Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
hawkowl mannequin opened this issue May 14, 2018 · 11 comments
Closed

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

hawkowl mannequin opened this issue May 14, 2018 · 11 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@hawkowl
Copy link
Mannequin

hawkowl mannequin commented May 14, 2018

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']

    @hawkowl
    Copy link
    Mannequin Author

    hawkowl mannequin commented May 14, 2018

    Reproducible with:

    import warnings
    warnings.warn_explicit("msg", DeprecationWarning, "name", 1, module_globals=None)

    @hawkowl hawkowl mannequin added 3.7 (EOL) end of life 3.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-crash A hard crash of the interpreter, possibly with a core dump labels May 14, 2018
    @vstinner
    Copy link
    Member

    It may be related to:

    commit d4f8480
    Author: Serhiy Storchaka <storchaka@gmail.com>
    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.
    

    @vstinner
    Copy link
    Member

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

    @serhiy-storchaka
    Copy link
    Member

    This bug was before commit d4f8480.

    @vstinner
    Copy link
    Member

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

    @miss-islington
    Copy link
    Contributor

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

    @ned-deily
    Copy link
    Member

    Thanks for the report and thanks for the fix!

    @serhiy-storchaka
    Copy link
    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

    @ned-deily
    Copy link
    Member

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

    @miss-islington
    Copy link
    Contributor

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

    @vstinner
    Copy link
    Member

    vstinner commented Jun 4, 2018

    This test is failed with -We.

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

    @vstinner vstinner closed this as completed Jun 4, 2018
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life 3.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-crash A hard crash of the interpreter, possibly with a core dump
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants