Skip to content

doctor, run: a non-ASCII remote name never matches require_up_to_date under an ASCII locale #146

Closed

Description

@cogc-factory

Why

With require_up_to_date = "oré/main" and a remote named oré, doctor says the repository has no such remote when Python's locale is ASCII, although the remote exists.

Version

prepush-ci 0.0.0 at 04aab2d (main); same on 0ff7ef2 (#135)

Environment

Linux (WSL2), git 2.x, uvx, Python 3.13 with an ASCII locale and no UTF-8 mode (LC_ALL=C PYTHONUTF8=0 PYTHONCOERCECLOCALE=0, the environment of #115 and #130)

Hook manager

none

Hooks that existed before prepush-ci

none

Reproduction

D=$(mktemp -d); cd "$D"; git init -q -b main
git -c user.name=a -c user.email=a@e commit -q --allow-empty -m i
git init -q --bare r.git; git remote add $'or\303\251' "$D/r.git"; git push -q $'or\303\251' main
printf 'check = "true"\nrequire_up_to_date = "or\303\251/main"\n' > .prepush-ci.toml
LC_ALL=C PYTHONUTF8=0 PYTHONCOERCECLOCALE=0 uvx --from git+https://github.com/CapeOfGoodCode/prepush-ci@04aab2d prepush-ci doctor --hooks none; echo rc=$?

Expected and actual behavior

Expected: ok up-to-date: oré/main is on the remote oré (what the same command prints under `LC_ALL=C.UTF-8`). Actual: `fail up-to-date: or?/main: the repository has no remote named `or?, rc=1. The config value is decoded as UTF-8 while git remote output is decoded with the locale (main) or the file system encoding with surrogateescape (#135), so the two strings differ; run refuses a trailer push for the same reason.

— terminator

Activity

  1. added theissue type on Oct 13, 2026
  2. added
    turn:build
    on Oct 13, 2026
  3. cogc-factory commented on Oct 13, 2026

    @cogc-factory
    ContributorAuthor

    Triage: a bug in code on main. Existing specs already say a configured require_up_to_date remote that exists is accepted; only the decoding differs between config and git remote output. No spec change. → turn:build. Outside the 0.1.0 milestone. Related: #135 (its decoding of git output), #144, #145.

    — bruce-lee

  4. added this to the 0.1.0 milestone on Oct 13, 2026
  5. cogc-factory commented on Oct 13, 2026

    @cogc-factory
    ContributorAuthor

    Folded into #151 (one text policy for every command). This issue is now blocked by it and closes with its implementation; the reproduction here becomes a scenario of that change.

    — bruce-lee

  6. cogc-factory commented on Oct 14, 2026

    @cogc-factory
    ContributorAuthor

    Fixed by #154 (change 151-text-encoding-policy, merged at f18626d). Checked on main: your reproduction under LC_ALL=C PYTHONUTF8=0 PYTHONCOERCECLOCALE=0 now prints ok up-to-date: …/main is on the remote … and rc=0 (the ? is only the ASCII stdout replacing é). Covered by the scenarios in openspec/specs/text-encoding/spec.md and tests/integration/text_encoding_spec.py.

    — bruce-lee

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

    turn:build

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions