Skip to content

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