From 41e764843c900a7f68a952e851293296f1854a95 Mon Sep 17 00:00:00 2001 From: furkanonder Date: Mon, 10 Apr 2023 18:42:09 +0300 Subject: [PATCH 1/7] GH-83893 Cross reference env. vars and -X command line options --- Doc/using/cmdline.rst | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst index 2a4d070ec057df..ca5db34e819893 100644 --- a/Doc/using/cmdline.rst +++ b/Doc/using/cmdline.rst @@ -495,7 +495,8 @@ Miscellaneous options Reserved for various implementation-specific options. CPython currently defines the following possible values: - * ``-X faulthandler`` to enable :mod:`faulthandler`; + * ``-X faulthandler`` to enable :mod:`faulthandler`. See also + * :envvar:`PYTHONFAULTHANDLER`. * ``-X showrefcount`` to output the total reference count and number of used memory blocks when the program finishes or after each statement in the interactive interpreter. This only works on :ref:`debug builds @@ -503,8 +504,8 @@ Miscellaneous options * ``-X tracemalloc`` to start tracing Python memory allocations using the :mod:`tracemalloc` module. By default, only the most recent frame is stored in a traceback of a trace. Use ``-X tracemalloc=NFRAME`` to start - tracing with a traceback limit of *NFRAME* frames. See the - :func:`tracemalloc.start` for more information. + :func:`tracemalloc.start` and :envvar:`PYTHONTRACEMALLOC` for more + information. * ``-X int_max_str_digits`` configures the :ref:`integer string conversion length limitation `. See also :envvar:`PYTHONINTMAXSTRDIGITS`. @@ -519,6 +520,7 @@ Miscellaneous options * ``-X utf8`` enables the :ref:`Python UTF-8 Mode `. ``-X utf8=0`` explicitly disables :ref:`Python UTF-8 Mode ` (even when it would otherwise activate automatically). + See also :envvar:`PYTHONUTF8`. * ``-X pycache_prefix=PATH`` enables writing ``.pyc`` files to a parallel tree rooted at the given directory instead of to the code tree. See also :envvar:`PYTHONPYCACHEPREFIX`. @@ -861,7 +863,8 @@ conflict. Python memory allocations using the :mod:`tracemalloc` module. The value of the variable is the maximum number of frames stored in a traceback of a trace. For example, ``PYTHONTRACEMALLOC=1`` stores only the most recent - frame. See the :func:`tracemalloc.start` for more information. + frame. See the :func:`tracemalloc.start` for more information. This is + equivalent to setting the :option:`-X` ``tracemalloc`` option. .. versionadded:: 3.4 @@ -869,8 +872,8 @@ conflict. .. envvar:: PYTHONPROFILEIMPORTTIME If this environment variable is set to a non-empty string, Python will - show how long each import takes. This is exactly equivalent to setting - ``-X importtime`` on the command line. + show how long each import takes. This is equivalent to setting the + :option:`-X` ``importtime`` option. .. versionadded:: 3.7 @@ -1012,6 +1015,7 @@ conflict. If this environment variable is set to a non-empty string, enable :ref:`Python Development Mode `, introducing additional runtime checks that are too expensive to be enabled by default. + This is equivalent to setting the :option:`-X` ``dev`` option. .. versionadded:: 3.7 From d6d30ca901a9b7502d215c7b54b138d5ef899516 Mon Sep 17 00:00:00 2001 From: Furkan Onder Date: Tue, 11 Apr 2023 15:28:04 +0300 Subject: [PATCH 2/7] Update Doc/using/cmdline.rst Co-authored-by: Erlend E. Aasland --- Doc/using/cmdline.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst index ca5db34e819893..47c8e0c7d17f07 100644 --- a/Doc/using/cmdline.rst +++ b/Doc/using/cmdline.rst @@ -495,8 +495,8 @@ Miscellaneous options Reserved for various implementation-specific options. CPython currently defines the following possible values: - * ``-X faulthandler`` to enable :mod:`faulthandler`. See also - * :envvar:`PYTHONFAULTHANDLER`. + * ``-X faulthandler`` to enable :mod:`faulthandler`. + See also :envvar:`PYTHONFAULTHANDLER`. * ``-X showrefcount`` to output the total reference count and number of used memory blocks when the program finishes or after each statement in the interactive interpreter. This only works on :ref:`debug builds From e6f6e5ad204c942f926bcc512ea77b3de78513cc Mon Sep 17 00:00:00 2001 From: Furkan Onder Date: Tue, 11 Apr 2023 15:28:11 +0300 Subject: [PATCH 3/7] Update Doc/using/cmdline.rst Co-authored-by: Erlend E. Aasland --- Doc/using/cmdline.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst index 47c8e0c7d17f07..5351805fe511bd 100644 --- a/Doc/using/cmdline.rst +++ b/Doc/using/cmdline.rst @@ -504,8 +504,9 @@ Miscellaneous options * ``-X tracemalloc`` to start tracing Python memory allocations using the :mod:`tracemalloc` module. By default, only the most recent frame is stored in a traceback of a trace. Use ``-X tracemalloc=NFRAME`` to start - :func:`tracemalloc.start` and :envvar:`PYTHONTRACEMALLOC` for more - information. + tracing with a traceback limit of *NFRAME* frames. + See :func:`tracemalloc.start` and :envvar:`PYTHONTRACEMALLOC` + for more information. * ``-X int_max_str_digits`` configures the :ref:`integer string conversion length limitation `. See also :envvar:`PYTHONINTMAXSTRDIGITS`. From 64d763993165c22cadcf727611973e2836bf81a9 Mon Sep 17 00:00:00 2001 From: Furkan Onder Date: Tue, 11 Apr 2023 15:28:20 +0300 Subject: [PATCH 4/7] Update Doc/using/cmdline.rst Co-authored-by: Erlend E. Aasland --- Doc/using/cmdline.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst index 5351805fe511bd..fbb7155c164bc6 100644 --- a/Doc/using/cmdline.rst +++ b/Doc/using/cmdline.rst @@ -864,8 +864,8 @@ conflict. Python memory allocations using the :mod:`tracemalloc` module. The value of the variable is the maximum number of frames stored in a traceback of a trace. For example, ``PYTHONTRACEMALLOC=1`` stores only the most recent - frame. See the :func:`tracemalloc.start` for more information. This is - equivalent to setting the :option:`-X` ``tracemalloc`` option. + frame. See the :func:`tracemalloc.start` for more information. + This is equivalent to setting the :option:`-X` ``tracemalloc`` option. .. versionadded:: 3.4 From f57b6dfc011aec35fc3d1b30fb93e8c3e2aafb24 Mon Sep 17 00:00:00 2001 From: Furkan Onder Date: Tue, 11 Apr 2023 15:28:28 +0300 Subject: [PATCH 5/7] Update Doc/using/cmdline.rst Co-authored-by: Erlend E. Aasland --- Doc/using/cmdline.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst index fbb7155c164bc6..b4801e106b75d4 100644 --- a/Doc/using/cmdline.rst +++ b/Doc/using/cmdline.rst @@ -873,8 +873,8 @@ conflict. .. envvar:: PYTHONPROFILEIMPORTTIME If this environment variable is set to a non-empty string, Python will - show how long each import takes. This is equivalent to setting the - :option:`-X` ``importtime`` option. + show how long each import takes. + This is equivalent to setting the :option:`-X` ``importtime`` option. .. versionadded:: 3.7 From 1c7e826a23b3cad099650e508bc8fe3a41a4c2d1 Mon Sep 17 00:00:00 2001 From: Furkan Onder Date: Tue, 11 Apr 2023 15:35:05 +0300 Subject: [PATCH 6/7] Fix grammar issue for the PYTHONTRACEMALLOC sec --- Doc/using/cmdline.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst index b4801e106b75d4..70ed10b5096d51 100644 --- a/Doc/using/cmdline.rst +++ b/Doc/using/cmdline.rst @@ -864,7 +864,7 @@ conflict. Python memory allocations using the :mod:`tracemalloc` module. The value of the variable is the maximum number of frames stored in a traceback of a trace. For example, ``PYTHONTRACEMALLOC=1`` stores only the most recent - frame. See the :func:`tracemalloc.start` for more information. + frame. See the :func:`tracemalloc.start` function for more information. This is equivalent to setting the :option:`-X` ``tracemalloc`` option. .. versionadded:: 3.4 From 974dd4e2c3be614b9545c8d994b1331def59a11b Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Wed, 12 Apr 2023 10:36:35 +0200 Subject: [PATCH 7/7] Update Doc/using/cmdline.rst --- Doc/using/cmdline.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst index 70ed10b5096d51..b35e8454fa2a1a 100644 --- a/Doc/using/cmdline.rst +++ b/Doc/using/cmdline.rst @@ -864,7 +864,8 @@ conflict. Python memory allocations using the :mod:`tracemalloc` module. The value of the variable is the maximum number of frames stored in a traceback of a trace. For example, ``PYTHONTRACEMALLOC=1`` stores only the most recent - frame. See the :func:`tracemalloc.start` function for more information. + frame. + See the :func:`tracemalloc.start` function for more information. This is equivalent to setting the :option:`-X` ``tracemalloc`` option. .. versionadded:: 3.4