
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2017-09-11 07:52 byOren Milman, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 3496 | merged | Oren Milman,2017-09-11 10:49 | |
| PR 3509 | merged | serhiy.storchaka,2017-09-12 06:32 | |
| Messages (3) | |||
|---|---|---|---|
| msg301867 -(view) | Author: Oren Milman (Oren Milman)* | Date: 2017-09-11 07:52 | |
The following code causes an assertion failure in warn_explicit() (inPython/_warnings.c):import warningswarnings.filters = [(None, None, Warning, None, 0)]warnings.warn_explicit(message='foo', category=Warning, filename='bar', lineno=1)this is because warn_explicit() assumes that get_filter() returned a string,and passes the return value (of get_filter()) to _PyUnicode_EqualToASCIIString(),which asserts it received a string.In addition, get_filter() might return warnings.defaultaction, and so thefollowing code also causes an assertion failure in warn_explicit():import warningswarnings.defaultaction = Nonewarnings.filters = []warnings.warn_explicit(message='foo', category=Warning, filename='bar', lineno=1) | |||
| msg301903 -(view) | Author: Serhiy Storchaka (serhiy.storchaka)*![]() | Date: 2017-09-11 21:18 | |
New changeset9d984fd2b097c8c29479d1c3eb740995fe1ccb0d by Serhiy Storchaka (Oren Milman) in branch 'master':bpo-31416: Fix assertion failures in case of a bad warnings.filters or warnings.defaultaction. (#3496)https://github.com/python/cpython/commit/9d984fd2b097c8c29479d1c3eb740995fe1ccb0d | |||
| msg301940 -(view) | Author: Serhiy Storchaka (serhiy.storchaka)*![]() | Date: 2017-09-12 06:48 | |
New changeset9adc87b0f82e5169c5f44739f89212a86013d1c4 by Serhiy Storchaka in branch '3.6':[3.6]bpo-31416: Fix assertion failures in case of a bad warnings.filters or warnings.defaultaction. (GH-3496) (#3509)https://github.com/python/cpython/commit/9adc87b0f82e5169c5f44739f89212a86013d1c4 | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:52 | admin | set | github: 75597 |
| 2017-09-12 06:48:53 | serhiy.storchaka | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2017-09-12 06:48:30 | serhiy.storchaka | set | messages: +msg301940 |
| 2017-09-12 06:32:41 | serhiy.storchaka | set | pull_requests: +pull_request3504 |
| 2017-09-11 21:18:11 | serhiy.storchaka | set | nosy: +serhiy.storchaka messages: +msg301903 |
| 2017-09-11 10:49:09 | Oren Milman | set | keywords: +patch stage: patch review pull_requests: +pull_request3489 |
| 2017-09-11 07:52:58 | Oren Milman | create | |