[issue27266] Add block keyword-only optional parameter to os.urandom()
STINNER Victor
report at bugs.python.org
Wed Jun 8 05:43:02 EDT 2016
STINNER Victor added the comment:
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.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27266>
_______________________________________
More information about the Python-bugs-list
mailing list