diff options
author | Walter Dörwald <walter@livinglogic.de> | 2005-04-21 21:32:03 (GMT) |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2005-04-21 21:32:03 (GMT) |
commit | bc8e642c1bfbef3b94f5c31dd8fdd824549039b0 (patch) | |
tree | 488577ff6f24bda24cbebe4b51df7d69b05f6679 /Misc | |
parent | 49ab700cc180c41083c817929fea62c581a4dac7 (diff) | |
download | cpython-bc8e642c1bfbef3b94f5c31dd8fdd824549039b0.zip cpython-bc8e642c1bfbef3b94f5c31dd8fdd824549039b0.tar.gz cpython-bc8e642c1bfbef3b94f5c31dd8fdd824549039b0.tar.bz2 |
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.
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -266,6 +266,12 @@ Library - Bug #1149508: ``textwrap`` now handles hyphenated numbers (eg. "2004-03-05") correctly. +- Partial fixes for SF bugs #1163244 and #1175396: If a chunk read by + ``codecs.StreamReader.readline()`` has a trailing "\r", read one more + character even if the user has passed a size parameter to get a proper + line ending. Remove the special handling of a "\r\n" that has been split + between two lines. + Build ----- |