Skip to content

Commit

Permalink
Avoid EncodingWarning in blib2to3 (#3696)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed May 19, 2023
1 parent 2fd9d8b commit eedfc38
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/blib2to3/pgen2/pgen.py
Expand Up @@ -30,7 +30,6 @@ class PgenGrammar(grammar.Grammar):


class ParserGenerator(object):

filename: Path
stream: IO[Text]
generator: Iterator[GoodTokenInfo]
Expand All @@ -39,7 +38,7 @@ class ParserGenerator(object):
def __init__(self, filename: Path, stream: Optional[IO[Text]] = None) -> 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
Expand Down

0 comments on commit eedfc38

Please sign in to comment.