Skip to content
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

shutil functions are not working some file systems #127

Open
sapetnioc opened this issue Feb 6, 2023 · 2 comments
Open

shutil functions are not working some file systems #127

sapetnioc opened this issue Feb 6, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@sapetnioc
Copy link
Member

This is the case on several file systems used in Neurospin. The use of os.setxattrs raises a permission denied exception. But shutil functions that move files are calling it making BrainVISA being unusable.

@sapetnioc sapetnioc added the bug Something isn't working label Feb 6, 2023
@sapetnioc
Copy link
Member Author

An urgent workaround is required here for a user using a shared development environment. For this, I will provide a modified image where shutil._setxattrs does nothing. It is a possibility for shutil if extended attributes are not supported by system. I will just change the test for this image. This will be in a casa-dev-5.3-17-neurospin.sif image. If it works and Neurospin users report the same kind of problems, we may have to do the same for user images.

@ylep
Copy link
Member

ylep commented Mar 13, 2023

I actually encountered and fixed a similar issue in brainvisa/brainvisa-spm@d67cf36.

A less drastic way of fixing the issue is to replace shutil.move(src,dst) by shutil.move(src, dst, copy_function=shutil.copyfile) when we do not need to copy file metadata (mode, mtime, xattrs...).

Maybe we should add some functions to soma-base that reimplement shutil.move, shutil.copy, shutil.copy2, but ignore PermissionErrors that occur during the copy of file metadata?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants