Repository navigation
Description
What happens
go() (tests/test_install_unprintable_values_241.py:293-313 at 4c7ded8, the head of #241's branch when this was filed) builds its environment with command_env (tests/test_openrepotools_command.py:170-208). That copies os.environ, drops the OPENREPOTOOLS_* names, XDG_DATA_HOME, CLAUDE_PROFILES_HOME, CLAUDE_USER_DIR, AGENT_PROTOCOL_ROOT and PROJECTS_DIR, and applies the case's env. Neither file clears or sets LANG, LC_ALL or LC_CTYPE for a run. Line numbers are at 4c7ded8, in the test file unless the text says openRepoTools.
The installer asks the person's own locale about a directory, and only a directory: refuse_bad_bin_dir calls value_fault "$dir" locale (openRepoTools:5456), and locale_reading (openRepoTools:5387-5404) runs locale charmap, which reads LC_ALL, LC_CTYPE and LANG. Where a multibyte charmap that is not UTF-8 reads the bytes of a misdrawn character or a C1 control as text, the directory is taken, not refused. That is the design (openRepoShape issue 858: the locale is taken at its word). The repository and the ref never ask (openRepoTools:5487, :5492).
So a case that passes a directory holding a misdrawn character and no LC_ALL expects a refusal that holds only under a UTF-8 or C locale. Collecting the ids at 4c7ded8 and reading what each passes gives 51 items:
test_each_misdrawn_character_is_refused_by_its_code_point[...-the-directory], 41 (:474-488). Its docstring says "the locale changes nothing", which holds for the repository and the ref and not for the directory.- The U+202E rows of
UNNAMEABLE_BIN_DIRS(2,:398-403), ofBAD_HOMES(:436-437; 2 tests,--installat:441-453andwip initat:832-847) and ofWIP_BAD_DIRS(:780-781; 6 items, three routes with and without--dry-run).
The cases that name a locale (LC_ALL over LOCALES, and the marker-locale section from :1002) are not exposed.
Measured, with a stand-in locale first on PATH that answers each charmap and the real iconv: the installer at 4c7ded8, --install, gh and curl failing, for each of the 41 code points as <home>/a<char>forged.
locale charmap says |
refused at the door | went on (taken) |
|---|---|---|
| UTF-8, or ANSI_X3.4-1968 (C) | 41 | 0 |
| EUC-JP, EUC-KR | 40 | 1 (U+00AD) |
| Big5 | 36 | 5 |
| Shift_JIS | 15 | 26 |
| GBK | 7 | 34 |
| GB18030 | 1 | 40 |
U+202E is taken under GB18030, GBK and Shift_JIS. The full installer ran for UTF-8, GB18030 and Shift_JIS; the other rows come from value_fault, the installer's own function, whose answers matched the installer's wherever both ran.
CI's UTF-8 locale is unaffected, and so is a developer whose locale is UTF-8 or C. A developer whose shell exports a GB18030, GBK or Shift_JIS locale (installed) would see dozens of these rows fail for a reason that has nothing to do with the change under test.
Not run: the test module under a real multibyte locale. None is installed here (locale -a lists C, C.utf8 and POSIX) and, as the module says (:1006), none is on CI.
Suggested fix
Pin the locale in go() unless the case names one: pass {"LC_ALL": "C.UTF-8", **(env or {})} to command_env. A case that sets LC_ALL keeps its own, and the_persons_locale's empty LC_ALL (:1053-1056) still wins. C would do as well; both are in LOCALES. Pinning command_env instead would cover every install test that shares it.
To see the fix work without a multibyte locale installed: put put_a_locale's locale stub first on the pytest process's PATH and export LANG=xx_XX.GB18030. The items above should fail before the pin and pass after it.
Found by: the first independent review of #241 (NIT 3, 2026-10-22) and its re-review, which says the follow-up is worth doing (2026-10-22). Filed on Brett Heap's word of 2026-10-23T14:21:33Z, by multiple choice: "Pin LC_ALL in go()".
Lane: openRepoTools-5
Activity
brettheap commentedon Oct 24, 2026
CLAIMED — lane openRepoTools-5, session 0d83dca2-c18c-4bb0-99ce-896e6cafea02@Eagle, 2026-10-24T14:18:13Z, for #320
Logged in
lanes/log/openRepoTools-5.mdat71a7cdd13f7fd76ad606bd430f108101d570ae66.The three reads (lane-collision-protocol Rule 1):
A failed mktemp -d for the workdir ends --install with exit 1 from ev…
The late refusal of a link at settings.json says only what is true in…
The note wip init prints beside a refused hook pair says the refusal …