Donald Stufft added the comment:

I've attached a minimal patch for making it so ``import random`` does not 
block, it does this by changing what the default instance of Random() is seeded 
with, from os.urandom() to the time based fallback it currently employs. It 
does not change the behavior of any documented behavior that I can see (it's 
documented that calling seed(None) or seed() will use urandom if available).

This could be improved by mixing in id(self) and using SipHash or LCG on the 
value, but this represents a minimal patch that is already possible in cases 
where os.urandom doesn't exist.

----------
Added file: http://bugs.python.org/file43282/no-urandom-by-default.diff

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

Reply via email to