Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when do copy a file using paramiko sftp.put(parent_dir + '/' + filename, dest_dir + '/' + filename), IOError(text) occurred #798

Open
dharmaece opened this issue Aug 16, 2016 · 1 comment

Comments

@dharmaece
Copy link

File "C:\Python27\Wrkout\16082016\commnmthdclass.py", line 348, in copy_file
sftp.put(parent_dir + '/' + filename, dest_dir + '/' + filename)
File "C:\Python27\lib\site-packages\paramiko\sftp_client.py", line 676, in put

return self.putfo(fl, remotepath, file_size, callback, confirm)

File "C:\Python27\lib\site-packages\paramiko\sftp_client.py", line 637, in put
fo
reader=fl, writer=fr, file_size=file_size, callback=callback
File "C:\Python27\lib\site-packages\paramiko\sftp_client.py", line 599, in _tr
ansfer_with_callback
writer.write(data)
File "C:\Python27\lib\site-packages\paramiko\file.py", line 381, in write
self._write_all(data)
File "C:\Python27\lib\site-packages\paramiko\file.py", line 498, in _write_all
count = self._write(data)
File "C:\Python27\lib\site-packages\paramiko\sftp_file.py", line 180, in _writ
e
t, msg = self.sftp._read_response(req)
File "C:\Python27\lib\site-packages\paramiko\sftp_client.py", line 781, in _re
ad_response
self._convert_status(msg)
File "C:\Python27\lib\site-packages\paramiko\sftp_client.py", line 811, in _co
nvert_status
raise IOError(text)
IOError: Failure

@nolaskito123
Copy link

import os
local_path = os.path.join(parent_dir, filename)
remote_path = os.path.join(dest_dir, filename)
sftp.put(local_path, remote_path)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants