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.

Author msimacek
Recipients msimacek
Date 2020-06-19.08:54:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1592556858.95.0.825167658939.issue41031@roundup.psfhosted.org>
In-reply-to
Content
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>
History
Date User Action Args
2020-06-19 08:54:18msimaceksetrecipients: + msimacek
2020-06-19 08:54:18msimaceksetmessageid: <1592556858.95.0.825167658939.issue41031@roundup.psfhosted.org>
2020-06-19 08:54:18msimaceklinkissue41031 messages
2020-06-19 08:54:18msimacekcreate