[Tutor] sftp get single file
Matt Herzog
msh at blisses.org
Mon Jul 20 22:26:24 CEST 2009
On Mon, Jul 20, 2009 at 10:22:37PM +0200, Sander Sweers wrote:
> I do not know paramiko but looking over the client documentations...
>
> 2009/7/20 Matt Herzog <msh at blisses.org>:
> > if __name__ == "__main__":
> > t = paramiko.Transport((hostname, port))
> > t.connect(username=username, password=password)
> > sftp = paramiko.SFTPClient.from_transport(t)
>
> Up to here it looks fine.
>
> > sftp(remotepath,localpath)
>
> If I understand it correctly you need to use sftp.get(remotepath, localpath).
Yeah that's exactly what I have tried, and the error is:
Traceback (most recent call last):
File "./scpgetter.py", line 20, in ?
sftp.get(remotepath, localpath)
File "build/bdist.linux-x86_64/egg/paramiko/sftp_client.py", line 584, in get
File "build/bdist.linux-x86_64/egg/paramiko/sftp_client.py", line 240, in open
File "build/bdist.linux-x86_64/egg/paramiko/sftp_client.py", line 609, in _request
File "build/bdist.linux-x86_64/egg/paramiko/sftp_client.py", line 656, in _read_response
File "build/bdist.linux-x86_64/egg/paramiko/sftp_client.py", line 682, in _convert_status
IOError: (2, '')
>
> Greets
> Sander
> _______________________________________________
> Tutor maillist - Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
--
I fear you speak upon the rack,
Where men enforced do speak anything.
- William Shakespeare
More information about the Tutor
mailing list