diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-11-21 01:32:40 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-21 01:32:40 (GMT) |
commit | 09f3a8a1249308a104a89041d82fe99e6c087043 (patch) | |
tree | 2d494c186b4aadfb6fe630f8ac9fc7e66e1906f5 /Doc | |
parent | f39b674876d2bd47ec7fc106d673b60ff24092ca (diff) | |
download | cpython-09f3a8a1249308a104a89041d82fe99e6c087043.zip cpython-09f3a8a1249308a104a89041d82fe99e6c087043.tar.gz cpython-09f3a8a1249308a104a89041d82fe99e6c087043.tar.bz2 |
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')
-rw-r--r-- | Doc/using/cmdline.rst | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst index b226930..8e186b3 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 |