From 0e9010c8b9d7ed3c947273af2e81236b46e9f179 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Tue, 28 Jul 2026 05:37:39 -0700 Subject: [PATCH] Installer: name the encoding when syncing the prebuilt marker (#7554) sync_marker_llama_backend read and wrote UNSLOTH_PREBUILT_INFO.json without an encoding, so the operator locale decided it and the file could crash or turn to mojibake on Windows. The sibling helper 15 lines above already passes encoding = "utf-8"; match it. This is what test_shipping_code_names_an_encoding has been failing on, and since that test is a repo-wide AST scan it turns Repo tests (CPU) red on every PR that touches studio/. --- studio/install_llama_prebuilt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/studio/install_llama_prebuilt.py b/studio/install_llama_prebuilt.py index 346796a8c7..529b90c3e3 100644 --- a/studio/install_llama_prebuilt.py +++ b/studio/install_llama_prebuilt.py @@ -5644,7 +5644,7 @@ def sync_marker_llama_backend(install_dir: Path, llama_backend: str | None) -> N """Sync the persisted llama.cpp backend when the bundle is reused unchanged.""" marker_path = install_dir / "UNSLOTH_PREBUILT_INFO.json" try: - marker = json.loads(marker_path.read_text()) + marker = json.loads(marker_path.read_text(encoding = "utf-8")) except (OSError, ValueError): return if not isinstance(marker, dict) or marker.get("llama_backend") == llama_backend: @@ -5653,7 +5653,7 @@ def sync_marker_llama_backend(install_dir: Path, llama_backend: str | None) -> N marker.pop("llama_backend", None) else: marker["llama_backend"] = llama_backend - marker_path.write_text(json.dumps(marker, indent = 2) + "\n") + marker_path.write_text(json.dumps(marker, indent = 2) + "\n", encoding = "utf-8") log(f"existing install reused; recorded llama_backend={llama_backend!r} from this run")