Skip to content

Commit

Permalink
Fixed #6353: better handle unicode in exception reasons.
Browse files Browse the repository at this point in the history
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8560 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
jacobian committed Aug 25, 2008
1 parent 3deff41 commit ddb3cdd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions django/views/debug.py
Expand Up @@ -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')

Expand Down Expand Up @@ -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(),
Expand Down

0 comments on commit ddb3cdd

Please sign in to comment.