Message283859
I spoke prematurely; I recently rediscovered that the persistence of __PYVENV_LAUNCHER__ poisons the sys.executable of virtualenv interpreters launched as a subprocess of another Python interpreter:
$ virtualenv -p python3 test
$ test/bin/python3 -c 'import sys; print(sys.executable)'
/Users/tim/test/bin/python3
$ /usr/local/bin/python3 -c 'import subprocess; subprocess.call(["/Users/tim/test/bin/python3", "-c", "import sys; print(sys.executable)"])'
/usr/local/bin/python3
$ /usr/local/bin/python3 -c 'import subprocess, os; del os.environ["__PYVENV_LAUNCHER__"]; subprocess.call(["/Users/tim/test/bin/python3", "-c", "import sys; print(sys.executable)"])'
/Users/tim/test/bin/python3
If __PYVENV_LAUNCHER__ can be unset before script execution begins, that seems ideal. |
|
Date |
User |
Action |
Args |
2016-12-22 20:00:39 | tdsmith | set | recipients:
+ tdsmith, vinay.sajip, ronaldoussoren, jaraco, ned.deily |
2016-12-22 20:00:38 | tdsmith | set | messageid: <1482436838.94.0.527377078187.issue22490@psf.upfronthosting.co.za> |
2016-12-22 20:00:38 | tdsmith | link | issue22490 messages |
2016-12-22 20:00:38 | tdsmith | create | |
|