summaryrefslogtreecommitdiff
path: root/Doc/using
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-11-16 03:20:31 -0800
committerGitHub <noreply@github.com>2017-11-16 03:20:31 -0800
commitccb0442a338066bf40fe417455e5a374e5238afb (patch)
tree155b84289b5136d624ebd3577902ee1435a6b4e1 /Doc/using
parent05cb728d68a278d11466f9a6c8258d914135c96c (diff)
downloadcpython-git-ccb0442a338066bf40fe417455e5a374e5238afb.tar.gz
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/using')
-rw-r--r--Doc/using/cmdline.rst14
1 files changed, 13 insertions, 1 deletions
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