diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-11-20 15:14:07 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-20 15:14:07 (GMT) |
commit | 44862df2eeec62adea20672b0fe2a5d3e160569e (patch) | |
tree | e8f66bbbd2b7769ca42a292f553a7ecacb29da57 /Doc | |
parent | 04dee2720851ec39e831beaa3edc0c59f228f461 (diff) | |
download | cpython-44862df2eeec62adea20672b0fe2a5d3e160569e.zip cpython-44862df2eeec62adea20672b0fe2a5d3e160569e.tar.gz cpython-44862df2eeec62adea20672b0fe2a5d3e160569e.tar.bz2 |
bpo-32047: -X dev enables asyncio debug mode (#4418)
The new -X dev command line option now also enables asyncio debug
mode.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/asyncio-dev.rst | 9 | ||||
-rw-r--r-- | Doc/using/cmdline.rst | 10 |
2 files changed, 14 insertions, 5 deletions
diff --git a/Doc/library/asyncio-dev.rst b/Doc/library/asyncio-dev.rst index 1838eb9..b2ad87b 100644 --- a/Doc/library/asyncio-dev.rst +++ b/Doc/library/asyncio-dev.rst @@ -21,7 +21,9 @@ enable *debug mode*. To enable all debug checks for an application: * Enable the asyncio debug mode globally by setting the environment variable - :envvar:`PYTHONASYNCIODEBUG` to ``1``, or by calling :meth:`AbstractEventLoop.set_debug`. + :envvar:`PYTHONASYNCIODEBUG` to ``1``, using ``-X dev`` command line option + (see the :option:`-X` option), or by calling + :meth:`AbstractEventLoop.set_debug`. * Set the log level of the :ref:`asyncio logger <asyncio-logger>` to :py:data:`logging.DEBUG`. For example, call ``logging.basicConfig(level=logging.DEBUG)`` at startup. @@ -42,6 +44,11 @@ Examples debug checks: * :exc:`ResourceWarning` warnings are emitted when transports and event loops are :ref:`not closed explicitly <asyncio-close-transports>`. +.. versionchanged:: 3.7 + + The new ``-X dev`` command line option can now also be used to enable + the debug mode. + .. seealso:: The :meth:`AbstractEventLoop.set_debug` method and the :ref:`asyncio logger diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst index 01869d1..bf27c1e 100644 --- a/Doc/using/cmdline.rst +++ b/Doc/using/cmdline.rst @@ -414,16 +414,18 @@ 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 python3 + In short, ``python3 -X dev ...`` behaves as ``PYTHONMALLOC=debug PYTHONASYNCIODEBUG=1 python3 -W default -X faulthandler ...``, except that the :envvar:`PYTHONMALLOC` - environment variable is not set in practice. Developer mode: + and :envvar:`PYTHONASYNCIODEBUG` environment variables are 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``. + * Install debug hooks on memory allocators: see the + :c:func:`PyMem_SetupDebugHooks` C function. * Enable the :mod:`faulthandler` module to dump the Python traceback on a crash. + * Enable :ref:`asyncio debug mode <asyncio-debug-mode>`. It also allows passing arbitrary values and retrieving them through the :data:`sys._xoptions` dictionary. |