New submission from Michael Simacek <michael.sima...@oracle.com>:
I belive the python traceback module was designed to produce the same output as the internal exception printer (sys.__excepthook__), but this is not the case when the exception's __str__ raises an exception. Given an exception of the following class: class E(Exception): def __str__(self): raise RuntimeError Internal printer output: Traceback (most recent call last): File "inconsistent.py", line 6, in <module> raise E() __main__.E: <exception str() failed> traceback.print_exc output: Traceback (most recent call last): File "inconsistent.py", line 6, in <module> raise E() E: <unprintable E object> ---------- components: Library (Lib) messages: 371855 nosy: msimacek priority: normal severity: normal status: open title: Inconsistency in C and python traceback printers type: behavior versions: Python 3.10 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue41031> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com