pysftp / paramiko problem

dieter dieter at handshake.de
Wed Jun 12 00:59:17 EDT 2019


Robin Becker <robin at reportlab.com> writes:
> I am trying to convert older code that uses ftplib as the endpoint has switched to sftp only.
>
> I am using the pysftp wrapper around paramiko.
>
> The following script fails
>
> def main():
>     import pysftp
>     with pysftp.Connection('ftp.remote.com', username='me', password='xxxxxx') as sftp:
>         print('top level')
>         print(sftp.listdir())
>         print(sftp.normalize(u'XXXX'))

>From the "sftp" documentation:

 |  normalize(self, remotepath)
 |      Return the expanded path, w.r.t the server, of a given path.  This
 |      can be used to resolve symlinks or determine what the server believes
 |      to be the :attr:`.pwd`, by passing '.' as remotepath.

This suggests that your observation could be explained
by "u'XXXX'" being a broken symlink.




More information about the Python-list mailing list