Skip to content

warnings.warn_explicit with module_globals=True raises a SystemError #77690

Closed

Description

@hawkowl
mannequin
BPO 33509
Nosy @vstinner, @ned-deily, @serhiy-storchaka, @hawkowl, @miss-islington
PRs
  • bpo-33509: Fix _warnings for module_globals=None #6833
  • [3.7] bpo-33509: Fix _warnings for module_globals=None (GH-6833) #6870
  • bpo-33509: Fix test_warnings for python3 -Werror #7365
  • [3.7] bpo-33509: Fix test_warnings for python3 -Werror (GH-7365) #7384
  • 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 2018-06-04.20:44:24.857>
    created_at = <Date 2018-05-14.21:09:06.413>
    labels = ['interpreter-core', '3.7', '3.8', 'type-crash']
    title = 'warnings.warn_explicit with module_globals=True raises a SystemError'
    updated_at = <Date 2018-06-04.20:44:24.855>
    user = 'https://github.com/hawkowl'

    bugs.python.org fields:

    activity = <Date 2018-06-04.20:44:24.855>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-06-04.20:44:24.857>
    closer = 'vstinner'
    components = ['Interpreter Core']
    creation = <Date 2018-05-14.21:09:06.413>
    creator = 'hawkowl'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 33509
    keywords = ['patch']
    message_count = 11.0
    messages = ['316578', '316579', '316581', '316586', '316693', '316726', '316801', '318564', '318632', '318682', '318700']
    nosy_count = 5.0
    nosy_names = ['vstinner', 'ned.deily', 'serhiy.storchaka', 'hawkowl', 'miss-islington']
    pr_nums = ['6833', '6870', '7365', '7384']
    priority = None
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'crash'
    url = 'https://bugs.python.org/issue33509'
    versions = ['Python 3.7', 'Python 3.8']

    Activity

    1. hawkowl commented on May 14, 2018

      hawkowlmannequin
      MannequinAuthor

      Reproducible with:

      import warnings
      warnings.warn_explicit("msg", DeprecationWarning, "name", 1, module_globals=None)
    2. added
      interpreter-core(Objects, Python, Grammar, and Parser dirs)
      type-crashA hard crash of the interpreter, possibly with a core dump
      on May 14, 2018
    3. vstinner commented on May 14, 2018

      @vstinner
      Member

      It may be related to:

      commit d4f8480
      Author: Serhiy Storchaka <[email protected]>
      Date: Sat Nov 11 15:19:47 2017 +0200

      bpo-31572: Don't silence unexpected errors in the _warnings module. (bpo-3731)
      
      Get rid of _PyObject_HasAttrId() and PyDict_GetItemString().
      Silence only expected AttributeError, KeyError and ImportError when
      get an attribute, look up in a dict or import a module.
      
    4. vstinner commented on May 14, 2018

      @vstinner
      Member

      I choose the release blocker priority, since IMHO it's an easy fix.

    5. serhiy-storchaka commented on May 14, 2018

      @serhiy-storchaka
      Member

      This bug was before commit d4f8480.

    6. vstinner commented on May 15, 2018

      @vstinner
      Member

      New changeset b056562 by Victor Stinner in branch 'master':
      bpo-33509: Fix _warnings for module_globals=None (bpo-6833)
      b056562

    7. miss-islington commented on May 15, 2018

      @miss-islington
      Contributor

      New changeset 820219f by Miss Islington (bot) in branch '3.7':
      bpo-33509: Fix _warnings for module_globals=None (GH-6833)
      820219f

    8. ned-deily commented on May 16, 2018

      @ned-deily
      Member

      Thanks for the report and thanks for the fix!

    9. serhiy-storchaka commented on Jun 3, 2018

      @serhiy-storchaka
      Member

      This test is failed with -We.

      $ ./python -We -m test -v test_warnings
      ...

      ======================================================================
      ERROR: test_module_globals (test.test_warnings.CFilterTests)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "/home/serhiy/py/cpython/Lib/test/test_warnings/__init__.py", line 226, in test_module_globals
          module_globals=None)
      UserWarning: msg

      ======================================================================
      ERROR: test_module_globals (test.test_warnings.PyFilterTests)
      ----------------------------------------------------------------------

      Traceback (most recent call last):
        File "/home/serhiy/py/cpython/Lib/test/test_warnings/__init__.py", line 226, in test_module_globals
          module_globals=None)
        File "/home/serhiy/py/cpython/Lib/warnings.py", line 375, in warn_explicit
          raise message
      UserWarning: msg

    10. ned-deily commented on Jun 4, 2018

      @ned-deily
      Member

      New changeset e292b75 by Ned Deily (Victor Stinner) in branch 'master':
      bpo-33509: Fix test_warnings for python3 -Werror (GH-7365)
      e292b75

    11. miss-islington commented on Jun 4, 2018

      @miss-islington
      Contributor

      New changeset d2c6ecc by Miss Islington (bot) in branch '3.7':
      bpo-33509: Fix test_warnings for python3 -Werror (GH-7365)
      d2c6ecc

    12. vstinner commented on Jun 4, 2018

      @vstinner
      Member

      This test is failed with -We.

      Thank you Serhiy for the bug report. It should now be fixed again.

    13. 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.7 (EOL)end of life3.8 (EOL)end of lifeinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-crashA hard crash of the interpreter, possibly with a core dump

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions