Re: [Python-Dev] BDFL ruling request: should we block forever waiting for high-quality random bits?

2016年6月09日 19:58:19 -0700

On 06/09/2016 07:38 PM, Nikolaus Rath wrote:
On Jun 09 2016, Larry Hastings <[email protected]> wrote:
Nope, I want the old behavior back. os.urandom() should read
/dev/random if getrandom() would block. As the British say, "it
should do what it says on the tin".
Aeh, what the tin says is "return random bytes".
What the tin says is "urandom", which has local man pages that dictate exactly how it behaves. On Linux the "urandom" man page says:
 A read from the /dev/urandom device will not block waiting for more
 entropy. If there is not sufficient entropy, a pseudorandom number
 generator is used to create the requested bytes.
os.urandom() needs to behave like that on Linux, which is how it behaved in Python 2.4 through 3.4.
//arry/
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to