mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-06-06 14:07:26 -05:00
Fix: Add exception to utime
in copy_basic_file_stats
(#10070)
This commit is contained in:
parent
3849569bd1
commit
bfaab21589
@ -23,11 +23,17 @@ def copy_basic_file_stats(source: Path | str, dest: Path | str) -> None:
|
|||||||
|
|
||||||
The extended attribute copy does weird things with SELinux and files
|
The extended attribute copy does weird things with SELinux and files
|
||||||
copied from temporary directories and copystat doesn't allow disabling
|
copied from temporary directories and copystat doesn't allow disabling
|
||||||
these copies
|
these copies.
|
||||||
|
|
||||||
|
If there is a PermissionError, skip copying file stats.
|
||||||
"""
|
"""
|
||||||
source, dest = _coerce_to_path(source, dest)
|
source, dest = _coerce_to_path(source, dest)
|
||||||
src_stat = source.stat()
|
src_stat = source.stat()
|
||||||
utime(dest, ns=(src_stat.st_atime_ns, src_stat.st_mtime_ns))
|
|
||||||
|
try:
|
||||||
|
utime(dest, ns=(src_stat.st_atime_ns, src_stat.st_mtime_ns))
|
||||||
|
except PermissionError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def copy_file_with_basic_stats(
|
def copy_file_with_basic_stats(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user