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 tdb
Recipients tdb
Date 2012-04-02.13:13:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1333372414.16.0.496350307965.issue14475@psf.upfronthosting.co.za>
In-reply-to
Content
For regular files, a read() call without arguments will read until EOF.  codecs.StreamReader does its own buffering, and if there are characters in the buffer, a read() call will be satisfied from the buffer without an attempt to read the rest of the file.  This discrepancy causes certain code that worked with regular open() fail if codecs.open() is substituted.

The easiest way to reproduce this is to first call readline() and then read().  Since readline() can't know how many characters are on the line, it will almost always leave some characters in the buffer, triggering the problem with read().
History
Date User Action Args
2012-04-02 13:13:34tdbsetrecipients: + tdb
2012-04-02 13:13:34tdbsetmessageid: <1333372414.16.0.496350307965.issue14475@psf.upfronthosting.co.za>
2012-04-02 13:13:33tdblinkissue14475 messages
2012-04-02 13:13:33tdbcreate