From 5a76734072908edef0b722918da56f90f7a20a27 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sun, 3 Dec 2023 21:07:12 -0800 Subject: [PATCH] Warn if file in directory disappears during copy, but don't crash. --- voussoirkit/spinal.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/voussoirkit/spinal.py b/voussoirkit/spinal.py index 29c39e5..0115c20 100644 --- a/voussoirkit/spinal.py +++ b/voussoirkit/spinal.py @@ -279,6 +279,10 @@ def copy_directory( written_bytes = 0 for (source_file, destination_file) in walker: + if not source_file.is_file: + log.warning('%s disappeared during directory copy.', source_file.absolute_path) + continue + if stop_event and stop_event.is_set(): break