summaryrefslogtreecommitdiffstats
path: root/Lib/pdb.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-04-26 05:28:29 (GMT)
committerGitHub <noreply@github.com>2023-04-26 05:28:29 (GMT)
commitf11ba1c2decd2fa6e9dfe93b9df4b80b46a290be (patch)
tree81568fb32553bcb6cabef8f9940bb7f751bb8882 /Lib/pdb.py
parentd9aafe249994bc142927a9d92242613ae9d42d13 (diff)
downloadcpython-f11ba1c2decd2fa6e9dfe93b9df4b80b46a290be.zip
cpython-f11ba1c2decd2fa6e9dfe93b9df4b80b46a290be.tar.gz
cpython-f11ba1c2decd2fa6e9dfe93b9df4b80b46a290be.tar.bz2
[3.11] gh-103578: Fix pdb reading code with non-utf8 encoding (GH-103581) (#103867)
`pdb` should use `io.open_code` to open code to avoid encoding issue. (cherry picked from commit 31acfd78a0810f84898d36a8289e407d3754b823) Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
Diffstat (limited to 'Lib/pdb.py')
-rwxr-xr-xLib/pdb.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/pdb.py b/Lib/pdb.py
index 57d070a..f9c5bee 100755
--- a/Lib/pdb.py
+++ b/Lib/pdb.py
@@ -154,7 +154,7 @@ class _ScriptTarget(str):
@property
def code(self):
- with io.open(self) as fp:
+ with io.open_code(self) as fp:
return f"exec(compile({fp.read()!r}, {self!r}, 'exec'))"