Opened 14 years ago
Closed 13 years ago
#15672 closed Bug (fixed)
wsgi handler bug in 1.3
Reported by: | vkryachko | Owned by: | vkryachko |
---|---|---|---|
Component: | Core (Other) | Version: | 1.3 |
Severity: | Release blocker | Keywords: | |
Cc: | kinpoo | Triage Stage: | Design decision needed |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
When environ cannot be parsed, the following exception i raised:
File "/var/www/dynamic/virtualenv/lib/python2.5/site-packages/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 (2)
Change History (13)
comment:1 by , 14 years ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Version: | 1.3-rc1 → 1.3 |
comment:2 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:3 by , 14 years ago
Resolution: | fixed |
---|---|
Severity: | → Normal |
Status: | closed → reopened |
Type: | → Bug |
Thanks for the fix, adrian. But looking at the 1.3.x branch, I see that this fix has not been backported there, so I think the issue has to be reopened. I would have backported it myself, but I don't have write access to the SVN. Regards
by , 14 years ago
Attachment: | ticket-15672.diff added |
---|
Removes references to request in the wsgi and mod_python handlers and adds a test
comment:5 by , 14 years ago
Has patch: | set |
---|---|
Resolution: | fixed |
Status: | closed → reopened |
'request' was referenced twice so the bug is still present (see test)
Same thing happens in the mod_python handler.
comment:6 by , 14 years ago
Easy pickings: | unset |
---|---|
Severity: | Normal → Release blocker |
comment:7 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
In [16082]:
(The changeset message doesn't reference this ticket)
comment:9 by , 13 years ago
Cc: | added |
---|---|
UI/UX: | unset |
- I think it might be handle as a bad URL and output 404 not found, but not 400 bad request.
- Sometimes, add some unnecessary information in URL for SEO reason, example: "/123-外贸", encoded as "/123-%E5%A4%96%E8%B4%B8", if it broken, looks like "/123-%E5", I can also get the correct resource and redirect to correct url.
by , 13 years ago
Attachment: | ticket-15672-force_unicode-with-ignore.diff added |
---|
ignore UnicodeDecodeError, does not handle it as bad request, let handle it as 404
comment:10 by , 13 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Triage Stage: | Accepted → Design decision needed |
comment:11 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
This ticket was about a straightforward bug: use of a variable before it had been set. The recent comments and re-opening of this ticket don't seem related to that simple bug, which has been fixed. If you think this area of the code has some other problem please open a new ticket to track that. Reclosing this ticket as fixed, because the UnboundLocalError has been fixed.
In [15918]: