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 vstinner
Date 2017-01-06.23:53:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1483746834.46.0.642378238515.issue29188@psf.upfronthosting.co.za>
In-reply-to
Content
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:

* configure.ac: 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.
History
Date User Action Args
2017-01-06 23:53:54vstinnersetrecipients: + vstinner
2017-01-06 23:53:54vstinnersetmessageid: <1483746834.46.0.642378238515.issue29188@psf.upfronthosting.co.za>
2017-01-06 23:53:54vstinnerlinkissue29188 messages
2017-01-06 23:53:54vstinnercreate