https://github.com/python/cpython/commit/aa3c6421ef8663ffeaeaee90862c1e6eb3d54931 commit: aa3c6421ef8663ffeaeaee90862c1e6eb3d54931 branch: 3.13 author: Miss Islington (bot) <31488909+miss-isling...@users.noreply.github.com> committer: malemburg <m...@lemburg.com> date: 2025-07-10T18:06:34+02:00 summary:
[3.13] gh-52876: Implement missing parameter in `codecs.StreamReaderWriter` functions (GH-136498) (#136515) gh-52876: Implement missing parameter in `codecs.StreamReaderWriter` functions (GH-136498) Closes GH-52876 (cherry picked from commit 35e2c359703e076256c1249b74b87043972e04d6) Co-authored-by: Stan Ulbrych <89152624+stanfromirel...@users.noreply.github.com> 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 9b35b6127dd01c..e4f4e1b5c02549 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