From 6663af74c6aa9b85a8a449783353b9e633e9716c Mon Sep 17 00:00:00 2001 From: Saber_0324 Date: Thu, 18 Jun 2026 17:57:35 -0400 Subject: [PATCH 1/5] 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 993f94bc055b2e2..d352f0f9e0f0a6b 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 2/5] 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 d352f0f9e0f0a6b..4ba9b4070dff93e 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 3/5] 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 000000000000000..dfa7dc81e423ba3 --- /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 4/5] 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 dfa7dc81e423ba3..5b80f71cc04a72b 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 5/5] 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 5b80f71cc04a72b..96fdf941565ce31 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`