fix(xurl): treat PermissionError from PATH lookup as unavailable (#322)

is_available() only caught FileNotFoundError and TimeoutExpired. On WSL,
a /mnt/c/.../WindowsApps entry on $PATH returns EACCES during exec, and
Python raises PermissionError. That escaped is_available() and crashed
pipeline.diagnose() before any source ran.

Catch OSError instead. It covers FileNotFoundError, PermissionError, and
any other spawn-time OS error, so a non-executable xurl on PATH falls
through to the next backend instead of aborting the run.
This commit is contained in:
Ilia Alshanetsky
2026-04-26 17:16:14 -04:00
committed by GitHub
parent bbf892aecc
commit 5b87cca886
2 changed files with 11 additions and 3 deletions
+4 -3
View File
@@ -46,9 +46,10 @@ def is_available() -> bool:
timeout=10,
)
return result.returncode == 0 and '"username"' in result.stdout
except FileNotFoundError:
return False
except subprocess.TimeoutExpired:
except (OSError, subprocess.TimeoutExpired):
# OSError covers FileNotFoundError (no xurl on PATH) and
# PermissionError (a non-executable match on PATH, e.g. WSL's
# /mnt/c/.../WindowsApps shim returning EACCES on exec).
return False