mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-31 19:16:29 +00:00
fix(gateway): add utf-8 encoding to dead target registry
This commit is contained in:
parent
5b76ce169b
commit
09910bc3a5
1 changed files with 2 additions and 2 deletions
|
|
@ -67,7 +67,7 @@ class DeadTargetRegistry:
|
|||
def _load(self) -> None:
|
||||
try:
|
||||
if self._path.exists():
|
||||
raw = json.loads(self._path.read_text())
|
||||
raw = json.loads(self._path.read_text(encoding="utf-8"))
|
||||
if isinstance(raw, dict):
|
||||
# Only keep well-shaped entries.
|
||||
self._dead = {
|
||||
|
|
@ -82,7 +82,7 @@ class DeadTargetRegistry:
|
|||
try:
|
||||
self._path.parent.mkdir(parents=True, exist_ok=True)
|
||||
tmp = self._path.with_suffix(self._path.suffix + ".tmp")
|
||||
tmp.write_text(json.dumps(self._dead, indent=2))
|
||||
tmp.write_text(json.dumps(self._dead, indent=2), encoding="utf-8")
|
||||
tmp.replace(self._path)
|
||||
except OSError as exc:
|
||||
# Best-effort: keep the in-memory state, don't break delivery.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue