Files
hermes-agent/hermes_cli
kshitijk4poor 4de541df1a refactor(utils): stage every atomic writer's temp through one mkstemp_beside helper
Five writers (cron jobs store, utils._atomic_write, config._write_env_lines,
the env_loader sanitize rewrite, backup _extract_member_atomically) each
hand-rolled "stage beside the resolved symlink target", and only cron kept the
PermissionError fallback. A symlink into another filesystem whose real
directory is read-only to us therefore made utils/config/backup raise and the
.env sanitize silently skip (NUL bytes left on disk), where base saved by copy.

mkstemp_beside picks the same directory atomic_replace renames into (resolved
only when the target is a link) and, on PermissionError, retries beside the
link so the base EXDEV -> copy fallback still saves. One rule, one docstring,
one place to test.
2026-10-02 01:02:00 +05:30
..
…
…
…
…
2026-09-28 12:18:42 -07:00
…
…
…