]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-143993: Document ways to disable remote debugging support (#143994)
authorRafael Weingartner-Ortner <38643099+RafaelWO@users.noreply.github.com>
Thu, 22 Jan 2026 10:41:20 +0000 (11:41 +0100)
committerGitHub <noreply@github.com>
Thu, 22 Jan 2026 10:41:20 +0000 (11:41 +0100)
Although PEP 768 mentions how to disable the mechanism of
remote debugging, it is not documented in the Python docs.

This change adds a note on how to disable remote debugging support
in a Python interpreter to the remote debugging how-to.

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Doc/howto/remote_debugging.rst
Doc/library/sys.rst

index 78b40bcdf7127b21a8300313c3f7599ba82b4a0f..dfe0176b75a02071e024a7b93bf215f9fa9475d1 100644 (file)
@@ -8,6 +8,16 @@ execute Python code remotely.
 
 Most platforms require elevated privileges to attach to another Python process.
 
+Disabling remote debugging
+--------------------------
+
+To disable remote debugging support, use any of the following:
+
+* Set the :envvar:`PYTHON_DISABLE_REMOTE_DEBUG` environment variable to ``1`` before
+  starting the interpreter.
+* Use the :option:`-X disable_remote_debug` command-line option.
+* Compile Python with the :option:`--without-remote-debug` build flag.
+
 .. _permission-requirements:
 
 Permission requirements
@@ -614,4 +624,3 @@ To inject and execute a Python script in a remote process:
 6. Set ``_PY_EVAL_PLEASE_STOP_BIT`` in the ``eval_breaker`` field.
 7. Resume the process (if suspended). The script will execute at the next safe
    evaluation point.
-
index a0621d4b0dbd091ffbdcf4049c04bc347849e218..f977f1389b61a5d592e55e0c0e2f6f0049aad187 100644 (file)
@@ -1997,6 +1997,9 @@ always available. Unless explicitly noted otherwise, all variables are read-only
    interpreter is pre-release (alpha, beta, or release candidate) then the
    local and remote interpreters must be the same exact version.
 
+   See :ref:`remote-debugging` for more information about the remote debugging
+   mechanism.
+
    .. audit-event:: sys.remote_exec pid script_path
 
       When the code is executed in the remote process, an
@@ -2015,6 +2018,7 @@ always available. Unless explicitly noted otherwise, all variables are read-only
 
    .. availability:: Unix, Windows.
    .. versionadded:: 3.14
+      See :pep:`768` for more details.
 
 
 .. function:: _enablelegacywindowsfsencoding()