summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2008-08-25 22:47:07 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2008-08-25 22:47:07 +0000
commitddb3cdd514588bfae7a44ee6b1a12857e8833cf1 (patch)
treeb6d8f20682c8d129f69cccce23865d6d3d18f42c
parent3deff41a32637f22aa393d5b10bdc43f5911d95e (diff)
Fixed #6353: better handle unicode in exception reasons.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8560 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/views/debug.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/views/debug.py b/django/views/debug.py
index 72631b35a7..0370204764 100644
--- a/django/views/debug.py
+++ b/django/views/debug.py
@@ -7,7 +7,7 @@ from django.conf import settings
from django.template import Template, Context, TemplateDoesNotExist
from django.utils.html import escape
from django.http import HttpResponse, HttpResponseServerError, HttpResponseNotFound
-from django.utils.encoding import smart_unicode
+from django.utils.encoding import smart_unicode, smart_str
HIDDEN_SETTINGS = re.compile('SECRET|PASSWORD|PROFANITIES_LIST')
@@ -256,7 +256,7 @@ def technical_404_response(request, exception):
'root_urlconf': settings.ROOT_URLCONF,
'request_path': request.path[1:], # Trim leading slash
'urlpatterns': tried,
- 'reason': str(exception),
+ 'reason': smart_str(exception, errors='replace'),
'request': request,
'request_protocol': request.is_secure() and "https" or "http",
'settings': get_safe_settings(),