This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author christian.heimes
Recipients David Carlier, benjamin.peterson, christian.heimes, eitan.adler, rhettinger, serhiy.storchaka, vstinner
Date 2018-05-19.16:26:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1526747202.28.0.682650639539.issue33528@psf.upfronthosting.co.za>
In-reply-to
Content
I'm -1 on this feature.

It's both confusing and unnecessary to have this feature in the standard library. In general we prefer portable functions or expose platform-specific functions for unique features. The getentropy function is neither portable nor more useful than the high-level wrapper os.urandom().

If you truly require to access the raw function, then you can easily access the libc function with a simple C-types wrapper:

>>> from ctypes import cdll, create_string_buffer
>>> libc = cdll.LoadLibrary("libc.so.6") 
>>> buf = create_string_buffer(8)
>>> buf.raw
b'\x00\x00\x00\x00\x00\x00\x00\x00'
>>> libc.getentropy(buf, len(buf))
0
>>> buf.raw
b'\xd9\x83`\x8a\x89\xc7\x9eX'
History
Date User Action Args
2018-05-19 16:26:42christian.heimessetrecipients: + christian.heimes, rhettinger, vstinner, benjamin.peterson, serhiy.storchaka, eitan.adler, David Carlier
2018-05-19 16:26:42christian.heimessetmessageid: <1526747202.28.0.682650639539.issue33528@psf.upfronthosting.co.za>
2018-05-19 16:26:42christian.heimeslinkissue33528 messages
2018-05-19 16:26:42christian.heimescreate