mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Unix: Ignore failure to copy file metadata
See #2023476 (Linux error in new trash management)
This commit is contained in:
parent
f956f4a207
commit
2e49369657
@ -47,7 +47,12 @@ class UnixFileCopier:
|
||||
for src_path, dest_path in self.copy_map.items():
|
||||
with suppress(OSError):
|
||||
os.link(src_path, dest_path, follow_symlinks=False)
|
||||
shutil.copystat(src_path, dest_path, follow_symlinks=False)
|
||||
try:
|
||||
shutil.copystat(src_path, dest_path, follow_symlinks=False)
|
||||
except OSError:
|
||||
# Failure to copy metadata is not critical
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
continue
|
||||
with suppress(shutil.SameFileError):
|
||||
shutil.copy2(src_path, dest_path, follow_symlinks=False)
|
||||
|
Loading…
x
Reference in New Issue
Block a user