Am 23.11.2010 11:55, schrieb Amaury Forgeot d'Arc:
> Hi,
> 
> 2010/11/23 Glenn Linderman <v+pyt...@g.nevcal.com>:
>>   File "C:\Python32\lib\random.py", line 108, in seed
>>     a = int.from_bytes(_urandom(32), 'big')
>> WindowsError: [Error -2146893818] Invalid Signature
> 
> In the subprocess documentation http://docs.python.org/library/subprocess.html
> """On Windows, in order to run a side-by-side assembly the specified
> env *must* include a valid SystemRoot."""

Indeed, setting SystemRoot might solve this problem. According to

http://jpassing.com/2009/12/28/the-hidden-danger-of-forgetting-to-specify-systemroot-in-a-custom-environment-block/

CrypoAPI, in Windows 7, requires this variable be set. Failure to
find the enhanced crypto provider would explain why the "random"
module of Python fails to work.

The specific cause is in the registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Cryptography\Defaults\Provider\Microsoft
Strong Cryptographic Provider has as it's ImagePath value

%SystemRoot%\system32\rsaenh.dll

So the registry (and COM) do rely on environment variables.

Regards,
Martin
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to