#16894: UnicodeDecodeError handled incorrectly in WSGIHandler.__call__()
----------------------+---------------------------------
 Reporter:  RoySmith  |          Owner:  nobody
     Type:  Bug       |         Status:  new
Milestone:            |      Component:  Core (Other)
  Version:  1.3       |       Severity:  Release blocker
 Keywords:            |   Triage Stage:  Unreviewed
Has patch:  0         |  Easy pickings:  0
    UI/UX:  0         |
----------------------+---------------------------------
 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
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16894>
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to