Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Does pysftp need a logout?
#1
I've been practicing with ssh, sftp and pysftp.

Somehow I managed to make them all work, which is almost a wonder for me!

If I connect from a bash shell using sftp, I need to enter bye or exit to logout.

In pysftp I see no such choice.

Does pysftp log out automatically when the job is done?
Reply
#2
According to https://pysftp.readthedocs.io/en/release...ight=close there is a close method which you can use. If you need the connection for the whole lifetime of your application, then you don't really need to bother closing it, though using a context manager with it would probably be considered a best practice.
Reply
#3
Thanks, I didn't see that! I just want to do things correctly.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  pysftp connection issue geil007 0 2,786 May-18-2022, 08:40 AM
Last Post: geil007
  Use pysftp to get the content of a remote folder Pedroski55 0 6,900 Jun-18-2019, 09:22 AM
Last Post: Pedroski55
  pysftp pop-up 'Client forking' micksulley 5 3,325 Dec-21-2018, 02:07 AM
Last Post: Larz60+
  PySFTP ChDir Error490 whoknows 2 3,925 Jan-19-2018, 08:18 PM
Last Post: whoknows
  PYSFTP - Password Change torz 0 2,393 Dec-11-2017, 02:32 AM
Last Post: torz

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020