From 7bdc2424f2425ee4f562f217d5227a17fbab2ec2 Mon Sep 17 00:00:00 2001 From: yoni Date: Fri, 7 Aug 2026 21:40:39 +0000 Subject: [PATCH] fix(update): strip PyInstaller bootloader env vars before re-exec after self-update --- strix/interface/main.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/strix/interface/main.py b/strix/interface/main.py index ceb14c26..4da8f089 100644 --- a/strix/interface/main.py +++ b/strix/interface/main.py @@ -435,7 +435,16 @@ def main() -> None: start_background_check() if not args.non_interactive and prompt_update_if_available(Console()): if is_binary_install() and sys.platform != "win32": - os.execv(sys.executable, sys.argv) # noqa: S606 # nosec B606 + # The PyInstaller onefile bootloader passes its state to the child + # process via environment variables; if they leak into the re-exec, + # the new binary reuses the old extracted application instead of + # unpacking itself, so the pre-update version runs again. + env = { + key: value + for key, value in os.environ.items() + if not key.startswith("_PYI_") and key != "_MEIPASS2" + } + os.execve(sys.executable, sys.argv, env) # noqa: S606 # nosec B606 sys.exit(0) check_docker_installed()