mirror of
https://github.com/usestrix/strix.git
synced 2026-09-06 08:15:56 +00:00
fix(update): strip PyInstaller bootloader env vars before re-exec after self-update
This commit is contained in:
parent
a22c686626
commit
7bdc2424f2
1 changed files with 10 additions and 1 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue