From be67e1d31ec24babf8c17cc1d75da9b0c1b6dbf5 Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Tue, 15 Sep 2026 13:41:02 -0700 Subject: [PATCH] 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. --- tools/environments/local.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/environments/local.py b/tools/environments/local.py index 0f60e46a18..d38c636167 100644 --- a/tools/environments/local.py +++ b/tools/environments/local.py @@ -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: