-
-
Notifications
You must be signed in to change notification settings - Fork 179
Bugfix: File deleted / emptied when moved / copied onto itself (#546) #547
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
Merged
althonos
merged 22 commits into
PyFilesystem:master
from
tfeldmann:fix/file-deleted-when-moved-onto-itself
Aug 2, 2022
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
ec7c68d
add failing tests
tfeldmann 56bed83
fix OSFS copy
tfeldmann 0e3ed72
assert DestinationExists when using overwrite=False
tfeldmann b3d2d73
fix memoryfs
tfeldmann f1a7bfb
update changelog
tfeldmann cec3e06
add movedir tests
tfeldmann 2b0cbac
add copydir tests
tfeldmann 9a7fe1a
new error names
tfeldmann 2a93304
establish new errors.IllegalDestination
tfeldmann 0f09731
fix osfs
tfeldmann 2e0238a
fix copydir hangup
tfeldmann e157d93
uses validated paths in copydir
tfeldmann a039bb6
assert no files were touched
tfeldmann f9cf49f
fix wrapfs
tfeldmann b4f2dc4
wip copy
tfeldmann 2668bfc
raise DestinationExists if overwrite is not set
tfeldmann 6ef99f6
wrapfs does not need checks sprinkled everywhere anymore
tfeldmann c703c99
remove unneeded code
tfeldmann 300fe89
remove unused import
tfeldmann 9d9dcd6
revert shutil formatting
tfeldmann 3bc8691
use validatepath
tfeldmann 420998d
copy_structure FS can be of type str
tfeldmann File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR has been merged now, but I'm still not convinced that doing an early-exit here, instead of raising an exception, is the correct thing to do? Since trying to move a file onto itself is probably an indication of an application bug? Same comment applies to
movedir
too.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that you point it out, I agree. In UNIX filesystems, moving a file onto itself raises an error, so I think it's fair to expect an
IllegalDestination
there as well.