| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Path.read_text() without an encoding argument uses the locale preferred encoding, which on Windows is the ANSI code page (e.g. GBK on Chinese-locale systems). manifest.toml and the story sources are UTF-8, so tests/examples failed to collect or run there. Fixes modelcontextprotocol#3244 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
| Back | FazBrowse Home | New Git URL |
Summary
Fixes #3244.
Two Path.read_text() calls in tests/examples omit the encoding argument, so they decode with the locale preferred encoding - on Windows that is the ANSI code page. On non-Western-locale Windows (e.g. Chinese locale, cp936/GBK) this raises UnicodeDecodeError: tests/examples/conftest.py:41 fails at collection (8 collection errors blocking the whole directory) and tests/examples/test_story_shape.py:30 fails ~70 parametrized tests. CI's windows-latest uses cp1252, which happens to decode the same bytes without raising, so this only reproduces on non-Western locales.
Both files being read (manifest.toml, story sources) are UTF-8 - TOML is UTF-8 by specification - so this passes encoding=utf-8 explicitly at both call sites.
Test plan
Disclosure
This fix was prepared with AI assistance (Claude Code); I have reviewed and verified the change myself.
🤖 Generated with Claude Code