ci(lint): fix broken-venv probe (AGENTS.md #12 stderr trap)
Lint / python (push) Failing after 11s
Lint / pssa (push) Successful in 24s

Native stderr from a broken python.exe shim ('No Python at ...') becomes a terminating exception under \Continue='Stop' BEFORE \0 can be read. Wrap the probe in try/catch + SilentlyContinue.
This commit is contained in:
2026-05-14 22:50:29 +02:00
parent 0c7c9272ee
commit 38898a3c21
+10
View File
@@ -87,11 +87,21 @@ jobs:
# does NOT have plain "python" in PATH, but py.exe is installed system-wide.
$venvPy = Join-Path $env:VENV_DIR 'Scripts\python.exe'
# Probe: a broken venv (pyvenv.cfg pointing to a deleted base interpreter)
# writes "No Python at ..." to stderr; under $ErrorActionPreference='Stop'
# native stderr becomes a terminating exception (AGENTS.md error #12),
# so probe with SilentlyContinue + try/catch.
$venvOk = $false
if (Test-Path $venvPy) {
try {
$prevEAP = $ErrorActionPreference
$ErrorActionPreference = 'SilentlyContinue'
& $venvPy --version 2>&1 | Out-Null
if ($LASTEXITCODE -eq 0) { $venvOk = $true }
}
catch { $venvOk = $false }
finally { $ErrorActionPreference = $prevEAP }
}
if (-not $venvOk) {
Write-Host "Venv missing or broken, (re)bootstrapping at $env:VENV_DIR"