fix: add explicit UTF-8 encoding to read_text() calls (#776)

On Windows with non-UTF-8 locale (e.g. GBK), Path.read_text() defaults
to platform encoding, breaking onboarding tests and any source code that
reads JSON/markdown with non-ASCII content.

5 files, 8 call sites fixed.
This commit is contained in:
mvalentsev
2026-04-16 16:00:29 +05:00
parent d4c942417a
commit 09fe2dda3c
5 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -308,7 +308,7 @@ class EntityRegistry:
path = (Path(config_dir) / "entity_registry.json") if config_dir else cls.DEFAULT_PATH
if path.exists():
try:
data = json.loads(path.read_text())
data = json.loads(path.read_text(encoding="utf-8"))
return cls(data, path)
except (json.JSONDecodeError, OSError):
pass