diff --git a/loopx/cli_commands/refresh_settlement.py b/loopx/cli_commands/refresh_settlement.py index 6a8fb21873..522d4dbf2a 100644 --- a/loopx/cli_commands/refresh_settlement.py +++ b/loopx/cli_commands/refresh_settlement.py @@ -65,7 +65,7 @@ def settle_refreshed_turn( # call the lower-level debit without its receipt-producing adapter. result = subprocess.run( [sys.executable, "-m", "loopx.cli", "--format", "json", *command[1:]], - capture_output=True, text=True, timeout=60, check=False, + capture_output=True, text=True, encoding="utf-8", timeout=60, check=False, ) value = json.loads(result.stdout) if not isinstance(value, dict): diff --git a/loopx/control_plane/turn_driver/codex_context.py b/loopx/control_plane/turn_driver/codex_context.py index b7d7879f1f..8b1b8f4fbb 100644 --- a/loopx/control_plane/turn_driver/codex_context.py +++ b/loopx/control_plane/turn_driver/codex_context.py @@ -163,7 +163,7 @@ def _locked(directory: str) -> Iterator[Path]: root = _private_root(directory) fd = os.open(root / "lock", os.O_CREAT | os.O_RDWR | os.O_NOFOLLOW | os.O_NONBLOCK, 0o600) - with os.fdopen(fd, "r+") as lock: + with os.fdopen(fd, "r+", encoding="utf-8") as lock: if not stat.S_ISREG(os.fstat(lock.fileno()).st_mode): raise ValueError("context lock is not a regular file") fcntl.flock(lock, fcntl.LOCK_EX)