Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1)

#27776: PEP 524: Make os.urandom() blocking on Linux

Can't Edit
Can't Publish+Mail
Start Review
Created:
3 years, 9 months ago by vstinner
Modified:
3 years, 9 months ago
Reviewers:
ncoghlan
CC:
Nick Coghlan, haypo, devnull_psf.upfronthosting.co.za, Decorater
Visibility:
Public.

Patch Set 1 #

Total comments: 9

Patch Set 2 #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Doc/library/os.rst View 1 1 chunk +22 lines, -8 lines 0 comments Download
Doc/whatsnew/3.6.rst View 1 3 chunks +12 lines, -0 lines 0 comments Download
Include/pylifecycle.h View 1 1 chunk +2 lines, -1 line 0 comments Download
Lib/random.py View 1 1 chunk +0 lines, -9 lines 0 comments Download
Modules/posixmodule.c View 1 1 chunk +1 line, -2 lines 0 comments Download
Modules/_randommodule.c View 1 5 chunks +40 lines, -9 lines 0 comments Download
Python/random.c View 1 10 chunks +45 lines, -30 lines 0 comments Download

Messages

Total messages: 2
Nick Coghlan
Pending the docs updates (What's New, tweaking the os.urandom() docs), +1 from me. https://bugs.python.org/review/27776/diff/18150/Lib/random.py File ...
3 years, 9 months ago #1
victor.stinner_gmail.com
3 years, 9 months ago #2
https://bugs.python.org/review/27776/diff/18150/Lib/random.py
File Lib/random.py (right):

https://bugs.python.org/review/27776/diff/18150/Lib/random.py#newcode106
Lib/random.py:106: if version == 2:
Exactly.

https://bugs.python.org/review/27776/diff/18150/Modules/_randommodule.c
File Modules/_randommodule.c (right):

https://bugs.python.org/review/27776/diff/18150/Modules/_randommodule.c#newco...
Modules/_randommodule.c:230: if (random_seed_urandom(self) < 0) {
Hum, the function can fail if getrandom() syscall doesn't work and the
/dev/urandom device doesn't exist (for example when Python is run on a
"incomplete" chroot) or is not accessible (strange file permissions).

https://bugs.python.org/review/27776/diff/18150/Python/random.c
File Python/random.c (right):

https://bugs.python.org/review/27776/diff/18150/Python/random.c#newcode226
Python/random.c:226: Return 0 on success. Raise an exception and return -1 on
error. */
On 2016/08/18 14:57:52, Nick Coghlan wrote:
> I'm not clear on the reason for removing the additional details from the
comment
> here

Oh, it's a mistake. I had bad time with Mercurial and merge conflicts :-)

https://bugs.python.org/review/27776/diff/18150/Python/random.c#newcode230
Python/random.c:230: if (raise) {
> the PY_GETRANDOM block seems to be identical on both branches,

Oh. Again, it looks like I made a mistake. I refactored the code to move the
common code at the top/end.
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+