From ea2cc4f9023c02a2cc130814fdfacc51098efbcf Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Fri, 8 May 2026 14:24:36 -0700 Subject: [PATCH] fix(profiles): pass encoding=utf-8 to distribution.yaml open (#22083) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _distribution_metadata() reads the profile's distribution.yaml without an explicit encoding, which defaults to the platform's locale encoding — UTF-8 on POSIX, cp1252/mbcs on Windows. Files round-tripped between hosts get mojibake on the Windows side. Single-line fix: add encoding='utf-8' to the open() call. Matches the sibling _read_config_model() site at line 398, which already does this. Surfaces once PR #21561 lands the blocking ruff-check CI job (PLW1514 — unspecified-encoding), but the underlying bug is pre-existing on main. --- hermes_cli/profiles.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hermes_cli/profiles.py b/hermes_cli/profiles.py index a8bc229bf9..091d259344 100644 --- a/hermes_cli/profiles.py +++ b/hermes_cli/profiles.py @@ -375,7 +375,7 @@ def _read_distribution_meta(profile_dir: Path) -> tuple: return None, None, None try: import yaml - with open(mf_path, "r") as f: + with open(mf_path, "r", encoding="utf-8") as f: data = yaml.safe_load(f) or {} if not isinstance(data, dict): return None, None, None