test(sweep): read feedback and manifest files as UTF-8 (#624) - #766
test(sweep): read feedback and manifest files as UTF-8 (#624)#766Polloinfilzato wants to merge 1 commit into
Conversation
…#624) Four bare `open(...).read()` calls used the platform default encoding and leaked the handle. The default is not UTF-8 on Windows and CI runs the suite on windows py3.11 and py3.14, so a non-ASCII byte in one of these files would raise UnicodeDecodeError there and nowhere else. Matches the sibling read at tests/test_sweep.py:4458, fixed in bmad-code-org#616.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. WalkthroughFour assertions in ChangesTest file encoding consistency
Estimated code review effort: 1 (Trivial) | ~3 minutes Merge Risk: ⚪ Minimal · up to Sweep tests now decode intent, feedback, and manifest files as UTF-8, making test behavior deterministic across platforms without changing production behavior. The change is ready to merge. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What
Four bare
open(...).read()calls intests/test_sweep.pynow read UTF-8 explicitly throughPath.read_text, matching the sibling at:4458that #616 already fixed.Why
They use the platform default encoding and leak the handle. The default is not UTF-8 on Windows and CI runs
windows py3.11/py3.14, so a non-ASCII byte in one of these files would raiseUnicodeDecodeErrorthere and nowhere else.Fixes #624.
How
:4063— the instance the issue names, using the one-liner it proposes.:1617,:2412,:4034— the same defect in the same file, found by the same search. Happy to drop these three if you would rather keep the PR to the filed line.Testing
uv run pytest -q tests/test_sweep.py— 198 passed.trunk checkclean. These tests pass before and after: the fault is latent and only reachable under a non-UTF-8 default encoding, so this is a non-regression check rather than a proof.Changelog
n/a — test-only, nothing user-visible.
Summary by CodeRabbit