Author: jacob
Date: 2008-08-25 17:47:07 -0500 (Mon, 25 Aug 2008)
New Revision: 8560
Modified:
django/trunk/django/views/debug.py
Log:
Fixed #6353: better handle unicode in exception reasons.
Modified: django/trunk/django/views/debug.py
===================================================================
--- django/trunk/django/views/debug.py 2008-08-25 22:43:25 UTC (rev 8559)
+++ django/trunk/django/views/debug.py 2008-08-25 22:47:07 UTC (rev 8560)
@@ -7,7 +7,7 @@
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 @@
'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(),
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---