load_yaml: _load_yaml(): Specify UTF-8 encoding

open() without an encoding argument decodes the file with the
platform's locale-dependent default, so the same YAML file can be
decoded differently (or fail) on hosts with different locale
settings.  YAML files are expected to be UTF-8, so say so
explicitly.

Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.84.2
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-08-16 12:20:42 +02:00
commit 717b69f5d8
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61

View file

@ -346,7 +346,7 @@ def _load_yaml(path: str | Path, optional: bool, seen: set[Path]) -> dict[str, A
seen.add(path)
try:
try:
with open(path) as f:
with open(path, encoding = 'utf-8') as f:
loaded = yaml.safe_load(f)
if loaded is None:
ret: dict[str, Any] = {}