From 4b06d9ab8bea9c4aa86a9a59a0433b5e15ce9f94 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Mon, 18 May 2020 11:00:59 +0300 Subject: [PATCH 1/2] Add stub for TextIOWrapper.reconfigure() --- stdlib/3/io.pyi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/stdlib/3/io.pyi b/stdlib/3/io.pyi index 1f3ca4973157..313ad6462295 100644 --- a/stdlib/3/io.pyi +++ b/stdlib/3/io.pyi @@ -171,6 +171,14 @@ class TextIOWrapper(TextIO): line_buffering: bool = ..., write_through: bool = ... ) -> None: ... + if sys.version_info >= (3, 7): + def reconfigure(self, *, + encoding: Optional[str] = ..., + errors: Optional[str] = ..., + newline: Optional[str] = ..., + line_buffering: bool = ..., + write_through: bool = ... + ) -> None: ... # copied from IOBase def __exit__(self, t: Optional[Type[BaseException]] = ..., value: Optional[BaseException] = ..., traceback: Optional[TracebackType] = ...) -> Optional[bool]: ... From 324e03743f865880be615fb695039e4639b86f83 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 18 May 2020 17:37:53 +0200 Subject: [PATCH 2/2] Fix CI failures --- stdlib/3/io.pyi | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/stdlib/3/io.pyi b/stdlib/3/io.pyi index 313ad6462295..68564e89aad9 100644 --- a/stdlib/3/io.pyi +++ b/stdlib/3/io.pyi @@ -172,12 +172,14 @@ class TextIOWrapper(TextIO): write_through: bool = ... ) -> None: ... if sys.version_info >= (3, 7): - def reconfigure(self, *, + def reconfigure( + self, + *, encoding: Optional[str] = ..., errors: Optional[str] = ..., newline: Optional[str] = ..., - line_buffering: bool = ..., - write_through: bool = ... + line_buffering: Optional[bool] = ..., + write_through: Optional[bool] = ... ) -> None: ... # copied from IOBase def __exit__(self, t: Optional[Type[BaseException]] = ..., value: Optional[BaseException] = ...,