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
run_reach raises UnicodeEncodeError for a checkout whose directory name has a non-UTF-8 byte #754
run_reach in dokimi/dokimi/repos/reach.py:527 derives its default salt with hashlib.sha256(f"{tree.label}\0{datetime.now(timezone.utc).isoformat()}".encode()). WorkTree.label is str(self.root) (repos/source.py:122), and a git tree's label starts with the source location, so a checkout whose directory name holds a non-UTF-8 byte (a surrogate-escaped path from argv) raises when no --salt is given. Repro: WorkTree over a directory named d\xff holding the toy repo of tests/test_repo_reach.py, then run_reach(tree=tree, manifest=load_manifest(tree, 'evals/repo-eval.yaml'), profile=..., model='m', out_dir=..., work_dir=..., dry_run=True) gives UnicodeEncodeError: 'utf-8' codec can't encode character '\udcff' in position N: surrogates not allowed at reach.py:527. Fix: os.fsencode(f"..."), which keeps the salt of a UTF-8 label unchanged on POSIX (the label is a path or a source location, so n\ud800 cannot occur). Same class as #715, which fixes token in the same file.
Activity