]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-43651: Fix EncodingWarning in lib2to3/pgen2/pgen.py (GH-25127)
authorInada Naoki <songofacandy@gmail.com>
Thu, 1 Apr 2021 23:59:15 +0000 (08:59 +0900)
committerGitHub <noreply@github.com>
Thu, 1 Apr 2021 23:59:15 +0000 (08:59 +0900)
Lib/lib2to3/pgen2/pgen.py

index b0cbd16c4dad4fbf8b7afc8c776786dc7ad997ec..7abd5cef1c36bb90f340fa6d308672537292ef1f 100644 (file)
@@ -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