Author vstinner
Recipients vstinner
Date 2017-01-06.23:53:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Python 3.6 uses the new getrandom() function/syscall on Linux and Solaris to get random bytes with no file descriptor: it prevents EMFILE and ENFILE errors or surprises when opening a first file (and looking at its file descriptor).

I propose to copy and adapt Python/random.c from Python 3.5 when Python 3.5 will be updated for the issue #29157. Python 2.7 requires extra changes:

* need to check linux/random.h in AC_CHECK_HEADERS()
* random.c: need to keep vms_urandom() function (Python 2.7 still supports VMS!)
* Python 2.7 doesn't implement the PEP 475 (EINTR) and so don't have functions like _Py_read() which handles EINTR for us.

See also the issue #29157 for the latest change in random.c: prefer getrandom() over getentropy() to support the glibc 2.24.
Date User Action Args
2017-01-06 23:53:54vstinnersetrecipients: + vstinner
2017-01-06 23:53:54vstinnersetmessageid: <>
2017-01-06 23:53:54vstinnerlinkissue29188 messages
2017-01-06 23:53:54vstinnercreate