Opened 10 years ago
Closed 10 years ago
#24069 closed Bug (fixed)
Regression in ServerHandler.handler_error
Reported by: | Andreas Pelme | Owned by: | Andreas Pelme |
---|---|---|---|
Component: | Core (Other) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
9253042d53d61b23b3f727a00c41e8089be73836 which #4444 - silence broken pipe errors introduced a regression in the error handling on Python 2.x.
In Python 2.x, simple_server.ServerHandler
is and old style class. This makes it an error using super() to access the super class.
The solution is simple: explicitly call simple_server.ServerHandler.handle_error()
or inherit from object.
Change History (5)
comment:1 by , 10 years ago
Description: | modified (diff) |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:2 by , 10 years ago
comment:3 by , 10 years ago
For reference, here is a traceback where this fails:
The TestLiveServer.test_serve_static_dj17_without_staticfiles_app
failure from https://travis-ci.org/pytest-dev/pytest-django/jobs/45674534 shows this error in action. It is obscured by the exception munging that is done within simple_server
, though.
comment:4 by , 10 years ago
Has patch: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:5 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Here is a PR that makes ServerHandler a new style class which fixes the issue:
https://github.com/django/django/pull/3826
I am not sure how this can be tested. It is hard to test this since simple_server does some very nasty error handling (
except:
in a bunch of places and relies onsys.exc_info
).