Warn if file in directory disappears during copy, but don't crash.
This commit is contained in:
parent
21a9e39e52
commit
5a76734072
1 changed files with 4 additions and 0 deletions
|
@ -279,6 +279,10 @@ def copy_directory(
|
||||||
written_bytes = 0
|
written_bytes = 0
|
||||||
|
|
||||||
for (source_file, destination_file) in walker:
|
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():
|
if stop_event and stop_event.is_set():
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue