[Tutor] paramiko error with put()

Evert Rol evert.rol at gmail.com
Fri Dec 24 01:27:02 CET 2010


I don't really know the answer, but more a question/note (below):

> Hi I am using paramiko 1.7.6 "fanny" on microsoft windows xp v2002 service pack3 with python 2.4.2
> 
> I have the follwing script:
> import paramiko
> 
> hostname='blah' 
> port=22
> username='blah'
> password='blah'
> fullpath='\\\\root\\path\\file.xls'
> remotepath='/inbox/file.xls'

<snip />


> and i get the following error:


<snip />

> IOError: [Errno 2] /inbox/file.xls is not a valid file path
> 
> but the path definitely exists (I can move into it using sftp.chdir('inbox')) I have also tried moving into the folder and using put() but I get the exact same error (did take out inbox prefix)

chdir('inbox') seems like a relative path, while '/inbox/file.xls' is absolute. Could that be an issue, or does chdir() always translate to absolute path?
Because, depending on your sftp server, you may (likely) not land in the root dir when connecting.
(I've also never seen /inbox in the root dir, so './inbox/file.xls' does seem the more logical choice to me)

As said, no idea really, but this is the only thing that I notice.

Cheers,

  Evert

> 
> Has anyone had this issue? 
> 
> 
> I would really appreciate you help
> 
> Thanks 
> Ad
> 
> 
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor



More information about the Tutor mailing list