bpo-41497: Fix potential UnicodeDecodeError in dis CLI (GH-21757)

(cherry picked from commit a4084b9d1e)

Co-authored-by: Konge <zkonge@outlook.com>
This commit is contained in:
Miss Islington (bot) 2020-08-07 20:24:12 -07:00 committed by GitHub
parent deea701b7f
commit d9106434f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -542,7 +542,7 @@ def _test():
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('infile', type=argparse.FileType(), nargs='?', default='-')
parser.add_argument('infile', type=argparse.FileType('rb'), nargs='?', default='-')
args = parser.parse_args()
with args.infile as infile:
source = infile.read()

View File

@ -0,0 +1 @@
Fix potential UnicodeDecodeError in dis module.