From eedfc3832290b3a32825b3c0f2dfa3f3d7ee9d1c Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 19 May 2023 13:00:29 -0400 Subject: [PATCH] Avoid EncodingWarning in blib2to3 (#3696) --- src/blib2to3/pgen2/pgen.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/blib2to3/pgen2/pgen.py b/src/blib2to3/pgen2/pgen.py index 631682a..b5ebc7b 100644 --- a/src/blib2to3/pgen2/pgen.py +++ b/src/blib2to3/pgen2/pgen.py @@ -30,7 +30,6 @@ class PgenGrammar(grammar.Grammar): class ParserGenerator(object): - filename: Path stream: IO[Text] generator: Iterator[GoodTokenInfo] @@ -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 -- 2.39.5