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 Andreas Pelme)

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 Andreas Pelme, 10 years ago

Description: modified (diff)
Owner: changed from nobody to Andreas Pelme
Status: newassigned

comment:2 by Andreas Pelme, 10 years ago

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 on sys.exc_info).

comment:3 by Andreas Pelme, 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 Claude Paroz, 10 years ago

Has patch: set
Triage Stage: UnreviewedAccepted

comment:5 by Tim Graham <timograham@…>, 10 years ago

Resolution: fixed
Status: assignedclosed

In 4ee06ec3fc8e94d164afbd2f9c880c60c658a9ac:

Fixed #24069 -- Made ServerHandler a new style class to fix super() call.

Note: See TracTickets for help on using tickets.
Back to Top