Repository navigation
tests: six skips on a failed git call ask the system first, so a failed git call fails the test and an encoding that cannot spell U+202E skips the bidi test (#853, #854) - #869
Conversation
… carry a name or branch that is not UTF-8, `os.fsencode` first and the disk's EILSEQ second, and two pins hold `bump-leg.py`'s UTF-8 decode and the leg finding's role, so a test no longer skips on the disk alone or passes under a decode as ASCII or a finding named by path (#663) #461's five test lines, lane 2's L2-52 and lane 4's R423 N1 and N2 and R455 F1 and F3. Test only: no tool and no template changes, and `validate-manifest.py`, a pinned copy, is read and not edited. - `tests/conftest.py` holds `skip_where_a_name_cannot_be_not_utf_8`, which `tests/test_adopt_pins.py` and `tests/test_pin_source_unreadable.py` each had a copy of. It asks `skip_where_fsencode_gives_a_surrogate_no_byte` first (Windows' `os.fsencode` makes three bytes of U+DCFF, so no name that stands for a byte is carried there, though NTFS would take the file), then the disk (macOS answers EILSEQ); any other error is the test's own. - `make_file` and the `--branch a\udcffb` test call it, so they skip on Windows too, where the disk takes the name and the child then refuses the branch. `test_a_branch_the_system_carries_has_no_fault` asks the same function instead of its own copy of the question. - `test_a_name_that_is_utf8_under_quote_path_false_is_still_refused` asserts that the line naming `caf<e9>.yml` holds no literal `\x`, in any locale, so `bump-leg.py` decoding git's bytes as ASCII fails it. - `_leg_branch_findings` is asked of a leg whose role is not its path, so naming the leg by `path` fails it. - `tests/test_non_utf8_name_helpers.py` holds the helpers to this, with Windows' `os.fsencode` and macOS's EILSEQ emulated: CI is Linux only, and no Windows or macOS run was made. Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…held by an emulation, so dropping the shared helper from it fails a test on Linux too (#663) `test_a_branch_the_system_carries_has_no_fault` now asks `skip_where_fsencode_gives_a_surrogate_no_byte` where it had its own copy of the question. The new test calls it under Windows' `os.fsencode` (emulated): a branch holding a byte-carrying surrogate is skipped, plain text and text with an accent run. Removing the call fails the two skipped rows. Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… fails where a skip escapes it, `windows_fsencode` passes bytes through as `os.fsencode` does, and the no-`\x` check skips where the file name encoding is not UTF-8, so a leaked skip, an emulation that breaks on bytes and a Latin-1 host no longer pass silently or fail on a tool that is right (#663) The review of #723 (0b1d1dd) found no MUST and three things to take. SHOULD-1: `skip_message` had no test of its own. A skip that escapes it ends the test SKIPPED, and no run fails on a skip, so the mutant where one escapes gave `10 passed, 3 skipped` on the helpers file and seven emulation tests silently skipped. `tests/test_non_utf8_name_helpers.py` now holds it with three tests: it returns the reason a call skips with, it returns None where the call does not skip, and it lets any other exception go on. The first catches the escape and fails it with `pytest.fail`, because a bare assert on an escaped skip would end that test SKIPPED too. NIT-2: `windows_fsencode` took `str` only. `os.fsencode` passes bytes through on every system, so the emulation now does, and two tests hold it (the surrogate and text, and the bytes, compared with `os.fsencode` itself). NIT-1: on a Latin-1 file name encoding `make_file` writes `caf\xe9.yml` as the single byte 0xE9, the tool prints `caf\xe9.yml`, and the new `"\\x" not in shown` assertion would fail although the tool is right. It is now `assert_shown_without_hex_escapes`, which skips where `os.fsencode(UTF8) != UTF8.encode("utf-8")` and is called after the test's other assertions, so a skip loses none of them. Two tests hold it under an emulated Latin-1 `os.fsencode` (it skips) and Windows' (it asserts, and fails a line that holds a `\x`). Tests only; no tool and no template changes. Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…_values.py, test_adopt_plan_escapes.py, test_clone_url_bytes.py and test_non_utf8_git_reads.py: the four tests and `directory_named` that made a directory named with a byte that is not UTF-8 ask `skip_where_a_name_cannot_be_not_utf_8` and skip on its two answers only, `directory_named` keeps its own Windows skip for a control character and no longer skips a bidi override there, and three tests of `test_non_utf8_git_reads.py` skip where an ASCII file name encoding cannot carry their text, so a full disk or a `tmp_path` nobody can write in fails the test instead of skipping it and a C locale shows no failure that is not a defect (#757) The four tests (in `test_stdout_encoding.py`, `test_adopt_git_reads.py`, `test_adopt_template_values.py` and `test_adopt_plan_escapes.py`) and `directory_named` each made the directory themselves and turned ANY `OSError` into `pytest.skip`, beside the helper #663 added to `tests/conftest.py`. That helper skips on the two answers that mean "this system cannot carry the name" (Windows' `os.fsencode` first, macOS's EILSEQ second) and raises the rest. They now call it, and each keeps its own second skip (git will not work under the name; a listing that shows a rewritten name); the directory they make after the probe is no longer guarded. The file twin in `test_adopt_plan_escapes.py` asks the same question of a file name and calls the helper too. `directory_named` asks the helper for a name that is not UTF-8 and keeps its own Windows skip for a control character, which Windows refuses in any name. The `bidi-override` row, which NTFS holds, now runs on Windows (reasoned; CI is Linux only, no Windows run was made). Under `PYTHONUTF8=0 LC_ALL=C PYTHONCOERCECLOCALE=0` the file name encoding is ASCII, and `tests/test_non_utf8_git_reads.py` failed six tests that hold no defect: `test_make_file_writes_a_name_that_is_utf8_where_fsencode_makes_no_byte` (the issue's line) and the five rows that put `Jos\u00E9`, a U+200C name or a U+202E name into a child's environment, where `subprocess` raises `UnicodeEncodeError` before the tool runs. The first now ends as its neighbour does, on a skip that names the filesystem; the others skip where `os.fsencode` cannot carry the value. `tests/test_non_utf8_name_callers.py` calls each caller as a function with the disk answering as macOS (EILSEQ on the probe: a skip), as a folder nobody can write in (EACCES on the probe, and on the test's own directory: a failure), and `directory_named` as Windows (a control character skips, a bidi override does not), and holds the two C-locale skips with an ASCII `os.fsencode` and a `write_bytes` that raises as it would. Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ke_file` test asks the file name encoding first and keeps its strict assert, the rows that let the probe through ask the real disk first, and each `pytest.raises` block holds one call, so a write the disk refuses fails the test and no skip is made of it, a disk that refuses the probe skips the rows and does not fail them, and the new file has no S5778 smell (#757) A fix round for lane 1's review of #806 at 4184972 (three SHOULD FIX, one nit). 1. The `make_file` test skipped on `make_file`'s own "filesystem" reason, which `make_file` gives for ANY `OSError` of its write, so a write refused with EACCES or ENOSPC for the plain UTF-8 name `caf` and U+00E9 plus `.yml` ended the test SKIPPED, and the reason it gave was false. The test now calls `skip_where_the_environment_cannot_carry(UTF8)` first, before it swaps in the Windows `os.fsencode`, and keeps the strict `assert skip_message(make_file, ...) is None`: it skips for the file name encoding and for nothing else. The helper's reason loses " in an environment", which was wrong for a file name; the callers file reads "file name encoding". The ASCII row now patches `os.fsencode`, and two rows make `Path.write_bytes` raise EACCES and ENOSPC and expect the test to FAIL. 2. The own-directory rows let the probe through to the real disk, and their fixture asked only `os.fsencode`, so on macOS's APFS or a ZFS with `utf8only` the real probe answers EILSEQ, the helper skips, and the row failed. `a_disk_that_takes_the_probe` asks the real disk first and those rows alone use it; a row makes the disk answer EILSEQ and asks the fixture. 3. `fail_where_the_caller_ends` holds the `pytest.fail`, so each `pytest.raises` block holds one call (python:S5778, two places, and the new EACCES/ENOSPC rows). 4. The Windows rows for a byte and a control character now call `directory_named` itself, so its order (ask, then make) is held: a version that skipped after `os.mkdir` leaves a directory or fails on `os.fsencode` of a path. The bidi row asks `skip_where_this_system_cannot_name` and is named for it, because `directory_named` goes on to make a `Path`, and under an emulated `os.name` of `nt` that is a `WindowsPath`. Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ile` skips on EILSEQ or a `UnicodeError` only and the U+202E directory has no guard, so a full disk or a read-only `tmp_path` fails the test, not SKIPPED (#834) Five tests that make a directory or a file named with a byte that is not UTF-8, or with U+202E, turned ANY `OSError` into `pytest.skip`, beside `skip_where_a_name_cannot_be_not_utf_8` (#663). A disk that filled up, a read-only `tmp_path` or a folder this user cannot write in read as SKIPPED, and no run fails on a skip. - `test_a_checkout_whose_path_is_not_utf8_is_a_checkout` (test_cli_reference.py) and `test_a_name_that_is_not_utf8_is_never_an_exception_quoted_as_a_finding` (test_doctor_validator_verdicts.py) ask the helper on `tmp_path` and make their directory with no `try`. - `test_a_branch_whose_name_is_not_utf8_is_read_back_on_every_run` (test_bootstrap_leg_moves.py) asks the helper in place of its `write_bytes` probe, which skipped on `OSError` and `ValueError`. - `make_file` (test_non_utf8_git_reads.py) keeps the `UnicodeError` skip (an ASCII file name encoding, #757) and skips an `OSError` only where its errno is EILSEQ (macOS); ENOSPC, EROFS and EACCES are raised, so each caller inherits a failure and no skip. #757's test of a refused write (test_non_utf8_name_callers.py) now expects that `OSError`, where it expected the AssertionError of the test's own "not a skip" assert. - The U+202E directory (test_adopt_template_values.py) is valid text, which no system known here refuses, so its `mkdir` is unguarded. Read, not run, on macOS and Windows; Linux takes it. tests/test_non_utf8_oserror_sites.py calls each as a function, with the disk answering as it would on a system CI does not run (Linux only, #597): EILSEQ on the probe (macOS) skips, EACCES, ENOSPC and EROFS on the probe or on the test's own name raise, and an `os.fsencode` that gives a surrogate three bytes (Windows) skips the three helper callers before the disk is touched. On the base 30 of its 32 tests fail, and so do the 2 changed ones of test_non_utf8_name_callers.py; the other 2 hold what both keep, the EILSEQ skip and the `UnicodeError` skip of `make_file`. No Windows or macOS run was made. Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…gives its two skips their own reasons, and the U+202E test fails where git fails, so a guard that skips the rest or a full disk after the `mkdir` no longer passes (#834) Fix round on #845, after lane 4's review of b18b243 (READY, no MUST). SHOULD 1. `REFUSALS` held ENOSPC, EROFS and EACCES, so a guard that re-raised those three and skipped every other error passed all of the tests. The emulated disk now answers every errno `errno.errorcode` holds but EILSEQ (129 of them), and each caller must raise it, as Python makes it (`PermissionError` for EACCES). The sweep stops at the first errno that fails and names it, so a caller that goes on past a refused name runs its test once and not 129 times. The explicit three-row families are gone, as the sweeps cover them; the new file has 18 tests where it had 32. SHOULD 2. The U+202E test's docstring claimed more than `refused_then_moved` did: its `make_source_repo` call still skipped on an `AssertionError`, so a disk that filled after the `mkdir` read as SKIPPED. Made true and not narrowed: `refused_then_moved` takes `skip_where_git_fails` (default True, as #757 left it for the name that is not UTF-8, which git may not work under), and the U+202E test passes False, as the name is valid text and git failing there is the disk. Two new tests hold it, and a third holds the kept skip for the byte name, which stays a known limit. NIT 3. `make_file` gives the two skips their own reasons: "this system's file name encoding cannot spell ..." for a `UnicodeError`, and "this filesystem refuses a file name that is not UTF-8 (EILSEQ)" for EILSEQ. The controls pin both. NIT 5. The new own-directory test is renamed for its sites, so a `-k` selection no longer picks up #757's test of the same name. NIT 6. The module docstring keeps `skip_where_a_name_cannot_be_not_utf_8` on one line. NIT 4 stays: moving the emulated disk and the two fixtures into conftest would add hunks to a file #814 and #818 also edit. Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…re and does not catch it, so a failing errno still names itself and the test has no `try` for python:S8714 (#834) Fix round 2 on #845, after lane 4's re-check of efb1727 (READY, no MUST). SonarCloud reported python:S8714 on the `except pytest.fail.Exception` of `raised_for_every_errno`, which caught a failure only to fail again with the errno's name in front. `fail_where_the_caller_ends` takes a keyword `said`, put in front of its message, and `the_error_of` threads it through; the loop passes `said=f"errno {code} ({errno.errorcode[code]}): "`. The loop has no `try`. The message a failing errno gives is the same as before, `errno 1 (EPERM): the caller ended SKIPPED: ...`, and the sweep still stops at the first errno that fails. The three other callers of `fail_where_the_caller_ends` pass no `said` and are unchanged. One test holds it: a caller that skips where it should raise fails at the first errno with the label in front of the message, and is asked once. It passes on efb1727 too, as the message is kept; it fails where the label is dropped at any of the three places it is passed, and where the sweep goes on past a failure. The U+202E test under a C locale (the re-check's NIT 2) is #854 and is not changed here. Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…es` block, so the block holds one call and python:S5778 no longer reports it (#834) Fix round 3 on #845, after lane 4's re-check of 9ba530a (READY, no MUST). SonarCloud reported python:S5778 (MAJOR) on `test_the_sweep_names_the_first_errno_that_fails_and_stops_there`: its `pytest.raises(pytest.fail.Exception)` block held two calls that could raise, `Disk(first)` and `raised_for_every_errno(...)`. `disk = Disk(first)` is built before the block, and the block holds `raised_for_every_errno(disk, hides_the_error, "a path")` alone. The assertions after it read the same exception, `failed.value.msg`, and the list of calls the caller was asked. Nothing else changes. Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…s `appended_to_command_scope` import and #806's `skip_where_a_name_cannot_be_not_utf_8` import both stay in `tests/test_adopt_git_reads.py`'s `from conftest import` block, as the union of the two names, sorted as the file sorts them main moved from `677f9bfa` to `e62b5e17`. #818 (`aec3b38f`) changed `tests/test_adopt_git_reads.py` and `tests/test_non_utf8_git_reads.py`, as #806 does. `tests/test_non_utf8_git_reads.py` merged by itself. In `tests/test_adopt_git_reads.py` the only conflict was the `from conftest import` block: #806's side added `skip_where_a_name_cannot_be_not_utf_8`, #818's side added `appended_to_command_scope` and took the block back to one line. The block is now both names, the constant first and the rest in alphabetical order, wrapped at 79 columns as the other test files wrap it. The rest of the file is #818's change to `command_scope` and to `test_the_user_name_given_is_appended_to_the_config_the_environment_holds`, beside #806's use of the skip helper. Conflicts: tests/test_adopt_git_reads.py Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…`from conftest import` block of `tests/test_adopt_git_reads.py` (#818's `appended_to_command_scope` beside #806's `skip_where_a_name_cannot_be_not_utf_8`), so main's #830 merges after it with no conflict #845's head 8f6a38e is stacked on #806's older head 76ae641. A merge of origin/main straight onto it conflicts in that one import line, which #806's own merge of e62b5e1 already resolved as the union of the names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s `with_default_branch` and `remembered_on` (51414d2), which #853's second line edits #853's second line waits for #797 (PR #830), which rewrote `with_default_branch`, gave it a `branch` argument called with a UTF-8 name, and added `remembered_on`, the sixth site of the issue's scan. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…m first and let git's failure fail the test, and the U+202E test asks the file name encoding before its `mkdir`, so a full disk reads as a failure, not SKIPPED, and a C locale skips that test instead of erroring (#853, #854) #853, line 1: `refused_then_moved`, `test_a_utf8_clone_of_a_source_whose_path_is_not_utf8_adopts` and `test_a_source_directory_that_is_not_utf8_is_shown_spelled` no longer wrap `make_source_repo` in `except AssertionError: pytest.skip(...)`. They already ask `skip_where_a_name_cannot_be_not_utf_8` before the `mkdir` (#757), and git works under any directory a system carries, so a git that fails there (a disk that filled after the `mkdir`) fails the test. `refused_then_moved` loses #834's `skip_where_git_fails`, which only the byte-name test still used. #853, line 2, and the sixth site: `with_default_branch`, `moved_to_a_branch_that_is_not_utf8` and `remembered_on` (added by #830 after the issue's scan) ask `skip_where_no_ref_can_be_named` before their first git call and drop their `except (AssertionError, UnicodeError, OSError)`. A name that is not UTF-8 asks the helper of the directory the source is in; a name that is text asks only whether the file name encoding can spell it, since `subprocess` puts every argument through `os.fsencode`. The skip after `git symbolic-ref` stays. #854: the U+202E test asks `skip_where_the_environment_cannot_carry` before its `mkdir`. The helper moves from `tests/test_non_utf8_git_reads.py` to `tests/conftest.py` with its callers, and its reason now reads "this system's file name encoding (...) cannot spell ...", as `make_file`'s does. `tests/test_non_utf8_git_failures.py` (new) calls each place with git made to fail, and with macOS, Windows and an ASCII encoding emulated. It also scans every `tests/*.py` for an `except` that names `AssertionError` and holds a `pytest.skip`. #845's control test that held the byte-name skip as a known limit is gone, and its two U+202E tests skip under an ASCII encoding. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
(lane openRepoShape-3, 2026-10-18T03:55:44Z) Lane 3's independent review of its own #869 (#853, #854) at
Verdict: READY. There is no MUST. There is one SHOULD and four NITs. The Review of #869, head The checks the brief asked for1. Both merges are exact and clean.
2a. A text branch name asking the file name encoding is right.
2b. Moving the helper and rewording its reason breaks nothing.
2c. The control test's purpose is kept, the other way round.
3. The scan, with my own script, independent of the writer's.
4.
5. The 6 C-locale failures are unchanged and were already there.
7. Windows.
8. SonarCloud analysed
9. Merges. See the merge results below. Other hygiene:
SHOULDSHOULD 1: line 1 has no Windows (
NITs
Test runsEvery run had a stub
MutantsEach was run against
Merge results
Scratch pathsAll under
No Windows or macOS run was possible here; those answers are emulated. Nothing was pushed or posted, and no git config was changed. Lane: openreposhape-3 (openRepoShape-3) |
…old them to asking before their `mkdir`, and the scan finds a `pytest.skip` in a bare, `Exception` or `BaseException` handler too (#853, review of #869) - `test_where_fsencode_makes_no_byte_the_byte_directory_test_skips_first` (`tests/test_non_utf8_git_failures.py`), one row for each of the three tests over `UNDER_A_BYTE_DIRECTORY`: with `os.fsencode` as Windows has it, each test skips on the helper's reason and makes nothing under `tmp_path`. A test that asked after its `mkdir` passed every row before. - `skips_on_an_assertion_error` is `skips_that_catch_an_assertion_error`: it finds an `except` that catches an `AssertionError` without naming it as well, so an `except Exception: pytest.skip(...)` around a git call fails the scan. No open pull request's `tests/` holds one. - `tests/test_non_utf8_oserror_sites.py`'s docstring says the U+202E test asks the file name encoding before its `mkdir` (#854). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…under a C locale ask the file name encoding first and skip there, as #854's U+202E test does Under `PYTHONUTF8=0 LC_ALL=C PYTHONCOERCECLOCALE=0` the file name encoding is ASCII. Three rows of `test_plan_refuses_a_flag_no_file_can_hold` (U+2028, U+202E, U+2066) and both rows of `test_a_valid_non_ascii_elector_still_adopts` raised at `subprocess.run` in `adopted`, which cannot put the value on `plan`'s command line there; `test_a_utf8_source_directory_still_adopts_with_local_remotes` raised at the `mkdir` of `caf` and U+00E9 in `make_source_repo`. Each now calls `skip_where_the_environment_cannot_carry` first. Under UTF-8 none skips. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
(lane openRepoShape-3, 2026-10-18T04:13:32Z) Fix round 1 (W869f) of lane 3's #869, answering RV869: pushed. The head is now
An independent re-check of this round (RV869b, opus) starts now. Lane: openreposhape-3 (openRepoShape-3) |
Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
(lane openRepoShape-3, 2026-10-18T04:37:54Z) Lane 3's independent re-check of #869's fix round 1 ( RV869b: independent re-check of fix round 1 on lane 3's #869 (closes #853 and #854). Head There is no MUST and no SHOULD, and there are four optional NITs. All five of RV869's items are fixed, and I measured each fix myself. All 33 open PR heads pass the wider scan, and so do their predicted merges. The head is clean with everything the brief named except a plain merge with current main (5 files). That conflict comes only from #806's squash landing at 04:17:02Z, after this round; merged through #845's new head it is clean (merge results below). What moved while I worked (the PR head did not;
On CI, The checks1. SHOULD 1: the Windows rows at
2. NIT 2, taken here: the six C-locale tests.
3. NIT 3: the wider scan.
4. NITs 1 and 4.
5. Every hunk read.
NITs (all optional)NIT 1:
NIT 2: the body's "Left out" says the six C-locale skips cannot get an emulated row. They can.
NIT 3: the scan has one false positive and two misses.
NIT 4: the title does not name the six extra skips.
Test runsAll runs used a stub
MutantsUnder UTF-8 unless marked C.
Merge results
Scratch paths
No Windows or macOS run was possible; those answers are emulated. Nothing was pushed or posted, no GitHub write was made, and no git config was changed. The scratch commits used env-var identities only. Lane: openreposhape-3 (openRepoShape-3) |
…s hold the C-locale skips of test_adopt_template_values.py in CI (#853, #854) Fix round 2 of #869, RV869b's NIT 1 and NIT 2. NIT 1: windows_fsencode now calls os.fspath first, so a test that asks os.fsencode(tmp_path) under the emulation no longer fails with an AttributeError before the question it holds; the rows of test_non_utf8_git_failures.py that ask after a mkdir now fail on their own empty-tmp_path assertion. A row in test_non_utf8_name_helpers.py holds it. NIT 2: six emulated rows in test_non_utf8_git_failures.py (os.fsencode as ASCII, make_source_repo failing) hold the six tests of test_adopt_template_values.py that skip under LC_ALL=C: each must skip on the file name encoding with nothing made under tmp_path. CI runs UTF-8, so a test that asked after make_source_repo or adopted passed there before. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
(lane openRepoShape-3, 2026-10-18T04:48:33Z) Fix round 2 (W869g, sonnet-xhigh) (
Lane 3's own check, not a reviewer's verdict: the round is tests only and takes two optional NITs, so it carries no opus re-check of its own. Lane 3 read every line of the diff (3 files, +72/-4, no non-ASCII added) and the writer's runs and mutants. The gate that runs before #869 lands covers the whole PR on its predicted squash tree, after #845 lands and #869 restacks. Lane: openreposhape-3 (openRepoShape-3) |
…s/test_adopt_template_values.py, tests/test_non_utf8_name_callers.py and tests/test_non_utf8_oserror_sites.py, which are #845's files and equal its final head there; tests/conftest.py is #845's squash's text with this branch's two changes laid on it, so main's NOT_UTF_8_BRANCH, NOT_UTF_8_BRANCH_NAMED and git_answer_bytes stay Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
(lane openRepoShape-3, 2026-10-18T10:26:50Z) #869 is restacked onto main by lane 3's R869 (sonnet), now at
Lane: openreposhape-3 (openRepoShape-3) |
|
|
Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days. You can request another review in 3 days and 8 hours by commenting |
…ith #815, #770, #869 and #802 (#883) Round 5 of #883, a refresh. Each line comes from its squash body and was checked against the code at main 0d5d2b1: - #815 (#764): a project's bootstrap ends a validator's exit 2 as `bootstrap REFUSED`, exit 2, takes an upstream path, cache or pin it cannot read as no answer, and leaves a reftable leg's cherry-pick or revert alone. A line in "What changed", one in "What 1.1.1 fixes", and a note under "What a script sees" on the direct run's exit code. Its body's leftovers, two tracebacks on Python 3.12 and 3.13 and two "failed" texts beneath a REFUSED line, are a new limit. - #770 (#755) and #869 (#853, #854): tests, in the Tests line. The test limit for #853 and #854, and the skip #845 left, which #869 removes, are retired. - #802 (#675): update-shape.py's `git show` lines are shell-quoted and its kept-copy readers read some Python as Python does. Its one-hop read and what it reads as running are a new limit. 67 pull requests; 69 of the milestone's 72 issues closed at 11:31Z, and the open list is the 3 that read leaves: #707, #879 and #884. The shape-copy lists stand: the assembly root's bootstrap.py, which #815 changes, is on them. No other file changes. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the release commit, #778's leg-clone sentence and #802's readers sentence, each checked against runs at v1.1.0 and main (#883 follow-up) (#893) The v1.1.1 notes landed as the release commit `5017830` (#883), and RV883's round 5 held two SHOULDs and five NITs for after it (#883 issuecomment-6250558821). This applies them to `docs/release-notes/v1.1.1.md`, with two more sentences lane 1's review found: 1. **#778's leg-clone sentence** says what runs at `v1.1.0` and `5017830` show. A leg clone whose own `AGENTS.md` says so keeps its leg row and its Triad row over each fault, where v1.1.0 gave `FINDING the way in refused` over a tab line and a traceback, exit 1, over a pattern that does not compile or a policy that raised on its name. A leg known only by its name gets a repository's two `n/a` rows. 2. **"Is", not "stays", exit 2,** in the pattern case, which was exit 1 in v1.1.0. 3. **#802's clause is dropped:** v1.1.0's `_blocks_inside` already read a `try`'s handlers, `else` and `finally` outside its guard. 4. **"What 1.1.1 fixes"** names "or cannot be used", and `the other way in`. 5. **#815's leftover tracebacks** were measured on Python 3.12; 3.13 is read, not run. 6. **#871 lets `_` through for any owner,** an organisation's name included. 7. **#869 asks the disk** only about a name that is not UTF-8. 8. **#802's readers:** at v1.1.0 only the import reader skipped an `if TYPE_CHECKING:` body; the binding reader skips one now. 9. **A known limit names #940:** under the `C` or POSIX locale, the bash `openRepoShape` and `setup.sh`'s guards refuse a URL, path or ref with a letter past ASCII as "a control character", a regression from v1.1.0 in the launcher through #872 (#866); a UTF-8 locale takes such a URL or path. The draft-time lines in the sections marked "remove at tag time" say main `2d372bb`, where #778 landed file for file as its reviewed head `8259ea1`, and that #879 moved to v1.2.0. The release body never carries those sections. Review: lane 1's independent reviewer found `b795ef74` NOT READY, on the leg-clone sentence, and `ca49f125` READY, with each changed sentence checked against runs at `v1.1.0` and `5017830`. Lane 1's second reviewer found `6cdb5551`, which adds the #940 limit, READY, with each clause measured against the launcher at `64464d31` and at v1.1.0. It lands by fast refresh (Brett Heap, 2026-10-15T22:48:35Z). Its reviewed head `6cdb5551` is green on Linux and SonarCloud. The branch merged main once and was never rebased; the last merge is update-branch's, clean, giving f60654e, which is green on SonarCloud and Git Bash. Lane 1's gate passed on its tree: the 5 test files that read the release notes or the workflows (`test_repo_hygiene.py`, `test_release_workflow.py`, `test_workflow_concurrency.py`, `test_agents_md_codes.py` and `test_cli_reference.py`), 221 passed and 0 skipped. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>



How to review
84a09c2e. Review it asgit diff 84a09c2e 2572a717(9 test files, +629/-118).40531e19is the change.60836f5candbcf6952eare fix round 1, which answers lane 3's review RV869 (comment); review the round alone asgit diff 40531e19 bcf6952e(3 test files, +101/-23).2572a717is fix round 2, which answers the two optional NITs of lane 3's re-check RV869b (comment); review it alone asgit diff bcf6952e 2572a717(3 test files, +72/-4). GitHub's diff againstfix/834-oserror-skipsalso shows the two merges below.e387a3c2: tests: four tests,directory_namedand the file twin ask the one helper whether a name that is not UTF-8 can be made and skip on its two answers only, and three tests skip where an ASCII file name encoding cannot carry their text (#757) #806's current heada1498632. tests: three tests ask the helper whether a name can be made,make_fileskips on EILSEQ or aUnicodeErroronly and the U+202E directory has no guard, so a full disk or a read-onlytmp_pathfails the test, not SKIPPED (#834) #845's head8f6a38e3is stacked on tests: four tests,directory_namedand the file twin ask the one helper whether a name that is not UTF-8 can be made and skip on its two answers only, and three tests skip where an ASCII file name encoding cannot carry their text (#757) #806's older head76ae6419. Merging main straight onto it conflicts in one place: thefrom conftest importline oftests/test_adopt_git_reads.py(tests/test_doctor_legs_members_next.py and 24 other files: tests append what they tell git to theGIT_CONFIG_COUNTentries the environment holds, so a pasted line keeps the session's maintenance settings and the Windows job's two (#758) #818'sappended_to_command_scopebeside tests: four tests,directory_namedand the file twin ask the one helper whether a name that is not UTF-8 can be made and skip on its two answers only, and three tests skip where an ASCII file name encoding cannot carry their text (#757) #806'sskip_where_a_name_cannot_be_not_utf_8). tests: four tests,directory_namedand the file twin ask the one helper whether a name that is not UTF-8 can be made and skip on its two answers only, and three tests skip where an ASCII file name encoding cannot carry their text (#757) #806's own merge ofe62b5e17already resolves that line, keeping both names, so taking tests: four tests,directory_namedand the file twin ask the one helper whether a name that is not UTF-8 can be made and skip on its two answers only, and three tests skip where an ASCII file name encoding cannot carry their text (#757) #806's head first makes the next merge clean.84a09c2e: origin/main3fb30a8f. It brings adopt-project.py:_default_branchreadsorigin/HEADand HEAD by full name and whole, and reads the source only at a branch of its own, so agit clone -bsource is no longergit-failedwith no remedy, and a HEAD onorigin/x, onmain<U+00A0>or beside a tagmainno longer adopts another branch's commit (#797) #830 (51414d2, adopt-project.py:_default_branchreadsorigin/HEADand HEAD by short name, so a source cloned withgit clone -b <branch>is refusedgit-failedwith no remedy, and a HEAD on a localorigin/xor on a name ending in U+00A0 adopts another branch's commit #797), which tests: five adopt tests skip on any failure ofmake_source_repo, or of thegitcall that makes a branch whose name is not UTF-8, so a full disk or a refused write reads as SKIPPED #853's second line waits for. adopt-project.py:_default_branchreadsorigin/HEADand HEAD by full name and whole, and reads the source only at a branch of its own, so agit clone -bsource is no longergit-failedwith no remedy, and a HEAD onorigin/x, onmain<U+00A0>or beside a tagmainno longer adopts another branch's commit (#797) #830 rewrotewith_default_branchand addedremembered_on. Both merges were clean, and their trees match themerge-treepredictions (88a781dc,f7147379).make_fileskips on EILSEQ or aUnicodeErroronly and the U+202E directory has no guard, so a full disk or a read-onlytmp_pathfails the test, not SKIPPED (#834) #845, which is stacked on tests: four tests,directory_namedand the file twin ask the one helper whether a name that is not UTF-8 can be made and skip on its two answers only, and three tests skip where an ASCII file name encoding cannot carry their text (#757) #806. It lands after both, by lane 3's three-merge restack.Closes #853.
Closes #854.
Tests only. No tool, template, pinned file or doc changes. Beyond the two issues' text, the PR also makes six more tests in
tests/test_adopt_template_values.pyskip under a C locale, where they raisedUnicodeEncodeError(see "Beyond #853 and #854" below).What changed
#853, line 1: three tests no longer skip when
make_source_repofailsrefused_then_moved(tests/test_adopt_template_values.py),test_a_utf8_clone_of_a_source_whose_path_is_not_utf8_adopts(tests/test_adopt_git_reads.py) andtest_a_source_directory_that_is_not_utf8_is_shown_spelled(tests/test_adopt_plan_escapes.py) each wrappedmake_source_repo(parent / "Thing")inexcept AssertionError: pytest.skip("git will not work under ..."). All threetryblocks are gone.directory_namedand the file twin ask the one helper whether a name that is not UTF-8 can be made and skip on its two answers only, and three tests skip where an ASCII file name encoding cannot carry their text (#757) #806'sskip_where_a_name_cannot_be_not_utf_8still asks them before themkdir.mkdiris the case this catches.refused_then_movedwas worked from tests: three tests ask the helper whether a name can be made,make_fileskips on EILSEQ or aUnicodeErroronly and the U+202E directory has no guard, so a full disk or a read-onlytmp_pathfails the test, not SKIPPED (#834) #845's version, which had addedskip_where_git_fails(true for the byte name, false for U+202E). With thetrygone, the parameter has no use, so it is removed, together with the U+202E caller'sskip_where_git_fails=False.make_fileskips on EILSEQ or aUnicodeErroronly and the U+202E directory has no guard, so a full disk or a read-onlytmp_pathfails the test, not SKIPPED (#834) #845's control testtest_a_failure_of_git_under_the_byte_directory_still_skips_the_test, intests/test_non_utf8_oserror_sites.py, asserted this skip as a known limit. It is removed, and that file's docstring points to the new tests.make_source_repo, or of thegitcall that makes a branch whose name is not UTF-8, so a full disk or a refused write reads as SKIPPED #853's Verify asks that Windows'os.fsencodestill skips. A new test,test_where_fsencode_makes_no_byte_the_byte_directory_test_skips_first, has one row for each of the three tests. Withwindows_fsencodein place, each test must skip on theos.fsencodereason, and nothing may be made undertmp_path. RV869's mutant asks the question after the template-values test'smkdir. It passed every row before, and it fails this one now.#853, line 2, and the sixth site: three branch helpers no longer skip when git fails
with_default_branch,moved_to_a_branch_that_is_not_utf8andremembered_on(tests/test_adopt_git_reads.py) caughtexcept (AssertionError, UnicodeError, OSError)around the git calls that make the branch.remembered_onis the sixth site. adopt-project.py:_default_branchreadsorigin/HEADand HEAD by full name and whole, and reads the source only at a branch of its own, so agit clone -bsource is no longergit-failedwith no remedy, and a HEAD onorigin/x, onmain<U+00A0>or beside a tagmainno longer adopts another branch's commit (#797) #830 added it after the issue's scan of main atfc867207. The same AST scan, run on this branch after merge 2, found it attests/test_adopt_git_reads.py:730. It is called withma, U+2028 andin(text) and withcafand byte 0xE9 (not UTF-8).skip_where_no_ref_can_be_named(source, branch), before its first git call, and theexceptis gone. That function asks:skip_where_a_name_cannot_be_not_utf_8(source.parent), as the issue says. That asks Windows'os.fsencodefirst, then macOS's EILSEQ, on the disk the ref files go to.subprocessputs every argument throughos.fsencode, so underLC_ALL=Cthe git call formainplus U+00A0, or for U+2028, raisedUnicodeEncodeErrorin the test. On the base those rows skipped through the broadexcept, asno branch here is named b'main\xc2\xa0': UnicodeEncodeError(...). Asking nothing would have turned those skips into failures under the C locale. Under UTF-8 the question never skips.moved_to_a_branch_that_is_not_utf8asks before it makes anything, so a skip costs nomake_source_repoand noplanrun.git symbolic-ref, inwith_default_branch, stays. Whether git gives the name back as it was written is the system's answer, and no exception is behind it.#854: the U+202E test skips under an ASCII file name encoding
test_execute_refuses_a_local_source_directory_holding_a_bidi_controlnow callsskip_where_the_environment_cannot_carry(parent.name)beforeparent.mkdir(). Nothing else in the test is guarded.directory_namedand the file twin ask the one helper whether a name that is not UTF-8 can be made and skip on its two answers only, and three tests skip where an ASCII file name encoding cannot carry their text (#757) #806's, and it moved fromtests/test_non_utf8_git_reads.pytotests/conftest.pytogether with its callers:tests/test_non_utf8_git_reads.py(3 calls),tests/test_non_utf8_name_callers.py(3) andtests/test_non_utf8_oserror_sites.py(1). Without the move,test_adopt_template_values.py, which three other test files import, would have had to importtest_non_utf8_git_reads.pyand, through it,test_bump_leg.pyandtest_commit_trailers.py. It now sits afterskip_message, away from update-shape.py, family.py and bump-leg.py: the branch HEAD is on is read as the bytes git wrote, so a branch ending in U+00A0 is no longer read as its neighbour, and a name that is not UTF-8 is refused by name before anything is written (#765) #849's hunk inconftest.py.make_file's encoding skip is since tests: three tests ask the helper whether a name can be made,make_fileskips on EILSEQ or aUnicodeErroronly and the U+202E directory has no guard, so a full disk or a read-onlytmp_pathfails the test, not SKIPPED (#834) #845's fix round. The existing tests assert only "file name encoding", so tests: four tests,directory_namedand the file twin ask the one helper whether a name that is not UTF-8 can be made and skip on its two answers only, and three tests skip where an ASCII file name encoding cannot carry their text (#757) #806's three callers keep passing. Their reasons change by that one word.make_fileskips on EILSEQ or aUnicodeErroronly and the U+202E directory has no guard, so a full disk or a read-onlytmp_pathfails the test, not SKIPPED (#834) #845's two U+202E tests intests/test_non_utf8_oserror_sites.py(the disk sweep and the git failure) now ask the same question first. Without it, under the C locale, the bidi test would skip before the disk or git is reached, and both tests would fail on a skip.Beyond #853 and #854: six more tests skip under a C locale (fix round 1)
Under
PYTHONUTF8=0 LC_ALL=C PYTHONCOERCECLOCALE=0 LANG=C LC_CTYPE=C, six tests intests/test_adopt_template_values.pyraisedUnicodeEncodeErrorin the test body. Neither issue names them: #854 names only the U+202E test, and #853 is aboutAssertionErrorskips. They are the same kind of failure as #854, in a file this PR already changes, so this PR takes them (the review's NIT 2) and they need no issue of their own.subprocess.runinadopted. In ASCII it cannot put the value onplan's command line. They aretest_plan_refuses_a_flag_no_file_can_hold[--elected-by='Jos\\u2028e'],[--elected-by='\\u202eevil'],[--reference='ref \\u2066x\\u2069 y'],test_a_valid_non_ascii_elector_still_adopts[accented]and[zero-width-non-joiner]. Each now callsskip_where_the_environment_cannot_carrywith its value (the elector, in the second test) as its first line, beforemake_source_repoandadopted.test_a_utf8_source_directory_still_adopts_with_local_remotes, raised at themkdirofcafand U+00E9 inmake_source_repo(tests/conftest.py:916). It now asks about that directory's name beforemake_source_repo.40531e19, the six:6 failed, 3 passed, 69 deselected. The 3 that pass are the flag test's surrogate and TAB rows, which ASCII withsurrogateescapecan carry.84a09c2eand on origin/main (RV869's runs 3 and 5).bcf6952e:3 passed, 6 skipped. Each of the six skips on "this system's file name encoding (ascii) cannot spell ...".make_source_repooradoptedstill passed. Six emulated rows intests/test_non_utf8_git_failures.pynow hold them (see "Fix round 2" below).New:
tests/test_non_utf8_git_failures.py(42 tests)Each place is called as a plain function, as
tests/test_non_utf8_oserror_sites.pydoes. The tests reuse #845'sGIT_FAILED,a_source_git_cannot_make,the_error_ofandBIDI_TEST, and #806's fixtures,refusingandascii_fsencode.make_source_reporaisesAssertionError("... No space left on device")after the byte directory is madeos.fsencodegives a surrogate three bytes, andmake_source_repofailsos.fsencodebefore themkdiror git, with nothing made undertmp_pathgitraises ittmp_pathos.fsencodegives a surrogate three bytesos.fsencodebefore the disk or git, with nothing madeos.fsencodeis ASCIIos.fsencodeis ASCII, andos.mkdirraisesUnicodeEncodeErroras the real one does thereos.fsencodeis ASCII, andmake_source_repofailsmake_source_repo, with nothing made undertmp_pathtests/*.py, read as #853's scan reads it, and widerexceptthat catches anAssertionErrorholds apytest.skip. That covers one that namesAssertionError,ExceptionorBaseException(alone or in a tuple), and a bareexceptexcept AssertionErroralone, in a tuple, or with the skip behind araise;except Exception;except (OSError, BaseException); a bareexcept. Not found:except AssertionErrororexcept Exceptionwith no skip; one for another error; thesymbolic-refkind of skipThe states the helper answers still skip for the three line-1 tests:
directory_namedand the file twin ask the one helper whether a name that is not UTF-8 can be made and skip on its two answers only, and three tests skip where an ASCII file name encoding cannot carry their text (#757) #806's rows intests/test_non_utf8_name_callers.py(EILSEQ and EACCES on the probe, foradopt-git-reads,adopt-template-valuesandadopt-plan-escapes-directory) hold macOS's answer and the refusal.os.fsencode.All of them pass in the runs below.
AST scan after the change. I re-ran #853's scan, an
exceptthat namesAssertionErrorand holds apytest.skip, overtests/*.py. It finds no site. Before the change it found 6 on the merged tree: the issue's 5 andremembered_on.Fix round 1 widened the scan (the review's NIT 3).
skips_on_an_assertion_erroris nowskips_that_catch_an_assertion_error. It also finds a bareexcept, anexcept Exceptionor anexcept BaseExceptionthat holds apytest.skip. Each of those catches a failed git call without naming it.Tests
Linux, Python 3.12.3. Every run had a stub
ghfirst on PATH (it exits 97),GH_TOKEN=bogus, an emptyGH_CONFIG_DIRand/usr/bin/python3 -m pytest -q -p no:cacheprovider --basetemp=<scratch>/bt-<name> -o tmp_path_retention_policy=failed -rs <files>. The C locale addsPYTHONUTF8=0 LC_ALL=C PYTHONCOERCECLOCALE=0 LANG=C LC_CTYPE=C, andsys.getfilesystemencoding()printedasciithere.UTF-8, on the change's files. The 11 files are
tests/test_adopt_template_values.py,tests/test_adopt_git_reads.py,tests/test_adopt_plan_escapes.py,tests/test_non_utf8_name_helpers.py,tests/test_repo_hygiene.py,tests/test_non_utf8_oserror_sites.py,tests/test_non_utf8_name_callers.py,tests/test_non_utf8_git_reads.py,tests/test_non_utf8_git_failures.py,tests/test_family_init_asks_every_value.py(it importstest_non_utf8_git_reads.py) andtests/test_no_auto_maintenance.py(it scans every test file):Nothing skipped. The new file alone:
36 passed in 9.36s. At40531e19the same 11 files gave543 passed. The 7 new ones are the 3 line-1 Windows rows and the 4 new rows of the scan.C locale, on the 8 changed files. These are files 1-4 and 6-9 of the 11 above: the 7 changed test files and
tests/test_non_utf8_name_helpers.py.test_repo_hygiene.pyis left out.40531e19the same run was6 failed, 295 passed, 26 skipped. The 6 are the tests under "Beyond tests: five adopt tests skip on any failure ofmake_source_repo, or of thegitcall that makes a branch whose name is not UTF-8, so a full disk or a refused write reads as SKIPPED #853 and tests: under a C locale,test_execute_refuses_a_local_source_directory_holding_a_bidi_controlerrors atmkdir, because itsexcept OSErrordoes not catch theUnicodeEncodeErrorthat U+202E raises there, where it should skip #854" above, which skip now, and the 7 new tests pass.SKIPPED [1] tests/conftest.py:1219: this system's file name encoding (ascii) cannot spell '\u202ecaf'.84a09c2e, on its 7 files (the 8 less the new one), under the same environment:7 failed, 272 passed, 20 skipped in 131.11s (0:02:11). The 7 were those six plus the U+202E test, which failed withUnicodeEncodeError: 'ascii' codec can't encode character '\u202e'.The skip reasons of the C-locale run (
-rs):Mutants
Each mutant was applied alone in a scratch worktree, and
tests/test_non_utf8_git_failures.pywas run. All 13 are caught:try/skipback inrefused_then_movedtest_a_failure_of_git_under_the_byte_directory_fails_the_test[adopt-template-values], the scan[adopt-git-reads], the scan[adopt-plan-escapes], the scanexceptback inwith_default_branchmoved_to_a_branch_that_is_not_utf8remembered_on(the sixth site)skip_where_no_ref_can_be_namedasks nothing for a name that is not UTF-8moved_to_a_branch_that_is_not_utf8asks aftermake_source_repotmp_pathnot empty)test_where_the_file_name_encoding_cannot_spell_u202e_the_bidi_test_skipsmkdirWith a real git failure. A stub
gitfirst on PATH, in the scratch worktree only, failed one subcommand as a full disk does (error: unable to write file .git/objects/xx: No space left on device, exit 128) and ran/usr/bin/gitfor everything else:git commitfails,test_execute_refuses_a_local_source_directory_that_is_not_utf8:1 failed in 0.39s(AssertionError: error: unable to write file ...);1 skipped in 0.38s,SKIPPED [1] tests/test_adopt_template_values.py:266: git will not work under 'caf\udce9' here: error: unable to write file .git/objects/xx: No space left on device. This is the test that passes where it should fail.git branch -mfails,test_check_finds_a_plans_branch_gone_for_one_that_is_not_utf8:1 failed in 0.98s;moved_to_a_branch_that_is_not_utf8mutant:1 skipped in 0.95s("no branch here is named b'caf\xe9'").git update-reffails,test_the_way_through_spells_a_name_no_command_line_carries(the sixth site):2 failed in 0.63s;remembered_onmutant:2 skipped in 0.79s.#854 in the real C locale,
test_execute_refuses_a_local_source_directory_holding_a_bidi_control:1 skipped in 0.15s, on the reason above;1 failed in 0.26s, withUnicodeEncodeError: 'ascii' codec can't encode character '\u202e' in position 115at themkdir, as on the base;1 passed.Fix round 1. Each mutant was applied alone in a scratch worktree:
skip_where_a_name_cannot_be_not_utf_8after itsmkdirtest_non_utf8_*files (git_failures,name_callers,oserror_sites,name_helpers), UTF-81 failed, 107 passedtest_where_fsencode_makes_no_byte_the_byte_directory_test_skips_first[adopt-template-values]test_a_valid_non_ascii_elector_still_adoptsasks afteradopted2 failed(UnicodeEncodeErrorfor U+00E9 and for U+200C)test_plan_refuses_a_flag_no_file_can_holdasks afteradopted3 failed, 3 passedtest_a_utf8_source_directory_still_adopts_with_local_remotesasks aftermake_source_repo1 failed(UnicodeEncodeErrorat themkdir)except Exception as exc: pytest.skip(...)aroundwith_default_branch's git callstests/test_non_utf8_git_failures.py, UTF-85 failed, 31 passedtest_no_test_skips_on_an_assertion_error({'test_adopt_git_reads.py': [567]}) and the 4 behaviour rows ofwith_default_branch. With the scan of40531e19in its place, the scan test passes on own1:1 passedwindows_fsencodetakes noPath, at the test's ownos.fsencode(tmp_path). I also madewindows_fsencodetake one (os.fspath, in the scratch tree only). Then the same row fails onassert list(tmp_path.iterdir()) == [], with the directorycaf\udce9left there. Either way the row fails.2 passed,6 passed,1 passed). Atbcf6952ea C-locale run like the one above held those skips, and no emulated row did. Fix round 2 adds the rows (below).Fix round 2 (
2572a717): RV869b's two NITsNIT 1:
windows_fsencodetakes a path (tests/conftest.py:1187). It callsos.fspath(text)first, as the realos.fsencodedoes, so a test that asksos.fsencode(tmp_path)under the emulation no longer raisesAttributeError: 'PosixPath' object has no attribute 'encode'before the question it holds. A new row,test_windows_fsencode_takes_a_path_as_os_fsencode_does(tests/test_non_utf8_name_helpers.py:93), assertswindows_fsencode(Path("caf\udcff")) == b"caf\xed\xb3\xbf". Its non-ASCII is written as escapes.NIT 2: six emulated rows for the six C-locale skips (
tests/test_non_utf8_git_failures.py:299-347,WHERE_ASCII_CANNOT_SPELLandtest_where_the_file_name_encoding_is_ascii_the_template_values_tests_skip). Each row setsos.fsencodetoascii_fsencodeandmake_source_repotoa_source_git_cannot_make, as the line-1 rows do. It then asserts that the test skips on "file name encoding" and thattmp_pathis empty. The rows areflag-u2028,flag-u202e,flag-u2066,elector-accented,elector-zwnjandcafe-directory. A test that asked aftermake_source_repofails on git's error under UTF-8, which is CI's locale.Runs (stub
ghfirst on PATH, as above):windows_fsencodeorascii_fsencode(tests/test_bootstrap_branch_bytes.py,tests/test_bootstrap_non_utf8_branch.py,tests/test_non_utf8_git_failures.py,tests/test_non_utf8_git_reads.py,tests/test_non_utf8_name_callers.py,tests/test_non_utf8_name_helpers.py,tests/test_non_utf8_oserror_sites.py), plustests/test_adopt_template_values.pyandtests/test_repo_hygiene.py:411 passed in 111.76s (0:01:51), nothing skipped.tests/test_non_utf8_git_failures.pyandtests/test_adopt_template_values.py:109 passed, 11 skipped in 44.32s. The 11 skips are the 6 template-values tests, the U+202E test and the 4 text-branch rows, each on "file name encoding ... cannot spell".Mutants, under UTF-8, each alone in a scratch worktree,
tests/test_non_utf8_git_failures.py:adopted3 failed, 39 passed[flag-u2028],[flag-u202e],[flag-u2066]cafand U+00E9 test asks aftermake_source_repo1 failed, 41 passed[cafe-directory]flag, notvalue3 failed, 39 passedmake_source_repo2 failed, 40 passed[elector-accented],[elector-zwnj]os.fspathtaken out ofwindows_fsencode1 failed, 60 passed(withtests/test_non_utf8_name_helpers.py)test_windows_fsencode_takes_a_path_as_os_fsencode_does, by theAttributeErrormkdir1 failed, 114 passed(the fourtest_non_utf8_*files)[adopt-template-values]of the byte-directory Windows rows, onassert list(tmp_path.iterdir()) == []and no longer on anAttributeErrorMerge checks
git merge-tree --write-treeofbcf6952e:d6475f96): clean (tree963aff8b);make_fileskips on EILSEQ or aUnicodeErroronly and the U+202E directory has no guard, so a full disk or a read-onlytmp_pathfails the test, not SKIPPED (#834) #845 (8f6a38e3): clean. The result is the head's own tree,840b7794;directory_namedand the file twin ask the one helper whether a name that is not UTF-8 can be made and skip on its two answers only, and three tests skip where an ASCII file name encoding cannot carry their text (#757) #806: clean. Its head moved during this round, froma1498632to22238b47, which merges origin/maind6475f96into it.a1498632gives the head's own tree,840b7794, and22238b47gives963aff8b, the same tree as the merge with origin/main. This round made no merge: tests: six skips on a failed git call ask the system first, so a failed git call fails the test and an encoding that cannot spell U+202E skips the bidi test (#853, #854) #869 restacks after tests: three tests ask the helper whether a name can be made,make_fileskips on EILSEQ or aUnicodeErroronly and the U+202E directory has no guard, so a full disk or a read-onlytmp_pathfails the test, not SKIPPED (#834) #845 lands;--org:initasks GitHub's limits on the topic, the--organd the holder's name before any repository exists,checkfinds whatexecuterefuses from one list, and an--orgGitHub gives no organisation (., a trailing hyphen,--) is refused where GitHub is asked (#863) #871 (66fc8f6b, which touchestests/test_non_utf8_git_reads.py): clean;fix/765-branch-read-bytes,d98df568, which touchestests/conftest.py):tests/conftest.pymerges clean.tests/test_bump_leg_branch_and_push_line.pyandtests/test_family_tracking_branch.py, files this PR does not touch, as it did at40531e19.merge-tree origin/main d98df568, atd6475f96, conflicts in the same two files.gh pr list --state open --limit 200 --json number,filesshows 34 open PRs. Only #806, #845, #849 and #871 touch these 8 files.The open PRs'
tests/, for the widened scan.gh pr list --state open --limit 200 --json number,headRefOid, 34 open, this one included). It scanned each head'stests/with the widened scan.except, anexcept Exceptionor anexcept BaseExceptionthat holds apytest.skip.except AssertionErrorsites (5 or 6 a head), which it keeps from main before this PR.Left out
os.fsencode. They do not change whatsubprocessdoes with an argument, somake_source_repois replaced by a function that fails: a test that went on past its question fails on git's error under UTF-8. A real C-locale run is still what finds a new test of this kind.Lane: openreposhape-3 (openRepoShape-3)
🤖 Generated with Claude Code
Summary by Sourcery
Make non-UTF-8 test skips depend on explicit system capability checks while allowing unexpected Git and filesystem failures to fail the tests.
New Features:
Bug Fixes:
Enhancements:
Tests: