diff --git a/00102-lib64.patch b/00102-lib64.patch index 8eea66d..2b913ca 100644 --- a/00102-lib64.patch +++ b/00102-lib64.patch @@ -110,7 +110,7 @@ index f698927..bc977b5 100644 @@ -248,8 +248,8 @@ class HelperFunctionsTests(unittest.TestCase): self.assertEqual(dirs[1], wanted) elif os.sep == '/': - # OS X non-framwework builds, Linux, FreeBSD, etc + # OS X non-framework builds, Linux, FreeBSD, etc - self.assertEqual(len(dirs), 1) - wanted = os.path.join('xoxo', 'lib', + self.assertEqual(len(dirs), 2) diff --git a/00111-no-static-lib.patch b/00111-no-static-lib.patch index 6929fda..bc4203d 100644 --- a/00111-no-static-lib.patch +++ b/00111-no-static-lib.patch @@ -1,9 +1,9 @@ diff --git a/Makefile.pre.in b/Makefile.pre.in -index 70e5927..04c8e3d 100644 +index 4b093e3..1088435 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -556,7 +556,7 @@ clinic: $(BUILDPYTHON) $(srcdir)/Modules/_blake2/blake2s_impl.c - $(RUNSHARED) $(PYTHON_FOR_BUILD) ./Tools/clinic/clinic.py --make +@@ -543,7 +543,7 @@ clinic: check-clean-src $(srcdir)/Modules/_blake2/blake2s_impl.c + $(PYTHON_FOR_REGEN) ./Tools/clinic/clinic.py --make # Build the interpreter -$(BUILDPYTHON): Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) @@ -11,7 +11,7 @@ index 70e5927..04c8e3d 100644 $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) platform: $(BUILDPYTHON) pybuilddir.txt -@@ -601,18 +601,6 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o +@@ -588,18 +588,6 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build @@ -30,7 +30,7 @@ index 70e5927..04c8e3d 100644 libpython$(LDVERSION).so: $(LIBRARY_OBJS) if test $(INSTSONAME) != $(LDLIBRARY); then \ $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ -@@ -702,7 +690,7 @@ Modules/Setup: $(srcdir)/Modules/Setup.dist +@@ -689,7 +677,7 @@ Modules/Setup: $(srcdir)/Modules/Setup.dist echo "-----------------------------------------------"; \ fi @@ -39,7 +39,7 @@ index 70e5927..04c8e3d 100644 $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) ############################################################################ -@@ -1382,18 +1370,6 @@ libainstall: all python-config +@@ -1425,18 +1413,6 @@ libainstall: @DEF_MAKE_RULE@ python-config else true; \ fi; \ done diff --git a/00262-pep538_coerce_legacy_c_locale.patch b/00262-pep538_coerce_legacy_c_locale.patch index b144ba5..4a640fd 100644 --- a/00262-pep538_coerce_legacy_c_locale.patch +++ b/00262-pep538_coerce_legacy_c_locale.patch @@ -542,18 +542,6 @@ diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py index ae2bcd4..0a302ff 100644 --- a/Lib/test/test_cmd_line.py +++ b/Lib/test/test_cmd_line.py -@@ -9,8 +9,9 @@ import sys - import subprocess - import tempfile - from test.support import script_helper, is_android --from test.support.script_helper import (spawn_python, kill_python, assert_python_ok, -- assert_python_failure) -+from test.support.script_helper import ( -+ spawn_python, kill_python, assert_python_ok, assert_python_failure -+) - - - # XXX (ncoghlan): Move to script_helper and make consistent with run_python @@ -151,6 +152,7 @@ class CmdLineTest(unittest.TestCase): env = os.environ.copy() # Use C locale to get ascii for the locale encoding diff --git a/00264-skip-test-failing-on-aarch64.patch b/00264-skip-test-failing-on-aarch64.patch deleted file mode 100644 index edda219..0000000 --- a/00264-skip-test-failing-on-aarch64.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/Lib/ctypes/test/test_structures.py b/Lib/ctypes/test/test_structures.py -index 3eded77..ad7859a 100644 ---- a/Lib/ctypes/test/test_structures.py -+++ b/Lib/ctypes/test/test_structures.py -@@ -392,6 +392,7 @@ class StructureTestCase(unittest.TestCase): - (1, 0, 0, 0, 0, 0)) - self.assertRaises(TypeError, lambda: Z(1, 2, 3, 4, 5, 6, 7)) - -+ @unittest.skip('Fails on aarch64: http://bugs.python.org/issue29804') - def test_pass_by_value(self): - # This should mirror the structure in Modules/_ctypes/_ctypes_test.c - class X(Structure): diff --git a/00273-fix-localeconv-encoding-for-LC_NUMERIC.patch b/00273-fix-localeconv-encoding-for-LC_NUMERIC.patch deleted file mode 100644 index 4d0c87d..0000000 --- a/00273-fix-localeconv-encoding-for-LC_NUMERIC.patch +++ /dev/null @@ -1,240 +0,0 @@ -diff --git a/Doc/library/locale.rst b/Doc/library/locale.rst -index b04442bc162..9a0c570533a 100644 ---- a/Doc/library/locale.rst -+++ b/Doc/library/locale.rst -@@ -147,6 +147,16 @@ The :mod:`locale` module defines the following exception and functions: - | ``CHAR_MAX`` | Nothing is specified in this locale. | - +--------------+-----------------------------------------+ - -+ The function sets temporarily the ``LC_CTYPE`` locale to the ``LC_NUMERIC`` -+ locale to decode ``decimal_point`` and ``thousands_sep`` byte strings if -+ they are non-ASCII or longer than 1 byte, and the ``LC_NUMERIC`` locale is -+ different than the ``LC_CTYPE`` locale. This temporary change affects other -+ threads. -+ -+ .. versionchanged:: 3.6.5 -+ The function now sets temporarily the ``LC_CTYPE`` locale to the -+ ``LC_NUMERIC`` locale in some cases. -+ - - .. function:: nl_langinfo(option) - -diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst -index 196a4c00056..d8a1647e8b5 100644 ---- a/Doc/library/stdtypes.rst -+++ b/Doc/library/stdtypes.rst -@@ -1599,6 +1599,20 @@ expression support in the :mod:`re` module). - See :ref:`formatstrings` for a description of the various formatting options - that can be specified in format strings. - -+ .. note:: -+ When formatting a number (:class:`int`, :class:`float`, :class:`float` -+ and subclasses) with the ``n`` type (ex: ``'{:n}'.format(1234)``), the -+ function sets temporarily the ``LC_CTYPE`` locale to the ``LC_NUMERIC`` -+ locale to decode ``decimal_point`` and ``thousands_sep`` fields of -+ :c:func:`localeconv` if they are non-ASCII or longer than 1 byte, and the -+ ``LC_NUMERIC`` locale is different than the ``LC_CTYPE`` locale. This -+ temporary change affects other threads. -+ -+ .. versionchanged:: 3.6.5 -+ When formatting a number with the ``n`` type, the function sets -+ temporarily the ``LC_CTYPE`` locale to the ``LC_NUMERIC`` locale in some -+ cases. -+ - - .. method:: str.format_map(mapping) - -diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst -index 847b50140a6..f83508c9250 100644 ---- a/Doc/whatsnew/3.6.rst -+++ b/Doc/whatsnew/3.6.rst -@@ -2346,3 +2346,11 @@ It has been replaced by the new ``make regen-all`` target. - (Contributed by Victor Stinner in :issue:`23404`.) - - .. versionchanged:: 3.6.2 -+ -+ -+Notable changes in Python 3.6.5 -+=============================== -+ -+The :func:`locale.localeconv` function now sets temporarily the ``LC_CTYPE`` -+locale to the ``LC_NUMERIC`` locale in some cases. -+(Contributed by Victor Stinner in :issue:`31900`.) -diff --git a/Include/fileutils.h b/Include/fileutils.h -index 900c70faad7..875715df97a 100644 ---- a/Include/fileutils.h -+++ b/Include/fileutils.h -@@ -119,6 +119,11 @@ PyAPI_FUNC(int) _Py_get_blocking(int fd); - PyAPI_FUNC(int) _Py_set_blocking(int fd, int blocking); - #endif /* !MS_WINDOWS */ - -+PyAPI_FUNC(int) _Py_GetLocaleconvNumeric( -+ PyObject **decimal_point, -+ PyObject **thousands_sep, -+ const char **grouping); -+ - #endif /* Py_LIMITED_API */ - - #ifdef __cplusplus -diff --git a/Modules/_localemodule.c b/Modules/_localemodule.c -index 71c9146ccb8..95b370b1ad0 100644 ---- a/Modules/_localemodule.c -+++ b/Modules/_localemodule.c -@@ -171,12 +171,6 @@ PyLocale_localeconv(PyObject* self) - RESULT(#i, x); \ - } while (0) - -- /* Numeric information */ -- RESULT_STRING(decimal_point); -- RESULT_STRING(thousands_sep); -- x = copy_grouping(l->grouping); -- RESULT("grouping", x); -- - /* Monetary information */ - RESULT_STRING(int_curr_symbol); - RESULT_STRING(currency_symbol); -@@ -195,6 +189,32 @@ PyLocale_localeconv(PyObject* self) - RESULT_INT(n_sep_by_space); - RESULT_INT(p_sign_posn); - RESULT_INT(n_sign_posn); -+ -+ /* Numeric information */ -+ PyObject *decimal_point, *thousands_sep; -+ const char *grouping; -+ if (_Py_GetLocaleconvNumeric(&decimal_point, -+ &thousands_sep, -+ &grouping) < 0) { -+ goto failed; -+ } -+ -+ if (PyDict_SetItemString(result, "decimal_point", decimal_point) < 0) { -+ Py_DECREF(decimal_point); -+ Py_DECREF(thousands_sep); -+ goto failed; -+ } -+ Py_DECREF(decimal_point); -+ -+ if (PyDict_SetItemString(result, "thousands_sep", thousands_sep) < 0) { -+ Py_DECREF(thousands_sep); -+ goto failed; -+ } -+ Py_DECREF(thousands_sep); -+ -+ x = copy_grouping(grouping); -+ RESULT("grouping", x); -+ - return result; - - failed: -diff --git a/Python/fileutils.c b/Python/fileutils.c -index 97505e5bc6d..14dd81b03f0 100644 ---- a/Python/fileutils.c -+++ b/Python/fileutils.c -@@ -1597,3 +1597,80 @@ _Py_set_blocking(int fd, int blocking) - return -1; - } - #endif -+ -+ -+int -+_Py_GetLocaleconvNumeric(PyObject **decimal_point, PyObject **thousands_sep, -+ const char **grouping) -+{ -+ int res = -1; -+ -+ struct lconv *lc = localeconv(); -+ -+ int change_locale = 0; -+ if (decimal_point != NULL && -+ (strlen(lc->decimal_point) > 1 || ((unsigned char)lc->decimal_point[0]) > 127)) -+ { -+ change_locale = 1; -+ } -+ if (thousands_sep != NULL && -+ (strlen(lc->thousands_sep) > 1 || ((unsigned char)lc->thousands_sep[0]) > 127)) -+ { -+ change_locale = 1; -+ } -+ -+ /* Keep a copy of the LC_CTYPE locale */ -+ char *oldloc = NULL, *loc = NULL; -+ if (change_locale) { -+ oldloc = setlocale(LC_CTYPE, NULL); -+ if (!oldloc) { -+ PyErr_SetString(PyExc_RuntimeWarning, "faild to get LC_CTYPE locale"); -+ return -1; -+ } -+ -+ oldloc = _PyMem_Strdup(oldloc); -+ if (!oldloc) { -+ PyErr_NoMemory(); -+ return -1; -+ } -+ -+ loc = setlocale(LC_NUMERIC, NULL); -+ if (loc != NULL && strcmp(loc, oldloc) == 0) { -+ loc = NULL; -+ } -+ -+ if (loc != NULL) { -+ /* Only set the locale temporarilty the LC_CTYPE locale -+ if LC_NUMERIC locale is different than LC_CTYPE locale and -+ decimal_point and/or thousands_sep are non-ASCII or longer than -+ 1 byte */ -+ setlocale(LC_CTYPE, loc); -+ } -+ } -+ -+ if (decimal_point != NULL) { -+ *decimal_point = PyUnicode_DecodeLocale(lc->decimal_point, NULL); -+ if (*decimal_point == NULL) { -+ goto error; -+ } -+ } -+ if (thousands_sep != NULL) { -+ *thousands_sep = PyUnicode_DecodeLocale(lc->thousands_sep, NULL); -+ if (*thousands_sep == NULL) { -+ goto error; -+ } -+ } -+ -+ if (grouping != NULL) { -+ *grouping = lc->grouping; -+ } -+ -+ res = 0; -+ -+error: -+ if (loc != NULL) { -+ setlocale(LC_CTYPE, oldloc); -+ } -+ PyMem_Free(oldloc); -+ return res; -+} -diff --git a/Python/formatter_unicode.c b/Python/formatter_unicode.c -index d2be76f1e1a..d3ef650e6ce 100644 ---- a/Python/formatter_unicode.c -+++ b/Python/formatter_unicode.c -@@ -707,18 +707,11 @@ get_locale_info(enum LocaleType type, LocaleInfo *locale_info) - { - switch (type) { - case LT_CURRENT_LOCALE: { -- struct lconv *locale_data = localeconv(); -- locale_info->decimal_point = PyUnicode_DecodeLocale( -- locale_data->decimal_point, -- NULL); -- if (locale_info->decimal_point == NULL) -+ if (_Py_GetLocaleconvNumeric(&locale_info->decimal_point, -+ &locale_info->thousands_sep, -+ &locale_info->grouping) < 0) { - return -1; -- locale_info->thousands_sep = PyUnicode_DecodeLocale( -- locale_data->thousands_sep, -- NULL); -- if (locale_info->thousands_sep == NULL) -- return -1; -- locale_info->grouping = locale_data->grouping; -+ } - break; - } - case LT_DEFAULT_LOCALE: diff --git a/00277-fix-test-subprocess-hanging-tests.patch b/00277-fix-test-subprocess-hanging-tests.patch deleted file mode 100644 index c9b54e2..0000000 --- a/00277-fix-test-subprocess-hanging-tests.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 54849962eacc38f4e6c6f8a72ae258b3e7c2ecd5 Mon Sep 17 00:00:00 2001 -From: Victor Stinner -Date: Thu, 5 Oct 2017 15:05:30 +0200 -Subject: [PATCH] bpo-31178: Mock os.waitpid() in test_subprocess - -Fix test_exception_errpipe_bad_data() and -test_exception_errpipe_normal() of test_subprocess: mock os.waitpid() -to avoid calling the real os.waitpid(0, 0) which is an unexpected -side effect of the test. ---- - Lib/test/test_subprocess.py | 12 ++++++++---- - 1 file changed, 8 insertions(+), 4 deletions(-) - -diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py -index 00dc37bc2c7..3ba5c028517 100644 ---- a/Lib/test/test_subprocess.py -+++ b/Lib/test/test_subprocess.py -@@ -1559,8 +1559,10 @@ def proper_error(*args): - - fork_exec.side_effect = proper_error - -- with self.assertRaises(IsADirectoryError): -- self.PopenNoDestructor(["non_existent_command"]) -+ with mock.patch("subprocess.os.waitpid", -+ side_effect=ChildProcessError): -+ with self.assertRaises(IsADirectoryError): -+ self.PopenNoDestructor(["non_existent_command"]) - - @mock.patch("subprocess._posixsubprocess.fork_exec") - def test_exception_errpipe_bad_data(self, fork_exec): -@@ -1577,8 +1579,10 @@ def bad_error(*args): - - fork_exec.side_effect = bad_error - -- with self.assertRaises(subprocess.SubprocessError) as e: -- self.PopenNoDestructor(["non_existent_command"]) -+ with mock.patch("subprocess.os.waitpid", -+ side_effect=ChildProcessError): -+ with self.assertRaises(subprocess.SubprocessError) as e: -+ self.PopenNoDestructor(["non_existent_command"]) - - self.assertIn(repr(error_data), str(e.exception)) - diff --git a/00279-fix-memory-corruption-due-to-allocator-mix.patch b/00279-fix-memory-corruption-due-to-allocator-mix.patch deleted file mode 100644 index 4937391..0000000 --- a/00279-fix-memory-corruption-due-to-allocator-mix.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/Modules/getpath.c b/Modules/getpath.c -index c4055be..1258fcd 100644 ---- a/Modules/getpath.c -+++ b/Modules/getpath.c -@@ -735,7 +735,7 @@ calculate_path(void) - bufsz += wcslen(zip_path) + 1; - bufsz += wcslen(exec_prefix) + 1; - -- buf = PyMem_New(wchar_t, bufsz); -+ buf = PyMem_RawMalloc(bufsz * sizeof(wchar_t)); - if (buf == NULL) { - Py_FatalError( - "Not enough memory for dynamic PYTHONPATH"); diff --git a/00289-fix-nis-compilation.patch b/00289-fix-nis-compilation.patch deleted file mode 100644 index 4d4e3dc..0000000 --- a/00289-fix-nis-compilation.patch +++ /dev/null @@ -1,83 +0,0 @@ -diff --git a/setup.py b/setup.py -index 3eb6ad1..3437e48 100644 ---- a/setup.py -+++ b/setup.py -@@ -1331,20 +1331,14 @@ class PyBuildExt(build_ext): - exts.append( Extension('termios', ['termios.c']) ) - # Jeremy Hylton's rlimit interface - exts.append( Extension('resource', ['resource.c']) ) -+ else: -+ missing.extend(['resource', 'termios']) - -- # Sun yellow pages. Some systems have the functions in libc. -- if (host_platform not in ['cygwin', 'qnx6'] and -- find_file('rpcsvc/yp_prot.h', inc_dirs, []) is not None): -- if (self.compiler.find_library_file(lib_dirs, 'nsl')): -- libs = ['nsl'] -- else: -- libs = [] -- exts.append( Extension('nis', ['nismodule.c'], -- libraries = libs) ) -- else: -- missing.append('nis') -+ nis = self._detect_nis(inc_dirs, lib_dirs) -+ if nis is not None: -+ exts.append(nis) - else: -- missing.extend(['nis', 'resource', 'termios']) -+ missing.append('nis') - - # Curses support, requiring the System V version of curses, often - # provided by the ncurses library. -@@ -2179,6 +2173,51 @@ class PyBuildExt(build_ext): - ) - return ext - -+ def _detect_nis(self, inc_dirs, lib_dirs): -+ if host_platform in {'win32', 'cygwin', 'qnx6'}: -+ return None -+ -+ libs = [] -+ library_dirs = [] -+ includes_dirs = [] -+ -+ # Latest glibc has moved Sun RPC headers into tircp and nsl sub -+ # directories. rpc code has been moved to libtirpc. -+ rpcsvc_inc = find_file( -+ 'rpcsvc/yp_prot.h', inc_dirs, -+ ['/usr/local/include/nsl', '/usr/include/nsl'] -+ ) -+ rpc_inc = find_file( -+ 'rpc/rpc.h', inc_dirs, -+ ['/usr/local/include/tirpc', '/usr/include/tirpc'] -+ ) -+ if rpcsvc_inc is None or rpc_inc is None: -+ # not found -+ return None -+ includes_dirs.extend(rpcsvc_inc) -+ includes_dirs.extend(rpc_inc) -+ -+ if self.compiler.find_library_file(lib_dirs, 'nsl'): -+ libs.append('nsl') -+ else: -+ # libnsl-devel: check for libnsl in nsl/ subdirectory -+ nsl_dirs = [os.path.join(lib_dir, 'nsl') for lib_dir in lib_dirs] -+ libnsl = self.compiler.find_library_file(nsl_dirs, 'nsl') -+ if libnsl is not None: -+ library_dirs.append(os.path.dirname(libnsl)) -+ libs.append('nsl') -+ -+ if self.compiler.find_library_file(lib_dirs, 'tirpc'): -+ libs.append('tirpc') -+ -+ return Extension( -+ 'nis', ['nismodule.c'], -+ libraries=libs, -+ library_dirs=library_dirs, -+ include_dirs=includes_dirs -+ ) -+ -+ - class PyBuildInstall(install): - # Suppress the warning about installation into the lib_dynload - # directory, which is not in sys.path when running Python during diff --git a/00290-cryptmodule-Include-crypt.h-for-declaration-of-crypt.patch b/00290-cryptmodule-Include-crypt.h-for-declaration-of-crypt.patch deleted file mode 100644 index c5d768b..0000000 --- a/00290-cryptmodule-Include-crypt.h-for-declaration-of-crypt.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/Include/Python.h b/Include/Python.h -index dd595ea5e4c..1feb1531cc9 100644 ---- a/Include/Python.h -+++ b/Include/Python.h -@@ -35,6 +35,9 @@ - #ifdef HAVE_UNISTD_H - #include - #endif -+#ifdef HAVE_CRYPT_H -+#include -+#endif - - /* For size_t? */ - #ifdef HAVE_STDDEF_H -diff --git a/configure.ac b/configure.ac -index 03b0f501aff..15ef872a53a 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -2041,7 +2041,7 @@ dnl AC_MSG_RESULT($cpp_type) - - # checks for header files - AC_HEADER_STDC --AC_CHECK_HEADERS(asm/types.h conio.h direct.h dlfcn.h errno.h \ -+AC_CHECK_HEADERS(asm/types.h crypt.h conio.h direct.h dlfcn.h errno.h \ - fcntl.h grp.h \ - ieeefp.h io.h langinfo.h libintl.h process.h pthread.h \ - sched.h shadow.h signal.h stropts.h termios.h \ - diff --git a/00291-setup-Link-ctypes-against-dl-explicitly.patch b/00291-setup-Link-ctypes-against-dl-explicitly.patch deleted file mode 100644 index 6539003..0000000 --- a/00291-setup-Link-ctypes-against-dl-explicitly.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/setup.py b/setup.py -index f4f6e4fdb1f0..8536c350fe3a 100644 ---- a/setup.py -+++ b/setup.py -@@ -2005,6 +2005,10 @@ def detect_ctypes(self, inc_dirs, lib_dirs): - ext.libraries.append(ffi_lib) - self.use_system_libffi = True - -+ if sysconfig.get_config_var('HAVE_LIBDL'): -+ # for dlopen, see bpo-32647 -+ ext.libraries.append('dl') -+ - def _decimal_ext(self): - extra_compile_args = [] - undef_macros = [] diff --git a/00298-do-not-send-IP-in-SNI-TLS-extension.patch b/00298-do-not-send-IP-in-SNI-TLS-extension.patch deleted file mode 100644 index 19b6b31..0000000 --- a/00298-do-not-send-IP-in-SNI-TLS-extension.patch +++ /dev/null @@ -1,60 +0,0 @@ -diff --git a/Modules/_ssl.c b/Modules/_ssl.c -index df8c6a7d96d8..e8cffef14de0 100644 ---- a/Modules/_ssl.c -+++ b/Modules/_ssl.c -@@ -55,6 +55,11 @@ static PySocketModule_APIObject PySocketModule; - #include - #endif - -+#ifndef MS_WINDOWS -+/* inet_pton */ -+#include -+#endif -+ - /* Don't warn about deprecated functions */ - #ifdef __GNUC__ - #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -@@ -667,8 +672,41 @@ newPySSLSocket(PySSLContext *sslctx, PySocketSockObject *sock, - SSL_set_mode(self->ssl, mode); - - #if HAVE_SNI -- if (server_hostname != NULL) -- SSL_set_tlsext_host_name(self->ssl, server_hostname); -+ if (server_hostname != NULL) { -+/* Don't send SNI for IP addresses. We cannot simply use inet_aton() and -+ * inet_pton() here. inet_aton() may be linked weakly and inet_pton() isn't -+ * available on all platforms. Use OpenSSL's IP address parser. It's -+ * available since 1.0.2 and LibreSSL since at least 2.3.0. */ -+ int send_sni = 1; -+#if OPENSSL_VERSION_NUMBER >= 0x10200000L -+ ASN1_OCTET_STRING *ip = a2i_IPADDRESS(server_hostname); -+ if (ip == NULL) { -+ send_sni = 1; -+ ERR_clear_error(); -+ } else { -+ send_sni = 0; -+ ASN1_OCTET_STRING_free(ip); -+ } -+#elif defined(HAVE_INET_PTON) -+#ifdef ENABLE_IPV6 -+ char packed[Py_MAX(sizeof(struct in_addr), sizeof(struct in6_addr))]; -+#else -+ char packed[sizeof(struct in_addr)]; -+#endif /* ENABLE_IPV6 */ -+ if (inet_pton(AF_INET, server_hostname, packed)) { -+ send_sni = 0; -+#ifdef ENABLE_IPV6 -+ } else if(inet_pton(AF_INET6, server_hostname, packed)) { -+ send_sni = 0; -+#endif /* ENABLE_IPV6 */ -+ } else { -+ send_sni = 1; -+ } -+#endif /* HAVE_INET_PTON */ -+ if (send_sni) { -+ SSL_set_tlsext_host_name(self->ssl, server_hostname); -+ } -+ } - #endif - - /* If the socket is in non-blocking mode or timeout mode, set the BIO diff --git a/python3.spec b/python3.spec index dd21fdc..5bdde01 100644 --- a/python3.spec +++ b/python3.spec @@ -13,8 +13,8 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well -Version: %{pybasever}.4 -Release: 20%{?dist} +Version: %{pybasever}.5 +Release: 1%{?dist} License: Python @@ -334,45 +334,10 @@ Patch251: 00251-change-user-install-location.patch # Original proposal: https://bugzilla.redhat.com/show_bug.cgi?id=1404918 Patch262: 00262-pep538_coerce_legacy_c_locale.patch -# 00264 # -# test_pass_by_value was added in Python 3.6.1 and on aarch64 -# it is catching an error that was there, but wasn't tested before. -# Therefore skipping the test on aarch64 until fixed upstream. -# Reported upstream: http://bugs.python.org/issue29804 -Patch264: 00264-skip-test-failing-on-aarch64.patch - -# 00273 # -# Fix localeconv() encoding for LC_NUMERIC -# Fixed upstream: https://bugs.python.org/issue31900 -Patch273: 00273-fix-localeconv-encoding-for-LC_NUMERIC.patch - # 00274 # # Upstream uses Debian-style architecture naming. Change to match Fedora. Patch274: 00274-fix-arch-names.patch -# 00289 # -# Fix the compilation of the nis module, as glibc removed the -# interfaces related to Sun RPC and they are now provided -# by libtirpc and libnsl2. -# See: https://fedoraproject.org/wiki/Changes/SunRPCRemoval -# and https://fedoraproject.org/wiki/Changes/NISIPv6 -# Fixed upstream: https://bugs.python.org/issue32521 -Patch289: 00289-fix-nis-compilation.patch - -# 00290 # -# Not every target system may provide a crypt() function in its stdlibc -# and may use an external or replacement library, like libxcrypt, for -# providing such functions. -# Fixed upstream: https://bugs.python.org/issue32635 -Patch290: 00290-cryptmodule-Include-crypt.h-for-declaration-of-crypt.patch - -# 00291 # -# Build fails with undefined references to dlopen / dlsym otherwise. -# See: https://bugzilla.redhat.com/show_bug.cgi?id=1537489 -# and: https://src.fedoraproject.org/rpms/redhat-rpm-config/c/078af19 -# Fixed upstream: https://bugs.python.org/issue32647 -Patch291: 00291-setup-Link-ctypes-against-dl-explicitly.patch - # 00292 # # Restore the public PyExc_RecursionErrorInst symbol that was removed # from the 3.6.4 release upstream. @@ -387,12 +352,6 @@ Patch292: 00292-restore-PyExc_RecursionErrorInst-symbol.patch # See also: https://bugzilla.redhat.com/show_bug.cgi?id=1489816 Patch294: 00294-define-TLS-cipher-suite-on-build-time.patch -# 00298 # -# The SSL module no longer sends IP addresses in SNI TLS extension on -# platforms with OpenSSL 1.0.2+ or inet_pton. -# Fixed upstream: https://bugs.python.org/issue32185 -Patch298: 00298-do-not-send-IP-in-SNI-TLS-extension.patch - # 00301 # # Tools/scripts/pathfix.py: Add -n option for no backup~ # See: https://bugzilla.redhat.com/show_bug.cgi?id=1546990 @@ -659,7 +618,7 @@ rm -r Modules/expat rm -r Modules/zlib %if %{with rewheel} -%global pip_version 9.0.1 +%global pip_version 9.0.3 sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/ensurepip/__init__.py %endif @@ -686,19 +645,9 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch205 -p1 %patch251 -p1 %patch262 -p1 - -%ifarch aarch64 -%patch264 -p1 -%endif - -%patch273 -p1 %patch274 -p1 -%patch289 -p1 -%patch290 -p1 -%patch291 -p1 %patch292 -p1 %patch294 -p1 -%patch298 -p1 %patch301 -p1 @@ -1521,6 +1470,9 @@ CheckPython optimized # ====================================================== %changelog +* Thu Mar 29 2018 Charalampos Stratakis - 3.6.5-1 +- Update to 3.6.5 + * Sat Mar 24 2018 Miro HronĨok - 3.6.4-20 - Fix broken macro invocation and broken building of C Python extensions Resolves: rhbz#1560103 diff --git a/sources b/sources index 6b5ff13..9d32274 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Python-3.6.4.tar.xz) = 09ba2103ac517ac4d262f00380c9aac836a53401ce252540c17fd821a3b92e1ddf32528d00772221eb3126b12cb95b62c3ac3e852f4951e6f2eb406c88c848a2 +SHA512 (Python-3.6.5.tar.xz) = 6b26fcd296b9bd8e67861eff10d14db7507711ddba947288d16d6def53135c39326b7f969c04bb2b2993f924d9e7ad3f5c5282a3915760bc0885cf0a8ea5eb51