mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-21 10:22:18 +00:00
fix: open dispatcher lock file with explicit utf-8 encoding
ruff (unspecified-encoding) and the Windows-footgun checker both flag open() in text mode without encoture=. Keep text mode (the Windows lock path in _try_acquire_file_lock writes a str newline) and pass encoding='utf-8'.
This commit is contained in:
parent
226e9322e1
commit
ba50e86563
1 changed files with 1 additions and 1 deletions
|
|
@ -51,7 +51,7 @@ def _acquire_singleton_lock(lock_path) -> "tuple[Optional[object], str]":
|
|||
return None, "unavailable"
|
||||
try:
|
||||
Path(lock_path).parent.mkdir(parents=True, exist_ok=True)
|
||||
handle = open(str(lock_path), "a+")
|
||||
handle = open(str(lock_path), "a+", encoding="utf-8")
|
||||
except OSError:
|
||||
return None, "unavailable"
|
||||
if not _try_acquire_file_lock(handle):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue