From ba50e86563cac49a4db2f964607b1cad8eecb358 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Fri, 19 Jun 2026 07:06:13 -0700 Subject: [PATCH] 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'. --- gateway/kanban_watchers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gateway/kanban_watchers.py b/gateway/kanban_watchers.py index 123b8aafdd5..21753054f01 100644 --- a/gateway/kanban_watchers.py +++ b/gateway/kanban_watchers.py @@ -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):