From: Inada Naoki Date: Thu, 1 Apr 2021 23:59:15 +0000 (+0900) Subject: bpo-43651: Fix EncodingWarning in lib2to3/pgen2/pgen.py (GH-25127) X-Git-Tag: v3.10.0a7~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c0ec4486dc7dd70fea39d1473ac9a9ac568378fe;p=thirdparty%2FPython%2Fcpython.git bpo-43651: Fix EncodingWarning in lib2to3/pgen2/pgen.py (GH-25127) --- diff --git a/Lib/lib2to3/pgen2/pgen.py b/Lib/lib2to3/pgen2/pgen.py index b0cbd16c4dad..7abd5cef1c36 100644 --- a/Lib/lib2to3/pgen2/pgen.py +++ b/Lib/lib2to3/pgen2/pgen.py @@ -12,7 +12,7 @@ class ParserGenerator(object): def __init__(self, filename, stream=None): close_stream = None if stream is None: - stream = open(filename) + stream = open(filename, encoding="utf-8") close_stream = stream.close self.filename = filename self.stream = stream