eryksun added the comment:
I forgot to set errcheck:
import ctypes
userenv = ctypes.WinDLL('userenv', use_last_error=True)
def errcheck_bool(result, func, args):
if not result:
raise ctypes.WinError(ctypes.get_last_error())
return args
eryksun added the comment:
Albert, this issue was opened for Python 2.4 and was closed over 6 years ago.
Open a new issue if you believe there's a bug or room for improvement in a
currently supported Python version.
FYI, on Windows _PyOS_URandom first initializes the Crypto API by calling
Albert Zeyer added the comment:
Ah thanks, that explains why it failed for me, and why it works after my fix,
which was anyway what I intended.
I mostly posted my comment here in case someone else hits this, so he has
another thing to check/debug.
I don't think that there is a bug on
Albert Zeyer added the comment:
Note that there are still people who get this error in some strange cases, me
included.
E.g.:
http://stackoverflow.com/questions/27904936/python-exe-file-crashes-while-launching-on-windows-xp/32137554#32137554
This happened at a call to `os.urandom` for me.
Silas S. Brown ss...@users.sourceforge.net added the comment:
I got a very similar error on an Otek Pocket PC running Windows Mobile
2003 SE and the latest version of pythonce from
pythonce.sourceforge.net. The error is:
File
Silas S. Brown ss...@users.sourceforge.net added the comment:
After further investigation I'm suspecting that this issue is actually
due to the process running out of RAM.
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1384175
Daniel Diniz aja...@gmail.com added the comment:
Given MvL's diagnostics and lack of response from OP, suggest closing.
--
nosy: +ajaksu2
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1384175
Changes by Martin v. Löwis mar...@v.loewis.de:
--
resolution: - works for me
status: open - closed
versions: +3rd party -Python 2.4
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1384175
___