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

Transport: SshTransport bug in method rename #6725 solved #6750

Closed
wants to merge 2 commits into from

Conversation

Anurag0git
Copy link

The comment in the code indicates a potential bug or misunderstanding around raising an OSError when newpath does not exist. The purpose of renaming is usually to move or rename a file or folder to a new location, so newpath doesn't need to exist. I think, the check might want to verify if newpath already exists to prevent overwriting existing files/folders unintentionally.
In my view it could be adjusted by raising an error if newpath exists rather than if it does not. A more appropriate exception might be FileExistsError.

The new code now checks if oldpath exists and raises an OSError if not.
Also the added check to ensure that newpath doesn't already exist (with using FileExistsError), to avoid unintentional overwriting.

Please let me know if its right,and I would really like to keep contributing more

@agoscinski agoscinski requested a review from khsrali February 10, 2025 07:50
@khsrali
Copy link
Contributor

khsrali commented Feb 10, 2025

@Anurag0git , Thanks a lot for your interest.
However, issue #6725 is solved through PR #6735

To save your time, it's the best first to check if there's an ongoing PR on the issue you are going to solve, before working on it. At least this is the way I'm advised to do it :)

We appreciate your interest for more contribution,
You're always welcome to find and solve another issue :)

@khsrali khsrali closed this Feb 10, 2025
@Anurag0git
Copy link
Author

@Anurag0git , Thanks a lot for your interest. However, issue #6725 is solved through PR #6735

To save your time, it's the best first to check if there's an ongoing PR on the issue you are going to solve, before working on it. At least this is the way I'm advised to do it :)

We appreciate your interest for more contribution, You're always welcome to find and solve another issue :)

Okay, thanks for clarifying!

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

Successfully merging this pull request may close these issues.

2 participants