This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author donut
Recipients
Date 2005-12-13.08:54:29
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
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.
History
Date User Action Args
2007-08-23 15:44:57adminlinkissue1379332 messages
2007-08-23 15:44:57admincreate