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: test_interpreters has side effects on test_signal
Type: Stage: resolved
Components: Tests Versions: Python 3.10
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Theelgirl, vstinner
Priority: normal Keywords: patch

Created on 2021-04-27 22:58 by vstinner, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 25674 merged vstinner, 2021-04-27 23:26
PR 25676 merged vstinner, 2021-04-28 00:33
Messages (7)
msg392147 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-04-27 22:58
vstinner@DESKTOP-DK7VBIL C:\vstinner\python\master>type bisect3
test.test_signal.RaiseSignalTest.test_handler
test.test_interpreters.TestInterpreterAttrs.test_main_id
test.test_interpreters.TestInterpreterClose.test_from_sibling

vstinner@DESKTOP-DK7VBIL C:\vstinner\python\master>python -m test test_interpreters test_signal --matchfile=bisect3 -v
Running Debug|x64 interpreter...
== CPython 3.10.0a7+ (heads/master:6bd9288b80, Apr 27 2021, 22:54:42) [MSC v.1928 64 bit (AMD64)]
== Windows-10-10.0.19042-SP0 little-endian
== cwd: C:\vstinner\python\master\build\test_python_5756æ
== CPU count: 2
== encodings: locale=cp1252, FS=utf-8
0:00:00 Run tests sequentially
0:00:00 [1/2] test_interpreters
test_main_id (test.test_interpreters.TestInterpreterAttrs) ... ok
test_from_sibling (test.test_interpreters.TestInterpreterClose) ... ok

----------------------------------------------------------------------

Ran 2 tests in 0.277s

OK
0:00:00 [2/2] test_signal
test_handler (test.test_signal.RaiseSignalTest) ... ERROR

======================================================================
ERROR: test_handler (test.test_signal.RaiseSignalTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\vstinner\python\master\lib\signal.py", line 47, in signal
    handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
TypeError: signal handler must be signal.SIG_IGN, signal.SIG_DFL, or a callable object

----------------------------------------------------------------------

Ran 1 test in 0.004s

FAILED (errors=1)
test test_signal failed
test_signal failed

== Tests result: FAILURE ==

1 test OK.

1 test failed:
    test_signal

Total duration: 689 ms
Tests result: FAILURE
msg392148 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-04-27 22:59
See also bpo-43962: "test_interpreters: when TestInterpreterAttrs.test_id_type() is run alone, it fails with an assertion error".
msg392151 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-04-27 23:32
See also bpo-43955: "Windows: Running the Python test suite sequentially is interrupted by (Pdb) prompt".
msg392152 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-04-27 23:34
This issue is a follow-up of bpo-41713:

commit 7f9b25a21ab95f8cf8d663396993766307be475c
Author: Victor Stinner <vstinner@python.org>
Date:   Tue Nov 17 23:28:25 2020 +0100

    bpo-41713: Port _signal module to multi-phase init (GH-23355)
    
    Port the _signal extension module to the multi-phase initialization
    API (PEP 489).
    
    Co-Authored-By: Mohamed Koubaa <koubaa.m@gmail.com>
msg392155 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-04-27 23:50
New changeset a09766deab5aff549f40f27080895e148af922ed by Victor Stinner in branch 'master':
bpo-43963: Fix import _signal in subinterpreters (GH-25674)
https://github.com/python/cpython/commit/a09766deab5aff549f40f27080895e148af922ed
msg392160 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-04-28 01:03
New changeset a5e64444e6df7d1d498576bab26deaddc288a7bd by Victor Stinner in branch 'master':
bpo-43963: Add _signal module state (GH-25676)
https://github.com/python/cpython/commit/a5e64444e6df7d1d498576bab26deaddc288a7bd
msg392834 - (view) Author: Theelgirl (Theelgirl) * Date: 2021-05-03 18:55
Sorry if I'm not supposed to open closed issues, however I believe there's a typo in the whatsnew page for this. In https://docs.python.org/3.10/whatsnew/changelog.html#changelog, the entry for bpo-43963 says "Importing the signal module in a subinterpreter has no longer side effects.", however I believe it should be "Importing the signal module in a subinterpreter no longer has side effects". The only difference is that "has" is moved after "no longer" instead of before.
History
Date User Action Args
2022-04-11 14:59:44adminsetgithub: 88129
2021-05-03 18:55:28Theelgirlsetnosy: + Theelgirl
messages: + msg392834
2021-04-28 01:03:04vstinnersetmessages: + msg392160
2021-04-28 00:33:40vstinnersetpull_requests: + pull_request24367
2021-04-27 23:51:03vstinnersetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-04-27 23:50:08vstinnersetmessages: + msg392155
2021-04-27 23:34:10vstinnersetmessages: + msg392152
2021-04-27 23:32:50vstinnersetmessages: + msg392151
2021-04-27 23:26:09vstinnersetkeywords: + patch
stage: patch review
pull_requests: + pull_request24365
2021-04-27 22:59:18vstinnersetmessages: + msg392148
2021-04-27 22:58:44vstinnercreate