This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients Claudiu.Popa, brett.cannon, christian.heimes, pitrou, virtuald, vstinner
Date 2017-12-19.14:50:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1513695028.19.0.213398074469.issue29877@psf.upfronthosting.co.za>
In-reply-to
Content
> Found on Python 3.6 on a low-resource platform (NI RoboRIO), ...

Hum, it looks like an "embedded device", likely with no entropy source.

To check if os.urandom() will block, try to call the following function in your main script:

>>> import os; os.getrandom(1, flags=os.GRND_NONBLOCK)
b'\xd1'

os.urandom() blocks at system startup until the entropy pool is initialized with 128 bytes of entropy. Once it's initialized, os.urandom() will never block again.

You may also check the number of entropy bytes available to /dev/random (Python uses /dev/urandom which is different):

$ cat /proc/sys/kernel/random/entropy_avail 
3748

For a longer explanation, see the PEP 524.
History
Date User Action Args
2017-12-19 14:50:28vstinnersetrecipients: + vstinner, brett.cannon, pitrou, christian.heimes, Claudiu.Popa, virtuald
2017-12-19 14:50:28vstinnersetmessageid: <1513695028.19.0.213398074469.issue29877@psf.upfronthosting.co.za>
2017-12-19 14:50:28vstinnerlinkissue29877 messages
2017-12-19 14:50:28vstinnercreate