https://github.com/python/cpython/commit/35e2c359703e076256c1249b74b87043972e04d6
commit: 35e2c359703e076256c1249b74b87043972e04d6
branch: main
author: Stan Ulbrych <89152624+stanfromirel...@users.noreply.github.com>
committer: malemburg <m...@lemburg.com>
date: 2025-07-10T17:42:14+02:00
summary:

gh-52876: Implement missing parameter in `codecs.StreamReaderWriter` functions 
(#136498)

Closes #52876

files:
A Misc/NEWS.d/next/Library/2025-07-10-10-18-19.gh-issue-52876.9Vjrd8.rst
M Lib/codecs.py

diff --git a/Lib/codecs.py b/Lib/codecs.py
index fc38e922257644..e4a8010aba90a5 100644
--- a/Lib/codecs.py
+++ b/Lib/codecs.py
@@ -618,7 +618,7 @@ def readlines(self, sizehint=None, keepends=True):
             method and are included in the list entries.
 
             sizehint, if given, is ignored since there is no efficient
-            way to finding the true end-of-line.
+            way of finding the true end-of-line.
 
         """
         data = self.read()
@@ -709,13 +709,13 @@ def read(self, size=-1):
 
         return self.reader.read(size)
 
-    def readline(self, size=None):
+    def readline(self, size=None, keepends=True):
 
-        return self.reader.readline(size)
+        return self.reader.readline(size, keepends)
 
-    def readlines(self, sizehint=None):
+    def readlines(self, sizehint=None, keepends=True):
 
-        return self.reader.readlines(sizehint)
+        return self.reader.readlines(sizehint, keepends)
 
     def __next__(self):
 
diff --git 
a/Misc/NEWS.d/next/Library/2025-07-10-10-18-19.gh-issue-52876.9Vjrd8.rst 
b/Misc/NEWS.d/next/Library/2025-07-10-10-18-19.gh-issue-52876.9Vjrd8.rst
new file mode 100644
index 00000000000000..a835306868d3dc
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2025-07-10-10-18-19.gh-issue-52876.9Vjrd8.rst
@@ -0,0 +1,3 @@
+Add missing ``keepends`` (default ``True``) parameter to
+:meth:`!codecs.StreamReaderWriter.readline` and
+:meth:`!codecs.StreamReaderWriter.readlines`.

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: arch...@mail-archive.com

Reply via email to