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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user