From 6663af74c6aa9b85a8a449783353b9e633e9716c Mon Sep 17 00:00:00 2001 From: Saber_0324 Date: Thu, 18 Jun 2026 17:57:35 -0400 Subject: [PATCH 01/10] Added missing argument 'size' with default value of -1 to TextIOBase.readline --- Lib/_pyio.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/_pyio.py b/Lib/_pyio.py index 993f94bc055b2e..d352f0f9e0f0a6 100644 --- a/Lib/_pyio.py +++ b/Lib/_pyio.py @@ -1928,7 +1928,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. From eff30bee7a36a89f0f35b929f6614289cf2caa74 Mon Sep 17 00:00:00 2001 From: Saber_0324 Date: Thu, 18 Jun 2026 23:29:07 -0400 Subject: [PATCH 02/10] Made 'size' argument from TextIOBase.readline positional only --- Lib/_pyio.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/_pyio.py b/Lib/_pyio.py index d352f0f9e0f0a6..4ba9b4070dff93 100644 --- a/Lib/_pyio.py +++ b/Lib/_pyio.py @@ -1928,7 +1928,7 @@ def truncate(self, pos=None): """Truncate size to pos, where pos is an int.""" self._unsupported("truncate") - def readline(self, size=-1): + def readline(self, size=-1, /): """Read until newline or EOF. Returns an empty string if EOF is hit immediately. From 4dd197d195ce78f49c663ec43efd4e535398424d Mon Sep 17 00:00:00 2001 From: Saber_0324 Date: Fri, 19 Jun 2026 00:00:19 -0400 Subject: [PATCH 03/10] Added news entry --- .../next/Library/2026-06-18-23-59-46.gh-issue-151596.5ma144.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Library/2026-06-18-23-59-46.gh-issue-151596.5ma144.rst 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..dfa7dc81e423ba --- /dev/null +++ b/Misc/NEWS.d/next/Library/2026-06-18-23-59-46.gh-issue-151596.5ma144.rst @@ -0,0 +1 @@ +Added missing *size* positional arg to :meth: `TextIOBase.readline` From e9abe5d05b440a81a400d07a46671c96b2ddd12f Mon Sep 17 00:00:00 2001 From: saber-bit Date: Fri, 19 Jun 2026 00:07:46 -0400 Subject: [PATCH 04/10] Updated method reference to _pyio --- .../next/Library/2026-06-18-23-59-46.gh-issue-151596.5ma144.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index dfa7dc81e423ba..5b80f71cc04a72 100644 --- 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 @@ -1 +1 @@ -Added missing *size* positional arg to :meth: `TextIOBase.readline` +Added missing *size* positional arg to :meth: `_pyio.TextIOBase.readline` From 5562d18f39c8734eb3af5ffbc99f0cf432a13e66 Mon Sep 17 00:00:00 2001 From: saber-bit Date: Fri, 19 Jun 2026 00:11:37 -0400 Subject: [PATCH 05/10] Fix formatting --- .../next/Library/2026-06-18-23-59-46.gh-issue-151596.5ma144.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index 5b80f71cc04a72..96fdf941565ce3 100644 --- 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 @@ -1 +1 @@ -Added missing *size* positional arg to :meth: `_pyio.TextIOBase.readline` +Added missing ``size`` positional argument to :meth:`io.TextIOBase.readline` From a040ebf28fdb883351e14a11472c74d87641cbea Mon Sep 17 00:00:00 2001 From: saber-bit Date: Sun, 21 Jun 2026 06:54:43 -0400 Subject: [PATCH 06/10] Corrected the module name --- .../next/Library/2026-06-18-23-59-46.gh-issue-151596.5ma144.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index 96fdf941565ce3..13e1c7acb7508f 100644 --- 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 @@ -1 +1 @@ -Added missing ``size`` positional argument to :meth:`io.TextIOBase.readline` +Added missing ``size`` positional argument to :meth:`_pyio.TextIOBase.readline` From 03489ef32f63ed8ecaf0be791566fd92b7f42a0c Mon Sep 17 00:00:00 2001 From: saber-bit Date: Sun, 21 Jun 2026 07:51:13 -0400 Subject: [PATCH 07/10] Use different wording to pass doc tests --- .../next/Library/2026-06-18-23-59-46.gh-issue-151596.5ma144.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index 13e1c7acb7508f..e1cb86ece2b38a 100644 --- 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 @@ -1 +1 @@ -Added missing ``size`` positional argument to :meth:`_pyio.TextIOBase.readline` +Added missing ``size`` positional argument to the pure Python implementation of :meth:`io.TextIOBase.readline` From 62be0a9f967a3f0fa20d073938472b1934a6f266 Mon Sep 17 00:00:00 2001 From: saber-bit Date: Sun, 21 Jun 2026 08:00:09 -0400 Subject: [PATCH 08/10] delete trailing whitespace --- .../next/Library/2026-06-18-23-59-46.gh-issue-151596.5ma144.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index e1cb86ece2b38a..4e3debb6fe3076 100644 --- 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 @@ -1 +1 @@ -Added missing ``size`` positional argument to the pure Python implementation of :meth:`io.TextIOBase.readline` +Added missing ``size`` positional argument to the pure Python implementation of :meth:`io.TextIOBase.readline` From b701b40e2d1faeb2bcce30cb9848b01cf8af5e14 Mon Sep 17 00:00:00 2001 From: saber-bit Date: Sun, 21 Jun 2026 11:42:51 -0400 Subject: [PATCH 09/10] Update 2026-06-18-23-59-46.gh-issue-151596.5ma144.rst --- .../next/Library/2026-06-18-23-59-46.gh-issue-151596.5ma144.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index 4e3debb6fe3076..80b2dee9fbab26 100644 --- 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 @@ -1 +1 @@ -Added missing ``size`` positional argument to the pure Python implementation of :meth:`io.TextIOBase.readline` +Add missing ``size`` positional argument to the pure-Python implementation of :meth:`io.TextIOBase.readline`. \ No newline at end of file From 2e9e55b4eede9683b34396febe7e79d5459e4afc Mon Sep 17 00:00:00 2001 From: saber-bit Date: Sun, 21 Jun 2026 11:48:23 -0400 Subject: [PATCH 10/10] add final newline --- .../next/Library/2026-06-18-23-59-46.gh-issue-151596.5ma144.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index 80b2dee9fbab26..17ec1341142e93 100644 --- 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 @@ -1 +1 @@ -Add missing ``size`` positional argument to the pure-Python implementation of :meth:`io.TextIOBase.readline`. \ No newline at end of file +Add missing ``size`` positional argument to the pure-Python implementation of :meth:`io.TextIOBase.readline`.