Code

Opened 3 years ago

Closed 3 years ago

#16894 closed Bug (duplicate)

UnicodeDecodeError handled incorrectly in WSGIHandler.__call__()

Reported by: RoySmith Owned by: nobody
Component: Core (Other) Version: 1.3
Severity: Release blocker Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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

Attachments (0)

Change History (1)

comment:1 Changed 3 years ago by carljm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

This is a duplicate of #15672 and is already fixed in trunk (r15918). Thanks for the report!

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.