Issue 31411: SystemError raised by warn_explicit() in case warnings.onceregistry is not a dict
Created on 2017-09-10 17:37 by Oren Milman, last changed 2022-04-11 14:58 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 3485 | merged | Oren Milman, 2017-09-10 20:13 | |
| PR 3493 | merged | serhiy.storchaka, 2017-09-11 06:40 | |
| PR 3494 | merged | serhiy.storchaka, 2017-09-11 06:43 | |
| Messages (4) | |||
|---|---|---|---|
| msg301822 - (view) | Author: Oren Milman (Oren Milman) * | Date: 2017-09-10 17:37 | |
The following code causes warn_explicit() (in Python/_warnings.c) to raise a SystemError: import warnings warnings.filterwarnings('once') warnings.onceregistry = None warnings.warn_explicit(message='foo', category=Warning, filename='bar', lineno=1, registry=None) this is because warn_explicit() assumes that warnings.onceregistry is a dict, and passes it to update_registry(), which passes it to already_warned(), which eventually passes it to _PyDict_SetItemId(), which raises the SystemError. |
|||
| msg301862 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2017-09-11 06:28 | |
New changeset 252033d50effa08046ac34fcc406bc99796ab88b by Serhiy Storchaka (Oren Milman) in branch 'master': bpo-31411: Prevent raising a SystemError in case warnings.onceregistry is not a dictionary. (#3485) https://github.com/python/cpython/commit/252033d50effa08046ac34fcc406bc99796ab88b |
|||
| msg301865 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2017-09-11 07:01 | |
New changeset 004547f97067be2e23ae770f300c0c0d1db1ba27 by Serhiy Storchaka in branch '2.7': [2.7] bpo-31411: Prevent raising a SystemError in case warnings.onceregistry is not a dictionary. (GH-3485). (#3493) https://github.com/python/cpython/commit/004547f97067be2e23ae770f300c0c0d1db1ba27 |
|||
| msg301866 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2017-09-11 07:01 | |
New changeset 7972ed2111ea2f01e8712eef91bcf2260e05ad8b by Serhiy Storchaka in branch '3.6': [3.6] bpo-31411: Prevent raising a SystemError in case warnings.onceregistry is not a dictionary. (GH-3485). (#3494) https://github.com/python/cpython/commit/7972ed2111ea2f01e8712eef91bcf2260e05ad8b |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:52 | admin | set | github: 75592 |
| 2017-09-11 07:07:50 | serhiy.storchaka | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2017-09-11 07:01:49 | serhiy.storchaka | set | messages: + msg301866 |
| 2017-09-11 07:01:33 | serhiy.storchaka | set | messages: + msg301865 |
| 2017-09-11 06:43:58 | serhiy.storchaka | set | pull_requests: + pull_request3487 |
| 2017-09-11 06:40:14 | serhiy.storchaka | set | pull_requests: + pull_request3486 |
| 2017-09-11 06:28:42 | serhiy.storchaka | set | messages: + msg301862 |
| 2017-09-10 20:38:04 | serhiy.storchaka | set | nosy:
+ serhiy.storchaka |
| 2017-09-10 20:13:21 | Oren Milman | set | keywords:
+ patch stage: patch review pull_requests: + pull_request3475 |
| 2017-09-10 17:37:43 | Oren Milman | create | |
