Closed gjost closed 3 years ago
It doesn't make sense that there should be a PermissionError when the repo and files dirs were created by the same process.
Problem occurs when re-uploading an existing file. You'd think this would return a SameFileError
but it's not the same file -- the binary was previously ingested into git-annex so the actual file is a symlink pointing to the annex dir.
According to (the Python docs)[https://docs.python.org/3/library/exceptions.html?highlight=permissionerror#PermissionError], PermissionError
corresponds to errno EACCES
and EPERM
. errno.EACCES
is "Permission denied" while errno.EPERM
is "Operation not permitted".
We need to either detect that the file already exists or use shutil.copyfile
's follow_symlinks
flag to overwrite the file in the annex dir. Will try the former.
Somewhat of an edge-case. Re-verify that the behavior still exists; if so, we'll decide whether to fix or ignore
@pkikawa will check if behavior still exists
behavior no longer present as of 5.2.2
When user re-uploaded a previously uploaded file, they see the following error:
Instead of this ugly error they should see a nice "Already uploaded this file to $ENTITY with role $ROLE." message.