Skip to content

test_interpreters has side effects on test_signal #88129

Closed

Description

@vstinner
BPO 43963
Nosy @vstinner, @Theelgirl
PRs
  • bpo-43963: import _signal in subinterpreter has no side effect #25674
  • bpo-43963: Add a module state to _signal #25676
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2021-04-27.23:51:03.344>
    created_at = <Date 2021-04-27.22:58:44.092>
    labels = ['tests', '3.10']
    title = 'test_interpreters has side effects on test_signal'
    updated_at = <Date 2021-05-03.18:55:28.123>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2021-05-03.18:55:28.123>
    actor = 'Theelgirl'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-04-27.23:51:03.344>
    closer = 'vstinner'
    components = ['Tests']
    creation = <Date 2021-04-27.22:58:44.092>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 43963
    keywords = ['patch']
    message_count = 7.0
    messages = ['392147', '392148', '392151', '392152', '392155', '392160', '392834']
    nosy_count = 2.0
    nosy_names = ['vstinner', 'Theelgirl']
    pr_nums = ['25674', '25676']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue43963'
    versions = ['Python 3.10']

    Activity

    1. vstinner commented on Apr 27, 2021

      @vstinner
      MemberAuthor

      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

    2. vstinner commented on Apr 27, 2021

      @vstinner
      MemberAuthor

      See also bpo-43962: "test_interpreters: when TestInterpreterAttrs.test_id_type() is run alone, it fails with an assertion error".

    3. vstinner commented on Apr 27, 2021

      @vstinner
      MemberAuthor

      See also bpo-43955: "Windows: Running the Python test suite sequentially is interrupted by (Pdb) prompt".

    4. vstinner commented on Apr 27, 2021

      @vstinner
      MemberAuthor

      This issue is a follow-up of bpo-41713:

      commit 7f9b25a
      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>
      
    5. vstinner commented on Apr 27, 2021

      @vstinner
      MemberAuthor

      New changeset a09766d by Victor Stinner in branch 'master':
      bpo-43963: Fix import _signal in subinterpreters (GH-25674)
      a09766d

    6. vstinner commented on Apr 28, 2021

      @vstinner
      MemberAuthor

      New changeset a5e6444 by Victor Stinner in branch 'master':
      bpo-43963: Add _signal module state (GH-25676)
      a5e6444

    7. Theelgirl commented on May 3, 2021

      Theelgirlmannequin
      Mannequin

      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.

    8. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.10 (EOL)end of lifetestsTests in the Lib/test dir

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions