Skip to content

Fix Windows cp1252 encoding bugs in build_all_github.py - #21

Merged
Wewoc merged 1 commit into
mainfrom
claude/magical-ritchie-807x8r
Sep 30, 2026
Merged

Wewoc merged 1 commit into
mainfrom
claude/magical-ritchie-807x8r

Conversation

@Wewoc

@Wewoc Wewoc commented Sep 30, 2026

Copy link
Copy Markdown
Owner

Summary

The first real build-release.yml run (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 _Tee already works around this class of issue for its own output; build_all_github.py didn't):

  1. git log -1 --pretty=%B was 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 with encoding="utf-8" on the subprocess.run() call.
  2. The final success print() (uses a ✓) crashed with UnicodeEncodeError after build_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 with errors="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_compile passes
  • Next workflow_dispatch run 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

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
@Wewoc
Wewoc merged commit c34857e into main Sep 30, 2026
@coderabbitai

coderabbitai Bot commented Sep 30, 2026

Copy link
Copy Markdown

Review in Change Stack →

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 16091c7e-42bd-49a3-9969-0f864b7901da

📥 Commits

Reviewing files that changed from the base of the PR and between 9e17581 and 8762353.

📒 Files selected for processing (1)
  • src/compiler/build_all_github.py
 ______________________________________________________________________________________________________________________________
< Gently exceed your users' expectations. Come to understand your users' expectations, then deliver just that little bit more. >
 ------------------------------------------------------------------------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants