You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
question about the decisions made in the repository
Do you want to request a feature or report a bug?
Report a bug.
What is the current behavior?
HookMap.run does not preserve traceback information when passing an exception.
If the exception is not HTTPError, HTTPRedirect, InternalRedirect, KeyboardInterrupt or SystemExit, it is logged with traceback through cherrypy.log, but then the exception is re-raised without preserving the original traceback.
If the current behavior is a bug, please provide the steps to reproduce and if possible a screenshots and logs of the problem. If you can, show us your code.
I could provide all that if that's really needed, but come on...
What is the expected behavior?
Re-raise exceptions from hooks in a way that preserves the original traceback.
What is the motivation / use case for changing the behavior?
Making it easier to debug tools from automated tests using webtest. In my environment, logging is suppressed to reduce noise, but then tracebacks originating from tools are lost.
FYI, for this bug or any that you would like to see in the 17 line, just target the PR at the maint/17.x branch, all commits which should be merged back into master.
I'm submitting a ...
Do you want to request a feature or report a bug?
Report a bug.
What is the current behavior?
HookMap.run
does not preserve traceback information when passing an exception.If the exception is not
HTTPError
,HTTPRedirect
,InternalRedirect
,KeyboardInterrupt
orSystemExit
, it is logged with traceback throughcherrypy.log
, but then the exception is re-raised without preserving the original traceback.If the current behavior is a bug, please provide the steps to reproduce and if possible a screenshots and logs of the problem. If you can, show us your code.
I could provide all that if that's really needed, but come on...
What is the expected behavior?
Re-raise exceptions from hooks in a way that preserves the original traceback.
What is the motivation / use case for changing the behavior?
Making it easier to debug tools from automated tests using
webtest
. In my environment, logging is suppressed to reduce noise, but then tracebacks originating from tools are lost.Please tell us about your environment:
Other information
The fix is trivial,
https://github.com/cherrypy/cherrypy/blob/master/cherrypy/_cprequest.py#L114
Replace with a bare
raise
statement.The bare
raise
statement was introduced in Python 1.5.1p1… It provides exactly the semantics wanted here.https://docs.python.org/release/1.5.1p1/ref/raise.html
https://docs.python.org/release/2.7.15/reference/simple_stmts.html#the-raise-statement
https://docs.python.org/release/3.7.2/reference/simple_stmts.html#the-raise-statement
PR upcoming.
The text was updated successfully, but these errors were encountered: