Rather than supporting dev mode directly in the warnings module, this instead adjusts the initialisation code to add an extra 'default' entry to sys.warnoptions when dev mode is enabled. This ensures that dev mode behaves *exactly* as if `-Wdefault` had been passed on the command line, including in the way it interacts with `sys.warnoptions`, and with other command line flags like `-bb`.
As a command line setting, dev mode should take precedence of the PYTHONWARNINGS environment variable.
- expanded PR to also fix bpo-20361 and have -b & -bb take precedence over any other warnings options - reverted to the short implicit filter list in Py_DEBUG builds (this is now even shorter than it was previously, as there are *no* implicit filters in debug builds)
ncoghlan
changed the title
bpo-32230: Set sys.warnoptions for
bpo-32230, bpo-20361: Set sys.warnoptions for all command line options-X dev
Merged
ncoghlan deleted the issue-32230-set-warnoptions-in-dev-mode branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters