Commit ed1c78d9 authored by yujunqiang's avatar yujunqiang

fix bug: TypeError: set(['bing', 'google']) is not JSON serializable, when...

fix bug: TypeError: set(['bing', 'google']) is not JSON serializable, when curl 'http://127.0.0.1:8888/?q=xxxxxxxx&categories=general&format=json'
parent 84e7b8ba
...@@ -541,7 +541,8 @@ def index(): ...@@ -541,7 +541,8 @@ def index():
'corrections': list(result_container.corrections), 'corrections': list(result_container.corrections),
'infoboxes': result_container.infoboxes, 'infoboxes': result_container.infoboxes,
'suggestions': list(result_container.suggestions), 'suggestions': list(result_container.suggestions),
'unresponsive_engines': list(result_container.unresponsive_engines)}), 'unresponsive_engines': list(result_container.unresponsive_engines)},
default=lambda item: list(item) if isinstance(item, set) else item),
mimetype='application/json') mimetype='application/json')
elif output_format == 'csv': elif output_format == 'csv':
csv = UnicodeWriter(StringIO()) csv = UnicodeWriter(StringIO())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment