fix(release): read the packaged tokenizer as UTF-8, not the Windows ANSI page - #746
Merged
Conversation
…NSI page The v1.4.0 tag build failed on windows-x86_64: UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 5262 FAIL: packaged k3_tokenizer.py does not parse The file is fine -- valid UTF-8, parses cleanly. The check was wrong: open() without an encoding uses the platform default, which on Windows is the ANSI code page (cp1252), and cp1252 cannot decode a UTF-8 file containing non-ASCII bytes. Reproduced locally: cp1252 raises, utf-8 parses. Mine, introduced with the all-engines packaging in #737, and caught on the very first tag build that exercised it -- which is what that verification step is for, even when the thing it catches is the step itself. No broken archive was published; the job failed before upload. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
The v1.4.0 tag build failed on
windows-x86_64:The file is fine — valid UTF-8, parses cleanly. The check was wrong:
open()without anencodingargument uses the platform default, which on Windows is the ANSI code page (cp1252), and cp1252 cannot decode a UTF-8 file containing non-ASCII bytes.Reproduced locally:
Mine, introduced with the all-engines packaging in #737, and caught on the very first tag build that exercised it — which is what that verification step exists for, even when the thing it catches is the step itself.
No broken archive was published: the job failed before the upload, which is the whole point of verifying the artifact rather than trusting the build.
The three engines and the tokenizer were all packaged correctly; the
test -xassertions above this line passed. Only the parse check was broken.One file, workflow only. After this lands, the
v1.4.0tag needs to be moved onto it so the release job re-runs.