Paramiko throws EOFError rather than returning a 0 length file or ENOENT

John Arbash Meinel john at arbash-meinel.com
Tue Sep 12 16:06:38 BST 2006


Vincent Ladeuil wrote:
>>>>>> "jam" == John Arbash Meinel <john at arbash-meinel.com> writes:

...

>     jam> So this may be a reason to introduce a TransportFile,
>     jam> which is file-like, only it handles translating a
>     jam> transport specific exception into a generic exception.
> 
> http faces the same kind of problem, the reads can (today for
> pycurl, in the future for urllib) occur outside the scope of the
> transport, so having a TransportFile, if not necessary now, can
> solve future problems.
> 
> +1 on the concept
> 
>    Vincent

I think it is just a question of what should a file raise if it gets
truncated. A standard file just returns a short read, but no exception.
Would bzr handle that properly? Or do we really prefer getting a
Disconnected error.

I'm tempted to say Disconnected, because I don't know what a short-read
would really do. I *think* it would be safe, as long as the next action
was Disconnected. The readv stuff doesn't actually assert that the
lengths it reads are correct. It should, though.

On that note, should it keep trying to read more until it gets the full
length, and fail only if it gets a 0-length read, or should it just fail
on the first wrong-length read?

John
=:->

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060912/10eaab91/attachment.pgp 


More information about the bazaar mailing list