[issue27279] Add random.cryptorandom() and random.pseudorandom, deprecate os.urandom()

Nick Coghlan report at bugs.python.org
Thu Jun 9 12:52:13 EDT 2016


Nick Coghlan added the comment:

As with other proposals to add new APIs, I think this is an overreaction to a Linux specific problem. Linux system boot could deadlock with 3.5.0 and 3.5.1 due to:

- CPython startup using os.urandom() when it wasn't necessary
- systemd invoking a Python script before the OS entropy pool had been initialised (which then deadlocked until the Python invocation timed out)

As long as we switch the internal hash algorithm to seeding from a non-blocking random source, and also ensure that importing the random module doesn't implicitly call os.urandom, then any other software that only needs pseudorandom data can just use the random module APIs.

----------
nosy: +ncoghlan

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


More information about the Python-bugs-list mailing list