From 91c984cd162f8e2bcf31b4a0f6c070c526b85460 Mon Sep 17 00:00:00 2001 From: Yash Date: Thu, 8 Jan 2026 23:27:00 +0530 Subject: [PATCH 1/5] execdocs first commit --- Doc/library/sys.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index a0621d4b0dbd09..deaed8ecae37b7 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -2016,6 +2016,21 @@ always available. Unless explicitly noted otherwise, all variables are read-only .. availability:: Unix, Windows. .. versionadded:: 3.14 + The temporary script file is created with restrictive permissions (typically + ``0o600``). The target process must be able to read this file. + + Callers should adjust permissions before calling, e.g.:: + + 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() From d1256a4a4280daecabda94d93c7adbc19f37c24d Mon Sep 17 00:00:00 2001 From: Yash Date: Sat, 10 Jan 2026 00:35:27 +0530 Subject: [PATCH 2/5] remotexec fix 1 --- Doc/library/sys.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index deaed8ecae37b7..4cc523a4d4e6c9 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -2019,7 +2019,7 @@ always available. Unless explicitly noted otherwise, all variables are read-only The temporary script file is created with restrictive permissions (typically ``0o600``). The target process must be able to read this file. - Callers should adjust permissions before calling, e.g.:: + Callers should adjust permissions before calling, for example:: import os import tempfile From c96d1aa668a84912f42936319ec41e2f52be0885 Mon Sep 17 00:00:00 2001 From: Yash Date: Sat, 10 Jan 2026 23:51:08 +0530 Subject: [PATCH 3/5] remotexec fix 2 --- Doc/library/sys.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index 4cc523a4d4e6c9..2393ab199dd785 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -2013,12 +2013,12 @@ 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`. - .. availability:: Unix, Windows. - .. versionadded:: 3.14 - 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 From 9f6d131edc0f3a0b117afb57aca271254b59c27a Mon Sep 17 00:00:00 2001 From: Yash Date: Tue, 13 Jan 2026 00:06:51 +0530 Subject: [PATCH 4/5] remotexec fix 3 --- Doc/library/sys.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index 2393ab199dd785..06bd825b58976e 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -2015,10 +2015,6 @@ always available. Unless explicitly noted otherwise, all variables are read-only 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 @@ -2032,6 +2028,9 @@ always available. Unless explicitly noted otherwise, all variables are read-only sys.remote_exec(pid, f.name) os.unlink(f.name) # Cleanup + .. availability:: Unix, Windows. + .. versionadded:: 3.14 + .. function:: _enablelegacywindowsfsencoding() Changes the :term:`filesystem encoding and error handler` to 'mbcs' and From fe77ba98d8df67bff70aab07d93abd2bcf34b6f1 Mon Sep 17 00:00:00 2001 From: Yash Date: Wed, 14 Jan 2026 23:20:26 +0530 Subject: [PATCH 5/5] remotexec fix 3 --- Doc/library/sys.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index 06bd825b58976e..41d6b32110b63f 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -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 @@ -2013,8 +2015,6 @@ 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. Callers should adjust permissions before calling, for example:: import os