
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2019-09-29 22:54 byvstinner, last changed2022-04-11 14:59 byadmin. This issue is nowclosed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 16478 | merged | vstinner,2019-09-29 22:59 | |
| PR 16479 | merged | miss-islington,2019-09-29 23:40 | |
| Messages (4) | |||
|---|---|---|---|
| msg353513 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2019-09-29 22:54 | |
ThePEP 587 says that PyConfig.warnoptions has the highest priority for warnings options:https://www.python.org/dev/peps/pep-0587/#priority-and-rulesBut in the current implementation, PyConfig.warnoptions has... the lowest priority :-(Attached PR not only fix the issue but also add tests to ensure that every ways to set warnings options have the expected priority.Priority of warnings options, lowest to highest:- any implicit filters added by _warnings.c/warnings.py- PyConfig.dev_mode: "default" filter- PYTHONWARNINGS environment variable- '-W' command line options- PyConfig.bytes_warning ('-b', '-bb'): "default::BytesWarning" or "error::BytesWarning" filter- early PySys_AddWarnOption() calls- PyConfig.warnoptions | |||
| msg353514 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2019-09-29 23:40 | |
New changesetfb4ae152a9930f0e00cae8b2807f534058cf341a by Victor Stinner in branch 'master':bpo-38317: Fix PyConfig.warnoptions priority (GH-16478)https://github.com/python/cpython/commit/fb4ae152a9930f0e00cae8b2807f534058cf341a | |||
| msg353516 -(view) | Author: miss-islington (miss-islington) | Date: 2019-09-29 23:59 | |
New changesetc9ed9e6fc76323ed537fb79d4232bcd27d82c57e by Miss Islington (bot) in branch '3.8':bpo-38317: Fix PyConfig.warnoptions priority (GH-16478)https://github.com/python/cpython/commit/c9ed9e6fc76323ed537fb79d4232bcd27d82c57e | |||
| msg353518 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2019-09-30 00:29 | |
Oh, the documentation in thePEP 587 was also wrong. I updated it:https://github.com/python/peps/commit/16bc2821eeb09b4692c372a5a359fd28993cd29bThe "warnings options priority" is currently not documented at:https://docs.python.org/dev/c-api/init_config.htmlThe latest major change wasbpo-20361 when -b command line option changed to get the highest priority (-b > -W).cc Nick Coghlan | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:21 | admin | set | github: 82498 |
| 2019-09-30 00:29:52 | vstinner | set | status: open -> closed nosy: +ncoghlan messages: +msg353518 resolution: fixed stage: patch review -> resolved |
| 2019-09-29 23:59:00 | miss-islington | set | nosy: +miss-islington messages: +msg353516 |
| 2019-09-29 23:40:38 | miss-islington | set | pull_requests: +pull_request16064 |
| 2019-09-29 23:40:21 | vstinner | set | messages: +msg353514 |
| 2019-09-29 22:59:04 | vstinner | set | keywords: +patch stage: patch review pull_requests: +pull_request16063 |
| 2019-09-29 22:54:37 | vstinner | create | |