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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user