Message267715
| Author |
dstufft |
| Recipients |
Colm Buckley, Lukasa, alex, christian.heimes, doko, dstufft, larry, lemburg, martin.panter, matejcik, ned.deily, python-dev, rhettinger, skrah, thomas-petazzoni, vstinner, ztane |
| Date |
2016年06月07日.18:29:04 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1465324144.64.0.466557905701.issue26839@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2016年06月07日 18:29:05 | dstufft | set | recipients:
+ dstufft, lemburg, rhettinger, doko, vstinner, larry, christian.heimes, matejcik, ned.deily, alex, skrah, python-dev, martin.panter, ztane, Lukasa, thomas-petazzoni, Colm Buckley |
| 2016年06月07日 18:29:04 | dstufft | set | messageid: <1465324144.64.0.466557905701.issue26839@psf.upfronthosting.co.za> |
| 2016年06月07日 18:29:04 | dstufft | link | issue26839 messages |
| 2016年06月07日 18:29:04 | dstufft | create |
|