You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
repo_gate.py Decodes ls-files stderr Strictly, So a Non-UTF-8 Root Path Crashes It #1872
tracked() in .github/actions/repo-gate/repo_gate.py decodes the git ls-files call's stderr strictly as UTF-8. When git's error message echoes a path that is not valid UTF-8, the decode raises UnicodeDecodeError. That is a ValueError, so nothing catches it, and the gate ends in a traceback instead of main returning 2.
Evidence
Constructed case: pass --root a directory that does not exist and whose name contains the byte 0xff. Git's "cannot change to" message quotes the name raw on stderr, and the strict decode of that stderr raises.
The same line is on develop, so this change did not introduce it. A local review pass found it on the branch that pins and decodes the stdout side for #1580.
Suggested fix
Decode that call's output with errors="surrogateescape", matching sh() and resolved_eol.
Activity
Pin and Decode Git's Quoting in repo_gate.py's ls-files Read (#1873)