Repository navigation
Fix Windows cp1252 encoding bugs in build_all_github.py - #21
Merged
Merged
Conversation
First real run (v1.7.3.3, test pre-release) surfaced two bugs, both the same root cause: Windows' default console/subprocess encoding is cp1252, not UTF-8 — build_all.py's own _Tee already works around this for its output, build_all_github.py didn't. 1. `git log -1 --pretty=%B` was decoded with subprocess's platform default (cp1252) instead of UTF-8, mangling non-ASCII characters (em-dashes -> "—") in the commit-message-derived release notes — the actual release body v1.7.3.3 shipped with. Added encoding="utf-8" to the subprocess.run() call. 2. The final success print() (uses a ✓) crashed with UnicodeEncodeError on the Windows console after build_all.main() had already restored the real stdout/stderr — cosmetic (the Release + all 4 assets were already published successfully by that point) but made the job report red for a fully successful run. Reconfigures stdout/stderr to UTF-8 with errors="replace" at module load, covering every print() in this file. v1.7.3.3's pre-release (garbled body, otherwise correct) was deleted manually — this fix is for the next real run. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JYLx9STTgfo9KXLC2Gog3g
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The first real
build-release.ymlrun (v1.7.3.3, test pre-release) actually succeeded end-to-end — build, tests, and all 4 release assets uploaded — but surfaced two bugs, both rooted in Windows' default console/subprocess encoding being cp1252, not UTF-8 (build_all.py's own_Teealready works around this class of issue for its own output;build_all_github.pydidn't):git log -1 --pretty=%Bwas decoded with the subprocess default (cp1252) instead of UTF-8, mangling non-ASCII characters (em-dashes →—) in the commit-message-derived release notes — the real v1.7.3.3 release body shipped with garbled text. Fixed withencoding="utf-8"on thesubprocess.run()call.print()(uses a ✓) crashed withUnicodeEncodeErrorafterbuild_all.main()had already restored the real stdout/stderr — cosmetic (Release + assets were already published by that point) but made a fully successful run report red. Fixed by reconfiguring stdout/stderr to UTF-8 witherrors="replace"at module load.v1.7.3.3's garbled pre-release was deleted manually; this fix is for the next real run.
Test plan
python -m py_compilepassesworkflow_dispatchrun produces a clean, correctly-encoded release body and a green job🤖 Generated with Claude Code
https://claude.ai/code/session_01JYLx9STTgfo9KXLC2Gog3g
Generated by Claude Code