Message267814
Follow-up of the issue #26839: I propose to add a "block" keyword-only optional parameter to os.urandom(). I chose to make the parameter a keyword-only to avoid suprises and backward incompatible change and because I want to make this change in Python 3.5.2.
The attached patch:
* add block parameter to os.urandom()
* modify random.Random constructor to call os.urandom() with block=False
* modify _PyOS_URandom() to add a block parameter
* modify dev_urandom_noraise() to not block
The block parameter currently only changes the behaviour on Linux when the getrandom() syscall is used and the urandom entropy pool is not initialized.
With the change, os.urandom() blocks by default, but Python startup and "import random" doesn't block even if the urandom entropy pool is not initialized yet. |
|
Date |
User |
Action |
Args |
2016-06-08 09:19:03 | vstinner | set | recipients:
+ vstinner |
2016-06-08 09:19:03 | vstinner | set | messageid: <1465377543.28.0.588369041234.issue27266@psf.upfronthosting.co.za> |
2016-06-08 09:19:03 | vstinner | link | issue27266 messages |
2016-06-08 09:19:03 | vstinner | create | |
|