summaryrefslogtreecommitdiff
path: root/Doc/using
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-11-20 17:32:40 -0800
committerGitHub <noreply@github.com>2017-11-20 17:32:40 -0800
commit09f3a8a1249308a104a89041d82fe99e6c087043 (patch)
tree2d494c186b4aadfb6fe630f8ac9fc7e66e1906f5 /Doc/using
parentf39b674876d2bd47ec7fc106d673b60ff24092ca (diff)
downloadcpython-git-09f3a8a1249308a104a89041d82fe99e6c087043.tar.gz
bpo-32089: Fix warnings filters in dev mode (#4482)
The developer mode (-X dev) now creates all default warnings filters to order filters in the correct order to always show ResourceWarning and make BytesWarning depend on the -b option. Write a functional test to make sure that ResourceWarning is logged twice at the same location in the developer mode. Add a new 'dev_mode' field to _PyCoreConfig.
Diffstat (limited to 'Doc/using')
-rw-r--r--Doc/using/cmdline.rst12
1 files changed, 6 insertions, 6 deletions
diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst
index b2269302cb..8e186b3366 100644
--- a/Doc/using/cmdline.rst
+++ b/Doc/using/cmdline.rst
@@ -412,13 +412,13 @@ Miscellaneous options
application. Typical usage is ``python3 -X importtime -c 'import
asyncio'``. See also :envvar:`PYTHONPROFILEIMPORTTIME`.
* ``-X dev`` enables the "developer mode": enable debug checks at runtime.
- In short, ``python3 -X dev ...`` behaves as ``PYTHONMALLOC=debug PYTHONASYNCIODEBUG=1 python3
- -W default -X faulthandler ...``, except that the :envvar:`PYTHONMALLOC`
- and :envvar:`PYTHONASYNCIODEBUG` environment variables are not set in
- practice. Developer mode:
+ Developer mode:
- * Add ``default`` warnings option. For example, display
- :exc:`DeprecationWarning` and :exc:`ResourceWarning` warnings.
+ * 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.
* Install debug hooks on memory allocators: see the
:c:func:`PyMem_SetupDebugHooks` C function.
* Enable the :mod:`faulthandler` module to dump the Python traceback