Update installer.py not to destroy the original PYTHONPATH for installer subprocesses

When invoking the extension installer subprocess, the code used to simply overwrite the PYTHONPATH env var, which could potentially mess with the python runtime in some environments, basically breaking the extension installation step. 

Changing this behavior to simply "add" the current working directory to the path and not destroy its other entries already there, would solve the problem and allows the whole application run just fine.
This commit is contained in:
Mehran Ahadi
2025-04-18 11:38:53 -04:00
committed by GitHub
parent c6da185061
commit 9e89e29b00
+1 -1
View File
@@ -976,7 +976,7 @@ def run_extension_installer(folder):
try:
log.debug(f"Extension installer: {path_installer}")
env = os.environ.copy()
env['PYTHONPATH'] = os.path.abspath(".")
env['PYTHONPATH'] = os.path.abspath(".") + ";" + env['PYTHONPATH']
result = subprocess.run(f'"{sys.executable}" "{path_installer}"', shell=True, env=env, check=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=folder)
txt = result.stdout.decode(encoding="utf8", errors="ignore")
debug(f'Extension installer: file="{path_installer}" {txt}')