[issue27778] PEP 524: Add os.getrandom()

2017-03-31 Thread Donald Stufft
Changes by Donald Stufft : -- pull_requests: +848 ___ Python tracker ___ ___

[issue27778] PEP 524: Add os.getrandom()

2016-10-17 Thread STINNER Victor
STINNER Victor added the comment: Because of the lack of interest for getrandom_errno.patch, and Christian saying that it's not good to document specific errors, I now close the bug. Thank you all for your help on this nice security enhancement in Python 3.6! -- resolution: -> fixed

[issue27778] PEP 524: Add os.getrandom()

2016-09-24 Thread Christian Heimes
Christian Heimes added the comment: I think the documentation is too specific. We typically don't document all possible error numbers. Something along the lines "fails with OSError when getrandom is not supported" is sufficient. -- assignee: -> docs@python components: +Documentation

[issue27778] PEP 524: Add os.getrandom()

2016-09-20 Thread STINNER Victor
STINNER Victor added the comment: I pushed the fix for the issue #27955, os.urandom() now handles getrandom() failing with EPERM. @Christian: Thanks for your review, I pushed a change fixing the two issues that you reported (memory leak and inefficient temporarily buffer). I attached

[issue27778] PEP 524: Add os.getrandom()

2016-09-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset d31b4de433b7 by Victor Stinner in branch '3.6': Fix memleak in os.getrandom() https://hg.python.org/cpython/rev/d31b4de433b7 -- ___ Python tracker

[issue27778] PEP 524: Add os.getrandom()

2016-09-14 Thread Christian Heimes
Christian Heimes added the comment: Oh sorry, I looked in the wrong location and missed it. * if (PyErr_CheckSignals() < 0) {return NULL;} does not free buffer with PyMem_Free(buffer); * The function allocates memory once with PyMem_Malloc() and later a second time with

[issue27778] PEP 524: Add os.getrandom()

2016-09-14 Thread Nick Coghlan
Nick Coghlan added the comment: Right, the only missing piece now is documentation of the ENOSYS case, which end users may encounter if a Python 3.6 binary that supports os.getrandom() is run against an older kernel. That's pretty easy to trigger via containers, as getrandom() was added in

[issue27778] PEP 524: Add os.getrandom()

2016-09-13 Thread Martin Panter
Martin Panter added the comment: I understand it’s already implemented, and Victor just reopened it for more documentation. -- ___ Python tracker ___

[issue27778] PEP 524: Add os.getrandom()

2016-09-13 Thread Christian Heimes
Christian Heimes added the comment: 3.6 is in beta phase. Are you interested to add the feature to 3.7? -- nosy: +christian.heimes versions: +Python 3.7 -Python 3.6 ___ Python tracker

[issue27778] PEP 524: Add os.getrandom()

2016-09-06 Thread Martin Panter
Martin Panter added the comment: I run Arch Linux, but only update packages when I have to. As a result, I am running Linux 3.15 installed and running, but the linux-api-headers has more recently been updated to 4.7 (i.e. matching Linux 4.7). --

[issue27778] PEP 524: Add os.getrandom()

2016-09-06 Thread Nick Coghlan
Nick Coghlan added the comment: Ah, I'd missed that Martin was talking about the other way around from #27990. Yes, I think it's worth documenting that os.getrandom() may raise OSError if the running kernel doesn't provide the syscall - that's going to be pretty easy to trigger by running a

[issue27778] PEP 524: Add os.getrandom()

2016-09-06 Thread STINNER Victor
STINNER Victor added the comment: > HAVE_GETRANDOM_SYSCALL seems to be a compile-time library check, not a > runtime check. I compiled and run on Linux 3.15.5, and os.getrandom() exists > but raises ENOSYS: Oh, I'm surprised the configure sees getrandom() as available. But well ok, the error

[issue27778] PEP 524: Add os.getrandom()

2016-09-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7a243a40b421 by Victor Stinner in branch 'default': Fix test_os.GetRandomTests() https://hg.python.org/cpython/rev/7a243a40b421 -- ___ Python tracker

[issue27778] PEP 524: Add os.getrandom()

2016-09-06 Thread Nick Coghlan
Nick Coghlan added the comment: Huh, I thought I'd already filed an issue for that, but it looks like it was only a security-sig thread: https://mail.python.org/pipermail/security-sig/2016-June/60.html I've now remedied that omission and filed http://bugs.python.org/issue27990 to cover

[issue27778] PEP 524: Add os.getrandom()

2016-09-06 Thread Martin Panter
Martin Panter added the comment: HAVE_GETRANDOM_SYSCALL seems to be a compile-time library check, not a runtime check. I compiled and run on Linux 3.15.5, and os.getrandom() exists but raises ENOSYS: == ERROR: test_getrandom0

[issue27778] PEP 524: Add os.getrandom()

2016-09-06 Thread STINNER Victor
Changes by STINNER Victor : -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue27778] PEP 524: Add os.getrandom()

2016-09-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 27267d2fb091 by Victor Stinner in branch 'default': Add os.getrandom() https://hg.python.org/cpython/rev/27267d2fb091 -- nosy: +python-dev ___ Python tracker

[issue27778] PEP 524: Add os.getrandom()

2016-08-18 Thread Nick Coghlan
Nick Coghlan added the comment: Given docs (with the Linux-only platform support disclaimer), +1 for this as an initial implementation. Providing it on Solaris as well can be a separate patch, but it's less important there (since /dev/urandom and os.urandom() are already blocking APIs)

[issue27778] PEP 524: Add os.getrandom()

2016-08-16 Thread STINNER Victor
New submission from STINNER Victor: Attached patch adds os.getrandom(): thin wrapper on the Linux getrandom() syscall. os.getrandom() can return less bytes than requested. The patch is incomplete: it doesn't include documentation. I chose to not implement a loop to not loose entropy if a