Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Put crashes if destination already exists as a folder. #23

Closed
edev opened this issue Feb 28, 2019 · 2 comments
Closed

Put crashes if destination already exists as a folder. #23

edev opened this issue Feb 28, 2019 · 2 comments

Comments

@edev
Copy link
Collaborator

edev commented Feb 28, 2019

How to reproduce:

  1. Create a local file named foo
  2. Create a remote folder named foo
  3. Run put foo from the client

Output:

sftp> put main.py
Failure
[dylan@localhost git]$ 

Cause:

In the put action, we catch only FileNotFoundError. This is a subclass of OSError, but we don't catch any other subclasses that might arise, nor the parent class itself.

Solution:

Either (a) add an OSError handler after the FileNotFoundError handler or (b) if the OSError messages are clear enough, replace the FileNotFoundError handler with an OSError handler that looks something like:

except OSError as e:
print("Error:", e.strerror)

@Danc2050
Copy link
Collaborator

Danc2050 commented Mar 2, 2019

This is no longer an issue, yes? Can we close this?

EDIT
Oh, I see. This is for pysftp to know about maybe someday. Nevermind.

@edev
Copy link
Collaborator Author

edev commented Mar 2, 2019

Huh? Nope, you may be right, we may be able to close it. I hadn't updated our issues today.

@Danc2050 Danc2050 closed this as completed Mar 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants