mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-06 23:05:42 +01:00
In cases where a temporary file is created or used, copy the original file stats to it
This commit is contained in:
parent
36b4fff5c7
commit
883937bfd7
2 changed files with 8 additions and 1 deletions
|
|
@ -326,7 +326,7 @@ class Consumer(LoggingMixin):
|
|||
dir=settings.SCRATCH_DIR,
|
||||
)
|
||||
self.path = Path(tempdir.name) / Path(self.filename)
|
||||
shutil.copy(self.original_path, self.path)
|
||||
shutil.copy2(self.original_path, self.path)
|
||||
|
||||
# Determine the parser class.
|
||||
|
||||
|
|
@ -582,6 +582,7 @@ class Consumer(LoggingMixin):
|
|||
def _write(self, storage_type, source, target):
|
||||
with open(source, "rb") as read_file, open(target, "wb") as write_file:
|
||||
write_file.write(read_file.read())
|
||||
shutil.copystat(source, target)
|
||||
|
||||
def _log_script_outputs(self, completed_process: CompletedProcess):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue