mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
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#4107
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/2542
Author: @qiuzan2001
Created: 10/15/2026
Status: ❌ Closed
Base:
main← Head:chief-serve/bench-utf8-version📝 Commits (1)
860b745bench: read the project version from CMakeLists.txt as UTF-8 on every locale (#2499)📊 Changes
2 files changed (+12 additions, -1 deletions)
View changed files
📝
tools/strata_bench.py(+1 -1)📝
tools/test_strata_bench.py(+11 -0)📄 Description
Fixes #2499.
What it changes.
tools/strata_bench.py'sproject_version()readsCMakeLists.txtasutf-8-siginstead ofwith the locale's code page.
CMakeLists.txtstarts with a UTF-8 BOM (ef bb bf), so on a Windows with a non-UTF-8code page (cp932 in the report) the read raised
UnicodeDecodeError, which theexcept OSErroraround it does notcatch, and
BENCH.batstopped right after it found the server. The bench already reads the run config asutf-8-sig(the same file, lines 657, 688, 961).What it leaves alone. Everything else in the report. On a UTF-8 locale the version read is the same (the regex
is not anchored, so the BOM never mattered there). The
except OSErroris unchanged: with the file read as UTF-8,only a corrupt
CMakeLists.txtcould still raise, and I kept this to the one line the issue names. The other filereads on the bench's main path already name an encoding; the two
/procreads are Linux-only.How it was checked.
ReportTests.test_the_version_is_read_on_a_non_utf8_localeintools/test_strata_bench.py: it givesPath.read_texta cp932 default (as a Japanese Windows does) and reads the realCMakeLists.txt. Without the fixit fails with the issue's error (
'cp932' codec can't decode byte 0xef in position 0); with it, it passes.python3 tools/test_strata_bench.py: 18 tests OK.python3 tools/test_setup_bench_tips.py: 9 tests OK.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.