﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
16894	UnicodeDecodeError handled incorrectly in WSGIHandler.__call__()	Roy Smith	nobody	"In django/core/handlers/wsgi.py, around line 262, is the following code:

{{{
           try:
                request = self.request_class(environ)
            except UnicodeDecodeError:
                logger.warning('Bad Request (UnicodeDecodeError): %s' % request.path,
}}}

when the exception is caught, request is undefined, leading to:

{{{
Traceback (most recent call last):
  File ""/usr/lib/pymodules/python2.6/django/core/servers/basehttp.py"", line 283, in run
    self.result = application(self.environ, self.start_response)
  File ""/usr/lib/pymodules/python2.6/django/contrib/staticfiles/handlers.py"", line 68, in __call__
    return self.application(environ, start_response)
  File ""/usr/lib/pymodules/python2.6/django/core/handlers/wsgi.py"", line 264, in __call__
    logger.warning('Bad Request (UnicodeDecodeError): %s' % request.path,
UnboundLocalError: local variable 'request' referenced before assignment
}}}


"	Bug	closed	Core (Other)	1.3	Release blocker	duplicate			Unreviewed	0	0	0	0	0	0
