Author vstinner
Recipients lazka, serhiy.storchaka, vstinner
Date 2019-05-28.22:14:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> Since the error handling for is written on Python there are many opportunities to get an exception in error handling: KeyboardInterrupt, MemoryError and, at the shutdown stage, maybe NameError, AttributeError or TypeError.

Sure, the risk is real, but I tried to minimize it.

NameError and AttributeError "should" not happen: I wrote _make_invoke_excepthook() to prevent name errors. Functions used to invoke threading.excepthook are "cached" in a private namespace. Moreover, the default hook is implemented in C also to reduce the risk of raising a new exception.

Anyway, if threading.excepthook() raises a second exception, sys.excepthook() is now called to handle it ;-) That's a Python 3.8 change. In Python 3.7 and older, new exception was handled by start_new_thread().
Date User Action Args
2019-05-28 22:14:44vstinnersetrecipients: + vstinner, serhiy.storchaka, lazka
2019-05-28 22:14:44vstinnersetmessageid: <>
2019-05-28 22:14:44vstinnerlinkissue37076 messages
2019-05-28 22:14:44vstinnercreate