Skip to content
Open
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Doc/library/sys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1996,6 +1996,25 @@ always available. Unless explicitly noted otherwise, all variables are read-only
and minor version as the local process. If either the local or remote
interpreter is pre-release (alpha, beta, or release candidate) then the
local and remote interpreters must be the same exact version.
Note that the remote process must be able to read the temporary script file in terms
Comment thread
Yashp002 marked this conversation as resolved.
of permissions. If the caller is running under different user than the process,
the caller should grant permissions (typically ``os.fchmod(filename, 0o644)``).

Callers should adjust permissions before calling, for example::

import os
import tempfile
import sys
Comment thread
Yashp002 marked this conversation as resolved.

with tempfile.NamedTemporaryFile(mode='w', suffix='.py', delete=False) as f:
f.write("print('Hello from remote!')")
f.flush()
os.chmod(f.name, 0o644) # Readable by group/other
sys.remote_exec(pid, f.name)
os.unlink(f.name) # Cleanup
Comment thread
Yashp002 marked this conversation as resolved.
Outdated

.. availability:: Unix, Windows.
.. versionadded:: 3.14
Comment thread
Yashp002 marked this conversation as resolved.
Outdated

See :ref:`remote-debugging` for more information about the remote debugging
mechanism.
Expand Down
Loading