Skip to content

Fix install.ps1 Python probe crash on PowerShell 5.1#14

Merged
ksimback merged 1 commit into
mainfrom
fix/install-ps1-python-probe
Jul 5, 2026
Merged

Fix install.ps1 Python probe crash on PowerShell 5.1#14
ksimback merged 1 commit into
mainfrom
fix/install-ps1-python-probe

Conversation

@ksimback

@ksimback ksimback commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Hotfix for the public install one-liner, broken by the probe added in #13 (reported by Kevin running irm .../install.ps1 | iex):

python.exe : Argument expected for the -c option

Two PowerShell 5.1 behaviors combined: an empty-string argument is dropped when calling a native executable (so python -c "" became a bare python -c), and with $ErrorActionPreference = "Stop" the 2>$null redirect promoted Python's stderr complaint to a terminating NativeCommandError, aborting the whole install.

The probe now runs --version, tolerates stderr during the probe (preference lowered for the probe only and restored in finally), and accepts a candidate solely on exit code 0. Verified on this machine against the real Microsoft Store python3 stub: stub rejected, C:\Python313\python.exe selected, no terminating error under Stop.

Also bumps to 0.2.1 with a CHANGELOG entry.

🤖 Generated with Claude Code

The v0.2.0 probe ran '& python -c "" 2>$null'. PowerShell 5.1 drops
an empty-string argument to native executables, so Python saw a bare
-c and errored; that stderr line, redirected under the script's
ErrorActionPreference = Stop, became a terminating NativeCommandError
and aborted the install.

Probe with --version instead, tolerate stderr while probing (EAP
lowered for the probe only, restored after), and validate via exit
code. Verified against the real Microsoft Store python3 stub: stub
rejected, real interpreter selected, no terminating error under Stop.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ksimback ksimback merged commit 5e206cc into main Jul 5, 2026
9 checks passed
@ksimback ksimback deleted the fix/install-ps1-python-probe branch July 5, 2026 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant