STINNER Victor added the comment:

Enhanced patch to address Nick's comments and fix mistakes. The new patch now 
also updates the documentation.

I restored the code in _random.Random.seed() to fallback on the system clock: 
_PyOS_URandomNonblock() *can* fail is /dev/urandom is missing or not readable. 
I enhanced this part to not only read the system clock, but also use the 
current process identifier and get also the monotonic clock. Moreover, 64 bits 
are now used instead of 32 bits from the system clock (use a resolution of 1 
nanoscond, not only 1 second).

I didn't test yet the fall back on clocks/pid. It should be tested manually by 
modifying _PyOS_URandomNonblock() to always fail.

----------
Added file: http://bugs.python.org/file44150/urandom_nonblock-2.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27776>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to