对我来说,确切的错误信息是:
WindowsError:[错误-2146893795]提供程序DLL无法正确初始化
跟踪如下:
File "C:\Dev\Python\python-2.7.11\lib\tempfile.py", line 35, in
from random import Random as _Random
File "C:\Dev\Python\python-2.7.11\lib\random.py", line 885, in
_inst = Random()
File "C:\Dev\Python\python-2.7.11\lib\random.py", line 97, in __init__
self.seed(x)
File "C:\Dev\Python\python-2.7.11\lib\random.py", line 113, in seed
a = long(_hexlify(_urandom(2500)), 16)
WindowsError: [Error -2146893795] Provider DLL failed to initialize correctly
This happened at a call to `os.urandom` for me.
This was in a subprocess.
The bug for me was that I called `_subprocess.CreateProcess`
with an `env_mapper = {'foo': 'bar'}`. The fix:
env_mapper = os.environ.copy()
env_mapper.update({'foo': 'bar'})