Staging
v0.5.1
https://github.com/python/cpython
Revision d0e18e48d2e05b323fdbcd1b11cafc5b85de726a authored by Walter Dörwald on 21 December 2004, 22:35:24 UTC, committed by Walter Dörwald on 21 December 2004, 22:35:24 UTC
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).
1 parent 09b28e9
History
Tip revision: d0e18e48d2e05b323fdbcd1b11cafc5b85de726a authored by Walter Dörwald on 21 December 2004, 22:35:24 UTC
Backport checkin:
Tip revision: d0e18e4
File Mode Size
Demo
Doc
Grammar
Include
Lib
Mac
Misc
Modules
Objects
PC
PCbuild
Parser
Python
RISCOS
Tools
.cvsignore -rw-r--r-- 109 bytes
.hgtags -rw-r--r-- 2.5 KB
LICENSE -rw-r--r-- 12.9 KB
Makefile.pre.in -rw-r--r-- 31.6 KB
README -rw-r--r-- 48.6 KB
aclocal.m4 -rw-r--r-- 2.1 KB
configure -rwxr-xr-x 572.0 KB
configure.in -rw-r--r-- 84.8 KB
install-sh -rwxr-xr-x 7.0 KB
pyconfig.h.in -rw-r--r-- 23.8 KB
setup.py -rw-r--r-- 52.1 KB

README

back to top