mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Ignore a filenotfound error that happens during folder removal on windows despite exists() succeeding
This commit is contained in:
parent
0c66368c9e
commit
e1956f3cff
@ -284,6 +284,12 @@ def copy_tree(
|
||||
if delete_source and os.path.exists(make_long_path_useable(src)):
|
||||
try:
|
||||
shutil.rmtree(make_long_path_useable(src))
|
||||
except FileNotFoundError:
|
||||
# some kind of delayed folder removal on handle close on Windows? Or exists() is succeeding but
|
||||
# rmdir() is failing? Or something deleted the
|
||||
# folder between the call to exists() and rmtree(). Windows is full
|
||||
# of nanny programs that keep users safe from "themselves".
|
||||
pass
|
||||
except OSError:
|
||||
if iswindows:
|
||||
time.sleep(WINDOWS_SLEEP_FOR_RETRY_TIME)
|
||||
|
Loading…
x
Reference in New Issue
Block a user