classification
Title: warnings.warn_explicit with module_globals=True raises a SystemError
Type: crash Stage: resolved
Components: Interpreter Core Versions: Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: hawkowl, miss-islington, ned.deily, serhiy.storchaka, vstinner
Priority: Keywords: patch

Created on 2018-05-14 21:09 by hawkowl, last changed 2018-06-04 20:44 by vstinner. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 6833 merged vstinner, 2018-05-14 21:31
PR 6870 merged miss-islington, 2018-05-15 18:43
PR 7365 merged vstinner, 2018-06-03 22:21
PR 7384 merged miss-islington, 2018-06-04 06:42
Messages (11)
msg316578 - (view) Author: Amber Brown (hawkowl) * Date: 2018-05-14 21:09
Reproducible with:

import warnings
warnings.warn_explicit("msg", DeprecationWarning, "name", 1, module_globals=None)
msg316579 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-05-14 21:09
It may be related to:

commit d4f8480dfe89447587550a85b61d4e9faf827e98
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. (#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.
msg316581 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-05-14 21:12
I choose the release blocker priority, since IMHO it's an easy fix.
msg316586 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-05-14 21:51
This bug was before commit d4f8480dfe89447587550a85b61d4e9faf827e98.
msg316693 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-05-15 18:42
New changeset b056562860c227bad2e0ba7cd3130e115c007768 by Victor Stinner in branch 'master':
bpo-33509: Fix _warnings for module_globals=None (#6833)
https://github.com/python/cpython/commit/b056562860c227bad2e0ba7cd3130e115c007768
msg316726 - (view) Author: miss-islington (miss-islington) Date: 2018-05-15 20:56
New changeset 820219f7867f2bbfe0ac4d4f0d1ea1fdef7795a9 by Miss Islington (bot) in branch '3.7':
bpo-33509: Fix _warnings for module_globals=None (GH-6833)
https://github.com/python/cpython/commit/820219f7867f2bbfe0ac4d4f0d1ea1fdef7795a9
msg316801 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2018-05-16 12:16
Thanks for the report and thanks for the fix!
msg318564 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-06-03 15:56
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

----------------------------------------------------------------------
msg318632 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2018-06-04 05:14
New changeset e292b75e3ecdc6bbe81cda09de836dc9e27ab9e6 by Ned Deily (Victor Stinner) in branch 'master':
bpo-33509: Fix test_warnings for python3 -Werror (GH-7365)
https://github.com/python/cpython/commit/e292b75e3ecdc6bbe81cda09de836dc9e27ab9e6
msg318682 - (view) Author: miss-islington (miss-islington) Date: 2018-06-04 17:23
New changeset d2c6ecc234e705b60cbcbb9dd4c99022407d0dd0 by Miss Islington (bot) in branch '3.7':
bpo-33509: Fix test_warnings for python3 -Werror (GH-7365)
https://github.com/python/cpython/commit/d2c6ecc234e705b60cbcbb9dd4c99022407d0dd0
msg318700 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-06-04 20:44
> This test is failed with -We.

Thank you Serhiy for the bug report. It should now be fixed again.
History
Date User Action Args
2018-06-04 20:44:24vstinnersetstatus: open -> closed

messages: + msg318700
stage: patch review -> resolved
2018-06-04 17:23:43miss-islingtonsetmessages: + msg318682
2018-06-04 06:42:52miss-islingtonsetpull_requests: + pull_request7010
2018-06-04 05:14:49ned.deilysetmessages: + msg318632
2018-06-03 22:21:39vstinnersetstage: resolved -> patch review
pull_requests: + pull_request6991
2018-06-03 15:56:37serhiy.storchakasetstatus: closed -> open

messages: + msg318564
2018-05-16 12:16:51ned.deilysetstatus: open -> closed
priority: release blocker ->
messages: + msg316801

resolution: fixed
stage: patch review -> resolved
2018-05-15 20:56:30miss-islingtonsetnosy: + miss-islington
messages: + msg316726
2018-05-15 18:43:44miss-islingtonsetpull_requests: + pull_request6544
2018-05-15 18:42:14vstinnersetmessages: + msg316693
2018-05-14 21:51:25serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg316586
2018-05-14 21:31:32vstinnersetkeywords: + patch
stage: patch review
pull_requests: + pull_request6516
2018-05-14 21:12:04vstinnersetpriority: normal -> release blocker
nosy: + ned.deily
messages: + msg316581

2018-05-14 21:09:25vstinnersetnosy: + vstinner
messages: + msg316579
2018-05-14 21:09:06hawkowlcreate