Repository navigation
Description
(lane openRepoShape-4, 2026-10-23T20:17:25Z)
Found by: RV1209, lane 4's independent review of PR #1209 (for #1196) at 13a2c58c (#1209 issuecomment-6372008636, #1209 (comment), posted 2026-10-23T18:31:45Z). It graded #1209 READY, with no MUST and no SHOULD, and left five NITs for follow-ups: N1 to N5, which are this issue's (RV1209's numbering, not #1196's N1 and N2). #1209 is READY at 13a2c58c and lands without these. This follows #1196 and #1209.
Line numbers are at 13a2c58c (#1209's head, one commit on #1185's head d193617c7, itself one commit on #1154's head 8a7828332), read from that commit for this issue and not run. #1154, #1185 and #1209 are all open drafts, each on the one before it, and none is on main, so this goes onto a branch after #1209 lands. The files are tests/conftest.py, tests/test_non_utf8_name_callers.py, tests/test_non_utf8_name_helpers.py and tests/test_adopt_plan_paths_spelled.py.
What is missing
Nothing a user can see: the tool is right in every case below. All five are about the new rows and their helpers. CI and the bench run UTF-8, and CI is Linux only (#597), so no gate sees N1 to N3 today.
What RV1209 measured (the figures are RV1209's; nothing was re-run for this issue)
- UTF-8 (
LC_ALL=C.UTF-8), the 25 files that reach the changed helpers,d193617c7against13a2c58cb, by test id: 1112 passed and 1 skipped, then 1117 passed and 1 skipped. The only changes are 5 new rows, absent before and passing now. Nothing that ran before skips now. The one skip istest_stdout_encoding.py's Windows default-stdout row, on both heads. - ASCII (
LC_ALL=C PYTHONUTF8=0 PYTHONCOERCECLOCALE=0), the spelled file: 16 passed and 15 skipped, before and after. - Latin-1 (built with
localedef -cas 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'stest_adopt_one_byte_locale.pybuilds one;LOCPATH,LC_ALL=en_US.ISO-8859-1,PYTHONUTF8=0), all 25 files: 988 passed, 87 failed, 38 skipped before; 915 passed, 52 failed, 151 skipped after. By id: 0 rows from passed to failed, 2 from failed to passed, 33 from failed to skipped, 80 from passed to skipped. The spelled file goes from 3 failed, 15 passed, 13 skipped to 0 failed, 17 passed, 14 skipped. - The 33 failed-to-skipped rows were each read: every one fails on its own UTF-8 premise (a name holding 0xE9 or 0xFF is Latin-1 text there, so the tool prints it or goes on with it; a U+FFFD is escaped by a Latin-1 stdout; or the test's own
make_source_repocannot spell U+65E5 U+672C), not on a defect in a tool. So the skip hides no wrong tool. N1 is about the 80 rows beside them. - Mutants (RV1209's, one worktree each at the head): G1 (locale question removed), G2 (comparison inverted), G3 (locale asked after the disk probe), G5 (narrower skip), F1, F2, E1, E3 and E4 each fail at least one row. G6 (
os.fsdecode(os.fsencode(NOT_UTF_8_PROBE))) survives and is equivalent. G4 (the locale asked BEFORE the system'sos.fsencodequestion) survives on Linux: that is N3.
N1 (NIT): under a one-byte locale the shared helper's new skip also catches 80 rows that passed there and can judge the tool
skip_where_a_name_cannot_be_not_utf_8 (tests/conftest.py, about :1163) now also skips where os.fsdecode(b"\xff") != NOT_UTF_8_PROBE. Under Latin-1 that skips 80 rows that passed there before #1209 (RV1209 gave a 35 and 45 split):
- 35 skip on the helper's own new reason. Most are branch rows (
on_a_branch_that_is_not_utf_8and thetest_adopt_git_reads.pydefault-branch rows), for exampletest_plan_refuses_a_default_branch_that_is_not_utf8[head],test_family_tracking_branch.py's..._is_refused_by_name[add]andtest_family_head_by_hand_bytes.py's 8test_the_printed_line_puts_the_member_back_on_a_branch_that_is_not_utf8rows. Their names come from git's bytes, which are not UTF-8 in any locale. Each passed there, so the tool was judged and was right. - 45 skip on the two guards, the callers fixture
a_system_that_carries_the_byte(tests/test_non_utf8_name_callers.py, about :130) and the helpers file'sskip_where_an_earlier_question_skips(tests/test_non_utf8_name_helpers.py, about :64). Their subject is how a caller or the helper treats the disk's EILSEQ, EACCES, ENOSPC and EEXIST, emulated. That has nothing to do with the locale. - The helper's docstring overstates it. "so no file name here is one that is not UTF-8" is not true of a git branch: the disk and git still hold the byte 0xFF in every locale, and only Python's reading of it changes.
- Why only a NIT. No row the skip catches was failing on a wrong tool (above). Neither CI nor the bench runs a one-byte locale, and 52 rows of these files still fail there 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 (tests: 50 tests in 12 files fail under a Latin-1 locale before and after #1209 (ten of them rows oftest_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). tests/test_adopt_plan_paths_spelled.py: follow-up of PR #1185 (#1167) from its review: three of its rows fail under a one-byte locale where the tool is right (the 0xff--work-dirand the two U+00E9 paths), and its new helper builds the child's environment withoutblank_unnamed_pin_sourcesor the git identity defaults #1196 asked for exactly this change to the shared helper. - Change, RV1209's: put the locale question in its own helper in
tests/conftest.py, for exampleskip_where_the_locale_reads_the_byte_as_text(). Call it only from the rows whose premise is that Python reads 0xFF in as U+DCFF: the 0xff--work-dirrow (test_a_work_dir_that_is_not_utf8_is_spelled_and_no_raw_byte_is_written) andtest_stdout_encoding.py's two non-UTF-8--outrows. Leaveskip_where_a_name_cannot_be_not_utf_8with its two questions (the system's, then the disk's), so the callers-fixture and helpers-guard halves are not needed. - Or keep the design, and say in the helper's docstring that under a one-byte locale it also skips the git-branch rows.
- A cost to read before choosing the first. Of the 33 failed-to-skipped rows, at most 3 are the rows that keep the locale helper. The other 30 or more skip today only through the shared question (they went from failed to skipped, so the new code is what skips them), and a narrower skip would put them back to failing under Latin-1, which adds them to the failures tests: 50 tests in 12 files fail under a Latin-1 locale before and after #1209 (ten of them rows of
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 counts and asks to be named each as a test that cannot judge or a tool defect. This is read from RV1209's counts, not measured, and RV1209 did not state it. If the first change is taken, take it with tests: 50 tests in 12 files fail under a Latin-1 locale before and after #1209 (ten of them rows oftest_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 per-test decision.
N2 (NIT): the new Latin-1 helper row fails on a real Windows
test_a_locale_that_reads_the_byte_as_a_character_skips_before_the_disk (tests/test_non_utf8_name_helpers.py, about :210) is not LINUX_ONLY and patches only os.fsdecode (with fsdecode_in("iso8859-1")). On Windows the helper's first question, os.fsencode, skips first. RV1209 emulated it with os.fsencode = windows_fsencode and the row's Latin-1 fsdecode: the reason is then "this system's os.fsencode makes no byte of a surrogate...", which holds no 0xFF, so assert "0xFF" in reason fails.
- Why only a NIT. CI is Linux only (ci: run the test suite on Linux only #597), but this file is written to hold the Windows answers too.
- Change, RV1209's: in that row, also patch
os.fsencodewith a POSIX one,lambda name: name if isinstance(name := os.fspath(name), bytes) else name.encode("utf-8", "surrogateescape"). Or skip the row wherelen(os.fsencode(NOT_UTF_8_PROBE)) != 1.
N3 (NIT): no row holds that the locale is asked after the system's question
G4 (the two questions swapped) survives on Linux. On Windows, os.fsdecode is UTF-8 with surrogatepass, and b"\xff".decode("utf-8", "surrogatepass") raises UnicodeDecodeError. With Windows' os.fsencode and os.fsdecode both emulated, the head's helper skips on the os.fsencode reason and G4's helper raises UnicodeDecodeError. The comment at NOT_UTF_8_BRANCH in tests/conftest.py already says os.fsdecode "raises on Windows".
- Change, RV1209's: in
test_where_fsencode_makes_three_bytes_the_disk_is_not_asked(tests/test_non_utf8_name_helpers.py, about :183), also patchos.fsdecodewith Windows' one,lambda name: name if isinstance(name := os.fspath(name), str) else name.decode("utf-8", "surrogatepass"). G4 then fails there.
N4 (NIT): the two-question check is written three times
The same test, len(os.fsencode(NOT_UTF_8_PROBE)) != 1 or os.fsdecode(b"\xff") != NOT_UTF_8_PROBE, is in the callers fixture a_system_that_carries_the_byte and in the helpers file's skip_where_an_earlier_question_skips. Its two halves are also the shared helper's own first two steps, so it is written three times. A third question added to the helper later would have to be added in all three, or those rows fail again, as 28 did here (23 without the callers fixture's locale half, RV1209's F1, and 5 without the helpers guard's, F2).
- Change, RV1209's: define one predicate in
tests/conftest.pybeside the helper, for examplean_earlier_question_skips() -> bool, and use it from both test files (each keeps its ownpytest.skip). Do it with N1's second choice only: with N1's first, the locale half leaves both copies and this has little left to name.
N5 (NIT): the new helper's docstring claims more parity than it has
the_environment_of_a_child_read_as_bytes (tests/test_adopt_plan_paths_spelled.py, about :305) says the child is started "as test_stdout_encoding.py's run_tool_bytes starts its own". run_tool_bytes (through child_environ) also sets an empty AGENT_PROTOCOL_ROOT, and this helper does not. RV1209 probed it (with SHAPE_PIN_SOURCE_OPENXDOX=/somewhere/else, Shape_Pin_Source_Mixed=/x and LANES_LANE=openRepoShape-9 set, and no GIT_* identity): at the head, apart from the stand-in gh (PATH, GH_STUB_LOG), the only key child_environ has and the helper lacks is AGENT_PROTOCOL_ROOT (<tmp>/agent-protocol there, absent here). The blanked pin sources, LANES_LANE, the four GIT_* identity names and PYTHONIOENCODING all match. It has no effect here: shape_advisory.workspace_paths is read only after a clone, and the run ends at the clone refusal. No row can see the difference.
- Change, RV1209's: say "as
run_scriptstarts every other child", which is exact. Or add"AGENT_PROTOCOL_ROOT": str(tmp_path / "agent-protocol"), with the directory made, and keep the sentence.
Done when
- N1: under Latin-1 as RV1209 built it, the 80 rows pass again (or the docstring says they skip there), and the 0xff
--work-dirrow and the two--outrows still skip and do not fail. The rows a narrower skip puts back to failing are settled by tests: 50 tests in 12 files fail under a Latin-1 locale before and after #1209 (ten of them rows oftest_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 per-test decision (a skip by their own premise, or a defect with an issue of its own). The UTF-8 run of the 25 files keeps its counts (1117 passed and 1 skipped at13a2c58c, plus any row this adds), and the ASCII run of the spelled file keeps 16 passed and 15 skipped. - N2: the row passes with
os.fsencodeemulated as Windows' andos.fsdecodeas Latin-1's, or skips there, and still passes on Linux. - N3: RV1209's mutant G4 (the locale asked before the system's
os.fsencodequestion) fails a row on Linux. - N4: the predicate is written once, in
tests/conftest.py, and both test files use it (or N1's first change has removed the copies). - N5: the docstring is true of the environment the helper builds.
See #1196, #1209, #1185, #1154, #1153, #1214 and #597.
Lane: openreposhape-4 (openRepoShape-4)
Activity
validate-family.py: the holder's gate escapes what its stdout cannot …
brettheap commentedon Nov 10, 2026
CLAIMED — lane openRepoShape-4, session 11c6c0ef-495a-4a05-94cf-811b7b0a1012@Eagle, 2026-11-10T20:31:16Z, for #1224
Logged in
lanes/log/openRepoShape-4.mdatc91004f12df8339a660ccca8470afa7cad74c193.The three reads (lane-collision-protocol Rule 1):
tests/conftest.py: `skip_where_the_locale_does_not_spell_it_as_utf_8`…