[Python-checkins] bpo-41497: Fix potential UnicodeDecodeError in dis CLI (GH-21757)

Konge webhook-mailer at python.org
Fri Aug 7 23:03:13 EDT 2020


https://github.com/python/cpython/commit/a4084b9d1e40c1c9259372263d1fe8c8a562b093
commit: a4084b9d1e40c1c9259372263d1fe8c8a562b093
branch: master
author: Konge <zkonge at outlook.com>
committer: GitHub <noreply at github.com>
date: 2020-08-08T12:03:09+09:00
summary:

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

files:
A Misc/NEWS.d/next/Library/2020-08-07-06-06-29.bpo-41497.aBtsWz.rst
M Lib/dis.py

diff --git a/Lib/dis.py b/Lib/dis.py
index 10e5f7fb08ab2..e289e176c78ff 100644
--- a/Lib/dis.py
+++ b/Lib/dis.py
@@ -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()
diff --git a/Misc/NEWS.d/next/Library/2020-08-07-06-06-29.bpo-41497.aBtsWz.rst b/Misc/NEWS.d/next/Library/2020-08-07-06-06-29.bpo-41497.aBtsWz.rst
new file mode 100644
index 0000000000000..2c863ed7ffa3f
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2020-08-07-06-06-29.bpo-41497.aBtsWz.rst
@@ -0,0 +1 @@
+Fix potential UnicodeDecodeError in dis module.
\ No newline at end of file



More information about the Python-checkins mailing list