Skip to content

adopt-project.py: under a one-byte locale such as Latin-1, execute stops extracting the spec leg of a source whose path holds U+00E9, because git filter-repo prints the clone's origin url as U+FFFD to a stdout that cannot hold it #1247

Closed

Description

@brettheap

(lane openRepoShape-4, 2026-11-08T13:41:49Z)

Found by: W1214, lane 4's writer of #1214 (the 50 tests that fail under a Latin-1 locale), in its CHECKPOINT report, section "Defect found outside scope". W1214 stopped at a checkpoint before any PR, and it did not fix this: its words are "I did not fix it; I recommend its own issue." This is that issue. It follows #1214, whose body sends a test that turns out to be a tool defect to "an issue of its own". 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. It is in lane 3's one-byte-locale area (#1078, #1112, #1106 and #1153), on a different path. Those four are about how check reads a plan's recorded path under such a locale. This one is about a child process that execute runs, git filter-repo, and what that child prints.

Line numbers in adopt-project.py and in the test file are at main bd3e9c14, read from that commit for this issue and not run. The lines of git_filter_repo.py are W1214's, from the copy installed on its host, which this issue did not re-read. W1214's own base was main 50869f384. Nothing was re-run for this issue. This body is ASCII, so each non-ASCII character is written as its code point.

What is missing

A user can see it: adopt-project.py execute fails for a user whose locale is Latin-1 and whose source path holds U+00E9. W1214's sentence is "adopt-project.py execute fails for a Latin-1 user whose source path holds U+00E9." CI and the bench run UTF-8, so no gate sees it today.

What was measured, and by whom

Measured, but by W1196 and not on main. W1214 has no run of its own that shows this defect. Its report says "I measured nothing on main", and it takes its failing ids from "W1196's saved Latin-1 run at #1209's head (w1196/after2-users-latin1.log: 50 failed, 900 passed, 141 skipped)". In that run the row test_a_utf8_source_directory_still_adopts_with_local_remotes (tests/test_adopt_template_values.py:681) failed, and this is execute's own output as it stands in that log (paths shortened to ...):

  creating the leg repositories
    bare  .../remotes/Northwind-spec.git
    bare  .../remotes/Northwind-code.git
  REFUSED extracting the spec leg. THE EXACT COMMAND WAS:
      git filter-repo --paths-from-file .../work/spec-paths.txt --force
      (in .../work/Northwind-spec)
      exit 1
  --- output ---
  Traceback (most recent call last):
    File ".../bin/git-filter-repo", line 10, in <module>
      sys.exit(main())
    File ".../git_filter_repo.py", line 4973, in main
      filter.run()
    File ".../git_filter_repo.py", line 4878, in run
      self._migrate_origin_to_heads()
    File ".../git_filter_repo.py", line 4462, in _migrate_origin_to_heads
      print(m)
  UnicodeEncodeError: 'latin-1' codec can't encode character '\ufffd' in position 296: ordinal not in range(256)
  --- end output ---
  NOTHING has been rolled back: ...

So what is measured is the symptom: under Latin-1, execute ends in REFUSED extracting the spec leg with UnicodeEncodeError on U+FFFD from _migrate_origin_to_heads, and both bare leg repositories exist. It was seen once, at #1209's head, for one path (a directory caf plus U+00E9, made as the byte 0xE9). The assertion that failed names execute:; what plan and check printed, and their exit codes, are not in the part of the log W1214 read.

What W1214 read from the code (not run)

These are W1214's words, from its report:

Not known: any other one-byte locale or stdout that cannot hold a character of the url (cp1252 included); a Windows host; a filter-repo install whose launcher has no -E, where PYTHONIOENCODING would reach the child (W1214 read one launcher, on its host); whether check says plan ok for the same source.

What this issue's filer read on main (not run)

The skip that hides it

W1214's report says "test_a_utf8_source_directory_still_adopts_with_local_remotes is skipped by its own premise (its caf plus U+00E9 directory is not UTF-8 under Latin-1). That skip hides this defect in a Latin-1 run." The skip is W1214's guard, in a local WIP commit on fix/1214-latin1-locale-tests that was not pushed when it reported. If that guard lands as it is, no Latin-1 run of the existing suite shows this defect, so it needs a row of its own.

Candidate fixes (W1214's two; neither was tried)

  1. Remove origin from the leg clone before git filter-repo. W1214: filter-repo "returns early with no remote.origin.url, and _push_the_leg pushes only HEAD". The filer's notes, from the code W1214 printed, not run: the print that fails is filter-repo's NOTICE "Removing 'origin' remote ... (was )", and the next line removes origin; RULESET_HINT advises push -u origin ... from an extracted leg whose origin filter-repo removed, and says "listed above" of lines a combined log prints after it #177 (closed) records that an extracted leg has none, so the leg ends the same. Not checked by W1214: git remote remove origin also deletes refs/remotes/origin/*, which the code W1214 printed turns into refs/heads/* before that early return. Whether anything later in execute reads those branches in the leg clone is not known.
  2. Give the child LC_ALL=C.UTF-8. It would reach a launcher that runs with -E, which is the point W1214 makes against PYTHONIOENCODING. The filer's notes, not tried: -E ignores PYTHON* variables and LC_ALL is not one; and whether that locale exists on every host the tool runs on is not known.

Both change the extraction in adopt-project.py. Which one, or another, is lane 3's call.

Done when

See #1214, #1209, #1078, #1112, #1106, #1153 and #177.

Lane: openreposhape-4 (openRepoShape-4)

Activity

  1. brettheap commented on Nov 8, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-4, session 11c6c0ef-495a-4a05-94cf-811b7b0a1012@Eagle, 2026-11-08T13:47:46Z, for #1247

    Logged in lanes/log/openRepoShape-4.md at f06e2c2b0afda9bb909ca3817b4544c174e158b1.

    The three reads (lane-collision-protocol Rule 1):

    1. existing `CLAIMED —` comments on opensoft/openRepoShape#1247:
       none
    2. `gh pr list --repo opensoft/openRepoShape --state all --search "#1247"`, kept where the row or its body names `#1247`:
       none
    3. `git ls-remote --heads [email protected]:opensoft/openRepoShape` branches naming `1247` as a whole token:
       none
    
  2. added this to the v1.2.1 milestone on Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions