fix(tools): tolerate an untraversable HOME when probing ~/.local/bin

CI runs the suite as an unprivileged user with HOME=/root in one fixture;
Path.is_dir() raised PermissionError from _user_local_bin_entries and the
run-env builder crashed. An unreadable home has no usable ~/.local/bin, so
treat the OSError as absent.
This commit is contained in:
teknium1
2026-09-15 13:41:02 -07:00
committed by Teknium
parent 43e7e830fd
commit be67e1d31e
+7 -1
View File
@@ -558,7 +558,13 @@ def _user_local_bin_entries() -> list[str]:
launcher inherits a PATH without it (only the login shell adds it), so CLIs
installed there were ``command not found`` from the terminal tool (#111778)."""
local_bin = Path.home() / ".local" / "bin"
return [str(local_bin)] if local_bin.is_dir() else []
try:
return [str(local_bin)] if local_bin.is_dir() else []
except OSError:
# HOME can point at a directory this process may not traverse (CI runs
# with HOME=/root as an unprivileged user); such a home has no usable
# ~/.local/bin either.
return []
def _append_missing_sane_path_entries(existing_path: str) -> str: