diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index a0621d4b0dbd09..2393ab199dd785 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -2013,9 +2013,24 @@ 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`. + The temporary script file is created with restrictive permissions (typically + ``0o600``). The target process must be able to read this file. + .. availability:: Unix, Windows. .. versionadded:: 3.14 + 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 .. function:: _enablelegacywindowsfsencoding()