2014-01-27 Antoine Pitrou <solipsis@pitrou.net>:
> On Mon, 27 Jan 2014 10:45:37 +0100IncompleteReadError has two additionnal attributes:
> Victor Stinner <victor.stinner@gmail.com> wrote:
>>
>> - Tulip #111: StreamReader.readexactly() now raises an
>> IncompleteReadError if the
>> end of stream is reached before we received enough bytes, instead of returning
>> less bytes than requested.
>
> Why not simply EOFError?
- 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.
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/gjcarneiro%40gmail.com