From 1e6efe1319b9814fda4971618ee5887e5a0e629c Mon Sep 17 00:00:00 2001 From: zkonge Date: Fri, 7 Aug 2020 03:33:20 +0800 Subject: [PATCH 1/2] Fix potential UnicodeDecodeError on non-utf8 encoding environment in dis --- Lib/dis.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/dis.py b/Lib/dis.py index 10e5f7fb08ab21..e289e176c78ffd 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() From b357d0ea5024ce3ceaf30f79940c8f7d57deba42 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Fri, 7 Aug 2020 06:06:30 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NEWS.d/next/Library/2020-08-07-06-06-29.bpo-41497.aBtsWz.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Library/2020-08-07-06-06-29.bpo-41497.aBtsWz.rst 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 00000000000000..2c863ed7ffa3fa --- /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