Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ace8848

Browse files
committed
What's New in Python 3.5: document os.urandom() changes
1 parent 9881013 commit ace8848

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

Doc/library/os.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3730,3 +3730,9 @@ Miscellaneous Functions
37303730

37313731
For an easy-to-use interface to the random number generator
37323732
provided by your platform, please see :class:`random.SystemRandom`.
3733+
3734+
.. versionchanged:: 3.5
3735+
On Linux 3.17 and newer, the ``getrandom()`` syscall is now used
3736+
when available. On OpenBSD 5.6 and newer, the C ``getentropy()``
3737+
function is now used. These functions avoid the usage of an internal file
3738+
descriptor.

Doc/whatsnew/3.5.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,11 @@ os
648648
* :class:`os.stat_result` now has a :attr:`~os.stat_result.st_file_attributes`
649649
attribute on Windows. (Contributed by Ben Hoyt in :issue:`21719`.)
650650

651+
* :func:`os.urandom`: On Linux 3.17 and newer, the ``getrandom()`` syscall is
652+
now used when available. On OpenBSD 5.6 and newer, the C ``getentropy()``
653+
function is now used. These functions avoid the usage of an internal file
654+
descriptor.
655+
651656
os.path
652657
-------
653658

0 commit comments

Comments
 (0)