Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Draft
user202729 wants to merge1 commit intomatplotlib:main
base:main
Choose a base branch
Loading
fromuser202729:handler

Conversation

user202729
Copy link

@user202729user202729 commentedApr 18, 2025
edited
Loading

Previously,cysignals signal handlers are broken afterplt.pause() is called. More explanation can be found insagemath/sage#39601 andsagemath/cysignals#228

The change was adapted fromprompt-toolkit/python-prompt-toolkit#1822

PR checklist

Copy link

@github-actionsgithub-actionsbot left a 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.

@tacaswell
Copy link
Member

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).

user202729 reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@github-actionsgithub-actions[bot]github-actions[bot] left review comments

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Projects
Status: Waiting for author
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@user202729@tacaswell@QuLogic

[8]ページ先頭

©2009-2025 Movatter.jp