This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: signal.signal should check tripped signals
Type: Stage: resolved
Components: Interpreter Core Versions: Python 3.7, Python 3.6, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: jdemeyer, pitrou
Priority: normal Keywords: patch

Created on 2017-04-12 15:52 by jdemeyer, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
fix30057-py2.patch jdemeyer, 2017-04-12 16:54 Patch for Python 2
fix30057-py3.patch jdemeyer, 2017-04-12 16:54 Patch for Python 3
Pull Requests
URL Status Linked Edit
PR 4258 merged pitrou, 2017-11-03 18:14
PR 4261 merged python-dev, 2017-11-03 18:59
PR 4263 merged pitrou, 2017-11-03 19:09
Messages (5)
msg291561 - (view) Author: Jeroen Demeyer (jdemeyer) * (Python triager) Date: 2017-04-12 15:52
There is a race condition in calling signal.signal() if the signal arrives while (or right before) signal.signal() is being executed: the function signal.signal(sig, action) marks the signal "sig" as not tripped. Because of this, signals can get lost. Instead, it would be better to call PyErr_CheckSignals() to check for pending signals.
msg305494 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2017-11-03 18:13
Thanks for the report! I will push your patch soon.
msg305497 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2017-11-03 18:58
New changeset f6f90ff079a22b79a58d47b6117cc8a8c7d366f3 by Antoine Pitrou in branch 'master':
bpo-30057: Fix potential missed signal in signal.signal(). (#4258)
https://github.com/python/cpython/commit/f6f90ff079a22b79a58d47b6117cc8a8c7d366f3
msg305499 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2017-11-03 19:23
New changeset ea80ae04e2ec68c7e289048d3224a24b3c3fb107 by Antoine Pitrou (Miss Islington (bot)) in branch '3.6':
bpo-30057: Fix potential missed signal in signal.signal(). (GH-4258) (#4261)
https://github.com/python/cpython/commit/ea80ae04e2ec68c7e289048d3224a24b3c3fb107
msg305501 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2017-11-03 19:36
New changeset c713837e91f39dc18740c74729cb7cebcf54fe6e by Antoine Pitrou in branch '2.7':
[2.7] bpo-30057: Fix potential missed signal in signal.signal(). (GH-4258) (#4263)
https://github.com/python/cpython/commit/c713837e91f39dc18740c74729cb7cebcf54fe6e
History
Date User Action Args
2022-04-11 14:58:45adminsetgithub: 74243
2017-11-03 19:36:58pitrousetstatus: open -> closed
stage: patch review -> resolved
resolution: fixed
versions: + Python 2.7
2017-11-03 19:36:41pitrousetmessages: + msg305501
2017-11-03 19:23:14pitrousetmessages: + msg305499
2017-11-03 19:10:00pitrousetpull_requests: + pull_request4225
2017-11-03 18:59:54python-devsetpull_requests: + pull_request4223
2017-11-03 18:58:49pitrousetmessages: + msg305497
2017-11-03 18:14:44pitrousetstage: patch review
pull_requests: + pull_request4220
2017-11-03 18:13:33pitrousetmessages: + msg305494
versions: + Python 3.6, Python 3.7, - Python 2.7, Python 3.5
2017-10-31 09:22:23vstinnersetnosy: + pitrou
2017-04-12 16:54:17jdemeyersetfiles: + fix30057-py3.patch
2017-04-12 16:54:05jdemeyersetfiles: + fix30057-py2.patch
keywords: + patch
2017-04-12 15:52:29jdemeyercreate