From 58a630308a95f886db9de19d562e11890ac35e07 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Fri, 13 Mar 2020 00:57:01 +0100 Subject: [PATCH] [fix] convert query to string to produce valid filename for csv output --- searx/webapp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/searx/webapp.py b/searx/webapp.py index 49129d14e..0c5ed4570 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -643,7 +643,7 @@ def index(): csv.writerow([row.get(key, '') for key in keys]) csv.stream.seek(0) response = Response(csv.stream.read(), mimetype='application/csv') - cont_disp = 'attachment;Filename=searx_-_{0}.csv'.format(search_query.query) + cont_disp = 'attachment;Filename=searx_-_{0}.csv'.format(search_query.query.decode('utf-8')) response.headers.add('Content-Disposition', cont_disp) return response elif output_format == 'rss':