Skip to content

Commit 03701c3

Browse files
committed
Document ways to disable remote debugging support
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 and to the sys.remote_exec docs.
1 parent bb25f72 commit 03701c3

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

Doc/howto/remote_debugging.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ execute Python code remotely.
88

99
Most platforms require elevated privileges to attach to another Python process.
1010

11+
.. note::
12+
13+
You can disable remote debugging support in a Python interpreter by (1) setting the
14+
``PYTHON_DISABLE_REMOTE_DEBUG`` environment variable to any value before starting
15+
the interpreter, (2) using the ``-X disable-remote-debug`` command-line option, or
16+
(3) compiling Python with the ``--without-remote-debug`` build flag.
17+
1118
.. _permission-requirements:
1219

1320
Permission requirements
@@ -614,4 +621,3 @@ To inject and execute a Python script in a remote process:
614621
6. Set ``_PY_EVAL_PLEASE_STOP_BIT`` in the ``eval_breaker`` field.
615622
7. Resume the process (if suspended). The script will execute at the next safe
616623
evaluation point.
617-

Doc/library/sys.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1997,6 +1997,13 @@ always available. Unless explicitly noted otherwise, all variables are read-only
19971997
interpreter is pre-release (alpha, beta, or release candidate) then the
19981998
local and remote interpreters must be the same exact version.
19991999

2000+
.. note::
2001+
2002+
You can disable remote debugging support in a Python interpreter by (1) setting the
2003+
``PYTHON_DISABLE_REMOTE_DEBUG`` environment variable to any value before starting
2004+
the interpreter, (2) using the ``-X disable-remote-debug`` command-line option, or
2005+
(3) compiling Python with the ``--without-remote-debug`` build flag.
2006+
20002007
.. audit-event:: sys.remote_exec pid script_path
20012008

20022009
When the code is executed in the remote process, an

0 commit comments

Comments
 (0)