https://github.com/python/cpython/commit/8f94785080490022fe576472b6ad28cd52370f07 commit: 8f94785080490022fe576472b6ad28cd52370f07 branch: 3.14 author: Miss Islington (bot) <[email protected]> committer: ZeroIntensity <[email protected]> date: 2026-06-23T12:41:26-04:00 summary:
[3.14] gh-151596: Add missing argument 'size' to pure-Python implementation of `TextIOBase.readline` (GH-151679) (GH-151871) (cherry picked from commit 30aeeb375b8f6c1f0eec95f7af60d3d4afa37f33) Co-authored-by: saber-bit <[email protected]> files: A Misc/NEWS.d/next/Library/2026-06-18-23-59-46.gh-issue-151596.5ma144.rst M Lib/_pyio.py diff --git a/Lib/_pyio.py b/Lib/_pyio.py index d0adef08e846f7..cc336d2939443c 100644 --- a/Lib/_pyio.py +++ b/Lib/_pyio.py @@ -1904,7 +1904,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 00000000000000..17ec1341142e93 --- /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`. _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: [email protected]
