-
Couldn't load subscription status.
- Fork 1.3k
utils/fs: checking files ownership in 'move' (#4348) #4832
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
Conversation
Exception is verbose enough.
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.
Looks great! One minor thing
If error related to access/permission, throw the newly created FileOwnershipError exception, otherwise throw the OSError as is.
|
@danielfleischer looks good, the tests |
Using the function _unlink which includes error handling.
|
Made a small fix; used |
|
@danielfleischer Thank you very much! |
Files are checked for ownership by trying to
chmodthem before moving them around; if fail, return a verbose exception.Previous behavior: moving files to a temp folder and then do the check; when fail, files seemed to be missing.
Should fix #4348 and maybe fix #2992.
❗ I have followed the Contributing to DVC checklist.
📖 If this PR requires documentation updates, I have created a separate PR (or issue, at least) in dvc.org and linked it here.
Thank you for the contribution - we'll try to review it as soon as possible. 🙏