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 christian.heimes
Recipients bmwiedemann, christian.heimes, vstinner
Date 2017-05-05.09:42:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1493977349.12.0.303991578847.issue30276@psf.upfronthosting.co.za>
In-reply-to
Content
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?
History
Date User Action Args
2017-05-05 09:42:29christian.heimessetrecipients: + christian.heimes, vstinner, bmwiedemann
2017-05-05 09:42:29christian.heimessetmessageid: <1493977349.12.0.303991578847.issue30276@psf.upfronthosting.co.za>
2017-05-05 09:42:29christian.heimeslinkissue30276 messages
2017-05-05 09:42:28christian.heimescreate