Repository navigation
attach-artifacts-utf8 - #897
Merged
Merged
Conversation
Decode gh output as UTF-8 in cicd/python/attach_build_artifacts.py and fetch only the sha when resolving the tag commit. On Windows subprocess.run(text=True) decodes with the console code page (cp1252). The commit endpoint returns the whole diff of the tagged commit, and the first byte cp1252 cannot map crashed the stdout reader thread, so stdout was None and the script died with a TypeError before attaching anything (seen on the v1.0.888 dry run). gh always writes UTF-8, so decode as UTF-8 with errors=replace; tag_commit now passes --jq .sha so the diff is not fetched at all. Two regression tests cover both. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This was referenced Nov 5, 2026
Merged
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.
Fixes the crash hit on the first
v1.0.888dry run ofcicd/python/attach_build_artifacts.pyon Windows (release process step 2):What changes
gh()decodes the subprocess output as UTF-8 (errors='replace') instead of the console code page.ghalways writes UTF-8; withtext=Truealone, Windows decoded it as cp1252, the stdout reader thread died on the first unmappable byte andcompleted.stdoutcame back asNone.tag_commit()asks the commits endpoint for.shaonly via--jq. Unfiltered, that endpoint returns the full diff of the tagged commit (over 100 KB for the plugin-submissions #896 squash), which is where the unmappable byte came from.Two files touched: the script and its unit tests.
Test plan
python -m pytest cicd/python/test_attach_build_artifacts.py: 9 passed, including two new regression tests (UTF-8 decoding kwargs on theghcall;tag_commitrequests only the sha and strips it).python cicd/python/attach_build_artifacts.py 1.0.888 --dry-runon Windows with the fix applied, against the realv1.0.888release.🤖 Generated with Claude Code