Skip to content
Prev Previous commit
Next Next commit
Ignore .nfs placeholder files when catching the error
- I forgot that `os.listdir` also lists hidden files in the previous
  commit
  • Loading branch information
HippocampusGirl committed Jul 30, 2021
commit 7a0803f9483d7e743fb9a5379fbb65cb478b2b87
2 changes: 1 addition & 1 deletion nipype/utils/filemanip.py
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ def emptydirs(path, noexist_ok=False):
try:
shutil.rmtree(path)
except OSError as ex:
elcont = os.listdir(path)
elcont = [p for p in os.listdir(path) if not p.startswith(".nfs")]
if ex.errno in [errno.ENOTEMPTY, errno.EBUSY] and not elcont:
Comment thread
HippocampusGirl marked this conversation as resolved.
fmlogger.warning(
"An exception was raised trying to remove old %s, but the path"
Expand Down