SFTP error

John A Meinel john at arbash-meinel.com
Tue Dec 6 22:20:57 GMT 2005


Erik Bågfors wrote:
> Hi
> 
> With latest bzr.dev bzr I get the following error when trying to push
> to a sftp url.
> 
> bzr push sftp://erik@bagfors.nu/public_html/bzrk.erik
> bzr: ERROR: exceptions.AttributeError: 'SFTPClient' object has no
> attribute 'file'
>   at /home/bagfors/usr/src/bzr.dev/bzrlib/transport/sftp.py line 319
>   in get

I'm not sure what you are seeing, since I definitely have it working for me.
I'm using these steps:

mkdir tmp
cd tmp
mkdir a
cd a
bzr init
echo a > a
bzr add
bzr commit -m a
bzr push sftp://localhost//path/to/tmp/b

At this point, I get a warning that it can't update the working tree, 
but the push succeeds.

If I continue and do:
echo b > b
bzr add
bzr commit -m b
bzr push

It also succeeds.

Do you know what version of paramiko you have? Can you do:
python
 >>> import paramiko
 >>> from paramiko.sftp_client import SFTPClient
 >>> dir(SFTPClient)

On my machine this has a 'file' attribute.

John
=:->


> 
> 
> the bzr.log is this....
> 
> trying to open u'/home/bagfors/usr/src/bzrk.erik' with transport
> <bzrlib.transport.local.LocalTransport object at 0xb77b6a6c>
> got branch format u'Bazaar-NG branch, format 6\n'
> ssh implementation is OpenSSH
> trying to open u'sftp://erik@bagfors.nu/public_html/bzrk.erik' with
> transport <bzrlib.transport.sftp.SFTPTransport object at 0xb77e126c>
> [19192] Tue 15:17:36.383 ERROR: exceptions.AttributeError:
> 'SFTPClient' object has no attribute 'file'
>   at /home/bagfors/usr/src/bzr.dev/bzrlib/transport/sftp.py line 319
>   in get
> Traceback (most recent call last):
>   File "/home/bagfors/usr/src/bzr.dev/bzrlib/commands.py", line 558,
> in run_bzr_catch_errors
>     return run_bzr(argv)
>   File "/home/bagfors/usr/src/bzr.dev/bzrlib/commands.py", line 520, in run_bzr
>     ret = cmd_obj.run_argv(argv)
>   File "/home/bagfors/usr/src/bzr.dev/bzrlib/commands.py", line 233, in run_argv
>     return self.run(**all_cmd_args)
>   File "/home/bagfors/usr/src/bzr.dev/bzrlib/builtins.py", line 456, in run
>     br_to = Branch.open(location)
>   File "/home/bagfors/usr/src/bzr.dev/bzrlib/branch.py", line 120, in open
>     return BzrBranch(t)
>   File "/home/bagfors/usr/src/bzr.dev/bzrlib/branch.py", line 564, in __init__
>     self._check_format(relax_version_check)
>   File "/home/bagfors/usr/src/bzr.dev/bzrlib/branch.py", line 801, in
> _check_format
>     fmt = self.controlfile('branch-format', 'r').read()
>   File "/home/bagfors/usr/src/bzr.dev/bzrlib/branch.py", line 733, in
> controlfile
>     return codecs.getreader('utf-8')(self._transport.get(relpath),
> errors='replace')
>   File "/home/bagfors/usr/src/bzr.dev/bzrlib/transport/sftp.py", line
> 319, in get
>     f = self._sftp.file(path)
> AttributeError: 'SFTPClient' object has no attribute 'file'
> 
> return code 3
> 
> 
> Regards,
> Erik
> 
> 





More information about the bazaar mailing list