Tags: linkedin/shiv
Tags
Fix python-version-specific paths in PYTHONPATH When SHIV_EXTED_PYTHONPATH is used, PYTHONPATH env variable gets not only zipapp sit-packages and other new stuff, but also the default sys.path of the current Python (for ex. Python3.10). This breaks ability to run a different version of Python in a subprocess, because PYTHONPATH takes precedence over default sys.path, and so a subprocess starting Python3.9 will attempt to use Python 3.10 builtin modules, and will most likely break in unpredictable ways. This change fixes that by only adding new paths which appear after injecting zipapp site-packages.
PreviousNext