tooling: skip a UTF-8 byte-order mark in check listings #2810
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!2810
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2810/head"
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?
@RenzoWit35 on GitHub · 2026-11-26 11:02 UTC · original
RenzoWit35:tooling/run-checks-listing-bom→main· +23 −2 · 2 files · 1 commits · merged 2026-11-26 11:09 UTCChange
read_check_filesintools/run_checks_parallel.py(the code behind--from-dir, which reads thefragments under
tests/checks/) read each listing as plainutf-8. A listing saved with a UTF-8byte-order mark (Notepad, or Windows PowerShell 5.1
Set-Content -Encoding UTF8) therefore keptU+FEFF at the start of line 1. Two symptoms, both a clean refusal rather than a wrong result:
x.txt:1: script path does not exist: \ufeff<path>;\ufeff#is not#), so the commentwas treated as a script path and refused the same way.
The error text gives no hint that a BOM is the cause. The listing is now read as
utf-8-sig, so aleading BOM is ignored. This is the same treatment
tests/docs_links_check.pyandtests/rdna2_tools_check.py(BOM-skipping assembly parser) already use. Nothing else about parsingchanges (comment rule, argument splitting, duplicate and missing-script refusals, empty-run
behaviour). The
read_check_filesdocstring now says a leading BOM is skipped.tests/run_checks_fragments_check.pygains cases: for a listing whose line 1 is a script path, acomment, or a blank line, the listing with a BOM (written as the explicit bytes
\xef\xbb\xbf)and the same listing without one both run the script with its argument and report
all 1 checks passed.Verification
Repro on
origin/main(temporary directory,ok.pyprintsok ran; exit code, then output):x.txt:1: script path does not exist: \ufeff<T>\ok.pyall 1 checks passed# notethen path: exit 1,x.txt:1: script path does not exist: \ufeff#x.txt:1: script path does not exist: \ufeff# notethen path: exit 0With the change, all five exit 0 with
all 1 checks passed.Commands (from the worktree root,
out/pe-envPython 3.14.5, Windows 11):python -B tests/run_checks_fragments_check.py->run_checks_fragments_check ok, exit 0python -B tests/run_checks_parallel_check.py->run_checks_parallel_check: okNegative control: the new test file run against
git show origin/main:tools/run_checks_parallel.py(copied into a scratch
tools/beside a copy of the test) fails at the first new case:AssertionError: ('path', '...case_bom_path_bom\x.txt:1: script path does not exist: \ufeff...echo.py').Not run: Linux (the new cases use explicit BOM bytes,
os.pathand"wb"writes, noplatform encoder default); the full CI workflow.
Evidence and follow-up
No open PR touches
run_checks_parallel(gh pr list -R R0Y00/Xbox2Windows --state open --search "run_checks_parallel"returned nothing).tests/checks/README.mdsays nothing about encoding.Impact is modest: the old behaviour was a clean but misleading error, never a wrong result or a
silently skipped check.
AI-assisted.
@tedin7 on GitHub · 2026-11-26 11:08 UTC · original · reviewed
Review of head
be45ce18.Checked against origin/main (6 commits behind; a trial merge with main is clean):
tools/run_checks_parallel.py: reading listings asutf-8-sigis the minimal correct fix. A leading BOM is dropped, nothing else in parsing changes. The docstring is updated.tests/run_checks_fragments_check.py: new cases cover a BOM before a script path, before a comment and before a blank line, each compared with the same listing without a BOM. The BOM is written as explicit bytes, so the result does not depend on the platform.Commands run locally on this head:
python3 -B tests/run_checks_fragments_check.py-> okpython3 tests/docs_links_check.py-> okpython3 tests/bidi_controls_check.py-> okgit diff --check origin/main...HEAD-> cleanutf-8-sigput back toutf-8): the check script fails (rc 1).No blockers.
AI-assisted; commands listed were executed locally.
@tedin7 on GitHub · 2026-11-26 11:09 UTC · original
Win2025 WARP receipt for head
be45ce18(Python-only PR; real-GPU run not available, RunPod stopped).Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
be45ce18e265e057683c51109db8ed196a2ce1ea:--preset dev):cmake --build --preset dev -- -j 2):0.00s(configure0.00s)ctest --preset dev -R 'run_checks' --parallel 2 --no-tests=error --output-on-failure): 1/1 passed (1.42s:ci_run_checks_parallel_cli_check1.30s)/O2(--preset release):cmake --build --preset release -- -j 2):0.00s(configure0.00s)ctest --preset release -R 'run_checks' --parallel 2 --no-tests=error --output-on-failure): 1/1 passed (1.42s:ci_run_checks_parallel_cli_check1.31s)tests/run_checks_fragments_check.pyok (1.9s)9.9sAI-assisted; commands listed were executed locally.