Read UTF-8 test fixtures with explicit encoding (#3245)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
ShuQingDollarVoyager 2026-08-14 18:08:55 +08:00 • committed by GitHub
commit 2378e560fb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -27,7 +27,7 @@ _LOWLEVEL_STORIES = [name for name in sorted(STORIES) if story_cfg(name)["lowlev
def _parse(path: Path) -> ast.Module:
"""Parse ``path`` into an AST module."""
return ast.parse(path.read_text(), filename=str(path))
return ast.parse(path.read_text(encoding="utf-8"), filename=str(path))
def _resolve(node: ast.ImportFrom, package: str) -> str: