Issue 28795: Misleading stating, that SIGINT handler is installed by default (original) (raw)
Issue28795
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.
This issue has been migrated to GitHub: https://github.com/python/cpython/issues/72981
classification
Title: | Misleading stating, that SIGINT handler is installed by default | ||
---|---|---|---|
Type: | behavior | Stage: | resolved |
Components: | Documentation | Versions: | Python 3.7, Python 3.6, Python 3.3, Python 3.4, Python 3.5, Python 2.7 |
process
Status: | closed | Resolution: | fixed |
---|---|---|---|
Dependencies: | Superseder: | ||
Assigned To: | docs@python | Nosy List: | Jan Velecký, docs@python, mdk, miss-islington |
Priority: | normal | Keywords: | patch |
Created on 2016-11-24 22:25 by Jan Velecký, last changed 2022-04-11 14:58 by admin. This issue is now closed.
Files | |||
---|---|---|---|
File name | Uploaded | Description | Edit |
issue28795-tip.diff | mdk,2016-11-29 21:17 | review | |
issue28795-2.7.diff | mdk,2016-11-29 21:17 | review |
Pull Requests | |||
---|---|---|---|
URL | Status | Linked | Edit |
PR 13121 | merged | mdk,2019-05-06 17:40 | |
PR 13158 | merged | miss-islington,2019-05-07 15:28 |
Messages (7) | ||
---|---|---|
msg281664 - (view) | Author: Jan Velecký (Jan Velecký) | Date: 2016-11-24 22:25 |
Hello, documentation (https://docs.python.org/2/library/signal.html) states, that Python by default installs SIGINT handler which cause KeyboardInterrupt. This is not true everytime according to implementation. "Python installs a small number of signal handlers by default: SIGPIPE ... and SIGINT is translated into a KeyboardInterrupt exception." It should also mention this "SIGINT is installed only, when default handler is set at startup.". Because user can run python script from non-interative shell as background task and SIGINT handler is not installed, regardless although user does not change Python default behaviour. Related SO: http://stackoverflow.com/questions/40775054/capturing-sigint-using-keyboardinterrupt-exception-works-in-terminal-not-in-scr/40785230?noredirect=1 | ||
msg281671 - (view) | Author: Julien Palard (mdk) * ![]() |
Date: 2016-11-25 00:13 |
Maybe something like: > Python installs a small number of signal handlers by default: SIGPIPE is ignored (so write errors on pipes and sockets can be reported as ordinary Python exceptions) and SIGINT (if parent process has not changed it) is translated into a KeyboardInterrupt exception. All of these can be overridden. | ||
msg281728 - (view) | Author: Jan Velecký (Jan Velecký) | Date: 2016-11-25 16:32 |
That's good. | ||
msg282047 - (view) | Author: Julien Palard (mdk) * ![]() |
Date: 2016-11-29 21:17 |
Proposed as patches but english is not my native language so please review carefully. | ||
msg341749 - (view) | Author: Julien Palard (mdk) * ![]() |
Date: 2019-05-07 15:27 |
New changeset e85ef7a7eacdef2f43e6bf2e67f335100e7ef2da by Julien Palard in branch 'master': bpo-28795: Signal documentation: Fix misleading statement. (GH-13121) https://github.com/python/cpython/commit/e85ef7a7eacdef2f43e6bf2e67f335100e7ef2da | ||
msg341751 - (view) | Author: Julien Palard (mdk) * ![]() |
Date: 2019-05-07 15:29 |
Thanks for reporting Jan! It's finally merged \o/ | ||
msg341759 - (view) | Author: miss-islington (miss-islington) | Date: 2019-05-07 15:55 |
New changeset 721729fca4fab9fd11861844880b3f3780015ae0 by Miss Islington (bot) in branch '3.7': bpo-28795: Signal documentation: Fix misleading statement. (GH-13121) https://github.com/python/cpython/commit/721729fca4fab9fd11861844880b3f3780015ae0 |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-11 14:58:40 | admin | set | github: 72981 |
2019-05-07 15:55:42 | miss-islington | set | nosy: + miss-islingtonmessages: + |
2019-05-07 15:29:33 | mdk | set | status: open -> closedresolution: fixedmessages: + stage: backport needed -> resolved |
2019-05-07 15:28:21 | mdk | set | stage: patch review -> backport needed |
2019-05-07 15:28:00 | miss-islington | set | pull_requests: + <pull%5Frequest13075> |
2019-05-07 15:27:53 | mdk | set | messages: + |
2019-05-06 17:40:14 | mdk | set | stage: patch reviewpull_requests: + <pull%5Frequest13034> |
2016-11-29 21:17:55 | mdk | set | files: + issue28795-2.7.diff |
2016-11-29 21:17:43 | mdk | set | files: + issue28795-tip.diffkeywords: + patchmessages: + |
2016-11-25 16:32:40 | Jan Velecký | set | messages: + |
2016-11-25 00:13:05 | mdk | set | nosy: + mdkmessages: + |
2016-11-24 22:25:57 | Jan Velecký | create |
Supported by The Python Software Foundation,
Powered by Roundup
Copyright © 1990-2022, Python Software Foundation
Legal Statements