Closed gferragu closed 2 years ago
I don't really follow what is happening. I don't think that it should matter if .DS_Store is empty since shutil.rmtree removes a directory tree, and there are already many non empty directories in the path handed to it. If it is a permissions issue in that your user cannot delete the directory, that doesn't seem like a gmprocess issue.
Closd by #901.
Describe the bug When the auto-generated
.DS_Store
files are created by Mac's Finder in a gmprocess project's subdirectories (data/raw/ for example), subcommandassemble
may fail due to an error encountered inread_directory.py
This is likely due to.DS_Store
file permissions, which results in a non-empty directory during the call toshutil.rmtree()
hereAdding
.DS_Store
to the EXT_IGNORE list does not fix the issue to the how ignored files are checked here.A fix and possible improvement to the existing method of looping over files and checking their extensions could be to use the built-in
shutil.ignore_patterns()
function, which can be passed as a parameter to the initial call ofshutil.copytree()
here so that unwanted files (both.DS_Store
and those with extensions listed inEXT_IGNORE
) are never copied in the first place.