Skip to content

Commit 260fc4d

Browse files
author
Erlend E. Aasland
committed
bpo-39712: Add doc refs for env. vars & -X options
Mention corresponding environment variables in -X option documentation. Also reference -X options in environment variable documentation.
1 parent 25e244c commit 260fc4d

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

Doc/using/cmdline.rst

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -430,15 +430,17 @@ Miscellaneous options
430430
Reserved for various implementation-specific options. CPython currently
431431
defines the following possible values:
432432

433-
* ``-X faulthandler`` to enable :mod:`faulthandler`;
433+
* ``-X faulthandler`` to enable :mod:`faulthandler`. See also
434+
:envvar:`PYTHONFAULTHANDLER`.
434435
* ``-X showrefcount`` to output the total reference count and number of used
435436
memory blocks when the program finishes or after each statement in the
436437
interactive interpreter. This only works on debug builds.
437438
* ``-X tracemalloc`` to start tracing Python memory allocations using the
438439
:mod:`tracemalloc` module. By default, only the most recent frame is
439440
stored in a traceback of a trace. Use ``-X tracemalloc=NFRAME`` to start
440-
tracing with a traceback limit of *NFRAME* frames. See the
441-
:func:`tracemalloc.start` for more information.
441+
tracing with a traceback limit of *NFRAME* frames. See
442+
:func:`tracemalloc.start` and :envvar:`PYTHONTRACEMALLOC` for more
443+
information.
442444
* ``-X importtime`` to show how long each import takes. It shows module
443445
name, cumulative time (including nested imports) and self time (excluding
444446
nested imports). Note that its output may be broken in multi-threaded
@@ -450,6 +452,7 @@ Miscellaneous options
450452
* ``-X utf8`` enables the :ref:`Python UTF-8 Mode <utf8-mode>`.
451453
``-X utf8=0`` explicitly disables :ref:`Python UTF-8 Mode <utf8-mode>`
452454
(even when it would otherwise activate automatically).
455+
See also :envvar:`PYTHONUTF8`.
453456
* ``-X pycache_prefix=PATH`` enables writing ``.pyc`` files to a parallel
454457
tree rooted at the given directory instead of to the code tree. See also
455458
:envvar:`PYTHONPYCACHEPREFIX`.
@@ -738,16 +741,17 @@ conflict.
738741
Python memory allocations using the :mod:`tracemalloc` module. The value of
739742
the variable is the maximum number of frames stored in a traceback of a
740743
trace. For example, ``PYTHONTRACEMALLOC=1`` stores only the most recent
741-
frame. See the :func:`tracemalloc.start` for more information.
744+
frame. See the :func:`tracemalloc.start` for more information. This is
745+
equivalent to setting the :option:`-X` ``tracemalloc`` option.
742746

743747
.. versionadded:: 3.4
744748

745749

746750
.. envvar:: PYTHONPROFILEIMPORTTIME
747751

748752
If this environment variable is set to a non-empty string, Python will
749-
show how long each import takes. This is exactly equivalent to setting
750-
``-X importtime`` on the command line.
753+
show how long each import takes. This is equivalent to setting the
754+
:option:`-X` ``importtime`` option.
751755

752756
.. versionadded:: 3.7
753757

@@ -893,6 +897,7 @@ conflict.
893897
If this environment variable is set to a non-empty string, enable
894898
:ref:`Python Development Mode <devmode>`, introducing additional runtime
895899
checks that are too expensive to be enabled by default.
900+
This is equivalent to setting the :option:`-X` ``dev`` option.
896901

897902
.. versionadded:: 3.7
898903

0 commit comments

Comments
 (0)