[proxy] web.archive.org← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light

bpo-32230, bpo-20361: Set sys.warnoptions for all command line options by ncoghlan · Pull Request #4734 · python/cpython

ncoghlan

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 -X dev bpo-32230, bpo-20361: Set sys.warnoptions for all command line options

Dec 7, 2017

Merged

ncoghlan deleted the issue-32230-set-warnoptions-in-dev-mode branch

March 30, 2018 07:52