Author vstinner
Recipients vstinner
Date 2019-09-29.22:54:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The PEP 587 says that PyConfig.warnoptions has the highest priority for warnings options:

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:

- any implicit filters added by _warnings.c/
- 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
Date User Action Args
2019-09-29 22:54:37vstinnersetrecipients: + vstinner
2019-09-29 22:54:37vstinnersetmessageid: <>
2019-09-29 22:54:37vstinnerlinkissue38317 messages
2019-09-29 22:54:37vstinnercreate