Message23486
Logged In: YES
user_id=38388
Walter, your analysis is not quite right: the size parameter
for .readline()
was always just a hint and never intended to limit the
number of bytes
returned by the method (like the size parameter in .read()).
In Python 2.3, the size parameter was simply passed down to
the stream's
.readline() method, so semantics were defined by the stream
rather than
the codec.
I think that we should restore this kind of behaviour for
Python 2.4.1.
Any code which makes assumptions on the length of the
returned data
is simply broken. If the Python parser makes such an
assumption it
should be fixed.
Again, the size parameter is just a hint for the
implementation. It
might as well ignore it completely. The reason for having
the parameter
is to limit the number of bytes read in case the stream does
not
include line breaks - otherwise, .readline() could end up
reading the
whole file into memory.
What was the reason why you introduced the change in semantics ?
I would have complained about it, had I known about this change
(I only saw you change to .read() which was required for the
stateful
codecs). |
|
| Date |
User |
Action |
Args |
| 2007-08-23 14:28:03 | admin | link | issue1076985 messages |
| 2007-08-23 14:28:03 | admin | create | |
|