Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion Doc/library/os.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4886,7 +4886,7 @@ Random numbers
device. If the ``/dev/urandom`` device is not available or not readable, the
:exc:`NotImplementedError` exception is raised.

On Windows, it will use ``CryptGenRandom()``.
On Windows, it will use ``BCryptGenRandom()``.

.. seealso::
The :mod:`secrets` module provides higher level functions. For an
Expand All @@ -4907,6 +4907,10 @@ Random numbers
function is now used. These functions avoid the usage of an internal file
descriptor.

.. versionchanged:: 3.11
On Windows, ``BCryptGenRandom()`` is used instead of ``CryptGenRandom()``
which is deprecated.

.. data:: GRND_NONBLOCK

By default, when reading from ``/dev/random``, :func:`getrandom` blocks if
Expand Down
4 changes: 2 additions & 2 deletions Doc/whatsnew/3.11.rst
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ math
os
--

* On Windows, :func:`os.urandom`: uses BCryptGenRandom API instead of CryptGenRandom API
which is deprecated from Microsoft Windows API.
* On Windows, :func:`os.urandom` uses ``BCryptGenRandom()`` instead of ``CryptGenRandom()``
which is deprecated.
(Contributed by Dong-hee Na in :issue:`44611`.)


Expand Down