嗨,我使用的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