From 0ba3fcdf2f42ffec7e736595cfa68771e03d8cc2 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Tue, 23 Jun 2026 18:41:37 +0200 Subject: [PATCH] [3.13] gh-151596: Add missing argument 'size' to pure-Python implementation of `TextIOBase.readline` (GH-151679) (GH-151872) (cherry picked from commit 30aeeb375b8f6c1f0eec95f7af60d3d4afa37f33) Co-authored-by: saber-bit --- Lib/_pyio.py | 2 +- .../next/Library/2026-06-18-23-59-46.gh-issue-151596.5ma144.rst | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Library/2026-06-18-23-59-46.gh-issue-151596.5ma144.rst diff --git a/Lib/_pyio.py b/Lib/_pyio.py index 7c1635cb331..f0a1fa2da42 100644 --- a/Lib/_pyio.py +++ b/Lib/_pyio.py @@ -1856,7 +1856,7 @@ def truncate(self, pos=None): """Truncate size to pos, where pos is an int.""" self._unsupported("truncate") - def readline(self): + def readline(self, size=-1, /): """Read until newline or EOF. Returns an empty string if EOF is hit immediately. diff --git a/Misc/NEWS.d/next/Library/2026-06-18-23-59-46.gh-issue-151596.5ma144.rst b/Misc/NEWS.d/next/Library/2026-06-18-23-59-46.gh-issue-151596.5ma144.rst new file mode 100644 index 00000000000..17ec1341142 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2026-06-18-23-59-46.gh-issue-151596.5ma144.rst @@ -0,0 +1 @@ +Add missing ``size`` positional argument to the pure-Python implementation of :meth:`io.TextIOBase.readline`.