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
@@ -10,7 +10,7 @@ from mempalace.instructions_cli import AVAILABLE, INSTRUCTIONS_DIR, run_instruct
def test_run_instructions_valid_name(capsys):
"""Valid name prints the .md file content."""
name = "init"
expected = (INSTRUCTIONS_DIR / f"{name}.md").read_text()
expected = (INSTRUCTIONS_DIR / f"{name}.md").read_text(encoding="utf-8")
run_instructions(name)
captured = capsys.readouterr()
assert captured.out.strip() == expected.strip()