From 0077a197809465e42a2c6300b80af67898f8ebcd Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Mon, 15 Jan 2018 15:28:35 +0100 Subject: [PATCH] Update to version 3.6.4 Rebased patches: 189, 262 Dropped patches due to being upstreamed: 277, 279 --- 00189-add-rewheel-module.patch | 21 +-- 00262-pep538_coerce_legacy_c_locale.patch | 176 +++------------------- python3.spec | 22 +-- sources | 2 +- 4 files changed, 36 insertions(+), 185 deletions(-) diff --git a/00189-add-rewheel-module.patch b/00189-add-rewheel-module.patch index 53a26ca..36b2611 100644 --- a/00189-add-rewheel-module.patch +++ b/00189-add-rewheel-module.patch @@ -1,6 +1,7 @@ -diff -Nur Python-3.4.1/Lib/ensurepip/__init__.py Python-3.4.1-rewheel/Lib/ensurepip/__init__.py ---- Python-3.4.1/Lib/ensurepip/__init__.py 2014-08-21 10:49:30.792695824 +0200 -+++ Python-3.4.1-rewheel/Lib/ensurepip/__init__.py 2014-08-21 10:10:41.958341726 +0200 +diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py +index d69e09f..5cb12df 100644 +--- a/Lib/ensurepip/__init__.py ++++ b/Lib/ensurepip/__init__.py @@ -1,8 +1,10 @@ import os import os.path @@ -12,16 +13,16 @@ diff -Nur Python-3.4.1/Lib/ensurepip/__init__.py Python-3.4.1-rewheel/Lib/ensure __all__ = ["version", "bootstrap"] -@@ -38,6 +40,8 @@ +@@ -25,6 +27,8 @@ def _run_pip(args, additional_paths=None): # Install the bundled software import pip + if args[0] in ["install", "list", "wheel"]: + args.append('--pre') - pip.main(args) + return pip.main(args) -@@ -87,20 +91,39 @@ +@@ -88,20 +92,39 @@ def _bootstrap(*, root=None, upgrade=False, user=False, # omit pip and easy_install os.environ["ENSUREPIP_OPTIONS"] = "install" @@ -72,8 +73,8 @@ diff -Nur Python-3.4.1/Lib/ensurepip/__init__.py Python-3.4.1-rewheel/Lib/ensure # Construct the arguments to be passed to the pip command args = ["install", "--no-index", "--find-links", tmpdir] diff -Nur Python-3.4.1/Lib/ensurepip/rewheel/__init__.py Python-3.4.1-rewheel/Lib/ensurepip/rewheel/__init__.py ---- Python-3.4.1/Lib/ensurepip/rewheel/__init__.py 1970-01-01 01:00:00.000000000 +0100 -+++ Python-3.4.1-rewheel/Lib/ensurepip/rewheel/__init__.py 2014-08-21 10:11:22.560320121 +0200 +--- Python-3.4.1/Lib/ensurepip/rewheel/__init__.py 1970-01-01 01:00:00.000000000 +0100 ++++ Python-3.4.1-rewheel/Lib/ensurepip/rewheel/__init__.py 2014-08-21 10:11:22.560320121 +0200 @@ -0,0 +1,143 @@ +import argparse +import codecs @@ -219,8 +220,8 @@ diff -Nur Python-3.4.1/Lib/ensurepip/rewheel/__init__.py Python-3.4.1-rewheel/Li + pass # bad RECORD or empty line + return to_write, to_omit diff -Nur Python-3.4.1/Makefile.pre.in Python-3.4.1-rewheel/Makefile.pre.in ---- Python-3.4.1/Makefile.pre.in 2014-08-21 10:49:31.512695040 +0200 -+++ Python-3.4.1-rewheel/Makefile.pre.in 2014-08-21 10:10:41.961341722 +0200 +--- Python-3.4.1/Makefile.pre.in 2014-08-21 10:49:31.512695040 +0200 ++++ Python-3.4.1-rewheel/Makefile.pre.in 2014-08-21 10:10:41.961341722 +0200 @@ -1145,7 +1145,7 @@ test/test_asyncio \ collections concurrent concurrent/futures encodings \ diff --git a/00262-pep538_coerce_legacy_c_locale.patch b/00262-pep538_coerce_legacy_c_locale.patch index d749bac..b144ba5 100644 --- a/00262-pep538_coerce_legacy_c_locale.patch +++ b/00262-pep538_coerce_legacy_c_locale.patch @@ -1,8 +1,8 @@ diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst -index 195f63f..8ecd70f 100644 +index 9ffb714..3f7201a 100644 --- a/Doc/using/cmdline.rst +++ b/Doc/using/cmdline.rst -@@ -713,6 +713,45 @@ conflict. +@@ -711,6 +711,45 @@ conflict. .. versionadded:: 3.6 @@ -500,37 +500,13 @@ index 0000000..635c98f +if __name__ == "__main__": + test_main() diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py -index 6c3625d..009f542 100644 +index 6e4286e..594dfa9 100644 --- a/Lib/test/test_capi.py +++ b/Lib/test/test_capi.py -@@ -369,14 +369,21 @@ class EmbeddingTests(unittest.TestCase): - def tearDown(self): - os.chdir(self.oldcwd) - -- def run_embedded_interpreter(self, *args): -+ def run_embedded_interpreter(self, *args, env=None): - """Runs a test in the embedded interpreter""" - cmd = [self.test_exe] - cmd.extend(args) -+ if env is not None and sys.platform == 'win32': -+ # Windows requires at least the SYSTEMROOT environment variable to -+ # start Python. -+ env = env.copy() -+ env['SYSTEMROOT'] = os.environ['SYSTEMROOT'] -+ - p = subprocess.Popen(cmd, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, -- universal_newlines=True) -+ universal_newlines=True, -+ env=env) - (out, err) = p.communicate() - self.assertEqual(p.returncode, 0, - "bad returncode %d, stderr is %r" % -@@ -386,31 +393,21 @@ class EmbeddingTests(unittest.TestCase): - def test_subinterps(self): +@@ -425,32 +425,21 @@ class EmbeddingTests(unittest.TestCase): + def test_repeated_init_and_subinterpreters(self): # This is just a "don't crash" test - out, err = self.run_embedded_interpreter() + out, err = self.run_embedded_interpreter('repeated_init_and_subinterpreters') - if support.verbose: + if support.verbose > 1: print() @@ -549,33 +525,19 @@ index 6c3625d..009f542 100644 - def test_forced_io_encoding(self): # Checks forced configuration of embedded interpreter IO streams -- out, err = self.run_embedded_interpreter("forced_io_encoding") + env = dict(os.environ, PYTHONIOENCODING="utf-8:surrogateescape") + out, err = self.run_embedded_interpreter("forced_io_encoding", env=env) - if support.verbose: -+ env = dict(os.environ, PYTHONIOENCODING="utf-8:surrogateescape") -+ out, err = self.run_embedded_interpreter("forced_io_encoding", env=env) + if support.verbose > 1: print() print(out) print(err) -- expected_errors = sys.__stdout__.errors -- expected_stdin_encoding = sys.__stdin__.encoding + expected_stream_encoding = "utf-8" + expected_errors = "surrogateescape" - expected_pipe_encoding = self._get_default_pipe_encoding() -+ expected_stream_encoding = "utf-8" -+ expected_errors = "surrogateescape" expected_output = '\n'.join([ "--- Use defaults ---", "Expected encoding: default", -@@ -437,8 +434,8 @@ class EmbeddingTests(unittest.TestCase): - "stdout: latin-1:replace", - "stderr: latin-1:backslashreplace"]) - expected_output = expected_output.format( -- in_encoding=expected_stdin_encoding, -- out_encoding=expected_pipe_encoding, -+ in_encoding=expected_stream_encoding, -+ out_encoding=expected_stream_encoding, - errors=expected_errors) - # This is useful if we ever trip over odd platform behaviour - self.maxDiff = None 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 @@ -601,7 +563,7 @@ index ae2bcd4..0a302ff 100644 b'import locale; ' b'print(ascii("' + undecodable + b'"), ' diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py -index df9ebd4..63145e4 100644 +index 7866a5c..b41239a 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -680,6 +680,7 @@ class SysModuleTest(unittest.TestCase): @@ -613,7 +575,7 @@ index df9ebd4..63145e4 100644 'import sys', 'def dump(name):', diff --git a/Modules/main.c b/Modules/main.c -index dd50211..f20cf24 100644 +index b0fb78f..0d8590a 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -105,7 +105,11 @@ static const char usage_6[] = @@ -630,16 +592,15 @@ index dd50211..f20cf24 100644 static int usage(int exitcode, const wchar_t* program) diff --git a/Programs/_testembed.c b/Programs/_testembed.c -index 3968399..1bd2bbf 100644 +index b0f9087..da892bf 100644 --- a/Programs/_testembed.c +++ b/Programs/_testembed.c @@ -1,4 +1,5 @@ --#include -+#include "Python.h" + #include +#include "pyconfig.h" + #include "pythread.h" #include - /********************************************************* diff --git a/Programs/python.c b/Programs/python.c index a7afbc7..03f8295 100644 --- a/Programs/python.c @@ -713,7 +674,7 @@ index a7afbc7..03f8295 100644 for (i = 0; i < argc; i++) { PyMem_RawFree(argv_copy2[i]); diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c -index a4f7f82..3843297 100644 +index 640271f..2a22b24 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -167,6 +167,7 @@ Py_SetStandardStreamEncoding(const char *encoding, const char *errors) @@ -929,7 +890,7 @@ index a4f7f82..3843297 100644 #endif if ((p = Py_GETENV("PYTHONDEBUG")) && *p != '\0') -@@ -1242,12 +1428,8 @@ initstdio(void) +@@ -1251,12 +1437,8 @@ initstdio(void) } } if (!errors && !(pythonioencoding && *pythonioencoding)) { @@ -944,90 +905,11 @@ index a4f7f82..3843297 100644 } } -diff --git a/configure b/configure -index 2915246..39e5a27 100755 ---- a/configure -+++ b/configure -@@ -834,6 +834,8 @@ with_thread - enable_ipv6 - with_doc_strings - with_pymalloc -+with_c_locale_coercion -+with_c_locale_warning - with_valgrind - with_dtrace - with_fpectl -@@ -1527,6 +1529,12 @@ Optional Packages: - deprecated; use --with(out)-threads - --with(out)-doc-strings disable/enable documentation strings - --with(out)-pymalloc disable/enable specialized mallocs -+ --with(out)-c-locale-coercion -+ disable/enable C locale coercion to a UTF-8 based -+ locale -+ --with(out)-c-locale-warning -+ disable/enable locale compatibility warning in the C -+ locale - --with-valgrind Enable Valgrind support - --with(out)-dtrace disable/enable DTrace support - --with-fpectl enable SIGFPE catching -@@ -11010,6 +11018,52 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_pymalloc" >&5 - $as_echo "$with_pymalloc" >&6; } - -+# Check for --with-c-locale-coercion -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-c-locale-coercion" >&5 -+$as_echo_n "checking for --with-c-locale-coercion... " >&6; } -+ -+# Check whether --with-c-locale-coercion was given. -+if test "${with_c_locale_coercion+set}" = set; then : -+ withval=$with_c_locale_coercion; -+fi -+ -+ -+if test -z "$with_c_locale_coercion" -+then -+ with_c_locale_coercion="yes" -+fi -+if test "$with_c_locale_coercion" != "no" -+then -+ -+$as_echo "#define PY_COERCE_C_LOCALE 1" >>confdefs.h -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_c_locale_coercion" >&5 -+$as_echo "$with_c_locale_coercion" >&6; } -+ -+# Check for --with-c-locale-warning -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-c-locale-warning" >&5 -+$as_echo_n "checking for --with-c-locale-warning... " >&6; } -+ -+# Check whether --with-c-locale-warning was given. -+if test "${with_c_locale_warning+set}" = set; then : -+ withval=$with_c_locale_warning; -+fi -+ -+ -+if test -z "$with_c_locale_warning" -+then -+ with_c_locale_warning="yes" -+fi -+if test "$with_c_locale_warning" != "no" -+then -+ -+$as_echo "#define PY_WARN_ON_C_LOCALE 1" >>confdefs.h -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_c_locale_warning" >&5 -+$as_echo "$with_c_locale_warning" >&6; } -+ - # Check for Valgrind support - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-valgrind" >&5 - $as_echo_n "checking for --with-valgrind... " >&6; } diff --git a/configure.ac b/configure.ac -index 67dfba3..b9c9f04 100644 +index 601cc84..5cdc021 100644 --- a/configure.ac +++ b/configure.ac -@@ -3279,6 +3279,40 @@ then +@@ -3310,6 +3310,40 @@ then fi AC_MSG_RESULT($with_pymalloc) @@ -1068,23 +950,3 @@ index 67dfba3..b9c9f04 100644 # Check for Valgrind support AC_MSG_CHECKING([for --with-valgrind]) AC_ARG_WITH([valgrind], -diff --git a/pyconfig.h.in b/pyconfig.h.in -index b10c57f..0a6f3e2 100644 ---- a/pyconfig.h.in -+++ b/pyconfig.h.in -@@ -1244,9 +1244,15 @@ - /* Define as the preferred size in bits of long digits */ - #undef PYLONG_BITS_IN_DIGIT - -+/* Define if you want to coerce the C locale to a UTF-8 based locale */ -+#undef PY_COERCE_C_LOCALE -+ - /* Define to printf format modifier for Py_ssize_t */ - #undef PY_FORMAT_SIZE_T - -+/* Define to emit a locale compatibility warning in the C locale */ -+#undef PY_WARN_ON_C_LOCALE -+ - /* Define if you want to build an interpreter with many run-time checks. */ - #undef Py_DEBUG - diff --git a/python3.spec b/python3.spec index 7495259..d6f9c43 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}.3 -Release: 5%{?dist} +Version: %{pybasever}.4 +Release: 1%{?dist} License: Python @@ -350,19 +350,6 @@ Patch273: 00273-skip-float-test.patch # Upstream uses Debian-style architecture naming. Change to match Fedora. Patch274: 00274-fix-arch-names.patch -# 00277 # -# 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, which makes the koji builds hang. -# Fixed upstream: https://github.com/python/cpython/commit/11045c9d8a21dd9bd182a3939189db02815f9783 -Patch277: 00277-fix-test-subprocess-hanging-tests.patch - -# 00279 # -# Fix memory corruption due to allocator mix -# Fixed upstream: https://bugs.python.org/issue31532 -Patch279: 00279-fix-memory-corruption-due-to-allocator-mix.patch - # 00289 # # Fix the compilation of the nis module, as glibc removed the # interfaces related to Sun RPC and they are now provided @@ -632,8 +619,6 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch273 -p1 %patch274 -p1 -%patch277 -p1 -%patch279 -p1 %patch289 -p1 @@ -1499,6 +1484,9 @@ fi # ====================================================== %changelog +* Mon Jan 15 2018 Charalampos Stratakis - 3.6.4-1 +- Update to version 3.6.4 + * Fri Jan 12 2018 Charalampos Stratakis - 3.6.3-5 - Fix the compilation of the nis module. diff --git a/sources b/sources index 002f1fb..6b5ff13 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Python-3.6.3.tar.xz) = 32f24a3adcb7880003c7ecdc5e53e838e774adda76b308961d8215e28db630b2fa2828097817924c76afa4212b2df3362eb64d4e10f37c0147f512ec5aa8662b +SHA512 (Python-3.6.4.tar.xz) = 09ba2103ac517ac4d262f00380c9aac836a53401ce252540c17fd821a3b92e1ddf32528d00772221eb3126b12cb95b62c3ac3e852f4951e6f2eb406c88c848a2