Transport w/ extra tests

Aaron Bentley aaron.bentley at utoronto.ca
Tue Jul 19 17:38:19 BST 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John A Meinel wrote:
> Aaron Bentley wrote:

> Or we could include an
> .errno value, which could be used similarly to IOError.errno.
> I suppose I prefer the individual exceptions, because I think it is
> easier to catch them, than to trap an error and check the errno.

I agree.  Also, if the errno doesn't match, you must re-raise the
exception, which messes up the traceback.

> Well, they all throw TransportError, but I agree, that type is too opaque.

- From what I can tell, the handling isn't consistent.  e.g.
HttpTransport.get() will throw a BzrError if the file doesn't exist.

> You wouldn't have to have the encode/decode. Except, in the Branch
> class, there are a lot of locations that require encode/decode, and I
> thought it would be easier to do that at the lower level rather than the
> higher.

By my count, there are only 8 call to get and put, so the transition
wouldn't hurt much.

> Certainly we can rewrite more of Branch to use a different function call
> (rather than _transport.get) which wraps the return value
> _transport.get()

I think it makes more sense to handle encoding issues in Branch.  It
would be fine with me to enforce 100% UTF-8 control files.  ElementTree
will auto-decode bytestrings, but will it leave unicode data alone?

I'm pretty sure we should not use the 'b' flag as a hint about whether
the file is encoded or not.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFC3Sx70F+nu1YWqI0RAg+pAJ9iYmI4rHbZ5my3MLGAg8S7Tmv8qwCZAS5y
Oa+UZlTGJnXLWrGnql0GUw8=
=Ahe7
-----END PGP SIGNATURE-----




More information about the bazaar mailing list