]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Backport checkin (and the appropriate fix to the test):
authorWalter Dörwald <walter@livinglogic.de>
Thu, 21 Apr 2005 21:53:43 +0000 (21:53 +0000)
committerWalter Dörwald <walter@livinglogic.de>
Thu, 21 Apr 2005 21:53:43 +0000 (21:53 +0000)
commit4d3fec604dadbffe5211c6ca21fa05c72cbceefd
tree6e8f2d9451889a0884ac2b6aabfcbd1c549ebce7
parent21287ee5bc46d54cf041f75f857c0fc0e5dde754
Backport checkin (and the appropriate fix to the test):
If the data read from the bytestream in readline() ends in a '\r' read one more
byte, even if the user has passed a size parameter. This extra byte shouldn't
cause a buffer overflow in the tokenizer. The original plan was to return a line
ending in '\r', which might be recognizable as a complete line and skip any '\n'
that was read afterwards. Unfortunately this didn't work, as the tokenizer only
recognizes '\n' as line ends, which in turn lead to joined lines and
SyntaxErrors, so this special treatment of a split '\r\n' has been dropped. (It
can only happen with a temporarily exhausted bytestream now anyway.)
Fixes parts of SF bugs #1163244 and #1175396.
Lib/codecs.py
Lib/test/test_codecs.py
Misc/NEWS