gh-134546: ensure remote pdb script is readable (#134552)

This commit is contained in:
Anthony Sottile 2025-05-23 23:07:39 -04:00 committed by GitHub
parent 47f1161d3a
commit 74a9c60f3e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View 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?

View file

@ -0,0 +1 @@
Ensure :mod:`pdb` remote debugging script is readable by remote Python process.