diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2014-12-15 11:49:59 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2014-12-15 11:49:59 +0300 |
commit | 4bc27c30adefff9b58353d26b5605a5e362c5101 (patch) | |
tree | 0125fbf075f68247ad6616d195c8eb12b8e80efc | |
parent | 6a211b11d6c85cc78798178294e54b07d54509ba (diff) | |
download | python2.7-4bc27c30adefff9b58353d26b5605a5e362c5101.tar.gz |
Imported python2.7 (2.7.9-1)debian/2.7.9-1
41 files changed, 536 insertions, 438 deletions
diff --git a/debian/PVER-minimal.README.Debian.in b/debian/PVER-minimal.README.Debian.in index 8504234..6fadf10 100644 --- a/debian/PVER-minimal.README.Debian.in +++ b/debian/PVER-minimal.README.Debian.in @@ -47,12 +47,16 @@ are: binascii extension bisect module cmath extension + calendar module codecs module collections module compileall module + contextlib module copy module copy_reg module + datetime extension dis module + encodings package errno builtin exceptions builtin fcntl extension @@ -71,6 +75,7 @@ are: itertools extension keyword module linecache module + locale module logging package marshal builtin math extension diff --git a/debian/changelog b/debian/changelog index b69ef96..a5c46be 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,133 @@ +python2.7 (2.7.9-1) unstable; urgency=medium + + * Python 2.7.9 release. + + -- Matthias Klose <doko@debian.org> Thu, 11 Dec 2014 00:38:09 +0100 + +python2.7 (2.7.9~rc1-2) unstable; urgency=medium + + * Update to 20141209, taken from the 2.7 release repository. + - Issue #22959: Remove the *check_hostname* parameter of + httplib.HTTPSConnection. The *context* parameter should be used instead. + - Issue #16043: Add a default limit for the amount of data + xmlrpclib.gzip_decode will return. This resolves CVE-2013-1753. + Closes: #742929. + - Issue #16042: CVE-2013-1752: smtplib: Limit amount of data read by + limiting the call to readline(). Closes: #742929. + - Issue #16041: In poplib, limit maximum line length read from the server + to prevent CVE-2013-1752. Closes: #742929. + - Issue #22960: Add a context argument to xmlrpclib.ServerProxy. + - Issue #22935: Allow the ssl module to be compiled if openssl + doesn't support SSL 3. + * Add locales to autopkg test dependencies as in 3.4. + * Remove Demo/scripts/newslist.* from the examples package, not + distributable, will get removed in 2.7.9~rc2 sources. See issue #12987. + * Let ensurepip always use a temporary directory for installations. + + -- Matthias Klose <doko@debian.org> Tue, 09 Dec 2014 15:47:40 +0100 + +python2.7 (2.7.9~rc1-1) unstable; urgency=medium + + * Python 2.7.9 release candidate 1. + - Testsuite updates. + - Issue #16056: Rename test methods to avoid conflict. + - Issue #20351: Add examples for csv.DictReader and csv.DictWriter. + - PEP 476: verify certificates by default (#22417). + - Give urllib.urlopen a context parameter (closes #22927). + - Allow hostname to be passed to SSLContext even if OpenSSL doesn't + support SNI (closes #22921). + - Allow passing cert/ssl information to urllib2.urlopen and + httplib.HTTPSConnection (backport of issues #9003 and #22366). + * Let libpython2.7-stdlib break python-urllib3 (<< 1.9.1-3). Closes: #770157. + * Ignore the test_threading_local test failure in the Debian CI environment. + Succeeds even there when repeated. + * Don't pass default compiler search directories in the pkgconfig file. + Closes: #770935. + + -- Matthias Klose <doko@debian.org> Wed, 26 Nov 2014 21:01:48 +0100 + +python2.7 (2.7.8-12) unstable; urgency=medium + + * Update to 20141118, taken from the 2.7 branch. + - Issue #12728: Different Unicode characters having the same uppercase + but different lowercase are now matched in case-insensitive regular + expressions. + - Issue #22821: Fixed fcntl() with integer argument on 64-bit big-endian + platforms. + - Issues #814253, #9179: Group references and conditional group references + now work in lookbehind assertions in regular expressions. + - Issue #22769: Fixed ttk.Treeview.tag_has() when called without arguments. + - Issue #22787: Allow the keyfile argument of SSLContext.load_cert_chain + to be None. + - Issue #22775: Fixed unpickling of Cookie.SimpleCookie with protocol 2. + - Issue #22776: Brought excluded code into the scope of a try block in + SysLogHandler.emit(). + - Issue #17381: Fixed ranges handling in case-insensitive regular + expressions. + - Issue #19329: Optimized compiling charsets in regular expressions. + - Issue #22410: Module level functions in the re module now cache compiled + locale-dependent regular expressions taking into account the locale. + - Issue #8876: distutils now falls back to copying files when hard linking + doesn't work. This allows use with special filesystems such as + VirtualBox shared folders. + - Issue #22193: Fixed integer overflow error in sys.getsizeof(). + * Backport the ensurepip patch from 3.4. + * Disable ensurepip in Debian, at least for the upcoming release. + * Fix maintainer scripts for byte-code removal. Closes: #769078. + * Allow building and testing without SSLv3 support (Kurt Roeckx). + Closes: #768611. + * Let distutils.sysconfig.get_python_inc() honor the "prefix" argument. + Closes: #769720. + + -- Matthias Klose <doko@debian.org> Tue, 18 Nov 2014 11:37:13 +0100 + +python2.7 (2.7.8-11) unstable; urgency=medium + + * Update to 20141018, taken from the 2.7 branch. + - Issue #9351: Defaults set with set_defaults on an argparse subparser + are no longer ignored when also set on the parent parser. + - Issue #20421: Add a .version() method to SSL sockets exposing the actual + protocol version in use. + - Issue #22435: Fix a file descriptor leak when SocketServer bind fails. + - Issue #13664: GzipFile now supports non-ascii Unicode filenames. + - Issue #13096: Fixed segfault in CTypes POINTER handling of large + values. + - Issue #11694: Raise ConversionError in xdrlib as documented. + - Issue #10712: 2to3 has a new "asserts" fixer that replaces deprecated names + of unittest methods (e.g. failUnlessEqual -> assertEqual). + * Pass -ffat-lto-objects for LTO enabled builds with GCC 4.9. + + -- Matthias Klose <doko@debian.org> Sat, 18 Oct 2014 14:14:19 +0200 + +python2.7 (2.7.8-10) unstable; urgency=medium + + * Update to 20141007, taken from the 2.7 branch. + + -- Matthias Klose <doko@debian.org> Tue, 07 Oct 2014 19:42:51 +0200 + +python2.7 (2.7.8-9) unstable; urgency=medium + + * Fix refcounting error in the fix for issue #22523. Closes: #762010. + + -- Matthias Klose <doko@debian.org> Thu, 02 Oct 2014 13:49:07 +0200 + +python2.7 (2.7.8-8) unstable; urgency=medium + + * Update to 20141002, taken from the 2.7 branch. + * Refresh patches. + * Apply proposed patch for issue #22523. Closes: #762010. + + -- Matthias Klose <doko@debian.org> Thu, 02 Oct 2014 02:13:37 +0200 + +python2.7 (2.7.8-7) unstable; urgency=medium + + * Update to 20140909, taken from the 2.7 branch. + * debian/tests/testsuite{,-dbg}: Several tests fail with configured proxy + and disabled network test resources. Explicitly unset proxy variables. + See issue #22371. + + -- Matthias Klose <doko@debian.org> Tue, 09 Sep 2014 22:02:11 +0200 + python2.7 (2.7.8-6) unstable; urgency=medium * distuils: For extension builds, always pass BASECFLAGS. diff --git a/debian/control b/debian/control index 07409ca..baa8929 100644 --- a/debian/control +++ b/debian/control @@ -3,9 +3,10 @@ Section: python Priority: optional Maintainer: Matthias Klose <doko@debian.org> Build-Depends: debhelper (>= 5), dpkg-dev (>= 1.17.11), + gcc (>= 4:4.9.2), quilt, autoconf, autotools-dev, lsb-release, sharutils, - libreadline-dev, libtinfo-dev, libncursesw5-dev (>= 5.3), gcc (>= 4:4.9.1-1~), + libreadline-dev, libtinfo-dev, libncursesw5-dev (>= 5.3), gcc (>= 4:4.9.2-1~), gcc-4.9 (>= 4.9.2-7), tk-dev, blt-dev (>= 2.4z), libssl-dev, zlib1g-dev, libbz2-dev, libexpat1-dev, @@ -17,8 +18,11 @@ Build-Depends: debhelper (>= 5), dpkg-dev (>= 1.17.11), libdb-dev (<< 1:6.0), libgdbm-dev, python:any, help2man, xvfb, xauth Build-Depends-Indep: python-sphinx -Build-Conflicts: tcl8.4-dev, tk8.4-dev, python2.7-xml, python-xml, autoconf2.13, python-cxx-dev -Standards-Version: 3.9.5 +Build-Conflicts: tcl8.4-dev, tk8.4-dev, + python2.7-xml, python-xml, + autoconf2.13, python-cxx-dev, + hardening-wrapper +Standards-Version: 3.9.6 Vcs-Browser: https://code.launchpad.net/~doko/python/pkg2.7-debian Vcs-Bzr: http://bazaar.launchpad.net/~doko/python/pkg2.7-debian XS-Testsuite: autopkgtest @@ -44,6 +48,7 @@ Priority: standard Depends: libpython2.7-minimal (= ${binary:Version}), mime-support, ${shlibs:Depends}, ${misc:Depends} Provides: python2.7-cjkcodecs, python2.7-ctypes, python2.7-elementtree, python2.7-celementtree, python2.7-wsgiref, python2.7-profiler, python2.7-argparse, python-argparse Replaces: python2.7 (<< 2.7.5-0~) +Breaks: python-urllib3 (<< 1.9.1-3) Description: Interactive high-level object-oriented language (standard library, version 2.7) Python is a high-level, interactive, object-oriented language. Its 2.7 version includes an extensive class library with lots of goodies for @@ -60,7 +65,7 @@ Pre-Depends: ${shlibs:Pre-Depends} Depends: libpython2.7-minimal (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} Recommends: python2.7 Suggests: binfmt-support -Replaces: python2.7 (<< 2.7.1~rc1-2~) +Replaces: python2.7 (<< 2.7.8-7~) Conflicts: binfmt-support (<< 1.1.2) Description: Minimal subset of the Python language (version 2.7) This package contains the interpreter and some essential modules. It can @@ -74,7 +79,7 @@ Multi-Arch: same Priority: standard Depends: ${shlibs:Depends}, ${misc:Depends} Recommends: libpython2.7-stdlib -Replaces: python2.7 (<< 2.7.4-2), python2.7-minimal (<< 2.7.3-10), libpython2.7-stdlib (<< 2.7.4-2) +Replaces: python2.7 (<< 2.7.4-2), python2.7-minimal (<< 2.7.3-10), libpython2.7-stdlib (<< 2.7.8-7) Breaks: python2.7-minimal (<< 2.7.4~rc1-1~) Conflicts: binfmt-support (<< 1.1.2) Description: Minimal subset of the Python language (version 2.7) diff --git a/debian/control.in b/debian/control.in index 4192fcb..27ecc31 100644 --- a/debian/control.in +++ b/debian/control.in @@ -3,6 +3,7 @@ Section: python Priority: optional Maintainer: Matthias Klose <doko@debian.org> Build-Depends: debhelper (>= 5), @bd_dpkgdev@ + gcc (>= 4:4.9.2), quilt, autoconf, autotools-dev, lsb-release, sharutils, libreadline-dev, libtinfo-dev, libncursesw5-dev (>= 5.3), @bd_gcc@ @@ -17,8 +18,11 @@ Build-Depends: debhelper (>= 5), @bd_dpkgdev@ libdb-dev (<< 1:6.0), libgdbm-dev, python@bd_qual@, help2man, xvfb, xauth Build-Depends-Indep: python-sphinx -Build-Conflicts: tcl8.4-dev, tk8.4-dev, @PVER@-xml, python-xml, autoconf2.13, python-cxx-dev -Standards-Version: 3.9.5 +Build-Conflicts: tcl8.4-dev, tk8.4-dev, + @PVER@-xml, python-xml, + autoconf2.13, python-cxx-dev, + hardening-wrapper +Standards-Version: 3.9.6 Vcs-Browser: https://code.launchpad.net/~doko/python/pkg@VER@-debian Vcs-Bzr: http://bazaar.launchpad.net/~doko/python/pkg@VER@-debian XS-Testsuite: autopkgtest @@ -44,6 +48,7 @@ Priority: @PRIO@ Depends: lib@PVER@-minimal (= ${binary:Version}), mime-support, ${shlibs:Depends}, ${misc:Depends} Provides: @PVER@-cjkcodecs, @PVER@-ctypes, @PVER@-elementtree, @PVER@-celementtree, @PVER@-wsgiref, @PVER@-profiler, @PVER@-argparse, python-argparse Replaces: @PVER@ (<< 2.7.5-0~) +Breaks: python-urllib3 (<< 1.9.1-3) Description: Interactive high-level object-oriented language (standard library, version @VER@) Python is a high-level, interactive, object-oriented language. Its @VER@ version includes an extensive class library with lots of goodies for @@ -60,7 +65,7 @@ Pre-Depends: ${shlibs:Pre-Depends} Depends: lib@PVER@-minimal (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} Recommends: @PVER@ Suggests: binfmt-support -Replaces: @PVER@ (<< 2.7.1~rc1-2~) +Replaces: @PVER@ (<< 2.7.8-7~) Conflicts: binfmt-support (<< 1.1.2) Description: Minimal subset of the Python language (version @VER@) This package contains the interpreter and some essential modules. It can @@ -74,7 +79,7 @@ Multi-Arch: same Priority: @MINPRIO@ Depends: ${shlibs:Depends}, ${misc:Depends} Recommends: lib@PVER@-stdlib -Replaces: @PVER@ (<< 2.7.4-2), @PVER@-minimal (<< 2.7.3-10), lib@PVER@-stdlib (<< 2.7.4-2) +Replaces: @PVER@ (<< 2.7.4-2), @PVER@-minimal (<< 2.7.3-10), lib@PVER@-stdlib (<< 2.7.8-7) Breaks: @PVER@-minimal (<< 2.7.4~rc1-1~) Conflicts: binfmt-support (<< 1.1.2) Description: Minimal subset of the Python language (version @VER@) diff --git a/debian/libPVER-minimal.postrm.in b/debian/libPVER-minimal.postrm.in index 9d8d891..5a0bff0 100644 --- a/debian/libPVER-minimal.postrm.in +++ b/debian/libPVER-minimal.postrm.in @@ -3,7 +3,7 @@ set -e if [ "$1" = "remove" ]; then - pc=$(dpkg-query -f '${db:Status-Abbrev} ${binary:Package}\n' -W pkgname \ + pc=$(dpkg-query -f '${db:Status-Abbrev} ${binary:Package}\n' -W lib@PVER@-minimal \ | grep -v '^.n' | wc -l) if [ "$pc" -le 1 ]; then find /usr/lib/@PVER@ -name '*.py[co]' -print0 | xargs -r0 rm -f @@ -11,7 +11,7 @@ if [ "$1" = "remove" ]; then fi if [ "$1" = "purge" ]; then - pc=$(dpkg-query -f '${db:Status-Abbrev} ${binary:Package}\n' -W pkgname \ + pc=$(dpkg-query -f '${db:Status-Abbrev} ${binary:Package}\n' -W lib@PVER@-minimal \ | grep -v '^.n' | wc -l) if [ "$pc" -le 1 ]; then rm -f /etc/@PVER@/site.py /etc/@PVER@/sitecustomize.py diff --git a/debian/libPVER-minimal.prerm.in b/debian/libPVER-minimal.prerm.in index ebf2734..6dd3faf 100644 --- a/debian/libPVER-minimal.prerm.in +++ b/debian/libPVER-minimal.prerm.in @@ -12,7 +12,7 @@ remove_bytecode() case "$1" in remove) - pc=$(dpkg-query -f '${db:Status-Abbrev} ${binary:Package}\n' -W pkgname \ + pc=$(dpkg-query -f '${db:Status-Abbrev} ${binary:Package}\n' -W lib@PVER@-minimal \ | grep -v '^.n' | wc -l) if [ "$pc" -le 1 ]; then remove_bytecode lib@PVER@-minimal@HOST_QUAL@ diff --git a/debian/libPVER-stdlib.prerm.in b/debian/libPVER-stdlib.prerm.in index bde86dc..33ffbce 100644 --- a/debian/libPVER-stdlib.prerm.in +++ b/debian/libPVER-stdlib.prerm.in @@ -12,7 +12,7 @@ remove_bytecode() case "$1" in remove) - pc=$(dpkg-query -f '${db:Status-Abbrev} ${binary:Package}\n' -W pkgname \ + pc=$(dpkg-query -f '${db:Status-Abbrev} ${binary:Package}\n' -W lib@PVER@-stdlib \ | grep -v '^.n' | wc -l) if [ "$pc" -le 1 ]; then remove_bytecode lib@PVER@-stdlib@HOST_QUAL@ diff --git a/debian/libpython.symbols.in b/debian/libpython.symbols.in index 30f2744..8c0ea6d 100644 --- a/debian/libpython.symbols.in +++ b/debian/libpython.symbols.in @@ -1055,6 +1055,7 @@ _PyObject_Str@Base @VER@ _PyParser_Grammar@Base @VER@ _PyParser_TokenNames@Base @VER@ + _PyRandom_Fini@Base @VER@ _PyRandom_Init@Base @VER@ _PySequence_IterSearch@Base @VER@ _PySet_Next@Base @VER@ @@ -1066,6 +1067,7 @@ _PyString_InsertThousandsGrouping@Base @VER@ _PyString_Join@Base @VER@ _PyString_Resize@Base @VER@ + _PySys_GetSizeOf@Base @VER@ _PySys_Init@Base @VER@ _PyThreadState_Current@Base @VER@ _PyThreadState_GetFrame@Base @VER@ @@ -1314,6 +1316,7 @@ (optional)initcPickle@Base @VER@ (optional)initcStringIO@Base @VER@ (optional)initcmath@Base @VER@ + (optional)initdatetime@Base @VER@ (optional)initerrno@Base @VER@ (optional)initfcntl@Base @VER@ (optional)initgc@Base @VER@ diff --git a/debian/patches/add-python-config-sh.diff b/debian/patches/add-python-config-sh.diff index 5212ca2..43a0760 100644 --- a/debian/patches/add-python-config-sh.diff +++ b/debian/patches/add-python-config-sh.diff @@ -2,7 +2,7 @@ Index: b/Makefile.pre.in =================================================================== --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -1068,6 +1068,8 @@ python-config: $(srcdir)/Misc/python-con +@@ -1078,6 +1078,8 @@ python-config: $(srcdir)/Misc/python-con # Substitution happens here, as the completely-expanded BINDIR # is not available in configure sed -e "s,@EXENAME@,$(BINDIR)/python$(VERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config @@ -11,7 +11,7 @@ Index: b/Makefile.pre.in # Install the include files INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY) -@@ -1127,6 +1129,7 @@ libainstall: all python-config +@@ -1137,6 +1139,7 @@ libainstall: all python-config $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh $(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(VERSION)-config rm python-config @@ -23,7 +23,7 @@ Index: b/Misc/python-config.in =================================================================== --- a/Misc/python-config.in +++ b/Misc/python-config.in -@@ -55,3 +55,11 @@ for opt in opt_flags: +@@ -56,3 +56,11 @@ for opt in opt_flags: libs.extend(getvar('LINKFORSHARED').split()) print ' '.join(libs) @@ -78,7 +78,7 @@ Index: b/Misc/python-config.sh.in +SYSLIBS="$LIBM $LIBC" +ABIFLAGS="@DEBUG_EXT@" +MULTIARCH="@MULTIARCH@" -+LIBS="@LIBS@ $SYSLIBS -lpython${VERSION}${ABIFLAGS}" ++LIBS="-lpython${VERSION}${ABIFLAGS} @LIBS@ $SYSLIBS" +BASECFLAGS="@BASECFLAGS@" +LDLIBRARY="@LDLIBRARY@" +LINKFORSHARED="@LINKFORSHARED@" @@ -147,7 +147,7 @@ Index: b/configure.ac =================================================================== --- a/configure.ac +++ b/configure.ac -@@ -870,6 +870,7 @@ fi +@@ -873,6 +873,7 @@ fi # Other platforms follow if test $enable_shared = "yes"; then @@ -155,7 +155,7 @@ Index: b/configure.ac AC_DEFINE(Py_ENABLE_SHARED, 1, [Defined if Python is built as a shared library.]) case $ac_sys_system in BeOS*) -@@ -930,6 +931,7 @@ if test $enable_shared = "yes"; then +@@ -933,6 +934,7 @@ if test $enable_shared = "yes"; then esac else # shared is disabled @@ -163,7 +163,7 @@ Index: b/configure.ac case $ac_sys_system in CYGWIN*) BLDLIBRARY='$(LIBRARY)' -@@ -937,6 +939,7 @@ else # shared is disabled +@@ -940,6 +942,7 @@ else # shared is disabled ;; esac fi @@ -171,7 +171,7 @@ Index: b/configure.ac if test "$cross_compiling" = yes; then RUNSHARED= -@@ -4568,7 +4571,7 @@ done +@@ -4571,7 +4574,7 @@ done AC_MSG_RESULT(done) # generate output files diff --git a/debian/patches/bsddb-libpath.diff b/debian/patches/bsddb-libpath.diff index 9e25eb4..ec10d12 100644 --- a/debian/patches/bsddb-libpath.diff +++ b/debian/patches/bsddb-libpath.diff @@ -4,7 +4,7 @@ Index: b/setup.py =================================================================== --- a/setup.py +++ b/setup.py -@@ -1068,7 +1068,13 @@ class PyBuildExt(build_ext): +@@ -1070,7 +1070,13 @@ class PyBuildExt(build_ext): if db_setup_debug: print "bsddb using BerkeleyDB lib:", db_ver, dblib print "bsddb lib dir:", dblib_dir, " inc dir:", db_incdir diff --git a/debian/patches/build-hash.diff b/debian/patches/build-hash.diff index eab30de..957f7b2 100644 --- a/debian/patches/build-hash.diff +++ b/debian/patches/build-hash.diff @@ -4,7 +4,7 @@ Index: b/setup.py =================================================================== --- a/setup.py +++ b/setup.py -@@ -852,7 +852,7 @@ class PyBuildExt(build_ext): +@@ -854,7 +854,7 @@ class PyBuildExt(build_ext): print ("warning: openssl 0x%08x is too old for _hashlib" % openssl_ver) missing.append('_hashlib') @@ -13,7 +13,7 @@ Index: b/setup.py # The _sha module implements the SHA1 hash algorithm. exts.append( Extension('_sha', ['shamodule.c']) ) # The _md5 module implements the RSA Data Security, Inc. MD5 -@@ -863,7 +863,7 @@ class PyBuildExt(build_ext): +@@ -865,7 +865,7 @@ class PyBuildExt(build_ext): depends = ['md5.h']) ) min_sha2_openssl_ver = 0x00908000 diff --git a/debian/patches/build-libpython.diff b/debian/patches/build-libpython.diff index cbae8b9..57616d8 100644 --- a/debian/patches/build-libpython.diff +++ b/debian/patches/build-libpython.diff @@ -1,8 +1,10 @@ # DP: Don't include object files twice in libpython. +Index: b/Makefile.pre.in +=================================================================== --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -404,7 +404,7 @@ +@@ -404,7 +404,7 @@ LIBRARY_OBJS= \ $(PYTHON_OBJS) \ $(MODULE_OBJS) \ $(SIGNAL_OBJS) \ @@ -11,7 +13,7 @@ ######################################################################### # Rules -@@ -478,7 +478,7 @@ +@@ -488,7 +488,7 @@ $(LIBRARY): $(LIBRARY_OBJS) $(AR) $(ARFLAGS) $@ $(OBJECT_OBJS) $(AR) $(ARFLAGS) $@ $(PYTHON_OBJS) $(AR) $(ARFLAGS) $@ $(MODULE_OBJS) $(SIGNAL_OBJS) diff --git a/debian/patches/deb-setup.diff b/debian/patches/deb-setup.diff index 0deda8f..15c60e0 100644 --- a/debian/patches/deb-setup.diff +++ b/debian/patches/deb-setup.diff @@ -1,8 +1,10 @@ # 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 -@@ -436,10 +436,10 @@ +@@ -438,10 +438,10 @@ class PyBuildExt(build_ext): os.unlink(tmpfile) def detect_modules(self): diff --git a/debian/patches/debug-build.diff b/debian/patches/debug-build.diff index 5f5270e..24efc62 100644 --- a/debian/patches/debug-build.diff +++ b/debian/patches/debug-build.diff @@ -29,7 +29,7 @@ Index: b/Lib/distutils/sysconfig.py elif os.name == "nt": return os.path.join(prefix, "include") elif os.name == "os2": -@@ -251,7 +251,7 @@ def get_makefile_filename(): +@@ -263,7 +263,7 @@ def get_makefile_filename(): if python_build: return os.path.join(project_base, "Makefile") lib_dir = get_python_lib(plat_specific=1, standard_lib=1) @@ -42,16 +42,16 @@ Index: b/Lib/sysconfig.py =================================================================== --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py -@@ -332,7 +332,7 @@ def _parse_makefile(filename, vars=None) - def _get_makefile_filename(): +@@ -333,7 +333,7 @@ def get_makefile_filename(): + """Return the path of the Makefile.""" if _PYTHON_BUILD: return os.path.join(_PROJECT_BASE, "Makefile") - return os.path.join(get_path('platstdlib').replace("/usr/local","/usr",1), "config", "Makefile") + return os.path.join(get_path('platstdlib').replace("/usr/local","/usr",1), "config" + (sys.pydebug and "_d" or ""), "Makefile") - def _generate_posix_vars(): - """Generate the Python module containing build-time variables.""" -@@ -461,7 +461,7 @@ def get_config_h_filename(): + # Issue #22199: retain undocumented private name for compatibility + _get_makefile_filename = get_makefile_filename +@@ -465,7 +465,7 @@ def get_config_h_filename(): else: inc_dir = _PROJECT_BASE else: @@ -84,7 +84,7 @@ Index: b/Makefile.pre.in # Short name and location for Mac OS X Python framework UNIVERSALSDK=@UNIVERSALSDK@ PYTHONFRAMEWORK= @PYTHONFRAMEWORK@ -@@ -481,7 +483,7 @@ $(LIBRARY): $(LIBRARY_OBJS) +@@ -491,7 +493,7 @@ $(LIBRARY): $(LIBRARY_OBJS) $(AR) $(ARFLAGS) $@ $(sort $(MODOBJS)) $(RANLIB) $@ @@ -93,7 +93,7 @@ Index: b/Makefile.pre.in if test $(INSTSONAME) != $(LDLIBRARY); then \ $(BLDSHARED) $(PY_LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ $(LN) -f $(INSTSONAME) $@; \ -@@ -1079,8 +1081,8 @@ inclinstall: +@@ -1089,8 +1091,8 @@ inclinstall: $(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h # Install the library and miscellaneous stuff needed for extending/embedding @@ -108,15 +108,15 @@ Index: b/Misc/python-config.in =================================================================== --- a/Misc/python-config.in +++ b/Misc/python-config.in -@@ -45,7 +45,7 @@ for opt in opt_flags: +@@ -44,7 +44,7 @@ for opt in opt_flags: + print ' '.join(flags) elif opt in ('--libs', '--ldflags'): - libs = getvar('LIBS').split() + getvar('SYSLIBS').split() -- libs.append('-lpython'+pyver) -+ libs.append('-lpython' + pyver + (sys.pydebug and "_d" or "")) +- libs = ['-lpython' + pyver] ++ libs = ['-lpython' + pyver + (sys.pydebug and "_d" or "")] + libs += getvar('LIBS').split() + libs += getvar('SYSLIBS').split() # add the prefix/lib/pythonX.Y/config dir, but only if there is no - # shared library in prefix/lib/. - if opt == '--ldflags': Index: b/Python/dynload_shlib.c =================================================================== --- a/Python/dynload_shlib.c @@ -136,7 +136,7 @@ Index: b/Python/sysmodule.c =================================================================== --- a/Python/sysmodule.c +++ b/Python/sysmodule.c -@@ -1510,6 +1510,12 @@ _PySys_Init(void) +@@ -1519,6 +1519,12 @@ _PySys_Init(void) PyString_FromString("legacy")); #endif @@ -153,7 +153,7 @@ Index: b/configure.ac =================================================================== --- a/configure.ac +++ b/configure.ac -@@ -737,7 +737,7 @@ AC_SUBST(LIBRARY) +@@ -740,7 +740,7 @@ AC_SUBST(LIBRARY) AC_MSG_CHECKING(LIBRARY) if test -z "$LIBRARY" then @@ -162,7 +162,7 @@ Index: b/configure.ac fi AC_MSG_RESULT($LIBRARY) -@@ -883,8 +883,8 @@ if test $enable_shared = "yes"; then +@@ -886,8 +886,8 @@ if test $enable_shared = "yes"; then INSTSONAME="$LDLIBRARY".$SOVERSION ;; Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*) @@ -173,7 +173,7 @@ Index: b/configure.ac RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} case $ac_sys_system in FreeBSD*) -@@ -1027,6 +1027,12 @@ else AC_MSG_RESULT(no); Py_DEBUG='false' +@@ -1030,6 +1030,12 @@ else AC_MSG_RESULT(no); Py_DEBUG='false' fi], [AC_MSG_RESULT(no)]) @@ -186,7 +186,7 @@ Index: b/configure.ac # XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be # merged with this chunk of code? -@@ -1916,7 +1922,7 @@ then +@@ -1919,7 +1925,7 @@ then esac ;; CYGWIN*) SO=.dll;; diff --git a/debian/patches/disable-sem-check.diff b/debian/patches/disable-sem-check.diff index 743c838..5040699 100644 --- a/debian/patches/disable-sem-check.diff +++ b/debian/patches/disable-sem-check.diff @@ -4,7 +4,7 @@ Index: b/configure.ac =================================================================== --- a/configure.ac +++ b/configure.ac -@@ -3838,6 +3838,11 @@ int main(void) { +@@ -3841,6 +3841,11 @@ int main(void) { [ac_cv_posix_semaphores_enabled=no], [ac_cv_posix_semaphores_enabled=yes]) ) @@ -16,7 +16,7 @@ Index: b/configure.ac AC_MSG_RESULT($ac_cv_posix_semaphores_enabled) if test $ac_cv_posix_semaphores_enabled = no then -@@ -3874,6 +3879,11 @@ int main(void){ +@@ -3877,6 +3882,11 @@ int main(void){ [ac_cv_broken_sem_getvalue=yes], [ac_cv_broken_sem_getvalue=yes]) ) diff --git a/debian/patches/distutils-install-layout.diff b/debian/patches/distutils-install-layout.diff index 4bf7204..5799e9f 100644 --- a/debian/patches/distutils-install-layout.diff +++ b/debian/patches/distutils-install-layout.diff @@ -290,16 +290,16 @@ Index: b/Lib/sysconfig.py return os.name def _getuserbase(): -@@ -309,7 +332,7 @@ def _parse_makefile(filename, vars=None) - def _get_makefile_filename(): +@@ -310,7 +333,7 @@ def get_makefile_filename(): + """Return the path of the Makefile.""" if _PYTHON_BUILD: return os.path.join(_PROJECT_BASE, "Makefile") - return os.path.join(get_path('platstdlib'), "config", "Makefile") + return os.path.join(get_path('platstdlib').replace("/usr/local","/usr",1), "config", "Makefile") - def _generate_posix_vars(): - """Generate the Python module containing build-time variables.""" -@@ -438,7 +461,7 @@ def get_config_h_filename(): + # Issue #22199: retain undocumented private name for compatibility + _get_makefile_filename = get_makefile_filename +@@ -442,7 +465,7 @@ def get_config_h_filename(): else: inc_dir = _PROJECT_BASE else: @@ -356,7 +356,7 @@ Index: b/Lib/test/test_sysconfig.py + 'posix_home', 'posix_local', 'posix_prefix', 'posix_user') self.assertEqual(get_scheme_names(), wanted) - def test_symlink(self): + @unittest.skipIf(sys.platform.startswith('win'), Index: b/Lib/distutils/tests/test_install.py =================================================================== --- a/Lib/distutils/tests/test_install.py diff --git a/debian/patches/distutils-sysconfig.diff b/debian/patches/distutils-sysconfig.diff index 5163757..88b77cb 100644 --- a/debian/patches/distutils-sysconfig.diff +++ b/debian/patches/distutils-sysconfig.diff @@ -5,7 +5,7 @@ Index: b/Lib/distutils/sysconfig.py =================================================================== --- a/Lib/distutils/sysconfig.py +++ b/Lib/distutils/sysconfig.py -@@ -173,10 +173,12 @@ def customize_compiler(compiler): +@@ -174,10 +174,12 @@ def customize_compiler(compiler): _osx_support.customize_compiler(_config_vars) _config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True' @@ -22,7 +22,7 @@ Index: b/Lib/distutils/sysconfig.py if 'CC' in os.environ: newcc = os.environ['CC'] -@@ -197,13 +199,27 @@ def customize_compiler(compiler): +@@ -198,13 +200,27 @@ def customize_compiler(compiler): cpp = cc + " -E" # not always if 'LDFLAGS' in os.environ: ldshared = ldshared + ' ' + os.environ['LDFLAGS'] diff --git a/debian/patches/enable-fpectl.diff b/debian/patches/enable-fpectl.diff index 9e8c0c2..0472122 100644 --- a/debian/patches/enable-fpectl.diff +++ b/debian/patches/enable-fpectl.diff @@ -4,7 +4,7 @@ Index: b/setup.py =================================================================== --- a/setup.py +++ b/setup.py -@@ -1377,6 +1377,9 @@ class PyBuildExt(build_ext): +@@ -1379,6 +1379,9 @@ class PyBuildExt(build_ext): else: missing.append('_curses_panel') diff --git a/debian/patches/enable-sqlite-loadext.diff b/debian/patches/enable-sqlite-loadext.diff index 939a719..bbebabc 100644 --- a/debian/patches/enable-sqlite-loadext.diff +++ b/debian/patches/enable-sqlite-loadext.diff @@ -4,7 +4,7 @@ Index: b/setup.py =================================================================== --- a/setup.py +++ b/setup.py -@@ -1178,7 +1178,7 @@ class PyBuildExt(build_ext): +@@ -1180,7 +1180,7 @@ class PyBuildExt(build_ext): sqlite_defines.append(('MODULE_NAME', '\\"sqlite3\\"')) # Comment this out if you want the sqlite3 module to be able to load extensions. diff --git a/debian/patches/ensurepip-disabled.diff b/debian/patches/ensurepip-disabled.diff new file mode 100644 index 0000000..b762994 --- /dev/null +++ b/debian/patches/ensurepip-disabled.diff @@ -0,0 +1,42 @@ +# DP: Disable ensurepip in Debian for now. + +--- a/Lib/ensurepip/__init__.py ++++ b/Lib/ensurepip/__init__.py +@@ -12,6 +12,21 @@ + + __all__ = ["version", "bootstrap"] + ++def _ensurepip_is_disabled_in_debian(): ++ if True: ++ print ('''\ ++ensurepip is disabled in Debian/Ubuntu for the system python. ++ ++Python modules For the system python are usually handled by dpkg and apt-get. ++ ++ apt-get install python-<module name> ++ ++Install the python-pip package to use pip itself. Using pip together ++with the system python might have unexpected results for any system installed ++module, so use it on your own risk, or make sure to only use it in virtual ++environments. ++''') ++ sys.exit(1) + + # pip currently requires ssl support, so we try to provide a nicer + # error message when that is missing (http://bugs.python.org/issue19744) +@@ -47,6 +62,7 @@ + """ + Returns a string specifying the bundled version of pip. + """ ++ _ensurepip_is_disabled_in_debian() + whl_name = 'pip' + wheel_names = glob.glob('/usr/share/python-wheels/%s-*.whl' % whl_name) + if len(wheel_names) == 1: +@@ -75,6 +91,7 @@ + + Note that calling this function will alter both sys.path and os.environ. + """ ++ _ensurepip_is_disabled_in_debian() + if altinstall and default_pip: + raise ValueError("Cannot use altinstall and default_pip together") + diff --git a/debian/patches/ensurepip-wheels.diff b/debian/patches/ensurepip-wheels.diff new file mode 100644 index 0000000..de47ae6 --- /dev/null +++ b/debian/patches/ensurepip-wheels.diff @@ -0,0 +1,145 @@ +# DP: Let ensurepip use the system wheels, not the ones from the python source. + +Index: b/Lib/ensurepip/__init__.py +=================================================================== +--- a/Lib/ensurepip/__init__.py ++++ b/Lib/ensurepip/__init__.py +@@ -1,6 +1,7 @@ + #!/usr/bin/env python2 + from __future__ import print_function + ++import glob + import os + import os.path + import pkgutil +@@ -12,13 +13,9 @@ import tempfile + __all__ = ["version", "bootstrap"] + + +-_SETUPTOOLS_VERSION = "7.0" +- +-_PIP_VERSION = "1.5.6" +- + # pip currently requires ssl support, so we try to provide a nicer + # error message when that is missing (http://bugs.python.org/issue19744) +-_MISSING_SSL_MESSAGE = ("pip {} requires SSL/TLS".format(_PIP_VERSION)) ++_MISSING_SSL_MESSAGE = ("pip requires SSL/TLS") + try: + import ssl + except ImportError: +@@ -31,8 +28,8 @@ else: + pass + + _PROJECTS = [ +- ("setuptools", _SETUPTOOLS_VERSION), +- ("pip", _PIP_VERSION), ++ "setuptools", ++ "pip", + ] + + +@@ -50,7 +47,11 @@ def version(): + """ + Returns a string specifying the bundled version of pip. + """ +- return _PIP_VERSION ++ whl_name = 'pip' ++ wheel_names = glob.glob('/usr/share/python-wheels/%s-*.whl' % whl_name) ++ if len(wheel_names) == 1: ++ return os.path.basename(wheel_names[0]).split('-')[1] ++ raise RuntimeError('missing dependency wheel %s. Installation of the python-%s-whl package is needed to use ensurepip.' % (whl_name, whl_name)) + + + def _disable_pip_configuration_settings(): +@@ -93,21 +94,53 @@ def bootstrap(root=None, upgrade=False, + # omit pip and easy_install + os.environ["ENSUREPIP_OPTIONS"] = "install" + ++ # Debian: The bundled wheels are useless to us because we must use ones ++ # crafted from source code in the archive. As we build the virtual ++ # environment, copy the wheels from the system location into the virtual ++ # environment, and place those wheels on sys.path. ++ def copy_wheels(wheels, destdir, paths): ++ for project in wheels: ++ wheel_names = glob.glob( ++ '/usr/share/python-wheels/{}-*.whl'.format(project)) ++ if len(wheel_names) == 0: ++ raise RuntimeError('missing dependency wheel %s. Installation of the python-%s-whl package is needed to use ensurepip.' % (project, project)) ++ assert len(wheel_names) == 1, wheel_names ++ wheel_name = os.path.basename(wheel_names[0]) ++ path = os.path.join('/usr/share/python-wheels', wheel_name) ++ with open(path, 'rb') as fp: ++ whl = fp.read() ++ dest = os.path.join(destdir, wheel_name) ++ with open(dest, 'wb') as fp: ++ fp.write(whl) ++ paths.append(dest) ++ ++ # check that the python-{pip,setuptools}-whl packages are installed ++ missing = [] ++ for project in reversed(_PROJECTS): ++ wheel_names = glob.glob('/usr/share/python-wheels/%s-*.whl' % project) ++ if len(wheel_names) != 1: ++ missing.append(project) ++ if missing: ++ raise RuntimeError('missing wheel(s) %s. Installation of the %s package(s) is needed to use ensurepip.' \ ++ % (', '.join([missing]), ++ ', '.join(['python-%s-whl' % m for m in missing])) \ ++ ) ++ + tmpdir = tempfile.mkdtemp() ++ ++ for project in _PROJECTS: ++ try: ++ with open('/usr/share/python-wheels/%s.dependencies' % project) as fp: ++ dependencies = [line[:-1].split()[0] for line in fp.readlines()] ++ except IOError: ++ dependencies = [] ++ copy_wheels(dependencies, tmpdir, sys.path) ++ + try: + # Put our bundled wheels into a temporary directory and construct the + # additional paths that need added to sys.path + additional_paths = [] +- for project, version in _PROJECTS: +- wheel_name = "{}-{}-py2.py3-none-any.whl".format(project, version) +- whl = pkgutil.get_data( +- "ensurepip", +- "_bundled/{}".format(wheel_name), +- ) +- with open(os.path.join(tmpdir, wheel_name), "wb") as fp: +- fp.write(whl) +- +- additional_paths.append(os.path.join(tmpdir, wheel_name)) ++ copy_wheels(_PROJECTS, tmpdir, additional_paths) + + # Construct the arguments to be passed to the pip command + args = ["install", "--no-index", "--find-links", tmpdir] +@@ -120,7 +153,7 @@ def bootstrap(root=None, upgrade=False, + if verbosity: + args += ["-" + "v" * verbosity] + +- _run_pip(args + [p[0] for p in _PROJECTS], additional_paths) ++ _run_pip(args + _PROJECTS, additional_paths) + finally: + shutil.rmtree(tmpdir, ignore_errors=True) + +@@ -137,7 +170,8 @@ def _uninstall_helper(verbosity=0): + return + + # If the pip version doesn't match the bundled one, leave it alone +- if pip.__version__ != _PIP_VERSION: ++ # Disabled for Debian, always using the version from the python3-pip package. ++ if False and pip.__version__ != _PIP_VERSION: + msg = ("ensurepip will only uninstall a matching version " + "({!r} installed, {!r} bundled)") + print(msg.format(pip.__version__, _PIP_VERSION), file=sys.stderr) +@@ -151,7 +185,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)) + + + def _main(argv=None): diff --git a/debian/patches/ext-no-libpython-link.diff b/debian/patches/ext-no-libpython-link.diff index ab2c302..0ccd370 100644 --- a/debian/patches/ext-no-libpython-link.diff +++ b/debian/patches/ext-no-libpython-link.diff @@ -1,17 +1,19 @@ # 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 -@@ -234,7 +234,7 @@ +@@ -234,7 +234,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 - if (sysconfig.get_config_var('Py_ENABLE_SHARED')): + if False and (sysconfig.get_config_var('Py_ENABLE_SHARED')): - if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")): + if not sysconfig.python_build: # building third party extensions self.library_dirs.append(sysconfig.get_config_var('LIBDIR')) -@@ -755,7 +755,7 @@ +@@ -755,7 +755,7 @@ class build_ext (Command): return ext.libraries else: from distutils import sysconfig diff --git a/debian/patches/hg-updates.diff b/debian/patches/hg-updates.diff index 12cd32f..b4b9991 100644 --- a/debian/patches/hg-updates.diff +++ b/debian/patches/hg-updates.diff @@ -1,4 +1,4 @@ -# DP: hg updates of the 2.7 release branch (until 2014-08-10). +# DP: hg updates of the 2.7 release branch (until 2014-12-09). -# hg diff -r v2.7.8 | filterdiff --exclude=.*ignore --exclude=.hg* --remove-timestamps +# hg diff -r v2.7.9rc1 | filterdiff --exclude=.*ignore --exclude=.hg* --remove-timestamps diff --git a/debian/patches/hurd-disable-nonworking-constants.diff b/debian/patches/hurd-disable-nonworking-constants.diff index 5685006..baf33f6 100644 --- a/debian/patches/hurd-disable-nonworking-constants.diff +++ b/debian/patches/hurd-disable-nonworking-constants.diff @@ -24,7 +24,7 @@ Index: b/Modules/socketmodule.c =================================================================== --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c -@@ -4905,9 +4905,11 @@ init_socket(void) +@@ -4903,9 +4903,11 @@ init_socket(void) #ifdef SO_OOBINLINE PyModule_AddIntConstant(m, "SO_OOBINLINE", SO_OOBINLINE); #endif diff --git a/debian/patches/issue21963.diff b/debian/patches/issue21963.diff deleted file mode 100644 index 9ca005b..0000000 --- a/debian/patches/issue21963.diff +++ /dev/null @@ -1,152 +0,0 @@ -Index: b/Include/pythonrun.h -=================================================================== ---- a/Include/pythonrun.h -+++ b/Include/pythonrun.h -@@ -146,8 +146,6 @@ PyAPI_FUNC(void) PyFloat_Fini(void); - PyAPI_FUNC(void) PyOS_FiniInterrupts(void); - PyAPI_FUNC(void) PyByteArray_Fini(void); - --PyAPI_DATA(PyThreadState *) _Py_Finalizing; -- - /* Stuff with no proper home (yet) */ - PyAPI_FUNC(char *) PyOS_Readline(FILE *, FILE *, char *); - PyAPI_DATA(int) (*PyOS_InputHook)(void); -Index: b/Lib/test/test_threading.py -=================================================================== ---- a/Lib/test/test_threading.py -+++ b/Lib/test/test_threading.py -@@ -700,49 +700,6 @@ class ThreadJoinOnShutdown(BaseTestCase) - output = "end of worker thread\nend of main thread\n" - self.assertScriptHasOutput(script, output) - -- @unittest.skipIf(sys.platform in platforms_to_skip, "due to known OS bug") -- def test_6_daemon_threads(self): -- # Check that a daemon thread cannot crash the interpreter on shutdown -- # by manipulating internal structures that are being disposed of in -- # the main thread. -- script = """if True: -- import os -- import random -- import sys -- import time -- import threading -- -- thread_has_run = set() -- -- def random_io(): -- '''Loop for a while sleeping random tiny amounts and doing some I/O.''' -- while True: -- in_f = open(os.__file__, 'rb') -- stuff = in_f.read(200) -- null_f = open(os.devnull, 'wb') -- null_f.write(stuff) -- time.sleep(random.random() / 1995) -- null_f.close() -- in_f.close() -- thread_has_run.add(threading.current_thread()) -- -- def main(): -- count = 0 -- for _ in range(40): -- new_thread = threading.Thread(target=random_io) -- new_thread.daemon = True -- new_thread.start() -- count += 1 -- while len(thread_has_run) < count: -- time.sleep(0.001) -- # Trigger process shutdown -- sys.exit(0) -- -- main() -- """ -- rc, out, err = assert_python_ok('-c', script) -- self.assertFalse(err) -- - @unittest.skipUnless(hasattr(os, 'fork'), "needs os.fork()") - @unittest.skipIf(sys.platform in platforms_to_skip, "due to known OS bug") - def test_reinit_tls_after_fork(self): -Index: b/Python/ceval.c -=================================================================== ---- a/Python/ceval.c -+++ b/Python/ceval.c -@@ -355,12 +355,6 @@ PyEval_RestoreThread(PyThreadState *tsta - if (interpreter_lock) { - int err = errno; - PyThread_acquire_lock(interpreter_lock, 1); -- /* _Py_Finalizing is protected by the GIL */ -- if (_Py_Finalizing && tstate != _Py_Finalizing) { -- PyThread_release_lock(interpreter_lock); -- PyThread_exit_thread(); -- assert(0); /* unreachable */ -- } - errno = err; - } - #endif -@@ -1025,12 +1019,6 @@ PyEval_EvalFrameEx(PyFrameObject *f, int - - PyThread_acquire_lock(interpreter_lock, 1); - -- /* Check if we should make a quick exit. */ -- if (_Py_Finalizing && _Py_Finalizing != tstate) { -- PyThread_release_lock(interpreter_lock); -- PyThread_exit_thread(); -- } -- - if (PyThreadState_Swap(tstate) != NULL) - Py_FatalError("ceval: orphan tstate"); - -Index: b/Python/pythonrun.c -=================================================================== ---- a/Python/pythonrun.c -+++ b/Python/pythonrun.c -@@ -91,8 +91,6 @@ int _Py_QnewFlag = 0; - int Py_NoUserSiteDirectory = 0; /* for -s and site.py */ - int Py_HashRandomizationFlag = 0; /* for -R and PYTHONHASHSEED */ - --PyThreadState *_Py_Finalizing = NULL; -- - - /* Hack to force loading of object files */ - int (*_PyOS_mystrnicmp_hack)(const char *, const char *, Py_ssize_t) = \ -@@ -165,7 +163,6 @@ Py_InitializeEx(int install_sigs) - if (initialized) - return; - initialized = 1; -- _Py_Finalizing = NULL; - - if ((p = Py_GETENV("PYTHONDEBUG")) && *p != '\0') - Py_DebugFlag = add_flag(Py_DebugFlag, p); -@@ -425,16 +422,12 @@ Py_Finalize(void) - * the threads created via Threading. - */ - call_sys_exitfunc(); -+ initialized = 0; - - /* Get current thread state and interpreter pointer */ - tstate = PyThreadState_GET(); - interp = tstate->interp; - -- /* Remaining threads (e.g. daemon threads) will automatically exit -- after taking the GIL (in PyEval_RestoreThread()). */ -- _Py_Finalizing = tstate; -- initialized = 0; -- - /* Disable signal handling */ - PyOS_FiniInterrupts(); - -Index: b/Python/thread_pthread.h -=================================================================== ---- a/Python/thread_pthread.h -+++ b/Python/thread_pthread.h -@@ -242,9 +242,9 @@ void - PyThread_exit_thread(void) - { - dprintf(("PyThread_exit_thread called\n")); -- if (!initialized) -+ if (!initialized) { - exit(0); -- pthread_exit(0); -+ } - } - - #ifdef USE_SEMAPHORES diff --git a/debian/patches/issue9189.diff b/debian/patches/issue9189.diff index fc197b5..ff2f98c 100644 --- a/debian/patches/issue9189.diff +++ b/debian/patches/issue9189.diff @@ -122,7 +122,7 @@ Index: b/Makefile.pre.in Modules/python.o \ $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) -@@ -459,7 +465,7 @@ sharedmods: $(BUILDPYTHON) pybuilddir.tx +@@ -469,7 +475,7 @@ sharedmods: $(BUILDPYTHON) pybuilddir.tx *\ -s*|s*) quiet="-q";; \ *) quiet="";; \ esac; \ @@ -131,7 +131,7 @@ Index: b/Makefile.pre.in _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build -@@ -477,18 +483,18 @@ $(LIBRARY): $(LIBRARY_OBJS) +@@ -487,18 +493,18 @@ $(LIBRARY): $(LIBRARY_OBJS) libpython$(VERSION).so: $(LIBRARY_OBJS) if test $(INSTSONAME) != $(LDLIBRARY); then \ @@ -154,7 +154,7 @@ Index: b/Makefile.pre.in # Copy up the gdb python hooks into a position where they can be automatically # loaded by gdb during Lib/test/test_gdb.py -@@ -527,7 +533,7 @@ $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION +@@ -537,7 +543,7 @@ $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION # for a shared core library; otherwise, this rule is a noop. $(DLLLIBRARY) libpython$(VERSION).dll.a: $(LIBRARY_OBJS) if test -n "$(DLLLIBRARY)"; then \ @@ -163,7 +163,7 @@ Index: b/Makefile.pre.in $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST); \ else true; \ fi -@@ -571,7 +577,7 @@ Modules/getbuildinfo.o: $(PARSER_OBJS) \ +@@ -581,7 +587,7 @@ Modules/getbuildinfo.o: $(PARSER_OBJS) \ $(SIGNAL_OBJS) \ $(MODOBJS) \ $(srcdir)/Modules/getbuildinfo.c @@ -172,7 +172,7 @@ Index: b/Makefile.pre.in -DSVNVERSION="\"`LC_ALL=C $(SVNVERSION)`\"" \ -DHGVERSION="\"`LC_ALL=C $(HGVERSION)`\"" \ -DHGTAG="\"`LC_ALL=C $(HGTAG)`\"" \ -@@ -579,7 +585,7 @@ Modules/getbuildinfo.o: $(PARSER_OBJS) \ +@@ -589,7 +595,7 @@ Modules/getbuildinfo.o: $(PARSER_OBJS) \ -o $@ $(srcdir)/Modules/getbuildinfo.c Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile @@ -181,7 +181,7 @@ Index: b/Makefile.pre.in -DPREFIX='"$(prefix)"' \ -DEXEC_PREFIX='"$(exec_prefix)"' \ -DVERSION='"$(VERSION)"' \ -@@ -587,7 +593,7 @@ Modules/getpath.o: $(srcdir)/Modules/get +@@ -597,7 +603,7 @@ Modules/getpath.o: $(srcdir)/Modules/get -o $@ $(srcdir)/Modules/getpath.c Modules/python.o: $(srcdir)/Modules/python.c @@ -190,7 +190,7 @@ Index: b/Makefile.pre.in Modules/posixmodule.o: $(srcdir)/Modules/posixmodule.c $(srcdir)/Modules/posixmodule.h -@@ -604,7 +610,7 @@ $(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INP +@@ -614,7 +620,7 @@ $(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INP touch $(GRAMMAR_C) $(PGEN): $(PGENOBJS) @@ -199,7 +199,7 @@ Index: b/Makefile.pre.in Parser/grammar.o: $(srcdir)/Parser/grammar.c \ $(srcdir)/Include/token.h \ -@@ -626,10 +632,10 @@ $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES) +@@ -636,10 +642,10 @@ $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES) Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H) Python/getplatform.o: $(srcdir)/Python/getplatform.c @@ -212,7 +212,7 @@ Index: b/Makefile.pre.in Objects/unicodectype.o: $(srcdir)/Objects/unicodectype.c \ $(srcdir)/Objects/unicodetype_db.h -@@ -1234,7 +1240,7 @@ config.status: $(srcdir)/configure +@@ -1244,7 +1250,7 @@ config.status: $(srcdir)/configure # Some make's put the object file in the current directory .c.o: @@ -238,7 +238,7 @@ Index: b/configure.ac =================================================================== --- a/configure.ac +++ b/configure.ac -@@ -607,14 +607,13 @@ if test "$MACHDEP" = "irix6" && test "$C +@@ -610,14 +610,13 @@ if test "$MACHDEP" = "irix6" && test "$C fi fi @@ -263,7 +263,7 @@ Index: b/Lib/distutils/sysconfig.py =================================================================== --- a/Lib/distutils/sysconfig.py +++ b/Lib/distutils/sysconfig.py -@@ -319,11 +319,19 @@ def parse_makefile(fn, g=None): +@@ -320,11 +320,19 @@ def parse_makefile(fn, g=None): done[n] = v # do variable interpolation here @@ -286,7 +286,7 @@ Index: b/Lib/distutils/sysconfig.py n = m.group(1) found = True if n in done: -@@ -334,25 +342,47 @@ def parse_makefile(fn, g=None): +@@ -335,25 +343,47 @@ def parse_makefile(fn, g=None): elif n in os.environ: # do it like make: fall back to environment item = os.environ[n] diff --git a/debian/patches/libffi-shared.diff b/debian/patches/libffi-shared.diff index acf9ec7..1bfeac7 100644 --- a/debian/patches/libffi-shared.diff +++ b/debian/patches/libffi-shared.diff @@ -2,7 +2,7 @@ Index: b/setup.py =================================================================== --- a/setup.py +++ b/setup.py -@@ -2129,7 +2129,7 @@ class PyBuildExt(build_ext): +@@ -2131,7 +2131,7 @@ class PyBuildExt(build_ext): break ffi_lib = None if ffi_inc is not None: diff --git a/debian/patches/linecache.diff b/debian/patches/linecache.diff deleted file mode 100644 index a7fdd5a..0000000 --- a/debian/patches/linecache.diff +++ /dev/null @@ -1,16 +0,0 @@ -# DP: Proper handling of packages in linecache.py - ---- a/Lib/linecache.py -+++ b/Lib/linecache.py -@@ -108,6 +108,11 @@ - if os.path.isabs(filename): - return [] - -+ # Take care to handle packages -+ if basename == '__init__.py': -+ # filename referes to a package -+ basename = filename -+ - for dirname in sys.path: - # When using imputil, sys.path may contain things other than - # strings; ignore them when it happens. diff --git a/debian/patches/link-opt.diff b/debian/patches/link-opt.diff index 5424786..9d0d6a9 100644 --- a/debian/patches/link-opt.diff +++ b/debian/patches/link-opt.diff @@ -4,7 +4,7 @@ Index: b/configure.ac =================================================================== --- a/configure.ac +++ b/configure.ac -@@ -2030,8 +2030,8 @@ then +@@ -2033,8 +2033,8 @@ then fi ;; Linux*|GNU*|QNX*) @@ -15,7 +15,7 @@ Index: b/configure.ac BSD/OS*/4*) LDSHARED="gcc -shared" LDCXXSHARED="g++ -shared";; -@@ -2133,7 +2133,7 @@ then +@@ -2136,7 +2136,7 @@ then LINKFORSHARED="-Wl,-E -Wl,+s";; # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";; BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";; diff --git a/debian/patches/locale-module.diff b/debian/patches/locale-module.diff index 0dc335b..72c0cdc 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 -@@ -1592,8 +1592,8 @@ locale_alias = { +@@ -1690,8 +1690,8 @@ locale_alias = { 'uk_ua.iso88595': 'uk_UA.ISO8859-5', 'uk_ua.koi8u': 'uk_UA.KOI8-U', 'uk_ua.microsoftcp1251': 'uk_UA.CP1251', @@ -15,5 +15,5 @@ Index: b/Lib/locale.py + 'univ': 'en_US.UTF-8', + 'universal': 'en_US.UTF-8', 'universal.utf8@ucs4': 'en_US.UTF-8', + 'unm_us': 'unm_US.UTF-8', 'ur': 'ur_PK.CP1256', - 'ur_in': 'ur_IN.UTF-8', diff --git a/debian/patches/multiarch.diff b/debian/patches/multiarch.diff index c07ecb2..865a5f2 100644 --- a/debian/patches/multiarch.diff +++ b/debian/patches/multiarch.diff @@ -2,16 +2,16 @@ Index: b/Lib/sysconfig.py =================================================================== --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py -@@ -332,7 +332,7 @@ def _parse_makefile(filename, vars=None) - def _get_makefile_filename(): +@@ -333,7 +333,7 @@ def get_makefile_filename(): + """Return the path of the Makefile.""" if _PYTHON_BUILD: return os.path.join(_PROJECT_BASE, "Makefile") - return os.path.join(get_path('platstdlib').replace("/usr/local","/usr",1), "config" + (sys.pydebug and "_d" or ""), "Makefile") + return os.path.join(get_config_var('LIBPL'), "Makefile") - def _generate_posix_vars(): - """Generate the Python module containing build-time variables.""" -@@ -528,6 +528,12 @@ def get_config_vars(*args): + # Issue #22199: retain undocumented private name for compatibility + _get_makefile_filename = get_makefile_filename +@@ -532,6 +532,12 @@ def get_config_vars(*args): # the init-function. _CONFIG_VARS['userbase'] = _getuserbase() @@ -38,7 +38,7 @@ Index: b/Makefile.pre.in # Install prefix for architecture-independent files prefix= @prefix@ -@@ -558,6 +561,10 @@ Makefile Modules/config.c: Makefile.pre +@@ -568,6 +571,10 @@ Makefile Modules/config.c: Makefile.pre @mv config.c Modules @echo "The Makefile was updated, you may need to re-run make." @@ -49,7 +49,7 @@ Index: b/Makefile.pre.in Modules/Setup: $(srcdir)/Modules/Setup.dist @if test -f Modules/Setup; then \ -@@ -922,7 +929,7 @@ maninstall: altmaninstall +@@ -932,7 +939,7 @@ maninstall: altmaninstall (cd $(DESTDIR)$(MANDIR)/man1; $(LN) -s python2.1 python.1) # Install the library @@ -58,7 +58,7 @@ Index: b/Makefile.pre.in EXTRAPLATDIR= @EXTRAPLATDIR@ EXTRAMACHDEPPATH=@EXTRAMACHDEPPATH@ MACHDEPS= $(PLATDIR) $(EXTRAPLATDIR) -@@ -1082,10 +1089,10 @@ inclinstall: +@@ -1093,10 +1100,10 @@ inclinstall: # Install the library and miscellaneous stuff needed for extending/embedding # This goes into $(exec_prefix)$(DEBUG_EXT) @@ -71,7 +71,7 @@ Index: b/Makefile.pre.in libainstall: all python-config @for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \ -@@ -1361,6 +1368,11 @@ patchcheck: +@@ -1372,6 +1379,11 @@ patchcheck: Python/thread.o: @THREADHEADERS@ @@ -117,7 +117,7 @@ Index: b/configure.ac =================================================================== --- a/configure.ac +++ b/configure.ac -@@ -672,6 +672,9 @@ fi +@@ -675,6 +675,9 @@ fi MULTIARCH=$($CC --print-multiarch 2>/dev/null) AC_SUBST(MULTIARCH) @@ -131,12 +131,24 @@ Index: b/Lib/distutils/sysconfig.py =================================================================== --- a/Lib/distutils/sysconfig.py +++ b/Lib/distutils/sysconfig.py -@@ -90,7 +90,11 @@ def get_python_inc(plat_specific=0, pref +@@ -74,8 +74,6 @@ def get_python_inc(plat_specific=0, pref + If 'prefix' is supplied, use it instead of sys.prefix or + sys.exec_prefix -- i.e., ignore 'plat_specific'. + """ +- if prefix is None: +- prefix = plat_specific and EXEC_PREFIX or PREFIX + + if os.name == "posix": + if python_build: +@@ -90,7 +88,14 @@ def get_python_inc(plat_specific=0, pref # Include is located in the srcdir inc_dir = os.path.join(srcdir, "Include") return inc_dir - return os.path.join(prefix, "include", "python" + get_python_version())+(sys.pydebug and "_d" or "") + else: ++ if not (prefix is None): ++ return os.path.join(prefix, "include", ++ "python" + get_python_version())+(sys.pydebug and "_d" or "") + if plat_specific: + return get_config_var('CONFINCLUDEPY') + else: @@ -144,7 +156,7 @@ Index: b/Lib/distutils/sysconfig.py elif os.name == "nt": return os.path.join(prefix, "include") elif os.name == "os2": -@@ -251,7 +255,7 @@ def get_makefile_filename(): +@@ -263,7 +268,7 @@ def get_makefile_filename(): if python_build: return os.path.join(project_base, "Makefile") lib_dir = get_python_lib(plat_specific=1, standard_lib=1) @@ -157,7 +169,7 @@ Index: b/Python/sysmodule.c =================================================================== --- a/Python/sysmodule.c +++ b/Python/sysmodule.c -@@ -1439,6 +1439,8 @@ _PySys_Init(void) +@@ -1453,6 +1453,8 @@ _PySys_Init(void) PyFloat_GetInfo()); SET_SYS_FROM_STRING("long_info", PyLong_GetInfo()); diff --git a/debian/patches/revert-unittest-loader-symlinks19352.diff b/debian/patches/revert-unittest-loader-symlinks19352.diff index 73efeec..de4b9a6 100644 --- a/debian/patches/revert-unittest-loader-symlinks19352.diff +++ b/debian/patches/revert-unittest-loader-symlinks19352.diff @@ -1,9 +1,11 @@ Description: DP: Revert patch from http://bugs.python.org/issue19352 as it completely breaks unittest discovery on Debian/Ubuntu Bug-Ubuntu: https://launchpad.net/bugs/1255505 +Index: b/Lib/unittest/loader.py +=================================================================== --- a/Lib/unittest/loader.py +++ b/Lib/unittest/loader.py -@@ -256,8 +256,8 @@ +@@ -256,8 +256,8 @@ class TestLoader(object): yield _make_failed_import_test(name, self.suiteClass) else: mod_file = os.path.abspath(getattr(module, '__file__', full_path)) @@ -14,9 +16,11 @@ Bug-Ubuntu: https://launchpad.net/bugs/1255505 if realpath.lower() != fullpath_noext.lower(): module_dir = os.path.dirname(realpath) mod_name = os.path.splitext(os.path.basename(full_path))[0] ---- a/Lib/unittest/test/test_discovery.py 2013-11-28 17:29:32.092312004 +0100 -+++ b/Lib/unittest/test/test_discovery.py 2013-11-28 17:29:49.224311629 +0100 -@@ -314,7 +314,7 @@ +Index: b/Lib/unittest/test/test_discovery.py +=================================================================== +--- a/Lib/unittest/test/test_discovery.py ++++ b/Lib/unittest/test/test_discovery.py +@@ -315,7 +315,7 @@ class TestDiscovery(unittest.TestCase): self.assertTrue(program.failfast) self.assertTrue(program.catchbreak) @@ -25,7 +29,7 @@ Bug-Ubuntu: https://launchpad.net/bugs/1255505 class Module(object): __file__ = 'bar/foo.py' sys.modules['foo'] = Module -@@ -341,10 +341,7 @@ +@@ -342,10 +342,7 @@ class TestDiscovery(unittest.TestCase): os.listdir = listdir os.path.isfile = isfile os.path.isdir = isdir @@ -36,7 +40,7 @@ Bug-Ubuntu: https://launchpad.net/bugs/1255505 loader = unittest.TestLoader() mod_dir = os.path.abspath('bar') -@@ -357,25 +354,6 @@ +@@ -358,25 +355,6 @@ class TestDiscovery(unittest.TestCase): ) self.assertEqual(sys.path[0], full_path) diff --git a/debian/patches/series.in b/debian/patches/series.in index 1581fb7..35987a7 100644 --- a/debian/patches/series.in +++ b/debian/patches/series.in @@ -13,8 +13,6 @@ tkinter-import.diff link-opt.diff debug-build.diff hotshot-import.diff -linecache.diff -doc-nodownload.diff profiled-build.diff no-zip-on-sys.path.diff platform-lsbrelease.diff @@ -57,13 +55,12 @@ do-not-italicize-punctuation.patch multiarch.diff lib2to3-no-pickled-grammar.diff add-python-config-sh.diff -ssl.match_hostname.diff ext-no-libpython-link.diff build-hash.diff libffi-shared.diff atomic-pyc-rename.diff revert-unittest-loader-symlinks19352.diff -sphinx-no-refcounting.diff enable-sqlite-loadext.diff installed-testsuite.diff -issue21963.diff +ensurepip-wheels.diff +ensurepip-disabled.diff diff --git a/debian/patches/ssl.match_hostname.diff b/debian/patches/ssl.match_hostname.diff deleted file mode 100644 index 9c6b345..0000000 --- a/debian/patches/ssl.match_hostname.diff +++ /dev/null @@ -1,147 +0,0 @@ -Index: b/Lib/ssl.py -=================================================================== ---- a/Lib/ssl.py -+++ b/Lib/ssl.py -@@ -56,6 +56,7 @@ PROTOCOL_TLSv1 - """ - - import textwrap -+import re - - import _ssl # if we can't import it, let the error propagate - -@@ -97,6 +98,100 @@ import errno - # (OpenSSL's default setting is 'DEFAULT:!aNULL:!eNULL') - _DEFAULT_CIPHERS = 'DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2' - -+class CertificateError(ValueError): -+ pass -+ -+ -+def _dnsname_match(dn, hostname, max_wildcards=1): -+ """Matching according to RFC 6125, section 6.4.3 -+ -+ http://tools.ietf.org/html/rfc6125#section-6.4.3 -+ """ -+ pats = [] -+ if not dn: -+ return False -+ -+ dn_split = dn.split(r'.') -+ leftmost = dn_split[0] -+ remainder = dn_split[1:] -+ -+ wildcards = leftmost.count('*') -+ if wildcards > max_wildcards: -+ # Issue #17980: avoid denials of service by refusing more -+ # than one wildcard per fragment. A survery of established -+ # policy among SSL implementations showed it to be a -+ # reasonable choice. -+ raise CertificateError( -+ "too many wildcards in certificate DNS name: " + repr(dn)) -+ -+ # speed up common case w/o wildcards -+ if not wildcards: -+ return dn.lower() == hostname.lower() -+ -+ # RFC 6125, section 6.4.3, subitem 1. -+ # The client SHOULD NOT attempt to match a presented identifier in which -+ # the wildcard character comprises a label other than the left-most label. -+ if leftmost == '*': -+ # When '*' is a fragment by itself, it matches a non-empty dotless -+ # fragment. -+ pats.append('[^.]+') -+ elif leftmost.startswith('xn--') or hostname.startswith('xn--'): -+ # RFC 6125, section 6.4.3, subitem 3. -+ # The client SHOULD NOT attempt to match a presented identifier -+ # where the wildcard character is embedded within an A-label or -+ # U-label of an internationalized domain name. -+ pats.append(re.escape(leftmost)) -+ else: -+ # Otherwise, '*' matches any dotless string, e.g. www* -+ pats.append(re.escape(leftmost).replace(r'\*', '[^.]*')) -+ -+ # add the remaining fragments, ignore any wildcards -+ for frag in remainder: -+ pats.append(re.escape(frag)) -+ -+ pat = re.compile(r'\A' + r'\.'.join(pats) + r'\Z', re.IGNORECASE) -+ return pat.match(hostname) -+ -+ -+def match_hostname(cert, hostname): -+ """Verify that *cert* (in decoded format as returned by -+ SSLSocket.getpeercert()) matches the *hostname*. RFC 2818 and RFC 6125 -+ rules are followed, but IP addresses are not accepted for *hostname*. -+ -+ CertificateError is raised on failure. On success, the function -+ returns nothing. -+ """ -+ if not cert: -+ raise ValueError("empty or no certificate") -+ dnsnames = [] -+ san = cert.get('subjectAltName', ()) -+ for key, value in san: -+ if key == 'DNS': -+ if _dnsname_match(value, hostname): -+ return -+ dnsnames.append(value) -+ if not dnsnames: -+ # The subject is only checked when there is no dNSName entry -+ # in subjectAltName -+ for sub in cert.get('subject', ()): -+ for key, value in sub: -+ # XXX according to RFC 2818, the most specific Common Name -+ # must be used. -+ if key == 'commonName': -+ if _dnsname_match(value, hostname): -+ return -+ dnsnames.append(value) -+ if len(dnsnames) > 1: -+ raise CertificateError("hostname %r " -+ "doesn't match either of %s" -+ % (hostname, ', '.join(map(repr, dnsnames)))) -+ elif len(dnsnames) == 1: -+ raise CertificateError("hostname %r " -+ "doesn't match %r" -+ % (hostname, dnsnames[0])) -+ else: -+ raise CertificateError("no appropriate commonName or " -+ "subjectAltName fields were found") - - class SSLSocket(socket): - -Index: b/Doc/library/ssl.rst -=================================================================== ---- a/Doc/library/ssl.rst -+++ b/Doc/library/ssl.rst -@@ -535,6 +535,29 @@ The disadvantage of a self-signed certif - certificate, and no one else will have it in their cache of known (and trusted) - root certificates. - -+.. function:: match_hostname(cert, hostname) -+ -+ Verify that *cert* (in decoded format as returned by -+ :meth:`SSLSocket.getpeercert`) matches the given *hostname*. The rules -+ applied are those for checking the identity of HTTPS servers as outlined -+ in :rfc:`2818` and :rfc:`6125`, except that IP addresses are not currently -+ supported. In addition to HTTPS, this function should be suitable for -+ checking the identity of servers in various SSL-based protocols such as -+ FTPS, IMAPS, POPS and others. -+ -+ :exc:`CertificateError` is raised on failure. On success, the function -+ returns nothing:: -+ -+ >>> cert = {'subject': ((('commonName', 'example.com'),),)} -+ >>> ssl.match_hostname(cert, "example.com") -+ >>> ssl.match_hostname(cert, "example.org") -+ Traceback (most recent call last): -+ File "<stdin>", line 1, in <module> -+ File "/home/py3k/Lib/ssl.py", line 130, in match_hostname -+ ssl.CertificateError: hostname 'example.org' doesn't match 'example.com' -+ -+ Not part of the 2.7 upstream releases. Backported for Debian/Ubuntu. -+ - - Examples - -------- diff --git a/debian/pymindeps.py b/debian/pymindeps.py index c9e0871..0b610ca 100644 --- a/debian/pymindeps.py +++ b/debian/pymindeps.py @@ -106,7 +106,6 @@ def reduce_depgraph(dg): # guarded imports, which don't need to be included in python-minimal excluded_imports = { - 'codecs': set(('encodings',)), 'collections': set(('doctest', 'dummy_thread', 'cPickle')), 'copy': set(('reprlib',)), 'difflib': set(('doctest',)), diff --git a/debian/rules b/debian/rules index 67381f1..884f9d4 100755 --- a/debian/rules +++ b/debian/rules @@ -111,8 +111,8 @@ ifeq (,$(filter $(distrelease),lenny etch squeeze wheezy lucid maverick natty on else ma_filter = grep -v '^Multi-Arch:' endif -ifneq (,$(filter $(distrelease),sid experimental)) - bd_gcc = gcc (>= 4:4.9.1-1~), +ifneq (,$(filter $(distrelease),jessie sid experimental)) + bd_gcc = gcc (>= 4:4.9.2-1~), gcc-4.9 (>= 4.9.2-7), endif ifeq (,$(filter $(distrelease),lenny etch squeeze wheezy lucid maverick natty oneiric precise quantal raring saucy trusty)) bd_dpkgdev = dpkg-dev (>= 1.17.11), @@ -166,7 +166,7 @@ endif ifeq ($(with_lto),yes) LTO_CFLAGS = -g -flto -fuse-linker-plugin with_fat_lto := $(shell dpkg --compare-versions $$($(CC) --version \ - | sed -n '/^gcc/s/.* //p') ge 4.9 && echo yes) + | sed -n '/^$(CC)/s/.* //p') ge 4.9 && echo yes) ifeq ($(with_fat_lto),yes) LTO_CFLAGS += -ffat-lto-objects endif @@ -453,6 +453,7 @@ ifneq (,$(filter $(DEB_HOST_ARCH), arm avr32)) TEST_EXCLUDES += test_ctypes endif TEST_EXCLUDES += test_bsddb3 +TEST_EXCLUDES += test_ensurepip ifneq (,$(filter $(DEB_HOST_ARCH), arm armel avr32 m68k)) ifeq ($(on_buildd),yes) TEST_EXCLUDES += test_compiler @@ -777,6 +778,11 @@ endif rm -f $(d)/usr/share/man/man1/python2{,-config}.1 rm -f $(d)/$(scriptdir)/lib2to3/*.pickle + if [ -d $(d)/$(scriptdir)/ensurepip/_bundled ]; then \ + echo "ensurepip/_bundled must not be included in the source package"; \ + exit 1; \ + fi + : # cannot build it, zlib maintainer won't provide a mingw build find $(d) -name 'wininst*.exe' | xargs -r rm -f @@ -904,7 +910,9 @@ ifneq ($(DEB_HOST_MULTIARCH),$(DEB_HOST_GNU_TYPE)) $(d_ldev)/usr/share/man/man1/$(DEB_HOST_GNU_TYPE)-$(PVER)-config.1.gz endif - sed -i '/^Cflags:/s,$$, -I$${includedir}/$(DEB_HOST_MULTIARCH)/python$(VER),' \ + sed -i \ + -e '/^Cflags:/s,$$, -I$${includedir}/$(DEB_HOST_MULTIARCH)/python$(VER),' \ + -e '/^libdir=/d;s/-L\$${libdir} *//' \ $(d_ldev)/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/python-$(VER).pc dh_link -p$(p_ldev) \ @@ -1004,12 +1012,13 @@ endif Demo/{classes/*.py*,comparisons/patterns} \ Demo/{rpc/test,threads/*.py*,md5test/*} \ Demo/pdist/{client.py,cmdfw.py,cmptree.py,cvslib.py,cvslock.py,FSProxy.py,mac.py,rcsclient.py,rcslib.py,security.py,server.py,sumtree.py} \ - Demo/scripts/{morse.py,newslist.doc} \ + Demo/scripts/morse.py \ Demo/sockets/{broadcast.py,ftp.py,mcast.py,radio.py} \ Demo/tix/{bitmaps/{tix.gif,*x[pb]m*},samples/*.py} \ Demo/tkinter/guido/{AttrDialog.py,hanoi.py,hello.py,imagedraw.py,imageview.py,listtree.py,ManPage.py,ShellWindow.py,wish.py} \ Tools/scripts/pydocgui.pyw \ Tools/scripts/mailerdaemon.py + rm -f $(d_exam)/usr/share/doc/python$(VER)/examples/Demo/scripts/newslist.* : # Replace all '#!' calls to python with $(PY_INTERPRETER) : # and make them executable @@ -1128,8 +1137,9 @@ endif /usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)_d.so.1 \ /usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)_d.so sed -e '/^Libs:/s,-lpython$(VER),-lpython$(VER)_d,' \ - -e '/^Cflags:/s,python$(VER),python$(VER)_d,' \ - -e '/^Cflags:/s,$$, -I$${includedir}/$(DEB_HOST_MULTIARCH)/python$(VER)_d,' \ + -e '/^Cflags:/s,python$(VER),python$(VER)_d,' \ + -e '/^Cflags:/s,$$, -I$${includedir}/$(DEB_HOST_MULTIARCH)/python$(VER)_d,' \ + -e '/^libdir=/d;s/-L\$${libdir} *//' \ $(d)-dbg/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/python-$(VER).pc \ > $(d_ldbg)/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/python-$(VER)-dbg.pc diff --git a/debian/tests/control b/debian/tests/control index 6fa5e14..e90c2ae 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -1,19 +1,19 @@ Tests: testsuite -Depends: build-essential, python2.7-dev, libpython2.7-testsuite, python-gdbm +Depends: build-essential, locales, python2.7-dev, libpython2.7-testsuite, python-gdbm # test_zipfile wants to write Restrictions: needs-root Tests: testsuite-dbg -Depends: build-essential, python2.7-dev, python2.7-dbg, libpython2.7-testsuite, python-gdbm-dbg +Depends: build-essential, locales, python2.7-dev, python2.7-dbg, libpython2.7-testsuite, python-gdbm-dbg # test_zipfile wants to write Restrictions: needs-root Tests: failing-tests -Depends: build-essential, python2.7-dev, libpython2.7-testsuite, python-gdbm +Depends: build-essential, locales, python2.7-dev, libpython2.7-testsuite, python-gdbm # test_zipfile wants to write Restrictions: needs-root allow-stderr Tests: failing-tests-dbg -Depends: build-essential, python2.7-dev, python2.7-dbg, libpython2.7-testsuite, python-gdbm-dbg +Depends: build-essential, locales, python2.7-dev, python2.7-dbg, libpython2.7-testsuite, python-gdbm-dbg # test_zipfile wants to write Restrictions: needs-root allow-stderr diff --git a/debian/tests/failing-tests b/debian/tests/failing-tests index 4e7c307..0af8709 100644 --- a/debian/tests/failing-tests +++ b/debian/tests/failing-tests @@ -39,6 +39,7 @@ sh $debian_dir/locale-gen export LANG=C arch=$(dpkg --print-architecture) +vendor=$(dpkg-vendor --query Vendor) TESTPYTHON="python2.7 -E -Wd -3 -tt /usr/lib/python2.7/test/regrtest.py" TESTOPTS="-w -uall,-network,-urlfetch,-gui,-xpickle" @@ -53,6 +54,13 @@ TESTEXCLUSIONS="$TESTEXCLUSIONS test_distutils" # test_gdb: not run for the optimized build TESTEXCLUSIONS="$TESTEXCLUSIONS test_gdb" +# test_threading_local: fails in the Debian CI environment, but even +# succeeds there when re-run. See +# http://ci.debian.net/data/packages/unstable/amd64/p/python2.7/20141121_061940.autopkgtest.log.gz +case "$vendor" in Debian) + TESTEXCLUSIONS="$TESTEXCLUSIONS test_threading_local" +esac + # test_zipfile: Issue 17753, requires write access to test and email.test TESTEXCLUSIONS="$TESTEXCLUSIONS test_zipfile" diff --git a/debian/tests/failing-tests-dbg b/debian/tests/failing-tests-dbg index b7ced84..ab13ebe 100644 --- a/debian/tests/failing-tests-dbg +++ b/debian/tests/failing-tests-dbg @@ -38,6 +38,9 @@ sh $debian_dir/locale-gen export LANG=C +arch=$(dpkg --print-architecture) +vendor=$(dpkg-vendor --query Vendor) + tmphome=$ADTTMP/home mkdir -p $tmphome if [ -n "$su_user" ]; then @@ -54,6 +57,13 @@ TESTEXCLUSIONS="$TESTEXCLUSIONS test_curses" # test_distutils: failing tests test_parse_makefile_base, test_parse_makefile_literal_dollar TESTEXCLUSIONS="$TESTEXCLUSIONS test_distutils" +# test_threading_local: fails in the Debian CI environment, but even +# succeeds there when re-run. See +# http://ci.debian.net/data/packages/unstable/amd64/p/python2.7/20141121_061940.autopkgtest.log.gz +case "$vendor" in Debian) + TESTEXCLUSIONS="$TESTEXCLUSIONS test_threading_local" +esac + # test_zipfile: Issue 17753, requires write access to test and email.test TESTEXCLUSIONS="$TESTEXCLUSIONS test_zipfile" diff --git a/debian/tests/testsuite b/debian/tests/testsuite index f7085b1..2f746d0 100644 --- a/debian/tests/testsuite +++ b/debian/tests/testsuite @@ -39,6 +39,7 @@ sh $debian_dir/locale-gen export LANG=C arch=$(dpkg --print-architecture) +vendor=$(dpkg-vendor --query Vendor) TESTPYTHON="python2.7 -E -Wd -3 -tt /usr/lib/python2.7/test/regrtest.py" TESTOPTS="-w -uall,-network,-urlfetch,-gui,-xpickle" @@ -50,9 +51,19 @@ TESTEXCLUSIONS="$TESTEXCLUSIONS test_curses" # test_distutils: failing tests test_parse_makefile_base, test_parse_makefile_literal_dollar TESTEXCLUSIONS="$TESTEXCLUSIONS test_distutils" +# test_ensurepip: module disabled in Debian +TESTEXCLUSIONS="$TESTEXCLUSIONS test_ensurepip" + # test_gdb: not run for the optimized build TESTEXCLUSIONS="$TESTEXCLUSIONS test_gdb" +# test_threading_local: fails in the Debian CI environment, but even +# succeeds there when re-run. See +# http://ci.debian.net/data/packages/unstable/amd64/p/python2.7/20141121_061940.autopkgtest.log.gz +case "$vendor" in Debian) + TESTEXCLUSIONS="$TESTEXCLUSIONS test_threading_local" +esac + # test_zipfile: Issue 17753, requires write access to test and email.test TESTEXCLUSIONS="$TESTEXCLUSIONS test_zipfile" @@ -73,13 +84,17 @@ case "$arch" in ;; esac +# several tests fail with configured proxy; we don't need internet access, so +# unset proxy variables +EXTRAENV="env -u https_proxy -u http_proxy -u no_proxy HOME=$tmphome" + script=$debian_dir/script.py if [ -f "$script" ]; then - cmd1="HOME=$tmphome python2.7 $script \"$log\" \"$TESTPYTHON $TESTOPTS $TESTEXCLUSIONS $SEPARATE_TESTS\"" - cmd2="HOME=$tmphome python2.7 $script \"$log\" \"$TESTPYTHON $TESTOPTS $SEPARATE_TESTS\"" + cmd1="$EXTRAENV python2.7 $script \"$log\" \"$TESTPYTHON $TESTOPTS $TESTEXCLUSIONS $SEPARATE_TESTS\"" + cmd2="$EXTRAENV python2.7 $script \"$log\" \"$TESTPYTHON $TESTOPTS $SEPARATE_TESTS\"" else - cmd1="HOME=$tmphome $TESTPYTHON $TESTOPTS $TESTEXCLUSIONS $SEPARATE_TESTS" - cmd2="HOME=$tmphome $TESTPYTHON $TESTOPTS $SEPARATE_TESTS" + cmd1="$EXTRAENV $TESTPYTHON $TESTOPTS $TESTEXCLUSIONS $SEPARATE_TESTS" + cmd2="$EXTRAENV $TESTPYTHON $TESTOPTS $SEPARATE_TESTS" fi echo "Running the python testsuite with the standard interpreter:" diff --git a/debian/tests/testsuite-dbg b/debian/tests/testsuite-dbg index 565eaad..9215bb9 100644 --- a/debian/tests/testsuite-dbg +++ b/debian/tests/testsuite-dbg @@ -38,6 +38,9 @@ sh $debian_dir/locale-gen export LANG=C +arch=$(dpkg --print-architecture) +vendor=$(dpkg-vendor --query Vendor) + TESTPYTHON="python2.7-dbg -E -Wd -3 -tt /usr/lib/python2.7/test/regrtest.py" TESTOPTS="-w -uall,-network,-urlfetch,-gui,-xpickle" TESTEXCLUSIONS="-x" @@ -48,6 +51,16 @@ TESTEXCLUSIONS="$TESTEXCLUSIONS test_curses" # test_distutils: failing tests test_parse_makefile_base, test_parse_makefile_literal_dollar TESTEXCLUSIONS="$TESTEXCLUSIONS test_distutils" +# test_ensurepip: module disabled in Debian +TESTEXCLUSIONS="$TESTEXCLUSIONS test_ensurepip" + +# test_threading_local: fails in the Debian CI environment, but even +# succeeds there when re-run. See +# http://ci.debian.net/data/packages/unstable/amd64/p/python2.7/20141121_061940.autopkgtest.log.gz +case "$vendor" in Debian) + TESTEXCLUSIONS="$TESTEXCLUSIONS test_threading_local" +esac + # test_zipfile: Issue 17753, requires write access to test and email.test TESTEXCLUSIONS="$TESTEXCLUSIONS test_zipfile" @@ -57,11 +70,15 @@ else log=testsuite-dbg.log fi +# several tests fail with configured proxy; we don't need internet access, so +# unset proxy variables +EXTRAENV="env -u https_proxy -u http_proxy -u no_proxy HOME=$tmphome" + script=$debian_dir/script.py if [ -f "$script" ]; then - cmd="HOME=$tmphome python2.7 $script \"$log\" \"$TESTPYTHON $TESTOPTS $TESTEXCLUSIONS\"" + cmd="$EXTRAENV python2.7 $script \"$log\" \"$TESTPYTHON $TESTOPTS $TESTEXCLUSIONS\"" else - cmd="HOME=$tmphome $TESTPYTHON $TESTOPTS $TESTEXCLUSIONS" + cmd="$EXTRAENV $TESTPYTHON $TESTOPTS $TESTEXCLUSIONS" fi echo "Running the python testsuite with the debug enabled interpreter:" if [ "$(whoami)" = root ]; then |