[Tutor] paramiko error with put()

Adam Cryer ad.mat.cryer at gmail.com
Thu Dec 23 16:22:05 CET 2010


Hi I am using paramiko 1.7.6 "fanny" on microsoft windows xp v2002 service
pack3 with python 2.4.2

I have the follwing script:
*import paramiko

hostname='blah'
port=22
username='blah'
password='blah'
fullpath='\\\\root\\path\\file.xls'
remotepath='/inbox/file.xls'

self.client= paramiko.SSHClient()
self.client.load_system_host_keys()
self.client.connect(hostname,port,username,password)
sftp = self.client.open_sftp()
sftp.put(fullpath,remotepath)*


and i get the following error:

*sftp.put(fullpath,remotepath))

File "build\bdist.win32\egg\paramiko\sftp_client.py", line 577, in put
File "build\bdist.win32\egg\paramiko\sftp_client.py", line 337, in stat
File "build\bdist.win32\egg\paramiko\sftp_client.py", line 628, in _request
File "build\bdist.win32\egg\paramiko\sftp_client.py", line 675, in
_read_response
File "build\bdist.win32\egg\paramiko\sftp_client.py", line 701, in
_convert_status
IOError: [Errno 2] /inbox/file.xls is not a valid file path**
*

but the path definitely exists (I can move into it using
sftp.chdir('inbox')) I have also tried moving into the folder and using
put() but I get the exact same error (did take out inbox prefix)

Has anyone had this issue?

I would really appreciate you help

Thanks
Ad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20101223/ee5fee1c/attachment.html>


More information about the Tutor mailing list