SFTP tests fail on Windows

Robert Collins robertc at robertcollins.net
Mon May 1 23:15:40 BST 2006


On Mon, 2006-05-01 at 17:05 -0500, John Arbash Meinel wrote:
> Alexander Belchenko wrote:
> 
> ...
> 
> >> I don't know if you have any time to look into it Alexander, but since
> >> you raised the issue, I thought I would mention what I thought was the
> >> solution.
> > 
> > I've just install fresh paramiko on my machine and run bzr selftest.
> > During selftest I've got numerous messages like that:
> > 
> > bzr: WARNING: Exception from within unit test server thread:
> > <exceptions.AttributeError instance at 0x03365940>
> > 
> > In test.log I see numerous errors in SFTP tests that point to 2 similar
> > errors: NoSuchFile and FileExists. Probably this errors raised because
> > of path issues. How can I help to fix it?
> > 
> > I need to have working SFTP transport because I want to use it in my
> > real work: I have 2 machines connected together (windows and linux). I
> > can connect to linux machine from windows via ssh. And I want to use bzr
> > to version control some files from linux machine.
> > 
> > -- 
> > Alexander
> 
> 
> Well, in actuality, SFTP works just fine under windows. I frequently
> checkout code from a Linux box onto my Windows machine.
> The big issue is that the tests fail, because bzr isn't able to get a
> file over sftp from a windows machine, because it doesn't know how to
> request the file H:/foo.
> As I outlined above, it should probably be requesting the file:
> sftp://localhost/H|/foo
> or at the very least
> sftp://localhost/H:/foo
> 
> I don't know what sftp servers exist for windows, so I don't know what
> the "official" paths look like, but I think the above path will at least
> get us 90% of the way.
> 
> (The biggest trick is that right now the code just does:
> sftp_url = "sftp://localhost" + abspath(path)
> 
> But for win32 it needs to do:
> sftp_url = "sftp://localhost/" + munge(abspath(path))
>                             ^--very important

I think that a better approach is to implement the previously discussed
transport backing server for the sftp stub server.

Then the transport server sftp://localhost/ can be backed by
LocalTransport(file:///C|/), so a request for
sftp://localhosthost/autoexec.bat returns C:\autoexec.bat.

This means no platform specific code path is needed, and also allows us
to start testing the sftp permissions code paths on windows, by backing
the sftp server with a MemoryTransport.

Rob

Cheers,
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: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060502/76ceb246/attachment.pgp 


More information about the bazaar mailing list