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 Joel Croteau
Recipients Joel Croteau
Date 2019-04-19.01:36:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <[email protected]>
In-reply-to
Content
This has been commented on numerous times by others (https://stackoverflow.com/questions/2829329/catch-a-threads-exception-in-the-caller-thread-in-python, http://benno.id.au/blog/2012/10/06/python-thread-exceptions, to name a few), but there is no in-built mechanism in threading to catch an unhandled exception thrown by a thread. The default behavior of dumping to stderr is completely useless for error handling in many scenarios. Solutions do exist, but I have yet to see one that is not exceptionally complicated. It seems like checking for exceptions should be a very basic part of any threading library. The simplest solution would be to just have the Thread store any unhandled exceptions and have them raised by Thread.join(). There could also be additional methods to check if exceptions were raised.
History
Date User Action Args
2019-04-19 01:36:15Joel Croteausetrecipients: + Joel Croteau
2019-04-19 01:36:15Joel Croteausetmessageid: <[email protected]>
2019-04-19 01:36:15Joel Croteaulinkissue36666 messages
2019-04-19 01:36:15Joel Croteaucreate