From 472be1247df12e6460dfaef97a7b7ed1fee82944 Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 25 May 2026 10:32:36 +1000 Subject: [PATCH] fix(service_manager): pass encoding to Path.read_text in _s6_running PR #30136 CI: ruff PLW1514 (preview rule unspecified-encoding) failed on `Path('/proc/1/comm').read_text().strip()` introduced by commit 2f8ceeab9 (the daimon-nous critical-bug fix that switched s6 detection off /proc/1/exe to /proc/1/comm so it works for the unprivileged hermes user). Add explicit encoding='utf-8'. /proc/1/comm is always plain ASCII (the kernel's PR_GET_NAME / TASK_COMM_LEN buffer), so utf-8 is correct and locale-independent. --- hermes_cli/service_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hermes_cli/service_manager.py b/hermes_cli/service_manager.py index 22aa08c4479..b8c2158b8dc 100644 --- a/hermes_cli/service_manager.py +++ b/hermes_cli/service_manager.py @@ -143,7 +143,7 @@ def _s6_running() -> bool: init, or an unrelated process named ``s6-svscan``). """ try: - comm = Path("/proc/1/comm").read_text().strip() + comm = Path("/proc/1/comm").read_text(encoding="utf-8").strip() except OSError: return False if comm != "s6-svscan":