summaryrefslogtreecommitdiff
path: root/searx/webapp.py
diff options
context:
space:
mode:
authoryujunqiang <yujunqiang@baidu.com>2017-11-15 21:31:27 +0800
committeryujunqiang <yujunqiang@baidu.com>2017-11-15 21:31:27 +0800
commited1c78d92300948d9692f411e97db330de550726 (patch)
tree4b7f00e0b571c5e7c3b6f49ba1be6e0e50d0445a /searx/webapp.py
parent84e7b8bad10280e947d5dfff864630ee331da044 (diff)
downloadsearxng-ed1c78d92300948d9692f411e97db330de550726.tar.gz
searxng-ed1c78d92300948d9692f411e97db330de550726.zip
fix bug: TypeError: set(['bing', 'google']) is not JSON serializable, when curl 'http://127.0.0.1:8888/?q=xxxxxxxx&categories=general&format=json'
Diffstat (limited to 'searx/webapp.py')
-rw-r--r--searx/webapp.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/searx/webapp.py b/searx/webapp.py
index f81747325..371fb2a31 100644
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -541,7 +541,8 @@ def index():
'corrections': list(result_container.corrections),
'infoboxes': result_container.infoboxes,
'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')
elif output_format == 'csv':
csv = UnicodeWriter(StringIO())