sftp urls are interpreted as a local paths

Jan Hudec bulb at ucw.cz
Wed May 17 09:10:40 BST 2006


On Tue, May 16, 2006 at 08:02:57 -0500, John Arbash Meinel wrote:
> Matthieu Moy wrote:
> > Haakon Riiser wrote:
> > 
> >> Btw, shouldn't bzr report this problem to the user when
> >> encountering sftp:// urls, instead of just converting it to a
> >> local path?
> > 
> > I think this was the initial behavior (raise an error, saying that
> > paramiko is needed). It was IMHO better (I can't imagine someone typing
> > sftp://something for a local path).
> > 
> 
> I agree. The specific issue is if we had multiple sftp handlers.
> 
> What happened is that we ended up with multiple http handlers, so we
> needed a way to fall back after trying the first one. Because we support
> decorators, and other such things, it isn't quite as trivial to just
> check for the protocol (we support stuff like readonly+sftp:// for instance)
> 
> However, I did fix up some of that in my encoding branch, since I am
> working on fixing up how Transport uses URLs instead of whatever mix it
> is using now.
> 
> So if it gets something that looks like a URL (has :// in it), then it
> will complain about an unsupported protocol, rather than trying it as a
> local path.
> 
> But it could use a little bit more work, so that it would give the
> proper error saying what needs to be installed.

Maybe the sftp handler could print a UserWarning every time it is called
to handle an URL and fails to run because paramiko does not load.
It might be appropriate for the http one as well (giving a warning that
http would be faster if you had pycurl).

-- 
						 Jan 'Bulb' Hudec <bulb at ucw.cz>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060517/f8473672/attachment.pgp 


More information about the bazaar mailing list