mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix(backup): handle files with pre-1980 timestamps
ZipFile.write() raises ValueError for files with mtime before 1980-01-01 (the ZIP format uses MS-DOS timestamps which can't represent earlier dates). This crashes the entire backup. Add ValueError to the existing except clause so these files are skipped and reported in the warnings summary, matching the existing behavior for PermissionError and OSError.
This commit is contained in:
parent
afba54364e
commit
12c8cefbce
2 changed files with 29 additions and 1 deletions
|
|
@ -201,7 +201,7 @@ def run_backup(args) -> None:
|
|||
else:
|
||||
zf.write(abs_path, arcname=str(rel_path))
|
||||
total_bytes += abs_path.stat().st_size
|
||||
except (PermissionError, OSError) as exc:
|
||||
except (PermissionError, OSError, ValueError) as exc:
|
||||
errors.append(f" {rel_path}: {exc}")
|
||||
continue
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue