summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2021-04-26 13:50:29 +0200
committerGitHub <noreply@github.com>2021-04-26 13:50:29 +0200
commit12bdf7146be23936ed7efc239c5fb4df868cd3f8 (patch)
tree9b995fa59df2264965b39cbe854d7354b5f447ec
parent51494849fc821fb9ef3d3738d96a86c4d48a5ca3 (diff)
parent1a402be175e20d27cb3c6d9b0c23dd4aaedc5c85 (diff)
downloadsearxng-12bdf7146be23936ed7efc239c5fb4df868cd3f8.tar.gz
searxng-12bdf7146be23936ed7efc239c5fb4df868cd3f8.zip
Merge pull request #27 from return42/fix-debug-log
[fix] debug log: UnicodeEncodeError: 'ascii' codec can't encode
-rwxr-xr-xsearx/webapp.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/searx/webapp.py b/searx/webapp.py
index 69ec915a7..70d2d662b 100755
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -54,6 +54,7 @@ from datetime import datetime, timedelta
from timeit import default_timer
from html import escape
from io import StringIO
+import urllib
from urllib.parse import urlencode, urlparse
from pygments import highlight
@@ -246,7 +247,10 @@ def get_locale():
request.form['use-translation'] = 'oc'
locale = 'fr_FR'
- logger.debug("%s uses locale `%s` from %s", request.url, locale, locale_source)
+ logger.debug(
+ "%s uses locale `%s` from %s", urllib.parse.quote(request.url), locale, locale_source
+ )
+
return locale