Sftp error New Help
dieter
dieter at handshake.de
Wed May 20 01:36:29 EDT 2015
ejmmanning at gmail.com writes:
> Traceback (most recent call last):
> File "Juniper.py", line 66, in <module>
> device_information()
> File "Juniper.py", line 26, in device_information
> device_connection(dev_ip,dev_username,dev_password)
> File "Juniper.py", line 54, in device_connection
> sftp_transfer(r)
> File "Juniper.py", line 61, in sftp_transfer
> c.put("%r" %r)
> File "/usr/local/lib/python2.7/dist-packages/pysftp.py", line 349, in put
> confirm=confirm)
> File "/usr/local/lib/python2.7/dist-packages/paramiko/sftp_client.py", line 667, in put
> file_size = os.stat(localpath).st_size
> OSError: [Errno 2] No such file or directory: "<closed file 'juniper-results20150519-191928.txt', mode 'a' at 0x24a0780>"
Apparently, you pass to "sftp_transfer" a parameter with an unexpected
type. Looks as if it would expect a file name (and you pass a
file descriptor, referencing a closed file). Thus, pass the filename
and try again.
More information about the Python-list
mailing list