So secrets.py needs an upgrade; it currently uses random.SysRandom.<br><br>On Thursday, June 9, 2016, Tim Peters <<a href="mailto:tim.peters@gmail.com">tim.peters@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">[Nikolaus Rath]<br>
>> Aeh, what the tin says is "return random bytes".<br>
<br>
[Larry Hastings]<br>
> What the tin says is "urandom", which has local man pages that dictate<br>
> exactly how it behaves.  On Linux the "urandom" man page says:<br>
><br>
>     A read from the /dev/urandom device will not block waiting for more entropy.<br>
>     If there is not sufficient entropy, a pseudorandom number generator is used<br>
>     to create the requested bytes.<br>
><br>
> os.urandom() needs to behave like that on Linux, which is how it behaved in<br>
> Python 2.4 through 3.4.<br>
<br>
I agree (with Larry).  If the change hadn't already been made, nobody<br>
would get anywhere trying to make it now.  So best to pretend it was<br>
never made to begin with ;-)<br>
<br>
The tin that _will_ say "return random bytes" in Python will<br>
be`secrets.token_bytes()`.  That's self-evidently (to me) where the<br>
"possibly block forever" implementation belongs.<br>
_______________________________________________<br>
Python-Dev mailing list<br>
<a href="javascript:;" onclick="_e(event, 'cvml', 'Python-Dev@python.org')">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" target="_blank">https://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/guido%40python.org" target="_blank">https://mail.python.org/mailman/options/python-dev/guido%40python.org</a><br>
</blockquote><br><br>-- <br>--Guido (mobile)<br>