Closed mawaliya closed 1 year ago
Not sure if I'm missing something but I don't see where you are passing in IOError to the exceptions argument of the put function. So in your example to reproduce I would expect:
try:
sftp.put(localfile, remotefile, exceptions=IOError, tries=3)
except IOError:
print("Error caught")
Can you confirm that this fixes the behavior? To be clear I should be dealing with the lack of an exceptions argument a bit more concisely than what you got so it's clear to the user what they are missing.
the suggestion works. thank you for the clarification. it wasn't very clear to me that we needed to pass on the exceptions on which we want to retry with tries
argument.
python: 3.10.6 sftpretty:1.1.1 paramiko: 3.3.1 Ubuntu 22.04.3 LTS
When trying to catch error with a retry enabled, when the IOError is thrown, it will not be caught and it will give this stack trace:
Steps to reproduce:
run a similar code like this, but the file exists already in the remote directory so it will give us permission denied error.