Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Restore OS-level signal handler after changing it in plt.pause()#29947
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thank you for opening your first PR into Matplotlib!
If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks.
You can also join uson gitter for real-time discussion.
For details on testing, writing docs, and our review process, please seethe developer guide
We strive to be a welcoming and open project. Please follow ourCode of Conduct.
Specificallyhttps://github.com/python/cpython/blob/ce31ae5209c976d28d1c21fcbb06c0ae5e50a896/Modules/signalmodule.c#L535-L538 is the source of the problem as (somewhat reasonably) CPython unconditionally takes over the underlying signal handling machinery when you register a Python side signal handler (if CPython does not do that it can not call the user provided handler for the user. Contrary to prompt-toolkit, we already have a fair amount of compiled code I would rather see a helper inhttps://github.com/matplotlib/matplotlib/blob/main/src/_c_internal_utils.cpp. This is both to avoid having ctypes in generally and because Python can be built without the ctypes module. Signal handling is a fun rabbit hole that I was sure we had already gotten to the bottom of (when we added checking to making sure that handler set from julia didn't get broken). |
Uh oh!
There was an error while loading.Please reload this page.
Previously,
cysignals
signal handlers are broken afterplt.pause()
is called. More explanation can be found insagemath/sage#39601 andsagemath/cysignals#228The change was adapted fromprompt-toolkit/python-prompt-toolkit#1822
PR checklist