Repository navigation
Build.bat: start make_game.py by the interpreter's full path - #7616
Daniromavi wants to merge 1 commit into
Conversation
The Python install manager's `py` is an app execution alias in WindowsApps, like its `python`. A Python started through either alias, and every program it starts, does not see folders that other programs create under %LOCALAPPDATA% or %APPDATA% (ItsNotRexed#1233 measured `python` only). So Build.bat's `py -3.x` had the problem too, and the appdata_hint advice to start make_game.py with `py` did not help. Build.bat now resolves PY to sys.executable before it starts make_game.py, printed in the console code page so that for /f reads a non-ASCII path back intact; when nothing usable comes back, PY stays as it was. The hint names that full path, and docs/design.md says which launchers see the folder. Measured on Windows 11 26200, Python 3.14.4, PythonManager 26.4.240.0: Build.bat with a stand-in make_game.py that checks a new %LOCALAPPDATA% folder: main False, this change True.
|
Windows check + review. Read the diff and ran it locally; not a code-read-only review. Environment: Windows 11, CPython 3.13.1, PR head
The block itself behaves as intended for a quoted full path, a quoted launcher and a bare One problem: The cause is the product doing the right thing: Suggestion: build the venv folder name from the console code page instead of hard-coding Related and worth one sentence in the block comment or |
|
Tested 68cdfa4 on Windows 11, Python 3.15.2, NVIDIA RTX 4060 Ti (driver 621.24; CPU-only checks, no game files, no GPU/llvm-mc/MSVC used): pass. Ran the test files this PR adds or changes, from a clean checkout of the PR head: AI-assisted (Claude Code). |
Claim: #7496 (comment)
What changed and why
On a PC with only the Python install manager (python.org's default Windows installer since 3.14),
pyis an app execution alias inWindowsApps, likepython. A Python started through either alias, and every program that Python starts, does not see folders that other programs create under%LOCALAPPDATA%or%APPDATA%. #1233 measured this forpythonand foundpyfine there; with the install manager's ownpy,Build.bat'spy -3.xhits it too, and theappdata_hintadvice "start make_game.py withpy" does not help.Build.bat: a new:resolve_python, called beforemake_game.pystarts, asks the interpreter forsys.executableand uses that full path asPY. The path is printed in the console's code page so thatfor /freads a non-ASCII one back intact; when nothing usable comes back,PYstays as it was.make_game.py:appdata_hintnames this interpreter's full path instead ofpy.docs/design.md: the AppData note says which launchers see the folder.Measured
Windows 11 26200, Python 3.14.4, PythonManager 26.4.240.0, a folder created under
%LOCALAPPDATA%by another process:python(WindowsApps alias)py(WindowsApps alias)pythoncore-3.14-64\python.exeby its full pathsys.executablestarted by an alias-started PythonBuild.batitself, with a stand-inmake_game.pythat checks such a folder:mainFalse, this branch True.Tests
tests/test_build_bat_python.py(Windows only, cmd.exe) runs:resolve_pythonas written, with launchers standing in for the aliases: a quoted launcher path, a bare command with an argument (aspy -3.14), the full path left as is, a non-ASCII venv path (this case fails if the code-page step is removed), and no or a nonexistent path keepsPY.tests/test_make_game_preflight.py: the hint namessys.executable, notpy(96 tests OK).mainat 86a7807, all pre-existing and unrelated; none new.compileallandscripts/check_no_game_data.pyare clean. No GPU or game files needed.AI-assisted.