Repository navigation
fix(doctor): fall through a python3 that cannot report its version - #201
Merged
cathrynlavery merged 3 commits intoSep 10, 2026
Merged
cathrynlavery merged 3 commits into
cathrynlavery merged 3 commits into
Conversation
Contributor
The process-launch exception path should be handled before merging because a newly reached fallback candidate can crash the doctor. Findings
|
The python3 fallback only survived an interpreter that exits non-zero. A name on PATH that cannot be spawned at all -- an App Execution Alias for an uninstalled app, a dangling symlink, a file without the exec bit -- raised out of run_command and ended the run with a traceback, on the very candidate the fallback exists to survive. Catch OSError in run_command and return it as a non-zero result. Every caller already asks only whether the command answered, so the probe loop falls through as it does for any other dud, and check_playwright, which is handed the command name even when the runtime check failed, warns instead of dying. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_018yueXNv7ew2s8sHhv43HG4
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.
Ran
/diagram-design:doctoron a stock Windows 11 machine and got a hard FAIL on a box that has a perfectly good Python 3.12.9 on it:Nothing is wrong with the machine.
pythonis real,python3isn't:Windows enables that App Execution Alias by default, and the python.org installer doesn't create a
python3.exe, so this is what a normal Windows install looks like rather than a broken one.The cause is in
probe_python_command()— it takes the first nameshutil.whichresolves and stops there:Sitting on PATH isn't evidence of being an interpreter.
references/doctor.mdalready says "Resolvepython3first, thenpython", which reads like a fallback — it just isn't implemented, sopythonnever gets a turn.It leaks into the next check too. On that failure
check_python_runtimestill hands back"python3", socheck_playwrightgoes on to probe the same stub and reports Playwright as missing whether it's installed or not.What this changes
PythonProbeinstead of a bare tuple, which is what letscheck_python_runtimereuse the version it already asked for instead of shelling out a second time.references/doctor.mdso the contract and the code say the same thing.Tests
Three cases in
scripts/test-verify-doctor.py: apython3that can't report its version, nothing runnable at all, and an empty PATH. They stubshutil.whichandrun_command, so they don't depend on what the runner happens to have installed. Against the current code the first one fails with the exact symptom above:Probably worth saying why CI didn't catch this: the Windows leg does run, but
setup-pythonputs a workingpython3on PATH, so the runner never looks like an ordinary Windows desktop.Verified
Full CONTRIBUTING gate list passes on Windows / Python 3.12. I couldn't run
lint-render.py, the README thumbnails orclaude plugin validatelocally (Playwright, Pillow, npx) — none of them touch this path.Doctor on the same machine, after the change:
No manifest versions touched.
#190 also touches
verify-doctor.py, but not this function, so the two should sit fine next to each other.