Skip to content

bpo-36829: Add a -X option to abort in PyErr_WriteUnraisable() #13175

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

Conversation

ZackerySpytz
Copy link
Contributor

@ZackerySpytz ZackerySpytz commented May 7, 2019

Add a -X command-line option to abort the current process
if PyErr_WriteUnraisable() is called.

https://bugs.python.org/issue36829

Add a -X command-line option to abort the current process
if PyErr_WriteUnraisable() is called.
@matrixise
Copy link
Member

Hi @ZackerySpytz

Do you think you could add a test?

@vstinner
Copy link
Member

vstinner commented May 7, 2019

I am not sure I like this feature. Would it make sense to add a callback instead, like sys.excepthook? The callback could log the error, do nothing, abort the process, call the police, etc. It might be more general, no?

@graingert
Copy link
Contributor

@vstinner PyErr_WriteUnraisable can get called during __del__ or GC so most of the python environment could have already been deleted by the time the hook is called,

Or the hook could be called after the hook is removed by GC and then we're back to the same problem

@vstinner
Copy link
Member

I merged my PR #13187 instead, so I reject this PR. See https://bugs.python.org/issue36829#msg343201 for the rationale.

@vstinner vstinner closed this May 22, 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.

6 participants