Larry Hastings (msg267818, on the issue #26839):
> What is the default value of the "block" parameter?
False
> 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. |