2014-01-27 Gustavo Carneiro <gjcarne...@gmail.com>:
>> > Why not simply EOFError?
>>
>> IncompleteReadError has two additionnal attributes:
>>
>> - partial: "incomplete" received bytes
>> - expected: total number of expected bytes (n parameter of readexactly)
>>
>> I prefer to use a different exception to ensure that these attributes
>> are present. I don't like having to check "hasattr(exc, ...)".
>>
>> Before this change, readexactly(n) returned the partial received bytes
>> if the end of the stream was reached.
>
> I had the same doubt.  Note also that IncompleteReadError is a subclass of
> EOFError, so you can catch EOFError if you like.

Oops, I forgot to mention that :-) I just documented the new
IncompleteReadError in asyncio doc.

Victor
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to