Recipients, iwienand
Date 2012-08-31.10:39:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The root of the problem preventing me from running some 3rd party scripts correctly is the mismatch between (recently) raising an OSError in Python/random.c, but catching only NotImplementedError in Lib/

For backwards compatibility (previous releases all raised and caught NotImplementedError), here is a patch that stops Python bailing out with "OSError: No such file or directory /dev/urandom" for me.  Tested with Python-2.6.8, Python-2.7.3 and Python-3.2.3, on HPUX 11.00, HPUX 11.11 and Tru 64 5.1.

Arguably, as long as 3rd party code doesn't rely on the NotImplementedError exception, changing to catch OSErrors would work equally well.

This patch does not stop dev_urandom_noraise() from halting the interpreter on machines with no /dev/urandom, but that seems intentional to me so I didn't try to fix it.
Date User Action Args
2012-08-31 10:39:33bugs-python@vendor.thewrittenword.comsetrecipients: +, iwienand
2012-08-31 10:39:33bugs-python@vendor.thewrittenword.comsetmessageid: <>
2012-08-31 10:39:32bugs-python@vendor.thewrittenword.comlinkissue15340 messages
2012-08-31 10:39:32bugs-python@vendor.thewrittenword.comcreate