#23593: UnicodeDecodeError when handling uncaught exception with UTF-8 in URL
-------------------------------+--------------------------------
Reporter: edevil | Owner: nobody
Type: Bug | Status: new
Component: HTTP handling | Version: master
Severity: Normal | Keywords: UnicodeDecodeError
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------
When DEBUG==False, there is UTF-8 in URL, and an uncaught exception
occurs:
{{{
Traceback (most recent call last):
File "/Users/andre/work/penv/discosite/lib/python2.7/site-
packages/django/core/handlers/wsgi.py", line 187, in __call__
response = self.get_response(request)
File "/Users/andre/work/penv/discosite/lib/python2.7/site-
packages/django/core/handlers/base.py", line 199, in get_response
response = self.handle_uncaught_exception(request, resolver,
sys.exc_info())
File "/Users/andre/work/penv/discosite/lib/python2.7/site-
packages/django/core/handlers/base.py", line 231, in
handle_uncaught_exception
'request': request
File
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py",
line 1175, in error
self._log(ERROR, msg, args, **kwargs)
File
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py",
line 1268, in _log
self.handle(record)
File
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py",
line 1278, in handle
self.callHandlers(record)
File
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py",
line 1318, in callHandlers
hdlr.handle(record)
File
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py",
line 749, in handle
self.emit(record)
File "/Users/andre/work/penv/discosite/lib/python2.7/site-
packages/django/utils/log.py", line 124, in emit
message = "%s\n\nRequest repr(): %s" % (self.format(record),
request_repr)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 30:
ordinal not in range(128)
}}}
Example request:
{{{
$ curl "http://localhost:8000/%5BSC%5D%20TIC%207%C2%BAC"
}}}
This did not happen < 1.7.
--
Ticket URL: <https://code.djangoproject.com/ticket/23593>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/049.6e82fe282e564f770d06af5ca01f85a9%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.