Fix install.ps1 Python probe crash on PowerShell 5.1#14
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hotfix for the public install one-liner, broken by the probe added in #13 (reported by Kevin running
irm .../install.ps1 | iex):Two PowerShell 5.1 behaviors combined: an empty-string argument is dropped when calling a native executable (so
python -c ""became a barepython -c), and with$ErrorActionPreference = "Stop"the2>$nullredirect promoted Python's stderr complaint to a terminatingNativeCommandError, aborting the whole install.The probe now runs
--version, tolerates stderr during the probe (preference lowered for the probe only and restored infinally), and accepts a candidate solely on exit code 0. Verified on this machine against the real Microsoft Storepython3stub: stub rejected,C:\Python313\python.exeselected, no terminating error underStop.Also bumps to 0.2.1 with a CHANGELOG entry.
🤖 Generated with Claude Code