bpo-43651: Fix EncodingWarning in lib2to3/pgen2/pgen.py (GH-25127)

This commit is contained in:
Inada Naoki 2021-04-02 08:59:15 +09:00 committed by GitHub
parent 036fc7de24
commit c0ec4486dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View 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