mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1965] [CLOSED] fix(bench): prevent UnicodeDecodeError on Windows #3779
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#3779
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/1965
Author: @saruiwa
Created: 10/11/2026
Status: ❌ Closed
Base:
main← Head:fix/bench-windows-encoding📝 Commits (1)
9075c23fix(bench): prevent UnicodeDecodeError on Windows📊 Changes
1 file changed (+1 additions, -1 deletions)
View changed files
📝
tools/strata_bench.py(+1 -1)📄 Description
Summary
Fix a
UnicodeDecodeErrorinBENCH.baton Windows systems using non-UTF-8 default encodings, such as CP932 (Japanese Windows).Problem
On Japanese Windows with Python 3.11, running
BENCH.batfails during machine information collection becauseproject_version()readsCMakeLists.txtwithout specifying an encoding.Python defaults to CP932, which cannot decode the UTF-8 BOM at the beginning of the file.
Fix
Explicitly use
encoding="utf-8-sig"when readingCMakeLists.txt.This handles UTF-8 files with or without a BOM, regardless of the system's default encoding.
Testing
PYTHONUTF8=1works around the issue.BENCH.batcompletes withoutPYTHONUTF8after applying the fix.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.