Skip to content

bpo-30654: Do not reset SIGINT handler to SIG_DFL in finisignal #7146

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

Merged
merged 1 commit into from
Jun 1, 2018
Merged

bpo-30654: Do not reset SIGINT handler to SIG_DFL in finisignal #7146

merged 1 commit into from
Jun 1, 2018

Conversation

yol
Copy link

@yol yol commented May 28, 2018

Instead of saving old_siginthandler which will always be SIG_DFL, just use the normal reset code. This means that SIGINT will not be reset to SIG_DFL if it had a custom C handler during initialization, since func will be Py_None then.

I'm not sure if this is the intended behavior. But the prior behavior was broken, so it's an improvement.

https://bugs.python.org/issue30654

Supersedes #2162 (now for master branch)

https://bugs.python.org/issue30654

@yol
Copy link
Author

yol commented May 28, 2018

@pitrou Now let's get this in before procedure changes again ;-)

@pitrou
Copy link
Member

pitrou commented Jun 1, 2018

Ok, I'm gonna merge. I sincerely hope this doesn't cause any regression.
Unfortunately, the signal restore logic is a bit murky, as the handlers array doesn't make any difference between the original signal handlers and the signal handlers that may have been set by calling signal.signal from Python code.

@pitrou pitrou merged commit e905c84 into python:master Jun 1, 2018
@miss-islington
Copy link
Contributor

Thanks @pkerling for the PR, and @pitrou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 1, 2018
…onGH-7146)

(cherry picked from commit e905c84)

Co-authored-by: pkerling <pkerling@casix.org>
@bedevere-bot
Copy link

GH-7306 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 1, 2018
…onGH-7146)

(cherry picked from commit e905c84)

Co-authored-by: pkerling <pkerling@casix.org>
@bedevere-bot
Copy link

GH-7307 is a backport of this pull request to the 3.6 branch.

pitrou pushed a commit that referenced this pull request Jun 1, 2018
) (GH-7306)

(cherry picked from commit e905c84)

Co-authored-by: pkerling <pkerling@casix.org>
pitrou pushed a commit that referenced this pull request Jun 1, 2018
) (GH-7307)

(cherry picked from commit e905c84)

Co-authored-by: pkerling <pkerling@casix.org>
@yol
Copy link
Author

yol commented Jun 1, 2018

@pitrou Thanks a lot! Glad this made it for 3.7.

@miss-islington
Copy link
Contributor

Thanks @pkerling for the PR, and @pitrou for merging it 🌮🎉.. I'm working now to backport this PR to: 2.7.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry, @pkerling and @pitrou, I could not cleanly backport this to 2.7 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker e905c84494526363086f66a979e317e155bf9536 2.7

pitrou pushed a commit to pitrou/cpython that referenced this pull request Jun 2, 2018
pitrou added a commit to pitrou/cpython that referenced this pull request Jun 2, 2018
@bedevere-bot
Copy link

GH-7347 is a backport of this pull request to the 2.7 branch.

pitrou added a commit that referenced this pull request Jun 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants