嗨,我使用的paramiko在Microsoft Windows XP V2002服务PACK3 1.7.6 “芬妮” 与Python 2.4.2的paramiko错误
我有follwing脚本:
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)
错误我得到的是:
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
但路径肯定存在我 也曾尝试移动到文件夹,并用放(我可以用sftp.chdir(“收件箱”)进入它),但我得到完全相同的 错误(取出收件箱前缀)
有没有人有这个问题?
干杯 亚光
您是否尝试过使用反斜杠:__remotepath ='\\ inbox \\ file.xls'__? – mouad 2010-12-23 12:22:19