Repository navigation
Description
Goal: every test that needs a directory named with a byte that is not UTF-8 asks the one helper whether this system can carry it, so a full disk or a permission error fails the test instead of skipping it, and a test about a skip helper is held on the encodings CI does not have.
Filed by lane openRepoShape-5, from the writer's checklist candidates of #663's PR (#723, w663, "Four tests make their own ...") and from the fix round of that PR (w663b and rv663b, "optional, v1.1.1"). Both are tests only.
Lands after: lane 5's #663 (PR #723, fix/663-non-utf8-name-tests, head 6ba8c5d2). It adds skip_where_a_name_cannot_be_not_utf_8 to tests/conftest.py (at 6ba8c5d2:tests/conftest.py:904), which the first line below calls; main has it only in tests/test_adopt_pins.py:893 today.
Lines (path:line at main 66b230ed, except the last, which is at #723's head 6ba8c5d2)
- Four tests and
directory_namedmake the directory themselves and skip on ANYOSError. Read from source, not measured. Each one builds a name from bytes, callsmkdir, and turnsOSErrorandUnicodeErrorintopytest.skip:tests/test_stdout_encoding.py:209-215(b"b\xffd",os.mkdir, then a listing check),tests/test_adopt_git_reads.py:465-469(cafand byte 0xE9,parent.mkdir(), then:471-473skips again where git will not work there),tests/test_adopt_template_values.py:296-300,tests/test_adopt_plan_escapes.py:402-406(the same, then:407-410) andtests/test_clone_url_bytes.py:136-152(directory_named, six callers at:188,:204,:232,:245,:292and:307). tests: one skip helper for names and branches that are not UTF-8, Windows guards onmake_fileand the--branch a\udcffbtest by emulation, and the UTF-8 promise and the leg finding's role pinned (#663) #723's helper answers the same question in two steps and skips only on the two answers that mean "this system cannot carry the name":os.fsencodefirst (Windows) andEILSEQsecond (macOS). Any otherOSErroris the test's own and is raised. These five skip onEACCES,ENOSPCand the rest, so a disk that fills up, or atmp_paththis user cannot write in, reads as SKIPPED where the helper's tests read it as a failure. Direction: call the helper for the question and keep each test's own second skip (git will not work under the name; the listing that shows a rewritten name). Fordirectory_named, whoserawis any bytes, call the helper for the names that are not UTF-8 and keep its own Windows skip for a name holding a control character.tests/test_adopt_plan_escapes.py:462-468asks the same question of a FILE (cafand byte 0xE9 plus.txt,write_bytes); it is the file twin, and tests: one skip helper for names and branches that are not UTF-8, Windows guards onmake_fileand the--branch a\udcffbtest by emulation, and the UTF-8 promise and the leg finding's role pinned (#663) #723'smake_fileskip intests/test_non_utf8_git_reads.pyis its model. -
test_make_file_writes_a_name_that_is_utf8_where_fsencode_makes_no_bytefails where the file-name encoding is ASCII (tests/test_non_utf8_git_reads.py:120-127at6ba8c5d2). Measured twice, by w663b at0b1d1ddband by rv663b at6ba8c5d2, underPYTHONUTF8=0 LC_ALL=C PYTHONCOERCECLOCALE=0(1 failed, 6 passed, 2 skipped):make_filecannot writecafand U+00E9 plus.yml, skips with "this filesystem cannot hold a file name that is not UTF-8: 'ascii' codec can't encode character", and the test'sassert skip_message(make_file, target, ...) is Nonefails at:126. The neighbouring control,:130-142, already endsif reason is not None and "filesystem" in reason: pytest.skip(reason). Direction: the same two lines in this test. CI never has that encoding, so nothing is red today; a person who runs the suite under a C locale sees one failure that is not a defect.
Verify: tests/test_stdout_encoding.py, tests/test_adopt_git_reads.py, tests/test_adopt_template_values.py, tests/test_adopt_plan_escapes.py, tests/test_clone_url_bytes.py and tests/test_non_utf8_git_reads.py pass on Linux, and tests/test_non_utf8_git_reads.py passes under PYTHONUTF8=0 LC_ALL=C PYTHONCOERCECLOCALE=0. For the first line, one test per file under monkeypatch.setattr(os, "mkdir", <raises PermissionError>) that asserts a failure and not a skip, as #723's tests/test_non_utf8_name_helpers.py does for the helper itself. No Windows or macOS run: CI is Linux only (#597), so the Windows half is emulated with windows_fsencode.
Overlaps. Open branches that touch these files: fix/663-non-utf8-name-tests (#723) edits tests/conftest.py and tests/test_non_utf8_git_reads.py; fix/672-bump-leg-branch-and-push-line (#746) also edits tests/test_non_utf8_git_reads.py (three dirty-list expectations); fix/693-local-remote-dir (96ebe450) edits tests/test_clone_url_bytes.py. Nothing on origin touches tests/test_stdout_encoding.py, tests/test_adopt_git_reads.py, tests/test_adopt_template_values.py or tests/test_adopt_plan_escapes.py. A line on #459 (issuecomment 6214823552, R433 O5) says directory_named skips every bad-name test on Windows, reasoned and not run; it is a different question about the same function, so decide it with the first line here. No pinned file changes.
Parent: #461.
Milestone: v1.1.1. Tests only; nothing a user runs changes.
🤖 Generated with Claude Code
Activity
brettheap commentedon Oct 17, 2026
CLAIMED — lane openRepoShape-5, session 50cede29-ab82-4ca3-9f67-d98e1a58c8d2@Eagle, 2026-10-17T10:24:07Z, for #757
Logged in
lanes/log/openRepoShape-5.mdatc1f23679ad2a49e5bb1ec7e752236858233df3b4.The three reads (lane-collision-protocol Rule 1):
test_non_utf8_git_reads.py and test_non_utf8_name_callers.py: the `ma…
tests: the emulated disk answers every errno but EILSEQ, `make_file` …
tests: three tests ask the helper whether a name can be made, `make_f…