From 9b3920646edde08d8fbb57c4b9f1d204fc83f09d Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Thu, 17 Oct 2013 21:55:34 +0200 Subject: Support non-ASCII queries in the SQL panel. Fix #28. --- debug_toolbar/utils/__init__.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'debug_toolbar/utils/__init__.py') diff --git a/debug_toolbar/utils/__init__.py b/debug_toolbar/utils/__init__.py index 297c901..75f3024 100644 --- a/debug_toolbar/utils/__init__.py +++ b/debug_toolbar/utils/__init__.py @@ -7,6 +7,7 @@ import sys from django.conf import settings from django.views.debug import linebreak_iter +from django.utils.encoding import force_text from django.utils.html import escape from django.utils.safestring import mark_safe from django.utils import six @@ -39,10 +40,7 @@ def tidy_stacktrace(stack): continue if socketserver_path in s_path: continue - if not text: - text = '' - else: - text = (''.join(text)).strip() + text = (''.join(force_text(t) for t in text)).strip() if text else '' trace.append((path, line_no, func_name, text)) return trace -- cgit v1.2.3