fix(i18n): clear _PYI_APPLICATION_HOME_DIR (correct env var for PyI 6.x)#50
Merged
Conversation
Follow-up to #49. PyInstaller 6.x renamed the temp-extraction handoff env var from _MEIPASS2 to _PYI_APPLICATION_HOME_DIR. Verified by extracting strings from the runw.exe bootloader shipped with PyInstaller 6.19. Clearing only _MEIPASS2 had no effect on modern builds, so the language-change relaunch crash could still surface. Clear both names (legacy + current) so the fix works regardless of the PyInstaller version we ship with. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
nelsonduarte
added a commit
that referenced
this pull request
May 10, 2026
…unch (#57) PR #50 cleared _PYI_APPLICATION_HOME_DIR but left _PYI_PARENT_PROCESS_LEVEL and _PYI_ARCHIVE_FILE inherited. The child bootloader sees _PYI_PARENT_PROCESS_LEVEL=1 from the parent, concludes it is a phase-2 (child-phase) launch, then tries to read _PYI_APPLICATION_HOME_DIR — which we cleared — and aborts with _PYI_APPLICATION_HOME_DIR environment variable is not defined! Switch to a pattern-based clear that removes anything matching _PYI_* or _MEIPASS*, so the relaunched process truly starts fresh and is robust against future PyInstaller versions adding new internal vars. Verified locally with a build + smoke test + relaunch simulation. Bumps APP_VERSION to 1.13.11. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Follow-up to #49. PyInstaller 6.x renamed the env var that drives the temp-extraction handoff between parent and child from `_MEIPASS2` to `_PYI_APPLICATION_HOME_DIR`. The original PR cleared only the legacy name, which has no effect on the build we actually ship (PyInstaller 6.19).
Evidence
```
$ strings venv/Lib/site-packages/PyInstaller/bootloader/Windows-64bit-intel/runw.exe
| grep -i 'meipass|pyi_application'
_PYI_APPLICATION_HOME_DIR
_PYI_APPLICATION_HOME_DIR environment variable is not defined!
Failed to get _MEIPASS as PyObject.
_MEIPASS
```
No reference to `_MEIPASS2` in the modern bootloader. `_MEIPASS` is read inside Python (sys._MEIPASS) but isn't the inter-process handoff variable.
Fix
Clear both env var names before `startDetached()`:
So the fix works regardless of which PyInstaller version we ship with.
Why ship inside v1.13.10 (not bump again)
Tag `v1.13.10` has not been pushed yet — main is still in the pre-release window. No need to bump version twice.
Test plan
🤖 Generated with Claude Code