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: unittest.installHandler incorrectly assumes SIGINT handler is set.
Type: crash Stage: resolved
Components: Tests Versions: Python 3.2, Python 3.3, Python 3.4, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: gregory.p.smith Nosy List: ezio.melotti, gregory.p.smith, michael.foord, python-dev, twouters
Priority: normal Keywords: needs review, patch

Created on 2012-07-30 16:37 by twouters, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
inthandler.patch twouters, 2012-07-31 00:24 review
Messages (6)
msg166910 - (view) Author: Thomas Wouters (twouters) * (Python committer) Date: 2012-07-30 16:37
unittest.installHandler incorrectly assumes signal.SIGINT will always be set to a callable object, rather than signal.SIG_DFL or signal.SIG_IGN. This breaks if the test is being executed in an environment that e.g. ignores signal.SIGINT, like a bash script that executes 'make' in a subshell, because an attempt to call the original handler (for whatever reason) causes it to try and call an integer.

On top of that, the *tests* for unittest.installHandler in unittest/tests/test_break.py assume not just that signal.SIGINT is set to a callable object, but that they're set to signal.default_int_handler.
msg166916 - (view) Author: Thomas Wouters (twouters) * (Python committer) Date: 2012-07-30 18:00
Patch attached.
msg166937 - (view) Author: Thomas Wouters (twouters) * (Python committer) Date: 2012-07-31 00:24
Updated patch.
msg180946 - (view) Author: Thomas Wouters (twouters) * (Python committer) Date: 2013-01-29 20:43
ping (you know why :)
msg180955 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-01-29 22:59
New changeset 7e4c5914ba76 by Michael Foord in branch '2.7':
Issue 15505. unittest.installHandler and non callable signal handlers
http://hg.python.org/cpython/rev/7e4c5914ba76
msg180956 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-01-29 23:08
New changeset 48c5c632d212 by Michael Foord in branch '3.2':
Closes issue 15505. unittest.installHandler and non-callable signal handlers.
http://hg.python.org/cpython/rev/48c5c632d212
History
Date User Action Args
2022-04-11 14:57:33adminsetgithub: 59710
2013-01-29 23:08:14python-devsetstatus: open -> closed
resolution: fixed
messages: + msg180956

stage: patch review -> resolved
2013-01-29 22:59:06python-devsetnosy: + python-dev
messages: + msg180955
2013-01-29 20:45:05pitrousetnosy: + ezio.melotti
2013-01-29 20:43:56twouterssetmessages: + msg180946
2012-09-30 10:18:28tomwardillsetnosy: + michael.foord
2012-07-31 00:24:13twouterssetfiles: - inthandler.patch
2012-07-31 00:24:02twouterssetfiles: + inthandler.patch

messages: + msg166937
2012-07-30 18:44:59gregory.p.smithsetkeywords: + needs review
assignee: gregory.p.smith

nosy: + gregory.p.smith
2012-07-30 18:00:05twouterssetfiles: + inthandler.patch
keywords: + patch
messages: + msg166916

stage: patch review
2012-07-30 16:37:01twouterscreate