[issue1384175] random module - Provider DLL failed to initialize correctly

Silas S. Brown report at bugs.python.org
Sun Feb 15 18:15:12 CET 2009


Silas S. Brown <ssb22 at 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
"C:\devl\release\PythonCE-2.5-20061219\Python-2.5-wince\Lib\random.py",
line 108, in seed
<type 'exceptions.WindowsError'>: [Error 87] Provider DLL failed to
initialize correctly

Although this was thrown up at the "import random" at the start of my
program, the actual change I made that resulted in this error was much
later in the program, and it was to change the lines

            try: justSynthesize=raw_input("Say: ")
            except EOFError: break

into

            try:
justSynthesize=raw_input(cond(winCEsound,"".join(warnings_printed)+cond(warnings_printed,"\n",""),"")+"Say:
") # (WinCE uses an input box so need to repeat the warnings if any)
            except EOFError: break

where "cond" is an "if a then b else c" function.

A little more investigation showed that the culprit was the comment! 
Removing the comment after the raw_input() call (or putting it on a
different line) causes the program to work again.

I confirmed that adding any raw_input() call to any function, with a
prompt parameter and a comment afterwards, causes this error to happen
on the "import random" near the top of the program.  This is a very
strange bug.

----------
nosy: +ssb22

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1384175>
_______________________________________


More information about the Python-bugs-list mailing list