mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-27 17:58:07 +00:00
fix(update): explicit utf-8 decoding on systemctl restart calls
Windows-footguns lint: subprocess text=True without encoding= decodes via locale.getpreferredencoding(). Match the file's house style.
This commit is contained in:
parent
bd03960071
commit
3dc2decd43
1 changed files with 12 additions and 2 deletions
|
|
@ -7124,7 +7124,12 @@ def _try_restart_systemd_service(svc_name: str, cgroup_path: str | None = None)
|
|||
["systemctl", "--user", "restart", svc_name],
|
||||
):
|
||||
try:
|
||||
r = subprocess.run(candidate, capture_output=True, text=True, timeout=15)
|
||||
r = subprocess.run(
|
||||
candidate,
|
||||
capture_output=True,
|
||||
text=True, encoding="utf-8", errors="replace",
|
||||
timeout=15,
|
||||
)
|
||||
if r.returncode == 0:
|
||||
return True
|
||||
except (FileNotFoundError, subprocess.TimeoutExpired, OSError):
|
||||
|
|
@ -7132,7 +7137,12 @@ def _try_restart_systemd_service(svc_name: str, cgroup_path: str | None = None)
|
|||
return False
|
||||
|
||||
try:
|
||||
r = subprocess.run(cmd, capture_output=True, text=True, timeout=15)
|
||||
r = subprocess.run(
|
||||
cmd,
|
||||
capture_output=True,
|
||||
text=True, encoding="utf-8", errors="replace",
|
||||
timeout=15,
|
||||
)
|
||||
return r.returncode == 0
|
||||
except (FileNotFoundError, subprocess.TimeoutExpired, OSError):
|
||||
return False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue