From: Jason R. Coombs Date: Fri, 19 May 2023 17:00:29 +0000 (-0400) Subject: Avoid EncodingWarning in blib2to3 (#3696) X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/eedfc3832290b3a32825b3c0f2dfa3f3d7ee9d1c?ds=inline Avoid EncodingWarning in blib2to3 (#3696) --- 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