Repository navigation
tests/conftest.py: under a one-byte locale skip_where_a_name_cannot_be_not_utf_8 says it also skips the branch rows, its first two questions are one predicate, and rows hold the order it asks them in, on Windows too (#1224) - #1326
brettheap wants to merge 2 commits into
Conversation
…under a one-byte locale it also skips the rows about a branch or a file named with the byte 0xFF, its first two questions are one predicate both guards ask, the system is held to be asked before the locale with Windows' `os.fsdecode`, the Latin-1 row holds on Windows, and the bytes child of the spelled file is said to start as `run_script` starts one, which a row holds (#1224) N1, the second choice. The locale question stays in the shared helper. Moved into a helper of its own, asked only by the rows whose premise is that Python reads the byte 0xFF in as U+DCFF, it left 67 rows of the 31 gate files going from skipped to failed under Latin-1, 63 of them on their own UTF-8 premise, over the brief's 12. The docstring now says that under a one-byte locale it also skips the branch rows, and why it is kept; its skip no longer says that no file name here is one that is not UTF-8. N4: `an_earlier_question_skips()`, beside the helper, is its first two questions; the callers fixture `a_system_that_carries_the_byte` and the helpers file's `skip_where_an_earlier_question_skips` each ask it and keep their own skip. Four rows hold it to the helper under UTF-8, ASCII, Latin-1 and Windows, each emulated. N2: the Latin-1 row emulates POSIX's `os.fsencode` with Latin-1's `os.fsdecode` (`locale_of`), so the system's question lets it through on Windows too. N3: `test_where_fsencode_makes_three_bytes_the_disk_is_not_asked` also emulates Windows' `os.fsdecode`, which raises on the byte 0xFF, so the locale asked before the system fails it. `windows_fsdecode` moves from the callers file into `tests/conftest.py`, beside `windows_fsencode`. N5: `the_environment_of_a_child_read_as_bytes` says its child starts as `run_script` starts every other child, and a row compares the two environments key for key. The helpers file's first `fsdecode_in`, which its later definition rebound (pyflakes: redefinition of unused 'fsdecode_in'), is gone. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideTestsClarify the shared non-UTF-8 name skip’s locale behavior and centralize its first two ordered checks, then verify the predicate agrees with the helper across UTF-8, ASCII, Latin-1, cp1251, and Windows.
Move the Windows filesystem-decoding emulation into shared test support and exercise its behavior, including that the system check runs before a locale check that would raise on Windows.
Make the Latin-1 skip test emulate POSIX filesystem encoding as well as locale decoding, so it also tests the intended behavior under emulated Windows encoding.
Align the byte-oriented child environment’s description with
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
RV1224: independent review of #1326 at One SHOULD, a sentence in Reviewed head Counts, base against head, by id
Per file at the head: helpers 46 passed (UTF-8), 41 passed and 5 skipped (Latin-1); callers 36 passed (UTF-8), 18 passed and 18 skipped (Latin-1), the same ids as the base; spelled 32 passed (UTF-8), 18 passed and 14 skipped (Latin-1). N1: the first choice, measured againI fetched the writer's unpushed The 67, by file: 33 I read 19 of them in full: 15 that stand for the premise classes, plus the 4 defect rows. The first failure line of each of the other 48 falls in the same classes.
So 63 rows fail on their own UTF-8 premise, as the writer found, and 4 fail on a tool defect. N1's decision stands. The first choice needs 63 premise skips in 10 test files outside this PR, against the brief's limit of 12, and it would leave 4 rows failing until the defect is mended. The second choice is what #1224's "Done when" offers ("or the docstring says they skip there"). There is no MUST or SHOULD in the choice itself. Two things favour the first choice later, as a follow-up: it is what surfaced the defect below, and it lets 101 rows in 21 files judge under Latin-1. FindingsS1 (SHOULD):
|
| Mutant | Run | Result |
|---|---|---|
| M1: the N1 docstring says the helper skips no branch row; code unchanged | UTF-8, h+c | survives (82 passed): no row reads a docstring, as expected |
M2: windows_fsdecode returns U+DCFF instead of raising |
UTF-8, h+c | survives (82 passed): NIT A above |
| M2 with RV1209's G4 | UTF-8, h+c | survives (82 passed): NIT A above |
M3: the helper's third question (the disk's mkdir and EILSEQ) dropped |
UTF-8, h+c | killed: 19 rows, among them the N4 [utf-8] and [ascii] rows (no FileNotFoundError) |
M4: the predicate joins its halves with and |
UTF-8, h+c | killed: [latin-1], and [windows] (UnicodeDecodeError) |
| M5: the bytes child's environment no longer blanks pin-source overrides | UTF-8, spelled | killed: the N5 row |
M6: the N5 row compares by subset, with the PR's N5-a (AGENT_PROTOCOL_ROOT added) |
UTF-8, spelled | survives (2 passed). This is a check of the row: its equality is what kills N5-a, and the PR uses equality |
| M7: the helpers guard inverted | UTF-8; Latin-1 | survives under UTF-8 (41 passed, 5 skipped); killed under Latin-1 (5): NIT B above |
| M7b: the callers fixture inverted | UTF-8; Latin-1 | survives under UTF-8 (18 passed, 18 skipped); killed under Latin-1 (13): NIT B above |
| M8: the locale reason no longer names the encoding | UTF-8, helpers | killed: the N2 row, by its new ({LATIN_1}) assertion |
M14: the predicate's locale half narrowed to == "\u00ff" |
UTF-8; Latin-1 | survives in both: NIT C above |
| The PR's N3 (G4), run again | UTF-8, h+c | killed: the N3 row and [windows] (UnicodeDecodeError). Then the callers file's Windows row ends the session with INTERNALERROR (see below) |
| The PR's N5-a, run again | UTF-8, spelled | killed: the N5 row |
G4 at the base 01ee69763 |
UTF-8, h+c | the helpers file's 42 rows pass (the body's "G4 survives"). With the callers file in the run, the session ends with INTERNALERROR at test_where_windows_cannot_carry_the_byte_directory_named_skips_and_makes_nothing |
Merge-trees
git merge-tree --write-tree of this head, at 2026-11-10T23:21Z, all clean:
origin/maindcf63b8b9. Main has moved on from the writer'sa98fe7cb4;dcf63b8b9changedadopt-project.pyand two tests that call none of these helpers. The merged tree differs from main merged with tests/conftest.py and tests/test_adopt_plan_paths_spelled.py: under a one-byte locale such as Latin-1 the 0xff--work-dirrow skips and the two U+00E9 rows read the child's UTF-8, so none of the three fails on a tool that is right, and the bytes helper starts its child asrun_scriptdoes (#1196) #1209 only in the PR's 4 files. The PR's diff is the same on that merge as on tests/conftest.py and tests/test_adopt_plan_paths_spelled.py: under a one-byte locale such as Latin-1 the 0xff--work-dirrow skips and the two U+00E9 rows read the child's UTF-8, so none of the three fails on a tool that is right, and the bytes helper starts its child asrun_scriptdoes (#1196) #1209.- On a scratch merge commit (
e9030733c), the helpers, callers, spelled and hygiene files: 215 passed under UTF-8. Under Latin-1, 178 passed and 37 skipped, the same as this head file for file.
- On a scratch merge commit (
- tests/conftest.py and tests/test_adopt_plan_paths_spelled.py: under a one-byte locale such as Latin-1 the 0xff
--work-dirrow skips and the two U+00E9 rows read the child's UTF-8, so none of the three fails on a tool that is right, and the bytes helper starts its child asrun_scriptdoes (#1196) #1209's head01ee69763. - adopt-project.py:
checkandexecutework the follow-ups out from the plan as it stands andplanno longer stores them, so after a hand edit of an entry'sleg:neitherchecknor the split commit names aGNUmakefileor a collision the root no longer keeps, and a plan that still holds afollow_ups:list is refused by name (#1206) #13125235870f1. The only other open PR that touches one of these four files (tests/conftest.py). - tests/test_bootstrap_non_utf8_branch.py and tests/test_bootstrap_branch_bytes.py: under Latin-1 four rows that expect the byte 0xFF spelled
a\udcffbrun what judges there and skip on their premise, as each failed on a tool that is right (#1301) #1302371264be0. Its two files under Latin-1 give 83 passed and 9 skipped, with no change by id, on a scratch merge with this head (abd28f740) and on one with tests/conftest.py and tests/test_adopt_plan_paths_spelled.py: under a one-byte locale such as Latin-1 the 0xff--work-dirrow skips and the two U+00E9 rows read the child's UTF-8, so none of the three fails on a tool that is right, and the bytes helper starts its child asrun_scriptdoes (#1196) #1209's head (0939a9cb8).- Its row 4,
test_a_name_that_is_not_utf8_is_still_carried_and_the_branch_made, skips at its first line on the shared helper's locale reason in both merges; only the reason's words differ. - On a merge with the first choice (
222e89be1), row 4 runs the tool and then skips on tests/test_bootstrap_non_utf8_branch.py and tests/test_bootstrap_branch_bytes.py: under Latin-1 four rows that expect the byte 0xFF spelleda\udcffbrun what judges there and skip on their premise, as each failed on a tool that is right (#1301) #1302's own premise. That is the writer's account.
- Its row 4,
SonarCloud and CI
- SonarCloud. The newest
sonarqubecloud[bot]comment, and SonarCloud's API for PR 1326 at commite7359206: the quality gate passed, with 0 new issues, 0 accepted issues, 0 security hotspots and 0.0% duplication. - CI.
gh pr checks 1326:packagepassed,tests-git-bashpassed, andtests(run 42908344813) completed with success ate7359206.
#1326's body, checked
Every count and claim I ran again holds (I did not run the 7 extra files of the writer's 38-file gate):
- the UTF-8, Latin-1 and ASCII counts;
- the 101 and the 67;
- the 63 premise rows and 4 defect rows;
- the per-file split;
- the pyflakes line: at the base,
test_non_utf8_name_helpers.py:326:1: redefinition of unused 'fsdecode_in' from line 58; at this head, nothing for that file; - the N2 row failing at the base with Windows'
os.fsencodeemulated; - the helpers file's counts;
- tests/test_bootstrap_non_utf8_branch.py and tests/test_bootstrap_branch_bytes.py: under Latin-1 four rows that expect the byte 0xFF spelled
a\udcffbrun what judges there and skip on their premise, as each failed on a tool that is right (#1301) #1302's row 4.
Three notes:
origin/mainis nowdcf63b8b9, nota98fe7cb4. The merge is still clean.- G4 at the base. "G4 survives (42 passed)" is true of the helpers file alone. With the callers file in the run, the base already ended G4's session with an INTERNALERROR. The PR's row turns that into a clean failure.
- The
family.pydefect. The body's reading is close. The mismatch is inPinRollback._legs, which never puts the leg inself.legs;legs_leftplays no part. The defect also shows under ASCII today, not only under Latin-1. Details below.
Outside this PR (follow-up candidates for Brett Heap; none filed)
A real defect in scripts/family.py
What is wrong. A failed remove's rollback loses a member's leg whose path is non-ASCII UTF-8, under any locale whose file name encoding is not UTF-8.
The cause. PinRollback._legs (scripts/family.py:8216) reads each leg's path as name.decode("utf-8", "surrogateescape"). It then asks _is_there(self.member / leg / ".git"), which Python encodes in the locale's codec.
- Under Latin-1,
cafU+00E9's legbecomescaf\xe9's leg, a path that does not exist. - Under ASCII it is a
UnicodeEncodeError, which_is_thereanswers False. - Either way the leg is never in
self.legs. A leg named with a byte that is not UTF-8 (caf\xe9) round-trips through its surrogate and is kept.
Measured with probes of family.py in the test process (local git only, GIT_SSH_COMMAND=false, a stub gh), on the row's own holder:
- Under UTF-8,
PinRollback.legsholds the leg andspec. There are 4 by-hand lines, and_undo_work_tree()puts the leg back onrefs/heads/side. - Under Latin-1 and under ASCII,
legsholds onlyspec:- the by-hand lines are 3, with no word for the leg and no
checkoutline; _undo_work_tree()leaves the leg with no checkout;- it says "members/Thing checked out again ... and spec in it", with no word that the leg was not brought back.
- the by-hand lines are 3, with no word for the leg and no
What fails today. Under ASCII the shared helper does not skip, so the 4 [utf8-keeps-shlex-quote-*] rows run at this head, and all 4 fail at assert len(lines) == 4 (4 failed, 74 passed). The test file and family.py are the same blobs on origin/main, so main fails them under ASCII too (read, not run on main). CI runs UTF-8 only.
A direction for the fix. Keep the leg's path as bytes for the file system and the argv, or read it with os.fsdecode. There are 11 decode("utf-8", "surrogateescape") sites in family.py, worth a look in the same change.
Other candidates
- tests/test_bootstrap_non_utf8_branch.py and tests/test_bootstrap_branch_bytes.py: under Latin-1 four rows that expect the byte 0xFF spelled
a\udcffbrun what judges there and skip on their premise, as each failed on a tool that is right (#1301) #1302's row 4 docstring. It says "The run,could not create branchand HEAD's bytes judge there" under Latin-1. Once tests/conftest.py and tests/test_adopt_plan_paths_spelled.py: under a one-byte locale such as Latin-1 the 0xff--work-dirrow skips and the two U+00E9 rows read the child's UTF-8, so none of the three fails on a tool that is right, and the bytes helper starts its child asrun_scriptdoes (#1196) #1209 lands, with or without this PR, the row skips at its first line there (measured above). The writer named this one. - A failure inside the callers file's Windows emulation ends the whole pytest session.
windows_names_itsetsos.nametont, so pytest cannot build the failure's report (NotImplementedError: cannot instantiate 'WindowsPath'), and every later row goes unreported. G4 met it at the base and at this head. - The first choice with per-row premise skips. That is 63 rows in 10 files, as the writer lists.
Paths
- Scratch folder
_lane4-scratch/tools/run/rv1224/: the runners,mutants.py,suggested.py, the probes, the logs and junit files, and the id comparisons. - Clone
_lane4-scratch/rv1224-clone, and worktrees_lane4-scratch/rv1224-{base,fc,head,mut,m1302-head,m1302-base,m1302-fc,mmain-head}-wt.
Lane: openreposhape-4 (openRepoShape-4)
… says a branch whose bytes are not UTF-8 skips first under a one-byte locale, at `skip_where_a_name_cannot_be_not_utf_8`'s locale question, and rows hold `windows_fsdecode` (it raises on the byte 0xFF, so the N3 row sees a helper that asks the locale first), both guards of the rows that reach the disk (each asks the predicate, under UTF-8 too) and the predicate under cp1251 (#1224) The docstring of `skip_where_the_locale_does_not_spell_it_as_utf_8` said a row about a branch whose bytes are not UTF-8 judges under a one-byte locale (#1224's N1). The helper skips it there, first. The rows added, from RV1224's review of #1326: - `windows_fsdecode` raises `UnicodeDecodeError` on the byte 0xFF, gives the UTF-8 bytes of `caf` and U+00E9 back as that text and passes a str through; the module docstring of the helpers file names it among its tools. A `windows_fsdecode` that returned U+DCFF let the N3 row pass a helper that asked the locale first. - `skip_where_an_earlier_question_skips` and the fixture `a_system_that_carries_the_byte` skip under Latin-1 and not under UTF-8 or ASCII, with the locale emulated by `locale_of`. Inverted, each skipped rows in silence under UTF-8 and failed only under Latin-1. - `an_earlier_question_skips` is held to the helper under cp1251, where the byte 0xFF is U+044F and not U+00FF. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
|
FX1224: RV1224's S1 and NITs A to C on #1326. New head The delta is one commit, Items
Counts (base
Mutants, one at a time in a worktree at this head, under UTF-8; each file put back with
Merge-trees ( SonarCloud at Not done, as the brief said: Lane: openreposhape-4 (openRepoShape-4) |
|
RVD1224: delta review of FX1224's round at All eight checks PASS. FX1224's one commit settles RV1224's S1 and NITs A to C and changes nothing else. No MUST, no SHOULD. One optional NIT, which the writer disclosed (below). SonarCloud's quality gate passed at this head. CI's Reviewed head The checks
1. Ancestry. 2. The diff.
3. S1. The docstring of
4. NITs A, B, C. Each row holds what RV1224 asked:
Extra probe, not in the brief: with RV1224's Windows Mutants. Each ran alone in
5. Counts. The helpers, callers and spelled files plus
The 9 new ids: helpers 7 (3 6. Merge-trees (
7. SonarCloud and CI at
8. Body and FX1224's comment (#1326 issuecomment-6783434420):
FindingsNo MUST. No SHOULD. NIT 1 (optional, disclosed by the writer, outside RV1224's ask): no row pins Still outside this PR, as RV1224 listed and nothing here changes it: Paths
Lane: openreposhape-4 (openRepoShape-4) |



Closes #1224
This PR lands after #1209. It is stacked on #1209's branch (
fix/1196-paths-spelled-locale-and-env, head01ee6976), and is restacked ontomainonce #1209 has landed.One commit on
01ee69763, four test files, no tool changed:tests/conftest.py,tests/test_non_utf8_name_callers.py,tests/test_non_utf8_name_helpers.py,tests/test_adopt_plan_paths_spelled.py. Writer W1224, lane openRepoShape-4. All figures below were measured on 2026-11-10, after #1258 and RS1209's restack; none of RV1209's Latin-1 counts is used as a baseline.What
skip_where_a_name_cannot_be_not_utf_8, asked between the system's and the disk's.os.fsdecoderaises on the byte.an_earlier_question_skips() -> bool, beside the helper intests/conftest.py, is its first two questions, asked in its order. The callers fixturea_system_that_carries_the_byteand the helpers file'sskip_where_an_earlier_question_skipseach ask it and keep their ownpytest.skip. Four new rows hold it to the helper, each system emulated: where it says true (Latin-1, Windows) the helper skips before anymkdir; where it says false (UTF-8, ASCII) the helper goes on to the disk.test_a_locale_that_reads_the_byte_as_a_character_skips_before_the_diskemulates POSIX'sos.fsencodewith Latin-1'sos.fsdecode(locale_of, validate-family.py: the holder's gate escapes what its stdout cannot encode, so it passes under Latin-1 where it ended in a traceback, and 45 rows in 11 test files that cannot judge under a one-byte locale skip there on their own premise (#1214) #1258's emulation), so the system's question lets it through on Windows too. It also asserts the encoding's name in the reason.test_where_fsencode_makes_three_bytes_the_disk_is_not_askedalso emulates Windows'os.fsdecode(UTF-8 withsurrogatepass), which raises on the byte 0xFF. So RV1209's G4, the locale asked before the system, now fails it on Linux.windows_fsdecodemoves from the callers file intotests/conftest.py, besidewindows_fsencode, so both files use one definition.the_environment_of_a_child_read_as_bytesnow says its child starts "asrun_scriptstarts every other child", which sets noAGENT_PROTOCOL_ROOT, wherechild_environdoes. The environment is unchanged. A new row compares it with the environmentrun_scripthandssubprocess.run, key for key. It excludes onlyPATH,GH_STUB_LOGandPYTHONIOENCODING, and runs with a lane, a pin-source override and no git identity set in the test process.fsdecode_in(tests/conftest.py and tests/test_adopt_plan_paths_spelled.py: under a one-byte locale such as Latin-1 the 0xff--work-dirrow skips and the two U+00E9 rows read the child's UTF-8, so none of the three fails on a tool that is right, and the bytes helper starts its child asrun_scriptdoes (#1196) #1209's) is removed. RS1209's restack left two definitions, and the later one (validate-family.py: the holder's gate escapes what its stdout cannot encode, so it passes under Latin-1 where it ended in a traceback, and 45 rows in 11 test files that cannot judge under a one-byte locale skip there on their own premise (#1214) #1258's) rebound the name, so every row already ran with it. pyflakes at the base:redefinition of unused 'fsdecode_in' from line 58; at this head, pyflakes reports nothing for the file.Measured, base against head, by locale
Base
01ee69763(#1209's head) against this heade73592062, compared by test id, in the landing-gate environment: a stubgh,GH_TOKEN=bogus, an emptyGH_CONFIG_DIR, an empty global git config,GIT_CONFIG_NOSYSTEM=1,git filter-repoon PATH, and/usr/bin/python3 -m pytest -p no:cacheprovider, at most two runs at a time.LC_ALL=C.UTF-8), the 31 files of the lane's tests/conftest.py and tests/test_adopt_plan_paths_spelled.py: under a one-byte locale such as Latin-1 the 0xff--work-dirrow skips and the two U+00E9 rows read the child's UTF-8, so none of the three fails on a tool that is right, and the bytes helper starts its child asrun_scriptdoes (#1196) #1209 gate kit. Base: 1781 rows, 1774 passed, 7 skipped, from RS1209's run of tree181f5eba9, which is this base's tree, in the same environment. Head: 1786 rows, 1779 passed, 7 skipped. Every row keeps its outcome, and the only change is 5 new rows, absent before and passing now.LOCPATHwithen_US.ISO-8859-1built as adopt-project.py: under a one-byte locale such as Latin-1, a clonecheckmakes again for a plan's clone record that neither spelling names is compared with both, so it is kept and the next run reads it rather than cloning again (#1112) #1153's test builds it,LC_ALL=en_US.ISO-8859-1,PYTHONUTF8=0), the 31 files. Base: 1359 passed, 123 failed, 299 skipped. Head: 1364 passed, 123 failed, 299 skipped. The same 123 ids fail on both heads, none of them this PR's, so no row goes from passed to failed. The only change is the same 5 new rows, absent before and passing now.LC_ALL=C PYTHONUTF8=0 PYTHONCOERCECLOCALE=0),tests/test_adopt_plan_paths_spelled.py. Base: 16 passed, 15 skipped. Head: 17 passed, 15 skipped. The new N5 row is the one more.N1's decision and its evidence
The brief's rule: take the first choice (the locale question in a helper of its own, asked only by the rows whose premise is that Python reads 0xFF in as U+DCFF) unless more than 12 rows then need a new premise skip under Latin-1.
The first choice was built and measured first, as commit
f48f46c7fon01ee69763(kept locally asrefs/w1224/first-choice, not pushed). It had a newskip_where_the_locale_reads_the_byte_as_text(), asked by the--work-dirrow and the two--outrows oftests/test_stdout_encoding.py, and the locale halves of both guards dropped. Under Latin-1, the 31 files, base01ee69763againstf48f46c7f, by test id:tests/test_adopt_plan_and_remote_paths_spelled.py, 33[...byte-0xff-not-utf-8]rows. 29 fail in the test process: it writes its plan withos.fsencode, which Latin-1 cannot use for the plan's U+2014 (UnicodeEncodeError). The other 4 get the byte as U+00FF in a refusal line where they expect it spelled as U+DCFF.tests/test_clone_url_bytes.py(12) andtests/test_local_remote_dir_urls.py(10): a directory named with the byte is text under Latin-1, soscaffold-project.pyandscripts/family.pygo on (exit 0, agitstarted) where the row expects the refusal of a name that is not UTF-8.tests/test_adopt_git_reads.py,tests/test_adopt_template_values.py,tests/test_adopt_plan_escapes.pyandtests/test_adopt_pins.py, 1 each: the byte is text, soexecuteadopts,planwrites, or the name prints as itself, where the row expects a refusal or a spelling.tests/test_family_member_branch_not_utf8.py[bump]and[remove]: the rollback is right and exits 2, but a Latin-1 stderr writes U+FFFD as an escape (adopt-project.pyplanraisesUnicodeEncodeErrorin its terminal report, after the plan file is written, for a printable name stdout cannot encode (日本.mdunder cp1252, as on a redirected Windows stdout), soplanexits 1 beforeplan written to#214).tests/test_bootstrap_branch_bytes.pyandtests/test_bootstrap_leg_moves.py, 1 each: the branch is printed asaU+00FFb, where the row expects U+DCFF spelled (tests: under a Latin-1 locale 4 rows of test_bootstrap_non_utf8_branch.py and test_bootstrap_branch_bytes.py fail on main, expecting the byte 0xFF spelleda\udcffbas UTF-8 reads it where bootstrap.py rightly prints U+00FF, and no issue names them #1301's kind; tests/test_bootstrap_non_utf8_branch.py and tests/test_bootstrap_branch_bytes.py: under Latin-1 four rows that expect the byte 0xFF spelleda\udcffbrun what judges there and skip on their premise, as each failed on a tool that is right (#1301) #1302 settles the first of the two).tests/test_family_leg_path_by_hand_bytes.py[utf8-keeps-shlex-quote-{sh,dash,bash,zsh}]: a suspected tool defect, see "Not in this PR".The ids are in the lane's scratch folder (
tools/run/w1224/):base-latin1.ids,head-latin1.ids(the first choice),delta-latin1.txt,s2f-msgs.txt.Rows
01ee69763test_an_earlier_question_skips_where_the_helper_skips_before_the_disk[utf-8],[ascii],[latin-1],[windows](helpers file, new)os.fsencodetest_the_child_read_as_bytes_is_started_as_run_script_starts_one(spelled file, new)test_a_locale_that_reads_the_byte_as_a_character_skips_before_the_disk(helpers file, changed)os.fsencodeemulated for the run ("this system'sos.fsencodemakes no byte...", no0xFF), as RV1209 foundos.fsencodeemulatedtest_where_fsencode_makes_three_bytes_the_disk_is_not_asked(helpers file, changed)UnicodeDecodeError)Windows'
os.fsencode"emulated for the run" means a pytest plugin that replacesos.fsencodewith UTF-8surrogatepassbefore each test's fixtures and puts it back after its teardown, as RV1209 emulated it. It lives in the lane's scratch folder (tools/run/w1224/plugins/), not in the PR. The new rows are in ASCII source, with escapes.Counts for the changed files, base against head:
Mutants
Run one at a time in a worktree at this head, each file put back with
git checkoutafter each and its sha256 checked againstHEAD's (all 12 matched). Each kills at least one row:[latin-1]of the predicate row..._the_disk_is_not_askedand[windows](UnicodeDecodeError)[latin-1][windows](UnicodeDecodeError)[windows][ascii]os.fsdecodealone, as at the baseos.fsencodeemulatedAGENT_PROTOCOL_ROOT, aschild_environgives itLANES_LANEThe first choice's own 15 mutants were also all killed at
f48f46c7f. They are moot here, and their log is in the scratch folder (logs/mutants.txt).Gate
The list is
tools/run/w1224/gate1224.txtin the lane's scratch folder, 38 files:skip_where_a_name_cannot_be_not_utf_8ora_system_that_carries_the_byte(RS1209's fixpoint) plustests/test_repo_hygiene.py;tests/test_stdout_encoding.py(test_bootstrap_non_utf8_branch.py,test_bootstrap_spelling.py,test_chain_link_fold.py,test_pinned_copy_columns.py,test_siblings_family_name.py,test_validator_child_encoding.py), or the callers file imports them (test_non_utf8_git_reads.py).Results:
tests/test_repo_hygiene.py: 101 passed, under UTF-8 and Latin-1.Merge-trees
git merge-tree --write-treeof this head, at 2026-11-10T21:18Z:origin/maina98fe7cb4(validate-family.py: a member whose git directory'sHEADthis user cannot open, under.git/modules/<path>or in a.gitdirectory, is refusedmember-unreadableby name, where it endedmember-commit-unresolvablewith a fetch (#1256) #1263 landed after tests/conftest.py and tests/test_adopt_plan_paths_spelled.py: under a one-byte locale such as Latin-1 the 0xff--work-dirrow skips and the two U+00E9 rows read the child's UTF-8, so none of the three fails on a tool that is right, and the bytes helper starts its child asrun_scriptdoes (#1196) #1209's base; it touchedtemplates/family-root/scripts/validate-family.pyand its own test, neither a file here): clean.origin, asclone.defaultRemoteNamenames it, is read from that remote, soplanreads its organisation, default branch and branches where it refusedadopt-no-org, took HEAD's branch as the default and asked--tracking-branchof the source's own branches, and one with several remotes and nooriginnames them and guesses none (#1276) #1280 and shape-doctor.py: a repository whose only remote is not namedoriginis offered the adoption lineplantakes,--project Thingwith no--org, where it was--project WorkUpstream --org <your-org>, whichplanrefusedadopt-not-the-source; thenamingrow and the Triad advisory read that remote too (#1292) #1320, which conflict inadopt-project.pywithorigin/mainalone (git merge-tree origin/main <head>conflicts there too), so not through this PR.checkandexecutework the follow-ups out from the plan as it stands andplanno longer stores them, so after a hand edit of an entry'sleg:neitherchecknor the split commit names aGNUmakefileor a collision the root no longer keeps, and a plan that still holds afollow_ups:list is refused by name (#1206) #1312 is the one other open PR that touchestests/conftest.py: clean against this head.a\udcffbrun what judges there and skip on their premise, as each failed on a tool that is right (#1301) #1302 (fix/1301-latin1-bootstrap-branch-rows): clean. Its two test files were run under Latin-1 on a scratch merge of tests/test_bootstrap_non_utf8_branch.py and tests/test_bootstrap_branch_bytes.py: under Latin-1 four rows that expect the byte 0xFF spelleda\udcffbrun what judges there and skip on their premise, as each failed on a tool that is right (#1301) #1302 and this head, and on one of tests/test_bootstrap_non_utf8_branch.py and tests/test_bootstrap_branch_bytes.py: under Latin-1 four rows that expect the byte 0xFF spelleda\udcffbrun what judges there and skip on their premise, as each failed on a tool that is right (#1301) #1302 and tests/conftest.py and tests/test_adopt_plan_paths_spelled.py: under a one-byte locale such as Latin-1 the 0xff--work-dirrow skips and the two U+00E9 rows read the child's UTF-8, so none of the three fails on a tool that is right, and the bytes helper starts its child asrun_scriptdoes (#1196) #1209's head: 83 passed and 9 skipped on each, with no change by id.test_a_name_that_is_not_utf8_is_still_carried_and_the_branch_made, skips at its first line on the shared helper's locale reason in both, because the helper keeps the locale question. Only the reason's words change. So under Latin-1 its run,could not create branchand HEAD's bytes do not judge there, as tests/test_bootstrap_non_utf8_branch.py and tests/test_bootstrap_branch_bytes.py: under Latin-1 four rows that expect the byte 0xFF spelleda\udcffbrun what judges there and skip on their premise, as each failed on a tool that is right (#1301) #1302's new docstring says they do.--work-dirrow skips and the two U+00E9 rows read the child's UTF-8, so none of the three fails on a tool that is right, and the bytes helper starts its child asrun_scriptdoes (#1196) #1209 alone, and stays true with this PR. It would have changed only under N1's first choice: there, on a scratch merge, row 4 ran the tool and then skipped on tests/test_bootstrap_non_utf8_branch.py and tests/test_bootstrap_branch_bytes.py: under Latin-1 four rows that expect the byte 0xFF spelleda\udcffbrun what judges there and skip on their premise, as each failed on a tool that is right (#1301) #1302's own premise (also 83 passed, 9 skipped).Not in this PR (follow-up candidates for Brett Heap; none filed)
scripts/family.py. Under Latin-1, the first choice lettests/test_family_leg_path_by_hand_bytes.py::test_each_printed_line_puts_the_leg_back_by_its_bytes[utf8-keeps-shlex-quote-{sh,dash,bash,zsh}]run, and all four failed.PinRollback._work_tree_by_hand, run in the test process, printed 3 lines where 4 are expected. Its legcafU+00E9's leg(UTF-8's bytes) had no word in thesubmodule updateline and nocheckoutline, so the restore lines a person types would not bring that leg back.self.legsandself.legs_left, and a path read once as UTF-8 and once in the locale's encoding would not match.a\udcffbrun what judges there and skip on their premise, as each failed on a tool that is right (#1301) #1302's docstring for its row 4 (above): it says the run judges under Latin-1. With tests/conftest.py and tests/test_adopt_plan_paths_spelled.py: under a one-byte locale such as Latin-1 the 0xff--work-dirrow skips and the two U+00E9 rows read the child's UTF-8, so none of the three fails on a tool that is right, and the bytes helper starts its child asrun_scriptdoes (#1196) #1209 landed it skips at its first line there.test_stdout_encoding.py), and whether each is a test that cannot judge under a one-byte locale or a tool defect is not measured (W1196's leftovers; follows #1196) #1214's rule asks for, and it is larger than this NIT.tests/test_adopt_plan_and_remote_paths_spelled.pyfails 87 rows under Latin-1 at the base and at this head, the same ids, outside this PR.Fix round (FX1224)
RV1224 graded
e73592062NOT READY for one SHOULD and three NITs (#1326 issuecomment-6783237077). Everything above describese73592062; this section is the delta on top of it. The head is now3f668f4f2, one commit one73592062, in three files:tests/conftest.py,tests/test_non_utf8_name_helpers.py,tests/test_non_utf8_name_callers.py. No tool changed, andscripts/family.pyis not touched (its defect stays a follow-up candidate, above). The new source is ASCII, with escapes.skip_where_the_locale_does_not_spell_it_as_utf_8's docstring no longer says a branch row "judges there too". It says that under a one-byte locale the row skips first, atskip_where_a_name_cannot_be_not_utf_8's locale question (tests/conftest.py: follow-up of PR #1209 (#1196) from its review: the helper's locale skip also catches 80 rows that can judge the tool under a one-byte locale, and four smaller gaps (a Windows failure, an unheld order, a triple predicate, a docstring) #1224's N1). Nothing else in that docstring changed.windows_fsencoderows holdwindows_fsdecode: it raisesUnicodeDecodeErroron the byte 0xFF, it gives the UTF-8 bytes ofcafand U+00E9 back as that text, and it passes a str through. The helpers file's docstring names it among its tools.locale_of:test_the_guard_of_the_rows_that_reach_the_disk_asks_the_predicate(helpers:[utf-8],[ascii],[latin-1]) andtest_the_fixture_that_lets_the_probe_through_asks_the_predicate(callers:[utf-8],[latin-1]). The guard and the fixture skip under Latin-1 and not under UTF-8 or ASCII, so they now judge under UTF-8, which CI runs.[cp1251]case in the N4 rows: 0xFF is U+044F there, so the predicate must say true where the helper skips.New rows: 9 (helpers 7, callers 2), each passing under UTF-8 and under Latin-1. Base
e73592062against this head, by test id, the helpers, callers and spelled files andtests/test_repo_hygiene.py:Mutants, run one at a time in a worktree at this head under UTF-8, each file put back with
git checkoutand its sha256 checked againstHEAD's. Ate73592062each survived under UTF-8, as RV1224 found:windows_fsdecodedecodes withsurrogateescapetest_windows_fsdecode_raises_on_a_byte_that_is_not_utf_8skip_where_an_earlier_question_skipsinverteda_system_that_carries_the_byteinverted[cp1251]SonarCloud at
3f668f4f2: quality gate passed, 0 open issues, 0.0% duplication.git merge-tree --write-treeof this head is clean againstorigin/maina6f1374b0, #1209's head, #1312 and #1302.Lane 4 logs OPENED for #1224; an independent review comes next.
🤖 Generated with Claude Code
Lane: openreposhape-4 (openRepoShape-4)
Summary by Sourcery
Align non-UTF-8 filename test skips with platform and locale behavior while consolidating shared predicates and strengthening cross-platform coverage.
Bug Fixes:
Enhancements:
Tests:
Chores: