[patch][win32] Use u'.' not '.' as hardcoded path

Robert Collins robertc at robertcollins.net
Mon Jan 2 23:33:33 GMT 2006


On Mon, 2006-01-02 at 15:29 -0600, John Arbash Meinel wrote:

>  
> >>So LocalTransport should do something like:
> >>    def __init__(self, base):
> >>        """Set the base path where files will be stored."""
> >>        if base.startswith('file://'):
> >>            base = base[7:]
> >>        base = unicode(base)
> > 
> > 
> > base = base.decode('utf8')
> > 
> > :)
> > 
> > Rob
> 
> Isn't it:
> base = urldecode(base).decode('utf-8')
> 
> Because some of the characters would be escaped into %2F or whatever.

Yes, my bad.

> It also means that 'LocalTransport.list_dir()' needs to encode the
> filenames. If you are truly intending that the Transport api is always urls.
> 
> It seems a little foolish to do utf8 + url encoding in
> Transport.list_dir(), and then do utf8 + url decoding in get(), but I
> suppose it makes it consistent, and probably doesn't add a lot of overhead.

It makes it unambiguous, and prevents the whole class of bugs with url
only transports - where we *cannot* cheat. (I.e. DAV).

Rob

-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060103/3375d8cb/attachment.pgp 


More information about the bazaar mailing list