From: saber-bit Date: Sun, 21 Jun 2026 18:51:04 +0000 (-0400) Subject: gh-151596: Add missing argument 'size' to pure-Python implementation of `TextIOBase... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30aeeb375b8f6c1f0eec95f7af60d3d4afa37f33;p=thirdparty%2FPython%2Fcpython.git gh-151596: Add missing argument 'size' to pure-Python implementation of `TextIOBase.readline` (GH-151679) --- diff --git a/Lib/_pyio.py b/Lib/_pyio.py index 993f94bc055b..4ba9b4070dff 100644 --- a/Lib/_pyio.py +++ b/Lib/_pyio.py @@ -1928,7 +1928,7 @@ class TextIOBase(IOBase): """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 000000000000..17ec1341142e --- /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`.