From 750eba0498e44a11b371ac1ccd9c325dc5955cb6 Mon Sep 17 00:00:00 2001 From: Gabriel Schubiner Date: Mon, 10 Jun 2024 13:37:09 -0400 Subject: [PATCH] Ignore errors for shutil.rmtree() in BIDS writer --- src/bidsi/bids_writer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bidsi/bids_writer.py b/src/bidsi/bids_writer.py index 34d063d..dbbcdab 100644 --- a/src/bidsi/bids_writer.py +++ b/src/bidsi/bids_writer.py @@ -207,7 +207,7 @@ def _merge_folder( return path, True case MergeStrategy.OVERWRITE: # Remove and recreate directory. - shutil.rmtree(path) + shutil.rmtree(path, ignore_errors=True) self._ensure_directory_path(path, is_dir=True) return path, True case MergeStrategy.KEEP: