[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

Larry Hastings report at bugs.python.org
Wed Jun 8 05:01:24 EDT 2016


Larry Hastings added the comment:

I don't know if anyone literally still uses BSD.  But on FreeBSD, /dev/urandom can block.

So let me revise my statement slightly.  Developers on platform X know how *their* /dev/urandom behaves.  They should rightly expect that os.urandom() is a thin wrapper around their local /dev/urandom.  If their /dev/urandom doesn't block, then os.urandom() shouldn't block.  If their /dev/urandom blocks, then it's acceptable that their os.urandom() would block.

What I'm trying to avoid here is the surprising situation where someone is using Python on a system where /dev/urandom will never block, and os.urandom() blocks.

----------

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


More information about the Python-bugs-list mailing list