Message293087
I cannot reproduce the open /dev/urandom calls locally. You seem to be running an old Python version and/or old Kernel. Python prefers getrandom() over /dev/urandom. The urandom code caches the fd for /dev/urandom.
$ strace ./python -c 'import hashlib' 2>&1 | grep random
getrandom("\xe0\xa5\x00\xda\xe1\xce\x1a\x9c\xe7\x61\x71\xf2\x1d\x15\x63\x19\xdc\x60\x70\x3c\xef\xf6\xcb\xdb", 24, GRND_NONBLOCK) = 24
open("/dev/urandom", O_RDONLY|O_NOCTTY|O_NONBLOCK) = 3
The O_RDONLY|O_NOCTTY|O_NONBLOCK|O_CLOEXEC comes from OpenSSL.
What's your Python version, OpenSSL version, Kernel version and which platform/distribution are you on? |
|
Date |
User |
Action |
Args |
2017-05-05 09:42:29 | christian.heimes | set | recipients:
+ christian.heimes, vstinner, bmwiedemann |
2017-05-05 09:42:29 | christian.heimes | set | messageid: <1493977349.12.0.303991578847.issue30276@psf.upfronthosting.co.za> |
2017-05-05 09:42:29 | christian.heimes | link | issue30276 messages |
2017-05-05 09:42:28 | christian.heimes | create | |
|