Message49193
In Python 2.4.2 and trunk, when StreamReader.readline
is used with a size argument, it will eventually
truncate some lines, even if every line is less than
the size. It works correctly in Python 2.3.5, I
haven't tried other versions.
>>>
f=codecs.getreader('ascii')(StringIO.StringIO("hello\nworld\n"))
>>> f.readline(8)
u'hello\n'
>>> f.readline(8)
u'wo'
>>> f.readline(8)
u'rld\n'
I've attached a patch which fixes this and modifies
test_codecs.py to test this. I don't know if this is
the best way to fix it, but I didn't want to make
deeper changes to the caching mechanism, being
unfamiliar with this code. |
|
Date |
User |
Action |
Args |
2007-08-23 15:44:57 | admin | link | issue1379332 messages |
2007-08-23 15:44:57 | admin | create | |
|