I'm not sure I entirely follow though, if I don't know the size of the 
response ahead of time, how will readexactly(N) help me?

On Friday, July 31, 2015 at 10:12:29 AM UTC-6, Guido van Rossum wrote:
>
> Perhaps better to use readexactly(N), which raises EOF instead of 
> returning fewer than N bytes if it hits EOF early.
>
> On Fri, Jul 31, 2015 at 5:02 PM, Victor Stinner <[email protected] 
> <javascript:>> wrote:
>
>> 2015-07-31 6:56 GMT+02:00 Luciano Ramalho <[email protected] 
>> <javascript:>>:
>> > It seems to me you can't use .read() with no arguments to read data
>> > that is not line-oriented and is not the whole transmission either.
>> > You must use .read(N), where N is a number of bytes. Then you parse
>> > what you get and decide on a suitable value of N for the next read.
>> > Rinse and repeat.
>>
>> Exactly.
>>
>> Victor
>>
>
>
>
> -- 
> --Guido van Rossum (python.org/~guido)
>

Reply via email to