[issue27266] Always use getrandom() in os.random() on Linux and add block=False parameter to os.urandom()

Larry Hastings report at bugs.python.org
Wed Jun 8 19:59:22 EDT 2016


Larry Hastings added the comment:

Wait a minute.  If I read the code correctly, currently os.urandom() is implemented strictly using getrandom() *on all platforms*.  And if block=false, it... returns an empty buffer?  Am I reading that right?

And what does it do on platforms that don't have a getrandom() call?  Does os.urandom() literally always raise an exception on OS X or FreeBSD?

This is so crazy.  Surely I'm misunderstanding the code.  What am I missing?

----------

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


More information about the Python-bugs-list mailing list