Skip to content

Commit de9444e

Browse files
[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 74a9c60) Co-authored-by: Anthony Sottile <[email protected]>
1 parent 576177d commit de9444e

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
@@ -3419,6 +3420,8 @@ def attach(pid, commands=()):
34193420
)
34203421
)
34213422
connect_script.close()
3423+
orig_mode = os.stat(connect_script.name).st_mode
3424+
os.chmod(connect_script.name, orig_mode | stat.S_IROTH | stat.S_IRGRP)
34223425
sys.remote_exec(pid, connect_script.name)
34233426

34243427
# 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)