Skip to content

family-root siblings.py: make siblings, park and resume print the family's name with a plain print, so name: "a\ud83db" ends each in a UnicodeEncodeError, and the literal dash ends every name under PYTHONIOENCODING=ascii #454

Closed

Description

@brettheap

Lane: openreposhape-5 (openRepoShape-5)

(lane openRepoShape-5, 2026-10-12T19:25:03Z)

Found by lane 5's review of fix/bootstrap-print-name-escaped (the branch for #391), its F1, and reproduced on origin/main 53bee5b. Not claimed. It is #391's bug in the next script over: #391 gives both roots' bootstrap.py an escape and a stdout guard, and siblings.py (the family holder's make siblings, make park and make resume) prints the same first line with the same plain print.

What is wrong. templates/family-root/scripts/siblings.py opens each of its two reports with

print(f"siblings: {name} ({root}) — {len(rows)} member(s)")

at _run_placement (:906, make siblings) and dispatch_all (:676, --make <target>, which make park and make resume call), before anything else is said. name is family.yaml's name: as the reader gives it, so:

  • name: "a\ud83db" reads as a string holding a lone surrogate, which no UTF-8 stdout can write. The run ends in a UnicodeEncodeError traceback. validate-family.py names the value only as FINDING naming-unclassified (exit 1), so the person who runs make siblings first is told nothing useful, and make park, which exists to save work, ends before it parks anything.
  • The line holds a literal —, so on a stdout that cannot hold it (PYTHONIOENCODING=ascii, or the ANSI code page Windows gives a stdout that is not the console) it raises for EVERY name, InkRouter included.
  • A raw ESC or CR in a name is encodable everywhere and reaches the terminal as the control it is.

The member rows are the same class ([{project}], a member's path, url and branch, sibling.row(), the make target: :397, :401, :449, :451, :476, :478, :486, :621, :645, :695, :850, :864, :866), printed raw. Only the first line is reproduced below: a member row needs a member.

SHAPE=<checkout of origin/main>
STUB=$(mktemp -d); printf '#!/bin/sh\nexit 97\n' > "$STUB/gh"; chmod +x "$STUB/gh"
export PATH="$STUB:$PATH" GH_TOKEN=bogus GH_CONFIG_DIR=$(mktemp -d)
export GIT_AUTHOR_NAME=T [email protected] GIT_COMMITTER_NAME=T [email protected]
D=$(mktemp -d)
python3 "$SHAPE/scripts/family.py" init --org InkRouter --family InkRouter \
    --created-by 'Test Human' --created-on 2026-09-04 \
    --local-remote-dir "$D/remotes" --work-dir "$D/work" > /dev/null
cd "$D/work/InkRouter" || exit 1
python3 scripts/siblings.py --dry-run > /dev/null 2>&1; echo "control exit $?"
sed -i 's/^name: .*/name: "a\\ud83db"/' family.yaml
python3 scripts/siblings.py --dry-run > /dev/null 2> "$D/e1"; echo "exit $?"; tail -n 3 "$D/e1"
make siblings > /dev/null 2> "$D/e2"; echo "make siblings exit $?"
python3 scripts/siblings.py --make park --dry-run > /dev/null 2> "$D/e3"; echo "exit $?"; tail -n 3 "$D/e3"
make park > /dev/null 2>&1; echo "make park exit $?"; make resume > /dev/null 2>&1; echo "make resume exit $?"
sed -i 's/^name: .*/name: "InkRouter"/' family.yaml
PYTHONIOENCODING=ascii python3 scripts/siblings.py --dry-run > /dev/null 2> "$D/e4"; echo "exit $?"; tail -n 2 "$D/e4"

Observed on origin/main 53bee5b, Python 3.12.3:

run result
name: "InkRouter", siblings.py --dry-run (control) exit 0, siblings: InkRouter (<root>) — 0 member(s)
name: "a\ud83db", siblings.py --dry-run exit 1, File ".../scripts/siblings.py", line 906, in _run_placement, UnicodeEncodeError: 'utf-8' codec can't encode character '\ud83d' in position 11: surrogates not allowed
the same, make siblings exit 2, the same traceback, make: *** [Makefile:49: siblings] Error 1
the same, siblings.py --make park --dry-run exit 1, line 676, in dispatch_all, the same error
the same, make park / make resume exit 2 each (Makefile:59, Makefile:62), the same error
name: "InkRouter", PYTHONIOENCODING=ascii, siblings.py --dry-run exit 1, line 906, in _run_placement, UnicodeEncodeError: 'ascii' codec can't encode character '\u2014' (the position depends on the root's path)
name: "a\ud83db", family scripts/bootstrap.py --no-fetch --skip-members exit 1, the same error from its own first line (that one is #391)

What it should do. The same two functions #391 gives bootstrap.py: escape_unencodable_stdout() as the first statement of main, and spelled(value) around every value a line prints that came from the manifest, a member row or the disk (the name and the root first, then the member rows). siblings.py already imports from bootstrap (REWRITE_TARGETS, credential, member_path, members_of, at :129), so both are one import away once #391 lands; until then they are the two functions in that PR. The member's own make command is still handed the RAW target, as #391 does for --members-make. What stays out of spelled is the file's own wording: the literal dash is for escape_unencodable_stdout to cover, which is why #391 needs both.

How to test. A holder from family.py init into local bare remotes (the holder fixture in tests/test_bootstrap_spelling.py once #391 lands, or its own). Edit family.yaml's name: and run scripts/siblings.py --dry-run and --make park --dry-run under the stdouts #391's rows use (utf-8:strict, utf-8:surrogateescape, cp1252:surrogateescape, cp1252:strict, ascii:strict), answered in bytes and decoded strictly in the encoding the run was given:

  • a plain name: byte-identical to origin/main under utf-8:strict;
  • a lone surrogate, ESC and CR, 日本, a Persian name with its ZWNJ (raw, as on main): exit 0, no Traceback, the first line spelled;
  • a member row holding an ESC or a U+2028 in a project name or path, with a member that is not checked out.

Not in this issue.

Related: #391, #214.

Activity

  1. added this to the v1.1.0 milestone on Oct 15, 2026
  2. brettheap commented on Oct 15, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-4, session 11c6c0ef-495a-4a05-94cf-811b7b0a1012@Eagle, 2026-10-15T23:04:56Z, for #454

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

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

    1. existing `CLAIMED —` comments on opensoft/openRepoShape#454:
       none
    2. `gh pr list --repo opensoft/openRepoShape --state all --search "#454"`, kept where the row or its body names `#454`:
    456	Both roots' scripts/bootstrap.py: `main` escapes what stdout cannot encode and spells each value it prints, so `name: "a\\ud83db"` or `日本` under `PYTHONIOENCODING=ascii` no longer ends `make bootstrap` in a traceback (#391)	fix/bootstrap-print-name-escaped	MERGED
    473	docs/release-notes/v1.0.0.md: the v1.0.0 release notes, a draft for Brett to amend before he tags, saying what 1.0 contains and promises, how to pin it by commit, what changed on the way grouped by the five tracking areas, and every known limit as the input that triggers it and what the person sees (#472)	docs/v1.0.0-release-notes	MERGED
    3. `git ls-remote --heads [email protected]:opensoft/openRepoShape` branches naming `454` as a whole token:
       none
    
  3. added a commit that references this issue on Oct 16, 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