8000 bpo-38723: Pdb._runscript should use io.open_code() instead of open()… · python/cpython@0a8e7fd · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0a8e7fd

Browse files
bpo-38723: Pdb._runscript should use io.open_code() instead of open() (GH-17127)
Co-Authored-By: Brandt Bucher <brandtbucher@gmail.com> (cherry picked from commit d593881) Co-authored-by: jsnklln <jsnklln@gmail.com>
1 parent d360346 commit 0a8e7fd

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Lib/pdb.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
# commands and is appended to __doc__ after the class has been defined.
6969

7070
import os
71+
import io
7172
import re
7273
import sys
7374
import cmd
@@ -1565,7 +1566,7 @@ def _runscript(self, filename):
15651566
self._wait_for_mainpyfile = True
15661567
self.mainpyfile = self.canonic(filename)
15671568
self._user_requested_quit = False
1568-
with open(filename, "rb") as fp:
1569+
with io.open_code(filename) as fp:
15691570
statement = "exec(compile(%r, %r, 'exec'))" % \
15701571
(fp.read(), self.mainpyfile)
15711572
self.run(statement)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
:mod:`pdb` now uses :meth:`io.open_code` to trigger auditing events.

0 commit comments

Comments
 (0)
0