wok-undigest view python/stuff/patches/13a39142c047.diff @ rev 1226

copied python and python3 recipes from wok-next
author Hans-G?nter Theisgen
date Fri Nov 15 17:47:30 2019 +0100 (2019-11-15)
parents
children
line source
1 Error in the end of the `make install`:
3 ```
4 Traceback (most recent call last):
5 File "${src}/Lib/runpy.py", line 163, in _run_module_as_main
6 mod_name, _Error)
7 File "${src}/Lib/runpy.py", line 111, in _get_module_details
8 __import__(mod_name) # Do not catch exceptions initializing package
9 File "${src}/Lib/ensurepip/__init__.py", line 9, in <module>
10 import tempfile
11 File "${src}/Lib/tempfile.py", line 35, in <module>
12 from random import Random as _Random
13 File "${src}/Lib/random.py", line 885, in <module>
14 _inst = Random()
15 File "${src}/Lib/random.py", line 97, in __init__
16 self.seed(x)
17 File "${src}/Lib/random.py", line 113, in seed
18 a = long(_hexlify(_urandom(2500)), 16)
19 OSError: [Errno 38] Function not implemented
20 make: *** [Makefile:927: install] Error 1
21 ```
23 While the normal installing process is following:
25 ```
26 Collecting setuptools
27 Collecting pip
28 Installing collected packages: setuptools, pip
29 Successfully installed pip-9.0.1 setuptools-28.8.0
30 ```
32 Discussion found here: http://bugs.python.org/issue29188
33 Patch found in the discussion above:
34 https://hg.python.org/cpython/rev/13a39142c047
36 Chunk #1 is removed from the original patch because it rejected.
39 # HG changeset patch
40 # User Victor Stinner <victor.stinner@gmail.com>
41 # Date 1483956641 -3600
42 # Node ID 13a39142c0473ecb64fcd4b12a915025df6e4310
43 # Parent cb4f73be9486d47f1dc4285998d1532d8857c59e
44 Don't use getentropy() on Linux
46 Issue #29188: Support glibc 2.24 on Linux: don't use getentropy() function but
47 read from /dev/urandom to get random bytes, for example in os.urandom(). On
48 Linux, getentropy() is implemented which getrandom() is blocking mode, whereas
49 os.urandom() should not block.
51 diff --git a/Python/random.c b/Python/random.c
52 --- a/Python/random.c
53 +++ b/Python/random.c
54 @@ -97,8 +97,15 @@ win32_urandom(unsigned char *buffer, Py_
55 }
57 /* Issue #25003: Don't use getentropy() on Solaris (available since
58 - * Solaris 11.3), it is blocking whereas os.urandom() should not block. */
59 -#elif defined(HAVE_GETENTROPY) && !defined(sun)
60 + Solaris 11.3), it is blocking whereas os.urandom() should not block.
61 +
62 + Issue #29188: Don't use getentropy() on Linux since the glibc 2.24
63 + implements it with the getrandom() syscall which can fail with ENOSYS,
64 + and this error is not supported in py_getentropy() and getrandom() is called
65 + with flags=0 which blocks until system urandom is initialized, which is not
66 + the desired behaviour to seed the Python hash secret nor for os.urandom():
67 + see the PEP 524 which was only implemented in Python 3.6. */
68 +#elif defined(HAVE_GETENTROPY) && !defined(sun) && !defined(linux)
69 #define PY_GETENTROPY 1
71 /* Fill buffer with size pseudo-random bytes generated by getentropy().