]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Backport checkin:
authorWalter Dörwald <walter@livinglogic.de>
Mon, 4 Apr 2005 21:56:28 +0000 (21:56 +0000)
committerWalter Dörwald <walter@livinglogic.de>
Mon, 4 Apr 2005 21:56:28 +0000 (21:56 +0000)
commit67e4ecd451fb7d675603b93e035883b4a2bdf277
treed4bf57cd48e6a8ef532051694ab66bafe85bc450
parent6ca93ed0c928b19922f4d5ea442e1de72a43329f
Backport checkin:
Fix for SF bug #1175396: readline() will now read one more character, if
the last character read is "\r" (and size is None, i.e. we're allowed to
call read() multiple times), so that we can return the correct line ending
(this additional character might be a "\n").

If the stream is temporarily exhausted, we might return the wrong line ending
(if the last character read is "\r" and the next one (after the byte stream
provides more data) is "\n", but at least the atcr member ensures that we
get the correct number of lines (i.e. this "\n" will not be treated as
another line ending).
Lib/codecs.py
Lib/test/test_codecs.py