Repository navigation
fix: use UTF-8 for build graph persistence - #9323
Open
ahmedkhan1 wants to merge 1 commit into
Open
ahmedkhan1 wants to merge 1 commit into
ahmedkhan1 wants to merge 1 commit into
Conversation
reedham-aws
reviewed
Oct 9, 2026
| document = {} | ||
| try: | ||
| txt = self._filepath.read_text() | ||
| txt = self._filepath.read_text(encoding="utf-8") |
Contributor
There was a problem hiding this comment.
If an existing file was written with CP1252, would there be a problem that we're now reading it as utf-8? I think the utf-8 encoding would throw an error because it couldn't parse non-ASCII characters (at least according to this Stack Overflow answer).
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.
Which issue(s) does this change fix?
Fixes #7714
Why is this change necessary?
BuildGraph uses the locale-default encoding for build.toml. On Windows locales such as CP1252, cached builds with non-ASCII paths fail with UnicodeEncodeError.
How does it address the issue?
Read and write build.toml explicitly as UTF-8, including source-hash updates. Add a regression test that simulates a CP1252 locale and round-trips a Greek code path.
What side effects does this change have?
Existing ASCII build graphs remain valid because ASCII is a subset of UTF-8. Build graphs containing non-ASCII data are now persisted consistently across locales.
Mandatory Checklist
PRs will only be reviewed after checklist is complete
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.