Skip to content

fix(launcher): remove hard-coded Python 3.13 path - #3

Open
s-qin wants to merge 1 commit into
Divisionless:mainfrom
s-qin:fix/windows-python-launcher
Open

fix(launcher): remove hard-coded Python 3.13 path#3
s-qin wants to merge 1 commit into
Divisionless:mainfrom
s-qin:fix/windows-python-launcher

Conversation

@s-qin

@s-qin s-qin commented Sep 7, 2026

Copy link
Copy Markdown

fix(launcher): remove hard-coded Python 3.13 path

Problem

OpenSpan.bat hard-coded a fallback interpreter: C:\Python313\openspanw.exe (a renamed pythonw.exe copy). On machines with any other Python install (here: Python 3.14.3 with Tk 8.6), that file does not exist and the launcher dies with a raw missing-file path error — so after OpenSpan.exe is absent, OpenSpan cannot be started again.

Reproduction evidence:

old : start "" "C:\Python313\openspanw.exe" "%~dp0win\openspan.py"
     -> file not found
verified environment : Python 3.14.3, Tk 8.6 (pyw.exe Python Launcher)
after: OpenSpan.bat -> dynamically resolved pythonw.exe -> win\openspan.py -> GUI launched

Fix

OpenSpan.bat now resolves the interpreter dynamically — nothing version- or username-bound:

  1. OpenSpan.exe next to the script is still preferred, always.
  2. Otherwise the first usable GUI interpreter is picked, in this order:
    a. pyw.exe — Windows Python Launcher, console-less
    b. pythonw.exe on PATH
    c. python.exe on PATH (WindowsApps Store stub skipped)
    d. newest registered PythonCore install (pythonw preferred)
  3. Every candidate is validated with import tkinter; a broken candidate is skipped, never trusted.
  4. Clear errors via MessageBox: "no Python found" vs "Python found but tkinter missing" — never a raw missing-interpreter path error.
  5. No renamed binaries, no requiring PATH edits, no hardcoded install dirs; quoting is safe for spaces.

Docs updated for the same change (minimal): BUILD.md (build command example is now version-agnostic: py -3 build_exe.py), build_exe.py docstring example, TECHNICAL_NOTES.md launch section.

Validation

Manually tested on real hardware (OpenSpan.exe absent):

  • OpenSpan.bat starts the GUI successfully
  • dynamically resolves the current pythonw.exe (Python 3.14.3 / Tk 8.6)
  • no Python-3.13 dependency
  • GUI appears and is functional

No CI pipeline configured in this repository (no .github/workflows); static checks passed (python -m py_compile, git diff --check).

@s-qin
s-qin force-pushed the fix/windows-python-launcher branch from e4e749d to 609d996 Compare September 7, 2026 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant