Repository navigation
Conversation
This was referenced Aug 14, 2026
5 of 6 tasks
CanReader
approved these changes
Oct 7, 2026
CanReader
left a comment
There was a problem hiding this comment.
Ran the new test: 24 passed on this branch, and with main's sg-python.sh 4 fail (the "probe errors:" ones), so it catches the bug. Also tried it by hand with no python on PATH, now I get the errors for python3, python and py instead of the generic message. With no mktemp it falls back to the old output without crashing, and the temp file is gone after success, failure and a SIGTERM.
Small things, all optional:
- If
errlogdefaults to/dev/nullwhenmktempfails,probecan always use2>>"$errlog"and you don't need the two branches with the same python line. errlog=""before themktempline isn't needed, it's already empty when mktemp fails.- For a missing interpreter the output now includes bash's own message with the shim's line number (
sg-python.sh: line 38: python3: command not found). Still useful, just a bit noisy. - Nothing in CI runs
plugins/security-guidance/tests/right now, so it only helps when someone runs it by hand.
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.
What this does
Fixes #86709 by preserving stderr from Python interpreter probes and reporting the diagnostics when all candidate interpreters fail.
Previously,
sg-python.shredirected probe stderr to/dev/null. Whenpython3,python, andpy -3all failed, users only saw the generic "no working Python 3 interpreter found" message, which made failures such as broken pyenv shims, Microsoft Store stubs, or transient process errors difficult to diagnose.Changes
Test plan
python3andpythonshims and verified their stderr is now included in the final error.python3candidate can still fall through to a workingpythoncandidate without exposing the failed probe's stderr.py -3fallback remains functional.bash -n.Fixes #86709