This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: traceback's rendering behavior while throwing custom exception
Type: enhancement Stage:
Components: Interpreter Core Versions: Python 3.1
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: Kain94, benjamin.peterson
Priority: normal Keywords:

Created on 2011-01-23 02:46 by Kain94, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
traceback_rendering.py Kain94, 2011-01-23 02:46 Two different raising exception case but same rendering behavior
Messages (2)
msg126871 - (view) Author: Benjamin VENELLE (Kain94) Date: 2011-01-23 02:46
Hi,

From few days, I've acknowledge when throwing an exception, the last traceback entry is always related to the raise statement. This is ok when the exception takes source from a non fail-safe code. But when an exception is raised due to a function's inputs sanity check (like an assertion error) the last traceback entry is non-sense. I've done a script to spot this behavior.

Is there a way to prevent last traceback rendering (not suppressing) while exception is displayed without explicit call to traceback.print_exception ? If not, it would be useful to have a boolean declared in Exception's classes which will allow last traceback entry rendering or not.
msg126872 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2011-01-23 04:04
Please see python-ideas list.
History
Date User Action Args
2022-04-11 14:57:11adminsetgithub: 55195
2011-01-23 04:04:17benjamin.petersonsetstatus: open -> closed

nosy: + benjamin.peterson
messages: + msg126872

resolution: rejected
2011-01-23 02:46:56Kain94create