include Config
-VER = 2.7.10
+VER = 2.7.13
THISAPP = Python-$(VER)
DL_FILE = $(THISAPP).tar.xz
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = c685ef0b8e9f27b5e3db5db12b268ac6
+$(DL_FILE)_MD5 = 53b43534153bb2a0363f08bae8b9d990
install : $(TARGET)
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar Jxf $(DIR_DL)/$(DL_FILE)
rm -rf $(DIR_APP)/Modules/_ctypes/{darwin,libffi,libffi_arm_wince,libffi_msvc,libffi_osx}
+ cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/python-2.7.13-getentropy.patch
cd $(DIR_APP) && OPT="$(CFLAGS)" ./configure \
--prefix=/usr --enable-shared --with-system-ffi
cd $(DIR_APP) && make $(MAKETUNING)
--- /dev/null
+diff --git a/Python/random.c b/Python/random.c
+index 2f83b5d..4cae217 100644
+--- a/Python/random.c
++++ b/Python/random.c
+@@ -97,8 +97,15 @@ win32_urandom(unsigned char *buffer, Py_ssize_t size, int raise)
+ }
+
+ /* Issue #25003: Don't use getentropy() on Solaris (available since
+- * Solaris 11.3), it is blocking whereas os.urandom() should not block. */
+-#elif defined(HAVE_GETENTROPY) && !defined(sun)
++ Solaris 11.3), it is blocking whereas os.urandom() should not block.
++
++ Issue #29188: Don't use getentropy() on Linux since the glibc 2.24
++ implements it with the getrandom() syscall which can fail with ENOSYS,
++ and this error is not supported in py_getentropy() and getrandom() is called
++ with flags=0 which blocks until system urandom is initialized, which is not
++ the desired behaviour to seed the Python hash secret nor for os.urandom():
++ see the PEP 524 which was only implemented in Python 3.6. */
++#elif defined(HAVE_GETENTROPY) && !defined(sun) && !defined(linux)
+ #define PY_GETENTROPY 1
+
+ /* Fill buffer with size pseudo-random bytes generated by getentropy().