All Questions
2 questions
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....
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:
...