You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PyConfig (PEP 587): PyConfig.warnoptions should have the highest priority #82498
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=Noneclosed_at=<Date2019-09-30.00:29:52.741>created_at=<Date2019-09-29.22:54:37.599>labels= ['interpreter-core', '3.8', '3.9']
title='PyConfig (PEP 587): PyConfig.warnoptions should have the highest priority'updated_at=<Date2019-09-30.00:29:52.735>user='https://github.com/vstinner'
Activity
vstinner commentedon Sep 29, 2019
The PEP-587 says that PyConfig.warnoptions has the highest priority for warnings options:
https://www.python.org/dev/peps/pep-0587/#priority-and-rules
But 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:
or "error::BytesWarning" filter
vstinner commentedon Sep 29, 2019
New changeset fb4ae15 by Victor Stinner in branch 'master':
bpo-38317: Fix PyConfig.warnoptions priority (GH-16478)
fb4ae15
miss-islington commentedon Sep 29, 2019
New changeset c9ed9e6 by Miss Islington (bot) in branch '3.8':
bpo-38317: Fix PyConfig.warnoptions priority (GH-16478)
c9ed9e6
vstinner commentedon Sep 30, 2019
Oh, the documentation in the PEP-587 was also wrong. I updated it:
python/peps@16bc282
The "warnings options priority" is currently not documented at:
https://docs.python.org/dev/c-api/init_config.html
The latest major change was bpo-20361 when -b command line option changed to get the highest priority (-b > -W).
cc Nick Coghlan