summaryrefslogtreecommitdiff
path: root/django/utils/log.py
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2014-10-06 16:07:20 -0400
committerTim Graham <timograham@gmail.com>2014-10-06 17:35:53 -0400
commit9dff5ce7c70780f4ee91567d98dba227093b49e2 (patch)
treead4132cc05dd6ddb5d50a6e64da3b950c2a8ad7d /django/utils/log.py
parent6f6e7d01dce94668e178b26da547c4643ed3a6cc (diff)
Fixed #23593 -- Fixed crash in AdminEmailHandler with non-ASCII characters in request.
Thanks edevil for the report and Simon Charette for review.
Diffstat (limited to 'django/utils/log.py')
-rw-r--r--django/utils/log.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/django/utils/log.py b/django/utils/log.py
index f2813f4175..a2296a3281 100644
--- a/django/utils/log.py
+++ b/django/utils/log.py
@@ -1,3 +1,5 @@
+from __future__ import unicode_literals
+
import logging
import sys
import warnings
@@ -6,6 +8,7 @@ from django.conf import settings
from django.core import mail
from django.core.mail import get_connection
from django.utils.deprecation import RemovedInNextVersionWarning
+from django.utils.encoding import force_text
from django.utils.module_loading import import_string
from django.views.debug import ExceptionReporter, get_exception_reporter_filter
@@ -106,7 +109,7 @@ class AdminEmailHandler(logging.Handler):
record.getMessage()
)
filter = get_exception_reporter_filter(request)
- request_repr = '\n{0}'.format(filter.get_request_repr(request))
+ request_repr = '\n{0}'.format(force_text(filter.get_request_repr(request)))
except Exception:
subject = '%s: %s' % (
record.levelname,