Skip to content
Open
Changes from all 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
16 changes: 15 additions & 1 deletion Doc/library/sys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1996,6 +1996,8 @@ 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.
The temporary script file is created with restrictive permissions (typically
``0o600``). The target process must be able to read this file.

.. audit-event:: sys.remote_exec pid script_path

Expand All @@ -2013,10 +2015,22 @@ always available. Unless explicitly noted otherwise, all variables are read-only
This event is raised in the remote process, not the one
that called :func:`sys.remote_exec`.

Callers should adjust permissions before calling, for example::

import os
import tempfile
import sys

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 on lines +2018 to +2029
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be put before the audit event descriptions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@picnixz Have implemented that yes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not before the audit events yet. Speaking in line numbers, your paragraph should be after line 1998 but before 2000.

Image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did so
accidentally named the commit the same as last one but yeah, shouldn't be a problem


.. availability:: Unix, Windows.
.. versionadded:: 3.14


.. function:: _enablelegacywindowsfsencoding()

Changes the :term:`filesystem encoding and error handler` to 'mbcs' and
Expand Down
Loading