diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2019-12-01 17:44:24 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2019-12-01 17:44:24 +0300 |
commit | c089c4500b0b78acf03ee5405ad250a84b0dfa66 (patch) | |
tree | 23870848d194569aff6e0e4e41bc7907960b1af1 /debian/patches | |
parent | 377002e7300431b68f3548d9fd2c7f99cf883939 (diff) | |
download | python3.7-debian.tar.gz |
Import python3.7 (3.7.5-2)debian/3.7.5-2debian
Diffstat (limited to 'debian/patches')
38 files changed, 456 insertions, 416 deletions
diff --git a/debian/patches/arm-alignment.diff b/debian/patches/arm-alignment.diff new file mode 100644 index 0000000..a7a4b39 --- /dev/null +++ b/debian/patches/arm-alignment.diff @@ -0,0 +1,17 @@ +Author: Dave Jones <dave.jones@canonical.com> +Description: Use aligned access for _sha3 module on ARM. +--- a/Modules/_sha3/sha3module.c ++++ b/Modules/_sha3/sha3module.c +@@ -64,6 +64,12 @@ + #define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN + #endif + ++/* Bus error on 32-bit ARM due to un-aligned memory accesses; 64-bit ARM ++ * doesn't complain but un-aligned memory accesses are sub-optimal */ ++#if defined(__arm__) || defined(__aarch64__) ++#define NO_MISALIGNED_ACCESSES ++#endif ++ + /* mangle names */ + #define KeccakF1600_FastLoop_Absorb _PySHA3_KeccakF1600_FastLoop_Absorb + #define Keccak_HashFinal _PySHA3_Keccak_HashFinal diff --git a/debian/patches/bdist-wininst-notfound.diff b/debian/patches/bdist-wininst-notfound.diff index 27e9024..a716bf3 100644 --- a/debian/patches/bdist-wininst-notfound.diff +++ b/debian/patches/bdist-wininst-notfound.diff @@ -5,15 +5,14 @@ Index: b/Lib/distutils/command/bdist_wininst.py =================================================================== --- a/Lib/distutils/command/bdist_wininst.py +++ b/Lib/distutils/command/bdist_wininst.py -@@ -358,7 +358,10 @@ class bdist_wininst(Command): - sfix = '' - +@@ -359,6 +359,10 @@ class bdist_wininst(Command): filename = os.path.join(directory, "wininst-%s%s.exe" % (bv, sfix)) -- f = open(filename, "rb") -+ try: + f = open(filename, "rb") + try: + f = open(filename, "rb") + except IOError as e: + raise DistutilsFileError(str(e) + ', %s not included in the Debian packages.' % filename) - try: ++ try: return f.read() finally: + f.close() diff --git a/debian/patches/build-math-object.diff b/debian/patches/build-math-object.diff new file mode 100644 index 0000000..904e9eb --- /dev/null +++ b/debian/patches/build-math-object.diff @@ -0,0 +1,23 @@ +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -22,7 +22,8 @@ + + MODBUILT_NAMES= _MODBUILT_NAMES_ + MODDISABLED_NAMES= _MODDISABLED_NAMES_ +-MODOBJS= _MODOBJS_ ++# filter out duplicate object files (_math.o) ++MODOBJS= $(sort _MODOBJS_) + MODLIBS= _MODLIBS_ + + # === Variables set by configure +@@ -602,8 +603,9 @@ pybuilddir.txt: $(BUILDPYTHON) + fi + + # This is shared by the math and cmath modules ++# don't build with -fPIC when building as math and cmath as builtins + Modules/_math.o: Modules/_math.c Modules/_math.h +- $(CC) -c $(CCSHARED) $(PY_CORE_CFLAGS) -o $@ $< ++ $(CC) -c $(if $(findstring _math.o, $(MODOBJS)),,$(CCSHARED)) $(PY_CORE_CFLAGS) -o $@ $< + + # blake2s is auto-generated from blake2b + $(srcdir)/Modules/_blake2/blake2s_impl.c: $(srcdir)/Modules/_blake2/blake2b_impl.c $(srcdir)/Modules/_blake2/blake2b2s.py diff --git a/debian/patches/ctypes-arm.diff b/debian/patches/ctypes-arm.diff index 5be98b6..9387ac7 100644 --- a/debian/patches/ctypes-arm.diff +++ b/debian/patches/ctypes-arm.diff @@ -2,7 +2,7 @@ Index: b/Lib/ctypes/util.py =================================================================== --- a/Lib/ctypes/util.py +++ b/Lib/ctypes/util.py -@@ -247,16 +247,27 @@ elif os.name == "posix": +@@ -256,16 +256,27 @@ elif os.name == "posix": def _findSoname_ldconfig(name): import struct diff --git a/debian/patches/deb-locations.diff b/debian/patches/deb-locations.diff index b3b2ad9..513adb7 100644 --- a/debian/patches/deb-locations.diff +++ b/debian/patches/deb-locations.diff @@ -1,10 +1,8 @@ # DP: adjust locations of directories to debian policy -Index: b/Lib/pydoc.py -=================================================================== --- a/Lib/pydoc.py +++ b/Lib/pydoc.py -@@ -28,6 +28,10 @@ to a file named "<name>.html". +@@ -31,6 +31,10 @@ to a file named "<name>.html". Module docs for core modules are assumed to be in @@ -15,11 +13,9 @@ Index: b/Lib/pydoc.py https://docs.python.org/X.Y/library/ This can be overridden by setting the PYTHONDOCS environment variable -Index: b/Misc/python.man -=================================================================== --- a/Misc/python.man +++ b/Misc/python.man -@@ -327,7 +327,7 @@ exception). Error messages are written +@@ -337,7 +337,7 @@ exception). Error messages are written These are subject to difference depending on local installation conventions; ${prefix} and ${exec_prefix} are installation-dependent and should be interpreted as for GNU software; they may be the same. diff --git a/debian/patches/deb-setup.diff b/debian/patches/deb-setup.diff index 08ce316..748085d 100644 --- a/debian/patches/deb-setup.diff +++ b/debian/patches/deb-setup.diff @@ -1,10 +1,8 @@ # DP: Don't include /usr/local/include and /usr/local/lib as gcc search paths -Index: b/setup.py -=================================================================== --- a/setup.py +++ b/setup.py -@@ -262,8 +262,10 @@ class PyBuildExt(build_ext): +@@ -337,8 +337,10 @@ class PyBuildExt(build_ext): # unfortunately, distutils doesn't let us provide separate C and C++ # compilers if compiler is not None: @@ -17,8 +15,8 @@ Index: b/setup.py self.compiler.set_executables(**args) build_ext.build_extensions(self) -@@ -487,12 +489,7 @@ class PyBuildExt(build_ext): - return ['m'] +@@ -576,12 +578,7 @@ class PyBuildExt(build_ext): + os.unlink(tmpfile) def detect_modules(self): - # Ensure that /usr/local is always used, but the local build diff --git a/debian/patches/disable-sem-check.diff b/debian/patches/disable-sem-check.diff index cb1630f..387fd8a 100644 --- a/debian/patches/disable-sem-check.diff +++ b/debian/patches/disable-sem-check.diff @@ -1,10 +1,8 @@ # DP: Assume working semaphores, don't rely on running kernel for the check. -Index: b/configure.ac -=================================================================== --- a/configure.ac +++ b/configure.ac -@@ -4496,8 +4496,13 @@ int main(void) { +@@ -4586,8 +4586,13 @@ int main(void) { AC_MSG_RESULT($ac_cv_posix_semaphores_enabled) if test $ac_cv_posix_semaphores_enabled = no then @@ -20,7 +18,7 @@ Index: b/configure.ac fi # Multiprocessing check for broken sem_getvalue -@@ -4532,8 +4537,13 @@ int main(void){ +@@ -4622,8 +4627,13 @@ int main(void){ AC_MSG_RESULT($ac_cv_broken_sem_getvalue) if test $ac_cv_broken_sem_getvalue = yes then @@ -35,4 +33,4 @@ Index: b/configure.ac + esac fi - AC_CHECK_DECLS([RTLD_LAZY, RTLD_NOW, RTLD_GLOBAL, RTLD_LOCAL, RTLD_NODELETE, RTLD_NOLOAD, RTLD_DEEPBIND], [], [], [[#include <dlfcn.h>]]) + AC_CHECK_DECLS([RTLD_LAZY, RTLD_NOW, RTLD_GLOBAL, RTLD_LOCAL, RTLD_NODELETE, RTLD_NOLOAD, RTLD_DEEPBIND, RTLD_MEMBER], [], [], [[#include <dlfcn.h>]]) diff --git a/debian/patches/disable-some-tests.diff b/debian/patches/disable-some-tests.diff index ddec2cd..7f8dc05 100644 --- a/debian/patches/disable-some-tests.diff +++ b/debian/patches/disable-some-tests.diff @@ -5,8 +5,8 @@ Index: b/Lib/distutils/tests/test_build_ext.py --- a/Lib/distutils/tests/test_build_ext.py +++ b/Lib/distutils/tests/test_build_ext.py @@ -102,6 +102,7 @@ class BuildExtTestCase(TempdirManager, - build_ext.USER_BASE = self.old_user_base - super(BuildExtTestCase, self).tearDown() + self.assertIsInstance(xx.Null(), xx.Null) + self.assertIsInstance(xx.Str(), xx.Str) + @unittest.skip('Skipping failing Solaris test') def test_solaris_enable_shared(self): diff --git a/debian/patches/distutils-install-layout.diff b/debian/patches/distutils-install-layout.diff index 9ca8b00..fbc6681 100644 --- a/debian/patches/distutils-install-layout.diff +++ b/debian/patches/distutils-install-layout.diff @@ -2,8 +2,6 @@ # DP: - installs into $prefix/dist-packages instead of $prefix/site-packages. # DP: - doesn't encode the python version into the egg name. -Index: b/Lib/distutils/command/install_egg_info.py -=================================================================== --- a/Lib/distutils/command/install_egg_info.py +++ b/Lib/distutils/command/install_egg_info.py @@ -14,18 +14,38 @@ class install_egg_info(Command): @@ -50,8 +48,6 @@ Index: b/Lib/distutils/command/install_egg_info.py self.target = os.path.join(self.install_dir, basename) self.outputs = [self.target] -Index: b/Lib/distutils/command/install.py -=================================================================== --- a/Lib/distutils/command/install.py +++ b/Lib/distutils/command/install.py @@ -35,6 +35,20 @@ INSTALL_SCHEMES = { @@ -139,11 +135,9 @@ Index: b/Lib/distutils/command/install.py def finalize_other(self): """Finalizes options for non-posix platforms""" -Index: b/Lib/distutils/sysconfig.py -=================================================================== --- a/Lib/distutils/sysconfig.py +++ b/Lib/distutils/sysconfig.py -@@ -122,6 +122,7 @@ def get_python_lib(plat_specific=0, stan +@@ -140,6 +140,7 @@ def get_python_lib(plat_specific=0, stan If 'prefix' is supplied, use it instead of sys.base_prefix or sys.base_exec_prefix -- i.e., ignore 'plat_specific'. """ @@ -151,7 +145,7 @@ Index: b/Lib/distutils/sysconfig.py if prefix is None: if standard_lib: prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX -@@ -133,6 +134,12 @@ def get_python_lib(plat_specific=0, stan +@@ -151,6 +152,12 @@ def get_python_lib(plat_specific=0, stan "lib", "python" + get_python_version()) if standard_lib: return libpython @@ -164,8 +158,6 @@ Index: b/Lib/distutils/sysconfig.py else: return os.path.join(libpython, "site-packages") elif os.name == "nt": -Index: b/Lib/site.py -=================================================================== --- a/Lib/site.py +++ b/Lib/site.py @@ -7,12 +7,18 @@ @@ -188,7 +180,7 @@ Index: b/Lib/site.py If a file named "pyvenv.cfg" exists one directory above sys.executable, sys.prefix and sys.exec_prefix are set to that directory and it is also checked for site-packages (sys.base_prefix and -@@ -304,9 +310,20 @@ def getsitepackages(prefixes=None): +@@ -334,9 +340,20 @@ def getsitepackages(prefixes=None): seen.add(prefix) if os.sep == '/': @@ -211,14 +203,12 @@ Index: b/Lib/site.py else: sitepackages.append(prefix) sitepackages.append(os.path.join(prefix, "lib", "site-packages")) -Index: b/Lib/test/test_site.py -=================================================================== --- a/Lib/test/test_site.py +++ b/Lib/test/test_site.py -@@ -260,10 +260,10 @@ class HelperFunctionsTests(unittest.Test - self.assertEqual(dirs[1], wanted) - elif os.sep == '/': - # OS X non-framwework builds, Linux, FreeBSD, etc +@@ -269,10 +269,10 @@ class HelperFunctionsTests(unittest.Test + dirs = site.getsitepackages() + if os.sep == '/': + # OS X, Linux, FreeBSD, etc - self.assertEqual(len(dirs), 1) - wanted = os.path.join('xoxo', 'lib', + self.assertEqual(len(dirs), 3) @@ -229,21 +219,17 @@ Index: b/Lib/test/test_site.py self.assertEqual(dirs[0], wanted) else: # other platforms -Index: b/Lib/distutils/tests/test_bdist_dumb.py -=================================================================== --- a/Lib/distutils/tests/test_bdist_dumb.py +++ b/Lib/distutils/tests/test_bdist_dumb.py @@ -85,7 +85,7 @@ class BuildDumbTestCase(support.TempdirM fp.close() - contents = sorted(os.path.basename(fn) for fn in contents) + contents = sorted(filter(None, map(os.path.basename, contents))) - wanted = ['foo-0.1-py%s.%s.egg-info' % sys.version_info[:2], 'foo.py'] + wanted = ['foo-0.1.egg-info', 'foo.py'] if not sys.dont_write_bytecode: wanted.append('foo.%s.pyc' % sys.implementation.cache_tag) self.assertEqual(contents, sorted(wanted)) -Index: b/Lib/distutils/tests/test_install.py -=================================================================== --- a/Lib/distutils/tests/test_install.py +++ b/Lib/distutils/tests/test_install.py @@ -193,7 +193,7 @@ class InstallTestCase(support.TempdirMan @@ -264,11 +250,9 @@ Index: b/Lib/distutils/tests/test_install.py self.assertEqual(found, expected) def test_debug_mode(self): -Index: b/Lib/pydoc.py -=================================================================== --- a/Lib/pydoc.py +++ b/Lib/pydoc.py -@@ -417,6 +417,7 @@ class Doc: +@@ -420,6 +420,7 @@ class Doc: 'marshal', 'posix', 'signal', 'sys', '_thread', 'zipimport') or (file.startswith(basedir) and diff --git a/debian/patches/distutils-sysconfig.diff b/debian/patches/distutils-sysconfig.diff index c12e6b3..3a87f2f 100644 --- a/debian/patches/distutils-sysconfig.diff +++ b/debian/patches/distutils-sysconfig.diff @@ -2,35 +2,33 @@ # DP: the python build, when CFLAGS, CPPFLAGS, LDSHARED) are not set # DP: in the environment. -Index: b/Lib/distutils/sysconfig.py -=================================================================== --- a/Lib/distutils/sysconfig.py +++ b/Lib/distutils/sysconfig.py -@@ -177,9 +177,11 @@ def customize_compiler(compiler): +@@ -195,9 +195,11 @@ def customize_compiler(compiler): _osx_support.customize_compiler(_config_vars) _config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True' -- (cc, cxx, opt, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags) = \ -+ (cc, cxx, opt, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags, +- (cc, cxx, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags) = \ ++ (cc, cxx, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags, + configure_cppflags, configure_cflags, configure_ldflags) = \ - get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS', + get_config_vars('CC', 'CXX', 'CFLAGS', - 'CCSHARED', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS') + 'CCSHARED', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS', + 'CONFIGURE_CPPFLAGS', 'CONFIGURE_CFLAGS', 'CONFIGURE_LDFLAGS') if 'CC' in os.environ: newcc = os.environ['CC'] -@@ -200,13 +202,22 @@ def customize_compiler(compiler): +@@ -218,13 +220,22 @@ def customize_compiler(compiler): cpp = cc + " -E" # not always if 'LDFLAGS' in os.environ: ldshared = ldshared + ' ' + os.environ['LDFLAGS'] + elif configure_ldflags: + ldshared = ldshared + ' ' + configure_ldflags if 'CFLAGS' in os.environ: - cflags = opt + ' ' + os.environ['CFLAGS'] + cflags = cflags + ' ' + os.environ['CFLAGS'] ldshared = ldshared + ' ' + os.environ['CFLAGS'] + elif configure_cflags: -+ cflags = opt + ' ' + configure_cflags ++ cflags = cflags + ' ' + configure_cflags + ldshared = ldshared + ' ' + configure_cflags if 'CPPFLAGS' in os.environ: cpp = cpp + ' ' + os.environ['CPPFLAGS'] diff --git a/debian/patches/doc-build-texinfo.diff b/debian/patches/doc-build-texinfo.diff new file mode 100644 index 0000000..7297473 --- /dev/null +++ b/debian/patches/doc-build-texinfo.diff @@ -0,0 +1,27 @@ +Description: Add the option to build Texinfo-format documentation. +Author: Benjamin Moody <benjamin@physionet.org> +Bug-Debian: https://bugs.debian.org/881959 +Last-Update: 2017-11-27 + +--- python3.7-3.7.0~a2.orig/Doc/Makefile ++++ python3.7-3.7.0~a2/Doc/Makefile +@@ -27,6 +27,7 @@ help: + @echo " htmlview to open the index page built by the html target in your browser" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" ++ @echo " texinfo to make Texinfo files" + @echo " text to make plain text files" + @echo " epub to make EPUB files" + @echo " changes to make an overview over all changed/added/deprecated items" +@@ -72,6 +73,11 @@ latex: build + @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ + "run these through (pdf)latex." + ++texinfo: BUILDER = texinfo ++texinfo: build ++ @echo "Build finished; the Texinfo files are in build/texinfo." ++ @echo "Run \`make\' in that directory to run these through makeinfo." ++ + text: BUILDER = text + text: build + @echo "Build finished; the text files are in build/text." diff --git a/debian/patches/ensurepip-disabled.diff b/debian/patches/ensurepip-disabled.diff index f19b36a..ff221d7 100644 --- a/debian/patches/ensurepip-disabled.diff +++ b/debian/patches/ensurepip-disabled.diff @@ -1,7 +1,5 @@ # DP: Disable ensurepip for the system installation, only enable it for virtual environments. -Index: b/Lib/ensurepip/__init__.py -=================================================================== --- a/Lib/ensurepip/__init__.py +++ b/Lib/ensurepip/__init__.py @@ -8,6 +8,34 @@ import tempfile @@ -39,7 +37,7 @@ Index: b/Lib/ensurepip/__init__.py _PROJECTS = [ "setuptools", -@@ -56,6 +84,11 @@ def bootstrap(*, root=None, upgrade=Fals +@@ -75,6 +103,11 @@ def _bootstrap(*, root=None, upgrade=Fal Note that calling this function will alter both sys.path and os.environ. """ @@ -51,11 +49,9 @@ Index: b/Lib/ensurepip/__init__.py if altinstall and default_pip: raise ValueError("Cannot use altinstall and default_pip together") -Index: b/Lib/venv/__init__.py -=================================================================== --- a/Lib/venv/__init__.py +++ b/Lib/venv/__init__.py -@@ -242,7 +242,28 @@ class EnvBuilder: +@@ -266,7 +266,28 @@ class EnvBuilder: # intended for the global Python environment cmd = [context.env_exe, '-Im', 'ensurepip', '--upgrade', '--default-pip'] diff --git a/debian/patches/ensurepip-wheels.diff b/debian/patches/ensurepip-wheels.diff index df5de92..558cf9d 100644 --- a/debian/patches/ensurepip-wheels.diff +++ b/debian/patches/ensurepip-wheels.diff @@ -1,5 +1,3 @@ -Index: b/Lib/ensurepip/__init__.py -=================================================================== --- a/Lib/ensurepip/__init__.py +++ b/Lib/ensurepip/__init__.py @@ -1,3 +1,4 @@ @@ -11,9 +9,9 @@ Index: b/Lib/ensurepip/__init__.py __all__ = ["version", "bootstrap"] --_SETUPTOOLS_VERSION = "28.8.0" +-_SETUPTOOLS_VERSION = "41.2.0" - --_PIP_VERSION = "9.0.1" +-_PIP_VERSION = "19.2.3" - _PROJECTS = [ - ("setuptools", _SETUPTOOLS_VERSION), @@ -24,7 +22,21 @@ Index: b/Lib/ensurepip/__init__.py ] -@@ -32,7 +30,10 @@ def version(): +@@ -24,15 +22,22 @@ def _run_pip(args, additional_paths=None + sys.path = additional_paths + sys.path + + # Install the bundled software +- import pip._internal +- return pip._internal.main(args) ++ try: ++ import pip._internal ++ return pip._internal.main(args) ++ except ImportError: ++ import pip ++ return pip.main(args) + + + def version(): """ Returns a string specifying the bundled version of pip. """ @@ -36,7 +48,7 @@ Index: b/Lib/ensurepip/__init__.py def _disable_pip_configuration_settings(): # We deliberately ignore all pip environment variables -@@ -73,20 +74,44 @@ def bootstrap(*, root=None, upgrade=Fals +@@ -88,20 +93,44 @@ def _bootstrap(*, root=None, upgrade=Fal # omit pip and easy_install os.environ["ENSUREPIP_OPTIONS"] = "install" @@ -91,16 +103,16 @@ Index: b/Lib/ensurepip/__init__.py # Construct the arguments to be passed to the pip command args = ["install", "--no-index", "--find-links", tmpdir] -@@ -99,7 +124,7 @@ def bootstrap(*, root=None, upgrade=Fals +@@ -114,7 +143,7 @@ def _bootstrap(*, root=None, upgrade=Fal if verbosity: args += ["-" + "v" * verbosity] -- _run_pip(args + [p[0] for p in _PROJECTS], additional_paths) -+ _run_pip(args + _PROJECTS, additional_paths) +- return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths) ++ return _run_pip(args + _PROJECTS, additional_paths) def _uninstall_helper(*, verbosity=0): """Helper to support a clean default uninstall process on Windows -@@ -113,7 +138,8 @@ def _uninstall_helper(*, verbosity=0): +@@ -128,7 +157,8 @@ def _uninstall_helper(*, verbosity=0): return # If the pip version doesn't match the bundled one, leave it alone @@ -110,12 +122,12 @@ Index: b/Lib/ensurepip/__init__.py msg = ("ensurepip will only uninstall a matching version " "({!r} installed, {!r} bundled)") print(msg.format(pip.__version__, _PIP_VERSION), file=sys.stderr) -@@ -126,7 +152,7 @@ def _uninstall_helper(*, verbosity=0): +@@ -141,7 +171,7 @@ def _uninstall_helper(*, verbosity=0): if verbosity: args += ["-" + "v" * verbosity] -- _run_pip(args + [p[0] for p in reversed(_PROJECTS)]) -+ _run_pip(args + reversed(_PROJECTS)) +- return _run_pip(args + [p[0] for p in reversed(_PROJECTS)]) ++ return _run_pip(args + reversed(_PROJECTS)) def _main(argv=None): diff --git a/debian/patches/ext-no-libpython-link.diff b/debian/patches/ext-no-libpython-link.diff index 627d9d1..21407d7 100644 --- a/debian/patches/ext-no-libpython-link.diff +++ b/debian/patches/ext-no-libpython-link.diff @@ -1,10 +1,8 @@ # DP: Don't link extensions with the shared libpython library. -Index: b/Lib/distutils/command/build_ext.py -=================================================================== --- a/Lib/distutils/command/build_ext.py +++ b/Lib/distutils/command/build_ext.py -@@ -230,7 +230,7 @@ class build_ext(Command): +@@ -231,7 +231,7 @@ class build_ext(Command): # For building extensions with a shared Python library, # Python's library directory must be appended to library_dirs # See Issues: #1600860, #4366 @@ -13,7 +11,7 @@ Index: b/Lib/distutils/command/build_ext.py if not sysconfig.python_build: # building third party extensions self.library_dirs.append(sysconfig.get_config_var('LIBDIR')) -@@ -746,7 +746,7 @@ class build_ext(Command): +@@ -724,7 +724,7 @@ class build_ext(Command): return ext.libraries else: from distutils import sysconfig diff --git a/debian/patches/git-updates.diff b/debian/patches/git-updates.diff index f9229ee..773b020 100644 --- a/debian/patches/git-updates.diff +++ b/debian/patches/git-updates.diff @@ -1,4 +1,4 @@ -# DP: updates from the 3.6 branch (until 2017-06-07, ). +# DP: updates from the 3.7 branch (until 2019-09-04). -# git diff 69c0db5050f623e8895b72dfe970392b1f9a0e2e 09b6c0c71ea944f7e8b46998f3ebaf5b9fbe15f6 | filterdiff -x ?/.hgignore -x ?/.hgeol -x ?/.hgtags -x ?/.hgtouch -x ?/.gitignore -x ?/.gitattributes -x '?/.github/*' -x '?/.git*' -x ?/.codecov.yml -x ?/.travis.yml -x ?/configure --remove-timestamps +# git diff --no-renames e09359112e250268eca209355abeb17abf822486 6b8121a261917256198ac5bc3a02306a05cea169 | filterdiff -x ?/.hgignore -x ?/.hgeol -x ?/.hgtags -x ?/.hgtouch -x ?/.gitignore -x ?/.gitattributes -x '?/.github/*' -x '?/.git*' -x ?/.codecov.yml -x ?/.travis.yml -x ?/configure --remove-timestamps diff --git a/debian/patches/issue35998.diff b/debian/patches/issue35998.diff new file mode 100644 index 0000000..51cdd1f --- /dev/null +++ b/debian/patches/issue35998.diff @@ -0,0 +1,22 @@ +--- a/Lib/test/test_asyncio/test_sslproto.py ++++ b/Lib/test/test_asyncio/test_sslproto.py +@@ -495,14 +495,11 @@ + + server_context = test_utils.simple_server_sslcontext() + client_context = test_utils.simple_client_sslcontext() +- if (sys.platform.startswith('freebsd') +- or sys.platform.startswith('win') +- or sys.platform.startswith('darwin')): +- # bpo-35031: Some FreeBSD and Windows buildbots fail to run this test +- # as the eof was not being received by the server if the payload +- # size is not big enough. This behaviour only appears if the +- # client is using TLS1.3. Also seen on macOS. +- client_context.options |= ssl.OP_NO_TLSv1_3 ++ # bpo-35031: Some buildbots fail to run this test as the eof ++ # was not being received by the server if the payload size is ++ # not big enough. This behaviour only appears if the client is ++ # using TLS1.3. ++ client_context.options |= ssl.OP_NO_TLSv1_3 + answer = None + + def client(sock, addr): diff --git a/debian/patches/langpack-gettext.diff b/debian/patches/langpack-gettext.diff index 56deb77..c80e300 100644 --- a/debian/patches/langpack-gettext.diff +++ b/debian/patches/langpack-gettext.diff @@ -7,7 +7,7 @@ Index: b/Lib/gettext.py =================================================================== --- a/Lib/gettext.py +++ b/Lib/gettext.py -@@ -491,11 +491,26 @@ def find(domain, localedir=None, languag +@@ -499,11 +499,26 @@ def find(domain, localedir=None, languag if lang == 'C': break mofile = os.path.join(localedir, lang, 'LC_MESSAGES', '%s.mo' % domain) diff --git a/debian/patches/lib-argparse.diff b/debian/patches/lib-argparse.diff index c9d604a..28856ff 100644 --- a/debian/patches/lib-argparse.diff +++ b/debian/patches/lib-argparse.diff @@ -1,10 +1,12 @@ # DP: argparse.py: Make the gettext import conditional +Index: b/Lib/argparse.py +=================================================================== --- a/Lib/argparse.py +++ b/Lib/argparse.py -@@ -90,7 +90,16 @@ +@@ -87,7 +87,16 @@ import os as _os + import re as _re import sys as _sys - import textwrap as _textwrap -from gettext import gettext as _, ngettext +try: @@ -18,5 +20,5 @@ + else: + return plural - SUPPRESS = '==SUPPRESS==' + diff --git a/debian/patches/lib2to3-no-pickled-grammar.diff b/debian/patches/lib2to3-no-pickled-grammar.diff index 6364384..a7cc1ec 100644 --- a/debian/patches/lib2to3-no-pickled-grammar.diff +++ b/debian/patches/lib2to3-no-pickled-grammar.diff @@ -2,7 +2,7 @@ Index: b/Lib/lib2to3/pgen2/driver.py =================================================================== --- a/Lib/lib2to3/pgen2/driver.py +++ b/Lib/lib2to3/pgen2/driver.py -@@ -122,7 +122,10 @@ def load_grammar(gt="Grammar.txt", gp=No +@@ -120,7 +120,10 @@ def load_grammar(gt="Grammar.txt", gp=No if force or not _newer(gp, gt): logger.info("Generating grammar tables from %s", gt) g = pgen.generate_grammar(gt) @@ -18,7 +18,7 @@ Index: b/Lib/lib2to3/tests/test_parser.py =================================================================== --- a/Lib/lib2to3/tests/test_parser.py +++ b/Lib/lib2to3/tests/test_parser.py -@@ -36,71 +36,6 @@ +@@ -38,83 +38,6 @@ class TestDriver(support.TestCase): self.assertEqual(t.children[1].children[0].type, syms.print_stmt) @@ -85,6 +85,18 @@ Index: b/Lib/lib2to3/tests/test_parser.py - finally: - shutil.rmtree(tmpdir) - +- def test_load_packaged_grammar(self): +- modname = __name__ + '.load_test' +- class MyLoader: +- def get_data(self, where): +- return pickle.dumps({'elephant': 19}) +- class MyModule: +- __file__ = 'parsertestmodule' +- __spec__ = importlib.util.spec_from_loader(modname, MyLoader()) +- sys.modules[modname] = MyModule() +- self.addCleanup(operator.delitem, sys.modules, modname) +- g = pgen2_driver.load_packaged_grammar(modname, 'Grammar.txt') +- self.assertEqual(g.elephant, 19) - - class GrammarTest(support.TestCase): diff --git a/debian/patches/link-opt.diff b/debian/patches/link-opt.diff index 4b4d7b7..5608d5c 100644 --- a/debian/patches/link-opt.diff +++ b/debian/patches/link-opt.diff @@ -1,10 +1,8 @@ # DP: Call the linker with -O1 -Bsymbolic-functions -Index: b/configure.ac -=================================================================== --- a/configure.ac +++ b/configure.ac -@@ -2511,8 +2511,8 @@ then +@@ -2611,8 +2611,8 @@ then fi ;; Linux*|GNU*|QNX*) @@ -12,12 +10,12 @@ Index: b/configure.ac - LDCXXSHARED='$(CXX) -shared';; + LDSHARED='$(CC) -shared -Wl,-O1 -Wl,-Bsymbolic-functions' + LDCXXSHARED='$(CXX) -shared -Wl,-O1 -Wl,-Bsymbolic-functions';; - BSD/OS*/4*) - LDSHARED="gcc -shared" - LDCXXSHARED="g++ -shared";; -@@ -2612,7 +2612,7 @@ then + FreeBSD*) + if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]] + then +@@ -2703,7 +2703,7 @@ then + LINKFORSHARED="-Wl,-E -Wl,+s";; # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";; - BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";; Linux-android*) LINKFORSHARED="-pie -Xlinker -export-dynamic";; - Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";; + Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions";; diff --git a/debian/patches/local-doc-references.diff b/debian/patches/local-doc-references.diff new file mode 100644 index 0000000..631a1de --- /dev/null +++ b/debian/patches/local-doc-references.diff @@ -0,0 +1,22 @@ +--- a/Doc/tools/templates/layout.html ++++ b/Doc/tools/templates/layout.html +@@ -50,7 +50,7 @@ + {% endblock %} + {% block extrahead %} + <link rel="shortcut icon" type="image/png" href="{{ pathto('_static/py.png', 1) }}" /> +- <link rel="canonical" href="https://docs.python.org/3/{{pagename}}.html" /> ++ <link rel="canonical" href="file:///usr/share/doc/python3.7/html/{{pagename}}.html" /> + {% if builder != "htmlhelp" %} + {% if not embedded %}<script type="text/javascript" src="{{ pathto('_static/copybutton.js', 1) }}"></script>{% endif %} + {% if switchers is defined and not embedded %}<script type="text/javascript" src="{{ pathto('_static/switchers.js', 1) }}"></script>{% endif %} +--- a/Lib/idlelib/help.html ++++ b/Lib/idlelib/help.html +@@ -27,7 +27,7 @@ + <link rel="copyright" title="Copyright" href="../copyright.html" /> + <link rel="next" title="Other Graphical User Interface Packages" href="othergui.html" /> + <link rel="prev" title="tkinter.scrolledtext — Scrolled Text Widget" href="tkinter.scrolledtext.html" /> +- <link rel="canonical" href="https://docs.python.org/3/library/idle.html" /> ++ <link rel="canonical" href="file:///usr/share/doc/python3.7/html/library/idle.html" /> + + + diff --git a/debian/patches/locale-module.diff b/debian/patches/locale-module.diff index 76fd849..a35f0bf 100644 --- a/debian/patches/locale-module.diff +++ b/debian/patches/locale-module.diff @@ -6,7 +6,7 @@ Index: b/Lib/locale.py =================================================================== --- a/Lib/locale.py +++ b/Lib/locale.py -@@ -1339,8 +1339,8 @@ locale_alias = { +@@ -1403,8 +1403,8 @@ locale_alias = { 'ug_cn': 'ug_CN.UTF-8', 'uk': 'uk_UA.KOI8-U', 'uk_ua': 'uk_UA.KOI8-U', diff --git a/debian/patches/lto-link-flags.diff b/debian/patches/lto-link-flags.diff index afea9c2..dcf9d5d 100644 --- a/debian/patches/lto-link-flags.diff +++ b/debian/patches/lto-link-flags.diff @@ -1,17 +1,15 @@ -Index: b/Makefile.pre.in -=================================================================== --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -146,7 +146,7 @@ CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$ +@@ -150,7 +150,7 @@ CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$ SHLIB_SUFFIX= @SHLIB_SUFFIX@ EXT_SUFFIX= @EXT_SUFFIX@ LDSHARED= @LDSHARED@ $(PY_LDFLAGS) -BLDSHARED= @BLDSHARED@ $(PY_LDFLAGS) -+BLDSHARED= @BLDSHARED@ $(PY_LDFLAGS) $(PY_CFLAGS) ++BLDSHARED= @BLDSHARED@ $(PY_LDFLAGS) $(PY_CFLAGS) $(CCSHARED) LDCXXSHARED= @LDCXXSHARED@ DESTSHARED= $(BINLIBDEST)/lib-dynload -@@ -544,7 +544,7 @@ clinic: $(BUILDPYTHON) $(srcdir)/Modules +@@ -580,7 +580,7 @@ clinic: check-clean-src $(srcdir)/Module # Build the interpreter $(BUILDPYTHON): Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) diff --git a/debian/patches/mangle-fstack-protector.diff b/debian/patches/mangle-fstack-protector.diff index 19b27f7..35384c7 100644 --- a/debian/patches/mangle-fstack-protector.diff +++ b/debian/patches/mangle-fstack-protector.diff @@ -1,8 +1,6 @@ # DP: When using GCC versions older than 4.9, automagically mangle # DP: -fstack-protector-strong to -fstack-protector -Index: b/Lib/distutils/sysconfig.py -=================================================================== --- a/Lib/distutils/sysconfig.py +++ b/Lib/distutils/sysconfig.py @@ -13,6 +13,7 @@ import _imp @@ -13,7 +11,7 @@ Index: b/Lib/distutils/sysconfig.py from .errors import DistutilsPlatformError -@@ -197,6 +198,10 @@ def customize_compiler(compiler): +@@ -216,6 +217,10 @@ def customize_compiler(compiler): cc = newcc if 'CXX' in os.environ: cxx = os.environ['CXX'] diff --git a/debian/patches/multiarch.diff b/debian/patches/multiarch.diff index dace3f5..cdd5290 100644 --- a/debian/patches/multiarch.diff +++ b/debian/patches/multiarch.diff @@ -1,8 +1,6 @@ -Index: b/Lib/sysconfig.py -=================================================================== --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py -@@ -557,6 +557,12 @@ def get_config_vars(*args): +@@ -558,6 +558,12 @@ def get_config_vars(*args): # the init-function. _CONFIG_VARS['userbase'] = _getuserbase() @@ -15,11 +13,9 @@ Index: b/Lib/sysconfig.py # Always convert srcdir to an absolute path srcdir = _CONFIG_VARS.get('srcdir', _PROJECT_BASE) if os.name == 'posix': -Index: b/Lib/distutils/sysconfig.py -=================================================================== --- a/Lib/distutils/sysconfig.py +++ b/Lib/distutils/sysconfig.py -@@ -99,6 +99,9 @@ def get_python_inc(plat_specific=0, pref +@@ -112,6 +112,9 @@ def get_python_inc(plat_specific=0, pref incdir = os.path.join(get_config_var('srcdir'), 'Include') return os.path.normpath(incdir) python_dir = 'python' + get_python_version() + build_flags @@ -28,12 +24,10 @@ Index: b/Lib/distutils/sysconfig.py + return sysconfig.get_path('platinclude') return os.path.join(prefix, "include", python_dir) elif os.name == "nt": - return os.path.join(prefix, "include") -Index: b/Makefile.pre.in -=================================================================== + if python_build: --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -760,6 +760,7 @@ Modules/signalmodule.o: $(srcdir)/Module +@@ -794,6 +794,7 @@ Modules/signalmodule.o: $(srcdir)/Module Python/dynload_shlib.o: $(srcdir)/Python/dynload_shlib.c Makefile $(CC) -c $(PY_CORE_CFLAGS) \ @@ -41,7 +35,7 @@ Index: b/Makefile.pre.in -DSOABI='"$(SOABI)"' \ -o $@ $(srcdir)/Python/dynload_shlib.c -@@ -1404,7 +1405,7 @@ inclinstall: +@@ -1477,7 +1478,7 @@ inclinstall: LIBPL= @LIBPL@ # pkgconfig directory diff --git a/debian/patches/platform-lsbrelease.diff b/debian/patches/platform-lsbrelease.diff index 271139f..83f3df3 100644 --- a/debian/patches/platform-lsbrelease.diff +++ b/debian/patches/platform-lsbrelease.diff @@ -1,10 +1,8 @@ # DP: Use /etc/lsb-release to identify the platform. -Index: b/Lib/platform.py -=================================================================== --- a/Lib/platform.py +++ b/Lib/platform.py -@@ -267,7 +267,7 @@ _release_version = re.compile(r'([^0-9]+ +@@ -299,7 +299,7 @@ _release_version = re.compile(r'([^0-9]+ _supported_dists = ( 'SuSE', 'debian', 'fedora', 'redhat', 'centos', 'mandrake', 'mandriva', 'rocks', 'slackware', 'yellowdog', 'gentoo', @@ -13,18 +11,18 @@ Index: b/Lib/platform.py def _parse_release_file(firstline): -@@ -296,6 +296,10 @@ def _parse_release_file(firstline): +@@ -328,6 +328,10 @@ def _parse_release_file(firstline): id = l[1] return '', version, id -+_distributor_id_file_re = re.compile("(?:DISTRIB_ID\s*=)\s*(.*)", re.I) -+_release_file_re = re.compile("(?:DISTRIB_RELEASE\s*=)\s*(.*)", re.I) -+_codename_file_re = re.compile("(?:DISTRIB_CODENAME\s*=)\s*(.*)", re.I) ++_distributor_id_file_re = re.compile(r"(?:DISTRIB_ID\s*=)\s*(.*)", re.I) ++_release_file_re = re.compile(r"(?:DISTRIB_RELEASE\s*=)\s*(.*)", re.I) ++_codename_file_re = re.compile(r"(?:DISTRIB_CODENAME\s*=)\s*(.*)", re.I) + def linux_distribution(distname='', version='', id='', supported_dists=_supported_dists, -@@ -328,6 +332,25 @@ def _linux_distribution(distname, versio +@@ -360,6 +364,25 @@ def _linux_distribution(distname, versio args given as parameters. """ @@ -50,16 +48,3 @@ Index: b/Lib/platform.py try: etc = os.listdir(_UNIXCONFDIR) except OSError: -Index: b/Lib/test/test_platform.py -=================================================================== ---- a/Lib/test/test_platform.py -+++ b/Lib/test/test_platform.py -@@ -349,6 +349,8 @@ class PlatformTest(unittest.TestCase): - self.assertEqual(version, '19') - self.assertEqual(distid, 'Schr\xf6dinger\u2019s Cat') - -+ # we know we are Debian/Ubuntu -+ test_linux_distribution_encoding.skip = True - - class DeprecationTest(unittest.TestCase): - diff --git a/debian/patches/profiled-build.diff b/debian/patches/profiled-build.diff index 1eb203b..b4e67c5 100644 --- a/debian/patches/profiled-build.diff +++ b/debian/patches/profiled-build.diff @@ -1,18 +1,16 @@ # DP: Ignore errors in the profile task. -Index: b/Makefile.pre.in -=================================================================== --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -467,6 +467,16 @@ build_all_generate_profile: +@@ -504,6 +504,16 @@ build_all_generate_profile: run_profile_task: - : # FIXME: can't run for a cross build + @ # FIXME: can't run for a cross build $(LLVM_PROF_FILE) $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) || true + task="$(PROFILE_TASK)"; \ + case "$$task" in \ + *-s\ *) \ + $(LLVM_PROF_FILE) $(RUNSHARED) ./$(BUILDPYTHON) $$task; \ -+ while [ -f $(srcdir)/build/pynexttest ]; do \ ++ while [ -f $(abs_builddir)/build/pynexttest ]; do \ + $(LLVM_PROF_FILE) $(RUNSHARED) ./$(BUILDPYTHON) $$task; \ + done;; \ + *) \ diff --git a/debian/patches/pydoc-use-pager.diff b/debian/patches/pydoc-use-pager.diff index a92c245..ca2b49f 100644 --- a/debian/patches/pydoc-use-pager.diff +++ b/debian/patches/pydoc-use-pager.diff @@ -1,10 +1,8 @@ # DP: pydoc: use the pager command if available. -Index: b/Lib/pydoc.py -=================================================================== --- a/Lib/pydoc.py +++ b/Lib/pydoc.py -@@ -1446,6 +1446,8 @@ def getpager(): +@@ -1473,6 +1473,8 @@ def getpager(): return plainpager if sys.platform == 'win32': return lambda text: tempfilepager(plain(text), 'more <') diff --git a/debian/patches/pyhash.diff b/debian/patches/pyhash.diff deleted file mode 100644 index f8ecfda..0000000 --- a/debian/patches/pyhash.diff +++ /dev/null @@ -1,67 +0,0 @@ -Index: b/Python/pyhash.c -=================================================================== ---- a/Python/pyhash.c -+++ b/Python/pyhash.c -@@ -328,13 +328,14 @@ static PyHash_FuncDef PyHash_Func = {fnv - * the hash values' least significant bits. - */ - #if PY_LITTLE_ENDIAN --# define _le64toh(x) ((uint64_t)(x)) -+# define _le64toh(v, x) memcpy(&(v), &(x), sizeof(v)) - #elif defined(__APPLE__) --# define _le64toh(x) OSSwapLittleToHostInt64(x) -+# define _le64toh(v, x) v = OSSwapLittleToHostInt64(x) - #elif defined(HAVE_LETOH64) --# define _le64toh(x) le64toh(x) -+# define _le64toh(v, x) v = le64toh(x) - #else --# define _le64toh(x) (((uint64_t)(x) << 56) | \ -+# define _le64toh(v, x) v = \ -+ (((uint64_t)(x) << 56) | \ - (((uint64_t)(x) << 40) & 0xff000000000000ULL) | \ - (((uint64_t)(x) << 24) & 0xff0000000000ULL) | \ - (((uint64_t)(x) << 8) & 0xff00000000ULL) | \ -@@ -366,22 +367,24 @@ static PyHash_FuncDef PyHash_Func = {fnv - - static Py_hash_t - siphash24(const void *src, Py_ssize_t src_sz) { -- uint64_t k0 = _le64toh(_Py_HashSecret.siphash.k0); -- uint64_t k1 = _le64toh(_Py_HashSecret.siphash.k1); -+ uint64_t k0, k1, v0, v1, v2, v3; - uint64_t b = (uint64_t)src_sz << 56; - const uint64_t *in = (uint64_t*)src; - -- uint64_t v0 = k0 ^ 0x736f6d6570736575ULL; -- uint64_t v1 = k1 ^ 0x646f72616e646f6dULL; -- uint64_t v2 = k0 ^ 0x6c7967656e657261ULL; -- uint64_t v3 = k1 ^ 0x7465646279746573ULL; -- -- uint64_t t; -+ uint64_t t, t2; - uint8_t *pt; - uint8_t *m; - -+ _le64toh(k0, _Py_HashSecret.siphash.k0); -+ _le64toh(k1, _Py_HashSecret.siphash.k1); -+ v0 = k0 ^ 0x736f6d6570736575ULL; -+ v1 = k1 ^ 0x646f72616e646f6dULL; -+ v2 = k0 ^ 0x6c7967656e657261ULL; -+ v3 = k1 ^ 0x7465646279746573ULL; -+ - while (src_sz >= 8) { -- uint64_t mi = _le64toh(*in); -+ uint64_t mi; -+ _le64toh(mi, *in); - in += 1; - src_sz -= 8; - v3 ^= mi; -@@ -401,7 +404,8 @@ siphash24(const void *src, Py_ssize_t sr - case 2: pt[1] = m[1]; /* fall through */ - case 1: pt[0] = m[0]; /* fall through */ - } -- b |= _le64toh(t); -+ _le64toh(t2, t); -+ b |= t2; - - v3 ^= b; - DOUBLE_ROUND(v0,v1,v2,v3); diff --git a/debian/patches/reproducible-buildinfo.diff b/debian/patches/reproducible-buildinfo.diff index 232e43e..8ee5271 100644 --- a/debian/patches/reproducible-buildinfo.diff +++ b/debian/patches/reproducible-buildinfo.diff @@ -1,10 +1,8 @@ # DP: Build getbuildinfo.o with DATE/TIME values when defined -Index: b/Makefile.pre.in -=================================================================== --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -732,6 +732,8 @@ Modules/getbuildinfo.o: $(PARSER_OBJS) \ +@@ -766,6 +766,8 @@ Modules/getbuildinfo.o: $(PARSER_OBJS) \ -DGITVERSION="\"`LC_ALL=C $(GITVERSION)`\"" \ -DGITTAG="\"`LC_ALL=C $(GITTAG)`\"" \ -DGITBRANCH="\"`LC_ALL=C $(GITBRANCH)`\"" \ diff --git a/debian/patches/revert-profile-opt-changes.diff b/debian/patches/revert-profile-opt-changes.diff new file mode 100644 index 0000000..b66c6ce --- /dev/null +++ b/debian/patches/revert-profile-opt-changes.diff @@ -0,0 +1,189 @@ +--- a/Lib/_osx_support.py ++++ b/Lib/_osx_support.py +@@ -17,7 +17,7 @@ __all__ = [ + _UNIVERSAL_CONFIG_VARS = ('CFLAGS', 'LDFLAGS', 'CPPFLAGS', 'BASECFLAGS', + 'BLDSHARED', 'LDSHARED', 'CC', 'CXX', + 'PY_CFLAGS', 'PY_LDFLAGS', 'PY_CPPFLAGS', +- 'PY_CORE_CFLAGS', 'PY_CORE_LDFLAGS') ++ 'PY_CORE_CFLAGS') + + # configuration variables that may contain compiler calls + _COMPILER_CONFIG_VARS = ('BLDSHARED', 'LDSHARED', 'CC', 'CXX') +--- a/Lib/test/pythoninfo.py ++++ b/Lib/test/pythoninfo.py +@@ -420,10 +420,7 @@ def collect_sysconfig(info_add): + 'OPT', + 'PY_CFLAGS', + 'PY_CFLAGS_NODIST', +- 'PY_CORE_LDFLAGS', + 'PY_LDFLAGS', +- 'PY_LDFLAGS_NODIST', +- 'PY_STDMODULE_CFLAGS', + 'Py_DEBUG', + 'Py_ENABLE_SHARED', + 'SHELL', +--- a/Lib/test/test__osx_support.py ++++ b/Lib/test/test__osx_support.py +@@ -24,7 +24,7 @@ class Test_OSXSupport(unittest.TestCase) + for cv in ('CFLAGS', 'LDFLAGS', 'CPPFLAGS', + 'BASECFLAGS', 'BLDSHARED', 'LDSHARED', 'CC', + 'CXX', 'PY_CFLAGS', 'PY_LDFLAGS', 'PY_CPPFLAGS', +- 'PY_CORE_CFLAGS', 'PY_CORE_LDFLAGS'): ++ 'PY_CORE_CFLAGS'): + if cv in self.env: + self.env.unset(cv) + +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -85,10 +85,6 @@ CONFIGURE_CFLAGS= @CFLAGS@ + # Use it when a compiler flag should _not_ be part of the distutils CFLAGS + # once Python is installed (Issue #21121). + CONFIGURE_CFLAGS_NODIST=@CFLAGS_NODIST@ +-# LDFLAGS_NODIST is used in the same manner as CFLAGS_NODIST. +-# Use it when a linker flag should _not_ be part of the distutils LDFLAGS +-# once Python is installed (bpo-35257) +-CONFIGURE_LDFLAGS_NODIST=@LDFLAGS_NODIST@ + CONFIGURE_CPPFLAGS= @CPPFLAGS@ + CONFIGURE_LDFLAGS= @LDFLAGS@ + # Avoid assigning CFLAGS, LDFLAGS, etc. so users can use them on the +@@ -101,7 +97,6 @@ PY_CFLAGS_NODIST=$(CONFIGURE_CFLAGS_NODI + # environment variables + PY_CPPFLAGS= $(BASECPPFLAGS) -I. -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) $(CPPFLAGS) + PY_LDFLAGS= $(CONFIGURE_LDFLAGS) $(LDFLAGS) +-PY_LDFLAGS_NODIST=$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST) + NO_AS_NEEDED= @NO_AS_NEEDED@ + LDLAST= @LDLAST@ + SGI_ABI= @SGI_ABI@ +@@ -116,8 +111,6 @@ CFLAGSFORSHARED=@CFLAGSFORSHARED@ + PY_STDMODULE_CFLAGS= $(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) $(CFLAGSFORSHARED) + PY_BUILTIN_MODULE_CFLAGS= $(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN + PY_CORE_CFLAGS= $(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE +-# Linker flags used for building the interpreter object files +-PY_CORE_LDFLAGS=$(PY_LDFLAGS) $(PY_LDFLAGS_NODIST) + # Strict or non-strict aliasing flags used to compile dtoa.c, see above + CFLAGS_ALIASING=@CFLAGS_ALIASING@ + +@@ -157,7 +150,7 @@ CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$ + SHLIB_SUFFIX= @SHLIB_SUFFIX@ + EXT_SUFFIX= @EXT_SUFFIX@ + LDSHARED= @LDSHARED@ $(PY_LDFLAGS) +-BLDSHARED= @BLDSHARED@ $(PY_CORE_LDFLAGS) ++BLDSHARED= @BLDSHARED@ $(PY_LDFLAGS) + LDCXXSHARED= @LDCXXSHARED@ + DESTSHARED= $(BINLIBDEST)/lib-dynload + +@@ -506,7 +499,7 @@ profile-run-stamp: + touch $@ + + build_all_generate_profile: +- $(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LDFLAGS_NODIST="$(LDFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LIBS="$(LIBS)" ++ $(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS) $(PGO_PROF_GEN_FLAG)" LDFLAGS="$(LDFLAGS) $(PGO_PROF_GEN_FLAG)" LIBS="$(LIBS)" + + run_profile_task: + @ # FIXME: can't run for a cross build +@@ -520,7 +513,7 @@ build_all_merge_profile: + profile-opt: profile-run-stamp + @echo "Rebuilding with profile guided optimizations:" + -rm -f profile-clean-stamp +- $(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS_NODIST) $(PGO_PROF_USE_FLAG)" LDFLAGS_NODIST="$(LDFLAGS_NODIST)" ++ $(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS) $(PGO_PROF_USE_FLAG)" LDFLAGS="$(LDFLAGS)" + + # Compile and run with gcov + .PHONY=coverage coverage-lcov coverage-report +@@ -577,7 +570,7 @@ clinic: check-clean-src $(srcdir)/Module + + # Build the interpreter + $(BUILDPYTHON): Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) +- $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) ++ $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) + + platform: $(BUILDPYTHON) pybuilddir.txt + $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform +@@ -642,7 +635,7 @@ libpython3.so: libpython$(LDVERSION).so + $(BLDSHARED) $(NO_AS_NEEDED) -o $@ -Wl,-h$@ $^ + + libpython$(LDVERSION).dylib: $(LIBRARY_OBJS) +- $(CC) -dynamiclib -Wl,-single_module $(PY_CORE_LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(LDVERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ ++ $(CC) -dynamiclib -Wl,-single_module $(PY_LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(LDVERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ + + + libpython$(VERSION).sl: $(LIBRARY_OBJS) +@@ -667,7 +660,7 @@ $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION + $(LIBRARY) \ + $(RESSRCDIR)/Info.plist + $(INSTALL) -d -m $(DIRMODE) $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION) +- $(CC) -o $(LDLIBRARY) $(PY_CORE_LDFLAGS) -dynamiclib \ ++ $(CC) -o $(LDLIBRARY) $(PY_LDFLAGS) -dynamiclib \ + -all_load $(LIBRARY) -Wl,-single_module \ + -install_name $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK) \ + -compatibility_version $(VERSION) \ +@@ -718,7 +711,7 @@ Modules/Setup: $(srcdir)/Modules/Setup.d + fi + + Programs/_testembed: Programs/_testembed.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) +- $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) ++ $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) + + ############################################################################ + # Importlib +@@ -726,7 +719,7 @@ Programs/_testembed: Programs/_testembed + Programs/_freeze_importlib.o: Programs/_freeze_importlib.c Makefile + + Programs/_freeze_importlib: Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN) +- $(LINKCC) $(PY_CORE_LDFLAGS) -o $@ Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) ++ $(LINKCC) $(PY_LDFLAGS) -o $@ Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) + + .PHONY: regen-importlib + regen-importlib: Programs/_freeze_importlib +@@ -808,7 +801,7 @@ Python/sysmodule.o: $(srcdir)/Python/sys + $(IO_OBJS): $(IO_H) + + $(PGEN): $(PGENOBJS) +- $(CC) $(OPT) $(PY_CORE_LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN) ++ $(CC) $(OPT) $(PY_LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN) + + .PHONY: regen-grammar + regen-grammar: $(PGEN) +--- a/configure.ac ++++ b/configure.ac +@@ -1395,7 +1395,7 @@ if test "$Py_LTO" = 'true' ; then + fi + + CFLAGS_NODIST="$CFLAGS_NODIST $LTOFLAGS" +- LDFLAGS_NODIST="$LDFLAGS_NODIST $LTOFLAGS" ++ LDFLAGS="$LDFLAGS $LTOFLAGS" + fi + + # Enable PGO flags. +@@ -1555,7 +1555,6 @@ fi + + AC_SUBST(BASECFLAGS) + AC_SUBST(CFLAGS_NODIST) +-AC_SUBST(LDFLAGS_NODIST) + + # The -arch flags for universal builds on OSX + UNIVERSAL_ARCH_FLAGS= +--- a/setup.py ++++ b/setup.py +@@ -18,16 +18,11 @@ from distutils.spawn import find_executa + + cross_compiling = "_PYTHON_HOST_PLATFORM" in os.environ + +-# Set common compiler and linker flags derived from the Makefile, +-# reserved for building the interpreter and the stdlib modules. +-# See bpo-21121 and bpo-35257 +-def set_compiler_flags(compiler_flags, compiler_py_flags_nodist): +- flags = sysconfig.get_config_var(compiler_flags) +- py_flags_nodist = sysconfig.get_config_var(compiler_py_flags_nodist) +- sysconfig.get_config_vars()[compiler_flags] = flags + ' ' + py_flags_nodist +- +-set_compiler_flags('CFLAGS', 'PY_CFLAGS_NODIST') +-set_compiler_flags('LDFLAGS', 'PY_LDFLAGS_NODIST') ++# Add special CFLAGS reserved for building the interpreter and the stdlib ++# modules (Issue #21121). ++cflags = sysconfig.get_config_var('CFLAGS') ++py_cflags_nodist = sysconfig.get_config_var('PY_CFLAGS_NODIST') ++sysconfig.get_config_vars()['CFLAGS'] = cflags + ' ' + py_cflags_nodist + + class Dummy: + """Hack for parallel build""" diff --git a/debian/patches/series b/debian/patches/series index 9eed915..1da427a 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,10 +1,12 @@ # git-updates.diff +revert-profile-opt-changes.diff deb-setup.diff deb-locations.diff distutils-install-layout.diff locale-module.diff distutils-link.diff distutils-sysconfig.diff +#sysconfig-debian-schemes.diff tkinter-import.diff gdbm-import.diff link-opt.diff @@ -30,5 +32,8 @@ ensurepip-disabled.diff mangle-fstack-protector.diff reproducible-buildinfo.diff pydoc-use-pager.diff -pyhash.diff -update-tls-protocol.diff +local-doc-references.diff +doc-build-texinfo.diff +build-math-object.diff +issue35998.diff +arm-alignment.diff diff --git a/debian/patches/setup-modules.diff b/debian/patches/setup-modules.diff index 8c10c06..6f80339 100644 --- a/debian/patches/setup-modules.diff +++ b/debian/patches/setup-modules.diff @@ -1,10 +1,8 @@ # DP: Modules/Setup.dist: patches to build some extensions statically -Index: b/Modules/Setup.dist -=================================================================== --- a/Modules/Setup.dist +++ b/Modules/Setup.dist -@@ -176,7 +176,7 @@ _symtable symtablemodule.c +@@ -178,7 +178,7 @@ _symtable symtablemodule.c #_weakref _weakref.c # basic weak reference support #_testcapi _testcapimodule.c # Python C API test module #_random _randommodule.c # Random number generator @@ -13,7 +11,7 @@ Index: b/Modules/Setup.dist #_pickle _pickle.c # pickle accelerator #_datetime _datetimemodule.c # datetime accelerator #_bisect _bisectmodule.c # Bisection algorithms -@@ -206,10 +206,7 @@ _symtable symtablemodule.c +@@ -208,10 +208,7 @@ _symtable symtablemodule.c # Socket module helper for SSL support; you must comment out the other # socket line above, and possibly edit the SSL variable: @@ -33,19 +31,19 @@ Index: b/Modules/Setup.dist # The _sha module implements the SHA checksum algorithms. # (NIST's Secure Hash Algorithms.) -@@ -342,6 +340,7 @@ _symtable symtablemodule.c +@@ -331,6 +329,7 @@ _symtable symtablemodule.c # Fred Drake's interface to the Python parser #parser parsermodule.c +#_ctypes _ctypes/_ctypes.c _ctypes/callbacks.c _ctypes/callproc.c _ctypes/stgdict.c _ctypes/cfield.c _ctypes/malloc_closure.c -lffi - # Lee Busby's SIGFPE modules. - # The library to link fpectl with is platform specific. -@@ -376,7 +375,7 @@ _symtable symtablemodule.c - # + # Andrew Kuchling's zlib module. + # This require zlib 1.1.3 (or later). +@@ -340,7 +339,7 @@ _symtable symtablemodule.c + # Interface to the Expat XML parser # More information on Expat can be found at www.libexpat.org. # --#pyexpat expat/xmlparse.c expat/xmlrole.c expat/xmltok.c pyexpat.c -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI +-#pyexpat expat/xmlparse.c expat/xmlrole.c expat/xmltok.c pyexpat.c -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DXML_POOR_ENTROPY -DUSE_PYEXPAT_CAPI +#pyexpat pyexpat.c -lexpat # Hye-Shik Chang's CJKCodecs diff --git a/debian/patches/sysconfig-debian-schemes.diff b/debian/patches/sysconfig-debian-schemes.diff index d26ee20..07eb5bf 100644 --- a/debian/patches/sysconfig-debian-schemes.diff +++ b/debian/patches/sysconfig-debian-schemes.diff @@ -1,8 +1,10 @@ # DP: Add schemes 'deb_system' and 'posix_local', make the latter the default +Index: b/Lib/sysconfig.py +=================================================================== --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py -@@ -32,6 +32,30 @@ +@@ -31,6 +31,30 @@ _INSTALL_SCHEMES = { 'scripts': '{base}/bin', 'data': '{base}', }, @@ -33,7 +35,7 @@ 'posix_home': { 'stdlib': '{installed_base}/lib/python', 'platstdlib': '{base}/lib/python', -@@ -162,7 +186,7 @@ +@@ -136,7 +160,7 @@ def is_python_build(check_home=False): _PYTHON_BUILD = is_python_build(True) if _PYTHON_BUILD: @@ -42,7 +44,7 @@ _INSTALL_SCHEMES[scheme]['include'] = '{srcdir}/Include' _INSTALL_SCHEMES[scheme]['platinclude'] = '{projectbase}/.' -@@ -200,7 +224,12 @@ +@@ -174,7 +198,16 @@ def _expand_vars(scheme, vars): def _get_default_scheme(): if os.name == 'posix': # the default scheme for posix is posix_prefix @@ -51,12 +53,16 @@ + # virtual environments + return 'posix_prefix' + else: -+ # Debian default -+ return 'posix_local' ++ # default to /usr for package builds, /usr/local otherwise ++ deb_build = os.environ.get('DEB_PYTHON_INSTALL_LAYOUT', 'posix_local') ++ if deb_build in ('deb', 'deb_system'): ++ return 'deb_system' ++ else: ++ return 'posix_local' return os.name -@@ -485,7 +514,7 @@ +@@ -472,7 +505,7 @@ def get_config_h_filename(): else: inc_dir = _sys_home or _PROJECT_BASE else: @@ -65,3 +71,18 @@ return os.path.join(inc_dir, 'pyconfig.h') +Index: b/Lib/test/test_sysconfig.py +=================================================================== +--- a/Lib/test/test_sysconfig.py ++++ b/Lib/test/test_sysconfig.py +@@ -227,8 +227,8 @@ class TestSysConfig(unittest.TestCase): + self.assertTrue(os.path.isfile(config_h), config_h) + + def test_get_scheme_names(self): +- wanted = ('nt', 'nt_user', 'osx_framework_user', +- 'posix_home', 'posix_prefix', 'posix_user') ++ wanted = ('deb_system', 'nt', 'nt_user', 'osx_framework_user', ++ 'posix_home', 'posix_local', 'posix_prefix', 'posix_user') + self.assertEqual(get_scheme_names(), wanted) + + @skip_unless_symlink diff --git a/debian/patches/tempfile-minimal.diff b/debian/patches/tempfile-minimal.diff index 64f83fc..8aeb75d 100644 --- a/debian/patches/tempfile-minimal.diff +++ b/debian/patches/tempfile-minimal.diff @@ -152,7 +152,7 @@ Index: b/Lib/tempfile.py import errno as _errno from random import Random as _Random import weakref as _weakref -@@ -794,7 +933,7 @@ class TemporaryDirectory(object): +@@ -792,7 +931,7 @@ class TemporaryDirectory(object): @classmethod def _cleanup(cls, name, warn_message): @@ -161,7 +161,7 @@ Index: b/Lib/tempfile.py _warnings.warn(warn_message, ResourceWarning) def __repr__(self): -@@ -808,4 +947,4 @@ class TemporaryDirectory(object): +@@ -806,4 +945,4 @@ class TemporaryDirectory(object): def cleanup(self): if self._finalizer.detach(): diff --git a/debian/patches/test-no-random-order.diff b/debian/patches/test-no-random-order.diff index 1c98695..b21e76d 100644 --- a/debian/patches/test-no-random-order.diff +++ b/debian/patches/test-no-random-order.diff @@ -4,8 +4,8 @@ Index: b/Tools/scripts/run_tests.py =================================================================== --- a/Tools/scripts/run_tests.py +++ b/Tools/scripts/run_tests.py -@@ -37,7 +37,6 @@ def main(regrtest_args): - args.extend(['-W', 'error::BytesWarning']) +@@ -31,7 +31,6 @@ def main(regrtest_args): + args.extend(test.support.args_from_interpreter_flags()) args.extend(['-m', 'test', # Run the test suite - '-r', # Randomize test order diff --git a/debian/patches/update-tls-protocol.diff b/debian/patches/update-tls-protocol.diff deleted file mode 100644 index 4548a4a..0000000 --- a/debian/patches/update-tls-protocol.diff +++ /dev/null @@ -1,79 +0,0 @@ -Index: b/Lib/test/test_ftplib.py -=================================================================== ---- a/Lib/test/test_ftplib.py -+++ b/Lib/test/test_ftplib.py -@@ -912,7 +912,7 @@ class TestTLS_FTPClass(TestCase): - - def test_context(self): - self.client.quit() -- ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1) -+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2) - self.assertRaises(ValueError, ftplib.FTP_TLS, keyfile=CERTFILE, - context=ctx) - self.assertRaises(ValueError, ftplib.FTP_TLS, certfile=CERTFILE, -@@ -941,7 +941,7 @@ class TestTLS_FTPClass(TestCase): - - def test_check_hostname(self): - self.client.quit() -- ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1) -+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2) - ctx.verify_mode = ssl.CERT_REQUIRED - ctx.check_hostname = True - ctx.load_verify_locations(CAFILE) -Index: b/Lib/test/test_httplib.py -=================================================================== ---- a/Lib/test/test_httplib.py -+++ b/Lib/test/test_httplib.py -@@ -1620,7 +1620,7 @@ class HTTPSTest(TestCase): - # The (valid) cert validates the HTTP hostname - import ssl - server = self.make_server(CERT_localhost) -- context = ssl.SSLContext(ssl.PROTOCOL_TLSv1) -+ context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2) - context.verify_mode = ssl.CERT_REQUIRED - context.load_verify_locations(CERT_localhost) - h = client.HTTPSConnection('localhost', server.port, context=context) -@@ -1634,7 +1634,7 @@ class HTTPSTest(TestCase): - # The (valid) cert doesn't validate the HTTP hostname - import ssl - server = self.make_server(CERT_fakehostname) -- context = ssl.SSLContext(ssl.PROTOCOL_TLSv1) -+ context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2) - context.verify_mode = ssl.CERT_REQUIRED - context.check_hostname = True - context.load_verify_locations(CERT_fakehostname) -Index: b/Lib/test/test_poplib.py -=================================================================== ---- a/Lib/test/test_poplib.py -+++ b/Lib/test/test_poplib.py -@@ -352,7 +352,7 @@ class TestPOP3Class(TestCase): - @requires_ssl - def test_stls_context(self): - expected = b'+OK Begin TLS negotiation' -- ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1) -+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2) - ctx.load_verify_locations(CAFILE) - ctx.verify_mode = ssl.CERT_REQUIRED - ctx.check_hostname = True -@@ -392,7 +392,7 @@ class TestPOP3_SSLClass(TestPOP3Class): - self.assertIn('POP3_SSL', poplib.__all__) - - def test_context(self): -- ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1) -+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2) - self.assertRaises(ValueError, poplib.POP3_SSL, self.server.host, - self.server.port, keyfile=CERTFILE, context=ctx) - self.assertRaises(ValueError, poplib.POP3_SSL, self.server.host, -Index: b/Lib/test/test_urllib2_localnet.py -=================================================================== ---- a/Lib/test/test_urllib2_localnet.py -+++ b/Lib/test/test_urllib2_localnet.py -@@ -598,7 +598,7 @@ class TestUrlopen(unittest.TestCase): - def cb_sni(ssl_sock, server_name, initial_context): - nonlocal sni_name - sni_name = server_name -- context = ssl.SSLContext(ssl.PROTOCOL_TLSv1) -+ context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2) - context.set_servername_callback(cb_sni) - handler = self.start_https_server(context=context, certfile=CERT_localhost) - context = ssl.create_default_context(cafile=CERT_localhost) diff --git a/debian/patches/update-tls-protocol2.diff b/debian/patches/update-tls-protocol2.diff deleted file mode 100644 index 7dbe9d8..0000000 --- a/debian/patches/update-tls-protocol2.diff +++ /dev/null @@ -1,98 +0,0 @@ -# Don't apply yet, still test failures .. - -Index: b/Lib/test/test_ssl.py -=================================================================== ---- a/Lib/test/test_ssl.py -+++ b/Lib/test/test_ssl.py -@@ -147,7 +147,7 @@ def skip_if_broken_ubuntu_ssl(func): - needs_sni = unittest.skipUnless(ssl.HAS_SNI, "SNI support needed for this test") - - --def test_wrap_socket(sock, ssl_version=ssl.PROTOCOL_TLS, *, -+def test_wrap_socket(sock, ssl_version=ssl.PROTOCOL_TLSv1_2, *, - cert_reqs=ssl.CERT_NONE, ca_certs=None, - ciphers=None, certfile=None, keyfile=None, - **kwargs): -@@ -883,7 +883,7 @@ class ContextTests(unittest.TestCase): - self.assertEqual(ctx.protocol, proto) - - def test_ciphers(self): -- ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1) -+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2) - ctx.set_ciphers("ALL") - ctx.set_ciphers("DEFAULT") - with self.assertRaisesRegex(ssl.SSLError, "No cipher can be selected"): -@@ -1542,7 +1542,7 @@ class SimpleBackgroundTests(unittest.Tes - - def test_connect_with_context(self): - # Same as test_connect, but with a separately created context -- ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23) -+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2) - with ctx.wrap_socket(socket.socket(socket.AF_INET)) as s: - s.connect(self.server_addr) - self.assertEqual({}, s.getpeercert()) -@@ -1562,7 +1562,7 @@ class SimpleBackgroundTests(unittest.Tes - # This should fail because we have no verification certs. Connection - # failure crashes ThreadedEchoServer, so run this in an independent - # test method. -- ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23) -+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2) - ctx.verify_mode = ssl.CERT_REQUIRED - s = ctx.wrap_socket(socket.socket(socket.AF_INET)) - self.addCleanup(s.close) -@@ -1595,7 +1595,7 @@ class SimpleBackgroundTests(unittest.Tes - with open(SIGNING_CA) as f: - pem = f.read() - der = ssl.PEM_cert_to_DER_cert(pem) -- ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23) -+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2) - ctx.verify_mode = ssl.CERT_REQUIRED - ctx.load_verify_locations(cadata=pem) - with ctx.wrap_socket(socket.socket(socket.AF_INET)) as s: -@@ -1604,7 +1604,7 @@ class SimpleBackgroundTests(unittest.Tes - self.assertTrue(cert) - - # same with DER -- ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23) -+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2) - ctx.verify_mode = ssl.CERT_REQUIRED - ctx.load_verify_locations(cadata=der) - with ctx.wrap_socket(socket.socket(socket.AF_INET)) as s: -@@ -1676,7 +1676,7 @@ class SimpleBackgroundTests(unittest.Tes - - def test_get_ca_certs_capath(self): - # capath certs are loaded on request -- ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23) -+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2) - ctx.verify_mode = ssl.CERT_REQUIRED - ctx.load_verify_locations(capath=CAPATH) - self.assertEqual(ctx.get_ca_certs(), []) -@@ -1689,8 +1689,8 @@ class SimpleBackgroundTests(unittest.Tes - @needs_sni - def test_context_setget(self): - # Check that the context of a connected socket can be replaced. -- ctx1 = ssl.SSLContext(ssl.PROTOCOL_TLSv1) -- ctx2 = ssl.SSLContext(ssl.PROTOCOL_SSLv23) -+ ctx1 = ssl.SSLContext(ssl.PROTOCOL_TLSv1_1) -+ ctx2 = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2) - s = socket.socket(socket.AF_INET) - with ctx1.wrap_socket(s) as ss: - ss.connect(self.server_addr) -@@ -1740,7 +1740,7 @@ class SimpleBackgroundTests(unittest.Tes - sock.connect(self.server_addr) - incoming = ssl.MemoryBIO() - outgoing = ssl.MemoryBIO() -- ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23) -+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2) - ctx.verify_mode = ssl.CERT_REQUIRED - ctx.load_verify_locations(SIGNING_CA) - ctx.check_hostname = True -@@ -1773,7 +1773,7 @@ class SimpleBackgroundTests(unittest.Tes - sock.connect(self.server_addr) - incoming = ssl.MemoryBIO() - outgoing = ssl.MemoryBIO() -- ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23) -+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2) - ctx.verify_mode = ssl.CERT_NONE - sslobj = ctx.wrap_bio(incoming, outgoing, False) - self.ssl_io_loop(sock, incoming, outgoing, sslobj.do_handshake) |