From cb43cf8e3150f09140b1e80e6bd11c11e0662603 Mon Sep 17 00:00:00 2001 From: Zak Gilliam Date: Tue, 10 Mar 2026 13:23:38 -0500 Subject: [PATCH] fix: handle OSError in copystat and log warnings for skipped operations --- act/utils/save.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/act/utils/save.py b/act/utils/save.py index d73b0b4..37f18e5 100644 --- a/act/utils/save.py +++ b/act/utils/save.py @@ -503,7 +503,17 @@ def _replace_file_atomically(self, source_path, destination_path): shutil.copyfileobj(source_handle, handle) handle.flush() os.fsync(handle.fileno()) - shutil.copystat(source_path, temp_path, follow_symlinks=True) + try: + shutil.copystat(source_path, temp_path, follow_symlinks=True) + except OSError as exc: + if exc.errno not in (errno.EPERM, errno.EACCES): + raise + self.logger.warning( + "reconcile_copystat_skipped source=%s destination=%s error=%s", + source_path, + destination_path, + exc, + ) os.replace(temp_path, destination_path) except Exception: if temp_path and os.path.exists(temp_path):