]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-134546: ensure remote pdb script is readable (#134552)
authorAnthony Sottile <asottile@umich.edu>
Sat, 24 May 2025 03:07:39 +0000 (23:07 -0400)
committerGitHub <noreply@github.com>
Sat, 24 May 2025 03:07:39 +0000 (23:07 -0400)
Lib/pdb.py
Misc/NEWS.d/next/Library/2025-05-22-18-14-13.gh-issue-134546.fjLVzK.rst [new file with mode: 0644]

index 78ee35f61bbceaf72dc479023410a82be48fad57..fc83728fb6dc9491a80c2007c4d7d5eea8eeb567 100644 (file)
@@ -75,6 +75,7 @@ import dis
 import code
 import glob
 import json
+import stat
 import token
 import types
 import atexit
@@ -3418,6 +3419,8 @@ def attach(pid, commands=()):
             )
         )
         connect_script.close()
+        orig_mode = os.stat(connect_script.name).st_mode
+        os.chmod(connect_script.name, orig_mode | stat.S_IROTH | stat.S_IRGRP)
         sys.remote_exec(pid, connect_script.name)
 
         # TODO Add a timeout? Or don't bother since the user can ^C?
diff --git a/Misc/NEWS.d/next/Library/2025-05-22-18-14-13.gh-issue-134546.fjLVzK.rst b/Misc/NEWS.d/next/Library/2025-05-22-18-14-13.gh-issue-134546.fjLVzK.rst
new file mode 100644 (file)
index 0000000..eea897f
--- /dev/null
@@ -0,0 +1 @@
+Ensure :mod:`pdb` remote debugging script is readable by remote Python process.