[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: python 2.4: os.urandom() hangs if /dev/random, /dev/urandom are not reconnected to a translator



On Sat, Jan 27, 2007 at 06:16:22PM +0000, massimo s. wrote:
> I thought that for os.urandom():
> - a timeout could be useful on any platform without a reliable random
> device (I don't think Hurd is alone in this). I'll ask to the python
> mailing list.

/dev/urandom does not provide reliable random data anyway; it's just a
problem if no data can be provided at all I guess.  An appropriate error
message should be raised in that case after some timeout maybe.

For /dev/random, things are different, it should block until reliable
random data is again available from the entropy pool, I think.

> - hurd-specifically, the module could maybe also check if a translator
> is attached to /dev/urandom and at least spit a warning if there is none.

A work-around on the Hurd is to copy a random binary (like /bin/bash) to
/dev/urandom.  

I don't think python should worry about Hurd implementation details
here.


Michael



Reply to: