Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Doc/library/os.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6466,9 +6466,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()``.

Expand Down
Loading