https://github.com/python/cpython/commit/6377e47d17137dccd4122aaea6f2d500f3268ad9
commit: 6377e47d17137dccd4122aaea6f2d500f3268ad9
branch: 3.15
author: Miss Islington (bot) <[email protected]>
committer: StanFromIreland <[email protected]>
date: 2026-11-17T20:41:30Z
summary:

[3.15] gh-116245: Document `getentropy()` use in `os.urandom()` (GH-162108) 
(#162171)

(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 7ed3a5987539251..8f686a8bd5b7966 100644
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -6392,9 +6392,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]

Reply via email to