[BUG] sftp push usage

Alexander Belchenko bialix at ukr.net
Thu May 25 12:55:14 BST 2006


I think it's a bug.

Today I'm testing how paramiko works on win32.
I try to push paramiko's own branch to linux machine.
I specify wrong path but bzr behaviour is buggy.

D:\user\python\bzr\third.party\paramiko>bzr push sftp://root@bj/paramiko/
Connected (version 1.99, client OpenSSH_3.8.1p1)
SSH root at bj password:
Authentication (password) successful!
Secsh channel 1 opened.
Opened sftp connection (server version 3)
bzr: ERROR: No such file: '/paramiko': [Errno 2] No such file
Exception exceptions.AttributeError: "'LockableFiles' object has no
attribute '_lock_count'" in <bound method LockableFiles.__de
l__ of LockableFiles(<bzrlib.transport.sftp.SFTPTransport
url=sftp://root@bj/paramiko/>)> ignored

After execution of this command on the linux side in /root directory
appear subdirectory named "paramiko". So, if my path totally wrong I
suspect that nothing should be happens on server side. But it's not true.

Probably problem is here (quote from .bzr.log):

[ 1108] Thu 12:59:57.732 INFO: Opened sftp connection (server version 3)
trying to open u'sftp://root@bj/paramiko/' with transport
<bzrlib.transport.sftp.SFTPTransport url=sftp://root@bj/paramiko/>
[ 1108] Thu 12:59:57.732 DEBUG: open('/paramiko/.bzr/branch-format', 'rb')
[ 1108] Thu 12:59:57.742 DEBUG: mkdir('paramiko')
[ 1108] Thu 12:59:57.752 DEBUG: stat('/paramiko')
[ 1108] Thu 12:59:57.762 ERROR: No such file: '/paramiko': [Errno 2] No
such file

It looks like the sftp transport at first create just 'paramiko', and
then try to stat '/paramiko'.

When I specify relative path, as:

D:\user\python\bzr\third.party\paramiko>bzr push sftp://root@bj/~/paramiko/
Connected (version 1.99, client OpenSSH_3.8.1p1)
SSH root at bj password:
Authentication (password) successful!
Secsh channel 1 opened.
Opened sftp connection (server version 3)
0 revision(s) pushed.


Good news: because paramiko know how to request password from command
prompt, sftp works OK even without putty, pageant and other helpers
utility. So, basic bzr.exe distribution is ready for sftp on win32.
But selftest for sftp transport should be rewritten for make it passed
on win32.

--
Alexander






More information about the bazaar mailing list