Skip to content

bpo-1230540: Invoke custom sys.excepthook for threads in threading #8610

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

vlasovskikh
Copy link
Member

@vlasovskikh vlasovskikh commented Aug 1, 2018

Threads created via threading.Thread didn't invoke sys.excepthook if there was an uncaught exception. Since the docs for sys.excepthook are not specific about using it from threads and, in fact, this hook works for threads created via the _thread module, it makes sense to enable it the threading module as well.

https://bugs.python.org/issue1230540

Threads created via threading.Thread didn't invoke sys.excepthook if
there was an uncaught exception. Since the docs for sys.excepthook are
not specific about using it from threads and, in fact, this hook works
for threads created via the _thread module, it makes sense to enable it
the threading module as well.
@vstinner
Copy link
Member

I dislike this PR: threading.Thread doesn't call sys.excepthook to handle run() exception by default, it only calls sys.excepthook if it's overridden. Moreover, when sys.excepthook is called, the hook doesn't get access to the thread object :-(
https://bugs.python.org/issue1230540#msg343260

I proposed a different approach: PR #13515.

@vstinner
Copy link
Member

I merged a different approach: my PR #13515. Thanks @vlasovskikh anyway for working on this issue ;-)

@vstinner vstinner closed this May 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants