Tim Peters added the comment:

I think it's clear Guido would say "#1".  The thrust of all his comments to 
date is that it was a mistake to change the semantics of os.urandom() on Linux 
(and one other platform? don't really care), and that in 3.6+ only `secrets` 
should _try_ to supply possibly-blocking behavior on Linux.

Indeed, even in 3.6+ he doesn't want to expose the new-ish getrandom() 
directly.  Today he said:

"""
So what should the secrets module use? Let's make that part an extension module.
"""

So he feels strongly enough about this as to recommend a teensy private C 
extension module for secrets.py alone to get at the platform getrandom() (if 
any - of course it needs to fall back to os.urandom() on other platforms).

"""
The main thing that I want to avoid is that people start cargo-culting whatever 
the secrets module uses rather than just using the secrets module. Having it 
redundantly available as os.getrandom() is just begging for people to show off 
how much they know about writing secure code. 
"""

Whenever he starts taking that tone, his mind is made up for good ;-)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27288>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to