Skip to main content

All Questions

Filter by
Sorted by
Tagged with
18 votes
3 answers
34k views

"'Connection' object has no attribute '_sftp_live'" when pysftp connection fails

I'd like to catch nicely the error when "No hostkey for host *** is found" and give an appropriate message to the end user. I tried this: import pysftp, paramiko try: with pysftp....
Basj's user avatar
  • 46k
1 vote
2 answers
2k views

PySFTP/Paramiko exceptions leaking into stderr

I am trying to catch paramiko exceptions but they are still written to stderr. Is there a way to stop writing there? EDIT: It happens even before paramiko gets involved: import pysftp try: ...
Andy's user avatar
  • 10.9k