]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Backport checkin:
authorWalter Dörwald <walter@livinglogic.de>
Tue, 21 Dec 2004 22:35:24 +0000 (22:35 +0000)
committerWalter Dörwald <walter@livinglogic.de>
Tue, 21 Dec 2004 22:35:24 +0000 (22:35 +0000)
commitd0e18e48d2e05b323fdbcd1b11cafc5b85de726a
tree692852e4071c088523a6ca0e017b5e0bf4c4e3da
parent09b28e91905bdea30a961afc2280f2a0b6486740
Backport checkin:
The changes to the stateful codecs in 2.4 resulted in StreamReader.readline()
trying to return a complete line even if a size parameter was given (see
http://www.python.org/sf/1076985). This leads to buffer overflows with long
source lines under Windows if e.g. cp1252 is used as the source encoding.
This patch reverts the behaviour of readline() to something that behaves more
like Python 2.3: If a size parameter is given, read() is called only once.

As a side effect of this, readline() now supports all types of linebreaks
supported by unicode.splitlines().

Note that the tokenizer is still broken and it's possible to provoke segfaults
(see http://www.python.org/sf/1089395).
Lib/codecs.py
Lib/test/test_codecs.py