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

mv: no-op when paths are the same #1218

Merged
merged 4 commits into from
Mar 17, 2023

Conversation

DavidKatz-il
Copy link
Contributor

@DavidKatz-il DavidKatz-il commented Mar 16, 2023

fixes: fsspec/s3fs#711

Previous: If you run mv('path', 'path'), the mv function will call cp and then rm, resulting in the removal of the original 'path'.
Revised: If you run mv('path', 'path'), the mv function will not perform any action as the source and destination paths are the same.

@martindurant
Copy link
Member

Any chance of adding a test in one of the backends?

@DavidKatz-il
Copy link
Contributor Author

Where should we add this test (which test file)?

@martindurant
Copy link
Member

I suggest fsspec.implementations.tests.test_memory and use a test fixture m (an instance of MemoryFileSystem) like all the other tests there.

@martindurant martindurant merged commit 5920300 into fsspec:master Mar 17, 2023
@DavidKatz-il DavidKatz-il deleted the mv_same_path branch March 18, 2023 18:10
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.

mv('filepath','filepath') results in deletion of the file rather than no action/inplace move
2 participants