https://github.com/python/cpython/commit/9616539a7a3186ed8c9c9fae238005c0f66154a3 commit: 9616539a7a3186ed8c9c9fae238005c0f66154a3 branch: 3.14 author: Miss Islington (bot) <[email protected]> committer: StanFromIreland <[email protected]> date: 2026-11-17T20:41:24Z summary:
[3.14] gh-116245: Document `getentropy()` use in `os.urandom()` (GH-162108) (#162172) (cherry picked from commit c885978bb600ac94012776877070381a50e4d4f2) Co-authored-by: Kirti Aggarwal <[email protected]> Co-authored-by: Stan Ulbrych <[email protected]> files: M Doc/library/os.rst diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 59f60b7fd195a4..b0a390b588fe59 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -5969,9 +5969,12 @@ Random numbers random bytes in non-blocking mode (using the :data:`GRND_NONBLOCK` flag) or to poll until the system urandom entropy pool is initialized. - On a Unix-like system, random bytes are read from the ``/dev/urandom`` - device. If the ``/dev/urandom`` device is not available or not readable, the - :exc:`NotImplementedError` exception is raised. + On other Unix-like systems, the C ``getrandom()`` function is used if it is + available, otherwise the C ``getentropy()`` function. + + If none of these functions can be used, random bytes are read from the + ``/dev/urandom`` device. If the ``/dev/urandom`` device is not available or + not readable, the :exc:`NotImplementedError` exception is raised. On Windows, it will use ``BCryptGenRandom()``. _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: [email protected]
