Skip to content

Commit 74a9c60

Browse files
authored
pythongh-134546: ensure remote pdb script is readable (python#134552)
1 parent 47f1161 commit 74a9c60

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

Lib/pdb.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
import code
7676
import glob
7777
import json
78+
import stat
7879
import token
7980
import types
8081
import atexit
@@ -3418,6 +3419,8 @@ def attach(pid, commands=()):
34183419
)
34193420
)
34203421
connect_script.close()
3422+
orig_mode = os.stat(connect_script.name).st_mode
3423+
os.chmod(connect_script.name, orig_mode | stat.S_IROTH | stat.S_IRGRP)
34213424
sys.remote_exec(pid, connect_script.name)
34223425

34233426
# TODO Add a timeout? Or don't bother since the user can ^C?
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Ensure :mod:`pdb` remote debugging script is readable by remote Python process.

0 commit comments

Comments
 (0)