From 9eec3b68ebca42656ca15d50bbb1dd6b22ab95a7 Mon Sep 17 00:00:00 2001 From: Alexey Homza Date: Tue, 18 Feb 2014 11:33:15 +0200 Subject: Update forms.py Fix UnicodeDecodeError exception when sql params has unicode characters--- debug_toolbar/panels/sql/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debug_toolbar/panels/sql/forms.py b/debug_toolbar/panels/sql/forms.py index 582f611..58a4dba 100644 --- a/debug_toolbar/panels/sql/forms.py +++ b/debug_toolbar/panels/sql/forms.py @@ -80,7 +80,7 @@ class SQLSelectForm(forms.Form): items = [settings.SECRET_KEY, data['sql'], data['params']] # Replace lines endings with spaces to preserve the hash value # even when the browser normalizes \r\n to \n in inputs. - items = [force_text(' '.join(item.splitlines())) for item in items] + items = [' '.join(force_text(item).splitlines()) for item in items] return hashlib.sha1(''.join(items).encode('utf-8')).hexdigest() @property -- cgit v1.2.3