-
-
Notifications
You must be signed in to change notification settings - Fork 178
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
Bugfix: File deleted / emptied when moved / copied onto itself (#546) #547
Bugfix: File deleted / emptied when moved / copied onto itself (#546) #547
Conversation
My git fu is not so good. Only the latest commit is meant to be in this branch. I'll try to rebase. EDIT: Should be fine now. |
c68718f
to
ec7c68d
Compare
Yes, it successfully fails 😆 |
The github actions probably should have a timeout 😅 They need 6h to expire when there's a loop going wrong. |
I'm sure nobody would mind if you set https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idtimeout-minutes to something sensible? 😃 (and I suspect #520 is probably why the whole test-suite takes so long to fail?) |
@lurch : Fine by me 👍 |
Caveat: This only fixes moving / copying on the same FS instance. I'll try to tackle the problem with the same resources on different FSs in a separate PR. |
Good job again @tfeldmann , apart from my one comment this is pretty solid and helps covering some undefined behaviour 👍 Looking forward to see how the plugins ( |
if _src_path == _dst_path: | ||
# early exit when moving a file onto itself | ||
return |
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.
Type of changes
Checklist
Description
Draft PR for fixing #546.