diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-11-16 11:20:31 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-16 11:20:31 (GMT) |
commit | ccb0442a338066bf40fe417455e5a374e5238afb (patch) | |
tree | 155b84289b5136d624ebd3577902ee1435a6b4e1 /Doc | |
parent | 05cb728d68a278d11466f9a6c8258d914135c96c (diff) | |
download | cpython-ccb0442a338066bf40fe417455e5a374e5238afb.zip cpython-ccb0442a338066bf40fe417455e5a374e5238afb.tar.gz cpython-ccb0442a338066bf40fe417455e5a374e5238afb.tar.bz2 |
bpo-32043: New "developer mode": "-X dev" option (#4413)
Add a new "developer mode": new "-X dev" command line option to
enable debug checks at runtime.
Changes:
* Add unit tests for -X dev
* test_cmd_line: replace test.support with support.
* Fix _PyRuntimeState_Fini(): Use the same memory allocator
than _PyRuntimeState_Init().
* Fix _PyMem_GetDefaultRawAllocator()
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/using/cmdline.rst | 14 | ||||
-rw-r--r-- | Doc/whatsnew/3.7.rst | 13 |
2 files changed, 26 insertions, 1 deletions
diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst index 9100494..01869d1 100644 --- a/Doc/using/cmdline.rst +++ b/Doc/using/cmdline.rst @@ -413,6 +413,17 @@ Miscellaneous options nested imports). Note that its output may be broken in multi-threaded 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 python3 + -W default -X faulthandler ...``, except that the :envvar:`PYTHONMALLOC` + environment variable is not set in practice. Developer mode: + + * Add ``default`` warnings option. For example, display + :exc:`DeprecationWarning` and :exc:`ResourceWarning` warnings. + * Install debug hooks on memory allocators as if :envvar:`PYTHONMALLOC` + is set to ``debug``. + * Enable the :mod:`faulthandler` module to dump the Python traceback + on a crash. It also allows passing arbitrary values and retrieving them through the :data:`sys._xoptions` dictionary. @@ -430,7 +441,8 @@ Miscellaneous options The ``-X showalloccount`` option. .. versionadded:: 3.7 - The ``-X importtime`` and :envvar:`PYTHONPROFILEIMPORTTIME` options. + The ``-X importtime``, ``-X dev`` and :envvar:`PYTHONPROFILEIMPORTTIME` + options. Options you shouldn't use diff --git a/Doc/whatsnew/3.7.rst b/Doc/whatsnew/3.7.rst index 9d63540..bb75939 100644 --- a/Doc/whatsnew/3.7.rst +++ b/Doc/whatsnew/3.7.rst @@ -185,6 +185,19 @@ resolution on Linux and Windows. PEP written and implemented by Victor Stinner +New Developer Mode: -X dev +-------------------------- + +Add a new "developer mode": ``-X dev`` command line option to enable debug +checks at runtime. + +In short, ``python3 -X dev ...`` behaves as ``PYTHONMALLOC=debug python3 -W +default -X faulthandler ...``, except that the PYTHONMALLOC environment +variable is not set in practice. + +See :option:`-X` ``dev`` for the details. + + Other Language Changes ====================== |