Repository navigation
Repair locale-dependent reads in test_research_current_status (no new kappa) - #1834
Merged
Mister-Meeseeks merged 1 commit intoOct 14, 2026
Conversation
… kappa) On a native Windows cp1252 host, the documented check python3 -B -m unittest discover -s tests -p 'test_research_*.py' fails with three errors when PYTHONUTF8 is not set: STATUS.read_text() decodes docs/research/current-status.md with the locale codec and the document carries byte 0x9d (U+201D). Pass explicit UTF-8 and add a static locale-independence guard plus a load-bearing byte control in the same module, following the test_research_onboarding.TextEncodingTests pattern. Adds research/test-suite-locale-reads: task card, base-commit source pins and a bounded registered replay with cp1252/bare-read failure controls and a forced legacy codec (cp1252 on Windows, C locale elsewhere). Credit: Aaron Wang, with help from opencode. Predecessor: the merged CrocSwap#1299/CrocSwap#1293-rgb Windows encoding line, whose five-script static guard did not cover the suite's document readers.
Contributor
|
Batch review at Merged to Reviewed scope: Explicit UTF-8 status reads, AST regression guard and load-bearing cp1252 control preserve research-status tests under legacy locale. Complete declared 44-test replay and combined current-main checks pass; complements earlier onboarding fixes. The pinned scoped command passed; the batch ledger contains its command, input hashes, environment and log. This incorporates the research/tooling contribution and does not change the selected κ or discharge the inherited multiplication-theorem assumptions. Batch review, attribution and evidence. Thank you for the contribution. |
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.
Scope
No kappa, no certificate change. One reproducible environment failure repaired: on a native Windows cp1252 host (the Git-for-Windows default), the documented check
fails with three errors when
PYTHONUTF8is not set, all from one root cause:tests/test_research_current_status.pyreadsdocs/research/current-status.mdwith the locale codec, and that document contains byte0x9d(in U+201D), which is undefined in cp1252.verifier-engineering/portable-replay(scope key831cc1a3c8f9ff01b197, chooser OS noncec7669648496a57422bfa478f1d356cad, priority revision 3), scope refined to this one failure. Base0b1cccf86e2f5132ed286a26ef0a681a495740ea.tests/test_research_current_status.py(explicitencoding="utf-8"on its two reads, plus two regression tests) and the new packageresearch/test-suite-locale-reads/(README with the task card,TASK.json,SOURCES.json,VERIFY.json,verify.py). Nothing else;upstream/, frozen pins, certificates and the selected record are untouched.Evidence
Windows 11, cp1252, Git 2.55.0.windows.5 (
core.autocrlf=true), CPython 3.13.15 and 3.12.Before (base
0b1cccf8, noPYTHONUTF8):The same command with
PYTHONUTF8=1, and everything under Python 3.12, passed at base.After (this branch):
Regression tests (in the repaired module, following
test_research_onboarding.TextEncodingTests: "a UTF-8 CI host cannot observe locale-codec bugs, so check the calls statically"): an AST guard requiringencoding=on every text read/write in the module, and a load-bearing control asserting the document containse2 80 9dand is undecodable as cp1252 (deterministic on every host).Failure controls (both executed in this session): the static guard applied to the base-commit module reports missing
encoding=at exactly lines 10 and 26; a bareread_text()of the document in aPYTHONUTF8=0child fails with the sameUnicodeDecodeError. The registered replay reruns everything with a forced legacy codec (cp1252 on Windows;PYTHONUTF8=0 PYTHONCOERCECLOCALE=0 LC_ALL=Celsewhere).Killed first candidate (obstruction recorded). The historical Windows failures cited in many PR bodies (autocrlf temp-fixture pin mismatch in
test_research_onboarding.PackageTests, POSIX-onlyos.killpg, cp1252 metadata reads inresearch_package.py/find_overlap.py) no longer reproduce at base:test_research_onboardingruns green natively (Python 3.13.15: 18 tests, 2 environment-gated skips; Python 3.12: all 18 pass,core.autocrlf=true), including the Python 3.12-only replay-environment tests. Those repairs are credited below; what remained was the suite's own document readers, which the merged static guard (five named scripts) does not cover.Limitations (not checked)
upstream/or cold-replay change. The card's acceptance gate (preserve immutable source hashes and proof-relevant content) is untouched: no comparison logic changed.tests/and the one-offscripts/generators were inventoried (1,536 repo files carry non-ASCII bytes, mostly underresearch/) but not swept. Structured next questions are inresearch/test-suite-locale-reads/TASK.json.SOURCES.jsonpinstests/test_research_current_status.pyat its base-commit bytes as provenance (the defective version this PR repairs); it cannot be a live input under the pin contract because this contribution changes it.docs/research/current-status.mdis the live input and matches its pin exactly.Overlap
Refreshed before submission (2026-10-14 11:34Z, complete pagination: 492 open PRs, 478 discussions): no matches for the refined object terms (
test_research_current_statuslocale, cp1252UnicodeDecodeErrorsuite). Nearest work, none conflicting: #1702 (CP1252 overlap-regression self-containment intest_research_onboarding.py, different file and object). The card's gzip/canonical-payload variation is under active concurrent work (#1559, #1824) and was deliberately not duplicated.Credit
Aaron Wang, with help from opencode. Predecessor credit: the merged PR 1299/PR 1298 (rtyu193-rgb) Windows encoding line (UTF-8 metadata and pipe handling, child-tree timeout fallback, cp1252 simulations and the
TextEncodingTestsstatic-guard pattern, summarized inresearch/community-efficient400-audit); the failure report and environment details in #1200 (comment), which identified the same byte inresearch_package.py; and the upstream authors oftests/test_research_current_status.pyitself. This PR adds the instance that guard missed, a regression in the module that failed, and a replayable legacy-locale check.Remaining obligations: the two structured open questions in
research/test-suite-locale-reads/TASK.json(atests/encoding sweep, and a whole-suite POSIX ASCII-locale guarantee). Optional workflow feedback: the useful improvement here would be for theTextEncodingTestsstatic guard to covertests/document readers as well as the five onboarding scripts, since that gap is exactly how this failure survived the previous fix.