Author vstinner
Recipients lazka, serhiy.storchaka, vstinner
Date 2019-05-28.22:14:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1559081684.67.0.507685679311.issue37076@roundup.psfhosted.org>
In-reply-to
Content
> Since the error handling for threading.Thread.run() 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().
History
Date User Action Args
2019-05-28 22:14:44vstinnersetrecipients: + vstinner, serhiy.storchaka, lazka
2019-05-28 22:14:44vstinnersetmessageid: <1559081684.67.0.507685679311.issue37076@roundup.psfhosted.org>
2019-05-28 22:14:44vstinnerlinkissue37076 messages
2019-05-28 22:14:44vstinnercreate