#16674: Django's WSGI Handler should report exceptions to the start_response()
callback
-----------------------------------------+------------------------------
Reporter: jamesh | Owner: nobody
Type: Uncategorized | Status: new
Milestone: | Component: Core (Other)
Version: SVN | Severity: Normal
Resolution: | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------------
Comment (by jamesh):
By my reading of the WSGI spec, that is not the case. If the app does
something like the following, then the container will render the custom
error page:
{{{
def simple_app(environ, start_response):
try:
raise RuntimeError()
except RuntimeError:
start_response('500 Internal Error', [('Content-type',
'text/plain')],
sys.exc_info())
return ['Custom error message']
}}}
The spec only says that the container may re-raise the exception if the
headers have already been sent, which is clearly not the case if the app
only calls start_response() once, as Django's WSGIHandler does. This
seems pretty clear from both the wording in the PEP and the wsgiref
reference implementation.
--
Ticket URL: <https://code.djangoproject.com/ticket/16674#comment:4>
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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.