Author vstinner
Recipients vstinner
Date 2016-06-08.09:43:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Larry Hastings (msg267818, on the issue #26839):
> What is the default value of the "block" parameter?


> If called with block=False on FreeBSD, where /dev/urandom may block sometimes, what does the function do?

The function blocks.

In which case FreeBSD urandom can block?

Is there a way to read from /dev/urandom without blocking? If not, _PyOS_URandom() may use arc4random() on FreeBSD if block is false. I suggest to enhance _PyOS_URandom() after the Python 3.5.2 release.

My patch is a quick fix for Python 3.5.2, it can be enhanced later.

I chose to only modify the behaviour on Linux since issues #26839 and #25420 were only reported on Linux.
Date User Action Args
2016-06-08 09:43:02vstinnersetrecipients: + vstinner
2016-06-08 09:43:02vstinnersetmessageid: <>
2016-06-08 09:43:02vstinnerlinkissue27266 messages
2016-06-08 09:43:02vstinnercreate