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 iritkatriel
Recipients iritkatriel
Date 2021-11-01.11:23:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1635765813.05.0.395181724494.issue45635@roundup.psfhosted.org>
In-reply-to
Content
It's more intricate than I initially thought - the assertion that no exception is set is in PyObject_Str rather than PyFile_WriteObject, and it should remain there because it ensures that exceptions are not accidentally cleared by an str() call.

In the traceback display code, there are places where the exception is cleared because it's being overridden (like when modulename is not found and is replace by "<unknown>") or places where the code makes a best-effort attempt to print something anyway. In these situations the error is cleared before calling PyFile_WriteObject. It is probably correct, but it's hard to follow the logic when making changes to the code, so it should be made more explicit.
History
Date User Action Args
2021-11-01 11:23:33iritkatrielsetrecipients: + iritkatriel
2021-11-01 11:23:33iritkatrielsetmessageid: <1635765813.05.0.395181724494.issue45635@roundup.psfhosted.org>
2021-11-01 11:23:33iritkatriellinkissue45635 messages
2021-11-01 11:23:32iritkatrielcreate