Build.bat/Mods.bat: quote per-user Python paths, sync lookup, and add no-pause guard #2342
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2342"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by kirigayakazima on 2026-11-26T14:12:19Z.
Claimed in the coordination issue as: WIN-LAUNCHERS-BUILD-MODS-BAT-QUOTING-USER-PYTHON-AND-NO-PAUSE (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7194337029)
What and why
Build.batandMods.batby splittingPYinto quotedPY_EXEandPY_ARG(set "PY_EXE=%~1", invoking"%PY_EXE%" %PY_ARG% -I ...) and quoting"%~1"in:try_pythonso per-user install paths containing spaces or&work without unquoted syntax errors.:find_user_pythonand:try_pythontoMods.bat(matchingBuild.bat) so per-user Python installs under%LOCALAPPDATA%\Programs\Python\Python3*work in the mod manager launcher as well.pausecalls in bothBuild.batandMods.batwithif not defined LEONIDA_NO_PAUSE pause, and addPYTMPfallbacks (%TEMP%->%LOCALAPPDATA%\Temp->%~dp0) inBuild.bat's:py_download.tests/test_win_launchers.py.Tested
python -I tests/test_win_launchers.py -v: 2 passed, 0 failed (detachedupstream/mainbaseline with only the new test file fails with 2 failures).python -I tests/test_ci_registration.py: 16 passed.python -I tests/test_text_write_line_endings.py: 3 passed.python -I scripts/check_no_game_data.py,python -I -m compileall -q tests/test_win_launchers.py, andgit diff --cached --check: passed.GPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-11-26T15:40:31Z.
Review: COMMENTED
Windows 11: both launcher tests passed, including native cmd.exe and PowerShell tests with a disposable per-user Python path containing spaces and an ampersand,
LEONIDA_NO_PAUSE, and exact exit-code propagation. No findings.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T12:57:28Z.
#2342 | head
6f015d8345(merged cleanly with maind48a957bb) |python -I tests/test_win_launchers.py| red on main:FAILED (failures=2)(Build.batunquoted%1broke per-user Python paths containing&,Mods.batlacked:find_user_python, and neither launcher supportedLEONIDA_NO_PAUSE) | green on PR+main:2 tests OK| Windows 11 (10.0.26200.9974,cmd.exe+powershell.exe5.1.26100.9818), Python 3.12.10 | AI-assisted: yesAudited
Build.bat,Mods.bat, andtests/test_win_launchers.pyon Windows 11 (cmd.exe+powershell.exeAdd-TypeC# stubpython.exe), verifying splitPY_EXE/PY_ARGquoting ("%PY_EXE%" %PY_ARG% -I ...),:find_user_pythonper-user Python discovery under paths containing&(user & test\Programs\Python\Python313\python.exe),PYTMPfallback when%TEMP%is unset,LEONIDA_NO_PAUSEnon-interactive exit without blocking onpause, and exact exit-code propagation (0,5,1). Also verifiedtests/test_ci_registration.py(18 OK),tests/test_text_write_line_endings.py(3 OK), andscripts/check_no_game_data.py.Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-29T00:59:21Z.
Merged, thank you! Its own tests failed on main without the change and passed with it, and a batch test with eight other tool PRs (main's Python suite plus a game run on an RTX 5080) showed no regression.
AI-assisted (Claude Code, Claude Opus 5.5), on behalf of DadaCap.