[issue29183] Unintuitive error handling in wsgiref when a crash happens in write() or close()

Martin Panter report at bugs.python.org
Sun Nov 4 06:20:48 EST 2018


Martin Panter <vadmium+py at gmail.com> added the comment:

Looks like the error handling is broken by Issue 16220, which calls the “BaseHandler.close” method before the exception is caught for the error handler. Perhaps it is better to just close the iterator without messing with the other attributes in the exception case.

I tried various cases in Python 2.6 (without the Issue 16220 change) and the error handling seems better (not masked by double exceptions, no sending a 500 response after the start of the app’s response).

The same problem exists in Python 2, except only the later exception is reported, and the original exception is forgotten.

----------
keywords: +3.2regression
nosy: +martin.panter
type:  -> behavior
versions: +Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue29183>
_______________________________________


More information about the Python-bugs-list mailing list