Merge pull request #27 from return42/fix-debug-log

[fix] debug log: UnicodeEncodeError: 'ascii' codec can't encode
This commit is contained in:
Alexandre Flament 2021-04-26 13:50:29 +02:00 committed by GitHub
commit 12bdf7146b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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