Everybody calls readline() without arguments, and there's a known attack on
HTTP servers which sends headers containing very long lines. Convincing
everyone to call readline(N) and check the return for a trailing \n is a
lost cause -- most people just don't imagine the attack.

But for read() it is common to pass an explicit size, and the behavior of
read() without a size is well-understood.

So I don't think we should complicate the API. If you really need to
support reading very large lines just pass a very large limit to the
constructor (and be aware of the risk).


On Thu, Feb 20, 2014 at 1:59 AM, Victor Stinner <[email protected]>wrote:

> Hi,
>
> StreamReader.read() can reed unlimited data, but
> StreamReader.readline() is limited by the limit paramter of the
> StreamReader constructor. It is not possible to pass None. Is there a
> reason for that?
>
> Victor
>



-- 
--Guido van Rossum (python.org/~guido)

Reply via email to