Guido van Rossum added the comment:

>
> It seems to me that the StreamReader() limit parameter is for buffer size
> while the io.BytesIO.readline() "n" parameter is for maximum number of
> lines to be retreived, I guess.
>

You sound confused. The parameter for io.BytesIO.readline() limits the
number of bytes read in that call. The StreamReader limit parameter also
limits the number of bytes read, in all readline() calls. However, the
effect is different -- if you exceed the limit in io.BytesIO.readline() you
get an unterminated line; if you exceed the limit in
StreamReader.readline(), the call raises an exception.

> And since the StreamReader().readline() does not accept parameter, it
> still cannot be used in other modules (like http.client.parse_headers()).

Since StreamReader.readline() must be used with yield from, you can't use
it in http.client.parse_headers() anyway.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20841>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to