mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
Ignore errors when trying to copy the original file's stats
This commit is contained in:
parent
59d683849e
commit
1c66daf12b
@ -582,7 +582,12 @@ class Consumer(LoggingMixin):
|
|||||||
def _write(self, storage_type, source, target):
|
def _write(self, storage_type, source, target):
|
||||||
with open(source, "rb") as read_file, open(target, "wb") as write_file:
|
with open(source, "rb") as read_file, open(target, "wb") as write_file:
|
||||||
write_file.write(read_file.read())
|
write_file.write(read_file.read())
|
||||||
shutil.copystat(source, target)
|
|
||||||
|
# Attempt to copy file's original stats, but it's ok if we can't
|
||||||
|
try:
|
||||||
|
shutil.copystat(source, target)
|
||||||
|
except Exception: # pragma: no cover
|
||||||
|
pass
|
||||||
|
|
||||||
def _log_script_outputs(self, completed_process: CompletedProcess):
|
def _log_script_outputs(self, completed_process: CompletedProcess):
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user