https://github.com/python/cpython/commit/de9444ef94abe0cc8f72c26cd3900f4c66883646
commit: de9444ef94abe0cc8f72c26cd3900f4c66883646
branch: 3.14
author: Miss Islington (bot) <31488909+miss-isling...@users.noreply.github.com>
committer: gaogaotiantian <gaogaotiant...@hotmail.com>
date: 2025-05-24T03:34:17Z
summary:

[3.14] gh-134546: ensure remote pdb script is readable (GH-134552) (#134616)

gh-134546: ensure remote pdb script is readable (GH-134552)
(cherry picked from commit 74a9c60f3ee2195e506144c3811090f1334c996b)

Co-authored-by: Anthony Sottile <asott...@umich.edu>

files:
A Misc/NEWS.d/next/Library/2025-05-22-18-14-13.gh-issue-134546.fjLVzK.rst
M Lib/pdb.py

diff --git a/Lib/pdb.py b/Lib/pdb.py
index d9e9bc011dbcca..c8c3134d3eb721 100644
--- a/Lib/pdb.py
+++ b/Lib/pdb.py
@@ -75,6 +75,7 @@
 import code
 import glob
 import json
+import stat
 import token
 import types
 import atexit
@@ -3419,6 +3420,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
index 00000000000000..eea897f59181c9
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2025-05-22-18-14-13.gh-issue-134546.fjLVzK.rst
@@ -0,0 +1 @@
+Ensure :mod:`pdb` remote debugging script is readable by remote Python process.

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: arch...@mail-archive.com

Reply via email to