Message245700
Trying to call a 32bit Python via subprocess from a 64bit one works as expected:
Python 3.4.2 (v3.4.2:ab2c023a9432, Oct 6 2014, 22:16:31) [MSC v.1600 64 bit (AMD64)] on win32
[...]
>>> subprocess.check_call([r'C:\Python34_x32\python.exe', '-c', 'print("Hello World")'])
Hello World
However, when passing the `env` parameter, even just as `env=os.environ`, things break:
>>> subprocess.check_call([r'C:\Python34_x32\python.exe', '-c', 'print("Hello World")'], env=os.environ)
Fatal Python error: Failed to initialize Windows random API (CryptoGen)
Starting a 64bit Python from the 64bit one works fine:
>>> subprocess.check_call([r'C:\Python34\python.exe', '-c', 'print("Hello World")'], env=os.environ)
Hello World
According to issue20614 the "Fatal Python error" happens when SYSTEMROOT is not set, but that's definitely set in the original environment.
Looking at the code, it just passes env to Windows' CreateProcess[1] - I guess this does *something* different in this scenario when None/NULL is given as compared to the os.environ dict?
This breaks virtualenv with --python for me:
C:\Users\florian\tmp>C:\Python34\python.exe -m virtualenv --python=C:\Python34_x32\python.exe venv3
Running virtualenv with interpreter C:\Python34_x32\python.exe
Fatal Python error: Failed to initialize Windows random API (CryptoGen)
[1] https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx |
|
Date |
User |
Action |
Args |
2015-06-23 20:37:07 | The Compiler | set | recipients:
+ The Compiler, paul.moore, astrand, tim.golden, zach.ware, steve.dower |
2015-06-23 20:37:07 | The Compiler | set | messageid: <1435091827.68.0.4316449172.issue24493@psf.upfronthosting.co.za> |
2015-06-23 20:37:07 | The Compiler | link | issue24493 messages |
2015-06-23 20:37:07 | The Compiler | create | |
|