summaryrefslogtreecommitdiff
path: root/Doc/using
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-12-12 22:59:48 +0100
committerGitHub <noreply@github.com>2017-12-12 22:59:48 +0100
commit747f48e2e92390c44c72f52a1239959601cde157 (patch)
tree502e53b129aee7a393ca6d05e4f93751919a5e1b /Doc/using
parentb748e3b2586e44bfc7011b601bce9cc6d16d89f1 (diff)
downloadcpython-git-747f48e2e92390c44c72f52a1239959601cde157.tar.gz
bpo-32230: Set sys.warnoptions with -X dev (#4820)
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`. Fix also bpo-20361: have -b & -bb options take precedence over any other warnings options. Patch written by Nick Coghlan, with minor modifications of Victor Stinner.
Diffstat (limited to 'Doc/using')
-rw-r--r--Doc/using/cmdline.rst6
1 files changed, 1 insertions, 5 deletions
diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst
index 716bc821b4..e32f77e7ff 100644
--- a/Doc/using/cmdline.rst
+++ b/Doc/using/cmdline.rst
@@ -430,11 +430,7 @@ Miscellaneous options
not be more verbose than the default if the code is correct: new warnings
are only emitted when an issue is detected. Effect of the developer mode:
- * Warning filters: add a filter to display all warnings (``"default"``
- action), except of :exc:`BytesWarning` which still depends on the
- :option:`-b` option, and use ``"always"`` action for
- :exc:`ResourceWarning` warnings. For example, display
- :exc:`DeprecationWarning` warnings.
+ * Add ``default`` warning filter, as :option:`-W` ``default``.
* Install debug hooks on memory allocators: see the
:c:func:`PyMem_SetupDebugHooks` C function.
* Enable the :mod:`faulthandler` module to dump the Python traceback