From ccb0442a338066bf40fe417455e5a374e5238afb Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 16 Nov 2017 03:20:31 -0800 Subject: 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() --- Doc/using/cmdline.rst | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'Doc/using') diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst index 9100494fa1..01869d117f 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 -- cgit v1.2.1