Author lemburg
Recipients Lukasa, Theodore Tso, christian.heimes, dstufft, larry, lemburg, martin.panter, ncoghlan, vstinner
Date 2016-06-09.08:11:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In-reply-to <>
On 09.06.2016 09:57, STINNER Victor wrote:
> STINNER Victor added the comment:
> I played with select() on Linux on a VM:
> * /dev/random: it works as expected
> * /dev/urandom: the device is already seen as readable even before the urandom entropy pool is initialized. It is not really surprising since, yes, read() does not block in practice
> To test Python before urandom is initialized, I used the init=/path/to/python trick in the boot loader.

It's best to look at the code for this in Linux:

getrandom() is implemented directly on top of the two

> By the way, I confirm that getrandom(GRND_NONBLOCK) fails with EAGAIN before urandom is initialized.

Right, and that's good, since it's better to let the application
control what to do than to simply block.

Here's a good reading on getrandom():
Date User Action Args
2016-06-09 08:11:37lemburgsetrecipients: + lemburg, ncoghlan, vstinner, larry, christian.heimes, martin.panter, dstufft, Lukasa, Theodore Tso
2016-06-09 08:11:37lemburglinkissue27266 messages
2016-06-09 08:11:37lemburgcreate