Repository navigation
Description
(lane openRepoShape-4, 2026-11-09T16:13:15Z)
Found by: W1259, lane 4's writer of #1259 (the 13 rows that fail under a Latin-1 locale and pass under UTF-8), in its final report, section "Kind (c) defect, for lane 4 to file", and in the body of its draft PR #1278, under the heading "The tool defect (row 13, kind c)". Row 13 is tests/test_bootstrap_spelling.py::test_a_branch_name_is_spelled_in_every_line_that_names_it. W1259 found it to be a tool defect and not a test that cannot judge, so #1278 leaves it failing and untouched for an issue of its own. This is that issue. It follows #1259. The report is a lane 4 writer's message and is not posted on GitHub.
Lane 3 places this issue, and it has no milestone here: v1.2.1 is frozen. It is a tool defect under a one-byte locale, in the area of lane 3's #1078, #1112, #1106 and #1153 (adopt-project.py, a name the locale spells otherwise than the plan wrote it) and of the one-byte-locale tests of #1214 and #1259.
Nothing was re-run for this issue. Every measurement below is W1259's, read from its saved logs (in lane 4's scratch, tools/run/w1259/logs/probe-branch-latin1.log and tools/run/w1259/logs/probe-branch-second-run-latin1.txt) and its report. A sentence that is read from the code and not measured says so, and a reading that is the filer's and not W1259's says so. This body is ASCII, so each non-ASCII character is written as its code point, and a printed escape is written with a backslash.
What is wrong
Under a Latin-1 locale the assembly root's bootstrap.py makes the branch that tracking_branch names and leaves HEAD on it at the pin, and then says it could not make it (first run) and that git refused to check it out (every later run). Both claims are false, and the run still ends bootstrap ok, exit 0. HEAD is on the right branch at the right commit (measured, below), so what the user is told is wrong, and the line tells them to "deal with what git said", where git said nothing.
What was measured, and by whom
Measured by W1259, under Latin-1.
- The manifest:
tracking_branch: "tb\udcffx", the spelling that step (a) ofbootstrap.pytakes for a branch holding the byte 0xFF (the row's docstring: "the one such name step (a) hands to git since repo_shape.py's YAML reader: Unicode spaces are stripped from text YAML keeps, the empty block key andk: {?: 1}still read, and three texts about the reader are one word out of date (what #635 left) #715"). It is the manifest of row 13,project.yamlof the row'sAtlasproject. - The locale: 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'stests/test_adopt_one_byte_locale.pybuilds one:LOCPATH,LC_ALL=en_US.ISO-8859-1,PYTHONUTF8=0; Python 3.12.3, which the probe's header line reports asfsenc=iso8859-1 iso8859-1; a stubghfirst on PATH,GH_TOKEN=bogus, an emptyGH_CONFIG_DIR, an empty global git config. The first line of the log is bash's ownsetlocale: LC_ALL: cannot change locale (en_US.ISO-8859-1)warning fromenv.sh; the next line is the probe's header, where Python reports its encoding. - The tree: W1259's base tree at
cd9f3cfd1, the main W1259 began from.templates/assembly-root/scripts/bootstrap.pythere is the same blob (99c8bf065e56) as at42308f26b(read from the git objects, not run).
What the probe showed:
-
The row fails under Latin-1 at its first assert (
tests/test_bootstrap_spelling.py:454atcd9f3cfd1), which looks for[spec] spec: branch tb\udcffx created at <pin> .... The first run's stdout, as the assert's message holds it for thespecleg (pytest cuts the rest with...), reads:[spec] spec: could not create branch 'tb\udcffx' at the pin f6d8ff445a2d; leaving detached `git checkout -b` exited 0, and HEAD is not on the branch at the pin nothing else is tried; the recorded pin is authoritative. Deal with what git said and run bootstrap again. -
The branch exists and HEAD is on it at the pin, in both legs, before and after a second run. In the tree the failed run kept, W1259's
probe-branch.shrangit symbolic-ref HEADandgit rev-parse HEADinspecand incode, then ranscripts/bootstrap.py --skip-validatorsagain, then asked both again. The ref bytes printed byodarer e f s / h e a d s / t b 377 xin both legs, before and after; the commits aref6d8ff445a2d...(spec) andce2298350500...(code), before and after, and they are the pins (git rev-parse HEAD:spec HEAD:codein the root gives the same two). -
The second run says git refused, and exits 0. Its stdout, for both legs, then
bootstrap okandEXIT 0:[spec] spec: branch tb\udcffx is at the pin f6d8ff445a2d, and git refused to check it out: `git checkout` exited 0, and HEAD is not on the branch at the pin nothing else is tried; the recorded pin is authoritative. Deal with what git said and run bootstrap again. [code] code: branch tb\udcffx is at the pin ce2298350500, and git refused to check it out: `git checkout` exited 0, and HEAD is not on the branch at the pin nothing else is tried; the recorded pin is authoritative. Deal with what git said and run bootstrap again.Both messages say git exited 0 and then say it refused; with HEAD on the branch at the pin (point 2), neither claim holds.
-
UTF-8 and ASCII do not show it (the three-file runs,
tests/test_bootstrap_spelling.pywith the two other files, in W1259's PR body): 407 passed under UTF-8, on main and on the head; under ASCII "Rows 8 and 13 pass under ASCII on main and still do". The row asserts thecreated atline on the first run, so under both it is made and said so.
Read from the code, not measured (W1259's reading; the filer read the same lines again at origin/main 674077657, where the file is the same blob, 41c2eb42b563, as at 2fde6c3d0; on cd9f3cfd1 and 42308f26b the lines are :782, :798, :863, :1446, :1696 and :1698):
_head_of(:841) returns HEAD's ref asos.fsdecode(ref.rstrip(b"\r\n"))(:857). Its docstring says a branch not in UTF-8 "reads back as therefs/heads/<branch>built from the same name" (bootstrap.py: moving a leg off a branch overwrites an ignored file and ends a merge, P9 does not name the branch it leaves, a branch at its upstream's tip is left when HEAD is on a branch, a HEAD outsiderefs/heads/is read two ways #704). W1259: that holds only whereos.fsdecode(os.fsencode(name)) == name.- W1259: "Under Latin-1,
os.fsdecode(b"\xff")is U+00FF, not U+DCFF."os.fsencode("tb\udcffx")isb"tb\xffx"(surrogateescape), which is what git is handed, so git makesrefs/heads/tb\377x._head_ofreads that back asrefs/heads/tbU+00FFx, and the code buildsrefs/heads/{branch}from the manifest asrefs/heads/tbU+DCFFx. The two texts differ. - Two places compare them:
- the creation step,
if _head_of(sub) != (pin, f"refs/heads/{branch}")(:1755), which printscould not create branch(:1757); _check_out,if _head_of(sub) == (pin, f"refs/heads/{branch}")(:922), which returns "git checkoutexited 0, and HEAD is not on the branch at the pin", and whose caller prints "git refused to check it out" (:1505).
- the creation step,
What is not known
- Other codecs. W1259 probed Latin-1 only. The filer's reading, not run: another one-byte codec that decodes 0xFF to a character reads it as Latin-1 does. Under ASCII, 0xFF reads as U+DCFF, and the row passes (point 4).
- Which names are affected. The filer's reading, not run: under Latin-1 a name whose text survives
os.fsdecode(os.fsencode(name))unchanged is not affected, and the names the compare misreads are those that hold a lone surrogate, U+DC80 to U+DCFF, for a byte 0x80 to 0xFF. A branch a manifest spells as U+00FF (a character, not a surrogate) was not measured. How many manifests spell a branch as a surrogate is not known; the row's is the one known. - The row's later phases. The row has two more phases that expect
on tb\udcffx at <pin> (branch tip == pin)and, incodeafter a local commit,PIN <pin> != branch tb\udcffx tip <tip>. Neither was reached, because the first assert fails. W1259's second-run probe is the only measure of the second phase, and it shows the "refused" lines above. The third phase was not measured. - The upstream. The creation step returns (:1761) before
git branch --set-upstream-to=origin/<branch>(:1763), so the first run may leave a leg that has arefs/remotes/origin/<branch>(specin the row) with no upstream. This is read from the code. W1259 did not askbranch.<name>.remote, and did not look at a later run's effect on it. - The other sites. At
674077657the same text,_head_of's ref, is compared withrefs/heads/{branch}at :1501, :1508, :1585, :1586, :1679 and :1771, and is the input of_folded_twin,_on_a_branchand_place_of. They were read, not probed. Whether any of them misreads under Latin-1 is not known. family-root.templates/family-root/scripts/bootstrap.pyhas no_head_ofand norefs/heads/{branch}(the filer'sgrepof it at674077657).
Direction (the filer's reading; not tried)
Compare the ref the way git was handed the name: either as bytes, or against os.fsdecode(os.fsencode(f"refs/heads/{branch}")), the text git's bytes read back as. _head_of's text is also printed and tested by the helpers above, so changing what _head_of returns is wider than changing the two comparisons. The one who takes this decides, and looks at every site in "What is not known" under Latin-1 first.
Done when
- Under a Latin-1 locale built as adopt-project.py: under a one-byte locale such as Latin-1, a clone
checkmakes 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 one, a project whosetracking_branchis"tb\udcffx"gets from the assembly root'sbootstrap.pybranch tb\udcffx created at <pin>on the first run andon tb\udcffx at <pin> (branch tip == pin)on the next, and nevercould not create branchorgit refused to check it outwhile HEAD is on the branch at the pin.git symbolic-ref HEADandgit rev-parse HEADin both legs show it, as W1259's probe did. - The branch in
spec, which has arefs/remotes/origin/tb\udcffx, has its upstream after the first run under Latin-1 as it has under UTF-8 (git config branch.<name>.remotein the leg). -
tests/test_bootstrap_spelling.py::test_a_branch_name_is_spelled_in_every_line_that_names_itpasses under Latin-1 as it is written (tests: under a Latin-1 locale 12 of the 13 rows of #1259 skip on their own premise or read their UTF-8 file as UTF-8, and the 13th, the assembly root bootstrap.py saying it could not create a branch it made, is left failing for its own issue (#1259) #1278 leaves it untouched), and keeps passing under UTF-8 and ASCII. - Each other site in "What is not known" is measured under Latin-1 on the same manifest, and either reads right or is named in an issue.
- A branch the manifest spells as U+00FF, not as a surrogate, is measured under Latin-1 before and after, so the change does not move it.
See #1259, #1278, #1214, #1258, #704, #710, #1078, #1112, #1106 and #1153.
Lane: openreposhape-4 (openRepoShape-4)
Activity
brettheap commentedon Nov 10, 2026
CLAIMED — lane openRepoShape-1, session 300f8f46-004a-4e72-8587-4f192be2e108@Eagle, 2026-11-10T08:15:56Z, for #1283
Logged in
lanes/log/openRepoShape-1.mdatc53fa943ef725836a7085dbde0f0a2ff586b7fd8.The three reads (lane-collision-protocol Rule 1):
tests: test_bootstrap_branch_one_byte_locale.py runs the assembly roo…
tests: test_bootstrap_branch_one_byte_locale.py spells U+00FF by its …
tests: under a Latin-1 locale 12 of the 13 rows of #1259 skip on thei…
assembly-root bootstrap.py: `_branch_ref` falls back to main's compar…