]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-151596: Add missing argument 'size' to pure-Python implementation of `TextI...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 23 Jun 2026 16:41:26 +0000 (18:41 +0200)
committerGitHub <noreply@github.com>
Tue, 23 Jun 2026 16:41:26 +0000 (12:41 -0400)
(cherry picked from commit 30aeeb375b8f6c1f0eec95f7af60d3d4afa37f33)

Co-authored-by: saber-bit <bryanventura0324@gmail.com>
Lib/_pyio.py
Misc/NEWS.d/next/Library/2026-06-18-23-59-46.gh-issue-151596.5ma144.rst [new file with mode: 0644]

index d0adef08e846f7516277ee4aa9f4762ab53ccd13..cc336d2939443cd3f55507d9ae1b8adcf875b127 100644 (file)
@@ -1904,7 +1904,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 (file)
index 0000000..17ec134
--- /dev/null
@@ -0,0 +1 @@
+Add missing ``size`` positional argument to the pure-Python implementation of :meth:`io.TextIOBase.readline`.