Skip to content

Commit d910643

Browse files
bpo-41497: Fix potential UnicodeDecodeError in dis CLI (GH-21757)
(cherry picked from commit a4084b9) Co-authored-by: Konge <[email protected]>
1 parent deea701 commit d910643

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Lib/dis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ def _test():
542542
import argparse
543543

544544
parser = argparse.ArgumentParser()
545-
parser.add_argument('infile', type=argparse.FileType(), nargs='?', default='-')
545+
parser.add_argument('infile', type=argparse.FileType('rb'), nargs='?', default='-')
546546
args = parser.parse_args()
547547
with args.infile as infile:
548548
source = infile.read()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix potential UnicodeDecodeError in dis module.

0 commit comments

Comments
 (0)