Transport w/ extra tests

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


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

John A Meinel wrote:
> Do you have a specific list of desirable exceptions?

Probably PermissionDenied, FileExists, ConnectionReset also make sense.

> Anything else? Perhaps a TransportTimeout of some sort. (I know
> effbot.org can give a timeout for a download taking to long, but that
> may not be the best place to do it)

> (and it is a little tricky to test Http, since you would
> have to have an http server. Unless we trick HttpTransport into also
> supporting file:// type urls.)

Perhaps you can use SimpleHttpServer for your tests.  Oh, and since http
does support PUT, maybe you should say "http PUT is not supported"
instead of "http does not support put" :-)

>>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?
> 
> 
> Actually, ElementTree automatically decodes/encodes into utf-8. But the
> other control files need to be handled specially. (Notice that reading
> inventory is done in binary form).

That is my point.  If we auto-decode all control files, we'll be handing
a unicode-producing file to ElementTree when we try to get inventory.  I
don't know what ElementTree will do.  The docs don't say how it decodes
data, so I'd assume it will decode a well-formed Windows-1252 XML file,
as long as the file has an encoding declaration.  But if you're handing
it unicode data, will it try to re-decode it?

In terms of output, ElementTree defaults to ascii, but Martin's wrapper
changes that to utf-8.

> If I get some time, I'll look into adding some new exception classes,
> and moving the encoding stuff higher up.

Cool.

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

iD8DBQFC3UFX0F+nu1YWqI0RAtOzAJ9r4l59HtRowTzo1nL80IypFN4AfwCggoc1
puRstkOUoGDORbABd7nNGTg=
=vcGS
-----END PGP SIGNATURE-----




More information about the bazaar mailing list