The package rpms/python27.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=5815530bb...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=441dd7e8f...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=76e85fb77...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=eab66f504...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=82a502ede...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=a95ca83c7...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=a730bd11a...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=093a2cb27...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=c4cfb20f2...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=0d8e7a55c...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=0c63f17a1...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=d86077a9e...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=920a5e3f5...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=cfa0d57d9...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=c4cd8d349...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=3a252e136...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=3f17ce7e1...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=83e90d9c5...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=1554ebbaa...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=a0eea8701...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=31a6ae971...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=000d1758a...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=6b01c7b48...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=8cf5a3127...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=38234095e...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=81cc0f163...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=80188df0a...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=e252525e3...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=866e92926...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=8ac2b8e35...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=6520c8583...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=8caa1f320...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=599d1aa47...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=e0fde95b8...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=c365dbf92...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=19a5b75bf...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=d4a39597b...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=a1e09b039...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=dc5f99530...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=3dde1c965...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=663654f40...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=81b61ec96...
https://src.fedoraproject.org/cgit/rpms/python27.git/commit/?id=92ed49e1f....
Change:
+%ifarch %{mips64}
+%ifarch ppc64 s390x x86_64
+%ifarch %{ix86} x86_64 ppc
+ExcludeArch: s390 s390x
+%ifnarch s390 ppc64le
-%ifarch alpha ia64
+%ifarch %{mips64}
+%ifarch s390 s390x
-%ifarch s390 s390x
+%ifarch ppc64 s390x x86_64 ia64
+%ifarch %{ix86} x86_64 ppc ppc64
+%ifarch %{arm} %{ix86} x86_64 ppc %{power64} s390x
+%ifarch ppc64 s390x x86_64 ia64 alpha
+%ifarch s390 s390x
+%ifnarch %{arm}
+%ifarch s390 s390x %{power64} %{arm}
+%ifarch %{mips64}
+%ifarch %{sparc}
+%ifarch %{ix86} x86_64
-%ifnarch %{arm}
+%ifarch s390 s390x %{power64} %{arm} aarch64
+%ifarch %{sparc}
+%ifarch ia64
+%ifarch ppc64 s390x x86_64 ia64 alpha sparc64
+%ifarch %{ix86} x86_64 ppc ppc64 s390x
+%ifarch s390 s390x
+%ifarch s390 s390x %{power64}
+%ifarch ppc ppc64
-%ifarch %{sparc}
+%ifarch %{power64} s390x x86_64 ia64 alpha sparc64 aarch64
+%ifarch alpha ia64
-%ifarch i386
+%ifarch %{arm}
+%ifarch i386
-%ifarch ia64
+%ifnarch s390 s390x
-%ifarch s390 s390x
-ExcludeArch: s390 s390x
+%ifarch %{power64} s390x x86_64 ia64 alpha sparc64 aarch64 %{mips64} riscv64
+%ifarch ppc64 s390x x86_64 ia64 alpha sparc64
+%ifarch %{power64} s390x x86_64 ia64 alpha sparc64
+%ifarch %{arm} %{ix86} x86_64 ppc ppc64 ppc64p7 s390x
+%ifarch %{ix86} x86_64 ppc ppc64
Thanks.
Full change:
============
commit a730bd11a702044dd6e266507c07e1a2c492451e
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Wed Aug 21 16:26:24 2019 +0200
Make the package flat
diff --git a/python2.spec b/python2.spec
deleted file mode 100644
index 7e2c5f5..0000000
--- a/python2.spec
+++ /dev/null
@@ -1,3770 +0,0 @@
-# ======================================================
-# Conditionals and other variables controlling the build
-# ======================================================
-
-# Note that the bcond macros are named for the CLI option they create.
-# "%%bcond_without" means "ENABLE by default and create a --without
option"
-
-# Whether to use RPM build wheels from the python-{pip,setuptools}-wheel package
-# Uses upstream bundled prebuilt wheels otherwise
-%bcond_without rpmwheels
-
-# Extra build for debugging the interpreter or C-API extensions
-# (the -debug subpackages)
-%bcond_without debug_build
-
-# Only use this when bootstrapping python3
-# Needed to build setuptools for the first time
-%bcond_with python3_bootstrap
-
-%global unicode ucs4
-
-%global python python2
-
-%global pybasever 2.7
-%global pylibdir %{_libdir}/python%{pybasever}
-%global tools_dir %{pylibdir}/Tools
-%global demo_dir %{pylibdir}/Demo
-%global doc_tools_dir %{pylibdir}/Doc/tools
-%global dynload_dir %{pylibdir}/lib-dynload
-%global site_packages %{pylibdir}/site-packages
-
-# Python's configure script defines SOVERSION, and this is used in the Makefile
-# to determine INSTSONAME, the name of the libpython DSO:
-# LDLIBRARY='libpython$(VERSION).so'
-# INSTSONAME="$LDLIBRARY".$SOVERSION
-# We mirror this here in order to make it easier to add the -gdb.py hooks.
-# (if these get out of sync, the payload of the libs subpackage will fail
-# and halt the build)
-%global py_SOVERSION 1.0
-%global py_INSTSONAME_optimized libpython%{pybasever}.so.%{py_SOVERSION}
-%global py_INSTSONAME_debug libpython%{pybasever}_d.so.%{py_SOVERSION}
-
-# Disabled for now:
-%global with_huntrleaks 0
-
-%global with_gdb_hooks 1
-
-%global with_systemtap 1
-
-# some arches don't have valgrind so we need to disable its support on them
-%ifnarch s390 %{mips} riscv64
-%global with_valgrind 1
-%else
-%global with_valgrind 0
-%endif
-
-%global with_gdbm 1
-
-%if 0%{?_module_build}
-%global with_valgrind 0
-%global with_systemtap 0
-
-# (Don't) Run the test suite in %%check
-%bcond_with tests
-%else
-# Run the test suite in %%check
-%bcond_without tests
-%endif
-
-# Disable automatic bytecompilation. The python2.7 binary is not yet
-# available in /usr/bin when Python is built. Also, the bytecompilation fails
-# on files that test invalid syntax.
-%global __brp_python_bytecompile %{nil}
-
-# We need to get a newer configure generated out of configure.in for the following
-# patches:
-# patch 4 (CFLAGS)
-# patch 52 (valgrind)
-# patch 55 (systemtap)
-# patch 145 (linux2)
-#
-# For patch 55 (systemtap), we need to get a new header for configure to use
-#
-# configure.in requires autoconf-2.65, but the version in Fedora is currently
-# autoconf-2.66
-#
-# For now, we'll generate a patch to the generated configure script and
-# pyconfig.h.in on a machine that has a local copy of autoconf 2.65
-#
-# Instructions on obtaining such a copy can be seen at
-#
http://bugs.python.org/issue7997
-#
-# To make it easy to regenerate the patch, this specfile can be run in two
-# ways:
-# (i) regenerate_autotooling_patch 0 : the normal approach: prep the
-# source tree using a pre-generated patch to the "configure" script, and do a
-# full build
-# (ii) regenerate_autotooling_patch 1 : intended to be run on a developer's
-# workstation: prep the source tree without patching configure, then rerun a
-# local copy of autoconf-2.65, regenerate the patch, then exit, without doing
-# the rest of the build
-%global regenerate_autotooling_patch 0
-
-# Python 2 is deprecated in Fedora 30+, see:
-#
https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
-# This means that new packages MUST NOT depend on python2, even transitively
-# see:
https://fedoraproject.org/wiki/Packaging:Deprecating_Packages
-# Python 2 will not be supported after 2019. Use the python3 package instead
-# if possible.
-%if 0%{fedora} >= 30
-%global deprecated Provides: deprecated()
-%endif
-
-
-# ==================
-# Top-level metadata
-# ==================
-Summary: An interpreted, interactive, object-oriented programming language
-Name: %{python}
-# Remember to also rebase python2-docs when changing this:
-%global general_version %{pybasever}.16
-#global prerel ...
-%global upstream_version %{general_version}%{?prerel}
-Version: %{general_version}%{?prerel:~%{prerel}}
-Release: 7%{?dist}
-License: Python
-Requires: %{python}-libs%{?_isa} = %{version}-%{release}
-Provides: python(abi) = %{pybasever}
-
-%?deprecated
-
-# People might want to dnf install pythonX.Y instead of pythonXY
-Provides: python%{pybasever} = %{version}-%{release}
-
-
-# =======================
-# Build-time requirements
-# =======================
-
-# (keep this list alphabetized)
-
-BuildRequires: autoconf
-%if ! 0%{?_module_build}
-BuildRequires: bluez-libs-devel
-%endif
-BuildRequires: bzip2
-BuildRequires: bzip2-devel
-BuildRequires: glibc-all-langpacks
-BuildRequires: glibc-devel
-BuildRequires: gmp-devel
-BuildRequires: libdb-devel
-BuildRequires: libffi-devel
-BuildRequires: ncurses-devel
-BuildRequires: pkgconfig
-BuildRequires: readline-devel
-BuildRequires: sqlite-devel
-BuildRequires: tcl-devel
-
-BuildRequires: openssl-devel
-
-# For the nis module
-BuildRequires: libnsl2-devel
-BuildRequires: libtirpc-devel
-
-# expat 2.1.0 added the symbol XML_SetHashSalt without bumping SONAME. We use
-# it (in pyexpat) in order to enable the fix in Python-2.7.3 for CVE-2012-0876:
-BuildRequires: expat-devel >= 2.1.0
-
-BuildRequires: findutils
-BuildRequires: gcc-c++
-%if %{with_gdbm}
-# ABI change without soname bump, reverted
-BuildRequires: gdbm-devel >= 1:1.13
-%endif
-%if ! 0%{?_module_build}
-BuildRequires: libGL-devel
-BuildRequires: libX11-devel
-%endif
-
-%if 0%{?with_systemtap}
-BuildRequires: systemtap-sdt-devel
-# (this introduces a circular dependency, in that systemtap-sdt-devel's
-# /usr/bin/dtrace is a python script)
-%global tapsetdir /usr/share/systemtap/tapset
-%endif # with_systemtap
-
-BuildRequires: tar
-%if ! 0%{?_module_build}
-BuildRequires: tix-devel
-BuildRequires: tk-devel
-%endif
-
-%if 0%{?with_valgrind}
-BuildRequires: valgrind-devel
-%endif
-
-BuildRequires: zlib-devel
-
-# For %%python_provide
-BuildRequires: python-rpm-macros
-
-%if %{with rpmwheels}
-BuildRequires: python-setuptools-wheel
-BuildRequires: python-pip-wheel
-%endif
-
-# Providing python27 as now multiple interpreters exist in Fedora
-# alongside the system one e.g. python26, python33 etc
-Provides: python27 = %{version}-%{release}
-
-# Previously, this was required for our rewheel patch to work.
-# This is technically no longer needed, but we keep it recommended
-# for the developer experience.
-Recommends: python2-setuptools
-Recommends: python2-pip
-
-
-# =======================
-# Source code and patches
-# =======================
-
-Source:
https://www.python.org/ftp/python/%{version}/Python-%{upstream_version}.t...
-
-# Work around bug 562906 until it's fixed in rpm-build by providing a fixed
-# version of pythondeps.sh:
-Source2: pythondeps.sh
-%global __python_requires %{SOURCE2}
-
-# Systemtap tapset to make it easier to use the systemtap static probes
-# (actually a template; LIBRARY_PATH will get fixed up during install)
-# Written by dmalcolm; not yet sent upstream
-Source3: libpython.stp
-
-
-# Example systemtap script using the tapset
-# Written by wcohen, mjw, dmalcolm; not yet sent upstream
-Source4: systemtap-example.stp
-
-# Another example systemtap script that uses the tapset
-# Written by dmalcolm; not yet sent upstream
-Source5: pyfuntop.stp
-
-Source7: pynche
-
-# Modules/Setup.dist is ultimately used by the "makesetup" script to construct
-# the Makefile and config.c
-#
-# Upstream leaves many things disabled by default, to try to make it easy as
-# possible to build the code on as many platforms as possible.
-#
-# TODO: many modules can also now be built by setup.py after the python binary
-# has been built; need to assess if we should instead build things there
-#
-# We patch it downstream as follows:
-# - various modules are built by default by upstream as static libraries;
-# we built them as shared libraries
-# - build the "readline" module (appears to also be handled by setup.py now)
-# - build the nis module (which needs the tirpc library since glibc 2.26)
-# - enable the build of the following modules:
-# - array arraymodule.c # array objects
-# - cmath cmathmodule.c # -lm # complex math library functions
-# - math mathmodule.c # -lm # math library functions, e.g. sin()
-# - _struct _struct.c # binary structure packing/unpacking
-# - time timemodule.c # -lm # time operations and variables
-# - operator operator.c # operator.add() and similar goodies
-# - _weakref _weakref.c # basic weak reference support
-# - _testcapi _testcapimodule.c # Python C API test module
-# - _random _randommodule.c # Random number generator
-# - _collections _collectionsmodule.c # Container types
-# - itertools itertoolsmodule.c
-# - strop stropmodule.c
-# - _functools _functoolsmodule.c
-# - _bisect _bisectmodule.c # Bisection algorithms
-# - unicodedata unicodedata.c # static Unicode character database
-# - _locale _localemodule.c
-# - fcntl fcntlmodule.c # fcntl(2) and ioctl(2)
-# - spwd spwdmodule.c # spwd(3)
-# - grp grpmodule.c # grp(3)
-# - select selectmodule.c # select(2); not on ancient System V
-# - mmap mmapmodule.c # Memory-mapped files
-# - _csv _csv.c # CSV file helper
-# - _socket socketmodule.c # Socket module helper for socket(2)
-# - _ssl _ssl.c
-# - crypt cryptmodule.c -lcrypt # crypt(3)
-# - termios termios.c # Steen Lumholt's termios module
-# - resource resource.c # Jeremy Hylton's rlimit interface
-# - audioop audioop.c # Operations on audio samples
-# - imageop imageop.c # Operations on images
-# - _md5 md5module.c md5.c
-# - _sha shamodule.c
-# - _sha256 sha256module.c
-# - _sha512 sha512module.c
-# - linuxaudiodev linuxaudiodev.c
-# - timing timingmodule.c
-# - _tkinter _tkinter.c tkappinit.c
-# - dl dlmodule.c
-# - gdbm gdbmmodule.c
-# - _bsddb _bsddb.c
-# - binascii binascii.c
-# - parser parsermodule.c
-# - cStringIO cStringIO.c
-# - cPickle cPickle.c
-# - zlib zlibmodule.c
-# - _multibytecodec cjkcodecs/multibytecodec.c
-# - _codecs_cn cjkcodecs/_codecs_cn.c
-# - _codecs_hk cjkcodecs/_codecs_hk.c
-# - _codecs_iso2022 cjkcodecs/_codecs_iso2022.c
-# - _codecs_jp cjkcodecs/_codecs_jp.c
-# - _codecs_kr cjkcodecs/_codecs_kr.c
-# - _codecs_tw cjkcodecs/_codecs_tw.c
-Patch0: python-2.7.1-config.patch
-
-# Removes the "-g" option from "pydoc", for some reason; I believe
-# (dmalcolm 2010-01-29) that this was introduced in this change:
-# - fix pydoc (#68082)
-# in 2.2.1-12 as a response to the -g option needing TkInter installed
-# (Red Hat Linux 8)
-# Not upstream
-Patch1: 00001-pydocnogui.patch
-
-# Add $(CFLAGS) to the linker arguments when linking the "python" binary
-# since some architectures (sparc64) need this (rhbz:199373).
-# Not yet filed upstream
-Patch4: python-2.5-cflags.patch
-
-# Work around a bug in Python' gettext module relating to the
"Plural-Forms"
-# header (rhbz:252136)
-# Related to upstream issues:
-#
http://bugs.python.org/issue1448060 and
http://bugs.python.org/issue1475523
-# though the proposed upstream patches are, alas, different
-Patch6: python-2.5.1-plural-fix.patch
-
-# This patch was listed in the changelog as:
-# * Fri Sep 14 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-11
-# - fix encoding of sqlite .py files to work around weird encoding problem
-# in Turkish (#283331)
-# A traceback attached to rhbz 244016 shows the problem most clearly: a
-# traceback on attempting to import the sqlite module, with:
-# "SyntaxError: encoding problem: with BOM (__init__.py, line 1)"
-# This seems to come from Parser/tokenizer.c:check_coding_spec
-# Our patch changes two source files within sqlite3, removing the
-# "coding: ISO-8859-1" specs and character E4 = U+00E4 =
-# LATIN SMALL LETTER A WITH DIAERESIS from in ghaering's surname.
-#
-# It may be that the conversion of "ISO-8859-1" to "iso-8859-1" is
thwarted
-# by the implementation of "tolower" in the Turkish locale; see:
-#
https://bugzilla.redhat.com/show_bug.cgi?id=191096#c9
-#
-# TODO: Not yet sent upstream, and appears to me (dmalcolm 2010-01-29) that
-# it may be papering over a symptom
-Patch7: python-2.5.1-sqlite-encoding.patch
-
-# FIXME: Lib/ctypes/util.py posix implementation defines a function
-# _get_soname(f). Upstreams's implementation of this uses objdump to read the
-# SONAME from a library; we avoid this, apparently to minimize space
-# requirements on the live CD:
-# (rhbz:307221)
-Patch10: 00010-2.7.13-binutils-no-dep.patch
-
-# Upstream as of Python 2.7.3:
-# Patch11: python-2.7rc1-codec-ascii-tolower.patch
-
-# Add various constants to the socketmodule (rhbz#436560):
-# TODO: these patches were added in 2.5.1-22 and 2.5.1-24 but appear not to
-# have been sent upstream yet:
-Patch13: python-2.7rc1-socketmodule-constants.patch
-Patch14: python-2.7rc1-socketmodule-constants2.patch
-
-# Remove an "-rpath $(LIBDIR)" argument from the linkage args in configure.in:
-# FIXME: is this for OSF, not Linux?
-Patch16: python-2.6-rpath.patch
-
-# Fixup distutils/unixccompiler.py to remove standard library path from rpath:
-# Adapted from Patch0 in ivazquez' python3000 specfile, removing usage of
-# super() as it's an old-style class
-Patch17: python-2.6.4-distutils-rpath.patch
-
-# 00055 #
-# Systemtap support: add statically-defined probe points
-# Patch based on upstream bug:
http://bugs.python.org/issue4111
-# fixed up by mjw and wcohen for 2.6.2, then fixed up by dmalcolm for 2.6.4
-# then rewritten by mjw (attachment 390110 of rhbz 545179), then reformatted
-# for 2.7rc1 by dmalcolm:
-Patch55: 00055-systemtap.patch
-
-# Only used when "%%{_lib}" == "lib64"
-# Fixup various paths throughout the build and in distutils from "lib" to
"lib64",
-# and add the /usr/lib64/pythonMAJOR.MINOR/site-packages to sitedirs, in front of
-# /usr/lib/pythonMAJOR.MINOR/site-packages
-# Not upstream
-Patch102: 00102-2.7.13-lib64.patch
-
-# Python 2.7 split out much of the path-handling from distutils/sysconfig.py to
-# a new sysconfig.py (in r77704).
-# We need to make equivalent changes to that new file to ensure that the stdlib
-# and platform-specific code go to /usr/lib64 not /usr/lib, on 64-bit archs:
-Patch103: python-2.7-lib64-sysconfig.patch
-
-# 00104 #
-# Only used when "%%{_lib}" == "lib64"
-# Another lib64 fix, for distutils/tests/test_install.py; not upstream:
-Patch104: 00104-lib64-fix-for-test_install.patch
-
-# 00111 #
-# Patch the Makefile.pre.in so that the generated Makefile doesn't try to build
-# a libpythonMAJOR.MINOR.a (bug 550692):
-# Downstream only: not appropriate for upstream
-Patch111: 00111-no-static-lib.patch
-
-# 00112 #
-# Patch to support building both optimized vs debug stacks DSO ABIs, sharing
-# the same .py and .pyc files, using "_d.so" to signify a debug build of an
-# extension module.
-#
-# Based on Debian's patch for the same,
-#
http://patch-tracker.debian.org/patch/series/view/python2.6/2.6.5-2/debug...
-#
-# (which was itself based on the upstream Windows build), but with some
-# changes:
-#
-# * Debian's patch to dynload_shlib.c looks for module_d.so, then module.so,
-# but this can potentially find a module built against the wrong DSO ABI. We
-# instead search for just module_d.so in a debug build
-#
-# * We remove this change from configure.in's build of the Makefile:
-# SO=$DEBUG_EXT.so
-# so that sysconfig.py:customize_compiler stays with shared_lib_extension='.so'
-# on debug builds, so that UnixCCompiler.find_library_file can find system
-# libraries (otherwise "make sharedlibs" fails to find system libraries,
-# erroneously looking e.g. for "libffi_d.so" rather than
"libffi.so")
-#
-# * We change Lib/distutils/command/build_ext.py:build_ext.get_ext_filename
-# to add the _d there, when building an extension. This way, "make
sharedlibs"
-# can build ctypes, by finding the sysmtem libffi.so (rather than failing to
-# find "libffi_d.so"), and builds the module as _ctypes_d.so
-#
-# * Similarly, update build_ext:get_libraries handling of Py_ENABLE_SHARED by
-# appending "_d" to the python library's name for the debug configuration
-#
-# * We modify Modules/makesetup to add the "_d" to the generated Makefile
-# rules for the various Modules/*.so targets
-#
-# This may introduce issues when building an extension that links directly
-# against another extension (e.g. users of NumPy?), but seems more robust when
-# searching for external libraries
-#
-# * We don't change Lib/distutils/command/build.py: build.build_purelib to
-# embed plat_specifier, leaving it as is, as pure python builds should be
-# unaffected by these differences (we'll be sharing the .py and .pyc files)
-#
-# * We introduce DEBUG_SUFFIX as well as DEBUG_EXT:
-# - DEBUG_EXT is used by ELF files (names and SONAMEs); it will be "_d"
for
-# a debug build
-# - DEBUG_SUFFIX is used by filesystem paths; it will be "-debug" for a
-# debug build
-#
-# Both will be empty in an optimized build. "_d" contains characters that
-# are valid ELF metadata, but this leads to various ugly filesystem paths (such
-# as the include path), and DEBUG_SUFFIX allows these paths to have more natural
-# names. Changing this requires changes elsewhere in the distutils code.
-#
-# * We add DEBUG_SUFFIX to PYTHON in the Makefile, so that the two
-# configurations build parallel-installable binaries with different names
-# ("python-debug" vs "python").
-#
-# * Similarly, we add DEBUG_SUFFIX within python-config and
-# python$(VERSION)-config, so that the two configuration get different paths
-# for these.
-#
-# See also patch 130 below
-#
-Patch112: 00112-2.7.13-debug-build.patch
-
-
-# 00113 #
-# Add configure-time support for the COUNT_ALLOCS and CALL_PROFILE options
-# described at
http://svn.python.org/projects/python/trunk/Misc/SpecialBuilds.txt
-# so that if they are enabled, they will be in that build's pyconfig.h, so that
-# extension modules will reliably use them
-# Not yet sent upstream
-Patch113: 00113-more-configuration-flags.patch
-
-# 00114 #
-# Add flags for statvfs.f_flag to the constant list in posixmodule (i.e. "os")
-# (rhbz:553020); partially upstream as
http://bugs.python.org/issue7647
-# Not yet sent upstream
-Patch114: 00114-statvfs-f_flag-constants.patch
-
-# Upstream r79310 removed the "Modules" directory from sys.path when Python is
-# running from the build directory on POSIX to fix a unit test (issue #8205).
-# This seems to have broken the compileall.py done in "make install": it
cannot
-# find shared library extension modules at this point in the build (sys.path
-# does not contain DESTDIR/usr/lib(64)/python-2.7/lib-dynload for some reason),
-# leading to the build failing with:
-# Traceback (most recent call last):
-# File
"/home/david/rpmbuild/BUILDROOT/python-2.7-0.1.rc2.fc14.x86_64/usr/lib64/python2.7/compileall.py",
line 17, in <module>
-# import struct
-# File
"/home/david/rpmbuild/BUILDROOT/python-2.7-0.1.rc2.fc14.x86_64/usr/lib64/python2.7/struct.py",
line 1, in <module>
-# from _struct import *
-# ImportError: No module named _struct
-# This patch adds the build Modules directory to build path.
-Patch121: 00121-add-Modules-to-build-path.patch
-
-# 2.7.1 (in r84230) added a test to test_abc which fails if python is
-# configured with COUNT_ALLOCS, which is the case for our debug build
-# (the COUNT_ALLOCS instrumentation keeps "C" alive).
-# Not yet sent upstream
-Patch128: python-2.7.1-fix_test_abc_with_COUNT_ALLOCS.patch
-
-# 00130 #
-# Add "--extension-suffix" option to python-config and python-debug-config
-# (rhbz#732808)
-#
-# This is adapted from 3.2's PEP-3149 support.
-#
-# Fedora's debug build has some non-standard features (see also patch 112
-# above), though largely shared with Debian/Ubuntu and Windows
-#
-# In particular, SO in the Makefile is currently always just ".so" for our
-# python 2 optimized builds, but for python 2 debug it should be '_d.so', to
-# distinguish the debug vs optimized ABI, following the pattern in the above
-# patch.
-#
-# Not yet sent upstream
-Patch130: python-2.7.2-add-extension-suffix-to-python-config.patch
-
-# 00131 #
-# The four tests in test_io built on top of check_interrupted_write_retry
-# fail when built in Koji, for ppc and ppc64; for some reason, the SIGALRM
-# handlers are never called, and the call to write runs to completion
-# (rhbz#732998)
-Patch131: 00131-disable-tests-in-test_io.patch
-
-# 00132 #
-# Add non-standard hooks to unittest for use in the "check" phase below, when
-# running selftests within the build:
-# @unittest._skipInRpmBuild(reason)
-# for tests that hang or fail intermittently within the build environment, and:
-# @unittest._expectedFailureInRpmBuild
-# for tests that always fail within the build environment
-#
-# The hooks only take effect if WITHIN_PYTHON_RPM_BUILD is set in the
-# environment, which we set manually in the appropriate portion of the "check"
-# phase below (and which potentially other python-* rpms could set, to reuse
-# these unittest hooks in their own "check" phases)
-Patch132: 00132-add-rpmbuild-hooks-to-unittest.patch
-
-# 00133 #
-# "dl" is deprecated, and test_dl doesn't work on 64-bit builds:
-Patch133: 00133-skip-test_dl.patch
-
-# 00136 #
-# Some tests try to seek on sys.stdin, but don't work as expected when run
-# within Koji/mock; skip them within the rpm build:
-Patch136: 00136-skip-tests-of-seeking-stdin-in-rpmbuild.patch
-
-# 00137 #
-# Some tests within distutils fail when run in an rpmbuild:
-Patch137: 00137-skip-distutils-tests-that-fail-in-rpmbuild.patch
-
-# 00138 #
-# Fixup some tests within distutils to work with how debug builds are set up:
-Patch138: 00138-fix-distutils-tests-in-debug-build.patch
-
-# 00139 #
-# ARM-specific: skip known failure in test_float:
-#
http://bugs.python.org/issue8265 (rhbz#706253)
-Patch139: 00139-skip-test_float-known-failure-on-arm.patch
-
-# 00140 #
-# Sparc-specific: skip known failure in test_ctypes:
-#
http://bugs.python.org/issue8314 (rhbz#711584)
-# which appears to be a libffi bug
-Patch140: 00140-skip-test_ctypes-known-failure-on-sparc.patch
-
-# 00142 #
-# Some pty tests fail when run in mock (rhbz#714627):
-Patch142: 00142-skip-failing-pty-tests-in-rpmbuild.patch
-
-# 00143 #
-# Fix the --with-tsc option on ppc64, and rework it on 32-bit ppc to avoid
-# aliasing violations (rhbz#698726)
-# Sent upstream as
http://bugs.python.org/issue12872
-Patch143: 00143-tsc-on-ppc.patch
-
-# 00144 #
-# (Optionally) disable the gdbm module:
-Patch144: 00144-no-gdbm.patch
-
-# 00146 #
-# Support OpenSSL FIPS mode (e.g. when OPENSSL_FORCE_FIPS_MODE=1 is set)
-# - handle failures from OpenSSL (e.g. on attempts to use MD5 in a
-# FIPS-enforcing environment)
-# - add a new "usedforsecurity" keyword argument to the various digest
-# algorithms in hashlib so that you can whitelist a callsite with
-# "usedforsecurity=False"
-# (sent upstream for python 3 as
http://bugs.python.org/issue9216; this is a
-# backport to python 2.7; see RHEL6 patch 119)
-# - enforce usage of the _hashlib implementation: don't fall back to the _md5
-# and _sha* modules (leading to clearer error messages if fips selftests
-# fail)
-# - don't build the _md5 and _sha* modules; rely on the _hashlib implementation
-# of hashlib (for example, md5.py will use _hashlib's implementation of MD5,
-# if permitted by the FIPS setting)
-# (rhbz#563986)
-Patch146: 00146-hashlib-fips.patch
-
-# 00147 #
-# Add a sys._debugmallocstats() function
-# Based on patch 202 from RHEL 5's python.spec, with updates from rhbz#737198
-# Sent upstream as
http://bugs.python.org/issue14785
-Patch147: 00147-add-debug-malloc-stats.patch
-
-# 00155 #
-# Avoid allocating thunks in ctypes unless absolutely necessary, to avoid
-# generating SELinux denials on "import ctypes" and "import uuid"
when
-# embedding Python within httpd (rhbz#814391)
-Patch155: 00155-avoid-ctypes-thunks.patch
-
-# 00156 #
-# Recent builds of gdb will only auto-load scripts from certain safe
-# locations. Turn off this protection when running test_gdb in the selftest
-# suite to ensure that it can load our -gdb.py script (rhbz#817072):
-# Not yet sent upstream
-Patch156: 00156-gdb-autoload-safepath.patch
-
-# 00157 #
-# Update uid/gid handling throughout the standard library: uid_t and gid_t are
-# unsigned 32-bit values, but existing code often passed them through C long
-# values, which are signed 32-bit values on 32-bit architectures, leading to
-# negative int objects for uid/gid values >= 2^31 on 32-bit architectures.
-#
-# Introduce _PyObject_FromUid/Gid to convert uid_t/gid_t values to python
-# objects, using int objects where the value will fit (long objects otherwise),
-# and _PyArg_ParseUid/Gid to convert int/long to uid_t/gid_t, with -1 allowed
-# as a special case (since this is given special meaning by the chown syscall)
-#
-# Update standard library to use this throughout for uid/gid values, so that
-# very large uid/gid values are round-trippable, and -1 remains usable.
-# (rhbz#697470)
-Patch157: 00157-uid-gid-overflows.patch
-
-# 00165 #
-# Backport to Python 2 from Python 3.3 of improvements to the "crypt" module
-# adding precanned ways of salting a password (rhbz#835021)
-# Based on r88500 patch to py3k from Python 3.3
-# plus 6482dd1c11ed, 0586c699d467, 62994662676a, 74a1110a3b50, plus edits
-# to docstrings to note that this additional functionality is not standard
-# within 2.7
-Patch165: 00165-crypt-module-salt-backport.patch
-
-# 00167 #
-# Don't run any of the stack navigation tests in test_gdb when Python is
-# optimized, since there appear to be many different ways in which gdb can
-# fail to read the PyFrameObject* for arbitrary places in the callstack,
-# presumably due to compiler optimization (rhbz#912025)
-#
-# Not yet sent upstream
-Patch167: 00167-disable-stack-navigation-tests-when-optimized-in-test_gdb.patch
-
-# 00168 #
-# Update distutils.sysconfig so that if CFLAGS is defined in the environment,
-# when building extension modules, it is appended to the full compilation
-# flags from Python's Makefile, rather than instead reducing the compilation
-# flags to the subset within OPT and adding it to those.
-#
-# In particular, this should ensure that "-fno-strict-aliasing" is used by
-# "python setup.py build" even when CFLAGS is defined in the environment.
-#
-# (rhbz#849994)
-Patch168: 00168-distutils-cflags.patch
-
-# 00169 #
-# Use SHA-256 rather than implicitly using MD5 within the challenge handling
-# in multiprocessing.connection
-#
-# Sent upstream as
http://bugs.python.org/issue17258
-# (rhbz#879695)
-Patch169: 00169-avoid-implicit-usage-of-md5-in-multiprocessing.patch
-
-# 00170 #
-# In debug builds, try to print repr() when a C-level assert fails in the
-# garbage collector (typically indicating a reference-counting error
-# somewhere else e.g in an extension module)
-# Backported to 2.7 from a patch I sent upstream for py3k
-#
http://bugs.python.org/issue9263 (rhbz#614680)
-# hiding the proposed new macros/functions within gcmodule.c to avoid exposing
-# them within the extension API.
-# (rhbz#850013)
-Patch170: 00170-gc-assertions.patch
-
-# 00174 #
-# Workaround for failure to set up prefix/exec_prefix when running
-# an embededed libpython that sets Py_SetProgramName() to a name not
-# on $PATH when run from the root directory due to
-#
https://fedoraproject.org/wiki/Features/UsrMove
-# e.g. cmpi-bindings under systemd (rhbz#817554):
-Patch174: 00174-fix-for-usr-move.patch
-
-# 00180 #
-# Enable building on ppc64p7
-# Not appropriate for upstream, Fedora-specific naming
-Patch180: 00180-python-add-support-for-ppc64p7.patch
-
-# 00181 #
-# Allow arbitrary timeout for Condition.wait, as reported in
-#
https://bugzilla.redhat.com/show_bug.cgi?id=917709
-# Upstream doesn't want this:
http://bugs.python.org/issue17748
-# But we have no better solution downstream yet, and since there is
-# no API breakage, we apply this patch.
-# Doesn't apply to Python 3, where this is fixed otherwise and works.
-Patch181: 00181-allow-arbitrary-timeout-in-condition-wait.patch
-
-# 00185 #
-# Makes urllib2 honor "no_proxy" enviroment variable for "ftp:" URLs
-# when ftp_proxy is set
-Patch185: 00185-urllib2-honors-noproxy-for-ftp.patch
-
-# 00187 #
-# Add an explicit RPATH to pyexpat.so pointing at the directory
-# containing the system expat (which has the extra XML_SetHashSalt
-# symbol), to avoid an ImportError with a link error if there's an
-# LD_LIBRARY_PATH containing a "vanilla" build of expat (without the
-# symbol)
-Patch187: 00187-add-RPATH-to-pyexpat.patch
-
-# 00189 #
-# Instead of bundled wheels, use our RPM packaged wheels from
-# /usr/share/python-wheels
-Patch189: 00189-use-rpm-wheels.patch
-
-# 00191 #
-# Disabling NOOP test as it fails without internet connection
-Patch191: 00191-disable-NOOP.patch
-
-# 00193 #
-# Enable loading sqlite extensions. This patch isn't needed for
-# python3.spec, since Python 3 has a configuration option for this.
-# rhbz#1066708
-# Patch provided by John C. Peterson
-Patch193: 00193-enable-loading-sqlite-extensions.patch
-
-# 00289 #
-# Disable automatic detection for the nis module
-# (we handle it it in Setup.dist, see Patch0)
-Patch289: 00289-disable-nis-detection.patch
-
-# (New patches go here ^^^)
-#
-# When adding new patches to "python2" and "python3" in Fedora, EL,
etc.,
-# please try to keep the patch numbers in-sync between all specfiles.
-#
-# More information, and a patch number catalog, is at:
-#
-#
https://fedoraproject.org/wiki/SIGs/Python/PythonPatches
-
-# This is the generated patch to "configure"; see the description of
-# %%{regenerate_autotooling_patch}
-# above:
-
-# Disable tk for modularity builds to break up build dependencies
-Patch04000: 04000-modularity-disable-tk.patch
-
-Patch5000: 05000-autotool-intermediates.patch
-
-# ======================================================
-# Additional metadata, and subpackages
-# ======================================================
-
-URL:
https://www.python.org/
-
-%description
-Python 2 is an old version of the language that is incompatible with the 3.x
-line of releases. The language is mostly the same, but many details, especially
-how built-in objects like dictionaries and strings work, have changed
-considerably, and a lot of deprecated features have finally been removed in the
-3.x line.
-
-Note that documentation for Python 2 is provided in the python2-docs
-package.
-
-This package provides the "python2" executable; most of the actual
-implementation is within the "python2-libs" package.
-
-
-%package libs
-Summary: Runtime libraries for Python 2
-%?deprecated
-
-# Needed for ctypes, to load libraries, worked around for Live CDs size
-# Requires: binutils
-
-# expat 2.1.0 added the symbol XML_SetHashSalt without bumping SONAME. We use
-# this symbol (in pyexpat), so we must explicitly state this dependency to
-# prevent "import pyexpat" from failing with a linker error if someone
hasn't
-# yet upgraded expat:
-Requires: expat >= 2.1.0
-
-# Python built with glibc >= 2.24.90-26 needs to require it (rhbz#1410644).
-Requires: glibc%{?_isa} >= 2.24.90-26
-
-%if %{with_gdbm}
-# ABI change without soname bump, reverted
-Requires: gdbm%{?_isa} >= 1:1.13
-%endif
-
-%if %{with rpmwheels}
-Requires: python-setuptools-wheel
-Requires: python-pip-wheel
-%else
-Provides: bundled(python2-pip) = 18.1
-Provides: bundled(python2-setuptools) = 40.6.2
-%endif
-
-%{?python_provide:%python_provide python2-libs}
-%{?python_provide:%python_provide python2-libs%{?_isa}}
-
-%description libs
-This package contains files used to embed Python 2 into applications.
-
-%package devel
-Summary: Libraries and header files needed for Python 2 development
-%?deprecated
-
-Requires: %{python}%{?_isa} = %{version}-%{release}
-Requires: pkgconfig
-
-# The RPM related dependencies bring nothing to a non-RPM Python developer
-# But we want them when packages BuildRequire python2-devel
-Requires: (python-rpm-macros if rpm-build)
-Requires: (python2-rpm-macros if rpm-build)
-
-%if %{without python3_bootstrap}
-# When bootstrapping python3, we need to build setuptools
-# But setuptools BR python2-devel and that brings in python3-rpm-generators
-# python3-rpm-generators needs python3-setuptools, so we cannot have it yet
-Requires: (python3-rpm-generators if rpm-build)
-%endif
-
-# This is not "API" (packages that need setuptools should still BuildRequire
it)
-# However some packages apparently can build both with and without setuptools
-# producing egg-info as file or directory (depending on setuptools presence).
-# Directory-to-file updates are problematic in RPM, so we ensure setuptools is
-# installed when -devel is required.
-# See
https://bugzilla.redhat.com/show_bug.cgi?id=1623922
-# See
https://fedoraproject.org/wiki/Packaging:Directory_Replacement
-Requires: (python2-setuptools if rpm-build)
-
-#
https://bugzilla.redhat.com/show_bug.cgi?id=1217376
-#
https://bugzilla.redhat.com/show_bug.cgi?id=1496757
-#
https://bugzilla.redhat.com/show_bug.cgi?id=1218294
-# TODO change to a specific subpackage once available (#1218294)
-Requires: (redhat-rpm-config if gcc)
-
-# Needed here because of the migration of Makefile from -devel to the main
-# package
-Conflicts: %{python} < %{version}-%{release}
-
-%{?python_provide:%python_provide python2-devel}
-%{?python_provide:%python_provide python2-devel%{?_isa}}
-
-%description devel
-This package contains libraries and header files used to build applications
-with and native libraries for Python 2
-
-%package tools
-Summary: A collection of development tools included with Python 2
-%?deprecated
-
-Requires: %{name} = %{version}-%{release}
-Requires: %{python}-tkinter = %{version}-%{release}
-
-%{?python_provide:%python_provide python2-tools}
-%{?python_provide:%python_provide python2-tools%{?_isa}}
-
-%description tools
-This package includes several tools to help with the development of Python 2
-programs, including IDLE (an IDE with editing and debugging facilities), a
-color editor (pynche), and a python gettext program (pygettext.py).
-
-%package tkinter
-Summary: A graphical user interface for the Python 2 scripting language
-%?deprecated
-
-Requires: %{name} = %{version}-%{release}
-
-%if 0%{?fedora} < 31
-Provides: tkinter = %{version}-%{release}
-Provides: tkinter%{?_isa} = %{version}-%{release}
-Provides: tkinter2 = %{version}-%{release}
-Provides: tkinter2%{?_isa} = %{version}-%{release}
-%endif
-%{?python_provide:%python_provide python2-tkinter}
-%{?python_provide:%python_provide python2-tkinter%{?_isa}}
-
-%description tkinter
-
-The Tkinter (Tk interface) program is an graphical user interface for
-the Python 2 scripting language.
-
-You should install the python2tkinter package if you'd like to use a graphical
-user interface for Python 2 programming.
-
-%package test
-Summary: The test modules from the main python2 package
-%?deprecated
-
-Requires: %{name} = %{version}-%{release}
-
-%{?python_provide:%python_provide python2-test}
-%{?python_provide:%python_provide python2-test%{?_isa}}
-
-%description test
-
-The test modules from the main python2 package: %{name}
-These have been removed to save space, as they are never or almost
-never used in production.
-
-You might want to install the python2-test package if you're developing python 2
-code that uses more than just unittest and/or test.support.
-
-%if %{with debug_build}
-%package debug
-Summary: Debug version of the Python 2 runtime
-%?deprecated
-
-# The debug build is an all-in-one package version of the regular build, and
-# shares the same .py/.pyc files and directories as the regular build. Hence
-# we depend on all of the subpackages of the regular build:
-Requires: %{name}%{?_isa} = %{version}-%{release}
-Requires: %{name}-libs%{?_isa} = %{version}-%{release}
-Requires: %{name}-devel%{?_isa} = %{version}-%{release}
-Requires: %{name}-test%{?_isa} = %{version}-%{release}
-Requires: %{python}-tkinter%{?_isa} = %{version}-%{release}
-Requires: %{name}-tools%{?_isa} = %{version}-%{release}
-
-%{?python_provide:%python_provide python2-debug}
-%{?python_provide:%python_provide python2-debug%{?_isa}}
-
-%description debug
-python2-debug provides a version of the Python 2 runtime with numerous debugging
-features enabled, aimed at advanced Python users, such as developers of Python
-extension modules.
-
-This version uses more memory and will be slower than the regular Python 2 build,
-but is useful for tracking down reference-counting issues, and other bugs.
-
-The bytecodes are unchanged, so that .pyc files are compatible between the two
-version of Python 2, but the debugging features mean that C/C++ extension modules
-are ABI-incompatible with those built for the standard runtime.
-
-It shares installation directories with the standard Python 2 runtime, so that
-.py and .pyc files can be shared. All compiled extension modules gain a "_d"
-suffix ("foo_d.so" rather than "foo.so") so that each Python 2
implementation can
-load its own extensions.
-%endif # with debug_build
-
-
-# ======================================================
-# The prep phase of the build:
-# ======================================================
-
-%prep
-%setup -q -n Python-%{upstream_version}
-
-%if 0%{?with_systemtap}
-# Provide an example of usage of the tapset:
-cp -a %{SOURCE4} .
-cp -a %{SOURCE5} .
-%endif # with_systemtap
-
-# Ensure that we're using the system copy of various libraries, rather than
-# copies shipped by upstream in the tarball:
-# Remove embedded copy of expat:
-rm -r Modules/expat || exit 1
-
-# Remove embedded copy of libffi:
-for SUBDIR in darwin libffi libffi_arm_wince libffi_msvc libffi_osx ; do
- rm -r Modules/_ctypes/$SUBDIR || exit 1 ;
-done
-
-# Remove embedded copy of zlib:
-rm -r Modules/zlib || exit 1
-
-## Disabling hashlib patch for now as it needs to be reimplemented
-## for OpenSSL 1.1.0.
-# Don't build upstream Python's implementation of these crypto algorithms;
-# instead rely on _hashlib and OpenSSL.
-#
-# For example, in our builds md5.py uses always uses hashlib.md5 (rather than
-# falling back to _md5 when hashlib.md5 is not available); hashlib.md5 is
-# implemented within _hashlib via OpenSSL (and thus respects FIPS mode)
-#for f in md5module.c md5.c shamodule.c sha256module.c sha512module.c; do
-# rm Modules/$f
-#done
-
-#
-# Apply patches:
-#
-%patch0 -p1 -b .rhconfig
-%patch1 -p1 -b .no_gui
-%patch4 -p1 -b .cflags
-%patch6 -p1 -b .plural
-%patch7 -p1
-
-%if "%{_lib}" == "lib64"
-%patch102 -p1 -b .lib64
-%patch103 -p1 -b .lib64-sysconfig
-%patch104 -p1
-%endif
-
-%patch10 -p1 -b .binutils-no-dep
-%patch13 -p1 -b .socketmodule
-%patch14 -p1 -b .socketmodule2
-%patch16 -p1 -b .rpath
-%patch17 -p1 -b .distutils-rpath
-
-%if 0%{?with_systemtap}
-%patch55 -p1 -b .systemtap
-%endif
-
-%patch111 -p1 -b .no-static-lib
-
-%patch112 -p1 -b .debug-build
-
-%patch113 -p1 -b .more-configuration-flags
-
-%patch114 -p1 -b .statvfs-f-flag-constants
-
-
-%patch121 -p1
-%patch128 -p1
-
-%patch130 -p1
-
-%ifarch ppc %{power64}
-%patch131 -p1
-%endif
-
-%patch132 -p1
-%patch133 -p1
-%patch136 -p1 -b .stdin-test
-%patch137 -p1
-%patch138 -p1
-%ifarch %{arm}
-%patch139 -p1
-%endif
-%ifarch %{sparc}
-%patch140 -p1
-%endif
-%patch142 -p1 -b .tty-fail
-%patch143 -p1 -b .tsc-on-ppc
-%if !%{with_gdbm}
-%patch144 -p1
-%endif
-#patch146 -p1
-%patch147 -p1
-%patch155 -p1
-%patch156 -p1
-%patch157 -p1
-%patch165 -p1
-mv Modules/cryptmodule.c Modules/_cryptmodule.c
-%patch167 -p1
-%patch168 -p1
-%patch169 -p1
-%patch170 -p1
-%patch174 -p1 -b .fix-for-usr-move
-%patch180 -p1
-%patch181 -p1
-%patch185 -p1
-%patch187 -p1
-
-%if %{with rpmwheels}
-%patch189 -p1
-rm Lib/ensurepip/_bundled/*.whl
-%endif
-
-%patch191 -p1
-%patch193 -p1
-%patch289 -p1
-
-%if 0%{?_module_build}
-%patch4000 -p1
-%endif
-
-# This shouldn't be necesarry, but is right now (2.2a3)
-find -name "*~" |xargs rm -f
-
-%if ! 0%{regenerate_autotooling_patch}
-# Normally we apply the patch to "configure"
-# We don't apply the patch if we're working towards regenerating it
-%patch5000 -p0 -b .autotool-intermediates
-%endif
-
-
-# ======================================================
-# Configuring and building the code:
-# ======================================================
-
-%build
-topdir=$(pwd)
-export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv"
-export CXXFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv"
-export CPPFLAGS="$(pkg-config --cflags-only-I libffi)"
-export OPT="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv"
-export LINKCC="gcc"
-export LDFLAGS="$RPM_LD_FLAGS"
-if pkg-config openssl ; then
- export CFLAGS="$CFLAGS $(pkg-config --cflags openssl)"
- export LDFLAGS="$LDFLAGS $(pkg-config --libs-only-L openssl)"
-fi
-# Force CC
-export CC=gcc
-
-%if 0%{regenerate_autotooling_patch}
-# If enabled, this code regenerates the patch to "configure", using a
-# local copy of autoconf-2.65, then exits the build
-#
-# The following assumes that the copy is installed to ~/autoconf-2.65/bin
-# as per these instructions:
-#
http://bugs.python.org/issue7997
-
-for f in pyconfig.h.in configure ; do
- cp $f $f.autotool-intermediates ;
-done
-
-# Rerun the autotools:
-PATH=~/autoconf-2.65/bin:$PATH autoconf
-autoheader
-
-# Regenerate the patch:
-gendiff . .autotool-intermediates > %{PATCH5000}
-
-
-# Exit the build
-exit 1
-%endif
-
-# Define a function, for how to perform a "build" of python for a given
-# configuration:
-BuildPython() {
- ConfName=$1
- BinaryName=$2
- SymlinkName=$3
- ExtraConfigArgs=$4
- PathFixWithThisBinary=$5
-
- ConfDir=build/$ConfName
-
- echo STARTING: BUILD OF PYTHON FOR CONFIGURATION: $ConfName - %{_bindir}/$BinaryName
- mkdir -p $ConfDir
-
- pushd $ConfDir
-
- # Use the freshly created "configure" script, but in the directory two
above:
- %global _configure $topdir/configure
-
-%configure \
- --enable-ipv6 \
- --enable-shared \
- --enable-unicode=%{unicode} \
- --with-dbmliborder=gdbm:ndbm:bdb \
- --with-system-expat \
- --with-system-ffi \
-%if 0%{?with_systemtap}
- --with-dtrace \
- --with-tapset-install-dir=%{tapsetdir} \
-%endif
-%if 0%{?with_valgrind}
- --with-valgrind \
-%endif
- $ExtraConfigArgs \
- %{nil}
-
-make EXTRA_CFLAGS="$CFLAGS" %{?_smp_mflags}
-
-# We need to fix shebang lines across the full source tree.
-#
-# We do this using the pathfix.py script, which requires one of the
-# freshly-built Python binaries.
-#
-# We use the optimized python binary, and make the shebangs point at that same
-# optimized python binary:
-if $PathFixWithThisBinary
-then
- # pathfix.py currently only works with files matching ^[a-zA-Z0-9_]+\.py$
- # when crawling through directories, so we handle the special cases manually
- LD_LIBRARY_PATH="$topdir/$ConfDir" ./$BinaryName \
- $topdir/Tools/scripts/pathfix.py \
- -i "%{_bindir}/python%{pybasever}" \
- $topdir \
- $topdir/Tools/pynche/pynche \
- $topdir/Demo/pdist/{rcvs,rcsbump,rrcs} \
- $topdir/Demo/scripts/find-uname.py \
- $topdir/Tools/scripts/reindent-rst.py
-fi
-
-# Rebuild with new python
-# We need a link to a versioned python in the build directory
-ln -s $BinaryName $SymlinkName
-LD_LIBRARY_PATH="$topdir/$ConfDir" PATH=$PATH:$topdir/$ConfDir make -s
EXTRA_CFLAGS="$CFLAGS" %{?_smp_mflags}
-
- popd
- echo FINISHED: BUILD OF PYTHON FOR CONFIGURATION: $ConfDir
-}
-
-# Use "BuildPython" to support building with different configurations:
-
-%if %{with debug_build}
-BuildPython debug \
- python-debug \
- python%{pybasever}-debug \
-%ifarch %{ix86} x86_64 ppc %{power64}
- "--with-pydebug --with-tsc --with-count-allocs --with-call-profile" \
-%else
- "--with-pydebug --with-count-allocs --with-call-profile" \
-%endif
- false
-%endif # with debug_build
-
-BuildPython optimized \
- python \
- python%{pybasever} \
-%ifarch %{ix86} x86_64
- "--enable-optimizations" \
-%else
- "" \
-%endif
- true
-
-
-# ======================================================
-# Installing the built code:
-# ======================================================
-
-%install
-topdir=$(pwd)
-rm -rf %{buildroot}
-mkdir -p %{buildroot}%{_prefix} %{buildroot}%{_mandir}
-
-# Clean up patched .py files that are saved as .lib64
-for f in distutils/command/install distutils/sysconfig; do
- rm -f Lib/$f.py.lib64
-done
-
-InstallPython() {
-
- ConfName=$1
- BinaryName=$2
- PyInstSoName=$3
-
- ConfDir=build/$ConfName
-
- echo STARTING: INSTALL OF PYTHON FOR CONFIGURATION: $ConfName - %{_bindir}/$BinaryName
- mkdir -p $ConfDir
-
- pushd $ConfDir
-
-make install DESTDIR=%{buildroot}
-
-# We install a collection of hooks for gdb that make it easier to debug
-# executables linked against libpython (such as /usr/lib/python itself)
-#
-# These hooks are implemented in Python itself
-#
-# gdb-archer looks for them in the same path as the ELF file, with a -gdb.py suffix.
-# We put them in the debuginfo package by installing them to e.g.:
-# /usr/lib/debug/usr/lib/libpython2.6.so.1.0.debug-gdb.py
-# (note that the debug path is /usr/lib/debug for both 32/64 bit)
-#
-# See
https://fedoraproject.org/wiki/Features/EasierPythonDebugging for more
-# information
-#
-# Initially I tried:
-# /usr/lib/libpython2.6.so.1.0-gdb.py
-# but doing so generated noise when ldconfig was rerun (rhbz:562980)
-#
-%if 0%{?with_gdb_hooks}
-DirHoldingGdbPy=%{_prefix}/lib/debug/%{_libdir}
-PathOfGdbPy=$DirHoldingGdbPy/$PyInstSoName-%{version}-%{release}.%{_arch}.debug-gdb.py
-
-mkdir -p %{buildroot}$DirHoldingGdbPy
-cp $topdir/Tools/gdb/libpython.py %{buildroot}$PathOfGdbPy
-
-# Manually byte-compile the file, in case find-debuginfo.sh is run before
-# brp-python-bytecompile, so that the .pyc/.pyo files are properly listed in
-# the debuginfo manifest:
-LD_LIBRARY_PATH="$topdir/$ConfDir" $topdir/$ConfDir/$BinaryName \
- -c "import compileall; import sys;
compileall.compile_dir('%{buildroot}$DirHoldingGdbPy',
ddir='$DirHoldingGdbPy')"
-
-LD_LIBRARY_PATH="$topdir/$ConfDir" $topdir/$ConfDir/$BinaryName -O \
- -c "import compileall; import sys;
compileall.compile_dir('%{buildroot}$DirHoldingGdbPy',
ddir='$DirHoldingGdbPy')"
-%endif # with_gdb_hooks
-
- popd
-
- echo FINISHED: INSTALL OF PYTHON FOR CONFIGURATION: $ConfName
-}
-
-# Use "InstallPython" to support building with different configurations:
-
-# Install the "debug" build first, so that we can move some files aside
-%if %{with debug_build}
-InstallPython debug \
- python%{pybasever}-debug \
- %{py_INSTSONAME_debug}
-%endif # with debug_build
-
-# Now the optimized build:
-InstallPython optimized \
- python%{pybasever} \
- %{py_INSTSONAME_optimized}
-
-
-# Fix the interpreter path in binaries installed by distutils
-# (which changes them by itself)
-# Make sure we preserve the file permissions
-for fixed in %{buildroot}%{_bindir}/pydoc; do
- sed 's,#!.*/python$,#!/usr/bin/env python%{pybasever},' $fixed > $fixed-
\
- && cat $fixed- > $fixed && rm -f $fixed-
-done
-
-# Junk, no point in putting in -test sub-pkg
-rm -f %{buildroot}/%{pylibdir}/idlelib/testcode.py*
-
-# don't include tests that are run at build time in the package
-# This is documented, and used: rhbz#387401
-if /bin/false; then
- # Move this to -test subpackage.
-mkdir save_bits_of_test
-for i in test_support.py __init__.py; do
- cp -a %{buildroot}/%{pylibdir}/test/$i save_bits_of_test
-done
-rm -rf %{buildroot}/%{pylibdir}/test
-mkdir %{buildroot}/%{pylibdir}/test
-cp -a save_bits_of_test/* %{buildroot}/%{pylibdir}/test
-fi
-
-# tools
-
-mkdir -p ${RPM_BUILD_ROOT}%{site_packages}
-
-#pynche
-install -p -m755 %{SOURCE7} ${RPM_BUILD_ROOT}%{_bindir}/pynche
-chmod 755 ${RPM_BUILD_ROOT}%{_bindir}/pynche
-rm -f Tools/pynche/*.pyw
-cp -rp Tools/pynche \
- ${RPM_BUILD_ROOT}%{site_packages}/
-
-mv Tools/pynche/README Tools/pynche/README.pynche
-
-#gettext
-install -m755 Tools/i18n/pygettext.py %{buildroot}%{_bindir}/
-install -m755 Tools/i18n/msgfmt.py %{buildroot}%{_bindir}/
-
-# Useful development tools
-install -m755 -d %{buildroot}%{tools_dir}/scripts
-install Tools/README %{buildroot}%{tools_dir}/
-install Tools/scripts/*py %{buildroot}%{tools_dir}/scripts/
-
-# Documentation tools
-install -m755 -d %{buildroot}%{doc_tools_dir}
-#install -m755 Doc/tools/mkhowto %{buildroot}%{doc_tools_dir}
-
-# Useful demo scripts
-install -m755 -d %{buildroot}%{demo_dir}
-cp -ar Demo/* %{buildroot}%{demo_dir}
-
-# Get rid of crap
-find %{buildroot}/ -name "*~"|xargs rm -f
-find %{buildroot}/ -name ".cvsignore"|xargs rm -f
-find %{buildroot}/ -name "*.bat"|xargs rm -f
-find . -name "*~"|xargs rm -f
-find . -name ".cvsignore"|xargs rm -f
-
-
-# Provide binaries in the form of bin2 and bin2.7, thus implementing
-# (and expanding) the recommendations of PEP 394.
-# Do NOT provide unversioned binaries
-#
https://fedoraproject.org/wiki/Changes/Python_means_Python3
-mv %{buildroot}%{_bindir}/idle %{buildroot}%{_bindir}/idle%{pybasever}
-ln -s ./idle%{pybasever} %{buildroot}%{_bindir}/idle2
-
-mv %{buildroot}%{_bindir}/pynche %{buildroot}%{_bindir}/pynche%{pybasever}
-ln -s ./pynche%{pybasever} %{buildroot}%{_bindir}/pynche2
-
-mv %{buildroot}%{_bindir}/pydoc %{buildroot}%{_bindir}/pydoc%{pybasever}
-ln -s ./pydoc%{pybasever} %{buildroot}%{_bindir}/pydoc2
-
-mv %{buildroot}%{_bindir}/pygettext.py %{buildroot}%{_bindir}/pygettext%{pybasever}.py
-ln -s ./pygettext%{pybasever}.py %{buildroot}%{_bindir}/pygettext2.py
-
-mv %{buildroot}%{_bindir}/msgfmt.py %{buildroot}%{_bindir}/msgfmt%{pybasever}.py
-ln -s ./msgfmt%{pybasever}.py %{buildroot}%{_bindir}/msgfmt2.py
-
-mv %{buildroot}%{_bindir}/smtpd.py %{buildroot}%{_bindir}/smtpd%{pybasever}.py
-ln -s ./smtpd%{pybasever}.py %{buildroot}%{_bindir}/smtpd2.py
-
-# Fix for bug #136654
-rm -f %{buildroot}%{pylibdir}/email/test/data/audiotest.au
%{buildroot}%{pylibdir}/test/audiotest.au
-
-# Fix bug #143667: python should own /usr/lib/python2.x on 64-bit machines
-%if "%{_lib}" == "lib64"
-install -d %{buildroot}/%{_prefix}/lib/python%{pybasever}/site-packages
-%endif
-
-# Make python-devel multilib-ready (bug #192747, #139911)
-%global _pyconfig32_h pyconfig-32.h
-%global _pyconfig64_h pyconfig-64.h
-
-%ifarch %{power64} s390x x86_64 ia64 alpha sparc64 aarch64 %{mips64} riscv64
-%global _pyconfig_h %{_pyconfig64_h}
-%else
-%global _pyconfig_h %{_pyconfig32_h}
-%endif
-
-%if %{with debug_build}
-%global PyIncludeDirs python%{pybasever} python%{pybasever}-debug
-%else
-%global PyIncludeDirs python%{pybasever}
-%endif
-
-for PyIncludeDir in %{PyIncludeDirs} ; do
- mv %{buildroot}%{_includedir}/$PyIncludeDir/pyconfig.h \
- %{buildroot}%{_includedir}/$PyIncludeDir/%{_pyconfig_h}
- cat > %{buildroot}%{_includedir}/$PyIncludeDir/pyconfig.h << EOF
-#include <bits/wordsize.h>
-
-#if __WORDSIZE == 32
-#include "%{_pyconfig32_h}"
-#elif __WORDSIZE == 64
-#include "%{_pyconfig64_h}"
-#else
-#error "Unknown word size"
-#endif
-EOF
-done
-ln -s ../../libpython%{pybasever}.so
%{buildroot}%{pylibdir}/config/libpython%{pybasever}.so
-
-# Fix for bug 201434: make sure distutils looks at the right pyconfig.h file
-# Similar for sysconfig: sysconfig.get_config_h_filename tries to locate
-# pyconfig.h so it can be parsed, and needs to do this at runtime in site.py
-# when python starts up.
-#
-# Split this out so it goes directly to the pyconfig-32.h/pyconfig-64.h
-# variants:
-sed -i -e "s/'pyconfig.h'/'%{_pyconfig_h}'/" \
- %{buildroot}%{pylibdir}/distutils/sysconfig.py \
- %{buildroot}%{pylibdir}/sysconfig.py
-
-# Ensure that the curses module was linked against libncursesw.so, rather than
-# libncurses.so (bug 539917)
-ldd %{buildroot}/%{dynload_dir}/_curses*.so \
- | grep curses \
- | grep libncurses.so && (echo "_curses.so linked against
libncurses.so" ; exit 1)
-
-# Ensure that the debug modules are linked against the debug libpython, and
-# likewise for the optimized modules and libpython:
-for Module in %{buildroot}/%{dynload_dir}/*.so ; do
- case $Module in
- *_d.so)
- ldd $Module | grep %{py_INSTSONAME_optimized} &&
- (echo Debug module $Module linked against optimized
%{py_INSTSONAME_optimized} ; exit 1)
-
- ;;
- *)
- ldd $Module | grep %{py_INSTSONAME_debug} &&
- (echo Optimized module $Module linked against debug
%{py_INSTSONAME_optimized} ; exit 1)
- ;;
- esac
-done
-
-#
-# Systemtap hooks:
-#
-%if 0%{?with_systemtap}
-# Install a tapset for this libpython into tapsetdir, fixing up the path to the
-# library:
-mkdir -p %{buildroot}%{tapsetdir}
-%ifarch %{power64} s390x x86_64 ia64 alpha sparc64 aarch64 %{mips64}
-%global libpython_stp_optimized libpython%{pybasever}-64.stp
-%global libpython_stp_debug libpython%{pybasever}-debug-64.stp
-%else
-%global libpython_stp_optimized libpython%{pybasever}-32.stp
-%global libpython_stp_debug libpython%{pybasever}-debug-32.stp
-%endif
-
-sed \
- -e "s|LIBRARY_PATH|%{_libdir}/%{py_INSTSONAME_optimized}|" \
- %{SOURCE3} \
- > %{buildroot}%{tapsetdir}/%{libpython_stp_optimized}
-
-%if %{with debug_build}
-sed \
- -e "s|LIBRARY_PATH|%{_libdir}/%{py_INSTSONAME_debug}|" \
- %{SOURCE3} \
- > %{buildroot}%{tapsetdir}/%{libpython_stp_debug}
-%endif # with debug_build
-%endif # with_systemtap
-
-# Do bytecompilation with the newly installed interpreter.
-# compile *.pyo
-find %{buildroot} -type f -a -name "*.py" -print0 | \
- LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \
- PYTHONPATH="%{buildroot}%{_libdir}/python%{pybasever}
%{buildroot}%{_libdir}/python%{pybasever}/site-packages" \
- xargs -0 %{buildroot}%{_bindir}/python%{pybasever} -O -c 'import py_compile, sys;
[py_compile.compile(f, dfile=f.partition("%{buildroot}")[2]) for f in
sys.argv[1:]]' || :
-# compile *.pyc
-find %{buildroot} -type f -a -name "*.py" -print0 | \
- LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \
- PYTHONPATH="%{buildroot}%{_libdir}/python%{pybasever}
%{buildroot}%{_libdir}/python%{pybasever}/site-packages" \
- xargs -0 %{buildroot}%{_bindir}/python%{pybasever} -c 'import py_compile, sys;
[py_compile.compile(f, dfile=f.partition("%{buildroot}")[2]) for f in
sys.argv[1:]]' || :
-
-
-# Make library-files user writable
-/usr/bin/chmod 755 %{buildroot}%{dynload_dir}/*.so
-/usr/bin/chmod 755 %{buildroot}%{_libdir}/libpython%{pybasever}.so.1.0
-%if %{with debug_build}
-/usr/bin/chmod 755 %{buildroot}%{_libdir}/libpython%{pybasever}_d.so.1.0
-%endif
-
-# Remove pyc/pyo files from /usr/bin
-# They are not needed, and due to them, the resulting RPM is not multilib-clean
-#
https://bugzilla.redhat.com/show_bug.cgi?id=1703575
-rm %{buildroot}%{_bindir}/*.py{c,o}
-
-# Remove all remaining unversioned commands
-#
https://fedoraproject.org/wiki/Changes/Python_means_Python3
-rm %{buildroot}%{_bindir}/python
-rm %{buildroot}%{_bindir}/python-config
-rm %{buildroot}%{_mandir}/*/python.1*
-rm %{buildroot}%{_libdir}/pkgconfig/python.pc
-%if %{with debug_build}
-rm %{buildroot}%{_bindir}/python-debug
-rm %{buildroot}%{_bindir}/python-debug-config
-rm %{buildroot}%{_libdir}/pkgconfig/python-debug.pc
-%endif
-
-
-# ======================================================
-# Running the upstream test suite
-# ======================================================
-
-%check
-topdir=$(pwd)
-CheckPython() {
- ConfName=$1
- BinaryName=$2
- ConfDir=$(pwd)/build/$ConfName
-
- export OPENSSL_CONF=/non-existing-file
-
- echo STARTING: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName
-
- # Note that we're running the tests using the version of the code in the
- # builddir, not in the buildroot.
-
- pushd $ConfDir
-
- EXTRATESTOPTS="--verbose"
-
-%ifarch s390 s390x %{power64} %{arm} aarch64 %{mips}
- EXTRATESTOPTS="$EXTRATESTOPTS -x test_gdb"
-%endif
-%ifarch %{mips64}
- EXTRATESTOPTS="$EXTRATESTOPTS -x test_ctypes"
-%endif
-
-%if 0%{?with_huntrleaks}
- # Try to detect reference leaks on debug builds. By default this means
- # running every test 10 times (6 to stabilize, then 4 to watch):
- if [ "$ConfName" = "debug" ] ; then
- EXTRATESTOPTS="$EXTRATESTOPTS --huntrleaks : "
- fi
-%endif
-
- # Run the upstream test suite, setting "WITHIN_PYTHON_RPM_BUILD" so that the
- # our non-standard decorators take effect on the relevant tests:
- # @unittest._skipInRpmBuild(reason)
- # @unittest._expectedFailureInRpmBuild
- WITHIN_PYTHON_RPM_BUILD= EXTRATESTOPTS="$EXTRATESTOPTS" make test
-
- popd
-
- echo FINISHED: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName
-
-}
-
-%if %{with tests}
-
-# no locale coercion in python2
-# test_ssl:test_load_dh_params shutil.copies into unicode filename
-export LC_ALL=C.utf-8
-
-# Check each of the configurations:
-%if %{with debug_build}
-CheckPython \
- debug \
- python%{pybasever}-debug
-%endif # with debug_build
-CheckPython \
- optimized \
- python%{pybasever}
-
-%endif # with tests
-
-
-# ======================================================
-# Cleaning up
-# ======================================================
-
-
-%files
-%doc README
-%{_bindir}/pydoc2*
-%{_bindir}/%{python}
-%{_bindir}/python%{pybasever}
-%{_mandir}/*/python2*
-
-%files libs
-%doc README
-%license %{pylibdir}/LICENSE.txt
-%dir %{pylibdir}
-%dir %{dynload_dir}
-
-%{dynload_dir}/_md5module.so
-%{dynload_dir}/_sha256module.so
-%{dynload_dir}/_sha512module.so
-%{dynload_dir}/_shamodule.so
-
-%{dynload_dir}/Python-%{upstream_version}-py%{pybasever}.egg-info
-%{dynload_dir}/_bisectmodule.so
-%{dynload_dir}/_bsddb.so
-%{dynload_dir}/_codecs_cn.so
-%{dynload_dir}/_codecs_hk.so
-%{dynload_dir}/_codecs_iso2022.so
-%{dynload_dir}/_codecs_jp.so
-%{dynload_dir}/_codecs_kr.so
-%{dynload_dir}/_codecs_tw.so
-%{dynload_dir}/_collectionsmodule.so
-%{dynload_dir}/_csv.so
-%{dynload_dir}/_ctypes.so
-%{dynload_dir}/_curses.so
-%{dynload_dir}/_curses_panel.so
-%{dynload_dir}/_elementtree.so
-%{dynload_dir}/_functoolsmodule.so
-%{dynload_dir}/_hashlib.so
-%{dynload_dir}/_heapq.so
-%{dynload_dir}/_hotshot.so
-%{dynload_dir}/_io.so
-%{dynload_dir}/_json.so
-%{dynload_dir}/_localemodule.so
-%{dynload_dir}/_lsprof.so
-%{dynload_dir}/_multibytecodecmodule.so
-%{dynload_dir}/_multiprocessing.so
-%{dynload_dir}/_randommodule.so
-%{dynload_dir}/_socketmodule.so
-%{dynload_dir}/_sqlite3.so
-%{dynload_dir}/_ssl.so
-%{dynload_dir}/_struct.so
-%{dynload_dir}/arraymodule.so
-%{dynload_dir}/audioop.so
-%{dynload_dir}/binascii.so
-%{dynload_dir}/bz2.so
-%{dynload_dir}/cPickle.so
-%{dynload_dir}/cStringIO.so
-%{dynload_dir}/cmathmodule.so
-%{dynload_dir}/_cryptmodule.so
-%{dynload_dir}/datetime.so
-%{dynload_dir}/dbm.so
-%{dynload_dir}/dlmodule.so
-%{dynload_dir}/fcntlmodule.so
-%{dynload_dir}/future_builtins.so
-%if %{with_gdbm}
-%{dynload_dir}/gdbmmodule.so
-%endif
-%{dynload_dir}/grpmodule.so
-%{dynload_dir}/imageop.so
-%{dynload_dir}/itertoolsmodule.so
-%{dynload_dir}/linuxaudiodev.so
-%{dynload_dir}/math.so
-%{dynload_dir}/mmapmodule.so
-%{dynload_dir}/nismodule.so
-%{dynload_dir}/operator.so
-%{dynload_dir}/ossaudiodev.so
-%{dynload_dir}/parsermodule.so
-%{dynload_dir}/pyexpat.so
-%{dynload_dir}/readline.so
-%{dynload_dir}/resource.so
-%{dynload_dir}/selectmodule.so
-%{dynload_dir}/spwdmodule.so
-%{dynload_dir}/stropmodule.so
-%{dynload_dir}/syslog.so
-%{dynload_dir}/termios.so
-%{dynload_dir}/timemodule.so
-%{dynload_dir}/timingmodule.so
-%{dynload_dir}/unicodedata.so
-%{dynload_dir}/xxsubtype.so
-%{dynload_dir}/zlibmodule.so
-
-%dir %{site_packages}
-%{site_packages}/README
-%{pylibdir}/*.py*
-%{pylibdir}/*.doc
-%{pylibdir}/wsgiref.egg-info
-%dir %{pylibdir}/bsddb
-%{pylibdir}/bsddb/*.py*
-%{pylibdir}/compiler
-%dir %{pylibdir}/ctypes
-%{pylibdir}/ctypes/*.py*
-%{pylibdir}/ctypes/macholib
-%{pylibdir}/curses
-%dir %{pylibdir}/distutils
-%{pylibdir}/distutils/*.py*
-%{pylibdir}/distutils/README
-%{pylibdir}/distutils/command
-%exclude %{pylibdir}/distutils/command/wininst-*.exe
-%dir %{pylibdir}/email
-%{pylibdir}/email/*.py*
-%{pylibdir}/email/mime
-%{pylibdir}/encodings
-%{pylibdir}/hotshot
-%{pylibdir}/idlelib
-%{pylibdir}/importlib
-%dir %{pylibdir}/json
-%{pylibdir}/json/*.py*
-%{pylibdir}/lib2to3
-%exclude %{pylibdir}/lib2to3/tests
-%{pylibdir}/logging
-%{pylibdir}/multiprocessing
-%{pylibdir}/plat-linux2
-%{pylibdir}/pydoc_data
-%dir %{pylibdir}/sqlite3
-%{pylibdir}/sqlite3/*.py*
-
-# Some bits of test are used for actual testing of stuff, not just python itself:
-# See also
https://bugzilla.redhat.com/show_bug.cgi?id=1528899
-%dir %{pylibdir}/test
-%{pylibdir}/test/__init__.py*
-%{pylibdir}/test/support/
-%{pylibdir}/test/script_helper.py*
-%{pylibdir}/test/test_support.py*
-
-%{pylibdir}/unittest
-%{pylibdir}/wsgiref
-%{pylibdir}/xml
-%if "%{_lib}" == "lib64"
-%attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}
-%attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}/site-packages
-%endif
-
-# "Makefile" and the config-32/64.h file are needed by
-# distutils/sysconfig.py:_init_posix(), so we include them in the libs
-# package, along with their parent directories (bug 531901):
-%dir %{pylibdir}/config
-%{pylibdir}/config/Makefile
-%dir %{_includedir}/python%{pybasever}
-%{_includedir}/python%{pybasever}/%{_pyconfig_h}
-
-%{_libdir}/%{py_INSTSONAME_optimized}
-%if 0%{?with_systemtap}
-%dir %(dirname %{tapsetdir})
-%dir %{tapsetdir}
-%{tapsetdir}/%{libpython_stp_optimized}
-%doc systemtap-example.stp pyfuntop.stp
-%endif
-
-%dir %{pylibdir}/ensurepip/
-%{pylibdir}/ensurepip/*.py*
-%if %{with rpmwheels}
-%exclude %{pylibdir}/ensurepip/_bundled
-%else
-%dir %{pylibdir}/ensurepip/_bundled
-%{pylibdir}/ensurepip/_bundled/*.whl
-%endif
-
-
-%files devel
-%{_libdir}/pkgconfig/python-%{pybasever}.pc
-%{_libdir}/pkgconfig/python2.pc
-%{pylibdir}/config/*
-%exclude %{pylibdir}/config/Makefile
-%{pylibdir}/distutils/command/wininst-*.exe
-%{_includedir}/python%{pybasever}/*.h
-%exclude %{_includedir}/python%{pybasever}/%{_pyconfig_h}
-%doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit
-%{_bindir}/python2-config
-%{_bindir}/python%{pybasever}-config
-%{_libdir}/libpython%{pybasever}.so
-
-%files tools
-%doc Tools/pynche/README.pynche
-%{site_packages}/pynche
-%{_bindir}/smtpd2*.py
-
-#
https://bugzilla.redhat.com/show_bug.cgi?id=1111275
-%exclude %{_bindir}/2to3*
-
-%{_bindir}/idle2*
-%{_bindir}/pynche2*
-%{_bindir}/pygettext2*.py
-%{_bindir}/msgfmt2*.py
-%{tools_dir}
-%{demo_dir}
-%{pylibdir}/Doc
-
-%files tkinter
-%{pylibdir}/lib-tk
-%if ! 0%{?_module_build}
-%{dynload_dir}/_tkinter.so
-%endif
-
-%files test
-%{pylibdir}/bsddb/test
-%{pylibdir}/ctypes/test
-%{pylibdir}/distutils/tests
-%{pylibdir}/email/test
-%{pylibdir}/json/tests
-%{pylibdir}/lib2to3/tests
-%{pylibdir}/sqlite3/test
-%{pylibdir}/test/*
-
-# Some bits of test are used for actual testing of stuff, not just python itself:
-# See also
https://bugzilla.redhat.com/show_bug.cgi?id=1528899
-%exclude %{pylibdir}/test/__init__.py*
-%exclude %{pylibdir}/test/support/
-%exclude %{pylibdir}/test/script_helper.py*
-%exclude %{pylibdir}/test/test_support.py*
-
-%{dynload_dir}/_ctypes_test.so
-%{dynload_dir}/_testcapimodule.so
-
-
-# We don't bother splitting the debug build out into further subpackages:
-# if you need it, you're probably a developer.
-
-# Hence the manifest is the combination of analogous files in the manifests of
-# all of the other subpackages
-
-%if %{with debug_build}
-%files debug
-
-# Analog of the core subpackage's files:
-%{_bindir}/%{python}-debug
-%{_bindir}/python%{pybasever}-debug
-
-# Analog of the -libs subpackage's files, with debug builds of the built-in
-# "extension" modules:
-
-%{dynload_dir}/_md5module_d.so
-%{dynload_dir}/_sha256module_d.so
-%{dynload_dir}/_sha512module_d.so
-%{dynload_dir}/_shamodule_d.so
-
-%{dynload_dir}/_bisectmodule_d.so
-%{dynload_dir}/_bsddb_d.so
-%{dynload_dir}/_codecs_cn_d.so
-%{dynload_dir}/_codecs_hk_d.so
-%{dynload_dir}/_codecs_iso2022_d.so
-%{dynload_dir}/_codecs_jp_d.so
-%{dynload_dir}/_codecs_kr_d.so
-%{dynload_dir}/_codecs_tw_d.so
-%{dynload_dir}/_collectionsmodule_d.so
-%{dynload_dir}/_csv_d.so
-%{dynload_dir}/_ctypes_d.so
-%{dynload_dir}/_curses_d.so
-%{dynload_dir}/_curses_panel_d.so
-%{dynload_dir}/_elementtree_d.so
-%{dynload_dir}/_functoolsmodule_d.so
-%{dynload_dir}/_hashlib_d.so
-%{dynload_dir}/_heapq_d.so
-%{dynload_dir}/_hotshot_d.so
-%{dynload_dir}/_io_d.so
-%{dynload_dir}/_json_d.so
-%{dynload_dir}/_localemodule_d.so
-%{dynload_dir}/_lsprof_d.so
-%{dynload_dir}/_multibytecodecmodule_d.so
-%{dynload_dir}/_multiprocessing_d.so
-%{dynload_dir}/_randommodule_d.so
-%{dynload_dir}/_socketmodule_d.so
-%{dynload_dir}/_sqlite3_d.so
-%{dynload_dir}/_ssl_d.so
-%{dynload_dir}/_struct_d.so
-%{dynload_dir}/arraymodule_d.so
-%{dynload_dir}/audioop_d.so
-%{dynload_dir}/binascii_d.so
-%{dynload_dir}/bz2_d.so
-%{dynload_dir}/cPickle_d.so
-%{dynload_dir}/cStringIO_d.so
-%{dynload_dir}/cmathmodule_d.so
-%{dynload_dir}/_cryptmodule_d.so
-%{dynload_dir}/datetime_d.so
-%{dynload_dir}/dbm_d.so
-%{dynload_dir}/dlmodule_d.so
-%{dynload_dir}/fcntlmodule_d.so
-%{dynload_dir}/future_builtins_d.so
-%if %{with_gdbm}
-%{dynload_dir}/gdbmmodule_d.so
-%endif
-%{dynload_dir}/grpmodule_d.so
-%{dynload_dir}/imageop_d.so
-%{dynload_dir}/itertoolsmodule_d.so
-%{dynload_dir}/linuxaudiodev_d.so
-%{dynload_dir}/math_d.so
-%{dynload_dir}/mmapmodule_d.so
-%{dynload_dir}/nismodule_d.so
-%{dynload_dir}/operator_d.so
-%{dynload_dir}/ossaudiodev_d.so
-%{dynload_dir}/parsermodule_d.so
-%{dynload_dir}/pyexpat_d.so
-%{dynload_dir}/readline_d.so
-%{dynload_dir}/resource_d.so
-%{dynload_dir}/selectmodule_d.so
-%{dynload_dir}/spwdmodule_d.so
-%{dynload_dir}/stropmodule_d.so
-%{dynload_dir}/syslog_d.so
-%{dynload_dir}/termios_d.so
-%{dynload_dir}/timemodule_d.so
-%{dynload_dir}/timingmodule_d.so
-%{dynload_dir}/unicodedata_d.so
-%{dynload_dir}/xxsubtype_d.so
-%{dynload_dir}/zlibmodule_d.so
-
-# No need to split things out the "Makefile" and the config-32/64.h file as we
-# do for the regular build above (bug 531901), since they're all in one package
-# now; they're listed below, under "-devel":
-
-%{_libdir}/%{py_INSTSONAME_debug}
-%if 0%{?with_systemtap}
-%dir %(dirname %{tapsetdir})
-%dir %{tapsetdir}
-%{tapsetdir}/%{libpython_stp_debug}
-%endif
-
-# Analog of the -devel subpackage's files:
-%dir %{pylibdir}/config-debug
-%{_libdir}/pkgconfig/python-%{pybasever}-debug.pc
-%{_libdir}/pkgconfig/python2-debug.pc
-%{pylibdir}/config-debug/*
-%{_includedir}/python%{pybasever}-debug/*.h
-%{_bindir}/python2-debug-config
-%{_bindir}/python%{pybasever}-debug-config
-%{_libdir}/libpython%{pybasever}_d.so
-
-# Analog of the -tools subpackage's files:
-# None for now; we could build precanned versions that have the appropriate
-# shebang if needed
-
-%if ! 0%{?_module_build}
-# Analog of the tkinter subpackage's files:
-%{dynload_dir}/_tkinter_d.so
-%endif
-
-# Analog of the -test subpackage's files:
-%{dynload_dir}/_ctypes_test_d.so
-%{dynload_dir}/_testcapimodule_d.so
-
-%endif # with debug_build
-
-# We put the debug-gdb.py file inside /usr/lib/debug to avoid noise from
-# ldconfig (rhbz:562980).
-#
-# The /usr/lib/rpm/redhat/macros defines the __debug_package macro to use
-# debugfiles.list, and it appears that everything below /usr/lib/debug and
-# (/usr/src/debug) gets added to this file (via LISTFILES) in
-# /usr/lib/rpm/find-debuginfo.sh
-#
-# Hence by installing it below /usr/lib/debug we ensure it is added to the
-# -debuginfo subpackage
-# (if it doesn't, then the rpmbuild ought to fail since the debug-gdb.py
-# payload file would be unpackaged)
-
-# Workaround for rhbz#1476593
-%undefine _debuginfo_subpackages
-
-# ======================================================
-# Finally, the changelog:
-# ======================================================
-
-%changelog
-* Tue Aug 20 2019 Miro Hronok <mhroncok(a)redhat.com> - 2.7.16-7
-- Conditionalize python2-devel runtime dependencies
-
-* Wed Aug 14 2019 Miro Hronok <mhroncok(a)redhat.com> - 2.7.16-6
-- Rebuilt for Python 3.8
-
-* Wed Aug 14 2019 Miro Hronok <mhroncok(a)redhat.com> - 2.7.16-5
-- Bootstrap for Python 3.8
-
-* Fri Jul 26 2019 Fedora Release Engineering <releng(a)fedoraproject.org> - 2.7.16-4
-- Rebuilt for
https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
-
-* Fri Jul 12 2019 Miro Hronok <mhroncok(a)redhat.com> - 2.7.16-3
--
https://fedoraproject.org/wiki/Changes/Python_means_Python3
-- The python-unversioned-command package is no longer Python 2, but 3
-- The python, pydoc, python-config, python-debug, idle, pygettext.py and
- msgfmt.py commands are now in python3
-
-* Fri Apr 26 2019 Tomas Orsava <torsava(a)redhat.com> - 2.7.16-2
-- Remove pyc/pyo files from /usr/bin (#1703575)
-- Update the macro that disables automatic bytecompilation to the new correct
- form (#1597664)
-
-* Mon Mar 04 2019 Miro Hronok <mhroncok(a)redhat.com> - 2.7.16-1
-- Update to 2.7.16 final
-
-* Tue Feb 19 2019 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.16~rc1-1
-- Update to 2.7.16rc1
-
-* Sun Feb 17 2019 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 2.7.15-14
-- Rebuild for readline 8.0
-
-* Sat Feb 02 2019 Fedora Release Engineering <releng(a)fedoraproject.org> -
2.7.15-13
-- Rebuilt for
https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
-
-* Mon Jan 14 2019 Bjrn Esser <besser82(a)fedoraproject.org> - 2.7.15-12
-- Rebuilt for libcrypt.so.2 (#1666033)
-
-* Mon Sep 24 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.15-11
-- Security fix for CVE-2018-14647 (#1631822)
-
-* Thu Sep 20 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.15-10
-- Security fix for CVE-2018-1000802 (#1631662)
-
-* Thu Sep 06 2018 Petr Viktorin <pviktori(a)redhat.com> - 2.7.15-9
-- Deprecate python2 and all subpackages in Fedora 30+ (#1625773)
-
-* Thu Aug 30 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.15-8
-- Require python2-setuptools from python2-devel to prevent packaging errors (#1623922)
-
-* Tue Aug 21 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.15-7
-- Use RPM built wheels of pip and setuptools in ensurepip instead of our rewheel patch
-
-* Sat Jul 14 2018 Fedora Release Engineering <releng(a)fedoraproject.org> - 2.7.15-6
-- Rebuilt for
https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
-
-* Thu Jun 14 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.15-5
-- Move /usr/bin/python into a separate package
-
https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_...
-- Revert
https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build
-
-* Wed Jun 13 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.15-4
-- Rebuilt for Python 3.7
-
-* Wed Jun 13 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.15-3
-- Bootstrap for Python 3.7
-
-* Tue May 15 2018 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.15-2
-- Fix loading of the gdb python plugin (rhbz#1578001)
-
-* Tue May 01 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.15-1
-- Update to version 2.7.15
-
-* Wed Apr 25 2018 Tomas Orsava <torsava(a)redhat.com> - 2.7.14-17
-- Change shebangs to the proper versioned binary
-- Bytecompile files manually, disbale brp-python-bytecompile
-Resolves: rhbz#1572171
-
-* Fri Apr 13 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.14-16
-- Remove Obsoletes tag from when python was renamed to python2 (Fedora 25 was last)
-
-* Wed Mar 14 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.14-15
-- Fix broken SSL module
-Resolves: rhbz#1555081
-
-* Tue Mar 13 2018 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.14-14
-- Do not send IP addresses in SNI TLS extension
-
-* Mon Feb 26 2018 Petr Viktorin <pviktori(a)redhat.com> - 2.7.14-13
-- Fix -Wint-in-bool-context warnings
-Resolves: rhbz#1473425
-
-* Sat Feb 24 2018 Florian Weimer <fweimer(a)redhat.com> - 2.7.14-12
-- Rebuild with new LDFLAGS from redhat-rpm-config
-
-* Thu Feb 15 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.14-11
-- Move test.support and test.script_helper to python2-libs
-Resolves: rhbz#1528899
-
-* Fri Feb 09 2018 Fedora Release Engineering <releng(a)fedoraproject.org> -
2.7.14-10
-- Rebuilt for
https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
-
-* Tue Jan 30 2018 Petr Viktorin <pviktori(a)redhat.com> - 2.7.14-9
-- Add patch 288: warn/fail if Python 2 is called as /usr/bin/python and
- PYTHON_DISALLOW_AMBIGUOUS_VERSION is set
-- Add patch 289: Fix for over-aligned GC info
-
-* Sat Jan 20 2018 Bjrn Esser <besser82(a)fedoraproject.org> - 2.7.14-8
-- Rebuilt for switch to libxcrypt
-
-* Wed Jan 17 2018 Petr Viktorin <pviktori(a)redhat.com> - 2.7.14-7
-- Build the nis module with tirpc
-
-* Tue Jan 16 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.14-6
-- Rebuild for reverted gdbm 1.13 on Fedora 27
-
-* Thu Jan 11 2018 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.14-5
-- Rebuild for gdbm 1.14
-
-* Mon Dec 11 2017 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.14-4
-- Fix hanging of all threads when trying to access an inaccessible NFS server.
-
-* Thu Nov 09 2017 Miro Hronok <mhroncok(a)redhat.com> - 2.7.14-3
-- Make the -devel package require redhat-rpm-config
-Resolves: rhbz#1496757
-
-* Thu Nov 02 2017 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.14-2
-- Add a new PYTHONSHOWREFCOUNT environment variable for printing the reference
- count in debug builds.
-- Fix nondeterministic read in test_pty.
-
-* Mon Oct 09 2017 Iryna Shcherbina <ishcherb(a)redhat.com> - 2.7.14-1
-- Update to version 2.7.14
-
-* Thu Aug 31 2017 Tomas Orsava <torsava(a)redhat.com> - 2.7.13-18
-- Switch some macros into bconds to facilitate modularity
-
-* Wed Aug 16 2017 Miro Hronok <mhroncok(a)redhat.com> - 2.7.13-17
-- Exclude /usr/bin/2to3 (rhbz#1111275)
-
-* Mon Aug 14 2017 David "Sanqui" Labsk <dlabsky(a)redhat.com> - 2.7.13-16
-- Do not generate debuginfo subpackages (#1476593)
-
-* Wed Aug 09 2017 Michal Cyprian <mcyprian(a)redhat.com> - 2.7.13-15
-- Revert "Add --executable option to install.py command"
- This enhancement is currently not needed and it can possibly
- collide with `pip --editable`option
-
-* Thu Aug 03 2017 Fedora Release Engineering <releng(a)fedoraproject.org> -
2.7.13-14
-- Rebuilt for
https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
-
-* Thu Jul 27 2017 Fedora Release Engineering <releng(a)fedoraproject.org> -
2.7.13-13
-- Rebuilt for
https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
-
-* Mon Jun 26 2017 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.13-11
-- Fix test_alpn_protocols from test_ssl
-
-* Wed May 31 2017 Miro Hronok <mhroncok(a)redhat.com> - 2.7.13-11
-- Change fixed Obsoletes version with a dynamic one (rhbz#1457336)
-
-* Thu May 18 2017 Karsten Hopp <karsten(a)redhat.com> - 2.7.13-10
-- revert logic for modularity patch and enable gdbm for modularity
-
-* Tue May 16 2017 Tomas Orsava <torsava(a)redhat.com> - 2.7.13-9
-- Added a dependency to the devel subpackage on python3-rpm-generators which
- have been excised out of rpm-build
-- There is no Python 2 package containing Python RPM generators, therefore
- Python 3 is needed when Python 2 package is to be built, but this was
- decided not to be a problem due to nearing EOL of Python 2
-- Involves: rhbz#1410631, rhbz#1444925
-
-* Wed May 10 2017 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.13-8
-- Enable profile guided optimizations for x86_64 and i686 architectures
-- Update description to reflect that Python 2 is not the default Python
-
-* Tue Apr 25 2017 Karsten Hopp <karsten(a)redhat.com> - 2.7.13-7
-- apply modularity patch only during module builds
-
-* Sun Apr 23 2017 Karsten Hopp <karsten(a)redhat.com> - 2.7.13-6
-- add missing patch
-
-* Fri Apr 21 2017 Karsten Hopp <karsten(a)redhat.com> - 2.7.13-5
-- drop a couple of dependencies for Modularity builds
-
-* Tue Feb 21 2017 Michal Cyprian <mcyprian(a)redhat.com> - 2.7.13-5
-- Add --executable option to install.py command
-
-* Fri Feb 17 2017 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.13-4
-- Fix the upgrade path to F26 due to renaming the package to python2 (rhbz#1420332)
-
-* Sat Feb 11 2017 Fedora Release Engineering <releng(a)fedoraproject.org> - 2.7.13-3
-- Rebuilt for
https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
-
-* Thu Jan 12 2017 Igor Gnatenko <ignatenko(a)redhat.com> - 2.7.13-2
-- Rebuild for readline 7.x
-
-* Wed Jan 11 2017 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.13-1
-- Update to 2.7.13
-- Don't blow up on EL7 kernel (random generator) (rhbz#1410175, rhbz#1410187)
-- Require glibc >= 2.24.90-26 (rhbz#1410644)
-
-* Thu Oct 27 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-9
-- Rename package to python2 and also rename the subpackages accordingly
-- Provide and obsolete python and the respective subpackages to ensure a clean
-upgrade path
-- Remove old provides for packages that got into stdlib
-- Implement PEP 394
-
-* Wed Oct 12 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-8
-- Port ssl and hashlib modules to OpenSSL 1.1.0
-- Drop hashlib patch for now
-- Add riscv64 arch to 64bit and no-valgrind arches
-
-* Thu Sep 29 2016 Miro Hronok <mhroncok(a)redhat.com> - 2.7.12-7
-- Provide python27
-
-* Fri Sep 02 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-6
-- Remove unversioned Obsoletes
-
-* Thu Sep 01 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-5
-- Rebase rewheel patch so it applies properly (rhbz#1372183)
-
-* Tue Aug 09 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-4
-- SPEC file cleanup
-- Removal of unapplied patches
-
-* Tue Aug 09 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-3
-- Fix for CVE-2016-1000110 HTTPoxy attack
-- SPEC file cleanup
-
-* Mon Aug 01 2016 Michal Toman <mtoman(a)fedoraproject.org> - 2.7.12-2
-- Build properly on MIPS
-
-* Fri Jul 15 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-1
-- Update to 2.7.12
-- Refactored patches: 10, 102, 112, 134, 153
-- Dropped patches: 166, 209, 210
-
-* Fri Jul 08 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.11-8
-- Refactor patch for properly fixing CVE-2016-5636
-
-* Fri Jul 08 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.11-7
-- Fix test_pyexpat failure with Expat version of 2.2.0
-
-* Thu Jun 16 2016 Tomas Orsava <torsava(a)redhat.com> - 2.7.11-6
-- Fix for: CVE-2016-0772 python: smtplib StartTLS stripping attack
-- Raise an error when STARTTLS fails
-- rhbz#1303647:
https://bugzilla.redhat.com/show_bug.cgi?id=1303647
-- rhbz#1346344:
https://bugzilla.redhat.com/show_bug.cgi?id=1346344
-- Fixed upstream:
https://hg.python.org/cpython/rev/b3ce713fb9be
-
-* Mon Jun 13 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.11-5
-- Added patch for fixing possible integer overflow and heap corruption in
zipimporter.get_data()
-
-* Thu Feb 04 2016 Fedora Release Engineering <releng(a)fedoraproject.org> - 2.7.11-4
-- Rebuilt for
https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
-
-* Wed Jan 13 2016 Orion Poplawski <orion(a)cora.nwra.com> - 2.7.11-3
-- Drop macros, require python/python2-rpm-macros
-
-* Wed Dec 30 2015 Orion Poplawski <orion(a)cora.nwra.com> - 2.7.11-2
-- Get ready for separate python-macros package
-
-* Tue Dec 15 2015 Robert Kuska <rkuska(a)redhat.com> - 2.7.11-1
-- Update to 2.7.11
-
-* Thu Oct 15 2015 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.10-11
-- provide/obsolete _isa packages in python_provide (#1271776)
-
-* Wed Sep 23 2015 Robert Kuska <rkuska(a)redhat.com> - 2.7.10-10
-- Revert the moving modules to python-tools because distutils uses lib2to3
-
-* Tue Sep 22 2015 Robert Kuska <rkuska(a)redhat.com> - 2.7.10-9
-- Move idlelib and lib2to3 modules to pythont-tools
-
-* Thu Sep 3 2015 Orion Poplawski <orion(a)cora.nwra.com> - 2.7.10-8
-- Fix quoting in %%python_provide macro
-
-* Thu Sep 3 2015 Orion Poplawski <orion(a)cora.nwra.com> - 2.7.10-7
-- Add obsoletes to %%python_provide macro to fix upgrade path
-- Fix python2- provides for python- packages in %%python_provide
-
-* Thu Jul 23 2015 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.10-6
-- python-macros: remove R on python (#1246036)
-
-* Wed Jul 22 2015 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.10-5
-- Include epoch in the python_provide macro fpc#534 (Slavek Kabrda)
-
-* Mon Jun 29 2015 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.10-4
-- correct python_provide macro to include version only when emiting provides
-
-* Thu Jun 25 2015 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.10-3
-- Add unversioned python-macros from fpc#281 and fpc#534
- and require it from python-devel
-- Make python-macros noarch
-
-* Wed Jun 17 2015 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.10-2
-- Make relocating Python by changing _prefix actually work
-Resolves: rhbz#1231801
-
-* Mon May 25 2015 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.10-1
-- Update to 2.7.10
-
-* Tue May 5 2015 Peter Robinson <pbrobinson(a)fedoraproject.org> 2.7.9-11
-- Disable test_gdb on aarch64 (rhbz#1196181), it joins all other non x86 arches
-
-* Wed Apr 15 2015 Robert Kuska <rkuska(a)redhat.com> - 2.7.9-10
-- Remove provides/obsolates for unittest2
-- Skip test_gdb on arm until rhbz#1196181 is resolved
-
-* Thu Mar 05 2015 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.9-9
-- Add proper rewheel Requires
-
-* Sat Feb 21 2015 Till Maas <opensource(a)till.name> - 2.7.9-8
-- Rebuilt for Fedora 23 Change
-
https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-...
-
-* Sat Feb 21 2015 Till Maas <opensource(a)till.name> - 2.7.9-7
-- Rebuilt for Fedora 23 Change
-
https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-...
-
-* Tue Feb 17 2015 Ville Skytt <ville.skytta(a)iki.fi> - 2.7.9-6
-- Own systemtap dirs (#710733)
-
-* Fri Feb 06 2015 Karsten Hopp <karsten(a)redhat.com> 2.7.9-5
-- disable test_gdb on ppc64* until rhbz#1132488 is really resolved
-
-* Tue Jan 20 2015 Slavek Kabrda <bkabrda(a)redhat.com> - 2.7.9-4
-- We need to provide both arch specific and noarch Provide for python2-devel
-in order not to break noarch builds.
-
-* Tue Jan 20 2015 Slavek Kabrda <bkabrda(a)redhat.com> - 2.7.9-3
-- Make python2-devel provide arch specific.
-Resolves: rhbz#1183530
-
-* Mon Jan 12 2015 Dan Hork <dan[at]danny.cz> - 2.7.9-2
-- build with valgrind on ppc64le
-- disable test_gdb on s390(x) until rhbz#1181034 is resolved
-
-* Thu Dec 11 2014 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.9-1
-- Update to 2.7.9
-- Refreshed patches: #55, #137, #146, #153, #156, #198
-- Dropped patches: #196, #197
-- New patch: #199
-- Added the rewheel module
-
-* Mon Nov 24 2014 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.8-10
-- Improve python2_version macros
-
-* Thu Nov 13 2014 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.8-9
-- Add python2_version_nodots macro
-
-* Mon Nov 10 2014 Slavek Kabrda <bkabrda(a)redhat.com> - 2.7.8-8
-- Revert previous change, see rhbz#1161166#c6.
-
-* Fri Nov 07 2014 Slavek Kabrda <bkabrda(a)redhat.com> - 2.7.8-7
-- Provide importable unittest2
-Resolves: rhbz#1161166
-
-* Thu Aug 21 2014 Robert Kuska <rkuska(a)redhat.com> - 2.7.8-6
-- Update patch 196 (ssl backport)
-
-* Tue Aug 19 2014 Robert Kuska <rkuska(a)redhat.com> - 2.7.8-5
-- Backport ssl module from python3
-
-* Sun Aug 17 2014 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.7.8-4
-- Rebuilt for
https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
-
-* Thu Jul 31 2014 Tom Callaway <spot(a)fedoraproject.org> - 2.7.8-3
-- fix license handling
-
-* Fri Jul 18 2014 Robert Kuska <rkuska(a)redhat.com> - 2.7.8-2
-- Enable SSLv2 and SSLv3 when SSLv23_method is used in ssl
-
-* Mon Jul 14 2014 Robert Kuska <rkuska(a)redhat.com> - 2.7.8-1
-- Update to 2.7.8
-
-* Fri Jul 11 2014 Dan Hork <dan[at]danny.cz> - 2.7.7-3
-- rebuilt for updated libffi ABI on ppc64le
-
-* Sat Jun 7 2014 Peter Robinson <pbrobinson(a)fedoraproject.org> 2.7.7-2
-- aarch64 has valgrind, just list those that don't support it
-
-* Wed Jun 04 2014 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.7-1
-- Update to 2.7.7
-- Refreshed patches: #16, #112, #138, #147, #157, #166, #173, #5000
-- Dropped patches: #190, #192, #194
-
-* Tue Jun 03 2014 Dan Hork <dan[at]danny.cz> - 2.7.6-9
-- update the arch list where valgrind exists - %%power64 includes also
- ppc64le which is not supported yet
-
-* Wed May 21 2014 Jaroslav karvada <jskarvad(a)redhat.com> - 2.7.6-8
-- Rebuilt for
https://fedoraproject.org/wiki/Changes/f21tcl86
-
-* Fri May 09 2014 Tomas Radej <tradej(a)redhat.com> - 2.7.6-7
-- Fixed obsoletes on ordereddict (bz #1095434)
-
-* Mon Apr 14 2014 Tomas Radej <tradej(a)redhat.com> - 2.7.6-6
-- Obsoletes python-ordereddict (bz #1085593, not precisely 1:1 replacement)
-
-* Mon Apr 07 2014 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.6-5
-- Fix test failure with SQLite > 3.8.4.
-- Obsolete/Provide python-unittest2
-Related: rhbz#1060426
-
-* Wed Feb 19 2014 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.6-4
-- Enable loading sqlite extensions.
-Resolves: rhbz#1066708
-
-* Mon Feb 10 2014 Tomas Radej <tradej(a)redhat.com> - 2.7.6-3
-- Fixed buffer overflow (upstream patch)
-Resolves: rhbz#1062375
-
-* Tue Feb 04 2014 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.6-2
-- Install macros in _rpmconfigdir.
-
-* Wed Jan 29 2014 Tomas Radej <tradej(a)redhat.com> - 2.7.6-1
-- Updated to v2.7.6
-- Freshened patches 102, 111, 112, 136, and 142
-- Dropped patches 186, 188 (both fixed upstream)
-
-* Wed Jan 15 2014 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.5-11
-- Make library-files user writable to get rid of
- Permission Denied in buildlog from debuginfo-packaging
-
-* Tue Jan 14 2014 Dennis Gilmore <dennis(a)ausil.us> - 2.7.5-10
-- enable valgrind support on 32 bit arm
-
-* Tue Nov 12 2013 Tomas Radej <tradej(a)redhat.com> - 2.7.5-9
-- Import get_python_version in bdist_rpm
-Resolves: rhbz#1029082
-
-* Tue Oct 08 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-8
-- Fix processing gdb py-bt command in eval calls.
-Resolves: rhbz#1008154
-
-* Tue Sep 03 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-7
-- Removed ancient Obsolete: python-sqlite2.
-
-* Mon Aug 26 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-6
-- Sync back/renumber patches to stay consistent with rhel.
-
-* Mon Aug 19 2013 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.5-5
-- Added fix for CVE-2013-4238 (rhbz#998430)
-
-* Sun Aug 04 2013 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.7.5-4
-- Rebuilt for
https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
-
-* Mon Jul 08 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-3
-- Fix build with libffi containing multilib wrapper for ffi.h (rhbz#979696).
-
-* Mon Jul 08 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-2
-- Obsolete PyXML as requested in rhbz#981137.
-
-* Thu May 16 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-1
-- Updated to Python 2.7.5.
-- Refreshed patches: 0 (config), 102 (lib64), 121 (add Modules to build path),
-153 (gdb test noise)
-- Dropped patches: 126, 127 (big endian issues, both fixed upstream),
-175 (configure -Wformat, fixed upstream)
-- Synced patch numbers with python3.spec.
-
-* Tue May 14 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.4-5
-- fix multilib issue in python-tools due to /usr/bin/pynche (source 7;
-rhbz#831437)
-
-* Thu May 02 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.4-4
-- Add patch that enables building on ppc64p7.
-
-* Mon Apr 22 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.4-3
-- Allow arbitrary timeout in Condition.wait (rhbz#917709).
-
-* Thu Apr 11 2013 Kalev Lember <kalevlember(a)gmail.com> - 2.7.4-2
-- Build with libdb 5.3 instead of libdb4
-- Refreshed patches: 0 (config), 102 (lib64)
-- Dropped patches: 54 (db4 version), 159 (db4 include path adjustment)
-
-* Mon Apr 08 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.4-1
-- Updated to Python 2.7.4.
-- Refreshed patches: 0 (config), 7 (sqlite encoding), 16 (rpath in config),
-55 (systemtap), 111 (no static lib), 112 (debug build), 113 (more
-configuration flags), 130 (add extension to python config), 134 (fix
-COUNT_ALLOCS in test_sys), 146 (haslib FIPS), 147 (add debug malloc stats),
-153 (fix gdb test noise), 157 (uid, gid overflow - fixed upstream, just
-keeping few more downstream tests), 165 (crypt module salt backport),
-175 (fix configure Wformat), 5000 (regenerated autotooling patch)
-- Dropped patches: 101 (lib64 regex; merged upstream), 171 (exception on
-missing /dev/urandom; merged upstream), 172 (poll for multiprocessing socket
-connection; merged upstream)
-
-* Mon Mar 25 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-35
-- fix gcc 4.8 incompatibility (rhbz#927358); regenerate autotool intermediates
-
-* Wed Mar 6 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-34
-- restrict scope of workaround for cmpi-bindings issue to avoid breaking
-in-tree running of test_sys and test_subprocess (rhbz#817554)
-
-* Wed Mar 6 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-33
-- add workaround for cmpi-bindings issue (rhbz#817554)
-
-* Mon Mar 4 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-32
-- add workaround for ENOPROTOOPT seen running selftests in Koji
-(rhbz#913732)
-
-* Mon Mar 4 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-31
-- remove config flag from /etc/rpm/macros.python2
-
-* Fri Feb 22 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-30
-- remove __debug_package macro from comment
-
-* Fri Feb 22 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-29
-- drop -b from application of patch 157 (uid/gid overflows)
-
-* Fri Feb 22 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-28
-- fix bogus dates in changelog
-
-* Thu Feb 21 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-27
-- port _multiprocessing.Connection.poll() to use the "poll" syscall, rather
-than "select", allowing large numbers of subprocesses (patch 172;
-rhbz#849992)
-
-* Thu Feb 21 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-26
-- raise correct exception in os.urandom() when /dev/urandom is missing
-(patch 171; rhbz#907383)
-
-* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-25
-- in debug builds, try to print repr() when a C-level assert fails in the
-garbage collector (typically indicating a reference-counting error somewhere
-else e.g in an extension module) (patch 170; rhbz#850013)
-
-* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-24
-- move lib2to3/tests from python-libs to python-test (rhbz#850056)
-
-* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-23
-- use SHA-256 rather than implicitly using MD5 within the challenge handling
-in multiprocessing.connection (patch 169; rhbz#879695)
-
-* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-22
-- fix a problem with distutils.sysconfig when CFLAGS is defined in the
-environment (patch 168; rhbz#849994)
-
-* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-21
-- don't run any stack navigation tests in test_gdb for optimized builds
-(patch 167; rhbz#912025)
-
-* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-20
-- s/cryptmodule/_cryptmodule/ in package payload (rhbz#835021)
-
-* Tue Feb 19 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-19
-- bulletproof the gdb debugging hooks against a failure seen in ARM builds
-(patch 166; rhbz#912025)
-- re-enable make check on ARM (rhbz#912025)
-
-* Tue Feb 19 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-18
-- backport pre-canned ways of salting a password to the "crypt" module from
3.3
-(rhbz#835021)
-
-* Tue Feb 19 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-17
-- remove "_default_patch_fuzz" directive to avoid patches being silently
-misapplied (refresh patch 1, patch 101, patch 102, patch 111, patch 121,
-patch 158; rename patch 1, patch 101, patch 121; apply patch 54 before the
-lib64 patches to avoid fuzz problems caused by the conditional application
-of the lib64 patches)
-
-* Mon Feb 18 2013 Peter Robinson <pbrobinson(a)fedoraproject.org> 2.7.3-16
-- disable make check on ARM for the moment until 912025 is fixed
-
-* Mon Feb 11 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-15
-- add aarch64 (rhbz#909783)
-
-* Thu Nov 29 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-14
-- add BR on bluez-libs-devel (rhbz#879720)
-
-* Thu Aug 9 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-13
-- remove f18 conditional from patch 159
-
-* Fri Jul 27 2012 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.7.3-12
-- Rebuilt for
https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
-
-* Tue Jul 17 2012 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.3-11
-- fix memory leak in module _hashlib (patch 158, rhbz#836285)
-- fix db4 include path for libdb4 package (f18 and above) (patch 159)
-
-* Tue Jun 26 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-10
-- fix missing include in uid/gid handling patch (patch 157; rhbz#830405)
-
-* Fri Jun 22 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-9
-- use rpm macro for power64 (rhbz#834653)
-
-* Tue May 15 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-8
-- update uid/gid handling to avoid int overflows seen with uid/gid
-values >= 2^31 on 32-bit architectures (patch 157; rhbz#697470)
-
-* Fri May 4 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-7
-- renumber autotools patch from 300 to 5000
-- specfile cleanups
-
-* Mon Apr 30 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-6
-- try again to fix test_gdb.py (patch 156; rhbz#817072)
-
-* Mon Apr 30 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-5
-- fix test_gdb.py (patch 156; rhbz#817072)
-
-* Fri Apr 20 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-4
-- avoid allocating thunks in ctypes unless absolutely necessary, to avoid
-generating SELinux denials on "import ctypes" and "import uuid" when
embedding
-Python within httpd (patch 155; rhbz#814391)
-
-* Thu Apr 19 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-3
-- add explicit version requirements on expat to avoid linkage problems with
-XML_SetHashSalt
-
-* Wed Apr 18 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-2
-- fix -config symlinks (patch 112; rhbz#813836)
-
-* Wed Apr 11 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-1
-- 2.7.3: refresh patch 102 (lib64); drop upstream patches 11 (ascii-to-lower),
-115 (pydoc robustness), 145 (linux2), 148 (gdbm magic values), 151 (deadlock
-in fork); refresh patch 112 (debug build); revise patch 127
-(test_structmember); fix test_gdb (patch 153); refresh patch 137 (distutils
-tests); add python2.pc to python-devel; regenerate the autotool intermediates
-patch (patch 300)
-
-* Sat Feb 25 2012 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.2-20
-- fix deadlock issue (#787712)
-
-* Fri Feb 17 2012 Toshio Kuratomi <toshio(a)fedoraproject.org> - 2.7.2-19
-- Obsolete python-sqlite2
-
-* Thu Nov 24 2011 Ville Skytt <ville.skytta(a)iki.fi> - 2.7.2-18
-- Build with $RPM_LD_FLAGS (#756862).
-- Use xz-compressed source tarball.
-
-* Wed Oct 26 2011 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.7.2-17
-- Rebuilt for glibc bug#747377
-
-* Fri Sep 30 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-16
-- re-enable gdbm (patch 148; rhbz#742242)
-
-* Fri Sep 16 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-15
-- add a sys._debugmallocstats() function (patch 147)
-
-* Wed Sep 14 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-14
-- support OpenSSL FIPS mode in _hashlib and hashlib; don't build the _md5 and
-_sha* modules, relying on _hashlib in hashlib, and thus within md5 etc
-(rhbz#563986; patch 146)
-
-* Wed Sep 14 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-13
-- force sys.platform to be "linux2" (patch 145)
-
-* Tue Sep 13 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-12
-- disable gdbm module to prepare for gdbm soname bump
-
-* Mon Sep 12 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-11
-- rename and renumber patches for consistency with python3.spec (55, 111, 113,
-114, 125, 131, 129 to 143)
-
-* Sat Sep 10 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-10
-- rewrite of "check", introducing downstream-only hooks for skipping specific
-cases in an rpmbuild (patch 132), and fixing/skipping failing tests in a more
-fine-grained manner than before (patches 104, 133-142)
-
-* Thu Sep 1 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-9
-- run selftests with "--verbose"
-- disable parts of test_io on ppc (rhbz#732998)
-
-* Tue Aug 23 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-8
-- add --extension-suffix option to python-config (patch 130; rhbz#732808)
-
-* Tue Aug 23 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-7
-- re-enable and fix the --with-tsc option on ppc64, and rework it on 32-bit
-ppc to avoid aliasing violations (patch 129; rhbz#698726)
-
-* Tue Aug 23 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-6
-- don't use --with-tsc on ppc64 debug builds (rhbz#698726)
-
-* Thu Aug 18 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-5
-- add rpm macros file (rhbz#731800)
-
-* Fri Jul 8 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-4
-- cleanup of BuildRequires; add comment headings to specfile sections
-
-* Wed Jun 22 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-3
-- reorganize test exclusions (test_openpty and test_pty seem to be failing on
-every arch, not just the explicitly-listed ones)
-
-* Mon Jun 13 2011 Dan Hork <dan[at]danny.cz> - 2.7.2-2
-- add s390(x) excluded tests
-
-* Mon Jun 13 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-1
-- 2.7.2; drop upstreamed patches: patch 122 (parallel make fix), patch 124
-(test_commands and SELinux), patch 130 (ppc preprocessor macro in debug
-build); patch 131 (decimal in Turkish locale); regenerate the autotool
-intermediates patch (patch 300)
-
-* Tue Jun 07 2011 Dennis Gilmore <dennis(a)ausil.us> - 2.7.1-9
-- fix sparc building by excluding failing tests RHBZ#711584
-
-* Mon May 23 2011 Peter Robinson <pbrobinson(a)gmail.com> - 2.7.1-8
-- fix compile on ARM by excluding failing tests on arm - RHBZ #706253
-
-* Tue Apr 12 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.1-7
-- fix "import decimal" in the Turkish locale (patch 131; rhbz#694928)
-
-* Wed Feb 09 2011 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.7.1-6
-- Rebuilt for
https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
-
-* Fri Jan 21 2011 Toshio Kuratomi <toshio(a)fedoraproject.org> - 2.7.1-5
-- Switch from setting OPT to setting EXTRA_CFLAGS so we don't overwrite the
- DNDEBUG flag
-
-* Fri Jan 7 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.1-4
-- for now, drop "obsoletes" of python-argparse, since it interracts badly with
-multilib (rhbz#667984)
-
-* Fri Jan 7 2011 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.1-3
-- obsolete/provide python-argparse (new in 2.7)
-
-* Thu Jan 6 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.1-2
-- fix the ppc build of the debug configuration (patch 130; rhbz#661510)
-
-* Thu Dec 23 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7.1-1
-- 2.7.1, reworking patch 0 (config), patch 102 (lib64); drop upstream
-patch 56 (cfgparse), patch 110 (ctypes/SELinux/noexecmem), patch 119 (expat
-compat), patch 123 (2to3 on "from itertools import *")
-- fix test_abc's test_cache_leak in the debug build (patch 128)
-- drop _weakref.so from manifest (_weakref became a core module in r84230)
-
-* Wed Sep 29 2010 jkeating - 2.7-13
-- Rebuilt for gcc bug 634757
-
-* Mon Sep 27 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-12
-- fix test_structmember on 64bit-bigendian (patch 127)
-
-* Fri Sep 24 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-11
-- fix dbm_contains on 64bit-bigendian (patch 126; rhbz#626756)
-
-* Thu Sep 16 2010 Toshio Kuratomi <toshio(a)fedoraproject.org> - 2.7-10
-- backport a patch to fix a change in behaviour in configparse.
-
-* Thu Sep 9 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-9
-- move most of the payload of the core package to the libs subpackage, given
-that the libs aren't meaningfully usable without the standard libraries
-
-* Wed Aug 18 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-8
-- add %%check section
-- update lib64 patch (patch 102) to fix expected output in test_site.py on
-64-bit systems
-- patch test_commands.py to work with SELinux (patch 124)
-- patch the debug build's usage of COUNT_ALLOCS to be less verbose (patch 125)
-
-* Mon Jul 26 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-7
-- fixup missing -lcrypt to "crypt" module in config patch (patch 0)
-
-* Mon Jul 26 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-6
-- re-enable systemtap
-- cherrypick upstream patch to 2to3 for "from itertools import *"
-traceback (patch 123)
-
-* Thu Jul 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-5
-- disable systemtap for now (dtrace is failing on startup due to the bug
-mentioned in 2.7-4)
-- provide relative path to python binary when running pathfix.py
-- fix parallel make (patch 122)
-
-* Thu Jul 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-4
-- fix reference to pyconfig.h in sysconfig that led to failure on startup if
-python-devel was not installed
-
-* Thu Jul 8 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-3
-- add patch to fixup the new sysconfig.py for our multilib support on
-64-bit (patch 103)
-
-* Thu Jul 8 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-2
-- add machinery for regenerating the "configure" script in the face of
-mismatching autoconf versions (patch 300)
-
-* Tue Jul 6 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-1
-- 2.7 final; drop alphatag
-- drop patch 117 (upstream), patch 120 (upstreamed)
-- fix the commented-out __python_ver from 26 to 27
-
-* Tue Jun 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-0.1.rc2
-- 2.7rc2
-- revert r79310 (patch 121)
-- remove modulator: upstream removed it in r78338
-- rename mathmodule(_d).so to math(_d).so in manifests (appears to be changed
-by r76861)
-- _bytesio(_d).so and _filesio(_d).so were consolidated into _io(_d).so in
-r73394 (upstream issue 6215)
-- use the gdb hooks from the upstream tarball, rather than keeping our own
-copy. The upstream version has some whitespace changes, a new write_repr for
-unicode objects, and various bulletproofings for being run on older gdbs
-
-* Tue Jun 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-0.1.rc1
-- 2.7rc1:
- - rework patches to apply against 2.7 (which among other changes has had a
-whitespace cleanup of the .c code): .rhconfig (patch0), .binutils-no-dep
-(patch10), .ascii-tolower (patch11), .socketmodule (patch13), .socketmodule2
-(patch14), .systemtap (patch55), .lib64 (patch102), .selinux (patch110),
-.no-static-lib (patch111), .debug-build (patch112), .statvfs-f-flag-constants
-(patch114), ..CVE-2010-2089 (patch117)
- - drop upstream patches: .expat (patch3), .brprpm (patch51), .valgrind
-(patch52), .db48 (patch53), .CVE-2010-1634 (patch 116), .CVE-2008-5983 (patch
-118)
-
-* Tue Jun 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-17
-- Stop python bailing out with an assertion failure when UnicodeDecodeErrors
-occur on very large buffers (patch 120, upstream issue 9058)
-
-* Mon Jun 21 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-16
-- Fix an incompatibility between pyexpat and the system expat-2.0.1 that led to
-a segfault running test_pyexpat.py (patch 119; upstream issue 9054)
-
-* Tue Jun 8 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-15
-- add a flag to make it easy to turn off the debug build when troubleshooting
-the rpm build
-
-* Sat Jun 5 2010 Dan Hork <dan[at]danny.cz> - 2.6.5-14
-- reading the timestamp counter is available only on some arches (see Python/ceval.c)
-- disable --with-valgrind on s390(x) arches
-
-* Fri Jun 4 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-13
-- ensure that the compiler is invoked with "-fwrapv" (rhbz#594819)
-- CVE-2010-1634: fix various integer overflow checks in the audioop
-module (patch 116)
-- CVE-2010-2089: further checks within the audioop module (patch 117)
-- CVE-2008-5983: the new PySys_SetArgvEx entry point from r81399 (patch 118)
-
-* Thu May 27 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-12
-- make "pydoc -k" more robust in the face of broken modules (rhbz:461419,
patch115)
-
-* Wed May 26 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-11
-- add flags for statvfs.f_flag to the constant list in posixmodule (i.e. "os")
-(patch 114)
-
-* Tue May 25 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-10
-- add configure-time support for COUNT_ALLOCS and CALL_PROFILE debug options
-(patch 113); enable them and the WITH_TSC option within the debug build
-
-* Tue May 18 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-9
-- build and install two different configurations of Python: debug and standard,
-packaging the debug build in a new "python-debug" subpackage (patch 112)
-
-* Tue May 4 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-8
-- don't delete wsgiref.egg-info (rhbz:588426)
-
-* Mon Apr 26 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-7
-- disable --with-valgrind on sparc arches
-
-* Mon Apr 12 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-6
-- move the "bdist_wininst" command's template .exe files from the core
package
-to the devel subpackage, to save space (rhbz:525469)
-- fix stray doublelisting of config directory wildcard in devel subpackage
-
-* Wed Mar 31 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-5
-- update python-gdb.py from v4 to v5 (improving performance and stability,
-adding commands)
-
-* Thu Mar 25 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-4
-- update python-gdb.py from v3 to v4 (fixing infinite recursion on reference
-cycles and tracebacks on bytes 0x80-0xff in strings, adding handlers for sets
-and exceptions)
-
-* Wed Mar 24 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-3
-- refresh gdb hooks to v3 (reworking how they are packaged)
-
-* Mon Mar 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-2
-- remove unnecessary arch-conditionality for patch 101
-
-* Fri Mar 19 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-1
-- update to 2.6.5:
http://www.python.org/download/releases/2.6.5/
-- replace our patch to compile against db4.8 with a patch from
-upstream (patch 53, from r78974); update patch 54 since part of it is now in
-that upstream patch
-- update patch 110 so that it still applies in the face of upstream r78380
-
-* Tue Mar 16 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-23
-- fixup distutils/unixccompiler.py to remove standard library path from
-rpath (patch 17)
-- delete DOS batch files
-
-* Fri Mar 12 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-22
-- add pyfuntop.stp; allow systemtap support to be disabled
-- remove trailing period from tkinter summary
-- don't own /usr/bin/python-config if you're not the main python
-
-* Thu Mar 11 2010 Marcela Malov <mmaslano(a)redhat.com> - 2.6.4-21
-- rebuild with new gdbm
-
-* Thu Feb 11 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-20
-- avoid having the "test" subdirectory and the files within it that are in the
-core subpackage also be owned by the test subpackage (rhbz:467588)
-
-* Wed Feb 10 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-19
-- revise the systemtap patch (patch 55:python-2.6.4-dtrace.patch) to the
-new version by mjw in attachment 390110 of rhbz:545179, as this should
-eliminate the performance penalty for the case where the probes aren't in
-use, and eliminate all architecture-specific code (rhbz:563541; except on
-sparc)
-
-* Tue Feb 9 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-18
-- add a systemtap tapset defining "python.function.entry" and
-"python.function.return" to make it easy to use the static probepoint within
-Python; add an example of using the tapset to the docs
-
-* Tue Feb 9 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-17
-- add systemtap static probes (wcohen; patch 55; rh bug #545179)
-- update some comments in specfile relating to gdb work
-- manually byte-compile the gdb.py file with the freshly-built python to ensure
-that .pyx and .pyo files make it into the debuginfo manifest if they are later
-byte-compiled after find-debuginfo.sh is run
-
-* Mon Feb 8 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-16
-- move the -gdb.py file from %%{_libdir}/INSTSONAME-gdb.py to
-%%{_prefix}/lib/debug/%%{_libdir}/INSTSONAME.debug-gdb.py to avoid noise from
-ldconfig (bug 562980), and which should also ensure it becomes part of the
-debuginfo subpackage, rather than the libs subpackage
-- introduce %%{py_SOVERSION} and %%{py_INSTSONAME} to reflect the upstream
-configure script, and to avoid fragile scripts that try to figure this out
-dynamically (e.g. for the -gdb.py change)
-
-* Mon Feb 8 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-15
-- work around bug 562906 by supplying a fixed version of pythondeps.sh
-- set %%{_python_bytecompile_errors_terminate_build} to 0 to prevent the broken
-test files from killing the build on buildroots where python is installed
-
-* Fri Feb 5 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-14
-- add gdb hooks for easier debugging
-
-* Fri Jan 29 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-13
-- document all patches, and remove the commented-out ones
-
-* Tue Jan 26 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-12
-- Address some of the issues identified in package review (bug 226342):
- - update libs requirement on base package to use %%{name} for consistency's
-sake
- - convert from backticks to $() syntax throughout
- - wrap value of LD_LIBRARY_PATH in quotes
- - convert "/usr/bin/find" requirement to "findutils"
- - remove trailing periods from summaries of -devel and -tools subpackages
- - fix spelling mistake in description of -test subpackage
- - convert usage of $$RPM_BUILD_ROOT to %%{buildroot} throughout, for
-stylistic consistency
- - supply dirmode arguments to defattr directives
-
-* Mon Jan 25 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-11
-- update python-2.6.2-config.patch to remove downstream customization of build
-of pyexpat and elementtree modules
-- add patch adapted from upstream (patch 3) to add support for building against
-system expat; add --with-system-expat to "configure" invocation
-- remove embedded copy of expat from source tree during "prep"
-
-* Mon Jan 25 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-10
-- introduce macros for 3 directories, replacing expanded references throughout:
-%%{pylibdir}, %%{dynload_dir}, %%{site_packages}
-- explicitly list all lib-dynload files, rather than dynamically gathering the
-payload into a temporary text file, so that we can be sure what we are
-shipping; remove now-redundant testing for presence of certain .so files
-- remove embedded copy of zlib from source tree before building
-
-* Mon Jan 25 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-9
-- change python-2.6.2-config.patch to remove our downstream change to curses
-configuration in Modules/Setup.dist, so that the curses modules are built using
-setup.py with the downstream default (linking against libncursesw.so, rather
-than libncurses.so), rather than within the Makefile; add a test to %%install
-to verify the dso files that the curses module is linked against the correct
-DSO (bug 539917; changes _cursesmodule.so -> _curses.so)
-
-* Fri Jan 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-8
-- rebuild (bug 556975)
-
-* Wed Jan 20 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-7
-- move lib2to3 from -tools subpackage to main package (bug 556667)
-
-* Mon Jan 18 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-6
-- patch Makefile.pre.in to avoid building static library (patch111, bug 556092)
-- split up the "configure" invocation flags onto individual lines
-
-* Fri Jan 15 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-5
-- replace usage of %%define with %%global
-- use the %%{_isa} macro to ensure that the python-devel dependency on python
-is for the correct multilib arch (#555943)
-- delete bundled copy of libffi to make sure we use the system one
-- replace references to /usr with %%{_prefix}; replace references to
-/usr/include with %%{_includedir}
-
-* Wed Dec 16 2009 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-4
-- automatically disable arena allocator when run under valgrind (upstream
-issue 2422; patch 52)
-- add patch from Josh Boyer containing diff against upstream PyBSDDB to make
-the bsddb module compile against db-4.8 (patch 53, #544275); bump the necessary
-version of db4-devel to 4.8
-- patch setup.py so that it searches for db-4.8, and enable debug output for
-said search; make Setup.dist use db-4.8 (patch 54)
-
-* Thu Nov 12 2009 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-3
-- fixup the build when __python_ver is set (Zach Sadecki; bug 533989); use
-pybasever in the files section
-
-* Thu Oct 29 2009 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-2
-- "Makefile" and the config-32/64.h file are needed by distutils/sysconfig.py
-_init_posix(), so we include them in the core package, along with their parent
-directories (bug 531901)
-
-* Mon Oct 26 2009 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-1
-- Update to 2.6.4
-
-* Fri Aug 21 2009 Tomas Mraz <tmraz(a)redhat.com> - 2.6.2-2
-- rebuilt with new openssl
-
-* Mon Jul 27 2009 James Antill <james.antill(a)redhat.com> - 2.6.2-1
-- Update to 2.6.2
-
-* Sun Jul 26 2009 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.6-11
-- Rebuilt for
https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
-
-* Sat Jul 4 2009 Jonathan Steffan <jsteffan(a)fedoraproject.org> - 2.6-10
-- Move python-config to devel subpackage (#506153)
-- Update BuildRoot for new standard
-
-* Sun Jun 28 2009 Jonathan Steffan <jsteffan(a)fedoraproject.org> - 2.6-9
-- Update python-tools description (#448940)
-
-* Wed Apr 15 2009 Ignacio Vazquez-Abrams <ivazqueznet+rpm(a)gmail.com> 2.6-8
-- Replace python-hashlib and python-uuid (#484715)
-
-* Tue Mar 17 2009 James Antill <james(a)fedoraproject.org> - 2.6-7
-- Use system libffi
-- Resolves: bug#490573
-- Fix SELinux execmem problems
-- Resolves: bug#488396
-
-* Thu Feb 26 2009 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.6-5
-- Rebuilt for
https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
-
-* Fri Jan 16 2009 Tomas Mraz <tmraz(a)redhat.com> - 2.6-4
-- rebuild with new openssl
-
-* Tue Jan 6 2009 James Antill <james.antill(a)redhat.com> - 2.6-3
-- Fix distutils generated rpms.
-- Resolves: bug#236535
-
-* Wed Dec 10 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm(a)gmail.com> - 2.6-2
-- Enable -lcrypt for cryptmodule
-
-* Fri Nov 28 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm(a)gmail.com> - 2.6-1
-- Update to 2.6
-
-* Tue Sep 30 2008 James Antill <james.antill(a)redhat.com> - 2.5.2-1
-- Move to 2.5.2
-- Fix CVE-2008-2316 hashlib overflow.
-
-* Thu Jul 17 2008 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-30
-- Fix up the build for new rpm
-- And actually build against db4-4.7 (#455170)
-
-* Thu Jul 10 2008 Tom "spot" Callaway <tcallawa(a)redhat.com> - 2.5.1-27
-- fix license tag
-- enable support for db4-4.7
-
-* Sun Jun 15 2008 James Antill <jantill(a)redhat.com> - 2.5.1-26
-- Fix sporadic listdir problem
-- Resolves: bug#451494
-
-* Mon Apr 7 2008 James Antill <jantill(a)redhat.com> - 2.5.1-25
-- Rebuild to re-gen autoconf file due to glibc change.
-- Resolves: bug#441003
-
-* Tue Mar 25 2008 James Antill <jantill(a)redhat.com> - 2.5.1-24
-- Add more constants to socketmodule
-
-* Sat Mar 8 2008 James Antill <jantill(a)redhat.com> - 2.5.1-22
-- Add constants to socketmodule
-- Resolves: bug#436560
-
-* Tue Feb 19 2008 Fedora Release Engineering <rel-eng(a)fedoraproject.org> -
2.5.1-22
-- Autorebuild for GCC 4.3
-
-* Sun Jan 13 2008 Tom "spot" Callaway <tcallawa(a)redhat.com> - 2.5.1-21
-- rebuild for new tk in rawhide
-
-* Mon Jan 7 2008 James Antill <jantill(a)redhat.com> - 2.5.1-20
-- Add valgrind support files, as doc, to python-devel
-- Relates: rhbz#418621
-- Add new API from 2.6, set_wakeup_fd ... use at own risk, presumably won't
-- change but I have no control to guarantee that.
-- Resolves: rhbz#427794
-- Add gdbinit support file, as doc, to python-devel
-
-* Fri Jan 4 2008 Tom "spot" Callaway <tcallawa(a)redhat.com> - 2.5.1-19
-- rebuild for new tcl/tk in rawhide
-
-* Fri Dec 7 2007 James Antill <jantill(a)redhat.com> - 2.5.1-18
-- Create a python-test sub-module, over 3MB of stuff noone wants.
-- Don't remove egginfo files, try this see what happens ... may revert.
-- Resolves: rhbz#414711
-
-* Mon Dec 3 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-17
-- rebuild for new libssl
-
-* Fri Nov 30 2007 James Antill <jantill(a)redhat.com> - 2.5.1-16
-- Fix pyconfig.h comment typo.
-- Add back test_support.py and the __init__.py file.
-- Resolves: rhbz#387401
-
-* Tue Oct 30 2007 James Antill <jantill(a)redhat.com> - 2.5.1-15
-- Do codec lowercase in C Locale.
-- Resolves: 207134 191096
-- Fix stupid namespacing in pysqlite, minimal upgrade to 2.3.3 pysqlite
-- Resolves: 263221
-
-* Wed Oct 24 2007 James Antill <jantill(a)redhat.com> - 2.5.1-14
-- Remove bintuils dep. for live CD ... add work around for ctypes
-
-* Mon Oct 22 2007 James Antill <jantill(a)redhat.com> - 2.5.1-13
-- Add tix buildprereq
-- Add tkinter patch
-- Resolves: #281751
-- Fix ctypes loading of libraries, add requires on binutils
-- Resolves: #307221
-- Possible fix for CVE-2007-4965 possible exploitable integer overflow
-- Resolves: #295971
-
-* Tue Oct 16 2007 Mike Bonnet <mikeb(a)redhat.com> - 2.5.1-12
-- fix marshalling of objects in xmlrpclib (python bug #1739842)
-
-* Fri Sep 14 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-11
-- fix encoding of sqlite .py files to work around weird encoding problem
- in Turkish (#283331)
-
-* Mon Sep 10 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-10
-- work around problems with multi-line plural specification (#252136)
-
-* Tue Aug 28 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-9
-- rebuild against new expat
-
-* Tue Aug 14 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-8
-- build against db4.6
-
-* Tue Aug 14 2007 Dennis Gilmore <dennis(a)ausil.us> - 2.5.1-7
-- add sparc64 to the list of archs for _pyconfig64_h
-
-* Fri Aug 10 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-6
-- fix ctypes again on some arches (Hans de Goede, #251637)
-
-* Fri Jul 6 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-5
-- link curses modules with ncursesw (#246385)
-
-* Wed Jun 27 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-4
-- fix _elementtree.so build (#245703)
-- ensure that extension modules we expect are actually built rather than
- having them silently fall out of the package
-
-* Tue Jun 26 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-3
-- link with system expat (#245703)
-
-* Thu Jun 21 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-2
-- rebuild to take advantage of hardlinking between identical pyc/pyo files
-
-* Thu May 31 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-1
-- update to python 2.5.1
-
-* Mon Mar 19 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-12
-- fix alpha build (#231961)
-
-* Tue Feb 13 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-11
-- tcl/tk was reverted; rebuild again
-
-* Thu Feb 1 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-10
-- rebuild for new tcl/tk
-
-* Tue Jan 16 2007 Miroslav Lichvar <mlichvar(a)redhat.com> - 2.5.3-9
-- link with ncurses
-
-* Sat Jan 6 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-8
-- fix extensions to use shared libpython (#219564)
-- all 64bit platforms need the regex fix (#122304)
-
-* Wed Jan 3 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-7
-- fix ctypes to not require execstack (#220669)
-
-* Fri Dec 15 2006 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-6
-- don't link against compat-db (Robert Scheck)
-
-* Wed Dec 13 2006 Jarod Wilson <jwilson(a)redhat.com> - 2.5.3-5
-- fix invalid assert in debug mode (upstream changeset 52622)
-
-* Tue Dec 12 2006 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-4
-- obsolete/provide python-ctypes (#219256)
-
-* Mon Dec 11 2006 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-3
-- fix atexit traceback with failed syslog logger (#218214)
-- split libpython into python-libs subpackage for multilib apps
- embedding python interpreters
-
-* Wed Dec 6 2006 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-2
-- disable installation of .egg-info files for now
-
-* Tue Dec 5 2006 Jeremy Katz <katzj(a)redhat.com>
-- support db 4.5
-- obsolete python-elementtree; since it requires some code tweaks, don't
- provide it
-- obsolete old python-sqlite; provide the version that's actually included
-
-* Mon Oct 30 2006 Jeremy Katz <katzj(a)redhat.com>
-- fix _md5 and _sha modules (Robert Sheck)
-- no longer provide optik compat; it's been a couple of years now
-- no longer provide the old shm module; if this is still needed, let's
- build it separately
-- no longer provide japanese codecs; should be a separate package
-
-* Mon Oct 23 2006 Jeremy Katz <katzj(a)redhat.com> - 2.5-0
-- update to 2.5.0 final
-
-* Fri Aug 18 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.99.c1
-- Updated to 2.5c1. Merged fixes from FC6 too:
-- Fixed bug #199373 (on some platforms CFLAGS is needed when linking)
-- Fixed bug #198971 (case conversion not locale safe in logging library)
-- Verified bug #201434 (distutils.sysconfig is confused by the change to make
- python-devel multilib friendly) is fixed upstream
-
-* Sun Jul 16 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.99.b2
-- Updated to 2.5b2 (which for comparison reasons is re-labeled 2.4.99.b2)
-
-* Fri Jun 23 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.99.b1
-- Updated to 2.5b1 (which for comparison reasons is re-labeled 2.4.99.b1)
-
-* Tue Jun 13 2006 Jeremy Katz <katzj(a)redhat.com> - 2.4.3-11.FC6
-- and fix it for real
-
-* Tue Jun 13 2006 Jeremy Katz <katzj(a)redhat.com> - 2.4.3-10.FC6
-- fix python-devel on ia64
-
-* Tue Jun 13 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-9
-- Fixed python-devel to be multilib friendly (bug #192747, #139911)
-
-* Tue Jun 13 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-8
-- Only copying mkhowto from the Docs - we don't need perl dependencies from
- python-tools.
-
-* Mon Jun 12 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-7
-- Fixed bug #121198 (webbrowser.py should use the user's preferences first)
-
-* Mon Jun 12 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-6
-- Fixed bug #192592 (too aggressive assertion fails) - SF#1257960
-- Fixed bug #167468 (Doc/tools not included) - added in the python-tools package
-
-* Thu Jun 8 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-5
-- Fixed bug #193484 (added pydoc in the main package)
-
-* Mon Jun 5 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-4
-- Added dist in the release
-
-* Mon May 15 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-3
-- rebuilt to fix broken libX11 dependency
-
-* Wed Apr 12 2006 Jeremy Katz <katzj(a)redhat.com> - 2.4.3-2
-- rebuild with new gcc to fix #188649
-
-* Thu Apr 6 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-1
-- Updated to 2.4.3
-
-* Fri Feb 10 2006 Jesse Keating <jkeating(a)redhat.com> - 2.4.2-3.2.1
-- bump again for double-long bug on ppc(64)
-
-* Fri Feb 10 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-3.2
-- rebuilt for newer tix
-
-* Tue Feb 07 2006 Jesse Keating <jkeating(a)redhat.com> - 2.4.2-3.1
-- rebuilt for new gcc4.1 snapshot and glibc changes
-
-* Fri Jan 20 2006 Mihai Ibanescu <misa(a)redhat.com> 2.4.2-3
-- fixed #136654 for another instance of audiotest.au
-
-* Fri Dec 09 2005 Jesse Keating <jkeating(a)redhat.com>
-- rebuilt
-
-* Sat Nov 19 2005 Bill Nottingham <notting(a)redhat.com> 2.4.2-2
-- fix build for modular X, remove X11R6 path references
-
-* Tue Nov 15 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.2-1
-- Upgraded to 2.4.2
-- BuildRequires autoconf
-
-* Wed Nov 9 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-16
-- Rebuilding against newer openssl.
-- XFree86-devel no longer exists
-
-* Mon Sep 26 2005 Peter Jones <pjones(a)redhat.com> 2.4.1-14
-- Once more -- this time, to fix -EPERM when you run it in a directory
- you can't read from.
-
-* Mon Sep 26 2005 Peter Jones <pjones(a)redhat.com> 2.4.1-13
-- So, 5 or 6 people have said it works for them with this patch...
-
-* Sun Sep 25 2005 Peter Jones <pjones(a)redhat.com> 2.4.1-12
-- Fixed bug #169159 (check for argc>0 and argv[0] == NULL, not just
- argv[0][0]='\0')
- Reworked the patch from -8 a bit more.
-
-* Fri Sep 23 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-10
-- Fixed bug #169159 (don't let python core dump if no arguments are passed in)
- Reworked the patch from -8 a bit more.
-
-* Thu Sep 22 2005 Peter Jones <pjones(a)redhat.com> 2.4.1-8
-- Fix bug #169046 more correctly.
-
-* Thu Sep 22 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-7
-- Fixed bug #169046 (realpath is unsafe); thanks to
- Peter Jones <pjones(a)redhat.com> and Arjan van de Ven <arjanv(a)redhat.com>
for
- diagnosing and the patch.
-
-* Tue Sep 20 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-4
-- Fixed bug #168655 (fixes for building as python24)
-
-* Tue Jul 26 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-3
-- Fixed bug #163435 (pynche doesn't start))
-
-* Wed Apr 20 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-2
-- Fixed bug #143667 (python should own /usr/lib/python* on 64-bit systems, for
- noarch packages)
-- Fixed bug #143419 (BuildRequires db4 is not versioned)
-
-* Wed Apr 6 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-1
-- updated to 2.4.1
-
-* Mon Mar 14 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4-6
-- building the docs from a different source rpm, to decouple bootstrapping
- python from having tetex installed
-
-* Fri Mar 11 2005 Dan Williams <dcbw(a)redhat.com> 2.4-5
-- Rebuild to pick up new libssl.so.5
-
-* Wed Feb 2 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4-4
-- Fixed security issue in SimpleXMLRPCServer.py (#146647)
-
-* Wed Jan 12 2005 Tim Waugh <twaugh(a)redhat.com> 2.4-3
-- Rebuilt for new readline.
-
-* Mon Dec 6 2004 Jeff Johnson <jbj(a)jbj.org> 2.4-2
-- db-4.3.21 returns DB_BUFFER_SMALL rather than ENOMEM (#141994).
-- add Provide: python(abi) = 2.4
-- include msgfmt/pygettext *.pyc and *.pyo from brp-python-bytecompile.
-
-* Fri Dec 3 2004 Mihai Ibanescu <misa(a)redhat.com> 2.4-1
-- Python-2.4.tar.bz2 (final)
-
-* Fri Nov 19 2004 Mihai Ibanescu <misa(a)redhat.com> 2.4-0.c1.1
-- Python-2.4c1.tar.bz2 (release candidate 1)
-
-* Thu Nov 11 2004 Jeff Johnson <jbj(a)jbj.org> 2.4-0.b2.4
-- rebuild against db-4.3.21.
-
-* Mon Nov 8 2004 Jeremy Katz <katzj(a)redhat.com> - 2.4-0.b2.3
-- fix the lib64 patch so that 64bit arches still look in /usr/lib/python...
-
-* Mon Nov 8 2004 Jeremy Katz <katzj(a)redhat.com> - 2.4-0.b2.2
-- cryptmodule still needs -lcrypt (again)
-
-* Thu Nov 4 2004 Mihai Ibanescu <misa(a)redhat.com> 2.4-0.b2.1
-- Updated to python 2.4b2 (and labeled it 2.4-0.b2.1 to avoid breaking rpm's
- version comparison)
-
-* Thu Nov 4 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-13
-- Fixed bug #138112 (python overflows stack buffer) - SF bug 105470
-
-* Tue Nov 2 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-12
-- Fixed bugs #131439 #136023 #137863 (.pyc/.pyo files had the buildroot added)
-
-* Tue Oct 26 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-11
-- Fixed bug #136654 (python has sketchy audio clip)
-
-* Tue Aug 31 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-10
-- Fixed bug #77418 (Demo dir not packaged)
-- More tweaking on #19347 (Moved Tools/ under /usr/lib/python2.3/Tools)
-
-* Fri Aug 13 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-8
-- Fixed bug #129769: Makefile in new python conflicts with older version found
- in old python-devel
-- Reorganized the spec file to get rid of the aspython2 define; __python_ver
- is more powerful.
-
-* Tue Aug 3 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-7
-- Including html documentation for non-i386 arches
-- Fixed #125362 (python-doc html files have japanese character encoding)
-- Fixed #128923 (missing dependency between python and python-devel)
-
-* Fri Jul 30 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-6
-- Fixed #128030 (help() not printing anything)
-- Fixed #125472 (distutils.sysconfig.get_python_lib() not returning the right
- path on 64-bit systems)
-- Fixed #127357 (building python as a shared library)
-- Fixed #19347 (including the contents of Tools/scripts/ in python-tools)
-
-* Tue Jun 15 2004 Elliot Lee <sopwith(a)redhat.com>
-- rebuilt
-
-* Tue Jun 8 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-3
-- Added an optik.py that provides the same interface from optparse for
- backward compatibility; obsoleting python-optik
-
-* Mon Jun 7 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-2
-- Patched bdist_rpm to allow for builds of multiple binary rpms (bug #123598)
-
-* Fri Jun 4 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-1
-- Updated to 2.3.4-1 with Robert Scheck's help (bug #124764)
-- Added BuildRequires: tix-devel (bug #124918)
-
-* Fri May 7 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.3-6
-- Correct fix for #122304 from upstream:
-
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=93184...
-
-* Thu May 6 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.3-4
-- Fix for bug #122304 : splitting the domain name fails on 64-bit arches
-- Fix for bug #120879 : including Makefile into the main package
-
-- Requires XFree86-devel instead of -libs (see bug #118442)
-
-* Tue Mar 16 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.3-3
-- Requires XFree86-devel instead of -libs (see bug #118442)
-
-* Tue Mar 02 2004 Elliot Lee <sopwith(a)redhat.com>
-- rebuilt
-
-* Fri Feb 13 2004 Elliot Lee <sopwith(a)redhat.com>
-- rebuilt
-
-* Fri Dec 19 2003 Jeff Johnson <jbj(a)jbj.org> 2.3.3-1
-- upgrade to 2.3.3.
-
-* Sat Dec 13 2003 Jeff Johnson <jbj(a)jbj.org> 2.3.2-9
-- rebuild against db-4.2.52.
-
-* Fri Dec 12 2003 Jeremy Katz <katzj(a)redhat.com> 2.3.2-8
-- more rebuilding for new tcl/tk
-
-* Wed Dec 3 2003 Jeff Johnson <jbj(a)jbj.org> 2.3.2-7.1
-- rebuild against db-4.2.42.
-
-* Fri Nov 28 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.2-7
-- rebuilt against newer tcl/tk
-
-* Mon Nov 24 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.2-6
-- added a Provides: python-abi
-
-* Wed Nov 12 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.2-5
-- force CC (#109268)
-
-* Sun Nov 9 2003 Jeremy Katz <katzj(a)redhat.com> 2.3.2-4
-- cryptmodule still needs -lcrypt
-
-* Wed Nov 5 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.2-2
-- Added patch for missing mkhowto
-
-* Thu Oct 16 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.2-1
-- Updated to 2.3.2
-
-* Thu Sep 25 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.1-1
-- 2.3.1 final
-
-* Tue Sep 23 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.1-0.8.RC1
-- Building the python 2.3.1 release candidate
-- Updated the lib64 patch
-
-* Wed Jul 30 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3-0.2
-- Building python 2.3
-- Added more BuildRequires
-- Updated the startup files for modulator and pynche; idle installs its own
- now.
-
-* Thu Jul 3 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.3-4
-- Rebuilt against newer db4 packages (bug #98539)
-
-* Mon Jun 9 2003 Elliot Lee <sopwith(a)redhat.com> 2.2.3-3
-- rebuilt
-
-* Sat Jun 7 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.3-2
-- Rebuilt
-
-* Fri Jun 6 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.3-1
-- Upgraded to 2.2.3
-
-* Wed Apr 2 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-28
-- Rebuilt
-
-* Wed Apr 2 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-27
-- Modified the ftpuri patch conforming to
http://ietf.org/rfc/rfc1738.txt
-
-* Mon Feb 24 2003 Elliot Lee <sopwith(a)redhat.com>
-- rebuilt
-
-* Mon Feb 24 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-25
-- Fixed bug #84886: pydoc dies when run w/o arguments
-- Fixed bug #84205: add python shm module back (used to be shipped with 1.5.2)
-- Fixed bug #84966: path in byte-compiled code still wrong
-
-* Thu Feb 20 2003 Jeremy Katz <katzj(a)redhat.com> 2.2.2-23
-- ftp uri's should be able to specify being rooted at the root instead of
- where you login via ftp (#84692)
-
-* Mon Feb 10 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-22
-- Using newer Japanese codecs (1.4.9). Thanks to
- Peter Bowen <pzb(a)datastacks.com> for pointing this out.
-
-* Thu Feb 6 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-21
-- Rebuild
-
-* Wed Feb 5 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-20
-- Release number bumped really high: turning on UCS4 (ABI compatibility
- breakage)
-
-* Fri Jan 31 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-13
-- Attempt to look both in /usr/lib64 and /usr/lib/python2.2/site-packages/:
- some work on python-2.2.2-lib64.patch
-
-* Thu Jan 30 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-12
-- Rebuild to incorporate the removal of .lib64 and - files.
-
-* Thu Jan 30 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-11.7.3
-- Fixed bug #82544: Errata removes most tools
-- Fixed bug #82435: Python 2.2.2 errata breaks redhat-config-users
-- Removed .lib64 and - files that get installed after we fix the multilib
- .py files.
-
-* Wed Jan 22 2003 Tim Powers <timp(a)redhat.com>
-- rebuilt
-
-* Wed Jan 15 2003 Jens Petersen <petersen(a)redhat.com> 2.2.2-10
-- rebuild to update tkinter's tcltk deps
-- convert changelog to utf-8
-
-* Tue Jan 7 2003 Nalin Dahyabhai <nalin(a)redhat.com> 2.2.2-9
-- rebuild
-
-* Fri Jan 3 2003 Nalin Dahyabhai <nalin(a)redhat.com>
-- pick up OpenSSL cflags and ldflags from pkgconfig if available
-
-* Thu Jan 2 2003 Jeremy Katz <katzj(a)redhat.com> 2.2.2-8
-- urllib2 didn't support non-anonymous ftp. add support based on how
- urllib did it (#80676, #78168)
-
-* Mon Dec 16 2002 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-7
-- Fix bug #79647 (Rebuild of SRPM fails if python isn't installed)
-- Added a bunch of missing BuildRequires found while fixing the
- above-mentioned bug
-
-* Tue Dec 10 2002 Tim Powers <timp(a)redhat.com> 2.2.2-6
-- rebuild to fix broken tcltk deps for tkinter
-
-* Fri Nov 22 2002 Mihai Ibanescu <misa(a)redhat.com>
-2.2.2-3.7.3
-- Recompiled for 7.3 (to fix the -lcrypt bug)
-- Fix for the spurious error message at the end of the build (build-requires
- gets confused by executable files starting with """"): make the
tests
- non-executable.
-
-* Wed Nov 20 2002 Mihai Ibanescu <misa(a)redhat.com>
-2.2.2-5
-- Fixed configuration patch to add -lcrypt when compiling cryptmodule.c
-
-2.2.2-4
-- Spec file change from Matt Wilson <msw(a)redhat.com> to disable linking
- with the C++ compiler.
-
-* Mon Nov 11 2002 Mihai Ibanescu <misa(a)redhat.com>
-2.2.2-3.*
-- Merged patch from Karsten Hopp <karsten(a)redhat.de> from 2.2.1-17hammer to
- use %%{_libdir}
-- Added XFree86-libs as BuildRequires (because of tkinter)
-- Fixed duplicate listing of plat-linux2
-- Fixed exclusion of lib-dynload/japanese
-- Added lib64 patch for the japanese codecs
-- Use setup magic instead of using tar directly on JapaneseCodecs
-
-* Tue Nov 5 2002 Mihai Ibanescu <misa(a)redhat.com>
-2.2.2-2
-- Fix #76912 (python-tools contains idle, which uses tkinter, but there is no
- requirement of tkinter from python-tools).
-- Fix #74013 (rpm is missing the /usr/lib/python2.2/test directory)
-
-* Mon Nov 4 2002 Mihai Ibanescu <misa(a)redhat.com>
-- builds as python2 require a different libdb
-- changed the buildroot name of python to match python2 builds
-
-* Fri Nov 1 2002 Mihai Ibanescu <misa(a)redhat.com>
-- updated python to 2.2.2 and adjusted the patches accordingly
-
-* Mon Oct 21 2002 Mihai Ibanescu <misa(a)redhat.com>
-- Fix #53930 (Python-2.2.1-buildroot-bytecode.patch)
-- Added BuildPrereq dependency on gcc-c++
-
-* Fri Aug 30 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-17
-- security fix for _execvpe
-
-* Tue Aug 13 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-16
-- Fix #71011,#71134, #58157
-
-* Wed Aug 7 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-15
-- Resurrect tkinter
-- Fix for distutils (#67671)
-- Fix #69962
-
-* Thu Jul 25 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-14
-- Obsolete tkinter/tkinter2 (#69838)
-
-* Tue Jul 23 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-13
-- Doc fixes (#53951) - not on alpha at the momemt
-
-* Mon Jul 8 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-12
-- fix pydoc (#68082)
-
-* Mon Jul 8 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-11
-- Add db4-devel as a BuildPrereq
-
-* Fri Jun 21 2002 Tim Powers <timp(a)redhat.com> 2.2.1-10
-- automated rebuild
-
-* Mon Jun 17 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-9
-- Add Japanese codecs (#66352)
-
-* Tue Jun 11 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-8
-- No more tkinter...
-
-* Wed May 29 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-7
-- Rebuild
-
-* Tue May 21 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-6
-- Add the email subcomponent (#65301)
-
-* Fri May 10 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-5
-- Rebuild
-
-* Thu May 02 2002 Than Ngo <than(a)redhat.com> 2.2.1-4
-- rebuild i new enviroment
-
-* Tue Apr 23 2002 Trond Eivind Glomsrd <teg(a)redhat.com>
-- Use ucs2, not ucs4, to avoid breaking tkinter (#63965)
-
-* Mon Apr 22 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-2
-- Make it use db4
-
-* Fri Apr 12 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-1
-- 2.2.1 - a bugfix-only release
-
-* Fri Apr 12 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-16
-- the same, but in builddirs - this will remove them from the
- docs package, which doesn't look in the buildroot for files.
-
-* Fri Apr 12 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-15
-- Get rid of temporary files and .cvsignores included
- in the tarball and make install
-
-* Fri Apr 5 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-14
-- Don't own lib-tk in main package, only in tkinter (#62753)
-
-* Mon Mar 25 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-13
-- rebuild
-
-* Mon Mar 25 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-12
-- rebuild
-
-* Fri Mar 1 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-11
-- Add a not to the Distutils obsoletes test (doh!)
-
-* Fri Mar 1 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-10
-- Rebuild
-
-* Mon Feb 25 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-9
-- Only obsolete Distutils when built as python
-
-* Thu Feb 21 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-8
-- Make files in /usr/bin install side by side with python 1.5 when
-- Drop explicit requirement of db4
- built as python2
-
-* Thu Jan 31 2002 Elliot Lee <sopwith(a)redhat.com> 2.2-7
-- Use version and pybasever macros to make updating easy
-- Use _smp_mflags macro
-
-* Tue Jan 29 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-6
-- Add db4-devel to BuildPrereq
-
-* Fri Jan 25 2002 Nalin Dahyabhai <nalin(a)redhat.com> 2.2-5
-- disable ndbm support, which is db2 in disguise (really interesting things
- can happen when you mix db2 and db4 in a single application)
-
-* Thu Jan 24 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-4
-- Obsolete subpackages if necesarry
-- provide versioned python2
-- build with db4
-
-* Wed Jan 16 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-3
-- Alpha toolchain broken. Disable build on alpha.
-- New openssl
-
-* Wed Dec 26 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-1
-- 2.2 final
-
-* Fri Dec 14 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.11c1
-- 2.2 RC 1
-- Don't include the _tkinter module in the main package - it's
- already in the tkiter packace
-- Turn off the mpzmodule, something broke in the buildroot
-
-* Wed Nov 28 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.10b2
-- Use -fPIC for OPT as well, in lack of a proper libpython.so
-
-* Mon Nov 26 2001 Matt Wilson <msw(a)redhat.com> 2.2-0.9b2
-- changed DESTDIR to point to / so that distutils will install dynload
- modules properly in the installroot
-
-* Fri Nov 16 2001 Matt Wilson <msw(a)redhat.com> 2.2-0.8b2
-- 2.2b2
-
-* Fri Oct 26 2001 Matt Wilson <msw(a)redhat.com> 2.2-0.7b1
-- python2ify
-
-* Fri Oct 19 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.5b1
-- 2.2b1
-
-* Sun Sep 30 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.4a4
-- 2.2a4
-- Enable UCS4 support
-- Enable IPv6
-- Provide distutils
-- Include msgfmt.py and pygettext.py
-
-* Fri Sep 14 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.3a3
-- Obsolete Distutils, which is now part of the main package
-- Obsolete python2
-
-* Thu Sep 13 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.2a3
-- Add docs, tools and tkinter subpackages, to match the 1.5 layout
-
-* Wed Sep 12 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.1a3
-- 2.2a3
-- don't build tix and blt extensions
-
-* Mon Aug 13 2001 Trond Eivind Glomsrd <teg(a)redhat.com>
-- Add tk and tix to build dependencies
-
-* Sat Jul 21 2001 Trond Eivind Glomsrd <teg(a)redhat.com>
-- 2.1.1 bugfix release - with a GPL compatible license
-
-* Fri Jul 20 2001 Trond Eivind Glomsrd <teg(a)redhat.com>
-- Add new build dependencies (#49753)
-
-* Tue Jun 26 2001 Nalin Dahyabhai <nalin(a)redhat.com>
-- build with -fPIC
-
-* Fri Jun 1 2001 Trond Eivind Glomsrd <teg(a)redhat.com>
-- 2.1
-- reorganization of file includes
-
-* Wed Dec 20 2000 Trond Eivind Glomsrd <teg(a)redhat.com>
-- fix the "requires" clause, it lacked a space causing problems
-- use %%{_tmppath}
-- don't define name, version etc
-- add the available patches from the Python home page
-
-* Fri Dec 15 2000 Matt Wilson <msw(a)redhat.com>
-- added devel subpackage
-
-* Fri Dec 15 2000 Matt Wilson <msw(a)redhat.com>
-- modify all files to use "python2.0" as the intrepter
-- don't build the Expat bindings
-- build against db1
-
-* Mon Oct 16 2000 Jeremy Hylton <jeremy(a)beopen.com>
-- updated for 2.0 final
-
-* Mon Oct 9 2000 Jeremy Hylton <jeremy(a)beopen.com>
-- updated for 2.0c1
-- build audioop, imageop, and rgbimg extension modules
-- include xml.parsers subpackage
-- add test.xml.out to files list
-
-* Thu Oct 5 2000 Jeremy Hylton <jeremy(a)beopen.com>
-- added bin/python2.0 to files list (suggested by Martin v. L?)
-
-* Tue Sep 26 2000 Jeremy Hylton <jeremy(a)beopen.com>
-- updated for release 1 of 2.0b2
-- use .bz2 version of Python source
-
-* Tue Sep 12 2000 Jeremy Hylton <jeremy(a)beopen.com>
-- Version 2 of 2.0b1
-- Make the package relocatable. Thanks to Suchandra Thapa.
-- Exclude Tkinter from main RPM. If it is in a separate RPM, it is
- easier to track Tk releases.
diff --git a/python27.spec b/python27.spec
new file mode 100644
index 0000000..bc62ebb
--- /dev/null
+++ b/python27.spec
@@ -0,0 +1,3325 @@
+# ======================================================
+# Conditionals and other variables controlling the build
+# ======================================================
+
+# Note that the bcond macros are named for the CLI option they create.
+# "%%bcond_without" means "ENABLE by default and create a --without
option"
+
+# Whether to use RPM build wheels from the python-{pip,setuptools}-wheel package
+# Uses upstream bundled prebuilt wheels otherwise
+# WARNING: Always check if the RPM built wheel versions support Python 2
+%bcond_without rpmwheels
+
+# Run the test suite in %%check
+%bcond_without tests
+
+%global unicode ucs4
+%global pybasever 2.7
+%global pyshortver 27
+%global pylibdir %{_libdir}/python%{pybasever}
+%global tools_dir %{pylibdir}/Tools
+%global demo_dir %{pylibdir}/Demo
+%global doc_tools_dir %{pylibdir}/Doc/tools
+%global dynload_dir %{pylibdir}/lib-dynload
+%global site_packages %{pylibdir}/site-packages
+
+# Python's configure script defines SOVERSION, and this is used in the Makefile
+# to determine INSTSONAME, the name of the libpython DSO:
+# LDLIBRARY='libpython$(VERSION).so'
+# INSTSONAME="$LDLIBRARY".$SOVERSION
+# We mirror this here in order to make it easier to add the -gdb.py hooks.
+# (if these get out of sync, the payload of the libs subpackage will fail
+# and halt the build)
+%global py_SOVERSION 1.0
+%global py_INSTSONAME_optimized libpython%{pybasever}.so.%{py_SOVERSION}
+%global py_INSTSONAME_debug libpython%{pybasever}_d.so.%{py_SOVERSION}
+
+%global with_huntrleaks 0
+%global with_gdb_hooks 1
+%global with_systemtap 1
+%global with_valgrind 0
+%global with_gdbm 1
+
+# Disable automatic bytecompilation. The python2.7 binary is not yet
+# available in /usr/bin when Python is built. Also, the bytecompilation fails
+# on files that test invalid syntax.
+%global __brp_python_bytecompile %{nil}
+%global regenerate_autotooling_patch 0
+
+# ==================
+# Top-level metadata
+# ==================
+Summary: Version %{pybasever} of the Python interpreter
+Name: python%{pyshortver}
+%global general_version %{pybasever}.16
+#global prerel ...
+%global upstream_version %{general_version}%{?prerel}
+Version: %{general_version}%{?prerel:~%{prerel}}
+Release: 8%{?dist}
+License: Python
+
+# Python 2 is deprecated in Fedora 30+, see:
+#
https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
+# This means that new packages MUST NOT depend on python2, even transitively
+# see:
https://fedoraproject.org/wiki/Packaging:Deprecating_Packages
+# Python 2 will not be supported after 2019. Use the python3 package instead
+# if possible.
+Provides: deprecated()
+
+# People might want to dnf install pythonX.Y instead of pythonXY
+Provides: python%{pybasever} = %{version}-%{release}
+
+# People might want to dnf install python2 instead of pythonXY
+Provides: python2 = %{version}-%{release}
+
+# We want to be nice for the packages that still remain, so we keep providing this
+# TODO stop doing this in undefined future
+Provides: python(abi) = %{pybasever}
+
+# To test the python27 without disrupting everything, we keep providing the devel part
until mid September 2019
+Provides: python2-devel = %{version}-%{release}
+Provides: python2-tkinter = %{version}-%{release}
+
+
+# =======================
+# Build-time requirements
+# =======================
+
+# (keep this list alphabetized)
+
+BuildRequires: autoconf
+BuildRequires: bluez-libs-devel
+BuildRequires: bzip2
+BuildRequires: bzip2-devel
+BuildRequires: expat-devel
+BuildRequires: findutils
+BuildRequires: gcc-c++
+BuildRequires: glibc-all-langpacks
+BuildRequires: glibc-devel
+BuildRequires: gmp-devel
+BuildRequires: libGL-devel
+BuildRequires: libX11-devel
+BuildRequires: libdb-devel
+BuildRequires: libffi-devel
+BuildRequires: libnsl2-devel
+BuildRequires: libtirpc-devel
+BuildRequires: ncurses-devel
+BuildRequires: openssl-devel
+BuildRequires: pkgconf-pkg-config
+BuildRequires: readline-devel
+BuildRequires: sqlite-devel
+BuildRequires: tar
+BuildRequires: tcl-devel
+BuildRequires: tix-devel
+BuildRequires: tk-devel
+BuildRequires: zlib-devel
+
+%if %{with_gdbm}
+# ABI change without soname bump, reverted
+BuildRequires: gdbm-devel >= 1:1.13
+%endif
+
+%if 0%{?with_systemtap}
+BuildRequires: systemtap-sdt-devel
+# (this introduces a circular dependency, in that systemtap-sdt-devel's
+# /usr/bin/dtrace is a python script)
+%global tapsetdir /usr/share/systemtap/tapset
+%endif # with_systemtap
+
+%if 0%{?with_valgrind}
+BuildRequires: valgrind-devel
+%endif
+
+%if %{with rpmwheels}
+BuildRequires: python-setuptools-wheel
+BuildRequires: python-pip-wheel
+Requires: python-setuptools-wheel
+Requires: python-pip-wheel
+%else
+Provides: bundled(python2-pip) = 18.1
+Provides: bundled(python2-setuptools) = 40.6.2
+%endif
+
+# For /usr/lib64/pkgconfig/
+Requires: pkgconf-pkg-config
+
+# The RPM related dependencies bring nothing to a non-RPM Python developer
+# But we want them when packages BuildRequire python2-devel
+Requires: (python-rpm-macros if rpm-build)
+Requires: (python2-rpm-macros if rpm-build)
+
+# When bootstrapping python3, we need to build setuptools
+# But setuptools BR python2-devel and that brings in python3-rpm-generators
+# python3-rpm-generators needs python3-setuptools, so we cannot have it yet
+Requires: (python3-rpm-generators if rpm-build)
+
+#
https://bugzilla.redhat.com/show_bug.cgi?id=1217376
+#
https://bugzilla.redhat.com/show_bug.cgi?id=1496757
+#
https://bugzilla.redhat.com/show_bug.cgi?id=1218294
+# TODO change to a specific subpackage once available (#1218294)
+Requires: (redhat-rpm-config if gcc)
+
+Obsoletes: python2 < %{version}-%{release}
+Obsoletes: python2-debug < %{version}-%{release}
+Obsoletes: python2-devel < %{version}-%{release}
+Obsoletes: python2-libs < %{version}-%{release}
+Obsoletes: python2-test < %{version}-%{release}
+Obsoletes: python2-tkinter < %{version}-%{release}
+Obsoletes: python2-tools < %{version}-%{release}
+
+
+# =======================
+# Source code and patches
+# =======================
+
+Source:
https://www.python.org/ftp/python/%{version}/Python-%{upstream_version}.t...
+
+# Systemtap tapset to make it easier to use the systemtap static probes
+# (actually a template; LIBRARY_PATH will get fixed up during install)
+# Written by dmalcolm; not yet sent upstream
+Source3: libpython.stp
+
+# Example systemtap script using the tapset
+# Written by wcohen, mjw, dmalcolm; not yet sent upstream
+Source4: systemtap-example.stp
+
+# Another example systemtap script that uses the tapset
+# Written by dmalcolm; not yet sent upstream
+Source5: pyfuntop.stp
+
+# Modules/Setup.dist is ultimately used by the "makesetup" script to construct
+# the Makefile and config.c
+#
+# Upstream leaves many things disabled by default, to try to make it easy as
+# possible to build the code on as many platforms as possible.
+#
+# TODO: many modules can also now be built by setup.py after the python binary
+# has been built; need to assess if we should instead build things there
+#
+# We patch it downstream as follows:
+# - various modules are built by default by upstream as static libraries;
+# we built them as shared libraries
+# - build the "readline" module (appears to also be handled by setup.py now)
+# - build the nis module (which needs the tirpc library since glibc 2.26)
+# - enable the build of the following modules:
+# - array arraymodule.c # array objects
+# - cmath cmathmodule.c # -lm # complex math library functions
+# - math mathmodule.c # -lm # math library functions, e.g. sin()
+# - _struct _struct.c # binary structure packing/unpacking
+# - time timemodule.c # -lm # time operations and variables
+# - operator operator.c # operator.add() and similar goodies
+# - _weakref _weakref.c # basic weak reference support
+# - _testcapi _testcapimodule.c # Python C API test module
+# - _random _randommodule.c # Random number generator
+# - _collections _collectionsmodule.c # Container types
+# - itertools itertoolsmodule.c
+# - strop stropmodule.c
+# - _functools _functoolsmodule.c
+# - _bisect _bisectmodule.c # Bisection algorithms
+# - unicodedata unicodedata.c # static Unicode character database
+# - _locale _localemodule.c
+# - fcntl fcntlmodule.c # fcntl(2) and ioctl(2)
+# - spwd spwdmodule.c # spwd(3)
+# - grp grpmodule.c # grp(3)
+# - select selectmodule.c # select(2); not on ancient System V
+# - mmap mmapmodule.c # Memory-mapped files
+# - _csv _csv.c # CSV file helper
+# - _socket socketmodule.c # Socket module helper for socket(2)
+# - _ssl _ssl.c
+# - crypt cryptmodule.c -lcrypt # crypt(3)
+# - termios termios.c # Steen Lumholt's termios module
+# - resource resource.c # Jeremy Hylton's rlimit interface
+# - audioop audioop.c # Operations on audio samples
+# - imageop imageop.c # Operations on images
+# - _md5 md5module.c md5.c
+# - _sha shamodule.c
+# - _sha256 sha256module.c
+# - _sha512 sha512module.c
+# - linuxaudiodev linuxaudiodev.c
+# - timing timingmodule.c
+# - _tkinter _tkinter.c tkappinit.c
+# - dl dlmodule.c
+# - gdbm gdbmmodule.c
+# - _bsddb _bsddb.c
+# - binascii binascii.c
+# - parser parsermodule.c
+# - cStringIO cStringIO.c
+# - cPickle cPickle.c
+# - zlib zlibmodule.c
+# - _multibytecodec cjkcodecs/multibytecodec.c
+# - _codecs_cn cjkcodecs/_codecs_cn.c
+# - _codecs_hk cjkcodecs/_codecs_hk.c
+# - _codecs_iso2022 cjkcodecs/_codecs_iso2022.c
+# - _codecs_jp cjkcodecs/_codecs_jp.c
+# - _codecs_kr cjkcodecs/_codecs_kr.c
+# - _codecs_tw cjkcodecs/_codecs_tw.c
+Patch0: python-2.7.1-config.patch
+
+# Removes the "-g" option from "pydoc", for some reason; I believe
+# (dmalcolm 2010-01-29) that this was introduced in this change:
+# - fix pydoc (#68082)
+# in 2.2.1-12 as a response to the -g option needing TkInter installed
+# (Red Hat Linux 8)
+# Not upstream
+Patch1: 00001-pydocnogui.patch
+
+# Add $(CFLAGS) to the linker arguments when linking the "python" binary
+# since some architectures (sparc64) need this (rhbz:199373).
+# Not yet filed upstream
+Patch4: python-2.5-cflags.patch
+
+# Work around a bug in Python' gettext module relating to the
"Plural-Forms"
+# header (rhbz:252136)
+# Related to upstream issues:
+#
http://bugs.python.org/issue1448060 and
http://bugs.python.org/issue1475523
+# though the proposed upstream patches are, alas, different
+Patch6: python-2.5.1-plural-fix.patch
+
+# This patch was listed in the changelog as:
+# * Fri Sep 14 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-11
+# - fix encoding of sqlite .py files to work around weird encoding problem
+# in Turkish (#283331)
+# A traceback attached to rhbz 244016 shows the problem most clearly: a
+# traceback on attempting to import the sqlite module, with:
+# "SyntaxError: encoding problem: with BOM (__init__.py, line 1)"
+# This seems to come from Parser/tokenizer.c:check_coding_spec
+# Our patch changes two source files within sqlite3, removing the
+# "coding: ISO-8859-1" specs and character E4 = U+00E4 =
+# LATIN SMALL LETTER A WITH DIAERESIS from in ghaering's surname.
+#
+# It may be that the conversion of "ISO-8859-1" to "iso-8859-1" is
thwarted
+# by the implementation of "tolower" in the Turkish locale; see:
+#
https://bugzilla.redhat.com/show_bug.cgi?id=191096#c9
+#
+# TODO: Not yet sent upstream, and appears to me (dmalcolm 2010-01-29) that
+# it may be papering over a symptom
+Patch7: python-2.5.1-sqlite-encoding.patch
+
+# FIXME: Lib/ctypes/util.py posix implementation defines a function
+# _get_soname(f). Upstreams's implementation of this uses objdump to read the
+# SONAME from a library; we avoid this, apparently to minimize space
+# requirements on the live CD:
+# (rhbz:307221)
+Patch10: 00010-2.7.13-binutils-no-dep.patch
+
+# Upstream as of Python 2.7.3:
+# Patch11: python-2.7rc1-codec-ascii-tolower.patch
+
+# Add various constants to the socketmodule (rhbz#436560):
+# TODO: these patches were added in 2.5.1-22 and 2.5.1-24 but appear not to
+# have been sent upstream yet:
+Patch13: python-2.7rc1-socketmodule-constants.patch
+Patch14: python-2.7rc1-socketmodule-constants2.patch
+
+# Remove an "-rpath $(LIBDIR)" argument from the linkage args in configure.in:
+# FIXME: is this for OSF, not Linux?
+Patch16: python-2.6-rpath.patch
+
+# Fixup distutils/unixccompiler.py to remove standard library path from rpath:
+# Adapted from Patch0 in ivazquez' python3000 specfile, removing usage of
+# super() as it's an old-style class
+Patch17: python-2.6.4-distutils-rpath.patch
+
+# 00055 #
+# Systemtap support: add statically-defined probe points
+# Patch based on upstream bug:
http://bugs.python.org/issue4111
+# fixed up by mjw and wcohen for 2.6.2, then fixed up by dmalcolm for 2.6.4
+# then rewritten by mjw (attachment 390110 of rhbz 545179), then reformatted
+# for 2.7rc1 by dmalcolm:
+Patch55: 00055-systemtap.patch
+
+# Only used when "%%{_lib}" == "lib64"
+# Fixup various paths throughout the build and in distutils from "lib" to
"lib64",
+# and add the /usr/lib64/pythonMAJOR.MINOR/site-packages to sitedirs, in front of
+# /usr/lib/pythonMAJOR.MINOR/site-packages
+# Not upstream
+Patch102: 00102-2.7.13-lib64.patch
+
+# Python 2.7 split out much of the path-handling from distutils/sysconfig.py to
+# a new sysconfig.py (in r77704).
+# We need to make equivalent changes to that new file to ensure that the stdlib
+# and platform-specific code go to /usr/lib64 not /usr/lib, on 64-bit archs:
+Patch103: python-2.7-lib64-sysconfig.patch
+
+# 00104 #
+# Only used when "%%{_lib}" == "lib64"
+# Another lib64 fix, for distutils/tests/test_install.py; not upstream:
+Patch104: 00104-lib64-fix-for-test_install.patch
+
+# 00111 #
+# Patch the Makefile.pre.in so that the generated Makefile doesn't try to build
+# a libpythonMAJOR.MINOR.a (bug 550692):
+# Downstream only: not appropriate for upstream
+Patch111: 00111-no-static-lib.patch
+
+# 00112 #
+# Patch to support building both optimized vs debug stacks DSO ABIs, sharing
+# the same .py and .pyc files, using "_d.so" to signify a debug build of an
+# extension module.
+#
+# Based on Debian's patch for the same,
+#
http://patch-tracker.debian.org/patch/series/view/python2.6/2.6.5-2/debug...
+#
+# (which was itself based on the upstream Windows build), but with some
+# changes:
+#
+# * Debian's patch to dynload_shlib.c looks for module_d.so, then module.so,
+# but this can potentially find a module built against the wrong DSO ABI. We
+# instead search for just module_d.so in a debug build
+#
+# * We remove this change from configure.in's build of the Makefile:
+# SO=$DEBUG_EXT.so
+# so that sysconfig.py:customize_compiler stays with shared_lib_extension='.so'
+# on debug builds, so that UnixCCompiler.find_library_file can find system
+# libraries (otherwise "make sharedlibs" fails to find system libraries,
+# erroneously looking e.g. for "libffi_d.so" rather than
"libffi.so")
+#
+# * We change Lib/distutils/command/build_ext.py:build_ext.get_ext_filename
+# to add the _d there, when building an extension. This way, "make
sharedlibs"
+# can build ctypes, by finding the sysmtem libffi.so (rather than failing to
+# find "libffi_d.so"), and builds the module as _ctypes_d.so
+#
+# * Similarly, update build_ext:get_libraries handling of Py_ENABLE_SHARED by
+# appending "_d" to the python library's name for the debug configuration
+#
+# * We modify Modules/makesetup to add the "_d" to the generated Makefile
+# rules for the various Modules/*.so targets
+#
+# This may introduce issues when building an extension that links directly
+# against another extension (e.g. users of NumPy?), but seems more robust when
+# searching for external libraries
+#
+# * We don't change Lib/distutils/command/build.py: build.build_purelib to
+# embed plat_specifier, leaving it as is, as pure python builds should be
+# unaffected by these differences (we'll be sharing the .py and .pyc files)
+#
+# * We introduce DEBUG_SUFFIX as well as DEBUG_EXT:
+# - DEBUG_EXT is used by ELF files (names and SONAMEs); it will be "_d"
for
+# a debug build
+# - DEBUG_SUFFIX is used by filesystem paths; it will be "-debug" for a
+# debug build
+#
+# Both will be empty in an optimized build. "_d" contains characters that
+# are valid ELF metadata, but this leads to various ugly filesystem paths (such
+# as the include path), and DEBUG_SUFFIX allows these paths to have more natural
+# names. Changing this requires changes elsewhere in the distutils code.
+#
+# * We add DEBUG_SUFFIX to PYTHON in the Makefile, so that the two
+# configurations build parallel-installable binaries with different names
+# ("python-debug" vs "python").
+#
+# * Similarly, we add DEBUG_SUFFIX within python-config and
+# python$(VERSION)-config, so that the two configuration get different paths
+# for these.
+#
+# See also patch 130 below
+#
+Patch112: 00112-2.7.13-debug-build.patch
+
+
+# 00113 #
+# Add configure-time support for the COUNT_ALLOCS and CALL_PROFILE options
+# described at
http://svn.python.org/projects/python/trunk/Misc/SpecialBuilds.txt
+# so that if they are enabled, they will be in that build's pyconfig.h, so that
+# extension modules will reliably use them
+# Not yet sent upstream
+Patch113: 00113-more-configuration-flags.patch
+
+# 00114 #
+# Add flags for statvfs.f_flag to the constant list in posixmodule (i.e. "os")
+# (rhbz:553020); partially upstream as
http://bugs.python.org/issue7647
+# Not yet sent upstream
+Patch114: 00114-statvfs-f_flag-constants.patch
+
+# Upstream r79310 removed the "Modules" directory from sys.path when Python is
+# running from the build directory on POSIX to fix a unit test (issue #8205).
+# This seems to have broken the compileall.py done in "make install": it
cannot
+# find shared library extension modules at this point in the build (sys.path
+# does not contain DESTDIR/usr/lib(64)/python-2.7/lib-dynload for some reason),
+# leading to the build failing with:
+# Traceback (most recent call last):
+# File
"/home/david/rpmbuild/BUILDROOT/python-2.7-0.1.rc2.fc14.x86_64/usr/lib64/python2.7/compileall.py",
line 17, in <module>
+# import struct
+# File
"/home/david/rpmbuild/BUILDROOT/python-2.7-0.1.rc2.fc14.x86_64/usr/lib64/python2.7/struct.py",
line 1, in <module>
+# from _struct import *
+# ImportError: No module named _struct
+# This patch adds the build Modules directory to build path.
+Patch121: 00121-add-Modules-to-build-path.patch
+
+# 2.7.1 (in r84230) added a test to test_abc which fails if python is
+# configured with COUNT_ALLOCS, which is the case for our debug build
+# (the COUNT_ALLOCS instrumentation keeps "C" alive).
+# Not yet sent upstream
+Patch128: python-2.7.1-fix_test_abc_with_COUNT_ALLOCS.patch
+
+# 00130 #
+# Add "--extension-suffix" option to python-config and python-debug-config
+# (rhbz#732808)
+#
+# This is adapted from 3.2's PEP-3149 support.
+#
+# Fedora's debug build has some non-standard features (see also patch 112
+# above), though largely shared with Debian/Ubuntu and Windows
+#
+# In particular, SO in the Makefile is currently always just ".so" for our
+# python 2 optimized builds, but for python 2 debug it should be '_d.so', to
+# distinguish the debug vs optimized ABI, following the pattern in the above
+# patch.
+#
+# Not yet sent upstream
+Patch130: python-2.7.2-add-extension-suffix-to-python-config.patch
+
+# 00131 #
+# The four tests in test_io built on top of check_interrupted_write_retry
+# fail when built in Koji, for ppc and ppc64; for some reason, the SIGALRM
+# handlers are never called, and the call to write runs to completion
+# (rhbz#732998)
+Patch131: 00131-disable-tests-in-test_io.patch
+
+# 00132 #
+# Add non-standard hooks to unittest for use in the "check" phase below, when
+# running selftests within the build:
+# @unittest._skipInRpmBuild(reason)
+# for tests that hang or fail intermittently within the build environment, and:
+# @unittest._expectedFailureInRpmBuild
+# for tests that always fail within the build environment
+#
+# The hooks only take effect if WITHIN_PYTHON_RPM_BUILD is set in the
+# environment, which we set manually in the appropriate portion of the "check"
+# phase below (and which potentially other python-* rpms could set, to reuse
+# these unittest hooks in their own "check" phases)
+Patch132: 00132-add-rpmbuild-hooks-to-unittest.patch
+
+# 00133 #
+# "dl" is deprecated, and test_dl doesn't work on 64-bit builds:
+Patch133: 00133-skip-test_dl.patch
+
+# 00136 #
+# Some tests try to seek on sys.stdin, but don't work as expected when run
+# within Koji/mock; skip them within the rpm build:
+Patch136: 00136-skip-tests-of-seeking-stdin-in-rpmbuild.patch
+
+# 00137 #
+# Some tests within distutils fail when run in an rpmbuild:
+Patch137: 00137-skip-distutils-tests-that-fail-in-rpmbuild.patch
+
+# 00138 #
+# Fixup some tests within distutils to work with how debug builds are set up:
+Patch138: 00138-fix-distutils-tests-in-debug-build.patch
+
+# 00139 #
+# ARM-specific: skip known failure in test_float:
+#
http://bugs.python.org/issue8265 (rhbz#706253)
+Patch139: 00139-skip-test_float-known-failure-on-arm.patch
+
+# 00140 #
+# Sparc-specific: skip known failure in test_ctypes:
+#
http://bugs.python.org/issue8314 (rhbz#711584)
+# which appears to be a libffi bug
+Patch140: 00140-skip-test_ctypes-known-failure-on-sparc.patch
+
+# 00142 #
+# Some pty tests fail when run in mock (rhbz#714627):
+Patch142: 00142-skip-failing-pty-tests-in-rpmbuild.patch
+
+# 00143 #
+# Fix the --with-tsc option on ppc64, and rework it on 32-bit ppc to avoid
+# aliasing violations (rhbz#698726)
+# Sent upstream as
http://bugs.python.org/issue12872
+Patch143: 00143-tsc-on-ppc.patch
+
+# 00144 #
+# (Optionally) disable the gdbm module:
+Patch144: 00144-no-gdbm.patch
+
+# 00146 #
+# Support OpenSSL FIPS mode (e.g. when OPENSSL_FORCE_FIPS_MODE=1 is set)
+# - handle failures from OpenSSL (e.g. on attempts to use MD5 in a
+# FIPS-enforcing environment)
+# - add a new "usedforsecurity" keyword argument to the various digest
+# algorithms in hashlib so that you can whitelist a callsite with
+# "usedforsecurity=False"
+# (sent upstream for python 3 as
http://bugs.python.org/issue9216; this is a
+# backport to python 2.7; see RHEL6 patch 119)
+# - enforce usage of the _hashlib implementation: don't fall back to the _md5
+# and _sha* modules (leading to clearer error messages if fips selftests
+# fail)
+# - don't build the _md5 and _sha* modules; rely on the _hashlib implementation
+# of hashlib (for example, md5.py will use _hashlib's implementation of MD5,
+# if permitted by the FIPS setting)
+# (rhbz#563986)
+Patch146: 00146-hashlib-fips.patch
+
+# 00147 #
+# Add a sys._debugmallocstats() function
+# Based on patch 202 from RHEL 5's python.spec, with updates from rhbz#737198
+# Sent upstream as
http://bugs.python.org/issue14785
+Patch147: 00147-add-debug-malloc-stats.patch
+
+# 00155 #
+# Avoid allocating thunks in ctypes unless absolutely necessary, to avoid
+# generating SELinux denials on "import ctypes" and "import uuid"
when
+# embedding Python within httpd (rhbz#814391)
+Patch155: 00155-avoid-ctypes-thunks.patch
+
+# 00156 #
+# Recent builds of gdb will only auto-load scripts from certain safe
+# locations. Turn off this protection when running test_gdb in the selftest
+# suite to ensure that it can load our -gdb.py script (rhbz#817072):
+# Not yet sent upstream
+Patch156: 00156-gdb-autoload-safepath.patch
+
+# 00157 #
+# Update uid/gid handling throughout the standard library: uid_t and gid_t are
+# unsigned 32-bit values, but existing code often passed them through C long
+# values, which are signed 32-bit values on 32-bit architectures, leading to
+# negative int objects for uid/gid values >= 2^31 on 32-bit architectures.
+#
+# Introduce _PyObject_FromUid/Gid to convert uid_t/gid_t values to python
+# objects, using int objects where the value will fit (long objects otherwise),
+# and _PyArg_ParseUid/Gid to convert int/long to uid_t/gid_t, with -1 allowed
+# as a special case (since this is given special meaning by the chown syscall)
+#
+# Update standard library to use this throughout for uid/gid values, so that
+# very large uid/gid values are round-trippable, and -1 remains usable.
+# (rhbz#697470)
+Patch157: 00157-uid-gid-overflows.patch
+
+# 00165 #
+# Backport to Python 2 from Python 3.3 of improvements to the "crypt" module
+# adding precanned ways of salting a password (rhbz#835021)
+# Based on r88500 patch to py3k from Python 3.3
+# plus 6482dd1c11ed, 0586c699d467, 62994662676a, 74a1110a3b50, plus edits
+# to docstrings to note that this additional functionality is not standard
+# within 2.7
+Patch165: 00165-crypt-module-salt-backport.patch
+
+# 00167 #
+# Don't run any of the stack navigation tests in test_gdb when Python is
+# optimized, since there appear to be many different ways in which gdb can
+# fail to read the PyFrameObject* for arbitrary places in the callstack,
+# presumably due to compiler optimization (rhbz#912025)
+#
+# Not yet sent upstream
+Patch167: 00167-disable-stack-navigation-tests-when-optimized-in-test_gdb.patch
+
+# 00168 #
+# Update distutils.sysconfig so that if CFLAGS is defined in the environment,
+# when building extension modules, it is appended to the full compilation
+# flags from Python's Makefile, rather than instead reducing the compilation
+# flags to the subset within OPT and adding it to those.
+#
+# In particular, this should ensure that "-fno-strict-aliasing" is used by
+# "python setup.py build" even when CFLAGS is defined in the environment.
+#
+# (rhbz#849994)
+Patch168: 00168-distutils-cflags.patch
+
+# 00169 #
+# Use SHA-256 rather than implicitly using MD5 within the challenge handling
+# in multiprocessing.connection
+#
+# Sent upstream as
http://bugs.python.org/issue17258
+# (rhbz#879695)
+Patch169: 00169-avoid-implicit-usage-of-md5-in-multiprocessing.patch
+
+# 00170 #
+# In debug builds, try to print repr() when a C-level assert fails in the
+# garbage collector (typically indicating a reference-counting error
+# somewhere else e.g in an extension module)
+# Backported to 2.7 from a patch I sent upstream for py3k
+#
http://bugs.python.org/issue9263 (rhbz#614680)
+# hiding the proposed new macros/functions within gcmodule.c to avoid exposing
+# them within the extension API.
+# (rhbz#850013)
+Patch170: 00170-gc-assertions.patch
+
+# 00174 #
+# Workaround for failure to set up prefix/exec_prefix when running
+# an embededed libpython that sets Py_SetProgramName() to a name not
+# on $PATH when run from the root directory due to
+#
https://fedoraproject.org/wiki/Features/UsrMove
+# e.g. cmpi-bindings under systemd (rhbz#817554):
+Patch174: 00174-fix-for-usr-move.patch
+
+# 00180 #
+# Enable building on ppc64p7
+# Not appropriate for upstream, Fedora-specific naming
+Patch180: 00180-python-add-support-for-ppc64p7.patch
+
+# 00181 #
+# Allow arbitrary timeout for Condition.wait, as reported in
+#
https://bugzilla.redhat.com/show_bug.cgi?id=917709
+# Upstream doesn't want this:
http://bugs.python.org/issue17748
+# But we have no better solution downstream yet, and since there is
+# no API breakage, we apply this patch.
+# Doesn't apply to Python 3, where this is fixed otherwise and works.
+Patch181: 00181-allow-arbitrary-timeout-in-condition-wait.patch
+
+# 00185 #
+# Makes urllib2 honor "no_proxy" enviroment variable for "ftp:" URLs
+# when ftp_proxy is set
+Patch185: 00185-urllib2-honors-noproxy-for-ftp.patch
+
+# 00187 #
+# Add an explicit RPATH to pyexpat.so pointing at the directory
+# containing the system expat (which has the extra XML_SetHashSalt
+# symbol), to avoid an ImportError with a link error if there's an
+# LD_LIBRARY_PATH containing a "vanilla" build of expat (without the
+# symbol)
+Patch187: 00187-add-RPATH-to-pyexpat.patch
+
+# 00189 #
+# Instead of bundled wheels, use our RPM packaged wheels from
+# /usr/share/python-wheels
+Patch189: 00189-use-rpm-wheels.patch
+
+# 00191 #
+# Disabling NOOP test as it fails without internet connection
+Patch191: 00191-disable-NOOP.patch
+
+# 00193 #
+# Enable loading sqlite extensions. This patch isn't needed for
+# python3.spec, since Python 3 has a configuration option for this.
+# rhbz#1066708
+# Patch provided by John C. Peterson
+Patch193: 00193-enable-loading-sqlite-extensions.patch
+
+# 00289 #
+# Disable automatic detection for the nis module
+# (we handle it it in Setup.dist, see Patch0)
+Patch289: 00289-disable-nis-detection.patch
+
+# (New patches go here ^^^)
+#
+# When adding new patches to "python2" and "python3" in Fedora, EL,
etc.,
+# please try to keep the patch numbers in-sync between all specfiles.
+#
+# More information, and a patch number catalog, is at:
+#
+#
https://fedoraproject.org/wiki/SIGs/Python/PythonPatches
+
+# This is the generated patch to "configure"; see the description of
+# %%{regenerate_autotooling_patch}
+# above:
+
+Patch5000: 05000-autotool-intermediates.patch
+
+# ======================================================
+# Additional metadata
+# ======================================================
+
+URL:
https://www.python.org/
+
+%description
+Python 2 is an old version of the language that is incompatible with the 3.x
+line of releases. The language is mostly the same, but many details, especially
+how built-in objects like dictionaries and strings work, have changed
+considerably, and a lot of deprecated features have finally been removed in the
+3.x line.
+
+Note that Python 2 is not supported upstream after 2020-01-01, please use the
+python3 package instead if you can.
+
+This package also provides the "python2" executable.
+
+# ======================================================
+# The prep phase of the build:
+# ======================================================
+
+%prep
+%setup -q -n Python-%{upstream_version}
+
+%if 0%{?with_systemtap}
+# Provide an example of usage of the tapset:
+cp -a %{SOURCE4} .
+cp -a %{SOURCE5} .
+%endif # with_systemtap
+
+# Ensure that we're using the system copy of various libraries, rather than
+# copies shipped by upstream in the tarball:
+# Remove embedded copy of expat:
+rm -r Modules/expat || exit 1
+
+# Remove embedded copy of libffi:
+for SUBDIR in darwin libffi libffi_arm_wince libffi_msvc libffi_osx ; do
+ rm -r Modules/_ctypes/$SUBDIR || exit 1 ;
+done
+
+# Remove embedded copy of zlib:
+rm -r Modules/zlib || exit 1
+
+## Disabling hashlib patch for now as it needs to be reimplemented
+## for OpenSSL 1.1.0.
+# Don't build upstream Python's implementation of these crypto algorithms;
+# instead rely on _hashlib and OpenSSL.
+#
+# For example, in our builds md5.py uses always uses hashlib.md5 (rather than
+# falling back to _md5 when hashlib.md5 is not available); hashlib.md5 is
+# implemented within _hashlib via OpenSSL (and thus respects FIPS mode)
+#for f in md5module.c md5.c shamodule.c sha256module.c sha512module.c; do
+# rm Modules/$f
+#done
+
+#
+# Apply patches:
+#
+%patch0 -p1 -b .rhconfig
+%patch1 -p1 -b .no_gui
+%patch4 -p1 -b .cflags
+%patch6 -p1 -b .plural
+%patch7 -p1
+
+%if "%{_lib}" == "lib64"
+%patch102 -p1 -b .lib64
+%patch103 -p1 -b .lib64-sysconfig
+%patch104 -p1
+%endif
+
+%patch10 -p1 -b .binutils-no-dep
+%patch13 -p1 -b .socketmodule
+%patch14 -p1 -b .socketmodule2
+%patch16 -p1 -b .rpath
+%patch17 -p1 -b .distutils-rpath
+
+%if 0%{?with_systemtap}
+%patch55 -p1 -b .systemtap
+%endif
+
+%patch111 -p1 -b .no-static-lib
+
+%patch112 -p1 -b .debug-build
+
+%patch113 -p1 -b .more-configuration-flags
+
+%patch114 -p1 -b .statvfs-f-flag-constants
+
+
+%patch121 -p1
+%patch128 -p1
+
+%patch130 -p1
+
+%ifarch ppc %{power64}
+%patch131 -p1
+%endif
+
+%patch132 -p1
+%patch133 -p1
+%patch136 -p1 -b .stdin-test
+%patch137 -p1
+%patch138 -p1
+%ifarch %{arm}
+%patch139 -p1
+%endif
+%ifarch %{sparc}
+%patch140 -p1
+%endif
+%patch142 -p1 -b .tty-fail
+%patch143 -p1 -b .tsc-on-ppc
+%if !%{with_gdbm}
+%patch144 -p1
+%endif
+#patch146 -p1
+%patch147 -p1
+%patch155 -p1
+%patch156 -p1
+%patch157 -p1
+%patch165 -p1
+mv Modules/cryptmodule.c Modules/_cryptmodule.c
+%patch167 -p1
+%patch168 -p1
+%patch169 -p1
+%patch170 -p1
+%patch174 -p1 -b .fix-for-usr-move
+%patch180 -p1
+%patch181 -p1
+%patch185 -p1
+%patch187 -p1
+
+%if %{with rpmwheels}
+%patch189 -p1
+rm Lib/ensurepip/_bundled/*.whl
+%endif
+
+%patch191 -p1
+%patch193 -p1
+%patch289 -p1
+
+# This shouldn't be necesarry, but is right now (2.2a3)
+find -name "*~" |xargs rm -f
+
+%if ! 0%{regenerate_autotooling_patch}
+# Normally we apply the patch to "configure"
+# We don't apply the patch if we're working towards regenerating it
+%patch5000 -p0 -b .autotool-intermediates
+%endif
+
+
+# ======================================================
+# Configuring and building the code:
+# ======================================================
+
+%build
+topdir=$(pwd)
+export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv"
+export CXXFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv"
+export CPPFLAGS="$(pkg-config --cflags-only-I libffi)"
+export OPT="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv"
+export LINKCC="gcc"
+export LDFLAGS="$RPM_LD_FLAGS"
+if pkg-config openssl ; then
+ export CFLAGS="$CFLAGS $(pkg-config --cflags openssl)"
+ export LDFLAGS="$LDFLAGS $(pkg-config --libs-only-L openssl)"
+fi
+# Force CC
+export CC=gcc
+
+%if 0%{regenerate_autotooling_patch}
+# If enabled, this code regenerates the patch to "configure", using a
+# local copy of autoconf-2.65, then exits the build
+#
+# The following assumes that the copy is installed to ~/autoconf-2.65/bin
+# as per these instructions:
+#
http://bugs.python.org/issue7997
+
+for f in pyconfig.h.in configure ; do
+ cp $f $f.autotool-intermediates ;
+done
+
+# Rerun the autotools:
+PATH=~/autoconf-2.65/bin:$PATH autoconf
+autoheader
+
+# Regenerate the patch:
+gendiff . .autotool-intermediates > %{PATCH5000}
+
+
+# Exit the build
+exit 1
+%endif
+
+# Define a function, for how to perform a "build" of python for a given
+# configuration:
+BuildPython() {
+ ConfName=$1
+ BinaryName=$2
+ SymlinkName=$3
+ ExtraConfigArgs=$4
+ PathFixWithThisBinary=$5
+
+ ConfDir=build/$ConfName
+
+ echo STARTING: BUILD OF PYTHON FOR CONFIGURATION: $ConfName - %{_bindir}/$BinaryName
+ mkdir -p $ConfDir
+
+ pushd $ConfDir
+
+ # Use the freshly created "configure" script, but in the directory two
above:
+ %global _configure $topdir/configure
+
+%configure \
+ --enable-ipv6 \
+ --enable-shared \
+ --enable-unicode=%{unicode} \
+ --with-dbmliborder=gdbm:ndbm:bdb \
+ --with-system-expat \
+ --with-system-ffi \
+%if 0%{?with_systemtap}
+ --with-dtrace \
+ --with-tapset-install-dir=%{tapsetdir} \
+%endif
+%if 0%{?with_valgrind}
+ --with-valgrind \
+%endif
+ $ExtraConfigArgs \
+ %{nil}
+
+make EXTRA_CFLAGS="$CFLAGS" %{?_smp_mflags}
+
+# We need to fix shebang lines across the full source tree.
+#
+# We do this using the pathfix.py script, which requires one of the
+# freshly-built Python binaries.
+#
+# We use the optimized python binary, and make the shebangs point at that same
+# optimized python binary:
+if $PathFixWithThisBinary
+then
+ # pathfix.py currently only works with files matching ^[a-zA-Z0-9_]+\.py$
+ # when crawling through directories, so we handle the special cases manually
+ LD_LIBRARY_PATH="$topdir/$ConfDir" ./$BinaryName \
+ $topdir/Tools/scripts/pathfix.py \
+ -i "%{_bindir}/python%{pybasever}" \
+ $topdir \
+ $topdir/Tools/pynche/pynche \
+ $topdir/Demo/pdist/{rcvs,rcsbump,rrcs} \
+ $topdir/Demo/scripts/find-uname.py \
+ $topdir/Tools/scripts/reindent-rst.py
+fi
+
+# Rebuild with new python
+# We need a link to a versioned python in the build directory
+ln -s $BinaryName $SymlinkName
+LD_LIBRARY_PATH="$topdir/$ConfDir" PATH=$PATH:$topdir/$ConfDir make -s
EXTRA_CFLAGS="$CFLAGS" %{?_smp_mflags}
+
+ popd
+ echo FINISHED: BUILD OF PYTHON FOR CONFIGURATION: $ConfDir
+}
+
+# Use "BuildPython" to support building with different configurations:
+
+BuildPython optimized \
+ python \
+ python%{pybasever} \
+ "" \
+ true
+
+
+# ======================================================
+# Installing the built code:
+# ======================================================
+
+%install
+topdir=$(pwd)
+rm -rf %{buildroot}
+mkdir -p %{buildroot}%{_prefix} %{buildroot}%{_mandir}
+
+# Clean up patched .py files that are saved as .lib64
+for f in distutils/command/install distutils/sysconfig; do
+ rm -f Lib/$f.py.lib64
+done
+
+InstallPython() {
+
+ ConfName=$1
+ BinaryName=$2
+ PyInstSoName=$3
+
+ ConfDir=build/$ConfName
+
+ echo STARTING: INSTALL OF PYTHON FOR CONFIGURATION: $ConfName - %{_bindir}/$BinaryName
+ mkdir -p $ConfDir
+
+ pushd $ConfDir
+
+make install DESTDIR=%{buildroot}
+
+# We install a collection of hooks for gdb that make it easier to debug
+# executables linked against libpython (such as /usr/lib/python itself)
+#
+# These hooks are implemented in Python itself
+#
+# gdb-archer looks for them in the same path as the ELF file, with a -gdb.py suffix.
+# We put them in the debuginfo package by installing them to e.g.:
+# /usr/lib/debug/usr/lib/libpython2.6.so.1.0.debug-gdb.py
+# (note that the debug path is /usr/lib/debug for both 32/64 bit)
+#
+# See
https://fedoraproject.org/wiki/Features/EasierPythonDebugging for more
+# information
+#
+# Initially I tried:
+# /usr/lib/libpython2.6.so.1.0-gdb.py
+# but doing so generated noise when ldconfig was rerun (rhbz:562980)
+#
+%if 0%{?with_gdb_hooks}
+DirHoldingGdbPy=%{_prefix}/lib/debug/%{_libdir}
+PathOfGdbPy=$DirHoldingGdbPy/$PyInstSoName-%{version}-%{release}.%{_arch}.debug-gdb.py
+
+mkdir -p %{buildroot}$DirHoldingGdbPy
+cp $topdir/Tools/gdb/libpython.py %{buildroot}$PathOfGdbPy
+
+# Manually byte-compile the file, in case find-debuginfo.sh is run before
+# brp-python-bytecompile, so that the .pyc/.pyo files are properly listed in
+# the debuginfo manifest:
+LD_LIBRARY_PATH="$topdir/$ConfDir" $topdir/$ConfDir/$BinaryName \
+ -c "import compileall; import sys;
compileall.compile_dir('%{buildroot}$DirHoldingGdbPy',
ddir='$DirHoldingGdbPy')"
+
+LD_LIBRARY_PATH="$topdir/$ConfDir" $topdir/$ConfDir/$BinaryName -O \
+ -c "import compileall; import sys;
compileall.compile_dir('%{buildroot}$DirHoldingGdbPy',
ddir='$DirHoldingGdbPy')"
+%endif # with_gdb_hooks
+
+ popd
+
+ echo FINISHED: INSTALL OF PYTHON FOR CONFIGURATION: $ConfName
+}
+
+# Use "InstallPython" to support building with different configurations:
+
+# Now the optimized build:
+InstallPython optimized \
+ python%{pybasever} \
+ %{py_INSTSONAME_optimized}
+
+
+# Fix the interpreter path in binaries installed by distutils
+# (which changes them by itself)
+# Make sure we preserve the file permissions
+for fixed in %{buildroot}%{_bindir}/pydoc; do
+ sed 's,#!.*/python$,#!/usr/bin/env python%{pybasever},' $fixed > $fixed-
\
+ && cat $fixed- > $fixed && rm -f $fixed-
+done
+
+# Junk, no point in putting in -test sub-pkg
+rm -f %{buildroot}/%{pylibdir}/idlelib/testcode.py*
+
+# don't include tests that are run at build time in the package
+# This is documented, and used: rhbz#387401
+if /bin/false; then
+ # Move this to -test subpackage.
+mkdir save_bits_of_test
+for i in test_support.py __init__.py; do
+ cp -a %{buildroot}/%{pylibdir}/test/$i save_bits_of_test
+done
+rm -rf %{buildroot}/%{pylibdir}/test
+mkdir %{buildroot}/%{pylibdir}/test
+cp -a save_bits_of_test/* %{buildroot}/%{pylibdir}/test
+fi
+
+# tools
+
+mkdir -p ${RPM_BUILD_ROOT}%{site_packages}
+
+#pynche
+rm -f Tools/pynche/*.pyw
+cp -rp Tools/pynche \
+ ${RPM_BUILD_ROOT}%{site_packages}/
+
+mv Tools/pynche/README Tools/pynche/README.pynche
+
+#gettext
+install -m755 Tools/i18n/pygettext.py %{buildroot}%{_bindir}/
+install -m755 Tools/i18n/msgfmt.py %{buildroot}%{_bindir}/
+
+# Useful development tools
+install -m755 -d %{buildroot}%{tools_dir}/scripts
+install Tools/README %{buildroot}%{tools_dir}/
+install Tools/scripts/*py %{buildroot}%{tools_dir}/scripts/
+
+# Documentation tools
+install -m755 -d %{buildroot}%{doc_tools_dir}
+#install -m755 Doc/tools/mkhowto %{buildroot}%{doc_tools_dir}
+
+# Useful demo scripts
+install -m755 -d %{buildroot}%{demo_dir}
+cp -ar Demo/* %{buildroot}%{demo_dir}
+
+# Get rid of crap
+find %{buildroot}/ -name "*~"|xargs rm -f
+find %{buildroot}/ -name ".cvsignore"|xargs rm -f
+find %{buildroot}/ -name "*.bat"|xargs rm -f
+find . -name "*~"|xargs rm -f
+find . -name ".cvsignore"|xargs rm -f
+
+
+# Provide binaries in the form of bin2 and bin2.7, thus implementing
+# (and expanding) the recommendations of PEP 394.
+# Do NOT provide unversioned binaries
+#
https://fedoraproject.org/wiki/Changes/Python_means_Python3
+mv %{buildroot}%{_bindir}/idle %{buildroot}%{_bindir}/idle%{pybasever}
+ln -s ./idle%{pybasever} %{buildroot}%{_bindir}/idle2
+
+mv %{buildroot}%{_bindir}/pydoc %{buildroot}%{_bindir}/pydoc%{pybasever}
+ln -s ./pydoc%{pybasever} %{buildroot}%{_bindir}/pydoc2
+
+mv %{buildroot}%{_bindir}/pygettext.py %{buildroot}%{_bindir}/pygettext%{pybasever}.py
+ln -s ./pygettext%{pybasever}.py %{buildroot}%{_bindir}/pygettext2.py
+
+mv %{buildroot}%{_bindir}/msgfmt.py %{buildroot}%{_bindir}/msgfmt%{pybasever}.py
+ln -s ./msgfmt%{pybasever}.py %{buildroot}%{_bindir}/msgfmt2.py
+
+mv %{buildroot}%{_bindir}/smtpd.py %{buildroot}%{_bindir}/smtpd%{pybasever}.py
+ln -s ./smtpd%{pybasever}.py %{buildroot}%{_bindir}/smtpd2.py
+
+# Fix for bug #136654
+rm -f %{buildroot}%{pylibdir}/email/test/data/audiotest.au
%{buildroot}%{pylibdir}/test/audiotest.au
+
+# Fix bug #143667: python should own /usr/lib/python2.x on 64-bit machines
+%if "%{_lib}" == "lib64"
+install -d %{buildroot}/%{_prefix}/lib/python%{pybasever}/site-packages
+%endif
+
+# Make python-devel multilib-ready (bug #192747, #139911)
+%global _pyconfig32_h pyconfig-32.h
+%global _pyconfig64_h pyconfig-64.h
+
+%ifarch %{power64} s390x x86_64 ia64 alpha sparc64 aarch64 %{mips64} riscv64
+%global _pyconfig_h %{_pyconfig64_h}
+%else
+%global _pyconfig_h %{_pyconfig32_h}
+%endif
+
+%global PyIncludeDirs python%{pybasever}
+
+for PyIncludeDir in %{PyIncludeDirs} ; do
+ mv %{buildroot}%{_includedir}/$PyIncludeDir/pyconfig.h \
+ %{buildroot}%{_includedir}/$PyIncludeDir/%{_pyconfig_h}
+ cat > %{buildroot}%{_includedir}/$PyIncludeDir/pyconfig.h << EOF
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "%{_pyconfig32_h}"
+#elif __WORDSIZE == 64
+#include "%{_pyconfig64_h}"
+#else
+#error "Unknown word size"
+#endif
+EOF
+done
+ln -s ../../libpython%{pybasever}.so
%{buildroot}%{pylibdir}/config/libpython%{pybasever}.so
+
+# Fix for bug 201434: make sure distutils looks at the right pyconfig.h file
+# Similar for sysconfig: sysconfig.get_config_h_filename tries to locate
+# pyconfig.h so it can be parsed, and needs to do this at runtime in site.py
+# when python starts up.
+#
+# Split this out so it goes directly to the pyconfig-32.h/pyconfig-64.h
+# variants:
+sed -i -e "s/'pyconfig.h'/'%{_pyconfig_h}'/" \
+ %{buildroot}%{pylibdir}/distutils/sysconfig.py \
+ %{buildroot}%{pylibdir}/sysconfig.py
+
+# Ensure that the curses module was linked against libncursesw.so, rather than
+# libncurses.so (bug 539917)
+ldd %{buildroot}/%{dynload_dir}/_curses*.so \
+ | grep curses \
+ | grep libncurses.so && (echo "_curses.so linked against
libncurses.so" ; exit 1)
+
+# Ensure that the debug modules are linked against the debug libpython, and
+# likewise for the optimized modules and libpython:
+for Module in %{buildroot}/%{dynload_dir}/*.so ; do
+ case $Module in
+ *_d.so)
+ ldd $Module | grep %{py_INSTSONAME_optimized} &&
+ (echo Debug module $Module linked against optimized
%{py_INSTSONAME_optimized} ; exit 1)
+
+ ;;
+ *)
+ ldd $Module | grep %{py_INSTSONAME_debug} &&
+ (echo Optimized module $Module linked against debug
%{py_INSTSONAME_optimized} ; exit 1)
+ ;;
+ esac
+done
+
+#
+# Systemtap hooks:
+#
+%if 0%{?with_systemtap}
+# Install a tapset for this libpython into tapsetdir, fixing up the path to the
+# library:
+mkdir -p %{buildroot}%{tapsetdir}
+%ifarch %{power64} s390x x86_64 ia64 alpha sparc64 aarch64 %{mips64}
+%global libpython_stp_optimized libpython%{pybasever}-64.stp
+%global libpython_stp_debug libpython%{pybasever}-debug-64.stp
+%else
+%global libpython_stp_optimized libpython%{pybasever}-32.stp
+%global libpython_stp_debug libpython%{pybasever}-debug-32.stp
+%endif
+
+sed \
+ -e "s|LIBRARY_PATH|%{_libdir}/%{py_INSTSONAME_optimized}|" \
+ %{SOURCE3} \
+ > %{buildroot}%{tapsetdir}/%{libpython_stp_optimized}
+
+%endif # with_systemtap
+
+# Do bytecompilation with the newly installed interpreter.
+# compile *.pyo
+find %{buildroot} -type f -a -name "*.py" -print0 | \
+ LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \
+ PYTHONPATH="%{buildroot}%{_libdir}/python%{pybasever}
%{buildroot}%{_libdir}/python%{pybasever}/site-packages" \
+ xargs -0 %{buildroot}%{_bindir}/python%{pybasever} -O -c 'import py_compile, sys;
[py_compile.compile(f, dfile=f.partition("%{buildroot}")[2]) for f in
sys.argv[1:]]' || :
+# compile *.pyc
+find %{buildroot} -type f -a -name "*.py" -print0 | \
+ LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \
+ PYTHONPATH="%{buildroot}%{_libdir}/python%{pybasever}
%{buildroot}%{_libdir}/python%{pybasever}/site-packages" \
+ xargs -0 %{buildroot}%{_bindir}/python%{pybasever} -c 'import py_compile, sys;
[py_compile.compile(f, dfile=f.partition("%{buildroot}")[2]) for f in
sys.argv[1:]]' || :
+
+
+# Make library-files user writable
+/usr/bin/chmod 755 %{buildroot}%{dynload_dir}/*.so
+/usr/bin/chmod 755 %{buildroot}%{_libdir}/libpython%{pybasever}.so.1.0
+
+# Remove pyc/pyo files from /usr/bin
+# They are not needed, and due to them, the resulting RPM is not multilib-clean
+#
https://bugzilla.redhat.com/show_bug.cgi?id=1703575
+rm %{buildroot}%{_bindir}/*.py{c,o}
+
+# Remove all remaining unversioned commands
+#
https://fedoraproject.org/wiki/Changes/Python_means_Python3
+rm %{buildroot}%{_bindir}/python
+rm %{buildroot}%{_bindir}/python-config
+rm %{buildroot}%{_mandir}/*/python.1*
+rm %{buildroot}%{_libdir}/pkgconfig/python.pc
+
+
+# ======================================================
+# Running the upstream test suite
+# ======================================================
+
+%check
+topdir=$(pwd)
+CheckPython() {
+ ConfName=$1
+ BinaryName=$2
+ ConfDir=$(pwd)/build/$ConfName
+
+ export OPENSSL_CONF=/non-existing-file
+
+ echo STARTING: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName
+
+ # Note that we're running the tests using the version of the code in the
+ # builddir, not in the buildroot.
+
+ pushd $ConfDir
+
+ EXTRATESTOPTS="--verbose"
+
+%ifarch s390 s390x %{power64} %{arm} aarch64 %{mips}
+ EXTRATESTOPTS="$EXTRATESTOPTS -x test_gdb"
+%endif
+%ifarch %{mips64}
+ EXTRATESTOPTS="$EXTRATESTOPTS -x test_ctypes"
+%endif
+
+%if 0%{?with_huntrleaks}
+ # Try to detect reference leaks on debug builds. By default this means
+ # running every test 10 times (6 to stabilize, then 4 to watch):
+ if [ "$ConfName" = "debug" ] ; then
+ EXTRATESTOPTS="$EXTRATESTOPTS --huntrleaks : "
+ fi
+%endif
+
+ # Run the upstream test suite, setting "WITHIN_PYTHON_RPM_BUILD" so that the
+ # our non-standard decorators take effect on the relevant tests:
+ # @unittest._skipInRpmBuild(reason)
+ # @unittest._expectedFailureInRpmBuild
+ WITHIN_PYTHON_RPM_BUILD= EXTRATESTOPTS="$EXTRATESTOPTS" make test
+
+ popd
+
+ echo FINISHED: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName
+
+}
+
+%if %{with tests}
+
+# no locale coercion in python2
+# test_ssl:test_load_dh_params shutil.copies into unicode filename
+export LC_ALL=C.utf-8
+
+# Check each of the configurations:
+CheckPython \
+ optimized \
+ python%{pybasever}
+
+%endif # with tests
+
+
+# ======================================================
+# Cleaning up
+# ======================================================
+
+
+%files
+%doc README
+%license %{pylibdir}/LICENSE.txt
+%{_bindir}/pydoc2*
+%{_bindir}/python2
+%{_bindir}/python%{pybasever}
+%{_mandir}/*/python2*
+
+%dir %{pylibdir}
+%dir %{dynload_dir}
+
+%{dynload_dir}/_md5module.so
+%{dynload_dir}/_sha256module.so
+%{dynload_dir}/_sha512module.so
+%{dynload_dir}/_shamodule.so
+
+%{dynload_dir}/Python-%{upstream_version}-py%{pybasever}.egg-info
+%{dynload_dir}/_bisectmodule.so
+%{dynload_dir}/_bsddb.so
+%{dynload_dir}/_codecs_cn.so
+%{dynload_dir}/_codecs_hk.so
+%{dynload_dir}/_codecs_iso2022.so
+%{dynload_dir}/_codecs_jp.so
+%{dynload_dir}/_codecs_kr.so
+%{dynload_dir}/_codecs_tw.so
+%{dynload_dir}/_collectionsmodule.so
+%{dynload_dir}/_csv.so
+%{dynload_dir}/_ctypes.so
+%{dynload_dir}/_curses.so
+%{dynload_dir}/_curses_panel.so
+%{dynload_dir}/_elementtree.so
+%{dynload_dir}/_functoolsmodule.so
+%{dynload_dir}/_hashlib.so
+%{dynload_dir}/_heapq.so
+%{dynload_dir}/_hotshot.so
+%{dynload_dir}/_io.so
+%{dynload_dir}/_json.so
+%{dynload_dir}/_localemodule.so
+%{dynload_dir}/_lsprof.so
+%{dynload_dir}/_multibytecodecmodule.so
+%{dynload_dir}/_multiprocessing.so
+%{dynload_dir}/_randommodule.so
+%{dynload_dir}/_socketmodule.so
+%{dynload_dir}/_sqlite3.so
+%{dynload_dir}/_ssl.so
+%{dynload_dir}/_struct.so
+%{dynload_dir}/arraymodule.so
+%{dynload_dir}/audioop.so
+%{dynload_dir}/binascii.so
+%{dynload_dir}/bz2.so
+%{dynload_dir}/cPickle.so
+%{dynload_dir}/cStringIO.so
+%{dynload_dir}/cmathmodule.so
+%{dynload_dir}/_cryptmodule.so
+%{dynload_dir}/datetime.so
+%{dynload_dir}/dbm.so
+%{dynload_dir}/dlmodule.so
+%{dynload_dir}/fcntlmodule.so
+%{dynload_dir}/future_builtins.so
+%if %{with_gdbm}
+%{dynload_dir}/gdbmmodule.so
+%endif
+%{dynload_dir}/grpmodule.so
+%{dynload_dir}/imageop.so
+%{dynload_dir}/itertoolsmodule.so
+%{dynload_dir}/linuxaudiodev.so
+%{dynload_dir}/math.so
+%{dynload_dir}/mmapmodule.so
+%{dynload_dir}/nismodule.so
+%{dynload_dir}/operator.so
+%{dynload_dir}/ossaudiodev.so
+%{dynload_dir}/parsermodule.so
+%{dynload_dir}/pyexpat.so
+%{dynload_dir}/readline.so
+%{dynload_dir}/resource.so
+%{dynload_dir}/selectmodule.so
+%{dynload_dir}/spwdmodule.so
+%{dynload_dir}/stropmodule.so
+%{dynload_dir}/syslog.so
+%{dynload_dir}/termios.so
+%{dynload_dir}/timemodule.so
+%{dynload_dir}/timingmodule.so
+%{dynload_dir}/unicodedata.so
+%{dynload_dir}/xxsubtype.so
+%{dynload_dir}/zlibmodule.so
+
+%dir %{site_packages}
+%{site_packages}/README
+%{pylibdir}/*.py*
+%{pylibdir}/*.doc
+%{pylibdir}/wsgiref.egg-info
+%dir %{pylibdir}/bsddb
+%{pylibdir}/bsddb/*.py*
+%{pylibdir}/compiler
+%dir %{pylibdir}/ctypes
+%{pylibdir}/ctypes/*.py*
+%{pylibdir}/ctypes/macholib
+%{pylibdir}/curses
+%dir %{pylibdir}/distutils
+%{pylibdir}/distutils/*.py*
+%{pylibdir}/distutils/README
+%{pylibdir}/distutils/command
+%exclude %{pylibdir}/distutils/command/wininst-*.exe
+%dir %{pylibdir}/email
+%{pylibdir}/email/*.py*
+%{pylibdir}/email/mime
+%{pylibdir}/encodings
+%{pylibdir}/hotshot
+%{pylibdir}/idlelib
+%{pylibdir}/importlib
+%dir %{pylibdir}/json
+%{pylibdir}/json/*.py*
+%{pylibdir}/lib2to3
+%exclude %{pylibdir}/lib2to3/tests
+%{pylibdir}/logging
+%{pylibdir}/multiprocessing
+%{pylibdir}/plat-linux2
+%{pylibdir}/pydoc_data
+%dir %{pylibdir}/sqlite3
+%{pylibdir}/sqlite3/*.py*
+
+%{pylibdir}/unittest
+%{pylibdir}/wsgiref
+%{pylibdir}/xml
+%if "%{_lib}" == "lib64"
+%attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}
+%attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}/site-packages
+%endif
+
+# "Makefile" and the config-32/64.h file are needed by
+# distutils/sysconfig.py:_init_posix(), so we include them in the libs
+# package, along with their parent directories (bug 531901):
+%dir %{pylibdir}/config
+%{pylibdir}/config/Makefile
+%dir %{_includedir}/python%{pybasever}
+%{_includedir}/python%{pybasever}/%{_pyconfig_h}
+
+%{_libdir}/%{py_INSTSONAME_optimized}
+%if 0%{?with_systemtap}
+%dir %(dirname %{tapsetdir})
+%dir %{tapsetdir}
+%{tapsetdir}/%{libpython_stp_optimized}
+%doc systemtap-example.stp pyfuntop.stp
+%endif
+
+%dir %{pylibdir}/ensurepip/
+%{pylibdir}/ensurepip/*.py*
+%if %{with rpmwheels}
+%exclude %{pylibdir}/ensurepip/_bundled
+%else
+%dir %{pylibdir}/ensurepip/_bundled
+%{pylibdir}/ensurepip/_bundled/*.whl
+%endif
+
+
+#files devel
+%{_libdir}/pkgconfig/python-%{pybasever}.pc
+%{_libdir}/pkgconfig/python2.pc
+%{pylibdir}/config/*
+%exclude %{pylibdir}/config/Makefile
+%{pylibdir}/distutils/command/wininst-*.exe
+%{_includedir}/python%{pybasever}/*.h
+%exclude %{_includedir}/python%{pybasever}/%{_pyconfig_h}
+%doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit
+%{_bindir}/python2-config
+%{_bindir}/python%{pybasever}-config
+%{_libdir}/libpython%{pybasever}.so
+
+#files tools
+%doc Tools/pynche/README.pynche
+%{site_packages}/pynche
+%{_bindir}/smtpd2*.py
+
+#
https://bugzilla.redhat.com/show_bug.cgi?id=1111275
+%exclude %{_bindir}/2to3*
+
+%{_bindir}/idle2*
+%{_bindir}/pygettext2*.py
+%{_bindir}/msgfmt2*.py
+%{tools_dir}
+%{demo_dir}
+%{pylibdir}/Doc
+
+#files tkinter
+%{pylibdir}/lib-tk
+%{dynload_dir}/_tkinter.so
+
+#files test
+%{pylibdir}/bsddb/test
+%{pylibdir}/ctypes/test
+%{pylibdir}/distutils/tests
+%{pylibdir}/email/test
+%{pylibdir}/json/tests
+%{pylibdir}/lib2to3/tests
+%{pylibdir}/sqlite3/test
+%{pylibdir}/test/
+
+%{dynload_dir}/_ctypes_test.so
+%{dynload_dir}/_testcapimodule.so
+
+# Workaround for rhbz#1476593
+%undefine _debuginfo_subpackages
+
+# ======================================================
+# Finally, the changelog:
+# ======================================================
+
+%changelog
+* Wed Aug 21 2019 Miro Hronok <mhroncok(a)redhat.com> - 2.7.16-8
+- Make the python27 package flat
+
+* Tue Aug 20 2019 Miro Hronok <mhroncok(a)redhat.com> - 2.7.16-7
+- Conditionalize python2-devel runtime dependencies
+
+* Wed Aug 14 2019 Miro Hronok <mhroncok(a)redhat.com> - 2.7.16-6
+- Rebuilt for Python 3.8
+
+* Wed Aug 14 2019 Miro Hronok <mhroncok(a)redhat.com> - 2.7.16-5
+- Bootstrap for Python 3.8
+
+* Fri Jul 26 2019 Fedora Release Engineering <releng(a)fedoraproject.org> - 2.7.16-4
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
+
+* Fri Jul 12 2019 Miro Hronok <mhroncok(a)redhat.com> - 2.7.16-3
+-
https://fedoraproject.org/wiki/Changes/Python_means_Python3
+- The python-unversioned-command package is no longer Python 2, but 3
+- The python, pydoc, python-config, python-debug, idle, pygettext.py and
+ msgfmt.py commands are now in python3
+
+* Fri Apr 26 2019 Tomas Orsava <torsava(a)redhat.com> - 2.7.16-2
+- Remove pyc/pyo files from /usr/bin (#1703575)
+- Update the macro that disables automatic bytecompilation to the new correct
+ form (#1597664)
+
+* Mon Mar 04 2019 Miro Hronok <mhroncok(a)redhat.com> - 2.7.16-1
+- Update to 2.7.16 final
+
+* Tue Feb 19 2019 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.16~rc1-1
+- Update to 2.7.16rc1
+
+* Sun Feb 17 2019 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 2.7.15-14
+- Rebuild for readline 8.0
+
+* Sat Feb 02 2019 Fedora Release Engineering <releng(a)fedoraproject.org> -
2.7.15-13
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
+
+* Mon Jan 14 2019 Bjrn Esser <besser82(a)fedoraproject.org> - 2.7.15-12
+- Rebuilt for libcrypt.so.2 (#1666033)
+
+* Mon Sep 24 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.15-11
+- Security fix for CVE-2018-14647 (#1631822)
+
+* Thu Sep 20 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.15-10
+- Security fix for CVE-2018-1000802 (#1631662)
+
+* Thu Sep 06 2018 Petr Viktorin <pviktori(a)redhat.com> - 2.7.15-9
+- Deprecate python2 and all subpackages in Fedora 30+ (#1625773)
+
+* Thu Aug 30 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.15-8
+- Require python2-setuptools from python2-devel to prevent packaging errors (#1623922)
+
+* Tue Aug 21 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.15-7
+- Use RPM built wheels of pip and setuptools in ensurepip instead of our rewheel patch
+
+* Sat Jul 14 2018 Fedora Release Engineering <releng(a)fedoraproject.org> - 2.7.15-6
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
+
+* Thu Jun 14 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.15-5
+- Move /usr/bin/python into a separate package
+
https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_...
+- Revert
https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build
+
+* Wed Jun 13 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.15-4
+- Rebuilt for Python 3.7
+
+* Wed Jun 13 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.15-3
+- Bootstrap for Python 3.7
+
+* Tue May 15 2018 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.15-2
+- Fix loading of the gdb python plugin (rhbz#1578001)
+
+* Tue May 01 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.15-1
+- Update to version 2.7.15
+
+* Wed Apr 25 2018 Tomas Orsava <torsava(a)redhat.com> - 2.7.14-17
+- Change shebangs to the proper versioned binary
+- Bytecompile files manually, disbale brp-python-bytecompile
+Resolves: rhbz#1572171
+
+* Fri Apr 13 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.14-16
+- Remove Obsoletes tag from when python was renamed to python2 (Fedora 25 was last)
+
+* Wed Mar 14 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.14-15
+- Fix broken SSL module
+Resolves: rhbz#1555081
+
+* Tue Mar 13 2018 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.14-14
+- Do not send IP addresses in SNI TLS extension
+
+* Mon Feb 26 2018 Petr Viktorin <pviktori(a)redhat.com> - 2.7.14-13
+- Fix -Wint-in-bool-context warnings
+Resolves: rhbz#1473425
+
+* Sat Feb 24 2018 Florian Weimer <fweimer(a)redhat.com> - 2.7.14-12
+- Rebuild with new LDFLAGS from redhat-rpm-config
+
+* Thu Feb 15 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.14-11
+- Move test.support and test.script_helper to python2-libs
+Resolves: rhbz#1528899
+
+* Fri Feb 09 2018 Fedora Release Engineering <releng(a)fedoraproject.org> -
2.7.14-10
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
+
+* Tue Jan 30 2018 Petr Viktorin <pviktori(a)redhat.com> - 2.7.14-9
+- Add patch 288: warn/fail if Python 2 is called as /usr/bin/python and
+ PYTHON_DISALLOW_AMBIGUOUS_VERSION is set
+- Add patch 289: Fix for over-aligned GC info
+
+* Sat Jan 20 2018 Bjrn Esser <besser82(a)fedoraproject.org> - 2.7.14-8
+- Rebuilt for switch to libxcrypt
+
+* Wed Jan 17 2018 Petr Viktorin <pviktori(a)redhat.com> - 2.7.14-7
+- Build the nis module with tirpc
+
+* Tue Jan 16 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.14-6
+- Rebuild for reverted gdbm 1.13 on Fedora 27
+
+* Thu Jan 11 2018 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.14-5
+- Rebuild for gdbm 1.14
+
+* Mon Dec 11 2017 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.14-4
+- Fix hanging of all threads when trying to access an inaccessible NFS server.
+
+* Thu Nov 09 2017 Miro Hronok <mhroncok(a)redhat.com> - 2.7.14-3
+- Make the -devel package require redhat-rpm-config
+Resolves: rhbz#1496757
+
+* Thu Nov 02 2017 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.14-2
+- Add a new PYTHONSHOWREFCOUNT environment variable for printing the reference
+ count in debug builds.
+- Fix nondeterministic read in test_pty.
+
+* Mon Oct 09 2017 Iryna Shcherbina <ishcherb(a)redhat.com> - 2.7.14-1
+- Update to version 2.7.14
+
+* Thu Aug 31 2017 Tomas Orsava <torsava(a)redhat.com> - 2.7.13-18
+- Switch some macros into bconds to facilitate modularity
+
+* Wed Aug 16 2017 Miro Hronok <mhroncok(a)redhat.com> - 2.7.13-17
+- Exclude /usr/bin/2to3 (rhbz#1111275)
+
+* Mon Aug 14 2017 David "Sanqui" Labsk <dlabsky(a)redhat.com> - 2.7.13-16
+- Do not generate debuginfo subpackages (#1476593)
+
+* Wed Aug 09 2017 Michal Cyprian <mcyprian(a)redhat.com> - 2.7.13-15
+- Revert "Add --executable option to install.py command"
+ This enhancement is currently not needed and it can possibly
+ collide with `pip --editable`option
+
+* Thu Aug 03 2017 Fedora Release Engineering <releng(a)fedoraproject.org> -
2.7.13-14
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
+
+* Thu Jul 27 2017 Fedora Release Engineering <releng(a)fedoraproject.org> -
2.7.13-13
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
+
+* Mon Jun 26 2017 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.13-11
+- Fix test_alpn_protocols from test_ssl
+
+* Wed May 31 2017 Miro Hronok <mhroncok(a)redhat.com> - 2.7.13-11
+- Change fixed Obsoletes version with a dynamic one (rhbz#1457336)
+
+* Thu May 18 2017 Karsten Hopp <karsten(a)redhat.com> - 2.7.13-10
+- revert logic for modularity patch and enable gdbm for modularity
+
+* Tue May 16 2017 Tomas Orsava <torsava(a)redhat.com> - 2.7.13-9
+- Added a dependency to the devel subpackage on python3-rpm-generators which
+ have been excised out of rpm-build
+- There is no Python 2 package containing Python RPM generators, therefore
+ Python 3 is needed when Python 2 package is to be built, but this was
+ decided not to be a problem due to nearing EOL of Python 2
+- Involves: rhbz#1410631, rhbz#1444925
+
+* Wed May 10 2017 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.13-8
+- Enable profile guided optimizations for x86_64 and i686 architectures
+- Update description to reflect that Python 2 is not the default Python
+
+* Tue Apr 25 2017 Karsten Hopp <karsten(a)redhat.com> - 2.7.13-7
+- apply modularity patch only during module builds
+
+* Sun Apr 23 2017 Karsten Hopp <karsten(a)redhat.com> - 2.7.13-6
+- add missing patch
+
+* Fri Apr 21 2017 Karsten Hopp <karsten(a)redhat.com> - 2.7.13-5
+- drop a couple of dependencies for Modularity builds
+
+* Tue Feb 21 2017 Michal Cyprian <mcyprian(a)redhat.com> - 2.7.13-5
+- Add --executable option to install.py command
+
+* Fri Feb 17 2017 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.13-4
+- Fix the upgrade path to F26 due to renaming the package to python2 (rhbz#1420332)
+
+* Sat Feb 11 2017 Fedora Release Engineering <releng(a)fedoraproject.org> - 2.7.13-3
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
+
+* Thu Jan 12 2017 Igor Gnatenko <ignatenko(a)redhat.com> - 2.7.13-2
+- Rebuild for readline 7.x
+
+* Wed Jan 11 2017 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.13-1
+- Update to 2.7.13
+- Don't blow up on EL7 kernel (random generator) (rhbz#1410175, rhbz#1410187)
+- Require glibc >= 2.24.90-26 (rhbz#1410644)
+
+* Thu Oct 27 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-9
+- Rename package to python2 and also rename the subpackages accordingly
+- Provide and obsolete python and the respective subpackages to ensure a clean
+upgrade path
+- Remove old provides for packages that got into stdlib
+- Implement PEP 394
+
+* Wed Oct 12 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-8
+- Port ssl and hashlib modules to OpenSSL 1.1.0
+- Drop hashlib patch for now
+- Add riscv64 arch to 64bit and no-valgrind arches
+
+* Thu Sep 29 2016 Miro Hronok <mhroncok(a)redhat.com> - 2.7.12-7
+- Provide python27
+
+* Fri Sep 02 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-6
+- Remove unversioned Obsoletes
+
+* Thu Sep 01 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-5
+- Rebase rewheel patch so it applies properly (rhbz#1372183)
+
+* Tue Aug 09 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-4
+- SPEC file cleanup
+- Removal of unapplied patches
+
+* Tue Aug 09 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-3
+- Fix for CVE-2016-1000110 HTTPoxy attack
+- SPEC file cleanup
+
+* Mon Aug 01 2016 Michal Toman <mtoman(a)fedoraproject.org> - 2.7.12-2
+- Build properly on MIPS
+
+* Fri Jul 15 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-1
+- Update to 2.7.12
+- Refactored patches: 10, 102, 112, 134, 153
+- Dropped patches: 166, 209, 210
+
+* Fri Jul 08 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.11-8
+- Refactor patch for properly fixing CVE-2016-5636
+
+* Fri Jul 08 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.11-7
+- Fix test_pyexpat failure with Expat version of 2.2.0
+
+* Thu Jun 16 2016 Tomas Orsava <torsava(a)redhat.com> - 2.7.11-6
+- Fix for: CVE-2016-0772 python: smtplib StartTLS stripping attack
+- Raise an error when STARTTLS fails
+- rhbz#1303647:
https://bugzilla.redhat.com/show_bug.cgi?id=1303647
+- rhbz#1346344:
https://bugzilla.redhat.com/show_bug.cgi?id=1346344
+- Fixed upstream:
https://hg.python.org/cpython/rev/b3ce713fb9be
+
+* Mon Jun 13 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.11-5
+- Added patch for fixing possible integer overflow and heap corruption in
zipimporter.get_data()
+
+* Thu Feb 04 2016 Fedora Release Engineering <releng(a)fedoraproject.org> - 2.7.11-4
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
+
+* Wed Jan 13 2016 Orion Poplawski <orion(a)cora.nwra.com> - 2.7.11-3
+- Drop macros, require python/python2-rpm-macros
+
+* Wed Dec 30 2015 Orion Poplawski <orion(a)cora.nwra.com> - 2.7.11-2
+- Get ready for separate python-macros package
+
+* Tue Dec 15 2015 Robert Kuska <rkuska(a)redhat.com> - 2.7.11-1
+- Update to 2.7.11
+
+* Thu Oct 15 2015 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.10-11
+- provide/obsolete _isa packages in python_provide (#1271776)
+
+* Wed Sep 23 2015 Robert Kuska <rkuska(a)redhat.com> - 2.7.10-10
+- Revert the moving modules to python-tools because distutils uses lib2to3
+
+* Tue Sep 22 2015 Robert Kuska <rkuska(a)redhat.com> - 2.7.10-9
+- Move idlelib and lib2to3 modules to pythont-tools
+
+* Thu Sep 3 2015 Orion Poplawski <orion(a)cora.nwra.com> - 2.7.10-8
+- Fix quoting in %%python_provide macro
+
+* Thu Sep 3 2015 Orion Poplawski <orion(a)cora.nwra.com> - 2.7.10-7
+- Add obsoletes to %%python_provide macro to fix upgrade path
+- Fix python2- provides for python- packages in %%python_provide
+
+* Thu Jul 23 2015 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.10-6
+- python-macros: remove R on python (#1246036)
+
+* Wed Jul 22 2015 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.10-5
+- Include epoch in the python_provide macro fpc#534 (Slavek Kabrda)
+
+* Mon Jun 29 2015 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.10-4
+- correct python_provide macro to include version only when emiting provides
+
+* Thu Jun 25 2015 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.10-3
+- Add unversioned python-macros from fpc#281 and fpc#534
+ and require it from python-devel
+- Make python-macros noarch
+
+* Wed Jun 17 2015 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.10-2
+- Make relocating Python by changing _prefix actually work
+Resolves: rhbz#1231801
+
+* Mon May 25 2015 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.10-1
+- Update to 2.7.10
+
+* Tue May 5 2015 Peter Robinson <pbrobinson(a)fedoraproject.org> 2.7.9-11
+- Disable test_gdb on aarch64 (rhbz#1196181), it joins all other non x86 arches
+
+* Wed Apr 15 2015 Robert Kuska <rkuska(a)redhat.com> - 2.7.9-10
+- Remove provides/obsolates for unittest2
+- Skip test_gdb on arm until rhbz#1196181 is resolved
+
+* Thu Mar 05 2015 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.9-9
+- Add proper rewheel Requires
+
+* Sat Feb 21 2015 Till Maas <opensource(a)till.name> - 2.7.9-8
+- Rebuilt for Fedora 23 Change
+
https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-...
+
+* Sat Feb 21 2015 Till Maas <opensource(a)till.name> - 2.7.9-7
+- Rebuilt for Fedora 23 Change
+
https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-...
+
+* Tue Feb 17 2015 Ville Skytt <ville.skytta(a)iki.fi> - 2.7.9-6
+- Own systemtap dirs (#710733)
+
+* Fri Feb 06 2015 Karsten Hopp <karsten(a)redhat.com> 2.7.9-5
+- disable test_gdb on ppc64* until rhbz#1132488 is really resolved
+
+* Tue Jan 20 2015 Slavek Kabrda <bkabrda(a)redhat.com> - 2.7.9-4
+- We need to provide both arch specific and noarch Provide for python2-devel
+in order not to break noarch builds.
+
+* Tue Jan 20 2015 Slavek Kabrda <bkabrda(a)redhat.com> - 2.7.9-3
+- Make python2-devel provide arch specific.
+Resolves: rhbz#1183530
+
+* Mon Jan 12 2015 Dan Hork <dan[at]danny.cz> - 2.7.9-2
+- build with valgrind on ppc64le
+- disable test_gdb on s390(x) until rhbz#1181034 is resolved
+
+* Thu Dec 11 2014 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.9-1
+- Update to 2.7.9
+- Refreshed patches: #55, #137, #146, #153, #156, #198
+- Dropped patches: #196, #197
+- New patch: #199
+- Added the rewheel module
+
+* Mon Nov 24 2014 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.8-10
+- Improve python2_version macros
+
+* Thu Nov 13 2014 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.8-9
+- Add python2_version_nodots macro
+
+* Mon Nov 10 2014 Slavek Kabrda <bkabrda(a)redhat.com> - 2.7.8-8
+- Revert previous change, see rhbz#1161166#c6.
+
+* Fri Nov 07 2014 Slavek Kabrda <bkabrda(a)redhat.com> - 2.7.8-7
+- Provide importable unittest2
+Resolves: rhbz#1161166
+
+* Thu Aug 21 2014 Robert Kuska <rkuska(a)redhat.com> - 2.7.8-6
+- Update patch 196 (ssl backport)
+
+* Tue Aug 19 2014 Robert Kuska <rkuska(a)redhat.com> - 2.7.8-5
+- Backport ssl module from python3
+
+* Sun Aug 17 2014 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.7.8-4
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
+
+* Thu Jul 31 2014 Tom Callaway <spot(a)fedoraproject.org> - 2.7.8-3
+- fix license handling
+
+* Fri Jul 18 2014 Robert Kuska <rkuska(a)redhat.com> - 2.7.8-2
+- Enable SSLv2 and SSLv3 when SSLv23_method is used in ssl
+
+* Mon Jul 14 2014 Robert Kuska <rkuska(a)redhat.com> - 2.7.8-1
+- Update to 2.7.8
+
+* Fri Jul 11 2014 Dan Hork <dan[at]danny.cz> - 2.7.7-3
+- rebuilt for updated libffi ABI on ppc64le
+
+* Sat Jun 7 2014 Peter Robinson <pbrobinson(a)fedoraproject.org> 2.7.7-2
+- aarch64 has valgrind, just list those that don't support it
+
+* Wed Jun 04 2014 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.7-1
+- Update to 2.7.7
+- Refreshed patches: #16, #112, #138, #147, #157, #166, #173, #5000
+- Dropped patches: #190, #192, #194
+
+* Tue Jun 03 2014 Dan Hork <dan[at]danny.cz> - 2.7.6-9
+- update the arch list where valgrind exists - %%power64 includes also
+ ppc64le which is not supported yet
+
+* Wed May 21 2014 Jaroslav karvada <jskarvad(a)redhat.com> - 2.7.6-8
+- Rebuilt for
https://fedoraproject.org/wiki/Changes/f21tcl86
+
+* Fri May 09 2014 Tomas Radej <tradej(a)redhat.com> - 2.7.6-7
+- Fixed obsoletes on ordereddict (bz #1095434)
+
+* Mon Apr 14 2014 Tomas Radej <tradej(a)redhat.com> - 2.7.6-6
+- Obsoletes python-ordereddict (bz #1085593, not precisely 1:1 replacement)
+
+* Mon Apr 07 2014 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.6-5
+- Fix test failure with SQLite > 3.8.4.
+- Obsolete/Provide python-unittest2
+Related: rhbz#1060426
+
+* Wed Feb 19 2014 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.6-4
+- Enable loading sqlite extensions.
+Resolves: rhbz#1066708
+
+* Mon Feb 10 2014 Tomas Radej <tradej(a)redhat.com> - 2.7.6-3
+- Fixed buffer overflow (upstream patch)
+Resolves: rhbz#1062375
+
+* Tue Feb 04 2014 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.6-2
+- Install macros in _rpmconfigdir.
+
+* Wed Jan 29 2014 Tomas Radej <tradej(a)redhat.com> - 2.7.6-1
+- Updated to v2.7.6
+- Freshened patches 102, 111, 112, 136, and 142
+- Dropped patches 186, 188 (both fixed upstream)
+
+* Wed Jan 15 2014 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.5-11
+- Make library-files user writable to get rid of
+ Permission Denied in buildlog from debuginfo-packaging
+
+* Tue Jan 14 2014 Dennis Gilmore <dennis(a)ausil.us> - 2.7.5-10
+- enable valgrind support on 32 bit arm
+
+* Tue Nov 12 2013 Tomas Radej <tradej(a)redhat.com> - 2.7.5-9
+- Import get_python_version in bdist_rpm
+Resolves: rhbz#1029082
+
+* Tue Oct 08 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-8
+- Fix processing gdb py-bt command in eval calls.
+Resolves: rhbz#1008154
+
+* Tue Sep 03 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-7
+- Removed ancient Obsolete: python-sqlite2.
+
+* Mon Aug 26 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-6
+- Sync back/renumber patches to stay consistent with rhel.
+
+* Mon Aug 19 2013 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.5-5
+- Added fix for CVE-2013-4238 (rhbz#998430)
+
+* Sun Aug 04 2013 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.7.5-4
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
+
+* Mon Jul 08 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-3
+- Fix build with libffi containing multilib wrapper for ffi.h (rhbz#979696).
+
+* Mon Jul 08 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-2
+- Obsolete PyXML as requested in rhbz#981137.
+
+* Thu May 16 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-1
+- Updated to Python 2.7.5.
+- Refreshed patches: 0 (config), 102 (lib64), 121 (add Modules to build path),
+153 (gdb test noise)
+- Dropped patches: 126, 127 (big endian issues, both fixed upstream),
+175 (configure -Wformat, fixed upstream)
+- Synced patch numbers with python3.spec.
+
+* Tue May 14 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.4-5
+- fix multilib issue in python-tools due to /usr/bin/pynche (source 7;
+rhbz#831437)
+
+* Thu May 02 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.4-4
+- Add patch that enables building on ppc64p7.
+
+* Mon Apr 22 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.4-3
+- Allow arbitrary timeout in Condition.wait (rhbz#917709).
+
+* Thu Apr 11 2013 Kalev Lember <kalevlember(a)gmail.com> - 2.7.4-2
+- Build with libdb 5.3 instead of libdb4
+- Refreshed patches: 0 (config), 102 (lib64)
+- Dropped patches: 54 (db4 version), 159 (db4 include path adjustment)
+
+* Mon Apr 08 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.4-1
+- Updated to Python 2.7.4.
+- Refreshed patches: 0 (config), 7 (sqlite encoding), 16 (rpath in config),
+55 (systemtap), 111 (no static lib), 112 (debug build), 113 (more
+configuration flags), 130 (add extension to python config), 134 (fix
+COUNT_ALLOCS in test_sys), 146 (haslib FIPS), 147 (add debug malloc stats),
+153 (fix gdb test noise), 157 (uid, gid overflow - fixed upstream, just
+keeping few more downstream tests), 165 (crypt module salt backport),
+175 (fix configure Wformat), 5000 (regenerated autotooling patch)
+- Dropped patches: 101 (lib64 regex; merged upstream), 171 (exception on
+missing /dev/urandom; merged upstream), 172 (poll for multiprocessing socket
+connection; merged upstream)
+
+* Mon Mar 25 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-35
+- fix gcc 4.8 incompatibility (rhbz#927358); regenerate autotool intermediates
+
+* Wed Mar 6 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-34
+- restrict scope of workaround for cmpi-bindings issue to avoid breaking
+in-tree running of test_sys and test_subprocess (rhbz#817554)
+
+* Wed Mar 6 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-33
+- add workaround for cmpi-bindings issue (rhbz#817554)
+
+* Mon Mar 4 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-32
+- add workaround for ENOPROTOOPT seen running selftests in Koji
+(rhbz#913732)
+
+* Mon Mar 4 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-31
+- remove config flag from /etc/rpm/macros.python2
+
+* Fri Feb 22 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-30
+- remove __debug_package macro from comment
+
+* Fri Feb 22 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-29
+- drop -b from application of patch 157 (uid/gid overflows)
+
+* Fri Feb 22 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-28
+- fix bogus dates in changelog
+
+* Thu Feb 21 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-27
+- port _multiprocessing.Connection.poll() to use the "poll" syscall, rather
+than "select", allowing large numbers of subprocesses (patch 172;
+rhbz#849992)
+
+* Thu Feb 21 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-26
+- raise correct exception in os.urandom() when /dev/urandom is missing
+(patch 171; rhbz#907383)
+
+* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-25
+- in debug builds, try to print repr() when a C-level assert fails in the
+garbage collector (typically indicating a reference-counting error somewhere
+else e.g in an extension module) (patch 170; rhbz#850013)
+
+* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-24
+- move lib2to3/tests from python-libs to python-test (rhbz#850056)
+
+* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-23
+- use SHA-256 rather than implicitly using MD5 within the challenge handling
+in multiprocessing.connection (patch 169; rhbz#879695)
+
+* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-22
+- fix a problem with distutils.sysconfig when CFLAGS is defined in the
+environment (patch 168; rhbz#849994)
+
+* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-21
+- don't run any stack navigation tests in test_gdb for optimized builds
+(patch 167; rhbz#912025)
+
+* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-20
+- s/cryptmodule/_cryptmodule/ in package payload (rhbz#835021)
+
+* Tue Feb 19 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-19
+- bulletproof the gdb debugging hooks against a failure seen in ARM builds
+(patch 166; rhbz#912025)
+- re-enable make check on ARM (rhbz#912025)
+
+* Tue Feb 19 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-18
+- backport pre-canned ways of salting a password to the "crypt" module from
3.3
+(rhbz#835021)
+
+* Tue Feb 19 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-17
+- remove "_default_patch_fuzz" directive to avoid patches being silently
+misapplied (refresh patch 1, patch 101, patch 102, patch 111, patch 121,
+patch 158; rename patch 1, patch 101, patch 121; apply patch 54 before the
+lib64 patches to avoid fuzz problems caused by the conditional application
+of the lib64 patches)
+
+* Mon Feb 18 2013 Peter Robinson <pbrobinson(a)fedoraproject.org> 2.7.3-16
+- disable make check on ARM for the moment until 912025 is fixed
+
+* Mon Feb 11 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-15
+- add aarch64 (rhbz#909783)
+
+* Thu Nov 29 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-14
+- add BR on bluez-libs-devel (rhbz#879720)
+
+* Thu Aug 9 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-13
+- remove f18 conditional from patch 159
+
+* Fri Jul 27 2012 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.7.3-12
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
+
+* Tue Jul 17 2012 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.3-11
+- fix memory leak in module _hashlib (patch 158, rhbz#836285)
+- fix db4 include path for libdb4 package (f18 and above) (patch 159)
+
+* Tue Jun 26 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-10
+- fix missing include in uid/gid handling patch (patch 157; rhbz#830405)
+
+* Fri Jun 22 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-9
+- use rpm macro for power64 (rhbz#834653)
+
+* Tue May 15 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-8
+- update uid/gid handling to avoid int overflows seen with uid/gid
+values >= 2^31 on 32-bit architectures (patch 157; rhbz#697470)
+
+* Fri May 4 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-7
+- renumber autotools patch from 300 to 5000
+- specfile cleanups
+
+* Mon Apr 30 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-6
+- try again to fix test_gdb.py (patch 156; rhbz#817072)
+
+* Mon Apr 30 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-5
+- fix test_gdb.py (patch 156; rhbz#817072)
+
+* Fri Apr 20 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-4
+- avoid allocating thunks in ctypes unless absolutely necessary, to avoid
+generating SELinux denials on "import ctypes" and "import uuid" when
embedding
+Python within httpd (patch 155; rhbz#814391)
+
+* Thu Apr 19 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-3
+- add explicit version requirements on expat to avoid linkage problems with
+XML_SetHashSalt
+
+* Wed Apr 18 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-2
+- fix -config symlinks (patch 112; rhbz#813836)
+
+* Wed Apr 11 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-1
+- 2.7.3: refresh patch 102 (lib64); drop upstream patches 11 (ascii-to-lower),
+115 (pydoc robustness), 145 (linux2), 148 (gdbm magic values), 151 (deadlock
+in fork); refresh patch 112 (debug build); revise patch 127
+(test_structmember); fix test_gdb (patch 153); refresh patch 137 (distutils
+tests); add python2.pc to python-devel; regenerate the autotool intermediates
+patch (patch 300)
+
+* Sat Feb 25 2012 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.2-20
+- fix deadlock issue (#787712)
+
+* Fri Feb 17 2012 Toshio Kuratomi <toshio(a)fedoraproject.org> - 2.7.2-19
+- Obsolete python-sqlite2
+
+* Thu Nov 24 2011 Ville Skytt <ville.skytta(a)iki.fi> - 2.7.2-18
+- Build with $RPM_LD_FLAGS (#756862).
+- Use xz-compressed source tarball.
+
+* Wed Oct 26 2011 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.7.2-17
+- Rebuilt for glibc bug#747377
+
+* Fri Sep 30 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-16
+- re-enable gdbm (patch 148; rhbz#742242)
+
+* Fri Sep 16 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-15
+- add a sys._debugmallocstats() function (patch 147)
+
+* Wed Sep 14 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-14
+- support OpenSSL FIPS mode in _hashlib and hashlib; don't build the _md5 and
+_sha* modules, relying on _hashlib in hashlib, and thus within md5 etc
+(rhbz#563986; patch 146)
+
+* Wed Sep 14 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-13
+- force sys.platform to be "linux2" (patch 145)
+
+* Tue Sep 13 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-12
+- disable gdbm module to prepare for gdbm soname bump
+
+* Mon Sep 12 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-11
+- rename and renumber patches for consistency with python3.spec (55, 111, 113,
+114, 125, 131, 129 to 143)
+
+* Sat Sep 10 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-10
+- rewrite of "check", introducing downstream-only hooks for skipping specific
+cases in an rpmbuild (patch 132), and fixing/skipping failing tests in a more
+fine-grained manner than before (patches 104, 133-142)
+
+* Thu Sep 1 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-9
+- run selftests with "--verbose"
+- disable parts of test_io on ppc (rhbz#732998)
+
+* Tue Aug 23 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-8
+- add --extension-suffix option to python-config (patch 130; rhbz#732808)
+
+* Tue Aug 23 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-7
+- re-enable and fix the --with-tsc option on ppc64, and rework it on 32-bit
+ppc to avoid aliasing violations (patch 129; rhbz#698726)
+
+* Tue Aug 23 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-6
+- don't use --with-tsc on ppc64 debug builds (rhbz#698726)
+
+* Thu Aug 18 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-5
+- add rpm macros file (rhbz#731800)
+
+* Fri Jul 8 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-4
+- cleanup of BuildRequires; add comment headings to specfile sections
+
+* Wed Jun 22 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-3
+- reorganize test exclusions (test_openpty and test_pty seem to be failing on
+every arch, not just the explicitly-listed ones)
+
+* Mon Jun 13 2011 Dan Hork <dan[at]danny.cz> - 2.7.2-2
+- add s390(x) excluded tests
+
+* Mon Jun 13 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-1
+- 2.7.2; drop upstreamed patches: patch 122 (parallel make fix), patch 124
+(test_commands and SELinux), patch 130 (ppc preprocessor macro in debug
+build); patch 131 (decimal in Turkish locale); regenerate the autotool
+intermediates patch (patch 300)
+
+* Tue Jun 07 2011 Dennis Gilmore <dennis(a)ausil.us> - 2.7.1-9
+- fix sparc building by excluding failing tests RHBZ#711584
+
+* Mon May 23 2011 Peter Robinson <pbrobinson(a)gmail.com> - 2.7.1-8
+- fix compile on ARM by excluding failing tests on arm - RHBZ #706253
+
+* Tue Apr 12 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.1-7
+- fix "import decimal" in the Turkish locale (patch 131; rhbz#694928)
+
+* Wed Feb 09 2011 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.7.1-6
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
+
+* Fri Jan 21 2011 Toshio Kuratomi <toshio(a)fedoraproject.org> - 2.7.1-5
+- Switch from setting OPT to setting EXTRA_CFLAGS so we don't overwrite the
+ DNDEBUG flag
+
+* Fri Jan 7 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.1-4
+- for now, drop "obsoletes" of python-argparse, since it interracts badly with
+multilib (rhbz#667984)
+
+* Fri Jan 7 2011 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.1-3
+- obsolete/provide python-argparse (new in 2.7)
+
+* Thu Jan 6 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.1-2
+- fix the ppc build of the debug configuration (patch 130; rhbz#661510)
+
+* Thu Dec 23 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7.1-1
+- 2.7.1, reworking patch 0 (config), patch 102 (lib64); drop upstream
+patch 56 (cfgparse), patch 110 (ctypes/SELinux/noexecmem), patch 119 (expat
+compat), patch 123 (2to3 on "from itertools import *")
+- fix test_abc's test_cache_leak in the debug build (patch 128)
+- drop _weakref.so from manifest (_weakref became a core module in r84230)
+
+* Wed Sep 29 2010 jkeating - 2.7-13
+- Rebuilt for gcc bug 634757
+
+* Mon Sep 27 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-12
+- fix test_structmember on 64bit-bigendian (patch 127)
+
+* Fri Sep 24 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-11
+- fix dbm_contains on 64bit-bigendian (patch 126; rhbz#626756)
+
+* Thu Sep 16 2010 Toshio Kuratomi <toshio(a)fedoraproject.org> - 2.7-10
+- backport a patch to fix a change in behaviour in configparse.
+
+* Thu Sep 9 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-9
+- move most of the payload of the core package to the libs subpackage, given
+that the libs aren't meaningfully usable without the standard libraries
+
+* Wed Aug 18 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-8
+- add %%check section
+- update lib64 patch (patch 102) to fix expected output in test_site.py on
+64-bit systems
+- patch test_commands.py to work with SELinux (patch 124)
+- patch the debug build's usage of COUNT_ALLOCS to be less verbose (patch 125)
+
+* Mon Jul 26 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-7
+- fixup missing -lcrypt to "crypt" module in config patch (patch 0)
+
+* Mon Jul 26 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-6
+- re-enable systemtap
+- cherrypick upstream patch to 2to3 for "from itertools import *"
+traceback (patch 123)
+
+* Thu Jul 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-5
+- disable systemtap for now (dtrace is failing on startup due to the bug
+mentioned in 2.7-4)
+- provide relative path to python binary when running pathfix.py
+- fix parallel make (patch 122)
+
+* Thu Jul 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-4
+- fix reference to pyconfig.h in sysconfig that led to failure on startup if
+python-devel was not installed
+
+* Thu Jul 8 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-3
+- add patch to fixup the new sysconfig.py for our multilib support on
+64-bit (patch 103)
+
+* Thu Jul 8 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-2
+- add machinery for regenerating the "configure" script in the face of
+mismatching autoconf versions (patch 300)
+
+* Tue Jul 6 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-1
+- 2.7 final; drop alphatag
+- drop patch 117 (upstream), patch 120 (upstreamed)
+- fix the commented-out __python_ver from 26 to 27
+
+* Tue Jun 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-0.1.rc2
+- 2.7rc2
+- revert r79310 (patch 121)
+- remove modulator: upstream removed it in r78338
+- rename mathmodule(_d).so to math(_d).so in manifests (appears to be changed
+by r76861)
+- _bytesio(_d).so and _filesio(_d).so were consolidated into _io(_d).so in
+r73394 (upstream issue 6215)
+- use the gdb hooks from the upstream tarball, rather than keeping our own
+copy. The upstream version has some whitespace changes, a new write_repr for
+unicode objects, and various bulletproofings for being run on older gdbs
+
+* Tue Jun 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-0.1.rc1
+- 2.7rc1:
+ - rework patches to apply against 2.7 (which among other changes has had a
+whitespace cleanup of the .c code): .rhconfig (patch0), .binutils-no-dep
+(patch10), .ascii-tolower (patch11), .socketmodule (patch13), .socketmodule2
+(patch14), .systemtap (patch55), .lib64 (patch102), .selinux (patch110),
+.no-static-lib (patch111), .debug-build (patch112), .statvfs-f-flag-constants
+(patch114), ..CVE-2010-2089 (patch117)
+ - drop upstream patches: .expat (patch3), .brprpm (patch51), .valgrind
+(patch52), .db48 (patch53), .CVE-2010-1634 (patch 116), .CVE-2008-5983 (patch
+118)
+
+* Tue Jun 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-17
+- Stop python bailing out with an assertion failure when UnicodeDecodeErrors
+occur on very large buffers (patch 120, upstream issue 9058)
+
+* Mon Jun 21 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-16
+- Fix an incompatibility between pyexpat and the system expat-2.0.1 that led to
+a segfault running test_pyexpat.py (patch 119; upstream issue 9054)
+
+* Tue Jun 8 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-15
+- add a flag to make it easy to turn off the debug build when troubleshooting
+the rpm build
+
+* Sat Jun 5 2010 Dan Hork <dan[at]danny.cz> - 2.6.5-14
+- reading the timestamp counter is available only on some arches (see Python/ceval.c)
+- disable --with-valgrind on s390(x) arches
+
+* Fri Jun 4 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-13
+- ensure that the compiler is invoked with "-fwrapv" (rhbz#594819)
+- CVE-2010-1634: fix various integer overflow checks in the audioop
+module (patch 116)
+- CVE-2010-2089: further checks within the audioop module (patch 117)
+- CVE-2008-5983: the new PySys_SetArgvEx entry point from r81399 (patch 118)
+
+* Thu May 27 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-12
+- make "pydoc -k" more robust in the face of broken modules (rhbz:461419,
patch115)
+
+* Wed May 26 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-11
+- add flags for statvfs.f_flag to the constant list in posixmodule (i.e. "os")
+(patch 114)
+
+* Tue May 25 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-10
+- add configure-time support for COUNT_ALLOCS and CALL_PROFILE debug options
+(patch 113); enable them and the WITH_TSC option within the debug build
+
+* Tue May 18 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-9
+- build and install two different configurations of Python: debug and standard,
+packaging the debug build in a new "python-debug" subpackage (patch 112)
+
+* Tue May 4 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-8
+- don't delete wsgiref.egg-info (rhbz:588426)
+
+* Mon Apr 26 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-7
+- disable --with-valgrind on sparc arches
+
+* Mon Apr 12 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-6
+- move the "bdist_wininst" command's template .exe files from the core
package
+to the devel subpackage, to save space (rhbz:525469)
+- fix stray doublelisting of config directory wildcard in devel subpackage
+
+* Wed Mar 31 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-5
+- update python-gdb.py from v4 to v5 (improving performance and stability,
+adding commands)
+
+* Thu Mar 25 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-4
+- update python-gdb.py from v3 to v4 (fixing infinite recursion on reference
+cycles and tracebacks on bytes 0x80-0xff in strings, adding handlers for sets
+and exceptions)
+
+* Wed Mar 24 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-3
+- refresh gdb hooks to v3 (reworking how they are packaged)
+
+* Mon Mar 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-2
+- remove unnecessary arch-conditionality for patch 101
+
+* Fri Mar 19 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-1
+- update to 2.6.5:
http://www.python.org/download/releases/2.6.5/
+- replace our patch to compile against db4.8 with a patch from
+upstream (patch 53, from r78974); update patch 54 since part of it is now in
+that upstream patch
+- update patch 110 so that it still applies in the face of upstream r78380
+
+* Tue Mar 16 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-23
+- fixup distutils/unixccompiler.py to remove standard library path from
+rpath (patch 17)
+- delete DOS batch files
+
+* Fri Mar 12 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-22
+- add pyfuntop.stp; allow systemtap support to be disabled
+- remove trailing period from tkinter summary
+- don't own /usr/bin/python-config if you're not the main python
+
+* Thu Mar 11 2010 Marcela Malov <mmaslano(a)redhat.com> - 2.6.4-21
+- rebuild with new gdbm
+
+* Thu Feb 11 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-20
+- avoid having the "test" subdirectory and the files within it that are in the
+core subpackage also be owned by the test subpackage (rhbz:467588)
+
+* Wed Feb 10 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-19
+- revise the systemtap patch (patch 55:python-2.6.4-dtrace.patch) to the
+new version by mjw in attachment 390110 of rhbz:545179, as this should
+eliminate the performance penalty for the case where the probes aren't in
+use, and eliminate all architecture-specific code (rhbz:563541; except on
+sparc)
+
+* Tue Feb 9 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-18
+- add a systemtap tapset defining "python.function.entry" and
+"python.function.return" to make it easy to use the static probepoint within
+Python; add an example of using the tapset to the docs
+
+* Tue Feb 9 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-17
+- add systemtap static probes (wcohen; patch 55; rh bug #545179)
+- update some comments in specfile relating to gdb work
+- manually byte-compile the gdb.py file with the freshly-built python to ensure
+that .pyx and .pyo files make it into the debuginfo manifest if they are later
+byte-compiled after find-debuginfo.sh is run
+
+* Mon Feb 8 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-16
+- move the -gdb.py file from %%{_libdir}/INSTSONAME-gdb.py to
+%%{_prefix}/lib/debug/%%{_libdir}/INSTSONAME.debug-gdb.py to avoid noise from
+ldconfig (bug 562980), and which should also ensure it becomes part of the
+debuginfo subpackage, rather than the libs subpackage
+- introduce %%{py_SOVERSION} and %%{py_INSTSONAME} to reflect the upstream
+configure script, and to avoid fragile scripts that try to figure this out
+dynamically (e.g. for the -gdb.py change)
+
+* Mon Feb 8 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-15
+- work around bug 562906 by supplying a fixed version of pythondeps.sh
+- set %%{_python_bytecompile_errors_terminate_build} to 0 to prevent the broken
+test files from killing the build on buildroots where python is installed
+
+* Fri Feb 5 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-14
+- add gdb hooks for easier debugging
+
+* Fri Jan 29 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-13
+- document all patches, and remove the commented-out ones
+
+* Tue Jan 26 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-12
+- Address some of the issues identified in package review (bug 226342):
+ - update libs requirement on base package to use %%{name} for consistency's
+sake
+ - convert from backticks to $() syntax throughout
+ - wrap value of LD_LIBRARY_PATH in quotes
+ - convert "/usr/bin/find" requirement to "findutils"
+ - remove trailing periods from summaries of -devel and -tools subpackages
+ - fix spelling mistake in description of -test subpackage
+ - convert usage of $$RPM_BUILD_ROOT to %%{buildroot} throughout, for
+stylistic consistency
+ - supply dirmode arguments to defattr directives
+
+* Mon Jan 25 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-11
+- update python-2.6.2-config.patch to remove downstream customization of build
+of pyexpat and elementtree modules
+- add patch adapted from upstream (patch 3) to add support for building against
+system expat; add --with-system-expat to "configure" invocation
+- remove embedded copy of expat from source tree during "prep"
+
+* Mon Jan 25 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-10
+- introduce macros for 3 directories, replacing expanded references throughout:
+%%{pylibdir}, %%{dynload_dir}, %%{site_packages}
+- explicitly list all lib-dynload files, rather than dynamically gathering the
+payload into a temporary text file, so that we can be sure what we are
+shipping; remove now-redundant testing for presence of certain .so files
+- remove embedded copy of zlib from source tree before building
+
+* Mon Jan 25 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-9
+- change python-2.6.2-config.patch to remove our downstream change to curses
+configuration in Modules/Setup.dist, so that the curses modules are built using
+setup.py with the downstream default (linking against libncursesw.so, rather
+than libncurses.so), rather than within the Makefile; add a test to %%install
+to verify the dso files that the curses module is linked against the correct
+DSO (bug 539917; changes _cursesmodule.so -> _curses.so)
+
+* Fri Jan 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-8
+- rebuild (bug 556975)
+
+* Wed Jan 20 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-7
+- move lib2to3 from -tools subpackage to main package (bug 556667)
+
+* Mon Jan 18 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-6
+- patch Makefile.pre.in to avoid building static library (patch111, bug 556092)
+- split up the "configure" invocation flags onto individual lines
+
+* Fri Jan 15 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-5
+- replace usage of %%define with %%global
+- use the %%{_isa} macro to ensure that the python-devel dependency on python
+is for the correct multilib arch (#555943)
+- delete bundled copy of libffi to make sure we use the system one
+- replace references to /usr with %%{_prefix}; replace references to
+/usr/include with %%{_includedir}
+
+* Wed Dec 16 2009 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-4
+- automatically disable arena allocator when run under valgrind (upstream
+issue 2422; patch 52)
+- add patch from Josh Boyer containing diff against upstream PyBSDDB to make
+the bsddb module compile against db-4.8 (patch 53, #544275); bump the necessary
+version of db4-devel to 4.8
+- patch setup.py so that it searches for db-4.8, and enable debug output for
+said search; make Setup.dist use db-4.8 (patch 54)
+
+* Thu Nov 12 2009 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-3
+- fixup the build when __python_ver is set (Zach Sadecki; bug 533989); use
+pybasever in the files section
+
+* Thu Oct 29 2009 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-2
+- "Makefile" and the config-32/64.h file are needed by distutils/sysconfig.py
+_init_posix(), so we include them in the core package, along with their parent
+directories (bug 531901)
+
+* Mon Oct 26 2009 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-1
+- Update to 2.6.4
+
+* Fri Aug 21 2009 Tomas Mraz <tmraz(a)redhat.com> - 2.6.2-2
+- rebuilt with new openssl
+
+* Mon Jul 27 2009 James Antill <james.antill(a)redhat.com> - 2.6.2-1
+- Update to 2.6.2
+
+* Sun Jul 26 2009 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.6-11
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
+
+* Sat Jul 4 2009 Jonathan Steffan <jsteffan(a)fedoraproject.org> - 2.6-10
+- Move python-config to devel subpackage (#506153)
+- Update BuildRoot for new standard
+
+* Sun Jun 28 2009 Jonathan Steffan <jsteffan(a)fedoraproject.org> - 2.6-9
+- Update python-tools description (#448940)
+
+* Wed Apr 15 2009 Ignacio Vazquez-Abrams <ivazqueznet+rpm(a)gmail.com> 2.6-8
+- Replace python-hashlib and python-uuid (#484715)
+
+* Tue Mar 17 2009 James Antill <james(a)fedoraproject.org> - 2.6-7
+- Use system libffi
+- Resolves: bug#490573
+- Fix SELinux execmem problems
+- Resolves: bug#488396
+
+* Thu Feb 26 2009 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.6-5
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
+
+* Fri Jan 16 2009 Tomas Mraz <tmraz(a)redhat.com> - 2.6-4
+- rebuild with new openssl
+
+* Tue Jan 6 2009 James Antill <james.antill(a)redhat.com> - 2.6-3
+- Fix distutils generated rpms.
+- Resolves: bug#236535
+
+* Wed Dec 10 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm(a)gmail.com> - 2.6-2
+- Enable -lcrypt for cryptmodule
+
+* Fri Nov 28 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm(a)gmail.com> - 2.6-1
+- Update to 2.6
+
+* Tue Sep 30 2008 James Antill <james.antill(a)redhat.com> - 2.5.2-1
+- Move to 2.5.2
+- Fix CVE-2008-2316 hashlib overflow.
+
+* Thu Jul 17 2008 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-30
+- Fix up the build for new rpm
+- And actually build against db4-4.7 (#455170)
+
+* Thu Jul 10 2008 Tom "spot" Callaway <tcallawa(a)redhat.com> - 2.5.1-27
+- fix license tag
+- enable support for db4-4.7
+
+* Sun Jun 15 2008 James Antill <jantill(a)redhat.com> - 2.5.1-26
+- Fix sporadic listdir problem
+- Resolves: bug#451494
+
+* Mon Apr 7 2008 James Antill <jantill(a)redhat.com> - 2.5.1-25
+- Rebuild to re-gen autoconf file due to glibc change.
+- Resolves: bug#441003
+
+* Tue Mar 25 2008 James Antill <jantill(a)redhat.com> - 2.5.1-24
+- Add more constants to socketmodule
+
+* Sat Mar 8 2008 James Antill <jantill(a)redhat.com> - 2.5.1-22
+- Add constants to socketmodule
+- Resolves: bug#436560
+
+* Tue Feb 19 2008 Fedora Release Engineering <rel-eng(a)fedoraproject.org> -
2.5.1-22
+- Autorebuild for GCC 4.3
+
+* Sun Jan 13 2008 Tom "spot" Callaway <tcallawa(a)redhat.com> - 2.5.1-21
+- rebuild for new tk in rawhide
+
+* Mon Jan 7 2008 James Antill <jantill(a)redhat.com> - 2.5.1-20
+- Add valgrind support files, as doc, to python-devel
+- Relates: rhbz#418621
+- Add new API from 2.6, set_wakeup_fd ... use at own risk, presumably won't
+- change but I have no control to guarantee that.
+- Resolves: rhbz#427794
+- Add gdbinit support file, as doc, to python-devel
+
+* Fri Jan 4 2008 Tom "spot" Callaway <tcallawa(a)redhat.com> - 2.5.1-19
+- rebuild for new tcl/tk in rawhide
+
+* Fri Dec 7 2007 James Antill <jantill(a)redhat.com> - 2.5.1-18
+- Create a python-test sub-module, over 3MB of stuff noone wants.
+- Don't remove egginfo files, try this see what happens ... may revert.
+- Resolves: rhbz#414711
+
+* Mon Dec 3 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-17
+- rebuild for new libssl
+
+* Fri Nov 30 2007 James Antill <jantill(a)redhat.com> - 2.5.1-16
+- Fix pyconfig.h comment typo.
+- Add back test_support.py and the __init__.py file.
+- Resolves: rhbz#387401
+
+* Tue Oct 30 2007 James Antill <jantill(a)redhat.com> - 2.5.1-15
+- Do codec lowercase in C Locale.
+- Resolves: 207134 191096
+- Fix stupid namespacing in pysqlite, minimal upgrade to 2.3.3 pysqlite
+- Resolves: 263221
+
+* Wed Oct 24 2007 James Antill <jantill(a)redhat.com> - 2.5.1-14
+- Remove bintuils dep. for live CD ... add work around for ctypes
+
+* Mon Oct 22 2007 James Antill <jantill(a)redhat.com> - 2.5.1-13
+- Add tix buildprereq
+- Add tkinter patch
+- Resolves: #281751
+- Fix ctypes loading of libraries, add requires on binutils
+- Resolves: #307221
+- Possible fix for CVE-2007-4965 possible exploitable integer overflow
+- Resolves: #295971
+
+* Tue Oct 16 2007 Mike Bonnet <mikeb(a)redhat.com> - 2.5.1-12
+- fix marshalling of objects in xmlrpclib (python bug #1739842)
+
+* Fri Sep 14 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-11
+- fix encoding of sqlite .py files to work around weird encoding problem
+ in Turkish (#283331)
+
+* Mon Sep 10 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-10
+- work around problems with multi-line plural specification (#252136)
+
+* Tue Aug 28 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-9
+- rebuild against new expat
+
+* Tue Aug 14 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-8
+- build against db4.6
+
+* Tue Aug 14 2007 Dennis Gilmore <dennis(a)ausil.us> - 2.5.1-7
+- add sparc64 to the list of archs for _pyconfig64_h
+
+* Fri Aug 10 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-6
+- fix ctypes again on some arches (Hans de Goede, #251637)
+
+* Fri Jul 6 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-5
+- link curses modules with ncursesw (#246385)
+
+* Wed Jun 27 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-4
+- fix _elementtree.so build (#245703)
+- ensure that extension modules we expect are actually built rather than
+ having them silently fall out of the package
+
+* Tue Jun 26 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-3
+- link with system expat (#245703)
+
+* Thu Jun 21 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-2
+- rebuild to take advantage of hardlinking between identical pyc/pyo files
+
+* Thu May 31 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-1
+- update to python 2.5.1
+
+* Mon Mar 19 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-12
+- fix alpha build (#231961)
+
+* Tue Feb 13 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-11
+- tcl/tk was reverted; rebuild again
+
+* Thu Feb 1 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-10
+- rebuild for new tcl/tk
+
+* Tue Jan 16 2007 Miroslav Lichvar <mlichvar(a)redhat.com> - 2.5.3-9
+- link with ncurses
+
+* Sat Jan 6 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-8
+- fix extensions to use shared libpython (#219564)
+- all 64bit platforms need the regex fix (#122304)
+
+* Wed Jan 3 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-7
+- fix ctypes to not require execstack (#220669)
+
+* Fri Dec 15 2006 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-6
+- don't link against compat-db (Robert Scheck)
+
+* Wed Dec 13 2006 Jarod Wilson <jwilson(a)redhat.com> - 2.5.3-5
+- fix invalid assert in debug mode (upstream changeset 52622)
+
+* Tue Dec 12 2006 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-4
+- obsolete/provide python-ctypes (#219256)
+
+* Mon Dec 11 2006 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-3
+- fix atexit traceback with failed syslog logger (#218214)
+- split libpython into python-libs subpackage for multilib apps
+ embedding python interpreters
+
+* Wed Dec 6 2006 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-2
+- disable installation of .egg-info files for now
+
+* Tue Dec 5 2006 Jeremy Katz <katzj(a)redhat.com>
+- support db 4.5
+- obsolete python-elementtree; since it requires some code tweaks, don't
+ provide it
+- obsolete old python-sqlite; provide the version that's actually included
+
+* Mon Oct 30 2006 Jeremy Katz <katzj(a)redhat.com>
+- fix _md5 and _sha modules (Robert Sheck)
+- no longer provide optik compat; it's been a couple of years now
+- no longer provide the old shm module; if this is still needed, let's
+ build it separately
+- no longer provide japanese codecs; should be a separate package
+
+* Mon Oct 23 2006 Jeremy Katz <katzj(a)redhat.com> - 2.5-0
+- update to 2.5.0 final
+
+* Fri Aug 18 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.99.c1
+- Updated to 2.5c1. Merged fixes from FC6 too:
+- Fixed bug #199373 (on some platforms CFLAGS is needed when linking)
+- Fixed bug #198971 (case conversion not locale safe in logging library)
+- Verified bug #201434 (distutils.sysconfig is confused by the change to make
+ python-devel multilib friendly) is fixed upstream
+
+* Sun Jul 16 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.99.b2
+- Updated to 2.5b2 (which for comparison reasons is re-labeled 2.4.99.b2)
+
+* Fri Jun 23 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.99.b1
+- Updated to 2.5b1 (which for comparison reasons is re-labeled 2.4.99.b1)
+
+* Tue Jun 13 2006 Jeremy Katz <katzj(a)redhat.com> - 2.4.3-11.FC6
+- and fix it for real
+
+* Tue Jun 13 2006 Jeremy Katz <katzj(a)redhat.com> - 2.4.3-10.FC6
+- fix python-devel on ia64
+
+* Tue Jun 13 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-9
+- Fixed python-devel to be multilib friendly (bug #192747, #139911)
+
+* Tue Jun 13 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-8
+- Only copying mkhowto from the Docs - we don't need perl dependencies from
+ python-tools.
+
+* Mon Jun 12 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-7
+- Fixed bug #121198 (webbrowser.py should use the user's preferences first)
+
+* Mon Jun 12 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-6
+- Fixed bug #192592 (too aggressive assertion fails) - SF#1257960
+- Fixed bug #167468 (Doc/tools not included) - added in the python-tools package
+
+* Thu Jun 8 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-5
+- Fixed bug #193484 (added pydoc in the main package)
+
+* Mon Jun 5 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-4
+- Added dist in the release
+
+* Mon May 15 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-3
+- rebuilt to fix broken libX11 dependency
+
+* Wed Apr 12 2006 Jeremy Katz <katzj(a)redhat.com> - 2.4.3-2
+- rebuild with new gcc to fix #188649
+
+* Thu Apr 6 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-1
+- Updated to 2.4.3
+
+* Fri Feb 10 2006 Jesse Keating <jkeating(a)redhat.com> - 2.4.2-3.2.1
+- bump again for double-long bug on ppc(64)
+
+* Fri Feb 10 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-3.2
+- rebuilt for newer tix
+
+* Tue Feb 07 2006 Jesse Keating <jkeating(a)redhat.com> - 2.4.2-3.1
+- rebuilt for new gcc4.1 snapshot and glibc changes
+
+* Fri Jan 20 2006 Mihai Ibanescu <misa(a)redhat.com> 2.4.2-3
+- fixed #136654 for another instance of audiotest.au
+
+* Fri Dec 09 2005 Jesse Keating <jkeating(a)redhat.com>
+- rebuilt
+
+* Sat Nov 19 2005 Bill Nottingham <notting(a)redhat.com> 2.4.2-2
+- fix build for modular X, remove X11R6 path references
+
+* Tue Nov 15 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.2-1
+- Upgraded to 2.4.2
+- BuildRequires autoconf
+
+* Wed Nov 9 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-16
+- Rebuilding against newer openssl.
+- XFree86-devel no longer exists
+
+* Mon Sep 26 2005 Peter Jones <pjones(a)redhat.com> 2.4.1-14
+- Once more -- this time, to fix -EPERM when you run it in a directory
+ you can't read from.
+
+* Mon Sep 26 2005 Peter Jones <pjones(a)redhat.com> 2.4.1-13
+- So, 5 or 6 people have said it works for them with this patch...
+
+* Sun Sep 25 2005 Peter Jones <pjones(a)redhat.com> 2.4.1-12
+- Fixed bug #169159 (check for argc>0 and argv[0] == NULL, not just
+ argv[0][0]='\0')
+ Reworked the patch from -8 a bit more.
+
+* Fri Sep 23 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-10
+- Fixed bug #169159 (don't let python core dump if no arguments are passed in)
+ Reworked the patch from -8 a bit more.
+
+* Thu Sep 22 2005 Peter Jones <pjones(a)redhat.com> 2.4.1-8
+- Fix bug #169046 more correctly.
+
+* Thu Sep 22 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-7
+- Fixed bug #169046 (realpath is unsafe); thanks to
+ Peter Jones <pjones(a)redhat.com> and Arjan van de Ven <arjanv(a)redhat.com>
for
+ diagnosing and the patch.
+
+* Tue Sep 20 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-4
+- Fixed bug #168655 (fixes for building as python24)
+
+* Tue Jul 26 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-3
+- Fixed bug #163435 (pynche doesn't start))
+
+* Wed Apr 20 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-2
+- Fixed bug #143667 (python should own /usr/lib/python* on 64-bit systems, for
+ noarch packages)
+- Fixed bug #143419 (BuildRequires db4 is not versioned)
+
+* Wed Apr 6 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-1
+- updated to 2.4.1
+
+* Mon Mar 14 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4-6
+- building the docs from a different source rpm, to decouple bootstrapping
+ python from having tetex installed
+
+* Fri Mar 11 2005 Dan Williams <dcbw(a)redhat.com> 2.4-5
+- Rebuild to pick up new libssl.so.5
+
+* Wed Feb 2 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4-4
+- Fixed security issue in SimpleXMLRPCServer.py (#146647)
+
+* Wed Jan 12 2005 Tim Waugh <twaugh(a)redhat.com> 2.4-3
+- Rebuilt for new readline.
+
+* Mon Dec 6 2004 Jeff Johnson <jbj(a)jbj.org> 2.4-2
+- db-4.3.21 returns DB_BUFFER_SMALL rather than ENOMEM (#141994).
+- add Provide: python(abi) = 2.4
+- include msgfmt/pygettext *.pyc and *.pyo from brp-python-bytecompile.
+
+* Fri Dec 3 2004 Mihai Ibanescu <misa(a)redhat.com> 2.4-1
+- Python-2.4.tar.bz2 (final)
+
+* Fri Nov 19 2004 Mihai Ibanescu <misa(a)redhat.com> 2.4-0.c1.1
+- Python-2.4c1.tar.bz2 (release candidate 1)
+
+* Thu Nov 11 2004 Jeff Johnson <jbj(a)jbj.org> 2.4-0.b2.4
+- rebuild against db-4.3.21.
+
+* Mon Nov 8 2004 Jeremy Katz <katzj(a)redhat.com> - 2.4-0.b2.3
+- fix the lib64 patch so that 64bit arches still look in /usr/lib/python...
+
+* Mon Nov 8 2004 Jeremy Katz <katzj(a)redhat.com> - 2.4-0.b2.2
+- cryptmodule still needs -lcrypt (again)
+
+* Thu Nov 4 2004 Mihai Ibanescu <misa(a)redhat.com> 2.4-0.b2.1
+- Updated to python 2.4b2 (and labeled it 2.4-0.b2.1 to avoid breaking rpm's
+ version comparison)
+
+* Thu Nov 4 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-13
+- Fixed bug #138112 (python overflows stack buffer) - SF bug 105470
+
+* Tue Nov 2 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-12
+- Fixed bugs #131439 #136023 #137863 (.pyc/.pyo files had the buildroot added)
+
+* Tue Oct 26 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-11
+- Fixed bug #136654 (python has sketchy audio clip)
+
+* Tue Aug 31 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-10
+- Fixed bug #77418 (Demo dir not packaged)
+- More tweaking on #19347 (Moved Tools/ under /usr/lib/python2.3/Tools)
+
+* Fri Aug 13 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-8
+- Fixed bug #129769: Makefile in new python conflicts with older version found
+ in old python-devel
+- Reorganized the spec file to get rid of the aspython2 define; __python_ver
+ is more powerful.
+
+* Tue Aug 3 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-7
+- Including html documentation for non-i386 arches
+- Fixed #125362 (python-doc html files have japanese character encoding)
+- Fixed #128923 (missing dependency between python and python-devel)
+
+* Fri Jul 30 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-6
+- Fixed #128030 (help() not printing anything)
+- Fixed #125472 (distutils.sysconfig.get_python_lib() not returning the right
+ path on 64-bit systems)
+- Fixed #127357 (building python as a shared library)
+- Fixed #19347 (including the contents of Tools/scripts/ in python-tools)
+
+* Tue Jun 15 2004 Elliot Lee <sopwith(a)redhat.com>
+- rebuilt
+
+* Tue Jun 8 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-3
+- Added an optik.py that provides the same interface from optparse for
+ backward compatibility; obsoleting python-optik
+
+* Mon Jun 7 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-2
+- Patched bdist_rpm to allow for builds of multiple binary rpms (bug #123598)
+
+* Fri Jun 4 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-1
+- Updated to 2.3.4-1 with Robert Scheck's help (bug #124764)
+- Added BuildRequires: tix-devel (bug #124918)
+
+* Fri May 7 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.3-6
+- Correct fix for #122304 from upstream:
+
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=93184...
+
+* Thu May 6 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.3-4
+- Fix for bug #122304 : splitting the domain name fails on 64-bit arches
+- Fix for bug #120879 : including Makefile into the main package
+
+- Requires XFree86-devel instead of -libs (see bug #118442)
+
+* Tue Mar 16 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.3-3
+- Requires XFree86-devel instead of -libs (see bug #118442)
+
+* Tue Mar 02 2004 Elliot Lee <sopwith(a)redhat.com>
+- rebuilt
+
+* Fri Feb 13 2004 Elliot Lee <sopwith(a)redhat.com>
+- rebuilt
+
+* Fri Dec 19 2003 Jeff Johnson <jbj(a)jbj.org> 2.3.3-1
+- upgrade to 2.3.3.
+
+* Sat Dec 13 2003 Jeff Johnson <jbj(a)jbj.org> 2.3.2-9
+- rebuild against db-4.2.52.
+
+* Fri Dec 12 2003 Jeremy Katz <katzj(a)redhat.com> 2.3.2-8
+- more rebuilding for new tcl/tk
+
+* Wed Dec 3 2003 Jeff Johnson <jbj(a)jbj.org> 2.3.2-7.1
+- rebuild against db-4.2.42.
+
+* Fri Nov 28 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.2-7
+- rebuilt against newer tcl/tk
+
+* Mon Nov 24 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.2-6
+- added a Provides: python-abi
+
+* Wed Nov 12 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.2-5
+- force CC (#109268)
+
+* Sun Nov 9 2003 Jeremy Katz <katzj(a)redhat.com> 2.3.2-4
+- cryptmodule still needs -lcrypt
+
+* Wed Nov 5 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.2-2
+- Added patch for missing mkhowto
+
+* Thu Oct 16 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.2-1
+- Updated to 2.3.2
+
+* Thu Sep 25 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.1-1
+- 2.3.1 final
+
+* Tue Sep 23 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.1-0.8.RC1
+- Building the python 2.3.1 release candidate
+- Updated the lib64 patch
+
+* Wed Jul 30 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3-0.2
+- Building python 2.3
+- Added more BuildRequires
+- Updated the startup files for modulator and pynche; idle installs its own
+ now.
+
+* Thu Jul 3 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.3-4
+- Rebuilt against newer db4 packages (bug #98539)
+
+* Mon Jun 9 2003 Elliot Lee <sopwith(a)redhat.com> 2.2.3-3
+- rebuilt
+
+* Sat Jun 7 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.3-2
+- Rebuilt
+
+* Fri Jun 6 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.3-1
+- Upgraded to 2.2.3
+
+* Wed Apr 2 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-28
+- Rebuilt
+
+* Wed Apr 2 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-27
+- Modified the ftpuri patch conforming to
http://ietf.org/rfc/rfc1738.txt
+
+* Mon Feb 24 2003 Elliot Lee <sopwith(a)redhat.com>
+- rebuilt
+
+* Mon Feb 24 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-25
+- Fixed bug #84886: pydoc dies when run w/o arguments
+- Fixed bug #84205: add python shm module back (used to be shipped with 1.5.2)
+- Fixed bug #84966: path in byte-compiled code still wrong
+
+* Thu Feb 20 2003 Jeremy Katz <katzj(a)redhat.com> 2.2.2-23
+- ftp uri's should be able to specify being rooted at the root instead of
+ where you login via ftp (#84692)
+
+* Mon Feb 10 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-22
+- Using newer Japanese codecs (1.4.9). Thanks to
+ Peter Bowen <pzb(a)datastacks.com> for pointing this out.
+
+* Thu Feb 6 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-21
+- Rebuild
+
+* Wed Feb 5 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-20
+- Release number bumped really high: turning on UCS4 (ABI compatibility
+ breakage)
+
+* Fri Jan 31 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-13
+- Attempt to look both in /usr/lib64 and /usr/lib/python2.2/site-packages/:
+ some work on python-2.2.2-lib64.patch
+
+* Thu Jan 30 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-12
+- Rebuild to incorporate the removal of .lib64 and - files.
+
+* Thu Jan 30 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-11.7.3
+- Fixed bug #82544: Errata removes most tools
+- Fixed bug #82435: Python 2.2.2 errata breaks redhat-config-users
+- Removed .lib64 and - files that get installed after we fix the multilib
+ .py files.
+
+* Wed Jan 22 2003 Tim Powers <timp(a)redhat.com>
+- rebuilt
+
+* Wed Jan 15 2003 Jens Petersen <petersen(a)redhat.com> 2.2.2-10
+- rebuild to update tkinter's tcltk deps
+- convert changelog to utf-8
+
+* Tue Jan 7 2003 Nalin Dahyabhai <nalin(a)redhat.com> 2.2.2-9
+- rebuild
+
+* Fri Jan 3 2003 Nalin Dahyabhai <nalin(a)redhat.com>
+- pick up OpenSSL cflags and ldflags from pkgconfig if available
+
+* Thu Jan 2 2003 Jeremy Katz <katzj(a)redhat.com> 2.2.2-8
+- urllib2 didn't support non-anonymous ftp. add support based on how
+ urllib did it (#80676, #78168)
+
+* Mon Dec 16 2002 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-7
+- Fix bug #79647 (Rebuild of SRPM fails if python isn't installed)
+- Added a bunch of missing BuildRequires found while fixing the
+ above-mentioned bug
+
+* Tue Dec 10 2002 Tim Powers <timp(a)redhat.com> 2.2.2-6
+- rebuild to fix broken tcltk deps for tkinter
+
+* Fri Nov 22 2002 Mihai Ibanescu <misa(a)redhat.com>
+2.2.2-3.7.3
+- Recompiled for 7.3 (to fix the -lcrypt bug)
+- Fix for the spurious error message at the end of the build (build-requires
+ gets confused by executable files starting with """"): make the
tests
+ non-executable.
+
+* Wed Nov 20 2002 Mihai Ibanescu <misa(a)redhat.com>
+2.2.2-5
+- Fixed configuration patch to add -lcrypt when compiling cryptmodule.c
+
+2.2.2-4
+- Spec file change from Matt Wilson <msw(a)redhat.com> to disable linking
+ with the C++ compiler.
+
+* Mon Nov 11 2002 Mihai Ibanescu <misa(a)redhat.com>
+2.2.2-3.*
+- Merged patch from Karsten Hopp <karsten(a)redhat.de> from 2.2.1-17hammer to
+ use %%{_libdir}
+- Added XFree86-libs as BuildRequires (because of tkinter)
+- Fixed duplicate listing of plat-linux2
+- Fixed exclusion of lib-dynload/japanese
+- Added lib64 patch for the japanese codecs
+- Use setup magic instead of using tar directly on JapaneseCodecs
+
+* Tue Nov 5 2002 Mihai Ibanescu <misa(a)redhat.com>
+2.2.2-2
+- Fix #76912 (python-tools contains idle, which uses tkinter, but there is no
+ requirement of tkinter from python-tools).
+- Fix #74013 (rpm is missing the /usr/lib/python2.2/test directory)
+
+* Mon Nov 4 2002 Mihai Ibanescu <misa(a)redhat.com>
+- builds as python2 require a different libdb
+- changed the buildroot name of python to match python2 builds
+
+* Fri Nov 1 2002 Mihai Ibanescu <misa(a)redhat.com>
+- updated python to 2.2.2 and adjusted the patches accordingly
+
+* Mon Oct 21 2002 Mihai Ibanescu <misa(a)redhat.com>
+- Fix #53930 (Python-2.2.1-buildroot-bytecode.patch)
+- Added BuildPrereq dependency on gcc-c++
+
+* Fri Aug 30 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-17
+- security fix for _execvpe
+
+* Tue Aug 13 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-16
+- Fix #71011,#71134, #58157
+
+* Wed Aug 7 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-15
+- Resurrect tkinter
+- Fix for distutils (#67671)
+- Fix #69962
+
+* Thu Jul 25 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-14
+- Obsolete tkinter/tkinter2 (#69838)
+
+* Tue Jul 23 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-13
+- Doc fixes (#53951) - not on alpha at the momemt
+
+* Mon Jul 8 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-12
+- fix pydoc (#68082)
+
+* Mon Jul 8 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-11
+- Add db4-devel as a BuildPrereq
+
+* Fri Jun 21 2002 Tim Powers <timp(a)redhat.com> 2.2.1-10
+- automated rebuild
+
+* Mon Jun 17 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-9
+- Add Japanese codecs (#66352)
+
+* Tue Jun 11 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-8
+- No more tkinter...
+
+* Wed May 29 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-7
+- Rebuild
+
+* Tue May 21 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-6
+- Add the email subcomponent (#65301)
+
+* Fri May 10 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-5
+- Rebuild
+
+* Thu May 02 2002 Than Ngo <than(a)redhat.com> 2.2.1-4
+- rebuild i new enviroment
+
+* Tue Apr 23 2002 Trond Eivind Glomsrd <teg(a)redhat.com>
+- Use ucs2, not ucs4, to avoid breaking tkinter (#63965)
+
+* Mon Apr 22 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-2
+- Make it use db4
+
+* Fri Apr 12 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-1
+- 2.2.1 - a bugfix-only release
+
+* Fri Apr 12 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-16
+- the same, but in builddirs - this will remove them from the
+ docs package, which doesn't look in the buildroot for files.
+
+* Fri Apr 12 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-15
+- Get rid of temporary files and .cvsignores included
+ in the tarball and make install
+
+* Fri Apr 5 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-14
+- Don't own lib-tk in main package, only in tkinter (#62753)
+
+* Mon Mar 25 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-13
+- rebuild
+
+* Mon Mar 25 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-12
+- rebuild
+
+* Fri Mar 1 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-11
+- Add a not to the Distutils obsoletes test (doh!)
+
+* Fri Mar 1 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-10
+- Rebuild
+
+* Mon Feb 25 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-9
+- Only obsolete Distutils when built as python
+
+* Thu Feb 21 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-8
+- Make files in /usr/bin install side by side with python 1.5 when
+- Drop explicit requirement of db4
+ built as python2
+
+* Thu Jan 31 2002 Elliot Lee <sopwith(a)redhat.com> 2.2-7
+- Use version and pybasever macros to make updating easy
+- Use _smp_mflags macro
+
+* Tue Jan 29 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-6
+- Add db4-devel to BuildPrereq
+
+* Fri Jan 25 2002 Nalin Dahyabhai <nalin(a)redhat.com> 2.2-5
+- disable ndbm support, which is db2 in disguise (really interesting things
+ can happen when you mix db2 and db4 in a single application)
+
+* Thu Jan 24 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-4
+- Obsolete subpackages if necesarry
+- provide versioned python2
+- build with db4
+
+* Wed Jan 16 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-3
+- Alpha toolchain broken. Disable build on alpha.
+- New openssl
+
+* Wed Dec 26 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-1
+- 2.2 final
+
+* Fri Dec 14 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.11c1
+- 2.2 RC 1
+- Don't include the _tkinter module in the main package - it's
+ already in the tkiter packace
+- Turn off the mpzmodule, something broke in the buildroot
+
+* Wed Nov 28 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.10b2
+- Use -fPIC for OPT as well, in lack of a proper libpython.so
+
+* Mon Nov 26 2001 Matt Wilson <msw(a)redhat.com> 2.2-0.9b2
+- changed DESTDIR to point to / so that distutils will install dynload
+ modules properly in the installroot
+
+* Fri Nov 16 2001 Matt Wilson <msw(a)redhat.com> 2.2-0.8b2
+- 2.2b2
+
+* Fri Oct 26 2001 Matt Wilson <msw(a)redhat.com> 2.2-0.7b1
+- python2ify
+
+* Fri Oct 19 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.5b1
+- 2.2b1
+
+* Sun Sep 30 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.4a4
+- 2.2a4
+- Enable UCS4 support
+- Enable IPv6
+- Provide distutils
+- Include msgfmt.py and pygettext.py
+
+* Fri Sep 14 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.3a3
+- Obsolete Distutils, which is now part of the main package
+- Obsolete python2
+
+* Thu Sep 13 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.2a3
+- Add docs, tools and tkinter subpackages, to match the 1.5 layout
+
+* Wed Sep 12 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.1a3
+- 2.2a3
+- don't build tix and blt extensions
+
+* Mon Aug 13 2001 Trond Eivind Glomsrd <teg(a)redhat.com>
+- Add tk and tix to build dependencies
+
+* Sat Jul 21 2001 Trond Eivind Glomsrd <teg(a)redhat.com>
+- 2.1.1 bugfix release - with a GPL compatible license
+
+* Fri Jul 20 2001 Trond Eivind Glomsrd <teg(a)redhat.com>
+- Add new build dependencies (#49753)
+
+* Tue Jun 26 2001 Nalin Dahyabhai <nalin(a)redhat.com>
+- build with -fPIC
+
+* Fri Jun 1 2001 Trond Eivind Glomsrd <teg(a)redhat.com>
+- 2.1
+- reorganization of file includes
+
+* Wed Dec 20 2000 Trond Eivind Glomsrd <teg(a)redhat.com>
+- fix the "requires" clause, it lacked a space causing problems
+- use %%{_tmppath}
+- don't define name, version etc
+- add the available patches from the Python home page
+
+* Fri Dec 15 2000 Matt Wilson <msw(a)redhat.com>
+- added devel subpackage
+
+* Fri Dec 15 2000 Matt Wilson <msw(a)redhat.com>
+- modify all files to use "python2.0" as the intrepter
+- don't build the Expat bindings
+- build against db1
+
+* Mon Oct 16 2000 Jeremy Hylton <jeremy(a)beopen.com>
+- updated for 2.0 final
+
+* Mon Oct 9 2000 Jeremy Hylton <jeremy(a)beopen.com>
+- updated for 2.0c1
+- build audioop, imageop, and rgbimg extension modules
+- include xml.parsers subpackage
+- add test.xml.out to files list
+
+* Thu Oct 5 2000 Jeremy Hylton <jeremy(a)beopen.com>
+- added bin/python2.0 to files list (suggested by Martin v. L?)
+
+* Tue Sep 26 2000 Jeremy Hylton <jeremy(a)beopen.com>
+- updated for release 1 of 2.0b2
+- use .bz2 version of Python source
+
+* Tue Sep 12 2000 Jeremy Hylton <jeremy(a)beopen.com>
+- Version 2 of 2.0b1
+- Make the package relocatable. Thanks to Suchandra Thapa.
+- Exclude Tkinter from main RPM. If it is in a separate RPM, it is
+ easier to track Tk releases.
commit f8b5f40daeb36978ab60abb7c2bb3431888e7d0c
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Mon Aug 12 16:00:38 2019 +0200
Conditionalize python2-devel runtime dependencies
diff --git a/python2.spec b/python2.spec
index 5ea0098..7e2c5f5 100644
--- a/python2.spec
+++ b/python2.spec
@@ -122,7 +122,7 @@ Name: %{python}
#global prerel ...
%global upstream_version %{general_version}%{?prerel}
Version: %{general_version}%{?prerel:~%{prerel}}
-Release: 6%{?dist}
+Release: 7%{?dist}
License: Python
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
Provides: python(abi) = %{pybasever}
@@ -823,15 +823,18 @@ Summary: Libraries and header files needed for Python 2 development
%?deprecated
Requires: %{python}%{?_isa} = %{version}-%{release}
-Requires: python-rpm-macros
-Requires: python2-rpm-macros
Requires: pkgconfig
+# The RPM related dependencies bring nothing to a non-RPM Python developer
+# But we want them when packages BuildRequire python2-devel
+Requires: (python-rpm-macros if rpm-build)
+Requires: (python2-rpm-macros if rpm-build)
+
%if %{without python3_bootstrap}
# When bootstrapping python3, we need to build setuptools
# But setuptools BR python2-devel and that brings in python3-rpm-generators
# python3-rpm-generators needs python3-setuptools, so we cannot have it yet
-Requires: python3-rpm-generators
+Requires: (python3-rpm-generators if rpm-build)
%endif
# This is not "API" (packages that need setuptools should still BuildRequire
it)
@@ -841,13 +844,13 @@ Requires: python3-rpm-generators
# installed when -devel is required.
# See
https://bugzilla.redhat.com/show_bug.cgi?id=1623922
# See
https://fedoraproject.org/wiki/Packaging:Directory_Replacement
-Requires: python2-setuptools
+Requires: (python2-setuptools if rpm-build)
#
https://bugzilla.redhat.com/show_bug.cgi?id=1217376
#
https://bugzilla.redhat.com/show_bug.cgi?id=1496757
#
https://bugzilla.redhat.com/show_bug.cgi?id=1218294
# TODO change to a specific subpackage once available (#1218294)
-Requires: redhat-rpm-config
+Requires: (redhat-rpm-config if gcc)
# Needed here because of the migration of Makefile from -devel to the main
# package
@@ -1974,6 +1977,9 @@ CheckPython \
# ======================================================
%changelog
+* Tue Aug 20 2019 Miro Hronok <mhroncok(a)redhat.com> - 2.7.16-7
+- Conditionalize python2-devel runtime dependencies
+
* Wed Aug 14 2019 Miro Hronok <mhroncok(a)redhat.com> - 2.7.16-6
- Rebuilt for Python 3.8
commit 6ab8b22e3c53a373e0181918f303443f78d6a08b
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Wed Aug 14 23:08:11 2019 +0200
Rebuilt for Python 3.8
diff --git a/python2.spec b/python2.spec
index c5c0b46..5ea0098 100644
--- a/python2.spec
+++ b/python2.spec
@@ -1,6 +1,3 @@
-%global _without_tests 1
-%global _without_rpmwheels 1
-%global _with_python3_bootstrap 1
# ======================================================
# Conditionals and other variables controlling the build
# ======================================================
@@ -125,7 +122,7 @@ Name: %{python}
#global prerel ...
%global upstream_version %{general_version}%{?prerel}
Version: %{general_version}%{?prerel:~%{prerel}}
-Release: 5%{?dist}
+Release: 6%{?dist}
License: Python
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
Provides: python(abi) = %{pybasever}
@@ -1977,6 +1974,9 @@ CheckPython \
# ======================================================
%changelog
+* Wed Aug 14 2019 Miro Hronok <mhroncok(a)redhat.com> - 2.7.16-6
+- Rebuilt for Python 3.8
+
* Wed Aug 14 2019 Miro Hronok <mhroncok(a)redhat.com> - 2.7.16-5
- Bootstrap for Python 3.8
commit d3fb1961494ed74f019db8f2566cea460588b7c1
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Wed Aug 14 19:46:49 2019 +0200
Bootstrap for Python 3.8
diff --git a/python2.spec b/python2.spec
index d763257..c5c0b46 100644
--- a/python2.spec
+++ b/python2.spec
@@ -1,3 +1,6 @@
+%global _without_tests 1
+%global _without_rpmwheels 1
+%global _with_python3_bootstrap 1
# ======================================================
# Conditionals and other variables controlling the build
# ======================================================
@@ -122,7 +125,7 @@ Name: %{python}
#global prerel ...
%global upstream_version %{general_version}%{?prerel}
Version: %{general_version}%{?prerel:~%{prerel}}
-Release: 4%{?dist}
+Release: 5%{?dist}
License: Python
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
Provides: python(abi) = %{pybasever}
@@ -1974,6 +1977,9 @@ CheckPython \
# ======================================================
%changelog
+* Wed Aug 14 2019 Miro Hronok <mhroncok(a)redhat.com> - 2.7.16-5
+- Bootstrap for Python 3.8
+
* Fri Jul 26 2019 Fedora Release Engineering <releng(a)fedoraproject.org> - 2.7.16-4
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
commit 15876466e81d72ab678ca759a61642e3ca1d5126
Author: Fedora Release Engineering <releng(a)fedoraproject.org>
Date: Fri Jul 26 17:20:25 2019 +0000
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng(a)fedoraproject.org>
diff --git a/python2.spec b/python2.spec
index ff54dca..d763257 100644
--- a/python2.spec
+++ b/python2.spec
@@ -122,7 +122,7 @@ Name: %{python}
#global prerel ...
%global upstream_version %{general_version}%{?prerel}
Version: %{general_version}%{?prerel:~%{prerel}}
-Release: 3%{?dist}
+Release: 4%{?dist}
License: Python
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
Provides: python(abi) = %{pybasever}
@@ -1974,6 +1974,9 @@ CheckPython \
# ======================================================
%changelog
+* Fri Jul 26 2019 Fedora Release Engineering <releng(a)fedoraproject.org> - 2.7.16-4
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
+
* Fri Jul 12 2019 Miro Hronok <mhroncok(a)redhat.com> - 2.7.16-3
-
https://fedoraproject.org/wiki/Changes/Python_means_Python3
- The python-unversioned-command package is no longer Python 2, but 3
commit 026488911cbe9c81a24eb8b3daa7937f345c042c
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Thu Jul 11 16:20:09 2019 +0200
Keep the LICENSE.txt file in lib/pythonX.Y dir
The license() builtin tries to read it and virtualenv tries to copy it.
See
https://github.com/pypa/virtualenv/issues/1352
Up until now, the license() builtin juts felt back to:
See
https://www.python.org/psf/license/
However it should output the full license text.
Virtualenv ~16.6 warns:
No LICENSE.txt / LICENSE found in source
Technically, it is probably possible to install the package without
%license files, but that would simply resort to the previous noncritical
behavior.
This fix is not critical and hence it doesn't bump release, for easier
backporting to all our Python packages.
diff --git a/python2.spec b/python2.spec
index fa2a6d5..ff54dca 100644
--- a/python2.spec
+++ b/python2.spec
@@ -1369,8 +1369,6 @@ find %{buildroot}/ -name ".cvsignore"|xargs rm -f
find %{buildroot}/ -name "*.bat"|xargs rm -f
find . -name "*~"|xargs rm -f
find . -name ".cvsignore"|xargs rm -f
-#zero length
-rm -f %{buildroot}%{pylibdir}/LICENSE.txt
# Provide binaries in the form of bin2 and bin2.7, thus implementing
@@ -1609,8 +1607,6 @@ CheckPython \
%files
-%{!?_licensedir:%global license %%doc}
-%license LICENSE
%doc README
%{_bindir}/pydoc2*
%{_bindir}/%{python}
@@ -1618,9 +1614,8 @@ CheckPython \
%{_mandir}/*/python2*
%files libs
-%{!?_licensedir:%global license %%doc}
-%license LICENSE
%doc README
+%license %{pylibdir}/LICENSE.txt
%dir %{pylibdir}
%dir %{dynload_dir}
commit 6ac6817a8175a049ae4d37ba22147f1a283d49b0
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Tue Jul 23 13:23:43 2019 +0200
Provide pythonX.Y
diff --git a/python2.spec b/python2.spec
index cd3d5ab..fa2a6d5 100644
--- a/python2.spec
+++ b/python2.spec
@@ -129,6 +129,9 @@ Provides: python(abi) = %{pybasever}
%?deprecated
+# People might want to dnf install pythonX.Y instead of pythonXY
+Provides: python%{pybasever} = %{version}-%{release}
+
# =======================
# Build-time requirements
commit 5cff7a7251fc3d44009ac2ff76ec4d1ec87e55cb
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Fri Jul 12 18:23:20 2019 +0200
Python no longer means Python 2
-
https://fedoraproject.org/wiki/Changes/Python_means_Python3
- The python-unversioned-command package is no longer Python 2, but 3
- The python, pydoc, python-config, python-debug, idle, pygettext.py and
msgfmt.py commands are now in python3
diff --git a/python2.spec b/python2.spec
index edfd0aa..cd3d5ab 100644
--- a/python2.spec
+++ b/python2.spec
@@ -122,7 +122,7 @@ Name: %{python}
#global prerel ...
%global upstream_version %{general_version}%{?prerel}
Version: %{general_version}%{?prerel:~%{prerel}}
-Release: 2%{?dist}
+Release: 3%{?dist}
License: Python
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
Provides: python(abi) = %{pybasever}
@@ -205,12 +205,6 @@ BuildRequires: python-pip-wheel
# alongside the system one e.g. python26, python33 etc
Provides: python27 = %{version}-%{release}
-#
https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_...
-# We recommend /usr/bin/python so users get it by default
-# Versioned recommends are problematic, and we know that the package requires
-# python2 back with fixed version, so we just use the path here:
-Recommends: %{_bindir}/python
-
# Previously, this was required for our rewheel patch to work.
# This is technically no longer needed, but we keep it recommended
# for the developer experience.
@@ -786,22 +780,6 @@ This package provides the "python2" executable; most of the
actual
implementation is within the "python2-libs" package.
-%package -n python-unversioned-command
-Summary: The "python" command that runs Python 2
-BuildArch: noarch
-#
https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_...
-%?deprecated
-
-# In theory this could require any python2 version
-Requires: python2 == %{version}-%{release}
-# But since we want to provide versioned python, we require exact version
-Provides: python = %{version}-%{release}
-# This also save us an explicit conflict for older python2 builds
-
-%description -n python-unversioned-command
-This package contains /usr/bin/python - the "python" command that runs Python
2.
-
-
%package libs
Summary: Runtime libraries for Python 2
%?deprecated
@@ -1394,29 +1372,25 @@ rm -f %{buildroot}%{pylibdir}/LICENSE.txt
# Provide binaries in the form of bin2 and bin2.7, thus implementing
# (and expanding) the recommendations of PEP 394.
+# Do NOT provide unversioned binaries
+#
https://fedoraproject.org/wiki/Changes/Python_means_Python3
mv %{buildroot}%{_bindir}/idle %{buildroot}%{_bindir}/idle%{pybasever}
ln -s ./idle%{pybasever} %{buildroot}%{_bindir}/idle2
-ln -s ./idle2 %{buildroot}%{_bindir}/idle
mv %{buildroot}%{_bindir}/pynche %{buildroot}%{_bindir}/pynche%{pybasever}
ln -s ./pynche%{pybasever} %{buildroot}%{_bindir}/pynche2
-ln -s ./pynche2 %{buildroot}%{_bindir}/pynche
mv %{buildroot}%{_bindir}/pydoc %{buildroot}%{_bindir}/pydoc%{pybasever}
ln -s ./pydoc%{pybasever} %{buildroot}%{_bindir}/pydoc2
-ln -s ./pydoc2 %{buildroot}%{_bindir}/pydoc
mv %{buildroot}%{_bindir}/pygettext.py %{buildroot}%{_bindir}/pygettext%{pybasever}.py
ln -s ./pygettext%{pybasever}.py %{buildroot}%{_bindir}/pygettext2.py
-ln -s ./pygettext2.py %{buildroot}%{_bindir}/pygettext.py
mv %{buildroot}%{_bindir}/msgfmt.py %{buildroot}%{_bindir}/msgfmt%{pybasever}.py
ln -s ./msgfmt%{pybasever}.py %{buildroot}%{_bindir}/msgfmt2.py
-ln -s ./msgfmt2.py %{buildroot}%{_bindir}/msgfmt.py
mv %{buildroot}%{_bindir}/smtpd.py %{buildroot}%{_bindir}/smtpd%{pybasever}.py
ln -s ./smtpd%{pybasever}.py %{buildroot}%{_bindir}/smtpd2.py
-ln -s ./smtpd2.py %{buildroot}%{_bindir}/smtpd.py
# Fix for bug #136654
rm -f %{buildroot}%{pylibdir}/email/test/data/audiotest.au
%{buildroot}%{pylibdir}/test/audiotest.au
@@ -1545,6 +1519,19 @@ find %{buildroot} -type f -a -name "*.py" -print0 | \
#
https://bugzilla.redhat.com/show_bug.cgi?id=1703575
rm %{buildroot}%{_bindir}/*.py{c,o}
+# Remove all remaining unversioned commands
+#
https://fedoraproject.org/wiki/Changes/Python_means_Python3
+rm %{buildroot}%{_bindir}/python
+rm %{buildroot}%{_bindir}/python-config
+rm %{buildroot}%{_mandir}/*/python.1*
+rm %{buildroot}%{_libdir}/pkgconfig/python.pc
+%if %{with debug_build}
+rm %{buildroot}%{_bindir}/python-debug
+rm %{buildroot}%{_bindir}/python-debug-config
+rm %{buildroot}%{_libdir}/pkgconfig/python-debug.pc
+%endif
+
+
# ======================================================
# Running the upstream test suite
# ======================================================
@@ -1622,15 +1609,11 @@ CheckPython \
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc README
-%{_bindir}/pydoc*
+%{_bindir}/pydoc2*
%{_bindir}/%{python}
%{_bindir}/python%{pybasever}
%{_mandir}/*/python2*
-%files -n python-unversioned-command
-%{_bindir}/python
-%{_mandir}/*/python.1*
-
%files libs
%{!?_licensedir:%global license %%doc}
%license LICENSE
@@ -1792,7 +1775,6 @@ CheckPython \
%files devel
%{_libdir}/pkgconfig/python-%{pybasever}.pc
-%{_libdir}/pkgconfig/python.pc
%{_libdir}/pkgconfig/python2.pc
%{pylibdir}/config/*
%exclude %{pylibdir}/config/Makefile
@@ -1800,7 +1782,6 @@ CheckPython \
%{_includedir}/python%{pybasever}/*.h
%exclude %{_includedir}/python%{pybasever}/%{_pyconfig_h}
%doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit
-%{_bindir}/python-config
%{_bindir}/python2-config
%{_bindir}/python%{pybasever}-config
%{_libdir}/libpython%{pybasever}.so
@@ -1808,15 +1789,15 @@ CheckPython \
%files tools
%doc Tools/pynche/README.pynche
%{site_packages}/pynche
-%{_bindir}/smtpd*.py*
+%{_bindir}/smtpd2*.py
#
https://bugzilla.redhat.com/show_bug.cgi?id=1111275
%exclude %{_bindir}/2to3*
-%{_bindir}/idle*
-%{_bindir}/pynche*
-%{_bindir}/pygettext*.py*
-%{_bindir}/msgfmt*.py*
+%{_bindir}/idle2*
+%{_bindir}/pynche2*
+%{_bindir}/pygettext2*.py
+%{_bindir}/msgfmt2*.py
%{tools_dir}
%{demo_dir}
%{pylibdir}/Doc
@@ -1858,7 +1839,6 @@ CheckPython \
%files debug
# Analog of the core subpackage's files:
-%{_bindir}/python-debug
%{_bindir}/%{python}-debug
%{_bindir}/python%{pybasever}-debug
@@ -1953,11 +1933,9 @@ CheckPython \
# Analog of the -devel subpackage's files:
%dir %{pylibdir}/config-debug
%{_libdir}/pkgconfig/python-%{pybasever}-debug.pc
-%{_libdir}/pkgconfig/python-debug.pc
%{_libdir}/pkgconfig/python2-debug.pc
%{pylibdir}/config-debug/*
%{_includedir}/python%{pybasever}-debug/*.h
-%{_bindir}/python-debug-config
%{_bindir}/python2-debug-config
%{_bindir}/python%{pybasever}-debug-config
%{_libdir}/libpython%{pybasever}_d.so
@@ -1998,6 +1976,12 @@ CheckPython \
# ======================================================
%changelog
+* Fri Jul 12 2019 Miro Hronok <mhroncok(a)redhat.com> - 2.7.16-3
+-
https://fedoraproject.org/wiki/Changes/Python_means_Python3
+- The python-unversioned-command package is no longer Python 2, but 3
+- The python, pydoc, python-config, python-debug, idle, pygettext.py and
+ msgfmt.py commands are now in python3
+
* Fri Apr 26 2019 Tomas Orsava <torsava(a)redhat.com> - 2.7.16-2
- Remove pyc/pyo files from /usr/bin (#1703575)
- Update the macro that disables automatic bytecompilation to the new correct
commit b44a3f393357dab3775471423448b48674921d57
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Mon Jul 8 11:34:57 2019 +0200
Use %python_provide macros for backward compatibility provides
This allows easier compatibility back and forth once (and if)
https://fedoraproject.org/wiki/Changes/Python_means_Python3
happens. This is not the full implementation of the change,
as the python-unversioned package still stays.
The provides with %{?_isa} are added for backwards compatibility.
In theory, such provides should be added by %python_provide automatically,
but in practice the noarch python-unversioned-command subpackage prevents
it, see
https://bugzilla.redhat.com/show_bug.cgi?id=1705656
Also, conditionalize the tkinter provides for Fedora < 31 (nothing uses it).
diff --git a/python2.spec b/python2.spec
index a66847a..edfd0aa 100644
--- a/python2.spec
+++ b/python2.spec
@@ -193,6 +193,9 @@ BuildRequires: valgrind-devel
BuildRequires: zlib-devel
+# For %%python_provide
+BuildRequires: python-rpm-macros
+
%if %{with rpmwheels}
BuildRequires: python-setuptools-wheel
BuildRequires: python-pip-wheel
@@ -828,8 +831,8 @@ Provides: bundled(python2-pip) = 18.1
Provides: bundled(python2-setuptools) = 40.6.2
%endif
-Provides: python-libs = %{version}-%{release}
-Provides: python-libs%{?_isa} = %{version}-%{release}
+%{?python_provide:%python_provide python2-libs}
+%{?python_provide:%python_provide python2-libs%{?_isa}}
%description libs
This package contains files used to embed Python 2 into applications.
@@ -869,8 +872,8 @@ Requires: redhat-rpm-config
# package
Conflicts: %{python} < %{version}-%{release}
-Provides: python-devel = %{version}-%{release}
-Provides: python-devel%{?_isa} = %{version}-%{release}
+%{?python_provide:%python_provide python2-devel}
+%{?python_provide:%python_provide python2-devel%{?_isa}}
%description devel
This package contains libraries and header files used to build applications
@@ -883,8 +886,8 @@ Summary: A collection of development tools included with Python 2
Requires: %{name} = %{version}-%{release}
Requires: %{python}-tkinter = %{version}-%{release}
-Provides: python-tools = %{version}-%{release}
-Provides: python-tools%{?_isa} = %{version}-%{release}
+%{?python_provide:%python_provide python2-tools}
+%{?python_provide:%python_provide python2-tools%{?_isa}}
%description tools
This package includes several tools to help with the development of Python 2
@@ -897,12 +900,14 @@ Summary: A graphical user interface for the Python 2 scripting
language
Requires: %{name} = %{version}-%{release}
+%if 0%{?fedora} < 31
Provides: tkinter = %{version}-%{release}
Provides: tkinter%{?_isa} = %{version}-%{release}
Provides: tkinter2 = %{version}-%{release}
Provides: tkinter2%{?_isa} = %{version}-%{release}
-Provides: python-tkinter = %{version}-%{release}
-Provides: python-tkinter%{?_isa} = %{version}-%{release}
+%endif
+%{?python_provide:%python_provide python2-tkinter}
+%{?python_provide:%python_provide python2-tkinter%{?_isa}}
%description tkinter
@@ -918,8 +923,8 @@ Summary: The test modules from the main python2 package
Requires: %{name} = %{version}-%{release}
-Provides: python-test = %{version}-%{release}
-Provides: python-test%{?_isa} = %{version}-%{release}
+%{?python_provide:%python_provide python2-test}
+%{?python_provide:%python_provide python2-test%{?_isa}}
%description test
@@ -945,8 +950,8 @@ Requires: %{name}-test%{?_isa} = %{version}-%{release}
Requires: %{python}-tkinter%{?_isa} = %{version}-%{release}
Requires: %{name}-tools%{?_isa} = %{version}-%{release}
-Provides: python-debug = %{version}-%{release}
-Provides: python-debug%{?_isa} = %{version}-%{release}
+%{?python_provide:%python_provide python2-debug}
+%{?python_provide:%python_provide python2-debug%{?_isa}}
%description debug
python2-debug provides a version of the Python 2 runtime with numerous debugging
commit 1feb31bbed834e491ba61101dd2ae6dc2a0bc5a2
Author: Kalev Lember <klember(a)redhat.com>
Date: Mon Jun 10 13:56:00 2019 +0200
Update man page glob to allow man pages without compression
This happens when building as a flatpak module.
diff --git a/python2.spec b/python2.spec
index 89da154..a66847a 100644
--- a/python2.spec
+++ b/python2.spec
@@ -1624,7 +1624,7 @@ CheckPython \
%files -n python-unversioned-command
%{_bindir}/python
-%{_mandir}/*/python.1.*
+%{_mandir}/*/python.1*
%files libs
%{!?_licensedir:%global license %%doc}
commit dbbe8ca531cf5f2c2eed70af7ff4a5106b6eb241
Author: Tomas Orsava <torsava(a)redhat.com>
Date: Fri Apr 26 15:23:13 2019 -0400
Update the macro that disables automatic bytecompilation
.. to the new correct form (#1597664)
diff --git a/python2.spec b/python2.spec
index 3d1348a..89da154 100644
--- a/python2.spec
+++ b/python2.spec
@@ -70,11 +70,7 @@
# Disable automatic bytecompilation. The python2.7 binary is not yet
# available in /usr/bin when Python is built. Also, the bytecompilation fails
# on files that test invalid syntax.
-%undefine __brp_python_bytecompile
-# The above is broken now
-#
https://bugzilla.redhat.com/show_bug.cgi?id=1597664
-# This is an older non-standard way to disable the brp script, as a workaround
-%undefine py_auto_byte_compile
+%global __brp_python_bytecompile %{nil}
# We need to get a newer configure generated out of configure.in for the following
# patches:
@@ -1999,6 +1995,8 @@ CheckPython \
%changelog
* Fri Apr 26 2019 Tomas Orsava <torsava(a)redhat.com> - 2.7.16-2
- Remove pyc/pyo files from /usr/bin (#1703575)
+- Update the macro that disables automatic bytecompilation to the new correct
+ form (#1597664)
* Mon Mar 04 2019 Miro Hronok <mhroncok(a)redhat.com> - 2.7.16-1
- Update to 2.7.16 final
commit 5912c5a4e41ba5e01229899abf74ea3ef01cbb60
Author: Tomas Orsava <torsava(a)redhat.com>
Date: Fri Apr 26 15:22:39 2019 -0400
Remove pyc/pyo files from /usr/bin (#1703575)
diff --git a/python2.spec b/python2.spec
index a2b4405..3d1348a 100644
--- a/python2.spec
+++ b/python2.spec
@@ -126,7 +126,7 @@ Name: %{python}
#global prerel ...
%global upstream_version %{general_version}%{?prerel}
Version: %{general_version}%{?prerel:~%{prerel}}
-Release: 1%{?dist}
+Release: 2%{?dist}
License: Python
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
Provides: python(abi) = %{pybasever}
@@ -1539,6 +1539,10 @@ find %{buildroot} -type f -a -name "*.py" -print0 | \
/usr/bin/chmod 755 %{buildroot}%{_libdir}/libpython%{pybasever}_d.so.1.0
%endif
+# Remove pyc/pyo files from /usr/bin
+# They are not needed, and due to them, the resulting RPM is not multilib-clean
+#
https://bugzilla.redhat.com/show_bug.cgi?id=1703575
+rm %{buildroot}%{_bindir}/*.py{c,o}
# ======================================================
# Running the upstream test suite
@@ -1993,6 +1997,9 @@ CheckPython \
# ======================================================
%changelog
+* Fri Apr 26 2019 Tomas Orsava <torsava(a)redhat.com> - 2.7.16-2
+- Remove pyc/pyo files from /usr/bin (#1703575)
+
* Mon Mar 04 2019 Miro Hronok <mhroncok(a)redhat.com> - 2.7.16-1
- Update to 2.7.16 final
commit c045a2b9f16a15026d43eaa5f07323fa742a20b0
Author: Mr. Clean <mr@clean>
Date: Fri Apr 26 11:27:01 2019 +0200
Clean trailing whitespace
diff --git a/python2.spec b/python2.spec
index d116739..a2b4405 100644
--- a/python2.spec
+++ b/python2.spec
@@ -2131,7 +2131,7 @@ Resolves: rhbz#1496757
- Change fixed Obsoletes version with a dynamic one (rhbz#1457336)
* Thu May 18 2017 Karsten Hopp <karsten(a)redhat.com> - 2.7.13-10
-- revert logic for modularity patch and enable gdbm for modularity
+- revert logic for modularity patch and enable gdbm for modularity
* Tue May 16 2017 Tomas Orsava <torsava(a)redhat.com> - 2.7.13-9
- Added a dependency to the devel subpackage on python3-rpm-generators which
commit 6edbcdead48f210b9cedf6ae8eee7e2b965f6614
Author: Victor Stinner <vstinner(a)redhat.com>
Date: Fri Mar 8 10:53:02 2019 +0100
Remove 00153-fix-test_gdb-noise.patch
Patch fixed upstream by ignoring all messages starting
with 'warning: ':
https://github.com/python/cpython/commit/8420cd29053106f97b7d27dcc288882f...
Removed patch added by:
commit b0a6ae18b357c63aa7594fb622ca8e42cecb3f63
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Fri Apr 13 10:36:12 2012 -0400
2.7.3-1
* Wed Apr 11 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-1
- 2.7.3: (...) fix test_gdb (patch 153) (...)
diff --git a/00153-fix-test_gdb-noise.patch b/00153-fix-test_gdb-noise.patch
deleted file mode 100644
index 8884d4c..0000000
--- a/00153-fix-test_gdb-noise.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- Lib/test/test_gdb.py.old 2012-04-11 21:04:01.367073855 -0400
-+++ Lib/test/test_gdb.py 2012-04-12 08:52:58.320288761 -0400
-@@ -211,6 +211,10 @@
- # ignore all warnings
- 'warning: ',
- )
-+ ignore_patterns += ('warning: Unable to open',
-+ 'Missing separate debuginfo for',
-+ 'Try: yum --disablerepo=',
-+ 'Undefined set print command')
- for line in errlines:
- if not line:
- continue
diff --git a/python2.spec b/python2.spec
index faee589..d116739 100644
--- a/python2.spec
+++ b/python2.spec
@@ -615,13 +615,6 @@ Patch146: 00146-hashlib-fips.patch
# Sent upstream as
http://bugs.python.org/issue14785
Patch147: 00147-add-debug-malloc-stats.patch
-# 00153 #
-# Strip out lines of the form "warning: Unable to open ..." from gdb's
stderr
-# when running test_gdb.py; also cope with change to gdb in F17 onwards in
-# which values are printed as "v@entry" rather than just "v":
-# Not yet sent upstream
-Patch153: 00153-fix-test_gdb-noise.patch
-
# 00155 #
# Avoid allocating thunks in ctypes unless absolutely necessary, to avoid
# generating SELinux denials on "import ctypes" and "import uuid"
when
@@ -1077,7 +1070,6 @@ rm -r Modules/zlib || exit 1
%endif
#patch146 -p1
%patch147 -p1
-%patch153 -p0
%patch155 -p1
%patch156 -p1
%patch157 -p1
commit ed49db74fbeb7d5a27f6b992d0a9bfb5b03ce11f
Author: Victor Stinner <vstinner(a)redhat.com>
Date: Fri Mar 8 10:33:08 2019 +0100
Remove 00190-gdb-py-bt-dont-raise-exception-from-eval.patch
The bug has been fixed upstream in Python 2.7.16:
*
https://github.com/python/cpython/commit/aadb44ee98bc73bc5132acea5848ac6a...
*
https://bugs.python.org/issue34989
Removed patch was added by:
commit c86b2c6e570b509a2763391457ddba46b1e0018c
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Tue Oct 8 14:04:54 2013 +0200
Fix processing gdb py-bt command in eval calls.
Resolves: rhbz#1008154
diff --git a/00190-gdb-py-bt-dont-raise-exception-from-eval.patch
b/00190-gdb-py-bt-dont-raise-exception-from-eval.patch
deleted file mode 100644
index df1f4e7..0000000
--- a/00190-gdb-py-bt-dont-raise-exception-from-eval.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py
-index 9def56e..c0df208 100755
---- a/Tools/gdb/libpython.py
-+++ b/Tools/gdb/libpython.py
-@@ -939,6 +939,9 @@ class PyFrameObjectPtr(PyObjectPtr):
- if self.is_optimized_out():
- return '(frame information optimized out)'
-
-+ if self.filename() == '<string>':
-+ return '(in an eval block)'
-+
- lineno = self.current_line_num()
- if lineno is None:
- return '(failed to get frame line number)'
diff --git a/python2.spec b/python2.spec
index ab20ad5..faee589 100644
--- a/python2.spec
+++ b/python2.spec
@@ -740,12 +740,6 @@ Patch187: 00187-add-RPATH-to-pyexpat.patch
# /usr/share/python-wheels
Patch189: 00189-use-rpm-wheels.patch
-# 00190 #
-# Fixes gdb py-bt command not to raise exception while processing
-# statements from eval
-# rhbz#1008154 (patch by Attila Fazekas)
-Patch190: 00190-gdb-py-bt-dont-raise-exception-from-eval.patch
-
# 00191 #
# Disabling NOOP test as it fails without internet connection
Patch191: 00191-disable-NOOP.patch
@@ -1104,7 +1098,6 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
rm Lib/ensurepip/_bundled/*.whl
%endif
-%patch190 -p1
%patch191 -p1
%patch193 -p1
%patch289 -p1
commit ef338dc7d01513c9ee13cb82bddfe20629dc916e
Author: Victor Stinner <vstinner(a)redhat.com>
Date: Mon Feb 11 11:35:49 2019 +0100
tests.yml now installs also glibc-all-langpacks
Install all locales to not skip test_locale tests.
diff --git a/tests/tests.yml b/tests/tests.yml
index d796909..a31cb8b 100644
--- a/tests/tests.yml
+++ b/tests/tests.yml
@@ -16,3 +16,4 @@
- virtualenv
- python3-tox
- python2-devel
+ - glibc-all-langpacks # for locale tests
commit a5e818f21770e07bd64a181cc6b967b34c2c1f78
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Mon Mar 4 15:08:29 2019 +0100
Update to 2.7.16 final
diff --git a/python2.spec b/python2.spec
index cf82c5f..ab20ad5 100644
--- a/python2.spec
+++ b/python2.spec
@@ -123,7 +123,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python2-docs when changing this:
%global general_version %{pybasever}.16
-%global prerel rc1
+#global prerel ...
%global upstream_version %{general_version}%{?prerel}
Version: %{general_version}%{?prerel:~%{prerel}}
Release: 1%{?dist}
@@ -2008,6 +2008,9 @@ CheckPython \
# ======================================================
%changelog
+* Mon Mar 04 2019 Miro Hronok <mhroncok(a)redhat.com> - 2.7.16-1
+- Update to 2.7.16 final
+
* Tue Feb 19 2019 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.16~rc1-1
- Update to 2.7.16rc1
diff --git a/sources b/sources
index 95b9608..f0a0c91 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (Python-2.7.16rc1.tar.xz) =
d06edb29d6517c9ff7c5c31f587d6dbe32c420ab11170fdedb5e0207c45423756407d01764a0666f8605eaf629f44f1d5400714224e1a958722b8bee3c3c24a2
+SHA512 (Python-2.7.16.tar.xz) =
16e814e8dcffc707b595ca2919bd2fa3db0d15794c63d977364652c4a5b92e90e72b8c9e1cc83b5020398bd90a1b397dbdd7cb931c49f1aa4af6ef95414b43e0
commit 5d0f9111df1767735cb2ce4c863859baf8e64cdc
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Fri Mar 1 15:10:33 2019 +0100
Update bundled pip/setuptools versions
diff --git a/python2.spec b/python2.spec
index a81496e..cf82c5f 100644
--- a/python2.spec
+++ b/python2.spec
@@ -841,8 +841,8 @@ Requires: gdbm%{?_isa} >= 1:1.13
Requires: python-setuptools-wheel
Requires: python-pip-wheel
%else
-Provides: bundled(python2-pip) = 9.0.3
-Provides: bundled(python2-setuptools) = 39.0.1
+Provides: bundled(python2-pip) = 18.1
+Provides: bundled(python2-setuptools) = 40.6.2
%endif
Provides: python-libs = %{version}-%{release}
commit 75a07030663b6ff3be2a80d7ea6e3106bd17b039
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Tue Feb 19 16:06:24 2019 +0100
Rebase to 2.7.16rc1
diff --git a/00102-2.7.13-lib64.patch b/00102-2.7.13-lib64.patch
index 5a87d03..02d3f6c 100644
--- a/00102-2.7.13-lib64.patch
+++ b/00102-2.7.13-lib64.patch
@@ -20,10 +20,10 @@ index b9f1c6c..7b23714 100644
'scripts': '$base/bin',
'data' : '$base',
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
-index 068d1ba..3e7f077 100644
+index 031f809..ec5d584 100644
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
-@@ -119,8 +119,12 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
+@@ -120,8 +120,12 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
prefix = plat_specific and EXEC_PREFIX or PREFIX
if os.name == "posix":
@@ -59,10 +59,10 @@ index c360802..868b7cb 100644
return sitepackages
diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py
-index d9a9324..e411e5c 100644
+index b4384ee..349f688 100644
--- a/Lib/test/test_site.py
+++ b/Lib/test/test_site.py
-@@ -235,17 +235,20 @@ class HelperFunctionsTests(unittest.TestCase):
+@@ -254,17 +254,20 @@ class HelperFunctionsTests(unittest.TestCase):
self.assertEqual(dirs[0], wanted)
elif os.sep == '/':
# OS X, Linux, FreeBSD, etc
@@ -86,12 +86,12 @@ index d9a9324..e411e5c 100644
+ wanted = os.path.join('xoxo', 'lib64',
'site-packages')
self.assertEqual(dirs[1], wanted)
- class PthFile(object):
+ def test_no_home_directory(self):
diff --git a/Makefile.pre.in b/Makefile.pre.in
-index adae76b..ecb27f3 100644
+index 4f59dd3..877698c 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
-@@ -111,7 +111,7 @@ LIBDIR= @libdir@
+@@ -110,7 +110,7 @@ LIBDIR= @libdir@
MANDIR= @mandir@
INCLUDEDIR= @includedir@
CONFINCLUDEDIR= $(exec_prefix)/include
@@ -101,10 +101,10 @@ index adae76b..ecb27f3 100644
# Detailed destination directories
BINLIBDEST= $(LIBDIR)/python$(VERSION)
diff --git a/Modules/Setup.dist b/Modules/Setup.dist
-index fbfa1c1..138fb33 100644
+index 2cf35a9..c4c88cb 100644
--- a/Modules/Setup.dist
+++ b/Modules/Setup.dist
-@@ -231,7 +231,7 @@
+@@ -231,7 +231,7 @@ crypt cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some
systems
# Some more UNIX dependent modules -- off by default, since these
# are not supported by all UNIX systems:
@@ -130,7 +130,7 @@ index fbfa1c1..138fb33 100644
+zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib64 -lz
# Interface to the Expat XML parser
- #
+ # More information on Expat can be found at
www.libexpat.org.
diff --git a/Modules/getpath.c b/Modules/getpath.c
index fd33a01..c5c86fd 100644
--- a/Modules/getpath.c
@@ -154,7 +154,7 @@ index fd33a01..c5c86fd 100644
/* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */
diff --git a/setup.py b/setup.py
-index 99ac359..859b6c4 100644
+index 0288a6b..7905f6f 100644
--- a/setup.py
+++ b/setup.py
@@ -456,7 +456,7 @@ class PyBuildExt(build_ext):
diff --git a/00189-use-rpm-wheels.patch b/00189-use-rpm-wheels.patch
index d7428f8..76a1324 100644
--- a/00189-use-rpm-wheels.patch
+++ b/00189-use-rpm-wheels.patch
@@ -1,5 +1,5 @@
diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py
-index 89ed1ef..8008222 100644
+index 5021ebf..1903cc0 100644
--- a/Lib/ensurepip/__init__.py
+++ b/Lib/ensurepip/__init__.py
@@ -1,9 +1,10 @@
@@ -14,15 +14,14 @@ index 89ed1ef..8008222 100644
import shutil
import sys
import tempfile
-@@ -11,10 +12,20 @@ import tempfile
-
+@@ -12,9 +13,19 @@ import tempfile
__all__ = ["version", "bootstrap"]
-+_WHEEL_DIR = "/usr/share/python-wheels/"
--_SETUPTOOLS_VERSION = "39.0.1"
+-_SETUPTOOLS_VERSION = "40.6.2"
++_WHEEL_DIR = "/usr/share/python-wheels/"
--_PIP_VERSION = "9.0.3"
+-_PIP_VERSION = "18.1"
+def _get_most_recent_wheel_version(pkg):
+ prefix = os.path.join(_WHEEL_DIR, "{}-".format(pkg))
+ suffix = "-py2.py3-none-any.whl"
@@ -41,8 +40,8 @@ index 89ed1ef..8008222 100644
sys.path = additional_paths + sys.path
# Install the bundled software
-- import pip
-- return pip.main(args)
+- import pip._internal
+- return pip._internal.main(args)
+ try:
+ # pip 10
+ from pip._internal import main
diff --git a/00190-gdb-py-bt-dont-raise-exception-from-eval.patch
b/00190-gdb-py-bt-dont-raise-exception-from-eval.patch
index 4ef2a5d..df1f4e7 100644
--- a/00190-gdb-py-bt-dont-raise-exception-from-eval.patch
+++ b/00190-gdb-py-bt-dont-raise-exception-from-eval.patch
@@ -1,11 +1,14 @@
---- Python-2.7.5-orig/Tools/gdb/libpython.py 2013-05-12 03:32:54.000000000 +0000
-+++ Python-2.7.5-orig/Tools/gdb/libpython.py 2013-09-15 09:56:25.494000000 +0000
-@@ -887,6 +887,8 @@
- newline character'''
+diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py
+index 9def56e..c0df208 100755
+--- a/Tools/gdb/libpython.py
++++ b/Tools/gdb/libpython.py
+@@ -939,6 +939,9 @@ class PyFrameObjectPtr(PyObjectPtr):
if self.is_optimized_out():
return '(frame information optimized out)'
+
+ if self.filename() == '<string>':
+ return '(in an eval block)'
- filename = self.filename()
- try:
- f = open(filename, 'r')
++
+ lineno = self.current_line_num()
+ if lineno is None:
+ return '(failed to get frame line number)'
diff --git a/00309-shutil-spawn-subprocess.patch b/00309-shutil-spawn-subprocess.patch
deleted file mode 100644
index adc56c4..0000000
--- a/00309-shutil-spawn-subprocess.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From add531a1e55b0a739b0f42582f1c9747e5649ace Mon Sep 17 00:00:00 2001
-From: Benjamin Peterson <benjamin(a)python.org>
-Date: Tue, 28 Aug 2018 22:12:56 -0700
-Subject: [PATCH] closes bpo-34540: Convert shutil._call_external_zip to use
- subprocess rather than distutils.spawn.
-
----
- Lib/shutil.py | 16 ++++++++++------
- .../2018-08-28-22-11-54.bpo-34540.gfQ0TM.rst | 3 +++
- 2 files changed, 13 insertions(+), 6 deletions(-)
- create mode 100644 Misc/NEWS.d/next/Security/2018-08-28-22-11-54.bpo-34540.gfQ0TM.rst
-
-diff --git a/Lib/shutil.py b/Lib/shutil.py
-index 3462f7c5e91c..0ab1a06f5260 100644
---- a/Lib/shutil.py
-+++ b/Lib/shutil.py
-@@ -413,17 +413,21 @@ def _set_uid_gid(tarinfo):
-
- return archive_name
-
--def _call_external_zip(base_dir, zip_filename, verbose=False, dry_run=False):
-+def _call_external_zip(base_dir, zip_filename, verbose, dry_run, logger):
- # XXX see if we want to keep an external call here
- if verbose:
- zipoptions = "-r"
- else:
- zipoptions = "-rq"
-- from distutils.errors import DistutilsExecError
-- from distutils.spawn import spawn
-+ cmd = ["zip", zipoptions, zip_filename, base_dir]
-+ if logger is not None:
-+ logger.info(' '.join(cmd))
-+ if dry_run:
-+ return
-+ import subprocess
- try:
-- spawn(["zip", zipoptions, zip_filename, base_dir], dry_run=dry_run)
-- except DistutilsExecError:
-+ subprocess.check_call(cmd)
-+ except subprocess.CalledProcessError:
- # XXX really should distinguish between "couldn't find
- # external 'zip' command" and "zip failed".
- raise ExecError, \
-@@ -458,7 +462,7 @@ def _make_zipfile(base_name, base_dir, verbose=0, dry_run=0,
logger=None):
- zipfile = None
-
- if zipfile is None:
-- _call_external_zip(base_dir, zip_filename, verbose, dry_run)
-+ _call_external_zip(base_dir, zip_filename, verbose, dry_run, logger)
- else:
- if logger is not None:
- logger.info("creating '%s' and adding '%s' to
it",
-diff --git a/Misc/NEWS.d/next/Security/2018-08-28-22-11-54.bpo-34540.gfQ0TM.rst
b/Misc/NEWS.d/next/Security/2018-08-28-22-11-54.bpo-34540.gfQ0TM.rst
-new file mode 100644
-index 000000000000..4f686962a87b
---- /dev/null
-+++ b/Misc/NEWS.d/next/Security/2018-08-28-22-11-54.bpo-34540.gfQ0TM.rst
-@@ -0,0 +1,3 @@
-+When ``shutil.make_archive`` falls back to the external ``zip`` problem, it
-+uses :mod:`subprocess` to invoke it rather than :mod:`distutils.spawn`. This
-+closes a possible shell injection vector.
diff --git a/00310-use-xml-sethashsalt-in-elementtree.patch
b/00310-use-xml-sethashsalt-in-elementtree.patch
deleted file mode 100644
index 27d8d1c..0000000
--- a/00310-use-xml-sethashsalt-in-elementtree.patch
+++ /dev/null
@@ -1,85 +0,0 @@
-From 554c48934c599b3fb04c73d740bba1a745b89b41 Mon Sep 17 00:00:00 2001
-From: Christian Heimes <christian(a)python.org>
-Date: Tue, 18 Sep 2018 14:38:58 +0200
-Subject: [PATCH] [2.7] bpo-34623: Use XML_SetHashSalt in _elementtree
- (GH-9146)
-
-The C accelerated _elementtree module now initializes hash randomization
-salt from _Py_HashSecret instead of libexpat's default CPRNG.
-
-Signed-off-by: Christian Heimes <christian(a)python.org>
-
-https://bugs.python.org/issue34623.
-(cherry picked from commit cb5778f00ce48631c7140f33ba242496aaf7102b)
-
-Co-authored-by: Christian Heimes <christian(a)python.org>
----
- Include/pyexpat.h | 4 +++-
- .../next/Security/2018-09-10-16-05-39.bpo-34623.Ua9jMv.rst | 2 ++
- Modules/_elementtree.c | 5 +++++
- Modules/pyexpat.c | 5 +++++
- 4 files changed, 15 insertions(+), 1 deletion(-)
- create mode 100644 Misc/NEWS.d/next/Security/2018-09-10-16-05-39.bpo-34623.Ua9jMv.rst
-
-diff --git a/Include/pyexpat.h b/Include/pyexpat.h
-index 5340ef5fa386..3fc5fa54da63 100644
---- a/Include/pyexpat.h
-+++ b/Include/pyexpat.h
-@@ -3,7 +3,7 @@
-
- /* note: you must import expat.h before importing this module! */
-
--#define PyExpat_CAPI_MAGIC "pyexpat.expat_CAPI 1.0"
-+#define PyExpat_CAPI_MAGIC "pyexpat.expat_CAPI 1.1"
- #define PyExpat_CAPSULE_NAME "pyexpat.expat_CAPI"
-
- struct PyExpat_CAPI
-@@ -43,6 +43,8 @@ struct PyExpat_CAPI
- XML_Parser parser, XML_UnknownEncodingHandler handler,
- void *encodingHandlerData);
- void (*SetUserData)(XML_Parser parser, void *userData);
-+ /* might be none for expat < 2.1.0 */
-+ int (*SetHashSalt)(XML_Parser parser, unsigned long hash_salt);
- /* always add new stuff to the end! */
- };
-
-diff --git a/Misc/NEWS.d/next/Security/2018-09-10-16-05-39.bpo-34623.Ua9jMv.rst
b/Misc/NEWS.d/next/Security/2018-09-10-16-05-39.bpo-34623.Ua9jMv.rst
-new file mode 100644
-index 000000000000..31ad92ef8582
---- /dev/null
-+++ b/Misc/NEWS.d/next/Security/2018-09-10-16-05-39.bpo-34623.Ua9jMv.rst
-@@ -0,0 +1,2 @@
-+The C accelerated _elementtree module now initializes hash randomization
-+salt from _Py_HashSecret instead of libexpat's default CSPRNG.
-diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c
-index f7f992dd3a95..b38e0ab329c7 100644
---- a/Modules/_elementtree.c
-+++ b/Modules/_elementtree.c
-@@ -2574,6 +2574,11 @@ xmlparser(PyObject* self_, PyObject* args, PyObject* kw)
- PyErr_NoMemory();
- return NULL;
- }
-+ /* expat < 2.1.0 has no XML_SetHashSalt() */
-+ if (EXPAT(SetHashSalt) != NULL) {
-+ EXPAT(SetHashSalt)(self->parser,
-+ (unsigned long)_Py_HashSecret.prefix);
-+ }
-
- ALLOC(sizeof(XMLParserObject), "create expatparser");
-
-diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c
-index 2b4d31293c64..1f8c0d70a559 100644
---- a/Modules/pyexpat.c
-+++ b/Modules/pyexpat.c
-@@ -2042,6 +2042,11 @@ MODULE_INITFUNC(void)
- capi.SetProcessingInstructionHandler = XML_SetProcessingInstructionHandler;
- capi.SetUnknownEncodingHandler = XML_SetUnknownEncodingHandler;
- capi.SetUserData = XML_SetUserData;
-+#if XML_COMBINED_VERSION >= 20100
-+ capi.SetHashSalt = XML_SetHashSalt;
-+#else
-+ capi.SetHashSalt = NULL;
-+#endif
-
- /* export using capsule */
- capi_object = PyCapsule_New(&capi, PyExpat_CAPSULE_NAME, NULL);
diff --git a/python-2.7.1-config.patch b/python-2.7.1-config.patch
index 5c8bd43..4b076db 100644
--- a/python-2.7.1-config.patch
+++ b/python-2.7.1-config.patch
@@ -1,5 +1,7 @@
---- Python-2.7.4/Modules/Setup.dist.rhconfig 2013-04-06 16:02:34.000000000 +0200
-+++ Python-2.7.4/Modules/Setup.dist 2013-04-08 10:05:16.369985654 +0200
+diff --git a/Modules/Setup.dist b/Modules/Setup.dist
+index bbc9222..2cf35a9 100644
+--- a/Modules/Setup.dist
++++ b/Modules/Setup.dist
@@ -153,7 +153,7 @@ GLHACK=-Dclear=__GLclear
# modules are to be built as shared libraries (see above for more
# detail; also note that *static* reverses this effect):
@@ -9,7 +11,7 @@
# GNU readline. Unlike previous Python incarnations, GNU readline is
# now incorporated in an optional module, configured in the Setup file
-@@ -163,77 +163,77 @@ GLHACK=-Dclear=__GLclear
+@@ -163,33 +163,33 @@ GLHACK=-Dclear=__GLclear
# it, depending on your system -- see the GNU readline instructions.
# It's okay for this to be a shared library, too.
@@ -59,9 +61,7 @@
# Standard I/O baseline
#_io -I$(srcdir)/Modules/_io _io/bufferedio.c _io/bytesio.c _io/fileio.c _io/iobase.c
_io/_iomodule.c _io/stringio.c _io/textio.c
-
-
- # Modules with some UNIX dependencies -- on by default:
+@@ -199,41 +199,41 @@ GLHACK=-Dclear=__GLclear
# (If you have a really backward UNIX, select and socket may not be
# supported...)
@@ -117,7 +117,7 @@
# Multimedia modules -- off by default.
-@@ -238,8 +238,8 @@ GLHACK=-Dclear=__GLclear
+@@ -241,8 +241,8 @@ GLHACK=-Dclear=__GLclear
# #993173 says audioop works on 64-bit platforms, though.
# These represent audio samples or images as strings:
@@ -128,7 +128,7 @@
# Note that the _md5 and _sha modules are normally only built if the
-@@ -249,14 +249,14 @@ GLHACK=-Dclear=__GLclear
+@@ -252,14 +252,14 @@ GLHACK=-Dclear=__GLclear
# Message-Digest Algorithm, described in RFC 1321. The necessary files
# md5.c and md5.h are included here.
@@ -147,7 +147,7 @@
# SGI IRIX specific modules -- off by default.
-@@ -303,12 +303,12 @@ GLHACK=-Dclear=__GLclear
+@@ -306,12 +306,12 @@ GLHACK=-Dclear=__GLclear
# A Linux specific module -- off by default; this may also work on
# some *BSDs.
@@ -162,7 +162,7 @@
# The _tkinter module.
-@@ -323,7 +323,7 @@ GLHACK=-Dclear=__GLclear
+@@ -326,7 +326,7 @@ GLHACK=-Dclear=__GLclear
# every system.
# *** Always uncomment this (leave the leading underscore in!):
@@ -171,7 +171,7 @@
# *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
# -L/usr/local/lib \
# *** Uncomment and edit to reflect where your Tcl/Tk headers are:
-@@ -333,7 +333,7 @@ GLHACK=-Dclear=__GLclear
+@@ -336,7 +336,7 @@ GLHACK=-Dclear=__GLclear
# *** Or uncomment this for Solaris:
# -I/usr/openwin/include \
# *** Uncomment and edit for Tix extension only:
@@ -180,7 +180,7 @@
# *** Uncomment and edit for BLT extension only:
# -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \
# *** Uncomment and edit for PIL (TkImaging) extension only:
-@@ -342,7 +342,7 @@ GLHACK=-Dclear=__GLclear
+@@ -345,7 +345,7 @@ GLHACK=-Dclear=__GLclear
# *** Uncomment and edit for TOGL extension only:
# -DWITH_TOGL togl.c \
# *** Uncomment and edit to reflect your Tcl/Tk versions:
@@ -189,7 +189,7 @@
# *** Uncomment and edit to reflect where your X11 libraries are:
# -L/usr/X11R6/lib \
# *** Or uncomment this for Solaris:
-@@ -352,7 +352,7 @@ GLHACK=-Dclear=__GLclear
+@@ -355,7 +355,7 @@ GLHACK=-Dclear=__GLclear
# *** Uncomment for AIX:
# -lld \
# *** Always uncomment this; X11 libraries to link with:
@@ -198,7 +198,7 @@
# Lance Ellinghaus's syslog module
#syslog syslogmodule.c # syslog daemon interface
-@@ -374,7 +374,7 @@ GLHACK=-Dclear=__GLclear
+@@ -377,7 +377,7 @@ GLHACK=-Dclear=__GLclear
# it is a highly experimental and dangerous device for calling
# *arbitrary* C functions in *arbitrary* shared libraries:
@@ -207,7 +207,7 @@
# Modules that provide persistent dictionary-like semantics. You will
-@@ -397,7 +397,7 @@ GLHACK=-Dclear=__GLclear
+@@ -400,7 +400,7 @@ GLHACK=-Dclear=__GLclear
#
# First, look at Setup.config; configure may have set this for you.
@@ -216,7 +216,7 @@
# Sleepycat Berkeley DB interface.
-@@ -412,11 +412,9 @@ GLHACK=-Dclear=__GLclear
+@@ -415,11 +415,9 @@ GLHACK=-Dclear=__GLclear
#
# Edit the variables DB and DBLIBVERto point to the db top directory
# and the subdirectory of PORT where you built it.
@@ -231,7 +231,7 @@
# Historical Berkeley DB 1.85
#
-@@ -431,14 +430,14 @@ GLHACK=-Dclear=__GLclear
+@@ -434,14 +432,14 @@ GLHACK=-Dclear=__GLclear
# Helper module for various ascii-encoders
@@ -250,7 +250,7 @@
# Lee Busby's SIGFPE modules.
-@@ -461,7 +460,7 @@ GLHACK=-Dclear=__GLclear
+@@ -464,7 +462,7 @@ GLHACK=-Dclear=__GLclear
# Andrew Kuchling's zlib module.
# This require zlib 1.1.3 (or later).
# See
http://www.gzip.org/zlib/
@@ -258,20 +258,21 @@
+zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
# Interface to the Expat XML parser
- #
-@@ -480,14 +479,14 @@ GLHACK=-Dclear=__GLclear
+ # More information on Expat can be found at
www.libexpat.org.
+@@ -475,14 +473,14 @@ GLHACK=-Dclear=__GLclear
# Hye-Shik Chang's CJKCodecs
# multibytecodec is required for all the other CJK codec modules
-#_multibytecodec cjkcodecs/multibytecodec.c
-+_multibytecodec cjkcodecs/multibytecodec.c
-
+-
-#_codecs_cn cjkcodecs/_codecs_cn.c
-#_codecs_hk cjkcodecs/_codecs_hk.c
-#_codecs_iso2022 cjkcodecs/_codecs_iso2022.c
-#_codecs_jp cjkcodecs/_codecs_jp.c
-#_codecs_kr cjkcodecs/_codecs_kr.c
-#_codecs_tw cjkcodecs/_codecs_tw.c
++_multibytecodec cjkcodecs/multibytecodec.c
++
+_codecs_cn cjkcodecs/_codecs_cn.c
+_codecs_hk cjkcodecs/_codecs_hk.c
+_codecs_iso2022 cjkcodecs/_codecs_iso2022.c
diff --git a/python2.spec b/python2.spec
index b476bb5..a81496e 100644
--- a/python2.spec
+++ b/python2.spec
@@ -122,8 +122,11 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
# Remember to also rebase python2-docs when changing this:
-Version: 2.7.15
-Release: 14%{?dist}
+%global general_version %{pybasever}.16
+%global prerel rc1
+%global upstream_version %{general_version}%{?prerel}
+Version: %{general_version}%{?prerel:~%{prerel}}
+Release: 1%{?dist}
License: Python
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
Provides: python(abi) = %{pybasever}
@@ -154,8 +157,7 @@ BuildRequires: readline-devel
BuildRequires: sqlite-devel
BuildRequires: tcl-devel
-#
https://bugzilla.redhat.com/show_bug.cgi?id=1609291
-BuildRequires: compat-openssl10-devel
+BuildRequires: openssl-devel
# For the nis module
BuildRequires: libnsl2-devel
@@ -221,7 +223,7 @@ Recommends: python2-pip
# Source code and patches
# =======================
-Source:
https://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz
+Source:
https://www.python.org/ftp/python/%{version}/Python-%{upstream_version}.t...
# Work around bug 562906 until it's fixed in rpm-build by providing a fixed
# version of pythondeps.sh:
@@ -760,20 +762,6 @@ Patch193: 00193-enable-loading-sqlite-extensions.patch
# (we handle it it in Setup.dist, see Patch0)
Patch289: 00289-disable-nis-detection.patch
-# 00309 #
-# CVE-2018-1000802
-# shutil._call_external_zip to use subprocess instead of distutils.spawn
-# rhbz#1631662
-# Fixed upstream
https://bugs.python.org/issue34540
-Patch309: 00309-shutil-spawn-subprocess.patch
-
-# 00310 #
-# CVE-2018-14647
-# Use XML_SetHashSalt in _elementtree
-# rhbz#1631822
-# Fixed upstream
https://bugs.python.org/issue34623
-Patch310: 00310-use-xml-sethashsalt-in-elementtree.patch
-
# (New patches go here ^^^)
#
# When adding new patches to "python2" and "python3" in Fedora, EL,
etc.,
@@ -1001,7 +989,7 @@ load its own extensions.
# ======================================================
%prep
-%setup -q -n Python-%{version}
+%setup -q -n Python-%{upstream_version}
%if 0%{?with_systemtap}
# Provide an example of usage of the tapset:
@@ -1120,9 +1108,6 @@ rm Lib/ensurepip/_bundled/*.whl
%patch191 -p1
%patch193 -p1
%patch289 -p1
-%patch309 -p1
-%patch310 -p1
-
%if 0%{?_module_build}
%patch4000 -p1
@@ -1581,6 +1566,8 @@ CheckPython() {
BinaryName=$2
ConfDir=$(pwd)/build/$ConfName
+ export OPENSSL_CONF=/non-existing-file
+
echo STARTING: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName
# Note that we're running the tests using the version of the code in the
@@ -1666,7 +1653,7 @@ CheckPython \
%{dynload_dir}/_sha512module.so
%{dynload_dir}/_shamodule.so
-%{dynload_dir}/Python-%{version}-py%{pybasever}.egg-info
+%{dynload_dir}/Python-%{upstream_version}-py%{pybasever}.egg-info
%{dynload_dir}/_bisectmodule.so
%{dynload_dir}/_bsddb.so
%{dynload_dir}/_codecs_cn.so
@@ -2021,6 +2008,9 @@ CheckPython \
# ======================================================
%changelog
+* Tue Feb 19 2019 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.16~rc1-1
+- Update to 2.7.16rc1
+
* Sun Feb 17 2019 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 2.7.15-14
- Rebuild for readline 8.0
diff --git a/sources b/sources
index e5dbb80..95b9608 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (Python-2.7.15.tar.xz) =
27ea43eb45fc68f3d2469d5f07636e10801dee11635a430ec8ec922ed790bb426b072da94df885e4dfa1ea8b7a24f2f56dd92f9b0f51e162330f161216bd6de6
+SHA512 (Python-2.7.16rc1.tar.xz) =
d06edb29d6517c9ff7c5c31f587d6dbe32c420ab11170fdedb5e0207c45423756407d01764a0666f8605eaf629f44f1d5400714224e1a958722b8bee3c3c24a2
commit b13073ac76772fe323544c4c94b7576dce3372be
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Thu Feb 28 09:45:47 2019 +0100
Fedora CI: Workaround for fedora-ci/general #31
https://pagure.io/fedora-ci/general/issue/31
diff --git a/tests/tests.yml b/tests/tests.yml
index fc8183f..d796909 100644
--- a/tests/tests.yml
+++ b/tests/tests.yml
@@ -13,6 +13,6 @@
run: METHOD=virtualenv VERSION=2.7 ./venv.sh
required_packages:
- gcc
- - /usr/bin/virtualenv
+ - virtualenv
- python3-tox
- python2-devel
commit 789267ab769ad7b28a0abeed95c5ac4cba9794b2
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Sun Feb 17 09:30:52 2019 +0100
Rebuild for readline 8.0
diff --git a/python2.spec b/python2.spec
index 8845550..b476bb5 100644
--- a/python2.spec
+++ b/python2.spec
@@ -123,7 +123,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python2-docs when changing this:
Version: 2.7.15
-Release: 13%{?dist}
+Release: 14%{?dist}
License: Python
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
Provides: python(abi) = %{pybasever}
@@ -2021,6 +2021,9 @@ CheckPython \
# ======================================================
%changelog
+* Sun Feb 17 2019 Igor Gnatenko <ignatenkobrain(a)fedoraproject.org> - 2.7.15-14
+- Rebuild for readline 8.0
+
* Sat Feb 02 2019 Fedora Release Engineering <releng(a)fedoraproject.org> -
2.7.15-13
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
commit ef2a83ef763f8a120e4a0993b77571c4e8f7f3e4
Author: Fedora Release Engineering <releng(a)fedoraproject.org>
Date: Sat Feb 2 10:16:35 2019 +0000
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng(a)fedoraproject.org>
diff --git a/python2.spec b/python2.spec
index ad6246b..8845550 100644
--- a/python2.spec
+++ b/python2.spec
@@ -123,7 +123,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python2-docs when changing this:
Version: 2.7.15
-Release: 12%{?dist}
+Release: 13%{?dist}
License: Python
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
Provides: python(abi) = %{pybasever}
@@ -2021,6 +2021,9 @@ CheckPython \
# ======================================================
%changelog
+* Sat Feb 02 2019 Fedora Release Engineering <releng(a)fedoraproject.org> -
2.7.15-13
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
+
* Mon Jan 14 2019 Bjrn Esser <besser82(a)fedoraproject.org> - 2.7.15-12
- Rebuilt for libcrypt.so.2 (#1666033)
commit 1d7cbe3b6c3143e8e030df672798e4e95c95b13c
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Mon Jan 28 20:18:14 2019 +0100
Remove obsolete Group tag
References:
https://fedoraproject.org/wiki/Changes/Remove_Group_Tag
diff --git a/python2.spec b/python2.spec
index e34ac4a..ad6246b 100644
--- a/python2.spec
+++ b/python2.spec
@@ -125,7 +125,6 @@ Name: %{python}
Version: 2.7.15
Release: 12%{?dist}
License: Python
-Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
Provides: python(abi) = %{pybasever}
@@ -831,7 +830,6 @@ This package contains /usr/bin/python - the "python" command
that runs Python 2.
%package libs
Summary: Runtime libraries for Python 2
-Group: Applications/System
%?deprecated
# Needed for ctypes, to load libraries, worked around for Live CDs size
@@ -867,7 +865,6 @@ This package contains files used to embed Python 2 into applications.
%package devel
Summary: Libraries and header files needed for Python 2 development
-Group: Development/Libraries
%?deprecated
Requires: %{python}%{?_isa} = %{version}-%{release}
@@ -910,7 +907,6 @@ with and native libraries for Python 2
%package tools
Summary: A collection of development tools included with Python 2
-Group: Development/Tools
%?deprecated
Requires: %{name} = %{version}-%{release}
@@ -926,7 +922,6 @@ color editor (pynche), and a python gettext program (pygettext.py).
%package tkinter
Summary: A graphical user interface for the Python 2 scripting language
-Group: Development/Languages
%?deprecated
Requires: %{name} = %{version}-%{release}
@@ -948,7 +943,6 @@ user interface for Python 2 programming.
%package test
Summary: The test modules from the main python2 package
-Group: Development/Languages
%?deprecated
Requires: %{name} = %{version}-%{release}
@@ -968,7 +962,6 @@ code that uses more than just unittest and/or test.support.
%if %{with debug_build}
%package debug
Summary: Debug version of the Python 2 runtime
-Group: Applications/System
%?deprecated
# The debug build is an all-in-one package version of the regular build, and
commit 284b905a2ef4d935343f4ce3e92838cd1c952836
Author: Bjrn Esser <besser82(a)fedoraproject.org>
Date: Mon Jan 14 18:52:20 2019 +0100
Rebuilt for libcrypt.so.2 (#1666033)
diff --git a/python2.spec b/python2.spec
index 03ca506..e34ac4a 100644
--- a/python2.spec
+++ b/python2.spec
@@ -123,7 +123,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python2-docs when changing this:
Version: 2.7.15
-Release: 11%{?dist}
+Release: 12%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -2028,6 +2028,9 @@ CheckPython \
# ======================================================
%changelog
+* Mon Jan 14 2019 Bjrn Esser <besser82(a)fedoraproject.org> - 2.7.15-12
+- Rebuilt for libcrypt.so.2 (#1666033)
+
* Mon Sep 24 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.15-11
- Security fix for CVE-2018-14647 (#1631822)
commit 44b757bc099867bbcbd65d041a855a296b847684
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Mon Dec 10 14:56:26 2018 +0100
BR glibc-all-langpacks to fix a FTBFS and avoid skipped tests
See
https://fedoraproject.org/wiki/Changes/Remove_glibc-langpacks-all_from_bu...
The tests failed with:
Some tests will be disabled: Test locale not supported
(tried en_US.UTF-8, en_US.US-ASCII, en_US)
...
======================================================================
ERROR: test_lookup_issue1813 (test.test_codecs.CodecsModuleTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/builddir/build/BUILD/Python-2.7.15/Lib/locale.py", line 581, in
setlocale
return _setlocale(category, locale)
Error: unsupported locale setting
----------------------------------------------------------------------
...
======================================================================
ERROR: test_getsetlocale_issue1813 (test.test_locale.TestMiscellaneous)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/builddir/build/BUILD/Python-2.7.15/Lib/locale.py", line 581, in
setlocale
return _setlocale(category, locale)
Error: unsupported locale setting
======================================================================
ERROR: test_setlocale_unicode (test.test_locale.TestMiscellaneous)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/builddir/build/BUILD/Python-2.7.15/Lib/locale.py", line 581, in
setlocale
return _setlocale(category, locale)
Error: unsupported locale setting
----------------------------------------------------------------------
diff --git a/python2.spec b/python2.spec
index f11d4b7..03ca506 100644
--- a/python2.spec
+++ b/python2.spec
@@ -144,6 +144,7 @@ BuildRequires: bluez-libs-devel
%endif
BuildRequires: bzip2
BuildRequires: bzip2-devel
+BuildRequires: glibc-all-langpacks
BuildRequires: glibc-devel
BuildRequires: gmp-devel
BuildRequires: libdb-devel
commit ebba43dec3fd3b1984fb1836ba99475adead1a8d
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Mon Sep 24 13:08:08 2018 +0200
Security fix for CVE-2018-14647 (#1631822)
diff --git a/00310-use-xml-sethashsalt-in-elementtree.patch
b/00310-use-xml-sethashsalt-in-elementtree.patch
new file mode 100644
index 0000000..27d8d1c
--- /dev/null
+++ b/00310-use-xml-sethashsalt-in-elementtree.patch
@@ -0,0 +1,85 @@
+From 554c48934c599b3fb04c73d740bba1a745b89b41 Mon Sep 17 00:00:00 2001
+From: Christian Heimes <christian(a)python.org>
+Date: Tue, 18 Sep 2018 14:38:58 +0200
+Subject: [PATCH] [2.7] bpo-34623: Use XML_SetHashSalt in _elementtree
+ (GH-9146)
+
+The C accelerated _elementtree module now initializes hash randomization
+salt from _Py_HashSecret instead of libexpat's default CPRNG.
+
+Signed-off-by: Christian Heimes <christian(a)python.org>
+
+https://bugs.python.org/issue34623.
+(cherry picked from commit cb5778f00ce48631c7140f33ba242496aaf7102b)
+
+Co-authored-by: Christian Heimes <christian(a)python.org>
+---
+ Include/pyexpat.h | 4 +++-
+ .../next/Security/2018-09-10-16-05-39.bpo-34623.Ua9jMv.rst | 2 ++
+ Modules/_elementtree.c | 5 +++++
+ Modules/pyexpat.c | 5 +++++
+ 4 files changed, 15 insertions(+), 1 deletion(-)
+ create mode 100644 Misc/NEWS.d/next/Security/2018-09-10-16-05-39.bpo-34623.Ua9jMv.rst
+
+diff --git a/Include/pyexpat.h b/Include/pyexpat.h
+index 5340ef5fa386..3fc5fa54da63 100644
+--- a/Include/pyexpat.h
++++ b/Include/pyexpat.h
+@@ -3,7 +3,7 @@
+
+ /* note: you must import expat.h before importing this module! */
+
+-#define PyExpat_CAPI_MAGIC "pyexpat.expat_CAPI 1.0"
++#define PyExpat_CAPI_MAGIC "pyexpat.expat_CAPI 1.1"
+ #define PyExpat_CAPSULE_NAME "pyexpat.expat_CAPI"
+
+ struct PyExpat_CAPI
+@@ -43,6 +43,8 @@ struct PyExpat_CAPI
+ XML_Parser parser, XML_UnknownEncodingHandler handler,
+ void *encodingHandlerData);
+ void (*SetUserData)(XML_Parser parser, void *userData);
++ /* might be none for expat < 2.1.0 */
++ int (*SetHashSalt)(XML_Parser parser, unsigned long hash_salt);
+ /* always add new stuff to the end! */
+ };
+
+diff --git a/Misc/NEWS.d/next/Security/2018-09-10-16-05-39.bpo-34623.Ua9jMv.rst
b/Misc/NEWS.d/next/Security/2018-09-10-16-05-39.bpo-34623.Ua9jMv.rst
+new file mode 100644
+index 000000000000..31ad92ef8582
+--- /dev/null
++++ b/Misc/NEWS.d/next/Security/2018-09-10-16-05-39.bpo-34623.Ua9jMv.rst
+@@ -0,0 +1,2 @@
++The C accelerated _elementtree module now initializes hash randomization
++salt from _Py_HashSecret instead of libexpat's default CSPRNG.
+diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c
+index f7f992dd3a95..b38e0ab329c7 100644
+--- a/Modules/_elementtree.c
++++ b/Modules/_elementtree.c
+@@ -2574,6 +2574,11 @@ xmlparser(PyObject* self_, PyObject* args, PyObject* kw)
+ PyErr_NoMemory();
+ return NULL;
+ }
++ /* expat < 2.1.0 has no XML_SetHashSalt() */
++ if (EXPAT(SetHashSalt) != NULL) {
++ EXPAT(SetHashSalt)(self->parser,
++ (unsigned long)_Py_HashSecret.prefix);
++ }
+
+ ALLOC(sizeof(XMLParserObject), "create expatparser");
+
+diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c
+index 2b4d31293c64..1f8c0d70a559 100644
+--- a/Modules/pyexpat.c
++++ b/Modules/pyexpat.c
+@@ -2042,6 +2042,11 @@ MODULE_INITFUNC(void)
+ capi.SetProcessingInstructionHandler = XML_SetProcessingInstructionHandler;
+ capi.SetUnknownEncodingHandler = XML_SetUnknownEncodingHandler;
+ capi.SetUserData = XML_SetUserData;
++#if XML_COMBINED_VERSION >= 20100
++ capi.SetHashSalt = XML_SetHashSalt;
++#else
++ capi.SetHashSalt = NULL;
++#endif
+
+ /* export using capsule */
+ capi_object = PyCapsule_New(&capi, PyExpat_CAPSULE_NAME, NULL);
diff --git a/python2.spec b/python2.spec
index bdb9c92..f11d4b7 100644
--- a/python2.spec
+++ b/python2.spec
@@ -123,7 +123,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python2-docs when changing this:
Version: 2.7.15
-Release: 10%{?dist}
+Release: 11%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -767,6 +767,13 @@ Patch289: 00289-disable-nis-detection.patch
# Fixed upstream
https://bugs.python.org/issue34540
Patch309: 00309-shutil-spawn-subprocess.patch
+# 00310 #
+# CVE-2018-14647
+# Use XML_SetHashSalt in _elementtree
+# rhbz#1631822
+# Fixed upstream
https://bugs.python.org/issue34623
+Patch310: 00310-use-xml-sethashsalt-in-elementtree.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python2" and "python3" in Fedora, EL,
etc.,
@@ -1120,6 +1127,7 @@ rm Lib/ensurepip/_bundled/*.whl
%patch193 -p1
%patch289 -p1
%patch309 -p1
+%patch310 -p1
%if 0%{?_module_build}
@@ -2019,6 +2027,9 @@ CheckPython \
# ======================================================
%changelog
+* Mon Sep 24 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.15-11
+- Security fix for CVE-2018-14647 (#1631822)
+
* Thu Sep 20 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.15-10
- Security fix for CVE-2018-1000802 (#1631662)
commit 0dfe62335c378c2cefe24d6c314ebbf14d2d5baf
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Thu Sep 20 20:54:32 2018 +0200
Security fix for CVE-2018-1000802 (#1631662)
diff --git a/00309-shutil-spawn-subprocess.patch b/00309-shutil-spawn-subprocess.patch
new file mode 100644
index 0000000..adc56c4
--- /dev/null
+++ b/00309-shutil-spawn-subprocess.patch
@@ -0,0 +1,61 @@
+From add531a1e55b0a739b0f42582f1c9747e5649ace Mon Sep 17 00:00:00 2001
+From: Benjamin Peterson <benjamin(a)python.org>
+Date: Tue, 28 Aug 2018 22:12:56 -0700
+Subject: [PATCH] closes bpo-34540: Convert shutil._call_external_zip to use
+ subprocess rather than distutils.spawn.
+
+---
+ Lib/shutil.py | 16 ++++++++++------
+ .../2018-08-28-22-11-54.bpo-34540.gfQ0TM.rst | 3 +++
+ 2 files changed, 13 insertions(+), 6 deletions(-)
+ create mode 100644 Misc/NEWS.d/next/Security/2018-08-28-22-11-54.bpo-34540.gfQ0TM.rst
+
+diff --git a/Lib/shutil.py b/Lib/shutil.py
+index 3462f7c5e91c..0ab1a06f5260 100644
+--- a/Lib/shutil.py
++++ b/Lib/shutil.py
+@@ -413,17 +413,21 @@ def _set_uid_gid(tarinfo):
+
+ return archive_name
+
+-def _call_external_zip(base_dir, zip_filename, verbose=False, dry_run=False):
++def _call_external_zip(base_dir, zip_filename, verbose, dry_run, logger):
+ # XXX see if we want to keep an external call here
+ if verbose:
+ zipoptions = "-r"
+ else:
+ zipoptions = "-rq"
+- from distutils.errors import DistutilsExecError
+- from distutils.spawn import spawn
++ cmd = ["zip", zipoptions, zip_filename, base_dir]
++ if logger is not None:
++ logger.info(' '.join(cmd))
++ if dry_run:
++ return
++ import subprocess
+ try:
+- spawn(["zip", zipoptions, zip_filename, base_dir], dry_run=dry_run)
+- except DistutilsExecError:
++ subprocess.check_call(cmd)
++ except subprocess.CalledProcessError:
+ # XXX really should distinguish between "couldn't find
+ # external 'zip' command" and "zip failed".
+ raise ExecError, \
+@@ -458,7 +462,7 @@ def _make_zipfile(base_name, base_dir, verbose=0, dry_run=0,
logger=None):
+ zipfile = None
+
+ if zipfile is None:
+- _call_external_zip(base_dir, zip_filename, verbose, dry_run)
++ _call_external_zip(base_dir, zip_filename, verbose, dry_run, logger)
+ else:
+ if logger is not None:
+ logger.info("creating '%s' and adding '%s' to
it",
+diff --git a/Misc/NEWS.d/next/Security/2018-08-28-22-11-54.bpo-34540.gfQ0TM.rst
b/Misc/NEWS.d/next/Security/2018-08-28-22-11-54.bpo-34540.gfQ0TM.rst
+new file mode 100644
+index 000000000000..4f686962a87b
+--- /dev/null
++++ b/Misc/NEWS.d/next/Security/2018-08-28-22-11-54.bpo-34540.gfQ0TM.rst
+@@ -0,0 +1,3 @@
++When ``shutil.make_archive`` falls back to the external ``zip`` problem, it
++uses :mod:`subprocess` to invoke it rather than :mod:`distutils.spawn`. This
++closes a possible shell injection vector.
diff --git a/python2.spec b/python2.spec
index 4a06c22..bdb9c92 100644
--- a/python2.spec
+++ b/python2.spec
@@ -123,7 +123,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python2-docs when changing this:
Version: 2.7.15
-Release: 9%{?dist}
+Release: 10%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -760,6 +760,13 @@ Patch193: 00193-enable-loading-sqlite-extensions.patch
# (we handle it it in Setup.dist, see Patch0)
Patch289: 00289-disable-nis-detection.patch
+# 00309 #
+# CVE-2018-1000802
+# shutil._call_external_zip to use subprocess instead of distutils.spawn
+# rhbz#1631662
+# Fixed upstream
https://bugs.python.org/issue34540
+Patch309: 00309-shutil-spawn-subprocess.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python2" and "python3" in Fedora, EL,
etc.,
@@ -1112,6 +1119,7 @@ rm Lib/ensurepip/_bundled/*.whl
%patch191 -p1
%patch193 -p1
%patch289 -p1
+%patch309 -p1
%if 0%{?_module_build}
@@ -2011,6 +2019,9 @@ CheckPython \
# ======================================================
%changelog
+* Thu Sep 20 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.15-10
+- Security fix for CVE-2018-1000802 (#1631662)
+
* Thu Sep 06 2018 Petr Viktorin <pviktori(a)redhat.com> - 2.7.15-9
- Deprecate python2 and all subpackages in Fedora 30+ (#1625773)
commit 0052c9fa9d76e1706d96a17460ad26f331a4e0fe
Author: Petr Viktorin <pviktori(a)redhat.com>
Date: Thu Sep 6 13:27:15 2018 +0200
Deprecate python2 and all subpackages in Fedora 30+
See:
-
https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
-
https://fedoraproject.org/wiki/Packaging:Deprecating_Packages
diff --git a/python2.spec b/python2.spec
index 4b1eff0..4a06c22 100644
--- a/python2.spec
+++ b/python2.spec
@@ -105,6 +105,16 @@
# the rest of the build
%global regenerate_autotooling_patch 0
+# Python 2 is deprecated in Fedora 30+, see:
+#
https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
+# This means that new packages MUST NOT depend on python2, even transitively
+# see:
https://fedoraproject.org/wiki/Packaging:Deprecating_Packages
+# Python 2 will not be supported after 2019. Use the python3 package instead
+# if possible.
+%if 0%{fedora} >= 30
+%global deprecated Provides: deprecated()
+%endif
+
# ==================
# Top-level metadata
@@ -113,12 +123,14 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python2-docs when changing this:
Version: 2.7.15
-Release: 8%{?dist}
+Release: 9%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
Provides: python(abi) = %{pybasever}
+%?deprecated
+
# =======================
# Build-time requirements
@@ -790,6 +802,7 @@ implementation is within the "python2-libs" package.
Summary: The "python" command that runs Python 2
BuildArch: noarch
#
https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_...
+%?deprecated
# In theory this could require any python2 version
Requires: python2 == %{version}-%{release}
@@ -804,6 +817,7 @@ This package contains /usr/bin/python - the "python" command
that runs Python 2.
%package libs
Summary: Runtime libraries for Python 2
Group: Applications/System
+%?deprecated
# Needed for ctypes, to load libraries, worked around for Live CDs size
# Requires: binutils
@@ -839,6 +853,8 @@ This package contains files used to embed Python 2 into applications.
%package devel
Summary: Libraries and header files needed for Python 2 development
Group: Development/Libraries
+%?deprecated
+
Requires: %{python}%{?_isa} = %{version}-%{release}
Requires: python-rpm-macros
Requires: python2-rpm-macros
@@ -880,6 +896,8 @@ with and native libraries for Python 2
%package tools
Summary: A collection of development tools included with Python 2
Group: Development/Tools
+%?deprecated
+
Requires: %{name} = %{version}-%{release}
Requires: %{python}-tkinter = %{version}-%{release}
@@ -894,6 +912,8 @@ color editor (pynche), and a python gettext program (pygettext.py).
%package tkinter
Summary: A graphical user interface for the Python 2 scripting language
Group: Development/Languages
+%?deprecated
+
Requires: %{name} = %{version}-%{release}
Provides: tkinter = %{version}-%{release}
@@ -914,6 +934,8 @@ user interface for Python 2 programming.
%package test
Summary: The test modules from the main python2 package
Group: Development/Languages
+%?deprecated
+
Requires: %{name} = %{version}-%{release}
Provides: python-test = %{version}-%{release}
@@ -932,6 +954,7 @@ code that uses more than just unittest and/or test.support.
%package debug
Summary: Debug version of the Python 2 runtime
Group: Applications/System
+%?deprecated
# The debug build is an all-in-one package version of the regular build, and
# shares the same .py/.pyc files and directories as the regular build. Hence
@@ -1988,6 +2011,9 @@ CheckPython \
# ======================================================
%changelog
+* Thu Sep 06 2018 Petr Viktorin <pviktori(a)redhat.com> - 2.7.15-9
+- Deprecate python2 and all subpackages in Fedora 30+ (#1625773)
+
* Thu Aug 30 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.15-8
- Require python2-setuptools from python2-devel to prevent packaging errors (#1623922)
commit ae09a791255cd6f6ee172efa8c77bb83746ebecf
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Fri Jul 20 12:37:22 2018 +0200
Enable basic venv smoke test in the CI
diff --git a/tests/tests.yml b/tests/tests.yml
new file mode 100644
index 0000000..fc8183f
--- /dev/null
+++ b/tests/tests.yml
@@ -0,0 +1,18 @@
+---
+- hosts: localhost
+ roles:
+ - role: standard-test-basic
+ tags:
+ - classic
+ repositories:
+ - repo: "https://src.fedoraproject.org/tests/python.git"
+ dest: "python"
+ tests:
+ - smoke:
+ dir: python/smoke
+ run: METHOD=virtualenv VERSION=2.7 ./venv.sh
+ required_packages:
+ - gcc
+ - /usr/bin/virtualenv
+ - python3-tox
+ - python2-devel
commit e8ef86e1cf0e8b37771e5053c9124ae55b0026c9
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Thu Aug 30 15:46:34 2018 +0200
Require python2-setuptools from python2-devel to prevent packaging errors (#1623922)
diff --git a/python2.spec b/python2.spec
index c93f93c..4b1eff0 100644
--- a/python2.spec
+++ b/python2.spec
@@ -113,7 +113,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python2-docs when changing this:
Version: 2.7.15
-Release: 7%{?dist}
+Release: 8%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -851,6 +851,15 @@ Requires: pkgconfig
Requires: python3-rpm-generators
%endif
+# This is not "API" (packages that need setuptools should still BuildRequire
it)
+# However some packages apparently can build both with and without setuptools
+# producing egg-info as file or directory (depending on setuptools presence).
+# Directory-to-file updates are problematic in RPM, so we ensure setuptools is
+# installed when -devel is required.
+# See
https://bugzilla.redhat.com/show_bug.cgi?id=1623922
+# See
https://fedoraproject.org/wiki/Packaging:Directory_Replacement
+Requires: python2-setuptools
+
#
https://bugzilla.redhat.com/show_bug.cgi?id=1217376
#
https://bugzilla.redhat.com/show_bug.cgi?id=1496757
#
https://bugzilla.redhat.com/show_bug.cgi?id=1218294
@@ -1979,6 +1988,9 @@ CheckPython \
# ======================================================
%changelog
+* Thu Aug 30 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.15-8
+- Require python2-setuptools from python2-devel to prevent packaging errors (#1623922)
+
* Tue Aug 21 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.15-7
- Use RPM built wheels of pip and setuptools in ensurepip instead of our rewheel patch
commit 4d74b7c9bf6d6aa13cf6d7099ced0ebe3768e73e
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Tue Aug 21 15:58:19 2018 +0200
Use RPM built wheels of pip and setuptools in ensurepip instead of our rewheel patch
diff --git a/00189-use-rpm-wheels.patch b/00189-use-rpm-wheels.patch
new file mode 100644
index 0000000..d7428f8
--- /dev/null
+++ b/00189-use-rpm-wheels.patch
@@ -0,0 +1,71 @@
+diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py
+index 89ed1ef..8008222 100644
+--- a/Lib/ensurepip/__init__.py
++++ b/Lib/ensurepip/__init__.py
+@@ -1,9 +1,10 @@
+ #!/usr/bin/env python2
+ from __future__ import print_function
+
++import distutils.version
++import glob
+ import os
+ import os.path
+-import pkgutil
+ import shutil
+ import sys
+ import tempfile
+@@ -11,10 +12,20 @@ import tempfile
+
+ __all__ = ["version", "bootstrap"]
+
++_WHEEL_DIR = "/usr/share/python-wheels/"
+
+-_SETUPTOOLS_VERSION = "39.0.1"
+
+-_PIP_VERSION = "9.0.3"
++def _get_most_recent_wheel_version(pkg):
++ prefix = os.path.join(_WHEEL_DIR, "{}-".format(pkg))
++ suffix = "-py2.py3-none-any.whl"
++ pattern = "{}*{}".format(prefix, suffix)
++ versions = (p[len(prefix):-len(suffix)] for p in glob.glob(pattern))
++ return str(max(versions, key=distutils.version.LooseVersion))
++
++
++_SETUPTOOLS_VERSION = _get_most_recent_wheel_version("setuptools")
++
++_PIP_VERSION = _get_most_recent_wheel_version("pip")
+
+ _PROJECTS = [
+ ("setuptools", _SETUPTOOLS_VERSION),
+@@ -28,8 +39,13 @@ def _run_pip(args, additional_paths=None):
+ sys.path = additional_paths + sys.path
+
+ # Install the bundled software
+- import pip
+- return pip.main(args)
++ try:
++ # pip 10
++ from pip._internal import main
++ except ImportError:
++ # pip 9
++ from pip import main
++ return main(args)
+
+
+ def version():
+@@ -100,12 +116,9 @@ def _bootstrap(root=None, upgrade=False, user=False,
+ 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)
++ with open(os.path.join(_WHEEL_DIR, wheel_name), "rb") as sfp:
++ with open(os.path.join(tmpdir, wheel_name), "wb") as fp:
++ fp.write(sfp.read())
+
+ additional_paths.append(os.path.join(tmpdir, wheel_name))
+
diff --git a/00198-add-rewheel-module.patch b/00198-add-rewheel-module.patch
deleted file mode 100644
index 0273f1b..0000000
--- a/00198-add-rewheel-module.patch
+++ /dev/null
@@ -1,249 +0,0 @@
-diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py
-index 89ed1ef..e2a4c25 100644
---- a/Lib/ensurepip/__init__.py
-+++ b/Lib/ensurepip/__init__.py
-@@ -7,6 +7,7 @@ import pkgutil
- import shutil
- import sys
- import tempfile
-+from ensurepip import rewheel
-
-
- __all__ = ["version", "bootstrap"]
-@@ -29,6 +30,8 @@ def _run_pip(args, additional_paths=None):
-
- # Install the bundled software
- import pip
-+ if args[0] in ["install", "list", "wheel"]:
-+ args.append('--pre')
- return pip.main(args)
-
-
-@@ -93,21 +96,40 @@ def _bootstrap(root=None, upgrade=False, user=False,
- # omit pip and easy_install
- os.environ["ENSUREPIP_OPTIONS"] = "install"
-
-+ whls = []
-+ rewheel_dir = None
-+ # try to see if we have system-wide versions of _PROJECTS
-+ dep_records = rewheel.find_system_records([p[0] for p in _PROJECTS])
-+ # TODO: check if system-wide versions are the newest ones
-+ # if --upgrade is used?
-+ if all(dep_records):
-+ # if we have all _PROJECTS installed system-wide, we'll recreate
-+ # wheels from them and install those
-+ rewheel_dir = tempfile.mkdtemp()
-+ for dr in dep_records:
-+ new_whl = rewheel.rewheel_from_record(dr, rewheel_dir)
-+ whls.append(os.path.join(rewheel_dir, new_whl))
-+ else:
-+ # if we don't have all the _PROJECTS installed system-wide,
-+ # let's just fall back to bundled wheels
-+ for project, version in _PROJECTS:
-+ whl = os.path.join(
-+ os.path.dirname(__file__),
-+ "_bundled",
-+ "{}-{}-py2.py3-none-any.whl".format(project, version)
-+ )
-+ whls.append(whl)
-+
- tmpdir = tempfile.mkdtemp()
- 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))
-+ for whl in whls:
-+ shutil.copy(whl, tmpdir)
-+ additional_paths.append(os.path.join(tmpdir, os.path.basename(whl)))
-+ if rewheel_dir:
-+ shutil.rmtree(rewheel_dir)
-
- # Construct the arguments to be passed to the pip command
- args = ["install", "--no-index", "--find-links",
tmpdir]
-diff --git a/Lib/ensurepip/rewheel/__init__.py b/Lib/ensurepip/rewheel/__init__.py
-new file mode 100644
-index 0000000..75c2094
---- /dev/null
-+++ b/Lib/ensurepip/rewheel/__init__.py
-@@ -0,0 +1,158 @@
-+import argparse
-+import codecs
-+import csv
-+import email.parser
-+import os
-+import io
-+import re
-+import site
-+import subprocess
-+import sys
-+import zipfile
-+
-+def run():
-+ parser = argparse.ArgumentParser(description='Recreate wheel of package with
given RECORD.')
-+ parser.add_argument('record_path',
-+ help='Path to RECORD file')
-+ parser.add_argument('-o', '--output-dir',
-+ help='Dir where to place the wheel, defaults to current
working dir.',
-+ dest='outdir',
-+ default=os.path.curdir)
-+
-+ ns = parser.parse_args()
-+ retcode = 0
-+ try:
-+ print(rewheel_from_record(**vars(ns)))
-+ except BaseException as e:
-+ print('Failed: {}'.format(e))
-+ retcode = 1
-+ sys.exit(1)
-+
-+def find_system_records(projects):
-+ """Return list of paths to RECORD files for system-installed
projects.
-+
-+ If a project is not installed, the resulting list contains None instead
-+ of a path to its RECORD
-+ """
-+ records = []
-+ # get system site-packages dirs
-+ if hasattr(sys, 'real_prefix'):
-+ #we are in python2 virtualenv and sys.real_prefix is the original sys.prefix
-+ _orig_prefixes = site.PREFIXES
-+ setattr(site, 'PREFIXES', [sys.real_prefix]*2)
-+ sys_sitepack = site.getsitepackages()
-+ setattr(site, 'PREFIXES', _orig_prefixes)
-+ elif hasattr(sys, 'base_prefix'): # python3 venv doesn't inject
real_prefix to sys
-+ # we are on python3 and base(_exec)_prefix is unchanged in venv
-+ sys_sitepack = site.getsitepackages([sys.base_prefix, sys.base_exec_prefix])
-+ else:
-+ # we are in python2 without virtualenv
-+ sys_sitepack = site.getsitepackages()
-+
-+ sys_sitepack = [sp for sp in sys_sitepack if os.path.exists(sp)]
-+ # try to find all projects in all system site-packages
-+ for project in projects:
-+ path = None
-+ for sp in sys_sitepack:
-+ dist_info_re = os.path.join(sp, project) +
'-[^\{0}]+\.dist-info'.format(os.sep)
-+ candidates = [os.path.join(sp, p) for p in os.listdir(sp)]
-+ # filter out candidate dirs based on the above regexp
-+ filtered = [c for c in candidates if re.match(dist_info_re, c)]
-+ # if we have 0 or 2 or more dirs, something is wrong...
-+ if len(filtered) == 1:
-+ path = filtered[0]
-+ if path is not None:
-+ records.append(os.path.join(path, 'RECORD'))
-+ else:
-+ records.append(None)
-+ return records
-+
-+def rewheel_from_record(record_path, outdir):
-+ """Recreates a whee of package with given record_path and returns
path
-+ to the newly created wheel."""
-+ site_dir = os.path.dirname(os.path.dirname(record_path))
-+ record_relpath = record_path[len(site_dir):].strip(os.path.sep)
-+ to_write, to_omit = get_records_to_pack(site_dir, record_relpath)
-+ new_wheel_name = get_wheel_name(record_path)
-+ new_wheel_path = os.path.join(outdir, new_wheel_name + '.whl')
-+
-+ new_wheel = zipfile.ZipFile(new_wheel_path, mode='w',
compression=zipfile.ZIP_DEFLATED)
-+ # we need to write a new record with just the files that we will write,
-+ # e.g. not binaries and *.pyc/*.pyo files
-+ if sys.version_info[0] < 3:
-+ new_record = io.BytesIO()
-+ else:
-+ new_record = io.StringIO()
-+ writer = csv.writer(new_record)
-+
-+ # handle files that we can write straight away
-+ for f, sha_hash, size in to_write:
-+ new_wheel.write(os.path.join(site_dir, f), arcname=f)
-+ writer.writerow([f, sha_hash,size])
-+
-+ # rewrite the old wheel file with a new computed one
-+ writer.writerow([record_relpath, '', ''])
-+ new_wheel.writestr(record_relpath, new_record.getvalue())
-+
-+ new_wheel.close()
-+
-+ return new_wheel.filename
-+
-+def get_wheel_name(record_path):
-+ """Return proper name of the wheel, without .whl."""
-+
-+ wheel_info_path = os.path.join(os.path.dirname(record_path), 'WHEEL')
-+ with codecs.open(wheel_info_path, encoding='utf-8') as wheel_info_file:
-+ wheel_info =
email.parser.Parser().parsestr(wheel_info_file.read().encode('utf-8'))
-+
-+ metadata_path = os.path.join(os.path.dirname(record_path), 'METADATA')
-+ with codecs.open(metadata_path, encoding='utf-8') as metadata_file:
-+ metadata =
email.parser.Parser().parsestr(metadata_file.read().encode('utf-8'))
-+
-+ # construct name parts according to wheel spec
-+ distribution = metadata.get('Name')
-+ version = metadata.get('Version')
-+ build_tag = '' # nothing for now
-+ lang_tag = []
-+ for t in wheel_info.get_all('Tag'):
-+ lang_tag.append(t.split('-')[0])
-+ lang_tag = '.'.join(lang_tag)
-+ abi_tag, plat_tag = wheel_info.get('Tag').split('-')[1:3]
-+ # leave out build tag, if it is empty
-+ to_join = filter(None, [distribution, version, build_tag, lang_tag, abi_tag,
plat_tag])
-+ return '-'.join(list(to_join))
-+
-+def get_records_to_pack(site_dir, record_relpath):
-+ """Accepts path of sitedir and path of RECORD file relative to it.
-+ Returns two lists:
-+ - list of files that can be written to new RECORD straight away
-+ - list of files that shouldn't be written or need some processing
-+ (pyc and pyo files, scripts)
-+ """
-+ record_file_path = os.path.join(site_dir, record_relpath)
-+ with codecs.open(record_file_path, encoding='utf-8') as record_file:
-+ record_contents = record_file.read()
-+ # temporary fix for
https://github.com/pypa/pip/issues/1376
-+ # we need to ignore files under ".data" directory
-+ data_dir = os.path.dirname(record_relpath).strip(os.path.sep)
-+ data_dir = data_dir[:-len('dist-info')] + 'data'
-+
-+ to_write = []
-+ to_omit = []
-+ for l in record_contents.splitlines():
-+ spl = l.split(',')
-+ if len(spl) == 3:
-+ # new record will omit (or write differently):
-+ # - abs paths, paths with ".." (entry points),
-+ # - pyc+pyo files
-+ # - the old RECORD file
-+ # TODO: is there any better way to recognize an entry point?
-+ if os.path.isabs(spl[0]) or spl[0].startswith('..') or \
-+ spl[0].endswith('.pyc') or spl[0].endswith('.pyo') or \
-+ spl[0] == record_relpath or spl[0].startswith(data_dir):
-+ to_omit.append(spl)
-+ else:
-+ to_write.append(spl)
-+ else:
-+ pass # bad RECORD or empty line
-+ return to_write, to_omit
-diff --git a/Makefile.pre.in b/Makefile.pre.in
-index 877698c..2c43611 100644
---- a/Makefile.pre.in
-+++ b/Makefile.pre.in
-@@ -1065,7 +1065,7 @@ LIBSUBDIRS= lib-tk lib-tk/test lib-tk/test/test_tkinter \
- test/tracedmodules \
- encodings compiler hotshot \
- email email/mime email/test email/test/data \
-- ensurepip ensurepip/_bundled \
-+ ensurepip ensurepip/_bundled ensurepip/rewheel\
- json json/tests \
- sqlite3 sqlite3/test \
- logging bsddb bsddb/test csv importlib wsgiref \
diff --git a/python2.spec b/python2.spec
index 78fe8cb..c93f93c 100644
--- a/python2.spec
+++ b/python2.spec
@@ -5,8 +5,9 @@
# Note that the bcond macros are named for the CLI option they create.
# "%%bcond_without" means "ENABLE by default and create a --without
option"
-# Ability to reuse RPM-installed pip using rewheel
-%bcond_without rewheel
+# Whether to use RPM build wheels from the python-{pip,setuptools}-wheel package
+# Uses upstream bundled prebuilt wheels otherwise
+%bcond_without rpmwheels
# Extra build for debugging the interpreter or C-API extensions
# (the -debug subpackages)
@@ -112,7 +113,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python2-docs when changing this:
Version: 2.7.15
-Release: 6%{?dist}
+Release: 7%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -182,15 +183,10 @@ BuildRequires: valgrind-devel
BuildRequires: zlib-devel
-%if %{with rewheel}
-BuildRequires: python2-setuptools
-Requires: python2-setuptools
-
-%if ! 0%{?_module_build}
-BuildRequires: python2-pip
-Requires: python2-pip
-%endif # !module_build
-%endif # rewheel
+%if %{with rpmwheels}
+BuildRequires: python-setuptools-wheel
+BuildRequires: python-pip-wheel
+%endif
# Providing python27 as now multiple interpreters exist in Fedora
# alongside the system one e.g. python26, python33 etc
@@ -202,6 +198,12 @@ Provides: python27 = %{version}-%{release}
# python2 back with fixed version, so we just use the path here:
Recommends: %{_bindir}/python
+# Previously, this was required for our rewheel patch to work.
+# This is technically no longer needed, but we keep it recommended
+# for the developer experience.
+Recommends: python2-setuptools
+Recommends: python2-pip
+
# =======================
# Source code and patches
@@ -719,6 +721,11 @@ Patch185: 00185-urllib2-honors-noproxy-for-ftp.patch
# symbol)
Patch187: 00187-add-RPATH-to-pyexpat.patch
+# 00189 #
+# Instead of bundled wheels, use our RPM packaged wheels from
+# /usr/share/python-wheels
+Patch189: 00189-use-rpm-wheels.patch
+
# 00190 #
# Fixes gdb py-bt command not to raise exception while processing
# statements from eval
@@ -736,9 +743,6 @@ Patch191: 00191-disable-NOOP.patch
# Patch provided by John C. Peterson
Patch193: 00193-enable-loading-sqlite-extensions.patch
-# 00198 #
-Patch198: 00198-add-rewheel-module.patch
-
# 00289 #
# Disable automatic detection for the nis module
# (we handle it it in Setup.dist, see Patch0)
@@ -818,6 +822,14 @@ Requires: glibc%{?_isa} >= 2.24.90-26
Requires: gdbm%{?_isa} >= 1:1.13
%endif
+%if %{with rpmwheels}
+Requires: python-setuptools-wheel
+Requires: python-pip-wheel
+%else
+Provides: bundled(python2-pip) = 9.0.3
+Provides: bundled(python2-setuptools) = 39.0.1
+%endif
+
Provides: python-libs = %{version}-%{release}
Provides: python-libs%{?_isa} = %{version}-%{release}
@@ -1058,12 +1070,15 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch181 -p1
%patch185 -p1
%patch187 -p1
+
+%if %{with rpmwheels}
+%patch189 -p1
+rm Lib/ensurepip/_bundled/*.whl
+%endif
+
%patch190 -p1
%patch191 -p1
%patch193 -p1
-%if %{with rewheel}
-%patch198 -p1
-%endif
%patch289 -p1
@@ -1748,11 +1763,11 @@ CheckPython \
%dir %{pylibdir}/ensurepip/
%{pylibdir}/ensurepip/*.py*
+%if %{with rpmwheels}
%exclude %{pylibdir}/ensurepip/_bundled
-
-%if %{with rewheel}
-%dir %{pylibdir}/ensurepip/rewheel/
-%{pylibdir}/ensurepip/rewheel/*.py*
+%else
+%dir %{pylibdir}/ensurepip/_bundled
+%{pylibdir}/ensurepip/_bundled/*.whl
%endif
@@ -1964,6 +1979,9 @@ CheckPython \
# ======================================================
%changelog
+* Tue Aug 21 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.15-7
+- Use RPM built wheels of pip and setuptools in ensurepip instead of our rewheel patch
+
* Sat Jul 14 2018 Fedora Release Engineering <releng(a)fedoraproject.org> - 2.7.15-6
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
commit d60e5a4fc915bd68ef372d5ad8b5851179d96d43
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Tue Aug 21 15:47:27 2018 +0200
Move patch 189 to 190 to make room for standardized 189
https://fedoraproject.org/wiki/SIGs/Python/PythonPatches
diff --git a/00189-gdb-py-bt-dont-raise-exception-from-eval.patch
b/00189-gdb-py-bt-dont-raise-exception-from-eval.patch
deleted file mode 100644
index 4ef2a5d..0000000
--- a/00189-gdb-py-bt-dont-raise-exception-from-eval.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- Python-2.7.5-orig/Tools/gdb/libpython.py 2013-05-12 03:32:54.000000000 +0000
-+++ Python-2.7.5-orig/Tools/gdb/libpython.py 2013-09-15 09:56:25.494000000 +0000
-@@ -887,6 +887,8 @@
- newline character'''
- if self.is_optimized_out():
- return '(frame information optimized out)'
-+ if self.filename() == '<string>':
-+ return '(in an eval block)'
- filename = self.filename()
- try:
- f = open(filename, 'r')
diff --git a/00190-gdb-py-bt-dont-raise-exception-from-eval.patch
b/00190-gdb-py-bt-dont-raise-exception-from-eval.patch
new file mode 100644
index 0000000..4ef2a5d
--- /dev/null
+++ b/00190-gdb-py-bt-dont-raise-exception-from-eval.patch
@@ -0,0 +1,11 @@
+--- Python-2.7.5-orig/Tools/gdb/libpython.py 2013-05-12 03:32:54.000000000 +0000
++++ Python-2.7.5-orig/Tools/gdb/libpython.py 2013-09-15 09:56:25.494000000 +0000
+@@ -887,6 +887,8 @@
+ newline character'''
+ if self.is_optimized_out():
+ return '(frame information optimized out)'
++ if self.filename() == '<string>':
++ return '(in an eval block)'
+ filename = self.filename()
+ try:
+ f = open(filename, 'r')
diff --git a/python2.spec b/python2.spec
index 11af0f1..78fe8cb 100644
--- a/python2.spec
+++ b/python2.spec
@@ -719,11 +719,11 @@ Patch185: 00185-urllib2-honors-noproxy-for-ftp.patch
# symbol)
Patch187: 00187-add-RPATH-to-pyexpat.patch
-# 00189 #
+# 00190 #
# Fixes gdb py-bt command not to raise exception while processing
# statements from eval
# rhbz#1008154 (patch by Attila Fazekas)
-Patch189: 00189-gdb-py-bt-dont-raise-exception-from-eval.patch
+Patch190: 00190-gdb-py-bt-dont-raise-exception-from-eval.patch
# 00191 #
# Disabling NOOP test as it fails without internet connection
@@ -1058,7 +1058,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch181 -p1
%patch185 -p1
%patch187 -p1
-%patch189 -p1
+%patch190 -p1
%patch191 -p1
%patch193 -p1
%if %{with rewheel}
commit 8b06c12ed7dfcbe634bcd9c5642500ee1488aec3
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Sun Aug 5 20:28:48 2018 +0000
Temporarily use compat-openssl10-devel to workaround #1609291
diff --git a/python2.spec b/python2.spec
index 86003b1..11af0f1 100644
--- a/python2.spec
+++ b/python2.spec
@@ -136,12 +136,14 @@ BuildRequires: gmp-devel
BuildRequires: libdb-devel
BuildRequires: libffi-devel
BuildRequires: ncurses-devel
-BuildRequires: openssl-devel
BuildRequires: pkgconfig
BuildRequires: readline-devel
BuildRequires: sqlite-devel
BuildRequires: tcl-devel
+#
https://bugzilla.redhat.com/show_bug.cgi?id=1609291
+BuildRequires: compat-openssl10-devel
+
# For the nis module
BuildRequires: libnsl2-devel
BuildRequires: libtirpc-devel
commit fb398608462610bd519556a9d4e6b10ead41d696
Author: Fedora Release Engineering <releng(a)fedoraproject.org>
Date: Sat Jul 14 02:48:28 2018 +0000
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng(a)fedoraproject.org>
diff --git a/python2.spec b/python2.spec
index 2bf84ad..86003b1 100644
--- a/python2.spec
+++ b/python2.spec
@@ -112,7 +112,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python2-docs when changing this:
Version: 2.7.15
-Release: 5%{?dist}
+Release: 6%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1962,6 +1962,9 @@ CheckPython \
# ======================================================
%changelog
+* Sat Jul 14 2018 Fedora Release Engineering <releng(a)fedoraproject.org> - 2.7.15-6
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
+
* Thu Jun 14 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.15-5
- Move /usr/bin/python into a separate package
https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_...
commit f5b3292c6845e91dfcf02b9fc3aab6a3a3e9bdd6
Author: Jason Tibbitts <tibbs(a)math.uh.edu>
Date: Tue Jul 10 01:54:54 2018 -0500
Remove needless use of %defattr
diff --git a/python2.spec b/python2.spec
index 8b614d7..2bf84ad 100644
--- a/python2.spec
+++ b/python2.spec
@@ -1583,7 +1583,6 @@ CheckPython \
%files
-%defattr(-, root, root, -)
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc README
@@ -1597,7 +1596,6 @@ CheckPython \
%{_mandir}/*/python.1.*
%files libs
-%defattr(-,root,root,-)
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc README
@@ -1757,7 +1755,6 @@ CheckPython \
%files devel
-%defattr(-,root,root,-)
%{_libdir}/pkgconfig/python-%{pybasever}.pc
%{_libdir}/pkgconfig/python.pc
%{_libdir}/pkgconfig/python2.pc
@@ -1773,7 +1770,6 @@ CheckPython \
%{_libdir}/libpython%{pybasever}.so
%files tools
-%defattr(-,root,root,755)
%doc Tools/pynche/README.pynche
%{site_packages}/pynche
%{_bindir}/smtpd*.py*
@@ -1790,14 +1786,12 @@ CheckPython \
%{pylibdir}/Doc
%files tkinter
-%defattr(-,root,root,755)
%{pylibdir}/lib-tk
%if ! 0%{?_module_build}
%{dynload_dir}/_tkinter.so
%endif
%files test
-%defattr(-, root, root, -)
%{pylibdir}/bsddb/test
%{pylibdir}/ctypes/test
%{pylibdir}/distutils/tests
@@ -1826,7 +1820,6 @@ CheckPython \
%if %{with debug_build}
%files debug
-%defattr(-,root,root,-)
# Analog of the core subpackage's files:
%{_bindir}/python-debug
commit 08290bc9c39a293634a5fc649ca27b6468f9c6d3
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Tue Jul 3 14:02:51 2018 +0200
Add a workaround for broken %undefine __brp_python_bytecompile
See
https://bugzilla.redhat.com/show_bug.cgi?id=1597664
diff --git a/python2.spec b/python2.spec
index dc6b1ff..8b614d7 100644
--- a/python2.spec
+++ b/python2.spec
@@ -70,6 +70,10 @@
# available in /usr/bin when Python is built. Also, the bytecompilation fails
# on files that test invalid syntax.
%undefine __brp_python_bytecompile
+# The above is broken now
+#
https://bugzilla.redhat.com/show_bug.cgi?id=1597664
+# This is an older non-standard way to disable the brp script, as a workaround
+%undefine py_auto_byte_compile
# We need to get a newer configure generated out of configure.in for the following
# patches:
commit 002eb7557e49e3a6dc08d164805c04f23a18de66
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Thu Jun 14 14:15:03 2018 +0200
Move /usr/bin/python into a separate package
See
https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_...
Reverts
https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build
diff --git a/00288-ambiguous-python-version-rpmbuild-warn.patch
b/00288-ambiguous-python-version-rpmbuild-warn.patch
deleted file mode 100644
index 8da5151..0000000
--- a/00288-ambiguous-python-version-rpmbuild-warn.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-diff -U3 -r Python-2.7.14.orig/Lib/site.py Python-2.7.14/Lib/site.py
---- Python-2.7.14.orig/Lib/site.py 2018-01-29 15:05:04.517599815 +0100
-+++ Python-2.7.14/Lib/site.py 2018-01-30 09:13:17.305270500 +0100
-@@ -515,6 +515,41 @@
- "'import usercustomize' failed; use -v for traceback"
-
-
-+def handle_ambiguous_python_version():
-+ """Warn or fail if /usr/bin/python is used
-+
-+ Behavior depends on the value of PYTHON_DISALLOW_AMBIGUOUS_VERSION:
-+ - "warn" - print warning to stderr
-+ - "1" - print error and exit with positive exit code
-+ - otherwise: do nothing
-+
-+ This is a Fedora modification, see the Change page for details:
-+ See
https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build
-+ """
-+ if sys.executable == "/usr/bin/python":
-+ setting = os.environ.get("PYTHON_DISALLOW_AMBIGUOUS_VERSION")
-+ if setting == 'warn':
-+ print>>sys.stderr, (
-+ "DEPRECATION WARNING: python2 invoked with
/usr/bin/python.\n"
-+ " Use /usr/bin/python3 or /usr/bin/python2\n"
-+ " /usr/bin/python will be removed or switched to Python 3"
-+ " in the future.\n"
-+ " If you cannot make the switch now, please follow"
-+ " instructions at"
-+ "
https://fedoraproject.org/wiki/Changes/"
-+ "Avoid_usr_bin_python_in_RPM_Build#Quick_Opt-Out")
-+ elif setting == '1':
-+ print>>sys.stderr, (
-+ "ERROR: python2 invoked with /usr/bin/python.\n"
-+ " Use /usr/bin/python3 or /usr/bin/python2\n"
-+ " /usr/bin/python will be switched to Python 3"
-+ " in the future.\n"
-+ " More details are at"
-+ "
https://fedoraproject.org/wiki/Changes/"
-+ "Avoid_usr_bin_python_in_RPM_Build#Quick_Opt-Out")
-+ exit(1)
-+
-+
- def main():
- global ENABLE_USER_SITE
-
-@@ -543,6 +578,7 @@
- # this module is run as a script, because this code is executed twice.
- if hasattr(sys, "setdefaultencoding"):
- del sys.setdefaultencoding
-+ handle_ambiguous_python_version()
-
- main()
-
diff --git a/python2.spec b/python2.spec
index 5e4433b..dc6b1ff 100644
--- a/python2.spec
+++ b/python2.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python2-docs when changing this:
Version: 2.7.15
-Release: 4%{?dist}
+Release: 5%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -186,6 +186,15 @@ Requires: python2-pip
%endif # !module_build
%endif # rewheel
+# Providing python27 as now multiple interpreters exist in Fedora
+# alongside the system one e.g. python26, python33 etc
+Provides: python27 = %{version}-%{release}
+
+#
https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_...
+# We recommend /usr/bin/python so users get it by default
+# Versioned recommends are problematic, and we know that the package requires
+# python2 back with fixed version, so we just use the path here:
+Recommends: %{_bindir}/python
# =======================
@@ -724,11 +733,6 @@ Patch193: 00193-enable-loading-sqlite-extensions.patch
# 00198 #
Patch198: 00198-add-rewheel-module.patch
-# 00288 #
-# Adds a warning when /usr/bin/python is invoked during rpmbuild
-# See
https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build
-Patch288: 00288-ambiguous-python-version-rpmbuild-warn.patch
-
# 00289 #
# Disable automatic detection for the nis module
# (we handle it it in Setup.dist, see Patch0)
@@ -756,15 +760,6 @@ Patch5000: 05000-autotool-intermediates.patch
# Additional metadata, and subpackages
# ======================================================
-Provides: python = %{version}-%{release}
-Provides: python%{?_isa} = %{version}-%{release}
-
-
-# Providing python27 as now multiple interpreters exist in Fedora
-# alongside the system one e.g. python26, python33 etc
-Provides: python27 = %{version}-%{release}
-
-
URL:
https://www.python.org/
%description
@@ -780,6 +775,22 @@ package.
This package provides the "python2" executable; most of the actual
implementation is within the "python2-libs" package.
+
+%package -n python-unversioned-command
+Summary: The "python" command that runs Python 2
+BuildArch: noarch
+#
https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_...
+
+# In theory this could require any python2 version
+Requires: python2 == %{version}-%{release}
+# But since we want to provide versioned python, we require exact version
+Provides: python = %{version}-%{release}
+# This also save us an explicit conflict for older python2 builds
+
+%description -n python-unversioned-command
+This package contains /usr/bin/python - the "python" command that runs Python
2.
+
+
%package libs
Summary: Runtime libraries for Python 2
Group: Applications/System
@@ -1047,7 +1058,6 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%if %{with rewheel}
%patch198 -p1
%endif
-%patch288 -p1
%patch289 -p1
@@ -1574,10 +1584,13 @@ CheckPython \
%license LICENSE
%doc README
%{_bindir}/pydoc*
-%{_bindir}/python
%{_bindir}/%{python}
%{_bindir}/python%{pybasever}
-%{_mandir}/*/*
+%{_mandir}/*/python2*
+
+%files -n python-unversioned-command
+%{_bindir}/python
+%{_mandir}/*/python.1.*
%files libs
%defattr(-,root,root,-)
@@ -1952,6 +1965,11 @@ CheckPython \
# ======================================================
%changelog
+* Thu Jun 14 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.15-5
+- Move /usr/bin/python into a separate package
+
https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_...
+- Revert
https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build
+
* Wed Jun 13 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.15-4
- Rebuilt for Python 3.7
commit 692623a0b949f8053d183414a3eff9ac49069db9
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Thu Jun 21 16:35:28 2018 +0200
pynche: Do not execute just python, but python2
diff --git a/pynche b/pynche
index 368d740..4032e41 100644
--- a/pynche
+++ b/pynche
@@ -1,2 +1,2 @@
#!/bin/bash
-exec `python -c "from distutils.sysconfig import get_python_lib;
print(get_python_lib(plat_specific = True))"`/pynche/pynche
+exec `python2 -c "from distutils.sysconfig import get_python_lib;
print(get_python_lib(plat_specific = True))"`/pynche/pynche
commit 5ee9c1ec451b34b643340b925f2b31340134cc53
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Wed Jun 13 18:34:16 2018 +0200
Rebuilt for Python 3.7
diff --git a/python2.spec b/python2.spec
index f2a856c..5e4433b 100644
--- a/python2.spec
+++ b/python2.spec
@@ -1,4 +1,3 @@
-%global _with_python3_bootstrap 1
# ======================================================
# Conditionals and other variables controlling the build
# ======================================================
@@ -109,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python2-docs when changing this:
Version: 2.7.15
-Release: 3%{?dist}
+Release: 4%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1953,6 +1952,9 @@ CheckPython \
# ======================================================
%changelog
+* Wed Jun 13 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.15-4
+- Rebuilt for Python 3.7
+
* Wed Jun 13 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.15-3
- Bootstrap for Python 3.7
commit 2b53e7ec9bb3decca2f50e450ad89e24faade303
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Wed Jun 13 15:40:42 2018 +0200
Bootstrap for Python 3.7
diff --git a/python2.spec b/python2.spec
index 3274d34..f2a856c 100644
--- a/python2.spec
+++ b/python2.spec
@@ -1,3 +1,4 @@
+%global _with_python3_bootstrap 1
# ======================================================
# Conditionals and other variables controlling the build
# ======================================================
@@ -108,7 +109,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python2-docs when changing this:
Version: 2.7.15
-Release: 2%{?dist}
+Release: 3%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1952,6 +1953,9 @@ CheckPython \
# ======================================================
%changelog
+* Wed Jun 13 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.15-3
+- Bootstrap for Python 3.7
+
* Tue May 15 2018 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.15-2
- Fix loading of the gdb python plugin (rhbz#1578001)
commit 4922a4e974dbb5859c317120b799564edff076fd
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Tue May 15 14:28:59 2018 +0200
Fix loading of the gdb python plugin (rhbz#1578001)
Conditionalize permissions changes for the debug
shared library.
diff --git a/python2.spec b/python2.spec
index 8aa14df..3274d34 100644
--- a/python2.spec
+++ b/python2.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python2-docs when changing this:
Version: 2.7.15
-Release: 1%{?dist}
+Release: 2%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1249,7 +1249,7 @@ make install DESTDIR=%{buildroot}
#
%if 0%{?with_gdb_hooks}
DirHoldingGdbPy=%{_prefix}/lib/debug/%{_libdir}
-PathOfGdbPy=$DirHoldingGdbPy/$PyInstSoName.debug-gdb.py
+PathOfGdbPy=$DirHoldingGdbPy/$PyInstSoName-%{version}-%{release}.%{_arch}.debug-gdb.py
mkdir -p %{buildroot}$DirHoldingGdbPy
cp $topdir/Tools/gdb/libpython.py %{buildroot}$PathOfGdbPy
@@ -1492,7 +1492,9 @@ find %{buildroot} -type f -a -name "*.py" -print0 | \
# Make library-files user writable
/usr/bin/chmod 755 %{buildroot}%{dynload_dir}/*.so
/usr/bin/chmod 755 %{buildroot}%{_libdir}/libpython%{pybasever}.so.1.0
+%if %{with debug_build}
/usr/bin/chmod 755 %{buildroot}%{_libdir}/libpython%{pybasever}_d.so.1.0
+%endif
# ======================================================
@@ -1950,6 +1952,9 @@ CheckPython \
# ======================================================
%changelog
+* Tue May 15 2018 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.15-2
+- Fix loading of the gdb python plugin (rhbz#1578001)
+
* Tue May 01 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.15-1
- Update to version 2.7.15
commit ba2118865d4e86470fdc22f4fb0f976942f43679
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Sat May 12 00:53:31 2018 +0200
Add a Python 3 bootstrapping bcond
diff --git a/python2.spec b/python2.spec
index d15b497..8aa14df 100644
--- a/python2.spec
+++ b/python2.spec
@@ -12,6 +12,10 @@
# (the -debug subpackages)
%bcond_without debug_build
+# Only use this when bootstrapping python3
+# Needed to build setuptools for the first time
+%bcond_with python3_bootstrap
+
%global unicode ucs4
%global python python2
@@ -809,9 +813,15 @@ Group: Development/Libraries
Requires: %{python}%{?_isa} = %{version}-%{release}
Requires: python-rpm-macros
Requires: python2-rpm-macros
-Requires: python3-rpm-generators
Requires: pkgconfig
+%if %{without python3_bootstrap}
+# When bootstrapping python3, we need to build setuptools
+# But setuptools BR python2-devel and that brings in python3-rpm-generators
+# python3-rpm-generators needs python3-setuptools, so we cannot have it yet
+Requires: python3-rpm-generators
+%endif
+
#
https://bugzilla.redhat.com/show_bug.cgi?id=1217376
#
https://bugzilla.redhat.com/show_bug.cgi?id=1496757
#
https://bugzilla.redhat.com/show_bug.cgi?id=1218294
commit 080ef9bdfbcdd43658e435a1ee012542e7cb70b8
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Tue May 1 13:03:41 2018 +0200
Coerce locale to UTF-8 encoding when running tests
Since 2.7.15, there is a test that shutil.copies to unicode filename.
diff --git a/python2.spec b/python2.spec
index 10af069..d15b497 100644
--- a/python2.spec
+++ b/python2.spec
@@ -1534,6 +1534,10 @@ CheckPython() {
%if %{with tests}
+# no locale coercion in python2
+# test_ssl:test_load_dh_params shutil.copies into unicode filename
+export LC_ALL=C.utf-8
+
# Check each of the configurations:
%if %{with debug_build}
CheckPython \
commit 066c2585871071aee13f704b361e2dc6b56e9574
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Tue May 1 12:01:16 2018 +0200
Update to version 2.7.15
- Rebased patches: 165, 170, 198
- Refactored patches: 289
- Removed patches (included upstream): 280, 283, 284, 285, 287,
293, 297, 298, 299
diff --git a/00165-crypt-module-salt-backport.patch
b/00165-crypt-module-salt-backport.patch
index 4308b4c..0040aae 100644
--- a/00165-crypt-module-salt-backport.patch
+++ b/00165-crypt-module-salt-backport.patch
@@ -1,6 +1,7 @@
-diff -up Python-2.7.3/Doc/library/crypt.rst.crypt-module-salt-backport
Python-2.7.3/Doc/library/crypt.rst
---- Python-2.7.3/Doc/library/crypt.rst.crypt-module-salt-backport 2012-04-09
19:07:28.000000000 -0400
-+++ Python-2.7.3/Doc/library/crypt.rst 2013-02-19 16:44:20.465334062 -0500
+diff --git a/Doc/library/crypt.rst b/Doc/library/crypt.rst
+index 91464ef..6ee64d6 100644
+--- a/Doc/library/crypt.rst
++++ b/Doc/library/crypt.rst
@@ -16,9 +16,9 @@
This module implements an interface to the :manpage:`crypt(3)` routine, which is
@@ -14,7 +15,7 @@ diff -up Python-2.7.3/Doc/library/crypt.rst.crypt-module-salt-backport
Python-2.
.. index:: single: crypt(3)
-@@ -27,15 +27,81 @@ the :manpage:`crypt(3)` routine in the r
+@@ -27,15 +27,81 @@ the :manpage:`crypt(3)` routine in the running system. Therefore,
any
extensions available on the current implementation will also be available on
this module.
@@ -130,7 +131,7 @@ diff -up Python-2.7.3/Doc/library/crypt.rst.crypt-module-salt-backport
Python-2.
A simple example illustrating typical use::
import crypt, getpass, pwd
-@@ -59,3 +146,11 @@ A simple example illustrating typical us
+@@ -59,3 +146,11 @@ A simple example illustrating typical use::
else:
return 1
@@ -142,9 +143,11 @@ diff -up
Python-2.7.3/Doc/library/crypt.rst.crypt-module-salt-backport Python-2.
+ hashed = crypt.crypt(plaintext)
+ if hashed != crypt.crypt(plaintext, hashed):
+ raise "Hashed version doesn't validate against original"
-diff -up Python-2.7.3/Lib/crypt.py.crypt-module-salt-backport Python-2.7.3/Lib/crypt.py
---- Python-2.7.3/Lib/crypt.py.crypt-module-salt-backport 2013-02-19 16:44:20.465334062
-0500
-+++ Python-2.7.3/Lib/crypt.py 2013-02-19 16:49:56.425311089 -0500
+diff --git a/Lib/crypt.py b/Lib/crypt.py
+new file mode 100644
+index 0000000..bf0a416
+--- /dev/null
++++ b/Lib/crypt.py
@@ -0,0 +1,71 @@
+"""Wrapper to the POSIX crypt library call and associated functionality.
+
@@ -217,12 +220,13 @@ diff -up Python-2.7.3/Lib/crypt.py.crypt-module-salt-backport
Python-2.7.3/Lib/c
+methods.append(METHOD_CRYPT)
+del _result, _method
+
-diff -up Python-2.7.3/Lib/test/test_crypt.py.crypt-module-salt-backport
Python-2.7.3/Lib/test/test_crypt.py
---- Python-2.7.3/Lib/test/test_crypt.py.crypt-module-salt-backport 2012-04-09
19:07:31.000000000 -0400
-+++ Python-2.7.3/Lib/test/test_crypt.py 2013-02-19 16:44:20.465334062 -0500
-@@ -10,6 +10,25 @@ class CryptTestCase(unittest.TestCase):
- if test_support.verbose:
- print 'Test encryption: ', c
+diff --git a/Lib/test/test_crypt.py b/Lib/test/test_crypt.py
+index 7cd9c71..b061a55 100644
+--- a/Lib/test/test_crypt.py
++++ b/Lib/test/test_crypt.py
+@@ -16,6 +16,25 @@ class CryptTestCase(unittest.TestCase):
+ self.assertEqual(cr2, cr)
+
+ def test_salt(self):
+ self.assertEqual(len(crypt._saltchars), 64)
@@ -246,9 +250,23 @@ diff -up
Python-2.7.3/Lib/test/test_crypt.py.crypt-module-salt-backport Python-2
def test_main():
test_support.run_unittest(CryptTestCase)
-diff -up Python-2.7.3/Modules/cryptmodule.c.crypt-module-salt-backport
Python-2.7.3/Modules/cryptmodule.c
---- Python-2.7.3/Modules/cryptmodule.c.crypt-module-salt-backport 2012-04-09
19:07:34.000000000 -0400
-+++ Python-2.7.3/Modules/cryptmodule.c 2013-02-19 16:44:20.466334063 -0500
+diff --git a/Modules/Setup.dist b/Modules/Setup.dist
+index 2712f06..3ea4f0c 100644
+--- a/Modules/Setup.dist
++++ b/Modules/Setup.dist
+@@ -225,7 +225,7 @@ _ssl _ssl.c \
+ #
+ # First, look at Setup.config; configure may have set this for you.
+
+-crypt cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some systems
++_crypt _cryptmodule.c -lcrypt # crypt(3); needs -lcrypt on some systems
+
+
+ # Some more UNIX dependent modules -- off by default, since these
+diff --git a/Modules/cryptmodule.c b/Modules/cryptmodule.c
+index 76de54f..7c69ca6 100644
+--- a/Modules/cryptmodule.c
++++ b/Modules/cryptmodule.c
@@ -43,7 +43,7 @@ static PyMethodDef crypt_methods[] = {
};
@@ -259,22 +277,11 @@ diff -up
Python-2.7.3/Modules/cryptmodule.c.crypt-module-salt-backport Python-2.
- Py_InitModule("crypt", crypt_methods);
+ Py_InitModule("_crypt", crypt_methods);
}
-diff -up Python-2.7.3/Modules/Setup.dist.crypt-module-salt-backport
Python-2.7.3/Modules/Setup.dist
---- Python-2.7.3/Modules/Setup.dist.crypt-module-salt-backport 2013-02-19
16:44:20.463334063 -0500
-+++ Python-2.7.3/Modules/Setup.dist 2013-02-19 16:44:20.466334063 -0500
-@@ -221,7 +221,7 @@ _ssl _ssl.c \
- #
- # First, look at Setup.config; configure may have set this for you.
-
--crypt cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some systems
-+_crypt _cryptmodule.c -lcrypt # crypt(3); needs -lcrypt on some systems
-
-
- # Some more UNIX dependent modules -- off by default, since these
-diff -up Python-2.7.3/setup.py.crypt-module-salt-backport Python-2.7.3/setup.py
---- Python-2.7.3/setup.py.crypt-module-salt-backport 2013-02-19 16:44:20.425334067 -0500
-+++ Python-2.7.3/setup.py 2013-02-19 16:44:20.466334063 -0500
-@@ -693,7 +693,7 @@ class PyBuildExt(build_ext):
+diff --git a/setup.py b/setup.py
+index b787487..c60ac35 100644
+--- a/setup.py
++++ b/setup.py
+@@ -798,7 +798,7 @@ class PyBuildExt(build_ext):
libs = ['crypt']
else:
libs = []
diff --git a/00170-gc-assertions.patch b/00170-gc-assertions.patch
index f3a0838..9ade298 100644
--- a/00170-gc-assertions.patch
+++ b/00170-gc-assertions.patch
@@ -1,16 +1,18 @@
-diff -up Python-2.7.3/Lib/test/test_gc.py.gc-assertions Python-2.7.3/Lib/test/test_gc.py
---- Python-2.7.3/Lib/test/test_gc.py.gc-assertions 2013-02-20 16:28:20.890536607 -0500
-+++ Python-2.7.3/Lib/test/test_gc.py 2013-02-20 16:39:52.720489297 -0500
-@@ -1,6 +1,7 @@
+diff --git a/Lib/test/test_gc.py b/Lib/test/test_gc.py
+index 7e47b2d..12a210d 100644
+--- a/Lib/test/test_gc.py
++++ b/Lib/test/test_gc.py
+@@ -1,7 +1,8 @@
import unittest
--from test.test_support import verbose, run_unittest, start_threads
-+from test.test_support import verbose, run_unittest, start_threads, import_module
+ from test.support import (verbose, run_unittest, start_threads,
+- requires_type_collecting)
++ requires_type_collecting, import_module)
import sys
+import sysconfig
import time
import gc
import weakref
-@@ -32,6 +33,8 @@ class GC_Detector(object):
+@@ -39,6 +40,8 @@ class GC_Detector(object):
self.wr = weakref.ref(C1055820(666), it_happened)
@@ -19,7 +21,7 @@ diff -up Python-2.7.3/Lib/test/test_gc.py.gc-assertions
Python-2.7.3/Lib/test/te
### Tests
###############################################################################
-@@ -476,6 +479,49 @@ class GCTests(unittest.TestCase):
+@@ -537,6 +540,49 @@ class GCTests(unittest.TestCase):
# would be damaged, with an empty __dict__.
self.assertEqual(x, None)
@@ -69,9 +71,10 @@ diff -up Python-2.7.3/Lib/test/test_gc.py.gc-assertions
Python-2.7.3/Lib/test/te
class GCTogglingTests(unittest.TestCase):
def setUp(self):
gc.enable()
-diff -up Python-2.7.3/Modules/gcmodule.c.gc-assertions Python-2.7.3/Modules/gcmodule.c
---- Python-2.7.3/Modules/gcmodule.c.gc-assertions 2012-04-09 19:07:34.000000000 -0400
-+++ Python-2.7.3/Modules/gcmodule.c 2013-02-20 16:28:21.029536600 -0500
+diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c
+index 916e481..0233ce2 100644
+--- a/Modules/gcmodule.c
++++ b/Modules/gcmodule.c
@@ -21,6 +21,73 @@
#include "Python.h"
#include "frameobject.h" /* for PyFrame_ClearFreeList */
@@ -146,7 +149,7 @@ diff -up Python-2.7.3/Modules/gcmodule.c.gc-assertions
Python-2.7.3/Modules/gcmo
/* Get an object's GC head */
#define AS_GC(o) ((PyGC_Head *)(o)-1)
-@@ -288,7 +355,8 @@ update_refs(PyGC_Head *containers)
+@@ -328,7 +395,8 @@ update_refs(PyGC_Head *containers)
{
PyGC_Head *gc = containers->gc.gc_next;
for (; gc != containers; gc = gc->gc.gc_next) {
@@ -156,7 +159,7 @@ diff -up Python-2.7.3/Modules/gcmodule.c.gc-assertions
Python-2.7.3/Modules/gcmo
gc->gc.gc_refs = Py_REFCNT(FROM_GC(gc));
/* Python's cyclic gc should never see an incoming refcount
* of 0: if something decref'ed to 0, it should have been
-@@ -308,7 +376,8 @@ update_refs(PyGC_Head *containers)
+@@ -348,7 +416,8 @@ update_refs(PyGC_Head *containers)
* so serious that maybe this should be a release-build
* check instead of an assert?
*/
@@ -166,7 +169,7 @@ diff -up Python-2.7.3/Modules/gcmodule.c.gc-assertions
Python-2.7.3/Modules/gcmo
}
}
-@@ -323,7 +392,9 @@ visit_decref(PyObject *op, void *data)
+@@ -363,7 +432,9 @@ visit_decref(PyObject *op, void *data)
* generation being collected, which can be recognized
* because only they have positive gc_refs.
*/
@@ -177,7 +180,7 @@ diff -up Python-2.7.3/Modules/gcmodule.c.gc-assertions
Python-2.7.3/Modules/gcmo
if (gc->gc.gc_refs > 0)
gc->gc.gc_refs--;
}
-@@ -383,9 +454,10 @@ visit_reachable(PyObject *op, PyGC_Head
+@@ -423,9 +494,10 @@ visit_reachable(PyObject *op, PyGC_Head *reachable)
* If gc_refs == GC_UNTRACKED, it must be ignored.
*/
else {
@@ -191,7 +194,7 @@ diff -up Python-2.7.3/Modules/gcmodule.c.gc-assertions
Python-2.7.3/Modules/gcmo
}
}
return 0;
-@@ -427,7 +499,7 @@ move_unreachable(PyGC_Head *young, PyGC_
+@@ -467,7 +539,7 @@ move_unreachable(PyGC_Head *young, PyGC_Head *unreachable)
*/
PyObject *op = FROM_GC(gc);
traverseproc traverse = Py_TYPE(op)->tp_traverse;
@@ -200,7 +203,7 @@ diff -up Python-2.7.3/Modules/gcmodule.c.gc-assertions
Python-2.7.3/Modules/gcmo
gc->gc.gc_refs = GC_REACHABLE;
(void) traverse(op,
(visitproc)visit_reachable,
-@@ -494,7 +566,8 @@ move_finalizers(PyGC_Head *unreachable,
+@@ -545,7 +617,8 @@ move_finalizers(PyGC_Head *unreachable, PyGC_Head *finalizers)
for (gc = unreachable->gc.gc_next; gc != unreachable; gc = next) {
PyObject *op = FROM_GC(gc);
@@ -210,7 +213,7 @@ diff -up Python-2.7.3/Modules/gcmodule.c.gc-assertions
Python-2.7.3/Modules/gcmo
next = gc->gc.gc_next;
if (has_finalizer(op)) {
-@@ -570,7 +643,7 @@ handle_weakrefs(PyGC_Head *unreachable,
+@@ -621,7 +694,7 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old)
PyWeakReference **wrlist;
op = FROM_GC(gc);
@@ -219,7 +222,7 @@ diff -up Python-2.7.3/Modules/gcmodule.c.gc-assertions
Python-2.7.3/Modules/gcmo
next = gc->gc.gc_next;
if (! PyType_SUPPORTS_WEAKREFS(Py_TYPE(op)))
-@@ -591,9 +664,9 @@ handle_weakrefs(PyGC_Head *unreachable,
+@@ -642,9 +715,9 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old)
* the callback pointer intact. Obscure: it also
* changes *wrlist.
*/
@@ -231,7 +234,7 @@ diff -up Python-2.7.3/Modules/gcmodule.c.gc-assertions
Python-2.7.3/Modules/gcmo
if (wr->wr_callback == NULL)
continue; /* no callback */
-@@ -627,7 +700,7 @@ handle_weakrefs(PyGC_Head *unreachable,
+@@ -678,7 +751,7 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old)
*/
if (IS_TENTATIVELY_UNREACHABLE(wr))
continue;
@@ -240,7 +243,7 @@ diff -up Python-2.7.3/Modules/gcmodule.c.gc-assertions
Python-2.7.3/Modules/gcmo
/* Create a new reference so that wr can't go away
* before we can process it again.
-@@ -636,7 +709,8 @@ handle_weakrefs(PyGC_Head *unreachable,
+@@ -687,7 +760,8 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old)
/* Move wr to wrcb_to_call, for the next pass. */
wrasgc = AS_GC(wr);
@@ -250,7 +253,7 @@ diff -up Python-2.7.3/Modules/gcmodule.c.gc-assertions
Python-2.7.3/Modules/gcmo
next isn't, so they can't
be the same */
gc_list_move(wrasgc, &wrcb_to_call);
-@@ -652,11 +726,11 @@ handle_weakrefs(PyGC_Head *unreachable,
+@@ -703,11 +777,11 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old)
gc = wrcb_to_call.gc.gc_next;
op = FROM_GC(gc);
@@ -265,7 +268,7 @@ diff -up Python-2.7.3/Modules/gcmodule.c.gc-assertions
Python-2.7.3/Modules/gcmo
/* copy-paste of weakrefobject.c's handle_callback() */
temp = PyObject_CallFunctionObjArgs(callback, wr, NULL);
-@@ -759,7 +833,7 @@ delete_garbage(PyGC_Head *collectable, P
+@@ -810,7 +884,7 @@ delete_garbage(PyGC_Head *collectable, PyGC_Head *old)
PyGC_Head *gc = collectable->gc.gc_next;
PyObject *op = FROM_GC(gc);
diff --git a/00198-add-rewheel-module.patch b/00198-add-rewheel-module.patch
index 029f24f..0273f1b 100644
--- a/00198-add-rewheel-module.patch
+++ b/00198-add-rewheel-module.patch
@@ -1,5 +1,5 @@
diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py
-index 14c9adb..e20104e 100644
+index 89ed1ef..e2a4c25 100644
--- a/Lib/ensurepip/__init__.py
+++ b/Lib/ensurepip/__init__.py
@@ -7,6 +7,7 @@ import pkgutil
@@ -7,22 +7,22 @@ index 14c9adb..e20104e 100644
import sys
import tempfile
+from ensurepip import rewheel
-
-
+
+
__all__ = ["version", "bootstrap"]
-@@ -43,6 +44,8 @@ def _run_pip(args, additional_paths=None):
-
+@@ -29,6 +30,8 @@ def _run_pip(args, additional_paths=None):
+
# Install the bundled software
import pip
+ if args[0] in ["install", "list", "wheel"]:
+ args.append('--pre')
- pip.main(args)
-
-
-@@ -93,21 +96,40 @@ def bootstrap(root=None, upgrade=False, user=False,
+ return pip.main(args)
+
+
+@@ -93,21 +96,40 @@ def _bootstrap(root=None, upgrade=False, user=False,
# omit pip and easy_install
os.environ["ENSUREPIP_OPTIONS"] = "install"
-
+
+ whls = []
+ rewheel_dir = None
+ # try to see if we have system-wide versions of _PROJECTS
@@ -67,7 +67,7 @@ index 14c9adb..e20104e 100644
+ additional_paths.append(os.path.join(tmpdir, os.path.basename(whl)))
+ if rewheel_dir:
+ shutil.rmtree(rewheel_dir)
-
+
# Construct the arguments to be passed to the pip command
args = ["install", "--no-index", "--find-links",
tmpdir]
diff --git a/Lib/ensurepip/rewheel/__init__.py b/Lib/ensurepip/rewheel/__init__.py
@@ -235,15 +235,15 @@ index 0000000..75c2094
+ pass # bad RECORD or empty line
+ return to_write, to_omit
diff --git a/Makefile.pre.in b/Makefile.pre.in
-index ca33158..44bdde5 100644
+index 877698c..2c43611 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
-@@ -1066,7 +1066,7 @@ LIBSUBDIRS= lib-tk lib-tk/test lib-tk/test/test_tkinter \
- test/tracedmodules \
- encodings compiler hotshot \
- email email/mime email/test email/test/data \
+@@ -1065,7 +1065,7 @@ LIBSUBDIRS= lib-tk lib-tk/test lib-tk/test/test_tkinter \
+ test/tracedmodules \
+ encodings compiler hotshot \
+ email email/mime email/test email/test/data \
- ensurepip ensurepip/_bundled \
+ ensurepip ensurepip/_bundled ensurepip/rewheel\
- json json/tests \
- sqlite3 sqlite3/test \
- logging bsddb bsddb/test csv importlib wsgiref \
+ json json/tests \
+ sqlite3 sqlite3/test \
+ logging bsddb bsddb/test csv importlib wsgiref \
diff --git a/00280-Fix-test_regrtest-test_crashed-on-s390x.patch
b/00280-Fix-test_regrtest-test_crashed-on-s390x.patch
deleted file mode 100644
index 4a340c8..0000000
--- a/00280-Fix-test_regrtest-test_crashed-on-s390x.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-From ab35adc682ec51800aa19a77de9947c6aaa50f41 Mon Sep 17 00:00:00 2001
-From: Victor Stinner <victor.stinner(a)gmail.com>
-Date: Fri, 6 Oct 2017 22:28:59 +0200
-Subject: [PATCH] bpo-31719: Fix test_regrtest.test_crashed() on s390x
-
-Add a new _testcapi._read_null() function to crash Python in a
-reliable way on s390x.
-
-On s390x, ctypes.string_at(0) returns an empty string rather than
-crashing.
----
- Lib/test/support/__init__.py | 4 ++--
- Lib/test/test_regrtest.py | 2 ++
- .../next/Tests/2017-10-06-22-37-38.bpo-31719.gHyrV3.rst | 3 +++
- Modules/_testcapimodule.c | 17 +++++++++++++++++
- 4 files changed, 24 insertions(+), 2 deletions(-)
- create mode 100644 Misc/NEWS.d/next/Tests/2017-10-06-22-37-38.bpo-31719.gHyrV3.rst
-
-diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
-index ef474e00b68..25df3ed0c41 100644
---- a/Lib/test/support/__init__.py
-+++ b/Lib/test/support/__init__.py
-@@ -1960,6 +1960,6 @@ def _crash_python():
- Use SuppressCrashReport() to prevent a crash report from popping up.
- """
-
-- import ctypes
-+ import _testcapi
- with SuppressCrashReport():
-- ctypes.string_at(0)
-+ _testcapi._read_null()
-diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
-index 264c74d22ba..aae274384c7 100644
---- a/Lib/test/test_regrtest.py
-+++ b/Lib/test/test_regrtest.py
-@@ -543,6 +543,8 @@ def test_method2(self):
- testname)
- self.assertEqual(output.splitlines(), all_methods)
-
-+ @unittest.skipIf(sys.platform.startswith('aix'),
-+ "support._crash_python() doesn't work on AIX")
- def test_crashed(self):
- # Any code which causes a crash
- code = 'import test.support; test.support._crash_python()'
-diff --git a/Misc/NEWS.d/next/Tests/2017-10-06-22-37-38.bpo-31719.gHyrV3.rst
b/Misc/NEWS.d/next/Tests/2017-10-06-22-37-38.bpo-31719.gHyrV3.rst
-new file mode 100644
-index 00000000000..a06c5267251
---- /dev/null
-+++ b/Misc/NEWS.d/next/Tests/2017-10-06-22-37-38.bpo-31719.gHyrV3.rst
-@@ -0,0 +1,3 @@
-+Fix test_regrtest.test_crashed() on s390x. Add a new _testcapi._read_null()
-+function to crash Python in a reliable way on s390x. On s390x,
-+ctypes.string_at(0) returns an empty string rather than crashing.
-diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
-index 7691b5188ff..5902de07823 100644
---- a/Modules/_testcapimodule.c
-+++ b/Modules/_testcapimodule.c
-@@ -2566,6 +2566,22 @@ py_w_stopcode(PyObject *self, PyObject *args)
- #endif
-
-
-+/* Read memory from NULL (address 0) to raise a SIGSEGV or SIGBUS signal
-+ depending on the platform. This function is used by
-+ test.support._crash_python() to "crash" Python. */
-+static PyObject *
-+read_null(PyObject *self, PyObject *args)
-+{
-+ volatile int *x;
-+ volatile int y;
-+
-+ x = NULL;
-+ y = *x;
-+ return PyLong_FromLong(y);
-+
-+}
-+
-+
- static PyMethodDef TestMethods[] = {
- {"raise_exception", raise_exception,
METH_VARARGS},
- {"set_errno", set_errno,
METH_VARARGS},
-@@ -2685,6 +2701,7 @@ static PyMethodDef TestMethods[] = {
- #ifdef W_STOPCODE
- {"W_STOPCODE", py_w_stopcode, METH_VARARGS},
- #endif
-+ {"_read_null", (PyCFunction)read_null, METH_NOARGS},
- {NULL, NULL} /* sentinel */
- };
-
diff --git a/00283-fix-tests_with_COUNT_ALLOCS.patch
b/00283-fix-tests_with_COUNT_ALLOCS.patch
deleted file mode 100644
index 358d473..0000000
--- a/00283-fix-tests_with_COUNT_ALLOCS.patch
+++ /dev/null
@@ -1,184 +0,0 @@
-From 7b4ba62e388474e811268322b47f80d464933541 Mon Sep 17 00:00:00 2001
-From: Victor Stinner <victor.stinner(a)gmail.com>
-Date: Tue, 17 Oct 2017 02:25:23 -0700
-Subject: [PATCH] [2.7] bpo-31692: Add PYTHONSHOWALLOCCOUNT env var (GH-3927)
-
-bpo-31692, bpo-19527:
-
-* Add a new PYTHONSHOWALLOCCOUNT environment variable, similar to
- the Python 3 "-X showalloccount" option
-* When Python is compiled with COUNT_ALLOCS, the new
- PYTHONSHOWALLOCCOUNT environment variable now has to be set to dump
- allocation counts into stderr on shutdown. Moreover, allocations
- statistics are now dumped into stderr rather than stdout.
-* Add @test.support.requires_type_collecting decorator: skip test if
- COUNT_ALLOCS is defined
-* Fix tests for COUNT_ALLOCS: decorate some methods with
- @requires_type_collecting
-* test_sys.test_objecttypes(): update object type when COUNT_ALLOCS
- is defined
----
- Doc/c-api/typeobj.rst | 2 +-
- Doc/using/cmdline.rst | 7 +++++++
- Lib/test/support/__init__.py | 3 +++
- Lib/test/test_abc.py | 1 +
- Lib/test/test_gc.py | 4 +++-
- Lib/test/test_regrtest.py | 1 +
- Lib/test/test_sys.py | 5 ++++-
- Lib/test/test_weakref.py | 1 +
- .../Core and Builtins/2017-10-09-11-03-13.bpo-31692.5-bpdk.rst | 4 ++++
- Python/pythonrun.c | 4 +++-
- 10 files changed, 28 insertions(+), 4 deletions(-)
- create mode 100644 Misc/NEWS.d/next/Core and
Builtins/2017-10-09-11-03-13.bpo-31692.5-bpdk.rst
-
-diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst
-index 18edcdd7e5a..f0ccf2ea5fe 100644
---- a/Doc/c-api/typeobj.rst
-+++ b/Doc/c-api/typeobj.rst
-@@ -1101,7 +1101,7 @@ The next fields, up to and including
:c:member:`~PyTypeObject.tp_weaklist`, only
- The remaining fields are only defined if the feature test macro
- :const:`COUNT_ALLOCS` is defined, and are for internal use only. They are
- documented here for completeness. None of these fields are inherited by
--subtypes.
-+subtypes. See the :envvar:`PYTHONSHOWALLOCCOUNT` environment variable.
-
-
- .. c:member:: Py_ssize_t PyTypeObject.tp_allocs
-diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst
-index f00f7f6026a..55bc12893d6 100644
---- a/Doc/using/cmdline.rst
-+++ b/Doc/using/cmdline.rst
-@@ -663,3 +663,10 @@ if Python was configured with the ``--with-pydebug`` build option.
-
- If set, Python will print memory allocation statistics every time a new
- object arena is created, and on shutdown.
-+
-+.. envvar:: PYTHONSHOWALLOCCOUNT
-+
-+ If set and Python was compiled with ``COUNT_ALLOCS`` defined, Python will
-+ dump allocations counts into stderr on shutdown.
-+
-+ .. versionadded:: 2.7.15
-diff --git a/Doc/whatsnew/2.7.rst b/Doc/whatsnew/2.7.rst
-index 28a8d4b..f0d2428 100644
---- a/Doc/whatsnew/2.7.rst
-+++ b/Doc/whatsnew/2.7.rst
-@@ -2540,6 +2540,17 @@ exemption allowing new ``-3`` warnings to be added in any Python
2.7
- maintenance release.
-
-
-+Two new environment variables for debug mode
-+--------------------------------------------
-+
-+When Python is compiled with ``COUNT_ALLOC`` defined, allocation counts are no
-+longer dumped by default anymore: the :envvar:`PYTHONSHOWALLOCCOUNT` environment
-+variable must now also be set. Moreover, allocation counts are now dumped into
-+stderr, rather than stdout. (Contributed by Victor Stinner; :issue:`31692`.)
-+
-+.. versionadded:: 2.7.15
-+
-+
- PEP 434: IDLE Enhancement Exception for All Branches
- ----------------------------------------------------
-
-diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
-index 25df3ed0c41..d14a6620b5d 100644
---- a/Lib/test/support/__init__.py
-+++ b/Lib/test/support/__init__.py
-@@ -1795,6 +1795,9 @@ def py3k_bytes(b):
- except TypeError:
- return bytes(b)
-
-+requires_type_collecting = unittest.skipIf(hasattr(sys, 'getcounts'),
-+ 'types are immortal if COUNT_ALLOCS is defined')
-+
- def args_from_interpreter_flags():
- """Return a list of command-line arguments reproducing the current
- settings in sys.flags."""
-diff --git a/Lib/test/test_abc.py b/Lib/test/test_abc.py
-index 6a8c3a13274..dbba37cdb6f 100644
---- a/Lib/test/test_abc.py
-+++ b/Lib/test/test_abc.py
-@@ -208,6 +208,7 @@ class C(A, B):
- C()
- self.assertEqual(B.counter, 1)
-
-+ @test_support.requires_type_collecting
- def test_cache_leak(self):
- # See issue #2521.
- class A(object):
-diff --git a/Lib/test/test_gc.py b/Lib/test/test_gc.py
-index ed01c9802fc..7e47b2d3a27 100644
---- a/Lib/test/test_gc.py
-+++ b/Lib/test/test_gc.py
-@@ -1,5 +1,6 @@
- import unittest
--from test.test_support import verbose, run_unittest, start_threads, import_module
-+from test.support import (verbose, run_unittest, start_threads, import_module,
-+ requires_type_collecting)
- import sys
- import sysconfig
- import time
-@@ -90,6 +91,7 @@ class A:
- del a
- self.assertNotEqual(gc.collect(), 0)
-
-+ @requires_type_collecting
- def test_newinstance(self):
- class A(object):
- pass
-diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
-index aae274384c7..988a72c1099 100644
---- a/Lib/test/test_regrtest.py
-+++ b/Lib/test/test_regrtest.py
-@@ -493,6 +493,7 @@ def check_leak(self, code, what):
- self.assertIn(line2, reflog)
-
- @unittest.skipUnless(Py_DEBUG, 'need a debug build')
-+ @support.requires_type_collecting
- def test_huntrleaks(self):
- # test --huntrleaks
- code = textwrap.dedent("""
-diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
-index 5baaa352c0b..9342716272a 100644
---- a/Lib/test/test_sys.py
-+++ b/Lib/test/test_sys.py
-@@ -748,7 +748,10 @@ def delx(self): del self.__x
- # tupleiterator
- check(iter(()), size('lP'))
- # type
-- s = vsize('P2P15Pl4PP9PP11PI' # PyTypeObject
-+ fmt = 'P2P15Pl4PP9PP11PI'
-+ if hasattr(sys, 'getcounts'):
-+ fmt += '3P2P'
-+ s = vsize(fmt + # PyTypeObject
- '39P' # PyNumberMethods
- '3P' # PyMappingMethods
- '10P' # PySequenceMethods
-diff --git a/Lib/test/test_weakref.py b/Lib/test/test_weakref.py
-index 415d5ebbd72..418481dadd8 100644
---- a/Lib/test/test_weakref.py
-+++ b/Lib/test/test_weakref.py
-@@ -601,6 +601,7 @@ class D:
- del c1, c2, C, D
- gc.collect()
-
-+ @test_support.requires_type_collecting
- def test_callback_in_cycle_resurrection(self):
- import gc
-
-diff --git a/Python/pythonrun.c b/Python/pythonrun.c
-index 677f6e48111..44fe13d2f7d 100644
---- a/Python/pythonrun.c
-+++ b/Python/pythonrun.c
-@@ -488,7 +488,9 @@ Py_Finalize(void)
-
- /* Debugging stuff */
- #ifdef COUNT_ALLOCS
-- dump_counts(stdout);
-+ if (Py_GETENV("PYTHONSHOWALLOCCOUNT")) {
-+ dump_counts(stderr);
-+ }
- #endif
-
- PRINT_TOTAL_REFS();
diff --git a/00284-add-PYTHONSHOWREFCOUNT-env-var.patch
b/00284-add-PYTHONSHOWREFCOUNT-env-var.patch
deleted file mode 100644
index bfa71dc..0000000
--- a/00284-add-PYTHONSHOWREFCOUNT-env-var.patch
+++ /dev/null
@@ -1,92 +0,0 @@
-diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst
-index 55bc128..15d5830 100644
---- a/Doc/using/cmdline.rst
-+++ b/Doc/using/cmdline.rst
-@@ -664,6 +664,13 @@ if Python was configured with the ``--with-pydebug`` build option.
- If set, Python will print memory allocation statistics every time a new
- object arena is created, and on shutdown.
-
-+.. envvar:: PYTHONSHOWREFCOUNT
-+
-+ If set, Python will print the total reference count when the program
-+ finishes or after each statement in the interactive interpreter.
-+
-+ .. versionadded:: 2.7.15
-+
- .. envvar:: PYTHONSHOWALLOCCOUNT
-
- If set and Python was compiled with ``COUNT_ALLOCS`` defined, Python will
-diff --git a/Doc/whatsnew/2.7.rst b/Doc/whatsnew/2.7.rst
-index f0d2428..b29593a 100644
---- a/Doc/whatsnew/2.7.rst
-+++ b/Doc/whatsnew/2.7.rst
-@@ -2548,6 +2548,10 @@ longer dumped by default anymore: the
:envvar:`PYTHONSHOWALLOCCOUNT` environment
- variable must now also be set. Moreover, allocation counts are now dumped into
- stderr, rather than stdout. (Contributed by Victor Stinner; :issue:`31692`.)
-
-+In debug mode, the ``[xxx refs]`` statistic is not written by default, the
-+:envvar:`PYTHONSHOWREFCOUNT` environment variable now must also be set.
-+(Contributed by Victor Stinner; :issue:`31733`.)
-+
- .. versionadded:: 2.7.15
-
-
-diff --git a/Python/pythonrun.c b/Python/pythonrun.c
-index d17f7f3..eb31e34 100644
---- a/Python/pythonrun.c
-+++ b/Python/pythonrun.c
-@@ -37,14 +37,6 @@
- #include "windows.h"
- #endif
-
--#ifndef Py_REF_DEBUG
--#define PRINT_TOTAL_REFS()
--#else /* Py_REF_DEBUG */
--#define PRINT_TOTAL_REFS() fprintf(stderr, \
-- "[%" PY_FORMAT_SIZE_T "d refs]\n",
\
-- _Py_GetRefTotal())
--#endif
--
- #ifdef __cplusplus
- extern "C" {
- #endif
-@@ -104,6 +96,21 @@ PyModule_GetWarningsModule(void)
- return PyImport_ImportModule("warnings");
- }
-
-+static void
-+_PyDebug_PrintTotalRefs(void)
-+{
-+#ifdef Py_REF_DEBUG
-+ Py_ssize_t total;
-+
-+ if (!Py_GETENV("PYTHONSHOWREFCOUNT")) {
-+ return;
-+ }
-+
-+ total = _Py_GetRefTotal();
-+ fprintf(stderr, "[%" PY_FORMAT_SIZE_T "d refs]\n", total);
-+#endif
-+}
-+
- static int initialized = 0;
-
- /* API to access the initialized flag -- useful for esoteric use */
-@@ -486,7 +493,7 @@ Py_Finalize(void)
- }
- #endif
-
-- PRINT_TOTAL_REFS();
-+ _PyDebug_PrintTotalRefs();
-
- #ifdef Py_TRACE_REFS
- /* Display all objects still alive -- this can invoke arbitrary
-@@ -777,7 +784,7 @@ PyRun_InteractiveLoopFlags(FILE *fp, const char *filename,
PyCompilerFlags *flag
- }
- for (;;) {
- ret = PyRun_InteractiveOneFlags(fp, filename, flags);
-- PRINT_TOTAL_REFS();
-+ _PyDebug_PrintTotalRefs();
- if (ret == E_EOF)
- return 0;
- /*
diff --git a/00285-fix-non-deterministic-read-in-test_pty.patch
b/00285-fix-non-deterministic-read-in-test_pty.patch
deleted file mode 100644
index 8605809..0000000
--- a/00285-fix-non-deterministic-read-in-test_pty.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-diff --git a/Lib/test/test_pty.py b/Lib/test/test_pty.py
-index bec38c45456..f623aa09620 100644
---- a/Lib/test/test_pty.py
-+++ b/Lib/test/test_pty.py
-@@ -11,6 +11,7 @@
- import select
- import signal
- import socket
-+import io # readline
- import unittest
-
- TEST_STRING_1 = "I wish to buy a fish license.\n"
-@@ -24,6 +25,16 @@ def debug(msg):
- pass
-
-
-+# Note that os.read() is nondeterministic so we need to be very careful
-+# to make the test suite deterministic. A normal call to os.read() may
-+# give us less than expected.
-+#
-+# Beware, on my Linux system, if I put 'foo\n' into a terminal fd, I get
-+# back 'foo\r\n' at the other end. The behavior depends on the termios
-+# setting. The newline translation may be OS-specific. To make the
-+# test suite deterministic and OS-independent, the functions _readline
-+# and normalize_output can be used.
-+
- def normalize_output(data):
- # Some operating systems do conversions on newline. We could possibly
- # fix that by doing the appropriate termios.tcsetattr()s. I couldn't
-@@ -45,6 +56,12 @@ def normalize_output(data):
-
- return data
-
-+def _readline(fd):
-+ """Read one line. May block forever if no newline is
read."""
-+ reader = io.FileIO(fd, mode='rb', closefd=False)
-+ return reader.readline()
-+
-+
-
- # Marginal testing of pty suite. Cannot do extensive 'do or fail' testing
- # because pty code is not too portable.
-@@ -97,14 +114,14 @@ def test_basic(self):
-
- debug("Writing to slave_fd")
- os.write(slave_fd, TEST_STRING_1)
-- s1 = os.read(master_fd, 1024)
-+ s1 = _readline(master_fd)
- self.assertEqual('I wish to buy a fish license.\n',
- normalize_output(s1))
-
- debug("Writing chunked output")
- os.write(slave_fd, TEST_STRING_2[:5])
- os.write(slave_fd, TEST_STRING_2[5:])
-- s2 = os.read(master_fd, 1024)
-+ s2 = _readline(master_fd)
- self.assertEqual('For my pet fish, Eric.\n', normalize_output(s2))
-
- os.close(slave_fd)
diff --git a/00287-fix-thread-hanging-on-inaccessible-nfs-server.patch
b/00287-fix-thread-hanging-on-inaccessible-nfs-server.patch
deleted file mode 100644
index 1dbb62f..0000000
--- a/00287-fix-thread-hanging-on-inaccessible-nfs-server.patch
+++ /dev/null
@@ -1,135 +0,0 @@
-diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c
-index 4a71a57ec0d..2b40ada195a 100644
---- a/Modules/_io/fileio.c
-+++ b/Modules/_io/fileio.c
-@@ -146,9 +146,15 @@ dircheck(fileio* self, PyObject *nameobj)
- {
- #if defined(HAVE_FSTAT) && defined(S_IFDIR) && defined(EISDIR)
- struct stat buf;
-+ int res;
- if (self->fd < 0)
- return 0;
-- if (fstat(self->fd, &buf) == 0 && S_ISDIR(buf.st_mode)) {
-+
-+ Py_BEGIN_ALLOW_THREADS
-+ res = fstat(self->fd, &buf);
-+ Py_END_ALLOW_THREADS
-+
-+ if (res == 0 && S_ISDIR(buf.st_mode)) {
- errno = EISDIR;
- PyErr_SetFromErrnoWithFilenameObject(PyExc_IOError, nameobj);
- return -1;
-@@ -162,17 +168,34 @@ check_fd(int fd)
- {
- #if defined(HAVE_FSTAT)
- struct stat buf;
-- if (!_PyVerify_fd(fd) || (fstat(fd, &buf) < 0 && errno == EBADF)) {
-- PyObject *exc;
-- char *msg = strerror(EBADF);
-- exc = PyObject_CallFunction(PyExc_OSError, "(is)",
-- EBADF, msg);
-- PyErr_SetObject(PyExc_OSError, exc);
-- Py_XDECREF(exc);
-- return -1;
-+ int res;
-+ PyObject *exc;
-+ char *msg;
-+
-+ if (!_PyVerify_fd(fd)) {
-+ goto badfd;
- }
--#endif
-+
-+ Py_BEGIN_ALLOW_THREADS
-+ res = fstat(fd, &buf);
-+ Py_END_ALLOW_THREADS
-+
-+ if (res < 0 && errno == EBADF) {
-+ goto badfd;
-+ }
-+
- return 0;
-+
-+badfd:
-+ msg = strerror(EBADF);
-+ exc = PyObject_CallFunction(PyExc_OSError, "(is)",
-+ EBADF, msg);
-+ PyErr_SetObject(PyExc_OSError, exc);
-+ Py_XDECREF(exc);
-+ return -1;
-+#else
-+ return 0;
-+#endif
- }
-
-
-@@ -519,9 +542,19 @@ new_buffersize(fileio *self, size_t currentsize)
- #ifdef HAVE_FSTAT
- off_t pos, end;
- struct stat st;
-- if (fstat(self->fd, &st) == 0) {
-+ int res;
-+
-+ Py_BEGIN_ALLOW_THREADS
-+ res = fstat(self->fd, &st);
-+ Py_END_ALLOW_THREADS
-+
-+ if (res == 0) {
- end = st.st_size;
-+
-+ Py_BEGIN_ALLOW_THREADS
- pos = lseek(self->fd, 0L, SEEK_CUR);
-+ Py_END_ALLOW_THREADS
-+
- /* Files claiming a size smaller than SMALLCHUNK may
- actually be streaming pseudo-files. In this case, we
- apply the more aggressive algorithm below.
-diff --git a/Objects/fileobject.c b/Objects/fileobject.c
-index 2f63c374d1e..8d1c5812f0d 100644
---- a/Objects/fileobject.c
-+++ b/Objects/fileobject.c
-@@ -121,10 +121,15 @@ dircheck(PyFileObject* f)
- {
- #if defined(HAVE_FSTAT) && defined(S_IFDIR) && defined(EISDIR)
- struct stat buf;
-+ int res;
- if (f->f_fp == NULL)
- return f;
-- if (fstat(fileno(f->f_fp), &buf) == 0 &&
-- S_ISDIR(buf.st_mode)) {
-+
-+ Py_BEGIN_ALLOW_THREADS
-+ res = fstat(fileno(f->f_fp), &buf);
-+ Py_END_ALLOW_THREADS
-+
-+ if (res == 0 && S_ISDIR(buf.st_mode)) {
- char *msg = strerror(EISDIR);
- PyObject *exc = PyObject_CallFunction(PyExc_IOError, "(isO)",
- EISDIR, msg, f->f_name);
-@@ -1010,7 +1015,13 @@ new_buffersize(PyFileObject *f, size_t currentsize)
- #ifdef HAVE_FSTAT
- off_t pos, end;
- struct stat st;
-- if (fstat(fileno(f->f_fp), &st) == 0) {
-+ int res;
-+
-+ Py_BEGIN_ALLOW_THREADS
-+ res = fstat(fileno(f->f_fp), &st);
-+ Py_END_ALLOW_THREADS
-+
-+ if (res == 0) {
- end = st.st_size;
- /* The following is not a bug: we really need to call lseek()
- *and* ftell(). The reason is that some stdio libraries
-@@ -1021,7 +1032,11 @@ new_buffersize(PyFileObject *f, size_t currentsize)
- works. We can't use the lseek() value either, because we
- need to take the amount of buffered data into account.
- (Yet another reason why stdio stinks. :-) */
-+
-+ Py_BEGIN_ALLOW_THREADS
- pos = lseek(fileno(f->f_fp), 0L, SEEK_CUR);
-+ Py_END_ALLOW_THREADS
-+
- if (pos >= 0) {
- pos = ftell(f->f_fp);
- }
diff --git a/00289-disable-nis-detection.patch b/00289-disable-nis-detection.patch
index baf69b5..4e185bb 100644
--- a/00289-disable-nis-detection.patch
+++ b/00289-disable-nis-detection.patch
@@ -1,26 +1,69 @@
-diff a/setup.py b/setup.py
---- a/setup.py 2018-01-17 11:58:45.384354567 +0100
-+++ b/setup.py 2018-01-17 11:54:23.384743168 +0100
-@@ -1346,19 +1346,10 @@
+diff --git a/setup.py b/setup.py
+index 585e380..9993f11 100644
+--- a/setup.py
++++ b/setup.py
+@@ -1346,11 +1346,7 @@ class PyBuildExt(build_ext):
else:
missing.append('resource')
-- # Sun yellow pages. Some systems have the functions in libc.
-- if (host_platform not in ['cygwin', 'atheos',
'qnx6'] and
-- find_file('rpcsvc/yp_prot.h', inc_dirs, []) is not None):
-- if (self.compiler.find_library_file(lib_dirs, 'nsl')):
-- libs = ['nsl']
-- else:
-- libs = []
-- exts.append( Extension('nis', ['nismodule.c'],
-- libraries = libs) )
+- nis = self._detect_nis(inc_dirs, lib_dirs)
+- if nis is not None:
+- exts.append(nis)
- else:
- missing.append('nis')
+ # nis (Sun yellow pages) is handled in Setup.dist
-+
- else:
-- missing.extend(['nis', 'resource', 'termios'])
-+ missing.extend(['resource', 'termios'])
# Curses support, requiring the System V version of curses, often
# provided by the ncurses library.
+@@ -2162,51 +2158,6 @@ class PyBuildExt(build_ext):
+ # for dlopen, see bpo-32647
+ ext.libraries.append('dl')
+
+- def _detect_nis(self, inc_dirs, lib_dirs):
+- if host_platform in {'win32', 'cygwin', 'qnx6'}:
+- return None
+-
+- libs = []
+- library_dirs = []
+- includes_dirs = []
+-
+- # bpo-32521: glibc has deprecated Sun RPC for some time. Fedora 28
+- # moved headers and libraries to libtirpc and libnsl. The headers
+- # are in tircp and nsl sub directories.
+- rpcsvc_inc = find_file(
+- 'rpcsvc/yp_prot.h', inc_dirs,
+- [os.path.join(inc_dir, 'nsl') for inc_dir in inc_dirs]
+- )
+- rpc_inc = find_file(
+- 'rpc/rpc.h', inc_dirs,
+- [os.path.join(inc_dir, 'tirpc') for inc_dir in inc_dirs]
+- )
+- if rpcsvc_inc is None or rpc_inc is None:
+- # not found
+- return None
+- includes_dirs.extend(rpcsvc_inc)
+- includes_dirs.extend(rpc_inc)
+-
+- if self.compiler.find_library_file(lib_dirs, 'nsl'):
+- libs.append('nsl')
+- else:
+- # libnsl-devel: check for libnsl in nsl/ subdirectory
+- nsl_dirs = [os.path.join(lib_dir, 'nsl') for lib_dir in lib_dirs]
+- libnsl = self.compiler.find_library_file(nsl_dirs, 'nsl')
+- if libnsl is not None:
+- library_dirs.append(os.path.dirname(libnsl))
+- libs.append('nsl')
+-
+- if self.compiler.find_library_file(lib_dirs, 'tirpc'):
+- libs.append('tirpc')
+-
+- return Extension(
+- 'nis', ['nismodule.c'],
+- libraries=libs,
+- library_dirs=library_dirs,
+- include_dirs=includes_dirs
+- )
+-
+
+ class PyBuildInstall(install):
+ # Suppress the warning about installation into the lib_dynload
diff --git a/00293-fix-gc-alignment.patch b/00293-fix-gc-alignment.patch
deleted file mode 100644
index 691b03e..0000000
--- a/00293-fix-gc-alignment.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-Fix for over-aligned GC info
-Patch by Florian Weimer
-
-See:
https://bugzilla.redhat.com/show_bug.cgi?id=1540316
-Upstream discussion:
https://mail.python.org/pipermail/python-dev/2018-January/152000.html
-
-diff --git a/Include/objimpl.h b/Include/objimpl.h
-index 55e83eced6..aa906144dc 100644
---- a/Include/objimpl.h
-+++ b/Include/objimpl.h
-@@ -248,6 +248,18 @@ PyAPI_FUNC(PyVarObject *) _PyObject_GC_Resize(PyVarObject *,
Py_ssize_t);
- /* for source compatibility with 2.2 */
- #define _PyObject_GC_Del PyObject_GC_Del
-
-+/* Former over-aligned definition of PyGC_Head, used to compute the
-+ size of the padding for the new version below. */
-+union _gc_head;
-+union _gc_head_old {
-+ struct {
-+ union _gc_head *gc_next;
-+ union _gc_head *gc_prev;
-+ Py_ssize_t gc_refs;
-+ } gc;
-+ long double dummy;
-+};
-+
- /* GC information is stored BEFORE the object structure. */
- typedef union _gc_head {
- struct {
-@@ -255,7 +267,8 @@ typedef union _gc_head {
- union _gc_head *gc_prev;
- Py_ssize_t gc_refs;
- } gc;
-- long double dummy; /* force worst-case alignment */
-+ double dummy; /* force worst-case alignment */
-+ char dummy_padding[sizeof(union _gc_head_old)];
- } PyGC_Head;
-
- extern PyGC_Head *_PyGC_generation0;
diff --git a/00297-fix-int-in-bool-context-warnings.patch
b/00297-fix-int-in-bool-context-warnings.patch
deleted file mode 100644
index 4f29f37..0000000
--- a/00297-fix-int-in-bool-context-warnings.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-commit fd39e2a6845f33a74fbb0671c434c0d84a5ec2f3
-Author: Christian Heimes <christian(a)python.org>
-Date: Fri Sep 15 20:27:23 2017 +0200
-
- bpo-31474: Fix -Wint-in-bool-context warnings (#3581)
-
- Signed-off-by: Christian Heimes <christian(a)python.org>
-
-diff --git a/Include/pymem.h b/Include/pymem.h
-index 10b5bea5eb..2c239df590 100644
---- a/Include/pymem.h
-+++ b/Include/pymem.h
-@@ -72,9 +72,9 @@ PyAPI_FUNC(void) PyMem_Free(void *);
- /* Returns NULL to indicate error if a negative size or size larger than
- Py_ssize_t can represent is supplied. Helps prevents security holes. */
- #define PyMem_MALLOC(n) ((size_t)(n) > (size_t)PY_SSIZE_T_MAX ? NULL \
-- : malloc((n) ? (n) : 1))
-+ : malloc(((n) != 0) ? (n) : 1))
- #define PyMem_REALLOC(p, n) ((size_t)(n) > (size_t)PY_SSIZE_T_MAX ? NULL \
-- : realloc((p), (n) ? (n) : 1))
-+ : realloc((p), ((n) != 0) ? (n) : 1))
- #define PyMem_FREE free
-
- #endif /* PYMALLOC_DEBUG */
diff --git a/00298-do-not-send-IP-in-SNI-TLS-extension.patch
b/00298-do-not-send-IP-in-SNI-TLS-extension.patch
deleted file mode 100644
index dc80f33..0000000
--- a/00298-do-not-send-IP-in-SNI-TLS-extension.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-diff --git a/Misc/NEWS.d/next/Library/2017-12-20-09-25-10.bpo-32185.IL0cMt.rst
b/Misc/NEWS.d/next/Library/2017-12-20-09-25-10.bpo-32185.IL0cMt.rst
-new file mode 100644
-index 000000000000..bfb2533b5dcf
---- /dev/null
-+++ b/Misc/NEWS.d/next/Library/2017-12-20-09-25-10.bpo-32185.IL0cMt.rst
-@@ -0,0 +1,2 @@
-+The SSL module no longer sends IP addresses in SNI TLS extension on
-+platforms with OpenSSL 1.0.2+ or inet_pton.
-diff --git a/Modules/_ssl.c b/Modules/_ssl.c
-index f70af266731a..b191b3a8687a 100644
---- a/Modules/_ssl.c
-+++ b/Modules/_ssl.c
-@@ -52,6 +52,11 @@
- #include <sys/poll.h>
- #endif
-
-+#ifndef MS_WINDOWS
-+/* inet_pton */
-+#include <arpa/inet.h>
-+#endif
-+
- /* Don't warn about deprecated functions */
- #ifdef __GNUC__
- #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-@@ -575,8 +580,41 @@ newPySSLSocket(PySSLContext *sslctx, PySocketSockObject *sock,
- SSL_set_mode(self->ssl, mode);
-
- #if HAVE_SNI
-- if (server_hostname != NULL)
-- SSL_set_tlsext_host_name(self->ssl, server_hostname);
-+ if (server_hostname != NULL) {
-+/* Don't send SNI for IP addresses. We cannot simply use inet_aton() and
-+ * inet_pton() here. inet_aton() may be linked weakly and inet_pton() isn't
-+ * available on all platforms. Use OpenSSL's IP address parser. It's
-+ * available since 1.0.2 and LibreSSL since at least 2.3.0. */
-+ int send_sni = 1;
-+#if OPENSSL_VERSION_NUMBER >= 0x10200000L
-+ ASN1_OCTET_STRING *ip = a2i_IPADDRESS(server_hostname);
-+ if (ip == NULL) {
-+ send_sni = 1;
-+ ERR_clear_error();
-+ } else {
-+ send_sni = 0;
-+ ASN1_OCTET_STRING_free(ip);
-+ }
-+#elif defined(HAVE_INET_PTON)
-+#ifdef ENABLE_IPV6
-+ char packed[Py_MAX(sizeof(struct in_addr), sizeof(struct in6_addr))];
-+#else
-+ char packed[sizeof(struct in_addr)];
-+#endif /* ENABLE_IPV6 */
-+ if (inet_pton(AF_INET, server_hostname, packed)) {
-+ send_sni = 0;
-+#ifdef ENABLE_IPV6
-+ } else if(inet_pton(AF_INET6, server_hostname, packed)) {
-+ send_sni = 0;
-+#endif /* ENABLE_IPV6 */
-+ } else {
-+ send_sni = 1;
-+ }
-+#endif /* HAVE_INET_PTON */
-+ if (send_sni) {
-+ SSL_set_tlsext_host_name(self->ssl, server_hostname);
-+ }
-+ }
- #endif
-
- /* If the socket is in non-blocking mode or timeout mode, set the BIO
diff --git a/00299-fix-ssl-module-pymax.patch b/00299-fix-ssl-module-pymax.patch
deleted file mode 100644
index 4f8c8da..0000000
--- a/00299-fix-ssl-module-pymax.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 439956a149f8a3eb44646498c63b2ef3337d5f3d Mon Sep 17 00:00:00 2001
-From: Christian Heimes <christian(a)python.org>
-Date: Sun, 25 Feb 2018 13:08:05 +0100
-Subject: [PATCH] Fix ssl module, Python 2.7 doesn't have Py_MAX (#5878)
-
-Signed-off-by: Christian Heimes <christian(a)python.org>
----
- Modules/_ssl.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/Modules/_ssl.c b/Modules/_ssl.c
-index af66a581e15a..f9ed94dee1e1 100644
---- a/Modules/_ssl.c
-+++ b/Modules/_ssl.c
-@@ -610,7 +610,8 @@ newPySSLSocket(PySSLContext *sslctx, PySocketSockObject *sock,
- }
- #elif defined(HAVE_INET_PTON)
- #ifdef ENABLE_IPV6
-- char packed[Py_MAX(sizeof(struct in_addr), sizeof(struct in6_addr))];
-+ #define PySSL_MAX(x, y) (((x) > (y)) ? (x) : (y))
-+ char packed[PySSL_MAX(sizeof(struct in_addr), sizeof(struct in6_addr))];
- #else
- char packed[sizeof(struct in_addr)];
- #endif /* ENABLE_IPV6 */
diff --git a/python2.spec b/python2.spec
index 8232b8b..10af069 100644
--- a/python2.spec
+++ b/python2.spec
@@ -103,8 +103,8 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
# Remember to also rebase python2-docs when changing this:
-Version: 2.7.14
-Release: 17%{?dist}
+Version: 2.7.15
+Release: 1%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -720,36 +720,6 @@ Patch193: 00193-enable-loading-sqlite-extensions.patch
# 00198 #
Patch198: 00198-add-rewheel-module.patch
-# 00280 #
-# The test `test_regrtest.test_crashed` fails on s390x architecture.
-#
https://bugs.python.org/issue31719
-Patch280: 00280-Fix-test_regrtest-test_crashed-on-s390x.patch
-
-# 00283 #
-# Fix tests on debug build configured with COUNT_ALLOCS,
-# and add a new environment variable PYTHONSHOWALLOCCOUNT:
-#
https://bugs.python.org/issue31692
-Patch283: 00283-fix-tests_with_COUNT_ALLOCS.patch
-
-# 00284 #
-# Add a new PYTHONSHOWREFCOUNT environment variable. In debug mode, Python now
-# will print the total reference count if PYTHONSHOWREFCOUNT is set.
-# Backported from upstream:
https://bugs.python.org/issue31733
-Patch284: 00284-add-PYTHONSHOWREFCOUNT-env-var.patch
-
-# 00285 #
-# Fix nondeterministic read in test_pty which fails randomly in koji.
-# Fixed upstream:
https://bugs.python.org/issue31158
-Patch285: 00285-fix-non-deterministic-read-in-test_pty.patch
-
-# 00287 #
-# On the creation of io.FileIO() and builtin file() objects the GIL is now released
-# when checking the file descriptor. io.FileIO.readall(), io.FileIO.read(), and
-# file.read() also now release the GIL when getting the file size, which fixes hanging
-# of all threads when trying to access an inaccessible NFS server.
-# Fixed upstream:
https://bugs.python.org/issue32186
-Patch287: 00287-fix-thread-hanging-on-inaccessible-nfs-server.patch
-
# 00288 #
# Adds a warning when /usr/bin/python is invoked during rpmbuild
# See
https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build
@@ -760,30 +730,6 @@ Patch288: 00288-ambiguous-python-version-rpmbuild-warn.patch
# (we handle it it in Setup.dist, see Patch0)
Patch289: 00289-disable-nis-detection.patch
-# 00293 #
-# Fix over-alignment of _gc_head, the structure for GC information
-# See
https://bugzilla.redhat.com/show_bug.cgi?id=1540316
-Patch293: 00293-fix-gc-alignment.patch
-
-# 00297 #
-# Fix -Wint-in-bool-context warnings that show up when compiling Python
-# (and, more importantly, Python libraries) with newer GCC.
-# See
https://bugzilla.redhat.com/show_bug.cgi?id=1473425
-# Fixed upstream:
https://github.com/python/cpython/pull/3581
-Patch297: 00297-fix-int-in-bool-context-warnings.patch
-
-# 00298 #
-# The SSL module no longer sends IP addresses in SNI TLS extension on
-# platforms with OpenSSL 1.0.2+ or inet_pton.
-# Fixed upstream:
https://bugs.python.org/issue32185
-Patch298: 00298-do-not-send-IP-in-SNI-TLS-extension.patch
-
-# 00299 #
-# Fix ssl module, Python 2.7 doesn't have Py_MAX
-# The previous patch 298 broke python2. This is a fixup.
-# Fixed upstream:
https://github.com/python/cpython/pull/5878
-Patch299: 00299-fix-ssl-module-pymax.patch
-
# (New patches go here ^^^)
#
# When adding new patches to "python2" and "python3" in Fedora, EL,
etc.,
@@ -1091,17 +1037,8 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%if %{with rewheel}
%patch198 -p1
%endif
-%patch280 -p1
-%patch283 -p1
-%patch284 -p1
-%patch285 -p1
-%patch287 -p1
%patch288 -p1
%patch289 -p1
-%patch293 -p1
-%patch297 -p1
-%patch298 -p1
-%patch299 -p1
%if 0%{?_module_build}
@@ -1999,6 +1936,9 @@ CheckPython \
# ======================================================
%changelog
+* Tue May 01 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.15-1
+- Update to version 2.7.15
+
* Wed Apr 25 2018 Tomas Orsava <torsava(a)redhat.com> - 2.7.14-17
- Change shebangs to the proper versioned binary
- Bytecompile files manually, disbale brp-python-bytecompile
diff --git a/sources b/sources
index dd576a7..e5dbb80 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (Python-2.7.14.tar.xz) =
78310b0be6388ffa15f29a80afb9ab3c03a572cb094e9da00cfe391afadb51696e41f592eb658d6a31a2f422fdac8a55214a382cbb8cfb43d4a127d5b35ea7f9
+SHA512 (Python-2.7.15.tar.xz) =
27ea43eb45fc68f3d2469d5f07636e10801dee11635a430ec8ec922ed790bb426b072da94df885e4dfa1ea8b7a24f2f56dd92f9b0f51e162330f161216bd6de6
commit 3be16be9fa8ac73aba410fac0f89f3fb1521976e
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Sat Apr 28 17:12:13 2018 +0200
Bytecompile files manually, disable brp-python-bytecompile
Resolves
https://bugzilla.redhat.com/show_bug.cgi?id=1572171
diff --git a/python2.spec b/python2.spec
index 49e4e97..8232b8b 100644
--- a/python2.spec
+++ b/python2.spec
@@ -62,18 +62,10 @@
%bcond_without tests
%endif
-# Some of the files below /usr/lib/pythonMAJOR.MINOR/test (e.g. bad_coding.py)
-# are deliberately invalid, leading to SyntaxError exceptions if they get
-# byte-compiled.
-#
-# These errors are ignored by the normal python build, and aren't normally a
-# problem in the buildroots since /usr/bin/python isn't present.
-#
-# However, for the case where we're rebuilding the python srpm on a machine
-# that does have python installed we need to set this to avoid
-# brp-python-bytecompile treating these as fatal errors:
-#
-%global _python_bytecompile_errors_terminate_build 0
+# Disable automatic bytecompilation. The python2.7 binary is not yet
+# available in /usr/bin when Python is built. Also, the bytecompilation fails
+# on files that test invalid syntax.
+%undefine __brp_python_bytecompile
# We need to get a newer configure generated out of configure.in for the following
# patches:
@@ -1537,6 +1529,19 @@ sed \
%endif # with debug_build
%endif # with_systemtap
+# Do bytecompilation with the newly installed interpreter.
+# compile *.pyo
+find %{buildroot} -type f -a -name "*.py" -print0 | \
+ LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \
+ PYTHONPATH="%{buildroot}%{_libdir}/python%{pybasever}
%{buildroot}%{_libdir}/python%{pybasever}/site-packages" \
+ xargs -0 %{buildroot}%{_bindir}/python%{pybasever} -O -c 'import py_compile, sys;
[py_compile.compile(f, dfile=f.partition("%{buildroot}")[2]) for f in
sys.argv[1:]]' || :
+# compile *.pyc
+find %{buildroot} -type f -a -name "*.py" -print0 | \
+ LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \
+ PYTHONPATH="%{buildroot}%{_libdir}/python%{pybasever}
%{buildroot}%{_libdir}/python%{pybasever}/site-packages" \
+ xargs -0 %{buildroot}%{_bindir}/python%{pybasever} -c 'import py_compile, sys;
[py_compile.compile(f, dfile=f.partition("%{buildroot}")[2]) for f in
sys.argv[1:]]' || :
+
+
# Make library-files user writable
/usr/bin/chmod 755 %{buildroot}%{dynload_dir}/*.so
/usr/bin/chmod 755 %{buildroot}%{_libdir}/libpython%{pybasever}.so.1.0
@@ -1996,6 +2001,8 @@ CheckPython \
%changelog
* Wed Apr 25 2018 Tomas Orsava <torsava(a)redhat.com> - 2.7.14-17
- Change shebangs to the proper versioned binary
+- Bytecompile files manually, disbale brp-python-bytecompile
+Resolves: rhbz#1572171
* Fri Apr 13 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.14-16
- Remove Obsoletes tag from when python was renamed to python2 (Fedora 25 was last)
commit b1a24b465f100ff1eed8ef7c6f447ab8a57cbfd1
Author: Tomas Orsava <torsava(a)redhat.com>
Date: Thu Apr 26 10:35:56 2018 +0200
Change shebangs to the proper versioned binary
diff --git a/python2.spec b/python2.spec
index 37c7347..49e4e97 100644
--- a/python2.spec
+++ b/python2.spec
@@ -112,7 +112,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python2-docs when changing this:
Version: 2.7.14
-Release: 16%{?dist}
+Release: 17%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1216,10 +1216,16 @@ make EXTRA_CFLAGS="$CFLAGS" %{?_smp_mflags}
# optimized python binary:
if $PathFixWithThisBinary
then
+ # pathfix.py currently only works with files matching ^[a-zA-Z0-9_]+\.py$
+ # when crawling through directories, so we handle the special cases manually
LD_LIBRARY_PATH="$topdir/$ConfDir" ./$BinaryName \
$topdir/Tools/scripts/pathfix.py \
- -i "/usr/bin/env $BinaryName" \
- $topdir
+ -i "%{_bindir}/python%{pybasever}" \
+ $topdir \
+ $topdir/Tools/pynche/pynche \
+ $topdir/Demo/pdist/{rcvs,rcsbump,rrcs} \
+ $topdir/Demo/scripts/find-uname.py \
+ $topdir/Tools/scripts/reindent-rst.py
fi
# Rebuild with new python
@@ -1988,6 +1994,9 @@ CheckPython \
# ======================================================
%changelog
+* Wed Apr 25 2018 Tomas Orsava <torsava(a)redhat.com> - 2.7.14-17
+- Change shebangs to the proper versioned binary
+
* Fri Apr 13 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.14-16
- Remove Obsoletes tag from when python was renamed to python2 (Fedora 25 was last)
commit 4856e50ce116af23647859e2ca032530556d140a
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Fri Apr 13 23:01:00 2018 +0200
Update the docs comment to mention python2-docs
diff --git a/python2.spec b/python2.spec
index 83accd0..37c7347 100644
--- a/python2.spec
+++ b/python2.spec
@@ -110,7 +110,7 @@
# ==================
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
-# Remember to also rebase python-docs when changing this:
+# Remember to also rebase python2-docs when changing this:
Version: 2.7.14
Release: 16%{?dist}
License: Python
commit 8545792aae837c1be52fb7c60c6bf0d62542a656
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Fri Apr 13 22:58:24 2018 +0200
Remove Obsoletes tag from when python was renamed to python2
Fedora 25 was last Fedora that had python, N+3 upgrades are not
supported, this can be merged to Fedora 28+.
diff --git a/python2.spec b/python2.spec
index f239aab..83accd0 100644
--- a/python2.spec
+++ b/python2.spec
@@ -112,7 +112,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.14
-Release: 15%{?dist}
+Release: 16%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -817,10 +817,6 @@ Patch5000: 05000-autotool-intermediates.patch
Provides: python = %{version}-%{release}
Provides: python%{?_isa} = %{version}-%{release}
-# All the obsolete tags similar to this one should be removed at Fedora 28
-# Also, according to the guidelines, this should be a hardcoded version,
-# but that was proven problematic, see rhbz#1457336
-Obsoletes: python < %{version}-%{release}
# Providing python27 as now multiple interpreters exist in Fedora
# alongside the system one e.g. python26, python33 etc
@@ -865,7 +861,6 @@ Requires: gdbm%{?_isa} >= 1:1.13
Provides: python-libs = %{version}-%{release}
Provides: python-libs%{?_isa} = %{version}-%{release}
-Obsoletes: python-libs < %{version}-%{release}
%description libs
This package contains files used to embed Python 2 into applications.
@@ -891,7 +886,6 @@ Conflicts: %{python} < %{version}-%{release}
Provides: python-devel = %{version}-%{release}
Provides: python-devel%{?_isa} = %{version}-%{release}
-Obsoletes: python-devel < %{version}-%{release}
%description devel
This package contains libraries and header files used to build applications
@@ -905,7 +899,6 @@ Requires: %{python}-tkinter = %{version}-%{release}
Provides: python-tools = %{version}-%{release}
Provides: python-tools%{?_isa} = %{version}-%{release}
-Obsoletes: python-tools < %{version}-%{release}
%description tools
This package includes several tools to help with the development of Python 2
@@ -923,7 +916,6 @@ Provides: tkinter2 = %{version}-%{release}
Provides: tkinter2%{?_isa} = %{version}-%{release}
Provides: python-tkinter = %{version}-%{release}
Provides: python-tkinter%{?_isa} = %{version}-%{release}
-Obsoletes: tkinter < %{version}-%{release}
%description tkinter
@@ -940,7 +932,6 @@ Requires: %{name} = %{version}-%{release}
Provides: python-test = %{version}-%{release}
Provides: python-test%{?_isa} = %{version}-%{release}
-Obsoletes: python-test < %{version}-%{release}
%description test
@@ -968,7 +959,6 @@ Requires: %{name}-tools%{?_isa} = %{version}-%{release}
Provides: python-debug = %{version}-%{release}
Provides: python-debug%{?_isa} = %{version}-%{release}
-Obsoletes: python-debug < %{version}-%{release}
%description debug
python2-debug provides a version of the Python 2 runtime with numerous debugging
@@ -1998,6 +1988,9 @@ CheckPython \
# ======================================================
%changelog
+* Fri Apr 13 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.14-16
+- Remove Obsoletes tag from when python was renamed to python2 (Fedora 25 was last)
+
* Wed Mar 14 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.14-15
- Fix broken SSL module
Resolves: rhbz#1555081
commit cc58e7d338d6c1f51924f08f16997f0cfb0f66bc
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Wed Mar 14 11:33:05 2018 +0100
Fix broken SSL module (#1555081)
diff --git a/00299-fix-ssl-module-pymax.patch b/00299-fix-ssl-module-pymax.patch
new file mode 100644
index 0000000..4f8c8da
--- /dev/null
+++ b/00299-fix-ssl-module-pymax.patch
@@ -0,0 +1,24 @@
+From 439956a149f8a3eb44646498c63b2ef3337d5f3d Mon Sep 17 00:00:00 2001
+From: Christian Heimes <christian(a)python.org>
+Date: Sun, 25 Feb 2018 13:08:05 +0100
+Subject: [PATCH] Fix ssl module, Python 2.7 doesn't have Py_MAX (#5878)
+
+Signed-off-by: Christian Heimes <christian(a)python.org>
+---
+ Modules/_ssl.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/Modules/_ssl.c b/Modules/_ssl.c
+index af66a581e15a..f9ed94dee1e1 100644
+--- a/Modules/_ssl.c
++++ b/Modules/_ssl.c
+@@ -610,7 +610,8 @@ newPySSLSocket(PySSLContext *sslctx, PySocketSockObject *sock,
+ }
+ #elif defined(HAVE_INET_PTON)
+ #ifdef ENABLE_IPV6
+- char packed[Py_MAX(sizeof(struct in_addr), sizeof(struct in6_addr))];
++ #define PySSL_MAX(x, y) (((x) > (y)) ? (x) : (y))
++ char packed[PySSL_MAX(sizeof(struct in_addr), sizeof(struct in6_addr))];
+ #else
+ char packed[sizeof(struct in_addr)];
+ #endif /* ENABLE_IPV6 */
diff --git a/python2.spec b/python2.spec
index 8cdbea3..f239aab 100644
--- a/python2.spec
+++ b/python2.spec
@@ -112,7 +112,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.14
-Release: 14%{?dist}
+Release: 15%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -786,6 +786,12 @@ Patch297: 00297-fix-int-in-bool-context-warnings.patch
# Fixed upstream:
https://bugs.python.org/issue32185
Patch298: 00298-do-not-send-IP-in-SNI-TLS-extension.patch
+# 00299 #
+# Fix ssl module, Python 2.7 doesn't have Py_MAX
+# The previous patch 298 broke python2. This is a fixup.
+# Fixed upstream:
https://github.com/python/cpython/pull/5878
+Patch299: 00299-fix-ssl-module-pymax.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python2" and "python3" in Fedora, EL,
etc.,
@@ -1113,6 +1119,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch293 -p1
%patch297 -p1
%patch298 -p1
+%patch299 -p1
%if 0%{?_module_build}
@@ -1991,6 +1998,10 @@ CheckPython \
# ======================================================
%changelog
+* Wed Mar 14 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.14-15
+- Fix broken SSL module
+Resolves: rhbz#1555081
+
* Tue Mar 13 2018 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.14-14
- Do not send IP addresses in SNI TLS extension
commit e1abe5a026e4ae70e3a5bd249c89a3b33e6bb0c1
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Tue Mar 13 17:09:14 2018 +0100
Do not send IP addresses in SNI TLS extension
diff --git a/00298-do-not-send-IP-in-SNI-TLS-extension.patch
b/00298-do-not-send-IP-in-SNI-TLS-extension.patch
new file mode 100644
index 0000000..dc80f33
--- /dev/null
+++ b/00298-do-not-send-IP-in-SNI-TLS-extension.patch
@@ -0,0 +1,68 @@
+diff --git a/Misc/NEWS.d/next/Library/2017-12-20-09-25-10.bpo-32185.IL0cMt.rst
b/Misc/NEWS.d/next/Library/2017-12-20-09-25-10.bpo-32185.IL0cMt.rst
+new file mode 100644
+index 000000000000..bfb2533b5dcf
+--- /dev/null
++++ b/Misc/NEWS.d/next/Library/2017-12-20-09-25-10.bpo-32185.IL0cMt.rst
+@@ -0,0 +1,2 @@
++The SSL module no longer sends IP addresses in SNI TLS extension on
++platforms with OpenSSL 1.0.2+ or inet_pton.
+diff --git a/Modules/_ssl.c b/Modules/_ssl.c
+index f70af266731a..b191b3a8687a 100644
+--- a/Modules/_ssl.c
++++ b/Modules/_ssl.c
+@@ -52,6 +52,11 @@
+ #include <sys/poll.h>
+ #endif
+
++#ifndef MS_WINDOWS
++/* inet_pton */
++#include <arpa/inet.h>
++#endif
++
+ /* Don't warn about deprecated functions */
+ #ifdef __GNUC__
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+@@ -575,8 +580,41 @@ newPySSLSocket(PySSLContext *sslctx, PySocketSockObject *sock,
+ SSL_set_mode(self->ssl, mode);
+
+ #if HAVE_SNI
+- if (server_hostname != NULL)
+- SSL_set_tlsext_host_name(self->ssl, server_hostname);
++ if (server_hostname != NULL) {
++/* Don't send SNI for IP addresses. We cannot simply use inet_aton() and
++ * inet_pton() here. inet_aton() may be linked weakly and inet_pton() isn't
++ * available on all platforms. Use OpenSSL's IP address parser. It's
++ * available since 1.0.2 and LibreSSL since at least 2.3.0. */
++ int send_sni = 1;
++#if OPENSSL_VERSION_NUMBER >= 0x10200000L
++ ASN1_OCTET_STRING *ip = a2i_IPADDRESS(server_hostname);
++ if (ip == NULL) {
++ send_sni = 1;
++ ERR_clear_error();
++ } else {
++ send_sni = 0;
++ ASN1_OCTET_STRING_free(ip);
++ }
++#elif defined(HAVE_INET_PTON)
++#ifdef ENABLE_IPV6
++ char packed[Py_MAX(sizeof(struct in_addr), sizeof(struct in6_addr))];
++#else
++ char packed[sizeof(struct in_addr)];
++#endif /* ENABLE_IPV6 */
++ if (inet_pton(AF_INET, server_hostname, packed)) {
++ send_sni = 0;
++#ifdef ENABLE_IPV6
++ } else if(inet_pton(AF_INET6, server_hostname, packed)) {
++ send_sni = 0;
++#endif /* ENABLE_IPV6 */
++ } else {
++ send_sni = 1;
++ }
++#endif /* HAVE_INET_PTON */
++ if (send_sni) {
++ SSL_set_tlsext_host_name(self->ssl, server_hostname);
++ }
++ }
+ #endif
+
+ /* If the socket is in non-blocking mode or timeout mode, set the BIO
diff --git a/python2.spec b/python2.spec
index 37f5803..8cdbea3 100644
--- a/python2.spec
+++ b/python2.spec
@@ -112,7 +112,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.14
-Release: 13%{?dist}
+Release: 14%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -780,6 +780,11 @@ Patch293: 00293-fix-gc-alignment.patch
# Fixed upstream:
https://github.com/python/cpython/pull/3581
Patch297: 00297-fix-int-in-bool-context-warnings.patch
+# 00298 #
+# The SSL module no longer sends IP addresses in SNI TLS extension on
+# platforms with OpenSSL 1.0.2+ or inet_pton.
+# Fixed upstream:
https://bugs.python.org/issue32185
+Patch298: 00298-do-not-send-IP-in-SNI-TLS-extension.patch
# (New patches go here ^^^)
#
@@ -1107,6 +1112,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch289 -p1
%patch293 -p1
%patch297 -p1
+%patch298 -p1
%if 0%{?_module_build}
@@ -1985,6 +1991,9 @@ CheckPython \
# ======================================================
%changelog
+* Tue Mar 13 2018 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.14-14
+- Do not send IP addresses in SNI TLS extension
+
* Mon Feb 26 2018 Petr Viktorin <pviktori(a)redhat.com> - 2.7.14-13
- Fix -Wint-in-bool-context warnings
Resolves: rhbz#1473425
commit 5316098666073320fec50e1bbf3a2b40a19df4ee
Author: Petr Viktorin <pviktori(a)redhat.com>
Date: Fri Feb 23 13:48:07 2018 +0100
Fix -Wint-in-bool-context warnings
diff --git a/00297-fix-int-in-bool-context-warnings.patch
b/00297-fix-int-in-bool-context-warnings.patch
new file mode 100644
index 0000000..4f29f37
--- /dev/null
+++ b/00297-fix-int-in-bool-context-warnings.patch
@@ -0,0 +1,24 @@
+commit fd39e2a6845f33a74fbb0671c434c0d84a5ec2f3
+Author: Christian Heimes <christian(a)python.org>
+Date: Fri Sep 15 20:27:23 2017 +0200
+
+ bpo-31474: Fix -Wint-in-bool-context warnings (#3581)
+
+ Signed-off-by: Christian Heimes <christian(a)python.org>
+
+diff --git a/Include/pymem.h b/Include/pymem.h
+index 10b5bea5eb..2c239df590 100644
+--- a/Include/pymem.h
++++ b/Include/pymem.h
+@@ -72,9 +72,9 @@ PyAPI_FUNC(void) PyMem_Free(void *);
+ /* Returns NULL to indicate error if a negative size or size larger than
+ Py_ssize_t can represent is supplied. Helps prevents security holes. */
+ #define PyMem_MALLOC(n) ((size_t)(n) > (size_t)PY_SSIZE_T_MAX ? NULL \
+- : malloc((n) ? (n) : 1))
++ : malloc(((n) != 0) ? (n) : 1))
+ #define PyMem_REALLOC(p, n) ((size_t)(n) > (size_t)PY_SSIZE_T_MAX ? NULL \
+- : realloc((p), (n) ? (n) : 1))
++ : realloc((p), ((n) != 0) ? (n) : 1))
+ #define PyMem_FREE free
+
+ #endif /* PYMALLOC_DEBUG */
diff --git a/python2.spec b/python2.spec
index 474da3b..37f5803 100644
--- a/python2.spec
+++ b/python2.spec
@@ -112,7 +112,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.14
-Release: 12%{?dist}
+Release: 13%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -773,6 +773,14 @@ Patch289: 00289-disable-nis-detection.patch
# See
https://bugzilla.redhat.com/show_bug.cgi?id=1540316
Patch293: 00293-fix-gc-alignment.patch
+# 00297 #
+# Fix -Wint-in-bool-context warnings that show up when compiling Python
+# (and, more importantly, Python libraries) with newer GCC.
+# See
https://bugzilla.redhat.com/show_bug.cgi?id=1473425
+# Fixed upstream:
https://github.com/python/cpython/pull/3581
+Patch297: 00297-fix-int-in-bool-context-warnings.patch
+
+
# (New patches go here ^^^)
#
# When adding new patches to "python2" and "python3" in Fedora, EL,
etc.,
@@ -1098,6 +1106,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch288 -p1
%patch289 -p1
%patch293 -p1
+%patch297 -p1
%if 0%{?_module_build}
@@ -1976,6 +1985,10 @@ CheckPython \
# ======================================================
%changelog
+* Mon Feb 26 2018 Petr Viktorin <pviktori(a)redhat.com> - 2.7.14-13
+- Fix -Wint-in-bool-context warnings
+Resolves: rhbz#1473425
+
* Sat Feb 24 2018 Florian Weimer <fweimer(a)redhat.com> - 2.7.14-12
- Rebuild with new LDFLAGS from redhat-rpm-config
commit 528a444ab64323da77b5ed3901810f2d358fcf01
Author: Florian Weimer <fweimer(a)redhat.com>
Date: Sat Feb 24 18:25:24 2018 +0100
Rebuild with new LDFLAGS from redhat-rpm-config
diff --git a/python2.spec b/python2.spec
index 6a9d0ed..474da3b 100644
--- a/python2.spec
+++ b/python2.spec
@@ -112,7 +112,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.14
-Release: 11%{?dist}
+Release: 12%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1976,6 +1976,9 @@ CheckPython \
# ======================================================
%changelog
+* Sat Feb 24 2018 Florian Weimer <fweimer(a)redhat.com> - 2.7.14-12
+- Rebuild with new LDFLAGS from redhat-rpm-config
+
* Thu Feb 15 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.14-11
- Move test.support and test.script_helper to python2-libs
Resolves: rhbz#1528899
commit b02c01e554ccb7189e991d622f070ed28bacca0f
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Thu Feb 15 17:01:53 2018 +0100
Move test.support and test.script_helper to python2-libs
Fixes
https://bugzilla.redhat.com/show_bug.cgi?id=1528899
When moving files around, explicit conflicts should be added, however
the dependency chain here (python2-test requires exact version-release of
python2, python2 requires exact version-release of python2-libs) prevents
instalation of python2-libs with greater version-release than python2-test.
diff --git a/python2.spec b/python2.spec
index d6cefd3..6a9d0ed 100644
--- a/python2.spec
+++ b/python2.spec
@@ -112,7 +112,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.14
-Release: 10%{?dist}
+Release: 11%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -930,7 +930,7 @@ These have been removed to save space, as they are never or almost
never used in production.
You might want to install the python2-test package if you're developing python 2
-code that uses more than just unittest and/or test_support.py.
+code that uses more than just unittest and/or test.support.
%if %{with debug_build}
%package debug
@@ -1720,9 +1720,15 @@ CheckPython \
%{pylibdir}/pydoc_data
%dir %{pylibdir}/sqlite3
%{pylibdir}/sqlite3/*.py*
+
+# Some bits of test are used for actual testing of stuff, not just python itself:
+# See also
https://bugzilla.redhat.com/show_bug.cgi?id=1528899
%dir %{pylibdir}/test
-%{pylibdir}/test/test_support.py*
%{pylibdir}/test/__init__.py*
+%{pylibdir}/test/support/
+%{pylibdir}/test/script_helper.py*
+%{pylibdir}/test/test_support.py*
+
%{pylibdir}/unittest
%{pylibdir}/wsgiref
%{pylibdir}/xml
@@ -1807,9 +1813,14 @@ CheckPython \
%{pylibdir}/lib2to3/tests
%{pylibdir}/sqlite3/test
%{pylibdir}/test/*
-# These two are shipped in the main subpackage:
-%exclude %{pylibdir}/test/test_support.py*
+
+# Some bits of test are used for actual testing of stuff, not just python itself:
+# See also
https://bugzilla.redhat.com/show_bug.cgi?id=1528899
%exclude %{pylibdir}/test/__init__.py*
+%exclude %{pylibdir}/test/support/
+%exclude %{pylibdir}/test/script_helper.py*
+%exclude %{pylibdir}/test/test_support.py*
+
%{dynload_dir}/_ctypes_test.so
%{dynload_dir}/_testcapimodule.so
@@ -1965,6 +1976,10 @@ CheckPython \
# ======================================================
%changelog
+* Thu Feb 15 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.14-11
+- Move test.support and test.script_helper to python2-libs
+Resolves: rhbz#1528899
+
* Fri Feb 09 2018 Fedora Release Engineering <releng(a)fedoraproject.org> -
2.7.14-10
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
commit 71264cf8473dcbaee5f86a0e2ff71043465ec482
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Wed Feb 14 09:28:24 2018 +0100
Remove %clean section
None of currently supported distributions need that.
Last one was EL5 which is EOL for a while.
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/python2.spec b/python2.spec
index aef95a9..d6cefd3 100644
--- a/python2.spec
+++ b/python2.spec
@@ -1591,9 +1591,6 @@ CheckPython \
# Cleaning up
# ======================================================
-%clean
-rm -fr %{buildroot}
-
%files
%defattr(-, root, root, -)
commit 1bdc5fed8a3078d56ea173f7ce74a037f4941e92
Author: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
Date: Wed Feb 14 00:53:42 2018 +0100
Remove BuildRoot definition
None of currently supported distributions need that.
It was needed last for EL5 which is EOL now
Signed-off-by: Igor Gnatenko <ignatenkobrain(a)fedoraproject.org>
diff --git a/python2.spec b/python2.spec
index ce14f44..aef95a9 100644
--- a/python2.spec
+++ b/python2.spec
@@ -807,7 +807,6 @@ Obsoletes: python < %{version}-%{release}
# alongside the system one e.g. python26, python33 etc
Provides: python27 = %{version}-%{release}
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
URL:
https://www.python.org/
commit 9c47bee6d8c82b1d4f40cdbb770858a65acbb35b
Author: Fedora Release Engineering <releng(a)fedoraproject.org>
Date: Fri Feb 9 11:53:31 2018 +0000
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng(a)fedoraproject.org>
diff --git a/python2.spec b/python2.spec
index 235e300..ce14f44 100644
--- a/python2.spec
+++ b/python2.spec
@@ -112,7 +112,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.14
-Release: 9%{?dist}
+Release: 10%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1969,6 +1969,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Fri Feb 09 2018 Fedora Release Engineering <releng(a)fedoraproject.org> -
2.7.14-10
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
+
* Tue Jan 30 2018 Petr Viktorin <pviktori(a)redhat.com> - 2.7.14-9
- Add patch 288: warn/fail if Python 2 is called as /usr/bin/python and
PYTHON_DISALLOW_AMBIGUOUS_VERSION is set
commit 11b080bc3c31c00171140368cfd8cfdcd526ccbe
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Mon Feb 5 17:55:07 2018 +0100
Remove obsolete scriptlets that are now automatic.
diff --git a/python2.spec b/python2.spec
index 15e8548..235e300 100644
--- a/python2.spec
+++ b/python2.spec
@@ -1596,16 +1596,6 @@ CheckPython \
rm -fr %{buildroot}
-# ======================================================
-# Scriptlets
-# ======================================================
-
-%post libs -p /sbin/ldconfig
-
-%postun libs -p /sbin/ldconfig
-
-
-
%files
%defattr(-, root, root, -)
%{!?_licensedir:%global license %%doc}
commit 96b18273ae8932a8e5d2a3d9da25fc321bdbe282
Author: Petr Viktorin <pviktori(a)redhat.com>
Date: Wed Jan 31 11:23:10 2018 +0100
Add patch 289: Fix for over-aligned GC info
diff --git a/00293-fix-gc-alignment.patch b/00293-fix-gc-alignment.patch
new file mode 100644
index 0000000..691b03e
--- /dev/null
+++ b/00293-fix-gc-alignment.patch
@@ -0,0 +1,39 @@
+Fix for over-aligned GC info
+Patch by Florian Weimer
+
+See:
https://bugzilla.redhat.com/show_bug.cgi?id=1540316
+Upstream discussion:
https://mail.python.org/pipermail/python-dev/2018-January/152000.html
+
+diff --git a/Include/objimpl.h b/Include/objimpl.h
+index 55e83eced6..aa906144dc 100644
+--- a/Include/objimpl.h
++++ b/Include/objimpl.h
+@@ -248,6 +248,18 @@ PyAPI_FUNC(PyVarObject *) _PyObject_GC_Resize(PyVarObject *,
Py_ssize_t);
+ /* for source compatibility with 2.2 */
+ #define _PyObject_GC_Del PyObject_GC_Del
+
++/* Former over-aligned definition of PyGC_Head, used to compute the
++ size of the padding for the new version below. */
++union _gc_head;
++union _gc_head_old {
++ struct {
++ union _gc_head *gc_next;
++ union _gc_head *gc_prev;
++ Py_ssize_t gc_refs;
++ } gc;
++ long double dummy;
++};
++
+ /* GC information is stored BEFORE the object structure. */
+ typedef union _gc_head {
+ struct {
+@@ -255,7 +267,8 @@ typedef union _gc_head {
+ union _gc_head *gc_prev;
+ Py_ssize_t gc_refs;
+ } gc;
+- long double dummy; /* force worst-case alignment */
++ double dummy; /* force worst-case alignment */
++ char dummy_padding[sizeof(union _gc_head_old)];
+ } PyGC_Head;
+
+ extern PyGC_Head *_PyGC_generation0;
diff --git a/python2.spec b/python2.spec
index 9c922a2..15e8548 100644
--- a/python2.spec
+++ b/python2.spec
@@ -768,6 +768,10 @@ Patch288: 00288-ambiguous-python-version-rpmbuild-warn.patch
# (we handle it it in Setup.dist, see Patch0)
Patch289: 00289-disable-nis-detection.patch
+# 00293 #
+# Fix over-alignment of _gc_head, the structure for GC information
+# See
https://bugzilla.redhat.com/show_bug.cgi?id=1540316
+Patch293: 00293-fix-gc-alignment.patch
# (New patches go here ^^^)
#
@@ -1094,6 +1098,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch287 -p1
%patch288 -p1
%patch289 -p1
+%patch293 -p1
%if 0%{?_module_build}
@@ -1977,6 +1982,7 @@ rm -fr %{buildroot}
* Tue Jan 30 2018 Petr Viktorin <pviktori(a)redhat.com> - 2.7.14-9
- Add patch 288: warn/fail if Python 2 is called as /usr/bin/python and
PYTHON_DISALLOW_AMBIGUOUS_VERSION is set
+- Add patch 289: Fix for over-aligned GC info
* Sat Jan 20 2018 Bjrn Esser <besser82(a)fedoraproject.org> - 2.7.14-8
- Rebuilt for switch to libxcrypt
commit 7143d8af3a3148044422d3a96fc52877e4fa6c21
Author: Petr Viktorin <pviktori(a)redhat.com>
Date: Tue Jan 30 10:10:31 2018 +0100
Warn/fail if /usr/bin/python is called with PYTHON_DISALLOW_AMBIGUOUS_VERSION
See
https://fedoraproject.org/wiki/User:Pviktori/Avoid_usr_bin_python_in_RPM_...
diff --git a/00288-ambiguous-python-version-rpmbuild-warn.patch
b/00288-ambiguous-python-version-rpmbuild-warn.patch
new file mode 100644
index 0000000..8da5151
--- /dev/null
+++ b/00288-ambiguous-python-version-rpmbuild-warn.patch
@@ -0,0 +1,53 @@
+diff -U3 -r Python-2.7.14.orig/Lib/site.py Python-2.7.14/Lib/site.py
+--- Python-2.7.14.orig/Lib/site.py 2018-01-29 15:05:04.517599815 +0100
++++ Python-2.7.14/Lib/site.py 2018-01-30 09:13:17.305270500 +0100
+@@ -515,6 +515,41 @@
+ "'import usercustomize' failed; use -v for traceback"
+
+
++def handle_ambiguous_python_version():
++ """Warn or fail if /usr/bin/python is used
++
++ Behavior depends on the value of PYTHON_DISALLOW_AMBIGUOUS_VERSION:
++ - "warn" - print warning to stderr
++ - "1" - print error and exit with positive exit code
++ - otherwise: do nothing
++
++ This is a Fedora modification, see the Change page for details:
++ See
https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build
++ """
++ if sys.executable == "/usr/bin/python":
++ setting = os.environ.get("PYTHON_DISALLOW_AMBIGUOUS_VERSION")
++ if setting == 'warn':
++ print>>sys.stderr, (
++ "DEPRECATION WARNING: python2 invoked with
/usr/bin/python.\n"
++ " Use /usr/bin/python3 or /usr/bin/python2\n"
++ " /usr/bin/python will be removed or switched to Python 3"
++ " in the future.\n"
++ " If you cannot make the switch now, please follow"
++ " instructions at"
++ "
https://fedoraproject.org/wiki/Changes/"
++ "Avoid_usr_bin_python_in_RPM_Build#Quick_Opt-Out")
++ elif setting == '1':
++ print>>sys.stderr, (
++ "ERROR: python2 invoked with /usr/bin/python.\n"
++ " Use /usr/bin/python3 or /usr/bin/python2\n"
++ " /usr/bin/python will be switched to Python 3"
++ " in the future.\n"
++ " More details are at"
++ "
https://fedoraproject.org/wiki/Changes/"
++ "Avoid_usr_bin_python_in_RPM_Build#Quick_Opt-Out")
++ exit(1)
++
++
+ def main():
+ global ENABLE_USER_SITE
+
+@@ -543,6 +578,7 @@
+ # this module is run as a script, because this code is executed twice.
+ if hasattr(sys, "setdefaultencoding"):
+ del sys.setdefaultencoding
++ handle_ambiguous_python_version()
+
+ main()
+
diff --git a/python2.spec b/python2.spec
index dd0bc61..9c922a2 100644
--- a/python2.spec
+++ b/python2.spec
@@ -112,7 +112,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.14
-Release: 8%{?dist}
+Release: 9%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -758,11 +758,17 @@ Patch285: 00285-fix-non-deterministic-read-in-test_pty.patch
# Fixed upstream:
https://bugs.python.org/issue32186
Patch287: 00287-fix-thread-hanging-on-inaccessible-nfs-server.patch
+# 00288 #
+# Adds a warning when /usr/bin/python is invoked during rpmbuild
+# See
https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build
+Patch288: 00288-ambiguous-python-version-rpmbuild-warn.patch
+
# 00289 #
# Disable automatic detection for the nis module
# (we handle it it in Setup.dist, see Patch0)
Patch289: 00289-disable-nis-detection.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python2" and "python3" in Fedora, EL,
etc.,
@@ -1086,6 +1092,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch284 -p1
%patch285 -p1
%patch287 -p1
+%patch288 -p1
%patch289 -p1
@@ -1967,6 +1974,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Tue Jan 30 2018 Petr Viktorin <pviktori(a)redhat.com> - 2.7.14-9
+- Add patch 288: warn/fail if Python 2 is called as /usr/bin/python and
+ PYTHON_DISALLOW_AMBIGUOUS_VERSION is set
+
* Sat Jan 20 2018 Bjrn Esser <besser82(a)fedoraproject.org> - 2.7.14-8
- Rebuilt for switch to libxcrypt
commit 9c6e188db09c1ab4cb4d2bd852e5d8f6bde98ad6
Author: Bjrn Esser <besser82(a)fedoraproject.org>
Date: Sat Jan 20 23:07:40 2018 +0100
Rebuilt for switch to libxcrypt
diff --git a/python2.spec b/python2.spec
index 77265df..dd0bc61 100644
--- a/python2.spec
+++ b/python2.spec
@@ -112,7 +112,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.14
-Release: 7%{?dist}
+Release: 8%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1967,6 +1967,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Sat Jan 20 2018 Bjrn Esser <besser82(a)fedoraproject.org> - 2.7.14-8
+- Rebuilt for switch to libxcrypt
+
* Wed Jan 17 2018 Petr Viktorin <pviktori(a)redhat.com> - 2.7.14-7
- Build the nis module with tirpc
commit 3056bfd92a4269ad8f9b57cab05af3125e87ca8c
Author: Petr Viktorin <pviktori(a)redhat.com>
Date: Wed Jan 17 13:58:28 2018 +0100
Build the nis module with tirpc
diff --git a/00102-2.7.13-lib64.patch b/00102-2.7.13-lib64.patch
index 5d20879..5a87d03 100644
--- a/00102-2.7.13-lib64.patch
+++ b/00102-2.7.13-lib64.patch
@@ -104,6 +104,15 @@ diff --git a/Modules/Setup.dist b/Modules/Setup.dist
index fbfa1c1..138fb33 100644
--- a/Modules/Setup.dist
+++ b/Modules/Setup.dist
+@@ -231,7 +231,7 @@
+ # Some more UNIX dependent modules -- off by default, since these
+ # are not supported by all UNIX systems:
+
+-nis nismodule.c -lnsl -ltirpc -I/usr/include/tirpc -I/usr/include/nsl -L/usr/lib/nsl
++nis nismodule.c -lnsl -ltirpc -I/usr/include/tirpc -I/usr/include/nsl -L/usr/lib64/nsl
+ termios termios.c # Steen Lumholt's termios module
+ resource resource.c # Jeremy Hylton's rlimit interface
+
@@ -416,7 +416,7 @@ gdbm gdbmmodule.c -lgdbm
# Edit the variables DB and DBLIBVERto point to the db top directory
# and the subdirectory of PORT where you built it.
diff --git a/00289-disable-nis-detection.patch b/00289-disable-nis-detection.patch
new file mode 100644
index 0000000..baf69b5
--- /dev/null
+++ b/00289-disable-nis-detection.patch
@@ -0,0 +1,26 @@
+diff a/setup.py b/setup.py
+--- a/setup.py 2018-01-17 11:58:45.384354567 +0100
++++ b/setup.py 2018-01-17 11:54:23.384743168 +0100
+@@ -1346,19 +1346,10 @@
+ else:
+ missing.append('resource')
+
+- # Sun yellow pages. Some systems have the functions in libc.
+- if (host_platform not in ['cygwin', 'atheos',
'qnx6'] and
+- find_file('rpcsvc/yp_prot.h', inc_dirs, []) is not None):
+- if (self.compiler.find_library_file(lib_dirs, 'nsl')):
+- libs = ['nsl']
+- else:
+- libs = []
+- exts.append( Extension('nis', ['nismodule.c'],
+- libraries = libs) )
+- else:
+- missing.append('nis')
++ # nis (Sun yellow pages) is handled in Setup.dist
++
+ else:
+- missing.extend(['nis', 'resource', 'termios'])
++ missing.extend(['resource', 'termios'])
+
+ # Curses support, requiring the System V version of curses, often
+ # provided by the ncurses library.
diff --git a/python-2.7.1-config.patch b/python-2.7.1-config.patch
index 6976d5c..5c8bd43 100644
--- a/python-2.7.1-config.patch
+++ b/python-2.7.1-config.patch
@@ -111,7 +111,7 @@
-#nis nismodule.c -lnsl # Sun yellow pages -- not everywhere
-#termios termios.c # Steen Lumholt's termios module
-#resource resource.c # Jeremy Hylton's rlimit interface
-+nis nismodule.c -lnsl # Sun yellow pages -- not everywhere
++nis nismodule.c -lnsl -ltirpc -I/usr/include/tirpc -I/usr/include/nsl -L/usr/lib/nsl
+termios termios.c # Steen Lumholt's termios module
+resource resource.c # Jeremy Hylton's rlimit interface
diff --git a/python2.spec b/python2.spec
index de0323d..77265df 100644
--- a/python2.spec
+++ b/python2.spec
@@ -112,7 +112,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.14
-Release: 6%{?dist}
+Release: 7%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -142,6 +142,10 @@ BuildRequires: readline-devel
BuildRequires: sqlite-devel
BuildRequires: tcl-devel
+# For the nis module
+BuildRequires: libnsl2-devel
+BuildRequires: libtirpc-devel
+
# expat 2.1.0 added the symbol XML_SetHashSalt without bumping SONAME. We use
# it (in pyexpat) in order to enable the fix in Python-2.7.3 for CVE-2012-0876:
BuildRequires: expat-devel >= 2.1.0
@@ -228,6 +232,7 @@ Source7: pynche
# - various modules are built by default by upstream as static libraries;
# we built them as shared libraries
# - build the "readline" module (appears to also be handled by setup.py now)
+# - build the nis module (which needs the tirpc library since glibc 2.26)
# - enable the build of the following modules:
# - array arraymodule.c # array objects
# - cmath cmathmodule.c # -lm # complex math library functions
@@ -254,7 +259,6 @@ Source7: pynche
# - _socket socketmodule.c # Socket module helper for socket(2)
# - _ssl _ssl.c
# - crypt cryptmodule.c -lcrypt # crypt(3)
-# - nis nismodule.c -lnsl # Sun yellow pages -- not everywhere
# - termios termios.c # Steen Lumholt's termios module
# - resource resource.c # Jeremy Hylton's rlimit interface
# - audioop audioop.c # Operations on audio samples
@@ -754,6 +758,11 @@ Patch285: 00285-fix-non-deterministic-read-in-test_pty.patch
# Fixed upstream:
https://bugs.python.org/issue32186
Patch287: 00287-fix-thread-hanging-on-inaccessible-nfs-server.patch
+# 00289 #
+# Disable automatic detection for the nis module
+# (we handle it it in Setup.dist, see Patch0)
+Patch289: 00289-disable-nis-detection.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python2" and "python3" in Fedora, EL,
etc.,
@@ -1077,6 +1086,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch284 -p1
%patch285 -p1
%patch287 -p1
+%patch289 -p1
%if 0%{?_module_build}
@@ -1957,6 +1967,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Wed Jan 17 2018 Petr Viktorin <pviktori(a)redhat.com> - 2.7.14-7
+- Build the nis module with tirpc
+
* Tue Jan 16 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.14-6
- Rebuild for reverted gdbm 1.13 on Fedora 27
commit 75ba8b986caca5f468e8af11f83395b7adb064ce
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Tue Jan 16 16:39:38 2018 +0100
Rebuild for reverted gdbm 1:1.13 on F27
diff --git a/python2.spec b/python2.spec
index 6d78510..de0323d 100644
--- a/python2.spec
+++ b/python2.spec
@@ -112,7 +112,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.14
-Release: 5%{?dist}
+Release: 6%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -149,7 +149,8 @@ BuildRequires: expat-devel >= 2.1.0
BuildRequires: findutils
BuildRequires: gcc-c++
%if %{with_gdbm}
-BuildRequires: gdbm-devel
+# ABI change without soname bump, reverted
+BuildRequires: gdbm-devel >= 1:1.13
%endif
%if ! 0%{?_module_build}
BuildRequires: libGL-devel
@@ -820,6 +821,11 @@ Requires: expat >= 2.1.0
# Python built with glibc >= 2.24.90-26 needs to require it (rhbz#1410644).
Requires: glibc%{?_isa} >= 2.24.90-26
+%if %{with_gdbm}
+# ABI change without soname bump, reverted
+Requires: gdbm%{?_isa} >= 1:1.13
+%endif
+
Provides: python-libs = %{version}-%{release}
Provides: python-libs%{?_isa} = %{version}-%{release}
Obsoletes: python-libs < %{version}-%{release}
@@ -1951,6 +1957,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Tue Jan 16 2018 Miro Hronok <mhroncok(a)redhat.com> - 2.7.14-6
+- Rebuild for reverted gdbm 1.13 on Fedora 27
+
* Thu Jan 11 2018 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.14-5
- Rebuild for gdbm 1.14
commit f2b472093a557d382a04265b7a0a51194f8e9fbf
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Thu Jan 11 15:10:39 2018 +0100
Rebuild for gdbm 1.14
diff --git a/python2.spec b/python2.spec
index 70b5e16..6d78510 100644
--- a/python2.spec
+++ b/python2.spec
@@ -112,7 +112,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.14
-Release: 4%{?dist}
+Release: 5%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1951,6 +1951,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu Jan 11 2018 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.14-5
+- Rebuild for gdbm 1.14
+
* Mon Dec 11 2017 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.14-4
- Fix hanging of all threads when trying to access an inaccessible NFS server.
commit cf221a53b134d822b29246734790132de4740598
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Mon Dec 11 13:35:09 2017 +0100
Fix hanging of all threads when trying to access an inaccessible NFS server.
Also mask some macros in comments.
diff --git a/00287-fix-thread-hanging-on-inaccessible-nfs-server.patch
b/00287-fix-thread-hanging-on-inaccessible-nfs-server.patch
new file mode 100644
index 0000000..1dbb62f
--- /dev/null
+++ b/00287-fix-thread-hanging-on-inaccessible-nfs-server.patch
@@ -0,0 +1,135 @@
+diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c
+index 4a71a57ec0d..2b40ada195a 100644
+--- a/Modules/_io/fileio.c
++++ b/Modules/_io/fileio.c
+@@ -146,9 +146,15 @@ dircheck(fileio* self, PyObject *nameobj)
+ {
+ #if defined(HAVE_FSTAT) && defined(S_IFDIR) && defined(EISDIR)
+ struct stat buf;
++ int res;
+ if (self->fd < 0)
+ return 0;
+- if (fstat(self->fd, &buf) == 0 && S_ISDIR(buf.st_mode)) {
++
++ Py_BEGIN_ALLOW_THREADS
++ res = fstat(self->fd, &buf);
++ Py_END_ALLOW_THREADS
++
++ if (res == 0 && S_ISDIR(buf.st_mode)) {
+ errno = EISDIR;
+ PyErr_SetFromErrnoWithFilenameObject(PyExc_IOError, nameobj);
+ return -1;
+@@ -162,17 +168,34 @@ check_fd(int fd)
+ {
+ #if defined(HAVE_FSTAT)
+ struct stat buf;
+- if (!_PyVerify_fd(fd) || (fstat(fd, &buf) < 0 && errno == EBADF)) {
+- PyObject *exc;
+- char *msg = strerror(EBADF);
+- exc = PyObject_CallFunction(PyExc_OSError, "(is)",
+- EBADF, msg);
+- PyErr_SetObject(PyExc_OSError, exc);
+- Py_XDECREF(exc);
+- return -1;
++ int res;
++ PyObject *exc;
++ char *msg;
++
++ if (!_PyVerify_fd(fd)) {
++ goto badfd;
+ }
+-#endif
++
++ Py_BEGIN_ALLOW_THREADS
++ res = fstat(fd, &buf);
++ Py_END_ALLOW_THREADS
++
++ if (res < 0 && errno == EBADF) {
++ goto badfd;
++ }
++
+ return 0;
++
++badfd:
++ msg = strerror(EBADF);
++ exc = PyObject_CallFunction(PyExc_OSError, "(is)",
++ EBADF, msg);
++ PyErr_SetObject(PyExc_OSError, exc);
++ Py_XDECREF(exc);
++ return -1;
++#else
++ return 0;
++#endif
+ }
+
+
+@@ -519,9 +542,19 @@ new_buffersize(fileio *self, size_t currentsize)
+ #ifdef HAVE_FSTAT
+ off_t pos, end;
+ struct stat st;
+- if (fstat(self->fd, &st) == 0) {
++ int res;
++
++ Py_BEGIN_ALLOW_THREADS
++ res = fstat(self->fd, &st);
++ Py_END_ALLOW_THREADS
++
++ if (res == 0) {
+ end = st.st_size;
++
++ Py_BEGIN_ALLOW_THREADS
+ pos = lseek(self->fd, 0L, SEEK_CUR);
++ Py_END_ALLOW_THREADS
++
+ /* Files claiming a size smaller than SMALLCHUNK may
+ actually be streaming pseudo-files. In this case, we
+ apply the more aggressive algorithm below.
+diff --git a/Objects/fileobject.c b/Objects/fileobject.c
+index 2f63c374d1e..8d1c5812f0d 100644
+--- a/Objects/fileobject.c
++++ b/Objects/fileobject.c
+@@ -121,10 +121,15 @@ dircheck(PyFileObject* f)
+ {
+ #if defined(HAVE_FSTAT) && defined(S_IFDIR) && defined(EISDIR)
+ struct stat buf;
++ int res;
+ if (f->f_fp == NULL)
+ return f;
+- if (fstat(fileno(f->f_fp), &buf) == 0 &&
+- S_ISDIR(buf.st_mode)) {
++
++ Py_BEGIN_ALLOW_THREADS
++ res = fstat(fileno(f->f_fp), &buf);
++ Py_END_ALLOW_THREADS
++
++ if (res == 0 && S_ISDIR(buf.st_mode)) {
+ char *msg = strerror(EISDIR);
+ PyObject *exc = PyObject_CallFunction(PyExc_IOError, "(isO)",
+ EISDIR, msg, f->f_name);
+@@ -1010,7 +1015,13 @@ new_buffersize(PyFileObject *f, size_t currentsize)
+ #ifdef HAVE_FSTAT
+ off_t pos, end;
+ struct stat st;
+- if (fstat(fileno(f->f_fp), &st) == 0) {
++ int res;
++
++ Py_BEGIN_ALLOW_THREADS
++ res = fstat(fileno(f->f_fp), &st);
++ Py_END_ALLOW_THREADS
++
++ if (res == 0) {
+ end = st.st_size;
+ /* The following is not a bug: we really need to call lseek()
+ *and* ftell(). The reason is that some stdio libraries
+@@ -1021,7 +1032,11 @@ new_buffersize(PyFileObject *f, size_t currentsize)
+ works. We can't use the lseek() value either, because we
+ need to take the amount of buffered data into account.
+ (Yet another reason why stdio stinks. :-) */
++
++ Py_BEGIN_ALLOW_THREADS
+ pos = lseek(fileno(f->f_fp), 0L, SEEK_CUR);
++ Py_END_ALLOW_THREADS
++
+ if (pos >= 0) {
+ pos = ftell(f->f_fp);
+ }
diff --git a/python2.spec b/python2.spec
index b822c79..70b5e16 100644
--- a/python2.spec
+++ b/python2.spec
@@ -112,7 +112,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.14
-Release: 3%{?dist}
+Release: 4%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -355,7 +355,7 @@ Patch17: python-2.6.4-distutils-rpath.patch
# for 2.7rc1 by dmalcolm:
Patch55: 00055-systemtap.patch
-# Only used when "%{_lib}" == "lib64"
+# Only used when "%%{_lib}" == "lib64"
# Fixup various paths throughout the build and in distutils from "lib" to
"lib64",
# and add the /usr/lib64/pythonMAJOR.MINOR/site-packages to sitedirs, in front of
# /usr/lib/pythonMAJOR.MINOR/site-packages
@@ -369,7 +369,7 @@ Patch102: 00102-2.7.13-lib64.patch
Patch103: python-2.7-lib64-sysconfig.patch
# 00104 #
-# Only used when "%{_lib}" == "lib64"
+# Only used when "%%{_lib}" == "lib64"
# Another lib64 fix, for distutils/tests/test_install.py; not upstream:
Patch104: 00104-lib64-fix-for-test_install.patch
@@ -745,6 +745,14 @@ Patch284: 00284-add-PYTHONSHOWREFCOUNT-env-var.patch
# Fixed upstream:
https://bugs.python.org/issue31158
Patch285: 00285-fix-non-deterministic-read-in-test_pty.patch
+# 00287 #
+# On the creation of io.FileIO() and builtin file() objects the GIL is now released
+# when checking the file descriptor. io.FileIO.readall(), io.FileIO.read(), and
+# file.read() also now release the GIL when getting the file size, which fixes hanging
+# of all threads when trying to access an inaccessible NFS server.
+# Fixed upstream:
https://bugs.python.org/issue32186
+Patch287: 00287-fix-thread-hanging-on-inaccessible-nfs-server.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python2" and "python3" in Fedora, EL,
etc.,
@@ -755,7 +763,7 @@ Patch285: 00285-fix-non-deterministic-read-in-test_pty.patch
#
https://fedoraproject.org/wiki/SIGs/Python/PythonPatches
# This is the generated patch to "configure"; see the description of
-# %{regenerate_autotooling_patch}
+# %%{regenerate_autotooling_patch}
# above:
# Disable tk for modularity builds to break up build dependencies
@@ -1062,6 +1070,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch283 -p1
%patch284 -p1
%patch285 -p1
+%patch287 -p1
%if 0%{?_module_build}
@@ -1942,6 +1951,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Mon Dec 11 2017 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.14-4
+- Fix hanging of all threads when trying to access an inaccessible NFS server.
+
* Thu Nov 09 2017 Miro Hronok <mhroncok(a)redhat.com> - 2.7.14-3
- Make the -devel package require redhat-rpm-config
Resolves: rhbz#1496757
commit 3bebf16e1652b4ecf471840ef31eabad9b88d516
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Thu Nov 9 12:44:53 2017 +0100
Make the -devel package require redhat-rpm-config
Resolves: rhbz#1496757
diff --git a/python2.spec b/python2.spec
index 377208c..b822c79 100644
--- a/python2.spec
+++ b/python2.spec
@@ -112,7 +112,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.14
-Release: 2%{?dist}
+Release: 3%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -827,6 +827,13 @@ Requires: python-rpm-macros
Requires: python2-rpm-macros
Requires: python3-rpm-generators
Requires: pkgconfig
+
+#
https://bugzilla.redhat.com/show_bug.cgi?id=1217376
+#
https://bugzilla.redhat.com/show_bug.cgi?id=1496757
+#
https://bugzilla.redhat.com/show_bug.cgi?id=1218294
+# TODO change to a specific subpackage once available (#1218294)
+Requires: redhat-rpm-config
+
# Needed here because of the migration of Makefile from -devel to the main
# package
Conflicts: %{python} < %{version}-%{release}
@@ -1935,6 +1942,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu Nov 09 2017 Miro Hronok <mhroncok(a)redhat.com> - 2.7.14-3
+- Make the -devel package require redhat-rpm-config
+Resolves: rhbz#1496757
+
* Thu Nov 02 2017 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.14-2
- Add a new PYTHONSHOWREFCOUNT environment variable for printing the reference
count in debug builds.
commit 9d3ac306c199b09909c29549c2c34f941124c151
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Thu Nov 2 16:44:28 2017 +0100
Fix nondeterministic read in test_pty
diff --git a/00285-fix-non-deterministic-read-in-test_pty.patch
b/00285-fix-non-deterministic-read-in-test_pty.patch
new file mode 100644
index 0000000..8605809
--- /dev/null
+++ b/00285-fix-non-deterministic-read-in-test_pty.patch
@@ -0,0 +1,59 @@
+diff --git a/Lib/test/test_pty.py b/Lib/test/test_pty.py
+index bec38c45456..f623aa09620 100644
+--- a/Lib/test/test_pty.py
++++ b/Lib/test/test_pty.py
+@@ -11,6 +11,7 @@
+ import select
+ import signal
+ import socket
++import io # readline
+ import unittest
+
+ TEST_STRING_1 = "I wish to buy a fish license.\n"
+@@ -24,6 +25,16 @@ def debug(msg):
+ pass
+
+
++# Note that os.read() is nondeterministic so we need to be very careful
++# to make the test suite deterministic. A normal call to os.read() may
++# give us less than expected.
++#
++# Beware, on my Linux system, if I put 'foo\n' into a terminal fd, I get
++# back 'foo\r\n' at the other end. The behavior depends on the termios
++# setting. The newline translation may be OS-specific. To make the
++# test suite deterministic and OS-independent, the functions _readline
++# and normalize_output can be used.
++
+ def normalize_output(data):
+ # Some operating systems do conversions on newline. We could possibly
+ # fix that by doing the appropriate termios.tcsetattr()s. I couldn't
+@@ -45,6 +56,12 @@ def normalize_output(data):
+
+ return data
+
++def _readline(fd):
++ """Read one line. May block forever if no newline is
read."""
++ reader = io.FileIO(fd, mode='rb', closefd=False)
++ return reader.readline()
++
++
+
+ # Marginal testing of pty suite. Cannot do extensive 'do or fail' testing
+ # because pty code is not too portable.
+@@ -97,14 +114,14 @@ def test_basic(self):
+
+ debug("Writing to slave_fd")
+ os.write(slave_fd, TEST_STRING_1)
+- s1 = os.read(master_fd, 1024)
++ s1 = _readline(master_fd)
+ self.assertEqual('I wish to buy a fish license.\n',
+ normalize_output(s1))
+
+ debug("Writing chunked output")
+ os.write(slave_fd, TEST_STRING_2[:5])
+ os.write(slave_fd, TEST_STRING_2[5:])
+- s2 = os.read(master_fd, 1024)
++ s2 = _readline(master_fd)
+ self.assertEqual('For my pet fish, Eric.\n', normalize_output(s2))
+
+ os.close(slave_fd)
diff --git a/python2.spec b/python2.spec
index f1462df..377208c 100644
--- a/python2.spec
+++ b/python2.spec
@@ -740,6 +740,11 @@ Patch283: 00283-fix-tests_with_COUNT_ALLOCS.patch
# Backported from upstream:
https://bugs.python.org/issue31733
Patch284: 00284-add-PYTHONSHOWREFCOUNT-env-var.patch
+# 00285 #
+# Fix nondeterministic read in test_pty which fails randomly in koji.
+# Fixed upstream:
https://bugs.python.org/issue31158
+Patch285: 00285-fix-non-deterministic-read-in-test_pty.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python2" and "python3" in Fedora, EL,
etc.,
@@ -1049,6 +1054,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch280 -p1
%patch283 -p1
%patch284 -p1
+%patch285 -p1
%if 0%{?_module_build}
@@ -1932,6 +1938,7 @@ rm -fr %{buildroot}
* Thu Nov 02 2017 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.14-2
- Add a new PYTHONSHOWREFCOUNT environment variable for printing the reference
count in debug builds.
+- Fix nondeterministic read in test_pty.
* Mon Oct 09 2017 Iryna Shcherbina <ishcherb(a)redhat.com> - 2.7.14-1
- Update to version 2.7.14
commit f948d41aff030bc36716217273e47311539fe5c7
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Thu Nov 2 16:33:52 2017 +0100
Add a new PYTHONSHOWREFCOUNT environment variable which when set
prints the number of references when using the debug build.
diff --git a/00283-fix-tests_with_COUNT_ALLOCS.patch
b/00283-fix-tests_with_COUNT_ALLOCS.patch
index 5845c43..358d473 100644
--- a/00283-fix-tests_with_COUNT_ALLOCS.patch
+++ b/00283-fix-tests_with_COUNT_ALLOCS.patch
@@ -59,6 +59,28 @@ index f00f7f6026a..55bc12893d6 100644
+ dump allocations counts into stderr on shutdown.
+
+ .. versionadded:: 2.7.15
+diff --git a/Doc/whatsnew/2.7.rst b/Doc/whatsnew/2.7.rst
+index 28a8d4b..f0d2428 100644
+--- a/Doc/whatsnew/2.7.rst
++++ b/Doc/whatsnew/2.7.rst
+@@ -2540,6 +2540,17 @@ exemption allowing new ``-3`` warnings to be added in any Python
2.7
+ maintenance release.
+
+
++Two new environment variables for debug mode
++--------------------------------------------
++
++When Python is compiled with ``COUNT_ALLOC`` defined, allocation counts are no
++longer dumped by default anymore: the :envvar:`PYTHONSHOWALLOCCOUNT` environment
++variable must now also be set. Moreover, allocation counts are now dumped into
++stderr, rather than stdout. (Contributed by Victor Stinner; :issue:`31692`.)
++
++.. versionadded:: 2.7.15
++
++
+ PEP 434: IDLE Enhancement Exception for All Branches
+ ----------------------------------------------------
+
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index 25df3ed0c41..d14a6620b5d 100644
--- a/Lib/test/support/__init__.py
@@ -145,16 +167,6 @@ index 415d5ebbd72..418481dadd8 100644
def test_callback_in_cycle_resurrection(self):
import gc
-diff --git a/Misc/NEWS.d/next/Core and Builtins/2017-10-09-11-03-13.bpo-31692.5-bpdk.rst
b/Misc/NEWS.d/next/Core and Builtins/2017-10-09-11-03-13.bpo-31692.5-bpdk.rst
-new file mode 100644
-index 00000000000..f32548c67bd
---- /dev/null
-+++ b/Misc/NEWS.d/next/Core and Builtins/2017-10-09-11-03-13.bpo-31692.5-bpdk.rst
-@@ -0,0 +1,4 @@
-+Add a new PYTHONSHOWALLOCCOUNT environment variable. When Python is compiled
-+with COUNT_ALLOCS, PYTHONSHOWALLOCCOUNT now has to be set to dump allocation
-+counts into stderr on shutdown. Moreover, allocations statistics are now dumped
-+into stderr rather than stdout.
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 677f6e48111..44fe13d2f7d 100644
--- a/Python/pythonrun.c
diff --git a/00284-add-PYTHONSHOWREFCOUNT-env-var.patch
b/00284-add-PYTHONSHOWREFCOUNT-env-var.patch
new file mode 100644
index 0000000..bfa71dc
--- /dev/null
+++ b/00284-add-PYTHONSHOWREFCOUNT-env-var.patch
@@ -0,0 +1,92 @@
+diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst
+index 55bc128..15d5830 100644
+--- a/Doc/using/cmdline.rst
++++ b/Doc/using/cmdline.rst
+@@ -664,6 +664,13 @@ if Python was configured with the ``--with-pydebug`` build option.
+ If set, Python will print memory allocation statistics every time a new
+ object arena is created, and on shutdown.
+
++.. envvar:: PYTHONSHOWREFCOUNT
++
++ If set, Python will print the total reference count when the program
++ finishes or after each statement in the interactive interpreter.
++
++ .. versionadded:: 2.7.15
++
+ .. envvar:: PYTHONSHOWALLOCCOUNT
+
+ If set and Python was compiled with ``COUNT_ALLOCS`` defined, Python will
+diff --git a/Doc/whatsnew/2.7.rst b/Doc/whatsnew/2.7.rst
+index f0d2428..b29593a 100644
+--- a/Doc/whatsnew/2.7.rst
++++ b/Doc/whatsnew/2.7.rst
+@@ -2548,6 +2548,10 @@ longer dumped by default anymore: the
:envvar:`PYTHONSHOWALLOCCOUNT` environment
+ variable must now also be set. Moreover, allocation counts are now dumped into
+ stderr, rather than stdout. (Contributed by Victor Stinner; :issue:`31692`.)
+
++In debug mode, the ``[xxx refs]`` statistic is not written by default, the
++:envvar:`PYTHONSHOWREFCOUNT` environment variable now must also be set.
++(Contributed by Victor Stinner; :issue:`31733`.)
++
+ .. versionadded:: 2.7.15
+
+
+diff --git a/Python/pythonrun.c b/Python/pythonrun.c
+index d17f7f3..eb31e34 100644
+--- a/Python/pythonrun.c
++++ b/Python/pythonrun.c
+@@ -37,14 +37,6 @@
+ #include "windows.h"
+ #endif
+
+-#ifndef Py_REF_DEBUG
+-#define PRINT_TOTAL_REFS()
+-#else /* Py_REF_DEBUG */
+-#define PRINT_TOTAL_REFS() fprintf(stderr, \
+- "[%" PY_FORMAT_SIZE_T "d refs]\n",
\
+- _Py_GetRefTotal())
+-#endif
+-
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+@@ -104,6 +96,21 @@ PyModule_GetWarningsModule(void)
+ return PyImport_ImportModule("warnings");
+ }
+
++static void
++_PyDebug_PrintTotalRefs(void)
++{
++#ifdef Py_REF_DEBUG
++ Py_ssize_t total;
++
++ if (!Py_GETENV("PYTHONSHOWREFCOUNT")) {
++ return;
++ }
++
++ total = _Py_GetRefTotal();
++ fprintf(stderr, "[%" PY_FORMAT_SIZE_T "d refs]\n", total);
++#endif
++}
++
+ static int initialized = 0;
+
+ /* API to access the initialized flag -- useful for esoteric use */
+@@ -486,7 +493,7 @@ Py_Finalize(void)
+ }
+ #endif
+
+- PRINT_TOTAL_REFS();
++ _PyDebug_PrintTotalRefs();
+
+ #ifdef Py_TRACE_REFS
+ /* Display all objects still alive -- this can invoke arbitrary
+@@ -777,7 +784,7 @@ PyRun_InteractiveLoopFlags(FILE *fp, const char *filename,
PyCompilerFlags *flag
+ }
+ for (;;) {
+ ret = PyRun_InteractiveOneFlags(fp, filename, flags);
+- PRINT_TOTAL_REFS();
++ _PyDebug_PrintTotalRefs();
+ if (ret == E_EOF)
+ return 0;
+ /*
diff --git a/python2.spec b/python2.spec
index 8366e1f..f1462df 100644
--- a/python2.spec
+++ b/python2.spec
@@ -112,7 +112,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.14
-Release: 1%{?dist}
+Release: 2%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -734,6 +734,12 @@ Patch280: 00280-Fix-test_regrtest-test_crashed-on-s390x.patch
#
https://bugs.python.org/issue31692
Patch283: 00283-fix-tests_with_COUNT_ALLOCS.patch
+# 00284 #
+# Add a new PYTHONSHOWREFCOUNT environment variable. In debug mode, Python now
+# will print the total reference count if PYTHONSHOWREFCOUNT is set.
+# Backported from upstream:
https://bugs.python.org/issue31733
+Patch284: 00284-add-PYTHONSHOWREFCOUNT-env-var.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python2" and "python3" in Fedora, EL,
etc.,
@@ -1040,8 +1046,9 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%if %{with rewheel}
%patch198 -p1
%endif
-%patch283 -p1
%patch280 -p1
+%patch283 -p1
+%patch284 -p1
%if 0%{?_module_build}
@@ -1922,6 +1929,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu Nov 02 2017 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.14-2
+- Add a new PYTHONSHOWREFCOUNT environment variable for printing the reference
+ count in debug builds.
+
* Mon Oct 09 2017 Iryna Shcherbina <ishcherb(a)redhat.com> - 2.7.14-1
- Update to version 2.7.14
commit 349b2233cba3833d8719084c284188920ed420b3
Author: Troy Dawson <tdawson(a)redhat.com>
Date: Mon Oct 23 10:20:54 2017 -0500
Require python2-setuptools even in modules
diff --git a/python2.spec b/python2.spec
index e04f61b..8366e1f 100644
--- a/python2.spec
+++ b/python2.spec
@@ -175,15 +175,15 @@ BuildRequires: valgrind-devel
BuildRequires: zlib-devel
-%if ! 0%{?_module_build}
%if %{with rewheel}
BuildRequires: python2-setuptools
-BuildRequires: python2-pip
-
Requires: python2-setuptools
+
+%if ! 0%{?_module_build}
+BuildRequires: python2-pip
Requires: python2-pip
-%endif
-%endif
+%endif # !module_build
+%endif # rewheel
commit 6bc3f63023f8d7d5b2e39c02b3de830b22067dde
Author: Iryna Shcherbina <ishcherb(a)redhat.com>
Date: Wed Oct 18 15:33:53 2017 +0200
Add patches for failing tests
- Replace COUNT_ALLOCS patches with upstreamed one
(patches added: 283; patches removed: 125, 134, 135, 141)
https://bugs.python.org/issue31692
- Add a patch to skip a failing test on s390x: 280
https://bugs.python.org/issue31719
diff --git a/00125-less-verbose-COUNT_ALLOCS.patch
b/00125-less-verbose-COUNT_ALLOCS.patch
deleted file mode 100644
index 8cef015..0000000
--- a/00125-less-verbose-COUNT_ALLOCS.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-diff -up Python-2.7/Python/pythonrun.c.less-verbose-COUNT_ALLOCS
Python-2.7/Python/pythonrun.c
---- Python-2.7/Python/pythonrun.c.less-verbose-COUNT_ALLOCS 2010-08-17 14:49:33.321913909
-0400
-+++ Python-2.7/Python/pythonrun.c 2010-08-17 14:54:48.750910403 -0400
-@@ -470,7 +470,15 @@ Py_Finalize(void)
-
- /* Debugging stuff */
- #ifdef COUNT_ALLOCS
-- dump_counts(stdout);
-+ /* This is a downstream Fedora modification.
-+ The upstream default with COUNT_ALLOCS is to always dump the counts to
-+ stdout on exit. For our debug builds its useful to have the info from
-+ COUNT_ALLOCS available, but the stdout info here gets in the way, so
-+ we make it optional, wrapping it in an environment variable (modelled
-+ on the other PYTHONDUMP* env variables):
-+ */
-+ if (Py_GETENV("PYTHONDUMPCOUNTS"))
-+ dump_counts(stdout);
- #endif
-
- PRINT_TOTAL_REFS();
diff --git a/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch
b/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch
deleted file mode 100644
index 71e7f68..0000000
--- a/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
-index 0dd4258..d9b3267 100644
---- a/Lib/test/test_sys.py
-+++ b/Lib/test/test_sys.py
-@@ -769,6 +769,11 @@ class SizeofTest(unittest.TestCase):
- '10P' # PySequenceMethods
- '6P' # PyBufferProcs
- '2P')
-+
-+ # COUNT_ALLOCS adds further fields to the end of a PyTypeObject:
-+ if hasattr(sys, 'getcounts'):
-+ s += size('P')
-+
- class newstyleclass(object):
- pass
- check(newstyleclass, s)
diff --git a/00135-skip-test-within-test_weakref-in-debug-build.patch
b/00135-skip-test-within-test_weakref-in-debug-build.patch
deleted file mode 100644
index e464aa9..0000000
--- a/00135-skip-test-within-test_weakref-in-debug-build.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-diff -up
Python-2.7.2/Lib/test/test_weakref.py.skip-test-within-test_weakref-in-debug-build
Python-2.7.2/Lib/test/test_weakref.py
----
Python-2.7.2/Lib/test/test_weakref.py.skip-test-within-test_weakref-in-debug-build 2011-09-08
17:55:09.675392260 -0400
-+++ Python-2.7.2/Lib/test/test_weakref.py 2011-09-08 17:59:08.857375903 -0400
-@@ -550,6 +550,14 @@ class ReferencesTestCase(TestBase):
- del c1, c2, C, D
- gc.collect()
-
-+ # In a debug build, this fails with:
-+ # AssertionError: Lists differ: [] != ['C went away']
-+ # Second list contains 1 additional elements.
-+ # First extra element 0:
-+ # C went away
-+ # - []
-+ # + ['C went away']
-+ @unittest.skipIf(hasattr(sys, 'getobjects'), 'debug build')
- def test_callback_in_cycle_resurrection(self):
- import gc
-
diff --git a/00141-fix-test_gc_with_COUNT_ALLOCS.patch
b/00141-fix-test_gc_with_COUNT_ALLOCS.patch
deleted file mode 100644
index d5bf3c9..0000000
--- a/00141-fix-test_gc_with_COUNT_ALLOCS.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -up Python-2.7.2/Lib/test/test_gc.py.fix-test_gc_with_COUNT_ALLOCS
Python-2.7.2/Lib/test/test_gc.py
---- Python-2.7.2/Lib/test/test_gc.py.fix-test_gc_with_COUNT_ALLOCS 2011-09-08
19:49:13.045924309 -0400
-+++ Python-2.7.2/Lib/test/test_gc.py 2011-09-08 19:50:07.035920617 -0400
-@@ -102,11 +102,17 @@ class GCTests(unittest.TestCase):
- del a
- self.assertNotEqual(gc.collect(), 0)
- del B, C
-- self.assertNotEqual(gc.collect(), 0)
-+ if hasattr(sys, 'getcounts'):
-+ self.assertEqual(gc.collect(), 0)
-+ else:
-+ self.assertNotEqual(gc.collect(), 0)
- A.a = A()
- del A
-- self.assertNotEqual(gc.collect(), 0)
-- self.assertEqual(gc.collect(), 0)
-+ if hasattr(sys, 'getcounts'):
-+ self.assertEqual(gc.collect(), 0)
-+ else:
-+ self.assertNotEqual(gc.collect(), 0)
-+ self.assertEqual(gc.collect(), 0)
-
- def test_method(self):
- # Tricky: self.__init__ is a bound method, it references the instance.
diff --git a/00280-Fix-test_regrtest-test_crashed-on-s390x.patch
b/00280-Fix-test_regrtest-test_crashed-on-s390x.patch
new file mode 100644
index 0000000..4a340c8
--- /dev/null
+++ b/00280-Fix-test_regrtest-test_crashed-on-s390x.patch
@@ -0,0 +1,88 @@
+From ab35adc682ec51800aa19a77de9947c6aaa50f41 Mon Sep 17 00:00:00 2001
+From: Victor Stinner <victor.stinner(a)gmail.com>
+Date: Fri, 6 Oct 2017 22:28:59 +0200
+Subject: [PATCH] bpo-31719: Fix test_regrtest.test_crashed() on s390x
+
+Add a new _testcapi._read_null() function to crash Python in a
+reliable way on s390x.
+
+On s390x, ctypes.string_at(0) returns an empty string rather than
+crashing.
+---
+ Lib/test/support/__init__.py | 4 ++--
+ Lib/test/test_regrtest.py | 2 ++
+ .../next/Tests/2017-10-06-22-37-38.bpo-31719.gHyrV3.rst | 3 +++
+ Modules/_testcapimodule.c | 17 +++++++++++++++++
+ 4 files changed, 24 insertions(+), 2 deletions(-)
+ create mode 100644 Misc/NEWS.d/next/Tests/2017-10-06-22-37-38.bpo-31719.gHyrV3.rst
+
+diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
+index ef474e00b68..25df3ed0c41 100644
+--- a/Lib/test/support/__init__.py
++++ b/Lib/test/support/__init__.py
+@@ -1960,6 +1960,6 @@ def _crash_python():
+ Use SuppressCrashReport() to prevent a crash report from popping up.
+ """
+
+- import ctypes
++ import _testcapi
+ with SuppressCrashReport():
+- ctypes.string_at(0)
++ _testcapi._read_null()
+diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
+index 264c74d22ba..aae274384c7 100644
+--- a/Lib/test/test_regrtest.py
++++ b/Lib/test/test_regrtest.py
+@@ -543,6 +543,8 @@ def test_method2(self):
+ testname)
+ self.assertEqual(output.splitlines(), all_methods)
+
++ @unittest.skipIf(sys.platform.startswith('aix'),
++ "support._crash_python() doesn't work on AIX")
+ def test_crashed(self):
+ # Any code which causes a crash
+ code = 'import test.support; test.support._crash_python()'
+diff --git a/Misc/NEWS.d/next/Tests/2017-10-06-22-37-38.bpo-31719.gHyrV3.rst
b/Misc/NEWS.d/next/Tests/2017-10-06-22-37-38.bpo-31719.gHyrV3.rst
+new file mode 100644
+index 00000000000..a06c5267251
+--- /dev/null
++++ b/Misc/NEWS.d/next/Tests/2017-10-06-22-37-38.bpo-31719.gHyrV3.rst
+@@ -0,0 +1,3 @@
++Fix test_regrtest.test_crashed() on s390x. Add a new _testcapi._read_null()
++function to crash Python in a reliable way on s390x. On s390x,
++ctypes.string_at(0) returns an empty string rather than crashing.
+diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
+index 7691b5188ff..5902de07823 100644
+--- a/Modules/_testcapimodule.c
++++ b/Modules/_testcapimodule.c
+@@ -2566,6 +2566,22 @@ py_w_stopcode(PyObject *self, PyObject *args)
+ #endif
+
+
++/* Read memory from NULL (address 0) to raise a SIGSEGV or SIGBUS signal
++ depending on the platform. This function is used by
++ test.support._crash_python() to "crash" Python. */
++static PyObject *
++read_null(PyObject *self, PyObject *args)
++{
++ volatile int *x;
++ volatile int y;
++
++ x = NULL;
++ y = *x;
++ return PyLong_FromLong(y);
++
++}
++
++
+ static PyMethodDef TestMethods[] = {
+ {"raise_exception", raise_exception,
METH_VARARGS},
+ {"set_errno", set_errno,
METH_VARARGS},
+@@ -2685,6 +2701,7 @@ static PyMethodDef TestMethods[] = {
+ #ifdef W_STOPCODE
+ {"W_STOPCODE", py_w_stopcode, METH_VARARGS},
+ #endif
++ {"_read_null", (PyCFunction)read_null, METH_NOARGS},
+ {NULL, NULL} /* sentinel */
+ };
+
diff --git a/00283-fix-tests_with_COUNT_ALLOCS.patch
b/00283-fix-tests_with_COUNT_ALLOCS.patch
new file mode 100644
index 0000000..5845c43
--- /dev/null
+++ b/00283-fix-tests_with_COUNT_ALLOCS.patch
@@ -0,0 +1,172 @@
+From 7b4ba62e388474e811268322b47f80d464933541 Mon Sep 17 00:00:00 2001
+From: Victor Stinner <victor.stinner(a)gmail.com>
+Date: Tue, 17 Oct 2017 02:25:23 -0700
+Subject: [PATCH] [2.7] bpo-31692: Add PYTHONSHOWALLOCCOUNT env var (GH-3927)
+
+bpo-31692, bpo-19527:
+
+* Add a new PYTHONSHOWALLOCCOUNT environment variable, similar to
+ the Python 3 "-X showalloccount" option
+* When Python is compiled with COUNT_ALLOCS, the new
+ PYTHONSHOWALLOCCOUNT environment variable now has to be set to dump
+ allocation counts into stderr on shutdown. Moreover, allocations
+ statistics are now dumped into stderr rather than stdout.
+* Add @test.support.requires_type_collecting decorator: skip test if
+ COUNT_ALLOCS is defined
+* Fix tests for COUNT_ALLOCS: decorate some methods with
+ @requires_type_collecting
+* test_sys.test_objecttypes(): update object type when COUNT_ALLOCS
+ is defined
+---
+ Doc/c-api/typeobj.rst | 2 +-
+ Doc/using/cmdline.rst | 7 +++++++
+ Lib/test/support/__init__.py | 3 +++
+ Lib/test/test_abc.py | 1 +
+ Lib/test/test_gc.py | 4 +++-
+ Lib/test/test_regrtest.py | 1 +
+ Lib/test/test_sys.py | 5 ++++-
+ Lib/test/test_weakref.py | 1 +
+ .../Core and Builtins/2017-10-09-11-03-13.bpo-31692.5-bpdk.rst | 4 ++++
+ Python/pythonrun.c | 4 +++-
+ 10 files changed, 28 insertions(+), 4 deletions(-)
+ create mode 100644 Misc/NEWS.d/next/Core and
Builtins/2017-10-09-11-03-13.bpo-31692.5-bpdk.rst
+
+diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst
+index 18edcdd7e5a..f0ccf2ea5fe 100644
+--- a/Doc/c-api/typeobj.rst
++++ b/Doc/c-api/typeobj.rst
+@@ -1101,7 +1101,7 @@ The next fields, up to and including
:c:member:`~PyTypeObject.tp_weaklist`, only
+ The remaining fields are only defined if the feature test macro
+ :const:`COUNT_ALLOCS` is defined, and are for internal use only. They are
+ documented here for completeness. None of these fields are inherited by
+-subtypes.
++subtypes. See the :envvar:`PYTHONSHOWALLOCCOUNT` environment variable.
+
+
+ .. c:member:: Py_ssize_t PyTypeObject.tp_allocs
+diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst
+index f00f7f6026a..55bc12893d6 100644
+--- a/Doc/using/cmdline.rst
++++ b/Doc/using/cmdline.rst
+@@ -663,3 +663,10 @@ if Python was configured with the ``--with-pydebug`` build option.
+
+ If set, Python will print memory allocation statistics every time a new
+ object arena is created, and on shutdown.
++
++.. envvar:: PYTHONSHOWALLOCCOUNT
++
++ If set and Python was compiled with ``COUNT_ALLOCS`` defined, Python will
++ dump allocations counts into stderr on shutdown.
++
++ .. versionadded:: 2.7.15
+diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
+index 25df3ed0c41..d14a6620b5d 100644
+--- a/Lib/test/support/__init__.py
++++ b/Lib/test/support/__init__.py
+@@ -1795,6 +1795,9 @@ def py3k_bytes(b):
+ except TypeError:
+ return bytes(b)
+
++requires_type_collecting = unittest.skipIf(hasattr(sys, 'getcounts'),
++ 'types are immortal if COUNT_ALLOCS is defined')
++
+ def args_from_interpreter_flags():
+ """Return a list of command-line arguments reproducing the current
+ settings in sys.flags."""
+diff --git a/Lib/test/test_abc.py b/Lib/test/test_abc.py
+index 6a8c3a13274..dbba37cdb6f 100644
+--- a/Lib/test/test_abc.py
++++ b/Lib/test/test_abc.py
+@@ -208,6 +208,7 @@ class C(A, B):
+ C()
+ self.assertEqual(B.counter, 1)
+
++ @test_support.requires_type_collecting
+ def test_cache_leak(self):
+ # See issue #2521.
+ class A(object):
+diff --git a/Lib/test/test_gc.py b/Lib/test/test_gc.py
+index ed01c9802fc..7e47b2d3a27 100644
+--- a/Lib/test/test_gc.py
++++ b/Lib/test/test_gc.py
+@@ -1,5 +1,6 @@
+ import unittest
+-from test.test_support import verbose, run_unittest, start_threads, import_module
++from test.support import (verbose, run_unittest, start_threads, import_module,
++ requires_type_collecting)
+ import sys
+ import sysconfig
+ import time
+@@ -90,6 +91,7 @@ class A:
+ del a
+ self.assertNotEqual(gc.collect(), 0)
+
++ @requires_type_collecting
+ def test_newinstance(self):
+ class A(object):
+ pass
+diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
+index aae274384c7..988a72c1099 100644
+--- a/Lib/test/test_regrtest.py
++++ b/Lib/test/test_regrtest.py
+@@ -493,6 +493,7 @@ def check_leak(self, code, what):
+ self.assertIn(line2, reflog)
+
+ @unittest.skipUnless(Py_DEBUG, 'need a debug build')
++ @support.requires_type_collecting
+ def test_huntrleaks(self):
+ # test --huntrleaks
+ code = textwrap.dedent("""
+diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
+index 5baaa352c0b..9342716272a 100644
+--- a/Lib/test/test_sys.py
++++ b/Lib/test/test_sys.py
+@@ -748,7 +748,10 @@ def delx(self): del self.__x
+ # tupleiterator
+ check(iter(()), size('lP'))
+ # type
+- s = vsize('P2P15Pl4PP9PP11PI' # PyTypeObject
++ fmt = 'P2P15Pl4PP9PP11PI'
++ if hasattr(sys, 'getcounts'):
++ fmt += '3P2P'
++ s = vsize(fmt + # PyTypeObject
+ '39P' # PyNumberMethods
+ '3P' # PyMappingMethods
+ '10P' # PySequenceMethods
+diff --git a/Lib/test/test_weakref.py b/Lib/test/test_weakref.py
+index 415d5ebbd72..418481dadd8 100644
+--- a/Lib/test/test_weakref.py
++++ b/Lib/test/test_weakref.py
+@@ -601,6 +601,7 @@ class D:
+ del c1, c2, C, D
+ gc.collect()
+
++ @test_support.requires_type_collecting
+ def test_callback_in_cycle_resurrection(self):
+ import gc
+
+diff --git a/Misc/NEWS.d/next/Core and Builtins/2017-10-09-11-03-13.bpo-31692.5-bpdk.rst
b/Misc/NEWS.d/next/Core and Builtins/2017-10-09-11-03-13.bpo-31692.5-bpdk.rst
+new file mode 100644
+index 00000000000..f32548c67bd
+--- /dev/null
++++ b/Misc/NEWS.d/next/Core and Builtins/2017-10-09-11-03-13.bpo-31692.5-bpdk.rst
+@@ -0,0 +1,4 @@
++Add a new PYTHONSHOWALLOCCOUNT environment variable. When Python is compiled
++with COUNT_ALLOCS, PYTHONSHOWALLOCCOUNT now has to be set to dump allocation
++counts into stderr on shutdown. Moreover, allocations statistics are now dumped
++into stderr rather than stdout.
+diff --git a/Python/pythonrun.c b/Python/pythonrun.c
+index 677f6e48111..44fe13d2f7d 100644
+--- a/Python/pythonrun.c
++++ b/Python/pythonrun.c
+@@ -488,7 +488,9 @@ Py_Finalize(void)
+
+ /* Debugging stuff */
+ #ifdef COUNT_ALLOCS
+- dump_counts(stdout);
++ if (Py_GETENV("PYTHONSHOWALLOCCOUNT")) {
++ dump_counts(stderr);
++ }
+ #endif
+
+ PRINT_TOTAL_REFS();
diff --git a/python2.spec b/python2.spec
index cb89db5..e04f61b 100644
--- a/python2.spec
+++ b/python2.spec
@@ -473,14 +473,6 @@ Patch114: 00114-statvfs-f_flag-constants.patch
# This patch adds the build Modules directory to build path.
Patch121: 00121-add-Modules-to-build-path.patch
-# 00125 #
-# COUNT_ALLOCS is useful for debugging, but the upstream behaviour of always
-# emitting debug info to stdout on exit is too verbose and makes it harder to
-# use the debug build. Add a "PYTHONDUMPCOUNTS" environment variable which
-# must be set to enable the output on exit
-# Not yet sent upstream
-Patch125: 00125-less-verbose-COUNT_ALLOCS.patch
-
# 2.7.1 (in r84230) added a test to test_abc which fails if python is
# configured with COUNT_ALLOCS, which is the case for our debug build
# (the COUNT_ALLOCS instrumentation keeps "C" alive).
@@ -529,16 +521,6 @@ Patch132: 00132-add-rpmbuild-hooks-to-unittest.patch
# "dl" is deprecated, and test_dl doesn't work on 64-bit builds:
Patch133: 00133-skip-test_dl.patch
-# 00134 #
-# Fix a failure in test_sys.py when configured with COUNT_ALLOCS enabled
-# Not yet sent upstream
-Patch134: 00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch
-
-# 00135 #
-# Skip "test_callback_in_cycle_resurrection" in a debug build, where it fails:
-# Not yet sent upstream
-Patch135: 00135-skip-test-within-test_weakref-in-debug-build.patch
-
# 00136 #
# Some tests try to seek on sys.stdin, but don't work as expected when run
# within Koji/mock; skip them within the rpm build:
@@ -563,11 +545,6 @@ Patch139: 00139-skip-test_float-known-failure-on-arm.patch
# which appears to be a libffi bug
Patch140: 00140-skip-test_ctypes-known-failure-on-sparc.patch
-# 00141 #
-# Fix test_gc's test_newinstance case when configured with COUNT_ALLOCS:
-# Not yet sent upstream
-Patch141: 00141-fix-test_gc_with_COUNT_ALLOCS.patch
-
# 00142 #
# Some pty tests fail when run in mock (rhbz#714627):
Patch142: 00142-skip-failing-pty-tests-in-rpmbuild.patch
@@ -746,6 +723,17 @@ Patch193: 00193-enable-loading-sqlite-extensions.patch
# 00198 #
Patch198: 00198-add-rewheel-module.patch
+# 00280 #
+# The test `test_regrtest.test_crashed` fails on s390x architecture.
+#
https://bugs.python.org/issue31719
+Patch280: 00280-Fix-test_regrtest-test_crashed-on-s390x.patch
+
+# 00283 #
+# Fix tests on debug build configured with COUNT_ALLOCS,
+# and add a new environment variable PYTHONSHOWALLOCCOUNT:
+#
https://bugs.python.org/issue31692
+Patch283: 00283-fix-tests_with_COUNT_ALLOCS.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python2" and "python3" in Fedora, EL,
etc.,
@@ -1005,7 +993,6 @@ rm -r Modules/zlib || exit 1
%patch121 -p1
-%patch125 -p1 -b .less-verbose-COUNT_ALLOCS
%patch128 -p1
%patch130 -p1
@@ -1016,8 +1003,6 @@ rm -r Modules/zlib || exit 1
%patch132 -p1
%patch133 -p1
-%patch134 -p1
-%patch135 -p1
%patch136 -p1 -b .stdin-test
%patch137 -p1
%patch138 -p1
@@ -1027,7 +1012,6 @@ rm -r Modules/zlib || exit 1
%ifarch %{sparc}
%patch140 -p1
%endif
-%patch141 -p1
%patch142 -p1 -b .tty-fail
%patch143 -p1 -b .tsc-on-ppc
%if !%{with_gdbm}
@@ -1056,6 +1040,9 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%if %{with rewheel}
%patch198 -p1
%endif
+%patch283 -p1
+%patch280 -p1
+
%if 0%{?_module_build}
%patch4000 -p1
commit 9db4c321af9f7fa7093b08e171c1ce4355268bd1
Author: Iryna Shcherbina <ishcherb(a)redhat.com>
Date: Wed Sep 27 15:53:44 2017 +0200
Update to 2.7.14
- Refactored patches: 55, 112, 153
- Upstreamed patches: 250, 269, 270
diff --git a/00055-systemtap.patch b/00055-systemtap.patch
index 63bc3f8..6ccc747 100644
--- a/00055-systemtap.patch
+++ b/00055-systemtap.patch
@@ -87,9 +87,9 @@ diff -up Python-2.7rc1/Makefile.pre.in.systemtap
Python-2.7rc1/Makefile.pre.in
@@ -1251,7 +1264,7 @@ Python/thread.o: @THREADHEADERS@
.PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
.PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
- .PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean
--.PHONY: smelly funny patchcheck touch altmaninstall commoninstall
-+.PHONY: smelly funny patchcheck touch altmaninstall commoninstall buildinclude
+ .PHONY: frameworkaltinstallunixtools recheck clean clobber distclean
+-.PHONY: smelly funny patchcheck altmaninstall commoninstall
++.PHONY: smelly funny patchcheck altmaninstall commoninstall buildinclude
.PHONY: gdbhooks
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
diff --git a/00112-2.7.13-debug-build.patch b/00112-2.7.13-debug-build.patch
index b7ba7ba..463f4d8 100644
--- a/00112-2.7.13-debug-build.patch
+++ b/00112-2.7.13-debug-build.patch
@@ -118,8 +118,8 @@ index 997a2fc..467e782 100644
+PYTHON= python$(DEBUG_SUFFIX)$(EXE)
+BUILDPYTHON= python$(DEBUG_SUFFIX)$(BUILDEXE)
+ PYTHON_FOR_REGEN=@PYTHON_FOR_REGEN@
PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@
- _PYTHON_HOST_PLATFORM=@_PYTHON_HOST_PLATFORM@
@@ -547,7 +553,7 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o
_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
@@ -194,8 +194,8 @@ index 997a2fc..467e782 100644
# pkgconfig directory
LIBPC= $(LIBDIR)/pkgconfig
--libainstall: all python-config
-+libainstall: all python$(DEBUG_SUFFIX)-config
+-libainstall: @DEF_MAKE_RULE@ python-config
++libainstall: @DEF_MAKE_RULE@ python$(DEBUG_SUFFIX)-config
@for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \
do \
if test ! -d $(DESTDIR)$$i; then \
diff --git a/00153-fix-test_gdb-noise.patch b/00153-fix-test_gdb-noise.patch
index a1b26d0..8884d4c 100644
--- a/00153-fix-test_gdb-noise.patch
+++ b/00153-fix-test_gdb-noise.patch
@@ -1,13 +1,13 @@
--- Lib/test/test_gdb.py.old 2012-04-11 21:04:01.367073855 -0400
+++ Lib/test/test_gdb.py 2012-04-12 08:52:58.320288761 -0400
-@@ -144,6 +153,10 @@
- 'Missing separate debuginfo for ',
- 'Try: zypper install -C ',
+@@ -211,6 +211,10 @@
+ # ignore all warnings
+ 'warning: ',
)
+ ignore_patterns += ('warning: Unable to open',
+ 'Missing separate debuginfo for',
+ 'Try: yum --disablerepo=',
+ 'Undefined set print command')
for line in errlines:
- if not line.startswith(ignore_patterns):
- unexpected_errlines.append(line)
+ if not line:
+ continue
diff --git a/00250-getentropy.patch b/00250-getentropy.patch
deleted file mode 100644
index 7e00061..0000000
--- a/00250-getentropy.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git a/Python/random.c b/Python/random.c
-index 2f83b5d..4cae217 100644
---- a/Python/random.c
-+++ b/Python/random.c
-@@ -97,8 +97,15 @@ win32_urandom(unsigned char *buffer, Py_ssize_t size, int raise)
- }
-
- /* Issue #25003: Don't use getentropy() on Solaris (available since
-- * Solaris 11.3), it is blocking whereas os.urandom() should not block. */
--#elif defined(HAVE_GETENTROPY) && !defined(sun)
-+ Solaris 11.3), it is blocking whereas os.urandom() should not block.
-+
-+ Issue #29188: Don't use getentropy() on Linux since the glibc 2.24
-+ implements it with the getrandom() syscall which can fail with ENOSYS,
-+ and this error is not supported in py_getentropy() and getrandom() is called
-+ with flags=0 which blocks until system urandom is initialized, which is not
-+ the desired behaviour to seed the Python hash secret nor for os.urandom():
-+ see the PEP 524 which was only implemented in Python 3.6. */
-+#elif defined(HAVE_GETENTROPY) && !defined(sun) && !defined(linux)
- #define PY_GETENTROPY 1
-
- /* Fill buffer with size pseudo-random bytes generated by getentropy().
diff --git a/00269-fix-multiple-compilations-issue-with-pgo-builds.patch
b/00269-fix-multiple-compilations-issue-with-pgo-builds.patch
deleted file mode 100644
index 2e5b33d..0000000
--- a/00269-fix-multiple-compilations-issue-with-pgo-builds.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/Makefile.pre.in b/Makefile.pre.in
-index 9e4be0a..a58b59c 100644
---- a/Makefile.pre.in
-+++ b/Makefile.pre.in
-@@ -863,12 +863,12 @@ $(LIBRARY_OBJS) $(MODOBJS) Modules/python.o: $(PYTHON_HEADERS)
- TESTOPTS= -l $(EXTRATESTOPTS)
- TESTPROG= $(srcdir)/Lib/test/regrtest.py
- TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS)
--test: all platform
-+test: @DEF_MAKE_RULE@ platform
- -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
- -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
- $(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
-
--testall: all platform
-+testall: @DEF_MAKE_RULE@ platform
- -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
- $(TESTPYTHON) $(srcdir)/Lib/compileall.py
- -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
-@@ -877,7 +877,7 @@ testall: all platform
-
- # Run the unitests for both architectures in a Universal build on OSX
- # Must be run on an Intel box.
--testuniversal: all platform
-+testuniversal: @DEF_MAKE_RULE@ platform
- if [ `arch` != 'i386' ];then \
- echo "This can only be used on OSX/i386" ;\
- exit 1 ;\
-@@ -900,14 +900,14 @@ QUICKTESTOPTS= $(TESTOPTS) -x test_subprocess test_io test_lib2to3
\
- test_multibytecodec test_urllib2_localnet test_itertools \
- test_multiprocessing test_mailbox test_socket test_poll \
- test_select test_zipfile
--quicktest: all platform
-+quicktest: @DEF_MAKE_RULE@ platform
- -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
- -$(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
- $(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
-
- MEMTESTOPTS= $(QUICKTESTOPTS) -x test_dl test___all__ test_fork1 \
- test_longexp
--memtest: all platform
-+memtest: @DEF_MAKE_RULE@ platform
- -rm -f $(srcdir)/Lib/test/*.py[co]
- -$(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
- $(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
-@@ -1198,7 +1198,7 @@ LIBPL= $(LIBP)/config$(DEBUG_SUFFIX)
- # pkgconfig directory
- LIBPC= $(LIBDIR)/pkgconfig
-
--libainstall: all python$(DEBUG_SUFFIX)-config
-+libainstall: @DEF_MAKE_RULE@ python$(DEBUG_SUFFIX)-config
- @for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \
- do \
- if test ! -d $(DESTDIR)$$i; then \
-@@ -1425,7 +1425,7 @@ distclean: clobber
- -exec rm -f {} ';'
-
- # Check for smelly exported symbols (not starting with Py/_Py)
--smelly: all
-+smelly: @DEF_MAKE_RULE@
- nm -p $(LIBRARY) | \
- sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \
-
diff --git a/00270-fix-ssl-alpn-hook-test.patch b/00270-fix-ssl-alpn-hook-test.patch
deleted file mode 100644
index 97b433e..0000000
--- a/00270-fix-ssl-alpn-hook-test.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
-index d203cdd..c128dae 100644
---- a/Lib/test/test_ssl.py
-+++ b/Lib/test/test_ssl.py
-@@ -3256,8 +3256,9 @@ if _have_threads:
- except ssl.SSLError as e:
- stats = e
-
-- if expected is None and IS_OPENSSL_1_1:
-- # OpenSSL 1.1.0 raises handshake error
-+ if (expected is None and IS_OPENSSL_1_1
-+ and ssl.OPENSSL_VERSION_INFO < (1, 1, 0, 6)):
-+ # OpenSSL 1.1.0 to 1.1.0e raises handshake error
- self.assertIsInstance(stats, ssl.SSLError)
- else:
- msg = "failed trying %s (s) and %s (c).\n" \
diff --git a/python2.spec b/python2.spec
index 5f6e0c6..cb89db5 100644
--- a/python2.spec
+++ b/python2.spec
@@ -111,8 +111,8 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
# Remember to also rebase python-docs when changing this:
-Version: 2.7.13
-Release: 18%{?dist}
+Version: 2.7.14
+Release: 1%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -746,25 +746,6 @@ Patch193: 00193-enable-loading-sqlite-extensions.patch
# 00198 #
Patch198: 00198-add-rewheel-module.patch
-# 00250 #
-# After glibc-2.24.90, Python failed to start on EL7 kernel
-# rhbz#1410175:
https://bugzilla.redhat.com/show_bug.cgi?id=1410175
-#
http://bugs.python.org/issue29157
-# Fixed upstream:
https://hg.python.org/cpython/rev/13a39142c047
-Patch250: 00250-getentropy.patch
-
-# 00269 #
-# Fix python's recompilation with common build commands when using
-# profile guided optimizations.
-# Fixed upstream:
http://bugs.python.org/issue29243
-Patch269: 00269-fix-multiple-compilations-issue-with-pgo-builds.patch
-
-# 00270 #
-# Fix test_alpn_protocols from test_ssl as openssl > 1.1.0f
-# changed the behaviour of the ALPN hook.
-# Fixed upstream:
http://bugs.python.org/issue30714
-Patch270: 00270-fix-ssl-alpn-hook-test.patch
-
# (New patches go here ^^^)
#
# When adding new patches to "python2" and "python3" in Fedora, EL,
etc.,
@@ -1076,10 +1057,6 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch198 -p1
%endif
-%patch250 -p1
-%patch269 -p1
-%patch270 -p1
-
%if 0%{?_module_build}
%patch4000 -p1
%endif
@@ -1958,6 +1935,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Mon Oct 09 2017 Iryna Shcherbina <ishcherb(a)redhat.com> - 2.7.14-1
+- Update to version 2.7.14
+
* Thu Aug 31 2017 Tomas Orsava <torsava(a)redhat.com> - 2.7.13-18
- Switch some macros into bconds to facilitate modularity
diff --git a/sources b/sources
index a72e73a..dd576a7 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (Python-2.7.13.tar.xz) =
f37c9a28ce129d01e63c84d7db627a06402854578f62d17927334ea21ede318e04bbf66e890e3f47c85333e6b19f6e5581fb3f3e27efd24be27017d1b6529c4b
+SHA512 (Python-2.7.14.tar.xz) =
78310b0be6388ffa15f29a80afb9ab3c03a572cb094e9da00cfe391afadb51696e41f592eb658d6a31a2f422fdac8a55214a382cbb8cfb43d4a127d5b35ea7f9
commit 57e494a406537556cead38c5bf5a9e7d97503137
Author: Carl George <carl(a)george.computer>
Date: Wed Sep 20 13:43:54 2017 -0500
drop patch 173
This was resolved upstream in 3.3/3.4. The fix was later backported to 2.7.7rc1.
https://bugs.python.org/issue19901
https://github.com/python/cpython/commit/d82634d606583d7e2a55f57be70882a7...
https://github.com/python/cpython/blob/2.7/Misc/NEWS.d/2.7.7rc1.rst
diff --git a/00173-workaround-ENOPROTOOPT-in-bind_port.patch
b/00173-workaround-ENOPROTOOPT-in-bind_port.patch
deleted file mode 100644
index 3e83d67..0000000
--- a/00173-workaround-ENOPROTOOPT-in-bind_port.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff -up Python-2.7.3/Lib/test/test_support.py.rhbz913732
Python-2.7.3/Lib/test/test_support.py
---- Python-2.7.3/Lib/test/test_support.py.rhbz913732 2013-03-04 16:11:53.757315921 -0500
-+++ Python-2.7.3/Lib/test/test_support.py 2013-03-04 16:12:11.331314722 -0500
-@@ -304,7 +304,8 @@ def bind_port(sock, host=HOST):
- if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR) == 1:
- raise TestFailed("tests should never set the SO_REUSEADDR "
\
- "socket option on TCP/IP sockets!")
-- if hasattr(socket, 'SO_REUSEPORT'):
-+ if hasattr(socket, 'SO_REUSEPORT') \
-+ and 'WITHIN_PYTHON_RPM_BUILD' not in os.environ: # rhbz#913732
- try:
- if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) == 1:
- raise TestFailed("tests should never set the SO_REUSEPORT
" \
- "socket option on TCP/IP sockets!")
diff --git a/python2.spec b/python2.spec
index e1f2d04..5f6e0c6 100644
--- a/python2.spec
+++ b/python2.spec
@@ -691,12 +691,6 @@ Patch169: 00169-avoid-implicit-usage-of-md5-in-multiprocessing.patch
# (rhbz#850013)
Patch170: 00170-gc-assertions.patch
-# 00173 #
-# Workaround for ENOPROTOOPT seen in Koji within
-# test.test_support.bind_port()
-# (rhbz#913732)
-Patch173: 00173-workaround-ENOPROTOOPT-in-bind_port.patch
-
# 00174 #
# Workaround for failure to set up prefix/exec_prefix when running
# an embededed libpython that sets Py_SetProgramName() to a name not
@@ -1070,7 +1064,6 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch168 -p1
%patch169 -p1
%patch170 -p1
-%patch173 -p1
%patch174 -p1 -b .fix-for-usr-move
%patch180 -p1
%patch181 -p1
commit e4e4dbbeea4c3c739eaea260ec4c8acee0e96e1f
Author: Tomas Orsava <torsava(a)redhat.com>
Date: Thu Aug 31 11:11:41 2017 +0200
Switch some macros into bconds to facilitate modularity
Bconds can be switched on/off in modulemd whereas normal macros cannot be
redefined there.
diff --git a/python2.spec b/python2.spec
index e6ff25a..e1f2d04 100644
--- a/python2.spec
+++ b/python2.spec
@@ -2,7 +2,15 @@
# Conditionals and other variables controlling the build
# ======================================================
-%global with_rewheel 1
+# Note that the bcond macros are named for the CLI option they create.
+# "%%bcond_without" means "ENABLE by default and create a --without
option"
+
+# Ability to reuse RPM-installed pip using rewheel
+%bcond_without rewheel
+
+# Extra build for debugging the interpreter or C-API extensions
+# (the -debug subpackages)
+%bcond_without debug_build
%global unicode ucs4
@@ -27,8 +35,6 @@
%global py_INSTSONAME_optimized libpython%{pybasever}.so.%{py_SOVERSION}
%global py_INSTSONAME_debug libpython%{pybasever}_d.so.%{py_SOVERSION}
-%global with_debug_build 1
-
# Disabled for now:
%global with_huntrleaks 0
@@ -45,13 +51,15 @@
%global with_gdbm 1
-# Turn this to 0 to turn off the "check" phase:
-%global run_selftest_suite 1
-
%if 0%{?_module_build}
%global with_valgrind 0
%global with_systemtap 0
-%global run_selftest_suite 0
+
+# (Don't) Run the test suite in %%check
+%bcond_with tests
+%else
+# Run the test suite in %%check
+%bcond_without tests
%endif
# Some of the files below /usr/lib/pythonMAJOR.MINOR/test (e.g. bad_coding.py)
@@ -104,7 +112,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.13
-Release: 17%{?dist}
+Release: 18%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -168,7 +176,7 @@ BuildRequires: valgrind-devel
BuildRequires: zlib-devel
%if ! 0%{?_module_build}
-%if 0%{?with_rewheel}
+%if %{with rewheel}
BuildRequires: python2-setuptools
BuildRequires: python2-pip
@@ -911,7 +919,7 @@ never used in production.
You might want to install the python2-test package if you're developing python 2
code that uses more than just unittest and/or test_support.py.
-%if 0%{?with_debug_build}
+%if %{with debug_build}
%package debug
Summary: Debug version of the Python 2 runtime
Group: Applications/System
@@ -946,7 +954,7 @@ It shares installation directories with the standard Python 2 runtime,
so that
.py and .pyc files can be shared. All compiled extension modules gain a "_d"
suffix ("foo_d.so" rather than "foo.so") so that each Python 2
implementation can
load its own extensions.
-%endif # with_debug_build
+%endif # with debug_build
# ======================================================
@@ -1071,7 +1079,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch189 -p1
%patch191 -p1
%patch193 -p1
-%if 0%{with_rewheel}
+%if %{with rewheel}
%patch198 -p1
%endif
@@ -1200,7 +1208,7 @@ LD_LIBRARY_PATH="$topdir/$ConfDir"
PATH=$PATH:$topdir/$ConfDir make -s EXTRA_CFL
# Use "BuildPython" to support building with different configurations:
-%if 0%{?with_debug_build}
+%if %{with debug_build}
BuildPython debug \
python-debug \
python%{pybasever}-debug \
@@ -1210,7 +1218,7 @@ BuildPython debug \
"--with-pydebug --with-count-allocs --with-call-profile" \
%endif
false
-%endif # with_debug_build
+%endif # with debug_build
BuildPython optimized \
python \
@@ -1294,11 +1302,11 @@ LD_LIBRARY_PATH="$topdir/$ConfDir"
$topdir/$ConfDir/$BinaryName -O \
# Use "InstallPython" to support building with different configurations:
# Install the "debug" build first, so that we can move some files aside
-%if 0%{?with_debug_build}
+%if %{with debug_build}
InstallPython debug \
python%{pybasever}-debug \
%{py_INSTSONAME_debug}
-%endif # with_debug_build
+%endif # with debug_build
# Now the optimized build:
InstallPython optimized \
@@ -1414,7 +1422,7 @@ install -d
%{buildroot}/%{_prefix}/lib/python%{pybasever}/site-packages
%global _pyconfig_h %{_pyconfig32_h}
%endif
-%if 0%{?with_debug_build}
+%if %{with debug_build}
%global PyIncludeDirs python%{pybasever} python%{pybasever}-debug
%else
%global PyIncludeDirs python%{pybasever}
@@ -1490,12 +1498,12 @@ sed \
%{SOURCE3} \
%{buildroot}%{tapsetdir}/%{libpython_stp_optimized}
-%if 0%{?with_debug_build}
+%if %{with debug_build}
sed \
-e "s|LIBRARY_PATH|%{_libdir}/%{py_INSTSONAME_debug}|" \
%{SOURCE3} \
%{buildroot}%{tapsetdir}/%{libpython_stp_debug}
-%endif #
with_debug_build
+%endif # with debug_build
%endif # with_systemtap
# Make library-files user writable
@@ -1551,19 +1559,19 @@ CheckPython() {
}
-%if 0%{run_selftest_suite}
+%if %{with tests}
# Check each of the configurations:
-%if 0%{?with_debug_build}
+%if %{with debug_build}
CheckPython \
debug \
python%{pybasever}-debug
-%endif # with_debug_build
+%endif # with debug_build
CheckPython \
optimized \
python%{pybasever}
-%endif # run_selftest_suite
+%endif # with tests
# ======================================================
@@ -1743,7 +1751,7 @@ rm -fr %{buildroot}
%{pylibdir}/ensurepip/*.py*
%exclude %{pylibdir}/ensurepip/_bundled
-%if 0%{?with_rewheel}
+%if %{with rewheel}
%dir %{pylibdir}/ensurepip/rewheel/
%{pylibdir}/ensurepip/rewheel/*.py*
%endif
@@ -1812,7 +1820,7 @@ rm -fr %{buildroot}
# Hence the manifest is the combination of analogous files in the manifests of
# all of the other subpackages
-%if 0%{?with_debug_build}
+%if %{with debug_build}
%files debug
%defattr(-,root,root,-)
@@ -1934,7 +1942,7 @@ rm -fr %{buildroot}
%{dynload_dir}/_ctypes_test_d.so
%{dynload_dir}/_testcapimodule_d.so
-%endif # with_debug_build
+%endif # with debug_build
# We put the debug-gdb.py file inside /usr/lib/debug to avoid noise from
# ldconfig (rhbz:562980).
@@ -1957,6 +1965,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu Aug 31 2017 Tomas Orsava <torsava(a)redhat.com> - 2.7.13-18
+- Switch some macros into bconds to facilitate modularity
+
* Wed Aug 16 2017 Miro Hronok <mhroncok(a)redhat.com> - 2.7.13-17
- Exclude /usr/bin/2to3 (rhbz#1111275)
commit d2afb4596ff96225791920a87ef803ca0d434444
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Wed Aug 16 14:31:44 2017 +0200
Exclude /usr/bin/2to3 (rhbz#1111275)
diff --git a/python2.spec b/python2.spec
index 7084876..e6ff25a 100644
--- a/python2.spec
+++ b/python2.spec
@@ -104,7 +104,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.13
-Release: 16%{?dist}
+Release: 17%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1770,7 +1770,10 @@ rm -fr %{buildroot}
%doc Tools/pynche/README.pynche
%{site_packages}/pynche
%{_bindir}/smtpd*.py*
-%{_bindir}/2to3*
+
+#
https://bugzilla.redhat.com/show_bug.cgi?id=1111275
+%exclude %{_bindir}/2to3*
+
%{_bindir}/idle*
%{_bindir}/pynche*
%{_bindir}/pygettext*.py*
@@ -1954,6 +1957,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Wed Aug 16 2017 Miro Hronok <mhroncok(a)redhat.com> - 2.7.13-17
+- Exclude /usr/bin/2to3 (rhbz#1111275)
+
* Mon Aug 14 2017 David "Sanqui" Labsk <dlabsky(a)redhat.com> - 2.7.13-16
- Do not generate debuginfo subpackages (#1476593)
commit db65c52e5c6706ea95425fa06018f307e1ae8e59
Author: Sanqui <gsanky(a)gmail.com>
Date: Mon Aug 14 16:00:35 2017 +0200
Do not generate debuginfo subpackages (#1476593)
diff --git a/python2.spec b/python2.spec
index c4ffd82..7084876 100644
--- a/python2.spec
+++ b/python2.spec
@@ -104,7 +104,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.13
-Release: 15%{?dist}
+Release: 16%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1946,12 +1946,17 @@ rm -fr %{buildroot}
# (if it doesn't, then the rpmbuild ought to fail since the debug-gdb.py
# payload file would be unpackaged)
+# Workaround for rhbz#1476593
+%undefine _debuginfo_subpackages
# ======================================================
# Finally, the changelog:
# ======================================================
%changelog
+* Mon Aug 14 2017 David "Sanqui" Labsk <dlabsky(a)redhat.com> - 2.7.13-16
+- Do not generate debuginfo subpackages (#1476593)
+
* Wed Aug 09 2017 Michal Cyprian <mcyprian(a)redhat.com> - 2.7.13-15
- Revert "Add --executable option to install.py command"
This enhancement is currently not needed and it can possibly
commit d99160d4df1ac29f76dfcf3dcf78832442c5b7cb
Author: Michal Cyprian <mcyprian(a)redhat.com>
Date: Wed Aug 9 13:49:30 2017 +0200
Revert "Add --executable option to install.py command"
This enhancement is currently not needed and it can possibly
collide with `pip --editable`option
Reverts commit 8043ae7719d4fba0689510194ac4d3ff41c228bd.
diff --git a/00252-add-executable-option.patch b/00252-add-executable-option.patch
deleted file mode 100644
index b3bf721..0000000
--- a/00252-add-executable-option.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-diff --git a/Lib/distutils/cmd.py b/Lib/distutils/cmd.py
-index c89d5ef..dd61621 100644
---- a/Lib/distutils/cmd.py
-+++ b/Lib/distutils/cmd.py
-@@ -296,7 +296,8 @@ class Command:
- finalized command object.
- """
- cmd_obj = self.distribution.get_command_obj(command, create)
-- cmd_obj.ensure_finalized()
-+ if cmd_obj is not None:
-+ cmd_obj.ensure_finalized()
- return cmd_obj
-
- # XXX rename to 'get_reinitialized_command()'? (should do the
-diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
-index 8174192..30ca739 100644
---- a/Lib/distutils/command/install.py
-+++ b/Lib/distutils/command/install.py
-@@ -122,6 +122,8 @@ class install(Command):
- "force installation (overwrite any existing files)"),
- ('skip-build', None,
- "skip rebuilding everything (for testing/debugging)"),
-+ ('executable=', 'e',
-+ "specify final destination interpreter path (install.py)"),
-
- # Where to install documentation (eventually!)
- #('doc-format=', None, "format of documentation to
generate"),
-@@ -194,6 +196,7 @@ class install(Command):
- # directory not in sys.path.
- self.force = 0
- self.skip_build = 0
-+ self.executable = None
- self.warn_dir = 1
-
- # These are only here as a conduit from the 'build' command to the
-@@ -365,6 +368,9 @@ class install(Command):
- ('build_base', 'build_base'),
- ('build_lib', 'build_lib'))
-
-+ if self.executable is None:
-+ self.executable = os.path.normpath(sys.executable)
-+
- # Punt on doc directories for now -- after all, we're punting on
- # documentation completely!
-
diff --git a/python2.spec b/python2.spec
index 555a0b3..c4ffd82 100644
--- a/python2.spec
+++ b/python2.spec
@@ -104,7 +104,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.13
-Release: 14%{?dist}
+Release: 15%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -751,12 +751,6 @@ Patch198: 00198-add-rewheel-module.patch
# Fixed upstream:
https://hg.python.org/cpython/rev/13a39142c047
Patch250: 00250-getentropy.patch
-# 00252
-# Add executable option to install.py command to make it work for
-# scripts specified as an entry_points
-# Reported upstream:
https://bugs.python.org/issue29411
-Patch252: 00252-add-executable-option.patch
-
# 00269 #
# Fix python's recompilation with common build commands when using
# profile guided optimizations.
@@ -1082,7 +1076,6 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%endif
%patch250 -p1
-%patch252 -p1
%patch269 -p1
%patch270 -p1
@@ -1959,6 +1952,11 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Wed Aug 09 2017 Michal Cyprian <mcyprian(a)redhat.com> - 2.7.13-15
+- Revert "Add --executable option to install.py command"
+ This enhancement is currently not needed and it can possibly
+ collide with `pip --editable`option
+
* Thu Aug 03 2017 Fedora Release Engineering <releng(a)fedoraproject.org> -
2.7.13-14
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
commit f9d5f4b78d70660ec265e94d590160d0fcdfb740
Author: Fedora Release Engineering <releng(a)fedoraproject.org>
Date: Thu Aug 3 07:04:34 2017 +0000
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
diff --git a/python2.spec b/python2.spec
index 1517b13..555a0b3 100644
--- a/python2.spec
+++ b/python2.spec
@@ -104,7 +104,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.13
-Release: 13%{?dist}
+Release: 14%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1959,6 +1959,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu Aug 03 2017 Fedora Release Engineering <releng(a)fedoraproject.org> -
2.7.13-14
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
+
* Thu Jul 27 2017 Fedora Release Engineering <releng(a)fedoraproject.org> -
2.7.13-13
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
commit f33a48746967112cb9545e7b0993961de190065a
Author: Fedora Release Engineering <releng(a)fedoraproject.org>
Date: Thu Jul 27 12:25:01 2017 +0000
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
diff --git a/python2.spec b/python2.spec
index 4ab98ca..1517b13 100644
--- a/python2.spec
+++ b/python2.spec
@@ -104,7 +104,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.13
-Release: 12%{?dist}
+Release: 13%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1959,6 +1959,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu Jul 27 2017 Fedora Release Engineering <releng(a)fedoraproject.org> -
2.7.13-13
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
+
* Mon Jun 26 2017 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.13-11
- Fix test_alpn_protocols from test_ssl
commit b096dc5eb06f9f5b2467304aceb2e9204f56eafd
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Wed Jun 28 15:49:57 2017 +0200
Provide additional reference for patch 252
diff --git a/python2.spec b/python2.spec
index f2350c0..4ab98ca 100644
--- a/python2.spec
+++ b/python2.spec
@@ -754,6 +754,7 @@ Patch250: 00250-getentropy.patch
# 00252
# Add executable option to install.py command to make it work for
# scripts specified as an entry_points
+# Reported upstream:
https://bugs.python.org/issue29411
Patch252: 00252-add-executable-option.patch
# 00269 #
commit 916477c6e62ae053c2aec5bd240159636c0bdb82
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Mon Jun 26 11:50:49 2017 +0200
Fix test_alpn_protocols from test_ssl
diff --git a/00270-fix-ssl-alpn-hook-test.patch b/00270-fix-ssl-alpn-hook-test.patch
new file mode 100644
index 0000000..97b433e
--- /dev/null
+++ b/00270-fix-ssl-alpn-hook-test.patch
@@ -0,0 +1,16 @@
+diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
+index d203cdd..c128dae 100644
+--- a/Lib/test/test_ssl.py
++++ b/Lib/test/test_ssl.py
+@@ -3256,8 +3256,9 @@ if _have_threads:
+ except ssl.SSLError as e:
+ stats = e
+
+- if expected is None and IS_OPENSSL_1_1:
+- # OpenSSL 1.1.0 raises handshake error
++ if (expected is None and IS_OPENSSL_1_1
++ and ssl.OPENSSL_VERSION_INFO < (1, 1, 0, 6)):
++ # OpenSSL 1.1.0 to 1.1.0e raises handshake error
+ self.assertIsInstance(stats, ssl.SSLError)
+ else:
+ msg = "failed trying %s (s) and %s (c).\n" \
diff --git a/python2.spec b/python2.spec
index ebbb803..f2350c0 100644
--- a/python2.spec
+++ b/python2.spec
@@ -104,7 +104,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.13
-Release: 11%{?dist}
+Release: 12%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -762,6 +762,12 @@ Patch252: 00252-add-executable-option.patch
# Fixed upstream:
http://bugs.python.org/issue29243
Patch269: 00269-fix-multiple-compilations-issue-with-pgo-builds.patch
+# 00270 #
+# Fix test_alpn_protocols from test_ssl as openssl > 1.1.0f
+# changed the behaviour of the ALPN hook.
+# Fixed upstream:
http://bugs.python.org/issue30714
+Patch270: 00270-fix-ssl-alpn-hook-test.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python2" and "python3" in Fedora, EL,
etc.,
@@ -1077,6 +1083,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch250 -p1
%patch252 -p1
%patch269 -p1
+%patch270 -p1
%if 0%{?_module_build}
%patch4000 -p1
@@ -1951,6 +1958,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Mon Jun 26 2017 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.13-11
+- Fix test_alpn_protocols from test_ssl
+
* Wed May 31 2017 Miro Hronok <mhroncok(a)redhat.com> - 2.7.13-11
- Change fixed Obsoletes version with a dynamic one (rhbz#1457336)
commit 2ee453130cad76c437e7cfb610de6b9a92389337
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Wed May 31 18:01:14 2017 +0200
Change fixed Obsoletes version with a dynamic one (rhbz#1457336)
diff --git a/python2.spec b/python2.spec
index 3d2ba03..ebbb803 100644
--- a/python2.spec
+++ b/python2.spec
@@ -8,11 +8,6 @@
%global python python2
-# Macro for using a version-release which will obsolete python for
-# Fedora 24 and 25, in order to ensure a clean upgrade path to Fedora 26.
-# It should be removed along with the obsolete tags at Fedora 28.
-%global obs 2.7.13-2
-
%global pybasever 2.7
%global pylibdir %{_libdir}/python%{pybasever}
%global tools_dir %{pylibdir}/Tools
@@ -109,7 +104,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.13
-Release: 10%{?dist}
+Release: 11%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -791,7 +786,11 @@ Patch5000: 05000-autotool-intermediates.patch
Provides: python = %{version}-%{release}
Provides: python%{?_isa} = %{version}-%{release}
-Obsoletes: python < %{obs}
+
+# All the obsolete tags similar to this one should be removed at Fedora 28
+# Also, according to the guidelines, this should be a hardcoded version,
+# but that was proven problematic, see rhbz#1457336
+Obsoletes: python < %{version}-%{release}
# Providing python27 as now multiple interpreters exist in Fedora
# alongside the system one e.g. python26, python33 etc
@@ -832,7 +831,7 @@ Requires: glibc%{?_isa} >= 2.24.90-26
Provides: python-libs = %{version}-%{release}
Provides: python-libs%{?_isa} = %{version}-%{release}
-Obsoletes: python-libs < %{obs}
+Obsoletes: python-libs < %{version}-%{release}
%description libs
This package contains files used to embed Python 2 into applications.
@@ -851,7 +850,7 @@ Conflicts: %{python} < %{version}-%{release}
Provides: python-devel = %{version}-%{release}
Provides: python-devel%{?_isa} = %{version}-%{release}
-Obsoletes: python-devel < %{obs}
+Obsoletes: python-devel < %{version}-%{release}
%description devel
This package contains libraries and header files used to build applications
@@ -865,7 +864,7 @@ Requires: %{python}-tkinter = %{version}-%{release}
Provides: python-tools = %{version}-%{release}
Provides: python-tools%{?_isa} = %{version}-%{release}
-Obsoletes: python-tools < %{obs}
+Obsoletes: python-tools < %{version}-%{release}
%description tools
This package includes several tools to help with the development of Python 2
@@ -883,7 +882,7 @@ Provides: tkinter2 = %{version}-%{release}
Provides: tkinter2%{?_isa} = %{version}-%{release}
Provides: python-tkinter = %{version}-%{release}
Provides: python-tkinter%{?_isa} = %{version}-%{release}
-Obsoletes: tkinter < %{obs}
+Obsoletes: tkinter < %{version}-%{release}
%description tkinter
@@ -900,7 +899,7 @@ Requires: %{name} = %{version}-%{release}
Provides: python-test = %{version}-%{release}
Provides: python-test%{?_isa} = %{version}-%{release}
-Obsoletes: python-test < %{obs}
+Obsoletes: python-test < %{version}-%{release}
%description test
@@ -928,7 +927,7 @@ Requires: %{name}-tools%{?_isa} = %{version}-%{release}
Provides: python-debug = %{version}-%{release}
Provides: python-debug%{?_isa} = %{version}-%{release}
-Obsoletes: python-debug < %{obs}
+Obsoletes: python-debug < %{version}-%{release}
%description debug
python2-debug provides a version of the Python 2 runtime with numerous debugging
@@ -1952,6 +1951,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Wed May 31 2017 Miro Hronok <mhroncok(a)redhat.com> - 2.7.13-11
+- Change fixed Obsoletes version with a dynamic one (rhbz#1457336)
+
* Thu May 18 2017 Karsten Hopp <karsten(a)redhat.com> - 2.7.13-10
- revert logic for modularity patch and enable gdbm for modularity
commit 32febd6043a24b0f8d98d13220792d23c2bb8b48
Author: Karsten Hopp <karsten(a)redhat.com>
Date: Thu May 18 14:19:19 2017 +0200
revert logic for modularity patch and enable gdbm for modularity
diff --git a/python2.spec b/python2.spec
index 83e962e..3d2ba03 100644
--- a/python2.spec
+++ b/python2.spec
@@ -54,7 +54,6 @@
%global run_selftest_suite 1
%if 0%{?_module_build}
-%global with_gdbm 0
%global with_valgrind 0
%global with_systemtap 0
%global run_selftest_suite 0
@@ -110,7 +109,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.13
-Release: 9%{?dist}
+Release: 10%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1080,7 +1079,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch252 -p1
%patch269 -p1
-%if ! 0%{?_module_build}
+%if 0%{?_module_build}
%patch4000 -p1
%endif
@@ -1953,6 +1952,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu May 18 2017 Karsten Hopp <karsten(a)redhat.com> - 2.7.13-10
+- revert logic for modularity patch and enable gdbm for modularity
+
* Tue May 16 2017 Tomas Orsava <torsava(a)redhat.com> - 2.7.13-9
- Added a dependency to the devel subpackage on python3-rpm-generators which
have been excised out of rpm-build
commit 4485b86f0d0f3de25f3f94381d1ed95c09a6197d
Author: Tomas Orsava <torsava(a)redhat.com>
Date: Tue May 16 13:10:05 2017 +0200
Add dependency to the devel subpackage on python3-rpm-generators
... which have been excised out of rpm-build.
Involves: rhbz#1410631, rhbz#1444925
diff --git a/python2.spec b/python2.spec
index 5f044b0..83e962e 100644
--- a/python2.spec
+++ b/python2.spec
@@ -110,7 +110,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.13
-Release: 8%{?dist}
+Release: 9%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -844,6 +844,7 @@ Group: Development/Libraries
Requires: %{python}%{?_isa} = %{version}-%{release}
Requires: python-rpm-macros
Requires: python2-rpm-macros
+Requires: python3-rpm-generators
Requires: pkgconfig
# Needed here because of the migration of Makefile from -devel to the main
# package
@@ -1952,6 +1953,14 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Tue May 16 2017 Tomas Orsava <torsava(a)redhat.com> - 2.7.13-9
+- Added a dependency to the devel subpackage on python3-rpm-generators which
+ have been excised out of rpm-build
+- There is no Python 2 package containing Python RPM generators, therefore
+ Python 3 is needed when Python 2 package is to be built, but this was
+ decided not to be a problem due to nearing EOL of Python 2
+- Involves: rhbz#1410631, rhbz#1444925
+
* Wed May 10 2017 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.13-8
- Enable profile guided optimizations for x86_64 and i686 architectures
- Update description to reflect that Python 2 is not the default Python
commit 1554ebbaa5294f56aa0883ed2f1791f6b8fd53b6
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Wed May 10 16:41:09 2017 +0200
Enable profile guided optimizations for x86_64 and i686 architectures.
Added patch for fixing recompilation of Python when using common
build commands and the --enable-optimizations flag.
diff --git a/00269-fix-multiple-compilations-issue-with-pgo-builds.patch
b/00269-fix-multiple-compilations-issue-with-pgo-builds.patch
new file mode 100644
index 0000000..2e5b33d
--- /dev/null
+++ b/00269-fix-multiple-compilations-issue-with-pgo-builds.patch
@@ -0,0 +1,63 @@
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index 9e4be0a..a58b59c 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -863,12 +863,12 @@ $(LIBRARY_OBJS) $(MODOBJS) Modules/python.o: $(PYTHON_HEADERS)
+ TESTOPTS= -l $(EXTRATESTOPTS)
+ TESTPROG= $(srcdir)/Lib/test/regrtest.py
+ TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS)
+-test: all platform
++test: @DEF_MAKE_RULE@ platform
+ -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
+ -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
+ $(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
+
+-testall: all platform
++testall: @DEF_MAKE_RULE@ platform
+ -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
+ $(TESTPYTHON) $(srcdir)/Lib/compileall.py
+ -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
+@@ -877,7 +877,7 @@ testall: all platform
+
+ # Run the unitests for both architectures in a Universal build on OSX
+ # Must be run on an Intel box.
+-testuniversal: all platform
++testuniversal: @DEF_MAKE_RULE@ platform
+ if [ `arch` != 'i386' ];then \
+ echo "This can only be used on OSX/i386" ;\
+ exit 1 ;\
+@@ -900,14 +900,14 @@ QUICKTESTOPTS= $(TESTOPTS) -x test_subprocess test_io test_lib2to3
\
+ test_multibytecodec test_urllib2_localnet test_itertools \
+ test_multiprocessing test_mailbox test_socket test_poll \
+ test_select test_zipfile
+-quicktest: all platform
++quicktest: @DEF_MAKE_RULE@ platform
+ -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
+ -$(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
+ $(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
+
+ MEMTESTOPTS= $(QUICKTESTOPTS) -x test_dl test___all__ test_fork1 \
+ test_longexp
+-memtest: all platform
++memtest: @DEF_MAKE_RULE@ platform
+ -rm -f $(srcdir)/Lib/test/*.py[co]
+ -$(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
+ $(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
+@@ -1198,7 +1198,7 @@ LIBPL= $(LIBP)/config$(DEBUG_SUFFIX)
+ # pkgconfig directory
+ LIBPC= $(LIBDIR)/pkgconfig
+
+-libainstall: all python$(DEBUG_SUFFIX)-config
++libainstall: @DEF_MAKE_RULE@ python$(DEBUG_SUFFIX)-config
+ @for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \
+ do \
+ if test ! -d $(DESTDIR)$$i; then \
+@@ -1425,7 +1425,7 @@ distclean: clobber
+ -exec rm -f {} ';'
+
+ # Check for smelly exported symbols (not starting with Py/_Py)
+-smelly: all
++smelly: @DEF_MAKE_RULE@
+ nm -p $(LIBRARY) | \
+ sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \
+
diff --git a/python2.spec b/python2.spec
index 54d4c28..5f044b0 100644
--- a/python2.spec
+++ b/python2.spec
@@ -110,7 +110,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.13
-Release: 7%{?dist}
+Release: 8%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -762,8 +762,11 @@ Patch250: 00250-getentropy.patch
# scripts specified as an entry_points
Patch252: 00252-add-executable-option.patch
-# Disable tk for modularity builds to break up build dependencies
-Patch04000: 04000-modularity-disable-tk.patch
+# 00269 #
+# Fix python's recompilation with common build commands when using
+# profile guided optimizations.
+# Fixed upstream:
http://bugs.python.org/issue29243
+Patch269: 00269-fix-multiple-compilations-issue-with-pgo-builds.patch
# (New patches go here ^^^)
#
@@ -777,6 +780,10 @@ Patch04000: 04000-modularity-disable-tk.patch
# This is the generated patch to "configure"; see the description of
# %{regenerate_autotooling_patch}
# above:
+
+# Disable tk for modularity builds to break up build dependencies
+Patch04000: 04000-modularity-disable-tk.patch
+
Patch5000: 05000-autotool-intermediates.patch
# ======================================================
@@ -1070,6 +1077,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch250 -p1
%patch252 -p1
+%patch269 -p1
%if ! 0%{?_module_build}
%patch4000 -p1
@@ -1207,7 +1215,11 @@ BuildPython debug \
BuildPython optimized \
python \
python%{pybasever} \
+%ifarch %{ix86} x86_64
+ "--enable-optimizations" \
+%else
"" \
+%endif
true
@@ -1940,6 +1952,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Wed May 10 2017 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.13-8
+- Enable profile guided optimizations for x86_64 and i686 architectures
+- Update description to reflect that Python 2 is not the default Python
+
* Tue Apr 25 2017 Karsten Hopp <karsten(a)redhat.com> - 2.7.13-7
- apply modularity patch only during module builds
commit 890215f62732dcf76de3ca9c7021acecc32da0d0
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Wed May 10 15:26:35 2017 +0200
Change description, to reflect that python2 is obsoleted by Python 3 as
the default Python interpreter.
Also reduce verbosity for the descriptions of subpackages.
Use https sources URL.
diff --git a/python2.spec b/python2.spec
index da73c16..54d4c28 100644
--- a/python2.spec
+++ b/python2.spec
@@ -189,7 +189,7 @@ Requires: python2-pip
# Source code and patches
# =======================
-Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz
+Source:
https://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz
# Work around bug 562906 until it's fixed in rpm-build by providing a fixed
# version of pythondeps.sh:
@@ -767,7 +767,7 @@ Patch04000: 04000-modularity-disable-tk.patch
# (New patches go here ^^^)
#
-# When adding new patches to "python" and "python3" in Fedora, EL,
etc.,
+# When adding new patches to "python2" and "python3" in Fedora, EL,
etc.,
# please try to keep the patch numbers in-sync between all specfiles.
#
# More information, and a patch number catalog, is at:
@@ -796,25 +796,20 @@ BuildRoot:
%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
URL:
https://www.python.org/
%description
-Python is an interpreted, interactive, object-oriented programming
-language often compared to Tcl, Perl, Scheme or Java. Python includes
-modules, classes, exceptions, very high level dynamic data types and
-dynamic typing. Python supports interfaces to many system calls and
-libraries, as well as to various windowing systems (X11, Motif, Tk,
-Mac and MFC).
-
-Programmers can write new built-in modules for Python in C or C++.
-Python can be used as an extension language for applications that need
-a programmable interface.
-
-Note that documentation for Python is provided in the python-docs
+Python 2 is an old version of the language that is incompatible with the 3.x
+line of releases. The language is mostly the same, but many details, especially
+how built-in objects like dictionaries and strings work, have changed
+considerably, and a lot of deprecated features have finally been removed in the
+3.x line.
+
+Note that documentation for Python 2 is provided in the python2-docs
package.
-This package provides the "python" executable; most of the actual
-implementation is within the "python-libs" package.
+This package provides the "python2" executable; most of the actual
+implementation is within the "python2-libs" package.
%package libs
-Summary: Runtime libraries for Python
+Summary: Runtime libraries for Python 2
Group: Applications/System
# Needed for ctypes, to load libraries, worked around for Live CDs size
@@ -834,13 +829,10 @@ Provides: python-libs%{?_isa} = %{version}-%{release}
Obsoletes: python-libs < %{obs}
%description libs
-This package contains runtime libraries for use by Python:
-- the libpython dynamic library, for use by applications that embed Python as
-a scripting language, and by the main "python" executable
-- the Python standard library
+This package contains files used to embed Python 2 into applications.
%package devel
-Summary: The libraries and header files needed for Python development
+Summary: Libraries and header files needed for Python 2 development
Group: Development/Libraries
Requires: %{python}%{?_isa} = %{version}-%{release}
Requires: python-rpm-macros
@@ -855,18 +847,11 @@ Provides: python-devel%{?_isa} = %{version}-%{release}
Obsoletes: python-devel < %{obs}
%description devel
-The Python programming language's interpreter can be extended with
-dynamically loaded extensions and can be embedded in other programs.
-This package contains the header files and libraries needed to do
-these types of tasks.
-
-Install python-devel if you want to develop Python extensions. The
-python package will also need to be installed. You'll probably also
-want to install the python-docs package, which contains Python
-documentation.
+This package contains libraries and header files used to build applications
+with and native libraries for Python 2
%package tools
-Summary: A collection of development tools included with Python
+Summary: A collection of development tools included with Python 2
Group: Development/Tools
Requires: %{name} = %{version}-%{release}
Requires: %{python}-tkinter = %{version}-%{release}
@@ -876,12 +861,12 @@ Provides: python-tools%{?_isa} = %{version}-%{release}
Obsoletes: python-tools < %{obs}
%description tools
-This package includes several tools to help with the development of Python
+This package includes several tools to help with the development of Python 2
programs, including IDLE (an IDE with editing and debugging facilities), a
color editor (pynche), and a python gettext program (pygettext.py).
%package tkinter
-Summary: A graphical user interface for the Python scripting language
+Summary: A graphical user interface for the Python 2 scripting language
Group: Development/Languages
Requires: %{name} = %{version}-%{release}
@@ -896,13 +881,13 @@ Obsoletes: tkinter < %{obs}
%description tkinter
The Tkinter (Tk interface) program is an graphical user interface for
-the Python scripting language.
+the Python 2 scripting language.
-You should install the tkinter package if you'd like to use a graphical
-user interface for Python programming.
+You should install the python2tkinter package if you'd like to use a graphical
+user interface for Python 2 programming.
%package test
-Summary: The test modules from the main python package
+Summary: The test modules from the main python2 package
Group: Development/Languages
Requires: %{name} = %{version}-%{release}
@@ -912,16 +897,16 @@ Obsoletes: python-test < %{obs}
%description test
-The test modules from the main python package: %{name}
+The test modules from the main python2 package: %{name}
These have been removed to save space, as they are never or almost
never used in production.
-You might want to install the python-test package if you're developing python
+You might want to install the python2-test package if you're developing python 2
code that uses more than just unittest and/or test_support.py.
%if 0%{?with_debug_build}
%package debug
-Summary: Debug version of the Python runtime
+Summary: Debug version of the Python 2 runtime
Group: Applications/System
# The debug build is an all-in-one package version of the regular build, and
@@ -939,20 +924,20 @@ Provides: python-debug%{?_isa} = %{version}-%{release}
Obsoletes: python-debug < %{obs}
%description debug
-python-debug provides a version of the Python runtime with numerous debugging
+python2-debug provides a version of the Python 2 runtime with numerous debugging
features enabled, aimed at advanced Python users, such as developers of Python
extension modules.
-This version uses more memory and will be slower than the regular Python build,
+This version uses more memory and will be slower than the regular Python 2 build,
but is useful for tracking down reference-counting issues, and other bugs.
The bytecodes are unchanged, so that .pyc files are compatible between the two
-version of Python, but the debugging features mean that C/C++ extension modules
+version of Python 2, but the debugging features mean that C/C++ extension modules
are ABI-incompatible with those built for the standard runtime.
-It shares installation directories with the standard Python runtime, so that
+It shares installation directories with the standard Python 2 runtime, so that
.py and .pyc files can be shared. All compiled extension modules gain a "_d"
-suffix ("foo_d.so" rather than "foo.so") so that each Python
implementation can
+suffix ("foo_d.so" rather than "foo.so") so that each Python 2
implementation can
load its own extensions.
%endif # with_debug_build
commit bd0f7dde0373e1a3458a6cf41fe5621b6f41c6de
Author: Karsten Hopp <karsten(a)redhat.com>
Date: Tue Apr 25 14:51:26 2017 +0200
apply modularity patch only during module builds
diff --git a/python2.spec b/python2.spec
index 0963321..da73c16 100644
--- a/python2.spec
+++ b/python2.spec
@@ -110,7 +110,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.13
-Release: 6%{?dist}
+Release: 7%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1086,7 +1086,9 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch250 -p1
%patch252 -p1
+%if ! 0%{?_module_build}
%patch4000 -p1
+%endif
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -1953,6 +1955,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Tue Apr 25 2017 Karsten Hopp <karsten(a)redhat.com> - 2.7.13-7
+- apply modularity patch only during module builds
+
* Sun Apr 23 2017 Karsten Hopp <karsten(a)redhat.com> - 2.7.13-6
- add missing patch
commit 280de3dba0076661e5fb3419228c13151cfd1b39
Author: Karsten Hopp <karsten(a)redhat.com>
Date: Sun Apr 23 00:49:12 2017 +0200
add missing patch
diff --git a/04000-modularity-disable-tk.patch b/04000-modularity-disable-tk.patch
new file mode 100644
index 0000000..a90f5a1
--- /dev/null
+++ b/04000-modularity-disable-tk.patch
@@ -0,0 +1,21 @@
+diff -urN Python-2.7.13/Modules/Setup.dist Python-2.7.13_modul/Modules/Setup.dist
+--- Python-2.7.13/Modules/Setup.dist 2017-04-21 14:57:13.767444374 +0200
++++ Python-2.7.13_modul/Modules/Setup.dist 2017-04-21 14:56:49.658953833 +0200
+@@ -326,7 +326,7 @@
+ # every system.
+
+ # *** Always uncomment this (leave the leading underscore in!):
+-_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \
++#_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \
+ # *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
+ # -L/usr/local/lib \
+ # *** Uncomment and edit to reflect where your Tcl/Tk headers are:
+@@ -345,7 +345,7 @@
+ # *** Uncomment and edit for TOGL extension only:
+ # -DWITH_TOGL togl.c \
+ # *** Uncomment and edit to reflect your Tcl/Tk versions:
+- -ltk -ltcl \
++# -ltk -ltcl \
+ # *** Uncomment and edit to reflect where your X11 libraries are:
+ # -L/usr/X11R6/lib \
+ # *** Or uncomment this for Solaris:
diff --git a/python2.spec b/python2.spec
index f4d28e8..0963321 100644
--- a/python2.spec
+++ b/python2.spec
@@ -110,7 +110,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.13
-Release: 5%{?dist}
+Release: 6%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1953,6 +1953,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Sun Apr 23 2017 Karsten Hopp <karsten(a)redhat.com> - 2.7.13-6
+- add missing patch
+
* Fri Apr 21 2017 Karsten Hopp <karsten(a)redhat.com> - 2.7.13-5
- drop a couple of dependencies for Modularity builds
commit 7a7d98401ad9fe147088d0aefc10ee74761969e4
Author: Karsten Hopp <karsten(a)redhat.com>
Date: Fri Apr 21 20:48:53 2017 +0200
drop a couple of dependencies for Modularity builds
diff --git a/python2.spec b/python2.spec
index 730d7a3..f4d28e8 100644
--- a/python2.spec
+++ b/python2.spec
@@ -53,6 +53,13 @@
# Turn this to 0 to turn off the "check" phase:
%global run_selftest_suite 1
+%if 0%{?_module_build}
+%global with_gdbm 0
+%global with_valgrind 0
+%global with_systemtap 0
+%global run_selftest_suite 0
+%endif
+
# Some of the files below /usr/lib/pythonMAJOR.MINOR/test (e.g. bad_coding.py)
# are deliberately invalid, leading to SyntaxError exceptions if they get
# byte-compiled.
@@ -117,9 +124,21 @@ Provides: python(abi) = %{pybasever}
# (keep this list alphabetized)
BuildRequires: autoconf
+%if ! 0%{?_module_build}
BuildRequires: bluez-libs-devel
+%endif
BuildRequires: bzip2
BuildRequires: bzip2-devel
+BuildRequires: glibc-devel
+BuildRequires: gmp-devel
+BuildRequires: libdb-devel
+BuildRequires: libffi-devel
+BuildRequires: ncurses-devel
+BuildRequires: openssl-devel
+BuildRequires: pkgconfig
+BuildRequires: readline-devel
+BuildRequires: sqlite-devel
+BuildRequires: tcl-devel
# expat 2.1.0 added the symbol XML_SetHashSalt without bumping SONAME. We use
# it (in pyexpat) in order to enable the fix in Python-2.7.3 for CVE-2012-0876:
@@ -130,17 +149,10 @@ BuildRequires: gcc-c++
%if %{with_gdbm}
BuildRequires: gdbm-devel
%endif
-BuildRequires: glibc-devel
-BuildRequires: gmp-devel
-BuildRequires: libdb-devel
-BuildRequires: libffi-devel
+%if ! 0%{?_module_build}
BuildRequires: libGL-devel
BuildRequires: libX11-devel
-BuildRequires: ncurses-devel
-BuildRequires: openssl-devel
-BuildRequires: pkgconfig
-BuildRequires: readline-devel
-BuildRequires: sqlite-devel
+%endif
%if 0%{?with_systemtap}
BuildRequires: systemtap-sdt-devel
@@ -150,9 +162,10 @@ BuildRequires: systemtap-sdt-devel
%endif # with_systemtap
BuildRequires: tar
-BuildRequires: tcl-devel
+%if ! 0%{?_module_build}
BuildRequires: tix-devel
BuildRequires: tk-devel
+%endif
%if 0%{?with_valgrind}
BuildRequires: valgrind-devel
@@ -160,6 +173,7 @@ BuildRequires: valgrind-devel
BuildRequires: zlib-devel
+%if ! 0%{?_module_build}
%if 0%{?with_rewheel}
BuildRequires: python2-setuptools
BuildRequires: python2-pip
@@ -167,6 +181,7 @@ BuildRequires: python2-pip
Requires: python2-setuptools
Requires: python2-pip
%endif
+%endif
@@ -747,6 +762,9 @@ Patch250: 00250-getentropy.patch
# scripts specified as an entry_points
Patch252: 00252-add-executable-option.patch
+# Disable tk for modularity builds to break up build dependencies
+Patch04000: 04000-modularity-disable-tk.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora, EL,
etc.,
@@ -1068,6 +1086,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch250 -p1
%patch252 -p1
+%patch4000 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -1764,7 +1783,9 @@ rm -fr %{buildroot}
%files tkinter
%defattr(-,root,root,755)
%{pylibdir}/lib-tk
+%if ! 0%{?_module_build}
%{dynload_dir}/_tkinter.so
+%endif
%files test
%defattr(-, root, root, -)
@@ -1902,8 +1923,10 @@ rm -fr %{buildroot}
# None for now; we could build precanned versions that have the appropriate
# shebang if needed
+%if ! 0%{?_module_build}
# Analog of the tkinter subpackage's files:
%{dynload_dir}/_tkinter_d.so
+%endif
# Analog of the -test subpackage's files:
%{dynload_dir}/_ctypes_test_d.so
@@ -1930,6 +1953,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Fri Apr 21 2017 Karsten Hopp <karsten(a)redhat.com> - 2.7.13-5
+- drop a couple of dependencies for Modularity builds
+
* Tue Feb 21 2017 Michal Cyprian <mcyprian(a)redhat.com> - 2.7.13-5
- Add --executable option to install.py command
commit 8043ae7719d4fba0689510194ac4d3ff41c228bd
Author: Michal Cyprian <mcyprian(a)redhat.com>
Date: Tue Feb 21 12:54:47 2017 +0100
Add --executable option to install.py command
diff --git a/00252-add-executable-option.patch b/00252-add-executable-option.patch
new file mode 100644
index 0000000..b3bf721
--- /dev/null
+++ b/00252-add-executable-option.patch
@@ -0,0 +1,45 @@
+diff --git a/Lib/distutils/cmd.py b/Lib/distutils/cmd.py
+index c89d5ef..dd61621 100644
+--- a/Lib/distutils/cmd.py
++++ b/Lib/distutils/cmd.py
+@@ -296,7 +296,8 @@ class Command:
+ finalized command object.
+ """
+ cmd_obj = self.distribution.get_command_obj(command, create)
+- cmd_obj.ensure_finalized()
++ if cmd_obj is not None:
++ cmd_obj.ensure_finalized()
+ return cmd_obj
+
+ # XXX rename to 'get_reinitialized_command()'? (should do the
+diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
+index 8174192..30ca739 100644
+--- a/Lib/distutils/command/install.py
++++ b/Lib/distutils/command/install.py
+@@ -122,6 +122,8 @@ class install(Command):
+ "force installation (overwrite any existing files)"),
+ ('skip-build', None,
+ "skip rebuilding everything (for testing/debugging)"),
++ ('executable=', 'e',
++ "specify final destination interpreter path (install.py)"),
+
+ # Where to install documentation (eventually!)
+ #('doc-format=', None, "format of documentation to
generate"),
+@@ -194,6 +196,7 @@ class install(Command):
+ # directory not in sys.path.
+ self.force = 0
+ self.skip_build = 0
++ self.executable = None
+ self.warn_dir = 1
+
+ # These are only here as a conduit from the 'build' command to the
+@@ -365,6 +368,9 @@ class install(Command):
+ ('build_base', 'build_base'),
+ ('build_lib', 'build_lib'))
+
++ if self.executable is None:
++ self.executable = os.path.normpath(sys.executable)
++
+ # Punt on doc directories for now -- after all, we're punting on
+ # documentation completely!
+
diff --git a/python2.spec b/python2.spec
index 5c45c77..730d7a3 100644
--- a/python2.spec
+++ b/python2.spec
@@ -103,7 +103,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.13
-Release: 4%{?dist}
+Release: 5%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -742,6 +742,11 @@ Patch198: 00198-add-rewheel-module.patch
# Fixed upstream:
https://hg.python.org/cpython/rev/13a39142c047
Patch250: 00250-getentropy.patch
+# 00252
+# Add executable option to install.py command to make it work for
+# scripts specified as an entry_points
+Patch252: 00252-add-executable-option.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora, EL,
etc.,
@@ -1061,6 +1066,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%endif
%patch250 -p1
+%patch252 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -1924,6 +1930,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Tue Feb 21 2017 Michal Cyprian <mcyprian(a)redhat.com> - 2.7.13-5
+- Add --executable option to install.py command
+
* Fri Feb 17 2017 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.13-4
- Fix the upgrade path to F26 due to renaming the package to python2 (rhbz#1420332)
commit f6f7300380d963bd60d2ee8ef0492cccbb3ead67
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Fri Feb 17 15:13:13 2017 +0100
Ensure that the F24 and F25 python package will always
be obsoleted by the F26 python2 package (rhbz#1420332)
diff --git a/python2.spec b/python2.spec
index 1e7da51..5c45c77 100644
--- a/python2.spec
+++ b/python2.spec
@@ -8,10 +8,10 @@
%global python python2
-# Macro for using the version-release where python got
-# renamed to python2 at Fedora 26, in order to ensure clean upgrade path.
-# It should be removed along with the obsoletes at Fedora 28.
-%global obs 2.7.12-9
+# Macro for using a version-release which will obsolete python for
+# Fedora 24 and 25, in order to ensure a clean upgrade path to Fedora 26.
+# It should be removed along with the obsolete tags at Fedora 28.
+%global obs 2.7.13-2
%global pybasever 2.7
%global pylibdir %{_libdir}/python%{pybasever}
@@ -103,7 +103,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.13
-Release: 3%{?dist}
+Release: 4%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1924,6 +1924,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Fri Feb 17 2017 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.13-4
+- Fix the upgrade path to F26 due to renaming the package to python2 (rhbz#1420332)
+
* Sat Feb 11 2017 Fedora Release Engineering <releng(a)fedoraproject.org> - 2.7.13-3
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
commit be651f81237bf5ec6afd2dfd3858a2c64b6823c2
Author: Fedora Release Engineering <releng(a)fedoraproject.org>
Date: Sat Feb 11 11:03:10 2017 +0000
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
diff --git a/python2.spec b/python2.spec
index 103e9de..1e7da51 100644
--- a/python2.spec
+++ b/python2.spec
@@ -103,7 +103,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.13
-Release: 2%{?dist}
+Release: 3%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1924,6 +1924,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Sat Feb 11 2017 Fedora Release Engineering <releng(a)fedoraproject.org> - 2.7.13-3
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
+
* Thu Jan 12 2017 Igor Gnatenko <ignatenko(a)redhat.com> - 2.7.13-2
- Rebuild for readline 7.x
commit 2c2cb4d85b5b92e862431a36012a35873f9267da
Author: Igor Gnatenko <ignatenko(a)redhat.com>
Date: Thu Jan 12 17:30:37 2017 +0100
Rebuild for readline 7.x
Signed-off-by: Igor Gnatenko <ignatenko(a)redhat.com>
diff --git a/python2.spec b/python2.spec
index a6a20ad..103e9de 100644
--- a/python2.spec
+++ b/python2.spec
@@ -103,7 +103,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.13
-Release: 1%{?dist}
+Release: 2%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1924,6 +1924,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu Jan 12 2017 Igor Gnatenko <ignatenko(a)redhat.com> - 2.7.13-2
+- Rebuild for readline 7.x
+
* Wed Jan 11 2017 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.13-1
- Update to 2.7.13
- Don't blow up on EL7 kernel (random generator) (rhbz#1410175, rhbz#1410187)
commit e82e344346f062f3d0afb10ca9f48937f8677b87
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Wed Jan 11 22:07:44 2017 +0100
Upload sources for 2.7.13
diff --git a/sources b/sources
index a994449..a72e73a 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (Python-2.7.12.tar.xz) =
6ddbbce47cc49597433d98ca05c2f62f07ed1070807b645602a8e9e9b996adc6fa66fa20a33cd7d23d4e7e925e25071d7301d288149fbe4e8c5f06d5438dda1f
+SHA512 (Python-2.7.13.tar.xz) =
f37c9a28ce129d01e63c84d7db627a06402854578f62d17927334ea21ede318e04bbf66e890e3f47c85333e6b19f6e5581fb3f3e27efd24be27017d1b6529c4b
commit f3da2c555dd48db7e0583ba41aec495cd4106fe7
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Wed Jan 11 20:42:17 2017 +0100
Require glibc >= 2.24.90-26(rhbz#1410644)
diff --git a/python2.spec b/python2.spec
index 3859681..a6a20ad 100644
--- a/python2.spec
+++ b/python2.spec
@@ -803,6 +803,9 @@ Group: Applications/System
# yet upgraded expat:
Requires: expat >= 2.1.0
+# Python built with glibc >= 2.24.90-26 needs to require it (rhbz#1410644).
+Requires: glibc%{?_isa} >= 2.24.90-26
+
Provides: python-libs = %{version}-%{release}
Provides: python-libs%{?_isa} = %{version}-%{release}
Obsoletes: python-libs < %{obs}
@@ -1924,6 +1927,7 @@ rm -fr %{buildroot}
* Wed Jan 11 2017 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.13-1
- Update to 2.7.13
- Don't blow up on EL7 kernel (random generator) (rhbz#1410175, rhbz#1410187)
+- Require glibc >= 2.24.90-26 (rhbz#1410644)
* Thu Oct 27 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-9
- Rename package to python2 and also rename the subpackages accordingly
commit aabe04e2552304236180c390fe0697e663cbc432
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Wed Jan 11 20:39:50 2017 +0100
Don't blow up on EL7 kernel (random generator) (rhbz#1410175, rhbz#1410187)
diff --git a/00250-getentropy.patch b/00250-getentropy.patch
new file mode 100644
index 0000000..7e00061
--- /dev/null
+++ b/00250-getentropy.patch
@@ -0,0 +1,22 @@
+diff --git a/Python/random.c b/Python/random.c
+index 2f83b5d..4cae217 100644
+--- a/Python/random.c
++++ b/Python/random.c
+@@ -97,8 +97,15 @@ win32_urandom(unsigned char *buffer, Py_ssize_t size, int raise)
+ }
+
+ /* Issue #25003: Don't use getentropy() on Solaris (available since
+- * Solaris 11.3), it is blocking whereas os.urandom() should not block. */
+-#elif defined(HAVE_GETENTROPY) && !defined(sun)
++ Solaris 11.3), it is blocking whereas os.urandom() should not block.
++
++ Issue #29188: Don't use getentropy() on Linux since the glibc 2.24
++ implements it with the getrandom() syscall which can fail with ENOSYS,
++ and this error is not supported in py_getentropy() and getrandom() is called
++ with flags=0 which blocks until system urandom is initialized, which is not
++ the desired behaviour to seed the Python hash secret nor for os.urandom():
++ see the PEP 524 which was only implemented in Python 3.6. */
++#elif defined(HAVE_GETENTROPY) && !defined(sun) && !defined(linux)
+ #define PY_GETENTROPY 1
+
+ /* Fill buffer with size pseudo-random bytes generated by getentropy().
diff --git a/python2.spec b/python2.spec
index 840cc01..3859681 100644
--- a/python2.spec
+++ b/python2.spec
@@ -735,11 +735,12 @@ Patch193: 00193-enable-loading-sqlite-extensions.patch
# 00198 #
Patch198: 00198-add-rewheel-module.patch
-# 00200 #
-# test_gdb.test_threads fails when run within rpmbuild
-# I couldnt reproduce the issue outside of rpmbuild, therefore
-# I skip test for now
-Patch200: 00200-skip-thread-test.patch
+# 00250 #
+# After glibc-2.24.90, Python failed to start on EL7 kernel
+# rhbz#1410175:
https://bugzilla.redhat.com/show_bug.cgi?id=1410175
+#
http://bugs.python.org/issue29157
+# Fixed upstream:
https://hg.python.org/cpython/rev/13a39142c047
+Patch250: 00250-getentropy.patch
# (New patches go here ^^^)
#
@@ -1056,6 +1057,8 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch198 -p1
%endif
+%patch250 -p1
+
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -1920,6 +1923,7 @@ rm -fr %{buildroot}
%changelog
* Wed Jan 11 2017 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.13-1
- Update to 2.7.13
+- Don't blow up on EL7 kernel (random generator) (rhbz#1410175, rhbz#1410187)
* Thu Oct 27 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-9
- Rename package to python2 and also rename the subpackages accordingly
commit 202761631bb1008780df41228ff774ffcc0717a8
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Wed Jan 11 20:20:31 2017 +0100
Update to Python 2.7.13
Refactored patches: 10, 102 112, 167, 180, 191
Dropped patches: 184, 200, 209, 242, 247
diff --git a/00010-2.7.12-binutils-no-dep.patch b/00010-2.7.12-binutils-no-dep.patch
deleted file mode 100644
index d74dbf9..0000000
--- a/00010-2.7.12-binutils-no-dep.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py
-index b2c514d..d92af0c 100644
---- a/Lib/ctypes/util.py
-+++ b/Lib/ctypes/util.py
-@@ -139,7 +139,9 @@ elif os.name == "posix":
- finally:
- rv = f.close()
- if rv == 10:
-- raise OSError, 'objdump command not found'
-+ return os.path.basename(f) # This is good for GLibc, I think,
-+ # and a dep on binutils is big (for
-+ # live CDs).
- res = re.search(r'\sSONAME\s+([^\s]+)', dump)
- if not res:
- return None
diff --git a/00010-2.7.13-binutils-no-dep.patch b/00010-2.7.13-binutils-no-dep.patch
new file mode 100644
index 0000000..d432623
--- /dev/null
+++ b/00010-2.7.13-binutils-no-dep.patch
@@ -0,0 +1,21 @@
+diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py
+index ab10ec5..923d1b7 100644
+--- a/Lib/ctypes/util.py
++++ b/Lib/ctypes/util.py
+@@ -140,11 +140,15 @@ elif os.name == "posix":
+ # assuming GNU binutils / ELF
+ if not f:
+ return None
+- cmd = 'if ! type objdump >/dev/null 2>&1; then exit; fi;'
\
++ cmd = 'if ! type objdump >/dev/null 2>&1; then exit 10;
fi;' \
+ 'objdump -p -j .dynamic 2>/dev/null "$1"'
+ proc = subprocess.Popen((cmd, '_get_soname', f), shell=True,
+ stdout=subprocess.PIPE)
+ [dump, _] = proc.communicate()
++ if proc.returncode == 10:
++ return os.path.basename(f) # This is good for GLibc, I think,
++ # and a dep on binutils is big (for
++ # live CDs).
+ res = re.search(br'\sSONAME\s+([^\s]+)', dump)
+ if not res:
+ return None
diff --git a/00102-2.7.12-lib64.patch b/00102-2.7.12-lib64.patch
deleted file mode 100644
index 00c835c..0000000
--- a/00102-2.7.12-lib64.patch
+++ /dev/null
@@ -1,184 +0,0 @@
-diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
-index b9f1c6c..7b23714 100644
---- a/Lib/distutils/command/install.py
-+++ b/Lib/distutils/command/install.py
-@@ -42,14 +42,14 @@ else:
- INSTALL_SCHEMES = {
- 'unix_prefix': {
- 'purelib': '$base/lib/python$py_version_short/site-packages',
-- 'platlib':
'$platbase/lib/python$py_version_short/site-packages',
-+ 'platlib':
'$platbase/lib64/python$py_version_short/site-packages',
- 'headers': '$base/include/python$py_version_short/$dist_name',
- 'scripts': '$base/bin',
- 'data' : '$base',
- },
- 'unix_home': {
- 'purelib': '$base/lib/python',
-- 'platlib': '$base/lib/python',
-+ 'platlib': '$base/lib64/python',
- 'headers': '$base/include/python/$dist_name',
- 'scripts': '$base/bin',
- 'data' : '$base',
-diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
-index 068d1ba..3e7f077 100644
---- a/Lib/distutils/sysconfig.py
-+++ b/Lib/distutils/sysconfig.py
-@@ -119,8 +119,12 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
- prefix = plat_specific and EXEC_PREFIX or PREFIX
-
- if os.name == "posix":
-+ if plat_specific or standard_lib:
-+ lib = "lib64"
-+ else:
-+ lib = "lib"
- libpython = os.path.join(prefix,
-- "lib", "python" +
get_python_version())
-+ lib, "python" + get_python_version())
- if standard_lib:
- return libpython
- else:
-diff --git a/Lib/site.py b/Lib/site.py
-index e8433b4..e8e6b50 100644
---- a/Lib/site.py
-+++ b/Lib/site.py
-@@ -288,12 +288,16 @@ def getsitepackages():
- if sys.platform in ('os2emx', 'riscos'):
- sitepackages.append(os.path.join(prefix, "Lib",
"site-packages"))
- elif os.sep == '/':
-+ sitepackages.append(os.path.join(prefix, "lib64",
-+ "python" + sys.version[:3],
-+ "site-packages"))
- sitepackages.append(os.path.join(prefix, "lib",
- "python" + sys.version[:3],
- "site-packages"))
- sitepackages.append(os.path.join(prefix, "lib",
"site-python"))
- else:
- sitepackages.append(prefix)
-+ sitepackages.append(os.path.join(prefix, "lib64",
"site-packages"))
- sitepackages.append(os.path.join(prefix, "lib",
"site-packages"))
- if sys.platform == "darwin":
- # for framework builds *only* we add the standard Apple
-diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py
-index 78c4809..3b9e74d 100644
---- a/Lib/test/test_site.py
-+++ b/Lib/test/test_site.py
-@@ -246,17 +246,20 @@ class HelperFunctionsTests(unittest.TestCase):
- self.assertEqual(dirs[2], wanted)
- elif os.sep == '/':
- # OS X non-framwework builds, Linux, FreeBSD, etc
-- self.assertEqual(len(dirs), 2)
-- wanted = os.path.join('xoxo', 'lib', 'python' +
sys.version[:3],
-+ self.assertEqual(len(dirs), 3)
-+ wanted = os.path.join('xoxo', 'lib64', 'python' +
sys.version[:3],
- 'site-packages')
- self.assertEqual(dirs[0], wanted)
-- wanted = os.path.join('xoxo', 'lib', 'site-python')
-+ wanted = os.path.join('xoxo', 'lib', 'python' +
sys.version[:3],
-+ 'site-packages')
- self.assertEqual(dirs[1], wanted)
-+ wanted = os.path.join('xoxo', 'lib', 'site-python')
-+ self.assertEqual(dirs[2], wanted)
- else:
- # other platforms
- self.assertEqual(len(dirs), 2)
- self.assertEqual(dirs[0], 'xoxo')
-- wanted = os.path.join('xoxo', 'lib',
'site-packages')
-+ wanted = os.path.join('xoxo', 'lib64',
'site-packages')
- self.assertEqual(dirs[1], wanted)
-
- class PthFile(object):
-diff --git a/Makefile.pre.in b/Makefile.pre.in
-index 5741a4c..0faa5c5 100644
---- a/Makefile.pre.in
-+++ b/Makefile.pre.in
-@@ -111,7 +111,7 @@ LIBDIR= @libdir@
- MANDIR= @mandir@
- INCLUDEDIR= @includedir@
- CONFINCLUDEDIR= $(exec_prefix)/include
--SCRIPTDIR= $(prefix)/lib
-+SCRIPTDIR= $(prefix)/lib64
-
- # Detailed destination directories
- BINLIBDEST= $(LIBDIR)/python$(VERSION)
-diff --git a/Modules/Setup.dist b/Modules/Setup.dist
-index c70a0d6..051fd41 100644
---- a/Modules/Setup.dist
-+++ b/Modules/Setup.dist
-@@ -416,7 +416,7 @@ gdbm gdbmmodule.c -lgdbm
- # Edit the variables DB and DBLIBVERto point to the db top directory
- # and the subdirectory of PORT where you built it.
- DBINC=/usr/include/libdb
--DBLIB=/usr/lib
-+DBLIB=/usr/lib64
- _bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb
-
- # Historical Berkeley DB 1.85
-@@ -462,7 +462,7 @@ cPickle cPickle.c
- # Andrew Kuchling's zlib module.
- # This require zlib 1.1.3 (or later).
- # See
http://www.gzip.org/zlib/
--zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
-+zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib64 -lz
-
- # Interface to the Expat XML parser
- #
-diff --git a/Modules/getpath.c b/Modules/getpath.c
-index 428684c..9ef6711 100644
---- a/Modules/getpath.c
-+++ b/Modules/getpath.c
-@@ -108,7 +108,7 @@ static char prefix[MAXPATHLEN+1];
- static char exec_prefix[MAXPATHLEN+1];
- static char progpath[MAXPATHLEN+1];
- static char *module_search_path = NULL;
--static char lib_python[] = "lib/python" VERSION;
-+static char lib_python[] = "lib64/python" VERSION;
-
- static void
- reduce(char *dir)
-@@ -550,7 +550,7 @@ calculate_path(void)
- fprintf(stderr,
- "Could not find platform dependent libraries
<exec_prefix>\n");
- strncpy(exec_prefix, EXEC_PREFIX, MAXPATHLEN);
-- joinpath(exec_prefix, "lib/lib-dynload");
-+ joinpath(exec_prefix, "lib64/lib-dynload");
- }
- /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */
-
-diff --git a/setup.py b/setup.py
-index 55c4f5d..19efe82 100644
---- a/setup.py
-+++ b/setup.py
-@@ -456,7 +456,7 @@ class PyBuildExt(build_ext):
- def detect_modules(self):
- # Ensure that /usr/local is always used
- if not cross_compiling:
-- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
-+ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib64')
- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
- if cross_compiling:
- self.add_gcc_paths()
-@@ -782,11 +782,11 @@ class PyBuildExt(build_ext):
- elif curses_library:
- readline_libs.append(curses_library)
- elif self.compiler.find_library_file(lib_dirs +
-- ['/usr/lib/termcap'],
-+ ['/usr/lib64/termcap'],
- 'termcap'):
- readline_libs.append('termcap')
- exts.append( Extension('readline', ['readline.c'],
-- library_dirs=['/usr/lib/termcap'],
-+ library_dirs=['/usr/lib64/termcap'],
- extra_link_args=readline_extra_link_args,
- libraries=readline_libs) )
- else:
-@@ -821,8 +821,8 @@ class PyBuildExt(build_ext):
- if krb5_h:
- ssl_incs += krb5_h
- ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
-- ['/usr/local/ssl/lib',
-- '/usr/contrib/ssl/lib/'
-+ ['/usr/local/ssl/lib64',
-+ '/usr/contrib/ssl/lib64/'
- ] )
-
- if (ssl_incs is not None and
diff --git a/00102-2.7.13-lib64.patch b/00102-2.7.13-lib64.patch
new file mode 100644
index 0000000..5d20879
--- /dev/null
+++ b/00102-2.7.13-lib64.patch
@@ -0,0 +1,184 @@
+diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
+index b9f1c6c..7b23714 100644
+--- a/Lib/distutils/command/install.py
++++ b/Lib/distutils/command/install.py
+@@ -42,14 +42,14 @@ else:
+ INSTALL_SCHEMES = {
+ 'unix_prefix': {
+ 'purelib': '$base/lib/python$py_version_short/site-packages',
+- 'platlib':
'$platbase/lib/python$py_version_short/site-packages',
++ 'platlib':
'$platbase/lib64/python$py_version_short/site-packages',
+ 'headers': '$base/include/python$py_version_short/$dist_name',
+ 'scripts': '$base/bin',
+ 'data' : '$base',
+ },
+ 'unix_home': {
+ 'purelib': '$base/lib/python',
+- 'platlib': '$base/lib/python',
++ 'platlib': '$base/lib64/python',
+ 'headers': '$base/include/python/$dist_name',
+ 'scripts': '$base/bin',
+ 'data' : '$base',
+diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
+index 068d1ba..3e7f077 100644
+--- a/Lib/distutils/sysconfig.py
++++ b/Lib/distutils/sysconfig.py
+@@ -119,8 +119,12 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
+ prefix = plat_specific and EXEC_PREFIX or PREFIX
+
+ if os.name == "posix":
++ if plat_specific or standard_lib:
++ lib = "lib64"
++ else:
++ lib = "lib"
+ libpython = os.path.join(prefix,
+- "lib", "python" +
get_python_version())
++ lib, "python" + get_python_version())
+ if standard_lib:
+ return libpython
+ else:
+diff --git a/Lib/site.py b/Lib/site.py
+index c360802..868b7cb 100644
+--- a/Lib/site.py
++++ b/Lib/site.py
+@@ -288,12 +288,16 @@ def getsitepackages():
+ if sys.platform in ('os2emx', 'riscos'):
+ sitepackages.append(os.path.join(prefix, "Lib",
"site-packages"))
+ elif os.sep == '/':
++ sitepackages.append(os.path.join(prefix, "lib64",
++ "python" + sys.version[:3],
++ "site-packages"))
+ sitepackages.append(os.path.join(prefix, "lib",
+ "python" + sys.version[:3],
+ "site-packages"))
+ sitepackages.append(os.path.join(prefix, "lib",
"site-python"))
+ else:
+ sitepackages.append(prefix)
++ sitepackages.append(os.path.join(prefix, "lib64",
"site-packages"))
+ sitepackages.append(os.path.join(prefix, "lib",
"site-packages"))
+ return sitepackages
+
+diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py
+index d9a9324..e411e5c 100644
+--- a/Lib/test/test_site.py
++++ b/Lib/test/test_site.py
+@@ -235,17 +235,20 @@ class HelperFunctionsTests(unittest.TestCase):
+ self.assertEqual(dirs[0], wanted)
+ elif os.sep == '/':
+ # OS X, Linux, FreeBSD, etc
+- self.assertEqual(len(dirs), 2)
+- wanted = os.path.join('xoxo', 'lib', 'python' +
sys.version[:3],
++ self.assertEqual(len(dirs), 3)
++ wanted = os.path.join('xoxo', 'lib64', 'python' +
sys.version[:3],
+ 'site-packages')
+ self.assertEqual(dirs[0], wanted)
+- wanted = os.path.join('xoxo', 'lib', 'site-python')
++ wanted = os.path.join('xoxo', 'lib', 'python' +
sys.version[:3],
++ 'site-packages')
+ self.assertEqual(dirs[1], wanted)
++ wanted = os.path.join('xoxo', 'lib', 'site-python')
++ self.assertEqual(dirs[2], wanted)
+ else:
+ # other platforms
+ self.assertEqual(len(dirs), 2)
+ self.assertEqual(dirs[0], 'xoxo')
+- wanted = os.path.join('xoxo', 'lib',
'site-packages')
++ wanted = os.path.join('xoxo', 'lib64',
'site-packages')
+ self.assertEqual(dirs[1], wanted)
+
+ class PthFile(object):
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index adae76b..ecb27f3 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -111,7 +111,7 @@ LIBDIR= @libdir@
+ MANDIR= @mandir@
+ INCLUDEDIR= @includedir@
+ CONFINCLUDEDIR= $(exec_prefix)/include
+-SCRIPTDIR= $(prefix)/lib
++SCRIPTDIR= $(prefix)/lib64
+
+ # Detailed destination directories
+ BINLIBDEST= $(LIBDIR)/python$(VERSION)
+diff --git a/Modules/Setup.dist b/Modules/Setup.dist
+index fbfa1c1..138fb33 100644
+--- a/Modules/Setup.dist
++++ b/Modules/Setup.dist
+@@ -416,7 +416,7 @@ gdbm gdbmmodule.c -lgdbm
+ # Edit the variables DB and DBLIBVERto point to the db top directory
+ # and the subdirectory of PORT where you built it.
+ DBINC=/usr/include/libdb
+-DBLIB=/usr/lib
++DBLIB=/usr/lib64
+ _bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb
+
+ # Historical Berkeley DB 1.85
+@@ -462,7 +462,7 @@ cPickle cPickle.c
+ # Andrew Kuchling's zlib module.
+ # This require zlib 1.1.3 (or later).
+ # See
http://www.gzip.org/zlib/
+-zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
++zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib64 -lz
+
+ # Interface to the Expat XML parser
+ #
+diff --git a/Modules/getpath.c b/Modules/getpath.c
+index fd33a01..c5c86fd 100644
+--- a/Modules/getpath.c
++++ b/Modules/getpath.c
+@@ -108,7 +108,7 @@ static char prefix[MAXPATHLEN+1];
+ static char exec_prefix[MAXPATHLEN+1];
+ static char progpath[MAXPATHLEN+1];
+ static char *module_search_path = NULL;
+-static char lib_python[] = "lib/python" VERSION;
++static char lib_python[] = "lib64/python" VERSION;
+
+ static void
+ reduce(char *dir)
+@@ -548,7 +548,7 @@ calculate_path(void)
+ fprintf(stderr,
+ "Could not find platform dependent libraries
<exec_prefix>\n");
+ strncpy(exec_prefix, EXEC_PREFIX, MAXPATHLEN);
+- joinpath(exec_prefix, "lib/lib-dynload");
++ joinpath(exec_prefix, "lib64/lib-dynload");
+ }
+ /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */
+
+diff --git a/setup.py b/setup.py
+index 99ac359..859b6c4 100644
+--- a/setup.py
++++ b/setup.py
+@@ -456,7 +456,7 @@ class PyBuildExt(build_ext):
+ def detect_modules(self):
+ # Ensure that /usr/local is always used
+ if not cross_compiling:
+- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
++ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib64')
+ add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+ if cross_compiling:
+ self.add_gcc_paths()
+@@ -782,11 +782,11 @@ class PyBuildExt(build_ext):
+ elif curses_library:
+ readline_libs.append(curses_library)
+ elif self.compiler.find_library_file(lib_dirs +
+- ['/usr/lib/termcap'],
++ ['/usr/lib64/termcap'],
+ 'termcap'):
+ readline_libs.append('termcap')
+ exts.append( Extension('readline', ['readline.c'],
+- library_dirs=['/usr/lib/termcap'],
++ library_dirs=['/usr/lib64/termcap'],
+ extra_link_args=readline_extra_link_args,
+ libraries=readline_libs) )
+ else:
+@@ -821,8 +821,8 @@ class PyBuildExt(build_ext):
+ if krb5_h:
+ ssl_incs += krb5_h
+ ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
+- ['/usr/local/ssl/lib',
+- '/usr/contrib/ssl/lib/'
++ ['/usr/local/ssl/lib64',
++ '/usr/contrib/ssl/lib64/'
+ ] )
+
+ if (ssl_incs is not None and
diff --git a/00112-2.7.12-debug-build.patch b/00112-2.7.12-debug-build.patch
deleted file mode 100644
index df4c577..0000000
--- a/00112-2.7.12-debug-build.patch
+++ /dev/null
@@ -1,301 +0,0 @@
-diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py
-index 3a49454..07fd2ae 100644
---- a/Lib/distutils/command/build_ext.py
-+++ b/Lib/distutils/command/build_ext.py
-@@ -676,7 +676,10 @@ class build_ext (Command):
- so_ext = get_config_var('SO')
- if os.name == 'nt' and self.debug:
- return os.path.join(*ext_path) + '_d' + so_ext
-- return os.path.join(*ext_path) + so_ext
-+
-+ # Similarly, extensions in debug mode are named 'module_d.so', to
-+ # avoid adding the _d to the SO config variable:
-+ return os.path.join(*ext_path) + (sys.pydebug and "_d" or
"") + so_ext
-
- def get_export_symbols (self, ext):
- """Return the list of symbols that a shared extension has to
-@@ -761,6 +764,8 @@ class build_ext (Command):
- template = "python%d.%d"
- pythonlib = (template %
- (sys.hexversion >> 24, (sys.hexversion >> 16)
& 0xff))
-+ if sys.pydebug:
-+ pythonlib += '_d'
- return ext.libraries + [pythonlib]
- else:
- return ext.libraries
-diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
-index 068d1ba..031f809 100644
---- a/Lib/distutils/sysconfig.py
-+++ b/Lib/distutils/sysconfig.py
-@@ -90,7 +90,8 @@ def get_python_inc(plat_specific=0, prefix=None):
- # 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())
-+ return os.path.join(prefix, "include",
-+ "python" + get_python_version() + (sys.pydebug and
'-debug' or ''))
- elif os.name == "nt":
- return os.path.join(prefix, "include")
- elif os.name == "os2":
-@@ -244,7 +245,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)
-- return os.path.join(lib_dir, "config", "Makefile")
-+ return os.path.join(lib_dir, "config" + (sys.pydebug and
"-debug" or ""), "Makefile")
-
-
- def parse_config_h(fp, g=None):
-diff --git a/Lib/distutils/tests/test_install.py b/Lib/distutils/tests/test_install.py
-index 78fac46..d1d0931 100644
---- a/Lib/distutils/tests/test_install.py
-+++ b/Lib/distutils/tests/test_install.py
-@@ -20,8 +20,9 @@ from distutils.tests import support
-
-
- def _make_ext_name(modname):
-- if os.name == 'nt' and sys.executable.endswith('_d.exe'):
-+ if sys.pydebug:
- modname += '_d'
-+
- return modname + sysconfig.get_config_var('SO')
-
-
-diff --git a/Makefile.pre.in b/Makefile.pre.in
-index 5741a4c..d13ba40 100644
---- a/Makefile.pre.in
-+++ b/Makefile.pre.in
-@@ -116,8 +116,8 @@ SCRIPTDIR= $(prefix)/lib
- # Detailed destination directories
- BINLIBDEST= $(LIBDIR)/python$(VERSION)
- LIBDEST= $(SCRIPTDIR)/python$(VERSION)
--INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
--CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)
-+INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)$(DEBUG_SUFFIX)
-+CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)$(DEBUG_SUFFIX)
- LIBP= $(LIBDIR)/python$(VERSION)
-
- # Symbols used for using shared libraries
-@@ -131,6 +131,12 @@ DESTSHARED= $(BINLIBDEST)/lib-dynload
- EXE= @EXEEXT@
- BUILDEXE= @BUILDEXEEXT@
-
-+# DEBUG_EXT is used by ELF files (names and SONAMEs); it will be "_d" for a
debug build
-+# DEBUG_SUFFIX is used by filesystem paths; it will be "-debug" for a debug
build
-+# Both will be empty in an optimized build
-+DEBUG_EXT= @DEBUG_EXT@
-+DEBUG_SUFFIX= @DEBUG_SUFFIX@
-+
- # Short name and location for Mac OS X Python framework
- UNIVERSALSDK=@UNIVERSALSDK@
- PYTHONFRAMEWORK= @PYTHONFRAMEWORK@
-@@ -197,8 +203,8 @@ LIBOBJDIR= Python/
- LIBOBJS= @LIBOBJS@
- UNICODE_OBJS= @UNICODE_OBJS@
-
--PYTHON= python$(EXE)
--BUILDPYTHON= python$(BUILDEXE)
-+PYTHON= python$(DEBUG_SUFFIX)$(EXE)
-+BUILDPYTHON= python$(DEBUG_SUFFIX)$(BUILDEXE)
-
- cross_compiling=@cross_compiling@
- PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@
-@@ -549,7 +555,7 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o
- _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
- $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
-
--libpython$(VERSION).so: $(LIBRARY_OBJS)
-+libpython$(VERSION)$(DEBUG_EXT).so: $(LIBRARY_OBJS)
- if test $(INSTSONAME) != $(LDLIBRARY); then \
- $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS)
$(LIBC) $(LIBM) $(LDLAST); \
- $(LN) -f $(INSTSONAME) $@; \
-@@ -979,18 +985,18 @@ bininstall: altbininstall
- then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON); \
- else true; \
- fi
-- (cd $(DESTDIR)$(BINDIR); $(LN) -s python2$(EXE) $(PYTHON))
-- -rm -f $(DESTDIR)$(BINDIR)/python2$(EXE)
-- (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(EXE) python2$(EXE))
-- -rm -f $(DESTDIR)$(BINDIR)/python2-config
-- (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python2-config)
-- -rm -f $(DESTDIR)$(BINDIR)/python-config
-- (cd $(DESTDIR)$(BINDIR); $(LN) -s python2-config python-config)
-+ (cd $(DESTDIR)$(BINDIR); $(LN) -s python2$(DEBUG_SUFFIX)$(EXE) $(PYTHON))
-+ -rm -f $(DESTDIR)$(BINDIR)/python2$(DEBUG_SUFFIX)$(EXE)
-+ (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(DEBUG_SUFFIX)$(EXE)
python2$(DEBUG_SUFFIX)$(EXE))
-+ -rm -f $(DESTDIR)$(BINDIR)/python2$(DEBUG_SUFFIX)-config
-+ (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(DEBUG_SUFFIX)-config
python2$(DEBUG_SUFFIX)-config)
-+ -rm -f $(DESTDIR)$(BINDIR)/python$(DEBUG_SUFFIX)-config
-+ (cd $(DESTDIR)$(BINDIR); $(LN) -s python2$(DEBUG_SUFFIX)-config
python$(DEBUG_SUFFIX)-config)
- -test -d $(DESTDIR)$(LIBPC) || $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(LIBPC)
-- -rm -f $(DESTDIR)$(LIBPC)/python2.pc
-- (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python2.pc)
-- -rm -f $(DESTDIR)$(LIBPC)/python.pc
-- (cd $(DESTDIR)$(LIBPC); $(LN) -s python2.pc python.pc)
-+ -rm -f $(DESTDIR)$(LIBPC)/python2$(DEBUG_SUFFIX).pc
-+ (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION)$(DEBUG_SUFFIX).pc
python2$(DEBUG_SUFFIX).pc)
-+ -rm -f $(DESTDIR)$(LIBPC)/python$(DEBUG_SUFFIX).pc
-+ (cd $(DESTDIR)$(LIBPC); $(LN) -s python2$(DEBUG_SUFFIX).pc python$(DEBUG_SUFFIX).pc)
-
- # Install the interpreter with $(VERSION) affixed
- # This goes into $(exec_prefix)
-@@ -1003,7 +1009,7 @@ altbininstall: $(BUILDPYTHON)
- else true; \
- fi; \
- done
-- $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE)
-+ $(INSTALL_PROGRAM) $(BUILDPYTHON)
$(DESTDIR)$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)$(EXE)
- if test -f $(LDLIBRARY); then \
- if test -n "$(DLLLIBRARY)" ; then \
- $(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
-@@ -1173,10 +1179,11 @@ $(srcdir)/Lib/$(PLATDIR):
- fi; \
- cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen
-
--python-config: $(srcdir)/Misc/python-config.in
-+python$(DEBUG_SUFFIX)-config: $(srcdir)/Misc/python-config.in
- # 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
-+ sed -e "s,@EXENAME@,$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)$(EXE)," <
$(srcdir)/Misc/python-config.in >python$(DEBUG_SUFFIX)-config
-+
-
- # Install the include files
- INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
-@@ -1197,13 +1204,13 @@ inclinstall:
- $(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
-
- # Install the library and miscellaneous stuff needed for extending/embedding
--# This goes into $(exec_prefix)
--LIBPL= $(LIBP)/config
-+# This goes into $(exec_prefix)$(DEBUG_SUFFIX)
-+LIBPL= $(LIBP)/config$(DEBUG_SUFFIX)
-
- # pkgconfig directory
- LIBPC= $(LIBDIR)/pkgconfig
-
--libainstall: all python-config
-+libainstall: all python$(DEBUG_SUFFIX)-config
- @for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \
- do \
- if test ! -d $(DESTDIR)$$i; then \
-@@ -1219,11 +1226,10 @@ libainstall: all python-config
- $(INSTALL_DATA) Modules/Setup $(DESTDIR)$(LIBPL)/Setup
- $(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local
- $(INSTALL_DATA) Modules/Setup.config $(DESTDIR)$(LIBPL)/Setup.config
-- $(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc
-+ $(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION)$(DEBUG_SUFFIX).pc
- $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
- $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
-- $(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(VERSION)-config
-- rm python-config
-+ $(INSTALL_SCRIPT) python$(DEBUG_SUFFIX)-config
$(DESTDIR)$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)-config
- @if [ -s Modules/python.exp -a \
- "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ];
then \
- echo; echo "Installing support files for building shared extension modules on
AIX:"; \
-diff --git a/Misc/python-config.in b/Misc/python-config.in
-index a09e07c..c1691ef 100644
---- a/Misc/python-config.in
-+++ b/Misc/python-config.in
-@@ -44,7 +44,7 @@ for opt in opt_flags:
- print ' '.join(flags)
-
- elif opt in ('--libs', '--ldflags'):
-- 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
-diff --git a/Modules/makesetup b/Modules/makesetup
-index 8862c36..0d4ae4e 100755
---- a/Modules/makesetup
-+++ b/Modules/makesetup
-@@ -233,7 +233,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
- *$mod.o*) base=$mod;;
- *) base=${mod}module;;
- esac
-- file="$srcdir/$base\$(SO)"
-+ file="$srcdir/$base\$(DEBUG_EXT)\$(SO)"
- case $doconfig in
- no) SHAREDMODS="$SHAREDMODS $file";;
- esac
-diff --git a/Python/dynload_shlib.c b/Python/dynload_shlib.c
-index 17ebab1..02a94aa 100644
---- a/Python/dynload_shlib.c
-+++ b/Python/dynload_shlib.c
-@@ -46,11 +46,16 @@ const struct filedescr _PyImport_DynLoadFiletab[] = {
- {"module.exe", "rb", C_EXTENSION},
- {"MODULE.EXE", "rb", C_EXTENSION},
- #else
-+#ifdef Py_DEBUG
-+ {"_d.so", "rb", C_EXTENSION},
-+ {"module_d.so", "rb", C_EXTENSION},
-+#else
- {".so", "rb", C_EXTENSION},
- {"module.so", "rb", C_EXTENSION},
--#endif
--#endif
--#endif
-+#endif /* Py_DEBUG */
-+#endif /* __VMS */
-+#endif /* defined(PYOS_OS2) && defined(PYCC_GCC) */
-+#endif /* __CYGWIN__ */
- {0, 0}
- };
-
-diff --git a/Python/sysmodule.c b/Python/sysmodule.c
-index 609578b..6ee9639 100644
---- a/Python/sysmodule.c
-+++ b/Python/sysmodule.c
-@@ -1577,6 +1577,12 @@ _PySys_Init(void)
- PyString_FromString("legacy"));
- #endif
-
-+#ifdef Py_DEBUG
-+ PyDict_SetItemString(sysdict, "pydebug", Py_True);
-+#else
-+ PyDict_SetItemString(sysdict, "pydebug", Py_False);
-+#endif
-+
- #undef SET_SYS_FROM_STRING
- if (PyErr_Occurred())
- return NULL;
-diff --git a/configure.ac b/configure.ac
-index cce1be7..acb496b 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -761,7 +761,7 @@ AC_SUBST(LIBRARY)
- AC_MSG_CHECKING(LIBRARY)
- if test -z "$LIBRARY"
- then
-- LIBRARY='libpython$(VERSION).a'
-+ LIBRARY='libpython$(VERSION)$(DEBUG_EXT).a'
- fi
- AC_MSG_RESULT($LIBRARY)
-
-@@ -907,8 +907,8 @@ if test $enable_shared = "yes"; then
- INSTSONAME="$LDLIBRARY".$SOVERSION
- ;;
- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*)
-- LDLIBRARY='libpython$(VERSION).so'
-- BLDLIBRARY='-L. -lpython$(VERSION)'
-+ LDLIBRARY='libpython$(VERSION)$(DEBUG_EXT).so'
-+ BLDLIBRARY='-L. -lpython$(VERSION)$(DEBUG_EXT)'
- RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
- case $ac_sys_system in
- FreeBSD*)
-@@ -1051,6 +1051,14 @@ else AC_MSG_RESULT(no); Py_DEBUG='false'
- fi],
- [AC_MSG_RESULT(no)])
-
-+if test "$Py_DEBUG" = 'true'
-+then
-+ DEBUG_EXT=_d
-+ DEBUG_SUFFIX=-debug
-+fi
-+AC_SUBST(DEBUG_EXT)
-+AC_SUBST(DEBUG_SUFFIX)
-+
- # XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
- # merged with this chunk of code?
-
diff --git a/00112-2.7.13-debug-build.patch b/00112-2.7.13-debug-build.patch
new file mode 100644
index 0000000..b7ba7ba
--- /dev/null
+++ b/00112-2.7.13-debug-build.patch
@@ -0,0 +1,324 @@
+From 898f93aa206e577dfe854c59bc62d0cea09cd5ed Mon Sep 17 00:00:00 2001
+From: Tomas Orsava <torsava(a)redhat.com>
+Date: Tue, 10 Jan 2017 16:19:50 +0100
+Subject: [PATCH] Patch to support building both optimized vs debug stacks DSO
+ ABIs,
+
+sharing the same .py and .pyc files, using "_d.so" to signify a debug build of
+an extension module.
+---
+ Lib/distutils/command/build_ext.py | 7 ++++-
+ Lib/distutils/sysconfig.py | 5 ++--
+ Lib/distutils/tests/test_install.py | 3 +-
+ Makefile.pre.in | 56 ++++++++++++++++++++-----------------
+ Misc/python-config.in | 2 +-
+ Modules/makesetup | 2 +-
+ Python/dynload_shlib.c | 11 ++++++--
+ Python/sysmodule.c | 6 ++++
+ configure.ac | 14 ++++++++--
+ 9 files changed, 69 insertions(+), 37 deletions(-)
+
+diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py
+index 2c68be3..029d144 100644
+--- a/Lib/distutils/command/build_ext.py
++++ b/Lib/distutils/command/build_ext.py
+@@ -677,7 +677,10 @@ class build_ext (Command):
+ so_ext = get_config_var('SO')
+ if os.name == 'nt' and self.debug:
+ return os.path.join(*ext_path) + '_d' + so_ext
+- return os.path.join(*ext_path) + so_ext
++
++ # Similarly, extensions in debug mode are named 'module_d.so', to
++ # avoid adding the _d to the SO config variable:
++ return os.path.join(*ext_path) + (sys.pydebug and "_d" or
"") + so_ext
+
+ def get_export_symbols (self, ext):
+ """Return the list of symbols that a shared extension has to
+@@ -762,6 +765,8 @@ class build_ext (Command):
+ template = "python%d.%d"
+ pythonlib = (template %
+ (sys.hexversion >> 24, (sys.hexversion >> 16)
& 0xff))
++ if sys.pydebug:
++ pythonlib += '_d'
+ return ext.libraries + [pythonlib]
+ else:
+ return ext.libraries
+diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
+index 3e7f077..ec5d584 100644
+--- a/Lib/distutils/sysconfig.py
++++ b/Lib/distutils/sysconfig.py
+@@ -90,7 +90,8 @@ def get_python_inc(plat_specific=0, prefix=None):
+ # 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())
++ return os.path.join(prefix, "include",
++ "python" + get_python_version() + (sys.pydebug and
'-debug' or ''))
+ elif os.name == "nt":
+ return os.path.join(prefix, "include")
+ elif os.name == "os2":
+@@ -248,7 +249,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)
+- return os.path.join(lib_dir, "config", "Makefile")
++ return os.path.join(lib_dir, "config" + (sys.pydebug and
"-debug" or ""), "Makefile")
+
+
+ def parse_config_h(fp, g=None):
+diff --git a/Lib/distutils/tests/test_install.py b/Lib/distutils/tests/test_install.py
+index 78fac46..d1d0931 100644
+--- a/Lib/distutils/tests/test_install.py
++++ b/Lib/distutils/tests/test_install.py
+@@ -20,8 +20,9 @@ from distutils.tests import support
+
+
+ def _make_ext_name(modname):
+- if os.name == 'nt' and sys.executable.endswith('_d.exe'):
++ if sys.pydebug:
+ modname += '_d'
++
+ return modname + sysconfig.get_config_var('SO')
+
+
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index 997a2fc..467e782 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -116,8 +116,8 @@ SCRIPTDIR= $(prefix)/lib64
+ # Detailed destination directories
+ BINLIBDEST= $(LIBDIR)/python$(VERSION)
+ LIBDEST= $(SCRIPTDIR)/python$(VERSION)
+-INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
+-CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)
++INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)$(DEBUG_SUFFIX)
++CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)$(DEBUG_SUFFIX)
+ LIBP= $(LIBDIR)/python$(VERSION)
+
+ # Symbols used for using shared libraries
+@@ -131,6 +131,12 @@ DESTSHARED= $(BINLIBDEST)/lib-dynload
+ EXE= @EXEEXT@
+ BUILDEXE= @BUILDEXEEXT@
+
++# DEBUG_EXT is used by ELF files (names and SONAMEs); it will be "_d" for a
debug build
++# DEBUG_SUFFIX is used by filesystem paths; it will be "-debug" for a debug
build
++# Both will be empty in an optimized build
++DEBUG_EXT= @DEBUG_EXT@
++DEBUG_SUFFIX= @DEBUG_SUFFIX@
++
+ # Short name and location for Mac OS X Python framework
+ UNIVERSALSDK=@UNIVERSALSDK@
+ PYTHONFRAMEWORK= @PYTHONFRAMEWORK@
+@@ -197,8 +203,8 @@ LIBOBJDIR= Python/
+ LIBOBJS= @LIBOBJS@
+ UNICODE_OBJS= @UNICODE_OBJS@
+
+-PYTHON= python$(EXE)
+-BUILDPYTHON= python$(BUILDEXE)
++PYTHON= python$(DEBUG_SUFFIX)$(EXE)
++BUILDPYTHON= python$(DEBUG_SUFFIX)$(BUILDEXE)
+
+ PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@
+ _PYTHON_HOST_PLATFORM=@_PYTHON_HOST_PLATFORM@
+@@ -547,7 +553,7 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o
+ _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
+ $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
+
+-libpython$(VERSION).so: $(LIBRARY_OBJS)
++libpython$(VERSION)$(DEBUG_EXT).so: $(LIBRARY_OBJS)
+ if test $(INSTSONAME) != $(LDLIBRARY); then \
+ $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS)
$(LIBC) $(LIBM) $(LDLAST); \
+ $(LN) -f $(INSTSONAME) $@; \
+@@ -954,18 +960,18 @@ bininstall: altbininstall
+ then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON); \
+ else true; \
+ fi
+- (cd $(DESTDIR)$(BINDIR); $(LN) -s python2$(EXE) $(PYTHON))
+- -rm -f $(DESTDIR)$(BINDIR)/python2$(EXE)
+- (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(EXE) python2$(EXE))
+- -rm -f $(DESTDIR)$(BINDIR)/python2-config
+- (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python2-config)
+- -rm -f $(DESTDIR)$(BINDIR)/python-config
+- (cd $(DESTDIR)$(BINDIR); $(LN) -s python2-config python-config)
++ (cd $(DESTDIR)$(BINDIR); $(LN) -s python2$(DEBUG_SUFFIX)$(EXE) $(PYTHON))
++ -rm -f $(DESTDIR)$(BINDIR)/python2$(DEBUG_SUFFIX)$(EXE)
++ (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(DEBUG_SUFFIX)$(EXE)
python2$(DEBUG_SUFFIX)$(EXE))
++ -rm -f $(DESTDIR)$(BINDIR)/python2$(DEBUG_SUFFIX)-config
++ (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(DEBUG_SUFFIX)-config
python2$(DEBUG_SUFFIX)-config)
++ -rm -f $(DESTDIR)$(BINDIR)/python$(DEBUG_SUFFIX)-config
++ (cd $(DESTDIR)$(BINDIR); $(LN) -s python2$(DEBUG_SUFFIX)-config
python$(DEBUG_SUFFIX)-config)
+ -test -d $(DESTDIR)$(LIBPC) || $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(LIBPC)
+- -rm -f $(DESTDIR)$(LIBPC)/python2.pc
+- (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python2.pc)
+- -rm -f $(DESTDIR)$(LIBPC)/python.pc
+- (cd $(DESTDIR)$(LIBPC); $(LN) -s python2.pc python.pc)
++ -rm -f $(DESTDIR)$(LIBPC)/python2$(DEBUG_SUFFIX).pc
++ (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION)$(DEBUG_SUFFIX).pc
python2$(DEBUG_SUFFIX).pc)
++ -rm -f $(DESTDIR)$(LIBPC)/python$(DEBUG_SUFFIX).pc
++ (cd $(DESTDIR)$(LIBPC); $(LN) -s python2$(DEBUG_SUFFIX).pc python$(DEBUG_SUFFIX).pc)
+
+ # Install the interpreter with $(VERSION) affixed
+ # This goes into $(exec_prefix)
+@@ -978,7 +984,7 @@ altbininstall: $(BUILDPYTHON)
+ else true; \
+ fi; \
+ done
+- $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE)
++ $(INSTALL_PROGRAM) $(BUILDPYTHON)
$(DESTDIR)$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)$(EXE)
+ if test -f $(LDLIBRARY); then \
+ if test -n "$(DLLLIBRARY)" ; then \
+ $(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
+@@ -1148,10 +1154,11 @@ $(srcdir)/Lib/$(PLATDIR):
+ fi; \
+ cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen
+
+-python-config: $(srcdir)/Misc/python-config.in
++python$(DEBUG_SUFFIX)-config: $(srcdir)/Misc/python-config.in
+ # 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
++ sed -e "s,@EXENAME@,$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)$(EXE)," <
$(srcdir)/Misc/python-config.in >python$(DEBUG_SUFFIX)-config
++
+
+ # Install the include files
+ INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
+@@ -1172,13 +1179,13 @@ inclinstall:
+ $(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
+
+ # Install the library and miscellaneous stuff needed for extending/embedding
+-# This goes into $(exec_prefix)
+-LIBPL= $(LIBP)/config
++# This goes into $(exec_prefix)$(DEBUG_SUFFIX)
++LIBPL= $(LIBP)/config$(DEBUG_SUFFIX)
+
+ # pkgconfig directory
+ LIBPC= $(LIBDIR)/pkgconfig
+
+-libainstall: all python-config
++libainstall: all python$(DEBUG_SUFFIX)-config
+ @for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \
+ do \
+ if test ! -d $(DESTDIR)$$i; then \
+@@ -1194,11 +1201,10 @@ libainstall: all python-config
+ $(INSTALL_DATA) Modules/Setup $(DESTDIR)$(LIBPL)/Setup
+ $(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local
+ $(INSTALL_DATA) Modules/Setup.config $(DESTDIR)$(LIBPL)/Setup.config
+- $(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc
++ $(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION)$(DEBUG_SUFFIX).pc
+ $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
+ $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
+- $(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(VERSION)-config
+- rm python-config
++ $(INSTALL_SCRIPT) python$(DEBUG_SUFFIX)-config
$(DESTDIR)$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)-config
+ @if [ -s Modules/python.exp -a \
+ "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ];
then \
+ echo; echo "Installing support files for building shared extension modules on
AIX:"; \
+diff --git a/Misc/python-config.in b/Misc/python-config.in
+index a09e07c..c1691ef 100644
+--- a/Misc/python-config.in
++++ b/Misc/python-config.in
+@@ -44,7 +44,7 @@ for opt in opt_flags:
+ print ' '.join(flags)
+
+ elif opt in ('--libs', '--ldflags'):
+- 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
+diff --git a/Modules/makesetup b/Modules/makesetup
+index 1bffcbf..f0bc743 100755
+--- a/Modules/makesetup
++++ b/Modules/makesetup
+@@ -233,7 +233,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
+ *$mod.o*) base=$mod;;
+ *) base=${mod}module;;
+ esac
+- file="$srcdir/$base\$(SO)"
++ file="$srcdir/$base\$(DEBUG_EXT)\$(SO)"
+ case $doconfig in
+ no) SHAREDMODS="$SHAREDMODS $file";;
+ esac
+diff --git a/Python/dynload_shlib.c b/Python/dynload_shlib.c
+index 17ebab1..02a94aa 100644
+--- a/Python/dynload_shlib.c
++++ b/Python/dynload_shlib.c
+@@ -46,11 +46,16 @@ const struct filedescr _PyImport_DynLoadFiletab[] = {
+ {"module.exe", "rb", C_EXTENSION},
+ {"MODULE.EXE", "rb", C_EXTENSION},
+ #else
++#ifdef Py_DEBUG
++ {"_d.so", "rb", C_EXTENSION},
++ {"module_d.so", "rb", C_EXTENSION},
++#else
+ {".so", "rb", C_EXTENSION},
+ {"module.so", "rb", C_EXTENSION},
+-#endif
+-#endif
+-#endif
++#endif /* Py_DEBUG */
++#endif /* __VMS */
++#endif /* defined(PYOS_OS2) && defined(PYCC_GCC) */
++#endif /* __CYGWIN__ */
+ {0, 0}
+ };
+
+diff --git a/Python/sysmodule.c b/Python/sysmodule.c
+index aeff38a..183e3cc 100644
+--- a/Python/sysmodule.c
++++ b/Python/sysmodule.c
+@@ -1524,6 +1524,12 @@ _PySys_Init(void)
+ PyString_FromString("legacy"));
+ #endif
+
++#ifdef Py_DEBUG
++ PyDict_SetItemString(sysdict, "pydebug", Py_True);
++#else
++ PyDict_SetItemString(sysdict, "pydebug", Py_False);
++#endif
++
+ #undef SET_SYS_FROM_STRING
+ if (PyErr_Occurred())
+ return NULL;
+diff --git a/configure.ac b/configure.ac
+index 0a902c7..5caedb7 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -764,7 +764,7 @@ AC_SUBST(LIBRARY)
+ AC_MSG_CHECKING(LIBRARY)
+ if test -z "$LIBRARY"
+ then
+- LIBRARY='libpython$(VERSION).a'
++ LIBRARY='libpython$(VERSION)$(DEBUG_EXT).a'
+ fi
+ AC_MSG_RESULT($LIBRARY)
+
+@@ -910,8 +910,8 @@ if test $enable_shared = "yes"; then
+ INSTSONAME="$LDLIBRARY".$SOVERSION
+ ;;
+ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*)
+- LDLIBRARY='libpython$(VERSION).so'
+- BLDLIBRARY='-L. -lpython$(VERSION)'
++ LDLIBRARY='libpython$(VERSION)$(DEBUG_EXT).so'
++ BLDLIBRARY='-L. -lpython$(VERSION)$(DEBUG_EXT)'
+ RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
+ case $ac_sys_system in
+ FreeBSD*)
+@@ -1040,6 +1040,14 @@ else AC_MSG_RESULT(no); Py_DEBUG='false'
+ fi],
+ [AC_MSG_RESULT(no)])
+
++if test "$Py_DEBUG" = 'true'
++then
++ DEBUG_EXT=_d
++ DEBUG_SUFFIX=-debug
++fi
++AC_SUBST(DEBUG_EXT)
++AC_SUBST(DEBUG_SUFFIX)
++
+ # XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
+ # merged with this chunk of code?
+
+--
+2.11.0
+
diff --git a/00167-disable-stack-navigation-tests-when-optimized-in-test_gdb.patch
b/00167-disable-stack-navigation-tests-when-optimized-in-test_gdb.patch
index 3fa94fb..9807883 100644
--- a/00167-disable-stack-navigation-tests-when-optimized-in-test_gdb.patch
+++ b/00167-disable-stack-navigation-tests-when-optimized-in-test_gdb.patch
@@ -1,10 +1,12 @@
-diff -up
Python-2.7.3/Lib/test/test_gdb.py.disable-stack-navigation-tests-when-optimized-in-test_gdb
Python-2.7.3/Lib/test/test_gdb.py
----
Python-2.7.3/Lib/test/test_gdb.py.disable-stack-navigation-tests-when-optimized-in-test_gdb 2013-02-20
12:27:05.669526425 -0500
-+++ Python-2.7.3/Lib/test/test_gdb.py 2013-02-20 12:27:05.715526422 -0500
-@@ -653,10 +653,10 @@ class PyListTests(DebuggerTests):
+diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py
+index 3354b34..10ba0e5 100644
+--- a/Lib/test/test_gdb.py
++++ b/Lib/test/test_gdb.py
+@@ -725,11 +725,10 @@ class PyListTests(DebuggerTests):
+ ' 2 \n'
' 3 def foo(a, b, c):\n',
bt)
-
+-
+(a)unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands")
+(a)unittest.skipIf(python_is_optimized(),
+ "Python was compiled with optimizations")
@@ -15,7 +17,7 @@ diff -up
Python-2.7.3/Lib/test/test_gdb.py.disable-stack-navigation-tests-when-o
def test_pyup_command(self):
'Verify that the "py-up" command works'
bt = self.get_stack_trace(script=self.get_sample_script(),
-@@ -667,7 +667,6 @@ class StackNavigationTests(DebuggerTests
+@@ -740,7 +739,6 @@ class StackNavigationTests(DebuggerTests):
baz\(a, b, c\)
$''')
@@ -23,15 +25,17 @@ diff -up
Python-2.7.3/Lib/test/test_gdb.py.disable-stack-navigation-tests-when-o
def test_down_at_bottom(self):
'Verify handling of "py-down" at the bottom of the stack'
bt = self.get_stack_trace(script=self.get_sample_script(),
-@@ -675,7 +674,6 @@ $''')
+@@ -748,9 +746,6 @@ $''')
self.assertEndsWith(bt,
'Unable to find a newer python frame\n')
- @unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down
commands")
+- @unittest.skipIf(python_is_optimized(),
+- "Python was compiled with optimizations")
def test_up_at_top(self):
'Verify handling of "py-up" at the top of the stack'
bt = self.get_stack_trace(script=self.get_sample_script(),
-@@ -683,9 +681,6 @@ $''')
+@@ -758,9 +753,6 @@ $''')
self.assertEndsWith(bt,
'Unable to find an older python frame\n')
diff --git a/00180-python-add-support-for-ppc64p7.patch
b/00180-python-add-support-for-ppc64p7.patch
index 022944a..ef94c86 100644
--- a/00180-python-add-support-for-ppc64p7.patch
+++ b/00180-python-add-support-for-ppc64p7.patch
@@ -1,12 +1,13 @@
-diff -r de35eae9048a config.sub
---- a/config.sub Wed Apr 24 23:33:20 2013 +0200
-+++ b/config.sub Thu Apr 25 08:51:00 2013 +0200
-@@ -1008,7 +1008,7 @@
+diff --git a/config.sub b/config.sub
+index 3478c1f..e422173 100755
+--- a/config.sub
++++ b/config.sub
+@@ -1040,7 +1040,7 @@ case $basic_machine in
;;
ppc64) basic_machine=powerpc64-unknown
;;
- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed
's/^[^-]*-//'`
;;
- ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ ppc64le | powerpc64little)
basic_machine=powerpc64le-unknown
diff --git a/00184-ctypes-should-build-with-libffi-multilib-wrapper.patch
b/00184-ctypes-should-build-with-libffi-multilib-wrapper.patch
deleted file mode 100644
index 53d9dae..0000000
--- a/00184-ctypes-should-build-with-libffi-multilib-wrapper.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- Python-3.3.2/setup.py.orig 2013-07-01 15:23:24.377711044 +0200
-+++ Python-3.3.2/setup.py 2013-07-01 15:23:34.094676496 +0200
-@@ -1882,7 +1882,8 @@
- if not line:
- ffi_inc = None
- break
-- if line.startswith('#define LIBFFI_H'):
-+ if line.startswith('#define LIBFFI_H') or \
-+ line.startswith('#define ffi_wrapper_h'):
- break
- ffi_lib = None
- if ffi_inc is not None:
diff --git a/00191-disable-NOOP.patch b/00191-disable-NOOP.patch
index fbe9474..2d4189a 100644
--- a/00191-disable-NOOP.patch
+++ b/00191-disable-NOOP.patch
@@ -1,12 +1,12 @@
diff --git a/Lib/test/test_smtplib.py b/Lib/test/test_smtplib.py
-index 81806c9..e7881b9 100644
+index 1bb6690..28ed25d 100644
--- a/Lib/test/test_smtplib.py
+++ b/Lib/test/test_smtplib.py
@@ -182,6 +182,7 @@ class DebuggingServerTests(unittest.TestCase):
- smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost',
timeout=3)
+ smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost',
timeout=15)
smtp.quit()
+ @unittest._skipInRpmBuild("Does not work in network-free environment")
def testNOOP(self):
- smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost',
timeout=3)
+ smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost',
timeout=15)
expected = (250, 'Ok')
diff --git a/00200-skip-thread-test.patch b/00200-skip-thread-test.patch
deleted file mode 100644
index 90536d1..0000000
--- a/00200-skip-thread-test.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -up Python-2.7.11/Lib/test/test_gdb.py.old Python-2.7.11/Lib/test/test_gdb.py
---- Python-2.7.11/Lib/test/test_gdb.py.old 2015-12-24 19:12:46.167487914 +0100
-+++ Python-2.7.11/Lib/test/test_gdb.py 2015-12-24 19:13:48.833057910 +0100
-@@ -801,6 +801,7 @@ Traceback \(most recent call first\):
- foo\(1, 2, 3\)
- ''')
-
-+ @unittest._skipInRpmBuild('this test fail within rpmbuild')
- @unittest.skipUnless(thread,
- "Python was compiled without thread support")
- def test_threads(self):
diff --git a/00209-fix-test-pyexpat-failure.patch b/00209-fix-test-pyexpat-failure.patch
deleted file mode 100644
index f14a19b..0000000
--- a/00209-fix-test-pyexpat-failure.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-diff --git a/Lib/test/test_pyexpat.py b/Lib/test/test_pyexpat.py
-index eba9058..2c8a164 100644
---- a/Lib/test/test_pyexpat.py
-+++ b/Lib/test/test_pyexpat.py
-@@ -610,11 +610,9 @@ class MalformedInputText(unittest.TestCase):
- def test2(self):
- xml = "<?xml version\xc2\x85='1.0'?>\r\n"
- parser = expat.ParserCreate()
-- try:
-+ err_pattern = r'XML declaration not well-formed: line 1, column \d+'
-+ with self.assertRaisesRegexp(expat.ExpatError, err_pattern):
- parser.Parse(xml, True)
-- self.fail()
-- except expat.ExpatError as e:
-- self.assertEqual(str(e), 'XML declaration not well-formed: line 1,
column 14')
-
- class ForeignDTDTests(unittest.TestCase):
- """
diff --git a/00242-CVE-2016-1000110-httpoxy.patch b/00242-CVE-2016-1000110-httpoxy.patch
deleted file mode 100644
index d644e8c..0000000
--- a/00242-CVE-2016-1000110-httpoxy.patch
+++ /dev/null
@@ -1,111 +0,0 @@
-
-# HG changeset patch
-# User Senthil Kumaran <senthil(a)uthcode.com>
-# Date 1469882993 25200
-# Node ID ba915d561667fa0584ad89f8d5a844fd43803c0d
-# Parent c8c1ea94379a7706638f1571988576d504d7fc98
-Prevent HTTPoxy attack (CVE-2016-1000110)
-
-Ignore the HTTP_PROXY variable when REQUEST_METHOD environment is set, which
-indicates that the script is in CGI mode.
-
-Issue reported and patch contributed by Rmi Rampin.
-
-diff --git a/Doc/howto/urllib2.rst b/Doc/howto/urllib2.rst
---- a/Doc/howto/urllib2.rst
-+++ b/Doc/howto/urllib2.rst
-@@ -525,6 +525,11 @@ setting up a `Basic Authentication`_ han
- through a proxy. However, this can be enabled by extending urllib2 as
- shown in the recipe [#]_.
-
-+.. note::
-+
-+ ``HTTP_PROXY`` will be ignored if a variable ``REQUEST_METHOD`` is set; see
-+ the documentation on :func:`~urllib.getproxies`.
-+
-
- Sockets and Layers
- ==================
-diff --git a/Doc/library/urllib.rst b/Doc/library/urllib.rst
---- a/Doc/library/urllib.rst
-+++ b/Doc/library/urllib.rst
-@@ -295,6 +295,16 @@ Utility functions
- If both lowercase and uppercase environment variables exist (and disagree),
- lowercase is preferred.
-
-+ .. note::
-+
-+ If the environment variable ``REQUEST_METHOD`` is set, which usually
-+ indicates your script is running in a CGI environment, the environment
-+ variable ``HTTP_PROXY`` (uppercase ``_PROXY``) will be ignored. This is
-+ because that variable can be injected by a client using the "Proxy:"
-+ HTTP header. If you need to use an HTTP proxy in a CGI environment,
-+ either use ``ProxyHandler`` explicitly, or make sure the variable name
-+ is in lowercase (or at least the ``_proxy`` suffix).
-+
- .. note::
- urllib also exposes certain utility functions like splittype, splithost and
- others parsing URL into various components. But it is recommended to use
-diff --git a/Doc/library/urllib2.rst b/Doc/library/urllib2.rst
---- a/Doc/library/urllib2.rst
-+++ b/Doc/library/urllib2.rst
-@@ -229,6 +229,11 @@ The following classes are provided:
-
- To disable autodetected proxy pass an empty dictionary.
-
-+ .. note::
-+
-+ ``HTTP_PROXY`` will be ignored if a variable ``REQUEST_METHOD`` is set;
-+ see the documentation on :func:`~urllib.getproxies`.
-+
-
- .. class:: HTTPPasswordMgr()
-
-diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py
---- a/Lib/test/test_urllib.py
-+++ b/Lib/test/test_urllib.py
-@@ -170,6 +170,18 @@ class ProxyTests(unittest.TestCase):
-
self.assertTrue(urllib.proxy_bypass_environment('anotherdomain.com:8888'))
- self.assertTrue(urllib.proxy_bypass_environment('newdomain.com:1234'))
-
-+ def test_proxy_cgi_ignore(self):
-+ try:
-+ self.env.set('HTTP_PROXY', 'http://somewhere:3128')
-+ proxies = urllib.getproxies_environment()
-+ self.assertEqual('http://somewhere:3128', proxies['http'])
-+ self.env.set('REQUEST_METHOD', 'GET')
-+ proxies = urllib.getproxies_environment()
-+ self.assertNotIn('http', proxies)
-+ finally:
-+ self.env.unset('REQUEST_METHOD')
-+ self.env.unset('HTTP_PROXY')
-+
- def test_proxy_bypass_environment_host_match(self):
- bypass = urllib.proxy_bypass_environment
- self.env.set('NO_PROXY',
-diff --git a/Lib/urllib.py b/Lib/urllib.py
---- a/Lib/urllib.py
-+++ b/Lib/urllib.py
-@@ -1380,12 +1380,21 @@ def getproxies_environment():
- If you need a different way, you can pass a proxies dictionary to the
- [Fancy]URLopener constructor.
- """
-+ # Get all variables
- proxies = {}
- for name, value in os.environ.items():
- name = name.lower()
- if value and name[-6:] == '_proxy':
- proxies[name[:-6]] = value
-
-+ # CVE-2016-1000110 - If we are running as CGI script, forget HTTP_PROXY
-+ # (non-all-lowercase) as it may be set from the web server by a "Proxy:"
-+ # header from the client
-+ # If "proxy" is lowercase, it will still be used thanks to the next block
-+ if 'REQUEST_METHOD' in os.environ:
-+ proxies.pop('http', None)
-+
-+ # Get lowercase variables
- for name, value in os.environ.items():
- if name[-6:] == '_proxy':
- name = name.lower()
-
diff --git a/00247-port-ssl-and-hashlib-to-OpenSSL-1.1.0.patch
b/00247-port-ssl-and-hashlib-to-OpenSSL-1.1.0.patch
deleted file mode 100644
index 4ac606a..0000000
--- a/00247-port-ssl-and-hashlib-to-OpenSSL-1.1.0.patch
+++ /dev/null
@@ -1,1088 +0,0 @@
-
-# HG changeset patch
-# User Christian Heimes <christian(a)python.org>
-# Date 1473111433 -7200
-# Node ID 14b611ddaabe404c8cae84c35f553f50e3a068c9
-# Parent 4c91651912d1b3dbedcd8404c61f9e2a4094af93
-Issue #26470: Port ssl and hashlib module to OpenSSL 1.1.0.
-
-diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst
---- a/Doc/library/ssl.rst
-+++ b/Doc/library/ssl.rst
-@@ -322,6 +322,16 @@ purposes.
- Random generation
- ^^^^^^^^^^^^^^^^^
-
-+ .. deprecated::
-+
-+ 2.7.13 OpenSSL has deprecated :func:`ssl.RAND_pseudo_bytes`, use
-+ :func:`ssl.RAND_bytes` instead.
-+
-+ .. deprecated::
-+
-+ 2.7.13 OpenSSL has deprecated :func:`ssl.RAND_pseudo_bytes`, use
-+ :func:`ssl.RAND_bytes` instead.
-+
- .. function:: RAND_status()
-
- Return ``True`` if the SSL pseudo-random number generator has been seeded
-@@ -340,7 +350,7 @@ Random generation
- See
http://egd.sourceforge.net/ or
http://prngd.sourceforge.net/ for sources
- of entropy-gathering daemons.
-
-- Availability: not available with LibreSSL.
-+ Availability: not available with LibreSSL and OpenSSL > 1.1.0
-
- .. function:: RAND_add(bytes, entropy)
-
-@@ -444,6 +454,9 @@ Certificate handling
- * :attr:`openssl_capath_env` - OpenSSL's environment key that points to a
capath,
- * :attr:`openssl_capath` - hard coded path to a capath directory
-
-+ Availability: LibreSSL ignores the environment vars
-+ :attr:`openssl_cafile_env` and :attr:`openssl_capath_env`
-+
- .. versionadded:: 2.7.9
-
- .. function:: enum_certificates(store_name)
-@@ -561,11 +574,19 @@ Constants
-
- .. versionadded:: 2.7.10
-
--.. data:: PROTOCOL_SSLv23
-+.. data:: PROTOCOL_TLS
-
- Selects the highest protocol version that both the client and server support.
- Despite the name, this option can select "TLS" protocols as well as
"SSL".
-
-+ .. versionadded:: 2.7.13
-+
-+.. data:: PROTOCOL_SSLv23
-+
-+ Alias for ``PROTOCOL_TLS``.
-+
-+ .. deprecated:: 2.7.13 Use ``PROTOCOL_TLS`` instead.
-+
- .. data:: PROTOCOL_SSLv2
-
- Selects SSL version 2 as the channel encryption protocol.
-@@ -577,6 +598,8 @@ Constants
-
- SSL version 2 is insecure. Its use is highly discouraged.
-
-+ .. deprecated:: 2.7.13 OpenSSL has removed support for SSLv2.
-+
- .. data:: PROTOCOL_SSLv3
-
- Selects SSL version 3 as the channel encryption protocol.
-@@ -588,10 +611,20 @@ Constants
-
- SSL version 3 is insecure. Its use is highly discouraged.
-
-+ .. deprecated:: 2.7.13
-+
-+ OpenSSL has deprecated all version specific protocols. Use the default
-+ protocol with flags like ``OP_NO_SSLv3`` instead.
-+
- .. data:: PROTOCOL_TLSv1
-
- Selects TLS version 1.0 as the channel encryption protocol.
-
-+ .. deprecated:: 2.7.13
-+
-+ OpenSSL has deprecated all version specific protocols. Use the default
-+ protocol with flags like ``OP_NO_SSLv3`` instead.
-+
- .. data:: PROTOCOL_TLSv1_1
-
- Selects TLS version 1.1 as the channel encryption protocol.
-@@ -599,6 +632,11 @@ Constants
-
- .. versionadded:: 2.7.9
-
-+ .. deprecated:: 2.7.13
-+
-+ OpenSSL has deprecated all version specific protocols. Use the default
-+ protocol with flags like ``OP_NO_SSLv3`` instead.
-+
- .. data:: PROTOCOL_TLSv1_2
-
- Selects TLS version 1.2 as the channel encryption protocol. This is the
-@@ -607,6 +645,12 @@ Constants
-
- .. versionadded:: 2.7.9
-
-+ .. deprecated:: 2.7.13
-+
-+ OpenSSL has deprecated all version specific protocols. Use the default
-+ protocol with flags like ``OP_NO_SSLv3`` instead.
-+
-+
- .. data:: OP_ALL
-
- Enables workarounds for various bugs present in other SSL implementations.
-@@ -1112,6 +1156,9 @@ to speed up repeated connections from th
- This method will raise :exc:`NotImplementedError` if :data:`HAS_ALPN` is
- False.
-
-+ OpenSSL 1.1.0+ will abort the handshake and raise :exc:`SSLError` when
-+ both sides support ALPN but cannot agree on a protocol.
-+
- .. versionadded:: 2.7.10
-
- .. method:: SSLContext.set_npn_protocols(protocols)
-diff --git a/Lib/ssl.py b/Lib/ssl.py
---- a/Lib/ssl.py
-+++ b/Lib/ssl.py
-@@ -51,6 +51,7 @@ The following constants identify various
- PROTOCOL_SSLv2
- PROTOCOL_SSLv3
- PROTOCOL_SSLv23
-+PROTOCOL_TLS
- PROTOCOL_TLSv1
- PROTOCOL_TLSv1_1
- PROTOCOL_TLSv1_2
-@@ -126,7 +127,10 @@ from _ssl import HAS_SNI, HAS_ECDH, HAS_
-
- from _ssl import _OPENSSL_API_VERSION
-
--_PROTOCOL_NAMES = {value: name for name, value in globals().items() if
name.startswith('PROTOCOL_')}
-+_PROTOCOL_NAMES = {value: name for name, value in globals().items()
-+ if name.startswith('PROTOCOL_')
-+ and name != 'PROTOCOL_SSLv23'}
-+PROTOCOL_SSLv23 = PROTOCOL_TLS
-
- try:
- _SSLv2_IF_EXISTS = PROTOCOL_SSLv2
-@@ -408,7 +412,7 @@ def create_default_context(purpose=Purpo
- if not isinstance(purpose, _ASN1Object):
- raise TypeError(purpose)
-
-- context = SSLContext(PROTOCOL_SSLv23)
-+ context = SSLContext(PROTOCOL_TLS)
-
- # SSLv2 considered harmful.
- context.options |= OP_NO_SSLv2
-@@ -445,7 +449,7 @@ def create_default_context(purpose=Purpo
- context.load_default_certs(purpose)
- return context
-
--def _create_unverified_context(protocol=PROTOCOL_SSLv23, cert_reqs=None,
-+def _create_unverified_context(protocol=PROTOCOL_TLS, cert_reqs=None,
- check_hostname=False, purpose=Purpose.SERVER_AUTH,
- certfile=None, keyfile=None,
- cafile=None, capath=None, cadata=None):
-@@ -518,7 +522,7 @@ class SSLSocket(socket):
-
- def __init__(self, sock=None, keyfile=None, certfile=None,
- server_side=False, cert_reqs=CERT_NONE,
-- ssl_version=PROTOCOL_SSLv23, ca_certs=None,
-+ ssl_version=PROTOCOL_TLS, ca_certs=None,
- do_handshake_on_connect=True,
- family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None,
- suppress_ragged_eofs=True, npn_protocols=None, ciphers=None,
-@@ -920,7 +924,7 @@ class SSLSocket(socket):
-
- def wrap_socket(sock, keyfile=None, certfile=None,
- server_side=False, cert_reqs=CERT_NONE,
-- ssl_version=PROTOCOL_SSLv23, ca_certs=None,
-+ ssl_version=PROTOCOL_TLS, ca_certs=None,
- do_handshake_on_connect=True,
- suppress_ragged_eofs=True,
- ciphers=None):
-@@ -989,7 +993,7 @@ def PEM_cert_to_DER_cert(pem_cert_string
- d = pem_cert_string.strip()[len(PEM_HEADER):-len(PEM_FOOTER)]
- return base64.decodestring(d.encode('ASCII', 'strict'))
-
--def get_server_certificate(addr, ssl_version=PROTOCOL_SSLv23, ca_certs=None):
-+def get_server_certificate(addr, ssl_version=PROTOCOL_TLS, ca_certs=None):
- """Retrieve the certificate from the server at the specified
address,
- and return it as a PEM-encoded string.
- If 'ca_certs' is specified, validate the server cert against it.
-diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
---- a/Lib/test/test_ssl.py
-+++ b/Lib/test/test_ssl.py
-@@ -26,6 +26,9 @@ ssl = support.import_module("ssl")
-
- PROTOCOLS = sorted(ssl._PROTOCOL_NAMES)
- HOST = support.HOST
-+IS_LIBRESSL = ssl.OPENSSL_VERSION.startswith('LibreSSL')
-+IS_OPENSSL_1_1 = not IS_LIBRESSL and ssl.OPENSSL_VERSION_INFO >= (1, 1, 0)
-+
-
- def data_file(*name):
- return os.path.join(os.path.dirname(__file__), *name)
-@@ -164,7 +167,6 @@ class BasicSocketTests(unittest.TestCase
- self.assertIn(ssl.HAS_SNI, {True, False})
- self.assertIn(ssl.HAS_ECDH, {True, False})
-
--
- def test_random(self):
- v = ssl.RAND_status()
- if support.verbose:
-@@ -281,9 +283,9 @@ class BasicSocketTests(unittest.TestCase
- self.assertGreaterEqual(status, 0)
- self.assertLessEqual(status, 15)
- # Version string as returned by {Open,Libre}SSL, the format might change
-- if "LibreSSL" in s:
-- self.assertTrue(s.startswith("LibreSSL {:d}.{:d}".format(major,
minor)),
-- (s, t))
-+ if IS_LIBRESSL:
-+ self.assertTrue(s.startswith("LibreSSL {:d}".format(major)),
-+ (s, t, hex(n)))
- else:
- self.assertTrue(s.startswith("OpenSSL
{:d}.{:d}.{:d}".format(major, minor, fix)),
- (s, t))
-@@ -742,15 +744,15 @@ class ContextTests(unittest.TestCase):
- def test_options(self):
- ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
- # OP_ALL | OP_NO_SSLv2 | OP_NO_SSLv3 is the default value
-- self.assertEqual(ssl.OP_ALL | ssl.OP_NO_SSLv2 | ssl.OP_NO_SSLv3,
-- ctx.options)
-+ default = (ssl.OP_ALL | ssl.OP_NO_SSLv2 | ssl.OP_NO_SSLv3)
-+ if not IS_LIBRESSL and ssl.OPENSSL_VERSION_INFO >= (1, 1, 0):
-+ default |= ssl.OP_NO_COMPRESSION
-+ self.assertEqual(default, ctx.options)
- ctx.options |= ssl.OP_NO_TLSv1
-- self.assertEqual(ssl.OP_ALL | ssl.OP_NO_SSLv2 | ssl.OP_NO_SSLv3 |
ssl.OP_NO_TLSv1,
-- ctx.options)
-+ self.assertEqual(default | ssl.OP_NO_TLSv1, ctx.options)
- if can_clear_options():
-- ctx.options = (ctx.options & ~ssl.OP_NO_SSLv2) | ssl.OP_NO_TLSv1
-- self.assertEqual(ssl.OP_ALL | ssl.OP_NO_TLSv1 | ssl.OP_NO_SSLv3,
-- ctx.options)
-+ ctx.options = (ctx.options & ~ssl.OP_NO_TLSv1)
-+ self.assertEqual(default, ctx.options)
- ctx.options = 0
- self.assertEqual(0, ctx.options)
- else:
-@@ -1088,6 +1090,7 @@ class ContextTests(unittest.TestCase):
- self.assertRaises(TypeError, ctx.load_default_certs, 'SERVER_AUTH')
-
- @unittest.skipIf(sys.platform == "win32", "not-Windows
specific")
-+ @unittest.skipIf(IS_LIBRESSL, "LibreSSL doesn't support env vars")
- def test_load_default_certs_env(self):
- ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
- with support.EnvironmentVarGuard() as env:
-@@ -1534,7 +1537,6 @@ class NetworkedTests(unittest.TestCase):
- sys.stdout.write("%s\n" % x)
- else:
- self.fail("Got server certificate %s for %s:%s!" % (pem,
host, port))
--
- pem = ssl.get_server_certificate((host, port),
- ca_certs=cert)
- if not pem:
-@@ -2783,7 +2785,7 @@ else:
- with closing(context.wrap_socket(socket.socket())) as s:
- self.assertIs(s.version(), None)
- s.connect((HOST, server.port))
-- self.assertEqual(s.version(), "TLSv1")
-+ self.assertEqual(s.version(), 'TLSv1')
- self.assertIs(s.version(), None)
-
- @unittest.skipUnless(ssl.HAS_ECDH, "test requires ECDH-enabled
OpenSSL")
-@@ -2925,24 +2927,36 @@ else:
- (['http/3.0', 'http/4.0'], None)
- ]
- for client_protocols, expected in protocol_tests:
-- server_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ server_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
- server_context.load_cert_chain(CERTFILE)
- server_context.set_alpn_protocols(server_protocols)
-- client_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ client_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
- client_context.load_cert_chain(CERTFILE)
- client_context.set_alpn_protocols(client_protocols)
-- stats = server_params_test(client_context, server_context,
-- chatty=True, connectionchatty=True)
--
-- msg = "failed trying %s (s) and %s (c).\n" \
-- "was expecting %s, but got %%s from the %%s" \
-- % (str(server_protocols), str(client_protocols),
-- str(expected))
-- client_result = stats['client_alpn_protocol']
-- self.assertEqual(client_result, expected, msg % (client_result,
"client"))
-- server_result = stats['server_alpn_protocols'][-1] \
-- if len(stats['server_alpn_protocols']) else
'nothing'
-- self.assertEqual(server_result, expected, msg % (server_result,
"server"))
-+
-+ try:
-+ stats = server_params_test(client_context,
-+ server_context,
-+ chatty=True,
-+ connectionchatty=True)
-+ except ssl.SSLError as e:
-+ stats = e
-+
-+ if expected is None and IS_OPENSSL_1_1:
-+ # OpenSSL 1.1.0 raises handshake error
-+ self.assertIsInstance(stats, ssl.SSLError)
-+ else:
-+ msg = "failed trying %s (s) and %s (c).\n" \
-+ "was expecting %s, but got %%s from the %%s" \
-+ % (str(server_protocols), str(client_protocols),
-+ str(expected))
-+ client_result = stats['client_alpn_protocol']
-+ self.assertEqual(client_result, expected,
-+ msg % (client_result, "client"))
-+ server_result = stats['server_alpn_protocols'][-1] \
-+ if len(stats['server_alpn_protocols']) else
'nothing'
-+ self.assertEqual(server_result, expected,
-+ msg % (server_result, "server"))
-
- def test_selected_npn_protocol(self):
- # selected_npn_protocol() is None unless NPN is used
-
---- a/Modules/_hashopenssl.c
-+++ b/Modules/_hashopenssl.c
-@@ -37,8 +37,10 @@
-
- /* EVP is the preferred interface to hashing in OpenSSL */
- #include <openssl/evp.h>
--#include <openssl/hmac.h>
- #include <openssl/err.h>
-+/* We use the object interface to discover what hashes OpenSSL supports. */
-+#include <openssl/objects.h>
-+#include "openssl/err.h"
-
- #define MUNCH_SIZE INT_MAX
-
-@@ -50,15 +52,26 @@
- #define HASH_OBJ_CONSTRUCTOR 0
- #endif
-
--/* Minimum OpenSSL version needed to support sha224 and higher. */
- #if defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >=
0x00908000)
- #define _OPENSSL_SUPPORTS_SHA2
- #endif
-
-+#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
-+/* OpenSSL < 1.1.0 */
-+#define EVP_MD_CTX_new EVP_MD_CTX_create
-+#define EVP_MD_CTX_free EVP_MD_CTX_destroy
-+#define HAS_FAST_PKCS5_PBKDF2_HMAC 0
-+#include <openssl/hmac.h>
-+#else
-+/* OpenSSL >= 1.1.0 */
-+#define HAS_FAST_PKCS5_PBKDF2_HMAC 1
-+#endif
-+
-+
- typedef struct {
- PyObject_HEAD
- PyObject *name; /* name of this hash algorithm */
-- EVP_MD_CTX ctx; /* OpenSSL message digest context */
-+ EVP_MD_CTX *ctx; /* OpenSSL message digest context */
- #ifdef WITH_THREAD
- PyThread_type_lock lock; /* OpenSSL context lock */
- #endif
-@@ -70,7 +83,6 @@ static PyTypeObject EVPtype;
-
- #define DEFINE_CONSTS_FOR_NEW(Name) \
- static PyObject *CONST_ ## Name ## _name_obj = NULL; \
-- static EVP_MD_CTX CONST_new_ ## Name ## _ctx; \
- static EVP_MD_CTX *CONST_new_ ## Name ## _ctx_p = NULL;
-
- DEFINE_CONSTS_FOR_NEW(md5)
-@@ -83,19 +95,56 @@ DEFINE_CONSTS_FOR_NEW(sha512)
- #endif
-
-
-+/* LCOV_EXCL_START */
-+static PyObject *
-+_setException(PyObject *exc)
-+{
-+ unsigned long errcode;
-+ const char *lib, *func, *reason;
-+
-+ errcode = ERR_peek_last_error();
-+ if (!errcode) {
-+ PyErr_SetString(exc, "unknown reasons");
-+ return NULL;
-+ }
-+ ERR_clear_error();
-+
-+ lib = ERR_lib_error_string(errcode);
-+ func = ERR_func_error_string(errcode);
-+ reason = ERR_reason_error_string(errcode);
-+
-+ if (lib && func) {
-+ PyErr_Format(exc, "[%s: %s] %s", lib, func, reason);
-+ }
-+ else if (lib) {
-+ PyErr_Format(exc, "[%s] %s", lib, reason);
-+ }
-+ else {
-+ PyErr_SetString(exc, reason);
-+ }
-+ return NULL;
-+}
-+/* LCOV_EXCL_STOP */
-+
- static EVPobject *
- newEVPobject(PyObject *name)
- {
- EVPobject *retval = (EVPobject *)PyObject_New(EVPobject, &EVPtype);
-+ if (retval == NULL)
-+ return NULL;
-+
-+ retval->ctx = EVP_MD_CTX_new();
-+ if (retval->ctx == NULL) {
-+ PyErr_NoMemory();
-+ return NULL;
-+ }
-
- /* save the name for .name to return */
-- if (retval != NULL) {
-- Py_INCREF(name);
-- retval->name = name;
-+ Py_INCREF(name);
-+ retval->name = name;
- #ifdef WITH_THREAD
-- retval->lock = NULL;
-+ retval->lock = NULL;
- #endif
-- }
-
- return retval;
- }
-@@ -111,7 +160,7 @@ EVP_hash(EVPobject *self, const void *vp
- process = MUNCH_SIZE;
- else
- process = Py_SAFE_DOWNCAST(len, Py_ssize_t, unsigned int);
-- EVP_DigestUpdate(&self->ctx, (const void*)cp, process);
-+ EVP_DigestUpdate(self->ctx, (const void*)cp, process);
- len -= process;
- cp += process;
- }
-@@ -126,16 +175,20 @@ EVP_dealloc(EVPobject *self)
- if (self->lock != NULL)
- PyThread_free_lock(self->lock);
- #endif
-- EVP_MD_CTX_cleanup(&self->ctx);
-+ EVP_MD_CTX_free(self->ctx);
- Py_XDECREF(self->name);
- PyObject_Del(self);
- }
-
--static void locked_EVP_MD_CTX_copy(EVP_MD_CTX *new_ctx_p, EVPobject *self)
-+static int
-+locked_EVP_MD_CTX_copy(EVP_MD_CTX *new_ctx_p, EVPobject *self)
- {
-+ int result;
- ENTER_HASHLIB(self);
-- EVP_MD_CTX_copy(new_ctx_p, &self->ctx);
-+ /* XXX no error reporting */
-+ result = EVP_MD_CTX_copy(new_ctx_p, self->ctx);
- LEAVE_HASHLIB(self);
-+ return result;
- }
-
- /* External methods for a hash object */
-@@ -151,7 +204,9 @@ EVP_copy(EVPobject *self, PyObject *unus
- if ( (newobj = newEVPobject(self->name))==NULL)
- return NULL;
-
-- locked_EVP_MD_CTX_copy(&newobj->ctx, self);
-+ if (!locked_EVP_MD_CTX_copy(newobj->ctx, self)) {
-+ return _setException(PyExc_ValueError);
-+ }
- return (PyObject *)newobj;
- }
-
-@@ -162,16 +217,24 @@ static PyObject *
- EVP_digest(EVPobject *self, PyObject *unused)
- {
- unsigned char digest[EVP_MAX_MD_SIZE];
-- EVP_MD_CTX temp_ctx;
-+ EVP_MD_CTX *temp_ctx;
- PyObject *retval;
- unsigned int digest_size;
-
-- locked_EVP_MD_CTX_copy(&temp_ctx, self);
-- digest_size = EVP_MD_CTX_size(&temp_ctx);
-- EVP_DigestFinal(&temp_ctx, digest, NULL);
-+ temp_ctx = EVP_MD_CTX_new();
-+ if (temp_ctx == NULL) {
-+ PyErr_NoMemory();
-+ return NULL;
-+ }
-+
-+ if (!locked_EVP_MD_CTX_copy(temp_ctx, self)) {
-+ return _setException(PyExc_ValueError);
-+ }
-+ digest_size = EVP_MD_CTX_size(temp_ctx);
-+ EVP_DigestFinal(temp_ctx, digest, NULL);
-
- retval = PyString_FromStringAndSize((const char *)digest, digest_size);
-- EVP_MD_CTX_cleanup(&temp_ctx);
-+ EVP_MD_CTX_free(temp_ctx);
- return retval;
- }
-
-@@ -182,17 +245,25 @@ static PyObject *
- EVP_hexdigest(EVPobject *self, PyObject *unused)
- {
- unsigned char digest[EVP_MAX_MD_SIZE];
-- EVP_MD_CTX temp_ctx;
-+ EVP_MD_CTX *temp_ctx;
- PyObject *retval;
- char *hex_digest;
- unsigned int i, j, digest_size;
-
-+ temp_ctx = EVP_MD_CTX_new();
-+ if (temp_ctx == NULL) {
-+ PyErr_NoMemory();
-+ return NULL;
-+ }
-+
- /* Get the raw (binary) digest value */
-- locked_EVP_MD_CTX_copy(&temp_ctx, self);
-- digest_size = EVP_MD_CTX_size(&temp_ctx);
-- EVP_DigestFinal(&temp_ctx, digest, NULL);
-+ if (!locked_EVP_MD_CTX_copy(temp_ctx, self)) {
-+ return _setException(PyExc_ValueError);
-+ }
-+ digest_size = EVP_MD_CTX_size(temp_ctx);
-+ EVP_DigestFinal(temp_ctx, digest, NULL);
-
-- EVP_MD_CTX_cleanup(&temp_ctx);
-+ EVP_MD_CTX_free(temp_ctx);
-
- /* Create a new string */
- /* NOTE: not thread safe! modifying an already created string object */
-@@ -266,7 +337,7 @@ static PyObject *
- EVP_get_block_size(EVPobject *self, void *closure)
- {
- long block_size;
-- block_size = EVP_MD_CTX_block_size(&self->ctx);
-+ block_size = EVP_MD_CTX_block_size(self->ctx);
- return PyLong_FromLong(block_size);
- }
-
-@@ -274,7 +345,7 @@ static PyObject *
- EVP_get_digest_size(EVPobject *self, void *closure)
- {
- long size;
-- size = EVP_MD_CTX_size(&self->ctx);
-+ size = EVP_MD_CTX_size(self->ctx);
- return PyLong_FromLong(size);
- }
-
-@@ -338,7 +409,7 @@ EVP_tp_init(EVPobject *self, PyObject *a
- PyBuffer_Release(&view);
- return -1;
- }
-- EVP_DigestInit(&self->ctx, digest);
-+ EVP_DigestInit(self->ctx, digest);
-
- self->name = name_obj;
- Py_INCREF(self->name);
-@@ -435,9 +506,9 @@ EVPnew(PyObject *name_obj,
- return NULL;
-
- if (initial_ctx) {
-- EVP_MD_CTX_copy(&self->ctx, initial_ctx);
-+ EVP_MD_CTX_copy(self->ctx, initial_ctx);
- } else {
-- EVP_DigestInit(&self->ctx, digest);
-+ EVP_DigestInit(self->ctx, digest);
- }
-
- if (cp && len) {
-@@ -499,6 +570,7 @@ EVP_new(PyObject *self, PyObject *args,
-
- #define PY_PBKDF2_HMAC 1
-
-+#if !HAS_FAST_PKCS5_PBKDF2_HMAC
- /* Improved implementation of PKCS5_PBKDF2_HMAC()
- *
- * PKCS5_PBKDF2_HMAC_fast() hashes the password exactly one time instead of
-@@ -580,37 +652,8 @@ PKCS5_PBKDF2_HMAC_fast(const char *pass,
- HMAC_CTX_cleanup(&hctx_tpl);
- return 1;
- }
-+#endif
-
--/* LCOV_EXCL_START */
--static PyObject *
--_setException(PyObject *exc)
--{
-- unsigned long errcode;
-- const char *lib, *func, *reason;
--
-- errcode = ERR_peek_last_error();
-- if (!errcode) {
-- PyErr_SetString(exc, "unknown reasons");
-- return NULL;
-- }
-- ERR_clear_error();
--
-- lib = ERR_lib_error_string(errcode);
-- func = ERR_func_error_string(errcode);
-- reason = ERR_reason_error_string(errcode);
--
-- if (lib && func) {
-- PyErr_Format(exc, "[%s: %s] %s", lib, func, reason);
-- }
-- else if (lib) {
-- PyErr_Format(exc, "[%s] %s", lib, reason);
-- }
-- else {
-- PyErr_SetString(exc, reason);
-- }
-- return NULL;
--}
--/* LCOV_EXCL_STOP */
-
- PyDoc_STRVAR(pbkdf2_hmac__doc__,
- "pbkdf2_hmac(hash_name, password, salt, iterations, dklen=None) -> key\n\
-@@ -692,10 +735,17 @@ pbkdf2_hmac(PyObject *self, PyObject *ar
- key = PyBytes_AS_STRING(key_obj);
-
- Py_BEGIN_ALLOW_THREADS
-+#if HAS_FAST_PKCS5_PBKDF2_HMAC
-+ retval = PKCS5_PBKDF2_HMAC((char*)password.buf, (int)password.len,
-+ (unsigned char *)salt.buf, (int)salt.len,
-+ iterations, digest, dklen,
-+ (unsigned char *)key);
-+#else
- retval = PKCS5_PBKDF2_HMAC_fast((char*)password.buf, (int)password.len,
- (unsigned char *)salt.buf, (int)salt.len,
- iterations, digest, dklen,
- (unsigned char *)key);
-+#endif
- Py_END_ALLOW_THREADS
-
- if (!retval) {
-@@ -807,7 +857,7 @@ generate_hash_name_list(void)
- if (CONST_ ## NAME ## _name_obj == NULL) { \
- CONST_ ## NAME ## _name_obj = PyString_FromString(#NAME); \
- if (EVP_get_digestbyname(#NAME)) { \
-- CONST_new_ ## NAME ## _ctx_p = &CONST_new_ ## NAME ## _ctx; \
-+ CONST_new_ ## NAME ## _ctx_p = EVP_MD_CTX_new(); \
- EVP_DigestInit(CONST_new_ ## NAME ## _ctx_p, EVP_get_digestbyname(#NAME));
\
- } \
- } \
-diff --git a/Modules/_ssl.c b/Modules/_ssl.c
---- a/Modules/_ssl.c
-+++ b/Modules/_ssl.c
-@@ -52,6 +52,14 @@
- #include <sys/poll.h>
- #endif
-
-+/* Don't warn about deprecated functions */
-+#ifdef __GNUC__
-+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-+#endif
-+#ifdef __clang__
-+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-+#endif
-+
- /* Include OpenSSL header files */
- #include "openssl/rsa.h"
- #include "openssl/crypto.h"
-@@ -87,6 +95,10 @@ struct py_ssl_library_code {
- /* Include generated data (error codes) */
- #include "_ssl_data.h"
-
-+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) &&
!defined(LIBRESSL_VERSION_NUMBER)
-+# define OPENSSL_VERSION_1_1 1
-+#endif
-+
- /* Openssl comes with TLSv1.1 and TLSv1.2 between 1.0.0h and 1.0.1
-
http://www.openssl.org/news/changelog.html
- */
-@@ -110,6 +122,70 @@ struct py_ssl_library_code {
- # define HAVE_ALPN
- #endif
-
-+#ifndef INVALID_SOCKET /* MS defines this */
-+#define INVALID_SOCKET (-1)
-+#endif
-+
-+#ifdef OPENSSL_VERSION_1_1
-+/* OpenSSL 1.1.0+ */
-+#ifndef OPENSSL_NO_SSL2
-+#define OPENSSL_NO_SSL2
-+#endif
-+#else /* OpenSSL < 1.1.0 */
-+#if defined(WITH_THREAD)
-+#define HAVE_OPENSSL_CRYPTO_LOCK
-+#endif
-+
-+#define TLS_method SSLv23_method
-+
-+static int X509_NAME_ENTRY_set(const X509_NAME_ENTRY *ne)
-+{
-+ return ne->set;
-+}
-+
-+#ifndef OPENSSL_NO_COMP
-+static int COMP_get_type(const COMP_METHOD *meth)
-+{
-+ return meth->type;
-+}
-+
-+static const char *COMP_get_name(const COMP_METHOD *meth)
-+{
-+ return meth->name;
-+}
-+#endif
-+
-+static pem_password_cb *SSL_CTX_get_default_passwd_cb(SSL_CTX *ctx)
-+{
-+ return ctx->default_passwd_callback;
-+}
-+
-+static void *SSL_CTX_get_default_passwd_cb_userdata(SSL_CTX *ctx)
-+{
-+ return ctx->default_passwd_callback_userdata;
-+}
-+
-+static int X509_OBJECT_get_type(X509_OBJECT *x)
-+{
-+ return x->type;
-+}
-+
-+static X509 *X509_OBJECT_get0_X509(X509_OBJECT *x)
-+{
-+ return x->data.x509;
-+}
-+
-+static STACK_OF(X509_OBJECT) *X509_STORE_get0_objects(X509_STORE *store) {
-+ return store->objs;
-+}
-+
-+static X509_VERIFY_PARAM *X509_STORE_get0_param(X509_STORE *store)
-+{
-+ return store->param;
-+}
-+#endif /* OpenSSL < 1.1.0 or LibreSSL */
-+
-+
- enum py_ssl_error {
- /* these mirror ssl.h */
- PY_SSL_ERROR_NONE,
-@@ -140,7 +216,7 @@ enum py_ssl_cert_requirements {
- enum py_ssl_version {
- PY_SSL_VERSION_SSL2,
- PY_SSL_VERSION_SSL3=1,
-- PY_SSL_VERSION_SSL23,
-+ PY_SSL_VERSION_TLS,
- #if HAVE_TLSv1_2
- PY_SSL_VERSION_TLS1,
- PY_SSL_VERSION_TLS1_1,
-@@ -681,7 +757,7 @@ static PyObject *
-
- /* check to see if we've gotten to a new RDN */
- if (rdn_level >= 0) {
-- if (rdn_level != entry->set) {
-+ if (rdn_level != X509_NAME_ENTRY_set(entry)) {
- /* yes, new RDN */
- /* add old RDN to DN */
- rdnt = PyList_AsTuple(rdn);
-@@ -698,7 +774,7 @@ static PyObject *
- goto fail0;
- }
- }
-- rdn_level = entry->set;
-+ rdn_level = X509_NAME_ENTRY_set(entry);
-
- /* now add this attribute to the current RDN */
- name = X509_NAME_ENTRY_get_object(entry);
-@@ -801,18 +877,18 @@ static PyObject *
- goto fail;
- }
-
-- p = ext->value->data;
-+ p = X509_EXTENSION_get_data(ext)->data;
- if (method->it)
- names = (GENERAL_NAMES*)
- (ASN1_item_d2i(NULL,
- &p,
-- ext->value->length,
-+ X509_EXTENSION_get_data(ext)->length,
- ASN1_ITEM_ptr(method->it)));
- else
- names = (GENERAL_NAMES*)
- (method->d2i(NULL,
- &p,
-- ext->value->length));
-+ X509_EXTENSION_get_data(ext)->length));
-
- for(j = 0; j < sk_GENERAL_NAME_num(names); j++) {
- /* get a rendering of each name in the set of names */
-@@ -1021,13 +1097,11 @@ static PyObject *
- int i, j;
- PyObject *lst, *res = NULL;
-
--#if OPENSSL_VERSION_NUMBER < 0x10001000L
-- dps = X509_get_ext_d2i(certificate, NID_crl_distribution_points, NULL, NULL);
--#else
-+#if OPENSSL_VERSION_NUMBER >= 0x10001000L
- /* Calls x509v3_cache_extensions and sets up crldp */
- X509_check_ca(certificate);
-- dps = certificate->crldp;
- #endif
-+ dps = X509_get_ext_d2i(certificate, NID_crl_distribution_points, NULL, NULL);
-
- if (dps == NULL)
- return Py_None;
-@@ -1443,9 +1517,9 @@ static PyObject *PySSL_compression(PySSL
- if (self->ssl == NULL)
- Py_RETURN_NONE;
- comp_method = SSL_get_current_compression(self->ssl);
-- if (comp_method == NULL || comp_method->type == NID_undef)
-+ if (comp_method == NULL || COMP_get_type(comp_method) == NID_undef)
- Py_RETURN_NONE;
-- short_name = OBJ_nid2sn(comp_method->type);
-+ short_name = COMP_get_name(comp_method);
- if (short_name == NULL)
- Py_RETURN_NONE;
- return PyBytes_FromString(short_name);
-@@ -1994,7 +2068,7 @@ context_new(PyTypeObject *type, PyObject
- {
- char *kwlist[] = {"protocol", NULL};
- PySSLContext *self;
-- int proto_version = PY_SSL_VERSION_SSL23;
-+ int proto_version = PY_SSL_VERSION_TLS;
- long options;
- SSL_CTX *ctx = NULL;
-
-@@ -2020,8 +2094,8 @@ context_new(PyTypeObject *type, PyObject
- else if (proto_version == PY_SSL_VERSION_SSL2)
- ctx = SSL_CTX_new(SSLv2_method());
- #endif
-- else if (proto_version == PY_SSL_VERSION_SSL23)
-- ctx = SSL_CTX_new(SSLv23_method());
-+ else if (proto_version == PY_SSL_VERSION_TLS)
-+ ctx = SSL_CTX_new(TLS_method());
- else
- proto_version = -1;
- PySSL_END_ALLOW_THREADS
-@@ -2067,8 +2141,9 @@ context_new(PyTypeObject *type, PyObject
- #ifndef OPENSSL_NO_ECDH
- /* Allow automatic ECDH curve selection (on OpenSSL 1.0.2+), or use
- prime256v1 by default. This is Apache mod_ssl's initialization
-- policy, so we should be safe. */
--#if defined(SSL_CTX_set_ecdh_auto)
-+ policy, so we should be safe. OpenSSL 1.1 has it enabled by default.
-+ */
-+#if defined(SSL_CTX_set_ecdh_auto) && !defined(OPENSSL_VERSION_1_1)
- SSL_CTX_set_ecdh_auto(self->ctx, 1);
- #else
- {
-@@ -2336,10 +2411,12 @@ static PyObject *
- get_verify_flags(PySSLContext *self, void *c)
- {
- X509_STORE *store;
-+ X509_VERIFY_PARAM *param;
- unsigned long flags;
-
- store = SSL_CTX_get_cert_store(self->ctx);
-- flags = X509_VERIFY_PARAM_get_flags(store->param);
-+ param = X509_STORE_get0_param(store);
-+ flags = X509_VERIFY_PARAM_get_flags(param);
- return PyLong_FromUnsignedLong(flags);
- }
-
-@@ -2347,22 +2424,24 @@ static int
- set_verify_flags(PySSLContext *self, PyObject *arg, void *c)
- {
- X509_STORE *store;
-+ X509_VERIFY_PARAM *param;
- unsigned long new_flags, flags, set, clear;
-
- if (!PyArg_Parse(arg, "k", &new_flags))
- return -1;
- store = SSL_CTX_get_cert_store(self->ctx);
-- flags = X509_VERIFY_PARAM_get_flags(store->param);
-+ param = X509_STORE_get0_param(store);
-+ flags = X509_VERIFY_PARAM_get_flags(param);
- clear = flags & ~new_flags;
- set = ~flags & new_flags;
- if (clear) {
-- if (!X509_VERIFY_PARAM_clear_flags(store->param, clear)) {
-+ if (!X509_VERIFY_PARAM_clear_flags(param, clear)) {
- _setSSLError(NULL, 0, __FILE__, __LINE__);
- return -1;
- }
- }
- if (set) {
-- if (!X509_VERIFY_PARAM_set_flags(store->param, set)) {
-+ if (!X509_VERIFY_PARAM_set_flags(param, set)) {
- _setSSLError(NULL, 0, __FILE__, __LINE__);
- return -1;
- }
-@@ -2537,8 +2616,8 @@ load_cert_chain(PySSLContext *self, PyOb
- char *kwlist[] = {"certfile", "keyfile", "password",
NULL};
- PyObject *keyfile = NULL, *keyfile_bytes = NULL, *password = NULL;
- char *certfile_bytes = NULL;
-- pem_password_cb *orig_passwd_cb = self->ctx->default_passwd_callback;
-- void *orig_passwd_userdata = self->ctx->default_passwd_callback_userdata;
-+ pem_password_cb *orig_passwd_cb = SSL_CTX_get_default_passwd_cb(self->ctx);
-+ void *orig_passwd_userdata = SSL_CTX_get_default_passwd_cb_userdata(self->ctx);
- _PySSLPasswordInfo pw_info = { NULL, NULL, NULL, 0, 0 };
- int r;
-
-@@ -2674,8 +2753,9 @@ static int
- cert = d2i_X509_bio(biobuf, NULL);
- } else {
- cert = PEM_read_bio_X509(biobuf, NULL,
-- self->ctx->default_passwd_callback,
--
self->ctx->default_passwd_callback_userdata);
-+ SSL_CTX_get_default_passwd_cb(self->ctx),
-+
SSL_CTX_get_default_passwd_cb_userdata(self->ctx)
-+ );
- }
- if (cert == NULL) {
- break;
-@@ -3160,25 +3240,24 @@ static PyObject *
- cert_store_stats(PySSLContext *self)
- {
- X509_STORE *store;
-+ STACK_OF(X509_OBJECT) *objs;
- X509_OBJECT *obj;
-- int x509 = 0, crl = 0, pkey = 0, ca = 0, i;
-+ int x509 = 0, crl = 0, ca = 0, i;
-
- store = SSL_CTX_get_cert_store(self->ctx);
-- for (i = 0; i < sk_X509_OBJECT_num(store->objs); i++) {
-- obj = sk_X509_OBJECT_value(store->objs, i);
-- switch (obj->type) {
-+ objs = X509_STORE_get0_objects(store);
-+ for (i = 0; i < sk_X509_OBJECT_num(objs); i++) {
-+ obj = sk_X509_OBJECT_value(objs, i);
-+ switch (X509_OBJECT_get_type(obj)) {
- case X509_LU_X509:
- x509++;
-- if (X509_check_ca(obj->data.x509)) {
-+ if (X509_check_ca(X509_OBJECT_get0_X509(obj))) {
- ca++;
- }
- break;
- case X509_LU_CRL:
- crl++;
- break;
-- case X509_LU_PKEY:
-- pkey++;
-- break;
- default:
- /* Ignore X509_LU_FAIL, X509_LU_RETRY, X509_LU_PKEY.
- * As far as I can tell they are internal states and never
-@@ -3204,6 +3283,7 @@ get_ca_certs(PySSLContext *self, PyObjec
- char *kwlist[] = {"binary_form", NULL};
- X509_STORE *store;
- PyObject *ci = NULL, *rlist = NULL, *py_binary_mode = Py_False;
-+ STACK_OF(X509_OBJECT) *objs;
- int i;
- int binary_mode = 0;
-
-@@ -3221,17 +3301,18 @@ get_ca_certs(PySSLContext *self, PyObjec
- }
-
- store = SSL_CTX_get_cert_store(self->ctx);
-- for (i = 0; i < sk_X509_OBJECT_num(store->objs); i++) {
-+ objs = X509_STORE_get0_objects(store);
-+ for (i = 0; i < sk_X509_OBJECT_num(objs); i++) {
- X509_OBJECT *obj;
- X509 *cert;
-
-- obj = sk_X509_OBJECT_value(store->objs, i);
-- if (obj->type != X509_LU_X509) {
-+ obj = sk_X509_OBJECT_value(objs, i);
-+ if (X509_OBJECT_get_type(obj) != X509_LU_X509) {
- /* not a x509 cert */
- continue;
- }
- /* CA for any purpose */
-- cert = obj->data.x509;
-+ cert = X509_OBJECT_get0_X509(obj);
- if (!X509_check_ca(cert)) {
- continue;
- }
-@@ -3842,10 +3923,12 @@ static PyMethodDef PySSL_methods[] = {
- };
-
-
--#ifdef WITH_THREAD
-+#ifdef HAVE_OPENSSL_CRYPTO_LOCK
-
- /* an implementation of OpenSSL threading operations in terms
-- of the Python C thread library */
-+ * of the Python C thread library
-+ * Only used up to 1.0.2. OpenSSL 1.1.0+ has its own locking code.
-+ */
-
- static PyThread_type_lock *_ssl_locks = NULL;
-
-@@ -3926,7 +4009,7 @@ static int _setup_ssl_threads(void) {
- return 1;
- }
-
--#endif /* def HAVE_THREAD */
-+#endif /* HAVE_OPENSSL_CRYPTO_LOCK for WITH_THREAD && OpenSSL < 1.1.0 */
-
- PyDoc_STRVAR(module_doc,
- "Implementation module for SSL socket operations. See the socket module\n\
-@@ -3979,11 +4062,16 @@ init_ssl(void)
- SSL_load_error_strings();
- SSL_library_init();
- #ifdef WITH_THREAD
-+#ifdef HAVE_OPENSSL_CRYPTO_LOCK
- /* note that this will start threading if not already started */
- if (!_setup_ssl_threads()) {
- return;
- }
-+#elif OPENSSL_VERSION_1_1 && defined(OPENSSL_THREADS)
-+ /* OpenSSL 1.1.0 builtin thread support is enabled */
-+ _ssl_locks_count++;
- #endif
-+#endif /* WITH_THREAD */
- OpenSSL_add_all_algorithms();
-
- /* Add symbols to module dict */
-@@ -4136,7 +4224,9 @@ init_ssl(void)
- PY_SSL_VERSION_SSL3);
- #endif
- PyModule_AddIntConstant(m, "PROTOCOL_SSLv23",
-- PY_SSL_VERSION_SSL23);
-+ PY_SSL_VERSION_TLS);
-+ PyModule_AddIntConstant(m, "PROTOCOL_TLS",
-+ PY_SSL_VERSION_TLS);
- PyModule_AddIntConstant(m, "PROTOCOL_TLSv1",
- PY_SSL_VERSION_TLS1);
- #if HAVE_TLSv1_2
-
-# HG changeset patch
-# User Christian Heimes <christian(a)python.org>
-# Date 1473117039 -7200
-# Node ID 2593ed9a6a629b4fe3f77feb632c9584a3406201
-# Parent fb74947843eb9f39f3a564022c9132a118dabbb0
-Issue #26470: Use short name rather than name for compression name to fix #27958.
-
-diff --git a/Modules/_ssl.c b/Modules/_ssl.c
---- a/Modules/_ssl.c
-+++ b/Modules/_ssl.c
-@@ -148,11 +148,6 @@ static int COMP_get_type(const COMP_METH
- {
- return meth->type;
- }
--
--static const char *COMP_get_name(const COMP_METHOD *meth)
--{
-- return meth->name;
--}
- #endif
-
- static pem_password_cb *SSL_CTX_get_default_passwd_cb(SSL_CTX *ctx)
-@@ -1519,7 +1514,7 @@ static PyObject *PySSL_compression(PySSL
- comp_method = SSL_get_current_compression(self->ssl);
- if (comp_method == NULL || COMP_get_type(comp_method) == NID_undef)
- Py_RETURN_NONE;
-- short_name = COMP_get_name(comp_method);
-+ short_name = OBJ_nid2sn(COMP_get_type(comp_method));
- if (short_name == NULL)
- Py_RETURN_NONE;
- return PyBytes_FromString(short_name);
diff --git a/python2.spec b/python2.spec
index ae312bc..840cc01 100644
--- a/python2.spec
+++ b/python2.spec
@@ -102,8 +102,8 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
# Remember to also rebase python-docs when changing this:
-Version: 2.7.12
-Release: 9%{?dist}
+Version: 2.7.13
+Release: 1%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -310,7 +310,7 @@ Patch7: python-2.5.1-sqlite-encoding.patch
# SONAME from a library; we avoid this, apparently to minimize space
# requirements on the live CD:
# (rhbz:307221)
-Patch10: 00010-2.7.12-binutils-no-dep.patch
+Patch10: 00010-2.7.13-binutils-no-dep.patch
# Upstream as of Python 2.7.3:
# Patch11: python-2.7rc1-codec-ascii-tolower.patch
@@ -343,7 +343,7 @@ Patch55: 00055-systemtap.patch
# and add the /usr/lib64/pythonMAJOR.MINOR/site-packages to sitedirs, in front of
# /usr/lib/pythonMAJOR.MINOR/site-packages
# Not upstream
-Patch102: 00102-2.7.12-lib64.patch
+Patch102: 00102-2.7.13-lib64.patch
# Python 2.7 split out much of the path-handling from distutils/sysconfig.py to
# a new sysconfig.py (in r77704).
@@ -424,7 +424,7 @@ Patch111: 00111-no-static-lib.patch
#
# See also patch 130 below
#
-Patch112: 00112-2.7.12-debug-build.patch
+Patch112: 00112-2.7.13-debug-build.patch
# 00113 #
@@ -702,14 +702,6 @@ Patch180: 00180-python-add-support-for-ppc64p7.patch
# Doesn't apply to Python 3, where this is fixed otherwise and works.
Patch181: 00181-allow-arbitrary-timeout-in-condition-wait.patch
-# 00184 #
-# Fix for
https://bugzilla.redhat.com/show_bug.cgi?id=979696
-# Fixes build of ctypes against libffi with multilib wrapper
-# Python recognizes ffi.h only if it contains "#define LIBFFI_H",
-# but the wrapper doesn't contain that, which makes the build fail
-# We patch this by also accepting "#define ffi_wrapper_h"
-Patch184: 00184-ctypes-should-build-with-libffi-multilib-wrapper.patch
-
# 00185 #
# Makes urllib2 honor "no_proxy" enviroment variable for "ftp:" URLs
# when ftp_proxy is set
@@ -749,27 +741,6 @@ Patch198: 00198-add-rewheel-module.patch
# I skip test for now
Patch200: 00200-skip-thread-test.patch
-# 00209 #
-# Fix test breakage with version 2.2.0 of Expat
-# rhbz#1353919:
https://bugzilla.redhat.com/show_bug.cgi?id=1353919
-# FIXED UPSTREAM:
http://bugs.python.org/issue27369
-Patch209: 00209-fix-test-pyexpat-failure.patch
-
-# 00242 #
-# HTTPoxy attack (CVE-2016-1000110)
-#
https://httpoxy.org/
-# FIXED UPSTREAM:
http://bugs.python.org/issue27568
-# Based on a patch by Rmi Rampin
-# Resolves: rhbz#1359175
-Patch242: 00242-CVE-2016-1000110-httpoxy.patch
-
-# 00247 #
-# Port ssl and hashlib modules to OpenSSL 1.1.0.
-# As of F26, OpenSSL is rebased to 1.1.0, so in order for python
-# to not FTBFS we need to backport this patch from 2.7.13
-# FIXED UPSTREAM:
https://bugs.python.org/issue26470
-Patch247: 00247-port-ssl-and-hashlib-to-OpenSSL-1.1.0.patch
-
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora, EL,
etc.,
@@ -1076,7 +1047,6 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch174 -p1 -b .fix-for-usr-move
%patch180 -p1
%patch181 -p1
-%patch184 -p1
%patch185 -p1
%patch187 -p1
%patch189 -p1
@@ -1085,10 +1055,6 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%if 0%{with_rewheel}
%patch198 -p1
%endif
-%patch200 -p1
-%patch209 -p1
-%patch242 -p1
-%patch247 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -1952,6 +1918,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Wed Jan 11 2017 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.13-1
+- Update to 2.7.13
+
* Thu Oct 27 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-9
- Rename package to python2 and also rename the subpackages accordingly
- Provide and obsolete python and the respective subpackages to ensure a clean
commit 09c5a2e117ea8b4a5a990dd6c5d45837e37412ce
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Tue Jan 10 22:10:43 2017 +0100
Always include the rewheel patch at the SRPM
diff --git a/python2.spec b/python2.spec
index 555d4ab..ae312bc 100644
--- a/python2.spec
+++ b/python2.spec
@@ -741,9 +741,7 @@ Patch191: 00191-disable-NOOP.patch
Patch193: 00193-enable-loading-sqlite-extensions.patch
# 00198 #
-%if 0%{with_rewheel}
Patch198: 00198-add-rewheel-module.patch
-%endif
# 00200 #
# test_gdb.test_threads fails when run within rpmbuild
commit b16a7e06a487c400d19ce49e143fdae0566708df
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Tue Jan 10 16:24:02 2017 +0100
Reupload sources after package rename
diff --git a/sources b/sources
index dfb032e..a994449 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-57dffcee9cee8bb2ab5f82af1d8e9a69 Python-2.7.12.tar.xz
+SHA512 (Python-2.7.12.tar.xz) =
6ddbbce47cc49597433d98ca05c2f62f07ed1070807b645602a8e9e9b996adc6fa66fa20a33cd7d23d4e7e925e25071d7301d288149fbe4e8c5f06d5438dda1f
commit 7207f73b41d88ff5abf74006f7ab2f33b9522832
Merge: ac2b7b0 ce1eee6
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Tue Jan 10 16:16:52 2017 +0100
Merge with python package history
commit ac2b7b0248c38801f6ba86666310b87b735f1dab
Author: Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org>
Date: Tue Jan 10 14:44:50 2017 +0000
Initial setup of the repo
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/sources b/sources
new file mode 100644
index 0000000..e69de29
commit ce1eee682beab6c572b56f47de4c4751e28e2813
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Fri Dec 9 10:29:57 2016 +0100
Use https URL
diff --git a/python2.spec b/python2.spec
index b11e84d..555d4ab 100644
--- a/python2.spec
+++ b/python2.spec
@@ -800,7 +800,7 @@ Provides: python27 = %{version}-%{release}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-URL:
http://www.python.org/
+URL:
https://www.python.org/
%description
Python is an interpreted, interactive, object-oriented programming
commit 9e09f0f095c684e3bddfb6ec1ab4e437fc9f467a
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Mon Dec 5 15:27:30 2016 +0100
Implement and expand the recommendations of PEP 394, thus
providing symlinks of all the binaries in the form of
bin2 and bin2.7.
diff --git a/python2.spec b/python2.spec
index 164752b..b11e84d 100644
--- a/python2.spec
+++ b/python2.spec
@@ -1375,6 +1375,33 @@ find . -name ".cvsignore"|xargs rm -f
#zero length
rm -f %{buildroot}%{pylibdir}/LICENSE.txt
+
+# Provide binaries in the form of bin2 and bin2.7, thus implementing
+# (and expanding) the recommendations of PEP 394.
+mv %{buildroot}%{_bindir}/idle %{buildroot}%{_bindir}/idle%{pybasever}
+ln -s ./idle%{pybasever} %{buildroot}%{_bindir}/idle2
+ln -s ./idle2 %{buildroot}%{_bindir}/idle
+
+mv %{buildroot}%{_bindir}/pynche %{buildroot}%{_bindir}/pynche%{pybasever}
+ln -s ./pynche%{pybasever} %{buildroot}%{_bindir}/pynche2
+ln -s ./pynche2 %{buildroot}%{_bindir}/pynche
+
+mv %{buildroot}%{_bindir}/pydoc %{buildroot}%{_bindir}/pydoc%{pybasever}
+ln -s ./pydoc%{pybasever} %{buildroot}%{_bindir}/pydoc2
+ln -s ./pydoc2 %{buildroot}%{_bindir}/pydoc
+
+mv %{buildroot}%{_bindir}/pygettext.py %{buildroot}%{_bindir}/pygettext%{pybasever}.py
+ln -s ./pygettext%{pybasever}.py %{buildroot}%{_bindir}/pygettext2.py
+ln -s ./pygettext2.py %{buildroot}%{_bindir}/pygettext.py
+
+mv %{buildroot}%{_bindir}/msgfmt.py %{buildroot}%{_bindir}/msgfmt%{pybasever}.py
+ln -s ./msgfmt%{pybasever}.py %{buildroot}%{_bindir}/msgfmt2.py
+ln -s ./msgfmt2.py %{buildroot}%{_bindir}/msgfmt.py
+
+mv %{buildroot}%{_bindir}/smtpd.py %{buildroot}%{_bindir}/smtpd%{pybasever}.py
+ln -s ./smtpd%{pybasever}.py %{buildroot}%{_bindir}/smtpd2.py
+ln -s ./smtpd2.py %{buildroot}%{_bindir}/smtpd.py
+
# Fix for bug #136654
rm -f %{buildroot}%{pylibdir}/email/test/data/audiotest.au
%{buildroot}%{pylibdir}/test/audiotest.au
@@ -1932,6 +1959,7 @@ rm -fr %{buildroot}
- Provide and obsolete python and the respective subpackages to ensure a clean
upgrade path
- Remove old provides for packages that got into stdlib
+- Implement PEP 394
* Wed Oct 12 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-8
- Port ssl and hashlib modules to OpenSSL 1.1.0
commit 8611db76f0486bbf3979bed345769ddcb5609511
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Mon Nov 14 11:27:43 2016 +0100
Remove Provides for python-abi as it is not required by any package, as opposed to
python(abi).
diff --git a/python2.spec b/python2.spec
index 13fe4d3..164752b 100644
--- a/python2.spec
+++ b/python2.spec
@@ -107,7 +107,6 @@ Release: 9%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
-Provides: python-abi = %{pybasever}
Provides: python(abi) = %{pybasever}
commit 5815530bba3ebdfce913fc06f0ad3ee0a075335f
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Mon Nov 14 11:20:24 2016 +0100
Rename python.spec to python2.spec
diff --git a/python.spec b/python.spec
deleted file mode 100644
index 13fe4d3..0000000
--- a/python.spec
+++ /dev/null
@@ -1,3519 +0,0 @@
-# ======================================================
-# Conditionals and other variables controlling the build
-# ======================================================
-
-%global with_rewheel 1
-
-%global unicode ucs4
-
-%global python python2
-
-# Macro for using the version-release where python got
-# renamed to python2 at Fedora 26, in order to ensure clean upgrade path.
-# It should be removed along with the obsoletes at Fedora 28.
-%global obs 2.7.12-9
-
-%global pybasever 2.7
-%global pylibdir %{_libdir}/python%{pybasever}
-%global tools_dir %{pylibdir}/Tools
-%global demo_dir %{pylibdir}/Demo
-%global doc_tools_dir %{pylibdir}/Doc/tools
-%global dynload_dir %{pylibdir}/lib-dynload
-%global site_packages %{pylibdir}/site-packages
-
-# Python's configure script defines SOVERSION, and this is used in the Makefile
-# to determine INSTSONAME, the name of the libpython DSO:
-# LDLIBRARY='libpython$(VERSION).so'
-# INSTSONAME="$LDLIBRARY".$SOVERSION
-# We mirror this here in order to make it easier to add the -gdb.py hooks.
-# (if these get out of sync, the payload of the libs subpackage will fail
-# and halt the build)
-%global py_SOVERSION 1.0
-%global py_INSTSONAME_optimized libpython%{pybasever}.so.%{py_SOVERSION}
-%global py_INSTSONAME_debug libpython%{pybasever}_d.so.%{py_SOVERSION}
-
-%global with_debug_build 1
-
-# Disabled for now:
-%global with_huntrleaks 0
-
-%global with_gdb_hooks 1
-
-%global with_systemtap 1
-
-# some arches don't have valgrind so we need to disable its support on them
-%ifnarch s390 %{mips} riscv64
-%global with_valgrind 1
-%else
-%global with_valgrind 0
-%endif
-
-%global with_gdbm 1
-
-# Turn this to 0 to turn off the "check" phase:
-%global run_selftest_suite 1
-
-# Some of the files below /usr/lib/pythonMAJOR.MINOR/test (e.g. bad_coding.py)
-# are deliberately invalid, leading to SyntaxError exceptions if they get
-# byte-compiled.
-#
-# These errors are ignored by the normal python build, and aren't normally a
-# problem in the buildroots since /usr/bin/python isn't present.
-#
-# However, for the case where we're rebuilding the python srpm on a machine
-# that does have python installed we need to set this to avoid
-# brp-python-bytecompile treating these as fatal errors:
-#
-%global _python_bytecompile_errors_terminate_build 0
-
-# We need to get a newer configure generated out of configure.in for the following
-# patches:
-# patch 4 (CFLAGS)
-# patch 52 (valgrind)
-# patch 55 (systemtap)
-# patch 145 (linux2)
-#
-# For patch 55 (systemtap), we need to get a new header for configure to use
-#
-# configure.in requires autoconf-2.65, but the version in Fedora is currently
-# autoconf-2.66
-#
-# For now, we'll generate a patch to the generated configure script and
-# pyconfig.h.in on a machine that has a local copy of autoconf 2.65
-#
-# Instructions on obtaining such a copy can be seen at
-#
http://bugs.python.org/issue7997
-#
-# To make it easy to regenerate the patch, this specfile can be run in two
-# ways:
-# (i) regenerate_autotooling_patch 0 : the normal approach: prep the
-# source tree using a pre-generated patch to the "configure" script, and do a
-# full build
-# (ii) regenerate_autotooling_patch 1 : intended to be run on a developer's
-# workstation: prep the source tree without patching configure, then rerun a
-# local copy of autoconf-2.65, regenerate the patch, then exit, without doing
-# the rest of the build
-%global regenerate_autotooling_patch 0
-
-
-# ==================
-# Top-level metadata
-# ==================
-Summary: An interpreted, interactive, object-oriented programming language
-Name: %{python}
-# Remember to also rebase python-docs when changing this:
-Version: 2.7.12
-Release: 9%{?dist}
-License: Python
-Group: Development/Languages
-Requires: %{python}-libs%{?_isa} = %{version}-%{release}
-Provides: python-abi = %{pybasever}
-Provides: python(abi) = %{pybasever}
-
-
-# =======================
-# Build-time requirements
-# =======================
-
-# (keep this list alphabetized)
-
-BuildRequires: autoconf
-BuildRequires: bluez-libs-devel
-BuildRequires: bzip2
-BuildRequires: bzip2-devel
-
-# expat 2.1.0 added the symbol XML_SetHashSalt without bumping SONAME. We use
-# it (in pyexpat) in order to enable the fix in Python-2.7.3 for CVE-2012-0876:
-BuildRequires: expat-devel >= 2.1.0
-
-BuildRequires: findutils
-BuildRequires: gcc-c++
-%if %{with_gdbm}
-BuildRequires: gdbm-devel
-%endif
-BuildRequires: glibc-devel
-BuildRequires: gmp-devel
-BuildRequires: libdb-devel
-BuildRequires: libffi-devel
-BuildRequires: libGL-devel
-BuildRequires: libX11-devel
-BuildRequires: ncurses-devel
-BuildRequires: openssl-devel
-BuildRequires: pkgconfig
-BuildRequires: readline-devel
-BuildRequires: sqlite-devel
-
-%if 0%{?with_systemtap}
-BuildRequires: systemtap-sdt-devel
-# (this introduces a circular dependency, in that systemtap-sdt-devel's
-# /usr/bin/dtrace is a python script)
-%global tapsetdir /usr/share/systemtap/tapset
-%endif # with_systemtap
-
-BuildRequires: tar
-BuildRequires: tcl-devel
-BuildRequires: tix-devel
-BuildRequires: tk-devel
-
-%if 0%{?with_valgrind}
-BuildRequires: valgrind-devel
-%endif
-
-BuildRequires: zlib-devel
-
-%if 0%{?with_rewheel}
-BuildRequires: python2-setuptools
-BuildRequires: python2-pip
-
-Requires: python2-setuptools
-Requires: python2-pip
-%endif
-
-
-
-# =======================
-# Source code and patches
-# =======================
-
-Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz
-
-# Work around bug 562906 until it's fixed in rpm-build by providing a fixed
-# version of pythondeps.sh:
-Source2: pythondeps.sh
-%global __python_requires %{SOURCE2}
-
-# Systemtap tapset to make it easier to use the systemtap static probes
-# (actually a template; LIBRARY_PATH will get fixed up during install)
-# Written by dmalcolm; not yet sent upstream
-Source3: libpython.stp
-
-
-# Example systemtap script using the tapset
-# Written by wcohen, mjw, dmalcolm; not yet sent upstream
-Source4: systemtap-example.stp
-
-# Another example systemtap script that uses the tapset
-# Written by dmalcolm; not yet sent upstream
-Source5: pyfuntop.stp
-
-Source7: pynche
-
-# Modules/Setup.dist is ultimately used by the "makesetup" script to construct
-# the Makefile and config.c
-#
-# Upstream leaves many things disabled by default, to try to make it easy as
-# possible to build the code on as many platforms as possible.
-#
-# TODO: many modules can also now be built by setup.py after the python binary
-# has been built; need to assess if we should instead build things there
-#
-# We patch it downstream as follows:
-# - various modules are built by default by upstream as static libraries;
-# we built them as shared libraries
-# - build the "readline" module (appears to also be handled by setup.py now)
-# - enable the build of the following modules:
-# - array arraymodule.c # array objects
-# - cmath cmathmodule.c # -lm # complex math library functions
-# - math mathmodule.c # -lm # math library functions, e.g. sin()
-# - _struct _struct.c # binary structure packing/unpacking
-# - time timemodule.c # -lm # time operations and variables
-# - operator operator.c # operator.add() and similar goodies
-# - _weakref _weakref.c # basic weak reference support
-# - _testcapi _testcapimodule.c # Python C API test module
-# - _random _randommodule.c # Random number generator
-# - _collections _collectionsmodule.c # Container types
-# - itertools itertoolsmodule.c
-# - strop stropmodule.c
-# - _functools _functoolsmodule.c
-# - _bisect _bisectmodule.c # Bisection algorithms
-# - unicodedata unicodedata.c # static Unicode character database
-# - _locale _localemodule.c
-# - fcntl fcntlmodule.c # fcntl(2) and ioctl(2)
-# - spwd spwdmodule.c # spwd(3)
-# - grp grpmodule.c # grp(3)
-# - select selectmodule.c # select(2); not on ancient System V
-# - mmap mmapmodule.c # Memory-mapped files
-# - _csv _csv.c # CSV file helper
-# - _socket socketmodule.c # Socket module helper for socket(2)
-# - _ssl _ssl.c
-# - crypt cryptmodule.c -lcrypt # crypt(3)
-# - nis nismodule.c -lnsl # Sun yellow pages -- not everywhere
-# - termios termios.c # Steen Lumholt's termios module
-# - resource resource.c # Jeremy Hylton's rlimit interface
-# - audioop audioop.c # Operations on audio samples
-# - imageop imageop.c # Operations on images
-# - _md5 md5module.c md5.c
-# - _sha shamodule.c
-# - _sha256 sha256module.c
-# - _sha512 sha512module.c
-# - linuxaudiodev linuxaudiodev.c
-# - timing timingmodule.c
-# - _tkinter _tkinter.c tkappinit.c
-# - dl dlmodule.c
-# - gdbm gdbmmodule.c
-# - _bsddb _bsddb.c
-# - binascii binascii.c
-# - parser parsermodule.c
-# - cStringIO cStringIO.c
-# - cPickle cPickle.c
-# - zlib zlibmodule.c
-# - _multibytecodec cjkcodecs/multibytecodec.c
-# - _codecs_cn cjkcodecs/_codecs_cn.c
-# - _codecs_hk cjkcodecs/_codecs_hk.c
-# - _codecs_iso2022 cjkcodecs/_codecs_iso2022.c
-# - _codecs_jp cjkcodecs/_codecs_jp.c
-# - _codecs_kr cjkcodecs/_codecs_kr.c
-# - _codecs_tw cjkcodecs/_codecs_tw.c
-Patch0: python-2.7.1-config.patch
-
-# Removes the "-g" option from "pydoc", for some reason; I believe
-# (dmalcolm 2010-01-29) that this was introduced in this change:
-# - fix pydoc (#68082)
-# in 2.2.1-12 as a response to the -g option needing TkInter installed
-# (Red Hat Linux 8)
-# Not upstream
-Patch1: 00001-pydocnogui.patch
-
-# Add $(CFLAGS) to the linker arguments when linking the "python" binary
-# since some architectures (sparc64) need this (rhbz:199373).
-# Not yet filed upstream
-Patch4: python-2.5-cflags.patch
-
-# Work around a bug in Python' gettext module relating to the
"Plural-Forms"
-# header (rhbz:252136)
-# Related to upstream issues:
-#
http://bugs.python.org/issue1448060 and
http://bugs.python.org/issue1475523
-# though the proposed upstream patches are, alas, different
-Patch6: python-2.5.1-plural-fix.patch
-
-# This patch was listed in the changelog as:
-# * Fri Sep 14 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-11
-# - fix encoding of sqlite .py files to work around weird encoding problem
-# in Turkish (#283331)
-# A traceback attached to rhbz 244016 shows the problem most clearly: a
-# traceback on attempting to import the sqlite module, with:
-# "SyntaxError: encoding problem: with BOM (__init__.py, line 1)"
-# This seems to come from Parser/tokenizer.c:check_coding_spec
-# Our patch changes two source files within sqlite3, removing the
-# "coding: ISO-8859-1" specs and character E4 = U+00E4 =
-# LATIN SMALL LETTER A WITH DIAERESIS from in ghaering's surname.
-#
-# It may be that the conversion of "ISO-8859-1" to "iso-8859-1" is
thwarted
-# by the implementation of "tolower" in the Turkish locale; see:
-#
https://bugzilla.redhat.com/show_bug.cgi?id=191096#c9
-#
-# TODO: Not yet sent upstream, and appears to me (dmalcolm 2010-01-29) that
-# it may be papering over a symptom
-Patch7: python-2.5.1-sqlite-encoding.patch
-
-# FIXME: Lib/ctypes/util.py posix implementation defines a function
-# _get_soname(f). Upstreams's implementation of this uses objdump to read the
-# SONAME from a library; we avoid this, apparently to minimize space
-# requirements on the live CD:
-# (rhbz:307221)
-Patch10: 00010-2.7.12-binutils-no-dep.patch
-
-# Upstream as of Python 2.7.3:
-# Patch11: python-2.7rc1-codec-ascii-tolower.patch
-
-# Add various constants to the socketmodule (rhbz#436560):
-# TODO: these patches were added in 2.5.1-22 and 2.5.1-24 but appear not to
-# have been sent upstream yet:
-Patch13: python-2.7rc1-socketmodule-constants.patch
-Patch14: python-2.7rc1-socketmodule-constants2.patch
-
-# Remove an "-rpath $(LIBDIR)" argument from the linkage args in configure.in:
-# FIXME: is this for OSF, not Linux?
-Patch16: python-2.6-rpath.patch
-
-# Fixup distutils/unixccompiler.py to remove standard library path from rpath:
-# Adapted from Patch0 in ivazquez' python3000 specfile, removing usage of
-# super() as it's an old-style class
-Patch17: python-2.6.4-distutils-rpath.patch
-
-# 00055 #
-# Systemtap support: add statically-defined probe points
-# Patch based on upstream bug:
http://bugs.python.org/issue4111
-# fixed up by mjw and wcohen for 2.6.2, then fixed up by dmalcolm for 2.6.4
-# then rewritten by mjw (attachment 390110 of rhbz 545179), then reformatted
-# for 2.7rc1 by dmalcolm:
-Patch55: 00055-systemtap.patch
-
-# Only used when "%{_lib}" == "lib64"
-# Fixup various paths throughout the build and in distutils from "lib" to
"lib64",
-# and add the /usr/lib64/pythonMAJOR.MINOR/site-packages to sitedirs, in front of
-# /usr/lib/pythonMAJOR.MINOR/site-packages
-# Not upstream
-Patch102: 00102-2.7.12-lib64.patch
-
-# Python 2.7 split out much of the path-handling from distutils/sysconfig.py to
-# a new sysconfig.py (in r77704).
-# We need to make equivalent changes to that new file to ensure that the stdlib
-# and platform-specific code go to /usr/lib64 not /usr/lib, on 64-bit archs:
-Patch103: python-2.7-lib64-sysconfig.patch
-
-# 00104 #
-# Only used when "%{_lib}" == "lib64"
-# Another lib64 fix, for distutils/tests/test_install.py; not upstream:
-Patch104: 00104-lib64-fix-for-test_install.patch
-
-# 00111 #
-# Patch the Makefile.pre.in so that the generated Makefile doesn't try to build
-# a libpythonMAJOR.MINOR.a (bug 550692):
-# Downstream only: not appropriate for upstream
-Patch111: 00111-no-static-lib.patch
-
-# 00112 #
-# Patch to support building both optimized vs debug stacks DSO ABIs, sharing
-# the same .py and .pyc files, using "_d.so" to signify a debug build of an
-# extension module.
-#
-# Based on Debian's patch for the same,
-#
http://patch-tracker.debian.org/patch/series/view/python2.6/2.6.5-2/debug...
-#
-# (which was itself based on the upstream Windows build), but with some
-# changes:
-#
-# * Debian's patch to dynload_shlib.c looks for module_d.so, then module.so,
-# but this can potentially find a module built against the wrong DSO ABI. We
-# instead search for just module_d.so in a debug build
-#
-# * We remove this change from configure.in's build of the Makefile:
-# SO=$DEBUG_EXT.so
-# so that sysconfig.py:customize_compiler stays with shared_lib_extension='.so'
-# on debug builds, so that UnixCCompiler.find_library_file can find system
-# libraries (otherwise "make sharedlibs" fails to find system libraries,
-# erroneously looking e.g. for "libffi_d.so" rather than
"libffi.so")
-#
-# * We change Lib/distutils/command/build_ext.py:build_ext.get_ext_filename
-# to add the _d there, when building an extension. This way, "make
sharedlibs"
-# can build ctypes, by finding the sysmtem libffi.so (rather than failing to
-# find "libffi_d.so"), and builds the module as _ctypes_d.so
-#
-# * Similarly, update build_ext:get_libraries handling of Py_ENABLE_SHARED by
-# appending "_d" to the python library's name for the debug configuration
-#
-# * We modify Modules/makesetup to add the "_d" to the generated Makefile
-# rules for the various Modules/*.so targets
-#
-# This may introduce issues when building an extension that links directly
-# against another extension (e.g. users of NumPy?), but seems more robust when
-# searching for external libraries
-#
-# * We don't change Lib/distutils/command/build.py: build.build_purelib to
-# embed plat_specifier, leaving it as is, as pure python builds should be
-# unaffected by these differences (we'll be sharing the .py and .pyc files)
-#
-# * We introduce DEBUG_SUFFIX as well as DEBUG_EXT:
-# - DEBUG_EXT is used by ELF files (names and SONAMEs); it will be "_d"
for
-# a debug build
-# - DEBUG_SUFFIX is used by filesystem paths; it will be "-debug" for a
-# debug build
-#
-# Both will be empty in an optimized build. "_d" contains characters that
-# are valid ELF metadata, but this leads to various ugly filesystem paths (such
-# as the include path), and DEBUG_SUFFIX allows these paths to have more natural
-# names. Changing this requires changes elsewhere in the distutils code.
-#
-# * We add DEBUG_SUFFIX to PYTHON in the Makefile, so that the two
-# configurations build parallel-installable binaries with different names
-# ("python-debug" vs "python").
-#
-# * Similarly, we add DEBUG_SUFFIX within python-config and
-# python$(VERSION)-config, so that the two configuration get different paths
-# for these.
-#
-# See also patch 130 below
-#
-Patch112: 00112-2.7.12-debug-build.patch
-
-
-# 00113 #
-# Add configure-time support for the COUNT_ALLOCS and CALL_PROFILE options
-# described at
http://svn.python.org/projects/python/trunk/Misc/SpecialBuilds.txt
-# so that if they are enabled, they will be in that build's pyconfig.h, so that
-# extension modules will reliably use them
-# Not yet sent upstream
-Patch113: 00113-more-configuration-flags.patch
-
-# 00114 #
-# Add flags for statvfs.f_flag to the constant list in posixmodule (i.e. "os")
-# (rhbz:553020); partially upstream as
http://bugs.python.org/issue7647
-# Not yet sent upstream
-Patch114: 00114-statvfs-f_flag-constants.patch
-
-# Upstream r79310 removed the "Modules" directory from sys.path when Python is
-# running from the build directory on POSIX to fix a unit test (issue #8205).
-# This seems to have broken the compileall.py done in "make install": it
cannot
-# find shared library extension modules at this point in the build (sys.path
-# does not contain DESTDIR/usr/lib(64)/python-2.7/lib-dynload for some reason),
-# leading to the build failing with:
-# Traceback (most recent call last):
-# File
"/home/david/rpmbuild/BUILDROOT/python-2.7-0.1.rc2.fc14.x86_64/usr/lib64/python2.7/compileall.py",
line 17, in <module>
-# import struct
-# File
"/home/david/rpmbuild/BUILDROOT/python-2.7-0.1.rc2.fc14.x86_64/usr/lib64/python2.7/struct.py",
line 1, in <module>
-# from _struct import *
-# ImportError: No module named _struct
-# This patch adds the build Modules directory to build path.
-Patch121: 00121-add-Modules-to-build-path.patch
-
-# 00125 #
-# COUNT_ALLOCS is useful for debugging, but the upstream behaviour of always
-# emitting debug info to stdout on exit is too verbose and makes it harder to
-# use the debug build. Add a "PYTHONDUMPCOUNTS" environment variable which
-# must be set to enable the output on exit
-# Not yet sent upstream
-Patch125: 00125-less-verbose-COUNT_ALLOCS.patch
-
-# 2.7.1 (in r84230) added a test to test_abc which fails if python is
-# configured with COUNT_ALLOCS, which is the case for our debug build
-# (the COUNT_ALLOCS instrumentation keeps "C" alive).
-# Not yet sent upstream
-Patch128: python-2.7.1-fix_test_abc_with_COUNT_ALLOCS.patch
-
-# 00130 #
-# Add "--extension-suffix" option to python-config and python-debug-config
-# (rhbz#732808)
-#
-# This is adapted from 3.2's PEP-3149 support.
-#
-# Fedora's debug build has some non-standard features (see also patch 112
-# above), though largely shared with Debian/Ubuntu and Windows
-#
-# In particular, SO in the Makefile is currently always just ".so" for our
-# python 2 optimized builds, but for python 2 debug it should be '_d.so', to
-# distinguish the debug vs optimized ABI, following the pattern in the above
-# patch.
-#
-# Not yet sent upstream
-Patch130: python-2.7.2-add-extension-suffix-to-python-config.patch
-
-# 00131 #
-# The four tests in test_io built on top of check_interrupted_write_retry
-# fail when built in Koji, for ppc and ppc64; for some reason, the SIGALRM
-# handlers are never called, and the call to write runs to completion
-# (rhbz#732998)
-Patch131: 00131-disable-tests-in-test_io.patch
-
-# 00132 #
-# Add non-standard hooks to unittest for use in the "check" phase below, when
-# running selftests within the build:
-# @unittest._skipInRpmBuild(reason)
-# for tests that hang or fail intermittently within the build environment, and:
-# @unittest._expectedFailureInRpmBuild
-# for tests that always fail within the build environment
-#
-# The hooks only take effect if WITHIN_PYTHON_RPM_BUILD is set in the
-# environment, which we set manually in the appropriate portion of the "check"
-# phase below (and which potentially other python-* rpms could set, to reuse
-# these unittest hooks in their own "check" phases)
-Patch132: 00132-add-rpmbuild-hooks-to-unittest.patch
-
-# 00133 #
-# "dl" is deprecated, and test_dl doesn't work on 64-bit builds:
-Patch133: 00133-skip-test_dl.patch
-
-# 00134 #
-# Fix a failure in test_sys.py when configured with COUNT_ALLOCS enabled
-# Not yet sent upstream
-Patch134: 00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch
-
-# 00135 #
-# Skip "test_callback_in_cycle_resurrection" in a debug build, where it fails:
-# Not yet sent upstream
-Patch135: 00135-skip-test-within-test_weakref-in-debug-build.patch
-
-# 00136 #
-# Some tests try to seek on sys.stdin, but don't work as expected when run
-# within Koji/mock; skip them within the rpm build:
-Patch136: 00136-skip-tests-of-seeking-stdin-in-rpmbuild.patch
-
-# 00137 #
-# Some tests within distutils fail when run in an rpmbuild:
-Patch137: 00137-skip-distutils-tests-that-fail-in-rpmbuild.patch
-
-# 00138 #
-# Fixup some tests within distutils to work with how debug builds are set up:
-Patch138: 00138-fix-distutils-tests-in-debug-build.patch
-
-# 00139 #
-# ARM-specific: skip known failure in test_float:
-#
http://bugs.python.org/issue8265 (rhbz#706253)
-Patch139: 00139-skip-test_float-known-failure-on-arm.patch
-
-# 00140 #
-# Sparc-specific: skip known failure in test_ctypes:
-#
http://bugs.python.org/issue8314 (rhbz#711584)
-# which appears to be a libffi bug
-Patch140: 00140-skip-test_ctypes-known-failure-on-sparc.patch
-
-# 00141 #
-# Fix test_gc's test_newinstance case when configured with COUNT_ALLOCS:
-# Not yet sent upstream
-Patch141: 00141-fix-test_gc_with_COUNT_ALLOCS.patch
-
-# 00142 #
-# Some pty tests fail when run in mock (rhbz#714627):
-Patch142: 00142-skip-failing-pty-tests-in-rpmbuild.patch
-
-# 00143 #
-# Fix the --with-tsc option on ppc64, and rework it on 32-bit ppc to avoid
-# aliasing violations (rhbz#698726)
-# Sent upstream as
http://bugs.python.org/issue12872
-Patch143: 00143-tsc-on-ppc.patch
-
-# 00144 #
-# (Optionally) disable the gdbm module:
-Patch144: 00144-no-gdbm.patch
-
-# 00146 #
-# Support OpenSSL FIPS mode (e.g. when OPENSSL_FORCE_FIPS_MODE=1 is set)
-# - handle failures from OpenSSL (e.g. on attempts to use MD5 in a
-# FIPS-enforcing environment)
-# - add a new "usedforsecurity" keyword argument to the various digest
-# algorithms in hashlib so that you can whitelist a callsite with
-# "usedforsecurity=False"
-# (sent upstream for python 3 as
http://bugs.python.org/issue9216; this is a
-# backport to python 2.7; see RHEL6 patch 119)
-# - enforce usage of the _hashlib implementation: don't fall back to the _md5
-# and _sha* modules (leading to clearer error messages if fips selftests
-# fail)
-# - don't build the _md5 and _sha* modules; rely on the _hashlib implementation
-# of hashlib (for example, md5.py will use _hashlib's implementation of MD5,
-# if permitted by the FIPS setting)
-# (rhbz#563986)
-Patch146: 00146-hashlib-fips.patch
-
-# 00147 #
-# Add a sys._debugmallocstats() function
-# Based on patch 202 from RHEL 5's python.spec, with updates from rhbz#737198
-# Sent upstream as
http://bugs.python.org/issue14785
-Patch147: 00147-add-debug-malloc-stats.patch
-
-# 00153 #
-# Strip out lines of the form "warning: Unable to open ..." from gdb's
stderr
-# when running test_gdb.py; also cope with change to gdb in F17 onwards in
-# which values are printed as "v@entry" rather than just "v":
-# Not yet sent upstream
-Patch153: 00153-fix-test_gdb-noise.patch
-
-# 00155 #
-# Avoid allocating thunks in ctypes unless absolutely necessary, to avoid
-# generating SELinux denials on "import ctypes" and "import uuid"
when
-# embedding Python within httpd (rhbz#814391)
-Patch155: 00155-avoid-ctypes-thunks.patch
-
-# 00156 #
-# Recent builds of gdb will only auto-load scripts from certain safe
-# locations. Turn off this protection when running test_gdb in the selftest
-# suite to ensure that it can load our -gdb.py script (rhbz#817072):
-# Not yet sent upstream
-Patch156: 00156-gdb-autoload-safepath.patch
-
-# 00157 #
-# Update uid/gid handling throughout the standard library: uid_t and gid_t are
-# unsigned 32-bit values, but existing code often passed them through C long
-# values, which are signed 32-bit values on 32-bit architectures, leading to
-# negative int objects for uid/gid values >= 2^31 on 32-bit architectures.
-#
-# Introduce _PyObject_FromUid/Gid to convert uid_t/gid_t values to python
-# objects, using int objects where the value will fit (long objects otherwise),
-# and _PyArg_ParseUid/Gid to convert int/long to uid_t/gid_t, with -1 allowed
-# as a special case (since this is given special meaning by the chown syscall)
-#
-# Update standard library to use this throughout for uid/gid values, so that
-# very large uid/gid values are round-trippable, and -1 remains usable.
-# (rhbz#697470)
-Patch157: 00157-uid-gid-overflows.patch
-
-# 00165 #
-# Backport to Python 2 from Python 3.3 of improvements to the "crypt" module
-# adding precanned ways of salting a password (rhbz#835021)
-# Based on r88500 patch to py3k from Python 3.3
-# plus 6482dd1c11ed, 0586c699d467, 62994662676a, 74a1110a3b50, plus edits
-# to docstrings to note that this additional functionality is not standard
-# within 2.7
-Patch165: 00165-crypt-module-salt-backport.patch
-
-# 00167 #
-# Don't run any of the stack navigation tests in test_gdb when Python is
-# optimized, since there appear to be many different ways in which gdb can
-# fail to read the PyFrameObject* for arbitrary places in the callstack,
-# presumably due to compiler optimization (rhbz#912025)
-#
-# Not yet sent upstream
-Patch167: 00167-disable-stack-navigation-tests-when-optimized-in-test_gdb.patch
-
-# 00168 #
-# Update distutils.sysconfig so that if CFLAGS is defined in the environment,
-# when building extension modules, it is appended to the full compilation
-# flags from Python's Makefile, rather than instead reducing the compilation
-# flags to the subset within OPT and adding it to those.
-#
-# In particular, this should ensure that "-fno-strict-aliasing" is used by
-# "python setup.py build" even when CFLAGS is defined in the environment.
-#
-# (rhbz#849994)
-Patch168: 00168-distutils-cflags.patch
-
-# 00169 #
-# Use SHA-256 rather than implicitly using MD5 within the challenge handling
-# in multiprocessing.connection
-#
-# Sent upstream as
http://bugs.python.org/issue17258
-# (rhbz#879695)
-Patch169: 00169-avoid-implicit-usage-of-md5-in-multiprocessing.patch
-
-# 00170 #
-# In debug builds, try to print repr() when a C-level assert fails in the
-# garbage collector (typically indicating a reference-counting error
-# somewhere else e.g in an extension module)
-# Backported to 2.7 from a patch I sent upstream for py3k
-#
http://bugs.python.org/issue9263 (rhbz#614680)
-# hiding the proposed new macros/functions within gcmodule.c to avoid exposing
-# them within the extension API.
-# (rhbz#850013)
-Patch170: 00170-gc-assertions.patch
-
-# 00173 #
-# Workaround for ENOPROTOOPT seen in Koji within
-# test.test_support.bind_port()
-# (rhbz#913732)
-Patch173: 00173-workaround-ENOPROTOOPT-in-bind_port.patch
-
-# 00174 #
-# Workaround for failure to set up prefix/exec_prefix when running
-# an embededed libpython that sets Py_SetProgramName() to a name not
-# on $PATH when run from the root directory due to
-#
https://fedoraproject.org/wiki/Features/UsrMove
-# e.g. cmpi-bindings under systemd (rhbz#817554):
-Patch174: 00174-fix-for-usr-move.patch
-
-# 00180 #
-# Enable building on ppc64p7
-# Not appropriate for upstream, Fedora-specific naming
-Patch180: 00180-python-add-support-for-ppc64p7.patch
-
-# 00181 #
-# Allow arbitrary timeout for Condition.wait, as reported in
-#
https://bugzilla.redhat.com/show_bug.cgi?id=917709
-# Upstream doesn't want this:
http://bugs.python.org/issue17748
-# But we have no better solution downstream yet, and since there is
-# no API breakage, we apply this patch.
-# Doesn't apply to Python 3, where this is fixed otherwise and works.
-Patch181: 00181-allow-arbitrary-timeout-in-condition-wait.patch
-
-# 00184 #
-# Fix for
https://bugzilla.redhat.com/show_bug.cgi?id=979696
-# Fixes build of ctypes against libffi with multilib wrapper
-# Python recognizes ffi.h only if it contains "#define LIBFFI_H",
-# but the wrapper doesn't contain that, which makes the build fail
-# We patch this by also accepting "#define ffi_wrapper_h"
-Patch184: 00184-ctypes-should-build-with-libffi-multilib-wrapper.patch
-
-# 00185 #
-# Makes urllib2 honor "no_proxy" enviroment variable for "ftp:" URLs
-# when ftp_proxy is set
-Patch185: 00185-urllib2-honors-noproxy-for-ftp.patch
-
-# 00187 #
-# Add an explicit RPATH to pyexpat.so pointing at the directory
-# containing the system expat (which has the extra XML_SetHashSalt
-# symbol), to avoid an ImportError with a link error if there's an
-# LD_LIBRARY_PATH containing a "vanilla" build of expat (without the
-# symbol)
-Patch187: 00187-add-RPATH-to-pyexpat.patch
-
-# 00189 #
-# Fixes gdb py-bt command not to raise exception while processing
-# statements from eval
-# rhbz#1008154 (patch by Attila Fazekas)
-Patch189: 00189-gdb-py-bt-dont-raise-exception-from-eval.patch
-
-# 00191 #
-# Disabling NOOP test as it fails without internet connection
-Patch191: 00191-disable-NOOP.patch
-
-# 00193 #
-# Enable loading sqlite extensions. This patch isn't needed for
-# python3.spec, since Python 3 has a configuration option for this.
-# rhbz#1066708
-# Patch provided by John C. Peterson
-Patch193: 00193-enable-loading-sqlite-extensions.patch
-
-# 00198 #
-%if 0%{with_rewheel}
-Patch198: 00198-add-rewheel-module.patch
-%endif
-
-# 00200 #
-# test_gdb.test_threads fails when run within rpmbuild
-# I couldnt reproduce the issue outside of rpmbuild, therefore
-# I skip test for now
-Patch200: 00200-skip-thread-test.patch
-
-# 00209 #
-# Fix test breakage with version 2.2.0 of Expat
-# rhbz#1353919:
https://bugzilla.redhat.com/show_bug.cgi?id=1353919
-# FIXED UPSTREAM:
http://bugs.python.org/issue27369
-Patch209: 00209-fix-test-pyexpat-failure.patch
-
-# 00242 #
-# HTTPoxy attack (CVE-2016-1000110)
-#
https://httpoxy.org/
-# FIXED UPSTREAM:
http://bugs.python.org/issue27568
-# Based on a patch by Rmi Rampin
-# Resolves: rhbz#1359175
-Patch242: 00242-CVE-2016-1000110-httpoxy.patch
-
-# 00247 #
-# Port ssl and hashlib modules to OpenSSL 1.1.0.
-# As of F26, OpenSSL is rebased to 1.1.0, so in order for python
-# to not FTBFS we need to backport this patch from 2.7.13
-# FIXED UPSTREAM:
https://bugs.python.org/issue26470
-Patch247: 00247-port-ssl-and-hashlib-to-OpenSSL-1.1.0.patch
-
-# (New patches go here ^^^)
-#
-# When adding new patches to "python" and "python3" in Fedora, EL,
etc.,
-# please try to keep the patch numbers in-sync between all specfiles.
-#
-# More information, and a patch number catalog, is at:
-#
-#
https://fedoraproject.org/wiki/SIGs/Python/PythonPatches
-
-# This is the generated patch to "configure"; see the description of
-# %{regenerate_autotooling_patch}
-# above:
-Patch5000: 05000-autotool-intermediates.patch
-
-# ======================================================
-# Additional metadata, and subpackages
-# ======================================================
-
-Provides: python = %{version}-%{release}
-Provides: python%{?_isa} = %{version}-%{release}
-Obsoletes: python < %{obs}
-
-# Providing python27 as now multiple interpreters exist in Fedora
-# alongside the system one e.g. python26, python33 etc
-Provides: python27 = %{version}-%{release}
-
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-
-URL:
http://www.python.org/
-
-%description
-Python is an interpreted, interactive, object-oriented programming
-language often compared to Tcl, Perl, Scheme or Java. Python includes
-modules, classes, exceptions, very high level dynamic data types and
-dynamic typing. Python supports interfaces to many system calls and
-libraries, as well as to various windowing systems (X11, Motif, Tk,
-Mac and MFC).
-
-Programmers can write new built-in modules for Python in C or C++.
-Python can be used as an extension language for applications that need
-a programmable interface.
-
-Note that documentation for Python is provided in the python-docs
-package.
-
-This package provides the "python" executable; most of the actual
-implementation is within the "python-libs" package.
-
-%package libs
-Summary: Runtime libraries for Python
-Group: Applications/System
-
-# Needed for ctypes, to load libraries, worked around for Live CDs size
-# Requires: binutils
-
-# expat 2.1.0 added the symbol XML_SetHashSalt without bumping SONAME. We use
-# this symbol (in pyexpat), so we must explicitly state this dependency to
-# prevent "import pyexpat" from failing with a linker error if someone
hasn't
-# yet upgraded expat:
-Requires: expat >= 2.1.0
-
-Provides: python-libs = %{version}-%{release}
-Provides: python-libs%{?_isa} = %{version}-%{release}
-Obsoletes: python-libs < %{obs}
-
-%description libs
-This package contains runtime libraries for use by Python:
-- the libpython dynamic library, for use by applications that embed Python as
-a scripting language, and by the main "python" executable
-- the Python standard library
-
-%package devel
-Summary: The libraries and header files needed for Python development
-Group: Development/Libraries
-Requires: %{python}%{?_isa} = %{version}-%{release}
-Requires: python-rpm-macros
-Requires: python2-rpm-macros
-Requires: pkgconfig
-# Needed here because of the migration of Makefile from -devel to the main
-# package
-Conflicts: %{python} < %{version}-%{release}
-
-Provides: python-devel = %{version}-%{release}
-Provides: python-devel%{?_isa} = %{version}-%{release}
-Obsoletes: python-devel < %{obs}
-
-%description devel
-The Python programming language's interpreter can be extended with
-dynamically loaded extensions and can be embedded in other programs.
-This package contains the header files and libraries needed to do
-these types of tasks.
-
-Install python-devel if you want to develop Python extensions. The
-python package will also need to be installed. You'll probably also
-want to install the python-docs package, which contains Python
-documentation.
-
-%package tools
-Summary: A collection of development tools included with Python
-Group: Development/Tools
-Requires: %{name} = %{version}-%{release}
-Requires: %{python}-tkinter = %{version}-%{release}
-
-Provides: python-tools = %{version}-%{release}
-Provides: python-tools%{?_isa} = %{version}-%{release}
-Obsoletes: python-tools < %{obs}
-
-%description tools
-This package includes several tools to help with the development of Python
-programs, including IDLE (an IDE with editing and debugging facilities), a
-color editor (pynche), and a python gettext program (pygettext.py).
-
-%package tkinter
-Summary: A graphical user interface for the Python scripting language
-Group: Development/Languages
-Requires: %{name} = %{version}-%{release}
-
-Provides: tkinter = %{version}-%{release}
-Provides: tkinter%{?_isa} = %{version}-%{release}
-Provides: tkinter2 = %{version}-%{release}
-Provides: tkinter2%{?_isa} = %{version}-%{release}
-Provides: python-tkinter = %{version}-%{release}
-Provides: python-tkinter%{?_isa} = %{version}-%{release}
-Obsoletes: tkinter < %{obs}
-
-%description tkinter
-
-The Tkinter (Tk interface) program is an graphical user interface for
-the Python scripting language.
-
-You should install the tkinter package if you'd like to use a graphical
-user interface for Python programming.
-
-%package test
-Summary: The test modules from the main python package
-Group: Development/Languages
-Requires: %{name} = %{version}-%{release}
-
-Provides: python-test = %{version}-%{release}
-Provides: python-test%{?_isa} = %{version}-%{release}
-Obsoletes: python-test < %{obs}
-
-%description test
-
-The test modules from the main python package: %{name}
-These have been removed to save space, as they are never or almost
-never used in production.
-
-You might want to install the python-test package if you're developing python
-code that uses more than just unittest and/or test_support.py.
-
-%if 0%{?with_debug_build}
-%package debug
-Summary: Debug version of the Python runtime
-Group: Applications/System
-
-# The debug build is an all-in-one package version of the regular build, and
-# shares the same .py/.pyc files and directories as the regular build. Hence
-# we depend on all of the subpackages of the regular build:
-Requires: %{name}%{?_isa} = %{version}-%{release}
-Requires: %{name}-libs%{?_isa} = %{version}-%{release}
-Requires: %{name}-devel%{?_isa} = %{version}-%{release}
-Requires: %{name}-test%{?_isa} = %{version}-%{release}
-Requires: %{python}-tkinter%{?_isa} = %{version}-%{release}
-Requires: %{name}-tools%{?_isa} = %{version}-%{release}
-
-Provides: python-debug = %{version}-%{release}
-Provides: python-debug%{?_isa} = %{version}-%{release}
-Obsoletes: python-debug < %{obs}
-
-%description debug
-python-debug provides a version of the Python runtime with numerous debugging
-features enabled, aimed at advanced Python users, such as developers of Python
-extension modules.
-
-This version uses more memory and will be slower than the regular Python build,
-but is useful for tracking down reference-counting issues, and other bugs.
-
-The bytecodes are unchanged, so that .pyc files are compatible between the two
-version of Python, but the debugging features mean that C/C++ extension modules
-are ABI-incompatible with those built for the standard runtime.
-
-It shares installation directories with the standard Python runtime, so that
-.py and .pyc files can be shared. All compiled extension modules gain a "_d"
-suffix ("foo_d.so" rather than "foo.so") so that each Python
implementation can
-load its own extensions.
-%endif # with_debug_build
-
-
-# ======================================================
-# The prep phase of the build:
-# ======================================================
-
-%prep
-%setup -q -n Python-%{version}
-
-%if 0%{?with_systemtap}
-# Provide an example of usage of the tapset:
-cp -a %{SOURCE4} .
-cp -a %{SOURCE5} .
-%endif # with_systemtap
-
-# Ensure that we're using the system copy of various libraries, rather than
-# copies shipped by upstream in the tarball:
-# Remove embedded copy of expat:
-rm -r Modules/expat || exit 1
-
-# Remove embedded copy of libffi:
-for SUBDIR in darwin libffi libffi_arm_wince libffi_msvc libffi_osx ; do
- rm -r Modules/_ctypes/$SUBDIR || exit 1 ;
-done
-
-# Remove embedded copy of zlib:
-rm -r Modules/zlib || exit 1
-
-## Disabling hashlib patch for now as it needs to be reimplemented
-## for OpenSSL 1.1.0.
-# Don't build upstream Python's implementation of these crypto algorithms;
-# instead rely on _hashlib and OpenSSL.
-#
-# For example, in our builds md5.py uses always uses hashlib.md5 (rather than
-# falling back to _md5 when hashlib.md5 is not available); hashlib.md5 is
-# implemented within _hashlib via OpenSSL (and thus respects FIPS mode)
-#for f in md5module.c md5.c shamodule.c sha256module.c sha512module.c; do
-# rm Modules/$f
-#done
-
-#
-# Apply patches:
-#
-%patch0 -p1 -b .rhconfig
-%patch1 -p1 -b .no_gui
-%patch4 -p1 -b .cflags
-%patch6 -p1 -b .plural
-%patch7 -p1
-
-%if "%{_lib}" == "lib64"
-%patch102 -p1 -b .lib64
-%patch103 -p1 -b .lib64-sysconfig
-%patch104 -p1
-%endif
-
-%patch10 -p1 -b .binutils-no-dep
-%patch13 -p1 -b .socketmodule
-%patch14 -p1 -b .socketmodule2
-%patch16 -p1 -b .rpath
-%patch17 -p1 -b .distutils-rpath
-
-%if 0%{?with_systemtap}
-%patch55 -p1 -b .systemtap
-%endif
-
-%patch111 -p1 -b .no-static-lib
-
-%patch112 -p1 -b .debug-build
-
-%patch113 -p1 -b .more-configuration-flags
-
-%patch114 -p1 -b .statvfs-f-flag-constants
-
-
-%patch121 -p1
-%patch125 -p1 -b .less-verbose-COUNT_ALLOCS
-%patch128 -p1
-
-%patch130 -p1
-
-%ifarch ppc %{power64}
-%patch131 -p1
-%endif
-
-%patch132 -p1
-%patch133 -p1
-%patch134 -p1
-%patch135 -p1
-%patch136 -p1 -b .stdin-test
-%patch137 -p1
-%patch138 -p1
-%ifarch %{arm}
-%patch139 -p1
-%endif
-%ifarch %{sparc}
-%patch140 -p1
-%endif
-%patch141 -p1
-%patch142 -p1 -b .tty-fail
-%patch143 -p1 -b .tsc-on-ppc
-%if !%{with_gdbm}
-%patch144 -p1
-%endif
-#patch146 -p1
-%patch147 -p1
-%patch153 -p0
-%patch155 -p1
-%patch156 -p1
-%patch157 -p1
-%patch165 -p1
-mv Modules/cryptmodule.c Modules/_cryptmodule.c
-%patch167 -p1
-%patch168 -p1
-%patch169 -p1
-%patch170 -p1
-%patch173 -p1
-%patch174 -p1 -b .fix-for-usr-move
-%patch180 -p1
-%patch181 -p1
-%patch184 -p1
-%patch185 -p1
-%patch187 -p1
-%patch189 -p1
-%patch191 -p1
-%patch193 -p1
-%if 0%{with_rewheel}
-%patch198 -p1
-%endif
-%patch200 -p1
-%patch209 -p1
-%patch242 -p1
-%patch247 -p1
-
-
-# This shouldn't be necesarry, but is right now (2.2a3)
-find -name "*~" |xargs rm -f
-
-%if ! 0%{regenerate_autotooling_patch}
-# Normally we apply the patch to "configure"
-# We don't apply the patch if we're working towards regenerating it
-%patch5000 -p0 -b .autotool-intermediates
-%endif
-
-
-# ======================================================
-# Configuring and building the code:
-# ======================================================
-
-%build
-topdir=$(pwd)
-export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv"
-export CXXFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv"
-export CPPFLAGS="$(pkg-config --cflags-only-I libffi)"
-export OPT="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv"
-export LINKCC="gcc"
-export LDFLAGS="$RPM_LD_FLAGS"
-if pkg-config openssl ; then
- export CFLAGS="$CFLAGS $(pkg-config --cflags openssl)"
- export LDFLAGS="$LDFLAGS $(pkg-config --libs-only-L openssl)"
-fi
-# Force CC
-export CC=gcc
-
-%if 0%{regenerate_autotooling_patch}
-# If enabled, this code regenerates the patch to "configure", using a
-# local copy of autoconf-2.65, then exits the build
-#
-# The following assumes that the copy is installed to ~/autoconf-2.65/bin
-# as per these instructions:
-#
http://bugs.python.org/issue7997
-
-for f in pyconfig.h.in configure ; do
- cp $f $f.autotool-intermediates ;
-done
-
-# Rerun the autotools:
-PATH=~/autoconf-2.65/bin:$PATH autoconf
-autoheader
-
-# Regenerate the patch:
-gendiff . .autotool-intermediates > %{PATCH5000}
-
-
-# Exit the build
-exit 1
-%endif
-
-# Define a function, for how to perform a "build" of python for a given
-# configuration:
-BuildPython() {
- ConfName=$1
- BinaryName=$2
- SymlinkName=$3
- ExtraConfigArgs=$4
- PathFixWithThisBinary=$5
-
- ConfDir=build/$ConfName
-
- echo STARTING: BUILD OF PYTHON FOR CONFIGURATION: $ConfName - %{_bindir}/$BinaryName
- mkdir -p $ConfDir
-
- pushd $ConfDir
-
- # Use the freshly created "configure" script, but in the directory two
above:
- %global _configure $topdir/configure
-
-%configure \
- --enable-ipv6 \
- --enable-shared \
- --enable-unicode=%{unicode} \
- --with-dbmliborder=gdbm:ndbm:bdb \
- --with-system-expat \
- --with-system-ffi \
-%if 0%{?with_systemtap}
- --with-dtrace \
- --with-tapset-install-dir=%{tapsetdir} \
-%endif
-%if 0%{?with_valgrind}
- --with-valgrind \
-%endif
- $ExtraConfigArgs \
- %{nil}
-
-make EXTRA_CFLAGS="$CFLAGS" %{?_smp_mflags}
-
-# We need to fix shebang lines across the full source tree.
-#
-# We do this using the pathfix.py script, which requires one of the
-# freshly-built Python binaries.
-#
-# We use the optimized python binary, and make the shebangs point at that same
-# optimized python binary:
-if $PathFixWithThisBinary
-then
- LD_LIBRARY_PATH="$topdir/$ConfDir" ./$BinaryName \
- $topdir/Tools/scripts/pathfix.py \
- -i "/usr/bin/env $BinaryName" \
- $topdir
-fi
-
-# Rebuild with new python
-# We need a link to a versioned python in the build directory
-ln -s $BinaryName $SymlinkName
-LD_LIBRARY_PATH="$topdir/$ConfDir" PATH=$PATH:$topdir/$ConfDir make -s
EXTRA_CFLAGS="$CFLAGS" %{?_smp_mflags}
-
- popd
- echo FINISHED: BUILD OF PYTHON FOR CONFIGURATION: $ConfDir
-}
-
-# Use "BuildPython" to support building with different configurations:
-
-%if 0%{?with_debug_build}
-BuildPython debug \
- python-debug \
- python%{pybasever}-debug \
-%ifarch %{ix86} x86_64 ppc %{power64}
- "--with-pydebug --with-tsc --with-count-allocs --with-call-profile" \
-%else
- "--with-pydebug --with-count-allocs --with-call-profile" \
-%endif
- false
-%endif # with_debug_build
-
-BuildPython optimized \
- python \
- python%{pybasever} \
- "" \
- true
-
-
-# ======================================================
-# Installing the built code:
-# ======================================================
-
-%install
-topdir=$(pwd)
-rm -rf %{buildroot}
-mkdir -p %{buildroot}%{_prefix} %{buildroot}%{_mandir}
-
-# Clean up patched .py files that are saved as .lib64
-for f in distutils/command/install distutils/sysconfig; do
- rm -f Lib/$f.py.lib64
-done
-
-InstallPython() {
-
- ConfName=$1
- BinaryName=$2
- PyInstSoName=$3
-
- ConfDir=build/$ConfName
-
- echo STARTING: INSTALL OF PYTHON FOR CONFIGURATION: $ConfName - %{_bindir}/$BinaryName
- mkdir -p $ConfDir
-
- pushd $ConfDir
-
-make install DESTDIR=%{buildroot}
-
-# We install a collection of hooks for gdb that make it easier to debug
-# executables linked against libpython (such as /usr/lib/python itself)
-#
-# These hooks are implemented in Python itself
-#
-# gdb-archer looks for them in the same path as the ELF file, with a -gdb.py suffix.
-# We put them in the debuginfo package by installing them to e.g.:
-# /usr/lib/debug/usr/lib/libpython2.6.so.1.0.debug-gdb.py
-# (note that the debug path is /usr/lib/debug for both 32/64 bit)
-#
-# See
https://fedoraproject.org/wiki/Features/EasierPythonDebugging for more
-# information
-#
-# Initially I tried:
-# /usr/lib/libpython2.6.so.1.0-gdb.py
-# but doing so generated noise when ldconfig was rerun (rhbz:562980)
-#
-%if 0%{?with_gdb_hooks}
-DirHoldingGdbPy=%{_prefix}/lib/debug/%{_libdir}
-PathOfGdbPy=$DirHoldingGdbPy/$PyInstSoName.debug-gdb.py
-
-mkdir -p %{buildroot}$DirHoldingGdbPy
-cp $topdir/Tools/gdb/libpython.py %{buildroot}$PathOfGdbPy
-
-# Manually byte-compile the file, in case find-debuginfo.sh is run before
-# brp-python-bytecompile, so that the .pyc/.pyo files are properly listed in
-# the debuginfo manifest:
-LD_LIBRARY_PATH="$topdir/$ConfDir" $topdir/$ConfDir/$BinaryName \
- -c "import compileall; import sys;
compileall.compile_dir('%{buildroot}$DirHoldingGdbPy',
ddir='$DirHoldingGdbPy')"
-
-LD_LIBRARY_PATH="$topdir/$ConfDir" $topdir/$ConfDir/$BinaryName -O \
- -c "import compileall; import sys;
compileall.compile_dir('%{buildroot}$DirHoldingGdbPy',
ddir='$DirHoldingGdbPy')"
-%endif # with_gdb_hooks
-
- popd
-
- echo FINISHED: INSTALL OF PYTHON FOR CONFIGURATION: $ConfName
-}
-
-# Use "InstallPython" to support building with different configurations:
-
-# Install the "debug" build first, so that we can move some files aside
-%if 0%{?with_debug_build}
-InstallPython debug \
- python%{pybasever}-debug \
- %{py_INSTSONAME_debug}
-%endif # with_debug_build
-
-# Now the optimized build:
-InstallPython optimized \
- python%{pybasever} \
- %{py_INSTSONAME_optimized}
-
-
-# Fix the interpreter path in binaries installed by distutils
-# (which changes them by itself)
-# Make sure we preserve the file permissions
-for fixed in %{buildroot}%{_bindir}/pydoc; do
- sed 's,#!.*/python$,#!/usr/bin/env python%{pybasever},' $fixed > $fixed-
\
- && cat $fixed- > $fixed && rm -f $fixed-
-done
-
-# Junk, no point in putting in -test sub-pkg
-rm -f %{buildroot}/%{pylibdir}/idlelib/testcode.py*
-
-# don't include tests that are run at build time in the package
-# This is documented, and used: rhbz#387401
-if /bin/false; then
- # Move this to -test subpackage.
-mkdir save_bits_of_test
-for i in test_support.py __init__.py; do
- cp -a %{buildroot}/%{pylibdir}/test/$i save_bits_of_test
-done
-rm -rf %{buildroot}/%{pylibdir}/test
-mkdir %{buildroot}/%{pylibdir}/test
-cp -a save_bits_of_test/* %{buildroot}/%{pylibdir}/test
-fi
-
-# tools
-
-mkdir -p ${RPM_BUILD_ROOT}%{site_packages}
-
-#pynche
-install -p -m755 %{SOURCE7} ${RPM_BUILD_ROOT}%{_bindir}/pynche
-chmod 755 ${RPM_BUILD_ROOT}%{_bindir}/pynche
-rm -f Tools/pynche/*.pyw
-cp -rp Tools/pynche \
- ${RPM_BUILD_ROOT}%{site_packages}/
-
-mv Tools/pynche/README Tools/pynche/README.pynche
-
-#gettext
-install -m755 Tools/i18n/pygettext.py %{buildroot}%{_bindir}/
-install -m755 Tools/i18n/msgfmt.py %{buildroot}%{_bindir}/
-
-# Useful development tools
-install -m755 -d %{buildroot}%{tools_dir}/scripts
-install Tools/README %{buildroot}%{tools_dir}/
-install Tools/scripts/*py %{buildroot}%{tools_dir}/scripts/
-
-# Documentation tools
-install -m755 -d %{buildroot}%{doc_tools_dir}
-#install -m755 Doc/tools/mkhowto %{buildroot}%{doc_tools_dir}
-
-# Useful demo scripts
-install -m755 -d %{buildroot}%{demo_dir}
-cp -ar Demo/* %{buildroot}%{demo_dir}
-
-# Get rid of crap
-find %{buildroot}/ -name "*~"|xargs rm -f
-find %{buildroot}/ -name ".cvsignore"|xargs rm -f
-find %{buildroot}/ -name "*.bat"|xargs rm -f
-find . -name "*~"|xargs rm -f
-find . -name ".cvsignore"|xargs rm -f
-#zero length
-rm -f %{buildroot}%{pylibdir}/LICENSE.txt
-
-# Fix for bug #136654
-rm -f %{buildroot}%{pylibdir}/email/test/data/audiotest.au
%{buildroot}%{pylibdir}/test/audiotest.au
-
-# Fix bug #143667: python should own /usr/lib/python2.x on 64-bit machines
-%if "%{_lib}" == "lib64"
-install -d %{buildroot}/%{_prefix}/lib/python%{pybasever}/site-packages
-%endif
-
-# Make python-devel multilib-ready (bug #192747, #139911)
-%global _pyconfig32_h pyconfig-32.h
-%global _pyconfig64_h pyconfig-64.h
-
-%ifarch %{power64} s390x x86_64 ia64 alpha sparc64 aarch64 %{mips64} riscv64
-%global _pyconfig_h %{_pyconfig64_h}
-%else
-%global _pyconfig_h %{_pyconfig32_h}
-%endif
-
-%if 0%{?with_debug_build}
-%global PyIncludeDirs python%{pybasever} python%{pybasever}-debug
-%else
-%global PyIncludeDirs python%{pybasever}
-%endif
-
-for PyIncludeDir in %{PyIncludeDirs} ; do
- mv %{buildroot}%{_includedir}/$PyIncludeDir/pyconfig.h \
- %{buildroot}%{_includedir}/$PyIncludeDir/%{_pyconfig_h}
- cat > %{buildroot}%{_includedir}/$PyIncludeDir/pyconfig.h << EOF
-#include <bits/wordsize.h>
-
-#if __WORDSIZE == 32
-#include "%{_pyconfig32_h}"
-#elif __WORDSIZE == 64
-#include "%{_pyconfig64_h}"
-#else
-#error "Unknown word size"
-#endif
-EOF
-done
-ln -s ../../libpython%{pybasever}.so
%{buildroot}%{pylibdir}/config/libpython%{pybasever}.so
-
-# Fix for bug 201434: make sure distutils looks at the right pyconfig.h file
-# Similar for sysconfig: sysconfig.get_config_h_filename tries to locate
-# pyconfig.h so it can be parsed, and needs to do this at runtime in site.py
-# when python starts up.
-#
-# Split this out so it goes directly to the pyconfig-32.h/pyconfig-64.h
-# variants:
-sed -i -e "s/'pyconfig.h'/'%{_pyconfig_h}'/" \
- %{buildroot}%{pylibdir}/distutils/sysconfig.py \
- %{buildroot}%{pylibdir}/sysconfig.py
-
-# Ensure that the curses module was linked against libncursesw.so, rather than
-# libncurses.so (bug 539917)
-ldd %{buildroot}/%{dynload_dir}/_curses*.so \
- | grep curses \
- | grep libncurses.so && (echo "_curses.so linked against
libncurses.so" ; exit 1)
-
-# Ensure that the debug modules are linked against the debug libpython, and
-# likewise for the optimized modules and libpython:
-for Module in %{buildroot}/%{dynload_dir}/*.so ; do
- case $Module in
- *_d.so)
- ldd $Module | grep %{py_INSTSONAME_optimized} &&
- (echo Debug module $Module linked against optimized
%{py_INSTSONAME_optimized} ; exit 1)
-
- ;;
- *)
- ldd $Module | grep %{py_INSTSONAME_debug} &&
- (echo Optimized module $Module linked against debug
%{py_INSTSONAME_optimized} ; exit 1)
- ;;
- esac
-done
-
-#
-# Systemtap hooks:
-#
-%if 0%{?with_systemtap}
-# Install a tapset for this libpython into tapsetdir, fixing up the path to the
-# library:
-mkdir -p %{buildroot}%{tapsetdir}
-%ifarch %{power64} s390x x86_64 ia64 alpha sparc64 aarch64 %{mips64}
-%global libpython_stp_optimized libpython%{pybasever}-64.stp
-%global libpython_stp_debug libpython%{pybasever}-debug-64.stp
-%else
-%global libpython_stp_optimized libpython%{pybasever}-32.stp
-%global libpython_stp_debug libpython%{pybasever}-debug-32.stp
-%endif
-
-sed \
- -e "s|LIBRARY_PATH|%{_libdir}/%{py_INSTSONAME_optimized}|" \
- %{SOURCE3} \
- > %{buildroot}%{tapsetdir}/%{libpython_stp_optimized}
-
-%if 0%{?with_debug_build}
-sed \
- -e "s|LIBRARY_PATH|%{_libdir}/%{py_INSTSONAME_debug}|" \
- %{SOURCE3} \
- > %{buildroot}%{tapsetdir}/%{libpython_stp_debug}
-%endif # with_debug_build
-%endif # with_systemtap
-
-# Make library-files user writable
-/usr/bin/chmod 755 %{buildroot}%{dynload_dir}/*.so
-/usr/bin/chmod 755 %{buildroot}%{_libdir}/libpython%{pybasever}.so.1.0
-/usr/bin/chmod 755 %{buildroot}%{_libdir}/libpython%{pybasever}_d.so.1.0
-
-
-# ======================================================
-# Running the upstream test suite
-# ======================================================
-
-%check
-topdir=$(pwd)
-CheckPython() {
- ConfName=$1
- BinaryName=$2
- ConfDir=$(pwd)/build/$ConfName
-
- echo STARTING: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName
-
- # Note that we're running the tests using the version of the code in the
- # builddir, not in the buildroot.
-
- pushd $ConfDir
-
- EXTRATESTOPTS="--verbose"
-
-%ifarch s390 s390x %{power64} %{arm} aarch64 %{mips}
- EXTRATESTOPTS="$EXTRATESTOPTS -x test_gdb"
-%endif
-%ifarch %{mips64}
- EXTRATESTOPTS="$EXTRATESTOPTS -x test_ctypes"
-%endif
-
-%if 0%{?with_huntrleaks}
- # Try to detect reference leaks on debug builds. By default this means
- # running every test 10 times (6 to stabilize, then 4 to watch):
- if [ "$ConfName" = "debug" ] ; then
- EXTRATESTOPTS="$EXTRATESTOPTS --huntrleaks : "
- fi
-%endif
-
- # Run the upstream test suite, setting "WITHIN_PYTHON_RPM_BUILD" so that the
- # our non-standard decorators take effect on the relevant tests:
- # @unittest._skipInRpmBuild(reason)
- # @unittest._expectedFailureInRpmBuild
- WITHIN_PYTHON_RPM_BUILD= EXTRATESTOPTS="$EXTRATESTOPTS" make test
-
- popd
-
- echo FINISHED: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName
-
-}
-
-%if 0%{run_selftest_suite}
-
-# Check each of the configurations:
-%if 0%{?with_debug_build}
-CheckPython \
- debug \
- python%{pybasever}-debug
-%endif # with_debug_build
-CheckPython \
- optimized \
- python%{pybasever}
-
-%endif # run_selftest_suite
-
-
-# ======================================================
-# Cleaning up
-# ======================================================
-
-%clean
-rm -fr %{buildroot}
-
-
-# ======================================================
-# Scriptlets
-# ======================================================
-
-%post libs -p /sbin/ldconfig
-
-%postun libs -p /sbin/ldconfig
-
-
-
-%files
-%defattr(-, root, root, -)
-%{!?_licensedir:%global license %%doc}
-%license LICENSE
-%doc README
-%{_bindir}/pydoc*
-%{_bindir}/python
-%{_bindir}/%{python}
-%{_bindir}/python%{pybasever}
-%{_mandir}/*/*
-
-%files libs
-%defattr(-,root,root,-)
-%{!?_licensedir:%global license %%doc}
-%license LICENSE
-%doc README
-%dir %{pylibdir}
-%dir %{dynload_dir}
-
-%{dynload_dir}/_md5module.so
-%{dynload_dir}/_sha256module.so
-%{dynload_dir}/_sha512module.so
-%{dynload_dir}/_shamodule.so
-
-%{dynload_dir}/Python-%{version}-py%{pybasever}.egg-info
-%{dynload_dir}/_bisectmodule.so
-%{dynload_dir}/_bsddb.so
-%{dynload_dir}/_codecs_cn.so
-%{dynload_dir}/_codecs_hk.so
-%{dynload_dir}/_codecs_iso2022.so
-%{dynload_dir}/_codecs_jp.so
-%{dynload_dir}/_codecs_kr.so
-%{dynload_dir}/_codecs_tw.so
-%{dynload_dir}/_collectionsmodule.so
-%{dynload_dir}/_csv.so
-%{dynload_dir}/_ctypes.so
-%{dynload_dir}/_curses.so
-%{dynload_dir}/_curses_panel.so
-%{dynload_dir}/_elementtree.so
-%{dynload_dir}/_functoolsmodule.so
-%{dynload_dir}/_hashlib.so
-%{dynload_dir}/_heapq.so
-%{dynload_dir}/_hotshot.so
-%{dynload_dir}/_io.so
-%{dynload_dir}/_json.so
-%{dynload_dir}/_localemodule.so
-%{dynload_dir}/_lsprof.so
-%{dynload_dir}/_multibytecodecmodule.so
-%{dynload_dir}/_multiprocessing.so
-%{dynload_dir}/_randommodule.so
-%{dynload_dir}/_socketmodule.so
-%{dynload_dir}/_sqlite3.so
-%{dynload_dir}/_ssl.so
-%{dynload_dir}/_struct.so
-%{dynload_dir}/arraymodule.so
-%{dynload_dir}/audioop.so
-%{dynload_dir}/binascii.so
-%{dynload_dir}/bz2.so
-%{dynload_dir}/cPickle.so
-%{dynload_dir}/cStringIO.so
-%{dynload_dir}/cmathmodule.so
-%{dynload_dir}/_cryptmodule.so
-%{dynload_dir}/datetime.so
-%{dynload_dir}/dbm.so
-%{dynload_dir}/dlmodule.so
-%{dynload_dir}/fcntlmodule.so
-%{dynload_dir}/future_builtins.so
-%if %{with_gdbm}
-%{dynload_dir}/gdbmmodule.so
-%endif
-%{dynload_dir}/grpmodule.so
-%{dynload_dir}/imageop.so
-%{dynload_dir}/itertoolsmodule.so
-%{dynload_dir}/linuxaudiodev.so
-%{dynload_dir}/math.so
-%{dynload_dir}/mmapmodule.so
-%{dynload_dir}/nismodule.so
-%{dynload_dir}/operator.so
-%{dynload_dir}/ossaudiodev.so
-%{dynload_dir}/parsermodule.so
-%{dynload_dir}/pyexpat.so
-%{dynload_dir}/readline.so
-%{dynload_dir}/resource.so
-%{dynload_dir}/selectmodule.so
-%{dynload_dir}/spwdmodule.so
-%{dynload_dir}/stropmodule.so
-%{dynload_dir}/syslog.so
-%{dynload_dir}/termios.so
-%{dynload_dir}/timemodule.so
-%{dynload_dir}/timingmodule.so
-%{dynload_dir}/unicodedata.so
-%{dynload_dir}/xxsubtype.so
-%{dynload_dir}/zlibmodule.so
-
-%dir %{site_packages}
-%{site_packages}/README
-%{pylibdir}/*.py*
-%{pylibdir}/*.doc
-%{pylibdir}/wsgiref.egg-info
-%dir %{pylibdir}/bsddb
-%{pylibdir}/bsddb/*.py*
-%{pylibdir}/compiler
-%dir %{pylibdir}/ctypes
-%{pylibdir}/ctypes/*.py*
-%{pylibdir}/ctypes/macholib
-%{pylibdir}/curses
-%dir %{pylibdir}/distutils
-%{pylibdir}/distutils/*.py*
-%{pylibdir}/distutils/README
-%{pylibdir}/distutils/command
-%exclude %{pylibdir}/distutils/command/wininst-*.exe
-%dir %{pylibdir}/email
-%{pylibdir}/email/*.py*
-%{pylibdir}/email/mime
-%{pylibdir}/encodings
-%{pylibdir}/hotshot
-%{pylibdir}/idlelib
-%{pylibdir}/importlib
-%dir %{pylibdir}/json
-%{pylibdir}/json/*.py*
-%{pylibdir}/lib2to3
-%exclude %{pylibdir}/lib2to3/tests
-%{pylibdir}/logging
-%{pylibdir}/multiprocessing
-%{pylibdir}/plat-linux2
-%{pylibdir}/pydoc_data
-%dir %{pylibdir}/sqlite3
-%{pylibdir}/sqlite3/*.py*
-%dir %{pylibdir}/test
-%{pylibdir}/test/test_support.py*
-%{pylibdir}/test/__init__.py*
-%{pylibdir}/unittest
-%{pylibdir}/wsgiref
-%{pylibdir}/xml
-%if "%{_lib}" == "lib64"
-%attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}
-%attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}/site-packages
-%endif
-
-# "Makefile" and the config-32/64.h file are needed by
-# distutils/sysconfig.py:_init_posix(), so we include them in the libs
-# package, along with their parent directories (bug 531901):
-%dir %{pylibdir}/config
-%{pylibdir}/config/Makefile
-%dir %{_includedir}/python%{pybasever}
-%{_includedir}/python%{pybasever}/%{_pyconfig_h}
-
-%{_libdir}/%{py_INSTSONAME_optimized}
-%if 0%{?with_systemtap}
-%dir %(dirname %{tapsetdir})
-%dir %{tapsetdir}
-%{tapsetdir}/%{libpython_stp_optimized}
-%doc systemtap-example.stp pyfuntop.stp
-%endif
-
-%dir %{pylibdir}/ensurepip/
-%{pylibdir}/ensurepip/*.py*
-%exclude %{pylibdir}/ensurepip/_bundled
-
-%if 0%{?with_rewheel}
-%dir %{pylibdir}/ensurepip/rewheel/
-%{pylibdir}/ensurepip/rewheel/*.py*
-%endif
-
-
-%files devel
-%defattr(-,root,root,-)
-%{_libdir}/pkgconfig/python-%{pybasever}.pc
-%{_libdir}/pkgconfig/python.pc
-%{_libdir}/pkgconfig/python2.pc
-%{pylibdir}/config/*
-%exclude %{pylibdir}/config/Makefile
-%{pylibdir}/distutils/command/wininst-*.exe
-%{_includedir}/python%{pybasever}/*.h
-%exclude %{_includedir}/python%{pybasever}/%{_pyconfig_h}
-%doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit
-%{_bindir}/python-config
-%{_bindir}/python2-config
-%{_bindir}/python%{pybasever}-config
-%{_libdir}/libpython%{pybasever}.so
-
-%files tools
-%defattr(-,root,root,755)
-%doc Tools/pynche/README.pynche
-%{site_packages}/pynche
-%{_bindir}/smtpd*.py*
-%{_bindir}/2to3*
-%{_bindir}/idle*
-%{_bindir}/pynche*
-%{_bindir}/pygettext*.py*
-%{_bindir}/msgfmt*.py*
-%{tools_dir}
-%{demo_dir}
-%{pylibdir}/Doc
-
-%files tkinter
-%defattr(-,root,root,755)
-%{pylibdir}/lib-tk
-%{dynload_dir}/_tkinter.so
-
-%files test
-%defattr(-, root, root, -)
-%{pylibdir}/bsddb/test
-%{pylibdir}/ctypes/test
-%{pylibdir}/distutils/tests
-%{pylibdir}/email/test
-%{pylibdir}/json/tests
-%{pylibdir}/lib2to3/tests
-%{pylibdir}/sqlite3/test
-%{pylibdir}/test/*
-# These two are shipped in the main subpackage:
-%exclude %{pylibdir}/test/test_support.py*
-%exclude %{pylibdir}/test/__init__.py*
-%{dynload_dir}/_ctypes_test.so
-%{dynload_dir}/_testcapimodule.so
-
-
-# We don't bother splitting the debug build out into further subpackages:
-# if you need it, you're probably a developer.
-
-# Hence the manifest is the combination of analogous files in the manifests of
-# all of the other subpackages
-
-%if 0%{?with_debug_build}
-%files debug
-%defattr(-,root,root,-)
-
-# Analog of the core subpackage's files:
-%{_bindir}/python-debug
-%{_bindir}/%{python}-debug
-%{_bindir}/python%{pybasever}-debug
-
-# Analog of the -libs subpackage's files, with debug builds of the built-in
-# "extension" modules:
-
-%{dynload_dir}/_md5module_d.so
-%{dynload_dir}/_sha256module_d.so
-%{dynload_dir}/_sha512module_d.so
-%{dynload_dir}/_shamodule_d.so
-
-%{dynload_dir}/_bisectmodule_d.so
-%{dynload_dir}/_bsddb_d.so
-%{dynload_dir}/_codecs_cn_d.so
-%{dynload_dir}/_codecs_hk_d.so
-%{dynload_dir}/_codecs_iso2022_d.so
-%{dynload_dir}/_codecs_jp_d.so
-%{dynload_dir}/_codecs_kr_d.so
-%{dynload_dir}/_codecs_tw_d.so
-%{dynload_dir}/_collectionsmodule_d.so
-%{dynload_dir}/_csv_d.so
-%{dynload_dir}/_ctypes_d.so
-%{dynload_dir}/_curses_d.so
-%{dynload_dir}/_curses_panel_d.so
-%{dynload_dir}/_elementtree_d.so
-%{dynload_dir}/_functoolsmodule_d.so
-%{dynload_dir}/_hashlib_d.so
-%{dynload_dir}/_heapq_d.so
-%{dynload_dir}/_hotshot_d.so
-%{dynload_dir}/_io_d.so
-%{dynload_dir}/_json_d.so
-%{dynload_dir}/_localemodule_d.so
-%{dynload_dir}/_lsprof_d.so
-%{dynload_dir}/_multibytecodecmodule_d.so
-%{dynload_dir}/_multiprocessing_d.so
-%{dynload_dir}/_randommodule_d.so
-%{dynload_dir}/_socketmodule_d.so
-%{dynload_dir}/_sqlite3_d.so
-%{dynload_dir}/_ssl_d.so
-%{dynload_dir}/_struct_d.so
-%{dynload_dir}/arraymodule_d.so
-%{dynload_dir}/audioop_d.so
-%{dynload_dir}/binascii_d.so
-%{dynload_dir}/bz2_d.so
-%{dynload_dir}/cPickle_d.so
-%{dynload_dir}/cStringIO_d.so
-%{dynload_dir}/cmathmodule_d.so
-%{dynload_dir}/_cryptmodule_d.so
-%{dynload_dir}/datetime_d.so
-%{dynload_dir}/dbm_d.so
-%{dynload_dir}/dlmodule_d.so
-%{dynload_dir}/fcntlmodule_d.so
-%{dynload_dir}/future_builtins_d.so
-%if %{with_gdbm}
-%{dynload_dir}/gdbmmodule_d.so
-%endif
-%{dynload_dir}/grpmodule_d.so
-%{dynload_dir}/imageop_d.so
-%{dynload_dir}/itertoolsmodule_d.so
-%{dynload_dir}/linuxaudiodev_d.so
-%{dynload_dir}/math_d.so
-%{dynload_dir}/mmapmodule_d.so
-%{dynload_dir}/nismodule_d.so
-%{dynload_dir}/operator_d.so
-%{dynload_dir}/ossaudiodev_d.so
-%{dynload_dir}/parsermodule_d.so
-%{dynload_dir}/pyexpat_d.so
-%{dynload_dir}/readline_d.so
-%{dynload_dir}/resource_d.so
-%{dynload_dir}/selectmodule_d.so
-%{dynload_dir}/spwdmodule_d.so
-%{dynload_dir}/stropmodule_d.so
-%{dynload_dir}/syslog_d.so
-%{dynload_dir}/termios_d.so
-%{dynload_dir}/timemodule_d.so
-%{dynload_dir}/timingmodule_d.so
-%{dynload_dir}/unicodedata_d.so
-%{dynload_dir}/xxsubtype_d.so
-%{dynload_dir}/zlibmodule_d.so
-
-# No need to split things out the "Makefile" and the config-32/64.h file as we
-# do for the regular build above (bug 531901), since they're all in one package
-# now; they're listed below, under "-devel":
-
-%{_libdir}/%{py_INSTSONAME_debug}
-%if 0%{?with_systemtap}
-%dir %(dirname %{tapsetdir})
-%dir %{tapsetdir}
-%{tapsetdir}/%{libpython_stp_debug}
-%endif
-
-# Analog of the -devel subpackage's files:
-%dir %{pylibdir}/config-debug
-%{_libdir}/pkgconfig/python-%{pybasever}-debug.pc
-%{_libdir}/pkgconfig/python-debug.pc
-%{_libdir}/pkgconfig/python2-debug.pc
-%{pylibdir}/config-debug/*
-%{_includedir}/python%{pybasever}-debug/*.h
-%{_bindir}/python-debug-config
-%{_bindir}/python2-debug-config
-%{_bindir}/python%{pybasever}-debug-config
-%{_libdir}/libpython%{pybasever}_d.so
-
-# Analog of the -tools subpackage's files:
-# None for now; we could build precanned versions that have the appropriate
-# shebang if needed
-
-# Analog of the tkinter subpackage's files:
-%{dynload_dir}/_tkinter_d.so
-
-# Analog of the -test subpackage's files:
-%{dynload_dir}/_ctypes_test_d.so
-%{dynload_dir}/_testcapimodule_d.so
-
-%endif # with_debug_build
-
-# We put the debug-gdb.py file inside /usr/lib/debug to avoid noise from
-# ldconfig (rhbz:562980).
-#
-# The /usr/lib/rpm/redhat/macros defines the __debug_package macro to use
-# debugfiles.list, and it appears that everything below /usr/lib/debug and
-# (/usr/src/debug) gets added to this file (via LISTFILES) in
-# /usr/lib/rpm/find-debuginfo.sh
-#
-# Hence by installing it below /usr/lib/debug we ensure it is added to the
-# -debuginfo subpackage
-# (if it doesn't, then the rpmbuild ought to fail since the debug-gdb.py
-# payload file would be unpackaged)
-
-
-# ======================================================
-# Finally, the changelog:
-# ======================================================
-
-%changelog
-* Thu Oct 27 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-9
-- Rename package to python2 and also rename the subpackages accordingly
-- Provide and obsolete python and the respective subpackages to ensure a clean
-upgrade path
-- Remove old provides for packages that got into stdlib
-
-* Wed Oct 12 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-8
-- Port ssl and hashlib modules to OpenSSL 1.1.0
-- Drop hashlib patch for now
-- Add riscv64 arch to 64bit and no-valgrind arches
-
-* Thu Sep 29 2016 Miro Hronok <mhroncok(a)redhat.com> - 2.7.12-7
-- Provide python27
-
-* Fri Sep 02 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-6
-- Remove unversioned Obsoletes
-
-* Thu Sep 01 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-5
-- Rebase rewheel patch so it applies properly (rhbz#1372183)
-
-* Tue Aug 09 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-4
-- SPEC file cleanup
-- Removal of unapplied patches
-
-* Tue Aug 09 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-3
-- Fix for CVE-2016-1000110 HTTPoxy attack
-- SPEC file cleanup
-
-* Mon Aug 01 2016 Michal Toman <mtoman(a)fedoraproject.org> - 2.7.12-2
-- Build properly on MIPS
-
-* Fri Jul 15 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-1
-- Update to 2.7.12
-- Refactored patches: 10, 102, 112, 134, 153
-- Dropped patches: 166, 209, 210
-
-* Fri Jul 08 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.11-8
-- Refactor patch for properly fixing CVE-2016-5636
-
-* Fri Jul 08 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.11-7
-- Fix test_pyexpat failure with Expat version of 2.2.0
-
-* Thu Jun 16 2016 Tomas Orsava <torsava(a)redhat.com> - 2.7.11-6
-- Fix for: CVE-2016-0772 python: smtplib StartTLS stripping attack
-- Raise an error when STARTTLS fails
-- rhbz#1303647:
https://bugzilla.redhat.com/show_bug.cgi?id=1303647
-- rhbz#1346344:
https://bugzilla.redhat.com/show_bug.cgi?id=1346344
-- Fixed upstream:
https://hg.python.org/cpython/rev/b3ce713fb9be
-
-* Mon Jun 13 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.11-5
-- Added patch for fixing possible integer overflow and heap corruption in
zipimporter.get_data()
-
-* Thu Feb 04 2016 Fedora Release Engineering <releng(a)fedoraproject.org> - 2.7.11-4
-- Rebuilt for
https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
-
-* Wed Jan 13 2016 Orion Poplawski <orion(a)cora.nwra.com> - 2.7.11-3
-- Drop macros, require python/python2-rpm-macros
-
-* Wed Dec 30 2015 Orion Poplawski <orion(a)cora.nwra.com> - 2.7.11-2
-- Get ready for separate python-macros package
-
-* Tue Dec 15 2015 Robert Kuska <rkuska(a)redhat.com> - 2.7.11-1
-- Update to 2.7.11
-
-* Thu Oct 15 2015 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.10-11
-- provide/obsolete _isa packages in python_provide (#1271776)
-
-* Wed Sep 23 2015 Robert Kuska <rkuska(a)redhat.com> - 2.7.10-10
-- Revert the moving modules to python-tools because distutils uses lib2to3
-
-* Tue Sep 22 2015 Robert Kuska <rkuska(a)redhat.com> - 2.7.10-9
-- Move idlelib and lib2to3 modules to pythont-tools
-
-* Thu Sep 3 2015 Orion Poplawski <orion(a)cora.nwra.com> - 2.7.10-8
-- Fix quoting in %%python_provide macro
-
-* Thu Sep 3 2015 Orion Poplawski <orion(a)cora.nwra.com> - 2.7.10-7
-- Add obsoletes to %%python_provide macro to fix upgrade path
-- Fix python2- provides for python- packages in %%python_provide
-
-* Thu Jul 23 2015 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.10-6
-- python-macros: remove R on python (#1246036)
-
-* Wed Jul 22 2015 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.10-5
-- Include epoch in the python_provide macro fpc#534 (Slavek Kabrda)
-
-* Mon Jun 29 2015 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.10-4
-- correct python_provide macro to include version only when emiting provides
-
-* Thu Jun 25 2015 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.10-3
-- Add unversioned python-macros from fpc#281 and fpc#534
- and require it from python-devel
-- Make python-macros noarch
-
-* Wed Jun 17 2015 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.10-2
-- Make relocating Python by changing _prefix actually work
-Resolves: rhbz#1231801
-
-* Mon May 25 2015 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.10-1
-- Update to 2.7.10
-
-* Tue May 5 2015 Peter Robinson <pbrobinson(a)fedoraproject.org> 2.7.9-11
-- Disable test_gdb on aarch64 (rhbz#1196181), it joins all other non x86 arches
-
-* Wed Apr 15 2015 Robert Kuska <rkuska(a)redhat.com> - 2.7.9-10
-- Remove provides/obsolates for unittest2
-- Skip test_gdb on arm until rhbz#1196181 is resolved
-
-* Thu Mar 05 2015 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.9-9
-- Add proper rewheel Requires
-
-* Sat Feb 21 2015 Till Maas <opensource(a)till.name> - 2.7.9-8
-- Rebuilt for Fedora 23 Change
-
https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-...
-
-* Sat Feb 21 2015 Till Maas <opensource(a)till.name> - 2.7.9-7
-- Rebuilt for Fedora 23 Change
-
https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-...
-
-* Tue Feb 17 2015 Ville Skytt <ville.skytta(a)iki.fi> - 2.7.9-6
-- Own systemtap dirs (#710733)
-
-* Fri Feb 06 2015 Karsten Hopp <karsten(a)redhat.com> 2.7.9-5
-- disable test_gdb on ppc64* until rhbz#1132488 is really resolved
-
-* Tue Jan 20 2015 Slavek Kabrda <bkabrda(a)redhat.com> - 2.7.9-4
-- We need to provide both arch specific and noarch Provide for python2-devel
-in order not to break noarch builds.
-
-* Tue Jan 20 2015 Slavek Kabrda <bkabrda(a)redhat.com> - 2.7.9-3
-- Make python2-devel provide arch specific.
-Resolves: rhbz#1183530
-
-* Mon Jan 12 2015 Dan Hork <dan[at]danny.cz> - 2.7.9-2
-- build with valgrind on ppc64le
-- disable test_gdb on s390(x) until rhbz#1181034 is resolved
-
-* Thu Dec 11 2014 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.9-1
-- Update to 2.7.9
-- Refreshed patches: #55, #137, #146, #153, #156, #198
-- Dropped patches: #196, #197
-- New patch: #199
-- Added the rewheel module
-
-* Mon Nov 24 2014 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.8-10
-- Improve python2_version macros
-
-* Thu Nov 13 2014 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.8-9
-- Add python2_version_nodots macro
-
-* Mon Nov 10 2014 Slavek Kabrda <bkabrda(a)redhat.com> - 2.7.8-8
-- Revert previous change, see rhbz#1161166#c6.
-
-* Fri Nov 07 2014 Slavek Kabrda <bkabrda(a)redhat.com> - 2.7.8-7
-- Provide importable unittest2
-Resolves: rhbz#1161166
-
-* Thu Aug 21 2014 Robert Kuska <rkuska(a)redhat.com> - 2.7.8-6
-- Update patch 196 (ssl backport)
-
-* Tue Aug 19 2014 Robert Kuska <rkuska(a)redhat.com> - 2.7.8-5
-- Backport ssl module from python3
-
-* Sun Aug 17 2014 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.7.8-4
-- Rebuilt for
https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
-
-* Thu Jul 31 2014 Tom Callaway <spot(a)fedoraproject.org> - 2.7.8-3
-- fix license handling
-
-* Fri Jul 18 2014 Robert Kuska <rkuska(a)redhat.com> - 2.7.8-2
-- Enable SSLv2 and SSLv3 when SSLv23_method is used in ssl
-
-* Mon Jul 14 2014 Robert Kuska <rkuska(a)redhat.com> - 2.7.8-1
-- Update to 2.7.8
-
-* Fri Jul 11 2014 Dan Hork <dan[at]danny.cz> - 2.7.7-3
-- rebuilt for updated libffi ABI on ppc64le
-
-* Sat Jun 7 2014 Peter Robinson <pbrobinson(a)fedoraproject.org> 2.7.7-2
-- aarch64 has valgrind, just list those that don't support it
-
-* Wed Jun 04 2014 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.7-1
-- Update to 2.7.7
-- Refreshed patches: #16, #112, #138, #147, #157, #166, #173, #5000
-- Dropped patches: #190, #192, #194
-
-* Tue Jun 03 2014 Dan Hork <dan[at]danny.cz> - 2.7.6-9
-- update the arch list where valgrind exists - %%power64 includes also
- ppc64le which is not supported yet
-
-* Wed May 21 2014 Jaroslav karvada <jskarvad(a)redhat.com> - 2.7.6-8
-- Rebuilt for
https://fedoraproject.org/wiki/Changes/f21tcl86
-
-* Fri May 09 2014 Tomas Radej <tradej(a)redhat.com> - 2.7.6-7
-- Fixed obsoletes on ordereddict (bz #1095434)
-
-* Mon Apr 14 2014 Tomas Radej <tradej(a)redhat.com> - 2.7.6-6
-- Obsoletes python-ordereddict (bz #1085593, not precisely 1:1 replacement)
-
-* Mon Apr 07 2014 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.6-5
-- Fix test failure with SQLite > 3.8.4.
-- Obsolete/Provide python-unittest2
-Related: rhbz#1060426
-
-* Wed Feb 19 2014 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.6-4
-- Enable loading sqlite extensions.
-Resolves: rhbz#1066708
-
-* Mon Feb 10 2014 Tomas Radej <tradej(a)redhat.com> - 2.7.6-3
-- Fixed buffer overflow (upstream patch)
-Resolves: rhbz#1062375
-
-* Tue Feb 04 2014 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.6-2
-- Install macros in _rpmconfigdir.
-
-* Wed Jan 29 2014 Tomas Radej <tradej(a)redhat.com> - 2.7.6-1
-- Updated to v2.7.6
-- Freshened patches 102, 111, 112, 136, and 142
-- Dropped patches 186, 188 (both fixed upstream)
-
-* Wed Jan 15 2014 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.5-11
-- Make library-files user writable to get rid of
- Permission Denied in buildlog from debuginfo-packaging
-
-* Tue Jan 14 2014 Dennis Gilmore <dennis(a)ausil.us> - 2.7.5-10
-- enable valgrind support on 32 bit arm
-
-* Tue Nov 12 2013 Tomas Radej <tradej(a)redhat.com> - 2.7.5-9
-- Import get_python_version in bdist_rpm
-Resolves: rhbz#1029082
-
-* Tue Oct 08 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-8
-- Fix processing gdb py-bt command in eval calls.
-Resolves: rhbz#1008154
-
-* Tue Sep 03 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-7
-- Removed ancient Obsolete: python-sqlite2.
-
-* Mon Aug 26 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-6
-- Sync back/renumber patches to stay consistent with rhel.
-
-* Mon Aug 19 2013 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.5-5
-- Added fix for CVE-2013-4238 (rhbz#998430)
-
-* Sun Aug 04 2013 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.7.5-4
-- Rebuilt for
https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
-
-* Mon Jul 08 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-3
-- Fix build with libffi containing multilib wrapper for ffi.h (rhbz#979696).
-
-* Mon Jul 08 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-2
-- Obsolete PyXML as requested in rhbz#981137.
-
-* Thu May 16 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-1
-- Updated to Python 2.7.5.
-- Refreshed patches: 0 (config), 102 (lib64), 121 (add Modules to build path),
-153 (gdb test noise)
-- Dropped patches: 126, 127 (big endian issues, both fixed upstream),
-175 (configure -Wformat, fixed upstream)
-- Synced patch numbers with python3.spec.
-
-* Tue May 14 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.4-5
-- fix multilib issue in python-tools due to /usr/bin/pynche (source 7;
-rhbz#831437)
-
-* Thu May 02 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.4-4
-- Add patch that enables building on ppc64p7.
-
-* Mon Apr 22 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.4-3
-- Allow arbitrary timeout in Condition.wait (rhbz#917709).
-
-* Thu Apr 11 2013 Kalev Lember <kalevlember(a)gmail.com> - 2.7.4-2
-- Build with libdb 5.3 instead of libdb4
-- Refreshed patches: 0 (config), 102 (lib64)
-- Dropped patches: 54 (db4 version), 159 (db4 include path adjustment)
-
-* Mon Apr 08 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.4-1
-- Updated to Python 2.7.4.
-- Refreshed patches: 0 (config), 7 (sqlite encoding), 16 (rpath in config),
-55 (systemtap), 111 (no static lib), 112 (debug build), 113 (more
-configuration flags), 130 (add extension to python config), 134 (fix
-COUNT_ALLOCS in test_sys), 146 (haslib FIPS), 147 (add debug malloc stats),
-153 (fix gdb test noise), 157 (uid, gid overflow - fixed upstream, just
-keeping few more downstream tests), 165 (crypt module salt backport),
-175 (fix configure Wformat), 5000 (regenerated autotooling patch)
-- Dropped patches: 101 (lib64 regex; merged upstream), 171 (exception on
-missing /dev/urandom; merged upstream), 172 (poll for multiprocessing socket
-connection; merged upstream)
-
-* Mon Mar 25 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-35
-- fix gcc 4.8 incompatibility (rhbz#927358); regenerate autotool intermediates
-
-* Wed Mar 6 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-34
-- restrict scope of workaround for cmpi-bindings issue to avoid breaking
-in-tree running of test_sys and test_subprocess (rhbz#817554)
-
-* Wed Mar 6 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-33
-- add workaround for cmpi-bindings issue (rhbz#817554)
-
-* Mon Mar 4 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-32
-- add workaround for ENOPROTOOPT seen running selftests in Koji
-(rhbz#913732)
-
-* Mon Mar 4 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-31
-- remove config flag from /etc/rpm/macros.python2
-
-* Fri Feb 22 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-30
-- remove __debug_package macro from comment
-
-* Fri Feb 22 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-29
-- drop -b from application of patch 157 (uid/gid overflows)
-
-* Fri Feb 22 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-28
-- fix bogus dates in changelog
-
-* Thu Feb 21 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-27
-- port _multiprocessing.Connection.poll() to use the "poll" syscall, rather
-than "select", allowing large numbers of subprocesses (patch 172;
-rhbz#849992)
-
-* Thu Feb 21 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-26
-- raise correct exception in os.urandom() when /dev/urandom is missing
-(patch 171; rhbz#907383)
-
-* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-25
-- in debug builds, try to print repr() when a C-level assert fails in the
-garbage collector (typically indicating a reference-counting error somewhere
-else e.g in an extension module) (patch 170; rhbz#850013)
-
-* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-24
-- move lib2to3/tests from python-libs to python-test (rhbz#850056)
-
-* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-23
-- use SHA-256 rather than implicitly using MD5 within the challenge handling
-in multiprocessing.connection (patch 169; rhbz#879695)
-
-* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-22
-- fix a problem with distutils.sysconfig when CFLAGS is defined in the
-environment (patch 168; rhbz#849994)
-
-* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-21
-- don't run any stack navigation tests in test_gdb for optimized builds
-(patch 167; rhbz#912025)
-
-* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-20
-- s/cryptmodule/_cryptmodule/ in package payload (rhbz#835021)
-
-* Tue Feb 19 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-19
-- bulletproof the gdb debugging hooks against a failure seen in ARM builds
-(patch 166; rhbz#912025)
-- re-enable make check on ARM (rhbz#912025)
-
-* Tue Feb 19 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-18
-- backport pre-canned ways of salting a password to the "crypt" module from
3.3
-(rhbz#835021)
-
-* Tue Feb 19 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-17
-- remove "_default_patch_fuzz" directive to avoid patches being silently
-misapplied (refresh patch 1, patch 101, patch 102, patch 111, patch 121,
-patch 158; rename patch 1, patch 101, patch 121; apply patch 54 before the
-lib64 patches to avoid fuzz problems caused by the conditional application
-of the lib64 patches)
-
-* Mon Feb 18 2013 Peter Robinson <pbrobinson(a)fedoraproject.org> 2.7.3-16
-- disable make check on ARM for the moment until 912025 is fixed
-
-* Mon Feb 11 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-15
-- add aarch64 (rhbz#909783)
-
-* Thu Nov 29 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-14
-- add BR on bluez-libs-devel (rhbz#879720)
-
-* Thu Aug 9 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-13
-- remove f18 conditional from patch 159
-
-* Fri Jul 27 2012 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.7.3-12
-- Rebuilt for
https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
-
-* Tue Jul 17 2012 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.3-11
-- fix memory leak in module _hashlib (patch 158, rhbz#836285)
-- fix db4 include path for libdb4 package (f18 and above) (patch 159)
-
-* Tue Jun 26 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-10
-- fix missing include in uid/gid handling patch (patch 157; rhbz#830405)
-
-* Fri Jun 22 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-9
-- use rpm macro for power64 (rhbz#834653)
-
-* Tue May 15 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-8
-- update uid/gid handling to avoid int overflows seen with uid/gid
-values >= 2^31 on 32-bit architectures (patch 157; rhbz#697470)
-
-* Fri May 4 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-7
-- renumber autotools patch from 300 to 5000
-- specfile cleanups
-
-* Mon Apr 30 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-6
-- try again to fix test_gdb.py (patch 156; rhbz#817072)
-
-* Mon Apr 30 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-5
-- fix test_gdb.py (patch 156; rhbz#817072)
-
-* Fri Apr 20 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-4
-- avoid allocating thunks in ctypes unless absolutely necessary, to avoid
-generating SELinux denials on "import ctypes" and "import uuid" when
embedding
-Python within httpd (patch 155; rhbz#814391)
-
-* Thu Apr 19 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-3
-- add explicit version requirements on expat to avoid linkage problems with
-XML_SetHashSalt
-
-* Wed Apr 18 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-2
-- fix -config symlinks (patch 112; rhbz#813836)
-
-* Wed Apr 11 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-1
-- 2.7.3: refresh patch 102 (lib64); drop upstream patches 11 (ascii-to-lower),
-115 (pydoc robustness), 145 (linux2), 148 (gdbm magic values), 151 (deadlock
-in fork); refresh patch 112 (debug build); revise patch 127
-(test_structmember); fix test_gdb (patch 153); refresh patch 137 (distutils
-tests); add python2.pc to python-devel; regenerate the autotool intermediates
-patch (patch 300)
-
-* Sat Feb 25 2012 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.2-20
-- fix deadlock issue (#787712)
-
-* Fri Feb 17 2012 Toshio Kuratomi <toshio(a)fedoraproject.org> - 2.7.2-19
-- Obsolete python-sqlite2
-
-* Thu Nov 24 2011 Ville Skytt <ville.skytta(a)iki.fi> - 2.7.2-18
-- Build with $RPM_LD_FLAGS (#756862).
-- Use xz-compressed source tarball.
-
-* Wed Oct 26 2011 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.7.2-17
-- Rebuilt for glibc bug#747377
-
-* Fri Sep 30 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-16
-- re-enable gdbm (patch 148; rhbz#742242)
-
-* Fri Sep 16 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-15
-- add a sys._debugmallocstats() function (patch 147)
-
-* Wed Sep 14 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-14
-- support OpenSSL FIPS mode in _hashlib and hashlib; don't build the _md5 and
-_sha* modules, relying on _hashlib in hashlib, and thus within md5 etc
-(rhbz#563986; patch 146)
-
-* Wed Sep 14 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-13
-- force sys.platform to be "linux2" (patch 145)
-
-* Tue Sep 13 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-12
-- disable gdbm module to prepare for gdbm soname bump
-
-* Mon Sep 12 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-11
-- rename and renumber patches for consistency with python3.spec (55, 111, 113,
-114, 125, 131, 129 to 143)
-
-* Sat Sep 10 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-10
-- rewrite of "check", introducing downstream-only hooks for skipping specific
-cases in an rpmbuild (patch 132), and fixing/skipping failing tests in a more
-fine-grained manner than before (patches 104, 133-142)
-
-* Thu Sep 1 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-9
-- run selftests with "--verbose"
-- disable parts of test_io on ppc (rhbz#732998)
-
-* Tue Aug 23 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-8
-- add --extension-suffix option to python-config (patch 130; rhbz#732808)
-
-* Tue Aug 23 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-7
-- re-enable and fix the --with-tsc option on ppc64, and rework it on 32-bit
-ppc to avoid aliasing violations (patch 129; rhbz#698726)
-
-* Tue Aug 23 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-6
-- don't use --with-tsc on ppc64 debug builds (rhbz#698726)
-
-* Thu Aug 18 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-5
-- add rpm macros file (rhbz#731800)
-
-* Fri Jul 8 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-4
-- cleanup of BuildRequires; add comment headings to specfile sections
-
-* Wed Jun 22 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-3
-- reorganize test exclusions (test_openpty and test_pty seem to be failing on
-every arch, not just the explicitly-listed ones)
-
-* Mon Jun 13 2011 Dan Hork <dan[at]danny.cz> - 2.7.2-2
-- add s390(x) excluded tests
-
-* Mon Jun 13 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-1
-- 2.7.2; drop upstreamed patches: patch 122 (parallel make fix), patch 124
-(test_commands and SELinux), patch 130 (ppc preprocessor macro in debug
-build); patch 131 (decimal in Turkish locale); regenerate the autotool
-intermediates patch (patch 300)
-
-* Tue Jun 07 2011 Dennis Gilmore <dennis(a)ausil.us> - 2.7.1-9
-- fix sparc building by excluding failing tests RHBZ#711584
-
-* Mon May 23 2011 Peter Robinson <pbrobinson(a)gmail.com> - 2.7.1-8
-- fix compile on ARM by excluding failing tests on arm - RHBZ #706253
-
-* Tue Apr 12 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.1-7
-- fix "import decimal" in the Turkish locale (patch 131; rhbz#694928)
-
-* Wed Feb 09 2011 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.7.1-6
-- Rebuilt for
https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
-
-* Fri Jan 21 2011 Toshio Kuratomi <toshio(a)fedoraproject.org> - 2.7.1-5
-- Switch from setting OPT to setting EXTRA_CFLAGS so we don't overwrite the
- DNDEBUG flag
-
-* Fri Jan 7 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.1-4
-- for now, drop "obsoletes" of python-argparse, since it interracts badly with
-multilib (rhbz#667984)
-
-* Fri Jan 7 2011 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.1-3
-- obsolete/provide python-argparse (new in 2.7)
-
-* Thu Jan 6 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.1-2
-- fix the ppc build of the debug configuration (patch 130; rhbz#661510)
-
-* Thu Dec 23 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7.1-1
-- 2.7.1, reworking patch 0 (config), patch 102 (lib64); drop upstream
-patch 56 (cfgparse), patch 110 (ctypes/SELinux/noexecmem), patch 119 (expat
-compat), patch 123 (2to3 on "from itertools import *")
-- fix test_abc's test_cache_leak in the debug build (patch 128)
-- drop _weakref.so from manifest (_weakref became a core module in r84230)
-
-* Wed Sep 29 2010 jkeating - 2.7-13
-- Rebuilt for gcc bug 634757
-
-* Mon Sep 27 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-12
-- fix test_structmember on 64bit-bigendian (patch 127)
-
-* Fri Sep 24 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-11
-- fix dbm_contains on 64bit-bigendian (patch 126; rhbz#626756)
-
-* Thu Sep 16 2010 Toshio Kuratomi <toshio(a)fedoraproject.org> - 2.7-10
-- backport a patch to fix a change in behaviour in configparse.
-
-* Thu Sep 9 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-9
-- move most of the payload of the core package to the libs subpackage, given
-that the libs aren't meaningfully usable without the standard libraries
-
-* Wed Aug 18 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-8
-- add %%check section
-- update lib64 patch (patch 102) to fix expected output in test_site.py on
-64-bit systems
-- patch test_commands.py to work with SELinux (patch 124)
-- patch the debug build's usage of COUNT_ALLOCS to be less verbose (patch 125)
-
-* Mon Jul 26 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-7
-- fixup missing -lcrypt to "crypt" module in config patch (patch 0)
-
-* Mon Jul 26 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-6
-- re-enable systemtap
-- cherrypick upstream patch to 2to3 for "from itertools import *"
-traceback (patch 123)
-
-* Thu Jul 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-5
-- disable systemtap for now (dtrace is failing on startup due to the bug
-mentioned in 2.7-4)
-- provide relative path to python binary when running pathfix.py
-- fix parallel make (patch 122)
-
-* Thu Jul 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-4
-- fix reference to pyconfig.h in sysconfig that led to failure on startup if
-python-devel was not installed
-
-* Thu Jul 8 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-3
-- add patch to fixup the new sysconfig.py for our multilib support on
-64-bit (patch 103)
-
-* Thu Jul 8 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-2
-- add machinery for regenerating the "configure" script in the face of
-mismatching autoconf versions (patch 300)
-
-* Tue Jul 6 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-1
-- 2.7 final; drop alphatag
-- drop patch 117 (upstream), patch 120 (upstreamed)
-- fix the commented-out __python_ver from 26 to 27
-
-* Tue Jun 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-0.1.rc2
-- 2.7rc2
-- revert r79310 (patch 121)
-- remove modulator: upstream removed it in r78338
-- rename mathmodule(_d).so to math(_d).so in manifests (appears to be changed
-by r76861)
-- _bytesio(_d).so and _filesio(_d).so were consolidated into _io(_d).so in
-r73394 (upstream issue 6215)
-- use the gdb hooks from the upstream tarball, rather than keeping our own
-copy. The upstream version has some whitespace changes, a new write_repr for
-unicode objects, and various bulletproofings for being run on older gdbs
-
-* Tue Jun 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-0.1.rc1
-- 2.7rc1:
- - rework patches to apply against 2.7 (which among other changes has had a
-whitespace cleanup of the .c code): .rhconfig (patch0), .binutils-no-dep
-(patch10), .ascii-tolower (patch11), .socketmodule (patch13), .socketmodule2
-(patch14), .systemtap (patch55), .lib64 (patch102), .selinux (patch110),
-.no-static-lib (patch111), .debug-build (patch112), .statvfs-f-flag-constants
-(patch114), ..CVE-2010-2089 (patch117)
- - drop upstream patches: .expat (patch3), .brprpm (patch51), .valgrind
-(patch52), .db48 (patch53), .CVE-2010-1634 (patch 116), .CVE-2008-5983 (patch
-118)
-
-* Tue Jun 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-17
-- Stop python bailing out with an assertion failure when UnicodeDecodeErrors
-occur on very large buffers (patch 120, upstream issue 9058)
-
-* Mon Jun 21 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-16
-- Fix an incompatibility between pyexpat and the system expat-2.0.1 that led to
-a segfault running test_pyexpat.py (patch 119; upstream issue 9054)
-
-* Tue Jun 8 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-15
-- add a flag to make it easy to turn off the debug build when troubleshooting
-the rpm build
-
-* Sat Jun 5 2010 Dan Hork <dan[at]danny.cz> - 2.6.5-14
-- reading the timestamp counter is available only on some arches (see Python/ceval.c)
-- disable --with-valgrind on s390(x) arches
-
-* Fri Jun 4 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-13
-- ensure that the compiler is invoked with "-fwrapv" (rhbz#594819)
-- CVE-2010-1634: fix various integer overflow checks in the audioop
-module (patch 116)
-- CVE-2010-2089: further checks within the audioop module (patch 117)
-- CVE-2008-5983: the new PySys_SetArgvEx entry point from r81399 (patch 118)
-
-* Thu May 27 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-12
-- make "pydoc -k" more robust in the face of broken modules (rhbz:461419,
patch115)
-
-* Wed May 26 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-11
-- add flags for statvfs.f_flag to the constant list in posixmodule (i.e. "os")
-(patch 114)
-
-* Tue May 25 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-10
-- add configure-time support for COUNT_ALLOCS and CALL_PROFILE debug options
-(patch 113); enable them and the WITH_TSC option within the debug build
-
-* Tue May 18 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-9
-- build and install two different configurations of Python: debug and standard,
-packaging the debug build in a new "python-debug" subpackage (patch 112)
-
-* Tue May 4 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-8
-- don't delete wsgiref.egg-info (rhbz:588426)
-
-* Mon Apr 26 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-7
-- disable --with-valgrind on sparc arches
-
-* Mon Apr 12 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-6
-- move the "bdist_wininst" command's template .exe files from the core
package
-to the devel subpackage, to save space (rhbz:525469)
-- fix stray doublelisting of config directory wildcard in devel subpackage
-
-* Wed Mar 31 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-5
-- update python-gdb.py from v4 to v5 (improving performance and stability,
-adding commands)
-
-* Thu Mar 25 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-4
-- update python-gdb.py from v3 to v4 (fixing infinite recursion on reference
-cycles and tracebacks on bytes 0x80-0xff in strings, adding handlers for sets
-and exceptions)
-
-* Wed Mar 24 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-3
-- refresh gdb hooks to v3 (reworking how they are packaged)
-
-* Mon Mar 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-2
-- remove unnecessary arch-conditionality for patch 101
-
-* Fri Mar 19 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-1
-- update to 2.6.5:
http://www.python.org/download/releases/2.6.5/
-- replace our patch to compile against db4.8 with a patch from
-upstream (patch 53, from r78974); update patch 54 since part of it is now in
-that upstream patch
-- update patch 110 so that it still applies in the face of upstream r78380
-
-* Tue Mar 16 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-23
-- fixup distutils/unixccompiler.py to remove standard library path from
-rpath (patch 17)
-- delete DOS batch files
-
-* Fri Mar 12 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-22
-- add pyfuntop.stp; allow systemtap support to be disabled
-- remove trailing period from tkinter summary
-- don't own /usr/bin/python-config if you're not the main python
-
-* Thu Mar 11 2010 Marcela Malov <mmaslano(a)redhat.com> - 2.6.4-21
-- rebuild with new gdbm
-
-* Thu Feb 11 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-20
-- avoid having the "test" subdirectory and the files within it that are in the
-core subpackage also be owned by the test subpackage (rhbz:467588)
-
-* Wed Feb 10 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-19
-- revise the systemtap patch (patch 55:python-2.6.4-dtrace.patch) to the
-new version by mjw in attachment 390110 of rhbz:545179, as this should
-eliminate the performance penalty for the case where the probes aren't in
-use, and eliminate all architecture-specific code (rhbz:563541; except on
-sparc)
-
-* Tue Feb 9 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-18
-- add a systemtap tapset defining "python.function.entry" and
-"python.function.return" to make it easy to use the static probepoint within
-Python; add an example of using the tapset to the docs
-
-* Tue Feb 9 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-17
-- add systemtap static probes (wcohen; patch 55; rh bug #545179)
-- update some comments in specfile relating to gdb work
-- manually byte-compile the gdb.py file with the freshly-built python to ensure
-that .pyx and .pyo files make it into the debuginfo manifest if they are later
-byte-compiled after find-debuginfo.sh is run
-
-* Mon Feb 8 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-16
-- move the -gdb.py file from %%{_libdir}/INSTSONAME-gdb.py to
-%%{_prefix}/lib/debug/%%{_libdir}/INSTSONAME.debug-gdb.py to avoid noise from
-ldconfig (bug 562980), and which should also ensure it becomes part of the
-debuginfo subpackage, rather than the libs subpackage
-- introduce %%{py_SOVERSION} and %%{py_INSTSONAME} to reflect the upstream
-configure script, and to avoid fragile scripts that try to figure this out
-dynamically (e.g. for the -gdb.py change)
-
-* Mon Feb 8 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-15
-- work around bug 562906 by supplying a fixed version of pythondeps.sh
-- set %%{_python_bytecompile_errors_terminate_build} to 0 to prevent the broken
-test files from killing the build on buildroots where python is installed
-
-* Fri Feb 5 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-14
-- add gdb hooks for easier debugging
-
-* Fri Jan 29 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-13
-- document all patches, and remove the commented-out ones
-
-* Tue Jan 26 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-12
-- Address some of the issues identified in package review (bug 226342):
- - update libs requirement on base package to use %%{name} for consistency's
-sake
- - convert from backticks to $() syntax throughout
- - wrap value of LD_LIBRARY_PATH in quotes
- - convert "/usr/bin/find" requirement to "findutils"
- - remove trailing periods from summaries of -devel and -tools subpackages
- - fix spelling mistake in description of -test subpackage
- - convert usage of $$RPM_BUILD_ROOT to %%{buildroot} throughout, for
-stylistic consistency
- - supply dirmode arguments to defattr directives
-
-* Mon Jan 25 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-11
-- update python-2.6.2-config.patch to remove downstream customization of build
-of pyexpat and elementtree modules
-- add patch adapted from upstream (patch 3) to add support for building against
-system expat; add --with-system-expat to "configure" invocation
-- remove embedded copy of expat from source tree during "prep"
-
-* Mon Jan 25 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-10
-- introduce macros for 3 directories, replacing expanded references throughout:
-%%{pylibdir}, %%{dynload_dir}, %%{site_packages}
-- explicitly list all lib-dynload files, rather than dynamically gathering the
-payload into a temporary text file, so that we can be sure what we are
-shipping; remove now-redundant testing for presence of certain .so files
-- remove embedded copy of zlib from source tree before building
-
-* Mon Jan 25 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-9
-- change python-2.6.2-config.patch to remove our downstream change to curses
-configuration in Modules/Setup.dist, so that the curses modules are built using
-setup.py with the downstream default (linking against libncursesw.so, rather
-than libncurses.so), rather than within the Makefile; add a test to %%install
-to verify the dso files that the curses module is linked against the correct
-DSO (bug 539917; changes _cursesmodule.so -> _curses.so)
-
-* Fri Jan 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-8
-- rebuild (bug 556975)
-
-* Wed Jan 20 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-7
-- move lib2to3 from -tools subpackage to main package (bug 556667)
-
-* Mon Jan 18 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-6
-- patch Makefile.pre.in to avoid building static library (patch111, bug 556092)
-- split up the "configure" invocation flags onto individual lines
-
-* Fri Jan 15 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-5
-- replace usage of %%define with %%global
-- use the %%{_isa} macro to ensure that the python-devel dependency on python
-is for the correct multilib arch (#555943)
-- delete bundled copy of libffi to make sure we use the system one
-- replace references to /usr with %%{_prefix}; replace references to
-/usr/include with %%{_includedir}
-
-* Wed Dec 16 2009 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-4
-- automatically disable arena allocator when run under valgrind (upstream
-issue 2422; patch 52)
-- add patch from Josh Boyer containing diff against upstream PyBSDDB to make
-the bsddb module compile against db-4.8 (patch 53, #544275); bump the necessary
-version of db4-devel to 4.8
-- patch setup.py so that it searches for db-4.8, and enable debug output for
-said search; make Setup.dist use db-4.8 (patch 54)
-
-* Thu Nov 12 2009 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-3
-- fixup the build when __python_ver is set (Zach Sadecki; bug 533989); use
-pybasever in the files section
-
-* Thu Oct 29 2009 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-2
-- "Makefile" and the config-32/64.h file are needed by distutils/sysconfig.py
-_init_posix(), so we include them in the core package, along with their parent
-directories (bug 531901)
-
-* Mon Oct 26 2009 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-1
-- Update to 2.6.4
-
-* Fri Aug 21 2009 Tomas Mraz <tmraz(a)redhat.com> - 2.6.2-2
-- rebuilt with new openssl
-
-* Mon Jul 27 2009 James Antill <james.antill(a)redhat.com> - 2.6.2-1
-- Update to 2.6.2
-
-* Sun Jul 26 2009 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.6-11
-- Rebuilt for
https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
-
-* Sat Jul 4 2009 Jonathan Steffan <jsteffan(a)fedoraproject.org> - 2.6-10
-- Move python-config to devel subpackage (#506153)
-- Update BuildRoot for new standard
-
-* Sun Jun 28 2009 Jonathan Steffan <jsteffan(a)fedoraproject.org> - 2.6-9
-- Update python-tools description (#448940)
-
-* Wed Apr 15 2009 Ignacio Vazquez-Abrams <ivazqueznet+rpm(a)gmail.com> 2.6-8
-- Replace python-hashlib and python-uuid (#484715)
-
-* Tue Mar 17 2009 James Antill <james(a)fedoraproject.org> - 2.6-7
-- Use system libffi
-- Resolves: bug#490573
-- Fix SELinux execmem problems
-- Resolves: bug#488396
-
-* Thu Feb 26 2009 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.6-5
-- Rebuilt for
https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
-
-* Fri Jan 16 2009 Tomas Mraz <tmraz(a)redhat.com> - 2.6-4
-- rebuild with new openssl
-
-* Tue Jan 6 2009 James Antill <james.antill(a)redhat.com> - 2.6-3
-- Fix distutils generated rpms.
-- Resolves: bug#236535
-
-* Wed Dec 10 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm(a)gmail.com> - 2.6-2
-- Enable -lcrypt for cryptmodule
-
-* Fri Nov 28 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm(a)gmail.com> - 2.6-1
-- Update to 2.6
-
-* Tue Sep 30 2008 James Antill <james.antill(a)redhat.com> - 2.5.2-1
-- Move to 2.5.2
-- Fix CVE-2008-2316 hashlib overflow.
-
-* Thu Jul 17 2008 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-30
-- Fix up the build for new rpm
-- And actually build against db4-4.7 (#455170)
-
-* Thu Jul 10 2008 Tom "spot" Callaway <tcallawa(a)redhat.com> - 2.5.1-27
-- fix license tag
-- enable support for db4-4.7
-
-* Sun Jun 15 2008 James Antill <jantill(a)redhat.com> - 2.5.1-26
-- Fix sporadic listdir problem
-- Resolves: bug#451494
-
-* Mon Apr 7 2008 James Antill <jantill(a)redhat.com> - 2.5.1-25
-- Rebuild to re-gen autoconf file due to glibc change.
-- Resolves: bug#441003
-
-* Tue Mar 25 2008 James Antill <jantill(a)redhat.com> - 2.5.1-24
-- Add more constants to socketmodule
-
-* Sat Mar 8 2008 James Antill <jantill(a)redhat.com> - 2.5.1-22
-- Add constants to socketmodule
-- Resolves: bug#436560
-
-* Tue Feb 19 2008 Fedora Release Engineering <rel-eng(a)fedoraproject.org> -
2.5.1-22
-- Autorebuild for GCC 4.3
-
-* Sun Jan 13 2008 Tom "spot" Callaway <tcallawa(a)redhat.com> - 2.5.1-21
-- rebuild for new tk in rawhide
-
-* Mon Jan 7 2008 James Antill <jantill(a)redhat.com> - 2.5.1-20
-- Add valgrind support files, as doc, to python-devel
-- Relates: rhbz#418621
-- Add new API from 2.6, set_wakeup_fd ... use at own risk, presumably won't
-- change but I have no control to guarantee that.
-- Resolves: rhbz#427794
-- Add gdbinit support file, as doc, to python-devel
-
-* Fri Jan 4 2008 Tom "spot" Callaway <tcallawa(a)redhat.com> - 2.5.1-19
-- rebuild for new tcl/tk in rawhide
-
-* Fri Dec 7 2007 James Antill <jantill(a)redhat.com> - 2.5.1-18
-- Create a python-test sub-module, over 3MB of stuff noone wants.
-- Don't remove egginfo files, try this see what happens ... may revert.
-- Resolves: rhbz#414711
-
-* Mon Dec 3 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-17
-- rebuild for new libssl
-
-* Fri Nov 30 2007 James Antill <jantill(a)redhat.com> - 2.5.1-16
-- Fix pyconfig.h comment typo.
-- Add back test_support.py and the __init__.py file.
-- Resolves: rhbz#387401
-
-* Tue Oct 30 2007 James Antill <jantill(a)redhat.com> - 2.5.1-15
-- Do codec lowercase in C Locale.
-- Resolves: 207134 191096
-- Fix stupid namespacing in pysqlite, minimal upgrade to 2.3.3 pysqlite
-- Resolves: 263221
-
-* Wed Oct 24 2007 James Antill <jantill(a)redhat.com> - 2.5.1-14
-- Remove bintuils dep. for live CD ... add work around for ctypes
-
-* Mon Oct 22 2007 James Antill <jantill(a)redhat.com> - 2.5.1-13
-- Add tix buildprereq
-- Add tkinter patch
-- Resolves: #281751
-- Fix ctypes loading of libraries, add requires on binutils
-- Resolves: #307221
-- Possible fix for CVE-2007-4965 possible exploitable integer overflow
-- Resolves: #295971
-
-* Tue Oct 16 2007 Mike Bonnet <mikeb(a)redhat.com> - 2.5.1-12
-- fix marshalling of objects in xmlrpclib (python bug #1739842)
-
-* Fri Sep 14 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-11
-- fix encoding of sqlite .py files to work around weird encoding problem
- in Turkish (#283331)
-
-* Mon Sep 10 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-10
-- work around problems with multi-line plural specification (#252136)
-
-* Tue Aug 28 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-9
-- rebuild against new expat
-
-* Tue Aug 14 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-8
-- build against db4.6
-
-* Tue Aug 14 2007 Dennis Gilmore <dennis(a)ausil.us> - 2.5.1-7
-- add sparc64 to the list of archs for _pyconfig64_h
-
-* Fri Aug 10 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-6
-- fix ctypes again on some arches (Hans de Goede, #251637)
-
-* Fri Jul 6 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-5
-- link curses modules with ncursesw (#246385)
-
-* Wed Jun 27 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-4
-- fix _elementtree.so build (#245703)
-- ensure that extension modules we expect are actually built rather than
- having them silently fall out of the package
-
-* Tue Jun 26 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-3
-- link with system expat (#245703)
-
-* Thu Jun 21 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-2
-- rebuild to take advantage of hardlinking between identical pyc/pyo files
-
-* Thu May 31 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-1
-- update to python 2.5.1
-
-* Mon Mar 19 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-12
-- fix alpha build (#231961)
-
-* Tue Feb 13 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-11
-- tcl/tk was reverted; rebuild again
-
-* Thu Feb 1 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-10
-- rebuild for new tcl/tk
-
-* Tue Jan 16 2007 Miroslav Lichvar <mlichvar(a)redhat.com> - 2.5.3-9
-- link with ncurses
-
-* Sat Jan 6 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-8
-- fix extensions to use shared libpython (#219564)
-- all 64bit platforms need the regex fix (#122304)
-
-* Wed Jan 3 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-7
-- fix ctypes to not require execstack (#220669)
-
-* Fri Dec 15 2006 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-6
-- don't link against compat-db (Robert Scheck)
-
-* Wed Dec 13 2006 Jarod Wilson <jwilson(a)redhat.com> - 2.5.3-5
-- fix invalid assert in debug mode (upstream changeset 52622)
-
-* Tue Dec 12 2006 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-4
-- obsolete/provide python-ctypes (#219256)
-
-* Mon Dec 11 2006 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-3
-- fix atexit traceback with failed syslog logger (#218214)
-- split libpython into python-libs subpackage for multilib apps
- embedding python interpreters
-
-* Wed Dec 6 2006 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-2
-- disable installation of .egg-info files for now
-
-* Tue Dec 5 2006 Jeremy Katz <katzj(a)redhat.com>
-- support db 4.5
-- obsolete python-elementtree; since it requires some code tweaks, don't
- provide it
-- obsolete old python-sqlite; provide the version that's actually included
-
-* Mon Oct 30 2006 Jeremy Katz <katzj(a)redhat.com>
-- fix _md5 and _sha modules (Robert Sheck)
-- no longer provide optik compat; it's been a couple of years now
-- no longer provide the old shm module; if this is still needed, let's
- build it separately
-- no longer provide japanese codecs; should be a separate package
-
-* Mon Oct 23 2006 Jeremy Katz <katzj(a)redhat.com> - 2.5-0
-- update to 2.5.0 final
-
-* Fri Aug 18 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.99.c1
-- Updated to 2.5c1. Merged fixes from FC6 too:
-- Fixed bug #199373 (on some platforms CFLAGS is needed when linking)
-- Fixed bug #198971 (case conversion not locale safe in logging library)
-- Verified bug #201434 (distutils.sysconfig is confused by the change to make
- python-devel multilib friendly) is fixed upstream
-
-* Sun Jul 16 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.99.b2
-- Updated to 2.5b2 (which for comparison reasons is re-labeled 2.4.99.b2)
-
-* Fri Jun 23 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.99.b1
-- Updated to 2.5b1 (which for comparison reasons is re-labeled 2.4.99.b1)
-
-* Tue Jun 13 2006 Jeremy Katz <katzj(a)redhat.com> - 2.4.3-11.FC6
-- and fix it for real
-
-* Tue Jun 13 2006 Jeremy Katz <katzj(a)redhat.com> - 2.4.3-10.FC6
-- fix python-devel on ia64
-
-* Tue Jun 13 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-9
-- Fixed python-devel to be multilib friendly (bug #192747, #139911)
-
-* Tue Jun 13 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-8
-- Only copying mkhowto from the Docs - we don't need perl dependencies from
- python-tools.
-
-* Mon Jun 12 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-7
-- Fixed bug #121198 (webbrowser.py should use the user's preferences first)
-
-* Mon Jun 12 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-6
-- Fixed bug #192592 (too aggressive assertion fails) - SF#1257960
-- Fixed bug #167468 (Doc/tools not included) - added in the python-tools package
-
-* Thu Jun 8 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-5
-- Fixed bug #193484 (added pydoc in the main package)
-
-* Mon Jun 5 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-4
-- Added dist in the release
-
-* Mon May 15 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-3
-- rebuilt to fix broken libX11 dependency
-
-* Wed Apr 12 2006 Jeremy Katz <katzj(a)redhat.com> - 2.4.3-2
-- rebuild with new gcc to fix #188649
-
-* Thu Apr 6 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-1
-- Updated to 2.4.3
-
-* Fri Feb 10 2006 Jesse Keating <jkeating(a)redhat.com> - 2.4.2-3.2.1
-- bump again for double-long bug on ppc(64)
-
-* Fri Feb 10 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-3.2
-- rebuilt for newer tix
-
-* Tue Feb 07 2006 Jesse Keating <jkeating(a)redhat.com> - 2.4.2-3.1
-- rebuilt for new gcc4.1 snapshot and glibc changes
-
-* Fri Jan 20 2006 Mihai Ibanescu <misa(a)redhat.com> 2.4.2-3
-- fixed #136654 for another instance of audiotest.au
-
-* Fri Dec 09 2005 Jesse Keating <jkeating(a)redhat.com>
-- rebuilt
-
-* Sat Nov 19 2005 Bill Nottingham <notting(a)redhat.com> 2.4.2-2
-- fix build for modular X, remove X11R6 path references
-
-* Tue Nov 15 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.2-1
-- Upgraded to 2.4.2
-- BuildRequires autoconf
-
-* Wed Nov 9 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-16
-- Rebuilding against newer openssl.
-- XFree86-devel no longer exists
-
-* Mon Sep 26 2005 Peter Jones <pjones(a)redhat.com> 2.4.1-14
-- Once more -- this time, to fix -EPERM when you run it in a directory
- you can't read from.
-
-* Mon Sep 26 2005 Peter Jones <pjones(a)redhat.com> 2.4.1-13
-- So, 5 or 6 people have said it works for them with this patch...
-
-* Sun Sep 25 2005 Peter Jones <pjones(a)redhat.com> 2.4.1-12
-- Fixed bug #169159 (check for argc>0 and argv[0] == NULL, not just
- argv[0][0]='\0')
- Reworked the patch from -8 a bit more.
-
-* Fri Sep 23 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-10
-- Fixed bug #169159 (don't let python core dump if no arguments are passed in)
- Reworked the patch from -8 a bit more.
-
-* Thu Sep 22 2005 Peter Jones <pjones(a)redhat.com> 2.4.1-8
-- Fix bug #169046 more correctly.
-
-* Thu Sep 22 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-7
-- Fixed bug #169046 (realpath is unsafe); thanks to
- Peter Jones <pjones(a)redhat.com> and Arjan van de Ven <arjanv(a)redhat.com>
for
- diagnosing and the patch.
-
-* Tue Sep 20 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-4
-- Fixed bug #168655 (fixes for building as python24)
-
-* Tue Jul 26 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-3
-- Fixed bug #163435 (pynche doesn't start))
-
-* Wed Apr 20 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-2
-- Fixed bug #143667 (python should own /usr/lib/python* on 64-bit systems, for
- noarch packages)
-- Fixed bug #143419 (BuildRequires db4 is not versioned)
-
-* Wed Apr 6 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-1
-- updated to 2.4.1
-
-* Mon Mar 14 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4-6
-- building the docs from a different source rpm, to decouple bootstrapping
- python from having tetex installed
-
-* Fri Mar 11 2005 Dan Williams <dcbw(a)redhat.com> 2.4-5
-- Rebuild to pick up new libssl.so.5
-
-* Wed Feb 2 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4-4
-- Fixed security issue in SimpleXMLRPCServer.py (#146647)
-
-* Wed Jan 12 2005 Tim Waugh <twaugh(a)redhat.com> 2.4-3
-- Rebuilt for new readline.
-
-* Mon Dec 6 2004 Jeff Johnson <jbj(a)jbj.org> 2.4-2
-- db-4.3.21 returns DB_BUFFER_SMALL rather than ENOMEM (#141994).
-- add Provide: python(abi) = 2.4
-- include msgfmt/pygettext *.pyc and *.pyo from brp-python-bytecompile.
-
-* Fri Dec 3 2004 Mihai Ibanescu <misa(a)redhat.com> 2.4-1
-- Python-2.4.tar.bz2 (final)
-
-* Fri Nov 19 2004 Mihai Ibanescu <misa(a)redhat.com> 2.4-0.c1.1
-- Python-2.4c1.tar.bz2 (release candidate 1)
-
-* Thu Nov 11 2004 Jeff Johnson <jbj(a)jbj.org> 2.4-0.b2.4
-- rebuild against db-4.3.21.
-
-* Mon Nov 8 2004 Jeremy Katz <katzj(a)redhat.com> - 2.4-0.b2.3
-- fix the lib64 patch so that 64bit arches still look in /usr/lib/python...
-
-* Mon Nov 8 2004 Jeremy Katz <katzj(a)redhat.com> - 2.4-0.b2.2
-- cryptmodule still needs -lcrypt (again)
-
-* Thu Nov 4 2004 Mihai Ibanescu <misa(a)redhat.com> 2.4-0.b2.1
-- Updated to python 2.4b2 (and labeled it 2.4-0.b2.1 to avoid breaking rpm's
- version comparison)
-
-* Thu Nov 4 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-13
-- Fixed bug #138112 (python overflows stack buffer) - SF bug 105470
-
-* Tue Nov 2 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-12
-- Fixed bugs #131439 #136023 #137863 (.pyc/.pyo files had the buildroot added)
-
-* Tue Oct 26 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-11
-- Fixed bug #136654 (python has sketchy audio clip)
-
-* Tue Aug 31 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-10
-- Fixed bug #77418 (Demo dir not packaged)
-- More tweaking on #19347 (Moved Tools/ under /usr/lib/python2.3/Tools)
-
-* Fri Aug 13 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-8
-- Fixed bug #129769: Makefile in new python conflicts with older version found
- in old python-devel
-- Reorganized the spec file to get rid of the aspython2 define; __python_ver
- is more powerful.
-
-* Tue Aug 3 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-7
-- Including html documentation for non-i386 arches
-- Fixed #125362 (python-doc html files have japanese character encoding)
-- Fixed #128923 (missing dependency between python and python-devel)
-
-* Fri Jul 30 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-6
-- Fixed #128030 (help() not printing anything)
-- Fixed #125472 (distutils.sysconfig.get_python_lib() not returning the right
- path on 64-bit systems)
-- Fixed #127357 (building python as a shared library)
-- Fixed #19347 (including the contents of Tools/scripts/ in python-tools)
-
-* Tue Jun 15 2004 Elliot Lee <sopwith(a)redhat.com>
-- rebuilt
-
-* Tue Jun 8 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-3
-- Added an optik.py that provides the same interface from optparse for
- backward compatibility; obsoleting python-optik
-
-* Mon Jun 7 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-2
-- Patched bdist_rpm to allow for builds of multiple binary rpms (bug #123598)
-
-* Fri Jun 4 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-1
-- Updated to 2.3.4-1 with Robert Scheck's help (bug #124764)
-- Added BuildRequires: tix-devel (bug #124918)
-
-* Fri May 7 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.3-6
-- Correct fix for #122304 from upstream:
-
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=93184...
-
-* Thu May 6 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.3-4
-- Fix for bug #122304 : splitting the domain name fails on 64-bit arches
-- Fix for bug #120879 : including Makefile into the main package
-
-- Requires XFree86-devel instead of -libs (see bug #118442)
-
-* Tue Mar 16 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.3-3
-- Requires XFree86-devel instead of -libs (see bug #118442)
-
-* Tue Mar 02 2004 Elliot Lee <sopwith(a)redhat.com>
-- rebuilt
-
-* Fri Feb 13 2004 Elliot Lee <sopwith(a)redhat.com>
-- rebuilt
-
-* Fri Dec 19 2003 Jeff Johnson <jbj(a)jbj.org> 2.3.3-1
-- upgrade to 2.3.3.
-
-* Sat Dec 13 2003 Jeff Johnson <jbj(a)jbj.org> 2.3.2-9
-- rebuild against db-4.2.52.
-
-* Fri Dec 12 2003 Jeremy Katz <katzj(a)redhat.com> 2.3.2-8
-- more rebuilding for new tcl/tk
-
-* Wed Dec 3 2003 Jeff Johnson <jbj(a)jbj.org> 2.3.2-7.1
-- rebuild against db-4.2.42.
-
-* Fri Nov 28 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.2-7
-- rebuilt against newer tcl/tk
-
-* Mon Nov 24 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.2-6
-- added a Provides: python-abi
-
-* Wed Nov 12 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.2-5
-- force CC (#109268)
-
-* Sun Nov 9 2003 Jeremy Katz <katzj(a)redhat.com> 2.3.2-4
-- cryptmodule still needs -lcrypt
-
-* Wed Nov 5 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.2-2
-- Added patch for missing mkhowto
-
-* Thu Oct 16 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.2-1
-- Updated to 2.3.2
-
-* Thu Sep 25 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.1-1
-- 2.3.1 final
-
-* Tue Sep 23 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.1-0.8.RC1
-- Building the python 2.3.1 release candidate
-- Updated the lib64 patch
-
-* Wed Jul 30 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3-0.2
-- Building python 2.3
-- Added more BuildRequires
-- Updated the startup files for modulator and pynche; idle installs its own
- now.
-
-* Thu Jul 3 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.3-4
-- Rebuilt against newer db4 packages (bug #98539)
-
-* Mon Jun 9 2003 Elliot Lee <sopwith(a)redhat.com> 2.2.3-3
-- rebuilt
-
-* Sat Jun 7 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.3-2
-- Rebuilt
-
-* Fri Jun 6 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.3-1
-- Upgraded to 2.2.3
-
-* Wed Apr 2 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-28
-- Rebuilt
-
-* Wed Apr 2 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-27
-- Modified the ftpuri patch conforming to
http://ietf.org/rfc/rfc1738.txt
-
-* Mon Feb 24 2003 Elliot Lee <sopwith(a)redhat.com>
-- rebuilt
-
-* Mon Feb 24 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-25
-- Fixed bug #84886: pydoc dies when run w/o arguments
-- Fixed bug #84205: add python shm module back (used to be shipped with 1.5.2)
-- Fixed bug #84966: path in byte-compiled code still wrong
-
-* Thu Feb 20 2003 Jeremy Katz <katzj(a)redhat.com> 2.2.2-23
-- ftp uri's should be able to specify being rooted at the root instead of
- where you login via ftp (#84692)
-
-* Mon Feb 10 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-22
-- Using newer Japanese codecs (1.4.9). Thanks to
- Peter Bowen <pzb(a)datastacks.com> for pointing this out.
-
-* Thu Feb 6 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-21
-- Rebuild
-
-* Wed Feb 5 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-20
-- Release number bumped really high: turning on UCS4 (ABI compatibility
- breakage)
-
-* Fri Jan 31 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-13
-- Attempt to look both in /usr/lib64 and /usr/lib/python2.2/site-packages/:
- some work on python-2.2.2-lib64.patch
-
-* Thu Jan 30 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-12
-- Rebuild to incorporate the removal of .lib64 and - files.
-
-* Thu Jan 30 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-11.7.3
-- Fixed bug #82544: Errata removes most tools
-- Fixed bug #82435: Python 2.2.2 errata breaks redhat-config-users
-- Removed .lib64 and - files that get installed after we fix the multilib
- .py files.
-
-* Wed Jan 22 2003 Tim Powers <timp(a)redhat.com>
-- rebuilt
-
-* Wed Jan 15 2003 Jens Petersen <petersen(a)redhat.com> 2.2.2-10
-- rebuild to update tkinter's tcltk deps
-- convert changelog to utf-8
-
-* Tue Jan 7 2003 Nalin Dahyabhai <nalin(a)redhat.com> 2.2.2-9
-- rebuild
-
-* Fri Jan 3 2003 Nalin Dahyabhai <nalin(a)redhat.com>
-- pick up OpenSSL cflags and ldflags from pkgconfig if available
-
-* Thu Jan 2 2003 Jeremy Katz <katzj(a)redhat.com> 2.2.2-8
-- urllib2 didn't support non-anonymous ftp. add support based on how
- urllib did it (#80676, #78168)
-
-* Mon Dec 16 2002 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-7
-- Fix bug #79647 (Rebuild of SRPM fails if python isn't installed)
-- Added a bunch of missing BuildRequires found while fixing the
- above-mentioned bug
-
-* Tue Dec 10 2002 Tim Powers <timp(a)redhat.com> 2.2.2-6
-- rebuild to fix broken tcltk deps for tkinter
-
-* Fri Nov 22 2002 Mihai Ibanescu <misa(a)redhat.com>
-2.2.2-3.7.3
-- Recompiled for 7.3 (to fix the -lcrypt bug)
-- Fix for the spurious error message at the end of the build (build-requires
- gets confused by executable files starting with """"): make the
tests
- non-executable.
-
-* Wed Nov 20 2002 Mihai Ibanescu <misa(a)redhat.com>
-2.2.2-5
-- Fixed configuration patch to add -lcrypt when compiling cryptmodule.c
-
-2.2.2-4
-- Spec file change from Matt Wilson <msw(a)redhat.com> to disable linking
- with the C++ compiler.
-
-* Mon Nov 11 2002 Mihai Ibanescu <misa(a)redhat.com>
-2.2.2-3.*
-- Merged patch from Karsten Hopp <karsten(a)redhat.de> from 2.2.1-17hammer to
- use %%{_libdir}
-- Added XFree86-libs as BuildRequires (because of tkinter)
-- Fixed duplicate listing of plat-linux2
-- Fixed exclusion of lib-dynload/japanese
-- Added lib64 patch for the japanese codecs
-- Use setup magic instead of using tar directly on JapaneseCodecs
-
-* Tue Nov 5 2002 Mihai Ibanescu <misa(a)redhat.com>
-2.2.2-2
-- Fix #76912 (python-tools contains idle, which uses tkinter, but there is no
- requirement of tkinter from python-tools).
-- Fix #74013 (rpm is missing the /usr/lib/python2.2/test directory)
-
-* Mon Nov 4 2002 Mihai Ibanescu <misa(a)redhat.com>
-- builds as python2 require a different libdb
-- changed the buildroot name of python to match python2 builds
-
-* Fri Nov 1 2002 Mihai Ibanescu <misa(a)redhat.com>
-- updated python to 2.2.2 and adjusted the patches accordingly
-
-* Mon Oct 21 2002 Mihai Ibanescu <misa(a)redhat.com>
-- Fix #53930 (Python-2.2.1-buildroot-bytecode.patch)
-- Added BuildPrereq dependency on gcc-c++
-
-* Fri Aug 30 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-17
-- security fix for _execvpe
-
-* Tue Aug 13 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-16
-- Fix #71011,#71134, #58157
-
-* Wed Aug 7 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-15
-- Resurrect tkinter
-- Fix for distutils (#67671)
-- Fix #69962
-
-* Thu Jul 25 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-14
-- Obsolete tkinter/tkinter2 (#69838)
-
-* Tue Jul 23 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-13
-- Doc fixes (#53951) - not on alpha at the momemt
-
-* Mon Jul 8 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-12
-- fix pydoc (#68082)
-
-* Mon Jul 8 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-11
-- Add db4-devel as a BuildPrereq
-
-* Fri Jun 21 2002 Tim Powers <timp(a)redhat.com> 2.2.1-10
-- automated rebuild
-
-* Mon Jun 17 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-9
-- Add Japanese codecs (#66352)
-
-* Tue Jun 11 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-8
-- No more tkinter...
-
-* Wed May 29 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-7
-- Rebuild
-
-* Tue May 21 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-6
-- Add the email subcomponent (#65301)
-
-* Fri May 10 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-5
-- Rebuild
-
-* Thu May 02 2002 Than Ngo <than(a)redhat.com> 2.2.1-4
-- rebuild i new enviroment
-
-* Tue Apr 23 2002 Trond Eivind Glomsrd <teg(a)redhat.com>
-- Use ucs2, not ucs4, to avoid breaking tkinter (#63965)
-
-* Mon Apr 22 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-2
-- Make it use db4
-
-* Fri Apr 12 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-1
-- 2.2.1 - a bugfix-only release
-
-* Fri Apr 12 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-16
-- the same, but in builddirs - this will remove them from the
- docs package, which doesn't look in the buildroot for files.
-
-* Fri Apr 12 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-15
-- Get rid of temporary files and .cvsignores included
- in the tarball and make install
-
-* Fri Apr 5 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-14
-- Don't own lib-tk in main package, only in tkinter (#62753)
-
-* Mon Mar 25 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-13
-- rebuild
-
-* Mon Mar 25 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-12
-- rebuild
-
-* Fri Mar 1 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-11
-- Add a not to the Distutils obsoletes test (doh!)
-
-* Fri Mar 1 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-10
-- Rebuild
-
-* Mon Feb 25 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-9
-- Only obsolete Distutils when built as python
-
-* Thu Feb 21 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-8
-- Make files in /usr/bin install side by side with python 1.5 when
-- Drop explicit requirement of db4
- built as python2
-
-* Thu Jan 31 2002 Elliot Lee <sopwith(a)redhat.com> 2.2-7
-- Use version and pybasever macros to make updating easy
-- Use _smp_mflags macro
-
-* Tue Jan 29 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-6
-- Add db4-devel to BuildPrereq
-
-* Fri Jan 25 2002 Nalin Dahyabhai <nalin(a)redhat.com> 2.2-5
-- disable ndbm support, which is db2 in disguise (really interesting things
- can happen when you mix db2 and db4 in a single application)
-
-* Thu Jan 24 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-4
-- Obsolete subpackages if necesarry
-- provide versioned python2
-- build with db4
-
-* Wed Jan 16 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-3
-- Alpha toolchain broken. Disable build on alpha.
-- New openssl
-
-* Wed Dec 26 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-1
-- 2.2 final
-
-* Fri Dec 14 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.11c1
-- 2.2 RC 1
-- Don't include the _tkinter module in the main package - it's
- already in the tkiter packace
-- Turn off the mpzmodule, something broke in the buildroot
-
-* Wed Nov 28 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.10b2
-- Use -fPIC for OPT as well, in lack of a proper libpython.so
-
-* Mon Nov 26 2001 Matt Wilson <msw(a)redhat.com> 2.2-0.9b2
-- changed DESTDIR to point to / so that distutils will install dynload
- modules properly in the installroot
-
-* Fri Nov 16 2001 Matt Wilson <msw(a)redhat.com> 2.2-0.8b2
-- 2.2b2
-
-* Fri Oct 26 2001 Matt Wilson <msw(a)redhat.com> 2.2-0.7b1
-- python2ify
-
-* Fri Oct 19 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.5b1
-- 2.2b1
-
-* Sun Sep 30 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.4a4
-- 2.2a4
-- Enable UCS4 support
-- Enable IPv6
-- Provide distutils
-- Include msgfmt.py and pygettext.py
-
-* Fri Sep 14 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.3a3
-- Obsolete Distutils, which is now part of the main package
-- Obsolete python2
-
-* Thu Sep 13 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.2a3
-- Add docs, tools and tkinter subpackages, to match the 1.5 layout
-
-* Wed Sep 12 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.1a3
-- 2.2a3
-- don't build tix and blt extensions
-
-* Mon Aug 13 2001 Trond Eivind Glomsrd <teg(a)redhat.com>
-- Add tk and tix to build dependencies
-
-* Sat Jul 21 2001 Trond Eivind Glomsrd <teg(a)redhat.com>
-- 2.1.1 bugfix release - with a GPL compatible license
-
-* Fri Jul 20 2001 Trond Eivind Glomsrd <teg(a)redhat.com>
-- Add new build dependencies (#49753)
-
-* Tue Jun 26 2001 Nalin Dahyabhai <nalin(a)redhat.com>
-- build with -fPIC
-
-* Fri Jun 1 2001 Trond Eivind Glomsrd <teg(a)redhat.com>
-- 2.1
-- reorganization of file includes
-
-* Wed Dec 20 2000 Trond Eivind Glomsrd <teg(a)redhat.com>
-- fix the "requires" clause, it lacked a space causing problems
-- use %%{_tmppath}
-- don't define name, version etc
-- add the available patches from the Python home page
-
-* Fri Dec 15 2000 Matt Wilson <msw(a)redhat.com>
-- added devel subpackage
-
-* Fri Dec 15 2000 Matt Wilson <msw(a)redhat.com>
-- modify all files to use "python2.0" as the intrepter
-- don't build the Expat bindings
-- build against db1
-
-* Mon Oct 16 2000 Jeremy Hylton <jeremy(a)beopen.com>
-- updated for 2.0 final
-
-* Mon Oct 9 2000 Jeremy Hylton <jeremy(a)beopen.com>
-- updated for 2.0c1
-- build audioop, imageop, and rgbimg extension modules
-- include xml.parsers subpackage
-- add test.xml.out to files list
-
-* Thu Oct 5 2000 Jeremy Hylton <jeremy(a)beopen.com>
-- added bin/python2.0 to files list (suggested by Martin v. L?)
-
-* Tue Sep 26 2000 Jeremy Hylton <jeremy(a)beopen.com>
-- updated for release 1 of 2.0b2
-- use .bz2 version of Python source
-
-* Tue Sep 12 2000 Jeremy Hylton <jeremy(a)beopen.com>
-- Version 2 of 2.0b1
-- Make the package relocatable. Thanks to Suchandra Thapa.
-- Exclude Tkinter from main RPM. If it is in a separate RPM, it is
- easier to track Tk releases.
diff --git a/python2.spec b/python2.spec
new file mode 100644
index 0000000..13fe4d3
--- /dev/null
+++ b/python2.spec
@@ -0,0 +1,3519 @@
+# ======================================================
+# Conditionals and other variables controlling the build
+# ======================================================
+
+%global with_rewheel 1
+
+%global unicode ucs4
+
+%global python python2
+
+# Macro for using the version-release where python got
+# renamed to python2 at Fedora 26, in order to ensure clean upgrade path.
+# It should be removed along with the obsoletes at Fedora 28.
+%global obs 2.7.12-9
+
+%global pybasever 2.7
+%global pylibdir %{_libdir}/python%{pybasever}
+%global tools_dir %{pylibdir}/Tools
+%global demo_dir %{pylibdir}/Demo
+%global doc_tools_dir %{pylibdir}/Doc/tools
+%global dynload_dir %{pylibdir}/lib-dynload
+%global site_packages %{pylibdir}/site-packages
+
+# Python's configure script defines SOVERSION, and this is used in the Makefile
+# to determine INSTSONAME, the name of the libpython DSO:
+# LDLIBRARY='libpython$(VERSION).so'
+# INSTSONAME="$LDLIBRARY".$SOVERSION
+# We mirror this here in order to make it easier to add the -gdb.py hooks.
+# (if these get out of sync, the payload of the libs subpackage will fail
+# and halt the build)
+%global py_SOVERSION 1.0
+%global py_INSTSONAME_optimized libpython%{pybasever}.so.%{py_SOVERSION}
+%global py_INSTSONAME_debug libpython%{pybasever}_d.so.%{py_SOVERSION}
+
+%global with_debug_build 1
+
+# Disabled for now:
+%global with_huntrleaks 0
+
+%global with_gdb_hooks 1
+
+%global with_systemtap 1
+
+# some arches don't have valgrind so we need to disable its support on them
+%ifnarch s390 %{mips} riscv64
+%global with_valgrind 1
+%else
+%global with_valgrind 0
+%endif
+
+%global with_gdbm 1
+
+# Turn this to 0 to turn off the "check" phase:
+%global run_selftest_suite 1
+
+# Some of the files below /usr/lib/pythonMAJOR.MINOR/test (e.g. bad_coding.py)
+# are deliberately invalid, leading to SyntaxError exceptions if they get
+# byte-compiled.
+#
+# These errors are ignored by the normal python build, and aren't normally a
+# problem in the buildroots since /usr/bin/python isn't present.
+#
+# However, for the case where we're rebuilding the python srpm on a machine
+# that does have python installed we need to set this to avoid
+# brp-python-bytecompile treating these as fatal errors:
+#
+%global _python_bytecompile_errors_terminate_build 0
+
+# We need to get a newer configure generated out of configure.in for the following
+# patches:
+# patch 4 (CFLAGS)
+# patch 52 (valgrind)
+# patch 55 (systemtap)
+# patch 145 (linux2)
+#
+# For patch 55 (systemtap), we need to get a new header for configure to use
+#
+# configure.in requires autoconf-2.65, but the version in Fedora is currently
+# autoconf-2.66
+#
+# For now, we'll generate a patch to the generated configure script and
+# pyconfig.h.in on a machine that has a local copy of autoconf 2.65
+#
+# Instructions on obtaining such a copy can be seen at
+#
http://bugs.python.org/issue7997
+#
+# To make it easy to regenerate the patch, this specfile can be run in two
+# ways:
+# (i) regenerate_autotooling_patch 0 : the normal approach: prep the
+# source tree using a pre-generated patch to the "configure" script, and do a
+# full build
+# (ii) regenerate_autotooling_patch 1 : intended to be run on a developer's
+# workstation: prep the source tree without patching configure, then rerun a
+# local copy of autoconf-2.65, regenerate the patch, then exit, without doing
+# the rest of the build
+%global regenerate_autotooling_patch 0
+
+
+# ==================
+# Top-level metadata
+# ==================
+Summary: An interpreted, interactive, object-oriented programming language
+Name: %{python}
+# Remember to also rebase python-docs when changing this:
+Version: 2.7.12
+Release: 9%{?dist}
+License: Python
+Group: Development/Languages
+Requires: %{python}-libs%{?_isa} = %{version}-%{release}
+Provides: python-abi = %{pybasever}
+Provides: python(abi) = %{pybasever}
+
+
+# =======================
+# Build-time requirements
+# =======================
+
+# (keep this list alphabetized)
+
+BuildRequires: autoconf
+BuildRequires: bluez-libs-devel
+BuildRequires: bzip2
+BuildRequires: bzip2-devel
+
+# expat 2.1.0 added the symbol XML_SetHashSalt without bumping SONAME. We use
+# it (in pyexpat) in order to enable the fix in Python-2.7.3 for CVE-2012-0876:
+BuildRequires: expat-devel >= 2.1.0
+
+BuildRequires: findutils
+BuildRequires: gcc-c++
+%if %{with_gdbm}
+BuildRequires: gdbm-devel
+%endif
+BuildRequires: glibc-devel
+BuildRequires: gmp-devel
+BuildRequires: libdb-devel
+BuildRequires: libffi-devel
+BuildRequires: libGL-devel
+BuildRequires: libX11-devel
+BuildRequires: ncurses-devel
+BuildRequires: openssl-devel
+BuildRequires: pkgconfig
+BuildRequires: readline-devel
+BuildRequires: sqlite-devel
+
+%if 0%{?with_systemtap}
+BuildRequires: systemtap-sdt-devel
+# (this introduces a circular dependency, in that systemtap-sdt-devel's
+# /usr/bin/dtrace is a python script)
+%global tapsetdir /usr/share/systemtap/tapset
+%endif # with_systemtap
+
+BuildRequires: tar
+BuildRequires: tcl-devel
+BuildRequires: tix-devel
+BuildRequires: tk-devel
+
+%if 0%{?with_valgrind}
+BuildRequires: valgrind-devel
+%endif
+
+BuildRequires: zlib-devel
+
+%if 0%{?with_rewheel}
+BuildRequires: python2-setuptools
+BuildRequires: python2-pip
+
+Requires: python2-setuptools
+Requires: python2-pip
+%endif
+
+
+
+# =======================
+# Source code and patches
+# =======================
+
+Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz
+
+# Work around bug 562906 until it's fixed in rpm-build by providing a fixed
+# version of pythondeps.sh:
+Source2: pythondeps.sh
+%global __python_requires %{SOURCE2}
+
+# Systemtap tapset to make it easier to use the systemtap static probes
+# (actually a template; LIBRARY_PATH will get fixed up during install)
+# Written by dmalcolm; not yet sent upstream
+Source3: libpython.stp
+
+
+# Example systemtap script using the tapset
+# Written by wcohen, mjw, dmalcolm; not yet sent upstream
+Source4: systemtap-example.stp
+
+# Another example systemtap script that uses the tapset
+# Written by dmalcolm; not yet sent upstream
+Source5: pyfuntop.stp
+
+Source7: pynche
+
+# Modules/Setup.dist is ultimately used by the "makesetup" script to construct
+# the Makefile and config.c
+#
+# Upstream leaves many things disabled by default, to try to make it easy as
+# possible to build the code on as many platforms as possible.
+#
+# TODO: many modules can also now be built by setup.py after the python binary
+# has been built; need to assess if we should instead build things there
+#
+# We patch it downstream as follows:
+# - various modules are built by default by upstream as static libraries;
+# we built them as shared libraries
+# - build the "readline" module (appears to also be handled by setup.py now)
+# - enable the build of the following modules:
+# - array arraymodule.c # array objects
+# - cmath cmathmodule.c # -lm # complex math library functions
+# - math mathmodule.c # -lm # math library functions, e.g. sin()
+# - _struct _struct.c # binary structure packing/unpacking
+# - time timemodule.c # -lm # time operations and variables
+# - operator operator.c # operator.add() and similar goodies
+# - _weakref _weakref.c # basic weak reference support
+# - _testcapi _testcapimodule.c # Python C API test module
+# - _random _randommodule.c # Random number generator
+# - _collections _collectionsmodule.c # Container types
+# - itertools itertoolsmodule.c
+# - strop stropmodule.c
+# - _functools _functoolsmodule.c
+# - _bisect _bisectmodule.c # Bisection algorithms
+# - unicodedata unicodedata.c # static Unicode character database
+# - _locale _localemodule.c
+# - fcntl fcntlmodule.c # fcntl(2) and ioctl(2)
+# - spwd spwdmodule.c # spwd(3)
+# - grp grpmodule.c # grp(3)
+# - select selectmodule.c # select(2); not on ancient System V
+# - mmap mmapmodule.c # Memory-mapped files
+# - _csv _csv.c # CSV file helper
+# - _socket socketmodule.c # Socket module helper for socket(2)
+# - _ssl _ssl.c
+# - crypt cryptmodule.c -lcrypt # crypt(3)
+# - nis nismodule.c -lnsl # Sun yellow pages -- not everywhere
+# - termios termios.c # Steen Lumholt's termios module
+# - resource resource.c # Jeremy Hylton's rlimit interface
+# - audioop audioop.c # Operations on audio samples
+# - imageop imageop.c # Operations on images
+# - _md5 md5module.c md5.c
+# - _sha shamodule.c
+# - _sha256 sha256module.c
+# - _sha512 sha512module.c
+# - linuxaudiodev linuxaudiodev.c
+# - timing timingmodule.c
+# - _tkinter _tkinter.c tkappinit.c
+# - dl dlmodule.c
+# - gdbm gdbmmodule.c
+# - _bsddb _bsddb.c
+# - binascii binascii.c
+# - parser parsermodule.c
+# - cStringIO cStringIO.c
+# - cPickle cPickle.c
+# - zlib zlibmodule.c
+# - _multibytecodec cjkcodecs/multibytecodec.c
+# - _codecs_cn cjkcodecs/_codecs_cn.c
+# - _codecs_hk cjkcodecs/_codecs_hk.c
+# - _codecs_iso2022 cjkcodecs/_codecs_iso2022.c
+# - _codecs_jp cjkcodecs/_codecs_jp.c
+# - _codecs_kr cjkcodecs/_codecs_kr.c
+# - _codecs_tw cjkcodecs/_codecs_tw.c
+Patch0: python-2.7.1-config.patch
+
+# Removes the "-g" option from "pydoc", for some reason; I believe
+# (dmalcolm 2010-01-29) that this was introduced in this change:
+# - fix pydoc (#68082)
+# in 2.2.1-12 as a response to the -g option needing TkInter installed
+# (Red Hat Linux 8)
+# Not upstream
+Patch1: 00001-pydocnogui.patch
+
+# Add $(CFLAGS) to the linker arguments when linking the "python" binary
+# since some architectures (sparc64) need this (rhbz:199373).
+# Not yet filed upstream
+Patch4: python-2.5-cflags.patch
+
+# Work around a bug in Python' gettext module relating to the
"Plural-Forms"
+# header (rhbz:252136)
+# Related to upstream issues:
+#
http://bugs.python.org/issue1448060 and
http://bugs.python.org/issue1475523
+# though the proposed upstream patches are, alas, different
+Patch6: python-2.5.1-plural-fix.patch
+
+# This patch was listed in the changelog as:
+# * Fri Sep 14 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-11
+# - fix encoding of sqlite .py files to work around weird encoding problem
+# in Turkish (#283331)
+# A traceback attached to rhbz 244016 shows the problem most clearly: a
+# traceback on attempting to import the sqlite module, with:
+# "SyntaxError: encoding problem: with BOM (__init__.py, line 1)"
+# This seems to come from Parser/tokenizer.c:check_coding_spec
+# Our patch changes two source files within sqlite3, removing the
+# "coding: ISO-8859-1" specs and character E4 = U+00E4 =
+# LATIN SMALL LETTER A WITH DIAERESIS from in ghaering's surname.
+#
+# It may be that the conversion of "ISO-8859-1" to "iso-8859-1" is
thwarted
+# by the implementation of "tolower" in the Turkish locale; see:
+#
https://bugzilla.redhat.com/show_bug.cgi?id=191096#c9
+#
+# TODO: Not yet sent upstream, and appears to me (dmalcolm 2010-01-29) that
+# it may be papering over a symptom
+Patch7: python-2.5.1-sqlite-encoding.patch
+
+# FIXME: Lib/ctypes/util.py posix implementation defines a function
+# _get_soname(f). Upstreams's implementation of this uses objdump to read the
+# SONAME from a library; we avoid this, apparently to minimize space
+# requirements on the live CD:
+# (rhbz:307221)
+Patch10: 00010-2.7.12-binutils-no-dep.patch
+
+# Upstream as of Python 2.7.3:
+# Patch11: python-2.7rc1-codec-ascii-tolower.patch
+
+# Add various constants to the socketmodule (rhbz#436560):
+# TODO: these patches were added in 2.5.1-22 and 2.5.1-24 but appear not to
+# have been sent upstream yet:
+Patch13: python-2.7rc1-socketmodule-constants.patch
+Patch14: python-2.7rc1-socketmodule-constants2.patch
+
+# Remove an "-rpath $(LIBDIR)" argument from the linkage args in configure.in:
+# FIXME: is this for OSF, not Linux?
+Patch16: python-2.6-rpath.patch
+
+# Fixup distutils/unixccompiler.py to remove standard library path from rpath:
+# Adapted from Patch0 in ivazquez' python3000 specfile, removing usage of
+# super() as it's an old-style class
+Patch17: python-2.6.4-distutils-rpath.patch
+
+# 00055 #
+# Systemtap support: add statically-defined probe points
+# Patch based on upstream bug:
http://bugs.python.org/issue4111
+# fixed up by mjw and wcohen for 2.6.2, then fixed up by dmalcolm for 2.6.4
+# then rewritten by mjw (attachment 390110 of rhbz 545179), then reformatted
+# for 2.7rc1 by dmalcolm:
+Patch55: 00055-systemtap.patch
+
+# Only used when "%{_lib}" == "lib64"
+# Fixup various paths throughout the build and in distutils from "lib" to
"lib64",
+# and add the /usr/lib64/pythonMAJOR.MINOR/site-packages to sitedirs, in front of
+# /usr/lib/pythonMAJOR.MINOR/site-packages
+# Not upstream
+Patch102: 00102-2.7.12-lib64.patch
+
+# Python 2.7 split out much of the path-handling from distutils/sysconfig.py to
+# a new sysconfig.py (in r77704).
+# We need to make equivalent changes to that new file to ensure that the stdlib
+# and platform-specific code go to /usr/lib64 not /usr/lib, on 64-bit archs:
+Patch103: python-2.7-lib64-sysconfig.patch
+
+# 00104 #
+# Only used when "%{_lib}" == "lib64"
+# Another lib64 fix, for distutils/tests/test_install.py; not upstream:
+Patch104: 00104-lib64-fix-for-test_install.patch
+
+# 00111 #
+# Patch the Makefile.pre.in so that the generated Makefile doesn't try to build
+# a libpythonMAJOR.MINOR.a (bug 550692):
+# Downstream only: not appropriate for upstream
+Patch111: 00111-no-static-lib.patch
+
+# 00112 #
+# Patch to support building both optimized vs debug stacks DSO ABIs, sharing
+# the same .py and .pyc files, using "_d.so" to signify a debug build of an
+# extension module.
+#
+# Based on Debian's patch for the same,
+#
http://patch-tracker.debian.org/patch/series/view/python2.6/2.6.5-2/debug...
+#
+# (which was itself based on the upstream Windows build), but with some
+# changes:
+#
+# * Debian's patch to dynload_shlib.c looks for module_d.so, then module.so,
+# but this can potentially find a module built against the wrong DSO ABI. We
+# instead search for just module_d.so in a debug build
+#
+# * We remove this change from configure.in's build of the Makefile:
+# SO=$DEBUG_EXT.so
+# so that sysconfig.py:customize_compiler stays with shared_lib_extension='.so'
+# on debug builds, so that UnixCCompiler.find_library_file can find system
+# libraries (otherwise "make sharedlibs" fails to find system libraries,
+# erroneously looking e.g. for "libffi_d.so" rather than
"libffi.so")
+#
+# * We change Lib/distutils/command/build_ext.py:build_ext.get_ext_filename
+# to add the _d there, when building an extension. This way, "make
sharedlibs"
+# can build ctypes, by finding the sysmtem libffi.so (rather than failing to
+# find "libffi_d.so"), and builds the module as _ctypes_d.so
+#
+# * Similarly, update build_ext:get_libraries handling of Py_ENABLE_SHARED by
+# appending "_d" to the python library's name for the debug configuration
+#
+# * We modify Modules/makesetup to add the "_d" to the generated Makefile
+# rules for the various Modules/*.so targets
+#
+# This may introduce issues when building an extension that links directly
+# against another extension (e.g. users of NumPy?), but seems more robust when
+# searching for external libraries
+#
+# * We don't change Lib/distutils/command/build.py: build.build_purelib to
+# embed plat_specifier, leaving it as is, as pure python builds should be
+# unaffected by these differences (we'll be sharing the .py and .pyc files)
+#
+# * We introduce DEBUG_SUFFIX as well as DEBUG_EXT:
+# - DEBUG_EXT is used by ELF files (names and SONAMEs); it will be "_d"
for
+# a debug build
+# - DEBUG_SUFFIX is used by filesystem paths; it will be "-debug" for a
+# debug build
+#
+# Both will be empty in an optimized build. "_d" contains characters that
+# are valid ELF metadata, but this leads to various ugly filesystem paths (such
+# as the include path), and DEBUG_SUFFIX allows these paths to have more natural
+# names. Changing this requires changes elsewhere in the distutils code.
+#
+# * We add DEBUG_SUFFIX to PYTHON in the Makefile, so that the two
+# configurations build parallel-installable binaries with different names
+# ("python-debug" vs "python").
+#
+# * Similarly, we add DEBUG_SUFFIX within python-config and
+# python$(VERSION)-config, so that the two configuration get different paths
+# for these.
+#
+# See also patch 130 below
+#
+Patch112: 00112-2.7.12-debug-build.patch
+
+
+# 00113 #
+# Add configure-time support for the COUNT_ALLOCS and CALL_PROFILE options
+# described at
http://svn.python.org/projects/python/trunk/Misc/SpecialBuilds.txt
+# so that if they are enabled, they will be in that build's pyconfig.h, so that
+# extension modules will reliably use them
+# Not yet sent upstream
+Patch113: 00113-more-configuration-flags.patch
+
+# 00114 #
+# Add flags for statvfs.f_flag to the constant list in posixmodule (i.e. "os")
+# (rhbz:553020); partially upstream as
http://bugs.python.org/issue7647
+# Not yet sent upstream
+Patch114: 00114-statvfs-f_flag-constants.patch
+
+# Upstream r79310 removed the "Modules" directory from sys.path when Python is
+# running from the build directory on POSIX to fix a unit test (issue #8205).
+# This seems to have broken the compileall.py done in "make install": it
cannot
+# find shared library extension modules at this point in the build (sys.path
+# does not contain DESTDIR/usr/lib(64)/python-2.7/lib-dynload for some reason),
+# leading to the build failing with:
+# Traceback (most recent call last):
+# File
"/home/david/rpmbuild/BUILDROOT/python-2.7-0.1.rc2.fc14.x86_64/usr/lib64/python2.7/compileall.py",
line 17, in <module>
+# import struct
+# File
"/home/david/rpmbuild/BUILDROOT/python-2.7-0.1.rc2.fc14.x86_64/usr/lib64/python2.7/struct.py",
line 1, in <module>
+# from _struct import *
+# ImportError: No module named _struct
+# This patch adds the build Modules directory to build path.
+Patch121: 00121-add-Modules-to-build-path.patch
+
+# 00125 #
+# COUNT_ALLOCS is useful for debugging, but the upstream behaviour of always
+# emitting debug info to stdout on exit is too verbose and makes it harder to
+# use the debug build. Add a "PYTHONDUMPCOUNTS" environment variable which
+# must be set to enable the output on exit
+# Not yet sent upstream
+Patch125: 00125-less-verbose-COUNT_ALLOCS.patch
+
+# 2.7.1 (in r84230) added a test to test_abc which fails if python is
+# configured with COUNT_ALLOCS, which is the case for our debug build
+# (the COUNT_ALLOCS instrumentation keeps "C" alive).
+# Not yet sent upstream
+Patch128: python-2.7.1-fix_test_abc_with_COUNT_ALLOCS.patch
+
+# 00130 #
+# Add "--extension-suffix" option to python-config and python-debug-config
+# (rhbz#732808)
+#
+# This is adapted from 3.2's PEP-3149 support.
+#
+# Fedora's debug build has some non-standard features (see also patch 112
+# above), though largely shared with Debian/Ubuntu and Windows
+#
+# In particular, SO in the Makefile is currently always just ".so" for our
+# python 2 optimized builds, but for python 2 debug it should be '_d.so', to
+# distinguish the debug vs optimized ABI, following the pattern in the above
+# patch.
+#
+# Not yet sent upstream
+Patch130: python-2.7.2-add-extension-suffix-to-python-config.patch
+
+# 00131 #
+# The four tests in test_io built on top of check_interrupted_write_retry
+# fail when built in Koji, for ppc and ppc64; for some reason, the SIGALRM
+# handlers are never called, and the call to write runs to completion
+# (rhbz#732998)
+Patch131: 00131-disable-tests-in-test_io.patch
+
+# 00132 #
+# Add non-standard hooks to unittest for use in the "check" phase below, when
+# running selftests within the build:
+# @unittest._skipInRpmBuild(reason)
+# for tests that hang or fail intermittently within the build environment, and:
+# @unittest._expectedFailureInRpmBuild
+# for tests that always fail within the build environment
+#
+# The hooks only take effect if WITHIN_PYTHON_RPM_BUILD is set in the
+# environment, which we set manually in the appropriate portion of the "check"
+# phase below (and which potentially other python-* rpms could set, to reuse
+# these unittest hooks in their own "check" phases)
+Patch132: 00132-add-rpmbuild-hooks-to-unittest.patch
+
+# 00133 #
+# "dl" is deprecated, and test_dl doesn't work on 64-bit builds:
+Patch133: 00133-skip-test_dl.patch
+
+# 00134 #
+# Fix a failure in test_sys.py when configured with COUNT_ALLOCS enabled
+# Not yet sent upstream
+Patch134: 00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch
+
+# 00135 #
+# Skip "test_callback_in_cycle_resurrection" in a debug build, where it fails:
+# Not yet sent upstream
+Patch135: 00135-skip-test-within-test_weakref-in-debug-build.patch
+
+# 00136 #
+# Some tests try to seek on sys.stdin, but don't work as expected when run
+# within Koji/mock; skip them within the rpm build:
+Patch136: 00136-skip-tests-of-seeking-stdin-in-rpmbuild.patch
+
+# 00137 #
+# Some tests within distutils fail when run in an rpmbuild:
+Patch137: 00137-skip-distutils-tests-that-fail-in-rpmbuild.patch
+
+# 00138 #
+# Fixup some tests within distutils to work with how debug builds are set up:
+Patch138: 00138-fix-distutils-tests-in-debug-build.patch
+
+# 00139 #
+# ARM-specific: skip known failure in test_float:
+#
http://bugs.python.org/issue8265 (rhbz#706253)
+Patch139: 00139-skip-test_float-known-failure-on-arm.patch
+
+# 00140 #
+# Sparc-specific: skip known failure in test_ctypes:
+#
http://bugs.python.org/issue8314 (rhbz#711584)
+# which appears to be a libffi bug
+Patch140: 00140-skip-test_ctypes-known-failure-on-sparc.patch
+
+# 00141 #
+# Fix test_gc's test_newinstance case when configured with COUNT_ALLOCS:
+# Not yet sent upstream
+Patch141: 00141-fix-test_gc_with_COUNT_ALLOCS.patch
+
+# 00142 #
+# Some pty tests fail when run in mock (rhbz#714627):
+Patch142: 00142-skip-failing-pty-tests-in-rpmbuild.patch
+
+# 00143 #
+# Fix the --with-tsc option on ppc64, and rework it on 32-bit ppc to avoid
+# aliasing violations (rhbz#698726)
+# Sent upstream as
http://bugs.python.org/issue12872
+Patch143: 00143-tsc-on-ppc.patch
+
+# 00144 #
+# (Optionally) disable the gdbm module:
+Patch144: 00144-no-gdbm.patch
+
+# 00146 #
+# Support OpenSSL FIPS mode (e.g. when OPENSSL_FORCE_FIPS_MODE=1 is set)
+# - handle failures from OpenSSL (e.g. on attempts to use MD5 in a
+# FIPS-enforcing environment)
+# - add a new "usedforsecurity" keyword argument to the various digest
+# algorithms in hashlib so that you can whitelist a callsite with
+# "usedforsecurity=False"
+# (sent upstream for python 3 as
http://bugs.python.org/issue9216; this is a
+# backport to python 2.7; see RHEL6 patch 119)
+# - enforce usage of the _hashlib implementation: don't fall back to the _md5
+# and _sha* modules (leading to clearer error messages if fips selftests
+# fail)
+# - don't build the _md5 and _sha* modules; rely on the _hashlib implementation
+# of hashlib (for example, md5.py will use _hashlib's implementation of MD5,
+# if permitted by the FIPS setting)
+# (rhbz#563986)
+Patch146: 00146-hashlib-fips.patch
+
+# 00147 #
+# Add a sys._debugmallocstats() function
+# Based on patch 202 from RHEL 5's python.spec, with updates from rhbz#737198
+# Sent upstream as
http://bugs.python.org/issue14785
+Patch147: 00147-add-debug-malloc-stats.patch
+
+# 00153 #
+# Strip out lines of the form "warning: Unable to open ..." from gdb's
stderr
+# when running test_gdb.py; also cope with change to gdb in F17 onwards in
+# which values are printed as "v@entry" rather than just "v":
+# Not yet sent upstream
+Patch153: 00153-fix-test_gdb-noise.patch
+
+# 00155 #
+# Avoid allocating thunks in ctypes unless absolutely necessary, to avoid
+# generating SELinux denials on "import ctypes" and "import uuid"
when
+# embedding Python within httpd (rhbz#814391)
+Patch155: 00155-avoid-ctypes-thunks.patch
+
+# 00156 #
+# Recent builds of gdb will only auto-load scripts from certain safe
+# locations. Turn off this protection when running test_gdb in the selftest
+# suite to ensure that it can load our -gdb.py script (rhbz#817072):
+# Not yet sent upstream
+Patch156: 00156-gdb-autoload-safepath.patch
+
+# 00157 #
+# Update uid/gid handling throughout the standard library: uid_t and gid_t are
+# unsigned 32-bit values, but existing code often passed them through C long
+# values, which are signed 32-bit values on 32-bit architectures, leading to
+# negative int objects for uid/gid values >= 2^31 on 32-bit architectures.
+#
+# Introduce _PyObject_FromUid/Gid to convert uid_t/gid_t values to python
+# objects, using int objects where the value will fit (long objects otherwise),
+# and _PyArg_ParseUid/Gid to convert int/long to uid_t/gid_t, with -1 allowed
+# as a special case (since this is given special meaning by the chown syscall)
+#
+# Update standard library to use this throughout for uid/gid values, so that
+# very large uid/gid values are round-trippable, and -1 remains usable.
+# (rhbz#697470)
+Patch157: 00157-uid-gid-overflows.patch
+
+# 00165 #
+# Backport to Python 2 from Python 3.3 of improvements to the "crypt" module
+# adding precanned ways of salting a password (rhbz#835021)
+# Based on r88500 patch to py3k from Python 3.3
+# plus 6482dd1c11ed, 0586c699d467, 62994662676a, 74a1110a3b50, plus edits
+# to docstrings to note that this additional functionality is not standard
+# within 2.7
+Patch165: 00165-crypt-module-salt-backport.patch
+
+# 00167 #
+# Don't run any of the stack navigation tests in test_gdb when Python is
+# optimized, since there appear to be many different ways in which gdb can
+# fail to read the PyFrameObject* for arbitrary places in the callstack,
+# presumably due to compiler optimization (rhbz#912025)
+#
+# Not yet sent upstream
+Patch167: 00167-disable-stack-navigation-tests-when-optimized-in-test_gdb.patch
+
+# 00168 #
+# Update distutils.sysconfig so that if CFLAGS is defined in the environment,
+# when building extension modules, it is appended to the full compilation
+# flags from Python's Makefile, rather than instead reducing the compilation
+# flags to the subset within OPT and adding it to those.
+#
+# In particular, this should ensure that "-fno-strict-aliasing" is used by
+# "python setup.py build" even when CFLAGS is defined in the environment.
+#
+# (rhbz#849994)
+Patch168: 00168-distutils-cflags.patch
+
+# 00169 #
+# Use SHA-256 rather than implicitly using MD5 within the challenge handling
+# in multiprocessing.connection
+#
+# Sent upstream as
http://bugs.python.org/issue17258
+# (rhbz#879695)
+Patch169: 00169-avoid-implicit-usage-of-md5-in-multiprocessing.patch
+
+# 00170 #
+# In debug builds, try to print repr() when a C-level assert fails in the
+# garbage collector (typically indicating a reference-counting error
+# somewhere else e.g in an extension module)
+# Backported to 2.7 from a patch I sent upstream for py3k
+#
http://bugs.python.org/issue9263 (rhbz#614680)
+# hiding the proposed new macros/functions within gcmodule.c to avoid exposing
+# them within the extension API.
+# (rhbz#850013)
+Patch170: 00170-gc-assertions.patch
+
+# 00173 #
+# Workaround for ENOPROTOOPT seen in Koji within
+# test.test_support.bind_port()
+# (rhbz#913732)
+Patch173: 00173-workaround-ENOPROTOOPT-in-bind_port.patch
+
+# 00174 #
+# Workaround for failure to set up prefix/exec_prefix when running
+# an embededed libpython that sets Py_SetProgramName() to a name not
+# on $PATH when run from the root directory due to
+#
https://fedoraproject.org/wiki/Features/UsrMove
+# e.g. cmpi-bindings under systemd (rhbz#817554):
+Patch174: 00174-fix-for-usr-move.patch
+
+# 00180 #
+# Enable building on ppc64p7
+# Not appropriate for upstream, Fedora-specific naming
+Patch180: 00180-python-add-support-for-ppc64p7.patch
+
+# 00181 #
+# Allow arbitrary timeout for Condition.wait, as reported in
+#
https://bugzilla.redhat.com/show_bug.cgi?id=917709
+# Upstream doesn't want this:
http://bugs.python.org/issue17748
+# But we have no better solution downstream yet, and since there is
+# no API breakage, we apply this patch.
+# Doesn't apply to Python 3, where this is fixed otherwise and works.
+Patch181: 00181-allow-arbitrary-timeout-in-condition-wait.patch
+
+# 00184 #
+# Fix for
https://bugzilla.redhat.com/show_bug.cgi?id=979696
+# Fixes build of ctypes against libffi with multilib wrapper
+# Python recognizes ffi.h only if it contains "#define LIBFFI_H",
+# but the wrapper doesn't contain that, which makes the build fail
+# We patch this by also accepting "#define ffi_wrapper_h"
+Patch184: 00184-ctypes-should-build-with-libffi-multilib-wrapper.patch
+
+# 00185 #
+# Makes urllib2 honor "no_proxy" enviroment variable for "ftp:" URLs
+# when ftp_proxy is set
+Patch185: 00185-urllib2-honors-noproxy-for-ftp.patch
+
+# 00187 #
+# Add an explicit RPATH to pyexpat.so pointing at the directory
+# containing the system expat (which has the extra XML_SetHashSalt
+# symbol), to avoid an ImportError with a link error if there's an
+# LD_LIBRARY_PATH containing a "vanilla" build of expat (without the
+# symbol)
+Patch187: 00187-add-RPATH-to-pyexpat.patch
+
+# 00189 #
+# Fixes gdb py-bt command not to raise exception while processing
+# statements from eval
+# rhbz#1008154 (patch by Attila Fazekas)
+Patch189: 00189-gdb-py-bt-dont-raise-exception-from-eval.patch
+
+# 00191 #
+# Disabling NOOP test as it fails without internet connection
+Patch191: 00191-disable-NOOP.patch
+
+# 00193 #
+# Enable loading sqlite extensions. This patch isn't needed for
+# python3.spec, since Python 3 has a configuration option for this.
+# rhbz#1066708
+# Patch provided by John C. Peterson
+Patch193: 00193-enable-loading-sqlite-extensions.patch
+
+# 00198 #
+%if 0%{with_rewheel}
+Patch198: 00198-add-rewheel-module.patch
+%endif
+
+# 00200 #
+# test_gdb.test_threads fails when run within rpmbuild
+# I couldnt reproduce the issue outside of rpmbuild, therefore
+# I skip test for now
+Patch200: 00200-skip-thread-test.patch
+
+# 00209 #
+# Fix test breakage with version 2.2.0 of Expat
+# rhbz#1353919:
https://bugzilla.redhat.com/show_bug.cgi?id=1353919
+# FIXED UPSTREAM:
http://bugs.python.org/issue27369
+Patch209: 00209-fix-test-pyexpat-failure.patch
+
+# 00242 #
+# HTTPoxy attack (CVE-2016-1000110)
+#
https://httpoxy.org/
+# FIXED UPSTREAM:
http://bugs.python.org/issue27568
+# Based on a patch by Rmi Rampin
+# Resolves: rhbz#1359175
+Patch242: 00242-CVE-2016-1000110-httpoxy.patch
+
+# 00247 #
+# Port ssl and hashlib modules to OpenSSL 1.1.0.
+# As of F26, OpenSSL is rebased to 1.1.0, so in order for python
+# to not FTBFS we need to backport this patch from 2.7.13
+# FIXED UPSTREAM:
https://bugs.python.org/issue26470
+Patch247: 00247-port-ssl-and-hashlib-to-OpenSSL-1.1.0.patch
+
+# (New patches go here ^^^)
+#
+# When adding new patches to "python" and "python3" in Fedora, EL,
etc.,
+# please try to keep the patch numbers in-sync between all specfiles.
+#
+# More information, and a patch number catalog, is at:
+#
+#
https://fedoraproject.org/wiki/SIGs/Python/PythonPatches
+
+# This is the generated patch to "configure"; see the description of
+# %{regenerate_autotooling_patch}
+# above:
+Patch5000: 05000-autotool-intermediates.patch
+
+# ======================================================
+# Additional metadata, and subpackages
+# ======================================================
+
+Provides: python = %{version}-%{release}
+Provides: python%{?_isa} = %{version}-%{release}
+Obsoletes: python < %{obs}
+
+# Providing python27 as now multiple interpreters exist in Fedora
+# alongside the system one e.g. python26, python33 etc
+Provides: python27 = %{version}-%{release}
+
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+URL:
http://www.python.org/
+
+%description
+Python is an interpreted, interactive, object-oriented programming
+language often compared to Tcl, Perl, Scheme or Java. Python includes
+modules, classes, exceptions, very high level dynamic data types and
+dynamic typing. Python supports interfaces to many system calls and
+libraries, as well as to various windowing systems (X11, Motif, Tk,
+Mac and MFC).
+
+Programmers can write new built-in modules for Python in C or C++.
+Python can be used as an extension language for applications that need
+a programmable interface.
+
+Note that documentation for Python is provided in the python-docs
+package.
+
+This package provides the "python" executable; most of the actual
+implementation is within the "python-libs" package.
+
+%package libs
+Summary: Runtime libraries for Python
+Group: Applications/System
+
+# Needed for ctypes, to load libraries, worked around for Live CDs size
+# Requires: binutils
+
+# expat 2.1.0 added the symbol XML_SetHashSalt without bumping SONAME. We use
+# this symbol (in pyexpat), so we must explicitly state this dependency to
+# prevent "import pyexpat" from failing with a linker error if someone
hasn't
+# yet upgraded expat:
+Requires: expat >= 2.1.0
+
+Provides: python-libs = %{version}-%{release}
+Provides: python-libs%{?_isa} = %{version}-%{release}
+Obsoletes: python-libs < %{obs}
+
+%description libs
+This package contains runtime libraries for use by Python:
+- the libpython dynamic library, for use by applications that embed Python as
+a scripting language, and by the main "python" executable
+- the Python standard library
+
+%package devel
+Summary: The libraries and header files needed for Python development
+Group: Development/Libraries
+Requires: %{python}%{?_isa} = %{version}-%{release}
+Requires: python-rpm-macros
+Requires: python2-rpm-macros
+Requires: pkgconfig
+# Needed here because of the migration of Makefile from -devel to the main
+# package
+Conflicts: %{python} < %{version}-%{release}
+
+Provides: python-devel = %{version}-%{release}
+Provides: python-devel%{?_isa} = %{version}-%{release}
+Obsoletes: python-devel < %{obs}
+
+%description devel
+The Python programming language's interpreter can be extended with
+dynamically loaded extensions and can be embedded in other programs.
+This package contains the header files and libraries needed to do
+these types of tasks.
+
+Install python-devel if you want to develop Python extensions. The
+python package will also need to be installed. You'll probably also
+want to install the python-docs package, which contains Python
+documentation.
+
+%package tools
+Summary: A collection of development tools included with Python
+Group: Development/Tools
+Requires: %{name} = %{version}-%{release}
+Requires: %{python}-tkinter = %{version}-%{release}
+
+Provides: python-tools = %{version}-%{release}
+Provides: python-tools%{?_isa} = %{version}-%{release}
+Obsoletes: python-tools < %{obs}
+
+%description tools
+This package includes several tools to help with the development of Python
+programs, including IDLE (an IDE with editing and debugging facilities), a
+color editor (pynche), and a python gettext program (pygettext.py).
+
+%package tkinter
+Summary: A graphical user interface for the Python scripting language
+Group: Development/Languages
+Requires: %{name} = %{version}-%{release}
+
+Provides: tkinter = %{version}-%{release}
+Provides: tkinter%{?_isa} = %{version}-%{release}
+Provides: tkinter2 = %{version}-%{release}
+Provides: tkinter2%{?_isa} = %{version}-%{release}
+Provides: python-tkinter = %{version}-%{release}
+Provides: python-tkinter%{?_isa} = %{version}-%{release}
+Obsoletes: tkinter < %{obs}
+
+%description tkinter
+
+The Tkinter (Tk interface) program is an graphical user interface for
+the Python scripting language.
+
+You should install the tkinter package if you'd like to use a graphical
+user interface for Python programming.
+
+%package test
+Summary: The test modules from the main python package
+Group: Development/Languages
+Requires: %{name} = %{version}-%{release}
+
+Provides: python-test = %{version}-%{release}
+Provides: python-test%{?_isa} = %{version}-%{release}
+Obsoletes: python-test < %{obs}
+
+%description test
+
+The test modules from the main python package: %{name}
+These have been removed to save space, as they are never or almost
+never used in production.
+
+You might want to install the python-test package if you're developing python
+code that uses more than just unittest and/or test_support.py.
+
+%if 0%{?with_debug_build}
+%package debug
+Summary: Debug version of the Python runtime
+Group: Applications/System
+
+# The debug build is an all-in-one package version of the regular build, and
+# shares the same .py/.pyc files and directories as the regular build. Hence
+# we depend on all of the subpackages of the regular build:
+Requires: %{name}%{?_isa} = %{version}-%{release}
+Requires: %{name}-libs%{?_isa} = %{version}-%{release}
+Requires: %{name}-devel%{?_isa} = %{version}-%{release}
+Requires: %{name}-test%{?_isa} = %{version}-%{release}
+Requires: %{python}-tkinter%{?_isa} = %{version}-%{release}
+Requires: %{name}-tools%{?_isa} = %{version}-%{release}
+
+Provides: python-debug = %{version}-%{release}
+Provides: python-debug%{?_isa} = %{version}-%{release}
+Obsoletes: python-debug < %{obs}
+
+%description debug
+python-debug provides a version of the Python runtime with numerous debugging
+features enabled, aimed at advanced Python users, such as developers of Python
+extension modules.
+
+This version uses more memory and will be slower than the regular Python build,
+but is useful for tracking down reference-counting issues, and other bugs.
+
+The bytecodes are unchanged, so that .pyc files are compatible between the two
+version of Python, but the debugging features mean that C/C++ extension modules
+are ABI-incompatible with those built for the standard runtime.
+
+It shares installation directories with the standard Python runtime, so that
+.py and .pyc files can be shared. All compiled extension modules gain a "_d"
+suffix ("foo_d.so" rather than "foo.so") so that each Python
implementation can
+load its own extensions.
+%endif # with_debug_build
+
+
+# ======================================================
+# The prep phase of the build:
+# ======================================================
+
+%prep
+%setup -q -n Python-%{version}
+
+%if 0%{?with_systemtap}
+# Provide an example of usage of the tapset:
+cp -a %{SOURCE4} .
+cp -a %{SOURCE5} .
+%endif # with_systemtap
+
+# Ensure that we're using the system copy of various libraries, rather than
+# copies shipped by upstream in the tarball:
+# Remove embedded copy of expat:
+rm -r Modules/expat || exit 1
+
+# Remove embedded copy of libffi:
+for SUBDIR in darwin libffi libffi_arm_wince libffi_msvc libffi_osx ; do
+ rm -r Modules/_ctypes/$SUBDIR || exit 1 ;
+done
+
+# Remove embedded copy of zlib:
+rm -r Modules/zlib || exit 1
+
+## Disabling hashlib patch for now as it needs to be reimplemented
+## for OpenSSL 1.1.0.
+# Don't build upstream Python's implementation of these crypto algorithms;
+# instead rely on _hashlib and OpenSSL.
+#
+# For example, in our builds md5.py uses always uses hashlib.md5 (rather than
+# falling back to _md5 when hashlib.md5 is not available); hashlib.md5 is
+# implemented within _hashlib via OpenSSL (and thus respects FIPS mode)
+#for f in md5module.c md5.c shamodule.c sha256module.c sha512module.c; do
+# rm Modules/$f
+#done
+
+#
+# Apply patches:
+#
+%patch0 -p1 -b .rhconfig
+%patch1 -p1 -b .no_gui
+%patch4 -p1 -b .cflags
+%patch6 -p1 -b .plural
+%patch7 -p1
+
+%if "%{_lib}" == "lib64"
+%patch102 -p1 -b .lib64
+%patch103 -p1 -b .lib64-sysconfig
+%patch104 -p1
+%endif
+
+%patch10 -p1 -b .binutils-no-dep
+%patch13 -p1 -b .socketmodule
+%patch14 -p1 -b .socketmodule2
+%patch16 -p1 -b .rpath
+%patch17 -p1 -b .distutils-rpath
+
+%if 0%{?with_systemtap}
+%patch55 -p1 -b .systemtap
+%endif
+
+%patch111 -p1 -b .no-static-lib
+
+%patch112 -p1 -b .debug-build
+
+%patch113 -p1 -b .more-configuration-flags
+
+%patch114 -p1 -b .statvfs-f-flag-constants
+
+
+%patch121 -p1
+%patch125 -p1 -b .less-verbose-COUNT_ALLOCS
+%patch128 -p1
+
+%patch130 -p1
+
+%ifarch ppc %{power64}
+%patch131 -p1
+%endif
+
+%patch132 -p1
+%patch133 -p1
+%patch134 -p1
+%patch135 -p1
+%patch136 -p1 -b .stdin-test
+%patch137 -p1
+%patch138 -p1
+%ifarch %{arm}
+%patch139 -p1
+%endif
+%ifarch %{sparc}
+%patch140 -p1
+%endif
+%patch141 -p1
+%patch142 -p1 -b .tty-fail
+%patch143 -p1 -b .tsc-on-ppc
+%if !%{with_gdbm}
+%patch144 -p1
+%endif
+#patch146 -p1
+%patch147 -p1
+%patch153 -p0
+%patch155 -p1
+%patch156 -p1
+%patch157 -p1
+%patch165 -p1
+mv Modules/cryptmodule.c Modules/_cryptmodule.c
+%patch167 -p1
+%patch168 -p1
+%patch169 -p1
+%patch170 -p1
+%patch173 -p1
+%patch174 -p1 -b .fix-for-usr-move
+%patch180 -p1
+%patch181 -p1
+%patch184 -p1
+%patch185 -p1
+%patch187 -p1
+%patch189 -p1
+%patch191 -p1
+%patch193 -p1
+%if 0%{with_rewheel}
+%patch198 -p1
+%endif
+%patch200 -p1
+%patch209 -p1
+%patch242 -p1
+%patch247 -p1
+
+
+# This shouldn't be necesarry, but is right now (2.2a3)
+find -name "*~" |xargs rm -f
+
+%if ! 0%{regenerate_autotooling_patch}
+# Normally we apply the patch to "configure"
+# We don't apply the patch if we're working towards regenerating it
+%patch5000 -p0 -b .autotool-intermediates
+%endif
+
+
+# ======================================================
+# Configuring and building the code:
+# ======================================================
+
+%build
+topdir=$(pwd)
+export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv"
+export CXXFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv"
+export CPPFLAGS="$(pkg-config --cflags-only-I libffi)"
+export OPT="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv"
+export LINKCC="gcc"
+export LDFLAGS="$RPM_LD_FLAGS"
+if pkg-config openssl ; then
+ export CFLAGS="$CFLAGS $(pkg-config --cflags openssl)"
+ export LDFLAGS="$LDFLAGS $(pkg-config --libs-only-L openssl)"
+fi
+# Force CC
+export CC=gcc
+
+%if 0%{regenerate_autotooling_patch}
+# If enabled, this code regenerates the patch to "configure", using a
+# local copy of autoconf-2.65, then exits the build
+#
+# The following assumes that the copy is installed to ~/autoconf-2.65/bin
+# as per these instructions:
+#
http://bugs.python.org/issue7997
+
+for f in pyconfig.h.in configure ; do
+ cp $f $f.autotool-intermediates ;
+done
+
+# Rerun the autotools:
+PATH=~/autoconf-2.65/bin:$PATH autoconf
+autoheader
+
+# Regenerate the patch:
+gendiff . .autotool-intermediates > %{PATCH5000}
+
+
+# Exit the build
+exit 1
+%endif
+
+# Define a function, for how to perform a "build" of python for a given
+# configuration:
+BuildPython() {
+ ConfName=$1
+ BinaryName=$2
+ SymlinkName=$3
+ ExtraConfigArgs=$4
+ PathFixWithThisBinary=$5
+
+ ConfDir=build/$ConfName
+
+ echo STARTING: BUILD OF PYTHON FOR CONFIGURATION: $ConfName - %{_bindir}/$BinaryName
+ mkdir -p $ConfDir
+
+ pushd $ConfDir
+
+ # Use the freshly created "configure" script, but in the directory two
above:
+ %global _configure $topdir/configure
+
+%configure \
+ --enable-ipv6 \
+ --enable-shared \
+ --enable-unicode=%{unicode} \
+ --with-dbmliborder=gdbm:ndbm:bdb \
+ --with-system-expat \
+ --with-system-ffi \
+%if 0%{?with_systemtap}
+ --with-dtrace \
+ --with-tapset-install-dir=%{tapsetdir} \
+%endif
+%if 0%{?with_valgrind}
+ --with-valgrind \
+%endif
+ $ExtraConfigArgs \
+ %{nil}
+
+make EXTRA_CFLAGS="$CFLAGS" %{?_smp_mflags}
+
+# We need to fix shebang lines across the full source tree.
+#
+# We do this using the pathfix.py script, which requires one of the
+# freshly-built Python binaries.
+#
+# We use the optimized python binary, and make the shebangs point at that same
+# optimized python binary:
+if $PathFixWithThisBinary
+then
+ LD_LIBRARY_PATH="$topdir/$ConfDir" ./$BinaryName \
+ $topdir/Tools/scripts/pathfix.py \
+ -i "/usr/bin/env $BinaryName" \
+ $topdir
+fi
+
+# Rebuild with new python
+# We need a link to a versioned python in the build directory
+ln -s $BinaryName $SymlinkName
+LD_LIBRARY_PATH="$topdir/$ConfDir" PATH=$PATH:$topdir/$ConfDir make -s
EXTRA_CFLAGS="$CFLAGS" %{?_smp_mflags}
+
+ popd
+ echo FINISHED: BUILD OF PYTHON FOR CONFIGURATION: $ConfDir
+}
+
+# Use "BuildPython" to support building with different configurations:
+
+%if 0%{?with_debug_build}
+BuildPython debug \
+ python-debug \
+ python%{pybasever}-debug \
+%ifarch %{ix86} x86_64 ppc %{power64}
+ "--with-pydebug --with-tsc --with-count-allocs --with-call-profile" \
+%else
+ "--with-pydebug --with-count-allocs --with-call-profile" \
+%endif
+ false
+%endif # with_debug_build
+
+BuildPython optimized \
+ python \
+ python%{pybasever} \
+ "" \
+ true
+
+
+# ======================================================
+# Installing the built code:
+# ======================================================
+
+%install
+topdir=$(pwd)
+rm -rf %{buildroot}
+mkdir -p %{buildroot}%{_prefix} %{buildroot}%{_mandir}
+
+# Clean up patched .py files that are saved as .lib64
+for f in distutils/command/install distutils/sysconfig; do
+ rm -f Lib/$f.py.lib64
+done
+
+InstallPython() {
+
+ ConfName=$1
+ BinaryName=$2
+ PyInstSoName=$3
+
+ ConfDir=build/$ConfName
+
+ echo STARTING: INSTALL OF PYTHON FOR CONFIGURATION: $ConfName - %{_bindir}/$BinaryName
+ mkdir -p $ConfDir
+
+ pushd $ConfDir
+
+make install DESTDIR=%{buildroot}
+
+# We install a collection of hooks for gdb that make it easier to debug
+# executables linked against libpython (such as /usr/lib/python itself)
+#
+# These hooks are implemented in Python itself
+#
+# gdb-archer looks for them in the same path as the ELF file, with a -gdb.py suffix.
+# We put them in the debuginfo package by installing them to e.g.:
+# /usr/lib/debug/usr/lib/libpython2.6.so.1.0.debug-gdb.py
+# (note that the debug path is /usr/lib/debug for both 32/64 bit)
+#
+# See
https://fedoraproject.org/wiki/Features/EasierPythonDebugging for more
+# information
+#
+# Initially I tried:
+# /usr/lib/libpython2.6.so.1.0-gdb.py
+# but doing so generated noise when ldconfig was rerun (rhbz:562980)
+#
+%if 0%{?with_gdb_hooks}
+DirHoldingGdbPy=%{_prefix}/lib/debug/%{_libdir}
+PathOfGdbPy=$DirHoldingGdbPy/$PyInstSoName.debug-gdb.py
+
+mkdir -p %{buildroot}$DirHoldingGdbPy
+cp $topdir/Tools/gdb/libpython.py %{buildroot}$PathOfGdbPy
+
+# Manually byte-compile the file, in case find-debuginfo.sh is run before
+# brp-python-bytecompile, so that the .pyc/.pyo files are properly listed in
+# the debuginfo manifest:
+LD_LIBRARY_PATH="$topdir/$ConfDir" $topdir/$ConfDir/$BinaryName \
+ -c "import compileall; import sys;
compileall.compile_dir('%{buildroot}$DirHoldingGdbPy',
ddir='$DirHoldingGdbPy')"
+
+LD_LIBRARY_PATH="$topdir/$ConfDir" $topdir/$ConfDir/$BinaryName -O \
+ -c "import compileall; import sys;
compileall.compile_dir('%{buildroot}$DirHoldingGdbPy',
ddir='$DirHoldingGdbPy')"
+%endif # with_gdb_hooks
+
+ popd
+
+ echo FINISHED: INSTALL OF PYTHON FOR CONFIGURATION: $ConfName
+}
+
+# Use "InstallPython" to support building with different configurations:
+
+# Install the "debug" build first, so that we can move some files aside
+%if 0%{?with_debug_build}
+InstallPython debug \
+ python%{pybasever}-debug \
+ %{py_INSTSONAME_debug}
+%endif # with_debug_build
+
+# Now the optimized build:
+InstallPython optimized \
+ python%{pybasever} \
+ %{py_INSTSONAME_optimized}
+
+
+# Fix the interpreter path in binaries installed by distutils
+# (which changes them by itself)
+# Make sure we preserve the file permissions
+for fixed in %{buildroot}%{_bindir}/pydoc; do
+ sed 's,#!.*/python$,#!/usr/bin/env python%{pybasever},' $fixed > $fixed-
\
+ && cat $fixed- > $fixed && rm -f $fixed-
+done
+
+# Junk, no point in putting in -test sub-pkg
+rm -f %{buildroot}/%{pylibdir}/idlelib/testcode.py*
+
+# don't include tests that are run at build time in the package
+# This is documented, and used: rhbz#387401
+if /bin/false; then
+ # Move this to -test subpackage.
+mkdir save_bits_of_test
+for i in test_support.py __init__.py; do
+ cp -a %{buildroot}/%{pylibdir}/test/$i save_bits_of_test
+done
+rm -rf %{buildroot}/%{pylibdir}/test
+mkdir %{buildroot}/%{pylibdir}/test
+cp -a save_bits_of_test/* %{buildroot}/%{pylibdir}/test
+fi
+
+# tools
+
+mkdir -p ${RPM_BUILD_ROOT}%{site_packages}
+
+#pynche
+install -p -m755 %{SOURCE7} ${RPM_BUILD_ROOT}%{_bindir}/pynche
+chmod 755 ${RPM_BUILD_ROOT}%{_bindir}/pynche
+rm -f Tools/pynche/*.pyw
+cp -rp Tools/pynche \
+ ${RPM_BUILD_ROOT}%{site_packages}/
+
+mv Tools/pynche/README Tools/pynche/README.pynche
+
+#gettext
+install -m755 Tools/i18n/pygettext.py %{buildroot}%{_bindir}/
+install -m755 Tools/i18n/msgfmt.py %{buildroot}%{_bindir}/
+
+# Useful development tools
+install -m755 -d %{buildroot}%{tools_dir}/scripts
+install Tools/README %{buildroot}%{tools_dir}/
+install Tools/scripts/*py %{buildroot}%{tools_dir}/scripts/
+
+# Documentation tools
+install -m755 -d %{buildroot}%{doc_tools_dir}
+#install -m755 Doc/tools/mkhowto %{buildroot}%{doc_tools_dir}
+
+# Useful demo scripts
+install -m755 -d %{buildroot}%{demo_dir}
+cp -ar Demo/* %{buildroot}%{demo_dir}
+
+# Get rid of crap
+find %{buildroot}/ -name "*~"|xargs rm -f
+find %{buildroot}/ -name ".cvsignore"|xargs rm -f
+find %{buildroot}/ -name "*.bat"|xargs rm -f
+find . -name "*~"|xargs rm -f
+find . -name ".cvsignore"|xargs rm -f
+#zero length
+rm -f %{buildroot}%{pylibdir}/LICENSE.txt
+
+# Fix for bug #136654
+rm -f %{buildroot}%{pylibdir}/email/test/data/audiotest.au
%{buildroot}%{pylibdir}/test/audiotest.au
+
+# Fix bug #143667: python should own /usr/lib/python2.x on 64-bit machines
+%if "%{_lib}" == "lib64"
+install -d %{buildroot}/%{_prefix}/lib/python%{pybasever}/site-packages
+%endif
+
+# Make python-devel multilib-ready (bug #192747, #139911)
+%global _pyconfig32_h pyconfig-32.h
+%global _pyconfig64_h pyconfig-64.h
+
+%ifarch %{power64} s390x x86_64 ia64 alpha sparc64 aarch64 %{mips64} riscv64
+%global _pyconfig_h %{_pyconfig64_h}
+%else
+%global _pyconfig_h %{_pyconfig32_h}
+%endif
+
+%if 0%{?with_debug_build}
+%global PyIncludeDirs python%{pybasever} python%{pybasever}-debug
+%else
+%global PyIncludeDirs python%{pybasever}
+%endif
+
+for PyIncludeDir in %{PyIncludeDirs} ; do
+ mv %{buildroot}%{_includedir}/$PyIncludeDir/pyconfig.h \
+ %{buildroot}%{_includedir}/$PyIncludeDir/%{_pyconfig_h}
+ cat > %{buildroot}%{_includedir}/$PyIncludeDir/pyconfig.h << EOF
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "%{_pyconfig32_h}"
+#elif __WORDSIZE == 64
+#include "%{_pyconfig64_h}"
+#else
+#error "Unknown word size"
+#endif
+EOF
+done
+ln -s ../../libpython%{pybasever}.so
%{buildroot}%{pylibdir}/config/libpython%{pybasever}.so
+
+# Fix for bug 201434: make sure distutils looks at the right pyconfig.h file
+# Similar for sysconfig: sysconfig.get_config_h_filename tries to locate
+# pyconfig.h so it can be parsed, and needs to do this at runtime in site.py
+# when python starts up.
+#
+# Split this out so it goes directly to the pyconfig-32.h/pyconfig-64.h
+# variants:
+sed -i -e "s/'pyconfig.h'/'%{_pyconfig_h}'/" \
+ %{buildroot}%{pylibdir}/distutils/sysconfig.py \
+ %{buildroot}%{pylibdir}/sysconfig.py
+
+# Ensure that the curses module was linked against libncursesw.so, rather than
+# libncurses.so (bug 539917)
+ldd %{buildroot}/%{dynload_dir}/_curses*.so \
+ | grep curses \
+ | grep libncurses.so && (echo "_curses.so linked against
libncurses.so" ; exit 1)
+
+# Ensure that the debug modules are linked against the debug libpython, and
+# likewise for the optimized modules and libpython:
+for Module in %{buildroot}/%{dynload_dir}/*.so ; do
+ case $Module in
+ *_d.so)
+ ldd $Module | grep %{py_INSTSONAME_optimized} &&
+ (echo Debug module $Module linked against optimized
%{py_INSTSONAME_optimized} ; exit 1)
+
+ ;;
+ *)
+ ldd $Module | grep %{py_INSTSONAME_debug} &&
+ (echo Optimized module $Module linked against debug
%{py_INSTSONAME_optimized} ; exit 1)
+ ;;
+ esac
+done
+
+#
+# Systemtap hooks:
+#
+%if 0%{?with_systemtap}
+# Install a tapset for this libpython into tapsetdir, fixing up the path to the
+# library:
+mkdir -p %{buildroot}%{tapsetdir}
+%ifarch %{power64} s390x x86_64 ia64 alpha sparc64 aarch64 %{mips64}
+%global libpython_stp_optimized libpython%{pybasever}-64.stp
+%global libpython_stp_debug libpython%{pybasever}-debug-64.stp
+%else
+%global libpython_stp_optimized libpython%{pybasever}-32.stp
+%global libpython_stp_debug libpython%{pybasever}-debug-32.stp
+%endif
+
+sed \
+ -e "s|LIBRARY_PATH|%{_libdir}/%{py_INSTSONAME_optimized}|" \
+ %{SOURCE3} \
+ > %{buildroot}%{tapsetdir}/%{libpython_stp_optimized}
+
+%if 0%{?with_debug_build}
+sed \
+ -e "s|LIBRARY_PATH|%{_libdir}/%{py_INSTSONAME_debug}|" \
+ %{SOURCE3} \
+ > %{buildroot}%{tapsetdir}/%{libpython_stp_debug}
+%endif # with_debug_build
+%endif # with_systemtap
+
+# Make library-files user writable
+/usr/bin/chmod 755 %{buildroot}%{dynload_dir}/*.so
+/usr/bin/chmod 755 %{buildroot}%{_libdir}/libpython%{pybasever}.so.1.0
+/usr/bin/chmod 755 %{buildroot}%{_libdir}/libpython%{pybasever}_d.so.1.0
+
+
+# ======================================================
+# Running the upstream test suite
+# ======================================================
+
+%check
+topdir=$(pwd)
+CheckPython() {
+ ConfName=$1
+ BinaryName=$2
+ ConfDir=$(pwd)/build/$ConfName
+
+ echo STARTING: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName
+
+ # Note that we're running the tests using the version of the code in the
+ # builddir, not in the buildroot.
+
+ pushd $ConfDir
+
+ EXTRATESTOPTS="--verbose"
+
+%ifarch s390 s390x %{power64} %{arm} aarch64 %{mips}
+ EXTRATESTOPTS="$EXTRATESTOPTS -x test_gdb"
+%endif
+%ifarch %{mips64}
+ EXTRATESTOPTS="$EXTRATESTOPTS -x test_ctypes"
+%endif
+
+%if 0%{?with_huntrleaks}
+ # Try to detect reference leaks on debug builds. By default this means
+ # running every test 10 times (6 to stabilize, then 4 to watch):
+ if [ "$ConfName" = "debug" ] ; then
+ EXTRATESTOPTS="$EXTRATESTOPTS --huntrleaks : "
+ fi
+%endif
+
+ # Run the upstream test suite, setting "WITHIN_PYTHON_RPM_BUILD" so that the
+ # our non-standard decorators take effect on the relevant tests:
+ # @unittest._skipInRpmBuild(reason)
+ # @unittest._expectedFailureInRpmBuild
+ WITHIN_PYTHON_RPM_BUILD= EXTRATESTOPTS="$EXTRATESTOPTS" make test
+
+ popd
+
+ echo FINISHED: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName
+
+}
+
+%if 0%{run_selftest_suite}
+
+# Check each of the configurations:
+%if 0%{?with_debug_build}
+CheckPython \
+ debug \
+ python%{pybasever}-debug
+%endif # with_debug_build
+CheckPython \
+ optimized \
+ python%{pybasever}
+
+%endif # run_selftest_suite
+
+
+# ======================================================
+# Cleaning up
+# ======================================================
+
+%clean
+rm -fr %{buildroot}
+
+
+# ======================================================
+# Scriptlets
+# ======================================================
+
+%post libs -p /sbin/ldconfig
+
+%postun libs -p /sbin/ldconfig
+
+
+
+%files
+%defattr(-, root, root, -)
+%{!?_licensedir:%global license %%doc}
+%license LICENSE
+%doc README
+%{_bindir}/pydoc*
+%{_bindir}/python
+%{_bindir}/%{python}
+%{_bindir}/python%{pybasever}
+%{_mandir}/*/*
+
+%files libs
+%defattr(-,root,root,-)
+%{!?_licensedir:%global license %%doc}
+%license LICENSE
+%doc README
+%dir %{pylibdir}
+%dir %{dynload_dir}
+
+%{dynload_dir}/_md5module.so
+%{dynload_dir}/_sha256module.so
+%{dynload_dir}/_sha512module.so
+%{dynload_dir}/_shamodule.so
+
+%{dynload_dir}/Python-%{version}-py%{pybasever}.egg-info
+%{dynload_dir}/_bisectmodule.so
+%{dynload_dir}/_bsddb.so
+%{dynload_dir}/_codecs_cn.so
+%{dynload_dir}/_codecs_hk.so
+%{dynload_dir}/_codecs_iso2022.so
+%{dynload_dir}/_codecs_jp.so
+%{dynload_dir}/_codecs_kr.so
+%{dynload_dir}/_codecs_tw.so
+%{dynload_dir}/_collectionsmodule.so
+%{dynload_dir}/_csv.so
+%{dynload_dir}/_ctypes.so
+%{dynload_dir}/_curses.so
+%{dynload_dir}/_curses_panel.so
+%{dynload_dir}/_elementtree.so
+%{dynload_dir}/_functoolsmodule.so
+%{dynload_dir}/_hashlib.so
+%{dynload_dir}/_heapq.so
+%{dynload_dir}/_hotshot.so
+%{dynload_dir}/_io.so
+%{dynload_dir}/_json.so
+%{dynload_dir}/_localemodule.so
+%{dynload_dir}/_lsprof.so
+%{dynload_dir}/_multibytecodecmodule.so
+%{dynload_dir}/_multiprocessing.so
+%{dynload_dir}/_randommodule.so
+%{dynload_dir}/_socketmodule.so
+%{dynload_dir}/_sqlite3.so
+%{dynload_dir}/_ssl.so
+%{dynload_dir}/_struct.so
+%{dynload_dir}/arraymodule.so
+%{dynload_dir}/audioop.so
+%{dynload_dir}/binascii.so
+%{dynload_dir}/bz2.so
+%{dynload_dir}/cPickle.so
+%{dynload_dir}/cStringIO.so
+%{dynload_dir}/cmathmodule.so
+%{dynload_dir}/_cryptmodule.so
+%{dynload_dir}/datetime.so
+%{dynload_dir}/dbm.so
+%{dynload_dir}/dlmodule.so
+%{dynload_dir}/fcntlmodule.so
+%{dynload_dir}/future_builtins.so
+%if %{with_gdbm}
+%{dynload_dir}/gdbmmodule.so
+%endif
+%{dynload_dir}/grpmodule.so
+%{dynload_dir}/imageop.so
+%{dynload_dir}/itertoolsmodule.so
+%{dynload_dir}/linuxaudiodev.so
+%{dynload_dir}/math.so
+%{dynload_dir}/mmapmodule.so
+%{dynload_dir}/nismodule.so
+%{dynload_dir}/operator.so
+%{dynload_dir}/ossaudiodev.so
+%{dynload_dir}/parsermodule.so
+%{dynload_dir}/pyexpat.so
+%{dynload_dir}/readline.so
+%{dynload_dir}/resource.so
+%{dynload_dir}/selectmodule.so
+%{dynload_dir}/spwdmodule.so
+%{dynload_dir}/stropmodule.so
+%{dynload_dir}/syslog.so
+%{dynload_dir}/termios.so
+%{dynload_dir}/timemodule.so
+%{dynload_dir}/timingmodule.so
+%{dynload_dir}/unicodedata.so
+%{dynload_dir}/xxsubtype.so
+%{dynload_dir}/zlibmodule.so
+
+%dir %{site_packages}
+%{site_packages}/README
+%{pylibdir}/*.py*
+%{pylibdir}/*.doc
+%{pylibdir}/wsgiref.egg-info
+%dir %{pylibdir}/bsddb
+%{pylibdir}/bsddb/*.py*
+%{pylibdir}/compiler
+%dir %{pylibdir}/ctypes
+%{pylibdir}/ctypes/*.py*
+%{pylibdir}/ctypes/macholib
+%{pylibdir}/curses
+%dir %{pylibdir}/distutils
+%{pylibdir}/distutils/*.py*
+%{pylibdir}/distutils/README
+%{pylibdir}/distutils/command
+%exclude %{pylibdir}/distutils/command/wininst-*.exe
+%dir %{pylibdir}/email
+%{pylibdir}/email/*.py*
+%{pylibdir}/email/mime
+%{pylibdir}/encodings
+%{pylibdir}/hotshot
+%{pylibdir}/idlelib
+%{pylibdir}/importlib
+%dir %{pylibdir}/json
+%{pylibdir}/json/*.py*
+%{pylibdir}/lib2to3
+%exclude %{pylibdir}/lib2to3/tests
+%{pylibdir}/logging
+%{pylibdir}/multiprocessing
+%{pylibdir}/plat-linux2
+%{pylibdir}/pydoc_data
+%dir %{pylibdir}/sqlite3
+%{pylibdir}/sqlite3/*.py*
+%dir %{pylibdir}/test
+%{pylibdir}/test/test_support.py*
+%{pylibdir}/test/__init__.py*
+%{pylibdir}/unittest
+%{pylibdir}/wsgiref
+%{pylibdir}/xml
+%if "%{_lib}" == "lib64"
+%attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}
+%attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}/site-packages
+%endif
+
+# "Makefile" and the config-32/64.h file are needed by
+# distutils/sysconfig.py:_init_posix(), so we include them in the libs
+# package, along with their parent directories (bug 531901):
+%dir %{pylibdir}/config
+%{pylibdir}/config/Makefile
+%dir %{_includedir}/python%{pybasever}
+%{_includedir}/python%{pybasever}/%{_pyconfig_h}
+
+%{_libdir}/%{py_INSTSONAME_optimized}
+%if 0%{?with_systemtap}
+%dir %(dirname %{tapsetdir})
+%dir %{tapsetdir}
+%{tapsetdir}/%{libpython_stp_optimized}
+%doc systemtap-example.stp pyfuntop.stp
+%endif
+
+%dir %{pylibdir}/ensurepip/
+%{pylibdir}/ensurepip/*.py*
+%exclude %{pylibdir}/ensurepip/_bundled
+
+%if 0%{?with_rewheel}
+%dir %{pylibdir}/ensurepip/rewheel/
+%{pylibdir}/ensurepip/rewheel/*.py*
+%endif
+
+
+%files devel
+%defattr(-,root,root,-)
+%{_libdir}/pkgconfig/python-%{pybasever}.pc
+%{_libdir}/pkgconfig/python.pc
+%{_libdir}/pkgconfig/python2.pc
+%{pylibdir}/config/*
+%exclude %{pylibdir}/config/Makefile
+%{pylibdir}/distutils/command/wininst-*.exe
+%{_includedir}/python%{pybasever}/*.h
+%exclude %{_includedir}/python%{pybasever}/%{_pyconfig_h}
+%doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit
+%{_bindir}/python-config
+%{_bindir}/python2-config
+%{_bindir}/python%{pybasever}-config
+%{_libdir}/libpython%{pybasever}.so
+
+%files tools
+%defattr(-,root,root,755)
+%doc Tools/pynche/README.pynche
+%{site_packages}/pynche
+%{_bindir}/smtpd*.py*
+%{_bindir}/2to3*
+%{_bindir}/idle*
+%{_bindir}/pynche*
+%{_bindir}/pygettext*.py*
+%{_bindir}/msgfmt*.py*
+%{tools_dir}
+%{demo_dir}
+%{pylibdir}/Doc
+
+%files tkinter
+%defattr(-,root,root,755)
+%{pylibdir}/lib-tk
+%{dynload_dir}/_tkinter.so
+
+%files test
+%defattr(-, root, root, -)
+%{pylibdir}/bsddb/test
+%{pylibdir}/ctypes/test
+%{pylibdir}/distutils/tests
+%{pylibdir}/email/test
+%{pylibdir}/json/tests
+%{pylibdir}/lib2to3/tests
+%{pylibdir}/sqlite3/test
+%{pylibdir}/test/*
+# These two are shipped in the main subpackage:
+%exclude %{pylibdir}/test/test_support.py*
+%exclude %{pylibdir}/test/__init__.py*
+%{dynload_dir}/_ctypes_test.so
+%{dynload_dir}/_testcapimodule.so
+
+
+# We don't bother splitting the debug build out into further subpackages:
+# if you need it, you're probably a developer.
+
+# Hence the manifest is the combination of analogous files in the manifests of
+# all of the other subpackages
+
+%if 0%{?with_debug_build}
+%files debug
+%defattr(-,root,root,-)
+
+# Analog of the core subpackage's files:
+%{_bindir}/python-debug
+%{_bindir}/%{python}-debug
+%{_bindir}/python%{pybasever}-debug
+
+# Analog of the -libs subpackage's files, with debug builds of the built-in
+# "extension" modules:
+
+%{dynload_dir}/_md5module_d.so
+%{dynload_dir}/_sha256module_d.so
+%{dynload_dir}/_sha512module_d.so
+%{dynload_dir}/_shamodule_d.so
+
+%{dynload_dir}/_bisectmodule_d.so
+%{dynload_dir}/_bsddb_d.so
+%{dynload_dir}/_codecs_cn_d.so
+%{dynload_dir}/_codecs_hk_d.so
+%{dynload_dir}/_codecs_iso2022_d.so
+%{dynload_dir}/_codecs_jp_d.so
+%{dynload_dir}/_codecs_kr_d.so
+%{dynload_dir}/_codecs_tw_d.so
+%{dynload_dir}/_collectionsmodule_d.so
+%{dynload_dir}/_csv_d.so
+%{dynload_dir}/_ctypes_d.so
+%{dynload_dir}/_curses_d.so
+%{dynload_dir}/_curses_panel_d.so
+%{dynload_dir}/_elementtree_d.so
+%{dynload_dir}/_functoolsmodule_d.so
+%{dynload_dir}/_hashlib_d.so
+%{dynload_dir}/_heapq_d.so
+%{dynload_dir}/_hotshot_d.so
+%{dynload_dir}/_io_d.so
+%{dynload_dir}/_json_d.so
+%{dynload_dir}/_localemodule_d.so
+%{dynload_dir}/_lsprof_d.so
+%{dynload_dir}/_multibytecodecmodule_d.so
+%{dynload_dir}/_multiprocessing_d.so
+%{dynload_dir}/_randommodule_d.so
+%{dynload_dir}/_socketmodule_d.so
+%{dynload_dir}/_sqlite3_d.so
+%{dynload_dir}/_ssl_d.so
+%{dynload_dir}/_struct_d.so
+%{dynload_dir}/arraymodule_d.so
+%{dynload_dir}/audioop_d.so
+%{dynload_dir}/binascii_d.so
+%{dynload_dir}/bz2_d.so
+%{dynload_dir}/cPickle_d.so
+%{dynload_dir}/cStringIO_d.so
+%{dynload_dir}/cmathmodule_d.so
+%{dynload_dir}/_cryptmodule_d.so
+%{dynload_dir}/datetime_d.so
+%{dynload_dir}/dbm_d.so
+%{dynload_dir}/dlmodule_d.so
+%{dynload_dir}/fcntlmodule_d.so
+%{dynload_dir}/future_builtins_d.so
+%if %{with_gdbm}
+%{dynload_dir}/gdbmmodule_d.so
+%endif
+%{dynload_dir}/grpmodule_d.so
+%{dynload_dir}/imageop_d.so
+%{dynload_dir}/itertoolsmodule_d.so
+%{dynload_dir}/linuxaudiodev_d.so
+%{dynload_dir}/math_d.so
+%{dynload_dir}/mmapmodule_d.so
+%{dynload_dir}/nismodule_d.so
+%{dynload_dir}/operator_d.so
+%{dynload_dir}/ossaudiodev_d.so
+%{dynload_dir}/parsermodule_d.so
+%{dynload_dir}/pyexpat_d.so
+%{dynload_dir}/readline_d.so
+%{dynload_dir}/resource_d.so
+%{dynload_dir}/selectmodule_d.so
+%{dynload_dir}/spwdmodule_d.so
+%{dynload_dir}/stropmodule_d.so
+%{dynload_dir}/syslog_d.so
+%{dynload_dir}/termios_d.so
+%{dynload_dir}/timemodule_d.so
+%{dynload_dir}/timingmodule_d.so
+%{dynload_dir}/unicodedata_d.so
+%{dynload_dir}/xxsubtype_d.so
+%{dynload_dir}/zlibmodule_d.so
+
+# No need to split things out the "Makefile" and the config-32/64.h file as we
+# do for the regular build above (bug 531901), since they're all in one package
+# now; they're listed below, under "-devel":
+
+%{_libdir}/%{py_INSTSONAME_debug}
+%if 0%{?with_systemtap}
+%dir %(dirname %{tapsetdir})
+%dir %{tapsetdir}
+%{tapsetdir}/%{libpython_stp_debug}
+%endif
+
+# Analog of the -devel subpackage's files:
+%dir %{pylibdir}/config-debug
+%{_libdir}/pkgconfig/python-%{pybasever}-debug.pc
+%{_libdir}/pkgconfig/python-debug.pc
+%{_libdir}/pkgconfig/python2-debug.pc
+%{pylibdir}/config-debug/*
+%{_includedir}/python%{pybasever}-debug/*.h
+%{_bindir}/python-debug-config
+%{_bindir}/python2-debug-config
+%{_bindir}/python%{pybasever}-debug-config
+%{_libdir}/libpython%{pybasever}_d.so
+
+# Analog of the -tools subpackage's files:
+# None for now; we could build precanned versions that have the appropriate
+# shebang if needed
+
+# Analog of the tkinter subpackage's files:
+%{dynload_dir}/_tkinter_d.so
+
+# Analog of the -test subpackage's files:
+%{dynload_dir}/_ctypes_test_d.so
+%{dynload_dir}/_testcapimodule_d.so
+
+%endif # with_debug_build
+
+# We put the debug-gdb.py file inside /usr/lib/debug to avoid noise from
+# ldconfig (rhbz:562980).
+#
+# The /usr/lib/rpm/redhat/macros defines the __debug_package macro to use
+# debugfiles.list, and it appears that everything below /usr/lib/debug and
+# (/usr/src/debug) gets added to this file (via LISTFILES) in
+# /usr/lib/rpm/find-debuginfo.sh
+#
+# Hence by installing it below /usr/lib/debug we ensure it is added to the
+# -debuginfo subpackage
+# (if it doesn't, then the rpmbuild ought to fail since the debug-gdb.py
+# payload file would be unpackaged)
+
+
+# ======================================================
+# Finally, the changelog:
+# ======================================================
+
+%changelog
+* Thu Oct 27 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-9
+- Rename package to python2 and also rename the subpackages accordingly
+- Provide and obsolete python and the respective subpackages to ensure a clean
+upgrade path
+- Remove old provides for packages that got into stdlib
+
+* Wed Oct 12 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-8
+- Port ssl and hashlib modules to OpenSSL 1.1.0
+- Drop hashlib patch for now
+- Add riscv64 arch to 64bit and no-valgrind arches
+
+* Thu Sep 29 2016 Miro Hronok <mhroncok(a)redhat.com> - 2.7.12-7
+- Provide python27
+
+* Fri Sep 02 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-6
+- Remove unversioned Obsoletes
+
+* Thu Sep 01 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-5
+- Rebase rewheel patch so it applies properly (rhbz#1372183)
+
+* Tue Aug 09 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-4
+- SPEC file cleanup
+- Removal of unapplied patches
+
+* Tue Aug 09 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-3
+- Fix for CVE-2016-1000110 HTTPoxy attack
+- SPEC file cleanup
+
+* Mon Aug 01 2016 Michal Toman <mtoman(a)fedoraproject.org> - 2.7.12-2
+- Build properly on MIPS
+
+* Fri Jul 15 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-1
+- Update to 2.7.12
+- Refactored patches: 10, 102, 112, 134, 153
+- Dropped patches: 166, 209, 210
+
+* Fri Jul 08 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.11-8
+- Refactor patch for properly fixing CVE-2016-5636
+
+* Fri Jul 08 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.11-7
+- Fix test_pyexpat failure with Expat version of 2.2.0
+
+* Thu Jun 16 2016 Tomas Orsava <torsava(a)redhat.com> - 2.7.11-6
+- Fix for: CVE-2016-0772 python: smtplib StartTLS stripping attack
+- Raise an error when STARTTLS fails
+- rhbz#1303647:
https://bugzilla.redhat.com/show_bug.cgi?id=1303647
+- rhbz#1346344:
https://bugzilla.redhat.com/show_bug.cgi?id=1346344
+- Fixed upstream:
https://hg.python.org/cpython/rev/b3ce713fb9be
+
+* Mon Jun 13 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.11-5
+- Added patch for fixing possible integer overflow and heap corruption in
zipimporter.get_data()
+
+* Thu Feb 04 2016 Fedora Release Engineering <releng(a)fedoraproject.org> - 2.7.11-4
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
+
+* Wed Jan 13 2016 Orion Poplawski <orion(a)cora.nwra.com> - 2.7.11-3
+- Drop macros, require python/python2-rpm-macros
+
+* Wed Dec 30 2015 Orion Poplawski <orion(a)cora.nwra.com> - 2.7.11-2
+- Get ready for separate python-macros package
+
+* Tue Dec 15 2015 Robert Kuska <rkuska(a)redhat.com> - 2.7.11-1
+- Update to 2.7.11
+
+* Thu Oct 15 2015 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.10-11
+- provide/obsolete _isa packages in python_provide (#1271776)
+
+* Wed Sep 23 2015 Robert Kuska <rkuska(a)redhat.com> - 2.7.10-10
+- Revert the moving modules to python-tools because distutils uses lib2to3
+
+* Tue Sep 22 2015 Robert Kuska <rkuska(a)redhat.com> - 2.7.10-9
+- Move idlelib and lib2to3 modules to pythont-tools
+
+* Thu Sep 3 2015 Orion Poplawski <orion(a)cora.nwra.com> - 2.7.10-8
+- Fix quoting in %%python_provide macro
+
+* Thu Sep 3 2015 Orion Poplawski <orion(a)cora.nwra.com> - 2.7.10-7
+- Add obsoletes to %%python_provide macro to fix upgrade path
+- Fix python2- provides for python- packages in %%python_provide
+
+* Thu Jul 23 2015 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.10-6
+- python-macros: remove R on python (#1246036)
+
+* Wed Jul 22 2015 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.10-5
+- Include epoch in the python_provide macro fpc#534 (Slavek Kabrda)
+
+* Mon Jun 29 2015 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.10-4
+- correct python_provide macro to include version only when emiting provides
+
+* Thu Jun 25 2015 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.10-3
+- Add unversioned python-macros from fpc#281 and fpc#534
+ and require it from python-devel
+- Make python-macros noarch
+
+* Wed Jun 17 2015 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.10-2
+- Make relocating Python by changing _prefix actually work
+Resolves: rhbz#1231801
+
+* Mon May 25 2015 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.10-1
+- Update to 2.7.10
+
+* Tue May 5 2015 Peter Robinson <pbrobinson(a)fedoraproject.org> 2.7.9-11
+- Disable test_gdb on aarch64 (rhbz#1196181), it joins all other non x86 arches
+
+* Wed Apr 15 2015 Robert Kuska <rkuska(a)redhat.com> - 2.7.9-10
+- Remove provides/obsolates for unittest2
+- Skip test_gdb on arm until rhbz#1196181 is resolved
+
+* Thu Mar 05 2015 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.9-9
+- Add proper rewheel Requires
+
+* Sat Feb 21 2015 Till Maas <opensource(a)till.name> - 2.7.9-8
+- Rebuilt for Fedora 23 Change
+
https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-...
+
+* Sat Feb 21 2015 Till Maas <opensource(a)till.name> - 2.7.9-7
+- Rebuilt for Fedora 23 Change
+
https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-...
+
+* Tue Feb 17 2015 Ville Skytt <ville.skytta(a)iki.fi> - 2.7.9-6
+- Own systemtap dirs (#710733)
+
+* Fri Feb 06 2015 Karsten Hopp <karsten(a)redhat.com> 2.7.9-5
+- disable test_gdb on ppc64* until rhbz#1132488 is really resolved
+
+* Tue Jan 20 2015 Slavek Kabrda <bkabrda(a)redhat.com> - 2.7.9-4
+- We need to provide both arch specific and noarch Provide for python2-devel
+in order not to break noarch builds.
+
+* Tue Jan 20 2015 Slavek Kabrda <bkabrda(a)redhat.com> - 2.7.9-3
+- Make python2-devel provide arch specific.
+Resolves: rhbz#1183530
+
+* Mon Jan 12 2015 Dan Hork <dan[at]danny.cz> - 2.7.9-2
+- build with valgrind on ppc64le
+- disable test_gdb on s390(x) until rhbz#1181034 is resolved
+
+* Thu Dec 11 2014 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.9-1
+- Update to 2.7.9
+- Refreshed patches: #55, #137, #146, #153, #156, #198
+- Dropped patches: #196, #197
+- New patch: #199
+- Added the rewheel module
+
+* Mon Nov 24 2014 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.8-10
+- Improve python2_version macros
+
+* Thu Nov 13 2014 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.8-9
+- Add python2_version_nodots macro
+
+* Mon Nov 10 2014 Slavek Kabrda <bkabrda(a)redhat.com> - 2.7.8-8
+- Revert previous change, see rhbz#1161166#c6.
+
+* Fri Nov 07 2014 Slavek Kabrda <bkabrda(a)redhat.com> - 2.7.8-7
+- Provide importable unittest2
+Resolves: rhbz#1161166
+
+* Thu Aug 21 2014 Robert Kuska <rkuska(a)redhat.com> - 2.7.8-6
+- Update patch 196 (ssl backport)
+
+* Tue Aug 19 2014 Robert Kuska <rkuska(a)redhat.com> - 2.7.8-5
+- Backport ssl module from python3
+
+* Sun Aug 17 2014 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.7.8-4
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
+
+* Thu Jul 31 2014 Tom Callaway <spot(a)fedoraproject.org> - 2.7.8-3
+- fix license handling
+
+* Fri Jul 18 2014 Robert Kuska <rkuska(a)redhat.com> - 2.7.8-2
+- Enable SSLv2 and SSLv3 when SSLv23_method is used in ssl
+
+* Mon Jul 14 2014 Robert Kuska <rkuska(a)redhat.com> - 2.7.8-1
+- Update to 2.7.8
+
+* Fri Jul 11 2014 Dan Hork <dan[at]danny.cz> - 2.7.7-3
+- rebuilt for updated libffi ABI on ppc64le
+
+* Sat Jun 7 2014 Peter Robinson <pbrobinson(a)fedoraproject.org> 2.7.7-2
+- aarch64 has valgrind, just list those that don't support it
+
+* Wed Jun 04 2014 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.7-1
+- Update to 2.7.7
+- Refreshed patches: #16, #112, #138, #147, #157, #166, #173, #5000
+- Dropped patches: #190, #192, #194
+
+* Tue Jun 03 2014 Dan Hork <dan[at]danny.cz> - 2.7.6-9
+- update the arch list where valgrind exists - %%power64 includes also
+ ppc64le which is not supported yet
+
+* Wed May 21 2014 Jaroslav karvada <jskarvad(a)redhat.com> - 2.7.6-8
+- Rebuilt for
https://fedoraproject.org/wiki/Changes/f21tcl86
+
+* Fri May 09 2014 Tomas Radej <tradej(a)redhat.com> - 2.7.6-7
+- Fixed obsoletes on ordereddict (bz #1095434)
+
+* Mon Apr 14 2014 Tomas Radej <tradej(a)redhat.com> - 2.7.6-6
+- Obsoletes python-ordereddict (bz #1085593, not precisely 1:1 replacement)
+
+* Mon Apr 07 2014 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.6-5
+- Fix test failure with SQLite > 3.8.4.
+- Obsolete/Provide python-unittest2
+Related: rhbz#1060426
+
+* Wed Feb 19 2014 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.6-4
+- Enable loading sqlite extensions.
+Resolves: rhbz#1066708
+
+* Mon Feb 10 2014 Tomas Radej <tradej(a)redhat.com> - 2.7.6-3
+- Fixed buffer overflow (upstream patch)
+Resolves: rhbz#1062375
+
+* Tue Feb 04 2014 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.6-2
+- Install macros in _rpmconfigdir.
+
+* Wed Jan 29 2014 Tomas Radej <tradej(a)redhat.com> - 2.7.6-1
+- Updated to v2.7.6
+- Freshened patches 102, 111, 112, 136, and 142
+- Dropped patches 186, 188 (both fixed upstream)
+
+* Wed Jan 15 2014 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.5-11
+- Make library-files user writable to get rid of
+ Permission Denied in buildlog from debuginfo-packaging
+
+* Tue Jan 14 2014 Dennis Gilmore <dennis(a)ausil.us> - 2.7.5-10
+- enable valgrind support on 32 bit arm
+
+* Tue Nov 12 2013 Tomas Radej <tradej(a)redhat.com> - 2.7.5-9
+- Import get_python_version in bdist_rpm
+Resolves: rhbz#1029082
+
+* Tue Oct 08 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-8
+- Fix processing gdb py-bt command in eval calls.
+Resolves: rhbz#1008154
+
+* Tue Sep 03 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-7
+- Removed ancient Obsolete: python-sqlite2.
+
+* Mon Aug 26 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-6
+- Sync back/renumber patches to stay consistent with rhel.
+
+* Mon Aug 19 2013 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.5-5
+- Added fix for CVE-2013-4238 (rhbz#998430)
+
+* Sun Aug 04 2013 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.7.5-4
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
+
+* Mon Jul 08 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-3
+- Fix build with libffi containing multilib wrapper for ffi.h (rhbz#979696).
+
+* Mon Jul 08 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-2
+- Obsolete PyXML as requested in rhbz#981137.
+
+* Thu May 16 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-1
+- Updated to Python 2.7.5.
+- Refreshed patches: 0 (config), 102 (lib64), 121 (add Modules to build path),
+153 (gdb test noise)
+- Dropped patches: 126, 127 (big endian issues, both fixed upstream),
+175 (configure -Wformat, fixed upstream)
+- Synced patch numbers with python3.spec.
+
+* Tue May 14 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.4-5
+- fix multilib issue in python-tools due to /usr/bin/pynche (source 7;
+rhbz#831437)
+
+* Thu May 02 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.4-4
+- Add patch that enables building on ppc64p7.
+
+* Mon Apr 22 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.4-3
+- Allow arbitrary timeout in Condition.wait (rhbz#917709).
+
+* Thu Apr 11 2013 Kalev Lember <kalevlember(a)gmail.com> - 2.7.4-2
+- Build with libdb 5.3 instead of libdb4
+- Refreshed patches: 0 (config), 102 (lib64)
+- Dropped patches: 54 (db4 version), 159 (db4 include path adjustment)
+
+* Mon Apr 08 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.4-1
+- Updated to Python 2.7.4.
+- Refreshed patches: 0 (config), 7 (sqlite encoding), 16 (rpath in config),
+55 (systemtap), 111 (no static lib), 112 (debug build), 113 (more
+configuration flags), 130 (add extension to python config), 134 (fix
+COUNT_ALLOCS in test_sys), 146 (haslib FIPS), 147 (add debug malloc stats),
+153 (fix gdb test noise), 157 (uid, gid overflow - fixed upstream, just
+keeping few more downstream tests), 165 (crypt module salt backport),
+175 (fix configure Wformat), 5000 (regenerated autotooling patch)
+- Dropped patches: 101 (lib64 regex; merged upstream), 171 (exception on
+missing /dev/urandom; merged upstream), 172 (poll for multiprocessing socket
+connection; merged upstream)
+
+* Mon Mar 25 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-35
+- fix gcc 4.8 incompatibility (rhbz#927358); regenerate autotool intermediates
+
+* Wed Mar 6 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-34
+- restrict scope of workaround for cmpi-bindings issue to avoid breaking
+in-tree running of test_sys and test_subprocess (rhbz#817554)
+
+* Wed Mar 6 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-33
+- add workaround for cmpi-bindings issue (rhbz#817554)
+
+* Mon Mar 4 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-32
+- add workaround for ENOPROTOOPT seen running selftests in Koji
+(rhbz#913732)
+
+* Mon Mar 4 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-31
+- remove config flag from /etc/rpm/macros.python2
+
+* Fri Feb 22 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-30
+- remove __debug_package macro from comment
+
+* Fri Feb 22 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-29
+- drop -b from application of patch 157 (uid/gid overflows)
+
+* Fri Feb 22 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-28
+- fix bogus dates in changelog
+
+* Thu Feb 21 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-27
+- port _multiprocessing.Connection.poll() to use the "poll" syscall, rather
+than "select", allowing large numbers of subprocesses (patch 172;
+rhbz#849992)
+
+* Thu Feb 21 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-26
+- raise correct exception in os.urandom() when /dev/urandom is missing
+(patch 171; rhbz#907383)
+
+* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-25
+- in debug builds, try to print repr() when a C-level assert fails in the
+garbage collector (typically indicating a reference-counting error somewhere
+else e.g in an extension module) (patch 170; rhbz#850013)
+
+* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-24
+- move lib2to3/tests from python-libs to python-test (rhbz#850056)
+
+* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-23
+- use SHA-256 rather than implicitly using MD5 within the challenge handling
+in multiprocessing.connection (patch 169; rhbz#879695)
+
+* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-22
+- fix a problem with distutils.sysconfig when CFLAGS is defined in the
+environment (patch 168; rhbz#849994)
+
+* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-21
+- don't run any stack navigation tests in test_gdb for optimized builds
+(patch 167; rhbz#912025)
+
+* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-20
+- s/cryptmodule/_cryptmodule/ in package payload (rhbz#835021)
+
+* Tue Feb 19 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-19
+- bulletproof the gdb debugging hooks against a failure seen in ARM builds
+(patch 166; rhbz#912025)
+- re-enable make check on ARM (rhbz#912025)
+
+* Tue Feb 19 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-18
+- backport pre-canned ways of salting a password to the "crypt" module from
3.3
+(rhbz#835021)
+
+* Tue Feb 19 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-17
+- remove "_default_patch_fuzz" directive to avoid patches being silently
+misapplied (refresh patch 1, patch 101, patch 102, patch 111, patch 121,
+patch 158; rename patch 1, patch 101, patch 121; apply patch 54 before the
+lib64 patches to avoid fuzz problems caused by the conditional application
+of the lib64 patches)
+
+* Mon Feb 18 2013 Peter Robinson <pbrobinson(a)fedoraproject.org> 2.7.3-16
+- disable make check on ARM for the moment until 912025 is fixed
+
+* Mon Feb 11 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-15
+- add aarch64 (rhbz#909783)
+
+* Thu Nov 29 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-14
+- add BR on bluez-libs-devel (rhbz#879720)
+
+* Thu Aug 9 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-13
+- remove f18 conditional from patch 159
+
+* Fri Jul 27 2012 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.7.3-12
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
+
+* Tue Jul 17 2012 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.3-11
+- fix memory leak in module _hashlib (patch 158, rhbz#836285)
+- fix db4 include path for libdb4 package (f18 and above) (patch 159)
+
+* Tue Jun 26 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-10
+- fix missing include in uid/gid handling patch (patch 157; rhbz#830405)
+
+* Fri Jun 22 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-9
+- use rpm macro for power64 (rhbz#834653)
+
+* Tue May 15 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-8
+- update uid/gid handling to avoid int overflows seen with uid/gid
+values >= 2^31 on 32-bit architectures (patch 157; rhbz#697470)
+
+* Fri May 4 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-7
+- renumber autotools patch from 300 to 5000
+- specfile cleanups
+
+* Mon Apr 30 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-6
+- try again to fix test_gdb.py (patch 156; rhbz#817072)
+
+* Mon Apr 30 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-5
+- fix test_gdb.py (patch 156; rhbz#817072)
+
+* Fri Apr 20 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-4
+- avoid allocating thunks in ctypes unless absolutely necessary, to avoid
+generating SELinux denials on "import ctypes" and "import uuid" when
embedding
+Python within httpd (patch 155; rhbz#814391)
+
+* Thu Apr 19 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-3
+- add explicit version requirements on expat to avoid linkage problems with
+XML_SetHashSalt
+
+* Wed Apr 18 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-2
+- fix -config symlinks (patch 112; rhbz#813836)
+
+* Wed Apr 11 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-1
+- 2.7.3: refresh patch 102 (lib64); drop upstream patches 11 (ascii-to-lower),
+115 (pydoc robustness), 145 (linux2), 148 (gdbm magic values), 151 (deadlock
+in fork); refresh patch 112 (debug build); revise patch 127
+(test_structmember); fix test_gdb (patch 153); refresh patch 137 (distutils
+tests); add python2.pc to python-devel; regenerate the autotool intermediates
+patch (patch 300)
+
+* Sat Feb 25 2012 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.2-20
+- fix deadlock issue (#787712)
+
+* Fri Feb 17 2012 Toshio Kuratomi <toshio(a)fedoraproject.org> - 2.7.2-19
+- Obsolete python-sqlite2
+
+* Thu Nov 24 2011 Ville Skytt <ville.skytta(a)iki.fi> - 2.7.2-18
+- Build with $RPM_LD_FLAGS (#756862).
+- Use xz-compressed source tarball.
+
+* Wed Oct 26 2011 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.7.2-17
+- Rebuilt for glibc bug#747377
+
+* Fri Sep 30 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-16
+- re-enable gdbm (patch 148; rhbz#742242)
+
+* Fri Sep 16 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-15
+- add a sys._debugmallocstats() function (patch 147)
+
+* Wed Sep 14 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-14
+- support OpenSSL FIPS mode in _hashlib and hashlib; don't build the _md5 and
+_sha* modules, relying on _hashlib in hashlib, and thus within md5 etc
+(rhbz#563986; patch 146)
+
+* Wed Sep 14 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-13
+- force sys.platform to be "linux2" (patch 145)
+
+* Tue Sep 13 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-12
+- disable gdbm module to prepare for gdbm soname bump
+
+* Mon Sep 12 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-11
+- rename and renumber patches for consistency with python3.spec (55, 111, 113,
+114, 125, 131, 129 to 143)
+
+* Sat Sep 10 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-10
+- rewrite of "check", introducing downstream-only hooks for skipping specific
+cases in an rpmbuild (patch 132), and fixing/skipping failing tests in a more
+fine-grained manner than before (patches 104, 133-142)
+
+* Thu Sep 1 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-9
+- run selftests with "--verbose"
+- disable parts of test_io on ppc (rhbz#732998)
+
+* Tue Aug 23 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-8
+- add --extension-suffix option to python-config (patch 130; rhbz#732808)
+
+* Tue Aug 23 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-7
+- re-enable and fix the --with-tsc option on ppc64, and rework it on 32-bit
+ppc to avoid aliasing violations (patch 129; rhbz#698726)
+
+* Tue Aug 23 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-6
+- don't use --with-tsc on ppc64 debug builds (rhbz#698726)
+
+* Thu Aug 18 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-5
+- add rpm macros file (rhbz#731800)
+
+* Fri Jul 8 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-4
+- cleanup of BuildRequires; add comment headings to specfile sections
+
+* Wed Jun 22 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-3
+- reorganize test exclusions (test_openpty and test_pty seem to be failing on
+every arch, not just the explicitly-listed ones)
+
+* Mon Jun 13 2011 Dan Hork <dan[at]danny.cz> - 2.7.2-2
+- add s390(x) excluded tests
+
+* Mon Jun 13 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-1
+- 2.7.2; drop upstreamed patches: patch 122 (parallel make fix), patch 124
+(test_commands and SELinux), patch 130 (ppc preprocessor macro in debug
+build); patch 131 (decimal in Turkish locale); regenerate the autotool
+intermediates patch (patch 300)
+
+* Tue Jun 07 2011 Dennis Gilmore <dennis(a)ausil.us> - 2.7.1-9
+- fix sparc building by excluding failing tests RHBZ#711584
+
+* Mon May 23 2011 Peter Robinson <pbrobinson(a)gmail.com> - 2.7.1-8
+- fix compile on ARM by excluding failing tests on arm - RHBZ #706253
+
+* Tue Apr 12 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.1-7
+- fix "import decimal" in the Turkish locale (patch 131; rhbz#694928)
+
+* Wed Feb 09 2011 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.7.1-6
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
+
+* Fri Jan 21 2011 Toshio Kuratomi <toshio(a)fedoraproject.org> - 2.7.1-5
+- Switch from setting OPT to setting EXTRA_CFLAGS so we don't overwrite the
+ DNDEBUG flag
+
+* Fri Jan 7 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.1-4
+- for now, drop "obsoletes" of python-argparse, since it interracts badly with
+multilib (rhbz#667984)
+
+* Fri Jan 7 2011 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.1-3
+- obsolete/provide python-argparse (new in 2.7)
+
+* Thu Jan 6 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.1-2
+- fix the ppc build of the debug configuration (patch 130; rhbz#661510)
+
+* Thu Dec 23 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7.1-1
+- 2.7.1, reworking patch 0 (config), patch 102 (lib64); drop upstream
+patch 56 (cfgparse), patch 110 (ctypes/SELinux/noexecmem), patch 119 (expat
+compat), patch 123 (2to3 on "from itertools import *")
+- fix test_abc's test_cache_leak in the debug build (patch 128)
+- drop _weakref.so from manifest (_weakref became a core module in r84230)
+
+* Wed Sep 29 2010 jkeating - 2.7-13
+- Rebuilt for gcc bug 634757
+
+* Mon Sep 27 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-12
+- fix test_structmember on 64bit-bigendian (patch 127)
+
+* Fri Sep 24 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-11
+- fix dbm_contains on 64bit-bigendian (patch 126; rhbz#626756)
+
+* Thu Sep 16 2010 Toshio Kuratomi <toshio(a)fedoraproject.org> - 2.7-10
+- backport a patch to fix a change in behaviour in configparse.
+
+* Thu Sep 9 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-9
+- move most of the payload of the core package to the libs subpackage, given
+that the libs aren't meaningfully usable without the standard libraries
+
+* Wed Aug 18 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-8
+- add %%check section
+- update lib64 patch (patch 102) to fix expected output in test_site.py on
+64-bit systems
+- patch test_commands.py to work with SELinux (patch 124)
+- patch the debug build's usage of COUNT_ALLOCS to be less verbose (patch 125)
+
+* Mon Jul 26 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-7
+- fixup missing -lcrypt to "crypt" module in config patch (patch 0)
+
+* Mon Jul 26 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-6
+- re-enable systemtap
+- cherrypick upstream patch to 2to3 for "from itertools import *"
+traceback (patch 123)
+
+* Thu Jul 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-5
+- disable systemtap for now (dtrace is failing on startup due to the bug
+mentioned in 2.7-4)
+- provide relative path to python binary when running pathfix.py
+- fix parallel make (patch 122)
+
+* Thu Jul 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-4
+- fix reference to pyconfig.h in sysconfig that led to failure on startup if
+python-devel was not installed
+
+* Thu Jul 8 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-3
+- add patch to fixup the new sysconfig.py for our multilib support on
+64-bit (patch 103)
+
+* Thu Jul 8 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-2
+- add machinery for regenerating the "configure" script in the face of
+mismatching autoconf versions (patch 300)
+
+* Tue Jul 6 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-1
+- 2.7 final; drop alphatag
+- drop patch 117 (upstream), patch 120 (upstreamed)
+- fix the commented-out __python_ver from 26 to 27
+
+* Tue Jun 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-0.1.rc2
+- 2.7rc2
+- revert r79310 (patch 121)
+- remove modulator: upstream removed it in r78338
+- rename mathmodule(_d).so to math(_d).so in manifests (appears to be changed
+by r76861)
+- _bytesio(_d).so and _filesio(_d).so were consolidated into _io(_d).so in
+r73394 (upstream issue 6215)
+- use the gdb hooks from the upstream tarball, rather than keeping our own
+copy. The upstream version has some whitespace changes, a new write_repr for
+unicode objects, and various bulletproofings for being run on older gdbs
+
+* Tue Jun 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-0.1.rc1
+- 2.7rc1:
+ - rework patches to apply against 2.7 (which among other changes has had a
+whitespace cleanup of the .c code): .rhconfig (patch0), .binutils-no-dep
+(patch10), .ascii-tolower (patch11), .socketmodule (patch13), .socketmodule2
+(patch14), .systemtap (patch55), .lib64 (patch102), .selinux (patch110),
+.no-static-lib (patch111), .debug-build (patch112), .statvfs-f-flag-constants
+(patch114), ..CVE-2010-2089 (patch117)
+ - drop upstream patches: .expat (patch3), .brprpm (patch51), .valgrind
+(patch52), .db48 (patch53), .CVE-2010-1634 (patch 116), .CVE-2008-5983 (patch
+118)
+
+* Tue Jun 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-17
+- Stop python bailing out with an assertion failure when UnicodeDecodeErrors
+occur on very large buffers (patch 120, upstream issue 9058)
+
+* Mon Jun 21 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-16
+- Fix an incompatibility between pyexpat and the system expat-2.0.1 that led to
+a segfault running test_pyexpat.py (patch 119; upstream issue 9054)
+
+* Tue Jun 8 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-15
+- add a flag to make it easy to turn off the debug build when troubleshooting
+the rpm build
+
+* Sat Jun 5 2010 Dan Hork <dan[at]danny.cz> - 2.6.5-14
+- reading the timestamp counter is available only on some arches (see Python/ceval.c)
+- disable --with-valgrind on s390(x) arches
+
+* Fri Jun 4 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-13
+- ensure that the compiler is invoked with "-fwrapv" (rhbz#594819)
+- CVE-2010-1634: fix various integer overflow checks in the audioop
+module (patch 116)
+- CVE-2010-2089: further checks within the audioop module (patch 117)
+- CVE-2008-5983: the new PySys_SetArgvEx entry point from r81399 (patch 118)
+
+* Thu May 27 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-12
+- make "pydoc -k" more robust in the face of broken modules (rhbz:461419,
patch115)
+
+* Wed May 26 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-11
+- add flags for statvfs.f_flag to the constant list in posixmodule (i.e. "os")
+(patch 114)
+
+* Tue May 25 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-10
+- add configure-time support for COUNT_ALLOCS and CALL_PROFILE debug options
+(patch 113); enable them and the WITH_TSC option within the debug build
+
+* Tue May 18 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-9
+- build and install two different configurations of Python: debug and standard,
+packaging the debug build in a new "python-debug" subpackage (patch 112)
+
+* Tue May 4 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-8
+- don't delete wsgiref.egg-info (rhbz:588426)
+
+* Mon Apr 26 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-7
+- disable --with-valgrind on sparc arches
+
+* Mon Apr 12 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-6
+- move the "bdist_wininst" command's template .exe files from the core
package
+to the devel subpackage, to save space (rhbz:525469)
+- fix stray doublelisting of config directory wildcard in devel subpackage
+
+* Wed Mar 31 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-5
+- update python-gdb.py from v4 to v5 (improving performance and stability,
+adding commands)
+
+* Thu Mar 25 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-4
+- update python-gdb.py from v3 to v4 (fixing infinite recursion on reference
+cycles and tracebacks on bytes 0x80-0xff in strings, adding handlers for sets
+and exceptions)
+
+* Wed Mar 24 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-3
+- refresh gdb hooks to v3 (reworking how they are packaged)
+
+* Mon Mar 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-2
+- remove unnecessary arch-conditionality for patch 101
+
+* Fri Mar 19 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-1
+- update to 2.6.5:
http://www.python.org/download/releases/2.6.5/
+- replace our patch to compile against db4.8 with a patch from
+upstream (patch 53, from r78974); update patch 54 since part of it is now in
+that upstream patch
+- update patch 110 so that it still applies in the face of upstream r78380
+
+* Tue Mar 16 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-23
+- fixup distutils/unixccompiler.py to remove standard library path from
+rpath (patch 17)
+- delete DOS batch files
+
+* Fri Mar 12 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-22
+- add pyfuntop.stp; allow systemtap support to be disabled
+- remove trailing period from tkinter summary
+- don't own /usr/bin/python-config if you're not the main python
+
+* Thu Mar 11 2010 Marcela Malov <mmaslano(a)redhat.com> - 2.6.4-21
+- rebuild with new gdbm
+
+* Thu Feb 11 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-20
+- avoid having the "test" subdirectory and the files within it that are in the
+core subpackage also be owned by the test subpackage (rhbz:467588)
+
+* Wed Feb 10 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-19
+- revise the systemtap patch (patch 55:python-2.6.4-dtrace.patch) to the
+new version by mjw in attachment 390110 of rhbz:545179, as this should
+eliminate the performance penalty for the case where the probes aren't in
+use, and eliminate all architecture-specific code (rhbz:563541; except on
+sparc)
+
+* Tue Feb 9 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-18
+- add a systemtap tapset defining "python.function.entry" and
+"python.function.return" to make it easy to use the static probepoint within
+Python; add an example of using the tapset to the docs
+
+* Tue Feb 9 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-17
+- add systemtap static probes (wcohen; patch 55; rh bug #545179)
+- update some comments in specfile relating to gdb work
+- manually byte-compile the gdb.py file with the freshly-built python to ensure
+that .pyx and .pyo files make it into the debuginfo manifest if they are later
+byte-compiled after find-debuginfo.sh is run
+
+* Mon Feb 8 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-16
+- move the -gdb.py file from %%{_libdir}/INSTSONAME-gdb.py to
+%%{_prefix}/lib/debug/%%{_libdir}/INSTSONAME.debug-gdb.py to avoid noise from
+ldconfig (bug 562980), and which should also ensure it becomes part of the
+debuginfo subpackage, rather than the libs subpackage
+- introduce %%{py_SOVERSION} and %%{py_INSTSONAME} to reflect the upstream
+configure script, and to avoid fragile scripts that try to figure this out
+dynamically (e.g. for the -gdb.py change)
+
+* Mon Feb 8 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-15
+- work around bug 562906 by supplying a fixed version of pythondeps.sh
+- set %%{_python_bytecompile_errors_terminate_build} to 0 to prevent the broken
+test files from killing the build on buildroots where python is installed
+
+* Fri Feb 5 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-14
+- add gdb hooks for easier debugging
+
+* Fri Jan 29 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-13
+- document all patches, and remove the commented-out ones
+
+* Tue Jan 26 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-12
+- Address some of the issues identified in package review (bug 226342):
+ - update libs requirement on base package to use %%{name} for consistency's
+sake
+ - convert from backticks to $() syntax throughout
+ - wrap value of LD_LIBRARY_PATH in quotes
+ - convert "/usr/bin/find" requirement to "findutils"
+ - remove trailing periods from summaries of -devel and -tools subpackages
+ - fix spelling mistake in description of -test subpackage
+ - convert usage of $$RPM_BUILD_ROOT to %%{buildroot} throughout, for
+stylistic consistency
+ - supply dirmode arguments to defattr directives
+
+* Mon Jan 25 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-11
+- update python-2.6.2-config.patch to remove downstream customization of build
+of pyexpat and elementtree modules
+- add patch adapted from upstream (patch 3) to add support for building against
+system expat; add --with-system-expat to "configure" invocation
+- remove embedded copy of expat from source tree during "prep"
+
+* Mon Jan 25 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-10
+- introduce macros for 3 directories, replacing expanded references throughout:
+%%{pylibdir}, %%{dynload_dir}, %%{site_packages}
+- explicitly list all lib-dynload files, rather than dynamically gathering the
+payload into a temporary text file, so that we can be sure what we are
+shipping; remove now-redundant testing for presence of certain .so files
+- remove embedded copy of zlib from source tree before building
+
+* Mon Jan 25 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-9
+- change python-2.6.2-config.patch to remove our downstream change to curses
+configuration in Modules/Setup.dist, so that the curses modules are built using
+setup.py with the downstream default (linking against libncursesw.so, rather
+than libncurses.so), rather than within the Makefile; add a test to %%install
+to verify the dso files that the curses module is linked against the correct
+DSO (bug 539917; changes _cursesmodule.so -> _curses.so)
+
+* Fri Jan 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-8
+- rebuild (bug 556975)
+
+* Wed Jan 20 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-7
+- move lib2to3 from -tools subpackage to main package (bug 556667)
+
+* Mon Jan 18 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-6
+- patch Makefile.pre.in to avoid building static library (patch111, bug 556092)
+- split up the "configure" invocation flags onto individual lines
+
+* Fri Jan 15 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-5
+- replace usage of %%define with %%global
+- use the %%{_isa} macro to ensure that the python-devel dependency on python
+is for the correct multilib arch (#555943)
+- delete bundled copy of libffi to make sure we use the system one
+- replace references to /usr with %%{_prefix}; replace references to
+/usr/include with %%{_includedir}
+
+* Wed Dec 16 2009 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-4
+- automatically disable arena allocator when run under valgrind (upstream
+issue 2422; patch 52)
+- add patch from Josh Boyer containing diff against upstream PyBSDDB to make
+the bsddb module compile against db-4.8 (patch 53, #544275); bump the necessary
+version of db4-devel to 4.8
+- patch setup.py so that it searches for db-4.8, and enable debug output for
+said search; make Setup.dist use db-4.8 (patch 54)
+
+* Thu Nov 12 2009 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-3
+- fixup the build when __python_ver is set (Zach Sadecki; bug 533989); use
+pybasever in the files section
+
+* Thu Oct 29 2009 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-2
+- "Makefile" and the config-32/64.h file are needed by distutils/sysconfig.py
+_init_posix(), so we include them in the core package, along with their parent
+directories (bug 531901)
+
+* Mon Oct 26 2009 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-1
+- Update to 2.6.4
+
+* Fri Aug 21 2009 Tomas Mraz <tmraz(a)redhat.com> - 2.6.2-2
+- rebuilt with new openssl
+
+* Mon Jul 27 2009 James Antill <james.antill(a)redhat.com> - 2.6.2-1
+- Update to 2.6.2
+
+* Sun Jul 26 2009 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.6-11
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
+
+* Sat Jul 4 2009 Jonathan Steffan <jsteffan(a)fedoraproject.org> - 2.6-10
+- Move python-config to devel subpackage (#506153)
+- Update BuildRoot for new standard
+
+* Sun Jun 28 2009 Jonathan Steffan <jsteffan(a)fedoraproject.org> - 2.6-9
+- Update python-tools description (#448940)
+
+* Wed Apr 15 2009 Ignacio Vazquez-Abrams <ivazqueznet+rpm(a)gmail.com> 2.6-8
+- Replace python-hashlib and python-uuid (#484715)
+
+* Tue Mar 17 2009 James Antill <james(a)fedoraproject.org> - 2.6-7
+- Use system libffi
+- Resolves: bug#490573
+- Fix SELinux execmem problems
+- Resolves: bug#488396
+
+* Thu Feb 26 2009 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.6-5
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
+
+* Fri Jan 16 2009 Tomas Mraz <tmraz(a)redhat.com> - 2.6-4
+- rebuild with new openssl
+
+* Tue Jan 6 2009 James Antill <james.antill(a)redhat.com> - 2.6-3
+- Fix distutils generated rpms.
+- Resolves: bug#236535
+
+* Wed Dec 10 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm(a)gmail.com> - 2.6-2
+- Enable -lcrypt for cryptmodule
+
+* Fri Nov 28 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm(a)gmail.com> - 2.6-1
+- Update to 2.6
+
+* Tue Sep 30 2008 James Antill <james.antill(a)redhat.com> - 2.5.2-1
+- Move to 2.5.2
+- Fix CVE-2008-2316 hashlib overflow.
+
+* Thu Jul 17 2008 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-30
+- Fix up the build for new rpm
+- And actually build against db4-4.7 (#455170)
+
+* Thu Jul 10 2008 Tom "spot" Callaway <tcallawa(a)redhat.com> - 2.5.1-27
+- fix license tag
+- enable support for db4-4.7
+
+* Sun Jun 15 2008 James Antill <jantill(a)redhat.com> - 2.5.1-26
+- Fix sporadic listdir problem
+- Resolves: bug#451494
+
+* Mon Apr 7 2008 James Antill <jantill(a)redhat.com> - 2.5.1-25
+- Rebuild to re-gen autoconf file due to glibc change.
+- Resolves: bug#441003
+
+* Tue Mar 25 2008 James Antill <jantill(a)redhat.com> - 2.5.1-24
+- Add more constants to socketmodule
+
+* Sat Mar 8 2008 James Antill <jantill(a)redhat.com> - 2.5.1-22
+- Add constants to socketmodule
+- Resolves: bug#436560
+
+* Tue Feb 19 2008 Fedora Release Engineering <rel-eng(a)fedoraproject.org> -
2.5.1-22
+- Autorebuild for GCC 4.3
+
+* Sun Jan 13 2008 Tom "spot" Callaway <tcallawa(a)redhat.com> - 2.5.1-21
+- rebuild for new tk in rawhide
+
+* Mon Jan 7 2008 James Antill <jantill(a)redhat.com> - 2.5.1-20
+- Add valgrind support files, as doc, to python-devel
+- Relates: rhbz#418621
+- Add new API from 2.6, set_wakeup_fd ... use at own risk, presumably won't
+- change but I have no control to guarantee that.
+- Resolves: rhbz#427794
+- Add gdbinit support file, as doc, to python-devel
+
+* Fri Jan 4 2008 Tom "spot" Callaway <tcallawa(a)redhat.com> - 2.5.1-19
+- rebuild for new tcl/tk in rawhide
+
+* Fri Dec 7 2007 James Antill <jantill(a)redhat.com> - 2.5.1-18
+- Create a python-test sub-module, over 3MB of stuff noone wants.
+- Don't remove egginfo files, try this see what happens ... may revert.
+- Resolves: rhbz#414711
+
+* Mon Dec 3 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-17
+- rebuild for new libssl
+
+* Fri Nov 30 2007 James Antill <jantill(a)redhat.com> - 2.5.1-16
+- Fix pyconfig.h comment typo.
+- Add back test_support.py and the __init__.py file.
+- Resolves: rhbz#387401
+
+* Tue Oct 30 2007 James Antill <jantill(a)redhat.com> - 2.5.1-15
+- Do codec lowercase in C Locale.
+- Resolves: 207134 191096
+- Fix stupid namespacing in pysqlite, minimal upgrade to 2.3.3 pysqlite
+- Resolves: 263221
+
+* Wed Oct 24 2007 James Antill <jantill(a)redhat.com> - 2.5.1-14
+- Remove bintuils dep. for live CD ... add work around for ctypes
+
+* Mon Oct 22 2007 James Antill <jantill(a)redhat.com> - 2.5.1-13
+- Add tix buildprereq
+- Add tkinter patch
+- Resolves: #281751
+- Fix ctypes loading of libraries, add requires on binutils
+- Resolves: #307221
+- Possible fix for CVE-2007-4965 possible exploitable integer overflow
+- Resolves: #295971
+
+* Tue Oct 16 2007 Mike Bonnet <mikeb(a)redhat.com> - 2.5.1-12
+- fix marshalling of objects in xmlrpclib (python bug #1739842)
+
+* Fri Sep 14 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-11
+- fix encoding of sqlite .py files to work around weird encoding problem
+ in Turkish (#283331)
+
+* Mon Sep 10 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-10
+- work around problems with multi-line plural specification (#252136)
+
+* Tue Aug 28 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-9
+- rebuild against new expat
+
+* Tue Aug 14 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-8
+- build against db4.6
+
+* Tue Aug 14 2007 Dennis Gilmore <dennis(a)ausil.us> - 2.5.1-7
+- add sparc64 to the list of archs for _pyconfig64_h
+
+* Fri Aug 10 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-6
+- fix ctypes again on some arches (Hans de Goede, #251637)
+
+* Fri Jul 6 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-5
+- link curses modules with ncursesw (#246385)
+
+* Wed Jun 27 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-4
+- fix _elementtree.so build (#245703)
+- ensure that extension modules we expect are actually built rather than
+ having them silently fall out of the package
+
+* Tue Jun 26 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-3
+- link with system expat (#245703)
+
+* Thu Jun 21 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-2
+- rebuild to take advantage of hardlinking between identical pyc/pyo files
+
+* Thu May 31 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-1
+- update to python 2.5.1
+
+* Mon Mar 19 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-12
+- fix alpha build (#231961)
+
+* Tue Feb 13 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-11
+- tcl/tk was reverted; rebuild again
+
+* Thu Feb 1 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-10
+- rebuild for new tcl/tk
+
+* Tue Jan 16 2007 Miroslav Lichvar <mlichvar(a)redhat.com> - 2.5.3-9
+- link with ncurses
+
+* Sat Jan 6 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-8
+- fix extensions to use shared libpython (#219564)
+- all 64bit platforms need the regex fix (#122304)
+
+* Wed Jan 3 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-7
+- fix ctypes to not require execstack (#220669)
+
+* Fri Dec 15 2006 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-6
+- don't link against compat-db (Robert Scheck)
+
+* Wed Dec 13 2006 Jarod Wilson <jwilson(a)redhat.com> - 2.5.3-5
+- fix invalid assert in debug mode (upstream changeset 52622)
+
+* Tue Dec 12 2006 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-4
+- obsolete/provide python-ctypes (#219256)
+
+* Mon Dec 11 2006 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-3
+- fix atexit traceback with failed syslog logger (#218214)
+- split libpython into python-libs subpackage for multilib apps
+ embedding python interpreters
+
+* Wed Dec 6 2006 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-2
+- disable installation of .egg-info files for now
+
+* Tue Dec 5 2006 Jeremy Katz <katzj(a)redhat.com>
+- support db 4.5
+- obsolete python-elementtree; since it requires some code tweaks, don't
+ provide it
+- obsolete old python-sqlite; provide the version that's actually included
+
+* Mon Oct 30 2006 Jeremy Katz <katzj(a)redhat.com>
+- fix _md5 and _sha modules (Robert Sheck)
+- no longer provide optik compat; it's been a couple of years now
+- no longer provide the old shm module; if this is still needed, let's
+ build it separately
+- no longer provide japanese codecs; should be a separate package
+
+* Mon Oct 23 2006 Jeremy Katz <katzj(a)redhat.com> - 2.5-0
+- update to 2.5.0 final
+
+* Fri Aug 18 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.99.c1
+- Updated to 2.5c1. Merged fixes from FC6 too:
+- Fixed bug #199373 (on some platforms CFLAGS is needed when linking)
+- Fixed bug #198971 (case conversion not locale safe in logging library)
+- Verified bug #201434 (distutils.sysconfig is confused by the change to make
+ python-devel multilib friendly) is fixed upstream
+
+* Sun Jul 16 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.99.b2
+- Updated to 2.5b2 (which for comparison reasons is re-labeled 2.4.99.b2)
+
+* Fri Jun 23 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.99.b1
+- Updated to 2.5b1 (which for comparison reasons is re-labeled 2.4.99.b1)
+
+* Tue Jun 13 2006 Jeremy Katz <katzj(a)redhat.com> - 2.4.3-11.FC6
+- and fix it for real
+
+* Tue Jun 13 2006 Jeremy Katz <katzj(a)redhat.com> - 2.4.3-10.FC6
+- fix python-devel on ia64
+
+* Tue Jun 13 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-9
+- Fixed python-devel to be multilib friendly (bug #192747, #139911)
+
+* Tue Jun 13 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-8
+- Only copying mkhowto from the Docs - we don't need perl dependencies from
+ python-tools.
+
+* Mon Jun 12 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-7
+- Fixed bug #121198 (webbrowser.py should use the user's preferences first)
+
+* Mon Jun 12 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-6
+- Fixed bug #192592 (too aggressive assertion fails) - SF#1257960
+- Fixed bug #167468 (Doc/tools not included) - added in the python-tools package
+
+* Thu Jun 8 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-5
+- Fixed bug #193484 (added pydoc in the main package)
+
+* Mon Jun 5 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-4
+- Added dist in the release
+
+* Mon May 15 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-3
+- rebuilt to fix broken libX11 dependency
+
+* Wed Apr 12 2006 Jeremy Katz <katzj(a)redhat.com> - 2.4.3-2
+- rebuild with new gcc to fix #188649
+
+* Thu Apr 6 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-1
+- Updated to 2.4.3
+
+* Fri Feb 10 2006 Jesse Keating <jkeating(a)redhat.com> - 2.4.2-3.2.1
+- bump again for double-long bug on ppc(64)
+
+* Fri Feb 10 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-3.2
+- rebuilt for newer tix
+
+* Tue Feb 07 2006 Jesse Keating <jkeating(a)redhat.com> - 2.4.2-3.1
+- rebuilt for new gcc4.1 snapshot and glibc changes
+
+* Fri Jan 20 2006 Mihai Ibanescu <misa(a)redhat.com> 2.4.2-3
+- fixed #136654 for another instance of audiotest.au
+
+* Fri Dec 09 2005 Jesse Keating <jkeating(a)redhat.com>
+- rebuilt
+
+* Sat Nov 19 2005 Bill Nottingham <notting(a)redhat.com> 2.4.2-2
+- fix build for modular X, remove X11R6 path references
+
+* Tue Nov 15 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.2-1
+- Upgraded to 2.4.2
+- BuildRequires autoconf
+
+* Wed Nov 9 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-16
+- Rebuilding against newer openssl.
+- XFree86-devel no longer exists
+
+* Mon Sep 26 2005 Peter Jones <pjones(a)redhat.com> 2.4.1-14
+- Once more -- this time, to fix -EPERM when you run it in a directory
+ you can't read from.
+
+* Mon Sep 26 2005 Peter Jones <pjones(a)redhat.com> 2.4.1-13
+- So, 5 or 6 people have said it works for them with this patch...
+
+* Sun Sep 25 2005 Peter Jones <pjones(a)redhat.com> 2.4.1-12
+- Fixed bug #169159 (check for argc>0 and argv[0] == NULL, not just
+ argv[0][0]='\0')
+ Reworked the patch from -8 a bit more.
+
+* Fri Sep 23 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-10
+- Fixed bug #169159 (don't let python core dump if no arguments are passed in)
+ Reworked the patch from -8 a bit more.
+
+* Thu Sep 22 2005 Peter Jones <pjones(a)redhat.com> 2.4.1-8
+- Fix bug #169046 more correctly.
+
+* Thu Sep 22 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-7
+- Fixed bug #169046 (realpath is unsafe); thanks to
+ Peter Jones <pjones(a)redhat.com> and Arjan van de Ven <arjanv(a)redhat.com>
for
+ diagnosing and the patch.
+
+* Tue Sep 20 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-4
+- Fixed bug #168655 (fixes for building as python24)
+
+* Tue Jul 26 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-3
+- Fixed bug #163435 (pynche doesn't start))
+
+* Wed Apr 20 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-2
+- Fixed bug #143667 (python should own /usr/lib/python* on 64-bit systems, for
+ noarch packages)
+- Fixed bug #143419 (BuildRequires db4 is not versioned)
+
+* Wed Apr 6 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-1
+- updated to 2.4.1
+
+* Mon Mar 14 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4-6
+- building the docs from a different source rpm, to decouple bootstrapping
+ python from having tetex installed
+
+* Fri Mar 11 2005 Dan Williams <dcbw(a)redhat.com> 2.4-5
+- Rebuild to pick up new libssl.so.5
+
+* Wed Feb 2 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4-4
+- Fixed security issue in SimpleXMLRPCServer.py (#146647)
+
+* Wed Jan 12 2005 Tim Waugh <twaugh(a)redhat.com> 2.4-3
+- Rebuilt for new readline.
+
+* Mon Dec 6 2004 Jeff Johnson <jbj(a)jbj.org> 2.4-2
+- db-4.3.21 returns DB_BUFFER_SMALL rather than ENOMEM (#141994).
+- add Provide: python(abi) = 2.4
+- include msgfmt/pygettext *.pyc and *.pyo from brp-python-bytecompile.
+
+* Fri Dec 3 2004 Mihai Ibanescu <misa(a)redhat.com> 2.4-1
+- Python-2.4.tar.bz2 (final)
+
+* Fri Nov 19 2004 Mihai Ibanescu <misa(a)redhat.com> 2.4-0.c1.1
+- Python-2.4c1.tar.bz2 (release candidate 1)
+
+* Thu Nov 11 2004 Jeff Johnson <jbj(a)jbj.org> 2.4-0.b2.4
+- rebuild against db-4.3.21.
+
+* Mon Nov 8 2004 Jeremy Katz <katzj(a)redhat.com> - 2.4-0.b2.3
+- fix the lib64 patch so that 64bit arches still look in /usr/lib/python...
+
+* Mon Nov 8 2004 Jeremy Katz <katzj(a)redhat.com> - 2.4-0.b2.2
+- cryptmodule still needs -lcrypt (again)
+
+* Thu Nov 4 2004 Mihai Ibanescu <misa(a)redhat.com> 2.4-0.b2.1
+- Updated to python 2.4b2 (and labeled it 2.4-0.b2.1 to avoid breaking rpm's
+ version comparison)
+
+* Thu Nov 4 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-13
+- Fixed bug #138112 (python overflows stack buffer) - SF bug 105470
+
+* Tue Nov 2 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-12
+- Fixed bugs #131439 #136023 #137863 (.pyc/.pyo files had the buildroot added)
+
+* Tue Oct 26 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-11
+- Fixed bug #136654 (python has sketchy audio clip)
+
+* Tue Aug 31 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-10
+- Fixed bug #77418 (Demo dir not packaged)
+- More tweaking on #19347 (Moved Tools/ under /usr/lib/python2.3/Tools)
+
+* Fri Aug 13 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-8
+- Fixed bug #129769: Makefile in new python conflicts with older version found
+ in old python-devel
+- Reorganized the spec file to get rid of the aspython2 define; __python_ver
+ is more powerful.
+
+* Tue Aug 3 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-7
+- Including html documentation for non-i386 arches
+- Fixed #125362 (python-doc html files have japanese character encoding)
+- Fixed #128923 (missing dependency between python and python-devel)
+
+* Fri Jul 30 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-6
+- Fixed #128030 (help() not printing anything)
+- Fixed #125472 (distutils.sysconfig.get_python_lib() not returning the right
+ path on 64-bit systems)
+- Fixed #127357 (building python as a shared library)
+- Fixed #19347 (including the contents of Tools/scripts/ in python-tools)
+
+* Tue Jun 15 2004 Elliot Lee <sopwith(a)redhat.com>
+- rebuilt
+
+* Tue Jun 8 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-3
+- Added an optik.py that provides the same interface from optparse for
+ backward compatibility; obsoleting python-optik
+
+* Mon Jun 7 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-2
+- Patched bdist_rpm to allow for builds of multiple binary rpms (bug #123598)
+
+* Fri Jun 4 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-1
+- Updated to 2.3.4-1 with Robert Scheck's help (bug #124764)
+- Added BuildRequires: tix-devel (bug #124918)
+
+* Fri May 7 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.3-6
+- Correct fix for #122304 from upstream:
+
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=93184...
+
+* Thu May 6 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.3-4
+- Fix for bug #122304 : splitting the domain name fails on 64-bit arches
+- Fix for bug #120879 : including Makefile into the main package
+
+- Requires XFree86-devel instead of -libs (see bug #118442)
+
+* Tue Mar 16 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.3-3
+- Requires XFree86-devel instead of -libs (see bug #118442)
+
+* Tue Mar 02 2004 Elliot Lee <sopwith(a)redhat.com>
+- rebuilt
+
+* Fri Feb 13 2004 Elliot Lee <sopwith(a)redhat.com>
+- rebuilt
+
+* Fri Dec 19 2003 Jeff Johnson <jbj(a)jbj.org> 2.3.3-1
+- upgrade to 2.3.3.
+
+* Sat Dec 13 2003 Jeff Johnson <jbj(a)jbj.org> 2.3.2-9
+- rebuild against db-4.2.52.
+
+* Fri Dec 12 2003 Jeremy Katz <katzj(a)redhat.com> 2.3.2-8
+- more rebuilding for new tcl/tk
+
+* Wed Dec 3 2003 Jeff Johnson <jbj(a)jbj.org> 2.3.2-7.1
+- rebuild against db-4.2.42.
+
+* Fri Nov 28 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.2-7
+- rebuilt against newer tcl/tk
+
+* Mon Nov 24 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.2-6
+- added a Provides: python-abi
+
+* Wed Nov 12 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.2-5
+- force CC (#109268)
+
+* Sun Nov 9 2003 Jeremy Katz <katzj(a)redhat.com> 2.3.2-4
+- cryptmodule still needs -lcrypt
+
+* Wed Nov 5 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.2-2
+- Added patch for missing mkhowto
+
+* Thu Oct 16 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.2-1
+- Updated to 2.3.2
+
+* Thu Sep 25 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.1-1
+- 2.3.1 final
+
+* Tue Sep 23 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.1-0.8.RC1
+- Building the python 2.3.1 release candidate
+- Updated the lib64 patch
+
+* Wed Jul 30 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3-0.2
+- Building python 2.3
+- Added more BuildRequires
+- Updated the startup files for modulator and pynche; idle installs its own
+ now.
+
+* Thu Jul 3 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.3-4
+- Rebuilt against newer db4 packages (bug #98539)
+
+* Mon Jun 9 2003 Elliot Lee <sopwith(a)redhat.com> 2.2.3-3
+- rebuilt
+
+* Sat Jun 7 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.3-2
+- Rebuilt
+
+* Fri Jun 6 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.3-1
+- Upgraded to 2.2.3
+
+* Wed Apr 2 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-28
+- Rebuilt
+
+* Wed Apr 2 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-27
+- Modified the ftpuri patch conforming to
http://ietf.org/rfc/rfc1738.txt
+
+* Mon Feb 24 2003 Elliot Lee <sopwith(a)redhat.com>
+- rebuilt
+
+* Mon Feb 24 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-25
+- Fixed bug #84886: pydoc dies when run w/o arguments
+- Fixed bug #84205: add python shm module back (used to be shipped with 1.5.2)
+- Fixed bug #84966: path in byte-compiled code still wrong
+
+* Thu Feb 20 2003 Jeremy Katz <katzj(a)redhat.com> 2.2.2-23
+- ftp uri's should be able to specify being rooted at the root instead of
+ where you login via ftp (#84692)
+
+* Mon Feb 10 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-22
+- Using newer Japanese codecs (1.4.9). Thanks to
+ Peter Bowen <pzb(a)datastacks.com> for pointing this out.
+
+* Thu Feb 6 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-21
+- Rebuild
+
+* Wed Feb 5 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-20
+- Release number bumped really high: turning on UCS4 (ABI compatibility
+ breakage)
+
+* Fri Jan 31 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-13
+- Attempt to look both in /usr/lib64 and /usr/lib/python2.2/site-packages/:
+ some work on python-2.2.2-lib64.patch
+
+* Thu Jan 30 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-12
+- Rebuild to incorporate the removal of .lib64 and - files.
+
+* Thu Jan 30 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-11.7.3
+- Fixed bug #82544: Errata removes most tools
+- Fixed bug #82435: Python 2.2.2 errata breaks redhat-config-users
+- Removed .lib64 and - files that get installed after we fix the multilib
+ .py files.
+
+* Wed Jan 22 2003 Tim Powers <timp(a)redhat.com>
+- rebuilt
+
+* Wed Jan 15 2003 Jens Petersen <petersen(a)redhat.com> 2.2.2-10
+- rebuild to update tkinter's tcltk deps
+- convert changelog to utf-8
+
+* Tue Jan 7 2003 Nalin Dahyabhai <nalin(a)redhat.com> 2.2.2-9
+- rebuild
+
+* Fri Jan 3 2003 Nalin Dahyabhai <nalin(a)redhat.com>
+- pick up OpenSSL cflags and ldflags from pkgconfig if available
+
+* Thu Jan 2 2003 Jeremy Katz <katzj(a)redhat.com> 2.2.2-8
+- urllib2 didn't support non-anonymous ftp. add support based on how
+ urllib did it (#80676, #78168)
+
+* Mon Dec 16 2002 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-7
+- Fix bug #79647 (Rebuild of SRPM fails if python isn't installed)
+- Added a bunch of missing BuildRequires found while fixing the
+ above-mentioned bug
+
+* Tue Dec 10 2002 Tim Powers <timp(a)redhat.com> 2.2.2-6
+- rebuild to fix broken tcltk deps for tkinter
+
+* Fri Nov 22 2002 Mihai Ibanescu <misa(a)redhat.com>
+2.2.2-3.7.3
+- Recompiled for 7.3 (to fix the -lcrypt bug)
+- Fix for the spurious error message at the end of the build (build-requires
+ gets confused by executable files starting with """"): make the
tests
+ non-executable.
+
+* Wed Nov 20 2002 Mihai Ibanescu <misa(a)redhat.com>
+2.2.2-5
+- Fixed configuration patch to add -lcrypt when compiling cryptmodule.c
+
+2.2.2-4
+- Spec file change from Matt Wilson <msw(a)redhat.com> to disable linking
+ with the C++ compiler.
+
+* Mon Nov 11 2002 Mihai Ibanescu <misa(a)redhat.com>
+2.2.2-3.*
+- Merged patch from Karsten Hopp <karsten(a)redhat.de> from 2.2.1-17hammer to
+ use %%{_libdir}
+- Added XFree86-libs as BuildRequires (because of tkinter)
+- Fixed duplicate listing of plat-linux2
+- Fixed exclusion of lib-dynload/japanese
+- Added lib64 patch for the japanese codecs
+- Use setup magic instead of using tar directly on JapaneseCodecs
+
+* Tue Nov 5 2002 Mihai Ibanescu <misa(a)redhat.com>
+2.2.2-2
+- Fix #76912 (python-tools contains idle, which uses tkinter, but there is no
+ requirement of tkinter from python-tools).
+- Fix #74013 (rpm is missing the /usr/lib/python2.2/test directory)
+
+* Mon Nov 4 2002 Mihai Ibanescu <misa(a)redhat.com>
+- builds as python2 require a different libdb
+- changed the buildroot name of python to match python2 builds
+
+* Fri Nov 1 2002 Mihai Ibanescu <misa(a)redhat.com>
+- updated python to 2.2.2 and adjusted the patches accordingly
+
+* Mon Oct 21 2002 Mihai Ibanescu <misa(a)redhat.com>
+- Fix #53930 (Python-2.2.1-buildroot-bytecode.patch)
+- Added BuildPrereq dependency on gcc-c++
+
+* Fri Aug 30 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-17
+- security fix for _execvpe
+
+* Tue Aug 13 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-16
+- Fix #71011,#71134, #58157
+
+* Wed Aug 7 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-15
+- Resurrect tkinter
+- Fix for distutils (#67671)
+- Fix #69962
+
+* Thu Jul 25 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-14
+- Obsolete tkinter/tkinter2 (#69838)
+
+* Tue Jul 23 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-13
+- Doc fixes (#53951) - not on alpha at the momemt
+
+* Mon Jul 8 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-12
+- fix pydoc (#68082)
+
+* Mon Jul 8 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-11
+- Add db4-devel as a BuildPrereq
+
+* Fri Jun 21 2002 Tim Powers <timp(a)redhat.com> 2.2.1-10
+- automated rebuild
+
+* Mon Jun 17 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-9
+- Add Japanese codecs (#66352)
+
+* Tue Jun 11 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-8
+- No more tkinter...
+
+* Wed May 29 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-7
+- Rebuild
+
+* Tue May 21 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-6
+- Add the email subcomponent (#65301)
+
+* Fri May 10 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-5
+- Rebuild
+
+* Thu May 02 2002 Than Ngo <than(a)redhat.com> 2.2.1-4
+- rebuild i new enviroment
+
+* Tue Apr 23 2002 Trond Eivind Glomsrd <teg(a)redhat.com>
+- Use ucs2, not ucs4, to avoid breaking tkinter (#63965)
+
+* Mon Apr 22 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-2
+- Make it use db4
+
+* Fri Apr 12 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-1
+- 2.2.1 - a bugfix-only release
+
+* Fri Apr 12 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-16
+- the same, but in builddirs - this will remove them from the
+ docs package, which doesn't look in the buildroot for files.
+
+* Fri Apr 12 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-15
+- Get rid of temporary files and .cvsignores included
+ in the tarball and make install
+
+* Fri Apr 5 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-14
+- Don't own lib-tk in main package, only in tkinter (#62753)
+
+* Mon Mar 25 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-13
+- rebuild
+
+* Mon Mar 25 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-12
+- rebuild
+
+* Fri Mar 1 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-11
+- Add a not to the Distutils obsoletes test (doh!)
+
+* Fri Mar 1 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-10
+- Rebuild
+
+* Mon Feb 25 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-9
+- Only obsolete Distutils when built as python
+
+* Thu Feb 21 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-8
+- Make files in /usr/bin install side by side with python 1.5 when
+- Drop explicit requirement of db4
+ built as python2
+
+* Thu Jan 31 2002 Elliot Lee <sopwith(a)redhat.com> 2.2-7
+- Use version and pybasever macros to make updating easy
+- Use _smp_mflags macro
+
+* Tue Jan 29 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-6
+- Add db4-devel to BuildPrereq
+
+* Fri Jan 25 2002 Nalin Dahyabhai <nalin(a)redhat.com> 2.2-5
+- disable ndbm support, which is db2 in disguise (really interesting things
+ can happen when you mix db2 and db4 in a single application)
+
+* Thu Jan 24 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-4
+- Obsolete subpackages if necesarry
+- provide versioned python2
+- build with db4
+
+* Wed Jan 16 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-3
+- Alpha toolchain broken. Disable build on alpha.
+- New openssl
+
+* Wed Dec 26 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-1
+- 2.2 final
+
+* Fri Dec 14 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.11c1
+- 2.2 RC 1
+- Don't include the _tkinter module in the main package - it's
+ already in the tkiter packace
+- Turn off the mpzmodule, something broke in the buildroot
+
+* Wed Nov 28 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.10b2
+- Use -fPIC for OPT as well, in lack of a proper libpython.so
+
+* Mon Nov 26 2001 Matt Wilson <msw(a)redhat.com> 2.2-0.9b2
+- changed DESTDIR to point to / so that distutils will install dynload
+ modules properly in the installroot
+
+* Fri Nov 16 2001 Matt Wilson <msw(a)redhat.com> 2.2-0.8b2
+- 2.2b2
+
+* Fri Oct 26 2001 Matt Wilson <msw(a)redhat.com> 2.2-0.7b1
+- python2ify
+
+* Fri Oct 19 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.5b1
+- 2.2b1
+
+* Sun Sep 30 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.4a4
+- 2.2a4
+- Enable UCS4 support
+- Enable IPv6
+- Provide distutils
+- Include msgfmt.py and pygettext.py
+
+* Fri Sep 14 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.3a3
+- Obsolete Distutils, which is now part of the main package
+- Obsolete python2
+
+* Thu Sep 13 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.2a3
+- Add docs, tools and tkinter subpackages, to match the 1.5 layout
+
+* Wed Sep 12 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.1a3
+- 2.2a3
+- don't build tix and blt extensions
+
+* Mon Aug 13 2001 Trond Eivind Glomsrd <teg(a)redhat.com>
+- Add tk and tix to build dependencies
+
+* Sat Jul 21 2001 Trond Eivind Glomsrd <teg(a)redhat.com>
+- 2.1.1 bugfix release - with a GPL compatible license
+
+* Fri Jul 20 2001 Trond Eivind Glomsrd <teg(a)redhat.com>
+- Add new build dependencies (#49753)
+
+* Tue Jun 26 2001 Nalin Dahyabhai <nalin(a)redhat.com>
+- build with -fPIC
+
+* Fri Jun 1 2001 Trond Eivind Glomsrd <teg(a)redhat.com>
+- 2.1
+- reorganization of file includes
+
+* Wed Dec 20 2000 Trond Eivind Glomsrd <teg(a)redhat.com>
+- fix the "requires" clause, it lacked a space causing problems
+- use %%{_tmppath}
+- don't define name, version etc
+- add the available patches from the Python home page
+
+* Fri Dec 15 2000 Matt Wilson <msw(a)redhat.com>
+- added devel subpackage
+
+* Fri Dec 15 2000 Matt Wilson <msw(a)redhat.com>
+- modify all files to use "python2.0" as the intrepter
+- don't build the Expat bindings
+- build against db1
+
+* Mon Oct 16 2000 Jeremy Hylton <jeremy(a)beopen.com>
+- updated for 2.0 final
+
+* Mon Oct 9 2000 Jeremy Hylton <jeremy(a)beopen.com>
+- updated for 2.0c1
+- build audioop, imageop, and rgbimg extension modules
+- include xml.parsers subpackage
+- add test.xml.out to files list
+
+* Thu Oct 5 2000 Jeremy Hylton <jeremy(a)beopen.com>
+- added bin/python2.0 to files list (suggested by Martin v. L?)
+
+* Tue Sep 26 2000 Jeremy Hylton <jeremy(a)beopen.com>
+- updated for release 1 of 2.0b2
+- use .bz2 version of Python source
+
+* Tue Sep 12 2000 Jeremy Hylton <jeremy(a)beopen.com>
+- Version 2 of 2.0b1
+- Make the package relocatable. Thanks to Suchandra Thapa.
+- Exclude Tkinter from main RPM. If it is in a separate RPM, it is
+ easier to track Tk releases.
commit 158b422995d7fc5e2b6dba5d2f480c645cbaa555
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Mon Nov 7 14:23:37 2016 +0100
Rename package to python2 and rename accordingly the respective subpackages.
Add obs macro with the value 2.7.12-9 to indicate when the package got renamed
and use it for the obsolete tags.
Provide and obsolete the previous package names to ensure a clean upgrade path.
diff --git a/python.spec b/python.spec
index 9fb3da0..13fe4d3 100644
--- a/python.spec
+++ b/python.spec
@@ -6,7 +6,12 @@
%global unicode ucs4
-%global python python
+%global python python2
+
+# Macro for using the version-release where python got
+# renamed to python2 at Fedora 26, in order to ensure clean upgrade path.
+# It should be removed along with the obsoletes at Fedora 28.
+%global obs 2.7.12-9
%global pybasever 2.7
%global pylibdir %{_libdir}/python%{pybasever}
@@ -98,7 +103,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.12
-Release: 8%{?dist}
+Release: 9%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -786,7 +791,12 @@ Patch5000: 05000-autotool-intermediates.patch
# Additional metadata, and subpackages
# ======================================================
-Provides: python2 = %{version}
+Provides: python = %{version}-%{release}
+Provides: python%{?_isa} = %{version}-%{release}
+Obsoletes: python < %{obs}
+
+# Providing python27 as now multiple interpreters exist in Fedora
+# alongside the system one e.g. python26, python33 etc
Provides: python27 = %{version}-%{release}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -824,6 +834,10 @@ Group: Applications/System
# yet upgraded expat:
Requires: expat >= 2.1.0
+Provides: python-libs = %{version}-%{release}
+Provides: python-libs%{?_isa} = %{version}-%{release}
+Obsoletes: python-libs < %{obs}
+
%description libs
This package contains runtime libraries for use by Python:
- the libpython dynamic library, for use by applications that embed Python as
@@ -841,6 +855,10 @@ Requires: pkgconfig
# package
Conflicts: %{python} < %{version}-%{release}
+Provides: python-devel = %{version}-%{release}
+Provides: python-devel%{?_isa} = %{version}-%{release}
+Obsoletes: python-devel < %{obs}
+
%description devel
The Python programming language's interpreter can be extended with
dynamically loaded extensions and can be embedded in other programs.
@@ -856,19 +874,31 @@ documentation.
Summary: A collection of development tools included with Python
Group: Development/Tools
Requires: %{name} = %{version}-%{release}
-Requires: %{tkinter} = %{version}-%{release}
+Requires: %{python}-tkinter = %{version}-%{release}
+
+Provides: python-tools = %{version}-%{release}
+Provides: python-tools%{?_isa} = %{version}-%{release}
+Obsoletes: python-tools < %{obs}
%description tools
This package includes several tools to help with the development of Python
programs, including IDLE (an IDE with editing and debugging facilities), a
color editor (pynche), and a python gettext program (pygettext.py).
-%package -n %{tkinter}
+%package tkinter
Summary: A graphical user interface for the Python scripting language
Group: Development/Languages
Requires: %{name} = %{version}-%{release}
-%description -n %{tkinter}
+Provides: tkinter = %{version}-%{release}
+Provides: tkinter%{?_isa} = %{version}-%{release}
+Provides: tkinter2 = %{version}-%{release}
+Provides: tkinter2%{?_isa} = %{version}-%{release}
+Provides: python-tkinter = %{version}-%{release}
+Provides: python-tkinter%{?_isa} = %{version}-%{release}
+Obsoletes: tkinter < %{obs}
+
+%description tkinter
The Tkinter (Tk interface) program is an graphical user interface for
the Python scripting language.
@@ -881,6 +911,10 @@ Summary: The test modules from the main python package
Group: Development/Languages
Requires: %{name} = %{version}-%{release}
+Provides: python-test = %{version}-%{release}
+Provides: python-test%{?_isa} = %{version}-%{release}
+Obsoletes: python-test < %{obs}
+
%description test
The test modules from the main python package: %{name}
@@ -902,9 +936,13 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-test%{?_isa} = %{version}-%{release}
-Requires: tkinter%{?_isa} = %{version}-%{release}
+Requires: %{python}-tkinter%{?_isa} = %{version}-%{release}
Requires: %{name}-tools%{?_isa} = %{version}-%{release}
+Provides: python-debug = %{version}-%{release}
+Provides: python-debug%{?_isa} = %{version}-%{release}
+Obsoletes: python-debug < %{obs}
+
%description debug
python-debug provides a version of the Python runtime with numerous debugging
features enabled, aimed at advanced Python users, such as developers of Python
@@ -1532,8 +1570,8 @@ rm -fr %{buildroot}
%license LICENSE
%doc README
%{_bindir}/pydoc*
+%{_bindir}/python
%{_bindir}/%{python}
-%{_bindir}/python2
%{_bindir}/python%{pybasever}
%{_mandir}/*/*
@@ -1721,7 +1759,7 @@ rm -fr %{buildroot}
%{demo_dir}
%{pylibdir}/Doc
-%files -n %{tkinter}
+%files tkinter
%defattr(-,root,root,755)
%{pylibdir}/lib-tk
%{dynload_dir}/_tkinter.so
@@ -1754,8 +1792,8 @@ rm -fr %{buildroot}
%defattr(-,root,root,-)
# Analog of the core subpackage's files:
+%{_bindir}/python-debug
%{_bindir}/%{python}-debug
-%{_bindir}/python2-debug
%{_bindir}/python%{pybasever}-debug
# Analog of the -libs subpackage's files, with debug builds of the built-in
@@ -1890,6 +1928,12 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu Oct 27 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-9
+- Rename package to python2 and also rename the subpackages accordingly
+- Provide and obsolete python and the respective subpackages to ensure a clean
+upgrade path
+- Remove old provides for packages that got into stdlib
+
* Wed Oct 12 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-8
- Port ssl and hashlib modules to OpenSSL 1.1.0
- Drop hashlib patch for now
commit 99c92afaf11b99cfd988be67c077ee348bbad450
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Mon Nov 7 14:11:27 2016 +0100
Drop main_python macro and the conditionals using it as it is not required anymore.
diff --git a/python.spec b/python.spec
index 71e5863..9fb3da0 100644
--- a/python.spec
+++ b/python.spec
@@ -4,19 +4,9 @@
%global with_rewheel 1
-%{!?__python_ver:%global __python_ver EMPTY}
-#global __python_ver 27
%global unicode ucs4
-%if "%{__python_ver}" != "EMPTY"
-%global main_python 0
-%global python python%{__python_ver}
-%global tkinter tkinter%{__python_ver}
-%else
-%global main_python 1
%global python python
-%global tkinter tkinter
-%endif
%global pybasever 2.7
%global pylibdir %{_libdir}/python%{pybasever}
@@ -850,10 +840,6 @@ Requires: pkgconfig
# Needed here because of the migration of Makefile from -devel to the main
# package
Conflicts: %{python} < %{version}-%{release}
-%if %{main_python}
-Provides: python2-devel = %{version}-%{release}
-Provides: python2-devel%{?_isa} = %{version}-%{release}
-%endif
%description devel
The Python programming language's interpreter can be extended with
@@ -871,9 +857,6 @@ Summary: A collection of development tools included with Python
Group: Development/Tools
Requires: %{name} = %{version}-%{release}
Requires: %{tkinter} = %{version}-%{release}
-%if %{main_python}
-Provides: python2-tools = %{version}
-%endif
%description tools
This package includes several tools to help with the development of Python
@@ -884,9 +867,6 @@ color editor (pynche), and a python gettext program (pygettext.py).
Summary: A graphical user interface for the Python scripting language
Group: Development/Languages
Requires: %{name} = %{version}-%{release}
-%if %{main_python}
-Provides: tkinter2 = %{version}
-%endif
%description -n %{tkinter}
@@ -1319,15 +1299,6 @@ mkdir %{buildroot}/%{pylibdir}/test
cp -a save_bits_of_test/* %{buildroot}/%{pylibdir}/test
fi
-%if %{main_python}
-%else
-mv %{buildroot}%{_bindir}/python %{buildroot}%{_bindir}/%{python}
-%if 0%{?with_debug_build}
-mv %{buildroot}%{_bindir}/python-debug %{buildroot}%{_bindir}/%{python}-debug
-%endif # with_debug_build
-mv %{buildroot}/%{_mandir}/man1/python.1
%{buildroot}/%{_mandir}/man1/python%{pybasever}.1
-%endif
-
# tools
mkdir -p ${RPM_BUILD_ROOT}%{site_packages}
@@ -1367,19 +1338,6 @@ find . -name ".cvsignore"|xargs rm -f
#zero length
rm -f %{buildroot}%{pylibdir}/LICENSE.txt
-
-#make the binaries install side by side with the main python
-%if !%{main_python}
-pushd %{buildroot}%{_bindir}
-mv idle idle%{__python_ver}
-mv pynche pynche%{__python_ver}
-mv pygettext.py pygettext%{__python_ver}.py
-mv msgfmt.py msgfmt%{__python_ver}.py
-mv smtpd.py smtpd%{__python_ver}.py
-mv pydoc pydoc%{__python_ver}
-popd
-%endif
-
# Fix for bug #136654
rm -f %{buildroot}%{pylibdir}/email/test/data/audiotest.au
%{buildroot}%{pylibdir}/test/audiotest.au
@@ -1575,9 +1533,7 @@ rm -fr %{buildroot}
%doc README
%{_bindir}/pydoc*
%{_bindir}/%{python}
-%if %{main_python}
%{_bindir}/python2
-%endif
%{_bindir}/python%{pybasever}
%{_mandir}/*/*
@@ -1746,10 +1702,8 @@ rm -fr %{buildroot}
%{_includedir}/python%{pybasever}/*.h
%exclude %{_includedir}/python%{pybasever}/%{_pyconfig_h}
%doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit
-%if %{main_python}
%{_bindir}/python-config
%{_bindir}/python2-config
-%endif
%{_bindir}/python%{pybasever}-config
%{_libdir}/libpython%{pybasever}.so
@@ -1801,9 +1755,7 @@ rm -fr %{buildroot}
# Analog of the core subpackage's files:
%{_bindir}/%{python}-debug
-%if %{main_python}
%{_bindir}/python2-debug
-%endif
%{_bindir}/python%{pybasever}-debug
# Analog of the -libs subpackage's files, with debug builds of the built-in
@@ -1901,10 +1853,8 @@ rm -fr %{buildroot}
%{_libdir}/pkgconfig/python2-debug.pc
%{pylibdir}/config-debug/*
%{_includedir}/python%{pybasever}-debug/*.h
-%if %{main_python}
%{_bindir}/python-debug-config
%{_bindir}/python2-debug-config
-%endif
%{_bindir}/python%{pybasever}-debug-config
%{_libdir}/libpython%{pybasever}_d.so
commit a7d311cd0adf32e93a055e004994e3a92b4575b0
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Mon Nov 7 14:02:38 2016 +0100
Replace the names for BuildRequires and Requires of python-setuptools and python-pip
to python2-setuptools and python2-pip.
diff --git a/python.spec b/python.spec
index fc62f15..71e5863 100644
--- a/python.spec
+++ b/python.spec
@@ -167,11 +167,11 @@ BuildRequires: valgrind-devel
BuildRequires: zlib-devel
%if 0%{?with_rewheel}
-BuildRequires: python-setuptools
-BuildRequires: python-pip
+BuildRequires: python2-setuptools
+BuildRequires: python2-pip
-Requires: python-setuptools
-Requires: python-pip
+Requires: python2-setuptools
+Requires: python2-pip
%endif
commit df197a00e9a976f238f706b29a94efcb3b7bb751
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Wed Oct 26 19:30:28 2016 +0200
Remove Obsoletes and Virtual Provides for packages that are now in stdlib
diff --git a/python.spec b/python.spec
index 80c5f56..fc62f15 100644
--- a/python.spec
+++ b/python.spec
@@ -796,27 +796,7 @@ Patch5000: 05000-autotool-intermediates.patch
# Additional metadata, and subpackages
# ======================================================
-%if %{main_python}
Provides: python2 = %{version}
-Obsoletes: python-elementtree <= 1.2.6
-Obsoletes: python-ordereddict <= 1.1-8
-Obsoletes: python-sqlite < 2.3.2
-Provides: python-sqlite = 2.3.2
-Obsoletes: python-ctypes < 1.0.1
-Provides: python-ctypes = 1.0.1
-Obsoletes: python-hashlib < 20081120
-Provides: python-hashlib = 20081120
-Obsoletes: python-uuid < 1.31
-Provides: python-uuid = 1.31
-# obsolete, not provide PyXML as proposed in feature
-#
https://fedoraproject.org/wiki/Features/RemovePyXML#How_To_Test
-Obsoletes: PyXML <= 0.8.4-29
-
-# python-argparse is part of python as of version 2.7
-# drop this Provides in F17
-# (having Obsoletes here caused problems with multilib; see rhbz#667984)
-Provides: python-argparse = %{version}-%{release}
-%endif
Provides: python27 = %{version}-%{release}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
commit 7c1eb9e0ebb2ede82c47eced11d7059abb688bb3
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Wed Oct 12 14:55:04 2016 +0200
Port ssl and hashlib modules to OpenSSL 1.1.0 and drop hashlib patch
diff --git a/00247-port-ssl-and-hashlib-to-OpenSSL-1.1.0.patch
b/00247-port-ssl-and-hashlib-to-OpenSSL-1.1.0.patch
new file mode 100644
index 0000000..4ac606a
--- /dev/null
+++ b/00247-port-ssl-and-hashlib-to-OpenSSL-1.1.0.patch
@@ -0,0 +1,1088 @@
+
+# HG changeset patch
+# User Christian Heimes <christian(a)python.org>
+# Date 1473111433 -7200
+# Node ID 14b611ddaabe404c8cae84c35f553f50e3a068c9
+# Parent 4c91651912d1b3dbedcd8404c61f9e2a4094af93
+Issue #26470: Port ssl and hashlib module to OpenSSL 1.1.0.
+
+diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst
+--- a/Doc/library/ssl.rst
++++ b/Doc/library/ssl.rst
+@@ -322,6 +322,16 @@ purposes.
+ Random generation
+ ^^^^^^^^^^^^^^^^^
+
++ .. deprecated::
++
++ 2.7.13 OpenSSL has deprecated :func:`ssl.RAND_pseudo_bytes`, use
++ :func:`ssl.RAND_bytes` instead.
++
++ .. deprecated::
++
++ 2.7.13 OpenSSL has deprecated :func:`ssl.RAND_pseudo_bytes`, use
++ :func:`ssl.RAND_bytes` instead.
++
+ .. function:: RAND_status()
+
+ Return ``True`` if the SSL pseudo-random number generator has been seeded
+@@ -340,7 +350,7 @@ Random generation
+ See
http://egd.sourceforge.net/ or
http://prngd.sourceforge.net/ for sources
+ of entropy-gathering daemons.
+
+- Availability: not available with LibreSSL.
++ Availability: not available with LibreSSL and OpenSSL > 1.1.0
+
+ .. function:: RAND_add(bytes, entropy)
+
+@@ -444,6 +454,9 @@ Certificate handling
+ * :attr:`openssl_capath_env` - OpenSSL's environment key that points to a
capath,
+ * :attr:`openssl_capath` - hard coded path to a capath directory
+
++ Availability: LibreSSL ignores the environment vars
++ :attr:`openssl_cafile_env` and :attr:`openssl_capath_env`
++
+ .. versionadded:: 2.7.9
+
+ .. function:: enum_certificates(store_name)
+@@ -561,11 +574,19 @@ Constants
+
+ .. versionadded:: 2.7.10
+
+-.. data:: PROTOCOL_SSLv23
++.. data:: PROTOCOL_TLS
+
+ Selects the highest protocol version that both the client and server support.
+ Despite the name, this option can select "TLS" protocols as well as
"SSL".
+
++ .. versionadded:: 2.7.13
++
++.. data:: PROTOCOL_SSLv23
++
++ Alias for ``PROTOCOL_TLS``.
++
++ .. deprecated:: 2.7.13 Use ``PROTOCOL_TLS`` instead.
++
+ .. data:: PROTOCOL_SSLv2
+
+ Selects SSL version 2 as the channel encryption protocol.
+@@ -577,6 +598,8 @@ Constants
+
+ SSL version 2 is insecure. Its use is highly discouraged.
+
++ .. deprecated:: 2.7.13 OpenSSL has removed support for SSLv2.
++
+ .. data:: PROTOCOL_SSLv3
+
+ Selects SSL version 3 as the channel encryption protocol.
+@@ -588,10 +611,20 @@ Constants
+
+ SSL version 3 is insecure. Its use is highly discouraged.
+
++ .. deprecated:: 2.7.13
++
++ OpenSSL has deprecated all version specific protocols. Use the default
++ protocol with flags like ``OP_NO_SSLv3`` instead.
++
+ .. data:: PROTOCOL_TLSv1
+
+ Selects TLS version 1.0 as the channel encryption protocol.
+
++ .. deprecated:: 2.7.13
++
++ OpenSSL has deprecated all version specific protocols. Use the default
++ protocol with flags like ``OP_NO_SSLv3`` instead.
++
+ .. data:: PROTOCOL_TLSv1_1
+
+ Selects TLS version 1.1 as the channel encryption protocol.
+@@ -599,6 +632,11 @@ Constants
+
+ .. versionadded:: 2.7.9
+
++ .. deprecated:: 2.7.13
++
++ OpenSSL has deprecated all version specific protocols. Use the default
++ protocol with flags like ``OP_NO_SSLv3`` instead.
++
+ .. data:: PROTOCOL_TLSv1_2
+
+ Selects TLS version 1.2 as the channel encryption protocol. This is the
+@@ -607,6 +645,12 @@ Constants
+
+ .. versionadded:: 2.7.9
+
++ .. deprecated:: 2.7.13
++
++ OpenSSL has deprecated all version specific protocols. Use the default
++ protocol with flags like ``OP_NO_SSLv3`` instead.
++
++
+ .. data:: OP_ALL
+
+ Enables workarounds for various bugs present in other SSL implementations.
+@@ -1112,6 +1156,9 @@ to speed up repeated connections from th
+ This method will raise :exc:`NotImplementedError` if :data:`HAS_ALPN` is
+ False.
+
++ OpenSSL 1.1.0+ will abort the handshake and raise :exc:`SSLError` when
++ both sides support ALPN but cannot agree on a protocol.
++
+ .. versionadded:: 2.7.10
+
+ .. method:: SSLContext.set_npn_protocols(protocols)
+diff --git a/Lib/ssl.py b/Lib/ssl.py
+--- a/Lib/ssl.py
++++ b/Lib/ssl.py
+@@ -51,6 +51,7 @@ The following constants identify various
+ PROTOCOL_SSLv2
+ PROTOCOL_SSLv3
+ PROTOCOL_SSLv23
++PROTOCOL_TLS
+ PROTOCOL_TLSv1
+ PROTOCOL_TLSv1_1
+ PROTOCOL_TLSv1_2
+@@ -126,7 +127,10 @@ from _ssl import HAS_SNI, HAS_ECDH, HAS_
+
+ from _ssl import _OPENSSL_API_VERSION
+
+-_PROTOCOL_NAMES = {value: name for name, value in globals().items() if
name.startswith('PROTOCOL_')}
++_PROTOCOL_NAMES = {value: name for name, value in globals().items()
++ if name.startswith('PROTOCOL_')
++ and name != 'PROTOCOL_SSLv23'}
++PROTOCOL_SSLv23 = PROTOCOL_TLS
+
+ try:
+ _SSLv2_IF_EXISTS = PROTOCOL_SSLv2
+@@ -408,7 +412,7 @@ def create_default_context(purpose=Purpo
+ if not isinstance(purpose, _ASN1Object):
+ raise TypeError(purpose)
+
+- context = SSLContext(PROTOCOL_SSLv23)
++ context = SSLContext(PROTOCOL_TLS)
+
+ # SSLv2 considered harmful.
+ context.options |= OP_NO_SSLv2
+@@ -445,7 +449,7 @@ def create_default_context(purpose=Purpo
+ context.load_default_certs(purpose)
+ return context
+
+-def _create_unverified_context(protocol=PROTOCOL_SSLv23, cert_reqs=None,
++def _create_unverified_context(protocol=PROTOCOL_TLS, cert_reqs=None,
+ check_hostname=False, purpose=Purpose.SERVER_AUTH,
+ certfile=None, keyfile=None,
+ cafile=None, capath=None, cadata=None):
+@@ -518,7 +522,7 @@ class SSLSocket(socket):
+
+ def __init__(self, sock=None, keyfile=None, certfile=None,
+ server_side=False, cert_reqs=CERT_NONE,
+- ssl_version=PROTOCOL_SSLv23, ca_certs=None,
++ ssl_version=PROTOCOL_TLS, ca_certs=None,
+ do_handshake_on_connect=True,
+ family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None,
+ suppress_ragged_eofs=True, npn_protocols=None, ciphers=None,
+@@ -920,7 +924,7 @@ class SSLSocket(socket):
+
+ def wrap_socket(sock, keyfile=None, certfile=None,
+ server_side=False, cert_reqs=CERT_NONE,
+- ssl_version=PROTOCOL_SSLv23, ca_certs=None,
++ ssl_version=PROTOCOL_TLS, ca_certs=None,
+ do_handshake_on_connect=True,
+ suppress_ragged_eofs=True,
+ ciphers=None):
+@@ -989,7 +993,7 @@ def PEM_cert_to_DER_cert(pem_cert_string
+ d = pem_cert_string.strip()[len(PEM_HEADER):-len(PEM_FOOTER)]
+ return base64.decodestring(d.encode('ASCII', 'strict'))
+
+-def get_server_certificate(addr, ssl_version=PROTOCOL_SSLv23, ca_certs=None):
++def get_server_certificate(addr, ssl_version=PROTOCOL_TLS, ca_certs=None):
+ """Retrieve the certificate from the server at the specified
address,
+ and return it as a PEM-encoded string.
+ If 'ca_certs' is specified, validate the server cert against it.
+diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
+--- a/Lib/test/test_ssl.py
++++ b/Lib/test/test_ssl.py
+@@ -26,6 +26,9 @@ ssl = support.import_module("ssl")
+
+ PROTOCOLS = sorted(ssl._PROTOCOL_NAMES)
+ HOST = support.HOST
++IS_LIBRESSL = ssl.OPENSSL_VERSION.startswith('LibreSSL')
++IS_OPENSSL_1_1 = not IS_LIBRESSL and ssl.OPENSSL_VERSION_INFO >= (1, 1, 0)
++
+
+ def data_file(*name):
+ return os.path.join(os.path.dirname(__file__), *name)
+@@ -164,7 +167,6 @@ class BasicSocketTests(unittest.TestCase
+ self.assertIn(ssl.HAS_SNI, {True, False})
+ self.assertIn(ssl.HAS_ECDH, {True, False})
+
+-
+ def test_random(self):
+ v = ssl.RAND_status()
+ if support.verbose:
+@@ -281,9 +283,9 @@ class BasicSocketTests(unittest.TestCase
+ self.assertGreaterEqual(status, 0)
+ self.assertLessEqual(status, 15)
+ # Version string as returned by {Open,Libre}SSL, the format might change
+- if "LibreSSL" in s:
+- self.assertTrue(s.startswith("LibreSSL {:d}.{:d}".format(major,
minor)),
+- (s, t))
++ if IS_LIBRESSL:
++ self.assertTrue(s.startswith("LibreSSL {:d}".format(major)),
++ (s, t, hex(n)))
+ else:
+ self.assertTrue(s.startswith("OpenSSL
{:d}.{:d}.{:d}".format(major, minor, fix)),
+ (s, t))
+@@ -742,15 +744,15 @@ class ContextTests(unittest.TestCase):
+ def test_options(self):
+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+ # OP_ALL | OP_NO_SSLv2 | OP_NO_SSLv3 is the default value
+- self.assertEqual(ssl.OP_ALL | ssl.OP_NO_SSLv2 | ssl.OP_NO_SSLv3,
+- ctx.options)
++ default = (ssl.OP_ALL | ssl.OP_NO_SSLv2 | ssl.OP_NO_SSLv3)
++ if not IS_LIBRESSL and ssl.OPENSSL_VERSION_INFO >= (1, 1, 0):
++ default |= ssl.OP_NO_COMPRESSION
++ self.assertEqual(default, ctx.options)
+ ctx.options |= ssl.OP_NO_TLSv1
+- self.assertEqual(ssl.OP_ALL | ssl.OP_NO_SSLv2 | ssl.OP_NO_SSLv3 |
ssl.OP_NO_TLSv1,
+- ctx.options)
++ self.assertEqual(default | ssl.OP_NO_TLSv1, ctx.options)
+ if can_clear_options():
+- ctx.options = (ctx.options & ~ssl.OP_NO_SSLv2) | ssl.OP_NO_TLSv1
+- self.assertEqual(ssl.OP_ALL | ssl.OP_NO_TLSv1 | ssl.OP_NO_SSLv3,
+- ctx.options)
++ ctx.options = (ctx.options & ~ssl.OP_NO_TLSv1)
++ self.assertEqual(default, ctx.options)
+ ctx.options = 0
+ self.assertEqual(0, ctx.options)
+ else:
+@@ -1088,6 +1090,7 @@ class ContextTests(unittest.TestCase):
+ self.assertRaises(TypeError, ctx.load_default_certs, 'SERVER_AUTH')
+
+ @unittest.skipIf(sys.platform == "win32", "not-Windows
specific")
++ @unittest.skipIf(IS_LIBRESSL, "LibreSSL doesn't support env vars")
+ def test_load_default_certs_env(self):
+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+ with support.EnvironmentVarGuard() as env:
+@@ -1534,7 +1537,6 @@ class NetworkedTests(unittest.TestCase):
+ sys.stdout.write("%s\n" % x)
+ else:
+ self.fail("Got server certificate %s for %s:%s!" % (pem,
host, port))
+-
+ pem = ssl.get_server_certificate((host, port),
+ ca_certs=cert)
+ if not pem:
+@@ -2783,7 +2785,7 @@ else:
+ with closing(context.wrap_socket(socket.socket())) as s:
+ self.assertIs(s.version(), None)
+ s.connect((HOST, server.port))
+- self.assertEqual(s.version(), "TLSv1")
++ self.assertEqual(s.version(), 'TLSv1')
+ self.assertIs(s.version(), None)
+
+ @unittest.skipUnless(ssl.HAS_ECDH, "test requires ECDH-enabled
OpenSSL")
+@@ -2925,24 +2927,36 @@ else:
+ (['http/3.0', 'http/4.0'], None)
+ ]
+ for client_protocols, expected in protocol_tests:
+- server_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ server_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
+ server_context.load_cert_chain(CERTFILE)
+ server_context.set_alpn_protocols(server_protocols)
+- client_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ client_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
+ client_context.load_cert_chain(CERTFILE)
+ client_context.set_alpn_protocols(client_protocols)
+- stats = server_params_test(client_context, server_context,
+- chatty=True, connectionchatty=True)
+-
+- msg = "failed trying %s (s) and %s (c).\n" \
+- "was expecting %s, but got %%s from the %%s" \
+- % (str(server_protocols), str(client_protocols),
+- str(expected))
+- client_result = stats['client_alpn_protocol']
+- self.assertEqual(client_result, expected, msg % (client_result,
"client"))
+- server_result = stats['server_alpn_protocols'][-1] \
+- if len(stats['server_alpn_protocols']) else
'nothing'
+- self.assertEqual(server_result, expected, msg % (server_result,
"server"))
++
++ try:
++ stats = server_params_test(client_context,
++ server_context,
++ chatty=True,
++ connectionchatty=True)
++ except ssl.SSLError as e:
++ stats = e
++
++ if expected is None and IS_OPENSSL_1_1:
++ # OpenSSL 1.1.0 raises handshake error
++ self.assertIsInstance(stats, ssl.SSLError)
++ else:
++ msg = "failed trying %s (s) and %s (c).\n" \
++ "was expecting %s, but got %%s from the %%s" \
++ % (str(server_protocols), str(client_protocols),
++ str(expected))
++ client_result = stats['client_alpn_protocol']
++ self.assertEqual(client_result, expected,
++ msg % (client_result, "client"))
++ server_result = stats['server_alpn_protocols'][-1] \
++ if len(stats['server_alpn_protocols']) else
'nothing'
++ self.assertEqual(server_result, expected,
++ msg % (server_result, "server"))
+
+ def test_selected_npn_protocol(self):
+ # selected_npn_protocol() is None unless NPN is used
+
+--- a/Modules/_hashopenssl.c
++++ b/Modules/_hashopenssl.c
+@@ -37,8 +37,10 @@
+
+ /* EVP is the preferred interface to hashing in OpenSSL */
+ #include <openssl/evp.h>
+-#include <openssl/hmac.h>
+ #include <openssl/err.h>
++/* We use the object interface to discover what hashes OpenSSL supports. */
++#include <openssl/objects.h>
++#include "openssl/err.h"
+
+ #define MUNCH_SIZE INT_MAX
+
+@@ -50,15 +52,26 @@
+ #define HASH_OBJ_CONSTRUCTOR 0
+ #endif
+
+-/* Minimum OpenSSL version needed to support sha224 and higher. */
+ #if defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >=
0x00908000)
+ #define _OPENSSL_SUPPORTS_SHA2
+ #endif
+
++#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
++/* OpenSSL < 1.1.0 */
++#define EVP_MD_CTX_new EVP_MD_CTX_create
++#define EVP_MD_CTX_free EVP_MD_CTX_destroy
++#define HAS_FAST_PKCS5_PBKDF2_HMAC 0
++#include <openssl/hmac.h>
++#else
++/* OpenSSL >= 1.1.0 */
++#define HAS_FAST_PKCS5_PBKDF2_HMAC 1
++#endif
++
++
+ typedef struct {
+ PyObject_HEAD
+ PyObject *name; /* name of this hash algorithm */
+- EVP_MD_CTX ctx; /* OpenSSL message digest context */
++ EVP_MD_CTX *ctx; /* OpenSSL message digest context */
+ #ifdef WITH_THREAD
+ PyThread_type_lock lock; /* OpenSSL context lock */
+ #endif
+@@ -70,7 +83,6 @@ static PyTypeObject EVPtype;
+
+ #define DEFINE_CONSTS_FOR_NEW(Name) \
+ static PyObject *CONST_ ## Name ## _name_obj = NULL; \
+- static EVP_MD_CTX CONST_new_ ## Name ## _ctx; \
+ static EVP_MD_CTX *CONST_new_ ## Name ## _ctx_p = NULL;
+
+ DEFINE_CONSTS_FOR_NEW(md5)
+@@ -83,19 +95,56 @@ DEFINE_CONSTS_FOR_NEW(sha512)
+ #endif
+
+
++/* LCOV_EXCL_START */
++static PyObject *
++_setException(PyObject *exc)
++{
++ unsigned long errcode;
++ const char *lib, *func, *reason;
++
++ errcode = ERR_peek_last_error();
++ if (!errcode) {
++ PyErr_SetString(exc, "unknown reasons");
++ return NULL;
++ }
++ ERR_clear_error();
++
++ lib = ERR_lib_error_string(errcode);
++ func = ERR_func_error_string(errcode);
++ reason = ERR_reason_error_string(errcode);
++
++ if (lib && func) {
++ PyErr_Format(exc, "[%s: %s] %s", lib, func, reason);
++ }
++ else if (lib) {
++ PyErr_Format(exc, "[%s] %s", lib, reason);
++ }
++ else {
++ PyErr_SetString(exc, reason);
++ }
++ return NULL;
++}
++/* LCOV_EXCL_STOP */
++
+ static EVPobject *
+ newEVPobject(PyObject *name)
+ {
+ EVPobject *retval = (EVPobject *)PyObject_New(EVPobject, &EVPtype);
++ if (retval == NULL)
++ return NULL;
++
++ retval->ctx = EVP_MD_CTX_new();
++ if (retval->ctx == NULL) {
++ PyErr_NoMemory();
++ return NULL;
++ }
+
+ /* save the name for .name to return */
+- if (retval != NULL) {
+- Py_INCREF(name);
+- retval->name = name;
++ Py_INCREF(name);
++ retval->name = name;
+ #ifdef WITH_THREAD
+- retval->lock = NULL;
++ retval->lock = NULL;
+ #endif
+- }
+
+ return retval;
+ }
+@@ -111,7 +160,7 @@ EVP_hash(EVPobject *self, const void *vp
+ process = MUNCH_SIZE;
+ else
+ process = Py_SAFE_DOWNCAST(len, Py_ssize_t, unsigned int);
+- EVP_DigestUpdate(&self->ctx, (const void*)cp, process);
++ EVP_DigestUpdate(self->ctx, (const void*)cp, process);
+ len -= process;
+ cp += process;
+ }
+@@ -126,16 +175,20 @@ EVP_dealloc(EVPobject *self)
+ if (self->lock != NULL)
+ PyThread_free_lock(self->lock);
+ #endif
+- EVP_MD_CTX_cleanup(&self->ctx);
++ EVP_MD_CTX_free(self->ctx);
+ Py_XDECREF(self->name);
+ PyObject_Del(self);
+ }
+
+-static void locked_EVP_MD_CTX_copy(EVP_MD_CTX *new_ctx_p, EVPobject *self)
++static int
++locked_EVP_MD_CTX_copy(EVP_MD_CTX *new_ctx_p, EVPobject *self)
+ {
++ int result;
+ ENTER_HASHLIB(self);
+- EVP_MD_CTX_copy(new_ctx_p, &self->ctx);
++ /* XXX no error reporting */
++ result = EVP_MD_CTX_copy(new_ctx_p, self->ctx);
+ LEAVE_HASHLIB(self);
++ return result;
+ }
+
+ /* External methods for a hash object */
+@@ -151,7 +204,9 @@ EVP_copy(EVPobject *self, PyObject *unus
+ if ( (newobj = newEVPobject(self->name))==NULL)
+ return NULL;
+
+- locked_EVP_MD_CTX_copy(&newobj->ctx, self);
++ if (!locked_EVP_MD_CTX_copy(newobj->ctx, self)) {
++ return _setException(PyExc_ValueError);
++ }
+ return (PyObject *)newobj;
+ }
+
+@@ -162,16 +217,24 @@ static PyObject *
+ EVP_digest(EVPobject *self, PyObject *unused)
+ {
+ unsigned char digest[EVP_MAX_MD_SIZE];
+- EVP_MD_CTX temp_ctx;
++ EVP_MD_CTX *temp_ctx;
+ PyObject *retval;
+ unsigned int digest_size;
+
+- locked_EVP_MD_CTX_copy(&temp_ctx, self);
+- digest_size = EVP_MD_CTX_size(&temp_ctx);
+- EVP_DigestFinal(&temp_ctx, digest, NULL);
++ temp_ctx = EVP_MD_CTX_new();
++ if (temp_ctx == NULL) {
++ PyErr_NoMemory();
++ return NULL;
++ }
++
++ if (!locked_EVP_MD_CTX_copy(temp_ctx, self)) {
++ return _setException(PyExc_ValueError);
++ }
++ digest_size = EVP_MD_CTX_size(temp_ctx);
++ EVP_DigestFinal(temp_ctx, digest, NULL);
+
+ retval = PyString_FromStringAndSize((const char *)digest, digest_size);
+- EVP_MD_CTX_cleanup(&temp_ctx);
++ EVP_MD_CTX_free(temp_ctx);
+ return retval;
+ }
+
+@@ -182,17 +245,25 @@ static PyObject *
+ EVP_hexdigest(EVPobject *self, PyObject *unused)
+ {
+ unsigned char digest[EVP_MAX_MD_SIZE];
+- EVP_MD_CTX temp_ctx;
++ EVP_MD_CTX *temp_ctx;
+ PyObject *retval;
+ char *hex_digest;
+ unsigned int i, j, digest_size;
+
++ temp_ctx = EVP_MD_CTX_new();
++ if (temp_ctx == NULL) {
++ PyErr_NoMemory();
++ return NULL;
++ }
++
+ /* Get the raw (binary) digest value */
+- locked_EVP_MD_CTX_copy(&temp_ctx, self);
+- digest_size = EVP_MD_CTX_size(&temp_ctx);
+- EVP_DigestFinal(&temp_ctx, digest, NULL);
++ if (!locked_EVP_MD_CTX_copy(temp_ctx, self)) {
++ return _setException(PyExc_ValueError);
++ }
++ digest_size = EVP_MD_CTX_size(temp_ctx);
++ EVP_DigestFinal(temp_ctx, digest, NULL);
+
+- EVP_MD_CTX_cleanup(&temp_ctx);
++ EVP_MD_CTX_free(temp_ctx);
+
+ /* Create a new string */
+ /* NOTE: not thread safe! modifying an already created string object */
+@@ -266,7 +337,7 @@ static PyObject *
+ EVP_get_block_size(EVPobject *self, void *closure)
+ {
+ long block_size;
+- block_size = EVP_MD_CTX_block_size(&self->ctx);
++ block_size = EVP_MD_CTX_block_size(self->ctx);
+ return PyLong_FromLong(block_size);
+ }
+
+@@ -274,7 +345,7 @@ static PyObject *
+ EVP_get_digest_size(EVPobject *self, void *closure)
+ {
+ long size;
+- size = EVP_MD_CTX_size(&self->ctx);
++ size = EVP_MD_CTX_size(self->ctx);
+ return PyLong_FromLong(size);
+ }
+
+@@ -338,7 +409,7 @@ EVP_tp_init(EVPobject *self, PyObject *a
+ PyBuffer_Release(&view);
+ return -1;
+ }
+- EVP_DigestInit(&self->ctx, digest);
++ EVP_DigestInit(self->ctx, digest);
+
+ self->name = name_obj;
+ Py_INCREF(self->name);
+@@ -435,9 +506,9 @@ EVPnew(PyObject *name_obj,
+ return NULL;
+
+ if (initial_ctx) {
+- EVP_MD_CTX_copy(&self->ctx, initial_ctx);
++ EVP_MD_CTX_copy(self->ctx, initial_ctx);
+ } else {
+- EVP_DigestInit(&self->ctx, digest);
++ EVP_DigestInit(self->ctx, digest);
+ }
+
+ if (cp && len) {
+@@ -499,6 +570,7 @@ EVP_new(PyObject *self, PyObject *args,
+
+ #define PY_PBKDF2_HMAC 1
+
++#if !HAS_FAST_PKCS5_PBKDF2_HMAC
+ /* Improved implementation of PKCS5_PBKDF2_HMAC()
+ *
+ * PKCS5_PBKDF2_HMAC_fast() hashes the password exactly one time instead of
+@@ -580,37 +652,8 @@ PKCS5_PBKDF2_HMAC_fast(const char *pass,
+ HMAC_CTX_cleanup(&hctx_tpl);
+ return 1;
+ }
++#endif
+
+-/* LCOV_EXCL_START */
+-static PyObject *
+-_setException(PyObject *exc)
+-{
+- unsigned long errcode;
+- const char *lib, *func, *reason;
+-
+- errcode = ERR_peek_last_error();
+- if (!errcode) {
+- PyErr_SetString(exc, "unknown reasons");
+- return NULL;
+- }
+- ERR_clear_error();
+-
+- lib = ERR_lib_error_string(errcode);
+- func = ERR_func_error_string(errcode);
+- reason = ERR_reason_error_string(errcode);
+-
+- if (lib && func) {
+- PyErr_Format(exc, "[%s: %s] %s", lib, func, reason);
+- }
+- else if (lib) {
+- PyErr_Format(exc, "[%s] %s", lib, reason);
+- }
+- else {
+- PyErr_SetString(exc, reason);
+- }
+- return NULL;
+-}
+-/* LCOV_EXCL_STOP */
+
+ PyDoc_STRVAR(pbkdf2_hmac__doc__,
+ "pbkdf2_hmac(hash_name, password, salt, iterations, dklen=None) -> key\n\
+@@ -692,10 +735,17 @@ pbkdf2_hmac(PyObject *self, PyObject *ar
+ key = PyBytes_AS_STRING(key_obj);
+
+ Py_BEGIN_ALLOW_THREADS
++#if HAS_FAST_PKCS5_PBKDF2_HMAC
++ retval = PKCS5_PBKDF2_HMAC((char*)password.buf, (int)password.len,
++ (unsigned char *)salt.buf, (int)salt.len,
++ iterations, digest, dklen,
++ (unsigned char *)key);
++#else
+ retval = PKCS5_PBKDF2_HMAC_fast((char*)password.buf, (int)password.len,
+ (unsigned char *)salt.buf, (int)salt.len,
+ iterations, digest, dklen,
+ (unsigned char *)key);
++#endif
+ Py_END_ALLOW_THREADS
+
+ if (!retval) {
+@@ -807,7 +857,7 @@ generate_hash_name_list(void)
+ if (CONST_ ## NAME ## _name_obj == NULL) { \
+ CONST_ ## NAME ## _name_obj = PyString_FromString(#NAME); \
+ if (EVP_get_digestbyname(#NAME)) { \
+- CONST_new_ ## NAME ## _ctx_p = &CONST_new_ ## NAME ## _ctx; \
++ CONST_new_ ## NAME ## _ctx_p = EVP_MD_CTX_new(); \
+ EVP_DigestInit(CONST_new_ ## NAME ## _ctx_p, EVP_get_digestbyname(#NAME));
\
+ } \
+ } \
+diff --git a/Modules/_ssl.c b/Modules/_ssl.c
+--- a/Modules/_ssl.c
++++ b/Modules/_ssl.c
+@@ -52,6 +52,14 @@
+ #include <sys/poll.h>
+ #endif
+
++/* Don't warn about deprecated functions */
++#ifdef __GNUC__
++#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
++#endif
++#ifdef __clang__
++#pragma clang diagnostic ignored "-Wdeprecated-declarations"
++#endif
++
+ /* Include OpenSSL header files */
+ #include "openssl/rsa.h"
+ #include "openssl/crypto.h"
+@@ -87,6 +95,10 @@ struct py_ssl_library_code {
+ /* Include generated data (error codes) */
+ #include "_ssl_data.h"
+
++#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) &&
!defined(LIBRESSL_VERSION_NUMBER)
++# define OPENSSL_VERSION_1_1 1
++#endif
++
+ /* Openssl comes with TLSv1.1 and TLSv1.2 between 1.0.0h and 1.0.1
+
http://www.openssl.org/news/changelog.html
+ */
+@@ -110,6 +122,70 @@ struct py_ssl_library_code {
+ # define HAVE_ALPN
+ #endif
+
++#ifndef INVALID_SOCKET /* MS defines this */
++#define INVALID_SOCKET (-1)
++#endif
++
++#ifdef OPENSSL_VERSION_1_1
++/* OpenSSL 1.1.0+ */
++#ifndef OPENSSL_NO_SSL2
++#define OPENSSL_NO_SSL2
++#endif
++#else /* OpenSSL < 1.1.0 */
++#if defined(WITH_THREAD)
++#define HAVE_OPENSSL_CRYPTO_LOCK
++#endif
++
++#define TLS_method SSLv23_method
++
++static int X509_NAME_ENTRY_set(const X509_NAME_ENTRY *ne)
++{
++ return ne->set;
++}
++
++#ifndef OPENSSL_NO_COMP
++static int COMP_get_type(const COMP_METHOD *meth)
++{
++ return meth->type;
++}
++
++static const char *COMP_get_name(const COMP_METHOD *meth)
++{
++ return meth->name;
++}
++#endif
++
++static pem_password_cb *SSL_CTX_get_default_passwd_cb(SSL_CTX *ctx)
++{
++ return ctx->default_passwd_callback;
++}
++
++static void *SSL_CTX_get_default_passwd_cb_userdata(SSL_CTX *ctx)
++{
++ return ctx->default_passwd_callback_userdata;
++}
++
++static int X509_OBJECT_get_type(X509_OBJECT *x)
++{
++ return x->type;
++}
++
++static X509 *X509_OBJECT_get0_X509(X509_OBJECT *x)
++{
++ return x->data.x509;
++}
++
++static STACK_OF(X509_OBJECT) *X509_STORE_get0_objects(X509_STORE *store) {
++ return store->objs;
++}
++
++static X509_VERIFY_PARAM *X509_STORE_get0_param(X509_STORE *store)
++{
++ return store->param;
++}
++#endif /* OpenSSL < 1.1.0 or LibreSSL */
++
++
+ enum py_ssl_error {
+ /* these mirror ssl.h */
+ PY_SSL_ERROR_NONE,
+@@ -140,7 +216,7 @@ enum py_ssl_cert_requirements {
+ enum py_ssl_version {
+ PY_SSL_VERSION_SSL2,
+ PY_SSL_VERSION_SSL3=1,
+- PY_SSL_VERSION_SSL23,
++ PY_SSL_VERSION_TLS,
+ #if HAVE_TLSv1_2
+ PY_SSL_VERSION_TLS1,
+ PY_SSL_VERSION_TLS1_1,
+@@ -681,7 +757,7 @@ static PyObject *
+
+ /* check to see if we've gotten to a new RDN */
+ if (rdn_level >= 0) {
+- if (rdn_level != entry->set) {
++ if (rdn_level != X509_NAME_ENTRY_set(entry)) {
+ /* yes, new RDN */
+ /* add old RDN to DN */
+ rdnt = PyList_AsTuple(rdn);
+@@ -698,7 +774,7 @@ static PyObject *
+ goto fail0;
+ }
+ }
+- rdn_level = entry->set;
++ rdn_level = X509_NAME_ENTRY_set(entry);
+
+ /* now add this attribute to the current RDN */
+ name = X509_NAME_ENTRY_get_object(entry);
+@@ -801,18 +877,18 @@ static PyObject *
+ goto fail;
+ }
+
+- p = ext->value->data;
++ p = X509_EXTENSION_get_data(ext)->data;
+ if (method->it)
+ names = (GENERAL_NAMES*)
+ (ASN1_item_d2i(NULL,
+ &p,
+- ext->value->length,
++ X509_EXTENSION_get_data(ext)->length,
+ ASN1_ITEM_ptr(method->it)));
+ else
+ names = (GENERAL_NAMES*)
+ (method->d2i(NULL,
+ &p,
+- ext->value->length));
++ X509_EXTENSION_get_data(ext)->length));
+
+ for(j = 0; j < sk_GENERAL_NAME_num(names); j++) {
+ /* get a rendering of each name in the set of names */
+@@ -1021,13 +1097,11 @@ static PyObject *
+ int i, j;
+ PyObject *lst, *res = NULL;
+
+-#if OPENSSL_VERSION_NUMBER < 0x10001000L
+- dps = X509_get_ext_d2i(certificate, NID_crl_distribution_points, NULL, NULL);
+-#else
++#if OPENSSL_VERSION_NUMBER >= 0x10001000L
+ /* Calls x509v3_cache_extensions and sets up crldp */
+ X509_check_ca(certificate);
+- dps = certificate->crldp;
+ #endif
++ dps = X509_get_ext_d2i(certificate, NID_crl_distribution_points, NULL, NULL);
+
+ if (dps == NULL)
+ return Py_None;
+@@ -1443,9 +1517,9 @@ static PyObject *PySSL_compression(PySSL
+ if (self->ssl == NULL)
+ Py_RETURN_NONE;
+ comp_method = SSL_get_current_compression(self->ssl);
+- if (comp_method == NULL || comp_method->type == NID_undef)
++ if (comp_method == NULL || COMP_get_type(comp_method) == NID_undef)
+ Py_RETURN_NONE;
+- short_name = OBJ_nid2sn(comp_method->type);
++ short_name = COMP_get_name(comp_method);
+ if (short_name == NULL)
+ Py_RETURN_NONE;
+ return PyBytes_FromString(short_name);
+@@ -1994,7 +2068,7 @@ context_new(PyTypeObject *type, PyObject
+ {
+ char *kwlist[] = {"protocol", NULL};
+ PySSLContext *self;
+- int proto_version = PY_SSL_VERSION_SSL23;
++ int proto_version = PY_SSL_VERSION_TLS;
+ long options;
+ SSL_CTX *ctx = NULL;
+
+@@ -2020,8 +2094,8 @@ context_new(PyTypeObject *type, PyObject
+ else if (proto_version == PY_SSL_VERSION_SSL2)
+ ctx = SSL_CTX_new(SSLv2_method());
+ #endif
+- else if (proto_version == PY_SSL_VERSION_SSL23)
+- ctx = SSL_CTX_new(SSLv23_method());
++ else if (proto_version == PY_SSL_VERSION_TLS)
++ ctx = SSL_CTX_new(TLS_method());
+ else
+ proto_version = -1;
+ PySSL_END_ALLOW_THREADS
+@@ -2067,8 +2141,9 @@ context_new(PyTypeObject *type, PyObject
+ #ifndef OPENSSL_NO_ECDH
+ /* Allow automatic ECDH curve selection (on OpenSSL 1.0.2+), or use
+ prime256v1 by default. This is Apache mod_ssl's initialization
+- policy, so we should be safe. */
+-#if defined(SSL_CTX_set_ecdh_auto)
++ policy, so we should be safe. OpenSSL 1.1 has it enabled by default.
++ */
++#if defined(SSL_CTX_set_ecdh_auto) && !defined(OPENSSL_VERSION_1_1)
+ SSL_CTX_set_ecdh_auto(self->ctx, 1);
+ #else
+ {
+@@ -2336,10 +2411,12 @@ static PyObject *
+ get_verify_flags(PySSLContext *self, void *c)
+ {
+ X509_STORE *store;
++ X509_VERIFY_PARAM *param;
+ unsigned long flags;
+
+ store = SSL_CTX_get_cert_store(self->ctx);
+- flags = X509_VERIFY_PARAM_get_flags(store->param);
++ param = X509_STORE_get0_param(store);
++ flags = X509_VERIFY_PARAM_get_flags(param);
+ return PyLong_FromUnsignedLong(flags);
+ }
+
+@@ -2347,22 +2424,24 @@ static int
+ set_verify_flags(PySSLContext *self, PyObject *arg, void *c)
+ {
+ X509_STORE *store;
++ X509_VERIFY_PARAM *param;
+ unsigned long new_flags, flags, set, clear;
+
+ if (!PyArg_Parse(arg, "k", &new_flags))
+ return -1;
+ store = SSL_CTX_get_cert_store(self->ctx);
+- flags = X509_VERIFY_PARAM_get_flags(store->param);
++ param = X509_STORE_get0_param(store);
++ flags = X509_VERIFY_PARAM_get_flags(param);
+ clear = flags & ~new_flags;
+ set = ~flags & new_flags;
+ if (clear) {
+- if (!X509_VERIFY_PARAM_clear_flags(store->param, clear)) {
++ if (!X509_VERIFY_PARAM_clear_flags(param, clear)) {
+ _setSSLError(NULL, 0, __FILE__, __LINE__);
+ return -1;
+ }
+ }
+ if (set) {
+- if (!X509_VERIFY_PARAM_set_flags(store->param, set)) {
++ if (!X509_VERIFY_PARAM_set_flags(param, set)) {
+ _setSSLError(NULL, 0, __FILE__, __LINE__);
+ return -1;
+ }
+@@ -2537,8 +2616,8 @@ load_cert_chain(PySSLContext *self, PyOb
+ char *kwlist[] = {"certfile", "keyfile", "password",
NULL};
+ PyObject *keyfile = NULL, *keyfile_bytes = NULL, *password = NULL;
+ char *certfile_bytes = NULL;
+- pem_password_cb *orig_passwd_cb = self->ctx->default_passwd_callback;
+- void *orig_passwd_userdata = self->ctx->default_passwd_callback_userdata;
++ pem_password_cb *orig_passwd_cb = SSL_CTX_get_default_passwd_cb(self->ctx);
++ void *orig_passwd_userdata = SSL_CTX_get_default_passwd_cb_userdata(self->ctx);
+ _PySSLPasswordInfo pw_info = { NULL, NULL, NULL, 0, 0 };
+ int r;
+
+@@ -2674,8 +2753,9 @@ static int
+ cert = d2i_X509_bio(biobuf, NULL);
+ } else {
+ cert = PEM_read_bio_X509(biobuf, NULL,
+- self->ctx->default_passwd_callback,
+-
self->ctx->default_passwd_callback_userdata);
++ SSL_CTX_get_default_passwd_cb(self->ctx),
++
SSL_CTX_get_default_passwd_cb_userdata(self->ctx)
++ );
+ }
+ if (cert == NULL) {
+ break;
+@@ -3160,25 +3240,24 @@ static PyObject *
+ cert_store_stats(PySSLContext *self)
+ {
+ X509_STORE *store;
++ STACK_OF(X509_OBJECT) *objs;
+ X509_OBJECT *obj;
+- int x509 = 0, crl = 0, pkey = 0, ca = 0, i;
++ int x509 = 0, crl = 0, ca = 0, i;
+
+ store = SSL_CTX_get_cert_store(self->ctx);
+- for (i = 0; i < sk_X509_OBJECT_num(store->objs); i++) {
+- obj = sk_X509_OBJECT_value(store->objs, i);
+- switch (obj->type) {
++ objs = X509_STORE_get0_objects(store);
++ for (i = 0; i < sk_X509_OBJECT_num(objs); i++) {
++ obj = sk_X509_OBJECT_value(objs, i);
++ switch (X509_OBJECT_get_type(obj)) {
+ case X509_LU_X509:
+ x509++;
+- if (X509_check_ca(obj->data.x509)) {
++ if (X509_check_ca(X509_OBJECT_get0_X509(obj))) {
+ ca++;
+ }
+ break;
+ case X509_LU_CRL:
+ crl++;
+ break;
+- case X509_LU_PKEY:
+- pkey++;
+- break;
+ default:
+ /* Ignore X509_LU_FAIL, X509_LU_RETRY, X509_LU_PKEY.
+ * As far as I can tell they are internal states and never
+@@ -3204,6 +3283,7 @@ get_ca_certs(PySSLContext *self, PyObjec
+ char *kwlist[] = {"binary_form", NULL};
+ X509_STORE *store;
+ PyObject *ci = NULL, *rlist = NULL, *py_binary_mode = Py_False;
++ STACK_OF(X509_OBJECT) *objs;
+ int i;
+ int binary_mode = 0;
+
+@@ -3221,17 +3301,18 @@ get_ca_certs(PySSLContext *self, PyObjec
+ }
+
+ store = SSL_CTX_get_cert_store(self->ctx);
+- for (i = 0; i < sk_X509_OBJECT_num(store->objs); i++) {
++ objs = X509_STORE_get0_objects(store);
++ for (i = 0; i < sk_X509_OBJECT_num(objs); i++) {
+ X509_OBJECT *obj;
+ X509 *cert;
+
+- obj = sk_X509_OBJECT_value(store->objs, i);
+- if (obj->type != X509_LU_X509) {
++ obj = sk_X509_OBJECT_value(objs, i);
++ if (X509_OBJECT_get_type(obj) != X509_LU_X509) {
+ /* not a x509 cert */
+ continue;
+ }
+ /* CA for any purpose */
+- cert = obj->data.x509;
++ cert = X509_OBJECT_get0_X509(obj);
+ if (!X509_check_ca(cert)) {
+ continue;
+ }
+@@ -3842,10 +3923,12 @@ static PyMethodDef PySSL_methods[] = {
+ };
+
+
+-#ifdef WITH_THREAD
++#ifdef HAVE_OPENSSL_CRYPTO_LOCK
+
+ /* an implementation of OpenSSL threading operations in terms
+- of the Python C thread library */
++ * of the Python C thread library
++ * Only used up to 1.0.2. OpenSSL 1.1.0+ has its own locking code.
++ */
+
+ static PyThread_type_lock *_ssl_locks = NULL;
+
+@@ -3926,7 +4009,7 @@ static int _setup_ssl_threads(void) {
+ return 1;
+ }
+
+-#endif /* def HAVE_THREAD */
++#endif /* HAVE_OPENSSL_CRYPTO_LOCK for WITH_THREAD && OpenSSL < 1.1.0 */
+
+ PyDoc_STRVAR(module_doc,
+ "Implementation module for SSL socket operations. See the socket module\n\
+@@ -3979,11 +4062,16 @@ init_ssl(void)
+ SSL_load_error_strings();
+ SSL_library_init();
+ #ifdef WITH_THREAD
++#ifdef HAVE_OPENSSL_CRYPTO_LOCK
+ /* note that this will start threading if not already started */
+ if (!_setup_ssl_threads()) {
+ return;
+ }
++#elif OPENSSL_VERSION_1_1 && defined(OPENSSL_THREADS)
++ /* OpenSSL 1.1.0 builtin thread support is enabled */
++ _ssl_locks_count++;
+ #endif
++#endif /* WITH_THREAD */
+ OpenSSL_add_all_algorithms();
+
+ /* Add symbols to module dict */
+@@ -4136,7 +4224,9 @@ init_ssl(void)
+ PY_SSL_VERSION_SSL3);
+ #endif
+ PyModule_AddIntConstant(m, "PROTOCOL_SSLv23",
+- PY_SSL_VERSION_SSL23);
++ PY_SSL_VERSION_TLS);
++ PyModule_AddIntConstant(m, "PROTOCOL_TLS",
++ PY_SSL_VERSION_TLS);
+ PyModule_AddIntConstant(m, "PROTOCOL_TLSv1",
+ PY_SSL_VERSION_TLS1);
+ #if HAVE_TLSv1_2
+
+# HG changeset patch
+# User Christian Heimes <christian(a)python.org>
+# Date 1473117039 -7200
+# Node ID 2593ed9a6a629b4fe3f77feb632c9584a3406201
+# Parent fb74947843eb9f39f3a564022c9132a118dabbb0
+Issue #26470: Use short name rather than name for compression name to fix #27958.
+
+diff --git a/Modules/_ssl.c b/Modules/_ssl.c
+--- a/Modules/_ssl.c
++++ b/Modules/_ssl.c
+@@ -148,11 +148,6 @@ static int COMP_get_type(const COMP_METH
+ {
+ return meth->type;
+ }
+-
+-static const char *COMP_get_name(const COMP_METHOD *meth)
+-{
+- return meth->name;
+-}
+ #endif
+
+ static pem_password_cb *SSL_CTX_get_default_passwd_cb(SSL_CTX *ctx)
+@@ -1519,7 +1514,7 @@ static PyObject *PySSL_compression(PySSL
+ comp_method = SSL_get_current_compression(self->ssl);
+ if (comp_method == NULL || COMP_get_type(comp_method) == NID_undef)
+ Py_RETURN_NONE;
+- short_name = COMP_get_name(comp_method);
++ short_name = OBJ_nid2sn(COMP_get_type(comp_method));
+ if (short_name == NULL)
+ Py_RETURN_NONE;
+ return PyBytes_FromString(short_name);
diff --git a/python.spec b/python.spec
index c927d4a..80c5f56 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.12
-Release: 7%{?dist}
+Release: 8%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -771,6 +771,13 @@ Patch209: 00209-fix-test-pyexpat-failure.patch
# Resolves: rhbz#1359175
Patch242: 00242-CVE-2016-1000110-httpoxy.patch
+# 00247 #
+# Port ssl and hashlib modules to OpenSSL 1.1.0.
+# As of F26, OpenSSL is rebased to 1.1.0, so in order for python
+# to not FTBFS we need to backport this patch from 2.7.13
+# FIXED UPSTREAM:
https://bugs.python.org/issue26470
+Patch247: 00247-port-ssl-and-hashlib-to-OpenSSL-1.1.0.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora, EL,
etc.,
@@ -983,15 +990,17 @@ done
# Remove embedded copy of zlib:
rm -r Modules/zlib || exit 1
+## Disabling hashlib patch for now as it needs to be reimplemented
+## for OpenSSL 1.1.0.
# Don't build upstream Python's implementation of these crypto algorithms;
# instead rely on _hashlib and OpenSSL.
#
# For example, in our builds md5.py uses always uses hashlib.md5 (rather than
# falling back to _md5 when hashlib.md5 is not available); hashlib.md5 is
# implemented within _hashlib via OpenSSL (and thus respects FIPS mode)
-for f in md5module.c md5.c shamodule.c sha256module.c sha512module.c; do
- rm Modules/$f
-done
+#for f in md5module.c md5.c shamodule.c sha256module.c sha512module.c; do
+# rm Modules/$f
+#done
#
# Apply patches:
@@ -1056,7 +1065,7 @@ done
%if !%{with_gdbm}
%patch144 -p1
%endif
-%patch146 -p1
+#patch146 -p1
%patch147 -p1
%patch153 -p0
%patch155 -p1
@@ -1084,6 +1093,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch200 -p1
%patch209 -p1
%patch242 -p1
+%patch247 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -1598,6 +1608,12 @@ rm -fr %{buildroot}
%doc README
%dir %{pylibdir}
%dir %{dynload_dir}
+
+%{dynload_dir}/_md5module.so
+%{dynload_dir}/_sha256module.so
+%{dynload_dir}/_sha512module.so
+%{dynload_dir}/_shamodule.so
+
%{dynload_dir}/Python-%{version}-py%{pybasever}.egg-info
%{dynload_dir}/_bisectmodule.so
%{dynload_dir}/_bsddb.so
@@ -1812,6 +1828,12 @@ rm -fr %{buildroot}
# Analog of the -libs subpackage's files, with debug builds of the built-in
# "extension" modules:
+
+%{dynload_dir}/_md5module_d.so
+%{dynload_dir}/_sha256module_d.so
+%{dynload_dir}/_sha512module_d.so
+%{dynload_dir}/_shamodule_d.so
+
%{dynload_dir}/_bisectmodule_d.so
%{dynload_dir}/_bsddb_d.so
%{dynload_dir}/_codecs_cn_d.so
@@ -1938,6 +1960,11 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Wed Oct 12 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-8
+- Port ssl and hashlib modules to OpenSSL 1.1.0
+- Drop hashlib patch for now
+- Add riscv64 arch to 64bit and no-valgrind arches
+
* Thu Sep 29 2016 Miro Hronok <mhroncok(a)redhat.com> - 2.7.12-7
- Provide python27
commit dc5f99530207b06cedb71b8b4af2a61fe93ac674
Author: Richard W.M. Jones <rjones(a)redhat.com>
Date: Sun Oct 9 11:12:33 2016 +0100
Add riscv64 to: arches without valgrind, 64 bit arches.
diff --git a/python.spec b/python.spec
index fe5ed2f..c927d4a 100644
--- a/python.spec
+++ b/python.spec
@@ -47,7 +47,7 @@
%global with_systemtap 1
# some arches don't have valgrind so we need to disable its support on them
-%ifnarch s390 %{mips}
+%ifnarch s390 %{mips} riscv64
%global with_valgrind 1
%else
%global with_valgrind 0
@@ -1402,7 +1402,7 @@ install -d
%{buildroot}/%{_prefix}/lib/python%{pybasever}/site-packages
%global _pyconfig32_h pyconfig-32.h
%global _pyconfig64_h pyconfig-64.h
-%ifarch %{power64} s390x x86_64 ia64 alpha sparc64 aarch64 %{mips64}
+%ifarch %{power64} s390x x86_64 ia64 alpha sparc64 aarch64 %{mips64} riscv64
%global _pyconfig_h %{_pyconfig64_h}
%else
%global _pyconfig_h %{_pyconfig32_h}
commit 9b77cb62b4f483d6b7130403117d3140fb71e9bb
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Thu Sep 29 14:42:42 2016 +0200
Provide python27
diff --git a/python.spec b/python.spec
index 141c466..fe5ed2f 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.12
-Release: 6%{?dist}
+Release: 7%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -810,6 +810,7 @@ Obsoletes: PyXML <= 0.8.4-29
# (having Obsoletes here caused problems with multilib; see rhbz#667984)
Provides: python-argparse = %{version}-%{release}
%endif
+Provides: python27 = %{version}-%{release}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -1937,6 +1938,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu Sep 29 2016 Miro Hronok <mhroncok(a)redhat.com> - 2.7.12-7
+- Provide python27
+
* Fri Sep 02 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-6
- Remove unversioned Obsoletes
commit 1f1422a9168d9eeaa2dc20a58a6ca31d7a6711f4
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Fri Sep 2 16:33:52 2016 +0200
Remove unversioned obsoletes
diff --git a/python.spec b/python.spec
index b24a7db..141c466 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.12
-Release: 5%{?dist}
+Release: 6%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -790,9 +790,6 @@ Patch5000: 05000-autotool-intermediates.patch
# ======================================================
%if %{main_python}
-Obsoletes: Distutils
-Provides: Distutils
-Obsoletes: python2
Provides: python2 = %{version}
Obsoletes: python-elementtree <= 1.2.6
Obsoletes: python-ordereddict <= 1.1-8
@@ -866,7 +863,6 @@ Requires: pkgconfig
# package
Conflicts: %{python} < %{version}-%{release}
%if %{main_python}
-Obsoletes: python2-devel
Provides: python2-devel = %{version}-%{release}
Provides: python2-devel%{?_isa} = %{version}-%{release}
%endif
@@ -888,7 +884,6 @@ Group: Development/Tools
Requires: %{name} = %{version}-%{release}
Requires: %{tkinter} = %{version}-%{release}
%if %{main_python}
-Obsoletes: python2-tools
Provides: python2-tools = %{version}
%endif
@@ -902,7 +897,6 @@ Summary: A graphical user interface for the Python scripting language
Group: Development/Languages
Requires: %{name} = %{version}-%{release}
%if %{main_python}
-Obsoletes: tkinter2
Provides: tkinter2 = %{version}
%endif
@@ -1943,6 +1937,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Fri Sep 02 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-6
+- Remove unversioned Obsoletes
+
* Thu Sep 01 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-5
- Rebase rewheel patch so it applies properly (rhbz#1372183)
commit f9138c2f2ab943d69690cdda779ca28fbb82916e
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Thu Sep 1 15:39:11 2016 +0200
Rebase rewheel patch so it applies properly
diff --git a/00198-add-rewheel-module.patch b/00198-add-rewheel-module.patch
index 2f558fe..029f24f 100644
--- a/00198-add-rewheel-module.patch
+++ b/00198-add-rewheel-module.patch
@@ -1,7 +1,81 @@
-diff -ru --new-file Python-2.7.9rc1-rewheel/Lib/ensurepip/rewheel/__init__.py
Python-2.7.9rc1/Lib/ensurepip/rewheel/__init__.py
---- Python-2.7.9rc1-rewheel/Lib/ensurepip/rewheel/__init__.py 1970-01-01
01:00:00.000000000 +0100
-+++ Python-2.7.9rc1/Lib/ensurepip/rewheel/__init__.py 2014-12-08 11:29:34.215237317
+0100
-@@ -0,0 +1,143 @@
+diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py
+index 14c9adb..e20104e 100644
+--- a/Lib/ensurepip/__init__.py
++++ b/Lib/ensurepip/__init__.py
+@@ -7,6 +7,7 @@ import pkgutil
+ import shutil
+ import sys
+ import tempfile
++from ensurepip import rewheel
+
+
+ __all__ = ["version", "bootstrap"]
+@@ -43,6 +44,8 @@ def _run_pip(args, additional_paths=None):
+
+ # Install the bundled software
+ import pip
++ if args[0] in ["install", "list", "wheel"]:
++ args.append('--pre')
+ pip.main(args)
+
+
+@@ -93,21 +96,40 @@ def bootstrap(root=None, upgrade=False, user=False,
+ # omit pip and easy_install
+ os.environ["ENSUREPIP_OPTIONS"] = "install"
+
++ whls = []
++ rewheel_dir = None
++ # try to see if we have system-wide versions of _PROJECTS
++ dep_records = rewheel.find_system_records([p[0] for p in _PROJECTS])
++ # TODO: check if system-wide versions are the newest ones
++ # if --upgrade is used?
++ if all(dep_records):
++ # if we have all _PROJECTS installed system-wide, we'll recreate
++ # wheels from them and install those
++ rewheel_dir = tempfile.mkdtemp()
++ for dr in dep_records:
++ new_whl = rewheel.rewheel_from_record(dr, rewheel_dir)
++ whls.append(os.path.join(rewheel_dir, new_whl))
++ else:
++ # if we don't have all the _PROJECTS installed system-wide,
++ # let's just fall back to bundled wheels
++ for project, version in _PROJECTS:
++ whl = os.path.join(
++ os.path.dirname(__file__),
++ "_bundled",
++ "{}-{}-py2.py3-none-any.whl".format(project, version)
++ )
++ whls.append(whl)
++
+ tmpdir = tempfile.mkdtemp()
+ 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))
++ for whl in whls:
++ shutil.copy(whl, tmpdir)
++ additional_paths.append(os.path.join(tmpdir, os.path.basename(whl)))
++ if rewheel_dir:
++ shutil.rmtree(rewheel_dir)
+
+ # Construct the arguments to be passed to the pip command
+ args = ["install", "--no-index", "--find-links",
tmpdir]
+diff --git a/Lib/ensurepip/rewheel/__init__.py b/Lib/ensurepip/rewheel/__init__.py
+new file mode 100644
+index 0000000..75c2094
+--- /dev/null
++++ b/Lib/ensurepip/rewheel/__init__.py
+@@ -0,0 +1,158 @@
+import argparse
+import codecs
+import csv
@@ -160,81 +234,11 @@ diff -ru --new-file
Python-2.7.9rc1-rewheel/Lib/ensurepip/rewheel/__init__.py Py
+ else:
+ pass # bad RECORD or empty line
+ return to_write, to_omit
-diff -Nur Python-2.7.9/Lib/ensurepip/__init__.py
Python-2.7.9-rewheel/Lib/ensurepip/__init__.py
---- Python-2.7.9/Lib/ensurepip/__init__.py 2014-08-21 10:49:30.792695824 +0200
-+++ Python-2.7.9-rewheel/Lib/ensurepip/__init__.py 2014-08-21 10:10:41.958341726 +0200
-@@ -7,6 +7,7 @@ import pkgutil
- import shutil
- import sys
- import tempfile
-+from ensurepip import rewheel
-
-
- __all__ = ["version", "bootstrap"]
-@@ -43,6 +44,8 @@
-
- # Install the bundled software
- import pip
-+ if args[0] in ["install", "list", "wheel"]:
-+ args.append('--pre')
- pip.main(args)
-
-
-@@ -93,21 +96,40 @@ def bootstrap(root=None, upgrade=False,
- # omit pip and easy_install
- os.environ["ENSUREPIP_OPTIONS"] = "install"
-
-+ whls = []
-+ rewheel_dir = None
-+ # try to see if we have system-wide versions of _PROJECTS
-+ dep_records = rewheel.find_system_records([p[0] for p in _PROJECTS])
-+ # TODO: check if system-wide versions are the newest ones
-+ # if --upgrade is used?
-+ if all(dep_records):
-+ # if we have all _PROJECTS installed system-wide, we'll recreate
-+ # wheels from them and install those
-+ rewheel_dir = tempfile.mkdtemp()
-+ for dr in dep_records:
-+ new_whl = rewheel.rewheel_from_record(dr, rewheel_dir)
-+ whls.append(os.path.join(rewheel_dir, new_whl))
-+ else:
-+ # if we don't have all the _PROJECTS installed system-wide,
-+ # let's just fall back to bundled wheels
-+ for project, version in _PROJECTS:
-+ whl = os.path.join(
-+ os.path.dirname(__file__),
-+ "_bundled",
-+ "{}-{}-py2.py3-none-any.whl".format(project, version)
-+ )
-+ whls.append(whl)
-+
- tmpdir = tempfile.mkdtemp()
- 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))
-+ for whl in whls:
-+ shutil.copy(whl, tmpdir)
-+ additional_paths.append(os.path.join(tmpdir, os.path.basename(whl)))
-+ if rewheel_dir:
-+ shutil.rmtree(rewheel_dir)
-
- # Construct the arguments to be passed to the pip command
- args = ["install", "--no-index", "--find-links",
tmpdir]
-diff -Nur Python-2.7.9/Makefile.pre.in Python-2.7.9-rewheel/Makefile.pre.in
---- Python-2.7.9/Makefile.pre.in 2014-08-21 10:49:31.512695040 +0200
-+++ Python-2.7.9-rewheel/Makefile.pre.in 2014-08-21 10:10:41.961341722 +0200
-@@ -976,7 +976,7 @@ LIBSUBDIRS= lib-tk lib-tk/test lib-tk/te
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index ca33158..44bdde5 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -1066,7 +1066,7 @@ LIBSUBDIRS= lib-tk lib-tk/test lib-tk/test/test_tkinter \
test/tracedmodules \
encodings compiler hotshot \
email email/mime email/test email/test/data \
diff --git a/python.spec b/python.spec
index 869461b..b24a7db 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.12
-Release: 4%{?dist}
+Release: 5%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1943,6 +1943,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu Sep 01 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-5
+- Rebase rewheel patch so it applies properly (rhbz#1372183)
+
* Tue Aug 09 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-4
- SPEC file cleanup
- Removal of unapplied patches
commit b6952a5e13c9ff5dbebf40bae7238ce855586303
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Tue Aug 16 18:45:23 2016 +0200
SPEC file cleanup
diff --git a/00101-lib64-regex.patch b/00101-lib64-regex.patch
deleted file mode 100644
index e399390..0000000
--- a/00101-lib64-regex.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-diff -up Python-2.7.3/Lib/test/test_re.py.lib64-regex Python-2.7.3/Lib/test/test_re.py
---- Python-2.7.3/Lib/test/test_re.py.lib64-regex 2012-04-09 19:07:32.000000000 -0400
-+++ Python-2.7.3/Lib/test/test_re.py 2013-02-19 13:53:57.624033102 -0500
-@@ -757,6 +757,15 @@ class ReTests(unittest.TestCase):
- self.assertRaises(TypeError, re.finditer, "a", {})
- self.assertRaises(OverflowError, _sre.compile, "abc", 0,
[long_overflow])
-
-+ def test_bug_931848(self):
-+ try:
-+ unicode
-+ except NameError:
-+ pass
-+ pattern = eval('u"[\u002E\u3002\uFF0E\uFF61]"')
-+ self.assertEqual(re.compile(pattern).split("a.b.c"),
-+ ['a','b','c'])
-+
- def run_re_tests():
- from test.re_tests import tests, SUCCEED, FAIL, SYNTAX_ERROR
- if verbose:
diff --git a/00148-gdbm-1.9-magic-values.patch b/00148-gdbm-1.9-magic-values.patch
deleted file mode 100644
index 5f1d881..0000000
--- a/00148-gdbm-1.9-magic-values.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -up Python-2.7.2/Lib/whichdb.py.gdbm-1.9-magic Python-2.7.2/Lib/whichdb.py
---- Python-2.7.2/Lib/whichdb.py.gdbm-1.9-magic 2011-06-11 11:46:26.000000000 -0400
-+++ Python-2.7.2/Lib/whichdb.py 2011-09-30 15:45:21.778872290 -0400
-@@ -91,7 +91,7 @@ def whichdb(filename):
- return ""
-
- # Check for GNU dbm
-- if magic == 0x13579ace:
-+ if magic in (0x13579ace, 0x13579acd, 0x13579acf):
- return "gdbm"
-
- # Check for old Berkeley db hash file format v2
-diff -up Python-2.7.2/Misc/NEWS.gdbm-1.9-magic Python-2.7.2/Misc/NEWS
diff --git a/00152-fix-test-gdb-regex.patch b/00152-fix-test-gdb-regex.patch
deleted file mode 100644
index 4e31c2e..0000000
--- a/00152-fix-test-gdb-regex.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- Lib/test/test_gdb.py.old 2012-04-11 19:35:13.512681203 -0400
-+++ Lib/test/test_gdb.py 2012-04-11 19:39:52.567192540 -0400
-@@ -159,7 +159,7 @@ class DebuggerTests(unittest.TestCase):
- # gdb can insert additional '\n' and space characters in various places
- # in its output, depending on the width of the terminal it's connected
- # to (using its "wrap_here" function)
-- m =
re.match('.*#0\s+builtin_id\s+\(self\=.*,\s+v=\s*(.*?)\)\s+at\s+Python/bltinmodule.c.*',
-+ m =
re.match('.*#0\s+builtin_id\s+\(self\=.*,\s+v=\s*(.*?)\)\s+at\s+\S*Python/bltinmodule.c.*',
- gdb_output, re.DOTALL)
- if not m:
- self.fail('Unexpected gdb output: %r\n%s' % (gdb_output,
gdb_output))
diff --git a/00158-fix-hashlib-leak.patch b/00158-fix-hashlib-leak.patch
deleted file mode 100644
index 12e7866..0000000
--- a/00158-fix-hashlib-leak.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-diff -up Python-2.7.3/Lib/test/test_hashlib.py.fix-hashlib-leak
Python-2.7.3/Lib/test/test_hashlib.py
---- Python-2.7.3/Lib/test/test_hashlib.py.fix-hashlib-leak 2013-02-19 14:13:44.000000000
-0500
-+++ Python-2.7.3/Lib/test/test_hashlib.py 2013-02-19 14:14:31.319948742 -0500
-@@ -106,12 +106,8 @@ class HashLibTestCase(unittest.TestCase)
- _algo.islower()]))
-
- def test_unknown_hash(self):
-- try:
-- hashlib.new('spam spam spam spam spam')
-- except ValueError:
-- pass
-- else:
-- self.assertTrue(0 == "hashlib didn't reject bogus hash name")
-+ self.assertRaises(ValueError, hashlib.new, 'spam spam spam spam spam')
-+ self.assertRaises(TypeError, hashlib.new, 1)
-
- def test_hexdigest(self):
- for name in self.supported_hash_names:
-diff -up Python-2.7.3/Modules/_hashopenssl.c.fix-hashlib-leak
Python-2.7.3/Modules/_hashopenssl.c
---- Python-2.7.3/Modules/_hashopenssl.c.fix-hashlib-leak 2013-02-19 14:13:44.646951933
-0500
-+++ Python-2.7.3/Modules/_hashopenssl.c 2013-02-19 14:13:44.715951929 -0500
-@@ -549,6 +549,7 @@ EVP_new(PyObject *self, PyObject *args,
- }
-
- if (!PyArg_Parse(name_obj, "s", &name)) {
-+ PyBuffer_Release(&view);
- PyErr_SetString(PyExc_TypeError, "name must be a string");
- return NULL;
- }
diff --git a/00166-fix-fake-repr-in-gdb-hooks.patch
b/00166-fix-fake-repr-in-gdb-hooks.patch
deleted file mode 100644
index 2cc0283..0000000
--- a/00166-fix-fake-repr-in-gdb-hooks.patch
+++ /dev/null
@@ -1,126 +0,0 @@
-diff -up Python-2.7.3/Tools/gdb/libpython.py.fix-fake-repr-in-gdb-hooks
Python-2.7.3/Tools/gdb/libpython.py
---- Python-2.7.3/Tools/gdb/libpython.py.fix-fake-repr-in-gdb-hooks 2013-02-19
17:21:33.541181366 -0500
-+++ Python-2.7.3/Tools/gdb/libpython.py 2013-02-19 17:21:42.090180782 -0500
-@@ -105,6 +105,24 @@ class TruncatedStringIO(object):
- def getvalue(self):
- return self._val
-
-+class FakeProxy(object):
-+ """
-+ Class representing a non-descript PyObject* value in the inferior
-+ process for when we don't have a custom scraper, intended to have
-+ a sane repr().
-+ """
-+ def __init__(self, tp_name, address):
-+ self.tp_name = tp_name
-+ self.address = address
-+
-+ def __repr__(self):
-+ # For the NULL pointer, we have no way of knowing a type, so
-+ # special-case it as per
-+ #
http://bugs.python.org/issue8032#msg100882
-+ if self.address == 0:
-+ return '0x0'
-+ return '<%s at remote 0x%x>' % (self.tp_name, self.address)
-+
- class PyObjectPtr(object):
- """
- Class wrapping a gdb.Value that's a either a (PyObject*) within the
-@@ -232,28 +250,8 @@ class PyObjectPtr(object):
- visiting object graphs with loops). Analogous to Py_ReprEnter and
- Py_ReprLeave
- '''
--
-- class FakeRepr(object):
-- """
-- Class representing a non-descript PyObject* value in the inferior
-- process for when we don't have a custom scraper, intended to have
-- a sane repr().
-- """
--
-- def __init__(self, tp_name, address):
-- self.tp_name = tp_name
-- self.address = address
--
-- def __repr__(self):
-- # For the NULL pointer, we have no way of knowing a type, so
-- # special-case it as per
-- #
http://bugs.python.org/issue8032#msg100882
-- if self.address == 0:
-- return '0x0'
-- return '<%s at remote 0x%x>' % (self.tp_name,
self.address)
--
-- return FakeRepr(self.safe_tp_name(),
-- long(self._gdbval))
-+ return FakeProxy(self.safe_tp_name(),
-+ long(self._gdbval))
-
- def write_repr(self, out, visited):
- '''
-@@ -384,7 +382,7 @@ def _write_instance_repr(out, visited, n
- if not first:
- out.write(', ')
- first = False
-- out.write(pyop_arg.proxyval(visited))
-+ out.write(str(pyop_arg.proxyval(visited)))
- out.write('=')
- pyop_val.write_repr(out, visited)
- out.write(')')
-@@ -785,6 +783,8 @@ class PyNoneStructPtr(PyObjectPtr):
- def proxyval(self, visited):
- return None
-
-+class CantReadFilename(ValueError):
-+ pass
-
- class PyFrameObjectPtr(PyObjectPtr):
- _typename = 'PyFrameObject'
-@@ -861,7 +861,10 @@ class PyFrameObjectPtr(PyObjectPtr):
- '''Get the path of the current Python source file, as a
string'''
- if self.is_optimized_out():
- return '(frame information optimized out)'
-- return self.co_filename.proxyval(set())
-+ value = self.co_filename.proxyval(set())
-+ if isinstance(value, FakeProxy):
-+ raise CantReadFilename('unable to extract filename)')
-+ return value
-
- def current_line_num(self):
- '''Get current line number as an integer (1-based)
-@@ -907,7 +910,7 @@ class PyFrameObjectPtr(PyObjectPtr):
- out.write(', ')
- first = False
-
-- out.write(pyop_name.proxyval(visited))
-+ out.write(str(pyop_name.proxyval(visited)))
- out.write('=')
- pyop_value.write_repr(out, visited)
-
-@@ -1252,8 +1255,11 @@ class Frame(object):
- write_unicode(sys.stdout, '#%i %s\n' % (self.get_index(),
line))
- if not pyop.is_optimized_out():
-- line = pyop.current_line()
-- if line is not None:
-- sys.stdout.write(' %s\n' % line.strip())
-+ try:
-+ line = pyop.current_line()
-+ if line is not None:
-+ sys.stdout.write(' %s\n' % line.strip())
-+ except CantReadFilename:
-+ sys.stdout.write(' %s\n' % '(unable to read
filename)')
- else:
- sys.stdout.write('#%i (unable to read python frame
information)\n' % self.get_index())
- else:
-@@ -1303,7 +1309,11 @@ class PyList(gdb.Command):
- print('Unable to read information on python frame')
- return
-
-- filename = pyop.filename()
-+ try:
-+ filename = pyop.filename()
-+ except CantReadFilename:
-+ print("Unable to extract filename from python frame")
-+ return
- lineno = pyop.current_line_num()
-
- if start is None:
diff --git a/00171-raise-correct-exception-when-dev-urandom-is-missing.patch
b/00171-raise-correct-exception-when-dev-urandom-is-missing.patch
deleted file mode 100644
index 1b26e51..0000000
--- a/00171-raise-correct-exception-when-dev-urandom-is-missing.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff -up Python-2.7.3/Misc/NEWS.raise-correct-exception-when-dev-urandom-is-missing
Python-2.7.3/Misc/NEWS
-diff -up Python-2.7.3/Python/random.c.raise-correct-exception-when-dev-urandom-is-missing
Python-2.7.3/Python/random.c
----
Python-2.7.3/Python/random.c.raise-correct-exception-when-dev-urandom-is-missing 2012-04-09
19:07:35.000000000 -0400
-+++ Python-2.7.3/Python/random.c 2013-02-21 14:39:01.020988043 -0500
-@@ -165,7 +165,8 @@ dev_urandom_python(char *buffer, Py_ssiz
- Py_END_ALLOW_THREADS
- if (fd < 0)
- {
-- PyErr_SetFromErrnoWithFilename(PyExc_OSError, "/dev/urandom");
-+ PyErr_SetString(PyExc_NotImplementedError,
-+ "/dev/urandom (or equivalent) not found");
- return -1;
- }
-
diff --git a/00172-use-poll-for-multiprocessing-socket-connection.patch
b/00172-use-poll-for-multiprocessing-socket-connection.patch
deleted file mode 100644
index 5b2f626..0000000
--- a/00172-use-poll-for-multiprocessing-socket-connection.patch
+++ /dev/null
@@ -1,87 +0,0 @@
-diff -up
Python-2.7.3/Doc/library/asyncore.rst.use-poll-for-multiprocessing-socket-connection
Python-2.7.3/Doc/library/asyncore.rst
----
Python-2.7.3/Doc/library/asyncore.rst.use-poll-for-multiprocessing-socket-connection 2013-02-21
15:21:41.204812979 -0500
-+++ Python-2.7.3/Doc/library/asyncore.rst 2013-02-21 15:21:41.211812976 -0500
-@@ -318,13 +318,10 @@ connections and dispatches the incoming
-
- def handle_accept(self):
- pair = self.accept()
-- if pair is None:
-- pass
-- else:
-+ if pair is not None:
- sock, addr = pair
- print 'Incoming connection from %s' % repr(addr)
- handler = EchoHandler(sock)
-
- server = EchoServer('localhost', 8080)
- asyncore.loop()
--
-diff -up
Python-2.7.3/Lib/multiprocessing/connection.py.use-poll-for-multiprocessing-socket-connection
Python-2.7.3/Lib/multiprocessing/connection.py
-diff -up
Python-2.7.3/Lib/test/test_multiprocessing.py.use-poll-for-multiprocessing-socket-connection
Python-2.7.3/Lib/test/test_multiprocessing.py
----
Python-2.7.3/Lib/test/test_multiprocessing.py.use-poll-for-multiprocessing-socket-connection 2013-02-21
15:21:41.199812979 -0500
-+++ Python-2.7.3/Lib/test/test_multiprocessing.py 2013-02-21 15:21:41.208812978 -0500
-@@ -1452,6 +1452,7 @@ class _TestConnection(BaseTestCase):
- self.assertTimingAlmostEqual(poll.elapsed, TIMEOUT1)
-
- conn.send(None)
-+ time.sleep(.1)
-
- self.assertEqual(poll(TIMEOUT1), True)
- self.assertTimingAlmostEqual(poll.elapsed, 0)
-diff -up
Python-2.7.3/Modules/_multiprocessing/socket_connection.c.use-poll-for-multiprocessing-socket-connection
Python-2.7.3/Modules/_multiprocessing/socket_connection.c
----
Python-2.7.3/Modules/_multiprocessing/socket_connection.c.use-poll-for-multiprocessing-socket-connection 2013-02-21
15:21:41.201812979 -0500
-+++ Python-2.7.3/Modules/_multiprocessing/socket_connection.c 2013-02-21
15:21:41.215812978 -0500
-@@ -8,6 +8,10 @@
-
- #include "multiprocessing.h"
-
-+#if defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)
-+# include "poll.h"
-+#endif
-+
- #ifdef MS_WINDOWS
- # define WRITE(h, buffer, length) send((SOCKET)h, buffer, length, 0)
- # define READ(h, buffer, length) recv((SOCKET)h, buffer, length, 0)
-@@ -155,6 +159,34 @@ conn_recv_string(ConnectionObject *conn,
- static int
- conn_poll(ConnectionObject *conn, double timeout, PyThreadState *_save)
- {
-+#if defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)
-+ int res;
-+ struct pollfd p;
-+
-+ p.fd = (int)conn->handle;
-+ p.events = POLLIN | POLLPRI;
-+ p.revents = 0;
-+
-+ if (timeout < 0) {
-+ res = poll(&p, 1, -1);
-+ } else {
-+ res = poll(&p, 1, (int)(timeout * 1000 + 0.5));
-+ }
-+
-+ if (res < 0) {
-+ return MP_SOCKET_ERROR;
-+ } else if (p.revents & (POLLNVAL|POLLERR)) {
-+ Py_BLOCK_THREADS
-+ PyErr_SetString(PyExc_IOError, "poll() gave POLLNVAL or POLLERR");
-+ Py_UNBLOCK_THREADS
-+ return MP_EXCEPTION_HAS_BEEN_SET;
-+ } else if (p.revents != 0) {
-+ return TRUE;
-+ } else {
-+ assert(res == 0);
-+ return FALSE;
-+ }
-+#else
- int res;
- fd_set rfds;
-
-@@ -190,6 +222,7 @@ conn_poll(ConnectionObject *conn, double
- assert(res == 0);
- return FALSE;
- }
-+#endif
- }
-
- /*
diff --git a/00175-fix-configure-Wformat.patch b/00175-fix-configure-Wformat.patch
deleted file mode 100644
index d527ab0..0000000
--- a/00175-fix-configure-Wformat.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -up Python-2.7.3/configure.ac.fix-configure-Wformat Python-2.7.3/configure.ac
---- Python-2.7.3/configure.ac.fix-configure-Wformat 2013-03-25 15:15:18.473888383 -0400
-+++ Python-2.7.3/configure.ac 2013-03-25 15:15:32.513887426 -0400
-@@ -1200,7 +1200,7 @@ if test "$GCC" = "yes"
- then
- AC_MSG_CHECKING(whether gcc supports ParseTuple __format__)
- save_CFLAGS=$CFLAGS
-- CFLAGS="$CFLAGS -Werror"
-+ CFLAGS="$CFLAGS -Werror -Wformat"
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([[void f(char*,...)__attribute((format(PyArg_ParseTuple, 1, 2)));]],
[[]])
- ],[
diff --git a/00185-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch
b/00185-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch
deleted file mode 100644
index e215589..0000000
--- a/00185-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch
+++ /dev/null
@@ -1,247 +0,0 @@
-diff -r 9ddc63c039ba Lib/test/nullbytecert.pem
---- /dev/null Thu Jan 01 00:00:00 1970 +0000
-+++ b/Lib/test/nullbytecert.pem Sun Aug 11 18:13:17 2013 +0200
-@@ -0,0 +1,90 @@
-+Certificate:
-+ Data:
-+ Version: 3 (0x2)
-+ Serial Number: 0 (0x0)
-+ Signature Algorithm: sha1WithRSAEncryption
-+ Issuer: C=US, ST=Oregon, L=Beaverton, O=Python Software Foundation, OU=Python
Core Development,
CN=null.python.org\x00example.org/emailAddress=python-dev@python.org
-+ Validity
-+ Not Before: Aug 7 13:11:52 2013 GMT
-+ Not After : Aug 7 13:12:52 2013 GMT
-+ Subject: C=US, ST=Oregon, L=Beaverton, O=Python Software Foundation, OU=Python
Core Development,
CN=null.python.org\x00example.org/emailAddress=python-dev@python.org
-+ Subject Public Key Info:
-+ Public Key Algorithm: rsaEncryption
-+ Public-Key: (2048 bit)
-+ Modulus:
-+ 00:b5:ea:ed:c9:fb:46:7d:6f:3b:76:80:dd:3a:f3:
-+ 03:94:0b:a7:a6:db:ec:1d:df:ff:23:74:08:9d:97:
-+ 16:3f:a3:a4:7b:3e:1b:0e:96:59:25:03:a7:26:e2:
-+ 88:a9:cf:79:cd:f7:04:56:b0:ab:79:32:6e:59:c1:
-+ 32:30:54:eb:58:a8:cb:91:f0:42:a5:64:27:cb:d4:
-+ 56:31:88:52:ad:cf:bd:7f:f0:06:64:1f:cc:27:b8:
-+ a3:8b:8c:f3:d8:29:1f:25:0b:f5:46:06:1b:ca:02:
-+ 45:ad:7b:76:0a:9c:bf:bb:b9:ae:0d:16:ab:60:75:
-+ ae:06:3e:9c:7c:31:dc:92:2f:29:1a:e0:4b:0c:91:
-+ 90:6c:e9:37:c5:90:d7:2a:d7:97:15:a3:80:8f:5d:
-+ 7b:49:8f:54:30:d4:97:2c:1c:5b:37:b5:ab:69:30:
-+ 68:43:d3:33:78:4b:02:60:f5:3c:44:80:a1:8f:e7:
-+ f0:0f:d1:5e:87:9e:46:cf:62:fc:f9:bf:0c:65:12:
-+ f1:93:c8:35:79:3f:c8:ec:ec:47:f5:ef:be:44:d5:
-+ ae:82:1e:2d:9a:9f:98:5a:67:65:e1:74:70:7c:cb:
-+ d3:c2:ce:0e:45:49:27:dc:e3:2d:d4:fb:48:0e:2f:
-+ 9e:77:b8:14:46:c0:c4:36:ca:02:ae:6a:91:8c:da:
-+ 2f:85
-+ Exponent: 65537 (0x10001)
-+ X509v3 extensions:
-+ X509v3 Basic Constraints: critical
-+ CA:FALSE
-+ X509v3 Subject Key Identifier:
-+ 88:5A:55:C0:52:FF:61:CD:52:A3:35:0F:EA:5A:9C:24:38:22:F7:5C
-+ X509v3 Key Usage:
-+ Digital Signature, Non Repudiation, Key Encipherment
-+ X509v3 Subject Alternative Name:
-+ *************************************************************
-+ WARNING: The values for DNS, email and URI are WRONG. OpenSSL
-+ doesn't print the text after a NULL byte.
-+ *************************************************************
-+
DNS:altnull.python.org, email:null@python.org,
URI:http://null.python.org, IP Address:192.0.2.1, IP Address:2001:DB8:0:0:0:0:0:1
-+ Signature Algorithm: sha1WithRSAEncryption
-+ ac:4f:45:ef:7d:49:a8:21:70:8e:88:59:3e:d4:36:42:70:f5:
-+ a3:bd:8b:d7:a8:d0:58:f6:31:4a:b1:a4:a6:dd:6f:d9:e8:44:
-+ 3c:b6:0a:71:d6:7f:b1:08:61:9d:60:ce:75:cf:77:0c:d2:37:
-+ 86:02:8d:5e:5d:f9:0f:71:b4:16:a8:c1:3d:23:1c:f1:11:b3:
-+ 56:6e:ca:d0:8d:34:94:e6:87:2a:99:f2:ae:ae:cc:c2:e8:86:
-+ de:08:a8:7f:c5:05:fa:6f:81:a7:82:e6:d0:53:9d:34:f4:ac:
-+ 3e:40:fe:89:57:7a:29:a4:91:7e:0b:c6:51:31:e5:10:2f:a4:
-+ 60:76:cd:95:51:1a:be:8b:a1:b0:fd:ad:52:bd:d7:1b:87:60:
-+ d2:31:c7:17:c4:18:4f:2d:08:25:a3:a7:4f:b7:92:ca:e2:f5:
-+ 25:f1:54:75:81:9d:b3:3d:61:a2:f7:da:ed:e1:c6:6f:2c:60:
-+ 1f:d8:6f:c5:92:05:ab:c9:09:62:49:a9:14:ad:55:11:cc:d6:
-+ 4a:19:94:99:97:37:1d:81:5f:8b:cf:a3:a8:96:44:51:08:3d:
-+ 0b:05:65:12:eb:b6:70:80:88:48:72:4f:c6:c2:da:cf:cd:8e:
-+ 5b:ba:97:2f:60:b4:96:56:49:5e:3a:43:76:63:04:be:2a:f6:
-+ c1:ca:a9:94
-+-----BEGIN CERTIFICATE-----
-+MIIE2DCCA8CgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBxTELMAkGA1UEBhMCVVMx
-+DzANBgNVBAgMBk9yZWdvbjESMBAGA1UEBwwJQmVhdmVydG9uMSMwIQYDVQQKDBpQ
-+eXRob24gU29mdHdhcmUgRm91bmRhdGlvbjEgMB4GA1UECwwXUHl0aG9uIENvcmUg
-+RGV2ZWxvcG1lbnQxJDAiBgNVBAMMG251bGwucHl0aG9uLm9yZwBleGFtcGxlLm9y
-+ZzEkMCIGCSqGSIb3DQEJARYVcHl0aG9uLWRldkBweXRob24ub3JnMB4XDTEzMDgw
-+NzEzMTE1MloXDTEzMDgwNzEzMTI1MlowgcUxCzAJBgNVBAYTAlVTMQ8wDQYDVQQI
-+DAZPcmVnb24xEjAQBgNVBAcMCUJlYXZlcnRvbjEjMCEGA1UECgwaUHl0aG9uIFNv
-+ZnR3YXJlIEZvdW5kYXRpb24xIDAeBgNVBAsMF1B5dGhvbiBDb3JlIERldmVsb3Bt
-+ZW50MSQwIgYDVQQDDBtudWxsLnB5dGhvbi5vcmcAZXhhbXBsZS5vcmcxJDAiBgkq
-+hkiG9w0BCQEWFXB5dGhvbi1kZXZAcHl0aG9uLm9yZzCCASIwDQYJKoZIhvcNAQEB
-+BQADggEPADCCAQoCggEBALXq7cn7Rn1vO3aA3TrzA5QLp6bb7B3f/yN0CJ2XFj+j
-+pHs+Gw6WWSUDpybiiKnPec33BFawq3kyblnBMjBU61ioy5HwQqVkJ8vUVjGIUq3P
-+vX/wBmQfzCe4o4uM89gpHyUL9UYGG8oCRa17dgqcv7u5rg0Wq2B1rgY+nHwx3JIv
-+KRrgSwyRkGzpN8WQ1yrXlxWjgI9de0mPVDDUlywcWze1q2kwaEPTM3hLAmD1PESA
-+oY/n8A/RXoeeRs9i/Pm/DGUS8ZPINXk/yOzsR/XvvkTVroIeLZqfmFpnZeF0cHzL
-+08LODkVJJ9zjLdT7SA4vnne4FEbAxDbKAq5qkYzaL4UCAwEAAaOB0DCBzTAMBgNV
-+HRMBAf8EAjAAMB0GA1UdDgQWBBSIWlXAUv9hzVKjNQ/qWpwkOCL3XDALBgNVHQ8E
-+BAMCBeAwgZAGA1UdEQSBiDCBhYIeYWx0bnVsbC5weXRob24ub3JnAGV4YW1wbGUu
-+Y29tgSBudWxsQHB5dGhvbi5vcmcAdXNlckBleGFtcGxlLm9yZ4YpaHR0cDovL251
-+bGwucHl0aG9uLm9yZwBodHRwOi8vZXhhbXBsZS5vcmeHBMAAAgGHECABDbgAAAAA
-+AAAAAAAAAAEwDQYJKoZIhvcNAQEFBQADggEBAKxPRe99SaghcI6IWT7UNkJw9aO9
-+i9eo0Fj2MUqxpKbdb9noRDy2CnHWf7EIYZ1gznXPdwzSN4YCjV5d+Q9xtBaowT0j
-+HPERs1ZuytCNNJTmhyqZ8q6uzMLoht4IqH/FBfpvgaeC5tBTnTT0rD5A/olXeimk
-+kX4LxlEx5RAvpGB2zZVRGr6LobD9rVK91xuHYNIxxxfEGE8tCCWjp0+3ksri9SXx
-+VHWBnbM9YaL32u3hxm8sYB/Yb8WSBavJCWJJqRStVRHM1koZlJmXNx2BX4vPo6iW
-+RFEIPQsFZRLrtnCAiEhyT8bC2s/Njlu6ly9gtJZWSV46Q3ZjBL4q9sHKqZQ=
-+-----END CERTIFICATE-----
-diff -r 9ddc63c039ba Lib/test/test_ssl.py
---- a/Lib/test/test_ssl.py Sun Aug 11 13:04:50 2013 +0300
-+++ b/Lib/test/test_ssl.py Sun Aug 11 18:13:17 2013 +0200
-@@ -25,6 +25,7 @@
- HOST = test_support.HOST
- CERTFILE = None
- SVN_PYTHON_ORG_ROOT_CERT = None
-+NULLBYTECERT = None
-
- def handle_error(prefix):
- exc_format = ' '.join(traceback.format_exception(*sys.exc_info()))
-@@ -123,6 +124,27 @@
- ('DNS', 'projects.forum.nokia.com'))
- )
-
-+ def test_parse_cert_CVE_2013_4073(self):
-+ p = ssl._ssl._test_decode_cert(NULLBYTECERT)
-+ if test_support.verbose:
-+ sys.stdout.write("\n" + pprint.pformat(p) + "\n")
-+ subject = ((('countryName', 'US'),),
-+ (('stateOrProvinceName', 'Oregon'),),
-+ (('localityName', 'Beaverton'),),
-+ (('organizationName', 'Python Software
Foundation'),),
-+ (('organizationalUnitName', 'Python Core
Development'),),
-+ (('commonName', 'null.python.org\x00example.org'),),
-+ (('emailAddress', 'python-dev(a)python.org'),))
-+ self.assertEqual(p['subject'], subject)
-+ self.assertEqual(p['issuer'], subject)
-+ self.assertEqual(p['subjectAltName'],
-+ (('DNS', 'altnull.python.org\x00example.com'),
-+ ('email',
'null@python.org\x00user(a)example.org'),
-+ ('URI',
'http://null.python.org\x00http://example.org'),
-+ ('IP Address', '192.0.2.1'),
-+ ('IP Address', '2001:DB8:0:0:0:0:0:1\n'))
-+ )
-+
- def test_DER_to_PEM(self):
- with open(SVN_PYTHON_ORG_ROOT_CERT, 'r') as f:
- pem = f.read()
-@@ -1360,7 +1382,7 @@
-
-
- def test_main(verbose=False):
-- global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, NOKIACERT
-+ global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, NOKIACERT, NULLBYTECERT
- CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir,
- "keycert.pem")
- SVN_PYTHON_ORG_ROOT_CERT = os.path.join(
-@@ -1368,10 +1390,13 @@
- "https_svn_python_org_root.pem")
- NOKIACERT = os.path.join(os.path.dirname(__file__) or os.curdir,
- "nokia.pem")
-+ NULLBYTECERT = os.path.join(os.path.dirname(__file__) or os.curdir,
-+ "nullbytecert.pem")
-
- if (not os.path.exists(CERTFILE) or
- not os.path.exists(SVN_PYTHON_ORG_ROOT_CERT) or
-- not os.path.exists(NOKIACERT)):
-+ not os.path.exists(NOKIACERT) or
-+ not os.path.exists(NULLBYTECERT)):
- raise test_support.TestFailed("Can't read certificate files!")
-
- tests = [BasicTests, BasicSocketTests]
-diff -r 9ddc63c039ba Modules/_ssl.c
---- a/Modules/_ssl.c Sun Aug 11 13:04:50 2013 +0300
-+++ b/Modules/_ssl.c Sun Aug 11 18:13:17 2013 +0200
-@@ -741,8 +741,13 @@
-
- /* get a rendering of each name in the set of names */
-
-+ int gntype;
-+ ASN1_STRING *as = NULL;
-+
- name = sk_GENERAL_NAME_value(names, j);
-- if (name->type == GEN_DIRNAME) {
-+ gntype = name-> type;
-+ switch (gntype) {
-+ case GEN_DIRNAME:
-
- /* we special-case DirName as a tuple of tuples of attributes */
-
-@@ -764,11 +769,61 @@
- goto fail;
- }
- PyTuple_SET_ITEM(t, 1, v);
-+ break;
-
-- } else {
-+ case GEN_EMAIL:
-+ case GEN_DNS:
-+ case GEN_URI:
-+ /* GENERAL_NAME_print() doesn't handle NUL bytes in ASN1_string
-+ correctly. */
-+ t = PyTuple_New(2);
-+ if (t == NULL)
-+ goto fail;
-+ switch (gntype) {
-+ case GEN_EMAIL:
-+ v = PyUnicode_FromString("email");
-+ as = name->d.rfc822Name;
-+ break;
-+ case GEN_DNS:
-+ v = PyUnicode_FromString("DNS");
-+ as = name->d.dNSName;
-+ break;
-+ case GEN_URI:
-+ v = PyUnicode_FromString("URI");
-+ as = name->d.uniformResourceIdentifier;
-+ break;
-+ }
-+ if (v == NULL) {
-+ Py_DECREF(t);
-+ goto fail;
-+ }
-+ PyTuple_SET_ITEM(t, 0, v);
-+ v = PyString_FromStringAndSize((char *)ASN1_STRING_data(as),
-+ ASN1_STRING_length(as));
-+ if (v == NULL) {
-+ Py_DECREF(t);
-+ goto fail;
-+ }
-+ PyTuple_SET_ITEM(t, 1, v);
-+ break;
-
-+ default:
- /* for everything else, we use the OpenSSL print form */
--
-+ switch (gntype) {
-+ /* check for new general name type */
-+ case GEN_OTHERNAME:
-+ case GEN_X400:
-+ case GEN_EDIPARTY:
-+ case GEN_IPADD:
-+ case GEN_RID:
-+ break;
-+ default:
-+ if (PyErr_Warn(PyExc_RuntimeWarning,
-+ "Unknown general name type") == -1) {
-+ goto fail;
-+ }
-+ break;
-+ }
- (void) BIO_reset(biobuf);
- GENERAL_NAME_print(biobuf, name);
- len = BIO_gets(biobuf, buf, sizeof(buf)-1);
-@@ -794,6 +849,7 @@
- goto fail;
- }
- PyTuple_SET_ITEM(t, 1, v);
-+ break;
- }
-
- /* and add that rendering to the list */
diff --git a/00190-get_python_version.patch b/00190-get_python_version.patch
deleted file mode 100644
index 822cd96..0000000
--- a/00190-get_python_version.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -r 2a38df26e009 Lib/distutils/command/bdist_rpm.py
---- a/Lib/distutils/command/bdist_rpm.py Tue Sep 03 11:39:06 2013 -0500
-+++ b/Lib/distutils/command/bdist_rpm.py Wed Sep 04 19:49:37 2013 +0200
-@@ -14,6 +14,7 @@
- from distutils.file_util import write_file
- from distutils.errors import (DistutilsOptionError, DistutilsPlatformError,
- DistutilsFileError, DistutilsExecError)
-+from distutils.sysconfig import get_python_version
- from distutils import log
-
- class bdist_rpm (Command):
diff --git a/00192-buffer-overflow.patch b/00192-buffer-overflow.patch
deleted file mode 100644
index 164b462..0000000
--- a/00192-buffer-overflow.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-
-# HG changeset patch
-# User Benjamin Peterson <benjamin(a)python.org>
-# Date 1389671978 18000
-# Node ID 87673659d8f7ba1623cd4914f09ad3d2ade034e9
-# Parent 2631d33ee7fbd5f0288931ef37872218d511d2e8
-complain when nbytes > buflen to fix possible buffer overflow (closes #20246)
-
-diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
---- a/Lib/test/test_socket.py
-+++ b/Lib/test/test_socket.py
-@@ -1620,6 +1620,16 @@ class BufferIOTest(SocketConnectedTest):
-
- _testRecvFromIntoMemoryview = _testRecvFromIntoArray
-
-+ def testRecvFromIntoSmallBuffer(self):
-+ # See issue #20246.
-+ buf = bytearray(8)
-+ self.assertRaises(ValueError, self.cli_conn.recvfrom_into, buf, 1024)
-+
-+ def _testRecvFromIntoSmallBuffer(self):
-+ with test_support.check_py3k_warnings():
-+ buf = buffer(MSG*2048)
-+ self.serv_conn.send(buf)
-+
-
- TIPC_STYPE = 2000
- TIPC_LOWER = 200
-diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
---- a/Modules/socketmodule.c
-+++ b/Modules/socketmodule.c
-@@ -2742,6 +2742,10 @@ sock_recvfrom_into(PySocketSockObject *s
- if (recvlen == 0) {
- /* If nbytes was not specified, use the buffer's length */
- recvlen = buflen;
-+ } else if (recvlen > buflen) {
-+ PyErr_SetString(PyExc_ValueError,
-+ "nbytes is greater than the length of the buffer");
-+ goto error;
- }
-
- readlen = sock_recvfrom_guts(s, buf.buf, recvlen, flags, &addr);
-
diff --git a/00194-fix-tests-with-sqlite-3.8.4.patch
b/00194-fix-tests-with-sqlite-3.8.4.patch
deleted file mode 100644
index 4037c26..0000000
--- a/00194-fix-tests-with-sqlite-3.8.4.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-# HG changeset patch
-# User Benjamin Peterson <benjamin(a)python.org>
-# Date 1394679112 18000
-# Node ID 1763e27a182d571cc3a428c71085bb86b3d895b5
-# Parent 1d31060f8a5c9695f0b79a738d355d8530e09cc7
-weaken callback count inequality (closes #20901)
-
-diff --git a/Lib/sqlite3/test/hooks.py b/Lib/sqlite3/test/hooks.py
---- a/Lib/sqlite3/test/hooks.py
-+++ b/Lib/sqlite3/test/hooks.py
-@@ -162,7 +162,7 @@ class ProgressTests(unittest.TestCase):
- create table bar (a, b)
- """)
- second_count = len(progress_calls)
-- self.assertTrue(first_count > second_count)
-+ self.assertGreaterEqual(first_count, second_count)
-
- def CheckCancelOperation(self):
- """
diff --git a/00195-enable-sslv23-in-ssl.patch b/00195-enable-sslv23-in-ssl.patch
deleted file mode 100644
index fcce84a..0000000
--- a/00195-enable-sslv23-in-ssl.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff -up Python-2.7.8/Modules/_ssl.c.orig Python-2.7.8/Modules/_ssl.c
---- Python-2.7.8/Modules/_ssl.c.orig 2014-07-17 14:17:32.584362667 +0200
-+++ Python-2.7.8/Modules/_ssl.c 2014-07-17 14:17:38.215405930 +0200
-@@ -312,8 +312,10 @@ newPySSLObject(PySocketSockObject *Sock,
- else if (proto_version == PY_SSL_VERSION_SSL2)
- self->ctx = SSL_CTX_new(SSLv2_method()); /* Set up context */
- #endif
-- else if (proto_version == PY_SSL_VERSION_SSL23)
-+ else if (proto_version == PY_SSL_VERSION_SSL23) {
- self->ctx = SSL_CTX_new(SSLv23_method()); /* Set up context */
-+ self->ctx->options &= ~(SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3);
-+ }
- PySSL_END_ALLOW_THREADS
-
- if (self->ctx == NULL) {
diff --git a/fix-dbm_contains-on-64bit-bigendian.patch
b/fix-dbm_contains-on-64bit-bigendian.patch
deleted file mode 100644
index e9ed979..0000000
--- a/fix-dbm_contains-on-64bit-bigendian.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-Index: Modules/dbmmodule.c
-===================================================================
---- Modules/dbmmodule.c (revision 84317)
-+++ Modules/dbmmodule.c (working copy)
-@@ -168,12 +168,18 @@
- dbm_contains(register dbmobject *dp, PyObject *v)
- {
- datum key, val;
-+ Py_ssize_t dsize;
-
-- if (PyString_AsStringAndSize(v, (char **)&key.dptr,
-- (Py_ssize_t *)&key.dsize)) {
-+ if (PyString_AsStringAndSize(v, (char **)&key.dptr, &dsize)) {
- return -1;
- }
-
-+ /* Coerce from Py_ssize_t down to int: */
-+ if (dsize > INT_MAX) {
-+ return -1;
-+ }
-+ key.dsize = dsize;
-+
- /* Expand check_dbmobject_open to return -1 */
- if (dp->di_dbm == NULL) {
- PyErr_SetString(DbmError, "DBM object has already been closed");
diff --git a/fix-test_commands-expected-ls-output-issue7108.patch
b/fix-test_commands-expected-ls-output-issue7108.patch
deleted file mode 100644
index e270ec5..0000000
--- a/fix-test_commands-expected-ls-output-issue7108.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -up Python-2.7/Lib/test/test_commands.py.gnu-ls-output
Python-2.7/Lib/test/test_commands.py
---- Python-2.7/Lib/test/test_commands.py.gnu-ls-output 2010-08-17 11:31:35.714913918
-0400
-+++ Python-2.7/Lib/test/test_commands.py 2010-08-17 11:37:08.913911808 -0400
-@@ -50,7 +50,7 @@ class CommandTests(unittest.TestCase):
- # Note that the first case above has a space in the group name
- # while the second one has a space in both names.
- pat = r'''d......... # It is a directory.
-- \+? # It may have ACLs.
-+ [.+@]? # It may have alt access (SELinux, ACLs or metadata
('@' OS X).
- \s+\d+ # It has some number of links.
- [^/]* # Skip user, group, size, and date.
- /\. # and end with the name of the file.
diff --git a/fix-test_structmember-on-64bit-bigendian.patch
b/fix-test_structmember-on-64bit-bigendian.patch
deleted file mode 100644
index a91b6db..0000000
--- a/fix-test_structmember-on-64bit-bigendian.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -up Python-2.7.3/Modules/_testcapimodule.c.fix-test_structmember-on-64bit-bigendian
Python-2.7.3/Modules/_testcapimodule.c
----
Python-2.7.3/Modules/_testcapimodule.c.fix-test_structmember-on-64bit-bigendian 2012-04-09
19:07:33.000000000 -0400
-+++ Python-2.7.3/Modules/_testcapimodule.c 2012-04-12 17:42:55.725766488 -0400
-@@ -1813,7 +1813,7 @@ test_structmembers_new(PyTypeObject *typ
- ;
- test_structmembers *ob;
- const char *s = NULL;
-- Py_ssize_t string_len = 0;
-+ int string_len = 0;
- ob = PyObject_New(test_structmembers, type);
- if (ob == NULL)
- return NULL;
diff --git a/python-2.6-distutils_rpm.patch b/python-2.6-distutils_rpm.patch
deleted file mode 100644
index 296bdaf..0000000
--- a/python-2.6-distutils_rpm.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -ru Python-2.6-orig/Lib/distutils/command/bdist_rpm.py
Python-2.6/Lib/distutils/command/bdist_rpm.py
---- Python-2.6-orig/Lib/distutils/command/bdist_rpm.py 2008-02-23 12:40:11.000000000
-0500
-+++ Python-2.6/Lib/distutils/command/bdist_rpm.py 2009-01-06 15:02:18.000000000 -0500
-@@ -493,6 +493,7 @@
- ('build', 'build_script', def_build),
- ('install', 'install_script',
- ("%s install "
-+ "-O1 "
- "--root=$RPM_BUILD_ROOT "
- "--record=INSTALLED_FILES") % def_setup_call),
- ('clean', 'clean_script', "rm -rf
$RPM_BUILD_ROOT"),
-Only in Python-2.6/Lib/distutils/command: bdist_rpm.py~
diff --git a/python-2.6-update-bsddb3-4.8.patch b/python-2.6-update-bsddb3-4.8.patch
deleted file mode 100644
index 4f25058..0000000
--- a/python-2.6-update-bsddb3-4.8.patch
+++ /dev/null
@@ -1,3446 +0,0 @@
-diff -Nupr Python-2.6.4.orig/Lib/bsddb/dbobj.py Python-2.6.4/Lib/bsddb/dbobj.py
---- Python-2.6.4.orig/Lib/bsddb/dbobj.py 2008-07-23 07:38:42.000000000 -0400
-+++ Python-2.6.4/Lib/bsddb/dbobj.py 2009-12-04 07:36:00.000000000 -0500
-@@ -110,15 +110,17 @@ class DBEnv:
- def log_stat(self, *args, **kwargs):
- return apply(self._cobj.log_stat, args, kwargs)
-
-- if db.version() >= (4,1):
-- def dbremove(self, *args, **kwargs):
-- return apply(self._cobj.dbremove, args, kwargs)
-- def dbrename(self, *args, **kwargs):
-- return apply(self._cobj.dbrename, args, kwargs)
-- def set_encrypt(self, *args, **kwargs):
-- return apply(self._cobj.set_encrypt, args, kwargs)
-+ def dbremove(self, *args, **kwargs):
-+ return apply(self._cobj.dbremove, args, kwargs)
-+ def dbrename(self, *args, **kwargs):
-+ return apply(self._cobj.dbrename, args, kwargs)
-+ def set_encrypt(self, *args, **kwargs):
-+ return apply(self._cobj.set_encrypt, args, kwargs)
-
- if db.version() >= (4,4):
-+ def fileid_reset(self, *args, **kwargs):
-+ return self._cobj.fileid_reset(*args, **kwargs)
-+
- def lsn_reset(self, *args, **kwargs):
- return apply(self._cobj.lsn_reset, args, kwargs)
-
-@@ -229,9 +231,8 @@ class DB(MutableMapping):
- def set_get_returns_none(self, *args, **kwargs):
- return apply(self._cobj.set_get_returns_none, args, kwargs)
-
-- if db.version() >= (4,1):
-- def set_encrypt(self, *args, **kwargs):
-- return apply(self._cobj.set_encrypt, args, kwargs)
-+ def set_encrypt(self, *args, **kwargs):
-+ return apply(self._cobj.set_encrypt, args, kwargs)
-
-
- class DBSequence:
-diff -Nupr Python-2.6.4.orig/Lib/bsddb/dbtables.py Python-2.6.4/Lib/bsddb/dbtables.py
---- Python-2.6.4.orig/Lib/bsddb/dbtables.py 2008-08-31 10:00:51.000000000 -0400
-+++ Python-2.6.4/Lib/bsddb/dbtables.py 2009-12-04 07:36:00.000000000 -0500
-@@ -15,7 +15,7 @@
- # This provides a simple database table interface built on top of
- # the Python Berkeley DB 3 interface.
- #
--_cvsid = '$Id: dbtables.py 66088 2008-08-31 14:00:51Z jesus.cea $'
-+_cvsid = '$Id: dbtables.py 58758 2007-11-01 21:15:36Z gregory.p.smith $'
-
- import re
- import sys
-@@ -659,6 +659,13 @@ class bsdTableDB :
- a = atuple[1]
- b = btuple[1]
- if type(a) is type(b):
-+
-+ # Needed for python 3. "cmp" vanished in 3.0.1
-+ def cmp(a, b) :
-+ if a==b : return 0
-+ if a<b : return -1
-+ return 1
-+
- if isinstance(a, PrefixCond) and isinstance(b, PrefixCond):
- # longest prefix first
- return cmp(len(b.prefix), len(a.prefix))
-diff -Nupr Python-2.6.4.orig/Lib/bsddb/dbutils.py Python-2.6.4/Lib/bsddb/dbutils.py
---- Python-2.6.4.orig/Lib/bsddb/dbutils.py 2008-08-31 10:00:51.000000000 -0400
-+++ Python-2.6.4/Lib/bsddb/dbutils.py 2009-12-04 07:36:00.000000000 -0500
-@@ -61,7 +61,7 @@ def DeadlockWrap(function, *_args, **_kw
- """
- sleeptime = _deadlock_MinSleepTime
- max_retries = _kwargs.get('max_retries', -1)
-- if _kwargs.has_key('max_retries'):
-+ if 'max_retries' in _kwargs:
- del _kwargs['max_retries']
- while True:
- try:
-diff -Nupr Python-2.6.4.orig/Lib/bsddb/__init__.py Python-2.6.4/Lib/bsddb/__init__.py
---- Python-2.6.4.orig/Lib/bsddb/__init__.py 2008-09-05 14:33:51.000000000 -0400
-+++ Python-2.6.4/Lib/bsddb/__init__.py 2009-12-04 07:36:00.000000000 -0500
-@@ -33,7 +33,7 @@
- #----------------------------------------------------------------------
-
-
--"""Support for Berkeley DB 4.0 through 4.7 with a simple interface.
-+"""Support for Berkeley DB 4.1 through 4.8 with a simple interface.
-
- For the full featured object oriented interface use the bsddb.db module
- instead. It mirrors the Oracle Berkeley DB C API.
-@@ -42,12 +42,6 @@ instead. It mirrors the Oracle Berkeley
- import sys
- absolute_import = (sys.version_info[0] >= 3)
-
--if sys.py3kwarning:
-- import warnings
-- warnings.warnpy3k("in 3.x, bsddb has been removed; "
-- "please use the pybsddb project instead",
-- DeprecationWarning, 2)
--
- try:
- if __name__ == 'bsddb3':
- # import _pybsddb binary as it should be the more recent version from
-@@ -442,8 +436,10 @@ def _checkflag(flag, file):
- # Berkeley DB was too.
-
- try:
-- import thread
-- del thread
-+ # 2to3 automatically changes "import thread" to "import
_thread"
-+ import thread as T
-+ del T
-+
- except ImportError:
- db.DB_THREAD = 0
-
-diff -Nupr Python-2.6.4.orig/Lib/bsddb/test/test_all.py
Python-2.6.4/Lib/bsddb/test/test_all.py
---- Python-2.6.4.orig/Lib/bsddb/test/test_all.py 2008-09-03 18:07:11.000000000 -0400
-+++ Python-2.6.4/Lib/bsddb/test/test_all.py 2009-12-04 07:36:00.000000000 -0500
-@@ -203,6 +203,16 @@ if sys.version_info[0] >= 3 :
- k = bytes(k, charset)
- return self._db.has_key(k, txn=txn)
-
-+ def set_re_delim(self, c) :
-+ if isinstance(c, str) : # We can use a numeric value byte too
-+ c = bytes(c, charset)
-+ return self._db.set_re_delim(c)
-+
-+ def set_re_pad(self, c) :
-+ if isinstance(c, str) : # We can use a numeric value byte too
-+ c = bytes(c, charset)
-+ return self._db.set_re_pad(c)
-+
- def put(self, key, value, txn=None, flags=0, dlen=-1, doff=-1) :
- if isinstance(key, str) :
- key = bytes(key, charset)
-@@ -221,6 +231,11 @@ if sys.version_info[0] >= 3 :
- key = bytes(key, charset)
- return self._db.get_size(key)
-
-+ def exists(self, key, *args, **kwargs) :
-+ if isinstance(key, str) :
-+ key = bytes(key, charset)
-+ return self._db.exists(key, *args, **kwargs)
-+
- def get(self, key, default="MagicCookie", txn=None, flags=0, dlen=-1,
doff=-1) :
- if isinstance(key, str) :
- key = bytes(key, charset)
-@@ -288,13 +303,21 @@ if sys.version_info[0] >= 3 :
- key = key.decode(charset)
- data = data.decode(charset)
- key = self._callback(key, data)
-- if (key != bsddb._db.DB_DONOTINDEX) and isinstance(key,
-- str) :
-- key = bytes(key, charset)
-+ if (key != bsddb._db.DB_DONOTINDEX) :
-+ if isinstance(key, str) :
-+ key = bytes(key, charset)
-+ elif isinstance(key, list) :
-+ key2 = []
-+ for i in key :
-+ if isinstance(i, str) :
-+ i = bytes(i, charset)
-+ key2.append(i)
-+ key = key2
- return key
-
- return self._db.associate(secondarydb._db,
-- associate_callback(callback).callback, flags=flags, txn=txn)
-+ associate_callback(callback).callback, flags=flags,
-+ txn=txn)
-
- def cursor(self, txn=None, flags=0) :
- return cursor_py3k(self._db, txn=txn, flags=flags)
-@@ -310,6 +333,12 @@ if sys.version_info[0] >= 3 :
- def __getattr__(self, v) :
- return getattr(self._dbenv, v)
-
-+ def get_data_dirs(self) :
-+ # Have to use a list comprehension and not
-+ # generators, because we are supporting Python 2.3.
-+ return tuple(
-+ [i.decode(charset) for i in self._dbenv.get_data_dirs()])
-+
- class DBSequence_py3k(object) :
- def __init__(self, db, *args, **kwargs) :
- self._db=db
-@@ -332,7 +361,10 @@ if sys.version_info[0] >= 3 :
-
- bsddb._db.DBEnv_orig = bsddb._db.DBEnv
- bsddb._db.DB_orig = bsddb._db.DB
-- bsddb._db.DBSequence_orig = bsddb._db.DBSequence
-+ if bsddb.db.version() <= (4, 3) :
-+ bsddb._db.DBSequence_orig = None
-+ else :
-+ bsddb._db.DBSequence_orig = bsddb._db.DBSequence
-
- def do_proxy_db_py3k(flag) :
- flag2 = do_proxy_db_py3k.flag
-@@ -481,6 +513,7 @@ def suite(module_prefix='', timing_check
- test_modules = [
- 'test_associate',
- 'test_basics',
-+ 'test_dbenv',
- 'test_compare',
- 'test_compat',
- 'test_cursor_pget_bug',
-@@ -489,6 +522,7 @@ def suite(module_prefix='', timing_check
- 'test_dbtables',
- 'test_distributed_transactions',
- 'test_early_close',
-+ 'test_fileid',
- 'test_get_none',
- 'test_join',
- 'test_lock',
-diff -Nupr Python-2.6.4.orig/Lib/bsddb/test/test_associate.py
Python-2.6.4/Lib/bsddb/test/test_associate.py
---- Python-2.6.4.orig/Lib/bsddb/test/test_associate.py 2008-08-31 10:00:51.000000000
-0400
-+++ Python-2.6.4/Lib/bsddb/test/test_associate.py 2009-12-04 07:36:00.000000000 -0500
-@@ -148,12 +148,8 @@ class AssociateTestCase(unittest.TestCas
- self.secDB = None
- self.primary = db.DB(self.env)
- self.primary.set_get_returns_none(2)
-- if db.version() >= (4, 1):
-- self.primary.open(self.filename, "primary", self.dbtype,
-- db.DB_CREATE | db.DB_THREAD | self.dbFlags, txn=txn)
-- else:
-- self.primary.open(self.filename, "primary", self.dbtype,
-- db.DB_CREATE | db.DB_THREAD | self.dbFlags)
-+ self.primary.open(self.filename, "primary", self.dbtype,
-+ db.DB_CREATE | db.DB_THREAD | self.dbFlags, txn=txn)
-
- def closeDB(self):
- if self.cur:
-@@ -169,12 +165,7 @@ class AssociateTestCase(unittest.TestCas
- return self.primary
-
-
-- def test01_associateWithDB(self):
-- if verbose:
-- print '\n', '-=' * 30
-- print "Running %s.test01_associateWithDB..." % \
-- self.__class__.__name__
--
-+ def _associateWithDB(self, getGenre):
- self.createDB()
-
- self.secDB = db.DB(self.env)
-@@ -182,19 +173,21 @@ class AssociateTestCase(unittest.TestCas
- self.secDB.set_get_returns_none(2)
- self.secDB.open(self.filename, "secondary", db.DB_BTREE,
- db.DB_CREATE | db.DB_THREAD | self.dbFlags)
-- self.getDB().associate(self.secDB, self.getGenre)
-+ self.getDB().associate(self.secDB, getGenre)
-
- self.addDataToDB(self.getDB())
-
- self.finish_test(self.secDB)
-
--
-- def test02_associateAfterDB(self):
-+ def test01_associateWithDB(self):
- if verbose:
- print '\n', '-=' * 30
-- print "Running %s.test02_associateAfterDB..." % \
-+ print "Running %s.test01_associateWithDB..." % \
- self.__class__.__name__
-
-+ return self._associateWithDB(self.getGenre)
-+
-+ def _associateAfterDB(self, getGenre) :
- self.createDB()
- self.addDataToDB(self.getDB())
-
-@@ -204,10 +197,35 @@ class AssociateTestCase(unittest.TestCas
- db.DB_CREATE | db.DB_THREAD | self.dbFlags)
-
- # adding the DB_CREATE flag will cause it to index existing records
-- self.getDB().associate(self.secDB, self.getGenre, db.DB_CREATE)
-+ self.getDB().associate(self.secDB, getGenre, db.DB_CREATE)
-
- self.finish_test(self.secDB)
-
-+ def test02_associateAfterDB(self):
-+ if verbose:
-+ print '\n', '-=' * 30
-+ print "Running %s.test02_associateAfterDB..." % \
-+ self.__class__.__name__
-+
-+ return self._associateAfterDB(self.getGenre)
-+
-+ if db.version() >= (4, 6):
-+ def test03_associateWithDB(self):
-+ if verbose:
-+ print '\n', '-=' * 30
-+ print "Running %s.test03_associateWithDB..." % \
-+ self.__class__.__name__
-+
-+ return self._associateWithDB(self.getGenreList)
-+
-+ def test04_associateAfterDB(self):
-+ if verbose:
-+ print '\n', '-=' * 30
-+ print "Running %s.test04_associateAfterDB..." % \
-+ self.__class__.__name__
-+
-+ return self._associateAfterDB(self.getGenreList)
-+
-
- def finish_test(self, secDB, txn=None):
- # 'Blues' should not be in the secondary database
-@@ -277,6 +295,12 @@ class AssociateTestCase(unittest.TestCas
- else:
- return genre
-
-+ def getGenreList(self, priKey, PriData) :
-+ v = self.getGenre(priKey, PriData)
-+ if type(v) == type("") :
-+ v = [v]
-+ return v
-+
-
- #----------------------------------------------------------------------
-
-@@ -322,10 +346,7 @@ class AssociateBTreeTxnTestCase(Associat
- self.secDB.set_get_returns_none(2)
- self.secDB.open(self.filename, "secondary", db.DB_BTREE,
- db.DB_CREATE | db.DB_THREAD, txn=txn)
-- if db.version() >= (4,1):
-- self.getDB().associate(self.secDB, self.getGenre, txn=txn)
-- else:
-- self.getDB().associate(self.secDB, self.getGenre)
-+ self.getDB().associate(self.secDB, self.getGenre, txn=txn)
-
- self.addDataToDB(self.getDB(), txn=txn)
- except:
-@@ -426,8 +447,7 @@ def test_suite():
- suite.addTest(unittest.makeSuite(AssociateBTreeTestCase))
- suite.addTest(unittest.makeSuite(AssociateRecnoTestCase))
-
-- if db.version() >= (4, 1):
-- suite.addTest(unittest.makeSuite(AssociateBTreeTxnTestCase))
-+ suite.addTest(unittest.makeSuite(AssociateBTreeTxnTestCase))
-
- suite.addTest(unittest.makeSuite(ShelveAssociateHashTestCase))
- suite.addTest(unittest.makeSuite(ShelveAssociateBTreeTestCase))
-diff -Nupr Python-2.6.4.orig/Lib/bsddb/test/test_basics.py
Python-2.6.4/Lib/bsddb/test/test_basics.py
---- Python-2.6.4.orig/Lib/bsddb/test/test_basics.py 2009-07-02 11:37:21.000000000 -0400
-+++ Python-2.6.4/Lib/bsddb/test/test_basics.py 2009-12-04 07:36:00.000000000 -0500
-@@ -33,6 +33,7 @@ class VersionTestCase(unittest.TestCase)
-
- class BasicTestCase(unittest.TestCase):
- dbtype = db.DB_UNKNOWN # must be set in derived class
-+ cachesize = (0, 1024*1024, 1)
- dbopenflags = 0
- dbsetflags = 0
- dbmode = 0660
-@@ -43,6 +44,13 @@ class BasicTestCase(unittest.TestCase):
-
- _numKeys = 1002 # PRIVATE. NOTE: must be an even value
-
-+ import sys
-+ if sys.version_info[:3] < (2, 4, 0):
-+ def assertTrue(self, expr, msg=None):
-+ self.failUnless(expr,msg=msg)
-+ def assertFalse(self, expr, msg=None):
-+ self.failIf(expr,msg=msg)
-+
- def setUp(self):
- if self.useEnv:
- self.homeDir=get_new_environment_path()
-@@ -50,7 +58,8 @@ class BasicTestCase(unittest.TestCase):
- self.env = db.DBEnv()
- self.env.set_lg_max(1024*1024)
- self.env.set_tx_max(30)
-- self.env.set_tx_timestamp(int(time.time()))
-+ self._t = int(time.time())
-+ self.env.set_tx_timestamp(self._t)
- self.env.set_flags(self.envsetflags, 1)
- self.env.open(self.homeDir, self.envflags | db.DB_CREATE)
- self.filename = "test"
-@@ -64,6 +73,15 @@ class BasicTestCase(unittest.TestCase):
-
- # create and open the DB
- self.d = db.DB(self.env)
-+ if not self.useEnv :
-+ if db.version() >= (4, 2) :
-+ self.d.set_cachesize(*self.cachesize)
-+ cachesize = self.d.get_cachesize()
-+ self.assertEqual(cachesize[0], self.cachesize[0])
-+ self.assertEqual(cachesize[2], self.cachesize[2])
-+ # Berkeley DB expands the cache 25% accounting overhead,
-+ # if the cache is small.
-+ self.assertEqual(125, int(100.0*cachesize[1]/self.cachesize[1]))
- self.d.set_flags(self.dbsetflags)
- if self.dbname:
- self.d.open(self.filename, self.dbname, self.dbtype,
-@@ -74,6 +92,10 @@ class BasicTestCase(unittest.TestCase):
- dbtype = self.dbtype,
- flags = self.dbopenflags|db.DB_CREATE)
-
-+ if not self.useEnv:
-+ self.assertRaises(db.DBInvalidArgError,
-+ self.d.set_cachesize, *self.cachesize)
-+
- self.populateDB()
-
-
-@@ -131,7 +153,7 @@ class BasicTestCase(unittest.TestCase):
-
- self.assertEqual(d.get('0321'), '0321-0321-0321-0321-0321')
-
-- # By default non-existent keys return None...
-+ # By default non-existant keys return None...
- self.assertEqual(d.get('abcd'), None)
-
- # ...but they raise exceptions in other situations. Call
-@@ -276,6 +298,21 @@ class BasicTestCase(unittest.TestCase):
- pprint(values[:10])
-
-
-+ #----------------------------------------
-+
-+ def test02b_SequenceMethods(self):
-+ d = self.d
-+
-+ for key in ['0002', '0101', '0401', '0701',
'0998']:
-+ data = d[key]
-+ self.assertEqual(data, self.makeData(key))
-+ if verbose:
-+ print data
-+
-+ self.assertTrue(hasattr(d, "__contains__"))
-+ self.assertTrue("0401" in d)
-+ self.assertFalse("1234" in d)
-+
-
- #----------------------------------------
-
-@@ -509,6 +546,15 @@ class BasicTestCase(unittest.TestCase):
- self.assertEqual(old, 1)
- self.test03_SimpleCursorStuff(get_raises_error=0, set_raises_error=0)
-
-+ if db.version() >= (4, 6):
-+ def test03d_SimpleCursorPriority(self) :
-+ c = self.d.cursor()
-+ c.set_priority(db.DB_PRIORITY_VERY_LOW) # Positional
-+ self.assertEqual(db.DB_PRIORITY_VERY_LOW, c.get_priority())
-+ c.set_priority(priority=db.DB_PRIORITY_HIGH) # Keyword
-+ self.assertEqual(db.DB_PRIORITY_HIGH, c.get_priority())
-+ c.close()
-+
- #----------------------------------------
-
- def test04_PartialGetAndPut(self):
-@@ -562,7 +608,7 @@ class BasicTestCase(unittest.TestCase):
- d = self.d
- if verbose:
- print '\n', '-=' * 30
-- print "Running %s.test99_Truncate..." % self.__class__.__name__
-+ print "Running %s.test06_Truncate..." % self.__class__.__name__
-
- d.put("abcde", "ABCDE");
- num = d.truncate()
-@@ -582,6 +628,33 @@ class BasicTestCase(unittest.TestCase):
-
- #----------------------------------------
-
-+ if db.version() >= (4, 6):
-+ def test08_exists(self) :
-+ self.d.put("abcde", "ABCDE")
-+ self.assert_(self.d.exists("abcde") == True,
-+ "DB->exists() returns wrong value")
-+ self.assert_(self.d.exists("x") == False,
-+ "DB->exists() returns wrong value")
-+
-+ #----------------------------------------
-+
-+ if db.version() >= (4, 7):
-+ def test_compact(self) :
-+ d = self.d
-+ self.assertEqual(0, d.compact(flags=db.DB_FREELIST_ONLY))
-+ self.assertEqual(0, d.compact(flags=db.DB_FREELIST_ONLY))
-+ d.put("abcde", "ABCDE");
-+ d.put("bcde", "BCDE");
-+ d.put("abc", "ABC");
-+ d.put("monty", "python");
-+ d.delete("abc")
-+ d.delete("bcde")
-+ d.compact(start='abcde', stop='monty', txn=None,
-+ compact_fillpercent=42, compact_pages=1,
-+ compact_timeout=50000000,
-+ flags=db.DB_FREELIST_ONLY|db.DB_FREE_SPACE)
-+
-+ #----------------------------------------
-
- #----------------------------------------------------------------------
-
-@@ -611,13 +684,13 @@ class BasicWithEnvTestCase(BasicTestCase
-
- #----------------------------------------
-
-- def test08_EnvRemoveAndRename(self):
-+ def test09_EnvRemoveAndRename(self):
- if not self.env:
- return
-
- if verbose:
- print '\n', '-=' * 30
-- print "Running %s.test08_EnvRemoveAndRename..." %
self.__class__.__name__
-+ print "Running %s.test09_EnvRemoveAndRename..." %
self.__class__.__name__
-
- # can't rename or remove an open DB
- self.d.close()
-@@ -626,10 +699,6 @@ class BasicWithEnvTestCase(BasicTestCase
- self.env.dbrename(self.filename, None, newname)
- self.env.dbremove(newname)
-
-- # dbremove and dbrename are in 4.1 and later
-- if db.version() < (4,1):
-- del test08_EnvRemoveAndRename
--
- #----------------------------------------
-
- class BasicBTreeWithEnvTestCase(BasicWithEnvTestCase):
-@@ -729,11 +798,25 @@ class BasicTransactionTestCase(BasicTest
-
- #----------------------------------------
-
-- def test08_TxnTruncate(self):
-+ if db.version() >= (4, 6):
-+ def test08_exists(self) :
-+ txn = self.env.txn_begin()
-+ self.d.put("abcde", "ABCDE", txn=txn)
-+ txn.commit()
-+ txn = self.env.txn_begin()
-+ self.assert_(self.d.exists("abcde", txn=txn) == True,
-+ "DB->exists() returns wrong value")
-+ self.assert_(self.d.exists("x", txn=txn) == False,
-+ "DB->exists() returns wrong value")
-+ txn.abort()
-+
-+ #----------------------------------------
-+
-+ def test09_TxnTruncate(self):
- d = self.d
- if verbose:
- print '\n', '-=' * 30
-- print "Running %s.test08_TxnTruncate..." %
self.__class__.__name__
-+ print "Running %s.test09_TxnTruncate..." %
self.__class__.__name__
-
- d.put("abcde", "ABCDE");
- txn = self.env.txn_begin()
-@@ -746,7 +829,7 @@ class BasicTransactionTestCase(BasicTest
-
- #----------------------------------------
-
-- def test09_TxnLateUse(self):
-+ def test10_TxnLateUse(self):
- txn = self.env.txn_begin()
- txn.abort()
- try:
-@@ -766,6 +849,39 @@ class BasicTransactionTestCase(BasicTest
- raise RuntimeError, "DBTxn.commit() called after DB_TXN no longer valid
w/o an exception"
-
-
-+ #----------------------------------------
-+
-+
-+ if db.version() >= (4, 4):
-+ def test_txn_name(self) :
-+ txn=self.env.txn_begin()
-+ self.assertEqual(txn.get_name(), "")
-+ txn.set_name("XXYY")
-+ self.assertEqual(txn.get_name(), "XXYY")
-+ txn.set_name("")
-+ self.assertEqual(txn.get_name(), "")
-+ txn.abort()
-+
-+ #----------------------------------------
-+
-+
-+ def test_txn_set_timeout(self) :
-+ txn=self.env.txn_begin()
-+ txn.set_timeout(1234567, db.DB_SET_LOCK_TIMEOUT)
-+ txn.set_timeout(2345678, flags=db.DB_SET_TXN_TIMEOUT)
-+ txn.abort()
-+
-+ #----------------------------------------
-+
-+ if db.version() >= (4, 2) :
-+ def test_get_tx_max(self) :
-+ self.assertEqual(self.env.get_tx_max(), 30)
-+
-+ def test_get_tx_timestamp(self) :
-+ self.assertEqual(self.env.get_tx_timestamp(), self._t)
-+
-+
-+
- class BTreeTransactionTestCase(BasicTransactionTestCase):
- dbtype = db.DB_BTREE
-
-@@ -780,11 +896,11 @@ class BTreeRecnoTestCase(BasicTestCase):
- dbtype = db.DB_BTREE
- dbsetflags = db.DB_RECNUM
-
-- def test08_RecnoInBTree(self):
-+ def test09_RecnoInBTree(self):
- d = self.d
- if verbose:
- print '\n', '-=' * 30
-- print "Running %s.test08_RecnoInBTree..." %
self.__class__.__name__
-+ print "Running %s.test09_RecnoInBTree..." %
self.__class__.__name__
-
- rec = d.get(200)
- self.assertEqual(type(rec), type(()))
-@@ -814,11 +930,11 @@ class BTreeRecnoWithThreadFlagTestCase(B
- class BasicDUPTestCase(BasicTestCase):
- dbsetflags = db.DB_DUP
-
-- def test09_DuplicateKeys(self):
-+ def test10_DuplicateKeys(self):
- d = self.d
- if verbose:
- print '\n', '-=' * 30
-- print "Running %s.test09_DuplicateKeys..." % \
-+ print "Running %s.test10_DuplicateKeys..." % \
- self.__class__.__name__
-
- d.put("dup0", "before")
-@@ -887,11 +1003,11 @@ class BasicMultiDBTestCase(BasicTestCase
- else:
- return db.DB_BTREE
-
-- def test10_MultiDB(self):
-+ def test11_MultiDB(self):
- d1 = self.d
- if verbose:
- print '\n', '-=' * 30
-- print "Running %s.test10_MultiDB..." % self.__class__.__name__
-+ print "Running %s.test11_MultiDB..." % self.__class__.__name__
-
- d2 = db.DB(self.env)
- d2.open(self.filename, "second", self.dbtype,
-@@ -1032,11 +1148,12 @@ class CrashAndBurn(unittest.TestCase) :
- # # See
http://bugs.python.org/issue3307
- # self.assertRaises(db.DBInvalidArgError, db.DB, None, 65535)
-
-- def test02_DBEnv_dealloc(self):
-- #
http://bugs.python.org/issue3885
-- import gc
-- self.assertRaises(db.DBInvalidArgError, db.DBEnv, ~db.DB_RPCCLIENT)
-- gc.collect()
-+ if db.version() < (4, 8) :
-+ def test02_DBEnv_dealloc(self):
-+ #
http://bugs.python.org/issue3885
-+ import gc
-+ self.assertRaises(db.DBInvalidArgError, db.DBEnv, ~db.DB_RPCCLIENT)
-+ gc.collect()
-
-
- #----------------------------------------------------------------------
-diff -Nupr Python-2.6.4.orig/Lib/bsddb/test/test_compare.py
Python-2.6.4/Lib/bsddb/test/test_compare.py
---- Python-2.6.4.orig/Lib/bsddb/test/test_compare.py 2008-08-31 10:00:51.000000000 -0400
-+++ Python-2.6.4/Lib/bsddb/test/test_compare.py 2009-12-04 07:36:00.000000000 -0500
-@@ -12,6 +12,12 @@ from test_all import db, dbshelve, test_
- get_new_environment_path, get_new_database_path
-
-
-+# Needed for python 3. "cmp" vanished in 3.0.1
-+def cmp(a, b) :
-+ if a==b : return 0
-+ if a<b : return -1
-+ return 1
-+
- lexical_cmp = cmp
-
- def lowercase_cmp(left, right):
-@@ -26,6 +32,10 @@ _expected_lexical_test_data = ['', 'CCCP
- _expected_lowercase_test_data = ['', 'a', 'aaa', 'b',
'c', 'CC', 'cccce', 'ccccf', 'CCCP']
-
- class ComparatorTests (unittest.TestCase):
-+ if sys.version_info[:3] < (2, 4, 0):
-+ def assertTrue(self, expr, msg=None):
-+ self.failUnless(expr,msg=msg)
-+
- def comparator_test_helper (self, comparator, expected_data):
- data = expected_data[:]
-
-@@ -47,7 +57,7 @@ class ComparatorTests (unittest.TestCase
- data2.append(i)
- data = data2
-
-- self.failUnless (data == expected_data,
-+ self.assertTrue (data == expected_data,
- "comparator `%s' is not right: %s vs. %s"
- % (comparator, expected_data, data))
- def test_lexical_comparator (self):
-@@ -65,6 +75,10 @@ class AbstractBtreeKeyCompareTestCase (u
- env = None
- db = None
-
-+ if sys.version_info[:3] < (2, 4, 0):
-+ def assertTrue(self, expr, msg=None):
-+ self.failUnless(expr,msg=msg)
-+
- def setUp (self):
- self.filename = self.__class__.__name__ + '.db'
- self.homeDir = get_new_environment_path()
-@@ -115,14 +129,14 @@ class AbstractBtreeKeyCompareTestCase (u
- rec = curs.first ()
- while rec:
- key, ignore = rec
-- self.failUnless (index < len (expected),
-+ self.assertTrue(index < len (expected),
- "to many values returned from cursor")
-- self.failUnless (expected[index] == key,
-+ self.assertTrue(expected[index] == key,
- "expected value `%s' at %d but got
`%s'"
- % (expected[index], index, key))
- index = index + 1
- rec = curs.next ()
-- self.failUnless (index == len (expected),
-+ self.assertTrue(index == len (expected),
- "not enough values returned from cursor")
- finally:
- curs.close ()
-diff -Nupr Python-2.6.4.orig/Lib/bsddb/test/test_compat.py
Python-2.6.4/Lib/bsddb/test/test_compat.py
---- Python-2.6.4.orig/Lib/bsddb/test/test_compat.py 2009-07-02 11:37:21.000000000 -0400
-+++ Python-2.6.4/Lib/bsddb/test/test_compat.py 2009-12-04 07:36:00.000000000 -0500
-@@ -133,7 +133,7 @@ class CompatibilityTestCase(unittest.Tes
- except KeyError:
- pass
- else:
-- self.fail("set_location on non-existent key did not raise
KeyError")
-+ self.fail("set_location on non-existant key did not raise
KeyError")
-
- f.sync()
- f.close()
-diff -Nupr Python-2.6.4.orig/Lib/bsddb/test/test_dbenv.py
Python-2.6.4/Lib/bsddb/test/test_dbenv.py
---- Python-2.6.4.orig/Lib/bsddb/test/test_dbenv.py 1969-12-31 19:00:00.000000000 -0500
-+++ Python-2.6.4/Lib/bsddb/test/test_dbenv.py 2009-12-04 07:36:00.000000000 -0500
-@@ -0,0 +1,148 @@
-+import unittest
-+import os, glob
-+
-+from test_all import db, test_support, get_new_environment_path, \
-+ get_new_database_path
-+
-+#----------------------------------------------------------------------
-+
-+class DBEnv(unittest.TestCase):
-+ def setUp(self):
-+ self.homeDir = get_new_environment_path()
-+ self.env = db.DBEnv()
-+
-+ def tearDown(self):
-+ del self.env
-+ test_support.rmtree(self.homeDir)
-+
-+ if db.version() >= (4, 2) :
-+ def test_setget_data_dirs(self) :
-+ dirs = ("a", "b", "c", "d")
-+ for i in dirs :
-+ self.env.set_data_dir(i)
-+ self.assertEqual(dirs, self.env.get_data_dirs())
-+
-+ def test_setget_cachesize(self) :
-+ cachesize = (0, 512*1024*1024, 3)
-+ self.env.set_cachesize(*cachesize)
-+ self.assertEqual(cachesize, self.env.get_cachesize())
-+
-+ cachesize = (0, 1*1024*1024, 5)
-+ self.env.set_cachesize(*cachesize)
-+ cachesize2 = self.env.get_cachesize()
-+ self.assertEqual(cachesize[0], cachesize2[0])
-+ self.assertEqual(cachesize[2], cachesize2[2])
-+ # Berkeley DB expands the cache 25% accounting overhead,
-+ # if the cache is small.
-+ self.assertEqual(125, int(100.0*cachesize2[1]/cachesize[1]))
-+
-+ # You can not change configuration after opening
-+ # the environment.
-+ self.env.open(self.homeDir, db.DB_CREATE | db.DB_INIT_MPOOL)
-+ cachesize = (0, 2*1024*1024, 1)
-+ self.assertRaises(db.DBInvalidArgError,
-+ self.env.set_cachesize, *cachesize)
-+ self.assertEqual(cachesize2, self.env.get_cachesize())
-+
-+ def test_set_cachesize_dbenv_db(self) :
-+ # You can not configure the cachesize using
-+ # the database handle, if you are using an environment.
-+ d = db.DB(self.env)
-+ self.assertRaises(db.DBInvalidArgError,
-+ d.set_cachesize, 0, 1024*1024, 1)
-+
-+ def test_setget_shm_key(self) :
-+ shm_key=137
-+ self.env.set_shm_key(shm_key)
-+ self.assertEqual(shm_key, self.env.get_shm_key())
-+ self.env.set_shm_key(shm_key+1)
-+ self.assertEqual(shm_key+1, self.env.get_shm_key())
-+
-+ # You can not change configuration after opening
-+ # the environment.
-+ self.env.open(self.homeDir, db.DB_CREATE | db.DB_INIT_MPOOL)
-+ # If we try to reconfigure cache after opening the
-+ # environment, core dump.
-+ self.assertRaises(db.DBInvalidArgError,
-+ self.env.set_shm_key, shm_key)
-+ self.assertEqual(shm_key+1, self.env.get_shm_key())
-+
-+ if db.version() >= (4, 4) :
-+ def test_mutex_setget_max(self) :
-+ v = self.env.mutex_get_max()
-+ v2 = v*2+1
-+
-+ self.env.mutex_set_max(v2)
-+ self.assertEqual(v2, self.env.mutex_get_max())
-+
-+ self.env.mutex_set_max(v)
-+ self.assertEqual(v, self.env.mutex_get_max())
-+
-+ # You can not change configuration after opening
-+ # the environment.
-+ self.env.open(self.homeDir, db.DB_CREATE)
-+ self.assertRaises(db.DBInvalidArgError,
-+ self.env.mutex_set_max, v2)
-+
-+ def test_mutex_setget_increment(self) :
-+ v = self.env.mutex_get_increment()
-+ v2 = 127
-+
-+ self.env.mutex_set_increment(v2)
-+ self.assertEqual(v2, self.env.mutex_get_increment())
-+
-+ self.env.mutex_set_increment(v)
-+ self.assertEqual(v, self.env.mutex_get_increment())
-+
-+ # You can not change configuration after opening
-+ # the environment.
-+ self.env.open(self.homeDir, db.DB_CREATE)
-+ self.assertRaises(db.DBInvalidArgError,
-+ self.env.mutex_set_increment, v2)
-+
-+ def test_mutex_setget_tas_spins(self) :
-+ self.env.mutex_set_tas_spins(0) # Default = BDB decides
-+ v = self.env.mutex_get_tas_spins()
-+ v2 = v*2+1
-+
-+ self.env.mutex_set_tas_spins(v2)
-+ self.assertEqual(v2, self.env.mutex_get_tas_spins())
-+
-+ self.env.mutex_set_tas_spins(v)
-+ self.assertEqual(v, self.env.mutex_get_tas_spins())
-+
-+ # In this case, you can change configuration
-+ # after opening the environment.
-+ self.env.open(self.homeDir, db.DB_CREATE)
-+ self.env.mutex_set_tas_spins(v2)
-+
-+ def test_mutex_setget_align(self) :
-+ v = self.env.mutex_get_align()
-+ v2 = 64
-+ if v == 64 :
-+ v2 = 128
-+
-+ self.env.mutex_set_align(v2)
-+ self.assertEqual(v2, self.env.mutex_get_align())
-+
-+ # Requires a nonzero power of two
-+ self.assertRaises(db.DBInvalidArgError,
-+ self.env.mutex_set_align, 0)
-+ self.assertRaises(db.DBInvalidArgError,
-+ self.env.mutex_set_align, 17)
-+
-+ self.env.mutex_set_align(2*v2)
-+ self.assertEqual(2*v2, self.env.mutex_get_align())
-+
-+ # You can not change configuration after opening
-+ # the environment.
-+ self.env.open(self.homeDir, db.DB_CREATE)
-+ self.assertRaises(db.DBInvalidArgError,
-+ self.env.mutex_set_align, v2)
-+
-+
-+def test_suite():
-+ return unittest.makeSuite(DBEnv)
-+
-+if __name__ == '__main__':
-+ unittest.main(defaultTest='test_suite')
-diff -Nupr Python-2.6.4.orig/Lib/bsddb/test/test_dbtables.py
Python-2.6.4/Lib/bsddb/test/test_dbtables.py
---- Python-2.6.4.orig/Lib/bsddb/test/test_dbtables.py 2008-08-31 10:00:51.000000000
-0400
-+++ Python-2.6.4/Lib/bsddb/test/test_dbtables.py 2009-12-04 07:36:00.000000000 -0500
-@@ -18,13 +18,17 @@
- #
- # -- Gregory P. Smith <greg(a)krypto.org>
- #
--# $Id: test_dbtables.py 66088 2008-08-31 14:00:51Z jesus.cea $
-+# $Id: test_dbtables.py 58532 2007-10-18 07:56:54Z gregory.p.smith $
-
--import os, re
--try:
-- import cPickle
-- pickle = cPickle
--except ImportError:
-+import os, re, sys
-+
-+if sys.version_info[0] < 3 :
-+ try:
-+ import cPickle
-+ pickle = cPickle
-+ except ImportError:
-+ import pickle
-+else :
- import pickle
-
- import unittest
-diff -Nupr Python-2.6.4.orig/Lib/bsddb/test/test_distributed_transactions.py
Python-2.6.4/Lib/bsddb/test/test_distributed_transactions.py
---- Python-2.6.4.orig/Lib/bsddb/test/test_distributed_transactions.py 2008-08-31
10:00:51.000000000 -0400
-+++ Python-2.6.4/Lib/bsddb/test/test_distributed_transactions.py 2009-12-04
07:36:00.000000000 -0500
-@@ -35,9 +35,9 @@ class DBTxn_distributed(unittest.TestCas
- db.DB_INIT_TXN | db.DB_INIT_LOG | db.DB_INIT_MPOOL |
- db.DB_INIT_LOCK, 0666)
- self.db = db.DB(self.dbenv)
-- self.db.set_re_len(db.DB_XIDDATASIZE)
-+ self.db.set_re_len(db.DB_GID_SIZE)
- if must_open_db :
-- if db.version() > (4,1) :
-+ if db.version() >= (4,2) :
- txn=self.dbenv.txn_begin()
- self.db.open(self.filename,
- db.DB_QUEUE, db.DB_CREATE | db.DB_THREAD, 0666,
-@@ -76,7 +76,7 @@ class DBTxn_distributed(unittest.TestCas
- # let them be garbage collected.
- for i in xrange(self.num_txns) :
- txn = self.dbenv.txn_begin()
-- gid = "%%%dd" %db.DB_XIDDATASIZE
-+ gid = "%%%dd" %db.DB_GID_SIZE
- gid = adapt(gid %i)
- self.db.put(i, gid, txn=txn, flags=db.DB_APPEND)
- txns.add(gid)
-diff -Nupr Python-2.6.4.orig/Lib/bsddb/test/test_early_close.py
Python-2.6.4/Lib/bsddb/test/test_early_close.py
---- Python-2.6.4.orig/Lib/bsddb/test/test_early_close.py 2008-09-08 20:49:16.000000000
-0400
-+++ Python-2.6.4/Lib/bsddb/test/test_early_close.py 2009-12-04 07:36:00.000000000 -0500
-@@ -155,11 +155,8 @@ class DBEnvClosedEarlyCrash(unittest.Tes
- db.DB_INIT_LOG | db.DB_CREATE)
- d = db.DB(dbenv)
- txn = dbenv.txn_begin()
-- if db.version() < (4,1) :
-- d.open(self.filename, dbtype = db.DB_HASH, flags = db.DB_CREATE)
-- else :
-- d.open(self.filename, dbtype = db.DB_HASH, flags = db.DB_CREATE,
-- txn=txn)
-+ d.open(self.filename, dbtype = db.DB_HASH, flags = db.DB_CREATE,
-+ txn=txn)
- d.put("XXX", "yyy", txn=txn)
- txn.commit()
- txn = dbenv.txn_begin()
-@@ -168,9 +165,9 @@ class DBEnvClosedEarlyCrash(unittest.Tes
- self.assertEquals(("XXX", "yyy"), c1.first())
- import warnings
- # Not interested in warnings about implicit close.
-- with warnings.catch_warnings():
-- warnings.simplefilter("ignore")
-- txn.commit()
-+ warnings.simplefilter("ignore")
-+ txn.commit()
-+ warnings.resetwarnings()
- self.assertRaises(db.DBCursorClosedError, c2.first)
-
- if db.version() > (4,3,0) :
-diff -Nupr Python-2.6.4.orig/Lib/bsddb/test/test_fileid.py
Python-2.6.4/Lib/bsddb/test/test_fileid.py
---- Python-2.6.4.orig/Lib/bsddb/test/test_fileid.py 1969-12-31 19:00:00.000000000 -0500
-+++ Python-2.6.4/Lib/bsddb/test/test_fileid.py 2009-12-04 07:36:00.000000000 -0500
-@@ -0,0 +1,63 @@
-+"""TestCase for reseting File ID.
-+"""
-+
-+import os
-+import shutil
-+import unittest
-+
-+from test_all import db, test_support, get_new_environment_path, get_new_database_path
-+
-+class FileidResetTestCase(unittest.TestCase):
-+ def setUp(self):
-+ self.db_path_1 = get_new_database_path()
-+ self.db_path_2 = get_new_database_path()
-+ self.db_env_path = get_new_environment_path()
-+
-+ def test_fileid_reset(self):
-+ # create DB 1
-+ self.db1 = db.DB()
-+ self.db1.open(self.db_path_1, dbtype=db.DB_HASH,
flags=(db.DB_CREATE|db.DB_EXCL))
-+ self.db1.put('spam', 'eggs')
-+ self.db1.close()
-+
-+ shutil.copy(self.db_path_1, self.db_path_2)
-+
-+ self.db2 = db.DB()
-+ self.db2.open(self.db_path_2, dbtype=db.DB_HASH)
-+ self.db2.put('spam', 'spam')
-+ self.db2.close()
-+
-+ self.db_env = db.DBEnv()
-+ self.db_env.open(self.db_env_path, db.DB_CREATE|db.DB_INIT_MPOOL)
-+
-+ # use fileid_reset() here
-+ self.db_env.fileid_reset(self.db_path_2)
-+
-+ self.db1 = db.DB(self.db_env)
-+ self.db1.open(self.db_path_1, dbtype=db.DB_HASH, flags=db.DB_RDONLY)
-+ self.assertEquals(self.db1.get('spam'), 'eggs')
-+
-+ self.db2 = db.DB(self.db_env)
-+ self.db2.open(self.db_path_2, dbtype=db.DB_HASH, flags=db.DB_RDONLY)
-+ self.assertEquals(self.db2.get('spam'), 'spam')
-+
-+ self.db1.close()
-+ self.db2.close()
-+
-+ self.db_env.close()
-+
-+ def tearDown(self):
-+ test_support.unlink(self.db_path_1)
-+ test_support.unlink(self.db_path_2)
-+ test_support.rmtree(self.db_env_path)
-+
-+def test_suite():
-+ suite = unittest.TestSuite()
-+ if db.version() >= (4, 4):
-+ suite.addTest(unittest.makeSuite(FileidResetTestCase))
-+ return suite
-+
-+if __name__ == '__main__':
-+ unittest.main(defaultTest='test_suite')
-+
-+
-diff -Nupr Python-2.6.4.orig/Lib/bsddb/test/test_lock.py
Python-2.6.4/Lib/bsddb/test/test_lock.py
---- Python-2.6.4.orig/Lib/bsddb/test/test_lock.py 2009-01-26 16:53:32.000000000 -0500
-+++ Python-2.6.4/Lib/bsddb/test/test_lock.py 2009-12-04 07:36:00.000000000 -0500
-@@ -89,7 +89,18 @@ class LockingTestCase(unittest.TestCase)
- for t in threads:
- t.join()
-
-- def test03_lock_timeout(self):
-+ if db.version() >= (4, 2) :
-+ def test03_lock_timeout(self):
-+ self.env.set_timeout(0, db.DB_SET_LOCK_TIMEOUT)
-+ self.assertEqual(self.env.get_timeout(db.DB_SET_LOCK_TIMEOUT), 0)
-+ self.env.set_timeout(0, db.DB_SET_TXN_TIMEOUT)
-+ self.assertEqual(self.env.get_timeout(db.DB_SET_TXN_TIMEOUT), 0)
-+ self.env.set_timeout(123456, db.DB_SET_LOCK_TIMEOUT)
-+ self.assertEqual(self.env.get_timeout(db.DB_SET_LOCK_TIMEOUT), 123456)
-+ self.env.set_timeout(7890123, db.DB_SET_TXN_TIMEOUT)
-+ self.assertEqual(self.env.get_timeout(db.DB_SET_TXN_TIMEOUT), 7890123)
-+
-+ def test04_lock_timeout2(self):
- self.env.set_timeout(0, db.DB_SET_LOCK_TIMEOUT)
- self.env.set_timeout(0, db.DB_SET_TXN_TIMEOUT)
- self.env.set_timeout(123456, db.DB_SET_LOCK_TIMEOUT)
-@@ -124,7 +135,7 @@ class LockingTestCase(unittest.TestCase)
- self.env.lock_get,anID2, "shared lock", db.DB_LOCK_READ)
- end_time=time.time()
- deadlock_detection.end=True
-- self.assertTrue((end_time-start_time) >= 0.0999)
-+ self.assertTrue((end_time-start_time) >= 0.1)
- self.env.lock_put(lock)
- t.join()
-
-diff -Nupr Python-2.6.4.orig/Lib/bsddb/test/test_pickle.py
Python-2.6.4/Lib/bsddb/test/test_pickle.py
---- Python-2.6.4.orig/Lib/bsddb/test/test_pickle.py 2008-08-31 10:00:51.000000000 -0400
-+++ Python-2.6.4/Lib/bsddb/test/test_pickle.py 2009-12-04 07:36:00.000000000 -0500
-@@ -1,10 +1,16 @@
-
- import os
- import pickle
--try:
-- import cPickle
--except ImportError:
-+import sys
-+
-+if sys.version_info[0] < 3 :
-+ try:
-+ import cPickle
-+ except ImportError:
-+ cPickle = None
-+else :
- cPickle = None
-+
- import unittest
-
- from test_all import db, test_support, get_new_environment_path, get_new_database_path
-diff -Nupr Python-2.6.4.orig/Lib/bsddb/test/test_recno.py
Python-2.6.4/Lib/bsddb/test/test_recno.py
---- Python-2.6.4.orig/Lib/bsddb/test/test_recno.py 2009-07-02 11:37:21.000000000 -0400
-+++ Python-2.6.4/Lib/bsddb/test/test_recno.py 2009-12-04 07:36:00.000000000 -0500
-@@ -150,7 +150,7 @@ class SimpleRecnoTestCase(unittest.TestC
- if verbose:
- print rec
-
-- # test that non-existent key lookups work (and that
-+ # test that non-existant key lookups work (and that
- # DBC_set_range doesn't have a memleak under valgrind)
- rec = c.set_range(999999)
- self.assertEqual(rec, None)
-diff -Nupr Python-2.6.4.orig/Lib/bsddb/test/test_replication.py
Python-2.6.4/Lib/bsddb/test/test_replication.py
---- Python-2.6.4.orig/Lib/bsddb/test/test_replication.py 2008-09-17 22:47:35.000000000
-0400
-+++ Python-2.6.4/Lib/bsddb/test/test_replication.py 2009-12-04 07:36:00.000000000 -0500
-@@ -119,19 +119,7 @@ class DBReplicationManager(unittest.Test
- timeout = time.time()+10
- while (time.time()<timeout) and not (self.confirmed_master and
self.client_startupdone) :
- time.sleep(0.02)
-- # this fails on Windows as self.client_startupdone never gets set
-- # to True - see bug 3892. BUT - even though this assertion
-- # fails on Windows the rest of the test passes - so to prove
-- # that we let the rest of the test run. Sadly we can't
-- # make use of raising TestSkipped() here (unittest still
-- # reports it as an error), so we yell to stderr.
-- import sys
-- if sys.platform=="win32":
-- print >> sys.stderr, \
-- "XXX - windows bsddb replication fails on windows and is
skipped"
-- print >> sys.stderr, "XXX - Please see issue #3892"
-- else:
-- self.assertTrue(time.time()<timeout)
-+ self.assertTrue(time.time()<timeout)
-
- d = self.dbenvMaster.repmgr_site_list()
- self.assertEquals(len(d), 1)
-@@ -340,6 +328,9 @@ class DBBaseReplication(DBReplicationMan
- txn.commit()
- break
-
-+ d = self.dbenvMaster.rep_stat(flags=db.DB_STAT_CLEAR);
-+ self.assertTrue("master_changes" in d)
-+
- txn=self.dbenvMaster.txn_begin()
- self.dbMaster.put("ABC", "123", txn=txn)
- txn.commit()
-@@ -430,6 +421,14 @@ class DBBaseReplication(DBReplicationMan
-
- self.assertTrue(self.confirmed_master)
-
-+ if db.version() >= (4,7) :
-+ def test04_test_clockskew(self) :
-+ fast, slow = 1234, 1230
-+ self.dbenvMaster.rep_set_clockskew(fast, slow)
-+ self.assertEqual((fast, slow),
-+ self.dbenvMaster.rep_get_clockskew())
-+ self.basic_rep_threading()
-+
- #----------------------------------------------------------------------
-
- def test_suite():
-diff -Nupr Python-2.6.4.orig/Lib/bsddb/test/test_sequence.py
Python-2.6.4/Lib/bsddb/test/test_sequence.py
---- Python-2.6.4.orig/Lib/bsddb/test/test_sequence.py 2008-08-31 10:00:51.000000000
-0400
-+++ Python-2.6.4/Lib/bsddb/test/test_sequence.py 2009-12-04 07:36:00.000000000 -0500
-@@ -37,7 +37,7 @@ class DBSequenceTest(unittest.TestCase):
- self.seq = db.DBSequence(self.d, flags=0)
- start_value = 10 * self.int_32_max
- self.assertEqual(0xA00000000, start_value)
-- self.assertEquals(None, self.seq.init_value(start_value))
-+ self.assertEquals(None, self.seq.initial_value(start_value))
- self.assertEquals(None, self.seq.open(key='id', txn=None,
flags=db.DB_CREATE))
- self.assertEquals(start_value, self.seq.get(5))
- self.assertEquals(start_value + 5, self.seq.get())
-@@ -77,7 +77,7 @@ class DBSequenceTest(unittest.TestCase):
- self.seq = db.DBSequence(self.d, flags=0)
- seq_range = (10 * self.int_32_max, 11 * self.int_32_max - 1)
- self.assertEquals(None, self.seq.set_range(seq_range))
-- self.seq.init_value(seq_range[0])
-+ self.seq.initial_value(seq_range[0])
- self.assertEquals(None, self.seq.open(key='foo', txn=None,
flags=db.DB_CREATE))
- self.assertEquals(seq_range, self.seq.get_range())
-
-@@ -110,7 +110,7 @@ class DBSequenceTest(unittest.TestCase):
- value_minus=(-1L<<63)+1 # Two complement
- self.assertEquals(-9223372036854775807L,value_minus)
- self.seq = db.DBSequence(self.d, flags=0)
-- self.assertEquals(None, self.seq.init_value(value_plus-1))
-+ self.assertEquals(None, self.seq.initial_value(value_plus-1))
- self.assertEquals(None, self.seq.open(key='id', txn=None,
- flags=db.DB_CREATE))
- self.assertEquals(value_plus-1, self.seq.get(1))
-@@ -119,7 +119,7 @@ class DBSequenceTest(unittest.TestCase):
- self.seq.remove(txn=None, flags=0)
-
- self.seq = db.DBSequence(self.d, flags=0)
-- self.assertEquals(None, self.seq.init_value(value_minus))
-+ self.assertEquals(None, self.seq.initial_value(value_minus))
- self.assertEquals(None, self.seq.open(key='id', txn=None,
- flags=db.DB_CREATE))
- self.assertEquals(value_minus, self.seq.get(1))
-diff -Nupr Python-2.6.4.orig/Lib/bsddb/test_support.py
Python-2.6.4/Lib/bsddb/test_support.py
---- Python-2.6.4.orig/Lib/bsddb/test_support.py 1969-12-31 19:00:00.000000000 -0500
-+++ Python-2.6.4/Lib/bsddb/test_support.py 2009-12-04 07:36:00.000000000 -0500
-@@ -0,0 +1,54 @@
-+# This module is a bridge.
-+#
-+# Code is copied from Python 2.6 (trunk) Lib/test/test_support.py that
-+# the bsddb test suite needs even when run standalone on a python
-+# version that may not have all of these.
-+
-+# DO NOT ADD NEW UNIQUE CODE. Copy code from the python trunk
-+# trunk test_support module into here. If you need a place for your
-+# own stuff specific to bsddb tests, make a bsddb.test.foo module.
-+
-+import errno
-+import os
-+import shutil
-+import socket
-+
-+def unlink(filename):
-+ try:
-+ os.unlink(filename)
-+ except OSError:
-+ pass
-+
-+def rmtree(path):
-+ try:
-+ shutil.rmtree(path)
-+ except OSError, e:
-+ # Unix returns ENOENT, Windows returns ESRCH.
-+ if e.errno not in (errno.ENOENT, errno.ESRCH):
-+ raise
-+
-+def find_unused_port(family=socket.AF_INET, socktype=socket.SOCK_STREAM):
-+ tempsock = socket.socket(family, socktype)
-+ port = bind_port(tempsock, family=family, socktype=socktype)
-+ tempsock.close()
-+ del tempsock
-+ return port
-+
-+HOST = 'localhost'
-+def bind_port(sock, family, socktype, host=HOST):
-+ if family == socket.AF_INET and type == socket.SOCK_STREAM:
-+ if hasattr(socket, 'SO_REUSEADDR'):
-+ if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR) == 1:
-+ raise TestFailed("tests should never set the SO_REUSEADDR "
\
-+ "socket option on TCP/IP sockets!")
-+ if hasattr(socket, 'SO_REUSEPORT'):
-+ if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) == 1:
-+ raise TestFailed("tests should never set the SO_REUSEPORT "
\
-+ "socket option on TCP/IP sockets!")
-+ if hasattr(socket, 'SO_EXCLUSIVEADDRUSE'):
-+ sock.setsockopt(socket.SOL_SOCKET, socket.SO_EXCLUSIVEADDRUSE, 1)
-+
-+ sock.bind((host, 0))
-+ port = sock.getsockname()[1]
-+ return port
-+
-diff -Nupr Python-2.6.4.orig/Modules/_bsddb.c Python-2.6.4/Modules/_bsddb.c
---- Python-2.6.4.orig/Modules/_bsddb.c 2008-09-23 14:54:08.000000000 -0400
-+++ Python-2.6.4/Modules/_bsddb.c 2009-12-04 07:34:56.000000000 -0500
-@@ -95,7 +95,7 @@
- #include "bsddb.h"
- #undef COMPILING_BSDDB_C
-
--static char *rcs_id = "$Id: _bsddb.c 66568 2008-09-23 18:54:08Z jesus.cea $";
-+static char *rcs_id = "$Id: _bsddb.c 732 2009-11-05 19:39:04Z jcea $";
-
- /* --------------------------------------------------------------------- */
- /* Various macro definitions */
-@@ -169,9 +169,6 @@ static PyInterpreterState* _db_interpret
-
- #endif
-
--/* Should DB_INCOMPLETE be turned into a warning or an exception? */
--#define INCOMPLETE_IS_WARNING 1
--
- /* --------------------------------------------------------------------- */
- /* Exceptions */
-
-@@ -191,10 +188,6 @@ static PyObject* DBNoServerIDError;
- static PyObject* DBPageNotFoundError; /* DB_PAGE_NOTFOUND */
- static PyObject* DBSecondaryBadError; /* DB_SECONDARY_BAD */
-
--#if !INCOMPLETE_IS_WARNING
--static PyObject* DBIncompleteError; /* DB_INCOMPLETE */
--#endif
--
- static PyObject* DBInvalidArgError; /* EINVAL */
- static PyObject* DBAccessError; /* EACCES */
- static PyObject* DBNoSpaceError; /* ENOSPC */
-@@ -208,6 +201,13 @@ static PyObject* DBPermissionsError;
- #if (DBVER >= 42)
- static PyObject* DBRepHandleDeadError; /* DB_REP_HANDLE_DEAD */
- #endif
-+#if (DBVER >= 44)
-+static PyObject* DBRepLockoutError; /* DB_REP_LOCKOUT */
-+#endif
-+
-+#if (DBVER >= 46)
-+static PyObject* DBRepLeaseExpiredError; /* DB_REP_LEASE_EXPIRED */
-+#endif
-
- static PyObject* DBRepUnavailError; /* DB_REP_UNAVAIL */
-
-@@ -215,6 +215,10 @@ static PyObject* DBRepUnavailError;
- #define DB_BUFFER_SMALL ENOMEM
- #endif
-
-+#if (DBVER < 48)
-+#define DB_GID_SIZE DB_XIDDATASIZE
-+#endif
-+
-
- /* --------------------------------------------------------------------- */
- /* Structure definitions */
-@@ -667,27 +671,8 @@ static int makeDBError(int err)
- unsigned int bytes_left;
-
- switch (err) {
-- case 0: /* successful, no error */ break;
--
--#if (DBVER < 41)
-- case DB_INCOMPLETE:
--#if INCOMPLETE_IS_WARNING
-- bytes_left = our_strlcpy(errTxt, db_strerror(err), sizeof(errTxt));
-- /* Ensure that bytes_left never goes negative */
-- if (_db_errmsg[0] && bytes_left < (sizeof(errTxt) - 4)) {
-- bytes_left = sizeof(errTxt) - bytes_left - 4 - 1;
-- assert(bytes_left >= 0);
-- strcat(errTxt, " -- ");
-- strncat(errTxt, _db_errmsg, bytes_left);
-- }
-- _db_errmsg[0] = 0;
-- exceptionRaised = PyErr_Warn(PyExc_RuntimeWarning, errTxt);
--
--#else /* do an exception instead */
-- errObj = DBIncompleteError;
--#endif
-- break;
--#endif /* DBVER < 41 */
-+ case 0: /* successful, no error */
-+ return 0;
-
- case DB_KEYEMPTY: errObj = DBKeyEmptyError; break;
- case DB_KEYEXIST: errObj = DBKeyExistError; break;
-@@ -720,6 +705,13 @@ static int makeDBError(int err)
- #if (DBVER >= 42)
- case DB_REP_HANDLE_DEAD : errObj = DBRepHandleDeadError; break;
- #endif
-+#if (DBVER >= 44)
-+ case DB_REP_LOCKOUT : errObj = DBRepLockoutError; break;
-+#endif
-+
-+#if (DBVER >= 46)
-+ case DB_REP_LEASE_EXPIRED : errObj = DBRepLeaseExpiredError; break;
-+#endif
-
- case DB_REP_UNAVAIL : errObj = DBRepUnavailError; break;
-
-@@ -1417,10 +1409,70 @@ _db_associateCallback(DB* db, const DBT*
- PyErr_Print();
- }
- }
-+#if (DBVER >= 46)
-+ else if (PyList_Check(result))
-+ {
-+ char* data;
-+ Py_ssize_t size;
-+ int i, listlen;
-+ DBT* dbts;
-+
-+ listlen = PyList_Size(result);
-+
-+ dbts = (DBT *)malloc(sizeof(DBT) * listlen);
-+
-+ for (i=0; i<listlen; i++)
-+ {
-+ if (!PyBytes_Check(PyList_GetItem(result, i)))
-+ {
-+ PyErr_SetString(
-+ PyExc_TypeError,
-+#if (PY_VERSION_HEX < 0x03000000)
-+"The list returned by DB->associate callback should be a list of
strings.");
-+#else
-+"The list returned by DB->associate callback should be a list of bytes.");
-+#endif
-+ PyErr_Print();
-+ }
-+
-+ PyBytes_AsStringAndSize(
-+ PyList_GetItem(result, i),
-+ &data, &size);
-+
-+ CLEAR_DBT(dbts[i]);
-+ dbts[i].data = malloc(size); /* TODO, check this */
-+
-+ if (dbts[i].data)
-+ {
-+ memcpy(dbts[i].data, data, size);
-+ dbts[i].size = size;
-+ dbts[i].ulen = dbts[i].size;
-+ dbts[i].flags = DB_DBT_APPMALLOC; /* DB will free */
-+ }
-+ else
-+ {
-+ PyErr_SetString(PyExc_MemoryError,
-+ "malloc failed in _db_associateCallback (list)");
-+ PyErr_Print();
-+ }
-+ }
-+
-+ CLEAR_DBT(*secKey);
-+
-+ secKey->data = dbts;
-+ secKey->size = listlen;
-+ secKey->flags = DB_DBT_APPMALLOC | DB_DBT_MULTIPLE;
-+ retval = 0;
-+ }
-+#endif
- else {
- PyErr_SetString(
- PyExc_TypeError,
-- "DB associate callback should return DB_DONOTINDEX or
string.");
-+#if (PY_VERSION_HEX < 0x03000000)
-+"DB associate callback should return DB_DONOTINDEX/string/list of strings.");
-+#else
-+"DB associate callback should return DB_DONOTINDEX/bytes/list of bytes.");
-+#endif
- PyErr_Print();
- }
-
-@@ -1439,29 +1491,18 @@ DB_associate(DBObject* self, PyObject* a
- int err, flags=0;
- DBObject* secondaryDB;
- PyObject* callback;
--#if (DBVER >= 41)
- PyObject *txnobj = NULL;
- DB_TXN *txn = NULL;
- static char* kwnames[] = {"secondaryDB", "callback",
"flags", "txn",
- NULL};
--#else
-- static char* kwnames[] = {"secondaryDB", "callback",
"flags", NULL};
--#endif
-
--#if (DBVER >= 41)
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO|iO:associate",
kwnames,
- &secondaryDB, &callback, &flags,
- &txnobj)) {
--#else
-- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO|i:associate", kwnames,
-- &secondaryDB, &callback, &flags)) {
--#endif
- return NULL;
- }
-
--#if (DBVER >= 41)
- if (!checkTxnObj(txnobj, &txn)) return NULL;
--#endif
-
- CHECK_DB_NOT_CLOSED(self);
- if (!DBObject_Check(secondaryDB)) {
-@@ -1497,18 +1538,11 @@ DB_associate(DBObject* self, PyObject* a
- PyEval_InitThreads();
- #endif
- MYDB_BEGIN_ALLOW_THREADS;
--#if (DBVER >= 41)
- err = self->db->associate(self->db,
- txn,
- secondaryDB->db,
- _db_associateCallback,
- flags);
--#else
-- err = self->db->associate(self->db,
-- secondaryDB->db,
-- _db_associateCallback,
-- flags);
--#endif
- MYDB_END_ALLOW_THREADS;
-
- if (err) {
-@@ -1701,6 +1735,64 @@ DB_delete(DBObject* self, PyObject* args
- }
-
-
-+#if (DBVER >= 47)
-+/*
-+** This function is available since Berkeley DB 4.4,
-+** but 4.6 version is so buggy that we only support
-+** it from BDB 4.7 and newer.
-+*/
-+static PyObject*
-+DB_compact(DBObject* self, PyObject* args, PyObject* kwargs)
-+{
-+ PyObject* txnobj = NULL;
-+ PyObject *startobj = NULL, *stopobj = NULL;
-+ int flags = 0;
-+ DB_TXN *txn = NULL;
-+ DBT *start_p = NULL, *stop_p = NULL;
-+ DBT start, stop;
-+ int err;
-+ DB_COMPACT c_data = { 0 };
-+ static char* kwnames[] = { "txn", "start", "stop",
"flags",
-+ "compact_fillpercent",
"compact_pages",
-+ "compact_timeout", NULL };
-+
-+
-+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OOOiiiI:compact",
kwnames,
-+ &txnobj, &startobj, &stopobj,
&flags,
-+ &c_data.compact_fillpercent,
-+ &c_data.compact_pages,
-+ &c_data.compact_timeout))
-+ return NULL;
-+
-+ CHECK_DB_NOT_CLOSED(self);
-+ if (!checkTxnObj(txnobj, &txn)) {
-+ return NULL;
-+ }
-+
-+ if (startobj && make_key_dbt(self, startobj, &start, NULL)) {
-+ start_p = &start;
-+ }
-+ if (stopobj && make_key_dbt(self, stopobj, &stop, NULL)) {
-+ stop_p = &stop;
-+ }
-+
-+ MYDB_BEGIN_ALLOW_THREADS;
-+ err = self->db->compact(self->db, txn, start_p, stop_p, &c_data,
-+ flags, NULL);
-+ MYDB_END_ALLOW_THREADS;
-+
-+ if (startobj)
-+ FREE_DBT(start);
-+ if (stopobj)
-+ FREE_DBT(stop);
-+
-+ RETURN_IF_ERR();
-+
-+ return PyLong_FromUnsignedLong(c_data.compact_pages_truncated);
-+}
-+#endif
-+
-+
- static PyObject*
- DB_fd(DBObject* self)
- {
-@@ -1716,6 +1808,55 @@ DB_fd(DBObject* self)
- }
-
-
-+#if (DBVER >= 46)
-+static PyObject*
-+DB_exists(DBObject* self, PyObject* args, PyObject* kwargs)
-+{
-+ int err, flags=0;
-+ PyObject* txnobj = NULL;
-+ PyObject* keyobj;
-+ DBT key;
-+ DB_TXN *txn;
-+
-+ static char* kwnames[] = {"key", "txn", "flags",
NULL};
-+
-+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|Oi:exists", kwnames,
-+ &keyobj, &txnobj, &flags))
-+ return NULL;
-+
-+ CHECK_DB_NOT_CLOSED(self);
-+ if (!make_key_dbt(self, keyobj, &key, NULL))
-+ return NULL;
-+ if (!checkTxnObj(txnobj, &txn)) {
-+ FREE_DBT(key);
-+ return NULL;
-+ }
-+
-+ MYDB_BEGIN_ALLOW_THREADS;
-+ err = self->db->exists(self->db, txn, &key, flags);
-+ MYDB_END_ALLOW_THREADS;
-+
-+ FREE_DBT(key);
-+
-+ if (!err) {
-+ Py_INCREF(Py_True);
-+ return Py_True;
-+ }
-+ if ((err == DB_NOTFOUND || err == DB_KEYEMPTY)) {
-+ Py_INCREF(Py_False);
-+ return Py_False;
-+ }
-+
-+ /*
-+ ** If we reach there, there was an error. The
-+ ** "return" should be unreachable.
-+ */
-+ RETURN_IF_ERR();
-+ assert(0); /* This coude SHOULD be unreachable */
-+ return NULL;
-+}
-+#endif
-+
- static PyObject*
- DB_get(DBObject* self, PyObject* args, PyObject* kwargs)
- {
-@@ -2114,7 +2255,6 @@ DB_open(DBObject* self, PyObject* args,
- int err, type = DB_UNKNOWN, flags=0, mode=0660;
- char* filename = NULL;
- char* dbname = NULL;
--#if (DBVER >= 41)
- PyObject *txnobj = NULL;
- DB_TXN *txn = NULL;
- /* with dbname */
-@@ -2123,45 +2263,22 @@ DB_open(DBObject* self, PyObject* args,
- /* without dbname */
- static char* kwnames_basic[] = {
- "filename", "dbtype", "flags", "mode",
"txn", NULL};
--#else
-- /* with dbname */
-- static char* kwnames[] = {
-- "filename", "dbname", "dbtype", "flags",
"mode", NULL};
-- /* without dbname */
-- static char* kwnames_basic[] = {
-- "filename", "dbtype", "flags", "mode",
NULL};
--#endif
-
--#if (DBVER >= 41)
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "z|ziiiO:open", kwnames,
- &filename, &dbname, &type, &flags, &mode,
- &txnobj))
--#else
-- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "z|ziii:open", kwnames,
-- &filename, &dbname, &type, &flags,
-- &mode))
--#endif
- {
- PyErr_Clear();
- type = DB_UNKNOWN; flags = 0; mode = 0660;
- filename = NULL; dbname = NULL;
--#if (DBVER >= 41)
- if (!PyArg_ParseTupleAndKeywords(args, kwargs,"z|iiiO:open",
- kwnames_basic,
- &filename, &type, &flags, &mode,
- &txnobj))
- return NULL;
--#else
-- if (!PyArg_ParseTupleAndKeywords(args, kwargs,"z|iii:open",
-- kwnames_basic,
-- &filename, &type, &flags, &mode))
-- return NULL;
--#endif
- }
-
--#if (DBVER >= 41)
- if (!checkTxnObj(txnobj, &txn)) return NULL;
--#endif
-
- if (NULL == self->db) {
- PyObject *t = Py_BuildValue("(is)", 0,
-@@ -2173,24 +2290,17 @@ DB_open(DBObject* self, PyObject* args,
- return NULL;
- }
-
--#if (DBVER >= 41)
- if (txn) { /* Can't use 'txnobj' because could be
'txnobj==Py_None' */
- INSERT_IN_DOUBLE_LINKED_LIST_TXN(((DBTxnObject
*)txnobj)->children_dbs,self);
- self->txn=(DBTxnObject *)txnobj;
- } else {
- self->txn=NULL;
- }
--#else
-- self->txn=NULL;
--#endif
-
- MYDB_BEGIN_ALLOW_THREADS;
--#if (DBVER >= 41)
- err = self->db->open(self->db, txn, filename, dbname, type, flags, mode);
--#else
-- err = self->db->open(self->db, filename, dbname, type, flags, mode);
--#endif
- MYDB_END_ALLOW_THREADS;
-+
- if (makeDBError(err)) {
- PyObject *dummy;
-
-@@ -2490,6 +2600,25 @@ DB_set_cachesize(DBObject* self, PyObjec
- RETURN_NONE();
- }
-
-+#if (DBVER >= 42)
-+static PyObject*
-+DB_get_cachesize(DBObject* self)
-+{
-+ int err;
-+ u_int32_t gbytes, bytes;
-+ int ncache;
-+
-+ CHECK_DB_NOT_CLOSED(self);
-+
-+ MYDB_BEGIN_ALLOW_THREADS;
-+ err = self->db->get_cachesize(self->db, &gbytes, &bytes,
&ncache);
-+ MYDB_END_ALLOW_THREADS;
-+
-+ RETURN_IF_ERR();
-+
-+ return Py_BuildValue("(iii)", gbytes, bytes, ncache);
-+}
-+#endif
-
- static PyObject*
- DB_set_flags(DBObject* self, PyObject* args)
-@@ -2730,9 +2859,6 @@ DB_stat(DBObject* self, PyObject* args,
- MAKE_HASH_ENTRY(pagecnt);
- #endif
- MAKE_HASH_ENTRY(pagesize);
--#if (DBVER < 41)
-- MAKE_HASH_ENTRY(nelem);
--#endif
- MAKE_HASH_ENTRY(ffactor);
- MAKE_HASH_ENTRY(buckets);
- MAKE_HASH_ENTRY(free);
-@@ -2779,9 +2905,7 @@ DB_stat(DBObject* self, PyObject* args,
- MAKE_QUEUE_ENTRY(nkeys);
- MAKE_QUEUE_ENTRY(ndata);
- MAKE_QUEUE_ENTRY(pagesize);
--#if (DBVER >= 41)
- MAKE_QUEUE_ENTRY(extentsize);
--#endif
- MAKE_QUEUE_ENTRY(pages);
- MAKE_QUEUE_ENTRY(re_len);
- MAKE_QUEUE_ENTRY(re_pad);
-@@ -2892,7 +3016,7 @@ DB_verify(DBObject* self, PyObject* args
- PyObject *error;
-
- error=DB_close_internal(self, 0, 1);
-- if (error ) {
-+ if (error) {
- return error;
- }
- }
-@@ -2930,7 +3054,6 @@ DB_set_get_returns_none(DBObject* self,
- return NUMBER_FromLong(oldValue);
- }
-
--#if (DBVER >= 41)
- static PyObject*
- DB_set_encrypt(DBObject* self, PyObject* args, PyObject* kwargs)
- {
-@@ -2951,7 +3074,24 @@ DB_set_encrypt(DBObject* self, PyObject*
- RETURN_IF_ERR();
- RETURN_NONE();
- }
--#endif /* DBVER >= 41 */
-+
-+#if (DBVER >= 42)
-+static PyObject*
-+DB_get_encrypt_flags(DBObject* self)
-+{
-+ int err;
-+ u_int32_t flags;
-+
-+ MYDB_BEGIN_ALLOW_THREADS;
-+ err = self->db->get_encrypt_flags(self->db, &flags);
-+ MYDB_END_ALLOW_THREADS;
-+
-+ RETURN_IF_ERR();
-+
-+ return NUMBER_FromLong(flags);
-+}
-+#endif
-+
-
-
- /*-------------------------------------------------------------- */
-@@ -3097,18 +3237,11 @@ DB_ass_sub(DBObject* self, PyObject* key
-
-
- static PyObject*
--DB_has_key(DBObject* self, PyObject* args, PyObject* kwargs)
-+_DB_has_key(DBObject* self, PyObject* keyobj, PyObject* txnobj)
- {
- int err;
-- PyObject* keyobj;
-- DBT key, data;
-- PyObject* txnobj = NULL;
-+ DBT key;
- DB_TXN *txn = NULL;
-- static char* kwnames[] = {"key","txn", NULL};
--
-- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|O:has_key", kwnames,
-- &keyobj, &txnobj))
-- return NULL;
-
- CHECK_DB_NOT_CLOSED(self);
- if (!make_key_dbt(self, keyobj, &key, NULL))
-@@ -3118,28 +3251,77 @@ DB_has_key(DBObject* self, PyObject* arg
- return NULL;
- }
-
-+#if (DBVER < 46)
- /* This causes DB_BUFFER_SMALL to be returned when the db has the key because
- it has a record but can't allocate a buffer for the data. This saves
- having to deal with data we won't be using.
- */
-- CLEAR_DBT(data);
-- data.flags = DB_DBT_USERMEM;
-+ {
-+ DBT data ;
-+ CLEAR_DBT(data);
-+ data.flags = DB_DBT_USERMEM;
-
-+ MYDB_BEGIN_ALLOW_THREADS;
-+ err = self->db->get(self->db, txn, &key, &data, 0);
-+ MYDB_END_ALLOW_THREADS;
-+ }
-+#else
- MYDB_BEGIN_ALLOW_THREADS;
-- err = self->db->get(self->db, txn, &key, &data, 0);
-+ err = self->db->exists(self->db, txn, &key, 0);
- MYDB_END_ALLOW_THREADS;
-+#endif
-+
- FREE_DBT(key);
-
-+ /*
-+ ** DB_BUFFER_SMALL is only used if we use "get".
-+ ** We can drop it when we only use "exists",
-+ ** when we drop suport for Berkeley DB < 4.6.
-+ */
- if (err == DB_BUFFER_SMALL || err == 0) {
-- return NUMBER_FromLong(1);
-+ Py_INCREF(Py_True);
-+ return Py_True;
- } else if (err == DB_NOTFOUND || err == DB_KEYEMPTY) {
-- return NUMBER_FromLong(0);
-+ Py_INCREF(Py_False);
-+ return Py_False;
- }
-
- makeDBError(err);
- return NULL;
- }
-
-+static PyObject*
-+DB_has_key(DBObject* self, PyObject* args, PyObject* kwargs)
-+{
-+ PyObject* keyobj;
-+ PyObject* txnobj = NULL;
-+ static char* kwnames[] = {"key","txn", NULL};
-+
-+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|O:has_key", kwnames,
-+ &keyobj, &txnobj))
-+ return NULL;
-+
-+ return _DB_has_key(self, keyobj, txnobj);
-+}
-+
-+
-+static int DB_contains(DBObject* self, PyObject* keyobj)
-+{
-+ PyObject* result;
-+ int result2 = 0;
-+
-+ result = _DB_has_key(self, keyobj, NULL) ;
-+ if (result == NULL) {
-+ return -1; /* Propague exception */
-+ }
-+ if (result != Py_False) {
-+ result2 = 1;
-+ }
-+
-+ Py_DECREF(result);
-+ return result2;
-+}
-+
-
- #define _KEYS_LIST 1
- #define _VALUES_LIST 2
-@@ -3970,6 +4152,13 @@ DBC_next_nodup(DBCursorObject* self, PyO
- return _DBCursor_get(self,DB_NEXT_NODUP,args,kwargs,"|iii:next_nodup");
- }
-
-+#if (DBVER >= 46)
-+static PyObject*
-+DBC_prev_dup(DBCursorObject* self, PyObject* args, PyObject *kwargs)
-+{
-+ return _DBCursor_get(self,DB_PREV_DUP,args,kwargs,"|iii:prev_dup");
-+}
-+#endif
-
- static PyObject*
- DBC_prev_nodup(DBCursorObject* self, PyObject* args, PyObject *kwargs)
-@@ -4012,6 +4201,44 @@ DBC_join_item(DBCursorObject* self, PyOb
- }
-
-
-+#if (DBVER >= 46)
-+static PyObject*
-+DBC_set_priority(DBCursorObject* self, PyObject* args, PyObject* kwargs)
-+{
-+ int err, priority;
-+ static char* kwnames[] = { "priority", NULL };
-+
-+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i:set_priority", kwnames,
-+ &priority))
-+ return NULL;
-+
-+ CHECK_CURSOR_NOT_CLOSED(self);
-+
-+ MYDB_BEGIN_ALLOW_THREADS;
-+ err = self->dbc->set_priority(self->dbc, priority);
-+ MYDB_END_ALLOW_THREADS;
-+ RETURN_IF_ERR();
-+ RETURN_NONE();
-+}
-+
-+
-+static PyObject*
-+DBC_get_priority(DBCursorObject* self)
-+{
-+ int err;
-+ DB_CACHE_PRIORITY priority;
-+
-+ CHECK_CURSOR_NOT_CLOSED(self);
-+
-+ MYDB_BEGIN_ALLOW_THREADS;
-+ err = self->dbc->get_priority(self->dbc, &priority);
-+ MYDB_END_ALLOW_THREADS;
-+ RETURN_IF_ERR();
-+ return NUMBER_FromLong(priority);
-+}
-+#endif
-+
-+
-
- /* --------------------------------------------------------------------- */
- /* DBEnv methods */
-@@ -4095,7 +4322,6 @@ DBEnv_remove(DBEnvObject* self, PyObject
- RETURN_NONE();
- }
-
--#if (DBVER >= 41)
- static PyObject*
- DBEnv_dbremove(DBEnvObject* self, PyObject* args, PyObject* kwargs)
- {
-@@ -4152,6 +4378,8 @@ DBEnv_dbrename(DBEnvObject* self, PyObje
- RETURN_NONE();
- }
-
-+
-+
- static PyObject*
- DBEnv_set_encrypt(DBEnvObject* self, PyObject* args, PyObject* kwargs)
- {
-@@ -4172,17 +4400,57 @@ DBEnv_set_encrypt(DBEnvObject* self, PyO
- RETURN_IF_ERR();
- RETURN_NONE();
- }
--#endif /* DBVER >= 41 */
-
-+#if (DBVER >= 42)
- static PyObject*
--DBEnv_set_timeout(DBEnvObject* self, PyObject* args, PyObject* kwargs)
-+DBEnv_get_encrypt_flags(DBEnvObject* self)
- {
- int err;
-- u_int32_t flags=0;
-- u_int32_t timeout = 0;
-- static char* kwnames[] = { "timeout", "flags", NULL };
-+ u_int32_t flags;
-
-- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ii:set_timeout", kwnames,
-+ CHECK_ENV_NOT_CLOSED(self);
-+
-+ MYDB_BEGIN_ALLOW_THREADS;
-+ err = self->db_env->get_encrypt_flags(self->db_env, &flags);
-+ MYDB_END_ALLOW_THREADS;
-+
-+ RETURN_IF_ERR();
-+
-+ return NUMBER_FromLong(flags);
-+}
-+
-+static PyObject*
-+DBEnv_get_timeout(DBEnvObject* self, PyObject* args, PyObject* kwargs)
-+{
-+ int err;
-+ int flag;
-+ u_int32_t timeout;
-+ static char* kwnames[] = {"flag", NULL };
-+
-+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i:get_timeout", kwnames,
-+ &flag)) {
-+ return NULL;
-+ }
-+ CHECK_ENV_NOT_CLOSED(self);
-+
-+ MYDB_BEGIN_ALLOW_THREADS;
-+ err = self->db_env->get_timeout(self->db_env, &timeout, flag);
-+ MYDB_END_ALLOW_THREADS;
-+ RETURN_IF_ERR();
-+ return NUMBER_FromLong(timeout);
-+}
-+#endif
-+
-+
-+static PyObject*
-+DBEnv_set_timeout(DBEnvObject* self, PyObject* args, PyObject* kwargs)
-+{
-+ int err;
-+ u_int32_t flags=0;
-+ u_int32_t timeout = 0;
-+ static char* kwnames[] = { "timeout", "flags", NULL };
-+
-+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ii:set_timeout", kwnames,
- &timeout, &flags)) {
- return NULL;
- }
-@@ -4210,6 +4478,25 @@ DBEnv_set_shm_key(DBEnvObject* self, PyO
- RETURN_NONE();
- }
-
-+#if (DBVER >= 42)
-+static PyObject*
-+DBEnv_get_shm_key(DBEnvObject* self)
-+{
-+ int err;
-+ long shm_key;
-+
-+ CHECK_ENV_NOT_CLOSED(self);
-+
-+ MYDB_BEGIN_ALLOW_THREADS;
-+ err = self->db_env->get_shm_key(self->db_env, &shm_key);
-+ MYDB_END_ALLOW_THREADS;
-+
-+ RETURN_IF_ERR();
-+
-+ return NUMBER_FromLong(shm_key);
-+}
-+#endif
-+
- static PyObject*
- DBEnv_set_cachesize(DBEnvObject* self, PyObject* args)
- {
-@@ -4227,6 +4514,26 @@ DBEnv_set_cachesize(DBEnvObject* self, P
- RETURN_NONE();
- }
-
-+#if (DBVER >= 42)
-+static PyObject*
-+DBEnv_get_cachesize(DBEnvObject* self)
-+{
-+ int err;
-+ u_int32_t gbytes, bytes;
-+ int ncache;
-+
-+ CHECK_ENV_NOT_CLOSED(self);
-+
-+ MYDB_BEGIN_ALLOW_THREADS;
-+ err = self->db_env->get_cachesize(self->db_env, &gbytes, &bytes,
&ncache);
-+ MYDB_END_ALLOW_THREADS;
-+
-+ RETURN_IF_ERR();
-+
-+ return Py_BuildValue("(iii)", gbytes, bytes, ncache);
-+}
-+#endif
-+
-
- static PyObject*
- DBEnv_set_flags(DBEnvObject* self, PyObject* args)
-@@ -4265,6 +4572,151 @@ DBEnv_log_set_config(DBEnvObject* self,
- }
- #endif /* DBVER >= 47 */
-
-+#if (DBVER >= 44)
-+static PyObject*
-+DBEnv_mutex_set_max(DBEnvObject* self, PyObject* args)
-+{
-+ int err;
-+ int value;
-+
-+ if (!PyArg_ParseTuple(args, "i:mutex_set_max", &value))
-+ return NULL;
-+
-+ CHECK_ENV_NOT_CLOSED(self);
-+
-+ MYDB_BEGIN_ALLOW_THREADS;
-+ err = self->db_env->mutex_set_max(self->db_env, value);
-+ MYDB_END_ALLOW_THREADS;
-+
-+ RETURN_IF_ERR();
-+ RETURN_NONE();
-+}
-+
-+static PyObject*
-+DBEnv_mutex_get_max(DBEnvObject* self)
-+{
-+ int err;
-+ u_int32_t value;
-+
-+ CHECK_ENV_NOT_CLOSED(self);
-+
-+ MYDB_BEGIN_ALLOW_THREADS;
-+ err = self->db_env->mutex_get_max(self->db_env, &value);
-+ MYDB_END_ALLOW_THREADS;
-+
-+ RETURN_IF_ERR();
-+
-+ return NUMBER_FromLong(value);
-+}
-+
-+static PyObject*
-+DBEnv_mutex_set_align(DBEnvObject* self, PyObject* args)
-+{
-+ int err;
-+ int align;
-+
-+ if (!PyArg_ParseTuple(args, "i:mutex_set_align", &align))
-+ return NULL;
-+
-+ CHECK_ENV_NOT_CLOSED(self);
-+
-+ MYDB_BEGIN_ALLOW_THREADS;
-+ err = self->db_env->mutex_set_align(self->db_env, align);
-+ MYDB_END_ALLOW_THREADS;
-+
-+ RETURN_IF_ERR();
-+ RETURN_NONE();
-+}
-+
-+static PyObject*
-+DBEnv_mutex_get_align(DBEnvObject* self)
-+{
-+ int err;
-+ u_int32_t align;
-+
-+ CHECK_ENV_NOT_CLOSED(self);
-+
-+ MYDB_BEGIN_ALLOW_THREADS;
-+ err = self->db_env->mutex_get_align(self->db_env, &align);
-+ MYDB_END_ALLOW_THREADS;
-+
-+ RETURN_IF_ERR();
-+
-+ return NUMBER_FromLong(align);
-+}
-+
-+static PyObject*
-+DBEnv_mutex_set_increment(DBEnvObject* self, PyObject* args)
-+{
-+ int err;
-+ int increment;
-+
-+ if (!PyArg_ParseTuple(args, "i:mutex_set_increment", &increment))
-+ return NULL;
-+
-+ CHECK_ENV_NOT_CLOSED(self);
-+
-+ MYDB_BEGIN_ALLOW_THREADS;
-+ err = self->db_env->mutex_set_increment(self->db_env, increment);
-+ MYDB_END_ALLOW_THREADS;
-+
-+ RETURN_IF_ERR();
-+ RETURN_NONE();
-+}
-+
-+static PyObject*
-+DBEnv_mutex_get_increment(DBEnvObject* self)
-+{
-+ int err;
-+ u_int32_t increment;
-+
-+ CHECK_ENV_NOT_CLOSED(self);
-+
-+ MYDB_BEGIN_ALLOW_THREADS;
-+ err = self->db_env->mutex_get_increment(self->db_env, &increment);
-+ MYDB_END_ALLOW_THREADS;
-+
-+ RETURN_IF_ERR();
-+
-+ return NUMBER_FromLong(increment);
-+}
-+
-+static PyObject*
-+DBEnv_mutex_set_tas_spins(DBEnvObject* self, PyObject* args)
-+{
-+ int err;
-+ int tas_spins;
-+
-+ if (!PyArg_ParseTuple(args, "i:mutex_set_tas_spins", &tas_spins))
-+ return NULL;
-+
-+ CHECK_ENV_NOT_CLOSED(self);
-+
-+ MYDB_BEGIN_ALLOW_THREADS;
-+ err = self->db_env->mutex_set_tas_spins(self->db_env, tas_spins);
-+ MYDB_END_ALLOW_THREADS;
-+
-+ RETURN_IF_ERR();
-+ RETURN_NONE();
-+}
-+
-+static PyObject*
-+DBEnv_mutex_get_tas_spins(DBEnvObject* self)
-+{
-+ int err;
-+ u_int32_t tas_spins;
-+
-+ CHECK_ENV_NOT_CLOSED(self);
-+
-+ MYDB_BEGIN_ALLOW_THREADS;
-+ err = self->db_env->mutex_get_tas_spins(self->db_env, &tas_spins);
-+ MYDB_END_ALLOW_THREADS;
-+
-+ RETURN_IF_ERR();
-+
-+ return NUMBER_FromLong(tas_spins);
-+}
-+#endif
-
- static PyObject*
- DBEnv_set_data_dir(DBEnvObject* self, PyObject* args)
-@@ -4283,6 +4735,47 @@ DBEnv_set_data_dir(DBEnvObject* self, Py
- RETURN_NONE();
- }
-
-+#if (DBVER >= 42)
-+static PyObject*
-+DBEnv_get_data_dirs(DBEnvObject* self)
-+{
-+ int err;
-+ PyObject *tuple;
-+ PyObject *item;
-+ const char **dirpp;
-+ int size, i;
-+
-+ CHECK_ENV_NOT_CLOSED(self);
-+
-+ MYDB_BEGIN_ALLOW_THREADS;
-+ err = self->db_env->get_data_dirs(self->db_env, &dirpp);
-+ MYDB_END_ALLOW_THREADS;
-+
-+ RETURN_IF_ERR();
-+
-+ /*
-+ ** Calculate size. Python C API
-+ ** actually allows for tuple resizing,
-+ ** but this is simple enough.
-+ */
-+ for (size=0; *(dirpp+size) ; size++);
-+
-+ tuple = PyTuple_New(size);
-+ if (!tuple)
-+ return NULL;
-+
-+ for (i=0; i<size; i++) {
-+ item = PyBytes_FromString (*(dirpp+i));
-+ if (item == NULL) {
-+ Py_DECREF(tuple);
-+ tuple = NULL;
-+ break;
-+ }
-+ PyTuple_SET_ITEM(tuple, i, item);
-+ }
-+ return tuple;
-+}
-+#endif
-
- static PyObject*
- DBEnv_set_lg_bsize(DBEnvObject* self, PyObject* args)
-@@ -4501,7 +4994,11 @@ DBEnv_txn_recover(DBEnvObject* self)
- DBTxnObject *txn;
- #define PREPLIST_LEN 16
- DB_PREPLIST preplist[PREPLIST_LEN];
-+#if (DBVER < 48)
- long retp;
-+#else
-+ u_int32_t retp;
-+#endif
-
- CHECK_ENV_NOT_CLOSED(self);
-
-@@ -4522,12 +5019,12 @@ DBEnv_txn_recover(DBEnvObject* self)
- flags=DB_NEXT; /* Prepare for next loop pass */
- for (i=0; i<retp; i++) {
- gid=PyBytes_FromStringAndSize((char *)(preplist[i].gid),
-- DB_XIDDATASIZE);
-+ DB_GID_SIZE);
- if (!gid) {
- Py_DECREF(list);
- return NULL;
- }
-- txn=newDBTxnObject(self, NULL, preplist[i].txn, flags);
-+ txn=newDBTxnObject(self, NULL, preplist[i].txn, 0);
- if (!txn) {
- Py_DECREF(list);
- Py_DECREF(gid);
-@@ -4602,6 +5099,24 @@ DBEnv_txn_checkpoint(DBEnvObject* self,
- }
-
-
-+#if (DBVER >= 42)
-+static PyObject*
-+DBEnv_get_tx_max(DBEnvObject* self)
-+{
-+ int err;
-+ u_int32_t max;
-+
-+ CHECK_ENV_NOT_CLOSED(self);
-+
-+ MYDB_BEGIN_ALLOW_THREADS;
-+ err = self->db_env->get_tx_max(self->db_env, &max);
-+ MYDB_END_ALLOW_THREADS;
-+ RETURN_IF_ERR();
-+ return PyLong_FromUnsignedLong(max);
-+}
-+#endif
-+
-+
- static PyObject*
- DBEnv_set_tx_max(DBEnvObject* self, PyObject* args)
- {
-@@ -4611,12 +5126,31 @@ DBEnv_set_tx_max(DBEnvObject* self, PyOb
- return NULL;
- CHECK_ENV_NOT_CLOSED(self);
-
-+ MYDB_BEGIN_ALLOW_THREADS;
- err = self->db_env->set_tx_max(self->db_env, max);
-+ MYDB_END_ALLOW_THREADS;
- RETURN_IF_ERR();
- RETURN_NONE();
- }
-
-
-+#if (DBVER >= 42)
-+static PyObject*
-+DBEnv_get_tx_timestamp(DBEnvObject* self)
-+{
-+ int err;
-+ time_t timestamp;
-+
-+ CHECK_ENV_NOT_CLOSED(self);
-+
-+ MYDB_BEGIN_ALLOW_THREADS;
-+ err = self->db_env->get_tx_timestamp(self->db_env, ×tamp);
-+ MYDB_END_ALLOW_THREADS;
-+ RETURN_IF_ERR();
-+ return NUMBER_FromLong(timestamp);
-+}
-+#endif
-+
- static PyObject*
- DBEnv_set_tx_timestamp(DBEnvObject* self, PyObject* args)
- {
-@@ -4628,7 +5162,9 @@ DBEnv_set_tx_timestamp(DBEnvObject* self
- return NULL;
- CHECK_ENV_NOT_CLOSED(self);
- timestamp = (time_t)stamp;
-+ MYDB_BEGIN_ALLOW_THREADS;
- err = self->db_env->set_tx_timestamp(self->db_env, ×tamp);
-+ MYDB_END_ALLOW_THREADS;
- RETURN_IF_ERR();
- RETURN_NONE();
- }
-@@ -4722,6 +5258,26 @@ DBEnv_lock_put(DBEnvObject* self, PyObje
-
- #if (DBVER >= 44)
- static PyObject*
-+DBEnv_fileid_reset(DBEnvObject* self, PyObject* args, PyObject* kwargs)
-+{
-+ int err;
-+ char *file;
-+ u_int32_t flags = 0;
-+ static char* kwnames[] = { "file", "flags", NULL};
-+
-+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "z|i:fileid_reset",
kwnames,
-+ &file, &flags))
-+ return NULL;
-+ CHECK_ENV_NOT_CLOSED(self);
-+
-+ MYDB_BEGIN_ALLOW_THREADS;
-+ err = self->db_env->fileid_reset(self->db_env, file, flags);
-+ MYDB_END_ALLOW_THREADS;
-+ RETURN_IF_ERR();
-+ RETURN_NONE();
-+}
-+
-+static PyObject*
- DBEnv_lsn_reset(DBEnvObject* self, PyObject* args, PyObject* kwargs)
- {
- int err;
-@@ -4777,9 +5333,6 @@ DBEnv_log_stat(DBEnvObject* self, PyObje
- MAKE_ENTRY(lg_size);
- MAKE_ENTRY(record);
- #endif
--#if (DBVER < 41)
-- MAKE_ENTRY(lg_max);
--#endif
- MAKE_ENTRY(w_mbytes);
- MAKE_ENTRY(w_bytes);
- MAKE_ENTRY(wc_mbytes);
-@@ -4832,13 +5385,8 @@ DBEnv_lock_stat(DBEnvObject* self, PyObj
-
- #define MAKE_ENTRY(name) _addIntToDict(d, #name, sp->st_##name)
-
--#if (DBVER < 41)
-- MAKE_ENTRY(lastid);
--#endif
--#if (DBVER >=41)
- MAKE_ENTRY(id);
- MAKE_ENTRY(cur_maxid);
--#endif
- MAKE_ENTRY(nmodes);
- MAKE_ENTRY(maxlocks);
- MAKE_ENTRY(maxlockers);
-@@ -4863,10 +5411,8 @@ DBEnv_lock_stat(DBEnvObject* self, PyObj
- MAKE_ENTRY(lock_wait);
- #endif
- MAKE_ENTRY(ndeadlocks);
--#if (DBVER >= 41)
- MAKE_ENTRY(locktimeout);
- MAKE_ENTRY(txntimeout);
--#endif
- MAKE_ENTRY(nlocktimeouts);
- MAKE_ENTRY(ntxntimeouts);
- #if (DBVER >= 46)
-@@ -4955,6 +5501,31 @@ DBEnv_log_archive(DBEnvObject* self, PyO
- }
-
-
-+#if (DBVER >= 43)
-+static PyObject*
-+DBEnv_txn_stat_print(DBEnvObject* self, PyObject* args, PyObject *kwargs)
-+{
-+ int err;
-+ int flags=0;
-+ static char* kwnames[] = { "flags", NULL };
-+
-+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|i:stat_print",
-+ kwnames, &flags))
-+ {
-+ return NULL;
-+ }
-+
-+ CHECK_ENV_NOT_CLOSED(self);
-+
-+ MYDB_BEGIN_ALLOW_THREADS;
-+ err = self->db_env->txn_stat_print(self->db_env, flags);
-+ MYDB_END_ALLOW_THREADS;
-+ RETURN_IF_ERR();
-+ RETURN_NONE();
-+}
-+#endif
-+
-+
- static PyObject*
- DBEnv_txn_stat(DBEnvObject* self, PyObject* args)
- {
-@@ -5047,6 +5618,7 @@ DBEnv_set_private(DBEnvObject* self, PyO
- }
-
-
-+#if (DBVER < 48)
- static PyObject*
- DBEnv_set_rpc_server(DBEnvObject* self, PyObject* args, PyObject* kwargs)
- {
-@@ -5068,6 +5640,7 @@ DBEnv_set_rpc_server(DBEnvObject* self,
- RETURN_IF_ERR();
- RETURN_NONE();
- }
-+#endif
-
- static PyObject*
- DBEnv_set_verbose(DBEnvObject* self, PyObject* args)
-@@ -5551,79 +6124,248 @@ DBEnv_rep_get_nsites(DBEnvObject* self)
- err = self->db_env->rep_get_nsites(self->db_env, &nsites);
- MYDB_END_ALLOW_THREADS;
- RETURN_IF_ERR();
-- return NUMBER_FromLong(nsites);
-+ return NUMBER_FromLong(nsites);
-+}
-+
-+static PyObject*
-+DBEnv_rep_set_priority(DBEnvObject* self, PyObject* args)
-+{
-+ int err;
-+ int priority;
-+
-+ if (!PyArg_ParseTuple(args, "i:rep_set_priority", &priority)) {
-+ return NULL;
-+ }
-+ CHECK_ENV_NOT_CLOSED(self);
-+ MYDB_BEGIN_ALLOW_THREADS;
-+ err = self->db_env->rep_set_priority(self->db_env, priority);
-+ MYDB_END_ALLOW_THREADS;
-+ RETURN_IF_ERR();
-+ RETURN_NONE();
-+}
-+
-+static PyObject*
-+DBEnv_rep_get_priority(DBEnvObject* self)
-+{
-+ int err;
-+#if (DBVER >= 47)
-+ u_int32_t priority;
-+#else
-+ int priority;
-+#endif
-+
-+ CHECK_ENV_NOT_CLOSED(self);
-+ MYDB_BEGIN_ALLOW_THREADS;
-+ err = self->db_env->rep_get_priority(self->db_env, &priority);
-+ MYDB_END_ALLOW_THREADS;
-+ RETURN_IF_ERR();
-+ return NUMBER_FromLong(priority);
-+}
-+
-+static PyObject*
-+DBEnv_rep_set_timeout(DBEnvObject* self, PyObject* args)
-+{
-+ int err;
-+ int which, timeout;
-+
-+ if (!PyArg_ParseTuple(args, "ii:rep_set_timeout", &which,
&timeout)) {
-+ return NULL;
-+ }
-+ CHECK_ENV_NOT_CLOSED(self);
-+ MYDB_BEGIN_ALLOW_THREADS;
-+ err = self->db_env->rep_set_timeout(self->db_env, which, timeout);
-+ MYDB_END_ALLOW_THREADS;
-+ RETURN_IF_ERR();
-+ RETURN_NONE();
-+}
-+
-+static PyObject*
-+DBEnv_rep_get_timeout(DBEnvObject* self, PyObject* args)
-+{
-+ int err;
-+ int which;
-+ u_int32_t timeout;
-+
-+ if (!PyArg_ParseTuple(args, "i:rep_get_timeout", &which)) {
-+ return NULL;
-+ }
-+ CHECK_ENV_NOT_CLOSED(self);
-+ MYDB_BEGIN_ALLOW_THREADS;
-+ err = self->db_env->rep_get_timeout(self->db_env, which, &timeout);
-+ MYDB_END_ALLOW_THREADS;
-+ RETURN_IF_ERR();
-+ return NUMBER_FromLong(timeout);
- }
-+#endif
-+
-
-+#if (DBVER >= 47)
- static PyObject*
--DBEnv_rep_set_priority(DBEnvObject* self, PyObject* args)
-+DBEnv_rep_set_clockskew(DBEnvObject* self, PyObject* args)
- {
- int err;
-- int priority;
-+ unsigned int fast, slow;
-
-- if (!PyArg_ParseTuple(args, "i:rep_set_priority", &priority)) {
-+#if (PY_VERSION_HEX >= 0x02040000)
-+ if (!PyArg_ParseTuple(args,"II:rep_set_clockskew", &fast, &slow))
- return NULL;
-- }
-+#else
-+ if (!PyArg_ParseTuple(args,"ii:rep_set_clockskew", &fast, &slow))
-+ return NULL;
-+#endif
-+
- CHECK_ENV_NOT_CLOSED(self);
-+
- MYDB_BEGIN_ALLOW_THREADS;
-- err = self->db_env->rep_set_priority(self->db_env, priority);
-+ err = self->db_env->rep_set_clockskew(self->db_env, fast, slow);
- MYDB_END_ALLOW_THREADS;
- RETURN_IF_ERR();
- RETURN_NONE();
- }
-
- static PyObject*
--DBEnv_rep_get_priority(DBEnvObject* self)
-+DBEnv_rep_get_clockskew(DBEnvObject* self)
- {
- int err;
--#if (DBVER >= 47)
-- u_int32_t priority;
--#else
-- int priority;
--#endif
-+ unsigned int fast, slow;
-
- CHECK_ENV_NOT_CLOSED(self);
- MYDB_BEGIN_ALLOW_THREADS;
-- err = self->db_env->rep_get_priority(self->db_env, &priority);
-+ err = self->db_env->rep_get_clockskew(self->db_env, &fast, &slow);
- MYDB_END_ALLOW_THREADS;
- RETURN_IF_ERR();
-- return NUMBER_FromLong(priority);
-+#if (PY_VERSION_HEX >= 0x02040000)
-+ return Py_BuildValue("(II)", fast, slow);
-+#else
-+ return Py_BuildValue("(ii)", fast, slow);
-+#endif
- }
-+#endif
-
-+#if (DBVER >= 43)
- static PyObject*
--DBEnv_rep_set_timeout(DBEnvObject* self, PyObject* args)
-+DBEnv_rep_stat_print(DBEnvObject* self, PyObject* args, PyObject *kwargs)
- {
- int err;
-- int which, timeout;
-+ int flags=0;
-+ static char* kwnames[] = { "flags", NULL };
-
-- if (!PyArg_ParseTuple(args, "ii:rep_set_timeout", &which,
&timeout)) {
-+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|i:rep_stat_print",
-+ kwnames, &flags))
-+ {
- return NULL;
- }
- CHECK_ENV_NOT_CLOSED(self);
- MYDB_BEGIN_ALLOW_THREADS;
-- err = self->db_env->rep_set_timeout(self->db_env, which, timeout);
-+ err = self->db_env->rep_stat_print(self->db_env, flags);
- MYDB_END_ALLOW_THREADS;
- RETURN_IF_ERR();
- RETURN_NONE();
- }
-+#endif
-
- static PyObject*
--DBEnv_rep_get_timeout(DBEnvObject* self, PyObject* args)
-+DBEnv_rep_stat(DBEnvObject* self, PyObject* args, PyObject *kwargs)
- {
- int err;
-- int which;
-- u_int32_t timeout;
-+ int flags=0;
-+ DB_REP_STAT *statp;
-+ PyObject *stats;
-+ static char* kwnames[] = { "flags", NULL };
-
-- if (!PyArg_ParseTuple(args, "i:rep_get_timeout", &which)) {
-+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|i:rep_stat",
-+ kwnames, &flags))
-+ {
- return NULL;
- }
- CHECK_ENV_NOT_CLOSED(self);
- MYDB_BEGIN_ALLOW_THREADS;
-- err = self->db_env->rep_get_timeout(self->db_env, which, &timeout);
-+ err = self->db_env->rep_stat(self->db_env, &statp, flags);
- MYDB_END_ALLOW_THREADS;
- RETURN_IF_ERR();
-- return NUMBER_FromLong(timeout);
--}
-+
-+ stats=PyDict_New();
-+ if (stats == NULL) {
-+ free(statp);
-+ return NULL;
-+ }
-+
-+#define MAKE_ENTRY(name) _addIntToDict(stats, #name, statp->st_##name)
-+#define MAKE_DB_LSN_ENTRY(name) _addDB_lsnToDict(stats , #name, statp->st_##name)
-+
-+#if (DBVER >= 44)
-+ MAKE_ENTRY(bulk_fills);
-+ MAKE_ENTRY(bulk_overflows);
-+ MAKE_ENTRY(bulk_records);
-+ MAKE_ENTRY(bulk_transfers);
-+ MAKE_ENTRY(client_rerequests);
-+ MAKE_ENTRY(client_svc_miss);
-+ MAKE_ENTRY(client_svc_req);
-+#endif
-+ MAKE_ENTRY(dupmasters);
-+#if (DBVER >= 43)
-+ MAKE_ENTRY(egen);
-+ MAKE_ENTRY(election_nvotes);
-+ MAKE_ENTRY(startup_complete);
-+ MAKE_ENTRY(pg_duplicated);
-+ MAKE_ENTRY(pg_records);
-+ MAKE_ENTRY(pg_requested);
-+ MAKE_ENTRY(next_pg);
-+ MAKE_ENTRY(waiting_pg);
-+#endif
-+ MAKE_ENTRY(election_cur_winner);
-+ MAKE_ENTRY(election_gen);
-+ MAKE_DB_LSN_ENTRY(election_lsn);
-+ MAKE_ENTRY(election_nsites);
-+ MAKE_ENTRY(election_priority);
-+#if (DBVER >= 44)
-+ MAKE_ENTRY(election_sec);
-+ MAKE_ENTRY(election_usec);
-+#endif
-+ MAKE_ENTRY(election_status);
-+ MAKE_ENTRY(election_tiebreaker);
-+ MAKE_ENTRY(election_votes);
-+ MAKE_ENTRY(elections);
-+ MAKE_ENTRY(elections_won);
-+ MAKE_ENTRY(env_id);
-+ MAKE_ENTRY(env_priority);
-+ MAKE_ENTRY(gen);
-+ MAKE_ENTRY(log_duplicated);
-+ MAKE_ENTRY(log_queued);
-+ MAKE_ENTRY(log_queued_max);
-+ MAKE_ENTRY(log_queued_total);
-+ MAKE_ENTRY(log_records);
-+ MAKE_ENTRY(log_requested);
-+ MAKE_ENTRY(master);
-+ MAKE_ENTRY(master_changes);
-+#if (DBVER >= 47)
-+ MAKE_ENTRY(max_lease_sec);
-+ MAKE_ENTRY(max_lease_usec);
-+ MAKE_DB_LSN_ENTRY(max_perm_lsn);
-+#endif
-+ MAKE_ENTRY(msgs_badgen);
-+ MAKE_ENTRY(msgs_processed);
-+ MAKE_ENTRY(msgs_recover);
-+ MAKE_ENTRY(msgs_send_failures);
-+ MAKE_ENTRY(msgs_sent);
-+ MAKE_ENTRY(newsites);
-+ MAKE_DB_LSN_ENTRY(next_lsn);
-+ MAKE_ENTRY(nsites);
-+ MAKE_ENTRY(nthrottles);
-+ MAKE_ENTRY(outdated);
-+#if (DBVER >= 46)
-+ MAKE_ENTRY(startsync_delayed);
- #endif
-+ MAKE_ENTRY(status);
-+ MAKE_ENTRY(txns_applied);
-+ MAKE_DB_LSN_ENTRY(waiting_lsn);
-+
-+#undef MAKE_DB_LSN_ENTRY
-+#undef MAKE_ENTRY
-+
-+ free(statp);
-+ return stats;
-+}
-
- /* --------------------------------------------------------------------- */
- /* REPLICATION METHODS: Replication Manager */
-@@ -5947,9 +6689,9 @@ DBTxn_prepare(DBTxnObject* self, PyObjec
- if (!PyArg_ParseTuple(args, "s#:prepare", &gid, &gid_size))
- return NULL;
-
-- if (gid_size != DB_XIDDATASIZE) {
-+ if (gid_size != DB_GID_SIZE) {
- PyErr_SetString(PyExc_TypeError,
-- "gid must be DB_XIDDATASIZE bytes long");
-+ "gid must be DB_GID_SIZE bytes long");
- return NULL;
- }
-
-@@ -6064,6 +6806,76 @@ DBTxn_id(DBTxnObject* self)
- return NUMBER_FromLong(id);
- }
-
-+
-+static PyObject*
-+DBTxn_set_timeout(DBTxnObject* self, PyObject* args, PyObject* kwargs)
-+{
-+ int err;
-+ u_int32_t flags=0;
-+ u_int32_t timeout = 0;
-+ static char* kwnames[] = { "timeout", "flags", NULL };
-+
-+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ii:set_timeout", kwnames,
-+ &timeout, &flags)) {
-+ return NULL;
-+ }
-+
-+ MYDB_BEGIN_ALLOW_THREADS;
-+ err = self->txn->set_timeout(self->txn, (db_timeout_t)timeout, flags);
-+ MYDB_END_ALLOW_THREADS;
-+
-+ RETURN_IF_ERR();
-+ RETURN_NONE();
-+}
-+
-+
-+#if (DBVER >= 44)
-+static PyObject*
-+DBTxn_set_name(DBTxnObject* self, PyObject* args)
-+{
-+ int err;
-+ const char *name;
-+
-+ if (!PyArg_ParseTuple(args, "s:set_name", &name))
-+ return NULL;
-+
-+ MYDB_BEGIN_ALLOW_THREADS;
-+ err = self->txn->set_name(self->txn, name);
-+ MYDB_END_ALLOW_THREADS;
-+
-+ RETURN_IF_ERR();
-+ RETURN_NONE();
-+}
-+#endif
-+
-+
-+#if (DBVER >= 44)
-+static PyObject*
-+DBTxn_get_name(DBTxnObject* self)
-+{
-+ int err;
-+ const char *name;
-+
-+ MYDB_BEGIN_ALLOW_THREADS;
-+ err = self->txn->get_name(self->txn, &name);
-+ MYDB_END_ALLOW_THREADS;
-+
-+ RETURN_IF_ERR();
-+#if (PY_VERSION_HEX < 0x03000000)
-+ if (!name) {
-+ return PyString_FromString("");
-+ }
-+ return PyString_FromString(name);
-+#else
-+ if (!name) {
-+ return PyUnicode_FromString("");
-+ }
-+ return PyUnicode_FromString(name);
-+#endif
-+}
-+#endif
-+
-+
- #if (DBVER >= 43)
- /* --------------------------------------------------------------------- */
- /* DBSequence methods */
-@@ -6167,12 +6979,12 @@ DBSequence_get_key(DBSequenceObject* sel
- }
-
- static PyObject*
--DBSequence_init_value(DBSequenceObject* self, PyObject* args)
-+DBSequence_initial_value(DBSequenceObject* self, PyObject* args)
- {
- int err;
- PY_LONG_LONG value;
- db_seq_t value2;
-- if (!PyArg_ParseTuple(args,"L:init_value", &value))
-+ if (!PyArg_ParseTuple(args,"L:initial_value", &value))
- return NULL;
- CHECK_SEQUENCE_NOT_CLOSED(self)
-
-@@ -6350,6 +7162,29 @@ DBSequence_get_range(DBSequenceObject* s
- return Py_BuildValue("(LL)", min, max);
- }
-
-+
-+static PyObject*
-+DBSequence_stat_print(DBSequenceObject* self, PyObject* args, PyObject *kwargs)
-+{
-+ int err;
-+ int flags=0;
-+ static char* kwnames[] = { "flags", NULL };
-+
-+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|i:stat_print",
-+ kwnames, &flags))
-+ {
-+ return NULL;
-+ }
-+
-+ CHECK_SEQUENCE_NOT_CLOSED(self);
-+
-+ MYDB_BEGIN_ALLOW_THREADS;
-+ err = self->sequence->stat_print(self->sequence, flags);
-+ MYDB_END_ALLOW_THREADS;
-+ RETURN_IF_ERR();
-+ RETURN_NONE();
-+}
-+
- static PyObject*
- DBSequence_stat(DBSequenceObject* self, PyObject* args, PyObject* kwargs)
- {
-@@ -6401,11 +7236,18 @@ static PyMethodDef DB_methods[] = {
- {"append", (PyCFunction)DB_append,
METH_VARARGS|METH_KEYWORDS},
- {"associate", (PyCFunction)DB_associate,
METH_VARARGS|METH_KEYWORDS},
- {"close", (PyCFunction)DB_close, METH_VARARGS},
-+#if (DBVER >= 47)
-+ {"compact", (PyCFunction)DB_compact,
METH_VARARGS|METH_KEYWORDS},
-+#endif
- {"consume", (PyCFunction)DB_consume,
METH_VARARGS|METH_KEYWORDS},
- {"consume_wait", (PyCFunction)DB_consume_wait,
METH_VARARGS|METH_KEYWORDS},
- {"cursor", (PyCFunction)DB_cursor,
METH_VARARGS|METH_KEYWORDS},
- {"delete", (PyCFunction)DB_delete,
METH_VARARGS|METH_KEYWORDS},
- {"fd", (PyCFunction)DB_fd, METH_NOARGS},
-+#if (DBVER >= 46)
-+ {"exists", (PyCFunction)DB_exists,
-+ METH_VARARGS|METH_KEYWORDS},
-+#endif
- {"get", (PyCFunction)DB_get,
METH_VARARGS|METH_KEYWORDS},
- {"pget", (PyCFunction)DB_pget,
METH_VARARGS|METH_KEYWORDS},
- {"get_both", (PyCFunction)DB_get_both,
METH_VARARGS|METH_KEYWORDS},
-@@ -6424,9 +7266,14 @@ static PyMethodDef DB_methods[] = {
- {"set_bt_minkey", (PyCFunction)DB_set_bt_minkey, METH_VARARGS},
- {"set_bt_compare", (PyCFunction)DB_set_bt_compare, METH_O},
- {"set_cachesize", (PyCFunction)DB_set_cachesize, METH_VARARGS},
--#if (DBVER >= 41)
-+#if (DBVER >= 42)
-+ {"get_cachesize", (PyCFunction)DB_get_cachesize, METH_NOARGS},
-+#endif
- {"set_encrypt", (PyCFunction)DB_set_encrypt,
METH_VARARGS|METH_KEYWORDS},
-+#if (DBVER >= 42)
-+ {"get_encrypt_flags", (PyCFunction)DB_get_encrypt_flags, METH_NOARGS},
- #endif
-+
- {"set_flags", (PyCFunction)DB_set_flags, METH_VARARGS},
- {"set_h_ffactor", (PyCFunction)DB_set_h_ffactor, METH_VARARGS},
- {"set_h_nelem", (PyCFunction)DB_set_h_nelem, METH_VARARGS},
-@@ -6451,6 +7298,20 @@ static PyMethodDef DB_methods[] = {
- };
-
-
-+/* We need this to support __contains__() */
-+static PySequenceMethods DB_sequence = {
-+ 0, /* sq_length, mapping wins here */
-+ 0, /* sq_concat */
-+ 0, /* sq_repeat */
-+ 0, /* sq_item */
-+ 0, /* sq_slice */
-+ 0, /* sq_ass_item */
-+ 0, /* sq_ass_slice */
-+ (objobjproc)DB_contains, /* sq_contains */
-+ 0, /* sq_inplace_concat */
-+ 0, /* sq_inplace_repeat */
-+};
-+
- static PyMappingMethods DB_mapping = {
- DB_length, /*mp_length*/
- (binaryfunc)DB_subscript, /*mp_subscript*/
-@@ -6481,8 +7342,17 @@ static PyMethodDef DBCursor_methods[] =
- {"consume", (PyCFunction)DBC_consume,
METH_VARARGS|METH_KEYWORDS},
- {"next_dup", (PyCFunction)DBC_next_dup,
METH_VARARGS|METH_KEYWORDS},
- {"next_nodup", (PyCFunction)DBC_next_nodup,
METH_VARARGS|METH_KEYWORDS},
-+#if (DBVER >= 46)
-+ {"prev_dup", (PyCFunction)DBC_prev_dup,
-+ METH_VARARGS|METH_KEYWORDS},
-+#endif
- {"prev_nodup", (PyCFunction)DBC_prev_nodup,
METH_VARARGS|METH_KEYWORDS},
- {"join_item", (PyCFunction)DBC_join_item, METH_VARARGS},
-+#if (DBVER >= 46)
-+ {"set_priority", (PyCFunction)DBC_set_priority,
-+ METH_VARARGS|METH_KEYWORDS},
-+ {"get_priority", (PyCFunction)DBC_get_priority, METH_NOARGS},
-+#endif
- {NULL, NULL} /* sentinel */
- };
-
-@@ -6491,57 +7361,94 @@ static PyMethodDef DBEnv_methods[] = {
- {"close", (PyCFunction)DBEnv_close, METH_VARARGS},
- {"open", (PyCFunction)DBEnv_open, METH_VARARGS},
- {"remove", (PyCFunction)DBEnv_remove, METH_VARARGS},
--#if (DBVER >= 41)
- {"dbremove", (PyCFunction)DBEnv_dbremove,
METH_VARARGS|METH_KEYWORDS},
- {"dbrename", (PyCFunction)DBEnv_dbrename,
METH_VARARGS|METH_KEYWORDS},
- {"set_encrypt", (PyCFunction)DBEnv_set_encrypt,
METH_VARARGS|METH_KEYWORDS},
-+#if (DBVER >= 42)
-+ {"get_encrypt_flags", (PyCFunction)DBEnv_get_encrypt_flags, METH_NOARGS},
-+ {"get_timeout", (PyCFunction)DBEnv_get_timeout,
-+ METH_VARARGS|METH_KEYWORDS},
-+#endif
-+ {"set_timeout", (PyCFunction)DBEnv_set_timeout,
METH_VARARGS|METH_KEYWORDS},
-+ {"set_shm_key", (PyCFunction)DBEnv_set_shm_key, METH_VARARGS},
-+#if (DBVER >= 42)
-+ {"get_shm_key", (PyCFunction)DBEnv_get_shm_key, METH_NOARGS},
-+#endif
-+ {"set_cachesize", (PyCFunction)DBEnv_set_cachesize, METH_VARARGS},
-+#if (DBVER >= 42)
-+ {"get_cachesize", (PyCFunction)DBEnv_get_cachesize, METH_NOARGS},
-+#endif
-+#if (DBVER >= 44)
-+ {"mutex_set_max", (PyCFunction)DBEnv_mutex_set_max, METH_VARARGS},
-+ {"mutex_get_max", (PyCFunction)DBEnv_mutex_get_max, METH_NOARGS},
-+ {"mutex_set_align", (PyCFunction)DBEnv_mutex_set_align, METH_VARARGS},
-+ {"mutex_get_align", (PyCFunction)DBEnv_mutex_get_align, METH_NOARGS},
-+ {"mutex_set_increment", (PyCFunction)DBEnv_mutex_set_increment,
-+ METH_VARARGS},
-+ {"mutex_get_increment", (PyCFunction)DBEnv_mutex_get_increment,
-+ METH_NOARGS},
-+ {"mutex_set_tas_spins", (PyCFunction)DBEnv_mutex_set_tas_spins,
-+ METH_VARARGS},
-+ {"mutex_get_tas_spins", (PyCFunction)DBEnv_mutex_get_tas_spins,
-+ METH_NOARGS},
-+#endif
-+ {"set_data_dir", (PyCFunction)DBEnv_set_data_dir, METH_VARARGS},
-+#if (DBVER >= 42)
-+ {"get_data_dirs", (PyCFunction)DBEnv_get_data_dirs, METH_NOARGS},
- #endif
-- {"set_timeout", (PyCFunction)DBEnv_set_timeout,
METH_VARARGS|METH_KEYWORDS},
-- {"set_shm_key", (PyCFunction)DBEnv_set_shm_key, METH_VARARGS},
-- {"set_cachesize", (PyCFunction)DBEnv_set_cachesize, METH_VARARGS},
-- {"set_data_dir", (PyCFunction)DBEnv_set_data_dir, METH_VARARGS},
-- {"set_flags", (PyCFunction)DBEnv_set_flags, METH_VARARGS},
-+ {"set_flags", (PyCFunction)DBEnv_set_flags, METH_VARARGS},
- #if (DBVER >= 47)
-- {"log_set_config", (PyCFunction)DBEnv_log_set_config, METH_VARARGS},
-+ {"log_set_config", (PyCFunction)DBEnv_log_set_config, METH_VARARGS},
- #endif
-- {"set_lg_bsize", (PyCFunction)DBEnv_set_lg_bsize, METH_VARARGS},
-- {"set_lg_dir", (PyCFunction)DBEnv_set_lg_dir, METH_VARARGS},
-- {"set_lg_max", (PyCFunction)DBEnv_set_lg_max, METH_VARARGS},
-+ {"set_lg_bsize", (PyCFunction)DBEnv_set_lg_bsize, METH_VARARGS},
-+ {"set_lg_dir", (PyCFunction)DBEnv_set_lg_dir, METH_VARARGS},
-+ {"set_lg_max", (PyCFunction)DBEnv_set_lg_max, METH_VARARGS},
- #if (DBVER >= 42)
-- {"get_lg_max", (PyCFunction)DBEnv_get_lg_max, METH_NOARGS},
-+ {"get_lg_max", (PyCFunction)DBEnv_get_lg_max, METH_NOARGS},
- #endif
- {"set_lg_regionmax",(PyCFunction)DBEnv_set_lg_regionmax, METH_VARARGS},
-- {"set_lk_detect", (PyCFunction)DBEnv_set_lk_detect, METH_VARARGS},
-+ {"set_lk_detect", (PyCFunction)DBEnv_set_lk_detect, METH_VARARGS},
- #if (DBVER < 45)
-- {"set_lk_max", (PyCFunction)DBEnv_set_lk_max, METH_VARARGS},
-+ {"set_lk_max", (PyCFunction)DBEnv_set_lk_max, METH_VARARGS},
- #endif
- {"set_lk_max_locks", (PyCFunction)DBEnv_set_lk_max_locks, METH_VARARGS},
- {"set_lk_max_lockers", (PyCFunction)DBEnv_set_lk_max_lockers,
METH_VARARGS},
- {"set_lk_max_objects", (PyCFunction)DBEnv_set_lk_max_objects,
METH_VARARGS},
-- {"set_mp_mmapsize", (PyCFunction)DBEnv_set_mp_mmapsize, METH_VARARGS},
-- {"set_tmp_dir", (PyCFunction)DBEnv_set_tmp_dir, METH_VARARGS},
-- {"txn_begin", (PyCFunction)DBEnv_txn_begin,
METH_VARARGS|METH_KEYWORDS},
-- {"txn_checkpoint", (PyCFunction)DBEnv_txn_checkpoint, METH_VARARGS},
-- {"txn_stat", (PyCFunction)DBEnv_txn_stat, METH_VARARGS},
-- {"set_tx_max", (PyCFunction)DBEnv_set_tx_max, METH_VARARGS},
-+ {"set_mp_mmapsize", (PyCFunction)DBEnv_set_mp_mmapsize, METH_VARARGS},
-+ {"set_tmp_dir", (PyCFunction)DBEnv_set_tmp_dir, METH_VARARGS},
-+ {"txn_begin", (PyCFunction)DBEnv_txn_begin,
METH_VARARGS|METH_KEYWORDS},
-+ {"txn_checkpoint", (PyCFunction)DBEnv_txn_checkpoint, METH_VARARGS},
-+ {"txn_stat", (PyCFunction)DBEnv_txn_stat, METH_VARARGS},
-+#if (DBVER >= 43)
-+ {"txn_stat_print", (PyCFunction)DBEnv_txn_stat_print,
-+ METH_VARARGS|METH_KEYWORDS},
-+#endif
-+#if (DBVER >= 42)
-+ {"get_tx_max", (PyCFunction)DBEnv_get_tx_max, METH_NOARGS},
-+ {"get_tx_timestamp", (PyCFunction)DBEnv_get_tx_timestamp, METH_NOARGS},
-+#endif
-+ {"set_tx_max", (PyCFunction)DBEnv_set_tx_max, METH_VARARGS},
- {"set_tx_timestamp", (PyCFunction)DBEnv_set_tx_timestamp, METH_VARARGS},
-- {"lock_detect", (PyCFunction)DBEnv_lock_detect, METH_VARARGS},
-- {"lock_get", (PyCFunction)DBEnv_lock_get, METH_VARARGS},
-- {"lock_id", (PyCFunction)DBEnv_lock_id, METH_NOARGS},
-- {"lock_id_free", (PyCFunction)DBEnv_lock_id_free, METH_VARARGS},
-- {"lock_put", (PyCFunction)DBEnv_lock_put, METH_VARARGS},
-- {"lock_stat", (PyCFunction)DBEnv_lock_stat, METH_VARARGS},
-- {"log_archive", (PyCFunction)DBEnv_log_archive, METH_VARARGS},
-- {"log_flush", (PyCFunction)DBEnv_log_flush, METH_NOARGS},
-- {"log_stat", (PyCFunction)DBEnv_log_stat, METH_VARARGS},
-+ {"lock_detect", (PyCFunction)DBEnv_lock_detect, METH_VARARGS},
-+ {"lock_get", (PyCFunction)DBEnv_lock_get, METH_VARARGS},
-+ {"lock_id", (PyCFunction)DBEnv_lock_id, METH_NOARGS},
-+ {"lock_id_free", (PyCFunction)DBEnv_lock_id_free, METH_VARARGS},
-+ {"lock_put", (PyCFunction)DBEnv_lock_put, METH_VARARGS},
-+ {"lock_stat", (PyCFunction)DBEnv_lock_stat, METH_VARARGS},
-+ {"log_archive", (PyCFunction)DBEnv_log_archive, METH_VARARGS},
-+ {"log_flush", (PyCFunction)DBEnv_log_flush, METH_NOARGS},
-+ {"log_stat", (PyCFunction)DBEnv_log_stat, METH_VARARGS},
- #if (DBVER >= 44)
-- {"lsn_reset", (PyCFunction)DBEnv_lsn_reset,
METH_VARARGS|METH_KEYWORDS},
-+ {"fileid_reset", (PyCFunction)DBEnv_fileid_reset,
METH_VARARGS|METH_KEYWORDS},
-+ {"lsn_reset", (PyCFunction)DBEnv_lsn_reset,
METH_VARARGS|METH_KEYWORDS},
- #endif
- {"set_get_returns_none",(PyCFunction)DBEnv_set_get_returns_none,
METH_VARARGS},
-- {"txn_recover", (PyCFunction)DBEnv_txn_recover, METH_NOARGS},
-+ {"txn_recover", (PyCFunction)DBEnv_txn_recover, METH_NOARGS},
-+#if (DBVER < 48)
- {"set_rpc_server", (PyCFunction)DBEnv_set_rpc_server,
- METH_VARARGS||METH_KEYWORDS},
-- {"set_verbose", (PyCFunction)DBEnv_set_verbose, METH_VARARGS},
-+#endif
-+ {"set_verbose", (PyCFunction)DBEnv_set_verbose, METH_VARARGS},
- #if (DBVER >= 42)
- {"get_verbose", (PyCFunction)DBEnv_get_verbose, METH_VARARGS},
- #endif
-@@ -6579,6 +7486,17 @@ static PyMethodDef DBEnv_methods[] = {
- {"rep_set_timeout", (PyCFunction)DBEnv_rep_set_timeout, METH_VARARGS},
- {"rep_get_timeout", (PyCFunction)DBEnv_rep_get_timeout, METH_VARARGS},
- #endif
-+#if (DBVER >= 47)
-+ {"rep_set_clockskew", (PyCFunction)DBEnv_rep_set_clockskew,
METH_VARARGS},
-+ {"rep_get_clockskew", (PyCFunction)DBEnv_rep_get_clockskew,
METH_VARARGS},
-+#endif
-+ {"rep_stat", (PyCFunction)DBEnv_rep_stat,
-+ METH_VARARGS|METH_KEYWORDS},
-+#if (DBVER >= 43)
-+ {"rep_stat_print", (PyCFunction)DBEnv_rep_stat_print,
-+ METH_VARARGS|METH_KEYWORDS},
-+#endif
-+
- #if (DBVER >= 45)
- {"repmgr_start", (PyCFunction)DBEnv_repmgr_start,
- METH_VARARGS|METH_KEYWORDS},
-@@ -6609,6 +7527,12 @@ static PyMethodDef DBTxn_methods[] = {
- {"discard", (PyCFunction)DBTxn_discard, METH_NOARGS},
- {"abort", (PyCFunction)DBTxn_abort, METH_NOARGS},
- {"id", (PyCFunction)DBTxn_id, METH_NOARGS},
-+ {"set_timeout", (PyCFunction)DBTxn_set_timeout,
-+ METH_VARARGS|METH_KEYWORDS},
-+#if (DBVER >= 44)
-+ {"set_name", (PyCFunction)DBTxn_set_name, METH_VARARGS},
-+ {"get_name", (PyCFunction)DBTxn_get_name, METH_NOARGS},
-+#endif
- {NULL, NULL} /* sentinel */
- };
-
-@@ -6619,7 +7543,7 @@ static PyMethodDef DBSequence_methods[]
- {"get", (PyCFunction)DBSequence_get,
METH_VARARGS|METH_KEYWORDS},
- {"get_dbp", (PyCFunction)DBSequence_get_dbp, METH_NOARGS},
- {"get_key", (PyCFunction)DBSequence_get_key, METH_NOARGS},
-- {"init_value", (PyCFunction)DBSequence_init_value,
METH_VARARGS},
-+ {"initial_value", (PyCFunction)DBSequence_initial_value,
METH_VARARGS},
- {"open", (PyCFunction)DBSequence_open,
METH_VARARGS|METH_KEYWORDS},
- {"remove", (PyCFunction)DBSequence_remove,
METH_VARARGS|METH_KEYWORDS},
- {"set_cachesize", (PyCFunction)DBSequence_set_cachesize,
METH_VARARGS},
-@@ -6629,6 +7553,8 @@ static PyMethodDef DBSequence_methods[]
- {"set_range", (PyCFunction)DBSequence_set_range,
METH_VARARGS},
- {"get_range", (PyCFunction)DBSequence_get_range, METH_NOARGS},
- {"stat", (PyCFunction)DBSequence_stat,
METH_VARARGS|METH_KEYWORDS},
-+ {"stat_print", (PyCFunction)DBSequence_stat_print,
-+ METH_VARARGS|METH_KEYWORDS},
- {NULL, NULL} /* sentinel */
- };
- #endif
-@@ -6677,7 +7603,7 @@ statichere PyTypeObject DB_Type = {
- 0, /*tp_compare*/
- 0, /*tp_repr*/
- 0, /*tp_as_number*/
-- 0, /*tp_as_sequence*/
-+ &DB_sequence,/*tp_as_sequence*/
- &DB_mapping,/*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /* tp_call */
-@@ -7029,10 +7955,21 @@ PyMODINIT_FUNC PyInit__bsddb(void) /
- {
- PyObject* m;
- PyObject* d;
-- PyObject* pybsddb_version_s = PyBytes_FromString( PY_BSDDB_VERSION );
-- PyObject* db_version_s = PyBytes_FromString( DB_VERSION_STRING );
-- PyObject* cvsid_s = PyBytes_FromString( rcs_id );
- PyObject* py_api;
-+ PyObject* pybsddb_version_s;
-+ PyObject* db_version_s;
-+ PyObject* cvsid_s;
-+
-+#if (PY_VERSION_HEX < 0x03000000)
-+ pybsddb_version_s = PyString_FromString(PY_BSDDB_VERSION);
-+ db_version_s = PyString_FromString(DB_VERSION_STRING);
-+ cvsid_s = PyString_FromString(rcs_id);
-+#else
-+ /* This data should be ascii, so UTF-8 conversion is fine */
-+ pybsddb_version_s = PyUnicode_FromString(PY_BSDDB_VERSION);
-+ db_version_s = PyUnicode_FromString(DB_VERSION_STRING);
-+ cvsid_s = PyUnicode_FromString(rcs_id);
-+#endif
-
- /* Initialize object types */
- if ((PyType_Ready(&DB_Type) < 0)
-@@ -7089,6 +8026,7 @@ PyMODINIT_FUNC PyInit__bsddb(void) /
- ADD_INT(d, DB_MAX_PAGES);
- ADD_INT(d, DB_MAX_RECORDS);
-
-+#if (DBVER < 48)
- #if (DBVER >= 42)
- ADD_INT(d, DB_RPCCLIENT);
- #else
-@@ -7096,7 +8034,11 @@ PyMODINIT_FUNC PyInit__bsddb(void) /
- /* allow apps to be written using DB_RPCCLIENT on older Berkeley DB */
- _addIntToDict(d, "DB_RPCCLIENT", DB_CLIENT);
- #endif
-+#endif
-+
-+#if (DBVER < 48)
- ADD_INT(d, DB_XA_CREATE);
-+#endif
-
- ADD_INT(d, DB_CREATE);
- ADD_INT(d, DB_NOMMAP);
-@@ -7113,7 +8055,13 @@ PyMODINIT_FUNC PyInit__bsddb(void) /
- ADD_INT(d, DB_INIT_TXN);
- ADD_INT(d, DB_JOINENV);
-
-+#if (DBVER >= 48)
-+ ADD_INT(d, DB_GID_SIZE);
-+#else
- ADD_INT(d, DB_XIDDATASIZE);
-+ /* Allow new code to work in old BDB releases */
-+ _addIntToDict(d, "DB_GID_SIZE", DB_XIDDATASIZE);
-+#endif
-
- ADD_INT(d, DB_RECOVER);
- ADD_INT(d, DB_RECOVER_FATAL);
-@@ -7128,6 +8076,10 @@ PyMODINIT_FUNC PyInit__bsddb(void) /
- ADD_INT(d, DB_TXN_SYNC);
- ADD_INT(d, DB_TXN_NOWAIT);
-
-+#if (DBVER >= 46)
-+ ADD_INT(d, DB_TXN_WAIT);
-+#endif
-+
- ADD_INT(d, DB_EXCL);
- ADD_INT(d, DB_FCNTL_LOCKING);
- ADD_INT(d, DB_ODDFILESIZE);
-@@ -7233,12 +8185,6 @@ PyMODINIT_FUNC PyInit__bsddb(void) /
- ADD_INT(d, DB_CACHED_COUNTS);
- #endif
-
--#if (DBVER >= 41)
-- _addIntToDict(d, "DB_CHECKPOINT", 0);
--#else
-- ADD_INT(d, DB_CHECKPOINT);
-- ADD_INT(d, DB_CURLSN);
--#endif
- #if (DBVER <= 41)
- ADD_INT(d, DB_COMMIT);
- #endif
-@@ -7249,6 +8195,7 @@ PyMODINIT_FUNC PyInit__bsddb(void) /
- ADD_INT(d, DB_FIRST);
- ADD_INT(d, DB_FLUSH);
- ADD_INT(d, DB_GET_BOTH);
-+ ADD_INT(d, DB_GET_BOTH_RANGE);
- ADD_INT(d, DB_GET_RECNO);
- ADD_INT(d, DB_JOIN_ITEM);
- ADD_INT(d, DB_KEYFIRST);
-@@ -7263,6 +8210,9 @@ PyMODINIT_FUNC PyInit__bsddb(void) /
- ADD_INT(d, DB_POSITION);
- ADD_INT(d, DB_PREV);
- ADD_INT(d, DB_PREV_NODUP);
-+#if (DBVER >= 46)
-+ ADD_INT(d, DB_PREV_DUP);
-+#endif
- #if (DBVER < 45)
- ADD_INT(d, DB_RECORDCOUNT);
- #endif
-@@ -7278,17 +8228,18 @@ PyMODINIT_FUNC PyInit__bsddb(void) /
- ADD_INT(d, DB_MULTIPLE_KEY);
-
- #if (DBVER >= 44)
-+ ADD_INT(d, DB_IMMUTABLE_KEY);
- ADD_INT(d, DB_READ_UNCOMMITTED); /* replaces DB_DIRTY_READ in 4.4 */
- ADD_INT(d, DB_READ_COMMITTED);
- #endif
-
-+#if (DBVER >= 44)
-+ ADD_INT(d, DB_FREELIST_ONLY);
-+ ADD_INT(d, DB_FREE_SPACE);
-+#endif
-+
- ADD_INT(d, DB_DONOTINDEX);
-
--#if (DBVER >= 41)
-- _addIntToDict(d, "DB_INCOMPLETE", 0);
--#else
-- ADD_INT(d, DB_INCOMPLETE);
--#endif
- ADD_INT(d, DB_KEYEMPTY);
- ADD_INT(d, DB_KEYEXIST);
- ADD_INT(d, DB_LOCK_DEADLOCK);
-@@ -7309,14 +8260,15 @@ PyMODINIT_FUNC PyInit__bsddb(void) /
- ADD_INT(d, DB_PANIC_ENVIRONMENT);
- ADD_INT(d, DB_NOPANIC);
-
--#if (DBVER >= 41)
- ADD_INT(d, DB_OVERWRITE);
--#endif
-
--#ifdef DB_REGISTER
-+#if (DBVER >= 44)
- ADD_INT(d, DB_REGISTER);
- #endif
-
-+ ADD_INT(d, DB_EID_INVALID);
-+ ADD_INT(d, DB_EID_BROADCAST);
-+
- #if (DBVER >= 42)
- ADD_INT(d, DB_TIME_NOTGRANTED);
- ADD_INT(d, DB_TXN_NOT_DURABLE);
-@@ -7389,6 +8341,32 @@ PyMODINIT_FUNC PyInit__bsddb(void) /
-
- ADD_INT(d, DB_REP_MASTER);
- ADD_INT(d, DB_REP_CLIENT);
-+
-+ ADD_INT(d, DB_REP_PERMANENT);
-+
-+#if (DBVER >= 44)
-+ ADD_INT(d, DB_REP_CONF_NOAUTOINIT);
-+ ADD_INT(d, DB_REP_CONF_DELAYCLIENT);
-+ ADD_INT(d, DB_REP_CONF_BULK);
-+ ADD_INT(d, DB_REP_CONF_NOWAIT);
-+ ADD_INT(d, DB_REP_ANYWHERE);
-+ ADD_INT(d, DB_REP_REREQUEST);
-+#endif
-+
-+#if (DBVER >= 42)
-+ ADD_INT(d, DB_REP_NOBUFFER);
-+#endif
-+
-+#if (DBVER >= 46)
-+ ADD_INT(d, DB_REP_LEASE_EXPIRED);
-+ ADD_INT(d, DB_IGNORE_LEASE);
-+#endif
-+
-+#if (DBVER >= 47)
-+ ADD_INT(d, DB_REP_CONF_LEASE);
-+ ADD_INT(d, DB_REPMGR_CONF_2SITE_STRICT);
-+#endif
-+
- #if (DBVER >= 45)
- ADD_INT(d, DB_REP_ELECTION);
-
-@@ -7400,6 +8378,11 @@ PyMODINIT_FUNC PyInit__bsddb(void) /
- #if (DBVER >= 46)
- ADD_INT(d, DB_REP_CHECKPOINT_DELAY);
- ADD_INT(d, DB_REP_FULL_ELECTION_TIMEOUT);
-+ ADD_INT(d, DB_REP_LEASE_TIMEOUT);
-+#endif
-+#if (DBVER >= 47)
-+ ADD_INT(d, DB_REP_HEARTBEAT_MONITOR);
-+ ADD_INT(d, DB_REP_HEARTBEAT_SEND);
- #endif
-
- #if (DBVER >= 45)
-@@ -7412,7 +8395,6 @@ PyMODINIT_FUNC PyInit__bsddb(void) /
- ADD_INT(d, DB_REPMGR_ACKS_QUORUM);
- ADD_INT(d, DB_REPMGR_CONNECTED);
- ADD_INT(d, DB_REPMGR_DISCONNECTED);
-- ADD_INT(d, DB_STAT_CLEAR);
- ADD_INT(d, DB_STAT_ALL);
- #endif
-
-@@ -7428,12 +8410,16 @@ PyMODINIT_FUNC PyInit__bsddb(void) /
- ADD_INT(d, DB_DSYNC_LOG);
- #endif
-
--#if (DBVER >= 41)
- ADD_INT(d, DB_ENCRYPT_AES);
- ADD_INT(d, DB_AUTO_COMMIT);
--#else
-- /* allow Berkeley DB 4.1 aware apps to run on older versions */
-- _addIntToDict(d, "DB_AUTO_COMMIT", 0);
-+ ADD_INT(d, DB_PRIORITY_VERY_LOW);
-+ ADD_INT(d, DB_PRIORITY_LOW);
-+ ADD_INT(d, DB_PRIORITY_DEFAULT);
-+ ADD_INT(d, DB_PRIORITY_HIGH);
-+ ADD_INT(d, DB_PRIORITY_VERY_HIGH);
-+
-+#if (DBVER >= 46)
-+ ADD_INT(d, DB_PRIORITY_UNCHANGED);
- #endif
-
- ADD_INT(d, EINVAL);
-@@ -7497,10 +8483,6 @@ PyMODINIT_FUNC PyInit__bsddb(void) /
- }
- #endif
-
--
--#if !INCOMPLETE_IS_WARNING
-- MAKE_EX(DBIncompleteError);
--#endif
- MAKE_EX(DBCursorClosedError);
- MAKE_EX(DBKeyEmptyError);
- MAKE_EX(DBKeyExistError);
-@@ -7528,9 +8510,16 @@ PyMODINIT_FUNC PyInit__bsddb(void) /
- #if (DBVER >= 42)
- MAKE_EX(DBRepHandleDeadError);
- #endif
-+#if (DBVER >= 44)
-+ MAKE_EX(DBRepLockoutError);
-+#endif
-
- MAKE_EX(DBRepUnavailError);
-
-+#if (DBVER >= 46)
-+ MAKE_EX(DBRepLeaseExpiredError);
-+#endif
-+
- #undef MAKE_EX
-
- /* Initiliase the C API structure and add it to the module */
-@@ -7544,7 +8533,24 @@ PyMODINIT_FUNC PyInit__bsddb(void) /
- #endif
- bsddb_api.makeDBError = makeDBError;
-
-+ /*
-+ ** Capsules exist from Python 3.1, but I
-+ ** don't want to break the API compatibility
-+ ** for already published Python versions.
-+ */
-+#if (PY_VERSION_HEX < 0x03020000)
- py_api = PyCObject_FromVoidPtr((void*)&bsddb_api, NULL);
-+#else
-+ {
-+ char py_api_name[250];
-+
-+ strcpy(py_api_name, _bsddbModuleName);
-+ strcat(py_api_name, ".api");
-+
-+ py_api = PyCapsule_New((void*)&bsddb_api, py_api_name, NULL);
-+ }
-+#endif
-+
- PyDict_SetItemString(d, "api", py_api);
- Py_DECREF(py_api);
-
-diff -Nupr Python-2.6.4.orig/Modules/bsddb.h Python-2.6.4/Modules/bsddb.h
---- Python-2.6.4.orig/Modules/bsddb.h 2008-09-28 19:24:19.000000000 -0400
-+++ Python-2.6.4/Modules/bsddb.h 2009-12-04 07:34:56.000000000 -0500
-@@ -105,7 +105,7 @@
- #error "eek! DBVER can't handle minor versions > 9"
- #endif
-
--#define PY_BSDDB_VERSION "4.7.3"
-+#define PY_BSDDB_VERSION "4.8.1"
-
- /* Python object definitions */
-
-@@ -220,6 +220,7 @@ typedef struct DBSequenceObject {
- /* To access the structure from an external module, use code like the
- following (error checking missed out for clarity):
-
-+ // If you are using Python 3.2:
- BSDDB_api* bsddb_api;
- PyObject* mod;
- PyObject* cobj;
-@@ -231,6 +232,15 @@ typedef struct DBSequenceObject {
- Py_DECREF(cobj);
- Py_DECREF(mod);
-
-+
-+ // If you are using Python 3.2 or up:
-+ BSDDB_api* bsddb_api;
-+
-+ // Use "bsddb3._pybsddb.api" if you're using
-+ // the standalone pybsddb add-on.
-+ bsddb_api = (void **)PyCapsule_Import("bsddb._bsddb.api", 1);
-+
-+
- The structure's members must not be changed.
- */
-
-@@ -247,7 +257,6 @@ typedef struct {
-
- /* Functions */
- int (*makeDBError)(int err);
--
- } BSDDB_api;
-
-
diff --git a/python-2.6.5-fix-expat-issue9054.patch
b/python-2.6.5-fix-expat-issue9054.patch
deleted file mode 100644
index f1a4640..0000000
--- a/python-2.6.5-fix-expat-issue9054.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-Index: Modules/pyexpat.c
-===================================================================
---- Modules/pyexpat.c (revision 81539)
-+++ Modules/pyexpat.c (working copy)
-@@ -415,6 +415,9 @@
- PyObject *args;
- PyObject *temp;
-
-+ if (!have_handler(self, CharacterData))
-+ return -1;
-+
- args = PyTuple_New(1);
- if (args == NULL)
- return -1;
diff --git a/python-2.7-fix-2to3-itertools-import-star.patch
b/python-2.7-fix-2to3-itertools-import-star.patch
deleted file mode 100644
index 2f12c9b..0000000
--- a/python-2.7-fix-2to3-itertools-import-star.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-Index: lib2to3/tests/test_fixers.py
-===================================================================
---- lib2to3/tests/test_fixers.py (revision 82529)
-+++ lib2to3/tests/test_fixers.py (revision 82530)
-@@ -3670,7 +3670,11 @@
- a = "from itertools import bar, filterfalse, foo"
- self.check(b, a)
-
-+ def test_import_star(self):
-+ s = "from itertools import *"
-+ self.unchanged(s)
-
-+
- def test_unchanged(self):
- s = "from itertools import foo"
- self.unchanged(s)
-Index: lib2to3/fixes/fix_itertools_imports.py
-===================================================================
---- lib2to3/fixes/fix_itertools_imports.py (revision 82529)
-+++ lib2to3/fixes/fix_itertools_imports.py (revision 82530)
-@@ -20,6 +20,9 @@
- if child.type == token.NAME:
- member = child.value
- name_node = child
-+ elif child.type == token.STAR:
-+ # Just leave the import as is.
-+ return
- else:
- assert child.type == syms.import_as_name
- name_node = child.children[0]
diff --git a/python-2.7-fix-parallel-make.patch b/python-2.7-fix-parallel-make.patch
deleted file mode 100644
index c43e141..0000000
--- a/python-2.7-fix-parallel-make.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-diff -up Python-2.7/Makefile.pre.in.fix-parallel-make Python-2.7/Makefile.pre.in
---- Python-2.7/Makefile.pre.in.fix-parallel-make 2010-07-22 15:01:39.567996932 -0400
-+++ Python-2.7/Makefile.pre.in 2010-07-22 15:47:02.437998509 -0400
-@@ -207,6 +207,7 @@ SIGNAL_OBJS= @SIGNAL_OBJS@
-
- ##########################################################################
- # Grammar
-+GRAMMAR_STAMP= $(srcdir)/grammar-stamp
- GRAMMAR_H= $(srcdir)/Include/graminit.h
- GRAMMAR_C= $(srcdir)/Python/graminit.c
- GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar
-@@ -530,10 +531,24 @@ Modules/getpath.o: $(srcdir)/Modules/get
- Modules/python.o: $(srcdir)/Modules/python.c
- $(MAINCC) -c $(PY_CFLAGS) -o $@ $(srcdir)/Modules/python.c
-
-+# GNU "make" interprets rules with two dependents as two copies of the rule.
-+#
-+# In a parallel build this can lead to pgen being run twice, once for each of
-+# GRAMMAR_H and GRAMMAR_C, leading to race conditions in which the compiler
-+# reads a partially-overwritten copy of one of these files, leading to syntax
-+# errors (or linker errors if the fragment happens to be syntactically valid C)
-+#
-+# See
http://www.gnu.org/software/hello/manual/automake/Multiple-Outputs.html
-+# for more information
-+#
-+# Introduce ".grammar-stamp" as a contrived single output from PGEN to avoid
-+# this:
-+$(GRAMMAR_H) $(GRAMMAR_C): $(GRAMMAR_STAMP)
-
--$(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
-+$(GRAMMAR_STAMP): $(PGEN) $(GRAMMAR_INPUT)
- -@$(INSTALL) -d Include
- -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
-+ touch $(GRAMMAR_STAMP)
-
- $(PGEN): $(PGENOBJS)
- $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
diff --git a/python-2.7-r84443-cfgparse.patch b/python-2.7-r84443-cfgparse.patch
deleted file mode 100644
index eed6e5f..0000000
--- a/python-2.7-r84443-cfgparse.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-Index: Lib/ConfigParser.py
-===================================================================
---- Lib/ConfigParser.py.orig
-+++ Lib/ConfigParser.py
-@@ -399,11 +399,10 @@ class RawConfigParser:
- fp.write("[%s]\n" % section)
- for (key, value) in self._sections[section].items():
- if key != "__name__":
-- if value is None:
-- fp.write("%s\n" % (key))
-- else:
-- fp.write("%s = %s\n" %
-- (key, str(value).replace('\n',
'\n\t')))
-+ if (value is not None) or (self._optcre == self.OPTCRE):
-+ key = " = ".join((key,
str(value).replace('\n', '\n\t')))
-+ fp.write("%s\n" % (key))
-+
- fp.write("\n")
-
- def remove_option(self, section, option):
-Index: Lib/test/test_cfgparser.py
-===================================================================
---- Lib/test/test_cfgparser.py.orig
-+++ Lib/test/test_cfgparser.py
-@@ -493,6 +493,33 @@ class SafeConfigParserTestCaseNoValue(Sa
- allow_no_value = True
-
-
-+class Issue7005TestCase(unittest.TestCase):
-+ """Test output when None is set() as a value and allow_no_value ==
False.
-+
-+
http://bugs.python.org/issue7005
-+
-+ """
-+
-+ expected_output = "[section]\noption = None\n\n"
-+
-+ def prepare(self, config_class):
-+ # This is the default, but that's the point.
-+ cp = config_class(allow_no_value=False)
-+ cp.add_section("section")
-+ cp.set("section", "option", None)
-+ sio = StringIO.StringIO()
-+ cp.write(sio)
-+ return sio.getvalue()
-+
-+ def test_none_as_value_stringified(self):
-+ output = self.prepare(ConfigParser.ConfigParser)
-+ self.assertEqual(output, self.expected_output)
-+
-+ def test_none_as_value_stringified_raw(self):
-+ output = self.prepare(ConfigParser.RawConfigParser)
-+ self.assertEqual(output, self.expected_output)
-+
-+
- class SortedTestCase(RawConfigParserTestCase):
- def newconfig(self, defaults=None):
- self.cf = self.config_class(defaults=defaults, dict_type=SortedDict)
-@@ -524,6 +551,7 @@ def test_main():
- RawConfigParserTestCase,
- SafeConfigParserTestCase,
- SortedTestCase,
-+ Issue7005TestCase,
- SafeConfigParserTestCaseNoValue,
- )
-
diff --git a/python-2.7.1-fix-decimal-in-turkish-locale.patch
b/python-2.7.1-fix-decimal-in-turkish-locale.patch
deleted file mode 100644
index 4645542..0000000
--- a/python-2.7.1-fix-decimal-in-turkish-locale.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-diff -up Python-2.7.1/Lib/decimal.py.fix-decimal-in-turkish-locale
Python-2.7.1/Lib/decimal.py
---- Python-2.7.1/Lib/decimal.py.fix-decimal-in-turkish-locale 2010-07-08
17:22:54.000000000 -0400
-+++ Python-2.7.1/Lib/decimal.py 2011-04-12 11:30:40.850350842 -0400
-@@ -1720,8 +1720,6 @@ class Decimal(object):
- # here self was representable to begin with; return unchanged
- return Decimal(self)
-
-- _pick_rounding_function = {}
--
- # for each of the rounding functions below:
- # self is a finite, nonzero Decimal
- # prec is an integer satisfying 0 <= prec < len(self._int)
-@@ -1788,6 +1786,17 @@ class Decimal(object):
- else:
- return -self._round_down(prec)
-
-+ _pick_rounding_function = dict(
-+ ROUND_DOWN = '_round_down',
-+ ROUND_UP = '_round_up',
-+ ROUND_HALF_UP = '_round_half_up',
-+ ROUND_HALF_DOWN = '_round_half_down',
-+ ROUND_HALF_EVEN = '_round_half_even',
-+ ROUND_CEILING = '_round_ceiling',
-+ ROUND_FLOOR = '_round_floor',
-+ ROUND_05UP = '_round_05up',
-+ )
-+
- def fma(self, other, third, context=None):
- """Fused multiply-add.
-
-@@ -3705,18 +3714,6 @@ _numbers.Number.register(Decimal)
-
- ##### Context class #######################################################
-
--
--# get rounding method function:
--rounding_functions = [name for name in Decimal.__dict__.keys()
-- if name.startswith('_round_')]
--for name in rounding_functions:
-- # name is like _round_half_even, goes to the global ROUND_HALF_EVEN value.
-- globalname = name[1:].upper()
-- val = globals()[globalname]
-- Decimal._pick_rounding_function[val] = name
--
--del name, val, globalname, rounding_functions
--
- class _ContextManager(object):
- """Context manager class to support localcontext().
-
-diff -up Python-2.7.1/Misc/NEWS.fix-decimal-in-turkish-locale Python-2.7.1/Misc/NEWS
diff --git a/python-2.7rc1-ctypes-noexecmem.patch b/python-2.7rc1-ctypes-noexecmem.patch
deleted file mode 100644
index ccc2e68..0000000
--- a/python-2.7rc1-ctypes-noexecmem.patch
+++ /dev/null
@@ -1,85 +0,0 @@
-diff -up Python-2.7rc1/Modules/_ctypes/callbacks.c.selinux
Python-2.7rc1/Modules/_ctypes/callbacks.c
---- Python-2.7rc1/Modules/_ctypes/callbacks.c.selinux 2010-05-09 10:46:46.000000000
-0400
-+++ Python-2.7rc1/Modules/_ctypes/callbacks.c 2010-06-08 08:44:18.357366200 -0400
-@@ -21,8 +21,8 @@ CThunkObject_dealloc(PyObject *_self)
- Py_XDECREF(self->converters);
- Py_XDECREF(self->callable);
- Py_XDECREF(self->restype);
-- if (self->pcl)
-- _ctypes_free_closure(self->pcl);
-+ if (self->pcl_write)
-+ ffi_closure_free(self->pcl_write);
- PyObject_GC_Del(self);
- }
-
-@@ -391,7 +391,8 @@ static CThunkObject* CThunkObject_new(Py
- return NULL;
- }
-
-- p->pcl = NULL;
-+ p->pcl_exec = NULL;
-+ p->pcl_write = NULL;
- memset(&p->cif, 0, sizeof(p->cif));
- p->converters = NULL;
- p->callable = NULL;
-@@ -421,8 +422,9 @@ CThunkObject *_ctypes_alloc_callback(PyO
-
- assert(CThunk_CheckExact(p));
-
-- p->pcl = _ctypes_alloc_closure();
-- if (p->pcl == NULL) {
-+ p->pcl_write = ffi_closure_alloc(sizeof(ffi_closure),
-+ &p->pcl_exec);
-+ if (p->pcl_write == NULL) {
- PyErr_NoMemory();
- goto error;
- }
-@@ -467,7 +469,9 @@ CThunkObject *_ctypes_alloc_callback(PyO
- "ffi_prep_cif failed with %d", result);
- goto error;
- }
-- result = ffi_prep_closure(p->pcl, &p->cif, closure_fcn, p);
-+ result = ffi_prep_closure_loc(p->pcl_write, &p->cif, closure_fcn,
-+ p,
-+ p->pcl_exec);
- if (result != FFI_OK) {
- PyErr_Format(PyExc_RuntimeError,
- "ffi_prep_closure failed with %d", result);
-diff -up Python-2.7rc1/Modules/_ctypes/_ctypes.c.selinux
Python-2.7rc1/Modules/_ctypes/_ctypes.c
---- Python-2.7rc1/Modules/_ctypes/_ctypes.c.selinux 2010-05-09 10:46:46.000000000 -0400
-+++ Python-2.7rc1/Modules/_ctypes/_ctypes.c 2010-06-07 23:19:39.950146038 -0400
-@@ -3463,7 +3463,7 @@ PyCFuncPtr_new(PyTypeObject *type, PyObj
- self->callable = callable;
-
- self->thunk = thunk;
-- *(void **)self->b_ptr = (void *)thunk->pcl;
-+ *(void **)self->b_ptr = (void *)thunk->pcl_exec;
-
- Py_INCREF((PyObject *)thunk); /* for KeepRef */
- if (-1 == KeepRef((CDataObject *)self, 0, (PyObject *)thunk)) {
-diff -up Python-2.7rc1/Modules/_ctypes/ctypes.h.selinux
Python-2.7rc1/Modules/_ctypes/ctypes.h
---- Python-2.7rc1/Modules/_ctypes/ctypes.h.selinux 2010-05-09 10:46:46.000000000 -0400
-+++ Python-2.7rc1/Modules/_ctypes/ctypes.h 2010-06-07 23:19:39.950146038 -0400
-@@ -95,7 +95,8 @@ struct tagCDataObject {
-
- typedef struct {
- PyObject_VAR_HEAD
-- ffi_closure *pcl; /* the C callable */
-+ ffi_closure *pcl_write; /* the C callable, writeable */
-+ void *pcl_exec; /* the C callable, executable */
- ffi_cif cif;
- int flags;
- PyObject *converters;
-diff -up Python-2.7rc1/setup.py.selinux Python-2.7rc1/setup.py
---- Python-2.7rc1/setup.py.selinux 2010-06-07 23:19:39.922147795 -0400
-+++ Python-2.7rc1/setup.py 2010-06-07 23:19:39.951145942 -0400
-@@ -1864,8 +1864,7 @@ class PyBuildExt(build_ext):
- '_ctypes/callbacks.c',
- '_ctypes/callproc.c',
- '_ctypes/stgdict.c',
-- '_ctypes/cfield.c',
-- '_ctypes/malloc_closure.c']
-+ '_ctypes/cfield.c']
- depends = ['_ctypes/ctypes.h']
-
- if sys.platform == 'darwin':
diff --git a/python-3.2b2-fix-ppc-debug-build.patch
b/python-3.2b2-fix-ppc-debug-build.patch
deleted file mode 100644
index e9c7176..0000000
--- a/python-3.2b2-fix-ppc-debug-build.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-diff -up Python-3.2b2/Python/ceval.c.fix-ppc-debug-build Python-3.2b2/Python/ceval.c
---- Python-3.2b2/Python/ceval.c.fix-ppc-debug-build 2011-01-05 16:37:27.007598805 -0500
-+++ Python-3.2b2/Python/ceval.c 2011-01-05 16:45:06.562652472 -0500
-@@ -30,10 +30,11 @@
-
- typedef unsigned long long uint64;
-
--#if defined(__ppc__) /* <- Don't know if this is the correct symbol; this
-- section should work for GCC on any PowerPC
-- platform, irrespective of OS.
-- POWER? Who knows :-) */
-+/* PowerPC suppport.
-+ "__ppc__" appears to be the preprocessor definition to detect on OS X,
whereas
-+ "__powerpc__" appears to be the correct one for Linux with GCC
-+*/
-+#if defined(__ppc__) || defined (__powerpc__)
-
- #define READ_TIMESTAMP(var) ppc_getcounter(&var)
-
diff --git a/python.spec b/python.spec
index ada986f..869461b 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.12
-Release: 3%{?dist}
+Release: 4%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -344,9 +344,6 @@ Patch17: python-2.6.4-distutils-rpath.patch
# for 2.7rc1 by dmalcolm:
Patch55: 00055-systemtap.patch
-# Upstream as of Python 2.7.4
-# Patch101: 00101-lib64-regex.patch
-
# Only used when "%{_lib}" == "lib64"
# Fixup various paths throughout the build and in distutils from "lib" to
"lib64",
# and add the /usr/lib64/pythonMAJOR.MINOR/site-packages to sitedirs, in front of
@@ -450,9 +447,6 @@ Patch113: 00113-more-configuration-flags.patch
# Not yet sent upstream
Patch114: 00114-statvfs-f_flag-constants.patch
-# Upstream as of Python 2.7.3:
-# Patch115: make-pydoc-more-robust-001.patch
-
# Upstream r79310 removed the "Modules" directory from sys.path when Python is
# running from the build directory on POSIX to fix a unit test (issue #8205).
# This seems to have broken the compileall.py done in "make install": it
cannot
@@ -476,12 +470,6 @@ Patch121: 00121-add-Modules-to-build-path.patch
# Not yet sent upstream
Patch125: 00125-less-verbose-COUNT_ALLOCS.patch
-# Upstream as of Python 2.7.5
-# Patch126: fix-dbm_contains-on-64bit-bigendian.patch
-
-# Upstream as of Python 2.7.5
-# Patch127: fix-test_structmember-on-64bit-bigendian.patch
-
# 2.7.1 (in r84230) added a test to test_abc which fails if python is
# configured with COUNT_ALLOCS, which is the case for our debug build
# (the COUNT_ALLOCS instrumentation keeps "C" alive).
@@ -583,10 +571,6 @@ Patch143: 00143-tsc-on-ppc.patch
# (Optionally) disable the gdbm module:
Patch144: 00144-no-gdbm.patch
-# 00145 #
-# Upstream as of Python 2.7.3:
-# Patch145: 00145-force-sys-platform-to-be-linux2.patch
-
# 00146 #
# Support OpenSSL FIPS mode (e.g. when OPENSSL_FORCE_FIPS_MODE=1 is set)
# - handle failures from OpenSSL (e.g. on attempts to use MD5 in a
@@ -611,28 +595,6 @@ Patch146: 00146-hashlib-fips.patch
# Sent upstream as
http://bugs.python.org/issue14785
Patch147: 00147-add-debug-malloc-stats.patch
-# 00148 #
-# Upstream as of Python 2.7.3:
-# Patch148: 00148-gdbm-1.9-magic-values.patch
-
-# 00149 #
-# python3.spec's
-# Patch149: 00149-backport-issue11254-pycache-bytecompilation-fix.patch
-# is not relevant for Python 2
-
-# 00150 #
-# python3.spec has:
-# Patch150: 00150-disable-rAssertAlmostEqual-cmath-on-ppc.patch
-# as a workaround for a glibc bug on PPC (bz #750811)
-
-# 00151 #
-# Upstream as of Python 2.7.3:
-# Patch151: 00151-fork-deadlock.patch
-
-# 00152 #
-# python3.spec has:
-# Patch152: 00152-fix-test-gdb-regex.patch
-
# 00153 #
# Strip out lines of the form "warning: Unable to open ..." from gdb's
stderr
# when running test_gdb.py; also cope with change to gdb in F17 onwards in
@@ -640,10 +602,6 @@ Patch147: 00147-add-debug-malloc-stats.patch
# Not yet sent upstream
Patch153: 00153-fix-test_gdb-noise.patch
-# 00154 #
-# python3.spec on f15 has:
-# Patch154: 00154-skip-urllib-test-requiring-working-DNS.patch
-
# 00155 #
# Avoid allocating thunks in ctypes unless absolutely necessary, to avoid
# generating SELinux denials on "import ctypes" and "import uuid"
when
@@ -673,31 +631,6 @@ Patch156: 00156-gdb-autoload-safepath.patch
# (rhbz#697470)
Patch157: 00157-uid-gid-overflows.patch
-# Upstream as of Python 2.7.4
-# Patch158: 00158-fix-hashlib-leak.patch
-
-# 00160 #
-# python3.spec's
-# Patch160: 00160-disable-test_fs_holes-in-rpm-build.patch
-# is not relevant for Python 2
-
-# 00161 #
-# python3.spec has:
-# Patch161: 00161-fix-test_tools-directory.patch
-# which will likely become relevant for Python 2 next time we rebase
-
-# 00162 #
-# python3.spec has:
-# Patch162: 00162-distutils-sysconfig-fix-CC-options.patch
-
-# 00163 #
-# python3.spec has:
-# Patch163: 00163-disable-parts-of-test_socket-in-rpm-build.patch
-
-# 00164 #
-# python3.spec has:
-# Patch164: 00164-disable-interrupted_write-tests-on-ppc.patch
-
# 00165 #
# Backport to Python 2 from Python 3.3 of improvements to the "crypt" module
# adding precanned ways of salting a password (rhbz#835021)
@@ -707,16 +640,6 @@ Patch157: 00157-uid-gid-overflows.patch
# within 2.7
Patch165: 00165-crypt-module-salt-backport.patch
-# 00166 #
-# Bulletproof the gdb debugging hooks against the case where co_filename for
-# a frame can't be read from the inferior process (rhbz#912025)
-#
-# Not yet sent upstream
-# This issue seems to have been fixed most probably by
https://bugs.python.org/issue26799
-# as of Python 2.7.12 and test_gdb seems to fail with the patch applied
-# so dropping it for now.
-#Patch166: 00166-fix-fake-repr-in-gdb-hooks.patch
-
# 00167 #
# Don't run any of the stack navigation tests in test_gdb when Python is
# optimized, since there appear to be many different ways in which gdb can
@@ -757,12 +680,6 @@ Patch169: 00169-avoid-implicit-usage-of-md5-in-multiprocessing.patch
# (rhbz#850013)
Patch170: 00170-gc-assertions.patch
-# Upstream as of Python 2.7.4
-# Patch171: 00171-raise-correct-exception-when-dev-urandom-is-missing.patch
-
-# Upstream as of Python 2.7.4
-# Patch172: 00172-use-poll-for-multiprocessing-socket-connection.patch
-
# 00173 #
# Workaround for ENOPROTOOPT seen in Koji within
# test.test_support.bind_port()
@@ -777,30 +694,6 @@ Patch173: 00173-workaround-ENOPROTOOPT-in-bind_port.patch
# e.g. cmpi-bindings under systemd (rhbz#817554):
Patch174: 00174-fix-for-usr-move.patch
-# 00175 #
-# Upstream as of Python 2.7.5
-# Patch175: 00175-fix-configure-Wformat.patch
-
-# 00176 #
-# python3.spec had:
-# Patch176: 00176-upstream-issue16754-so-extension.patch
-# doesn't affect python2
-
-# 00177 #
-# python3.spec has
-# Patch177: 00177-platform-unicode.patch
-# Does not affect python2
-
-# 00178 #
-# python3.spec has
-# Patch178: 00178-dont-duplicate-flags-in-sysconfig.patch
-# Does not affect python2 AFAICS (different sysconfig values initialization)
-
-# 00179 #
-# python3.spec has
-# Patch179: 00179-dont-raise-error-on-gdb-corrupted-frames-in-backtrace.patch
-# Doesn't seem to affect python2
-
# 00180 #
# Enable building on ppc64p7
# Not appropriate for upstream, Fedora-specific naming
@@ -815,14 +708,6 @@ Patch180: 00180-python-add-support-for-ppc64p7.patch
# Doesn't apply to Python 3, where this is fixed otherwise and works.
Patch181: 00181-allow-arbitrary-timeout-in-condition-wait.patch
-# 00182 #
-# python3.spec had
-# Patch182: 00182-fix-test_gdb-test_threads.patch
-
-# 00183 #
-# python3.spec has
-# Patch183: 00183-cve-2013-2099-fix-ssl-match_hostname-dos.patch
-
# 00184 #
# Fix for
https://bugzilla.redhat.com/show_bug.cgi?id=979696
# Fixes build of ctypes against libffi with multilib wrapper
@@ -850,23 +735,10 @@ Patch187: 00187-add-RPATH-to-pyexpat.patch
# rhbz#1008154 (patch by Attila Fazekas)
Patch189: 00189-gdb-py-bt-dont-raise-exception-from-eval.patch
-# 00190 #
-# Importing get_python_version in bdist_rpm
-#
http://bugs.python.org/issue18045
-# rhbz#1029082
-# FIXED UPSTREAM
-#Patch190: 00190-get_python_version.patch
-
# 00191 #
# Disabling NOOP test as it fails without internet connection
Patch191: 00191-disable-NOOP.patch
-# 00192 #
-# Fixing buffer overflow (upstream patch)
-# rhbz#1062375
-# FIXED UPSTREAM
-#Patch192: 00192-buffer-overflow.patch
-
# 00193 #
# Enable loading sqlite extensions. This patch isn't needed for
# python3.spec, since Python 3 has a configuration option for this.
@@ -874,35 +746,6 @@ Patch191: 00191-disable-NOOP.patch
# Patch provided by John C. Peterson
Patch193: 00193-enable-loading-sqlite-extensions.patch
-# 00194 #
-# Fix tests with SQLite >= 3.8.4
-#
http://bugs.python.org/issue20901
-#
http://hg.python.org/cpython/raw-rev/1763e27a182d
-# FIXED UPSTREAM
-#Patch194: 00194-fix-tests-with-sqlite-3.8.4.patch
-
-# 00195 #
-# Since openssl-1.0.1h-5.fc21 SSLv2 and SSLV3 protocols
-# are disabled by default in openssl, according the comment in openssl
-# patch this affects only SSLv23_method, this patch enables SSLv2
-# and SSLv3 when SSLv23_method is used
-# Update:
-# Patch disabled, Openssl reverted disabling sslv3 and now
-# disables only sslv2 all tests pass
-#Patch195: 00195-enable-sslv23-in-ssl.patch
-
-# 00196 #
-#
http://bugs.python.org/issue21308
-# Backport of ssl module from python3
-# FIXED UPSTREAM
-# Patch196: 00196-ssl-backport.patch
-
-# 00197 #
-#
http://bugs.python.org/issue22023
-# Patch seg fault in unicodeobject.c
-# FIXED UPSTREAM
-# Patch197: 00197-unicode_fromformat.patch
-
# 00198 #
%if 0%{with_rewheel}
Patch198: 00198-add-rewheel-module.patch
@@ -920,23 +763,6 @@ Patch200: 00200-skip-thread-test.patch
# FIXED UPSTREAM:
http://bugs.python.org/issue27369
Patch209: 00209-fix-test-pyexpat-failure.patch
-# 00237 #
-# CVE-2016-0772 python: smtplib StartTLS stripping attack
-# rhbz#1303647:
https://bugzilla.redhat.com/show_bug.cgi?id=1303647
-# rhbz#1346344:
https://bugzilla.redhat.com/show_bug.cgi?id=1346344
-# FIXED UPSTREAM:
https://hg.python.org/cpython/rev/b3ce713fb9be
-# Raise an error when STARTTLS fails
-# Patch237: 00237-Raise-an-error-when-STARTTLS-fails.patch
-
-# 00241 #
-# CVE-2016-5636:
http://seclists.org/oss-sec/2016/q2/560
-# rhbz#1345858:
https://bugzilla.redhat.com/show_bug.cgi?id=1345858
-#
https://hg.python.org/cpython/rev/985fc64c60d6/
-#
https://hg.python.org/cpython/rev/2edbdb79cd6d
-# Fix possible integer overflow and heap corruption in zipimporter.get_data()
-# FIXED UPSTREAM:
https://bugs.python.org/issue26171
-#Patch241: 00241-CVE-2016-5636-buffer-overflow-in-zipimport-module-fix.patch
-
# 00242 #
# HTTPoxy attack (CVE-2016-1000110)
#
https://httpoxy.org/
@@ -945,10 +771,6 @@ Patch209: 00209-fix-test-pyexpat-failure.patch
# Resolves: rhbz#1359175
Patch242: 00242-CVE-2016-1000110-httpoxy.patch
-# 00243 #
-# Patch243: 00243-fix-mips64-triplet.patch
-# only necessary for python3
-
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora, EL,
etc.,
@@ -1185,10 +1007,6 @@ done
%patch6 -p1 -b .plural
%patch7 -p1
-# Try not disabling egg-infos, bz#414711
-#patch50 -p1 -b .egginfo
-
-# patch101: upstream as of Python 2.7.4
%if "%{_lib}" == "lib64"
%patch102 -p1 -b .lib64
%patch103 -p1 -b .lib64-sysconfig
@@ -1196,7 +1014,6 @@ done
%endif
%patch10 -p1 -b .binutils-no-dep
-# patch11: upstream as of Python 2.7.3
%patch13 -p1 -b .socketmodule
%patch14 -p1 -b .socketmodule2
%patch16 -p1 -b .rpath
@@ -1214,12 +1031,9 @@ done
%patch114 -p1 -b .statvfs-f-flag-constants
-# patch115: upstream as of Python 2.7.3
%patch121 -p1
%patch125 -p1 -b .less-verbose-COUNT_ALLOCS
-# 00126: upstream as of Python 2.7.5
-# 00127: upstream as of Python 2.7.5
%patch128 -p1
%patch130 -p1
@@ -1247,64 +1061,33 @@ done
%if !%{with_gdbm}
%patch144 -p1
%endif
-# 00145: upstream as of Python 2.7.3
%patch146 -p1
%patch147 -p1
-# 00148: upstream as of Python 2.7.3
-# 00149: not for python 2
-# 00150: not for python 2
-# 00151: upstream as of Python 2.7.3
-# 00152: not for python 2
%patch153 -p0
-# 00154: not for python 2
%patch155 -p1
%patch156 -p1
%patch157 -p1
-# 00158: upstream as of Python 2.7.4
-# 00160: not for python 2
-# 00161: not for python 2 yet
-# 00162: not for python 2 yet
-# 00163: not for python 2 yet
-# 00164: not for python 2 yet
%patch165 -p1
mv Modules/cryptmodule.c Modules/_cryptmodule.c
-# 00166: dropped as of Python 2.7.12
%patch167 -p1
%patch168 -p1
%patch169 -p1
%patch170 -p1
-# 00171: upstream as of Python 2.7.4
-# 00171: upstream as of Python 2.7.4
%patch173 -p1
%patch174 -p1 -b .fix-for-usr-move
-# 00175: upstream as of Python 2.7.5
-# 00176: not for python 2
-# 00177: not for python 2
-# 00178: not for python 2
-# 00179: not for python 2
%patch180 -p1
%patch181 -p1
-# 00182: not for python 2
-# 00183: not for python 2
%patch184 -p1
%patch185 -p1
%patch187 -p1
%patch189 -p1
-# 00190: upstream as of Python 2.7.7
%patch191 -p1
-# 00192: upstream as of Python 2.7.7
%patch193 -p1
-# 00194: upstream as of Python 2.7.7
-#%patch195 -p1
-# 00196: upstream as of Python 2.7.9
-# 00197: upstream as of Python 2.7.9
%if 0%{with_rewheel}
%patch198 -p1
%endif
%patch200 -p1
%patch209 -p1
-# 00237: upstream as of Python 2.7.12
-# 00241: upstream as of Python 2.7.12
%patch242 -p1
@@ -2160,6 +1943,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Tue Aug 09 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-4
+- SPEC file cleanup
+- Removal of unapplied patches
+
* Tue Aug 09 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-3
- Fix for CVE-2016-1000110 HTTPoxy attack
- SPEC file cleanup
commit a75935795853a9a223715136afb5a61b7cb34b93
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Tue Aug 9 15:27:04 2016 +0200
Fix for CVE-2016-1000110 HTTPoxy attack
diff --git a/00209-CVE-2016-5636-buffer-overflow-in-zipimport-module-fix.patch
b/00209-CVE-2016-5636-buffer-overflow-in-zipimport-module-fix.patch
deleted file mode 100644
index f166d01..0000000
--- a/00209-CVE-2016-5636-buffer-overflow-in-zipimport-module-fix.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From 0f12cb75c708978f9201c1dd3464d2a8572b4544 Mon Sep 17 00:00:00 2001
-From: Charalampos Stratakis <cstratak(a)redhat.com>
-Date: Fri, 8 Jul 2016 20:24:10 +0200
-Subject: [PATCH] CVE-2016-5636 fix
-
----
- Modules/zipimport.c | 9 +++++++++
- 1 file changed, 9 insertions(+)
-
-diff --git a/Modules/zipimport.c b/Modules/zipimport.c
-index 7240cb4..2e6a61f 100644
---- a/Modules/zipimport.c
-+++ b/Modules/zipimport.c
-@@ -861,6 +861,10 @@ get_data(char *archive, PyObject *toc_entry)
- &date, &crc)) {
- return NULL;
- }
-+ if (data_size < 0) {
-+ PyErr_Format(ZipImportError, "negative data size");
-+ return NULL;
-+ }
-
- fp = fopen(archive, "rb");
- if (!fp) {
-@@ -895,6 +899,11 @@ get_data(char *archive, PyObject *toc_entry)
- PyMarshal_ReadShortFromFile(fp); /* local header size */
- file_offset += l; /* Start of file data */
-
-+ if (data_size > LONG_MAX - 1) {
-+ fclose(fp);
-+ PyErr_NoMemory();
-+ return NULL;
-+ }
- raw_data = PyString_FromStringAndSize((char *)NULL, compress == 0 ?
- data_size : data_size + 1);
- if (raw_data == NULL) {
---
-2.7.4
-
diff --git a/00209-fix-test-pyexpat-failure.patch b/00209-fix-test-pyexpat-failure.patch
new file mode 100644
index 0000000..f14a19b
--- /dev/null
+++ b/00209-fix-test-pyexpat-failure.patch
@@ -0,0 +1,18 @@
+diff --git a/Lib/test/test_pyexpat.py b/Lib/test/test_pyexpat.py
+index eba9058..2c8a164 100644
+--- a/Lib/test/test_pyexpat.py
++++ b/Lib/test/test_pyexpat.py
+@@ -610,11 +610,9 @@ class MalformedInputText(unittest.TestCase):
+ def test2(self):
+ xml = "<?xml version\xc2\x85='1.0'?>\r\n"
+ parser = expat.ParserCreate()
+- try:
++ err_pattern = r'XML declaration not well-formed: line 1, column \d+'
++ with self.assertRaisesRegexp(expat.ExpatError, err_pattern):
+ parser.Parse(xml, True)
+- self.fail()
+- except expat.ExpatError as e:
+- self.assertEqual(str(e), 'XML declaration not well-formed: line 1,
column 14')
+
+ class ForeignDTDTests(unittest.TestCase):
+ """
diff --git a/00210-Raise-an-error-when-STARTTLS-fails.patch
b/00210-Raise-an-error-when-STARTTLS-fails.patch
deleted file mode 100644
index 324749d..0000000
--- a/00210-Raise-an-error-when-STARTTLS-fails.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From c2c98ddde2665d12e34f17c4eac90832df720114 Mon Sep 17 00:00:00 2001
-From: Tomas Orsava <torsava(a)redhat.com>
-Date: Thu, 16 Jun 2016 18:56:18 +0200
-Subject: [PATCH] Raise an error when STARTTLS fails
-
-CVE-2016-0772 python: smtplib StartTLS stripping attack
-rhbz#1303647:
https://bugzilla.redhat.com/show_bug.cgi?id=1303647
-rhbz#1346344:
https://bugzilla.redhat.com/show_bug.cgi?id=1346344
-
-Based on an upstream change by Benjamin Peterson <benjamin(a)python.org>
-- in changeset 101886:b3ce713fb9be 2.7
--
https://hg.python.org/cpython/rev/b3ce713fb9be
----
- Lib/smtplib.py | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/Lib/smtplib.py b/Lib/smtplib.py
-index 8388b98..e1651c0 100755
---- a/Lib/smtplib.py
-+++ b/Lib/smtplib.py
-@@ -656,6 +656,11 @@ class SMTP:
- self.ehlo_resp = None
- self.esmtp_features = {}
- self.does_esmtp = 0
-+ else:
-+ # RFC 3207:
-+ # 501 Syntax error (no parameters allowed)
-+ # 454 TLS not available due to temporary reason
-+ raise SMTPResponseException(resp, reply)
- return (resp, reply)
-
- def sendmail(self, from_addr, to_addrs, msg, mail_options=[],
---
-2.5.5
-
diff --git a/00211-fix-test-pyexpat-failure.patch b/00211-fix-test-pyexpat-failure.patch
deleted file mode 100644
index f14a19b..0000000
--- a/00211-fix-test-pyexpat-failure.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-diff --git a/Lib/test/test_pyexpat.py b/Lib/test/test_pyexpat.py
-index eba9058..2c8a164 100644
---- a/Lib/test/test_pyexpat.py
-+++ b/Lib/test/test_pyexpat.py
-@@ -610,11 +610,9 @@ class MalformedInputText(unittest.TestCase):
- def test2(self):
- xml = "<?xml version\xc2\x85='1.0'?>\r\n"
- parser = expat.ParserCreate()
-- try:
-+ err_pattern = r'XML declaration not well-formed: line 1, column \d+'
-+ with self.assertRaisesRegexp(expat.ExpatError, err_pattern):
- parser.Parse(xml, True)
-- self.fail()
-- except expat.ExpatError as e:
-- self.assertEqual(str(e), 'XML declaration not well-formed: line 1,
column 14')
-
- class ForeignDTDTests(unittest.TestCase):
- """
diff --git a/00242-CVE-2016-1000110-httpoxy.patch b/00242-CVE-2016-1000110-httpoxy.patch
new file mode 100644
index 0000000..d644e8c
--- /dev/null
+++ b/00242-CVE-2016-1000110-httpoxy.patch
@@ -0,0 +1,111 @@
+
+# HG changeset patch
+# User Senthil Kumaran <senthil(a)uthcode.com>
+# Date 1469882993 25200
+# Node ID ba915d561667fa0584ad89f8d5a844fd43803c0d
+# Parent c8c1ea94379a7706638f1571988576d504d7fc98
+Prevent HTTPoxy attack (CVE-2016-1000110)
+
+Ignore the HTTP_PROXY variable when REQUEST_METHOD environment is set, which
+indicates that the script is in CGI mode.
+
+Issue reported and patch contributed by Rmi Rampin.
+
+diff --git a/Doc/howto/urllib2.rst b/Doc/howto/urllib2.rst
+--- a/Doc/howto/urllib2.rst
++++ b/Doc/howto/urllib2.rst
+@@ -525,6 +525,11 @@ setting up a `Basic Authentication`_ han
+ through a proxy. However, this can be enabled by extending urllib2 as
+ shown in the recipe [#]_.
+
++.. note::
++
++ ``HTTP_PROXY`` will be ignored if a variable ``REQUEST_METHOD`` is set; see
++ the documentation on :func:`~urllib.getproxies`.
++
+
+ Sockets and Layers
+ ==================
+diff --git a/Doc/library/urllib.rst b/Doc/library/urllib.rst
+--- a/Doc/library/urllib.rst
++++ b/Doc/library/urllib.rst
+@@ -295,6 +295,16 @@ Utility functions
+ If both lowercase and uppercase environment variables exist (and disagree),
+ lowercase is preferred.
+
++ .. note::
++
++ If the environment variable ``REQUEST_METHOD`` is set, which usually
++ indicates your script is running in a CGI environment, the environment
++ variable ``HTTP_PROXY`` (uppercase ``_PROXY``) will be ignored. This is
++ because that variable can be injected by a client using the "Proxy:"
++ HTTP header. If you need to use an HTTP proxy in a CGI environment,
++ either use ``ProxyHandler`` explicitly, or make sure the variable name
++ is in lowercase (or at least the ``_proxy`` suffix).
++
+ .. note::
+ urllib also exposes certain utility functions like splittype, splithost and
+ others parsing URL into various components. But it is recommended to use
+diff --git a/Doc/library/urllib2.rst b/Doc/library/urllib2.rst
+--- a/Doc/library/urllib2.rst
++++ b/Doc/library/urllib2.rst
+@@ -229,6 +229,11 @@ The following classes are provided:
+
+ To disable autodetected proxy pass an empty dictionary.
+
++ .. note::
++
++ ``HTTP_PROXY`` will be ignored if a variable ``REQUEST_METHOD`` is set;
++ see the documentation on :func:`~urllib.getproxies`.
++
+
+ .. class:: HTTPPasswordMgr()
+
+diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py
+--- a/Lib/test/test_urllib.py
++++ b/Lib/test/test_urllib.py
+@@ -170,6 +170,18 @@ class ProxyTests(unittest.TestCase):
+
self.assertTrue(urllib.proxy_bypass_environment('anotherdomain.com:8888'))
+ self.assertTrue(urllib.proxy_bypass_environment('newdomain.com:1234'))
+
++ def test_proxy_cgi_ignore(self):
++ try:
++ self.env.set('HTTP_PROXY', 'http://somewhere:3128')
++ proxies = urllib.getproxies_environment()
++ self.assertEqual('http://somewhere:3128', proxies['http'])
++ self.env.set('REQUEST_METHOD', 'GET')
++ proxies = urllib.getproxies_environment()
++ self.assertNotIn('http', proxies)
++ finally:
++ self.env.unset('REQUEST_METHOD')
++ self.env.unset('HTTP_PROXY')
++
+ def test_proxy_bypass_environment_host_match(self):
+ bypass = urllib.proxy_bypass_environment
+ self.env.set('NO_PROXY',
+diff --git a/Lib/urllib.py b/Lib/urllib.py
+--- a/Lib/urllib.py
++++ b/Lib/urllib.py
+@@ -1380,12 +1380,21 @@ def getproxies_environment():
+ If you need a different way, you can pass a proxies dictionary to the
+ [Fancy]URLopener constructor.
+ """
++ # Get all variables
+ proxies = {}
+ for name, value in os.environ.items():
+ name = name.lower()
+ if value and name[-6:] == '_proxy':
+ proxies[name[:-6]] = value
+
++ # CVE-2016-1000110 - If we are running as CGI script, forget HTTP_PROXY
++ # (non-all-lowercase) as it may be set from the web server by a "Proxy:"
++ # header from the client
++ # If "proxy" is lowercase, it will still be used thanks to the next block
++ if 'REQUEST_METHOD' in os.environ:
++ proxies.pop('http', None)
++
++ # Get lowercase variables
+ for name, value in os.environ.items():
+ if name[-6:] == '_proxy':
+ name = name.lower()
+
diff --git a/python.spec b/python.spec
index ea86c19..ada986f 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.12
-Release: 2%{?dist}
+Release: 3%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -915,27 +915,35 @@ Patch198: 00198-add-rewheel-module.patch
Patch200: 00200-skip-thread-test.patch
# 00209 #
-# CVE-2016-5636:
http://seclists.org/oss-sec/2016/q2/560
-# rhbz#1345858:
https://bugzilla.redhat.com/show_bug.cgi?id=1345858
-#
https://hg.python.org/cpython/rev/985fc64c60d6/
-#
https://hg.python.org/cpython/rev/2edbdb79cd6d
-# Fix possible integer overflow and heap corruption in zipimporter.get_data()
-# FIXED UPSTREAM:
https://bugs.python.org/issue26171
-#Patch209: 00209-CVE-2016-5636-buffer-overflow-in-zipimport-module-fix.patch
+# Fix test breakage with version 2.2.0 of Expat
+# rhbz#1353919:
https://bugzilla.redhat.com/show_bug.cgi?id=1353919
+# FIXED UPSTREAM:
http://bugs.python.org/issue27369
+Patch209: 00209-fix-test-pyexpat-failure.patch
-# 00210 #
+# 00237 #
# CVE-2016-0772 python: smtplib StartTLS stripping attack
# rhbz#1303647:
https://bugzilla.redhat.com/show_bug.cgi?id=1303647
# rhbz#1346344:
https://bugzilla.redhat.com/show_bug.cgi?id=1346344
# FIXED UPSTREAM:
https://hg.python.org/cpython/rev/b3ce713fb9be
# Raise an error when STARTTLS fails
-# Patch210: 00210-Raise-an-error-when-STARTTLS-fails.patch
+# Patch237: 00237-Raise-an-error-when-STARTTLS-fails.patch
-# 00211 #
-# Fix test breakage with version 2.2.0 of Expat
-# rhbz#1353919:
https://bugzilla.redhat.com/show_bug.cgi?id=1353919
-# FIXED UPSTREAM:
http://bugs.python.org/issue27369
-Patch211: 00211-fix-test-pyexpat-failure.patch
+# 00241 #
+# CVE-2016-5636:
http://seclists.org/oss-sec/2016/q2/560
+# rhbz#1345858:
https://bugzilla.redhat.com/show_bug.cgi?id=1345858
+#
https://hg.python.org/cpython/rev/985fc64c60d6/
+#
https://hg.python.org/cpython/rev/2edbdb79cd6d
+# Fix possible integer overflow and heap corruption in zipimporter.get_data()
+# FIXED UPSTREAM:
https://bugs.python.org/issue26171
+#Patch241: 00241-CVE-2016-5636-buffer-overflow-in-zipimport-module-fix.patch
+
+# 00242 #
+# HTTPoxy attack (CVE-2016-1000110)
+#
https://httpoxy.org/
+# FIXED UPSTREAM:
http://bugs.python.org/issue27568
+# Based on a patch by Rmi Rampin
+# Resolves: rhbz#1359175
+Patch242: 00242-CVE-2016-1000110-httpoxy.patch
# 00243 #
# Patch243: 00243-fix-mips64-triplet.patch
@@ -943,23 +951,12 @@ Patch211: 00211-fix-test-pyexpat-failure.patch
# (New patches go here ^^^)
#
-# When adding new patches to "python" and "python3" in Fedora 17
onwards,
-# please try to keep the patch numbers in-sync between the two specfiles:
-#
-# - use the same patch number across both specfiles for conceptually-equivalent
-# fixes, ideally with the same name
+# When adding new patches to "python" and "python3" in Fedora, EL,
etc.,
+# please try to keep the patch numbers in-sync between all specfiles.
#
-# - when a patch is relevant to both specfiles, use the same introductory
-# comment in both specfiles where possible (to improve "diff" output when
-# comparing them)
+# More information, and a patch number catalog, is at:
#
-# - when a patch is only relevant for one of the two specfiles, leave a gap
-# in the patch numbering in the other specfile, adding a comment when
-# omitting a patch, both in the manifest section here, and in the "prep"
-# phase below
-#
-# Hopefully this will make it easier to ensure that all relevant fixes are
-# applied to both versions.
+#
https://fedoraproject.org/wiki/SIGs/Python/PythonPatches
# This is the generated patch to "configure"; see the description of
# %{regenerate_autotooling_patch}
@@ -1305,9 +1302,10 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch198 -p1
%endif
%patch200 -p1
-# 00209: upstream as of Python 2.7.12
-# 00210: upstream as of Python 2.7.12
-%patch211 -p1
+%patch209 -p1
+# 00237: upstream as of Python 2.7.12
+# 00241: upstream as of Python 2.7.12
+%patch242 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -2162,6 +2160,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Tue Aug 09 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-3
+- Fix for CVE-2016-1000110 HTTPoxy attack
+- SPEC file cleanup
+
* Mon Aug 01 2016 Michal Toman <mtoman(a)fedoraproject.org> - 2.7.12-2
- Build properly on MIPS
commit 3f17ce7e158e45f20afdbf14674754cac70702b6
Author: Michal Toman <mtoman(a)fedoraproject.org>
Date: Mon Aug 1 20:23:04 2016 +0200
Build properly on MIPS
diff --git a/python.spec b/python.spec
index 65f6c8a..ea86c19 100644
--- a/python.spec
+++ b/python.spec
@@ -47,7 +47,7 @@
%global with_systemtap 1
# some arches don't have valgrind so we need to disable its support on them
-%ifnarch s390
+%ifnarch s390 %{mips}
%global with_valgrind 1
%else
%global with_valgrind 0
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.12
-Release: 1%{?dist}
+Release: 2%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -937,6 +937,10 @@ Patch200: 00200-skip-thread-test.patch
# FIXED UPSTREAM:
http://bugs.python.org/issue27369
Patch211: 00211-fix-test-pyexpat-failure.patch
+# 00243 #
+# Patch243: 00243-fix-mips64-triplet.patch
+# only necessary for python3
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -1622,7 +1626,7 @@ install -d
%{buildroot}/%{_prefix}/lib/python%{pybasever}/site-packages
%global _pyconfig32_h pyconfig-32.h
%global _pyconfig64_h pyconfig-64.h
-%ifarch %{power64} s390x x86_64 ia64 alpha sparc64 aarch64
+%ifarch %{power64} s390x x86_64 ia64 alpha sparc64 aarch64 %{mips64}
%global _pyconfig_h %{_pyconfig64_h}
%else
%global _pyconfig_h %{_pyconfig32_h}
@@ -1691,7 +1695,7 @@ done
# Install a tapset for this libpython into tapsetdir, fixing up the path to the
# library:
mkdir -p %{buildroot}%{tapsetdir}
-%ifarch %{power64} s390x x86_64 ia64 alpha sparc64 aarch64
+%ifarch %{power64} s390x x86_64 ia64 alpha sparc64 aarch64 %{mips64}
%global libpython_stp_optimized libpython%{pybasever}-64.stp
%global libpython_stp_debug libpython%{pybasever}-debug-64.stp
%else
@@ -1738,9 +1742,12 @@ CheckPython() {
EXTRATESTOPTS="--verbose"
-%ifarch s390 s390x %{power64} %{arm} aarch64
+%ifarch s390 s390x %{power64} %{arm} aarch64 %{mips}
EXTRATESTOPTS="$EXTRATESTOPTS -x test_gdb"
%endif
+%ifarch %{mips64}
+ EXTRATESTOPTS="$EXTRATESTOPTS -x test_ctypes"
+%endif
%if 0%{?with_huntrleaks}
# Try to detect reference leaks on debug builds. By default this means
@@ -2155,6 +2162,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Mon Aug 01 2016 Michal Toman <mtoman(a)fedoraproject.org> - 2.7.12-2
+- Build properly on MIPS
+
* Fri Jul 15 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-1
- Update to 2.7.12
- Refactored patches: 10, 102, 112, 134, 153
commit 9931502d13c015eda5a01e823faef4604d2efb9e
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Mon Jul 18 10:46:32 2016 +0200
Sources for 2.7.12
diff --git a/sources b/sources
index 827a703..dfb032e 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-1dbcc848b4cd8399a8199d000f9f823c Python-2.7.11.tar.xz
+57dffcee9cee8bb2ab5f82af1d8e9a69 Python-2.7.12.tar.xz
commit 31c533489bdfaa8066bac7d8fa4a33fdc1405bf6
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Sun Jul 17 22:28:26 2016 +0200
Update to 2.7.12
diff --git a/00010-2.7.12-binutils-no-dep.patch b/00010-2.7.12-binutils-no-dep.patch
new file mode 100644
index 0000000..d74dbf9
--- /dev/null
+++ b/00010-2.7.12-binutils-no-dep.patch
@@ -0,0 +1,15 @@
+diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py
+index b2c514d..d92af0c 100644
+--- a/Lib/ctypes/util.py
++++ b/Lib/ctypes/util.py
+@@ -139,7 +139,9 @@ elif os.name == "posix":
+ finally:
+ rv = f.close()
+ if rv == 10:
+- raise OSError, 'objdump command not found'
++ return os.path.basename(f) # This is good for GLibc, I think,
++ # and a dep on binutils is big (for
++ # live CDs).
+ res = re.search(r'\sSONAME\s+([^\s]+)', dump)
+ if not res:
+ return None
diff --git a/00102-2.7.12-lib64.patch b/00102-2.7.12-lib64.patch
new file mode 100644
index 0000000..00c835c
--- /dev/null
+++ b/00102-2.7.12-lib64.patch
@@ -0,0 +1,184 @@
+diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
+index b9f1c6c..7b23714 100644
+--- a/Lib/distutils/command/install.py
++++ b/Lib/distutils/command/install.py
+@@ -42,14 +42,14 @@ else:
+ INSTALL_SCHEMES = {
+ 'unix_prefix': {
+ 'purelib': '$base/lib/python$py_version_short/site-packages',
+- 'platlib':
'$platbase/lib/python$py_version_short/site-packages',
++ 'platlib':
'$platbase/lib64/python$py_version_short/site-packages',
+ 'headers': '$base/include/python$py_version_short/$dist_name',
+ 'scripts': '$base/bin',
+ 'data' : '$base',
+ },
+ 'unix_home': {
+ 'purelib': '$base/lib/python',
+- 'platlib': '$base/lib/python',
++ 'platlib': '$base/lib64/python',
+ 'headers': '$base/include/python/$dist_name',
+ 'scripts': '$base/bin',
+ 'data' : '$base',
+diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
+index 068d1ba..3e7f077 100644
+--- a/Lib/distutils/sysconfig.py
++++ b/Lib/distutils/sysconfig.py
+@@ -119,8 +119,12 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
+ prefix = plat_specific and EXEC_PREFIX or PREFIX
+
+ if os.name == "posix":
++ if plat_specific or standard_lib:
++ lib = "lib64"
++ else:
++ lib = "lib"
+ libpython = os.path.join(prefix,
+- "lib", "python" +
get_python_version())
++ lib, "python" + get_python_version())
+ if standard_lib:
+ return libpython
+ else:
+diff --git a/Lib/site.py b/Lib/site.py
+index e8433b4..e8e6b50 100644
+--- a/Lib/site.py
++++ b/Lib/site.py
+@@ -288,12 +288,16 @@ def getsitepackages():
+ if sys.platform in ('os2emx', 'riscos'):
+ sitepackages.append(os.path.join(prefix, "Lib",
"site-packages"))
+ elif os.sep == '/':
++ sitepackages.append(os.path.join(prefix, "lib64",
++ "python" + sys.version[:3],
++ "site-packages"))
+ sitepackages.append(os.path.join(prefix, "lib",
+ "python" + sys.version[:3],
+ "site-packages"))
+ sitepackages.append(os.path.join(prefix, "lib",
"site-python"))
+ else:
+ sitepackages.append(prefix)
++ sitepackages.append(os.path.join(prefix, "lib64",
"site-packages"))
+ sitepackages.append(os.path.join(prefix, "lib",
"site-packages"))
+ if sys.platform == "darwin":
+ # for framework builds *only* we add the standard Apple
+diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py
+index 78c4809..3b9e74d 100644
+--- a/Lib/test/test_site.py
++++ b/Lib/test/test_site.py
+@@ -246,17 +246,20 @@ class HelperFunctionsTests(unittest.TestCase):
+ self.assertEqual(dirs[2], wanted)
+ elif os.sep == '/':
+ # OS X non-framwework builds, Linux, FreeBSD, etc
+- self.assertEqual(len(dirs), 2)
+- wanted = os.path.join('xoxo', 'lib', 'python' +
sys.version[:3],
++ self.assertEqual(len(dirs), 3)
++ wanted = os.path.join('xoxo', 'lib64', 'python' +
sys.version[:3],
+ 'site-packages')
+ self.assertEqual(dirs[0], wanted)
+- wanted = os.path.join('xoxo', 'lib', 'site-python')
++ wanted = os.path.join('xoxo', 'lib', 'python' +
sys.version[:3],
++ 'site-packages')
+ self.assertEqual(dirs[1], wanted)
++ wanted = os.path.join('xoxo', 'lib', 'site-python')
++ self.assertEqual(dirs[2], wanted)
+ else:
+ # other platforms
+ self.assertEqual(len(dirs), 2)
+ self.assertEqual(dirs[0], 'xoxo')
+- wanted = os.path.join('xoxo', 'lib',
'site-packages')
++ wanted = os.path.join('xoxo', 'lib64',
'site-packages')
+ self.assertEqual(dirs[1], wanted)
+
+ class PthFile(object):
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index 5741a4c..0faa5c5 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -111,7 +111,7 @@ LIBDIR= @libdir@
+ MANDIR= @mandir@
+ INCLUDEDIR= @includedir@
+ CONFINCLUDEDIR= $(exec_prefix)/include
+-SCRIPTDIR= $(prefix)/lib
++SCRIPTDIR= $(prefix)/lib64
+
+ # Detailed destination directories
+ BINLIBDEST= $(LIBDIR)/python$(VERSION)
+diff --git a/Modules/Setup.dist b/Modules/Setup.dist
+index c70a0d6..051fd41 100644
+--- a/Modules/Setup.dist
++++ b/Modules/Setup.dist
+@@ -416,7 +416,7 @@ gdbm gdbmmodule.c -lgdbm
+ # Edit the variables DB and DBLIBVERto point to the db top directory
+ # and the subdirectory of PORT where you built it.
+ DBINC=/usr/include/libdb
+-DBLIB=/usr/lib
++DBLIB=/usr/lib64
+ _bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb
+
+ # Historical Berkeley DB 1.85
+@@ -462,7 +462,7 @@ cPickle cPickle.c
+ # Andrew Kuchling's zlib module.
+ # This require zlib 1.1.3 (or later).
+ # See
http://www.gzip.org/zlib/
+-zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
++zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib64 -lz
+
+ # Interface to the Expat XML parser
+ #
+diff --git a/Modules/getpath.c b/Modules/getpath.c
+index 428684c..9ef6711 100644
+--- a/Modules/getpath.c
++++ b/Modules/getpath.c
+@@ -108,7 +108,7 @@ static char prefix[MAXPATHLEN+1];
+ static char exec_prefix[MAXPATHLEN+1];
+ static char progpath[MAXPATHLEN+1];
+ static char *module_search_path = NULL;
+-static char lib_python[] = "lib/python" VERSION;
++static char lib_python[] = "lib64/python" VERSION;
+
+ static void
+ reduce(char *dir)
+@@ -550,7 +550,7 @@ calculate_path(void)
+ fprintf(stderr,
+ "Could not find platform dependent libraries
<exec_prefix>\n");
+ strncpy(exec_prefix, EXEC_PREFIX, MAXPATHLEN);
+- joinpath(exec_prefix, "lib/lib-dynload");
++ joinpath(exec_prefix, "lib64/lib-dynload");
+ }
+ /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */
+
+diff --git a/setup.py b/setup.py
+index 55c4f5d..19efe82 100644
+--- a/setup.py
++++ b/setup.py
+@@ -456,7 +456,7 @@ class PyBuildExt(build_ext):
+ def detect_modules(self):
+ # Ensure that /usr/local is always used
+ if not cross_compiling:
+- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
++ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib64')
+ add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+ if cross_compiling:
+ self.add_gcc_paths()
+@@ -782,11 +782,11 @@ class PyBuildExt(build_ext):
+ elif curses_library:
+ readline_libs.append(curses_library)
+ elif self.compiler.find_library_file(lib_dirs +
+- ['/usr/lib/termcap'],
++ ['/usr/lib64/termcap'],
+ 'termcap'):
+ readline_libs.append('termcap')
+ exts.append( Extension('readline', ['readline.c'],
+- library_dirs=['/usr/lib/termcap'],
++ library_dirs=['/usr/lib64/termcap'],
+ extra_link_args=readline_extra_link_args,
+ libraries=readline_libs) )
+ else:
+@@ -821,8 +821,8 @@ class PyBuildExt(build_ext):
+ if krb5_h:
+ ssl_incs += krb5_h
+ ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
+- ['/usr/local/ssl/lib',
+- '/usr/contrib/ssl/lib/'
++ ['/usr/local/ssl/lib64',
++ '/usr/contrib/ssl/lib64/'
+ ] )
+
+ if (ssl_incs is not None and
diff --git a/00112-2.7.12-debug-build.patch b/00112-2.7.12-debug-build.patch
new file mode 100644
index 0000000..df4c577
--- /dev/null
+++ b/00112-2.7.12-debug-build.patch
@@ -0,0 +1,301 @@
+diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py
+index 3a49454..07fd2ae 100644
+--- a/Lib/distutils/command/build_ext.py
++++ b/Lib/distutils/command/build_ext.py
+@@ -676,7 +676,10 @@ class build_ext (Command):
+ so_ext = get_config_var('SO')
+ if os.name == 'nt' and self.debug:
+ return os.path.join(*ext_path) + '_d' + so_ext
+- return os.path.join(*ext_path) + so_ext
++
++ # Similarly, extensions in debug mode are named 'module_d.so', to
++ # avoid adding the _d to the SO config variable:
++ return os.path.join(*ext_path) + (sys.pydebug and "_d" or
"") + so_ext
+
+ def get_export_symbols (self, ext):
+ """Return the list of symbols that a shared extension has to
+@@ -761,6 +764,8 @@ class build_ext (Command):
+ template = "python%d.%d"
+ pythonlib = (template %
+ (sys.hexversion >> 24, (sys.hexversion >> 16)
& 0xff))
++ if sys.pydebug:
++ pythonlib += '_d'
+ return ext.libraries + [pythonlib]
+ else:
+ return ext.libraries
+diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
+index 068d1ba..031f809 100644
+--- a/Lib/distutils/sysconfig.py
++++ b/Lib/distutils/sysconfig.py
+@@ -90,7 +90,8 @@ def get_python_inc(plat_specific=0, prefix=None):
+ # 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())
++ return os.path.join(prefix, "include",
++ "python" + get_python_version() + (sys.pydebug and
'-debug' or ''))
+ elif os.name == "nt":
+ return os.path.join(prefix, "include")
+ elif os.name == "os2":
+@@ -244,7 +245,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)
+- return os.path.join(lib_dir, "config", "Makefile")
++ return os.path.join(lib_dir, "config" + (sys.pydebug and
"-debug" or ""), "Makefile")
+
+
+ def parse_config_h(fp, g=None):
+diff --git a/Lib/distutils/tests/test_install.py b/Lib/distutils/tests/test_install.py
+index 78fac46..d1d0931 100644
+--- a/Lib/distutils/tests/test_install.py
++++ b/Lib/distutils/tests/test_install.py
+@@ -20,8 +20,9 @@ from distutils.tests import support
+
+
+ def _make_ext_name(modname):
+- if os.name == 'nt' and sys.executable.endswith('_d.exe'):
++ if sys.pydebug:
+ modname += '_d'
++
+ return modname + sysconfig.get_config_var('SO')
+
+
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index 5741a4c..d13ba40 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -116,8 +116,8 @@ SCRIPTDIR= $(prefix)/lib
+ # Detailed destination directories
+ BINLIBDEST= $(LIBDIR)/python$(VERSION)
+ LIBDEST= $(SCRIPTDIR)/python$(VERSION)
+-INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
+-CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)
++INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)$(DEBUG_SUFFIX)
++CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)$(DEBUG_SUFFIX)
+ LIBP= $(LIBDIR)/python$(VERSION)
+
+ # Symbols used for using shared libraries
+@@ -131,6 +131,12 @@ DESTSHARED= $(BINLIBDEST)/lib-dynload
+ EXE= @EXEEXT@
+ BUILDEXE= @BUILDEXEEXT@
+
++# DEBUG_EXT is used by ELF files (names and SONAMEs); it will be "_d" for a
debug build
++# DEBUG_SUFFIX is used by filesystem paths; it will be "-debug" for a debug
build
++# Both will be empty in an optimized build
++DEBUG_EXT= @DEBUG_EXT@
++DEBUG_SUFFIX= @DEBUG_SUFFIX@
++
+ # Short name and location for Mac OS X Python framework
+ UNIVERSALSDK=@UNIVERSALSDK@
+ PYTHONFRAMEWORK= @PYTHONFRAMEWORK@
+@@ -197,8 +203,8 @@ LIBOBJDIR= Python/
+ LIBOBJS= @LIBOBJS@
+ UNICODE_OBJS= @UNICODE_OBJS@
+
+-PYTHON= python$(EXE)
+-BUILDPYTHON= python$(BUILDEXE)
++PYTHON= python$(DEBUG_SUFFIX)$(EXE)
++BUILDPYTHON= python$(DEBUG_SUFFIX)$(BUILDEXE)
+
+ cross_compiling=@cross_compiling@
+ PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@
+@@ -549,7 +555,7 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o
+ _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
+ $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
+
+-libpython$(VERSION).so: $(LIBRARY_OBJS)
++libpython$(VERSION)$(DEBUG_EXT).so: $(LIBRARY_OBJS)
+ if test $(INSTSONAME) != $(LDLIBRARY); then \
+ $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS)
$(LIBC) $(LIBM) $(LDLAST); \
+ $(LN) -f $(INSTSONAME) $@; \
+@@ -979,18 +985,18 @@ bininstall: altbininstall
+ then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON); \
+ else true; \
+ fi
+- (cd $(DESTDIR)$(BINDIR); $(LN) -s python2$(EXE) $(PYTHON))
+- -rm -f $(DESTDIR)$(BINDIR)/python2$(EXE)
+- (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(EXE) python2$(EXE))
+- -rm -f $(DESTDIR)$(BINDIR)/python2-config
+- (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python2-config)
+- -rm -f $(DESTDIR)$(BINDIR)/python-config
+- (cd $(DESTDIR)$(BINDIR); $(LN) -s python2-config python-config)
++ (cd $(DESTDIR)$(BINDIR); $(LN) -s python2$(DEBUG_SUFFIX)$(EXE) $(PYTHON))
++ -rm -f $(DESTDIR)$(BINDIR)/python2$(DEBUG_SUFFIX)$(EXE)
++ (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(DEBUG_SUFFIX)$(EXE)
python2$(DEBUG_SUFFIX)$(EXE))
++ -rm -f $(DESTDIR)$(BINDIR)/python2$(DEBUG_SUFFIX)-config
++ (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(DEBUG_SUFFIX)-config
python2$(DEBUG_SUFFIX)-config)
++ -rm -f $(DESTDIR)$(BINDIR)/python$(DEBUG_SUFFIX)-config
++ (cd $(DESTDIR)$(BINDIR); $(LN) -s python2$(DEBUG_SUFFIX)-config
python$(DEBUG_SUFFIX)-config)
+ -test -d $(DESTDIR)$(LIBPC) || $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(LIBPC)
+- -rm -f $(DESTDIR)$(LIBPC)/python2.pc
+- (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python2.pc)
+- -rm -f $(DESTDIR)$(LIBPC)/python.pc
+- (cd $(DESTDIR)$(LIBPC); $(LN) -s python2.pc python.pc)
++ -rm -f $(DESTDIR)$(LIBPC)/python2$(DEBUG_SUFFIX).pc
++ (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION)$(DEBUG_SUFFIX).pc
python2$(DEBUG_SUFFIX).pc)
++ -rm -f $(DESTDIR)$(LIBPC)/python$(DEBUG_SUFFIX).pc
++ (cd $(DESTDIR)$(LIBPC); $(LN) -s python2$(DEBUG_SUFFIX).pc python$(DEBUG_SUFFIX).pc)
+
+ # Install the interpreter with $(VERSION) affixed
+ # This goes into $(exec_prefix)
+@@ -1003,7 +1009,7 @@ altbininstall: $(BUILDPYTHON)
+ else true; \
+ fi; \
+ done
+- $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE)
++ $(INSTALL_PROGRAM) $(BUILDPYTHON)
$(DESTDIR)$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)$(EXE)
+ if test -f $(LDLIBRARY); then \
+ if test -n "$(DLLLIBRARY)" ; then \
+ $(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
+@@ -1173,10 +1179,11 @@ $(srcdir)/Lib/$(PLATDIR):
+ fi; \
+ cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen
+
+-python-config: $(srcdir)/Misc/python-config.in
++python$(DEBUG_SUFFIX)-config: $(srcdir)/Misc/python-config.in
+ # 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
++ sed -e "s,@EXENAME@,$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)$(EXE)," <
$(srcdir)/Misc/python-config.in >python$(DEBUG_SUFFIX)-config
++
+
+ # Install the include files
+ INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
+@@ -1197,13 +1204,13 @@ inclinstall:
+ $(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
+
+ # Install the library and miscellaneous stuff needed for extending/embedding
+-# This goes into $(exec_prefix)
+-LIBPL= $(LIBP)/config
++# This goes into $(exec_prefix)$(DEBUG_SUFFIX)
++LIBPL= $(LIBP)/config$(DEBUG_SUFFIX)
+
+ # pkgconfig directory
+ LIBPC= $(LIBDIR)/pkgconfig
+
+-libainstall: all python-config
++libainstall: all python$(DEBUG_SUFFIX)-config
+ @for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \
+ do \
+ if test ! -d $(DESTDIR)$$i; then \
+@@ -1219,11 +1226,10 @@ libainstall: all python-config
+ $(INSTALL_DATA) Modules/Setup $(DESTDIR)$(LIBPL)/Setup
+ $(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local
+ $(INSTALL_DATA) Modules/Setup.config $(DESTDIR)$(LIBPL)/Setup.config
+- $(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc
++ $(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION)$(DEBUG_SUFFIX).pc
+ $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
+ $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
+- $(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(VERSION)-config
+- rm python-config
++ $(INSTALL_SCRIPT) python$(DEBUG_SUFFIX)-config
$(DESTDIR)$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)-config
+ @if [ -s Modules/python.exp -a \
+ "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ];
then \
+ echo; echo "Installing support files for building shared extension modules on
AIX:"; \
+diff --git a/Misc/python-config.in b/Misc/python-config.in
+index a09e07c..c1691ef 100644
+--- a/Misc/python-config.in
++++ b/Misc/python-config.in
+@@ -44,7 +44,7 @@ for opt in opt_flags:
+ print ' '.join(flags)
+
+ elif opt in ('--libs', '--ldflags'):
+- 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
+diff --git a/Modules/makesetup b/Modules/makesetup
+index 8862c36..0d4ae4e 100755
+--- a/Modules/makesetup
++++ b/Modules/makesetup
+@@ -233,7 +233,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
+ *$mod.o*) base=$mod;;
+ *) base=${mod}module;;
+ esac
+- file="$srcdir/$base\$(SO)"
++ file="$srcdir/$base\$(DEBUG_EXT)\$(SO)"
+ case $doconfig in
+ no) SHAREDMODS="$SHAREDMODS $file";;
+ esac
+diff --git a/Python/dynload_shlib.c b/Python/dynload_shlib.c
+index 17ebab1..02a94aa 100644
+--- a/Python/dynload_shlib.c
++++ b/Python/dynload_shlib.c
+@@ -46,11 +46,16 @@ const struct filedescr _PyImport_DynLoadFiletab[] = {
+ {"module.exe", "rb", C_EXTENSION},
+ {"MODULE.EXE", "rb", C_EXTENSION},
+ #else
++#ifdef Py_DEBUG
++ {"_d.so", "rb", C_EXTENSION},
++ {"module_d.so", "rb", C_EXTENSION},
++#else
+ {".so", "rb", C_EXTENSION},
+ {"module.so", "rb", C_EXTENSION},
+-#endif
+-#endif
+-#endif
++#endif /* Py_DEBUG */
++#endif /* __VMS */
++#endif /* defined(PYOS_OS2) && defined(PYCC_GCC) */
++#endif /* __CYGWIN__ */
+ {0, 0}
+ };
+
+diff --git a/Python/sysmodule.c b/Python/sysmodule.c
+index 609578b..6ee9639 100644
+--- a/Python/sysmodule.c
++++ b/Python/sysmodule.c
+@@ -1577,6 +1577,12 @@ _PySys_Init(void)
+ PyString_FromString("legacy"));
+ #endif
+
++#ifdef Py_DEBUG
++ PyDict_SetItemString(sysdict, "pydebug", Py_True);
++#else
++ PyDict_SetItemString(sysdict, "pydebug", Py_False);
++#endif
++
+ #undef SET_SYS_FROM_STRING
+ if (PyErr_Occurred())
+ return NULL;
+diff --git a/configure.ac b/configure.ac
+index cce1be7..acb496b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -761,7 +761,7 @@ AC_SUBST(LIBRARY)
+ AC_MSG_CHECKING(LIBRARY)
+ if test -z "$LIBRARY"
+ then
+- LIBRARY='libpython$(VERSION).a'
++ LIBRARY='libpython$(VERSION)$(DEBUG_EXT).a'
+ fi
+ AC_MSG_RESULT($LIBRARY)
+
+@@ -907,8 +907,8 @@ if test $enable_shared = "yes"; then
+ INSTSONAME="$LDLIBRARY".$SOVERSION
+ ;;
+ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*)
+- LDLIBRARY='libpython$(VERSION).so'
+- BLDLIBRARY='-L. -lpython$(VERSION)'
++ LDLIBRARY='libpython$(VERSION)$(DEBUG_EXT).so'
++ BLDLIBRARY='-L. -lpython$(VERSION)$(DEBUG_EXT)'
+ RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
+ case $ac_sys_system in
+ FreeBSD*)
+@@ -1051,6 +1051,14 @@ else AC_MSG_RESULT(no); Py_DEBUG='false'
+ fi],
+ [AC_MSG_RESULT(no)])
+
++if test "$Py_DEBUG" = 'true'
++then
++ DEBUG_EXT=_d
++ DEBUG_SUFFIX=-debug
++fi
++AC_SUBST(DEBUG_EXT)
++AC_SUBST(DEBUG_SUFFIX)
++
+ # XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
+ # merged with this chunk of code?
+
diff --git a/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch
b/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch
index 38381ef..71e7f68 100644
--- a/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch
+++ b/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch
@@ -1,9 +1,11 @@
---- Python-2.7.2/Lib/test/test_sys.py.mark-tests-that-fail-in-rpmbuild 2011-09-08
18:02:31.627362039 -0400
-+++ Python-2.7.2/Lib/test/test_sys.py 2011-09-08 18:15:29.450308851 -0400
-@@ -734,6 +734,11 @@ class SizeofTest(unittest.TestCase):
- # (PyTypeObject + PyNumberMethods + PyMappingMethods +
- # PySequenceMethods + PyBufferProcs)
- s = vsize('P2P15Pl4PP9PP11PI') + struct.calcsize('41P 10P 3P
6P')
+diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
+index 0dd4258..d9b3267 100644
+--- a/Lib/test/test_sys.py
++++ b/Lib/test/test_sys.py
+@@ -769,6 +769,11 @@ class SizeofTest(unittest.TestCase):
+ '10P' # PySequenceMethods
+ '6P' # PyBufferProcs
+ '2P')
+
+ # COUNT_ALLOCS adds further fields to the end of a PyTypeObject:
+ if hasattr(sys, 'getcounts'):
diff --git a/00153-fix-test_gdb-noise.patch b/00153-fix-test_gdb-noise.patch
index d1a1b6e..a1b26d0 100644
--- a/00153-fix-test_gdb-noise.patch
+++ b/00153-fix-test_gdb-noise.patch
@@ -1,23 +1,5 @@
--- Lib/test/test_gdb.py.old 2012-04-11 21:04:01.367073855 -0400
+++ Lib/test/test_gdb.py 2012-04-12 08:52:58.320288761 -0400
-@@ -96,6 +96,15 @@ class DebuggerTests(unittest.TestCase):
- # Generate a list of commands in gdb's language:
- commands = ['set breakpoint pending yes',
- 'break %s' % breakpoint,
-+
-+ # GDB as of Fedora 17 onwards can distinguish between the
-+ # value of a variable at entry vs current value:
-+ #
http://sourceware.org/gdb/onlinedocs/gdb/Variables.html
-+ # which leads to the selftests failing with errors like this:
-+ # AssertionError: 'v@entry=()' != '()'
-+ # Disable this:
-+ 'set print entry-values no',
-+
-
- # The tests assume that the first frame of printed
- # backtrace will not contain program counter,
---- Lib/test/test_gdb.py.old 2012-04-11 21:04:01.367073855 -0400
-+++ Lib/test/test_gdb.py 2012-04-12 08:52:58.320288761 -0400
@@ -144,6 +153,10 @@
'Missing separate debuginfo for ',
'Try: zypper install -C ',
diff --git a/python-2.7.3-debug-build.patch b/python-2.7.3-debug-build.patch
deleted file mode 100644
index c8e8fea..0000000
--- a/python-2.7.3-debug-build.patch
+++ /dev/null
@@ -1,292 +0,0 @@
-diff -up Python-2.7.6/Lib/distutils/command/build_ext.py.debug-build
Python-2.7.6/Lib/distutils/command/build_ext.py
---- Python-2.7.6/Lib/distutils/command/build_ext.py.debug-build 2013-11-10
08:36:40.000000000 +0100
-+++ Python-2.7.6/Lib/distutils/command/build_ext.py 2014-01-29 14:13:08.815888533 +0100
-@@ -674,7 +674,10 @@ class build_ext (Command):
- so_ext = get_config_var('SO')
- if os.name == 'nt' and self.debug:
- return os.path.join(*ext_path) + '_d' + so_ext
-- return os.path.join(*ext_path) + so_ext
-+
-+ # Similarly, extensions in debug mode are named 'module_d.so', to
-+ # avoid adding the _d to the SO config variable:
-+ return os.path.join(*ext_path) + (sys.pydebug and "_d" or
"") + so_ext
-
- def get_export_symbols (self, ext):
- """Return the list of symbols that a shared extension has to
-@@ -759,6 +762,8 @@ class build_ext (Command):
- template = "python%d.%d"
- pythonlib = (template %
- (sys.hexversion >> 24, (sys.hexversion >> 16)
& 0xff))
-+ if sys.pydebug:
-+ pythonlib += '_d'
- return ext.libraries + [pythonlib]
- else:
- return ext.libraries
-diff -up Python-2.7.6/Lib/distutils/sysconfig.py.debug-build
Python-2.7.6/Lib/distutils/sysconfig.py
---- Python-2.7.6/Lib/distutils/sysconfig.py.debug-build 2014-01-29 14:13:08.770891379
+0100
-+++ Python-2.7.6/Lib/distutils/sysconfig.py 2014-01-29 14:13:08.815888533 +0100
-@@ -90,7 +90,8 @@ 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())
-+ return os.path.join(prefix, "include",
-+ "python" + get_python_version() + (sys.pydebug and
'-debug' or ''))
- elif os.name == "nt":
- return os.path.join(prefix, "include")
- elif os.name == "os2":
-@@ -247,7 +248,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)
-- return os.path.join(lib_dir, "config", "Makefile")
-+ return os.path.join(lib_dir, "config" + (sys.pydebug and
"-debug" or ""), "Makefile")
-
-
- def parse_config_h(fp, g=None):
-diff -up Python-2.7.6/Lib/distutils/tests/test_install.py.debug-build
Python-2.7.6/Lib/distutils/tests/test_install.py
---- Python-2.7.6/Lib/distutils/tests/test_install.py.debug-build 2014-01-29
14:13:08.779890810 +0100
-+++ Python-2.7.6/Lib/distutils/tests/test_install.py 2014-01-29 14:13:08.815888533 +0100
-@@ -20,8 +20,9 @@ from distutils.tests import support
-
-
- def _make_ext_name(modname):
-- if os.name == 'nt' and sys.executable.endswith('_d.exe'):
-+ if sys.pydebug:
- modname += '_d'
-+
- return modname + sysconfig.get_config_var('SO')
-
-
-diff -up Python-2.7.6/Makefile.pre.in.debug-build Python-2.7.6/Makefile.pre.in
---- Python-2.7.6/Makefile.pre.in.debug-build 2014-01-29 14:13:08.800889482 +0100
-+++ Python-2.7.6/Makefile.pre.in 2014-01-29 14:17:30.929316462 +0100
-@@ -111,8 +111,8 @@ SCRIPTDIR= $(prefix)/lib64
- # Detailed destination directories
- BINLIBDEST= $(LIBDIR)/python$(VERSION)
- LIBDEST= $(SCRIPTDIR)/python$(VERSION)
--INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
--CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)
-+INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)$(DEBUG_SUFFIX)
-+CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)$(DEBUG_SUFFIX)
- LIBP= $(LIBDIR)/python$(VERSION)
-
- # Symbols used for using shared libraries
-@@ -126,6 +126,12 @@ DESTSHARED= $(BINLIBDEST)/lib-dynload
- EXE= @EXEEXT@
- BUILDEXE= @BUILDEXEEXT@
-
-+# DEBUG_EXT is used by ELF files (names and SONAMEs); it will be "_d" for a
debug build
-+# DEBUG_SUFFIX is used by filesystem paths; it will be "-debug" for a debug
build
-+# Both will be empty in an optimized build
-+DEBUG_EXT= @DEBUG_EXT@
-+DEBUG_SUFFIX= @DEBUG_SUFFIX@
-+
- # Short name and location for Mac OS X Python framework
- UNIVERSALSDK=@UNIVERSALSDK@
- PYTHONFRAMEWORK= @PYTHONFRAMEWORK@
-@@ -189,8 +195,8 @@ LIBOBJDIR= Python/
- LIBOBJS= @LIBOBJS@
- UNICODE_OBJS= @UNICODE_OBJS@
-
--PYTHON= python$(EXE)
--BUILDPYTHON= python$(BUILDEXE)
-+PYTHON= python$(DEBUG_SUFFIX)$(EXE)
-+BUILDPYTHON= python$(DEBUG_SUFFIX)$(BUILDEXE)
-
- PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@
- _PYTHON_HOST_PLATFORM=@_PYTHON_HOST_PLATFORM@
-@@ -464,7 +470,7 @@ sharedmods: $(BUILDPYTHON) pybuilddir.tx
- _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
- $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
-
--libpython$(VERSION).so: $(LIBRARY_OBJS)
-+libpython$(VERSION)$(DEBUG_EXT).so: $(LIBRARY_OBJS)
- if test $(INSTSONAME) != $(LDLIBRARY); then \
- $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS)
$(LIBC) $(LIBM) $(LDLAST); \
- $(LN) -f $(INSTSONAME) $@; \
-@@ -856,18 +862,18 @@ bininstall: altbininstall
- then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON); \
- else true; \
- fi
-- (cd $(DESTDIR)$(BINDIR); $(LN) -s python2$(EXE) $(PYTHON))
-- -rm -f $(DESTDIR)$(BINDIR)/python2$(EXE)
-- (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(EXE) python2$(EXE))
-- -rm -f $(DESTDIR)$(BINDIR)/python2-config
-- (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python2-config)
-- -rm -f $(DESTDIR)$(BINDIR)/python-config
-- (cd $(DESTDIR)$(BINDIR); $(LN) -s python2-config python-config)
-+ (cd $(DESTDIR)$(BINDIR); $(LN) -s python2$(DEBUG_SUFFIX)$(EXE) $(PYTHON))
-+ -rm -f $(DESTDIR)$(BINDIR)/python2$(DEBUG_SUFFIX)$(EXE)
-+ (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(DEBUG_SUFFIX)$(EXE)
python2$(DEBUG_SUFFIX)$(EXE))
-+ -rm -f $(DESTDIR)$(BINDIR)/python2$(DEBUG_SUFFIX)-config
-+ (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(DEBUG_SUFFIX)-config
python2$(DEBUG_SUFFIX)-config)
-+ -rm -f $(DESTDIR)$(BINDIR)/python$(DEBUG_SUFFIX)-config
-+ (cd $(DESTDIR)$(BINDIR); $(LN) -s python2$(DEBUG_SUFFIX)-config
python$(DEBUG_SUFFIX)-config)
- -test -d $(DESTDIR)$(LIBPC) || $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(LIBPC)
-- -rm -f $(DESTDIR)$(LIBPC)/python2.pc
-- (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python2.pc)
-- -rm -f $(DESTDIR)$(LIBPC)/python.pc
-- (cd $(DESTDIR)$(LIBPC); $(LN) -s python2.pc python.pc)
-+ -rm -f $(DESTDIR)$(LIBPC)/python2$(DEBUG_SUFFIX).pc
-+ (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION)$(DEBUG_SUFFIX).pc
python2$(DEBUG_SUFFIX).pc)
-+ -rm -f $(DESTDIR)$(LIBPC)/python$(DEBUG_SUFFIX).pc
-+ (cd $(DESTDIR)$(LIBPC); $(LN) -s python2$(DEBUG_SUFFIX).pc python$(DEBUG_SUFFIX).pc)
-
- # Install the interpreter with $(VERSION) affixed
- # This goes into $(exec_prefix)
-@@ -880,7 +886,7 @@ altbininstall: $(BUILDPYTHON)
- else true; \
- fi; \
- done
-- $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE)
-+ $(INSTALL_PROGRAM) $(BUILDPYTHON)
$(DESTDIR)$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)$(EXE)
- if test -f $(LDLIBRARY); then \
- if test -n "$(DLLLIBRARY)" ; then \
- $(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
-@@ -1046,10 +1052,11 @@ $(srcdir)/Lib/$(PLATDIR):
- fi; \
- cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen
-
--python-config: $(srcdir)/Misc/python-config.in
-+python$(DEBUG_SUFFIX)-config: $(srcdir)/Misc/python-config.in
- # 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
-+ sed -e "s,@EXENAME@,$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)$(EXE)," <
$(srcdir)/Misc/python-config.in >python$(DEBUG_SUFFIX)-config
-+
-
- # Install the include files
- INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
-@@ -1070,13 +1077,13 @@ inclinstall:
- $(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
-
- # Install the library and miscellaneous stuff needed for extending/embedding
--# This goes into $(exec_prefix)
--LIBPL= $(LIBP)/config
-+# This goes into $(exec_prefix)$(DEBUG_SUFFIX)
-+LIBPL= $(LIBP)/config$(DEBUG_SUFFIX)
-
- # pkgconfig directory
- LIBPC= $(LIBDIR)/pkgconfig
-
--libainstall: all python-config
-+libainstall: all python$(DEBUG_SUFFIX)-config
- @for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \
- do \
- if test ! -d $(DESTDIR)$$i; then \
-@@ -1092,11 +1099,10 @@ libainstall: all python-config
- $(INSTALL_DATA) Modules/Setup $(DESTDIR)$(LIBPL)/Setup
- $(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local
- $(INSTALL_DATA) Modules/Setup.config $(DESTDIR)$(LIBPL)/Setup.config
-- $(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc
-+ $(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION)$(DEBUG_SUFFIX).pc
- $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
- $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
-- $(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(VERSION)-config
-- rm python-config
-+ $(INSTALL_SCRIPT) python$(DEBUG_SUFFIX)-config
$(DESTDIR)$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)-config
- @if [ -s Modules/python.exp -a \
- "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ];
then \
- echo; echo "Installing support files for building shared extension modules on
AIX:"; \
-diff -up Python-2.7.6/Misc/python-config.in.debug-build
Python-2.7.6/Misc/python-config.in
---- Python-2.7.6/Misc/python-config.in.debug-build 2013-11-10 08:36:41.000000000 +0100
-+++ Python-2.7.6/Misc/python-config.in 2014-01-29 14:13:08.816888470 +0100
-@@ -45,7 +45,7 @@ for opt in opt_flags:
- print ' '.join(flags)
-
- elif opt in ('--libs', '--ldflags'):
-- 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
-diff -up Python-2.7.6/Modules/makesetup.debug-build Python-2.7.6/Modules/makesetup
---- Python-2.7.6/Modules/makesetup.debug-build 2013-11-10 08:36:41.000000000 +0100
-+++ Python-2.7.6/Modules/makesetup 2014-01-29 14:13:08.817888407 +0100
-@@ -233,7 +233,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
- *$mod.o*) base=$mod;;
- *) base=${mod}module;;
- esac
-- file="$srcdir/$base\$(SO)"
-+ file="$srcdir/$base\$(DEBUG_EXT)\$(SO)"
- case $doconfig in
- no) SHAREDMODS="$SHAREDMODS $file";;
- esac
-diff -up Python-2.7.6/Python/dynload_shlib.c.debug-build
Python-2.7.6/Python/dynload_shlib.c
---- Python-2.7.6/Python/dynload_shlib.c.debug-build 2013-11-10 08:36:41.000000000 +0100
-+++ Python-2.7.6/Python/dynload_shlib.c 2014-01-29 14:13:08.817888407 +0100
-@@ -46,11 +46,16 @@ const struct filedescr _PyImport_DynLoad
- {"module.exe", "rb", C_EXTENSION},
- {"MODULE.EXE", "rb", C_EXTENSION},
- #else
-+#ifdef Py_DEBUG
-+ {"_d.so", "rb", C_EXTENSION},
-+ {"module_d.so", "rb", C_EXTENSION},
-+#else
- {".so", "rb", C_EXTENSION},
- {"module.so", "rb", C_EXTENSION},
--#endif
--#endif
--#endif
-+#endif /* Py_DEBUG */
-+#endif /* __VMS */
-+#endif /* defined(PYOS_OS2) && defined(PYCC_GCC) */
-+#endif /* __CYGWIN__ */
- {0, 0}
- };
-
-diff -up Python-2.7.6/Python/sysmodule.c.debug-build Python-2.7.6/Python/sysmodule.c
---- Python-2.7.6/Python/sysmodule.c.debug-build 2013-11-10 08:36:41.000000000 +0100
-+++ Python-2.7.6/Python/sysmodule.c 2014-01-29 14:13:08.817888407 +0100
-@@ -1506,6 +1506,12 @@ _PySys_Init(void)
- PyString_FromString("legacy"));
- #endif
-
-+#ifdef Py_DEBUG
-+ PyDict_SetItemString(sysdict, "pydebug", Py_True);
-+#else
-+ PyDict_SetItemString(sysdict, "pydebug", Py_False);
-+#endif
-+
- #undef SET_SYS_FROM_STRING
- if (PyErr_Occurred())
- return NULL;
-diff -up Python-2.7.6/configure.ac.debug-build Python-2.7.6/configure.ac
---- Python-2.7.6/configure.ac.debug-build 2014-01-29 14:13:08.796889735 +0100
-+++ Python-2.7.6/configure.ac 2014-01-29 14:13:08.814888597 +0100
-@@ -738,7 +738,7 @@ AC_SUBST(LIBRARY)
- AC_MSG_CHECKING(LIBRARY)
- if test -z "$LIBRARY"
- then
-- LIBRARY='libpython$(VERSION).a'
-+ LIBRARY='libpython$(VERSION)$(DEBUG_EXT).a'
- fi
- AC_MSG_RESULT($LIBRARY)
-
-@@ -884,8 +884,8 @@ if test $enable_shared = "yes"; then
- INSTSONAME="$LDLIBRARY".$SOVERSION
- ;;
- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*)
-- LDLIBRARY='libpython$(VERSION).so'
-- BLDLIBRARY='-L. -lpython$(VERSION)'
-+ LDLIBRARY='libpython$(VERSION)$(DEBUG_EXT).so'
-+ BLDLIBRARY='-L. -lpython$(VERSION)$(DEBUG_EXT)'
- RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
- case $ac_sys_system in
- FreeBSD*)
-@@ -1028,6 +1028,14 @@ else AC_MSG_RESULT(no); Py_DEBUG='false'
- fi],
- [AC_MSG_RESULT(no)])
-
-+if test "$Py_DEBUG" = 'true'
-+then
-+ DEBUG_EXT=_d
-+ DEBUG_SUFFIX=-debug
-+fi
-+AC_SUBST(DEBUG_EXT)
-+AC_SUBST(DEBUG_SUFFIX)
-+
- # XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
- # merged with this chunk of code?
-
diff --git a/python-2.7.3-lib64.patch b/python-2.7.3-lib64.patch
deleted file mode 100644
index 678d916..0000000
--- a/python-2.7.3-lib64.patch
+++ /dev/null
@@ -1,196 +0,0 @@
-diff -up Python-2.7.6/Lib/distutils/command/install.py.lib64
Python-2.7.6/Lib/distutils/command/install.py
---- Python-2.7.6/Lib/distutils/command/install.py.lib64 2013-11-10 08:36:40.000000000
+0100
-+++ Python-2.7.6/Lib/distutils/command/install.py 2014-01-29 13:51:19.779590378 +0100
-@@ -42,14 +42,14 @@ else:
- INSTALL_SCHEMES = {
- 'unix_prefix': {
- 'purelib': '$base/lib/python$py_version_short/site-packages',
-- 'platlib':
'$platbase/lib/python$py_version_short/site-packages',
-+ 'platlib':
'$platbase/lib64/python$py_version_short/site-packages',
- 'headers': '$base/include/python$py_version_short/$dist_name',
- 'scripts': '$base/bin',
- 'data' : '$base',
- },
- 'unix_home': {
- 'purelib': '$base/lib/python',
-- 'platlib': '$base/lib/python',
-+ 'platlib': '$base/lib64/python',
- 'headers': '$base/include/python/$dist_name',
- 'scripts': '$base/bin',
- 'data' : '$base',
-diff -up Python-2.7.6/Lib/distutils/sysconfig.py.lib64
Python-2.7.6/Lib/distutils/sysconfig.py
---- Python-2.7.6/Lib/distutils/sysconfig.py.lib64 2013-11-10 08:36:40.000000000 +0100
-+++ Python-2.7.6/Lib/distutils/sysconfig.py 2014-01-29 13:51:19.779590378 +0100
-@@ -119,8 +119,12 @@ def get_python_lib(plat_specific=0, stan
- prefix = plat_specific and EXEC_PREFIX or PREFIX
-
- if os.name == "posix":
-+ if plat_specific or standard_lib:
-+ lib = "lib64"
-+ else:
-+ lib = "lib"
- libpython = os.path.join(prefix,
-- "lib", "python" +
get_python_version())
-+ lib, "python" + get_python_version())
- if standard_lib:
- return libpython
- else:
-diff -up Python-2.7.6/Lib/site.py.lib64 Python-2.7.6/Lib/site.py
---- Python-2.7.6/Lib/site.py.lib64 2013-11-10 08:36:40.000000000 +0100
-+++ Python-2.7.6/Lib/site.py 2014-01-29 13:51:19.779590378 +0100
-@@ -288,12 +288,16 @@ def getsitepackages():
- if sys.platform in ('os2emx', 'riscos'):
- sitepackages.append(os.path.join(prefix, "Lib",
"site-packages"))
- elif os.sep == '/':
-+ sitepackages.append(os.path.join(prefix, "lib64",
-+ "python" + sys.version[:3],
-+ "site-packages"))
- sitepackages.append(os.path.join(prefix, "lib",
- "python" + sys.version[:3],
- "site-packages"))
- sitepackages.append(os.path.join(prefix, "lib",
"site-python"))
- else:
- sitepackages.append(prefix)
-+ sitepackages.append(os.path.join(prefix, "lib64",
"site-packages"))
- sitepackages.append(os.path.join(prefix, "lib",
"site-packages"))
- if sys.platform == "darwin":
- # for framework builds *only* we add the standard Apple
-diff -up Python-2.7.6/Lib/test/test_site.py.lib64 Python-2.7.6/Lib/test/test_site.py
---- Python-2.7.6/Lib/test/test_site.py.lib64 2013-11-10 08:36:40.000000000 +0100
-+++ Python-2.7.6/Lib/test/test_site.py 2014-01-29 13:51:19.780590315 +0100
-@@ -241,17 +241,20 @@ class HelperFunctionsTests(unittest.Test
- self.assertEqual(dirs[2], wanted)
- elif os.sep == '/':
- # OS X non-framwework builds, Linux, FreeBSD, etc
-- self.assertEqual(len(dirs), 2)
-- wanted = os.path.join('xoxo', 'lib', 'python' +
sys.version[:3],
-+ self.assertEqual(len(dirs), 3)
-+ wanted = os.path.join('xoxo', 'lib64', 'python' +
sys.version[:3],
- 'site-packages')
- self.assertEqual(dirs[0], wanted)
-- wanted = os.path.join('xoxo', 'lib', 'site-python')
-+ wanted = os.path.join('xoxo', 'lib', 'python' +
sys.version[:3],
-+ 'site-packages')
- self.assertEqual(dirs[1], wanted)
-+ wanted = os.path.join('xoxo', 'lib', 'site-python')
-+ self.assertEqual(dirs[2], wanted)
- else:
- # other platforms
- self.assertEqual(len(dirs), 2)
- self.assertEqual(dirs[0], 'xoxo')
-- wanted = os.path.join('xoxo', 'lib',
'site-packages')
-+ wanted = os.path.join('xoxo', 'lib64',
'site-packages')
- self.assertEqual(dirs[1], wanted)
-
- class PthFile(object):
-diff -up Python-2.7.6/Makefile.pre.in.lib64 Python-2.7.6/Makefile.pre.in
---- Python-2.7.6/Makefile.pre.in.lib64 2014-01-29 13:51:19.773590757 +0100
-+++ Python-2.7.6/Makefile.pre.in 2014-01-29 13:51:19.780590315 +0100
-@@ -106,7 +106,7 @@ LIBDIR= @libdir@
- MANDIR= @mandir@
- INCLUDEDIR= @includedir@
- CONFINCLUDEDIR= $(exec_prefix)/include
--SCRIPTDIR= $(prefix)/lib
-+SCRIPTDIR= $(prefix)/lib64
-
- # Detailed destination directories
- BINLIBDEST= $(LIBDIR)/python$(VERSION)
-diff -up Python-2.7.6/Modules/Setup.dist.lib64 Python-2.7.6/Modules/Setup.dist
---- Python-2.7.6/Modules/Setup.dist.lib64 2014-01-29 13:51:19.768591073 +0100
-+++ Python-2.7.6/Modules/Setup.dist 2014-01-29 13:51:19.781590252 +0100
-@@ -416,7 +416,7 @@ gdbm gdbmmodule.c -lgdbm
- # Edit the variables DB and DBLIBVERto point to the db top directory
- # and the subdirectory of PORT where you built it.
- DBINC=/usr/include/libdb
--DBLIB=/usr/lib
-+DBLIB=/usr/lib64
- _bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb
-
- # Historical Berkeley DB 1.85
-@@ -462,7 +462,7 @@ cPickle cPickle.c
- # Andrew Kuchling's zlib module.
- # This require zlib 1.1.3 (or later).
- # See
http://www.gzip.org/zlib/
--zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
-+zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib64 -lz
-
- # Interface to the Expat XML parser
- #
-diff -up Python-2.7.6/Modules/getpath.c.lib64 Python-2.7.6/Modules/getpath.c
---- Python-2.7.6/Modules/getpath.c.lib64 2013-11-10 08:36:41.000000000 +0100
-+++ Python-2.7.6/Modules/getpath.c 2014-01-29 13:51:19.781590252 +0100
-@@ -117,8 +117,8 @@
- #endif
-
- #ifndef PYTHONPATH
--#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
-- EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
-+#define PYTHONPATH PREFIX "/lib64/python" VERSION ":" \
-+ EXEC_PREFIX "/lib64/python" VERSION "/lib-dynload"
- #endif
-
- #ifndef LANDMARK
-@@ -129,7 +129,7 @@ static char prefix[MAXPATHLEN+1];
- static char exec_prefix[MAXPATHLEN+1];
- static char progpath[MAXPATHLEN+1];
- static char *module_search_path = NULL;
--static char lib_python[] = "lib/python" VERSION;
-+static char lib_python[] = "lib64/python" VERSION;
-
- static void
- reduce(char *dir)
-@@ -543,7 +543,7 @@ calculate_path(void)
- }
- else
- strncpy(zip_path, PREFIX, MAXPATHLEN);
-- joinpath(zip_path, "lib/python00.zip");
-+ joinpath(zip_path, "lib64/python00.zip");
- bufsz = strlen(zip_path); /* Replace "00" with version */
- zip_path[bufsz - 6] = VERSION[0];
- zip_path[bufsz - 5] = VERSION[2];
-@@ -553,7 +553,7 @@ calculate_path(void)
- fprintf(stderr,
- "Could not find platform dependent libraries
<exec_prefix>\n");
- strncpy(exec_prefix, EXEC_PREFIX, MAXPATHLEN);
-- joinpath(exec_prefix, "lib/lib-dynload");
-+ joinpath(exec_prefix, "lib64/lib-dynload");
- }
- /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */
-
-diff -up Python-2.7.6/setup.py.lib64 Python-2.7.6/setup.py
---- Python-2.7.6/setup.py.lib64 2013-11-10 08:36:41.000000000 +0100
-+++ Python-2.7.6/setup.py 2014-01-29 13:56:02.713716528 +0100
-@@ -438,7 +438,7 @@ class PyBuildExt(build_ext):
- def detect_modules(self):
- # Ensure that /usr/local is always used
- if not cross_compiling:
-- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
-+ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib64')
- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
- if cross_compiling:
- self.add_gcc_paths()
-@@ -758,11 +758,11 @@ class PyBuildExt(build_ext):
- elif curses_library:
- readline_libs.append(curses_library)
- elif self.compiler.find_library_file(lib_dirs +
-- ['/usr/lib/termcap'],
-+ ['/usr/lib64/termcap'],
- 'termcap'):
- readline_libs.append('termcap')
- exts.append( Extension('readline', ['readline.c'],
-- library_dirs=['/usr/lib/termcap'],
-+ library_dirs=['/usr/lib64/termcap'],
- extra_link_args=readline_extra_link_args,
- libraries=readline_libs) )
- else:
-@@ -797,8 +797,8 @@ class PyBuildExt(build_ext):
- if krb5_h:
- ssl_incs += krb5_h
- ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
-- ['/usr/local/ssl/lib',
-- '/usr/contrib/ssl/lib/'
-+ ['/usr/local/ssl/lib64',
-+ '/usr/contrib/ssl/lib64/'
- ] )
-
- if (ssl_incs is not None and
diff --git a/python-2.7rc1-binutils-no-dep.patch b/python-2.7rc1-binutils-no-dep.patch
deleted file mode 100644
index ee6157c..0000000
--- a/python-2.7rc1-binutils-no-dep.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff -up Python-2.7rc1/Lib/ctypes/util.py.binutils-no-dep
Python-2.7rc1/Lib/ctypes/util.py
---- Python-2.7rc1/Lib/ctypes/util.py.binutils-no-dep 2010-03-15 09:42:23.000000000 -0400
-+++ Python-2.7rc1/Lib/ctypes/util.py 2010-06-06 05:03:02.155975210 -0400
-@@ -140,7 +140,9 @@ elif os.name == "posix":
- dump = f.read()
- rv = f.close()
- if rv == 10:
-- raise OSError, 'objdump command not found'
-+ return os.path.basename(f) # This is good for GLibc, I think,
-+ # and a dep on binutils is big (for
-+ # live CDs).
- f = os.popen(cmd)
- try:
- data = f.read()
diff --git a/python.spec b/python.spec
index 5e97b8e..65f6c8a 100644
--- a/python.spec
+++ b/python.spec
@@ -107,8 +107,8 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
# Remember to also rebase python-docs when changing this:
-Version: 2.7.11
-Release: 8%{?dist}
+Version: 2.7.12
+Release: 1%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -316,7 +316,7 @@ Patch7: python-2.5.1-sqlite-encoding.patch
# SONAME from a library; we avoid this, apparently to minimize space
# requirements on the live CD:
# (rhbz:307221)
-Patch10: python-2.7rc1-binutils-no-dep.patch
+Patch10: 00010-2.7.12-binutils-no-dep.patch
# Upstream as of Python 2.7.3:
# Patch11: python-2.7rc1-codec-ascii-tolower.patch
@@ -352,7 +352,7 @@ Patch55: 00055-systemtap.patch
# and add the /usr/lib64/pythonMAJOR.MINOR/site-packages to sitedirs, in front of
# /usr/lib/pythonMAJOR.MINOR/site-packages
# Not upstream
-Patch102: python-2.7.3-lib64.patch
+Patch102: 00102-2.7.12-lib64.patch
# Python 2.7 split out much of the path-handling from distutils/sysconfig.py to
# a new sysconfig.py (in r77704).
@@ -433,7 +433,7 @@ Patch111: 00111-no-static-lib.patch
#
# See also patch 130 below
#
-Patch112: python-2.7.3-debug-build.patch
+Patch112: 00112-2.7.12-debug-build.patch
# 00113 #
@@ -712,7 +712,10 @@ Patch165: 00165-crypt-module-salt-backport.patch
# a frame can't be read from the inferior process (rhbz#912025)
#
# Not yet sent upstream
-Patch166: 00166-fix-fake-repr-in-gdb-hooks.patch
+# This issue seems to have been fixed most probably by
https://bugs.python.org/issue26799
+# as of Python 2.7.12 and test_gdb seems to fail with the patch applied
+# so dropping it for now.
+#Patch166: 00166-fix-fake-repr-in-gdb-hooks.patch
# 00167 #
# Don't run any of the stack navigation tests in test_gdb when Python is
@@ -918,7 +921,7 @@ Patch200: 00200-skip-thread-test.patch
#
https://hg.python.org/cpython/rev/2edbdb79cd6d
# Fix possible integer overflow and heap corruption in zipimporter.get_data()
# FIXED UPSTREAM:
https://bugs.python.org/issue26171
-Patch209: 00209-CVE-2016-5636-buffer-overflow-in-zipimport-module-fix.patch
+#Patch209: 00209-CVE-2016-5636-buffer-overflow-in-zipimport-module-fix.patch
# 00210 #
# CVE-2016-0772 python: smtplib StartTLS stripping attack
@@ -926,12 +929,12 @@ Patch209:
00209-CVE-2016-5636-buffer-overflow-in-zipimport-module-fix.patch
# rhbz#1346344:
https://bugzilla.redhat.com/show_bug.cgi?id=1346344
# FIXED UPSTREAM:
https://hg.python.org/cpython/rev/b3ce713fb9be
# Raise an error when STARTTLS fails
-Patch210: 00210-Raise-an-error-when-STARTTLS-fails.patch
+# Patch210: 00210-Raise-an-error-when-STARTTLS-fails.patch
# 00211 #
# Fix test breakage with version 2.2.0 of Expat
# rhbz#1353919:
https://bugzilla.redhat.com/show_bug.cgi?id=1353919
-# NOT YET FIXED UPSTREAM:
http://bugs.python.org/issue27369
+# FIXED UPSTREAM:
http://bugs.python.org/issue27369
Patch211: 00211-fix-test-pyexpat-failure.patch
# (New patches go here ^^^)
@@ -1264,7 +1267,7 @@ done
# 00164: not for python 2 yet
%patch165 -p1
mv Modules/cryptmodule.c Modules/_cryptmodule.c
-%patch166 -p1
+# 00166: dropped as of Python 2.7.12
%patch167 -p1
%patch168 -p1
%patch169 -p1
@@ -1298,8 +1301,8 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch198 -p1
%endif
%patch200 -p1
-%patch209 -p1
-%patch210 -p1
+# 00209: upstream as of Python 2.7.12
+# 00210: upstream as of Python 2.7.12
%patch211 -p1
@@ -2152,6 +2155,11 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Fri Jul 15 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.12-1
+- Update to 2.7.12
+- Refactored patches: 10, 102, 112, 134, 153
+- Dropped patches: 166, 209, 210
+
* Fri Jul 08 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.11-8
- Refactor patch for properly fixing CVE-2016-5636
commit 20f301a645612d553df43b5f03c4aff3ca1fbd21
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Fri Jul 8 21:27:11 2016 +0200
Refactor patch for properly fixing CVE-2016-5636
diff --git a/00201-prevent-buffer-overflow-in-zipimport-module.patch
b/00201-prevent-buffer-overflow-in-zipimport-module.patch
deleted file mode 100644
index 319d57f..0000000
--- a/00201-prevent-buffer-overflow-in-zipimport-module.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff --git a/Modules/zipimport.c b/Modules/zipimport.c
-index 7240cb4..a139a3f 100644
---- a/Modules/zipimport.c
-+++ b/Modules/zipimport.c
-@@ -895,6 +895,11 @@ get_data(char *archive, PyObject *toc_entry)
- PyMarshal_ReadShortFromFile(fp); /* local header size */
- file_offset += l; /* Start of file data */
-
-+ if (data_size > LONG_MAX - 1) {
-+ fclose(fp);
-+ PyErr_NoMemory();
-+ return NULL;
-+ }
- raw_data = PyString_FromStringAndSize((char *)NULL, compress == 0 ?
- data_size : data_size + 1);
- if (raw_data == NULL) {
diff --git a/00209-CVE-2016-5636-buffer-overflow-in-zipimport-module-fix.patch
b/00209-CVE-2016-5636-buffer-overflow-in-zipimport-module-fix.patch
new file mode 100644
index 0000000..f166d01
--- /dev/null
+++ b/00209-CVE-2016-5636-buffer-overflow-in-zipimport-module-fix.patch
@@ -0,0 +1,39 @@
+From 0f12cb75c708978f9201c1dd3464d2a8572b4544 Mon Sep 17 00:00:00 2001
+From: Charalampos Stratakis <cstratak(a)redhat.com>
+Date: Fri, 8 Jul 2016 20:24:10 +0200
+Subject: [PATCH] CVE-2016-5636 fix
+
+---
+ Modules/zipimport.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/Modules/zipimport.c b/Modules/zipimport.c
+index 7240cb4..2e6a61f 100644
+--- a/Modules/zipimport.c
++++ b/Modules/zipimport.c
+@@ -861,6 +861,10 @@ get_data(char *archive, PyObject *toc_entry)
+ &date, &crc)) {
+ return NULL;
+ }
++ if (data_size < 0) {
++ PyErr_Format(ZipImportError, "negative data size");
++ return NULL;
++ }
+
+ fp = fopen(archive, "rb");
+ if (!fp) {
+@@ -895,6 +899,11 @@ get_data(char *archive, PyObject *toc_entry)
+ PyMarshal_ReadShortFromFile(fp); /* local header size */
+ file_offset += l; /* Start of file data */
+
++ if (data_size > LONG_MAX - 1) {
++ fclose(fp);
++ PyErr_NoMemory();
++ return NULL;
++ }
+ raw_data = PyString_FromStringAndSize((char *)NULL, compress == 0 ?
+ data_size : data_size + 1);
+ if (raw_data == NULL) {
+--
+2.7.4
+
diff --git a/python.spec b/python.spec
index 3249731..5e97b8e 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.11
-Release: 7%{?dist}
+Release: 8%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -848,7 +848,6 @@ Patch187: 00187-add-RPATH-to-pyexpat.patch
Patch189: 00189-gdb-py-bt-dont-raise-exception-from-eval.patch
# 00190 #
-#
# Importing get_python_version in bdist_rpm
#
http://bugs.python.org/issue18045
# rhbz#1029082
@@ -856,19 +855,16 @@ Patch189: 00189-gdb-py-bt-dont-raise-exception-from-eval.patch
#Patch190: 00190-get_python_version.patch
# 00191 #
-#
# Disabling NOOP test as it fails without internet connection
Patch191: 00191-disable-NOOP.patch
# 00192 #
-#
# Fixing buffer overflow (upstream patch)
# rhbz#1062375
# FIXED UPSTREAM
#Patch192: 00192-buffer-overflow.patch
# 00193 #
-#
# Enable loading sqlite extensions. This patch isn't needed for
# python3.spec, since Python 3 has a configuration option for this.
# rhbz#1066708
@@ -876,13 +872,13 @@ Patch191: 00191-disable-NOOP.patch
Patch193: 00193-enable-loading-sqlite-extensions.patch
# 00194 #
-#
# Fix tests with SQLite >= 3.8.4
#
http://bugs.python.org/issue20901
#
http://hg.python.org/cpython/raw-rev/1763e27a182d
# FIXED UPSTREAM
#Patch194: 00194-fix-tests-with-sqlite-3.8.4.patch
+# 00195 #
# Since openssl-1.0.1h-5.fc21 SSLv2 and SSLV3 protocols
# are disabled by default in openssl, according the comment in openssl
# patch this affects only SSLv23_method, this patch enables SSLv2
@@ -892,30 +888,37 @@ Patch193: 00193-enable-loading-sqlite-extensions.patch
# disables only sslv2 all tests pass
#Patch195: 00195-enable-sslv23-in-ssl.patch
+# 00196 #
#
http://bugs.python.org/issue21308
# Backport of ssl module from python3
# FIXED UPSTREAM
# Patch196: 00196-ssl-backport.patch
+# 00197 #
#
http://bugs.python.org/issue22023
# Patch seg fault in unicodeobject.c
# FIXED UPSTREAM
# Patch197: 00197-unicode_fromformat.patch
+# 00198 #
%if 0%{with_rewheel}
Patch198: 00198-add-rewheel-module.patch
%endif
+# 00200 #
# test_gdb.test_threads fails when run within rpmbuild
# I couldnt reproduce the issue outside of rpmbuild, therefore
# I skip test for now
Patch200: 00200-skip-thread-test.patch
-#
https://bugs.python.org/issue26171
+# 00209 #
+# CVE-2016-5636:
http://seclists.org/oss-sec/2016/q2/560
+# rhbz#1345858:
https://bugzilla.redhat.com/show_bug.cgi?id=1345858
#
https://hg.python.org/cpython/rev/985fc64c60d6/
+#
https://hg.python.org/cpython/rev/2edbdb79cd6d
# Fix possible integer overflow and heap corruption in zipimporter.get_data()
-# FIXED UPSTREAM
-Patch201: 00201-prevent-buffer-overflow-in-zipimport-module.patch
+# FIXED UPSTREAM:
https://bugs.python.org/issue26171
+Patch209: 00209-CVE-2016-5636-buffer-overflow-in-zipimport-module-fix.patch
# 00210 #
# CVE-2016-0772 python: smtplib StartTLS stripping attack
@@ -1295,7 +1298,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch198 -p1
%endif
%patch200 -p1
-%patch201 -p1
+%patch209 -p1
%patch210 -p1
%patch211 -p1
@@ -2149,6 +2152,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Fri Jul 08 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.11-8
+- Refactor patch for properly fixing CVE-2016-5636
+
* Fri Jul 08 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.11-7
- Fix test_pyexpat failure with Expat version of 2.2.0
commit 220a669a6c9c5d9d1886332d1d0419b755f496c5
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Fri Jul 8 17:48:51 2016 +0200
Fix test_pyexpat failure with Expat 2.2.0
diff --git a/00211-fix-test-pyexpat-failure.patch b/00211-fix-test-pyexpat-failure.patch
new file mode 100644
index 0000000..f14a19b
--- /dev/null
+++ b/00211-fix-test-pyexpat-failure.patch
@@ -0,0 +1,18 @@
+diff --git a/Lib/test/test_pyexpat.py b/Lib/test/test_pyexpat.py
+index eba9058..2c8a164 100644
+--- a/Lib/test/test_pyexpat.py
++++ b/Lib/test/test_pyexpat.py
+@@ -610,11 +610,9 @@ class MalformedInputText(unittest.TestCase):
+ def test2(self):
+ xml = "<?xml version\xc2\x85='1.0'?>\r\n"
+ parser = expat.ParserCreate()
+- try:
++ err_pattern = r'XML declaration not well-formed: line 1, column \d+'
++ with self.assertRaisesRegexp(expat.ExpatError, err_pattern):
+ parser.Parse(xml, True)
+- self.fail()
+- except expat.ExpatError as e:
+- self.assertEqual(str(e), 'XML declaration not well-formed: line 1,
column 14')
+
+ class ForeignDTDTests(unittest.TestCase):
+ """
diff --git a/python.spec b/python.spec
index 90c4acd..3249731 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.11
-Release: 6%{?dist}
+Release: 7%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -925,6 +925,12 @@ Patch201: 00201-prevent-buffer-overflow-in-zipimport-module.patch
# Raise an error when STARTTLS fails
Patch210: 00210-Raise-an-error-when-STARTTLS-fails.patch
+# 00211 #
+# Fix test breakage with version 2.2.0 of Expat
+# rhbz#1353919:
https://bugzilla.redhat.com/show_bug.cgi?id=1353919
+# NOT YET FIXED UPSTREAM:
http://bugs.python.org/issue27369
+Patch211: 00211-fix-test-pyexpat-failure.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -1291,6 +1297,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch200 -p1
%patch201 -p1
%patch210 -p1
+%patch211 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -2142,6 +2149,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Fri Jul 08 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.11-7
+- Fix test_pyexpat failure with Expat version of 2.2.0
+
* Thu Jun 16 2016 Tomas Orsava <torsava(a)redhat.com> - 2.7.11-6
- Fix for: CVE-2016-0772 python: smtplib StartTLS stripping attack
- Raise an error when STARTTLS fails
commit 570612449e84e52cd493cce08f72fc51be2219e7
Author: Tomas Orsava <tomas.n(a)orsava.cz>
Date: Thu Jun 16 19:39:34 2016 +0200
Fix for: CVE-2016-0772 python: smtplib StartTLS stripping attack (rhbz#1303647)
Raise an error when STARTTLS fails.
- rhbz#1303647:
https://bugzilla.redhat.com/show_bug.cgi?id=1303647
- rhbz#1346344:
https://bugzilla.redhat.com/show_bug.cgi?id=1346344
- Fixed upstream:
https://hg.python.org/cpython/rev/b3ce713fb9be
diff --git a/00210-Raise-an-error-when-STARTTLS-fails.patch
b/00210-Raise-an-error-when-STARTTLS-fails.patch
new file mode 100644
index 0000000..324749d
--- /dev/null
+++ b/00210-Raise-an-error-when-STARTTLS-fails.patch
@@ -0,0 +1,35 @@
+From c2c98ddde2665d12e34f17c4eac90832df720114 Mon Sep 17 00:00:00 2001
+From: Tomas Orsava <torsava(a)redhat.com>
+Date: Thu, 16 Jun 2016 18:56:18 +0200
+Subject: [PATCH] Raise an error when STARTTLS fails
+
+CVE-2016-0772 python: smtplib StartTLS stripping attack
+rhbz#1303647:
https://bugzilla.redhat.com/show_bug.cgi?id=1303647
+rhbz#1346344:
https://bugzilla.redhat.com/show_bug.cgi?id=1346344
+
+Based on an upstream change by Benjamin Peterson <benjamin(a)python.org>
+- in changeset 101886:b3ce713fb9be 2.7
+-
https://hg.python.org/cpython/rev/b3ce713fb9be
+---
+ Lib/smtplib.py | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/Lib/smtplib.py b/Lib/smtplib.py
+index 8388b98..e1651c0 100755
+--- a/Lib/smtplib.py
++++ b/Lib/smtplib.py
+@@ -656,6 +656,11 @@ class SMTP:
+ self.ehlo_resp = None
+ self.esmtp_features = {}
+ self.does_esmtp = 0
++ else:
++ # RFC 3207:
++ # 501 Syntax error (no parameters allowed)
++ # 454 TLS not available due to temporary reason
++ raise SMTPResponseException(resp, reply)
+ return (resp, reply)
+
+ def sendmail(self, from_addr, to_addrs, msg, mail_options=[],
+--
+2.5.5
+
diff --git a/python.spec b/python.spec
index 015c541..90c4acd 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.11
-Release: 5%{?dist}
+Release: 6%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -917,6 +917,14 @@ Patch200: 00200-skip-thread-test.patch
# FIXED UPSTREAM
Patch201: 00201-prevent-buffer-overflow-in-zipimport-module.patch
+# 00210 #
+# CVE-2016-0772 python: smtplib StartTLS stripping attack
+# rhbz#1303647:
https://bugzilla.redhat.com/show_bug.cgi?id=1303647
+# rhbz#1346344:
https://bugzilla.redhat.com/show_bug.cgi?id=1346344
+# FIXED UPSTREAM:
https://hg.python.org/cpython/rev/b3ce713fb9be
+# Raise an error when STARTTLS fails
+Patch210: 00210-Raise-an-error-when-STARTTLS-fails.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -1282,6 +1290,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%endif
%patch200 -p1
%patch201 -p1
+%patch210 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -2133,6 +2142,13 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu Jun 16 2016 Tomas Orsava <torsava(a)redhat.com> - 2.7.11-6
+- Fix for: CVE-2016-0772 python: smtplib StartTLS stripping attack
+- Raise an error when STARTTLS fails
+- rhbz#1303647:
https://bugzilla.redhat.com/show_bug.cgi?id=1303647
+- rhbz#1346344:
https://bugzilla.redhat.com/show_bug.cgi?id=1346344
+- Fixed upstream:
https://hg.python.org/cpython/rev/b3ce713fb9be
+
* Mon Jun 13 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.11-5
- Added patch for fixing possible integer overflow and heap corruption in
zipimporter.get_data()
commit 138d7442958d0916da8f6a33b5ace29c576bd05a
Author: Charalampos Stratakis <cstratak(a)redhat.com>
Date: Mon Jun 13 14:21:38 2016 +0200
Fix possible integer overflow and heap corruption in zipimport module
diff --git a/00201-prevent-buffer-overflow-in-zipimport-module.patch
b/00201-prevent-buffer-overflow-in-zipimport-module.patch
new file mode 100644
index 0000000..319d57f
--- /dev/null
+++ b/00201-prevent-buffer-overflow-in-zipimport-module.patch
@@ -0,0 +1,16 @@
+diff --git a/Modules/zipimport.c b/Modules/zipimport.c
+index 7240cb4..a139a3f 100644
+--- a/Modules/zipimport.c
++++ b/Modules/zipimport.c
+@@ -895,6 +895,11 @@ get_data(char *archive, PyObject *toc_entry)
+ PyMarshal_ReadShortFromFile(fp); /* local header size */
+ file_offset += l; /* Start of file data */
+
++ if (data_size > LONG_MAX - 1) {
++ fclose(fp);
++ PyErr_NoMemory();
++ return NULL;
++ }
+ raw_data = PyString_FromStringAndSize((char *)NULL, compress == 0 ?
+ data_size : data_size + 1);
+ if (raw_data == NULL) {
diff --git a/python.spec b/python.spec
index 997d5ba..015c541 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.11
-Release: 4%{?dist}
+Release: 5%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -911,6 +911,12 @@ Patch198: 00198-add-rewheel-module.patch
# I skip test for now
Patch200: 00200-skip-thread-test.patch
+#
https://bugs.python.org/issue26171
+#
https://hg.python.org/cpython/rev/985fc64c60d6/
+# Fix possible integer overflow and heap corruption in zipimporter.get_data()
+# FIXED UPSTREAM
+Patch201: 00201-prevent-buffer-overflow-in-zipimport-module.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -1275,6 +1281,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch198 -p1
%endif
%patch200 -p1
+%patch201 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -2126,6 +2133,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Mon Jun 13 2016 Charalampos Stratakis <cstratak(a)redhat.com> - 2.7.11-5
+- Added patch for fixing possible integer overflow and heap corruption in
zipimporter.get_data()
+
* Thu Feb 04 2016 Fedora Release Engineering <releng(a)fedoraproject.org> - 2.7.11-4
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
commit 380d16e2c1bcc295dc7a29fd12f1d0b47171ffad
Author: Fedora Release Engineering <releng(a)fedoraproject.org>
Date: Thu Feb 4 18:50:13 2016 +0000
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
diff --git a/python.spec b/python.spec
index 3d9b6fa..997d5ba 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.11
-Release: 3%{?dist}
+Release: 4%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -2126,6 +2126,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu Feb 04 2016 Fedora Release Engineering <releng(a)fedoraproject.org> - 2.7.11-4
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
+
* Wed Jan 13 2016 Orion Poplawski <orion(a)cora.nwra.com> - 2.7.11-3
- Drop macros, require python/python2-rpm-macros
commit 9e0b4c918236ff65c19b2b5301e01a7790301df9
Author: Orion Poplawski <orion(a)cora.nwra.com>
Date: Wed Jan 13 12:02:55 2016 -0700
Drop macros, require python/python2-rpm-macros
diff --git a/macros.python b/macros.python
deleted file mode 100644
index 84b9f57..0000000
--- a/macros.python
+++ /dev/null
@@ -1,49 +0,0 @@
-%py_setup setup.py
-%py_shbang_opts -s
-
-%py_build() %{expand:\
-CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} build
--executable="%{__python2} %{py_shbang_opts}" %{?1}\
-}
-
-%py_install() %{expand:\
-CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} install -O1
--skip-build --root %{buildroot} %{?1}\
-}
-
-%python_provide() %{lua:\
- function string.starts(String,Start)\
- return string.sub(String,1,string.len(Start))==Start\
- end\
- package = rpm.expand("%{?1:%{1}}");\
- vr = rpm.expand("%{?epoch:%{epoch}:}%{version}-%{release}")
- if (string.starts(package, "python2-")) then\
- str = "Provides: python-" ..
string.sub(package,9,string.len(package)) .. "%{?_isa} = " .. vr;\
- print(rpm.expand(str));\
- print("\\nProvides: python-");\
- print(string.sub(package,9,string.len(package)));\
- print(" = ");\
- print(vr);\
- --Obsoleting the previous default python package\
- str = "\\nObsoletes: python-" ..
string.sub(package,9,string.len(package)) .. "%{?_isa} < " .. vr;\
- print(rpm.expand(str));\
- print("\\nObsoletes: python-");\
- print(string.sub(package,9,string.len(package)));\
- print(" < ");\
- print(vr);\
- elseif (string.starts(package, "python3-")) then\
- --No unversioned provides as python3 is not default\
- elseif (string.starts(package, "pypy-")) then\
- --No unversioned provides as pypy is not default\
- elseif (string.starts(package, "pypy3-")) then\
- --No unversioned provides as pypy is not default\
- elseif (string.starts(package, "python-")) then\
- --Providing the current default python\
- print("Provides: python2-");\
- print(string.sub(package,8,string.len(package)));\
- print(" = ");\
- print(vr);\
- else\
- print("ERROR: ");\
- print(package);\
- print("not recognized.");\
- end\
-}
diff --git a/macros.python2 b/macros.python2
deleted file mode 100644
index 6bfd7f8..0000000
--- a/macros.python2
+++ /dev/null
@@ -1,15 +0,0 @@
-%__python2 /usr/bin/python2
-%python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib;
print(get_python_lib())")
-%python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib;
print(get_python_lib(1))")
-%python2_version %(%{__python2} -c "import sys;
sys.stdout.write('{0.major}.{0.minor}'.format(sys.version_info))")
-%python2_version_nodots %(%{__python2} -c "import sys;
sys.stdout.write('{0.major}{0.minor}'.format(sys.version_info))")
-
-%py2_shbang_opts -s
-
-%py2_build() %{expand:\
-CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} build
--executable="%{__python2} %{py2_shbang_opts}" %{?1}\
-}
-
-%py2_install() %{expand:\
-CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} install -O1
--skip-build --root %{buildroot} %{?1}\
-}
diff --git a/python.spec b/python.spec
index 749624c..3d9b6fa 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.11
-Release: 2%{?dist}
+Release: 3%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -201,16 +201,8 @@ Source4: systemtap-example.stp
# Written by dmalcolm; not yet sent upstream
Source5: pyfuntop.stp
-# Supply various useful macros for building python 2 modules:
-# __python2, python2_sitelib, python2_sitearch, python2_version
-Source6: macros.python2
-
Source7: pynche
-# Supply version independent macros such as python_provide, py_build and
-# py_install
-Source8: macros.python
-
# Modules/Setup.dist is ultimately used by the "makesetup" script to construct
# the Makefile and config.c
#
@@ -1018,7 +1010,8 @@ a scripting language, and by the main "python" executable
Summary: The libraries and header files needed for Python development
Group: Development/Libraries
Requires: %{python}%{?_isa} = %{version}-%{release}
-Requires: python-macros
+Requires: python-rpm-macros
+Requires: python2-rpm-macros
Requires: pkgconfig
# Needed here because of the migration of Makefile from -devel to the main
# package
@@ -1040,18 +1033,6 @@ python package will also need to be installed. You'll probably
also
want to install the python-docs package, which contains Python
documentation.
-%package -n python-macros
-Summary: The unversioned Python RPM macros
-Group: Development/Libraries
-BuildArch: noarch
-
-%description -n python-macros
-This package contains the unversioned Python RPM macros, that most
-implementations should rely on.
-
-You should not need to install this package manually as the various
-python?-devel packages require it. So install a python-devel package instead.
-
%package tools
Summary: A collection of development tools included with Python
Group: Development/Tools
@@ -1652,11 +1633,6 @@ sed -i -e
"s/'pyconfig.h'/'%{_pyconfig_h}'/" \
%{buildroot}%{pylibdir}/distutils/sysconfig.py \
%{buildroot}%{pylibdir}/sysconfig.py
-# Install macros for rpm:
-mkdir -p %{buildroot}/%{_rpmconfigdir}/macros.d/
-install -m 644 %{SOURCE6} %{buildroot}/%{_rpmconfigdir}/macros.d/
-install -m 644 %{SOURCE8} %{buildroot}/%{_rpmconfigdir}/macros.d/
-
# Ensure that the curses module was linked against libncursesw.so, rather than
# libncurses.so (bug 539917)
ldd %{buildroot}/%{dynload_dir}/_curses*.so \
@@ -1968,11 +1944,6 @@ rm -fr %{buildroot}
%endif
%{_bindir}/python%{pybasever}-config
%{_libdir}/libpython%{pybasever}.so
-%{_rpmconfigdir}/macros.d/macros.python2
-
-%files -n python-macros
-%defattr(-,root,root,-)
-%{_rpmconfigdir}/macros.d/macros.python
%files tools
%defattr(-,root,root,755)
@@ -2155,6 +2126,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Wed Jan 13 2016 Orion Poplawski <orion(a)cora.nwra.com> - 2.7.11-3
+- Drop macros, require python/python2-rpm-macros
+
* Wed Dec 30 2015 Orion Poplawski <orion(a)cora.nwra.com> - 2.7.11-2
- Get ready for separate python-macros package
commit 8d55496acc1e8fec83be6f01e09f1dc59dba7e16
Author: Orion Poplawski <orion(a)cora.nwra.com>
Date: Wed Dec 30 14:48:46 2015 -0700
Get ready for separate python-macros package
diff --git a/python.spec b/python.spec
index adc392b..749624c 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.11
-Release: 1%{?dist}
+Release: 2%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1018,7 +1018,7 @@ a scripting language, and by the main "python" executable
Summary: The libraries and header files needed for Python development
Group: Development/Libraries
Requires: %{python}%{?_isa} = %{version}-%{release}
-Requires: python-macros = %{version}-%{release}
+Requires: python-macros
Requires: pkgconfig
# Needed here because of the migration of Makefile from -devel to the main
# package
@@ -2155,6 +2155,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Wed Dec 30 2015 Orion Poplawski <orion(a)cora.nwra.com> - 2.7.11-2
+- Get ready for separate python-macros package
+
* Tue Dec 15 2015 Robert Kuska <rkuska(a)redhat.com> - 2.7.11-1
- Update to 2.7.11
commit 7af76a54f4d86feec3572073f43b36c93ed4926c
Author: Robert Kuska <rkuska(a)redhat.com>
Date: Thu Dec 24 20:53:12 2015 +0100
Update to 2.7.11
diff --git a/00166-fix-fake-repr-in-gdb-hooks.patch
b/00166-fix-fake-repr-in-gdb-hooks.patch
index 5f3781c..2cc0283 100644
--- a/00166-fix-fake-repr-in-gdb-hooks.patch
+++ b/00166-fix-fake-repr-in-gdb-hooks.patch
@@ -97,14 +97,15 @@ diff -up
Python-2.7.3/Tools/gdb/libpython.py.fix-fake-repr-in-gdb-hooks Python-2
pyop_value.write_repr(out, visited)
@@ -1252,8 +1255,11 @@ class Frame(object):
- if pyop:
- sys.stdout.write('#%i %s\n' % (self.get_index(),
pyop.get_truncated_repr(MAX_OUTPUT_LEN)))
+ write_unicode(sys.stdout, '#%i %s\n' % (self.get_index(),
line))
if not pyop.is_optimized_out():
- line = pyop.current_line()
-- sys.stdout.write(' %s\n' % line.strip())
+- if line is not None:
+- sys.stdout.write(' %s\n' % line.strip())
+ try:
+ line = pyop.current_line()
-+ sys.stdout.write(' %s\n' % line.strip())
++ if line is not None:
++ sys.stdout.write(' %s\n' % line.strip())
+ except CantReadFilename:
+ sys.stdout.write(' %s\n' % '(unable to read
filename)')
else:
diff --git a/00181-allow-arbitrary-timeout-in-condition-wait.patch
b/00181-allow-arbitrary-timeout-in-condition-wait.patch
index 665965d..757c7dd 100644
--- a/00181-allow-arbitrary-timeout-in-condition-wait.patch
+++ b/00181-allow-arbitrary-timeout-in-condition-wait.patch
@@ -24,8 +24,8 @@ index cb49c4a..c9795a5 100644
if not gotit:
if __debug__:
@@ -599,7 +602,7 @@ class _Event(_Verbose):
- finally:
- self.__cond.release()
+ with self.__cond:
+ self.__flag = False
- def wait(self, timeout=None):
+ def wait(self, timeout=None, balancing=True):
@@ -33,14 +33,14 @@ index cb49c4a..c9795a5 100644
If the internal flag is true on entry, return immediately. Otherwise,
@@ -617,7 +620,7 @@ class _Event(_Verbose):
- self.__cond.acquire()
- try:
+ """
+ with self.__cond:
if not self.__flag:
- self.__cond.wait(timeout)
+ self.__cond.wait(timeout, balancing)
return self.__flag
- finally:
- self.__cond.release()
+
+ # Helper to generate new thread names
@@ -908,7 +911,7 @@ class Thread(_Verbose):
if 'dummy_threading' not in _sys.modules:
raise
diff --git a/00189-gdb-py-bt-dont-raise-exception-from-eval.patch
b/00189-gdb-py-bt-dont-raise-exception-from-eval.patch
index 4e82859..4ef2a5d 100644
--- a/00189-gdb-py-bt-dont-raise-exception-from-eval.patch
+++ b/00189-gdb-py-bt-dont-raise-exception-from-eval.patch
@@ -6,6 +6,6 @@
return '(frame information optimized out)'
+ if self.filename() == '<string>':
+ return '(in an eval block)'
- with open(self.filename(), 'r') as f:
- all_lines = f.readlines()
- # Convert from 1-based current_line_num to 0-based list offset:
+ filename = self.filename()
+ try:
+ f = open(filename, 'r')
diff --git a/00198-add-rewheel-module.patch b/00198-add-rewheel-module.patch
index 7da66a4..2f558fe 100644
--- a/00198-add-rewheel-module.patch
+++ b/00198-add-rewheel-module.patch
@@ -1,86 +1,3 @@
-diff -Nur Python-3.4.1/Lib/ensurepip/__init__.py
Python-3.4.1-rewheel/Lib/ensurepip/__init__.py
---- Python-3.4.1/Lib/ensurepip/__init__.py 2014-08-21 10:49:30.792695824 +0200
-+++ Python-3.4.1-rewheel/Lib/ensurepip/__init__.py 2014-08-21 10:10:41.958341726 +0200
-@@ -7,6 +7,7 @@ import pkgutil
- import shutil
- import sys
- import tempfile
-+from ensurepip import rewheel
-
-
- __all__ = ["version", "bootstrap"]
-@@ -43,6 +44,8 @@
-
- # Install the bundled software
- import pip
-+ if args[0] in ["install", "list", "wheel"]:
-+ args.append('--pre')
- pip.main(args)
-
-
-@@ -93,21 +96,40 @@ def bootstrap(root=None, upgrade=False,
- # omit pip and easy_install
- os.environ["ENSUREPIP_OPTIONS"] = "install"
-
-+ whls = []
-+ rewheel_dir = None
-+ # try to see if we have system-wide versions of _PROJECTS
-+ dep_records = rewheel.find_system_records([p[0] for p in _PROJECTS])
-+ # TODO: check if system-wide versions are the newest ones
-+ # if --upgrade is used?
-+ if all(dep_records):
-+ # if we have all _PROJECTS installed system-wide, we'll recreate
-+ # wheels from them and install those
-+ rewheel_dir = tempfile.TemporaryDirectory()
-+ for dr in dep_records:
-+ new_whl = rewheel.rewheel_from_record(dr, rewheel_dir.name)
-+ whls.append(os.path.join(rewheel_dir.name, new_whl))
-+ else:
-+ # if we don't have all the _PROJECTS installed system-wide,
-+ # let's just fall back to bundled wheels
-+ for project, version in _PROJECTS:
-+ whl = os.path.join(
-+ os.path.dirname(__file__),
-+ "_bundled",
-+ "{}-{}-py2.py3-none-any.whl".format(project, version)
-+ )
-+ whls.append(whl)
-+
- tmpdir = tempfile.mkdtemp()
- 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))
-+ for whl in whls:
-+ shutil.copy(whl, tmpdir)
-+ additional_paths.append(os.path.join(tmpdir, os.path.basename(whl)))
-+ if rewheel_dir:
-+ rewheel_dir.cleanup()
-
- # Construct the arguments to be passed to the pip command
- args = ["install", "--no-index", "--find-links",
tmpdir]
-diff -Nur Python-3.4.1/Makefile.pre.in Python-3.4.1-rewheel/Makefile.pre.in
---- Python-3.4.1/Makefile.pre.in 2014-08-21 10:49:31.512695040 +0200
-+++ Python-3.4.1-rewheel/Makefile.pre.in 2014-08-21 10:10:41.961341722 +0200
-@@ -976,7 +976,7 @@ LIBSUBDIRS= lib-tk lib-tk/test lib-tk/te
- test/tracedmodules \
- encodings compiler hotshot \
- email email/mime email/test email/test/data \
-- ensurepip ensurepip/_bundled \
-+ ensurepip ensurepip/_bundled ensurepip/rewheel\
- json json/tests \
- sqlite3 sqlite3/test \
- logging bsddb bsddb/test csv importlib wsgiref \
diff -ru --new-file Python-2.7.9rc1-rewheel/Lib/ensurepip/rewheel/__init__.py
Python-2.7.9rc1/Lib/ensurepip/rewheel/__init__.py
--- Python-2.7.9rc1-rewheel/Lib/ensurepip/rewheel/__init__.py 1970-01-01
01:00:00.000000000 +0100
+++ Python-2.7.9rc1/Lib/ensurepip/rewheel/__init__.py 2014-12-08 11:29:34.215237317
+0100
@@ -123,7 +40,19 @@ diff -ru --new-file
Python-2.7.9rc1-rewheel/Lib/ensurepip/rewheel/__init__.py Py
+ """
+ records = []
+ # get system site-packages dirs
-+ sys_sitepack = site.getsitepackages([sys.base_prefix, sys.base_exec_prefix])
++ if hasattr(sys, 'real_prefix'):
++ #we are in python2 virtualenv and sys.real_prefix is the original sys.prefix
++ _orig_prefixes = site.PREFIXES
++ setattr(site, 'PREFIXES', [sys.real_prefix]*2)
++ sys_sitepack = site.getsitepackages()
++ setattr(site, 'PREFIXES', _orig_prefixes)
++ elif hasattr(sys, 'base_prefix'): # python3 venv doesn't inject
real_prefix to sys
++ # we are on python3 and base(_exec)_prefix is unchanged in venv
++ sys_sitepack = site.getsitepackages([sys.base_prefix, sys.base_exec_prefix])
++ else:
++ # we are in python2 without virtualenv
++ sys_sitepack = site.getsitepackages()
++
+ sys_sitepack = [sp for sp in sys_sitepack if os.path.exists(sp)]
+ # try to find all projects in all system site-packages
+ for project in projects:
@@ -154,7 +83,10 @@ diff -ru --new-file
Python-2.7.9rc1-rewheel/Lib/ensurepip/rewheel/__init__.py Py
+ new_wheel = zipfile.ZipFile(new_wheel_path, mode='w',
compression=zipfile.ZIP_DEFLATED)
+ # we need to write a new record with just the files that we will write,
+ # e.g. not binaries and *.pyc/*.pyo files
-+ new_record = io.StringIO()
++ if sys.version_info[0] < 3:
++ new_record = io.BytesIO()
++ else:
++ new_record = io.StringIO()
+ writer = csv.writer(new_record)
+
+ # handle files that we can write straight away
@@ -175,11 +107,11 @@ diff -ru --new-file
Python-2.7.9rc1-rewheel/Lib/ensurepip/rewheel/__init__.py Py
+
+ wheel_info_path = os.path.join(os.path.dirname(record_path), 'WHEEL')
+ with codecs.open(wheel_info_path, encoding='utf-8') as wheel_info_file:
-+ wheel_info = email.parser.Parser().parsestr(wheel_info_file.read())
++ wheel_info =
email.parser.Parser().parsestr(wheel_info_file.read().encode('utf-8'))
+
+ metadata_path = os.path.join(os.path.dirname(record_path), 'METADATA')
+ with codecs.open(metadata_path, encoding='utf-8') as metadata_file:
-+ metadata = email.parser.Parser().parsestr(metadata_file.read())
++ metadata =
email.parser.Parser().parsestr(metadata_file.read().encode('utf-8'))
+
+ # construct name parts according to wheel spec
+ distribution = metadata.get('Name')
@@ -228,3 +160,86 @@ diff -ru --new-file
Python-2.7.9rc1-rewheel/Lib/ensurepip/rewheel/__init__.py Py
+ else:
+ pass # bad RECORD or empty line
+ return to_write, to_omit
+diff -Nur Python-2.7.9/Lib/ensurepip/__init__.py
Python-2.7.9-rewheel/Lib/ensurepip/__init__.py
+--- Python-2.7.9/Lib/ensurepip/__init__.py 2014-08-21 10:49:30.792695824 +0200
++++ Python-2.7.9-rewheel/Lib/ensurepip/__init__.py 2014-08-21 10:10:41.958341726 +0200
+@@ -7,6 +7,7 @@ import pkgutil
+ import shutil
+ import sys
+ import tempfile
++from ensurepip import rewheel
+
+
+ __all__ = ["version", "bootstrap"]
+@@ -43,6 +44,8 @@
+
+ # Install the bundled software
+ import pip
++ if args[0] in ["install", "list", "wheel"]:
++ args.append('--pre')
+ pip.main(args)
+
+
+@@ -93,21 +96,40 @@ def bootstrap(root=None, upgrade=False,
+ # omit pip and easy_install
+ os.environ["ENSUREPIP_OPTIONS"] = "install"
+
++ whls = []
++ rewheel_dir = None
++ # try to see if we have system-wide versions of _PROJECTS
++ dep_records = rewheel.find_system_records([p[0] for p in _PROJECTS])
++ # TODO: check if system-wide versions are the newest ones
++ # if --upgrade is used?
++ if all(dep_records):
++ # if we have all _PROJECTS installed system-wide, we'll recreate
++ # wheels from them and install those
++ rewheel_dir = tempfile.mkdtemp()
++ for dr in dep_records:
++ new_whl = rewheel.rewheel_from_record(dr, rewheel_dir)
++ whls.append(os.path.join(rewheel_dir, new_whl))
++ else:
++ # if we don't have all the _PROJECTS installed system-wide,
++ # let's just fall back to bundled wheels
++ for project, version in _PROJECTS:
++ whl = os.path.join(
++ os.path.dirname(__file__),
++ "_bundled",
++ "{}-{}-py2.py3-none-any.whl".format(project, version)
++ )
++ whls.append(whl)
++
+ tmpdir = tempfile.mkdtemp()
+ 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))
++ for whl in whls:
++ shutil.copy(whl, tmpdir)
++ additional_paths.append(os.path.join(tmpdir, os.path.basename(whl)))
++ if rewheel_dir:
++ shutil.rmtree(rewheel_dir)
+
+ # Construct the arguments to be passed to the pip command
+ args = ["install", "--no-index", "--find-links",
tmpdir]
+diff -Nur Python-2.7.9/Makefile.pre.in Python-2.7.9-rewheel/Makefile.pre.in
+--- Python-2.7.9/Makefile.pre.in 2014-08-21 10:49:31.512695040 +0200
++++ Python-2.7.9-rewheel/Makefile.pre.in 2014-08-21 10:10:41.961341722 +0200
+@@ -976,7 +976,7 @@ LIBSUBDIRS= lib-tk lib-tk/test lib-tk/te
+ test/tracedmodules \
+ encodings compiler hotshot \
+ email email/mime email/test email/test/data \
+- ensurepip ensurepip/_bundled \
++ ensurepip ensurepip/_bundled ensurepip/rewheel\
+ json json/tests \
+ sqlite3 sqlite3/test \
+ logging bsddb bsddb/test csv importlib wsgiref \
diff --git a/00199-alter-tests-to-reflect-sslv3-disabled.patch
b/00199-alter-tests-to-reflect-sslv3-disabled.patch
deleted file mode 100644
index 70a605b..0000000
--- a/00199-alter-tests-to-reflect-sslv3-disabled.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-diff -up Python-2.7.9/Lib/test/test_ssl.py.ssl Python-2.7.9/Lib/test/test_ssl.py
---- Python-2.7.9/Lib/test/test_ssl.py.ssl 2014-12-11 10:40:22.657795081 +0100
-+++ Python-2.7.9/Lib/test/test_ssl.py 2014-12-11 11:25:11.925579957 +0100
-@@ -713,10 +713,7 @@ class ContextTests(unittest.TestCase):
- @skip_if_broken_ubuntu_ssl
- def test_options(self):
- ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-- # OP_ALL | OP_NO_SSLv2 is the default value
-- self.assertEqual(ssl.OP_ALL | ssl.OP_NO_SSLv2,
-- ctx.options)
-- ctx.options |= ssl.OP_NO_SSLv3
-+ # OP_ALL | OP_NO_SSLv2 | OP_NO_SSLv3 is the default value
- self.assertEqual(ssl.OP_ALL | ssl.OP_NO_SSLv2 | ssl.OP_NO_SSLv3,
- ctx.options)
- if can_clear_options():
-@@ -2220,24 +2217,20 @@ else:
- " SSL2 client to SSL23 server test unexpectedly
failed:\n %s\n"
- % str(x))
- if hasattr(ssl, 'PROTOCOL_SSLv3'):
-- try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3,
'SSLv3')
-+ try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3, False)
- try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv23, True)
- try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1,
'TLSv1')
-
- if hasattr(ssl, 'PROTOCOL_SSLv3'):
-- try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3,
'SSLv3', ssl.CERT_OPTIONAL)
-+ try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3, False,
ssl.CERT_OPTIONAL)
- try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv23, True,
ssl.CERT_OPTIONAL)
- try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1, 'TLSv1',
ssl.CERT_OPTIONAL)
-
- if hasattr(ssl, 'PROTOCOL_SSLv3'):
-- try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3,
'SSLv3', ssl.CERT_REQUIRED)
-+ try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3, False,
ssl.CERT_REQUIRED)
- try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv23, True,
ssl.CERT_REQUIRED)
- try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1, 'TLSv1',
ssl.CERT_REQUIRED)
-
-- # Server with specific SSL options
-- if hasattr(ssl, 'PROTOCOL_SSLv3'):
-- try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3, False,
-- server_options=ssl.OP_NO_SSLv3)
- # Will choose TLSv1
- try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv23, True,
- server_options=ssl.OP_NO_SSLv2 | ssl.OP_NO_SSLv3)
-@@ -2262,7 +2255,7 @@ else:
- try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_TLSv1, False)
- if no_sslv2_implies_sslv3_hello():
- # No SSLv2 => client will use an SSLv3 hello on recent OpenSSLs
-- try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv23,
'SSLv3',
-+ try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv23, False,
- client_options=ssl.OP_NO_SSLv2)
-
- @skip_if_broken_ubuntu_ssl
diff --git a/00200-skip-thread-test.patch b/00200-skip-thread-test.patch
new file mode 100644
index 0000000..90536d1
--- /dev/null
+++ b/00200-skip-thread-test.patch
@@ -0,0 +1,11 @@
+diff -up Python-2.7.11/Lib/test/test_gdb.py.old Python-2.7.11/Lib/test/test_gdb.py
+--- Python-2.7.11/Lib/test/test_gdb.py.old 2015-12-24 19:12:46.167487914 +0100
++++ Python-2.7.11/Lib/test/test_gdb.py 2015-12-24 19:13:48.833057910 +0100
+@@ -801,6 +801,7 @@ Traceback \(most recent call first\):
+ foo\(1, 2, 3\)
+ ''')
+
++ @unittest._skipInRpmBuild('this test fail within rpmbuild')
+ @unittest.skipUnless(thread,
+ "Python was compiled without thread support")
+ def test_threads(self):
diff --git a/python.spec b/python.spec
index 8110d7d..adc392b 100644
--- a/python.spec
+++ b/python.spec
@@ -107,8 +107,8 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
# Remember to also rebase python-docs when changing this:
-Version: 2.7.10
-Release: 11%{?dist}
+Version: 2.7.11
+Release: 1%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -914,10 +914,10 @@ Patch193: 00193-enable-loading-sqlite-extensions.patch
Patch198: 00198-add-rewheel-module.patch
%endif
-# OpenSSL disabled SSLv3 in SSLv23 method
-# This patch alters python tests to reflect this change
-# Issue:
http://bugs.python.org/issue22638 Upstream discussion about SSLv3 in Python
-Patch199: 00199-alter-tests-to-reflect-sslv3-disabled.patch
+# test_gdb.test_threads fails when run within rpmbuild
+# I couldnt reproduce the issue outside of rpmbuild, therefore
+# I skip test for now
+Patch200: 00200-skip-thread-test.patch
# (New patches go here ^^^)
#
@@ -1292,8 +1292,8 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
# 00197: upstream as of Python 2.7.9
%if 0%{with_rewheel}
%patch198 -p1
-%patch199 -p1
%endif
+%patch200 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -2155,6 +2155,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Tue Dec 15 2015 Robert Kuska <rkuska(a)redhat.com> - 2.7.11-1
+- Update to 2.7.11
+
* Thu Oct 15 2015 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.10-11
- provide/obsolete _isa packages in python_provide (#1271776)
diff --git a/sources b/sources
index 61bfd3d..827a703 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-c685ef0b8e9f27b5e3db5db12b268ac6 Python-2.7.10.tar.xz
+1dbcc848b4cd8399a8199d000f9f823c Python-2.7.11.tar.xz
commit 3b6fac0339bab69ca5fbf2881568f0565ab0e252
Author: Thomas Spura <thomas.spura(a)gmail.com>
Date: Thu Oct 15 22:27:31 2015 +0200
provide/obsolete _isa packages in python_provide (#1271776)
diff --git a/macros.python b/macros.python
index 938e422..84b9f57 100644
--- a/macros.python
+++ b/macros.python
@@ -13,33 +13,37 @@ CFLAGS="%{optflags}" %{__python} %{py_setup}
%{?py_setup_args} install -O1 --ski
function string.starts(String,Start)\
return string.sub(String,1,string.len(Start))==Start\
end\
- str = rpm.expand("%{?1:%{1}}");\
+ package = rpm.expand("%{?1:%{1}}");\
vr = rpm.expand("%{?epoch:%{epoch}:}%{version}-%{release}")
- if (string.starts(str, "python2-")) then\
- print("Provides: python-");\
- print(string.sub(str,9,string.len(str)));\
+ if (string.starts(package, "python2-")) then\
+ str = "Provides: python-" ..
string.sub(package,9,string.len(package)) .. "%{?_isa} = " .. vr;\
+ print(rpm.expand(str));\
+ print("\\nProvides: python-");\
+ print(string.sub(package,9,string.len(package)));\
print(" = ");\
print(vr);\
--Obsoleting the previous default python package\
+ str = "\\nObsoletes: python-" ..
string.sub(package,9,string.len(package)) .. "%{?_isa} < " .. vr;\
+ print(rpm.expand(str));\
print("\\nObsoletes: python-");\
- print(string.sub(str,9,string.len(str)));\
+ print(string.sub(package,9,string.len(package)));\
print(" < ");\
print(vr);\
- elseif (string.starts(str, "python3-")) then\
+ elseif (string.starts(package, "python3-")) then\
--No unversioned provides as python3 is not default\
- elseif (string.starts(str, "pypy-")) then\
+ elseif (string.starts(package, "pypy-")) then\
--No unversioned provides as pypy is not default\
- elseif (string.starts(str, "pypy3-")) then\
+ elseif (string.starts(package, "pypy3-")) then\
--No unversioned provides as pypy is not default\
- elseif (string.starts(str, "python-")) then\
+ elseif (string.starts(package, "python-")) then\
--Providing the current default python\
print("Provides: python2-");\
- print(string.sub(str,8,string.len(str)));\
+ print(string.sub(package,8,string.len(package)));\
print(" = ");\
print(vr);\
else\
print("ERROR: ");\
- print(str);\
+ print(package);\
print("not recognized.");\
end\
}
diff --git a/python.spec b/python.spec
index 2635734..8110d7d 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.10
-Release: 10%{?dist}
+Release: 11%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -2155,6 +2155,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu Oct 15 2015 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.10-11
+- provide/obsolete _isa packages in python_provide (#1271776)
+
* Wed Sep 23 2015 Robert Kuska <rkuska(a)redhat.com> - 2.7.10-10
- Revert the moving modules to python-tools because distutils uses lib2to3
commit 2881873aa2c9da2f0307a7b2c86eb07b4dcbe0bc
Author: Robert Kuska <rkuska(a)redhat.com>
Date: Wed Sep 23 08:53:54 2015 +0200
Revert moving modules to python-tools as distutils uses lib2to3
diff --git a/python.spec b/python.spec
index a252c7d..2635734 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.10
-Release: 9%{?dist}
+Release: 10%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1902,9 +1902,12 @@ rm -fr %{buildroot}
%{pylibdir}/email/mime
%{pylibdir}/encodings
%{pylibdir}/hotshot
+%{pylibdir}/idlelib
%{pylibdir}/importlib
%dir %{pylibdir}/json
%{pylibdir}/json/*.py*
+%{pylibdir}/lib2to3
+%exclude %{pylibdir}/lib2to3/tests
%{pylibdir}/logging
%{pylibdir}/multiprocessing
%{pylibdir}/plat-linux2
@@ -1981,9 +1984,6 @@ rm -fr %{buildroot}
%{_bindir}/pynche*
%{_bindir}/pygettext*.py*
%{_bindir}/msgfmt*.py*
-%{pylibdir}/idlelib
-%{pylibdir}/lib2to3
-%exclude %{pylibdir}/lib2to3/tests
%{tools_dir}
%{demo_dir}
%{pylibdir}/Doc
@@ -2155,6 +2155,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Wed Sep 23 2015 Robert Kuska <rkuska(a)redhat.com> - 2.7.10-10
+- Revert the moving modules to python-tools because distutils uses lib2to3
+
* Tue Sep 22 2015 Robert Kuska <rkuska(a)redhat.com> - 2.7.10-9
- Move idlelib and lib2to3 modules to pythont-tools
commit 411ce91104f046d6ca1344c435b0b2cdb6848ec7
Author: Robert Kuska <rkuska(a)redhat.com>
Date: Tue Sep 22 12:50:41 2015 +0200
Move idlelib and libto3 to python-tools
This change aims to shrink volume of default python installation
diff --git a/python.spec b/python.spec
index ad54f4f..a252c7d 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.10
-Release: 8%{?dist}
+Release: 9%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1902,12 +1902,9 @@ rm -fr %{buildroot}
%{pylibdir}/email/mime
%{pylibdir}/encodings
%{pylibdir}/hotshot
-%{pylibdir}/idlelib
%{pylibdir}/importlib
%dir %{pylibdir}/json
%{pylibdir}/json/*.py*
-%{pylibdir}/lib2to3
-%exclude %{pylibdir}/lib2to3/tests
%{pylibdir}/logging
%{pylibdir}/multiprocessing
%{pylibdir}/plat-linux2
@@ -1984,6 +1981,9 @@ rm -fr %{buildroot}
%{_bindir}/pynche*
%{_bindir}/pygettext*.py*
%{_bindir}/msgfmt*.py*
+%{pylibdir}/idlelib
+%{pylibdir}/lib2to3
+%exclude %{pylibdir}/lib2to3/tests
%{tools_dir}
%{demo_dir}
%{pylibdir}/Doc
@@ -2155,6 +2155,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Tue Sep 22 2015 Robert Kuska <rkuska(a)redhat.com> - 2.7.10-9
+- Move idlelib and lib2to3 modules to pythont-tools
+
* Thu Sep 3 2015 Orion Poplawski <orion(a)cora.nwra.com> - 2.7.10-8
- Fix quoting in %%python_provide macro
commit 7fdb9bedcda48894b7ba85e34ca5722b28b69076
Author: Orion Poplawski <orion(a)cora.nwra.com>
Date: Thu Sep 3 14:05:21 2015 -0600
Fix quoting in %python_provide macro
diff --git a/macros.python b/macros.python
index 8988b83..938e422 100644
--- a/macros.python
+++ b/macros.python
@@ -21,7 +21,7 @@ CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args}
install -O1 --ski
print(" = ");\
print(vr);\
--Obsoleting the previous default python package\
- print("\nObsoletes: python-");\
+ print("\\nObsoletes: python-");\
print(string.sub(str,9,string.len(str)));\
print(" < ");\
print(vr);\
diff --git a/python.spec b/python.spec
index dd4bddb..ad54f4f 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.10
-Release: 7%{?dist}
+Release: 8%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -2155,6 +2155,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu Sep 3 2015 Orion Poplawski <orion(a)cora.nwra.com> - 2.7.10-8
+- Fix quoting in %%python_provide macro
+
* Thu Sep 3 2015 Orion Poplawski <orion(a)cora.nwra.com> - 2.7.10-7
- Add obsoletes to %%python_provide macro to fix upgrade path
- Fix python2- provides for python- packages in %%python_provide
commit cb9dd734593c52b84f0b9b6f19f352001c1d50d3
Author: Orion Poplawski <orion(a)cora.nwra.com>
Date: Thu Sep 3 11:44:33 2015 -0600
Add obsoletes to %python_provide macro to fix upgrade path
- Fix python2- provides for python- packages in %python_provide
diff --git a/macros.python b/macros.python
index 376b1f5..8988b83 100644
--- a/macros.python
+++ b/macros.python
@@ -20,6 +20,11 @@ CFLAGS="%{optflags}" %{__python} %{py_setup}
%{?py_setup_args} install -O1 --ski
print(string.sub(str,9,string.len(str)));\
print(" = ");\
print(vr);\
+ --Obsoleting the previous default python package\
+ print("\nObsoletes: python-");\
+ print(string.sub(str,9,string.len(str)));\
+ print(" < ");\
+ print(vr);\
elseif (string.starts(str, "python3-")) then\
--No unversioned provides as python3 is not default\
elseif (string.starts(str, "pypy-")) then\
@@ -29,7 +34,7 @@ CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args}
install -O1 --ski
elseif (string.starts(str, "python-")) then\
--Providing the current default python\
print("Provides: python2-");\
- print(string.sub(str,9,string.len(str)));\
+ print(string.sub(str,8,string.len(str)));\
print(" = ");\
print(vr);\
else\
diff --git a/python.spec b/python.spec
index f7501b7..dd4bddb 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.10
-Release: 6%{?dist}
+Release: 7%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -2155,6 +2155,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu Sep 3 2015 Orion Poplawski <orion(a)cora.nwra.com> - 2.7.10-7
+- Add obsoletes to %%python_provide macro to fix upgrade path
+- Fix python2- provides for python- packages in %%python_provide
+
* Thu Jul 23 2015 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.10-6
- python-macros: remove R on python (#1246036)
commit 988c58d85224e5b4fffe4df2ad307f4a2c3b981b
Author: Thomas Spura <thomas.spura(a)gmail.com>
Date: Thu Jul 23 18:30:50 2015 +0200
python-macros: remove R on python (#1246036)
diff --git a/python.spec b/python.spec
index 3c17642..f7501b7 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.10
-Release: 5%{?dist}
+Release: 6%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1043,7 +1043,6 @@ documentation.
%package -n python-macros
Summary: The unversioned Python RPM macros
Group: Development/Libraries
-Requires: %{python} = %{version}-%{release}
BuildArch: noarch
%description -n python-macros
@@ -2156,6 +2155,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu Jul 23 2015 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.10-6
+- python-macros: remove R on python (#1246036)
+
* Wed Jul 22 2015 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.10-5
- Include epoch in the python_provide macro fpc#534 (Slavek Kabrda)
commit ff7069b4c937648d64c43ab58b9a5ae654b8c31d
Author: Thomas Spura <thomas.spura(a)gmail.com>
Date: Wed Jul 22 17:42:55 2015 +0200
Include epoch in the python_provide macro fpc#534 (Slavek Kabrda)
diff --git a/macros.python b/macros.python
index 9240d61..376b1f5 100644
--- a/macros.python
+++ b/macros.python
@@ -14,7 +14,7 @@ CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args}
install -O1 --ski
return string.sub(String,1,string.len(Start))==Start\
end\
str = rpm.expand("%{?1:%{1}}");\
- vr = rpm.expand("%{version}-%{release}")
+ vr = rpm.expand("%{?epoch:%{epoch}:}%{version}-%{release}")
if (string.starts(str, "python2-")) then\
print("Provides: python-");\
print(string.sub(str,9,string.len(str)));\
diff --git a/python.spec b/python.spec
index 179e126..3c17642 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.10
-Release: 4%{?dist}
+Release: 5%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -2156,6 +2156,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Wed Jul 22 2015 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.10-5
+- Include epoch in the python_provide macro fpc#534 (Slavek Kabrda)
+
* Mon Jun 29 2015 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.10-4
- correct python_provide macro to include version only when emiting provides
commit 855b225caa8e5541ddde02647da93ee660c0e1cb
Author: Thomas Spura <thomas.spura(a)gmail.com>
Date: Mon Jun 29 17:52:58 2015 +0200
correct python_provide macro to include version only when emiting provides
diff --git a/macros.python b/macros.python
index afe8040..9240d61 100644
--- a/macros.python
+++ b/macros.python
@@ -18,6 +18,8 @@ CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args}
install -O1 --ski
if (string.starts(str, "python2-")) then\
print("Provides: python-");\
print(string.sub(str,9,string.len(str)));\
+ print(" = ");\
+ print(vr);\
elseif (string.starts(str, "python3-")) then\
--No unversioned provides as python3 is not default\
elseif (string.starts(str, "pypy-")) then\
@@ -28,11 +30,11 @@ CFLAGS="%{optflags}" %{__python} %{py_setup}
%{?py_setup_args} install -O1 --ski
--Providing the current default python\
print("Provides: python2-");\
print(string.sub(str,9,string.len(str)));\
+ print(" = ");\
+ print(vr);\
else\
print("ERROR: ");\
print(str);\
print("not recognized.");\
end\
- print(" = ");\
- print(vr);\
}
diff --git a/python.spec b/python.spec
index 017a895..179e126 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.10
-Release: 3%{?dist}
+Release: 4%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -2156,6 +2156,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Mon Jun 29 2015 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.10-4
+- correct python_provide macro to include version only when emiting provides
+
* Thu Jun 25 2015 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.10-3
- Add unversioned python-macros from fpc#281 and fpc#534
and require it from python-devel
commit ab8fbd327d601db7dfbf8089de996c48eaeb3469
Author: Thomas Spura <thomas.spura(a)gmail.com>
Date: Mon Jun 29 11:11:25 2015 +0200
Make python-macros noarch
diff --git a/python.spec b/python.spec
index 534a316..017a895 100644
--- a/python.spec
+++ b/python.spec
@@ -1044,6 +1044,7 @@ documentation.
Summary: The unversioned Python RPM macros
Group: Development/Libraries
Requires: %{python} = %{version}-%{release}
+BuildArch: noarch
%description -n python-macros
This package contains the unversioned Python RPM macros, that most
@@ -2156,8 +2157,9 @@ rm -fr %{buildroot}
%changelog
* Thu Jun 25 2015 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.10-3
-- Add unversioned python macros from fpc#281 and fpc#534
+- Add unversioned python-macros from fpc#281 and fpc#534
and require it from python-devel
+- Make python-macros noarch
* Wed Jun 17 2015 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.10-2
- Make relocating Python by changing _prefix actually work
commit 965c95ee11d1ce7bfba4b751e763e8aeccc26d21
Author: Thomas Spura <thomas.spura(a)gmail.com>
Date: Thu Jun 25 18:59:04 2015 +0200
Add unversioned python macros
These macros are taken from fpc#281 and fpc#534 and the python-devel package
requires it.
diff --git a/macros.python b/macros.python
new file mode 100644
index 0000000..afe8040
--- /dev/null
+++ b/macros.python
@@ -0,0 +1,38 @@
+%py_setup setup.py
+%py_shbang_opts -s
+
+%py_build() %{expand:\
+CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} build
--executable="%{__python2} %{py_shbang_opts}" %{?1}\
+}
+
+%py_install() %{expand:\
+CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} install -O1
--skip-build --root %{buildroot} %{?1}\
+}
+
+%python_provide() %{lua:\
+ function string.starts(String,Start)\
+ return string.sub(String,1,string.len(Start))==Start\
+ end\
+ str = rpm.expand("%{?1:%{1}}");\
+ vr = rpm.expand("%{version}-%{release}")
+ if (string.starts(str, "python2-")) then\
+ print("Provides: python-");\
+ print(string.sub(str,9,string.len(str)));\
+ elseif (string.starts(str, "python3-")) then\
+ --No unversioned provides as python3 is not default\
+ elseif (string.starts(str, "pypy-")) then\
+ --No unversioned provides as pypy is not default\
+ elseif (string.starts(str, "pypy3-")) then\
+ --No unversioned provides as pypy is not default\
+ elseif (string.starts(str, "python-")) then\
+ --Providing the current default python\
+ print("Provides: python2-");\
+ print(string.sub(str,9,string.len(str)));\
+ else\
+ print("ERROR: ");\
+ print(str);\
+ print("not recognized.");\
+ end\
+ print(" = ");\
+ print(vr);\
+}
diff --git a/macros.python2 b/macros.python2
index 352f241..6bfd7f8 100644
--- a/macros.python2
+++ b/macros.python2
@@ -3,3 +3,13 @@
%python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib;
print(get_python_lib(1))")
%python2_version %(%{__python2} -c "import sys;
sys.stdout.write('{0.major}.{0.minor}'.format(sys.version_info))")
%python2_version_nodots %(%{__python2} -c "import sys;
sys.stdout.write('{0.major}{0.minor}'.format(sys.version_info))")
+
+%py2_shbang_opts -s
+
+%py2_build() %{expand:\
+CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} build
--executable="%{__python2} %{py2_shbang_opts}" %{?1}\
+}
+
+%py2_install() %{expand:\
+CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} install -O1
--skip-build --root %{buildroot} %{?1}\
+}
diff --git a/python.spec b/python.spec
index 9804576..534a316 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.10
-Release: 2%{?dist}
+Release: 3%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -207,6 +207,10 @@ Source6: macros.python2
Source7: pynche
+# Supply version independent macros such as python_provide, py_build and
+# py_install
+Source8: macros.python
+
# Modules/Setup.dist is ultimately used by the "makesetup" script to construct
# the Makefile and config.c
#
@@ -1014,6 +1018,7 @@ a scripting language, and by the main "python" executable
Summary: The libraries and header files needed for Python development
Group: Development/Libraries
Requires: %{python}%{?_isa} = %{version}-%{release}
+Requires: python-macros = %{version}-%{release}
Requires: pkgconfig
# Needed here because of the migration of Makefile from -devel to the main
# package
@@ -1035,6 +1040,18 @@ python package will also need to be installed. You'll probably
also
want to install the python-docs package, which contains Python
documentation.
+%package -n python-macros
+Summary: The unversioned Python RPM macros
+Group: Development/Libraries
+Requires: %{python} = %{version}-%{release}
+
+%description -n python-macros
+This package contains the unversioned Python RPM macros, that most
+implementations should rely on.
+
+You should not need to install this package manually as the various
+python?-devel packages require it. So install a python-devel package instead.
+
%package tools
Summary: A collection of development tools included with Python
Group: Development/Tools
@@ -1638,6 +1655,7 @@ sed -i -e
"s/'pyconfig.h'/'%{_pyconfig_h}'/" \
# Install macros for rpm:
mkdir -p %{buildroot}/%{_rpmconfigdir}/macros.d/
install -m 644 %{SOURCE6} %{buildroot}/%{_rpmconfigdir}/macros.d/
+install -m 644 %{SOURCE8} %{buildroot}/%{_rpmconfigdir}/macros.d/
# Ensure that the curses module was linked against libncursesw.so, rather than
# libncurses.so (bug 539917)
@@ -1952,6 +1970,10 @@ rm -fr %{buildroot}
%{_libdir}/libpython%{pybasever}.so
%{_rpmconfigdir}/macros.d/macros.python2
+%files -n python-macros
+%defattr(-,root,root,-)
+%{_rpmconfigdir}/macros.d/macros.python
+
%files tools
%defattr(-,root,root,755)
%doc Tools/pynche/README.pynche
@@ -2133,6 +2155,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu Jun 25 2015 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.10-3
+- Add unversioned python macros from fpc#281 and fpc#534
+ and require it from python-devel
+
* Wed Jun 17 2015 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.10-2
- Make relocating Python by changing _prefix actually work
Resolves: rhbz#1231801
commit a8af8d5b71852945496f5a5312934424ab10f9b0
Author: Matej Stuchlik <mstuchli(a)redhat.com>
Date: Wed Jun 17 11:52:33 2015 +0200
Make relocating Python by changing _prefix actually work (rhbz#1231801)
diff --git a/python.spec b/python.spec
index 9157497..9804576 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.10
-Release: 1%{?dist}
+Release: 2%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1381,7 +1381,7 @@ if $PathFixWithThisBinary
then
LD_LIBRARY_PATH="$topdir/$ConfDir" ./$BinaryName \
$topdir/Tools/scripts/pathfix.py \
- -i "%{_bindir}/env $BinaryName" \
+ -i "/usr/bin/env $BinaryName" \
$topdir
fi
@@ -1502,7 +1502,7 @@ InstallPython optimized \
# (which changes them by itself)
# Make sure we preserve the file permissions
for fixed in %{buildroot}%{_bindir}/pydoc; do
- sed 's,#!.*/python$,#!%{_bindir}/env python%{pybasever},' $fixed > $fixed-
\
+ sed 's,#!.*/python$,#!/usr/bin/env python%{pybasever},' $fixed > $fixed-
\
&& cat $fixed- > $fixed && rm -f $fixed-
done
@@ -1588,7 +1588,7 @@ rm -f %{buildroot}%{pylibdir}/email/test/data/audiotest.au
%{buildroot}%{pylibdi
# Fix bug #143667: python should own /usr/lib/python2.x on 64-bit machines
%if "%{_lib}" == "lib64"
-install -d %{buildroot}/usr/lib/python%{pybasever}/site-packages
+install -d %{buildroot}/%{_prefix}/lib/python%{pybasever}/site-packages
%endif
# Make python-devel multilib-ready (bug #192747, #139911)
@@ -2133,6 +2133,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Wed Jun 17 2015 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.10-2
+- Make relocating Python by changing _prefix actually work
+Resolves: rhbz#1231801
+
* Mon May 25 2015 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.10-1
- Update to 2.7.10
commit 4f33fd0ee9566c5d54bb501c275fb077e94a15be
Author: Matej Stuchlik <mstuchli(a)redhat.com>
Date: Tue May 26 13:46:18 2015 +0200
Upload new sources
diff --git a/sources b/sources
index a7b1f8e..61bfd3d 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-38d530f7efc373d64a8fb1637e3baaa7 Python-2.7.9.tar.xz
+c685ef0b8e9f27b5e3db5db12b268ac6 Python-2.7.10.tar.xz
commit 83d676a297b9dd29506ef65dfefa3d73db74ea0a
Author: Matej Stuchlik <mstuchli(a)redhat.com>
Date: Mon May 25 17:07:23 2015 +0200
Update to 2.7.10
diff --git a/00001-pydocnogui.patch b/00001-pydocnogui.patch
index 3b34842..0311f38 100644
--- a/00001-pydocnogui.patch
+++ b/00001-pydocnogui.patch
@@ -2,8 +2,8 @@ diff -up Python-2.7.3/Lib/pydoc.py.no_gui Python-2.7.3/Lib/pydoc.py
--- Python-2.7.3/Lib/pydoc.py.no_gui 2012-04-09 19:07:31.000000000 -0400
+++ Python-2.7.3/Lib/pydoc.py 2013-02-19 13:48:44.480054515 -0500
@@ -19,9 +19,6 @@ of all available modules.
- Run "pydoc -p <port>" to start an HTTP server on a given port on the
- local machine to generate documentation web pages.
+ local machine to generate documentation web pages. Port number 0 can be
+ used to get an arbitrary unused port.
-For platforms without a command line, "pydoc -g" starts the HTTP server
-and also pops up a little window for controlling it.
@@ -11,19 +11,9 @@ diff -up Python-2.7.3/Lib/pydoc.py.no_gui Python-2.7.3/Lib/pydoc.py
Run "pydoc -w <name>" to write out the HTML documentation for a module
to a file named "<name>.html".
-@@ -2290,9 +2287,6 @@ def cli():
- writing = 0
-
- for opt, val in opts:
-- if opt == '-g':
-- gui()
-- return
- if opt == '-k':
- apropos(val)
- return
@@ -2346,13 +2340,10 @@ def cli():
- %s -p <port>
- Start an HTTP server on the given port on the local machine.
+ Start an HTTP server on the given port on the local machine. Port
+ number 0 can be used to get an arbitrary unused port.
-%s -g
- Pop up a graphical interface for finding and serving documentation.
diff --git a/00136-skip-tests-of-seeking-stdin-in-rpmbuild.patch
b/00136-skip-tests-of-seeking-stdin-in-rpmbuild.patch
index 1214055..4d7626f 100644
--- a/00136-skip-tests-of-seeking-stdin-in-rpmbuild.patch
+++ b/00136-skip-tests-of-seeking-stdin-in-rpmbuild.patch
@@ -6,6 +6,6 @@ diff -up Python-2.7.6/Lib/test/test_file2k.py.stdin-test
Python-2.7.6/Lib/test/t
f.close()
+ @unittest._skipInRpmBuild('seems not to raise the exception when run in
Koji')
- def testStdin(self):
- # This causes the interpreter to exit on OSF1 v5.1.
- if sys.platform != 'osf1V5':
+ def testStdinSeek(self):
+ if sys.platform == 'osf1V5':
+ # This causes the interpreter to exit on OSF1 v5.1.
diff --git a/00153-fix-test_gdb-noise.patch b/00153-fix-test_gdb-noise.patch
index 8b0a76c..d1a1b6e 100644
--- a/00153-fix-test_gdb-noise.patch
+++ b/00153-fix-test_gdb-noise.patch
@@ -13,9 +13,9 @@
+ # Disable this:
+ 'set print entry-values no',
+
- 'run']
- if cmds_after_breakpoint:
- commands += cmds_after_breakpoint
+
+ # The tests assume that the first frame of printed
+ # backtrace will not contain program counter,
--- Lib/test/test_gdb.py.old 2012-04-11 21:04:01.367073855 -0400
+++ Lib/test/test_gdb.py 2012-04-12 08:52:58.320288761 -0400
@@ -144,6 +153,10 @@
diff --git a/00156-gdb-autoload-safepath.patch b/00156-gdb-autoload-safepath.patch
index 7193ad1..a16fe8d 100644
--- a/00156-gdb-autoload-safepath.patch
+++ b/00156-gdb-autoload-safepath.patch
@@ -21,11 +21,13 @@ diff -up Python-2.7.3/Lib/test/test_gdb.py.gdb-autoload-safepath
Python-2.7.3/Li
class DebuggerTests(unittest.TestCase):
"""Test that the debugger can debug Python."""
-@@ -112,15 +125,28 @@ class DebuggerTests(unittest.TestCase):
- 'set print entry-values no',
+diff -up Python-2.7.10/Lib/test/test_gdb.py.ms Python-2.7.10/Lib/test/test_gdb.py
+--- Python-2.7.10/Lib/test/test_gdb.py.ms 2015-05-25 17:00:25.028462615 +0200
++++ Python-2.7.10/Lib/test/test_gdb.py 2015-05-25 17:01:53.166359822 +0200
+@@ -153,6 +153,17 @@ class DebuggerTests(unittest.TestCase):
'run']
-+
+
+ if HAS_AUTOLOAD_SAFEPATH:
+ # Recent GDBs will only auto-load scripts from certain safe
+ # locations.
@@ -36,13 +38,16 @@ diff -up Python-2.7.3/Lib/test/test_gdb.py.gdb-autoload-safepath
Python-2.7.3/Li
+ else:
+ init_commands = []
+
- if cmds_after_breakpoint:
- commands += cmds_after_breakpoint
++
+ # GDB as of 7.4 onwards can distinguish between the
+ # value of a variable at entry vs current value:
+ #
http://sourceware.org/gdb/onlinedocs/gdb/Variables.html
+@@ -167,10 +178,11 @@ class DebuggerTests(unittest.TestCase):
else:
commands += ['backtrace']
+- # print commands
+ # print init_commands
- # print commands
# Use "commands" to generate the arguments with which to invoke
"gdb":
args = ["gdb", "--batch", "-nx"]
diff --git a/00170-gc-assertions.patch b/00170-gc-assertions.patch
index 3fb37ff..f3a0838 100644
--- a/00170-gc-assertions.patch
+++ b/00170-gc-assertions.patch
@@ -3,8 +3,8 @@ diff -up Python-2.7.3/Lib/test/test_gc.py.gc-assertions
Python-2.7.3/Lib/test/te
+++ Python-2.7.3/Lib/test/test_gc.py 2013-02-20 16:39:52.720489297 -0500
@@ -1,6 +1,7 @@
import unittest
--from test.test_support import verbose, run_unittest
-+from test.test_support import verbose, run_unittest, import_module
+-from test.test_support import verbose, run_unittest, start_threads
++from test.test_support import verbose, run_unittest, start_threads, import_module
import sys
+import sysconfig
import time
diff --git a/python-2.5.1-plural-fix.patch b/python-2.5.1-plural-fix.patch
index 040adaf..5002cb2 100644
--- a/python-2.5.1-plural-fix.patch
+++ b/python-2.5.1-plural-fix.patch
@@ -7,6 +7,6 @@ diff -up Python-2.5.1/Lib/gettext.py.plural Python-2.5.1/Lib/gettext.py
continue
+ if item.startswith("#"):
+ continue
+ k = v = None
if ':' in item:
k, v = item.split(':', 1)
- k = k.strip().lower()
diff --git a/python.spec b/python.spec
index 13b8d3d..9157497 100644
--- a/python.spec
+++ b/python.spec
@@ -107,8 +107,8 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
# Remember to also rebase python-docs when changing this:
-Version: 2.7.9
-Release: 11%{?dist}
+Version: 2.7.10
+Release: 1%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -2133,6 +2133,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Mon May 25 2015 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.10-1
+- Update to 2.7.10
+
* Tue May 5 2015 Peter Robinson <pbrobinson(a)fedoraproject.org> 2.7.9-11
- Disable test_gdb on aarch64 (rhbz#1196181), it joins all other non x86 arches
commit 31a6ae971bfe56125a24190f71b3f6e24fa16add
Author: Peter Robinson <pbrobinson(a)gmail.com>
Date: Tue May 5 12:32:59 2015 +0100
Disable test_gdb on aarch64 (rhbz#1196181), it joins all other non x86 arches
diff --git a/python.spec b/python.spec
index d364e80..13b8d3d 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.9
-Release: 10%{?dist}
+Release: 11%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1715,7 +1715,7 @@ CheckPython() {
EXTRATESTOPTS="--verbose"
-%ifarch s390 s390x %{power64} %{arm}
+%ifarch s390 s390x %{power64} %{arm} aarch64
EXTRATESTOPTS="$EXTRATESTOPTS -x test_gdb"
%endif
@@ -2133,6 +2133,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Tue May 5 2015 Peter Robinson <pbrobinson(a)fedoraproject.org> 2.7.9-11
+- Disable test_gdb on aarch64 (rhbz#1196181), it joins all other non x86 arches
+
* Wed Apr 15 2015 Robert Kuska <rkuska(a)redhat.com> - 2.7.9-10
- Remove provides/obsolates for unittest2
- Skip test_gdb on arm until rhbz#1196181 is resolved
commit 3a252e136bc66dc5066e461d68a1d5941094618d
Author: Robert Kuska <rkuska(a)redhat.com>
Date: Wed Apr 15 14:01:04 2015 +0200
Skip test_gdb on arm until rhbz#1196181 is resolved
diff --git a/python.spec b/python.spec
index 29f5d9a..d364e80 100644
--- a/python.spec
+++ b/python.spec
@@ -1715,7 +1715,7 @@ CheckPython() {
EXTRATESTOPTS="--verbose"
-%ifarch s390 s390x %{power64}
+%ifarch s390 s390x %{power64} %{arm}
EXTRATESTOPTS="$EXTRATESTOPTS -x test_gdb"
%endif
@@ -2135,6 +2135,7 @@ rm -fr %{buildroot}
%changelog
* Wed Apr 15 2015 Robert Kuska <rkuska(a)redhat.com> - 2.7.9-10
- Remove provides/obsolates for unittest2
+- Skip test_gdb on arm until rhbz#1196181 is resolved
* Thu Mar 05 2015 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.9-9
- Add proper rewheel Requires
commit e5f25a5bca548d07f1c6e36f791401c53c9610eb
Author: Robert Kuska <rkuska(a)redhat.com>
Date: Wed Apr 15 11:22:46 2015 +0200
Remove unittest2 provides/obsoletes
Resolves: rbhz#1160495
diff --git a/python.spec b/python.spec
index 90549fb..29f5d9a 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.9
-Release: 9%{?dist}
+Release: 10%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -957,8 +957,6 @@ Obsoletes: python-ctypes < 1.0.1
Provides: python-ctypes = 1.0.1
Obsoletes: python-hashlib < 20081120
Provides: python-hashlib = 20081120
-Obsoletes: python-unittest2 < 0.5.1-9
-Provides: python-unittest2 = 0.5.1-9
Obsoletes: python-uuid < 1.31
Provides: python-uuid = 1.31
# obsolete, not provide PyXML as proposed in feature
@@ -2135,6 +2133,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Wed Apr 15 2015 Robert Kuska <rkuska(a)redhat.com> - 2.7.9-10
+- Remove provides/obsolates for unittest2
+
* Thu Mar 05 2015 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.9-9
- Add proper rewheel Requires
commit da90bba09ac9215ba823f3a00b3ed596be6c6b38
Author: Matej Stuchlik <mstuchli(a)redhat.com>
Date: Thu Mar 5 11:48:47 2015 +0100
Add proper rewheel Requires
diff --git a/python.spec b/python.spec
index e814fad..90549fb 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.9
-Release: 8%{?dist}
+Release: 9%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -169,6 +169,9 @@ BuildRequires: zlib-devel
%if 0%{?with_rewheel}
BuildRequires: python-setuptools
BuildRequires: python-pip
+
+Requires: python-setuptools
+Requires: python-pip
%endif
@@ -2132,6 +2135,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu Mar 05 2015 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.9-9
+- Add proper rewheel Requires
+
* Sat Feb 21 2015 Till Maas <opensource(a)till.name> - 2.7.9-8
- Rebuilt for Fedora 23 Change
https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-...
commit 8c96efe002efe464803280ec919062ffa421e039
Author: Till Maas <opensource(a)till.name>
Date: Sat Feb 21 22:16:41 2015 +0100
Rebuilt for Fedora 23 Change
https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-...
diff --git a/python.spec b/python.spec
index 05e6792..e814fad 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.9
-Release: 7%{?dist}
+Release: 8%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -2132,6 +2132,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Sat Feb 21 2015 Till Maas <opensource(a)till.name> - 2.7.9-8
+- Rebuilt for Fedora 23 Change
+
https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-...
+
* Sat Feb 21 2015 Till Maas <opensource(a)till.name> - 2.7.9-7
- Rebuilt for Fedora 23 Change
https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-...
commit 847e7caf401f67700595fadc7cacfe05e4731c14
Author: Till Maas <opensource(a)till.name>
Date: Sat Feb 21 21:28:14 2015 +0100
Rebuilt for Fedora 23 Change
https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-...
diff --git a/python.spec b/python.spec
index bba9698..05e6792 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.9
-Release: 6%{?dist}
+Release: 7%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -2132,6 +2132,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Sat Feb 21 2015 Till Maas <opensource(a)till.name> - 2.7.9-7
+- Rebuilt for Fedora 23 Change
+
https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-...
+
* Tue Feb 17 2015 Ville Skytt <ville.skytta(a)iki.fi> - 2.7.9-6
- Own systemtap dirs (#710733)
commit a988484e2153bfe9884ddf1280963788245adec5
Author: Ville Skytt <ville.skytta(a)iki.fi>
Date: Tue Feb 17 21:29:42 2015 +0200
Own systemtap dirs (#710733)
diff --git a/python.spec b/python.spec
index a49761f..bba9698 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.9
-Release: 5%{?dist}
+Release: 6%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1916,6 +1916,8 @@ rm -fr %{buildroot}
%{_libdir}/%{py_INSTSONAME_optimized}
%if 0%{?with_systemtap}
+%dir %(dirname %{tapsetdir})
+%dir %{tapsetdir}
%{tapsetdir}/%{libpython_stp_optimized}
%doc systemtap-example.stp pyfuntop.stp
%endif
@@ -2079,6 +2081,8 @@ rm -fr %{buildroot}
%{_libdir}/%{py_INSTSONAME_debug}
%if 0%{?with_systemtap}
+%dir %(dirname %{tapsetdir})
+%dir %{tapsetdir}
%{tapsetdir}/%{libpython_stp_debug}
%endif
@@ -2128,6 +2132,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Tue Feb 17 2015 Ville Skytt <ville.skytta(a)iki.fi> - 2.7.9-6
+- Own systemtap dirs (#710733)
+
* Fri Feb 06 2015 Karsten Hopp <karsten(a)redhat.com> 2.7.9-5
- disable test_gdb on ppc64* until rhbz#1132488 is really resolved
commit 80188df0a818b54761bdc712f8466920c903da1c
Author: Karsten Hopp <karsten(a)redhat.com>
Date: Fri Feb 6 15:34:10 2015 +0100
disable test_gdb on ppc64* until rhbz#1132488 is really resolved
diff --git a/python.spec b/python.spec
index 8edd478..a49761f 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.9
-Release: 4%{?dist}
+Release: 5%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1714,7 +1714,7 @@ CheckPython() {
EXTRATESTOPTS="--verbose"
-%ifarch s390 s390x
+%ifarch s390 s390x %{power64}
EXTRATESTOPTS="$EXTRATESTOPTS -x test_gdb"
%endif
@@ -2128,6 +2128,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Fri Feb 06 2015 Karsten Hopp <karsten(a)redhat.com> 2.7.9-5
+- disable test_gdb on ppc64* until rhbz#1132488 is really resolved
+
* Tue Jan 20 2015 Slavek Kabrda <bkabrda(a)redhat.com> - 2.7.9-4
- We need to provide both arch specific and noarch Provide for python2-devel
in order not to break noarch builds.
commit dc37a5e7f063f6fd502fde1d319305f274aaccd3
Author: Slavek Kabrda <bkabrda(a)redhat.com>
Date: Tue Jan 20 17:05:27 2015 +0100
We need to provide both arch specific and noarch Provide for python2-devel
in order not to break noarch builds.
diff --git a/python.spec b/python.spec
index 16b5f61..8edd478 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.9
-Release: 3%{?dist}
+Release: 4%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1019,6 +1019,7 @@ Requires: pkgconfig
Conflicts: %{python} < %{version}-%{release}
%if %{main_python}
Obsoletes: python2-devel
+Provides: python2-devel = %{version}-%{release}
Provides: python2-devel%{?_isa} = %{version}-%{release}
%endif
@@ -2127,6 +2128,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Tue Jan 20 2015 Slavek Kabrda <bkabrda(a)redhat.com> - 2.7.9-4
+- We need to provide both arch specific and noarch Provide for python2-devel
+in order not to break noarch builds.
+
* Tue Jan 20 2015 Slavek Kabrda <bkabrda(a)redhat.com> - 2.7.9-3
- Make python2-devel provide arch specific.
Resolves: rhbz#1183530
commit 5b91169040c9806d7d83db4fe866405058a6a9ce
Author: Slavek Kabrda <bkabrda(a)redhat.com>
Date: Tue Jan 20 14:33:33 2015 +0100
Make python2-devel provide arch specific.
Resolves: rhbz#1183530
diff --git a/python.spec b/python.spec
index fb6e01c..16b5f61 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.9
-Release: 2%{?dist}
+Release: 3%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1019,7 +1019,7 @@ Requires: pkgconfig
Conflicts: %{python} < %{version}-%{release}
%if %{main_python}
Obsoletes: python2-devel
-Provides: python2-devel = %{version}-%{release}
+Provides: python2-devel%{?_isa} = %{version}-%{release}
%endif
%description devel
@@ -2127,6 +2127,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Tue Jan 20 2015 Slavek Kabrda <bkabrda(a)redhat.com> - 2.7.9-3
+- Make python2-devel provide arch specific.
+Resolves: rhbz#1183530
+
* Mon Jan 12 2015 Dan Hork <dan[at]danny.cz> - 2.7.9-2
- build with valgrind on ppc64le
- disable test_gdb on s390(x) until rhbz#1181034 is resolved
commit cfa0d57d9ef303fa7d9396e2923e779389b4cb9e
Author: Dan Hork <dan(a)danny.cz>
Date: Mon Jan 12 07:46:45 2015 -0500
- build with valgrind on ppc64le
- disable test_gdb on s390(x) until rhbz#1181034 is resolved
diff --git a/python.spec b/python.spec
index 650e1d4..fb6e01c 100644
--- a/python.spec
+++ b/python.spec
@@ -47,7 +47,7 @@
%global with_systemtap 1
# some arches don't have valgrind so we need to disable its support on them
-%ifnarch s390 ppc64le
+%ifnarch s390
%global with_valgrind 1
%else
%global with_valgrind 0
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.9
-Release: 1%{?dist}
+Release: 2%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1713,6 +1713,10 @@ CheckPython() {
EXTRATESTOPTS="--verbose"
+%ifarch s390 s390x
+ EXTRATESTOPTS="$EXTRATESTOPTS -x test_gdb"
+%endif
+
%if 0%{?with_huntrleaks}
# Try to detect reference leaks on debug builds. By default this means
# running every test 10 times (6 to stabilize, then 4 to watch):
@@ -2123,6 +2127,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Mon Jan 12 2015 Dan Hork <dan[at]danny.cz> - 2.7.9-2
+- build with valgrind on ppc64le
+- disable test_gdb on s390(x) until rhbz#1181034 is resolved
+
* Thu Dec 11 2014 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.9-1
- Update to 2.7.9
- Refreshed patches: #55, #137, #146, #153, #156, #198
commit 951dcd78fb0f0e822be108fd917dab00ca0f3598
Author: Robert Kuska <rkuska(a)redhat.com>
Date: Thu Dec 11 13:14:40 2014 +0100
Add the patch from previous commit
diff --git a/00199-alter-tests-to-reflect-sslv3-disabled.patch
b/00199-alter-tests-to-reflect-sslv3-disabled.patch
new file mode 100644
index 0000000..70a605b
--- /dev/null
+++ b/00199-alter-tests-to-reflect-sslv3-disabled.patch
@@ -0,0 +1,52 @@
+diff -up Python-2.7.9/Lib/test/test_ssl.py.ssl Python-2.7.9/Lib/test/test_ssl.py
+--- Python-2.7.9/Lib/test/test_ssl.py.ssl 2014-12-11 10:40:22.657795081 +0100
++++ Python-2.7.9/Lib/test/test_ssl.py 2014-12-11 11:25:11.925579957 +0100
+@@ -713,10 +713,7 @@ class ContextTests(unittest.TestCase):
+ @skip_if_broken_ubuntu_ssl
+ def test_options(self):
+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+- # OP_ALL | OP_NO_SSLv2 is the default value
+- self.assertEqual(ssl.OP_ALL | ssl.OP_NO_SSLv2,
+- ctx.options)
+- ctx.options |= ssl.OP_NO_SSLv3
++ # OP_ALL | OP_NO_SSLv2 | OP_NO_SSLv3 is the default value
+ self.assertEqual(ssl.OP_ALL | ssl.OP_NO_SSLv2 | ssl.OP_NO_SSLv3,
+ ctx.options)
+ if can_clear_options():
+@@ -2220,24 +2217,20 @@ else:
+ " SSL2 client to SSL23 server test unexpectedly
failed:\n %s\n"
+ % str(x))
+ if hasattr(ssl, 'PROTOCOL_SSLv3'):
+- try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3,
'SSLv3')
++ try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3, False)
+ try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv23, True)
+ try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1,
'TLSv1')
+
+ if hasattr(ssl, 'PROTOCOL_SSLv3'):
+- try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3,
'SSLv3', ssl.CERT_OPTIONAL)
++ try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3, False,
ssl.CERT_OPTIONAL)
+ try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv23, True,
ssl.CERT_OPTIONAL)
+ try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1, 'TLSv1',
ssl.CERT_OPTIONAL)
+
+ if hasattr(ssl, 'PROTOCOL_SSLv3'):
+- try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3,
'SSLv3', ssl.CERT_REQUIRED)
++ try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3, False,
ssl.CERT_REQUIRED)
+ try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv23, True,
ssl.CERT_REQUIRED)
+ try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1, 'TLSv1',
ssl.CERT_REQUIRED)
+
+- # Server with specific SSL options
+- if hasattr(ssl, 'PROTOCOL_SSLv3'):
+- try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3, False,
+- server_options=ssl.OP_NO_SSLv3)
+ # Will choose TLSv1
+ try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv23, True,
+ server_options=ssl.OP_NO_SSLv2 | ssl.OP_NO_SSLv3)
+@@ -2262,7 +2255,7 @@ else:
+ try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_TLSv1, False)
+ if no_sslv2_implies_sslv3_hello():
+ # No SSLv2 => client will use an SSLv3 hello on recent OpenSSLs
+- try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv23,
'SSLv3',
++ try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv23, False,
+ client_options=ssl.OP_NO_SSLv2)
+
+ @skip_if_broken_ubuntu_ssl
commit d48eeff57af008aec7553722530015e327f21592
Author: Robert Kuska <rkuska(a)redhat.com>
Date: Thu Dec 11 12:18:08 2014 +0100
SSLv3 is disabled by default in SSLv23 method in OpenSSL
diff --git a/python.spec b/python.spec
index 2e34041..650e1d4 100644
--- a/python.spec
+++ b/python.spec
@@ -907,6 +907,11 @@ Patch193: 00193-enable-loading-sqlite-extensions.patch
Patch198: 00198-add-rewheel-module.patch
%endif
+# OpenSSL disabled SSLv3 in SSLv23 method
+# This patch alters python tests to reflect this change
+# Issue:
http://bugs.python.org/issue22638 Upstream discussion about SSLv3 in Python
+Patch199: 00199-alter-tests-to-reflect-sslv3-disabled.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -1268,6 +1273,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
# 00197: upstream as of Python 2.7.9
%if 0%{with_rewheel}
%patch198 -p1
+%patch199 -p1
%endif
@@ -2121,6 +2127,7 @@ rm -fr %{buildroot}
- Update to 2.7.9
- Refreshed patches: #55, #137, #146, #153, #156, #198
- Dropped patches: #196, #197
+- New patch: #199
- Added the rewheel module
* Mon Nov 24 2014 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.8-10
commit b1e5a425db386ec6c8952f6da7ffa220b839948f
Author: Matej Stuchlik <mstuchli(a)redhat.com>
Date: Thu Dec 11 10:37:25 2014 +0100
Update to 2.7.9
diff --git a/00055-systemtap.patch b/00055-systemtap.patch
index 67ec005..63bc3f8 100644
--- a/00055-systemtap.patch
+++ b/00055-systemtap.patch
@@ -88,8 +88,8 @@ diff -up Python-2.7rc1/Makefile.pre.in.systemtap
Python-2.7rc1/Makefile.pre.in
.PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
.PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
.PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean
--.PHONY: smelly funny patchcheck touch altmaninstall
-+.PHONY: smelly funny patchcheck touch altmaninstall buildinclude
+-.PHONY: smelly funny patchcheck touch altmaninstall commoninstall
++.PHONY: smelly funny patchcheck touch altmaninstall commoninstall buildinclude
.PHONY: gdbhooks
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
diff --git a/00137-skip-distutils-tests-that-fail-in-rpmbuild.patch
b/00137-skip-distutils-tests-that-fail-in-rpmbuild.patch
index 8653772..7122a29 100644
--- a/00137-skip-distutils-tests-that-fail-in-rpmbuild.patch
+++ b/00137-skip-distutils-tests-that-fail-in-rpmbuild.patch
@@ -7,6 +7,6 @@ diff -up
Python-2.7.3/Lib/distutils/tests/test_bdist_rpm.py.mark-tests-that-fail
+(a)unittest._skipInRpmBuild("don't try to nest one rpm build inside another rpm
build")
class BuildRpmTestCase(support.TempdirManager,
+ support.EnvironGuard,
support.LoggingSilencer,
- unittest.TestCase):
diff -up
Python-2.7.3/Lib/distutils/tests/test_build_ext.py.mark-tests-that-fail-in-rpmbuild
Python-2.7.3/Lib/distutils/tests/test_build_ext.py
diff --git a/00146-hashlib-fips.patch b/00146-hashlib-fips.patch
index 696aa29..badb629 100644
--- a/00146-hashlib-fips.patch
+++ b/00146-hashlib-fips.patch
@@ -38,8 +38,8 @@ diff -up Python-2.7.2/Lib/hashlib.py.hashlib-fips
Python-2.7.2/Lib/hashlib.py
Hash objects have these methods:
- update(arg): Update the hash object with the string arg. Repeated calls
are equivalent to a single call with the concatenation of all
-@@ -63,74 +80,39 @@ algorithms = __always_supported
- __all__ = __always_supported + ('new', 'algorithms',
'pbkdf2_hmac')
+@@ -63,76 +80,41 @@ algorithms = __always_supported
+ 'pbkdf2_hmac')
-def __get_builtin_constructor(name):
@@ -118,6 +118,8 @@ diff -up Python-2.7.2/Lib/hashlib.py.hashlib-fips
Python-2.7.2/Lib/hashlib.py
import _hashlib
new = __hash_new
__get_hash = __get_openssl_constructor
+ algorithms_available = algorithms_available.union(
+ _hashlib.openssl_md_meth_names)
except ImportError:
- new = __py_new
- __get_hash = __get_builtin_constructor
@@ -570,7 +572,7 @@ diff -up Python-2.7.2/setup.py.hashlib-fips Python-2.7.2/setup.py
return ret_obj;
@@ -713,51 +785,111 @@
- #endif
+
/*
- * This macro generates constructor function definitions for specific
@@ -711,13 +713,14 @@ diff -up Python-2.7.2/setup.py.hashlib-fips Python-2.7.2/setup.py
GEN_CONSTRUCTOR(md5)
GEN_CONSTRUCTOR(sha1)
#ifdef _OPENSSL_SUPPORTS_SHA2
-@@ -794,13 +926,10 @@
+@@ -794,14 +926,11 @@
{
- PyObject *m;
+ PyObject *m, *openssl_md_meth_names;
+ SSL_load_error_strings();
+ SSL_library_init();
OpenSSL_add_all_digests();
+ ERR_load_crypto_strings();
- /* TODO build EVP_functions openssl_* entries dynamically based
- * on what hashes are supported rather than listing many
diff --git a/00153-fix-test_gdb-noise.patch b/00153-fix-test_gdb-noise.patch
index 50a0917..8b0a76c 100644
--- a/00153-fix-test_gdb-noise.patch
+++ b/00153-fix-test_gdb-noise.patch
@@ -19,8 +19,8 @@
--- Lib/test/test_gdb.py.old 2012-04-11 21:04:01.367073855 -0400
+++ Lib/test/test_gdb.py 2012-04-12 08:52:58.320288761 -0400
@@ -144,6 +153,10 @@
- 'Do you need "set solib-search-path" or '
- '"set sysroot"?',
+ 'Missing separate debuginfo for ',
+ 'Try: zypper install -C ',
)
+ ignore_patterns += ('warning: Unable to open',
+ 'Missing separate debuginfo for',
diff --git a/00156-gdb-autoload-safepath.patch b/00156-gdb-autoload-safepath.patch
index 54a5a6e..7193ad1 100644
--- a/00156-gdb-autoload-safepath.patch
+++ b/00156-gdb-autoload-safepath.patch
@@ -45,7 +45,7 @@ diff -up Python-2.7.3/Lib/test/test_gdb.py.gdb-autoload-safepath
Python-2.7.3/Li
# print commands
# Use "commands" to generate the arguments with which to invoke
"gdb":
- args = ["gdb", "--batch"]
+ args = ["gdb", "--batch", "-nx"]
+ args += ['--init-eval-command=%s' % cmd for cmd in init_commands]
args += ['--eval-command=%s' % cmd for cmd in commands]
args += ["--args",
diff --git a/00196-ssl-backport.patch b/00196-ssl-backport.patch
deleted file mode 100644
index 79cd81d..0000000
--- a/00196-ssl-backport.patch
+++ /dev/null
@@ -1,12963 +0,0 @@
-diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst
-index c115976..84dd332 100644
---- a/Doc/library/ssl.rst
-+++ b/Doc/library/ssl.rst
-@@ -28,19 +28,14 @@ probably additional platforms, as long as OpenSSL is installed on
that platform.
-
- Some behavior may be platform dependent, since calls are made to the
- operating system socket APIs. The installed version of OpenSSL may also
-- cause variations in behavior.
-+ cause variations in behavior. For example, TLSv1.1 and TLSv1.2 come with
-+ openssl version 1.0.1.
-
- .. warning::
-- The ssl module won't validate certificates by default. When used in
-- client mode, this means you are vulnerable to man-in-the-middle attacks.
-+ Don't use this module without reading the :ref:`ssl-security`. Doing so
-+ may lead to a false sense of security, as the default settings of the
-+ ssl module are not necessarily appropriate for your application.
-
--.. warning::
--
-- OpenSSL's internal random number generator does not properly handle fork.
-- Applications must change the PRNG state of the parent process if they use
-- any SSL feature with :func:`os.fork`. Any successful call of
-- :func:`~ssl.RAND_add`, :func:`~ssl.RAND_bytes` or
-- :func:`~ssl.RAND_pseudo_bytes` is sufficient.
-
- This section documents the objects and functions in the ``ssl`` module; for more
- general information about TLS, SSL, and certificates, the reader is referred to
-@@ -49,23 +44,101 @@ the documents in the "See Also" section at the bottom.
- This module provides a class, :class:`ssl.SSLSocket`, which is derived from the
- :class:`socket.socket` type, and provides a socket-like wrapper that also
- encrypts and decrypts the data going over the socket with SSL. It supports
--additional :meth:`read` and :meth:`write` methods, along with a method,
--:meth:`getpeercert`, to retrieve the certificate of the other side of the
--connection, and a method, :meth:`cipher`, to retrieve the cipher being used for
--the secure connection.
-+additional methods such as :meth:`getpeercert`, which retrieves the
-+certificate of the other side of the connection, and :meth:`cipher`,which
-+retrieves the cipher being used for the secure connection.
-+
-+For more sophisticated applications, the :class:`ssl.SSLContext` class
-+helps manage settings and certificates, which can then be inherited
-+by SSL sockets created through the :meth:`SSLContext.wrap_socket` method.
-+
-
- Functions, Constants, and Exceptions
- ------------------------------------
-
- .. exception:: SSLError
-
-- Raised to signal an error from the underlying SSL implementation. This
-- signifies some problem in the higher-level encryption and authentication
-- layer that's superimposed on the underlying network connection. This error
-- is a subtype of :exc:`socket.error`, which in turn is a subtype of
-- :exc:`IOError`.
-+ Raised to signal an error from the underlying SSL implementation (currently
-+ provided by the OpenSSL library). This signifies some problem in the
-+ higher-level encryption and authentication layer that's superimposed on the
-+ underlying network connection. This error is a subtype of
-+ :exc:`socket.error`, which in turn is a subtype of :exc:`IOError`. The
-+ error code and message of :exc:`SSLError` instances are provided by the
-+ OpenSSL library.
-+
-+ .. attribute:: library
-+
-+ A string mnemonic designating the OpenSSL submodule in which the error
-+ occurred, such as ``SSL``, ``PEM`` or ``X509``. The range of possible
-+ values depends on the OpenSSL version.
-+
-+ .. versionadded:: 2.7.9
-+
-+ .. attribute:: reason
-+
-+ A string mnemonic designating the reason this error occurred, for
-+ example ``CERTIFICATE_VERIFY_FAILED``. The range of possible
-+ values depends on the OpenSSL version.
-+
-+ .. versionadded:: 2.7.9
-+
-+.. exception:: SSLZeroReturnError
-+
-+ A subclass of :exc:`SSLError` raised when trying to read or write and
-+ the SSL connection has been closed cleanly. Note that this doesn't
-+ mean that the underlying transport (read TCP) has been closed.
-+
-+ .. versionadded:: 2.7.9
-+
-+.. exception:: SSLWantReadError
-+
-+ A subclass of :exc:`SSLError` raised by a :ref:`non-blocking SSL socket
-+ <ssl-nonblocking>` when trying to read or write data, but more data needs
-+ to be received on the underlying TCP transport before the request can be
-+ fulfilled.
-+
-+ .. versionadded:: 2.7.9
-+
-+.. exception:: SSLWantWriteError
-+
-+ A subclass of :exc:`SSLError` raised by a :ref:`non-blocking SSL socket
-+ <ssl-nonblocking>` when trying to read or write data, but more data needs
-+ to be sent on the underlying TCP transport before the request can be
-+ fulfilled.
-
--.. function:: wrap_socket (sock, keyfile=None, certfile=None, server_side=False,
cert_reqs=CERT_NONE, ssl_version={see docs}, ca_certs=None, do_handshake_on_connect=True,
suppress_ragged_eofs=True, ciphers=None)
-+ .. versionadded:: 2.7.9
-+
-+.. exception:: SSLSyscallError
-+
-+ A subclass of :exc:`SSLError` raised when a system error was encountered
-+ while trying to fulfill an operation on a SSL socket. Unfortunately,
-+ there is no easy way to inspect the original errno number.
-+
-+ .. versionadded:: 2.7.9
-+
-+.. exception:: SSLEOFError
-+
-+ A subclass of :exc:`SSLError` raised when the SSL connection has been
-+ terminated abruptly. Generally, you shouldn't try to reuse the underlying
-+ transport when this error is encountered.
-+
-+ .. versionadded:: 2.7.9
-+
-+.. exception:: CertificateError
-+
-+ Raised to signal an error with a certificate (such as mismatching
-+ hostname). Certificate errors detected by OpenSSL, though, raise
-+ an :exc:`SSLError`.
-+
-+
-+Socket creation
-+^^^^^^^^^^^^^^^
-+
-+The following function allows for standalone socket creation. Starting from
-+Python 2.7.9, it can be more flexible to use :meth:`SSLContext.wrap_socket`
-+instead.
-+
-+.. function:: wrap_socket(sock, keyfile=None, certfile=None, server_side=False,
cert_reqs=CERT_NONE, ssl_version={see docs}, ca_certs=None, do_handshake_on_connect=True,
suppress_ragged_eofs=True, ciphers=None)
-
- Takes an instance ``sock`` of :class:`socket.socket`, and returns an instance
- of :class:`ssl.SSLSocket`, a subtype of :class:`socket.socket`, which wraps
-@@ -85,19 +158,6 @@ Functions, Constants, and Exceptions
- connection. See the discussion of :ref:`ssl-certificates` for more
- information on how the certificate is stored in the ``certfile``.
-
-- Often the private key is stored in the same file as the certificate; in this
-- case, only the ``certfile`` parameter need be passed. If the private key is
-- stored in a separate file, both parameters must be used. If the private key
-- is stored in the ``certfile``, it should come before the first certificate in
-- the certificate chain::
--
-- -----BEGIN RSA PRIVATE KEY-----
-- ... (private key in base64 encoding) ...
-- -----END RSA PRIVATE KEY-----
-- -----BEGIN CERTIFICATE-----
-- ... (certificate in base64 PEM encoding) ...
-- -----END CERTIFICATE-----
--
- The parameter ``server_side`` is a boolean which identifies whether
- server-side or client-side behavior is desired from this socket.
-
-@@ -127,14 +187,16 @@ Functions, Constants, and Exceptions
-
- .. table::
-
-- ======================== ========= ========= ========== =========
-- *client* / **server** **SSLv2** **SSLv3** **SSLv23** **TLSv1**
-- ------------------------ --------- --------- ---------- ---------
-- *SSLv2* yes no yes no
-- *SSLv3* no yes yes no
-- *SSLv23* yes no yes no
-- *TLSv1* no no yes yes
-- ======================== ========= ========= ========== =========
-+ ======================== ========= ========= ========== =========
=========== ===========
-+ *client* / **server** **SSLv2** **SSLv3** **SSLv23** **TLSv1**
**TLSv1.1** **TLSv1.2**
-+ ------------------------ --------- --------- ---------- ---------
----------- -----------
-+ *SSLv2* yes no yes no no
no
-+ *SSLv3* no yes yes no no
no
-+ *SSLv23* yes no yes no no
no
-+ *TLSv1* no no yes yes no
no
-+ *TLSv1.1* no no yes no yes
no
-+ *TLSv1.2* no no yes no no
yes
-+ ======================== ========= ========= ========== =========
=========== ===========
-
- .. note::
-
-@@ -161,22 +223,79 @@ Functions, Constants, and Exceptions
- The parameter ``suppress_ragged_eofs`` specifies how the
- :meth:`SSLSocket.read` method should signal unexpected EOF from the other end
- of the connection. If specified as :const:`True` (the default), it returns a
-- normal EOF in response to unexpected EOF errors raised from the underlying
-- socket; if :const:`False`, it will raise the exceptions back to the caller.
-+ normal EOF (an empty bytes object) in response to unexpected EOF errors
-+ raised from the underlying socket; if :const:`False`, it will raise the
-+ exceptions back to the caller.
-
- .. versionchanged:: 2.7
- New optional argument *ciphers*.
-
-+
-+Context creation
-+^^^^^^^^^^^^^^^^
-+
-+A convenience function helps create :class:`SSLContext` objects for common
-+purposes.
-+
-+.. function:: create_default_context(purpose=Purpose.SERVER_AUTH, cafile=None,
capath=None, cadata=None)
-+
-+ Return a new :class:`SSLContext` object with default settings for
-+ the given *purpose*. The settings are chosen by the :mod:`ssl` module,
-+ and usually represent a higher security level than when calling the
-+ :class:`SSLContext` constructor directly.
-+
-+ *cafile*, *capath*, *cadata* represent optional CA certificates to
-+ trust for certificate verification, as in
-+ :meth:`SSLContext.load_verify_locations`. If all three are
-+ :const:`None`, this function can choose to trust the system's default
-+ CA certificates instead.
-+
-+ The settings in Python 2.7.9 are: :data:`PROTOCOL_SSLv23`,
-+ :data:`OP_NO_SSLv2`, and :data:`OP_NO_SSLv3` with high encryption cipher
-+ suites without RC4 and without unauthenticated cipher suites. Passing
-+ :data:`~Purpose.SERVER_AUTH` as *purpose* sets
-+ :data:`~SSLContext.verify_mode` to :data:`CERT_REQUIRED` and either loads CA
-+ certificates (when at least one of *cafile*, *capath* or *cadata* is given)
-+ or uses :meth:`SSLContext.load_default_certs` to load default CA
-+ certificates.
-+
-+ .. note::
-+ The protocol, options, cipher and other settings may change to more
-+ restrictive values anytime without prior deprecation. The values
-+ represent a fair balance between compatibility and security.
-+
-+ If your application needs specific settings, you should create a
-+ :class:`SSLContext` and apply the settings yourself.
-+
-+ .. note::
-+ If you find that when certain older clients or servers attempt to connect
-+ with a :class:`SSLContext` created by this function that they get an
-+ error stating "Protocol or cipher suite mismatch", it may be that they
-+ only support SSL3.0 which this function excludes using the
-+ :data:`OP_NO_SSLv3`. SSL3.0 has problematic security due to a number of
-+ poor implementations and it's reliance on MD5 within the protocol. If you
-+ wish to continue to use this function but still allow SSL 3.0 connections
-+ you can re-enable them using::
-+
-+ ctx = ssl.create_default_context(Purpose.CLIENT_AUTH)
-+ ctx.options &= ~ssl.OP_NO_SSLv3
-+
-+ .. versionadded:: 2.7.9
-+
-+
-+Random generation
-+^^^^^^^^^^^^^^^^^
-+
- .. function:: RAND_status()
-
- Returns ``True`` if the SSL pseudo-random number generator has been seeded with
-- 'enough' randomness, and False otherwise. You can use :func:`ssl.RAND_egd`
-+ 'enough' randomness, and ``False`` otherwise. You can use
:func:`ssl.RAND_egd`
- and :func:`ssl.RAND_add` to increase the randomness of the pseudo-random
- number generator.
-
- .. function:: RAND_egd(path)
-
-- If you are running an entropy-gathering daemon (EGD) somewhere, and ``path``
-+ If you are running an entropy-gathering daemon (EGD) somewhere, and *path*
- is the pathname of a socket connection open to it, this will read 256 bytes
- of randomness from the socket, and add it to the SSL pseudo-random number
- generator to increase the security of generated secret keys. This is
-@@ -187,28 +306,66 @@ Functions, Constants, and Exceptions
-
- .. function:: RAND_add(bytes, entropy)
-
-- Mixes the given ``bytes`` into the SSL pseudo-random number generator. The
-- parameter ``entropy`` (a float) is a lower bound on the entropy contained in
-+ Mixes the given *bytes* into the SSL pseudo-random number generator. The
-+ parameter *entropy* (a float) is a lower bound on the entropy contained in
- string (so you can always use :const:`0.0`). See :rfc:`1750` for more
- information on sources of entropy.
-
--.. function:: cert_time_to_seconds(timestring)
-+Certificate handling
-+^^^^^^^^^^^^^^^^^^^^
-+
-+.. 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::
-
-- Returns a floating-point value containing a normal seconds-after-the-epoch
-- time value, given the time-string representing the "notBefore" or
"notAfter"
-- date from a certificate.
-+ >>> 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'
-
-- Here's an example::
-+ .. versionadded:: 2.7.9
-
-- >>> import ssl
-- >>> ssl.cert_time_to_seconds("May 9 00:00:00 2007 GMT")
-- 1178694000.0
-- >>> import time
-- >>> time.ctime(ssl.cert_time_to_seconds("May 9 00:00:00 2007
GMT"))
-- 'Wed May 9 00:00:00 2007'
-- >>>
-
--.. function:: get_server_certificate (addr, ssl_version=PROTOCOL_SSLv3, ca_certs=None)
-+.. function:: cert_time_to_seconds(cert_time)
-+
-+ Return the time in seconds since the Epoch, given the ``cert_time``
-+ string representing the "notBefore" or "notAfter" date from a
-+ certificate in ``"%b %d %H:%M:%S %Y %Z"`` strptime format (C
-+ locale).
-+
-+ Here's an example:
-+
-+ .. doctest:: newcontext
-+
-+ >>> import ssl
-+ >>> timestamp = ssl.cert_time_to_seconds("Jan 5 09:34:43 2018
GMT")
-+ >>> timestamp
-+ 1515144883
-+ >>> from datetime import datetime
-+ >>> print(datetime.utcfromtimestamp(timestamp))
-+ 2018-01-05 09:34:43
-+
-+ "notBefore" or "notAfter" dates must use GMT (:rfc:`5280`).
-+
-+ .. versionchanged:: 2.7.9
-+ Interpret the input time as a time in UTC as specified by 'GMT'
-+ timezone in the input string. Local timezone was used
-+ previously. Return an integer (no fractions of a second in the
-+ input format)
-+
-+.. function:: get_server_certificate(addr, ssl_version=PROTOCOL_SSLv23, ca_certs=None)
-
- Given the address ``addr`` of an SSL-protected server, as a (*hostname*,
- *port-number*) pair, fetches the server's certificate, and returns it as a
-@@ -219,36 +376,144 @@ Functions, Constants, and Exceptions
- will attempt to validate the server certificate against that set of root
- certificates, and will fail if the validation attempt fails.
-
--.. function:: DER_cert_to_PEM_cert (DER_cert_bytes)
-+ .. versionchanged:: 2.7.9
-+
-+ This function is now IPv6-compatible, and the default *ssl_version* is
-+ changed from :data:`PROTOCOL_SSLv3` to :data:`PROTOCOL_SSLv23` for
-+ maximum compatibility with modern servers.
-+
-+.. function:: DER_cert_to_PEM_cert(DER_cert_bytes)
-
- Given a certificate as a DER-encoded blob of bytes, returns a PEM-encoded
- string version of the same certificate.
-
--.. function:: PEM_cert_to_DER_cert (PEM_cert_string)
-+.. function:: PEM_cert_to_DER_cert(PEM_cert_string)
-
- Given a certificate as an ASCII PEM string, returns a DER-encoded sequence of
- bytes for that same certificate.
-
-+.. function:: get_default_verify_paths()
-+
-+ Returns a named tuple with paths to OpenSSL's default cafile and capath.
-+ The paths are the same as used by
-+ :meth:`SSLContext.set_default_verify_paths`. The return value is a
-+ :term:`named tuple` ``DefaultVerifyPaths``:
-+
-+ * :attr:`cafile` - resolved path to cafile or None if the file doesn't exist,
-+ * :attr:`capath` - resolved path to capath or None if the directory doesn't
exist,
-+ * :attr:`openssl_cafile_env` - OpenSSL's environment key that points to a
cafile,
-+ * :attr:`openssl_cafile` - hard coded path to a cafile,
-+ * :attr:`openssl_capath_env` - OpenSSL's environment key that points to a
capath,
-+ * :attr:`openssl_capath` - hard coded path to a capath directory
-+
-+ .. versionadded:: 2.7.9
-+
-+.. function:: enum_certificates(store_name)
-+
-+ Retrieve certificates from Windows' system cert store. *store_name* may be
-+ one of ``CA``, ``ROOT`` or ``MY``. Windows may provide additional cert
-+ stores, too.
-+
-+ The function returns a list of (cert_bytes, encoding_type, trust) tuples.
-+ The encoding_type specifies the encoding of cert_bytes. It is either
-+ :const:`x509_asn` for X.509 ASN.1 data or :const:`pkcs_7_asn` for
-+ PKCS#7 ASN.1 data. Trust specifies the purpose of the certificate as a set
-+ of OIDS or exactly ``True`` if the certificate is trustworthy for all
-+ purposes.
-+
-+ Example::
-+
-+ >>> ssl.enum_certificates("CA")
-+ [(b'data...', 'x509_asn', {'1.3.6.1.5.5.7.3.1',
'1.3.6.1.5.5.7.3.2'}),
-+ (b'data...', 'x509_asn', True)]
-+
-+ Availability: Windows.
-+
-+ .. versionadded:: 2.7.9
-+
-+.. function:: enum_crls(store_name)
-+
-+ Retrieve CRLs from Windows' system cert store. *store_name* may be
-+ one of ``CA``, ``ROOT`` or ``MY``. Windows may provide additional cert
-+ stores, too.
-+
-+ The function returns a list of (cert_bytes, encoding_type, trust) tuples.
-+ The encoding_type specifies the encoding of cert_bytes. It is either
-+ :const:`x509_asn` for X.509 ASN.1 data or :const:`pkcs_7_asn` for
-+ PKCS#7 ASN.1 data.
-+
-+ Availability: Windows.
-+
-+ .. versionadded:: 2.7.9
-+
-+
-+Constants
-+^^^^^^^^^
-+
- .. data:: CERT_NONE
-
-- Value to pass to the ``cert_reqs`` parameter to :func:`sslobject` when no
-- certificates will be required or validated from the other side of the socket
-- connection.
-+ Possible value for :attr:`SSLContext.verify_mode`, or the ``cert_reqs``
-+ parameter to :func:`wrap_socket`. In this mode (the default), no
-+ certificates will be required from the other side of the socket connection.
-+ If a certificate is received from the other end, no attempt to validate it
-+ is made.
-+
-+ See the discussion of :ref:`ssl-security` below.
-
- .. data:: CERT_OPTIONAL
-
-- Value to pass to the ``cert_reqs`` parameter to :func:`sslobject` when no
-- certificates will be required from the other side of the socket connection,
-- but if they are provided, will be validated. Note that use of this setting
-- requires a valid certificate validation file also be passed as a value of the
-- ``ca_certs`` parameter.
-+ Possible value for :attr:`SSLContext.verify_mode`, or the ``cert_reqs``
-+ parameter to :func:`wrap_socket`. In this mode no certificates will be
-+ required from the other side of the socket connection; but if they
-+ are provided, validation will be attempted and an :class:`SSLError`
-+ will be raised on failure.
-+
-+ Use of this setting requires a valid set of CA certificates to
-+ be passed, either to :meth:`SSLContext.load_verify_locations` or as a
-+ value of the ``ca_certs`` parameter to :func:`wrap_socket`.
-
- .. data:: CERT_REQUIRED
-
-- Value to pass to the ``cert_reqs`` parameter to :func:`sslobject` when
-- certificates will be required from the other side of the socket connection.
-- Note that use of this setting requires a valid certificate validation file
-- also be passed as a value of the ``ca_certs`` parameter.
-+ Possible value for :attr:`SSLContext.verify_mode`, or the ``cert_reqs``
-+ parameter to :func:`wrap_socket`. In this mode, certificates are
-+ required from the other side of the socket connection; an :class:`SSLError`
-+ will be raised if no certificate is provided, or if its validation fails.
-+
-+ Use of this setting requires a valid set of CA certificates to
-+ be passed, either to :meth:`SSLContext.load_verify_locations` or as a
-+ value of the ``ca_certs`` parameter to :func:`wrap_socket`.
-+
-+.. data:: VERIFY_DEFAULT
-+
-+ Possible value for :attr:`SSLContext.verify_flags`. In this mode,
-+ certificate revocation lists (CRLs) are not checked. By default OpenSSL
-+ does neither require nor verify CRLs.
-+
-+ .. versionadded:: 2.7.9
-+
-+.. data:: VERIFY_CRL_CHECK_LEAF
-+
-+ Possible value for :attr:`SSLContext.verify_flags`. In this mode, only the
-+ peer cert is check but non of the intermediate CA certificates. The mode
-+ requires a valid CRL that is signed by the peer cert's issuer (its direct
-+ ancestor CA). If no proper has been loaded
-+ :attr:`SSLContext.load_verify_locations`, validation will fail.
-+
-+ .. versionadded:: 2.7.9
-+
-+.. data:: VERIFY_CRL_CHECK_CHAIN
-+
-+ Possible value for :attr:`SSLContext.verify_flags`. In this mode, CRLs of
-+ all certificates in the peer cert chain are checked.
-+
-+ .. versionadded:: 2.7.9
-+
-+.. data:: VERIFY_X509_STRICT
-+
-+ Possible value for :attr:`SSLContext.verify_flags` to disable workarounds
-+ for broken X.509 certificates.
-+
-+ .. versionadded:: 2.7.9
-
- .. data:: PROTOCOL_SSLv2
-
-@@ -275,9 +540,136 @@ Functions, Constants, and Exceptions
-
- .. data:: PROTOCOL_TLSv1
-
-- Selects TLS version 1 as the channel encryption protocol. This is the most
-+ Selects TLS version 1.0 as the channel encryption protocol.
-+
-+.. data:: PROTOCOL_TLSv1_1
-+
-+ Selects TLS version 1.1 as the channel encryption protocol.
-+ Available only with openssl version 1.0.1+.
-+
-+ .. versionadded:: 2.7.9
-+
-+.. data:: PROTOCOL_TLSv1_2
-+
-+ Selects TLS version 1.2 as the channel encryption protocol. This is the most
- modern version, and probably the best choice for maximum protection, if both
-- sides can speak it.
-+ sides can speak it. Available only with openssl version 1.0.1+.
-+
-+ .. versionadded:: 2.7.9
-+
-+.. data:: OP_ALL
-+
-+ Enables workarounds for various bugs present in other SSL implementations.
-+ This option is set by default. It does not necessarily set the same
-+ flags as OpenSSL's ``SSL_OP_ALL`` constant.
-+
-+ .. versionadded:: 2.7.9
-+
-+.. data:: OP_NO_SSLv2
-+
-+ Prevents an SSLv2 connection. This option is only applicable in
-+ conjunction with :const:`PROTOCOL_SSLv23`. It prevents the peers from
-+ choosing SSLv2 as the protocol version.
-+
-+ .. versionadded:: 2.7.9
-+
-+.. data:: OP_NO_SSLv3
-+
-+ Prevents an SSLv3 connection. This option is only applicable in
-+ conjunction with :const:`PROTOCOL_SSLv23`. It prevents the peers from
-+ choosing SSLv3 as the protocol version.
-+
-+ .. versionadded:: 2.7.9
-+
-+.. data:: OP_NO_TLSv1
-+
-+ Prevents a TLSv1 connection. This option is only applicable in
-+ conjunction with :const:`PROTOCOL_SSLv23`. It prevents the peers from
-+ choosing TLSv1 as the protocol version.
-+
-+ .. versionadded:: 2.7.9
-+
-+.. data:: OP_NO_TLSv1_1
-+
-+ Prevents a TLSv1.1 connection. This option is only applicable in conjunction
-+ with :const:`PROTOCOL_SSLv23`. It prevents the peers from choosing TLSv1.1 as
-+ the protocol version. Available only with openssl version 1.0.1+.
-+
-+ .. versionadded:: 2.7.9
-+
-+.. data:: OP_NO_TLSv1_2
-+
-+ Prevents a TLSv1.2 connection. This option is only applicable in conjunction
-+ with :const:`PROTOCOL_SSLv23`. It prevents the peers from choosing TLSv1.2 as
-+ the protocol version. Available only with openssl version 1.0.1+.
-+
-+ .. versionadded:: 2.7.9
-+
-+.. data:: OP_CIPHER_SERVER_PREFERENCE
-+
-+ Use the server's cipher ordering preference, rather than the client's.
-+ This option has no effect on client sockets and SSLv2 server sockets.
-+
-+ .. versionadded:: 2.7.9
-+
-+.. data:: OP_SINGLE_DH_USE
-+
-+ Prevents re-use of the same DH key for distinct SSL sessions. This
-+ improves forward secrecy but requires more computational resources.
-+ This option only applies to server sockets.
-+
-+ .. versionadded:: 2.7.9
-+
-+.. data:: OP_SINGLE_ECDH_USE
-+
-+ Prevents re-use of the same ECDH key for distinct SSL sessions. This
-+ improves forward secrecy but requires more computational resources.
-+ This option only applies to server sockets.
-+
-+ .. versionadded:: 2.7.9
-+
-+.. data:: OP_NO_COMPRESSION
-+
-+ Disable compression on the SSL channel. This is useful if the application
-+ protocol supports its own compression scheme.
-+
-+ This option is only available with OpenSSL 1.0.0 and later.
-+
-+ .. versionadded:: 2.7.9
-+
-+.. data:: HAS_ECDH
-+
-+ Whether the OpenSSL library has built-in support for Elliptic Curve-based
-+ Diffie-Hellman key exchange. This should be true unless the feature was
-+ explicitly disabled by the distributor.
-+
-+ .. versionadded:: 2.7.9
-+
-+.. data:: HAS_SNI
-+
-+ Whether the OpenSSL library has built-in support for the *Server Name
-+ Indication* extension to the SSLv3 and TLSv1 protocols (as defined in
-+ :rfc:`4366`). When true, you can use the *server_hostname* argument to
-+ :meth:`SSLContext.wrap_socket`.
-+
-+ .. versionadded:: 2.7.9
-+
-+.. data:: HAS_NPN
-+
-+ Whether the OpenSSL library has built-in support for *Next Protocol
-+ Negotiation* as described in the `NPN draft specification
-+ <
http://tools.ietf.org/html/draft-agl-tls-nextprotoneg>`_. When true,
-+ you can use the :meth:`SSLContext.set_npn_protocols` method to advertise
-+ which protocols you want to support.
-+
-+ .. versionadded:: 2.7.9
-+
-+.. data:: CHANNEL_BINDING_TYPES
-+
-+ List of supported TLS channel binding types. Strings in this list
-+ can be used as arguments to :meth:`SSLSocket.get_channel_binding`.
-+
-+ .. versionadded:: 2.7.9
-
- .. data:: OPENSSL_VERSION
-
-@@ -309,9 +701,40 @@ Functions, Constants, and Exceptions
-
- .. versionadded:: 2.7
-
-+.. data:: ALERT_DESCRIPTION_HANDSHAKE_FAILURE
-+ ALERT_DESCRIPTION_INTERNAL_ERROR
-+ ALERT_DESCRIPTION_*
-+
-+ Alert Descriptions from :rfc:`5246` and others. The `IANA TLS Alert Registry
-+
<
http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-par...
-+ contains this list and references to the RFCs where their meaning is defined.
-+
-+ Used as the return value of the callback function in
-+ :meth:`SSLContext.set_servername_callback`.
-+
-+ .. versionadded:: 2.7.9
-+
-+.. data:: Purpose.SERVER_AUTH
-+
-+ Option for :func:`create_default_context` and
-+ :meth:`SSLContext.load_default_certs`. This value indicates that the
-+ context may be used to authenticate Web servers (therefore, it will
-+ be used to create client-side sockets).
-+
-+ .. versionadded:: 2.7.9
-
--SSLSocket Objects
-------------------
-+.. data:: Purpose.CLIENT_AUTH
-+
-+ Option for :func:`create_default_context` and
-+ :meth:`SSLContext.load_default_certs`. This value indicates that the
-+ context may be used to authenticate Web clients (therefore, it will
-+ be used to create server-side sockets).
-+
-+ .. versionadded:: 2.7.9
-+
-+
-+SSL Sockets
-+-----------
-
- SSL sockets provide the following methods of :ref:`socket-objects`:
-
-@@ -334,37 +757,64 @@ SSL sockets provide the following methods of
:ref:`socket-objects`:
-
- However, since the SSL (and TLS) protocol has its own framing atop
- of TCP, the SSL sockets abstraction can, in certain respects, diverge from
--the specification of normal, OS-level sockets.
-+the specification of normal, OS-level sockets. See especially the
-+:ref:`notes on non-blocking sockets <ssl-nonblocking>`.
-
- SSL sockets also have the following additional methods and attributes:
-
-+.. method:: SSLSocket.do_handshake()
-+
-+ Perform the SSL setup handshake.
-+
-+ .. versionchanged:: 2.7.9
-+
-+ The handshake method also performs :func:`match_hostname` when the
-+ :attr:`~SSLContext.check_hostname` attribute of the socket's
-+ :attr:`~SSLSocket.context` is true.
-+
- .. method:: SSLSocket.getpeercert(binary_form=False)
-
- If there is no certificate for the peer on the other end of the connection,
-- returns ``None``.
-+ return ``None``. If the SSL handshake hasn't been done yet, raise
-+ :exc:`ValueError`.
-
- If the ``binary_form`` parameter is :const:`False`, and a certificate was
- received from the peer, this method returns a :class:`dict` instance. If the
- certificate was not validated, the dict is empty. If the certificate was
-- validated, it returns a dict with the keys ``subject`` (the principal for
-- which the certificate was issued), and ``notAfter`` (the time after which the
-- certificate should not be trusted). The certificate was already validated,
-- so the ``notBefore`` and ``issuer`` fields are not returned. If a
-- certificate contains an instance of the *Subject Alternative Name* extension
-- (see :rfc:`3280`), there will also be a ``subjectAltName`` key in the
-- dictionary.
--
-- The "subject" field is a tuple containing the sequence of relative
-- distinguished names (RDNs) given in the certificate's data structure for the
-- principal, and each RDN is a sequence of name-value pairs::
--
-- {'notAfter': 'Feb 16 16:54:50 2013 GMT',
-- 'subject': ((('countryName', u'US'),),
-- (('stateOrProvinceName', u'Delaware'),),
-- (('localityName', u'Wilmington'),),
-- (('organizationName', u'Python Software
Foundation'),),
-- (('organizationalUnitName', u'SSL'),),
-- (('commonName', u'somemachine.python.org'),))}
-+ validated, it returns a dict with several keys, amongst them ``subject``
-+ (the principal for which the certificate was issued) and ``issuer``
-+ (the principal issuing the certificate). If a certificate contains an
-+ instance of the *Subject Alternative Name* extension (see :rfc:`3280`),
-+ there will also be a ``subjectAltName`` key in the dictionary.
-+
-+ The ``subject`` and ``issuer`` fields are tuples containing the sequence
-+ of relative distinguished names (RDNs) given in the certificate's data
-+ structure for the respective fields, and each RDN is a sequence of
-+ name-value pairs. Here is a real-world example::
-+
-+ {'issuer': ((('countryName', 'IL'),),
-+ (('organizationName', 'StartCom Ltd.'),),
-+ (('organizationalUnitName',
-+ 'Secure Digital Certificate Signing'),),
-+ (('commonName',
-+ 'StartCom Class 2 Primary Intermediate Server CA'),)),
-+ 'notAfter': 'Nov 22 08:15:19 2013 GMT',
-+ 'notBefore': 'Nov 21 03:09:52 2011 GMT',
-+ 'serialNumber': '95F0',
-+ 'subject': ((('description',
'571208-SLe257oHY9fVQ07Z'),),
-+ (('countryName', 'US'),),
-+ (('stateOrProvinceName', 'California'),),
-+ (('localityName', 'San Francisco'),),
-+ (('organizationName', 'Electronic Frontier Foundation,
Inc.'),),
-+ (('commonName', '*.eff.org'),),
-+ (('emailAddress', 'hostmaster(a)eff.org'),)),
-+ 'subjectAltName': (('DNS', '*.eff.org'), ('DNS',
'eff.org')),
-+ 'version': 3}
-+
-+ .. note::
-+
-+ To validate a certificate for a particular service, you can use the
-+ :func:`match_hostname` function.
-
- If the ``binary_form`` parameter is :const:`True`, and a certificate was
- provided, this method returns the DER-encoded form of the entire certificate
-@@ -380,40 +830,388 @@ SSL sockets also have the following additional methods and
attributes:
- :const:`None` if you used :const:`CERT_NONE` (rather than
- :const:`CERT_OPTIONAL` or :const:`CERT_REQUIRED`).
-
-+ .. versionchanged:: 2.7.9
-+ The returned dictionary includes additional items such as ``issuer`` and
-+ ``notBefore``. Additionall :exc:`ValueError` is raised when the handshake
-+ isn't done. The returned dictionary includes additional X509v3 extension
-+ items such as ``crlDistributionPoints``, ``caIssuers`` and ``OCSP`` URIs.
-+
- .. method:: SSLSocket.cipher()
-
- Returns a three-value tuple containing the name of the cipher being used, the
- version of the SSL protocol that defines its use, and the number of secret
- bits being used. If no connection has been established, returns ``None``.
-
--.. method:: SSLSocket.do_handshake()
-+.. method:: SSLSocket.compression()
-+
-+ Return the compression algorithm being used as a string, or ``None``
-+ if the connection isn't compressed.
-+
-+ If the higher-level protocol supports its own compression mechanism,
-+ you can use :data:`OP_NO_COMPRESSION` to disable SSL-level compression.
-+
-+ .. versionadded:: 2.7.9
-+
-+.. method:: SSLSocket.get_channel_binding(cb_type="tls-unique")
-
-- Perform a TLS/SSL handshake. If this is used with a non-blocking socket, it
-- may raise :exc:`SSLError` with an ``arg[0]`` of :const:`SSL_ERROR_WANT_READ`
-- or :const:`SSL_ERROR_WANT_WRITE`, in which case it must be called again until
-- it completes successfully. For example, to simulate the behavior of a
-- blocking socket, one might write::
--
-- while True:
-- try:
-- s.do_handshake()
-- break
-- except ssl.SSLError as err:
-- if err.args[0] == ssl.SSL_ERROR_WANT_READ:
-- select.select([s], [], [])
-- elif err.args[0] == ssl.SSL_ERROR_WANT_WRITE:
-- select.select([], [s], [])
-- else:
-- raise
-+ Get channel binding data for current connection, as a bytes object. Returns
-+ ``None`` if not connected or the handshake has not been completed.
-+
-+ The *cb_type* parameter allow selection of the desired channel binding
-+ type. Valid channel binding types are listed in the
-+ :data:`CHANNEL_BINDING_TYPES` list. Currently only the 'tls-unique' channel
-+ binding, defined by :rfc:`5929`, is supported. :exc:`ValueError` will be
-+ raised if an unsupported channel binding type is requested.
-+
-+ .. versionadded:: 2.7.9
-+
-+.. method:: SSLSocket.selected_npn_protocol()
-+
-+ Returns the protocol that was selected during the TLS/SSL handshake. If
-+ :meth:`SSLContext.set_npn_protocols` was not called, or if the other party
-+ does not support NPN, or if the handshake has not yet happened, this will
-+ return ``None``.
-+
-+ .. versionadded:: 2.7.9
-
- .. method:: SSLSocket.unwrap()
-
- Performs the SSL shutdown handshake, which removes the TLS layer from the
- underlying socket, and returns the underlying socket object. This can be
- used to go from encrypted operation over a connection to unencrypted. The
-- socket instance returned should always be used for further communication with
-- the other side of the connection, rather than the original socket instance
-- (which may not function properly after the unwrap).
-+ returned socket should always be used for further communication with the
-+ other side of the connection, rather than the original socket.
-+
-+.. attribute:: SSLSocket.context
-+
-+ The :class:`SSLContext` object this SSL socket is tied to. If the SSL
-+ socket was created using the top-level :func:`wrap_socket` function
-+ (rather than :meth:`SSLContext.wrap_socket`), this is a custom context
-+ object created for this SSL socket.
-+
-+ .. versionadded:: 2.7.9
-+
-+
-+SSL Contexts
-+------------
-+
-+.. versionadded:: 2.7.9
-+
-+An SSL context holds various data longer-lived than single SSL connections,
-+such as SSL configuration options, certificate(s) and private key(s).
-+It also manages a cache of SSL sessions for server-side sockets, in order
-+to speed up repeated connections from the same clients.
-+
-+.. class:: SSLContext(protocol)
-+
-+ Create a new SSL context. You must pass *protocol* which must be one
-+ of the ``PROTOCOL_*`` constants defined in this module.
-+ :data:`PROTOCOL_SSLv23` is currently recommended for maximum
-+ interoperability.
-+
-+ .. seealso::
-+ :func:`create_default_context` lets the :mod:`ssl` module choose
-+ security settings for a given purpose.
-+
-+
-+:class:`SSLContext` objects have the following methods and attributes:
-+
-+.. method:: SSLContext.cert_store_stats()
-+
-+ Get statistics about quantities of loaded X.509 certificates, count of
-+ X.509 certificates flagged as CA certificates and certificate revocation
-+ lists as dictionary.
-+
-+ Example for a context with one CA cert and one other cert::
-+
-+ >>> context.cert_store_stats()
-+ {'crl': 0, 'x509_ca': 1, 'x509': 2}
-+
-+
-+.. method:: SSLContext.load_cert_chain(certfile, keyfile=None, password=None)
-+
-+ Load a private key and the corresponding certificate. The *certfile*
-+ string must be the path to a single file in PEM format containing the
-+ certificate as well as any number of CA certificates needed to establish
-+ the certificate's authenticity. The *keyfile* string, if present, must
-+ point to a file containing the private key in. Otherwise the private
-+ key will be taken from *certfile* as well. See the discussion of
-+ :ref:`ssl-certificates` for more information on how the certificate
-+ is stored in the *certfile*.
-+
-+ The *password* argument may be a function to call to get the password for
-+ decrypting the private key. It will only be called if the private key is
-+ encrypted and a password is necessary. It will be called with no arguments,
-+ and it should return a string, bytes, or bytearray. If the return value is
-+ a string it will be encoded as UTF-8 before using it to decrypt the key.
-+ Alternatively a string, bytes, or bytearray value may be supplied directly
-+ as the *password* argument. It will be ignored if the private key is not
-+ encrypted and no password is needed.
-+
-+ If the *password* argument is not specified and a password is required,
-+ OpenSSL's built-in password prompting mechanism will be used to
-+ interactively prompt the user for a password.
-+
-+ An :class:`SSLError` is raised if the private key doesn't
-+ match with the certificate.
-+
-+.. method:: SSLContext.load_default_certs(purpose=Purpose.SERVER_AUTH)
-+
-+ Load a set of default "certification authority" (CA) certificates from
-+ default locations. On Windows it loads CA certs from the ``CA`` and
-+ ``ROOT`` system stores. On other systems it calls
-+ :meth:`SSLContext.set_default_verify_paths`. In the future the method may
-+ load CA certificates from other locations, too.
-+
-+ The *purpose* flag specifies what kind of CA certificates are loaded. The
-+ default settings :data:`Purpose.SERVER_AUTH` loads certificates, that are
-+ flagged and trusted for TLS web server authentication (client side
-+ sockets). :data:`Purpose.CLIENT_AUTH` loads CA certificates for client
-+ certificate verification on the server side.
-+
-+.. method:: SSLContext.load_verify_locations(cafile=None, capath=None, cadata=None)
-+
-+ Load a set of "certification authority" (CA) certificates used to validate
-+ other peers' certificates when :data:`verify_mode` is other than
-+ :data:`CERT_NONE`. At least one of *cafile* or *capath* must be specified.
-+
-+ This method can also load certification revocation lists (CRLs) in PEM or
-+ DER format. In order to make use of CRLs, :attr:`SSLContext.verify_flags`
-+ must be configured properly.
-+
-+ The *cafile* string, if present, is the path to a file of concatenated
-+ CA certificates in PEM format. See the discussion of
-+ :ref:`ssl-certificates` for more information about how to arrange the
-+ certificates in this file.
-+
-+ The *capath* string, if present, is
-+ the path to a directory containing several CA certificates in PEM format,
-+ following an `OpenSSL specific layout
-+ <
http://www.openssl.org/docs/ssl/SSL_CTX_load_verify_locations.html>`_.
-+
-+ The *cadata* object, if present, is either an ASCII string of one or more
-+ PEM-encoded certificates or a bytes-like object of DER-encoded
-+ certificates. Like with *capath* extra lines around PEM-encoded
-+ certificates are ignored but at least one certificate must be present.
-+
-+.. method:: SSLContext.get_ca_certs(binary_form=False)
-+
-+ Get a list of loaded "certification authority" (CA) certificates. If the
-+ ``binary_form`` parameter is :const:`False` each list
-+ entry is a dict like the output of :meth:`SSLSocket.getpeercert`. Otherwise
-+ the method returns a list of DER-encoded certificates. The returned list
-+ does not contain certificates from *capath* unless a certificate was
-+ requested and loaded by a SSL connection.
-+
-+.. method:: SSLContext.set_default_verify_paths()
-+
-+ Load a set of default "certification authority" (CA) certificates from
-+ a filesystem path defined when building the OpenSSL library. Unfortunately,
-+ there's no easy way to know whether this method succeeds: no error is
-+ returned if no certificates are to be found. When the OpenSSL library is
-+ provided as part of the operating system, though, it is likely to be
-+ configured properly.
-+
-+.. method:: SSLContext.set_ciphers(ciphers)
-+
-+ Set the available ciphers for sockets created with this context.
-+ It should be a string in the `OpenSSL cipher list format
-+ <
http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT>`_.
-+ If no cipher can be selected (because compile-time options or other
-+ configuration forbids use of all the specified ciphers), an
-+ :class:`SSLError` will be raised.
-+
-+ .. note::
-+ when connected, the :meth:`SSLSocket.cipher` method of SSL sockets will
-+ give the currently selected cipher.
-+
-+.. method:: SSLContext.set_npn_protocols(protocols)
-+
-+ Specify which protocols the socket should advertise during the SSL/TLS
-+ handshake. It should be a list of strings, like ``['http/1.1',
'spdy/2']``,
-+ ordered by preference. The selection of a protocol will happen during the
-+ handshake, and will play out according to the `NPN draft specification
-+ <
http://tools.ietf.org/html/draft-agl-tls-nextprotoneg>`_. After a
-+ successful handshake, the :meth:`SSLSocket.selected_npn_protocol` method will
-+ return the agreed-upon protocol.
-+
-+ This method will raise :exc:`NotImplementedError` if :data:`HAS_NPN` is
-+ False.
-+
-+.. method:: SSLContext.set_servername_callback(server_name_callback)
-+
-+ Register a callback function that will be called after the TLS Client Hello
-+ handshake message has been received by the SSL/TLS server when the TLS client
-+ specifies a server name indication. The server name indication mechanism
-+ is specified in :rfc:`6066` section 3 - Server Name Indication.
-+
-+ Only one callback can be set per ``SSLContext``. If *server_name_callback*
-+ is ``None`` then the callback is disabled. Calling this function a
-+ subsequent time will disable the previously registered callback.
-+
-+ The callback function, *server_name_callback*, will be called with three
-+ arguments; the first being the :class:`ssl.SSLSocket`, the second is a string
-+ that represents the server name that the client is intending to communicate
-+ (or :const:`None` if the TLS Client Hello does not contain a server name)
-+ and the third argument is the original :class:`SSLContext`. The server name
-+ argument is the IDNA decoded server name.
-+
-+ A typical use of this callback is to change the :class:`ssl.SSLSocket`'s
-+ :attr:`SSLSocket.context` attribute to a new object of type
-+ :class:`SSLContext` representing a certificate chain that matches the server
-+ name.
-+
-+ Due to the early negotiation phase of the TLS connection, only limited
-+ methods and attributes are usable like
-+ :meth:`SSLSocket.selected_npn_protocol` and :attr:`SSLSocket.context`.
-+ :meth:`SSLSocket.getpeercert`, :meth:`SSLSocket.getpeercert`,
-+ :meth:`SSLSocket.cipher` and :meth:`SSLSocket.compress` methods require that
-+ the TLS connection has progressed beyond the TLS Client Hello and therefore
-+ will not contain return meaningful values nor can they be called safely.
-+
-+ The *server_name_callback* function must return ``None`` to allow the
-+ TLS negotiation to continue. If a TLS failure is required, a constant
-+ :const:`ALERT_DESCRIPTION_* <ALERT_DESCRIPTION_INTERNAL_ERROR>` can be
-+ returned. Other return values will result in a TLS fatal error with
-+ :const:`ALERT_DESCRIPTION_INTERNAL_ERROR`.
-+
-+ If there is an IDNA decoding error on the server name, the TLS connection
-+ will terminate with an :const:`ALERT_DESCRIPTION_INTERNAL_ERROR` fatal TLS
-+ alert message to the client.
-+
-+ If an exception is raised from the *server_name_callback* function the TLS
-+ connection will terminate with a fatal TLS alert message
-+ :const:`ALERT_DESCRIPTION_HANDSHAKE_FAILURE`.
-+
-+ This method will raise :exc:`NotImplementedError` if the OpenSSL library
-+ had OPENSSL_NO_TLSEXT defined when it was built.
-+
-+.. method:: SSLContext.load_dh_params(dhfile)
-+
-+ Load the key generation parameters for Diffie-Helman (DH) key exchange.
-+ Using DH key exchange improves forward secrecy at the expense of
-+ computational resources (both on the server and on the client).
-+ The *dhfile* parameter should be the path to a file containing DH
-+ parameters in PEM format.
-+
-+ This setting doesn't apply to client sockets. You can also use the
-+ :data:`OP_SINGLE_DH_USE` option to further improve security.
-+
-+.. method:: SSLContext.set_ecdh_curve(curve_name)
-+
-+ Set the curve name for Elliptic Curve-based Diffie-Hellman (ECDH) key
-+ exchange. ECDH is significantly faster than regular DH while arguably
-+ as secure. The *curve_name* parameter should be a string describing
-+ a well-known elliptic curve, for example ``prime256v1`` for a widely
-+ supported curve.
-+
-+ This setting doesn't apply to client sockets. You can also use the
-+ :data:`OP_SINGLE_ECDH_USE` option to further improve security.
-+
-+ This method is not available if :data:`HAS_ECDH` is False.
-+
-+ .. seealso::
-+ `SSL/TLS & Perfect Forward Secrecy
<
http://vincent.bernat.im/en/blog/2011-ssl-perfect-forward-secrecy.html>`_
-+ Vincent Bernat.
-+
-+.. method:: SSLContext.wrap_socket(sock, server_side=False, \
-+ do_handshake_on_connect=True, suppress_ragged_eofs=True, \
-+ server_hostname=None)
-+
-+ Wrap an existing Python socket *sock* and return an :class:`SSLSocket`
-+ object. *sock* must be a :data:`~socket.SOCK_STREAM` socket; other socket
-+ types are unsupported.
-+
-+ The returned SSL socket is tied to the context, its settings and
-+ certificates. The parameters *server_side*, *do_handshake_on_connect*
-+ and *suppress_ragged_eofs* have the same meaning as in the top-level
-+ :func:`wrap_socket` function.
-+
-+ On client connections, the optional parameter *server_hostname* specifies
-+ the hostname of the service which we are connecting to. This allows a
-+ single server to host multiple SSL-based services with distinct certificates,
-+ quite similarly to HTTP virtual hosts. Specifying *server_hostname*
-+ will raise a :exc:`ValueError` if the OpenSSL library doesn't have support
-+ for it (that is, if :data:`HAS_SNI` is :const:`False`). Specifying
-+ *server_hostname* will also raise a :exc:`ValueError` if *server_side*
-+ is true.
-+
-+.. method:: SSLContext.session_stats()
-+
-+ Get statistics about the SSL sessions created or managed by this context.
-+ A dictionary is returned which maps the names of each `piece of information
-+ <
http://www.openssl.org/docs/ssl/SSL_CTX_sess_number.html>`_ to their
-+ numeric values. For example, here is the total number of hits and misses
-+ in the session cache since the context was created::
-+
-+ >>> stats = context.session_stats()
-+ >>> stats['hits'], stats['misses']
-+ (0, 0)
-+
-+.. method:: SSLContext.get_ca_certs(binary_form=False)
-+
-+ Returns a list of dicts with information of loaded CA certs. If the
-+ optional argument is true, returns a DER-encoded copy of the CA
-+ certificate.
-+
-+ .. note::
-+ Certificates in a capath directory aren't loaded unless they have
-+ been used at least once.
-+
-+.. attribute:: SSLContext.check_hostname
-+
-+ Wether to match the peer cert's hostname with :func:`match_hostname` in
-+ :meth:`SSLSocket.do_handshake`. The context's
-+ :attr:`~SSLContext.verify_mode` must be set to :data:`CERT_OPTIONAL` or
-+ :data:`CERT_REQUIRED`, and you must pass *server_hostname* to
-+ :meth:`~SSLContext.wrap_socket` in order to match the hostname.
-+
-+ Example::
-+
-+ import socket, ssl
-+
-+ context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ context.verify_mode = ssl.CERT_REQUIRED
-+ context.check_hostname = True
-+ context.load_default_certs()
-+
-+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-+ ssl_sock = context.wrap_socket(s, server_hostname='www.verisign.com')
-+ ssl_sock.connect(('www.verisign.com', 443))
-+
-+ .. note::
-+
-+ This features requires OpenSSL 0.9.8f or newer.
-+
-+.. attribute:: SSLContext.options
-+
-+ An integer representing the set of SSL options enabled on this context.
-+ The default value is :data:`OP_ALL`, but you can specify other options
-+ such as :data:`OP_NO_SSLv2` by ORing them together.
-+
-+ .. note::
-+ With versions of OpenSSL older than 0.9.8m, it is only possible
-+ to set options, not to clear them. Attempting to clear an option
-+ (by resetting the corresponding bits) will raise a ``ValueError``.
-+
-+.. attribute:: SSLContext.protocol
-+
-+ The protocol version chosen when constructing the context. This attribute
-+ is read-only.
-+
-+.. attribute:: SSLContext.verify_flags
-+
-+ The flags for certificate verification operations. You can set flags like
-+ :data:`VERIFY_CRL_CHECK_LEAF` by ORing them together. By default OpenSSL
-+ does neither require nor verify certificate revocation lists (CRLs).
-+ Available only with openssl version 0.9.8+.
-+
-+.. attribute:: SSLContext.verify_mode
-+
-+ Whether to try to verify other peers' certificates and how to behave
-+ if verification fails. This attribute must be one of
-+ :data:`CERT_NONE`, :data:`CERT_OPTIONAL` or :data:`CERT_REQUIRED`.
-+
-
- .. index:: single: certificates
-
-@@ -460,6 +1258,9 @@ and a footer line::
- ... (certificate in base64 PEM encoding) ...
- -----END CERTIFICATE-----
-
-+Certificate chains
-+^^^^^^^^^^^^^^^^^^
-+
- The Python files which contain certificates can contain a sequence of
- certificates, sometimes called a *certificate chain*. This chain should start
- with the specific certificate for the principal who "is" the client or
server,
-@@ -483,24 +1284,35 @@ certification authority's certificate::
- ... (the root certificate for the CA's issuer)...
- -----END CERTIFICATE-----
-
-+CA certificates
-+^^^^^^^^^^^^^^^
-+
- If you are going to require validation of the other side of the connection's
- certificate, you need to provide a "CA certs" file, filled with the
certificate
- chains for each issuer you are willing to trust. Again, this file just contains
- these chains concatenated together. For validation, Python will use the first
--chain it finds in the file which matches.
-+chain it finds in the file which matches. The platform's certificates file can
-+be used by calling :meth:`SSLContext.load_default_certs`, this is done
-+automatically with :func:`.create_default_context`.
-+
-+Combined key and certificate
-+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-+
-+Often the private key is stored in the same file as the certificate; in this
-+case, only the ``certfile`` parameter to :meth:`SSLContext.load_cert_chain`
-+and :func:`wrap_socket` needs to be passed. If the private key is stored
-+with the certificate, it should come before the first certificate in
-+the certificate chain::
-
--Some "standard" root certificates are available from various certification
--authorities: `Thawte <
http://www.thawte.com/roots/>`_, `Verisign
--<http://www.verisign.com/support/roots.html>`_, `Positive SSL
--<http://www.PositiveSSL.com/ssl-certificate-support/cert_installation/UTN-USERFirst-Hardware.crt>`_
--(used by
python.org), `Equifax and GeoTrust
--<http://www.geotrust.com/resources/root_certificates/index.asp>`_.
-+ -----BEGIN RSA PRIVATE KEY-----
-+ ... (private key in base64 encoding) ...
-+ -----END RSA PRIVATE KEY-----
-+ -----BEGIN CERTIFICATE-----
-+ ... (certificate in base64 PEM encoding) ...
-+ -----END CERTIFICATE-----
-
--In general, if you are using SSL3 or TLS1, you don't need to put the full chain
--in your "CA certs" file; you only need the root certificates, and the remote
--peer is supposed to furnish the other certificates necessary to chain from its
--certificate to a root certificate. See :rfc:`4158` for more discussion of the
--way in which certification chains can be built.
-+Self-signed certificates
-+^^^^^^^^^^^^^^^^^^^^^^^^
-
- If you are going to create a server that provides SSL-encrypted connection
- services, you will need to acquire a certificate for that service. There are
-@@ -555,87 +1367,156 @@ should use the following idiom::
- Client-side operation
- ^^^^^^^^^^^^^^^^^^^^^
-
--This example connects to an SSL server, prints the server's address and
--certificate, sends some bytes, and reads part of the response::
-+This example connects to an SSL server and prints the server's certificate::
-
- import socket, ssl, pprint
-
- s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
--
- # require a certificate from the server
- ssl_sock = ssl.wrap_socket(s,
- ca_certs="/etc/ca_certs_file",
- cert_reqs=ssl.CERT_REQUIRED)
--
- ssl_sock.connect(('www.verisign.com', 443))
-
-- print repr(ssl_sock.getpeername())
-- print ssl_sock.cipher()
-- print pprint.pformat(ssl_sock.getpeercert())
--
-- # Set a simple HTTP request -- use httplib in actual code.
-- ssl_sock.write("""GET / HTTP/1.0\r
-- Host:
www.verisign.com\r\n\r\n""")
--
-- # Read a chunk of data. Will not necessarily
-- # read all the data returned by the server.
-- data = ssl_sock.read()
--
-+ pprint.pprint(ssl_sock.getpeercert())
- # note that closing the SSLSocket will also close the underlying socket
- ssl_sock.close()
-
--As of September 6, 2007, the certificate printed by this program looked like
-+As of January 6, 2012, the certificate printed by this program looks like
- this::
-
-- {'notAfter': 'May 8 23:59:59 2009 GMT',
-- 'subject': ((('serialNumber', u'2497886'),),
-- (('1.3.6.1.4.1.311.60.2.1.3', u'US'),),
-- (('1.3.6.1.4.1.311.60.2.1.2', u'Delaware'),),
-- (('countryName', u'US'),),
-- (('postalCode', u'94043'),),
-- (('stateOrProvinceName', u'California'),),
-- (('localityName', u'Mountain View'),),
-- (('streetAddress', u'487 East Middlefield Road'),),
-- (('organizationName', u'VeriSign, Inc.'),),
-- (('organizationalUnitName',
-- u'Production Security Services'),),
-- (('organizationalUnitName',
-- u'Terms of use at
www.verisign.com/rpa (c)06'),),
-- (('commonName', u'www.verisign.com'),))}
--
--which is a fairly poorly-formed ``subject`` field.
-+ {'issuer': ((('countryName', 'US'),),
-+ (('organizationName', 'VeriSign, Inc.'),),
-+ (('organizationalUnitName', 'VeriSign Trust Network'),),
-+ (('organizationalUnitName',
-+ 'Terms of use at
https://www.verisign.com/rpa (c)06'),),
-+ (('commonName',
-+ 'VeriSign Class 3 Extended Validation SSL SGC CA'),)),
-+ 'notAfter': 'May 25 23:59:59 2012 GMT',
-+ 'notBefore': 'May 26 00:00:00 2010 GMT',
-+ 'serialNumber': '53D2BEF924A7245E83CA01E46CAA2477',
-+ 'subject': ((('1.3.6.1.4.1.311.60.2.1.3', 'US'),),
-+ (('1.3.6.1.4.1.311.60.2.1.2', 'Delaware'),),
-+ (('businessCategory', 'V1.0, Clause 5.(b)'),),
-+ (('serialNumber', '2497886'),),
-+ (('countryName', 'US'),),
-+ (('postalCode', '94043'),),
-+ (('stateOrProvinceName', 'California'),),
-+ (('localityName', 'Mountain View'),),
-+ (('streetAddress', '487 East Middlefield Road'),),
-+ (('organizationName', 'VeriSign, Inc.'),),
-+ (('organizationalUnitName', ' Production Security
Services'),),
-+ (('commonName', 'www.verisign.com'),)),
-+ 'subjectAltName': (('DNS', 'www.verisign.com'),
-+ ('DNS', 'verisign.com'),
-+ ('DNS', 'www.verisign.net'),
-+ ('DNS', 'verisign.net'),
-+ ('DNS', 'www.verisign.mobi'),
-+ ('DNS', 'verisign.mobi'),
-+ ('DNS', 'www.verisign.eu'),
-+ ('DNS', 'verisign.eu')),
-+ 'version': 3}
-+
-+This other example first creates an SSL context, instructs it to verify
-+certificates sent by peers, and feeds it a set of recognized certificate
-+authorities (CA)::
-+
-+ >>> context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
-+ >>> context.verify_mode = ssl.CERT_REQUIRED
-+ >>> context.load_verify_locations("/etc/ssl/certs/ca-bundle.crt")
-+
-+(it is assumed your operating system places a bundle of all CA certificates
-+in ``/etc/ssl/certs/ca-bundle.crt``; if not, you'll get an error and have
-+to adjust the location)
-+
-+When you use the context to connect to a server, :const:`CERT_REQUIRED`
-+validates the server certificate: it ensures that the server certificate
-+was signed with one of the CA certificates, and checks the signature for
-+correctness::
-+
-+ >>> conn = context.wrap_socket(socket.socket(socket.AF_INET))
-+ >>> conn.connect(("linuxfr.org", 443))
-+
-+You should then fetch the certificate and check its fields for conformity::
-+
-+ >>> cert = conn.getpeercert()
-+ >>> ssl.match_hostname(cert, "linuxfr.org")
-+
-+Visual inspection shows that the certificate does identify the desired service
-+(that is, the HTTPS host ``linuxfr.org``)::
-+
-+ >>> pprint.pprint(cert)
-+ {'issuer': ((('organizationName', 'CAcert Inc.'),),
-+ (('organizationalUnitName', 'http://www.CAcert.org'),),
-+ (('commonName', 'CAcert Class 3 Root'),)),
-+ 'notAfter': 'Jun 7 21:02:24 2013 GMT',
-+ 'notBefore': 'Jun 8 21:02:24 2011 GMT',
-+ 'serialNumber': 'D3E9',
-+ 'subject': ((('commonName', 'linuxfr.org'),),),
-+ 'subjectAltName': (('DNS', 'linuxfr.org'),
-+ ('othername', '<unsupported>'),
-+ ('DNS', 'linuxfr.org'),
-+ ('othername', '<unsupported>'),
-+ ('DNS', 'dev.linuxfr.org'),
-+ ('othername', '<unsupported>'),
-+ ('DNS', 'prod.linuxfr.org'),
-+ ('othername', '<unsupported>'),
-+ ('DNS', 'alpha.linuxfr.org'),
-+ ('othername', '<unsupported>'),
-+ ('DNS', '*.linuxfr.org'),
-+ ('othername', '<unsupported>')),
-+ 'version': 3}
-+
-+Now that you are assured of its authenticity, you can proceed to talk with
-+the server::
-+
-+ >>> conn.sendall(b"HEAD / HTTP/1.0\r\nHost: linuxfr.org\r\n\r\n")
-+ >>> pprint.pprint(conn.recv(1024).split(b"\r\n"))
-+ [b'HTTP/1.1 302 Found',
-+ b'Date: Sun, 16 May 2010 13:43:28 GMT',
-+ b'Server: Apache/2.2',
-+ b'Location:
https://linuxfr.org/pub/';,
-+ b'Vary: Accept-Encoding',
-+ b'Connection: close',
-+ b'Content-Type: text/html; charset=iso-8859-1',
-+ b'',
-+ b'']
-+
-+See the discussion of :ref:`ssl-security` below.
-+
-
- Server-side operation
- ^^^^^^^^^^^^^^^^^^^^^
-
--For server operation, typically you'd need to have a server certificate, and
--private key, each in a file. You'd open a socket, bind it to a port, call
--:meth:`listen` on it, then start waiting for clients to connect::
-+For server operation, typically you'll need to have a server certificate, and
-+private key, each in a file. You'll first create a context holding the key
-+and the certificate, so that clients can check your authenticity. Then
-+you'll open a socket, bind it to a port, call :meth:`listen` on it, and start
-+waiting for clients to connect::
-
- import socket, ssl
-
-+ context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
-+ context.load_cert_chain(certfile="mycertfile",
keyfile="mykeyfile")
-+
- bindsocket = socket.socket()
- bindsocket.bind(('myaddr.mydomain.com', 10023))
- bindsocket.listen(5)
-
--When one did, you'd call :meth:`accept` on the socket to get the new socket from
--the other end, and use :func:`wrap_socket` to create a server-side SSL context
--for it::
-+When a client connects, you'll call :meth:`accept` on the socket to get the
-+new socket from the other end, and use the context's :meth:`SSLContext.wrap_socket`
-+method to create a server-side SSL socket for the connection::
-
- while True:
- newsocket, fromaddr = bindsocket.accept()
-- connstream = ssl.wrap_socket(newsocket,
-- server_side=True,
-- certfile="mycertfile",
-- keyfile="mykeyfile",
-- ssl_version=ssl.PROTOCOL_TLSv1)
-+ connstream = context.wrap_socket(newsocket, server_side=True)
- try:
- deal_with_client(connstream)
- finally:
- connstream.shutdown(socket.SHUT_RDWR)
- connstream.close()
-
--Then you'd read data from the ``connstream`` and do something with it till you
-+Then you'll read data from the ``connstream`` and do something with it till you
- are finished with the client (or the client is finished with you)::
-
- def deal_with_client(connstream):
-@@ -649,7 +1530,138 @@ are finished with the client (or the client is finished with
you)::
- data = connstream.read()
- # finished with client
-
--And go back to listening for new client connections.
-+And go back to listening for new client connections (of course, a real server
-+would probably handle each client connection in a separate thread, or put
-+the sockets in non-blocking mode and use an event loop).
-+
-+
-+.. _ssl-nonblocking:
-+
-+Notes on non-blocking sockets
-+-----------------------------
-+
-+When working with non-blocking sockets, there are several things you need
-+to be aware of:
-+
-+- Calling :func:`~select.select` tells you that the OS-level socket can be
-+ read from (or written to), but it does not imply that there is sufficient
-+ data at the upper SSL layer. For example, only part of an SSL frame might
-+ have arrived. Therefore, you must be ready to handle :meth:`SSLSocket.recv`
-+ and :meth:`SSLSocket.send` failures, and retry after another call to
-+ :func:`~select.select`.
-+
-+- Conversely, since the SSL layer has its own framing, a SSL socket may
-+ still have data available for reading without :func:`~select.select`
-+ being aware of it. Therefore, you should first call
-+ :meth:`SSLSocket.recv` to drain any potentially available data, and then
-+ only block on a :func:`~select.select` call if still necessary.
-+
-+ (of course, similar provisions apply when using other primitives such as
-+ :func:`~select.poll`, or those in the :mod:`selectors` module)
-+
-+- The SSL handshake itself will be non-blocking: the
-+ :meth:`SSLSocket.do_handshake` method has to be retried until it returns
-+ successfully. Here is a synopsis using :func:`~select.select` to wait for
-+ the socket's readiness::
-+
-+ while True:
-+ try:
-+ sock.do_handshake()
-+ break
-+ except ssl.SSLWantReadError:
-+ select.select([sock], [], [])
-+ except ssl.SSLWantWriteError:
-+ select.select([], [sock], [])
-+
-+
-+.. _ssl-security:
-+
-+Security considerations
-+-----------------------
-+
-+Best defaults
-+^^^^^^^^^^^^^
-+
-+For **client use**, if you don't have any special requirements for your
-+security policy, it is highly recommended that you use the
-+:func:`create_default_context` function to create your SSL context.
-+It will load the system's trusted CA certificates, enable certificate
-+validation and hostname checking, and try to choose reasonably secure
-+protocol and cipher settings.
-+
-+If a client certificate is needed for the connection, it can be added with
-+:meth:`SSLContext.load_cert_chain`.
-+
-+By contrast, if you create the SSL context by calling the :class:`SSLContext`
-+constructor yourself, it will not have certificate validation nor hostname
-+checking enabled by default. If you do so, please read the paragraphs below
-+to achieve a good security level.
-+
-+Manual settings
-+^^^^^^^^^^^^^^^
-+
-+Verifying certificates
-+''''''''''''''''''''''
-+
-+When calling the :class:`SSLContext` constructor directly,
-+:const:`CERT_NONE` is the default. Since it does not authenticate the other
-+peer, it can be insecure, especially in client mode where most of time you
-+would like to ensure the authenticity of the server you're talking to.
-+Therefore, when in client mode, it is highly recommended to use
-+:const:`CERT_REQUIRED`. However, it is in itself not sufficient; you also
-+have to check that the server certificate, which can be obtained by calling
-+:meth:`SSLSocket.getpeercert`, matches the desired service. For many
-+protocols and applications, the service can be identified by the hostname;
-+in this case, the :func:`match_hostname` function can be used. This common
-+check is automatically performed when :attr:`SSLContext.check_hostname` is
-+enabled.
-+
-+In server mode, if you want to authenticate your clients using the SSL layer
-+(rather than using a higher-level authentication mechanism), you'll also have
-+to specify :const:`CERT_REQUIRED` and similarly check the client certificate.
-+
-+ .. note::
-+
-+ In client mode, :const:`CERT_OPTIONAL` and :const:`CERT_REQUIRED` are
-+ equivalent unless anonymous ciphers are enabled (they are disabled
-+ by default).
-+
-+Protocol versions
-+'''''''''''''''''
-+
-+SSL version 2 is considered insecure and is therefore dangerous to use. If
-+you want maximum compatibility between clients and servers, it is recommended
-+to use :const:`PROTOCOL_SSLv23` as the protocol version and then disable
-+SSLv2 explicitly using the :data:`SSLContext.options` attribute::
-+
-+ context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
-+ context.options |= ssl.OP_NO_SSLv2
-+
-+The SSL context created above will allow SSLv3 and TLSv1 (and later, if
-+supported by your system) connections, but not SSLv2.
-+
-+Cipher selection
-+''''''''''''''''
-+
-+If you have advanced security requirements, fine-tuning of the ciphers
-+enabled when negotiating a SSL session is possible through the
-+:meth:`SSLContext.set_ciphers` method. Starting from Python 2.7.9, the
-+ssl module disables certain weak ciphers by default, but you may want
-+to further restrict the cipher choice. Be sure to read OpenSSL's documentation
-+about the `cipher list format
<
http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT>`_.
-+If you want to check which ciphers are enabled by a given cipher list, use the
-+``openssl ciphers`` command on your system.
-+
-+Multi-processing
-+^^^^^^^^^^^^^^^^
-+
-+If using this module as part of a multi-processed application (using,
-+for example the :mod:`multiprocessing` or :mod:`concurrent.futures` modules),
-+be aware that OpenSSL's internal random number generator does not properly
-+handle forked processes. Applications must change the PRNG state of the
-+parent process if they use any SSL feature with :func:`os.fork`. Any
-+successful call of :func:`~ssl.RAND_add`, :func:`~ssl.RAND_bytes` or
-+:func:`~ssl.RAND_pseudo_bytes` is sufficient.
-
-
- .. seealso::
-@@ -668,3 +1680,15 @@ And go back to listening for new client connections.
-
- `RFC 3280: Internet X.509 Public Key Infrastructure Certificate and CRL Profile
<
http://www.ietf.org/rfc/rfc3280>`_
- Housley et. al.
-+
-+ `RFC 4366: Transport Layer Security (TLS) Extensions
<
http://www.ietf.org/rfc/rfc4366>`_
-+ Blake-Wilson et. al.
-+
-+ `RFC 5246: The Transport Layer Security (TLS) Protocol Version 1.2
<
http://www.ietf.org/rfc/rfc5246>`_
-+ T. Dierks et. al.
-+
-+ `RFC 6066: Transport Layer Security (TLS) Extensions
<
http://www.ietf.org/rfc/rfc6066>`_
-+ D. Eastlake
-+
-+ `IANA TLS: Transport Layer Security (TLS) Parameters
<
http://www.iana.org/assignments/tls-parameters/tls-parameters.xml>`_
-+ IANA
-diff --git a/Lib/ssl.py b/Lib/ssl.py
-index 666cea3..882b60e 100644
---- a/Lib/ssl.py
-+++ b/Lib/ssl.py
-@@ -1,8 +1,7 @@
- # Wrapper module for _ssl, providing some additional facilities
- # implemented in Python. Written by Bill Janssen.
-
--"""\
--This module provides some more Pythonic support for SSL.
-+"""This module provides some more Pythonic support for SSL.
-
- Object types:
-
-@@ -53,62 +52,461 @@ PROTOCOL_SSLv2
- PROTOCOL_SSLv3
- PROTOCOL_SSLv23
- PROTOCOL_TLSv1
-+PROTOCOL_TLSv1_1
-+PROTOCOL_TLSv1_2
-+
-+The following constants identify various SSL alert message descriptions as per
-+http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-6
-+
-+ALERT_DESCRIPTION_CLOSE_NOTIFY
-+ALERT_DESCRIPTION_UNEXPECTED_MESSAGE
-+ALERT_DESCRIPTION_BAD_RECORD_MAC
-+ALERT_DESCRIPTION_RECORD_OVERFLOW
-+ALERT_DESCRIPTION_DECOMPRESSION_FAILURE
-+ALERT_DESCRIPTION_HANDSHAKE_FAILURE
-+ALERT_DESCRIPTION_BAD_CERTIFICATE
-+ALERT_DESCRIPTION_UNSUPPORTED_CERTIFICATE
-+ALERT_DESCRIPTION_CERTIFICATE_REVOKED
-+ALERT_DESCRIPTION_CERTIFICATE_EXPIRED
-+ALERT_DESCRIPTION_CERTIFICATE_UNKNOWN
-+ALERT_DESCRIPTION_ILLEGAL_PARAMETER
-+ALERT_DESCRIPTION_UNKNOWN_CA
-+ALERT_DESCRIPTION_ACCESS_DENIED
-+ALERT_DESCRIPTION_DECODE_ERROR
-+ALERT_DESCRIPTION_DECRYPT_ERROR
-+ALERT_DESCRIPTION_PROTOCOL_VERSION
-+ALERT_DESCRIPTION_INSUFFICIENT_SECURITY
-+ALERT_DESCRIPTION_INTERNAL_ERROR
-+ALERT_DESCRIPTION_USER_CANCELLED
-+ALERT_DESCRIPTION_NO_RENEGOTIATION
-+ALERT_DESCRIPTION_UNSUPPORTED_EXTENSION
-+ALERT_DESCRIPTION_CERTIFICATE_UNOBTAINABLE
-+ALERT_DESCRIPTION_UNRECOGNIZED_NAME
-+ALERT_DESCRIPTION_BAD_CERTIFICATE_STATUS_RESPONSE
-+ALERT_DESCRIPTION_BAD_CERTIFICATE_HASH_VALUE
-+ALERT_DESCRIPTION_UNKNOWN_PSK_IDENTITY
- """
-
- import textwrap
-+import re
-+import sys
-+import os
-+from collections import namedtuple
-+from contextlib import closing
-
- import _ssl # if we can't import it, let the error propagate
-
- from _ssl import OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_INFO, OPENSSL_VERSION
--from _ssl import SSLError
-+from _ssl import _SSLContext
-+from _ssl import (
-+ SSLError, SSLZeroReturnError, SSLWantReadError, SSLWantWriteError,
-+ SSLSyscallError, SSLEOFError,
-+ )
- from _ssl import CERT_NONE, CERT_OPTIONAL, CERT_REQUIRED
-+from _ssl import (VERIFY_DEFAULT, VERIFY_CRL_CHECK_LEAF, VERIFY_CRL_CHECK_CHAIN,
-+ VERIFY_X509_STRICT)
-+from _ssl import txt2obj as _txt2obj, nid2obj as _nid2obj
- from _ssl import RAND_status, RAND_egd, RAND_add
--from _ssl import \
-- SSL_ERROR_ZERO_RETURN, \
-- SSL_ERROR_WANT_READ, \
-- SSL_ERROR_WANT_WRITE, \
-- SSL_ERROR_WANT_X509_LOOKUP, \
-- SSL_ERROR_SYSCALL, \
-- SSL_ERROR_SSL, \
-- SSL_ERROR_WANT_CONNECT, \
-- SSL_ERROR_EOF, \
-- SSL_ERROR_INVALID_ERROR_CODE
--from _ssl import PROTOCOL_SSLv3, PROTOCOL_SSLv23, PROTOCOL_TLSv1
--_PROTOCOL_NAMES = {
-- PROTOCOL_TLSv1: "TLSv1",
-- PROTOCOL_SSLv23: "SSLv23",
-- PROTOCOL_SSLv3: "SSLv3",
--}
-+
-+def _import_symbols(prefix):
-+ for n in dir(_ssl):
-+ if n.startswith(prefix):
-+ globals()[n] = getattr(_ssl, n)
-+
-+_import_symbols('OP_')
-+_import_symbols('ALERT_DESCRIPTION_')
-+_import_symbols('SSL_ERROR_')
-+_import_symbols('PROTOCOL_')
-+
-+from _ssl import HAS_SNI, HAS_ECDH, HAS_NPN
-+
-+from _ssl import _OPENSSL_API_VERSION
-+
-+_PROTOCOL_NAMES = {value: name for name, value in globals().items() if
name.startswith('PROTOCOL_')}
-+
- try:
-- from _ssl import PROTOCOL_SSLv2
- _SSLv2_IF_EXISTS = PROTOCOL_SSLv2
--except ImportError:
-+except NameError:
- _SSLv2_IF_EXISTS = None
--else:
-- _PROTOCOL_NAMES[PROTOCOL_SSLv2] = "SSLv2"
-
- from socket import socket, _fileobject, _delegate_methods, error as socket_error
--from socket import getnameinfo as _getnameinfo
--from socket import SOL_SOCKET, SO_TYPE, SOCK_STREAM
-+if sys.platform == "win32":
-+ from _ssl import enum_certificates, enum_crls
-+
-+from socket import socket, AF_INET, SOCK_STREAM, create_connection
-+from socket import SOL_SOCKET, SO_TYPE
- import base64 # for DER-to-PEM translation
- import errno
-
-+if _ssl.HAS_TLS_UNIQUE:
-+ CHANNEL_BINDING_TYPES = ['tls-unique']
-+else:
-+ CHANNEL_BINDING_TYPES = []
-+
- # Disable weak or insecure ciphers by default
- # (OpenSSL's default setting is 'DEFAULT:!aNULL:!eNULL')
--_DEFAULT_CIPHERS = 'DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2'
--
-+# Enable a better set of ciphers by default
-+# This list has been explicitly chosen to:
-+# * Prefer cipher suites that offer perfect forward secrecy (DHE/ECDHE)
-+# * Prefer ECDHE over DHE for better performance
-+# * Prefer any AES-GCM over any AES-CBC for better performance and security
-+# * Then Use HIGH cipher suites as a fallback
-+# * Then Use 3DES as fallback which is secure but slow
-+# * Finally use RC4 as a fallback which is problematic but needed for
-+# compatibility some times.
-+# * Disable NULL authentication, NULL encryption, and MD5 MACs for security
-+# reasons
-+_DEFAULT_CIPHERS = (
-+ 'ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+HIGH:'
-+ 'DH+HIGH:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+HIGH:RSA+3DES:ECDH+RC4:'
-+ 'DH+RC4:RSA+RC4:!aNULL:!eNULL:!MD5'
-+)
-+
-+# Restricted and more secure ciphers for the server side
-+# This list has been explicitly chosen to:
-+# * Prefer cipher suites that offer perfect forward secrecy (DHE/ECDHE)
-+# * Prefer ECDHE over DHE for better performance
-+# * Prefer any AES-GCM over any AES-CBC for better performance and security
-+# * Then Use HIGH cipher suites as a fallback
-+# * Then Use 3DES as fallback which is secure but slow
-+# * Disable NULL authentication, NULL encryption, MD5 MACs, DSS, and RC4 for
-+# security reasons
-+_RESTRICTED_SERVER_CIPHERS = (
-+ 'ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+HIGH:'
-+ 'DH+HIGH:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+HIGH:RSA+3DES:!aNULL:'
-+ '!eNULL:!MD5:!DSS:!RC4'
-+)
-+
-+
-+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
-+
-+ pieces = dn.split(r'.')
-+ leftmost = pieces[0]
-+ remainder = pieces[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, match_hostname needs a "
-+ "SSL socket or SSL context with either "
-+ "CERT_OPTIONAL or CERT_REQUIRED")
-+ 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")
-+
-+
-+DefaultVerifyPaths = namedtuple("DefaultVerifyPaths",
-+ "cafile capath openssl_cafile_env openssl_cafile openssl_capath_env "
-+ "openssl_capath")
-+
-+def get_default_verify_paths():
-+ """Return paths to default cafile and capath.
-+ """
-+ parts = _ssl.get_default_verify_paths()
-+
-+ # environment vars shadow paths
-+ cafile = os.environ.get(parts[0], parts[1])
-+ capath = os.environ.get(parts[2], parts[3])
-+
-+ return DefaultVerifyPaths(cafile if os.path.isfile(cafile) else None,
-+ capath if os.path.isdir(capath) else None,
-+ *parts)
-+
-+
-+class _ASN1Object(namedtuple("_ASN1Object", "nid shortname longname
oid")):
-+ """ASN.1 object identifier lookup
-+ """
-+ __slots__ = ()
-+
-+ def __new__(cls, oid):
-+ return super(_ASN1Object, cls).__new__(cls, *_txt2obj(oid, name=False))
-+
-+ @classmethod
-+ def fromnid(cls, nid):
-+ """Create _ASN1Object from OpenSSL numeric ID
-+ """
-+ return super(_ASN1Object, cls).__new__(cls, *_nid2obj(nid))
-+
-+ @classmethod
-+ def fromname(cls, name):
-+ """Create _ASN1Object from short name, long name or OID
-+ """
-+ return super(_ASN1Object, cls).__new__(cls, *_txt2obj(name, name=True))
-+
-+
-+class Purpose(_ASN1Object):
-+ """SSLContext purpose flags with X509v3 Extended Key Usage objects
-+ """
-+
-+Purpose.SERVER_AUTH = Purpose('1.3.6.1.5.5.7.3.1')
-+Purpose.CLIENT_AUTH = Purpose('1.3.6.1.5.5.7.3.2')
-+
-+
-+class SSLContext(_SSLContext):
-+ """An SSLContext holds various SSL-related configuration options and
-+ data, such as certificates and possibly a private key."""
-+
-+ __slots__ = ('protocol', '__weakref__')
-+ _windows_cert_stores = ("CA", "ROOT")
-+
-+ def __new__(cls, protocol, *args, **kwargs):
-+ self = _SSLContext.__new__(cls, protocol)
-+ if protocol != _SSLv2_IF_EXISTS:
-+ self.set_ciphers(_DEFAULT_CIPHERS)
-+ return self
-+
-+ def __init__(self, protocol):
-+ self.protocol = protocol
-+
-+ def wrap_socket(self, sock, server_side=False,
-+ do_handshake_on_connect=True,
-+ suppress_ragged_eofs=True,
-+ server_hostname=None):
-+ return SSLSocket(sock=sock, server_side=server_side,
-+ do_handshake_on_connect=do_handshake_on_connect,
-+ suppress_ragged_eofs=suppress_ragged_eofs,
-+ server_hostname=server_hostname,
-+ _context=self)
-+
-+ def set_npn_protocols(self, npn_protocols):
-+ protos = bytearray()
-+ for protocol in npn_protocols:
-+ b = protocol.encode('ascii')
-+ if len(b) == 0 or len(b) > 255:
-+ raise SSLError('NPN protocols must be 1 to 255 in length')
-+ protos.append(len(b))
-+ protos.extend(b)
-+
-+ self._set_npn_protocols(protos)
-+
-+ def _load_windows_store_certs(self, storename, purpose):
-+ certs = bytearray()
-+ for cert, encoding, trust in enum_certificates(storename):
-+ # CA certs are never PKCS#7 encoded
-+ if encoding == "x509_asn":
-+ if trust is True or purpose.oid in trust:
-+ certs.extend(cert)
-+ self.load_verify_locations(cadata=certs)
-+ return certs
-+
-+ def load_default_certs(self, purpose=Purpose.SERVER_AUTH):
-+ if not isinstance(purpose, _ASN1Object):
-+ raise TypeError(purpose)
-+ if sys.platform == "win32":
-+ for storename in self._windows_cert_stores:
-+ self._load_windows_store_certs(storename, purpose)
-+ else:
-+ self.set_default_verify_paths()
-+
-+
-+def create_default_context(purpose=Purpose.SERVER_AUTH, cafile=None,
-+ capath=None, cadata=None):
-+ """Create a SSLContext object with default settings.
-+
-+ NOTE: The protocol and settings may change anytime without prior
-+ deprecation. The values represent a fair balance between maximum
-+ compatibility and security.
-+ """
-+ if not isinstance(purpose, _ASN1Object):
-+ raise TypeError(purpose)
-+
-+ context = SSLContext(PROTOCOL_SSLv23)
-+
-+ # SSLv2 considered harmful.
-+ context.options |= OP_NO_SSLv2
-+
-+ # SSLv3 has problematic security and is only required for really old
-+ # clients such as IE6 on Windows XP
-+ context.options |= OP_NO_SSLv3
-+
-+ # disable compression to prevent CRIME attacks (OpenSSL 1.0+)
-+ context.options |= getattr(_ssl, "OP_NO_COMPRESSION", 0)
-+
-+ if purpose == Purpose.SERVER_AUTH:
-+ # verify certs and host name in client mode
-+ context.verify_mode = CERT_REQUIRED
-+ context.check_hostname = True
-+ elif purpose == Purpose.CLIENT_AUTH:
-+ # Prefer the server's ciphers by default so that we get stronger
-+ # encryption
-+ context.options |= getattr(_ssl, "OP_CIPHER_SERVER_PREFERENCE", 0)
-+
-+ # Use single use keys in order to improve forward secrecy
-+ context.options |= getattr(_ssl, "OP_SINGLE_DH_USE", 0)
-+ context.options |= getattr(_ssl, "OP_SINGLE_ECDH_USE", 0)
-+
-+ # disallow ciphers with known vulnerabilities
-+ context.set_ciphers(_RESTRICTED_SERVER_CIPHERS)
-+
-+ if cafile or capath or cadata:
-+ context.load_verify_locations(cafile, capath, cadata)
-+ elif context.verify_mode != CERT_NONE:
-+ # no explicit cafile, capath or cadata but the verify mode is
-+ # CERT_OPTIONAL or CERT_REQUIRED. Let's try to load default system
-+ # root CA certificates for the given purpose. This may fail silently.
-+ context.load_default_certs(purpose)
-+ return context
-+
-+
-+def _create_stdlib_context(protocol=PROTOCOL_SSLv23, cert_reqs=None,
-+ check_hostname=False, purpose=Purpose.SERVER_AUTH,
-+ certfile=None, keyfile=None,
-+ cafile=None, capath=None, cadata=None):
-+ """Create a SSLContext object for Python stdlib modules
-+
-+ All Python stdlib modules shall use this function to create SSLContext
-+ objects in order to keep common settings in one place. The configuration
-+ is less restrict than create_default_context()'s to increase backward
-+ compatibility.
-+ """
-+ if not isinstance(purpose, _ASN1Object):
-+ raise TypeError(purpose)
-+
-+ context = SSLContext(protocol)
-+ # SSLv2 considered harmful.
-+ context.options |= OP_NO_SSLv2
-+
-+ if cert_reqs is not None:
-+ context.verify_mode = cert_reqs
-+ context.check_hostname = check_hostname
-+
-+ if keyfile and not certfile:
-+ raise ValueError("certfile must be specified")
-+ if certfile or keyfile:
-+ context.load_cert_chain(certfile, keyfile)
-+
-+ # load CA root certs
-+ if cafile or capath or cadata:
-+ context.load_verify_locations(cafile, capath, cadata)
-+ elif context.verify_mode != CERT_NONE:
-+ # no explicit cafile, capath or cadata but the verify mode is
-+ # CERT_OPTIONAL or CERT_REQUIRED. Let's try to load default system
-+ # root CA certificates for the given purpose. This may fail silently.
-+ context.load_default_certs(purpose)
-+
-+ return context
-
- class SSLSocket(socket):
--
- """This class implements a subtype of socket.socket that wraps
- the underlying OS socket in an SSL context when necessary, and
- provides read and write methods over that channel."""
-
-- def __init__(self, sock, keyfile=None, certfile=None,
-+ def __init__(self, sock=None, keyfile=None, certfile=None,
- server_side=False, cert_reqs=CERT_NONE,
- ssl_version=PROTOCOL_SSLv23, ca_certs=None,
- do_handshake_on_connect=True,
-- suppress_ragged_eofs=True, ciphers=None):
-+ family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None,
-+ suppress_ragged_eofs=True, npn_protocols=None, ciphers=None,
-+ server_hostname=None,
-+ _context=None):
-+
-+ if _context:
-+ self._context = _context
-+ else:
-+ if server_side and not certfile:
-+ raise ValueError("certfile must be specified for server-side
"
-+ "operations")
-+ if keyfile and not certfile:
-+ raise ValueError("certfile must be specified")
-+ if certfile and not keyfile:
-+ keyfile = certfile
-+ self._context = SSLContext(ssl_version)
-+ self._context.verify_mode = cert_reqs
-+ if ca_certs:
-+ self._context.load_verify_locations(ca_certs)
-+ if certfile:
-+ self._context.load_cert_chain(certfile, keyfile)
-+ if npn_protocols:
-+ self._context.set_npn_protocols(npn_protocols)
-+ if ciphers:
-+ self._context.set_ciphers(ciphers)
-+ self.keyfile = keyfile
-+ self.certfile = certfile
-+ self.cert_reqs = cert_reqs
-+ self.ssl_version = ssl_version
-+ self.ca_certs = ca_certs
-+ self.ciphers = ciphers
- # Can't use sock.type as other flags (such as SOCK_NONBLOCK) get
- # mixed in.
- if sock.getsockopt(SOL_SOCKET, SO_TYPE) != SOCK_STREAM:
-@@ -122,98 +520,161 @@ class SSLSocket(socket):
- delattr(self, attr)
- except AttributeError:
- pass
-+ if server_side and server_hostname:
-+ raise ValueError("server_hostname can only be specified "
-+ "in client mode")
-+ if self._context.check_hostname and not server_hostname:
-+ if HAS_SNI:
-+ raise ValueError("check_hostname requires server_hostname")
-+ else:
-+ raise ValueError("check_hostname requires server_hostname, "
-+ "but it's not supported by your OpenSSL
"
-+ "library")
-+ self.server_side = server_side
-+ self.server_hostname = server_hostname
-+ self.do_handshake_on_connect = do_handshake_on_connect
-+ self.suppress_ragged_eofs = suppress_ragged_eofs
-
-- if ciphers is None and ssl_version != _SSLv2_IF_EXISTS:
-- ciphers = _DEFAULT_CIPHERS
--
-- if certfile and not keyfile:
-- keyfile = certfile
-- # see if it's connected
-+ # See if we are connected
- try:
-- socket.getpeername(self)
-- except socket_error, e:
-+ self.getpeername()
-+ except socket_error as e:
- if e.errno != errno.ENOTCONN:
- raise
-- # no, no connection yet
-- self._connected = False
-- self._sslobj = None
-+ connected = False
- else:
-- # yes, create the SSL object
-- self._connected = True
-- self._sslobj = _ssl.sslwrap(self._sock, server_side,
-- keyfile, certfile,
-- cert_reqs, ssl_version, ca_certs,
-- ciphers)
-- if do_handshake_on_connect:
-- self.do_handshake()
-- self.keyfile = keyfile
-- self.certfile = certfile
-- self.cert_reqs = cert_reqs
-- self.ssl_version = ssl_version
-- self.ca_certs = ca_certs
-- self.ciphers = ciphers
-- self.do_handshake_on_connect = do_handshake_on_connect
-- self.suppress_ragged_eofs = suppress_ragged_eofs
-+ connected = True
-+
-+ self._closed = False
-+ self._sslobj = None
-+ self._connected = connected
-+ if connected:
-+ # create the SSL object
-+ try:
-+ self._sslobj = self._context._wrap_socket(self._sock, server_side,
-+ server_hostname,
ssl_sock=self)
-+ if do_handshake_on_connect:
-+ timeout = self.gettimeout()
-+ if timeout == 0.0:
-+ # non-blocking
-+ raise ValueError("do_handshake_on_connect should not be
specified for non-blocking sockets")
-+ self.do_handshake()
-+
-+ except (OSError, ValueError):
-+ self.close()
-+ raise
- self._makefile_refs = 0
-
-- def read(self, len=1024):
-+ @property
-+ def context(self):
-+ return self._context
-+
-+ @context.setter
-+ def context(self, ctx):
-+ self._context = ctx
-+ self._sslobj.context = ctx
-+
-+ def dup(self):
-+ raise NotImplemented("Can't dup() %s instances" %
-+ self.__class__.__name__)
-+
-+ def _checkClosed(self, msg=None):
-+ # raise an exception here if you wish to check for spurious closes
-+ pass
-
-+ def _check_connected(self):
-+ if not self._connected:
-+ # getpeername() will raise ENOTCONN if the socket is really
-+ # not connected; note that we can be connected even without
-+ # _connected being set, e.g. if connect() first returned
-+ # EAGAIN.
-+ self.getpeername()
-+
-+ def read(self, len=0, buffer=None):
- """Read up to LEN bytes and return them.
- Return zero-length string on EOF."""
-
-+ self._checkClosed()
-+ if not self._sslobj:
-+ raise ValueError("Read on closed or unwrapped SSL socket.")
- try:
-- return self._sslobj.read(len)
-- except SSLError, x:
-+ if buffer is not None:
-+ v = self._sslobj.read(len, buffer)
-+ else:
-+ v = self._sslobj.read(len or 1024)
-+ return v
-+ except SSLError as x:
- if x.args[0] == SSL_ERROR_EOF and self.suppress_ragged_eofs:
-- return ''
-+ if buffer is not None:
-+ return 0
-+ else:
-+ return b''
- else:
- raise
-
- def write(self, data):
--
- """Write DATA to the underlying SSL channel. Returns
- number of bytes of DATA actually transmitted."""
-
-+ self._checkClosed()
-+ if not self._sslobj:
-+ raise ValueError("Write on closed or unwrapped SSL socket.")
- return self._sslobj.write(data)
-
- def getpeercert(self, binary_form=False):
--
- """Returns a formatted version of the data in the
- certificate provided by the other end of the SSL channel.
- Return None if no certificate was provided, {} if a
- certificate was provided, but not validated."""
-
-+ self._checkClosed()
-+ self._check_connected()
- return self._sslobj.peer_certificate(binary_form)
-
-- def cipher(self):
-+ def selected_npn_protocol(self):
-+ self._checkClosed()
-+ if not self._sslobj or not _ssl.HAS_NPN:
-+ return None
-+ else:
-+ return self._sslobj.selected_npn_protocol()
-
-+ def cipher(self):
-+ self._checkClosed()
- if not self._sslobj:
- return None
- else:
- return self._sslobj.cipher()
-
-+ def compression(self):
-+ self._checkClosed()
-+ if not self._sslobj:
-+ return None
-+ else:
-+ return self._sslobj.compression()
-+
- def send(self, data, flags=0):
-+ self._checkClosed()
- if self._sslobj:
- if flags != 0:
- raise ValueError(
- "non-zero flags not allowed in calls to send() on %s" %
- self.__class__)
-- while True:
-- try:
-- v = self._sslobj.write(data)
-- except SSLError, x:
-- if x.args[0] == SSL_ERROR_WANT_READ:
-- return 0
-- elif x.args[0] == SSL_ERROR_WANT_WRITE:
-- return 0
-- else:
-- raise
-+ try:
-+ v = self._sslobj.write(data)
-+ except SSLError as x:
-+ if x.args[0] == SSL_ERROR_WANT_READ:
-+ return 0
-+ elif x.args[0] == SSL_ERROR_WANT_WRITE:
-+ return 0
- else:
-- return v
-+ raise
-+ else:
-+ return v
- else:
- return self._sock.send(data, flags)
-
- def sendto(self, data, flags_or_addr, addr=None):
-+ self._checkClosed()
- if self._sslobj:
- raise ValueError("sendto not allowed on instances of %s" %
- self.__class__)
-@@ -222,7 +683,9 @@ class SSLSocket(socket):
- else:
- return self._sock.sendto(data, flags_or_addr, addr)
-
-+
- def sendall(self, data, flags=0):
-+ self._checkClosed()
- if self._sslobj:
- if flags != 0:
- raise ValueError(
-@@ -238,6 +701,7 @@ class SSLSocket(socket):
- return socket.sendall(self, data, flags)
-
- def recv(self, buflen=1024, flags=0):
-+ self._checkClosed()
- if self._sslobj:
- if flags != 0:
- raise ValueError(
-@@ -248,6 +712,7 @@ class SSLSocket(socket):
- return self._sock.recv(buflen, flags)
-
- def recv_into(self, buffer, nbytes=None, flags=0):
-+ self._checkClosed()
- if buffer and (nbytes is None):
- nbytes = len(buffer)
- elif nbytes is None:
-@@ -257,14 +722,12 @@ class SSLSocket(socket):
- raise ValueError(
- "non-zero flags not allowed in calls to recv_into() on %s"
%
- self.__class__)
-- tmp_buffer = self.read(nbytes)
-- v = len(tmp_buffer)
-- buffer[:v] = tmp_buffer
-- return v
-+ return self.read(nbytes, buffer)
- else:
- return self._sock.recv_into(buffer, nbytes, flags)
-
- def recvfrom(self, buflen=1024, flags=0):
-+ self._checkClosed()
- if self._sslobj:
- raise ValueError("recvfrom not allowed on instances of %s" %
- self.__class__)
-@@ -272,27 +735,23 @@ class SSLSocket(socket):
- return self._sock.recvfrom(buflen, flags)
-
- def recvfrom_into(self, buffer, nbytes=None, flags=0):
-+ self._checkClosed()
- if self._sslobj:
- raise ValueError("recvfrom_into not allowed on instances of %s" %
- self.__class__)
- else:
- return self._sock.recvfrom_into(buffer, nbytes, flags)
-
-+
- def pending(self):
-+ self._checkClosed()
- if self._sslobj:
- return self._sslobj.pending()
- else:
- return 0
-
-- def unwrap(self):
-- if self._sslobj:
-- s = self._sslobj.shutdown()
-- self._sslobj = None
-- return s
-- else:
-- raise ValueError("No SSL wrapper around " + str(self))
--
- def shutdown(self, how):
-+ self._checkClosed()
- self._sslobj = None
- socket.shutdown(self, how)
-
-@@ -303,32 +762,55 @@ class SSLSocket(socket):
- else:
- self._makefile_refs -= 1
-
-- def do_handshake(self):
--
-- """Perform a TLS/SSL handshake."""
-+ def unwrap(self):
-+ if self._sslobj:
-+ s = self._sslobj.shutdown()
-+ self._sslobj = None
-+ return s
-+ else:
-+ raise ValueError("No SSL wrapper around " + str(self))
-
-- self._sslobj.do_handshake()
-+ def _real_close(self):
-+ self._sslobj = None
-+ socket._real_close(self)
-
-- def _real_connect(self, addr, return_errno):
-+ def do_handshake(self, block=False):
-+ """Perform a TLS/SSL handshake."""
-+ self._check_connected()
-+ timeout = self.gettimeout()
-+ try:
-+ if timeout == 0.0 and block:
-+ self.settimeout(None)
-+ self._sslobj.do_handshake()
-+ finally:
-+ self.settimeout(timeout)
-+
-+ if self.context.check_hostname:
-+ if not self.server_hostname:
-+ raise ValueError("check_hostname needs server_hostname "
-+ "argument")
-+ match_hostname(self.getpeercert(), self.server_hostname)
-+
-+ def _real_connect(self, addr, connect_ex):
-+ if self.server_side:
-+ raise ValueError("can't connect in server-side mode")
- # Here we assume that the socket is client-side, and not
- # connected at the time of the call. We connect it, then wrap it.
- if self._connected:
- raise ValueError("attempt to connect already-connected
SSLSocket!")
-- self._sslobj = _ssl.sslwrap(self._sock, False, self.keyfile, self.certfile,
-- self.cert_reqs, self.ssl_version,
-- self.ca_certs, self.ciphers)
-+ self._sslobj = self.context._wrap_socket(self._sock, False,
self.server_hostname, ssl_sock=self)
- try:
-- if return_errno:
-+ if connect_ex:
- rc = socket.connect_ex(self, addr)
- else:
- rc = None
- socket.connect(self, addr)
- if not rc:
-+ self._connected = True
- if self.do_handshake_on_connect:
- self.do_handshake()
-- self._connected = True
- return rc
-- except socket_error:
-+ except (OSError, ValueError):
- self._sslobj = None
- raise
-
-@@ -343,27 +825,16 @@ class SSLSocket(socket):
- return self._real_connect(addr, True)
-
- def accept(self):
--
- """Accepts a new connection from a remote client, and returns
- a tuple containing that new connection wrapped with a server-side
- SSL channel, and the address of the remote client."""
-
- newsock, addr = socket.accept(self)
-- try:
-- return (SSLSocket(newsock,
-- keyfile=self.keyfile,
-- certfile=self.certfile,
-- server_side=True,
-- cert_reqs=self.cert_reqs,
-- ssl_version=self.ssl_version,
-- ca_certs=self.ca_certs,
-- ciphers=self.ciphers,
-- do_handshake_on_connect=self.do_handshake_on_connect,
-- suppress_ragged_eofs=self.suppress_ragged_eofs),
-- addr)
-- except socket_error as e:
-- newsock.close()
-- raise e
-+ newsock = self.context.wrap_socket(newsock,
-+ do_handshake_on_connect=self.do_handshake_on_connect,
-+ suppress_ragged_eofs=self.suppress_ragged_eofs,
-+ server_side=True)
-+ return newsock, addr
-
- def makefile(self, mode='r', bufsize=-1):
-
-@@ -376,54 +847,81 @@ class SSLSocket(socket):
- # the file-like object.
- return _fileobject(self, mode, bufsize, close=True)
-
-+ def get_channel_binding(self, cb_type="tls-unique"):
-+ """Get channel binding data for current connection. Raise
ValueError
-+ if the requested `cb_type` is not supported. Return bytes of the data
-+ or None if the data is not available (e.g. before the handshake).
-+ """
-+ if cb_type not in CHANNEL_BINDING_TYPES:
-+ raise ValueError("Unsupported channel binding type")
-+ if cb_type != "tls-unique":
-+ raise NotImplementedError(
-+ "{0} channel binding type not implemented"
-+ .format(cb_type))
-+ if self._sslobj is None:
-+ return None
-+ return self._sslobj.tls_unique_cb()
-
-
- def wrap_socket(sock, keyfile=None, certfile=None,
- server_side=False, cert_reqs=CERT_NONE,
- ssl_version=PROTOCOL_SSLv23, ca_certs=None,
- do_handshake_on_connect=True,
-- suppress_ragged_eofs=True, ciphers=None):
-+ suppress_ragged_eofs=True,
-+ ciphers=None):
-
-- return SSLSocket(sock, keyfile=keyfile, certfile=certfile,
-+ return SSLSocket(sock=sock, keyfile=keyfile, certfile=certfile,
- server_side=server_side, cert_reqs=cert_reqs,
- ssl_version=ssl_version, ca_certs=ca_certs,
- do_handshake_on_connect=do_handshake_on_connect,
- suppress_ragged_eofs=suppress_ragged_eofs,
- ciphers=ciphers)
-
--
- # some utility functions
-
- def cert_time_to_seconds(cert_time):
--
-- """Takes a date-time string in standard ASN1_print form
-- ("MON DAY 24HOUR:MINUTE:SEC YEAR TIMEZONE") and return
-- a Python time value in seconds past the epoch."""
--
-- import time
-- return time.mktime(time.strptime(cert_time, "%b %d %H:%M:%S %Y GMT"))
-+ """Return the time in seconds since the Epoch, given the timestring
-+ representing the "notBefore" or "notAfter" date from a
certificate
-+ in ``"%b %d %H:%M:%S %Y %Z"`` strptime format (C locale).
-+
-+ "notBefore" or "notAfter" dates must use UTC (RFC 5280).
-+
-+ Month is one of: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
-+ UTC should be specified as GMT (see ASN1_TIME_print())
-+ """
-+ from time import strptime
-+ from calendar import timegm
-+
-+ months = (
-+
"Jan","Feb","Mar","Apr","May","Jun",
-+
"Jul","Aug","Sep","Oct","Nov","Dec"
-+ )
-+ time_format = ' %d %H:%M:%S %Y GMT' # NOTE: no month, fixed GMT
-+ try:
-+ month_number = months.index(cert_time[:3].title()) + 1
-+ except ValueError:
-+ raise ValueError('time data %r does not match '
-+ 'format "%%b%s"' % (cert_time, time_format))
-+ else:
-+ # found valid month
-+ tt = strptime(cert_time[3:], time_format)
-+ # return an integer, the previous mktime()-based implementation
-+ # returned a float (fractional seconds are always zero here).
-+ return timegm((tt[0], month_number) + tt[2:6])
-
- PEM_HEADER = "-----BEGIN CERTIFICATE-----"
- PEM_FOOTER = "-----END CERTIFICATE-----"
-
- def DER_cert_to_PEM_cert(der_cert_bytes):
--
- """Takes a certificate in binary DER format and returns the
- PEM version of it as a string."""
-
-- if hasattr(base64, 'standard_b64encode'):
-- # preferred because older API gets line-length wrong
-- f = base64.standard_b64encode(der_cert_bytes)
-- return (PEM_HEADER + '\n' +
-- textwrap.fill(f, 64) + '\n' +
-- PEM_FOOTER + '\n')
-- else:
-- return (PEM_HEADER + '\n' +
-- base64.encodestring(der_cert_bytes) +
-- PEM_FOOTER + '\n')
-+ f = base64.standard_b64encode(der_cert_bytes).decode('ascii')
-+ return (PEM_HEADER + '\n' +
-+ textwrap.fill(f, 64) + '\n' +
-+ PEM_FOOTER + '\n')
-
- def PEM_cert_to_DER_cert(pem_cert_string):
--
- """Takes a certificate in ASCII PEM format and returns the
- DER-encoded version of it as a byte sequence"""
-
-@@ -434,25 +932,25 @@ def PEM_cert_to_DER_cert(pem_cert_string):
- raise ValueError("Invalid PEM encoding; must end with %s"
- % PEM_FOOTER)
- d = pem_cert_string.strip()[len(PEM_HEADER):-len(PEM_FOOTER)]
-- return base64.decodestring(d)
--
--def get_server_certificate(addr, ssl_version=PROTOCOL_SSLv3, ca_certs=None):
-+ return base64.decodestring(d.encode('ASCII', 'strict'))
-
-+def get_server_certificate(addr, ssl_version=PROTOCOL_SSLv23, ca_certs=None):
- """Retrieve the certificate from the server at the specified
address,
- and return it as a PEM-encoded string.
- If 'ca_certs' is specified, validate the server cert against it.
- If 'ssl_version' is specified, use it in the connection
attempt."""
-
- host, port = addr
-- if (ca_certs is not None):
-+ if ca_certs is not None:
- cert_reqs = CERT_REQUIRED
- else:
- cert_reqs = CERT_NONE
-- s = wrap_socket(socket(), ssl_version=ssl_version,
-- cert_reqs=cert_reqs, ca_certs=ca_certs)
-- s.connect(addr)
-- dercert = s.getpeercert(True)
-- s.close()
-+ context = _create_stdlib_context(ssl_version,
-+ cert_reqs=cert_reqs,
-+ cafile=ca_certs)
-+ with closing(create_connection(addr)) as sock:
-+ with closing(context.wrap_socket(sock)) as sslsock:
-+ dercert = sslsock.getpeercert(True)
- return DER_cert_to_PEM_cert(dercert)
-
- def get_protocol_name(protocol_code):
-diff --git a/Lib/test/capath/4e1295a3.0 b/Lib/test/capath/4e1295a3.0
-new file mode 100644
-index 0000000..9d7ac23
---- /dev/null
-+++ b/Lib/test/capath/4e1295a3.0
-@@ -0,0 +1,14 @@
-+-----BEGIN CERTIFICATE-----
-+MIICLDCCAdYCAQAwDQYJKoZIhvcNAQEEBQAwgaAxCzAJBgNVBAYTAlBUMRMwEQYD
-+VQQIEwpRdWVlbnNsYW5kMQ8wDQYDVQQHEwZMaXNib2ExFzAVBgNVBAoTDk5ldXJv
-+bmlvLCBMZGEuMRgwFgYDVQQLEw9EZXNlbnZvbHZpbWVudG8xGzAZBgNVBAMTEmJy
-+dXR1cy5uZXVyb25pby5wdDEbMBkGCSqGSIb3DQEJARYMc2FtcG9AaWtpLmZpMB4X
-+DTk2MDkwNTAzNDI0M1oXDTk2MTAwNTAzNDI0M1owgaAxCzAJBgNVBAYTAlBUMRMw
-+EQYDVQQIEwpRdWVlbnNsYW5kMQ8wDQYDVQQHEwZMaXNib2ExFzAVBgNVBAoTDk5l
-+dXJvbmlvLCBMZGEuMRgwFgYDVQQLEw9EZXNlbnZvbHZpbWVudG8xGzAZBgNVBAMT
-+EmJydXR1cy5uZXVyb25pby5wdDEbMBkGCSqGSIb3DQEJARYMc2FtcG9AaWtpLmZp
-+MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAL7+aty3S1iBA/+yxjxv4q1MUTd1kjNw
-+L4lYKbpzzlmC5beaQXeQ2RmGMTXU+mDvuqItjVHOK3DvPK7lTcSGftUCAwEAATAN
-+BgkqhkiG9w0BAQQFAANBAFqPEKFjk6T6CKTHvaQeEAsX0/8YHPHqH/9AnhSjrwuX
-+9EBc0n6bVGhN7XaXd6sJ7dym9sbsWxb+pJdurnkxjx4=
-+-----END CERTIFICATE-----
-diff --git a/Lib/test/capath/5ed36f99.0 b/Lib/test/capath/5ed36f99.0
-new file mode 100644
-index 0000000..e7dfc82
---- /dev/null
-+++ b/Lib/test/capath/5ed36f99.0
-@@ -0,0 +1,41 @@
-+-----BEGIN CERTIFICATE-----
-+MIIHPTCCBSWgAwIBAgIBADANBgkqhkiG9w0BAQQFADB5MRAwDgYDVQQKEwdSb290
-+IENBMR4wHAYDVQQLExVodHRwOi8vd3d3LmNhY2VydC5vcmcxIjAgBgNVBAMTGUNB
-+IENlcnQgU2lnbmluZyBBdXRob3JpdHkxITAfBgkqhkiG9w0BCQEWEnN1cHBvcnRA
-+Y2FjZXJ0Lm9yZzAeFw0wMzAzMzAxMjI5NDlaFw0zMzAzMjkxMjI5NDlaMHkxEDAO
-+BgNVBAoTB1Jvb3QgQ0ExHjAcBgNVBAsTFWh0dHA6Ly93d3cuY2FjZXJ0Lm9yZzEi
-+MCAGA1UEAxMZQ0EgQ2VydCBTaWduaW5nIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJ
-+ARYSc3VwcG9ydEBjYWNlcnQub3JnMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC
-+CgKCAgEAziLA4kZ97DYoB1CW8qAzQIxL8TtmPzHlawI229Z89vGIj053NgVBlfkJ
-+8BLPRoZzYLdufujAWGSuzbCtRRcMY/pnCujW0r8+55jE8Ez64AO7NV1sId6eINm6
-+zWYyN3L69wj1x81YyY7nDl7qPv4coRQKFWyGhFtkZip6qUtTefWIonvuLwphK42y
-+fk1WpRPs6tqSnqxEQR5YYGUFZvjARL3LlPdCfgv3ZWiYUQXw8wWRBB0bF4LsyFe7
-+w2t6iPGwcswlWyCR7BYCEo8y6RcYSNDHBS4CMEK4JZwFaz+qOqfrU0j36NK2B5jc
-+G8Y0f3/JHIJ6BVgrCFvzOKKrF11myZjXnhCLotLddJr3cQxyYN/Nb5gznZY0dj4k
-+epKwDpUeb+agRThHqtdB7Uq3EvbXG4OKDy7YCbZZ16oE/9KTfWgu3YtLq1i6L43q
-+laegw1SJpfvbi1EinbLDvhG+LJGGi5Z4rSDTii8aP8bQUWWHIbEZAWV/RRyH9XzQ
-+QUxPKZgh/TMfdQwEUfoZd9vUFBzugcMd9Zi3aQaRIt0AUMyBMawSB3s42mhb5ivU
-+fslfrejrckzzAeVLIL+aplfKkQABi6F1ITe1Yw1nPkZPcCBnzsXWWdsC4PDSy826
-+YreQQejdIOQpvGQpQsgi3Hia/0PsmBsJUUtaWsJx8cTLc6nloQsCAwEAAaOCAc4w
-+ggHKMB0GA1UdDgQWBBQWtTIb1Mfz4OaO873SsDrusjkY0TCBowYDVR0jBIGbMIGY
-+gBQWtTIb1Mfz4OaO873SsDrusjkY0aF9pHsweTEQMA4GA1UEChMHUm9vdCBDQTEe
-+MBwGA1UECxMVaHR0cDovL3d3dy5jYWNlcnQub3JnMSIwIAYDVQQDExlDQSBDZXJ0
-+IFNpZ25pbmcgQXV0aG9yaXR5MSEwHwYJKoZIhvcNAQkBFhJzdXBwb3J0QGNhY2Vy
-+dC5vcmeCAQAwDwYDVR0TAQH/BAUwAwEB/zAyBgNVHR8EKzApMCegJaAjhiFodHRw
-+czovL3d3dy5jYWNlcnQub3JnL3Jldm9rZS5jcmwwMAYJYIZIAYb4QgEEBCMWIWh0
-+dHBzOi8vd3d3LmNhY2VydC5vcmcvcmV2b2tlLmNybDA0BglghkgBhvhCAQgEJxYl
-+aHR0cDovL3d3dy5jYWNlcnQub3JnL2luZGV4LnBocD9pZD0xMDBWBglghkgBhvhC
-+AQ0ESRZHVG8gZ2V0IHlvdXIgb3duIGNlcnRpZmljYXRlIGZvciBGUkVFIGhlYWQg
-+b3ZlciB0byBodHRwOi8vd3d3LmNhY2VydC5vcmcwDQYJKoZIhvcNAQEEBQADggIB
-+ACjH7pyCArpcgBLKNQodgW+JapnM8mgPf6fhjViVPr3yBsOQWqy1YPaZQwGjiHCc
-+nWKdpIevZ1gNMDY75q1I08t0AoZxPuIrA2jxNGJARjtT6ij0rPtmlVOKTV39O9lg
-+18p5aTuxZZKmxoGCXJzN600BiqXfEVWqFcofN8CCmHBh22p8lqOOLlQ+TyGpkO/c
-+gr/c6EWtTZBzCDyUZbAEmXZ/4rzCahWqlwQ3JNgelE5tDlG+1sSPypZt90Pf6DBl
-+Jzt7u0NDY8RD97LsaMzhGY4i+5jhe1o+ATc7iwiwovOVThrLm82asduycPAtStvY
-+sONvRUgzEv/+PDIqVPfE94rwiCPCR/5kenHA0R6mY7AHfqQv0wGP3J8rtsYIqQ+T
-+SCX8Ev2fQtzzxD72V7DX3WnRBnc0CkvSyqD/HMaMyRa+xMwyN2hzXwj7UfdJUzYF
-+CpUCTPJ5GhD22Dp1nPMd8aINcGeGG7MW9S/lpOt5hvk9C8JzC6WZrG/8Z7jlLwum
-+GCSNe9FINSkYQKyTYOGWhlC0elnYjyELn8+CkcY7v2vcB5G5l1YjqrZslMZIBjzk
-+zk6q5PYvCdxTby78dOs6Y5nCpqyJvKeyRKANihDjbPIky/qbn3BHLt4Ui9SyIAmW
-+omTxJBzcoTWcFbLUvFUufQb1nA5V9FrWk9p2rSVzTMVD
-+-----END CERTIFICATE-----
-diff --git a/Lib/test/capath/6e88d7b8.0 b/Lib/test/capath/6e88d7b8.0
-new file mode 100644
-index 0000000..9d7ac23
---- /dev/null
-+++ b/Lib/test/capath/6e88d7b8.0
-@@ -0,0 +1,14 @@
-+-----BEGIN CERTIFICATE-----
-+MIICLDCCAdYCAQAwDQYJKoZIhvcNAQEEBQAwgaAxCzAJBgNVBAYTAlBUMRMwEQYD
-+VQQIEwpRdWVlbnNsYW5kMQ8wDQYDVQQHEwZMaXNib2ExFzAVBgNVBAoTDk5ldXJv
-+bmlvLCBMZGEuMRgwFgYDVQQLEw9EZXNlbnZvbHZpbWVudG8xGzAZBgNVBAMTEmJy
-+dXR1cy5uZXVyb25pby5wdDEbMBkGCSqGSIb3DQEJARYMc2FtcG9AaWtpLmZpMB4X
-+DTk2MDkwNTAzNDI0M1oXDTk2MTAwNTAzNDI0M1owgaAxCzAJBgNVBAYTAlBUMRMw
-+EQYDVQQIEwpRdWVlbnNsYW5kMQ8wDQYDVQQHEwZMaXNib2ExFzAVBgNVBAoTDk5l
-+dXJvbmlvLCBMZGEuMRgwFgYDVQQLEw9EZXNlbnZvbHZpbWVudG8xGzAZBgNVBAMT
-+EmJydXR1cy5uZXVyb25pby5wdDEbMBkGCSqGSIb3DQEJARYMc2FtcG9AaWtpLmZp
-+MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAL7+aty3S1iBA/+yxjxv4q1MUTd1kjNw
-+L4lYKbpzzlmC5beaQXeQ2RmGMTXU+mDvuqItjVHOK3DvPK7lTcSGftUCAwEAATAN
-+BgkqhkiG9w0BAQQFAANBAFqPEKFjk6T6CKTHvaQeEAsX0/8YHPHqH/9AnhSjrwuX
-+9EBc0n6bVGhN7XaXd6sJ7dym9sbsWxb+pJdurnkxjx4=
-+-----END CERTIFICATE-----
-diff --git a/Lib/test/capath/99d0fa06.0 b/Lib/test/capath/99d0fa06.0
-new file mode 100644
-index 0000000..e7dfc82
---- /dev/null
-+++ b/Lib/test/capath/99d0fa06.0
-@@ -0,0 +1,41 @@
-+-----BEGIN CERTIFICATE-----
-+MIIHPTCCBSWgAwIBAgIBADANBgkqhkiG9w0BAQQFADB5MRAwDgYDVQQKEwdSb290
-+IENBMR4wHAYDVQQLExVodHRwOi8vd3d3LmNhY2VydC5vcmcxIjAgBgNVBAMTGUNB
-+IENlcnQgU2lnbmluZyBBdXRob3JpdHkxITAfBgkqhkiG9w0BCQEWEnN1cHBvcnRA
-+Y2FjZXJ0Lm9yZzAeFw0wMzAzMzAxMjI5NDlaFw0zMzAzMjkxMjI5NDlaMHkxEDAO
-+BgNVBAoTB1Jvb3QgQ0ExHjAcBgNVBAsTFWh0dHA6Ly93d3cuY2FjZXJ0Lm9yZzEi
-+MCAGA1UEAxMZQ0EgQ2VydCBTaWduaW5nIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJ
-+ARYSc3VwcG9ydEBjYWNlcnQub3JnMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC
-+CgKCAgEAziLA4kZ97DYoB1CW8qAzQIxL8TtmPzHlawI229Z89vGIj053NgVBlfkJ
-+8BLPRoZzYLdufujAWGSuzbCtRRcMY/pnCujW0r8+55jE8Ez64AO7NV1sId6eINm6
-+zWYyN3L69wj1x81YyY7nDl7qPv4coRQKFWyGhFtkZip6qUtTefWIonvuLwphK42y
-+fk1WpRPs6tqSnqxEQR5YYGUFZvjARL3LlPdCfgv3ZWiYUQXw8wWRBB0bF4LsyFe7
-+w2t6iPGwcswlWyCR7BYCEo8y6RcYSNDHBS4CMEK4JZwFaz+qOqfrU0j36NK2B5jc
-+G8Y0f3/JHIJ6BVgrCFvzOKKrF11myZjXnhCLotLddJr3cQxyYN/Nb5gznZY0dj4k
-+epKwDpUeb+agRThHqtdB7Uq3EvbXG4OKDy7YCbZZ16oE/9KTfWgu3YtLq1i6L43q
-+laegw1SJpfvbi1EinbLDvhG+LJGGi5Z4rSDTii8aP8bQUWWHIbEZAWV/RRyH9XzQ
-+QUxPKZgh/TMfdQwEUfoZd9vUFBzugcMd9Zi3aQaRIt0AUMyBMawSB3s42mhb5ivU
-+fslfrejrckzzAeVLIL+aplfKkQABi6F1ITe1Yw1nPkZPcCBnzsXWWdsC4PDSy826
-+YreQQejdIOQpvGQpQsgi3Hia/0PsmBsJUUtaWsJx8cTLc6nloQsCAwEAAaOCAc4w
-+ggHKMB0GA1UdDgQWBBQWtTIb1Mfz4OaO873SsDrusjkY0TCBowYDVR0jBIGbMIGY
-+gBQWtTIb1Mfz4OaO873SsDrusjkY0aF9pHsweTEQMA4GA1UEChMHUm9vdCBDQTEe
-+MBwGA1UECxMVaHR0cDovL3d3dy5jYWNlcnQub3JnMSIwIAYDVQQDExlDQSBDZXJ0
-+IFNpZ25pbmcgQXV0aG9yaXR5MSEwHwYJKoZIhvcNAQkBFhJzdXBwb3J0QGNhY2Vy
-+dC5vcmeCAQAwDwYDVR0TAQH/BAUwAwEB/zAyBgNVHR8EKzApMCegJaAjhiFodHRw
-+czovL3d3dy5jYWNlcnQub3JnL3Jldm9rZS5jcmwwMAYJYIZIAYb4QgEEBCMWIWh0
-+dHBzOi8vd3d3LmNhY2VydC5vcmcvcmV2b2tlLmNybDA0BglghkgBhvhCAQgEJxYl
-+aHR0cDovL3d3dy5jYWNlcnQub3JnL2luZGV4LnBocD9pZD0xMDBWBglghkgBhvhC
-+AQ0ESRZHVG8gZ2V0IHlvdXIgb3duIGNlcnRpZmljYXRlIGZvciBGUkVFIGhlYWQg
-+b3ZlciB0byBodHRwOi8vd3d3LmNhY2VydC5vcmcwDQYJKoZIhvcNAQEEBQADggIB
-+ACjH7pyCArpcgBLKNQodgW+JapnM8mgPf6fhjViVPr3yBsOQWqy1YPaZQwGjiHCc
-+nWKdpIevZ1gNMDY75q1I08t0AoZxPuIrA2jxNGJARjtT6ij0rPtmlVOKTV39O9lg
-+18p5aTuxZZKmxoGCXJzN600BiqXfEVWqFcofN8CCmHBh22p8lqOOLlQ+TyGpkO/c
-+gr/c6EWtTZBzCDyUZbAEmXZ/4rzCahWqlwQ3JNgelE5tDlG+1sSPypZt90Pf6DBl
-+Jzt7u0NDY8RD97LsaMzhGY4i+5jhe1o+ATc7iwiwovOVThrLm82asduycPAtStvY
-+sONvRUgzEv/+PDIqVPfE94rwiCPCR/5kenHA0R6mY7AHfqQv0wGP3J8rtsYIqQ+T
-+SCX8Ev2fQtzzxD72V7DX3WnRBnc0CkvSyqD/HMaMyRa+xMwyN2hzXwj7UfdJUzYF
-+CpUCTPJ5GhD22Dp1nPMd8aINcGeGG7MW9S/lpOt5hvk9C8JzC6WZrG/8Z7jlLwum
-+GCSNe9FINSkYQKyTYOGWhlC0elnYjyELn8+CkcY7v2vcB5G5l1YjqrZslMZIBjzk
-+zk6q5PYvCdxTby78dOs6Y5nCpqyJvKeyRKANihDjbPIky/qbn3BHLt4Ui9SyIAmW
-+omTxJBzcoTWcFbLUvFUufQb1nA5V9FrWk9p2rSVzTMVD
-+-----END CERTIFICATE-----
-diff --git a/Lib/test/dh512.pem b/Lib/test/dh512.pem
-new file mode 100644
-index 0000000..200d16c
---- /dev/null
-+++ b/Lib/test/dh512.pem
-@@ -0,0 +1,9 @@
-+-----BEGIN DH PARAMETERS-----
-+MEYCQQD1Kv884bEpQBgRjXyEpwpy1obEAxnIByl6ypUM2Zafq9AKUJsCRtMIPWak
-+XUGfnHy9iUsiGSa6q6Jew1XpKgVfAgEC
-+-----END DH PARAMETERS-----
-+
-+These are the 512 bit DH parameters from "Assigned Number for SKIP Protocols"
-+(http://www.skip-vpn.org/spec/numbers.html).
-+See there for how they were generated.
-+Note that g is not a generator, but this is not a problem since p is a safe prime.
-diff --git a/Lib/test/keycert.passwd.pem b/Lib/test/keycert.passwd.pem
-new file mode 100644
-index 0000000..e905748
---- /dev/null
-+++ b/Lib/test/keycert.passwd.pem
-@@ -0,0 +1,33 @@
-+-----BEGIN RSA PRIVATE KEY-----
-+Proc-Type: 4,ENCRYPTED
-+DEK-Info: DES-EDE3-CBC,1A8D9D2A02EC698A
-+
-+kJYbfZ8L0sfe9Oty3gw0aloNnY5E8fegRfQLZlNoxTl6jNt0nIwI8kDJ36CZgR9c
-+u3FDJm/KqrfUoz8vW+qEnWhSG7QPX2wWGPHd4K94Yz/FgrRzZ0DoK7XxXq9gOtVA
-+AVGQhnz32p+6WhfGsCr9ArXEwRZrTk/FvzEPaU5fHcoSkrNVAGX8IpSVkSDwEDQr
-+Gv17+cfk99UV1OCza6yKHoFkTtrC+PZU71LomBabivS2Oc4B9hYuSR2hF01wTHP+
-+YlWNagZOOVtNz4oKK9x9eNQpmfQXQvPPTfusexKIbKfZrMvJoxcm1gfcZ0H/wK6P
-+6wmXSG35qMOOztCZNtperjs1wzEBXznyK8QmLcAJBjkfarABJX9vBEzZV0OUKhy+
-+noORFwHTllphbmydLhu6ehLUZMHPhzAS5UN7srtpSN81eerDMy0RMUAwA7/PofX1
-+94Me85Q8jP0PC9ETdsJcPqLzAPETEYu0ELewKRcrdyWi+tlLFrpE5KT/s5ecbl9l
-+7B61U4Kfd1PIXc/siINhU3A3bYK+845YyUArUOnKf1kEox7p1RpD7yFqVT04lRTo
-+cibNKATBusXSuBrp2G6GNuhWEOSafWCKJQAzgCYIp6ZTV2khhMUGppc/2H3CF6cO
-+zX0KtlPVZC7hLkB6HT8SxYUwF1zqWY7+/XPPdc37MeEZ87Q3UuZwqORLY+Z0hpgt
-+L5JXBCoklZhCAaN2GqwFLXtGiRSRFGY7xXIhbDTlE65Wv1WGGgDLMKGE1gOz3yAo
-+2jjG1+yAHJUdE69XTFHSqSkvaloA1W03LdMXZ9VuQJ/ySXCie6ABAQ==
-+-----END RSA PRIVATE KEY-----
-+-----BEGIN CERTIFICATE-----
-+MIICVDCCAb2gAwIBAgIJANfHOBkZr8JOMA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV
-+BAYTAlhZMRcwFQYDVQQHEw5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9u
-+IFNvZnR3YXJlIEZvdW5kYXRpb24xEjAQBgNVBAMTCWxvY2FsaG9zdDAeFw0xMDEw
-+MDgyMzAxNTZaFw0yMDEwMDUyMzAxNTZaMF8xCzAJBgNVBAYTAlhZMRcwFQYDVQQH
-+Ew5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9uIFNvZnR3YXJlIEZvdW5k
-+YXRpb24xEjAQBgNVBAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAw
-+gYkCgYEA21vT5isq7F68amYuuNpSFlKDPrMUCa4YWYqZRt2OZ+/3NKaZ2xAiSwr7
-+6MrQF70t5nLbSPpqE5+5VrS58SY+g/sXLiFd6AplH1wJZwh78DofbFYXUggktFMt
-+pTyiX8jtP66bkcPkDADA089RI1TQR6Ca+n7HFa7c1fabVV6i3zkCAwEAAaMYMBYw
-+FAYDVR0RBA0wC4IJbG9jYWxob3N0MA0GCSqGSIb3DQEBBQUAA4GBAHPctQBEQ4wd
-+BJ6+JcpIraopLn8BGhbjNWj40mmRqWB/NAWF6M5ne7KpGAu7tLeG4hb1zLaldK8G
-+lxy2GPSRF6LFS48dpEj2HbMv2nvv6xxalDMJ9+DicWgAKTQ6bcX2j3GUkCR0g/T1
-+CRlNBAAlvhKzO7Clpf9l0YKBEfraJByX
-+-----END CERTIFICATE-----
-diff --git a/Lib/test/keycert3.pem b/Lib/test/keycert3.pem
-new file mode 100644
-index 0000000..5bfa62c
---- /dev/null
-+++ b/Lib/test/keycert3.pem
-@@ -0,0 +1,73 @@
-+-----BEGIN PRIVATE KEY-----
-+MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAMLgD0kAKDb5cFyP
-+jbwNfR5CtewdXC+kMXAWD8DLxiTTvhMW7qVnlwOm36mZlszHKvsRf05lT4pegiFM
-+9z2j1OlaN+ci/X7NU22TNN6crYSiN77FjYJP464j876ndSxyD+rzys386T+1r1aZ
-+aggEdkj1TsSsv1zWIYKlPIjlvhuxAgMBAAECgYA0aH+T2Vf3WOPv8KdkcJg6gCRe
-+yJKXOWgWRcicx/CUzOEsTxmFIDPLxqAWA3k7v0B+3vjGw5Y9lycV/5XqXNoQI14j
-+y09iNsumds13u5AKkGdTJnZhQ7UKdoVHfuP44ZdOv/rJ5/VD6F4zWywpe90pcbK+
-+AWDVtusgGQBSieEl1QJBAOyVrUG5l2yoUBtd2zr/kiGm/DYyXlIthQO/A3/LngDW
-+5/ydGxVsT7lAVOgCsoT+0L4efTh90PjzW8LPQrPBWVMCQQDS3h/FtYYd5lfz+FNL
-+9CEe1F1w9l8P749uNUD0g317zv1tatIqVCsQWHfVHNdVvfQ+vSFw38OORO00Xqs9
-+1GJrAkBkoXXEkxCZoy4PteheO/8IWWLGGr6L7di6MzFl1lIqwT6D8L9oaV2vynFT
-+DnKop0pa09Unhjyw57KMNmSE2SUJAkEArloTEzpgRmCq4IK2/NpCeGdHS5uqRlbh
-+1VIa/xGps7EWQl5Mn8swQDel/YP3WGHTjfx7pgSegQfkyaRtGpZ9OQJAa9Vumj8m
-+JAAtI0Bnga8hgQx7BhTQY4CadDxyiRGOGYhwUzYVCqkb2sbVRH9HnwUaJT7cWBY3
-+RnJdHOMXWem7/w==
-+-----END PRIVATE KEY-----
-+Certificate:
-+ Data:
-+ Version: 1 (0x0)
-+ Serial Number: 12723342612721443281 (0xb09264b1f2da21d1)
-+ Signature Algorithm: sha1WithRSAEncryption
-+ Issuer: C=XY, O=Python Software Foundation CA, CN=our-ca-server
-+ Validity
-+ Not Before: Jan 4 19:47:07 2013 GMT
-+ Not After : Nov 13 19:47:07 2022 GMT
-+ Subject: C=XY, L=Castle Anthrax, O=Python Software Foundation, CN=localhost
-+ Subject Public Key Info:
-+ Public Key Algorithm: rsaEncryption
-+ Public-Key: (1024 bit)
-+ Modulus:
-+ 00:c2:e0:0f:49:00:28:36:f9:70:5c:8f:8d:bc:0d:
-+ 7d:1e:42:b5:ec:1d:5c:2f:a4:31:70:16:0f:c0:cb:
-+ c6:24:d3:be:13:16:ee:a5:67:97:03:a6:df:a9:99:
-+ 96:cc:c7:2a:fb:11:7f:4e:65:4f:8a:5e:82:21:4c:
-+ f7:3d:a3:d4:e9:5a:37:e7:22:fd:7e:cd:53:6d:93:
-+ 34:de:9c:ad:84:a2:37:be:c5:8d:82:4f:e3:ae:23:
-+ f3:be:a7:75:2c:72:0f:ea:f3:ca:cd:fc:e9:3f:b5:
-+ af:56:99:6a:08:04:76:48:f5:4e:c4:ac:bf:5c:d6:
-+ 21:82:a5:3c:88:e5:be:1b:b1
-+ Exponent: 65537 (0x10001)
-+ Signature Algorithm: sha1WithRSAEncryption
-+ 2f:42:5f:a3:09:2c:fa:51:88:c7:37:7f:ea:0e:63:f0:a2:9a:
-+ e5:5a:e2:c8:20:f0:3f:60:bc:c8:0f:b6:c6:76:ce:db:83:93:
-+ f5:a3:33:67:01:8e:04:cd:00:9a:73:fd:f3:35:86:fa:d7:13:
-+ e2:46:c6:9d:c0:29:53:d4:a9:90:b8:77:4b:e6:83:76:e4:92:
-+ d6:9c:50:cf:43:d0:c6:01:77:61:9a:de:9b:70:f7:72:cd:59:
-+ 00:31:69:d9:b4:ca:06:9c:6d:c3:c7:80:8c:68:e6:b5:a2:f8:
-+ ef:1d:bb:16:9f:77:77:ef:87:62:22:9b:4d:69:a4:3a:1a:f1:
-+ 21:5e:8c:32:ac:92:fd:15:6b:18:c2:7f:15:0d:98:30:ca:75:
-+ 8f:1a:71:df:da:1d:b2:ef:9a:e8:2d:2e:02:fd:4a:3c:aa:96:
-+ 0b:06:5d:35:b3:3d:24:87:4b:e0:b0:58:60:2f:45:ac:2e:48:
-+ 8a:b0:99:10:65:27:ff:cc:b1:d8:fd:bd:26:6b:b9:0c:05:2a:
-+ f4:45:63:35:51:07:ed:83:85:fe:6f:69:cb:bb:40:a8:ae:b6:
-+ 3b:56:4a:2d:a4:ed:6d:11:2c:4d:ed:17:24:fd:47:bc:d3:41:
-+ a2:d3:06:fe:0c:90:d8:d8:94:26:c4:ff:cc:a1:d8:42:77:eb:
-+ fc:a9:94:71
-+-----BEGIN CERTIFICATE-----
-+MIICpDCCAYwCCQCwkmSx8toh0TANBgkqhkiG9w0BAQUFADBNMQswCQYDVQQGEwJY
-+WTEmMCQGA1UECgwdUHl0aG9uIFNvZnR3YXJlIEZvdW5kYXRpb24gQ0ExFjAUBgNV
-+BAMMDW91ci1jYS1zZXJ2ZXIwHhcNMTMwMTA0MTk0NzA3WhcNMjIxMTEzMTk0NzA3
-+WjBfMQswCQYDVQQGEwJYWTEXMBUGA1UEBxMOQ2FzdGxlIEFudGhyYXgxIzAhBgNV
-+BAoTGlB5dGhvbiBTb2Z0d2FyZSBGb3VuZGF0aW9uMRIwEAYDVQQDEwlsb2NhbGhv
-+c3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMLgD0kAKDb5cFyPjbwNfR5C
-+tewdXC+kMXAWD8DLxiTTvhMW7qVnlwOm36mZlszHKvsRf05lT4pegiFM9z2j1Ola
-+N+ci/X7NU22TNN6crYSiN77FjYJP464j876ndSxyD+rzys386T+1r1aZaggEdkj1
-+TsSsv1zWIYKlPIjlvhuxAgMBAAEwDQYJKoZIhvcNAQEFBQADggEBAC9CX6MJLPpR
-+iMc3f+oOY/CimuVa4sgg8D9gvMgPtsZ2ztuDk/WjM2cBjgTNAJpz/fM1hvrXE+JG
-+xp3AKVPUqZC4d0vmg3bkktacUM9D0MYBd2Ga3ptw93LNWQAxadm0ygacbcPHgIxo
-+5rWi+O8duxafd3fvh2Iim01ppDoa8SFejDKskv0VaxjCfxUNmDDKdY8acd/aHbLv
-+mugtLgL9SjyqlgsGXTWzPSSHS+CwWGAvRawuSIqwmRBlJ//Msdj9vSZruQwFKvRF
-+YzVRB+2Dhf5vacu7QKiutjtWSi2k7W0RLE3tFyT9R7zTQaLTBv4MkNjYlCbE/8yh
-+2EJ36/yplHE=
-+-----END CERTIFICATE-----
-diff --git a/Lib/test/keycert4.pem b/Lib/test/keycert4.pem
-new file mode 100644
-index 0000000..53355c8
---- /dev/null
-+++ b/Lib/test/keycert4.pem
-@@ -0,0 +1,73 @@
-+-----BEGIN PRIVATE KEY-----
-+MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAK5UQiMI5VkNs2Qv
-+L7gUaiDdFevNUXRjU4DHAe3ZzzYLZNE69h9gO9VCSS16tJ5fT5VEu0EZyGr0e3V2
-+NkX0ZoU0Hc/UaY4qx7LHmn5SYZpIxhJnkf7SyHJK1zUaGlU0/LxYqIuGCtF5dqx1
-+L2OQhEx1GM6RydHdgX69G64LXcY5AgMBAAECgYAhsRMfJkb9ERLMl/oG/5sLQu9L
-+pWDKt6+ZwdxzlZbggQ85CMYshjLKIod2DLL/sLf2x1PRXyRG131M1E3k8zkkz6de
-+R1uDrIN/x91iuYzfLQZGh8bMY7Yjd2eoroa6R/7DjpElGejLxOAaDWO0ST2IFQy9
-+myTGS2jSM97wcXfsSQJBANP3jelJoS5X6BRjTSneY21wcocxVuQh8pXpErALVNsT
-+drrFTeaBuZp7KvbtnIM5g2WRNvaxLZlAY/hXPJvi6ncCQQDSix1cebml6EmPlEZS
-+Mm8gwI2F9ufUunwJmBJcz826Do0ZNGByWDAM/JQZH4FX4GfAFNuj8PUb+GQfadkx
-+i1DPAkEA0lVsNHojvuDsIo8HGuzarNZQT2beWjJ1jdxh9t7HrTx7LIps6rb/fhOK
-+Zs0R6gVAJaEbcWAPZ2tFyECInAdnsQJAUjaeXXjuxFkjOFym5PvqpvhpivEx78Bu
-+JPTr3rAKXmfGMxxfuOa0xK1wSyshP6ZR/RBn/+lcXPKubhHQDOegwwJAJF1DBQnN
-++/tLmOPULtDwfP4Zixn+/8GmGOahFoRcu6VIGHmRilJTn6MOButw7Glv2YdeC6l/
-+e83Gq6ffLVfKNQ==
-+-----END PRIVATE KEY-----
-+Certificate:
-+ Data:
-+ Version: 1 (0x0)
-+ Serial Number: 12723342612721443282 (0xb09264b1f2da21d2)
-+ Signature Algorithm: sha1WithRSAEncryption
-+ Issuer: C=XY, O=Python Software Foundation CA, CN=our-ca-server
-+ Validity
-+ Not Before: Jan 4 19:47:07 2013 GMT
-+ Not After : Nov 13 19:47:07 2022 GMT
-+ Subject: C=XY, L=Castle Anthrax, O=Python Software Foundation, CN=fakehostname
-+ Subject Public Key Info:
-+ Public Key Algorithm: rsaEncryption
-+ Public-Key: (1024 bit)
-+ Modulus:
-+ 00:ae:54:42:23:08:e5:59:0d:b3:64:2f:2f:b8:14:
-+ 6a:20:dd:15:eb:cd:51:74:63:53:80:c7:01:ed:d9:
-+ cf:36:0b:64:d1:3a:f6:1f:60:3b:d5:42:49:2d:7a:
-+ b4:9e:5f:4f:95:44:bb:41:19:c8:6a:f4:7b:75:76:
-+ 36:45:f4:66:85:34:1d:cf:d4:69:8e:2a:c7:b2:c7:
-+ 9a:7e:52:61:9a:48:c6:12:67:91:fe:d2:c8:72:4a:
-+ d7:35:1a:1a:55:34:fc:bc:58:a8:8b:86:0a:d1:79:
-+ 76:ac:75:2f:63:90:84:4c:75:18:ce:91:c9:d1:dd:
-+ 81:7e:bd:1b:ae:0b:5d:c6:39
-+ Exponent: 65537 (0x10001)
-+ Signature Algorithm: sha1WithRSAEncryption
-+ ad:45:8a:8e:ef:c6:ef:04:41:5c:2c:4a:84:dc:02:76:0c:d0:
-+ 66:0f:f0:16:04:58:4d:fd:68:b7:b8:d3:a8:41:a5:5c:3c:6f:
-+ 65:3c:d1:f8:ce:43:35:e7:41:5f:53:3d:c9:2c:c3:7d:fc:56:
-+ 4a:fa:47:77:38:9d:bb:97:28:0a:3b:91:19:7f:bc:74:ae:15:
-+ 6b:bd:20:36:67:45:a5:1e:79:d7:75:e6:89:5c:6d:54:84:d1:
-+ 95:d7:a7:b4:33:3c:af:37:c4:79:8f:5e:75:dc:75:c2:18:fb:
-+ 61:6f:2d:dc:38:65:5b:ba:67:28:d0:88:d7:8d:b9:23:5a:8e:
-+ e8:c6:bb:db:ce:d5:b8:41:2a:ce:93:08:b6:95:ad:34:20:18:
-+ d5:3b:37:52:74:50:0b:07:2c:b0:6d:a4:4c:7b:f4:e0:fd:d1:
-+ af:17:aa:20:cd:62:e3:f0:9d:37:69:db:41:bd:d4:1c:fb:53:
-+ 20:da:88:9d:76:26:67:ce:01:90:a7:80:1d:a9:5b:39:73:68:
-+ 54:0a:d1:2a:03:1b:8f:3c:43:5d:5d:c4:51:f1:a7:e7:11:da:
-+ 31:2c:49:06:af:04:f4:b8:3c:99:c4:20:b9:06:36:a2:00:92:
-+ 61:1d:0c:6d:24:05:e2:82:e1:47:db:a0:5f:ba:b9:fb:ba:fa:
-+ 49:12:1e:ce
-+-----BEGIN CERTIFICATE-----
-+MIICpzCCAY8CCQCwkmSx8toh0jANBgkqhkiG9w0BAQUFADBNMQswCQYDVQQGEwJY
-+WTEmMCQGA1UECgwdUHl0aG9uIFNvZnR3YXJlIEZvdW5kYXRpb24gQ0ExFjAUBgNV
-+BAMMDW91ci1jYS1zZXJ2ZXIwHhcNMTMwMTA0MTk0NzA3WhcNMjIxMTEzMTk0NzA3
-+WjBiMQswCQYDVQQGEwJYWTEXMBUGA1UEBxMOQ2FzdGxlIEFudGhyYXgxIzAhBgNV
-+BAoTGlB5dGhvbiBTb2Z0d2FyZSBGb3VuZGF0aW9uMRUwEwYDVQQDEwxmYWtlaG9z
-+dG5hbWUwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAK5UQiMI5VkNs2QvL7gU
-+aiDdFevNUXRjU4DHAe3ZzzYLZNE69h9gO9VCSS16tJ5fT5VEu0EZyGr0e3V2NkX0
-+ZoU0Hc/UaY4qx7LHmn5SYZpIxhJnkf7SyHJK1zUaGlU0/LxYqIuGCtF5dqx1L2OQ
-+hEx1GM6RydHdgX69G64LXcY5AgMBAAEwDQYJKoZIhvcNAQEFBQADggEBAK1Fio7v
-+xu8EQVwsSoTcAnYM0GYP8BYEWE39aLe406hBpVw8b2U80fjOQzXnQV9TPcksw338
-+Vkr6R3c4nbuXKAo7kRl/vHSuFWu9IDZnRaUeedd15olcbVSE0ZXXp7QzPK83xHmP
-+XnXcdcIY+2FvLdw4ZVu6ZyjQiNeNuSNajujGu9vO1bhBKs6TCLaVrTQgGNU7N1J0
-+UAsHLLBtpEx79OD90a8XqiDNYuPwnTdp20G91Bz7UyDaiJ12JmfOAZCngB2pWzlz
-+aFQK0SoDG488Q11dxFHxp+cR2jEsSQavBPS4PJnEILkGNqIAkmEdDG0kBeKC4Ufb
-+oF+6ufu6+kkSHs4=
-+-----END CERTIFICATE-----
-diff --git a/Lib/test/make_ssl_certs.py b/Lib/test/make_ssl_certs.py
-new file mode 100644
-index 0000000..81d04f8
---- /dev/null
-+++ b/Lib/test/make_ssl_certs.py
-@@ -0,0 +1,176 @@
-+"""Make the custom certificate and private key files used by test_ssl
-+and friends."""
-+
-+import os
-+import shutil
-+import sys
-+import tempfile
-+from subprocess import *
-+
-+req_template = """
-+ [req]
-+ distinguished_name = req_distinguished_name
-+ x509_extensions = req_x509_extensions
-+ prompt = no
-+
-+ [req_distinguished_name]
-+ C = XY
-+ L = Castle Anthrax
-+ O = Python Software Foundation
-+ CN = {hostname}
-+
-+ [req_x509_extensions]
-+ subjectAltName = DNS:{hostname}
-+
-+ [ ca ]
-+ default_ca = CA_default
-+
-+ [ CA_default ]
-+ dir = cadir
-+ database = $dir/index.txt
-+ crlnumber = $dir/crl.txt
-+ default_md = sha1
-+ default_days = 3600
-+ default_crl_days = 3600
-+ certificate = pycacert.pem
-+ private_key = pycakey.pem
-+ serial = $dir/serial
-+ RANDFILE = $dir/.rand
-+
-+ policy = policy_match
-+
-+ [ policy_match ]
-+ countryName = match
-+ stateOrProvinceName = optional
-+ organizationName = match
-+ organizationalUnitName = optional
-+ commonName = supplied
-+ emailAddress = optional
-+
-+ [ policy_anything ]
-+ countryName = optional
-+ stateOrProvinceName = optional
-+ localityName = optional
-+ organizationName = optional
-+ organizationalUnitName = optional
-+ commonName = supplied
-+ emailAddress = optional
-+
-+
-+ [ v3_ca ]
-+
-+ subjectKeyIdentifier=hash
-+ authorityKeyIdentifier=keyid:always,issuer
-+ basicConstraints = CA:true
-+
-+ """
-+
-+here = os.path.abspath(os.path.dirname(__file__))
-+
-+def make_cert_key(hostname, sign=False):
-+ print("creating cert for " + hostname)
-+ tempnames = []
-+ for i in range(3):
-+ with tempfile.NamedTemporaryFile(delete=False) as f:
-+ tempnames.append(f.name)
-+ req_file, cert_file, key_file = tempnames
-+ try:
-+ with open(req_file, 'w') as f:
-+ f.write(req_template.format(hostname=hostname))
-+ args = ['req', '-new', '-days', '3650',
'-nodes',
-+ '-newkey', 'rsa:1024', '-keyout', key_file,
-+ '-config', req_file]
-+ if sign:
-+ with tempfile.NamedTemporaryFile(delete=False) as f:
-+ tempnames.append(f.name)
-+ reqfile = f.name
-+ args += ['-out', reqfile ]
-+
-+ else:
-+ args += ['-x509', '-out', cert_file ]
-+ check_call(['openssl'] + args)
-+
-+ if sign:
-+ args = ['ca', '-config', req_file, '-out',
cert_file, '-outdir', 'cadir',
-+ '-policy', 'policy_anything', '-batch',
'-infiles', reqfile ]
-+ check_call(['openssl'] + args)
-+
-+
-+ with open(cert_file, 'r') as f:
-+ cert = f.read()
-+ with open(key_file, 'r') as f:
-+ key = f.read()
-+ return cert, key
-+ finally:
-+ for name in tempnames:
-+ os.remove(name)
-+
-+TMP_CADIR = 'cadir'
-+
-+def unmake_ca():
-+ shutil.rmtree(TMP_CADIR)
-+
-+def make_ca():
-+ os.mkdir(TMP_CADIR)
-+ with open(os.path.join('cadir','index.txt'),'a+') as f:
-+ pass # empty file
-+ with open(os.path.join('cadir','crl.txt'),'a+') as f:
-+ f.write("00")
-+ with open(os.path.join('cadir','index.txt.attr'),'w+') as
f:
-+ f.write('unique_subject = no')
-+
-+ with tempfile.NamedTemporaryFile("w") as t:
-+ t.write(req_template.format(hostname='our-ca-server'))
-+ t.flush()
-+ with tempfile.NamedTemporaryFile() as f:
-+ args = ['req', '-new', '-days', '3650',
'-extensions', 'v3_ca', '-nodes',
-+ '-newkey', 'rsa:2048', '-keyout',
'pycakey.pem',
-+ '-out', f.name,
-+ '-subj', '/C=XY/L=Castle Anthrax/O=Python Software
Foundation CA/CN=our-ca-server']
-+ check_call(['openssl'] + args)
-+ args = ['ca', '-config', t.name, '-create_serial',
-+ '-out', 'pycacert.pem', '-batch',
'-outdir', TMP_CADIR,
-+ '-keyfile', 'pycakey.pem', '-days',
'3650',
-+ '-selfsign', '-extensions', 'v3_ca',
'-infiles', f.name ]
-+ check_call(['openssl'] + args)
-+ args = ['ca', '-config', t.name, '-gencrl',
'-out', 'revocation.crl']
-+ check_call(['openssl'] + args)
-+
-+if __name__ == '__main__':
-+ os.chdir(here)
-+ cert, key = make_cert_key('localhost')
-+ with open('ssl_cert.pem', 'w') as f:
-+ f.write(cert)
-+ with open('ssl_key.pem', 'w') as f:
-+ f.write(key)
-+ print("password protecting ssl_key.pem in ssl_key.passwd.pem")
-+
check_call(['openssl','rsa','-in','ssl_key.pem','-out','ssl_key.passwd.pem','-des3','-passout','pass:somepass'])
-+
check_call(['openssl','rsa','-in','ssl_key.pem','-out','keycert.passwd.pem','-des3','-passout','pass:somepass'])
-+
-+ with open('keycert.pem', 'w') as f:
-+ f.write(key)
-+ f.write(cert)
-+
-+ with open('keycert.passwd.pem', 'a+') as f:
-+ f.write(cert)
-+
-+ # For certificate matching tests
-+ make_ca()
-+ cert, key = make_cert_key('fakehostname')
-+ with open('keycert2.pem', 'w') as f:
-+ f.write(key)
-+ f.write(cert)
-+
-+ cert, key = make_cert_key('localhost', True)
-+ with open('keycert3.pem', 'w') as f:
-+ f.write(key)
-+ f.write(cert)
-+
-+ cert, key = make_cert_key('fakehostname', True)
-+ with open('keycert4.pem', 'w') as f:
-+ f.write(key)
-+ f.write(cert)
-+
-+ unmake_ca()
-+ print("\n\nPlease change the values in test_ssl.py, test_parse_cert function
related to notAfter,notBefore and serialNumber")
-+
check_call(['openssl','x509','-in','keycert.pem','-dates','-serial','-noout'])
-diff --git a/Lib/test/pycacert.pem b/Lib/test/pycacert.pem
-new file mode 100644
-index 0000000..09b1f3e
---- /dev/null
-+++ b/Lib/test/pycacert.pem
-@@ -0,0 +1,78 @@
-+Certificate:
-+ Data:
-+ Version: 3 (0x2)
-+ Serial Number: 12723342612721443280 (0xb09264b1f2da21d0)
-+ Signature Algorithm: sha1WithRSAEncryption
-+ Issuer: C=XY, O=Python Software Foundation CA, CN=our-ca-server
-+ Validity
-+ Not Before: Jan 4 19:47:07 2013 GMT
-+ Not After : Jan 2 19:47:07 2023 GMT
-+ Subject: C=XY, O=Python Software Foundation CA, CN=our-ca-server
-+ Subject Public Key Info:
-+ Public Key Algorithm: rsaEncryption
-+ Public-Key: (2048 bit)
-+ Modulus:
-+ 00:e7:de:e9:e3:0c:9f:00:b6:a1:fd:2b:5b:96:d2:
-+ 6f:cc:e0:be:86:b9:20:5e:ec:03:7a:55:ab:ea:a4:
-+ e9:f9:49:85:d2:66:d5:ed:c7:7a:ea:56:8e:2d:8f:
-+ e7:42:e2:62:28:a9:9f:d6:1b:8e:eb:b5:b4:9c:9f:
-+ 14:ab:df:e6:94:8b:76:1d:3e:6d:24:61:ed:0c:bf:
-+ 00:8a:61:0c:df:5c:c8:36:73:16:00:cd:47:ba:6d:
-+ a4:a4:74:88:83:23:0a:19:fc:09:a7:3c:4a:4b:d3:
-+ e7:1d:2d:e4:ea:4c:54:21:f3:26:db:89:37:18:d4:
-+ 02:bb:40:32:5f:a4:ff:2d:1c:f7:d4:bb:ec:8e:cf:
-+ 5c:82:ac:e6:7c:08:6c:48:85:61:07:7f:25:e0:5c:
-+ e0:bc:34:5f:e0:b9:04:47:75:c8:47:0b:8d:bc:d6:
-+ c8:68:5f:33:83:62:d2:20:44:35:b1:ad:81:1a:8a:
-+ cd:bc:35:b0:5c:8b:47:d6:18:e9:9c:18:97:cc:01:
-+ 3c:29:cc:e8:1e:e4:e4:c1:b8:de:e7:c2:11:18:87:
-+ 5a:93:34:d8:a6:25:f7:14:71:eb:e4:21:a2:d2:0f:
-+ 2e:2e:d4:62:00:35:d3:d6:ef:5c:60:4b:4c:a9:14:
-+ e2:dd:15:58:46:37:33:26:b7:e7:2e:5d:ed:42:e4:
-+ c5:4d
-+ Exponent: 65537 (0x10001)
-+ X509v3 extensions:
-+ X509v3 Subject Key Identifier:
-+ BC:DD:62:D9:76:DA:1B:D2:54:6B:CF:E0:66:9B:1E:1E:7B:56:0C:0B
-+ X509v3 Authority Key Identifier:
-+ keyid:BC:DD:62:D9:76:DA:1B:D2:54:6B:CF:E0:66:9B:1E:1E:7B:56:0C:0B
-+
-+ X509v3 Basic Constraints:
-+ CA:TRUE
-+ Signature Algorithm: sha1WithRSAEncryption
-+ 7d:0a:f5:cb:8d:d3:5d:bd:99:8e:f8:2b:0f:ba:eb:c2:d9:a6:
-+ 27:4f:2e:7b:2f:0e:64:d8:1c:35:50:4e:ee:fc:90:b9:8d:6d:
-+ a8:c5:c6:06:b0:af:f3:2d:bf:3b:b8:42:07:dd:18:7d:6d:95:
-+ 54:57:85:18:60:47:2f:eb:78:1b:f9:e8:17:fd:5a:0d:87:17:
-+ 28:ac:4c:6a:e6:bc:29:f4:f4:55:70:29:42:de:85:ea:ab:6c:
-+ 23:06:64:30:75:02:8e:53:bc:5e:01:33:37:cc:1e:cd:b8:a4:
-+ fd:ca:e4:5f:65:3b:83:1c:86:f1:55:02:a0:3a:8f:db:91:b7:
-+ 40:14:b4:e7:8d:d2:ee:73:ba:e3:e5:34:2d:bc:94:6f:4e:24:
-+ 06:f7:5f:8b:0e:a7:8e:6b:de:5e:75:f4:32:9a:50:b1:44:33:
-+ 9a:d0:05:e2:78:82:ff:db:da:8a:63:eb:a9:dd:d1:bf:a0:61:
-+ ad:e3:9e:8a:24:5d:62:0e:e7:4c:91:7f:ef:df:34:36:3b:2f:
-+ 5d:f5:84:b2:2f:c4:6d:93:96:1a:6f:30:28:f1:da:12:9a:64:
-+ b4:40:33:1d:bd:de:2b:53:a8:ea:be:d6:bc:4e:96:f5:44:fb:
-+ 32:18:ae:d5:1f:f6:69:af:b6:4e:7b:1d:58:ec:3b:a9:53:a3:
-+ 5e:58:c8:9e
-+-----BEGIN CERTIFICATE-----
-+MIIDbTCCAlWgAwIBAgIJALCSZLHy2iHQMA0GCSqGSIb3DQEBBQUAME0xCzAJBgNV
-+BAYTAlhZMSYwJAYDVQQKDB1QeXRob24gU29mdHdhcmUgRm91bmRhdGlvbiBDQTEW
-+MBQGA1UEAwwNb3VyLWNhLXNlcnZlcjAeFw0xMzAxMDQxOTQ3MDdaFw0yMzAxMDIx
-+OTQ3MDdaME0xCzAJBgNVBAYTAlhZMSYwJAYDVQQKDB1QeXRob24gU29mdHdhcmUg
-+Rm91bmRhdGlvbiBDQTEWMBQGA1UEAwwNb3VyLWNhLXNlcnZlcjCCASIwDQYJKoZI
-+hvcNAQEBBQADggEPADCCAQoCggEBAOfe6eMMnwC2of0rW5bSb8zgvoa5IF7sA3pV
-+q+qk6flJhdJm1e3HeupWji2P50LiYiipn9Ybjuu1tJyfFKvf5pSLdh0+bSRh7Qy/
-+AIphDN9cyDZzFgDNR7ptpKR0iIMjChn8Cac8SkvT5x0t5OpMVCHzJtuJNxjUArtA
-+Ml+k/y0c99S77I7PXIKs5nwIbEiFYQd/JeBc4Lw0X+C5BEd1yEcLjbzWyGhfM4Ni
-+0iBENbGtgRqKzbw1sFyLR9YY6ZwYl8wBPCnM6B7k5MG43ufCERiHWpM02KYl9xRx
-+6+QhotIPLi7UYgA109bvXGBLTKkU4t0VWEY3Mya35y5d7ULkxU0CAwEAAaNQME4w
-+HQYDVR0OBBYEFLzdYtl22hvSVGvP4GabHh57VgwLMB8GA1UdIwQYMBaAFLzdYtl2
-+2hvSVGvP4GabHh57VgwLMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEB
-+AH0K9cuN0129mY74Kw+668LZpidPLnsvDmTYHDVQTu78kLmNbajFxgawr/Mtvzu4
-+QgfdGH1tlVRXhRhgRy/reBv56Bf9Wg2HFyisTGrmvCn09FVwKULeheqrbCMGZDB1
-+Ao5TvF4BMzfMHs24pP3K5F9lO4MchvFVAqA6j9uRt0AUtOeN0u5zuuPlNC28lG9O
-+JAb3X4sOp45r3l519DKaULFEM5rQBeJ4gv/b2opj66nd0b+gYa3jnookXWIO50yR
-+f+/fNDY7L131hLIvxG2TlhpvMCjx2hKaZLRAMx293itTqOq+1rxOlvVE+zIYrtUf
-+9mmvtk57HVjsO6lTo15YyJ4=
-+-----END CERTIFICATE-----
-diff --git a/Lib/test/revocation.crl b/Lib/test/revocation.crl
-new file mode 100644
-index 0000000..6d89b08
---- /dev/null
-+++ b/Lib/test/revocation.crl
-@@ -0,0 +1,11 @@
-+-----BEGIN X509 CRL-----
-+MIIBpjCBjwIBATANBgkqhkiG9w0BAQUFADBNMQswCQYDVQQGEwJYWTEmMCQGA1UE
-+CgwdUHl0aG9uIFNvZnR3YXJlIEZvdW5kYXRpb24gQ0ExFjAUBgNVBAMMDW91ci1j
-+YS1zZXJ2ZXIXDTEzMTEyMTE3MDg0N1oXDTIzMDkzMDE3MDg0N1qgDjAMMAoGA1Ud
-+FAQDAgEAMA0GCSqGSIb3DQEBBQUAA4IBAQCNJXC2mVKauEeN3LlQ3ZtM5gkH3ExH
-++i4bmJjtJn497WwvvoIeUdrmVXgJQR93RtV37hZwN0SXMLlNmUZPH4rHhihayw4m
-+unCzVj/OhCCY7/TPjKuJ1O/0XhaLBpBVjQN7R/1ujoRKbSia/CD3vcn7Fqxzw7LK
-+fSRCKRGTj1CZiuxrphtFchwALXSiFDy9mr2ZKhImcyq1PydfgEzU78APpOkMQsIC
-+UNJ/cf3c9emzf+dUtcMEcejQ3mynBo4eIGg1EW42bz4q4hSjzQlKcBV0muw5qXhc
-+HOxH2iTFhQ7SrvVuK/dM14rYM4B5mSX3nRC1kNmXpS9j3wJDhuwmjHed
-+-----END X509 CRL-----
-diff --git a/Lib/test/sha256.pem b/Lib/test/sha256.pem
-index 9475576..d3db4b8 100644
---- a/Lib/test/sha256.pem
-+++ b/Lib/test/sha256.pem
-@@ -1,128 +1,128 @@
- # Certificate chain for
https://sha256.tbs-internet.com
-- 0 s:/C=FR/postalCode=14000/ST=Calvados/L=CAEN/street=22 rue de Bretagne/O=TBS
INTERNET/OU=0002 440443810/OU=Certificats TBS
X509/CN=ecom.tbs-x509.com
-- i:/C=FR/ST=Calvados/L=Caen/O=TBS INTERNET/OU=Terms and Conditions:
http://www.tbs-internet.com/CA/repository/OU=TBS INTERNET CA/CN=TBS X509 CA business
-+ 0 s:/C=FR/postalCode=14000/ST=Calvados/L=CAEN/street=22 rue de Bretagne/O=TBS
INTERNET/OU=0002 440443810/OU=sha-256
production/CN=sha256.tbs-internet.com
-+ i:/C=FR/ST=Calvados/L=Caen/O=TBS INTERNET/OU=Terms and Conditions:
http://www.tbs-internet.com/CA/repository/OU=TBS INTERNET CA/CN=TBS X509 CA SGC
- -----BEGIN CERTIFICATE-----
--MIIGTjCCBTagAwIBAgIQOh3d9dNDPq1cSdJmEiMpqDANBgkqhkiG9w0BAQUFADCB
--yTELMAkGA1UEBhMCRlIxETAPBgNVBAgTCENhbHZhZG9zMQ0wCwYDVQQHEwRDYWVu
--MRUwEwYDVQQKEwxUQlMgSU5URVJORVQxSDBGBgNVBAsTP1Rlcm1zIGFuZCBDb25k
--aXRpb25zOiBodHRwOi8vd3d3LnRicy1pbnRlcm5ldC5jb20vQ0EvcmVwb3NpdG9y
--eTEYMBYGA1UECxMPVEJTIElOVEVSTkVUIENBMR0wGwYDVQQDExRUQlMgWDUwOSBD
--QSBidXNpbmVzczAeFw0xMTAxMjUwMDAwMDBaFw0xMzAyMDUyMzU5NTlaMIHHMQsw
--CQYDVQQGEwJGUjEOMAwGA1UEERMFMTQwMDAxETAPBgNVBAgTCENhbHZhZG9zMQ0w
--CwYDVQQHEwRDQUVOMRswGQYDVQQJExIyMiBydWUgZGUgQnJldGFnbmUxFTATBgNV
--BAoTDFRCUyBJTlRFUk5FVDEXMBUGA1UECxMOMDAwMiA0NDA0NDM4MTAxHTAbBgNV
--BAsTFENlcnRpZmljYXRzIFRCUyBYNTA5MRowGAYDVQQDExFlY29tLnRicy14NTA5
--LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKRrlHUnJ++1lpcg
--jtYco7cdmRe+EEfTmwPfCdfV3G1QfsTSvY6FfMpm/83pqHfT+4ANwr18wD9ZrAEN
--G16mf9VdCGK12+TP7DmqeZyGIqlFFoahQnmb8EarvE43/1UeQ2CV9XmzwZvpqeli
--LfXsFonawrY3H6ZnMwS64St61Z+9gdyuZ/RbsoZBbT5KUjDEG844QRU4OT1IGeEI
--eY5NM5RNIh6ZNhVtqeeCxMS7afONkHQrOco73RdSTRck/Hj96Ofl3MHNHryr+AMK
--DGFk1kLCZGpPdXtkxXvaDeQoiYDlil26CWc+YK6xyDPMdsWvoG14ZLyCpzMXA7/7
--4YAQRH0CAwEAAaOCAjAwggIsMB8GA1UdIwQYMBaAFBoJBMz5CY+7HqDO1KQUf0vV
--I1jNMB0GA1UdDgQWBBQgOU8HsWzbmD4WZP5Wtdw7jca2WDAOBgNVHQ8BAf8EBAMC
--BaAwDAYDVR0TAQH/BAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIw
--TAYDVR0gBEUwQzBBBgsrBgEEAYDlNwIBATAyMDAGCCsGAQUFBwIBFiRodHRwczov
--L3d3dy50YnMtaW50ZXJuZXQuY29tL0NBL0NQUzEwdwYDVR0fBHAwbjA3oDWgM4Yx
--aHR0cDovL2NybC50YnMtaW50ZXJuZXQuY29tL1RCU1g1MDlDQWJ1c2luZXNzLmNy
--bDAzoDGgL4YtaHR0cDovL2NybC50YnMteDUwOS5jb20vVEJTWDUwOUNBYnVzaW5l
--c3MuY3JsMIGwBggrBgEFBQcBAQSBozCBoDA9BggrBgEFBQcwAoYxaHR0cDovL2Ny
--dC50YnMtaW50ZXJuZXQuY29tL1RCU1g1MDlDQWJ1c2luZXNzLmNydDA5BggrBgEF
--BQcwAoYtaHR0cDovL2NydC50YnMteDUwOS5jb20vVEJTWDUwOUNBYnVzaW5lc3Mu
--Y3J0MCQGCCsGAQUFBzABhhhodHRwOi8vb2NzcC50YnMteDUwOS5jb20wMwYDVR0R
--BCwwKoIRZWNvbS50YnMteDUwOS5jb22CFXd3dy5lY29tLnRicy14NTA5LmNvbTAN
--BgkqhkiG9w0BAQUFAAOCAQEArT4NHfbY87bGAw8lPV4DmHlmuDuVp/y7ltO3Ynse
--3Rz8RxW2AzuO0Oy2F0Cu4yWKtMyEyMXyHqWtae7ElRbdTu5w5GwVBLJHClCzC8S9
--SpgMMQTx3Rgn8vjkHuU9VZQlulZyiPK7yunjc7c310S9FRZ7XxOwf8Nnx4WnB+No
--WrfApzhhQl31w+RyrNxZe58hCfDDHmevRvwLjQ785ZoQXJDj2j3qAD4aI2yB8lB5
--oaE1jlCJzC7Kmz/Y9jzfmv/zAs1LQTm9ktevv4BTUFaGjv9jxnQ1xnS862ZiouLW
--zZYIlYPf4F6JjXGiIQgQRglILUfq3ftJd9/ok9W9ZF8h8w==
-+MIIGXDCCBUSgAwIBAgIRAKpVmHgg9nfCodAVwcP4siwwDQYJKoZIhvcNAQELBQAw
-+gcQxCzAJBgNVBAYTAkZSMREwDwYDVQQIEwhDYWx2YWRvczENMAsGA1UEBxMEQ2Fl
-+bjEVMBMGA1UEChMMVEJTIElOVEVSTkVUMUgwRgYDVQQLEz9UZXJtcyBhbmQgQ29u
-+ZGl0aW9uczogaHR0cDovL3d3dy50YnMtaW50ZXJuZXQuY29tL0NBL3JlcG9zaXRv
-+cnkxGDAWBgNVBAsTD1RCUyBJTlRFUk5FVCBDQTEYMBYGA1UEAxMPVEJTIFg1MDkg
-+Q0EgU0dDMB4XDTEyMDEwNDAwMDAwMFoXDTE0MDIxNzIzNTk1OVowgcsxCzAJBgNV
-+BAYTAkZSMQ4wDAYDVQQREwUxNDAwMDERMA8GA1UECBMIQ2FsdmFkb3MxDTALBgNV
-+BAcTBENBRU4xGzAZBgNVBAkTEjIyIHJ1ZSBkZSBCcmV0YWduZTEVMBMGA1UEChMM
-+VEJTIElOVEVSTkVUMRcwFQYDVQQLEw4wMDAyIDQ0MDQ0MzgxMDEbMBkGA1UECxMS
-+c2hhLTI1NiBwcm9kdWN0aW9uMSAwHgYDVQQDExdzaGEyNTYudGJzLWludGVybmV0
-+LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKQIX/zdJcyxty0m
-+PM1XQSoSSifueS3AVcgqMsaIKS/u+rYzsv4hQ/qA6vLn5m5/ewUcZDj7zdi6rBVf
-+PaVNXJ6YinLX0tkaW8TEjeVuZG5yksGZlhCt1CJ1Ho9XLiLaP4uJ7MCoNUntpJ+E
-+LfrOdgsIj91kPmwjDJeztVcQCvKzhjVJA/KxdInc0JvOATn7rpaSmQI5bvIjufgo
-+qVsTPwVFzuUYULXBk7KxRT7MiEqnd5HvviNh0285QC478zl3v0I0Fb5El4yD3p49
-+IthcRnxzMKc0UhU5ogi0SbONyBfm/mzONVfSxpM+MlyvZmJqrbuuLoEDzJD+t8PU
-+xSuzgbcCAwEAAaOCAj4wggI6MB8GA1UdIwQYMBaAFAdEdoWTKLx/bXjSCuv6TEvf
-+2YIfMB0GA1UdDgQWBBT/qTGYdaj+f61c2IRFL/B1eEsM8DAOBgNVHQ8BAf8EBAMC
-+BaAwDAYDVR0TAQH/BAIwADA0BgNVHSUELTArBggrBgEFBQcDAQYIKwYBBQUHAwIG
-+CisGAQQBgjcKAwMGCWCGSAGG+EIEATBLBgNVHSAERDBCMEAGCisGAQQB5TcCBAEw
-+MjAwBggrBgEFBQcCARYkaHR0cHM6Ly93d3cudGJzLWludGVybmV0LmNvbS9DQS9D
-+UFM0MG0GA1UdHwRmMGQwMqAwoC6GLGh0dHA6Ly9jcmwudGJzLWludGVybmV0LmNv
-+bS9UQlNYNTA5Q0FTR0MuY3JsMC6gLKAqhihodHRwOi8vY3JsLnRicy14NTA5LmNv
-+bS9UQlNYNTA5Q0FTR0MuY3JsMIGmBggrBgEFBQcBAQSBmTCBljA4BggrBgEFBQcw
-+AoYsaHR0cDovL2NydC50YnMtaW50ZXJuZXQuY29tL1RCU1g1MDlDQVNHQy5jcnQw
-+NAYIKwYBBQUHMAKGKGh0dHA6Ly9jcnQudGJzLXg1MDkuY29tL1RCU1g1MDlDQVNH
-+Qy5jcnQwJAYIKwYBBQUHMAGGGGh0dHA6Ly9vY3NwLnRicy14NTA5LmNvbTA/BgNV
-+HREEODA2ghdzaGEyNTYudGJzLWludGVybmV0LmNvbYIbd3d3LnNoYTI1Ni50YnMt
-+aW50ZXJuZXQuY29tMA0GCSqGSIb3DQEBCwUAA4IBAQA0pOuL8QvAa5yksTbGShzX
-+ABApagunUGoEydv4YJT1MXy9tTp7DrWaozZSlsqBxrYAXP1d9r2fuKbEniYHxaQ0
-+UYaf1VSIlDo1yuC8wE7wxbHDIpQ/E5KAyxiaJ8obtDhFstWAPAH+UoGXq0kj2teN
-+21sFQ5dXgA95nldvVFsFhrRUNB6xXAcaj0VZFhttI0ZfQZmQwEI/P+N9Jr40OGun
-+aa+Dn0TMeUH4U20YntfLbu2nDcJcYfyurm+8/0Tr4HznLnedXu9pCPYj0TaddrgT
-+XO0oFiyy7qGaY6+qKh71yD64Y3ycCJ/HR9Wm39mjZYc9ezYwT4noP6r7Lk8YO7/q
- -----END CERTIFICATE-----
-- 1 s:/C=FR/ST=Calvados/L=Caen/O=TBS INTERNET/OU=Terms and Conditions:
http://www.tbs-internet.com/CA/repository/OU=TBS INTERNET CA/CN=TBS X509 CA business
-+ 1 s:/C=FR/ST=Calvados/L=Caen/O=TBS INTERNET/OU=Terms and Conditions:
http://www.tbs-internet.com/CA/repository/OU=TBS INTERNET CA/CN=TBS X509 CA SGC
- i:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root
- -----BEGIN CERTIFICATE-----
--MIIFPzCCBCegAwIBAgIQDlBz/++iRSmLDeVRHT/hADANBgkqhkiG9w0BAQUFADBv
-+MIIFVjCCBD6gAwIBAgIQXpDZ0ETJMV02WTx3GTnhhTANBgkqhkiG9w0BAQUFADBv
- MQswCQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFk
- ZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBF
--eHRlcm5hbCBDQSBSb290MB4XDTA1MTIwMTAwMDAwMFoXDTE5MDcwOTE4MTkyMlow
--gckxCzAJBgNVBAYTAkZSMREwDwYDVQQIEwhDYWx2YWRvczENMAsGA1UEBxMEQ2Fl
-+eHRlcm5hbCBDQSBSb290MB4XDTA1MTIwMTAwMDAwMFoXDTE5MDYyNDE5MDYzMFow
-+gcQxCzAJBgNVBAYTAkZSMREwDwYDVQQIEwhDYWx2YWRvczENMAsGA1UEBxMEQ2Fl
- bjEVMBMGA1UEChMMVEJTIElOVEVSTkVUMUgwRgYDVQQLEz9UZXJtcyBhbmQgQ29u
- ZGl0aW9uczogaHR0cDovL3d3dy50YnMtaW50ZXJuZXQuY29tL0NBL3JlcG9zaXRv
--cnkxGDAWBgNVBAsTD1RCUyBJTlRFUk5FVCBDQTEdMBsGA1UEAxMUVEJTIFg1MDkg
--Q0EgYnVzaW5lc3MwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDB1PAU
--qudCcz3tmyGcf+u6EkZqonKKHrV4gZYbvVkIRojmmlhfi/jwvpHvo8bqSt/9Rj5S
--jhCDW0pcbI+IPPtD1Jy+CHNSfnMqVDy6CKQ3p5maTzCMG6ZT+XjnvcND5v+FtaiB
--xk1iCX6uvt0jeUtdZvYbyytsSDE6c3Y5//wRxOF8tM1JxibwO3pyER26jbbN2gQz
--m/EkdGjLdJ4svPk23WDAvQ6G0/z2LcAaJB+XLfqRwfQpHQvfKa1uTi8PivC8qtip
--rmNQMMPMjxSK2azX8cKjjTDJiUKaCb4VHlJDWKEsCFRpgJAoAuX8f7Yfs1M4esGo
--sWb3PGspK3O22uIlAgMBAAGjggF6MIIBdjAdBgNVHQ4EFgQUGgkEzPkJj7seoM7U
--pBR/S9UjWM0wDgYDVR0PAQH/BAQDAgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwGAYD
--VR0gBBEwDzANBgsrBgEEAYDlNwIBATB7BgNVHR8EdDByMDigNqA0hjJodHRwOi8v
--Y3JsLmNvbW9kb2NhLmNvbS9BZGRUcnVzdEV4dGVybmFsQ0FSb290LmNybDA2oDSg
--MoYwaHR0cDovL2NybC5jb21vZG8ubmV0L0FkZFRydXN0RXh0ZXJuYWxDQVJvb3Qu
--Y3JsMIGGBggrBgEFBQcBAQR6MHgwOwYIKwYBBQUHMAKGL2h0dHA6Ly9jcnQuY29t
--b2RvY2EuY29tL0FkZFRydXN0VVROU2VydmVyQ0EuY3J0MDkGCCsGAQUFBzAChi1o
--dHRwOi8vY3J0LmNvbW9kby5uZXQvQWRkVHJ1c3RVVE5TZXJ2ZXJDQS5jcnQwEQYJ
--YIZIAYb4QgEBBAQDAgIEMA0GCSqGSIb3DQEBBQUAA4IBAQA7mqrMgk/MrE6QnbNA
--h4nRCn2ti4bg4w2C3lB6bSvRPnYwuNw9Jb8vuKkNFzRDxNJXqVDZdfFW5CVQJuyd
--nfAx83+wk+spzvFaE1KhFYfN9G9pQfXUfvDRoIcJgPEKUXL1wRiOG+IjU3VVI8pg
--IgqHkr7ylln5i5zCiFAPuIJmYUSFg/gxH5xkCNcjJqqrHrHatJr6Qrrke93joupw
--oU1njfAcZtYp6fbiK6u2b1pJqwkVBE8RsfLnPhRj+SFbpvjv8Od7o/ieJhFIYQNU
--k2jX2u8qZnAiNw93LZW9lpYjtuvMXq8QQppENNja5b53q7UwI+lU7ZGjZ7quuESp
--J6/5
-+cnkxGDAWBgNVBAsTD1RCUyBJTlRFUk5FVCBDQTEYMBYGA1UEAxMPVEJTIFg1MDkg
-+Q0EgU0dDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsgOkO3f7wzN6
-+rOjg45tR5vjBfzK7qmV9IBxb/QW9EEXxG+E7FNhZqQLtwGBKoSsHTnQqV75wWMk0
-+9tinWvftBkSpj5sTi/8cbzJfUvTSVYh3Qxv6AVVjMMH/ruLjE6y+4PoaPs8WoYAQ
-+ts5R4Z1g8c/WnTepLst2x0/Wv7GmuoQi+gXvHU6YrBiu7XkeYhzc95QdviWSJRDk
-+owhb5K43qhcvjRmBfO/paGlCliDGZp8mHwrI21mwobWpVjTxZRwYO3bd4+TGcI4G
-+Ie5wmHwE8F7SK1tgSqbBacKjDa93j7txKkfz/Yd2n7TGqOXiHPsJpG655vrKtnXk
-+9vs1zoDeJQIDAQABo4IBljCCAZIwHQYDVR0OBBYEFAdEdoWTKLx/bXjSCuv6TEvf
-+2YIfMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEAMCAGA1UdJQQZ
-+MBcGCisGAQQBgjcKAwMGCWCGSAGG+EIEATAYBgNVHSAEETAPMA0GCysGAQQBgOU3
-+AgQBMHsGA1UdHwR0MHIwOKA2oDSGMmh0dHA6Ly9jcmwuY29tb2RvY2EuY29tL0Fk
-+ZFRydXN0RXh0ZXJuYWxDQVJvb3QuY3JsMDagNKAyhjBodHRwOi8vY3JsLmNvbW9k
-+by5uZXQvQWRkVHJ1c3RFeHRlcm5hbENBUm9vdC5jcmwwgYAGCCsGAQUFBwEBBHQw
-+cjA4BggrBgEFBQcwAoYsaHR0cDovL2NydC5jb21vZG9jYS5jb20vQWRkVHJ1c3RV
-+VE5TR0NDQS5jcnQwNgYIKwYBBQUHMAKGKmh0dHA6Ly9jcnQuY29tb2RvLm5ldC9B
-+ZGRUcnVzdFVUTlNHQ0NBLmNydDARBglghkgBhvhCAQEEBAMCAgQwDQYJKoZIhvcN
-+AQEFBQADggEBAK2zEzs+jcIrVK9oDkdDZNvhuBYTdCfpxfFs+OAujW0bIfJAy232
-+euVsnJm6u/+OrqKudD2tad2BbejLLXhMZViaCmK7D9nrXHx4te5EP8rL19SUVqLY
-+1pTnv5dhNgEgvA7n5lIzDSYs7yRLsr7HJsYPr6SeYSuZizyX1SNz7ooJ32/F3X98
-+RB0Mlc/E0OyOrkQ9/y5IrnpnaSora8CnUrV5XNOg+kyCz9edCyx4D5wXYcwZPVWz
-+8aDqquESrezPyjtfi4WRO4s/VD3HLZvOxzMrWAVYCDG9FxaOhF0QGuuG1F7F3GKV
-+v6prNyCl016kRl2j1UT+a7gLd8fA25A4C9E=
- -----END CERTIFICATE-----
- 2 s:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root
-- i:/C=US/ST=UT/L=Salt Lake City/O=The USERTRUST
Network/OU=http://www.usertrust.com/CN=UTN-USERFirst-Hardware
-+ i:/C=US/ST=UT/L=Salt Lake City/O=The USERTRUST
Network/OU=http://www.usertrust.com/CN=UTN - DATACorp SGC
- -----BEGIN CERTIFICATE-----
--MIIETzCCAzegAwIBAgIQHM5EYpUZep1jUvnyI6m2mDANBgkqhkiG9w0BAQUFADCB
--lzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug
-+MIIEZjCCA06gAwIBAgIQUSYKkxzif5zDpV954HKugjANBgkqhkiG9w0BAQUFADCB
-+kzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug
- Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho
--dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3Qt
--SGFyZHdhcmUwHhcNMDUwNjA3MDgwOTEwWhcNMTkwNzA5MTgxOTIyWjBvMQswCQYD
--VQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0
--IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5h
--bCBDQSBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAt/caM+by
--AAQtOeBOW+0fvGwPzbX6I7bO3psRM5ekKUx9k5+9SryT7QMa44/P5W1QWtaXKZRa
--gLBJetsulf24yr83OC0ePpFBrXBWx/BPP+gynnTKyJBU6cZfD3idmkA8Dqxhql4U
--j56HoWpQ3NeaTq8Fs6ZxlJxxs1BgCscTnTgHhgKo6ahpJhiQq0ywTyOrOk+E2N/O
--n+Fpb7vXQtdrROTHre5tQV9yWnEIN7N5ZaRZoJQ39wAvDcKSctrQOHLbFKhFxF0q
--fbe01sTurM0TRLfJK91DACX6YblpalgjEbenM49WdVn1zSnXRrcKK2W200JvFbK4
--e/vv6V1T1TRaJwIDAQABo4G9MIG6MB8GA1UdIwQYMBaAFKFyXyYbKJhDlV0HN9WF
--lp1L0sNFMB0GA1UdDgQWBBStvZh6NLQm9/rEJlTvA73gJMtUGjAOBgNVHQ8BAf8E
--BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zARBglghkgBhvhCAQEEBAMCAQIwRAYDVR0f
--BD0wOzA5oDegNYYzaHR0cDovL2NybC51c2VydHJ1c3QuY29tL1VUTi1VU0VSRmly
--c3QtSGFyZHdhcmUuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQByQhANOs4kClrwF8BW
--onvUOGCSjRK52zYZgDXYNjDtmr5rJ6NyPFDNn+JxkLpjYetIFMTbSRe679Bt8m7a
--gIAoQYFQtxMuyLnJegB2aEbQiIxh/tC21UcFF7ktdnDoTlA6w3pLuvunaI84Of3o
--2YBrhzkTbCfaYk5JRlTpudW9DkUkHBsyx3nknPKnplkIGaK0jgn8E0n+SFabYaHk
--I9LroYT/+JtLefh9lgBdAgVv0UPbzoGfuDsrk/Zh+UrgbLFpHoVnElhzbkh64Z0X
--OGaJunQc68cCZu5HTn/aK7fBGMcVflRCXLVEQpU9PIAdGA8Ynvg684t8GMaKsRl1
--jIGZ
-+dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xGzAZBgNVBAMTElVUTiAtIERBVEFDb3Jw
-+IFNHQzAeFw0wNTA2MDcwODA5MTBaFw0xOTA2MjQxOTA2MzBaMG8xCzAJBgNVBAYT
-+AlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0
-+ZXJuYWwgVFRQIE5ldHdvcmsxIjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENB
-+IFJvb3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC39xoz5vIABC05
-+4E5b7R+8bA/Ntfojts7emxEzl6QpTH2Tn71KvJPtAxrjj8/lbVBa1pcplFqAsEl6
-+2y6V/bjKvzc4LR4+kUGtcFbH8E8/6DKedMrIkFTpxl8PeJ2aQDwOrGGqXhSPnoeh
-+alDc15pOrwWzpnGUnHGzUGAKxxOdOAeGAqjpqGkmGJCrTLBPI6s6T4TY386f4Wlv
-+u9dC12tE5Met7m1BX3JacQg3s3llpFmglDf3AC8NwpJy2tA4ctsUqEXEXSp9t7TW
-+xO6szRNEt8kr3UMAJfphuWlqWCMRt6czj1Z1WfXNKddGtworZbbTQm8Vsrh7++/p
-+XVPVNFonAgMBAAGjgdgwgdUwHwYDVR0jBBgwFoAUUzLRs89/+uDxoF2FTpLSnkUd
-+tE8wHQYDVR0OBBYEFK29mHo0tCb3+sQmVO8DveAky1QaMA4GA1UdDwEB/wQEAwIB
-+BjAPBgNVHRMBAf8EBTADAQH/MBEGCWCGSAGG+EIBAQQEAwIBAjAgBgNVHSUEGTAX
-+BgorBgEEAYI3CgMDBglghkgBhvhCBAEwPQYDVR0fBDYwNDAyoDCgLoYsaHR0cDov
-+L2NybC51c2VydHJ1c3QuY29tL1VUTi1EQVRBQ29ycFNHQy5jcmwwDQYJKoZIhvcN
-+AQEFBQADggEBAMbuUxdoFLJRIh6QWA2U/b3xcOWGLcM2MY9USEbnLQg3vGwKYOEO
-+rVE04BKT6b64q7gmtOmWPSiPrmQH/uAB7MXjkesYoPF1ftsK5p+R26+udd8jkWjd
-+FwBaS/9kbHDrARrQkNnHptZt9hPk/7XJ0h4qy7ElQyZ42TCbTg0evmnv3+r+LbPM
-++bDdtRTKkdSytaX7ARmjR3mfnYyVhzT4HziS2jamEfpr62vp3EV4FTkG101B5CHI
-+3C+H0be/SGB1pWLLJN47YaApIKa+xWycxOkKaSLvkTr6Jq/RW0GnOuL4OAdCq8Fb
-++M5tug8EPzI0rNwEKNdwMBQmBsTkm5jVz3g=
- -----END CERTIFICATE-----
-- 3 s:/C=US/ST=UT/L=Salt Lake City/O=The USERTRUST
Network/OU=http://www.usertrust.com/CN=UTN-USERFirst-Hardware
-- i:/C=US/ST=UT/L=Salt Lake City/O=The USERTRUST
Network/OU=http://www.usertrust.com/CN=UTN-USERFirst-Hardware
-+ 3 s:/C=US/ST=UT/L=Salt Lake City/O=The USERTRUST
Network/OU=http://www.usertrust.com/CN=UTN - DATACorp SGC
-+ i:/C=US/ST=UT/L=Salt Lake City/O=The USERTRUST
Network/OU=http://www.usertrust.com/CN=UTN - DATACorp SGC
- -----BEGIN CERTIFICATE-----
--MIIEdDCCA1ygAwIBAgIQRL4Mi1AAJLQR0zYq/mUK/TANBgkqhkiG9w0BAQUFADCB
--lzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug
-+MIIEXjCCA0agAwIBAgIQRL4Mi1AAIbQR0ypoBqmtaTANBgkqhkiG9w0BAQUFADCB
-+kzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug
- Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho
--dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3Qt
--SGFyZHdhcmUwHhcNOTkwNzA5MTgxMDQyWhcNMTkwNzA5MTgxOTIyWjCBlzELMAkG
--A1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEe
--MBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8v
--d3d3LnVzZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdh
--cmUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCx98M4P7Sof885glFn
--0G2f0v9Y8+efK+wNiVSZuTiZFvfgIXlIwrthdBKWHTxqctU8EGc6Oe0rE81m65UJ
--M6Rsl7HoxuzBdXmcRl6Nq9Bq/bkqVRcQVLMZ8Jr28bFdtqdt++BxF2uiiPsA3/4a
--MXcMmgF6sTLjKwEHOG7DpV4jvEWbe1DByTCP2+UretNb+zNAHqDVmBe8i4fDidNd
--oI6yqqr2jmmIBsX6iSHzCJ1pLgkzmykNRg+MzEk0sGlRvfkGzWitZky8PqxhvQqI
--DsjfPe58BEydCl5rkdbux+0ojatNh4lz0G6k0B4WixThdkQDf2Os5M1JnMWS9Ksy
--oUhbAgMBAAGjgbkwgbYwCwYDVR0PBAQDAgHGMA8GA1UdEwEB/wQFMAMBAf8wHQYD
--VR0OBBYEFKFyXyYbKJhDlV0HN9WFlp1L0sNFMEQGA1UdHwQ9MDswOaA3oDWGM2h0
--dHA6Ly9jcmwudXNlcnRydXN0LmNvbS9VVE4tVVNFUkZpcnN0LUhhcmR3YXJlLmNy
--bDAxBgNVHSUEKjAoBggrBgEFBQcDAQYIKwYBBQUHAwUGCCsGAQUFBwMGBggrBgEF
--BQcDBzANBgkqhkiG9w0BAQUFAAOCAQEARxkP3nTGmZev/K0oXnWO6y1n7k57K9cM
--//bey1WiCuFMVGWTYGufEpytXoMs61quwOQt9ABjHbjAbPLPSbtNk28Gpgoiskli
--CE7/yMgUsogWXecB5BKV5UU0s4tpvc+0hY91UZ59Ojg6FEgSxvunOxqNDYJAB+gE
--CJChicsZUN/KHAG8HQQZexB2lzvukJDKxA4fFm517zP4029bHpbj4HR3dHuKom4t
--3XbWOTCC8KucUvIqx69JXn7HaOWCgchqJ/kniCrVWFCVH/A7HFe7fRQ5YiuayZSS
--KqMiDP+JJn1fIytH1xUdqWqeUQ0qUZ6B+dQ7XnASfxAynB67nfhmqA==
-+dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xGzAZBgNVBAMTElVUTiAtIERBVEFDb3Jw
-+IFNHQzAeFw05OTA2MjQxODU3MjFaFw0xOTA2MjQxOTA2MzBaMIGTMQswCQYDVQQG
-+EwJVUzELMAkGA1UECBMCVVQxFzAVBgNVBAcTDlNhbHQgTGFrZSBDaXR5MR4wHAYD
-+VQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxITAfBgNVBAsTGGh0dHA6Ly93d3cu
-+dXNlcnRydXN0LmNvbTEbMBkGA1UEAxMSVVROIC0gREFUQUNvcnAgU0dDMIIBIjAN
-+BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3+5YEKIrblXEjr8uRgnn4AgPLit6
-+E5Qbvfa2gI5lBZMAHryv4g+OGQ0SR+ysraP6LnD43m77VkIVni5c7yPeIbkFdicZ
-+D0/Ww5y0vpQZY/KmEQrrU0icvvIpOxboGqBMpsn0GFlowHDyUwDAXlCCpVZvNvlK
-+4ESGoE1O1kduSUrLZ9emxAW5jh70/P/N5zbgnAVssjMiFdC04MwXwLLA9P4yPykq
-+lXvY8qdOD1R8oQ2AswkDwf9c3V6aPryuvEeKaq5xyh+xKrhfQgUL7EYw0XILyulW
-+bfXv33i+Ybqypa4ETLyorGkVl73v67SMvzX41MPRKA5cOp9wGDMgd8SirwIDAQAB
-+o4GrMIGoMAsGA1UdDwQEAwIBxjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRT
-+MtGzz3/64PGgXYVOktKeRR20TzA9BgNVHR8ENjA0MDKgMKAuhixodHRwOi8vY3Js
-+LnVzZXJ0cnVzdC5jb20vVVROLURBVEFDb3JwU0dDLmNybDAqBgNVHSUEIzAhBggr
-+BgEFBQcDAQYKKwYBBAGCNwoDAwYJYIZIAYb4QgQBMA0GCSqGSIb3DQEBBQUAA4IB
-+AQAnNZcAiosovcYzMB4p/OL31ZjUQLtgyr+rFywJNn9Q+kHcrpY6CiM+iVnJowft
-+Gzet/Hy+UUla3joKVAgWRcKZsYfNjGjgaQPpxE6YsjuMFrMOoAyYUJuTqXAJyCyj
-+j98C5OBxOvG0I3KgqgHf35g+FFCgMSa9KOlaMCZ1+XtgHI3zzVAmbQQnmt/VDUVH
-+KWss5nbZqSl9Mt3JNjy9rjXxEZ4du5A/EkdOjtd+D2JzHVImOBwYSf0wdJrE5SIv
-+2MCN7ZF6TACPcn9d2t0bi0Vr591pl6jFVkwPDPafepE39peC4N1xaf92P2BNPM/3
-+mfnGV/TJVTl4uix5yaaIK/QI
- -----END CERTIFICATE-----
-diff --git a/Lib/test/ssl_cert.pem b/Lib/test/ssl_cert.pem
-new file mode 100644
-index 0000000..47a7d7e
---- /dev/null
-+++ b/Lib/test/ssl_cert.pem
-@@ -0,0 +1,15 @@
-+-----BEGIN CERTIFICATE-----
-+MIICVDCCAb2gAwIBAgIJANfHOBkZr8JOMA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV
-+BAYTAlhZMRcwFQYDVQQHEw5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9u
-+IFNvZnR3YXJlIEZvdW5kYXRpb24xEjAQBgNVBAMTCWxvY2FsaG9zdDAeFw0xMDEw
-+MDgyMzAxNTZaFw0yMDEwMDUyMzAxNTZaMF8xCzAJBgNVBAYTAlhZMRcwFQYDVQQH
-+Ew5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9uIFNvZnR3YXJlIEZvdW5k
-+YXRpb24xEjAQBgNVBAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAw
-+gYkCgYEA21vT5isq7F68amYuuNpSFlKDPrMUCa4YWYqZRt2OZ+/3NKaZ2xAiSwr7
-+6MrQF70t5nLbSPpqE5+5VrS58SY+g/sXLiFd6AplH1wJZwh78DofbFYXUggktFMt
-+pTyiX8jtP66bkcPkDADA089RI1TQR6Ca+n7HFa7c1fabVV6i3zkCAwEAAaMYMBYw
-+FAYDVR0RBA0wC4IJbG9jYWxob3N0MA0GCSqGSIb3DQEBBQUAA4GBAHPctQBEQ4wd
-+BJ6+JcpIraopLn8BGhbjNWj40mmRqWB/NAWF6M5ne7KpGAu7tLeG4hb1zLaldK8G
-+lxy2GPSRF6LFS48dpEj2HbMv2nvv6xxalDMJ9+DicWgAKTQ6bcX2j3GUkCR0g/T1
-+CRlNBAAlvhKzO7Clpf9l0YKBEfraJByX
-+-----END CERTIFICATE-----
-diff --git a/Lib/test/ssl_key.passwd.pem b/Lib/test/ssl_key.passwd.pem
-new file mode 100644
-index 0000000..2524672
---- /dev/null
-+++ b/Lib/test/ssl_key.passwd.pem
-@@ -0,0 +1,18 @@
-+-----BEGIN RSA PRIVATE KEY-----
-+Proc-Type: 4,ENCRYPTED
-+DEK-Info: DES-EDE3-CBC,1A8D9D2A02EC698A
-+
-+kJYbfZ8L0sfe9Oty3gw0aloNnY5E8fegRfQLZlNoxTl6jNt0nIwI8kDJ36CZgR9c
-+u3FDJm/KqrfUoz8vW+qEnWhSG7QPX2wWGPHd4K94Yz/FgrRzZ0DoK7XxXq9gOtVA
-+AVGQhnz32p+6WhfGsCr9ArXEwRZrTk/FvzEPaU5fHcoSkrNVAGX8IpSVkSDwEDQr
-+Gv17+cfk99UV1OCza6yKHoFkTtrC+PZU71LomBabivS2Oc4B9hYuSR2hF01wTHP+
-+YlWNagZOOVtNz4oKK9x9eNQpmfQXQvPPTfusexKIbKfZrMvJoxcm1gfcZ0H/wK6P
-+6wmXSG35qMOOztCZNtperjs1wzEBXznyK8QmLcAJBjkfarABJX9vBEzZV0OUKhy+
-+noORFwHTllphbmydLhu6ehLUZMHPhzAS5UN7srtpSN81eerDMy0RMUAwA7/PofX1
-+94Me85Q8jP0PC9ETdsJcPqLzAPETEYu0ELewKRcrdyWi+tlLFrpE5KT/s5ecbl9l
-+7B61U4Kfd1PIXc/siINhU3A3bYK+845YyUArUOnKf1kEox7p1RpD7yFqVT04lRTo
-+cibNKATBusXSuBrp2G6GNuhWEOSafWCKJQAzgCYIp6ZTV2khhMUGppc/2H3CF6cO
-+zX0KtlPVZC7hLkB6HT8SxYUwF1zqWY7+/XPPdc37MeEZ87Q3UuZwqORLY+Z0hpgt
-+L5JXBCoklZhCAaN2GqwFLXtGiRSRFGY7xXIhbDTlE65Wv1WGGgDLMKGE1gOz3yAo
-+2jjG1+yAHJUdE69XTFHSqSkvaloA1W03LdMXZ9VuQJ/ySXCie6ABAQ==
-+-----END RSA PRIVATE KEY-----
-diff --git a/Lib/test/ssl_key.pem b/Lib/test/ssl_key.pem
-new file mode 100644
-index 0000000..3fd3bbd
---- /dev/null
-+++ b/Lib/test/ssl_key.pem
-@@ -0,0 +1,16 @@
-+-----BEGIN PRIVATE KEY-----
-+MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBANtb0+YrKuxevGpm
-+LrjaUhZSgz6zFAmuGFmKmUbdjmfv9zSmmdsQIksK++jK0Be9LeZy20j6ahOfuVa0
-+ufEmPoP7Fy4hXegKZR9cCWcIe/A6H2xWF1IIJLRTLaU8ol/I7T+um5HD5AwAwNPP
-+USNU0Eegmvp+xxWu3NX2m1Veot85AgMBAAECgYA3ZdZ673X0oexFlq7AAmrutkHt
-+CL7LvwrpOiaBjhyTxTeSNWzvtQBkIU8DOI0bIazA4UreAFffwtvEuPmonDb3F+Iq
-+SMAu42XcGyVZEl+gHlTPU9XRX7nTOXVt+MlRRRxL6t9GkGfUAXI3XxJDXW3c0vBK
-+UL9xqD8cORXOfE06rQJBAP8mEX1ERkR64Ptsoe4281vjTlNfIbs7NMPkUnrn9N/Y
-+BLhjNIfQ3HFZG8BTMLfX7kCS9D593DW5tV4Z9BP/c6cCQQDcFzCcVArNh2JSywOQ
-+ZfTfRbJg/Z5Lt9Fkngv1meeGNPgIMLN8Sg679pAOOWmzdMO3V706rNPzSVMME7E5
-+oPIfAkEA8pDddarP5tCvTTgUpmTFbakm0KoTZm2+FzHcnA4jRh+XNTjTOv98Y6Ik
-+eO5d1ZnKXseWvkZncQgxfdnMqqpj5wJAcNq/RVne1DbYlwWchT2Si65MYmmJ8t+F
-+0mcsULqjOnEMwf5e+ptq5LzwbyrHZYq5FNk7ocufPv/ZQrcSSC+cFwJBAKvOJByS
-+x56qyGeZLOQlWS2JS3KJo59XuLFGqcbgN9Om9xFa41Yb4N9NvplFivsvZdw3m1Q/
-+SPIXQuT8RMPDVNQ=
-+-----END PRIVATE KEY-----
-diff --git a/Lib/test/ssl_servers.py b/Lib/test/ssl_servers.py
-new file mode 100644
-index 0000000..a312e28
---- /dev/null
-+++ b/Lib/test/ssl_servers.py
-@@ -0,0 +1,209 @@
-+import os
-+import sys
-+import ssl
-+import pprint
-+import urllib
-+import urlparse
-+# Rename HTTPServer to _HTTPServer so as to avoid confusion with HTTPSServer.
-+from BaseHTTPServer import HTTPServer as _HTTPServer, BaseHTTPRequestHandler
-+from SimpleHTTPServer import SimpleHTTPRequestHandler
-+
-+from test import test_support as support
-+threading = support.import_module("threading")
-+
-+here = os.path.dirname(__file__)
-+
-+HOST = support.HOST
-+CERTFILE = os.path.join(here, 'keycert.pem')
-+
-+# This one's based on HTTPServer, which is based on SocketServer
-+
-+class HTTPSServer(_HTTPServer):
-+
-+ def __init__(self, server_address, handler_class, context):
-+ _HTTPServer.__init__(self, server_address, handler_class)
-+ self.context = context
-+
-+ def __str__(self):
-+ return ('<%s %s:%s>' %
-+ (self.__class__.__name__,
-+ self.server_name,
-+ self.server_port))
-+
-+ def get_request(self):
-+ # override this to wrap socket with SSL
-+ try:
-+ sock, addr = self.socket.accept()
-+ sslconn = self.context.wrap_socket(sock, server_side=True)
-+ except OSError as e:
-+ # socket errors are silenced by the caller, print them here
-+ if support.verbose:
-+ sys.stderr.write("Got an error:\n%s\n" % e)
-+ raise
-+ return sslconn, addr
-+
-+class RootedHTTPRequestHandler(SimpleHTTPRequestHandler):
-+ # need to override translate_path to get a known root,
-+ # instead of using os.curdir, since the test could be
-+ # run from anywhere
-+
-+ server_version = "TestHTTPS/1.0"
-+ root = here
-+ # Avoid hanging when a request gets interrupted by the client
-+ timeout = 5
-+
-+ def translate_path(self, path):
-+ """Translate a /-separated PATH to the local filename syntax.
-+
-+ Components that mean special things to the local file system
-+ (e.g. drive or directory names) are ignored. (XXX They should
-+ probably be diagnosed.)
-+
-+ """
-+ # abandon query parameters
-+ path = urlparse.urlparse(path)[2]
-+ path = os.path.normpath(urllib.unquote(path))
-+ words = path.split('/')
-+ words = filter(None, words)
-+ path = self.root
-+ for word in words:
-+ drive, word = os.path.splitdrive(word)
-+ head, word = os.path.split(word)
-+ path = os.path.join(path, word)
-+ return path
-+
-+ def log_message(self, format, *args):
-+ # we override this to suppress logging unless "verbose"
-+ if support.verbose:
-+ sys.stdout.write(" server (%s:%d %s):\n [%s] %s\n" %
-+ (self.server.server_address,
-+ self.server.server_port,
-+ self.request.cipher(),
-+ self.log_date_time_string(),
-+ format%args))
-+
-+
-+class StatsRequestHandler(BaseHTTPRequestHandler):
-+ """Example HTTP request handler which returns SSL statistics on GET
-+ requests.
-+ """
-+
-+ server_version = "StatsHTTPS/1.0"
-+
-+ def do_GET(self, send_body=True):
-+ """Serve a GET request."""
-+ sock = self.rfile.raw._sock
-+ context = sock.context
-+ stats = {
-+ 'session_cache': context.session_stats(),
-+ 'cipher': sock.cipher(),
-+ 'compression': sock.compression(),
-+ }
-+ body = pprint.pformat(stats)
-+ body = body.encode('utf-8')
-+ self.send_response(200)
-+ self.send_header("Content-type", "text/plain;
charset=utf-8")
-+ self.send_header("Content-Length", str(len(body)))
-+ self.end_headers()
-+ if send_body:
-+ self.wfile.write(body)
-+
-+ def do_HEAD(self):
-+ """Serve a HEAD request."""
-+ self.do_GET(send_body=False)
-+
-+ def log_request(self, format, *args):
-+ if support.verbose:
-+ BaseHTTPRequestHandler.log_request(self, format, *args)
-+
-+
-+class HTTPSServerThread(threading.Thread):
-+
-+ def __init__(self, context, host=HOST, handler_class=None):
-+ self.flag = None
-+ self.server = HTTPSServer((host, 0),
-+ handler_class or RootedHTTPRequestHandler,
-+ context)
-+ self.port = self.server.server_port
-+ threading.Thread.__init__(self)
-+ self.daemon = True
-+
-+ def __str__(self):
-+ return "<%s %s>" % (self.__class__.__name__, self.server)
-+
-+ def start(self, flag=None):
-+ self.flag = flag
-+ threading.Thread.start(self)
-+
-+ def run(self):
-+ if self.flag:
-+ self.flag.set()
-+ try:
-+ self.server.serve_forever(0.05)
-+ finally:
-+ self.server.server_close()
-+
-+ def stop(self):
-+ self.server.shutdown()
-+
-+
-+def make_https_server(case, context=None, certfile=CERTFILE,
-+ host=HOST, handler_class=None):
-+ if context is None:
-+ context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
-+ # We assume the certfile contains both private key and certificate
-+ context.load_cert_chain(certfile)
-+ server = HTTPSServerThread(context, host, handler_class)
-+ flag = threading.Event()
-+ server.start(flag)
-+ flag.wait()
-+ def cleanup():
-+ if support.verbose:
-+ sys.stdout.write('stopping HTTPS server\n')
-+ server.stop()
-+ if support.verbose:
-+ sys.stdout.write('joining HTTPS thread\n')
-+ server.join()
-+ case.addCleanup(cleanup)
-+ return server
-+
-+
-+if __name__ == "__main__":
-+ import argparse
-+ parser = argparse.ArgumentParser(
-+ description='Run a test HTTPS server. '
-+ 'By default, the current directory is served.')
-+ parser.add_argument('-p', '--port', type=int, default=4433,
-+ help='port to listen on (default: %(default)s)')
-+ parser.add_argument('-q', '--quiet', dest='verbose',
default=True,
-+ action='store_false', help='be less verbose')
-+ parser.add_argument('-s', '--stats',
dest='use_stats_handler', default=False,
-+ action='store_true', help='always return stats
page')
-+ parser.add_argument('--curve-name', dest='curve_name', type=str,
-+ action='store',
-+ help='curve name for EC-based Diffie-Hellman')
-+ parser.add_argument('--ciphers', dest='ciphers', type=str,
-+ help='allowed cipher list')
-+ parser.add_argument('--dh', dest='dh_file', type=str,
action='store',
-+ help='PEM file containing DH parameters')
-+ args = parser.parse_args()
-+
-+ support.verbose = args.verbose
-+ if args.use_stats_handler:
-+ handler_class = StatsRequestHandler
-+ else:
-+ handler_class = RootedHTTPRequestHandler
-+ handler_class.root = os.getcwd()
-+ context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
-+ context.load_cert_chain(CERTFILE)
-+ if args.curve_name:
-+ context.set_ecdh_curve(args.curve_name)
-+ if args.dh_file:
-+ context.load_dh_params(args.dh_file)
-+ if args.ciphers:
-+ context.set_ciphers(args.ciphers)
-+
-+ server = HTTPSServer(("", args.port), handler_class, context)
-+ if args.verbose:
-+ print("Listening on
https://localhost:{0.port}".format(args))
-+ server.serve_forever(0.1)
-diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
-index 91b8029..a629e1b 100644
---- a/Lib/test/test_ssl.py
-+++ b/Lib/test/test_ssl.py
-@@ -1,35 +1,78 @@
-+# -*- encoding: utf-8 -*-
- # Test the support for SSL and sockets
-
- import sys
- import unittest
--from test import test_support
-+from test import test_support as support
- import asyncore
- import socket
- import select
- import time
-+import datetime
- import gc
- import os
- import errno
- import pprint
--import urllib, urlparse
-+import tempfile
-+import urllib
- import traceback
- import weakref
--import functools
- import platform
-+import functools
-+from contextlib import closing
-+
-+ssl = support.import_module("ssl")
-+
-+PROTOCOLS = sorted(ssl._PROTOCOL_NAMES)
-+HOST = support.HOST
-+
-+def data_file(*name):
-+ return os.path.join(os.path.dirname(__file__), *name)
-+
-+# The custom key and certificate files used in test_ssl are generated
-+# using Lib/test/make_ssl_certs.py.
-+# Other certificates are simply fetched from the Internet servers they
-+# are meant to authenticate.
-+
-+CERTFILE = data_file("keycert.pem")
-+BYTES_CERTFILE = CERTFILE.encode(sys.getfilesystemencoding())
-+ONLYCERT = data_file("ssl_cert.pem")
-+ONLYKEY = data_file("ssl_key.pem")
-+BYTES_ONLYCERT = ONLYCERT.encode(sys.getfilesystemencoding())
-+BYTES_ONLYKEY = ONLYKEY.encode(sys.getfilesystemencoding())
-+CERTFILE_PROTECTED = data_file("keycert.passwd.pem")
-+ONLYKEY_PROTECTED = data_file("ssl_key.passwd.pem")
-+KEY_PASSWORD = "somepass"
-+CAPATH = data_file("capath")
-+BYTES_CAPATH = CAPATH.encode(sys.getfilesystemencoding())
-+CAFILE_NEURONIO = data_file("capath", "4e1295a3.0")
-+CAFILE_CACERT = data_file("capath", "5ed36f99.0")
-+
-+
-+# empty CRL
-+CRLFILE = data_file("revocation.crl")
-+
-+# Two keys and certs signed by the same CA (for SNI tests)
-+SIGNED_CERTFILE = data_file("keycert3.pem")
-+SIGNED_CERTFILE2 = data_file("keycert4.pem")
-+SIGNING_CA = data_file("pycacert.pem")
-+
-+SVN_PYTHON_ORG_ROOT_CERT = data_file("https_svn_python_org_root.pem")
-
--from BaseHTTPServer import HTTPServer
--from SimpleHTTPServer import SimpleHTTPRequestHandler
-+EMPTYCERT = data_file("nullcert.pem")
-+BADCERT = data_file("badcert.pem")
-+WRONGCERT = data_file("XXXnonexisting.pem")
-+BADKEY = data_file("badkey.pem")
-+NOKIACERT = data_file("nokia.pem")
-+NULLBYTECERT = data_file("nullbytecert.pem")
-
--ssl = test_support.import_module("ssl")
-+DHFILE = data_file("dh512.pem")
-+BYTES_DHFILE = DHFILE.encode(sys.getfilesystemencoding())
-
--HOST = test_support.HOST
--CERTFILE = None
--SVN_PYTHON_ORG_ROOT_CERT = None
--NULLBYTECERT = None
-
- def handle_error(prefix):
- exc_format = ' '.join(traceback.format_exception(*sys.exc_info()))
-- if test_support.verbose:
-+ if support.verbose:
- sys.stdout.write(prefix + exc_format)
-
-
-@@ -51,48 +94,76 @@ class BasicTests(unittest.TestCase):
- pass
- else:
- raise
-+def can_clear_options():
-+ # 0.9.8m or higher
-+ return ssl._OPENSSL_API_VERSION >= (0, 9, 8, 13, 15)
-+
-+def no_sslv2_implies_sslv3_hello():
-+ # 0.9.7h or higher
-+ return ssl.OPENSSL_VERSION_INFO >= (0, 9, 7, 8, 15)
-+
-+def have_verify_flags():
-+ # 0.9.8 or higher
-+ return ssl.OPENSSL_VERSION_INFO >= (0, 9, 8, 0, 15)
-+
-+def utc_offset(): #NOTE: ignore issues like #1647654
-+ # local time = utc time + utc offset
-+ if time.daylight and time.localtime().tm_isdst > 0:
-+ return -time.altzone # seconds
-+ return -time.timezone
-+
-+def asn1time(cert_time):
-+ # Some versions of OpenSSL ignore seconds, see #18207
-+ # 0.9.8.i
-+ if ssl._OPENSSL_API_VERSION == (0, 9, 8, 9, 15):
-+ fmt = "%b %d %H:%M:%S %Y GMT"
-+ dt = datetime.datetime.strptime(cert_time, fmt)
-+ dt = dt.replace(second=0)
-+ cert_time = dt.strftime(fmt)
-+ # %d adds leading zero but ASN1_TIME_print() uses leading space
-+ if cert_time[4] == "0":
-+ cert_time = cert_time[:4] + " " + cert_time[5:]
-+
-+ return cert_time
-
- # Issue #9415: Ubuntu hijacks their OpenSSL and forcefully disables SSLv2
- def skip_if_broken_ubuntu_ssl(func):
- if hasattr(ssl, 'PROTOCOL_SSLv2'):
-- # We need to access the lower-level wrapper in order to create an
-- # implicit SSL context without trying to connect or listen.
-- try:
-- import _ssl
-- except ImportError:
-- # The returned function won't get executed, just ignore the error
-- pass
- @functools.wraps(func)
- def f(*args, **kwargs):
- try:
-- s = socket.socket(socket.AF_INET)
-- _ssl.sslwrap(s._sock, 0, None, None,
-- ssl.CERT_NONE, ssl.PROTOCOL_SSLv2, None, None)
-- except ssl.SSLError as e:
-+ ssl.SSLContext(ssl.PROTOCOL_SSLv2)
-+ except ssl.SSLError:
- if (ssl.OPENSSL_VERSION_INFO == (0, 9, 8, 15, 15) and
-- platform.linux_distribution() == ('debian',
'squeeze/sid', '')
-- and 'Invalid SSL protocol variant specified' in str(e)):
-+ platform.linux_distribution() == ('debian',
'squeeze/sid', '')):
- raise unittest.SkipTest("Patched Ubuntu OpenSSL breaks
behaviour")
- return func(*args, **kwargs)
- return f
- else:
- return func
-
-+needs_sni = unittest.skipUnless(ssl.HAS_SNI, "SNI support needed for this
test")
-+
-
- class BasicSocketTests(unittest.TestCase):
-
- def test_constants(self):
-- #ssl.PROTOCOL_SSLv2
-- ssl.PROTOCOL_SSLv23
-- ssl.PROTOCOL_SSLv3
-- ssl.PROTOCOL_TLSv1
- ssl.CERT_NONE
- ssl.CERT_OPTIONAL
- ssl.CERT_REQUIRED
-+ ssl.OP_CIPHER_SERVER_PREFERENCE
-+ ssl.OP_SINGLE_DH_USE
-+ if ssl.HAS_ECDH:
-+ ssl.OP_SINGLE_ECDH_USE
-+ if ssl.OPENSSL_VERSION_INFO >= (1, 0):
-+ ssl.OP_NO_COMPRESSION
-+ self.assertIn(ssl.HAS_SNI, {True, False})
-+ self.assertIn(ssl.HAS_ECDH, {True, False})
-+
-
- def test_random(self):
- v = ssl.RAND_status()
-- if test_support.verbose:
-+ if support.verbose:
- sys.stdout.write("\n RAND_status is %d (%s)\n"
- % (v, (v and "sufficient randomness") or
- "insufficient randomness"))
-@@ -104,9 +175,19 @@ class BasicSocketTests(unittest.TestCase):
- # note that this uses an 'unofficial' function in _ssl.c,
- # provided solely for this test, to exercise the certificate
- # parsing code
-- p = ssl._ssl._test_decode_cert(CERTFILE, False)
-- if test_support.verbose:
-+ p = ssl._ssl._test_decode_cert(CERTFILE)
-+ if support.verbose:
- sys.stdout.write("\n" + pprint.pformat(p) + "\n")
-+ self.assertEqual(p['issuer'],
-+ ((('countryName', 'XY'),),
-+ (('localityName', 'Castle Anthrax'),),
-+ (('organizationName', 'Python Software
Foundation'),),
-+ (('commonName', 'localhost'),))
-+ )
-+ # Note the next three asserts will fail if the keys are regenerated
-+ self.assertEqual(p['notAfter'], asn1time('Oct 5 23:01:56 2020
GMT'))
-+ self.assertEqual(p['notBefore'], asn1time('Oct 8 23:01:56 2010
GMT'))
-+ self.assertEqual(p['serialNumber'], 'D7C7381919AFC24E')
- self.assertEqual(p['subject'],
- ((('countryName', 'XY'),),
- (('localityName', 'Castle Anthrax'),),
-@@ -117,16 +198,22 @@ class BasicSocketTests(unittest.TestCase):
- # Issue #13034: the subjectAltName in some certificates
- # (notably projects.developer.nokia.com:443) wasn't parsed
- p = ssl._ssl._test_decode_cert(NOKIACERT)
-- if test_support.verbose:
-+ if support.verbose:
- sys.stdout.write("\n" + pprint.pformat(p) + "\n")
- self.assertEqual(p['subjectAltName'],
- (('DNS', 'projects.developer.nokia.com'),
- ('DNS', 'projects.forum.nokia.com'))
- )
-+ # extra OCSP and AIA fields
-+ self.assertEqual(p['OCSP'], ('http://ocsp.verisign.com',))
-+ self.assertEqual(p['caIssuers'],
-+ ('http://SVRIntl-G3-aia.verisign.com/SVRIntlG3.cer',))
-+ self.assertEqual(p['crlDistributionPoints'],
-+ ('http://SVRIntl-G3-crl.verisign.com/SVRIntlG3.crl',))
-
- def test_parse_cert_CVE_2013_4238(self):
- p = ssl._ssl._test_decode_cert(NULLBYTECERT)
-- if test_support.verbose:
-+ if support.verbose:
- sys.stdout.write("\n" + pprint.pformat(p) + "\n")
- subject = ((('countryName', 'US'),),
- (('stateOrProvinceName', 'Oregon'),),
-@@ -137,7 +224,7 @@ class BasicSocketTests(unittest.TestCase):
- (('emailAddress', 'python-dev(a)python.org'),))
- self.assertEqual(p['subject'], subject)
- self.assertEqual(p['issuer'], subject)
-- if ssl.OPENSSL_VERSION_INFO >= (0, 9, 8):
-+ if ssl._OPENSSL_API_VERSION >= (0, 9, 8):
- san = (('DNS', 'altnull.python.org\x00example.com'),
- ('email', 'null@python.org\x00user(a)example.org'),
- ('URI',
'http://null.python.org\x00http://example.org'),
-@@ -196,24 +283,7 @@ class BasicSocketTests(unittest.TestCase):
- self.assertTrue(s.startswith("OpenSSL {:d}.{:d}.{:d}".format(major,
minor, fix)),
- (s, t))
-
-- @test_support.requires_resource('network')
-- def test_ciphers(self):
-- remote = ("svn.python.org", 443)
-- with test_support.transient_internet(remote[0]):
-- s = ssl.wrap_socket(socket.socket(socket.AF_INET),
-- cert_reqs=ssl.CERT_NONE, ciphers="ALL")
-- s.connect(remote)
-- s = ssl.wrap_socket(socket.socket(socket.AF_INET),
-- cert_reqs=ssl.CERT_NONE, ciphers="DEFAULT")
-- s.connect(remote)
-- # Error checking occurs when connecting, because the SSL context
-- # isn't created before.
-- s = ssl.wrap_socket(socket.socket(socket.AF_INET),
-- cert_reqs=ssl.CERT_NONE,
ciphers="^$:,;?*'dorothyx")
-- with self.assertRaisesRegexp(ssl.SSLError, "No cipher can be
selected"):
-- s.connect(remote)
--
-- @test_support.cpython_only
-+ @support.cpython_only
- def test_refcycle(self):
- # Issue #7943: an SSL object doesn't create reference cycles with
- # itself.
-@@ -224,17 +294,319 @@ class BasicSocketTests(unittest.TestCase):
- self.assertEqual(wr(), None)
-
- def test_wrapped_unconnected(self):
-- # The _delegate_methods in socket.py are correctly delegated to by an
-- # unconnected SSLSocket, so they will raise a socket.error rather than
-- # something unexpected like TypeError.
-+ # Methods on an unconnected SSLSocket propagate the original
-+ # socket.error raise by the underlying socket object.
- s = socket.socket(socket.AF_INET)
-- ss = ssl.wrap_socket(s)
-- self.assertRaises(socket.error, ss.recv, 1)
-- self.assertRaises(socket.error, ss.recv_into, bytearray(b'x'))
-- self.assertRaises(socket.error, ss.recvfrom, 1)
-- self.assertRaises(socket.error, ss.recvfrom_into, bytearray(b'x'), 1)
-- self.assertRaises(socket.error, ss.send, b'x')
-- self.assertRaises(socket.error, ss.sendto, b'x', ('0.0.0.0',
0))
-+ with closing(ssl.wrap_socket(s)) as ss:
-+ self.assertRaises(socket.error, ss.recv, 1)
-+ self.assertRaises(socket.error, ss.recv_into, bytearray(b'x'))
-+ self.assertRaises(socket.error, ss.recvfrom, 1)
-+ self.assertRaises(socket.error, ss.recvfrom_into, bytearray(b'x'),
1)
-+ self.assertRaises(socket.error, ss.send, b'x')
-+ self.assertRaises(socket.error, ss.sendto, b'x', ('0.0.0.0',
0))
-+
-+ def test_timeout(self):
-+ # Issue #8524: when creating an SSL socket, the timeout of the
-+ # original socket should be retained.
-+ for timeout in (None, 0.0, 5.0):
-+ s = socket.socket(socket.AF_INET)
-+ s.settimeout(timeout)
-+ with closing(ssl.wrap_socket(s)) as ss:
-+ self.assertEqual(timeout, ss.gettimeout())
-+
-+ def test_errors(self):
-+ sock = socket.socket()
-+ self.assertRaisesRegexp(ValueError,
-+ "certfile must be specified",
-+ ssl.wrap_socket, sock, keyfile=CERTFILE)
-+ self.assertRaisesRegexp(ValueError,
-+ "certfile must be specified for server-side
operations",
-+ ssl.wrap_socket, sock, server_side=True)
-+ self.assertRaisesRegexp(ValueError,
-+ "certfile must be specified for server-side
operations",
-+ ssl.wrap_socket, sock, server_side=True, certfile="")
-+ with closing(ssl.wrap_socket(sock, server_side=True, certfile=CERTFILE)) as s:
-+ self.assertRaisesRegexp(ValueError, "can't connect in server-side
mode",
-+ s.connect, (HOST, 8080))
-+ with self.assertRaises(IOError) as cm:
-+ with closing(socket.socket()) as sock:
-+ ssl.wrap_socket(sock, certfile=WRONGCERT)
-+ self.assertEqual(cm.exception.errno, errno.ENOENT)
-+ with self.assertRaises(IOError) as cm:
-+ with closing(socket.socket()) as sock:
-+ ssl.wrap_socket(sock, certfile=CERTFILE, keyfile=WRONGCERT)
-+ self.assertEqual(cm.exception.errno, errno.ENOENT)
-+ with self.assertRaises(IOError) as cm:
-+ with closing(socket.socket()) as sock:
-+ ssl.wrap_socket(sock, certfile=WRONGCERT, keyfile=WRONGCERT)
-+ self.assertEqual(cm.exception.errno, errno.ENOENT)
-+
-+ def test_match_hostname(self):
-+ def ok(cert, hostname):
-+ ssl.match_hostname(cert, hostname)
-+ def fail(cert, hostname):
-+ self.assertRaises(ssl.CertificateError,
-+ ssl.match_hostname, cert, hostname)
-+
-+ cert = {'subject': ((('commonName', 'example.com'),),)}
-+ ok(cert, 'example.com')
-+ ok(cert, 'ExAmple.cOm')
-+ fail(cert, 'www.example.com')
-+ fail(cert, '.example.com')
-+ fail(cert, 'example.org')
-+ fail(cert, 'exampleXcom')
-+
-+ cert = {'subject': ((('commonName', '*.a.com'),),)}
-+ ok(cert, 'foo.a.com')
-+ fail(cert, 'bar.foo.a.com')
-+ fail(cert, 'a.com')
-+ fail(cert, 'Xa.com')
-+ fail(cert, '.a.com')
-+
-+ # only match one left-most wildcard
-+ cert = {'subject': ((('commonName', 'f*.com'),),)}
-+ ok(cert, 'foo.com')
-+ ok(cert, 'f.com')
-+ fail(cert, 'bar.com')
-+ fail(cert, 'foo.a.com')
-+ fail(cert, 'bar.foo.com')
-+
-+ # NULL bytes are bad, CVE-2013-4073
-+ cert = {'subject': ((('commonName',
-+ 'null.python.org\x00example.org'),),)}
-+ ok(cert, 'null.python.org\x00example.org') # or raise an error?
-+ fail(cert, 'example.org')
-+ fail(cert, 'null.python.org')
-+
-+ # error cases with wildcards
-+ cert = {'subject': ((('commonName', '*.*.a.com'),),)}
-+ fail(cert, 'bar.foo.a.com')
-+ fail(cert, 'a.com')
-+ fail(cert, 'Xa.com')
-+ fail(cert, '.a.com')
-+
-+ cert = {'subject': ((('commonName', 'a.*.com'),),)}
-+ fail(cert, 'a.foo.com')
-+ fail(cert, 'a..com')
-+ fail(cert, 'a.com')
-+
-+ # wildcard doesn't match IDNA prefix 'xn--'
-+ idna =
u'pthon.python.org'.encode("idna").decode("ascii")
-+ cert = {'subject': ((('commonName', idna),),)}
-+ ok(cert, idna)
-+ cert = {'subject': ((('commonName',
'x*.python.org'),),)}
-+ fail(cert, idna)
-+ cert = {'subject': ((('commonName',
'xn--p*.python.org'),),)}
-+ fail(cert, idna)
-+
-+ # wildcard in first fragment and IDNA A-labels in sequent fragments
-+ # are supported.
-+ idna =
u'www*.pythn.org'.encode("idna").decode("ascii")
-+ cert = {'subject': ((('commonName', idna),),)}
-+ ok(cert,
u'www.pythn.org'.encode("idna").decode("ascii"))
-+ ok(cert,
u'www1.pythn.org'.encode("idna").decode("ascii"))
-+ fail(cert,
u'ftp.pythn.org'.encode("idna").decode("ascii"))
-+ fail(cert,
u'pythn.org'.encode("idna").decode("ascii"))
-+
-+ # Slightly fake real-world example
-+ cert = {'notAfter': 'Jun 26 21:41:46 2011 GMT',
-+ 'subject': ((('commonName',
'linuxfrz.org'),),),
-+ 'subjectAltName': (('DNS', 'linuxfr.org'),
-+ ('DNS', 'linuxfr.com'),
-+ ('othername',
'<unsupported>'))}
-+ ok(cert, 'linuxfr.org')
-+ ok(cert, 'linuxfr.com')
-+ # Not a "DNS" entry
-+ fail(cert, '<unsupported>')
-+ # When there is a subjectAltName, commonName isn't used
-+ fail(cert, 'linuxfrz.org')
-+
-+ # A pristine real-world example
-+ cert = {'notAfter': 'Dec 18 23:59:59 2011 GMT',
-+ 'subject': ((('countryName', 'US'),),
-+ (('stateOrProvinceName', 'California'),),
-+ (('localityName', 'Mountain View'),),
-+ (('organizationName', 'Google Inc'),),
-+ (('commonName', 'mail.google.com'),))}
-+ ok(cert, 'mail.google.com')
-+ fail(cert, 'gmail.com')
-+ # Only commonName is considered
-+ fail(cert, 'California')
-+
-+ # Neither commonName nor subjectAltName
-+ cert = {'notAfter': 'Dec 18 23:59:59 2011 GMT',
-+ 'subject': ((('countryName', 'US'),),
-+ (('stateOrProvinceName', 'California'),),
-+ (('localityName', 'Mountain View'),),
-+ (('organizationName', 'Google Inc'),))}
-+ fail(cert, 'mail.google.com')
-+
-+ # No DNS entry in subjectAltName but a commonName
-+ cert = {'notAfter': 'Dec 18 23:59:59 2099 GMT',
-+ 'subject': ((('countryName', 'US'),),
-+ (('stateOrProvinceName', 'California'),),
-+ (('localityName', 'Mountain View'),),
-+ (('commonName', 'mail.google.com'),)),
-+ 'subjectAltName': (('othername', 'blabla'), )}
-+ ok(cert, 'mail.google.com')
-+
-+ # No DNS entry subjectAltName and no commonName
-+ cert = {'notAfter': 'Dec 18 23:59:59 2099 GMT',
-+ 'subject': ((('countryName', 'US'),),
-+ (('stateOrProvinceName', 'California'),),
-+ (('localityName', 'Mountain View'),),
-+ (('organizationName', 'Google Inc'),)),
-+ 'subjectAltName': (('othername', 'blabla'),)}
-+ fail(cert, 'google.com')
-+
-+ # Empty cert / no cert
-+ self.assertRaises(ValueError, ssl.match_hostname, None, 'example.com')
-+ self.assertRaises(ValueError, ssl.match_hostname, {}, 'example.com')
-+
-+ # Issue #17980: avoid denials of service by refusing more than one
-+ # wildcard per fragment.
-+ cert = {'subject': ((('commonName', 'a*b.com'),),)}
-+ ok(cert, 'axxb.com')
-+ cert = {'subject': ((('commonName', 'a*b.co*'),),)}
-+ fail(cert, 'axxb.com')
-+ cert = {'subject': ((('commonName', 'a*b*.com'),),)}
-+ with self.assertRaises(ssl.CertificateError) as cm:
-+ ssl.match_hostname(cert, 'axxbxxc.com')
-+ self.assertIn("too many wildcards", str(cm.exception))
-+
-+ def test_server_side(self):
-+ # server_hostname doesn't work for server sockets
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
-+ with closing(socket.socket()) as sock:
-+ self.assertRaises(ValueError, ctx.wrap_socket, sock, True,
-+ server_hostname="some.hostname")
-+
-+ def test_unknown_channel_binding(self):
-+ # should raise ValueError for unknown type
-+ s = socket.socket(socket.AF_INET)
-+ with closing(ssl.wrap_socket(s)) as ss:
-+ with self.assertRaises(ValueError):
-+ ss.get_channel_binding("unknown-type")
-+
-+ @unittest.skipUnless("tls-unique" in ssl.CHANNEL_BINDING_TYPES,
-+ "'tls-unique' channel binding not
available")
-+ def test_tls_unique_channel_binding(self):
-+ # unconnected should return None for known type
-+ s = socket.socket(socket.AF_INET)
-+ with closing(ssl.wrap_socket(s)) as ss:
-+ self.assertIsNone(ss.get_channel_binding("tls-unique"))
-+ # the same for server-side
-+ s = socket.socket(socket.AF_INET)
-+ with closing(ssl.wrap_socket(s, server_side=True, certfile=CERTFILE)) as ss:
-+ self.assertIsNone(ss.get_channel_binding("tls-unique"))
-+
-+ def test_get_default_verify_paths(self):
-+ paths = ssl.get_default_verify_paths()
-+ self.assertEqual(len(paths), 6)
-+ self.assertIsInstance(paths, ssl.DefaultVerifyPaths)
-+
-+ with support.EnvironmentVarGuard() as env:
-+ env["SSL_CERT_DIR"] = CAPATH
-+ env["SSL_CERT_FILE"] = CERTFILE
-+ paths = ssl.get_default_verify_paths()
-+ self.assertEqual(paths.cafile, CERTFILE)
-+ self.assertEqual(paths.capath, CAPATH)
-+
-+ @unittest.skipUnless(sys.platform == "win32", "Windows
specific")
-+ def test_enum_certificates(self):
-+ self.assertTrue(ssl.enum_certificates("CA"))
-+ self.assertTrue(ssl.enum_certificates("ROOT"))
-+
-+ self.assertRaises(TypeError, ssl.enum_certificates)
-+ self.assertRaises(WindowsError, ssl.enum_certificates, "")
-+
-+ trust_oids = set()
-+ for storename in ("CA", "ROOT"):
-+ store = ssl.enum_certificates(storename)
-+ self.assertIsInstance(store, list)
-+ for element in store:
-+ self.assertIsInstance(element, tuple)
-+ self.assertEqual(len(element), 3)
-+ cert, enc, trust = element
-+ self.assertIsInstance(cert, bytes)
-+ self.assertIn(enc, {"x509_asn", "pkcs_7_asn"})
-+ self.assertIsInstance(trust, (set, bool))
-+ if isinstance(trust, set):
-+ trust_oids.update(trust)
-+
-+ serverAuth = "1.3.6.1.5.5.7.3.1"
-+ self.assertIn(serverAuth, trust_oids)
-+
-+ @unittest.skipUnless(sys.platform == "win32", "Windows
specific")
-+ def test_enum_crls(self):
-+ self.assertTrue(ssl.enum_crls("CA"))
-+ self.assertRaises(TypeError, ssl.enum_crls)
-+ self.assertRaises(WindowsError, ssl.enum_crls, "")
-+
-+ crls = ssl.enum_crls("CA")
-+ self.assertIsInstance(crls, list)
-+ for element in crls:
-+ self.assertIsInstance(element, tuple)
-+ self.assertEqual(len(element), 2)
-+ self.assertIsInstance(element[0], bytes)
-+ self.assertIn(element[1], {"x509_asn", "pkcs_7_asn"})
-+
-+
-+ def test_asn1object(self):
-+ expected = (129, 'serverAuth', 'TLS Web Server Authentication',
-+ '1.3.6.1.5.5.7.3.1')
-+
-+ val = ssl._ASN1Object('1.3.6.1.5.5.7.3.1')
-+ self.assertEqual(val, expected)
-+ self.assertEqual(val.nid, 129)
-+ self.assertEqual(val.shortname, 'serverAuth')
-+ self.assertEqual(val.longname, 'TLS Web Server Authentication')
-+ self.assertEqual(val.oid, '1.3.6.1.5.5.7.3.1')
-+ self.assertIsInstance(val, ssl._ASN1Object)
-+ self.assertRaises(ValueError, ssl._ASN1Object, 'serverAuth')
-+
-+ val = ssl._ASN1Object.fromnid(129)
-+ self.assertEqual(val, expected)
-+ self.assertIsInstance(val, ssl._ASN1Object)
-+ self.assertRaises(ValueError, ssl._ASN1Object.fromnid, -1)
-+ with self.assertRaisesRegexp(ValueError, "unknown NID 100000"):
-+ ssl._ASN1Object.fromnid(100000)
-+ for i in range(1000):
-+ try:
-+ obj = ssl._ASN1Object.fromnid(i)
-+ except ValueError:
-+ pass
-+ else:
-+ self.assertIsInstance(obj.nid, int)
-+ self.assertIsInstance(obj.shortname, str)
-+ self.assertIsInstance(obj.longname, str)
-+ self.assertIsInstance(obj.oid, (str, type(None)))
-+
-+ val = ssl._ASN1Object.fromname('TLS Web Server Authentication')
-+ self.assertEqual(val, expected)
-+ self.assertIsInstance(val, ssl._ASN1Object)
-+ self.assertEqual(ssl._ASN1Object.fromname('serverAuth'), expected)
-+ self.assertEqual(ssl._ASN1Object.fromname('1.3.6.1.5.5.7.3.1'),
-+ expected)
-+ with self.assertRaisesRegexp(ValueError, "unknown object
'serverauth'"):
-+ ssl._ASN1Object.fromname('serverauth')
-+
-+ def test_purpose_enum(self):
-+ val = ssl._ASN1Object('1.3.6.1.5.5.7.3.1')
-+ self.assertIsInstance(ssl.Purpose.SERVER_AUTH, ssl._ASN1Object)
-+ self.assertEqual(ssl.Purpose.SERVER_AUTH, val)
-+ self.assertEqual(ssl.Purpose.SERVER_AUTH.nid, 129)
-+ self.assertEqual(ssl.Purpose.SERVER_AUTH.shortname, 'serverAuth')
-+ self.assertEqual(ssl.Purpose.SERVER_AUTH.oid,
-+ '1.3.6.1.5.5.7.3.1')
-+
-+ val = ssl._ASN1Object('1.3.6.1.5.5.7.3.2')
-+ self.assertIsInstance(ssl.Purpose.CLIENT_AUTH, ssl._ASN1Object)
-+ self.assertEqual(ssl.Purpose.CLIENT_AUTH, val)
-+ self.assertEqual(ssl.Purpose.CLIENT_AUTH.nid, 130)
-+ self.assertEqual(ssl.Purpose.CLIENT_AUTH.shortname, 'clientAuth')
-+ self.assertEqual(ssl.Purpose.CLIENT_AUTH.oid,
-+ '1.3.6.1.5.5.7.3.2')
-
- def test_unsupported_dtls(self):
- s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
-@@ -242,42 +614,606 @@ class BasicSocketTests(unittest.TestCase):
- with self.assertRaises(NotImplementedError) as cx:
- ssl.wrap_socket(s, cert_reqs=ssl.CERT_NONE)
- self.assertEqual(str(cx.exception), "only stream sockets are
supported")
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
-+ with self.assertRaises(NotImplementedError) as cx:
-+ ctx.wrap_socket(s)
-+ self.assertEqual(str(cx.exception), "only stream sockets are
supported")
-+
-+ def cert_time_ok(self, timestring, timestamp):
-+ self.assertEqual(ssl.cert_time_to_seconds(timestring), timestamp)
-+
-+ def cert_time_fail(self, timestring):
-+ with self.assertRaises(ValueError):
-+ ssl.cert_time_to_seconds(timestring)
-+
-+ @unittest.skipUnless(utc_offset(),
-+ 'local time needs to be different from UTC')
-+ def test_cert_time_to_seconds_timezone(self):
-+ # Issue #19940: ssl.cert_time_to_seconds() returns wrong
-+ # results if local timezone is not UTC
-+ self.cert_time_ok("May 9 00:00:00 2007 GMT", 1178668800.0)
-+ self.cert_time_ok("Jan 5 09:34:43 2018 GMT", 1515144883.0)
-+
-+ def test_cert_time_to_seconds(self):
-+ timestring = "Jan 5 09:34:43 2018 GMT"
-+ ts = 1515144883.0
-+ self.cert_time_ok(timestring, ts)
-+ # accept keyword parameter, assert its name
-+ self.assertEqual(ssl.cert_time_to_seconds(cert_time=timestring), ts)
-+ # accept both %e and %d (space or zero generated by strftime)
-+ self.cert_time_ok("Jan 05 09:34:43 2018 GMT", ts)
-+ # case-insensitive
-+ self.cert_time_ok("JaN 5 09:34:43 2018 GmT", ts)
-+ self.cert_time_fail("Jan 5 09:34 2018 GMT") # no seconds
-+ self.cert_time_fail("Jan 5 09:34:43 2018") # no GMT
-+ self.cert_time_fail("Jan 5 09:34:43 2018 UTC") # not GMT timezone
-+ self.cert_time_fail("Jan 35 09:34:43 2018 GMT") # invalid day
-+ self.cert_time_fail("Jon 5 09:34:43 2018 GMT") # invalid month
-+ self.cert_time_fail("Jan 5 24:00:00 2018 GMT") # invalid hour
-+ self.cert_time_fail("Jan 5 09:60:43 2018 GMT") # invalid minute
-+
-+ newyear_ts = 1230768000.0
-+ # leap seconds
-+ self.cert_time_ok("Dec 31 23:59:60 2008 GMT", newyear_ts)
-+ # same timestamp
-+ self.cert_time_ok("Jan 1 00:00:00 2009 GMT", newyear_ts)
-+
-+ self.cert_time_ok("Jan 5 09:34:59 2018 GMT", 1515144899)
-+ # allow 60th second (even if it is not a leap second)
-+ self.cert_time_ok("Jan 5 09:34:60 2018 GMT", 1515144900)
-+ # allow 2nd leap second for compatibility with time.strptime()
-+ self.cert_time_ok("Jan 5 09:34:61 2018 GMT", 1515144901)
-+ self.cert_time_fail("Jan 5 09:34:62 2018 GMT") # invalid seconds
-+
-+ # no special treatement for the special value:
-+ # 99991231235959Z (rfc 5280)
-+ self.cert_time_ok("Dec 31 23:59:59 9999 GMT", 253402300799.0)
-+
-+ @support.run_with_locale('LC_ALL', '')
-+ def test_cert_time_to_seconds_locale(self):
-+ # `cert_time_to_seconds()` should be locale independent
-+
-+ def local_february_name():
-+ return time.strftime('%b', (1, 2, 3, 4, 5, 6, 0, 0, 0))
-+
-+ if local_february_name().lower() == 'feb':
-+ self.skipTest("locale-specific month name needs to be "
-+ "different from C locale")
-+
-+ # locale-independent
-+ self.cert_time_ok("Feb 9 00:00:00 2007 GMT", 1170979200.0)
-+ self.cert_time_fail(local_february_name() + " 9 00:00:00 2007 GMT")
-+
-+
-+class ContextTests(unittest.TestCase):
-+
-+ @skip_if_broken_ubuntu_ssl
-+ def test_constructor(self):
-+ for protocol in PROTOCOLS:
-+ ssl.SSLContext(protocol)
-+ self.assertRaises(TypeError, ssl.SSLContext)
-+ self.assertRaises(ValueError, ssl.SSLContext, -1)
-+ self.assertRaises(ValueError, ssl.SSLContext, 42)
-+
-+ @skip_if_broken_ubuntu_ssl
-+ def test_protocol(self):
-+ for proto in PROTOCOLS:
-+ ctx = ssl.SSLContext(proto)
-+ self.assertEqual(ctx.protocol, proto)
-+
-+ def test_ciphers(self):
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ ctx.set_ciphers("ALL")
-+ ctx.set_ciphers("DEFAULT")
-+ with self.assertRaisesRegexp(ssl.SSLError, "No cipher can be
selected"):
-+ ctx.set_ciphers("^$:,;?*'dorothyx")
-+
-+ @skip_if_broken_ubuntu_ssl
-+ def test_options(self):
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ # OP_ALL | OP_NO_SSLv2 is the default value
-+ self.assertEqual(ssl.OP_ALL | ssl.OP_NO_SSLv2,
-+ ctx.options)
-+ ctx.options |= ssl.OP_NO_SSLv3
-+ self.assertEqual(ssl.OP_ALL | ssl.OP_NO_SSLv2 | ssl.OP_NO_SSLv3,
-+ ctx.options)
-+ if can_clear_options():
-+ ctx.options = (ctx.options & ~ssl.OP_NO_SSLv2) | ssl.OP_NO_TLSv1
-+ self.assertEqual(ssl.OP_ALL | ssl.OP_NO_TLSv1 | ssl.OP_NO_SSLv3,
-+ ctx.options)
-+ ctx.options = 0
-+ self.assertEqual(0, ctx.options)
-+ else:
-+ with self.assertRaises(ValueError):
-+ ctx.options = 0
-+
-+ def test_verify_mode(self):
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ # Default value
-+ self.assertEqual(ctx.verify_mode, ssl.CERT_NONE)
-+ ctx.verify_mode = ssl.CERT_OPTIONAL
-+ self.assertEqual(ctx.verify_mode, ssl.CERT_OPTIONAL)
-+ ctx.verify_mode = ssl.CERT_REQUIRED
-+ self.assertEqual(ctx.verify_mode, ssl.CERT_REQUIRED)
-+ ctx.verify_mode = ssl.CERT_NONE
-+ self.assertEqual(ctx.verify_mode, ssl.CERT_NONE)
-+ with self.assertRaises(TypeError):
-+ ctx.verify_mode = None
-+ with self.assertRaises(ValueError):
-+ ctx.verify_mode = 42
-+
-+ @unittest.skipUnless(have_verify_flags(),
-+ "verify_flags need OpenSSL > 0.9.8")
-+ def test_verify_flags(self):
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ # default value by OpenSSL
-+ self.assertEqual(ctx.verify_flags, ssl.VERIFY_DEFAULT)
-+ ctx.verify_flags = ssl.VERIFY_CRL_CHECK_LEAF
-+ self.assertEqual(ctx.verify_flags, ssl.VERIFY_CRL_CHECK_LEAF)
-+ ctx.verify_flags = ssl.VERIFY_CRL_CHECK_CHAIN
-+ self.assertEqual(ctx.verify_flags, ssl.VERIFY_CRL_CHECK_CHAIN)
-+ ctx.verify_flags = ssl.VERIFY_DEFAULT
-+ self.assertEqual(ctx.verify_flags, ssl.VERIFY_DEFAULT)
-+ # supports any value
-+ ctx.verify_flags = ssl.VERIFY_CRL_CHECK_LEAF | ssl.VERIFY_X509_STRICT
-+ self.assertEqual(ctx.verify_flags,
-+ ssl.VERIFY_CRL_CHECK_LEAF | ssl.VERIFY_X509_STRICT)
-+ with self.assertRaises(TypeError):
-+ ctx.verify_flags = None
-+
-+ def test_load_cert_chain(self):
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ # Combined key and cert in a single file
-+ ctx.load_cert_chain(CERTFILE)
-+ ctx.load_cert_chain(CERTFILE, keyfile=CERTFILE)
-+ self.assertRaises(TypeError, ctx.load_cert_chain, keyfile=CERTFILE)
-+ with self.assertRaises(IOError) as cm:
-+ ctx.load_cert_chain(WRONGCERT)
-+ self.assertEqual(cm.exception.errno, errno.ENOENT)
-+ with self.assertRaisesRegexp(ssl.SSLError, "PEM lib"):
-+ ctx.load_cert_chain(BADCERT)
-+ with self.assertRaisesRegexp(ssl.SSLError, "PEM lib"):
-+ ctx.load_cert_chain(EMPTYCERT)
-+ # Separate key and cert
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ ctx.load_cert_chain(ONLYCERT, ONLYKEY)
-+ ctx.load_cert_chain(certfile=ONLYCERT, keyfile=ONLYKEY)
-+ ctx.load_cert_chain(certfile=BYTES_ONLYCERT, keyfile=BYTES_ONLYKEY)
-+ with self.assertRaisesRegexp(ssl.SSLError, "PEM lib"):
-+ ctx.load_cert_chain(ONLYCERT)
-+ with self.assertRaisesRegexp(ssl.SSLError, "PEM lib"):
-+ ctx.load_cert_chain(ONLYKEY)
-+ with self.assertRaisesRegexp(ssl.SSLError, "PEM lib"):
-+ ctx.load_cert_chain(certfile=ONLYKEY, keyfile=ONLYCERT)
-+ # Mismatching key and cert
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ with self.assertRaisesRegexp(ssl.SSLError, "key values mismatch"):
-+ ctx.load_cert_chain(SVN_PYTHON_ORG_ROOT_CERT, ONLYKEY)
-+ # Password protected key and cert
-+ ctx.load_cert_chain(CERTFILE_PROTECTED, password=KEY_PASSWORD)
-+ ctx.load_cert_chain(CERTFILE_PROTECTED, password=KEY_PASSWORD.encode())
-+ ctx.load_cert_chain(CERTFILE_PROTECTED,
-+ password=bytearray(KEY_PASSWORD.encode()))
-+ ctx.load_cert_chain(ONLYCERT, ONLYKEY_PROTECTED, KEY_PASSWORD)
-+ ctx.load_cert_chain(ONLYCERT, ONLYKEY_PROTECTED, KEY_PASSWORD.encode())
-+ ctx.load_cert_chain(ONLYCERT, ONLYKEY_PROTECTED,
-+ bytearray(KEY_PASSWORD.encode()))
-+ with self.assertRaisesRegexp(TypeError, "should be a string"):
-+ ctx.load_cert_chain(CERTFILE_PROTECTED, password=True)
-+ with self.assertRaises(ssl.SSLError):
-+ ctx.load_cert_chain(CERTFILE_PROTECTED, password="badpass")
-+ with self.assertRaisesRegexp(ValueError, "cannot be longer"):
-+ # openssl has a fixed limit on the password buffer.
-+ # PEM_BUFSIZE is generally set to 1kb.
-+ # Return a string larger than this.
-+ ctx.load_cert_chain(CERTFILE_PROTECTED, password=b'a' * 102400)
-+ # Password callback
-+ def getpass_unicode():
-+ return KEY_PASSWORD
-+ def getpass_bytes():
-+ return KEY_PASSWORD.encode()
-+ def getpass_bytearray():
-+ return bytearray(KEY_PASSWORD.encode())
-+ def getpass_badpass():
-+ return "badpass"
-+ def getpass_huge():
-+ return b'a' * (1024 * 1024)
-+ def getpass_bad_type():
-+ return 9
-+ def getpass_exception():
-+ raise Exception('getpass error')
-+ class GetPassCallable:
-+ def __call__(self):
-+ return KEY_PASSWORD
-+ def getpass(self):
-+ return KEY_PASSWORD
-+ ctx.load_cert_chain(CERTFILE_PROTECTED, password=getpass_unicode)
-+ ctx.load_cert_chain(CERTFILE_PROTECTED, password=getpass_bytes)
-+ ctx.load_cert_chain(CERTFILE_PROTECTED, password=getpass_bytearray)
-+ ctx.load_cert_chain(CERTFILE_PROTECTED, password=GetPassCallable())
-+ ctx.load_cert_chain(CERTFILE_PROTECTED,
-+ password=GetPassCallable().getpass)
-+ with self.assertRaises(ssl.SSLError):
-+ ctx.load_cert_chain(CERTFILE_PROTECTED, password=getpass_badpass)
-+ with self.assertRaisesRegexp(ValueError, "cannot be longer"):
-+ ctx.load_cert_chain(CERTFILE_PROTECTED, password=getpass_huge)
-+ with self.assertRaisesRegexp(TypeError, "must return a string"):
-+ ctx.load_cert_chain(CERTFILE_PROTECTED, password=getpass_bad_type)
-+ with self.assertRaisesRegexp(Exception, "getpass error"):
-+ ctx.load_cert_chain(CERTFILE_PROTECTED, password=getpass_exception)
-+ # Make sure the password function isn't called if it isn't needed
-+ ctx.load_cert_chain(CERTFILE, password=getpass_exception)
-+
-+ def test_load_verify_locations(self):
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ ctx.load_verify_locations(CERTFILE)
-+ ctx.load_verify_locations(cafile=CERTFILE, capath=None)
-+ ctx.load_verify_locations(BYTES_CERTFILE)
-+ ctx.load_verify_locations(cafile=BYTES_CERTFILE, capath=None)
-+ self.assertRaises(TypeError, ctx.load_verify_locations)
-+ self.assertRaises(TypeError, ctx.load_verify_locations, None, None, None)
-+ with self.assertRaises(IOError) as cm:
-+ ctx.load_verify_locations(WRONGCERT)
-+ self.assertEqual(cm.exception.errno, errno.ENOENT)
-+ with self.assertRaisesRegexp(ssl.SSLError, "PEM lib"):
-+ ctx.load_verify_locations(BADCERT)
-+ ctx.load_verify_locations(CERTFILE, CAPATH)
-+ ctx.load_verify_locations(CERTFILE, capath=BYTES_CAPATH)
-+
-+ # Issue #10989: crash if the second argument type is invalid
-+ self.assertRaises(TypeError, ctx.load_verify_locations, None, True)
-+
-+ def test_load_verify_cadata(self):
-+ # test cadata
-+ with open(CAFILE_CACERT) as f:
-+ cacert_pem = f.read().decode("ascii")
-+ cacert_der = ssl.PEM_cert_to_DER_cert(cacert_pem)
-+ with open(CAFILE_NEURONIO) as f:
-+ neuronio_pem = f.read().decode("ascii")
-+ neuronio_der = ssl.PEM_cert_to_DER_cert(neuronio_pem)
-+
-+ # test PEM
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ self.assertEqual(ctx.cert_store_stats()["x509_ca"], 0)
-+ ctx.load_verify_locations(cadata=cacert_pem)
-+ self.assertEqual(ctx.cert_store_stats()["x509_ca"], 1)
-+ ctx.load_verify_locations(cadata=neuronio_pem)
-+ self.assertEqual(ctx.cert_store_stats()["x509_ca"], 2)
-+ # cert already in hash table
-+ ctx.load_verify_locations(cadata=neuronio_pem)
-+ self.assertEqual(ctx.cert_store_stats()["x509_ca"], 2)
-+
-+ # combined
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ combined = "\n".join((cacert_pem, neuronio_pem))
-+ ctx.load_verify_locations(cadata=combined)
-+ self.assertEqual(ctx.cert_store_stats()["x509_ca"], 2)
-+
-+ # with junk around the certs
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ combined = ["head", cacert_pem, "other", neuronio_pem,
"again",
-+ neuronio_pem, "tail"]
-+ ctx.load_verify_locations(cadata="\n".join(combined))
-+ self.assertEqual(ctx.cert_store_stats()["x509_ca"], 2)
-+
-+ # test DER
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ ctx.load_verify_locations(cadata=cacert_der)
-+ ctx.load_verify_locations(cadata=neuronio_der)
-+ self.assertEqual(ctx.cert_store_stats()["x509_ca"], 2)
-+ # cert already in hash table
-+ ctx.load_verify_locations(cadata=cacert_der)
-+ self.assertEqual(ctx.cert_store_stats()["x509_ca"], 2)
-+
-+ # combined
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ combined = b"".join((cacert_der, neuronio_der))
-+ ctx.load_verify_locations(cadata=combined)
-+ self.assertEqual(ctx.cert_store_stats()["x509_ca"], 2)
-+
-+ # error cases
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ self.assertRaises(TypeError, ctx.load_verify_locations, cadata=object)
-+
-+ with self.assertRaisesRegexp(ssl.SSLError, "no start line"):
-+ ctx.load_verify_locations(cadata=u"broken")
-+ with self.assertRaisesRegexp(ssl.SSLError, "not enough data"):
-+ ctx.load_verify_locations(cadata=b"broken")
-+
-+
-+ def test_load_dh_params(self):
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ ctx.load_dh_params(DHFILE)
-+ if os.name != 'nt':
-+ ctx.load_dh_params(BYTES_DHFILE)
-+ self.assertRaises(TypeError, ctx.load_dh_params)
-+ self.assertRaises(TypeError, ctx.load_dh_params, None)
-+ with self.assertRaises(IOError) as cm:
-+ ctx.load_dh_params(WRONGCERT)
-+ self.assertEqual(cm.exception.errno, errno.ENOENT)
-+ with self.assertRaises(ssl.SSLError) as cm:
-+ ctx.load_dh_params(CERTFILE)
-+
-+ @skip_if_broken_ubuntu_ssl
-+ def test_session_stats(self):
-+ for proto in PROTOCOLS:
-+ ctx = ssl.SSLContext(proto)
-+ self.assertEqual(ctx.session_stats(), {
-+ 'number': 0,
-+ 'connect': 0,
-+ 'connect_good': 0,
-+ 'connect_renegotiate': 0,
-+ 'accept': 0,
-+ 'accept_good': 0,
-+ 'accept_renegotiate': 0,
-+ 'hits': 0,
-+ 'misses': 0,
-+ 'timeouts': 0,
-+ 'cache_full': 0,
-+ })
-+
-+ def test_set_default_verify_paths(self):
-+ # There's not much we can do to test that it acts as expected,
-+ # so just check it doesn't crash or raise an exception.
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ ctx.set_default_verify_paths()
-+
-+ @unittest.skipUnless(ssl.HAS_ECDH, "ECDH disabled on this OpenSSL build")
-+ def test_set_ecdh_curve(self):
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ ctx.set_ecdh_curve("prime256v1")
-+ ctx.set_ecdh_curve(b"prime256v1")
-+ self.assertRaises(TypeError, ctx.set_ecdh_curve)
-+ self.assertRaises(TypeError, ctx.set_ecdh_curve, None)
-+ self.assertRaises(ValueError, ctx.set_ecdh_curve, "foo")
-+ self.assertRaises(ValueError, ctx.set_ecdh_curve, b"foo")
-+
-+ @needs_sni
-+ def test_sni_callback(self):
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+
-+ # set_servername_callback expects a callable, or None
-+ self.assertRaises(TypeError, ctx.set_servername_callback)
-+ self.assertRaises(TypeError, ctx.set_servername_callback, 4)
-+ self.assertRaises(TypeError, ctx.set_servername_callback, "")
-+ self.assertRaises(TypeError, ctx.set_servername_callback, ctx)
-+
-+ def dummycallback(sock, servername, ctx):
-+ pass
-+ ctx.set_servername_callback(None)
-+ ctx.set_servername_callback(dummycallback)
-+
-+ @needs_sni
-+ def test_sni_callback_refcycle(self):
-+ # Reference cycles through the servername callback are detected
-+ # and cleared.
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ def dummycallback(sock, servername, ctx, cycle=ctx):
-+ pass
-+ ctx.set_servername_callback(dummycallback)
-+ wr = weakref.ref(ctx)
-+ del ctx, dummycallback
-+ gc.collect()
-+ self.assertIs(wr(), None)
-+
-+ def test_cert_store_stats(self):
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ self.assertEqual(ctx.cert_store_stats(),
-+ {'x509_ca': 0, 'crl': 0, 'x509': 0})
-+ ctx.load_cert_chain(CERTFILE)
-+ self.assertEqual(ctx.cert_store_stats(),
-+ {'x509_ca': 0, 'crl': 0, 'x509': 0})
-+ ctx.load_verify_locations(CERTFILE)
-+ self.assertEqual(ctx.cert_store_stats(),
-+ {'x509_ca': 0, 'crl': 0, 'x509': 1})
-+ ctx.load_verify_locations(SVN_PYTHON_ORG_ROOT_CERT)
-+ self.assertEqual(ctx.cert_store_stats(),
-+ {'x509_ca': 1, 'crl': 0, 'x509': 2})
-+
-+ def test_get_ca_certs(self):
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ self.assertEqual(ctx.get_ca_certs(), [])
-+ # CERTFILE is not flagged as X509v3 Basic Constraints: CA:TRUE
-+ ctx.load_verify_locations(CERTFILE)
-+ self.assertEqual(ctx.get_ca_certs(), [])
-+ # but SVN_PYTHON_ORG_ROOT_CERT is a CA cert
-+ ctx.load_verify_locations(SVN_PYTHON_ORG_ROOT_CERT)
-+ self.assertEqual(ctx.get_ca_certs(),
-+ [{'issuer': ((('organizationName', 'Root CA'),),
-+ (('organizationalUnitName',
'http://www.cacert.org'),),
-+ (('commonName', 'CA Cert Signing
Authority'),),
-+ (('emailAddress', 'support(a)cacert.org'),)),
-+ 'notAfter': asn1time('Mar 29 12:29:49 2033 GMT'),
-+ 'notBefore': asn1time('Mar 30 12:29:49 2003 GMT'),
-+ 'serialNumber': '00',
-+ 'crlDistributionPoints':
('https://www.cacert.org/revoke.crl',),
-+ 'subject': ((('organizationName', 'Root CA'),),
-+ (('organizationalUnitName',
'http://www.cacert.org'),),
-+ (('commonName', 'CA Cert Signing
Authority'),),
-+ (('emailAddress', 'support(a)cacert.org'),)),
-+ 'version': 3}])
-+
-+ with open(SVN_PYTHON_ORG_ROOT_CERT) as f:
-+ pem = f.read()
-+ der = ssl.PEM_cert_to_DER_cert(pem)
-+ self.assertEqual(ctx.get_ca_certs(True), [der])
-+
-+ def test_load_default_certs(self):
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ ctx.load_default_certs()
-+
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ ctx.load_default_certs(ssl.Purpose.SERVER_AUTH)
-+ ctx.load_default_certs()
-+
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ ctx.load_default_certs(ssl.Purpose.CLIENT_AUTH)
-+
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ self.assertRaises(TypeError, ctx.load_default_certs, None)
-+ self.assertRaises(TypeError, ctx.load_default_certs, 'SERVER_AUTH')
-+
-+ def test_create_default_context(self):
-+ ctx = ssl.create_default_context()
-+ self.assertEqual(ctx.protocol, ssl.PROTOCOL_SSLv23)
-+ self.assertEqual(ctx.verify_mode, ssl.CERT_REQUIRED)
-+ self.assertTrue(ctx.check_hostname)
-+ self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2)
-+ self.assertEqual(
-+ ctx.options & getattr(ssl, "OP_NO_COMPRESSION", 0),
-+ getattr(ssl, "OP_NO_COMPRESSION", 0),
-+ )
-+
-+ with open(SIGNING_CA) as f:
-+ cadata = f.read().decode("ascii")
-+ ctx = ssl.create_default_context(cafile=SIGNING_CA, capath=CAPATH,
-+ cadata=cadata)
-+ self.assertEqual(ctx.protocol, ssl.PROTOCOL_SSLv23)
-+ self.assertEqual(ctx.verify_mode, ssl.CERT_REQUIRED)
-+ self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2)
-+ self.assertEqual(
-+ ctx.options & getattr(ssl, "OP_NO_COMPRESSION", 0),
-+ getattr(ssl, "OP_NO_COMPRESSION", 0),
-+ )
-+
-+ ctx = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
-+ self.assertEqual(ctx.protocol, ssl.PROTOCOL_SSLv23)
-+ self.assertEqual(ctx.verify_mode, ssl.CERT_NONE)
-+ self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2)
-+ self.assertEqual(
-+ ctx.options & getattr(ssl, "OP_NO_COMPRESSION", 0),
-+ getattr(ssl, "OP_NO_COMPRESSION", 0),
-+ )
-+ self.assertEqual(
-+ ctx.options & getattr(ssl, "OP_SINGLE_DH_USE", 0),
-+ getattr(ssl, "OP_SINGLE_DH_USE", 0),
-+ )
-+ self.assertEqual(
-+ ctx.options & getattr(ssl, "OP_SINGLE_ECDH_USE", 0),
-+ getattr(ssl, "OP_SINGLE_ECDH_USE", 0),
-+ )
-+
-+ def test__create_stdlib_context(self):
-+ ctx = ssl._create_stdlib_context()
-+ self.assertEqual(ctx.protocol, ssl.PROTOCOL_SSLv23)
-+ self.assertEqual(ctx.verify_mode, ssl.CERT_NONE)
-+ self.assertFalse(ctx.check_hostname)
-+ self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2)
-+
-+ ctx = ssl._create_stdlib_context(ssl.PROTOCOL_TLSv1)
-+ self.assertEqual(ctx.protocol, ssl.PROTOCOL_TLSv1)
-+ self.assertEqual(ctx.verify_mode, ssl.CERT_NONE)
-+ self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2)
-+
-+ ctx = ssl._create_stdlib_context(ssl.PROTOCOL_TLSv1,
-+ cert_reqs=ssl.CERT_REQUIRED,
-+ check_hostname=True)
-+ self.assertEqual(ctx.protocol, ssl.PROTOCOL_TLSv1)
-+ self.assertEqual(ctx.verify_mode, ssl.CERT_REQUIRED)
-+ self.assertTrue(ctx.check_hostname)
-+ self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2)
-+
-+ ctx = ssl._create_stdlib_context(purpose=ssl.Purpose.CLIENT_AUTH)
-+ self.assertEqual(ctx.protocol, ssl.PROTOCOL_SSLv23)
-+ self.assertEqual(ctx.verify_mode, ssl.CERT_NONE)
-+ self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2)
-+
-+ def test_check_hostname(self):
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ self.assertFalse(ctx.check_hostname)
-+
-+ # Requires CERT_REQUIRED or CERT_OPTIONAL
-+ with self.assertRaises(ValueError):
-+ ctx.check_hostname = True
-+ ctx.verify_mode = ssl.CERT_REQUIRED
-+ self.assertFalse(ctx.check_hostname)
-+ ctx.check_hostname = True
-+ self.assertTrue(ctx.check_hostname)
-+
-+ ctx.verify_mode = ssl.CERT_OPTIONAL
-+ ctx.check_hostname = True
-+ self.assertTrue(ctx.check_hostname)
-+
-+ # Cannot set CERT_NONE with check_hostname enabled
-+ with self.assertRaises(ValueError):
-+ ctx.verify_mode = ssl.CERT_NONE
-+ ctx.check_hostname = False
-+ self.assertFalse(ctx.check_hostname)
-+
-+
-+class SSLErrorTests(unittest.TestCase):
-+
-+ def test_str(self):
-+ # The str() of a SSLError doesn't include the errno
-+ e = ssl.SSLError(1, "foo")
-+ self.assertEqual(str(e), "foo")
-+ self.assertEqual(e.errno, 1)
-+ # Same for a subclass
-+ e = ssl.SSLZeroReturnError(1, "foo")
-+ self.assertEqual(str(e), "foo")
-+ self.assertEqual(e.errno, 1)
-+
-+ def test_lib_reason(self):
-+ # Test the library and reason attributes
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ with self.assertRaises(ssl.SSLError) as cm:
-+ ctx.load_dh_params(CERTFILE)
-+ self.assertEqual(cm.exception.library, 'PEM')
-+ self.assertEqual(cm.exception.reason, 'NO_START_LINE')
-+ s = str(cm.exception)
-+ self.assertTrue(s.startswith("[PEM: NO_START_LINE] no start line"),
s)
-+
-+ def test_subclass(self):
-+ # Check that the appropriate SSLError subclass is raised
-+ # (this only tests one of them)
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ with closing(socket.socket()) as s:
-+ s.bind(("127.0.0.1", 0))
-+ s.listen(5)
-+ c = socket.socket()
-+ c.connect(s.getsockname())
-+ c.setblocking(False)
-+ with closing(ctx.wrap_socket(c, False, do_handshake_on_connect=False)) as
c:
-+ with self.assertRaises(ssl.SSLWantReadError) as cm:
-+ c.do_handshake()
-+ s = str(cm.exception)
-+ self.assertTrue(s.startswith("The operation did not complete
(read)"), s)
-+ # For compatibility
-+ self.assertEqual(cm.exception.errno, ssl.SSL_ERROR_WANT_READ)
-
-
- class NetworkedTests(unittest.TestCase):
-
- def test_connect(self):
-- with test_support.transient_internet("svn.python.org"):
-+ with support.transient_internet("svn.python.org"):
- s = ssl.wrap_socket(socket.socket(socket.AF_INET),
- cert_reqs=ssl.CERT_NONE)
-- s.connect(("svn.python.org", 443))
-- c = s.getpeercert()
-- if c:
-- self.fail("Peer cert %s shouldn't be here!")
-- s.close()
--
-- # this should fail because we have no verification certs
-- s = ssl.wrap_socket(socket.socket(socket.AF_INET),
-- cert_reqs=ssl.CERT_REQUIRED)
- try:
- s.connect(("svn.python.org", 443))
-- except ssl.SSLError:
-- pass
-+ self.assertEqual({}, s.getpeercert())
- finally:
- s.close()
-
-+ # this should fail because we have no verification certs
-+ s = ssl.wrap_socket(socket.socket(socket.AF_INET),
-+ cert_reqs=ssl.CERT_REQUIRED)
-+ self.assertRaisesRegexp(ssl.SSLError, "certificate verify
failed",
-+ s.connect, ("svn.python.org", 443))
-+ s.close()
-+
- # this should succeed because we specify the root cert
- s = ssl.wrap_socket(socket.socket(socket.AF_INET),
- cert_reqs=ssl.CERT_REQUIRED,
- ca_certs=SVN_PYTHON_ORG_ROOT_CERT)
- try:
- s.connect(("svn.python.org", 443))
-+ self.assertTrue(s.getpeercert())
- finally:
- s.close()
-
- def test_connect_ex(self):
- # Issue #11326: check connect_ex() implementation
-- with test_support.transient_internet("svn.python.org"):
-+ with support.transient_internet("svn.python.org"):
- s = ssl.wrap_socket(socket.socket(socket.AF_INET),
- cert_reqs=ssl.CERT_REQUIRED,
- ca_certs=SVN_PYTHON_ORG_ROOT_CERT)
-@@ -290,7 +1226,7 @@ class NetworkedTests(unittest.TestCase):
- def test_non_blocking_connect_ex(self):
- # Issue #11326: non-blocking connect_ex() should allow handshake
- # to proceed after the socket gets ready.
-- with test_support.transient_internet("svn.python.org"):
-+ with support.transient_internet("svn.python.org"):
- s = ssl.wrap_socket(socket.socket(socket.AF_INET),
- cert_reqs=ssl.CERT_REQUIRED,
- ca_certs=SVN_PYTHON_ORG_ROOT_CERT,
-@@ -307,13 +1243,10 @@ class NetworkedTests(unittest.TestCase):
- try:
- s.do_handshake()
- break
-- except ssl.SSLError as err:
-- if err.args[0] == ssl.SSL_ERROR_WANT_READ:
-- select.select([s], [], [], 5.0)
-- elif err.args[0] == ssl.SSL_ERROR_WANT_WRITE:
-- select.select([], [s], [], 5.0)
-- else:
-- raise
-+ except ssl.SSLWantReadError:
-+ select.select([s], [], [], 5.0)
-+ except ssl.SSLWantWriteError:
-+ select.select([], [s], [], 5.0)
- # SSL established
- self.assertTrue(s.getpeercert())
- finally:
-@@ -322,7 +1255,7 @@ class NetworkedTests(unittest.TestCase):
- def test_timeout_connect_ex(self):
- # Issue #12065: on a timeout, connect_ex() should return the original
- # errno (mimicking the behaviour of non-SSL sockets).
-- with test_support.transient_internet("svn.python.org"):
-+ with support.transient_internet("svn.python.org"):
- s = ssl.wrap_socket(socket.socket(socket.AF_INET),
- cert_reqs=ssl.CERT_REQUIRED,
- ca_certs=SVN_PYTHON_ORG_ROOT_CERT,
-@@ -337,22 +1270,109 @@ class NetworkedTests(unittest.TestCase):
- s.close()
-
- def test_connect_ex_error(self):
-- with test_support.transient_internet("svn.python.org"):
-+ with support.transient_internet("svn.python.org"):
- s = ssl.wrap_socket(socket.socket(socket.AF_INET),
- cert_reqs=ssl.CERT_REQUIRED,
- ca_certs=SVN_PYTHON_ORG_ROOT_CERT)
- try:
-- self.assertEqual(errno.ECONNREFUSED,
-- s.connect_ex(("svn.python.org", 444)))
-+ rc = s.connect_ex(("svn.python.org", 444))
-+ # Issue #19919: Windows machines or VMs hosted on Windows
-+ # machines sometimes return EWOULDBLOCK.
-+ self.assertIn(rc, (errno.ECONNREFUSED, errno.EWOULDBLOCK))
-+ finally:
-+ s.close()
-+
-+ def test_connect_with_context(self):
-+ with support.transient_internet("svn.python.org"):
-+ # Same as test_connect, but with a separately created context
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
-+ s = ctx.wrap_socket(socket.socket(socket.AF_INET))
-+ s.connect(("svn.python.org", 443))
-+ try:
-+ self.assertEqual({}, s.getpeercert())
-+ finally:
-+ s.close()
-+ # Same with a server hostname
-+ s = ctx.wrap_socket(socket.socket(socket.AF_INET),
-+ server_hostname="svn.python.org")
-+ if ssl.HAS_SNI:
-+ s.connect(("svn.python.org", 443))
-+ s.close()
-+ else:
-+ self.assertRaises(ValueError, s.connect, ("svn.python.org",
443))
-+ # This should fail because we have no verification certs
-+ ctx.verify_mode = ssl.CERT_REQUIRED
-+ s = ctx.wrap_socket(socket.socket(socket.AF_INET))
-+ self.assertRaisesRegexp(ssl.SSLError, "certificate verify
failed",
-+ s.connect, ("svn.python.org", 443))
-+ s.close()
-+ # This should succeed because we specify the root cert
-+ ctx.load_verify_locations(SVN_PYTHON_ORG_ROOT_CERT)
-+ s = ctx.wrap_socket(socket.socket(socket.AF_INET))
-+ s.connect(("svn.python.org", 443))
-+ try:
-+ cert = s.getpeercert()
-+ self.assertTrue(cert)
-+ finally:
-+ s.close()
-+
-+ def test_connect_capath(self):
-+ # Verify server certificates using the `capath` argument
-+ # NOTE: the subject hashing algorithm has been changed between
-+ # OpenSSL 0.9.8n and 1.0.0, as a result the capath directory must
-+ # contain both versions of each certificate (same content, different
-+ # filename) for this test to be portable across OpenSSL releases.
-+ with support.transient_internet("svn.python.org"):
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
-+ ctx.verify_mode = ssl.CERT_REQUIRED
-+ ctx.load_verify_locations(capath=CAPATH)
-+ s = ctx.wrap_socket(socket.socket(socket.AF_INET))
-+ s.connect(("svn.python.org", 443))
-+ try:
-+ cert = s.getpeercert()
-+ self.assertTrue(cert)
-+ finally:
-+ s.close()
-+ # Same with a bytes `capath` argument
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
-+ ctx.verify_mode = ssl.CERT_REQUIRED
-+ ctx.load_verify_locations(capath=BYTES_CAPATH)
-+ s = ctx.wrap_socket(socket.socket(socket.AF_INET))
-+ s.connect(("svn.python.org", 443))
-+ try:
-+ cert = s.getpeercert()
-+ self.assertTrue(cert)
- finally:
- s.close()
-
-+ def test_connect_cadata(self):
-+ with open(CAFILE_CACERT) as f:
-+ pem = f.read().decode('ascii')
-+ der = ssl.PEM_cert_to_DER_cert(pem)
-+ with support.transient_internet("svn.python.org"):
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
-+ ctx.verify_mode = ssl.CERT_REQUIRED
-+ ctx.load_verify_locations(cadata=pem)
-+ with closing(ctx.wrap_socket(socket.socket(socket.AF_INET))) as s:
-+ s.connect(("svn.python.org", 443))
-+ cert = s.getpeercert()
-+ self.assertTrue(cert)
-+
-+ # same with DER
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
-+ ctx.verify_mode = ssl.CERT_REQUIRED
-+ ctx.load_verify_locations(cadata=der)
-+ with closing(ctx.wrap_socket(socket.socket(socket.AF_INET))) as s:
-+ s.connect(("svn.python.org", 443))
-+ cert = s.getpeercert()
-+ self.assertTrue(cert)
-+
- @unittest.skipIf(os.name == "nt", "Can't use a socket as a file
under Windows")
- def test_makefile_close(self):
- # Issue #5238: creating a file-like object with makefile() shouldn't
- # delay closing the underlying "real socket" (here tested with its
- # file descriptor, hence skipping the test under Windows).
-- with test_support.transient_internet("svn.python.org"):
-+ with support.transient_internet("svn.python.org"):
- ss = ssl.wrap_socket(socket.socket(socket.AF_INET))
- ss.connect(("svn.python.org", 443))
- fd = ss.fileno()
-@@ -368,7 +1388,7 @@ class NetworkedTests(unittest.TestCase):
- self.assertEqual(e.exception.errno, errno.EBADF)
-
- def test_non_blocking_handshake(self):
-- with test_support.transient_internet("svn.python.org"):
-+ with support.transient_internet("svn.python.org"):
- s = socket.socket(socket.AF_INET)
- s.connect(("svn.python.org", 443))
- s.setblocking(False)
-@@ -381,41 +1401,57 @@ class NetworkedTests(unittest.TestCase):
- count += 1
- s.do_handshake()
- break
-- except ssl.SSLError, err:
-- if err.args[0] == ssl.SSL_ERROR_WANT_READ:
-- select.select([s], [], [])
-- elif err.args[0] == ssl.SSL_ERROR_WANT_WRITE:
-- select.select([], [s], [])
-- else:
-- raise
-+ except ssl.SSLWantReadError:
-+ select.select([s], [], [])
-+ except ssl.SSLWantWriteError:
-+ select.select([], [s], [])
- s.close()
-- if test_support.verbose:
-+ if support.verbose:
- sys.stdout.write("\nNeeded %d calls to do_handshake() to establish
session.\n" % count)
-
- def test_get_server_certificate(self):
-- with test_support.transient_internet("svn.python.org"):
-- pem = ssl.get_server_certificate(("svn.python.org", 443),
-- ssl.PROTOCOL_SSLv23)
-- if not pem:
-- self.fail("No server certificate on svn.python.org:443!")
-+ def _test_get_server_certificate(host, port, cert=None):
-+ with support.transient_internet(host):
-+ pem = ssl.get_server_certificate((host, port))
-+ if not pem:
-+ self.fail("No server certificate on %s:%s!" % (host,
port))
-
-- try:
-- pem = ssl.get_server_certificate(("svn.python.org", 443),
-- ssl.PROTOCOL_SSLv23,
-- ca_certs=CERTFILE)
-- except ssl.SSLError:
-- #should fail
-- pass
-- else:
-- self.fail("Got server certificate %s for svn.python.org!" %
pem)
-+ try:
-+ pem = ssl.get_server_certificate((host, port),
-+ ca_certs=CERTFILE)
-+ except ssl.SSLError as x:
-+ #should fail
-+ if support.verbose:
-+ sys.stdout.write("%s\n" % x)
-+ else:
-+ self.fail("Got server certificate %s for %s:%s!" % (pem,
host, port))
-+
-+ pem = ssl.get_server_certificate((host, port),
-+ ca_certs=cert)
-+ if not pem:
-+ self.fail("No server certificate on %s:%s!" % (host,
port))
-+ if support.verbose:
-+ sys.stdout.write("\nVerified certificate for %s:%s
is\n%s\n" % (host, port ,pem))
-+
-+ _test_get_server_certificate('svn.python.org', 443,
SVN_PYTHON_ORG_ROOT_CERT)
-+ if support.IPV6_ENABLED:
-+ _test_get_server_certificate('ipv6.google.com', 443)
-
-- pem = ssl.get_server_certificate(("svn.python.org", 443),
-- ssl.PROTOCOL_SSLv23,
-- ca_certs=SVN_PYTHON_ORG_ROOT_CERT)
-- if not pem:
-- self.fail("No server certificate on svn.python.org:443!")
-- if test_support.verbose:
-- sys.stdout.write("\nVerified certificate for svn.python.org:443
is\n%s\n" % pem)
-+ def test_ciphers(self):
-+ remote = ("svn.python.org", 443)
-+ with support.transient_internet(remote[0]):
-+ with closing(ssl.wrap_socket(socket.socket(socket.AF_INET),
-+ cert_reqs=ssl.CERT_NONE,
ciphers="ALL")) as s:
-+ s.connect(remote)
-+ with closing(ssl.wrap_socket(socket.socket(socket.AF_INET),
-+ cert_reqs=ssl.CERT_NONE,
ciphers="DEFAULT")) as s:
-+ s.connect(remote)
-+ # Error checking can happen at instantiation or when connecting
-+ with self.assertRaisesRegexp(ssl.SSLError, "No cipher can be
selected"):
-+ with closing(socket.socket(socket.AF_INET)) as sock:
-+ s = ssl.wrap_socket(sock,
-+ cert_reqs=ssl.CERT_NONE,
ciphers="^$:,;?*'dorothyx")
-+ s.connect(remote)
-
- def test_algorithms(self):
- # Issue #8484: all algorithms should be available when verifying a
-@@ -423,17 +1459,21 @@ class NetworkedTests(unittest.TestCase):
- # SHA256 was added in OpenSSL 0.9.8
- if ssl.OPENSSL_VERSION_INFO < (0, 9, 8, 0, 15):
- self.skipTest("SHA256 not available on %r" % ssl.OPENSSL_VERSION)
-- self.skipTest("remote host needs SNI, only available on Python 3.2+")
-- # NOTE:
https://sha2.hboeck.de is another possible test host
-+ #
sha256.tbs-internet.com needs SNI to use the correct certificate
-+ if not ssl.HAS_SNI:
-+ self.skipTest("SNI needed for this test")
-+ #
https://sha2.hboeck.de/ was used until 2011-01-08 (no route to host)
- remote = ("sha256.tbs-internet.com", 443)
- sha256_cert = os.path.join(os.path.dirname(__file__), "sha256.pem")
-- with test_support.transient_internet("sha256.tbs-internet.com"):
-- s = ssl.wrap_socket(socket.socket(socket.AF_INET),
-- cert_reqs=ssl.CERT_REQUIRED,
-- ca_certs=sha256_cert,)
-+ with support.transient_internet("sha256.tbs-internet.com"):
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ ctx.verify_mode = ssl.CERT_REQUIRED
-+ ctx.load_verify_locations(sha256_cert)
-+ s = ctx.wrap_socket(socket.socket(socket.AF_INET),
-+ server_hostname="sha256.tbs-internet.com")
- try:
- s.connect(remote)
-- if test_support.verbose:
-+ if support.verbose:
- sys.stdout.write("\nCipher with %r is %r\n" %
- (remote, s.cipher()))
- sys.stdout.write("Certificate is:\n%s\n" %
-@@ -441,6 +1481,36 @@ class NetworkedTests(unittest.TestCase):
- finally:
- s.close()
-
-+ def test_get_ca_certs_capath(self):
-+ # capath certs are loaded on request
-+ with support.transient_internet("svn.python.org"):
-+ ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
-+ ctx.verify_mode = ssl.CERT_REQUIRED
-+ ctx.load_verify_locations(capath=CAPATH)
-+ self.assertEqual(ctx.get_ca_certs(), [])
-+ s = ctx.wrap_socket(socket.socket(socket.AF_INET))
-+ s.connect(("svn.python.org", 443))
-+ try:
-+ cert = s.getpeercert()
-+ self.assertTrue(cert)
-+ finally:
-+ s.close()
-+ self.assertEqual(len(ctx.get_ca_certs()), 1)
-+
-+ @needs_sni
-+ def test_context_setget(self):
-+ # Check that the context of a connected socket can be replaced.
-+ with support.transient_internet("svn.python.org"):
-+ ctx1 = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ ctx2 = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
-+ s = socket.socket(socket.AF_INET)
-+ with closing(ctx1.wrap_socket(s)) as ss:
-+ ss.connect(("svn.python.org", 443))
-+ self.assertIs(ss.context, ctx1)
-+ self.assertIs(ss._sslobj.context, ctx1)
-+ ss.context = ctx2
-+ self.assertIs(ss.context, ctx2)
-+ self.assertIs(ss._sslobj.context, ctx2)
-
- try:
- import threading
-@@ -449,6 +1519,8 @@ except ImportError:
- else:
- _have_threads = True
-
-+ from test.ssl_servers import make_https_server
-+
- class ThreadedEchoServer(threading.Thread):
-
- class ConnectionHandler(threading.Thread):
-@@ -457,48 +1529,51 @@ else:
- with and without the SSL wrapper around the socket connection, so
- that we can test the STARTTLS functionality."""
-
-- def __init__(self, server, connsock):
-+ def __init__(self, server, connsock, addr):
- self.server = server
- self.running = False
- self.sock = connsock
-+ self.addr = addr
- self.sock.setblocking(1)
- self.sslconn = None
- threading.Thread.__init__(self)
- self.daemon = True
-
-- def show_conn_details(self):
-- if self.server.certreqs == ssl.CERT_REQUIRED:
-- cert = self.sslconn.getpeercert()
-- if test_support.verbose and self.server.chatty:
-- sys.stdout.write(" client cert is " +
pprint.pformat(cert) + "\n")
-- cert_binary = self.sslconn.getpeercert(True)
-- if test_support.verbose and self.server.chatty:
-- sys.stdout.write(" cert binary is " +
str(len(cert_binary)) + " bytes\n")
-- cipher = self.sslconn.cipher()
-- if test_support.verbose and self.server.chatty:
-- sys.stdout.write(" server: connection cipher is now " +
str(cipher) + "\n")
--
- def wrap_conn(self):
- try:
-- self.sslconn = ssl.wrap_socket(self.sock, server_side=True,
-- certfile=self.server.certificate,
-- ssl_version=self.server.protocol,
-- ca_certs=self.server.cacerts,
-- cert_reqs=self.server.certreqs,
-- ciphers=self.server.ciphers)
-- except ssl.SSLError as e:
-+ self.sslconn = self.server.context.wrap_socket(
-+ self.sock, server_side=True)
-+
self.server.selected_protocols.append(self.sslconn.selected_npn_protocol())
-+ except socket.error as e:
-+ # We treat ConnectionResetError as though it were an
-+ # SSLError - OpenSSL on Ubuntu abruptly closes the
-+ # connection when asked to use an unsupported protocol.
-+ #
- # XXX Various errors can have happened here, for example
- # a mismatching protocol version, an invalid certificate,
- # or a low-level bug. This should be made more discriminating.
-+ if not isinstance(e, ssl.SSLError) and e.errno != errno.ECONNRESET:
-+ raise
- self.server.conn_errors.append(e)
- if self.server.chatty:
-- handle_error("\n server: bad connection attempt from
" +
-- str(self.sock.getpeername()) + ":\n")
-- self.close()
-+ handle_error("\n server: bad connection attempt from
" + repr(self.addr) + ":\n")
- self.running = False
- self.server.stop()
-+ self.close()
- return False
- else:
-+ if self.server.context.verify_mode == ssl.CERT_REQUIRED:
-+ cert = self.sslconn.getpeercert()
-+ if support.verbose and self.server.chatty:
-+ sys.stdout.write(" client cert is " +
pprint.pformat(cert) + "\n")
-+ cert_binary = self.sslconn.getpeercert(True)
-+ if support.verbose and self.server.chatty:
-+ sys.stdout.write(" cert binary is " +
str(len(cert_binary)) + " bytes\n")
-+ cipher = self.sslconn.cipher()
-+ if support.verbose and self.server.chatty:
-+ sys.stdout.write(" server: connection cipher is now "
+ str(cipher) + "\n")
-+ sys.stdout.write(" server: selected protocol is now "
-+ + str(self.sslconn.selected_npn_protocol()) +
"\n")
- return True
-
- def read(self):
-@@ -517,48 +1592,53 @@ else:
- if self.sslconn:
- self.sslconn.close()
- else:
-- self.sock._sock.close()
-+ self.sock.close()
-
- def run(self):
- self.running = True
- if not self.server.starttls_server:
-- if isinstance(self.sock, ssl.SSLSocket):
-- self.sslconn = self.sock
-- elif not self.wrap_conn():
-+ if not self.wrap_conn():
- return
-- self.show_conn_details()
- while self.running:
- try:
- msg = self.read()
-- if not msg:
-+ stripped = msg.strip()
-+ if not stripped:
- # eof, so quit this handler
- self.running = False
- self.close()
-- elif msg.strip() == 'over':
-- if test_support.verbose and self.server.connectionchatty:
-+ elif stripped == b'over':
-+ if support.verbose and self.server.connectionchatty:
- sys.stdout.write(" server: client closed
connection\n")
- self.close()
- return
-- elif self.server.starttls_server and msg.strip() ==
'STARTTLS':
-- if test_support.verbose and self.server.connectionchatty:
-+ elif (self.server.starttls_server and
-+ stripped == b'STARTTLS'):
-+ if support.verbose and self.server.connectionchatty:
- sys.stdout.write(" server: read STARTTLS from
client, sending OK...\n")
-- self.write("OK\n")
-+ self.write(b"OK\n")
- if not self.wrap_conn():
- return
-- elif self.server.starttls_server and self.sslconn and
msg.strip() == 'ENDTLS':
-- if test_support.verbose and self.server.connectionchatty:
-+ elif (self.server.starttls_server and self.sslconn
-+ and stripped == b'ENDTLS'):
-+ if support.verbose and self.server.connectionchatty:
- sys.stdout.write(" server: read ENDTLS from client,
sending OK...\n")
-- self.write("OK\n")
-- self.sslconn.unwrap()
-+ self.write(b"OK\n")
-+ self.sock = self.sslconn.unwrap()
- self.sslconn = None
-- if test_support.verbose and self.server.connectionchatty:
-+ if support.verbose and self.server.connectionchatty:
- sys.stdout.write(" server: connection is now
unencrypted...\n")
-+ elif stripped == b'CB tls-unique':
-+ if support.verbose and self.server.connectionchatty:
-+ sys.stdout.write(" server: read CB tls-unique from
client, sending our CB data...\n")
-+ data =
self.sslconn.get_channel_binding("tls-unique")
-+ self.write(repr(data).encode("us-ascii") +
b"\n")
- else:
-- if (test_support.verbose and
-+ if (support.verbose and
- self.server.connectionchatty):
- ctype = (self.sslconn and "encrypted") or
"unencrypted"
-- sys.stdout.write(" server: read %s (%s), sending
back %s (%s)...\n"
-- % (repr(msg), ctype, repr(msg.lower()),
ctype))
-+ sys.stdout.write(" server: read %r (%s), sending
back %r (%s)...\n"
-+ % (msg, ctype, msg.lower(), ctype))
- self.write(msg.lower())
- except ssl.SSLError:
- if self.server.chatty:
-@@ -569,36 +1649,34 @@ else:
- # harness, we want to stop the server
- self.server.stop()
-
-- def __init__(self, certificate, ssl_version=None,
-+ def __init__(self, certificate=None, ssl_version=None,
- certreqs=None, cacerts=None,
- chatty=True, connectionchatty=False, starttls_server=False,
-- wrap_accepting_socket=False, ciphers=None):
--
-- if ssl_version is None:
-- ssl_version = ssl.PROTOCOL_TLSv1
-- if certreqs is None:
-- certreqs = ssl.CERT_NONE
-- self.certificate = certificate
-- self.protocol = ssl_version
-- self.certreqs = certreqs
-- self.cacerts = cacerts
-- self.ciphers = ciphers
-+ npn_protocols=None, ciphers=None, context=None):
-+ if context:
-+ self.context = context
-+ else:
-+ self.context = ssl.SSLContext(ssl_version
-+ if ssl_version is not None
-+ else ssl.PROTOCOL_TLSv1)
-+ self.context.verify_mode = (certreqs if certreqs is not None
-+ else ssl.CERT_NONE)
-+ if cacerts:
-+ self.context.load_verify_locations(cacerts)
-+ if certificate:
-+ self.context.load_cert_chain(certificate)
-+ if npn_protocols:
-+ self.context.set_npn_protocols(npn_protocols)
-+ if ciphers:
-+ self.context.set_ciphers(ciphers)
- self.chatty = chatty
- self.connectionchatty = connectionchatty
- self.starttls_server = starttls_server
- self.sock = socket.socket()
-+ self.port = support.bind_port(self.sock)
- self.flag = None
-- if wrap_accepting_socket:
-- self.sock = ssl.wrap_socket(self.sock, server_side=True,
-- certfile=self.certificate,
-- cert_reqs = self.certreqs,
-- ca_certs = self.cacerts,
-- ssl_version = self.protocol,
-- ciphers = self.ciphers)
-- if test_support.verbose and self.chatty:
-- sys.stdout.write(' server: wrapped server socket as %s\n' %
str(self.sock))
-- self.port = test_support.bind_port(self.sock)
- self.active = False
-+ self.selected_protocols = []
- self.conn_errors = []
- threading.Thread.__init__(self)
- self.daemon = True
-@@ -626,10 +1704,10 @@ else:
- while self.active:
- try:
- newconn, connaddr = self.sock.accept()
-- if test_support.verbose and self.chatty:
-+ if support.verbose and self.chatty:
- sys.stdout.write(' server: new connection from '
-- + str(connaddr) + '\n')
-- handler = self.ConnectionHandler(self, newconn)
-+ + repr(connaddr) + '\n')
-+ handler = self.ConnectionHandler(self, newconn, connaddr)
- handler.start()
- handler.join()
- except socket.timeout:
-@@ -648,11 +1726,12 @@ else:
- class ConnectionHandler(asyncore.dispatcher_with_send):
-
- def __init__(self, conn, certfile):
-- asyncore.dispatcher_with_send.__init__(self, conn)
- self.socket = ssl.wrap_socket(conn, server_side=True,
- certfile=certfile,
- do_handshake_on_connect=False)
-+ asyncore.dispatcher_with_send.__init__(self, self.socket)
- self._ssl_accepting = True
-+ self._do_ssl_handshake()
-
- def readable(self):
- if isinstance(self.socket, ssl.SSLSocket):
-@@ -663,12 +1742,11 @@ else:
- def _do_ssl_handshake(self):
- try:
- self.socket.do_handshake()
-- except ssl.SSLError, err:
-- if err.args[0] in (ssl.SSL_ERROR_WANT_READ,
-- ssl.SSL_ERROR_WANT_WRITE):
-- return
-- elif err.args[0] == ssl.SSL_ERROR_EOF:
-- return self.handle_close()
-+ except (ssl.SSLWantReadError, ssl.SSLWantWriteError):
-+ return
-+ except ssl.SSLEOFError:
-+ return self.handle_close()
-+ except ssl.SSLError:
- raise
- except socket.error, err:
- if err.args[0] == errno.ECONNABORTED:
-@@ -681,12 +1759,16 @@ else:
- self._do_ssl_handshake()
- else:
- data = self.recv(1024)
-- if data and data.strip() != 'over':
-+ if support.verbose:
-+ sys.stdout.write(" server: read %s from client\n"
% repr(data))
-+ if not data:
-+ self.close()
-+ else:
- self.send(data.lower())
-
- def handle_close(self):
- self.close()
-- if test_support.verbose:
-+ if support.verbose:
- sys.stdout.write(" server: closed connection %s\n" %
self.socket)
-
- def handle_error(self):
-@@ -694,14 +1776,14 @@ else:
-
- def __init__(self, certfile):
- self.certfile = certfile
-- asyncore.dispatcher.__init__(self)
-- self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
-- self.port = test_support.bind_port(self.socket)
-+ sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-+ self.port = support.bind_port(sock, '')
-+ asyncore.dispatcher.__init__(self, sock)
- self.listen(5)
-
- def handle_accept(self):
- sock_obj, addr = self.accept()
-- if test_support.verbose:
-+ if support.verbose:
- sys.stdout.write(" server: new connection from %s:%s\n"
%addr)
- self.ConnectionHandler(sock_obj, self.certfile)
-
-@@ -725,13 +1807,13 @@ else:
- return self
-
- def __exit__(self, *args):
-- if test_support.verbose:
-+ if support.verbose:
- sys.stdout.write(" cleanup: stopping server.\n")
- self.stop()
-- if test_support.verbose:
-+ if support.verbose:
- sys.stdout.write(" cleanup: joining server thread.\n")
- self.join()
-- if test_support.verbose:
-+ if support.verbose:
- sys.stdout.write(" cleanup: successfully joined.\n")
-
- def start(self, flag=None):
-@@ -743,103 +1825,15 @@ else:
- if self.flag:
- self.flag.set()
- while self.active:
-- asyncore.loop(0.05)
-+ try:
-+ asyncore.loop(1)
-+ except:
-+ pass
-
- def stop(self):
- self.active = False
- self.server.close()
-
-- class SocketServerHTTPSServer(threading.Thread):
--
-- class HTTPSServer(HTTPServer):
--
-- def __init__(self, server_address, RequestHandlerClass, certfile):
-- HTTPServer.__init__(self, server_address, RequestHandlerClass)
-- # we assume the certfile contains both private key and certificate
-- self.certfile = certfile
-- self.allow_reuse_address = True
--
-- def __str__(self):
-- return ('<%s %s:%s>' %
-- (self.__class__.__name__,
-- self.server_name,
-- self.server_port))
--
-- def get_request(self):
-- # override this to wrap socket with SSL
-- sock, addr = self.socket.accept()
-- sslconn = ssl.wrap_socket(sock, server_side=True,
-- certfile=self.certfile)
-- return sslconn, addr
--
-- class RootedHTTPRequestHandler(SimpleHTTPRequestHandler):
-- # need to override translate_path to get a known root,
-- # instead of using os.curdir, since the test could be
-- # run from anywhere
--
-- server_version = "TestHTTPS/1.0"
--
-- root = None
--
-- def translate_path(self, path):
-- """Translate a /-separated PATH to the local filename
syntax.
--
-- Components that mean special things to the local file system
-- (e.g. drive or directory names) are ignored. (XXX They should
-- probably be diagnosed.)
--
-- """
-- # abandon query parameters
-- path = urlparse.urlparse(path)[2]
-- path = os.path.normpath(urllib.unquote(path))
-- words = path.split('/')
-- words = filter(None, words)
-- path = self.root
-- for word in words:
-- drive, word = os.path.splitdrive(word)
-- head, word = os.path.split(word)
-- if word in self.root: continue
-- path = os.path.join(path, word)
-- return path
--
-- def log_message(self, format, *args):
--
-- # we override this to suppress logging unless "verbose"
--
-- if test_support.verbose:
-- sys.stdout.write(" server (%s:%d %s):\n [%s] %s\n" %
-- (self.server.server_address,
-- self.server.server_port,
-- self.request.cipher(),
-- self.log_date_time_string(),
-- format%args))
--
--
-- def __init__(self, certfile):
-- self.flag = None
-- self.RootedHTTPRequestHandler.root = os.path.split(CERTFILE)[0]
-- self.server = self.HTTPSServer(
-- (HOST, 0), self.RootedHTTPRequestHandler, certfile)
-- self.port = self.server.server_port
-- threading.Thread.__init__(self)
-- self.daemon = True
--
-- def __str__(self):
-- return "<%s %s>" % (self.__class__.__name__, self.server)
--
-- def start(self, flag=None):
-- self.flag = flag
-- threading.Thread.start(self)
--
-- def run(self):
-- if self.flag:
-- self.flag.set()
-- self.server.serve_forever(0.05)
--
-- def stop(self):
-- self.server.shutdown()
--
--
- def bad_cert_test(certfile):
- """
- Launch a server with CERT_REQUIRED, and check that trying to
-@@ -847,74 +1841,74 @@ else:
- """
- server = ThreadedEchoServer(CERTFILE,
- certreqs=ssl.CERT_REQUIRED,
-- cacerts=CERTFILE, chatty=False)
-+ cacerts=CERTFILE, chatty=False,
-+ connectionchatty=False)
- with server:
- try:
-- s = ssl.wrap_socket(socket.socket(),
-- certfile=certfile,
-- ssl_version=ssl.PROTOCOL_TLSv1)
-- s.connect((HOST, server.port))
-- except ssl.SSLError, x:
-- if test_support.verbose:
-- sys.stdout.write("\nSSLError is %s\n" % x[1])
-- except socket.error, x:
-- if test_support.verbose:
-- sys.stdout.write("\nsocket.error is %s\n" % x[1])
-+ with closing(socket.socket()) as sock:
-+ s = ssl.wrap_socket(sock,
-+ certfile=certfile,
-+ ssl_version=ssl.PROTOCOL_TLSv1)
-+ s.connect((HOST, server.port))
-+ except ssl.SSLError as x:
-+ if support.verbose:
-+ sys.stdout.write("\nSSLError is %s\n" % x.args[1])
-+ except OSError as x:
-+ if support.verbose:
-+ sys.stdout.write("\nOSError is %s\n" % x.args[1])
-+ except OSError as x:
-+ if x.errno != errno.ENOENT:
-+ raise
-+ if support.verbose:
-+ sys.stdout.write("\OSError is %s\n" % str(x))
- else:
- raise AssertionError("Use of invalid cert should have
failed!")
-
-- def server_params_test(certfile, protocol, certreqs, cacertsfile,
-- client_certfile, client_protocol=None,
indata="FOO\n",
-- ciphers=None, chatty=True, connectionchatty=False,
-- wrap_accepting_socket=False):
-+ def server_params_test(client_context, server_context, indata=b"FOO\n",
-+ chatty=True, connectionchatty=False, sni_name=None):
- """
- Launch a server, connect a client to it and try various reads
- and writes.
- """
-- server = ThreadedEchoServer(certfile,
-- certreqs=certreqs,
-- ssl_version=protocol,
-- cacerts=cacertsfile,
-- ciphers=ciphers,
-+ stats = {}
-+ server = ThreadedEchoServer(context=server_context,
- chatty=chatty,
-- connectionchatty=connectionchatty,
-- wrap_accepting_socket=wrap_accepting_socket)
-+ connectionchatty=False)
- with server:
-- # try to connect
-- if client_protocol is None:
-- client_protocol = protocol
-- s = ssl.wrap_socket(socket.socket(),
-- certfile=client_certfile,
-- ca_certs=cacertsfile,
-- ciphers=ciphers,
-- cert_reqs=certreqs,
-- ssl_version=client_protocol)
-- s.connect((HOST, server.port))
-- for arg in [indata, bytearray(indata), memoryview(indata)]:
-- if connectionchatty:
-- if test_support.verbose:
-- sys.stdout.write(
-- " client: sending %s...\n" % (repr(arg)))
-- s.write(arg)
-- outdata = s.read()
-+ with closing(client_context.wrap_socket(socket.socket(),
-+ server_hostname=sni_name)) as s:
-+ s.connect((HOST, server.port))
-+ for arg in [indata, bytearray(indata), memoryview(indata)]:
-+ if connectionchatty:
-+ if support.verbose:
-+ sys.stdout.write(
-+ " client: sending %r...\n" % indata)
-+ s.write(arg)
-+ outdata = s.read()
-+ if connectionchatty:
-+ if support.verbose:
-+ sys.stdout.write(" client: read %r\n" % outdata)
-+ if outdata != indata.lower():
-+ raise AssertionError(
-+ "bad data <<%r>> (%d) received; expected
<<%r>> (%d)\n"
-+ % (outdata[:20], len(outdata),
-+ indata[:20].lower(), len(indata)))
-+ s.write(b"over\n")
- if connectionchatty:
-- if test_support.verbose:
-- sys.stdout.write(" client: read %s\n" %
repr(outdata))
-- if outdata != indata.lower():
-- raise AssertionError(
-- "bad data <<%s>> (%d) received; expected
<<%s>> (%d)\n"
-- % (outdata[:min(len(outdata),20)], len(outdata),
-- indata[:min(len(indata),20)].lower(), len(indata)))
-- s.write("over\n")
-- if connectionchatty:
-- if test_support.verbose:
-- sys.stdout.write(" client: closing connection.\n")
-- s.close()
-+ if support.verbose:
-+ sys.stdout.write(" client: closing connection.\n")
-+ stats.update({
-+ 'compression': s.compression(),
-+ 'cipher': s.cipher(),
-+ 'peercert': s.getpeercert(),
-+ 'client_npn_protocol': s.selected_npn_protocol()
-+ })
-+ s.close()
-+ stats['server_npn_protocols'] = server.selected_protocols
-+ return stats
-
-- def try_protocol_combo(server_protocol,
-- client_protocol,
-- expect_success,
-- certsreqs=None):
-+ def try_protocol_combo(server_protocol, client_protocol, expect_success,
-+ certsreqs=None, server_options=0, client_options=0):
- if certsreqs is None:
- certsreqs = ssl.CERT_NONE
- certtype = {
-@@ -922,19 +1916,30 @@ else:
- ssl.CERT_OPTIONAL: "CERT_OPTIONAL",
- ssl.CERT_REQUIRED: "CERT_REQUIRED",
- }[certsreqs]
-- if test_support.verbose:
-+ if support.verbose:
- formatstr = (expect_success and " %s->%s %s\n") or "
{%s->%s} %s\n"
- sys.stdout.write(formatstr %
- (ssl.get_protocol_name(client_protocol),
- ssl.get_protocol_name(server_protocol),
- certtype))
-+ client_context = ssl.SSLContext(client_protocol)
-+ client_context.options |= client_options
-+ server_context = ssl.SSLContext(server_protocol)
-+ server_context.options |= server_options
-+
-+ # NOTE: we must enable "ALL" ciphers on the client, otherwise an
-+ # SSLv23 client will send an SSLv3 hello (rather than SSLv2)
-+ # starting from OpenSSL 1.0.0 (see issue #8322).
-+ if client_context.protocol == ssl.PROTOCOL_SSLv23:
-+ client_context.set_ciphers("ALL")
-+
-+ for ctx in (client_context, server_context):
-+ ctx.verify_mode = certsreqs
-+ ctx.load_cert_chain(CERTFILE)
-+ ctx.load_verify_locations(CERTFILE)
- try:
-- # NOTE: we must enable "ALL" ciphers, otherwise an SSLv23 client
-- # will send an SSLv3 hello (rather than SSLv2) starting from
-- # OpenSSL 1.0.0 (see issue #8322).
-- server_params_test(CERTFILE, server_protocol, certsreqs,
-- CERTFILE, CERTFILE, client_protocol,
-- ciphers="ALL", chatty=False)
-+ server_params_test(client_context, server_context,
-+ chatty=False, connectionchatty=False)
- # Protocol mismatch can result in either an SSLError, or a
- # "Connection reset by peer" error.
- except ssl.SSLError:
-@@ -953,75 +1958,38 @@ else:
-
- class ThreadedTests(unittest.TestCase):
-
-- def test_rude_shutdown(self):
-- """A brutal shutdown of an SSL server should raise an
IOError
-- in the client when attempting handshake.
-- """
-- listener_ready = threading.Event()
-- listener_gone = threading.Event()
--
-- s = socket.socket()
-- port = test_support.bind_port(s, HOST)
--
-- # `listener` runs in a thread. It sits in an accept() until
-- # the main thread connects. Then it rudely closes the socket,
-- # and sets Event `listener_gone` to let the main thread know
-- # the socket is gone.
-- def listener():
-- s.listen(5)
-- listener_ready.set()
-- s.accept()
-- s.close()
-- listener_gone.set()
--
-- def connector():
-- listener_ready.wait()
-- c = socket.socket()
-- c.connect((HOST, port))
-- listener_gone.wait()
-- try:
-- ssl_sock = ssl.wrap_socket(c)
-- except IOError:
-- pass
-- else:
-- self.fail('connecting to closed SSL socket should have
failed')
--
-- t = threading.Thread(target=listener)
-- t.start()
-- try:
-- connector()
-- finally:
-- t.join()
--
- @skip_if_broken_ubuntu_ssl
- def test_echo(self):
- """Basic test of an SSL client connecting to a
server"""
-- if test_support.verbose:
-+ if support.verbose:
- sys.stdout.write("\n")
-- server_params_test(CERTFILE, ssl.PROTOCOL_TLSv1, ssl.CERT_NONE,
-- CERTFILE, CERTFILE, ssl.PROTOCOL_TLSv1,
-- chatty=True, connectionchatty=True)
-+ for protocol in PROTOCOLS:
-+ context = ssl.SSLContext(protocol)
-+ context.load_cert_chain(CERTFILE)
-+ server_params_test(context, context,
-+ chatty=True, connectionchatty=True)
-
- def test_getpeercert(self):
-- if test_support.verbose:
-+ if support.verbose:
- sys.stdout.write("\n")
-- s2 = socket.socket()
-- server = ThreadedEchoServer(CERTFILE,
-- certreqs=ssl.CERT_NONE,
-- ssl_version=ssl.PROTOCOL_SSLv23,
-- cacerts=CERTFILE,
-- chatty=False)
-+ context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
-+ context.verify_mode = ssl.CERT_REQUIRED
-+ context.load_verify_locations(CERTFILE)
-+ context.load_cert_chain(CERTFILE)
-+ server = ThreadedEchoServer(context=context, chatty=False)
- with server:
-- s = ssl.wrap_socket(socket.socket(),
-- certfile=CERTFILE,
-- ca_certs=CERTFILE,
-- cert_reqs=ssl.CERT_REQUIRED,
-- ssl_version=ssl.PROTOCOL_SSLv23)
-+ s = context.wrap_socket(socket.socket(),
-+ do_handshake_on_connect=False)
- s.connect((HOST, server.port))
-+ # getpeercert() raise ValueError while the handshake isn't
-+ # done.
-+ with self.assertRaises(ValueError):
-+ s.getpeercert()
-+ s.do_handshake()
- cert = s.getpeercert()
- self.assertTrue(cert, "Can't get peer certificate.")
- cipher = s.cipher()
-- if test_support.verbose:
-+ if support.verbose:
- sys.stdout.write(pprint.pformat(cert) + '\n')
- sys.stdout.write("Connection cipher is " + str(cipher) +
'.\n')
- if 'subject' not in cert:
-@@ -1032,8 +2000,94 @@ else:
- self.fail(
- "Missing or invalid 'organizationName' field in
certificate subject; "
- "should be 'Python Software Foundation'.")
-+ self.assertIn('notBefore', cert)
-+ self.assertIn('notAfter', cert)
-+ before = ssl.cert_time_to_seconds(cert['notBefore'])
-+ after = ssl.cert_time_to_seconds(cert['notAfter'])
-+ self.assertLess(before, after)
- s.close()
-
-+ @unittest.skipUnless(have_verify_flags(),
-+ "verify_flags need OpenSSL > 0.9.8")
-+ def test_crl_check(self):
-+ if support.verbose:
-+ sys.stdout.write("\n")
-+
-+ server_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ server_context.load_cert_chain(SIGNED_CERTFILE)
-+
-+ context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ context.verify_mode = ssl.CERT_REQUIRED
-+ context.load_verify_locations(SIGNING_CA)
-+ self.assertEqual(context.verify_flags, ssl.VERIFY_DEFAULT)
-+
-+ # VERIFY_DEFAULT should pass
-+ server = ThreadedEchoServer(context=server_context, chatty=True)
-+ with server:
-+ with closing(context.wrap_socket(socket.socket())) as s:
-+ s.connect((HOST, server.port))
-+ cert = s.getpeercert()
-+ self.assertTrue(cert, "Can't get peer certificate.")
-+
-+ # VERIFY_CRL_CHECK_LEAF without a loaded CRL file fails
-+ context.verify_flags |= ssl.VERIFY_CRL_CHECK_LEAF
-+
-+ server = ThreadedEchoServer(context=server_context, chatty=True)
-+ with server:
-+ with closing(context.wrap_socket(socket.socket())) as s:
-+ with self.assertRaisesRegexp(ssl.SSLError,
-+ "certificate verify failed"):
-+ s.connect((HOST, server.port))
-+
-+ # now load a CRL file. The CRL file is signed by the CA.
-+ context.load_verify_locations(CRLFILE)
-+
-+ server = ThreadedEchoServer(context=server_context, chatty=True)
-+ with server:
-+ with closing(context.wrap_socket(socket.socket())) as s:
-+ s.connect((HOST, server.port))
-+ cert = s.getpeercert()
-+ self.assertTrue(cert, "Can't get peer certificate.")
-+
-+ @needs_sni
-+ def test_check_hostname(self):
-+ if support.verbose:
-+ sys.stdout.write("\n")
-+
-+ server_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ server_context.load_cert_chain(SIGNED_CERTFILE)
-+
-+ context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ context.verify_mode = ssl.CERT_REQUIRED
-+ context.check_hostname = True
-+ context.load_verify_locations(SIGNING_CA)
-+
-+ # correct hostname should verify
-+ server = ThreadedEchoServer(context=server_context, chatty=True)
-+ with server:
-+ with closing(context.wrap_socket(socket.socket(),
-+ server_hostname="localhost"))
as s:
-+ s.connect((HOST, server.port))
-+ cert = s.getpeercert()
-+ self.assertTrue(cert, "Can't get peer certificate.")
-+
-+ # incorrect hostname should raise an exception
-+ server = ThreadedEchoServer(context=server_context, chatty=True)
-+ with server:
-+ with closing(context.wrap_socket(socket.socket(),
-+ server_hostname="invalid"))
as s:
-+ with self.assertRaisesRegexp(ssl.CertificateError,
-+ "hostname 'invalid'
doesn't match u?'localhost'"):
-+ s.connect((HOST, server.port))
-+
-+ # missing server_hostname arg should cause an exception, too
-+ server = ThreadedEchoServer(context=server_context, chatty=True)
-+ with server:
-+ with closing(socket.socket()) as s:
-+ with self.assertRaisesRegexp(ValueError,
-+ "check_hostname requires
server_hostname"):
-+ context.wrap_socket(s)
-+
- def test_empty_cert(self):
- """Connecting with an empty cert file"""
- bad_cert_test(os.path.join(os.path.dirname(__file__) or os.curdir,
-@@ -1051,25 +2105,84 @@ else:
- bad_cert_test(os.path.join(os.path.dirname(__file__) or os.curdir,
- "badkey.pem"))
-
-+ def test_rude_shutdown(self):
-+ """A brutal shutdown of an SSL server should raise an
OSError
-+ in the client when attempting handshake.
-+ """
-+ listener_ready = threading.Event()
-+ listener_gone = threading.Event()
-+
-+ s = socket.socket()
-+ port = support.bind_port(s, HOST)
-+
-+ # `listener` runs in a thread. It sits in an accept() until
-+ # the main thread connects. Then it rudely closes the socket,
-+ # and sets Event `listener_gone` to let the main thread know
-+ # the socket is gone.
-+ def listener():
-+ s.listen(5)
-+ listener_ready.set()
-+ newsock, addr = s.accept()
-+ newsock.close()
-+ s.close()
-+ listener_gone.set()
-+
-+ def connector():
-+ listener_ready.wait()
-+ with closing(socket.socket()) as c:
-+ c.connect((HOST, port))
-+ listener_gone.wait()
-+ try:
-+ ssl_sock = ssl.wrap_socket(c)
-+ except ssl.SSLError:
-+ pass
-+ else:
-+ self.fail('connecting to closed SSL socket should have
failed')
-+
-+ t = threading.Thread(target=listener)
-+ t.start()
-+ try:
-+ connector()
-+ finally:
-+ t.join()
-+
- @skip_if_broken_ubuntu_ssl
-+ @unittest.skipUnless(hasattr(ssl, 'PROTOCOL_SSLv2'),
-+ "OpenSSL is compiled without SSLv2 support")
- def test_protocol_sslv2(self):
- """Connecting to an SSLv2 server with various client
options"""
-- if test_support.verbose:
-+ if support.verbose:
- sys.stdout.write("\n")
-- if not hasattr(ssl, 'PROTOCOL_SSLv2'):
-- self.skipTest("PROTOCOL_SSLv2 needed")
- try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv2, True)
- try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv2, True,
ssl.CERT_OPTIONAL)
- try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv2, True,
ssl.CERT_REQUIRED)
- try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv23, False)
- try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv3, False)
- try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_TLSv1, False)
-+ # SSLv23 client with specific SSL options
-+ if no_sslv2_implies_sslv3_hello():
-+ # No SSLv2 => client will use an SSLv3 hello on recent OpenSSLs
-+ try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv23, False,
-+ client_options=ssl.OP_NO_SSLv2)
-+ try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv23, False,
-+ client_options=ssl.OP_NO_SSLv3)
-+ try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv23, False,
-+ client_options=ssl.OP_NO_TLSv1)
-
- @skip_if_broken_ubuntu_ssl
- def test_protocol_sslv23(self):
- """Connecting to an SSLv23 server with various client
options"""
-- if test_support.verbose:
-+ if support.verbose:
- sys.stdout.write("\n")
-+ if hasattr(ssl, 'PROTOCOL_SSLv2'):
-+ try:
-+ try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv2, True)
-+ except socket.error as x:
-+ # this fails on some older versions of OpenSSL (0.9.7l, for
instance)
-+ if support.verbose:
-+ sys.stdout.write(
-+ " SSL2 client to SSL23 server test unexpectedly
failed:\n %s\n"
-+ % str(x))
- try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3, True)
- try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv23, True)
- try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1, True)
-@@ -1082,22 +2195,38 @@ else:
- try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv23, True,
ssl.CERT_REQUIRED)
- try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1, True,
ssl.CERT_REQUIRED)
-
-+ # Server with specific SSL options
-+ try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3, False,
-+ server_options=ssl.OP_NO_SSLv3)
-+ # Will choose TLSv1
-+ try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv23, True,
-+ server_options=ssl.OP_NO_SSLv2 | ssl.OP_NO_SSLv3)
-+ try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1, False,
-+ server_options=ssl.OP_NO_TLSv1)
-+
-+
- @skip_if_broken_ubuntu_ssl
- def test_protocol_sslv3(self):
- """Connecting to an SSLv3 server with various client
options"""
-- if test_support.verbose:
-+ if support.verbose:
- sys.stdout.write("\n")
- try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv3, True)
- try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv3, True,
ssl.CERT_OPTIONAL)
- try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv3, True,
ssl.CERT_REQUIRED)
- if hasattr(ssl, 'PROTOCOL_SSLv2'):
- try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv2, False)
-+ try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv23, False,
-+ client_options=ssl.OP_NO_SSLv3)
- try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_TLSv1, False)
-+ if no_sslv2_implies_sslv3_hello():
-+ # No SSLv2 => client will use an SSLv3 hello on recent OpenSSLs
-+ try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv23, True,
-+ client_options=ssl.OP_NO_SSLv2)
-
- @skip_if_broken_ubuntu_ssl
- def test_protocol_tlsv1(self):
- """Connecting to a TLSv1 server with various client
options"""
-- if test_support.verbose:
-+ if support.verbose:
- sys.stdout.write("\n")
- try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_TLSv1, True)
- try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_TLSv1, True,
ssl.CERT_OPTIONAL)
-@@ -1105,10 +2234,55 @@ else:
- if hasattr(ssl, 'PROTOCOL_SSLv2'):
- try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_SSLv2, False)
- try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_SSLv3, False)
-+ try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_SSLv23, False,
-+ client_options=ssl.OP_NO_TLSv1)
-+
-+ @skip_if_broken_ubuntu_ssl
-+ @unittest.skipUnless(hasattr(ssl, "PROTOCOL_TLSv1_1"),
-+ "TLS version 1.1 not supported.")
-+ def test_protocol_tlsv1_1(self):
-+ """Connecting to a TLSv1.1 server with various client
options.
-+ Testing against older TLS versions."""
-+ if support.verbose:
-+ sys.stdout.write("\n")
-+ try_protocol_combo(ssl.PROTOCOL_TLSv1_1, ssl.PROTOCOL_TLSv1_1, True)
-+ if hasattr(ssl, 'PROTOCOL_SSLv2'):
-+ try_protocol_combo(ssl.PROTOCOL_TLSv1_1, ssl.PROTOCOL_SSLv2, False)
-+ try_protocol_combo(ssl.PROTOCOL_TLSv1_1, ssl.PROTOCOL_SSLv3, False)
-+ try_protocol_combo(ssl.PROTOCOL_TLSv1_1, ssl.PROTOCOL_SSLv23, False,
-+ client_options=ssl.OP_NO_TLSv1_1)
-+
-+ try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1_1, True)
-+ try_protocol_combo(ssl.PROTOCOL_TLSv1_1, ssl.PROTOCOL_TLSv1, False)
-+ try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_TLSv1_1, False)
-+
-+
-+ @skip_if_broken_ubuntu_ssl
-+ @unittest.skipUnless(hasattr(ssl, "PROTOCOL_TLSv1_2"),
-+ "TLS version 1.2 not supported.")
-+ def test_protocol_tlsv1_2(self):
-+ """Connecting to a TLSv1.2 server with various client
options.
-+ Testing against older TLS versions."""
-+ if support.verbose:
-+ sys.stdout.write("\n")
-+ try_protocol_combo(ssl.PROTOCOL_TLSv1_2, ssl.PROTOCOL_TLSv1_2, True,
-+ server_options=ssl.OP_NO_SSLv3|ssl.OP_NO_SSLv2,
-+ client_options=ssl.OP_NO_SSLv3|ssl.OP_NO_SSLv2,)
-+ if hasattr(ssl, 'PROTOCOL_SSLv2'):
-+ try_protocol_combo(ssl.PROTOCOL_TLSv1_2, ssl.PROTOCOL_SSLv2, False)
-+ try_protocol_combo(ssl.PROTOCOL_TLSv1_2, ssl.PROTOCOL_SSLv3, False)
-+ try_protocol_combo(ssl.PROTOCOL_TLSv1_2, ssl.PROTOCOL_SSLv23, False,
-+ client_options=ssl.OP_NO_TLSv1_2)
-+
-+ try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1_2, True)
-+ try_protocol_combo(ssl.PROTOCOL_TLSv1_2, ssl.PROTOCOL_TLSv1, False)
-+ try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_TLSv1_2, False)
-+ try_protocol_combo(ssl.PROTOCOL_TLSv1_2, ssl.PROTOCOL_TLSv1_1, False)
-+ try_protocol_combo(ssl.PROTOCOL_TLSv1_1, ssl.PROTOCOL_TLSv1_2, False)
-
- def test_starttls(self):
- """Switching from clear text to encrypted and back
again."""
-- msgs = ("msg 1", "MSG 2", "STARTTLS",
"MSG 3", "msg 4", "ENDTLS", "msg 5", "msg
6")
-+ msgs = (b"msg 1", b"MSG 2", b"STARTTLS",
b"MSG 3", b"msg 4", b"ENDTLS", b"msg 5",
b"msg 6")
-
- server = ThreadedEchoServer(CERTFILE,
- ssl_version=ssl.PROTOCOL_TLSv1,
-@@ -1120,119 +2294,109 @@ else:
- s = socket.socket()
- s.setblocking(1)
- s.connect((HOST, server.port))
-- if test_support.verbose:
-+ if support.verbose:
- sys.stdout.write("\n")
- for indata in msgs:
-- if test_support.verbose:
-+ if support.verbose:
- sys.stdout.write(
-- " client: sending %s...\n" % repr(indata))
-+ " client: sending %r...\n" % indata)
- if wrapped:
- conn.write(indata)
- outdata = conn.read()
- else:
- s.send(indata)
- outdata = s.recv(1024)
-- if (indata == "STARTTLS" and
-- outdata.strip().lower().startswith("ok")):
-+ msg = outdata.strip().lower()
-+ if indata == b"STARTTLS" and
msg.startswith(b"ok"):
- # STARTTLS ok, switch to secure mode
-- if test_support.verbose:
-+ if support.verbose:
- sys.stdout.write(
-- " client: read %s from server, starting
TLS...\n"
-- % repr(outdata))
-+ " client: read %r from server, starting
TLS...\n"
-+ % msg)
- conn = ssl.wrap_socket(s, ssl_version=ssl.PROTOCOL_TLSv1)
- wrapped = True
-- elif (indata == "ENDTLS" and
-- outdata.strip().lower().startswith("ok")):
-+ elif indata == b"ENDTLS" and
msg.startswith(b"ok"):
- # ENDTLS ok, switch back to clear text
-- if test_support.verbose:
-+ if support.verbose:
- sys.stdout.write(
-- " client: read %s from server, ending
TLS...\n"
-- % repr(outdata))
-+ " client: read %r from server, ending
TLS...\n"
-+ % msg)
- s = conn.unwrap()
- wrapped = False
- else:
-- if test_support.verbose:
-+ if support.verbose:
- sys.stdout.write(
-- " client: read %s from server\n" %
repr(outdata))
-- if test_support.verbose:
-+ " client: read %r from server\n" % msg)
-+ if support.verbose:
- sys.stdout.write(" client: closing connection.\n")
- if wrapped:
-- conn.write("over\n")
-+ conn.write(b"over\n")
- else:
-- s.send("over\n")
-- s.close()
-+ s.send(b"over\n")
-+ if wrapped:
-+ conn.close()
-+ else:
-+ s.close()
-
- def test_socketserver(self):
- """Using a SocketServer to create and manage SSL
connections."""
-- server = SocketServerHTTPSServer(CERTFILE)
-- flag = threading.Event()
-- server.start(flag)
-- # wait for it to start
-- flag.wait()
-+ server = make_https_server(self, certfile=CERTFILE)
- # try to connect
-+ if support.verbose:
-+ sys.stdout.write('\n')
-+ with open(CERTFILE, 'rb') as f:
-+ d1 = f.read()
-+ d2 = ''
-+ # now fetch the same data from the HTTPS server
-+ url = 'https://%s:%d/%s' % (
-+ HOST, server.port, os.path.split(CERTFILE)[1])
-+ f = urllib.urlopen(url)
- try:
-- if test_support.verbose:
-- sys.stdout.write('\n')
-- with open(CERTFILE, 'rb') as f:
-- d1 = f.read()
-- d2 = ''
-- # now fetch the same data from the HTTPS server
-- url = 'https://127.0.0.1:%d/%s' % (
-- server.port, os.path.split(CERTFILE)[1])
-- with test_support.check_py3k_warnings():
-- f = urllib.urlopen(url)
- dlen = f.info().getheader("content-length")
- if dlen and (int(dlen) > 0):
- d2 = f.read(int(dlen))
-- if test_support.verbose:
-+ if support.verbose:
- sys.stdout.write(
- " client: read %d bytes from remote server
'%s'\n"
- % (len(d2), server))
-- f.close()
-- self.assertEqual(d1, d2)
- finally:
-- server.stop()
-- server.join()
--
-- def test_wrapped_accept(self):
-- """Check the accept() method on SSL
sockets."""
-- if test_support.verbose:
-- sys.stdout.write("\n")
-- server_params_test(CERTFILE, ssl.PROTOCOL_SSLv23, ssl.CERT_REQUIRED,
-- CERTFILE, CERTFILE, ssl.PROTOCOL_SSLv23,
-- chatty=True, connectionchatty=True,
-- wrap_accepting_socket=True)
-+ f.close()
-+ self.assertEqual(d1, d2)
-
- def test_asyncore_server(self):
- """Check the example asyncore integration."""
- indata = "TEST MESSAGE of mixed case\n"
-
-- if test_support.verbose:
-+ if support.verbose:
- sys.stdout.write("\n")
-+
-+ indata = b"FOO\n"
- server = AsyncoreEchoServer(CERTFILE)
- with server:
- s = ssl.wrap_socket(socket.socket())
- s.connect(('127.0.0.1', server.port))
-- if test_support.verbose:
-+ if support.verbose:
- sys.stdout.write(
-- " client: sending %s...\n" % (repr(indata)))
-+ " client: sending %r...\n" % indata)
- s.write(indata)
- outdata = s.read()
-- if test_support.verbose:
-- sys.stdout.write(" client: read %s\n" % repr(outdata))
-+ if support.verbose:
-+ sys.stdout.write(" client: read %r\n" % outdata)
- if outdata != indata.lower():
- self.fail(
-- "bad data <<%s>> (%d) received; expected
<<%s>> (%d)\n"
-- % (outdata[:min(len(outdata),20)], len(outdata),
-- indata[:min(len(indata),20)].lower(), len(indata)))
-- s.write("over\n")
-- if test_support.verbose:
-+ "bad data <<%r>> (%d) received; expected
<<%r>> (%d)\n"
-+ % (outdata[:20], len(outdata),
-+ indata[:20].lower(), len(indata)))
-+ s.write(b"over\n")
-+ if support.verbose:
- sys.stdout.write(" client: closing connection.\n")
- s.close()
-+ if support.verbose:
-+ sys.stdout.write(" client: connection closed.\n")
-
- def test_recv_send(self):
- """Test recv(), send() and friends."""
-- if test_support.verbose:
-+ if support.verbose:
- sys.stdout.write("\n")
-
- server = ThreadedEchoServer(CERTFILE,
-@@ -1251,12 +2415,12 @@ else:
- s.connect((HOST, server.port))
- # helper methods for standardising recv* method signatures
- def _recv_into():
-- b = bytearray("\0"*100)
-+ b = bytearray(b"\0"*100)
- count = s.recv_into(b)
- return b[:count]
-
- def _recvfrom_into():
-- b = bytearray("\0"*100)
-+ b = bytearray(b"\0"*100)
- count, addr = s.recvfrom_into(b)
- return b[:count]
-
-@@ -1275,73 +2439,73 @@ else:
- data_prefix = u"PREFIX_"
-
- for meth_name, send_meth, expect_success, args in send_methods:
-- indata = data_prefix + meth_name
-+ indata = (data_prefix + meth_name).encode('ascii')
- try:
-- send_meth(indata.encode('ASCII', 'strict'),
*args)
-+ send_meth(indata, *args)
- outdata = s.read()
-- outdata = outdata.decode('ASCII', 'strict')
- if outdata != indata.lower():
- self.fail(
-- "While sending with <<%s>> bad data
"
-- "<<%r>> (%d) received; "
-- "expected <<%r>> (%d)\n" % (
-- meth_name, outdata[:20], len(outdata),
-- indata[:20], len(indata)
-+ "While sending with <<{name:s}>> bad
data "
-+ "<<{outdata:r}>> ({nout:d}) received;
"
-+ "expected <<{indata:r}>>
({nin:d})\n".format(
-+ name=meth_name, outdata=outdata[:20],
-+ nout=len(outdata),
-+ indata=indata[:20], nin=len(indata)
- )
- )
- except ValueError as e:
- if expect_success:
- self.fail(
-- "Failed to send with method <<%s>>;
"
-- "expected to succeed.\n" % (meth_name,)
-+ "Failed to send with method
<<{name:s}>>; "
-+ "expected to
succeed.\n".format(name=meth_name)
- )
- if not str(e).startswith(meth_name):
- self.fail(
-- "Method <<%s>> failed with unexpected
"
-- "exception message: %s\n" % (
-- meth_name, e
-+ "Method <<{name:s}>> failed with
unexpected "
-+ "exception message: {exp:s}\n".format(
-+ name=meth_name, exp=e
- )
- )
-
- for meth_name, recv_meth, expect_success, args in recv_methods:
-- indata = data_prefix + meth_name
-+ indata = (data_prefix + meth_name).encode('ascii')
- try:
-- s.send(indata.encode('ASCII', 'strict'))
-+ s.send(indata)
- outdata = recv_meth(*args)
-- outdata = outdata.decode('ASCII', 'strict')
- if outdata != indata.lower():
- self.fail(
-- "While receiving with <<%s>> bad data
"
-- "<<%r>> (%d) received; "
-- "expected <<%r>> (%d)\n" % (
-- meth_name, outdata[:20], len(outdata),
-- indata[:20], len(indata)
-+ "While receiving with <<{name:s}>> bad
data "
-+ "<<{outdata:r}>> ({nout:d}) received;
"
-+ "expected <<{indata:r}>>
({nin:d})\n".format(
-+ name=meth_name, outdata=outdata[:20],
-+ nout=len(outdata),
-+ indata=indata[:20], nin=len(indata)
- )
- )
- except ValueError as e:
- if expect_success:
- self.fail(
-- "Failed to receive with method <<%s>>;
"
-- "expected to succeed.\n" % (meth_name,)
-+ "Failed to receive with method
<<{name:s}>>; "
-+ "expected to
succeed.\n".format(name=meth_name)
- )
- if not str(e).startswith(meth_name):
- self.fail(
-- "Method <<%s>> failed with unexpected
"
-- "exception message: %s\n" % (
-- meth_name, e
-+ "Method <<{name:s}>> failed with
unexpected "
-+ "exception message: {exp:s}\n".format(
-+ name=meth_name, exp=e
- )
- )
- # consume data
- s.read()
-
-- s.write("over\n".encode("ASCII",
"strict"))
-+ s.write(b"over\n")
- s.close()
-
- def test_handshake_timeout(self):
- # Issue #5103: SSL handshake must respect the socket timeout
- server = socket.socket(socket.AF_INET)
- host = "127.0.0.1"
-- port = test_support.bind_port(server)
-+ port = support.bind_port(server)
- started = threading.Event()
- finish = False
-
-@@ -1355,6 +2519,8 @@ else:
- # Let the socket hang around rather than having
- # it closed by garbage collection.
- conns.append(server.accept()[0])
-+ for sock in conns:
-+ sock.close()
-
- t = threading.Thread(target=serve)
- t.start()
-@@ -1372,8 +2538,8 @@ else:
- c.close()
- try:
- c = socket.socket(socket.AF_INET)
-- c.settimeout(0.2)
- c = ssl.wrap_socket(c)
-+ c.settimeout(0.2)
- # Will attempt handshake and time out
- self.assertRaisesRegexp(ssl.SSLError, "timed out",
- c.connect, (host, port))
-@@ -1384,59 +2550,384 @@ else:
- t.join()
- server.close()
-
-+ def test_server_accept(self):
-+ # Issue #16357: accept() on a SSLSocket created through
-+ # SSLContext.wrap_socket().
-+ context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
-+ context.verify_mode = ssl.CERT_REQUIRED
-+ context.load_verify_locations(CERTFILE)
-+ context.load_cert_chain(CERTFILE)
-+ server = socket.socket(socket.AF_INET)
-+ host = "127.0.0.1"
-+ port = support.bind_port(server)
-+ server = context.wrap_socket(server, server_side=True)
-+
-+ evt = threading.Event()
-+ remote = [None]
-+ peer = [None]
-+ def serve():
-+ server.listen(5)
-+ # Block on the accept and wait on the connection to close.
-+ evt.set()
-+ remote[0], peer[0] = server.accept()
-+ remote[0].recv(1)
-+
-+ t = threading.Thread(target=serve)
-+ t.start()
-+ # Client wait until server setup and perform a connect.
-+ evt.wait()
-+ client = context.wrap_socket(socket.socket())
-+ client.connect((host, port))
-+ client_addr = client.getsockname()
-+ client.close()
-+ t.join()
-+ remote[0].close()
-+ server.close()
-+ # Sanity checks.
-+ self.assertIsInstance(remote[0], ssl.SSLSocket)
-+ self.assertEqual(peer[0], client_addr)
-+
-+ def test_getpeercert_enotconn(self):
-+ context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
-+ with closing(context.wrap_socket(socket.socket())) as sock:
-+ with self.assertRaises(socket.error) as cm:
-+ sock.getpeercert()
-+ self.assertEqual(cm.exception.errno, errno.ENOTCONN)
-+
-+ def test_do_handshake_enotconn(self):
-+ context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
-+ with closing(context.wrap_socket(socket.socket())) as sock:
-+ with self.assertRaises(socket.error) as cm:
-+ sock.do_handshake()
-+ self.assertEqual(cm.exception.errno, errno.ENOTCONN)
-+
- def test_default_ciphers(self):
-+ context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
-+ try:
-+ # Force a set of weak ciphers on our client context
-+ context.set_ciphers("DES")
-+ except ssl.SSLError:
-+ self.skipTest("no DES cipher available")
- with ThreadedEchoServer(CERTFILE,
- ssl_version=ssl.PROTOCOL_SSLv23,
- chatty=False) as server:
-- sock = socket.socket()
-- try:
-- # Force a set of weak ciphers on our client socket
-- try:
-- s = ssl.wrap_socket(sock,
-- ssl_version=ssl.PROTOCOL_SSLv23,
-- ciphers="DES")
-- except ssl.SSLError:
-- self.skipTest("no DES cipher available")
-- with self.assertRaises((OSError, ssl.SSLError)):
-+ with closing(context.wrap_socket(socket.socket())) as s:
-+ with self.assertRaises(ssl.SSLError):
- s.connect((HOST, server.port))
-- finally:
-- sock.close()
- self.assertIn("no shared cipher", str(server.conn_errors[0]))
-
-+ @unittest.skipUnless(ssl.HAS_ECDH, "test requires ECDH-enabled
OpenSSL")
-+ def test_default_ecdh_curve(self):
-+ # Issue #21015: elliptic curve-based Diffie Hellman key exchange
-+ # should be enabled by default on SSL contexts.
-+ context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
-+ context.load_cert_chain(CERTFILE)
-+ # Prior to OpenSSL 1.0.0, ECDH ciphers have to be enabled
-+ # explicitly using the 'ECCdraft' cipher alias. Otherwise,
-+ # our default cipher list should prefer ECDH-based ciphers
-+ # automatically.
-+ if ssl.OPENSSL_VERSION_INFO < (1, 0, 0):
-+ context.set_ciphers("ECCdraft:ECDH")
-+ with ThreadedEchoServer(context=context) as server:
-+ with closing(context.wrap_socket(socket.socket())) as s:
-+ s.connect((HOST, server.port))
-+ self.assertIn("ECDH", s.cipher()[0])
-+
-+ @unittest.skipUnless("tls-unique" in ssl.CHANNEL_BINDING_TYPES,
-+ "'tls-unique' channel binding not
available")
-+ def test_tls_unique_channel_binding(self):
-+ """Test tls-unique channel binding."""
-+ if support.verbose:
-+ sys.stdout.write("\n")
-+
-+ server = ThreadedEchoServer(CERTFILE,
-+ certreqs=ssl.CERT_NONE,
-+ ssl_version=ssl.PROTOCOL_TLSv1,
-+ cacerts=CERTFILE,
-+ chatty=True,
-+ connectionchatty=False)
-+ with server:
-+ s = ssl.wrap_socket(socket.socket(),
-+ server_side=False,
-+ certfile=CERTFILE,
-+ ca_certs=CERTFILE,
-+ cert_reqs=ssl.CERT_NONE,
-+ ssl_version=ssl.PROTOCOL_TLSv1)
-+ s.connect((HOST, server.port))
-+ # get the data
-+ cb_data = s.get_channel_binding("tls-unique")
-+ if support.verbose:
-+ sys.stdout.write(" got channel binding data: {0!r}\n"
-+ .format(cb_data))
-+
-+ # check if it is sane
-+ self.assertIsNotNone(cb_data)
-+ self.assertEqual(len(cb_data), 12) # True for TLSv1
-+
-+ # and compare with the peers version
-+ s.write(b"CB tls-unique\n")
-+ peer_data_repr = s.read().strip()
-+ self.assertEqual(peer_data_repr,
-+ repr(cb_data).encode("us-ascii"))
-+ s.close()
-+
-+ # now, again
-+ s = ssl.wrap_socket(socket.socket(),
-+ server_side=False,
-+ certfile=CERTFILE,
-+ ca_certs=CERTFILE,
-+ cert_reqs=ssl.CERT_NONE,
-+ ssl_version=ssl.PROTOCOL_TLSv1)
-+ s.connect((HOST, server.port))
-+ new_cb_data = s.get_channel_binding("tls-unique")
-+ if support.verbose:
-+ sys.stdout.write(" got another channel binding data:
{0!r}\n"
-+ .format(new_cb_data))
-+ # is it really unique
-+ self.assertNotEqual(cb_data, new_cb_data)
-+ self.assertIsNotNone(cb_data)
-+ self.assertEqual(len(cb_data), 12) # True for TLSv1
-+ s.write(b"CB tls-unique\n")
-+ peer_data_repr = s.read().strip()
-+ self.assertEqual(peer_data_repr,
-+ repr(new_cb_data).encode("us-ascii"))
-+ s.close()
-+
-+ def test_compression(self):
-+ context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ context.load_cert_chain(CERTFILE)
-+ stats = server_params_test(context, context,
-+ chatty=True, connectionchatty=True)
-+ if support.verbose:
-+ sys.stdout.write(" got compression:
{!r}\n".format(stats['compression']))
-+ self.assertIn(stats['compression'], { None, 'ZLIB',
'RLE' })
-+
-+ @unittest.skipUnless(hasattr(ssl, 'OP_NO_COMPRESSION'),
-+ "ssl.OP_NO_COMPRESSION needed for this test")
-+ def test_compression_disabled(self):
-+ context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ context.load_cert_chain(CERTFILE)
-+ context.options |= ssl.OP_NO_COMPRESSION
-+ stats = server_params_test(context, context,
-+ chatty=True, connectionchatty=True)
-+ self.assertIs(stats['compression'], None)
-+
-+ def test_dh_params(self):
-+ # Check we can get a connection with ephemeral Diffie-Hellman
-+ context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ context.load_cert_chain(CERTFILE)
-+ context.load_dh_params(DHFILE)
-+ context.set_ciphers("kEDH")
-+ stats = server_params_test(context, context,
-+ chatty=True, connectionchatty=True)
-+ cipher = stats["cipher"][0]
-+ parts = cipher.split("-")
-+ if "ADH" not in parts and "EDH" not in parts and
"DHE" not in parts:
-+ self.fail("Non-DH cipher: " + cipher[0])
-+
-+ def test_selected_npn_protocol(self):
-+ # selected_npn_protocol() is None unless NPN is used
-+ context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ context.load_cert_chain(CERTFILE)
-+ stats = server_params_test(context, context,
-+ chatty=True, connectionchatty=True)
-+ self.assertIs(stats['client_npn_protocol'], None)
-+
-+ @unittest.skipUnless(ssl.HAS_NPN, "NPN support needed for this test")
-+ def test_npn_protocols(self):
-+ server_protocols = ['http/1.1', 'spdy/2']
-+ protocol_tests = [
-+ (['http/1.1', 'spdy/2'], 'http/1.1'),
-+ (['spdy/2', 'http/1.1'], 'http/1.1'),
-+ (['spdy/2', 'test'], 'spdy/2'),
-+ (['abc', 'def'], 'abc')
-+ ]
-+ for client_protocols, expected in protocol_tests:
-+ server_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ server_context.load_cert_chain(CERTFILE)
-+ server_context.set_npn_protocols(server_protocols)
-+ client_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ client_context.load_cert_chain(CERTFILE)
-+ client_context.set_npn_protocols(client_protocols)
-+ stats = server_params_test(client_context, server_context,
-+ chatty=True, connectionchatty=True)
-+
-+ msg = "failed trying %s (s) and %s (c).\n" \
-+ "was expecting %s, but got %%s from the %%s" \
-+ % (str(server_protocols), str(client_protocols),
-+ str(expected))
-+ client_result = stats['client_npn_protocol']
-+ self.assertEqual(client_result, expected, msg % (client_result,
"client"))
-+ server_result = stats['server_npn_protocols'][-1] \
-+ if len(stats['server_npn_protocols']) else
'nothing'
-+ self.assertEqual(server_result, expected, msg % (server_result,
"server"))
-+
-+ def sni_contexts(self):
-+ server_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ server_context.load_cert_chain(SIGNED_CERTFILE)
-+ other_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ other_context.load_cert_chain(SIGNED_CERTFILE2)
-+ client_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-+ client_context.verify_mode = ssl.CERT_REQUIRED
-+ client_context.load_verify_locations(SIGNING_CA)
-+ return server_context, other_context, client_context
-+
-+ def check_common_name(self, stats, name):
-+ cert = stats['peercert']
-+ self.assertIn((('commonName', name),), cert['subject'])
-+
-+ @needs_sni
-+ def test_sni_callback(self):
-+ calls = []
-+ server_context, other_context, client_context = self.sni_contexts()
-+
-+ def servername_cb(ssl_sock, server_name, initial_context):
-+ calls.append((server_name, initial_context))
-+ if server_name is not None:
-+ ssl_sock.context = other_context
-+ server_context.set_servername_callback(servername_cb)
-+
-+ stats = server_params_test(client_context, server_context,
-+ chatty=True,
-+ sni_name='supermessage')
-+ # The hostname was fetched properly, and the certificate was
-+ # changed for the connection.
-+ self.assertEqual(calls, [("supermessage", server_context)])
-+ # CERTFILE4 was selected
-+ self.check_common_name(stats, 'fakehostname')
-+
-+ calls = []
-+ # The callback is called with server_name=None
-+ stats = server_params_test(client_context, server_context,
-+ chatty=True,
-+ sni_name=None)
-+ self.assertEqual(calls, [(None, server_context)])
-+ self.check_common_name(stats, 'localhost')
-+
-+ # Check disabling the callback
-+ calls = []
-+ server_context.set_servername_callback(None)
-+
-+ stats = server_params_test(client_context, server_context,
-+ chatty=True,
-+ sni_name='notfunny')
-+ # Certificate didn't change
-+ self.check_common_name(stats, 'localhost')
-+ self.assertEqual(calls, [])
-+
-+ @needs_sni
-+ def test_sni_callback_alert(self):
-+ # Returning a TLS alert is reflected to the connecting client
-+ server_context, other_context, client_context = self.sni_contexts()
-+
-+ def cb_returning_alert(ssl_sock, server_name, initial_context):
-+ return ssl.ALERT_DESCRIPTION_ACCESS_DENIED
-+ server_context.set_servername_callback(cb_returning_alert)
-+
-+ with self.assertRaises(ssl.SSLError) as cm:
-+ stats = server_params_test(client_context, server_context,
-+ chatty=False,
-+ sni_name='supermessage')
-+ self.assertEqual(cm.exception.reason, 'TLSV1_ALERT_ACCESS_DENIED')
-+
-+ @needs_sni
-+ def test_sni_callback_raising(self):
-+ # Raising fails the connection with a TLS handshake failure alert.
-+ server_context, other_context, client_context = self.sni_contexts()
-+
-+ def cb_raising(ssl_sock, server_name, initial_context):
-+ 1/0
-+ server_context.set_servername_callback(cb_raising)
-+
-+ with self.assertRaises(ssl.SSLError) as cm, \
-+ support.captured_stderr() as stderr:
-+ stats = server_params_test(client_context, server_context,
-+ chatty=False,
-+ sni_name='supermessage')
-+ self.assertEqual(cm.exception.reason,
'SSLV3_ALERT_HANDSHAKE_FAILURE')
-+ self.assertIn("ZeroDivisionError", stderr.getvalue())
-+
-+ @needs_sni
-+ def test_sni_callback_wrong_return_type(self):
-+ # Returning the wrong return type terminates the TLS connection
-+ # with an internal error alert.
-+ server_context, other_context, client_context = self.sni_contexts()
-+
-+ def cb_wrong_return_type(ssl_sock, server_name, initial_context):
-+ return "foo"
-+ server_context.set_servername_callback(cb_wrong_return_type)
-+
-+ with self.assertRaises(ssl.SSLError) as cm, \
-+ support.captured_stderr() as stderr:
-+ stats = server_params_test(client_context, server_context,
-+ chatty=False,
-+ sni_name='supermessage')
-+ self.assertEqual(cm.exception.reason, 'TLSV1_ALERT_INTERNAL_ERROR')
-+ self.assertIn("TypeError", stderr.getvalue())
-+
-+ def test_read_write_after_close_raises_valuerror(self):
-+ context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
-+ context.verify_mode = ssl.CERT_REQUIRED
-+ context.load_verify_locations(CERTFILE)
-+ context.load_cert_chain(CERTFILE)
-+ server = ThreadedEchoServer(context=context, chatty=False)
-+
-+ with server:
-+ s = context.wrap_socket(socket.socket())
-+ s.connect((HOST, server.port))
-+ s.close()
-+
-+ self.assertRaises(ValueError, s.read, 1024)
-+ self.assertRaises(ValueError, s.write, b'hello')
-+
-
- def test_main(verbose=False):
-- global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, NOKIACERT, NULLBYTECERT
-- CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir,
-- "keycert.pem")
-- SVN_PYTHON_ORG_ROOT_CERT = os.path.join(
-- os.path.dirname(__file__) or os.curdir,
-- "https_svn_python_org_root.pem")
-- NOKIACERT = os.path.join(os.path.dirname(__file__) or os.curdir,
-- "nokia.pem")
-- NULLBYTECERT = os.path.join(os.path.dirname(__file__) or os.curdir,
-- "nullbytecert.pem")
--
-- if (not os.path.exists(CERTFILE) or
-- not os.path.exists(SVN_PYTHON_ORG_ROOT_CERT) or
-- not os.path.exists(NOKIACERT) or
-- not os.path.exists(NULLBYTECERT)):
-- raise test_support.TestFailed("Can't read certificate files!")
--
-- tests = [BasicTests, BasicSocketTests]
--
-- if test_support.is_resource_enabled('network'):
-+ if support.verbose:
-+ plats = {
-+ 'Linux': platform.linux_distribution,
-+ 'Mac': platform.mac_ver,
-+ 'Windows': platform.win32_ver,
-+ }
-+ for name, func in plats.items():
-+ plat = func()
-+ if plat and plat[0]:
-+ plat = '%s %r' % (name, plat)
-+ break
-+ else:
-+ plat = repr(platform.platform())
-+ print("test_ssl: testing with %r %r" %
-+ (ssl.OPENSSL_VERSION, ssl.OPENSSL_VERSION_INFO))
-+ print(" under %s" % plat)
-+ print(" HAS_SNI = %r" % ssl.HAS_SNI)
-+ print(" OP_ALL = 0x%8x" % ssl.OP_ALL)
-+ try:
-+ print(" OP_NO_TLSv1_1 = 0x%8x" % ssl.OP_NO_TLSv1_1)
-+ except AttributeError:
-+ pass
-+
-+ for filename in [
-+ CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, BYTES_CERTFILE,
-+ ONLYCERT, ONLYKEY, BYTES_ONLYCERT, BYTES_ONLYKEY,
-+ SIGNED_CERTFILE, SIGNED_CERTFILE2, SIGNING_CA,
-+ BADCERT, BADKEY, EMPTYCERT]:
-+ if not os.path.exists(filename):
-+ raise support.TestFailed("Can't read certificate file %r" %
filename)
-+
-+ tests = [ContextTests, BasicSocketTests, SSLErrorTests]
-+
-+ if support.is_resource_enabled('network'):
- tests.append(NetworkedTests)
-
- if _have_threads:
-- thread_info = test_support.threading_setup()
-- if thread_info and test_support.is_resource_enabled('network'):
-+ thread_info = support.threading_setup()
-+ if thread_info:
- tests.append(ThreadedTests)
-
- try:
-- test_support.run_unittest(*tests)
-+ support.run_unittest(*tests)
- finally:
- if _have_threads:
-- test_support.threading_cleanup(*thread_info)
-+ support.threading_cleanup(*thread_info)
-
- if __name__ == "__main__":
- test_main()
-diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py
-index 695ac95..c1c8799 100644
---- a/Lib/test/test_support.py
-+++ b/Lib/test/test_support.py
-@@ -39,7 +39,7 @@ __all__ = ["Error", "TestFailed",
"ResourceDenied", "import_module",
- "threading_cleanup", "reap_children",
"cpython_only",
- "check_impl_detail", "get_attribute",
"py3k_bytes",
- "import_fresh_module", "threading_cleanup",
"reap_children",
-- "strip_python_stderr"]
-+ "strip_python_stderr", "IPV6_ENABLED"]
-
- class Error(Exception):
- """Base class for regression test exceptions."""
-@@ -465,6 +465,23 @@ def bind_port(sock, host=HOST):
- port = sock.getsockname()[1]
- return port
-
-+def _is_ipv6_enabled():
-+ """Check whether IPv6 is enabled on this host."""
-+ if socket.has_ipv6:
-+ sock = None
-+ try:
-+ sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
-+ sock.bind((HOSTv6, 0))
-+ return True
-+ except OSError:
-+ pass
-+ finally:
-+ if sock:
-+ sock.close()
-+ return False
-+
-+IPV6_ENABLED = _is_ipv6_enabled()
-+
- FUZZ = 1e-6
-
- def fcmp(x, y): # fuzzy comparison function
-diff --git a/Makefile.pre.in b/Makefile.pre.in
-index bcd83bf..80a0926 100644
---- a/Makefile.pre.in
-+++ b/Makefile.pre.in
-@@ -930,8 +930,8 @@ PLATMACDIRS= plat-mac plat-mac/Carbon plat-mac/lib-scriptpackages \
- plat-mac/lib-scriptpackages/Terminal
- PLATMACPATH=:plat-mac:plat-mac/lib-scriptpackages
- LIBSUBDIRS= lib-tk lib-tk/test lib-tk/test/test_tkinter \
-- lib-tk/test/test_ttk site-packages test test/audiodata test/data \
-- test/cjkencodings test/decimaltestdata test/xmltestdata \
-+ lib-tk/test/test_ttk site-packages test test/audiodata test/capath \
-+ test/data test/cjkencodings test/decimaltestdata test/xmltestdata \
- test/imghdrdata \
- test/subprocessdata \
- test/tracedmodules \
-diff --git a/Modules/_ssl.c b/Modules/_ssl.c
-index 752b033..8f4062b 100644
---- a/Modules/_ssl.c
-+++ b/Modules/_ssl.c
-@@ -14,22 +14,28 @@
-
http://bugs.python.org/issue8108#msg102867 ?
- */
-
-+#define PY_SSIZE_T_CLEAN
- #include "Python.h"
-
- #ifdef WITH_THREAD
- #include "pythread.h"
-
-
-+#define PySSL_BEGIN_ALLOW_THREADS_S(save) \
-+ do { if (_ssl_locks_count>0) { (save) = PyEval_SaveThread(); } } while (0)
-+#define PySSL_END_ALLOW_THREADS_S(save) \
-+ do { if (_ssl_locks_count>0) { PyEval_RestoreThread(save); } } while (0)
- #define PySSL_BEGIN_ALLOW_THREADS { \
- PyThreadState *_save = NULL; \
-- if (_ssl_locks_count>0) {_save = PyEval_SaveThread();}
--#define PySSL_BLOCK_THREADS if
(_ssl_locks_count>0){PyEval_RestoreThread(_save)};
--#define PySSL_UNBLOCK_THREADS if (_ssl_locks_count>0){_save =
PyEval_SaveThread()};
--#define PySSL_END_ALLOW_THREADS if (_ssl_locks_count>0){PyEval_RestoreThread(_save);}
\
-- }
-+ PySSL_BEGIN_ALLOW_THREADS_S(_save);
-+#define PySSL_BLOCK_THREADS PySSL_END_ALLOW_THREADS_S(_save);
-+#define PySSL_UNBLOCK_THREADS PySSL_BEGIN_ALLOW_THREADS_S(_save);
-+#define PySSL_END_ALLOW_THREADS PySSL_END_ALLOW_THREADS_S(_save); }
-
- #else /* no WITH_THREAD */
-
-+#define PySSL_BEGIN_ALLOW_THREADS_S(save)
-+#define PySSL_END_ALLOW_THREADS_S(save)
- #define PySSL_BEGIN_ALLOW_THREADS
- #define PySSL_BLOCK_THREADS
- #define PySSL_UNBLOCK_THREADS
-@@ -37,6 +43,68 @@
-
- #endif
-
-+/* Include symbols from _socket module */
-+#include "socketmodule.h"
-+
-+#if defined(HAVE_POLL_H)
-+#include <poll.h>
-+#elif defined(HAVE_SYS_POLL_H)
-+#include <sys/poll.h>
-+#endif
-+
-+/* Include OpenSSL header files */
-+#include "openssl/rsa.h"
-+#include "openssl/crypto.h"
-+#include "openssl/x509.h"
-+#include "openssl/x509v3.h"
-+#include "openssl/pem.h"
-+#include "openssl/ssl.h"
-+#include "openssl/err.h"
-+#include "openssl/rand.h"
-+
-+/* SSL error object */
-+static PyObject *PySSLErrorObject;
-+static PyObject *PySSLZeroReturnErrorObject;
-+static PyObject *PySSLWantReadErrorObject;
-+static PyObject *PySSLWantWriteErrorObject;
-+static PyObject *PySSLSyscallErrorObject;
-+static PyObject *PySSLEOFErrorObject;
-+
-+/* Error mappings */
-+static PyObject *err_codes_to_names;
-+static PyObject *err_names_to_codes;
-+static PyObject *lib_codes_to_names;
-+
-+struct py_ssl_error_code {
-+ const char *mnemonic;
-+ int library, reason;
-+};
-+struct py_ssl_library_code {
-+ const char *library;
-+ int code;
-+};
-+
-+/* Include generated data (error codes) */
-+#include "_ssl_data.h"
-+
-+/* Openssl comes with TLSv1.1 and TLSv1.2 between 1.0.0h and 1.0.1
-+
http://www.openssl.org/news/changelog.html
-+ */
-+#if OPENSSL_VERSION_NUMBER >= 0x10001000L
-+# define HAVE_TLSv1_2 1
-+#else
-+# define HAVE_TLSv1_2 0
-+#endif
-+
-+/* SNI support (client- and server-side) appeared in OpenSSL 1.0.0 and 0.9.8f
-+ * This includes the SSL_set_SSL_CTX() function.
-+ */
-+#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
-+# define HAVE_SNI 1
-+#else
-+# define HAVE_SNI 0
-+#endif
-+
- enum py_ssl_error {
- /* these mirror ssl.h */
- PY_SSL_ERROR_NONE,
-@@ -49,6 +117,7 @@ enum py_ssl_error {
- PY_SSL_ERROR_WANT_CONNECT,
- /* start of non ssl.h errorcodes */
- PY_SSL_ERROR_EOF, /* special case of SSL_ERROR_SYSCALL */
-+ PY_SSL_ERROR_NO_SOCKET, /* socket has been GC'd */
- PY_SSL_ERROR_INVALID_ERROR_CODE
- };
-
-@@ -64,35 +133,17 @@ enum py_ssl_cert_requirements {
- };
-
- enum py_ssl_version {
--#ifndef OPENSSL_NO_SSL2
- PY_SSL_VERSION_SSL2,
--#endif
- PY_SSL_VERSION_SSL3=1,
- PY_SSL_VERSION_SSL23,
-+#if HAVE_TLSv1_2
-+ PY_SSL_VERSION_TLS1,
-+ PY_SSL_VERSION_TLS1_1,
-+ PY_SSL_VERSION_TLS1_2
-+#else
- PY_SSL_VERSION_TLS1
--};
--
--/* Include symbols from _socket module */
--#include "socketmodule.h"
--
--#if defined(HAVE_POLL_H)
--#include <poll.h>
--#elif defined(HAVE_SYS_POLL_H)
--#include <sys/poll.h>
- #endif
--
--/* Include OpenSSL header files */
--#include "openssl/rsa.h"
--#include "openssl/crypto.h"
--#include "openssl/x509.h"
--#include "openssl/x509v3.h"
--#include "openssl/pem.h"
--#include "openssl/ssl.h"
--#include "openssl/err.h"
--#include "openssl/rand.h"
--
--/* SSL error object */
--static PyObject *PySSLErrorObject;
-+};
-
- #ifdef WITH_THREAD
-
-@@ -114,27 +165,79 @@ static unsigned int _ssl_locks_count = 0;
- # undef HAVE_OPENSSL_RAND
- #endif
-
-+/* SSL_CTX_clear_options() and SSL_clear_options() were first added in
-+ * OpenSSL 0.9.8m but do not appear in some 0.9.9-dev versions such the
-+ * 0.9.9 from "May 2008" that NetBSD 5.0 uses. */
-+#if OPENSSL_VERSION_NUMBER >= 0x009080dfL && OPENSSL_VERSION_NUMBER !=
0x00909000L
-+# define HAVE_SSL_CTX_CLEAR_OPTIONS
-+#else
-+# undef HAVE_SSL_CTX_CLEAR_OPTIONS
-+#endif
-+
-+/* In case of 'tls-unique' it will be 12 bytes for TLS, 36 bytes for
-+ * older SSL, but let's be safe */
-+#define PySSL_CB_MAXLEN 128
-+
-+/* SSL_get_finished got added to OpenSSL in 0.9.5 */
-+#if OPENSSL_VERSION_NUMBER >= 0x0090500fL
-+# define HAVE_OPENSSL_FINISHED 1
-+#else
-+# define HAVE_OPENSSL_FINISHED 0
-+#endif
-+
-+/* ECDH support got added to OpenSSL in 0.9.8 */
-+#if OPENSSL_VERSION_NUMBER < 0x0090800fL && !defined(OPENSSL_NO_ECDH)
-+# define OPENSSL_NO_ECDH
-+#endif
-+
-+/* compression support got added to OpenSSL in 0.9.8 */
-+#if OPENSSL_VERSION_NUMBER < 0x0090800fL && !defined(OPENSSL_NO_COMP)
-+# define OPENSSL_NO_COMP
-+#endif
-+
-+/* X509_VERIFY_PARAM got added to OpenSSL in 0.9.8 */
-+#if OPENSSL_VERSION_NUMBER >= 0x0090800fL
-+# define HAVE_OPENSSL_VERIFY_PARAM
-+#endif
-+
-+
-+typedef struct {
-+ PyObject_HEAD
-+ SSL_CTX *ctx;
-+#ifdef OPENSSL_NPN_NEGOTIATED
-+ char *npn_protocols;
-+ int npn_protocols_len;
-+#endif
-+#ifndef OPENSSL_NO_TLSEXT
-+ PyObject *set_hostname;
-+#endif
-+ int check_hostname;
-+} PySSLContext;
-+
- typedef struct {
- PyObject_HEAD
-- PySocketSockObject *Socket; /* Socket on which we're layered */
-- SSL_CTX* ctx;
-- SSL* ssl;
-- X509* peer_cert;
-- char server[X509_NAME_MAXLEN];
-- char issuer[X509_NAME_MAXLEN];
-- int shutdown_seen_zero;
--
--} PySSLObject;
--
--static PyTypeObject PySSL_Type;
--static PyObject *PySSL_SSLwrite(PySSLObject *self, PyObject *args);
--static PyObject *PySSL_SSLread(PySSLObject *self, PyObject *args);
-+ PySocketSockObject *Socket;
-+ PyObject *ssl_sock;
-+ SSL *ssl;
-+ PySSLContext *ctx; /* weakref to SSL context */
-+ X509 *peer_cert;
-+ char shutdown_seen_zero;
-+ char handshake_done;
-+ enum py_ssl_server_or_client socket_type;
-+} PySSLSocket;
-+
-+static PyTypeObject PySSLContext_Type;
-+static PyTypeObject PySSLSocket_Type;
-+
-+static PyObject *PySSL_SSLwrite(PySSLSocket *self, PyObject *args);
-+static PyObject *PySSL_SSLread(PySSLSocket *self, PyObject *args);
- static int check_socket_and_wait_for_timeout(PySocketSockObject *s,
- int writing);
--static PyObject *PySSL_peercert(PySSLObject *self, PyObject *args);
--static PyObject *PySSL_cipher(PySSLObject *self);
-+static PyObject *PySSL_peercert(PySSLSocket *self, PyObject *args);
-+static PyObject *PySSL_cipher(PySSLSocket *self);
-
--#define PySSLObject_Check(v) (Py_TYPE(v) == &PySSL_Type)
-+#define PySSLContext_Check(v) (Py_TYPE(v) == &PySSLContext_Type)
-+#define PySSLSocket_Check(v) (Py_TYPE(v) == &PySSLSocket_Type)
-
- typedef enum {
- SOCKET_IS_NONBLOCKING,
-@@ -151,36 +254,140 @@ typedef enum {
- #define ERRSTR1(x,y,z) (x ":" y ": " z)
- #define ERRSTR(x) ERRSTR1("_ssl.c", STRINGIFY2(__LINE__), x)
-
--/* XXX It might be helpful to augment the error message generated
-- below with the name of the SSL function that generated the error.
-- I expect it's obvious most of the time.
--*/
-+
-+/*
-+ * SSL errors.
-+ */
-+
-+PyDoc_STRVAR(SSLError_doc,
-+"An error occurred in the SSL implementation.");
-+
-+PyDoc_STRVAR(SSLZeroReturnError_doc,
-+"SSL/TLS session closed cleanly.");
-+
-+PyDoc_STRVAR(SSLWantReadError_doc,
-+"Non-blocking SSL socket needs to read more data\n"
-+"before the requested operation can be completed.");
-+
-+PyDoc_STRVAR(SSLWantWriteError_doc,
-+"Non-blocking SSL socket needs to write more data\n"
-+"before the requested operation can be completed.");
-+
-+PyDoc_STRVAR(SSLSyscallError_doc,
-+"System error when attempting SSL operation.");
-+
-+PyDoc_STRVAR(SSLEOFError_doc,
-+"SSL/TLS connection terminated abruptly.");
-+
-
- static PyObject *
--PySSL_SetError(PySSLObject *obj, int ret, char *filename, int lineno)
-+SSLError_str(PyEnvironmentErrorObject *self)
- {
-- PyObject *v;
-- char buf[2048];
-- char *errstr;
-+ if (self->strerror != NULL) {
-+ Py_INCREF(self->strerror);
-+ return self->strerror;
-+ }
-+ else
-+ return PyObject_Str(self->args);
-+}
-+
-+static void
-+fill_and_set_sslerror(PyObject *type, int ssl_errno, const char *errstr,
-+ int lineno, unsigned long errcode)
-+{
-+ PyObject *err_value = NULL, *reason_obj = NULL, *lib_obj = NULL;
-+ PyObject *init_value, *msg, *key;
-+
-+ if (errcode != 0) {
-+ int lib, reason;
-+
-+ lib = ERR_GET_LIB(errcode);
-+ reason = ERR_GET_REASON(errcode);
-+ key = Py_BuildValue("ii", lib, reason);
-+ if (key == NULL)
-+ goto fail;
-+ reason_obj = PyDict_GetItem(err_codes_to_names, key);
-+ Py_DECREF(key);
-+ if (reason_obj == NULL) {
-+ /* XXX if reason < 100, it might reflect a library number (!!) */
-+ PyErr_Clear();
-+ }
-+ key = PyLong_FromLong(lib);
-+ if (key == NULL)
-+ goto fail;
-+ lib_obj = PyDict_GetItem(lib_codes_to_names, key);
-+ Py_DECREF(key);
-+ if (lib_obj == NULL) {
-+ PyErr_Clear();
-+ }
-+ if (errstr == NULL)
-+ errstr = ERR_reason_error_string(errcode);
-+ }
-+ if (errstr == NULL)
-+ errstr = "unknown error";
-+
-+ if (reason_obj && lib_obj)
-+ msg = PyUnicode_FromFormat("[%S: %S] %s (_ssl.c:%d)",
-+ lib_obj, reason_obj, errstr, lineno);
-+ else if (lib_obj)
-+ msg = PyUnicode_FromFormat("[%S] %s (_ssl.c:%d)",
-+ lib_obj, errstr, lineno);
-+ else
-+ msg = PyUnicode_FromFormat("%s (_ssl.c:%d)", errstr, lineno);
-+ if (msg == NULL)
-+ goto fail;
-+
-+ init_value = Py_BuildValue("iN", ssl_errno, msg);
-+ if (init_value == NULL)
-+ goto fail;
-+
-+ err_value = PyObject_CallObject(type, init_value);
-+ Py_DECREF(init_value);
-+ if (err_value == NULL)
-+ goto fail;
-+
-+ if (reason_obj == NULL)
-+ reason_obj = Py_None;
-+ if (PyObject_SetAttrString(err_value, "reason", reason_obj))
-+ goto fail;
-+ if (lib_obj == NULL)
-+ lib_obj = Py_None;
-+ if (PyObject_SetAttrString(err_value, "library", lib_obj))
-+ goto fail;
-+ PyErr_SetObject(type, err_value);
-+fail:
-+ Py_XDECREF(err_value);
-+}
-+
-+static PyObject *
-+PySSL_SetError(PySSLSocket *obj, int ret, char *filename, int lineno)
-+{
-+ PyObject *type = PySSLErrorObject;
-+ char *errstr = NULL;
- int err;
- enum py_ssl_error p = PY_SSL_ERROR_NONE;
-+ unsigned long e = 0;
-
- assert(ret <= 0);
-+ e = ERR_peek_last_error();
-
- if (obj->ssl != NULL) {
- err = SSL_get_error(obj->ssl, ret);
-
- switch (err) {
- case SSL_ERROR_ZERO_RETURN:
-- errstr = "TLS/SSL connection has been closed";
-+ errstr = "TLS/SSL connection has been closed (EOF)";
-+ type = PySSLZeroReturnErrorObject;
- p = PY_SSL_ERROR_ZERO_RETURN;
- break;
- case SSL_ERROR_WANT_READ:
- errstr = "The operation did not complete (read)";
-+ type = PySSLWantReadErrorObject;
- p = PY_SSL_ERROR_WANT_READ;
- break;
- case SSL_ERROR_WANT_WRITE:
- p = PY_SSL_ERROR_WANT_WRITE;
-+ type = PySSLWantWriteErrorObject;
- errstr = "The operation did not complete (write)";
- break;
- case SSL_ERROR_WANT_X509_LOOKUP:
-@@ -193,213 +400,109 @@ PySSL_SetError(PySSLObject *obj, int ret, char *filename, int
lineno)
- break;
- case SSL_ERROR_SYSCALL:
- {
-- unsigned long e = ERR_get_error();
- if (e == 0) {
-- if (ret == 0 || !obj->Socket) {
-+ PySocketSockObject *s = obj->Socket;
-+ if (ret == 0) {
- p = PY_SSL_ERROR_EOF;
-+ type = PySSLEOFErrorObject;
- errstr = "EOF occurred in violation of protocol";
- } else if (ret == -1) {
- /* underlying BIO reported an I/O error */
-+ Py_INCREF(s);
- ERR_clear_error();
-- return obj->Socket->errorhandler();
-+ s->errorhandler();
-+ Py_DECREF(s);
-+ return NULL;
- } else { /* possible? */
- p = PY_SSL_ERROR_SYSCALL;
-+ type = PySSLSyscallErrorObject;
- errstr = "Some I/O error occurred";
- }
- } else {
- p = PY_SSL_ERROR_SYSCALL;
-- /* XXX Protected by global interpreter lock */
-- errstr = ERR_error_string(e, NULL);
- }
- break;
- }
- case SSL_ERROR_SSL:
- {
-- unsigned long e = ERR_get_error();
- p = PY_SSL_ERROR_SSL;
-- if (e != 0)
-- /* XXX Protected by global interpreter lock */
-- errstr = ERR_error_string(e, NULL);
-- else { /* possible? */
-+ if (e == 0)
-+ /* possible? */
- errstr = "A failure in the SSL library occurred";
-- }
- break;
- }
- default:
- p = PY_SSL_ERROR_INVALID_ERROR_CODE;
- errstr = "Invalid error code";
- }
-- } else {
-- errstr = ERR_error_string(ERR_peek_last_error(), NULL);
- }
-- PyOS_snprintf(buf, sizeof(buf), "_ssl.c:%d: %s", lineno, errstr);
-+ fill_and_set_sslerror(type, p, errstr, lineno, e);
- ERR_clear_error();
-- v = Py_BuildValue("(is)", p, buf);
-- if (v != NULL) {
-- PyErr_SetObject(PySSLErrorObject, v);
-- Py_DECREF(v);
-- }
- return NULL;
- }
-
- static PyObject *
- _setSSLError (char *errstr, int errcode, char *filename, int lineno) {
-
-- char buf[2048];
-- PyObject *v;
--
-- if (errstr == NULL) {
-+ if (errstr == NULL)
- errcode = ERR_peek_last_error();
-- errstr = ERR_error_string(errcode, NULL);
-- }
-- PyOS_snprintf(buf, sizeof(buf), "_ssl.c:%d: %s", lineno, errstr);
-+ else
-+ errcode = 0;
-+ fill_and_set_sslerror(PySSLErrorObject, errcode, errstr, lineno, errcode);
- ERR_clear_error();
-- v = Py_BuildValue("(is)", errcode, buf);
-- if (v != NULL) {
-- PyErr_SetObject(PySSLErrorObject, v);
-- Py_DECREF(v);
-- }
- return NULL;
- }
-
--static PySSLObject *
--newPySSLObject(PySocketSockObject *Sock, char *key_file, char *cert_file,
-+/*
-+ * SSL objects
-+ */
-+
-+static PySSLSocket *
-+newPySSLSocket(PySSLContext *sslctx, PySocketSockObject *sock,
- enum py_ssl_server_or_client socket_type,
-- enum py_ssl_cert_requirements certreq,
-- enum py_ssl_version proto_version,
-- char *cacerts_file, char *ciphers)
-+ char *server_hostname, PyObject *ssl_sock)
- {
-- PySSLObject *self;
-- char *errstr = NULL;
-- int ret;
-- int verification_mode;
-- long options;
-+ PySSLSocket *self;
-+ SSL_CTX *ctx = sslctx->ctx;
-+ long mode;
-
-- self = PyObject_New(PySSLObject, &PySSL_Type); /* Create new object */
-+ self = PyObject_New(PySSLSocket, &PySSLSocket_Type);
- if (self == NULL)
- return NULL;
-- memset(self->server, '\0', sizeof(char) * X509_NAME_MAXLEN);
-- memset(self->issuer, '\0', sizeof(char) * X509_NAME_MAXLEN);
-+
- self->peer_cert = NULL;
- self->ssl = NULL;
-- self->ctx = NULL;
- self->Socket = NULL;
-+ self->ssl_sock = NULL;
-+ self->ctx = sslctx;
- self->shutdown_seen_zero = 0;
-+ self->handshake_done = 0;
-+ Py_INCREF(sslctx);
-
- /* Make sure the SSL error state is initialized */
- (void) ERR_get_state();
- ERR_clear_error();
-
-- if ((key_file && !cert_file) || (!key_file && cert_file)) {
-- errstr = ERRSTR("Both the key & certificate files "
-- "must be specified");
-- goto fail;
-- }
--
-- if ((socket_type == PY_SSL_SERVER) &&
-- ((key_file == NULL) || (cert_file == NULL))) {
-- errstr = ERRSTR("Both the key & certificate files "
-- "must be specified for server-side operation");
-- goto fail;
-- }
--
-- PySSL_BEGIN_ALLOW_THREADS
-- if (proto_version == PY_SSL_VERSION_TLS1)
-- self->ctx = SSL_CTX_new(TLSv1_method()); /* Set up context */
-- else if (proto_version == PY_SSL_VERSION_SSL3)
-- self->ctx = SSL_CTX_new(SSLv3_method()); /* Set up context */
--#ifndef OPENSSL_NO_SSL2
-- else if (proto_version == PY_SSL_VERSION_SSL2)
-- self->ctx = SSL_CTX_new(SSLv2_method()); /* Set up context */
--#endif
-- else if (proto_version == PY_SSL_VERSION_SSL23)
-- self->ctx = SSL_CTX_new(SSLv23_method()); /* Set up context */
-- PySSL_END_ALLOW_THREADS
--
-- if (self->ctx == NULL) {
-- errstr = ERRSTR("Invalid SSL protocol variant specified.");
-- goto fail;
-- }
--
-- if (ciphers != NULL) {
-- ret = SSL_CTX_set_cipher_list(self->ctx, ciphers);
-- if (ret == 0) {
-- errstr = ERRSTR("No cipher can be selected.");
-- goto fail;
-- }
-- }
--
-- if (certreq != PY_SSL_CERT_NONE) {
-- if (cacerts_file == NULL) {
-- errstr = ERRSTR("No root certificates specified for "
-- "verification of other-side certificates.");
-- goto fail;
-- } else {
-- PySSL_BEGIN_ALLOW_THREADS
-- ret = SSL_CTX_load_verify_locations(self->ctx,
-- cacerts_file,
-- NULL);
-- PySSL_END_ALLOW_THREADS
-- if (ret != 1) {
-- _setSSLError(NULL, 0, __FILE__, __LINE__);
-- goto fail;
-- }
-- }
-- }
-- if (key_file) {
-- PySSL_BEGIN_ALLOW_THREADS
-- ret = SSL_CTX_use_PrivateKey_file(self->ctx, key_file,
-- SSL_FILETYPE_PEM);
-- PySSL_END_ALLOW_THREADS
-- if (ret != 1) {
-- _setSSLError(NULL, ret, __FILE__, __LINE__);
-- goto fail;
-- }
--
-- PySSL_BEGIN_ALLOW_THREADS
-- ret = SSL_CTX_use_certificate_chain_file(self->ctx,
-- cert_file);
-- PySSL_END_ALLOW_THREADS
-- if (ret != 1) {
-- /*
-- fprintf(stderr, "ret is %d, errcode is %lu, %lu, with file
\"%s\"\n",
-- ret, ERR_peek_error(), ERR_peek_last_error(), cert_file);
-- */
-- if (ERR_peek_last_error() != 0) {
-- _setSSLError(NULL, ret, __FILE__, __LINE__);
-- goto fail;
-- }
-- }
-- }
--
-- /* ssl compatibility */
-- options = SSL_OP_ALL & ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS;
-- if (proto_version != PY_SSL_VERSION_SSL2)
-- options |= SSL_OP_NO_SSLv2;
-- SSL_CTX_set_options(self->ctx, options);
--
-- verification_mode = SSL_VERIFY_NONE;
-- if (certreq == PY_SSL_CERT_OPTIONAL)
-- verification_mode = SSL_VERIFY_PEER;
-- else if (certreq == PY_SSL_CERT_REQUIRED)
-- verification_mode = (SSL_VERIFY_PEER |
-- SSL_VERIFY_FAIL_IF_NO_PEER_CERT);
-- SSL_CTX_set_verify(self->ctx, verification_mode,
-- NULL); /* set verify lvl */
--
- PySSL_BEGIN_ALLOW_THREADS
-- self->ssl = SSL_new(self->ctx); /* New ssl struct */
-+ self->ssl = SSL_new(ctx);
- PySSL_END_ALLOW_THREADS
-- SSL_set_fd(self->ssl, Sock->sock_fd); /* Set the socket for SSL */
-+ SSL_set_app_data(self->ssl,self);
-+ SSL_set_fd(self->ssl, Py_SAFE_DOWNCAST(sock->sock_fd, SOCKET_T, int));
-+ mode = SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER;
- #ifdef SSL_MODE_AUTO_RETRY
-- SSL_set_mode(self->ssl, SSL_MODE_AUTO_RETRY);
-+ mode |= SSL_MODE_AUTO_RETRY;
-+#endif
-+ SSL_set_mode(self->ssl, mode);
-+
-+#if HAVE_SNI
-+ if (server_hostname != NULL)
-+ SSL_set_tlsext_host_name(self->ssl, server_hostname);
- #endif
-
- /* If the socket is in non-blocking mode or timeout mode, set the BIO
- * to non-blocking mode (blocking is the default)
- */
-- if (Sock->sock_timeout >= 0.0) {
-- /* Set both the read and write BIO's to non-blocking mode */
-+ if (sock->sock_timeout >= 0.0) {
- BIO_set_nbio(SSL_get_rbio(self->ssl), 1);
- BIO_set_nbio(SSL_get_wbio(self->ssl), 1);
- }
-@@ -411,65 +514,31 @@ newPySSLObject(PySocketSockObject *Sock, char *key_file, char
*cert_file,
- SSL_set_accept_state(self->ssl);
- PySSL_END_ALLOW_THREADS
-
-- self->Socket = Sock;
-+ self->socket_type = socket_type;
-+ self->Socket = sock;
- Py_INCREF(self->Socket);
-- return self;
-- fail:
-- if (errstr)
-- PyErr_SetString(PySSLErrorObject, errstr);
-- Py_DECREF(self);
-- return NULL;
--}
--
--static PyObject *
--PySSL_sslwrap(PyObject *self, PyObject *args)
--{
-- PySocketSockObject *Sock;
-- int server_side = 0;
-- int verification_mode = PY_SSL_CERT_NONE;
-- int protocol = PY_SSL_VERSION_SSL23;
-- char *key_file = NULL;
-- char *cert_file = NULL;
-- char *cacerts_file = NULL;
-- char *ciphers = NULL;
--
-- if (!PyArg_ParseTuple(args, "O!i|zziizz:sslwrap",
-- PySocketModule.Sock_Type,
-- &Sock,
-- &server_side,
-- &key_file, &cert_file,
-- &verification_mode, &protocol,
-- &cacerts_file, &ciphers))
-+ self->ssl_sock = PyWeakref_NewRef(ssl_sock, NULL);
-+ if (self->ssl_sock == NULL) {
-+ Py_DECREF(self);
- return NULL;
--
-- /*
-- fprintf(stderr,
-- "server_side is %d, keyfile %p, certfile %p, verify_mode %d, "
-- "protocol %d, certs %p\n",
-- server_side, key_file, cert_file, verification_mode,
-- protocol, cacerts_file);
-- */
--
-- return (PyObject *) newPySSLObject(Sock, key_file, cert_file,
-- server_side, verification_mode,
-- protocol, cacerts_file,
-- ciphers);
-+ }
-+ return self;
- }
-
--PyDoc_STRVAR(ssl_doc,
--"sslwrap(socket, server_side, [keyfile, certfile, certs_mode, protocol,\n"
--" cacertsfile, ciphers]) -> sslobject");
-
- /* SSL object methods */
-
--static PyObject *PySSL_SSLdo_handshake(PySSLObject *self)
-+static PyObject *PySSL_SSLdo_handshake(PySSLSocket *self)
- {
- int ret;
- int err;
- int sockstate, nonblocking;
-+ PySocketSockObject *sock = self->Socket;
-+
-+ Py_INCREF(sock);
-
- /* just in case the blocking state of the socket has been changed */
-- nonblocking = (self->Socket->sock_timeout >= 0.0);
-+ nonblocking = (sock->sock_timeout >= 0.0);
- BIO_set_nbio(SSL_get_rbio(self->ssl), nonblocking);
- BIO_set_nbio(SSL_get_wbio(self->ssl), nonblocking);
-
-@@ -480,60 +549,48 @@ static PyObject *PySSL_SSLdo_handshake(PySSLObject *self)
- ret = SSL_do_handshake(self->ssl);
- err = SSL_get_error(self->ssl, ret);
- PySSL_END_ALLOW_THREADS
-- if(PyErr_CheckSignals()) {
-- return NULL;
-- }
-+ if (PyErr_CheckSignals())
-+ goto error;
- if (err == SSL_ERROR_WANT_READ) {
-- sockstate = check_socket_and_wait_for_timeout(self->Socket, 0);
-+ sockstate = check_socket_and_wait_for_timeout(sock, 0);
- } else if (err == SSL_ERROR_WANT_WRITE) {
-- sockstate = check_socket_and_wait_for_timeout(self->Socket, 1);
-+ sockstate = check_socket_and_wait_for_timeout(sock, 1);
- } else {
- sockstate = SOCKET_OPERATION_OK;
- }
- if (sockstate == SOCKET_HAS_TIMED_OUT) {
- PyErr_SetString(PySSLErrorObject,
- ERRSTR("The handshake operation timed out"));
-- return NULL;
-+ goto error;
- } else if (sockstate == SOCKET_HAS_BEEN_CLOSED) {
- PyErr_SetString(PySSLErrorObject,
- ERRSTR("Underlying socket has been closed."));
-- return NULL;
-+ goto error;
- } else if (sockstate == SOCKET_TOO_LARGE_FOR_SELECT) {
- PyErr_SetString(PySSLErrorObject,
- ERRSTR("Underlying socket too large for
select()."));
-- return NULL;
-+ goto error;
- } else if (sockstate == SOCKET_IS_NONBLOCKING) {
- break;
- }
- } while (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE);
-+ Py_DECREF(sock);
- if (ret < 1)
- return PySSL_SetError(self, ret, __FILE__, __LINE__);
-
- if (self->peer_cert)
- X509_free (self->peer_cert);
- PySSL_BEGIN_ALLOW_THREADS
-- if ((self->peer_cert = SSL_get_peer_certificate(self->ssl))) {
-- X509_NAME_oneline(X509_get_subject_name(self->peer_cert),
-- self->server, X509_NAME_MAXLEN);
-- X509_NAME_oneline(X509_get_issuer_name(self->peer_cert),
-- self->issuer, X509_NAME_MAXLEN);
-- }
-+ self->peer_cert = SSL_get_peer_certificate(self->ssl);
- PySSL_END_ALLOW_THREADS
-+ self->handshake_done = 1;
-
- Py_INCREF(Py_None);
- return Py_None;
--}
--
--static PyObject *
--PySSL_server(PySSLObject *self)
--{
-- return PyString_FromString(self->server);
--}
-
--static PyObject *
--PySSL_issuer(PySSLObject *self)
--{
-- return PyString_FromString(self->issuer);
-+error:
-+ Py_DECREF(sock);
-+ return NULL;
- }
-
- static PyObject *
-@@ -639,8 +696,8 @@ _create_tuple_for_X509_NAME (X509_NAME *xname)
- /*
- fprintf(stderr, "RDN level %d, attribute %s: %s\n",
- entry->set,
-- PyString_AS_STRING(PyTuple_GET_ITEM(attr, 0)),
-- PyString_AS_STRING(PyTuple_GET_ITEM(attr, 1)));
-+ PyBytes_AS_STRING(PyTuple_GET_ITEM(attr, 0)),
-+ PyBytes_AS_STRING(PyTuple_GET_ITEM(attr, 1)));
- */
- if (attr == NULL)
- goto fail1;
-@@ -727,21 +784,24 @@ _get_peer_alt_names (X509 *certificate) {
- /* now decode the altName */
- ext = X509_get_ext(certificate, i);
- if(!(method = X509V3_EXT_get(ext))) {
-- PyErr_SetString(PySSLErrorObject,
-- ERRSTR("No method for internalizing
subjectAltName!"));
-+ PyErr_SetString
-+ (PySSLErrorObject,
-+ ERRSTR("No method for internalizing subjectAltName!"));
- goto fail;
- }
-
- p = ext->value->data;
- if (method->it)
-- names = (GENERAL_NAMES*) (ASN1_item_d2i(NULL,
-- &p,
-- ext->value->length,
-- ASN1_ITEM_ptr(method->it)));
-+ names = (GENERAL_NAMES*)
-+ (ASN1_item_d2i(NULL,
-+ &p,
-+ ext->value->length,
-+ ASN1_ITEM_ptr(method->it)));
- else
-- names = (GENERAL_NAMES*) (method->d2i(NULL,
-- &p,
-- ext->value->length));
-+ names = (GENERAL_NAMES*)
-+ (method->d2i(NULL,
-+ &p,
-+ ext->value->length));
-
- for(j = 0; j < sk_GENERAL_NAME_num(names); j++) {
- /* get a rendering of each name in the set of names */
-@@ -888,94 +948,212 @@ _get_peer_alt_names (X509 *certificate) {
- }
-
- static PyObject *
--_decode_certificate (X509 *certificate, int verbose) {
--
-- PyObject *retval = NULL;
-- BIO *biobuf = NULL;
-- PyObject *peer;
-- PyObject *peer_alt_names = NULL;
-- PyObject *issuer;
-- PyObject *version;
-- PyObject *sn_obj;
-- ASN1_INTEGER *serialNumber;
-- char buf[2048];
-- int len;
-- ASN1_TIME *notBefore, *notAfter;
-- PyObject *pnotBefore, *pnotAfter;
--
-- retval = PyDict_New();
-- if (retval == NULL)
-- return NULL;
-+_get_aia_uri(X509 *certificate, int nid) {
-+ PyObject *lst = NULL, *ostr = NULL;
-+ int i, result;
-+ AUTHORITY_INFO_ACCESS *info;
-+
-+ info = X509_get_ext_d2i(certificate, NID_info_access, NULL, NULL);
-+ if ((info == NULL) || (sk_ACCESS_DESCRIPTION_num(info) == 0)) {
-+ return Py_None;
-+ }
-
-- peer = _create_tuple_for_X509_NAME(
-- X509_get_subject_name(certificate));
-- if (peer == NULL)
-- goto fail0;
-- if (PyDict_SetItemString(retval, (const char *) "subject", peer) < 0)
{
-- Py_DECREF(peer);
-- goto fail0;
-+ if ((lst = PyList_New(0)) == NULL) {
-+ goto fail;
- }
-- Py_DECREF(peer);
-
-- if (verbose) {
-- issuer = _create_tuple_for_X509_NAME(
-- X509_get_issuer_name(certificate));
-- if (issuer == NULL)
-- goto fail0;
-- if (PyDict_SetItemString(retval, (const char *)"issuer", issuer) <
0) {
-- Py_DECREF(issuer);
-- goto fail0;
-- }
-- Py_DECREF(issuer);
-+ for (i = 0; i < sk_ACCESS_DESCRIPTION_num(info); i++) {
-+ ACCESS_DESCRIPTION *ad = sk_ACCESS_DESCRIPTION_value(info, i);
-+ ASN1_IA5STRING *uri;
-
-- version = PyInt_FromLong(X509_get_version(certificate) + 1);
-- if (PyDict_SetItemString(retval, "version", version) < 0) {
-- Py_DECREF(version);
-- goto fail0;
-+ if ((OBJ_obj2nid(ad->method) != nid) ||
-+ (ad->location->type != GEN_URI)) {
-+ continue;
-+ }
-+ uri = ad->location->d.uniformResourceIdentifier;
-+ ostr = PyUnicode_FromStringAndSize((char *)uri->data,
-+ uri->length);
-+ if (ostr == NULL) {
-+ goto fail;
-+ }
-+ result = PyList_Append(lst, ostr);
-+ Py_DECREF(ostr);
-+ if (result < 0) {
-+ goto fail;
- }
-- Py_DECREF(version);
- }
-+ AUTHORITY_INFO_ACCESS_free(info);
-
-- /* get a memory buffer */
-- biobuf = BIO_new(BIO_s_mem());
--
-- if (verbose) {
-+ /* convert to tuple or None */
-+ if (PyList_Size(lst) == 0) {
-+ Py_DECREF(lst);
-+ return Py_None;
-+ } else {
-+ PyObject *tup;
-+ tup = PyList_AsTuple(lst);
-+ Py_DECREF(lst);
-+ return tup;
-+ }
-
-- (void) BIO_reset(biobuf);
-- serialNumber = X509_get_serialNumber(certificate);
-- /* should not exceed 20 octets, 160 bits, so buf is big enough */
-- i2a_ASN1_INTEGER(biobuf, serialNumber);
-- len = BIO_gets(biobuf, buf, sizeof(buf)-1);
-- if (len < 0) {
-- _setSSLError(NULL, 0, __FILE__, __LINE__);
-- goto fail1;
-- }
-- sn_obj = PyString_FromStringAndSize(buf, len);
-- if (sn_obj == NULL)
-- goto fail1;
-- if (PyDict_SetItemString(retval, "serialNumber", sn_obj) < 0) {
-- Py_DECREF(sn_obj);
-- goto fail1;
-+ fail:
-+ AUTHORITY_INFO_ACCESS_free(info);
-+ Py_XDECREF(lst);
-+ return NULL;
-+}
-+
-+static PyObject *
-+_get_crl_dp(X509 *certificate) {
-+ STACK_OF(DIST_POINT) *dps;
-+ int i, j, result;
-+ PyObject *lst;
-+
-+#if OPENSSL_VERSION_NUMBER < 0x10001000L
-+ dps = X509_get_ext_d2i(certificate, NID_crl_distribution_points,
-+ NULL, NULL);
-+#else
-+ /* Calls x509v3_cache_extensions and sets up crldp */
-+ X509_check_ca(certificate);
-+ dps = certificate->crldp;
-+#endif
-+
-+ if (dps == NULL) {
-+ return Py_None;
-+ }
-+
-+ if ((lst = PyList_New(0)) == NULL) {
-+ return NULL;
-+ }
-+
-+ for (i=0; i < sk_DIST_POINT_num(dps); i++) {
-+ DIST_POINT *dp;
-+ STACK_OF(GENERAL_NAME) *gns;
-+
-+ dp = sk_DIST_POINT_value(dps, i);
-+ gns = dp->distpoint->name.fullname;
-+
-+ for (j=0; j < sk_GENERAL_NAME_num(gns); j++) {
-+ GENERAL_NAME *gn;
-+ ASN1_IA5STRING *uri;
-+ PyObject *ouri;
-+
-+ gn = sk_GENERAL_NAME_value(gns, j);
-+ if (gn->type != GEN_URI) {
-+ continue;
-+ }
-+ uri = gn->d.uniformResourceIdentifier;
-+ ouri = PyUnicode_FromStringAndSize((char *)uri->data,
-+ uri->length);
-+ if (ouri == NULL) {
-+ Py_DECREF(lst);
-+ return NULL;
-+ }
-+ result = PyList_Append(lst, ouri);
-+ Py_DECREF(ouri);
-+ if (result < 0) {
-+ Py_DECREF(lst);
-+ return NULL;
-+ }
- }
-+ }
-+ /* convert to tuple or None */
-+ if (PyList_Size(lst) == 0) {
-+ Py_DECREF(lst);
-+ return Py_None;
-+ } else {
-+ PyObject *tup;
-+ tup = PyList_AsTuple(lst);
-+ Py_DECREF(lst);
-+ return tup;
-+ }
-+}
-+
-+static PyObject *
-+_decode_certificate(X509 *certificate) {
-+
-+ PyObject *retval = NULL;
-+ BIO *biobuf = NULL;
-+ PyObject *peer;
-+ PyObject *peer_alt_names = NULL;
-+ PyObject *issuer;
-+ PyObject *version;
-+ PyObject *sn_obj;
-+ PyObject *obj;
-+ ASN1_INTEGER *serialNumber;
-+ char buf[2048];
-+ int len, result;
-+ ASN1_TIME *notBefore, *notAfter;
-+ PyObject *pnotBefore, *pnotAfter;
-+
-+ retval = PyDict_New();
-+ if (retval == NULL)
-+ return NULL;
-+
-+ peer = _create_tuple_for_X509_NAME(
-+ X509_get_subject_name(certificate));
-+ if (peer == NULL)
-+ goto fail0;
-+ if (PyDict_SetItemString(retval, (const char *) "subject", peer) < 0)
{
-+ Py_DECREF(peer);
-+ goto fail0;
-+ }
-+ Py_DECREF(peer);
-+
-+ issuer = _create_tuple_for_X509_NAME(
-+ X509_get_issuer_name(certificate));
-+ if (issuer == NULL)
-+ goto fail0;
-+ if (PyDict_SetItemString(retval, (const char *)"issuer", issuer) < 0)
{
-+ Py_DECREF(issuer);
-+ goto fail0;
-+ }
-+ Py_DECREF(issuer);
-+
-+ version = PyLong_FromLong(X509_get_version(certificate) + 1);
-+ if (version == NULL)
-+ goto fail0;
-+ if (PyDict_SetItemString(retval, "version", version) < 0) {
-+ Py_DECREF(version);
-+ goto fail0;
-+ }
-+ Py_DECREF(version);
-+
-+ /* get a memory buffer */
-+ biobuf = BIO_new(BIO_s_mem());
-+
-+ (void) BIO_reset(biobuf);
-+ serialNumber = X509_get_serialNumber(certificate);
-+ /* should not exceed 20 octets, 160 bits, so buf is big enough */
-+ i2a_ASN1_INTEGER(biobuf, serialNumber);
-+ len = BIO_gets(biobuf, buf, sizeof(buf)-1);
-+ if (len < 0) {
-+ _setSSLError(NULL, 0, __FILE__, __LINE__);
-+ goto fail1;
-+ }
-+ sn_obj = PyUnicode_FromStringAndSize(buf, len);
-+ if (sn_obj == NULL)
-+ goto fail1;
-+ if (PyDict_SetItemString(retval, "serialNumber", sn_obj) < 0) {
- Py_DECREF(sn_obj);
-+ goto fail1;
-+ }
-+ Py_DECREF(sn_obj);
-
-- (void) BIO_reset(biobuf);
-- notBefore = X509_get_notBefore(certificate);
-- ASN1_TIME_print(biobuf, notBefore);
-- len = BIO_gets(biobuf, buf, sizeof(buf)-1);
-- if (len < 0) {
-- _setSSLError(NULL, 0, __FILE__, __LINE__);
-- goto fail1;
-- }
-- pnotBefore = PyString_FromStringAndSize(buf, len);
-- if (pnotBefore == NULL)
-- goto fail1;
-- if (PyDict_SetItemString(retval, "notBefore", pnotBefore) < 0) {
-- Py_DECREF(pnotBefore);
-- goto fail1;
-- }
-+ (void) BIO_reset(biobuf);
-+ notBefore = X509_get_notBefore(certificate);
-+ ASN1_TIME_print(biobuf, notBefore);
-+ len = BIO_gets(biobuf, buf, sizeof(buf)-1);
-+ if (len < 0) {
-+ _setSSLError(NULL, 0, __FILE__, __LINE__);
-+ goto fail1;
-+ }
-+ pnotBefore = PyUnicode_FromStringAndSize(buf, len);
-+ if (pnotBefore == NULL)
-+ goto fail1;
-+ if (PyDict_SetItemString(retval, "notBefore", pnotBefore) < 0) {
- Py_DECREF(pnotBefore);
-+ goto fail1;
- }
-+ Py_DECREF(pnotBefore);
-
- (void) BIO_reset(biobuf);
- notAfter = X509_get_notAfter(certificate);
-@@ -1008,6 +1186,41 @@ _decode_certificate (X509 *certificate, int verbose) {
- Py_DECREF(peer_alt_names);
- }
-
-+ /* Authority Information Access: OCSP URIs */
-+ obj = _get_aia_uri(certificate, NID_ad_OCSP);
-+ if (obj == NULL) {
-+ goto fail1;
-+ } else if (obj != Py_None) {
-+ result = PyDict_SetItemString(retval, "OCSP", obj);
-+ Py_DECREF(obj);
-+ if (result < 0) {
-+ goto fail1;
-+ }
-+ }
-+
-+ obj = _get_aia_uri(certificate, NID_ad_ca_issuers);
-+ if (obj == NULL) {
-+ goto fail1;
-+ } else if (obj != Py_None) {
-+ result = PyDict_SetItemString(retval, "caIssuers", obj);
-+ Py_DECREF(obj);
-+ if (result < 0) {
-+ goto fail1;
-+ }
-+ }
-+
-+ /* CDP (CRL distribution points) */
-+ obj = _get_crl_dp(certificate);
-+ if (obj == NULL) {
-+ goto fail1;
-+ } else if (obj != Py_None) {
-+ result = PyDict_SetItemString(retval, "crlDistributionPoints", obj);
-+ Py_DECREF(obj);
-+ if (result < 0) {
-+ goto fail1;
-+ }
-+ }
-+
- BIO_free(biobuf);
- return retval;
-
-@@ -1019,6 +1232,24 @@ _decode_certificate (X509 *certificate, int verbose) {
- return NULL;
- }
-
-+static PyObject *
-+_certificate_to_der(X509 *certificate)
-+{
-+ unsigned char *bytes_buf = NULL;
-+ int len;
-+ PyObject *retval;
-+
-+ bytes_buf = NULL;
-+ len = i2d_X509(certificate, &bytes_buf);
-+ if (len < 0) {
-+ _setSSLError(NULL, 0, __FILE__, __LINE__);
-+ return NULL;
-+ }
-+ /* this is actually an immutable bytes sequence */
-+ retval = PyBytes_FromStringAndSize((const char *) bytes_buf, len);
-+ OPENSSL_free(bytes_buf);
-+ return retval;
-+}
-
- static PyObject *
- PySSL_test_decode_certificate (PyObject *mod, PyObject *args) {
-@@ -1027,28 +1258,30 @@ PySSL_test_decode_certificate (PyObject *mod, PyObject *args) {
- char *filename = NULL;
- X509 *x=NULL;
- BIO *cert;
-- int verbose = 1;
-
-- if (!PyArg_ParseTuple(args, "s|i:test_decode_certificate", &filename,
&verbose))
-+ if (!PyArg_ParseTuple(args, "s:test_decode_certificate", &filename))
- return NULL;
-
- if ((cert=BIO_new(BIO_s_file())) == NULL) {
-- PyErr_SetString(PySSLErrorObject, "Can't malloc memory to read
file");
-+ PyErr_SetString(PySSLErrorObject,
-+ "Can't malloc memory to read file");
- goto fail0;
- }
-
- if (BIO_read_filename(cert,filename) <= 0) {
-- PyErr_SetString(PySSLErrorObject, "Can't open file");
-+ PyErr_SetString(PySSLErrorObject,
-+ "Can't open file");
- goto fail0;
- }
-
- x = PEM_read_bio_X509_AUX(cert,NULL, NULL, NULL);
- if (x == NULL) {
-- PyErr_SetString(PySSLErrorObject, "Error decoding PEM-encoded file");
-+ PyErr_SetString(PySSLErrorObject,
-+ "Error decoding PEM-encoded file");
- goto fail0;
- }
-
-- retval = _decode_certificate(x, verbose);
-+ retval = _decode_certificate(x);
- X509_free(x);
-
- fail0:
-@@ -1059,10 +1292,8 @@ PySSL_test_decode_certificate (PyObject *mod, PyObject *args) {
-
-
- static PyObject *
--PySSL_peercert(PySSLObject *self, PyObject *args)
-+PySSL_peercert(PySSLSocket *self, PyObject *args)
- {
-- PyObject *retval = NULL;
-- int len;
- int verification;
- PyObject *binary_mode = Py_None;
- int b;
-@@ -1070,6 +1301,11 @@ PySSL_peercert(PySSLObject *self, PyObject *args)
- if (!PyArg_ParseTuple(args, "|O:peer_certificate", &binary_mode))
- return NULL;
-
-+ if (!self->handshake_done) {
-+ PyErr_SetString(PyExc_ValueError,
-+ "handshake not done yet");
-+ return NULL;
-+ }
- if (!self->peer_cert)
- Py_RETURN_NONE;
-
-@@ -1078,26 +1314,13 @@ PySSL_peercert(PySSLObject *self, PyObject *args)
- return NULL;
- if (b) {
- /* return cert in DER-encoded format */
--
-- unsigned char *bytes_buf = NULL;
--
-- bytes_buf = NULL;
-- len = i2d_X509(self->peer_cert, &bytes_buf);
-- if (len < 0) {
-- PySSL_SetError(self, len, __FILE__, __LINE__);
-- return NULL;
-- }
-- retval = PyString_FromStringAndSize((const char *) bytes_buf, len);
-- OPENSSL_free(bytes_buf);
-- return retval;
--
-+ return _certificate_to_der(self->peer_cert);
- } else {
--
-- verification = SSL_CTX_get_verify_mode(self->ctx);
-+ verification = SSL_CTX_get_verify_mode(SSL_get_SSL_CTX(self->ssl));
- if ((verification & SSL_VERIFY_PEER) == 0)
- return PyDict_New();
- else
-- return _decode_certificate (self->peer_cert, 0);
-+ return _decode_certificate(self->peer_cert);
- }
- }
-
-@@ -1113,7 +1336,7 @@ If the optional argument is True, returns a DER-encoded copy of
the\n\
- peer certificate, or None if no certificate was provided. This will\n\
- return the certificate even if it wasn't validated.");
-
--static PyObject *PySSL_cipher (PySSLObject *self) {
-+static PyObject *PySSL_cipher (PySSLSocket *self) {
-
- PyObject *retval, *v;
- const SSL_CIPHER *current;
-@@ -1140,7 +1363,7 @@ static PyObject *PySSL_cipher (PySSLObject *self) {
- goto fail0;
- PyTuple_SET_ITEM(retval, 0, v);
- }
-- cipher_protocol = SSL_CIPHER_get_version(current);
-+ cipher_protocol = (char *) SSL_CIPHER_get_version(current);
- if (cipher_protocol == NULL) {
- Py_INCREF(Py_None);
- PyTuple_SET_ITEM(retval, 1, Py_None);
-@@ -1161,15 +1384,85 @@ static PyObject *PySSL_cipher (PySSLObject *self) {
- return NULL;
- }
-
--static void PySSL_dealloc(PySSLObject *self)
-+#ifdef OPENSSL_NPN_NEGOTIATED
-+static PyObject *PySSL_selected_npn_protocol(PySSLSocket *self) {
-+ const unsigned char *out;
-+ unsigned int outlen;
-+
-+ SSL_get0_next_proto_negotiated(self->ssl,
-+ &out, &outlen);
-+
-+ if (out == NULL)
-+ Py_RETURN_NONE;
-+ return PyUnicode_FromStringAndSize((char *) out, outlen);
-+}
-+#endif
-+
-+static PyObject *PySSL_compression(PySSLSocket *self) {
-+#ifdef OPENSSL_NO_COMP
-+ Py_RETURN_NONE;
-+#else
-+ const COMP_METHOD *comp_method;
-+ const char *short_name;
-+
-+ if (self->ssl == NULL)
-+ Py_RETURN_NONE;
-+ comp_method = SSL_get_current_compression(self->ssl);
-+ if (comp_method == NULL || comp_method->type == NID_undef)
-+ Py_RETURN_NONE;
-+ short_name = OBJ_nid2sn(comp_method->type);
-+ if (short_name == NULL)
-+ Py_RETURN_NONE;
-+ return PyBytes_FromString(short_name);
-+#endif
-+}
-+
-+static PySSLContext *PySSL_get_context(PySSLSocket *self, void *closure) {
-+ Py_INCREF(self->ctx);
-+ return self->ctx;
-+}
-+
-+static int PySSL_set_context(PySSLSocket *self, PyObject *value,
-+ void *closure) {
-+
-+ if (PyObject_TypeCheck(value, &PySSLContext_Type)) {
-+#if !HAVE_SNI
-+ PyErr_SetString(PyExc_NotImplementedError, "setting a socket's "
-+ "context is not supported by your OpenSSL library");
-+ return -1;
-+#else
-+ Py_INCREF(value);
-+ Py_DECREF(self->ctx);
-+ self->ctx = (PySSLContext *) value;
-+ SSL_set_SSL_CTX(self->ssl, self->ctx->ctx);
-+#endif
-+ } else {
-+ PyErr_SetString(PyExc_TypeError, "The value must be a SSLContext");
-+ return -1;
-+ }
-+
-+ return 0;
-+}
-+
-+PyDoc_STRVAR(PySSL_set_context_doc,
-+"_setter_context(ctx)\n\
-+\
-+This changes the context associated with the SSLSocket. This is typically\n\
-+used from within a callback function set by the set_servername_callback\n\
-+on the SSLContext to change the certificate information associated with the\n\
-+SSLSocket before the cryptographic exchange handshake messages\n");
-+
-+
-+
-+static void PySSL_dealloc(PySSLSocket *self)
- {
- if (self->peer_cert) /* Possible not to have one? */
- X509_free (self->peer_cert);
- if (self->ssl)
- SSL_free(self->ssl);
-- if (self->ctx)
-- SSL_CTX_free(self->ctx);
- Py_XDECREF(self->Socket);
-+ Py_XDECREF(self->ssl_sock);
-+ Py_XDECREF(self->ctx);
- PyObject_Del(self);
- }
-
-@@ -1241,16 +1534,21 @@ normal_return:
- return rc == 0 ? SOCKET_HAS_TIMED_OUT : SOCKET_OPERATION_OK;
- }
-
--static PyObject *PySSL_SSLwrite(PySSLObject *self, PyObject *args)
-+static PyObject *PySSL_SSLwrite(PySSLSocket *self, PyObject *args)
- {
- Py_buffer buf;
- int len;
- int sockstate;
- int err;
- int nonblocking;
-+ PySocketSockObject *sock = self->Socket;
-+
-+ Py_INCREF(sock);
-
-- if (!PyArg_ParseTuple(args, "s*:write", &buf))
-+ if (!PyArg_ParseTuple(args, "s*:write", &buf)) {
-+ Py_DECREF(sock);
- return NULL;
-+ }
-
- if (buf.len > INT_MAX) {
- PyErr_Format(PyExc_OverflowError,
-@@ -1259,11 +1557,11 @@ static PyObject *PySSL_SSLwrite(PySSLObject *self, PyObject
*args)
- }
-
- /* just in case the blocking state of the socket has been changed */
-- nonblocking = (self->Socket->sock_timeout >= 0.0);
-+ nonblocking = (sock->sock_timeout >= 0.0);
- BIO_set_nbio(SSL_get_rbio(self->ssl), nonblocking);
- BIO_set_nbio(SSL_get_wbio(self->ssl), nonblocking);
-
-- sockstate = check_socket_and_wait_for_timeout(self->Socket, 1);
-+ sockstate = check_socket_and_wait_for_timeout(sock, 1);
- if (sockstate == SOCKET_HAS_TIMED_OUT) {
- PyErr_SetString(PySSLErrorObject,
- "The write operation timed out");
-@@ -1286,9 +1584,9 @@ static PyObject *PySSL_SSLwrite(PySSLObject *self, PyObject *args)
- goto error;
- }
- if (err == SSL_ERROR_WANT_READ) {
-- sockstate = check_socket_and_wait_for_timeout(self->Socket, 0);
-+ sockstate = check_socket_and_wait_for_timeout(sock, 0);
- } else if (err == SSL_ERROR_WANT_WRITE) {
-- sockstate = check_socket_and_wait_for_timeout(self->Socket, 1);
-+ sockstate = check_socket_and_wait_for_timeout(sock, 1);
- } else {
- sockstate = SOCKET_OPERATION_OK;
- }
-@@ -1305,6 +1603,7 @@ static PyObject *PySSL_SSLwrite(PySSLObject *self, PyObject *args)
- }
- } while (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE);
-
-+ Py_DECREF(sock);
- PyBuffer_Release(&buf);
- if (len > 0)
- return PyInt_FromLong(len);
-@@ -1312,6 +1611,7 @@ static PyObject *PySSL_SSLwrite(PySSLObject *self, PyObject *args)
- return PySSL_SetError(self, len, __FILE__, __LINE__);
-
- error:
-+ Py_DECREF(sock);
- PyBuffer_Release(&buf);
- return NULL;
- }
-@@ -1322,7 +1622,7 @@ PyDoc_STRVAR(PySSL_SSLwrite_doc,
- Writes the string s into the SSL object. Returns the number\n\
- of bytes written.");
-
--static PyObject *PySSL_SSLpending(PySSLObject *self)
-+static PyObject *PySSL_SSLpending(PySSLSocket *self)
- {
- int count = 0;
-
-@@ -1341,23 +1641,46 @@ PyDoc_STRVAR(PySSL_SSLpending_doc,
- Returns the number of already decrypted bytes available for read,\n\
- pending on the connection.\n");
-
--static PyObject *PySSL_SSLread(PySSLObject *self, PyObject *args)
-+static PyObject *PySSL_SSLread(PySSLSocket *self, PyObject *args)
- {
-- PyObject *buf;
-- int count = 0;
-- int len = 1024;
-+ PyObject *dest = NULL;
-+ Py_buffer buf;
-+ char *mem;
-+ int len, count;
-+ int buf_passed = 0;
- int sockstate;
- int err;
- int nonblocking;
-+ PySocketSockObject *sock = self->Socket;
-
-- if (!PyArg_ParseTuple(args, "|i:read", &len))
-- return NULL;
-+ Py_INCREF(sock);
-
-- if (!(buf = PyString_FromStringAndSize((char *) 0, len)))
-- return NULL;
-+ buf.obj = NULL;
-+ buf.buf = NULL;
-+ if (!PyArg_ParseTuple(args, "i|w*:read", &len, &buf))
-+ goto error;
-+
-+ if ((buf.buf == NULL) && (buf.obj == NULL)) {
-+ dest = PyBytes_FromStringAndSize(NULL, len);
-+ if (dest == NULL)
-+ goto error;
-+ mem = PyBytes_AS_STRING(dest);
-+ }
-+ else {
-+ buf_passed = 1;
-+ mem = buf.buf;
-+ if (len <= 0 || len > buf.len) {
-+ len = (int) buf.len;
-+ if (buf.len != len) {
-+ PyErr_SetString(PyExc_OverflowError,
-+ "maximum length can't fit in a C
'int'");
-+ goto error;
-+ }
-+ }
-+ }
-
- /* just in case the blocking state of the socket has been changed */
-- nonblocking = (self->Socket->sock_timeout >= 0.0);
-+ nonblocking = (sock->sock_timeout >= 0.0);
- BIO_set_nbio(SSL_get_rbio(self->ssl), nonblocking);
- BIO_set_nbio(SSL_get_wbio(self->ssl), nonblocking);
-
-@@ -1367,70 +1690,71 @@ static PyObject *PySSL_SSLread(PySSLObject *self, PyObject
*args)
- PySSL_END_ALLOW_THREADS
-
- if (!count) {
-- sockstate = check_socket_and_wait_for_timeout(self->Socket, 0);
-+ sockstate = check_socket_and_wait_for_timeout(sock, 0);
- if (sockstate == SOCKET_HAS_TIMED_OUT) {
- PyErr_SetString(PySSLErrorObject,
- "The read operation timed out");
-- Py_DECREF(buf);
-- return NULL;
-+ goto error;
- } else if (sockstate == SOCKET_TOO_LARGE_FOR_SELECT) {
- PyErr_SetString(PySSLErrorObject,
- "Underlying socket too large for select().");
-- Py_DECREF(buf);
-- return NULL;
-+ goto error;
- } else if (sockstate == SOCKET_HAS_BEEN_CLOSED) {
-- if (SSL_get_shutdown(self->ssl) !=
-- SSL_RECEIVED_SHUTDOWN)
-- {
-- Py_DECREF(buf);
-- PyErr_SetString(PySSLErrorObject,
-- "Socket closed without SSL shutdown
handshake");
-- return NULL;
-- } else {
-- /* should contain a zero-length string */
-- _PyString_Resize(&buf, 0);
-- return buf;
-- }
-+ count = 0;
-+ goto done;
- }
- }
- do {
- PySSL_BEGIN_ALLOW_THREADS
-- count = SSL_read(self->ssl, PyString_AsString(buf), len);
-+ count = SSL_read(self->ssl, mem, len);
- err = SSL_get_error(self->ssl, count);
- PySSL_END_ALLOW_THREADS
-- if(PyErr_CheckSignals()) {
-- Py_DECREF(buf);
-- return NULL;
-- }
-+ if (PyErr_CheckSignals())
-+ goto error;
- if (err == SSL_ERROR_WANT_READ) {
-- sockstate = check_socket_and_wait_for_timeout(self->Socket, 0);
-+ sockstate = check_socket_and_wait_for_timeout(sock, 0);
- } else if (err == SSL_ERROR_WANT_WRITE) {
-- sockstate = check_socket_and_wait_for_timeout(self->Socket, 1);
-+ sockstate = check_socket_and_wait_for_timeout(sock, 1);
- } else if ((err == SSL_ERROR_ZERO_RETURN) &&
- (SSL_get_shutdown(self->ssl) ==
- SSL_RECEIVED_SHUTDOWN))
- {
-- _PyString_Resize(&buf, 0);
-- return buf;
-+ count = 0;
-+ goto done;
- } else {
- sockstate = SOCKET_OPERATION_OK;
- }
- if (sockstate == SOCKET_HAS_TIMED_OUT) {
- PyErr_SetString(PySSLErrorObject,
- "The read operation timed out");
-- Py_DECREF(buf);
-- return NULL;
-+ goto error;
- } else if (sockstate == SOCKET_IS_NONBLOCKING) {
- break;
- }
- } while (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE);
- if (count <= 0) {
-- Py_DECREF(buf);
-- return PySSL_SetError(self, count, __FILE__, __LINE__);
-+ PySSL_SetError(self, count, __FILE__, __LINE__);
-+ goto error;
-+ }
-+
-+done:
-+ Py_DECREF(sock);
-+ if (!buf_passed) {
-+ _PyBytes_Resize(&dest, count);
-+ return dest;
- }
-- if (count != len)
-- _PyString_Resize(&buf, count);
-- return buf;
-+ else {
-+ PyBuffer_Release(&buf);
-+ return PyLong_FromLong(count);
-+ }
-+
-+error:
-+ Py_DECREF(sock);
-+ if (!buf_passed)
-+ Py_XDECREF(dest);
-+ else
-+ PyBuffer_Release(&buf);
-+ return NULL;
- }
-
- PyDoc_STRVAR(PySSL_SSLread_doc,
-@@ -1438,20 +1762,22 @@ PyDoc_STRVAR(PySSL_SSLread_doc,
- \n\
- Read up to len bytes from the SSL socket.");
-
--static PyObject *PySSL_SSLshutdown(PySSLObject *self)
-+static PyObject *PySSL_SSLshutdown(PySSLSocket *self)
- {
- int err, ssl_err, sockstate, nonblocking;
- int zeros = 0;
-+ PySocketSockObject *sock = self->Socket;
-
- /* Guard against closed socket */
-- if (self->Socket->sock_fd < 0) {
-- PyErr_SetString(PySSLErrorObject,
-- "Underlying socket has been closed.");
-+ if (sock->sock_fd < 0) {
-+ _setSSLError("Underlying socket connection gone",
-+ PY_SSL_ERROR_NO_SOCKET, __FILE__, __LINE__);
- return NULL;
- }
-+ Py_INCREF(sock);
-
- /* Just in case the blocking state of the socket has been changed */
-- nonblocking = (self->Socket->sock_timeout >= 0.0);
-+ nonblocking = (sock->sock_timeout >= 0.0);
- BIO_set_nbio(SSL_get_rbio(self->ssl), nonblocking);
- BIO_set_nbio(SSL_get_wbio(self->ssl), nonblocking);
-
-@@ -1486,9 +1812,9 @@ static PyObject *PySSL_SSLshutdown(PySSLObject *self)
- /* Possibly retry shutdown until timeout or failure */
- ssl_err = SSL_get_error(self->ssl, err);
- if (ssl_err == SSL_ERROR_WANT_READ)
-- sockstate = check_socket_and_wait_for_timeout(self->Socket, 0);
-+ sockstate = check_socket_and_wait_for_timeout(sock, 0);
- else if (ssl_err == SSL_ERROR_WANT_WRITE)
-- sockstate = check_socket_and_wait_for_timeout(self->Socket, 1);
-+ sockstate = check_socket_and_wait_for_timeout(sock, 1);
- else
- break;
- if (sockstate == SOCKET_HAS_TIMED_OUT) {
-@@ -1498,24 +1824,29 @@ static PyObject *PySSL_SSLshutdown(PySSLObject *self)
- else
- PyErr_SetString(PySSLErrorObject,
- "The write operation timed out");
-- return NULL;
-+ goto error;
- }
- else if (sockstate == SOCKET_TOO_LARGE_FOR_SELECT) {
- PyErr_SetString(PySSLErrorObject,
- "Underlying socket too large for select().");
-- return NULL;
-+ goto error;
- }
- else if (sockstate != SOCKET_OPERATION_OK)
- /* Retain the SSL error code */
- break;
- }
-
-- if (err < 0)
-+ if (err < 0) {
-+ Py_DECREF(sock);
- return PySSL_SetError(self, err, __FILE__, __LINE__);
-- else {
-- Py_INCREF(self->Socket);
-- return (PyObject *) (self->Socket);
- }
-+ else
-+ /* It's already INCREF'ed */
-+ return (PyObject *) sock;
-+
-+error:
-+ Py_DECREF(sock);
-+ return NULL;
- }
-
- PyDoc_STRVAR(PySSL_SSLshutdown_doc,
-@@ -1524,6 +1855,47 @@ PyDoc_STRVAR(PySSL_SSLshutdown_doc,
- Does the SSL shutdown handshake with the remote end, and returns\n\
- the underlying socket object.");
-
-+#if HAVE_OPENSSL_FINISHED
-+static PyObject *
-+PySSL_tls_unique_cb(PySSLSocket *self)
-+{
-+ PyObject *retval = NULL;
-+ char buf[PySSL_CB_MAXLEN];
-+ size_t len;
-+
-+ if (SSL_session_reused(self->ssl) ^ !self->socket_type) {
-+ /* if session is resumed XOR we are the client */
-+ len = SSL_get_finished(self->ssl, buf, PySSL_CB_MAXLEN);
-+ }
-+ else {
-+ /* if a new session XOR we are the server */
-+ len = SSL_get_peer_finished(self->ssl, buf, PySSL_CB_MAXLEN);
-+ }
-+
-+ /* It cannot be negative in current OpenSSL version as of July 2011 */
-+ if (len == 0)
-+ Py_RETURN_NONE;
-+
-+ retval = PyBytes_FromStringAndSize(buf, len);
-+
-+ return retval;
-+}
-+
-+PyDoc_STRVAR(PySSL_tls_unique_cb_doc,
-+"tls_unique_cb() -> bytes\n\
-+\n\
-+Returns the 'tls-unique' channel binding data, as defined by RFC 5929.\n\
-+\n\
-+If the TLS handshake is not yet complete, None is returned");
-+
-+#endif /* HAVE_OPENSSL_FINISHED */
-+
-+static PyGetSetDef ssl_getsetlist[] = {
-+ {"context", (getter) PySSL_get_context,
-+ (setter) PySSL_set_context, PySSL_set_context_doc},
-+ {NULL}, /* sentinel */
-+};
-+
- static PyMethodDef PySSLMethods[] = {
- {"do_handshake", (PyCFunction)PySSL_SSLdo_handshake, METH_NOARGS},
- {"write", (PyCFunction)PySSL_SSLwrite, METH_VARARGS,
-@@ -1532,66 +1904,1343 @@ static PyMethodDef PySSLMethods[] = {
- PySSL_SSLread_doc},
- {"pending", (PyCFunction)PySSL_SSLpending, METH_NOARGS,
- PySSL_SSLpending_doc},
-- {"server", (PyCFunction)PySSL_server, METH_NOARGS},
-- {"issuer", (PyCFunction)PySSL_issuer, METH_NOARGS},
- {"peer_certificate", (PyCFunction)PySSL_peercert, METH_VARARGS,
- PySSL_peercert_doc},
- {"cipher", (PyCFunction)PySSL_cipher, METH_NOARGS},
-+#ifdef OPENSSL_NPN_NEGOTIATED
-+ {"selected_npn_protocol", (PyCFunction)PySSL_selected_npn_protocol,
METH_NOARGS},
-+#endif
-+ {"compression", (PyCFunction)PySSL_compression, METH_NOARGS},
- {"shutdown", (PyCFunction)PySSL_SSLshutdown, METH_NOARGS,
- PySSL_SSLshutdown_doc},
-+#if HAVE_OPENSSL_FINISHED
-+ {"tls_unique_cb", (PyCFunction)PySSL_tls_unique_cb, METH_NOARGS,
-+ PySSL_tls_unique_cb_doc},
-+#endif
- {NULL, NULL}
- };
-
--static PyObject *PySSL_getattr(PySSLObject *self, char *name)
--{
-- return Py_FindMethod(PySSLMethods, (PyObject *)self, name);
--}
--
--static PyTypeObject PySSL_Type = {
-+static PyTypeObject PySSLSocket_Type = {
- PyVarObject_HEAD_INIT(NULL, 0)
-- "ssl.SSLContext", /*tp_name*/
-- sizeof(PySSLObject), /*tp_basicsize*/
-+ "_ssl._SSLSocket", /*tp_name*/
-+ sizeof(PySSLSocket), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- /* methods */
- (destructor)PySSL_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
-- (getattrfunc)PySSL_getattr, /*tp_getattr*/
-+ 0, /*tp_getattr*/
- 0, /*tp_setattr*/
-- 0, /*tp_compare*/
-+ 0, /*tp_reserved*/
- 0, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash*/
-+ 0, /*tp_call*/
-+ 0, /*tp_str*/
-+ 0, /*tp_getattro*/
-+ 0, /*tp_setattro*/
-+ 0, /*tp_as_buffer*/
-+ Py_TPFLAGS_DEFAULT, /*tp_flags*/
-+ 0, /*tp_doc*/
-+ 0, /*tp_traverse*/
-+ 0, /*tp_clear*/
-+ 0, /*tp_richcompare*/
-+ 0, /*tp_weaklistoffset*/
-+ 0, /*tp_iter*/
-+ 0, /*tp_iternext*/
-+ PySSLMethods, /*tp_methods*/
-+ 0, /*tp_members*/
-+ ssl_getsetlist, /*tp_getset*/
- };
-
--#ifdef HAVE_OPENSSL_RAND
-
--/* helper routines for seeding the SSL PRNG */
-+/*
-+ * _SSLContext objects
-+ */
-+
- static PyObject *
--PySSL_RAND_add(PyObject *self, PyObject *args)
-+context_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
- {
-- char *buf;
-- int len;
-- double entropy;
-+ char *kwlist[] = {"protocol", NULL};
-+ PySSLContext *self;
-+ int proto_version = PY_SSL_VERSION_SSL23;
-+ long options;
-+ SSL_CTX *ctx = NULL;
-
-- if (!PyArg_ParseTuple(args, "s#d:RAND_add", &buf, &len,
&entropy))
-+ if (!PyArg_ParseTupleAndKeywords(
-+ args, kwds, "i:_SSLContext", kwlist,
-+ &proto_version))
- return NULL;
-- RAND_add(buf, len, entropy);
-- Py_INCREF(Py_None);
-- return Py_None;
--}
--
--PyDoc_STRVAR(PySSL_RAND_add_doc,
--"RAND_add(string, entropy)\n\
--\n\
--Mix string into the OpenSSL PRNG state. entropy (a float) is a lower\n\
--bound on the entropy contained in string. See RFC 1750.");
-
--static PyObject *
--PySSL_RAND_status(PyObject *self)
--{
-- return PyInt_FromLong(RAND_status());
-+ PySSL_BEGIN_ALLOW_THREADS
-+ if (proto_version == PY_SSL_VERSION_TLS1)
-+ ctx = SSL_CTX_new(TLSv1_method());
-+#if HAVE_TLSv1_2
-+ else if (proto_version == PY_SSL_VERSION_TLS1_1)
-+ ctx = SSL_CTX_new(TLSv1_1_method());
-+ else if (proto_version == PY_SSL_VERSION_TLS1_2)
-+ ctx = SSL_CTX_new(TLSv1_2_method());
-+#endif
-+ else if (proto_version == PY_SSL_VERSION_SSL3)
-+ ctx = SSL_CTX_new(SSLv3_method());
-+#ifndef OPENSSL_NO_SSL2
-+ else if (proto_version == PY_SSL_VERSION_SSL2)
-+ ctx = SSL_CTX_new(SSLv2_method());
-+#endif
-+ else if (proto_version == PY_SSL_VERSION_SSL23)
-+ ctx = SSL_CTX_new(SSLv23_method());
-+ else
-+ proto_version = -1;
-+ PySSL_END_ALLOW_THREADS
-+
-+ if (proto_version == -1) {
-+ PyErr_SetString(PyExc_ValueError,
-+ "invalid protocol version");
-+ return NULL;
-+ }
-+ if (ctx == NULL) {
-+ PyErr_SetString(PySSLErrorObject,
-+ "failed to allocate SSL context");
-+ return NULL;
-+ }
-+
-+ assert(type != NULL && type->tp_alloc != NULL);
-+ self = (PySSLContext *) type->tp_alloc(type, 0);
-+ if (self == NULL) {
-+ SSL_CTX_free(ctx);
-+ return NULL;
-+ }
-+ self->ctx = ctx;
-+#ifdef OPENSSL_NPN_NEGOTIATED
-+ self->npn_protocols = NULL;
-+#endif
-+#ifndef OPENSSL_NO_TLSEXT
-+ self->set_hostname = NULL;
-+#endif
-+ /* Don't check host name by default */
-+ self->check_hostname = 0;
-+ /* Defaults */
-+ SSL_CTX_set_verify(self->ctx, SSL_VERIFY_NONE, NULL);
-+ options = SSL_OP_ALL & ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS;
-+ if (proto_version != PY_SSL_VERSION_SSL2)
-+ options |= SSL_OP_NO_SSLv2;
-+ SSL_CTX_set_options(self->ctx, options);
-+
-+#ifndef OPENSSL_NO_ECDH
-+ /* Allow automatic ECDH curve selection (on OpenSSL 1.0.2+), or use
-+ prime256v1 by default. This is Apache mod_ssl's initialization
-+ policy, so we should be safe. */
-+#if defined(SSL_CTX_set_ecdh_auto)
-+ SSL_CTX_set_ecdh_auto(self->ctx, 1);
-+#else
-+ {
-+ EC_KEY *key = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
-+ SSL_CTX_set_tmp_ecdh(self->ctx, key);
-+ EC_KEY_free(key);
-+ }
-+#endif
-+#endif
-+
-+#define SID_CTX "Python"
-+ SSL_CTX_set_session_id_context(self->ctx, (const unsigned char *) SID_CTX,
-+ sizeof(SID_CTX));
-+#undef SID_CTX
-+
-+ return (PyObject *)self;
-+}
-+
-+static int
-+context_traverse(PySSLContext *self, visitproc visit, void *arg)
-+{
-+#ifndef OPENSSL_NO_TLSEXT
-+ Py_VISIT(self->set_hostname);
-+#endif
-+ return 0;
-+}
-+
-+static int
-+context_clear(PySSLContext *self)
-+{
-+#ifndef OPENSSL_NO_TLSEXT
-+ Py_CLEAR(self->set_hostname);
-+#endif
-+ return 0;
-+}
-+
-+static void
-+context_dealloc(PySSLContext *self)
-+{
-+ context_clear(self);
-+ SSL_CTX_free(self->ctx);
-+#ifdef OPENSSL_NPN_NEGOTIATED
-+ PyMem_Free(self->npn_protocols);
-+#endif
-+ Py_TYPE(self)->tp_free(self);
-+}
-+
-+static PyObject *
-+set_ciphers(PySSLContext *self, PyObject *args)
-+{
-+ int ret;
-+ const char *cipherlist;
-+
-+ if (!PyArg_ParseTuple(args, "s:set_ciphers", &cipherlist))
-+ return NULL;
-+ ret = SSL_CTX_set_cipher_list(self->ctx, cipherlist);
-+ if (ret == 0) {
-+ /* Clearing the error queue is necessary on some OpenSSL versions,
-+ otherwise the error will be reported again when another SSL call
-+ is done. */
-+ ERR_clear_error();
-+ PyErr_SetString(PySSLErrorObject,
-+ "No cipher can be selected.");
-+ return NULL;
-+ }
-+ Py_RETURN_NONE;
-+}
-+
-+#ifdef OPENSSL_NPN_NEGOTIATED
-+/* this callback gets passed to SSL_CTX_set_next_protos_advertise_cb */
-+static int
-+_advertiseNPN_cb(SSL *s,
-+ const unsigned char **data, unsigned int *len,
-+ void *args)
-+{
-+ PySSLContext *ssl_ctx = (PySSLContext *) args;
-+
-+ if (ssl_ctx->npn_protocols == NULL) {
-+ *data = (unsigned char *) "";
-+ *len = 0;
-+ } else {
-+ *data = (unsigned char *) ssl_ctx->npn_protocols;
-+ *len = ssl_ctx->npn_protocols_len;
-+ }
-+
-+ return SSL_TLSEXT_ERR_OK;
-+}
-+/* this callback gets passed to SSL_CTX_set_next_proto_select_cb */
-+static int
-+_selectNPN_cb(SSL *s,
-+ unsigned char **out, unsigned char *outlen,
-+ const unsigned char *server, unsigned int server_len,
-+ void *args)
-+{
-+ PySSLContext *ssl_ctx = (PySSLContext *) args;
-+
-+ unsigned char *client = (unsigned char *) ssl_ctx->npn_protocols;
-+ int client_len;
-+
-+ if (client == NULL) {
-+ client = (unsigned char *) "";
-+ client_len = 0;
-+ } else {
-+ client_len = ssl_ctx->npn_protocols_len;
-+ }
-+
-+ SSL_select_next_proto(out, outlen,
-+ server, server_len,
-+ client, client_len);
-+
-+ return SSL_TLSEXT_ERR_OK;
-+}
-+#endif
-+
-+static PyObject *
-+_set_npn_protocols(PySSLContext *self, PyObject *args)
-+{
-+#ifdef OPENSSL_NPN_NEGOTIATED
-+ Py_buffer protos;
-+
-+ if (!PyArg_ParseTuple(args, "s*:set_npn_protocols", &protos))
-+ return NULL;
-+
-+ if (self->npn_protocols != NULL) {
-+ PyMem_Free(self->npn_protocols);
-+ }
-+
-+ self->npn_protocols = PyMem_Malloc(protos.len);
-+ if (self->npn_protocols == NULL) {
-+ PyBuffer_Release(&protos);
-+ return PyErr_NoMemory();
-+ }
-+ memcpy(self->npn_protocols, protos.buf, protos.len);
-+ self->npn_protocols_len = (int) protos.len;
-+
-+ /* set both server and client callbacks, because the context can
-+ * be used to create both types of sockets */
-+ SSL_CTX_set_next_protos_advertised_cb(self->ctx,
-+ _advertiseNPN_cb,
-+ self);
-+ SSL_CTX_set_next_proto_select_cb(self->ctx,
-+ _selectNPN_cb,
-+ self);
-+
-+ PyBuffer_Release(&protos);
-+ Py_RETURN_NONE;
-+#else
-+ PyErr_SetString(PyExc_NotImplementedError,
-+ "The NPN extension requires OpenSSL 1.0.1 or later.");
-+ return NULL;
-+#endif
-+}
-+
-+static PyObject *
-+get_verify_mode(PySSLContext *self, void *c)
-+{
-+ switch (SSL_CTX_get_verify_mode(self->ctx)) {
-+ case SSL_VERIFY_NONE:
-+ return PyLong_FromLong(PY_SSL_CERT_NONE);
-+ case SSL_VERIFY_PEER:
-+ return PyLong_FromLong(PY_SSL_CERT_OPTIONAL);
-+ case SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT:
-+ return PyLong_FromLong(PY_SSL_CERT_REQUIRED);
-+ }
-+ PyErr_SetString(PySSLErrorObject,
-+ "invalid return value from SSL_CTX_get_verify_mode");
-+ return NULL;
-+}
-+
-+static int
-+set_verify_mode(PySSLContext *self, PyObject *arg, void *c)
-+{
-+ int n, mode;
-+ if (!PyArg_Parse(arg, "i", &n))
-+ return -1;
-+ if (n == PY_SSL_CERT_NONE)
-+ mode = SSL_VERIFY_NONE;
-+ else if (n == PY_SSL_CERT_OPTIONAL)
-+ mode = SSL_VERIFY_PEER;
-+ else if (n == PY_SSL_CERT_REQUIRED)
-+ mode = SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT;
-+ else {
-+ PyErr_SetString(PyExc_ValueError,
-+ "invalid value for verify_mode");
-+ return -1;
-+ }
-+ if (mode == SSL_VERIFY_NONE && self->check_hostname) {
-+ PyErr_SetString(PyExc_ValueError,
-+ "Cannot set verify_mode to CERT_NONE when "
-+ "check_hostname is enabled.");
-+ return -1;
-+ }
-+ SSL_CTX_set_verify(self->ctx, mode, NULL);
-+ return 0;
-+}
-+
-+#ifdef HAVE_OPENSSL_VERIFY_PARAM
-+static PyObject *
-+get_verify_flags(PySSLContext *self, void *c)
-+{
-+ X509_STORE *store;
-+ unsigned long flags;
-+
-+ store = SSL_CTX_get_cert_store(self->ctx);
-+ flags = X509_VERIFY_PARAM_get_flags(store->param);
-+ return PyLong_FromUnsignedLong(flags);
-+}
-+
-+static int
-+set_verify_flags(PySSLContext *self, PyObject *arg, void *c)
-+{
-+ X509_STORE *store;
-+ unsigned long new_flags, flags, set, clear;
-+
-+ if (!PyArg_Parse(arg, "k", &new_flags))
-+ return -1;
-+ store = SSL_CTX_get_cert_store(self->ctx);
-+ flags = X509_VERIFY_PARAM_get_flags(store->param);
-+ clear = flags & ~new_flags;
-+ set = ~flags & new_flags;
-+ if (clear) {
-+ if (!X509_VERIFY_PARAM_clear_flags(store->param, clear)) {
-+ _setSSLError(NULL, 0, __FILE__, __LINE__);
-+ return -1;
-+ }
-+ }
-+ if (set) {
-+ if (!X509_VERIFY_PARAM_set_flags(store->param, set)) {
-+ _setSSLError(NULL, 0, __FILE__, __LINE__);
-+ return -1;
-+ }
-+ }
-+ return 0;
-+}
-+#endif
-+
-+static PyObject *
-+get_options(PySSLContext *self, void *c)
-+{
-+ return PyLong_FromLong(SSL_CTX_get_options(self->ctx));
-+}
-+
-+static int
-+set_options(PySSLContext *self, PyObject *arg, void *c)
-+{
-+ long new_opts, opts, set, clear;
-+ if (!PyArg_Parse(arg, "l", &new_opts))
-+ return -1;
-+ opts = SSL_CTX_get_options(self->ctx);
-+ clear = opts & ~new_opts;
-+ set = ~opts & new_opts;
-+ if (clear) {
-+#ifdef HAVE_SSL_CTX_CLEAR_OPTIONS
-+ SSL_CTX_clear_options(self->ctx, clear);
-+#else
-+ PyErr_SetString(PyExc_ValueError,
-+ "can't clear options before OpenSSL 0.9.8m");
-+ return -1;
-+#endif
-+ }
-+ if (set)
-+ SSL_CTX_set_options(self->ctx, set);
-+ return 0;
-+}
-+
-+static PyObject *
-+get_check_hostname(PySSLContext *self, void *c)
-+{
-+ return PyBool_FromLong(self->check_hostname);
-+}
-+
-+static int
-+set_check_hostname(PySSLContext *self, PyObject *arg, void *c)
-+{
-+ PyObject *py_check_hostname;
-+ int check_hostname;
-+ if (!PyArg_Parse(arg, "O", &py_check_hostname))
-+ return -1;
-+
-+ check_hostname = PyObject_IsTrue(py_check_hostname);
-+ if (check_hostname < 0)
-+ return -1;
-+ if (check_hostname &&
-+ SSL_CTX_get_verify_mode(self->ctx) == SSL_VERIFY_NONE) {
-+ PyErr_SetString(PyExc_ValueError,
-+ "check_hostname needs a SSL context with either "
-+ "CERT_OPTIONAL or CERT_REQUIRED");
-+ return -1;
-+ }
-+ self->check_hostname = check_hostname;
-+ return 0;
-+}
-+
-+
-+typedef struct {
-+ PyThreadState *thread_state;
-+ PyObject *callable;
-+ char *password;
-+ int size;
-+ int error;
-+} _PySSLPasswordInfo;
-+
-+static int
-+_pwinfo_set(_PySSLPasswordInfo *pw_info, PyObject* password,
-+ const char *bad_type_error)
-+{
-+ /* Set the password and size fields of a _PySSLPasswordInfo struct
-+ from a unicode, bytes, or byte array object.
-+ The password field will be dynamically allocated and must be freed
-+ by the caller */
-+ PyObject *password_bytes = NULL;
-+ const char *data = NULL;
-+ Py_ssize_t size;
-+
-+ if (PyUnicode_Check(password)) {
-+ password_bytes = PyUnicode_AsEncodedString(password, NULL, NULL);
-+ if (!password_bytes) {
-+ goto error;
-+ }
-+ data = PyBytes_AS_STRING(password_bytes);
-+ size = PyBytes_GET_SIZE(password_bytes);
-+ } else if (PyBytes_Check(password)) {
-+ data = PyBytes_AS_STRING(password);
-+ size = PyBytes_GET_SIZE(password);
-+ } else if (PyByteArray_Check(password)) {
-+ data = PyByteArray_AS_STRING(password);
-+ size = PyByteArray_GET_SIZE(password);
-+ } else {
-+ PyErr_SetString(PyExc_TypeError, bad_type_error);
-+ goto error;
-+ }
-+
-+ if (size > (Py_ssize_t)INT_MAX) {
-+ PyErr_Format(PyExc_ValueError,
-+ "password cannot be longer than %d bytes", INT_MAX);
-+ goto error;
-+ }
-+
-+ PyMem_Free(pw_info->password);
-+ pw_info->password = PyMem_Malloc(size);
-+ if (!pw_info->password) {
-+ PyErr_SetString(PyExc_MemoryError,
-+ "unable to allocate password buffer");
-+ goto error;
-+ }
-+ memcpy(pw_info->password, data, size);
-+ pw_info->size = (int)size;
-+
-+ Py_XDECREF(password_bytes);
-+ return 1;
-+
-+error:
-+ Py_XDECREF(password_bytes);
-+ return 0;
-+}
-+
-+static int
-+_password_callback(char *buf, int size, int rwflag, void *userdata)
-+{
-+ _PySSLPasswordInfo *pw_info = (_PySSLPasswordInfo*) userdata;
-+ PyObject *fn_ret = NULL;
-+
-+ PySSL_END_ALLOW_THREADS_S(pw_info->thread_state);
-+
-+ if (pw_info->callable) {
-+ fn_ret = PyObject_CallFunctionObjArgs(pw_info->callable, NULL);
-+ if (!fn_ret) {
-+ /* TODO: It would be nice to move _ctypes_add_traceback() into the
-+ core python API, so we could use it to add a frame here */
-+ goto error;
-+ }
-+
-+ if (!_pwinfo_set(pw_info, fn_ret,
-+ "password callback must return a string")) {
-+ goto error;
-+ }
-+ Py_CLEAR(fn_ret);
-+ }
-+
-+ if (pw_info->size > size) {
-+ PyErr_Format(PyExc_ValueError,
-+ "password cannot be longer than %d bytes", size);
-+ goto error;
-+ }
-+
-+ PySSL_BEGIN_ALLOW_THREADS_S(pw_info->thread_state);
-+ memcpy(buf, pw_info->password, pw_info->size);
-+ return pw_info->size;
-+
-+error:
-+ Py_XDECREF(fn_ret);
-+ PySSL_BEGIN_ALLOW_THREADS_S(pw_info->thread_state);
-+ pw_info->error = 1;
-+ return -1;
-+}
-+
-+static PyObject *
-+load_cert_chain(PySSLContext *self, PyObject *args, PyObject *kwds)
-+{
-+ char *kwlist[] = {"certfile", "keyfile", "password",
NULL};
-+ PyObject *password = NULL;
-+ char *certfile_bytes = NULL, *keyfile_bytes = NULL;
-+ pem_password_cb *orig_passwd_cb = self->ctx->default_passwd_callback;
-+ void *orig_passwd_userdata = self->ctx->default_passwd_callback_userdata;
-+ _PySSLPasswordInfo pw_info = { NULL, NULL, NULL, 0, 0 };
-+ int r;
-+
-+ errno = 0;
-+ ERR_clear_error();
-+ if (!PyArg_ParseTupleAndKeywords(args, kwds,
-+ "et|etO:load_cert_chain", kwlist,
-+ Py_FileSystemDefaultEncoding, &certfile_bytes,
-+ Py_FileSystemDefaultEncoding, &keyfile_bytes,
-+ &password))
-+ return NULL;
-+ if (password && password != Py_None) {
-+ if (PyCallable_Check(password)) {
-+ pw_info.callable = password;
-+ } else if (!_pwinfo_set(&pw_info, password,
-+ "password should be a string or callable")) {
-+ goto error;
-+ }
-+ SSL_CTX_set_default_passwd_cb(self->ctx, _password_callback);
-+ SSL_CTX_set_default_passwd_cb_userdata(self->ctx, &pw_info);
-+ }
-+ PySSL_BEGIN_ALLOW_THREADS_S(pw_info.thread_state);
-+ r = SSL_CTX_use_certificate_chain_file(self->ctx, certfile_bytes);
-+ PySSL_END_ALLOW_THREADS_S(pw_info.thread_state);
-+ if (r != 1) {
-+ if (pw_info.error) {
-+ ERR_clear_error();
-+ /* the password callback has already set the error information */
-+ }
-+ else if (errno != 0) {
-+ ERR_clear_error();
-+ PyErr_SetFromErrno(PyExc_IOError);
-+ }
-+ else {
-+ _setSSLError(NULL, 0, __FILE__, __LINE__);
-+ }
-+ goto error;
-+ }
-+ PySSL_BEGIN_ALLOW_THREADS_S(pw_info.thread_state);
-+ r = SSL_CTX_use_PrivateKey_file(self->ctx,
-+ keyfile_bytes ? keyfile_bytes : certfile_bytes,
-+ SSL_FILETYPE_PEM);
-+ PySSL_END_ALLOW_THREADS_S(pw_info.thread_state);
-+ if (r != 1) {
-+ if (pw_info.error) {
-+ ERR_clear_error();
-+ /* the password callback has already set the error information */
-+ }
-+ else if (errno != 0) {
-+ ERR_clear_error();
-+ PyErr_SetFromErrno(PyExc_IOError);
-+ }
-+ else {
-+ _setSSLError(NULL, 0, __FILE__, __LINE__);
-+ }
-+ goto error;
-+ }
-+ PySSL_BEGIN_ALLOW_THREADS_S(pw_info.thread_state);
-+ r = SSL_CTX_check_private_key(self->ctx);
-+ PySSL_END_ALLOW_THREADS_S(pw_info.thread_state);
-+ if (r != 1) {
-+ _setSSLError(NULL, 0, __FILE__, __LINE__);
-+ goto error;
-+ }
-+ SSL_CTX_set_default_passwd_cb(self->ctx, orig_passwd_cb);
-+ SSL_CTX_set_default_passwd_cb_userdata(self->ctx, orig_passwd_userdata);
-+ PyMem_Free(pw_info.password);
-+ Py_RETURN_NONE;
-+
-+error:
-+ SSL_CTX_set_default_passwd_cb(self->ctx, orig_passwd_cb);
-+ SSL_CTX_set_default_passwd_cb_userdata(self->ctx, orig_passwd_userdata);
-+ PyMem_Free(pw_info.password);
-+ PyMem_Free(keyfile_bytes);
-+ PyMem_Free(certfile_bytes);
-+ return NULL;
-+}
-+
-+/* internal helper function, returns -1 on error
-+ */
-+static int
-+_add_ca_certs(PySSLContext *self, void *data, Py_ssize_t len,
-+ int filetype)
-+{
-+ BIO *biobuf = NULL;
-+ X509_STORE *store;
-+ int retval = 0, err, loaded = 0;
-+
-+ assert(filetype == SSL_FILETYPE_ASN1 || filetype == SSL_FILETYPE_PEM);
-+
-+ if (len <= 0) {
-+ PyErr_SetString(PyExc_ValueError,
-+ "Empty certificate data");
-+ return -1;
-+ } else if (len > INT_MAX) {
-+ PyErr_SetString(PyExc_OverflowError,
-+ "Certificate data is too long.");
-+ return -1;
-+ }
-+
-+ biobuf = BIO_new_mem_buf(data, (int)len);
-+ if (biobuf == NULL) {
-+ _setSSLError("Can't allocate buffer", 0, __FILE__, __LINE__);
-+ return -1;
-+ }
-+
-+ store = SSL_CTX_get_cert_store(self->ctx);
-+ assert(store != NULL);
-+
-+ while (1) {
-+ X509 *cert = NULL;
-+ int r;
-+
-+ if (filetype == SSL_FILETYPE_ASN1) {
-+ cert = d2i_X509_bio(biobuf, NULL);
-+ } else {
-+ cert = PEM_read_bio_X509(biobuf, NULL,
-+ self->ctx->default_passwd_callback,
-+
self->ctx->default_passwd_callback_userdata);
-+ }
-+ if (cert == NULL) {
-+ break;
-+ }
-+ r = X509_STORE_add_cert(store, cert);
-+ X509_free(cert);
-+ if (!r) {
-+ err = ERR_peek_last_error();
-+ if ((ERR_GET_LIB(err) == ERR_LIB_X509) &&
-+ (ERR_GET_REASON(err) == X509_R_CERT_ALREADY_IN_HASH_TABLE)) {
-+ /* cert already in hash table, not an error */
-+ ERR_clear_error();
-+ } else {
-+ break;
-+ }
-+ }
-+ loaded++;
-+ }
-+
-+ err = ERR_peek_last_error();
-+ if ((filetype == SSL_FILETYPE_ASN1) &&
-+ (loaded > 0) &&
-+ (ERR_GET_LIB(err) == ERR_LIB_ASN1) &&
-+ (ERR_GET_REASON(err) == ASN1_R_HEADER_TOO_LONG)) {
-+ /* EOF ASN1 file, not an error */
-+ ERR_clear_error();
-+ retval = 0;
-+ } else if ((filetype == SSL_FILETYPE_PEM) &&
-+ (loaded > 0) &&
-+ (ERR_GET_LIB(err) == ERR_LIB_PEM) &&
-+ (ERR_GET_REASON(err) == PEM_R_NO_START_LINE)) {
-+ /* EOF PEM file, not an error */
-+ ERR_clear_error();
-+ retval = 0;
-+ } else {
-+ _setSSLError(NULL, 0, __FILE__, __LINE__);
-+ retval = -1;
-+ }
-+
-+ BIO_free(biobuf);
-+ return retval;
-+}
-+
-+
-+static PyObject *
-+load_verify_locations(PySSLContext *self, PyObject *args, PyObject *kwds)
-+{
-+ char *kwlist[] = {"cafile", "capath", "cadata",
NULL};
-+ PyObject *cadata = NULL, *cafile = NULL, *capath = NULL;
-+ PyObject *cafile_bytes = NULL, *capath_bytes = NULL;
-+ const char *cafile_buf = NULL, *capath_buf = NULL;
-+ int r = 0, ok = 1;
-+
-+ errno = 0;
-+ if (!PyArg_ParseTupleAndKeywords(args, kwds,
-+ "|OOO:load_verify_locations", kwlist,
-+ &cafile, &capath, &cadata))
-+ return NULL;
-+
-+ if (cafile == Py_None)
-+ cafile = NULL;
-+ if (capath == Py_None)
-+ capath = NULL;
-+ if (cadata == Py_None)
-+ cadata = NULL;
-+
-+ if (cafile == NULL && capath == NULL && cadata == NULL) {
-+ PyErr_SetString(PyExc_TypeError,
-+ "cafile, capath and cadata cannot be all omitted");
-+ goto error;
-+ }
-+
-+ if (cafile) {
-+ cafile_bytes = PyString_AsEncodedObject(
-+ cafile, Py_FileSystemDefaultEncoding, "strict");
-+ if (!cafile_bytes) {
-+ goto error;
-+ }
-+ }
-+ if (capath) {
-+ capath_bytes = PyString_AsEncodedObject(
-+ capath, Py_FileSystemDefaultEncoding, "strict");
-+ if (!capath_bytes) {
-+ goto error;
-+ }
-+ }
-+
-+ /* validata cadata type and load cadata */
-+ if (cadata) {
-+ Py_buffer buf;
-+ PyObject *cadata_ascii = NULL;
-+
-+ if (!PyUnicode_Check(cadata) && PyObject_GetBuffer(cadata, &buf,
PyBUF_SIMPLE) == 0) {
-+ if (!PyBuffer_IsContiguous(&buf, 'C') || buf.ndim > 1) {
-+ PyBuffer_Release(&buf);
-+ PyErr_SetString(PyExc_TypeError,
-+ "cadata should be a contiguous buffer with "
-+ "a single dimension");
-+ goto error;
-+ }
-+ r = _add_ca_certs(self, buf.buf, buf.len, SSL_FILETYPE_ASN1);
-+ PyBuffer_Release(&buf);
-+ if (r == -1) {
-+ goto error;
-+ }
-+ } else {
-+ PyErr_Clear();
-+ cadata_ascii = PyUnicode_AsASCIIString(cadata);
-+ if (cadata_ascii == NULL) {
-+ PyErr_SetString(PyExc_TypeError,
-+ "cadata should be a ASCII string or a "
-+ "bytes-like object");
-+ goto error;
-+ }
-+ r = _add_ca_certs(self,
-+ PyBytes_AS_STRING(cadata_ascii),
-+ PyBytes_GET_SIZE(cadata_ascii),
-+ SSL_FILETYPE_PEM);
-+ Py_DECREF(cadata_ascii);
-+ if (r == -1) {
-+ goto error;
-+ }
-+ }
-+ }
-+
-+ /* load cafile or capath */
-+ if (cafile_bytes || capath_bytes) {
-+ if (cafile)
-+ cafile_buf = PyBytes_AS_STRING(cafile_bytes);
-+ if (capath)
-+ capath_buf = PyBytes_AS_STRING(capath_bytes);
-+ PySSL_BEGIN_ALLOW_THREADS
-+ r = SSL_CTX_load_verify_locations(
-+ self->ctx,
-+ cafile_buf,
-+ capath_buf);
-+ PySSL_END_ALLOW_THREADS
-+ if (r != 1) {
-+ ok = 0;
-+ if (errno != 0) {
-+ ERR_clear_error();
-+ PyErr_SetFromErrno(PyExc_IOError);
-+ }
-+ else {
-+ _setSSLError(NULL, 0, __FILE__, __LINE__);
-+ }
-+ goto error;
-+ }
-+ }
-+ goto end;
-+
-+ error:
-+ ok = 0;
-+ end:
-+ Py_XDECREF(cafile_bytes);
-+ Py_XDECREF(capath_bytes);
-+ if (ok) {
-+ Py_RETURN_NONE;
-+ } else {
-+ return NULL;
-+ }
-+}
-+
-+static PyObject *
-+load_dh_params(PySSLContext *self, PyObject *filepath)
-+{
-+ BIO *bio;
-+ DH *dh;
-+ char *path = PyBytes_AsString(filepath);
-+ if (!path) {
-+ return NULL;
-+ }
-+
-+ bio = BIO_new_file(path, "r");
-+ if (bio == NULL) {
-+ ERR_clear_error();
-+ PyErr_SetFromErrnoWithFilenameObject(PyExc_IOError, filepath);
-+ return NULL;
-+ }
-+ errno = 0;
-+ PySSL_BEGIN_ALLOW_THREADS
-+ dh = PEM_read_bio_DHparams(bio, NULL, NULL, NULL);
-+ BIO_free(bio);
-+ PySSL_END_ALLOW_THREADS
-+ if (dh == NULL) {
-+ if (errno != 0) {
-+ ERR_clear_error();
-+ PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError, filepath);
-+ }
-+ else {
-+ _setSSLError(NULL, 0, __FILE__, __LINE__);
-+ }
-+ return NULL;
-+ }
-+ if (SSL_CTX_set_tmp_dh(self->ctx, dh) == 0)
-+ _setSSLError(NULL, 0, __FILE__, __LINE__);
-+ DH_free(dh);
-+ Py_RETURN_NONE;
-+}
-+
-+static PyObject *
-+context_wrap_socket(PySSLContext *self, PyObject *args, PyObject *kwds)
-+{
-+ char *kwlist[] = {"sock", "server_side",
"server_hostname", "ssl_sock", NULL};
-+ PySocketSockObject *sock;
-+ int server_side = 0;
-+ char *hostname = NULL;
-+ PyObject *hostname_obj, *ssl_sock = Py_None, *res;
-+
-+ /* server_hostname is either None (or absent), or to be encoded
-+ using the idna encoding. */
-+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!i|O!O:_wrap_socket",
kwlist,
-+ PySocketModule.Sock_Type,
-+ &sock, &server_side,
-+ Py_TYPE(Py_None), &hostname_obj,
-+ &ssl_sock)) {
-+ PyErr_Clear();
-+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!iet|O:_wrap_socket",
kwlist,
-+ PySocketModule.Sock_Type,
-+ &sock, &server_side,
-+ "idna", &hostname, &ssl_sock))
-+ return NULL;
-+#if !HAVE_SNI
-+ PyMem_Free(hostname);
-+ PyErr_SetString(PyExc_ValueError, "server_hostname is not supported "
-+ "by your OpenSSL library");
-+ return NULL;
-+#endif
-+ }
-+
-+ res = (PyObject *) newPySSLSocket(self, sock, server_side,
-+ hostname, ssl_sock);
-+ if (hostname != NULL)
-+ PyMem_Free(hostname);
-+ return res;
-+}
-+
-+static PyObject *
-+session_stats(PySSLContext *self, PyObject *unused)
-+{
-+ int r;
-+ PyObject *value, *stats = PyDict_New();
-+ if (!stats)
-+ return NULL;
-+
-+#define ADD_STATS(SSL_NAME, KEY_NAME) \
-+ value = PyLong_FromLong(SSL_CTX_sess_ ## SSL_NAME (self->ctx)); \
-+ if (value == NULL) \
-+ goto error; \
-+ r = PyDict_SetItemString(stats, KEY_NAME, value); \
-+ Py_DECREF(value); \
-+ if (r < 0) \
-+ goto error;
-+
-+ ADD_STATS(number, "number");
-+ ADD_STATS(connect, "connect");
-+ ADD_STATS(connect_good, "connect_good");
-+ ADD_STATS(connect_renegotiate, "connect_renegotiate");
-+ ADD_STATS(accept, "accept");
-+ ADD_STATS(accept_good, "accept_good");
-+ ADD_STATS(accept_renegotiate, "accept_renegotiate");
-+ ADD_STATS(accept, "accept");
-+ ADD_STATS(hits, "hits");
-+ ADD_STATS(misses, "misses");
-+ ADD_STATS(timeouts, "timeouts");
-+ ADD_STATS(cache_full, "cache_full");
-+
-+#undef ADD_STATS
-+
-+ return stats;
-+
-+error:
-+ Py_DECREF(stats);
-+ return NULL;
-+}
-+
-+static PyObject *
-+set_default_verify_paths(PySSLContext *self, PyObject *unused)
-+{
-+ if (!SSL_CTX_set_default_verify_paths(self->ctx)) {
-+ _setSSLError(NULL, 0, __FILE__, __LINE__);
-+ return NULL;
-+ }
-+ Py_RETURN_NONE;
-+}
-+
-+#ifndef OPENSSL_NO_ECDH
-+static PyObject *
-+set_ecdh_curve(PySSLContext *self, PyObject *name)
-+{
-+ char *name_bytes;
-+ int nid;
-+ EC_KEY *key;
-+
-+ name_bytes = PyBytes_AsString(name);
-+ if (!name_bytes) {
-+ return NULL;
-+ }
-+ nid = OBJ_sn2nid(name_bytes);
-+ if (nid == 0) {
-+ PyErr_Format(PyExc_ValueError,
-+ "unknown elliptic curve name %R", name);
-+ return NULL;
-+ }
-+ key = EC_KEY_new_by_curve_name(nid);
-+ if (key == NULL) {
-+ _setSSLError(NULL, 0, __FILE__, __LINE__);
-+ return NULL;
-+ }
-+ SSL_CTX_set_tmp_ecdh(self->ctx, key);
-+ EC_KEY_free(key);
-+ Py_RETURN_NONE;
-+}
-+#endif
-+
-+#if HAVE_SNI && !defined(OPENSSL_NO_TLSEXT)
-+static int
-+_servername_callback(SSL *s, int *al, void *args)
-+{
-+ int ret;
-+ PySSLContext *ssl_ctx = (PySSLContext *) args;
-+ PySSLSocket *ssl;
-+ PyObject *servername_o;
-+ PyObject *servername_idna;
-+ PyObject *result;
-+ /* The high-level ssl.SSLSocket object */
-+ PyObject *ssl_socket;
-+ const char *servername = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name);
-+#ifdef WITH_THREAD
-+ PyGILState_STATE gstate = PyGILState_Ensure();
-+#endif
-+
-+ if (ssl_ctx->set_hostname == NULL) {
-+ /* remove race condition in this the call back while if removing the
-+ * callback is in progress */
-+#ifdef WITH_THREAD
-+ PyGILState_Release(gstate);
-+#endif
-+ return SSL_TLSEXT_ERR_OK;
-+ }
-+
-+ ssl = SSL_get_app_data(s);
-+ assert(PySSLSocket_Check(ssl));
-+ ssl_socket = PyWeakref_GetObject(ssl->ssl_sock);
-+ Py_INCREF(ssl_socket);
-+ if (ssl_socket == Py_None) {
-+ goto error;
-+ }
-+
-+ if (servername == NULL) {
-+ result = PyObject_CallFunctionObjArgs(ssl_ctx->set_hostname, ssl_socket,
-+ Py_None, ssl_ctx, NULL);
-+ }
-+ else {
-+ servername_o = PyBytes_FromString(servername);
-+ if (servername_o == NULL) {
-+ PyErr_WriteUnraisable((PyObject *) ssl_ctx);
-+ goto error;
-+ }
-+ servername_idna = PyUnicode_FromEncodedObject(servername_o, "idna",
NULL);
-+ if (servername_idna == NULL) {
-+ PyErr_WriteUnraisable(servername_o);
-+ Py_DECREF(servername_o);
-+ goto error;
-+ }
-+ Py_DECREF(servername_o);
-+ result = PyObject_CallFunctionObjArgs(ssl_ctx->set_hostname, ssl_socket,
-+ servername_idna, ssl_ctx, NULL);
-+ Py_DECREF(servername_idna);
-+ }
-+ Py_DECREF(ssl_socket);
-+
-+ if (result == NULL) {
-+ PyErr_WriteUnraisable(ssl_ctx->set_hostname);
-+ *al = SSL_AD_HANDSHAKE_FAILURE;
-+ ret = SSL_TLSEXT_ERR_ALERT_FATAL;
-+ }
-+ else {
-+ if (result != Py_None) {
-+ *al = (int) PyLong_AsLong(result);
-+ if (PyErr_Occurred()) {
-+ PyErr_WriteUnraisable(result);
-+ *al = SSL_AD_INTERNAL_ERROR;
-+ }
-+ ret = SSL_TLSEXT_ERR_ALERT_FATAL;
-+ }
-+ else {
-+ ret = SSL_TLSEXT_ERR_OK;
-+ }
-+ Py_DECREF(result);
-+ }
-+
-+#ifdef WITH_THREAD
-+ PyGILState_Release(gstate);
-+#endif
-+ return ret;
-+
-+error:
-+ Py_DECREF(ssl_socket);
-+ *al = SSL_AD_INTERNAL_ERROR;
-+ ret = SSL_TLSEXT_ERR_ALERT_FATAL;
-+#ifdef WITH_THREAD
-+ PyGILState_Release(gstate);
-+#endif
-+ return ret;
-+}
-+#endif
-+
-+PyDoc_STRVAR(PySSL_set_servername_callback_doc,
-+"set_servername_callback(method)\n\
-+\n\
-+This sets a callback that will be called when a server name is provided by\n\
-+the SSL/TLS client in the SNI extension.\n\
-+\n\
-+If the argument is None then the callback is disabled. The method is called\n\
-+with the SSLSocket, the server name as a string, and the SSLContext object.\n\
-+See RFC 6066 for details of the SNI extension.");
-+
-+static PyObject *
-+set_servername_callback(PySSLContext *self, PyObject *args)
-+{
-+#if HAVE_SNI && !defined(OPENSSL_NO_TLSEXT)
-+ PyObject *cb;
-+
-+ if (!PyArg_ParseTuple(args, "O", &cb))
-+ return NULL;
-+
-+ Py_CLEAR(self->set_hostname);
-+ if (cb == Py_None) {
-+ SSL_CTX_set_tlsext_servername_callback(self->ctx, NULL);
-+ }
-+ else {
-+ if (!PyCallable_Check(cb)) {
-+ SSL_CTX_set_tlsext_servername_callback(self->ctx, NULL);
-+ PyErr_SetString(PyExc_TypeError,
-+ "not a callable object");
-+ return NULL;
-+ }
-+ Py_INCREF(cb);
-+ self->set_hostname = cb;
-+ SSL_CTX_set_tlsext_servername_callback(self->ctx, _servername_callback);
-+ SSL_CTX_set_tlsext_servername_arg(self->ctx, self);
-+ }
-+ Py_RETURN_NONE;
-+#else
-+ PyErr_SetString(PyExc_NotImplementedError,
-+ "The TLS extension servername callback, "
-+ "SSL_CTX_set_tlsext_servername_callback, "
-+ "is not in the current OpenSSL library.");
-+ return NULL;
-+#endif
-+}
-+
-+PyDoc_STRVAR(PySSL_get_stats_doc,
-+"cert_store_stats() -> {'crl': int, 'x509_ca': int,
'x509': int}\n\
-+\n\
-+Returns quantities of loaded X.509 certificates. X.509 certificates with a\n\
-+CA extension and certificate revocation lists inside the context's cert\n\
-+store.\n\
-+NOTE: Certificates in a capath directory aren't loaded unless they have\n\
-+been used at least once.");
-+
-+static PyObject *
-+cert_store_stats(PySSLContext *self)
-+{
-+ X509_STORE *store;
-+ X509_OBJECT *obj;
-+ int x509 = 0, crl = 0, pkey = 0, ca = 0, i;
-+
-+ store = SSL_CTX_get_cert_store(self->ctx);
-+ for (i = 0; i < sk_X509_OBJECT_num(store->objs); i++) {
-+ obj = sk_X509_OBJECT_value(store->objs, i);
-+ switch (obj->type) {
-+ case X509_LU_X509:
-+ x509++;
-+ if (X509_check_ca(obj->data.x509)) {
-+ ca++;
-+ }
-+ break;
-+ case X509_LU_CRL:
-+ crl++;
-+ break;
-+ case X509_LU_PKEY:
-+ pkey++;
-+ break;
-+ default:
-+ /* Ignore X509_LU_FAIL, X509_LU_RETRY, X509_LU_PKEY.
-+ * As far as I can tell they are internal states and never
-+ * stored in a cert store */
-+ break;
-+ }
-+ }
-+ return Py_BuildValue("{sisisi}", "x509", x509, "crl",
crl,
-+ "x509_ca", ca);
-+}
-+
-+PyDoc_STRVAR(PySSL_get_ca_certs_doc,
-+"get_ca_certs(binary_form=False) -> list of loaded certificate\n\
-+\n\
-+Returns a list of dicts with information of loaded CA certs. If the\n\
-+optional argument is True, returns a DER-encoded copy of the CA certificate.\n\
-+NOTE: Certificates in a capath directory aren't loaded unless they have\n\
-+been used at least once.");
-+
-+static PyObject *
-+get_ca_certs(PySSLContext *self, PyObject *args, PyObject *kwds)
-+{
-+ char *kwlist[] = {"binary_form", NULL};
-+ X509_STORE *store;
-+ PyObject *ci = NULL, *rlist = NULL, *py_binary_mode = Py_False;
-+ int i;
-+ int binary_mode = 0;
-+
-+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O:get_ca_certs",
-+ kwlist, &py_binary_mode)) {
-+ return NULL;
-+ }
-+ binary_mode = PyObject_IsTrue(py_binary_mode);
-+ if (binary_mode < 0) {
-+ return NULL;
-+ }
-+
-+ if ((rlist = PyList_New(0)) == NULL) {
-+ return NULL;
-+ }
-+
-+ store = SSL_CTX_get_cert_store(self->ctx);
-+ for (i = 0; i < sk_X509_OBJECT_num(store->objs); i++) {
-+ X509_OBJECT *obj;
-+ X509 *cert;
-+
-+ obj = sk_X509_OBJECT_value(store->objs, i);
-+ if (obj->type != X509_LU_X509) {
-+ /* not a x509 cert */
-+ continue;
-+ }
-+ /* CA for any purpose */
-+ cert = obj->data.x509;
-+ if (!X509_check_ca(cert)) {
-+ continue;
-+ }
-+ if (binary_mode) {
-+ ci = _certificate_to_der(cert);
-+ } else {
-+ ci = _decode_certificate(cert);
-+ }
-+ if (ci == NULL) {
-+ goto error;
-+ }
-+ if (PyList_Append(rlist, ci) == -1) {
-+ goto error;
-+ }
-+ Py_CLEAR(ci);
-+ }
-+ return rlist;
-+
-+ error:
-+ Py_XDECREF(ci);
-+ Py_XDECREF(rlist);
-+ return NULL;
-+}
-+
-+
-+static PyGetSetDef context_getsetlist[] = {
-+ {"check_hostname", (getter) get_check_hostname,
-+ (setter) set_check_hostname, NULL},
-+ {"options", (getter) get_options,
-+ (setter) set_options, NULL},
-+#ifdef HAVE_OPENSSL_VERIFY_PARAM
-+ {"verify_flags", (getter) get_verify_flags,
-+ (setter) set_verify_flags, NULL},
-+#endif
-+ {"verify_mode", (getter) get_verify_mode,
-+ (setter) set_verify_mode, NULL},
-+ {NULL}, /* sentinel */
-+};
-+
-+static struct PyMethodDef context_methods[] = {
-+ {"_wrap_socket", (PyCFunction) context_wrap_socket,
-+ METH_VARARGS | METH_KEYWORDS, NULL},
-+ {"set_ciphers", (PyCFunction) set_ciphers,
-+ METH_VARARGS, NULL},
-+ {"_set_npn_protocols", (PyCFunction) _set_npn_protocols,
-+ METH_VARARGS, NULL},
-+ {"load_cert_chain", (PyCFunction) load_cert_chain,
-+ METH_VARARGS | METH_KEYWORDS, NULL},
-+ {"load_dh_params", (PyCFunction) load_dh_params,
-+ METH_O, NULL},
-+ {"load_verify_locations", (PyCFunction) load_verify_locations,
-+ METH_VARARGS | METH_KEYWORDS, NULL},
-+ {"session_stats", (PyCFunction) session_stats,
-+ METH_NOARGS, NULL},
-+ {"set_default_verify_paths", (PyCFunction) set_default_verify_paths,
-+ METH_NOARGS, NULL},
-+#ifndef OPENSSL_NO_ECDH
-+ {"set_ecdh_curve", (PyCFunction) set_ecdh_curve,
-+ METH_O, NULL},
-+#endif
-+ {"set_servername_callback", (PyCFunction) set_servername_callback,
-+ METH_VARARGS, PySSL_set_servername_callback_doc},
-+ {"cert_store_stats", (PyCFunction) cert_store_stats,
-+ METH_NOARGS, PySSL_get_stats_doc},
-+ {"get_ca_certs", (PyCFunction) get_ca_certs,
-+ METH_VARARGS | METH_KEYWORDS, PySSL_get_ca_certs_doc},
-+ {NULL, NULL} /* sentinel */
-+};
-+
-+static PyTypeObject PySSLContext_Type = {
-+ PyVarObject_HEAD_INIT(NULL, 0)
-+ "_ssl._SSLContext", /*tp_name*/
-+ sizeof(PySSLContext), /*tp_basicsize*/
-+ 0, /*tp_itemsize*/
-+ (destructor)context_dealloc, /*tp_dealloc*/
-+ 0, /*tp_print*/
-+ 0, /*tp_getattr*/
-+ 0, /*tp_setattr*/
-+ 0, /*tp_reserved*/
-+ 0, /*tp_repr*/
-+ 0, /*tp_as_number*/
-+ 0, /*tp_as_sequence*/
-+ 0, /*tp_as_mapping*/
-+ 0, /*tp_hash*/
-+ 0, /*tp_call*/
-+ 0, /*tp_str*/
-+ 0, /*tp_getattro*/
-+ 0, /*tp_setattro*/
-+ 0, /*tp_as_buffer*/
-+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-+ 0, /*tp_doc*/
-+ (traverseproc) context_traverse, /*tp_traverse*/
-+ (inquiry) context_clear, /*tp_clear*/
-+ 0, /*tp_richcompare*/
-+ 0, /*tp_weaklistoffset*/
-+ 0, /*tp_iter*/
-+ 0, /*tp_iternext*/
-+ context_methods, /*tp_methods*/
-+ 0, /*tp_members*/
-+ context_getsetlist, /*tp_getset*/
-+ 0, /*tp_base*/
-+ 0, /*tp_dict*/
-+ 0, /*tp_descr_get*/
-+ 0, /*tp_descr_set*/
-+ 0, /*tp_dictoffset*/
-+ 0, /*tp_init*/
-+ 0, /*tp_alloc*/
-+ context_new, /*tp_new*/
-+};
-+
-+
-+
-+#ifdef HAVE_OPENSSL_RAND
-+
-+/* helper routines for seeding the SSL PRNG */
-+static PyObject *
-+PySSL_RAND_add(PyObject *self, PyObject *args)
-+{
-+ char *buf;
-+ Py_ssize_t len, written;
-+ double entropy;
-+
-+ if (!PyArg_ParseTuple(args, "s#d:RAND_add", &buf, &len,
&entropy))
-+ return NULL;
-+ do {
-+ if (len >= INT_MAX) {
-+ written = INT_MAX;
-+ } else {
-+ written = len;
-+ }
-+ RAND_add(buf, (int)written, entropy);
-+ buf += written;
-+ len -= written;
-+ } while (len);
-+ Py_INCREF(Py_None);
-+ return Py_None;
-+}
-+
-+PyDoc_STRVAR(PySSL_RAND_add_doc,
-+"RAND_add(string, entropy)\n\
-+\n\
-+Mix string into the OpenSSL PRNG state. entropy (a float) is a lower\n\
-+bound on the entropy contained in string. See RFC 1750.");
-+
-+static PyObject *
-+PySSL_RAND_status(PyObject *self)
-+{
-+ return PyLong_FromLong(RAND_status());
- }
-
- PyDoc_STRVAR(PySSL_RAND_status_doc,
-@@ -1630,21 +3279,413 @@ fails or if it does not provide enough data to seed
PRNG.");
- #endif /* HAVE_OPENSSL_RAND */
-
-
-+PyDoc_STRVAR(PySSL_get_default_verify_paths_doc,
-+"get_default_verify_paths() -> tuple\n\
-+\n\
-+Return search paths and environment vars that are used by SSLContext's\n\
-+set_default_verify_paths() to load default CAs. The values are\n\
-+'cert_file_env', 'cert_file', 'cert_dir_env',
'cert_dir'.");
-+
-+static PyObject *
-+PySSL_get_default_verify_paths(PyObject *self)
-+{
-+ PyObject *ofile_env = NULL;
-+ PyObject *ofile = NULL;
-+ PyObject *odir_env = NULL;
-+ PyObject *odir = NULL;
-+
-+#define convert(info, target) { \
-+ const char *tmp = (info); \
-+ target = NULL; \
-+ if (!tmp) { Py_INCREF(Py_None); target = Py_None; } \
-+ else { target = PyBytes_FromString(tmp); } \
-+ if (!target) goto error; \
-+ } while(0)
-+
-+ convert(X509_get_default_cert_file_env(), ofile_env);
-+ convert(X509_get_default_cert_file(), ofile);
-+ convert(X509_get_default_cert_dir_env(), odir_env);
-+ convert(X509_get_default_cert_dir(), odir);
-+#undef convert
-+
-+ return Py_BuildValue("NNNN", ofile_env, ofile, odir_env, odir);
-+
-+ error:
-+ Py_XDECREF(ofile_env);
-+ Py_XDECREF(ofile);
-+ Py_XDECREF(odir_env);
-+ Py_XDECREF(odir);
-+ return NULL;
-+}
-+
-+static PyObject*
-+asn1obj2py(ASN1_OBJECT *obj)
-+{
-+ int nid;
-+ const char *ln, *sn;
-+ char buf[100];
-+ Py_ssize_t buflen;
-+
-+ nid = OBJ_obj2nid(obj);
-+ if (nid == NID_undef) {
-+ PyErr_Format(PyExc_ValueError, "Unknown object");
-+ return NULL;
-+ }
-+ sn = OBJ_nid2sn(nid);
-+ ln = OBJ_nid2ln(nid);
-+ buflen = OBJ_obj2txt(buf, sizeof(buf), obj, 1);
-+ if (buflen < 0) {
-+ _setSSLError(NULL, 0, __FILE__, __LINE__);
-+ return NULL;
-+ }
-+ if (buflen) {
-+ return Py_BuildValue("isss#", nid, sn, ln, buf, buflen);
-+ } else {
-+ return Py_BuildValue("issO", nid, sn, ln, Py_None);
-+ }
-+}
-+
-+PyDoc_STRVAR(PySSL_txt2obj_doc,
-+"txt2obj(txt, name=False) -> (nid, shortname, longname, oid)\n\
-+\n\
-+Lookup NID, short name, long name and OID of an ASN1_OBJECT. By default\n\
-+objects are looked up by OID. With name=True short and long name are also\n\
-+matched.");
-+
-+static PyObject*
-+PySSL_txt2obj(PyObject *self, PyObject *args, PyObject *kwds)
-+{
-+ char *kwlist[] = {"txt", "name", NULL};
-+ PyObject *result = NULL;
-+ char *txt;
-+ PyObject *pyname = Py_None;
-+ int name = 0;
-+ ASN1_OBJECT *obj;
-+
-+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|O:txt2obj",
-+ kwlist, &txt, &pyname)) {
-+ return NULL;
-+ }
-+ name = PyObject_IsTrue(pyname);
-+ if (name < 0)
-+ return NULL;
-+ obj = OBJ_txt2obj(txt, name ? 0 : 1);
-+ if (obj == NULL) {
-+ PyErr_Format(PyExc_ValueError, "unknown object '%.100s'",
txt);
-+ return NULL;
-+ }
-+ result = asn1obj2py(obj);
-+ ASN1_OBJECT_free(obj);
-+ return result;
-+}
-+
-+PyDoc_STRVAR(PySSL_nid2obj_doc,
-+"nid2obj(nid) -> (nid, shortname, longname, oid)\n\
-+\n\
-+Lookup NID, short name, long name and OID of an ASN1_OBJECT by NID.");
-+
-+static PyObject*
-+PySSL_nid2obj(PyObject *self, PyObject *args)
-+{
-+ PyObject *result = NULL;
-+ int nid;
-+ ASN1_OBJECT *obj;
-+
-+ if (!PyArg_ParseTuple(args, "i:nid2obj", &nid)) {
-+ return NULL;
-+ }
-+ if (nid < NID_undef) {
-+ PyErr_SetString(PyExc_ValueError, "NID must be positive.");
-+ return NULL;
-+ }
-+ obj = OBJ_nid2obj(nid);
-+ if (obj == NULL) {
-+ PyErr_Format(PyExc_ValueError, "unknown NID %i", nid);
-+ return NULL;
-+ }
-+ result = asn1obj2py(obj);
-+ ASN1_OBJECT_free(obj);
-+ return result;
-+}
-+
-+#ifdef _MSC_VER
-+
-+static PyObject*
-+certEncodingType(DWORD encodingType)
-+{
-+ static PyObject *x509_asn = NULL;
-+ static PyObject *pkcs_7_asn = NULL;
-+
-+ if (x509_asn == NULL) {
-+ x509_asn = PyUnicode_InternFromString("x509_asn");
-+ if (x509_asn == NULL)
-+ return NULL;
-+ }
-+ if (pkcs_7_asn == NULL) {
-+ pkcs_7_asn = PyUnicode_InternFromString("pkcs_7_asn");
-+ if (pkcs_7_asn == NULL)
-+ return NULL;
-+ }
-+ switch(encodingType) {
-+ case X509_ASN_ENCODING:
-+ Py_INCREF(x509_asn);
-+ return x509_asn;
-+ case PKCS_7_ASN_ENCODING:
-+ Py_INCREF(pkcs_7_asn);
-+ return pkcs_7_asn;
-+ default:
-+ return PyLong_FromLong(encodingType);
-+ }
-+}
-+
-+static PyObject*
-+parseKeyUsage(PCCERT_CONTEXT pCertCtx, DWORD flags)
-+{
-+ CERT_ENHKEY_USAGE *usage;
-+ DWORD size, error, i;
-+ PyObject *retval;
-+
-+ if (!CertGetEnhancedKeyUsage(pCertCtx, flags, NULL, &size)) {
-+ error = GetLastError();
-+ if (error == CRYPT_E_NOT_FOUND) {
-+ Py_RETURN_TRUE;
-+ }
-+ return PyErr_SetFromWindowsErr(error);
-+ }
-+
-+ usage = (CERT_ENHKEY_USAGE*)PyMem_Malloc(size);
-+ if (usage == NULL) {
-+ return PyErr_NoMemory();
-+ }
-+
-+ /* Now get the actual enhanced usage property */
-+ if (!CertGetEnhancedKeyUsage(pCertCtx, flags, usage, &size)) {
-+ PyMem_Free(usage);
-+ error = GetLastError();
-+ if (error == CRYPT_E_NOT_FOUND) {
-+ Py_RETURN_TRUE;
-+ }
-+ return PyErr_SetFromWindowsErr(error);
-+ }
-+ retval = PySet_New(NULL);
-+ if (retval == NULL) {
-+ goto error;
-+ }
-+ for (i = 0; i < usage->cUsageIdentifier; ++i) {
-+ if (usage->rgpszUsageIdentifier[i]) {
-+ PyObject *oid;
-+ int err;
-+ oid = PyUnicode_FromString(usage->rgpszUsageIdentifier[i]);
-+ if (oid == NULL) {
-+ Py_CLEAR(retval);
-+ goto error;
-+ }
-+ err = PySet_Add(retval, oid);
-+ Py_DECREF(oid);
-+ if (err == -1) {
-+ Py_CLEAR(retval);
-+ goto error;
-+ }
-+ }
-+ }
-+ error:
-+ PyMem_Free(usage);
-+ return retval;
-+}
-+
-+PyDoc_STRVAR(PySSL_enum_certificates_doc,
-+"enum_certificates(store_name) -> []\n\
-+\n\
-+Retrieve certificates from Windows' cert store. store_name may be one of\n\
-+'CA', 'ROOT' or 'MY'. The system may provide more cert storages,
too.\n\
-+The function returns a list of (bytes, encoding_type, trust) tuples. The\n\
-+encoding_type flag can be interpreted with X509_ASN_ENCODING or\n\
-+PKCS_7_ASN_ENCODING. The trust setting is either a set of OIDs or the\n\
-+boolean True.");
-+
-+static PyObject *
-+PySSL_enum_certificates(PyObject *self, PyObject *args, PyObject *kwds)
-+{
-+ char *kwlist[] = {"store_name", NULL};
-+ char *store_name;
-+ HCERTSTORE hStore = NULL;
-+ PCCERT_CONTEXT pCertCtx = NULL;
-+ PyObject *keyusage = NULL, *cert = NULL, *enc = NULL, *tup = NULL;
-+ PyObject *result = NULL;
-+
-+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|s:enum_certificates",
-+ kwlist, &store_name)) {
-+ return NULL;
-+ }
-+ result = PyList_New(0);
-+ if (result == NULL) {
-+ return NULL;
-+ }
-+ hStore = CertOpenSystemStore((HCRYPTPROV)NULL, store_name);
-+ if (hStore == NULL) {
-+ Py_DECREF(result);
-+ return PyErr_SetFromWindowsErr(GetLastError());
-+ }
-+
-+ while (pCertCtx = CertEnumCertificatesInStore(hStore, pCertCtx)) {
-+ cert = PyBytes_FromStringAndSize((const char*)pCertCtx->pbCertEncoded,
-+ pCertCtx->cbCertEncoded);
-+ if (!cert) {
-+ Py_CLEAR(result);
-+ break;
-+ }
-+ if ((enc = certEncodingType(pCertCtx->dwCertEncodingType)) == NULL) {
-+ Py_CLEAR(result);
-+ break;
-+ }
-+ keyusage = parseKeyUsage(pCertCtx, CERT_FIND_PROP_ONLY_ENHKEY_USAGE_FLAG);
-+ if (keyusage == Py_True) {
-+ Py_DECREF(keyusage);
-+ keyusage = parseKeyUsage(pCertCtx, CERT_FIND_EXT_ONLY_ENHKEY_USAGE_FLAG);
-+ }
-+ if (keyusage == NULL) {
-+ Py_CLEAR(result);
-+ break;
-+ }
-+ if ((tup = PyTuple_New(3)) == NULL) {
-+ Py_CLEAR(result);
-+ break;
-+ }
-+ PyTuple_SET_ITEM(tup, 0, cert);
-+ cert = NULL;
-+ PyTuple_SET_ITEM(tup, 1, enc);
-+ enc = NULL;
-+ PyTuple_SET_ITEM(tup, 2, keyusage);
-+ keyusage = NULL;
-+ if (PyList_Append(result, tup) < 0) {
-+ Py_CLEAR(result);
-+ break;
-+ }
-+ Py_CLEAR(tup);
-+ }
-+ if (pCertCtx) {
-+ /* loop ended with an error, need to clean up context manually */
-+ CertFreeCertificateContext(pCertCtx);
-+ }
-+
-+ /* In error cases cert, enc and tup may not be NULL */
-+ Py_XDECREF(cert);
-+ Py_XDECREF(enc);
-+ Py_XDECREF(keyusage);
-+ Py_XDECREF(tup);
-+
-+ if (!CertCloseStore(hStore, 0)) {
-+ /* This error case might shadow another exception.*/
-+ Py_XDECREF(result);
-+ return PyErr_SetFromWindowsErr(GetLastError());
-+ }
-+ return result;
-+}
-+
-+PyDoc_STRVAR(PySSL_enum_crls_doc,
-+"enum_crls(store_name) -> []\n\
-+\n\
-+Retrieve CRLs from Windows' cert store. store_name may be one of\n\
-+'CA', 'ROOT' or 'MY'. The system may provide more cert storages,
too.\n\
-+The function returns a list of (bytes, encoding_type) tuples. The\n\
-+encoding_type flag can be interpreted with X509_ASN_ENCODING or\n\
-+PKCS_7_ASN_ENCODING.");
-+
-+static PyObject *
-+PySSL_enum_crls(PyObject *self, PyObject *args, PyObject *kwds)
-+{
-+ char *kwlist[] = {"store_name", NULL};
-+ char *store_name;
-+ HCERTSTORE hStore = NULL;
-+ PCCRL_CONTEXT pCrlCtx = NULL;
-+ PyObject *crl = NULL, *enc = NULL, *tup = NULL;
-+ PyObject *result = NULL;
-+
-+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|s:enum_crls",
-+ kwlist, &store_name)) {
-+ return NULL;
-+ }
-+ result = PyList_New(0);
-+ if (result == NULL) {
-+ return NULL;
-+ }
-+ hStore = CertOpenSystemStore((HCRYPTPROV)NULL, store_name);
-+ if (hStore == NULL) {
-+ Py_DECREF(result);
-+ return PyErr_SetFromWindowsErr(GetLastError());
-+ }
-+
-+ while (pCrlCtx = CertEnumCRLsInStore(hStore, pCrlCtx)) {
-+ crl = PyBytes_FromStringAndSize((const char*)pCrlCtx->pbCrlEncoded,
-+ pCrlCtx->cbCrlEncoded);
-+ if (!crl) {
-+ Py_CLEAR(result);
-+ break;
-+ }
-+ if ((enc = certEncodingType(pCrlCtx->dwCertEncodingType)) == NULL) {
-+ Py_CLEAR(result);
-+ break;
-+ }
-+ if ((tup = PyTuple_New(2)) == NULL) {
-+ Py_CLEAR(result);
-+ break;
-+ }
-+ PyTuple_SET_ITEM(tup, 0, crl);
-+ crl = NULL;
-+ PyTuple_SET_ITEM(tup, 1, enc);
-+ enc = NULL;
-+
-+ if (PyList_Append(result, tup) < 0) {
-+ Py_CLEAR(result);
-+ break;
-+ }
-+ Py_CLEAR(tup);
-+ }
-+ if (pCrlCtx) {
-+ /* loop ended with an error, need to clean up context manually */
-+ CertFreeCRLContext(pCrlCtx);
-+ }
-+
-+ /* In error cases cert, enc and tup may not be NULL */
-+ Py_XDECREF(crl);
-+ Py_XDECREF(enc);
-+ Py_XDECREF(tup);
-+
-+ if (!CertCloseStore(hStore, 0)) {
-+ /* This error case might shadow another exception.*/
-+ Py_XDECREF(result);
-+ return PyErr_SetFromWindowsErr(GetLastError());
-+ }
-+ return result;
-+}
-+
-+#endif /* _MSC_VER */
-+
- /* List of functions exported by this module. */
-
- static PyMethodDef PySSL_methods[] = {
-- {"sslwrap", PySSL_sslwrap,
-- METH_VARARGS, ssl_doc},
- {"_test_decode_cert", PySSL_test_decode_certificate,
- METH_VARARGS},
- #ifdef HAVE_OPENSSL_RAND
- {"RAND_add", PySSL_RAND_add, METH_VARARGS,
- PySSL_RAND_add_doc},
-- {"RAND_egd", PySSL_RAND_egd, METH_O,
-+ {"RAND_egd", PySSL_RAND_egd, METH_VARARGS,
- PySSL_RAND_egd_doc},
- {"RAND_status", (PyCFunction)PySSL_RAND_status, METH_NOARGS,
- PySSL_RAND_status_doc},
- #endif
-+ {"get_default_verify_paths", (PyCFunction)PySSL_get_default_verify_paths,
-+ METH_NOARGS, PySSL_get_default_verify_paths_doc},
-+#ifdef _MSC_VER
-+ {"enum_certificates", (PyCFunction)PySSL_enum_certificates,
-+ METH_VARARGS | METH_KEYWORDS, PySSL_enum_certificates_doc},
-+ {"enum_crls", (PyCFunction)PySSL_enum_crls,
-+ METH_VARARGS | METH_KEYWORDS, PySSL_enum_crls_doc},
-+#endif
-+ {"txt2obj", (PyCFunction)PySSL_txt2obj,
-+ METH_VARARGS | METH_KEYWORDS, PySSL_txt2obj_doc},
-+ {"nid2obj", (PyCFunction)PySSL_nid2obj,
-+ METH_VARARGS, PySSL_nid2obj_doc},
- {NULL, NULL} /* Sentinel */
- };
-
-@@ -1672,16 +3713,17 @@ _ssl_thread_id_function (void) {
- }
- #endif
-
--static void _ssl_thread_locking_function (int mode, int n, const char *file, int line)
{
-+static void _ssl_thread_locking_function
-+ (int mode, int n, const char *file, int line) {
- /* this function is needed to perform locking on shared data
- structures. (Note that OpenSSL uses a number of global data
-- structures that will be implicitly shared whenever multiple threads
-- use OpenSSL.) Multi-threaded applications will crash at random if
-- it is not set.
-+ structures that will be implicitly shared whenever multiple
-+ threads use OpenSSL.) Multi-threaded applications will
-+ crash at random if it is not set.
-
-- locking_function() must be able to handle up to CRYPTO_num_locks()
-- different mutex locks. It sets the n-th lock if mode & CRYPTO_LOCK, and
-- releases it otherwise.
-+ locking_function() must be able to handle up to
-+ CRYPTO_num_locks() different mutex locks. It sets the n-th
-+ lock if mode & CRYPTO_LOCK, and releases it otherwise.
-
- file and line are the file number of the function setting the
- lock. They can be useful for debugging.
-@@ -1705,10 +3747,11 @@ static int _setup_ssl_threads(void) {
- if (_ssl_locks == NULL) {
- _ssl_locks_count = CRYPTO_num_locks();
- _ssl_locks = (PyThread_type_lock *)
-- malloc(sizeof(PyThread_type_lock) * _ssl_locks_count);
-+ PyMem_Malloc(sizeof(PyThread_type_lock) * _ssl_locks_count);
- if (_ssl_locks == NULL)
- return 0;
-- memset(_ssl_locks, 0, sizeof(PyThread_type_lock) * _ssl_locks_count);
-+ memset(_ssl_locks, 0,
-+ sizeof(PyThread_type_lock) * _ssl_locks_count);
- for (i = 0; i < _ssl_locks_count; i++) {
- _ssl_locks[i] = PyThread_allocate_lock();
- if (_ssl_locks[i] == NULL) {
-@@ -1716,7 +3759,7 @@ static int _setup_ssl_threads(void) {
- for (j = 0; j < i; j++) {
- PyThread_free_lock(_ssl_locks[j]);
- }
-- free(_ssl_locks);
-+ PyMem_Free(_ssl_locks);
- return 0;
- }
- }
-@@ -1736,14 +3779,39 @@ PyDoc_STRVAR(module_doc,
- "Implementation module for SSL socket operations. See the socket module\n\
- for documentation.");
-
-+
-+
-+
-+static void
-+parse_openssl_version(unsigned long libver,
-+ unsigned int *major, unsigned int *minor,
-+ unsigned int *fix, unsigned int *patch,
-+ unsigned int *status)
-+{
-+ *status = libver & 0xF;
-+ libver >>= 4;
-+ *patch = libver & 0xFF;
-+ libver >>= 8;
-+ *fix = libver & 0xFF;
-+ libver >>= 8;
-+ *minor = libver & 0xFF;
-+ libver >>= 8;
-+ *major = libver & 0xFF;
-+}
-+
- PyMODINIT_FUNC
- init_ssl(void)
- {
- PyObject *m, *d, *r;
- unsigned long libver;
- unsigned int major, minor, fix, patch, status;
-+ struct py_ssl_error_code *errcode;
-+ struct py_ssl_library_code *libcode;
-
-- Py_TYPE(&PySSL_Type) = &PyType_Type;
-+ if (PyType_Ready(&PySSLContext_Type) < 0)
-+ return;
-+ if (PyType_Ready(&PySSLSocket_Type) < 0)
-+ return;
-
- m = Py_InitModule3("_ssl", PySSL_methods, module_doc);
- if (m == NULL)
-@@ -1766,15 +3834,53 @@ init_ssl(void)
- OpenSSL_add_all_algorithms();
-
- /* Add symbols to module dict */
-- PySSLErrorObject = PyErr_NewException("ssl.SSLError",
-- PySocketModule.error,
-- NULL);
-+ PySSLErrorObject = PyErr_NewExceptionWithDoc(
-+ "ssl.SSLError", SSLError_doc,
-+ PySocketModule.error, NULL);
- if (PySSLErrorObject == NULL)
- return;
-- if (PyDict_SetItemString(d, "SSLError", PySSLErrorObject) != 0)
-+ ((PyTypeObject *)PySSLErrorObject)->tp_str = (reprfunc)SSLError_str;
-+
-+ PySSLZeroReturnErrorObject = PyErr_NewExceptionWithDoc(
-+ "ssl.SSLZeroReturnError", SSLZeroReturnError_doc,
-+ PySSLErrorObject, NULL);
-+ PySSLWantReadErrorObject = PyErr_NewExceptionWithDoc(
-+ "ssl.SSLWantReadError", SSLWantReadError_doc,
-+ PySSLErrorObject, NULL);
-+ PySSLWantWriteErrorObject = PyErr_NewExceptionWithDoc(
-+ "ssl.SSLWantWriteError", SSLWantWriteError_doc,
-+ PySSLErrorObject, NULL);
-+ PySSLSyscallErrorObject = PyErr_NewExceptionWithDoc(
-+ "ssl.SSLSyscallError", SSLSyscallError_doc,
-+ PySSLErrorObject, NULL);
-+ PySSLEOFErrorObject = PyErr_NewExceptionWithDoc(
-+ "ssl.SSLEOFError", SSLEOFError_doc,
-+ PySSLErrorObject, NULL);
-+ if (PySSLZeroReturnErrorObject == NULL
-+ || PySSLWantReadErrorObject == NULL
-+ || PySSLWantWriteErrorObject == NULL
-+ || PySSLSyscallErrorObject == NULL
-+ || PySSLEOFErrorObject == NULL)
-+ return;
-+
-+ ((PyTypeObject *)PySSLZeroReturnErrorObject)->tp_str = (reprfunc)SSLError_str;
-+ ((PyTypeObject *)PySSLWantReadErrorObject)->tp_str = (reprfunc)SSLError_str;
-+ ((PyTypeObject *)PySSLWantWriteErrorObject)->tp_str = (reprfunc)SSLError_str;
-+ ((PyTypeObject *)PySSLSyscallErrorObject)->tp_str = (reprfunc)SSLError_str;
-+ ((PyTypeObject *)PySSLEOFErrorObject)->tp_str = (reprfunc)SSLError_str;
-+
-+ if (PyDict_SetItemString(d, "SSLError", PySSLErrorObject) != 0
-+ || PyDict_SetItemString(d, "SSLZeroReturnError",
PySSLZeroReturnErrorObject) != 0
-+ || PyDict_SetItemString(d, "SSLWantReadError",
PySSLWantReadErrorObject) != 0
-+ || PyDict_SetItemString(d, "SSLWantWriteError",
PySSLWantWriteErrorObject) != 0
-+ || PyDict_SetItemString(d, "SSLSyscallError", PySSLSyscallErrorObject)
!= 0
-+ || PyDict_SetItemString(d, "SSLEOFError", PySSLEOFErrorObject) != 0)
-+ return;
-+ if (PyDict_SetItemString(d, "_SSLContext",
-+ (PyObject *)&PySSLContext_Type) != 0)
- return;
-- if (PyDict_SetItemString(d, "SSLType",
-- (PyObject *)&PySSL_Type) != 0)
-+ if (PyDict_SetItemString(d, "_SSLSocket",
-+ (PyObject *)&PySSLSocket_Type) != 0)
- return;
- PyModule_AddIntConstant(m, "SSL_ERROR_ZERO_RETURN",
- PY_SSL_ERROR_ZERO_RETURN);
-@@ -1802,6 +3908,66 @@ init_ssl(void)
- PY_SSL_CERT_OPTIONAL);
- PyModule_AddIntConstant(m, "CERT_REQUIRED",
- PY_SSL_CERT_REQUIRED);
-+ /* CRL verification for verification_flags */
-+ PyModule_AddIntConstant(m, "VERIFY_DEFAULT",
-+ 0);
-+ PyModule_AddIntConstant(m, "VERIFY_CRL_CHECK_LEAF",
-+ X509_V_FLAG_CRL_CHECK);
-+ PyModule_AddIntConstant(m, "VERIFY_CRL_CHECK_CHAIN",
-+ X509_V_FLAG_CRL_CHECK|X509_V_FLAG_CRL_CHECK_ALL);
-+ PyModule_AddIntConstant(m, "VERIFY_X509_STRICT",
-+ X509_V_FLAG_X509_STRICT);
-+
-+ /* Alert Descriptions from ssl.h */
-+ /* note RESERVED constants no longer intended for use have been removed */
-+ /*
http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-par... */
-+
-+#define ADD_AD_CONSTANT(s) \
-+ PyModule_AddIntConstant(m, "ALERT_DESCRIPTION_"#s, \
-+ SSL_AD_##s)
-+
-+ ADD_AD_CONSTANT(CLOSE_NOTIFY);
-+ ADD_AD_CONSTANT(UNEXPECTED_MESSAGE);
-+ ADD_AD_CONSTANT(BAD_RECORD_MAC);
-+ ADD_AD_CONSTANT(RECORD_OVERFLOW);
-+ ADD_AD_CONSTANT(DECOMPRESSION_FAILURE);
-+ ADD_AD_CONSTANT(HANDSHAKE_FAILURE);
-+ ADD_AD_CONSTANT(BAD_CERTIFICATE);
-+ ADD_AD_CONSTANT(UNSUPPORTED_CERTIFICATE);
-+ ADD_AD_CONSTANT(CERTIFICATE_REVOKED);
-+ ADD_AD_CONSTANT(CERTIFICATE_EXPIRED);
-+ ADD_AD_CONSTANT(CERTIFICATE_UNKNOWN);
-+ ADD_AD_CONSTANT(ILLEGAL_PARAMETER);
-+ ADD_AD_CONSTANT(UNKNOWN_CA);
-+ ADD_AD_CONSTANT(ACCESS_DENIED);
-+ ADD_AD_CONSTANT(DECODE_ERROR);
-+ ADD_AD_CONSTANT(DECRYPT_ERROR);
-+ ADD_AD_CONSTANT(PROTOCOL_VERSION);
-+ ADD_AD_CONSTANT(INSUFFICIENT_SECURITY);
-+ ADD_AD_CONSTANT(INTERNAL_ERROR);
-+ ADD_AD_CONSTANT(USER_CANCELLED);
-+ ADD_AD_CONSTANT(NO_RENEGOTIATION);
-+ /* Not all constants are in old OpenSSL versions */
-+#ifdef SSL_AD_UNSUPPORTED_EXTENSION
-+ ADD_AD_CONSTANT(UNSUPPORTED_EXTENSION);
-+#endif
-+#ifdef SSL_AD_CERTIFICATE_UNOBTAINABLE
-+ ADD_AD_CONSTANT(CERTIFICATE_UNOBTAINABLE);
-+#endif
-+#ifdef SSL_AD_UNRECOGNIZED_NAME
-+ ADD_AD_CONSTANT(UNRECOGNIZED_NAME);
-+#endif
-+#ifdef SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE
-+ ADD_AD_CONSTANT(BAD_CERTIFICATE_STATUS_RESPONSE);
-+#endif
-+#ifdef SSL_AD_BAD_CERTIFICATE_HASH_VALUE
-+ ADD_AD_CONSTANT(BAD_CERTIFICATE_HASH_VALUE);
-+#endif
-+#ifdef SSL_AD_UNKNOWN_PSK_IDENTITY
-+ ADD_AD_CONSTANT(UNKNOWN_PSK_IDENTITY);
-+#endif
-+
-+#undef ADD_AD_CONSTANT
-
- /* protocol versions */
- #ifndef OPENSSL_NO_SSL2
-@@ -1814,6 +3980,109 @@ init_ssl(void)
- PY_SSL_VERSION_SSL23);
- PyModule_AddIntConstant(m, "PROTOCOL_TLSv1",
- PY_SSL_VERSION_TLS1);
-+#if HAVE_TLSv1_2
-+ PyModule_AddIntConstant(m, "PROTOCOL_TLSv1_1",
-+ PY_SSL_VERSION_TLS1_1);
-+ PyModule_AddIntConstant(m, "PROTOCOL_TLSv1_2",
-+ PY_SSL_VERSION_TLS1_2);
-+#endif
-+
-+ /* protocol options */
-+ PyModule_AddIntConstant(m, "OP_ALL",
-+ SSL_OP_ALL & ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS);
-+ PyModule_AddIntConstant(m, "OP_NO_SSLv2", SSL_OP_NO_SSLv2);
-+ PyModule_AddIntConstant(m, "OP_NO_SSLv3", SSL_OP_NO_SSLv3);
-+ PyModule_AddIntConstant(m, "OP_NO_TLSv1", SSL_OP_NO_TLSv1);
-+#if HAVE_TLSv1_2
-+ PyModule_AddIntConstant(m, "OP_NO_TLSv1_1", SSL_OP_NO_TLSv1_1);
-+ PyModule_AddIntConstant(m, "OP_NO_TLSv1_2", SSL_OP_NO_TLSv1_2);
-+#endif
-+ PyModule_AddIntConstant(m, "OP_CIPHER_SERVER_PREFERENCE",
-+ SSL_OP_CIPHER_SERVER_PREFERENCE);
-+ PyModule_AddIntConstant(m, "OP_SINGLE_DH_USE", SSL_OP_SINGLE_DH_USE);
-+#ifdef SSL_OP_SINGLE_ECDH_USE
-+ PyModule_AddIntConstant(m, "OP_SINGLE_ECDH_USE", SSL_OP_SINGLE_ECDH_USE);
-+#endif
-+#ifdef SSL_OP_NO_COMPRESSION
-+ PyModule_AddIntConstant(m, "OP_NO_COMPRESSION",
-+ SSL_OP_NO_COMPRESSION);
-+#endif
-+
-+#if HAVE_SNI
-+ r = Py_True;
-+#else
-+ r = Py_False;
-+#endif
-+ Py_INCREF(r);
-+ PyModule_AddObject(m, "HAS_SNI", r);
-+
-+#if HAVE_OPENSSL_FINISHED
-+ r = Py_True;
-+#else
-+ r = Py_False;
-+#endif
-+ Py_INCREF(r);
-+ PyModule_AddObject(m, "HAS_TLS_UNIQUE", r);
-+
-+#ifdef OPENSSL_NO_ECDH
-+ r = Py_False;
-+#else
-+ r = Py_True;
-+#endif
-+ Py_INCREF(r);
-+ PyModule_AddObject(m, "HAS_ECDH", r);
-+
-+#ifdef OPENSSL_NPN_NEGOTIATED
-+ r = Py_True;
-+#else
-+ r = Py_False;
-+#endif
-+ Py_INCREF(r);
-+ PyModule_AddObject(m, "HAS_NPN", r);
-+
-+ /* Mappings for error codes */
-+ err_codes_to_names = PyDict_New();
-+ err_names_to_codes = PyDict_New();
-+ if (err_codes_to_names == NULL || err_names_to_codes == NULL)
-+ return;
-+ errcode = error_codes;
-+ while (errcode->mnemonic != NULL) {
-+ PyObject *mnemo, *key;
-+ mnemo = PyUnicode_FromString(errcode->mnemonic);
-+ key = Py_BuildValue("ii", errcode->library, errcode->reason);
-+ if (mnemo == NULL || key == NULL)
-+ return;
-+ if (PyDict_SetItem(err_codes_to_names, key, mnemo))
-+ return;
-+ if (PyDict_SetItem(err_names_to_codes, mnemo, key))
-+ return;
-+ Py_DECREF(key);
-+ Py_DECREF(mnemo);
-+ errcode++;
-+ }
-+ if (PyModule_AddObject(m, "err_codes_to_names", err_codes_to_names))
-+ return;
-+ if (PyModule_AddObject(m, "err_names_to_codes", err_names_to_codes))
-+ return;
-+
-+ lib_codes_to_names = PyDict_New();
-+ if (lib_codes_to_names == NULL)
-+ return;
-+ libcode = library_codes;
-+ while (libcode->library != NULL) {
-+ PyObject *mnemo, *key;
-+ key = PyLong_FromLong(libcode->code);
-+ mnemo = PyUnicode_FromString(libcode->library);
-+ if (key == NULL || mnemo == NULL)
-+ return;
-+ if (PyDict_SetItem(lib_codes_to_names, key, mnemo))
-+ return;
-+ Py_DECREF(key);
-+ Py_DECREF(mnemo);
-+ libcode++;
-+ }
-+ if (PyModule_AddObject(m, "lib_codes_to_names", lib_codes_to_names))
-+ return;
-
- /* OpenSSL version */
- /* SSLeay() gives us the version of the library linked against,
-@@ -1825,15 +4094,7 @@ init_ssl(void)
- return;
- if (PyModule_AddObject(m, "OPENSSL_VERSION_NUMBER", r))
- return;
-- status = libver & 0xF;
-- libver >>= 4;
-- patch = libver & 0xFF;
-- libver >>= 8;
-- fix = libver & 0xFF;
-- libver >>= 8;
-- minor = libver & 0xFF;
-- libver >>= 8;
-- major = libver & 0xFF;
-+ parse_openssl_version(libver, &major, &minor, &fix, &patch,
&status);
- r = Py_BuildValue("IIIII", major, minor, fix, patch, status);
- if (r == NULL || PyModule_AddObject(m, "OPENSSL_VERSION_INFO", r))
- return;
-@@ -1841,4 +4102,9 @@ init_ssl(void)
- if (r == NULL || PyModule_AddObject(m, "OPENSSL_VERSION", r))
- return;
-
-+ libver = OPENSSL_VERSION_NUMBER;
-+ parse_openssl_version(libver, &major, &minor, &fix, &patch,
&status);
-+ r = Py_BuildValue("IIIII", major, minor, fix, patch, status);
-+ if (r == NULL || PyModule_AddObject(m, "_OPENSSL_API_VERSION", r))
-+ return;
- }
-diff --git a/Modules/_ssl_data.h b/Modules/_ssl_data.h
-new file mode 100644
-index 0000000..81a8d7b
---- /dev/null
-+++ b/Modules/_ssl_data.h
-@@ -0,0 +1,1653 @@
-+/* File generated by Tools/ssl/make_ssl_data.py */
-+/* Generated on 2012-05-16T23:56:40.981382 */
-+
-+static struct py_ssl_library_code library_codes[] = {
-+ {"PEM", ERR_LIB_PEM},
-+ {"SSL", ERR_LIB_SSL},
-+ {"X509", ERR_LIB_X509},
-+ { NULL }
-+};
-+
-+static struct py_ssl_error_code error_codes[] = {
-+ #ifdef PEM_R_BAD_BASE64_DECODE
-+ {"BAD_BASE64_DECODE", ERR_LIB_PEM, PEM_R_BAD_BASE64_DECODE},
-+ #else
-+ {"BAD_BASE64_DECODE", ERR_LIB_PEM, 100},
-+ #endif
-+ #ifdef PEM_R_BAD_DECRYPT
-+ {"BAD_DECRYPT", ERR_LIB_PEM, PEM_R_BAD_DECRYPT},
-+ #else
-+ {"BAD_DECRYPT", ERR_LIB_PEM, 101},
-+ #endif
-+ #ifdef PEM_R_BAD_END_LINE
-+ {"BAD_END_LINE", ERR_LIB_PEM, PEM_R_BAD_END_LINE},
-+ #else
-+ {"BAD_END_LINE", ERR_LIB_PEM, 102},
-+ #endif
-+ #ifdef PEM_R_BAD_IV_CHARS
-+ {"BAD_IV_CHARS", ERR_LIB_PEM, PEM_R_BAD_IV_CHARS},
-+ #else
-+ {"BAD_IV_CHARS", ERR_LIB_PEM, 103},
-+ #endif
-+ #ifdef PEM_R_BAD_MAGIC_NUMBER
-+ {"BAD_MAGIC_NUMBER", ERR_LIB_PEM, PEM_R_BAD_MAGIC_NUMBER},
-+ #else
-+ {"BAD_MAGIC_NUMBER", ERR_LIB_PEM, 116},
-+ #endif
-+ #ifdef PEM_R_BAD_PASSWORD_READ
-+ {"BAD_PASSWORD_READ", ERR_LIB_PEM, PEM_R_BAD_PASSWORD_READ},
-+ #else
-+ {"BAD_PASSWORD_READ", ERR_LIB_PEM, 104},
-+ #endif
-+ #ifdef PEM_R_BAD_VERSION_NUMBER
-+ {"BAD_VERSION_NUMBER", ERR_LIB_PEM, PEM_R_BAD_VERSION_NUMBER},
-+ #else
-+ {"BAD_VERSION_NUMBER", ERR_LIB_PEM, 117},
-+ #endif
-+ #ifdef PEM_R_BIO_WRITE_FAILURE
-+ {"BIO_WRITE_FAILURE", ERR_LIB_PEM, PEM_R_BIO_WRITE_FAILURE},
-+ #else
-+ {"BIO_WRITE_FAILURE", ERR_LIB_PEM, 118},
-+ #endif
-+ #ifdef PEM_R_CIPHER_IS_NULL
-+ {"CIPHER_IS_NULL", ERR_LIB_PEM, PEM_R_CIPHER_IS_NULL},
-+ #else
-+ {"CIPHER_IS_NULL", ERR_LIB_PEM, 127},
-+ #endif
-+ #ifdef PEM_R_ERROR_CONVERTING_PRIVATE_KEY
-+ {"ERROR_CONVERTING_PRIVATE_KEY", ERR_LIB_PEM,
PEM_R_ERROR_CONVERTING_PRIVATE_KEY},
-+ #else
-+ {"ERROR_CONVERTING_PRIVATE_KEY", ERR_LIB_PEM, 115},
-+ #endif
-+ #ifdef PEM_R_EXPECTING_PRIVATE_KEY_BLOB
-+ {"EXPECTING_PRIVATE_KEY_BLOB", ERR_LIB_PEM,
PEM_R_EXPECTING_PRIVATE_KEY_BLOB},
-+ #else
-+ {"EXPECTING_PRIVATE_KEY_BLOB", ERR_LIB_PEM, 119},
-+ #endif
-+ #ifdef PEM_R_EXPECTING_PUBLIC_KEY_BLOB
-+ {"EXPECTING_PUBLIC_KEY_BLOB", ERR_LIB_PEM,
PEM_R_EXPECTING_PUBLIC_KEY_BLOB},
-+ #else
-+ {"EXPECTING_PUBLIC_KEY_BLOB", ERR_LIB_PEM, 120},
-+ #endif
-+ #ifdef PEM_R_INCONSISTENT_HEADER
-+ {"INCONSISTENT_HEADER", ERR_LIB_PEM, PEM_R_INCONSISTENT_HEADER},
-+ #else
-+ {"INCONSISTENT_HEADER", ERR_LIB_PEM, 121},
-+ #endif
-+ #ifdef PEM_R_KEYBLOB_HEADER_PARSE_ERROR
-+ {"KEYBLOB_HEADER_PARSE_ERROR", ERR_LIB_PEM,
PEM_R_KEYBLOB_HEADER_PARSE_ERROR},
-+ #else
-+ {"KEYBLOB_HEADER_PARSE_ERROR", ERR_LIB_PEM, 122},
-+ #endif
-+ #ifdef PEM_R_KEYBLOB_TOO_SHORT
-+ {"KEYBLOB_TOO_SHORT", ERR_LIB_PEM, PEM_R_KEYBLOB_TOO_SHORT},
-+ #else
-+ {"KEYBLOB_TOO_SHORT", ERR_LIB_PEM, 123},
-+ #endif
-+ #ifdef PEM_R_NOT_DEK_INFO
-+ {"NOT_DEK_INFO", ERR_LIB_PEM, PEM_R_NOT_DEK_INFO},
-+ #else
-+ {"NOT_DEK_INFO", ERR_LIB_PEM, 105},
-+ #endif
-+ #ifdef PEM_R_NOT_ENCRYPTED
-+ {"NOT_ENCRYPTED", ERR_LIB_PEM, PEM_R_NOT_ENCRYPTED},
-+ #else
-+ {"NOT_ENCRYPTED", ERR_LIB_PEM, 106},
-+ #endif
-+ #ifdef PEM_R_NOT_PROC_TYPE
-+ {"NOT_PROC_TYPE", ERR_LIB_PEM, PEM_R_NOT_PROC_TYPE},
-+ #else
-+ {"NOT_PROC_TYPE", ERR_LIB_PEM, 107},
-+ #endif
-+ #ifdef PEM_R_NO_START_LINE
-+ {"NO_START_LINE", ERR_LIB_PEM, PEM_R_NO_START_LINE},
-+ #else
-+ {"NO_START_LINE", ERR_LIB_PEM, 108},
-+ #endif
-+ #ifdef PEM_R_PROBLEMS_GETTING_PASSWORD
-+ {"PROBLEMS_GETTING_PASSWORD", ERR_LIB_PEM,
PEM_R_PROBLEMS_GETTING_PASSWORD},
-+ #else
-+ {"PROBLEMS_GETTING_PASSWORD", ERR_LIB_PEM, 109},
-+ #endif
-+ #ifdef PEM_R_PUBLIC_KEY_NO_RSA
-+ {"PUBLIC_KEY_NO_RSA", ERR_LIB_PEM, PEM_R_PUBLIC_KEY_NO_RSA},
-+ #else
-+ {"PUBLIC_KEY_NO_RSA", ERR_LIB_PEM, 110},
-+ #endif
-+ #ifdef PEM_R_PVK_DATA_TOO_SHORT
-+ {"PVK_DATA_TOO_SHORT", ERR_LIB_PEM, PEM_R_PVK_DATA_TOO_SHORT},
-+ #else
-+ {"PVK_DATA_TOO_SHORT", ERR_LIB_PEM, 124},
-+ #endif
-+ #ifdef PEM_R_PVK_TOO_SHORT
-+ {"PVK_TOO_SHORT", ERR_LIB_PEM, PEM_R_PVK_TOO_SHORT},
-+ #else
-+ {"PVK_TOO_SHORT", ERR_LIB_PEM, 125},
-+ #endif
-+ #ifdef PEM_R_READ_KEY
-+ {"READ_KEY", ERR_LIB_PEM, PEM_R_READ_KEY},
-+ #else
-+ {"READ_KEY", ERR_LIB_PEM, 111},
-+ #endif
-+ #ifdef PEM_R_SHORT_HEADER
-+ {"SHORT_HEADER", ERR_LIB_PEM, PEM_R_SHORT_HEADER},
-+ #else
-+ {"SHORT_HEADER", ERR_LIB_PEM, 112},
-+ #endif
-+ #ifdef PEM_R_UNSUPPORTED_CIPHER
-+ {"UNSUPPORTED_CIPHER", ERR_LIB_PEM, PEM_R_UNSUPPORTED_CIPHER},
-+ #else
-+ {"UNSUPPORTED_CIPHER", ERR_LIB_PEM, 113},
-+ #endif
-+ #ifdef PEM_R_UNSUPPORTED_ENCRYPTION
-+ {"UNSUPPORTED_ENCRYPTION", ERR_LIB_PEM, PEM_R_UNSUPPORTED_ENCRYPTION},
-+ #else
-+ {"UNSUPPORTED_ENCRYPTION", ERR_LIB_PEM, 114},
-+ #endif
-+ #ifdef PEM_R_UNSUPPORTED_KEY_COMPONENTS
-+ {"UNSUPPORTED_KEY_COMPONENTS", ERR_LIB_PEM,
PEM_R_UNSUPPORTED_KEY_COMPONENTS},
-+ #else
-+ {"UNSUPPORTED_KEY_COMPONENTS", ERR_LIB_PEM, 126},
-+ #endif
-+ #ifdef SSL_R_APP_DATA_IN_HANDSHAKE
-+ {"APP_DATA_IN_HANDSHAKE", ERR_LIB_SSL, SSL_R_APP_DATA_IN_HANDSHAKE},
-+ #else
-+ {"APP_DATA_IN_HANDSHAKE", ERR_LIB_SSL, 100},
-+ #endif
-+ #ifdef SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT
-+ {"ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT", ERR_LIB_SSL,
SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT},
-+ #else
-+ {"ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT", ERR_LIB_SSL, 272},
-+ #endif
-+ #ifdef SSL_R_BAD_ALERT_RECORD
-+ {"BAD_ALERT_RECORD", ERR_LIB_SSL, SSL_R_BAD_ALERT_RECORD},
-+ #else
-+ {"BAD_ALERT_RECORD", ERR_LIB_SSL, 101},
-+ #endif
-+ #ifdef SSL_R_BAD_AUTHENTICATION_TYPE
-+ {"BAD_AUTHENTICATION_TYPE", ERR_LIB_SSL, SSL_R_BAD_AUTHENTICATION_TYPE},
-+ #else
-+ {"BAD_AUTHENTICATION_TYPE", ERR_LIB_SSL, 102},
-+ #endif
-+ #ifdef SSL_R_BAD_CHANGE_CIPHER_SPEC
-+ {"BAD_CHANGE_CIPHER_SPEC", ERR_LIB_SSL, SSL_R_BAD_CHANGE_CIPHER_SPEC},
-+ #else
-+ {"BAD_CHANGE_CIPHER_SPEC", ERR_LIB_SSL, 103},
-+ #endif
-+ #ifdef SSL_R_BAD_CHECKSUM
-+ {"BAD_CHECKSUM", ERR_LIB_SSL, SSL_R_BAD_CHECKSUM},
-+ #else
-+ {"BAD_CHECKSUM", ERR_LIB_SSL, 104},
-+ #endif
-+ #ifdef SSL_R_BAD_DATA_RETURNED_BY_CALLBACK
-+ {"BAD_DATA_RETURNED_BY_CALLBACK", ERR_LIB_SSL,
SSL_R_BAD_DATA_RETURNED_BY_CALLBACK},
-+ #else
-+ {"BAD_DATA_RETURNED_BY_CALLBACK", ERR_LIB_SSL, 106},
-+ #endif
-+ #ifdef SSL_R_BAD_DECOMPRESSION
-+ {"BAD_DECOMPRESSION", ERR_LIB_SSL, SSL_R_BAD_DECOMPRESSION},
-+ #else
-+ {"BAD_DECOMPRESSION", ERR_LIB_SSL, 107},
-+ #endif
-+ #ifdef SSL_R_BAD_DH_G_LENGTH
-+ {"BAD_DH_G_LENGTH", ERR_LIB_SSL, SSL_R_BAD_DH_G_LENGTH},
-+ #else
-+ {"BAD_DH_G_LENGTH", ERR_LIB_SSL, 108},
-+ #endif
-+ #ifdef SSL_R_BAD_DH_PUB_KEY_LENGTH
-+ {"BAD_DH_PUB_KEY_LENGTH", ERR_LIB_SSL, SSL_R_BAD_DH_PUB_KEY_LENGTH},
-+ #else
-+ {"BAD_DH_PUB_KEY_LENGTH", ERR_LIB_SSL, 109},
-+ #endif
-+ #ifdef SSL_R_BAD_DH_P_LENGTH
-+ {"BAD_DH_P_LENGTH", ERR_LIB_SSL, SSL_R_BAD_DH_P_LENGTH},
-+ #else
-+ {"BAD_DH_P_LENGTH", ERR_LIB_SSL, 110},
-+ #endif
-+ #ifdef SSL_R_BAD_DIGEST_LENGTH
-+ {"BAD_DIGEST_LENGTH", ERR_LIB_SSL, SSL_R_BAD_DIGEST_LENGTH},
-+ #else
-+ {"BAD_DIGEST_LENGTH", ERR_LIB_SSL, 111},
-+ #endif
-+ #ifdef SSL_R_BAD_DSA_SIGNATURE
-+ {"BAD_DSA_SIGNATURE", ERR_LIB_SSL, SSL_R_BAD_DSA_SIGNATURE},
-+ #else
-+ {"BAD_DSA_SIGNATURE", ERR_LIB_SSL, 112},
-+ #endif
-+ #ifdef SSL_R_BAD_ECC_CERT
-+ {"BAD_ECC_CERT", ERR_LIB_SSL, SSL_R_BAD_ECC_CERT},
-+ #else
-+ {"BAD_ECC_CERT", ERR_LIB_SSL, 304},
-+ #endif
-+ #ifdef SSL_R_BAD_ECDSA_SIGNATURE
-+ {"BAD_ECDSA_SIGNATURE", ERR_LIB_SSL, SSL_R_BAD_ECDSA_SIGNATURE},
-+ #else
-+ {"BAD_ECDSA_SIGNATURE", ERR_LIB_SSL, 305},
-+ #endif
-+ #ifdef SSL_R_BAD_ECPOINT
-+ {"BAD_ECPOINT", ERR_LIB_SSL, SSL_R_BAD_ECPOINT},
-+ #else
-+ {"BAD_ECPOINT", ERR_LIB_SSL, 306},
-+ #endif
-+ #ifdef SSL_R_BAD_HANDSHAKE_LENGTH
-+ {"BAD_HANDSHAKE_LENGTH", ERR_LIB_SSL, SSL_R_BAD_HANDSHAKE_LENGTH},
-+ #else
-+ {"BAD_HANDSHAKE_LENGTH", ERR_LIB_SSL, 332},
-+ #endif
-+ #ifdef SSL_R_BAD_HELLO_REQUEST
-+ {"BAD_HELLO_REQUEST", ERR_LIB_SSL, SSL_R_BAD_HELLO_REQUEST},
-+ #else
-+ {"BAD_HELLO_REQUEST", ERR_LIB_SSL, 105},
-+ #endif
-+ #ifdef SSL_R_BAD_LENGTH
-+ {"BAD_LENGTH", ERR_LIB_SSL, SSL_R_BAD_LENGTH},
-+ #else
-+ {"BAD_LENGTH", ERR_LIB_SSL, 271},
-+ #endif
-+ #ifdef SSL_R_BAD_MAC_DECODE
-+ {"BAD_MAC_DECODE", ERR_LIB_SSL, SSL_R_BAD_MAC_DECODE},
-+ #else
-+ {"BAD_MAC_DECODE", ERR_LIB_SSL, 113},
-+ #endif
-+ #ifdef SSL_R_BAD_MAC_LENGTH
-+ {"BAD_MAC_LENGTH", ERR_LIB_SSL, SSL_R_BAD_MAC_LENGTH},
-+ #else
-+ {"BAD_MAC_LENGTH", ERR_LIB_SSL, 333},
-+ #endif
-+ #ifdef SSL_R_BAD_MESSAGE_TYPE
-+ {"BAD_MESSAGE_TYPE", ERR_LIB_SSL, SSL_R_BAD_MESSAGE_TYPE},
-+ #else
-+ {"BAD_MESSAGE_TYPE", ERR_LIB_SSL, 114},
-+ #endif
-+ #ifdef SSL_R_BAD_PACKET_LENGTH
-+ {"BAD_PACKET_LENGTH", ERR_LIB_SSL, SSL_R_BAD_PACKET_LENGTH},
-+ #else
-+ {"BAD_PACKET_LENGTH", ERR_LIB_SSL, 115},
-+ #endif
-+ #ifdef SSL_R_BAD_PROTOCOL_VERSION_NUMBER
-+ {"BAD_PROTOCOL_VERSION_NUMBER", ERR_LIB_SSL,
SSL_R_BAD_PROTOCOL_VERSION_NUMBER},
-+ #else
-+ {"BAD_PROTOCOL_VERSION_NUMBER", ERR_LIB_SSL, 116},
-+ #endif
-+ #ifdef SSL_R_BAD_PSK_IDENTITY_HINT_LENGTH
-+ {"BAD_PSK_IDENTITY_HINT_LENGTH", ERR_LIB_SSL,
SSL_R_BAD_PSK_IDENTITY_HINT_LENGTH},
-+ #else
-+ {"BAD_PSK_IDENTITY_HINT_LENGTH", ERR_LIB_SSL, 316},
-+ #endif
-+ #ifdef SSL_R_BAD_RESPONSE_ARGUMENT
-+ {"BAD_RESPONSE_ARGUMENT", ERR_LIB_SSL, SSL_R_BAD_RESPONSE_ARGUMENT},
-+ #else
-+ {"BAD_RESPONSE_ARGUMENT", ERR_LIB_SSL, 117},
-+ #endif
-+ #ifdef SSL_R_BAD_RSA_DECRYPT
-+ {"BAD_RSA_DECRYPT", ERR_LIB_SSL, SSL_R_BAD_RSA_DECRYPT},
-+ #else
-+ {"BAD_RSA_DECRYPT", ERR_LIB_SSL, 118},
-+ #endif
-+ #ifdef SSL_R_BAD_RSA_ENCRYPT
-+ {"BAD_RSA_ENCRYPT", ERR_LIB_SSL, SSL_R_BAD_RSA_ENCRYPT},
-+ #else
-+ {"BAD_RSA_ENCRYPT", ERR_LIB_SSL, 119},
-+ #endif
-+ #ifdef SSL_R_BAD_RSA_E_LENGTH
-+ {"BAD_RSA_E_LENGTH", ERR_LIB_SSL, SSL_R_BAD_RSA_E_LENGTH},
-+ #else
-+ {"BAD_RSA_E_LENGTH", ERR_LIB_SSL, 120},
-+ #endif
-+ #ifdef SSL_R_BAD_RSA_MODULUS_LENGTH
-+ {"BAD_RSA_MODULUS_LENGTH", ERR_LIB_SSL, SSL_R_BAD_RSA_MODULUS_LENGTH},
-+ #else
-+ {"BAD_RSA_MODULUS_LENGTH", ERR_LIB_SSL, 121},
-+ #endif
-+ #ifdef SSL_R_BAD_RSA_SIGNATURE
-+ {"BAD_RSA_SIGNATURE", ERR_LIB_SSL, SSL_R_BAD_RSA_SIGNATURE},
-+ #else
-+ {"BAD_RSA_SIGNATURE", ERR_LIB_SSL, 122},
-+ #endif
-+ #ifdef SSL_R_BAD_SIGNATURE
-+ {"BAD_SIGNATURE", ERR_LIB_SSL, SSL_R_BAD_SIGNATURE},
-+ #else
-+ {"BAD_SIGNATURE", ERR_LIB_SSL, 123},
-+ #endif
-+ #ifdef SSL_R_BAD_SSL_FILETYPE
-+ {"BAD_SSL_FILETYPE", ERR_LIB_SSL, SSL_R_BAD_SSL_FILETYPE},
-+ #else
-+ {"BAD_SSL_FILETYPE", ERR_LIB_SSL, 124},
-+ #endif
-+ #ifdef SSL_R_BAD_SSL_SESSION_ID_LENGTH
-+ {"BAD_SSL_SESSION_ID_LENGTH", ERR_LIB_SSL,
SSL_R_BAD_SSL_SESSION_ID_LENGTH},
-+ #else
-+ {"BAD_SSL_SESSION_ID_LENGTH", ERR_LIB_SSL, 125},
-+ #endif
-+ #ifdef SSL_R_BAD_STATE
-+ {"BAD_STATE", ERR_LIB_SSL, SSL_R_BAD_STATE},
-+ #else
-+ {"BAD_STATE", ERR_LIB_SSL, 126},
-+ #endif
-+ #ifdef SSL_R_BAD_WRITE_RETRY
-+ {"BAD_WRITE_RETRY", ERR_LIB_SSL, SSL_R_BAD_WRITE_RETRY},
-+ #else
-+ {"BAD_WRITE_RETRY", ERR_LIB_SSL, 127},
-+ #endif
-+ #ifdef SSL_R_BIO_NOT_SET
-+ {"BIO_NOT_SET", ERR_LIB_SSL, SSL_R_BIO_NOT_SET},
-+ #else
-+ {"BIO_NOT_SET", ERR_LIB_SSL, 128},
-+ #endif
-+ #ifdef SSL_R_BLOCK_CIPHER_PAD_IS_WRONG
-+ {"BLOCK_CIPHER_PAD_IS_WRONG", ERR_LIB_SSL,
SSL_R_BLOCK_CIPHER_PAD_IS_WRONG},
-+ #else
-+ {"BLOCK_CIPHER_PAD_IS_WRONG", ERR_LIB_SSL, 129},
-+ #endif
-+ #ifdef SSL_R_BN_LIB
-+ {"BN_LIB", ERR_LIB_SSL, SSL_R_BN_LIB},
-+ #else
-+ {"BN_LIB", ERR_LIB_SSL, 130},
-+ #endif
-+ #ifdef SSL_R_CA_DN_LENGTH_MISMATCH
-+ {"CA_DN_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_CA_DN_LENGTH_MISMATCH},
-+ #else
-+ {"CA_DN_LENGTH_MISMATCH", ERR_LIB_SSL, 131},
-+ #endif
-+ #ifdef SSL_R_CA_DN_TOO_LONG
-+ {"CA_DN_TOO_LONG", ERR_LIB_SSL, SSL_R_CA_DN_TOO_LONG},
-+ #else
-+ {"CA_DN_TOO_LONG", ERR_LIB_SSL, 132},
-+ #endif
-+ #ifdef SSL_R_CCS_RECEIVED_EARLY
-+ {"CCS_RECEIVED_EARLY", ERR_LIB_SSL, SSL_R_CCS_RECEIVED_EARLY},
-+ #else
-+ {"CCS_RECEIVED_EARLY", ERR_LIB_SSL, 133},
-+ #endif
-+ #ifdef SSL_R_CERTIFICATE_VERIFY_FAILED
-+ {"CERTIFICATE_VERIFY_FAILED", ERR_LIB_SSL,
SSL_R_CERTIFICATE_VERIFY_FAILED},
-+ #else
-+ {"CERTIFICATE_VERIFY_FAILED", ERR_LIB_SSL, 134},
-+ #endif
-+ #ifdef SSL_R_CERT_LENGTH_MISMATCH
-+ {"CERT_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_CERT_LENGTH_MISMATCH},
-+ #else
-+ {"CERT_LENGTH_MISMATCH", ERR_LIB_SSL, 135},
-+ #endif
-+ #ifdef SSL_R_CHALLENGE_IS_DIFFERENT
-+ {"CHALLENGE_IS_DIFFERENT", ERR_LIB_SSL, SSL_R_CHALLENGE_IS_DIFFERENT},
-+ #else
-+ {"CHALLENGE_IS_DIFFERENT", ERR_LIB_SSL, 136},
-+ #endif
-+ #ifdef SSL_R_CIPHER_CODE_WRONG_LENGTH
-+ {"CIPHER_CODE_WRONG_LENGTH", ERR_LIB_SSL,
SSL_R_CIPHER_CODE_WRONG_LENGTH},
-+ #else
-+ {"CIPHER_CODE_WRONG_LENGTH", ERR_LIB_SSL, 137},
-+ #endif
-+ #ifdef SSL_R_CIPHER_OR_HASH_UNAVAILABLE
-+ {"CIPHER_OR_HASH_UNAVAILABLE", ERR_LIB_SSL,
SSL_R_CIPHER_OR_HASH_UNAVAILABLE},
-+ #else
-+ {"CIPHER_OR_HASH_UNAVAILABLE", ERR_LIB_SSL, 138},
-+ #endif
-+ #ifdef SSL_R_CIPHER_TABLE_SRC_ERROR
-+ {"CIPHER_TABLE_SRC_ERROR", ERR_LIB_SSL, SSL_R_CIPHER_TABLE_SRC_ERROR},
-+ #else
-+ {"CIPHER_TABLE_SRC_ERROR", ERR_LIB_SSL, 139},
-+ #endif
-+ #ifdef SSL_R_CLIENTHELLO_TLSEXT
-+ {"CLIENTHELLO_TLSEXT", ERR_LIB_SSL, SSL_R_CLIENTHELLO_TLSEXT},
-+ #else
-+ {"CLIENTHELLO_TLSEXT", ERR_LIB_SSL, 226},
-+ #endif
-+ #ifdef SSL_R_COMPRESSED_LENGTH_TOO_LONG
-+ {"COMPRESSED_LENGTH_TOO_LONG", ERR_LIB_SSL,
SSL_R_COMPRESSED_LENGTH_TOO_LONG},
-+ #else
-+ {"COMPRESSED_LENGTH_TOO_LONG", ERR_LIB_SSL, 140},
-+ #endif
-+ #ifdef SSL_R_COMPRESSION_DISABLED
-+ {"COMPRESSION_DISABLED", ERR_LIB_SSL, SSL_R_COMPRESSION_DISABLED},
-+ #else
-+ {"COMPRESSION_DISABLED", ERR_LIB_SSL, 343},
-+ #endif
-+ #ifdef SSL_R_COMPRESSION_FAILURE
-+ {"COMPRESSION_FAILURE", ERR_LIB_SSL, SSL_R_COMPRESSION_FAILURE},
-+ #else
-+ {"COMPRESSION_FAILURE", ERR_LIB_SSL, 141},
-+ #endif
-+ #ifdef SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE
-+ {"COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE", ERR_LIB_SSL,
SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE},
-+ #else
-+ {"COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE", ERR_LIB_SSL, 307},
-+ #endif
-+ #ifdef SSL_R_COMPRESSION_LIBRARY_ERROR
-+ {"COMPRESSION_LIBRARY_ERROR", ERR_LIB_SSL,
SSL_R_COMPRESSION_LIBRARY_ERROR},
-+ #else
-+ {"COMPRESSION_LIBRARY_ERROR", ERR_LIB_SSL, 142},
-+ #endif
-+ #ifdef SSL_R_CONNECTION_ID_IS_DIFFERENT
-+ {"CONNECTION_ID_IS_DIFFERENT", ERR_LIB_SSL,
SSL_R_CONNECTION_ID_IS_DIFFERENT},
-+ #else
-+ {"CONNECTION_ID_IS_DIFFERENT", ERR_LIB_SSL, 143},
-+ #endif
-+ #ifdef SSL_R_CONNECTION_TYPE_NOT_SET
-+ {"CONNECTION_TYPE_NOT_SET", ERR_LIB_SSL, SSL_R_CONNECTION_TYPE_NOT_SET},
-+ #else
-+ {"CONNECTION_TYPE_NOT_SET", ERR_LIB_SSL, 144},
-+ #endif
-+ #ifdef SSL_R_COOKIE_MISMATCH
-+ {"COOKIE_MISMATCH", ERR_LIB_SSL, SSL_R_COOKIE_MISMATCH},
-+ #else
-+ {"COOKIE_MISMATCH", ERR_LIB_SSL, 308},
-+ #endif
-+ #ifdef SSL_R_DATA_BETWEEN_CCS_AND_FINISHED
-+ {"DATA_BETWEEN_CCS_AND_FINISHED", ERR_LIB_SSL,
SSL_R_DATA_BETWEEN_CCS_AND_FINISHED},
-+ #else
-+ {"DATA_BETWEEN_CCS_AND_FINISHED", ERR_LIB_SSL, 145},
-+ #endif
-+ #ifdef SSL_R_DATA_LENGTH_TOO_LONG
-+ {"DATA_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_DATA_LENGTH_TOO_LONG},
-+ #else
-+ {"DATA_LENGTH_TOO_LONG", ERR_LIB_SSL, 146},
-+ #endif
-+ #ifdef SSL_R_DECRYPTION_FAILED
-+ {"DECRYPTION_FAILED", ERR_LIB_SSL, SSL_R_DECRYPTION_FAILED},
-+ #else
-+ {"DECRYPTION_FAILED", ERR_LIB_SSL, 147},
-+ #endif
-+ #ifdef SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC
-+ {"DECRYPTION_FAILED_OR_BAD_RECORD_MAC", ERR_LIB_SSL,
SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC},
-+ #else
-+ {"DECRYPTION_FAILED_OR_BAD_RECORD_MAC", ERR_LIB_SSL, 281},
-+ #endif
-+ #ifdef SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG
-+ {"DH_PUBLIC_VALUE_LENGTH_IS_WRONG", ERR_LIB_SSL,
SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG},
-+ #else
-+ {"DH_PUBLIC_VALUE_LENGTH_IS_WRONG", ERR_LIB_SSL, 148},
-+ #endif
-+ #ifdef SSL_R_DIGEST_CHECK_FAILED
-+ {"DIGEST_CHECK_FAILED", ERR_LIB_SSL, SSL_R_DIGEST_CHECK_FAILED},
-+ #else
-+ {"DIGEST_CHECK_FAILED", ERR_LIB_SSL, 149},
-+ #endif
-+ #ifdef SSL_R_DTLS_MESSAGE_TOO_BIG
-+ {"DTLS_MESSAGE_TOO_BIG", ERR_LIB_SSL, SSL_R_DTLS_MESSAGE_TOO_BIG},
-+ #else
-+ {"DTLS_MESSAGE_TOO_BIG", ERR_LIB_SSL, 334},
-+ #endif
-+ #ifdef SSL_R_DUPLICATE_COMPRESSION_ID
-+ {"DUPLICATE_COMPRESSION_ID", ERR_LIB_SSL,
SSL_R_DUPLICATE_COMPRESSION_ID},
-+ #else
-+ {"DUPLICATE_COMPRESSION_ID", ERR_LIB_SSL, 309},
-+ #endif
-+ #ifdef SSL_R_ECC_CERT_NOT_FOR_KEY_AGREEMENT
-+ {"ECC_CERT_NOT_FOR_KEY_AGREEMENT", ERR_LIB_SSL,
SSL_R_ECC_CERT_NOT_FOR_KEY_AGREEMENT},
-+ #else
-+ {"ECC_CERT_NOT_FOR_KEY_AGREEMENT", ERR_LIB_SSL, 317},
-+ #endif
-+ #ifdef SSL_R_ECC_CERT_NOT_FOR_SIGNING
-+ {"ECC_CERT_NOT_FOR_SIGNING", ERR_LIB_SSL,
SSL_R_ECC_CERT_NOT_FOR_SIGNING},
-+ #else
-+ {"ECC_CERT_NOT_FOR_SIGNING", ERR_LIB_SSL, 318},
-+ #endif
-+ #ifdef SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE
-+ {"ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE", ERR_LIB_SSL,
SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE},
-+ #else
-+ {"ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE", ERR_LIB_SSL, 322},
-+ #endif
-+ #ifdef SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE
-+ {"ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE", ERR_LIB_SSL,
SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE},
-+ #else
-+ {"ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE", ERR_LIB_SSL, 323},
-+ #endif
-+ #ifdef SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER
-+ {"ECGROUP_TOO_LARGE_FOR_CIPHER", ERR_LIB_SSL,
SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER},
-+ #else
-+ {"ECGROUP_TOO_LARGE_FOR_CIPHER", ERR_LIB_SSL, 310},
-+ #endif
-+ #ifdef SSL_R_ENCRYPTED_LENGTH_TOO_LONG
-+ {"ENCRYPTED_LENGTH_TOO_LONG", ERR_LIB_SSL,
SSL_R_ENCRYPTED_LENGTH_TOO_LONG},
-+ #else
-+ {"ENCRYPTED_LENGTH_TOO_LONG", ERR_LIB_SSL, 150},
-+ #endif
-+ #ifdef SSL_R_ERROR_GENERATING_TMP_RSA_KEY
-+ {"ERROR_GENERATING_TMP_RSA_KEY", ERR_LIB_SSL,
SSL_R_ERROR_GENERATING_TMP_RSA_KEY},
-+ #else
-+ {"ERROR_GENERATING_TMP_RSA_KEY", ERR_LIB_SSL, 282},
-+ #endif
-+ #ifdef SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST
-+ {"ERROR_IN_RECEIVED_CIPHER_LIST", ERR_LIB_SSL,
SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST},
-+ #else
-+ {"ERROR_IN_RECEIVED_CIPHER_LIST", ERR_LIB_SSL, 151},
-+ #endif
-+ #ifdef SSL_R_EXCESSIVE_MESSAGE_SIZE
-+ {"EXCESSIVE_MESSAGE_SIZE", ERR_LIB_SSL, SSL_R_EXCESSIVE_MESSAGE_SIZE},
-+ #else
-+ {"EXCESSIVE_MESSAGE_SIZE", ERR_LIB_SSL, 152},
-+ #endif
-+ #ifdef SSL_R_EXTRA_DATA_IN_MESSAGE
-+ {"EXTRA_DATA_IN_MESSAGE", ERR_LIB_SSL, SSL_R_EXTRA_DATA_IN_MESSAGE},
-+ #else
-+ {"EXTRA_DATA_IN_MESSAGE", ERR_LIB_SSL, 153},
-+ #endif
-+ #ifdef SSL_R_GOT_A_FIN_BEFORE_A_CCS
-+ {"GOT_A_FIN_BEFORE_A_CCS", ERR_LIB_SSL, SSL_R_GOT_A_FIN_BEFORE_A_CCS},
-+ #else
-+ {"GOT_A_FIN_BEFORE_A_CCS", ERR_LIB_SSL, 154},
-+ #endif
-+ #ifdef SSL_R_HTTPS_PROXY_REQUEST
-+ {"HTTPS_PROXY_REQUEST", ERR_LIB_SSL, SSL_R_HTTPS_PROXY_REQUEST},
-+ #else
-+ {"HTTPS_PROXY_REQUEST", ERR_LIB_SSL, 155},
-+ #endif
-+ #ifdef SSL_R_HTTP_REQUEST
-+ {"HTTP_REQUEST", ERR_LIB_SSL, SSL_R_HTTP_REQUEST},
-+ #else
-+ {"HTTP_REQUEST", ERR_LIB_SSL, 156},
-+ #endif
-+ #ifdef SSL_R_ILLEGAL_PADDING
-+ {"ILLEGAL_PADDING", ERR_LIB_SSL, SSL_R_ILLEGAL_PADDING},
-+ #else
-+ {"ILLEGAL_PADDING", ERR_LIB_SSL, 283},
-+ #endif
-+ #ifdef SSL_R_INCONSISTENT_COMPRESSION
-+ {"INCONSISTENT_COMPRESSION", ERR_LIB_SSL,
SSL_R_INCONSISTENT_COMPRESSION},
-+ #else
-+ {"INCONSISTENT_COMPRESSION", ERR_LIB_SSL, 340},
-+ #endif
-+ #ifdef SSL_R_INVALID_CHALLENGE_LENGTH
-+ {"INVALID_CHALLENGE_LENGTH", ERR_LIB_SSL,
SSL_R_INVALID_CHALLENGE_LENGTH},
-+ #else
-+ {"INVALID_CHALLENGE_LENGTH", ERR_LIB_SSL, 158},
-+ #endif
-+ #ifdef SSL_R_INVALID_COMMAND
-+ {"INVALID_COMMAND", ERR_LIB_SSL, SSL_R_INVALID_COMMAND},
-+ #else
-+ {"INVALID_COMMAND", ERR_LIB_SSL, 280},
-+ #endif
-+ #ifdef SSL_R_INVALID_COMPRESSION_ALGORITHM
-+ {"INVALID_COMPRESSION_ALGORITHM", ERR_LIB_SSL,
SSL_R_INVALID_COMPRESSION_ALGORITHM},
-+ #else
-+ {"INVALID_COMPRESSION_ALGORITHM", ERR_LIB_SSL, 341},
-+ #endif
-+ #ifdef SSL_R_INVALID_PURPOSE
-+ {"INVALID_PURPOSE", ERR_LIB_SSL, SSL_R_INVALID_PURPOSE},
-+ #else
-+ {"INVALID_PURPOSE", ERR_LIB_SSL, 278},
-+ #endif
-+ #ifdef SSL_R_INVALID_STATUS_RESPONSE
-+ {"INVALID_STATUS_RESPONSE", ERR_LIB_SSL, SSL_R_INVALID_STATUS_RESPONSE},
-+ #else
-+ {"INVALID_STATUS_RESPONSE", ERR_LIB_SSL, 328},
-+ #endif
-+ #ifdef SSL_R_INVALID_TICKET_KEYS_LENGTH
-+ {"INVALID_TICKET_KEYS_LENGTH", ERR_LIB_SSL,
SSL_R_INVALID_TICKET_KEYS_LENGTH},
-+ #else
-+ {"INVALID_TICKET_KEYS_LENGTH", ERR_LIB_SSL, 325},
-+ #endif
-+ #ifdef SSL_R_INVALID_TRUST
-+ {"INVALID_TRUST", ERR_LIB_SSL, SSL_R_INVALID_TRUST},
-+ #else
-+ {"INVALID_TRUST", ERR_LIB_SSL, 279},
-+ #endif
-+ #ifdef SSL_R_KEY_ARG_TOO_LONG
-+ {"KEY_ARG_TOO_LONG", ERR_LIB_SSL, SSL_R_KEY_ARG_TOO_LONG},
-+ #else
-+ {"KEY_ARG_TOO_LONG", ERR_LIB_SSL, 284},
-+ #endif
-+ #ifdef SSL_R_KRB5
-+ {"KRB5", ERR_LIB_SSL, SSL_R_KRB5},
-+ #else
-+ {"KRB5", ERR_LIB_SSL, 285},
-+ #endif
-+ #ifdef SSL_R_KRB5_C_CC_PRINC
-+ {"KRB5_C_CC_PRINC", ERR_LIB_SSL, SSL_R_KRB5_C_CC_PRINC},
-+ #else
-+ {"KRB5_C_CC_PRINC", ERR_LIB_SSL, 286},
-+ #endif
-+ #ifdef SSL_R_KRB5_C_GET_CRED
-+ {"KRB5_C_GET_CRED", ERR_LIB_SSL, SSL_R_KRB5_C_GET_CRED},
-+ #else
-+ {"KRB5_C_GET_CRED", ERR_LIB_SSL, 287},
-+ #endif
-+ #ifdef SSL_R_KRB5_C_INIT
-+ {"KRB5_C_INIT", ERR_LIB_SSL, SSL_R_KRB5_C_INIT},
-+ #else
-+ {"KRB5_C_INIT", ERR_LIB_SSL, 288},
-+ #endif
-+ #ifdef SSL_R_KRB5_C_MK_REQ
-+ {"KRB5_C_MK_REQ", ERR_LIB_SSL, SSL_R_KRB5_C_MK_REQ},
-+ #else
-+ {"KRB5_C_MK_REQ", ERR_LIB_SSL, 289},
-+ #endif
-+ #ifdef SSL_R_KRB5_S_BAD_TICKET
-+ {"KRB5_S_BAD_TICKET", ERR_LIB_SSL, SSL_R_KRB5_S_BAD_TICKET},
-+ #else
-+ {"KRB5_S_BAD_TICKET", ERR_LIB_SSL, 290},
-+ #endif
-+ #ifdef SSL_R_KRB5_S_INIT
-+ {"KRB5_S_INIT", ERR_LIB_SSL, SSL_R_KRB5_S_INIT},
-+ #else
-+ {"KRB5_S_INIT", ERR_LIB_SSL, 291},
-+ #endif
-+ #ifdef SSL_R_KRB5_S_RD_REQ
-+ {"KRB5_S_RD_REQ", ERR_LIB_SSL, SSL_R_KRB5_S_RD_REQ},
-+ #else
-+ {"KRB5_S_RD_REQ", ERR_LIB_SSL, 292},
-+ #endif
-+ #ifdef SSL_R_KRB5_S_TKT_EXPIRED
-+ {"KRB5_S_TKT_EXPIRED", ERR_LIB_SSL, SSL_R_KRB5_S_TKT_EXPIRED},
-+ #else
-+ {"KRB5_S_TKT_EXPIRED", ERR_LIB_SSL, 293},
-+ #endif
-+ #ifdef SSL_R_KRB5_S_TKT_NYV
-+ {"KRB5_S_TKT_NYV", ERR_LIB_SSL, SSL_R_KRB5_S_TKT_NYV},
-+ #else
-+ {"KRB5_S_TKT_NYV", ERR_LIB_SSL, 294},
-+ #endif
-+ #ifdef SSL_R_KRB5_S_TKT_SKEW
-+ {"KRB5_S_TKT_SKEW", ERR_LIB_SSL, SSL_R_KRB5_S_TKT_SKEW},
-+ #else
-+ {"KRB5_S_TKT_SKEW", ERR_LIB_SSL, 295},
-+ #endif
-+ #ifdef SSL_R_LENGTH_MISMATCH
-+ {"LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_LENGTH_MISMATCH},
-+ #else
-+ {"LENGTH_MISMATCH", ERR_LIB_SSL, 159},
-+ #endif
-+ #ifdef SSL_R_LENGTH_TOO_SHORT
-+ {"LENGTH_TOO_SHORT", ERR_LIB_SSL, SSL_R_LENGTH_TOO_SHORT},
-+ #else
-+ {"LENGTH_TOO_SHORT", ERR_LIB_SSL, 160},
-+ #endif
-+ #ifdef SSL_R_LIBRARY_BUG
-+ {"LIBRARY_BUG", ERR_LIB_SSL, SSL_R_LIBRARY_BUG},
-+ #else
-+ {"LIBRARY_BUG", ERR_LIB_SSL, 274},
-+ #endif
-+ #ifdef SSL_R_LIBRARY_HAS_NO_CIPHERS
-+ {"LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, SSL_R_LIBRARY_HAS_NO_CIPHERS},
-+ #else
-+ {"LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, 161},
-+ #endif
-+ #ifdef SSL_R_MESSAGE_TOO_LONG
-+ {"MESSAGE_TOO_LONG", ERR_LIB_SSL, SSL_R_MESSAGE_TOO_LONG},
-+ #else
-+ {"MESSAGE_TOO_LONG", ERR_LIB_SSL, 296},
-+ #endif
-+ #ifdef SSL_R_MISSING_DH_DSA_CERT
-+ {"MISSING_DH_DSA_CERT", ERR_LIB_SSL, SSL_R_MISSING_DH_DSA_CERT},
-+ #else
-+ {"MISSING_DH_DSA_CERT", ERR_LIB_SSL, 162},
-+ #endif
-+ #ifdef SSL_R_MISSING_DH_KEY
-+ {"MISSING_DH_KEY", ERR_LIB_SSL, SSL_R_MISSING_DH_KEY},
-+ #else
-+ {"MISSING_DH_KEY", ERR_LIB_SSL, 163},
-+ #endif
-+ #ifdef SSL_R_MISSING_DH_RSA_CERT
-+ {"MISSING_DH_RSA_CERT", ERR_LIB_SSL, SSL_R_MISSING_DH_RSA_CERT},
-+ #else
-+ {"MISSING_DH_RSA_CERT", ERR_LIB_SSL, 164},
-+ #endif
-+ #ifdef SSL_R_MISSING_DSA_SIGNING_CERT
-+ {"MISSING_DSA_SIGNING_CERT", ERR_LIB_SSL,
SSL_R_MISSING_DSA_SIGNING_CERT},
-+ #else
-+ {"MISSING_DSA_SIGNING_CERT", ERR_LIB_SSL, 165},
-+ #endif
-+ #ifdef SSL_R_MISSING_EXPORT_TMP_DH_KEY
-+ {"MISSING_EXPORT_TMP_DH_KEY", ERR_LIB_SSL,
SSL_R_MISSING_EXPORT_TMP_DH_KEY},
-+ #else
-+ {"MISSING_EXPORT_TMP_DH_KEY", ERR_LIB_SSL, 166},
-+ #endif
-+ #ifdef SSL_R_MISSING_EXPORT_TMP_RSA_KEY
-+ {"MISSING_EXPORT_TMP_RSA_KEY", ERR_LIB_SSL,
SSL_R_MISSING_EXPORT_TMP_RSA_KEY},
-+ #else
-+ {"MISSING_EXPORT_TMP_RSA_KEY", ERR_LIB_SSL, 167},
-+ #endif
-+ #ifdef SSL_R_MISSING_RSA_CERTIFICATE
-+ {"MISSING_RSA_CERTIFICATE", ERR_LIB_SSL, SSL_R_MISSING_RSA_CERTIFICATE},
-+ #else
-+ {"MISSING_RSA_CERTIFICATE", ERR_LIB_SSL, 168},
-+ #endif
-+ #ifdef SSL_R_MISSING_RSA_ENCRYPTING_CERT
-+ {"MISSING_RSA_ENCRYPTING_CERT", ERR_LIB_SSL,
SSL_R_MISSING_RSA_ENCRYPTING_CERT},
-+ #else
-+ {"MISSING_RSA_ENCRYPTING_CERT", ERR_LIB_SSL, 169},
-+ #endif
-+ #ifdef SSL_R_MISSING_RSA_SIGNING_CERT
-+ {"MISSING_RSA_SIGNING_CERT", ERR_LIB_SSL,
SSL_R_MISSING_RSA_SIGNING_CERT},
-+ #else
-+ {"MISSING_RSA_SIGNING_CERT", ERR_LIB_SSL, 170},
-+ #endif
-+ #ifdef SSL_R_MISSING_TMP_DH_KEY
-+ {"MISSING_TMP_DH_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_DH_KEY},
-+ #else
-+ {"MISSING_TMP_DH_KEY", ERR_LIB_SSL, 171},
-+ #endif
-+ #ifdef SSL_R_MISSING_TMP_ECDH_KEY
-+ {"MISSING_TMP_ECDH_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_ECDH_KEY},
-+ #else
-+ {"MISSING_TMP_ECDH_KEY", ERR_LIB_SSL, 311},
-+ #endif
-+ #ifdef SSL_R_MISSING_TMP_RSA_KEY
-+ {"MISSING_TMP_RSA_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_RSA_KEY},
-+ #else
-+ {"MISSING_TMP_RSA_KEY", ERR_LIB_SSL, 172},
-+ #endif
-+ #ifdef SSL_R_MISSING_TMP_RSA_PKEY
-+ {"MISSING_TMP_RSA_PKEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_RSA_PKEY},
-+ #else
-+ {"MISSING_TMP_RSA_PKEY", ERR_LIB_SSL, 173},
-+ #endif
-+ #ifdef SSL_R_MISSING_VERIFY_MESSAGE
-+ {"MISSING_VERIFY_MESSAGE", ERR_LIB_SSL, SSL_R_MISSING_VERIFY_MESSAGE},
-+ #else
-+ {"MISSING_VERIFY_MESSAGE", ERR_LIB_SSL, 174},
-+ #endif
-+ #ifdef SSL_R_NON_SSLV2_INITIAL_PACKET
-+ {"NON_SSLV2_INITIAL_PACKET", ERR_LIB_SSL,
SSL_R_NON_SSLV2_INITIAL_PACKET},
-+ #else
-+ {"NON_SSLV2_INITIAL_PACKET", ERR_LIB_SSL, 175},
-+ #endif
-+ #ifdef SSL_R_NO_CERTIFICATES_RETURNED
-+ {"NO_CERTIFICATES_RETURNED", ERR_LIB_SSL,
SSL_R_NO_CERTIFICATES_RETURNED},
-+ #else
-+ {"NO_CERTIFICATES_RETURNED", ERR_LIB_SSL, 176},
-+ #endif
-+ #ifdef SSL_R_NO_CERTIFICATE_ASSIGNED
-+ {"NO_CERTIFICATE_ASSIGNED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_ASSIGNED},
-+ #else
-+ {"NO_CERTIFICATE_ASSIGNED", ERR_LIB_SSL, 177},
-+ #endif
-+ #ifdef SSL_R_NO_CERTIFICATE_RETURNED
-+ {"NO_CERTIFICATE_RETURNED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_RETURNED},
-+ #else
-+ {"NO_CERTIFICATE_RETURNED", ERR_LIB_SSL, 178},
-+ #endif
-+ #ifdef SSL_R_NO_CERTIFICATE_SET
-+ {"NO_CERTIFICATE_SET", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_SET},
-+ #else
-+ {"NO_CERTIFICATE_SET", ERR_LIB_SSL, 179},
-+ #endif
-+ #ifdef SSL_R_NO_CERTIFICATE_SPECIFIED
-+ {"NO_CERTIFICATE_SPECIFIED", ERR_LIB_SSL,
SSL_R_NO_CERTIFICATE_SPECIFIED},
-+ #else
-+ {"NO_CERTIFICATE_SPECIFIED", ERR_LIB_SSL, 180},
-+ #endif
-+ #ifdef SSL_R_NO_CIPHERS_AVAILABLE
-+ {"NO_CIPHERS_AVAILABLE", ERR_LIB_SSL, SSL_R_NO_CIPHERS_AVAILABLE},
-+ #else
-+ {"NO_CIPHERS_AVAILABLE", ERR_LIB_SSL, 181},
-+ #endif
-+ #ifdef SSL_R_NO_CIPHERS_PASSED
-+ {"NO_CIPHERS_PASSED", ERR_LIB_SSL, SSL_R_NO_CIPHERS_PASSED},
-+ #else
-+ {"NO_CIPHERS_PASSED", ERR_LIB_SSL, 182},
-+ #endif
-+ #ifdef SSL_R_NO_CIPHERS_SPECIFIED
-+ {"NO_CIPHERS_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_CIPHERS_SPECIFIED},
-+ #else
-+ {"NO_CIPHERS_SPECIFIED", ERR_LIB_SSL, 183},
-+ #endif
-+ #ifdef SSL_R_NO_CIPHER_LIST
-+ {"NO_CIPHER_LIST", ERR_LIB_SSL, SSL_R_NO_CIPHER_LIST},
-+ #else
-+ {"NO_CIPHER_LIST", ERR_LIB_SSL, 184},
-+ #endif
-+ #ifdef SSL_R_NO_CIPHER_MATCH
-+ {"NO_CIPHER_MATCH", ERR_LIB_SSL, SSL_R_NO_CIPHER_MATCH},
-+ #else
-+ {"NO_CIPHER_MATCH", ERR_LIB_SSL, 185},
-+ #endif
-+ #ifdef SSL_R_NO_CLIENT_CERT_METHOD
-+ {"NO_CLIENT_CERT_METHOD", ERR_LIB_SSL, SSL_R_NO_CLIENT_CERT_METHOD},
-+ #else
-+ {"NO_CLIENT_CERT_METHOD", ERR_LIB_SSL, 331},
-+ #endif
-+ #ifdef SSL_R_NO_CLIENT_CERT_RECEIVED
-+ {"NO_CLIENT_CERT_RECEIVED", ERR_LIB_SSL, SSL_R_NO_CLIENT_CERT_RECEIVED},
-+ #else
-+ {"NO_CLIENT_CERT_RECEIVED", ERR_LIB_SSL, 186},
-+ #endif
-+ #ifdef SSL_R_NO_COMPRESSION_SPECIFIED
-+ {"NO_COMPRESSION_SPECIFIED", ERR_LIB_SSL,
SSL_R_NO_COMPRESSION_SPECIFIED},
-+ #else
-+ {"NO_COMPRESSION_SPECIFIED", ERR_LIB_SSL, 187},
-+ #endif
-+ #ifdef SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER
-+ {"NO_GOST_CERTIFICATE_SENT_BY_PEER", ERR_LIB_SSL,
SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER},
-+ #else
-+ {"NO_GOST_CERTIFICATE_SENT_BY_PEER", ERR_LIB_SSL, 330},
-+ #endif
-+ #ifdef SSL_R_NO_METHOD_SPECIFIED
-+ {"NO_METHOD_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_METHOD_SPECIFIED},
-+ #else
-+ {"NO_METHOD_SPECIFIED", ERR_LIB_SSL, 188},
-+ #endif
-+ #ifdef SSL_R_NO_PRIVATEKEY
-+ {"NO_PRIVATEKEY", ERR_LIB_SSL, SSL_R_NO_PRIVATEKEY},
-+ #else
-+ {"NO_PRIVATEKEY", ERR_LIB_SSL, 189},
-+ #endif
-+ #ifdef SSL_R_NO_PRIVATE_KEY_ASSIGNED
-+ {"NO_PRIVATE_KEY_ASSIGNED", ERR_LIB_SSL, SSL_R_NO_PRIVATE_KEY_ASSIGNED},
-+ #else
-+ {"NO_PRIVATE_KEY_ASSIGNED", ERR_LIB_SSL, 190},
-+ #endif
-+ #ifdef SSL_R_NO_PROTOCOLS_AVAILABLE
-+ {"NO_PROTOCOLS_AVAILABLE", ERR_LIB_SSL, SSL_R_NO_PROTOCOLS_AVAILABLE},
-+ #else
-+ {"NO_PROTOCOLS_AVAILABLE", ERR_LIB_SSL, 191},
-+ #endif
-+ #ifdef SSL_R_NO_PUBLICKEY
-+ {"NO_PUBLICKEY", ERR_LIB_SSL, SSL_R_NO_PUBLICKEY},
-+ #else
-+ {"NO_PUBLICKEY", ERR_LIB_SSL, 192},
-+ #endif
-+ #ifdef SSL_R_NO_RENEGOTIATION
-+ {"NO_RENEGOTIATION", ERR_LIB_SSL, SSL_R_NO_RENEGOTIATION},
-+ #else
-+ {"NO_RENEGOTIATION", ERR_LIB_SSL, 339},
-+ #endif
-+ #ifdef SSL_R_NO_REQUIRED_DIGEST
-+ {"NO_REQUIRED_DIGEST", ERR_LIB_SSL, SSL_R_NO_REQUIRED_DIGEST},
-+ #else
-+ {"NO_REQUIRED_DIGEST", ERR_LIB_SSL, 324},
-+ #endif
-+ #ifdef SSL_R_NO_SHARED_CIPHER
-+ {"NO_SHARED_CIPHER", ERR_LIB_SSL, SSL_R_NO_SHARED_CIPHER},
-+ #else
-+ {"NO_SHARED_CIPHER", ERR_LIB_SSL, 193},
-+ #endif
-+ #ifdef SSL_R_NO_VERIFY_CALLBACK
-+ {"NO_VERIFY_CALLBACK", ERR_LIB_SSL, SSL_R_NO_VERIFY_CALLBACK},
-+ #else
-+ {"NO_VERIFY_CALLBACK", ERR_LIB_SSL, 194},
-+ #endif
-+ #ifdef SSL_R_NULL_SSL_CTX
-+ {"NULL_SSL_CTX", ERR_LIB_SSL, SSL_R_NULL_SSL_CTX},
-+ #else
-+ {"NULL_SSL_CTX", ERR_LIB_SSL, 195},
-+ #endif
-+ #ifdef SSL_R_NULL_SSL_METHOD_PASSED
-+ {"NULL_SSL_METHOD_PASSED", ERR_LIB_SSL, SSL_R_NULL_SSL_METHOD_PASSED},
-+ #else
-+ {"NULL_SSL_METHOD_PASSED", ERR_LIB_SSL, 196},
-+ #endif
-+ #ifdef SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED
-+ {"OLD_SESSION_CIPHER_NOT_RETURNED", ERR_LIB_SSL,
SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED},
-+ #else
-+ {"OLD_SESSION_CIPHER_NOT_RETURNED", ERR_LIB_SSL, 197},
-+ #endif
-+ #ifdef SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED
-+ {"OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED", ERR_LIB_SSL,
SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED},
-+ #else
-+ {"OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED", ERR_LIB_SSL, 344},
-+ #endif
-+ #ifdef SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE
-+ {"ONLY_TLS_ALLOWED_IN_FIPS_MODE", ERR_LIB_SSL,
SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE},
-+ #else
-+ {"ONLY_TLS_ALLOWED_IN_FIPS_MODE", ERR_LIB_SSL, 297},
-+ #endif
-+ #ifdef SSL_R_OPAQUE_PRF_INPUT_TOO_LONG
-+ {"OPAQUE_PRF_INPUT_TOO_LONG", ERR_LIB_SSL,
SSL_R_OPAQUE_PRF_INPUT_TOO_LONG},
-+ #else
-+ {"OPAQUE_PRF_INPUT_TOO_LONG", ERR_LIB_SSL, 327},
-+ #endif
-+ #ifdef SSL_R_PACKET_LENGTH_TOO_LONG
-+ {"PACKET_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_PACKET_LENGTH_TOO_LONG},
-+ #else
-+ {"PACKET_LENGTH_TOO_LONG", ERR_LIB_SSL, 198},
-+ #endif
-+ #ifdef SSL_R_PARSE_TLSEXT
-+ {"PARSE_TLSEXT", ERR_LIB_SSL, SSL_R_PARSE_TLSEXT},
-+ #else
-+ {"PARSE_TLSEXT", ERR_LIB_SSL, 227},
-+ #endif
-+ #ifdef SSL_R_PATH_TOO_LONG
-+ {"PATH_TOO_LONG", ERR_LIB_SSL, SSL_R_PATH_TOO_LONG},
-+ #else
-+ {"PATH_TOO_LONG", ERR_LIB_SSL, 270},
-+ #endif
-+ #ifdef SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE
-+ {"PEER_DID_NOT_RETURN_A_CERTIFICATE", ERR_LIB_SSL,
SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE},
-+ #else
-+ {"PEER_DID_NOT_RETURN_A_CERTIFICATE", ERR_LIB_SSL, 199},
-+ #endif
-+ #ifdef SSL_R_PEER_ERROR
-+ {"PEER_ERROR", ERR_LIB_SSL, SSL_R_PEER_ERROR},
-+ #else
-+ {"PEER_ERROR", ERR_LIB_SSL, 200},
-+ #endif
-+ #ifdef SSL_R_PEER_ERROR_CERTIFICATE
-+ {"PEER_ERROR_CERTIFICATE", ERR_LIB_SSL, SSL_R_PEER_ERROR_CERTIFICATE},
-+ #else
-+ {"PEER_ERROR_CERTIFICATE", ERR_LIB_SSL, 201},
-+ #endif
-+ #ifdef SSL_R_PEER_ERROR_NO_CERTIFICATE
-+ {"PEER_ERROR_NO_CERTIFICATE", ERR_LIB_SSL,
SSL_R_PEER_ERROR_NO_CERTIFICATE},
-+ #else
-+ {"PEER_ERROR_NO_CERTIFICATE", ERR_LIB_SSL, 202},
-+ #endif
-+ #ifdef SSL_R_PEER_ERROR_NO_CIPHER
-+ {"PEER_ERROR_NO_CIPHER", ERR_LIB_SSL, SSL_R_PEER_ERROR_NO_CIPHER},
-+ #else
-+ {"PEER_ERROR_NO_CIPHER", ERR_LIB_SSL, 203},
-+ #endif
-+ #ifdef SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE
-+ {"PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE", ERR_LIB_SSL,
SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE},
-+ #else
-+ {"PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE", ERR_LIB_SSL, 204},
-+ #endif
-+ #ifdef SSL_R_PRE_MAC_LENGTH_TOO_LONG
-+ {"PRE_MAC_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_PRE_MAC_LENGTH_TOO_LONG},
-+ #else
-+ {"PRE_MAC_LENGTH_TOO_LONG", ERR_LIB_SSL, 205},
-+ #endif
-+ #ifdef SSL_R_PROBLEMS_MAPPING_CIPHER_FUNCTIONS
-+ {"PROBLEMS_MAPPING_CIPHER_FUNCTIONS", ERR_LIB_SSL,
SSL_R_PROBLEMS_MAPPING_CIPHER_FUNCTIONS},
-+ #else
-+ {"PROBLEMS_MAPPING_CIPHER_FUNCTIONS", ERR_LIB_SSL, 206},
-+ #endif
-+ #ifdef SSL_R_PROTOCOL_IS_SHUTDOWN
-+ {"PROTOCOL_IS_SHUTDOWN", ERR_LIB_SSL, SSL_R_PROTOCOL_IS_SHUTDOWN},
-+ #else
-+ {"PROTOCOL_IS_SHUTDOWN", ERR_LIB_SSL, 207},
-+ #endif
-+ #ifdef SSL_R_PSK_IDENTITY_NOT_FOUND
-+ {"PSK_IDENTITY_NOT_FOUND", ERR_LIB_SSL, SSL_R_PSK_IDENTITY_NOT_FOUND},
-+ #else
-+ {"PSK_IDENTITY_NOT_FOUND", ERR_LIB_SSL, 223},
-+ #endif
-+ #ifdef SSL_R_PSK_NO_CLIENT_CB
-+ {"PSK_NO_CLIENT_CB", ERR_LIB_SSL, SSL_R_PSK_NO_CLIENT_CB},
-+ #else
-+ {"PSK_NO_CLIENT_CB", ERR_LIB_SSL, 224},
-+ #endif
-+ #ifdef SSL_R_PSK_NO_SERVER_CB
-+ {"PSK_NO_SERVER_CB", ERR_LIB_SSL, SSL_R_PSK_NO_SERVER_CB},
-+ #else
-+ {"PSK_NO_SERVER_CB", ERR_LIB_SSL, 225},
-+ #endif
-+ #ifdef SSL_R_PUBLIC_KEY_ENCRYPT_ERROR
-+ {"PUBLIC_KEY_ENCRYPT_ERROR", ERR_LIB_SSL,
SSL_R_PUBLIC_KEY_ENCRYPT_ERROR},
-+ #else
-+ {"PUBLIC_KEY_ENCRYPT_ERROR", ERR_LIB_SSL, 208},
-+ #endif
-+ #ifdef SSL_R_PUBLIC_KEY_IS_NOT_RSA
-+ {"PUBLIC_KEY_IS_NOT_RSA", ERR_LIB_SSL, SSL_R_PUBLIC_KEY_IS_NOT_RSA},
-+ #else
-+ {"PUBLIC_KEY_IS_NOT_RSA", ERR_LIB_SSL, 209},
-+ #endif
-+ #ifdef SSL_R_PUBLIC_KEY_NOT_RSA
-+ {"PUBLIC_KEY_NOT_RSA", ERR_LIB_SSL, SSL_R_PUBLIC_KEY_NOT_RSA},
-+ #else
-+ {"PUBLIC_KEY_NOT_RSA", ERR_LIB_SSL, 210},
-+ #endif
-+ #ifdef SSL_R_READ_BIO_NOT_SET
-+ {"READ_BIO_NOT_SET", ERR_LIB_SSL, SSL_R_READ_BIO_NOT_SET},
-+ #else
-+ {"READ_BIO_NOT_SET", ERR_LIB_SSL, 211},
-+ #endif
-+ #ifdef SSL_R_READ_TIMEOUT_EXPIRED
-+ {"READ_TIMEOUT_EXPIRED", ERR_LIB_SSL, SSL_R_READ_TIMEOUT_EXPIRED},
-+ #else
-+ {"READ_TIMEOUT_EXPIRED", ERR_LIB_SSL, 312},
-+ #endif
-+ #ifdef SSL_R_READ_WRONG_PACKET_TYPE
-+ {"READ_WRONG_PACKET_TYPE", ERR_LIB_SSL, SSL_R_READ_WRONG_PACKET_TYPE},
-+ #else
-+ {"READ_WRONG_PACKET_TYPE", ERR_LIB_SSL, 212},
-+ #endif
-+ #ifdef SSL_R_RECORD_LENGTH_MISMATCH
-+ {"RECORD_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_RECORD_LENGTH_MISMATCH},
-+ #else
-+ {"RECORD_LENGTH_MISMATCH", ERR_LIB_SSL, 213},
-+ #endif
-+ #ifdef SSL_R_RECORD_TOO_LARGE
-+ {"RECORD_TOO_LARGE", ERR_LIB_SSL, SSL_R_RECORD_TOO_LARGE},
-+ #else
-+ {"RECORD_TOO_LARGE", ERR_LIB_SSL, 214},
-+ #endif
-+ #ifdef SSL_R_RECORD_TOO_SMALL
-+ {"RECORD_TOO_SMALL", ERR_LIB_SSL, SSL_R_RECORD_TOO_SMALL},
-+ #else
-+ {"RECORD_TOO_SMALL", ERR_LIB_SSL, 298},
-+ #endif
-+ #ifdef SSL_R_RENEGOTIATE_EXT_TOO_LONG
-+ {"RENEGOTIATE_EXT_TOO_LONG", ERR_LIB_SSL,
SSL_R_RENEGOTIATE_EXT_TOO_LONG},
-+ #else
-+ {"RENEGOTIATE_EXT_TOO_LONG", ERR_LIB_SSL, 335},
-+ #endif
-+ #ifdef SSL_R_RENEGOTIATION_ENCODING_ERR
-+ {"RENEGOTIATION_ENCODING_ERR", ERR_LIB_SSL,
SSL_R_RENEGOTIATION_ENCODING_ERR},
-+ #else
-+ {"RENEGOTIATION_ENCODING_ERR", ERR_LIB_SSL, 336},
-+ #endif
-+ #ifdef SSL_R_RENEGOTIATION_MISMATCH
-+ {"RENEGOTIATION_MISMATCH", ERR_LIB_SSL, SSL_R_RENEGOTIATION_MISMATCH},
-+ #else
-+ {"RENEGOTIATION_MISMATCH", ERR_LIB_SSL, 337},
-+ #endif
-+ #ifdef SSL_R_REQUIRED_CIPHER_MISSING
-+ {"REQUIRED_CIPHER_MISSING", ERR_LIB_SSL, SSL_R_REQUIRED_CIPHER_MISSING},
-+ #else
-+ {"REQUIRED_CIPHER_MISSING", ERR_LIB_SSL, 215},
-+ #endif
-+ #ifdef SSL_R_REQUIRED_COMPRESSSION_ALGORITHM_MISSING
-+ {"REQUIRED_COMPRESSSION_ALGORITHM_MISSING", ERR_LIB_SSL,
SSL_R_REQUIRED_COMPRESSSION_ALGORITHM_MISSING},
-+ #else
-+ {"REQUIRED_COMPRESSSION_ALGORITHM_MISSING", ERR_LIB_SSL, 342},
-+ #endif
-+ #ifdef SSL_R_REUSE_CERT_LENGTH_NOT_ZERO
-+ {"REUSE_CERT_LENGTH_NOT_ZERO", ERR_LIB_SSL,
SSL_R_REUSE_CERT_LENGTH_NOT_ZERO},
-+ #else
-+ {"REUSE_CERT_LENGTH_NOT_ZERO", ERR_LIB_SSL, 216},
-+ #endif
-+ #ifdef SSL_R_REUSE_CERT_TYPE_NOT_ZERO
-+ {"REUSE_CERT_TYPE_NOT_ZERO", ERR_LIB_SSL,
SSL_R_REUSE_CERT_TYPE_NOT_ZERO},
-+ #else
-+ {"REUSE_CERT_TYPE_NOT_ZERO", ERR_LIB_SSL, 217},
-+ #endif
-+ #ifdef SSL_R_REUSE_CIPHER_LIST_NOT_ZERO
-+ {"REUSE_CIPHER_LIST_NOT_ZERO", ERR_LIB_SSL,
SSL_R_REUSE_CIPHER_LIST_NOT_ZERO},
-+ #else
-+ {"REUSE_CIPHER_LIST_NOT_ZERO", ERR_LIB_SSL, 218},
-+ #endif
-+ #ifdef SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING
-+ {"SCSV_RECEIVED_WHEN_RENEGOTIATING", ERR_LIB_SSL,
SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING},
-+ #else
-+ {"SCSV_RECEIVED_WHEN_RENEGOTIATING", ERR_LIB_SSL, 345},
-+ #endif
-+ #ifdef SSL_R_SERVERHELLO_TLSEXT
-+ {"SERVERHELLO_TLSEXT", ERR_LIB_SSL, SSL_R_SERVERHELLO_TLSEXT},
-+ #else
-+ {"SERVERHELLO_TLSEXT", ERR_LIB_SSL, 275},
-+ #endif
-+ #ifdef SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED
-+ {"SESSION_ID_CONTEXT_UNINITIALIZED", ERR_LIB_SSL,
SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED},
-+ #else
-+ {"SESSION_ID_CONTEXT_UNINITIALIZED", ERR_LIB_SSL, 277},
-+ #endif
-+ #ifdef SSL_R_SHORT_READ
-+ {"SHORT_READ", ERR_LIB_SSL, SSL_R_SHORT_READ},
-+ #else
-+ {"SHORT_READ", ERR_LIB_SSL, 219},
-+ #endif
-+ #ifdef SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE
-+ {"SIGNATURE_FOR_NON_SIGNING_CERTIFICATE", ERR_LIB_SSL,
SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE},
-+ #else
-+ {"SIGNATURE_FOR_NON_SIGNING_CERTIFICATE", ERR_LIB_SSL, 220},
-+ #endif
-+ #ifdef SSL_R_SSL23_DOING_SESSION_ID_REUSE
-+ {"SSL23_DOING_SESSION_ID_REUSE", ERR_LIB_SSL,
SSL_R_SSL23_DOING_SESSION_ID_REUSE},
-+ #else
-+ {"SSL23_DOING_SESSION_ID_REUSE", ERR_LIB_SSL, 221},
-+ #endif
-+ #ifdef SSL_R_SSL2_CONNECTION_ID_TOO_LONG
-+ {"SSL2_CONNECTION_ID_TOO_LONG", ERR_LIB_SSL,
SSL_R_SSL2_CONNECTION_ID_TOO_LONG},
-+ #else
-+ {"SSL2_CONNECTION_ID_TOO_LONG", ERR_LIB_SSL, 299},
-+ #endif
-+ #ifdef SSL_R_SSL3_EXT_INVALID_ECPOINTFORMAT
-+ {"SSL3_EXT_INVALID_ECPOINTFORMAT", ERR_LIB_SSL,
SSL_R_SSL3_EXT_INVALID_ECPOINTFORMAT},
-+ #else
-+ {"SSL3_EXT_INVALID_ECPOINTFORMAT", ERR_LIB_SSL, 321},
-+ #endif
-+ #ifdef SSL_R_SSL3_EXT_INVALID_SERVERNAME
-+ {"SSL3_EXT_INVALID_SERVERNAME", ERR_LIB_SSL,
SSL_R_SSL3_EXT_INVALID_SERVERNAME},
-+ #else
-+ {"SSL3_EXT_INVALID_SERVERNAME", ERR_LIB_SSL, 319},
-+ #endif
-+ #ifdef SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE
-+ {"SSL3_EXT_INVALID_SERVERNAME_TYPE", ERR_LIB_SSL,
SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE},
-+ #else
-+ {"SSL3_EXT_INVALID_SERVERNAME_TYPE", ERR_LIB_SSL, 320},
-+ #endif
-+ #ifdef SSL_R_SSL3_SESSION_ID_TOO_LONG
-+ {"SSL3_SESSION_ID_TOO_LONG", ERR_LIB_SSL,
SSL_R_SSL3_SESSION_ID_TOO_LONG},
-+ #else
-+ {"SSL3_SESSION_ID_TOO_LONG", ERR_LIB_SSL, 300},
-+ #endif
-+ #ifdef SSL_R_SSL3_SESSION_ID_TOO_SHORT
-+ {"SSL3_SESSION_ID_TOO_SHORT", ERR_LIB_SSL,
SSL_R_SSL3_SESSION_ID_TOO_SHORT},
-+ #else
-+ {"SSL3_SESSION_ID_TOO_SHORT", ERR_LIB_SSL, 222},
-+ #endif
-+ #ifdef SSL_R_SSLV3_ALERT_BAD_CERTIFICATE
-+ {"SSLV3_ALERT_BAD_CERTIFICATE", ERR_LIB_SSL,
SSL_R_SSLV3_ALERT_BAD_CERTIFICATE},
-+ #else
-+ {"SSLV3_ALERT_BAD_CERTIFICATE", ERR_LIB_SSL, 1042},
-+ #endif
-+ #ifdef SSL_R_SSLV3_ALERT_BAD_RECORD_MAC
-+ {"SSLV3_ALERT_BAD_RECORD_MAC", ERR_LIB_SSL,
SSL_R_SSLV3_ALERT_BAD_RECORD_MAC},
-+ #else
-+ {"SSLV3_ALERT_BAD_RECORD_MAC", ERR_LIB_SSL, 1020},
-+ #endif
-+ #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED
-+ {"SSLV3_ALERT_CERTIFICATE_EXPIRED", ERR_LIB_SSL,
SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED},
-+ #else
-+ {"SSLV3_ALERT_CERTIFICATE_EXPIRED", ERR_LIB_SSL, 1045},
-+ #endif
-+ #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED
-+ {"SSLV3_ALERT_CERTIFICATE_REVOKED", ERR_LIB_SSL,
SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED},
-+ #else
-+ {"SSLV3_ALERT_CERTIFICATE_REVOKED", ERR_LIB_SSL, 1044},
-+ #endif
-+ #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN
-+ {"SSLV3_ALERT_CERTIFICATE_UNKNOWN", ERR_LIB_SSL,
SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN},
-+ #else
-+ {"SSLV3_ALERT_CERTIFICATE_UNKNOWN", ERR_LIB_SSL, 1046},
-+ #endif
-+ #ifdef SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE
-+ {"SSLV3_ALERT_DECOMPRESSION_FAILURE", ERR_LIB_SSL,
SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE},
-+ #else
-+ {"SSLV3_ALERT_DECOMPRESSION_FAILURE", ERR_LIB_SSL, 1030},
-+ #endif
-+ #ifdef SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE
-+ {"SSLV3_ALERT_HANDSHAKE_FAILURE", ERR_LIB_SSL,
SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE},
-+ #else
-+ {"SSLV3_ALERT_HANDSHAKE_FAILURE", ERR_LIB_SSL, 1040},
-+ #endif
-+ #ifdef SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER
-+ {"SSLV3_ALERT_ILLEGAL_PARAMETER", ERR_LIB_SSL,
SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER},
-+ #else
-+ {"SSLV3_ALERT_ILLEGAL_PARAMETER", ERR_LIB_SSL, 1047},
-+ #endif
-+ #ifdef SSL_R_SSLV3_ALERT_NO_CERTIFICATE
-+ {"SSLV3_ALERT_NO_CERTIFICATE", ERR_LIB_SSL,
SSL_R_SSLV3_ALERT_NO_CERTIFICATE},
-+ #else
-+ {"SSLV3_ALERT_NO_CERTIFICATE", ERR_LIB_SSL, 1041},
-+ #endif
-+ #ifdef SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE
-+ {"SSLV3_ALERT_UNEXPECTED_MESSAGE", ERR_LIB_SSL,
SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE},
-+ #else
-+ {"SSLV3_ALERT_UNEXPECTED_MESSAGE", ERR_LIB_SSL, 1010},
-+ #endif
-+ #ifdef SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE
-+ {"SSLV3_ALERT_UNSUPPORTED_CERTIFICATE", ERR_LIB_SSL,
SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE},
-+ #else
-+ {"SSLV3_ALERT_UNSUPPORTED_CERTIFICATE", ERR_LIB_SSL, 1043},
-+ #endif
-+ #ifdef SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION
-+ {"SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION", ERR_LIB_SSL,
SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION},
-+ #else
-+ {"SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION", ERR_LIB_SSL, 228},
-+ #endif
-+ #ifdef SSL_R_SSL_HANDSHAKE_FAILURE
-+ {"SSL_HANDSHAKE_FAILURE", ERR_LIB_SSL, SSL_R_SSL_HANDSHAKE_FAILURE},
-+ #else
-+ {"SSL_HANDSHAKE_FAILURE", ERR_LIB_SSL, 229},
-+ #endif
-+ #ifdef SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS
-+ {"SSL_LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL,
SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS},
-+ #else
-+ {"SSL_LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, 230},
-+ #endif
-+ #ifdef SSL_R_SSL_SESSION_ID_CALLBACK_FAILED
-+ {"SSL_SESSION_ID_CALLBACK_FAILED", ERR_LIB_SSL,
SSL_R_SSL_SESSION_ID_CALLBACK_FAILED},
-+ #else
-+ {"SSL_SESSION_ID_CALLBACK_FAILED", ERR_LIB_SSL, 301},
-+ #endif
-+ #ifdef SSL_R_SSL_SESSION_ID_CONFLICT
-+ {"SSL_SESSION_ID_CONFLICT", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CONFLICT},
-+ #else
-+ {"SSL_SESSION_ID_CONFLICT", ERR_LIB_SSL, 302},
-+ #endif
-+ #ifdef SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG
-+ {"SSL_SESSION_ID_CONTEXT_TOO_LONG", ERR_LIB_SSL,
SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG},
-+ #else
-+ {"SSL_SESSION_ID_CONTEXT_TOO_LONG", ERR_LIB_SSL, 273},
-+ #endif
-+ #ifdef SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH
-+ {"SSL_SESSION_ID_HAS_BAD_LENGTH", ERR_LIB_SSL,
SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH},
-+ #else
-+ {"SSL_SESSION_ID_HAS_BAD_LENGTH", ERR_LIB_SSL, 303},
-+ #endif
-+ #ifdef SSL_R_SSL_SESSION_ID_IS_DIFFERENT
-+ {"SSL_SESSION_ID_IS_DIFFERENT", ERR_LIB_SSL,
SSL_R_SSL_SESSION_ID_IS_DIFFERENT},
-+ #else
-+ {"SSL_SESSION_ID_IS_DIFFERENT", ERR_LIB_SSL, 231},
-+ #endif
-+ #ifdef SSL_R_TLSV1_ALERT_ACCESS_DENIED
-+ {"TLSV1_ALERT_ACCESS_DENIED", ERR_LIB_SSL,
SSL_R_TLSV1_ALERT_ACCESS_DENIED},
-+ #else
-+ {"TLSV1_ALERT_ACCESS_DENIED", ERR_LIB_SSL, 1049},
-+ #endif
-+ #ifdef SSL_R_TLSV1_ALERT_DECODE_ERROR
-+ {"TLSV1_ALERT_DECODE_ERROR", ERR_LIB_SSL,
SSL_R_TLSV1_ALERT_DECODE_ERROR},
-+ #else
-+ {"TLSV1_ALERT_DECODE_ERROR", ERR_LIB_SSL, 1050},
-+ #endif
-+ #ifdef SSL_R_TLSV1_ALERT_DECRYPTION_FAILED
-+ {"TLSV1_ALERT_DECRYPTION_FAILED", ERR_LIB_SSL,
SSL_R_TLSV1_ALERT_DECRYPTION_FAILED},
-+ #else
-+ {"TLSV1_ALERT_DECRYPTION_FAILED", ERR_LIB_SSL, 1021},
-+ #endif
-+ #ifdef SSL_R_TLSV1_ALERT_DECRYPT_ERROR
-+ {"TLSV1_ALERT_DECRYPT_ERROR", ERR_LIB_SSL,
SSL_R_TLSV1_ALERT_DECRYPT_ERROR},
-+ #else
-+ {"TLSV1_ALERT_DECRYPT_ERROR", ERR_LIB_SSL, 1051},
-+ #endif
-+ #ifdef SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION
-+ {"TLSV1_ALERT_EXPORT_RESTRICTION", ERR_LIB_SSL,
SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION},
-+ #else
-+ {"TLSV1_ALERT_EXPORT_RESTRICTION", ERR_LIB_SSL, 1060},
-+ #endif
-+ #ifdef SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY
-+ {"TLSV1_ALERT_INSUFFICIENT_SECURITY", ERR_LIB_SSL,
SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY},
-+ #else
-+ {"TLSV1_ALERT_INSUFFICIENT_SECURITY", ERR_LIB_SSL, 1071},
-+ #endif
-+ #ifdef SSL_R_TLSV1_ALERT_INTERNAL_ERROR
-+ {"TLSV1_ALERT_INTERNAL_ERROR", ERR_LIB_SSL,
SSL_R_TLSV1_ALERT_INTERNAL_ERROR},
-+ #else
-+ {"TLSV1_ALERT_INTERNAL_ERROR", ERR_LIB_SSL, 1080},
-+ #endif
-+ #ifdef SSL_R_TLSV1_ALERT_NO_RENEGOTIATION
-+ {"TLSV1_ALERT_NO_RENEGOTIATION", ERR_LIB_SSL,
SSL_R_TLSV1_ALERT_NO_RENEGOTIATION},
-+ #else
-+ {"TLSV1_ALERT_NO_RENEGOTIATION", ERR_LIB_SSL, 1100},
-+ #endif
-+ #ifdef SSL_R_TLSV1_ALERT_PROTOCOL_VERSION
-+ {"TLSV1_ALERT_PROTOCOL_VERSION", ERR_LIB_SSL,
SSL_R_TLSV1_ALERT_PROTOCOL_VERSION},
-+ #else
-+ {"TLSV1_ALERT_PROTOCOL_VERSION", ERR_LIB_SSL, 1070},
-+ #endif
-+ #ifdef SSL_R_TLSV1_ALERT_RECORD_OVERFLOW
-+ {"TLSV1_ALERT_RECORD_OVERFLOW", ERR_LIB_SSL,
SSL_R_TLSV1_ALERT_RECORD_OVERFLOW},
-+ #else
-+ {"TLSV1_ALERT_RECORD_OVERFLOW", ERR_LIB_SSL, 1022},
-+ #endif
-+ #ifdef SSL_R_TLSV1_ALERT_UNKNOWN_CA
-+ {"TLSV1_ALERT_UNKNOWN_CA", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_UNKNOWN_CA},
-+ #else
-+ {"TLSV1_ALERT_UNKNOWN_CA", ERR_LIB_SSL, 1048},
-+ #endif
-+ #ifdef SSL_R_TLSV1_ALERT_USER_CANCELLED
-+ {"TLSV1_ALERT_USER_CANCELLED", ERR_LIB_SSL,
SSL_R_TLSV1_ALERT_USER_CANCELLED},
-+ #else
-+ {"TLSV1_ALERT_USER_CANCELLED", ERR_LIB_SSL, 1090},
-+ #endif
-+ #ifdef SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE
-+ {"TLSV1_BAD_CERTIFICATE_HASH_VALUE", ERR_LIB_SSL,
SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE},
-+ #else
-+ {"TLSV1_BAD_CERTIFICATE_HASH_VALUE", ERR_LIB_SSL, 1114},
-+ #endif
-+ #ifdef SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE
-+ {"TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE", ERR_LIB_SSL,
SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE},
-+ #else
-+ {"TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE", ERR_LIB_SSL, 1113},
-+ #endif
-+ #ifdef SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE
-+ {"TLSV1_CERTIFICATE_UNOBTAINABLE", ERR_LIB_SSL,
SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE},
-+ #else
-+ {"TLSV1_CERTIFICATE_UNOBTAINABLE", ERR_LIB_SSL, 1111},
-+ #endif
-+ #ifdef SSL_R_TLSV1_UNRECOGNIZED_NAME
-+ {"TLSV1_UNRECOGNIZED_NAME", ERR_LIB_SSL, SSL_R_TLSV1_UNRECOGNIZED_NAME},
-+ #else
-+ {"TLSV1_UNRECOGNIZED_NAME", ERR_LIB_SSL, 1112},
-+ #endif
-+ #ifdef SSL_R_TLSV1_UNSUPPORTED_EXTENSION
-+ {"TLSV1_UNSUPPORTED_EXTENSION", ERR_LIB_SSL,
SSL_R_TLSV1_UNSUPPORTED_EXTENSION},
-+ #else
-+ {"TLSV1_UNSUPPORTED_EXTENSION", ERR_LIB_SSL, 1110},
-+ #endif
-+ #ifdef SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER
-+ {"TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER", ERR_LIB_SSL,
SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER},
-+ #else
-+ {"TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER", ERR_LIB_SSL, 232},
-+ #endif
-+ #ifdef SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST
-+ {"TLS_INVALID_ECPOINTFORMAT_LIST", ERR_LIB_SSL,
SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST},
-+ #else
-+ {"TLS_INVALID_ECPOINTFORMAT_LIST", ERR_LIB_SSL, 157},
-+ #endif
-+ #ifdef SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST
-+ {"TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST", ERR_LIB_SSL,
SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST},
-+ #else
-+ {"TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST", ERR_LIB_SSL, 233},
-+ #endif
-+ #ifdef SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG
-+ {"TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG", ERR_LIB_SSL,
SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG},
-+ #else
-+ {"TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG", ERR_LIB_SSL, 234},
-+ #endif
-+ #ifdef SSL_R_TRIED_TO_USE_UNSUPPORTED_CIPHER
-+ {"TRIED_TO_USE_UNSUPPORTED_CIPHER", ERR_LIB_SSL,
SSL_R_TRIED_TO_USE_UNSUPPORTED_CIPHER},
-+ #else
-+ {"TRIED_TO_USE_UNSUPPORTED_CIPHER", ERR_LIB_SSL, 235},
-+ #endif
-+ #ifdef SSL_R_UNABLE_TO_DECODE_DH_CERTS
-+ {"UNABLE_TO_DECODE_DH_CERTS", ERR_LIB_SSL,
SSL_R_UNABLE_TO_DECODE_DH_CERTS},
-+ #else
-+ {"UNABLE_TO_DECODE_DH_CERTS", ERR_LIB_SSL, 236},
-+ #endif
-+ #ifdef SSL_R_UNABLE_TO_DECODE_ECDH_CERTS
-+ {"UNABLE_TO_DECODE_ECDH_CERTS", ERR_LIB_SSL,
SSL_R_UNABLE_TO_DECODE_ECDH_CERTS},
-+ #else
-+ {"UNABLE_TO_DECODE_ECDH_CERTS", ERR_LIB_SSL, 313},
-+ #endif
-+ #ifdef SSL_R_UNABLE_TO_EXTRACT_PUBLIC_KEY
-+ {"UNABLE_TO_EXTRACT_PUBLIC_KEY", ERR_LIB_SSL,
SSL_R_UNABLE_TO_EXTRACT_PUBLIC_KEY},
-+ #else
-+ {"UNABLE_TO_EXTRACT_PUBLIC_KEY", ERR_LIB_SSL, 237},
-+ #endif
-+ #ifdef SSL_R_UNABLE_TO_FIND_DH_PARAMETERS
-+ {"UNABLE_TO_FIND_DH_PARAMETERS", ERR_LIB_SSL,
SSL_R_UNABLE_TO_FIND_DH_PARAMETERS},
-+ #else
-+ {"UNABLE_TO_FIND_DH_PARAMETERS", ERR_LIB_SSL, 238},
-+ #endif
-+ #ifdef SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS
-+ {"UNABLE_TO_FIND_ECDH_PARAMETERS", ERR_LIB_SSL,
SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS},
-+ #else
-+ {"UNABLE_TO_FIND_ECDH_PARAMETERS", ERR_LIB_SSL, 314},
-+ #endif
-+ #ifdef SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS
-+ {"UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS", ERR_LIB_SSL,
SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS},
-+ #else
-+ {"UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS", ERR_LIB_SSL, 239},
-+ #endif
-+ #ifdef SSL_R_UNABLE_TO_FIND_SSL_METHOD
-+ {"UNABLE_TO_FIND_SSL_METHOD", ERR_LIB_SSL,
SSL_R_UNABLE_TO_FIND_SSL_METHOD},
-+ #else
-+ {"UNABLE_TO_FIND_SSL_METHOD", ERR_LIB_SSL, 240},
-+ #endif
-+ #ifdef SSL_R_UNABLE_TO_LOAD_SSL2_MD5_ROUTINES
-+ {"UNABLE_TO_LOAD_SSL2_MD5_ROUTINES", ERR_LIB_SSL,
SSL_R_UNABLE_TO_LOAD_SSL2_MD5_ROUTINES},
-+ #else
-+ {"UNABLE_TO_LOAD_SSL2_MD5_ROUTINES", ERR_LIB_SSL, 241},
-+ #endif
-+ #ifdef SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES
-+ {"UNABLE_TO_LOAD_SSL3_MD5_ROUTINES", ERR_LIB_SSL,
SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES},
-+ #else
-+ {"UNABLE_TO_LOAD_SSL3_MD5_ROUTINES", ERR_LIB_SSL, 242},
-+ #endif
-+ #ifdef SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES
-+ {"UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES", ERR_LIB_SSL,
SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES},
-+ #else
-+ {"UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES", ERR_LIB_SSL, 243},
-+ #endif
-+ #ifdef SSL_R_UNEXPECTED_MESSAGE
-+ {"UNEXPECTED_MESSAGE", ERR_LIB_SSL, SSL_R_UNEXPECTED_MESSAGE},
-+ #else
-+ {"UNEXPECTED_MESSAGE", ERR_LIB_SSL, 244},
-+ #endif
-+ #ifdef SSL_R_UNEXPECTED_RECORD
-+ {"UNEXPECTED_RECORD", ERR_LIB_SSL, SSL_R_UNEXPECTED_RECORD},
-+ #else
-+ {"UNEXPECTED_RECORD", ERR_LIB_SSL, 245},
-+ #endif
-+ #ifdef SSL_R_UNINITIALIZED
-+ {"UNINITIALIZED", ERR_LIB_SSL, SSL_R_UNINITIALIZED},
-+ #else
-+ {"UNINITIALIZED", ERR_LIB_SSL, 276},
-+ #endif
-+ #ifdef SSL_R_UNKNOWN_ALERT_TYPE
-+ {"UNKNOWN_ALERT_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_ALERT_TYPE},
-+ #else
-+ {"UNKNOWN_ALERT_TYPE", ERR_LIB_SSL, 246},
-+ #endif
-+ #ifdef SSL_R_UNKNOWN_CERTIFICATE_TYPE
-+ {"UNKNOWN_CERTIFICATE_TYPE", ERR_LIB_SSL,
SSL_R_UNKNOWN_CERTIFICATE_TYPE},
-+ #else
-+ {"UNKNOWN_CERTIFICATE_TYPE", ERR_LIB_SSL, 247},
-+ #endif
-+ #ifdef SSL_R_UNKNOWN_CIPHER_RETURNED
-+ {"UNKNOWN_CIPHER_RETURNED", ERR_LIB_SSL, SSL_R_UNKNOWN_CIPHER_RETURNED},
-+ #else
-+ {"UNKNOWN_CIPHER_RETURNED", ERR_LIB_SSL, 248},
-+ #endif
-+ #ifdef SSL_R_UNKNOWN_CIPHER_TYPE
-+ {"UNKNOWN_CIPHER_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_CIPHER_TYPE},
-+ #else
-+ {"UNKNOWN_CIPHER_TYPE", ERR_LIB_SSL, 249},
-+ #endif
-+ #ifdef SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE
-+ {"UNKNOWN_KEY_EXCHANGE_TYPE", ERR_LIB_SSL,
SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE},
-+ #else
-+ {"UNKNOWN_KEY_EXCHANGE_TYPE", ERR_LIB_SSL, 250},
-+ #endif
-+ #ifdef SSL_R_UNKNOWN_PKEY_TYPE
-+ {"UNKNOWN_PKEY_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_PKEY_TYPE},
-+ #else
-+ {"UNKNOWN_PKEY_TYPE", ERR_LIB_SSL, 251},
-+ #endif
-+ #ifdef SSL_R_UNKNOWN_PROTOCOL
-+ {"UNKNOWN_PROTOCOL", ERR_LIB_SSL, SSL_R_UNKNOWN_PROTOCOL},
-+ #else
-+ {"UNKNOWN_PROTOCOL", ERR_LIB_SSL, 252},
-+ #endif
-+ #ifdef SSL_R_UNKNOWN_REMOTE_ERROR_TYPE
-+ {"UNKNOWN_REMOTE_ERROR_TYPE", ERR_LIB_SSL,
SSL_R_UNKNOWN_REMOTE_ERROR_TYPE},
-+ #else
-+ {"UNKNOWN_REMOTE_ERROR_TYPE", ERR_LIB_SSL, 253},
-+ #endif
-+ #ifdef SSL_R_UNKNOWN_SSL_VERSION
-+ {"UNKNOWN_SSL_VERSION", ERR_LIB_SSL, SSL_R_UNKNOWN_SSL_VERSION},
-+ #else
-+ {"UNKNOWN_SSL_VERSION", ERR_LIB_SSL, 254},
-+ #endif
-+ #ifdef SSL_R_UNKNOWN_STATE
-+ {"UNKNOWN_STATE", ERR_LIB_SSL, SSL_R_UNKNOWN_STATE},
-+ #else
-+ {"UNKNOWN_STATE", ERR_LIB_SSL, 255},
-+ #endif
-+ #ifdef SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED
-+ {"UNSAFE_LEGACY_RENEGOTIATION_DISABLED", ERR_LIB_SSL,
SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED},
-+ #else
-+ {"UNSAFE_LEGACY_RENEGOTIATION_DISABLED", ERR_LIB_SSL, 338},
-+ #endif
-+ #ifdef SSL_R_UNSUPPORTED_CIPHER
-+ {"UNSUPPORTED_CIPHER", ERR_LIB_SSL, SSL_R_UNSUPPORTED_CIPHER},
-+ #else
-+ {"UNSUPPORTED_CIPHER", ERR_LIB_SSL, 256},
-+ #endif
-+ #ifdef SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM
-+ {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_SSL,
SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM},
-+ #else
-+ {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_SSL, 257},
-+ #endif
-+ #ifdef SSL_R_UNSUPPORTED_DIGEST_TYPE
-+ {"UNSUPPORTED_DIGEST_TYPE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_DIGEST_TYPE},
-+ #else
-+ {"UNSUPPORTED_DIGEST_TYPE", ERR_LIB_SSL, 326},
-+ #endif
-+ #ifdef SSL_R_UNSUPPORTED_ELLIPTIC_CURVE
-+ {"UNSUPPORTED_ELLIPTIC_CURVE", ERR_LIB_SSL,
SSL_R_UNSUPPORTED_ELLIPTIC_CURVE},
-+ #else
-+ {"UNSUPPORTED_ELLIPTIC_CURVE", ERR_LIB_SSL, 315},
-+ #endif
-+ #ifdef SSL_R_UNSUPPORTED_PROTOCOL
-+ {"UNSUPPORTED_PROTOCOL", ERR_LIB_SSL, SSL_R_UNSUPPORTED_PROTOCOL},
-+ #else
-+ {"UNSUPPORTED_PROTOCOL", ERR_LIB_SSL, 258},
-+ #endif
-+ #ifdef SSL_R_UNSUPPORTED_SSL_VERSION
-+ {"UNSUPPORTED_SSL_VERSION", ERR_LIB_SSL, SSL_R_UNSUPPORTED_SSL_VERSION},
-+ #else
-+ {"UNSUPPORTED_SSL_VERSION", ERR_LIB_SSL, 259},
-+ #endif
-+ #ifdef SSL_R_UNSUPPORTED_STATUS_TYPE
-+ {"UNSUPPORTED_STATUS_TYPE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_STATUS_TYPE},
-+ #else
-+ {"UNSUPPORTED_STATUS_TYPE", ERR_LIB_SSL, 329},
-+ #endif
-+ #ifdef SSL_R_WRITE_BIO_NOT_SET
-+ {"WRITE_BIO_NOT_SET", ERR_LIB_SSL, SSL_R_WRITE_BIO_NOT_SET},
-+ #else
-+ {"WRITE_BIO_NOT_SET", ERR_LIB_SSL, 260},
-+ #endif
-+ #ifdef SSL_R_WRONG_CIPHER_RETURNED
-+ {"WRONG_CIPHER_RETURNED", ERR_LIB_SSL, SSL_R_WRONG_CIPHER_RETURNED},
-+ #else
-+ {"WRONG_CIPHER_RETURNED", ERR_LIB_SSL, 261},
-+ #endif
-+ #ifdef SSL_R_WRONG_MESSAGE_TYPE
-+ {"WRONG_MESSAGE_TYPE", ERR_LIB_SSL, SSL_R_WRONG_MESSAGE_TYPE},
-+ #else
-+ {"WRONG_MESSAGE_TYPE", ERR_LIB_SSL, 262},
-+ #endif
-+ #ifdef SSL_R_WRONG_NUMBER_OF_KEY_BITS
-+ {"WRONG_NUMBER_OF_KEY_BITS", ERR_LIB_SSL,
SSL_R_WRONG_NUMBER_OF_KEY_BITS},
-+ #else
-+ {"WRONG_NUMBER_OF_KEY_BITS", ERR_LIB_SSL, 263},
-+ #endif
-+ #ifdef SSL_R_WRONG_SIGNATURE_LENGTH
-+ {"WRONG_SIGNATURE_LENGTH", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_LENGTH},
-+ #else
-+ {"WRONG_SIGNATURE_LENGTH", ERR_LIB_SSL, 264},
-+ #endif
-+ #ifdef SSL_R_WRONG_SIGNATURE_SIZE
-+ {"WRONG_SIGNATURE_SIZE", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_SIZE},
-+ #else
-+ {"WRONG_SIGNATURE_SIZE", ERR_LIB_SSL, 265},
-+ #endif
-+ #ifdef SSL_R_WRONG_SSL_VERSION
-+ {"WRONG_SSL_VERSION", ERR_LIB_SSL, SSL_R_WRONG_SSL_VERSION},
-+ #else
-+ {"WRONG_SSL_VERSION", ERR_LIB_SSL, 266},
-+ #endif
-+ #ifdef SSL_R_WRONG_VERSION_NUMBER
-+ {"WRONG_VERSION_NUMBER", ERR_LIB_SSL, SSL_R_WRONG_VERSION_NUMBER},
-+ #else
-+ {"WRONG_VERSION_NUMBER", ERR_LIB_SSL, 267},
-+ #endif
-+ #ifdef SSL_R_X509_LIB
-+ {"X509_LIB", ERR_LIB_SSL, SSL_R_X509_LIB},
-+ #else
-+ {"X509_LIB", ERR_LIB_SSL, 268},
-+ #endif
-+ #ifdef SSL_R_X509_VERIFICATION_SETUP_PROBLEMS
-+ {"X509_VERIFICATION_SETUP_PROBLEMS", ERR_LIB_SSL,
SSL_R_X509_VERIFICATION_SETUP_PROBLEMS},
-+ #else
-+ {"X509_VERIFICATION_SETUP_PROBLEMS", ERR_LIB_SSL, 269},
-+ #endif
-+ #ifdef X509_R_BAD_X509_FILETYPE
-+ {"BAD_X509_FILETYPE", ERR_LIB_X509, X509_R_BAD_X509_FILETYPE},
-+ #else
-+ {"BAD_X509_FILETYPE", ERR_LIB_X509, 100},
-+ #endif
-+ #ifdef X509_R_BASE64_DECODE_ERROR
-+ {"BASE64_DECODE_ERROR", ERR_LIB_X509, X509_R_BASE64_DECODE_ERROR},
-+ #else
-+ {"BASE64_DECODE_ERROR", ERR_LIB_X509, 118},
-+ #endif
-+ #ifdef X509_R_CANT_CHECK_DH_KEY
-+ {"CANT_CHECK_DH_KEY", ERR_LIB_X509, X509_R_CANT_CHECK_DH_KEY},
-+ #else
-+ {"CANT_CHECK_DH_KEY", ERR_LIB_X509, 114},
-+ #endif
-+ #ifdef X509_R_CERT_ALREADY_IN_HASH_TABLE
-+ {"CERT_ALREADY_IN_HASH_TABLE", ERR_LIB_X509,
X509_R_CERT_ALREADY_IN_HASH_TABLE},
-+ #else
-+ {"CERT_ALREADY_IN_HASH_TABLE", ERR_LIB_X509, 101},
-+ #endif
-+ #ifdef X509_R_ERR_ASN1_LIB
-+ {"ERR_ASN1_LIB", ERR_LIB_X509, X509_R_ERR_ASN1_LIB},
-+ #else
-+ {"ERR_ASN1_LIB", ERR_LIB_X509, 102},
-+ #endif
-+ #ifdef X509_R_INVALID_DIRECTORY
-+ {"INVALID_DIRECTORY", ERR_LIB_X509, X509_R_INVALID_DIRECTORY},
-+ #else
-+ {"INVALID_DIRECTORY", ERR_LIB_X509, 113},
-+ #endif
-+ #ifdef X509_R_INVALID_FIELD_NAME
-+ {"INVALID_FIELD_NAME", ERR_LIB_X509, X509_R_INVALID_FIELD_NAME},
-+ #else
-+ {"INVALID_FIELD_NAME", ERR_LIB_X509, 119},
-+ #endif
-+ #ifdef X509_R_INVALID_TRUST
-+ {"INVALID_TRUST", ERR_LIB_X509, X509_R_INVALID_TRUST},
-+ #else
-+ {"INVALID_TRUST", ERR_LIB_X509, 123},
-+ #endif
-+ #ifdef X509_R_KEY_TYPE_MISMATCH
-+ {"KEY_TYPE_MISMATCH", ERR_LIB_X509, X509_R_KEY_TYPE_MISMATCH},
-+ #else
-+ {"KEY_TYPE_MISMATCH", ERR_LIB_X509, 115},
-+ #endif
-+ #ifdef X509_R_KEY_VALUES_MISMATCH
-+ {"KEY_VALUES_MISMATCH", ERR_LIB_X509, X509_R_KEY_VALUES_MISMATCH},
-+ #else
-+ {"KEY_VALUES_MISMATCH", ERR_LIB_X509, 116},
-+ #endif
-+ #ifdef X509_R_LOADING_CERT_DIR
-+ {"LOADING_CERT_DIR", ERR_LIB_X509, X509_R_LOADING_CERT_DIR},
-+ #else
-+ {"LOADING_CERT_DIR", ERR_LIB_X509, 103},
-+ #endif
-+ #ifdef X509_R_LOADING_DEFAULTS
-+ {"LOADING_DEFAULTS", ERR_LIB_X509, X509_R_LOADING_DEFAULTS},
-+ #else
-+ {"LOADING_DEFAULTS", ERR_LIB_X509, 104},
-+ #endif
-+ #ifdef X509_R_METHOD_NOT_SUPPORTED
-+ {"METHOD_NOT_SUPPORTED", ERR_LIB_X509, X509_R_METHOD_NOT_SUPPORTED},
-+ #else
-+ {"METHOD_NOT_SUPPORTED", ERR_LIB_X509, 124},
-+ #endif
-+ #ifdef X509_R_NO_CERT_SET_FOR_US_TO_VERIFY
-+ {"NO_CERT_SET_FOR_US_TO_VERIFY", ERR_LIB_X509,
X509_R_NO_CERT_SET_FOR_US_TO_VERIFY},
-+ #else
-+ {"NO_CERT_SET_FOR_US_TO_VERIFY", ERR_LIB_X509, 105},
-+ #endif
-+ #ifdef X509_R_PUBLIC_KEY_DECODE_ERROR
-+ {"PUBLIC_KEY_DECODE_ERROR", ERR_LIB_X509,
X509_R_PUBLIC_KEY_DECODE_ERROR},
-+ #else
-+ {"PUBLIC_KEY_DECODE_ERROR", ERR_LIB_X509, 125},
-+ #endif
-+ #ifdef X509_R_PUBLIC_KEY_ENCODE_ERROR
-+ {"PUBLIC_KEY_ENCODE_ERROR", ERR_LIB_X509,
X509_R_PUBLIC_KEY_ENCODE_ERROR},
-+ #else
-+ {"PUBLIC_KEY_ENCODE_ERROR", ERR_LIB_X509, 126},
-+ #endif
-+ #ifdef X509_R_SHOULD_RETRY
-+ {"SHOULD_RETRY", ERR_LIB_X509, X509_R_SHOULD_RETRY},
-+ #else
-+ {"SHOULD_RETRY", ERR_LIB_X509, 106},
-+ #endif
-+ #ifdef X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN
-+ {"UNABLE_TO_FIND_PARAMETERS_IN_CHAIN", ERR_LIB_X509,
X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN},
-+ #else
-+ {"UNABLE_TO_FIND_PARAMETERS_IN_CHAIN", ERR_LIB_X509, 107},
-+ #endif
-+ #ifdef X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY
-+ {"UNABLE_TO_GET_CERTS_PUBLIC_KEY", ERR_LIB_X509,
X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY},
-+ #else
-+ {"UNABLE_TO_GET_CERTS_PUBLIC_KEY", ERR_LIB_X509, 108},
-+ #endif
-+ #ifdef X509_R_UNKNOWN_KEY_TYPE
-+ {"UNKNOWN_KEY_TYPE", ERR_LIB_X509, X509_R_UNKNOWN_KEY_TYPE},
-+ #else
-+ {"UNKNOWN_KEY_TYPE", ERR_LIB_X509, 117},
-+ #endif
-+ #ifdef X509_R_UNKNOWN_NID
-+ {"UNKNOWN_NID", ERR_LIB_X509, X509_R_UNKNOWN_NID},
-+ #else
-+ {"UNKNOWN_NID", ERR_LIB_X509, 109},
-+ #endif
-+ #ifdef X509_R_UNKNOWN_PURPOSE_ID
-+ {"UNKNOWN_PURPOSE_ID", ERR_LIB_X509, X509_R_UNKNOWN_PURPOSE_ID},
-+ #else
-+ {"UNKNOWN_PURPOSE_ID", ERR_LIB_X509, 121},
-+ #endif
-+ #ifdef X509_R_UNKNOWN_TRUST_ID
-+ {"UNKNOWN_TRUST_ID", ERR_LIB_X509, X509_R_UNKNOWN_TRUST_ID},
-+ #else
-+ {"UNKNOWN_TRUST_ID", ERR_LIB_X509, 120},
-+ #endif
-+ #ifdef X509_R_UNSUPPORTED_ALGORITHM
-+ {"UNSUPPORTED_ALGORITHM", ERR_LIB_X509, X509_R_UNSUPPORTED_ALGORITHM},
-+ #else
-+ {"UNSUPPORTED_ALGORITHM", ERR_LIB_X509, 111},
-+ #endif
-+ #ifdef X509_R_WRONG_LOOKUP_TYPE
-+ {"WRONG_LOOKUP_TYPE", ERR_LIB_X509, X509_R_WRONG_LOOKUP_TYPE},
-+ #else
-+ {"WRONG_LOOKUP_TYPE", ERR_LIB_X509, 112},
-+ #endif
-+ #ifdef X509_R_WRONG_TYPE
-+ {"WRONG_TYPE", ERR_LIB_X509, X509_R_WRONG_TYPE},
-+ #else
-+ {"WRONG_TYPE", ERR_LIB_X509, 122},
-+ #endif
-+ { NULL }
-+};
-diff --git a/Tools/ssl/make_ssl_data.py b/Tools/ssl/make_ssl_data.py
-new file mode 100755
-index 0000000..10244d1
---- /dev/null
-+++ b/Tools/ssl/make_ssl_data.py
-@@ -0,0 +1,68 @@
-+#! /usr/bin/env python3
-+
-+"""
-+This script should be called *manually* when we want to upgrade SSLError
-+`library` and `reason` mnemnonics to a more recent OpenSSL version.
-+
-+It takes two arguments:
-+- the path to the OpenSSL include files' directory
-+ (e.g. openssl-1.0.1-beta3/include/openssl/)
-+- the path to the C file to be generated
-+ (probably Modules/_ssl_data.h)
-+"""
-+
-+import datetime
-+import os
-+import re
-+import sys
-+
-+
-+def parse_error_codes(h_file, prefix):
-+ pat = re.compile(r"#define\W+(%s([\w]+))\W+(\d+)\b" % re.escape(prefix))
-+ codes = []
-+ with open(h_file, "r", encoding="latin1") as f:
-+ for line in f:
-+ match = pat.search(line)
-+ if match:
-+ code, name, num = match.groups()
-+ num = int(num)
-+ codes.append((code, name, num))
-+ return codes
-+
-+if __name__ == "__main__":
-+ openssl_inc = sys.argv[1]
-+ outfile = sys.argv[2]
-+ use_stdout = outfile == '-'
-+ f = sys.stdout if use_stdout else open(outfile, "w")
-+ error_libraries = (
-+ # (library code, mnemonic, error prefix, header file)
-+ ('ERR_LIB_PEM', 'PEM', 'PEM_R_', 'pem.h'),
-+ ('ERR_LIB_SSL', 'SSL', 'SSL_R_', 'ssl.h'),
-+ ('ERR_LIB_X509', 'X509', 'X509_R_', 'x509.h'),
-+ )
-+ def w(l):
-+ f.write(l + "\n")
-+ w("/* File generated by Tools/ssl/make_ssl_data.py */")
-+ w("/* Generated on %s */" % datetime.datetime.now().isoformat())
-+ w("")
-+
-+ w("static struct py_ssl_library_code library_codes[] = {")
-+ for libcode, mnemo, _, _ in error_libraries:
-+ w(' {"%s", %s},' % (mnemo, libcode))
-+ w(' { NULL }')
-+ w('};')
-+ w("")
-+
-+ w("static struct py_ssl_error_code error_codes[] = {")
-+ for libcode, _, prefix, h_file in error_libraries:
-+ codes = parse_error_codes(os.path.join(openssl_inc, h_file), prefix)
-+ for code, name, num in sorted(codes):
-+ w(' #ifdef %s' % (code))
-+ w(' {"%s", %s, %s},' % (name, libcode, code))
-+ w(' #else')
-+ w(' {"%s", %s, %d},' % (name, libcode, num))
-+ w(' #endif')
-+ w(' { NULL }')
-+ w('};')
-+ if not use_stdout:
-+ f.close()
-diff --git a/Tools/ssl/test_multiple_versions.py b/Tools/ssl/test_multiple_versions.py
-new file mode 100644
-index 0000000..fc7a967
---- /dev/null
-+++ b/Tools/ssl/test_multiple_versions.py
-@@ -0,0 +1,241 @@
-+#./python
-+"""Run Python tests with multiple installations of OpenSSL
-+
-+The script
-+
-+ (1) downloads OpenSSL tar bundle
-+ (2) extracts it to ../openssl/src/openssl-VERSION/
-+ (3) compiles OpenSSL
-+ (4) installs OpenSSL into ../openssl/VERSION/
-+ (5) forces a recompilation of Python modules using the
-+ header and library files from ../openssl/VERSION/
-+ (6) runs Python's test suite
-+
-+The script must be run with Python's build directory as current working
-+directory:
-+
-+ ./python Tools/ssl/test_multiple_versions.py
-+
-+The script uses LD_RUN_PATH, LD_LIBRARY_PATH, CPPFLAGS and LDFLAGS to bend
-+search paths for header files and shared libraries. It's known to work on
-+Linux with GCC 4.x.
-+
-+(c) 2013 Christian Heimes <christian(a)python.org>
-+"""
-+import logging
-+import os
-+import tarfile
-+import shutil
-+import subprocess
-+import sys
-+from urllib import urlopen
-+
-+log = logging.getLogger("multissl")
-+
-+OPENSSL_VERSIONS = [
-+ "0.9.7m", "0.9.8i", "0.9.8l", "0.9.8m",
"0.9.8y", "1.0.0k", "1.0.1e"
-+]
-+FULL_TESTS = [
-+ "test_asyncio", "test_ftplib", "test_hashlib",
"test_httplib",
-+ "test_imaplib", "test_nntplib", "test_poplib",
"test_smtplib",
-+ "test_smtpnet", "test_urllib2_localnet", "test_venv"
-+]
-+MINIMAL_TESTS = ["test_ssl", "test_hashlib"]
-+CADEFAULT = True
-+HERE = os.path.abspath(os.getcwd())
-+DEST_DIR = os.path.abspath(os.path.join(HERE, os.pardir, "openssl"))
-+
-+
-+class BuildSSL(object):
-+ url_template = "https://www.openssl.org/source/openssl-{}.tar.gz"
-+
-+ module_files = ["Modules/_ssl.c",
-+ "Modules/socketmodule.c",
-+ "Modules/_hashopenssl.c"]
-+
-+ def __init__(self, version, openssl_compile_args=(), destdir=DEST_DIR):
-+ self._check_python_builddir()
-+ self.version = version
-+ self.openssl_compile_args = openssl_compile_args
-+ # installation directory
-+ self.install_dir = os.path.join(destdir, version)
-+ # source file
-+ self.src_file = os.path.join(destdir, "src",
-+ "openssl-{}.tar.gz".format(version))
-+ # build directory (removed after install)
-+ self.build_dir = os.path.join(destdir, "src",
-+ "openssl-{}".format(version))
-+
-+ @property
-+ def openssl_cli(self):
-+ """openssl CLI binary"""
-+ return os.path.join(self.install_dir, "bin", "openssl")
-+
-+ @property
-+ def openssl_version(self):
-+ """output of 'bin/openssl version'"""
-+ env = os.environ.copy()
-+ env["LD_LIBRARY_PATH"] = self.lib_dir
-+ cmd = [self.openssl_cli, "version"]
-+ return self._subprocess_output(cmd, env=env)
-+
-+ @property
-+ def pyssl_version(self):
-+ """Value of ssl.OPENSSL_VERSION"""
-+ env = os.environ.copy()
-+ env["LD_LIBRARY_PATH"] = self.lib_dir
-+ cmd = ["./python", "-c", "import ssl;
print(ssl.OPENSSL_VERSION)"]
-+ return self._subprocess_output(cmd, env=env)
-+
-+ @property
-+ def include_dir(self):
-+ return os.path.join(self.install_dir, "include")
-+
-+ @property
-+ def lib_dir(self):
-+ return os.path.join(self.install_dir, "lib")
-+
-+ @property
-+ def has_openssl(self):
-+ return os.path.isfile(self.openssl_cli)
-+
-+ @property
-+ def has_src(self):
-+ return os.path.isfile(self.src_file)
-+
-+ def _subprocess_call(self, cmd, stdout=subprocess.DEVNULL, env=None,
-+ **kwargs):
-+ log.debug("Call '{}'".format(" ".join(cmd)))
-+ return subprocess.check_call(cmd, stdout=stdout, env=env, **kwargs)
-+
-+ def _subprocess_output(self, cmd, env=None, **kwargs):
-+ log.debug("Call '{}'".format(" ".join(cmd)))
-+ out = subprocess.check_output(cmd, env=env)
-+ return out.strip().decode("utf-8")
-+
-+ def _check_python_builddir(self):
-+ if not os.path.isfile("python") or not
os.path.isfile("setup.py"):
-+ raise ValueError("Script must be run in Python build directory")
-+
-+ def _download_openssl(self):
-+ """Download OpenSSL source dist"""
-+ src_dir = os.path.dirname(self.src_file)
-+ if not os.path.isdir(src_dir):
-+ os.makedirs(src_dir)
-+ url = self.url_template.format(self.version)
-+ log.info("Downloading OpenSSL from {}".format(url))
-+ req = urlopen(url, cadefault=CADEFAULT)
-+ # KISS, read all, write all
-+ data = req.read()
-+ log.info("Storing {}".format(self.src_file))
-+ with open(self.src_file, "wb") as f:
-+ f.write(data)
-+
-+ def _unpack_openssl(self):
-+ """Unpack tar.gz bundle"""
-+ # cleanup
-+ if os.path.isdir(self.build_dir):
-+ shutil.rmtree(self.build_dir)
-+ os.makedirs(self.build_dir)
-+
-+ tf = tarfile.open(self.src_file)
-+ base = "openssl-{}/".format(self.version)
-+ # force extraction into build dir
-+ members = tf.getmembers()
-+ for member in members:
-+ if not member.name.startswith(base):
-+ raise ValueError(member.name)
-+ member.name = member.name[len(base):]
-+ log.info("Unpacking files to {}".format(self.build_dir))
-+ tf.extractall(self.build_dir, members)
-+
-+ def _build_openssl(self):
-+ """Now build openssl"""
-+ log.info("Running build in {}".format(self.install_dir))
-+ cwd = self.build_dir
-+ cmd = ["./config", "shared",
"--prefix={}".format(self.install_dir)]
-+ cmd.extend(self.openssl_compile_args)
-+ self._subprocess_call(cmd, cwd=cwd)
-+ self._subprocess_call(["make"], cwd=cwd)
-+
-+ def _install_openssl(self, remove=True):
-+ self._subprocess_call(["make", "install"],
cwd=self.build_dir)
-+ if remove:
-+ shutil.rmtree(self.build_dir)
-+
-+ def install_openssl(self):
-+ if not self.has_openssl:
-+ if not self.has_src:
-+ self._download_openssl()
-+ else:
-+ log.debug("Already has src {}".format(self.src_file))
-+ self._unpack_openssl()
-+ self._build_openssl()
-+ self._install_openssl()
-+ else:
-+ log.info("Already has installation {}".format(self.install_dir))
-+ # validate installation
-+ version = self.openssl_version
-+ if self.version not in version:
-+ raise ValueError(version)
-+
-+ def touch_pymods(self):
-+ # force a rebuild of all modules that use OpenSSL APIs
-+ for fname in self.module_files:
-+ os.utime(fname)
-+
-+ def recompile_pymods(self):
-+ log.info("Using OpenSSL build from {}".format(self.build_dir))
-+ # overwrite header and library search paths
-+ env = os.environ.copy()
-+ env["CPPFLAGS"] = "-I{}".format(self.include_dir)
-+ env["LDFLAGS"] = "-L{}".format(self.lib_dir)
-+ # set rpath
-+ env["LD_RUN_PATH"] = self.lib_dir
-+
-+ log.info("Rebuilding Python modules")
-+ self.touch_pymods()
-+ cmd = ["./python", "setup.py", "build"]
-+ self._subprocess_call(cmd, env=env)
-+
-+ def check_pyssl(self):
-+ version = self.pyssl_version
-+ if self.version not in version:
-+ raise ValueError(version)
-+
-+ def run_pytests(self, *args):
-+ cmd = ["./python", "-m", "test"]
-+ cmd.extend(args)
-+ self._subprocess_call(cmd, stdout=None)
-+
-+ def run_python_tests(self, *args):
-+ self.recompile_pymods()
-+ self.check_pyssl()
-+ self.run_pytests(*args)
-+
-+
-+def main(*args):
-+ builders = []
-+ for version in OPENSSL_VERSIONS:
-+ if version in ("0.9.8i", "0.9.8l"):
-+ openssl_compile_args = ("no-asm",)
-+ else:
-+ openssl_compile_args = ()
-+ builder = BuildSSL(version, openssl_compile_args)
-+ builder.install_openssl()
-+ builders.append(builder)
-+
-+ for builder in builders:
-+ builder.run_python_tests(*args)
-+ # final touch
-+ builder.touch_pymods()
-+
-+
-+if __name__ == "__main__":
-+ logging.basicConfig(level=logging.INFO,
-+ format="*** %(levelname)s %(message)s")
-+ args = sys.argv[1:]
-+ if not args:
-+ args = ["-unetwork", "-v"]
-+ args.extend(FULL_TESTS)
-+ main(*args)
diff --git a/00197-unicode_fromformat.patch b/00197-unicode_fromformat.patch
deleted file mode 100644
index 95031d5..0000000
--- a/00197-unicode_fromformat.patch
+++ /dev/null
@@ -1,208 +0,0 @@
-diff -r 847a0e74c4cc Lib/test/test_unicode.py
---- a/Lib/test/test_unicode.py Sun Jul 20 21:26:04 2014 -0700
-+++ b/Lib/test/test_unicode.py Tue Jul 22 00:13:24 2014 +0200
-@@ -1659,6 +1659,122 @@ class UnicodeTest(
- self.assertEqual("%s" % u, u'__unicode__ overridden')
- self.assertEqual("{}".format(u), '__unicode__ overridden')
-
-+ # Test PyUnicode_FromFormat()
-+ def test_from_format(self):
-+ test_support.import_module('ctypes')
-+ from ctypes import (
-+ pythonapi, py_object, sizeof,
-+ c_int, c_long, c_longlong, c_ssize_t,
-+ c_uint, c_ulong, c_ulonglong, c_size_t, c_void_p)
-+ if sys.maxunicode == 0xffff:
-+ name = "PyUnicodeUCS2_FromFormat"
-+ else:
-+ name = "PyUnicodeUCS4_FromFormat"
-+ _PyUnicode_FromFormat = getattr(pythonapi, name)
-+ _PyUnicode_FromFormat.restype = py_object
-+
-+ def PyUnicode_FromFormat(format, *args):
-+ cargs = tuple(
-+ py_object(arg) if isinstance(arg, unicode) else arg
-+ for arg in args)
-+ return _PyUnicode_FromFormat(format, *cargs)
-+
-+ def check_format(expected, format, *args):
-+ text = PyUnicode_FromFormat(format, *args)
-+ self.assertEqual(expected, text)
-+
-+ # ascii format, non-ascii argument
-+ check_format(u'ascii\x7f=unicode\xe9',
-+ b'ascii\x7f=%U', u'unicode\xe9')
-+
-+ # non-ascii format, ascii argument: ensure that PyUnicode_FromFormatV()
-+ # raises an error
-+ #self.assertRaisesRegex(ValueError,
-+ # '^PyUnicode_FromFormatV\(\) expects an ASCII-encoded format '
-+ # 'string, got a non-ASCII byte: 0xe9$',
-+ # PyUnicode_FromFormat, b'unicode\xe9=%s', u'ascii')
-+
-+ # test "%c"
-+ check_format(u'\uabcd',
-+ b'%c', c_int(0xabcd))
-+ if sys.maxunicode > 0xffff:
-+ check_format(u'\U0010ffff',
-+ b'%c', c_int(0x10ffff))
-+ with self.assertRaises(OverflowError):
-+ PyUnicode_FromFormat(b'%c', c_int(0x110000))
-+ # Issue #18183
-+ if sys.maxunicode > 0xffff:
-+ check_format(u'\U00010000\U00100000',
-+ b'%c%c', c_int(0x10000), c_int(0x100000))
-+
-+ # test "%"
-+ check_format(u'%',
-+ b'%')
-+ check_format(u'%',
-+ b'%%')
-+ check_format(u'%s',
-+ b'%%s')
-+ check_format(u'[%]',
-+ b'[%%]')
-+ check_format(u'%abc',
-+ b'%%%s', b'abc')
-+
-+ # test %S
-+ check_format(u"repr=abc",
-+ b'repr=%S', u'abc')
-+
-+ # test %R
-+ check_format(u"repr=u'abc'",
-+ b'repr=%R', u'abc')
-+
-+ # test integer formats (%i, %d, %u)
-+ check_format(u'010',
-+ b'%03i', c_int(10))
-+ check_format(u'0010',
-+ b'%0.4i', c_int(10))
-+ check_format(u'-123',
-+ b'%i', c_int(-123))
-+ check_format(u'-123',
-+ b'%li', c_long(-123))
-+ check_format(u'-123',
-+ b'%zi', c_ssize_t(-123))
-+
-+ check_format(u'-123',
-+ b'%d', c_int(-123))
-+ check_format(u'-123',
-+ b'%ld', c_long(-123))
-+ check_format(u'-123',
-+ b'%zd', c_ssize_t(-123))
-+
-+ check_format(u'123',
-+ b'%u', c_uint(123))
-+ check_format(u'123',
-+ b'%lu', c_ulong(123))
-+ check_format(u'123',
-+ b'%zu', c_size_t(123))
-+
-+ # test long output
-+ PyUnicode_FromFormat(b'%p', c_void_p(-1))
-+
-+ # test %V
-+ check_format(u'repr=abc',
-+ b'repr=%V', u'abc', b'xyz')
-+ check_format(u'repr=\xe4\xba\xba\xe6\xb0\x91',
-+ b'repr=%V', None, b'\xe4\xba\xba\xe6\xb0\x91')
-+ check_format(u'repr=abc\xff',
-+ b'repr=%V', None, b'abc\xff')
-+
-+ # not supported: copy the raw format string. these tests are just here
-+ # to check for crashs and should not be considered as specifications
-+ check_format(u'%s',
-+ b'%1%s', b'abc')
-+ check_format(u'%1abc',
-+ b'%1abc')
-+ check_format(u'%+i',
-+ b'%+i', c_int(10))
-+ check_format(u'%s',
-+ b'%.%s', b'abc')
-+
- @test_support.cpython_only
- def test_encode_decimal(self):
- from _testcapi import unicode_encodedecimal
-diff -r 847a0e74c4cc Objects/unicodeobject.c
---- a/Objects/unicodeobject.c Sun Jul 20 21:26:04 2014 -0700
-+++ b/Objects/unicodeobject.c Tue Jul 22 00:13:24 2014 +0200
-@@ -690,7 +690,12 @@ makefmt(char *fmt, int longflag, int siz
- *fmt = '\0';
- }
-
--#define appendstring(string) {for (copy = string;*copy;) *s++ = *copy++;}
-+#define appendstring(string) \
-+ do { \
-+ for (copy = string;*copy; copy++) { \
-+ *s++ = (unsigned char)*copy; \
-+ } \
-+ } while (0)
-
- PyObject *
- PyUnicode_FromFormatV(const char *format, va_list vargs)
-@@ -845,7 +850,7 @@ PyUnicode_FromFormatV(const char *format
- str = PyObject_Str(obj);
- if (!str)
- goto fail;
-- n += PyUnicode_GET_SIZE(str);
-+ n += PyString_GET_SIZE(str);
- /* Remember the str and switch to the next slot */
- *callresult++ = str;
- break;
-@@ -925,12 +930,12 @@ PyUnicode_FromFormatV(const char *format
- }
- /* handle the long flag, but only for %ld and %lu.
- others can be added when necessary. */
-- if (*f == 'l' && (f[1] == 'd' || f[1] ==
'u')) {
-+ if (*f == 'l' && (f[1] == 'd' || f[1] == 'i'
|| f[1] == 'u')) {
- longflag = 1;
- ++f;
- }
- /* handle the size_t flag. */
-- if (*f == 'z' && (f[1] == 'd' || f[1] ==
'u')) {
-+ if (*f == 'z' && (f[1] == 'd' || f[1] == 'i'
|| f[1] == 'u')) {
- size_tflag = 1;
- ++f;
- }
-@@ -939,8 +944,9 @@ PyUnicode_FromFormatV(const char *format
- case 'c':
- *s++ = va_arg(vargs, int);
- break;
-+ case 'i':
- case 'd':
-- makefmt(fmt, longflag, size_tflag, zeropad, width, precision,
'd');
-+ makefmt(fmt, longflag, size_tflag, zeropad, width, precision, *f);
- if (longflag)
- sprintf(realbuffer, fmt, va_arg(vargs, long));
- else if (size_tflag)
-@@ -959,11 +965,6 @@ PyUnicode_FromFormatV(const char *format
- sprintf(realbuffer, fmt, va_arg(vargs, unsigned int));
- appendstring(realbuffer);
- break;
-- case 'i':
-- makefmt(fmt, 0, 0, zeropad, width, precision, 'i');
-- sprintf(realbuffer, fmt, va_arg(vargs, int));
-- appendstring(realbuffer);
-- break;
- case 'x':
- makefmt(fmt, 0, 0, zeropad, width, precision, 'x');
- sprintf(realbuffer, fmt, va_arg(vargs, int));
-@@ -1006,15 +1007,10 @@ PyUnicode_FromFormatV(const char *format
- case 'S':
- case 'R':
- {
-- Py_UNICODE *ucopy;
-- Py_ssize_t usize;
-- Py_ssize_t upos;
-+ const char *str = PyString_AS_STRING(*callresult);
- /* unused, since we already have the result */
- (void) va_arg(vargs, PyObject *);
-- ucopy = PyUnicode_AS_UNICODE(*callresult);
-- usize = PyUnicode_GET_SIZE(*callresult);
-- for (upos = 0; upos<usize;)
-- *s++ = ucopy[upos++];
-+ appendstring(str);
- /* We're done with the unicode()/repr() => forget it */
- Py_DECREF(*callresult);
- /* switch to next unicode()/repr() result */
diff --git a/00198-add-rewheel-module.patch b/00198-add-rewheel-module.patch
new file mode 100644
index 0000000..7da66a4
--- /dev/null
+++ b/00198-add-rewheel-module.patch
@@ -0,0 +1,230 @@
+diff -Nur Python-3.4.1/Lib/ensurepip/__init__.py
Python-3.4.1-rewheel/Lib/ensurepip/__init__.py
+--- Python-3.4.1/Lib/ensurepip/__init__.py 2014-08-21 10:49:30.792695824 +0200
++++ Python-3.4.1-rewheel/Lib/ensurepip/__init__.py 2014-08-21 10:10:41.958341726 +0200
+@@ -7,6 +7,7 @@ import pkgutil
+ import shutil
+ import sys
+ import tempfile
++from ensurepip import rewheel
+
+
+ __all__ = ["version", "bootstrap"]
+@@ -43,6 +44,8 @@
+
+ # Install the bundled software
+ import pip
++ if args[0] in ["install", "list", "wheel"]:
++ args.append('--pre')
+ pip.main(args)
+
+
+@@ -93,21 +96,40 @@ def bootstrap(root=None, upgrade=False,
+ # omit pip and easy_install
+ os.environ["ENSUREPIP_OPTIONS"] = "install"
+
++ whls = []
++ rewheel_dir = None
++ # try to see if we have system-wide versions of _PROJECTS
++ dep_records = rewheel.find_system_records([p[0] for p in _PROJECTS])
++ # TODO: check if system-wide versions are the newest ones
++ # if --upgrade is used?
++ if all(dep_records):
++ # if we have all _PROJECTS installed system-wide, we'll recreate
++ # wheels from them and install those
++ rewheel_dir = tempfile.TemporaryDirectory()
++ for dr in dep_records:
++ new_whl = rewheel.rewheel_from_record(dr, rewheel_dir.name)
++ whls.append(os.path.join(rewheel_dir.name, new_whl))
++ else:
++ # if we don't have all the _PROJECTS installed system-wide,
++ # let's just fall back to bundled wheels
++ for project, version in _PROJECTS:
++ whl = os.path.join(
++ os.path.dirname(__file__),
++ "_bundled",
++ "{}-{}-py2.py3-none-any.whl".format(project, version)
++ )
++ whls.append(whl)
++
+ tmpdir = tempfile.mkdtemp()
+ 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))
++ for whl in whls:
++ shutil.copy(whl, tmpdir)
++ additional_paths.append(os.path.join(tmpdir, os.path.basename(whl)))
++ if rewheel_dir:
++ rewheel_dir.cleanup()
+
+ # Construct the arguments to be passed to the pip command
+ args = ["install", "--no-index", "--find-links",
tmpdir]
+diff -Nur Python-3.4.1/Makefile.pre.in Python-3.4.1-rewheel/Makefile.pre.in
+--- Python-3.4.1/Makefile.pre.in 2014-08-21 10:49:31.512695040 +0200
++++ Python-3.4.1-rewheel/Makefile.pre.in 2014-08-21 10:10:41.961341722 +0200
+@@ -976,7 +976,7 @@ LIBSUBDIRS= lib-tk lib-tk/test lib-tk/te
+ test/tracedmodules \
+ encodings compiler hotshot \
+ email email/mime email/test email/test/data \
+- ensurepip ensurepip/_bundled \
++ ensurepip ensurepip/_bundled ensurepip/rewheel\
+ json json/tests \
+ sqlite3 sqlite3/test \
+ logging bsddb bsddb/test csv importlib wsgiref \
+diff -ru --new-file Python-2.7.9rc1-rewheel/Lib/ensurepip/rewheel/__init__.py
Python-2.7.9rc1/Lib/ensurepip/rewheel/__init__.py
+--- Python-2.7.9rc1-rewheel/Lib/ensurepip/rewheel/__init__.py 1970-01-01
01:00:00.000000000 +0100
++++ Python-2.7.9rc1/Lib/ensurepip/rewheel/__init__.py 2014-12-08 11:29:34.215237317
+0100
+@@ -0,0 +1,143 @@
++import argparse
++import codecs
++import csv
++import email.parser
++import os
++import io
++import re
++import site
++import subprocess
++import sys
++import zipfile
++
++def run():
++ parser = argparse.ArgumentParser(description='Recreate wheel of package with
given RECORD.')
++ parser.add_argument('record_path',
++ help='Path to RECORD file')
++ parser.add_argument('-o', '--output-dir',
++ help='Dir where to place the wheel, defaults to current
working dir.',
++ dest='outdir',
++ default=os.path.curdir)
++
++ ns = parser.parse_args()
++ retcode = 0
++ try:
++ print(rewheel_from_record(**vars(ns)))
++ except BaseException as e:
++ print('Failed: {}'.format(e))
++ retcode = 1
++ sys.exit(1)
++
++def find_system_records(projects):
++ """Return list of paths to RECORD files for system-installed
projects.
++
++ If a project is not installed, the resulting list contains None instead
++ of a path to its RECORD
++ """
++ records = []
++ # get system site-packages dirs
++ sys_sitepack = site.getsitepackages([sys.base_prefix, sys.base_exec_prefix])
++ sys_sitepack = [sp for sp in sys_sitepack if os.path.exists(sp)]
++ # try to find all projects in all system site-packages
++ for project in projects:
++ path = None
++ for sp in sys_sitepack:
++ dist_info_re = os.path.join(sp, project) +
'-[^\{0}]+\.dist-info'.format(os.sep)
++ candidates = [os.path.join(sp, p) for p in os.listdir(sp)]
++ # filter out candidate dirs based on the above regexp
++ filtered = [c for c in candidates if re.match(dist_info_re, c)]
++ # if we have 0 or 2 or more dirs, something is wrong...
++ if len(filtered) == 1:
++ path = filtered[0]
++ if path is not None:
++ records.append(os.path.join(path, 'RECORD'))
++ else:
++ records.append(None)
++ return records
++
++def rewheel_from_record(record_path, outdir):
++ """Recreates a whee of package with given record_path and returns
path
++ to the newly created wheel."""
++ site_dir = os.path.dirname(os.path.dirname(record_path))
++ record_relpath = record_path[len(site_dir):].strip(os.path.sep)
++ to_write, to_omit = get_records_to_pack(site_dir, record_relpath)
++ new_wheel_name = get_wheel_name(record_path)
++ new_wheel_path = os.path.join(outdir, new_wheel_name + '.whl')
++
++ new_wheel = zipfile.ZipFile(new_wheel_path, mode='w',
compression=zipfile.ZIP_DEFLATED)
++ # we need to write a new record with just the files that we will write,
++ # e.g. not binaries and *.pyc/*.pyo files
++ new_record = io.StringIO()
++ writer = csv.writer(new_record)
++
++ # handle files that we can write straight away
++ for f, sha_hash, size in to_write:
++ new_wheel.write(os.path.join(site_dir, f), arcname=f)
++ writer.writerow([f, sha_hash,size])
++
++ # rewrite the old wheel file with a new computed one
++ writer.writerow([record_relpath, '', ''])
++ new_wheel.writestr(record_relpath, new_record.getvalue())
++
++ new_wheel.close()
++
++ return new_wheel.filename
++
++def get_wheel_name(record_path):
++ """Return proper name of the wheel, without .whl."""
++
++ wheel_info_path = os.path.join(os.path.dirname(record_path), 'WHEEL')
++ with codecs.open(wheel_info_path, encoding='utf-8') as wheel_info_file:
++ wheel_info = email.parser.Parser().parsestr(wheel_info_file.read())
++
++ metadata_path = os.path.join(os.path.dirname(record_path), 'METADATA')
++ with codecs.open(metadata_path, encoding='utf-8') as metadata_file:
++ metadata = email.parser.Parser().parsestr(metadata_file.read())
++
++ # construct name parts according to wheel spec
++ distribution = metadata.get('Name')
++ version = metadata.get('Version')
++ build_tag = '' # nothing for now
++ lang_tag = []
++ for t in wheel_info.get_all('Tag'):
++ lang_tag.append(t.split('-')[0])
++ lang_tag = '.'.join(lang_tag)
++ abi_tag, plat_tag = wheel_info.get('Tag').split('-')[1:3]
++ # leave out build tag, if it is empty
++ to_join = filter(None, [distribution, version, build_tag, lang_tag, abi_tag,
plat_tag])
++ return '-'.join(list(to_join))
++
++def get_records_to_pack(site_dir, record_relpath):
++ """Accepts path of sitedir and path of RECORD file relative to it.
++ Returns two lists:
++ - list of files that can be written to new RECORD straight away
++ - list of files that shouldn't be written or need some processing
++ (pyc and pyo files, scripts)
++ """
++ record_file_path = os.path.join(site_dir, record_relpath)
++ with codecs.open(record_file_path, encoding='utf-8') as record_file:
++ record_contents = record_file.read()
++ # temporary fix for
https://github.com/pypa/pip/issues/1376
++ # we need to ignore files under ".data" directory
++ data_dir = os.path.dirname(record_relpath).strip(os.path.sep)
++ data_dir = data_dir[:-len('dist-info')] + 'data'
++
++ to_write = []
++ to_omit = []
++ for l in record_contents.splitlines():
++ spl = l.split(',')
++ if len(spl) == 3:
++ # new record will omit (or write differently):
++ # - abs paths, paths with ".." (entry points),
++ # - pyc+pyo files
++ # - the old RECORD file
++ # TODO: is there any better way to recognize an entry point?
++ if os.path.isabs(spl[0]) or spl[0].startswith('..') or \
++ spl[0].endswith('.pyc') or spl[0].endswith('.pyo') or \
++ spl[0] == record_relpath or spl[0].startswith(data_dir):
++ to_omit.append(spl)
++ else:
++ to_write.append(spl)
++ else:
++ pass # bad RECORD or empty line
++ return to_write, to_omit
diff --git a/python-2.7.3-debug-build.patch b/python-2.7.3-debug-build.patch
index ee0b2a2..c8e8fea 100644
--- a/python-2.7.3-debug-build.patch
+++ b/python-2.7.3-debug-build.patch
@@ -193,14 +193,14 @@ diff -up Python-2.7.6/Misc/python-config.in.debug-build
Python-2.7.6/Misc/python
--- Python-2.7.6/Misc/python-config.in.debug-build 2013-11-10 08:36:41.000000000 +0100
+++ Python-2.7.6/Misc/python-config.in 2014-01-29 14:13:08.816888470 +0100
@@ -45,7 +45,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':
diff -up Python-2.7.6/Modules/makesetup.debug-build Python-2.7.6/Modules/makesetup
--- Python-2.7.6/Modules/makesetup.debug-build 2013-11-10 08:36:41.000000000 +0100
+++ Python-2.7.6/Modules/makesetup 2014-01-29 14:13:08.817888407 +0100
diff --git a/python.spec b/python.spec
index 8e3a6c4..2e34041 100644
--- a/python.spec
+++ b/python.spec
@@ -2,6 +2,8 @@
# Conditionals and other variables controlling the build
# ======================================================
+%global with_rewheel 1
+
%{!?__python_ver:%global __python_ver EMPTY}
#global __python_ver 27
%global unicode ucs4
@@ -105,8 +107,8 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
# Remember to also rebase python-docs when changing this:
-Version: 2.7.8
-Release: 10%{?dist}
+Version: 2.7.9
+Release: 1%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -164,6 +166,11 @@ BuildRequires: valgrind-devel
BuildRequires: zlib-devel
+%if 0%{?with_rewheel}
+BuildRequires: python-setuptools
+BuildRequires: python-pip
+%endif
+
# =======================
@@ -888,11 +895,17 @@ Patch193: 00193-enable-loading-sqlite-extensions.patch
#
http://bugs.python.org/issue21308
# Backport of ssl module from python3
-Patch196: 00196-ssl-backport.patch
+# FIXED UPSTREAM
+# Patch196: 00196-ssl-backport.patch
#
http://bugs.python.org/issue22023
# Patch seg fault in unicodeobject.c
-Patch197: 00197-unicode_fromformat.patch
+# FIXED UPSTREAM
+# Patch197: 00197-unicode_fromformat.patch
+
+%if 0%{with_rewheel}
+Patch198: 00198-add-rewheel-module.patch
+%endif
# (New patches go here ^^^)
#
@@ -1251,8 +1264,11 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch193 -p1
# 00194: upstream as of Python 2.7.7
#%patch195 -p1
-%patch196 -p1
-%patch197 -p1
+# 00196: upstream as of Python 2.7.9
+# 00197: upstream as of Python 2.7.9
+%if 0%{with_rewheel}
+%patch198 -p1
+%endif
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -1893,6 +1909,16 @@ rm -fr %{buildroot}
%doc systemtap-example.stp pyfuntop.stp
%endif
+%dir %{pylibdir}/ensurepip/
+%{pylibdir}/ensurepip/*.py*
+%exclude %{pylibdir}/ensurepip/_bundled
+
+%if 0%{?with_rewheel}
+%dir %{pylibdir}/ensurepip/rewheel/
+%{pylibdir}/ensurepip/rewheel/*.py*
+%endif
+
+
%files devel
%defattr(-,root,root,-)
%{_libdir}/pkgconfig/python-%{pybasever}.pc
@@ -2091,6 +2117,12 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu Dec 11 2014 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.9-1
+- Update to 2.7.9
+- Refreshed patches: #55, #137, #146, #153, #156, #198
+- Dropped patches: #196, #197
+- Added the rewheel module
+
* Mon Nov 24 2014 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.8-10
- Improve python2_version macros
diff --git a/sources b/sources
index 9163c53..a7b1f8e 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-d235bdfa75b8396942e360a70487ee00 Python-2.7.8.tar.xz
+38d530f7efc373d64a8fb1637e3baaa7 Python-2.7.9.tar.xz
commit 3c4117634397669c14e9e6e98fa4324b961790fa
Author: Matej Stuchlik <mstuchli(a)redhat.com>
Date: Mon Nov 24 09:35:13 2014 +0100
Bump spec
diff --git a/python.spec b/python.spec
index 97ebfb8..8e3a6c4 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.8
-Release: 9%{?dist}
+Release: 10%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -2091,6 +2091,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Mon Nov 24 2014 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.8-10
+- Improve python2_version macros
+
* Thu Nov 13 2014 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.8-9
- Add python2_version_nodots macro
commit 7fad94a5912885047df5440c58c4f5ddd9d587cb
Author: Matej Stuchlik <mstuchli(a)redhat.com>
Date: Thu Nov 20 12:22:08 2014 +0100
Improve python2_version macros
diff --git a/macros.python2 b/macros.python2
index d090296..352f241 100644
--- a/macros.python2
+++ b/macros.python2
@@ -1,5 +1,5 @@
%__python2 /usr/bin/python2
%python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib;
print(get_python_lib())")
%python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib;
print(get_python_lib(1))")
-%python2_version %(%{__python2} -c "import sys;
sys.stdout.write(sys.version[:3])")
-%python2_version_nodots %(%{__python2} -c "import sys;
sys.stdout.write(sys.version[:3].replace('.',''))")
+%python2_version %(%{__python2} -c "import sys;
sys.stdout.write('{0.major}.{0.minor}'.format(sys.version_info))")
+%python2_version_nodots %(%{__python2} -c "import sys;
sys.stdout.write('{0.major}{0.minor}'.format(sys.version_info))")
commit 6875a63831616c6c8e722632e24faaa1a09cc831
Author: Matej Stuchlik <mstuchli(a)redhat.com>
Date: Thu Nov 13 15:04:28 2014 +0100
Add python2_version_nodots macro
diff --git a/macros.python2 b/macros.python2
index 982b51f..d090296 100644
--- a/macros.python2
+++ b/macros.python2
@@ -2,3 +2,4 @@
%python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib;
print(get_python_lib())")
%python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib;
print(get_python_lib(1))")
%python2_version %(%{__python2} -c "import sys;
sys.stdout.write(sys.version[:3])")
+%python2_version_nodots %(%{__python2} -c "import sys;
sys.stdout.write(sys.version[:3].replace('.',''))")
diff --git a/python.spec b/python.spec
index 0fed02a..97ebfb8 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.8
-Release: 8%{?dist}
+Release: 9%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -2091,6 +2091,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu Nov 13 2014 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.8-9
+- Add python2_version_nodots macro
+
* Mon Nov 10 2014 Slavek Kabrda <bkabrda(a)redhat.com> - 2.7.8-8
- Revert previous change, see rhbz#1161166#c6.
commit 8cc233cbbfc789e1fbe69b85352105c0bae06a06
Author: Slavek Kabrda <bkabrda(a)redhat.com>
Date: Mon Nov 10 09:08:21 2014 +0100
Revert previous change, see rhbz#1161166#c6.
diff --git a/python.spec b/python.spec
index 5820f67..0fed02a 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.8
-Release: 7%{?dist}
+Release: 8%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1567,9 +1567,6 @@ rm -f %{buildroot}%{pylibdir}/email/test/data/audiotest.au
%{buildroot}%{pylibdi
install -d %{buildroot}/usr/lib/python%{pybasever}/site-packages
%endif
-# Fix for bug #1161166 - provide importable unittest2
-ln -s %{pylibdir}/unittest %{buildroot}%{pylibdir}/unittest2
-
# Make python-devel multilib-ready (bug #192747, #139911)
%global _pyconfig32_h pyconfig-32.h
%global _pyconfig64_h pyconfig-64.h
@@ -1875,7 +1872,6 @@ rm -fr %{buildroot}
%{pylibdir}/test/test_support.py*
%{pylibdir}/test/__init__.py*
%{pylibdir}/unittest
-%{pylibdir}/unittest2
%{pylibdir}/wsgiref
%{pylibdir}/xml
%if "%{_lib}" == "lib64"
@@ -2095,6 +2091,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Mon Nov 10 2014 Slavek Kabrda <bkabrda(a)redhat.com> - 2.7.8-8
+- Revert previous change, see rhbz#1161166#c6.
+
* Fri Nov 07 2014 Slavek Kabrda <bkabrda(a)redhat.com> - 2.7.8-7
- Provide importable unittest2
Resolves: rhbz#1161166
commit e3d0c5000d848c5a41d1c3991f1ae07a28cd326a
Author: Slavek Kabrda <bkabrda(a)redhat.com>
Date: Fri Nov 7 10:07:32 2014 +0100
Don't disable the test suite
diff --git a/python.spec b/python.spec
index 412e781..5820f67 100644
--- a/python.spec
+++ b/python.spec
@@ -54,7 +54,7 @@
%global with_gdbm 1
# Turn this to 0 to turn off the "check" phase:
-%global run_selftest_suite 0
+%global run_selftest_suite 1
# Some of the files below /usr/lib/pythonMAJOR.MINOR/test (e.g. bad_coding.py)
# are deliberately invalid, leading to SyntaxError exceptions if they get
commit 5322c8ded111a645513a4f4f689e385d3ac787cd
Author: Slavek Kabrda <bkabrda(a)redhat.com>
Date: Fri Nov 7 09:55:37 2014 +0100
Provide importable unittest2
Resolves: rhbz#1161166
diff --git a/python.spec b/python.spec
index 339b68f..412e781 100644
--- a/python.spec
+++ b/python.spec
@@ -54,7 +54,7 @@
%global with_gdbm 1
# Turn this to 0 to turn off the "check" phase:
-%global run_selftest_suite 1
+%global run_selftest_suite 0
# Some of the files below /usr/lib/pythonMAJOR.MINOR/test (e.g. bad_coding.py)
# are deliberately invalid, leading to SyntaxError exceptions if they get
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.8
-Release: 6%{?dist}
+Release: 7%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1567,6 +1567,9 @@ rm -f %{buildroot}%{pylibdir}/email/test/data/audiotest.au
%{buildroot}%{pylibdi
install -d %{buildroot}/usr/lib/python%{pybasever}/site-packages
%endif
+# Fix for bug #1161166 - provide importable unittest2
+ln -s %{pylibdir}/unittest %{buildroot}%{pylibdir}/unittest2
+
# Make python-devel multilib-ready (bug #192747, #139911)
%global _pyconfig32_h pyconfig-32.h
%global _pyconfig64_h pyconfig-64.h
@@ -1872,6 +1875,7 @@ rm -fr %{buildroot}
%{pylibdir}/test/test_support.py*
%{pylibdir}/test/__init__.py*
%{pylibdir}/unittest
+%{pylibdir}/unittest2
%{pylibdir}/wsgiref
%{pylibdir}/xml
%if "%{_lib}" == "lib64"
@@ -2091,6 +2095,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Fri Nov 07 2014 Slavek Kabrda <bkabrda(a)redhat.com> - 2.7.8-7
+- Provide importable unittest2
+Resolves: rhbz#1161166
+
* Thu Aug 21 2014 Robert Kuska <rkuska(a)redhat.com> - 2.7.8-6
- Update patch 196 (ssl backport)
commit cc9f6c4bfb5e7192cae2b82e811813a930ba3dea
Author: Robert Kuska <rkuska(a)redhat.com>
Date: Thu Aug 21 08:59:02 2014 +0200
Bump changelog and release number
diff --git a/python.spec b/python.spec
index 448f55c..339b68f 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.8
-Release: 5%{?dist}
+Release: 6%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -2091,6 +2091,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu Aug 21 2014 Robert Kuska <rkuska(a)redhat.com> - 2.7.8-6
+- Update patch 196 (ssl backport)
+
* Tue Aug 19 2014 Robert Kuska <rkuska(a)redhat.com> - 2.7.8-5
- Backport ssl module from python3
commit 732b17459e5952706b1a90cd53fe93af9c82fc0b
Author: Robert Kuska <rkuska(a)redhat.com>
Date: Thu Aug 21 08:54:30 2014 +0200
Update patch 196 ssl backport
diff --git a/00196-ssl-backport.patch b/00196-ssl-backport.patch
index a14d626..79cd81d 100644
--- a/00196-ssl-backport.patch
+++ b/00196-ssl-backport.patch
@@ -3785,7 +3785,7 @@ index 0000000..a312e28
+ print("Listening on
https://localhost:{0.port}".format(args))
+ server.serve_forever(0.1)
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
-index 91b8029..54dbbd5 100644
+index 91b8029..a629e1b 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -1,35 +1,78 @@
@@ -4029,7 +4029,7 @@ index 91b8029..54dbbd5 100644
san = (('DNS', 'altnull.python.org\x00example.com'),
('email', 'null@python.org\x00user(a)example.org'),
('URI',
'http://null.python.org\x00http://example.org'),
-@@ -192,24 +279,7 @@ class BasicSocketTests(unittest.TestCase):
+@@ -196,24 +283,7 @@ class BasicSocketTests(unittest.TestCase):
self.assertTrue(s.startswith("OpenSSL {:d}.{:d}.{:d}".format(major,
minor, fix)),
(s, t))
@@ -5326,7 +5326,7 @@ index 91b8029..54dbbd5 100644
class ThreadedEchoServer(threading.Thread):
class ConnectionHandler(threading.Thread):
-@@ -457,48 +1529,45 @@ else:
+@@ -457,48 +1529,51 @@ else:
with and without the SSL wrapper around the socket connection, so
that we can test the STARTTLS functionality."""
@@ -5361,13 +5361,20 @@ index 91b8029..54dbbd5 100644
- ca_certs=self.server.cacerts,
- cert_reqs=self.server.certreqs,
- ciphers=self.server.ciphers)
+- except ssl.SSLError as e:
+ self.sslconn = self.server.context.wrap_socket(
+ self.sock, server_side=True)
+
self.server.selected_protocols.append(self.sslconn.selected_npn_protocol())
- except ssl.SSLError as e:
++ except socket.error as e:
++ # We treat ConnectionResetError as though it were an
++ # SSLError - OpenSSL on Ubuntu abruptly closes the
++ # connection when asked to use an unsupported protocol.
++ #
# XXX Various errors can have happened here, for example
# a mismatching protocol version, an invalid certificate,
# or a low-level bug. This should be made more discriminating.
++ if not isinstance(e, ssl.SSLError) and e.errno != errno.ECONNRESET:
++ raise
self.server.conn_errors.append(e)
if self.server.chatty:
- handle_error("\n server: bad connection attempt from
" +
@@ -5394,7 +5401,7 @@ index 91b8029..54dbbd5 100644
return True
def read(self):
-@@ -517,48 +1586,53 @@ else:
+@@ -517,48 +1592,53 @@ else:
if self.sslconn:
self.sslconn.close()
else:
@@ -5467,7 +5474,7 @@ index 91b8029..54dbbd5 100644
self.write(msg.lower())
except ssl.SSLError:
if self.server.chatty:
-@@ -569,36 +1643,34 @@ else:
+@@ -569,36 +1649,34 @@ else:
# harness, we want to stop the server
self.server.stop()
@@ -5524,7 +5531,7 @@ index 91b8029..54dbbd5 100644
self.conn_errors = []
threading.Thread.__init__(self)
self.daemon = True
-@@ -626,10 +1698,10 @@ else:
+@@ -626,10 +1704,10 @@ else:
while self.active:
try:
newconn, connaddr = self.sock.accept()
@@ -5538,7 +5545,7 @@ index 91b8029..54dbbd5 100644
handler.start()
handler.join()
except socket.timeout:
-@@ -648,11 +1720,12 @@ else:
+@@ -648,11 +1726,12 @@ else:
class ConnectionHandler(asyncore.dispatcher_with_send):
def __init__(self, conn, certfile):
@@ -5552,7 +5559,7 @@ index 91b8029..54dbbd5 100644
def readable(self):
if isinstance(self.socket, ssl.SSLSocket):
-@@ -663,12 +1736,11 @@ else:
+@@ -663,12 +1742,11 @@ else:
def _do_ssl_handshake(self):
try:
self.socket.do_handshake()
@@ -5570,7 +5577,7 @@ index 91b8029..54dbbd5 100644
raise
except socket.error, err:
if err.args[0] == errno.ECONNABORTED:
-@@ -681,12 +1753,16 @@ else:
+@@ -681,12 +1759,16 @@ else:
self._do_ssl_handshake()
else:
data = self.recv(1024)
@@ -5589,7 +5596,7 @@ index 91b8029..54dbbd5 100644
sys.stdout.write(" server: closed connection %s\n" %
self.socket)
def handle_error(self):
-@@ -694,14 +1770,14 @@ else:
+@@ -694,14 +1776,14 @@ else:
def __init__(self, certfile):
self.certfile = certfile
@@ -5608,7 +5615,7 @@ index 91b8029..54dbbd5 100644
sys.stdout.write(" server: new connection from %s:%s\n"
%addr)
self.ConnectionHandler(sock_obj, self.certfile)
-@@ -725,13 +1801,13 @@ else:
+@@ -725,13 +1807,13 @@ else:
return self
def __exit__(self, *args):
@@ -5625,7 +5632,7 @@ index 91b8029..54dbbd5 100644
sys.stdout.write(" cleanup: successfully joined.\n")
def start(self, flag=None):
-@@ -743,103 +1819,15 @@ else:
+@@ -743,103 +1825,15 @@ else:
if self.flag:
self.flag.set()
while self.active:
@@ -5733,7 +5740,7 @@ index 91b8029..54dbbd5 100644
def bad_cert_test(certfile):
"""
Launch a server with CERT_REQUIRED, and check that trying to
-@@ -847,74 +1835,74 @@ else:
+@@ -847,74 +1841,74 @@ else:
"""
server = ThreadedEchoServer(CERTFILE,
certreqs=ssl.CERT_REQUIRED,
@@ -5863,7 +5870,7 @@ index 91b8029..54dbbd5 100644
if certsreqs is None:
certsreqs = ssl.CERT_NONE
certtype = {
-@@ -922,19 +1910,30 @@ else:
+@@ -922,19 +1916,30 @@ else:
ssl.CERT_OPTIONAL: "CERT_OPTIONAL",
ssl.CERT_REQUIRED: "CERT_REQUIRED",
}[certsreqs]
@@ -5901,7 +5908,7 @@ index 91b8029..54dbbd5 100644
# Protocol mismatch can result in either an SSLError, or a
# "Connection reset by peer" error.
except ssl.SSLError:
-@@ -953,75 +1952,38 @@ else:
+@@ -953,75 +1958,38 @@ else:
class ThreadedTests(unittest.TestCase):
@@ -5997,7 +6004,7 @@ index 91b8029..54dbbd5 100644
sys.stdout.write(pprint.pformat(cert) + '\n')
sys.stdout.write("Connection cipher is " + str(cipher) +
'.\n')
if 'subject' not in cert:
-@@ -1032,8 +1994,94 @@ else:
+@@ -1032,8 +2000,94 @@ else:
self.fail(
"Missing or invalid 'organizationName' field in
certificate subject; "
"should be 'Python Software Foundation'.")
@@ -6092,7 +6099,7 @@ index 91b8029..54dbbd5 100644
def test_empty_cert(self):
"""Connecting with an empty cert file"""
bad_cert_test(os.path.join(os.path.dirname(__file__) or os.curdir,
-@@ -1051,25 +2099,84 @@ else:
+@@ -1051,25 +2105,84 @@ else:
bad_cert_test(os.path.join(os.path.dirname(__file__) or os.curdir,
"badkey.pem"))
@@ -6181,7 +6188,7 @@ index 91b8029..54dbbd5 100644
try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3, True)
try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv23, True)
try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1, True)
-@@ -1082,22 +2189,38 @@ else:
+@@ -1082,22 +2195,38 @@ else:
try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv23, True,
ssl.CERT_REQUIRED)
try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1, True,
ssl.CERT_REQUIRED)
@@ -6222,7 +6229,7 @@ index 91b8029..54dbbd5 100644
sys.stdout.write("\n")
try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_TLSv1, True)
try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_TLSv1, True,
ssl.CERT_OPTIONAL)
-@@ -1105,10 +2228,55 @@ else:
+@@ -1105,10 +2234,55 @@ else:
if hasattr(ssl, 'PROTOCOL_SSLv2'):
try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_SSLv2, False)
try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_SSLv3, False)
@@ -6279,7 +6286,7 @@ index 91b8029..54dbbd5 100644
server = ThreadedEchoServer(CERTFILE,
ssl_version=ssl.PROTOCOL_TLSv1,
-@@ -1120,119 +2288,109 @@ else:
+@@ -1120,119 +2294,109 @@ else:
s = socket.socket()
s.setblocking(1)
s.connect((HOST, server.port))
@@ -6448,7 +6455,7 @@ index 91b8029..54dbbd5 100644
sys.stdout.write("\n")
server = ThreadedEchoServer(CERTFILE,
-@@ -1251,12 +2409,12 @@ else:
+@@ -1251,12 +2415,12 @@ else:
s.connect((HOST, server.port))
# helper methods for standardising recv* method signatures
def _recv_into():
@@ -6463,7 +6470,7 @@ index 91b8029..54dbbd5 100644
count, addr = s.recvfrom_into(b)
return b[:count]
-@@ -1275,73 +2433,73 @@ else:
+@@ -1275,73 +2439,73 @@ else:
data_prefix = u"PREFIX_"
for meth_name, send_meth, expect_success, args in send_methods:
@@ -6565,7 +6572,7 @@ index 91b8029..54dbbd5 100644
started = threading.Event()
finish = False
-@@ -1355,6 +2513,8 @@ else:
+@@ -1355,6 +2519,8 @@ else:
# Let the socket hang around rather than having
# it closed by garbage collection.
conns.append(server.accept()[0])
@@ -6574,7 +6581,7 @@ index 91b8029..54dbbd5 100644
t = threading.Thread(target=serve)
t.start()
-@@ -1372,8 +2532,8 @@ else:
+@@ -1372,8 +2538,8 @@ else:
c.close()
try:
c = socket.socket(socket.AF_INET)
@@ -6584,7 +6591,7 @@ index 91b8029..54dbbd5 100644
# Will attempt handshake and time out
self.assertRaisesRegexp(ssl.SSLError, "timed out",
c.connect, (host, port))
-@@ -1384,59 +2544,384 @@ else:
+@@ -1384,59 +2550,384 @@ else:
t.join()
server.close()
@@ -7058,7 +7065,7 @@ index bcd83bf..80a0926 100644
test/subprocessdata \
test/tracedmodules \
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
-index 752b033..493eeea 100644
+index 752b033..8f4062b 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -14,22 +14,28 @@
@@ -8827,7 +8834,7 @@ index 752b033..493eeea 100644
static PyMethodDef PySSLMethods[] = {
{"do_handshake", (PyCFunction)PySSL_SSLdo_handshake, METH_NOARGS},
{"write", (PyCFunction)PySSL_SSLwrite, METH_VARARGS,
-@@ -1532,66 +1904,1345 @@ static PyMethodDef PySSLMethods[] = {
+@@ -1532,66 +1904,1343 @@ static PyMethodDef PySSLMethods[] = {
PySSL_SSLread_doc},
{"pending", (PyCFunction)PySSL_SSLpending, METH_NOARGS,
PySSL_SSLpending_doc},
@@ -9439,8 +9446,6 @@ index 752b033..493eeea 100644
+ keyfile_bytes ? keyfile_bytes : certfile_bytes,
+ SSL_FILETYPE_PEM);
+ PySSL_END_ALLOW_THREADS_S(pw_info.thread_state);
-+ Py_CLEAR(keyfile_bytes);
-+ Py_CLEAR(certfile_bytes);
+ if (r != 1) {
+ if (pw_info.error) {
+ ERR_clear_error();
@@ -9471,8 +9476,8 @@ index 752b033..493eeea 100644
+ SSL_CTX_set_default_passwd_cb(self->ctx, orig_passwd_cb);
+ SSL_CTX_set_default_passwd_cb_userdata(self->ctx, orig_passwd_userdata);
+ PyMem_Free(pw_info.password);
-+ Py_XDECREF(keyfile_bytes);
-+ Py_XDECREF(certfile_bytes);
++ PyMem_Free(keyfile_bytes);
++ PyMem_Free(certfile_bytes);
+ return NULL;
+}
+
@@ -10206,7 +10211,7 @@ index 752b033..493eeea 100644
}
PyDoc_STRVAR(PySSL_RAND_status_doc,
-@@ -1630,21 +3281,413 @@ fails or if it does not provide enough data to seed
PRNG.");
+@@ -1630,21 +3279,413 @@ fails or if it does not provide enough data to seed
PRNG.");
#endif /* HAVE_OPENSSL_RAND */
@@ -10623,7 +10628,7 @@ index 752b033..493eeea 100644
{NULL, NULL} /* Sentinel */
};
-@@ -1672,16 +3715,17 @@ _ssl_thread_id_function (void) {
+@@ -1672,16 +3713,17 @@ _ssl_thread_id_function (void) {
}
#endif
@@ -10648,7 +10653,7 @@ index 752b033..493eeea 100644
file and line are the file number of the function setting the
lock. They can be useful for debugging.
-@@ -1705,10 +3749,11 @@ static int _setup_ssl_threads(void) {
+@@ -1705,10 +3747,11 @@ static int _setup_ssl_threads(void) {
if (_ssl_locks == NULL) {
_ssl_locks_count = CRYPTO_num_locks();
_ssl_locks = (PyThread_type_lock *)
@@ -10662,7 +10667,7 @@ index 752b033..493eeea 100644
for (i = 0; i < _ssl_locks_count; i++) {
_ssl_locks[i] = PyThread_allocate_lock();
if (_ssl_locks[i] == NULL) {
-@@ -1716,7 +3761,7 @@ static int _setup_ssl_threads(void) {
+@@ -1716,7 +3759,7 @@ static int _setup_ssl_threads(void) {
for (j = 0; j < i; j++) {
PyThread_free_lock(_ssl_locks[j]);
}
@@ -10671,7 +10676,7 @@ index 752b033..493eeea 100644
return 0;
}
}
-@@ -1736,14 +3781,39 @@ PyDoc_STRVAR(module_doc,
+@@ -1736,14 +3779,39 @@ PyDoc_STRVAR(module_doc,
"Implementation module for SSL socket operations. See the socket module\n\
for documentation.");
@@ -10712,7 +10717,7 @@ index 752b033..493eeea 100644
m = Py_InitModule3("_ssl", PySSL_methods, module_doc);
if (m == NULL)
-@@ -1766,15 +3836,53 @@ init_ssl(void)
+@@ -1766,15 +3834,53 @@ init_ssl(void)
OpenSSL_add_all_algorithms();
/* Add symbols to module dict */
@@ -10772,7 +10777,7 @@ index 752b033..493eeea 100644
return;
PyModule_AddIntConstant(m, "SSL_ERROR_ZERO_RETURN",
PY_SSL_ERROR_ZERO_RETURN);
-@@ -1802,6 +3910,66 @@ init_ssl(void)
+@@ -1802,6 +3908,66 @@ init_ssl(void)
PY_SSL_CERT_OPTIONAL);
PyModule_AddIntConstant(m, "CERT_REQUIRED",
PY_SSL_CERT_REQUIRED);
@@ -10839,7 +10844,7 @@ index 752b033..493eeea 100644
/* protocol versions */
#ifndef OPENSSL_NO_SSL2
-@@ -1814,6 +3982,109 @@ init_ssl(void)
+@@ -1814,6 +3980,109 @@ init_ssl(void)
PY_SSL_VERSION_SSL23);
PyModule_AddIntConstant(m, "PROTOCOL_TLSv1",
PY_SSL_VERSION_TLS1);
@@ -10949,7 +10954,7 @@ index 752b033..493eeea 100644
/* OpenSSL version */
/* SSLeay() gives us the version of the library linked against,
-@@ -1825,15 +4096,7 @@ init_ssl(void)
+@@ -1825,15 +4094,7 @@ init_ssl(void)
return;
if (PyModule_AddObject(m, "OPENSSL_VERSION_NUMBER", r))
return;
@@ -10966,7 +10971,7 @@ index 752b033..493eeea 100644
r = Py_BuildValue("IIIII", major, minor, fix, patch, status);
if (r == NULL || PyModule_AddObject(m, "OPENSSL_VERSION_INFO", r))
return;
-@@ -1841,4 +4104,9 @@ init_ssl(void)
+@@ -1841,4 +4102,9 @@ init_ssl(void)
if (r == NULL || PyModule_AddObject(m, "OPENSSL_VERSION", r))
return;
@@ -12635,3 +12640,324 @@ index 0000000..81a8d7b
+ #endif
+ { NULL }
+};
+diff --git a/Tools/ssl/make_ssl_data.py b/Tools/ssl/make_ssl_data.py
+new file mode 100755
+index 0000000..10244d1
+--- /dev/null
++++ b/Tools/ssl/make_ssl_data.py
+@@ -0,0 +1,68 @@
++#! /usr/bin/env python3
++
++"""
++This script should be called *manually* when we want to upgrade SSLError
++`library` and `reason` mnemnonics to a more recent OpenSSL version.
++
++It takes two arguments:
++- the path to the OpenSSL include files' directory
++ (e.g. openssl-1.0.1-beta3/include/openssl/)
++- the path to the C file to be generated
++ (probably Modules/_ssl_data.h)
++"""
++
++import datetime
++import os
++import re
++import sys
++
++
++def parse_error_codes(h_file, prefix):
++ pat = re.compile(r"#define\W+(%s([\w]+))\W+(\d+)\b" % re.escape(prefix))
++ codes = []
++ with open(h_file, "r", encoding="latin1") as f:
++ for line in f:
++ match = pat.search(line)
++ if match:
++ code, name, num = match.groups()
++ num = int(num)
++ codes.append((code, name, num))
++ return codes
++
++if __name__ == "__main__":
++ openssl_inc = sys.argv[1]
++ outfile = sys.argv[2]
++ use_stdout = outfile == '-'
++ f = sys.stdout if use_stdout else open(outfile, "w")
++ error_libraries = (
++ # (library code, mnemonic, error prefix, header file)
++ ('ERR_LIB_PEM', 'PEM', 'PEM_R_', 'pem.h'),
++ ('ERR_LIB_SSL', 'SSL', 'SSL_R_', 'ssl.h'),
++ ('ERR_LIB_X509', 'X509', 'X509_R_', 'x509.h'),
++ )
++ def w(l):
++ f.write(l + "\n")
++ w("/* File generated by Tools/ssl/make_ssl_data.py */")
++ w("/* Generated on %s */" % datetime.datetime.now().isoformat())
++ w("")
++
++ w("static struct py_ssl_library_code library_codes[] = {")
++ for libcode, mnemo, _, _ in error_libraries:
++ w(' {"%s", %s},' % (mnemo, libcode))
++ w(' { NULL }')
++ w('};')
++ w("")
++
++ w("static struct py_ssl_error_code error_codes[] = {")
++ for libcode, _, prefix, h_file in error_libraries:
++ codes = parse_error_codes(os.path.join(openssl_inc, h_file), prefix)
++ for code, name, num in sorted(codes):
++ w(' #ifdef %s' % (code))
++ w(' {"%s", %s, %s},' % (name, libcode, code))
++ w(' #else')
++ w(' {"%s", %s, %d},' % (name, libcode, num))
++ w(' #endif')
++ w(' { NULL }')
++ w('};')
++ if not use_stdout:
++ f.close()
+diff --git a/Tools/ssl/test_multiple_versions.py b/Tools/ssl/test_multiple_versions.py
+new file mode 100644
+index 0000000..fc7a967
+--- /dev/null
++++ b/Tools/ssl/test_multiple_versions.py
+@@ -0,0 +1,241 @@
++#./python
++"""Run Python tests with multiple installations of OpenSSL
++
++The script
++
++ (1) downloads OpenSSL tar bundle
++ (2) extracts it to ../openssl/src/openssl-VERSION/
++ (3) compiles OpenSSL
++ (4) installs OpenSSL into ../openssl/VERSION/
++ (5) forces a recompilation of Python modules using the
++ header and library files from ../openssl/VERSION/
++ (6) runs Python's test suite
++
++The script must be run with Python's build directory as current working
++directory:
++
++ ./python Tools/ssl/test_multiple_versions.py
++
++The script uses LD_RUN_PATH, LD_LIBRARY_PATH, CPPFLAGS and LDFLAGS to bend
++search paths for header files and shared libraries. It's known to work on
++Linux with GCC 4.x.
++
++(c) 2013 Christian Heimes <christian(a)python.org>
++"""
++import logging
++import os
++import tarfile
++import shutil
++import subprocess
++import sys
++from urllib import urlopen
++
++log = logging.getLogger("multissl")
++
++OPENSSL_VERSIONS = [
++ "0.9.7m", "0.9.8i", "0.9.8l", "0.9.8m",
"0.9.8y", "1.0.0k", "1.0.1e"
++]
++FULL_TESTS = [
++ "test_asyncio", "test_ftplib", "test_hashlib",
"test_httplib",
++ "test_imaplib", "test_nntplib", "test_poplib",
"test_smtplib",
++ "test_smtpnet", "test_urllib2_localnet", "test_venv"
++]
++MINIMAL_TESTS = ["test_ssl", "test_hashlib"]
++CADEFAULT = True
++HERE = os.path.abspath(os.getcwd())
++DEST_DIR = os.path.abspath(os.path.join(HERE, os.pardir, "openssl"))
++
++
++class BuildSSL(object):
++ url_template = "https://www.openssl.org/source/openssl-{}.tar.gz"
++
++ module_files = ["Modules/_ssl.c",
++ "Modules/socketmodule.c",
++ "Modules/_hashopenssl.c"]
++
++ def __init__(self, version, openssl_compile_args=(), destdir=DEST_DIR):
++ self._check_python_builddir()
++ self.version = version
++ self.openssl_compile_args = openssl_compile_args
++ # installation directory
++ self.install_dir = os.path.join(destdir, version)
++ # source file
++ self.src_file = os.path.join(destdir, "src",
++ "openssl-{}.tar.gz".format(version))
++ # build directory (removed after install)
++ self.build_dir = os.path.join(destdir, "src",
++ "openssl-{}".format(version))
++
++ @property
++ def openssl_cli(self):
++ """openssl CLI binary"""
++ return os.path.join(self.install_dir, "bin", "openssl")
++
++ @property
++ def openssl_version(self):
++ """output of 'bin/openssl version'"""
++ env = os.environ.copy()
++ env["LD_LIBRARY_PATH"] = self.lib_dir
++ cmd = [self.openssl_cli, "version"]
++ return self._subprocess_output(cmd, env=env)
++
++ @property
++ def pyssl_version(self):
++ """Value of ssl.OPENSSL_VERSION"""
++ env = os.environ.copy()
++ env["LD_LIBRARY_PATH"] = self.lib_dir
++ cmd = ["./python", "-c", "import ssl;
print(ssl.OPENSSL_VERSION)"]
++ return self._subprocess_output(cmd, env=env)
++
++ @property
++ def include_dir(self):
++ return os.path.join(self.install_dir, "include")
++
++ @property
++ def lib_dir(self):
++ return os.path.join(self.install_dir, "lib")
++
++ @property
++ def has_openssl(self):
++ return os.path.isfile(self.openssl_cli)
++
++ @property
++ def has_src(self):
++ return os.path.isfile(self.src_file)
++
++ def _subprocess_call(self, cmd, stdout=subprocess.DEVNULL, env=None,
++ **kwargs):
++ log.debug("Call '{}'".format(" ".join(cmd)))
++ return subprocess.check_call(cmd, stdout=stdout, env=env, **kwargs)
++
++ def _subprocess_output(self, cmd, env=None, **kwargs):
++ log.debug("Call '{}'".format(" ".join(cmd)))
++ out = subprocess.check_output(cmd, env=env)
++ return out.strip().decode("utf-8")
++
++ def _check_python_builddir(self):
++ if not os.path.isfile("python") or not
os.path.isfile("setup.py"):
++ raise ValueError("Script must be run in Python build directory")
++
++ def _download_openssl(self):
++ """Download OpenSSL source dist"""
++ src_dir = os.path.dirname(self.src_file)
++ if not os.path.isdir(src_dir):
++ os.makedirs(src_dir)
++ url = self.url_template.format(self.version)
++ log.info("Downloading OpenSSL from {}".format(url))
++ req = urlopen(url, cadefault=CADEFAULT)
++ # KISS, read all, write all
++ data = req.read()
++ log.info("Storing {}".format(self.src_file))
++ with open(self.src_file, "wb") as f:
++ f.write(data)
++
++ def _unpack_openssl(self):
++ """Unpack tar.gz bundle"""
++ # cleanup
++ if os.path.isdir(self.build_dir):
++ shutil.rmtree(self.build_dir)
++ os.makedirs(self.build_dir)
++
++ tf = tarfile.open(self.src_file)
++ base = "openssl-{}/".format(self.version)
++ # force extraction into build dir
++ members = tf.getmembers()
++ for member in members:
++ if not member.name.startswith(base):
++ raise ValueError(member.name)
++ member.name = member.name[len(base):]
++ log.info("Unpacking files to {}".format(self.build_dir))
++ tf.extractall(self.build_dir, members)
++
++ def _build_openssl(self):
++ """Now build openssl"""
++ log.info("Running build in {}".format(self.install_dir))
++ cwd = self.build_dir
++ cmd = ["./config", "shared",
"--prefix={}".format(self.install_dir)]
++ cmd.extend(self.openssl_compile_args)
++ self._subprocess_call(cmd, cwd=cwd)
++ self._subprocess_call(["make"], cwd=cwd)
++
++ def _install_openssl(self, remove=True):
++ self._subprocess_call(["make", "install"],
cwd=self.build_dir)
++ if remove:
++ shutil.rmtree(self.build_dir)
++
++ def install_openssl(self):
++ if not self.has_openssl:
++ if not self.has_src:
++ self._download_openssl()
++ else:
++ log.debug("Already has src {}".format(self.src_file))
++ self._unpack_openssl()
++ self._build_openssl()
++ self._install_openssl()
++ else:
++ log.info("Already has installation {}".format(self.install_dir))
++ # validate installation
++ version = self.openssl_version
++ if self.version not in version:
++ raise ValueError(version)
++
++ def touch_pymods(self):
++ # force a rebuild of all modules that use OpenSSL APIs
++ for fname in self.module_files:
++ os.utime(fname)
++
++ def recompile_pymods(self):
++ log.info("Using OpenSSL build from {}".format(self.build_dir))
++ # overwrite header and library search paths
++ env = os.environ.copy()
++ env["CPPFLAGS"] = "-I{}".format(self.include_dir)
++ env["LDFLAGS"] = "-L{}".format(self.lib_dir)
++ # set rpath
++ env["LD_RUN_PATH"] = self.lib_dir
++
++ log.info("Rebuilding Python modules")
++ self.touch_pymods()
++ cmd = ["./python", "setup.py", "build"]
++ self._subprocess_call(cmd, env=env)
++
++ def check_pyssl(self):
++ version = self.pyssl_version
++ if self.version not in version:
++ raise ValueError(version)
++
++ def run_pytests(self, *args):
++ cmd = ["./python", "-m", "test"]
++ cmd.extend(args)
++ self._subprocess_call(cmd, stdout=None)
++
++ def run_python_tests(self, *args):
++ self.recompile_pymods()
++ self.check_pyssl()
++ self.run_pytests(*args)
++
++
++def main(*args):
++ builders = []
++ for version in OPENSSL_VERSIONS:
++ if version in ("0.9.8i", "0.9.8l"):
++ openssl_compile_args = ("no-asm",)
++ else:
++ openssl_compile_args = ()
++ builder = BuildSSL(version, openssl_compile_args)
++ builder.install_openssl()
++ builders.append(builder)
++
++ for builder in builders:
++ builder.run_python_tests(*args)
++ # final touch
++ builder.touch_pymods()
++
++
++if __name__ == "__main__":
++ logging.basicConfig(level=logging.INFO,
++ format="*** %(levelname)s %(message)s")
++ args = sys.argv[1:]
++ if not args:
++ args = ["-unetwork", "-v"]
++ args.extend(FULL_TESTS)
++ main(*args)
commit 833dc39f61926c2fb84d9880dd43c81aab1479ec
Author: Robert Kuska <rkuska(a)redhat.com>
Date: Tue Aug 19 10:59:43 2014 +0200
Backport ssl module from python3
diff --git a/00196-ssl-backport.patch b/00196-ssl-backport.patch
new file mode 100644
index 0000000..a14d626
--- /dev/null
+++ b/00196-ssl-backport.patch
@@ -0,0 +1,12637 @@
+diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst
+index c115976..84dd332 100644
+--- a/Doc/library/ssl.rst
++++ b/Doc/library/ssl.rst
+@@ -28,19 +28,14 @@ probably additional platforms, as long as OpenSSL is installed on
that platform.
+
+ Some behavior may be platform dependent, since calls are made to the
+ operating system socket APIs. The installed version of OpenSSL may also
+- cause variations in behavior.
++ cause variations in behavior. For example, TLSv1.1 and TLSv1.2 come with
++ openssl version 1.0.1.
+
+ .. warning::
+- The ssl module won't validate certificates by default. When used in
+- client mode, this means you are vulnerable to man-in-the-middle attacks.
++ Don't use this module without reading the :ref:`ssl-security`. Doing so
++ may lead to a false sense of security, as the default settings of the
++ ssl module are not necessarily appropriate for your application.
+
+-.. warning::
+-
+- OpenSSL's internal random number generator does not properly handle fork.
+- Applications must change the PRNG state of the parent process if they use
+- any SSL feature with :func:`os.fork`. Any successful call of
+- :func:`~ssl.RAND_add`, :func:`~ssl.RAND_bytes` or
+- :func:`~ssl.RAND_pseudo_bytes` is sufficient.
+
+ This section documents the objects and functions in the ``ssl`` module; for more
+ general information about TLS, SSL, and certificates, the reader is referred to
+@@ -49,23 +44,101 @@ the documents in the "See Also" section at the bottom.
+ This module provides a class, :class:`ssl.SSLSocket`, which is derived from the
+ :class:`socket.socket` type, and provides a socket-like wrapper that also
+ encrypts and decrypts the data going over the socket with SSL. It supports
+-additional :meth:`read` and :meth:`write` methods, along with a method,
+-:meth:`getpeercert`, to retrieve the certificate of the other side of the
+-connection, and a method, :meth:`cipher`, to retrieve the cipher being used for
+-the secure connection.
++additional methods such as :meth:`getpeercert`, which retrieves the
++certificate of the other side of the connection, and :meth:`cipher`,which
++retrieves the cipher being used for the secure connection.
++
++For more sophisticated applications, the :class:`ssl.SSLContext` class
++helps manage settings and certificates, which can then be inherited
++by SSL sockets created through the :meth:`SSLContext.wrap_socket` method.
++
+
+ Functions, Constants, and Exceptions
+ ------------------------------------
+
+ .. exception:: SSLError
+
+- Raised to signal an error from the underlying SSL implementation. This
+- signifies some problem in the higher-level encryption and authentication
+- layer that's superimposed on the underlying network connection. This error
+- is a subtype of :exc:`socket.error`, which in turn is a subtype of
+- :exc:`IOError`.
++ Raised to signal an error from the underlying SSL implementation (currently
++ provided by the OpenSSL library). This signifies some problem in the
++ higher-level encryption and authentication layer that's superimposed on the
++ underlying network connection. This error is a subtype of
++ :exc:`socket.error`, which in turn is a subtype of :exc:`IOError`. The
++ error code and message of :exc:`SSLError` instances are provided by the
++ OpenSSL library.
++
++ .. attribute:: library
++
++ A string mnemonic designating the OpenSSL submodule in which the error
++ occurred, such as ``SSL``, ``PEM`` or ``X509``. The range of possible
++ values depends on the OpenSSL version.
++
++ .. versionadded:: 2.7.9
++
++ .. attribute:: reason
++
++ A string mnemonic designating the reason this error occurred, for
++ example ``CERTIFICATE_VERIFY_FAILED``. The range of possible
++ values depends on the OpenSSL version.
++
++ .. versionadded:: 2.7.9
++
++.. exception:: SSLZeroReturnError
++
++ A subclass of :exc:`SSLError` raised when trying to read or write and
++ the SSL connection has been closed cleanly. Note that this doesn't
++ mean that the underlying transport (read TCP) has been closed.
++
++ .. versionadded:: 2.7.9
++
++.. exception:: SSLWantReadError
++
++ A subclass of :exc:`SSLError` raised by a :ref:`non-blocking SSL socket
++ <ssl-nonblocking>` when trying to read or write data, but more data needs
++ to be received on the underlying TCP transport before the request can be
++ fulfilled.
++
++ .. versionadded:: 2.7.9
++
++.. exception:: SSLWantWriteError
++
++ A subclass of :exc:`SSLError` raised by a :ref:`non-blocking SSL socket
++ <ssl-nonblocking>` when trying to read or write data, but more data needs
++ to be sent on the underlying TCP transport before the request can be
++ fulfilled.
+
+-.. function:: wrap_socket (sock, keyfile=None, certfile=None, server_side=False,
cert_reqs=CERT_NONE, ssl_version={see docs}, ca_certs=None, do_handshake_on_connect=True,
suppress_ragged_eofs=True, ciphers=None)
++ .. versionadded:: 2.7.9
++
++.. exception:: SSLSyscallError
++
++ A subclass of :exc:`SSLError` raised when a system error was encountered
++ while trying to fulfill an operation on a SSL socket. Unfortunately,
++ there is no easy way to inspect the original errno number.
++
++ .. versionadded:: 2.7.9
++
++.. exception:: SSLEOFError
++
++ A subclass of :exc:`SSLError` raised when the SSL connection has been
++ terminated abruptly. Generally, you shouldn't try to reuse the underlying
++ transport when this error is encountered.
++
++ .. versionadded:: 2.7.9
++
++.. exception:: CertificateError
++
++ Raised to signal an error with a certificate (such as mismatching
++ hostname). Certificate errors detected by OpenSSL, though, raise
++ an :exc:`SSLError`.
++
++
++Socket creation
++^^^^^^^^^^^^^^^
++
++The following function allows for standalone socket creation. Starting from
++Python 2.7.9, it can be more flexible to use :meth:`SSLContext.wrap_socket`
++instead.
++
++.. function:: wrap_socket(sock, keyfile=None, certfile=None, server_side=False,
cert_reqs=CERT_NONE, ssl_version={see docs}, ca_certs=None, do_handshake_on_connect=True,
suppress_ragged_eofs=True, ciphers=None)
+
+ Takes an instance ``sock`` of :class:`socket.socket`, and returns an instance
+ of :class:`ssl.SSLSocket`, a subtype of :class:`socket.socket`, which wraps
+@@ -85,19 +158,6 @@ Functions, Constants, and Exceptions
+ connection. See the discussion of :ref:`ssl-certificates` for more
+ information on how the certificate is stored in the ``certfile``.
+
+- Often the private key is stored in the same file as the certificate; in this
+- case, only the ``certfile`` parameter need be passed. If the private key is
+- stored in a separate file, both parameters must be used. If the private key
+- is stored in the ``certfile``, it should come before the first certificate in
+- the certificate chain::
+-
+- -----BEGIN RSA PRIVATE KEY-----
+- ... (private key in base64 encoding) ...
+- -----END RSA PRIVATE KEY-----
+- -----BEGIN CERTIFICATE-----
+- ... (certificate in base64 PEM encoding) ...
+- -----END CERTIFICATE-----
+-
+ The parameter ``server_side`` is a boolean which identifies whether
+ server-side or client-side behavior is desired from this socket.
+
+@@ -127,14 +187,16 @@ Functions, Constants, and Exceptions
+
+ .. table::
+
+- ======================== ========= ========= ========== =========
+- *client* / **server** **SSLv2** **SSLv3** **SSLv23** **TLSv1**
+- ------------------------ --------- --------- ---------- ---------
+- *SSLv2* yes no yes no
+- *SSLv3* no yes yes no
+- *SSLv23* yes no yes no
+- *TLSv1* no no yes yes
+- ======================== ========= ========= ========== =========
++ ======================== ========= ========= ========== =========
=========== ===========
++ *client* / **server** **SSLv2** **SSLv3** **SSLv23** **TLSv1**
**TLSv1.1** **TLSv1.2**
++ ------------------------ --------- --------- ---------- ---------
----------- -----------
++ *SSLv2* yes no yes no no
no
++ *SSLv3* no yes yes no no
no
++ *SSLv23* yes no yes no no
no
++ *TLSv1* no no yes yes no
no
++ *TLSv1.1* no no yes no yes
no
++ *TLSv1.2* no no yes no no
yes
++ ======================== ========= ========= ========== =========
=========== ===========
+
+ .. note::
+
+@@ -161,22 +223,79 @@ Functions, Constants, and Exceptions
+ The parameter ``suppress_ragged_eofs`` specifies how the
+ :meth:`SSLSocket.read` method should signal unexpected EOF from the other end
+ of the connection. If specified as :const:`True` (the default), it returns a
+- normal EOF in response to unexpected EOF errors raised from the underlying
+- socket; if :const:`False`, it will raise the exceptions back to the caller.
++ normal EOF (an empty bytes object) in response to unexpected EOF errors
++ raised from the underlying socket; if :const:`False`, it will raise the
++ exceptions back to the caller.
+
+ .. versionchanged:: 2.7
+ New optional argument *ciphers*.
+
++
++Context creation
++^^^^^^^^^^^^^^^^
++
++A convenience function helps create :class:`SSLContext` objects for common
++purposes.
++
++.. function:: create_default_context(purpose=Purpose.SERVER_AUTH, cafile=None,
capath=None, cadata=None)
++
++ Return a new :class:`SSLContext` object with default settings for
++ the given *purpose*. The settings are chosen by the :mod:`ssl` module,
++ and usually represent a higher security level than when calling the
++ :class:`SSLContext` constructor directly.
++
++ *cafile*, *capath*, *cadata* represent optional CA certificates to
++ trust for certificate verification, as in
++ :meth:`SSLContext.load_verify_locations`. If all three are
++ :const:`None`, this function can choose to trust the system's default
++ CA certificates instead.
++
++ The settings in Python 2.7.9 are: :data:`PROTOCOL_SSLv23`,
++ :data:`OP_NO_SSLv2`, and :data:`OP_NO_SSLv3` with high encryption cipher
++ suites without RC4 and without unauthenticated cipher suites. Passing
++ :data:`~Purpose.SERVER_AUTH` as *purpose* sets
++ :data:`~SSLContext.verify_mode` to :data:`CERT_REQUIRED` and either loads CA
++ certificates (when at least one of *cafile*, *capath* or *cadata* is given)
++ or uses :meth:`SSLContext.load_default_certs` to load default CA
++ certificates.
++
++ .. note::
++ The protocol, options, cipher and other settings may change to more
++ restrictive values anytime without prior deprecation. The values
++ represent a fair balance between compatibility and security.
++
++ If your application needs specific settings, you should create a
++ :class:`SSLContext` and apply the settings yourself.
++
++ .. note::
++ If you find that when certain older clients or servers attempt to connect
++ with a :class:`SSLContext` created by this function that they get an
++ error stating "Protocol or cipher suite mismatch", it may be that they
++ only support SSL3.0 which this function excludes using the
++ :data:`OP_NO_SSLv3`. SSL3.0 has problematic security due to a number of
++ poor implementations and it's reliance on MD5 within the protocol. If you
++ wish to continue to use this function but still allow SSL 3.0 connections
++ you can re-enable them using::
++
++ ctx = ssl.create_default_context(Purpose.CLIENT_AUTH)
++ ctx.options &= ~ssl.OP_NO_SSLv3
++
++ .. versionadded:: 2.7.9
++
++
++Random generation
++^^^^^^^^^^^^^^^^^
++
+ .. function:: RAND_status()
+
+ Returns ``True`` if the SSL pseudo-random number generator has been seeded with
+- 'enough' randomness, and False otherwise. You can use :func:`ssl.RAND_egd`
++ 'enough' randomness, and ``False`` otherwise. You can use
:func:`ssl.RAND_egd`
+ and :func:`ssl.RAND_add` to increase the randomness of the pseudo-random
+ number generator.
+
+ .. function:: RAND_egd(path)
+
+- If you are running an entropy-gathering daemon (EGD) somewhere, and ``path``
++ If you are running an entropy-gathering daemon (EGD) somewhere, and *path*
+ is the pathname of a socket connection open to it, this will read 256 bytes
+ of randomness from the socket, and add it to the SSL pseudo-random number
+ generator to increase the security of generated secret keys. This is
+@@ -187,28 +306,66 @@ Functions, Constants, and Exceptions
+
+ .. function:: RAND_add(bytes, entropy)
+
+- Mixes the given ``bytes`` into the SSL pseudo-random number generator. The
+- parameter ``entropy`` (a float) is a lower bound on the entropy contained in
++ Mixes the given *bytes* into the SSL pseudo-random number generator. The
++ parameter *entropy* (a float) is a lower bound on the entropy contained in
+ string (so you can always use :const:`0.0`). See :rfc:`1750` for more
+ information on sources of entropy.
+
+-.. function:: cert_time_to_seconds(timestring)
++Certificate handling
++^^^^^^^^^^^^^^^^^^^^
++
++.. 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::
+
+- Returns a floating-point value containing a normal seconds-after-the-epoch
+- time value, given the time-string representing the "notBefore" or
"notAfter"
+- date from a certificate.
++ >>> 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'
+
+- Here's an example::
++ .. versionadded:: 2.7.9
+
+- >>> import ssl
+- >>> ssl.cert_time_to_seconds("May 9 00:00:00 2007 GMT")
+- 1178694000.0
+- >>> import time
+- >>> time.ctime(ssl.cert_time_to_seconds("May 9 00:00:00 2007
GMT"))
+- 'Wed May 9 00:00:00 2007'
+- >>>
+
+-.. function:: get_server_certificate (addr, ssl_version=PROTOCOL_SSLv3, ca_certs=None)
++.. function:: cert_time_to_seconds(cert_time)
++
++ Return the time in seconds since the Epoch, given the ``cert_time``
++ string representing the "notBefore" or "notAfter" date from a
++ certificate in ``"%b %d %H:%M:%S %Y %Z"`` strptime format (C
++ locale).
++
++ Here's an example:
++
++ .. doctest:: newcontext
++
++ >>> import ssl
++ >>> timestamp = ssl.cert_time_to_seconds("Jan 5 09:34:43 2018
GMT")
++ >>> timestamp
++ 1515144883
++ >>> from datetime import datetime
++ >>> print(datetime.utcfromtimestamp(timestamp))
++ 2018-01-05 09:34:43
++
++ "notBefore" or "notAfter" dates must use GMT (:rfc:`5280`).
++
++ .. versionchanged:: 2.7.9
++ Interpret the input time as a time in UTC as specified by 'GMT'
++ timezone in the input string. Local timezone was used
++ previously. Return an integer (no fractions of a second in the
++ input format)
++
++.. function:: get_server_certificate(addr, ssl_version=PROTOCOL_SSLv23, ca_certs=None)
+
+ Given the address ``addr`` of an SSL-protected server, as a (*hostname*,
+ *port-number*) pair, fetches the server's certificate, and returns it as a
+@@ -219,36 +376,144 @@ Functions, Constants, and Exceptions
+ will attempt to validate the server certificate against that set of root
+ certificates, and will fail if the validation attempt fails.
+
+-.. function:: DER_cert_to_PEM_cert (DER_cert_bytes)
++ .. versionchanged:: 2.7.9
++
++ This function is now IPv6-compatible, and the default *ssl_version* is
++ changed from :data:`PROTOCOL_SSLv3` to :data:`PROTOCOL_SSLv23` for
++ maximum compatibility with modern servers.
++
++.. function:: DER_cert_to_PEM_cert(DER_cert_bytes)
+
+ Given a certificate as a DER-encoded blob of bytes, returns a PEM-encoded
+ string version of the same certificate.
+
+-.. function:: PEM_cert_to_DER_cert (PEM_cert_string)
++.. function:: PEM_cert_to_DER_cert(PEM_cert_string)
+
+ Given a certificate as an ASCII PEM string, returns a DER-encoded sequence of
+ bytes for that same certificate.
+
++.. function:: get_default_verify_paths()
++
++ Returns a named tuple with paths to OpenSSL's default cafile and capath.
++ The paths are the same as used by
++ :meth:`SSLContext.set_default_verify_paths`. The return value is a
++ :term:`named tuple` ``DefaultVerifyPaths``:
++
++ * :attr:`cafile` - resolved path to cafile or None if the file doesn't exist,
++ * :attr:`capath` - resolved path to capath or None if the directory doesn't
exist,
++ * :attr:`openssl_cafile_env` - OpenSSL's environment key that points to a
cafile,
++ * :attr:`openssl_cafile` - hard coded path to a cafile,
++ * :attr:`openssl_capath_env` - OpenSSL's environment key that points to a
capath,
++ * :attr:`openssl_capath` - hard coded path to a capath directory
++
++ .. versionadded:: 2.7.9
++
++.. function:: enum_certificates(store_name)
++
++ Retrieve certificates from Windows' system cert store. *store_name* may be
++ one of ``CA``, ``ROOT`` or ``MY``. Windows may provide additional cert
++ stores, too.
++
++ The function returns a list of (cert_bytes, encoding_type, trust) tuples.
++ The encoding_type specifies the encoding of cert_bytes. It is either
++ :const:`x509_asn` for X.509 ASN.1 data or :const:`pkcs_7_asn` for
++ PKCS#7 ASN.1 data. Trust specifies the purpose of the certificate as a set
++ of OIDS or exactly ``True`` if the certificate is trustworthy for all
++ purposes.
++
++ Example::
++
++ >>> ssl.enum_certificates("CA")
++ [(b'data...', 'x509_asn', {'1.3.6.1.5.5.7.3.1',
'1.3.6.1.5.5.7.3.2'}),
++ (b'data...', 'x509_asn', True)]
++
++ Availability: Windows.
++
++ .. versionadded:: 2.7.9
++
++.. function:: enum_crls(store_name)
++
++ Retrieve CRLs from Windows' system cert store. *store_name* may be
++ one of ``CA``, ``ROOT`` or ``MY``. Windows may provide additional cert
++ stores, too.
++
++ The function returns a list of (cert_bytes, encoding_type, trust) tuples.
++ The encoding_type specifies the encoding of cert_bytes. It is either
++ :const:`x509_asn` for X.509 ASN.1 data or :const:`pkcs_7_asn` for
++ PKCS#7 ASN.1 data.
++
++ Availability: Windows.
++
++ .. versionadded:: 2.7.9
++
++
++Constants
++^^^^^^^^^
++
+ .. data:: CERT_NONE
+
+- Value to pass to the ``cert_reqs`` parameter to :func:`sslobject` when no
+- certificates will be required or validated from the other side of the socket
+- connection.
++ Possible value for :attr:`SSLContext.verify_mode`, or the ``cert_reqs``
++ parameter to :func:`wrap_socket`. In this mode (the default), no
++ certificates will be required from the other side of the socket connection.
++ If a certificate is received from the other end, no attempt to validate it
++ is made.
++
++ See the discussion of :ref:`ssl-security` below.
+
+ .. data:: CERT_OPTIONAL
+
+- Value to pass to the ``cert_reqs`` parameter to :func:`sslobject` when no
+- certificates will be required from the other side of the socket connection,
+- but if they are provided, will be validated. Note that use of this setting
+- requires a valid certificate validation file also be passed as a value of the
+- ``ca_certs`` parameter.
++ Possible value for :attr:`SSLContext.verify_mode`, or the ``cert_reqs``
++ parameter to :func:`wrap_socket`. In this mode no certificates will be
++ required from the other side of the socket connection; but if they
++ are provided, validation will be attempted and an :class:`SSLError`
++ will be raised on failure.
++
++ Use of this setting requires a valid set of CA certificates to
++ be passed, either to :meth:`SSLContext.load_verify_locations` or as a
++ value of the ``ca_certs`` parameter to :func:`wrap_socket`.
+
+ .. data:: CERT_REQUIRED
+
+- Value to pass to the ``cert_reqs`` parameter to :func:`sslobject` when
+- certificates will be required from the other side of the socket connection.
+- Note that use of this setting requires a valid certificate validation file
+- also be passed as a value of the ``ca_certs`` parameter.
++ Possible value for :attr:`SSLContext.verify_mode`, or the ``cert_reqs``
++ parameter to :func:`wrap_socket`. In this mode, certificates are
++ required from the other side of the socket connection; an :class:`SSLError`
++ will be raised if no certificate is provided, or if its validation fails.
++
++ Use of this setting requires a valid set of CA certificates to
++ be passed, either to :meth:`SSLContext.load_verify_locations` or as a
++ value of the ``ca_certs`` parameter to :func:`wrap_socket`.
++
++.. data:: VERIFY_DEFAULT
++
++ Possible value for :attr:`SSLContext.verify_flags`. In this mode,
++ certificate revocation lists (CRLs) are not checked. By default OpenSSL
++ does neither require nor verify CRLs.
++
++ .. versionadded:: 2.7.9
++
++.. data:: VERIFY_CRL_CHECK_LEAF
++
++ Possible value for :attr:`SSLContext.verify_flags`. In this mode, only the
++ peer cert is check but non of the intermediate CA certificates. The mode
++ requires a valid CRL that is signed by the peer cert's issuer (its direct
++ ancestor CA). If no proper has been loaded
++ :attr:`SSLContext.load_verify_locations`, validation will fail.
++
++ .. versionadded:: 2.7.9
++
++.. data:: VERIFY_CRL_CHECK_CHAIN
++
++ Possible value for :attr:`SSLContext.verify_flags`. In this mode, CRLs of
++ all certificates in the peer cert chain are checked.
++
++ .. versionadded:: 2.7.9
++
++.. data:: VERIFY_X509_STRICT
++
++ Possible value for :attr:`SSLContext.verify_flags` to disable workarounds
++ for broken X.509 certificates.
++
++ .. versionadded:: 2.7.9
+
+ .. data:: PROTOCOL_SSLv2
+
+@@ -275,9 +540,136 @@ Functions, Constants, and Exceptions
+
+ .. data:: PROTOCOL_TLSv1
+
+- Selects TLS version 1 as the channel encryption protocol. This is the most
++ Selects TLS version 1.0 as the channel encryption protocol.
++
++.. data:: PROTOCOL_TLSv1_1
++
++ Selects TLS version 1.1 as the channel encryption protocol.
++ Available only with openssl version 1.0.1+.
++
++ .. versionadded:: 2.7.9
++
++.. data:: PROTOCOL_TLSv1_2
++
++ Selects TLS version 1.2 as the channel encryption protocol. This is the most
+ modern version, and probably the best choice for maximum protection, if both
+- sides can speak it.
++ sides can speak it. Available only with openssl version 1.0.1+.
++
++ .. versionadded:: 2.7.9
++
++.. data:: OP_ALL
++
++ Enables workarounds for various bugs present in other SSL implementations.
++ This option is set by default. It does not necessarily set the same
++ flags as OpenSSL's ``SSL_OP_ALL`` constant.
++
++ .. versionadded:: 2.7.9
++
++.. data:: OP_NO_SSLv2
++
++ Prevents an SSLv2 connection. This option is only applicable in
++ conjunction with :const:`PROTOCOL_SSLv23`. It prevents the peers from
++ choosing SSLv2 as the protocol version.
++
++ .. versionadded:: 2.7.9
++
++.. data:: OP_NO_SSLv3
++
++ Prevents an SSLv3 connection. This option is only applicable in
++ conjunction with :const:`PROTOCOL_SSLv23`. It prevents the peers from
++ choosing SSLv3 as the protocol version.
++
++ .. versionadded:: 2.7.9
++
++.. data:: OP_NO_TLSv1
++
++ Prevents a TLSv1 connection. This option is only applicable in
++ conjunction with :const:`PROTOCOL_SSLv23`. It prevents the peers from
++ choosing TLSv1 as the protocol version.
++
++ .. versionadded:: 2.7.9
++
++.. data:: OP_NO_TLSv1_1
++
++ Prevents a TLSv1.1 connection. This option is only applicable in conjunction
++ with :const:`PROTOCOL_SSLv23`. It prevents the peers from choosing TLSv1.1 as
++ the protocol version. Available only with openssl version 1.0.1+.
++
++ .. versionadded:: 2.7.9
++
++.. data:: OP_NO_TLSv1_2
++
++ Prevents a TLSv1.2 connection. This option is only applicable in conjunction
++ with :const:`PROTOCOL_SSLv23`. It prevents the peers from choosing TLSv1.2 as
++ the protocol version. Available only with openssl version 1.0.1+.
++
++ .. versionadded:: 2.7.9
++
++.. data:: OP_CIPHER_SERVER_PREFERENCE
++
++ Use the server's cipher ordering preference, rather than the client's.
++ This option has no effect on client sockets and SSLv2 server sockets.
++
++ .. versionadded:: 2.7.9
++
++.. data:: OP_SINGLE_DH_USE
++
++ Prevents re-use of the same DH key for distinct SSL sessions. This
++ improves forward secrecy but requires more computational resources.
++ This option only applies to server sockets.
++
++ .. versionadded:: 2.7.9
++
++.. data:: OP_SINGLE_ECDH_USE
++
++ Prevents re-use of the same ECDH key for distinct SSL sessions. This
++ improves forward secrecy but requires more computational resources.
++ This option only applies to server sockets.
++
++ .. versionadded:: 2.7.9
++
++.. data:: OP_NO_COMPRESSION
++
++ Disable compression on the SSL channel. This is useful if the application
++ protocol supports its own compression scheme.
++
++ This option is only available with OpenSSL 1.0.0 and later.
++
++ .. versionadded:: 2.7.9
++
++.. data:: HAS_ECDH
++
++ Whether the OpenSSL library has built-in support for Elliptic Curve-based
++ Diffie-Hellman key exchange. This should be true unless the feature was
++ explicitly disabled by the distributor.
++
++ .. versionadded:: 2.7.9
++
++.. data:: HAS_SNI
++
++ Whether the OpenSSL library has built-in support for the *Server Name
++ Indication* extension to the SSLv3 and TLSv1 protocols (as defined in
++ :rfc:`4366`). When true, you can use the *server_hostname* argument to
++ :meth:`SSLContext.wrap_socket`.
++
++ .. versionadded:: 2.7.9
++
++.. data:: HAS_NPN
++
++ Whether the OpenSSL library has built-in support for *Next Protocol
++ Negotiation* as described in the `NPN draft specification
++ <
http://tools.ietf.org/html/draft-agl-tls-nextprotoneg>`_. When true,
++ you can use the :meth:`SSLContext.set_npn_protocols` method to advertise
++ which protocols you want to support.
++
++ .. versionadded:: 2.7.9
++
++.. data:: CHANNEL_BINDING_TYPES
++
++ List of supported TLS channel binding types. Strings in this list
++ can be used as arguments to :meth:`SSLSocket.get_channel_binding`.
++
++ .. versionadded:: 2.7.9
+
+ .. data:: OPENSSL_VERSION
+
+@@ -309,9 +701,40 @@ Functions, Constants, and Exceptions
+
+ .. versionadded:: 2.7
+
++.. data:: ALERT_DESCRIPTION_HANDSHAKE_FAILURE
++ ALERT_DESCRIPTION_INTERNAL_ERROR
++ ALERT_DESCRIPTION_*
++
++ Alert Descriptions from :rfc:`5246` and others. The `IANA TLS Alert Registry
++
<
http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-par...
++ contains this list and references to the RFCs where their meaning is defined.
++
++ Used as the return value of the callback function in
++ :meth:`SSLContext.set_servername_callback`.
++
++ .. versionadded:: 2.7.9
++
++.. data:: Purpose.SERVER_AUTH
++
++ Option for :func:`create_default_context` and
++ :meth:`SSLContext.load_default_certs`. This value indicates that the
++ context may be used to authenticate Web servers (therefore, it will
++ be used to create client-side sockets).
++
++ .. versionadded:: 2.7.9
+
+-SSLSocket Objects
+------------------
++.. data:: Purpose.CLIENT_AUTH
++
++ Option for :func:`create_default_context` and
++ :meth:`SSLContext.load_default_certs`. This value indicates that the
++ context may be used to authenticate Web clients (therefore, it will
++ be used to create server-side sockets).
++
++ .. versionadded:: 2.7.9
++
++
++SSL Sockets
++-----------
+
+ SSL sockets provide the following methods of :ref:`socket-objects`:
+
+@@ -334,37 +757,64 @@ SSL sockets provide the following methods of
:ref:`socket-objects`:
+
+ However, since the SSL (and TLS) protocol has its own framing atop
+ of TCP, the SSL sockets abstraction can, in certain respects, diverge from
+-the specification of normal, OS-level sockets.
++the specification of normal, OS-level sockets. See especially the
++:ref:`notes on non-blocking sockets <ssl-nonblocking>`.
+
+ SSL sockets also have the following additional methods and attributes:
+
++.. method:: SSLSocket.do_handshake()
++
++ Perform the SSL setup handshake.
++
++ .. versionchanged:: 2.7.9
++
++ The handshake method also performs :func:`match_hostname` when the
++ :attr:`~SSLContext.check_hostname` attribute of the socket's
++ :attr:`~SSLSocket.context` is true.
++
+ .. method:: SSLSocket.getpeercert(binary_form=False)
+
+ If there is no certificate for the peer on the other end of the connection,
+- returns ``None``.
++ return ``None``. If the SSL handshake hasn't been done yet, raise
++ :exc:`ValueError`.
+
+ If the ``binary_form`` parameter is :const:`False`, and a certificate was
+ received from the peer, this method returns a :class:`dict` instance. If the
+ certificate was not validated, the dict is empty. If the certificate was
+- validated, it returns a dict with the keys ``subject`` (the principal for
+- which the certificate was issued), and ``notAfter`` (the time after which the
+- certificate should not be trusted). The certificate was already validated,
+- so the ``notBefore`` and ``issuer`` fields are not returned. If a
+- certificate contains an instance of the *Subject Alternative Name* extension
+- (see :rfc:`3280`), there will also be a ``subjectAltName`` key in the
+- dictionary.
+-
+- The "subject" field is a tuple containing the sequence of relative
+- distinguished names (RDNs) given in the certificate's data structure for the
+- principal, and each RDN is a sequence of name-value pairs::
+-
+- {'notAfter': 'Feb 16 16:54:50 2013 GMT',
+- 'subject': ((('countryName', u'US'),),
+- (('stateOrProvinceName', u'Delaware'),),
+- (('localityName', u'Wilmington'),),
+- (('organizationName', u'Python Software
Foundation'),),
+- (('organizationalUnitName', u'SSL'),),
+- (('commonName', u'somemachine.python.org'),))}
++ validated, it returns a dict with several keys, amongst them ``subject``
++ (the principal for which the certificate was issued) and ``issuer``
++ (the principal issuing the certificate). If a certificate contains an
++ instance of the *Subject Alternative Name* extension (see :rfc:`3280`),
++ there will also be a ``subjectAltName`` key in the dictionary.
++
++ The ``subject`` and ``issuer`` fields are tuples containing the sequence
++ of relative distinguished names (RDNs) given in the certificate's data
++ structure for the respective fields, and each RDN is a sequence of
++ name-value pairs. Here is a real-world example::
++
++ {'issuer': ((('countryName', 'IL'),),
++ (('organizationName', 'StartCom Ltd.'),),
++ (('organizationalUnitName',
++ 'Secure Digital Certificate Signing'),),
++ (('commonName',
++ 'StartCom Class 2 Primary Intermediate Server CA'),)),
++ 'notAfter': 'Nov 22 08:15:19 2013 GMT',
++ 'notBefore': 'Nov 21 03:09:52 2011 GMT',
++ 'serialNumber': '95F0',
++ 'subject': ((('description',
'571208-SLe257oHY9fVQ07Z'),),
++ (('countryName', 'US'),),
++ (('stateOrProvinceName', 'California'),),
++ (('localityName', 'San Francisco'),),
++ (('organizationName', 'Electronic Frontier Foundation,
Inc.'),),
++ (('commonName', '*.eff.org'),),
++ (('emailAddress', 'hostmaster(a)eff.org'),)),
++ 'subjectAltName': (('DNS', '*.eff.org'), ('DNS',
'eff.org')),
++ 'version': 3}
++
++ .. note::
++
++ To validate a certificate for a particular service, you can use the
++ :func:`match_hostname` function.
+
+ If the ``binary_form`` parameter is :const:`True`, and a certificate was
+ provided, this method returns the DER-encoded form of the entire certificate
+@@ -380,40 +830,388 @@ SSL sockets also have the following additional methods and
attributes:
+ :const:`None` if you used :const:`CERT_NONE` (rather than
+ :const:`CERT_OPTIONAL` or :const:`CERT_REQUIRED`).
+
++ .. versionchanged:: 2.7.9
++ The returned dictionary includes additional items such as ``issuer`` and
++ ``notBefore``. Additionall :exc:`ValueError` is raised when the handshake
++ isn't done. The returned dictionary includes additional X509v3 extension
++ items such as ``crlDistributionPoints``, ``caIssuers`` and ``OCSP`` URIs.
++
+ .. method:: SSLSocket.cipher()
+
+ Returns a three-value tuple containing the name of the cipher being used, the
+ version of the SSL protocol that defines its use, and the number of secret
+ bits being used. If no connection has been established, returns ``None``.
+
+-.. method:: SSLSocket.do_handshake()
++.. method:: SSLSocket.compression()
++
++ Return the compression algorithm being used as a string, or ``None``
++ if the connection isn't compressed.
++
++ If the higher-level protocol supports its own compression mechanism,
++ you can use :data:`OP_NO_COMPRESSION` to disable SSL-level compression.
++
++ .. versionadded:: 2.7.9
++
++.. method:: SSLSocket.get_channel_binding(cb_type="tls-unique")
+
+- Perform a TLS/SSL handshake. If this is used with a non-blocking socket, it
+- may raise :exc:`SSLError` with an ``arg[0]`` of :const:`SSL_ERROR_WANT_READ`
+- or :const:`SSL_ERROR_WANT_WRITE`, in which case it must be called again until
+- it completes successfully. For example, to simulate the behavior of a
+- blocking socket, one might write::
+-
+- while True:
+- try:
+- s.do_handshake()
+- break
+- except ssl.SSLError as err:
+- if err.args[0] == ssl.SSL_ERROR_WANT_READ:
+- select.select([s], [], [])
+- elif err.args[0] == ssl.SSL_ERROR_WANT_WRITE:
+- select.select([], [s], [])
+- else:
+- raise
++ Get channel binding data for current connection, as a bytes object. Returns
++ ``None`` if not connected or the handshake has not been completed.
++
++ The *cb_type* parameter allow selection of the desired channel binding
++ type. Valid channel binding types are listed in the
++ :data:`CHANNEL_BINDING_TYPES` list. Currently only the 'tls-unique' channel
++ binding, defined by :rfc:`5929`, is supported. :exc:`ValueError` will be
++ raised if an unsupported channel binding type is requested.
++
++ .. versionadded:: 2.7.9
++
++.. method:: SSLSocket.selected_npn_protocol()
++
++ Returns the protocol that was selected during the TLS/SSL handshake. If
++ :meth:`SSLContext.set_npn_protocols` was not called, or if the other party
++ does not support NPN, or if the handshake has not yet happened, this will
++ return ``None``.
++
++ .. versionadded:: 2.7.9
+
+ .. method:: SSLSocket.unwrap()
+
+ Performs the SSL shutdown handshake, which removes the TLS layer from the
+ underlying socket, and returns the underlying socket object. This can be
+ used to go from encrypted operation over a connection to unencrypted. The
+- socket instance returned should always be used for further communication with
+- the other side of the connection, rather than the original socket instance
+- (which may not function properly after the unwrap).
++ returned socket should always be used for further communication with the
++ other side of the connection, rather than the original socket.
++
++.. attribute:: SSLSocket.context
++
++ The :class:`SSLContext` object this SSL socket is tied to. If the SSL
++ socket was created using the top-level :func:`wrap_socket` function
++ (rather than :meth:`SSLContext.wrap_socket`), this is a custom context
++ object created for this SSL socket.
++
++ .. versionadded:: 2.7.9
++
++
++SSL Contexts
++------------
++
++.. versionadded:: 2.7.9
++
++An SSL context holds various data longer-lived than single SSL connections,
++such as SSL configuration options, certificate(s) and private key(s).
++It also manages a cache of SSL sessions for server-side sockets, in order
++to speed up repeated connections from the same clients.
++
++.. class:: SSLContext(protocol)
++
++ Create a new SSL context. You must pass *protocol* which must be one
++ of the ``PROTOCOL_*`` constants defined in this module.
++ :data:`PROTOCOL_SSLv23` is currently recommended for maximum
++ interoperability.
++
++ .. seealso::
++ :func:`create_default_context` lets the :mod:`ssl` module choose
++ security settings for a given purpose.
++
++
++:class:`SSLContext` objects have the following methods and attributes:
++
++.. method:: SSLContext.cert_store_stats()
++
++ Get statistics about quantities of loaded X.509 certificates, count of
++ X.509 certificates flagged as CA certificates and certificate revocation
++ lists as dictionary.
++
++ Example for a context with one CA cert and one other cert::
++
++ >>> context.cert_store_stats()
++ {'crl': 0, 'x509_ca': 1, 'x509': 2}
++
++
++.. method:: SSLContext.load_cert_chain(certfile, keyfile=None, password=None)
++
++ Load a private key and the corresponding certificate. The *certfile*
++ string must be the path to a single file in PEM format containing the
++ certificate as well as any number of CA certificates needed to establish
++ the certificate's authenticity. The *keyfile* string, if present, must
++ point to a file containing the private key in. Otherwise the private
++ key will be taken from *certfile* as well. See the discussion of
++ :ref:`ssl-certificates` for more information on how the certificate
++ is stored in the *certfile*.
++
++ The *password* argument may be a function to call to get the password for
++ decrypting the private key. It will only be called if the private key is
++ encrypted and a password is necessary. It will be called with no arguments,
++ and it should return a string, bytes, or bytearray. If the return value is
++ a string it will be encoded as UTF-8 before using it to decrypt the key.
++ Alternatively a string, bytes, or bytearray value may be supplied directly
++ as the *password* argument. It will be ignored if the private key is not
++ encrypted and no password is needed.
++
++ If the *password* argument is not specified and a password is required,
++ OpenSSL's built-in password prompting mechanism will be used to
++ interactively prompt the user for a password.
++
++ An :class:`SSLError` is raised if the private key doesn't
++ match with the certificate.
++
++.. method:: SSLContext.load_default_certs(purpose=Purpose.SERVER_AUTH)
++
++ Load a set of default "certification authority" (CA) certificates from
++ default locations. On Windows it loads CA certs from the ``CA`` and
++ ``ROOT`` system stores. On other systems it calls
++ :meth:`SSLContext.set_default_verify_paths`. In the future the method may
++ load CA certificates from other locations, too.
++
++ The *purpose* flag specifies what kind of CA certificates are loaded. The
++ default settings :data:`Purpose.SERVER_AUTH` loads certificates, that are
++ flagged and trusted for TLS web server authentication (client side
++ sockets). :data:`Purpose.CLIENT_AUTH` loads CA certificates for client
++ certificate verification on the server side.
++
++.. method:: SSLContext.load_verify_locations(cafile=None, capath=None, cadata=None)
++
++ Load a set of "certification authority" (CA) certificates used to validate
++ other peers' certificates when :data:`verify_mode` is other than
++ :data:`CERT_NONE`. At least one of *cafile* or *capath* must be specified.
++
++ This method can also load certification revocation lists (CRLs) in PEM or
++ DER format. In order to make use of CRLs, :attr:`SSLContext.verify_flags`
++ must be configured properly.
++
++ The *cafile* string, if present, is the path to a file of concatenated
++ CA certificates in PEM format. See the discussion of
++ :ref:`ssl-certificates` for more information about how to arrange the
++ certificates in this file.
++
++ The *capath* string, if present, is
++ the path to a directory containing several CA certificates in PEM format,
++ following an `OpenSSL specific layout
++ <
http://www.openssl.org/docs/ssl/SSL_CTX_load_verify_locations.html>`_.
++
++ The *cadata* object, if present, is either an ASCII string of one or more
++ PEM-encoded certificates or a bytes-like object of DER-encoded
++ certificates. Like with *capath* extra lines around PEM-encoded
++ certificates are ignored but at least one certificate must be present.
++
++.. method:: SSLContext.get_ca_certs(binary_form=False)
++
++ Get a list of loaded "certification authority" (CA) certificates. If the
++ ``binary_form`` parameter is :const:`False` each list
++ entry is a dict like the output of :meth:`SSLSocket.getpeercert`. Otherwise
++ the method returns a list of DER-encoded certificates. The returned list
++ does not contain certificates from *capath* unless a certificate was
++ requested and loaded by a SSL connection.
++
++.. method:: SSLContext.set_default_verify_paths()
++
++ Load a set of default "certification authority" (CA) certificates from
++ a filesystem path defined when building the OpenSSL library. Unfortunately,
++ there's no easy way to know whether this method succeeds: no error is
++ returned if no certificates are to be found. When the OpenSSL library is
++ provided as part of the operating system, though, it is likely to be
++ configured properly.
++
++.. method:: SSLContext.set_ciphers(ciphers)
++
++ Set the available ciphers for sockets created with this context.
++ It should be a string in the `OpenSSL cipher list format
++ <
http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT>`_.
++ If no cipher can be selected (because compile-time options or other
++ configuration forbids use of all the specified ciphers), an
++ :class:`SSLError` will be raised.
++
++ .. note::
++ when connected, the :meth:`SSLSocket.cipher` method of SSL sockets will
++ give the currently selected cipher.
++
++.. method:: SSLContext.set_npn_protocols(protocols)
++
++ Specify which protocols the socket should advertise during the SSL/TLS
++ handshake. It should be a list of strings, like ``['http/1.1',
'spdy/2']``,
++ ordered by preference. The selection of a protocol will happen during the
++ handshake, and will play out according to the `NPN draft specification
++ <
http://tools.ietf.org/html/draft-agl-tls-nextprotoneg>`_. After a
++ successful handshake, the :meth:`SSLSocket.selected_npn_protocol` method will
++ return the agreed-upon protocol.
++
++ This method will raise :exc:`NotImplementedError` if :data:`HAS_NPN` is
++ False.
++
++.. method:: SSLContext.set_servername_callback(server_name_callback)
++
++ Register a callback function that will be called after the TLS Client Hello
++ handshake message has been received by the SSL/TLS server when the TLS client
++ specifies a server name indication. The server name indication mechanism
++ is specified in :rfc:`6066` section 3 - Server Name Indication.
++
++ Only one callback can be set per ``SSLContext``. If *server_name_callback*
++ is ``None`` then the callback is disabled. Calling this function a
++ subsequent time will disable the previously registered callback.
++
++ The callback function, *server_name_callback*, will be called with three
++ arguments; the first being the :class:`ssl.SSLSocket`, the second is a string
++ that represents the server name that the client is intending to communicate
++ (or :const:`None` if the TLS Client Hello does not contain a server name)
++ and the third argument is the original :class:`SSLContext`. The server name
++ argument is the IDNA decoded server name.
++
++ A typical use of this callback is to change the :class:`ssl.SSLSocket`'s
++ :attr:`SSLSocket.context` attribute to a new object of type
++ :class:`SSLContext` representing a certificate chain that matches the server
++ name.
++
++ Due to the early negotiation phase of the TLS connection, only limited
++ methods and attributes are usable like
++ :meth:`SSLSocket.selected_npn_protocol` and :attr:`SSLSocket.context`.
++ :meth:`SSLSocket.getpeercert`, :meth:`SSLSocket.getpeercert`,
++ :meth:`SSLSocket.cipher` and :meth:`SSLSocket.compress` methods require that
++ the TLS connection has progressed beyond the TLS Client Hello and therefore
++ will not contain return meaningful values nor can they be called safely.
++
++ The *server_name_callback* function must return ``None`` to allow the
++ TLS negotiation to continue. If a TLS failure is required, a constant
++ :const:`ALERT_DESCRIPTION_* <ALERT_DESCRIPTION_INTERNAL_ERROR>` can be
++ returned. Other return values will result in a TLS fatal error with
++ :const:`ALERT_DESCRIPTION_INTERNAL_ERROR`.
++
++ If there is an IDNA decoding error on the server name, the TLS connection
++ will terminate with an :const:`ALERT_DESCRIPTION_INTERNAL_ERROR` fatal TLS
++ alert message to the client.
++
++ If an exception is raised from the *server_name_callback* function the TLS
++ connection will terminate with a fatal TLS alert message
++ :const:`ALERT_DESCRIPTION_HANDSHAKE_FAILURE`.
++
++ This method will raise :exc:`NotImplementedError` if the OpenSSL library
++ had OPENSSL_NO_TLSEXT defined when it was built.
++
++.. method:: SSLContext.load_dh_params(dhfile)
++
++ Load the key generation parameters for Diffie-Helman (DH) key exchange.
++ Using DH key exchange improves forward secrecy at the expense of
++ computational resources (both on the server and on the client).
++ The *dhfile* parameter should be the path to a file containing DH
++ parameters in PEM format.
++
++ This setting doesn't apply to client sockets. You can also use the
++ :data:`OP_SINGLE_DH_USE` option to further improve security.
++
++.. method:: SSLContext.set_ecdh_curve(curve_name)
++
++ Set the curve name for Elliptic Curve-based Diffie-Hellman (ECDH) key
++ exchange. ECDH is significantly faster than regular DH while arguably
++ as secure. The *curve_name* parameter should be a string describing
++ a well-known elliptic curve, for example ``prime256v1`` for a widely
++ supported curve.
++
++ This setting doesn't apply to client sockets. You can also use the
++ :data:`OP_SINGLE_ECDH_USE` option to further improve security.
++
++ This method is not available if :data:`HAS_ECDH` is False.
++
++ .. seealso::
++ `SSL/TLS & Perfect Forward Secrecy
<
http://vincent.bernat.im/en/blog/2011-ssl-perfect-forward-secrecy.html>`_
++ Vincent Bernat.
++
++.. method:: SSLContext.wrap_socket(sock, server_side=False, \
++ do_handshake_on_connect=True, suppress_ragged_eofs=True, \
++ server_hostname=None)
++
++ Wrap an existing Python socket *sock* and return an :class:`SSLSocket`
++ object. *sock* must be a :data:`~socket.SOCK_STREAM` socket; other socket
++ types are unsupported.
++
++ The returned SSL socket is tied to the context, its settings and
++ certificates. The parameters *server_side*, *do_handshake_on_connect*
++ and *suppress_ragged_eofs* have the same meaning as in the top-level
++ :func:`wrap_socket` function.
++
++ On client connections, the optional parameter *server_hostname* specifies
++ the hostname of the service which we are connecting to. This allows a
++ single server to host multiple SSL-based services with distinct certificates,
++ quite similarly to HTTP virtual hosts. Specifying *server_hostname*
++ will raise a :exc:`ValueError` if the OpenSSL library doesn't have support
++ for it (that is, if :data:`HAS_SNI` is :const:`False`). Specifying
++ *server_hostname* will also raise a :exc:`ValueError` if *server_side*
++ is true.
++
++.. method:: SSLContext.session_stats()
++
++ Get statistics about the SSL sessions created or managed by this context.
++ A dictionary is returned which maps the names of each `piece of information
++ <
http://www.openssl.org/docs/ssl/SSL_CTX_sess_number.html>`_ to their
++ numeric values. For example, here is the total number of hits and misses
++ in the session cache since the context was created::
++
++ >>> stats = context.session_stats()
++ >>> stats['hits'], stats['misses']
++ (0, 0)
++
++.. method:: SSLContext.get_ca_certs(binary_form=False)
++
++ Returns a list of dicts with information of loaded CA certs. If the
++ optional argument is true, returns a DER-encoded copy of the CA
++ certificate.
++
++ .. note::
++ Certificates in a capath directory aren't loaded unless they have
++ been used at least once.
++
++.. attribute:: SSLContext.check_hostname
++
++ Wether to match the peer cert's hostname with :func:`match_hostname` in
++ :meth:`SSLSocket.do_handshake`. The context's
++ :attr:`~SSLContext.verify_mode` must be set to :data:`CERT_OPTIONAL` or
++ :data:`CERT_REQUIRED`, and you must pass *server_hostname* to
++ :meth:`~SSLContext.wrap_socket` in order to match the hostname.
++
++ Example::
++
++ import socket, ssl
++
++ context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ context.verify_mode = ssl.CERT_REQUIRED
++ context.check_hostname = True
++ context.load_default_certs()
++
++ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
++ ssl_sock = context.wrap_socket(s, server_hostname='www.verisign.com')
++ ssl_sock.connect(('www.verisign.com', 443))
++
++ .. note::
++
++ This features requires OpenSSL 0.9.8f or newer.
++
++.. attribute:: SSLContext.options
++
++ An integer representing the set of SSL options enabled on this context.
++ The default value is :data:`OP_ALL`, but you can specify other options
++ such as :data:`OP_NO_SSLv2` by ORing them together.
++
++ .. note::
++ With versions of OpenSSL older than 0.9.8m, it is only possible
++ to set options, not to clear them. Attempting to clear an option
++ (by resetting the corresponding bits) will raise a ``ValueError``.
++
++.. attribute:: SSLContext.protocol
++
++ The protocol version chosen when constructing the context. This attribute
++ is read-only.
++
++.. attribute:: SSLContext.verify_flags
++
++ The flags for certificate verification operations. You can set flags like
++ :data:`VERIFY_CRL_CHECK_LEAF` by ORing them together. By default OpenSSL
++ does neither require nor verify certificate revocation lists (CRLs).
++ Available only with openssl version 0.9.8+.
++
++.. attribute:: SSLContext.verify_mode
++
++ Whether to try to verify other peers' certificates and how to behave
++ if verification fails. This attribute must be one of
++ :data:`CERT_NONE`, :data:`CERT_OPTIONAL` or :data:`CERT_REQUIRED`.
++
+
+ .. index:: single: certificates
+
+@@ -460,6 +1258,9 @@ and a footer line::
+ ... (certificate in base64 PEM encoding) ...
+ -----END CERTIFICATE-----
+
++Certificate chains
++^^^^^^^^^^^^^^^^^^
++
+ The Python files which contain certificates can contain a sequence of
+ certificates, sometimes called a *certificate chain*. This chain should start
+ with the specific certificate for the principal who "is" the client or
server,
+@@ -483,24 +1284,35 @@ certification authority's certificate::
+ ... (the root certificate for the CA's issuer)...
+ -----END CERTIFICATE-----
+
++CA certificates
++^^^^^^^^^^^^^^^
++
+ If you are going to require validation of the other side of the connection's
+ certificate, you need to provide a "CA certs" file, filled with the
certificate
+ chains for each issuer you are willing to trust. Again, this file just contains
+ these chains concatenated together. For validation, Python will use the first
+-chain it finds in the file which matches.
++chain it finds in the file which matches. The platform's certificates file can
++be used by calling :meth:`SSLContext.load_default_certs`, this is done
++automatically with :func:`.create_default_context`.
++
++Combined key and certificate
++^^^^^^^^^^^^^^^^^^^^^^^^^^^^
++
++Often the private key is stored in the same file as the certificate; in this
++case, only the ``certfile`` parameter to :meth:`SSLContext.load_cert_chain`
++and :func:`wrap_socket` needs to be passed. If the private key is stored
++with the certificate, it should come before the first certificate in
++the certificate chain::
+
+-Some "standard" root certificates are available from various certification
+-authorities: `Thawte <
http://www.thawte.com/roots/>`_, `Verisign
+-<http://www.verisign.com/support/roots.html>`_, `Positive SSL
+-<http://www.PositiveSSL.com/ssl-certificate-support/cert_installation/UTN-USERFirst-Hardware.crt>`_
+-(used by
python.org), `Equifax and GeoTrust
+-<http://www.geotrust.com/resources/root_certificates/index.asp>`_.
++ -----BEGIN RSA PRIVATE KEY-----
++ ... (private key in base64 encoding) ...
++ -----END RSA PRIVATE KEY-----
++ -----BEGIN CERTIFICATE-----
++ ... (certificate in base64 PEM encoding) ...
++ -----END CERTIFICATE-----
+
+-In general, if you are using SSL3 or TLS1, you don't need to put the full chain
+-in your "CA certs" file; you only need the root certificates, and the remote
+-peer is supposed to furnish the other certificates necessary to chain from its
+-certificate to a root certificate. See :rfc:`4158` for more discussion of the
+-way in which certification chains can be built.
++Self-signed certificates
++^^^^^^^^^^^^^^^^^^^^^^^^
+
+ If you are going to create a server that provides SSL-encrypted connection
+ services, you will need to acquire a certificate for that service. There are
+@@ -555,87 +1367,156 @@ should use the following idiom::
+ Client-side operation
+ ^^^^^^^^^^^^^^^^^^^^^
+
+-This example connects to an SSL server, prints the server's address and
+-certificate, sends some bytes, and reads part of the response::
++This example connects to an SSL server and prints the server's certificate::
+
+ import socket, ssl, pprint
+
+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+-
+ # require a certificate from the server
+ ssl_sock = ssl.wrap_socket(s,
+ ca_certs="/etc/ca_certs_file",
+ cert_reqs=ssl.CERT_REQUIRED)
+-
+ ssl_sock.connect(('www.verisign.com', 443))
+
+- print repr(ssl_sock.getpeername())
+- print ssl_sock.cipher()
+- print pprint.pformat(ssl_sock.getpeercert())
+-
+- # Set a simple HTTP request -- use httplib in actual code.
+- ssl_sock.write("""GET / HTTP/1.0\r
+- Host:
www.verisign.com\r\n\r\n""")
+-
+- # Read a chunk of data. Will not necessarily
+- # read all the data returned by the server.
+- data = ssl_sock.read()
+-
++ pprint.pprint(ssl_sock.getpeercert())
+ # note that closing the SSLSocket will also close the underlying socket
+ ssl_sock.close()
+
+-As of September 6, 2007, the certificate printed by this program looked like
++As of January 6, 2012, the certificate printed by this program looks like
+ this::
+
+- {'notAfter': 'May 8 23:59:59 2009 GMT',
+- 'subject': ((('serialNumber', u'2497886'),),
+- (('1.3.6.1.4.1.311.60.2.1.3', u'US'),),
+- (('1.3.6.1.4.1.311.60.2.1.2', u'Delaware'),),
+- (('countryName', u'US'),),
+- (('postalCode', u'94043'),),
+- (('stateOrProvinceName', u'California'),),
+- (('localityName', u'Mountain View'),),
+- (('streetAddress', u'487 East Middlefield Road'),),
+- (('organizationName', u'VeriSign, Inc.'),),
+- (('organizationalUnitName',
+- u'Production Security Services'),),
+- (('organizationalUnitName',
+- u'Terms of use at
www.verisign.com/rpa (c)06'),),
+- (('commonName', u'www.verisign.com'),))}
+-
+-which is a fairly poorly-formed ``subject`` field.
++ {'issuer': ((('countryName', 'US'),),
++ (('organizationName', 'VeriSign, Inc.'),),
++ (('organizationalUnitName', 'VeriSign Trust Network'),),
++ (('organizationalUnitName',
++ 'Terms of use at
https://www.verisign.com/rpa (c)06'),),
++ (('commonName',
++ 'VeriSign Class 3 Extended Validation SSL SGC CA'),)),
++ 'notAfter': 'May 25 23:59:59 2012 GMT',
++ 'notBefore': 'May 26 00:00:00 2010 GMT',
++ 'serialNumber': '53D2BEF924A7245E83CA01E46CAA2477',
++ 'subject': ((('1.3.6.1.4.1.311.60.2.1.3', 'US'),),
++ (('1.3.6.1.4.1.311.60.2.1.2', 'Delaware'),),
++ (('businessCategory', 'V1.0, Clause 5.(b)'),),
++ (('serialNumber', '2497886'),),
++ (('countryName', 'US'),),
++ (('postalCode', '94043'),),
++ (('stateOrProvinceName', 'California'),),
++ (('localityName', 'Mountain View'),),
++ (('streetAddress', '487 East Middlefield Road'),),
++ (('organizationName', 'VeriSign, Inc.'),),
++ (('organizationalUnitName', ' Production Security
Services'),),
++ (('commonName', 'www.verisign.com'),)),
++ 'subjectAltName': (('DNS', 'www.verisign.com'),
++ ('DNS', 'verisign.com'),
++ ('DNS', 'www.verisign.net'),
++ ('DNS', 'verisign.net'),
++ ('DNS', 'www.verisign.mobi'),
++ ('DNS', 'verisign.mobi'),
++ ('DNS', 'www.verisign.eu'),
++ ('DNS', 'verisign.eu')),
++ 'version': 3}
++
++This other example first creates an SSL context, instructs it to verify
++certificates sent by peers, and feeds it a set of recognized certificate
++authorities (CA)::
++
++ >>> context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
++ >>> context.verify_mode = ssl.CERT_REQUIRED
++ >>> context.load_verify_locations("/etc/ssl/certs/ca-bundle.crt")
++
++(it is assumed your operating system places a bundle of all CA certificates
++in ``/etc/ssl/certs/ca-bundle.crt``; if not, you'll get an error and have
++to adjust the location)
++
++When you use the context to connect to a server, :const:`CERT_REQUIRED`
++validates the server certificate: it ensures that the server certificate
++was signed with one of the CA certificates, and checks the signature for
++correctness::
++
++ >>> conn = context.wrap_socket(socket.socket(socket.AF_INET))
++ >>> conn.connect(("linuxfr.org", 443))
++
++You should then fetch the certificate and check its fields for conformity::
++
++ >>> cert = conn.getpeercert()
++ >>> ssl.match_hostname(cert, "linuxfr.org")
++
++Visual inspection shows that the certificate does identify the desired service
++(that is, the HTTPS host ``linuxfr.org``)::
++
++ >>> pprint.pprint(cert)
++ {'issuer': ((('organizationName', 'CAcert Inc.'),),
++ (('organizationalUnitName', 'http://www.CAcert.org'),),
++ (('commonName', 'CAcert Class 3 Root'),)),
++ 'notAfter': 'Jun 7 21:02:24 2013 GMT',
++ 'notBefore': 'Jun 8 21:02:24 2011 GMT',
++ 'serialNumber': 'D3E9',
++ 'subject': ((('commonName', 'linuxfr.org'),),),
++ 'subjectAltName': (('DNS', 'linuxfr.org'),
++ ('othername', '<unsupported>'),
++ ('DNS', 'linuxfr.org'),
++ ('othername', '<unsupported>'),
++ ('DNS', 'dev.linuxfr.org'),
++ ('othername', '<unsupported>'),
++ ('DNS', 'prod.linuxfr.org'),
++ ('othername', '<unsupported>'),
++ ('DNS', 'alpha.linuxfr.org'),
++ ('othername', '<unsupported>'),
++ ('DNS', '*.linuxfr.org'),
++ ('othername', '<unsupported>')),
++ 'version': 3}
++
++Now that you are assured of its authenticity, you can proceed to talk with
++the server::
++
++ >>> conn.sendall(b"HEAD / HTTP/1.0\r\nHost: linuxfr.org\r\n\r\n")
++ >>> pprint.pprint(conn.recv(1024).split(b"\r\n"))
++ [b'HTTP/1.1 302 Found',
++ b'Date: Sun, 16 May 2010 13:43:28 GMT',
++ b'Server: Apache/2.2',
++ b'Location:
https://linuxfr.org/pub/';,
++ b'Vary: Accept-Encoding',
++ b'Connection: close',
++ b'Content-Type: text/html; charset=iso-8859-1',
++ b'',
++ b'']
++
++See the discussion of :ref:`ssl-security` below.
++
+
+ Server-side operation
+ ^^^^^^^^^^^^^^^^^^^^^
+
+-For server operation, typically you'd need to have a server certificate, and
+-private key, each in a file. You'd open a socket, bind it to a port, call
+-:meth:`listen` on it, then start waiting for clients to connect::
++For server operation, typically you'll need to have a server certificate, and
++private key, each in a file. You'll first create a context holding the key
++and the certificate, so that clients can check your authenticity. Then
++you'll open a socket, bind it to a port, call :meth:`listen` on it, and start
++waiting for clients to connect::
+
+ import socket, ssl
+
++ context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
++ context.load_cert_chain(certfile="mycertfile",
keyfile="mykeyfile")
++
+ bindsocket = socket.socket()
+ bindsocket.bind(('myaddr.mydomain.com', 10023))
+ bindsocket.listen(5)
+
+-When one did, you'd call :meth:`accept` on the socket to get the new socket from
+-the other end, and use :func:`wrap_socket` to create a server-side SSL context
+-for it::
++When a client connects, you'll call :meth:`accept` on the socket to get the
++new socket from the other end, and use the context's :meth:`SSLContext.wrap_socket`
++method to create a server-side SSL socket for the connection::
+
+ while True:
+ newsocket, fromaddr = bindsocket.accept()
+- connstream = ssl.wrap_socket(newsocket,
+- server_side=True,
+- certfile="mycertfile",
+- keyfile="mykeyfile",
+- ssl_version=ssl.PROTOCOL_TLSv1)
++ connstream = context.wrap_socket(newsocket, server_side=True)
+ try:
+ deal_with_client(connstream)
+ finally:
+ connstream.shutdown(socket.SHUT_RDWR)
+ connstream.close()
+
+-Then you'd read data from the ``connstream`` and do something with it till you
++Then you'll read data from the ``connstream`` and do something with it till you
+ are finished with the client (or the client is finished with you)::
+
+ def deal_with_client(connstream):
+@@ -649,7 +1530,138 @@ are finished with the client (or the client is finished with
you)::
+ data = connstream.read()
+ # finished with client
+
+-And go back to listening for new client connections.
++And go back to listening for new client connections (of course, a real server
++would probably handle each client connection in a separate thread, or put
++the sockets in non-blocking mode and use an event loop).
++
++
++.. _ssl-nonblocking:
++
++Notes on non-blocking sockets
++-----------------------------
++
++When working with non-blocking sockets, there are several things you need
++to be aware of:
++
++- Calling :func:`~select.select` tells you that the OS-level socket can be
++ read from (or written to), but it does not imply that there is sufficient
++ data at the upper SSL layer. For example, only part of an SSL frame might
++ have arrived. Therefore, you must be ready to handle :meth:`SSLSocket.recv`
++ and :meth:`SSLSocket.send` failures, and retry after another call to
++ :func:`~select.select`.
++
++- Conversely, since the SSL layer has its own framing, a SSL socket may
++ still have data available for reading without :func:`~select.select`
++ being aware of it. Therefore, you should first call
++ :meth:`SSLSocket.recv` to drain any potentially available data, and then
++ only block on a :func:`~select.select` call if still necessary.
++
++ (of course, similar provisions apply when using other primitives such as
++ :func:`~select.poll`, or those in the :mod:`selectors` module)
++
++- The SSL handshake itself will be non-blocking: the
++ :meth:`SSLSocket.do_handshake` method has to be retried until it returns
++ successfully. Here is a synopsis using :func:`~select.select` to wait for
++ the socket's readiness::
++
++ while True:
++ try:
++ sock.do_handshake()
++ break
++ except ssl.SSLWantReadError:
++ select.select([sock], [], [])
++ except ssl.SSLWantWriteError:
++ select.select([], [sock], [])
++
++
++.. _ssl-security:
++
++Security considerations
++-----------------------
++
++Best defaults
++^^^^^^^^^^^^^
++
++For **client use**, if you don't have any special requirements for your
++security policy, it is highly recommended that you use the
++:func:`create_default_context` function to create your SSL context.
++It will load the system's trusted CA certificates, enable certificate
++validation and hostname checking, and try to choose reasonably secure
++protocol and cipher settings.
++
++If a client certificate is needed for the connection, it can be added with
++:meth:`SSLContext.load_cert_chain`.
++
++By contrast, if you create the SSL context by calling the :class:`SSLContext`
++constructor yourself, it will not have certificate validation nor hostname
++checking enabled by default. If you do so, please read the paragraphs below
++to achieve a good security level.
++
++Manual settings
++^^^^^^^^^^^^^^^
++
++Verifying certificates
++''''''''''''''''''''''
++
++When calling the :class:`SSLContext` constructor directly,
++:const:`CERT_NONE` is the default. Since it does not authenticate the other
++peer, it can be insecure, especially in client mode where most of time you
++would like to ensure the authenticity of the server you're talking to.
++Therefore, when in client mode, it is highly recommended to use
++:const:`CERT_REQUIRED`. However, it is in itself not sufficient; you also
++have to check that the server certificate, which can be obtained by calling
++:meth:`SSLSocket.getpeercert`, matches the desired service. For many
++protocols and applications, the service can be identified by the hostname;
++in this case, the :func:`match_hostname` function can be used. This common
++check is automatically performed when :attr:`SSLContext.check_hostname` is
++enabled.
++
++In server mode, if you want to authenticate your clients using the SSL layer
++(rather than using a higher-level authentication mechanism), you'll also have
++to specify :const:`CERT_REQUIRED` and similarly check the client certificate.
++
++ .. note::
++
++ In client mode, :const:`CERT_OPTIONAL` and :const:`CERT_REQUIRED` are
++ equivalent unless anonymous ciphers are enabled (they are disabled
++ by default).
++
++Protocol versions
++'''''''''''''''''
++
++SSL version 2 is considered insecure and is therefore dangerous to use. If
++you want maximum compatibility between clients and servers, it is recommended
++to use :const:`PROTOCOL_SSLv23` as the protocol version and then disable
++SSLv2 explicitly using the :data:`SSLContext.options` attribute::
++
++ context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
++ context.options |= ssl.OP_NO_SSLv2
++
++The SSL context created above will allow SSLv3 and TLSv1 (and later, if
++supported by your system) connections, but not SSLv2.
++
++Cipher selection
++''''''''''''''''
++
++If you have advanced security requirements, fine-tuning of the ciphers
++enabled when negotiating a SSL session is possible through the
++:meth:`SSLContext.set_ciphers` method. Starting from Python 2.7.9, the
++ssl module disables certain weak ciphers by default, but you may want
++to further restrict the cipher choice. Be sure to read OpenSSL's documentation
++about the `cipher list format
<
http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT>`_.
++If you want to check which ciphers are enabled by a given cipher list, use the
++``openssl ciphers`` command on your system.
++
++Multi-processing
++^^^^^^^^^^^^^^^^
++
++If using this module as part of a multi-processed application (using,
++for example the :mod:`multiprocessing` or :mod:`concurrent.futures` modules),
++be aware that OpenSSL's internal random number generator does not properly
++handle forked processes. Applications must change the PRNG state of the
++parent process if they use any SSL feature with :func:`os.fork`. Any
++successful call of :func:`~ssl.RAND_add`, :func:`~ssl.RAND_bytes` or
++:func:`~ssl.RAND_pseudo_bytes` is sufficient.
+
+
+ .. seealso::
+@@ -668,3 +1680,15 @@ And go back to listening for new client connections.
+
+ `RFC 3280: Internet X.509 Public Key Infrastructure Certificate and CRL Profile
<
http://www.ietf.org/rfc/rfc3280>`_
+ Housley et. al.
++
++ `RFC 4366: Transport Layer Security (TLS) Extensions
<
http://www.ietf.org/rfc/rfc4366>`_
++ Blake-Wilson et. al.
++
++ `RFC 5246: The Transport Layer Security (TLS) Protocol Version 1.2
<
http://www.ietf.org/rfc/rfc5246>`_
++ T. Dierks et. al.
++
++ `RFC 6066: Transport Layer Security (TLS) Extensions
<
http://www.ietf.org/rfc/rfc6066>`_
++ D. Eastlake
++
++ `IANA TLS: Transport Layer Security (TLS) Parameters
<
http://www.iana.org/assignments/tls-parameters/tls-parameters.xml>`_
++ IANA
+diff --git a/Lib/ssl.py b/Lib/ssl.py
+index 666cea3..882b60e 100644
+--- a/Lib/ssl.py
++++ b/Lib/ssl.py
+@@ -1,8 +1,7 @@
+ # Wrapper module for _ssl, providing some additional facilities
+ # implemented in Python. Written by Bill Janssen.
+
+-"""\
+-This module provides some more Pythonic support for SSL.
++"""This module provides some more Pythonic support for SSL.
+
+ Object types:
+
+@@ -53,62 +52,461 @@ PROTOCOL_SSLv2
+ PROTOCOL_SSLv3
+ PROTOCOL_SSLv23
+ PROTOCOL_TLSv1
++PROTOCOL_TLSv1_1
++PROTOCOL_TLSv1_2
++
++The following constants identify various SSL alert message descriptions as per
++http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-6
++
++ALERT_DESCRIPTION_CLOSE_NOTIFY
++ALERT_DESCRIPTION_UNEXPECTED_MESSAGE
++ALERT_DESCRIPTION_BAD_RECORD_MAC
++ALERT_DESCRIPTION_RECORD_OVERFLOW
++ALERT_DESCRIPTION_DECOMPRESSION_FAILURE
++ALERT_DESCRIPTION_HANDSHAKE_FAILURE
++ALERT_DESCRIPTION_BAD_CERTIFICATE
++ALERT_DESCRIPTION_UNSUPPORTED_CERTIFICATE
++ALERT_DESCRIPTION_CERTIFICATE_REVOKED
++ALERT_DESCRIPTION_CERTIFICATE_EXPIRED
++ALERT_DESCRIPTION_CERTIFICATE_UNKNOWN
++ALERT_DESCRIPTION_ILLEGAL_PARAMETER
++ALERT_DESCRIPTION_UNKNOWN_CA
++ALERT_DESCRIPTION_ACCESS_DENIED
++ALERT_DESCRIPTION_DECODE_ERROR
++ALERT_DESCRIPTION_DECRYPT_ERROR
++ALERT_DESCRIPTION_PROTOCOL_VERSION
++ALERT_DESCRIPTION_INSUFFICIENT_SECURITY
++ALERT_DESCRIPTION_INTERNAL_ERROR
++ALERT_DESCRIPTION_USER_CANCELLED
++ALERT_DESCRIPTION_NO_RENEGOTIATION
++ALERT_DESCRIPTION_UNSUPPORTED_EXTENSION
++ALERT_DESCRIPTION_CERTIFICATE_UNOBTAINABLE
++ALERT_DESCRIPTION_UNRECOGNIZED_NAME
++ALERT_DESCRIPTION_BAD_CERTIFICATE_STATUS_RESPONSE
++ALERT_DESCRIPTION_BAD_CERTIFICATE_HASH_VALUE
++ALERT_DESCRIPTION_UNKNOWN_PSK_IDENTITY
+ """
+
+ import textwrap
++import re
++import sys
++import os
++from collections import namedtuple
++from contextlib import closing
+
+ import _ssl # if we can't import it, let the error propagate
+
+ from _ssl import OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_INFO, OPENSSL_VERSION
+-from _ssl import SSLError
++from _ssl import _SSLContext
++from _ssl import (
++ SSLError, SSLZeroReturnError, SSLWantReadError, SSLWantWriteError,
++ SSLSyscallError, SSLEOFError,
++ )
+ from _ssl import CERT_NONE, CERT_OPTIONAL, CERT_REQUIRED
++from _ssl import (VERIFY_DEFAULT, VERIFY_CRL_CHECK_LEAF, VERIFY_CRL_CHECK_CHAIN,
++ VERIFY_X509_STRICT)
++from _ssl import txt2obj as _txt2obj, nid2obj as _nid2obj
+ from _ssl import RAND_status, RAND_egd, RAND_add
+-from _ssl import \
+- SSL_ERROR_ZERO_RETURN, \
+- SSL_ERROR_WANT_READ, \
+- SSL_ERROR_WANT_WRITE, \
+- SSL_ERROR_WANT_X509_LOOKUP, \
+- SSL_ERROR_SYSCALL, \
+- SSL_ERROR_SSL, \
+- SSL_ERROR_WANT_CONNECT, \
+- SSL_ERROR_EOF, \
+- SSL_ERROR_INVALID_ERROR_CODE
+-from _ssl import PROTOCOL_SSLv3, PROTOCOL_SSLv23, PROTOCOL_TLSv1
+-_PROTOCOL_NAMES = {
+- PROTOCOL_TLSv1: "TLSv1",
+- PROTOCOL_SSLv23: "SSLv23",
+- PROTOCOL_SSLv3: "SSLv3",
+-}
++
++def _import_symbols(prefix):
++ for n in dir(_ssl):
++ if n.startswith(prefix):
++ globals()[n] = getattr(_ssl, n)
++
++_import_symbols('OP_')
++_import_symbols('ALERT_DESCRIPTION_')
++_import_symbols('SSL_ERROR_')
++_import_symbols('PROTOCOL_')
++
++from _ssl import HAS_SNI, HAS_ECDH, HAS_NPN
++
++from _ssl import _OPENSSL_API_VERSION
++
++_PROTOCOL_NAMES = {value: name for name, value in globals().items() if
name.startswith('PROTOCOL_')}
++
+ try:
+- from _ssl import PROTOCOL_SSLv2
+ _SSLv2_IF_EXISTS = PROTOCOL_SSLv2
+-except ImportError:
++except NameError:
+ _SSLv2_IF_EXISTS = None
+-else:
+- _PROTOCOL_NAMES[PROTOCOL_SSLv2] = "SSLv2"
+
+ from socket import socket, _fileobject, _delegate_methods, error as socket_error
+-from socket import getnameinfo as _getnameinfo
+-from socket import SOL_SOCKET, SO_TYPE, SOCK_STREAM
++if sys.platform == "win32":
++ from _ssl import enum_certificates, enum_crls
++
++from socket import socket, AF_INET, SOCK_STREAM, create_connection
++from socket import SOL_SOCKET, SO_TYPE
+ import base64 # for DER-to-PEM translation
+ import errno
+
++if _ssl.HAS_TLS_UNIQUE:
++ CHANNEL_BINDING_TYPES = ['tls-unique']
++else:
++ CHANNEL_BINDING_TYPES = []
++
+ # Disable weak or insecure ciphers by default
+ # (OpenSSL's default setting is 'DEFAULT:!aNULL:!eNULL')
+-_DEFAULT_CIPHERS = 'DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2'
+-
++# Enable a better set of ciphers by default
++# This list has been explicitly chosen to:
++# * Prefer cipher suites that offer perfect forward secrecy (DHE/ECDHE)
++# * Prefer ECDHE over DHE for better performance
++# * Prefer any AES-GCM over any AES-CBC for better performance and security
++# * Then Use HIGH cipher suites as a fallback
++# * Then Use 3DES as fallback which is secure but slow
++# * Finally use RC4 as a fallback which is problematic but needed for
++# compatibility some times.
++# * Disable NULL authentication, NULL encryption, and MD5 MACs for security
++# reasons
++_DEFAULT_CIPHERS = (
++ 'ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+HIGH:'
++ 'DH+HIGH:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+HIGH:RSA+3DES:ECDH+RC4:'
++ 'DH+RC4:RSA+RC4:!aNULL:!eNULL:!MD5'
++)
++
++# Restricted and more secure ciphers for the server side
++# This list has been explicitly chosen to:
++# * Prefer cipher suites that offer perfect forward secrecy (DHE/ECDHE)
++# * Prefer ECDHE over DHE for better performance
++# * Prefer any AES-GCM over any AES-CBC for better performance and security
++# * Then Use HIGH cipher suites as a fallback
++# * Then Use 3DES as fallback which is secure but slow
++# * Disable NULL authentication, NULL encryption, MD5 MACs, DSS, and RC4 for
++# security reasons
++_RESTRICTED_SERVER_CIPHERS = (
++ 'ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+HIGH:'
++ 'DH+HIGH:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+HIGH:RSA+3DES:!aNULL:'
++ '!eNULL:!MD5:!DSS:!RC4'
++)
++
++
++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
++
++ pieces = dn.split(r'.')
++ leftmost = pieces[0]
++ remainder = pieces[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, match_hostname needs a "
++ "SSL socket or SSL context with either "
++ "CERT_OPTIONAL or CERT_REQUIRED")
++ 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")
++
++
++DefaultVerifyPaths = namedtuple("DefaultVerifyPaths",
++ "cafile capath openssl_cafile_env openssl_cafile openssl_capath_env "
++ "openssl_capath")
++
++def get_default_verify_paths():
++ """Return paths to default cafile and capath.
++ """
++ parts = _ssl.get_default_verify_paths()
++
++ # environment vars shadow paths
++ cafile = os.environ.get(parts[0], parts[1])
++ capath = os.environ.get(parts[2], parts[3])
++
++ return DefaultVerifyPaths(cafile if os.path.isfile(cafile) else None,
++ capath if os.path.isdir(capath) else None,
++ *parts)
++
++
++class _ASN1Object(namedtuple("_ASN1Object", "nid shortname longname
oid")):
++ """ASN.1 object identifier lookup
++ """
++ __slots__ = ()
++
++ def __new__(cls, oid):
++ return super(_ASN1Object, cls).__new__(cls, *_txt2obj(oid, name=False))
++
++ @classmethod
++ def fromnid(cls, nid):
++ """Create _ASN1Object from OpenSSL numeric ID
++ """
++ return super(_ASN1Object, cls).__new__(cls, *_nid2obj(nid))
++
++ @classmethod
++ def fromname(cls, name):
++ """Create _ASN1Object from short name, long name or OID
++ """
++ return super(_ASN1Object, cls).__new__(cls, *_txt2obj(name, name=True))
++
++
++class Purpose(_ASN1Object):
++ """SSLContext purpose flags with X509v3 Extended Key Usage objects
++ """
++
++Purpose.SERVER_AUTH = Purpose('1.3.6.1.5.5.7.3.1')
++Purpose.CLIENT_AUTH = Purpose('1.3.6.1.5.5.7.3.2')
++
++
++class SSLContext(_SSLContext):
++ """An SSLContext holds various SSL-related configuration options and
++ data, such as certificates and possibly a private key."""
++
++ __slots__ = ('protocol', '__weakref__')
++ _windows_cert_stores = ("CA", "ROOT")
++
++ def __new__(cls, protocol, *args, **kwargs):
++ self = _SSLContext.__new__(cls, protocol)
++ if protocol != _SSLv2_IF_EXISTS:
++ self.set_ciphers(_DEFAULT_CIPHERS)
++ return self
++
++ def __init__(self, protocol):
++ self.protocol = protocol
++
++ def wrap_socket(self, sock, server_side=False,
++ do_handshake_on_connect=True,
++ suppress_ragged_eofs=True,
++ server_hostname=None):
++ return SSLSocket(sock=sock, server_side=server_side,
++ do_handshake_on_connect=do_handshake_on_connect,
++ suppress_ragged_eofs=suppress_ragged_eofs,
++ server_hostname=server_hostname,
++ _context=self)
++
++ def set_npn_protocols(self, npn_protocols):
++ protos = bytearray()
++ for protocol in npn_protocols:
++ b = protocol.encode('ascii')
++ if len(b) == 0 or len(b) > 255:
++ raise SSLError('NPN protocols must be 1 to 255 in length')
++ protos.append(len(b))
++ protos.extend(b)
++
++ self._set_npn_protocols(protos)
++
++ def _load_windows_store_certs(self, storename, purpose):
++ certs = bytearray()
++ for cert, encoding, trust in enum_certificates(storename):
++ # CA certs are never PKCS#7 encoded
++ if encoding == "x509_asn":
++ if trust is True or purpose.oid in trust:
++ certs.extend(cert)
++ self.load_verify_locations(cadata=certs)
++ return certs
++
++ def load_default_certs(self, purpose=Purpose.SERVER_AUTH):
++ if not isinstance(purpose, _ASN1Object):
++ raise TypeError(purpose)
++ if sys.platform == "win32":
++ for storename in self._windows_cert_stores:
++ self._load_windows_store_certs(storename, purpose)
++ else:
++ self.set_default_verify_paths()
++
++
++def create_default_context(purpose=Purpose.SERVER_AUTH, cafile=None,
++ capath=None, cadata=None):
++ """Create a SSLContext object with default settings.
++
++ NOTE: The protocol and settings may change anytime without prior
++ deprecation. The values represent a fair balance between maximum
++ compatibility and security.
++ """
++ if not isinstance(purpose, _ASN1Object):
++ raise TypeError(purpose)
++
++ context = SSLContext(PROTOCOL_SSLv23)
++
++ # SSLv2 considered harmful.
++ context.options |= OP_NO_SSLv2
++
++ # SSLv3 has problematic security and is only required for really old
++ # clients such as IE6 on Windows XP
++ context.options |= OP_NO_SSLv3
++
++ # disable compression to prevent CRIME attacks (OpenSSL 1.0+)
++ context.options |= getattr(_ssl, "OP_NO_COMPRESSION", 0)
++
++ if purpose == Purpose.SERVER_AUTH:
++ # verify certs and host name in client mode
++ context.verify_mode = CERT_REQUIRED
++ context.check_hostname = True
++ elif purpose == Purpose.CLIENT_AUTH:
++ # Prefer the server's ciphers by default so that we get stronger
++ # encryption
++ context.options |= getattr(_ssl, "OP_CIPHER_SERVER_PREFERENCE", 0)
++
++ # Use single use keys in order to improve forward secrecy
++ context.options |= getattr(_ssl, "OP_SINGLE_DH_USE", 0)
++ context.options |= getattr(_ssl, "OP_SINGLE_ECDH_USE", 0)
++
++ # disallow ciphers with known vulnerabilities
++ context.set_ciphers(_RESTRICTED_SERVER_CIPHERS)
++
++ if cafile or capath or cadata:
++ context.load_verify_locations(cafile, capath, cadata)
++ elif context.verify_mode != CERT_NONE:
++ # no explicit cafile, capath or cadata but the verify mode is
++ # CERT_OPTIONAL or CERT_REQUIRED. Let's try to load default system
++ # root CA certificates for the given purpose. This may fail silently.
++ context.load_default_certs(purpose)
++ return context
++
++
++def _create_stdlib_context(protocol=PROTOCOL_SSLv23, cert_reqs=None,
++ check_hostname=False, purpose=Purpose.SERVER_AUTH,
++ certfile=None, keyfile=None,
++ cafile=None, capath=None, cadata=None):
++ """Create a SSLContext object for Python stdlib modules
++
++ All Python stdlib modules shall use this function to create SSLContext
++ objects in order to keep common settings in one place. The configuration
++ is less restrict than create_default_context()'s to increase backward
++ compatibility.
++ """
++ if not isinstance(purpose, _ASN1Object):
++ raise TypeError(purpose)
++
++ context = SSLContext(protocol)
++ # SSLv2 considered harmful.
++ context.options |= OP_NO_SSLv2
++
++ if cert_reqs is not None:
++ context.verify_mode = cert_reqs
++ context.check_hostname = check_hostname
++
++ if keyfile and not certfile:
++ raise ValueError("certfile must be specified")
++ if certfile or keyfile:
++ context.load_cert_chain(certfile, keyfile)
++
++ # load CA root certs
++ if cafile or capath or cadata:
++ context.load_verify_locations(cafile, capath, cadata)
++ elif context.verify_mode != CERT_NONE:
++ # no explicit cafile, capath or cadata but the verify mode is
++ # CERT_OPTIONAL or CERT_REQUIRED. Let's try to load default system
++ # root CA certificates for the given purpose. This may fail silently.
++ context.load_default_certs(purpose)
++
++ return context
+
+ class SSLSocket(socket):
+-
+ """This class implements a subtype of socket.socket that wraps
+ the underlying OS socket in an SSL context when necessary, and
+ provides read and write methods over that channel."""
+
+- def __init__(self, sock, keyfile=None, certfile=None,
++ def __init__(self, sock=None, keyfile=None, certfile=None,
+ server_side=False, cert_reqs=CERT_NONE,
+ ssl_version=PROTOCOL_SSLv23, ca_certs=None,
+ do_handshake_on_connect=True,
+- suppress_ragged_eofs=True, ciphers=None):
++ family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None,
++ suppress_ragged_eofs=True, npn_protocols=None, ciphers=None,
++ server_hostname=None,
++ _context=None):
++
++ if _context:
++ self._context = _context
++ else:
++ if server_side and not certfile:
++ raise ValueError("certfile must be specified for server-side
"
++ "operations")
++ if keyfile and not certfile:
++ raise ValueError("certfile must be specified")
++ if certfile and not keyfile:
++ keyfile = certfile
++ self._context = SSLContext(ssl_version)
++ self._context.verify_mode = cert_reqs
++ if ca_certs:
++ self._context.load_verify_locations(ca_certs)
++ if certfile:
++ self._context.load_cert_chain(certfile, keyfile)
++ if npn_protocols:
++ self._context.set_npn_protocols(npn_protocols)
++ if ciphers:
++ self._context.set_ciphers(ciphers)
++ self.keyfile = keyfile
++ self.certfile = certfile
++ self.cert_reqs = cert_reqs
++ self.ssl_version = ssl_version
++ self.ca_certs = ca_certs
++ self.ciphers = ciphers
+ # Can't use sock.type as other flags (such as SOCK_NONBLOCK) get
+ # mixed in.
+ if sock.getsockopt(SOL_SOCKET, SO_TYPE) != SOCK_STREAM:
+@@ -122,98 +520,161 @@ class SSLSocket(socket):
+ delattr(self, attr)
+ except AttributeError:
+ pass
++ if server_side and server_hostname:
++ raise ValueError("server_hostname can only be specified "
++ "in client mode")
++ if self._context.check_hostname and not server_hostname:
++ if HAS_SNI:
++ raise ValueError("check_hostname requires server_hostname")
++ else:
++ raise ValueError("check_hostname requires server_hostname, "
++ "but it's not supported by your OpenSSL
"
++ "library")
++ self.server_side = server_side
++ self.server_hostname = server_hostname
++ self.do_handshake_on_connect = do_handshake_on_connect
++ self.suppress_ragged_eofs = suppress_ragged_eofs
+
+- if ciphers is None and ssl_version != _SSLv2_IF_EXISTS:
+- ciphers = _DEFAULT_CIPHERS
+-
+- if certfile and not keyfile:
+- keyfile = certfile
+- # see if it's connected
++ # See if we are connected
+ try:
+- socket.getpeername(self)
+- except socket_error, e:
++ self.getpeername()
++ except socket_error as e:
+ if e.errno != errno.ENOTCONN:
+ raise
+- # no, no connection yet
+- self._connected = False
+- self._sslobj = None
++ connected = False
+ else:
+- # yes, create the SSL object
+- self._connected = True
+- self._sslobj = _ssl.sslwrap(self._sock, server_side,
+- keyfile, certfile,
+- cert_reqs, ssl_version, ca_certs,
+- ciphers)
+- if do_handshake_on_connect:
+- self.do_handshake()
+- self.keyfile = keyfile
+- self.certfile = certfile
+- self.cert_reqs = cert_reqs
+- self.ssl_version = ssl_version
+- self.ca_certs = ca_certs
+- self.ciphers = ciphers
+- self.do_handshake_on_connect = do_handshake_on_connect
+- self.suppress_ragged_eofs = suppress_ragged_eofs
++ connected = True
++
++ self._closed = False
++ self._sslobj = None
++ self._connected = connected
++ if connected:
++ # create the SSL object
++ try:
++ self._sslobj = self._context._wrap_socket(self._sock, server_side,
++ server_hostname,
ssl_sock=self)
++ if do_handshake_on_connect:
++ timeout = self.gettimeout()
++ if timeout == 0.0:
++ # non-blocking
++ raise ValueError("do_handshake_on_connect should not be
specified for non-blocking sockets")
++ self.do_handshake()
++
++ except (OSError, ValueError):
++ self.close()
++ raise
+ self._makefile_refs = 0
+
+- def read(self, len=1024):
++ @property
++ def context(self):
++ return self._context
++
++ @context.setter
++ def context(self, ctx):
++ self._context = ctx
++ self._sslobj.context = ctx
++
++ def dup(self):
++ raise NotImplemented("Can't dup() %s instances" %
++ self.__class__.__name__)
++
++ def _checkClosed(self, msg=None):
++ # raise an exception here if you wish to check for spurious closes
++ pass
+
++ def _check_connected(self):
++ if not self._connected:
++ # getpeername() will raise ENOTCONN if the socket is really
++ # not connected; note that we can be connected even without
++ # _connected being set, e.g. if connect() first returned
++ # EAGAIN.
++ self.getpeername()
++
++ def read(self, len=0, buffer=None):
+ """Read up to LEN bytes and return them.
+ Return zero-length string on EOF."""
+
++ self._checkClosed()
++ if not self._sslobj:
++ raise ValueError("Read on closed or unwrapped SSL socket.")
+ try:
+- return self._sslobj.read(len)
+- except SSLError, x:
++ if buffer is not None:
++ v = self._sslobj.read(len, buffer)
++ else:
++ v = self._sslobj.read(len or 1024)
++ return v
++ except SSLError as x:
+ if x.args[0] == SSL_ERROR_EOF and self.suppress_ragged_eofs:
+- return ''
++ if buffer is not None:
++ return 0
++ else:
++ return b''
+ else:
+ raise
+
+ def write(self, data):
+-
+ """Write DATA to the underlying SSL channel. Returns
+ number of bytes of DATA actually transmitted."""
+
++ self._checkClosed()
++ if not self._sslobj:
++ raise ValueError("Write on closed or unwrapped SSL socket.")
+ return self._sslobj.write(data)
+
+ def getpeercert(self, binary_form=False):
+-
+ """Returns a formatted version of the data in the
+ certificate provided by the other end of the SSL channel.
+ Return None if no certificate was provided, {} if a
+ certificate was provided, but not validated."""
+
++ self._checkClosed()
++ self._check_connected()
+ return self._sslobj.peer_certificate(binary_form)
+
+- def cipher(self):
++ def selected_npn_protocol(self):
++ self._checkClosed()
++ if not self._sslobj or not _ssl.HAS_NPN:
++ return None
++ else:
++ return self._sslobj.selected_npn_protocol()
+
++ def cipher(self):
++ self._checkClosed()
+ if not self._sslobj:
+ return None
+ else:
+ return self._sslobj.cipher()
+
++ def compression(self):
++ self._checkClosed()
++ if not self._sslobj:
++ return None
++ else:
++ return self._sslobj.compression()
++
+ def send(self, data, flags=0):
++ self._checkClosed()
+ if self._sslobj:
+ if flags != 0:
+ raise ValueError(
+ "non-zero flags not allowed in calls to send() on %s" %
+ self.__class__)
+- while True:
+- try:
+- v = self._sslobj.write(data)
+- except SSLError, x:
+- if x.args[0] == SSL_ERROR_WANT_READ:
+- return 0
+- elif x.args[0] == SSL_ERROR_WANT_WRITE:
+- return 0
+- else:
+- raise
++ try:
++ v = self._sslobj.write(data)
++ except SSLError as x:
++ if x.args[0] == SSL_ERROR_WANT_READ:
++ return 0
++ elif x.args[0] == SSL_ERROR_WANT_WRITE:
++ return 0
+ else:
+- return v
++ raise
++ else:
++ return v
+ else:
+ return self._sock.send(data, flags)
+
+ def sendto(self, data, flags_or_addr, addr=None):
++ self._checkClosed()
+ if self._sslobj:
+ raise ValueError("sendto not allowed on instances of %s" %
+ self.__class__)
+@@ -222,7 +683,9 @@ class SSLSocket(socket):
+ else:
+ return self._sock.sendto(data, flags_or_addr, addr)
+
++
+ def sendall(self, data, flags=0):
++ self._checkClosed()
+ if self._sslobj:
+ if flags != 0:
+ raise ValueError(
+@@ -238,6 +701,7 @@ class SSLSocket(socket):
+ return socket.sendall(self, data, flags)
+
+ def recv(self, buflen=1024, flags=0):
++ self._checkClosed()
+ if self._sslobj:
+ if flags != 0:
+ raise ValueError(
+@@ -248,6 +712,7 @@ class SSLSocket(socket):
+ return self._sock.recv(buflen, flags)
+
+ def recv_into(self, buffer, nbytes=None, flags=0):
++ self._checkClosed()
+ if buffer and (nbytes is None):
+ nbytes = len(buffer)
+ elif nbytes is None:
+@@ -257,14 +722,12 @@ class SSLSocket(socket):
+ raise ValueError(
+ "non-zero flags not allowed in calls to recv_into() on %s"
%
+ self.__class__)
+- tmp_buffer = self.read(nbytes)
+- v = len(tmp_buffer)
+- buffer[:v] = tmp_buffer
+- return v
++ return self.read(nbytes, buffer)
+ else:
+ return self._sock.recv_into(buffer, nbytes, flags)
+
+ def recvfrom(self, buflen=1024, flags=0):
++ self._checkClosed()
+ if self._sslobj:
+ raise ValueError("recvfrom not allowed on instances of %s" %
+ self.__class__)
+@@ -272,27 +735,23 @@ class SSLSocket(socket):
+ return self._sock.recvfrom(buflen, flags)
+
+ def recvfrom_into(self, buffer, nbytes=None, flags=0):
++ self._checkClosed()
+ if self._sslobj:
+ raise ValueError("recvfrom_into not allowed on instances of %s" %
+ self.__class__)
+ else:
+ return self._sock.recvfrom_into(buffer, nbytes, flags)
+
++
+ def pending(self):
++ self._checkClosed()
+ if self._sslobj:
+ return self._sslobj.pending()
+ else:
+ return 0
+
+- def unwrap(self):
+- if self._sslobj:
+- s = self._sslobj.shutdown()
+- self._sslobj = None
+- return s
+- else:
+- raise ValueError("No SSL wrapper around " + str(self))
+-
+ def shutdown(self, how):
++ self._checkClosed()
+ self._sslobj = None
+ socket.shutdown(self, how)
+
+@@ -303,32 +762,55 @@ class SSLSocket(socket):
+ else:
+ self._makefile_refs -= 1
+
+- def do_handshake(self):
+-
+- """Perform a TLS/SSL handshake."""
++ def unwrap(self):
++ if self._sslobj:
++ s = self._sslobj.shutdown()
++ self._sslobj = None
++ return s
++ else:
++ raise ValueError("No SSL wrapper around " + str(self))
+
+- self._sslobj.do_handshake()
++ def _real_close(self):
++ self._sslobj = None
++ socket._real_close(self)
+
+- def _real_connect(self, addr, return_errno):
++ def do_handshake(self, block=False):
++ """Perform a TLS/SSL handshake."""
++ self._check_connected()
++ timeout = self.gettimeout()
++ try:
++ if timeout == 0.0 and block:
++ self.settimeout(None)
++ self._sslobj.do_handshake()
++ finally:
++ self.settimeout(timeout)
++
++ if self.context.check_hostname:
++ if not self.server_hostname:
++ raise ValueError("check_hostname needs server_hostname "
++ "argument")
++ match_hostname(self.getpeercert(), self.server_hostname)
++
++ def _real_connect(self, addr, connect_ex):
++ if self.server_side:
++ raise ValueError("can't connect in server-side mode")
+ # Here we assume that the socket is client-side, and not
+ # connected at the time of the call. We connect it, then wrap it.
+ if self._connected:
+ raise ValueError("attempt to connect already-connected
SSLSocket!")
+- self._sslobj = _ssl.sslwrap(self._sock, False, self.keyfile, self.certfile,
+- self.cert_reqs, self.ssl_version,
+- self.ca_certs, self.ciphers)
++ self._sslobj = self.context._wrap_socket(self._sock, False,
self.server_hostname, ssl_sock=self)
+ try:
+- if return_errno:
++ if connect_ex:
+ rc = socket.connect_ex(self, addr)
+ else:
+ rc = None
+ socket.connect(self, addr)
+ if not rc:
++ self._connected = True
+ if self.do_handshake_on_connect:
+ self.do_handshake()
+- self._connected = True
+ return rc
+- except socket_error:
++ except (OSError, ValueError):
+ self._sslobj = None
+ raise
+
+@@ -343,27 +825,16 @@ class SSLSocket(socket):
+ return self._real_connect(addr, True)
+
+ def accept(self):
+-
+ """Accepts a new connection from a remote client, and returns
+ a tuple containing that new connection wrapped with a server-side
+ SSL channel, and the address of the remote client."""
+
+ newsock, addr = socket.accept(self)
+- try:
+- return (SSLSocket(newsock,
+- keyfile=self.keyfile,
+- certfile=self.certfile,
+- server_side=True,
+- cert_reqs=self.cert_reqs,
+- ssl_version=self.ssl_version,
+- ca_certs=self.ca_certs,
+- ciphers=self.ciphers,
+- do_handshake_on_connect=self.do_handshake_on_connect,
+- suppress_ragged_eofs=self.suppress_ragged_eofs),
+- addr)
+- except socket_error as e:
+- newsock.close()
+- raise e
++ newsock = self.context.wrap_socket(newsock,
++ do_handshake_on_connect=self.do_handshake_on_connect,
++ suppress_ragged_eofs=self.suppress_ragged_eofs,
++ server_side=True)
++ return newsock, addr
+
+ def makefile(self, mode='r', bufsize=-1):
+
+@@ -376,54 +847,81 @@ class SSLSocket(socket):
+ # the file-like object.
+ return _fileobject(self, mode, bufsize, close=True)
+
++ def get_channel_binding(self, cb_type="tls-unique"):
++ """Get channel binding data for current connection. Raise
ValueError
++ if the requested `cb_type` is not supported. Return bytes of the data
++ or None if the data is not available (e.g. before the handshake).
++ """
++ if cb_type not in CHANNEL_BINDING_TYPES:
++ raise ValueError("Unsupported channel binding type")
++ if cb_type != "tls-unique":
++ raise NotImplementedError(
++ "{0} channel binding type not implemented"
++ .format(cb_type))
++ if self._sslobj is None:
++ return None
++ return self._sslobj.tls_unique_cb()
+
+
+ def wrap_socket(sock, keyfile=None, certfile=None,
+ server_side=False, cert_reqs=CERT_NONE,
+ ssl_version=PROTOCOL_SSLv23, ca_certs=None,
+ do_handshake_on_connect=True,
+- suppress_ragged_eofs=True, ciphers=None):
++ suppress_ragged_eofs=True,
++ ciphers=None):
+
+- return SSLSocket(sock, keyfile=keyfile, certfile=certfile,
++ return SSLSocket(sock=sock, keyfile=keyfile, certfile=certfile,
+ server_side=server_side, cert_reqs=cert_reqs,
+ ssl_version=ssl_version, ca_certs=ca_certs,
+ do_handshake_on_connect=do_handshake_on_connect,
+ suppress_ragged_eofs=suppress_ragged_eofs,
+ ciphers=ciphers)
+
+-
+ # some utility functions
+
+ def cert_time_to_seconds(cert_time):
+-
+- """Takes a date-time string in standard ASN1_print form
+- ("MON DAY 24HOUR:MINUTE:SEC YEAR TIMEZONE") and return
+- a Python time value in seconds past the epoch."""
+-
+- import time
+- return time.mktime(time.strptime(cert_time, "%b %d %H:%M:%S %Y GMT"))
++ """Return the time in seconds since the Epoch, given the timestring
++ representing the "notBefore" or "notAfter" date from a
certificate
++ in ``"%b %d %H:%M:%S %Y %Z"`` strptime format (C locale).
++
++ "notBefore" or "notAfter" dates must use UTC (RFC 5280).
++
++ Month is one of: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
++ UTC should be specified as GMT (see ASN1_TIME_print())
++ """
++ from time import strptime
++ from calendar import timegm
++
++ months = (
++
"Jan","Feb","Mar","Apr","May","Jun",
++
"Jul","Aug","Sep","Oct","Nov","Dec"
++ )
++ time_format = ' %d %H:%M:%S %Y GMT' # NOTE: no month, fixed GMT
++ try:
++ month_number = months.index(cert_time[:3].title()) + 1
++ except ValueError:
++ raise ValueError('time data %r does not match '
++ 'format "%%b%s"' % (cert_time, time_format))
++ else:
++ # found valid month
++ tt = strptime(cert_time[3:], time_format)
++ # return an integer, the previous mktime()-based implementation
++ # returned a float (fractional seconds are always zero here).
++ return timegm((tt[0], month_number) + tt[2:6])
+
+ PEM_HEADER = "-----BEGIN CERTIFICATE-----"
+ PEM_FOOTER = "-----END CERTIFICATE-----"
+
+ def DER_cert_to_PEM_cert(der_cert_bytes):
+-
+ """Takes a certificate in binary DER format and returns the
+ PEM version of it as a string."""
+
+- if hasattr(base64, 'standard_b64encode'):
+- # preferred because older API gets line-length wrong
+- f = base64.standard_b64encode(der_cert_bytes)
+- return (PEM_HEADER + '\n' +
+- textwrap.fill(f, 64) + '\n' +
+- PEM_FOOTER + '\n')
+- else:
+- return (PEM_HEADER + '\n' +
+- base64.encodestring(der_cert_bytes) +
+- PEM_FOOTER + '\n')
++ f = base64.standard_b64encode(der_cert_bytes).decode('ascii')
++ return (PEM_HEADER + '\n' +
++ textwrap.fill(f, 64) + '\n' +
++ PEM_FOOTER + '\n')
+
+ def PEM_cert_to_DER_cert(pem_cert_string):
+-
+ """Takes a certificate in ASCII PEM format and returns the
+ DER-encoded version of it as a byte sequence"""
+
+@@ -434,25 +932,25 @@ def PEM_cert_to_DER_cert(pem_cert_string):
+ raise ValueError("Invalid PEM encoding; must end with %s"
+ % PEM_FOOTER)
+ d = pem_cert_string.strip()[len(PEM_HEADER):-len(PEM_FOOTER)]
+- return base64.decodestring(d)
+-
+-def get_server_certificate(addr, ssl_version=PROTOCOL_SSLv3, ca_certs=None):
++ return base64.decodestring(d.encode('ASCII', 'strict'))
+
++def get_server_certificate(addr, ssl_version=PROTOCOL_SSLv23, ca_certs=None):
+ """Retrieve the certificate from the server at the specified
address,
+ and return it as a PEM-encoded string.
+ If 'ca_certs' is specified, validate the server cert against it.
+ If 'ssl_version' is specified, use it in the connection
attempt."""
+
+ host, port = addr
+- if (ca_certs is not None):
++ if ca_certs is not None:
+ cert_reqs = CERT_REQUIRED
+ else:
+ cert_reqs = CERT_NONE
+- s = wrap_socket(socket(), ssl_version=ssl_version,
+- cert_reqs=cert_reqs, ca_certs=ca_certs)
+- s.connect(addr)
+- dercert = s.getpeercert(True)
+- s.close()
++ context = _create_stdlib_context(ssl_version,
++ cert_reqs=cert_reqs,
++ cafile=ca_certs)
++ with closing(create_connection(addr)) as sock:
++ with closing(context.wrap_socket(sock)) as sslsock:
++ dercert = sslsock.getpeercert(True)
+ return DER_cert_to_PEM_cert(dercert)
+
+ def get_protocol_name(protocol_code):
+diff --git a/Lib/test/capath/4e1295a3.0 b/Lib/test/capath/4e1295a3.0
+new file mode 100644
+index 0000000..9d7ac23
+--- /dev/null
++++ b/Lib/test/capath/4e1295a3.0
+@@ -0,0 +1,14 @@
++-----BEGIN CERTIFICATE-----
++MIICLDCCAdYCAQAwDQYJKoZIhvcNAQEEBQAwgaAxCzAJBgNVBAYTAlBUMRMwEQYD
++VQQIEwpRdWVlbnNsYW5kMQ8wDQYDVQQHEwZMaXNib2ExFzAVBgNVBAoTDk5ldXJv
++bmlvLCBMZGEuMRgwFgYDVQQLEw9EZXNlbnZvbHZpbWVudG8xGzAZBgNVBAMTEmJy
++dXR1cy5uZXVyb25pby5wdDEbMBkGCSqGSIb3DQEJARYMc2FtcG9AaWtpLmZpMB4X
++DTk2MDkwNTAzNDI0M1oXDTk2MTAwNTAzNDI0M1owgaAxCzAJBgNVBAYTAlBUMRMw
++EQYDVQQIEwpRdWVlbnNsYW5kMQ8wDQYDVQQHEwZMaXNib2ExFzAVBgNVBAoTDk5l
++dXJvbmlvLCBMZGEuMRgwFgYDVQQLEw9EZXNlbnZvbHZpbWVudG8xGzAZBgNVBAMT
++EmJydXR1cy5uZXVyb25pby5wdDEbMBkGCSqGSIb3DQEJARYMc2FtcG9AaWtpLmZp
++MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAL7+aty3S1iBA/+yxjxv4q1MUTd1kjNw
++L4lYKbpzzlmC5beaQXeQ2RmGMTXU+mDvuqItjVHOK3DvPK7lTcSGftUCAwEAATAN
++BgkqhkiG9w0BAQQFAANBAFqPEKFjk6T6CKTHvaQeEAsX0/8YHPHqH/9AnhSjrwuX
++9EBc0n6bVGhN7XaXd6sJ7dym9sbsWxb+pJdurnkxjx4=
++-----END CERTIFICATE-----
+diff --git a/Lib/test/capath/5ed36f99.0 b/Lib/test/capath/5ed36f99.0
+new file mode 100644
+index 0000000..e7dfc82
+--- /dev/null
++++ b/Lib/test/capath/5ed36f99.0
+@@ -0,0 +1,41 @@
++-----BEGIN CERTIFICATE-----
++MIIHPTCCBSWgAwIBAgIBADANBgkqhkiG9w0BAQQFADB5MRAwDgYDVQQKEwdSb290
++IENBMR4wHAYDVQQLExVodHRwOi8vd3d3LmNhY2VydC5vcmcxIjAgBgNVBAMTGUNB
++IENlcnQgU2lnbmluZyBBdXRob3JpdHkxITAfBgkqhkiG9w0BCQEWEnN1cHBvcnRA
++Y2FjZXJ0Lm9yZzAeFw0wMzAzMzAxMjI5NDlaFw0zMzAzMjkxMjI5NDlaMHkxEDAO
++BgNVBAoTB1Jvb3QgQ0ExHjAcBgNVBAsTFWh0dHA6Ly93d3cuY2FjZXJ0Lm9yZzEi
++MCAGA1UEAxMZQ0EgQ2VydCBTaWduaW5nIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJ
++ARYSc3VwcG9ydEBjYWNlcnQub3JnMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC
++CgKCAgEAziLA4kZ97DYoB1CW8qAzQIxL8TtmPzHlawI229Z89vGIj053NgVBlfkJ
++8BLPRoZzYLdufujAWGSuzbCtRRcMY/pnCujW0r8+55jE8Ez64AO7NV1sId6eINm6
++zWYyN3L69wj1x81YyY7nDl7qPv4coRQKFWyGhFtkZip6qUtTefWIonvuLwphK42y
++fk1WpRPs6tqSnqxEQR5YYGUFZvjARL3LlPdCfgv3ZWiYUQXw8wWRBB0bF4LsyFe7
++w2t6iPGwcswlWyCR7BYCEo8y6RcYSNDHBS4CMEK4JZwFaz+qOqfrU0j36NK2B5jc
++G8Y0f3/JHIJ6BVgrCFvzOKKrF11myZjXnhCLotLddJr3cQxyYN/Nb5gznZY0dj4k
++epKwDpUeb+agRThHqtdB7Uq3EvbXG4OKDy7YCbZZ16oE/9KTfWgu3YtLq1i6L43q
++laegw1SJpfvbi1EinbLDvhG+LJGGi5Z4rSDTii8aP8bQUWWHIbEZAWV/RRyH9XzQ
++QUxPKZgh/TMfdQwEUfoZd9vUFBzugcMd9Zi3aQaRIt0AUMyBMawSB3s42mhb5ivU
++fslfrejrckzzAeVLIL+aplfKkQABi6F1ITe1Yw1nPkZPcCBnzsXWWdsC4PDSy826
++YreQQejdIOQpvGQpQsgi3Hia/0PsmBsJUUtaWsJx8cTLc6nloQsCAwEAAaOCAc4w
++ggHKMB0GA1UdDgQWBBQWtTIb1Mfz4OaO873SsDrusjkY0TCBowYDVR0jBIGbMIGY
++gBQWtTIb1Mfz4OaO873SsDrusjkY0aF9pHsweTEQMA4GA1UEChMHUm9vdCBDQTEe
++MBwGA1UECxMVaHR0cDovL3d3dy5jYWNlcnQub3JnMSIwIAYDVQQDExlDQSBDZXJ0
++IFNpZ25pbmcgQXV0aG9yaXR5MSEwHwYJKoZIhvcNAQkBFhJzdXBwb3J0QGNhY2Vy
++dC5vcmeCAQAwDwYDVR0TAQH/BAUwAwEB/zAyBgNVHR8EKzApMCegJaAjhiFodHRw
++czovL3d3dy5jYWNlcnQub3JnL3Jldm9rZS5jcmwwMAYJYIZIAYb4QgEEBCMWIWh0
++dHBzOi8vd3d3LmNhY2VydC5vcmcvcmV2b2tlLmNybDA0BglghkgBhvhCAQgEJxYl
++aHR0cDovL3d3dy5jYWNlcnQub3JnL2luZGV4LnBocD9pZD0xMDBWBglghkgBhvhC
++AQ0ESRZHVG8gZ2V0IHlvdXIgb3duIGNlcnRpZmljYXRlIGZvciBGUkVFIGhlYWQg
++b3ZlciB0byBodHRwOi8vd3d3LmNhY2VydC5vcmcwDQYJKoZIhvcNAQEEBQADggIB
++ACjH7pyCArpcgBLKNQodgW+JapnM8mgPf6fhjViVPr3yBsOQWqy1YPaZQwGjiHCc
++nWKdpIevZ1gNMDY75q1I08t0AoZxPuIrA2jxNGJARjtT6ij0rPtmlVOKTV39O9lg
++18p5aTuxZZKmxoGCXJzN600BiqXfEVWqFcofN8CCmHBh22p8lqOOLlQ+TyGpkO/c
++gr/c6EWtTZBzCDyUZbAEmXZ/4rzCahWqlwQ3JNgelE5tDlG+1sSPypZt90Pf6DBl
++Jzt7u0NDY8RD97LsaMzhGY4i+5jhe1o+ATc7iwiwovOVThrLm82asduycPAtStvY
++sONvRUgzEv/+PDIqVPfE94rwiCPCR/5kenHA0R6mY7AHfqQv0wGP3J8rtsYIqQ+T
++SCX8Ev2fQtzzxD72V7DX3WnRBnc0CkvSyqD/HMaMyRa+xMwyN2hzXwj7UfdJUzYF
++CpUCTPJ5GhD22Dp1nPMd8aINcGeGG7MW9S/lpOt5hvk9C8JzC6WZrG/8Z7jlLwum
++GCSNe9FINSkYQKyTYOGWhlC0elnYjyELn8+CkcY7v2vcB5G5l1YjqrZslMZIBjzk
++zk6q5PYvCdxTby78dOs6Y5nCpqyJvKeyRKANihDjbPIky/qbn3BHLt4Ui9SyIAmW
++omTxJBzcoTWcFbLUvFUufQb1nA5V9FrWk9p2rSVzTMVD
++-----END CERTIFICATE-----
+diff --git a/Lib/test/capath/6e88d7b8.0 b/Lib/test/capath/6e88d7b8.0
+new file mode 100644
+index 0000000..9d7ac23
+--- /dev/null
++++ b/Lib/test/capath/6e88d7b8.0
+@@ -0,0 +1,14 @@
++-----BEGIN CERTIFICATE-----
++MIICLDCCAdYCAQAwDQYJKoZIhvcNAQEEBQAwgaAxCzAJBgNVBAYTAlBUMRMwEQYD
++VQQIEwpRdWVlbnNsYW5kMQ8wDQYDVQQHEwZMaXNib2ExFzAVBgNVBAoTDk5ldXJv
++bmlvLCBMZGEuMRgwFgYDVQQLEw9EZXNlbnZvbHZpbWVudG8xGzAZBgNVBAMTEmJy
++dXR1cy5uZXVyb25pby5wdDEbMBkGCSqGSIb3DQEJARYMc2FtcG9AaWtpLmZpMB4X
++DTk2MDkwNTAzNDI0M1oXDTk2MTAwNTAzNDI0M1owgaAxCzAJBgNVBAYTAlBUMRMw
++EQYDVQQIEwpRdWVlbnNsYW5kMQ8wDQYDVQQHEwZMaXNib2ExFzAVBgNVBAoTDk5l
++dXJvbmlvLCBMZGEuMRgwFgYDVQQLEw9EZXNlbnZvbHZpbWVudG8xGzAZBgNVBAMT
++EmJydXR1cy5uZXVyb25pby5wdDEbMBkGCSqGSIb3DQEJARYMc2FtcG9AaWtpLmZp
++MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAL7+aty3S1iBA/+yxjxv4q1MUTd1kjNw
++L4lYKbpzzlmC5beaQXeQ2RmGMTXU+mDvuqItjVHOK3DvPK7lTcSGftUCAwEAATAN
++BgkqhkiG9w0BAQQFAANBAFqPEKFjk6T6CKTHvaQeEAsX0/8YHPHqH/9AnhSjrwuX
++9EBc0n6bVGhN7XaXd6sJ7dym9sbsWxb+pJdurnkxjx4=
++-----END CERTIFICATE-----
+diff --git a/Lib/test/capath/99d0fa06.0 b/Lib/test/capath/99d0fa06.0
+new file mode 100644
+index 0000000..e7dfc82
+--- /dev/null
++++ b/Lib/test/capath/99d0fa06.0
+@@ -0,0 +1,41 @@
++-----BEGIN CERTIFICATE-----
++MIIHPTCCBSWgAwIBAgIBADANBgkqhkiG9w0BAQQFADB5MRAwDgYDVQQKEwdSb290
++IENBMR4wHAYDVQQLExVodHRwOi8vd3d3LmNhY2VydC5vcmcxIjAgBgNVBAMTGUNB
++IENlcnQgU2lnbmluZyBBdXRob3JpdHkxITAfBgkqhkiG9w0BCQEWEnN1cHBvcnRA
++Y2FjZXJ0Lm9yZzAeFw0wMzAzMzAxMjI5NDlaFw0zMzAzMjkxMjI5NDlaMHkxEDAO
++BgNVBAoTB1Jvb3QgQ0ExHjAcBgNVBAsTFWh0dHA6Ly93d3cuY2FjZXJ0Lm9yZzEi
++MCAGA1UEAxMZQ0EgQ2VydCBTaWduaW5nIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJ
++ARYSc3VwcG9ydEBjYWNlcnQub3JnMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC
++CgKCAgEAziLA4kZ97DYoB1CW8qAzQIxL8TtmPzHlawI229Z89vGIj053NgVBlfkJ
++8BLPRoZzYLdufujAWGSuzbCtRRcMY/pnCujW0r8+55jE8Ez64AO7NV1sId6eINm6
++zWYyN3L69wj1x81YyY7nDl7qPv4coRQKFWyGhFtkZip6qUtTefWIonvuLwphK42y
++fk1WpRPs6tqSnqxEQR5YYGUFZvjARL3LlPdCfgv3ZWiYUQXw8wWRBB0bF4LsyFe7
++w2t6iPGwcswlWyCR7BYCEo8y6RcYSNDHBS4CMEK4JZwFaz+qOqfrU0j36NK2B5jc
++G8Y0f3/JHIJ6BVgrCFvzOKKrF11myZjXnhCLotLddJr3cQxyYN/Nb5gznZY0dj4k
++epKwDpUeb+agRThHqtdB7Uq3EvbXG4OKDy7YCbZZ16oE/9KTfWgu3YtLq1i6L43q
++laegw1SJpfvbi1EinbLDvhG+LJGGi5Z4rSDTii8aP8bQUWWHIbEZAWV/RRyH9XzQ
++QUxPKZgh/TMfdQwEUfoZd9vUFBzugcMd9Zi3aQaRIt0AUMyBMawSB3s42mhb5ivU
++fslfrejrckzzAeVLIL+aplfKkQABi6F1ITe1Yw1nPkZPcCBnzsXWWdsC4PDSy826
++YreQQejdIOQpvGQpQsgi3Hia/0PsmBsJUUtaWsJx8cTLc6nloQsCAwEAAaOCAc4w
++ggHKMB0GA1UdDgQWBBQWtTIb1Mfz4OaO873SsDrusjkY0TCBowYDVR0jBIGbMIGY
++gBQWtTIb1Mfz4OaO873SsDrusjkY0aF9pHsweTEQMA4GA1UEChMHUm9vdCBDQTEe
++MBwGA1UECxMVaHR0cDovL3d3dy5jYWNlcnQub3JnMSIwIAYDVQQDExlDQSBDZXJ0
++IFNpZ25pbmcgQXV0aG9yaXR5MSEwHwYJKoZIhvcNAQkBFhJzdXBwb3J0QGNhY2Vy
++dC5vcmeCAQAwDwYDVR0TAQH/BAUwAwEB/zAyBgNVHR8EKzApMCegJaAjhiFodHRw
++czovL3d3dy5jYWNlcnQub3JnL3Jldm9rZS5jcmwwMAYJYIZIAYb4QgEEBCMWIWh0
++dHBzOi8vd3d3LmNhY2VydC5vcmcvcmV2b2tlLmNybDA0BglghkgBhvhCAQgEJxYl
++aHR0cDovL3d3dy5jYWNlcnQub3JnL2luZGV4LnBocD9pZD0xMDBWBglghkgBhvhC
++AQ0ESRZHVG8gZ2V0IHlvdXIgb3duIGNlcnRpZmljYXRlIGZvciBGUkVFIGhlYWQg
++b3ZlciB0byBodHRwOi8vd3d3LmNhY2VydC5vcmcwDQYJKoZIhvcNAQEEBQADggIB
++ACjH7pyCArpcgBLKNQodgW+JapnM8mgPf6fhjViVPr3yBsOQWqy1YPaZQwGjiHCc
++nWKdpIevZ1gNMDY75q1I08t0AoZxPuIrA2jxNGJARjtT6ij0rPtmlVOKTV39O9lg
++18p5aTuxZZKmxoGCXJzN600BiqXfEVWqFcofN8CCmHBh22p8lqOOLlQ+TyGpkO/c
++gr/c6EWtTZBzCDyUZbAEmXZ/4rzCahWqlwQ3JNgelE5tDlG+1sSPypZt90Pf6DBl
++Jzt7u0NDY8RD97LsaMzhGY4i+5jhe1o+ATc7iwiwovOVThrLm82asduycPAtStvY
++sONvRUgzEv/+PDIqVPfE94rwiCPCR/5kenHA0R6mY7AHfqQv0wGP3J8rtsYIqQ+T
++SCX8Ev2fQtzzxD72V7DX3WnRBnc0CkvSyqD/HMaMyRa+xMwyN2hzXwj7UfdJUzYF
++CpUCTPJ5GhD22Dp1nPMd8aINcGeGG7MW9S/lpOt5hvk9C8JzC6WZrG/8Z7jlLwum
++GCSNe9FINSkYQKyTYOGWhlC0elnYjyELn8+CkcY7v2vcB5G5l1YjqrZslMZIBjzk
++zk6q5PYvCdxTby78dOs6Y5nCpqyJvKeyRKANihDjbPIky/qbn3BHLt4Ui9SyIAmW
++omTxJBzcoTWcFbLUvFUufQb1nA5V9FrWk9p2rSVzTMVD
++-----END CERTIFICATE-----
+diff --git a/Lib/test/dh512.pem b/Lib/test/dh512.pem
+new file mode 100644
+index 0000000..200d16c
+--- /dev/null
++++ b/Lib/test/dh512.pem
+@@ -0,0 +1,9 @@
++-----BEGIN DH PARAMETERS-----
++MEYCQQD1Kv884bEpQBgRjXyEpwpy1obEAxnIByl6ypUM2Zafq9AKUJsCRtMIPWak
++XUGfnHy9iUsiGSa6q6Jew1XpKgVfAgEC
++-----END DH PARAMETERS-----
++
++These are the 512 bit DH parameters from "Assigned Number for SKIP Protocols"
++(http://www.skip-vpn.org/spec/numbers.html).
++See there for how they were generated.
++Note that g is not a generator, but this is not a problem since p is a safe prime.
+diff --git a/Lib/test/keycert.passwd.pem b/Lib/test/keycert.passwd.pem
+new file mode 100644
+index 0000000..e905748
+--- /dev/null
++++ b/Lib/test/keycert.passwd.pem
+@@ -0,0 +1,33 @@
++-----BEGIN RSA PRIVATE KEY-----
++Proc-Type: 4,ENCRYPTED
++DEK-Info: DES-EDE3-CBC,1A8D9D2A02EC698A
++
++kJYbfZ8L0sfe9Oty3gw0aloNnY5E8fegRfQLZlNoxTl6jNt0nIwI8kDJ36CZgR9c
++u3FDJm/KqrfUoz8vW+qEnWhSG7QPX2wWGPHd4K94Yz/FgrRzZ0DoK7XxXq9gOtVA
++AVGQhnz32p+6WhfGsCr9ArXEwRZrTk/FvzEPaU5fHcoSkrNVAGX8IpSVkSDwEDQr
++Gv17+cfk99UV1OCza6yKHoFkTtrC+PZU71LomBabivS2Oc4B9hYuSR2hF01wTHP+
++YlWNagZOOVtNz4oKK9x9eNQpmfQXQvPPTfusexKIbKfZrMvJoxcm1gfcZ0H/wK6P
++6wmXSG35qMOOztCZNtperjs1wzEBXznyK8QmLcAJBjkfarABJX9vBEzZV0OUKhy+
++noORFwHTllphbmydLhu6ehLUZMHPhzAS5UN7srtpSN81eerDMy0RMUAwA7/PofX1
++94Me85Q8jP0PC9ETdsJcPqLzAPETEYu0ELewKRcrdyWi+tlLFrpE5KT/s5ecbl9l
++7B61U4Kfd1PIXc/siINhU3A3bYK+845YyUArUOnKf1kEox7p1RpD7yFqVT04lRTo
++cibNKATBusXSuBrp2G6GNuhWEOSafWCKJQAzgCYIp6ZTV2khhMUGppc/2H3CF6cO
++zX0KtlPVZC7hLkB6HT8SxYUwF1zqWY7+/XPPdc37MeEZ87Q3UuZwqORLY+Z0hpgt
++L5JXBCoklZhCAaN2GqwFLXtGiRSRFGY7xXIhbDTlE65Wv1WGGgDLMKGE1gOz3yAo
++2jjG1+yAHJUdE69XTFHSqSkvaloA1W03LdMXZ9VuQJ/ySXCie6ABAQ==
++-----END RSA PRIVATE KEY-----
++-----BEGIN CERTIFICATE-----
++MIICVDCCAb2gAwIBAgIJANfHOBkZr8JOMA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV
++BAYTAlhZMRcwFQYDVQQHEw5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9u
++IFNvZnR3YXJlIEZvdW5kYXRpb24xEjAQBgNVBAMTCWxvY2FsaG9zdDAeFw0xMDEw
++MDgyMzAxNTZaFw0yMDEwMDUyMzAxNTZaMF8xCzAJBgNVBAYTAlhZMRcwFQYDVQQH
++Ew5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9uIFNvZnR3YXJlIEZvdW5k
++YXRpb24xEjAQBgNVBAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAw
++gYkCgYEA21vT5isq7F68amYuuNpSFlKDPrMUCa4YWYqZRt2OZ+/3NKaZ2xAiSwr7
++6MrQF70t5nLbSPpqE5+5VrS58SY+g/sXLiFd6AplH1wJZwh78DofbFYXUggktFMt
++pTyiX8jtP66bkcPkDADA089RI1TQR6Ca+n7HFa7c1fabVV6i3zkCAwEAAaMYMBYw
++FAYDVR0RBA0wC4IJbG9jYWxob3N0MA0GCSqGSIb3DQEBBQUAA4GBAHPctQBEQ4wd
++BJ6+JcpIraopLn8BGhbjNWj40mmRqWB/NAWF6M5ne7KpGAu7tLeG4hb1zLaldK8G
++lxy2GPSRF6LFS48dpEj2HbMv2nvv6xxalDMJ9+DicWgAKTQ6bcX2j3GUkCR0g/T1
++CRlNBAAlvhKzO7Clpf9l0YKBEfraJByX
++-----END CERTIFICATE-----
+diff --git a/Lib/test/keycert3.pem b/Lib/test/keycert3.pem
+new file mode 100644
+index 0000000..5bfa62c
+--- /dev/null
++++ b/Lib/test/keycert3.pem
+@@ -0,0 +1,73 @@
++-----BEGIN PRIVATE KEY-----
++MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAMLgD0kAKDb5cFyP
++jbwNfR5CtewdXC+kMXAWD8DLxiTTvhMW7qVnlwOm36mZlszHKvsRf05lT4pegiFM
++9z2j1OlaN+ci/X7NU22TNN6crYSiN77FjYJP464j876ndSxyD+rzys386T+1r1aZ
++aggEdkj1TsSsv1zWIYKlPIjlvhuxAgMBAAECgYA0aH+T2Vf3WOPv8KdkcJg6gCRe
++yJKXOWgWRcicx/CUzOEsTxmFIDPLxqAWA3k7v0B+3vjGw5Y9lycV/5XqXNoQI14j
++y09iNsumds13u5AKkGdTJnZhQ7UKdoVHfuP44ZdOv/rJ5/VD6F4zWywpe90pcbK+
++AWDVtusgGQBSieEl1QJBAOyVrUG5l2yoUBtd2zr/kiGm/DYyXlIthQO/A3/LngDW
++5/ydGxVsT7lAVOgCsoT+0L4efTh90PjzW8LPQrPBWVMCQQDS3h/FtYYd5lfz+FNL
++9CEe1F1w9l8P749uNUD0g317zv1tatIqVCsQWHfVHNdVvfQ+vSFw38OORO00Xqs9
++1GJrAkBkoXXEkxCZoy4PteheO/8IWWLGGr6L7di6MzFl1lIqwT6D8L9oaV2vynFT
++DnKop0pa09Unhjyw57KMNmSE2SUJAkEArloTEzpgRmCq4IK2/NpCeGdHS5uqRlbh
++1VIa/xGps7EWQl5Mn8swQDel/YP3WGHTjfx7pgSegQfkyaRtGpZ9OQJAa9Vumj8m
++JAAtI0Bnga8hgQx7BhTQY4CadDxyiRGOGYhwUzYVCqkb2sbVRH9HnwUaJT7cWBY3
++RnJdHOMXWem7/w==
++-----END PRIVATE KEY-----
++Certificate:
++ Data:
++ Version: 1 (0x0)
++ Serial Number: 12723342612721443281 (0xb09264b1f2da21d1)
++ Signature Algorithm: sha1WithRSAEncryption
++ Issuer: C=XY, O=Python Software Foundation CA, CN=our-ca-server
++ Validity
++ Not Before: Jan 4 19:47:07 2013 GMT
++ Not After : Nov 13 19:47:07 2022 GMT
++ Subject: C=XY, L=Castle Anthrax, O=Python Software Foundation, CN=localhost
++ Subject Public Key Info:
++ Public Key Algorithm: rsaEncryption
++ Public-Key: (1024 bit)
++ Modulus:
++ 00:c2:e0:0f:49:00:28:36:f9:70:5c:8f:8d:bc:0d:
++ 7d:1e:42:b5:ec:1d:5c:2f:a4:31:70:16:0f:c0:cb:
++ c6:24:d3:be:13:16:ee:a5:67:97:03:a6:df:a9:99:
++ 96:cc:c7:2a:fb:11:7f:4e:65:4f:8a:5e:82:21:4c:
++ f7:3d:a3:d4:e9:5a:37:e7:22:fd:7e:cd:53:6d:93:
++ 34:de:9c:ad:84:a2:37:be:c5:8d:82:4f:e3:ae:23:
++ f3:be:a7:75:2c:72:0f:ea:f3:ca:cd:fc:e9:3f:b5:
++ af:56:99:6a:08:04:76:48:f5:4e:c4:ac:bf:5c:d6:
++ 21:82:a5:3c:88:e5:be:1b:b1
++ Exponent: 65537 (0x10001)
++ Signature Algorithm: sha1WithRSAEncryption
++ 2f:42:5f:a3:09:2c:fa:51:88:c7:37:7f:ea:0e:63:f0:a2:9a:
++ e5:5a:e2:c8:20:f0:3f:60:bc:c8:0f:b6:c6:76:ce:db:83:93:
++ f5:a3:33:67:01:8e:04:cd:00:9a:73:fd:f3:35:86:fa:d7:13:
++ e2:46:c6:9d:c0:29:53:d4:a9:90:b8:77:4b:e6:83:76:e4:92:
++ d6:9c:50:cf:43:d0:c6:01:77:61:9a:de:9b:70:f7:72:cd:59:
++ 00:31:69:d9:b4:ca:06:9c:6d:c3:c7:80:8c:68:e6:b5:a2:f8:
++ ef:1d:bb:16:9f:77:77:ef:87:62:22:9b:4d:69:a4:3a:1a:f1:
++ 21:5e:8c:32:ac:92:fd:15:6b:18:c2:7f:15:0d:98:30:ca:75:
++ 8f:1a:71:df:da:1d:b2:ef:9a:e8:2d:2e:02:fd:4a:3c:aa:96:
++ 0b:06:5d:35:b3:3d:24:87:4b:e0:b0:58:60:2f:45:ac:2e:48:
++ 8a:b0:99:10:65:27:ff:cc:b1:d8:fd:bd:26:6b:b9:0c:05:2a:
++ f4:45:63:35:51:07:ed:83:85:fe:6f:69:cb:bb:40:a8:ae:b6:
++ 3b:56:4a:2d:a4:ed:6d:11:2c:4d:ed:17:24:fd:47:bc:d3:41:
++ a2:d3:06:fe:0c:90:d8:d8:94:26:c4:ff:cc:a1:d8:42:77:eb:
++ fc:a9:94:71
++-----BEGIN CERTIFICATE-----
++MIICpDCCAYwCCQCwkmSx8toh0TANBgkqhkiG9w0BAQUFADBNMQswCQYDVQQGEwJY
++WTEmMCQGA1UECgwdUHl0aG9uIFNvZnR3YXJlIEZvdW5kYXRpb24gQ0ExFjAUBgNV
++BAMMDW91ci1jYS1zZXJ2ZXIwHhcNMTMwMTA0MTk0NzA3WhcNMjIxMTEzMTk0NzA3
++WjBfMQswCQYDVQQGEwJYWTEXMBUGA1UEBxMOQ2FzdGxlIEFudGhyYXgxIzAhBgNV
++BAoTGlB5dGhvbiBTb2Z0d2FyZSBGb3VuZGF0aW9uMRIwEAYDVQQDEwlsb2NhbGhv
++c3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMLgD0kAKDb5cFyPjbwNfR5C
++tewdXC+kMXAWD8DLxiTTvhMW7qVnlwOm36mZlszHKvsRf05lT4pegiFM9z2j1Ola
++N+ci/X7NU22TNN6crYSiN77FjYJP464j876ndSxyD+rzys386T+1r1aZaggEdkj1
++TsSsv1zWIYKlPIjlvhuxAgMBAAEwDQYJKoZIhvcNAQEFBQADggEBAC9CX6MJLPpR
++iMc3f+oOY/CimuVa4sgg8D9gvMgPtsZ2ztuDk/WjM2cBjgTNAJpz/fM1hvrXE+JG
++xp3AKVPUqZC4d0vmg3bkktacUM9D0MYBd2Ga3ptw93LNWQAxadm0ygacbcPHgIxo
++5rWi+O8duxafd3fvh2Iim01ppDoa8SFejDKskv0VaxjCfxUNmDDKdY8acd/aHbLv
++mugtLgL9SjyqlgsGXTWzPSSHS+CwWGAvRawuSIqwmRBlJ//Msdj9vSZruQwFKvRF
++YzVRB+2Dhf5vacu7QKiutjtWSi2k7W0RLE3tFyT9R7zTQaLTBv4MkNjYlCbE/8yh
++2EJ36/yplHE=
++-----END CERTIFICATE-----
+diff --git a/Lib/test/keycert4.pem b/Lib/test/keycert4.pem
+new file mode 100644
+index 0000000..53355c8
+--- /dev/null
++++ b/Lib/test/keycert4.pem
+@@ -0,0 +1,73 @@
++-----BEGIN PRIVATE KEY-----
++MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAK5UQiMI5VkNs2Qv
++L7gUaiDdFevNUXRjU4DHAe3ZzzYLZNE69h9gO9VCSS16tJ5fT5VEu0EZyGr0e3V2
++NkX0ZoU0Hc/UaY4qx7LHmn5SYZpIxhJnkf7SyHJK1zUaGlU0/LxYqIuGCtF5dqx1
++L2OQhEx1GM6RydHdgX69G64LXcY5AgMBAAECgYAhsRMfJkb9ERLMl/oG/5sLQu9L
++pWDKt6+ZwdxzlZbggQ85CMYshjLKIod2DLL/sLf2x1PRXyRG131M1E3k8zkkz6de
++R1uDrIN/x91iuYzfLQZGh8bMY7Yjd2eoroa6R/7DjpElGejLxOAaDWO0ST2IFQy9
++myTGS2jSM97wcXfsSQJBANP3jelJoS5X6BRjTSneY21wcocxVuQh8pXpErALVNsT
++drrFTeaBuZp7KvbtnIM5g2WRNvaxLZlAY/hXPJvi6ncCQQDSix1cebml6EmPlEZS
++Mm8gwI2F9ufUunwJmBJcz826Do0ZNGByWDAM/JQZH4FX4GfAFNuj8PUb+GQfadkx
++i1DPAkEA0lVsNHojvuDsIo8HGuzarNZQT2beWjJ1jdxh9t7HrTx7LIps6rb/fhOK
++Zs0R6gVAJaEbcWAPZ2tFyECInAdnsQJAUjaeXXjuxFkjOFym5PvqpvhpivEx78Bu
++JPTr3rAKXmfGMxxfuOa0xK1wSyshP6ZR/RBn/+lcXPKubhHQDOegwwJAJF1DBQnN
+++/tLmOPULtDwfP4Zixn+/8GmGOahFoRcu6VIGHmRilJTn6MOButw7Glv2YdeC6l/
++e83Gq6ffLVfKNQ==
++-----END PRIVATE KEY-----
++Certificate:
++ Data:
++ Version: 1 (0x0)
++ Serial Number: 12723342612721443282 (0xb09264b1f2da21d2)
++ Signature Algorithm: sha1WithRSAEncryption
++ Issuer: C=XY, O=Python Software Foundation CA, CN=our-ca-server
++ Validity
++ Not Before: Jan 4 19:47:07 2013 GMT
++ Not After : Nov 13 19:47:07 2022 GMT
++ Subject: C=XY, L=Castle Anthrax, O=Python Software Foundation, CN=fakehostname
++ Subject Public Key Info:
++ Public Key Algorithm: rsaEncryption
++ Public-Key: (1024 bit)
++ Modulus:
++ 00:ae:54:42:23:08:e5:59:0d:b3:64:2f:2f:b8:14:
++ 6a:20:dd:15:eb:cd:51:74:63:53:80:c7:01:ed:d9:
++ cf:36:0b:64:d1:3a:f6:1f:60:3b:d5:42:49:2d:7a:
++ b4:9e:5f:4f:95:44:bb:41:19:c8:6a:f4:7b:75:76:
++ 36:45:f4:66:85:34:1d:cf:d4:69:8e:2a:c7:b2:c7:
++ 9a:7e:52:61:9a:48:c6:12:67:91:fe:d2:c8:72:4a:
++ d7:35:1a:1a:55:34:fc:bc:58:a8:8b:86:0a:d1:79:
++ 76:ac:75:2f:63:90:84:4c:75:18:ce:91:c9:d1:dd:
++ 81:7e:bd:1b:ae:0b:5d:c6:39
++ Exponent: 65537 (0x10001)
++ Signature Algorithm: sha1WithRSAEncryption
++ ad:45:8a:8e:ef:c6:ef:04:41:5c:2c:4a:84:dc:02:76:0c:d0:
++ 66:0f:f0:16:04:58:4d:fd:68:b7:b8:d3:a8:41:a5:5c:3c:6f:
++ 65:3c:d1:f8:ce:43:35:e7:41:5f:53:3d:c9:2c:c3:7d:fc:56:
++ 4a:fa:47:77:38:9d:bb:97:28:0a:3b:91:19:7f:bc:74:ae:15:
++ 6b:bd:20:36:67:45:a5:1e:79:d7:75:e6:89:5c:6d:54:84:d1:
++ 95:d7:a7:b4:33:3c:af:37:c4:79:8f:5e:75:dc:75:c2:18:fb:
++ 61:6f:2d:dc:38:65:5b:ba:67:28:d0:88:d7:8d:b9:23:5a:8e:
++ e8:c6:bb:db:ce:d5:b8:41:2a:ce:93:08:b6:95:ad:34:20:18:
++ d5:3b:37:52:74:50:0b:07:2c:b0:6d:a4:4c:7b:f4:e0:fd:d1:
++ af:17:aa:20:cd:62:e3:f0:9d:37:69:db:41:bd:d4:1c:fb:53:
++ 20:da:88:9d:76:26:67:ce:01:90:a7:80:1d:a9:5b:39:73:68:
++ 54:0a:d1:2a:03:1b:8f:3c:43:5d:5d:c4:51:f1:a7:e7:11:da:
++ 31:2c:49:06:af:04:f4:b8:3c:99:c4:20:b9:06:36:a2:00:92:
++ 61:1d:0c:6d:24:05:e2:82:e1:47:db:a0:5f:ba:b9:fb:ba:fa:
++ 49:12:1e:ce
++-----BEGIN CERTIFICATE-----
++MIICpzCCAY8CCQCwkmSx8toh0jANBgkqhkiG9w0BAQUFADBNMQswCQYDVQQGEwJY
++WTEmMCQGA1UECgwdUHl0aG9uIFNvZnR3YXJlIEZvdW5kYXRpb24gQ0ExFjAUBgNV
++BAMMDW91ci1jYS1zZXJ2ZXIwHhcNMTMwMTA0MTk0NzA3WhcNMjIxMTEzMTk0NzA3
++WjBiMQswCQYDVQQGEwJYWTEXMBUGA1UEBxMOQ2FzdGxlIEFudGhyYXgxIzAhBgNV
++BAoTGlB5dGhvbiBTb2Z0d2FyZSBGb3VuZGF0aW9uMRUwEwYDVQQDEwxmYWtlaG9z
++dG5hbWUwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAK5UQiMI5VkNs2QvL7gU
++aiDdFevNUXRjU4DHAe3ZzzYLZNE69h9gO9VCSS16tJ5fT5VEu0EZyGr0e3V2NkX0
++ZoU0Hc/UaY4qx7LHmn5SYZpIxhJnkf7SyHJK1zUaGlU0/LxYqIuGCtF5dqx1L2OQ
++hEx1GM6RydHdgX69G64LXcY5AgMBAAEwDQYJKoZIhvcNAQEFBQADggEBAK1Fio7v
++xu8EQVwsSoTcAnYM0GYP8BYEWE39aLe406hBpVw8b2U80fjOQzXnQV9TPcksw338
++Vkr6R3c4nbuXKAo7kRl/vHSuFWu9IDZnRaUeedd15olcbVSE0ZXXp7QzPK83xHmP
++XnXcdcIY+2FvLdw4ZVu6ZyjQiNeNuSNajujGu9vO1bhBKs6TCLaVrTQgGNU7N1J0
++UAsHLLBtpEx79OD90a8XqiDNYuPwnTdp20G91Bz7UyDaiJ12JmfOAZCngB2pWzlz
++aFQK0SoDG488Q11dxFHxp+cR2jEsSQavBPS4PJnEILkGNqIAkmEdDG0kBeKC4Ufb
++oF+6ufu6+kkSHs4=
++-----END CERTIFICATE-----
+diff --git a/Lib/test/make_ssl_certs.py b/Lib/test/make_ssl_certs.py
+new file mode 100644
+index 0000000..81d04f8
+--- /dev/null
++++ b/Lib/test/make_ssl_certs.py
+@@ -0,0 +1,176 @@
++"""Make the custom certificate and private key files used by test_ssl
++and friends."""
++
++import os
++import shutil
++import sys
++import tempfile
++from subprocess import *
++
++req_template = """
++ [req]
++ distinguished_name = req_distinguished_name
++ x509_extensions = req_x509_extensions
++ prompt = no
++
++ [req_distinguished_name]
++ C = XY
++ L = Castle Anthrax
++ O = Python Software Foundation
++ CN = {hostname}
++
++ [req_x509_extensions]
++ subjectAltName = DNS:{hostname}
++
++ [ ca ]
++ default_ca = CA_default
++
++ [ CA_default ]
++ dir = cadir
++ database = $dir/index.txt
++ crlnumber = $dir/crl.txt
++ default_md = sha1
++ default_days = 3600
++ default_crl_days = 3600
++ certificate = pycacert.pem
++ private_key = pycakey.pem
++ serial = $dir/serial
++ RANDFILE = $dir/.rand
++
++ policy = policy_match
++
++ [ policy_match ]
++ countryName = match
++ stateOrProvinceName = optional
++ organizationName = match
++ organizationalUnitName = optional
++ commonName = supplied
++ emailAddress = optional
++
++ [ policy_anything ]
++ countryName = optional
++ stateOrProvinceName = optional
++ localityName = optional
++ organizationName = optional
++ organizationalUnitName = optional
++ commonName = supplied
++ emailAddress = optional
++
++
++ [ v3_ca ]
++
++ subjectKeyIdentifier=hash
++ authorityKeyIdentifier=keyid:always,issuer
++ basicConstraints = CA:true
++
++ """
++
++here = os.path.abspath(os.path.dirname(__file__))
++
++def make_cert_key(hostname, sign=False):
++ print("creating cert for " + hostname)
++ tempnames = []
++ for i in range(3):
++ with tempfile.NamedTemporaryFile(delete=False) as f:
++ tempnames.append(f.name)
++ req_file, cert_file, key_file = tempnames
++ try:
++ with open(req_file, 'w') as f:
++ f.write(req_template.format(hostname=hostname))
++ args = ['req', '-new', '-days', '3650',
'-nodes',
++ '-newkey', 'rsa:1024', '-keyout', key_file,
++ '-config', req_file]
++ if sign:
++ with tempfile.NamedTemporaryFile(delete=False) as f:
++ tempnames.append(f.name)
++ reqfile = f.name
++ args += ['-out', reqfile ]
++
++ else:
++ args += ['-x509', '-out', cert_file ]
++ check_call(['openssl'] + args)
++
++ if sign:
++ args = ['ca', '-config', req_file, '-out',
cert_file, '-outdir', 'cadir',
++ '-policy', 'policy_anything', '-batch',
'-infiles', reqfile ]
++ check_call(['openssl'] + args)
++
++
++ with open(cert_file, 'r') as f:
++ cert = f.read()
++ with open(key_file, 'r') as f:
++ key = f.read()
++ return cert, key
++ finally:
++ for name in tempnames:
++ os.remove(name)
++
++TMP_CADIR = 'cadir'
++
++def unmake_ca():
++ shutil.rmtree(TMP_CADIR)
++
++def make_ca():
++ os.mkdir(TMP_CADIR)
++ with open(os.path.join('cadir','index.txt'),'a+') as f:
++ pass # empty file
++ with open(os.path.join('cadir','crl.txt'),'a+') as f:
++ f.write("00")
++ with open(os.path.join('cadir','index.txt.attr'),'w+') as
f:
++ f.write('unique_subject = no')
++
++ with tempfile.NamedTemporaryFile("w") as t:
++ t.write(req_template.format(hostname='our-ca-server'))
++ t.flush()
++ with tempfile.NamedTemporaryFile() as f:
++ args = ['req', '-new', '-days', '3650',
'-extensions', 'v3_ca', '-nodes',
++ '-newkey', 'rsa:2048', '-keyout',
'pycakey.pem',
++ '-out', f.name,
++ '-subj', '/C=XY/L=Castle Anthrax/O=Python Software
Foundation CA/CN=our-ca-server']
++ check_call(['openssl'] + args)
++ args = ['ca', '-config', t.name, '-create_serial',
++ '-out', 'pycacert.pem', '-batch',
'-outdir', TMP_CADIR,
++ '-keyfile', 'pycakey.pem', '-days',
'3650',
++ '-selfsign', '-extensions', 'v3_ca',
'-infiles', f.name ]
++ check_call(['openssl'] + args)
++ args = ['ca', '-config', t.name, '-gencrl',
'-out', 'revocation.crl']
++ check_call(['openssl'] + args)
++
++if __name__ == '__main__':
++ os.chdir(here)
++ cert, key = make_cert_key('localhost')
++ with open('ssl_cert.pem', 'w') as f:
++ f.write(cert)
++ with open('ssl_key.pem', 'w') as f:
++ f.write(key)
++ print("password protecting ssl_key.pem in ssl_key.passwd.pem")
++
check_call(['openssl','rsa','-in','ssl_key.pem','-out','ssl_key.passwd.pem','-des3','-passout','pass:somepass'])
++
check_call(['openssl','rsa','-in','ssl_key.pem','-out','keycert.passwd.pem','-des3','-passout','pass:somepass'])
++
++ with open('keycert.pem', 'w') as f:
++ f.write(key)
++ f.write(cert)
++
++ with open('keycert.passwd.pem', 'a+') as f:
++ f.write(cert)
++
++ # For certificate matching tests
++ make_ca()
++ cert, key = make_cert_key('fakehostname')
++ with open('keycert2.pem', 'w') as f:
++ f.write(key)
++ f.write(cert)
++
++ cert, key = make_cert_key('localhost', True)
++ with open('keycert3.pem', 'w') as f:
++ f.write(key)
++ f.write(cert)
++
++ cert, key = make_cert_key('fakehostname', True)
++ with open('keycert4.pem', 'w') as f:
++ f.write(key)
++ f.write(cert)
++
++ unmake_ca()
++ print("\n\nPlease change the values in test_ssl.py, test_parse_cert function
related to notAfter,notBefore and serialNumber")
++
check_call(['openssl','x509','-in','keycert.pem','-dates','-serial','-noout'])
+diff --git a/Lib/test/pycacert.pem b/Lib/test/pycacert.pem
+new file mode 100644
+index 0000000..09b1f3e
+--- /dev/null
++++ b/Lib/test/pycacert.pem
+@@ -0,0 +1,78 @@
++Certificate:
++ Data:
++ Version: 3 (0x2)
++ Serial Number: 12723342612721443280 (0xb09264b1f2da21d0)
++ Signature Algorithm: sha1WithRSAEncryption
++ Issuer: C=XY, O=Python Software Foundation CA, CN=our-ca-server
++ Validity
++ Not Before: Jan 4 19:47:07 2013 GMT
++ Not After : Jan 2 19:47:07 2023 GMT
++ Subject: C=XY, O=Python Software Foundation CA, CN=our-ca-server
++ Subject Public Key Info:
++ Public Key Algorithm: rsaEncryption
++ Public-Key: (2048 bit)
++ Modulus:
++ 00:e7:de:e9:e3:0c:9f:00:b6:a1:fd:2b:5b:96:d2:
++ 6f:cc:e0:be:86:b9:20:5e:ec:03:7a:55:ab:ea:a4:
++ e9:f9:49:85:d2:66:d5:ed:c7:7a:ea:56:8e:2d:8f:
++ e7:42:e2:62:28:a9:9f:d6:1b:8e:eb:b5:b4:9c:9f:
++ 14:ab:df:e6:94:8b:76:1d:3e:6d:24:61:ed:0c:bf:
++ 00:8a:61:0c:df:5c:c8:36:73:16:00:cd:47:ba:6d:
++ a4:a4:74:88:83:23:0a:19:fc:09:a7:3c:4a:4b:d3:
++ e7:1d:2d:e4:ea:4c:54:21:f3:26:db:89:37:18:d4:
++ 02:bb:40:32:5f:a4:ff:2d:1c:f7:d4:bb:ec:8e:cf:
++ 5c:82:ac:e6:7c:08:6c:48:85:61:07:7f:25:e0:5c:
++ e0:bc:34:5f:e0:b9:04:47:75:c8:47:0b:8d:bc:d6:
++ c8:68:5f:33:83:62:d2:20:44:35:b1:ad:81:1a:8a:
++ cd:bc:35:b0:5c:8b:47:d6:18:e9:9c:18:97:cc:01:
++ 3c:29:cc:e8:1e:e4:e4:c1:b8:de:e7:c2:11:18:87:
++ 5a:93:34:d8:a6:25:f7:14:71:eb:e4:21:a2:d2:0f:
++ 2e:2e:d4:62:00:35:d3:d6:ef:5c:60:4b:4c:a9:14:
++ e2:dd:15:58:46:37:33:26:b7:e7:2e:5d:ed:42:e4:
++ c5:4d
++ Exponent: 65537 (0x10001)
++ X509v3 extensions:
++ X509v3 Subject Key Identifier:
++ BC:DD:62:D9:76:DA:1B:D2:54:6B:CF:E0:66:9B:1E:1E:7B:56:0C:0B
++ X509v3 Authority Key Identifier:
++ keyid:BC:DD:62:D9:76:DA:1B:D2:54:6B:CF:E0:66:9B:1E:1E:7B:56:0C:0B
++
++ X509v3 Basic Constraints:
++ CA:TRUE
++ Signature Algorithm: sha1WithRSAEncryption
++ 7d:0a:f5:cb:8d:d3:5d:bd:99:8e:f8:2b:0f:ba:eb:c2:d9:a6:
++ 27:4f:2e:7b:2f:0e:64:d8:1c:35:50:4e:ee:fc:90:b9:8d:6d:
++ a8:c5:c6:06:b0:af:f3:2d:bf:3b:b8:42:07:dd:18:7d:6d:95:
++ 54:57:85:18:60:47:2f:eb:78:1b:f9:e8:17:fd:5a:0d:87:17:
++ 28:ac:4c:6a:e6:bc:29:f4:f4:55:70:29:42:de:85:ea:ab:6c:
++ 23:06:64:30:75:02:8e:53:bc:5e:01:33:37:cc:1e:cd:b8:a4:
++ fd:ca:e4:5f:65:3b:83:1c:86:f1:55:02:a0:3a:8f:db:91:b7:
++ 40:14:b4:e7:8d:d2:ee:73:ba:e3:e5:34:2d:bc:94:6f:4e:24:
++ 06:f7:5f:8b:0e:a7:8e:6b:de:5e:75:f4:32:9a:50:b1:44:33:
++ 9a:d0:05:e2:78:82:ff:db:da:8a:63:eb:a9:dd:d1:bf:a0:61:
++ ad:e3:9e:8a:24:5d:62:0e:e7:4c:91:7f:ef:df:34:36:3b:2f:
++ 5d:f5:84:b2:2f:c4:6d:93:96:1a:6f:30:28:f1:da:12:9a:64:
++ b4:40:33:1d:bd:de:2b:53:a8:ea:be:d6:bc:4e:96:f5:44:fb:
++ 32:18:ae:d5:1f:f6:69:af:b6:4e:7b:1d:58:ec:3b:a9:53:a3:
++ 5e:58:c8:9e
++-----BEGIN CERTIFICATE-----
++MIIDbTCCAlWgAwIBAgIJALCSZLHy2iHQMA0GCSqGSIb3DQEBBQUAME0xCzAJBgNV
++BAYTAlhZMSYwJAYDVQQKDB1QeXRob24gU29mdHdhcmUgRm91bmRhdGlvbiBDQTEW
++MBQGA1UEAwwNb3VyLWNhLXNlcnZlcjAeFw0xMzAxMDQxOTQ3MDdaFw0yMzAxMDIx
++OTQ3MDdaME0xCzAJBgNVBAYTAlhZMSYwJAYDVQQKDB1QeXRob24gU29mdHdhcmUg
++Rm91bmRhdGlvbiBDQTEWMBQGA1UEAwwNb3VyLWNhLXNlcnZlcjCCASIwDQYJKoZI
++hvcNAQEBBQADggEPADCCAQoCggEBAOfe6eMMnwC2of0rW5bSb8zgvoa5IF7sA3pV
++q+qk6flJhdJm1e3HeupWji2P50LiYiipn9Ybjuu1tJyfFKvf5pSLdh0+bSRh7Qy/
++AIphDN9cyDZzFgDNR7ptpKR0iIMjChn8Cac8SkvT5x0t5OpMVCHzJtuJNxjUArtA
++Ml+k/y0c99S77I7PXIKs5nwIbEiFYQd/JeBc4Lw0X+C5BEd1yEcLjbzWyGhfM4Ni
++0iBENbGtgRqKzbw1sFyLR9YY6ZwYl8wBPCnM6B7k5MG43ufCERiHWpM02KYl9xRx
++6+QhotIPLi7UYgA109bvXGBLTKkU4t0VWEY3Mya35y5d7ULkxU0CAwEAAaNQME4w
++HQYDVR0OBBYEFLzdYtl22hvSVGvP4GabHh57VgwLMB8GA1UdIwQYMBaAFLzdYtl2
++2hvSVGvP4GabHh57VgwLMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEB
++AH0K9cuN0129mY74Kw+668LZpidPLnsvDmTYHDVQTu78kLmNbajFxgawr/Mtvzu4
++QgfdGH1tlVRXhRhgRy/reBv56Bf9Wg2HFyisTGrmvCn09FVwKULeheqrbCMGZDB1
++Ao5TvF4BMzfMHs24pP3K5F9lO4MchvFVAqA6j9uRt0AUtOeN0u5zuuPlNC28lG9O
++JAb3X4sOp45r3l519DKaULFEM5rQBeJ4gv/b2opj66nd0b+gYa3jnookXWIO50yR
++f+/fNDY7L131hLIvxG2TlhpvMCjx2hKaZLRAMx293itTqOq+1rxOlvVE+zIYrtUf
++9mmvtk57HVjsO6lTo15YyJ4=
++-----END CERTIFICATE-----
+diff --git a/Lib/test/revocation.crl b/Lib/test/revocation.crl
+new file mode 100644
+index 0000000..6d89b08
+--- /dev/null
++++ b/Lib/test/revocation.crl
+@@ -0,0 +1,11 @@
++-----BEGIN X509 CRL-----
++MIIBpjCBjwIBATANBgkqhkiG9w0BAQUFADBNMQswCQYDVQQGEwJYWTEmMCQGA1UE
++CgwdUHl0aG9uIFNvZnR3YXJlIEZvdW5kYXRpb24gQ0ExFjAUBgNVBAMMDW91ci1j
++YS1zZXJ2ZXIXDTEzMTEyMTE3MDg0N1oXDTIzMDkzMDE3MDg0N1qgDjAMMAoGA1Ud
++FAQDAgEAMA0GCSqGSIb3DQEBBQUAA4IBAQCNJXC2mVKauEeN3LlQ3ZtM5gkH3ExH
+++i4bmJjtJn497WwvvoIeUdrmVXgJQR93RtV37hZwN0SXMLlNmUZPH4rHhihayw4m
++unCzVj/OhCCY7/TPjKuJ1O/0XhaLBpBVjQN7R/1ujoRKbSia/CD3vcn7Fqxzw7LK
++fSRCKRGTj1CZiuxrphtFchwALXSiFDy9mr2ZKhImcyq1PydfgEzU78APpOkMQsIC
++UNJ/cf3c9emzf+dUtcMEcejQ3mynBo4eIGg1EW42bz4q4hSjzQlKcBV0muw5qXhc
++HOxH2iTFhQ7SrvVuK/dM14rYM4B5mSX3nRC1kNmXpS9j3wJDhuwmjHed
++-----END X509 CRL-----
+diff --git a/Lib/test/sha256.pem b/Lib/test/sha256.pem
+index 9475576..d3db4b8 100644
+--- a/Lib/test/sha256.pem
++++ b/Lib/test/sha256.pem
+@@ -1,128 +1,128 @@
+ # Certificate chain for
https://sha256.tbs-internet.com
+- 0 s:/C=FR/postalCode=14000/ST=Calvados/L=CAEN/street=22 rue de Bretagne/O=TBS
INTERNET/OU=0002 440443810/OU=Certificats TBS
X509/CN=ecom.tbs-x509.com
+- i:/C=FR/ST=Calvados/L=Caen/O=TBS INTERNET/OU=Terms and Conditions:
http://www.tbs-internet.com/CA/repository/OU=TBS INTERNET CA/CN=TBS X509 CA business
++ 0 s:/C=FR/postalCode=14000/ST=Calvados/L=CAEN/street=22 rue de Bretagne/O=TBS
INTERNET/OU=0002 440443810/OU=sha-256
production/CN=sha256.tbs-internet.com
++ i:/C=FR/ST=Calvados/L=Caen/O=TBS INTERNET/OU=Terms and Conditions:
http://www.tbs-internet.com/CA/repository/OU=TBS INTERNET CA/CN=TBS X509 CA SGC
+ -----BEGIN CERTIFICATE-----
+-MIIGTjCCBTagAwIBAgIQOh3d9dNDPq1cSdJmEiMpqDANBgkqhkiG9w0BAQUFADCB
+-yTELMAkGA1UEBhMCRlIxETAPBgNVBAgTCENhbHZhZG9zMQ0wCwYDVQQHEwRDYWVu
+-MRUwEwYDVQQKEwxUQlMgSU5URVJORVQxSDBGBgNVBAsTP1Rlcm1zIGFuZCBDb25k
+-aXRpb25zOiBodHRwOi8vd3d3LnRicy1pbnRlcm5ldC5jb20vQ0EvcmVwb3NpdG9y
+-eTEYMBYGA1UECxMPVEJTIElOVEVSTkVUIENBMR0wGwYDVQQDExRUQlMgWDUwOSBD
+-QSBidXNpbmVzczAeFw0xMTAxMjUwMDAwMDBaFw0xMzAyMDUyMzU5NTlaMIHHMQsw
+-CQYDVQQGEwJGUjEOMAwGA1UEERMFMTQwMDAxETAPBgNVBAgTCENhbHZhZG9zMQ0w
+-CwYDVQQHEwRDQUVOMRswGQYDVQQJExIyMiBydWUgZGUgQnJldGFnbmUxFTATBgNV
+-BAoTDFRCUyBJTlRFUk5FVDEXMBUGA1UECxMOMDAwMiA0NDA0NDM4MTAxHTAbBgNV
+-BAsTFENlcnRpZmljYXRzIFRCUyBYNTA5MRowGAYDVQQDExFlY29tLnRicy14NTA5
+-LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKRrlHUnJ++1lpcg
+-jtYco7cdmRe+EEfTmwPfCdfV3G1QfsTSvY6FfMpm/83pqHfT+4ANwr18wD9ZrAEN
+-G16mf9VdCGK12+TP7DmqeZyGIqlFFoahQnmb8EarvE43/1UeQ2CV9XmzwZvpqeli
+-LfXsFonawrY3H6ZnMwS64St61Z+9gdyuZ/RbsoZBbT5KUjDEG844QRU4OT1IGeEI
+-eY5NM5RNIh6ZNhVtqeeCxMS7afONkHQrOco73RdSTRck/Hj96Ofl3MHNHryr+AMK
+-DGFk1kLCZGpPdXtkxXvaDeQoiYDlil26CWc+YK6xyDPMdsWvoG14ZLyCpzMXA7/7
+-4YAQRH0CAwEAAaOCAjAwggIsMB8GA1UdIwQYMBaAFBoJBMz5CY+7HqDO1KQUf0vV
+-I1jNMB0GA1UdDgQWBBQgOU8HsWzbmD4WZP5Wtdw7jca2WDAOBgNVHQ8BAf8EBAMC
+-BaAwDAYDVR0TAQH/BAIwADAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIw
+-TAYDVR0gBEUwQzBBBgsrBgEEAYDlNwIBATAyMDAGCCsGAQUFBwIBFiRodHRwczov
+-L3d3dy50YnMtaW50ZXJuZXQuY29tL0NBL0NQUzEwdwYDVR0fBHAwbjA3oDWgM4Yx
+-aHR0cDovL2NybC50YnMtaW50ZXJuZXQuY29tL1RCU1g1MDlDQWJ1c2luZXNzLmNy
+-bDAzoDGgL4YtaHR0cDovL2NybC50YnMteDUwOS5jb20vVEJTWDUwOUNBYnVzaW5l
+-c3MuY3JsMIGwBggrBgEFBQcBAQSBozCBoDA9BggrBgEFBQcwAoYxaHR0cDovL2Ny
+-dC50YnMtaW50ZXJuZXQuY29tL1RCU1g1MDlDQWJ1c2luZXNzLmNydDA5BggrBgEF
+-BQcwAoYtaHR0cDovL2NydC50YnMteDUwOS5jb20vVEJTWDUwOUNBYnVzaW5lc3Mu
+-Y3J0MCQGCCsGAQUFBzABhhhodHRwOi8vb2NzcC50YnMteDUwOS5jb20wMwYDVR0R
+-BCwwKoIRZWNvbS50YnMteDUwOS5jb22CFXd3dy5lY29tLnRicy14NTA5LmNvbTAN
+-BgkqhkiG9w0BAQUFAAOCAQEArT4NHfbY87bGAw8lPV4DmHlmuDuVp/y7ltO3Ynse
+-3Rz8RxW2AzuO0Oy2F0Cu4yWKtMyEyMXyHqWtae7ElRbdTu5w5GwVBLJHClCzC8S9
+-SpgMMQTx3Rgn8vjkHuU9VZQlulZyiPK7yunjc7c310S9FRZ7XxOwf8Nnx4WnB+No
+-WrfApzhhQl31w+RyrNxZe58hCfDDHmevRvwLjQ785ZoQXJDj2j3qAD4aI2yB8lB5
+-oaE1jlCJzC7Kmz/Y9jzfmv/zAs1LQTm9ktevv4BTUFaGjv9jxnQ1xnS862ZiouLW
+-zZYIlYPf4F6JjXGiIQgQRglILUfq3ftJd9/ok9W9ZF8h8w==
++MIIGXDCCBUSgAwIBAgIRAKpVmHgg9nfCodAVwcP4siwwDQYJKoZIhvcNAQELBQAw
++gcQxCzAJBgNVBAYTAkZSMREwDwYDVQQIEwhDYWx2YWRvczENMAsGA1UEBxMEQ2Fl
++bjEVMBMGA1UEChMMVEJTIElOVEVSTkVUMUgwRgYDVQQLEz9UZXJtcyBhbmQgQ29u
++ZGl0aW9uczogaHR0cDovL3d3dy50YnMtaW50ZXJuZXQuY29tL0NBL3JlcG9zaXRv
++cnkxGDAWBgNVBAsTD1RCUyBJTlRFUk5FVCBDQTEYMBYGA1UEAxMPVEJTIFg1MDkg
++Q0EgU0dDMB4XDTEyMDEwNDAwMDAwMFoXDTE0MDIxNzIzNTk1OVowgcsxCzAJBgNV
++BAYTAkZSMQ4wDAYDVQQREwUxNDAwMDERMA8GA1UECBMIQ2FsdmFkb3MxDTALBgNV
++BAcTBENBRU4xGzAZBgNVBAkTEjIyIHJ1ZSBkZSBCcmV0YWduZTEVMBMGA1UEChMM
++VEJTIElOVEVSTkVUMRcwFQYDVQQLEw4wMDAyIDQ0MDQ0MzgxMDEbMBkGA1UECxMS
++c2hhLTI1NiBwcm9kdWN0aW9uMSAwHgYDVQQDExdzaGEyNTYudGJzLWludGVybmV0
++LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKQIX/zdJcyxty0m
++PM1XQSoSSifueS3AVcgqMsaIKS/u+rYzsv4hQ/qA6vLn5m5/ewUcZDj7zdi6rBVf
++PaVNXJ6YinLX0tkaW8TEjeVuZG5yksGZlhCt1CJ1Ho9XLiLaP4uJ7MCoNUntpJ+E
++LfrOdgsIj91kPmwjDJeztVcQCvKzhjVJA/KxdInc0JvOATn7rpaSmQI5bvIjufgo
++qVsTPwVFzuUYULXBk7KxRT7MiEqnd5HvviNh0285QC478zl3v0I0Fb5El4yD3p49
++IthcRnxzMKc0UhU5ogi0SbONyBfm/mzONVfSxpM+MlyvZmJqrbuuLoEDzJD+t8PU
++xSuzgbcCAwEAAaOCAj4wggI6MB8GA1UdIwQYMBaAFAdEdoWTKLx/bXjSCuv6TEvf
++2YIfMB0GA1UdDgQWBBT/qTGYdaj+f61c2IRFL/B1eEsM8DAOBgNVHQ8BAf8EBAMC
++BaAwDAYDVR0TAQH/BAIwADA0BgNVHSUELTArBggrBgEFBQcDAQYIKwYBBQUHAwIG
++CisGAQQBgjcKAwMGCWCGSAGG+EIEATBLBgNVHSAERDBCMEAGCisGAQQB5TcCBAEw
++MjAwBggrBgEFBQcCARYkaHR0cHM6Ly93d3cudGJzLWludGVybmV0LmNvbS9DQS9D
++UFM0MG0GA1UdHwRmMGQwMqAwoC6GLGh0dHA6Ly9jcmwudGJzLWludGVybmV0LmNv
++bS9UQlNYNTA5Q0FTR0MuY3JsMC6gLKAqhihodHRwOi8vY3JsLnRicy14NTA5LmNv
++bS9UQlNYNTA5Q0FTR0MuY3JsMIGmBggrBgEFBQcBAQSBmTCBljA4BggrBgEFBQcw
++AoYsaHR0cDovL2NydC50YnMtaW50ZXJuZXQuY29tL1RCU1g1MDlDQVNHQy5jcnQw
++NAYIKwYBBQUHMAKGKGh0dHA6Ly9jcnQudGJzLXg1MDkuY29tL1RCU1g1MDlDQVNH
++Qy5jcnQwJAYIKwYBBQUHMAGGGGh0dHA6Ly9vY3NwLnRicy14NTA5LmNvbTA/BgNV
++HREEODA2ghdzaGEyNTYudGJzLWludGVybmV0LmNvbYIbd3d3LnNoYTI1Ni50YnMt
++aW50ZXJuZXQuY29tMA0GCSqGSIb3DQEBCwUAA4IBAQA0pOuL8QvAa5yksTbGShzX
++ABApagunUGoEydv4YJT1MXy9tTp7DrWaozZSlsqBxrYAXP1d9r2fuKbEniYHxaQ0
++UYaf1VSIlDo1yuC8wE7wxbHDIpQ/E5KAyxiaJ8obtDhFstWAPAH+UoGXq0kj2teN
++21sFQ5dXgA95nldvVFsFhrRUNB6xXAcaj0VZFhttI0ZfQZmQwEI/P+N9Jr40OGun
++aa+Dn0TMeUH4U20YntfLbu2nDcJcYfyurm+8/0Tr4HznLnedXu9pCPYj0TaddrgT
++XO0oFiyy7qGaY6+qKh71yD64Y3ycCJ/HR9Wm39mjZYc9ezYwT4noP6r7Lk8YO7/q
+ -----END CERTIFICATE-----
+- 1 s:/C=FR/ST=Calvados/L=Caen/O=TBS INTERNET/OU=Terms and Conditions:
http://www.tbs-internet.com/CA/repository/OU=TBS INTERNET CA/CN=TBS X509 CA business
++ 1 s:/C=FR/ST=Calvados/L=Caen/O=TBS INTERNET/OU=Terms and Conditions:
http://www.tbs-internet.com/CA/repository/OU=TBS INTERNET CA/CN=TBS X509 CA SGC
+ i:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root
+ -----BEGIN CERTIFICATE-----
+-MIIFPzCCBCegAwIBAgIQDlBz/++iRSmLDeVRHT/hADANBgkqhkiG9w0BAQUFADBv
++MIIFVjCCBD6gAwIBAgIQXpDZ0ETJMV02WTx3GTnhhTANBgkqhkiG9w0BAQUFADBv
+ MQswCQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFk
+ ZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBF
+-eHRlcm5hbCBDQSBSb290MB4XDTA1MTIwMTAwMDAwMFoXDTE5MDcwOTE4MTkyMlow
+-gckxCzAJBgNVBAYTAkZSMREwDwYDVQQIEwhDYWx2YWRvczENMAsGA1UEBxMEQ2Fl
++eHRlcm5hbCBDQSBSb290MB4XDTA1MTIwMTAwMDAwMFoXDTE5MDYyNDE5MDYzMFow
++gcQxCzAJBgNVBAYTAkZSMREwDwYDVQQIEwhDYWx2YWRvczENMAsGA1UEBxMEQ2Fl
+ bjEVMBMGA1UEChMMVEJTIElOVEVSTkVUMUgwRgYDVQQLEz9UZXJtcyBhbmQgQ29u
+ ZGl0aW9uczogaHR0cDovL3d3dy50YnMtaW50ZXJuZXQuY29tL0NBL3JlcG9zaXRv
+-cnkxGDAWBgNVBAsTD1RCUyBJTlRFUk5FVCBDQTEdMBsGA1UEAxMUVEJTIFg1MDkg
+-Q0EgYnVzaW5lc3MwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDB1PAU
+-qudCcz3tmyGcf+u6EkZqonKKHrV4gZYbvVkIRojmmlhfi/jwvpHvo8bqSt/9Rj5S
+-jhCDW0pcbI+IPPtD1Jy+CHNSfnMqVDy6CKQ3p5maTzCMG6ZT+XjnvcND5v+FtaiB
+-xk1iCX6uvt0jeUtdZvYbyytsSDE6c3Y5//wRxOF8tM1JxibwO3pyER26jbbN2gQz
+-m/EkdGjLdJ4svPk23WDAvQ6G0/z2LcAaJB+XLfqRwfQpHQvfKa1uTi8PivC8qtip
+-rmNQMMPMjxSK2azX8cKjjTDJiUKaCb4VHlJDWKEsCFRpgJAoAuX8f7Yfs1M4esGo
+-sWb3PGspK3O22uIlAgMBAAGjggF6MIIBdjAdBgNVHQ4EFgQUGgkEzPkJj7seoM7U
+-pBR/S9UjWM0wDgYDVR0PAQH/BAQDAgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwGAYD
+-VR0gBBEwDzANBgsrBgEEAYDlNwIBATB7BgNVHR8EdDByMDigNqA0hjJodHRwOi8v
+-Y3JsLmNvbW9kb2NhLmNvbS9BZGRUcnVzdEV4dGVybmFsQ0FSb290LmNybDA2oDSg
+-MoYwaHR0cDovL2NybC5jb21vZG8ubmV0L0FkZFRydXN0RXh0ZXJuYWxDQVJvb3Qu
+-Y3JsMIGGBggrBgEFBQcBAQR6MHgwOwYIKwYBBQUHMAKGL2h0dHA6Ly9jcnQuY29t
+-b2RvY2EuY29tL0FkZFRydXN0VVROU2VydmVyQ0EuY3J0MDkGCCsGAQUFBzAChi1o
+-dHRwOi8vY3J0LmNvbW9kby5uZXQvQWRkVHJ1c3RVVE5TZXJ2ZXJDQS5jcnQwEQYJ
+-YIZIAYb4QgEBBAQDAgIEMA0GCSqGSIb3DQEBBQUAA4IBAQA7mqrMgk/MrE6QnbNA
+-h4nRCn2ti4bg4w2C3lB6bSvRPnYwuNw9Jb8vuKkNFzRDxNJXqVDZdfFW5CVQJuyd
+-nfAx83+wk+spzvFaE1KhFYfN9G9pQfXUfvDRoIcJgPEKUXL1wRiOG+IjU3VVI8pg
+-IgqHkr7ylln5i5zCiFAPuIJmYUSFg/gxH5xkCNcjJqqrHrHatJr6Qrrke93joupw
+-oU1njfAcZtYp6fbiK6u2b1pJqwkVBE8RsfLnPhRj+SFbpvjv8Od7o/ieJhFIYQNU
+-k2jX2u8qZnAiNw93LZW9lpYjtuvMXq8QQppENNja5b53q7UwI+lU7ZGjZ7quuESp
+-J6/5
++cnkxGDAWBgNVBAsTD1RCUyBJTlRFUk5FVCBDQTEYMBYGA1UEAxMPVEJTIFg1MDkg
++Q0EgU0dDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsgOkO3f7wzN6
++rOjg45tR5vjBfzK7qmV9IBxb/QW9EEXxG+E7FNhZqQLtwGBKoSsHTnQqV75wWMk0
++9tinWvftBkSpj5sTi/8cbzJfUvTSVYh3Qxv6AVVjMMH/ruLjE6y+4PoaPs8WoYAQ
++ts5R4Z1g8c/WnTepLst2x0/Wv7GmuoQi+gXvHU6YrBiu7XkeYhzc95QdviWSJRDk
++owhb5K43qhcvjRmBfO/paGlCliDGZp8mHwrI21mwobWpVjTxZRwYO3bd4+TGcI4G
++Ie5wmHwE8F7SK1tgSqbBacKjDa93j7txKkfz/Yd2n7TGqOXiHPsJpG655vrKtnXk
++9vs1zoDeJQIDAQABo4IBljCCAZIwHQYDVR0OBBYEFAdEdoWTKLx/bXjSCuv6TEvf
++2YIfMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEAMCAGA1UdJQQZ
++MBcGCisGAQQBgjcKAwMGCWCGSAGG+EIEATAYBgNVHSAEETAPMA0GCysGAQQBgOU3
++AgQBMHsGA1UdHwR0MHIwOKA2oDSGMmh0dHA6Ly9jcmwuY29tb2RvY2EuY29tL0Fk
++ZFRydXN0RXh0ZXJuYWxDQVJvb3QuY3JsMDagNKAyhjBodHRwOi8vY3JsLmNvbW9k
++by5uZXQvQWRkVHJ1c3RFeHRlcm5hbENBUm9vdC5jcmwwgYAGCCsGAQUFBwEBBHQw
++cjA4BggrBgEFBQcwAoYsaHR0cDovL2NydC5jb21vZG9jYS5jb20vQWRkVHJ1c3RV
++VE5TR0NDQS5jcnQwNgYIKwYBBQUHMAKGKmh0dHA6Ly9jcnQuY29tb2RvLm5ldC9B
++ZGRUcnVzdFVUTlNHQ0NBLmNydDARBglghkgBhvhCAQEEBAMCAgQwDQYJKoZIhvcN
++AQEFBQADggEBAK2zEzs+jcIrVK9oDkdDZNvhuBYTdCfpxfFs+OAujW0bIfJAy232
++euVsnJm6u/+OrqKudD2tad2BbejLLXhMZViaCmK7D9nrXHx4te5EP8rL19SUVqLY
++1pTnv5dhNgEgvA7n5lIzDSYs7yRLsr7HJsYPr6SeYSuZizyX1SNz7ooJ32/F3X98
++RB0Mlc/E0OyOrkQ9/y5IrnpnaSora8CnUrV5XNOg+kyCz9edCyx4D5wXYcwZPVWz
++8aDqquESrezPyjtfi4WRO4s/VD3HLZvOxzMrWAVYCDG9FxaOhF0QGuuG1F7F3GKV
++v6prNyCl016kRl2j1UT+a7gLd8fA25A4C9E=
+ -----END CERTIFICATE-----
+ 2 s:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root
+- i:/C=US/ST=UT/L=Salt Lake City/O=The USERTRUST
Network/OU=http://www.usertrust.com/CN=UTN-USERFirst-Hardware
++ i:/C=US/ST=UT/L=Salt Lake City/O=The USERTRUST
Network/OU=http://www.usertrust.com/CN=UTN - DATACorp SGC
+ -----BEGIN CERTIFICATE-----
+-MIIETzCCAzegAwIBAgIQHM5EYpUZep1jUvnyI6m2mDANBgkqhkiG9w0BAQUFADCB
+-lzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug
++MIIEZjCCA06gAwIBAgIQUSYKkxzif5zDpV954HKugjANBgkqhkiG9w0BAQUFADCB
++kzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug
+ Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho
+-dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3Qt
+-SGFyZHdhcmUwHhcNMDUwNjA3MDgwOTEwWhcNMTkwNzA5MTgxOTIyWjBvMQswCQYD
+-VQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0
+-IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5h
+-bCBDQSBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAt/caM+by
+-AAQtOeBOW+0fvGwPzbX6I7bO3psRM5ekKUx9k5+9SryT7QMa44/P5W1QWtaXKZRa
+-gLBJetsulf24yr83OC0ePpFBrXBWx/BPP+gynnTKyJBU6cZfD3idmkA8Dqxhql4U
+-j56HoWpQ3NeaTq8Fs6ZxlJxxs1BgCscTnTgHhgKo6ahpJhiQq0ywTyOrOk+E2N/O
+-n+Fpb7vXQtdrROTHre5tQV9yWnEIN7N5ZaRZoJQ39wAvDcKSctrQOHLbFKhFxF0q
+-fbe01sTurM0TRLfJK91DACX6YblpalgjEbenM49WdVn1zSnXRrcKK2W200JvFbK4
+-e/vv6V1T1TRaJwIDAQABo4G9MIG6MB8GA1UdIwQYMBaAFKFyXyYbKJhDlV0HN9WF
+-lp1L0sNFMB0GA1UdDgQWBBStvZh6NLQm9/rEJlTvA73gJMtUGjAOBgNVHQ8BAf8E
+-BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zARBglghkgBhvhCAQEEBAMCAQIwRAYDVR0f
+-BD0wOzA5oDegNYYzaHR0cDovL2NybC51c2VydHJ1c3QuY29tL1VUTi1VU0VSRmly
+-c3QtSGFyZHdhcmUuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQByQhANOs4kClrwF8BW
+-onvUOGCSjRK52zYZgDXYNjDtmr5rJ6NyPFDNn+JxkLpjYetIFMTbSRe679Bt8m7a
+-gIAoQYFQtxMuyLnJegB2aEbQiIxh/tC21UcFF7ktdnDoTlA6w3pLuvunaI84Of3o
+-2YBrhzkTbCfaYk5JRlTpudW9DkUkHBsyx3nknPKnplkIGaK0jgn8E0n+SFabYaHk
+-I9LroYT/+JtLefh9lgBdAgVv0UPbzoGfuDsrk/Zh+UrgbLFpHoVnElhzbkh64Z0X
+-OGaJunQc68cCZu5HTn/aK7fBGMcVflRCXLVEQpU9PIAdGA8Ynvg684t8GMaKsRl1
+-jIGZ
++dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xGzAZBgNVBAMTElVUTiAtIERBVEFDb3Jw
++IFNHQzAeFw0wNTA2MDcwODA5MTBaFw0xOTA2MjQxOTA2MzBaMG8xCzAJBgNVBAYT
++AlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0
++ZXJuYWwgVFRQIE5ldHdvcmsxIjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENB
++IFJvb3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC39xoz5vIABC05
++4E5b7R+8bA/Ntfojts7emxEzl6QpTH2Tn71KvJPtAxrjj8/lbVBa1pcplFqAsEl6
++2y6V/bjKvzc4LR4+kUGtcFbH8E8/6DKedMrIkFTpxl8PeJ2aQDwOrGGqXhSPnoeh
++alDc15pOrwWzpnGUnHGzUGAKxxOdOAeGAqjpqGkmGJCrTLBPI6s6T4TY386f4Wlv
++u9dC12tE5Met7m1BX3JacQg3s3llpFmglDf3AC8NwpJy2tA4ctsUqEXEXSp9t7TW
++xO6szRNEt8kr3UMAJfphuWlqWCMRt6czj1Z1WfXNKddGtworZbbTQm8Vsrh7++/p
++XVPVNFonAgMBAAGjgdgwgdUwHwYDVR0jBBgwFoAUUzLRs89/+uDxoF2FTpLSnkUd
++tE8wHQYDVR0OBBYEFK29mHo0tCb3+sQmVO8DveAky1QaMA4GA1UdDwEB/wQEAwIB
++BjAPBgNVHRMBAf8EBTADAQH/MBEGCWCGSAGG+EIBAQQEAwIBAjAgBgNVHSUEGTAX
++BgorBgEEAYI3CgMDBglghkgBhvhCBAEwPQYDVR0fBDYwNDAyoDCgLoYsaHR0cDov
++L2NybC51c2VydHJ1c3QuY29tL1VUTi1EQVRBQ29ycFNHQy5jcmwwDQYJKoZIhvcN
++AQEFBQADggEBAMbuUxdoFLJRIh6QWA2U/b3xcOWGLcM2MY9USEbnLQg3vGwKYOEO
++rVE04BKT6b64q7gmtOmWPSiPrmQH/uAB7MXjkesYoPF1ftsK5p+R26+udd8jkWjd
++FwBaS/9kbHDrARrQkNnHptZt9hPk/7XJ0h4qy7ElQyZ42TCbTg0evmnv3+r+LbPM
+++bDdtRTKkdSytaX7ARmjR3mfnYyVhzT4HziS2jamEfpr62vp3EV4FTkG101B5CHI
++3C+H0be/SGB1pWLLJN47YaApIKa+xWycxOkKaSLvkTr6Jq/RW0GnOuL4OAdCq8Fb
+++M5tug8EPzI0rNwEKNdwMBQmBsTkm5jVz3g=
+ -----END CERTIFICATE-----
+- 3 s:/C=US/ST=UT/L=Salt Lake City/O=The USERTRUST
Network/OU=http://www.usertrust.com/CN=UTN-USERFirst-Hardware
+- i:/C=US/ST=UT/L=Salt Lake City/O=The USERTRUST
Network/OU=http://www.usertrust.com/CN=UTN-USERFirst-Hardware
++ 3 s:/C=US/ST=UT/L=Salt Lake City/O=The USERTRUST
Network/OU=http://www.usertrust.com/CN=UTN - DATACorp SGC
++ i:/C=US/ST=UT/L=Salt Lake City/O=The USERTRUST
Network/OU=http://www.usertrust.com/CN=UTN - DATACorp SGC
+ -----BEGIN CERTIFICATE-----
+-MIIEdDCCA1ygAwIBAgIQRL4Mi1AAJLQR0zYq/mUK/TANBgkqhkiG9w0BAQUFADCB
+-lzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug
++MIIEXjCCA0agAwIBAgIQRL4Mi1AAIbQR0ypoBqmtaTANBgkqhkiG9w0BAQUFADCB
++kzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug
+ Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho
+-dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3Qt
+-SGFyZHdhcmUwHhcNOTkwNzA5MTgxMDQyWhcNMTkwNzA5MTgxOTIyWjCBlzELMAkG
+-A1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEe
+-MBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8v
+-d3d3LnVzZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdh
+-cmUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCx98M4P7Sof885glFn
+-0G2f0v9Y8+efK+wNiVSZuTiZFvfgIXlIwrthdBKWHTxqctU8EGc6Oe0rE81m65UJ
+-M6Rsl7HoxuzBdXmcRl6Nq9Bq/bkqVRcQVLMZ8Jr28bFdtqdt++BxF2uiiPsA3/4a
+-MXcMmgF6sTLjKwEHOG7DpV4jvEWbe1DByTCP2+UretNb+zNAHqDVmBe8i4fDidNd
+-oI6yqqr2jmmIBsX6iSHzCJ1pLgkzmykNRg+MzEk0sGlRvfkGzWitZky8PqxhvQqI
+-DsjfPe58BEydCl5rkdbux+0ojatNh4lz0G6k0B4WixThdkQDf2Os5M1JnMWS9Ksy
+-oUhbAgMBAAGjgbkwgbYwCwYDVR0PBAQDAgHGMA8GA1UdEwEB/wQFMAMBAf8wHQYD
+-VR0OBBYEFKFyXyYbKJhDlV0HN9WFlp1L0sNFMEQGA1UdHwQ9MDswOaA3oDWGM2h0
+-dHA6Ly9jcmwudXNlcnRydXN0LmNvbS9VVE4tVVNFUkZpcnN0LUhhcmR3YXJlLmNy
+-bDAxBgNVHSUEKjAoBggrBgEFBQcDAQYIKwYBBQUHAwUGCCsGAQUFBwMGBggrBgEF
+-BQcDBzANBgkqhkiG9w0BAQUFAAOCAQEARxkP3nTGmZev/K0oXnWO6y1n7k57K9cM
+-//bey1WiCuFMVGWTYGufEpytXoMs61quwOQt9ABjHbjAbPLPSbtNk28Gpgoiskli
+-CE7/yMgUsogWXecB5BKV5UU0s4tpvc+0hY91UZ59Ojg6FEgSxvunOxqNDYJAB+gE
+-CJChicsZUN/KHAG8HQQZexB2lzvukJDKxA4fFm517zP4029bHpbj4HR3dHuKom4t
+-3XbWOTCC8KucUvIqx69JXn7HaOWCgchqJ/kniCrVWFCVH/A7HFe7fRQ5YiuayZSS
+-KqMiDP+JJn1fIytH1xUdqWqeUQ0qUZ6B+dQ7XnASfxAynB67nfhmqA==
++dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xGzAZBgNVBAMTElVUTiAtIERBVEFDb3Jw
++IFNHQzAeFw05OTA2MjQxODU3MjFaFw0xOTA2MjQxOTA2MzBaMIGTMQswCQYDVQQG
++EwJVUzELMAkGA1UECBMCVVQxFzAVBgNVBAcTDlNhbHQgTGFrZSBDaXR5MR4wHAYD
++VQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxITAfBgNVBAsTGGh0dHA6Ly93d3cu
++dXNlcnRydXN0LmNvbTEbMBkGA1UEAxMSVVROIC0gREFUQUNvcnAgU0dDMIIBIjAN
++BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3+5YEKIrblXEjr8uRgnn4AgPLit6
++E5Qbvfa2gI5lBZMAHryv4g+OGQ0SR+ysraP6LnD43m77VkIVni5c7yPeIbkFdicZ
++D0/Ww5y0vpQZY/KmEQrrU0icvvIpOxboGqBMpsn0GFlowHDyUwDAXlCCpVZvNvlK
++4ESGoE1O1kduSUrLZ9emxAW5jh70/P/N5zbgnAVssjMiFdC04MwXwLLA9P4yPykq
++lXvY8qdOD1R8oQ2AswkDwf9c3V6aPryuvEeKaq5xyh+xKrhfQgUL7EYw0XILyulW
++bfXv33i+Ybqypa4ETLyorGkVl73v67SMvzX41MPRKA5cOp9wGDMgd8SirwIDAQAB
++o4GrMIGoMAsGA1UdDwQEAwIBxjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRT
++MtGzz3/64PGgXYVOktKeRR20TzA9BgNVHR8ENjA0MDKgMKAuhixodHRwOi8vY3Js
++LnVzZXJ0cnVzdC5jb20vVVROLURBVEFDb3JwU0dDLmNybDAqBgNVHSUEIzAhBggr
++BgEFBQcDAQYKKwYBBAGCNwoDAwYJYIZIAYb4QgQBMA0GCSqGSIb3DQEBBQUAA4IB
++AQAnNZcAiosovcYzMB4p/OL31ZjUQLtgyr+rFywJNn9Q+kHcrpY6CiM+iVnJowft
++Gzet/Hy+UUla3joKVAgWRcKZsYfNjGjgaQPpxE6YsjuMFrMOoAyYUJuTqXAJyCyj
++j98C5OBxOvG0I3KgqgHf35g+FFCgMSa9KOlaMCZ1+XtgHI3zzVAmbQQnmt/VDUVH
++KWss5nbZqSl9Mt3JNjy9rjXxEZ4du5A/EkdOjtd+D2JzHVImOBwYSf0wdJrE5SIv
++2MCN7ZF6TACPcn9d2t0bi0Vr591pl6jFVkwPDPafepE39peC4N1xaf92P2BNPM/3
++mfnGV/TJVTl4uix5yaaIK/QI
+ -----END CERTIFICATE-----
+diff --git a/Lib/test/ssl_cert.pem b/Lib/test/ssl_cert.pem
+new file mode 100644
+index 0000000..47a7d7e
+--- /dev/null
++++ b/Lib/test/ssl_cert.pem
+@@ -0,0 +1,15 @@
++-----BEGIN CERTIFICATE-----
++MIICVDCCAb2gAwIBAgIJANfHOBkZr8JOMA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV
++BAYTAlhZMRcwFQYDVQQHEw5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9u
++IFNvZnR3YXJlIEZvdW5kYXRpb24xEjAQBgNVBAMTCWxvY2FsaG9zdDAeFw0xMDEw
++MDgyMzAxNTZaFw0yMDEwMDUyMzAxNTZaMF8xCzAJBgNVBAYTAlhZMRcwFQYDVQQH
++Ew5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9uIFNvZnR3YXJlIEZvdW5k
++YXRpb24xEjAQBgNVBAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAw
++gYkCgYEA21vT5isq7F68amYuuNpSFlKDPrMUCa4YWYqZRt2OZ+/3NKaZ2xAiSwr7
++6MrQF70t5nLbSPpqE5+5VrS58SY+g/sXLiFd6AplH1wJZwh78DofbFYXUggktFMt
++pTyiX8jtP66bkcPkDADA089RI1TQR6Ca+n7HFa7c1fabVV6i3zkCAwEAAaMYMBYw
++FAYDVR0RBA0wC4IJbG9jYWxob3N0MA0GCSqGSIb3DQEBBQUAA4GBAHPctQBEQ4wd
++BJ6+JcpIraopLn8BGhbjNWj40mmRqWB/NAWF6M5ne7KpGAu7tLeG4hb1zLaldK8G
++lxy2GPSRF6LFS48dpEj2HbMv2nvv6xxalDMJ9+DicWgAKTQ6bcX2j3GUkCR0g/T1
++CRlNBAAlvhKzO7Clpf9l0YKBEfraJByX
++-----END CERTIFICATE-----
+diff --git a/Lib/test/ssl_key.passwd.pem b/Lib/test/ssl_key.passwd.pem
+new file mode 100644
+index 0000000..2524672
+--- /dev/null
++++ b/Lib/test/ssl_key.passwd.pem
+@@ -0,0 +1,18 @@
++-----BEGIN RSA PRIVATE KEY-----
++Proc-Type: 4,ENCRYPTED
++DEK-Info: DES-EDE3-CBC,1A8D9D2A02EC698A
++
++kJYbfZ8L0sfe9Oty3gw0aloNnY5E8fegRfQLZlNoxTl6jNt0nIwI8kDJ36CZgR9c
++u3FDJm/KqrfUoz8vW+qEnWhSG7QPX2wWGPHd4K94Yz/FgrRzZ0DoK7XxXq9gOtVA
++AVGQhnz32p+6WhfGsCr9ArXEwRZrTk/FvzEPaU5fHcoSkrNVAGX8IpSVkSDwEDQr
++Gv17+cfk99UV1OCza6yKHoFkTtrC+PZU71LomBabivS2Oc4B9hYuSR2hF01wTHP+
++YlWNagZOOVtNz4oKK9x9eNQpmfQXQvPPTfusexKIbKfZrMvJoxcm1gfcZ0H/wK6P
++6wmXSG35qMOOztCZNtperjs1wzEBXznyK8QmLcAJBjkfarABJX9vBEzZV0OUKhy+
++noORFwHTllphbmydLhu6ehLUZMHPhzAS5UN7srtpSN81eerDMy0RMUAwA7/PofX1
++94Me85Q8jP0PC9ETdsJcPqLzAPETEYu0ELewKRcrdyWi+tlLFrpE5KT/s5ecbl9l
++7B61U4Kfd1PIXc/siINhU3A3bYK+845YyUArUOnKf1kEox7p1RpD7yFqVT04lRTo
++cibNKATBusXSuBrp2G6GNuhWEOSafWCKJQAzgCYIp6ZTV2khhMUGppc/2H3CF6cO
++zX0KtlPVZC7hLkB6HT8SxYUwF1zqWY7+/XPPdc37MeEZ87Q3UuZwqORLY+Z0hpgt
++L5JXBCoklZhCAaN2GqwFLXtGiRSRFGY7xXIhbDTlE65Wv1WGGgDLMKGE1gOz3yAo
++2jjG1+yAHJUdE69XTFHSqSkvaloA1W03LdMXZ9VuQJ/ySXCie6ABAQ==
++-----END RSA PRIVATE KEY-----
+diff --git a/Lib/test/ssl_key.pem b/Lib/test/ssl_key.pem
+new file mode 100644
+index 0000000..3fd3bbd
+--- /dev/null
++++ b/Lib/test/ssl_key.pem
+@@ -0,0 +1,16 @@
++-----BEGIN PRIVATE KEY-----
++MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBANtb0+YrKuxevGpm
++LrjaUhZSgz6zFAmuGFmKmUbdjmfv9zSmmdsQIksK++jK0Be9LeZy20j6ahOfuVa0
++ufEmPoP7Fy4hXegKZR9cCWcIe/A6H2xWF1IIJLRTLaU8ol/I7T+um5HD5AwAwNPP
++USNU0Eegmvp+xxWu3NX2m1Veot85AgMBAAECgYA3ZdZ673X0oexFlq7AAmrutkHt
++CL7LvwrpOiaBjhyTxTeSNWzvtQBkIU8DOI0bIazA4UreAFffwtvEuPmonDb3F+Iq
++SMAu42XcGyVZEl+gHlTPU9XRX7nTOXVt+MlRRRxL6t9GkGfUAXI3XxJDXW3c0vBK
++UL9xqD8cORXOfE06rQJBAP8mEX1ERkR64Ptsoe4281vjTlNfIbs7NMPkUnrn9N/Y
++BLhjNIfQ3HFZG8BTMLfX7kCS9D593DW5tV4Z9BP/c6cCQQDcFzCcVArNh2JSywOQ
++ZfTfRbJg/Z5Lt9Fkngv1meeGNPgIMLN8Sg679pAOOWmzdMO3V706rNPzSVMME7E5
++oPIfAkEA8pDddarP5tCvTTgUpmTFbakm0KoTZm2+FzHcnA4jRh+XNTjTOv98Y6Ik
++eO5d1ZnKXseWvkZncQgxfdnMqqpj5wJAcNq/RVne1DbYlwWchT2Si65MYmmJ8t+F
++0mcsULqjOnEMwf5e+ptq5LzwbyrHZYq5FNk7ocufPv/ZQrcSSC+cFwJBAKvOJByS
++x56qyGeZLOQlWS2JS3KJo59XuLFGqcbgN9Om9xFa41Yb4N9NvplFivsvZdw3m1Q/
++SPIXQuT8RMPDVNQ=
++-----END PRIVATE KEY-----
+diff --git a/Lib/test/ssl_servers.py b/Lib/test/ssl_servers.py
+new file mode 100644
+index 0000000..a312e28
+--- /dev/null
++++ b/Lib/test/ssl_servers.py
+@@ -0,0 +1,209 @@
++import os
++import sys
++import ssl
++import pprint
++import urllib
++import urlparse
++# Rename HTTPServer to _HTTPServer so as to avoid confusion with HTTPSServer.
++from BaseHTTPServer import HTTPServer as _HTTPServer, BaseHTTPRequestHandler
++from SimpleHTTPServer import SimpleHTTPRequestHandler
++
++from test import test_support as support
++threading = support.import_module("threading")
++
++here = os.path.dirname(__file__)
++
++HOST = support.HOST
++CERTFILE = os.path.join(here, 'keycert.pem')
++
++# This one's based on HTTPServer, which is based on SocketServer
++
++class HTTPSServer(_HTTPServer):
++
++ def __init__(self, server_address, handler_class, context):
++ _HTTPServer.__init__(self, server_address, handler_class)
++ self.context = context
++
++ def __str__(self):
++ return ('<%s %s:%s>' %
++ (self.__class__.__name__,
++ self.server_name,
++ self.server_port))
++
++ def get_request(self):
++ # override this to wrap socket with SSL
++ try:
++ sock, addr = self.socket.accept()
++ sslconn = self.context.wrap_socket(sock, server_side=True)
++ except OSError as e:
++ # socket errors are silenced by the caller, print them here
++ if support.verbose:
++ sys.stderr.write("Got an error:\n%s\n" % e)
++ raise
++ return sslconn, addr
++
++class RootedHTTPRequestHandler(SimpleHTTPRequestHandler):
++ # need to override translate_path to get a known root,
++ # instead of using os.curdir, since the test could be
++ # run from anywhere
++
++ server_version = "TestHTTPS/1.0"
++ root = here
++ # Avoid hanging when a request gets interrupted by the client
++ timeout = 5
++
++ def translate_path(self, path):
++ """Translate a /-separated PATH to the local filename syntax.
++
++ Components that mean special things to the local file system
++ (e.g. drive or directory names) are ignored. (XXX They should
++ probably be diagnosed.)
++
++ """
++ # abandon query parameters
++ path = urlparse.urlparse(path)[2]
++ path = os.path.normpath(urllib.unquote(path))
++ words = path.split('/')
++ words = filter(None, words)
++ path = self.root
++ for word in words:
++ drive, word = os.path.splitdrive(word)
++ head, word = os.path.split(word)
++ path = os.path.join(path, word)
++ return path
++
++ def log_message(self, format, *args):
++ # we override this to suppress logging unless "verbose"
++ if support.verbose:
++ sys.stdout.write(" server (%s:%d %s):\n [%s] %s\n" %
++ (self.server.server_address,
++ self.server.server_port,
++ self.request.cipher(),
++ self.log_date_time_string(),
++ format%args))
++
++
++class StatsRequestHandler(BaseHTTPRequestHandler):
++ """Example HTTP request handler which returns SSL statistics on GET
++ requests.
++ """
++
++ server_version = "StatsHTTPS/1.0"
++
++ def do_GET(self, send_body=True):
++ """Serve a GET request."""
++ sock = self.rfile.raw._sock
++ context = sock.context
++ stats = {
++ 'session_cache': context.session_stats(),
++ 'cipher': sock.cipher(),
++ 'compression': sock.compression(),
++ }
++ body = pprint.pformat(stats)
++ body = body.encode('utf-8')
++ self.send_response(200)
++ self.send_header("Content-type", "text/plain;
charset=utf-8")
++ self.send_header("Content-Length", str(len(body)))
++ self.end_headers()
++ if send_body:
++ self.wfile.write(body)
++
++ def do_HEAD(self):
++ """Serve a HEAD request."""
++ self.do_GET(send_body=False)
++
++ def log_request(self, format, *args):
++ if support.verbose:
++ BaseHTTPRequestHandler.log_request(self, format, *args)
++
++
++class HTTPSServerThread(threading.Thread):
++
++ def __init__(self, context, host=HOST, handler_class=None):
++ self.flag = None
++ self.server = HTTPSServer((host, 0),
++ handler_class or RootedHTTPRequestHandler,
++ context)
++ self.port = self.server.server_port
++ threading.Thread.__init__(self)
++ self.daemon = True
++
++ def __str__(self):
++ return "<%s %s>" % (self.__class__.__name__, self.server)
++
++ def start(self, flag=None):
++ self.flag = flag
++ threading.Thread.start(self)
++
++ def run(self):
++ if self.flag:
++ self.flag.set()
++ try:
++ self.server.serve_forever(0.05)
++ finally:
++ self.server.server_close()
++
++ def stop(self):
++ self.server.shutdown()
++
++
++def make_https_server(case, context=None, certfile=CERTFILE,
++ host=HOST, handler_class=None):
++ if context is None:
++ context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
++ # We assume the certfile contains both private key and certificate
++ context.load_cert_chain(certfile)
++ server = HTTPSServerThread(context, host, handler_class)
++ flag = threading.Event()
++ server.start(flag)
++ flag.wait()
++ def cleanup():
++ if support.verbose:
++ sys.stdout.write('stopping HTTPS server\n')
++ server.stop()
++ if support.verbose:
++ sys.stdout.write('joining HTTPS thread\n')
++ server.join()
++ case.addCleanup(cleanup)
++ return server
++
++
++if __name__ == "__main__":
++ import argparse
++ parser = argparse.ArgumentParser(
++ description='Run a test HTTPS server. '
++ 'By default, the current directory is served.')
++ parser.add_argument('-p', '--port', type=int, default=4433,
++ help='port to listen on (default: %(default)s)')
++ parser.add_argument('-q', '--quiet', dest='verbose',
default=True,
++ action='store_false', help='be less verbose')
++ parser.add_argument('-s', '--stats',
dest='use_stats_handler', default=False,
++ action='store_true', help='always return stats
page')
++ parser.add_argument('--curve-name', dest='curve_name', type=str,
++ action='store',
++ help='curve name for EC-based Diffie-Hellman')
++ parser.add_argument('--ciphers', dest='ciphers', type=str,
++ help='allowed cipher list')
++ parser.add_argument('--dh', dest='dh_file', type=str,
action='store',
++ help='PEM file containing DH parameters')
++ args = parser.parse_args()
++
++ support.verbose = args.verbose
++ if args.use_stats_handler:
++ handler_class = StatsRequestHandler
++ else:
++ handler_class = RootedHTTPRequestHandler
++ handler_class.root = os.getcwd()
++ context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
++ context.load_cert_chain(CERTFILE)
++ if args.curve_name:
++ context.set_ecdh_curve(args.curve_name)
++ if args.dh_file:
++ context.load_dh_params(args.dh_file)
++ if args.ciphers:
++ context.set_ciphers(args.ciphers)
++
++ server = HTTPSServer(("", args.port), handler_class, context)
++ if args.verbose:
++ print("Listening on
https://localhost:{0.port}".format(args))
++ server.serve_forever(0.1)
+diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
+index 91b8029..54dbbd5 100644
+--- a/Lib/test/test_ssl.py
++++ b/Lib/test/test_ssl.py
+@@ -1,35 +1,78 @@
++# -*- encoding: utf-8 -*-
+ # Test the support for SSL and sockets
+
+ import sys
+ import unittest
+-from test import test_support
++from test import test_support as support
+ import asyncore
+ import socket
+ import select
+ import time
++import datetime
+ import gc
+ import os
+ import errno
+ import pprint
+-import urllib, urlparse
++import tempfile
++import urllib
+ import traceback
+ import weakref
+-import functools
+ import platform
++import functools
++from contextlib import closing
++
++ssl = support.import_module("ssl")
++
++PROTOCOLS = sorted(ssl._PROTOCOL_NAMES)
++HOST = support.HOST
++
++def data_file(*name):
++ return os.path.join(os.path.dirname(__file__), *name)
++
++# The custom key and certificate files used in test_ssl are generated
++# using Lib/test/make_ssl_certs.py.
++# Other certificates are simply fetched from the Internet servers they
++# are meant to authenticate.
++
++CERTFILE = data_file("keycert.pem")
++BYTES_CERTFILE = CERTFILE.encode(sys.getfilesystemencoding())
++ONLYCERT = data_file("ssl_cert.pem")
++ONLYKEY = data_file("ssl_key.pem")
++BYTES_ONLYCERT = ONLYCERT.encode(sys.getfilesystemencoding())
++BYTES_ONLYKEY = ONLYKEY.encode(sys.getfilesystemencoding())
++CERTFILE_PROTECTED = data_file("keycert.passwd.pem")
++ONLYKEY_PROTECTED = data_file("ssl_key.passwd.pem")
++KEY_PASSWORD = "somepass"
++CAPATH = data_file("capath")
++BYTES_CAPATH = CAPATH.encode(sys.getfilesystemencoding())
++CAFILE_NEURONIO = data_file("capath", "4e1295a3.0")
++CAFILE_CACERT = data_file("capath", "5ed36f99.0")
++
++
++# empty CRL
++CRLFILE = data_file("revocation.crl")
++
++# Two keys and certs signed by the same CA (for SNI tests)
++SIGNED_CERTFILE = data_file("keycert3.pem")
++SIGNED_CERTFILE2 = data_file("keycert4.pem")
++SIGNING_CA = data_file("pycacert.pem")
++
++SVN_PYTHON_ORG_ROOT_CERT = data_file("https_svn_python_org_root.pem")
+
+-from BaseHTTPServer import HTTPServer
+-from SimpleHTTPServer import SimpleHTTPRequestHandler
++EMPTYCERT = data_file("nullcert.pem")
++BADCERT = data_file("badcert.pem")
++WRONGCERT = data_file("XXXnonexisting.pem")
++BADKEY = data_file("badkey.pem")
++NOKIACERT = data_file("nokia.pem")
++NULLBYTECERT = data_file("nullbytecert.pem")
+
+-ssl = test_support.import_module("ssl")
++DHFILE = data_file("dh512.pem")
++BYTES_DHFILE = DHFILE.encode(sys.getfilesystemencoding())
+
+-HOST = test_support.HOST
+-CERTFILE = None
+-SVN_PYTHON_ORG_ROOT_CERT = None
+-NULLBYTECERT = None
+
+ def handle_error(prefix):
+ exc_format = ' '.join(traceback.format_exception(*sys.exc_info()))
+- if test_support.verbose:
++ if support.verbose:
+ sys.stdout.write(prefix + exc_format)
+
+
+@@ -51,48 +94,76 @@ class BasicTests(unittest.TestCase):
+ pass
+ else:
+ raise
++def can_clear_options():
++ # 0.9.8m or higher
++ return ssl._OPENSSL_API_VERSION >= (0, 9, 8, 13, 15)
++
++def no_sslv2_implies_sslv3_hello():
++ # 0.9.7h or higher
++ return ssl.OPENSSL_VERSION_INFO >= (0, 9, 7, 8, 15)
++
++def have_verify_flags():
++ # 0.9.8 or higher
++ return ssl.OPENSSL_VERSION_INFO >= (0, 9, 8, 0, 15)
++
++def utc_offset(): #NOTE: ignore issues like #1647654
++ # local time = utc time + utc offset
++ if time.daylight and time.localtime().tm_isdst > 0:
++ return -time.altzone # seconds
++ return -time.timezone
++
++def asn1time(cert_time):
++ # Some versions of OpenSSL ignore seconds, see #18207
++ # 0.9.8.i
++ if ssl._OPENSSL_API_VERSION == (0, 9, 8, 9, 15):
++ fmt = "%b %d %H:%M:%S %Y GMT"
++ dt = datetime.datetime.strptime(cert_time, fmt)
++ dt = dt.replace(second=0)
++ cert_time = dt.strftime(fmt)
++ # %d adds leading zero but ASN1_TIME_print() uses leading space
++ if cert_time[4] == "0":
++ cert_time = cert_time[:4] + " " + cert_time[5:]
++
++ return cert_time
+
+ # Issue #9415: Ubuntu hijacks their OpenSSL and forcefully disables SSLv2
+ def skip_if_broken_ubuntu_ssl(func):
+ if hasattr(ssl, 'PROTOCOL_SSLv2'):
+- # We need to access the lower-level wrapper in order to create an
+- # implicit SSL context without trying to connect or listen.
+- try:
+- import _ssl
+- except ImportError:
+- # The returned function won't get executed, just ignore the error
+- pass
+ @functools.wraps(func)
+ def f(*args, **kwargs):
+ try:
+- s = socket.socket(socket.AF_INET)
+- _ssl.sslwrap(s._sock, 0, None, None,
+- ssl.CERT_NONE, ssl.PROTOCOL_SSLv2, None, None)
+- except ssl.SSLError as e:
++ ssl.SSLContext(ssl.PROTOCOL_SSLv2)
++ except ssl.SSLError:
+ if (ssl.OPENSSL_VERSION_INFO == (0, 9, 8, 15, 15) and
+- platform.linux_distribution() == ('debian',
'squeeze/sid', '')
+- and 'Invalid SSL protocol variant specified' in str(e)):
++ platform.linux_distribution() == ('debian',
'squeeze/sid', '')):
+ raise unittest.SkipTest("Patched Ubuntu OpenSSL breaks
behaviour")
+ return func(*args, **kwargs)
+ return f
+ else:
+ return func
+
++needs_sni = unittest.skipUnless(ssl.HAS_SNI, "SNI support needed for this
test")
++
+
+ class BasicSocketTests(unittest.TestCase):
+
+ def test_constants(self):
+- #ssl.PROTOCOL_SSLv2
+- ssl.PROTOCOL_SSLv23
+- ssl.PROTOCOL_SSLv3
+- ssl.PROTOCOL_TLSv1
+ ssl.CERT_NONE
+ ssl.CERT_OPTIONAL
+ ssl.CERT_REQUIRED
++ ssl.OP_CIPHER_SERVER_PREFERENCE
++ ssl.OP_SINGLE_DH_USE
++ if ssl.HAS_ECDH:
++ ssl.OP_SINGLE_ECDH_USE
++ if ssl.OPENSSL_VERSION_INFO >= (1, 0):
++ ssl.OP_NO_COMPRESSION
++ self.assertIn(ssl.HAS_SNI, {True, False})
++ self.assertIn(ssl.HAS_ECDH, {True, False})
++
+
+ def test_random(self):
+ v = ssl.RAND_status()
+- if test_support.verbose:
++ if support.verbose:
+ sys.stdout.write("\n RAND_status is %d (%s)\n"
+ % (v, (v and "sufficient randomness") or
+ "insufficient randomness"))
+@@ -104,9 +175,19 @@ class BasicSocketTests(unittest.TestCase):
+ # note that this uses an 'unofficial' function in _ssl.c,
+ # provided solely for this test, to exercise the certificate
+ # parsing code
+- p = ssl._ssl._test_decode_cert(CERTFILE, False)
+- if test_support.verbose:
++ p = ssl._ssl._test_decode_cert(CERTFILE)
++ if support.verbose:
+ sys.stdout.write("\n" + pprint.pformat(p) + "\n")
++ self.assertEqual(p['issuer'],
++ ((('countryName', 'XY'),),
++ (('localityName', 'Castle Anthrax'),),
++ (('organizationName', 'Python Software
Foundation'),),
++ (('commonName', 'localhost'),))
++ )
++ # Note the next three asserts will fail if the keys are regenerated
++ self.assertEqual(p['notAfter'], asn1time('Oct 5 23:01:56 2020
GMT'))
++ self.assertEqual(p['notBefore'], asn1time('Oct 8 23:01:56 2010
GMT'))
++ self.assertEqual(p['serialNumber'], 'D7C7381919AFC24E')
+ self.assertEqual(p['subject'],
+ ((('countryName', 'XY'),),
+ (('localityName', 'Castle Anthrax'),),
+@@ -117,16 +198,22 @@ class BasicSocketTests(unittest.TestCase):
+ # Issue #13034: the subjectAltName in some certificates
+ # (notably projects.developer.nokia.com:443) wasn't parsed
+ p = ssl._ssl._test_decode_cert(NOKIACERT)
+- if test_support.verbose:
++ if support.verbose:
+ sys.stdout.write("\n" + pprint.pformat(p) + "\n")
+ self.assertEqual(p['subjectAltName'],
+ (('DNS', 'projects.developer.nokia.com'),
+ ('DNS', 'projects.forum.nokia.com'))
+ )
++ # extra OCSP and AIA fields
++ self.assertEqual(p['OCSP'], ('http://ocsp.verisign.com',))
++ self.assertEqual(p['caIssuers'],
++ ('http://SVRIntl-G3-aia.verisign.com/SVRIntlG3.cer',))
++ self.assertEqual(p['crlDistributionPoints'],
++ ('http://SVRIntl-G3-crl.verisign.com/SVRIntlG3.crl',))
+
+ def test_parse_cert_CVE_2013_4238(self):
+ p = ssl._ssl._test_decode_cert(NULLBYTECERT)
+- if test_support.verbose:
++ if support.verbose:
+ sys.stdout.write("\n" + pprint.pformat(p) + "\n")
+ subject = ((('countryName', 'US'),),
+ (('stateOrProvinceName', 'Oregon'),),
+@@ -137,7 +224,7 @@ class BasicSocketTests(unittest.TestCase):
+ (('emailAddress', 'python-dev(a)python.org'),))
+ self.assertEqual(p['subject'], subject)
+ self.assertEqual(p['issuer'], subject)
+- if ssl.OPENSSL_VERSION_INFO >= (0, 9, 8):
++ if ssl._OPENSSL_API_VERSION >= (0, 9, 8):
+ san = (('DNS', 'altnull.python.org\x00example.com'),
+ ('email', 'null@python.org\x00user(a)example.org'),
+ ('URI',
'http://null.python.org\x00http://example.org'),
+@@ -192,24 +279,7 @@ class BasicSocketTests(unittest.TestCase):
+ self.assertTrue(s.startswith("OpenSSL {:d}.{:d}.{:d}".format(major,
minor, fix)),
+ (s, t))
+
+- @test_support.requires_resource('network')
+- def test_ciphers(self):
+- remote = ("svn.python.org", 443)
+- with test_support.transient_internet(remote[0]):
+- s = ssl.wrap_socket(socket.socket(socket.AF_INET),
+- cert_reqs=ssl.CERT_NONE, ciphers="ALL")
+- s.connect(remote)
+- s = ssl.wrap_socket(socket.socket(socket.AF_INET),
+- cert_reqs=ssl.CERT_NONE, ciphers="DEFAULT")
+- s.connect(remote)
+- # Error checking occurs when connecting, because the SSL context
+- # isn't created before.
+- s = ssl.wrap_socket(socket.socket(socket.AF_INET),
+- cert_reqs=ssl.CERT_NONE,
ciphers="^$:,;?*'dorothyx")
+- with self.assertRaisesRegexp(ssl.SSLError, "No cipher can be
selected"):
+- s.connect(remote)
+-
+- @test_support.cpython_only
++ @support.cpython_only
+ def test_refcycle(self):
+ # Issue #7943: an SSL object doesn't create reference cycles with
+ # itself.
+@@ -224,17 +294,319 @@ class BasicSocketTests(unittest.TestCase):
+ self.assertEqual(wr(), None)
+
+ def test_wrapped_unconnected(self):
+- # The _delegate_methods in socket.py are correctly delegated to by an
+- # unconnected SSLSocket, so they will raise a socket.error rather than
+- # something unexpected like TypeError.
++ # Methods on an unconnected SSLSocket propagate the original
++ # socket.error raise by the underlying socket object.
+ s = socket.socket(socket.AF_INET)
+- ss = ssl.wrap_socket(s)
+- self.assertRaises(socket.error, ss.recv, 1)
+- self.assertRaises(socket.error, ss.recv_into, bytearray(b'x'))
+- self.assertRaises(socket.error, ss.recvfrom, 1)
+- self.assertRaises(socket.error, ss.recvfrom_into, bytearray(b'x'), 1)
+- self.assertRaises(socket.error, ss.send, b'x')
+- self.assertRaises(socket.error, ss.sendto, b'x', ('0.0.0.0',
0))
++ with closing(ssl.wrap_socket(s)) as ss:
++ self.assertRaises(socket.error, ss.recv, 1)
++ self.assertRaises(socket.error, ss.recv_into, bytearray(b'x'))
++ self.assertRaises(socket.error, ss.recvfrom, 1)
++ self.assertRaises(socket.error, ss.recvfrom_into, bytearray(b'x'),
1)
++ self.assertRaises(socket.error, ss.send, b'x')
++ self.assertRaises(socket.error, ss.sendto, b'x', ('0.0.0.0',
0))
++
++ def test_timeout(self):
++ # Issue #8524: when creating an SSL socket, the timeout of the
++ # original socket should be retained.
++ for timeout in (None, 0.0, 5.0):
++ s = socket.socket(socket.AF_INET)
++ s.settimeout(timeout)
++ with closing(ssl.wrap_socket(s)) as ss:
++ self.assertEqual(timeout, ss.gettimeout())
++
++ def test_errors(self):
++ sock = socket.socket()
++ self.assertRaisesRegexp(ValueError,
++ "certfile must be specified",
++ ssl.wrap_socket, sock, keyfile=CERTFILE)
++ self.assertRaisesRegexp(ValueError,
++ "certfile must be specified for server-side
operations",
++ ssl.wrap_socket, sock, server_side=True)
++ self.assertRaisesRegexp(ValueError,
++ "certfile must be specified for server-side
operations",
++ ssl.wrap_socket, sock, server_side=True, certfile="")
++ with closing(ssl.wrap_socket(sock, server_side=True, certfile=CERTFILE)) as s:
++ self.assertRaisesRegexp(ValueError, "can't connect in server-side
mode",
++ s.connect, (HOST, 8080))
++ with self.assertRaises(IOError) as cm:
++ with closing(socket.socket()) as sock:
++ ssl.wrap_socket(sock, certfile=WRONGCERT)
++ self.assertEqual(cm.exception.errno, errno.ENOENT)
++ with self.assertRaises(IOError) as cm:
++ with closing(socket.socket()) as sock:
++ ssl.wrap_socket(sock, certfile=CERTFILE, keyfile=WRONGCERT)
++ self.assertEqual(cm.exception.errno, errno.ENOENT)
++ with self.assertRaises(IOError) as cm:
++ with closing(socket.socket()) as sock:
++ ssl.wrap_socket(sock, certfile=WRONGCERT, keyfile=WRONGCERT)
++ self.assertEqual(cm.exception.errno, errno.ENOENT)
++
++ def test_match_hostname(self):
++ def ok(cert, hostname):
++ ssl.match_hostname(cert, hostname)
++ def fail(cert, hostname):
++ self.assertRaises(ssl.CertificateError,
++ ssl.match_hostname, cert, hostname)
++
++ cert = {'subject': ((('commonName', 'example.com'),),)}
++ ok(cert, 'example.com')
++ ok(cert, 'ExAmple.cOm')
++ fail(cert, 'www.example.com')
++ fail(cert, '.example.com')
++ fail(cert, 'example.org')
++ fail(cert, 'exampleXcom')
++
++ cert = {'subject': ((('commonName', '*.a.com'),),)}
++ ok(cert, 'foo.a.com')
++ fail(cert, 'bar.foo.a.com')
++ fail(cert, 'a.com')
++ fail(cert, 'Xa.com')
++ fail(cert, '.a.com')
++
++ # only match one left-most wildcard
++ cert = {'subject': ((('commonName', 'f*.com'),),)}
++ ok(cert, 'foo.com')
++ ok(cert, 'f.com')
++ fail(cert, 'bar.com')
++ fail(cert, 'foo.a.com')
++ fail(cert, 'bar.foo.com')
++
++ # NULL bytes are bad, CVE-2013-4073
++ cert = {'subject': ((('commonName',
++ 'null.python.org\x00example.org'),),)}
++ ok(cert, 'null.python.org\x00example.org') # or raise an error?
++ fail(cert, 'example.org')
++ fail(cert, 'null.python.org')
++
++ # error cases with wildcards
++ cert = {'subject': ((('commonName', '*.*.a.com'),),)}
++ fail(cert, 'bar.foo.a.com')
++ fail(cert, 'a.com')
++ fail(cert, 'Xa.com')
++ fail(cert, '.a.com')
++
++ cert = {'subject': ((('commonName', 'a.*.com'),),)}
++ fail(cert, 'a.foo.com')
++ fail(cert, 'a..com')
++ fail(cert, 'a.com')
++
++ # wildcard doesn't match IDNA prefix 'xn--'
++ idna =
u'pthon.python.org'.encode("idna").decode("ascii")
++ cert = {'subject': ((('commonName', idna),),)}
++ ok(cert, idna)
++ cert = {'subject': ((('commonName',
'x*.python.org'),),)}
++ fail(cert, idna)
++ cert = {'subject': ((('commonName',
'xn--p*.python.org'),),)}
++ fail(cert, idna)
++
++ # wildcard in first fragment and IDNA A-labels in sequent fragments
++ # are supported.
++ idna =
u'www*.pythn.org'.encode("idna").decode("ascii")
++ cert = {'subject': ((('commonName', idna),),)}
++ ok(cert,
u'www.pythn.org'.encode("idna").decode("ascii"))
++ ok(cert,
u'www1.pythn.org'.encode("idna").decode("ascii"))
++ fail(cert,
u'ftp.pythn.org'.encode("idna").decode("ascii"))
++ fail(cert,
u'pythn.org'.encode("idna").decode("ascii"))
++
++ # Slightly fake real-world example
++ cert = {'notAfter': 'Jun 26 21:41:46 2011 GMT',
++ 'subject': ((('commonName',
'linuxfrz.org'),),),
++ 'subjectAltName': (('DNS', 'linuxfr.org'),
++ ('DNS', 'linuxfr.com'),
++ ('othername',
'<unsupported>'))}
++ ok(cert, 'linuxfr.org')
++ ok(cert, 'linuxfr.com')
++ # Not a "DNS" entry
++ fail(cert, '<unsupported>')
++ # When there is a subjectAltName, commonName isn't used
++ fail(cert, 'linuxfrz.org')
++
++ # A pristine real-world example
++ cert = {'notAfter': 'Dec 18 23:59:59 2011 GMT',
++ 'subject': ((('countryName', 'US'),),
++ (('stateOrProvinceName', 'California'),),
++ (('localityName', 'Mountain View'),),
++ (('organizationName', 'Google Inc'),),
++ (('commonName', 'mail.google.com'),))}
++ ok(cert, 'mail.google.com')
++ fail(cert, 'gmail.com')
++ # Only commonName is considered
++ fail(cert, 'California')
++
++ # Neither commonName nor subjectAltName
++ cert = {'notAfter': 'Dec 18 23:59:59 2011 GMT',
++ 'subject': ((('countryName', 'US'),),
++ (('stateOrProvinceName', 'California'),),
++ (('localityName', 'Mountain View'),),
++ (('organizationName', 'Google Inc'),))}
++ fail(cert, 'mail.google.com')
++
++ # No DNS entry in subjectAltName but a commonName
++ cert = {'notAfter': 'Dec 18 23:59:59 2099 GMT',
++ 'subject': ((('countryName', 'US'),),
++ (('stateOrProvinceName', 'California'),),
++ (('localityName', 'Mountain View'),),
++ (('commonName', 'mail.google.com'),)),
++ 'subjectAltName': (('othername', 'blabla'), )}
++ ok(cert, 'mail.google.com')
++
++ # No DNS entry subjectAltName and no commonName
++ cert = {'notAfter': 'Dec 18 23:59:59 2099 GMT',
++ 'subject': ((('countryName', 'US'),),
++ (('stateOrProvinceName', 'California'),),
++ (('localityName', 'Mountain View'),),
++ (('organizationName', 'Google Inc'),)),
++ 'subjectAltName': (('othername', 'blabla'),)}
++ fail(cert, 'google.com')
++
++ # Empty cert / no cert
++ self.assertRaises(ValueError, ssl.match_hostname, None, 'example.com')
++ self.assertRaises(ValueError, ssl.match_hostname, {}, 'example.com')
++
++ # Issue #17980: avoid denials of service by refusing more than one
++ # wildcard per fragment.
++ cert = {'subject': ((('commonName', 'a*b.com'),),)}
++ ok(cert, 'axxb.com')
++ cert = {'subject': ((('commonName', 'a*b.co*'),),)}
++ fail(cert, 'axxb.com')
++ cert = {'subject': ((('commonName', 'a*b*.com'),),)}
++ with self.assertRaises(ssl.CertificateError) as cm:
++ ssl.match_hostname(cert, 'axxbxxc.com')
++ self.assertIn("too many wildcards", str(cm.exception))
++
++ def test_server_side(self):
++ # server_hostname doesn't work for server sockets
++ ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
++ with closing(socket.socket()) as sock:
++ self.assertRaises(ValueError, ctx.wrap_socket, sock, True,
++ server_hostname="some.hostname")
++
++ def test_unknown_channel_binding(self):
++ # should raise ValueError for unknown type
++ s = socket.socket(socket.AF_INET)
++ with closing(ssl.wrap_socket(s)) as ss:
++ with self.assertRaises(ValueError):
++ ss.get_channel_binding("unknown-type")
++
++ @unittest.skipUnless("tls-unique" in ssl.CHANNEL_BINDING_TYPES,
++ "'tls-unique' channel binding not
available")
++ def test_tls_unique_channel_binding(self):
++ # unconnected should return None for known type
++ s = socket.socket(socket.AF_INET)
++ with closing(ssl.wrap_socket(s)) as ss:
++ self.assertIsNone(ss.get_channel_binding("tls-unique"))
++ # the same for server-side
++ s = socket.socket(socket.AF_INET)
++ with closing(ssl.wrap_socket(s, server_side=True, certfile=CERTFILE)) as ss:
++ self.assertIsNone(ss.get_channel_binding("tls-unique"))
++
++ def test_get_default_verify_paths(self):
++ paths = ssl.get_default_verify_paths()
++ self.assertEqual(len(paths), 6)
++ self.assertIsInstance(paths, ssl.DefaultVerifyPaths)
++
++ with support.EnvironmentVarGuard() as env:
++ env["SSL_CERT_DIR"] = CAPATH
++ env["SSL_CERT_FILE"] = CERTFILE
++ paths = ssl.get_default_verify_paths()
++ self.assertEqual(paths.cafile, CERTFILE)
++ self.assertEqual(paths.capath, CAPATH)
++
++ @unittest.skipUnless(sys.platform == "win32", "Windows
specific")
++ def test_enum_certificates(self):
++ self.assertTrue(ssl.enum_certificates("CA"))
++ self.assertTrue(ssl.enum_certificates("ROOT"))
++
++ self.assertRaises(TypeError, ssl.enum_certificates)
++ self.assertRaises(WindowsError, ssl.enum_certificates, "")
++
++ trust_oids = set()
++ for storename in ("CA", "ROOT"):
++ store = ssl.enum_certificates(storename)
++ self.assertIsInstance(store, list)
++ for element in store:
++ self.assertIsInstance(element, tuple)
++ self.assertEqual(len(element), 3)
++ cert, enc, trust = element
++ self.assertIsInstance(cert, bytes)
++ self.assertIn(enc, {"x509_asn", "pkcs_7_asn"})
++ self.assertIsInstance(trust, (set, bool))
++ if isinstance(trust, set):
++ trust_oids.update(trust)
++
++ serverAuth = "1.3.6.1.5.5.7.3.1"
++ self.assertIn(serverAuth, trust_oids)
++
++ @unittest.skipUnless(sys.platform == "win32", "Windows
specific")
++ def test_enum_crls(self):
++ self.assertTrue(ssl.enum_crls("CA"))
++ self.assertRaises(TypeError, ssl.enum_crls)
++ self.assertRaises(WindowsError, ssl.enum_crls, "")
++
++ crls = ssl.enum_crls("CA")
++ self.assertIsInstance(crls, list)
++ for element in crls:
++ self.assertIsInstance(element, tuple)
++ self.assertEqual(len(element), 2)
++ self.assertIsInstance(element[0], bytes)
++ self.assertIn(element[1], {"x509_asn", "pkcs_7_asn"})
++
++
++ def test_asn1object(self):
++ expected = (129, 'serverAuth', 'TLS Web Server Authentication',
++ '1.3.6.1.5.5.7.3.1')
++
++ val = ssl._ASN1Object('1.3.6.1.5.5.7.3.1')
++ self.assertEqual(val, expected)
++ self.assertEqual(val.nid, 129)
++ self.assertEqual(val.shortname, 'serverAuth')
++ self.assertEqual(val.longname, 'TLS Web Server Authentication')
++ self.assertEqual(val.oid, '1.3.6.1.5.5.7.3.1')
++ self.assertIsInstance(val, ssl._ASN1Object)
++ self.assertRaises(ValueError, ssl._ASN1Object, 'serverAuth')
++
++ val = ssl._ASN1Object.fromnid(129)
++ self.assertEqual(val, expected)
++ self.assertIsInstance(val, ssl._ASN1Object)
++ self.assertRaises(ValueError, ssl._ASN1Object.fromnid, -1)
++ with self.assertRaisesRegexp(ValueError, "unknown NID 100000"):
++ ssl._ASN1Object.fromnid(100000)
++ for i in range(1000):
++ try:
++ obj = ssl._ASN1Object.fromnid(i)
++ except ValueError:
++ pass
++ else:
++ self.assertIsInstance(obj.nid, int)
++ self.assertIsInstance(obj.shortname, str)
++ self.assertIsInstance(obj.longname, str)
++ self.assertIsInstance(obj.oid, (str, type(None)))
++
++ val = ssl._ASN1Object.fromname('TLS Web Server Authentication')
++ self.assertEqual(val, expected)
++ self.assertIsInstance(val, ssl._ASN1Object)
++ self.assertEqual(ssl._ASN1Object.fromname('serverAuth'), expected)
++ self.assertEqual(ssl._ASN1Object.fromname('1.3.6.1.5.5.7.3.1'),
++ expected)
++ with self.assertRaisesRegexp(ValueError, "unknown object
'serverauth'"):
++ ssl._ASN1Object.fromname('serverauth')
++
++ def test_purpose_enum(self):
++ val = ssl._ASN1Object('1.3.6.1.5.5.7.3.1')
++ self.assertIsInstance(ssl.Purpose.SERVER_AUTH, ssl._ASN1Object)
++ self.assertEqual(ssl.Purpose.SERVER_AUTH, val)
++ self.assertEqual(ssl.Purpose.SERVER_AUTH.nid, 129)
++ self.assertEqual(ssl.Purpose.SERVER_AUTH.shortname, 'serverAuth')
++ self.assertEqual(ssl.Purpose.SERVER_AUTH.oid,
++ '1.3.6.1.5.5.7.3.1')
++
++ val = ssl._ASN1Object('1.3.6.1.5.5.7.3.2')
++ self.assertIsInstance(ssl.Purpose.CLIENT_AUTH, ssl._ASN1Object)
++ self.assertEqual(ssl.Purpose.CLIENT_AUTH, val)
++ self.assertEqual(ssl.Purpose.CLIENT_AUTH.nid, 130)
++ self.assertEqual(ssl.Purpose.CLIENT_AUTH.shortname, 'clientAuth')
++ self.assertEqual(ssl.Purpose.CLIENT_AUTH.oid,
++ '1.3.6.1.5.5.7.3.2')
+
+ def test_unsupported_dtls(self):
+ s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+@@ -242,42 +614,606 @@ class BasicSocketTests(unittest.TestCase):
+ with self.assertRaises(NotImplementedError) as cx:
+ ssl.wrap_socket(s, cert_reqs=ssl.CERT_NONE)
+ self.assertEqual(str(cx.exception), "only stream sockets are
supported")
++ ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
++ with self.assertRaises(NotImplementedError) as cx:
++ ctx.wrap_socket(s)
++ self.assertEqual(str(cx.exception), "only stream sockets are
supported")
++
++ def cert_time_ok(self, timestring, timestamp):
++ self.assertEqual(ssl.cert_time_to_seconds(timestring), timestamp)
++
++ def cert_time_fail(self, timestring):
++ with self.assertRaises(ValueError):
++ ssl.cert_time_to_seconds(timestring)
++
++ @unittest.skipUnless(utc_offset(),
++ 'local time needs to be different from UTC')
++ def test_cert_time_to_seconds_timezone(self):
++ # Issue #19940: ssl.cert_time_to_seconds() returns wrong
++ # results if local timezone is not UTC
++ self.cert_time_ok("May 9 00:00:00 2007 GMT", 1178668800.0)
++ self.cert_time_ok("Jan 5 09:34:43 2018 GMT", 1515144883.0)
++
++ def test_cert_time_to_seconds(self):
++ timestring = "Jan 5 09:34:43 2018 GMT"
++ ts = 1515144883.0
++ self.cert_time_ok(timestring, ts)
++ # accept keyword parameter, assert its name
++ self.assertEqual(ssl.cert_time_to_seconds(cert_time=timestring), ts)
++ # accept both %e and %d (space or zero generated by strftime)
++ self.cert_time_ok("Jan 05 09:34:43 2018 GMT", ts)
++ # case-insensitive
++ self.cert_time_ok("JaN 5 09:34:43 2018 GmT", ts)
++ self.cert_time_fail("Jan 5 09:34 2018 GMT") # no seconds
++ self.cert_time_fail("Jan 5 09:34:43 2018") # no GMT
++ self.cert_time_fail("Jan 5 09:34:43 2018 UTC") # not GMT timezone
++ self.cert_time_fail("Jan 35 09:34:43 2018 GMT") # invalid day
++ self.cert_time_fail("Jon 5 09:34:43 2018 GMT") # invalid month
++ self.cert_time_fail("Jan 5 24:00:00 2018 GMT") # invalid hour
++ self.cert_time_fail("Jan 5 09:60:43 2018 GMT") # invalid minute
++
++ newyear_ts = 1230768000.0
++ # leap seconds
++ self.cert_time_ok("Dec 31 23:59:60 2008 GMT", newyear_ts)
++ # same timestamp
++ self.cert_time_ok("Jan 1 00:00:00 2009 GMT", newyear_ts)
++
++ self.cert_time_ok("Jan 5 09:34:59 2018 GMT", 1515144899)
++ # allow 60th second (even if it is not a leap second)
++ self.cert_time_ok("Jan 5 09:34:60 2018 GMT", 1515144900)
++ # allow 2nd leap second for compatibility with time.strptime()
++ self.cert_time_ok("Jan 5 09:34:61 2018 GMT", 1515144901)
++ self.cert_time_fail("Jan 5 09:34:62 2018 GMT") # invalid seconds
++
++ # no special treatement for the special value:
++ # 99991231235959Z (rfc 5280)
++ self.cert_time_ok("Dec 31 23:59:59 9999 GMT", 253402300799.0)
++
++ @support.run_with_locale('LC_ALL', '')
++ def test_cert_time_to_seconds_locale(self):
++ # `cert_time_to_seconds()` should be locale independent
++
++ def local_february_name():
++ return time.strftime('%b', (1, 2, 3, 4, 5, 6, 0, 0, 0))
++
++ if local_february_name().lower() == 'feb':
++ self.skipTest("locale-specific month name needs to be "
++ "different from C locale")
++
++ # locale-independent
++ self.cert_time_ok("Feb 9 00:00:00 2007 GMT", 1170979200.0)
++ self.cert_time_fail(local_february_name() + " 9 00:00:00 2007 GMT")
++
++
++class ContextTests(unittest.TestCase):
++
++ @skip_if_broken_ubuntu_ssl
++ def test_constructor(self):
++ for protocol in PROTOCOLS:
++ ssl.SSLContext(protocol)
++ self.assertRaises(TypeError, ssl.SSLContext)
++ self.assertRaises(ValueError, ssl.SSLContext, -1)
++ self.assertRaises(ValueError, ssl.SSLContext, 42)
++
++ @skip_if_broken_ubuntu_ssl
++ def test_protocol(self):
++ for proto in PROTOCOLS:
++ ctx = ssl.SSLContext(proto)
++ self.assertEqual(ctx.protocol, proto)
++
++ def test_ciphers(self):
++ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ ctx.set_ciphers("ALL")
++ ctx.set_ciphers("DEFAULT")
++ with self.assertRaisesRegexp(ssl.SSLError, "No cipher can be
selected"):
++ ctx.set_ciphers("^$:,;?*'dorothyx")
++
++ @skip_if_broken_ubuntu_ssl
++ def test_options(self):
++ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ # OP_ALL | OP_NO_SSLv2 is the default value
++ self.assertEqual(ssl.OP_ALL | ssl.OP_NO_SSLv2,
++ ctx.options)
++ ctx.options |= ssl.OP_NO_SSLv3
++ self.assertEqual(ssl.OP_ALL | ssl.OP_NO_SSLv2 | ssl.OP_NO_SSLv3,
++ ctx.options)
++ if can_clear_options():
++ ctx.options = (ctx.options & ~ssl.OP_NO_SSLv2) | ssl.OP_NO_TLSv1
++ self.assertEqual(ssl.OP_ALL | ssl.OP_NO_TLSv1 | ssl.OP_NO_SSLv3,
++ ctx.options)
++ ctx.options = 0
++ self.assertEqual(0, ctx.options)
++ else:
++ with self.assertRaises(ValueError):
++ ctx.options = 0
++
++ def test_verify_mode(self):
++ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ # Default value
++ self.assertEqual(ctx.verify_mode, ssl.CERT_NONE)
++ ctx.verify_mode = ssl.CERT_OPTIONAL
++ self.assertEqual(ctx.verify_mode, ssl.CERT_OPTIONAL)
++ ctx.verify_mode = ssl.CERT_REQUIRED
++ self.assertEqual(ctx.verify_mode, ssl.CERT_REQUIRED)
++ ctx.verify_mode = ssl.CERT_NONE
++ self.assertEqual(ctx.verify_mode, ssl.CERT_NONE)
++ with self.assertRaises(TypeError):
++ ctx.verify_mode = None
++ with self.assertRaises(ValueError):
++ ctx.verify_mode = 42
++
++ @unittest.skipUnless(have_verify_flags(),
++ "verify_flags need OpenSSL > 0.9.8")
++ def test_verify_flags(self):
++ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ # default value by OpenSSL
++ self.assertEqual(ctx.verify_flags, ssl.VERIFY_DEFAULT)
++ ctx.verify_flags = ssl.VERIFY_CRL_CHECK_LEAF
++ self.assertEqual(ctx.verify_flags, ssl.VERIFY_CRL_CHECK_LEAF)
++ ctx.verify_flags = ssl.VERIFY_CRL_CHECK_CHAIN
++ self.assertEqual(ctx.verify_flags, ssl.VERIFY_CRL_CHECK_CHAIN)
++ ctx.verify_flags = ssl.VERIFY_DEFAULT
++ self.assertEqual(ctx.verify_flags, ssl.VERIFY_DEFAULT)
++ # supports any value
++ ctx.verify_flags = ssl.VERIFY_CRL_CHECK_LEAF | ssl.VERIFY_X509_STRICT
++ self.assertEqual(ctx.verify_flags,
++ ssl.VERIFY_CRL_CHECK_LEAF | ssl.VERIFY_X509_STRICT)
++ with self.assertRaises(TypeError):
++ ctx.verify_flags = None
++
++ def test_load_cert_chain(self):
++ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ # Combined key and cert in a single file
++ ctx.load_cert_chain(CERTFILE)
++ ctx.load_cert_chain(CERTFILE, keyfile=CERTFILE)
++ self.assertRaises(TypeError, ctx.load_cert_chain, keyfile=CERTFILE)
++ with self.assertRaises(IOError) as cm:
++ ctx.load_cert_chain(WRONGCERT)
++ self.assertEqual(cm.exception.errno, errno.ENOENT)
++ with self.assertRaisesRegexp(ssl.SSLError, "PEM lib"):
++ ctx.load_cert_chain(BADCERT)
++ with self.assertRaisesRegexp(ssl.SSLError, "PEM lib"):
++ ctx.load_cert_chain(EMPTYCERT)
++ # Separate key and cert
++ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ ctx.load_cert_chain(ONLYCERT, ONLYKEY)
++ ctx.load_cert_chain(certfile=ONLYCERT, keyfile=ONLYKEY)
++ ctx.load_cert_chain(certfile=BYTES_ONLYCERT, keyfile=BYTES_ONLYKEY)
++ with self.assertRaisesRegexp(ssl.SSLError, "PEM lib"):
++ ctx.load_cert_chain(ONLYCERT)
++ with self.assertRaisesRegexp(ssl.SSLError, "PEM lib"):
++ ctx.load_cert_chain(ONLYKEY)
++ with self.assertRaisesRegexp(ssl.SSLError, "PEM lib"):
++ ctx.load_cert_chain(certfile=ONLYKEY, keyfile=ONLYCERT)
++ # Mismatching key and cert
++ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ with self.assertRaisesRegexp(ssl.SSLError, "key values mismatch"):
++ ctx.load_cert_chain(SVN_PYTHON_ORG_ROOT_CERT, ONLYKEY)
++ # Password protected key and cert
++ ctx.load_cert_chain(CERTFILE_PROTECTED, password=KEY_PASSWORD)
++ ctx.load_cert_chain(CERTFILE_PROTECTED, password=KEY_PASSWORD.encode())
++ ctx.load_cert_chain(CERTFILE_PROTECTED,
++ password=bytearray(KEY_PASSWORD.encode()))
++ ctx.load_cert_chain(ONLYCERT, ONLYKEY_PROTECTED, KEY_PASSWORD)
++ ctx.load_cert_chain(ONLYCERT, ONLYKEY_PROTECTED, KEY_PASSWORD.encode())
++ ctx.load_cert_chain(ONLYCERT, ONLYKEY_PROTECTED,
++ bytearray(KEY_PASSWORD.encode()))
++ with self.assertRaisesRegexp(TypeError, "should be a string"):
++ ctx.load_cert_chain(CERTFILE_PROTECTED, password=True)
++ with self.assertRaises(ssl.SSLError):
++ ctx.load_cert_chain(CERTFILE_PROTECTED, password="badpass")
++ with self.assertRaisesRegexp(ValueError, "cannot be longer"):
++ # openssl has a fixed limit on the password buffer.
++ # PEM_BUFSIZE is generally set to 1kb.
++ # Return a string larger than this.
++ ctx.load_cert_chain(CERTFILE_PROTECTED, password=b'a' * 102400)
++ # Password callback
++ def getpass_unicode():
++ return KEY_PASSWORD
++ def getpass_bytes():
++ return KEY_PASSWORD.encode()
++ def getpass_bytearray():
++ return bytearray(KEY_PASSWORD.encode())
++ def getpass_badpass():
++ return "badpass"
++ def getpass_huge():
++ return b'a' * (1024 * 1024)
++ def getpass_bad_type():
++ return 9
++ def getpass_exception():
++ raise Exception('getpass error')
++ class GetPassCallable:
++ def __call__(self):
++ return KEY_PASSWORD
++ def getpass(self):
++ return KEY_PASSWORD
++ ctx.load_cert_chain(CERTFILE_PROTECTED, password=getpass_unicode)
++ ctx.load_cert_chain(CERTFILE_PROTECTED, password=getpass_bytes)
++ ctx.load_cert_chain(CERTFILE_PROTECTED, password=getpass_bytearray)
++ ctx.load_cert_chain(CERTFILE_PROTECTED, password=GetPassCallable())
++ ctx.load_cert_chain(CERTFILE_PROTECTED,
++ password=GetPassCallable().getpass)
++ with self.assertRaises(ssl.SSLError):
++ ctx.load_cert_chain(CERTFILE_PROTECTED, password=getpass_badpass)
++ with self.assertRaisesRegexp(ValueError, "cannot be longer"):
++ ctx.load_cert_chain(CERTFILE_PROTECTED, password=getpass_huge)
++ with self.assertRaisesRegexp(TypeError, "must return a string"):
++ ctx.load_cert_chain(CERTFILE_PROTECTED, password=getpass_bad_type)
++ with self.assertRaisesRegexp(Exception, "getpass error"):
++ ctx.load_cert_chain(CERTFILE_PROTECTED, password=getpass_exception)
++ # Make sure the password function isn't called if it isn't needed
++ ctx.load_cert_chain(CERTFILE, password=getpass_exception)
++
++ def test_load_verify_locations(self):
++ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ ctx.load_verify_locations(CERTFILE)
++ ctx.load_verify_locations(cafile=CERTFILE, capath=None)
++ ctx.load_verify_locations(BYTES_CERTFILE)
++ ctx.load_verify_locations(cafile=BYTES_CERTFILE, capath=None)
++ self.assertRaises(TypeError, ctx.load_verify_locations)
++ self.assertRaises(TypeError, ctx.load_verify_locations, None, None, None)
++ with self.assertRaises(IOError) as cm:
++ ctx.load_verify_locations(WRONGCERT)
++ self.assertEqual(cm.exception.errno, errno.ENOENT)
++ with self.assertRaisesRegexp(ssl.SSLError, "PEM lib"):
++ ctx.load_verify_locations(BADCERT)
++ ctx.load_verify_locations(CERTFILE, CAPATH)
++ ctx.load_verify_locations(CERTFILE, capath=BYTES_CAPATH)
++
++ # Issue #10989: crash if the second argument type is invalid
++ self.assertRaises(TypeError, ctx.load_verify_locations, None, True)
++
++ def test_load_verify_cadata(self):
++ # test cadata
++ with open(CAFILE_CACERT) as f:
++ cacert_pem = f.read().decode("ascii")
++ cacert_der = ssl.PEM_cert_to_DER_cert(cacert_pem)
++ with open(CAFILE_NEURONIO) as f:
++ neuronio_pem = f.read().decode("ascii")
++ neuronio_der = ssl.PEM_cert_to_DER_cert(neuronio_pem)
++
++ # test PEM
++ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ self.assertEqual(ctx.cert_store_stats()["x509_ca"], 0)
++ ctx.load_verify_locations(cadata=cacert_pem)
++ self.assertEqual(ctx.cert_store_stats()["x509_ca"], 1)
++ ctx.load_verify_locations(cadata=neuronio_pem)
++ self.assertEqual(ctx.cert_store_stats()["x509_ca"], 2)
++ # cert already in hash table
++ ctx.load_verify_locations(cadata=neuronio_pem)
++ self.assertEqual(ctx.cert_store_stats()["x509_ca"], 2)
++
++ # combined
++ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ combined = "\n".join((cacert_pem, neuronio_pem))
++ ctx.load_verify_locations(cadata=combined)
++ self.assertEqual(ctx.cert_store_stats()["x509_ca"], 2)
++
++ # with junk around the certs
++ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ combined = ["head", cacert_pem, "other", neuronio_pem,
"again",
++ neuronio_pem, "tail"]
++ ctx.load_verify_locations(cadata="\n".join(combined))
++ self.assertEqual(ctx.cert_store_stats()["x509_ca"], 2)
++
++ # test DER
++ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ ctx.load_verify_locations(cadata=cacert_der)
++ ctx.load_verify_locations(cadata=neuronio_der)
++ self.assertEqual(ctx.cert_store_stats()["x509_ca"], 2)
++ # cert already in hash table
++ ctx.load_verify_locations(cadata=cacert_der)
++ self.assertEqual(ctx.cert_store_stats()["x509_ca"], 2)
++
++ # combined
++ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ combined = b"".join((cacert_der, neuronio_der))
++ ctx.load_verify_locations(cadata=combined)
++ self.assertEqual(ctx.cert_store_stats()["x509_ca"], 2)
++
++ # error cases
++ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ self.assertRaises(TypeError, ctx.load_verify_locations, cadata=object)
++
++ with self.assertRaisesRegexp(ssl.SSLError, "no start line"):
++ ctx.load_verify_locations(cadata=u"broken")
++ with self.assertRaisesRegexp(ssl.SSLError, "not enough data"):
++ ctx.load_verify_locations(cadata=b"broken")
++
++
++ def test_load_dh_params(self):
++ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ ctx.load_dh_params(DHFILE)
++ if os.name != 'nt':
++ ctx.load_dh_params(BYTES_DHFILE)
++ self.assertRaises(TypeError, ctx.load_dh_params)
++ self.assertRaises(TypeError, ctx.load_dh_params, None)
++ with self.assertRaises(IOError) as cm:
++ ctx.load_dh_params(WRONGCERT)
++ self.assertEqual(cm.exception.errno, errno.ENOENT)
++ with self.assertRaises(ssl.SSLError) as cm:
++ ctx.load_dh_params(CERTFILE)
++
++ @skip_if_broken_ubuntu_ssl
++ def test_session_stats(self):
++ for proto in PROTOCOLS:
++ ctx = ssl.SSLContext(proto)
++ self.assertEqual(ctx.session_stats(), {
++ 'number': 0,
++ 'connect': 0,
++ 'connect_good': 0,
++ 'connect_renegotiate': 0,
++ 'accept': 0,
++ 'accept_good': 0,
++ 'accept_renegotiate': 0,
++ 'hits': 0,
++ 'misses': 0,
++ 'timeouts': 0,
++ 'cache_full': 0,
++ })
++
++ def test_set_default_verify_paths(self):
++ # There's not much we can do to test that it acts as expected,
++ # so just check it doesn't crash or raise an exception.
++ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ ctx.set_default_verify_paths()
++
++ @unittest.skipUnless(ssl.HAS_ECDH, "ECDH disabled on this OpenSSL build")
++ def test_set_ecdh_curve(self):
++ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ ctx.set_ecdh_curve("prime256v1")
++ ctx.set_ecdh_curve(b"prime256v1")
++ self.assertRaises(TypeError, ctx.set_ecdh_curve)
++ self.assertRaises(TypeError, ctx.set_ecdh_curve, None)
++ self.assertRaises(ValueError, ctx.set_ecdh_curve, "foo")
++ self.assertRaises(ValueError, ctx.set_ecdh_curve, b"foo")
++
++ @needs_sni
++ def test_sni_callback(self):
++ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++
++ # set_servername_callback expects a callable, or None
++ self.assertRaises(TypeError, ctx.set_servername_callback)
++ self.assertRaises(TypeError, ctx.set_servername_callback, 4)
++ self.assertRaises(TypeError, ctx.set_servername_callback, "")
++ self.assertRaises(TypeError, ctx.set_servername_callback, ctx)
++
++ def dummycallback(sock, servername, ctx):
++ pass
++ ctx.set_servername_callback(None)
++ ctx.set_servername_callback(dummycallback)
++
++ @needs_sni
++ def test_sni_callback_refcycle(self):
++ # Reference cycles through the servername callback are detected
++ # and cleared.
++ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ def dummycallback(sock, servername, ctx, cycle=ctx):
++ pass
++ ctx.set_servername_callback(dummycallback)
++ wr = weakref.ref(ctx)
++ del ctx, dummycallback
++ gc.collect()
++ self.assertIs(wr(), None)
++
++ def test_cert_store_stats(self):
++ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ self.assertEqual(ctx.cert_store_stats(),
++ {'x509_ca': 0, 'crl': 0, 'x509': 0})
++ ctx.load_cert_chain(CERTFILE)
++ self.assertEqual(ctx.cert_store_stats(),
++ {'x509_ca': 0, 'crl': 0, 'x509': 0})
++ ctx.load_verify_locations(CERTFILE)
++ self.assertEqual(ctx.cert_store_stats(),
++ {'x509_ca': 0, 'crl': 0, 'x509': 1})
++ ctx.load_verify_locations(SVN_PYTHON_ORG_ROOT_CERT)
++ self.assertEqual(ctx.cert_store_stats(),
++ {'x509_ca': 1, 'crl': 0, 'x509': 2})
++
++ def test_get_ca_certs(self):
++ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ self.assertEqual(ctx.get_ca_certs(), [])
++ # CERTFILE is not flagged as X509v3 Basic Constraints: CA:TRUE
++ ctx.load_verify_locations(CERTFILE)
++ self.assertEqual(ctx.get_ca_certs(), [])
++ # but SVN_PYTHON_ORG_ROOT_CERT is a CA cert
++ ctx.load_verify_locations(SVN_PYTHON_ORG_ROOT_CERT)
++ self.assertEqual(ctx.get_ca_certs(),
++ [{'issuer': ((('organizationName', 'Root CA'),),
++ (('organizationalUnitName',
'http://www.cacert.org'),),
++ (('commonName', 'CA Cert Signing
Authority'),),
++ (('emailAddress', 'support(a)cacert.org'),)),
++ 'notAfter': asn1time('Mar 29 12:29:49 2033 GMT'),
++ 'notBefore': asn1time('Mar 30 12:29:49 2003 GMT'),
++ 'serialNumber': '00',
++ 'crlDistributionPoints':
('https://www.cacert.org/revoke.crl',),
++ 'subject': ((('organizationName', 'Root CA'),),
++ (('organizationalUnitName',
'http://www.cacert.org'),),
++ (('commonName', 'CA Cert Signing
Authority'),),
++ (('emailAddress', 'support(a)cacert.org'),)),
++ 'version': 3}])
++
++ with open(SVN_PYTHON_ORG_ROOT_CERT) as f:
++ pem = f.read()
++ der = ssl.PEM_cert_to_DER_cert(pem)
++ self.assertEqual(ctx.get_ca_certs(True), [der])
++
++ def test_load_default_certs(self):
++ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ ctx.load_default_certs()
++
++ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ ctx.load_default_certs(ssl.Purpose.SERVER_AUTH)
++ ctx.load_default_certs()
++
++ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ ctx.load_default_certs(ssl.Purpose.CLIENT_AUTH)
++
++ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ self.assertRaises(TypeError, ctx.load_default_certs, None)
++ self.assertRaises(TypeError, ctx.load_default_certs, 'SERVER_AUTH')
++
++ def test_create_default_context(self):
++ ctx = ssl.create_default_context()
++ self.assertEqual(ctx.protocol, ssl.PROTOCOL_SSLv23)
++ self.assertEqual(ctx.verify_mode, ssl.CERT_REQUIRED)
++ self.assertTrue(ctx.check_hostname)
++ self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2)
++ self.assertEqual(
++ ctx.options & getattr(ssl, "OP_NO_COMPRESSION", 0),
++ getattr(ssl, "OP_NO_COMPRESSION", 0),
++ )
++
++ with open(SIGNING_CA) as f:
++ cadata = f.read().decode("ascii")
++ ctx = ssl.create_default_context(cafile=SIGNING_CA, capath=CAPATH,
++ cadata=cadata)
++ self.assertEqual(ctx.protocol, ssl.PROTOCOL_SSLv23)
++ self.assertEqual(ctx.verify_mode, ssl.CERT_REQUIRED)
++ self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2)
++ self.assertEqual(
++ ctx.options & getattr(ssl, "OP_NO_COMPRESSION", 0),
++ getattr(ssl, "OP_NO_COMPRESSION", 0),
++ )
++
++ ctx = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
++ self.assertEqual(ctx.protocol, ssl.PROTOCOL_SSLv23)
++ self.assertEqual(ctx.verify_mode, ssl.CERT_NONE)
++ self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2)
++ self.assertEqual(
++ ctx.options & getattr(ssl, "OP_NO_COMPRESSION", 0),
++ getattr(ssl, "OP_NO_COMPRESSION", 0),
++ )
++ self.assertEqual(
++ ctx.options & getattr(ssl, "OP_SINGLE_DH_USE", 0),
++ getattr(ssl, "OP_SINGLE_DH_USE", 0),
++ )
++ self.assertEqual(
++ ctx.options & getattr(ssl, "OP_SINGLE_ECDH_USE", 0),
++ getattr(ssl, "OP_SINGLE_ECDH_USE", 0),
++ )
++
++ def test__create_stdlib_context(self):
++ ctx = ssl._create_stdlib_context()
++ self.assertEqual(ctx.protocol, ssl.PROTOCOL_SSLv23)
++ self.assertEqual(ctx.verify_mode, ssl.CERT_NONE)
++ self.assertFalse(ctx.check_hostname)
++ self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2)
++
++ ctx = ssl._create_stdlib_context(ssl.PROTOCOL_TLSv1)
++ self.assertEqual(ctx.protocol, ssl.PROTOCOL_TLSv1)
++ self.assertEqual(ctx.verify_mode, ssl.CERT_NONE)
++ self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2)
++
++ ctx = ssl._create_stdlib_context(ssl.PROTOCOL_TLSv1,
++ cert_reqs=ssl.CERT_REQUIRED,
++ check_hostname=True)
++ self.assertEqual(ctx.protocol, ssl.PROTOCOL_TLSv1)
++ self.assertEqual(ctx.verify_mode, ssl.CERT_REQUIRED)
++ self.assertTrue(ctx.check_hostname)
++ self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2)
++
++ ctx = ssl._create_stdlib_context(purpose=ssl.Purpose.CLIENT_AUTH)
++ self.assertEqual(ctx.protocol, ssl.PROTOCOL_SSLv23)
++ self.assertEqual(ctx.verify_mode, ssl.CERT_NONE)
++ self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2)
++
++ def test_check_hostname(self):
++ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ self.assertFalse(ctx.check_hostname)
++
++ # Requires CERT_REQUIRED or CERT_OPTIONAL
++ with self.assertRaises(ValueError):
++ ctx.check_hostname = True
++ ctx.verify_mode = ssl.CERT_REQUIRED
++ self.assertFalse(ctx.check_hostname)
++ ctx.check_hostname = True
++ self.assertTrue(ctx.check_hostname)
++
++ ctx.verify_mode = ssl.CERT_OPTIONAL
++ ctx.check_hostname = True
++ self.assertTrue(ctx.check_hostname)
++
++ # Cannot set CERT_NONE with check_hostname enabled
++ with self.assertRaises(ValueError):
++ ctx.verify_mode = ssl.CERT_NONE
++ ctx.check_hostname = False
++ self.assertFalse(ctx.check_hostname)
++
++
++class SSLErrorTests(unittest.TestCase):
++
++ def test_str(self):
++ # The str() of a SSLError doesn't include the errno
++ e = ssl.SSLError(1, "foo")
++ self.assertEqual(str(e), "foo")
++ self.assertEqual(e.errno, 1)
++ # Same for a subclass
++ e = ssl.SSLZeroReturnError(1, "foo")
++ self.assertEqual(str(e), "foo")
++ self.assertEqual(e.errno, 1)
++
++ def test_lib_reason(self):
++ # Test the library and reason attributes
++ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ with self.assertRaises(ssl.SSLError) as cm:
++ ctx.load_dh_params(CERTFILE)
++ self.assertEqual(cm.exception.library, 'PEM')
++ self.assertEqual(cm.exception.reason, 'NO_START_LINE')
++ s = str(cm.exception)
++ self.assertTrue(s.startswith("[PEM: NO_START_LINE] no start line"),
s)
++
++ def test_subclass(self):
++ # Check that the appropriate SSLError subclass is raised
++ # (this only tests one of them)
++ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ with closing(socket.socket()) as s:
++ s.bind(("127.0.0.1", 0))
++ s.listen(5)
++ c = socket.socket()
++ c.connect(s.getsockname())
++ c.setblocking(False)
++ with closing(ctx.wrap_socket(c, False, do_handshake_on_connect=False)) as
c:
++ with self.assertRaises(ssl.SSLWantReadError) as cm:
++ c.do_handshake()
++ s = str(cm.exception)
++ self.assertTrue(s.startswith("The operation did not complete
(read)"), s)
++ # For compatibility
++ self.assertEqual(cm.exception.errno, ssl.SSL_ERROR_WANT_READ)
+
+
+ class NetworkedTests(unittest.TestCase):
+
+ def test_connect(self):
+- with test_support.transient_internet("svn.python.org"):
++ with support.transient_internet("svn.python.org"):
+ s = ssl.wrap_socket(socket.socket(socket.AF_INET),
+ cert_reqs=ssl.CERT_NONE)
+- s.connect(("svn.python.org", 443))
+- c = s.getpeercert()
+- if c:
+- self.fail("Peer cert %s shouldn't be here!")
+- s.close()
+-
+- # this should fail because we have no verification certs
+- s = ssl.wrap_socket(socket.socket(socket.AF_INET),
+- cert_reqs=ssl.CERT_REQUIRED)
+ try:
+ s.connect(("svn.python.org", 443))
+- except ssl.SSLError:
+- pass
++ self.assertEqual({}, s.getpeercert())
+ finally:
+ s.close()
+
++ # this should fail because we have no verification certs
++ s = ssl.wrap_socket(socket.socket(socket.AF_INET),
++ cert_reqs=ssl.CERT_REQUIRED)
++ self.assertRaisesRegexp(ssl.SSLError, "certificate verify
failed",
++ s.connect, ("svn.python.org", 443))
++ s.close()
++
+ # this should succeed because we specify the root cert
+ s = ssl.wrap_socket(socket.socket(socket.AF_INET),
+ cert_reqs=ssl.CERT_REQUIRED,
+ ca_certs=SVN_PYTHON_ORG_ROOT_CERT)
+ try:
+ s.connect(("svn.python.org", 443))
++ self.assertTrue(s.getpeercert())
+ finally:
+ s.close()
+
+ def test_connect_ex(self):
+ # Issue #11326: check connect_ex() implementation
+- with test_support.transient_internet("svn.python.org"):
++ with support.transient_internet("svn.python.org"):
+ s = ssl.wrap_socket(socket.socket(socket.AF_INET),
+ cert_reqs=ssl.CERT_REQUIRED,
+ ca_certs=SVN_PYTHON_ORG_ROOT_CERT)
+@@ -290,7 +1226,7 @@ class NetworkedTests(unittest.TestCase):
+ def test_non_blocking_connect_ex(self):
+ # Issue #11326: non-blocking connect_ex() should allow handshake
+ # to proceed after the socket gets ready.
+- with test_support.transient_internet("svn.python.org"):
++ with support.transient_internet("svn.python.org"):
+ s = ssl.wrap_socket(socket.socket(socket.AF_INET),
+ cert_reqs=ssl.CERT_REQUIRED,
+ ca_certs=SVN_PYTHON_ORG_ROOT_CERT,
+@@ -307,13 +1243,10 @@ class NetworkedTests(unittest.TestCase):
+ try:
+ s.do_handshake()
+ break
+- except ssl.SSLError as err:
+- if err.args[0] == ssl.SSL_ERROR_WANT_READ:
+- select.select([s], [], [], 5.0)
+- elif err.args[0] == ssl.SSL_ERROR_WANT_WRITE:
+- select.select([], [s], [], 5.0)
+- else:
+- raise
++ except ssl.SSLWantReadError:
++ select.select([s], [], [], 5.0)
++ except ssl.SSLWantWriteError:
++ select.select([], [s], [], 5.0)
+ # SSL established
+ self.assertTrue(s.getpeercert())
+ finally:
+@@ -322,7 +1255,7 @@ class NetworkedTests(unittest.TestCase):
+ def test_timeout_connect_ex(self):
+ # Issue #12065: on a timeout, connect_ex() should return the original
+ # errno (mimicking the behaviour of non-SSL sockets).
+- with test_support.transient_internet("svn.python.org"):
++ with support.transient_internet("svn.python.org"):
+ s = ssl.wrap_socket(socket.socket(socket.AF_INET),
+ cert_reqs=ssl.CERT_REQUIRED,
+ ca_certs=SVN_PYTHON_ORG_ROOT_CERT,
+@@ -337,22 +1270,109 @@ class NetworkedTests(unittest.TestCase):
+ s.close()
+
+ def test_connect_ex_error(self):
+- with test_support.transient_internet("svn.python.org"):
++ with support.transient_internet("svn.python.org"):
+ s = ssl.wrap_socket(socket.socket(socket.AF_INET),
+ cert_reqs=ssl.CERT_REQUIRED,
+ ca_certs=SVN_PYTHON_ORG_ROOT_CERT)
+ try:
+- self.assertEqual(errno.ECONNREFUSED,
+- s.connect_ex(("svn.python.org", 444)))
++ rc = s.connect_ex(("svn.python.org", 444))
++ # Issue #19919: Windows machines or VMs hosted on Windows
++ # machines sometimes return EWOULDBLOCK.
++ self.assertIn(rc, (errno.ECONNREFUSED, errno.EWOULDBLOCK))
++ finally:
++ s.close()
++
++ def test_connect_with_context(self):
++ with support.transient_internet("svn.python.org"):
++ # Same as test_connect, but with a separately created context
++ ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
++ s = ctx.wrap_socket(socket.socket(socket.AF_INET))
++ s.connect(("svn.python.org", 443))
++ try:
++ self.assertEqual({}, s.getpeercert())
++ finally:
++ s.close()
++ # Same with a server hostname
++ s = ctx.wrap_socket(socket.socket(socket.AF_INET),
++ server_hostname="svn.python.org")
++ if ssl.HAS_SNI:
++ s.connect(("svn.python.org", 443))
++ s.close()
++ else:
++ self.assertRaises(ValueError, s.connect, ("svn.python.org",
443))
++ # This should fail because we have no verification certs
++ ctx.verify_mode = ssl.CERT_REQUIRED
++ s = ctx.wrap_socket(socket.socket(socket.AF_INET))
++ self.assertRaisesRegexp(ssl.SSLError, "certificate verify
failed",
++ s.connect, ("svn.python.org", 443))
++ s.close()
++ # This should succeed because we specify the root cert
++ ctx.load_verify_locations(SVN_PYTHON_ORG_ROOT_CERT)
++ s = ctx.wrap_socket(socket.socket(socket.AF_INET))
++ s.connect(("svn.python.org", 443))
++ try:
++ cert = s.getpeercert()
++ self.assertTrue(cert)
++ finally:
++ s.close()
++
++ def test_connect_capath(self):
++ # Verify server certificates using the `capath` argument
++ # NOTE: the subject hashing algorithm has been changed between
++ # OpenSSL 0.9.8n and 1.0.0, as a result the capath directory must
++ # contain both versions of each certificate (same content, different
++ # filename) for this test to be portable across OpenSSL releases.
++ with support.transient_internet("svn.python.org"):
++ ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
++ ctx.verify_mode = ssl.CERT_REQUIRED
++ ctx.load_verify_locations(capath=CAPATH)
++ s = ctx.wrap_socket(socket.socket(socket.AF_INET))
++ s.connect(("svn.python.org", 443))
++ try:
++ cert = s.getpeercert()
++ self.assertTrue(cert)
++ finally:
++ s.close()
++ # Same with a bytes `capath` argument
++ ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
++ ctx.verify_mode = ssl.CERT_REQUIRED
++ ctx.load_verify_locations(capath=BYTES_CAPATH)
++ s = ctx.wrap_socket(socket.socket(socket.AF_INET))
++ s.connect(("svn.python.org", 443))
++ try:
++ cert = s.getpeercert()
++ self.assertTrue(cert)
+ finally:
+ s.close()
+
++ def test_connect_cadata(self):
++ with open(CAFILE_CACERT) as f:
++ pem = f.read().decode('ascii')
++ der = ssl.PEM_cert_to_DER_cert(pem)
++ with support.transient_internet("svn.python.org"):
++ ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
++ ctx.verify_mode = ssl.CERT_REQUIRED
++ ctx.load_verify_locations(cadata=pem)
++ with closing(ctx.wrap_socket(socket.socket(socket.AF_INET))) as s:
++ s.connect(("svn.python.org", 443))
++ cert = s.getpeercert()
++ self.assertTrue(cert)
++
++ # same with DER
++ ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
++ ctx.verify_mode = ssl.CERT_REQUIRED
++ ctx.load_verify_locations(cadata=der)
++ with closing(ctx.wrap_socket(socket.socket(socket.AF_INET))) as s:
++ s.connect(("svn.python.org", 443))
++ cert = s.getpeercert()
++ self.assertTrue(cert)
++
+ @unittest.skipIf(os.name == "nt", "Can't use a socket as a file
under Windows")
+ def test_makefile_close(self):
+ # Issue #5238: creating a file-like object with makefile() shouldn't
+ # delay closing the underlying "real socket" (here tested with its
+ # file descriptor, hence skipping the test under Windows).
+- with test_support.transient_internet("svn.python.org"):
++ with support.transient_internet("svn.python.org"):
+ ss = ssl.wrap_socket(socket.socket(socket.AF_INET))
+ ss.connect(("svn.python.org", 443))
+ fd = ss.fileno()
+@@ -368,7 +1388,7 @@ class NetworkedTests(unittest.TestCase):
+ self.assertEqual(e.exception.errno, errno.EBADF)
+
+ def test_non_blocking_handshake(self):
+- with test_support.transient_internet("svn.python.org"):
++ with support.transient_internet("svn.python.org"):
+ s = socket.socket(socket.AF_INET)
+ s.connect(("svn.python.org", 443))
+ s.setblocking(False)
+@@ -381,41 +1401,57 @@ class NetworkedTests(unittest.TestCase):
+ count += 1
+ s.do_handshake()
+ break
+- except ssl.SSLError, err:
+- if err.args[0] == ssl.SSL_ERROR_WANT_READ:
+- select.select([s], [], [])
+- elif err.args[0] == ssl.SSL_ERROR_WANT_WRITE:
+- select.select([], [s], [])
+- else:
+- raise
++ except ssl.SSLWantReadError:
++ select.select([s], [], [])
++ except ssl.SSLWantWriteError:
++ select.select([], [s], [])
+ s.close()
+- if test_support.verbose:
++ if support.verbose:
+ sys.stdout.write("\nNeeded %d calls to do_handshake() to establish
session.\n" % count)
+
+ def test_get_server_certificate(self):
+- with test_support.transient_internet("svn.python.org"):
+- pem = ssl.get_server_certificate(("svn.python.org", 443),
+- ssl.PROTOCOL_SSLv23)
+- if not pem:
+- self.fail("No server certificate on svn.python.org:443!")
++ def _test_get_server_certificate(host, port, cert=None):
++ with support.transient_internet(host):
++ pem = ssl.get_server_certificate((host, port))
++ if not pem:
++ self.fail("No server certificate on %s:%s!" % (host,
port))
+
+- try:
+- pem = ssl.get_server_certificate(("svn.python.org", 443),
+- ssl.PROTOCOL_SSLv23,
+- ca_certs=CERTFILE)
+- except ssl.SSLError:
+- #should fail
+- pass
+- else:
+- self.fail("Got server certificate %s for svn.python.org!" %
pem)
++ try:
++ pem = ssl.get_server_certificate((host, port),
++ ca_certs=CERTFILE)
++ except ssl.SSLError as x:
++ #should fail
++ if support.verbose:
++ sys.stdout.write("%s\n" % x)
++ else:
++ self.fail("Got server certificate %s for %s:%s!" % (pem,
host, port))
++
++ pem = ssl.get_server_certificate((host, port),
++ ca_certs=cert)
++ if not pem:
++ self.fail("No server certificate on %s:%s!" % (host,
port))
++ if support.verbose:
++ sys.stdout.write("\nVerified certificate for %s:%s
is\n%s\n" % (host, port ,pem))
++
++ _test_get_server_certificate('svn.python.org', 443,
SVN_PYTHON_ORG_ROOT_CERT)
++ if support.IPV6_ENABLED:
++ _test_get_server_certificate('ipv6.google.com', 443)
+
+- pem = ssl.get_server_certificate(("svn.python.org", 443),
+- ssl.PROTOCOL_SSLv23,
+- ca_certs=SVN_PYTHON_ORG_ROOT_CERT)
+- if not pem:
+- self.fail("No server certificate on svn.python.org:443!")
+- if test_support.verbose:
+- sys.stdout.write("\nVerified certificate for svn.python.org:443
is\n%s\n" % pem)
++ def test_ciphers(self):
++ remote = ("svn.python.org", 443)
++ with support.transient_internet(remote[0]):
++ with closing(ssl.wrap_socket(socket.socket(socket.AF_INET),
++ cert_reqs=ssl.CERT_NONE,
ciphers="ALL")) as s:
++ s.connect(remote)
++ with closing(ssl.wrap_socket(socket.socket(socket.AF_INET),
++ cert_reqs=ssl.CERT_NONE,
ciphers="DEFAULT")) as s:
++ s.connect(remote)
++ # Error checking can happen at instantiation or when connecting
++ with self.assertRaisesRegexp(ssl.SSLError, "No cipher can be
selected"):
++ with closing(socket.socket(socket.AF_INET)) as sock:
++ s = ssl.wrap_socket(sock,
++ cert_reqs=ssl.CERT_NONE,
ciphers="^$:,;?*'dorothyx")
++ s.connect(remote)
+
+ def test_algorithms(self):
+ # Issue #8484: all algorithms should be available when verifying a
+@@ -423,17 +1459,21 @@ class NetworkedTests(unittest.TestCase):
+ # SHA256 was added in OpenSSL 0.9.8
+ if ssl.OPENSSL_VERSION_INFO < (0, 9, 8, 0, 15):
+ self.skipTest("SHA256 not available on %r" % ssl.OPENSSL_VERSION)
+- self.skipTest("remote host needs SNI, only available on Python 3.2+")
+- # NOTE:
https://sha2.hboeck.de is another possible test host
++ #
sha256.tbs-internet.com needs SNI to use the correct certificate
++ if not ssl.HAS_SNI:
++ self.skipTest("SNI needed for this test")
++ #
https://sha2.hboeck.de/ was used until 2011-01-08 (no route to host)
+ remote = ("sha256.tbs-internet.com", 443)
+ sha256_cert = os.path.join(os.path.dirname(__file__), "sha256.pem")
+- with test_support.transient_internet("sha256.tbs-internet.com"):
+- s = ssl.wrap_socket(socket.socket(socket.AF_INET),
+- cert_reqs=ssl.CERT_REQUIRED,
+- ca_certs=sha256_cert,)
++ with support.transient_internet("sha256.tbs-internet.com"):
++ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ ctx.verify_mode = ssl.CERT_REQUIRED
++ ctx.load_verify_locations(sha256_cert)
++ s = ctx.wrap_socket(socket.socket(socket.AF_INET),
++ server_hostname="sha256.tbs-internet.com")
+ try:
+ s.connect(remote)
+- if test_support.verbose:
++ if support.verbose:
+ sys.stdout.write("\nCipher with %r is %r\n" %
+ (remote, s.cipher()))
+ sys.stdout.write("Certificate is:\n%s\n" %
+@@ -441,6 +1481,36 @@ class NetworkedTests(unittest.TestCase):
+ finally:
+ s.close()
+
++ def test_get_ca_certs_capath(self):
++ # capath certs are loaded on request
++ with support.transient_internet("svn.python.org"):
++ ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
++ ctx.verify_mode = ssl.CERT_REQUIRED
++ ctx.load_verify_locations(capath=CAPATH)
++ self.assertEqual(ctx.get_ca_certs(), [])
++ s = ctx.wrap_socket(socket.socket(socket.AF_INET))
++ s.connect(("svn.python.org", 443))
++ try:
++ cert = s.getpeercert()
++ self.assertTrue(cert)
++ finally:
++ s.close()
++ self.assertEqual(len(ctx.get_ca_certs()), 1)
++
++ @needs_sni
++ def test_context_setget(self):
++ # Check that the context of a connected socket can be replaced.
++ with support.transient_internet("svn.python.org"):
++ ctx1 = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ ctx2 = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
++ s = socket.socket(socket.AF_INET)
++ with closing(ctx1.wrap_socket(s)) as ss:
++ ss.connect(("svn.python.org", 443))
++ self.assertIs(ss.context, ctx1)
++ self.assertIs(ss._sslobj.context, ctx1)
++ ss.context = ctx2
++ self.assertIs(ss.context, ctx2)
++ self.assertIs(ss._sslobj.context, ctx2)
+
+ try:
+ import threading
+@@ -449,6 +1519,8 @@ except ImportError:
+ else:
+ _have_threads = True
+
++ from test.ssl_servers import make_https_server
++
+ class ThreadedEchoServer(threading.Thread):
+
+ class ConnectionHandler(threading.Thread):
+@@ -457,48 +1529,45 @@ else:
+ with and without the SSL wrapper around the socket connection, so
+ that we can test the STARTTLS functionality."""
+
+- def __init__(self, server, connsock):
++ def __init__(self, server, connsock, addr):
+ self.server = server
+ self.running = False
+ self.sock = connsock
++ self.addr = addr
+ self.sock.setblocking(1)
+ self.sslconn = None
+ threading.Thread.__init__(self)
+ self.daemon = True
+
+- def show_conn_details(self):
+- if self.server.certreqs == ssl.CERT_REQUIRED:
+- cert = self.sslconn.getpeercert()
+- if test_support.verbose and self.server.chatty:
+- sys.stdout.write(" client cert is " +
pprint.pformat(cert) + "\n")
+- cert_binary = self.sslconn.getpeercert(True)
+- if test_support.verbose and self.server.chatty:
+- sys.stdout.write(" cert binary is " +
str(len(cert_binary)) + " bytes\n")
+- cipher = self.sslconn.cipher()
+- if test_support.verbose and self.server.chatty:
+- sys.stdout.write(" server: connection cipher is now " +
str(cipher) + "\n")
+-
+ def wrap_conn(self):
+ try:
+- self.sslconn = ssl.wrap_socket(self.sock, server_side=True,
+- certfile=self.server.certificate,
+- ssl_version=self.server.protocol,
+- ca_certs=self.server.cacerts,
+- cert_reqs=self.server.certreqs,
+- ciphers=self.server.ciphers)
++ self.sslconn = self.server.context.wrap_socket(
++ self.sock, server_side=True)
++
self.server.selected_protocols.append(self.sslconn.selected_npn_protocol())
+ except ssl.SSLError as e:
+ # XXX Various errors can have happened here, for example
+ # a mismatching protocol version, an invalid certificate,
+ # or a low-level bug. This should be made more discriminating.
+ self.server.conn_errors.append(e)
+ if self.server.chatty:
+- handle_error("\n server: bad connection attempt from
" +
+- str(self.sock.getpeername()) + ":\n")
+- self.close()
++ handle_error("\n server: bad connection attempt from
" + repr(self.addr) + ":\n")
+ self.running = False
+ self.server.stop()
++ self.close()
+ return False
+ else:
++ if self.server.context.verify_mode == ssl.CERT_REQUIRED:
++ cert = self.sslconn.getpeercert()
++ if support.verbose and self.server.chatty:
++ sys.stdout.write(" client cert is " +
pprint.pformat(cert) + "\n")
++ cert_binary = self.sslconn.getpeercert(True)
++ if support.verbose and self.server.chatty:
++ sys.stdout.write(" cert binary is " +
str(len(cert_binary)) + " bytes\n")
++ cipher = self.sslconn.cipher()
++ if support.verbose and self.server.chatty:
++ sys.stdout.write(" server: connection cipher is now "
+ str(cipher) + "\n")
++ sys.stdout.write(" server: selected protocol is now "
++ + str(self.sslconn.selected_npn_protocol()) +
"\n")
+ return True
+
+ def read(self):
+@@ -517,48 +1586,53 @@ else:
+ if self.sslconn:
+ self.sslconn.close()
+ else:
+- self.sock._sock.close()
++ self.sock.close()
+
+ def run(self):
+ self.running = True
+ if not self.server.starttls_server:
+- if isinstance(self.sock, ssl.SSLSocket):
+- self.sslconn = self.sock
+- elif not self.wrap_conn():
++ if not self.wrap_conn():
+ return
+- self.show_conn_details()
+ while self.running:
+ try:
+ msg = self.read()
+- if not msg:
++ stripped = msg.strip()
++ if not stripped:
+ # eof, so quit this handler
+ self.running = False
+ self.close()
+- elif msg.strip() == 'over':
+- if test_support.verbose and self.server.connectionchatty:
++ elif stripped == b'over':
++ if support.verbose and self.server.connectionchatty:
+ sys.stdout.write(" server: client closed
connection\n")
+ self.close()
+ return
+- elif self.server.starttls_server and msg.strip() ==
'STARTTLS':
+- if test_support.verbose and self.server.connectionchatty:
++ elif (self.server.starttls_server and
++ stripped == b'STARTTLS'):
++ if support.verbose and self.server.connectionchatty:
+ sys.stdout.write(" server: read STARTTLS from
client, sending OK...\n")
+- self.write("OK\n")
++ self.write(b"OK\n")
+ if not self.wrap_conn():
+ return
+- elif self.server.starttls_server and self.sslconn and
msg.strip() == 'ENDTLS':
+- if test_support.verbose and self.server.connectionchatty:
++ elif (self.server.starttls_server and self.sslconn
++ and stripped == b'ENDTLS'):
++ if support.verbose and self.server.connectionchatty:
+ sys.stdout.write(" server: read ENDTLS from client,
sending OK...\n")
+- self.write("OK\n")
+- self.sslconn.unwrap()
++ self.write(b"OK\n")
++ self.sock = self.sslconn.unwrap()
+ self.sslconn = None
+- if test_support.verbose and self.server.connectionchatty:
++ if support.verbose and self.server.connectionchatty:
+ sys.stdout.write(" server: connection is now
unencrypted...\n")
++ elif stripped == b'CB tls-unique':
++ if support.verbose and self.server.connectionchatty:
++ sys.stdout.write(" server: read CB tls-unique from
client, sending our CB data...\n")
++ data =
self.sslconn.get_channel_binding("tls-unique")
++ self.write(repr(data).encode("us-ascii") +
b"\n")
+ else:
+- if (test_support.verbose and
++ if (support.verbose and
+ self.server.connectionchatty):
+ ctype = (self.sslconn and "encrypted") or
"unencrypted"
+- sys.stdout.write(" server: read %s (%s), sending
back %s (%s)...\n"
+- % (repr(msg), ctype, repr(msg.lower()),
ctype))
++ sys.stdout.write(" server: read %r (%s), sending
back %r (%s)...\n"
++ % (msg, ctype, msg.lower(), ctype))
+ self.write(msg.lower())
+ except ssl.SSLError:
+ if self.server.chatty:
+@@ -569,36 +1643,34 @@ else:
+ # harness, we want to stop the server
+ self.server.stop()
+
+- def __init__(self, certificate, ssl_version=None,
++ def __init__(self, certificate=None, ssl_version=None,
+ certreqs=None, cacerts=None,
+ chatty=True, connectionchatty=False, starttls_server=False,
+- wrap_accepting_socket=False, ciphers=None):
+-
+- if ssl_version is None:
+- ssl_version = ssl.PROTOCOL_TLSv1
+- if certreqs is None:
+- certreqs = ssl.CERT_NONE
+- self.certificate = certificate
+- self.protocol = ssl_version
+- self.certreqs = certreqs
+- self.cacerts = cacerts
+- self.ciphers = ciphers
++ npn_protocols=None, ciphers=None, context=None):
++ if context:
++ self.context = context
++ else:
++ self.context = ssl.SSLContext(ssl_version
++ if ssl_version is not None
++ else ssl.PROTOCOL_TLSv1)
++ self.context.verify_mode = (certreqs if certreqs is not None
++ else ssl.CERT_NONE)
++ if cacerts:
++ self.context.load_verify_locations(cacerts)
++ if certificate:
++ self.context.load_cert_chain(certificate)
++ if npn_protocols:
++ self.context.set_npn_protocols(npn_protocols)
++ if ciphers:
++ self.context.set_ciphers(ciphers)
+ self.chatty = chatty
+ self.connectionchatty = connectionchatty
+ self.starttls_server = starttls_server
+ self.sock = socket.socket()
++ self.port = support.bind_port(self.sock)
+ self.flag = None
+- if wrap_accepting_socket:
+- self.sock = ssl.wrap_socket(self.sock, server_side=True,
+- certfile=self.certificate,
+- cert_reqs = self.certreqs,
+- ca_certs = self.cacerts,
+- ssl_version = self.protocol,
+- ciphers = self.ciphers)
+- if test_support.verbose and self.chatty:
+- sys.stdout.write(' server: wrapped server socket as %s\n' %
str(self.sock))
+- self.port = test_support.bind_port(self.sock)
+ self.active = False
++ self.selected_protocols = []
+ self.conn_errors = []
+ threading.Thread.__init__(self)
+ self.daemon = True
+@@ -626,10 +1698,10 @@ else:
+ while self.active:
+ try:
+ newconn, connaddr = self.sock.accept()
+- if test_support.verbose and self.chatty:
++ if support.verbose and self.chatty:
+ sys.stdout.write(' server: new connection from '
+- + str(connaddr) + '\n')
+- handler = self.ConnectionHandler(self, newconn)
++ + repr(connaddr) + '\n')
++ handler = self.ConnectionHandler(self, newconn, connaddr)
+ handler.start()
+ handler.join()
+ except socket.timeout:
+@@ -648,11 +1720,12 @@ else:
+ class ConnectionHandler(asyncore.dispatcher_with_send):
+
+ def __init__(self, conn, certfile):
+- asyncore.dispatcher_with_send.__init__(self, conn)
+ self.socket = ssl.wrap_socket(conn, server_side=True,
+ certfile=certfile,
+ do_handshake_on_connect=False)
++ asyncore.dispatcher_with_send.__init__(self, self.socket)
+ self._ssl_accepting = True
++ self._do_ssl_handshake()
+
+ def readable(self):
+ if isinstance(self.socket, ssl.SSLSocket):
+@@ -663,12 +1736,11 @@ else:
+ def _do_ssl_handshake(self):
+ try:
+ self.socket.do_handshake()
+- except ssl.SSLError, err:
+- if err.args[0] in (ssl.SSL_ERROR_WANT_READ,
+- ssl.SSL_ERROR_WANT_WRITE):
+- return
+- elif err.args[0] == ssl.SSL_ERROR_EOF:
+- return self.handle_close()
++ except (ssl.SSLWantReadError, ssl.SSLWantWriteError):
++ return
++ except ssl.SSLEOFError:
++ return self.handle_close()
++ except ssl.SSLError:
+ raise
+ except socket.error, err:
+ if err.args[0] == errno.ECONNABORTED:
+@@ -681,12 +1753,16 @@ else:
+ self._do_ssl_handshake()
+ else:
+ data = self.recv(1024)
+- if data and data.strip() != 'over':
++ if support.verbose:
++ sys.stdout.write(" server: read %s from client\n"
% repr(data))
++ if not data:
++ self.close()
++ else:
+ self.send(data.lower())
+
+ def handle_close(self):
+ self.close()
+- if test_support.verbose:
++ if support.verbose:
+ sys.stdout.write(" server: closed connection %s\n" %
self.socket)
+
+ def handle_error(self):
+@@ -694,14 +1770,14 @@ else:
+
+ def __init__(self, certfile):
+ self.certfile = certfile
+- asyncore.dispatcher.__init__(self)
+- self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
+- self.port = test_support.bind_port(self.socket)
++ sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
++ self.port = support.bind_port(sock, '')
++ asyncore.dispatcher.__init__(self, sock)
+ self.listen(5)
+
+ def handle_accept(self):
+ sock_obj, addr = self.accept()
+- if test_support.verbose:
++ if support.verbose:
+ sys.stdout.write(" server: new connection from %s:%s\n"
%addr)
+ self.ConnectionHandler(sock_obj, self.certfile)
+
+@@ -725,13 +1801,13 @@ else:
+ return self
+
+ def __exit__(self, *args):
+- if test_support.verbose:
++ if support.verbose:
+ sys.stdout.write(" cleanup: stopping server.\n")
+ self.stop()
+- if test_support.verbose:
++ if support.verbose:
+ sys.stdout.write(" cleanup: joining server thread.\n")
+ self.join()
+- if test_support.verbose:
++ if support.verbose:
+ sys.stdout.write(" cleanup: successfully joined.\n")
+
+ def start(self, flag=None):
+@@ -743,103 +1819,15 @@ else:
+ if self.flag:
+ self.flag.set()
+ while self.active:
+- asyncore.loop(0.05)
++ try:
++ asyncore.loop(1)
++ except:
++ pass
+
+ def stop(self):
+ self.active = False
+ self.server.close()
+
+- class SocketServerHTTPSServer(threading.Thread):
+-
+- class HTTPSServer(HTTPServer):
+-
+- def __init__(self, server_address, RequestHandlerClass, certfile):
+- HTTPServer.__init__(self, server_address, RequestHandlerClass)
+- # we assume the certfile contains both private key and certificate
+- self.certfile = certfile
+- self.allow_reuse_address = True
+-
+- def __str__(self):
+- return ('<%s %s:%s>' %
+- (self.__class__.__name__,
+- self.server_name,
+- self.server_port))
+-
+- def get_request(self):
+- # override this to wrap socket with SSL
+- sock, addr = self.socket.accept()
+- sslconn = ssl.wrap_socket(sock, server_side=True,
+- certfile=self.certfile)
+- return sslconn, addr
+-
+- class RootedHTTPRequestHandler(SimpleHTTPRequestHandler):
+- # need to override translate_path to get a known root,
+- # instead of using os.curdir, since the test could be
+- # run from anywhere
+-
+- server_version = "TestHTTPS/1.0"
+-
+- root = None
+-
+- def translate_path(self, path):
+- """Translate a /-separated PATH to the local filename
syntax.
+-
+- Components that mean special things to the local file system
+- (e.g. drive or directory names) are ignored. (XXX They should
+- probably be diagnosed.)
+-
+- """
+- # abandon query parameters
+- path = urlparse.urlparse(path)[2]
+- path = os.path.normpath(urllib.unquote(path))
+- words = path.split('/')
+- words = filter(None, words)
+- path = self.root
+- for word in words:
+- drive, word = os.path.splitdrive(word)
+- head, word = os.path.split(word)
+- if word in self.root: continue
+- path = os.path.join(path, word)
+- return path
+-
+- def log_message(self, format, *args):
+-
+- # we override this to suppress logging unless "verbose"
+-
+- if test_support.verbose:
+- sys.stdout.write(" server (%s:%d %s):\n [%s] %s\n" %
+- (self.server.server_address,
+- self.server.server_port,
+- self.request.cipher(),
+- self.log_date_time_string(),
+- format%args))
+-
+-
+- def __init__(self, certfile):
+- self.flag = None
+- self.RootedHTTPRequestHandler.root = os.path.split(CERTFILE)[0]
+- self.server = self.HTTPSServer(
+- (HOST, 0), self.RootedHTTPRequestHandler, certfile)
+- self.port = self.server.server_port
+- threading.Thread.__init__(self)
+- self.daemon = True
+-
+- def __str__(self):
+- return "<%s %s>" % (self.__class__.__name__, self.server)
+-
+- def start(self, flag=None):
+- self.flag = flag
+- threading.Thread.start(self)
+-
+- def run(self):
+- if self.flag:
+- self.flag.set()
+- self.server.serve_forever(0.05)
+-
+- def stop(self):
+- self.server.shutdown()
+-
+-
+ def bad_cert_test(certfile):
+ """
+ Launch a server with CERT_REQUIRED, and check that trying to
+@@ -847,74 +1835,74 @@ else:
+ """
+ server = ThreadedEchoServer(CERTFILE,
+ certreqs=ssl.CERT_REQUIRED,
+- cacerts=CERTFILE, chatty=False)
++ cacerts=CERTFILE, chatty=False,
++ connectionchatty=False)
+ with server:
+ try:
+- s = ssl.wrap_socket(socket.socket(),
+- certfile=certfile,
+- ssl_version=ssl.PROTOCOL_TLSv1)
+- s.connect((HOST, server.port))
+- except ssl.SSLError, x:
+- if test_support.verbose:
+- sys.stdout.write("\nSSLError is %s\n" % x[1])
+- except socket.error, x:
+- if test_support.verbose:
+- sys.stdout.write("\nsocket.error is %s\n" % x[1])
++ with closing(socket.socket()) as sock:
++ s = ssl.wrap_socket(sock,
++ certfile=certfile,
++ ssl_version=ssl.PROTOCOL_TLSv1)
++ s.connect((HOST, server.port))
++ except ssl.SSLError as x:
++ if support.verbose:
++ sys.stdout.write("\nSSLError is %s\n" % x.args[1])
++ except OSError as x:
++ if support.verbose:
++ sys.stdout.write("\nOSError is %s\n" % x.args[1])
++ except OSError as x:
++ if x.errno != errno.ENOENT:
++ raise
++ if support.verbose:
++ sys.stdout.write("\OSError is %s\n" % str(x))
+ else:
+ raise AssertionError("Use of invalid cert should have
failed!")
+
+- def server_params_test(certfile, protocol, certreqs, cacertsfile,
+- client_certfile, client_protocol=None,
indata="FOO\n",
+- ciphers=None, chatty=True, connectionchatty=False,
+- wrap_accepting_socket=False):
++ def server_params_test(client_context, server_context, indata=b"FOO\n",
++ chatty=True, connectionchatty=False, sni_name=None):
+ """
+ Launch a server, connect a client to it and try various reads
+ and writes.
+ """
+- server = ThreadedEchoServer(certfile,
+- certreqs=certreqs,
+- ssl_version=protocol,
+- cacerts=cacertsfile,
+- ciphers=ciphers,
++ stats = {}
++ server = ThreadedEchoServer(context=server_context,
+ chatty=chatty,
+- connectionchatty=connectionchatty,
+- wrap_accepting_socket=wrap_accepting_socket)
++ connectionchatty=False)
+ with server:
+- # try to connect
+- if client_protocol is None:
+- client_protocol = protocol
+- s = ssl.wrap_socket(socket.socket(),
+- certfile=client_certfile,
+- ca_certs=cacertsfile,
+- ciphers=ciphers,
+- cert_reqs=certreqs,
+- ssl_version=client_protocol)
+- s.connect((HOST, server.port))
+- for arg in [indata, bytearray(indata), memoryview(indata)]:
+- if connectionchatty:
+- if test_support.verbose:
+- sys.stdout.write(
+- " client: sending %s...\n" % (repr(arg)))
+- s.write(arg)
+- outdata = s.read()
++ with closing(client_context.wrap_socket(socket.socket(),
++ server_hostname=sni_name)) as s:
++ s.connect((HOST, server.port))
++ for arg in [indata, bytearray(indata), memoryview(indata)]:
++ if connectionchatty:
++ if support.verbose:
++ sys.stdout.write(
++ " client: sending %r...\n" % indata)
++ s.write(arg)
++ outdata = s.read()
++ if connectionchatty:
++ if support.verbose:
++ sys.stdout.write(" client: read %r\n" % outdata)
++ if outdata != indata.lower():
++ raise AssertionError(
++ "bad data <<%r>> (%d) received; expected
<<%r>> (%d)\n"
++ % (outdata[:20], len(outdata),
++ indata[:20].lower(), len(indata)))
++ s.write(b"over\n")
+ if connectionchatty:
+- if test_support.verbose:
+- sys.stdout.write(" client: read %s\n" %
repr(outdata))
+- if outdata != indata.lower():
+- raise AssertionError(
+- "bad data <<%s>> (%d) received; expected
<<%s>> (%d)\n"
+- % (outdata[:min(len(outdata),20)], len(outdata),
+- indata[:min(len(indata),20)].lower(), len(indata)))
+- s.write("over\n")
+- if connectionchatty:
+- if test_support.verbose:
+- sys.stdout.write(" client: closing connection.\n")
+- s.close()
++ if support.verbose:
++ sys.stdout.write(" client: closing connection.\n")
++ stats.update({
++ 'compression': s.compression(),
++ 'cipher': s.cipher(),
++ 'peercert': s.getpeercert(),
++ 'client_npn_protocol': s.selected_npn_protocol()
++ })
++ s.close()
++ stats['server_npn_protocols'] = server.selected_protocols
++ return stats
+
+- def try_protocol_combo(server_protocol,
+- client_protocol,
+- expect_success,
+- certsreqs=None):
++ def try_protocol_combo(server_protocol, client_protocol, expect_success,
++ certsreqs=None, server_options=0, client_options=0):
+ if certsreqs is None:
+ certsreqs = ssl.CERT_NONE
+ certtype = {
+@@ -922,19 +1910,30 @@ else:
+ ssl.CERT_OPTIONAL: "CERT_OPTIONAL",
+ ssl.CERT_REQUIRED: "CERT_REQUIRED",
+ }[certsreqs]
+- if test_support.verbose:
++ if support.verbose:
+ formatstr = (expect_success and " %s->%s %s\n") or "
{%s->%s} %s\n"
+ sys.stdout.write(formatstr %
+ (ssl.get_protocol_name(client_protocol),
+ ssl.get_protocol_name(server_protocol),
+ certtype))
++ client_context = ssl.SSLContext(client_protocol)
++ client_context.options |= client_options
++ server_context = ssl.SSLContext(server_protocol)
++ server_context.options |= server_options
++
++ # NOTE: we must enable "ALL" ciphers on the client, otherwise an
++ # SSLv23 client will send an SSLv3 hello (rather than SSLv2)
++ # starting from OpenSSL 1.0.0 (see issue #8322).
++ if client_context.protocol == ssl.PROTOCOL_SSLv23:
++ client_context.set_ciphers("ALL")
++
++ for ctx in (client_context, server_context):
++ ctx.verify_mode = certsreqs
++ ctx.load_cert_chain(CERTFILE)
++ ctx.load_verify_locations(CERTFILE)
+ try:
+- # NOTE: we must enable "ALL" ciphers, otherwise an SSLv23 client
+- # will send an SSLv3 hello (rather than SSLv2) starting from
+- # OpenSSL 1.0.0 (see issue #8322).
+- server_params_test(CERTFILE, server_protocol, certsreqs,
+- CERTFILE, CERTFILE, client_protocol,
+- ciphers="ALL", chatty=False)
++ server_params_test(client_context, server_context,
++ chatty=False, connectionchatty=False)
+ # Protocol mismatch can result in either an SSLError, or a
+ # "Connection reset by peer" error.
+ except ssl.SSLError:
+@@ -953,75 +1952,38 @@ else:
+
+ class ThreadedTests(unittest.TestCase):
+
+- def test_rude_shutdown(self):
+- """A brutal shutdown of an SSL server should raise an
IOError
+- in the client when attempting handshake.
+- """
+- listener_ready = threading.Event()
+- listener_gone = threading.Event()
+-
+- s = socket.socket()
+- port = test_support.bind_port(s, HOST)
+-
+- # `listener` runs in a thread. It sits in an accept() until
+- # the main thread connects. Then it rudely closes the socket,
+- # and sets Event `listener_gone` to let the main thread know
+- # the socket is gone.
+- def listener():
+- s.listen(5)
+- listener_ready.set()
+- s.accept()
+- s.close()
+- listener_gone.set()
+-
+- def connector():
+- listener_ready.wait()
+- c = socket.socket()
+- c.connect((HOST, port))
+- listener_gone.wait()
+- try:
+- ssl_sock = ssl.wrap_socket(c)
+- except IOError:
+- pass
+- else:
+- self.fail('connecting to closed SSL socket should have
failed')
+-
+- t = threading.Thread(target=listener)
+- t.start()
+- try:
+- connector()
+- finally:
+- t.join()
+-
+ @skip_if_broken_ubuntu_ssl
+ def test_echo(self):
+ """Basic test of an SSL client connecting to a
server"""
+- if test_support.verbose:
++ if support.verbose:
+ sys.stdout.write("\n")
+- server_params_test(CERTFILE, ssl.PROTOCOL_TLSv1, ssl.CERT_NONE,
+- CERTFILE, CERTFILE, ssl.PROTOCOL_TLSv1,
+- chatty=True, connectionchatty=True)
++ for protocol in PROTOCOLS:
++ context = ssl.SSLContext(protocol)
++ context.load_cert_chain(CERTFILE)
++ server_params_test(context, context,
++ chatty=True, connectionchatty=True)
+
+ def test_getpeercert(self):
+- if test_support.verbose:
++ if support.verbose:
+ sys.stdout.write("\n")
+- s2 = socket.socket()
+- server = ThreadedEchoServer(CERTFILE,
+- certreqs=ssl.CERT_NONE,
+- ssl_version=ssl.PROTOCOL_SSLv23,
+- cacerts=CERTFILE,
+- chatty=False)
++ context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
++ context.verify_mode = ssl.CERT_REQUIRED
++ context.load_verify_locations(CERTFILE)
++ context.load_cert_chain(CERTFILE)
++ server = ThreadedEchoServer(context=context, chatty=False)
+ with server:
+- s = ssl.wrap_socket(socket.socket(),
+- certfile=CERTFILE,
+- ca_certs=CERTFILE,
+- cert_reqs=ssl.CERT_REQUIRED,
+- ssl_version=ssl.PROTOCOL_SSLv23)
++ s = context.wrap_socket(socket.socket(),
++ do_handshake_on_connect=False)
+ s.connect((HOST, server.port))
++ # getpeercert() raise ValueError while the handshake isn't
++ # done.
++ with self.assertRaises(ValueError):
++ s.getpeercert()
++ s.do_handshake()
+ cert = s.getpeercert()
+ self.assertTrue(cert, "Can't get peer certificate.")
+ cipher = s.cipher()
+- if test_support.verbose:
++ if support.verbose:
+ sys.stdout.write(pprint.pformat(cert) + '\n')
+ sys.stdout.write("Connection cipher is " + str(cipher) +
'.\n')
+ if 'subject' not in cert:
+@@ -1032,8 +1994,94 @@ else:
+ self.fail(
+ "Missing or invalid 'organizationName' field in
certificate subject; "
+ "should be 'Python Software Foundation'.")
++ self.assertIn('notBefore', cert)
++ self.assertIn('notAfter', cert)
++ before = ssl.cert_time_to_seconds(cert['notBefore'])
++ after = ssl.cert_time_to_seconds(cert['notAfter'])
++ self.assertLess(before, after)
+ s.close()
+
++ @unittest.skipUnless(have_verify_flags(),
++ "verify_flags need OpenSSL > 0.9.8")
++ def test_crl_check(self):
++ if support.verbose:
++ sys.stdout.write("\n")
++
++ server_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ server_context.load_cert_chain(SIGNED_CERTFILE)
++
++ context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ context.verify_mode = ssl.CERT_REQUIRED
++ context.load_verify_locations(SIGNING_CA)
++ self.assertEqual(context.verify_flags, ssl.VERIFY_DEFAULT)
++
++ # VERIFY_DEFAULT should pass
++ server = ThreadedEchoServer(context=server_context, chatty=True)
++ with server:
++ with closing(context.wrap_socket(socket.socket())) as s:
++ s.connect((HOST, server.port))
++ cert = s.getpeercert()
++ self.assertTrue(cert, "Can't get peer certificate.")
++
++ # VERIFY_CRL_CHECK_LEAF without a loaded CRL file fails
++ context.verify_flags |= ssl.VERIFY_CRL_CHECK_LEAF
++
++ server = ThreadedEchoServer(context=server_context, chatty=True)
++ with server:
++ with closing(context.wrap_socket(socket.socket())) as s:
++ with self.assertRaisesRegexp(ssl.SSLError,
++ "certificate verify failed"):
++ s.connect((HOST, server.port))
++
++ # now load a CRL file. The CRL file is signed by the CA.
++ context.load_verify_locations(CRLFILE)
++
++ server = ThreadedEchoServer(context=server_context, chatty=True)
++ with server:
++ with closing(context.wrap_socket(socket.socket())) as s:
++ s.connect((HOST, server.port))
++ cert = s.getpeercert()
++ self.assertTrue(cert, "Can't get peer certificate.")
++
++ @needs_sni
++ def test_check_hostname(self):
++ if support.verbose:
++ sys.stdout.write("\n")
++
++ server_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ server_context.load_cert_chain(SIGNED_CERTFILE)
++
++ context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ context.verify_mode = ssl.CERT_REQUIRED
++ context.check_hostname = True
++ context.load_verify_locations(SIGNING_CA)
++
++ # correct hostname should verify
++ server = ThreadedEchoServer(context=server_context, chatty=True)
++ with server:
++ with closing(context.wrap_socket(socket.socket(),
++ server_hostname="localhost"))
as s:
++ s.connect((HOST, server.port))
++ cert = s.getpeercert()
++ self.assertTrue(cert, "Can't get peer certificate.")
++
++ # incorrect hostname should raise an exception
++ server = ThreadedEchoServer(context=server_context, chatty=True)
++ with server:
++ with closing(context.wrap_socket(socket.socket(),
++ server_hostname="invalid"))
as s:
++ with self.assertRaisesRegexp(ssl.CertificateError,
++ "hostname 'invalid'
doesn't match u?'localhost'"):
++ s.connect((HOST, server.port))
++
++ # missing server_hostname arg should cause an exception, too
++ server = ThreadedEchoServer(context=server_context, chatty=True)
++ with server:
++ with closing(socket.socket()) as s:
++ with self.assertRaisesRegexp(ValueError,
++ "check_hostname requires
server_hostname"):
++ context.wrap_socket(s)
++
+ def test_empty_cert(self):
+ """Connecting with an empty cert file"""
+ bad_cert_test(os.path.join(os.path.dirname(__file__) or os.curdir,
+@@ -1051,25 +2099,84 @@ else:
+ bad_cert_test(os.path.join(os.path.dirname(__file__) or os.curdir,
+ "badkey.pem"))
+
++ def test_rude_shutdown(self):
++ """A brutal shutdown of an SSL server should raise an
OSError
++ in the client when attempting handshake.
++ """
++ listener_ready = threading.Event()
++ listener_gone = threading.Event()
++
++ s = socket.socket()
++ port = support.bind_port(s, HOST)
++
++ # `listener` runs in a thread. It sits in an accept() until
++ # the main thread connects. Then it rudely closes the socket,
++ # and sets Event `listener_gone` to let the main thread know
++ # the socket is gone.
++ def listener():
++ s.listen(5)
++ listener_ready.set()
++ newsock, addr = s.accept()
++ newsock.close()
++ s.close()
++ listener_gone.set()
++
++ def connector():
++ listener_ready.wait()
++ with closing(socket.socket()) as c:
++ c.connect((HOST, port))
++ listener_gone.wait()
++ try:
++ ssl_sock = ssl.wrap_socket(c)
++ except ssl.SSLError:
++ pass
++ else:
++ self.fail('connecting to closed SSL socket should have
failed')
++
++ t = threading.Thread(target=listener)
++ t.start()
++ try:
++ connector()
++ finally:
++ t.join()
++
+ @skip_if_broken_ubuntu_ssl
++ @unittest.skipUnless(hasattr(ssl, 'PROTOCOL_SSLv2'),
++ "OpenSSL is compiled without SSLv2 support")
+ def test_protocol_sslv2(self):
+ """Connecting to an SSLv2 server with various client
options"""
+- if test_support.verbose:
++ if support.verbose:
+ sys.stdout.write("\n")
+- if not hasattr(ssl, 'PROTOCOL_SSLv2'):
+- self.skipTest("PROTOCOL_SSLv2 needed")
+ try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv2, True)
+ try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv2, True,
ssl.CERT_OPTIONAL)
+ try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv2, True,
ssl.CERT_REQUIRED)
+ try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv23, False)
+ try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv3, False)
+ try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_TLSv1, False)
++ # SSLv23 client with specific SSL options
++ if no_sslv2_implies_sslv3_hello():
++ # No SSLv2 => client will use an SSLv3 hello on recent OpenSSLs
++ try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv23, False,
++ client_options=ssl.OP_NO_SSLv2)
++ try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv23, False,
++ client_options=ssl.OP_NO_SSLv3)
++ try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv23, False,
++ client_options=ssl.OP_NO_TLSv1)
+
+ @skip_if_broken_ubuntu_ssl
+ def test_protocol_sslv23(self):
+ """Connecting to an SSLv23 server with various client
options"""
+- if test_support.verbose:
++ if support.verbose:
+ sys.stdout.write("\n")
++ if hasattr(ssl, 'PROTOCOL_SSLv2'):
++ try:
++ try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv2, True)
++ except socket.error as x:
++ # this fails on some older versions of OpenSSL (0.9.7l, for
instance)
++ if support.verbose:
++ sys.stdout.write(
++ " SSL2 client to SSL23 server test unexpectedly
failed:\n %s\n"
++ % str(x))
+ try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3, True)
+ try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv23, True)
+ try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1, True)
+@@ -1082,22 +2189,38 @@ else:
+ try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv23, True,
ssl.CERT_REQUIRED)
+ try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1, True,
ssl.CERT_REQUIRED)
+
++ # Server with specific SSL options
++ try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3, False,
++ server_options=ssl.OP_NO_SSLv3)
++ # Will choose TLSv1
++ try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv23, True,
++ server_options=ssl.OP_NO_SSLv2 | ssl.OP_NO_SSLv3)
++ try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1, False,
++ server_options=ssl.OP_NO_TLSv1)
++
++
+ @skip_if_broken_ubuntu_ssl
+ def test_protocol_sslv3(self):
+ """Connecting to an SSLv3 server with various client
options"""
+- if test_support.verbose:
++ if support.verbose:
+ sys.stdout.write("\n")
+ try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv3, True)
+ try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv3, True,
ssl.CERT_OPTIONAL)
+ try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv3, True,
ssl.CERT_REQUIRED)
+ if hasattr(ssl, 'PROTOCOL_SSLv2'):
+ try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv2, False)
++ try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv23, False,
++ client_options=ssl.OP_NO_SSLv3)
+ try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_TLSv1, False)
++ if no_sslv2_implies_sslv3_hello():
++ # No SSLv2 => client will use an SSLv3 hello on recent OpenSSLs
++ try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv23, True,
++ client_options=ssl.OP_NO_SSLv2)
+
+ @skip_if_broken_ubuntu_ssl
+ def test_protocol_tlsv1(self):
+ """Connecting to a TLSv1 server with various client
options"""
+- if test_support.verbose:
++ if support.verbose:
+ sys.stdout.write("\n")
+ try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_TLSv1, True)
+ try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_TLSv1, True,
ssl.CERT_OPTIONAL)
+@@ -1105,10 +2228,55 @@ else:
+ if hasattr(ssl, 'PROTOCOL_SSLv2'):
+ try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_SSLv2, False)
+ try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_SSLv3, False)
++ try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_SSLv23, False,
++ client_options=ssl.OP_NO_TLSv1)
++
++ @skip_if_broken_ubuntu_ssl
++ @unittest.skipUnless(hasattr(ssl, "PROTOCOL_TLSv1_1"),
++ "TLS version 1.1 not supported.")
++ def test_protocol_tlsv1_1(self):
++ """Connecting to a TLSv1.1 server with various client
options.
++ Testing against older TLS versions."""
++ if support.verbose:
++ sys.stdout.write("\n")
++ try_protocol_combo(ssl.PROTOCOL_TLSv1_1, ssl.PROTOCOL_TLSv1_1, True)
++ if hasattr(ssl, 'PROTOCOL_SSLv2'):
++ try_protocol_combo(ssl.PROTOCOL_TLSv1_1, ssl.PROTOCOL_SSLv2, False)
++ try_protocol_combo(ssl.PROTOCOL_TLSv1_1, ssl.PROTOCOL_SSLv3, False)
++ try_protocol_combo(ssl.PROTOCOL_TLSv1_1, ssl.PROTOCOL_SSLv23, False,
++ client_options=ssl.OP_NO_TLSv1_1)
++
++ try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1_1, True)
++ try_protocol_combo(ssl.PROTOCOL_TLSv1_1, ssl.PROTOCOL_TLSv1, False)
++ try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_TLSv1_1, False)
++
++
++ @skip_if_broken_ubuntu_ssl
++ @unittest.skipUnless(hasattr(ssl, "PROTOCOL_TLSv1_2"),
++ "TLS version 1.2 not supported.")
++ def test_protocol_tlsv1_2(self):
++ """Connecting to a TLSv1.2 server with various client
options.
++ Testing against older TLS versions."""
++ if support.verbose:
++ sys.stdout.write("\n")
++ try_protocol_combo(ssl.PROTOCOL_TLSv1_2, ssl.PROTOCOL_TLSv1_2, True,
++ server_options=ssl.OP_NO_SSLv3|ssl.OP_NO_SSLv2,
++ client_options=ssl.OP_NO_SSLv3|ssl.OP_NO_SSLv2,)
++ if hasattr(ssl, 'PROTOCOL_SSLv2'):
++ try_protocol_combo(ssl.PROTOCOL_TLSv1_2, ssl.PROTOCOL_SSLv2, False)
++ try_protocol_combo(ssl.PROTOCOL_TLSv1_2, ssl.PROTOCOL_SSLv3, False)
++ try_protocol_combo(ssl.PROTOCOL_TLSv1_2, ssl.PROTOCOL_SSLv23, False,
++ client_options=ssl.OP_NO_TLSv1_2)
++
++ try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1_2, True)
++ try_protocol_combo(ssl.PROTOCOL_TLSv1_2, ssl.PROTOCOL_TLSv1, False)
++ try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_TLSv1_2, False)
++ try_protocol_combo(ssl.PROTOCOL_TLSv1_2, ssl.PROTOCOL_TLSv1_1, False)
++ try_protocol_combo(ssl.PROTOCOL_TLSv1_1, ssl.PROTOCOL_TLSv1_2, False)
+
+ def test_starttls(self):
+ """Switching from clear text to encrypted and back
again."""
+- msgs = ("msg 1", "MSG 2", "STARTTLS",
"MSG 3", "msg 4", "ENDTLS", "msg 5", "msg
6")
++ msgs = (b"msg 1", b"MSG 2", b"STARTTLS",
b"MSG 3", b"msg 4", b"ENDTLS", b"msg 5",
b"msg 6")
+
+ server = ThreadedEchoServer(CERTFILE,
+ ssl_version=ssl.PROTOCOL_TLSv1,
+@@ -1120,119 +2288,109 @@ else:
+ s = socket.socket()
+ s.setblocking(1)
+ s.connect((HOST, server.port))
+- if test_support.verbose:
++ if support.verbose:
+ sys.stdout.write("\n")
+ for indata in msgs:
+- if test_support.verbose:
++ if support.verbose:
+ sys.stdout.write(
+- " client: sending %s...\n" % repr(indata))
++ " client: sending %r...\n" % indata)
+ if wrapped:
+ conn.write(indata)
+ outdata = conn.read()
+ else:
+ s.send(indata)
+ outdata = s.recv(1024)
+- if (indata == "STARTTLS" and
+- outdata.strip().lower().startswith("ok")):
++ msg = outdata.strip().lower()
++ if indata == b"STARTTLS" and
msg.startswith(b"ok"):
+ # STARTTLS ok, switch to secure mode
+- if test_support.verbose:
++ if support.verbose:
+ sys.stdout.write(
+- " client: read %s from server, starting
TLS...\n"
+- % repr(outdata))
++ " client: read %r from server, starting
TLS...\n"
++ % msg)
+ conn = ssl.wrap_socket(s, ssl_version=ssl.PROTOCOL_TLSv1)
+ wrapped = True
+- elif (indata == "ENDTLS" and
+- outdata.strip().lower().startswith("ok")):
++ elif indata == b"ENDTLS" and
msg.startswith(b"ok"):
+ # ENDTLS ok, switch back to clear text
+- if test_support.verbose:
++ if support.verbose:
+ sys.stdout.write(
+- " client: read %s from server, ending
TLS...\n"
+- % repr(outdata))
++ " client: read %r from server, ending
TLS...\n"
++ % msg)
+ s = conn.unwrap()
+ wrapped = False
+ else:
+- if test_support.verbose:
++ if support.verbose:
+ sys.stdout.write(
+- " client: read %s from server\n" %
repr(outdata))
+- if test_support.verbose:
++ " client: read %r from server\n" % msg)
++ if support.verbose:
+ sys.stdout.write(" client: closing connection.\n")
+ if wrapped:
+- conn.write("over\n")
++ conn.write(b"over\n")
+ else:
+- s.send("over\n")
+- s.close()
++ s.send(b"over\n")
++ if wrapped:
++ conn.close()
++ else:
++ s.close()
+
+ def test_socketserver(self):
+ """Using a SocketServer to create and manage SSL
connections."""
+- server = SocketServerHTTPSServer(CERTFILE)
+- flag = threading.Event()
+- server.start(flag)
+- # wait for it to start
+- flag.wait()
++ server = make_https_server(self, certfile=CERTFILE)
+ # try to connect
++ if support.verbose:
++ sys.stdout.write('\n')
++ with open(CERTFILE, 'rb') as f:
++ d1 = f.read()
++ d2 = ''
++ # now fetch the same data from the HTTPS server
++ url = 'https://%s:%d/%s' % (
++ HOST, server.port, os.path.split(CERTFILE)[1])
++ f = urllib.urlopen(url)
+ try:
+- if test_support.verbose:
+- sys.stdout.write('\n')
+- with open(CERTFILE, 'rb') as f:
+- d1 = f.read()
+- d2 = ''
+- # now fetch the same data from the HTTPS server
+- url = 'https://127.0.0.1:%d/%s' % (
+- server.port, os.path.split(CERTFILE)[1])
+- with test_support.check_py3k_warnings():
+- f = urllib.urlopen(url)
+ dlen = f.info().getheader("content-length")
+ if dlen and (int(dlen) > 0):
+ d2 = f.read(int(dlen))
+- if test_support.verbose:
++ if support.verbose:
+ sys.stdout.write(
+ " client: read %d bytes from remote server
'%s'\n"
+ % (len(d2), server))
+- f.close()
+- self.assertEqual(d1, d2)
+ finally:
+- server.stop()
+- server.join()
+-
+- def test_wrapped_accept(self):
+- """Check the accept() method on SSL
sockets."""
+- if test_support.verbose:
+- sys.stdout.write("\n")
+- server_params_test(CERTFILE, ssl.PROTOCOL_SSLv23, ssl.CERT_REQUIRED,
+- CERTFILE, CERTFILE, ssl.PROTOCOL_SSLv23,
+- chatty=True, connectionchatty=True,
+- wrap_accepting_socket=True)
++ f.close()
++ self.assertEqual(d1, d2)
+
+ def test_asyncore_server(self):
+ """Check the example asyncore integration."""
+ indata = "TEST MESSAGE of mixed case\n"
+
+- if test_support.verbose:
++ if support.verbose:
+ sys.stdout.write("\n")
++
++ indata = b"FOO\n"
+ server = AsyncoreEchoServer(CERTFILE)
+ with server:
+ s = ssl.wrap_socket(socket.socket())
+ s.connect(('127.0.0.1', server.port))
+- if test_support.verbose:
++ if support.verbose:
+ sys.stdout.write(
+- " client: sending %s...\n" % (repr(indata)))
++ " client: sending %r...\n" % indata)
+ s.write(indata)
+ outdata = s.read()
+- if test_support.verbose:
+- sys.stdout.write(" client: read %s\n" % repr(outdata))
++ if support.verbose:
++ sys.stdout.write(" client: read %r\n" % outdata)
+ if outdata != indata.lower():
+ self.fail(
+- "bad data <<%s>> (%d) received; expected
<<%s>> (%d)\n"
+- % (outdata[:min(len(outdata),20)], len(outdata),
+- indata[:min(len(indata),20)].lower(), len(indata)))
+- s.write("over\n")
+- if test_support.verbose:
++ "bad data <<%r>> (%d) received; expected
<<%r>> (%d)\n"
++ % (outdata[:20], len(outdata),
++ indata[:20].lower(), len(indata)))
++ s.write(b"over\n")
++ if support.verbose:
+ sys.stdout.write(" client: closing connection.\n")
+ s.close()
++ if support.verbose:
++ sys.stdout.write(" client: connection closed.\n")
+
+ def test_recv_send(self):
+ """Test recv(), send() and friends."""
+- if test_support.verbose:
++ if support.verbose:
+ sys.stdout.write("\n")
+
+ server = ThreadedEchoServer(CERTFILE,
+@@ -1251,12 +2409,12 @@ else:
+ s.connect((HOST, server.port))
+ # helper methods for standardising recv* method signatures
+ def _recv_into():
+- b = bytearray("\0"*100)
++ b = bytearray(b"\0"*100)
+ count = s.recv_into(b)
+ return b[:count]
+
+ def _recvfrom_into():
+- b = bytearray("\0"*100)
++ b = bytearray(b"\0"*100)
+ count, addr = s.recvfrom_into(b)
+ return b[:count]
+
+@@ -1275,73 +2433,73 @@ else:
+ data_prefix = u"PREFIX_"
+
+ for meth_name, send_meth, expect_success, args in send_methods:
+- indata = data_prefix + meth_name
++ indata = (data_prefix + meth_name).encode('ascii')
+ try:
+- send_meth(indata.encode('ASCII', 'strict'),
*args)
++ send_meth(indata, *args)
+ outdata = s.read()
+- outdata = outdata.decode('ASCII', 'strict')
+ if outdata != indata.lower():
+ self.fail(
+- "While sending with <<%s>> bad data
"
+- "<<%r>> (%d) received; "
+- "expected <<%r>> (%d)\n" % (
+- meth_name, outdata[:20], len(outdata),
+- indata[:20], len(indata)
++ "While sending with <<{name:s}>> bad
data "
++ "<<{outdata:r}>> ({nout:d}) received;
"
++ "expected <<{indata:r}>>
({nin:d})\n".format(
++ name=meth_name, outdata=outdata[:20],
++ nout=len(outdata),
++ indata=indata[:20], nin=len(indata)
+ )
+ )
+ except ValueError as e:
+ if expect_success:
+ self.fail(
+- "Failed to send with method <<%s>>;
"
+- "expected to succeed.\n" % (meth_name,)
++ "Failed to send with method
<<{name:s}>>; "
++ "expected to
succeed.\n".format(name=meth_name)
+ )
+ if not str(e).startswith(meth_name):
+ self.fail(
+- "Method <<%s>> failed with unexpected
"
+- "exception message: %s\n" % (
+- meth_name, e
++ "Method <<{name:s}>> failed with
unexpected "
++ "exception message: {exp:s}\n".format(
++ name=meth_name, exp=e
+ )
+ )
+
+ for meth_name, recv_meth, expect_success, args in recv_methods:
+- indata = data_prefix + meth_name
++ indata = (data_prefix + meth_name).encode('ascii')
+ try:
+- s.send(indata.encode('ASCII', 'strict'))
++ s.send(indata)
+ outdata = recv_meth(*args)
+- outdata = outdata.decode('ASCII', 'strict')
+ if outdata != indata.lower():
+ self.fail(
+- "While receiving with <<%s>> bad data
"
+- "<<%r>> (%d) received; "
+- "expected <<%r>> (%d)\n" % (
+- meth_name, outdata[:20], len(outdata),
+- indata[:20], len(indata)
++ "While receiving with <<{name:s}>> bad
data "
++ "<<{outdata:r}>> ({nout:d}) received;
"
++ "expected <<{indata:r}>>
({nin:d})\n".format(
++ name=meth_name, outdata=outdata[:20],
++ nout=len(outdata),
++ indata=indata[:20], nin=len(indata)
+ )
+ )
+ except ValueError as e:
+ if expect_success:
+ self.fail(
+- "Failed to receive with method <<%s>>;
"
+- "expected to succeed.\n" % (meth_name,)
++ "Failed to receive with method
<<{name:s}>>; "
++ "expected to
succeed.\n".format(name=meth_name)
+ )
+ if not str(e).startswith(meth_name):
+ self.fail(
+- "Method <<%s>> failed with unexpected
"
+- "exception message: %s\n" % (
+- meth_name, e
++ "Method <<{name:s}>> failed with
unexpected "
++ "exception message: {exp:s}\n".format(
++ name=meth_name, exp=e
+ )
+ )
+ # consume data
+ s.read()
+
+- s.write("over\n".encode("ASCII",
"strict"))
++ s.write(b"over\n")
+ s.close()
+
+ def test_handshake_timeout(self):
+ # Issue #5103: SSL handshake must respect the socket timeout
+ server = socket.socket(socket.AF_INET)
+ host = "127.0.0.1"
+- port = test_support.bind_port(server)
++ port = support.bind_port(server)
+ started = threading.Event()
+ finish = False
+
+@@ -1355,6 +2513,8 @@ else:
+ # Let the socket hang around rather than having
+ # it closed by garbage collection.
+ conns.append(server.accept()[0])
++ for sock in conns:
++ sock.close()
+
+ t = threading.Thread(target=serve)
+ t.start()
+@@ -1372,8 +2532,8 @@ else:
+ c.close()
+ try:
+ c = socket.socket(socket.AF_INET)
+- c.settimeout(0.2)
+ c = ssl.wrap_socket(c)
++ c.settimeout(0.2)
+ # Will attempt handshake and time out
+ self.assertRaisesRegexp(ssl.SSLError, "timed out",
+ c.connect, (host, port))
+@@ -1384,59 +2544,384 @@ else:
+ t.join()
+ server.close()
+
++ def test_server_accept(self):
++ # Issue #16357: accept() on a SSLSocket created through
++ # SSLContext.wrap_socket().
++ context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
++ context.verify_mode = ssl.CERT_REQUIRED
++ context.load_verify_locations(CERTFILE)
++ context.load_cert_chain(CERTFILE)
++ server = socket.socket(socket.AF_INET)
++ host = "127.0.0.1"
++ port = support.bind_port(server)
++ server = context.wrap_socket(server, server_side=True)
++
++ evt = threading.Event()
++ remote = [None]
++ peer = [None]
++ def serve():
++ server.listen(5)
++ # Block on the accept and wait on the connection to close.
++ evt.set()
++ remote[0], peer[0] = server.accept()
++ remote[0].recv(1)
++
++ t = threading.Thread(target=serve)
++ t.start()
++ # Client wait until server setup and perform a connect.
++ evt.wait()
++ client = context.wrap_socket(socket.socket())
++ client.connect((host, port))
++ client_addr = client.getsockname()
++ client.close()
++ t.join()
++ remote[0].close()
++ server.close()
++ # Sanity checks.
++ self.assertIsInstance(remote[0], ssl.SSLSocket)
++ self.assertEqual(peer[0], client_addr)
++
++ def test_getpeercert_enotconn(self):
++ context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
++ with closing(context.wrap_socket(socket.socket())) as sock:
++ with self.assertRaises(socket.error) as cm:
++ sock.getpeercert()
++ self.assertEqual(cm.exception.errno, errno.ENOTCONN)
++
++ def test_do_handshake_enotconn(self):
++ context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
++ with closing(context.wrap_socket(socket.socket())) as sock:
++ with self.assertRaises(socket.error) as cm:
++ sock.do_handshake()
++ self.assertEqual(cm.exception.errno, errno.ENOTCONN)
++
+ def test_default_ciphers(self):
++ context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
++ try:
++ # Force a set of weak ciphers on our client context
++ context.set_ciphers("DES")
++ except ssl.SSLError:
++ self.skipTest("no DES cipher available")
+ with ThreadedEchoServer(CERTFILE,
+ ssl_version=ssl.PROTOCOL_SSLv23,
+ chatty=False) as server:
+- sock = socket.socket()
+- try:
+- # Force a set of weak ciphers on our client socket
+- try:
+- s = ssl.wrap_socket(sock,
+- ssl_version=ssl.PROTOCOL_SSLv23,
+- ciphers="DES")
+- except ssl.SSLError:
+- self.skipTest("no DES cipher available")
+- with self.assertRaises((OSError, ssl.SSLError)):
++ with closing(context.wrap_socket(socket.socket())) as s:
++ with self.assertRaises(ssl.SSLError):
+ s.connect((HOST, server.port))
+- finally:
+- sock.close()
+ self.assertIn("no shared cipher", str(server.conn_errors[0]))
+
++ @unittest.skipUnless(ssl.HAS_ECDH, "test requires ECDH-enabled
OpenSSL")
++ def test_default_ecdh_curve(self):
++ # Issue #21015: elliptic curve-based Diffie Hellman key exchange
++ # should be enabled by default on SSL contexts.
++ context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
++ context.load_cert_chain(CERTFILE)
++ # Prior to OpenSSL 1.0.0, ECDH ciphers have to be enabled
++ # explicitly using the 'ECCdraft' cipher alias. Otherwise,
++ # our default cipher list should prefer ECDH-based ciphers
++ # automatically.
++ if ssl.OPENSSL_VERSION_INFO < (1, 0, 0):
++ context.set_ciphers("ECCdraft:ECDH")
++ with ThreadedEchoServer(context=context) as server:
++ with closing(context.wrap_socket(socket.socket())) as s:
++ s.connect((HOST, server.port))
++ self.assertIn("ECDH", s.cipher()[0])
++
++ @unittest.skipUnless("tls-unique" in ssl.CHANNEL_BINDING_TYPES,
++ "'tls-unique' channel binding not
available")
++ def test_tls_unique_channel_binding(self):
++ """Test tls-unique channel binding."""
++ if support.verbose:
++ sys.stdout.write("\n")
++
++ server = ThreadedEchoServer(CERTFILE,
++ certreqs=ssl.CERT_NONE,
++ ssl_version=ssl.PROTOCOL_TLSv1,
++ cacerts=CERTFILE,
++ chatty=True,
++ connectionchatty=False)
++ with server:
++ s = ssl.wrap_socket(socket.socket(),
++ server_side=False,
++ certfile=CERTFILE,
++ ca_certs=CERTFILE,
++ cert_reqs=ssl.CERT_NONE,
++ ssl_version=ssl.PROTOCOL_TLSv1)
++ s.connect((HOST, server.port))
++ # get the data
++ cb_data = s.get_channel_binding("tls-unique")
++ if support.verbose:
++ sys.stdout.write(" got channel binding data: {0!r}\n"
++ .format(cb_data))
++
++ # check if it is sane
++ self.assertIsNotNone(cb_data)
++ self.assertEqual(len(cb_data), 12) # True for TLSv1
++
++ # and compare with the peers version
++ s.write(b"CB tls-unique\n")
++ peer_data_repr = s.read().strip()
++ self.assertEqual(peer_data_repr,
++ repr(cb_data).encode("us-ascii"))
++ s.close()
++
++ # now, again
++ s = ssl.wrap_socket(socket.socket(),
++ server_side=False,
++ certfile=CERTFILE,
++ ca_certs=CERTFILE,
++ cert_reqs=ssl.CERT_NONE,
++ ssl_version=ssl.PROTOCOL_TLSv1)
++ s.connect((HOST, server.port))
++ new_cb_data = s.get_channel_binding("tls-unique")
++ if support.verbose:
++ sys.stdout.write(" got another channel binding data:
{0!r}\n"
++ .format(new_cb_data))
++ # is it really unique
++ self.assertNotEqual(cb_data, new_cb_data)
++ self.assertIsNotNone(cb_data)
++ self.assertEqual(len(cb_data), 12) # True for TLSv1
++ s.write(b"CB tls-unique\n")
++ peer_data_repr = s.read().strip()
++ self.assertEqual(peer_data_repr,
++ repr(new_cb_data).encode("us-ascii"))
++ s.close()
++
++ def test_compression(self):
++ context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ context.load_cert_chain(CERTFILE)
++ stats = server_params_test(context, context,
++ chatty=True, connectionchatty=True)
++ if support.verbose:
++ sys.stdout.write(" got compression:
{!r}\n".format(stats['compression']))
++ self.assertIn(stats['compression'], { None, 'ZLIB',
'RLE' })
++
++ @unittest.skipUnless(hasattr(ssl, 'OP_NO_COMPRESSION'),
++ "ssl.OP_NO_COMPRESSION needed for this test")
++ def test_compression_disabled(self):
++ context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ context.load_cert_chain(CERTFILE)
++ context.options |= ssl.OP_NO_COMPRESSION
++ stats = server_params_test(context, context,
++ chatty=True, connectionchatty=True)
++ self.assertIs(stats['compression'], None)
++
++ def test_dh_params(self):
++ # Check we can get a connection with ephemeral Diffie-Hellman
++ context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ context.load_cert_chain(CERTFILE)
++ context.load_dh_params(DHFILE)
++ context.set_ciphers("kEDH")
++ stats = server_params_test(context, context,
++ chatty=True, connectionchatty=True)
++ cipher = stats["cipher"][0]
++ parts = cipher.split("-")
++ if "ADH" not in parts and "EDH" not in parts and
"DHE" not in parts:
++ self.fail("Non-DH cipher: " + cipher[0])
++
++ def test_selected_npn_protocol(self):
++ # selected_npn_protocol() is None unless NPN is used
++ context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ context.load_cert_chain(CERTFILE)
++ stats = server_params_test(context, context,
++ chatty=True, connectionchatty=True)
++ self.assertIs(stats['client_npn_protocol'], None)
++
++ @unittest.skipUnless(ssl.HAS_NPN, "NPN support needed for this test")
++ def test_npn_protocols(self):
++ server_protocols = ['http/1.1', 'spdy/2']
++ protocol_tests = [
++ (['http/1.1', 'spdy/2'], 'http/1.1'),
++ (['spdy/2', 'http/1.1'], 'http/1.1'),
++ (['spdy/2', 'test'], 'spdy/2'),
++ (['abc', 'def'], 'abc')
++ ]
++ for client_protocols, expected in protocol_tests:
++ server_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ server_context.load_cert_chain(CERTFILE)
++ server_context.set_npn_protocols(server_protocols)
++ client_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ client_context.load_cert_chain(CERTFILE)
++ client_context.set_npn_protocols(client_protocols)
++ stats = server_params_test(client_context, server_context,
++ chatty=True, connectionchatty=True)
++
++ msg = "failed trying %s (s) and %s (c).\n" \
++ "was expecting %s, but got %%s from the %%s" \
++ % (str(server_protocols), str(client_protocols),
++ str(expected))
++ client_result = stats['client_npn_protocol']
++ self.assertEqual(client_result, expected, msg % (client_result,
"client"))
++ server_result = stats['server_npn_protocols'][-1] \
++ if len(stats['server_npn_protocols']) else
'nothing'
++ self.assertEqual(server_result, expected, msg % (server_result,
"server"))
++
++ def sni_contexts(self):
++ server_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ server_context.load_cert_chain(SIGNED_CERTFILE)
++ other_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ other_context.load_cert_chain(SIGNED_CERTFILE2)
++ client_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
++ client_context.verify_mode = ssl.CERT_REQUIRED
++ client_context.load_verify_locations(SIGNING_CA)
++ return server_context, other_context, client_context
++
++ def check_common_name(self, stats, name):
++ cert = stats['peercert']
++ self.assertIn((('commonName', name),), cert['subject'])
++
++ @needs_sni
++ def test_sni_callback(self):
++ calls = []
++ server_context, other_context, client_context = self.sni_contexts()
++
++ def servername_cb(ssl_sock, server_name, initial_context):
++ calls.append((server_name, initial_context))
++ if server_name is not None:
++ ssl_sock.context = other_context
++ server_context.set_servername_callback(servername_cb)
++
++ stats = server_params_test(client_context, server_context,
++ chatty=True,
++ sni_name='supermessage')
++ # The hostname was fetched properly, and the certificate was
++ # changed for the connection.
++ self.assertEqual(calls, [("supermessage", server_context)])
++ # CERTFILE4 was selected
++ self.check_common_name(stats, 'fakehostname')
++
++ calls = []
++ # The callback is called with server_name=None
++ stats = server_params_test(client_context, server_context,
++ chatty=True,
++ sni_name=None)
++ self.assertEqual(calls, [(None, server_context)])
++ self.check_common_name(stats, 'localhost')
++
++ # Check disabling the callback
++ calls = []
++ server_context.set_servername_callback(None)
++
++ stats = server_params_test(client_context, server_context,
++ chatty=True,
++ sni_name='notfunny')
++ # Certificate didn't change
++ self.check_common_name(stats, 'localhost')
++ self.assertEqual(calls, [])
++
++ @needs_sni
++ def test_sni_callback_alert(self):
++ # Returning a TLS alert is reflected to the connecting client
++ server_context, other_context, client_context = self.sni_contexts()
++
++ def cb_returning_alert(ssl_sock, server_name, initial_context):
++ return ssl.ALERT_DESCRIPTION_ACCESS_DENIED
++ server_context.set_servername_callback(cb_returning_alert)
++
++ with self.assertRaises(ssl.SSLError) as cm:
++ stats = server_params_test(client_context, server_context,
++ chatty=False,
++ sni_name='supermessage')
++ self.assertEqual(cm.exception.reason, 'TLSV1_ALERT_ACCESS_DENIED')
++
++ @needs_sni
++ def test_sni_callback_raising(self):
++ # Raising fails the connection with a TLS handshake failure alert.
++ server_context, other_context, client_context = self.sni_contexts()
++
++ def cb_raising(ssl_sock, server_name, initial_context):
++ 1/0
++ server_context.set_servername_callback(cb_raising)
++
++ with self.assertRaises(ssl.SSLError) as cm, \
++ support.captured_stderr() as stderr:
++ stats = server_params_test(client_context, server_context,
++ chatty=False,
++ sni_name='supermessage')
++ self.assertEqual(cm.exception.reason,
'SSLV3_ALERT_HANDSHAKE_FAILURE')
++ self.assertIn("ZeroDivisionError", stderr.getvalue())
++
++ @needs_sni
++ def test_sni_callback_wrong_return_type(self):
++ # Returning the wrong return type terminates the TLS connection
++ # with an internal error alert.
++ server_context, other_context, client_context = self.sni_contexts()
++
++ def cb_wrong_return_type(ssl_sock, server_name, initial_context):
++ return "foo"
++ server_context.set_servername_callback(cb_wrong_return_type)
++
++ with self.assertRaises(ssl.SSLError) as cm, \
++ support.captured_stderr() as stderr:
++ stats = server_params_test(client_context, server_context,
++ chatty=False,
++ sni_name='supermessage')
++ self.assertEqual(cm.exception.reason, 'TLSV1_ALERT_INTERNAL_ERROR')
++ self.assertIn("TypeError", stderr.getvalue())
++
++ def test_read_write_after_close_raises_valuerror(self):
++ context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
++ context.verify_mode = ssl.CERT_REQUIRED
++ context.load_verify_locations(CERTFILE)
++ context.load_cert_chain(CERTFILE)
++ server = ThreadedEchoServer(context=context, chatty=False)
++
++ with server:
++ s = context.wrap_socket(socket.socket())
++ s.connect((HOST, server.port))
++ s.close()
++
++ self.assertRaises(ValueError, s.read, 1024)
++ self.assertRaises(ValueError, s.write, b'hello')
++
+
+ def test_main(verbose=False):
+- global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, NOKIACERT, NULLBYTECERT
+- CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir,
+- "keycert.pem")
+- SVN_PYTHON_ORG_ROOT_CERT = os.path.join(
+- os.path.dirname(__file__) or os.curdir,
+- "https_svn_python_org_root.pem")
+- NOKIACERT = os.path.join(os.path.dirname(__file__) or os.curdir,
+- "nokia.pem")
+- NULLBYTECERT = os.path.join(os.path.dirname(__file__) or os.curdir,
+- "nullbytecert.pem")
+-
+- if (not os.path.exists(CERTFILE) or
+- not os.path.exists(SVN_PYTHON_ORG_ROOT_CERT) or
+- not os.path.exists(NOKIACERT) or
+- not os.path.exists(NULLBYTECERT)):
+- raise test_support.TestFailed("Can't read certificate files!")
+-
+- tests = [BasicTests, BasicSocketTests]
+-
+- if test_support.is_resource_enabled('network'):
++ if support.verbose:
++ plats = {
++ 'Linux': platform.linux_distribution,
++ 'Mac': platform.mac_ver,
++ 'Windows': platform.win32_ver,
++ }
++ for name, func in plats.items():
++ plat = func()
++ if plat and plat[0]:
++ plat = '%s %r' % (name, plat)
++ break
++ else:
++ plat = repr(platform.platform())
++ print("test_ssl: testing with %r %r" %
++ (ssl.OPENSSL_VERSION, ssl.OPENSSL_VERSION_INFO))
++ print(" under %s" % plat)
++ print(" HAS_SNI = %r" % ssl.HAS_SNI)
++ print(" OP_ALL = 0x%8x" % ssl.OP_ALL)
++ try:
++ print(" OP_NO_TLSv1_1 = 0x%8x" % ssl.OP_NO_TLSv1_1)
++ except AttributeError:
++ pass
++
++ for filename in [
++ CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, BYTES_CERTFILE,
++ ONLYCERT, ONLYKEY, BYTES_ONLYCERT, BYTES_ONLYKEY,
++ SIGNED_CERTFILE, SIGNED_CERTFILE2, SIGNING_CA,
++ BADCERT, BADKEY, EMPTYCERT]:
++ if not os.path.exists(filename):
++ raise support.TestFailed("Can't read certificate file %r" %
filename)
++
++ tests = [ContextTests, BasicSocketTests, SSLErrorTests]
++
++ if support.is_resource_enabled('network'):
+ tests.append(NetworkedTests)
+
+ if _have_threads:
+- thread_info = test_support.threading_setup()
+- if thread_info and test_support.is_resource_enabled('network'):
++ thread_info = support.threading_setup()
++ if thread_info:
+ tests.append(ThreadedTests)
+
+ try:
+- test_support.run_unittest(*tests)
++ support.run_unittest(*tests)
+ finally:
+ if _have_threads:
+- test_support.threading_cleanup(*thread_info)
++ support.threading_cleanup(*thread_info)
+
+ if __name__ == "__main__":
+ test_main()
+diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py
+index 695ac95..c1c8799 100644
+--- a/Lib/test/test_support.py
++++ b/Lib/test/test_support.py
+@@ -39,7 +39,7 @@ __all__ = ["Error", "TestFailed",
"ResourceDenied", "import_module",
+ "threading_cleanup", "reap_children",
"cpython_only",
+ "check_impl_detail", "get_attribute",
"py3k_bytes",
+ "import_fresh_module", "threading_cleanup",
"reap_children",
+- "strip_python_stderr"]
++ "strip_python_stderr", "IPV6_ENABLED"]
+
+ class Error(Exception):
+ """Base class for regression test exceptions."""
+@@ -465,6 +465,23 @@ def bind_port(sock, host=HOST):
+ port = sock.getsockname()[1]
+ return port
+
++def _is_ipv6_enabled():
++ """Check whether IPv6 is enabled on this host."""
++ if socket.has_ipv6:
++ sock = None
++ try:
++ sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
++ sock.bind((HOSTv6, 0))
++ return True
++ except OSError:
++ pass
++ finally:
++ if sock:
++ sock.close()
++ return False
++
++IPV6_ENABLED = _is_ipv6_enabled()
++
+ FUZZ = 1e-6
+
+ def fcmp(x, y): # fuzzy comparison function
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index bcd83bf..80a0926 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -930,8 +930,8 @@ PLATMACDIRS= plat-mac plat-mac/Carbon plat-mac/lib-scriptpackages \
+ plat-mac/lib-scriptpackages/Terminal
+ PLATMACPATH=:plat-mac:plat-mac/lib-scriptpackages
+ LIBSUBDIRS= lib-tk lib-tk/test lib-tk/test/test_tkinter \
+- lib-tk/test/test_ttk site-packages test test/audiodata test/data \
+- test/cjkencodings test/decimaltestdata test/xmltestdata \
++ lib-tk/test/test_ttk site-packages test test/audiodata test/capath \
++ test/data test/cjkencodings test/decimaltestdata test/xmltestdata \
+ test/imghdrdata \
+ test/subprocessdata \
+ test/tracedmodules \
+diff --git a/Modules/_ssl.c b/Modules/_ssl.c
+index 752b033..493eeea 100644
+--- a/Modules/_ssl.c
++++ b/Modules/_ssl.c
+@@ -14,22 +14,28 @@
+
http://bugs.python.org/issue8108#msg102867 ?
+ */
+
++#define PY_SSIZE_T_CLEAN
+ #include "Python.h"
+
+ #ifdef WITH_THREAD
+ #include "pythread.h"
+
+
++#define PySSL_BEGIN_ALLOW_THREADS_S(save) \
++ do { if (_ssl_locks_count>0) { (save) = PyEval_SaveThread(); } } while (0)
++#define PySSL_END_ALLOW_THREADS_S(save) \
++ do { if (_ssl_locks_count>0) { PyEval_RestoreThread(save); } } while (0)
+ #define PySSL_BEGIN_ALLOW_THREADS { \
+ PyThreadState *_save = NULL; \
+- if (_ssl_locks_count>0) {_save = PyEval_SaveThread();}
+-#define PySSL_BLOCK_THREADS if
(_ssl_locks_count>0){PyEval_RestoreThread(_save)};
+-#define PySSL_UNBLOCK_THREADS if (_ssl_locks_count>0){_save =
PyEval_SaveThread()};
+-#define PySSL_END_ALLOW_THREADS if (_ssl_locks_count>0){PyEval_RestoreThread(_save);}
\
+- }
++ PySSL_BEGIN_ALLOW_THREADS_S(_save);
++#define PySSL_BLOCK_THREADS PySSL_END_ALLOW_THREADS_S(_save);
++#define PySSL_UNBLOCK_THREADS PySSL_BEGIN_ALLOW_THREADS_S(_save);
++#define PySSL_END_ALLOW_THREADS PySSL_END_ALLOW_THREADS_S(_save); }
+
+ #else /* no WITH_THREAD */
+
++#define PySSL_BEGIN_ALLOW_THREADS_S(save)
++#define PySSL_END_ALLOW_THREADS_S(save)
+ #define PySSL_BEGIN_ALLOW_THREADS
+ #define PySSL_BLOCK_THREADS
+ #define PySSL_UNBLOCK_THREADS
+@@ -37,6 +43,68 @@
+
+ #endif
+
++/* Include symbols from _socket module */
++#include "socketmodule.h"
++
++#if defined(HAVE_POLL_H)
++#include <poll.h>
++#elif defined(HAVE_SYS_POLL_H)
++#include <sys/poll.h>
++#endif
++
++/* Include OpenSSL header files */
++#include "openssl/rsa.h"
++#include "openssl/crypto.h"
++#include "openssl/x509.h"
++#include "openssl/x509v3.h"
++#include "openssl/pem.h"
++#include "openssl/ssl.h"
++#include "openssl/err.h"
++#include "openssl/rand.h"
++
++/* SSL error object */
++static PyObject *PySSLErrorObject;
++static PyObject *PySSLZeroReturnErrorObject;
++static PyObject *PySSLWantReadErrorObject;
++static PyObject *PySSLWantWriteErrorObject;
++static PyObject *PySSLSyscallErrorObject;
++static PyObject *PySSLEOFErrorObject;
++
++/* Error mappings */
++static PyObject *err_codes_to_names;
++static PyObject *err_names_to_codes;
++static PyObject *lib_codes_to_names;
++
++struct py_ssl_error_code {
++ const char *mnemonic;
++ int library, reason;
++};
++struct py_ssl_library_code {
++ const char *library;
++ int code;
++};
++
++/* Include generated data (error codes) */
++#include "_ssl_data.h"
++
++/* Openssl comes with TLSv1.1 and TLSv1.2 between 1.0.0h and 1.0.1
++
http://www.openssl.org/news/changelog.html
++ */
++#if OPENSSL_VERSION_NUMBER >= 0x10001000L
++# define HAVE_TLSv1_2 1
++#else
++# define HAVE_TLSv1_2 0
++#endif
++
++/* SNI support (client- and server-side) appeared in OpenSSL 1.0.0 and 0.9.8f
++ * This includes the SSL_set_SSL_CTX() function.
++ */
++#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
++# define HAVE_SNI 1
++#else
++# define HAVE_SNI 0
++#endif
++
+ enum py_ssl_error {
+ /* these mirror ssl.h */
+ PY_SSL_ERROR_NONE,
+@@ -49,6 +117,7 @@ enum py_ssl_error {
+ PY_SSL_ERROR_WANT_CONNECT,
+ /* start of non ssl.h errorcodes */
+ PY_SSL_ERROR_EOF, /* special case of SSL_ERROR_SYSCALL */
++ PY_SSL_ERROR_NO_SOCKET, /* socket has been GC'd */
+ PY_SSL_ERROR_INVALID_ERROR_CODE
+ };
+
+@@ -64,35 +133,17 @@ enum py_ssl_cert_requirements {
+ };
+
+ enum py_ssl_version {
+-#ifndef OPENSSL_NO_SSL2
+ PY_SSL_VERSION_SSL2,
+-#endif
+ PY_SSL_VERSION_SSL3=1,
+ PY_SSL_VERSION_SSL23,
++#if HAVE_TLSv1_2
++ PY_SSL_VERSION_TLS1,
++ PY_SSL_VERSION_TLS1_1,
++ PY_SSL_VERSION_TLS1_2
++#else
+ PY_SSL_VERSION_TLS1
+-};
+-
+-/* Include symbols from _socket module */
+-#include "socketmodule.h"
+-
+-#if defined(HAVE_POLL_H)
+-#include <poll.h>
+-#elif defined(HAVE_SYS_POLL_H)
+-#include <sys/poll.h>
+ #endif
+-
+-/* Include OpenSSL header files */
+-#include "openssl/rsa.h"
+-#include "openssl/crypto.h"
+-#include "openssl/x509.h"
+-#include "openssl/x509v3.h"
+-#include "openssl/pem.h"
+-#include "openssl/ssl.h"
+-#include "openssl/err.h"
+-#include "openssl/rand.h"
+-
+-/* SSL error object */
+-static PyObject *PySSLErrorObject;
++};
+
+ #ifdef WITH_THREAD
+
+@@ -114,27 +165,79 @@ static unsigned int _ssl_locks_count = 0;
+ # undef HAVE_OPENSSL_RAND
+ #endif
+
++/* SSL_CTX_clear_options() and SSL_clear_options() were first added in
++ * OpenSSL 0.9.8m but do not appear in some 0.9.9-dev versions such the
++ * 0.9.9 from "May 2008" that NetBSD 5.0 uses. */
++#if OPENSSL_VERSION_NUMBER >= 0x009080dfL && OPENSSL_VERSION_NUMBER !=
0x00909000L
++# define HAVE_SSL_CTX_CLEAR_OPTIONS
++#else
++# undef HAVE_SSL_CTX_CLEAR_OPTIONS
++#endif
++
++/* In case of 'tls-unique' it will be 12 bytes for TLS, 36 bytes for
++ * older SSL, but let's be safe */
++#define PySSL_CB_MAXLEN 128
++
++/* SSL_get_finished got added to OpenSSL in 0.9.5 */
++#if OPENSSL_VERSION_NUMBER >= 0x0090500fL
++# define HAVE_OPENSSL_FINISHED 1
++#else
++# define HAVE_OPENSSL_FINISHED 0
++#endif
++
++/* ECDH support got added to OpenSSL in 0.9.8 */
++#if OPENSSL_VERSION_NUMBER < 0x0090800fL && !defined(OPENSSL_NO_ECDH)
++# define OPENSSL_NO_ECDH
++#endif
++
++/* compression support got added to OpenSSL in 0.9.8 */
++#if OPENSSL_VERSION_NUMBER < 0x0090800fL && !defined(OPENSSL_NO_COMP)
++# define OPENSSL_NO_COMP
++#endif
++
++/* X509_VERIFY_PARAM got added to OpenSSL in 0.9.8 */
++#if OPENSSL_VERSION_NUMBER >= 0x0090800fL
++# define HAVE_OPENSSL_VERIFY_PARAM
++#endif
++
++
++typedef struct {
++ PyObject_HEAD
++ SSL_CTX *ctx;
++#ifdef OPENSSL_NPN_NEGOTIATED
++ char *npn_protocols;
++ int npn_protocols_len;
++#endif
++#ifndef OPENSSL_NO_TLSEXT
++ PyObject *set_hostname;
++#endif
++ int check_hostname;
++} PySSLContext;
++
+ typedef struct {
+ PyObject_HEAD
+- PySocketSockObject *Socket; /* Socket on which we're layered */
+- SSL_CTX* ctx;
+- SSL* ssl;
+- X509* peer_cert;
+- char server[X509_NAME_MAXLEN];
+- char issuer[X509_NAME_MAXLEN];
+- int shutdown_seen_zero;
+-
+-} PySSLObject;
+-
+-static PyTypeObject PySSL_Type;
+-static PyObject *PySSL_SSLwrite(PySSLObject *self, PyObject *args);
+-static PyObject *PySSL_SSLread(PySSLObject *self, PyObject *args);
++ PySocketSockObject *Socket;
++ PyObject *ssl_sock;
++ SSL *ssl;
++ PySSLContext *ctx; /* weakref to SSL context */
++ X509 *peer_cert;
++ char shutdown_seen_zero;
++ char handshake_done;
++ enum py_ssl_server_or_client socket_type;
++} PySSLSocket;
++
++static PyTypeObject PySSLContext_Type;
++static PyTypeObject PySSLSocket_Type;
++
++static PyObject *PySSL_SSLwrite(PySSLSocket *self, PyObject *args);
++static PyObject *PySSL_SSLread(PySSLSocket *self, PyObject *args);
+ static int check_socket_and_wait_for_timeout(PySocketSockObject *s,
+ int writing);
+-static PyObject *PySSL_peercert(PySSLObject *self, PyObject *args);
+-static PyObject *PySSL_cipher(PySSLObject *self);
++static PyObject *PySSL_peercert(PySSLSocket *self, PyObject *args);
++static PyObject *PySSL_cipher(PySSLSocket *self);
+
+-#define PySSLObject_Check(v) (Py_TYPE(v) == &PySSL_Type)
++#define PySSLContext_Check(v) (Py_TYPE(v) == &PySSLContext_Type)
++#define PySSLSocket_Check(v) (Py_TYPE(v) == &PySSLSocket_Type)
+
+ typedef enum {
+ SOCKET_IS_NONBLOCKING,
+@@ -151,36 +254,140 @@ typedef enum {
+ #define ERRSTR1(x,y,z) (x ":" y ": " z)
+ #define ERRSTR(x) ERRSTR1("_ssl.c", STRINGIFY2(__LINE__), x)
+
+-/* XXX It might be helpful to augment the error message generated
+- below with the name of the SSL function that generated the error.
+- I expect it's obvious most of the time.
+-*/
++
++/*
++ * SSL errors.
++ */
++
++PyDoc_STRVAR(SSLError_doc,
++"An error occurred in the SSL implementation.");
++
++PyDoc_STRVAR(SSLZeroReturnError_doc,
++"SSL/TLS session closed cleanly.");
++
++PyDoc_STRVAR(SSLWantReadError_doc,
++"Non-blocking SSL socket needs to read more data\n"
++"before the requested operation can be completed.");
++
++PyDoc_STRVAR(SSLWantWriteError_doc,
++"Non-blocking SSL socket needs to write more data\n"
++"before the requested operation can be completed.");
++
++PyDoc_STRVAR(SSLSyscallError_doc,
++"System error when attempting SSL operation.");
++
++PyDoc_STRVAR(SSLEOFError_doc,
++"SSL/TLS connection terminated abruptly.");
++
+
+ static PyObject *
+-PySSL_SetError(PySSLObject *obj, int ret, char *filename, int lineno)
++SSLError_str(PyEnvironmentErrorObject *self)
+ {
+- PyObject *v;
+- char buf[2048];
+- char *errstr;
++ if (self->strerror != NULL) {
++ Py_INCREF(self->strerror);
++ return self->strerror;
++ }
++ else
++ return PyObject_Str(self->args);
++}
++
++static void
++fill_and_set_sslerror(PyObject *type, int ssl_errno, const char *errstr,
++ int lineno, unsigned long errcode)
++{
++ PyObject *err_value = NULL, *reason_obj = NULL, *lib_obj = NULL;
++ PyObject *init_value, *msg, *key;
++
++ if (errcode != 0) {
++ int lib, reason;
++
++ lib = ERR_GET_LIB(errcode);
++ reason = ERR_GET_REASON(errcode);
++ key = Py_BuildValue("ii", lib, reason);
++ if (key == NULL)
++ goto fail;
++ reason_obj = PyDict_GetItem(err_codes_to_names, key);
++ Py_DECREF(key);
++ if (reason_obj == NULL) {
++ /* XXX if reason < 100, it might reflect a library number (!!) */
++ PyErr_Clear();
++ }
++ key = PyLong_FromLong(lib);
++ if (key == NULL)
++ goto fail;
++ lib_obj = PyDict_GetItem(lib_codes_to_names, key);
++ Py_DECREF(key);
++ if (lib_obj == NULL) {
++ PyErr_Clear();
++ }
++ if (errstr == NULL)
++ errstr = ERR_reason_error_string(errcode);
++ }
++ if (errstr == NULL)
++ errstr = "unknown error";
++
++ if (reason_obj && lib_obj)
++ msg = PyUnicode_FromFormat("[%S: %S] %s (_ssl.c:%d)",
++ lib_obj, reason_obj, errstr, lineno);
++ else if (lib_obj)
++ msg = PyUnicode_FromFormat("[%S] %s (_ssl.c:%d)",
++ lib_obj, errstr, lineno);
++ else
++ msg = PyUnicode_FromFormat("%s (_ssl.c:%d)", errstr, lineno);
++ if (msg == NULL)
++ goto fail;
++
++ init_value = Py_BuildValue("iN", ssl_errno, msg);
++ if (init_value == NULL)
++ goto fail;
++
++ err_value = PyObject_CallObject(type, init_value);
++ Py_DECREF(init_value);
++ if (err_value == NULL)
++ goto fail;
++
++ if (reason_obj == NULL)
++ reason_obj = Py_None;
++ if (PyObject_SetAttrString(err_value, "reason", reason_obj))
++ goto fail;
++ if (lib_obj == NULL)
++ lib_obj = Py_None;
++ if (PyObject_SetAttrString(err_value, "library", lib_obj))
++ goto fail;
++ PyErr_SetObject(type, err_value);
++fail:
++ Py_XDECREF(err_value);
++}
++
++static PyObject *
++PySSL_SetError(PySSLSocket *obj, int ret, char *filename, int lineno)
++{
++ PyObject *type = PySSLErrorObject;
++ char *errstr = NULL;
+ int err;
+ enum py_ssl_error p = PY_SSL_ERROR_NONE;
++ unsigned long e = 0;
+
+ assert(ret <= 0);
++ e = ERR_peek_last_error();
+
+ if (obj->ssl != NULL) {
+ err = SSL_get_error(obj->ssl, ret);
+
+ switch (err) {
+ case SSL_ERROR_ZERO_RETURN:
+- errstr = "TLS/SSL connection has been closed";
++ errstr = "TLS/SSL connection has been closed (EOF)";
++ type = PySSLZeroReturnErrorObject;
+ p = PY_SSL_ERROR_ZERO_RETURN;
+ break;
+ case SSL_ERROR_WANT_READ:
+ errstr = "The operation did not complete (read)";
++ type = PySSLWantReadErrorObject;
+ p = PY_SSL_ERROR_WANT_READ;
+ break;
+ case SSL_ERROR_WANT_WRITE:
+ p = PY_SSL_ERROR_WANT_WRITE;
++ type = PySSLWantWriteErrorObject;
+ errstr = "The operation did not complete (write)";
+ break;
+ case SSL_ERROR_WANT_X509_LOOKUP:
+@@ -193,213 +400,109 @@ PySSL_SetError(PySSLObject *obj, int ret, char *filename, int
lineno)
+ break;
+ case SSL_ERROR_SYSCALL:
+ {
+- unsigned long e = ERR_get_error();
+ if (e == 0) {
+- if (ret == 0 || !obj->Socket) {
++ PySocketSockObject *s = obj->Socket;
++ if (ret == 0) {
+ p = PY_SSL_ERROR_EOF;
++ type = PySSLEOFErrorObject;
+ errstr = "EOF occurred in violation of protocol";
+ } else if (ret == -1) {
+ /* underlying BIO reported an I/O error */
++ Py_INCREF(s);
+ ERR_clear_error();
+- return obj->Socket->errorhandler();
++ s->errorhandler();
++ Py_DECREF(s);
++ return NULL;
+ } else { /* possible? */
+ p = PY_SSL_ERROR_SYSCALL;
++ type = PySSLSyscallErrorObject;
+ errstr = "Some I/O error occurred";
+ }
+ } else {
+ p = PY_SSL_ERROR_SYSCALL;
+- /* XXX Protected by global interpreter lock */
+- errstr = ERR_error_string(e, NULL);
+ }
+ break;
+ }
+ case SSL_ERROR_SSL:
+ {
+- unsigned long e = ERR_get_error();
+ p = PY_SSL_ERROR_SSL;
+- if (e != 0)
+- /* XXX Protected by global interpreter lock */
+- errstr = ERR_error_string(e, NULL);
+- else { /* possible? */
++ if (e == 0)
++ /* possible? */
+ errstr = "A failure in the SSL library occurred";
+- }
+ break;
+ }
+ default:
+ p = PY_SSL_ERROR_INVALID_ERROR_CODE;
+ errstr = "Invalid error code";
+ }
+- } else {
+- errstr = ERR_error_string(ERR_peek_last_error(), NULL);
+ }
+- PyOS_snprintf(buf, sizeof(buf), "_ssl.c:%d: %s", lineno, errstr);
++ fill_and_set_sslerror(type, p, errstr, lineno, e);
+ ERR_clear_error();
+- v = Py_BuildValue("(is)", p, buf);
+- if (v != NULL) {
+- PyErr_SetObject(PySSLErrorObject, v);
+- Py_DECREF(v);
+- }
+ return NULL;
+ }
+
+ static PyObject *
+ _setSSLError (char *errstr, int errcode, char *filename, int lineno) {
+
+- char buf[2048];
+- PyObject *v;
+-
+- if (errstr == NULL) {
++ if (errstr == NULL)
+ errcode = ERR_peek_last_error();
+- errstr = ERR_error_string(errcode, NULL);
+- }
+- PyOS_snprintf(buf, sizeof(buf), "_ssl.c:%d: %s", lineno, errstr);
++ else
++ errcode = 0;
++ fill_and_set_sslerror(PySSLErrorObject, errcode, errstr, lineno, errcode);
+ ERR_clear_error();
+- v = Py_BuildValue("(is)", errcode, buf);
+- if (v != NULL) {
+- PyErr_SetObject(PySSLErrorObject, v);
+- Py_DECREF(v);
+- }
+ return NULL;
+ }
+
+-static PySSLObject *
+-newPySSLObject(PySocketSockObject *Sock, char *key_file, char *cert_file,
++/*
++ * SSL objects
++ */
++
++static PySSLSocket *
++newPySSLSocket(PySSLContext *sslctx, PySocketSockObject *sock,
+ enum py_ssl_server_or_client socket_type,
+- enum py_ssl_cert_requirements certreq,
+- enum py_ssl_version proto_version,
+- char *cacerts_file, char *ciphers)
++ char *server_hostname, PyObject *ssl_sock)
+ {
+- PySSLObject *self;
+- char *errstr = NULL;
+- int ret;
+- int verification_mode;
+- long options;
++ PySSLSocket *self;
++ SSL_CTX *ctx = sslctx->ctx;
++ long mode;
+
+- self = PyObject_New(PySSLObject, &PySSL_Type); /* Create new object */
++ self = PyObject_New(PySSLSocket, &PySSLSocket_Type);
+ if (self == NULL)
+ return NULL;
+- memset(self->server, '\0', sizeof(char) * X509_NAME_MAXLEN);
+- memset(self->issuer, '\0', sizeof(char) * X509_NAME_MAXLEN);
++
+ self->peer_cert = NULL;
+ self->ssl = NULL;
+- self->ctx = NULL;
+ self->Socket = NULL;
++ self->ssl_sock = NULL;
++ self->ctx = sslctx;
+ self->shutdown_seen_zero = 0;
++ self->handshake_done = 0;
++ Py_INCREF(sslctx);
+
+ /* Make sure the SSL error state is initialized */
+ (void) ERR_get_state();
+ ERR_clear_error();
+
+- if ((key_file && !cert_file) || (!key_file && cert_file)) {
+- errstr = ERRSTR("Both the key & certificate files "
+- "must be specified");
+- goto fail;
+- }
+-
+- if ((socket_type == PY_SSL_SERVER) &&
+- ((key_file == NULL) || (cert_file == NULL))) {
+- errstr = ERRSTR("Both the key & certificate files "
+- "must be specified for server-side operation");
+- goto fail;
+- }
+-
+- PySSL_BEGIN_ALLOW_THREADS
+- if (proto_version == PY_SSL_VERSION_TLS1)
+- self->ctx = SSL_CTX_new(TLSv1_method()); /* Set up context */
+- else if (proto_version == PY_SSL_VERSION_SSL3)
+- self->ctx = SSL_CTX_new(SSLv3_method()); /* Set up context */
+-#ifndef OPENSSL_NO_SSL2
+- else if (proto_version == PY_SSL_VERSION_SSL2)
+- self->ctx = SSL_CTX_new(SSLv2_method()); /* Set up context */
+-#endif
+- else if (proto_version == PY_SSL_VERSION_SSL23)
+- self->ctx = SSL_CTX_new(SSLv23_method()); /* Set up context */
+- PySSL_END_ALLOW_THREADS
+-
+- if (self->ctx == NULL) {
+- errstr = ERRSTR("Invalid SSL protocol variant specified.");
+- goto fail;
+- }
+-
+- if (ciphers != NULL) {
+- ret = SSL_CTX_set_cipher_list(self->ctx, ciphers);
+- if (ret == 0) {
+- errstr = ERRSTR("No cipher can be selected.");
+- goto fail;
+- }
+- }
+-
+- if (certreq != PY_SSL_CERT_NONE) {
+- if (cacerts_file == NULL) {
+- errstr = ERRSTR("No root certificates specified for "
+- "verification of other-side certificates.");
+- goto fail;
+- } else {
+- PySSL_BEGIN_ALLOW_THREADS
+- ret = SSL_CTX_load_verify_locations(self->ctx,
+- cacerts_file,
+- NULL);
+- PySSL_END_ALLOW_THREADS
+- if (ret != 1) {
+- _setSSLError(NULL, 0, __FILE__, __LINE__);
+- goto fail;
+- }
+- }
+- }
+- if (key_file) {
+- PySSL_BEGIN_ALLOW_THREADS
+- ret = SSL_CTX_use_PrivateKey_file(self->ctx, key_file,
+- SSL_FILETYPE_PEM);
+- PySSL_END_ALLOW_THREADS
+- if (ret != 1) {
+- _setSSLError(NULL, ret, __FILE__, __LINE__);
+- goto fail;
+- }
+-
+- PySSL_BEGIN_ALLOW_THREADS
+- ret = SSL_CTX_use_certificate_chain_file(self->ctx,
+- cert_file);
+- PySSL_END_ALLOW_THREADS
+- if (ret != 1) {
+- /*
+- fprintf(stderr, "ret is %d, errcode is %lu, %lu, with file
\"%s\"\n",
+- ret, ERR_peek_error(), ERR_peek_last_error(), cert_file);
+- */
+- if (ERR_peek_last_error() != 0) {
+- _setSSLError(NULL, ret, __FILE__, __LINE__);
+- goto fail;
+- }
+- }
+- }
+-
+- /* ssl compatibility */
+- options = SSL_OP_ALL & ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS;
+- if (proto_version != PY_SSL_VERSION_SSL2)
+- options |= SSL_OP_NO_SSLv2;
+- SSL_CTX_set_options(self->ctx, options);
+-
+- verification_mode = SSL_VERIFY_NONE;
+- if (certreq == PY_SSL_CERT_OPTIONAL)
+- verification_mode = SSL_VERIFY_PEER;
+- else if (certreq == PY_SSL_CERT_REQUIRED)
+- verification_mode = (SSL_VERIFY_PEER |
+- SSL_VERIFY_FAIL_IF_NO_PEER_CERT);
+- SSL_CTX_set_verify(self->ctx, verification_mode,
+- NULL); /* set verify lvl */
+-
+ PySSL_BEGIN_ALLOW_THREADS
+- self->ssl = SSL_new(self->ctx); /* New ssl struct */
++ self->ssl = SSL_new(ctx);
+ PySSL_END_ALLOW_THREADS
+- SSL_set_fd(self->ssl, Sock->sock_fd); /* Set the socket for SSL */
++ SSL_set_app_data(self->ssl,self);
++ SSL_set_fd(self->ssl, Py_SAFE_DOWNCAST(sock->sock_fd, SOCKET_T, int));
++ mode = SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER;
+ #ifdef SSL_MODE_AUTO_RETRY
+- SSL_set_mode(self->ssl, SSL_MODE_AUTO_RETRY);
++ mode |= SSL_MODE_AUTO_RETRY;
++#endif
++ SSL_set_mode(self->ssl, mode);
++
++#if HAVE_SNI
++ if (server_hostname != NULL)
++ SSL_set_tlsext_host_name(self->ssl, server_hostname);
+ #endif
+
+ /* If the socket is in non-blocking mode or timeout mode, set the BIO
+ * to non-blocking mode (blocking is the default)
+ */
+- if (Sock->sock_timeout >= 0.0) {
+- /* Set both the read and write BIO's to non-blocking mode */
++ if (sock->sock_timeout >= 0.0) {
+ BIO_set_nbio(SSL_get_rbio(self->ssl), 1);
+ BIO_set_nbio(SSL_get_wbio(self->ssl), 1);
+ }
+@@ -411,65 +514,31 @@ newPySSLObject(PySocketSockObject *Sock, char *key_file, char
*cert_file,
+ SSL_set_accept_state(self->ssl);
+ PySSL_END_ALLOW_THREADS
+
+- self->Socket = Sock;
++ self->socket_type = socket_type;
++ self->Socket = sock;
+ Py_INCREF(self->Socket);
+- return self;
+- fail:
+- if (errstr)
+- PyErr_SetString(PySSLErrorObject, errstr);
+- Py_DECREF(self);
+- return NULL;
+-}
+-
+-static PyObject *
+-PySSL_sslwrap(PyObject *self, PyObject *args)
+-{
+- PySocketSockObject *Sock;
+- int server_side = 0;
+- int verification_mode = PY_SSL_CERT_NONE;
+- int protocol = PY_SSL_VERSION_SSL23;
+- char *key_file = NULL;
+- char *cert_file = NULL;
+- char *cacerts_file = NULL;
+- char *ciphers = NULL;
+-
+- if (!PyArg_ParseTuple(args, "O!i|zziizz:sslwrap",
+- PySocketModule.Sock_Type,
+- &Sock,
+- &server_side,
+- &key_file, &cert_file,
+- &verification_mode, &protocol,
+- &cacerts_file, &ciphers))
++ self->ssl_sock = PyWeakref_NewRef(ssl_sock, NULL);
++ if (self->ssl_sock == NULL) {
++ Py_DECREF(self);
+ return NULL;
+-
+- /*
+- fprintf(stderr,
+- "server_side is %d, keyfile %p, certfile %p, verify_mode %d, "
+- "protocol %d, certs %p\n",
+- server_side, key_file, cert_file, verification_mode,
+- protocol, cacerts_file);
+- */
+-
+- return (PyObject *) newPySSLObject(Sock, key_file, cert_file,
+- server_side, verification_mode,
+- protocol, cacerts_file,
+- ciphers);
++ }
++ return self;
+ }
+
+-PyDoc_STRVAR(ssl_doc,
+-"sslwrap(socket, server_side, [keyfile, certfile, certs_mode, protocol,\n"
+-" cacertsfile, ciphers]) -> sslobject");
+
+ /* SSL object methods */
+
+-static PyObject *PySSL_SSLdo_handshake(PySSLObject *self)
++static PyObject *PySSL_SSLdo_handshake(PySSLSocket *self)
+ {
+ int ret;
+ int err;
+ int sockstate, nonblocking;
++ PySocketSockObject *sock = self->Socket;
++
++ Py_INCREF(sock);
+
+ /* just in case the blocking state of the socket has been changed */
+- nonblocking = (self->Socket->sock_timeout >= 0.0);
++ nonblocking = (sock->sock_timeout >= 0.0);
+ BIO_set_nbio(SSL_get_rbio(self->ssl), nonblocking);
+ BIO_set_nbio(SSL_get_wbio(self->ssl), nonblocking);
+
+@@ -480,60 +549,48 @@ static PyObject *PySSL_SSLdo_handshake(PySSLObject *self)
+ ret = SSL_do_handshake(self->ssl);
+ err = SSL_get_error(self->ssl, ret);
+ PySSL_END_ALLOW_THREADS
+- if(PyErr_CheckSignals()) {
+- return NULL;
+- }
++ if (PyErr_CheckSignals())
++ goto error;
+ if (err == SSL_ERROR_WANT_READ) {
+- sockstate = check_socket_and_wait_for_timeout(self->Socket, 0);
++ sockstate = check_socket_and_wait_for_timeout(sock, 0);
+ } else if (err == SSL_ERROR_WANT_WRITE) {
+- sockstate = check_socket_and_wait_for_timeout(self->Socket, 1);
++ sockstate = check_socket_and_wait_for_timeout(sock, 1);
+ } else {
+ sockstate = SOCKET_OPERATION_OK;
+ }
+ if (sockstate == SOCKET_HAS_TIMED_OUT) {
+ PyErr_SetString(PySSLErrorObject,
+ ERRSTR("The handshake operation timed out"));
+- return NULL;
++ goto error;
+ } else if (sockstate == SOCKET_HAS_BEEN_CLOSED) {
+ PyErr_SetString(PySSLErrorObject,
+ ERRSTR("Underlying socket has been closed."));
+- return NULL;
++ goto error;
+ } else if (sockstate == SOCKET_TOO_LARGE_FOR_SELECT) {
+ PyErr_SetString(PySSLErrorObject,
+ ERRSTR("Underlying socket too large for
select()."));
+- return NULL;
++ goto error;
+ } else if (sockstate == SOCKET_IS_NONBLOCKING) {
+ break;
+ }
+ } while (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE);
++ Py_DECREF(sock);
+ if (ret < 1)
+ return PySSL_SetError(self, ret, __FILE__, __LINE__);
+
+ if (self->peer_cert)
+ X509_free (self->peer_cert);
+ PySSL_BEGIN_ALLOW_THREADS
+- if ((self->peer_cert = SSL_get_peer_certificate(self->ssl))) {
+- X509_NAME_oneline(X509_get_subject_name(self->peer_cert),
+- self->server, X509_NAME_MAXLEN);
+- X509_NAME_oneline(X509_get_issuer_name(self->peer_cert),
+- self->issuer, X509_NAME_MAXLEN);
+- }
++ self->peer_cert = SSL_get_peer_certificate(self->ssl);
+ PySSL_END_ALLOW_THREADS
++ self->handshake_done = 1;
+
+ Py_INCREF(Py_None);
+ return Py_None;
+-}
+-
+-static PyObject *
+-PySSL_server(PySSLObject *self)
+-{
+- return PyString_FromString(self->server);
+-}
+
+-static PyObject *
+-PySSL_issuer(PySSLObject *self)
+-{
+- return PyString_FromString(self->issuer);
++error:
++ Py_DECREF(sock);
++ return NULL;
+ }
+
+ static PyObject *
+@@ -639,8 +696,8 @@ _create_tuple_for_X509_NAME (X509_NAME *xname)
+ /*
+ fprintf(stderr, "RDN level %d, attribute %s: %s\n",
+ entry->set,
+- PyString_AS_STRING(PyTuple_GET_ITEM(attr, 0)),
+- PyString_AS_STRING(PyTuple_GET_ITEM(attr, 1)));
++ PyBytes_AS_STRING(PyTuple_GET_ITEM(attr, 0)),
++ PyBytes_AS_STRING(PyTuple_GET_ITEM(attr, 1)));
+ */
+ if (attr == NULL)
+ goto fail1;
+@@ -727,21 +784,24 @@ _get_peer_alt_names (X509 *certificate) {
+ /* now decode the altName */
+ ext = X509_get_ext(certificate, i);
+ if(!(method = X509V3_EXT_get(ext))) {
+- PyErr_SetString(PySSLErrorObject,
+- ERRSTR("No method for internalizing
subjectAltName!"));
++ PyErr_SetString
++ (PySSLErrorObject,
++ ERRSTR("No method for internalizing subjectAltName!"));
+ goto fail;
+ }
+
+ p = ext->value->data;
+ if (method->it)
+- names = (GENERAL_NAMES*) (ASN1_item_d2i(NULL,
+- &p,
+- ext->value->length,
+- ASN1_ITEM_ptr(method->it)));
++ names = (GENERAL_NAMES*)
++ (ASN1_item_d2i(NULL,
++ &p,
++ ext->value->length,
++ ASN1_ITEM_ptr(method->it)));
+ else
+- names = (GENERAL_NAMES*) (method->d2i(NULL,
+- &p,
+- ext->value->length));
++ names = (GENERAL_NAMES*)
++ (method->d2i(NULL,
++ &p,
++ ext->value->length));
+
+ for(j = 0; j < sk_GENERAL_NAME_num(names); j++) {
+ /* get a rendering of each name in the set of names */
+@@ -888,94 +948,212 @@ _get_peer_alt_names (X509 *certificate) {
+ }
+
+ static PyObject *
+-_decode_certificate (X509 *certificate, int verbose) {
+-
+- PyObject *retval = NULL;
+- BIO *biobuf = NULL;
+- PyObject *peer;
+- PyObject *peer_alt_names = NULL;
+- PyObject *issuer;
+- PyObject *version;
+- PyObject *sn_obj;
+- ASN1_INTEGER *serialNumber;
+- char buf[2048];
+- int len;
+- ASN1_TIME *notBefore, *notAfter;
+- PyObject *pnotBefore, *pnotAfter;
+-
+- retval = PyDict_New();
+- if (retval == NULL)
+- return NULL;
++_get_aia_uri(X509 *certificate, int nid) {
++ PyObject *lst = NULL, *ostr = NULL;
++ int i, result;
++ AUTHORITY_INFO_ACCESS *info;
++
++ info = X509_get_ext_d2i(certificate, NID_info_access, NULL, NULL);
++ if ((info == NULL) || (sk_ACCESS_DESCRIPTION_num(info) == 0)) {
++ return Py_None;
++ }
+
+- peer = _create_tuple_for_X509_NAME(
+- X509_get_subject_name(certificate));
+- if (peer == NULL)
+- goto fail0;
+- if (PyDict_SetItemString(retval, (const char *) "subject", peer) < 0)
{
+- Py_DECREF(peer);
+- goto fail0;
++ if ((lst = PyList_New(0)) == NULL) {
++ goto fail;
+ }
+- Py_DECREF(peer);
+
+- if (verbose) {
+- issuer = _create_tuple_for_X509_NAME(
+- X509_get_issuer_name(certificate));
+- if (issuer == NULL)
+- goto fail0;
+- if (PyDict_SetItemString(retval, (const char *)"issuer", issuer) <
0) {
+- Py_DECREF(issuer);
+- goto fail0;
+- }
+- Py_DECREF(issuer);
++ for (i = 0; i < sk_ACCESS_DESCRIPTION_num(info); i++) {
++ ACCESS_DESCRIPTION *ad = sk_ACCESS_DESCRIPTION_value(info, i);
++ ASN1_IA5STRING *uri;
+
+- version = PyInt_FromLong(X509_get_version(certificate) + 1);
+- if (PyDict_SetItemString(retval, "version", version) < 0) {
+- Py_DECREF(version);
+- goto fail0;
++ if ((OBJ_obj2nid(ad->method) != nid) ||
++ (ad->location->type != GEN_URI)) {
++ continue;
++ }
++ uri = ad->location->d.uniformResourceIdentifier;
++ ostr = PyUnicode_FromStringAndSize((char *)uri->data,
++ uri->length);
++ if (ostr == NULL) {
++ goto fail;
++ }
++ result = PyList_Append(lst, ostr);
++ Py_DECREF(ostr);
++ if (result < 0) {
++ goto fail;
+ }
+- Py_DECREF(version);
+ }
++ AUTHORITY_INFO_ACCESS_free(info);
+
+- /* get a memory buffer */
+- biobuf = BIO_new(BIO_s_mem());
+-
+- if (verbose) {
++ /* convert to tuple or None */
++ if (PyList_Size(lst) == 0) {
++ Py_DECREF(lst);
++ return Py_None;
++ } else {
++ PyObject *tup;
++ tup = PyList_AsTuple(lst);
++ Py_DECREF(lst);
++ return tup;
++ }
+
+- (void) BIO_reset(biobuf);
+- serialNumber = X509_get_serialNumber(certificate);
+- /* should not exceed 20 octets, 160 bits, so buf is big enough */
+- i2a_ASN1_INTEGER(biobuf, serialNumber);
+- len = BIO_gets(biobuf, buf, sizeof(buf)-1);
+- if (len < 0) {
+- _setSSLError(NULL, 0, __FILE__, __LINE__);
+- goto fail1;
+- }
+- sn_obj = PyString_FromStringAndSize(buf, len);
+- if (sn_obj == NULL)
+- goto fail1;
+- if (PyDict_SetItemString(retval, "serialNumber", sn_obj) < 0) {
+- Py_DECREF(sn_obj);
+- goto fail1;
++ fail:
++ AUTHORITY_INFO_ACCESS_free(info);
++ Py_XDECREF(lst);
++ return NULL;
++}
++
++static PyObject *
++_get_crl_dp(X509 *certificate) {
++ STACK_OF(DIST_POINT) *dps;
++ int i, j, result;
++ PyObject *lst;
++
++#if OPENSSL_VERSION_NUMBER < 0x10001000L
++ dps = X509_get_ext_d2i(certificate, NID_crl_distribution_points,
++ NULL, NULL);
++#else
++ /* Calls x509v3_cache_extensions and sets up crldp */
++ X509_check_ca(certificate);
++ dps = certificate->crldp;
++#endif
++
++ if (dps == NULL) {
++ return Py_None;
++ }
++
++ if ((lst = PyList_New(0)) == NULL) {
++ return NULL;
++ }
++
++ for (i=0; i < sk_DIST_POINT_num(dps); i++) {
++ DIST_POINT *dp;
++ STACK_OF(GENERAL_NAME) *gns;
++
++ dp = sk_DIST_POINT_value(dps, i);
++ gns = dp->distpoint->name.fullname;
++
++ for (j=0; j < sk_GENERAL_NAME_num(gns); j++) {
++ GENERAL_NAME *gn;
++ ASN1_IA5STRING *uri;
++ PyObject *ouri;
++
++ gn = sk_GENERAL_NAME_value(gns, j);
++ if (gn->type != GEN_URI) {
++ continue;
++ }
++ uri = gn->d.uniformResourceIdentifier;
++ ouri = PyUnicode_FromStringAndSize((char *)uri->data,
++ uri->length);
++ if (ouri == NULL) {
++ Py_DECREF(lst);
++ return NULL;
++ }
++ result = PyList_Append(lst, ouri);
++ Py_DECREF(ouri);
++ if (result < 0) {
++ Py_DECREF(lst);
++ return NULL;
++ }
+ }
++ }
++ /* convert to tuple or None */
++ if (PyList_Size(lst) == 0) {
++ Py_DECREF(lst);
++ return Py_None;
++ } else {
++ PyObject *tup;
++ tup = PyList_AsTuple(lst);
++ Py_DECREF(lst);
++ return tup;
++ }
++}
++
++static PyObject *
++_decode_certificate(X509 *certificate) {
++
++ PyObject *retval = NULL;
++ BIO *biobuf = NULL;
++ PyObject *peer;
++ PyObject *peer_alt_names = NULL;
++ PyObject *issuer;
++ PyObject *version;
++ PyObject *sn_obj;
++ PyObject *obj;
++ ASN1_INTEGER *serialNumber;
++ char buf[2048];
++ int len, result;
++ ASN1_TIME *notBefore, *notAfter;
++ PyObject *pnotBefore, *pnotAfter;
++
++ retval = PyDict_New();
++ if (retval == NULL)
++ return NULL;
++
++ peer = _create_tuple_for_X509_NAME(
++ X509_get_subject_name(certificate));
++ if (peer == NULL)
++ goto fail0;
++ if (PyDict_SetItemString(retval, (const char *) "subject", peer) < 0)
{
++ Py_DECREF(peer);
++ goto fail0;
++ }
++ Py_DECREF(peer);
++
++ issuer = _create_tuple_for_X509_NAME(
++ X509_get_issuer_name(certificate));
++ if (issuer == NULL)
++ goto fail0;
++ if (PyDict_SetItemString(retval, (const char *)"issuer", issuer) < 0)
{
++ Py_DECREF(issuer);
++ goto fail0;
++ }
++ Py_DECREF(issuer);
++
++ version = PyLong_FromLong(X509_get_version(certificate) + 1);
++ if (version == NULL)
++ goto fail0;
++ if (PyDict_SetItemString(retval, "version", version) < 0) {
++ Py_DECREF(version);
++ goto fail0;
++ }
++ Py_DECREF(version);
++
++ /* get a memory buffer */
++ biobuf = BIO_new(BIO_s_mem());
++
++ (void) BIO_reset(biobuf);
++ serialNumber = X509_get_serialNumber(certificate);
++ /* should not exceed 20 octets, 160 bits, so buf is big enough */
++ i2a_ASN1_INTEGER(biobuf, serialNumber);
++ len = BIO_gets(biobuf, buf, sizeof(buf)-1);
++ if (len < 0) {
++ _setSSLError(NULL, 0, __FILE__, __LINE__);
++ goto fail1;
++ }
++ sn_obj = PyUnicode_FromStringAndSize(buf, len);
++ if (sn_obj == NULL)
++ goto fail1;
++ if (PyDict_SetItemString(retval, "serialNumber", sn_obj) < 0) {
+ Py_DECREF(sn_obj);
++ goto fail1;
++ }
++ Py_DECREF(sn_obj);
+
+- (void) BIO_reset(biobuf);
+- notBefore = X509_get_notBefore(certificate);
+- ASN1_TIME_print(biobuf, notBefore);
+- len = BIO_gets(biobuf, buf, sizeof(buf)-1);
+- if (len < 0) {
+- _setSSLError(NULL, 0, __FILE__, __LINE__);
+- goto fail1;
+- }
+- pnotBefore = PyString_FromStringAndSize(buf, len);
+- if (pnotBefore == NULL)
+- goto fail1;
+- if (PyDict_SetItemString(retval, "notBefore", pnotBefore) < 0) {
+- Py_DECREF(pnotBefore);
+- goto fail1;
+- }
++ (void) BIO_reset(biobuf);
++ notBefore = X509_get_notBefore(certificate);
++ ASN1_TIME_print(biobuf, notBefore);
++ len = BIO_gets(biobuf, buf, sizeof(buf)-1);
++ if (len < 0) {
++ _setSSLError(NULL, 0, __FILE__, __LINE__);
++ goto fail1;
++ }
++ pnotBefore = PyUnicode_FromStringAndSize(buf, len);
++ if (pnotBefore == NULL)
++ goto fail1;
++ if (PyDict_SetItemString(retval, "notBefore", pnotBefore) < 0) {
+ Py_DECREF(pnotBefore);
++ goto fail1;
+ }
++ Py_DECREF(pnotBefore);
+
+ (void) BIO_reset(biobuf);
+ notAfter = X509_get_notAfter(certificate);
+@@ -1008,6 +1186,41 @@ _decode_certificate (X509 *certificate, int verbose) {
+ Py_DECREF(peer_alt_names);
+ }
+
++ /* Authority Information Access: OCSP URIs */
++ obj = _get_aia_uri(certificate, NID_ad_OCSP);
++ if (obj == NULL) {
++ goto fail1;
++ } else if (obj != Py_None) {
++ result = PyDict_SetItemString(retval, "OCSP", obj);
++ Py_DECREF(obj);
++ if (result < 0) {
++ goto fail1;
++ }
++ }
++
++ obj = _get_aia_uri(certificate, NID_ad_ca_issuers);
++ if (obj == NULL) {
++ goto fail1;
++ } else if (obj != Py_None) {
++ result = PyDict_SetItemString(retval, "caIssuers", obj);
++ Py_DECREF(obj);
++ if (result < 0) {
++ goto fail1;
++ }
++ }
++
++ /* CDP (CRL distribution points) */
++ obj = _get_crl_dp(certificate);
++ if (obj == NULL) {
++ goto fail1;
++ } else if (obj != Py_None) {
++ result = PyDict_SetItemString(retval, "crlDistributionPoints", obj);
++ Py_DECREF(obj);
++ if (result < 0) {
++ goto fail1;
++ }
++ }
++
+ BIO_free(biobuf);
+ return retval;
+
+@@ -1019,6 +1232,24 @@ _decode_certificate (X509 *certificate, int verbose) {
+ return NULL;
+ }
+
++static PyObject *
++_certificate_to_der(X509 *certificate)
++{
++ unsigned char *bytes_buf = NULL;
++ int len;
++ PyObject *retval;
++
++ bytes_buf = NULL;
++ len = i2d_X509(certificate, &bytes_buf);
++ if (len < 0) {
++ _setSSLError(NULL, 0, __FILE__, __LINE__);
++ return NULL;
++ }
++ /* this is actually an immutable bytes sequence */
++ retval = PyBytes_FromStringAndSize((const char *) bytes_buf, len);
++ OPENSSL_free(bytes_buf);
++ return retval;
++}
+
+ static PyObject *
+ PySSL_test_decode_certificate (PyObject *mod, PyObject *args) {
+@@ -1027,28 +1258,30 @@ PySSL_test_decode_certificate (PyObject *mod, PyObject *args) {
+ char *filename = NULL;
+ X509 *x=NULL;
+ BIO *cert;
+- int verbose = 1;
+
+- if (!PyArg_ParseTuple(args, "s|i:test_decode_certificate", &filename,
&verbose))
++ if (!PyArg_ParseTuple(args, "s:test_decode_certificate", &filename))
+ return NULL;
+
+ if ((cert=BIO_new(BIO_s_file())) == NULL) {
+- PyErr_SetString(PySSLErrorObject, "Can't malloc memory to read
file");
++ PyErr_SetString(PySSLErrorObject,
++ "Can't malloc memory to read file");
+ goto fail0;
+ }
+
+ if (BIO_read_filename(cert,filename) <= 0) {
+- PyErr_SetString(PySSLErrorObject, "Can't open file");
++ PyErr_SetString(PySSLErrorObject,
++ "Can't open file");
+ goto fail0;
+ }
+
+ x = PEM_read_bio_X509_AUX(cert,NULL, NULL, NULL);
+ if (x == NULL) {
+- PyErr_SetString(PySSLErrorObject, "Error decoding PEM-encoded file");
++ PyErr_SetString(PySSLErrorObject,
++ "Error decoding PEM-encoded file");
+ goto fail0;
+ }
+
+- retval = _decode_certificate(x, verbose);
++ retval = _decode_certificate(x);
+ X509_free(x);
+
+ fail0:
+@@ -1059,10 +1292,8 @@ PySSL_test_decode_certificate (PyObject *mod, PyObject *args) {
+
+
+ static PyObject *
+-PySSL_peercert(PySSLObject *self, PyObject *args)
++PySSL_peercert(PySSLSocket *self, PyObject *args)
+ {
+- PyObject *retval = NULL;
+- int len;
+ int verification;
+ PyObject *binary_mode = Py_None;
+ int b;
+@@ -1070,6 +1301,11 @@ PySSL_peercert(PySSLObject *self, PyObject *args)
+ if (!PyArg_ParseTuple(args, "|O:peer_certificate", &binary_mode))
+ return NULL;
+
++ if (!self->handshake_done) {
++ PyErr_SetString(PyExc_ValueError,
++ "handshake not done yet");
++ return NULL;
++ }
+ if (!self->peer_cert)
+ Py_RETURN_NONE;
+
+@@ -1078,26 +1314,13 @@ PySSL_peercert(PySSLObject *self, PyObject *args)
+ return NULL;
+ if (b) {
+ /* return cert in DER-encoded format */
+-
+- unsigned char *bytes_buf = NULL;
+-
+- bytes_buf = NULL;
+- len = i2d_X509(self->peer_cert, &bytes_buf);
+- if (len < 0) {
+- PySSL_SetError(self, len, __FILE__, __LINE__);
+- return NULL;
+- }
+- retval = PyString_FromStringAndSize((const char *) bytes_buf, len);
+- OPENSSL_free(bytes_buf);
+- return retval;
+-
++ return _certificate_to_der(self->peer_cert);
+ } else {
+-
+- verification = SSL_CTX_get_verify_mode(self->ctx);
++ verification = SSL_CTX_get_verify_mode(SSL_get_SSL_CTX(self->ssl));
+ if ((verification & SSL_VERIFY_PEER) == 0)
+ return PyDict_New();
+ else
+- return _decode_certificate (self->peer_cert, 0);
++ return _decode_certificate(self->peer_cert);
+ }
+ }
+
+@@ -1113,7 +1336,7 @@ If the optional argument is True, returns a DER-encoded copy of
the\n\
+ peer certificate, or None if no certificate was provided. This will\n\
+ return the certificate even if it wasn't validated.");
+
+-static PyObject *PySSL_cipher (PySSLObject *self) {
++static PyObject *PySSL_cipher (PySSLSocket *self) {
+
+ PyObject *retval, *v;
+ const SSL_CIPHER *current;
+@@ -1140,7 +1363,7 @@ static PyObject *PySSL_cipher (PySSLObject *self) {
+ goto fail0;
+ PyTuple_SET_ITEM(retval, 0, v);
+ }
+- cipher_protocol = SSL_CIPHER_get_version(current);
++ cipher_protocol = (char *) SSL_CIPHER_get_version(current);
+ if (cipher_protocol == NULL) {
+ Py_INCREF(Py_None);
+ PyTuple_SET_ITEM(retval, 1, Py_None);
+@@ -1161,15 +1384,85 @@ static PyObject *PySSL_cipher (PySSLObject *self) {
+ return NULL;
+ }
+
+-static void PySSL_dealloc(PySSLObject *self)
++#ifdef OPENSSL_NPN_NEGOTIATED
++static PyObject *PySSL_selected_npn_protocol(PySSLSocket *self) {
++ const unsigned char *out;
++ unsigned int outlen;
++
++ SSL_get0_next_proto_negotiated(self->ssl,
++ &out, &outlen);
++
++ if (out == NULL)
++ Py_RETURN_NONE;
++ return PyUnicode_FromStringAndSize((char *) out, outlen);
++}
++#endif
++
++static PyObject *PySSL_compression(PySSLSocket *self) {
++#ifdef OPENSSL_NO_COMP
++ Py_RETURN_NONE;
++#else
++ const COMP_METHOD *comp_method;
++ const char *short_name;
++
++ if (self->ssl == NULL)
++ Py_RETURN_NONE;
++ comp_method = SSL_get_current_compression(self->ssl);
++ if (comp_method == NULL || comp_method->type == NID_undef)
++ Py_RETURN_NONE;
++ short_name = OBJ_nid2sn(comp_method->type);
++ if (short_name == NULL)
++ Py_RETURN_NONE;
++ return PyBytes_FromString(short_name);
++#endif
++}
++
++static PySSLContext *PySSL_get_context(PySSLSocket *self, void *closure) {
++ Py_INCREF(self->ctx);
++ return self->ctx;
++}
++
++static int PySSL_set_context(PySSLSocket *self, PyObject *value,
++ void *closure) {
++
++ if (PyObject_TypeCheck(value, &PySSLContext_Type)) {
++#if !HAVE_SNI
++ PyErr_SetString(PyExc_NotImplementedError, "setting a socket's "
++ "context is not supported by your OpenSSL library");
++ return -1;
++#else
++ Py_INCREF(value);
++ Py_DECREF(self->ctx);
++ self->ctx = (PySSLContext *) value;
++ SSL_set_SSL_CTX(self->ssl, self->ctx->ctx);
++#endif
++ } else {
++ PyErr_SetString(PyExc_TypeError, "The value must be a SSLContext");
++ return -1;
++ }
++
++ return 0;
++}
++
++PyDoc_STRVAR(PySSL_set_context_doc,
++"_setter_context(ctx)\n\
++\
++This changes the context associated with the SSLSocket. This is typically\n\
++used from within a callback function set by the set_servername_callback\n\
++on the SSLContext to change the certificate information associated with the\n\
++SSLSocket before the cryptographic exchange handshake messages\n");
++
++
++
++static void PySSL_dealloc(PySSLSocket *self)
+ {
+ if (self->peer_cert) /* Possible not to have one? */
+ X509_free (self->peer_cert);
+ if (self->ssl)
+ SSL_free(self->ssl);
+- if (self->ctx)
+- SSL_CTX_free(self->ctx);
+ Py_XDECREF(self->Socket);
++ Py_XDECREF(self->ssl_sock);
++ Py_XDECREF(self->ctx);
+ PyObject_Del(self);
+ }
+
+@@ -1241,16 +1534,21 @@ normal_return:
+ return rc == 0 ? SOCKET_HAS_TIMED_OUT : SOCKET_OPERATION_OK;
+ }
+
+-static PyObject *PySSL_SSLwrite(PySSLObject *self, PyObject *args)
++static PyObject *PySSL_SSLwrite(PySSLSocket *self, PyObject *args)
+ {
+ Py_buffer buf;
+ int len;
+ int sockstate;
+ int err;
+ int nonblocking;
++ PySocketSockObject *sock = self->Socket;
++
++ Py_INCREF(sock);
+
+- if (!PyArg_ParseTuple(args, "s*:write", &buf))
++ if (!PyArg_ParseTuple(args, "s*:write", &buf)) {
++ Py_DECREF(sock);
+ return NULL;
++ }
+
+ if (buf.len > INT_MAX) {
+ PyErr_Format(PyExc_OverflowError,
+@@ -1259,11 +1557,11 @@ static PyObject *PySSL_SSLwrite(PySSLObject *self, PyObject
*args)
+ }
+
+ /* just in case the blocking state of the socket has been changed */
+- nonblocking = (self->Socket->sock_timeout >= 0.0);
++ nonblocking = (sock->sock_timeout >= 0.0);
+ BIO_set_nbio(SSL_get_rbio(self->ssl), nonblocking);
+ BIO_set_nbio(SSL_get_wbio(self->ssl), nonblocking);
+
+- sockstate = check_socket_and_wait_for_timeout(self->Socket, 1);
++ sockstate = check_socket_and_wait_for_timeout(sock, 1);
+ if (sockstate == SOCKET_HAS_TIMED_OUT) {
+ PyErr_SetString(PySSLErrorObject,
+ "The write operation timed out");
+@@ -1286,9 +1584,9 @@ static PyObject *PySSL_SSLwrite(PySSLObject *self, PyObject *args)
+ goto error;
+ }
+ if (err == SSL_ERROR_WANT_READ) {
+- sockstate = check_socket_and_wait_for_timeout(self->Socket, 0);
++ sockstate = check_socket_and_wait_for_timeout(sock, 0);
+ } else if (err == SSL_ERROR_WANT_WRITE) {
+- sockstate = check_socket_and_wait_for_timeout(self->Socket, 1);
++ sockstate = check_socket_and_wait_for_timeout(sock, 1);
+ } else {
+ sockstate = SOCKET_OPERATION_OK;
+ }
+@@ -1305,6 +1603,7 @@ static PyObject *PySSL_SSLwrite(PySSLObject *self, PyObject *args)
+ }
+ } while (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE);
+
++ Py_DECREF(sock);
+ PyBuffer_Release(&buf);
+ if (len > 0)
+ return PyInt_FromLong(len);
+@@ -1312,6 +1611,7 @@ static PyObject *PySSL_SSLwrite(PySSLObject *self, PyObject *args)
+ return PySSL_SetError(self, len, __FILE__, __LINE__);
+
+ error:
++ Py_DECREF(sock);
+ PyBuffer_Release(&buf);
+ return NULL;
+ }
+@@ -1322,7 +1622,7 @@ PyDoc_STRVAR(PySSL_SSLwrite_doc,
+ Writes the string s into the SSL object. Returns the number\n\
+ of bytes written.");
+
+-static PyObject *PySSL_SSLpending(PySSLObject *self)
++static PyObject *PySSL_SSLpending(PySSLSocket *self)
+ {
+ int count = 0;
+
+@@ -1341,23 +1641,46 @@ PyDoc_STRVAR(PySSL_SSLpending_doc,
+ Returns the number of already decrypted bytes available for read,\n\
+ pending on the connection.\n");
+
+-static PyObject *PySSL_SSLread(PySSLObject *self, PyObject *args)
++static PyObject *PySSL_SSLread(PySSLSocket *self, PyObject *args)
+ {
+- PyObject *buf;
+- int count = 0;
+- int len = 1024;
++ PyObject *dest = NULL;
++ Py_buffer buf;
++ char *mem;
++ int len, count;
++ int buf_passed = 0;
+ int sockstate;
+ int err;
+ int nonblocking;
++ PySocketSockObject *sock = self->Socket;
+
+- if (!PyArg_ParseTuple(args, "|i:read", &len))
+- return NULL;
++ Py_INCREF(sock);
+
+- if (!(buf = PyString_FromStringAndSize((char *) 0, len)))
+- return NULL;
++ buf.obj = NULL;
++ buf.buf = NULL;
++ if (!PyArg_ParseTuple(args, "i|w*:read", &len, &buf))
++ goto error;
++
++ if ((buf.buf == NULL) && (buf.obj == NULL)) {
++ dest = PyBytes_FromStringAndSize(NULL, len);
++ if (dest == NULL)
++ goto error;
++ mem = PyBytes_AS_STRING(dest);
++ }
++ else {
++ buf_passed = 1;
++ mem = buf.buf;
++ if (len <= 0 || len > buf.len) {
++ len = (int) buf.len;
++ if (buf.len != len) {
++ PyErr_SetString(PyExc_OverflowError,
++ "maximum length can't fit in a C
'int'");
++ goto error;
++ }
++ }
++ }
+
+ /* just in case the blocking state of the socket has been changed */
+- nonblocking = (self->Socket->sock_timeout >= 0.0);
++ nonblocking = (sock->sock_timeout >= 0.0);
+ BIO_set_nbio(SSL_get_rbio(self->ssl), nonblocking);
+ BIO_set_nbio(SSL_get_wbio(self->ssl), nonblocking);
+
+@@ -1367,70 +1690,71 @@ static PyObject *PySSL_SSLread(PySSLObject *self, PyObject
*args)
+ PySSL_END_ALLOW_THREADS
+
+ if (!count) {
+- sockstate = check_socket_and_wait_for_timeout(self->Socket, 0);
++ sockstate = check_socket_and_wait_for_timeout(sock, 0);
+ if (sockstate == SOCKET_HAS_TIMED_OUT) {
+ PyErr_SetString(PySSLErrorObject,
+ "The read operation timed out");
+- Py_DECREF(buf);
+- return NULL;
++ goto error;
+ } else if (sockstate == SOCKET_TOO_LARGE_FOR_SELECT) {
+ PyErr_SetString(PySSLErrorObject,
+ "Underlying socket too large for select().");
+- Py_DECREF(buf);
+- return NULL;
++ goto error;
+ } else if (sockstate == SOCKET_HAS_BEEN_CLOSED) {
+- if (SSL_get_shutdown(self->ssl) !=
+- SSL_RECEIVED_SHUTDOWN)
+- {
+- Py_DECREF(buf);
+- PyErr_SetString(PySSLErrorObject,
+- "Socket closed without SSL shutdown
handshake");
+- return NULL;
+- } else {
+- /* should contain a zero-length string */
+- _PyString_Resize(&buf, 0);
+- return buf;
+- }
++ count = 0;
++ goto done;
+ }
+ }
+ do {
+ PySSL_BEGIN_ALLOW_THREADS
+- count = SSL_read(self->ssl, PyString_AsString(buf), len);
++ count = SSL_read(self->ssl, mem, len);
+ err = SSL_get_error(self->ssl, count);
+ PySSL_END_ALLOW_THREADS
+- if(PyErr_CheckSignals()) {
+- Py_DECREF(buf);
+- return NULL;
+- }
++ if (PyErr_CheckSignals())
++ goto error;
+ if (err == SSL_ERROR_WANT_READ) {
+- sockstate = check_socket_and_wait_for_timeout(self->Socket, 0);
++ sockstate = check_socket_and_wait_for_timeout(sock, 0);
+ } else if (err == SSL_ERROR_WANT_WRITE) {
+- sockstate = check_socket_and_wait_for_timeout(self->Socket, 1);
++ sockstate = check_socket_and_wait_for_timeout(sock, 1);
+ } else if ((err == SSL_ERROR_ZERO_RETURN) &&
+ (SSL_get_shutdown(self->ssl) ==
+ SSL_RECEIVED_SHUTDOWN))
+ {
+- _PyString_Resize(&buf, 0);
+- return buf;
++ count = 0;
++ goto done;
+ } else {
+ sockstate = SOCKET_OPERATION_OK;
+ }
+ if (sockstate == SOCKET_HAS_TIMED_OUT) {
+ PyErr_SetString(PySSLErrorObject,
+ "The read operation timed out");
+- Py_DECREF(buf);
+- return NULL;
++ goto error;
+ } else if (sockstate == SOCKET_IS_NONBLOCKING) {
+ break;
+ }
+ } while (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE);
+ if (count <= 0) {
+- Py_DECREF(buf);
+- return PySSL_SetError(self, count, __FILE__, __LINE__);
++ PySSL_SetError(self, count, __FILE__, __LINE__);
++ goto error;
++ }
++
++done:
++ Py_DECREF(sock);
++ if (!buf_passed) {
++ _PyBytes_Resize(&dest, count);
++ return dest;
+ }
+- if (count != len)
+- _PyString_Resize(&buf, count);
+- return buf;
++ else {
++ PyBuffer_Release(&buf);
++ return PyLong_FromLong(count);
++ }
++
++error:
++ Py_DECREF(sock);
++ if (!buf_passed)
++ Py_XDECREF(dest);
++ else
++ PyBuffer_Release(&buf);
++ return NULL;
+ }
+
+ PyDoc_STRVAR(PySSL_SSLread_doc,
+@@ -1438,20 +1762,22 @@ PyDoc_STRVAR(PySSL_SSLread_doc,
+ \n\
+ Read up to len bytes from the SSL socket.");
+
+-static PyObject *PySSL_SSLshutdown(PySSLObject *self)
++static PyObject *PySSL_SSLshutdown(PySSLSocket *self)
+ {
+ int err, ssl_err, sockstate, nonblocking;
+ int zeros = 0;
++ PySocketSockObject *sock = self->Socket;
+
+ /* Guard against closed socket */
+- if (self->Socket->sock_fd < 0) {
+- PyErr_SetString(PySSLErrorObject,
+- "Underlying socket has been closed.");
++ if (sock->sock_fd < 0) {
++ _setSSLError("Underlying socket connection gone",
++ PY_SSL_ERROR_NO_SOCKET, __FILE__, __LINE__);
+ return NULL;
+ }
++ Py_INCREF(sock);
+
+ /* Just in case the blocking state of the socket has been changed */
+- nonblocking = (self->Socket->sock_timeout >= 0.0);
++ nonblocking = (sock->sock_timeout >= 0.0);
+ BIO_set_nbio(SSL_get_rbio(self->ssl), nonblocking);
+ BIO_set_nbio(SSL_get_wbio(self->ssl), nonblocking);
+
+@@ -1486,9 +1812,9 @@ static PyObject *PySSL_SSLshutdown(PySSLObject *self)
+ /* Possibly retry shutdown until timeout or failure */
+ ssl_err = SSL_get_error(self->ssl, err);
+ if (ssl_err == SSL_ERROR_WANT_READ)
+- sockstate = check_socket_and_wait_for_timeout(self->Socket, 0);
++ sockstate = check_socket_and_wait_for_timeout(sock, 0);
+ else if (ssl_err == SSL_ERROR_WANT_WRITE)
+- sockstate = check_socket_and_wait_for_timeout(self->Socket, 1);
++ sockstate = check_socket_and_wait_for_timeout(sock, 1);
+ else
+ break;
+ if (sockstate == SOCKET_HAS_TIMED_OUT) {
+@@ -1498,24 +1824,29 @@ static PyObject *PySSL_SSLshutdown(PySSLObject *self)
+ else
+ PyErr_SetString(PySSLErrorObject,
+ "The write operation timed out");
+- return NULL;
++ goto error;
+ }
+ else if (sockstate == SOCKET_TOO_LARGE_FOR_SELECT) {
+ PyErr_SetString(PySSLErrorObject,
+ "Underlying socket too large for select().");
+- return NULL;
++ goto error;
+ }
+ else if (sockstate != SOCKET_OPERATION_OK)
+ /* Retain the SSL error code */
+ break;
+ }
+
+- if (err < 0)
++ if (err < 0) {
++ Py_DECREF(sock);
+ return PySSL_SetError(self, err, __FILE__, __LINE__);
+- else {
+- Py_INCREF(self->Socket);
+- return (PyObject *) (self->Socket);
+ }
++ else
++ /* It's already INCREF'ed */
++ return (PyObject *) sock;
++
++error:
++ Py_DECREF(sock);
++ return NULL;
+ }
+
+ PyDoc_STRVAR(PySSL_SSLshutdown_doc,
+@@ -1524,6 +1855,47 @@ PyDoc_STRVAR(PySSL_SSLshutdown_doc,
+ Does the SSL shutdown handshake with the remote end, and returns\n\
+ the underlying socket object.");
+
++#if HAVE_OPENSSL_FINISHED
++static PyObject *
++PySSL_tls_unique_cb(PySSLSocket *self)
++{
++ PyObject *retval = NULL;
++ char buf[PySSL_CB_MAXLEN];
++ size_t len;
++
++ if (SSL_session_reused(self->ssl) ^ !self->socket_type) {
++ /* if session is resumed XOR we are the client */
++ len = SSL_get_finished(self->ssl, buf, PySSL_CB_MAXLEN);
++ }
++ else {
++ /* if a new session XOR we are the server */
++ len = SSL_get_peer_finished(self->ssl, buf, PySSL_CB_MAXLEN);
++ }
++
++ /* It cannot be negative in current OpenSSL version as of July 2011 */
++ if (len == 0)
++ Py_RETURN_NONE;
++
++ retval = PyBytes_FromStringAndSize(buf, len);
++
++ return retval;
++}
++
++PyDoc_STRVAR(PySSL_tls_unique_cb_doc,
++"tls_unique_cb() -> bytes\n\
++\n\
++Returns the 'tls-unique' channel binding data, as defined by RFC 5929.\n\
++\n\
++If the TLS handshake is not yet complete, None is returned");
++
++#endif /* HAVE_OPENSSL_FINISHED */
++
++static PyGetSetDef ssl_getsetlist[] = {
++ {"context", (getter) PySSL_get_context,
++ (setter) PySSL_set_context, PySSL_set_context_doc},
++ {NULL}, /* sentinel */
++};
++
+ static PyMethodDef PySSLMethods[] = {
+ {"do_handshake", (PyCFunction)PySSL_SSLdo_handshake, METH_NOARGS},
+ {"write", (PyCFunction)PySSL_SSLwrite, METH_VARARGS,
+@@ -1532,66 +1904,1345 @@ static PyMethodDef PySSLMethods[] = {
+ PySSL_SSLread_doc},
+ {"pending", (PyCFunction)PySSL_SSLpending, METH_NOARGS,
+ PySSL_SSLpending_doc},
+- {"server", (PyCFunction)PySSL_server, METH_NOARGS},
+- {"issuer", (PyCFunction)PySSL_issuer, METH_NOARGS},
+ {"peer_certificate", (PyCFunction)PySSL_peercert, METH_VARARGS,
+ PySSL_peercert_doc},
+ {"cipher", (PyCFunction)PySSL_cipher, METH_NOARGS},
++#ifdef OPENSSL_NPN_NEGOTIATED
++ {"selected_npn_protocol", (PyCFunction)PySSL_selected_npn_protocol,
METH_NOARGS},
++#endif
++ {"compression", (PyCFunction)PySSL_compression, METH_NOARGS},
+ {"shutdown", (PyCFunction)PySSL_SSLshutdown, METH_NOARGS,
+ PySSL_SSLshutdown_doc},
++#if HAVE_OPENSSL_FINISHED
++ {"tls_unique_cb", (PyCFunction)PySSL_tls_unique_cb, METH_NOARGS,
++ PySSL_tls_unique_cb_doc},
++#endif
+ {NULL, NULL}
+ };
+
+-static PyObject *PySSL_getattr(PySSLObject *self, char *name)
+-{
+- return Py_FindMethod(PySSLMethods, (PyObject *)self, name);
+-}
+-
+-static PyTypeObject PySSL_Type = {
++static PyTypeObject PySSLSocket_Type = {
+ PyVarObject_HEAD_INIT(NULL, 0)
+- "ssl.SSLContext", /*tp_name*/
+- sizeof(PySSLObject), /*tp_basicsize*/
++ "_ssl._SSLSocket", /*tp_name*/
++ sizeof(PySSLSocket), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ /* methods */
+ (destructor)PySSL_dealloc, /*tp_dealloc*/
+ 0, /*tp_print*/
+- (getattrfunc)PySSL_getattr, /*tp_getattr*/
++ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+- 0, /*tp_compare*/
++ 0, /*tp_reserved*/
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
++ 0, /*tp_call*/
++ 0, /*tp_str*/
++ 0, /*tp_getattro*/
++ 0, /*tp_setattro*/
++ 0, /*tp_as_buffer*/
++ Py_TPFLAGS_DEFAULT, /*tp_flags*/
++ 0, /*tp_doc*/
++ 0, /*tp_traverse*/
++ 0, /*tp_clear*/
++ 0, /*tp_richcompare*/
++ 0, /*tp_weaklistoffset*/
++ 0, /*tp_iter*/
++ 0, /*tp_iternext*/
++ PySSLMethods, /*tp_methods*/
++ 0, /*tp_members*/
++ ssl_getsetlist, /*tp_getset*/
+ };
+
+-#ifdef HAVE_OPENSSL_RAND
+
+-/* helper routines for seeding the SSL PRNG */
++/*
++ * _SSLContext objects
++ */
++
+ static PyObject *
+-PySSL_RAND_add(PyObject *self, PyObject *args)
++context_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+ {
+- char *buf;
+- int len;
+- double entropy;
++ char *kwlist[] = {"protocol", NULL};
++ PySSLContext *self;
++ int proto_version = PY_SSL_VERSION_SSL23;
++ long options;
++ SSL_CTX *ctx = NULL;
+
+- if (!PyArg_ParseTuple(args, "s#d:RAND_add", &buf, &len,
&entropy))
++ if (!PyArg_ParseTupleAndKeywords(
++ args, kwds, "i:_SSLContext", kwlist,
++ &proto_version))
+ return NULL;
+- RAND_add(buf, len, entropy);
+- Py_INCREF(Py_None);
+- return Py_None;
+-}
+-
+-PyDoc_STRVAR(PySSL_RAND_add_doc,
+-"RAND_add(string, entropy)\n\
+-\n\
+-Mix string into the OpenSSL PRNG state. entropy (a float) is a lower\n\
+-bound on the entropy contained in string. See RFC 1750.");
+
+-static PyObject *
+-PySSL_RAND_status(PyObject *self)
+-{
+- return PyInt_FromLong(RAND_status());
++ PySSL_BEGIN_ALLOW_THREADS
++ if (proto_version == PY_SSL_VERSION_TLS1)
++ ctx = SSL_CTX_new(TLSv1_method());
++#if HAVE_TLSv1_2
++ else if (proto_version == PY_SSL_VERSION_TLS1_1)
++ ctx = SSL_CTX_new(TLSv1_1_method());
++ else if (proto_version == PY_SSL_VERSION_TLS1_2)
++ ctx = SSL_CTX_new(TLSv1_2_method());
++#endif
++ else if (proto_version == PY_SSL_VERSION_SSL3)
++ ctx = SSL_CTX_new(SSLv3_method());
++#ifndef OPENSSL_NO_SSL2
++ else if (proto_version == PY_SSL_VERSION_SSL2)
++ ctx = SSL_CTX_new(SSLv2_method());
++#endif
++ else if (proto_version == PY_SSL_VERSION_SSL23)
++ ctx = SSL_CTX_new(SSLv23_method());
++ else
++ proto_version = -1;
++ PySSL_END_ALLOW_THREADS
++
++ if (proto_version == -1) {
++ PyErr_SetString(PyExc_ValueError,
++ "invalid protocol version");
++ return NULL;
++ }
++ if (ctx == NULL) {
++ PyErr_SetString(PySSLErrorObject,
++ "failed to allocate SSL context");
++ return NULL;
++ }
++
++ assert(type != NULL && type->tp_alloc != NULL);
++ self = (PySSLContext *) type->tp_alloc(type, 0);
++ if (self == NULL) {
++ SSL_CTX_free(ctx);
++ return NULL;
++ }
++ self->ctx = ctx;
++#ifdef OPENSSL_NPN_NEGOTIATED
++ self->npn_protocols = NULL;
++#endif
++#ifndef OPENSSL_NO_TLSEXT
++ self->set_hostname = NULL;
++#endif
++ /* Don't check host name by default */
++ self->check_hostname = 0;
++ /* Defaults */
++ SSL_CTX_set_verify(self->ctx, SSL_VERIFY_NONE, NULL);
++ options = SSL_OP_ALL & ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS;
++ if (proto_version != PY_SSL_VERSION_SSL2)
++ options |= SSL_OP_NO_SSLv2;
++ SSL_CTX_set_options(self->ctx, options);
++
++#ifndef OPENSSL_NO_ECDH
++ /* Allow automatic ECDH curve selection (on OpenSSL 1.0.2+), or use
++ prime256v1 by default. This is Apache mod_ssl's initialization
++ policy, so we should be safe. */
++#if defined(SSL_CTX_set_ecdh_auto)
++ SSL_CTX_set_ecdh_auto(self->ctx, 1);
++#else
++ {
++ EC_KEY *key = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
++ SSL_CTX_set_tmp_ecdh(self->ctx, key);
++ EC_KEY_free(key);
++ }
++#endif
++#endif
++
++#define SID_CTX "Python"
++ SSL_CTX_set_session_id_context(self->ctx, (const unsigned char *) SID_CTX,
++ sizeof(SID_CTX));
++#undef SID_CTX
++
++ return (PyObject *)self;
++}
++
++static int
++context_traverse(PySSLContext *self, visitproc visit, void *arg)
++{
++#ifndef OPENSSL_NO_TLSEXT
++ Py_VISIT(self->set_hostname);
++#endif
++ return 0;
++}
++
++static int
++context_clear(PySSLContext *self)
++{
++#ifndef OPENSSL_NO_TLSEXT
++ Py_CLEAR(self->set_hostname);
++#endif
++ return 0;
++}
++
++static void
++context_dealloc(PySSLContext *self)
++{
++ context_clear(self);
++ SSL_CTX_free(self->ctx);
++#ifdef OPENSSL_NPN_NEGOTIATED
++ PyMem_Free(self->npn_protocols);
++#endif
++ Py_TYPE(self)->tp_free(self);
++}
++
++static PyObject *
++set_ciphers(PySSLContext *self, PyObject *args)
++{
++ int ret;
++ const char *cipherlist;
++
++ if (!PyArg_ParseTuple(args, "s:set_ciphers", &cipherlist))
++ return NULL;
++ ret = SSL_CTX_set_cipher_list(self->ctx, cipherlist);
++ if (ret == 0) {
++ /* Clearing the error queue is necessary on some OpenSSL versions,
++ otherwise the error will be reported again when another SSL call
++ is done. */
++ ERR_clear_error();
++ PyErr_SetString(PySSLErrorObject,
++ "No cipher can be selected.");
++ return NULL;
++ }
++ Py_RETURN_NONE;
++}
++
++#ifdef OPENSSL_NPN_NEGOTIATED
++/* this callback gets passed to SSL_CTX_set_next_protos_advertise_cb */
++static int
++_advertiseNPN_cb(SSL *s,
++ const unsigned char **data, unsigned int *len,
++ void *args)
++{
++ PySSLContext *ssl_ctx = (PySSLContext *) args;
++
++ if (ssl_ctx->npn_protocols == NULL) {
++ *data = (unsigned char *) "";
++ *len = 0;
++ } else {
++ *data = (unsigned char *) ssl_ctx->npn_protocols;
++ *len = ssl_ctx->npn_protocols_len;
++ }
++
++ return SSL_TLSEXT_ERR_OK;
++}
++/* this callback gets passed to SSL_CTX_set_next_proto_select_cb */
++static int
++_selectNPN_cb(SSL *s,
++ unsigned char **out, unsigned char *outlen,
++ const unsigned char *server, unsigned int server_len,
++ void *args)
++{
++ PySSLContext *ssl_ctx = (PySSLContext *) args;
++
++ unsigned char *client = (unsigned char *) ssl_ctx->npn_protocols;
++ int client_len;
++
++ if (client == NULL) {
++ client = (unsigned char *) "";
++ client_len = 0;
++ } else {
++ client_len = ssl_ctx->npn_protocols_len;
++ }
++
++ SSL_select_next_proto(out, outlen,
++ server, server_len,
++ client, client_len);
++
++ return SSL_TLSEXT_ERR_OK;
++}
++#endif
++
++static PyObject *
++_set_npn_protocols(PySSLContext *self, PyObject *args)
++{
++#ifdef OPENSSL_NPN_NEGOTIATED
++ Py_buffer protos;
++
++ if (!PyArg_ParseTuple(args, "s*:set_npn_protocols", &protos))
++ return NULL;
++
++ if (self->npn_protocols != NULL) {
++ PyMem_Free(self->npn_protocols);
++ }
++
++ self->npn_protocols = PyMem_Malloc(protos.len);
++ if (self->npn_protocols == NULL) {
++ PyBuffer_Release(&protos);
++ return PyErr_NoMemory();
++ }
++ memcpy(self->npn_protocols, protos.buf, protos.len);
++ self->npn_protocols_len = (int) protos.len;
++
++ /* set both server and client callbacks, because the context can
++ * be used to create both types of sockets */
++ SSL_CTX_set_next_protos_advertised_cb(self->ctx,
++ _advertiseNPN_cb,
++ self);
++ SSL_CTX_set_next_proto_select_cb(self->ctx,
++ _selectNPN_cb,
++ self);
++
++ PyBuffer_Release(&protos);
++ Py_RETURN_NONE;
++#else
++ PyErr_SetString(PyExc_NotImplementedError,
++ "The NPN extension requires OpenSSL 1.0.1 or later.");
++ return NULL;
++#endif
++}
++
++static PyObject *
++get_verify_mode(PySSLContext *self, void *c)
++{
++ switch (SSL_CTX_get_verify_mode(self->ctx)) {
++ case SSL_VERIFY_NONE:
++ return PyLong_FromLong(PY_SSL_CERT_NONE);
++ case SSL_VERIFY_PEER:
++ return PyLong_FromLong(PY_SSL_CERT_OPTIONAL);
++ case SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT:
++ return PyLong_FromLong(PY_SSL_CERT_REQUIRED);
++ }
++ PyErr_SetString(PySSLErrorObject,
++ "invalid return value from SSL_CTX_get_verify_mode");
++ return NULL;
++}
++
++static int
++set_verify_mode(PySSLContext *self, PyObject *arg, void *c)
++{
++ int n, mode;
++ if (!PyArg_Parse(arg, "i", &n))
++ return -1;
++ if (n == PY_SSL_CERT_NONE)
++ mode = SSL_VERIFY_NONE;
++ else if (n == PY_SSL_CERT_OPTIONAL)
++ mode = SSL_VERIFY_PEER;
++ else if (n == PY_SSL_CERT_REQUIRED)
++ mode = SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT;
++ else {
++ PyErr_SetString(PyExc_ValueError,
++ "invalid value for verify_mode");
++ return -1;
++ }
++ if (mode == SSL_VERIFY_NONE && self->check_hostname) {
++ PyErr_SetString(PyExc_ValueError,
++ "Cannot set verify_mode to CERT_NONE when "
++ "check_hostname is enabled.");
++ return -1;
++ }
++ SSL_CTX_set_verify(self->ctx, mode, NULL);
++ return 0;
++}
++
++#ifdef HAVE_OPENSSL_VERIFY_PARAM
++static PyObject *
++get_verify_flags(PySSLContext *self, void *c)
++{
++ X509_STORE *store;
++ unsigned long flags;
++
++ store = SSL_CTX_get_cert_store(self->ctx);
++ flags = X509_VERIFY_PARAM_get_flags(store->param);
++ return PyLong_FromUnsignedLong(flags);
++}
++
++static int
++set_verify_flags(PySSLContext *self, PyObject *arg, void *c)
++{
++ X509_STORE *store;
++ unsigned long new_flags, flags, set, clear;
++
++ if (!PyArg_Parse(arg, "k", &new_flags))
++ return -1;
++ store = SSL_CTX_get_cert_store(self->ctx);
++ flags = X509_VERIFY_PARAM_get_flags(store->param);
++ clear = flags & ~new_flags;
++ set = ~flags & new_flags;
++ if (clear) {
++ if (!X509_VERIFY_PARAM_clear_flags(store->param, clear)) {
++ _setSSLError(NULL, 0, __FILE__, __LINE__);
++ return -1;
++ }
++ }
++ if (set) {
++ if (!X509_VERIFY_PARAM_set_flags(store->param, set)) {
++ _setSSLError(NULL, 0, __FILE__, __LINE__);
++ return -1;
++ }
++ }
++ return 0;
++}
++#endif
++
++static PyObject *
++get_options(PySSLContext *self, void *c)
++{
++ return PyLong_FromLong(SSL_CTX_get_options(self->ctx));
++}
++
++static int
++set_options(PySSLContext *self, PyObject *arg, void *c)
++{
++ long new_opts, opts, set, clear;
++ if (!PyArg_Parse(arg, "l", &new_opts))
++ return -1;
++ opts = SSL_CTX_get_options(self->ctx);
++ clear = opts & ~new_opts;
++ set = ~opts & new_opts;
++ if (clear) {
++#ifdef HAVE_SSL_CTX_CLEAR_OPTIONS
++ SSL_CTX_clear_options(self->ctx, clear);
++#else
++ PyErr_SetString(PyExc_ValueError,
++ "can't clear options before OpenSSL 0.9.8m");
++ return -1;
++#endif
++ }
++ if (set)
++ SSL_CTX_set_options(self->ctx, set);
++ return 0;
++}
++
++static PyObject *
++get_check_hostname(PySSLContext *self, void *c)
++{
++ return PyBool_FromLong(self->check_hostname);
++}
++
++static int
++set_check_hostname(PySSLContext *self, PyObject *arg, void *c)
++{
++ PyObject *py_check_hostname;
++ int check_hostname;
++ if (!PyArg_Parse(arg, "O", &py_check_hostname))
++ return -1;
++
++ check_hostname = PyObject_IsTrue(py_check_hostname);
++ if (check_hostname < 0)
++ return -1;
++ if (check_hostname &&
++ SSL_CTX_get_verify_mode(self->ctx) == SSL_VERIFY_NONE) {
++ PyErr_SetString(PyExc_ValueError,
++ "check_hostname needs a SSL context with either "
++ "CERT_OPTIONAL or CERT_REQUIRED");
++ return -1;
++ }
++ self->check_hostname = check_hostname;
++ return 0;
++}
++
++
++typedef struct {
++ PyThreadState *thread_state;
++ PyObject *callable;
++ char *password;
++ int size;
++ int error;
++} _PySSLPasswordInfo;
++
++static int
++_pwinfo_set(_PySSLPasswordInfo *pw_info, PyObject* password,
++ const char *bad_type_error)
++{
++ /* Set the password and size fields of a _PySSLPasswordInfo struct
++ from a unicode, bytes, or byte array object.
++ The password field will be dynamically allocated and must be freed
++ by the caller */
++ PyObject *password_bytes = NULL;
++ const char *data = NULL;
++ Py_ssize_t size;
++
++ if (PyUnicode_Check(password)) {
++ password_bytes = PyUnicode_AsEncodedString(password, NULL, NULL);
++ if (!password_bytes) {
++ goto error;
++ }
++ data = PyBytes_AS_STRING(password_bytes);
++ size = PyBytes_GET_SIZE(password_bytes);
++ } else if (PyBytes_Check(password)) {
++ data = PyBytes_AS_STRING(password);
++ size = PyBytes_GET_SIZE(password);
++ } else if (PyByteArray_Check(password)) {
++ data = PyByteArray_AS_STRING(password);
++ size = PyByteArray_GET_SIZE(password);
++ } else {
++ PyErr_SetString(PyExc_TypeError, bad_type_error);
++ goto error;
++ }
++
++ if (size > (Py_ssize_t)INT_MAX) {
++ PyErr_Format(PyExc_ValueError,
++ "password cannot be longer than %d bytes", INT_MAX);
++ goto error;
++ }
++
++ PyMem_Free(pw_info->password);
++ pw_info->password = PyMem_Malloc(size);
++ if (!pw_info->password) {
++ PyErr_SetString(PyExc_MemoryError,
++ "unable to allocate password buffer");
++ goto error;
++ }
++ memcpy(pw_info->password, data, size);
++ pw_info->size = (int)size;
++
++ Py_XDECREF(password_bytes);
++ return 1;
++
++error:
++ Py_XDECREF(password_bytes);
++ return 0;
++}
++
++static int
++_password_callback(char *buf, int size, int rwflag, void *userdata)
++{
++ _PySSLPasswordInfo *pw_info = (_PySSLPasswordInfo*) userdata;
++ PyObject *fn_ret = NULL;
++
++ PySSL_END_ALLOW_THREADS_S(pw_info->thread_state);
++
++ if (pw_info->callable) {
++ fn_ret = PyObject_CallFunctionObjArgs(pw_info->callable, NULL);
++ if (!fn_ret) {
++ /* TODO: It would be nice to move _ctypes_add_traceback() into the
++ core python API, so we could use it to add a frame here */
++ goto error;
++ }
++
++ if (!_pwinfo_set(pw_info, fn_ret,
++ "password callback must return a string")) {
++ goto error;
++ }
++ Py_CLEAR(fn_ret);
++ }
++
++ if (pw_info->size > size) {
++ PyErr_Format(PyExc_ValueError,
++ "password cannot be longer than %d bytes", size);
++ goto error;
++ }
++
++ PySSL_BEGIN_ALLOW_THREADS_S(pw_info->thread_state);
++ memcpy(buf, pw_info->password, pw_info->size);
++ return pw_info->size;
++
++error:
++ Py_XDECREF(fn_ret);
++ PySSL_BEGIN_ALLOW_THREADS_S(pw_info->thread_state);
++ pw_info->error = 1;
++ return -1;
++}
++
++static PyObject *
++load_cert_chain(PySSLContext *self, PyObject *args, PyObject *kwds)
++{
++ char *kwlist[] = {"certfile", "keyfile", "password",
NULL};
++ PyObject *password = NULL;
++ char *certfile_bytes = NULL, *keyfile_bytes = NULL;
++ pem_password_cb *orig_passwd_cb = self->ctx->default_passwd_callback;
++ void *orig_passwd_userdata = self->ctx->default_passwd_callback_userdata;
++ _PySSLPasswordInfo pw_info = { NULL, NULL, NULL, 0, 0 };
++ int r;
++
++ errno = 0;
++ ERR_clear_error();
++ if (!PyArg_ParseTupleAndKeywords(args, kwds,
++ "et|etO:load_cert_chain", kwlist,
++ Py_FileSystemDefaultEncoding, &certfile_bytes,
++ Py_FileSystemDefaultEncoding, &keyfile_bytes,
++ &password))
++ return NULL;
++ if (password && password != Py_None) {
++ if (PyCallable_Check(password)) {
++ pw_info.callable = password;
++ } else if (!_pwinfo_set(&pw_info, password,
++ "password should be a string or callable")) {
++ goto error;
++ }
++ SSL_CTX_set_default_passwd_cb(self->ctx, _password_callback);
++ SSL_CTX_set_default_passwd_cb_userdata(self->ctx, &pw_info);
++ }
++ PySSL_BEGIN_ALLOW_THREADS_S(pw_info.thread_state);
++ r = SSL_CTX_use_certificate_chain_file(self->ctx, certfile_bytes);
++ PySSL_END_ALLOW_THREADS_S(pw_info.thread_state);
++ if (r != 1) {
++ if (pw_info.error) {
++ ERR_clear_error();
++ /* the password callback has already set the error information */
++ }
++ else if (errno != 0) {
++ ERR_clear_error();
++ PyErr_SetFromErrno(PyExc_IOError);
++ }
++ else {
++ _setSSLError(NULL, 0, __FILE__, __LINE__);
++ }
++ goto error;
++ }
++ PySSL_BEGIN_ALLOW_THREADS_S(pw_info.thread_state);
++ r = SSL_CTX_use_PrivateKey_file(self->ctx,
++ keyfile_bytes ? keyfile_bytes : certfile_bytes,
++ SSL_FILETYPE_PEM);
++ PySSL_END_ALLOW_THREADS_S(pw_info.thread_state);
++ Py_CLEAR(keyfile_bytes);
++ Py_CLEAR(certfile_bytes);
++ if (r != 1) {
++ if (pw_info.error) {
++ ERR_clear_error();
++ /* the password callback has already set the error information */
++ }
++ else if (errno != 0) {
++ ERR_clear_error();
++ PyErr_SetFromErrno(PyExc_IOError);
++ }
++ else {
++ _setSSLError(NULL, 0, __FILE__, __LINE__);
++ }
++ goto error;
++ }
++ PySSL_BEGIN_ALLOW_THREADS_S(pw_info.thread_state);
++ r = SSL_CTX_check_private_key(self->ctx);
++ PySSL_END_ALLOW_THREADS_S(pw_info.thread_state);
++ if (r != 1) {
++ _setSSLError(NULL, 0, __FILE__, __LINE__);
++ goto error;
++ }
++ SSL_CTX_set_default_passwd_cb(self->ctx, orig_passwd_cb);
++ SSL_CTX_set_default_passwd_cb_userdata(self->ctx, orig_passwd_userdata);
++ PyMem_Free(pw_info.password);
++ Py_RETURN_NONE;
++
++error:
++ SSL_CTX_set_default_passwd_cb(self->ctx, orig_passwd_cb);
++ SSL_CTX_set_default_passwd_cb_userdata(self->ctx, orig_passwd_userdata);
++ PyMem_Free(pw_info.password);
++ Py_XDECREF(keyfile_bytes);
++ Py_XDECREF(certfile_bytes);
++ return NULL;
++}
++
++/* internal helper function, returns -1 on error
++ */
++static int
++_add_ca_certs(PySSLContext *self, void *data, Py_ssize_t len,
++ int filetype)
++{
++ BIO *biobuf = NULL;
++ X509_STORE *store;
++ int retval = 0, err, loaded = 0;
++
++ assert(filetype == SSL_FILETYPE_ASN1 || filetype == SSL_FILETYPE_PEM);
++
++ if (len <= 0) {
++ PyErr_SetString(PyExc_ValueError,
++ "Empty certificate data");
++ return -1;
++ } else if (len > INT_MAX) {
++ PyErr_SetString(PyExc_OverflowError,
++ "Certificate data is too long.");
++ return -1;
++ }
++
++ biobuf = BIO_new_mem_buf(data, (int)len);
++ if (biobuf == NULL) {
++ _setSSLError("Can't allocate buffer", 0, __FILE__, __LINE__);
++ return -1;
++ }
++
++ store = SSL_CTX_get_cert_store(self->ctx);
++ assert(store != NULL);
++
++ while (1) {
++ X509 *cert = NULL;
++ int r;
++
++ if (filetype == SSL_FILETYPE_ASN1) {
++ cert = d2i_X509_bio(biobuf, NULL);
++ } else {
++ cert = PEM_read_bio_X509(biobuf, NULL,
++ self->ctx->default_passwd_callback,
++
self->ctx->default_passwd_callback_userdata);
++ }
++ if (cert == NULL) {
++ break;
++ }
++ r = X509_STORE_add_cert(store, cert);
++ X509_free(cert);
++ if (!r) {
++ err = ERR_peek_last_error();
++ if ((ERR_GET_LIB(err) == ERR_LIB_X509) &&
++ (ERR_GET_REASON(err) == X509_R_CERT_ALREADY_IN_HASH_TABLE)) {
++ /* cert already in hash table, not an error */
++ ERR_clear_error();
++ } else {
++ break;
++ }
++ }
++ loaded++;
++ }
++
++ err = ERR_peek_last_error();
++ if ((filetype == SSL_FILETYPE_ASN1) &&
++ (loaded > 0) &&
++ (ERR_GET_LIB(err) == ERR_LIB_ASN1) &&
++ (ERR_GET_REASON(err) == ASN1_R_HEADER_TOO_LONG)) {
++ /* EOF ASN1 file, not an error */
++ ERR_clear_error();
++ retval = 0;
++ } else if ((filetype == SSL_FILETYPE_PEM) &&
++ (loaded > 0) &&
++ (ERR_GET_LIB(err) == ERR_LIB_PEM) &&
++ (ERR_GET_REASON(err) == PEM_R_NO_START_LINE)) {
++ /* EOF PEM file, not an error */
++ ERR_clear_error();
++ retval = 0;
++ } else {
++ _setSSLError(NULL, 0, __FILE__, __LINE__);
++ retval = -1;
++ }
++
++ BIO_free(biobuf);
++ return retval;
++}
++
++
++static PyObject *
++load_verify_locations(PySSLContext *self, PyObject *args, PyObject *kwds)
++{
++ char *kwlist[] = {"cafile", "capath", "cadata",
NULL};
++ PyObject *cadata = NULL, *cafile = NULL, *capath = NULL;
++ PyObject *cafile_bytes = NULL, *capath_bytes = NULL;
++ const char *cafile_buf = NULL, *capath_buf = NULL;
++ int r = 0, ok = 1;
++
++ errno = 0;
++ if (!PyArg_ParseTupleAndKeywords(args, kwds,
++ "|OOO:load_verify_locations", kwlist,
++ &cafile, &capath, &cadata))
++ return NULL;
++
++ if (cafile == Py_None)
++ cafile = NULL;
++ if (capath == Py_None)
++ capath = NULL;
++ if (cadata == Py_None)
++ cadata = NULL;
++
++ if (cafile == NULL && capath == NULL && cadata == NULL) {
++ PyErr_SetString(PyExc_TypeError,
++ "cafile, capath and cadata cannot be all omitted");
++ goto error;
++ }
++
++ if (cafile) {
++ cafile_bytes = PyString_AsEncodedObject(
++ cafile, Py_FileSystemDefaultEncoding, "strict");
++ if (!cafile_bytes) {
++ goto error;
++ }
++ }
++ if (capath) {
++ capath_bytes = PyString_AsEncodedObject(
++ capath, Py_FileSystemDefaultEncoding, "strict");
++ if (!capath_bytes) {
++ goto error;
++ }
++ }
++
++ /* validata cadata type and load cadata */
++ if (cadata) {
++ Py_buffer buf;
++ PyObject *cadata_ascii = NULL;
++
++ if (!PyUnicode_Check(cadata) && PyObject_GetBuffer(cadata, &buf,
PyBUF_SIMPLE) == 0) {
++ if (!PyBuffer_IsContiguous(&buf, 'C') || buf.ndim > 1) {
++ PyBuffer_Release(&buf);
++ PyErr_SetString(PyExc_TypeError,
++ "cadata should be a contiguous buffer with "
++ "a single dimension");
++ goto error;
++ }
++ r = _add_ca_certs(self, buf.buf, buf.len, SSL_FILETYPE_ASN1);
++ PyBuffer_Release(&buf);
++ if (r == -1) {
++ goto error;
++ }
++ } else {
++ PyErr_Clear();
++ cadata_ascii = PyUnicode_AsASCIIString(cadata);
++ if (cadata_ascii == NULL) {
++ PyErr_SetString(PyExc_TypeError,
++ "cadata should be a ASCII string or a "
++ "bytes-like object");
++ goto error;
++ }
++ r = _add_ca_certs(self,
++ PyBytes_AS_STRING(cadata_ascii),
++ PyBytes_GET_SIZE(cadata_ascii),
++ SSL_FILETYPE_PEM);
++ Py_DECREF(cadata_ascii);
++ if (r == -1) {
++ goto error;
++ }
++ }
++ }
++
++ /* load cafile or capath */
++ if (cafile_bytes || capath_bytes) {
++ if (cafile)
++ cafile_buf = PyBytes_AS_STRING(cafile_bytes);
++ if (capath)
++ capath_buf = PyBytes_AS_STRING(capath_bytes);
++ PySSL_BEGIN_ALLOW_THREADS
++ r = SSL_CTX_load_verify_locations(
++ self->ctx,
++ cafile_buf,
++ capath_buf);
++ PySSL_END_ALLOW_THREADS
++ if (r != 1) {
++ ok = 0;
++ if (errno != 0) {
++ ERR_clear_error();
++ PyErr_SetFromErrno(PyExc_IOError);
++ }
++ else {
++ _setSSLError(NULL, 0, __FILE__, __LINE__);
++ }
++ goto error;
++ }
++ }
++ goto end;
++
++ error:
++ ok = 0;
++ end:
++ Py_XDECREF(cafile_bytes);
++ Py_XDECREF(capath_bytes);
++ if (ok) {
++ Py_RETURN_NONE;
++ } else {
++ return NULL;
++ }
++}
++
++static PyObject *
++load_dh_params(PySSLContext *self, PyObject *filepath)
++{
++ BIO *bio;
++ DH *dh;
++ char *path = PyBytes_AsString(filepath);
++ if (!path) {
++ return NULL;
++ }
++
++ bio = BIO_new_file(path, "r");
++ if (bio == NULL) {
++ ERR_clear_error();
++ PyErr_SetFromErrnoWithFilenameObject(PyExc_IOError, filepath);
++ return NULL;
++ }
++ errno = 0;
++ PySSL_BEGIN_ALLOW_THREADS
++ dh = PEM_read_bio_DHparams(bio, NULL, NULL, NULL);
++ BIO_free(bio);
++ PySSL_END_ALLOW_THREADS
++ if (dh == NULL) {
++ if (errno != 0) {
++ ERR_clear_error();
++ PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError, filepath);
++ }
++ else {
++ _setSSLError(NULL, 0, __FILE__, __LINE__);
++ }
++ return NULL;
++ }
++ if (SSL_CTX_set_tmp_dh(self->ctx, dh) == 0)
++ _setSSLError(NULL, 0, __FILE__, __LINE__);
++ DH_free(dh);
++ Py_RETURN_NONE;
++}
++
++static PyObject *
++context_wrap_socket(PySSLContext *self, PyObject *args, PyObject *kwds)
++{
++ char *kwlist[] = {"sock", "server_side",
"server_hostname", "ssl_sock", NULL};
++ PySocketSockObject *sock;
++ int server_side = 0;
++ char *hostname = NULL;
++ PyObject *hostname_obj, *ssl_sock = Py_None, *res;
++
++ /* server_hostname is either None (or absent), or to be encoded
++ using the idna encoding. */
++ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!i|O!O:_wrap_socket",
kwlist,
++ PySocketModule.Sock_Type,
++ &sock, &server_side,
++ Py_TYPE(Py_None), &hostname_obj,
++ &ssl_sock)) {
++ PyErr_Clear();
++ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!iet|O:_wrap_socket",
kwlist,
++ PySocketModule.Sock_Type,
++ &sock, &server_side,
++ "idna", &hostname, &ssl_sock))
++ return NULL;
++#if !HAVE_SNI
++ PyMem_Free(hostname);
++ PyErr_SetString(PyExc_ValueError, "server_hostname is not supported "
++ "by your OpenSSL library");
++ return NULL;
++#endif
++ }
++
++ res = (PyObject *) newPySSLSocket(self, sock, server_side,
++ hostname, ssl_sock);
++ if (hostname != NULL)
++ PyMem_Free(hostname);
++ return res;
++}
++
++static PyObject *
++session_stats(PySSLContext *self, PyObject *unused)
++{
++ int r;
++ PyObject *value, *stats = PyDict_New();
++ if (!stats)
++ return NULL;
++
++#define ADD_STATS(SSL_NAME, KEY_NAME) \
++ value = PyLong_FromLong(SSL_CTX_sess_ ## SSL_NAME (self->ctx)); \
++ if (value == NULL) \
++ goto error; \
++ r = PyDict_SetItemString(stats, KEY_NAME, value); \
++ Py_DECREF(value); \
++ if (r < 0) \
++ goto error;
++
++ ADD_STATS(number, "number");
++ ADD_STATS(connect, "connect");
++ ADD_STATS(connect_good, "connect_good");
++ ADD_STATS(connect_renegotiate, "connect_renegotiate");
++ ADD_STATS(accept, "accept");
++ ADD_STATS(accept_good, "accept_good");
++ ADD_STATS(accept_renegotiate, "accept_renegotiate");
++ ADD_STATS(accept, "accept");
++ ADD_STATS(hits, "hits");
++ ADD_STATS(misses, "misses");
++ ADD_STATS(timeouts, "timeouts");
++ ADD_STATS(cache_full, "cache_full");
++
++#undef ADD_STATS
++
++ return stats;
++
++error:
++ Py_DECREF(stats);
++ return NULL;
++}
++
++static PyObject *
++set_default_verify_paths(PySSLContext *self, PyObject *unused)
++{
++ if (!SSL_CTX_set_default_verify_paths(self->ctx)) {
++ _setSSLError(NULL, 0, __FILE__, __LINE__);
++ return NULL;
++ }
++ Py_RETURN_NONE;
++}
++
++#ifndef OPENSSL_NO_ECDH
++static PyObject *
++set_ecdh_curve(PySSLContext *self, PyObject *name)
++{
++ char *name_bytes;
++ int nid;
++ EC_KEY *key;
++
++ name_bytes = PyBytes_AsString(name);
++ if (!name_bytes) {
++ return NULL;
++ }
++ nid = OBJ_sn2nid(name_bytes);
++ if (nid == 0) {
++ PyErr_Format(PyExc_ValueError,
++ "unknown elliptic curve name %R", name);
++ return NULL;
++ }
++ key = EC_KEY_new_by_curve_name(nid);
++ if (key == NULL) {
++ _setSSLError(NULL, 0, __FILE__, __LINE__);
++ return NULL;
++ }
++ SSL_CTX_set_tmp_ecdh(self->ctx, key);
++ EC_KEY_free(key);
++ Py_RETURN_NONE;
++}
++#endif
++
++#if HAVE_SNI && !defined(OPENSSL_NO_TLSEXT)
++static int
++_servername_callback(SSL *s, int *al, void *args)
++{
++ int ret;
++ PySSLContext *ssl_ctx = (PySSLContext *) args;
++ PySSLSocket *ssl;
++ PyObject *servername_o;
++ PyObject *servername_idna;
++ PyObject *result;
++ /* The high-level ssl.SSLSocket object */
++ PyObject *ssl_socket;
++ const char *servername = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name);
++#ifdef WITH_THREAD
++ PyGILState_STATE gstate = PyGILState_Ensure();
++#endif
++
++ if (ssl_ctx->set_hostname == NULL) {
++ /* remove race condition in this the call back while if removing the
++ * callback is in progress */
++#ifdef WITH_THREAD
++ PyGILState_Release(gstate);
++#endif
++ return SSL_TLSEXT_ERR_OK;
++ }
++
++ ssl = SSL_get_app_data(s);
++ assert(PySSLSocket_Check(ssl));
++ ssl_socket = PyWeakref_GetObject(ssl->ssl_sock);
++ Py_INCREF(ssl_socket);
++ if (ssl_socket == Py_None) {
++ goto error;
++ }
++
++ if (servername == NULL) {
++ result = PyObject_CallFunctionObjArgs(ssl_ctx->set_hostname, ssl_socket,
++ Py_None, ssl_ctx, NULL);
++ }
++ else {
++ servername_o = PyBytes_FromString(servername);
++ if (servername_o == NULL) {
++ PyErr_WriteUnraisable((PyObject *) ssl_ctx);
++ goto error;
++ }
++ servername_idna = PyUnicode_FromEncodedObject(servername_o, "idna",
NULL);
++ if (servername_idna == NULL) {
++ PyErr_WriteUnraisable(servername_o);
++ Py_DECREF(servername_o);
++ goto error;
++ }
++ Py_DECREF(servername_o);
++ result = PyObject_CallFunctionObjArgs(ssl_ctx->set_hostname, ssl_socket,
++ servername_idna, ssl_ctx, NULL);
++ Py_DECREF(servername_idna);
++ }
++ Py_DECREF(ssl_socket);
++
++ if (result == NULL) {
++ PyErr_WriteUnraisable(ssl_ctx->set_hostname);
++ *al = SSL_AD_HANDSHAKE_FAILURE;
++ ret = SSL_TLSEXT_ERR_ALERT_FATAL;
++ }
++ else {
++ if (result != Py_None) {
++ *al = (int) PyLong_AsLong(result);
++ if (PyErr_Occurred()) {
++ PyErr_WriteUnraisable(result);
++ *al = SSL_AD_INTERNAL_ERROR;
++ }
++ ret = SSL_TLSEXT_ERR_ALERT_FATAL;
++ }
++ else {
++ ret = SSL_TLSEXT_ERR_OK;
++ }
++ Py_DECREF(result);
++ }
++
++#ifdef WITH_THREAD
++ PyGILState_Release(gstate);
++#endif
++ return ret;
++
++error:
++ Py_DECREF(ssl_socket);
++ *al = SSL_AD_INTERNAL_ERROR;
++ ret = SSL_TLSEXT_ERR_ALERT_FATAL;
++#ifdef WITH_THREAD
++ PyGILState_Release(gstate);
++#endif
++ return ret;
++}
++#endif
++
++PyDoc_STRVAR(PySSL_set_servername_callback_doc,
++"set_servername_callback(method)\n\
++\n\
++This sets a callback that will be called when a server name is provided by\n\
++the SSL/TLS client in the SNI extension.\n\
++\n\
++If the argument is None then the callback is disabled. The method is called\n\
++with the SSLSocket, the server name as a string, and the SSLContext object.\n\
++See RFC 6066 for details of the SNI extension.");
++
++static PyObject *
++set_servername_callback(PySSLContext *self, PyObject *args)
++{
++#if HAVE_SNI && !defined(OPENSSL_NO_TLSEXT)
++ PyObject *cb;
++
++ if (!PyArg_ParseTuple(args, "O", &cb))
++ return NULL;
++
++ Py_CLEAR(self->set_hostname);
++ if (cb == Py_None) {
++ SSL_CTX_set_tlsext_servername_callback(self->ctx, NULL);
++ }
++ else {
++ if (!PyCallable_Check(cb)) {
++ SSL_CTX_set_tlsext_servername_callback(self->ctx, NULL);
++ PyErr_SetString(PyExc_TypeError,
++ "not a callable object");
++ return NULL;
++ }
++ Py_INCREF(cb);
++ self->set_hostname = cb;
++ SSL_CTX_set_tlsext_servername_callback(self->ctx, _servername_callback);
++ SSL_CTX_set_tlsext_servername_arg(self->ctx, self);
++ }
++ Py_RETURN_NONE;
++#else
++ PyErr_SetString(PyExc_NotImplementedError,
++ "The TLS extension servername callback, "
++ "SSL_CTX_set_tlsext_servername_callback, "
++ "is not in the current OpenSSL library.");
++ return NULL;
++#endif
++}
++
++PyDoc_STRVAR(PySSL_get_stats_doc,
++"cert_store_stats() -> {'crl': int, 'x509_ca': int,
'x509': int}\n\
++\n\
++Returns quantities of loaded X.509 certificates. X.509 certificates with a\n\
++CA extension and certificate revocation lists inside the context's cert\n\
++store.\n\
++NOTE: Certificates in a capath directory aren't loaded unless they have\n\
++been used at least once.");
++
++static PyObject *
++cert_store_stats(PySSLContext *self)
++{
++ X509_STORE *store;
++ X509_OBJECT *obj;
++ int x509 = 0, crl = 0, pkey = 0, ca = 0, i;
++
++ store = SSL_CTX_get_cert_store(self->ctx);
++ for (i = 0; i < sk_X509_OBJECT_num(store->objs); i++) {
++ obj = sk_X509_OBJECT_value(store->objs, i);
++ switch (obj->type) {
++ case X509_LU_X509:
++ x509++;
++ if (X509_check_ca(obj->data.x509)) {
++ ca++;
++ }
++ break;
++ case X509_LU_CRL:
++ crl++;
++ break;
++ case X509_LU_PKEY:
++ pkey++;
++ break;
++ default:
++ /* Ignore X509_LU_FAIL, X509_LU_RETRY, X509_LU_PKEY.
++ * As far as I can tell they are internal states and never
++ * stored in a cert store */
++ break;
++ }
++ }
++ return Py_BuildValue("{sisisi}", "x509", x509, "crl",
crl,
++ "x509_ca", ca);
++}
++
++PyDoc_STRVAR(PySSL_get_ca_certs_doc,
++"get_ca_certs(binary_form=False) -> list of loaded certificate\n\
++\n\
++Returns a list of dicts with information of loaded CA certs. If the\n\
++optional argument is True, returns a DER-encoded copy of the CA certificate.\n\
++NOTE: Certificates in a capath directory aren't loaded unless they have\n\
++been used at least once.");
++
++static PyObject *
++get_ca_certs(PySSLContext *self, PyObject *args, PyObject *kwds)
++{
++ char *kwlist[] = {"binary_form", NULL};
++ X509_STORE *store;
++ PyObject *ci = NULL, *rlist = NULL, *py_binary_mode = Py_False;
++ int i;
++ int binary_mode = 0;
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O:get_ca_certs",
++ kwlist, &py_binary_mode)) {
++ return NULL;
++ }
++ binary_mode = PyObject_IsTrue(py_binary_mode);
++ if (binary_mode < 0) {
++ return NULL;
++ }
++
++ if ((rlist = PyList_New(0)) == NULL) {
++ return NULL;
++ }
++
++ store = SSL_CTX_get_cert_store(self->ctx);
++ for (i = 0; i < sk_X509_OBJECT_num(store->objs); i++) {
++ X509_OBJECT *obj;
++ X509 *cert;
++
++ obj = sk_X509_OBJECT_value(store->objs, i);
++ if (obj->type != X509_LU_X509) {
++ /* not a x509 cert */
++ continue;
++ }
++ /* CA for any purpose */
++ cert = obj->data.x509;
++ if (!X509_check_ca(cert)) {
++ continue;
++ }
++ if (binary_mode) {
++ ci = _certificate_to_der(cert);
++ } else {
++ ci = _decode_certificate(cert);
++ }
++ if (ci == NULL) {
++ goto error;
++ }
++ if (PyList_Append(rlist, ci) == -1) {
++ goto error;
++ }
++ Py_CLEAR(ci);
++ }
++ return rlist;
++
++ error:
++ Py_XDECREF(ci);
++ Py_XDECREF(rlist);
++ return NULL;
++}
++
++
++static PyGetSetDef context_getsetlist[] = {
++ {"check_hostname", (getter) get_check_hostname,
++ (setter) set_check_hostname, NULL},
++ {"options", (getter) get_options,
++ (setter) set_options, NULL},
++#ifdef HAVE_OPENSSL_VERIFY_PARAM
++ {"verify_flags", (getter) get_verify_flags,
++ (setter) set_verify_flags, NULL},
++#endif
++ {"verify_mode", (getter) get_verify_mode,
++ (setter) set_verify_mode, NULL},
++ {NULL}, /* sentinel */
++};
++
++static struct PyMethodDef context_methods[] = {
++ {"_wrap_socket", (PyCFunction) context_wrap_socket,
++ METH_VARARGS | METH_KEYWORDS, NULL},
++ {"set_ciphers", (PyCFunction) set_ciphers,
++ METH_VARARGS, NULL},
++ {"_set_npn_protocols", (PyCFunction) _set_npn_protocols,
++ METH_VARARGS, NULL},
++ {"load_cert_chain", (PyCFunction) load_cert_chain,
++ METH_VARARGS | METH_KEYWORDS, NULL},
++ {"load_dh_params", (PyCFunction) load_dh_params,
++ METH_O, NULL},
++ {"load_verify_locations", (PyCFunction) load_verify_locations,
++ METH_VARARGS | METH_KEYWORDS, NULL},
++ {"session_stats", (PyCFunction) session_stats,
++ METH_NOARGS, NULL},
++ {"set_default_verify_paths", (PyCFunction) set_default_verify_paths,
++ METH_NOARGS, NULL},
++#ifndef OPENSSL_NO_ECDH
++ {"set_ecdh_curve", (PyCFunction) set_ecdh_curve,
++ METH_O, NULL},
++#endif
++ {"set_servername_callback", (PyCFunction) set_servername_callback,
++ METH_VARARGS, PySSL_set_servername_callback_doc},
++ {"cert_store_stats", (PyCFunction) cert_store_stats,
++ METH_NOARGS, PySSL_get_stats_doc},
++ {"get_ca_certs", (PyCFunction) get_ca_certs,
++ METH_VARARGS | METH_KEYWORDS, PySSL_get_ca_certs_doc},
++ {NULL, NULL} /* sentinel */
++};
++
++static PyTypeObject PySSLContext_Type = {
++ PyVarObject_HEAD_INIT(NULL, 0)
++ "_ssl._SSLContext", /*tp_name*/
++ sizeof(PySSLContext), /*tp_basicsize*/
++ 0, /*tp_itemsize*/
++ (destructor)context_dealloc, /*tp_dealloc*/
++ 0, /*tp_print*/
++ 0, /*tp_getattr*/
++ 0, /*tp_setattr*/
++ 0, /*tp_reserved*/
++ 0, /*tp_repr*/
++ 0, /*tp_as_number*/
++ 0, /*tp_as_sequence*/
++ 0, /*tp_as_mapping*/
++ 0, /*tp_hash*/
++ 0, /*tp_call*/
++ 0, /*tp_str*/
++ 0, /*tp_getattro*/
++ 0, /*tp_setattro*/
++ 0, /*tp_as_buffer*/
++ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /*tp_flags*/
++ 0, /*tp_doc*/
++ (traverseproc) context_traverse, /*tp_traverse*/
++ (inquiry) context_clear, /*tp_clear*/
++ 0, /*tp_richcompare*/
++ 0, /*tp_weaklistoffset*/
++ 0, /*tp_iter*/
++ 0, /*tp_iternext*/
++ context_methods, /*tp_methods*/
++ 0, /*tp_members*/
++ context_getsetlist, /*tp_getset*/
++ 0, /*tp_base*/
++ 0, /*tp_dict*/
++ 0, /*tp_descr_get*/
++ 0, /*tp_descr_set*/
++ 0, /*tp_dictoffset*/
++ 0, /*tp_init*/
++ 0, /*tp_alloc*/
++ context_new, /*tp_new*/
++};
++
++
++
++#ifdef HAVE_OPENSSL_RAND
++
++/* helper routines for seeding the SSL PRNG */
++static PyObject *
++PySSL_RAND_add(PyObject *self, PyObject *args)
++{
++ char *buf;
++ Py_ssize_t len, written;
++ double entropy;
++
++ if (!PyArg_ParseTuple(args, "s#d:RAND_add", &buf, &len,
&entropy))
++ return NULL;
++ do {
++ if (len >= INT_MAX) {
++ written = INT_MAX;
++ } else {
++ written = len;
++ }
++ RAND_add(buf, (int)written, entropy);
++ buf += written;
++ len -= written;
++ } while (len);
++ Py_INCREF(Py_None);
++ return Py_None;
++}
++
++PyDoc_STRVAR(PySSL_RAND_add_doc,
++"RAND_add(string, entropy)\n\
++\n\
++Mix string into the OpenSSL PRNG state. entropy (a float) is a lower\n\
++bound on the entropy contained in string. See RFC 1750.");
++
++static PyObject *
++PySSL_RAND_status(PyObject *self)
++{
++ return PyLong_FromLong(RAND_status());
+ }
+
+ PyDoc_STRVAR(PySSL_RAND_status_doc,
+@@ -1630,21 +3281,413 @@ fails or if it does not provide enough data to seed
PRNG.");
+ #endif /* HAVE_OPENSSL_RAND */
+
+
++PyDoc_STRVAR(PySSL_get_default_verify_paths_doc,
++"get_default_verify_paths() -> tuple\n\
++\n\
++Return search paths and environment vars that are used by SSLContext's\n\
++set_default_verify_paths() to load default CAs. The values are\n\
++'cert_file_env', 'cert_file', 'cert_dir_env',
'cert_dir'.");
++
++static PyObject *
++PySSL_get_default_verify_paths(PyObject *self)
++{
++ PyObject *ofile_env = NULL;
++ PyObject *ofile = NULL;
++ PyObject *odir_env = NULL;
++ PyObject *odir = NULL;
++
++#define convert(info, target) { \
++ const char *tmp = (info); \
++ target = NULL; \
++ if (!tmp) { Py_INCREF(Py_None); target = Py_None; } \
++ else { target = PyBytes_FromString(tmp); } \
++ if (!target) goto error; \
++ } while(0)
++
++ convert(X509_get_default_cert_file_env(), ofile_env);
++ convert(X509_get_default_cert_file(), ofile);
++ convert(X509_get_default_cert_dir_env(), odir_env);
++ convert(X509_get_default_cert_dir(), odir);
++#undef convert
++
++ return Py_BuildValue("NNNN", ofile_env, ofile, odir_env, odir);
++
++ error:
++ Py_XDECREF(ofile_env);
++ Py_XDECREF(ofile);
++ Py_XDECREF(odir_env);
++ Py_XDECREF(odir);
++ return NULL;
++}
++
++static PyObject*
++asn1obj2py(ASN1_OBJECT *obj)
++{
++ int nid;
++ const char *ln, *sn;
++ char buf[100];
++ Py_ssize_t buflen;
++
++ nid = OBJ_obj2nid(obj);
++ if (nid == NID_undef) {
++ PyErr_Format(PyExc_ValueError, "Unknown object");
++ return NULL;
++ }
++ sn = OBJ_nid2sn(nid);
++ ln = OBJ_nid2ln(nid);
++ buflen = OBJ_obj2txt(buf, sizeof(buf), obj, 1);
++ if (buflen < 0) {
++ _setSSLError(NULL, 0, __FILE__, __LINE__);
++ return NULL;
++ }
++ if (buflen) {
++ return Py_BuildValue("isss#", nid, sn, ln, buf, buflen);
++ } else {
++ return Py_BuildValue("issO", nid, sn, ln, Py_None);
++ }
++}
++
++PyDoc_STRVAR(PySSL_txt2obj_doc,
++"txt2obj(txt, name=False) -> (nid, shortname, longname, oid)\n\
++\n\
++Lookup NID, short name, long name and OID of an ASN1_OBJECT. By default\n\
++objects are looked up by OID. With name=True short and long name are also\n\
++matched.");
++
++static PyObject*
++PySSL_txt2obj(PyObject *self, PyObject *args, PyObject *kwds)
++{
++ char *kwlist[] = {"txt", "name", NULL};
++ PyObject *result = NULL;
++ char *txt;
++ PyObject *pyname = Py_None;
++ int name = 0;
++ ASN1_OBJECT *obj;
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|O:txt2obj",
++ kwlist, &txt, &pyname)) {
++ return NULL;
++ }
++ name = PyObject_IsTrue(pyname);
++ if (name < 0)
++ return NULL;
++ obj = OBJ_txt2obj(txt, name ? 0 : 1);
++ if (obj == NULL) {
++ PyErr_Format(PyExc_ValueError, "unknown object '%.100s'",
txt);
++ return NULL;
++ }
++ result = asn1obj2py(obj);
++ ASN1_OBJECT_free(obj);
++ return result;
++}
++
++PyDoc_STRVAR(PySSL_nid2obj_doc,
++"nid2obj(nid) -> (nid, shortname, longname, oid)\n\
++\n\
++Lookup NID, short name, long name and OID of an ASN1_OBJECT by NID.");
++
++static PyObject*
++PySSL_nid2obj(PyObject *self, PyObject *args)
++{
++ PyObject *result = NULL;
++ int nid;
++ ASN1_OBJECT *obj;
++
++ if (!PyArg_ParseTuple(args, "i:nid2obj", &nid)) {
++ return NULL;
++ }
++ if (nid < NID_undef) {
++ PyErr_SetString(PyExc_ValueError, "NID must be positive.");
++ return NULL;
++ }
++ obj = OBJ_nid2obj(nid);
++ if (obj == NULL) {
++ PyErr_Format(PyExc_ValueError, "unknown NID %i", nid);
++ return NULL;
++ }
++ result = asn1obj2py(obj);
++ ASN1_OBJECT_free(obj);
++ return result;
++}
++
++#ifdef _MSC_VER
++
++static PyObject*
++certEncodingType(DWORD encodingType)
++{
++ static PyObject *x509_asn = NULL;
++ static PyObject *pkcs_7_asn = NULL;
++
++ if (x509_asn == NULL) {
++ x509_asn = PyUnicode_InternFromString("x509_asn");
++ if (x509_asn == NULL)
++ return NULL;
++ }
++ if (pkcs_7_asn == NULL) {
++ pkcs_7_asn = PyUnicode_InternFromString("pkcs_7_asn");
++ if (pkcs_7_asn == NULL)
++ return NULL;
++ }
++ switch(encodingType) {
++ case X509_ASN_ENCODING:
++ Py_INCREF(x509_asn);
++ return x509_asn;
++ case PKCS_7_ASN_ENCODING:
++ Py_INCREF(pkcs_7_asn);
++ return pkcs_7_asn;
++ default:
++ return PyLong_FromLong(encodingType);
++ }
++}
++
++static PyObject*
++parseKeyUsage(PCCERT_CONTEXT pCertCtx, DWORD flags)
++{
++ CERT_ENHKEY_USAGE *usage;
++ DWORD size, error, i;
++ PyObject *retval;
++
++ if (!CertGetEnhancedKeyUsage(pCertCtx, flags, NULL, &size)) {
++ error = GetLastError();
++ if (error == CRYPT_E_NOT_FOUND) {
++ Py_RETURN_TRUE;
++ }
++ return PyErr_SetFromWindowsErr(error);
++ }
++
++ usage = (CERT_ENHKEY_USAGE*)PyMem_Malloc(size);
++ if (usage == NULL) {
++ return PyErr_NoMemory();
++ }
++
++ /* Now get the actual enhanced usage property */
++ if (!CertGetEnhancedKeyUsage(pCertCtx, flags, usage, &size)) {
++ PyMem_Free(usage);
++ error = GetLastError();
++ if (error == CRYPT_E_NOT_FOUND) {
++ Py_RETURN_TRUE;
++ }
++ return PyErr_SetFromWindowsErr(error);
++ }
++ retval = PySet_New(NULL);
++ if (retval == NULL) {
++ goto error;
++ }
++ for (i = 0; i < usage->cUsageIdentifier; ++i) {
++ if (usage->rgpszUsageIdentifier[i]) {
++ PyObject *oid;
++ int err;
++ oid = PyUnicode_FromString(usage->rgpszUsageIdentifier[i]);
++ if (oid == NULL) {
++ Py_CLEAR(retval);
++ goto error;
++ }
++ err = PySet_Add(retval, oid);
++ Py_DECREF(oid);
++ if (err == -1) {
++ Py_CLEAR(retval);
++ goto error;
++ }
++ }
++ }
++ error:
++ PyMem_Free(usage);
++ return retval;
++}
++
++PyDoc_STRVAR(PySSL_enum_certificates_doc,
++"enum_certificates(store_name) -> []\n\
++\n\
++Retrieve certificates from Windows' cert store. store_name may be one of\n\
++'CA', 'ROOT' or 'MY'. The system may provide more cert storages,
too.\n\
++The function returns a list of (bytes, encoding_type, trust) tuples. The\n\
++encoding_type flag can be interpreted with X509_ASN_ENCODING or\n\
++PKCS_7_ASN_ENCODING. The trust setting is either a set of OIDs or the\n\
++boolean True.");
++
++static PyObject *
++PySSL_enum_certificates(PyObject *self, PyObject *args, PyObject *kwds)
++{
++ char *kwlist[] = {"store_name", NULL};
++ char *store_name;
++ HCERTSTORE hStore = NULL;
++ PCCERT_CONTEXT pCertCtx = NULL;
++ PyObject *keyusage = NULL, *cert = NULL, *enc = NULL, *tup = NULL;
++ PyObject *result = NULL;
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|s:enum_certificates",
++ kwlist, &store_name)) {
++ return NULL;
++ }
++ result = PyList_New(0);
++ if (result == NULL) {
++ return NULL;
++ }
++ hStore = CertOpenSystemStore((HCRYPTPROV)NULL, store_name);
++ if (hStore == NULL) {
++ Py_DECREF(result);
++ return PyErr_SetFromWindowsErr(GetLastError());
++ }
++
++ while (pCertCtx = CertEnumCertificatesInStore(hStore, pCertCtx)) {
++ cert = PyBytes_FromStringAndSize((const char*)pCertCtx->pbCertEncoded,
++ pCertCtx->cbCertEncoded);
++ if (!cert) {
++ Py_CLEAR(result);
++ break;
++ }
++ if ((enc = certEncodingType(pCertCtx->dwCertEncodingType)) == NULL) {
++ Py_CLEAR(result);
++ break;
++ }
++ keyusage = parseKeyUsage(pCertCtx, CERT_FIND_PROP_ONLY_ENHKEY_USAGE_FLAG);
++ if (keyusage == Py_True) {
++ Py_DECREF(keyusage);
++ keyusage = parseKeyUsage(pCertCtx, CERT_FIND_EXT_ONLY_ENHKEY_USAGE_FLAG);
++ }
++ if (keyusage == NULL) {
++ Py_CLEAR(result);
++ break;
++ }
++ if ((tup = PyTuple_New(3)) == NULL) {
++ Py_CLEAR(result);
++ break;
++ }
++ PyTuple_SET_ITEM(tup, 0, cert);
++ cert = NULL;
++ PyTuple_SET_ITEM(tup, 1, enc);
++ enc = NULL;
++ PyTuple_SET_ITEM(tup, 2, keyusage);
++ keyusage = NULL;
++ if (PyList_Append(result, tup) < 0) {
++ Py_CLEAR(result);
++ break;
++ }
++ Py_CLEAR(tup);
++ }
++ if (pCertCtx) {
++ /* loop ended with an error, need to clean up context manually */
++ CertFreeCertificateContext(pCertCtx);
++ }
++
++ /* In error cases cert, enc and tup may not be NULL */
++ Py_XDECREF(cert);
++ Py_XDECREF(enc);
++ Py_XDECREF(keyusage);
++ Py_XDECREF(tup);
++
++ if (!CertCloseStore(hStore, 0)) {
++ /* This error case might shadow another exception.*/
++ Py_XDECREF(result);
++ return PyErr_SetFromWindowsErr(GetLastError());
++ }
++ return result;
++}
++
++PyDoc_STRVAR(PySSL_enum_crls_doc,
++"enum_crls(store_name) -> []\n\
++\n\
++Retrieve CRLs from Windows' cert store. store_name may be one of\n\
++'CA', 'ROOT' or 'MY'. The system may provide more cert storages,
too.\n\
++The function returns a list of (bytes, encoding_type) tuples. The\n\
++encoding_type flag can be interpreted with X509_ASN_ENCODING or\n\
++PKCS_7_ASN_ENCODING.");
++
++static PyObject *
++PySSL_enum_crls(PyObject *self, PyObject *args, PyObject *kwds)
++{
++ char *kwlist[] = {"store_name", NULL};
++ char *store_name;
++ HCERTSTORE hStore = NULL;
++ PCCRL_CONTEXT pCrlCtx = NULL;
++ PyObject *crl = NULL, *enc = NULL, *tup = NULL;
++ PyObject *result = NULL;
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|s:enum_crls",
++ kwlist, &store_name)) {
++ return NULL;
++ }
++ result = PyList_New(0);
++ if (result == NULL) {
++ return NULL;
++ }
++ hStore = CertOpenSystemStore((HCRYPTPROV)NULL, store_name);
++ if (hStore == NULL) {
++ Py_DECREF(result);
++ return PyErr_SetFromWindowsErr(GetLastError());
++ }
++
++ while (pCrlCtx = CertEnumCRLsInStore(hStore, pCrlCtx)) {
++ crl = PyBytes_FromStringAndSize((const char*)pCrlCtx->pbCrlEncoded,
++ pCrlCtx->cbCrlEncoded);
++ if (!crl) {
++ Py_CLEAR(result);
++ break;
++ }
++ if ((enc = certEncodingType(pCrlCtx->dwCertEncodingType)) == NULL) {
++ Py_CLEAR(result);
++ break;
++ }
++ if ((tup = PyTuple_New(2)) == NULL) {
++ Py_CLEAR(result);
++ break;
++ }
++ PyTuple_SET_ITEM(tup, 0, crl);
++ crl = NULL;
++ PyTuple_SET_ITEM(tup, 1, enc);
++ enc = NULL;
++
++ if (PyList_Append(result, tup) < 0) {
++ Py_CLEAR(result);
++ break;
++ }
++ Py_CLEAR(tup);
++ }
++ if (pCrlCtx) {
++ /* loop ended with an error, need to clean up context manually */
++ CertFreeCRLContext(pCrlCtx);
++ }
++
++ /* In error cases cert, enc and tup may not be NULL */
++ Py_XDECREF(crl);
++ Py_XDECREF(enc);
++ Py_XDECREF(tup);
++
++ if (!CertCloseStore(hStore, 0)) {
++ /* This error case might shadow another exception.*/
++ Py_XDECREF(result);
++ return PyErr_SetFromWindowsErr(GetLastError());
++ }
++ return result;
++}
++
++#endif /* _MSC_VER */
++
+ /* List of functions exported by this module. */
+
+ static PyMethodDef PySSL_methods[] = {
+- {"sslwrap", PySSL_sslwrap,
+- METH_VARARGS, ssl_doc},
+ {"_test_decode_cert", PySSL_test_decode_certificate,
+ METH_VARARGS},
+ #ifdef HAVE_OPENSSL_RAND
+ {"RAND_add", PySSL_RAND_add, METH_VARARGS,
+ PySSL_RAND_add_doc},
+- {"RAND_egd", PySSL_RAND_egd, METH_O,
++ {"RAND_egd", PySSL_RAND_egd, METH_VARARGS,
+ PySSL_RAND_egd_doc},
+ {"RAND_status", (PyCFunction)PySSL_RAND_status, METH_NOARGS,
+ PySSL_RAND_status_doc},
+ #endif
++ {"get_default_verify_paths", (PyCFunction)PySSL_get_default_verify_paths,
++ METH_NOARGS, PySSL_get_default_verify_paths_doc},
++#ifdef _MSC_VER
++ {"enum_certificates", (PyCFunction)PySSL_enum_certificates,
++ METH_VARARGS | METH_KEYWORDS, PySSL_enum_certificates_doc},
++ {"enum_crls", (PyCFunction)PySSL_enum_crls,
++ METH_VARARGS | METH_KEYWORDS, PySSL_enum_crls_doc},
++#endif
++ {"txt2obj", (PyCFunction)PySSL_txt2obj,
++ METH_VARARGS | METH_KEYWORDS, PySSL_txt2obj_doc},
++ {"nid2obj", (PyCFunction)PySSL_nid2obj,
++ METH_VARARGS, PySSL_nid2obj_doc},
+ {NULL, NULL} /* Sentinel */
+ };
+
+@@ -1672,16 +3715,17 @@ _ssl_thread_id_function (void) {
+ }
+ #endif
+
+-static void _ssl_thread_locking_function (int mode, int n, const char *file, int line)
{
++static void _ssl_thread_locking_function
++ (int mode, int n, const char *file, int line) {
+ /* this function is needed to perform locking on shared data
+ structures. (Note that OpenSSL uses a number of global data
+- structures that will be implicitly shared whenever multiple threads
+- use OpenSSL.) Multi-threaded applications will crash at random if
+- it is not set.
++ structures that will be implicitly shared whenever multiple
++ threads use OpenSSL.) Multi-threaded applications will
++ crash at random if it is not set.
+
+- locking_function() must be able to handle up to CRYPTO_num_locks()
+- different mutex locks. It sets the n-th lock if mode & CRYPTO_LOCK, and
+- releases it otherwise.
++ locking_function() must be able to handle up to
++ CRYPTO_num_locks() different mutex locks. It sets the n-th
++ lock if mode & CRYPTO_LOCK, and releases it otherwise.
+
+ file and line are the file number of the function setting the
+ lock. They can be useful for debugging.
+@@ -1705,10 +3749,11 @@ static int _setup_ssl_threads(void) {
+ if (_ssl_locks == NULL) {
+ _ssl_locks_count = CRYPTO_num_locks();
+ _ssl_locks = (PyThread_type_lock *)
+- malloc(sizeof(PyThread_type_lock) * _ssl_locks_count);
++ PyMem_Malloc(sizeof(PyThread_type_lock) * _ssl_locks_count);
+ if (_ssl_locks == NULL)
+ return 0;
+- memset(_ssl_locks, 0, sizeof(PyThread_type_lock) * _ssl_locks_count);
++ memset(_ssl_locks, 0,
++ sizeof(PyThread_type_lock) * _ssl_locks_count);
+ for (i = 0; i < _ssl_locks_count; i++) {
+ _ssl_locks[i] = PyThread_allocate_lock();
+ if (_ssl_locks[i] == NULL) {
+@@ -1716,7 +3761,7 @@ static int _setup_ssl_threads(void) {
+ for (j = 0; j < i; j++) {
+ PyThread_free_lock(_ssl_locks[j]);
+ }
+- free(_ssl_locks);
++ PyMem_Free(_ssl_locks);
+ return 0;
+ }
+ }
+@@ -1736,14 +3781,39 @@ PyDoc_STRVAR(module_doc,
+ "Implementation module for SSL socket operations. See the socket module\n\
+ for documentation.");
+
++
++
++
++static void
++parse_openssl_version(unsigned long libver,
++ unsigned int *major, unsigned int *minor,
++ unsigned int *fix, unsigned int *patch,
++ unsigned int *status)
++{
++ *status = libver & 0xF;
++ libver >>= 4;
++ *patch = libver & 0xFF;
++ libver >>= 8;
++ *fix = libver & 0xFF;
++ libver >>= 8;
++ *minor = libver & 0xFF;
++ libver >>= 8;
++ *major = libver & 0xFF;
++}
++
+ PyMODINIT_FUNC
+ init_ssl(void)
+ {
+ PyObject *m, *d, *r;
+ unsigned long libver;
+ unsigned int major, minor, fix, patch, status;
++ struct py_ssl_error_code *errcode;
++ struct py_ssl_library_code *libcode;
+
+- Py_TYPE(&PySSL_Type) = &PyType_Type;
++ if (PyType_Ready(&PySSLContext_Type) < 0)
++ return;
++ if (PyType_Ready(&PySSLSocket_Type) < 0)
++ return;
+
+ m = Py_InitModule3("_ssl", PySSL_methods, module_doc);
+ if (m == NULL)
+@@ -1766,15 +3836,53 @@ init_ssl(void)
+ OpenSSL_add_all_algorithms();
+
+ /* Add symbols to module dict */
+- PySSLErrorObject = PyErr_NewException("ssl.SSLError",
+- PySocketModule.error,
+- NULL);
++ PySSLErrorObject = PyErr_NewExceptionWithDoc(
++ "ssl.SSLError", SSLError_doc,
++ PySocketModule.error, NULL);
+ if (PySSLErrorObject == NULL)
+ return;
+- if (PyDict_SetItemString(d, "SSLError", PySSLErrorObject) != 0)
++ ((PyTypeObject *)PySSLErrorObject)->tp_str = (reprfunc)SSLError_str;
++
++ PySSLZeroReturnErrorObject = PyErr_NewExceptionWithDoc(
++ "ssl.SSLZeroReturnError", SSLZeroReturnError_doc,
++ PySSLErrorObject, NULL);
++ PySSLWantReadErrorObject = PyErr_NewExceptionWithDoc(
++ "ssl.SSLWantReadError", SSLWantReadError_doc,
++ PySSLErrorObject, NULL);
++ PySSLWantWriteErrorObject = PyErr_NewExceptionWithDoc(
++ "ssl.SSLWantWriteError", SSLWantWriteError_doc,
++ PySSLErrorObject, NULL);
++ PySSLSyscallErrorObject = PyErr_NewExceptionWithDoc(
++ "ssl.SSLSyscallError", SSLSyscallError_doc,
++ PySSLErrorObject, NULL);
++ PySSLEOFErrorObject = PyErr_NewExceptionWithDoc(
++ "ssl.SSLEOFError", SSLEOFError_doc,
++ PySSLErrorObject, NULL);
++ if (PySSLZeroReturnErrorObject == NULL
++ || PySSLWantReadErrorObject == NULL
++ || PySSLWantWriteErrorObject == NULL
++ || PySSLSyscallErrorObject == NULL
++ || PySSLEOFErrorObject == NULL)
++ return;
++
++ ((PyTypeObject *)PySSLZeroReturnErrorObject)->tp_str = (reprfunc)SSLError_str;
++ ((PyTypeObject *)PySSLWantReadErrorObject)->tp_str = (reprfunc)SSLError_str;
++ ((PyTypeObject *)PySSLWantWriteErrorObject)->tp_str = (reprfunc)SSLError_str;
++ ((PyTypeObject *)PySSLSyscallErrorObject)->tp_str = (reprfunc)SSLError_str;
++ ((PyTypeObject *)PySSLEOFErrorObject)->tp_str = (reprfunc)SSLError_str;
++
++ if (PyDict_SetItemString(d, "SSLError", PySSLErrorObject) != 0
++ || PyDict_SetItemString(d, "SSLZeroReturnError",
PySSLZeroReturnErrorObject) != 0
++ || PyDict_SetItemString(d, "SSLWantReadError",
PySSLWantReadErrorObject) != 0
++ || PyDict_SetItemString(d, "SSLWantWriteError",
PySSLWantWriteErrorObject) != 0
++ || PyDict_SetItemString(d, "SSLSyscallError", PySSLSyscallErrorObject)
!= 0
++ || PyDict_SetItemString(d, "SSLEOFError", PySSLEOFErrorObject) != 0)
++ return;
++ if (PyDict_SetItemString(d, "_SSLContext",
++ (PyObject *)&PySSLContext_Type) != 0)
+ return;
+- if (PyDict_SetItemString(d, "SSLType",
+- (PyObject *)&PySSL_Type) != 0)
++ if (PyDict_SetItemString(d, "_SSLSocket",
++ (PyObject *)&PySSLSocket_Type) != 0)
+ return;
+ PyModule_AddIntConstant(m, "SSL_ERROR_ZERO_RETURN",
+ PY_SSL_ERROR_ZERO_RETURN);
+@@ -1802,6 +3910,66 @@ init_ssl(void)
+ PY_SSL_CERT_OPTIONAL);
+ PyModule_AddIntConstant(m, "CERT_REQUIRED",
+ PY_SSL_CERT_REQUIRED);
++ /* CRL verification for verification_flags */
++ PyModule_AddIntConstant(m, "VERIFY_DEFAULT",
++ 0);
++ PyModule_AddIntConstant(m, "VERIFY_CRL_CHECK_LEAF",
++ X509_V_FLAG_CRL_CHECK);
++ PyModule_AddIntConstant(m, "VERIFY_CRL_CHECK_CHAIN",
++ X509_V_FLAG_CRL_CHECK|X509_V_FLAG_CRL_CHECK_ALL);
++ PyModule_AddIntConstant(m, "VERIFY_X509_STRICT",
++ X509_V_FLAG_X509_STRICT);
++
++ /* Alert Descriptions from ssl.h */
++ /* note RESERVED constants no longer intended for use have been removed */
++ /*
http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-par... */
++
++#define ADD_AD_CONSTANT(s) \
++ PyModule_AddIntConstant(m, "ALERT_DESCRIPTION_"#s, \
++ SSL_AD_##s)
++
++ ADD_AD_CONSTANT(CLOSE_NOTIFY);
++ ADD_AD_CONSTANT(UNEXPECTED_MESSAGE);
++ ADD_AD_CONSTANT(BAD_RECORD_MAC);
++ ADD_AD_CONSTANT(RECORD_OVERFLOW);
++ ADD_AD_CONSTANT(DECOMPRESSION_FAILURE);
++ ADD_AD_CONSTANT(HANDSHAKE_FAILURE);
++ ADD_AD_CONSTANT(BAD_CERTIFICATE);
++ ADD_AD_CONSTANT(UNSUPPORTED_CERTIFICATE);
++ ADD_AD_CONSTANT(CERTIFICATE_REVOKED);
++ ADD_AD_CONSTANT(CERTIFICATE_EXPIRED);
++ ADD_AD_CONSTANT(CERTIFICATE_UNKNOWN);
++ ADD_AD_CONSTANT(ILLEGAL_PARAMETER);
++ ADD_AD_CONSTANT(UNKNOWN_CA);
++ ADD_AD_CONSTANT(ACCESS_DENIED);
++ ADD_AD_CONSTANT(DECODE_ERROR);
++ ADD_AD_CONSTANT(DECRYPT_ERROR);
++ ADD_AD_CONSTANT(PROTOCOL_VERSION);
++ ADD_AD_CONSTANT(INSUFFICIENT_SECURITY);
++ ADD_AD_CONSTANT(INTERNAL_ERROR);
++ ADD_AD_CONSTANT(USER_CANCELLED);
++ ADD_AD_CONSTANT(NO_RENEGOTIATION);
++ /* Not all constants are in old OpenSSL versions */
++#ifdef SSL_AD_UNSUPPORTED_EXTENSION
++ ADD_AD_CONSTANT(UNSUPPORTED_EXTENSION);
++#endif
++#ifdef SSL_AD_CERTIFICATE_UNOBTAINABLE
++ ADD_AD_CONSTANT(CERTIFICATE_UNOBTAINABLE);
++#endif
++#ifdef SSL_AD_UNRECOGNIZED_NAME
++ ADD_AD_CONSTANT(UNRECOGNIZED_NAME);
++#endif
++#ifdef SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE
++ ADD_AD_CONSTANT(BAD_CERTIFICATE_STATUS_RESPONSE);
++#endif
++#ifdef SSL_AD_BAD_CERTIFICATE_HASH_VALUE
++ ADD_AD_CONSTANT(BAD_CERTIFICATE_HASH_VALUE);
++#endif
++#ifdef SSL_AD_UNKNOWN_PSK_IDENTITY
++ ADD_AD_CONSTANT(UNKNOWN_PSK_IDENTITY);
++#endif
++
++#undef ADD_AD_CONSTANT
+
+ /* protocol versions */
+ #ifndef OPENSSL_NO_SSL2
+@@ -1814,6 +3982,109 @@ init_ssl(void)
+ PY_SSL_VERSION_SSL23);
+ PyModule_AddIntConstant(m, "PROTOCOL_TLSv1",
+ PY_SSL_VERSION_TLS1);
++#if HAVE_TLSv1_2
++ PyModule_AddIntConstant(m, "PROTOCOL_TLSv1_1",
++ PY_SSL_VERSION_TLS1_1);
++ PyModule_AddIntConstant(m, "PROTOCOL_TLSv1_2",
++ PY_SSL_VERSION_TLS1_2);
++#endif
++
++ /* protocol options */
++ PyModule_AddIntConstant(m, "OP_ALL",
++ SSL_OP_ALL & ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS);
++ PyModule_AddIntConstant(m, "OP_NO_SSLv2", SSL_OP_NO_SSLv2);
++ PyModule_AddIntConstant(m, "OP_NO_SSLv3", SSL_OP_NO_SSLv3);
++ PyModule_AddIntConstant(m, "OP_NO_TLSv1", SSL_OP_NO_TLSv1);
++#if HAVE_TLSv1_2
++ PyModule_AddIntConstant(m, "OP_NO_TLSv1_1", SSL_OP_NO_TLSv1_1);
++ PyModule_AddIntConstant(m, "OP_NO_TLSv1_2", SSL_OP_NO_TLSv1_2);
++#endif
++ PyModule_AddIntConstant(m, "OP_CIPHER_SERVER_PREFERENCE",
++ SSL_OP_CIPHER_SERVER_PREFERENCE);
++ PyModule_AddIntConstant(m, "OP_SINGLE_DH_USE", SSL_OP_SINGLE_DH_USE);
++#ifdef SSL_OP_SINGLE_ECDH_USE
++ PyModule_AddIntConstant(m, "OP_SINGLE_ECDH_USE", SSL_OP_SINGLE_ECDH_USE);
++#endif
++#ifdef SSL_OP_NO_COMPRESSION
++ PyModule_AddIntConstant(m, "OP_NO_COMPRESSION",
++ SSL_OP_NO_COMPRESSION);
++#endif
++
++#if HAVE_SNI
++ r = Py_True;
++#else
++ r = Py_False;
++#endif
++ Py_INCREF(r);
++ PyModule_AddObject(m, "HAS_SNI", r);
++
++#if HAVE_OPENSSL_FINISHED
++ r = Py_True;
++#else
++ r = Py_False;
++#endif
++ Py_INCREF(r);
++ PyModule_AddObject(m, "HAS_TLS_UNIQUE", r);
++
++#ifdef OPENSSL_NO_ECDH
++ r = Py_False;
++#else
++ r = Py_True;
++#endif
++ Py_INCREF(r);
++ PyModule_AddObject(m, "HAS_ECDH", r);
++
++#ifdef OPENSSL_NPN_NEGOTIATED
++ r = Py_True;
++#else
++ r = Py_False;
++#endif
++ Py_INCREF(r);
++ PyModule_AddObject(m, "HAS_NPN", r);
++
++ /* Mappings for error codes */
++ err_codes_to_names = PyDict_New();
++ err_names_to_codes = PyDict_New();
++ if (err_codes_to_names == NULL || err_names_to_codes == NULL)
++ return;
++ errcode = error_codes;
++ while (errcode->mnemonic != NULL) {
++ PyObject *mnemo, *key;
++ mnemo = PyUnicode_FromString(errcode->mnemonic);
++ key = Py_BuildValue("ii", errcode->library, errcode->reason);
++ if (mnemo == NULL || key == NULL)
++ return;
++ if (PyDict_SetItem(err_codes_to_names, key, mnemo))
++ return;
++ if (PyDict_SetItem(err_names_to_codes, mnemo, key))
++ return;
++ Py_DECREF(key);
++ Py_DECREF(mnemo);
++ errcode++;
++ }
++ if (PyModule_AddObject(m, "err_codes_to_names", err_codes_to_names))
++ return;
++ if (PyModule_AddObject(m, "err_names_to_codes", err_names_to_codes))
++ return;
++
++ lib_codes_to_names = PyDict_New();
++ if (lib_codes_to_names == NULL)
++ return;
++ libcode = library_codes;
++ while (libcode->library != NULL) {
++ PyObject *mnemo, *key;
++ key = PyLong_FromLong(libcode->code);
++ mnemo = PyUnicode_FromString(libcode->library);
++ if (key == NULL || mnemo == NULL)
++ return;
++ if (PyDict_SetItem(lib_codes_to_names, key, mnemo))
++ return;
++ Py_DECREF(key);
++ Py_DECREF(mnemo);
++ libcode++;
++ }
++ if (PyModule_AddObject(m, "lib_codes_to_names", lib_codes_to_names))
++ return;
+
+ /* OpenSSL version */
+ /* SSLeay() gives us the version of the library linked against,
+@@ -1825,15 +4096,7 @@ init_ssl(void)
+ return;
+ if (PyModule_AddObject(m, "OPENSSL_VERSION_NUMBER", r))
+ return;
+- status = libver & 0xF;
+- libver >>= 4;
+- patch = libver & 0xFF;
+- libver >>= 8;
+- fix = libver & 0xFF;
+- libver >>= 8;
+- minor = libver & 0xFF;
+- libver >>= 8;
+- major = libver & 0xFF;
++ parse_openssl_version(libver, &major, &minor, &fix, &patch,
&status);
+ r = Py_BuildValue("IIIII", major, minor, fix, patch, status);
+ if (r == NULL || PyModule_AddObject(m, "OPENSSL_VERSION_INFO", r))
+ return;
+@@ -1841,4 +4104,9 @@ init_ssl(void)
+ if (r == NULL || PyModule_AddObject(m, "OPENSSL_VERSION", r))
+ return;
+
++ libver = OPENSSL_VERSION_NUMBER;
++ parse_openssl_version(libver, &major, &minor, &fix, &patch,
&status);
++ r = Py_BuildValue("IIIII", major, minor, fix, patch, status);
++ if (r == NULL || PyModule_AddObject(m, "_OPENSSL_API_VERSION", r))
++ return;
+ }
+diff --git a/Modules/_ssl_data.h b/Modules/_ssl_data.h
+new file mode 100644
+index 0000000..81a8d7b
+--- /dev/null
++++ b/Modules/_ssl_data.h
+@@ -0,0 +1,1653 @@
++/* File generated by Tools/ssl/make_ssl_data.py */
++/* Generated on 2012-05-16T23:56:40.981382 */
++
++static struct py_ssl_library_code library_codes[] = {
++ {"PEM", ERR_LIB_PEM},
++ {"SSL", ERR_LIB_SSL},
++ {"X509", ERR_LIB_X509},
++ { NULL }
++};
++
++static struct py_ssl_error_code error_codes[] = {
++ #ifdef PEM_R_BAD_BASE64_DECODE
++ {"BAD_BASE64_DECODE", ERR_LIB_PEM, PEM_R_BAD_BASE64_DECODE},
++ #else
++ {"BAD_BASE64_DECODE", ERR_LIB_PEM, 100},
++ #endif
++ #ifdef PEM_R_BAD_DECRYPT
++ {"BAD_DECRYPT", ERR_LIB_PEM, PEM_R_BAD_DECRYPT},
++ #else
++ {"BAD_DECRYPT", ERR_LIB_PEM, 101},
++ #endif
++ #ifdef PEM_R_BAD_END_LINE
++ {"BAD_END_LINE", ERR_LIB_PEM, PEM_R_BAD_END_LINE},
++ #else
++ {"BAD_END_LINE", ERR_LIB_PEM, 102},
++ #endif
++ #ifdef PEM_R_BAD_IV_CHARS
++ {"BAD_IV_CHARS", ERR_LIB_PEM, PEM_R_BAD_IV_CHARS},
++ #else
++ {"BAD_IV_CHARS", ERR_LIB_PEM, 103},
++ #endif
++ #ifdef PEM_R_BAD_MAGIC_NUMBER
++ {"BAD_MAGIC_NUMBER", ERR_LIB_PEM, PEM_R_BAD_MAGIC_NUMBER},
++ #else
++ {"BAD_MAGIC_NUMBER", ERR_LIB_PEM, 116},
++ #endif
++ #ifdef PEM_R_BAD_PASSWORD_READ
++ {"BAD_PASSWORD_READ", ERR_LIB_PEM, PEM_R_BAD_PASSWORD_READ},
++ #else
++ {"BAD_PASSWORD_READ", ERR_LIB_PEM, 104},
++ #endif
++ #ifdef PEM_R_BAD_VERSION_NUMBER
++ {"BAD_VERSION_NUMBER", ERR_LIB_PEM, PEM_R_BAD_VERSION_NUMBER},
++ #else
++ {"BAD_VERSION_NUMBER", ERR_LIB_PEM, 117},
++ #endif
++ #ifdef PEM_R_BIO_WRITE_FAILURE
++ {"BIO_WRITE_FAILURE", ERR_LIB_PEM, PEM_R_BIO_WRITE_FAILURE},
++ #else
++ {"BIO_WRITE_FAILURE", ERR_LIB_PEM, 118},
++ #endif
++ #ifdef PEM_R_CIPHER_IS_NULL
++ {"CIPHER_IS_NULL", ERR_LIB_PEM, PEM_R_CIPHER_IS_NULL},
++ #else
++ {"CIPHER_IS_NULL", ERR_LIB_PEM, 127},
++ #endif
++ #ifdef PEM_R_ERROR_CONVERTING_PRIVATE_KEY
++ {"ERROR_CONVERTING_PRIVATE_KEY", ERR_LIB_PEM,
PEM_R_ERROR_CONVERTING_PRIVATE_KEY},
++ #else
++ {"ERROR_CONVERTING_PRIVATE_KEY", ERR_LIB_PEM, 115},
++ #endif
++ #ifdef PEM_R_EXPECTING_PRIVATE_KEY_BLOB
++ {"EXPECTING_PRIVATE_KEY_BLOB", ERR_LIB_PEM,
PEM_R_EXPECTING_PRIVATE_KEY_BLOB},
++ #else
++ {"EXPECTING_PRIVATE_KEY_BLOB", ERR_LIB_PEM, 119},
++ #endif
++ #ifdef PEM_R_EXPECTING_PUBLIC_KEY_BLOB
++ {"EXPECTING_PUBLIC_KEY_BLOB", ERR_LIB_PEM,
PEM_R_EXPECTING_PUBLIC_KEY_BLOB},
++ #else
++ {"EXPECTING_PUBLIC_KEY_BLOB", ERR_LIB_PEM, 120},
++ #endif
++ #ifdef PEM_R_INCONSISTENT_HEADER
++ {"INCONSISTENT_HEADER", ERR_LIB_PEM, PEM_R_INCONSISTENT_HEADER},
++ #else
++ {"INCONSISTENT_HEADER", ERR_LIB_PEM, 121},
++ #endif
++ #ifdef PEM_R_KEYBLOB_HEADER_PARSE_ERROR
++ {"KEYBLOB_HEADER_PARSE_ERROR", ERR_LIB_PEM,
PEM_R_KEYBLOB_HEADER_PARSE_ERROR},
++ #else
++ {"KEYBLOB_HEADER_PARSE_ERROR", ERR_LIB_PEM, 122},
++ #endif
++ #ifdef PEM_R_KEYBLOB_TOO_SHORT
++ {"KEYBLOB_TOO_SHORT", ERR_LIB_PEM, PEM_R_KEYBLOB_TOO_SHORT},
++ #else
++ {"KEYBLOB_TOO_SHORT", ERR_LIB_PEM, 123},
++ #endif
++ #ifdef PEM_R_NOT_DEK_INFO
++ {"NOT_DEK_INFO", ERR_LIB_PEM, PEM_R_NOT_DEK_INFO},
++ #else
++ {"NOT_DEK_INFO", ERR_LIB_PEM, 105},
++ #endif
++ #ifdef PEM_R_NOT_ENCRYPTED
++ {"NOT_ENCRYPTED", ERR_LIB_PEM, PEM_R_NOT_ENCRYPTED},
++ #else
++ {"NOT_ENCRYPTED", ERR_LIB_PEM, 106},
++ #endif
++ #ifdef PEM_R_NOT_PROC_TYPE
++ {"NOT_PROC_TYPE", ERR_LIB_PEM, PEM_R_NOT_PROC_TYPE},
++ #else
++ {"NOT_PROC_TYPE", ERR_LIB_PEM, 107},
++ #endif
++ #ifdef PEM_R_NO_START_LINE
++ {"NO_START_LINE", ERR_LIB_PEM, PEM_R_NO_START_LINE},
++ #else
++ {"NO_START_LINE", ERR_LIB_PEM, 108},
++ #endif
++ #ifdef PEM_R_PROBLEMS_GETTING_PASSWORD
++ {"PROBLEMS_GETTING_PASSWORD", ERR_LIB_PEM,
PEM_R_PROBLEMS_GETTING_PASSWORD},
++ #else
++ {"PROBLEMS_GETTING_PASSWORD", ERR_LIB_PEM, 109},
++ #endif
++ #ifdef PEM_R_PUBLIC_KEY_NO_RSA
++ {"PUBLIC_KEY_NO_RSA", ERR_LIB_PEM, PEM_R_PUBLIC_KEY_NO_RSA},
++ #else
++ {"PUBLIC_KEY_NO_RSA", ERR_LIB_PEM, 110},
++ #endif
++ #ifdef PEM_R_PVK_DATA_TOO_SHORT
++ {"PVK_DATA_TOO_SHORT", ERR_LIB_PEM, PEM_R_PVK_DATA_TOO_SHORT},
++ #else
++ {"PVK_DATA_TOO_SHORT", ERR_LIB_PEM, 124},
++ #endif
++ #ifdef PEM_R_PVK_TOO_SHORT
++ {"PVK_TOO_SHORT", ERR_LIB_PEM, PEM_R_PVK_TOO_SHORT},
++ #else
++ {"PVK_TOO_SHORT", ERR_LIB_PEM, 125},
++ #endif
++ #ifdef PEM_R_READ_KEY
++ {"READ_KEY", ERR_LIB_PEM, PEM_R_READ_KEY},
++ #else
++ {"READ_KEY", ERR_LIB_PEM, 111},
++ #endif
++ #ifdef PEM_R_SHORT_HEADER
++ {"SHORT_HEADER", ERR_LIB_PEM, PEM_R_SHORT_HEADER},
++ #else
++ {"SHORT_HEADER", ERR_LIB_PEM, 112},
++ #endif
++ #ifdef PEM_R_UNSUPPORTED_CIPHER
++ {"UNSUPPORTED_CIPHER", ERR_LIB_PEM, PEM_R_UNSUPPORTED_CIPHER},
++ #else
++ {"UNSUPPORTED_CIPHER", ERR_LIB_PEM, 113},
++ #endif
++ #ifdef PEM_R_UNSUPPORTED_ENCRYPTION
++ {"UNSUPPORTED_ENCRYPTION", ERR_LIB_PEM, PEM_R_UNSUPPORTED_ENCRYPTION},
++ #else
++ {"UNSUPPORTED_ENCRYPTION", ERR_LIB_PEM, 114},
++ #endif
++ #ifdef PEM_R_UNSUPPORTED_KEY_COMPONENTS
++ {"UNSUPPORTED_KEY_COMPONENTS", ERR_LIB_PEM,
PEM_R_UNSUPPORTED_KEY_COMPONENTS},
++ #else
++ {"UNSUPPORTED_KEY_COMPONENTS", ERR_LIB_PEM, 126},
++ #endif
++ #ifdef SSL_R_APP_DATA_IN_HANDSHAKE
++ {"APP_DATA_IN_HANDSHAKE", ERR_LIB_SSL, SSL_R_APP_DATA_IN_HANDSHAKE},
++ #else
++ {"APP_DATA_IN_HANDSHAKE", ERR_LIB_SSL, 100},
++ #endif
++ #ifdef SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT
++ {"ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT", ERR_LIB_SSL,
SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT},
++ #else
++ {"ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT", ERR_LIB_SSL, 272},
++ #endif
++ #ifdef SSL_R_BAD_ALERT_RECORD
++ {"BAD_ALERT_RECORD", ERR_LIB_SSL, SSL_R_BAD_ALERT_RECORD},
++ #else
++ {"BAD_ALERT_RECORD", ERR_LIB_SSL, 101},
++ #endif
++ #ifdef SSL_R_BAD_AUTHENTICATION_TYPE
++ {"BAD_AUTHENTICATION_TYPE", ERR_LIB_SSL, SSL_R_BAD_AUTHENTICATION_TYPE},
++ #else
++ {"BAD_AUTHENTICATION_TYPE", ERR_LIB_SSL, 102},
++ #endif
++ #ifdef SSL_R_BAD_CHANGE_CIPHER_SPEC
++ {"BAD_CHANGE_CIPHER_SPEC", ERR_LIB_SSL, SSL_R_BAD_CHANGE_CIPHER_SPEC},
++ #else
++ {"BAD_CHANGE_CIPHER_SPEC", ERR_LIB_SSL, 103},
++ #endif
++ #ifdef SSL_R_BAD_CHECKSUM
++ {"BAD_CHECKSUM", ERR_LIB_SSL, SSL_R_BAD_CHECKSUM},
++ #else
++ {"BAD_CHECKSUM", ERR_LIB_SSL, 104},
++ #endif
++ #ifdef SSL_R_BAD_DATA_RETURNED_BY_CALLBACK
++ {"BAD_DATA_RETURNED_BY_CALLBACK", ERR_LIB_SSL,
SSL_R_BAD_DATA_RETURNED_BY_CALLBACK},
++ #else
++ {"BAD_DATA_RETURNED_BY_CALLBACK", ERR_LIB_SSL, 106},
++ #endif
++ #ifdef SSL_R_BAD_DECOMPRESSION
++ {"BAD_DECOMPRESSION", ERR_LIB_SSL, SSL_R_BAD_DECOMPRESSION},
++ #else
++ {"BAD_DECOMPRESSION", ERR_LIB_SSL, 107},
++ #endif
++ #ifdef SSL_R_BAD_DH_G_LENGTH
++ {"BAD_DH_G_LENGTH", ERR_LIB_SSL, SSL_R_BAD_DH_G_LENGTH},
++ #else
++ {"BAD_DH_G_LENGTH", ERR_LIB_SSL, 108},
++ #endif
++ #ifdef SSL_R_BAD_DH_PUB_KEY_LENGTH
++ {"BAD_DH_PUB_KEY_LENGTH", ERR_LIB_SSL, SSL_R_BAD_DH_PUB_KEY_LENGTH},
++ #else
++ {"BAD_DH_PUB_KEY_LENGTH", ERR_LIB_SSL, 109},
++ #endif
++ #ifdef SSL_R_BAD_DH_P_LENGTH
++ {"BAD_DH_P_LENGTH", ERR_LIB_SSL, SSL_R_BAD_DH_P_LENGTH},
++ #else
++ {"BAD_DH_P_LENGTH", ERR_LIB_SSL, 110},
++ #endif
++ #ifdef SSL_R_BAD_DIGEST_LENGTH
++ {"BAD_DIGEST_LENGTH", ERR_LIB_SSL, SSL_R_BAD_DIGEST_LENGTH},
++ #else
++ {"BAD_DIGEST_LENGTH", ERR_LIB_SSL, 111},
++ #endif
++ #ifdef SSL_R_BAD_DSA_SIGNATURE
++ {"BAD_DSA_SIGNATURE", ERR_LIB_SSL, SSL_R_BAD_DSA_SIGNATURE},
++ #else
++ {"BAD_DSA_SIGNATURE", ERR_LIB_SSL, 112},
++ #endif
++ #ifdef SSL_R_BAD_ECC_CERT
++ {"BAD_ECC_CERT", ERR_LIB_SSL, SSL_R_BAD_ECC_CERT},
++ #else
++ {"BAD_ECC_CERT", ERR_LIB_SSL, 304},
++ #endif
++ #ifdef SSL_R_BAD_ECDSA_SIGNATURE
++ {"BAD_ECDSA_SIGNATURE", ERR_LIB_SSL, SSL_R_BAD_ECDSA_SIGNATURE},
++ #else
++ {"BAD_ECDSA_SIGNATURE", ERR_LIB_SSL, 305},
++ #endif
++ #ifdef SSL_R_BAD_ECPOINT
++ {"BAD_ECPOINT", ERR_LIB_SSL, SSL_R_BAD_ECPOINT},
++ #else
++ {"BAD_ECPOINT", ERR_LIB_SSL, 306},
++ #endif
++ #ifdef SSL_R_BAD_HANDSHAKE_LENGTH
++ {"BAD_HANDSHAKE_LENGTH", ERR_LIB_SSL, SSL_R_BAD_HANDSHAKE_LENGTH},
++ #else
++ {"BAD_HANDSHAKE_LENGTH", ERR_LIB_SSL, 332},
++ #endif
++ #ifdef SSL_R_BAD_HELLO_REQUEST
++ {"BAD_HELLO_REQUEST", ERR_LIB_SSL, SSL_R_BAD_HELLO_REQUEST},
++ #else
++ {"BAD_HELLO_REQUEST", ERR_LIB_SSL, 105},
++ #endif
++ #ifdef SSL_R_BAD_LENGTH
++ {"BAD_LENGTH", ERR_LIB_SSL, SSL_R_BAD_LENGTH},
++ #else
++ {"BAD_LENGTH", ERR_LIB_SSL, 271},
++ #endif
++ #ifdef SSL_R_BAD_MAC_DECODE
++ {"BAD_MAC_DECODE", ERR_LIB_SSL, SSL_R_BAD_MAC_DECODE},
++ #else
++ {"BAD_MAC_DECODE", ERR_LIB_SSL, 113},
++ #endif
++ #ifdef SSL_R_BAD_MAC_LENGTH
++ {"BAD_MAC_LENGTH", ERR_LIB_SSL, SSL_R_BAD_MAC_LENGTH},
++ #else
++ {"BAD_MAC_LENGTH", ERR_LIB_SSL, 333},
++ #endif
++ #ifdef SSL_R_BAD_MESSAGE_TYPE
++ {"BAD_MESSAGE_TYPE", ERR_LIB_SSL, SSL_R_BAD_MESSAGE_TYPE},
++ #else
++ {"BAD_MESSAGE_TYPE", ERR_LIB_SSL, 114},
++ #endif
++ #ifdef SSL_R_BAD_PACKET_LENGTH
++ {"BAD_PACKET_LENGTH", ERR_LIB_SSL, SSL_R_BAD_PACKET_LENGTH},
++ #else
++ {"BAD_PACKET_LENGTH", ERR_LIB_SSL, 115},
++ #endif
++ #ifdef SSL_R_BAD_PROTOCOL_VERSION_NUMBER
++ {"BAD_PROTOCOL_VERSION_NUMBER", ERR_LIB_SSL,
SSL_R_BAD_PROTOCOL_VERSION_NUMBER},
++ #else
++ {"BAD_PROTOCOL_VERSION_NUMBER", ERR_LIB_SSL, 116},
++ #endif
++ #ifdef SSL_R_BAD_PSK_IDENTITY_HINT_LENGTH
++ {"BAD_PSK_IDENTITY_HINT_LENGTH", ERR_LIB_SSL,
SSL_R_BAD_PSK_IDENTITY_HINT_LENGTH},
++ #else
++ {"BAD_PSK_IDENTITY_HINT_LENGTH", ERR_LIB_SSL, 316},
++ #endif
++ #ifdef SSL_R_BAD_RESPONSE_ARGUMENT
++ {"BAD_RESPONSE_ARGUMENT", ERR_LIB_SSL, SSL_R_BAD_RESPONSE_ARGUMENT},
++ #else
++ {"BAD_RESPONSE_ARGUMENT", ERR_LIB_SSL, 117},
++ #endif
++ #ifdef SSL_R_BAD_RSA_DECRYPT
++ {"BAD_RSA_DECRYPT", ERR_LIB_SSL, SSL_R_BAD_RSA_DECRYPT},
++ #else
++ {"BAD_RSA_DECRYPT", ERR_LIB_SSL, 118},
++ #endif
++ #ifdef SSL_R_BAD_RSA_ENCRYPT
++ {"BAD_RSA_ENCRYPT", ERR_LIB_SSL, SSL_R_BAD_RSA_ENCRYPT},
++ #else
++ {"BAD_RSA_ENCRYPT", ERR_LIB_SSL, 119},
++ #endif
++ #ifdef SSL_R_BAD_RSA_E_LENGTH
++ {"BAD_RSA_E_LENGTH", ERR_LIB_SSL, SSL_R_BAD_RSA_E_LENGTH},
++ #else
++ {"BAD_RSA_E_LENGTH", ERR_LIB_SSL, 120},
++ #endif
++ #ifdef SSL_R_BAD_RSA_MODULUS_LENGTH
++ {"BAD_RSA_MODULUS_LENGTH", ERR_LIB_SSL, SSL_R_BAD_RSA_MODULUS_LENGTH},
++ #else
++ {"BAD_RSA_MODULUS_LENGTH", ERR_LIB_SSL, 121},
++ #endif
++ #ifdef SSL_R_BAD_RSA_SIGNATURE
++ {"BAD_RSA_SIGNATURE", ERR_LIB_SSL, SSL_R_BAD_RSA_SIGNATURE},
++ #else
++ {"BAD_RSA_SIGNATURE", ERR_LIB_SSL, 122},
++ #endif
++ #ifdef SSL_R_BAD_SIGNATURE
++ {"BAD_SIGNATURE", ERR_LIB_SSL, SSL_R_BAD_SIGNATURE},
++ #else
++ {"BAD_SIGNATURE", ERR_LIB_SSL, 123},
++ #endif
++ #ifdef SSL_R_BAD_SSL_FILETYPE
++ {"BAD_SSL_FILETYPE", ERR_LIB_SSL, SSL_R_BAD_SSL_FILETYPE},
++ #else
++ {"BAD_SSL_FILETYPE", ERR_LIB_SSL, 124},
++ #endif
++ #ifdef SSL_R_BAD_SSL_SESSION_ID_LENGTH
++ {"BAD_SSL_SESSION_ID_LENGTH", ERR_LIB_SSL,
SSL_R_BAD_SSL_SESSION_ID_LENGTH},
++ #else
++ {"BAD_SSL_SESSION_ID_LENGTH", ERR_LIB_SSL, 125},
++ #endif
++ #ifdef SSL_R_BAD_STATE
++ {"BAD_STATE", ERR_LIB_SSL, SSL_R_BAD_STATE},
++ #else
++ {"BAD_STATE", ERR_LIB_SSL, 126},
++ #endif
++ #ifdef SSL_R_BAD_WRITE_RETRY
++ {"BAD_WRITE_RETRY", ERR_LIB_SSL, SSL_R_BAD_WRITE_RETRY},
++ #else
++ {"BAD_WRITE_RETRY", ERR_LIB_SSL, 127},
++ #endif
++ #ifdef SSL_R_BIO_NOT_SET
++ {"BIO_NOT_SET", ERR_LIB_SSL, SSL_R_BIO_NOT_SET},
++ #else
++ {"BIO_NOT_SET", ERR_LIB_SSL, 128},
++ #endif
++ #ifdef SSL_R_BLOCK_CIPHER_PAD_IS_WRONG
++ {"BLOCK_CIPHER_PAD_IS_WRONG", ERR_LIB_SSL,
SSL_R_BLOCK_CIPHER_PAD_IS_WRONG},
++ #else
++ {"BLOCK_CIPHER_PAD_IS_WRONG", ERR_LIB_SSL, 129},
++ #endif
++ #ifdef SSL_R_BN_LIB
++ {"BN_LIB", ERR_LIB_SSL, SSL_R_BN_LIB},
++ #else
++ {"BN_LIB", ERR_LIB_SSL, 130},
++ #endif
++ #ifdef SSL_R_CA_DN_LENGTH_MISMATCH
++ {"CA_DN_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_CA_DN_LENGTH_MISMATCH},
++ #else
++ {"CA_DN_LENGTH_MISMATCH", ERR_LIB_SSL, 131},
++ #endif
++ #ifdef SSL_R_CA_DN_TOO_LONG
++ {"CA_DN_TOO_LONG", ERR_LIB_SSL, SSL_R_CA_DN_TOO_LONG},
++ #else
++ {"CA_DN_TOO_LONG", ERR_LIB_SSL, 132},
++ #endif
++ #ifdef SSL_R_CCS_RECEIVED_EARLY
++ {"CCS_RECEIVED_EARLY", ERR_LIB_SSL, SSL_R_CCS_RECEIVED_EARLY},
++ #else
++ {"CCS_RECEIVED_EARLY", ERR_LIB_SSL, 133},
++ #endif
++ #ifdef SSL_R_CERTIFICATE_VERIFY_FAILED
++ {"CERTIFICATE_VERIFY_FAILED", ERR_LIB_SSL,
SSL_R_CERTIFICATE_VERIFY_FAILED},
++ #else
++ {"CERTIFICATE_VERIFY_FAILED", ERR_LIB_SSL, 134},
++ #endif
++ #ifdef SSL_R_CERT_LENGTH_MISMATCH
++ {"CERT_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_CERT_LENGTH_MISMATCH},
++ #else
++ {"CERT_LENGTH_MISMATCH", ERR_LIB_SSL, 135},
++ #endif
++ #ifdef SSL_R_CHALLENGE_IS_DIFFERENT
++ {"CHALLENGE_IS_DIFFERENT", ERR_LIB_SSL, SSL_R_CHALLENGE_IS_DIFFERENT},
++ #else
++ {"CHALLENGE_IS_DIFFERENT", ERR_LIB_SSL, 136},
++ #endif
++ #ifdef SSL_R_CIPHER_CODE_WRONG_LENGTH
++ {"CIPHER_CODE_WRONG_LENGTH", ERR_LIB_SSL,
SSL_R_CIPHER_CODE_WRONG_LENGTH},
++ #else
++ {"CIPHER_CODE_WRONG_LENGTH", ERR_LIB_SSL, 137},
++ #endif
++ #ifdef SSL_R_CIPHER_OR_HASH_UNAVAILABLE
++ {"CIPHER_OR_HASH_UNAVAILABLE", ERR_LIB_SSL,
SSL_R_CIPHER_OR_HASH_UNAVAILABLE},
++ #else
++ {"CIPHER_OR_HASH_UNAVAILABLE", ERR_LIB_SSL, 138},
++ #endif
++ #ifdef SSL_R_CIPHER_TABLE_SRC_ERROR
++ {"CIPHER_TABLE_SRC_ERROR", ERR_LIB_SSL, SSL_R_CIPHER_TABLE_SRC_ERROR},
++ #else
++ {"CIPHER_TABLE_SRC_ERROR", ERR_LIB_SSL, 139},
++ #endif
++ #ifdef SSL_R_CLIENTHELLO_TLSEXT
++ {"CLIENTHELLO_TLSEXT", ERR_LIB_SSL, SSL_R_CLIENTHELLO_TLSEXT},
++ #else
++ {"CLIENTHELLO_TLSEXT", ERR_LIB_SSL, 226},
++ #endif
++ #ifdef SSL_R_COMPRESSED_LENGTH_TOO_LONG
++ {"COMPRESSED_LENGTH_TOO_LONG", ERR_LIB_SSL,
SSL_R_COMPRESSED_LENGTH_TOO_LONG},
++ #else
++ {"COMPRESSED_LENGTH_TOO_LONG", ERR_LIB_SSL, 140},
++ #endif
++ #ifdef SSL_R_COMPRESSION_DISABLED
++ {"COMPRESSION_DISABLED", ERR_LIB_SSL, SSL_R_COMPRESSION_DISABLED},
++ #else
++ {"COMPRESSION_DISABLED", ERR_LIB_SSL, 343},
++ #endif
++ #ifdef SSL_R_COMPRESSION_FAILURE
++ {"COMPRESSION_FAILURE", ERR_LIB_SSL, SSL_R_COMPRESSION_FAILURE},
++ #else
++ {"COMPRESSION_FAILURE", ERR_LIB_SSL, 141},
++ #endif
++ #ifdef SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE
++ {"COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE", ERR_LIB_SSL,
SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE},
++ #else
++ {"COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE", ERR_LIB_SSL, 307},
++ #endif
++ #ifdef SSL_R_COMPRESSION_LIBRARY_ERROR
++ {"COMPRESSION_LIBRARY_ERROR", ERR_LIB_SSL,
SSL_R_COMPRESSION_LIBRARY_ERROR},
++ #else
++ {"COMPRESSION_LIBRARY_ERROR", ERR_LIB_SSL, 142},
++ #endif
++ #ifdef SSL_R_CONNECTION_ID_IS_DIFFERENT
++ {"CONNECTION_ID_IS_DIFFERENT", ERR_LIB_SSL,
SSL_R_CONNECTION_ID_IS_DIFFERENT},
++ #else
++ {"CONNECTION_ID_IS_DIFFERENT", ERR_LIB_SSL, 143},
++ #endif
++ #ifdef SSL_R_CONNECTION_TYPE_NOT_SET
++ {"CONNECTION_TYPE_NOT_SET", ERR_LIB_SSL, SSL_R_CONNECTION_TYPE_NOT_SET},
++ #else
++ {"CONNECTION_TYPE_NOT_SET", ERR_LIB_SSL, 144},
++ #endif
++ #ifdef SSL_R_COOKIE_MISMATCH
++ {"COOKIE_MISMATCH", ERR_LIB_SSL, SSL_R_COOKIE_MISMATCH},
++ #else
++ {"COOKIE_MISMATCH", ERR_LIB_SSL, 308},
++ #endif
++ #ifdef SSL_R_DATA_BETWEEN_CCS_AND_FINISHED
++ {"DATA_BETWEEN_CCS_AND_FINISHED", ERR_LIB_SSL,
SSL_R_DATA_BETWEEN_CCS_AND_FINISHED},
++ #else
++ {"DATA_BETWEEN_CCS_AND_FINISHED", ERR_LIB_SSL, 145},
++ #endif
++ #ifdef SSL_R_DATA_LENGTH_TOO_LONG
++ {"DATA_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_DATA_LENGTH_TOO_LONG},
++ #else
++ {"DATA_LENGTH_TOO_LONG", ERR_LIB_SSL, 146},
++ #endif
++ #ifdef SSL_R_DECRYPTION_FAILED
++ {"DECRYPTION_FAILED", ERR_LIB_SSL, SSL_R_DECRYPTION_FAILED},
++ #else
++ {"DECRYPTION_FAILED", ERR_LIB_SSL, 147},
++ #endif
++ #ifdef SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC
++ {"DECRYPTION_FAILED_OR_BAD_RECORD_MAC", ERR_LIB_SSL,
SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC},
++ #else
++ {"DECRYPTION_FAILED_OR_BAD_RECORD_MAC", ERR_LIB_SSL, 281},
++ #endif
++ #ifdef SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG
++ {"DH_PUBLIC_VALUE_LENGTH_IS_WRONG", ERR_LIB_SSL,
SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG},
++ #else
++ {"DH_PUBLIC_VALUE_LENGTH_IS_WRONG", ERR_LIB_SSL, 148},
++ #endif
++ #ifdef SSL_R_DIGEST_CHECK_FAILED
++ {"DIGEST_CHECK_FAILED", ERR_LIB_SSL, SSL_R_DIGEST_CHECK_FAILED},
++ #else
++ {"DIGEST_CHECK_FAILED", ERR_LIB_SSL, 149},
++ #endif
++ #ifdef SSL_R_DTLS_MESSAGE_TOO_BIG
++ {"DTLS_MESSAGE_TOO_BIG", ERR_LIB_SSL, SSL_R_DTLS_MESSAGE_TOO_BIG},
++ #else
++ {"DTLS_MESSAGE_TOO_BIG", ERR_LIB_SSL, 334},
++ #endif
++ #ifdef SSL_R_DUPLICATE_COMPRESSION_ID
++ {"DUPLICATE_COMPRESSION_ID", ERR_LIB_SSL,
SSL_R_DUPLICATE_COMPRESSION_ID},
++ #else
++ {"DUPLICATE_COMPRESSION_ID", ERR_LIB_SSL, 309},
++ #endif
++ #ifdef SSL_R_ECC_CERT_NOT_FOR_KEY_AGREEMENT
++ {"ECC_CERT_NOT_FOR_KEY_AGREEMENT", ERR_LIB_SSL,
SSL_R_ECC_CERT_NOT_FOR_KEY_AGREEMENT},
++ #else
++ {"ECC_CERT_NOT_FOR_KEY_AGREEMENT", ERR_LIB_SSL, 317},
++ #endif
++ #ifdef SSL_R_ECC_CERT_NOT_FOR_SIGNING
++ {"ECC_CERT_NOT_FOR_SIGNING", ERR_LIB_SSL,
SSL_R_ECC_CERT_NOT_FOR_SIGNING},
++ #else
++ {"ECC_CERT_NOT_FOR_SIGNING", ERR_LIB_SSL, 318},
++ #endif
++ #ifdef SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE
++ {"ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE", ERR_LIB_SSL,
SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE},
++ #else
++ {"ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE", ERR_LIB_SSL, 322},
++ #endif
++ #ifdef SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE
++ {"ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE", ERR_LIB_SSL,
SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE},
++ #else
++ {"ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE", ERR_LIB_SSL, 323},
++ #endif
++ #ifdef SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER
++ {"ECGROUP_TOO_LARGE_FOR_CIPHER", ERR_LIB_SSL,
SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER},
++ #else
++ {"ECGROUP_TOO_LARGE_FOR_CIPHER", ERR_LIB_SSL, 310},
++ #endif
++ #ifdef SSL_R_ENCRYPTED_LENGTH_TOO_LONG
++ {"ENCRYPTED_LENGTH_TOO_LONG", ERR_LIB_SSL,
SSL_R_ENCRYPTED_LENGTH_TOO_LONG},
++ #else
++ {"ENCRYPTED_LENGTH_TOO_LONG", ERR_LIB_SSL, 150},
++ #endif
++ #ifdef SSL_R_ERROR_GENERATING_TMP_RSA_KEY
++ {"ERROR_GENERATING_TMP_RSA_KEY", ERR_LIB_SSL,
SSL_R_ERROR_GENERATING_TMP_RSA_KEY},
++ #else
++ {"ERROR_GENERATING_TMP_RSA_KEY", ERR_LIB_SSL, 282},
++ #endif
++ #ifdef SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST
++ {"ERROR_IN_RECEIVED_CIPHER_LIST", ERR_LIB_SSL,
SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST},
++ #else
++ {"ERROR_IN_RECEIVED_CIPHER_LIST", ERR_LIB_SSL, 151},
++ #endif
++ #ifdef SSL_R_EXCESSIVE_MESSAGE_SIZE
++ {"EXCESSIVE_MESSAGE_SIZE", ERR_LIB_SSL, SSL_R_EXCESSIVE_MESSAGE_SIZE},
++ #else
++ {"EXCESSIVE_MESSAGE_SIZE", ERR_LIB_SSL, 152},
++ #endif
++ #ifdef SSL_R_EXTRA_DATA_IN_MESSAGE
++ {"EXTRA_DATA_IN_MESSAGE", ERR_LIB_SSL, SSL_R_EXTRA_DATA_IN_MESSAGE},
++ #else
++ {"EXTRA_DATA_IN_MESSAGE", ERR_LIB_SSL, 153},
++ #endif
++ #ifdef SSL_R_GOT_A_FIN_BEFORE_A_CCS
++ {"GOT_A_FIN_BEFORE_A_CCS", ERR_LIB_SSL, SSL_R_GOT_A_FIN_BEFORE_A_CCS},
++ #else
++ {"GOT_A_FIN_BEFORE_A_CCS", ERR_LIB_SSL, 154},
++ #endif
++ #ifdef SSL_R_HTTPS_PROXY_REQUEST
++ {"HTTPS_PROXY_REQUEST", ERR_LIB_SSL, SSL_R_HTTPS_PROXY_REQUEST},
++ #else
++ {"HTTPS_PROXY_REQUEST", ERR_LIB_SSL, 155},
++ #endif
++ #ifdef SSL_R_HTTP_REQUEST
++ {"HTTP_REQUEST", ERR_LIB_SSL, SSL_R_HTTP_REQUEST},
++ #else
++ {"HTTP_REQUEST", ERR_LIB_SSL, 156},
++ #endif
++ #ifdef SSL_R_ILLEGAL_PADDING
++ {"ILLEGAL_PADDING", ERR_LIB_SSL, SSL_R_ILLEGAL_PADDING},
++ #else
++ {"ILLEGAL_PADDING", ERR_LIB_SSL, 283},
++ #endif
++ #ifdef SSL_R_INCONSISTENT_COMPRESSION
++ {"INCONSISTENT_COMPRESSION", ERR_LIB_SSL,
SSL_R_INCONSISTENT_COMPRESSION},
++ #else
++ {"INCONSISTENT_COMPRESSION", ERR_LIB_SSL, 340},
++ #endif
++ #ifdef SSL_R_INVALID_CHALLENGE_LENGTH
++ {"INVALID_CHALLENGE_LENGTH", ERR_LIB_SSL,
SSL_R_INVALID_CHALLENGE_LENGTH},
++ #else
++ {"INVALID_CHALLENGE_LENGTH", ERR_LIB_SSL, 158},
++ #endif
++ #ifdef SSL_R_INVALID_COMMAND
++ {"INVALID_COMMAND", ERR_LIB_SSL, SSL_R_INVALID_COMMAND},
++ #else
++ {"INVALID_COMMAND", ERR_LIB_SSL, 280},
++ #endif
++ #ifdef SSL_R_INVALID_COMPRESSION_ALGORITHM
++ {"INVALID_COMPRESSION_ALGORITHM", ERR_LIB_SSL,
SSL_R_INVALID_COMPRESSION_ALGORITHM},
++ #else
++ {"INVALID_COMPRESSION_ALGORITHM", ERR_LIB_SSL, 341},
++ #endif
++ #ifdef SSL_R_INVALID_PURPOSE
++ {"INVALID_PURPOSE", ERR_LIB_SSL, SSL_R_INVALID_PURPOSE},
++ #else
++ {"INVALID_PURPOSE", ERR_LIB_SSL, 278},
++ #endif
++ #ifdef SSL_R_INVALID_STATUS_RESPONSE
++ {"INVALID_STATUS_RESPONSE", ERR_LIB_SSL, SSL_R_INVALID_STATUS_RESPONSE},
++ #else
++ {"INVALID_STATUS_RESPONSE", ERR_LIB_SSL, 328},
++ #endif
++ #ifdef SSL_R_INVALID_TICKET_KEYS_LENGTH
++ {"INVALID_TICKET_KEYS_LENGTH", ERR_LIB_SSL,
SSL_R_INVALID_TICKET_KEYS_LENGTH},
++ #else
++ {"INVALID_TICKET_KEYS_LENGTH", ERR_LIB_SSL, 325},
++ #endif
++ #ifdef SSL_R_INVALID_TRUST
++ {"INVALID_TRUST", ERR_LIB_SSL, SSL_R_INVALID_TRUST},
++ #else
++ {"INVALID_TRUST", ERR_LIB_SSL, 279},
++ #endif
++ #ifdef SSL_R_KEY_ARG_TOO_LONG
++ {"KEY_ARG_TOO_LONG", ERR_LIB_SSL, SSL_R_KEY_ARG_TOO_LONG},
++ #else
++ {"KEY_ARG_TOO_LONG", ERR_LIB_SSL, 284},
++ #endif
++ #ifdef SSL_R_KRB5
++ {"KRB5", ERR_LIB_SSL, SSL_R_KRB5},
++ #else
++ {"KRB5", ERR_LIB_SSL, 285},
++ #endif
++ #ifdef SSL_R_KRB5_C_CC_PRINC
++ {"KRB5_C_CC_PRINC", ERR_LIB_SSL, SSL_R_KRB5_C_CC_PRINC},
++ #else
++ {"KRB5_C_CC_PRINC", ERR_LIB_SSL, 286},
++ #endif
++ #ifdef SSL_R_KRB5_C_GET_CRED
++ {"KRB5_C_GET_CRED", ERR_LIB_SSL, SSL_R_KRB5_C_GET_CRED},
++ #else
++ {"KRB5_C_GET_CRED", ERR_LIB_SSL, 287},
++ #endif
++ #ifdef SSL_R_KRB5_C_INIT
++ {"KRB5_C_INIT", ERR_LIB_SSL, SSL_R_KRB5_C_INIT},
++ #else
++ {"KRB5_C_INIT", ERR_LIB_SSL, 288},
++ #endif
++ #ifdef SSL_R_KRB5_C_MK_REQ
++ {"KRB5_C_MK_REQ", ERR_LIB_SSL, SSL_R_KRB5_C_MK_REQ},
++ #else
++ {"KRB5_C_MK_REQ", ERR_LIB_SSL, 289},
++ #endif
++ #ifdef SSL_R_KRB5_S_BAD_TICKET
++ {"KRB5_S_BAD_TICKET", ERR_LIB_SSL, SSL_R_KRB5_S_BAD_TICKET},
++ #else
++ {"KRB5_S_BAD_TICKET", ERR_LIB_SSL, 290},
++ #endif
++ #ifdef SSL_R_KRB5_S_INIT
++ {"KRB5_S_INIT", ERR_LIB_SSL, SSL_R_KRB5_S_INIT},
++ #else
++ {"KRB5_S_INIT", ERR_LIB_SSL, 291},
++ #endif
++ #ifdef SSL_R_KRB5_S_RD_REQ
++ {"KRB5_S_RD_REQ", ERR_LIB_SSL, SSL_R_KRB5_S_RD_REQ},
++ #else
++ {"KRB5_S_RD_REQ", ERR_LIB_SSL, 292},
++ #endif
++ #ifdef SSL_R_KRB5_S_TKT_EXPIRED
++ {"KRB5_S_TKT_EXPIRED", ERR_LIB_SSL, SSL_R_KRB5_S_TKT_EXPIRED},
++ #else
++ {"KRB5_S_TKT_EXPIRED", ERR_LIB_SSL, 293},
++ #endif
++ #ifdef SSL_R_KRB5_S_TKT_NYV
++ {"KRB5_S_TKT_NYV", ERR_LIB_SSL, SSL_R_KRB5_S_TKT_NYV},
++ #else
++ {"KRB5_S_TKT_NYV", ERR_LIB_SSL, 294},
++ #endif
++ #ifdef SSL_R_KRB5_S_TKT_SKEW
++ {"KRB5_S_TKT_SKEW", ERR_LIB_SSL, SSL_R_KRB5_S_TKT_SKEW},
++ #else
++ {"KRB5_S_TKT_SKEW", ERR_LIB_SSL, 295},
++ #endif
++ #ifdef SSL_R_LENGTH_MISMATCH
++ {"LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_LENGTH_MISMATCH},
++ #else
++ {"LENGTH_MISMATCH", ERR_LIB_SSL, 159},
++ #endif
++ #ifdef SSL_R_LENGTH_TOO_SHORT
++ {"LENGTH_TOO_SHORT", ERR_LIB_SSL, SSL_R_LENGTH_TOO_SHORT},
++ #else
++ {"LENGTH_TOO_SHORT", ERR_LIB_SSL, 160},
++ #endif
++ #ifdef SSL_R_LIBRARY_BUG
++ {"LIBRARY_BUG", ERR_LIB_SSL, SSL_R_LIBRARY_BUG},
++ #else
++ {"LIBRARY_BUG", ERR_LIB_SSL, 274},
++ #endif
++ #ifdef SSL_R_LIBRARY_HAS_NO_CIPHERS
++ {"LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, SSL_R_LIBRARY_HAS_NO_CIPHERS},
++ #else
++ {"LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, 161},
++ #endif
++ #ifdef SSL_R_MESSAGE_TOO_LONG
++ {"MESSAGE_TOO_LONG", ERR_LIB_SSL, SSL_R_MESSAGE_TOO_LONG},
++ #else
++ {"MESSAGE_TOO_LONG", ERR_LIB_SSL, 296},
++ #endif
++ #ifdef SSL_R_MISSING_DH_DSA_CERT
++ {"MISSING_DH_DSA_CERT", ERR_LIB_SSL, SSL_R_MISSING_DH_DSA_CERT},
++ #else
++ {"MISSING_DH_DSA_CERT", ERR_LIB_SSL, 162},
++ #endif
++ #ifdef SSL_R_MISSING_DH_KEY
++ {"MISSING_DH_KEY", ERR_LIB_SSL, SSL_R_MISSING_DH_KEY},
++ #else
++ {"MISSING_DH_KEY", ERR_LIB_SSL, 163},
++ #endif
++ #ifdef SSL_R_MISSING_DH_RSA_CERT
++ {"MISSING_DH_RSA_CERT", ERR_LIB_SSL, SSL_R_MISSING_DH_RSA_CERT},
++ #else
++ {"MISSING_DH_RSA_CERT", ERR_LIB_SSL, 164},
++ #endif
++ #ifdef SSL_R_MISSING_DSA_SIGNING_CERT
++ {"MISSING_DSA_SIGNING_CERT", ERR_LIB_SSL,
SSL_R_MISSING_DSA_SIGNING_CERT},
++ #else
++ {"MISSING_DSA_SIGNING_CERT", ERR_LIB_SSL, 165},
++ #endif
++ #ifdef SSL_R_MISSING_EXPORT_TMP_DH_KEY
++ {"MISSING_EXPORT_TMP_DH_KEY", ERR_LIB_SSL,
SSL_R_MISSING_EXPORT_TMP_DH_KEY},
++ #else
++ {"MISSING_EXPORT_TMP_DH_KEY", ERR_LIB_SSL, 166},
++ #endif
++ #ifdef SSL_R_MISSING_EXPORT_TMP_RSA_KEY
++ {"MISSING_EXPORT_TMP_RSA_KEY", ERR_LIB_SSL,
SSL_R_MISSING_EXPORT_TMP_RSA_KEY},
++ #else
++ {"MISSING_EXPORT_TMP_RSA_KEY", ERR_LIB_SSL, 167},
++ #endif
++ #ifdef SSL_R_MISSING_RSA_CERTIFICATE
++ {"MISSING_RSA_CERTIFICATE", ERR_LIB_SSL, SSL_R_MISSING_RSA_CERTIFICATE},
++ #else
++ {"MISSING_RSA_CERTIFICATE", ERR_LIB_SSL, 168},
++ #endif
++ #ifdef SSL_R_MISSING_RSA_ENCRYPTING_CERT
++ {"MISSING_RSA_ENCRYPTING_CERT", ERR_LIB_SSL,
SSL_R_MISSING_RSA_ENCRYPTING_CERT},
++ #else
++ {"MISSING_RSA_ENCRYPTING_CERT", ERR_LIB_SSL, 169},
++ #endif
++ #ifdef SSL_R_MISSING_RSA_SIGNING_CERT
++ {"MISSING_RSA_SIGNING_CERT", ERR_LIB_SSL,
SSL_R_MISSING_RSA_SIGNING_CERT},
++ #else
++ {"MISSING_RSA_SIGNING_CERT", ERR_LIB_SSL, 170},
++ #endif
++ #ifdef SSL_R_MISSING_TMP_DH_KEY
++ {"MISSING_TMP_DH_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_DH_KEY},
++ #else
++ {"MISSING_TMP_DH_KEY", ERR_LIB_SSL, 171},
++ #endif
++ #ifdef SSL_R_MISSING_TMP_ECDH_KEY
++ {"MISSING_TMP_ECDH_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_ECDH_KEY},
++ #else
++ {"MISSING_TMP_ECDH_KEY", ERR_LIB_SSL, 311},
++ #endif
++ #ifdef SSL_R_MISSING_TMP_RSA_KEY
++ {"MISSING_TMP_RSA_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_RSA_KEY},
++ #else
++ {"MISSING_TMP_RSA_KEY", ERR_LIB_SSL, 172},
++ #endif
++ #ifdef SSL_R_MISSING_TMP_RSA_PKEY
++ {"MISSING_TMP_RSA_PKEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_RSA_PKEY},
++ #else
++ {"MISSING_TMP_RSA_PKEY", ERR_LIB_SSL, 173},
++ #endif
++ #ifdef SSL_R_MISSING_VERIFY_MESSAGE
++ {"MISSING_VERIFY_MESSAGE", ERR_LIB_SSL, SSL_R_MISSING_VERIFY_MESSAGE},
++ #else
++ {"MISSING_VERIFY_MESSAGE", ERR_LIB_SSL, 174},
++ #endif
++ #ifdef SSL_R_NON_SSLV2_INITIAL_PACKET
++ {"NON_SSLV2_INITIAL_PACKET", ERR_LIB_SSL,
SSL_R_NON_SSLV2_INITIAL_PACKET},
++ #else
++ {"NON_SSLV2_INITIAL_PACKET", ERR_LIB_SSL, 175},
++ #endif
++ #ifdef SSL_R_NO_CERTIFICATES_RETURNED
++ {"NO_CERTIFICATES_RETURNED", ERR_LIB_SSL,
SSL_R_NO_CERTIFICATES_RETURNED},
++ #else
++ {"NO_CERTIFICATES_RETURNED", ERR_LIB_SSL, 176},
++ #endif
++ #ifdef SSL_R_NO_CERTIFICATE_ASSIGNED
++ {"NO_CERTIFICATE_ASSIGNED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_ASSIGNED},
++ #else
++ {"NO_CERTIFICATE_ASSIGNED", ERR_LIB_SSL, 177},
++ #endif
++ #ifdef SSL_R_NO_CERTIFICATE_RETURNED
++ {"NO_CERTIFICATE_RETURNED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_RETURNED},
++ #else
++ {"NO_CERTIFICATE_RETURNED", ERR_LIB_SSL, 178},
++ #endif
++ #ifdef SSL_R_NO_CERTIFICATE_SET
++ {"NO_CERTIFICATE_SET", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_SET},
++ #else
++ {"NO_CERTIFICATE_SET", ERR_LIB_SSL, 179},
++ #endif
++ #ifdef SSL_R_NO_CERTIFICATE_SPECIFIED
++ {"NO_CERTIFICATE_SPECIFIED", ERR_LIB_SSL,
SSL_R_NO_CERTIFICATE_SPECIFIED},
++ #else
++ {"NO_CERTIFICATE_SPECIFIED", ERR_LIB_SSL, 180},
++ #endif
++ #ifdef SSL_R_NO_CIPHERS_AVAILABLE
++ {"NO_CIPHERS_AVAILABLE", ERR_LIB_SSL, SSL_R_NO_CIPHERS_AVAILABLE},
++ #else
++ {"NO_CIPHERS_AVAILABLE", ERR_LIB_SSL, 181},
++ #endif
++ #ifdef SSL_R_NO_CIPHERS_PASSED
++ {"NO_CIPHERS_PASSED", ERR_LIB_SSL, SSL_R_NO_CIPHERS_PASSED},
++ #else
++ {"NO_CIPHERS_PASSED", ERR_LIB_SSL, 182},
++ #endif
++ #ifdef SSL_R_NO_CIPHERS_SPECIFIED
++ {"NO_CIPHERS_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_CIPHERS_SPECIFIED},
++ #else
++ {"NO_CIPHERS_SPECIFIED", ERR_LIB_SSL, 183},
++ #endif
++ #ifdef SSL_R_NO_CIPHER_LIST
++ {"NO_CIPHER_LIST", ERR_LIB_SSL, SSL_R_NO_CIPHER_LIST},
++ #else
++ {"NO_CIPHER_LIST", ERR_LIB_SSL, 184},
++ #endif
++ #ifdef SSL_R_NO_CIPHER_MATCH
++ {"NO_CIPHER_MATCH", ERR_LIB_SSL, SSL_R_NO_CIPHER_MATCH},
++ #else
++ {"NO_CIPHER_MATCH", ERR_LIB_SSL, 185},
++ #endif
++ #ifdef SSL_R_NO_CLIENT_CERT_METHOD
++ {"NO_CLIENT_CERT_METHOD", ERR_LIB_SSL, SSL_R_NO_CLIENT_CERT_METHOD},
++ #else
++ {"NO_CLIENT_CERT_METHOD", ERR_LIB_SSL, 331},
++ #endif
++ #ifdef SSL_R_NO_CLIENT_CERT_RECEIVED
++ {"NO_CLIENT_CERT_RECEIVED", ERR_LIB_SSL, SSL_R_NO_CLIENT_CERT_RECEIVED},
++ #else
++ {"NO_CLIENT_CERT_RECEIVED", ERR_LIB_SSL, 186},
++ #endif
++ #ifdef SSL_R_NO_COMPRESSION_SPECIFIED
++ {"NO_COMPRESSION_SPECIFIED", ERR_LIB_SSL,
SSL_R_NO_COMPRESSION_SPECIFIED},
++ #else
++ {"NO_COMPRESSION_SPECIFIED", ERR_LIB_SSL, 187},
++ #endif
++ #ifdef SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER
++ {"NO_GOST_CERTIFICATE_SENT_BY_PEER", ERR_LIB_SSL,
SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER},
++ #else
++ {"NO_GOST_CERTIFICATE_SENT_BY_PEER", ERR_LIB_SSL, 330},
++ #endif
++ #ifdef SSL_R_NO_METHOD_SPECIFIED
++ {"NO_METHOD_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_METHOD_SPECIFIED},
++ #else
++ {"NO_METHOD_SPECIFIED", ERR_LIB_SSL, 188},
++ #endif
++ #ifdef SSL_R_NO_PRIVATEKEY
++ {"NO_PRIVATEKEY", ERR_LIB_SSL, SSL_R_NO_PRIVATEKEY},
++ #else
++ {"NO_PRIVATEKEY", ERR_LIB_SSL, 189},
++ #endif
++ #ifdef SSL_R_NO_PRIVATE_KEY_ASSIGNED
++ {"NO_PRIVATE_KEY_ASSIGNED", ERR_LIB_SSL, SSL_R_NO_PRIVATE_KEY_ASSIGNED},
++ #else
++ {"NO_PRIVATE_KEY_ASSIGNED", ERR_LIB_SSL, 190},
++ #endif
++ #ifdef SSL_R_NO_PROTOCOLS_AVAILABLE
++ {"NO_PROTOCOLS_AVAILABLE", ERR_LIB_SSL, SSL_R_NO_PROTOCOLS_AVAILABLE},
++ #else
++ {"NO_PROTOCOLS_AVAILABLE", ERR_LIB_SSL, 191},
++ #endif
++ #ifdef SSL_R_NO_PUBLICKEY
++ {"NO_PUBLICKEY", ERR_LIB_SSL, SSL_R_NO_PUBLICKEY},
++ #else
++ {"NO_PUBLICKEY", ERR_LIB_SSL, 192},
++ #endif
++ #ifdef SSL_R_NO_RENEGOTIATION
++ {"NO_RENEGOTIATION", ERR_LIB_SSL, SSL_R_NO_RENEGOTIATION},
++ #else
++ {"NO_RENEGOTIATION", ERR_LIB_SSL, 339},
++ #endif
++ #ifdef SSL_R_NO_REQUIRED_DIGEST
++ {"NO_REQUIRED_DIGEST", ERR_LIB_SSL, SSL_R_NO_REQUIRED_DIGEST},
++ #else
++ {"NO_REQUIRED_DIGEST", ERR_LIB_SSL, 324},
++ #endif
++ #ifdef SSL_R_NO_SHARED_CIPHER
++ {"NO_SHARED_CIPHER", ERR_LIB_SSL, SSL_R_NO_SHARED_CIPHER},
++ #else
++ {"NO_SHARED_CIPHER", ERR_LIB_SSL, 193},
++ #endif
++ #ifdef SSL_R_NO_VERIFY_CALLBACK
++ {"NO_VERIFY_CALLBACK", ERR_LIB_SSL, SSL_R_NO_VERIFY_CALLBACK},
++ #else
++ {"NO_VERIFY_CALLBACK", ERR_LIB_SSL, 194},
++ #endif
++ #ifdef SSL_R_NULL_SSL_CTX
++ {"NULL_SSL_CTX", ERR_LIB_SSL, SSL_R_NULL_SSL_CTX},
++ #else
++ {"NULL_SSL_CTX", ERR_LIB_SSL, 195},
++ #endif
++ #ifdef SSL_R_NULL_SSL_METHOD_PASSED
++ {"NULL_SSL_METHOD_PASSED", ERR_LIB_SSL, SSL_R_NULL_SSL_METHOD_PASSED},
++ #else
++ {"NULL_SSL_METHOD_PASSED", ERR_LIB_SSL, 196},
++ #endif
++ #ifdef SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED
++ {"OLD_SESSION_CIPHER_NOT_RETURNED", ERR_LIB_SSL,
SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED},
++ #else
++ {"OLD_SESSION_CIPHER_NOT_RETURNED", ERR_LIB_SSL, 197},
++ #endif
++ #ifdef SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED
++ {"OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED", ERR_LIB_SSL,
SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED},
++ #else
++ {"OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED", ERR_LIB_SSL, 344},
++ #endif
++ #ifdef SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE
++ {"ONLY_TLS_ALLOWED_IN_FIPS_MODE", ERR_LIB_SSL,
SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE},
++ #else
++ {"ONLY_TLS_ALLOWED_IN_FIPS_MODE", ERR_LIB_SSL, 297},
++ #endif
++ #ifdef SSL_R_OPAQUE_PRF_INPUT_TOO_LONG
++ {"OPAQUE_PRF_INPUT_TOO_LONG", ERR_LIB_SSL,
SSL_R_OPAQUE_PRF_INPUT_TOO_LONG},
++ #else
++ {"OPAQUE_PRF_INPUT_TOO_LONG", ERR_LIB_SSL, 327},
++ #endif
++ #ifdef SSL_R_PACKET_LENGTH_TOO_LONG
++ {"PACKET_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_PACKET_LENGTH_TOO_LONG},
++ #else
++ {"PACKET_LENGTH_TOO_LONG", ERR_LIB_SSL, 198},
++ #endif
++ #ifdef SSL_R_PARSE_TLSEXT
++ {"PARSE_TLSEXT", ERR_LIB_SSL, SSL_R_PARSE_TLSEXT},
++ #else
++ {"PARSE_TLSEXT", ERR_LIB_SSL, 227},
++ #endif
++ #ifdef SSL_R_PATH_TOO_LONG
++ {"PATH_TOO_LONG", ERR_LIB_SSL, SSL_R_PATH_TOO_LONG},
++ #else
++ {"PATH_TOO_LONG", ERR_LIB_SSL, 270},
++ #endif
++ #ifdef SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE
++ {"PEER_DID_NOT_RETURN_A_CERTIFICATE", ERR_LIB_SSL,
SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE},
++ #else
++ {"PEER_DID_NOT_RETURN_A_CERTIFICATE", ERR_LIB_SSL, 199},
++ #endif
++ #ifdef SSL_R_PEER_ERROR
++ {"PEER_ERROR", ERR_LIB_SSL, SSL_R_PEER_ERROR},
++ #else
++ {"PEER_ERROR", ERR_LIB_SSL, 200},
++ #endif
++ #ifdef SSL_R_PEER_ERROR_CERTIFICATE
++ {"PEER_ERROR_CERTIFICATE", ERR_LIB_SSL, SSL_R_PEER_ERROR_CERTIFICATE},
++ #else
++ {"PEER_ERROR_CERTIFICATE", ERR_LIB_SSL, 201},
++ #endif
++ #ifdef SSL_R_PEER_ERROR_NO_CERTIFICATE
++ {"PEER_ERROR_NO_CERTIFICATE", ERR_LIB_SSL,
SSL_R_PEER_ERROR_NO_CERTIFICATE},
++ #else
++ {"PEER_ERROR_NO_CERTIFICATE", ERR_LIB_SSL, 202},
++ #endif
++ #ifdef SSL_R_PEER_ERROR_NO_CIPHER
++ {"PEER_ERROR_NO_CIPHER", ERR_LIB_SSL, SSL_R_PEER_ERROR_NO_CIPHER},
++ #else
++ {"PEER_ERROR_NO_CIPHER", ERR_LIB_SSL, 203},
++ #endif
++ #ifdef SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE
++ {"PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE", ERR_LIB_SSL,
SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE},
++ #else
++ {"PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE", ERR_LIB_SSL, 204},
++ #endif
++ #ifdef SSL_R_PRE_MAC_LENGTH_TOO_LONG
++ {"PRE_MAC_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_PRE_MAC_LENGTH_TOO_LONG},
++ #else
++ {"PRE_MAC_LENGTH_TOO_LONG", ERR_LIB_SSL, 205},
++ #endif
++ #ifdef SSL_R_PROBLEMS_MAPPING_CIPHER_FUNCTIONS
++ {"PROBLEMS_MAPPING_CIPHER_FUNCTIONS", ERR_LIB_SSL,
SSL_R_PROBLEMS_MAPPING_CIPHER_FUNCTIONS},
++ #else
++ {"PROBLEMS_MAPPING_CIPHER_FUNCTIONS", ERR_LIB_SSL, 206},
++ #endif
++ #ifdef SSL_R_PROTOCOL_IS_SHUTDOWN
++ {"PROTOCOL_IS_SHUTDOWN", ERR_LIB_SSL, SSL_R_PROTOCOL_IS_SHUTDOWN},
++ #else
++ {"PROTOCOL_IS_SHUTDOWN", ERR_LIB_SSL, 207},
++ #endif
++ #ifdef SSL_R_PSK_IDENTITY_NOT_FOUND
++ {"PSK_IDENTITY_NOT_FOUND", ERR_LIB_SSL, SSL_R_PSK_IDENTITY_NOT_FOUND},
++ #else
++ {"PSK_IDENTITY_NOT_FOUND", ERR_LIB_SSL, 223},
++ #endif
++ #ifdef SSL_R_PSK_NO_CLIENT_CB
++ {"PSK_NO_CLIENT_CB", ERR_LIB_SSL, SSL_R_PSK_NO_CLIENT_CB},
++ #else
++ {"PSK_NO_CLIENT_CB", ERR_LIB_SSL, 224},
++ #endif
++ #ifdef SSL_R_PSK_NO_SERVER_CB
++ {"PSK_NO_SERVER_CB", ERR_LIB_SSL, SSL_R_PSK_NO_SERVER_CB},
++ #else
++ {"PSK_NO_SERVER_CB", ERR_LIB_SSL, 225},
++ #endif
++ #ifdef SSL_R_PUBLIC_KEY_ENCRYPT_ERROR
++ {"PUBLIC_KEY_ENCRYPT_ERROR", ERR_LIB_SSL,
SSL_R_PUBLIC_KEY_ENCRYPT_ERROR},
++ #else
++ {"PUBLIC_KEY_ENCRYPT_ERROR", ERR_LIB_SSL, 208},
++ #endif
++ #ifdef SSL_R_PUBLIC_KEY_IS_NOT_RSA
++ {"PUBLIC_KEY_IS_NOT_RSA", ERR_LIB_SSL, SSL_R_PUBLIC_KEY_IS_NOT_RSA},
++ #else
++ {"PUBLIC_KEY_IS_NOT_RSA", ERR_LIB_SSL, 209},
++ #endif
++ #ifdef SSL_R_PUBLIC_KEY_NOT_RSA
++ {"PUBLIC_KEY_NOT_RSA", ERR_LIB_SSL, SSL_R_PUBLIC_KEY_NOT_RSA},
++ #else
++ {"PUBLIC_KEY_NOT_RSA", ERR_LIB_SSL, 210},
++ #endif
++ #ifdef SSL_R_READ_BIO_NOT_SET
++ {"READ_BIO_NOT_SET", ERR_LIB_SSL, SSL_R_READ_BIO_NOT_SET},
++ #else
++ {"READ_BIO_NOT_SET", ERR_LIB_SSL, 211},
++ #endif
++ #ifdef SSL_R_READ_TIMEOUT_EXPIRED
++ {"READ_TIMEOUT_EXPIRED", ERR_LIB_SSL, SSL_R_READ_TIMEOUT_EXPIRED},
++ #else
++ {"READ_TIMEOUT_EXPIRED", ERR_LIB_SSL, 312},
++ #endif
++ #ifdef SSL_R_READ_WRONG_PACKET_TYPE
++ {"READ_WRONG_PACKET_TYPE", ERR_LIB_SSL, SSL_R_READ_WRONG_PACKET_TYPE},
++ #else
++ {"READ_WRONG_PACKET_TYPE", ERR_LIB_SSL, 212},
++ #endif
++ #ifdef SSL_R_RECORD_LENGTH_MISMATCH
++ {"RECORD_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_RECORD_LENGTH_MISMATCH},
++ #else
++ {"RECORD_LENGTH_MISMATCH", ERR_LIB_SSL, 213},
++ #endif
++ #ifdef SSL_R_RECORD_TOO_LARGE
++ {"RECORD_TOO_LARGE", ERR_LIB_SSL, SSL_R_RECORD_TOO_LARGE},
++ #else
++ {"RECORD_TOO_LARGE", ERR_LIB_SSL, 214},
++ #endif
++ #ifdef SSL_R_RECORD_TOO_SMALL
++ {"RECORD_TOO_SMALL", ERR_LIB_SSL, SSL_R_RECORD_TOO_SMALL},
++ #else
++ {"RECORD_TOO_SMALL", ERR_LIB_SSL, 298},
++ #endif
++ #ifdef SSL_R_RENEGOTIATE_EXT_TOO_LONG
++ {"RENEGOTIATE_EXT_TOO_LONG", ERR_LIB_SSL,
SSL_R_RENEGOTIATE_EXT_TOO_LONG},
++ #else
++ {"RENEGOTIATE_EXT_TOO_LONG", ERR_LIB_SSL, 335},
++ #endif
++ #ifdef SSL_R_RENEGOTIATION_ENCODING_ERR
++ {"RENEGOTIATION_ENCODING_ERR", ERR_LIB_SSL,
SSL_R_RENEGOTIATION_ENCODING_ERR},
++ #else
++ {"RENEGOTIATION_ENCODING_ERR", ERR_LIB_SSL, 336},
++ #endif
++ #ifdef SSL_R_RENEGOTIATION_MISMATCH
++ {"RENEGOTIATION_MISMATCH", ERR_LIB_SSL, SSL_R_RENEGOTIATION_MISMATCH},
++ #else
++ {"RENEGOTIATION_MISMATCH", ERR_LIB_SSL, 337},
++ #endif
++ #ifdef SSL_R_REQUIRED_CIPHER_MISSING
++ {"REQUIRED_CIPHER_MISSING", ERR_LIB_SSL, SSL_R_REQUIRED_CIPHER_MISSING},
++ #else
++ {"REQUIRED_CIPHER_MISSING", ERR_LIB_SSL, 215},
++ #endif
++ #ifdef SSL_R_REQUIRED_COMPRESSSION_ALGORITHM_MISSING
++ {"REQUIRED_COMPRESSSION_ALGORITHM_MISSING", ERR_LIB_SSL,
SSL_R_REQUIRED_COMPRESSSION_ALGORITHM_MISSING},
++ #else
++ {"REQUIRED_COMPRESSSION_ALGORITHM_MISSING", ERR_LIB_SSL, 342},
++ #endif
++ #ifdef SSL_R_REUSE_CERT_LENGTH_NOT_ZERO
++ {"REUSE_CERT_LENGTH_NOT_ZERO", ERR_LIB_SSL,
SSL_R_REUSE_CERT_LENGTH_NOT_ZERO},
++ #else
++ {"REUSE_CERT_LENGTH_NOT_ZERO", ERR_LIB_SSL, 216},
++ #endif
++ #ifdef SSL_R_REUSE_CERT_TYPE_NOT_ZERO
++ {"REUSE_CERT_TYPE_NOT_ZERO", ERR_LIB_SSL,
SSL_R_REUSE_CERT_TYPE_NOT_ZERO},
++ #else
++ {"REUSE_CERT_TYPE_NOT_ZERO", ERR_LIB_SSL, 217},
++ #endif
++ #ifdef SSL_R_REUSE_CIPHER_LIST_NOT_ZERO
++ {"REUSE_CIPHER_LIST_NOT_ZERO", ERR_LIB_SSL,
SSL_R_REUSE_CIPHER_LIST_NOT_ZERO},
++ #else
++ {"REUSE_CIPHER_LIST_NOT_ZERO", ERR_LIB_SSL, 218},
++ #endif
++ #ifdef SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING
++ {"SCSV_RECEIVED_WHEN_RENEGOTIATING", ERR_LIB_SSL,
SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING},
++ #else
++ {"SCSV_RECEIVED_WHEN_RENEGOTIATING", ERR_LIB_SSL, 345},
++ #endif
++ #ifdef SSL_R_SERVERHELLO_TLSEXT
++ {"SERVERHELLO_TLSEXT", ERR_LIB_SSL, SSL_R_SERVERHELLO_TLSEXT},
++ #else
++ {"SERVERHELLO_TLSEXT", ERR_LIB_SSL, 275},
++ #endif
++ #ifdef SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED
++ {"SESSION_ID_CONTEXT_UNINITIALIZED", ERR_LIB_SSL,
SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED},
++ #else
++ {"SESSION_ID_CONTEXT_UNINITIALIZED", ERR_LIB_SSL, 277},
++ #endif
++ #ifdef SSL_R_SHORT_READ
++ {"SHORT_READ", ERR_LIB_SSL, SSL_R_SHORT_READ},
++ #else
++ {"SHORT_READ", ERR_LIB_SSL, 219},
++ #endif
++ #ifdef SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE
++ {"SIGNATURE_FOR_NON_SIGNING_CERTIFICATE", ERR_LIB_SSL,
SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE},
++ #else
++ {"SIGNATURE_FOR_NON_SIGNING_CERTIFICATE", ERR_LIB_SSL, 220},
++ #endif
++ #ifdef SSL_R_SSL23_DOING_SESSION_ID_REUSE
++ {"SSL23_DOING_SESSION_ID_REUSE", ERR_LIB_SSL,
SSL_R_SSL23_DOING_SESSION_ID_REUSE},
++ #else
++ {"SSL23_DOING_SESSION_ID_REUSE", ERR_LIB_SSL, 221},
++ #endif
++ #ifdef SSL_R_SSL2_CONNECTION_ID_TOO_LONG
++ {"SSL2_CONNECTION_ID_TOO_LONG", ERR_LIB_SSL,
SSL_R_SSL2_CONNECTION_ID_TOO_LONG},
++ #else
++ {"SSL2_CONNECTION_ID_TOO_LONG", ERR_LIB_SSL, 299},
++ #endif
++ #ifdef SSL_R_SSL3_EXT_INVALID_ECPOINTFORMAT
++ {"SSL3_EXT_INVALID_ECPOINTFORMAT", ERR_LIB_SSL,
SSL_R_SSL3_EXT_INVALID_ECPOINTFORMAT},
++ #else
++ {"SSL3_EXT_INVALID_ECPOINTFORMAT", ERR_LIB_SSL, 321},
++ #endif
++ #ifdef SSL_R_SSL3_EXT_INVALID_SERVERNAME
++ {"SSL3_EXT_INVALID_SERVERNAME", ERR_LIB_SSL,
SSL_R_SSL3_EXT_INVALID_SERVERNAME},
++ #else
++ {"SSL3_EXT_INVALID_SERVERNAME", ERR_LIB_SSL, 319},
++ #endif
++ #ifdef SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE
++ {"SSL3_EXT_INVALID_SERVERNAME_TYPE", ERR_LIB_SSL,
SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE},
++ #else
++ {"SSL3_EXT_INVALID_SERVERNAME_TYPE", ERR_LIB_SSL, 320},
++ #endif
++ #ifdef SSL_R_SSL3_SESSION_ID_TOO_LONG
++ {"SSL3_SESSION_ID_TOO_LONG", ERR_LIB_SSL,
SSL_R_SSL3_SESSION_ID_TOO_LONG},
++ #else
++ {"SSL3_SESSION_ID_TOO_LONG", ERR_LIB_SSL, 300},
++ #endif
++ #ifdef SSL_R_SSL3_SESSION_ID_TOO_SHORT
++ {"SSL3_SESSION_ID_TOO_SHORT", ERR_LIB_SSL,
SSL_R_SSL3_SESSION_ID_TOO_SHORT},
++ #else
++ {"SSL3_SESSION_ID_TOO_SHORT", ERR_LIB_SSL, 222},
++ #endif
++ #ifdef SSL_R_SSLV3_ALERT_BAD_CERTIFICATE
++ {"SSLV3_ALERT_BAD_CERTIFICATE", ERR_LIB_SSL,
SSL_R_SSLV3_ALERT_BAD_CERTIFICATE},
++ #else
++ {"SSLV3_ALERT_BAD_CERTIFICATE", ERR_LIB_SSL, 1042},
++ #endif
++ #ifdef SSL_R_SSLV3_ALERT_BAD_RECORD_MAC
++ {"SSLV3_ALERT_BAD_RECORD_MAC", ERR_LIB_SSL,
SSL_R_SSLV3_ALERT_BAD_RECORD_MAC},
++ #else
++ {"SSLV3_ALERT_BAD_RECORD_MAC", ERR_LIB_SSL, 1020},
++ #endif
++ #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED
++ {"SSLV3_ALERT_CERTIFICATE_EXPIRED", ERR_LIB_SSL,
SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED},
++ #else
++ {"SSLV3_ALERT_CERTIFICATE_EXPIRED", ERR_LIB_SSL, 1045},
++ #endif
++ #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED
++ {"SSLV3_ALERT_CERTIFICATE_REVOKED", ERR_LIB_SSL,
SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED},
++ #else
++ {"SSLV3_ALERT_CERTIFICATE_REVOKED", ERR_LIB_SSL, 1044},
++ #endif
++ #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN
++ {"SSLV3_ALERT_CERTIFICATE_UNKNOWN", ERR_LIB_SSL,
SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN},
++ #else
++ {"SSLV3_ALERT_CERTIFICATE_UNKNOWN", ERR_LIB_SSL, 1046},
++ #endif
++ #ifdef SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE
++ {"SSLV3_ALERT_DECOMPRESSION_FAILURE", ERR_LIB_SSL,
SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE},
++ #else
++ {"SSLV3_ALERT_DECOMPRESSION_FAILURE", ERR_LIB_SSL, 1030},
++ #endif
++ #ifdef SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE
++ {"SSLV3_ALERT_HANDSHAKE_FAILURE", ERR_LIB_SSL,
SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE},
++ #else
++ {"SSLV3_ALERT_HANDSHAKE_FAILURE", ERR_LIB_SSL, 1040},
++ #endif
++ #ifdef SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER
++ {"SSLV3_ALERT_ILLEGAL_PARAMETER", ERR_LIB_SSL,
SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER},
++ #else
++ {"SSLV3_ALERT_ILLEGAL_PARAMETER", ERR_LIB_SSL, 1047},
++ #endif
++ #ifdef SSL_R_SSLV3_ALERT_NO_CERTIFICATE
++ {"SSLV3_ALERT_NO_CERTIFICATE", ERR_LIB_SSL,
SSL_R_SSLV3_ALERT_NO_CERTIFICATE},
++ #else
++ {"SSLV3_ALERT_NO_CERTIFICATE", ERR_LIB_SSL, 1041},
++ #endif
++ #ifdef SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE
++ {"SSLV3_ALERT_UNEXPECTED_MESSAGE", ERR_LIB_SSL,
SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE},
++ #else
++ {"SSLV3_ALERT_UNEXPECTED_MESSAGE", ERR_LIB_SSL, 1010},
++ #endif
++ #ifdef SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE
++ {"SSLV3_ALERT_UNSUPPORTED_CERTIFICATE", ERR_LIB_SSL,
SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE},
++ #else
++ {"SSLV3_ALERT_UNSUPPORTED_CERTIFICATE", ERR_LIB_SSL, 1043},
++ #endif
++ #ifdef SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION
++ {"SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION", ERR_LIB_SSL,
SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION},
++ #else
++ {"SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION", ERR_LIB_SSL, 228},
++ #endif
++ #ifdef SSL_R_SSL_HANDSHAKE_FAILURE
++ {"SSL_HANDSHAKE_FAILURE", ERR_LIB_SSL, SSL_R_SSL_HANDSHAKE_FAILURE},
++ #else
++ {"SSL_HANDSHAKE_FAILURE", ERR_LIB_SSL, 229},
++ #endif
++ #ifdef SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS
++ {"SSL_LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL,
SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS},
++ #else
++ {"SSL_LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, 230},
++ #endif
++ #ifdef SSL_R_SSL_SESSION_ID_CALLBACK_FAILED
++ {"SSL_SESSION_ID_CALLBACK_FAILED", ERR_LIB_SSL,
SSL_R_SSL_SESSION_ID_CALLBACK_FAILED},
++ #else
++ {"SSL_SESSION_ID_CALLBACK_FAILED", ERR_LIB_SSL, 301},
++ #endif
++ #ifdef SSL_R_SSL_SESSION_ID_CONFLICT
++ {"SSL_SESSION_ID_CONFLICT", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CONFLICT},
++ #else
++ {"SSL_SESSION_ID_CONFLICT", ERR_LIB_SSL, 302},
++ #endif
++ #ifdef SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG
++ {"SSL_SESSION_ID_CONTEXT_TOO_LONG", ERR_LIB_SSL,
SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG},
++ #else
++ {"SSL_SESSION_ID_CONTEXT_TOO_LONG", ERR_LIB_SSL, 273},
++ #endif
++ #ifdef SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH
++ {"SSL_SESSION_ID_HAS_BAD_LENGTH", ERR_LIB_SSL,
SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH},
++ #else
++ {"SSL_SESSION_ID_HAS_BAD_LENGTH", ERR_LIB_SSL, 303},
++ #endif
++ #ifdef SSL_R_SSL_SESSION_ID_IS_DIFFERENT
++ {"SSL_SESSION_ID_IS_DIFFERENT", ERR_LIB_SSL,
SSL_R_SSL_SESSION_ID_IS_DIFFERENT},
++ #else
++ {"SSL_SESSION_ID_IS_DIFFERENT", ERR_LIB_SSL, 231},
++ #endif
++ #ifdef SSL_R_TLSV1_ALERT_ACCESS_DENIED
++ {"TLSV1_ALERT_ACCESS_DENIED", ERR_LIB_SSL,
SSL_R_TLSV1_ALERT_ACCESS_DENIED},
++ #else
++ {"TLSV1_ALERT_ACCESS_DENIED", ERR_LIB_SSL, 1049},
++ #endif
++ #ifdef SSL_R_TLSV1_ALERT_DECODE_ERROR
++ {"TLSV1_ALERT_DECODE_ERROR", ERR_LIB_SSL,
SSL_R_TLSV1_ALERT_DECODE_ERROR},
++ #else
++ {"TLSV1_ALERT_DECODE_ERROR", ERR_LIB_SSL, 1050},
++ #endif
++ #ifdef SSL_R_TLSV1_ALERT_DECRYPTION_FAILED
++ {"TLSV1_ALERT_DECRYPTION_FAILED", ERR_LIB_SSL,
SSL_R_TLSV1_ALERT_DECRYPTION_FAILED},
++ #else
++ {"TLSV1_ALERT_DECRYPTION_FAILED", ERR_LIB_SSL, 1021},
++ #endif
++ #ifdef SSL_R_TLSV1_ALERT_DECRYPT_ERROR
++ {"TLSV1_ALERT_DECRYPT_ERROR", ERR_LIB_SSL,
SSL_R_TLSV1_ALERT_DECRYPT_ERROR},
++ #else
++ {"TLSV1_ALERT_DECRYPT_ERROR", ERR_LIB_SSL, 1051},
++ #endif
++ #ifdef SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION
++ {"TLSV1_ALERT_EXPORT_RESTRICTION", ERR_LIB_SSL,
SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION},
++ #else
++ {"TLSV1_ALERT_EXPORT_RESTRICTION", ERR_LIB_SSL, 1060},
++ #endif
++ #ifdef SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY
++ {"TLSV1_ALERT_INSUFFICIENT_SECURITY", ERR_LIB_SSL,
SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY},
++ #else
++ {"TLSV1_ALERT_INSUFFICIENT_SECURITY", ERR_LIB_SSL, 1071},
++ #endif
++ #ifdef SSL_R_TLSV1_ALERT_INTERNAL_ERROR
++ {"TLSV1_ALERT_INTERNAL_ERROR", ERR_LIB_SSL,
SSL_R_TLSV1_ALERT_INTERNAL_ERROR},
++ #else
++ {"TLSV1_ALERT_INTERNAL_ERROR", ERR_LIB_SSL, 1080},
++ #endif
++ #ifdef SSL_R_TLSV1_ALERT_NO_RENEGOTIATION
++ {"TLSV1_ALERT_NO_RENEGOTIATION", ERR_LIB_SSL,
SSL_R_TLSV1_ALERT_NO_RENEGOTIATION},
++ #else
++ {"TLSV1_ALERT_NO_RENEGOTIATION", ERR_LIB_SSL, 1100},
++ #endif
++ #ifdef SSL_R_TLSV1_ALERT_PROTOCOL_VERSION
++ {"TLSV1_ALERT_PROTOCOL_VERSION", ERR_LIB_SSL,
SSL_R_TLSV1_ALERT_PROTOCOL_VERSION},
++ #else
++ {"TLSV1_ALERT_PROTOCOL_VERSION", ERR_LIB_SSL, 1070},
++ #endif
++ #ifdef SSL_R_TLSV1_ALERT_RECORD_OVERFLOW
++ {"TLSV1_ALERT_RECORD_OVERFLOW", ERR_LIB_SSL,
SSL_R_TLSV1_ALERT_RECORD_OVERFLOW},
++ #else
++ {"TLSV1_ALERT_RECORD_OVERFLOW", ERR_LIB_SSL, 1022},
++ #endif
++ #ifdef SSL_R_TLSV1_ALERT_UNKNOWN_CA
++ {"TLSV1_ALERT_UNKNOWN_CA", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_UNKNOWN_CA},
++ #else
++ {"TLSV1_ALERT_UNKNOWN_CA", ERR_LIB_SSL, 1048},
++ #endif
++ #ifdef SSL_R_TLSV1_ALERT_USER_CANCELLED
++ {"TLSV1_ALERT_USER_CANCELLED", ERR_LIB_SSL,
SSL_R_TLSV1_ALERT_USER_CANCELLED},
++ #else
++ {"TLSV1_ALERT_USER_CANCELLED", ERR_LIB_SSL, 1090},
++ #endif
++ #ifdef SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE
++ {"TLSV1_BAD_CERTIFICATE_HASH_VALUE", ERR_LIB_SSL,
SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE},
++ #else
++ {"TLSV1_BAD_CERTIFICATE_HASH_VALUE", ERR_LIB_SSL, 1114},
++ #endif
++ #ifdef SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE
++ {"TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE", ERR_LIB_SSL,
SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE},
++ #else
++ {"TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE", ERR_LIB_SSL, 1113},
++ #endif
++ #ifdef SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE
++ {"TLSV1_CERTIFICATE_UNOBTAINABLE", ERR_LIB_SSL,
SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE},
++ #else
++ {"TLSV1_CERTIFICATE_UNOBTAINABLE", ERR_LIB_SSL, 1111},
++ #endif
++ #ifdef SSL_R_TLSV1_UNRECOGNIZED_NAME
++ {"TLSV1_UNRECOGNIZED_NAME", ERR_LIB_SSL, SSL_R_TLSV1_UNRECOGNIZED_NAME},
++ #else
++ {"TLSV1_UNRECOGNIZED_NAME", ERR_LIB_SSL, 1112},
++ #endif
++ #ifdef SSL_R_TLSV1_UNSUPPORTED_EXTENSION
++ {"TLSV1_UNSUPPORTED_EXTENSION", ERR_LIB_SSL,
SSL_R_TLSV1_UNSUPPORTED_EXTENSION},
++ #else
++ {"TLSV1_UNSUPPORTED_EXTENSION", ERR_LIB_SSL, 1110},
++ #endif
++ #ifdef SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER
++ {"TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER", ERR_LIB_SSL,
SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER},
++ #else
++ {"TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER", ERR_LIB_SSL, 232},
++ #endif
++ #ifdef SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST
++ {"TLS_INVALID_ECPOINTFORMAT_LIST", ERR_LIB_SSL,
SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST},
++ #else
++ {"TLS_INVALID_ECPOINTFORMAT_LIST", ERR_LIB_SSL, 157},
++ #endif
++ #ifdef SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST
++ {"TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST", ERR_LIB_SSL,
SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST},
++ #else
++ {"TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST", ERR_LIB_SSL, 233},
++ #endif
++ #ifdef SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG
++ {"TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG", ERR_LIB_SSL,
SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG},
++ #else
++ {"TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG", ERR_LIB_SSL, 234},
++ #endif
++ #ifdef SSL_R_TRIED_TO_USE_UNSUPPORTED_CIPHER
++ {"TRIED_TO_USE_UNSUPPORTED_CIPHER", ERR_LIB_SSL,
SSL_R_TRIED_TO_USE_UNSUPPORTED_CIPHER},
++ #else
++ {"TRIED_TO_USE_UNSUPPORTED_CIPHER", ERR_LIB_SSL, 235},
++ #endif
++ #ifdef SSL_R_UNABLE_TO_DECODE_DH_CERTS
++ {"UNABLE_TO_DECODE_DH_CERTS", ERR_LIB_SSL,
SSL_R_UNABLE_TO_DECODE_DH_CERTS},
++ #else
++ {"UNABLE_TO_DECODE_DH_CERTS", ERR_LIB_SSL, 236},
++ #endif
++ #ifdef SSL_R_UNABLE_TO_DECODE_ECDH_CERTS
++ {"UNABLE_TO_DECODE_ECDH_CERTS", ERR_LIB_SSL,
SSL_R_UNABLE_TO_DECODE_ECDH_CERTS},
++ #else
++ {"UNABLE_TO_DECODE_ECDH_CERTS", ERR_LIB_SSL, 313},
++ #endif
++ #ifdef SSL_R_UNABLE_TO_EXTRACT_PUBLIC_KEY
++ {"UNABLE_TO_EXTRACT_PUBLIC_KEY", ERR_LIB_SSL,
SSL_R_UNABLE_TO_EXTRACT_PUBLIC_KEY},
++ #else
++ {"UNABLE_TO_EXTRACT_PUBLIC_KEY", ERR_LIB_SSL, 237},
++ #endif
++ #ifdef SSL_R_UNABLE_TO_FIND_DH_PARAMETERS
++ {"UNABLE_TO_FIND_DH_PARAMETERS", ERR_LIB_SSL,
SSL_R_UNABLE_TO_FIND_DH_PARAMETERS},
++ #else
++ {"UNABLE_TO_FIND_DH_PARAMETERS", ERR_LIB_SSL, 238},
++ #endif
++ #ifdef SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS
++ {"UNABLE_TO_FIND_ECDH_PARAMETERS", ERR_LIB_SSL,
SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS},
++ #else
++ {"UNABLE_TO_FIND_ECDH_PARAMETERS", ERR_LIB_SSL, 314},
++ #endif
++ #ifdef SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS
++ {"UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS", ERR_LIB_SSL,
SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS},
++ #else
++ {"UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS", ERR_LIB_SSL, 239},
++ #endif
++ #ifdef SSL_R_UNABLE_TO_FIND_SSL_METHOD
++ {"UNABLE_TO_FIND_SSL_METHOD", ERR_LIB_SSL,
SSL_R_UNABLE_TO_FIND_SSL_METHOD},
++ #else
++ {"UNABLE_TO_FIND_SSL_METHOD", ERR_LIB_SSL, 240},
++ #endif
++ #ifdef SSL_R_UNABLE_TO_LOAD_SSL2_MD5_ROUTINES
++ {"UNABLE_TO_LOAD_SSL2_MD5_ROUTINES", ERR_LIB_SSL,
SSL_R_UNABLE_TO_LOAD_SSL2_MD5_ROUTINES},
++ #else
++ {"UNABLE_TO_LOAD_SSL2_MD5_ROUTINES", ERR_LIB_SSL, 241},
++ #endif
++ #ifdef SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES
++ {"UNABLE_TO_LOAD_SSL3_MD5_ROUTINES", ERR_LIB_SSL,
SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES},
++ #else
++ {"UNABLE_TO_LOAD_SSL3_MD5_ROUTINES", ERR_LIB_SSL, 242},
++ #endif
++ #ifdef SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES
++ {"UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES", ERR_LIB_SSL,
SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES},
++ #else
++ {"UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES", ERR_LIB_SSL, 243},
++ #endif
++ #ifdef SSL_R_UNEXPECTED_MESSAGE
++ {"UNEXPECTED_MESSAGE", ERR_LIB_SSL, SSL_R_UNEXPECTED_MESSAGE},
++ #else
++ {"UNEXPECTED_MESSAGE", ERR_LIB_SSL, 244},
++ #endif
++ #ifdef SSL_R_UNEXPECTED_RECORD
++ {"UNEXPECTED_RECORD", ERR_LIB_SSL, SSL_R_UNEXPECTED_RECORD},
++ #else
++ {"UNEXPECTED_RECORD", ERR_LIB_SSL, 245},
++ #endif
++ #ifdef SSL_R_UNINITIALIZED
++ {"UNINITIALIZED", ERR_LIB_SSL, SSL_R_UNINITIALIZED},
++ #else
++ {"UNINITIALIZED", ERR_LIB_SSL, 276},
++ #endif
++ #ifdef SSL_R_UNKNOWN_ALERT_TYPE
++ {"UNKNOWN_ALERT_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_ALERT_TYPE},
++ #else
++ {"UNKNOWN_ALERT_TYPE", ERR_LIB_SSL, 246},
++ #endif
++ #ifdef SSL_R_UNKNOWN_CERTIFICATE_TYPE
++ {"UNKNOWN_CERTIFICATE_TYPE", ERR_LIB_SSL,
SSL_R_UNKNOWN_CERTIFICATE_TYPE},
++ #else
++ {"UNKNOWN_CERTIFICATE_TYPE", ERR_LIB_SSL, 247},
++ #endif
++ #ifdef SSL_R_UNKNOWN_CIPHER_RETURNED
++ {"UNKNOWN_CIPHER_RETURNED", ERR_LIB_SSL, SSL_R_UNKNOWN_CIPHER_RETURNED},
++ #else
++ {"UNKNOWN_CIPHER_RETURNED", ERR_LIB_SSL, 248},
++ #endif
++ #ifdef SSL_R_UNKNOWN_CIPHER_TYPE
++ {"UNKNOWN_CIPHER_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_CIPHER_TYPE},
++ #else
++ {"UNKNOWN_CIPHER_TYPE", ERR_LIB_SSL, 249},
++ #endif
++ #ifdef SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE
++ {"UNKNOWN_KEY_EXCHANGE_TYPE", ERR_LIB_SSL,
SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE},
++ #else
++ {"UNKNOWN_KEY_EXCHANGE_TYPE", ERR_LIB_SSL, 250},
++ #endif
++ #ifdef SSL_R_UNKNOWN_PKEY_TYPE
++ {"UNKNOWN_PKEY_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_PKEY_TYPE},
++ #else
++ {"UNKNOWN_PKEY_TYPE", ERR_LIB_SSL, 251},
++ #endif
++ #ifdef SSL_R_UNKNOWN_PROTOCOL
++ {"UNKNOWN_PROTOCOL", ERR_LIB_SSL, SSL_R_UNKNOWN_PROTOCOL},
++ #else
++ {"UNKNOWN_PROTOCOL", ERR_LIB_SSL, 252},
++ #endif
++ #ifdef SSL_R_UNKNOWN_REMOTE_ERROR_TYPE
++ {"UNKNOWN_REMOTE_ERROR_TYPE", ERR_LIB_SSL,
SSL_R_UNKNOWN_REMOTE_ERROR_TYPE},
++ #else
++ {"UNKNOWN_REMOTE_ERROR_TYPE", ERR_LIB_SSL, 253},
++ #endif
++ #ifdef SSL_R_UNKNOWN_SSL_VERSION
++ {"UNKNOWN_SSL_VERSION", ERR_LIB_SSL, SSL_R_UNKNOWN_SSL_VERSION},
++ #else
++ {"UNKNOWN_SSL_VERSION", ERR_LIB_SSL, 254},
++ #endif
++ #ifdef SSL_R_UNKNOWN_STATE
++ {"UNKNOWN_STATE", ERR_LIB_SSL, SSL_R_UNKNOWN_STATE},
++ #else
++ {"UNKNOWN_STATE", ERR_LIB_SSL, 255},
++ #endif
++ #ifdef SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED
++ {"UNSAFE_LEGACY_RENEGOTIATION_DISABLED", ERR_LIB_SSL,
SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED},
++ #else
++ {"UNSAFE_LEGACY_RENEGOTIATION_DISABLED", ERR_LIB_SSL, 338},
++ #endif
++ #ifdef SSL_R_UNSUPPORTED_CIPHER
++ {"UNSUPPORTED_CIPHER", ERR_LIB_SSL, SSL_R_UNSUPPORTED_CIPHER},
++ #else
++ {"UNSUPPORTED_CIPHER", ERR_LIB_SSL, 256},
++ #endif
++ #ifdef SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM
++ {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_SSL,
SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM},
++ #else
++ {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_SSL, 257},
++ #endif
++ #ifdef SSL_R_UNSUPPORTED_DIGEST_TYPE
++ {"UNSUPPORTED_DIGEST_TYPE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_DIGEST_TYPE},
++ #else
++ {"UNSUPPORTED_DIGEST_TYPE", ERR_LIB_SSL, 326},
++ #endif
++ #ifdef SSL_R_UNSUPPORTED_ELLIPTIC_CURVE
++ {"UNSUPPORTED_ELLIPTIC_CURVE", ERR_LIB_SSL,
SSL_R_UNSUPPORTED_ELLIPTIC_CURVE},
++ #else
++ {"UNSUPPORTED_ELLIPTIC_CURVE", ERR_LIB_SSL, 315},
++ #endif
++ #ifdef SSL_R_UNSUPPORTED_PROTOCOL
++ {"UNSUPPORTED_PROTOCOL", ERR_LIB_SSL, SSL_R_UNSUPPORTED_PROTOCOL},
++ #else
++ {"UNSUPPORTED_PROTOCOL", ERR_LIB_SSL, 258},
++ #endif
++ #ifdef SSL_R_UNSUPPORTED_SSL_VERSION
++ {"UNSUPPORTED_SSL_VERSION", ERR_LIB_SSL, SSL_R_UNSUPPORTED_SSL_VERSION},
++ #else
++ {"UNSUPPORTED_SSL_VERSION", ERR_LIB_SSL, 259},
++ #endif
++ #ifdef SSL_R_UNSUPPORTED_STATUS_TYPE
++ {"UNSUPPORTED_STATUS_TYPE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_STATUS_TYPE},
++ #else
++ {"UNSUPPORTED_STATUS_TYPE", ERR_LIB_SSL, 329},
++ #endif
++ #ifdef SSL_R_WRITE_BIO_NOT_SET
++ {"WRITE_BIO_NOT_SET", ERR_LIB_SSL, SSL_R_WRITE_BIO_NOT_SET},
++ #else
++ {"WRITE_BIO_NOT_SET", ERR_LIB_SSL, 260},
++ #endif
++ #ifdef SSL_R_WRONG_CIPHER_RETURNED
++ {"WRONG_CIPHER_RETURNED", ERR_LIB_SSL, SSL_R_WRONG_CIPHER_RETURNED},
++ #else
++ {"WRONG_CIPHER_RETURNED", ERR_LIB_SSL, 261},
++ #endif
++ #ifdef SSL_R_WRONG_MESSAGE_TYPE
++ {"WRONG_MESSAGE_TYPE", ERR_LIB_SSL, SSL_R_WRONG_MESSAGE_TYPE},
++ #else
++ {"WRONG_MESSAGE_TYPE", ERR_LIB_SSL, 262},
++ #endif
++ #ifdef SSL_R_WRONG_NUMBER_OF_KEY_BITS
++ {"WRONG_NUMBER_OF_KEY_BITS", ERR_LIB_SSL,
SSL_R_WRONG_NUMBER_OF_KEY_BITS},
++ #else
++ {"WRONG_NUMBER_OF_KEY_BITS", ERR_LIB_SSL, 263},
++ #endif
++ #ifdef SSL_R_WRONG_SIGNATURE_LENGTH
++ {"WRONG_SIGNATURE_LENGTH", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_LENGTH},
++ #else
++ {"WRONG_SIGNATURE_LENGTH", ERR_LIB_SSL, 264},
++ #endif
++ #ifdef SSL_R_WRONG_SIGNATURE_SIZE
++ {"WRONG_SIGNATURE_SIZE", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_SIZE},
++ #else
++ {"WRONG_SIGNATURE_SIZE", ERR_LIB_SSL, 265},
++ #endif
++ #ifdef SSL_R_WRONG_SSL_VERSION
++ {"WRONG_SSL_VERSION", ERR_LIB_SSL, SSL_R_WRONG_SSL_VERSION},
++ #else
++ {"WRONG_SSL_VERSION", ERR_LIB_SSL, 266},
++ #endif
++ #ifdef SSL_R_WRONG_VERSION_NUMBER
++ {"WRONG_VERSION_NUMBER", ERR_LIB_SSL, SSL_R_WRONG_VERSION_NUMBER},
++ #else
++ {"WRONG_VERSION_NUMBER", ERR_LIB_SSL, 267},
++ #endif
++ #ifdef SSL_R_X509_LIB
++ {"X509_LIB", ERR_LIB_SSL, SSL_R_X509_LIB},
++ #else
++ {"X509_LIB", ERR_LIB_SSL, 268},
++ #endif
++ #ifdef SSL_R_X509_VERIFICATION_SETUP_PROBLEMS
++ {"X509_VERIFICATION_SETUP_PROBLEMS", ERR_LIB_SSL,
SSL_R_X509_VERIFICATION_SETUP_PROBLEMS},
++ #else
++ {"X509_VERIFICATION_SETUP_PROBLEMS", ERR_LIB_SSL, 269},
++ #endif
++ #ifdef X509_R_BAD_X509_FILETYPE
++ {"BAD_X509_FILETYPE", ERR_LIB_X509, X509_R_BAD_X509_FILETYPE},
++ #else
++ {"BAD_X509_FILETYPE", ERR_LIB_X509, 100},
++ #endif
++ #ifdef X509_R_BASE64_DECODE_ERROR
++ {"BASE64_DECODE_ERROR", ERR_LIB_X509, X509_R_BASE64_DECODE_ERROR},
++ #else
++ {"BASE64_DECODE_ERROR", ERR_LIB_X509, 118},
++ #endif
++ #ifdef X509_R_CANT_CHECK_DH_KEY
++ {"CANT_CHECK_DH_KEY", ERR_LIB_X509, X509_R_CANT_CHECK_DH_KEY},
++ #else
++ {"CANT_CHECK_DH_KEY", ERR_LIB_X509, 114},
++ #endif
++ #ifdef X509_R_CERT_ALREADY_IN_HASH_TABLE
++ {"CERT_ALREADY_IN_HASH_TABLE", ERR_LIB_X509,
X509_R_CERT_ALREADY_IN_HASH_TABLE},
++ #else
++ {"CERT_ALREADY_IN_HASH_TABLE", ERR_LIB_X509, 101},
++ #endif
++ #ifdef X509_R_ERR_ASN1_LIB
++ {"ERR_ASN1_LIB", ERR_LIB_X509, X509_R_ERR_ASN1_LIB},
++ #else
++ {"ERR_ASN1_LIB", ERR_LIB_X509, 102},
++ #endif
++ #ifdef X509_R_INVALID_DIRECTORY
++ {"INVALID_DIRECTORY", ERR_LIB_X509, X509_R_INVALID_DIRECTORY},
++ #else
++ {"INVALID_DIRECTORY", ERR_LIB_X509, 113},
++ #endif
++ #ifdef X509_R_INVALID_FIELD_NAME
++ {"INVALID_FIELD_NAME", ERR_LIB_X509, X509_R_INVALID_FIELD_NAME},
++ #else
++ {"INVALID_FIELD_NAME", ERR_LIB_X509, 119},
++ #endif
++ #ifdef X509_R_INVALID_TRUST
++ {"INVALID_TRUST", ERR_LIB_X509, X509_R_INVALID_TRUST},
++ #else
++ {"INVALID_TRUST", ERR_LIB_X509, 123},
++ #endif
++ #ifdef X509_R_KEY_TYPE_MISMATCH
++ {"KEY_TYPE_MISMATCH", ERR_LIB_X509, X509_R_KEY_TYPE_MISMATCH},
++ #else
++ {"KEY_TYPE_MISMATCH", ERR_LIB_X509, 115},
++ #endif
++ #ifdef X509_R_KEY_VALUES_MISMATCH
++ {"KEY_VALUES_MISMATCH", ERR_LIB_X509, X509_R_KEY_VALUES_MISMATCH},
++ #else
++ {"KEY_VALUES_MISMATCH", ERR_LIB_X509, 116},
++ #endif
++ #ifdef X509_R_LOADING_CERT_DIR
++ {"LOADING_CERT_DIR", ERR_LIB_X509, X509_R_LOADING_CERT_DIR},
++ #else
++ {"LOADING_CERT_DIR", ERR_LIB_X509, 103},
++ #endif
++ #ifdef X509_R_LOADING_DEFAULTS
++ {"LOADING_DEFAULTS", ERR_LIB_X509, X509_R_LOADING_DEFAULTS},
++ #else
++ {"LOADING_DEFAULTS", ERR_LIB_X509, 104},
++ #endif
++ #ifdef X509_R_METHOD_NOT_SUPPORTED
++ {"METHOD_NOT_SUPPORTED", ERR_LIB_X509, X509_R_METHOD_NOT_SUPPORTED},
++ #else
++ {"METHOD_NOT_SUPPORTED", ERR_LIB_X509, 124},
++ #endif
++ #ifdef X509_R_NO_CERT_SET_FOR_US_TO_VERIFY
++ {"NO_CERT_SET_FOR_US_TO_VERIFY", ERR_LIB_X509,
X509_R_NO_CERT_SET_FOR_US_TO_VERIFY},
++ #else
++ {"NO_CERT_SET_FOR_US_TO_VERIFY", ERR_LIB_X509, 105},
++ #endif
++ #ifdef X509_R_PUBLIC_KEY_DECODE_ERROR
++ {"PUBLIC_KEY_DECODE_ERROR", ERR_LIB_X509,
X509_R_PUBLIC_KEY_DECODE_ERROR},
++ #else
++ {"PUBLIC_KEY_DECODE_ERROR", ERR_LIB_X509, 125},
++ #endif
++ #ifdef X509_R_PUBLIC_KEY_ENCODE_ERROR
++ {"PUBLIC_KEY_ENCODE_ERROR", ERR_LIB_X509,
X509_R_PUBLIC_KEY_ENCODE_ERROR},
++ #else
++ {"PUBLIC_KEY_ENCODE_ERROR", ERR_LIB_X509, 126},
++ #endif
++ #ifdef X509_R_SHOULD_RETRY
++ {"SHOULD_RETRY", ERR_LIB_X509, X509_R_SHOULD_RETRY},
++ #else
++ {"SHOULD_RETRY", ERR_LIB_X509, 106},
++ #endif
++ #ifdef X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN
++ {"UNABLE_TO_FIND_PARAMETERS_IN_CHAIN", ERR_LIB_X509,
X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN},
++ #else
++ {"UNABLE_TO_FIND_PARAMETERS_IN_CHAIN", ERR_LIB_X509, 107},
++ #endif
++ #ifdef X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY
++ {"UNABLE_TO_GET_CERTS_PUBLIC_KEY", ERR_LIB_X509,
X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY},
++ #else
++ {"UNABLE_TO_GET_CERTS_PUBLIC_KEY", ERR_LIB_X509, 108},
++ #endif
++ #ifdef X509_R_UNKNOWN_KEY_TYPE
++ {"UNKNOWN_KEY_TYPE", ERR_LIB_X509, X509_R_UNKNOWN_KEY_TYPE},
++ #else
++ {"UNKNOWN_KEY_TYPE", ERR_LIB_X509, 117},
++ #endif
++ #ifdef X509_R_UNKNOWN_NID
++ {"UNKNOWN_NID", ERR_LIB_X509, X509_R_UNKNOWN_NID},
++ #else
++ {"UNKNOWN_NID", ERR_LIB_X509, 109},
++ #endif
++ #ifdef X509_R_UNKNOWN_PURPOSE_ID
++ {"UNKNOWN_PURPOSE_ID", ERR_LIB_X509, X509_R_UNKNOWN_PURPOSE_ID},
++ #else
++ {"UNKNOWN_PURPOSE_ID", ERR_LIB_X509, 121},
++ #endif
++ #ifdef X509_R_UNKNOWN_TRUST_ID
++ {"UNKNOWN_TRUST_ID", ERR_LIB_X509, X509_R_UNKNOWN_TRUST_ID},
++ #else
++ {"UNKNOWN_TRUST_ID", ERR_LIB_X509, 120},
++ #endif
++ #ifdef X509_R_UNSUPPORTED_ALGORITHM
++ {"UNSUPPORTED_ALGORITHM", ERR_LIB_X509, X509_R_UNSUPPORTED_ALGORITHM},
++ #else
++ {"UNSUPPORTED_ALGORITHM", ERR_LIB_X509, 111},
++ #endif
++ #ifdef X509_R_WRONG_LOOKUP_TYPE
++ {"WRONG_LOOKUP_TYPE", ERR_LIB_X509, X509_R_WRONG_LOOKUP_TYPE},
++ #else
++ {"WRONG_LOOKUP_TYPE", ERR_LIB_X509, 112},
++ #endif
++ #ifdef X509_R_WRONG_TYPE
++ {"WRONG_TYPE", ERR_LIB_X509, X509_R_WRONG_TYPE},
++ #else
++ {"WRONG_TYPE", ERR_LIB_X509, 122},
++ #endif
++ { NULL }
++};
diff --git a/00197-unicode_fromformat.patch b/00197-unicode_fromformat.patch
new file mode 100644
index 0000000..95031d5
--- /dev/null
+++ b/00197-unicode_fromformat.patch
@@ -0,0 +1,208 @@
+diff -r 847a0e74c4cc Lib/test/test_unicode.py
+--- a/Lib/test/test_unicode.py Sun Jul 20 21:26:04 2014 -0700
++++ b/Lib/test/test_unicode.py Tue Jul 22 00:13:24 2014 +0200
+@@ -1659,6 +1659,122 @@ class UnicodeTest(
+ self.assertEqual("%s" % u, u'__unicode__ overridden')
+ self.assertEqual("{}".format(u), '__unicode__ overridden')
+
++ # Test PyUnicode_FromFormat()
++ def test_from_format(self):
++ test_support.import_module('ctypes')
++ from ctypes import (
++ pythonapi, py_object, sizeof,
++ c_int, c_long, c_longlong, c_ssize_t,
++ c_uint, c_ulong, c_ulonglong, c_size_t, c_void_p)
++ if sys.maxunicode == 0xffff:
++ name = "PyUnicodeUCS2_FromFormat"
++ else:
++ name = "PyUnicodeUCS4_FromFormat"
++ _PyUnicode_FromFormat = getattr(pythonapi, name)
++ _PyUnicode_FromFormat.restype = py_object
++
++ def PyUnicode_FromFormat(format, *args):
++ cargs = tuple(
++ py_object(arg) if isinstance(arg, unicode) else arg
++ for arg in args)
++ return _PyUnicode_FromFormat(format, *cargs)
++
++ def check_format(expected, format, *args):
++ text = PyUnicode_FromFormat(format, *args)
++ self.assertEqual(expected, text)
++
++ # ascii format, non-ascii argument
++ check_format(u'ascii\x7f=unicode\xe9',
++ b'ascii\x7f=%U', u'unicode\xe9')
++
++ # non-ascii format, ascii argument: ensure that PyUnicode_FromFormatV()
++ # raises an error
++ #self.assertRaisesRegex(ValueError,
++ # '^PyUnicode_FromFormatV\(\) expects an ASCII-encoded format '
++ # 'string, got a non-ASCII byte: 0xe9$',
++ # PyUnicode_FromFormat, b'unicode\xe9=%s', u'ascii')
++
++ # test "%c"
++ check_format(u'\uabcd',
++ b'%c', c_int(0xabcd))
++ if sys.maxunicode > 0xffff:
++ check_format(u'\U0010ffff',
++ b'%c', c_int(0x10ffff))
++ with self.assertRaises(OverflowError):
++ PyUnicode_FromFormat(b'%c', c_int(0x110000))
++ # Issue #18183
++ if sys.maxunicode > 0xffff:
++ check_format(u'\U00010000\U00100000',
++ b'%c%c', c_int(0x10000), c_int(0x100000))
++
++ # test "%"
++ check_format(u'%',
++ b'%')
++ check_format(u'%',
++ b'%%')
++ check_format(u'%s',
++ b'%%s')
++ check_format(u'[%]',
++ b'[%%]')
++ check_format(u'%abc',
++ b'%%%s', b'abc')
++
++ # test %S
++ check_format(u"repr=abc",
++ b'repr=%S', u'abc')
++
++ # test %R
++ check_format(u"repr=u'abc'",
++ b'repr=%R', u'abc')
++
++ # test integer formats (%i, %d, %u)
++ check_format(u'010',
++ b'%03i', c_int(10))
++ check_format(u'0010',
++ b'%0.4i', c_int(10))
++ check_format(u'-123',
++ b'%i', c_int(-123))
++ check_format(u'-123',
++ b'%li', c_long(-123))
++ check_format(u'-123',
++ b'%zi', c_ssize_t(-123))
++
++ check_format(u'-123',
++ b'%d', c_int(-123))
++ check_format(u'-123',
++ b'%ld', c_long(-123))
++ check_format(u'-123',
++ b'%zd', c_ssize_t(-123))
++
++ check_format(u'123',
++ b'%u', c_uint(123))
++ check_format(u'123',
++ b'%lu', c_ulong(123))
++ check_format(u'123',
++ b'%zu', c_size_t(123))
++
++ # test long output
++ PyUnicode_FromFormat(b'%p', c_void_p(-1))
++
++ # test %V
++ check_format(u'repr=abc',
++ b'repr=%V', u'abc', b'xyz')
++ check_format(u'repr=\xe4\xba\xba\xe6\xb0\x91',
++ b'repr=%V', None, b'\xe4\xba\xba\xe6\xb0\x91')
++ check_format(u'repr=abc\xff',
++ b'repr=%V', None, b'abc\xff')
++
++ # not supported: copy the raw format string. these tests are just here
++ # to check for crashs and should not be considered as specifications
++ check_format(u'%s',
++ b'%1%s', b'abc')
++ check_format(u'%1abc',
++ b'%1abc')
++ check_format(u'%+i',
++ b'%+i', c_int(10))
++ check_format(u'%s',
++ b'%.%s', b'abc')
++
+ @test_support.cpython_only
+ def test_encode_decimal(self):
+ from _testcapi import unicode_encodedecimal
+diff -r 847a0e74c4cc Objects/unicodeobject.c
+--- a/Objects/unicodeobject.c Sun Jul 20 21:26:04 2014 -0700
++++ b/Objects/unicodeobject.c Tue Jul 22 00:13:24 2014 +0200
+@@ -690,7 +690,12 @@ makefmt(char *fmt, int longflag, int siz
+ *fmt = '\0';
+ }
+
+-#define appendstring(string) {for (copy = string;*copy;) *s++ = *copy++;}
++#define appendstring(string) \
++ do { \
++ for (copy = string;*copy; copy++) { \
++ *s++ = (unsigned char)*copy; \
++ } \
++ } while (0)
+
+ PyObject *
+ PyUnicode_FromFormatV(const char *format, va_list vargs)
+@@ -845,7 +850,7 @@ PyUnicode_FromFormatV(const char *format
+ str = PyObject_Str(obj);
+ if (!str)
+ goto fail;
+- n += PyUnicode_GET_SIZE(str);
++ n += PyString_GET_SIZE(str);
+ /* Remember the str and switch to the next slot */
+ *callresult++ = str;
+ break;
+@@ -925,12 +930,12 @@ PyUnicode_FromFormatV(const char *format
+ }
+ /* handle the long flag, but only for %ld and %lu.
+ others can be added when necessary. */
+- if (*f == 'l' && (f[1] == 'd' || f[1] ==
'u')) {
++ if (*f == 'l' && (f[1] == 'd' || f[1] == 'i'
|| f[1] == 'u')) {
+ longflag = 1;
+ ++f;
+ }
+ /* handle the size_t flag. */
+- if (*f == 'z' && (f[1] == 'd' || f[1] ==
'u')) {
++ if (*f == 'z' && (f[1] == 'd' || f[1] == 'i'
|| f[1] == 'u')) {
+ size_tflag = 1;
+ ++f;
+ }
+@@ -939,8 +944,9 @@ PyUnicode_FromFormatV(const char *format
+ case 'c':
+ *s++ = va_arg(vargs, int);
+ break;
++ case 'i':
+ case 'd':
+- makefmt(fmt, longflag, size_tflag, zeropad, width, precision,
'd');
++ makefmt(fmt, longflag, size_tflag, zeropad, width, precision, *f);
+ if (longflag)
+ sprintf(realbuffer, fmt, va_arg(vargs, long));
+ else if (size_tflag)
+@@ -959,11 +965,6 @@ PyUnicode_FromFormatV(const char *format
+ sprintf(realbuffer, fmt, va_arg(vargs, unsigned int));
+ appendstring(realbuffer);
+ break;
+- case 'i':
+- makefmt(fmt, 0, 0, zeropad, width, precision, 'i');
+- sprintf(realbuffer, fmt, va_arg(vargs, int));
+- appendstring(realbuffer);
+- break;
+ case 'x':
+ makefmt(fmt, 0, 0, zeropad, width, precision, 'x');
+ sprintf(realbuffer, fmt, va_arg(vargs, int));
+@@ -1006,15 +1007,10 @@ PyUnicode_FromFormatV(const char *format
+ case 'S':
+ case 'R':
+ {
+- Py_UNICODE *ucopy;
+- Py_ssize_t usize;
+- Py_ssize_t upos;
++ const char *str = PyString_AS_STRING(*callresult);
+ /* unused, since we already have the result */
+ (void) va_arg(vargs, PyObject *);
+- ucopy = PyUnicode_AS_UNICODE(*callresult);
+- usize = PyUnicode_GET_SIZE(*callresult);
+- for (upos = 0; upos<usize;)
+- *s++ = ucopy[upos++];
++ appendstring(str);
+ /* We're done with the unicode()/repr() => forget it */
+ Py_DECREF(*callresult);
+ /* switch to next unicode()/repr() result */
diff --git a/python.spec b/python.spec
index 2033a36..448f55c 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.8
-Release: 4%{?dist}
+Release: 5%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -881,7 +881,18 @@ Patch193: 00193-enable-loading-sqlite-extensions.patch
# are disabled by default in openssl, according the comment in openssl
# patch this affects only SSLv23_method, this patch enables SSLv2
# and SSLv3 when SSLv23_method is used
-Patch195: 00195-enable-sslv23-in-ssl.patch
+# Update:
+# Patch disabled, Openssl reverted disabling sslv3 and now
+# disables only sslv2 all tests pass
+#Patch195: 00195-enable-sslv23-in-ssl.patch
+
+#
http://bugs.python.org/issue21308
+# Backport of ssl module from python3
+Patch196: 00196-ssl-backport.patch
+
+#
http://bugs.python.org/issue22023
+# Patch seg fault in unicodeobject.c
+Patch197: 00197-unicode_fromformat.patch
# (New patches go here ^^^)
#
@@ -1239,7 +1250,9 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
# 00192: upstream as of Python 2.7.7
%patch193 -p1
# 00194: upstream as of Python 2.7.7
-%patch195 -p1
+#%patch195 -p1
+%patch196 -p1
+%patch197 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -2078,6 +2091,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Tue Aug 19 2014 Robert Kuska <rkuska(a)redhat.com> - 2.7.8-5
+- Backport ssl module from python3
+
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.7.8-4
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
commit e29cbdd24ca68cf5379e297142f5180d740d60ab
Author: Peter Robinson <pbrobinson(a)fedoraproject.org>
Date: Sun Aug 17 20:46:03 2014 +0000
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
diff --git a/python.spec b/python.spec
index cb1d3d3..2033a36 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.8
-Release: 3%{?dist}
+Release: 4%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -2078,6 +2078,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Sun Aug 17 2014 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.7.8-4
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
+
* Thu Jul 31 2014 Tom Callaway <spot(a)fedoraproject.org> - 2.7.8-3
- fix license handling
commit 69a4fec2973558559e5cfc9b945b0185f708349c
Author: Tom Callaway <spot(a)fedoraproject.org>
Date: Thu Jul 31 09:48:10 2014 -0400
fix license handling
diff --git a/python.spec b/python.spec
index b11a27c..cb1d3d3 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.8
-Release: 2%{?dist}
+Release: 3%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1733,7 +1733,9 @@ rm -fr %{buildroot}
%files
%defattr(-, root, root, -)
-%doc LICENSE README
+%{!?_licensedir:%global license %%doc}
+%license LICENSE
+%doc README
%{_bindir}/pydoc*
%{_bindir}/%{python}
%if %{main_python}
@@ -1744,7 +1746,9 @@ rm -fr %{buildroot}
%files libs
%defattr(-,root,root,-)
-%doc LICENSE README
+%{!?_licensedir:%global license %%doc}
+%license LICENSE
+%doc README
%dir %{pylibdir}
%dir %{dynload_dir}
%{dynload_dir}/Python-%{version}-py%{pybasever}.egg-info
@@ -2074,6 +2078,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu Jul 31 2014 Tom Callaway <spot(a)fedoraproject.org> - 2.7.8-3
+- fix license handling
+
* Fri Jul 18 2014 Robert Kuska <rkuska(a)redhat.com> - 2.7.8-2
- Enable SSLv2 and SSLv3 when SSLv23_method is used in ssl
commit e0419e878a0bbf063bed8a8b54509a85196f7f9f
Author: Robert Kuska <rkuska(a)redhat.com>
Date: Fri Jul 18 16:44:10 2014 +0200
Enable SSLv2 and SSLv3 when SSLv23_method is used
diff --git a/00195-enable-sslv23-in-ssl.patch b/00195-enable-sslv23-in-ssl.patch
new file mode 100644
index 0000000..fcce84a
--- /dev/null
+++ b/00195-enable-sslv23-in-ssl.patch
@@ -0,0 +1,15 @@
+diff -up Python-2.7.8/Modules/_ssl.c.orig Python-2.7.8/Modules/_ssl.c
+--- Python-2.7.8/Modules/_ssl.c.orig 2014-07-17 14:17:32.584362667 +0200
++++ Python-2.7.8/Modules/_ssl.c 2014-07-17 14:17:38.215405930 +0200
+@@ -312,8 +312,10 @@ newPySSLObject(PySocketSockObject *Sock,
+ else if (proto_version == PY_SSL_VERSION_SSL2)
+ self->ctx = SSL_CTX_new(SSLv2_method()); /* Set up context */
+ #endif
+- else if (proto_version == PY_SSL_VERSION_SSL23)
++ else if (proto_version == PY_SSL_VERSION_SSL23) {
+ self->ctx = SSL_CTX_new(SSLv23_method()); /* Set up context */
++ self->ctx->options &= ~(SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3);
++ }
+ PySSL_END_ALLOW_THREADS
+
+ if (self->ctx == NULL) {
diff --git a/python.spec b/python.spec
index bccb8be..b11a27c 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.8
-Release: 1%{?dist}
+Release: 2%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -877,6 +877,12 @@ Patch193: 00193-enable-loading-sqlite-extensions.patch
# FIXED UPSTREAM
#Patch194: 00194-fix-tests-with-sqlite-3.8.4.patch
+# Since openssl-1.0.1h-5.fc21 SSLv2 and SSLV3 protocols
+# are disabled by default in openssl, according the comment in openssl
+# patch this affects only SSLv23_method, this patch enables SSLv2
+# and SSLv3 when SSLv23_method is used
+Patch195: 00195-enable-sslv23-in-ssl.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -1233,6 +1239,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
# 00192: upstream as of Python 2.7.7
%patch193 -p1
# 00194: upstream as of Python 2.7.7
+%patch195 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -2067,6 +2074,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Fri Jul 18 2014 Robert Kuska <rkuska(a)redhat.com> - 2.7.8-2
+- Enable SSLv2 and SSLv3 when SSLv23_method is used in ssl
+
* Mon Jul 14 2014 Robert Kuska <rkuska(a)redhat.com> - 2.7.8-1
- Update to 2.7.8
commit bdb652d59d62b316e6f7c1f6f99a0dff6cfe0a0c
Author: Robert Kuska <rkuska(a)redhat.com>
Date: Fri Jul 18 16:38:47 2014 +0200
Upload new sources
diff --git a/sources b/sources
index dce872a..9163c53 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-41f7348b348e3f72fcfb4f4d76701352 Python-2.7.7.tar.xz
+d235bdfa75b8396942e360a70487ee00 Python-2.7.8.tar.xz
commit 4c23f429dcb16a018cc7b8a4bb4ef044657bf199
Author: Robert Kuska <rkuska(a)redhat.com>
Date: Fri Jul 18 16:26:31 2014 +0200
Update to 2.7.8
diff --git a/00146-hashlib-fips.patch b/00146-hashlib-fips.patch
index c67eb3b..696aa29 100644
--- a/00146-hashlib-fips.patch
+++ b/00146-hashlib-fips.patch
@@ -39,7 +39,7 @@ diff -up Python-2.7.2/Lib/hashlib.py.hashlib-fips
Python-2.7.2/Lib/hashlib.py
- update(arg): Update the hash object with the string arg. Repeated calls
are equivalent to a single call with the concatenation of all
@@ -63,74 +80,39 @@ algorithms = __always_supported
- __all__ = __always_supported + ('new', 'algorithms')
+ __all__ = __always_supported + ('new', 'algorithms',
'pbkdf2_hmac')
-def __get_builtin_constructor(name):
@@ -269,9 +269,9 @@ diff -up Python-2.7.2/Lib/test/test_hashlib.py.hashlib-fips
Python-2.7.2/Lib/tes
def test_unicode(self):
@@ -354,6 +335,70 @@ class HashLibTestCase(unittest.TestCase)
-
self.assertEqual(expected_hash, hasher.hexdigest())
+
+ def test_issue9146(self):
+ # Ensure that various ways to use "MD5" from "hashlib"
don't segfault:
+ m = hashlib.md5(usedforsecurity=False)
@@ -336,12 +336,58 @@ diff -up Python-2.7.2/Lib/test/test_hashlib.py.hashlib-fips
Python-2.7.2/Lib/tes
+
+
+
- def test_main():
- test_support.run_unittest(HashLibTestCase)
+ class KDFTests(unittest.TestCase):
+ pbkdf2_test_vectors = [
+ (b'password', b'salt', 1, None),
+diff -up Python-2.7.2/Modules/Setup.dist.hashlib-fips Python-2.7.2/Modules/Setup.dist
+--- Python-2.7.2/Modules/Setup.dist.hashlib-fips 2011-09-14 00:21:26.163252001 -0400
++++ Python-2.7.2/Modules/Setup.dist 2011-09-14 00:21:26.201252001 -0400
+@@ -248,14 +248,14 @@ imageop imageop.c # Operations on images
+ # Message-Digest Algorithm, described in RFC 1321. The necessary files
+ # md5.c and md5.h are included here.
+
+-_md5 md5module.c md5.c
++#_md5 md5module.c md5.c
+
+
+ # The _sha module implements the SHA checksum algorithms.
+ # (NIST's Secure Hash Algorithms.)
+-_sha shamodule.c
+-_sha256 sha256module.c
+-_sha512 sha512module.c
++#_sha shamodule.c
++#_sha256 sha256module.c
++#_sha512 sha512module.c
+
+
+ # SGI IRIX specific modules -- off by default.
+diff -up Python-2.7.2/setup.py.hashlib-fips Python-2.7.2/setup.py
+--- Python-2.7.2/setup.py.hashlib-fips 2011-09-14 00:21:25.722252001 -0400
++++ Python-2.7.2/setup.py 2011-09-14 00:21:26.203252001 -0400
+@@ -768,21 +768,6 @@ class PyBuildExt(build_ext):
+ print ("warning: openssl 0x%08x is too old for _hashlib" %
+ openssl_ver)
+ missing.append('_hashlib')
+- if COMPILED_WITH_PYDEBUG or not have_usable_openssl:
+- # The _sha module implements the SHA1 hash algorithm.
+- exts.append( Extension('_sha', ['shamodule.c']) )
+- # The _md5 module implements the RSA Data Security, Inc. MD5
+- # Message-Digest Algorithm, described in RFC 1321. The
+- # necessary files md5.c and md5.h are included here.
+- exts.append( Extension('_md5',
+- sources = ['md5module.c', 'md5.c'],
+- depends = ['md5.h']) )
+-
+- min_sha2_openssl_ver = 0x00908000
+- if COMPILED_WITH_PYDEBUG or openssl_ver < min_sha2_openssl_ver:
+- # OpenSSL doesn't do these until 0.9.8 so we'll bring our own hash
+- exts.append( Extension('_sha256', ['sha256module.c']) )
+- exts.append( Extension('_sha512', ['sha512module.c']) )
-diff -up Python-2.7.2/Modules/_hashopenssl.c.hashlib-fips
Python-2.7.2/Modules/_hashopenssl.c
---- Python-2.7.2/Modules/_hashopenssl.c.hashlib-fips 2011-06-11 11:46:26.000000000 -0400
-+++ Python-2.7.2/Modules/_hashopenssl.c 2011-09-14 00:21:26.199252001 -0400
+ # Modules that provide persistent dictionary-like semantics. You will
+ # probably want to arrange for at least one of them to be available on
+--- Python-2.7.8/Modules/_hashopenssl.c.orig 2014-06-30 04:05:41.000000000 +0200
++++ Python-2.7.8/Modules/_hashopenssl.c 2014-07-14 14:21:59.546386572 +0200
@@ -36,6 +36,8 @@
#endif
@@ -349,9 +395,9 @@ diff -up Python-2.7.2/Modules/_hashopenssl.c.hashlib-fips
Python-2.7.2/Modules/_
+#include <openssl/ssl.h>
+#include <openssl/err.h>
#include <openssl/evp.h>
-
- #define MUNCH_SIZE INT_MAX
-@@ -65,11 +67,19 @@ typedef struct {
+ #include <openssl/hmac.h>
+ #include <openssl/err.h>
+@@ -67,11 +69,19 @@
static PyTypeObject EVPtype;
@@ -375,7 +421,7 @@ diff -up Python-2.7.2/Modules/_hashopenssl.c.hashlib-fips
Python-2.7.2/Modules/_
DEFINE_CONSTS_FOR_NEW(md5)
DEFINE_CONSTS_FOR_NEW(sha1)
-@@ -115,6 +125,48 @@ EVP_hash(EVPobject *self, const void *vp
+@@ -117,6 +127,48 @@
}
}
@@ -424,7 +470,7 @@ diff -up Python-2.7.2/Modules/_hashopenssl.c.hashlib-fips
Python-2.7.2/Modules/_
/* Internal methods for a hash object */
static void
-@@ -313,14 +365,15 @@ EVP_repr(PyObject *self)
+@@ -315,14 +367,15 @@
static int
EVP_tp_init(EVPobject *self, PyObject *args, PyObject *kwds)
{
@@ -443,7 +489,7 @@ diff -up Python-2.7.2/Modules/_hashopenssl.c.hashlib-fips
Python-2.7.2/Modules/_
return -1;
}
-@@ -336,7 +389,12 @@ EVP_tp_init(EVPobject *self, PyObject *a
+@@ -338,7 +391,12 @@
PyBuffer_Release(&view);
return -1;
}
@@ -457,7 +503,7 @@ diff -up Python-2.7.2/Modules/_hashopenssl.c.hashlib-fips
Python-2.7.2/Modules/_
self->name = name_obj;
Py_INCREF(self->name);
-@@ -420,7 +478,8 @@ static PyTypeObject EVPtype = {
+@@ -422,7 +480,8 @@
static PyObject *
EVPnew(PyObject *name_obj,
const EVP_MD *digest, const EVP_MD_CTX *initial_ctx,
@@ -467,7 +513,7 @@ diff -up Python-2.7.2/Modules/_hashopenssl.c.hashlib-fips
Python-2.7.2/Modules/_
{
EVPobject *self;
-@@ -435,7 +494,12 @@ EVPnew(PyObject *name_obj,
+@@ -437,7 +496,12 @@
if (initial_ctx) {
EVP_MD_CTX_copy(&self->ctx, initial_ctx);
} else {
@@ -481,7 +527,7 @@ diff -up Python-2.7.2/Modules/_hashopenssl.c.hashlib-fips
Python-2.7.2/Modules/_
}
if (cp && len) {
-@@ -459,20 +523,28 @@ PyDoc_STRVAR(EVP_new__doc__,
+@@ -461,20 +525,28 @@
An optional string argument may be provided and will be\n\
automatically hashed.\n\
\n\
@@ -514,7 +560,7 @@ diff -up Python-2.7.2/Modules/_hashopenssl.c.hashlib-fips
Python-2.7.2/Modules/_
return NULL;
}
-@@ -484,58 +556,118 @@ EVP_new(PyObject *self, PyObject *args,
+@@ -487,7 +559,7 @@
digest = EVP_get_digestbyname(name);
ret_obj = EVPnew(name_obj, digest, NULL, (unsigned char*)view.buf,
@@ -523,7 +569,8 @@ diff -up Python-2.7.2/Modules/_hashopenssl.c.hashlib-fips
Python-2.7.2/Modules/_
PyBuffer_Release(&view);
return ret_obj;
- }
+@@ -713,51 +785,111 @@
+ #endif
/*
- * This macro generates constructor function definitions for specific
@@ -539,7 +586,7 @@ diff -up Python-2.7.2/Modules/_hashopenssl.c.hashlib-fips
Python-2.7.2/Modules/_
#define GEN_CONSTRUCTOR(NAME) \
static PyObject * \
- EVP_new_ ## NAME (PyObject *self, PyObject *args) \
-+ EVP_new_ ## NAME (PyObject *self, PyObject *args, PyObject *kwdict) \
++ EVP_new_ ## NAME (PyObject *self, PyObject *args, PyObject *kwdict) \
{ \
- Py_buffer view = { 0 }; \
- PyObject *ret_obj; \
@@ -555,9 +602,9 @@ diff -up Python-2.7.2/Modules/_hashopenssl.c.hashlib-fips
Python-2.7.2/Modules/_
- (unsigned char*)view.buf, view.len); \
- PyBuffer_Release(&view); \
- return ret_obj; \
-+ return implement_specific_EVP_new(self, args, kwdict, \
-+ "|s*i:" #NAME, \
-+ &cached_info_ ## NAME ); \
++ return implement_specific_EVP_new(self, args, kwdict, \
++ "|s*i:" #NAME, \
++ &cached_info_ ## NAME ); \
}
+static PyObject *
@@ -565,7 +612,7 @@ diff -up Python-2.7.2/Modules/_hashopenssl.c.hashlib-fips
Python-2.7.2/Modules/_
+ const char *format,
+ EVPCachedInfo *cached_info)
+{
-+ static char *kwlist[] = {"string", "usedforsecurity", NULL};
++ static char *kwlist[] = {"string", "usedforsecurity", NULL};
+ Py_buffer view = { 0 };
+ int usedforsecurity = 1;
+ int idx;
@@ -631,7 +678,7 @@ diff -up Python-2.7.2/Modules/_hashopenssl.c.hashlib-fips
Python-2.7.2/Modules/_
+
+ Try to initialize a context for each hash twice, once with
+ EVP_MD_CTX_FLAG_NON_FIPS_ALLOW and once without.
-+
++
+ Any that have errors during initialization will end up wit a NULL ctx_ptrs
+ entry, and err_msgs will be set (unless we're very low on memory)
+*/
@@ -664,7 +711,7 @@ diff -up Python-2.7.2/Modules/_hashopenssl.c.hashlib-fips
Python-2.7.2/Modules/_
GEN_CONSTRUCTOR(md5)
GEN_CONSTRUCTOR(sha1)
#ifdef _OPENSSL_SUPPORTS_SHA2
-@@ -565,13 +700,10 @@ init_hashlib(void)
+@@ -794,13 +926,10 @@
{
PyObject *m;
@@ -680,50 +727,3 @@ diff -up Python-2.7.2/Modules/_hashopenssl.c.hashlib-fips
Python-2.7.2/Modules/_
Py_TYPE(&EVPtype) = &PyType_Type;
if (PyType_Ready(&EVPtype) < 0)
return;
-diff -up Python-2.7.2/Modules/Setup.dist.hashlib-fips Python-2.7.2/Modules/Setup.dist
---- Python-2.7.2/Modules/Setup.dist.hashlib-fips 2011-09-14 00:21:26.163252001 -0400
-+++ Python-2.7.2/Modules/Setup.dist 2011-09-14 00:21:26.201252001 -0400
-@@ -248,14 +248,14 @@ imageop imageop.c # Operations on images
- # Message-Digest Algorithm, described in RFC 1321. The necessary files
- # md5.c and md5.h are included here.
-
--_md5 md5module.c md5.c
-+#_md5 md5module.c md5.c
-
-
- # The _sha module implements the SHA checksum algorithms.
- # (NIST's Secure Hash Algorithms.)
--_sha shamodule.c
--_sha256 sha256module.c
--_sha512 sha512module.c
-+#_sha shamodule.c
-+#_sha256 sha256module.c
-+#_sha512 sha512module.c
-
-
- # SGI IRIX specific modules -- off by default.
-diff -up Python-2.7.2/setup.py.hashlib-fips Python-2.7.2/setup.py
---- Python-2.7.2/setup.py.hashlib-fips 2011-09-14 00:21:25.722252001 -0400
-+++ Python-2.7.2/setup.py 2011-09-14 00:21:26.203252001 -0400
-@@ -768,21 +768,6 @@ class PyBuildExt(build_ext):
- print ("warning: openssl 0x%08x is too old for _hashlib" %
- openssl_ver)
- missing.append('_hashlib')
-- if COMPILED_WITH_PYDEBUG or not have_usable_openssl:
-- # The _sha module implements the SHA1 hash algorithm.
-- exts.append( Extension('_sha', ['shamodule.c']) )
-- # The _md5 module implements the RSA Data Security, Inc. MD5
-- # Message-Digest Algorithm, described in RFC 1321. The
-- # necessary files md5.c and md5.h are included here.
-- exts.append( Extension('_md5',
-- sources = ['md5module.c', 'md5.c'],
-- depends = ['md5.h']) )
--
-- min_sha2_openssl_ver = 0x00908000
-- if COMPILED_WITH_PYDEBUG or openssl_ver < min_sha2_openssl_ver:
-- # OpenSSL doesn't do these until 0.9.8 so we'll bring our own hash
-- exts.append( Extension('_sha256', ['sha256module.c']) )
-- exts.append( Extension('_sha512', ['sha512module.c']) )
-
- # Modules that provide persistent dictionary-like semantics. You will
- # probably want to arrange for at least one of them to be available on
diff --git a/00147-add-debug-malloc-stats.patch b/00147-add-debug-malloc-stats.patch
index 6777619..0d783f5 100644
--- a/00147-add-debug-malloc-stats.patch
+++ b/00147-add-debug-malloc-stats.patch
@@ -362,7 +362,7 @@ diff -up Python-2.7.2/Objects/obmalloc.c.add-debug-malloc-stats
Python-2.7.2/Obj
if (unused_arena_objects == NULL) {
uint i;
@@ -588,11 +586,9 @@ new_arena(void)
- }
+ arenaobj->address = (uptr)address;
++narenas_currently_allocated;
-#ifdef PYMALLOC_DEBUG
diff --git a/python.spec b/python.spec
index 038f347..bccb8be 100644
--- a/python.spec
+++ b/python.spec
@@ -105,8 +105,8 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
# Remember to also rebase python-docs when changing this:
-Version: 2.7.7
-Release: 3%{?dist}
+Version: 2.7.8
+Release: 1%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -877,7 +877,6 @@ Patch193: 00193-enable-loading-sqlite-extensions.patch
# FIXED UPSTREAM
#Patch194: 00194-fix-tests-with-sqlite-3.8.4.patch
-
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -2068,6 +2067,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Mon Jul 14 2014 Robert Kuska <rkuska(a)redhat.com> - 2.7.8-1
+- Update to 2.7.8
+
* Fri Jul 11 2014 Dan Hork <dan[at]danny.cz> - 2.7.7-3
- rebuilt for updated libffi ABI on ppc64le
commit a4c1902c06819f07d652dd89434b058b2ab7c9c2
Author: Dan Hork <dan(a)danny.cz>
Date: Fri Jul 11 21:45:47 2014 +0200
- rebuilt for updated libffi ABI on ppc64le
diff --git a/python.spec b/python.spec
index cdae54e..038f347 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.7
-Release: 2%{?dist}
+Release: 3%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -2068,6 +2068,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Fri Jul 11 2014 Dan Hork <dan[at]danny.cz> - 2.7.7-3
+- rebuilt for updated libffi ABI on ppc64le
+
* Sat Jun 7 2014 Peter Robinson <pbrobinson(a)fedoraproject.org> 2.7.7-2
- aarch64 has valgrind, just list those that don't support it
commit 82a502edebdd0b9d8927edc1903150141a6ff709
Author: Peter Robinson <pbrobinson(a)gmail.com>
Date: Sat Jun 7 09:16:29 2014 +0100
aarch64 has valgrind, just list those that don't support it with a ifnarch
diff --git a/python.spec b/python.spec
index b02ede9..cdae54e 100644
--- a/python.spec
+++ b/python.spec
@@ -45,7 +45,7 @@
%global with_systemtap 1
# some arches don't have valgrind so we need to disable its support on them
-%ifarch %{arm} %{ix86} x86_64 ppc ppc64 ppc64p7 s390x
+%ifnarch s390 ppc64le
%global with_valgrind 1
%else
%global with_valgrind 0
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.7
-Release: 1%{?dist}
+Release: 2%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -2068,6 +2068,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Sat Jun 7 2014 Peter Robinson <pbrobinson(a)fedoraproject.org> 2.7.7-2
+- aarch64 has valgrind, just list those that don't support it
+
* Wed Jun 04 2014 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.7-1
- Update to 2.7.7
- Refreshed patches: #16, #112, #138, #147, #157, #166, #173, #5000
commit ebcba88f1cd71ff21c2119309889d90f18ddfef8
Author: Matej Stuchlik <mstuchli(a)redhat.com>
Date: Wed Jun 4 15:11:57 2014 +0200
Update to 2.7.7
Refreshed patches: #16, #112, #138, #147, #157, #166, #173, #5000
Dropped patches: #190, #192, #194
diff --git a/00138-fix-distutils-tests-in-debug-build.patch
b/00138-fix-distutils-tests-in-debug-build.patch
index 0bfda90..1fd1091 100644
--- a/00138-fix-distutils-tests-in-debug-build.patch
+++ b/00138-fix-distutils-tests-in-debug-build.patch
@@ -65,4 +65,4 @@ diff -up
Python-2.7.2/Lib/distutils/tests/test_build_ext.py.mark-tests-that-fail
+ wanted = os.path.join(cmd.build_lib, 'UpdateManager', 'fdsend' +
debug_ext + ext)
self.assertEqual(ext_path, wanted)
- def test_build_ext_path_cross_platform(self):
+ @unittest.skipUnless(sys.platform == 'win32', 'these tests require
Windows')
diff --git a/00147-add-debug-malloc-stats.patch b/00147-add-debug-malloc-stats.patch
index 0ab8c94..6777619 100644
--- a/00147-add-debug-malloc-stats.patch
+++ b/00147-add-debug-malloc-stats.patch
@@ -163,9 +163,9 @@ diff -up Python-2.7.2/Lib/test/test_sys.py.add-debug-malloc-stats
Python-2.7.2/L
+ sys._debugmallocstats(42)
+
+
+ @test.test_support.cpython_only
class SizeofTest(unittest.TestCase):
-
- def setUp(self):
+
diff -up Python-2.7.2/Objects/classobject.c.add-debug-malloc-stats
Python-2.7.2/Objects/classobject.c
--- Python-2.7.2/Objects/classobject.c.add-debug-malloc-stats 2011-06-11
11:46:27.000000000 -0400
+++ Python-2.7.2/Objects/classobject.c 2011-09-16 19:03:25.110821625 -0400
diff --git a/00157-uid-gid-overflows.patch b/00157-uid-gid-overflows.patch
index 13546bb..a31c98a 100644
--- a/00157-uid-gid-overflows.patch
+++ b/00157-uid-gid-overflows.patch
@@ -2,48 +2,48 @@ diff -up Python-2.7.3/Lib/test/test_os.py.uid-gid-overflows
Python-2.7.3/Lib/tes
--- Python-2.7.3/Lib/test/test_os.py.uid-gid-overflows 2012-04-09 19:07:32.000000000
-0400
+++ Python-2.7.3/Lib/test/test_os.py 2012-06-26 14:51:36.000817929 -0400
@@ -677,30 +677,36 @@ if sys.platform != 'win32':
- def test_setuid(self):
- if os.getuid() != 0:
- self.assertRaises(os.error, os.setuid, 0)
-+ self.assertRaises(TypeError, os.setuid, 'not an int')
- self.assertRaises(OverflowError, os.setuid, 1<<32)
+ def test_setuid(self):
+ if os.getuid() != 0:
+ self.assertRaises(os.error, os.setuid, 0)
++ self.assertRaises(TypeError, os.setuid, 'not an int')
+ self.assertRaises(OverflowError, os.setuid, 1<<32)
- if hasattr(os, 'setgid'):
- def test_setgid(self):
- if os.getuid() != 0:
- self.assertRaises(os.error, os.setgid, 0)
-+ self.assertRaises(TypeError, os.setgid, 'not an int')
- self.assertRaises(OverflowError, os.setgid, 1<<32)
+ @unittest.skipUnless(hasattr(os, 'setgid'), 'test needs
os.setgid()')
+ def test_setgid(self):
+ if os.getuid() != 0:
+ self.assertRaises(os.error, os.setgid, 0)
++ self.assertRaises(TypeError, os.setgid, 'not an int')
+ self.assertRaises(OverflowError, os.setgid, 1<<32)
- if hasattr(os, 'seteuid'):
- def test_seteuid(self):
- if os.getuid() != 0:
- self.assertRaises(os.error, os.seteuid, 0)
-+ self.assertRaises(TypeError, os.seteuid, 'not an int')
- self.assertRaises(OverflowError, os.seteuid, 1<<32)
+ @unittest.skipUnless(hasattr(os, 'seteuid'), 'test needs
os.seteuid()')
+ def test_seteuid(self):
+ if os.getuid() != 0:
+ self.assertRaises(os.error, os.seteuid, 0)
++ self.assertRaises(TypeError, os.seteuid, 'not an int')
+ self.assertRaises(OverflowError, os.seteuid, 1<<32)
- if hasattr(os, 'setegid'):
- def test_setegid(self):
- if os.getuid() != 0:
- self.assertRaises(os.error, os.setegid, 0)
-+ self.assertRaises(TypeError, os.setegid, 'not an int')
- self.assertRaises(OverflowError, os.setegid, 1<<32)
+ @unittest.skipUnless(hasattr(os, 'setegid'), 'test needs
os.setegid()')
+ def test_setegid(self):
+ if os.getuid() != 0:
+ self.assertRaises(os.error, os.setegid, 0)
++ self.assertRaises(TypeError, os.setegid, 'not an int')
+ self.assertRaises(OverflowError, os.setegid, 1<<32)
- if hasattr(os, 'setreuid'):
- def test_setreuid(self):
- if os.getuid() != 0:
- self.assertRaises(os.error, os.setreuid, 0, 0)
-+ self.assertRaises(TypeError, os.setreuid, 'not an int', 0)
-+ self.assertRaises(TypeError, os.setreuid, 0, 'not an int')
- self.assertRaises(OverflowError, os.setreuid, 1<<32, 0)
- self.assertRaises(OverflowError, os.setreuid, 0, 1<<32)
+ @unittest.skipUnless(hasattr(os, 'setreuid'), 'test needs
os.setreuid()')
+ def test_setreuid(self):
+ if os.getuid() != 0:
+ self.assertRaises(os.error, os.setreuid, 0, 0)
++ self.assertRaises(TypeError, os.setreuid, 'not an int', 0)
++ self.assertRaises(TypeError, os.setreuid, 0, 'not an int')
+ self.assertRaises(OverflowError, os.setreuid, 1<<32, 0)
+ self.assertRaises(OverflowError, os.setreuid, 0, 1<<32)
@@ -715,6 +721,8 @@ if sys.platform != 'win32':
- def test_setregid(self):
- if os.getuid() != 0:
- self.assertRaises(os.error, os.setregid, 0, 0)
-+ self.assertRaises(TypeError, os.setregid, 'not an int', 0)
-+ self.assertRaises(TypeError, os.setregid, 0, 'not an int')
- self.assertRaises(OverflowError, os.setregid, 1<<32, 0)
- self.assertRaises(OverflowError, os.setregid, 0, 1<<32)
+ def test_setregid(self):
+ if os.getuid() != 0:
+ self.assertRaises(os.error, os.setregid, 0, 0)
++ self.assertRaises(TypeError, os.setregid, 'not an int', 0)
++ self.assertRaises(TypeError, os.setregid, 0, 'not an int')
+ self.assertRaises(OverflowError, os.setregid, 1<<32, 0)
+ self.assertRaises(OverflowError, os.setregid, 0, 1<<32)
diff --git a/00166-fix-fake-repr-in-gdb-hooks.patch
b/00166-fix-fake-repr-in-gdb-hooks.patch
index bfd2459..5f3781c 100644
--- a/00166-fix-fake-repr-in-gdb-hooks.patch
+++ b/00166-fix-fake-repr-in-gdb-hooks.patch
@@ -111,14 +111,14 @@ diff -up
Python-2.7.3/Tools/gdb/libpython.py.fix-fake-repr-in-gdb-hooks Python-2
sys.stdout.write('#%i (unable to read python frame
information)\n' % self.get_index())
else:
@@ -1303,7 +1309,11 @@ class PyList(gdb.Command):
- print 'Unable to read information on python frame'
+ print('Unable to read information on python frame')
return
- filename = pyop.filename()
+ try:
+ filename = pyop.filename()
+ except CantReadFilename:
-+ print "Unable to extract filename from python frame"
++ print("Unable to extract filename from python frame")
+ return
lineno = pyop.current_line_num()
diff --git a/00173-workaround-ENOPROTOOPT-in-bind_port.patch
b/00173-workaround-ENOPROTOOPT-in-bind_port.patch
index eb34610..3e83d67 100644
--- a/00173-workaround-ENOPROTOOPT-in-bind_port.patch
+++ b/00173-workaround-ENOPROTOOPT-in-bind_port.patch
@@ -8,6 +8,7 @@ diff -up Python-2.7.3/Lib/test/test_support.py.rhbz913732
Python-2.7.3/Lib/test/
- if hasattr(socket, 'SO_REUSEPORT'):
+ if hasattr(socket, 'SO_REUSEPORT') \
+ and 'WITHIN_PYTHON_RPM_BUILD' not in os.environ: # rhbz#913732
- if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) == 1:
- raise TestFailed("tests should never set the SO_REUSEPORT "
\
- "socket option on TCP/IP sockets!")
+ try:
+ if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) == 1:
+ raise TestFailed("tests should never set the SO_REUSEPORT
" \
+ "socket option on TCP/IP sockets!")
diff --git a/05000-autotool-intermediates.patch b/05000-autotool-intermediates.patch
index cfedc25..dfe0257 100644
--- a/05000-autotool-intermediates.patch
+++ b/05000-autotool-intermediates.patch
@@ -43,15 +43,6 @@ diff -up ./configure.autotool-intermediates ./configure
--with-wctype-functions use wctype.h functions
--with-fpectl enable SIGFPE catching
--with-libm=STRING math library
-@@ -5171,7 +5181,7 @@ esac
- $as_echo_n "checking LIBRARY... " >&6; }
- if test -z "$LIBRARY"
- then
-- LIBRARY='libpython$(VERSION).a'
-+ LIBRARY='libpython$(VERSION)$(DEBUG_EXT).a'
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBRARY" >&5
- $as_echo "$LIBRARY" >&6; }
@@ -5343,8 +5353,8 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>
INSTSONAME="$LDLIBRARY".$SOVERSION
;;
@@ -60,7 +51,7 @@ diff -up ./configure.autotool-intermediates ./configure
- BLDLIBRARY='-L. -lpython$(VERSION)'
+ LDLIBRARY='libpython$(VERSION)$(DEBUG_EXT).so'
+ BLDLIBRARY='-L. -lpython$(VERSION)$(DEBUG_EXT)'
- RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
+ RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
case $ac_sys_system in
FreeBSD*)
@@ -5367,7 +5377,7 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>
@@ -69,7 +60,7 @@ diff -up ./configure.autotool-intermediates ./configure
LDLIBRARY='libpython$(VERSION).so'
- BLDLIBRARY='-rpath $(LIBDIR) -L. -lpython$(VERSION)'
+ BLDLIBRARY='-L. -lpython$(VERSION)'
- RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
+ RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
;;
atheos*)
@@ -5894,6 +5904,14 @@ $as_echo "no" >&6; }
diff --git a/python-2.6-rpath.patch b/python-2.6-rpath.patch
index 43e3ec4..33d7cf6 100644
--- a/python-2.6-rpath.patch
+++ b/python-2.6-rpath.patch
@@ -7,6 +7,6 @@ diff -up Python-2.6/configure.ac.rpath Python-2.6/configure.ac
LDLIBRARY='libpython$(VERSION).so'
- BLDLIBRARY='-rpath $(LIBDIR) -L. -lpython$(VERSION)'
+ BLDLIBRARY='-L. -lpython$(VERSION)'
- RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
+ RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
;;
atheos*)
diff --git a/python-2.7.3-debug-build.patch b/python-2.7.3-debug-build.patch
index d20e9d3..ee0b2a2 100644
--- a/python-2.7.3-debug-build.patch
+++ b/python-2.7.3-debug-build.patch
@@ -272,7 +272,7 @@ diff -up Python-2.7.6/configure.ac.debug-build
Python-2.7.6/configure.ac
- BLDLIBRARY='-L. -lpython$(VERSION)'
+ LDLIBRARY='libpython$(VERSION)$(DEBUG_EXT).so'
+ BLDLIBRARY='-L. -lpython$(VERSION)$(DEBUG_EXT)'
- RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
+ RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
case $ac_sys_system in
FreeBSD*)
@@ -1028,6 +1028,14 @@ else AC_MSG_RESULT(no); Py_DEBUG='false'
diff --git a/python.spec b/python.spec
index 7a70e2f..b02ede9 100644
--- a/python.spec
+++ b/python.spec
@@ -105,8 +105,8 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
# Remember to also rebase python-docs when changing this:
-Version: 2.7.6
-Release: 9%{?dist}
+Version: 2.7.7
+Release: 1%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -846,7 +846,8 @@ Patch189: 00189-gdb-py-bt-dont-raise-exception-from-eval.patch
# Importing get_python_version in bdist_rpm
#
http://bugs.python.org/issue18045
# rhbz#1029082
-Patch190: 00190-get_python_version.patch
+# FIXED UPSTREAM
+#Patch190: 00190-get_python_version.patch
# 00191 #
#
@@ -857,7 +858,8 @@ Patch191: 00191-disable-NOOP.patch
#
# Fixing buffer overflow (upstream patch)
# rhbz#1062375
-Patch192: 00192-buffer-overflow.patch
+# FIXED UPSTREAM
+#Patch192: 00192-buffer-overflow.patch
# 00193 #
#
@@ -872,7 +874,8 @@ Patch193: 00193-enable-loading-sqlite-extensions.patch
# Fix tests with SQLite >= 3.8.4
#
http://bugs.python.org/issue20901
#
http://hg.python.org/cpython/raw-rev/1763e27a182d
-Patch194: 00194-fix-tests-with-sqlite-3.8.4.patch
+# FIXED UPSTREAM
+#Patch194: 00194-fix-tests-with-sqlite-3.8.4.patch
# (New patches go here ^^^)
@@ -1226,11 +1229,11 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch185 -p1
%patch187 -p1
%patch189 -p1
-%patch190 -p1
+# 00190: upstream as of Python 2.7.7
%patch191 -p1
-%patch192 -p1
+# 00192: upstream as of Python 2.7.7
%patch193 -p1
-%patch194 -p1
+# 00194: upstream as of Python 2.7.7
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -2065,6 +2068,11 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Wed Jun 04 2014 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.7-1
+- Update to 2.7.7
+- Refreshed patches: #16, #112, #138, #147, #157, #166, #173, #5000
+- Dropped patches: #190, #192, #194
+
* Tue Jun 03 2014 Dan Hork <dan[at]danny.cz> - 2.7.6-9
- update the arch list where valgrind exists - %%power64 includes also
ppc64le which is not supported yet
diff --git a/sources b/sources
index 04234bd..dce872a 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-bcf93efa8eaf383c98ed3ce40b763497 Python-2.7.6.tar.xz
+41f7348b348e3f72fcfb4f4d76701352 Python-2.7.7.tar.xz
commit 81b61ec96951adeff7443221c06c537e572910c9
Author: Dan Hork <dan(a)danny.cz>
Date: Tue Jun 3 23:05:50 2014 +0200
- update the arch list where valgrind exists - %power64 includes also
ppc64le which is not supported yet
diff --git a/python.spec b/python.spec
index c569ddc..7a70e2f 100644
--- a/python.spec
+++ b/python.spec
@@ -45,7 +45,7 @@
%global with_systemtap 1
# some arches don't have valgrind so we need to disable its support on them
-%ifarch %{arm} %{ix86} x86_64 ppc %{power64} s390x
+%ifarch %{arm} %{ix86} x86_64 ppc ppc64 ppc64p7 s390x
%global with_valgrind 1
%else
%global with_valgrind 0
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.6
-Release: 8%{?dist}
+Release: 9%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -2065,6 +2065,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Tue Jun 03 2014 Dan Hork <dan[at]danny.cz> - 2.7.6-9
+- update the arch list where valgrind exists - %%power64 includes also
+ ppc64le which is not supported yet
+
* Wed May 21 2014 Jaroslav karvada <jskarvad(a)redhat.com> - 2.7.6-8
- Rebuilt for
https://fedoraproject.org/wiki/Changes/f21tcl86
commit 993ed3c4faadab4c6458a29410802dc4a29d5a26
Author: Jaroslav karvada <jskarvad(a)redhat.com>
Date: Wed May 21 12:34:52 2014 +0200
- Rebuilt for
https://fedoraproject.org/wiki/Changes/f21tcl86
diff --git a/python.spec b/python.spec
index 45527a9..c569ddc 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.6
-Release: 7%{?dist}
+Release: 8%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -2065,6 +2065,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Wed May 21 2014 Jaroslav karvada <jskarvad(a)redhat.com> - 2.7.6-8
+- Rebuilt for
https://fedoraproject.org/wiki/Changes/f21tcl86
+
* Fri May 09 2014 Tomas Radej <tradej(a)redhat.com> - 2.7.6-7
- Fixed obsoletes on ordereddict (bz #1095434)
commit f0ee294d71c8c53d23db054d50e944976dc40f2f
Author: Tomas Radej <tradej(a)redhat.com>
Date: Fri May 9 09:22:35 2014 +0200
Fixed obsoletes on ordereddict (bz #1095434)
diff --git a/python.spec b/python.spec
index 3ad368c..45527a9 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.6
-Release: 6%{?dist}
+Release: 7%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -910,7 +910,7 @@ Provides: Distutils
Obsoletes: python2
Provides: python2 = %{version}
Obsoletes: python-elementtree <= 1.2.6
-Obsoletes: python-ordereddict <= 1.1-7
+Obsoletes: python-ordereddict <= 1.1-8
Obsoletes: python-sqlite < 2.3.2
Provides: python-sqlite = 2.3.2
Obsoletes: python-ctypes < 1.0.1
@@ -2065,6 +2065,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Fri May 09 2014 Tomas Radej <tradej(a)redhat.com> - 2.7.6-7
+- Fixed obsoletes on ordereddict (bz #1095434)
+
* Mon Apr 14 2014 Tomas Radej <tradej(a)redhat.com> - 2.7.6-6
- Obsoletes python-ordereddict (bz #1085593, not precisely 1:1 replacement)
commit 0706c3293c45a73580bdc44d68db83c05515c922
Author: Tomas Radej <tradej(a)redhat.com>
Date: Mon Apr 14 10:02:43 2014 +0200
Obsoletes python-ordereddict (bz #1085593, not precisely 1:1 replacement)
diff --git a/python.spec b/python.spec
index 8c4d40a..3ad368c 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.6
-Release: 5%{?dist}
+Release: 6%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -910,6 +910,7 @@ Provides: Distutils
Obsoletes: python2
Provides: python2 = %{version}
Obsoletes: python-elementtree <= 1.2.6
+Obsoletes: python-ordereddict <= 1.1-7
Obsoletes: python-sqlite < 2.3.2
Provides: python-sqlite = 2.3.2
Obsoletes: python-ctypes < 1.0.1
@@ -2064,6 +2065,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Mon Apr 14 2014 Tomas Radej <tradej(a)redhat.com> - 2.7.6-6
+- Obsoletes python-ordereddict (bz #1085593, not precisely 1:1 replacement)
+
* Mon Apr 07 2014 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.6-5
- Fix test failure with SQLite > 3.8.4.
- Obsolete/Provide python-unittest2
commit cf980521aa071de10a6968d6b8dd88ffb7eb6de3
Author: Slavek Kabrda <bkabrda(a)redhat.com>
Date: Mon Apr 7 13:48:16 2014 +0200
Fix test failure with SQLite > 3.8.4.
- Obsolete/Provide python-unittest2.
diff --git a/00194-fix-tests-with-sqlite-3.8.4.patch
b/00194-fix-tests-with-sqlite-3.8.4.patch
new file mode 100644
index 0000000..4037c26
--- /dev/null
+++ b/00194-fix-tests-with-sqlite-3.8.4.patch
@@ -0,0 +1,19 @@
+# HG changeset patch
+# User Benjamin Peterson <benjamin(a)python.org>
+# Date 1394679112 18000
+# Node ID 1763e27a182d571cc3a428c71085bb86b3d895b5
+# Parent 1d31060f8a5c9695f0b79a738d355d8530e09cc7
+weaken callback count inequality (closes #20901)
+
+diff --git a/Lib/sqlite3/test/hooks.py b/Lib/sqlite3/test/hooks.py
+--- a/Lib/sqlite3/test/hooks.py
++++ b/Lib/sqlite3/test/hooks.py
+@@ -162,7 +162,7 @@ class ProgressTests(unittest.TestCase):
+ create table bar (a, b)
+ """)
+ second_count = len(progress_calls)
+- self.assertTrue(first_count > second_count)
++ self.assertGreaterEqual(first_count, second_count)
+
+ def CheckCancelOperation(self):
+ """
diff --git a/python.spec b/python.spec
index 066e54c..8c4d40a 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.6
-Release: 4%{?dist}
+Release: 5%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -867,6 +867,13 @@ Patch192: 00192-buffer-overflow.patch
# Patch provided by John C. Peterson
Patch193: 00193-enable-loading-sqlite-extensions.patch
+# 00194 #
+#
+# Fix tests with SQLite >= 3.8.4
+#
http://bugs.python.org/issue20901
+#
http://hg.python.org/cpython/raw-rev/1763e27a182d
+Patch194: 00194-fix-tests-with-sqlite-3.8.4.patch
+
# (New patches go here ^^^)
#
@@ -909,6 +916,8 @@ Obsoletes: python-ctypes < 1.0.1
Provides: python-ctypes = 1.0.1
Obsoletes: python-hashlib < 20081120
Provides: python-hashlib = 20081120
+Obsoletes: python-unittest2 < 0.5.1-9
+Provides: python-unittest2 = 0.5.1-9
Obsoletes: python-uuid < 1.31
Provides: python-uuid = 1.31
# obsolete, not provide PyXML as proposed in feature
@@ -1220,6 +1229,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch191 -p1
%patch192 -p1
%patch193 -p1
+%patch194 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -2054,6 +2064,11 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Mon Apr 07 2014 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.6-5
+- Fix test failure with SQLite > 3.8.4.
+- Obsolete/Provide python-unittest2
+Related: rhbz#1060426
+
* Wed Feb 19 2014 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.6-4
- Enable loading sqlite extensions.
Resolves: rhbz#1066708
commit 6739927946963e8afbc3d3dc32f37bf0ea843f01
Author: Slavek Kabrda <bkabrda(a)redhat.com>
Date: Wed Feb 19 14:29:31 2014 +0100
Enable loading sqlite extensions.
Resolves: rhbz#1066708
diff --git a/00193-enable-loading-sqlite-extensions.patch
b/00193-enable-loading-sqlite-extensions.patch
new file mode 100644
index 0000000..36d053a
--- /dev/null
+++ b/00193-enable-loading-sqlite-extensions.patch
@@ -0,0 +1,11 @@
+--- Python-2.7.5/setup.py.orig 2013-05-11 20:32:54.000000000 -0700
++++ Python-2.7.5/setup.py 2014-02-18 14:16:07.999004901 -0800
+@@ -1168,7 +1168,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.
+- sqlite_defines.append(("SQLITE_OMIT_LOAD_EXTENSION",
"1"))
++ #sqlite_defines.append(("SQLITE_OMIT_LOAD_EXTENSION",
"1"))
+
+ if host_platform == 'darwin':
+ # In every directory on the search path search for a dynamic
diff --git a/python.spec b/python.spec
index 989a5c3..066e54c 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.6
-Release: 3%{?dist}
+Release: 4%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -859,6 +859,14 @@ Patch191: 00191-disable-NOOP.patch
# rhbz#1062375
Patch192: 00192-buffer-overflow.patch
+# 00193 #
+#
+# Enable loading sqlite extensions. This patch isn't needed for
+# python3.spec, since Python 3 has a configuration option for this.
+# rhbz#1066708
+# Patch provided by John C. Peterson
+Patch193: 00193-enable-loading-sqlite-extensions.patch
+
# (New patches go here ^^^)
#
@@ -1211,6 +1219,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch190 -p1
%patch191 -p1
%patch192 -p1
+%patch193 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -2045,6 +2054,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Wed Feb 19 2014 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.6-4
+- Enable loading sqlite extensions.
+Resolves: rhbz#1066708
+
* Mon Feb 10 2014 Tomas Radej <tradej(a)redhat.com> - 2.7.6-3
- Fixed buffer overflow (upstream patch)
Resolves: rhbz#1062375
commit 645b355bed7767ffeebb9e8769529c5a70ea2a95
Author: Tomas Radej <tradej(a)redhat.com>
Date: Mon Feb 10 13:54:05 2014 +0100
Fixed buffer overflow (upstream patch)
Resolves: rhbz#1062375
diff --git a/00192-buffer-overflow.patch b/00192-buffer-overflow.patch
new file mode 100644
index 0000000..164b462
--- /dev/null
+++ b/00192-buffer-overflow.patch
@@ -0,0 +1,43 @@
+
+# HG changeset patch
+# User Benjamin Peterson <benjamin(a)python.org>
+# Date 1389671978 18000
+# Node ID 87673659d8f7ba1623cd4914f09ad3d2ade034e9
+# Parent 2631d33ee7fbd5f0288931ef37872218d511d2e8
+complain when nbytes > buflen to fix possible buffer overflow (closes #20246)
+
+diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
+--- a/Lib/test/test_socket.py
++++ b/Lib/test/test_socket.py
+@@ -1620,6 +1620,16 @@ class BufferIOTest(SocketConnectedTest):
+
+ _testRecvFromIntoMemoryview = _testRecvFromIntoArray
+
++ def testRecvFromIntoSmallBuffer(self):
++ # See issue #20246.
++ buf = bytearray(8)
++ self.assertRaises(ValueError, self.cli_conn.recvfrom_into, buf, 1024)
++
++ def _testRecvFromIntoSmallBuffer(self):
++ with test_support.check_py3k_warnings():
++ buf = buffer(MSG*2048)
++ self.serv_conn.send(buf)
++
+
+ TIPC_STYPE = 2000
+ TIPC_LOWER = 200
+diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
+--- a/Modules/socketmodule.c
++++ b/Modules/socketmodule.c
+@@ -2742,6 +2742,10 @@ sock_recvfrom_into(PySocketSockObject *s
+ if (recvlen == 0) {
+ /* If nbytes was not specified, use the buffer's length */
+ recvlen = buflen;
++ } else if (recvlen > buflen) {
++ PyErr_SetString(PyExc_ValueError,
++ "nbytes is greater than the length of the buffer");
++ goto error;
+ }
+
+ readlen = sock_recvfrom_guts(s, buf.buf, recvlen, flags, &addr);
+
diff --git a/python.spec b/python.spec
index 670b968..989a5c3 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.6
-Release: 2%{?dist}
+Release: 3%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -853,6 +853,13 @@ Patch190: 00190-get_python_version.patch
# Disabling NOOP test as it fails without internet connection
Patch191: 00191-disable-NOOP.patch
+# 00192 #
+#
+# Fixing buffer overflow (upstream patch)
+# rhbz#1062375
+Patch192: 00192-buffer-overflow.patch
+
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -1203,6 +1210,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch189 -p1
%patch190 -p1
%patch191 -p1
+%patch192 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -2037,6 +2045,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Mon Feb 10 2014 Tomas Radej <tradej(a)redhat.com> - 2.7.6-3
+- Fixed buffer overflow (upstream patch)
+Resolves: rhbz#1062375
+
* Tue Feb 04 2014 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.6-2
- Install macros in _rpmconfigdir.
commit 01c16031a5caac0694c4cef6a653ab2ff997424a
Author: Slavek Kabrda <bkabrda(a)redhat.com>
Date: Tue Feb 4 13:32:10 2014 +0100
Install macros in _rpmconfigdir.
diff --git a/python.spec b/python.spec
index cc7192d..670b968 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.6
-Release: 1%{?dist}
+Release: 2%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1562,8 +1562,8 @@ sed -i -e
"s/'pyconfig.h'/'%{_pyconfig_h}'/" \
%{buildroot}%{pylibdir}/sysconfig.py
# Install macros for rpm:
-mkdir -p %{buildroot}/%{_sysconfdir}/rpm
-install -m 644 %{SOURCE6} %{buildroot}/%{_sysconfdir}/rpm
+mkdir -p %{buildroot}/%{_rpmconfigdir}/macros.d/
+install -m 644 %{SOURCE6} %{buildroot}/%{_rpmconfigdir}/macros.d/
# Ensure that the curses module was linked against libncursesw.so, rather than
# libncurses.so (bug 539917)
@@ -1856,7 +1856,7 @@ rm -fr %{buildroot}
%endif
%{_bindir}/python%{pybasever}-config
%{_libdir}/libpython%{pybasever}.so
-%{_sysconfdir}/rpm/macros.python2
+%{_rpmconfigdir}/macros.d/macros.python2
%files tools
%defattr(-,root,root,755)
@@ -2037,6 +2037,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Tue Feb 04 2014 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.6-2
+- Install macros in _rpmconfigdir.
+
* Wed Jan 29 2014 Tomas Radej <tradej(a)redhat.com> - 2.7.6-1
- Updated to v2.7.6
- Freshened patches 102, 111, 112, 136, and 142
commit 112f64375b81fe0cc0e25229cf234262bc2a3dd5
Author: Tomas Radej <tradej(a)redhat.com>
Date: Thu Jan 30 12:35:44 2014 +0100
Patched failing NOOP test
diff --git a/00191-disable-NOOP.patch b/00191-disable-NOOP.patch
new file mode 100644
index 0000000..fbe9474
--- /dev/null
+++ b/00191-disable-NOOP.patch
@@ -0,0 +1,12 @@
+diff --git a/Lib/test/test_smtplib.py b/Lib/test/test_smtplib.py
+index 81806c9..e7881b9 100644
+--- a/Lib/test/test_smtplib.py
++++ b/Lib/test/test_smtplib.py
+@@ -182,6 +182,7 @@ class DebuggingServerTests(unittest.TestCase):
+ smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost',
timeout=3)
+ smtp.quit()
+
++ @unittest._skipInRpmBuild("Does not work in network-free environment")
+ def testNOOP(self):
+ smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost',
timeout=3)
+ expected = (250, 'Ok')
diff --git a/python.spec b/python.spec
index f002397..cc7192d 100644
--- a/python.spec
+++ b/python.spec
@@ -848,6 +848,11 @@ Patch189: 00189-gdb-py-bt-dont-raise-exception-from-eval.patch
# rhbz#1029082
Patch190: 00190-get_python_version.patch
+# 00191 #
+#
+# Disabling NOOP test as it fails without internet connection
+Patch191: 00191-disable-NOOP.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -1197,6 +1202,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch187 -p1
%patch189 -p1
%patch190 -p1
+%patch191 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
commit 9b754ebeb6c5b6a735d7f5cb68ccc191987e8280
Author: Tomas Radej <tradej(a)redhat.com>
Date: Wed Jan 29 15:32:33 2014 +0100
Changelog
diff --git a/python.spec b/python.spec
index 79acc38..f002397 100644
--- a/python.spec
+++ b/python.spec
@@ -2033,6 +2033,8 @@ rm -fr %{buildroot}
%changelog
* Wed Jan 29 2014 Tomas Radej <tradej(a)redhat.com> - 2.7.6-1
- Updated to v2.7.6
+- Freshened patches 102, 111, 112, 136, and 142
+- Dropped patches 186, 188 (both fixed upstream)
* Wed Jan 15 2014 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.5-11
- Make library-files user writable to get rid of
commit 8339259035d689975398998464b3ee632fadc32e
Author: Tomas Radej <tradej(a)redhat.com>
Date: Wed Jan 29 15:18:12 2014 +0100
Removed hostname-check-bypass patch (fixed upstream)
diff --git a/00188-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch
b/00188-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch
deleted file mode 100644
index e215589..0000000
--- a/00188-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch
+++ /dev/null
@@ -1,247 +0,0 @@
-diff -r 9ddc63c039ba Lib/test/nullbytecert.pem
---- /dev/null Thu Jan 01 00:00:00 1970 +0000
-+++ b/Lib/test/nullbytecert.pem Sun Aug 11 18:13:17 2013 +0200
-@@ -0,0 +1,90 @@
-+Certificate:
-+ Data:
-+ Version: 3 (0x2)
-+ Serial Number: 0 (0x0)
-+ Signature Algorithm: sha1WithRSAEncryption
-+ Issuer: C=US, ST=Oregon, L=Beaverton, O=Python Software Foundation, OU=Python
Core Development,
CN=null.python.org\x00example.org/emailAddress=python-dev@python.org
-+ Validity
-+ Not Before: Aug 7 13:11:52 2013 GMT
-+ Not After : Aug 7 13:12:52 2013 GMT
-+ Subject: C=US, ST=Oregon, L=Beaverton, O=Python Software Foundation, OU=Python
Core Development,
CN=null.python.org\x00example.org/emailAddress=python-dev@python.org
-+ Subject Public Key Info:
-+ Public Key Algorithm: rsaEncryption
-+ Public-Key: (2048 bit)
-+ Modulus:
-+ 00:b5:ea:ed:c9:fb:46:7d:6f:3b:76:80:dd:3a:f3:
-+ 03:94:0b:a7:a6:db:ec:1d:df:ff:23:74:08:9d:97:
-+ 16:3f:a3:a4:7b:3e:1b:0e:96:59:25:03:a7:26:e2:
-+ 88:a9:cf:79:cd:f7:04:56:b0:ab:79:32:6e:59:c1:
-+ 32:30:54:eb:58:a8:cb:91:f0:42:a5:64:27:cb:d4:
-+ 56:31:88:52:ad:cf:bd:7f:f0:06:64:1f:cc:27:b8:
-+ a3:8b:8c:f3:d8:29:1f:25:0b:f5:46:06:1b:ca:02:
-+ 45:ad:7b:76:0a:9c:bf:bb:b9:ae:0d:16:ab:60:75:
-+ ae:06:3e:9c:7c:31:dc:92:2f:29:1a:e0:4b:0c:91:
-+ 90:6c:e9:37:c5:90:d7:2a:d7:97:15:a3:80:8f:5d:
-+ 7b:49:8f:54:30:d4:97:2c:1c:5b:37:b5:ab:69:30:
-+ 68:43:d3:33:78:4b:02:60:f5:3c:44:80:a1:8f:e7:
-+ f0:0f:d1:5e:87:9e:46:cf:62:fc:f9:bf:0c:65:12:
-+ f1:93:c8:35:79:3f:c8:ec:ec:47:f5:ef:be:44:d5:
-+ ae:82:1e:2d:9a:9f:98:5a:67:65:e1:74:70:7c:cb:
-+ d3:c2:ce:0e:45:49:27:dc:e3:2d:d4:fb:48:0e:2f:
-+ 9e:77:b8:14:46:c0:c4:36:ca:02:ae:6a:91:8c:da:
-+ 2f:85
-+ Exponent: 65537 (0x10001)
-+ X509v3 extensions:
-+ X509v3 Basic Constraints: critical
-+ CA:FALSE
-+ X509v3 Subject Key Identifier:
-+ 88:5A:55:C0:52:FF:61:CD:52:A3:35:0F:EA:5A:9C:24:38:22:F7:5C
-+ X509v3 Key Usage:
-+ Digital Signature, Non Repudiation, Key Encipherment
-+ X509v3 Subject Alternative Name:
-+ *************************************************************
-+ WARNING: The values for DNS, email and URI are WRONG. OpenSSL
-+ doesn't print the text after a NULL byte.
-+ *************************************************************
-+
DNS:altnull.python.org, email:null@python.org,
URI:http://null.python.org, IP Address:192.0.2.1, IP Address:2001:DB8:0:0:0:0:0:1
-+ Signature Algorithm: sha1WithRSAEncryption
-+ ac:4f:45:ef:7d:49:a8:21:70:8e:88:59:3e:d4:36:42:70:f5:
-+ a3:bd:8b:d7:a8:d0:58:f6:31:4a:b1:a4:a6:dd:6f:d9:e8:44:
-+ 3c:b6:0a:71:d6:7f:b1:08:61:9d:60:ce:75:cf:77:0c:d2:37:
-+ 86:02:8d:5e:5d:f9:0f:71:b4:16:a8:c1:3d:23:1c:f1:11:b3:
-+ 56:6e:ca:d0:8d:34:94:e6:87:2a:99:f2:ae:ae:cc:c2:e8:86:
-+ de:08:a8:7f:c5:05:fa:6f:81:a7:82:e6:d0:53:9d:34:f4:ac:
-+ 3e:40:fe:89:57:7a:29:a4:91:7e:0b:c6:51:31:e5:10:2f:a4:
-+ 60:76:cd:95:51:1a:be:8b:a1:b0:fd:ad:52:bd:d7:1b:87:60:
-+ d2:31:c7:17:c4:18:4f:2d:08:25:a3:a7:4f:b7:92:ca:e2:f5:
-+ 25:f1:54:75:81:9d:b3:3d:61:a2:f7:da:ed:e1:c6:6f:2c:60:
-+ 1f:d8:6f:c5:92:05:ab:c9:09:62:49:a9:14:ad:55:11:cc:d6:
-+ 4a:19:94:99:97:37:1d:81:5f:8b:cf:a3:a8:96:44:51:08:3d:
-+ 0b:05:65:12:eb:b6:70:80:88:48:72:4f:c6:c2:da:cf:cd:8e:
-+ 5b:ba:97:2f:60:b4:96:56:49:5e:3a:43:76:63:04:be:2a:f6:
-+ c1:ca:a9:94
-+-----BEGIN CERTIFICATE-----
-+MIIE2DCCA8CgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBxTELMAkGA1UEBhMCVVMx
-+DzANBgNVBAgMBk9yZWdvbjESMBAGA1UEBwwJQmVhdmVydG9uMSMwIQYDVQQKDBpQ
-+eXRob24gU29mdHdhcmUgRm91bmRhdGlvbjEgMB4GA1UECwwXUHl0aG9uIENvcmUg
-+RGV2ZWxvcG1lbnQxJDAiBgNVBAMMG251bGwucHl0aG9uLm9yZwBleGFtcGxlLm9y
-+ZzEkMCIGCSqGSIb3DQEJARYVcHl0aG9uLWRldkBweXRob24ub3JnMB4XDTEzMDgw
-+NzEzMTE1MloXDTEzMDgwNzEzMTI1MlowgcUxCzAJBgNVBAYTAlVTMQ8wDQYDVQQI
-+DAZPcmVnb24xEjAQBgNVBAcMCUJlYXZlcnRvbjEjMCEGA1UECgwaUHl0aG9uIFNv
-+ZnR3YXJlIEZvdW5kYXRpb24xIDAeBgNVBAsMF1B5dGhvbiBDb3JlIERldmVsb3Bt
-+ZW50MSQwIgYDVQQDDBtudWxsLnB5dGhvbi5vcmcAZXhhbXBsZS5vcmcxJDAiBgkq
-+hkiG9w0BCQEWFXB5dGhvbi1kZXZAcHl0aG9uLm9yZzCCASIwDQYJKoZIhvcNAQEB
-+BQADggEPADCCAQoCggEBALXq7cn7Rn1vO3aA3TrzA5QLp6bb7B3f/yN0CJ2XFj+j
-+pHs+Gw6WWSUDpybiiKnPec33BFawq3kyblnBMjBU61ioy5HwQqVkJ8vUVjGIUq3P
-+vX/wBmQfzCe4o4uM89gpHyUL9UYGG8oCRa17dgqcv7u5rg0Wq2B1rgY+nHwx3JIv
-+KRrgSwyRkGzpN8WQ1yrXlxWjgI9de0mPVDDUlywcWze1q2kwaEPTM3hLAmD1PESA
-+oY/n8A/RXoeeRs9i/Pm/DGUS8ZPINXk/yOzsR/XvvkTVroIeLZqfmFpnZeF0cHzL
-+08LODkVJJ9zjLdT7SA4vnne4FEbAxDbKAq5qkYzaL4UCAwEAAaOB0DCBzTAMBgNV
-+HRMBAf8EAjAAMB0GA1UdDgQWBBSIWlXAUv9hzVKjNQ/qWpwkOCL3XDALBgNVHQ8E
-+BAMCBeAwgZAGA1UdEQSBiDCBhYIeYWx0bnVsbC5weXRob24ub3JnAGV4YW1wbGUu
-+Y29tgSBudWxsQHB5dGhvbi5vcmcAdXNlckBleGFtcGxlLm9yZ4YpaHR0cDovL251
-+bGwucHl0aG9uLm9yZwBodHRwOi8vZXhhbXBsZS5vcmeHBMAAAgGHECABDbgAAAAA
-+AAAAAAAAAAEwDQYJKoZIhvcNAQEFBQADggEBAKxPRe99SaghcI6IWT7UNkJw9aO9
-+i9eo0Fj2MUqxpKbdb9noRDy2CnHWf7EIYZ1gznXPdwzSN4YCjV5d+Q9xtBaowT0j
-+HPERs1ZuytCNNJTmhyqZ8q6uzMLoht4IqH/FBfpvgaeC5tBTnTT0rD5A/olXeimk
-+kX4LxlEx5RAvpGB2zZVRGr6LobD9rVK91xuHYNIxxxfEGE8tCCWjp0+3ksri9SXx
-+VHWBnbM9YaL32u3hxm8sYB/Yb8WSBavJCWJJqRStVRHM1koZlJmXNx2BX4vPo6iW
-+RFEIPQsFZRLrtnCAiEhyT8bC2s/Njlu6ly9gtJZWSV46Q3ZjBL4q9sHKqZQ=
-+-----END CERTIFICATE-----
-diff -r 9ddc63c039ba Lib/test/test_ssl.py
---- a/Lib/test/test_ssl.py Sun Aug 11 13:04:50 2013 +0300
-+++ b/Lib/test/test_ssl.py Sun Aug 11 18:13:17 2013 +0200
-@@ -25,6 +25,7 @@
- HOST = test_support.HOST
- CERTFILE = None
- SVN_PYTHON_ORG_ROOT_CERT = None
-+NULLBYTECERT = None
-
- def handle_error(prefix):
- exc_format = ' '.join(traceback.format_exception(*sys.exc_info()))
-@@ -123,6 +124,27 @@
- ('DNS', 'projects.forum.nokia.com'))
- )
-
-+ def test_parse_cert_CVE_2013_4073(self):
-+ p = ssl._ssl._test_decode_cert(NULLBYTECERT)
-+ if test_support.verbose:
-+ sys.stdout.write("\n" + pprint.pformat(p) + "\n")
-+ subject = ((('countryName', 'US'),),
-+ (('stateOrProvinceName', 'Oregon'),),
-+ (('localityName', 'Beaverton'),),
-+ (('organizationName', 'Python Software
Foundation'),),
-+ (('organizationalUnitName', 'Python Core
Development'),),
-+ (('commonName', 'null.python.org\x00example.org'),),
-+ (('emailAddress', 'python-dev(a)python.org'),))
-+ self.assertEqual(p['subject'], subject)
-+ self.assertEqual(p['issuer'], subject)
-+ self.assertEqual(p['subjectAltName'],
-+ (('DNS', 'altnull.python.org\x00example.com'),
-+ ('email',
'null@python.org\x00user(a)example.org'),
-+ ('URI',
'http://null.python.org\x00http://example.org'),
-+ ('IP Address', '192.0.2.1'),
-+ ('IP Address', '2001:DB8:0:0:0:0:0:1\n'))
-+ )
-+
- def test_DER_to_PEM(self):
- with open(SVN_PYTHON_ORG_ROOT_CERT, 'r') as f:
- pem = f.read()
-@@ -1360,7 +1382,7 @@
-
-
- def test_main(verbose=False):
-- global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, NOKIACERT
-+ global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, NOKIACERT, NULLBYTECERT
- CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir,
- "keycert.pem")
- SVN_PYTHON_ORG_ROOT_CERT = os.path.join(
-@@ -1368,10 +1390,13 @@
- "https_svn_python_org_root.pem")
- NOKIACERT = os.path.join(os.path.dirname(__file__) or os.curdir,
- "nokia.pem")
-+ NULLBYTECERT = os.path.join(os.path.dirname(__file__) or os.curdir,
-+ "nullbytecert.pem")
-
- if (not os.path.exists(CERTFILE) or
- not os.path.exists(SVN_PYTHON_ORG_ROOT_CERT) or
-- not os.path.exists(NOKIACERT)):
-+ not os.path.exists(NOKIACERT) or
-+ not os.path.exists(NULLBYTECERT)):
- raise test_support.TestFailed("Can't read certificate files!")
-
- tests = [BasicTests, BasicSocketTests]
-diff -r 9ddc63c039ba Modules/_ssl.c
---- a/Modules/_ssl.c Sun Aug 11 13:04:50 2013 +0300
-+++ b/Modules/_ssl.c Sun Aug 11 18:13:17 2013 +0200
-@@ -741,8 +741,13 @@
-
- /* get a rendering of each name in the set of names */
-
-+ int gntype;
-+ ASN1_STRING *as = NULL;
-+
- name = sk_GENERAL_NAME_value(names, j);
-- if (name->type == GEN_DIRNAME) {
-+ gntype = name-> type;
-+ switch (gntype) {
-+ case GEN_DIRNAME:
-
- /* we special-case DirName as a tuple of tuples of attributes */
-
-@@ -764,11 +769,61 @@
- goto fail;
- }
- PyTuple_SET_ITEM(t, 1, v);
-+ break;
-
-- } else {
-+ case GEN_EMAIL:
-+ case GEN_DNS:
-+ case GEN_URI:
-+ /* GENERAL_NAME_print() doesn't handle NUL bytes in ASN1_string
-+ correctly. */
-+ t = PyTuple_New(2);
-+ if (t == NULL)
-+ goto fail;
-+ switch (gntype) {
-+ case GEN_EMAIL:
-+ v = PyUnicode_FromString("email");
-+ as = name->d.rfc822Name;
-+ break;
-+ case GEN_DNS:
-+ v = PyUnicode_FromString("DNS");
-+ as = name->d.dNSName;
-+ break;
-+ case GEN_URI:
-+ v = PyUnicode_FromString("URI");
-+ as = name->d.uniformResourceIdentifier;
-+ break;
-+ }
-+ if (v == NULL) {
-+ Py_DECREF(t);
-+ goto fail;
-+ }
-+ PyTuple_SET_ITEM(t, 0, v);
-+ v = PyString_FromStringAndSize((char *)ASN1_STRING_data(as),
-+ ASN1_STRING_length(as));
-+ if (v == NULL) {
-+ Py_DECREF(t);
-+ goto fail;
-+ }
-+ PyTuple_SET_ITEM(t, 1, v);
-+ break;
-
-+ default:
- /* for everything else, we use the OpenSSL print form */
--
-+ switch (gntype) {
-+ /* check for new general name type */
-+ case GEN_OTHERNAME:
-+ case GEN_X400:
-+ case GEN_EDIPARTY:
-+ case GEN_IPADD:
-+ case GEN_RID:
-+ break;
-+ default:
-+ if (PyErr_Warn(PyExc_RuntimeWarning,
-+ "Unknown general name type") == -1) {
-+ goto fail;
-+ }
-+ break;
-+ }
- (void) BIO_reset(biobuf);
- GENERAL_NAME_print(biobuf, name);
- len = BIO_gets(biobuf, buf, sizeof(buf)-1);
-@@ -794,6 +849,7 @@
- goto fail;
- }
- PyTuple_SET_ITEM(t, 1, v);
-+ break;
- }
-
- /* and add that rendering to the list */
diff --git a/python.spec b/python.spec
index 908f5e3..79acc38 100644
--- a/python.spec
+++ b/python.spec
@@ -835,13 +835,6 @@ Patch185: 00185-urllib2-honors-noproxy-for-ftp.patch
# symbol)
Patch187: 00187-add-RPATH-to-pyexpat.patch
-# 00188 #
-# Fix for CVE-2013-4238 --
-# SSL module fails to handle NULL bytes inside subjectAltNames general names
-#
http://bugs.python.org/issue18709
-# rhbz#998430
-Patch188: 00188-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch
-
# 00189 #
# Fixes gdb py-bt command not to raise exception while processing
# statements from eval
@@ -1202,7 +1195,6 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch184 -p1
%patch185 -p1
%patch187 -p1
-%patch188 -p1
%patch189 -p1
%patch190 -p1
commit 3bea150658c4155e9c3042303a2c454b137c8cbf
Author: Tomas Radej <tradej(a)redhat.com>
Date: Wed Jan 29 15:07:05 2014 +0100
Removed marshal.c patch (fixed upstream)
diff --git a/00186-memory-leak-marshalc.patch b/00186-memory-leak-marshalc.patch
deleted file mode 100644
index 19fb175..0000000
--- a/00186-memory-leak-marshalc.patch
+++ /dev/null
@@ -1,57 +0,0 @@
---- Python-2.7.5/Python/marshal.c 2013-05-12 05:32:53.000000000 +0200
-+++ /home/rkuska/hg/cpython/Python/marshal.c 2013-07-18 10:33:26.392486235 +0200
-@@ -88,7 +88,7 @@
- }
-
- static void
--w_string(char *s, Py_ssize_t n, WFILE *p)
-+w_string(const char *s, Py_ssize_t n, WFILE *p)
- {
- if (p->fp != NULL) {
- fwrite(s, 1, n, p->fp);
-@@ -141,6 +141,13 @@
- # define W_SIZE w_long
- #endif
-
-+static void
-+w_pstring(const char *s, Py_ssize_t n, WFILE *p)
-+{
-+ W_SIZE(n, p);
-+ w_string(s, n, p);
-+}
-+
- /* We assume that Python longs are stored internally in base some power of
- 2**15; for the sake of portability we'll always read and write them in base
- exactly 2**15. */
-@@ -338,9 +345,7 @@
- else {
- w_byte(TYPE_STRING, p);
- }
-- n = PyString_GET_SIZE(v);
-- W_SIZE(n, p);
-- w_string(PyString_AS_STRING(v), n, p);
-+ w_pstring(PyBytes_AS_STRING(v), PyString_GET_SIZE(v), p);
- }
- #ifdef Py_USING_UNICODE
- else if (PyUnicode_CheckExact(v)) {
-@@ -352,9 +357,7 @@
- return;
- }
- w_byte(TYPE_UNICODE, p);
-- n = PyString_GET_SIZE(utf8);
-- W_SIZE(n, p);
-- w_string(PyString_AS_STRING(utf8), n, p);
-+ w_pstring(PyString_AS_STRING(utf8), PyString_GET_SIZE(utf8), p);
- Py_DECREF(utf8);
- }
- #endif
-@@ -441,8 +444,7 @@
- PyBufferProcs *pb = v->ob_type->tp_as_buffer;
- w_byte(TYPE_STRING, p);
- n = (*pb->bf_getreadbuffer)(v, 0, (void **)&s);
-- W_SIZE(n, p);
-- w_string(s, n, p);
-+ w_pstring(s, n, p);
- }
- else {
- w_byte(TYPE_UNKNOWN, p);
diff --git a/python.spec b/python.spec
index 1ee96ea..908f5e3 100644
--- a/python.spec
+++ b/python.spec
@@ -827,10 +827,6 @@ Patch184:
00184-ctypes-should-build-with-libffi-multilib-wrapper.patch
# when ftp_proxy is set
Patch185: 00185-urllib2-honors-noproxy-for-ftp.patch
-# 00186 #
-# Fix memory leak of variable utf8 in marshal.c
-Patch186: 00186-memory-leak-marshalc.patch
-
# 00187 #
# Add an explicit RPATH to pyexpat.so pointing at the directory
# containing the system expat (which has the extra XML_SetHashSalt
@@ -1205,7 +1201,6 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
# 00183: not for python 2
%patch184 -p1
%patch185 -p1
-%patch186 -p1
%patch187 -p1
%patch188 -p1
%patch189 -p1
commit b64e81110d6b33ccf4d46089041acd4be7b5d14f
Author: Tomas Radej <tradej(a)redhat.com>
Date: Wed Jan 29 14:33:01 2014 +0100
Fixed tty-fail patch
diff --git a/00142-skip-failing-pty-tests-in-rpmbuild.patch
b/00142-skip-failing-pty-tests-in-rpmbuild.patch
index 414ffcd..2f51165 100644
--- a/00142-skip-failing-pty-tests-in-rpmbuild.patch
+++ b/00142-skip-failing-pty-tests-in-rpmbuild.patch
@@ -1,6 +1,6 @@
-diff -up Python-2.7.2/Lib/test/test_openpty.py.skip-failing-pty-tests-in-rpmbuild
Python-2.7.2/Lib/test/test_openpty.py
---- Python-2.7.2/Lib/test/test_openpty.py.skip-failing-pty-tests-in-rpmbuild 2011-09-09
05:09:28.698920379 -0400
-+++ Python-2.7.2/Lib/test/test_openpty.py 2011-09-09 05:10:54.805914490 -0400
+diff -up Python-2.7.6/Lib/test/test_openpty.py.tty-fail
Python-2.7.6/Lib/test/test_openpty.py
+--- Python-2.7.6/Lib/test/test_openpty.py.tty-fail 2014-01-29 14:31:43.761343267 +0100
++++ Python-2.7.6/Lib/test/test_openpty.py 2014-01-29 14:32:19.284090165 +0100
@@ -8,6 +8,7 @@ if not hasattr(os, "openpty"):
@@ -8,11 +8,11 @@ diff -up
Python-2.7.2/Lib/test/test_openpty.py.skip-failing-pty-tests-in-rpmbuil
+ @unittest._skipInRpmBuild('sometimes fails in Koji, possibly due to a mock issue
(rhbz#714627)')
def test(self):
master, slave = os.openpty()
- if not os.isatty(slave):
-diff -up Python-2.7.2/Lib/test/test_pty.py.skip-failing-pty-tests-in-rpmbuild
Python-2.7.2/Lib/test/test_pty.py
---- Python-2.7.2/Lib/test/test_pty.py.skip-failing-pty-tests-in-rpmbuild 2011-09-09
05:09:36.781919825 -0400
-+++ Python-2.7.2/Lib/test/test_pty.py 2011-09-09 05:11:14.741913127 -0400
-@@ -109,6 +109,7 @@ class PtyTest(unittest.TestCase):
+ self.addCleanup(os.close, master)
+diff -up Python-2.7.6/Lib/test/test_pty.py.tty-fail Python-2.7.6/Lib/test/test_pty.py
+--- Python-2.7.6/Lib/test/test_pty.py.tty-fail 2013-11-10 08:36:40.000000000 +0100
++++ Python-2.7.6/Lib/test/test_pty.py 2014-01-29 14:31:43.761343267 +0100
+@@ -111,6 +111,7 @@ class PtyTest(unittest.TestCase):
os.close(master_fd)
diff --git a/python.spec b/python.spec
index e53b506..1ee96ea 100644
--- a/python.spec
+++ b/python.spec
@@ -1159,7 +1159,7 @@ done
%patch140 -p1
%endif
%patch141 -p1
-%patch142 -p1
+%patch142 -p1 -b .tty-fail
%patch143 -p1 -b .tsc-on-ppc
%if !%{with_gdbm}
%patch144 -p1
commit b2766547f59e5ae61776800f0a9e08b028d391ea
Author: Tomas Radej <tradej(a)redhat.com>
Date: Wed Jan 29 14:27:21 2014 +0100
Fixed stdin-test patch
diff --git a/00136-skip-tests-of-seeking-stdin-in-rpmbuild.patch
b/00136-skip-tests-of-seeking-stdin-in-rpmbuild.patch
index 845fb2a..1214055 100644
--- a/00136-skip-tests-of-seeking-stdin-in-rpmbuild.patch
+++ b/00136-skip-tests-of-seeking-stdin-in-rpmbuild.patch
@@ -1,7 +1,7 @@
-diff -up Python-2.7.2/Lib/test/test_file2k.py.skip-tests-of-seeking-stdin-in-rpmbuild
Python-2.7.2/Lib/test/test_file2k.py
----
Python-2.7.2/Lib/test/test_file2k.py.skip-tests-of-seeking-stdin-in-rpmbuild 2011-09-08
17:23:50.922520729 -0400
-+++ Python-2.7.2/Lib/test/test_file2k.py 2011-09-08 17:24:41.368517277 -0400
-@@ -213,6 +213,7 @@ class OtherFileTests(unittest.TestCase):
+diff -up Python-2.7.6/Lib/test/test_file2k.py.stdin-test
Python-2.7.6/Lib/test/test_file2k.py
+--- Python-2.7.6/Lib/test/test_file2k.py.stdin-test 2013-11-10 08:36:40.000000000 +0100
++++ Python-2.7.6/Lib/test/test_file2k.py 2014-01-29 14:28:01.029488055 +0100
+@@ -223,6 +223,7 @@ class OtherFileTests(unittest.TestCase):
else:
f.close()
@@ -9,14 +9,3 @@ diff -up
Python-2.7.2/Lib/test/test_file2k.py.skip-tests-of-seeking-stdin-in-rpm
def testStdin(self):
# This causes the interpreter to exit on OSF1 v5.1.
if sys.platform != 'osf1V5':
-diff -up Python-2.7.2/Lib/test/test_file.py.skip-tests-of-seeking-stdin-in-rpmbuild
Python-2.7.2/Lib/test/test_file.py
---- Python-2.7.2/Lib/test/test_file.py.skip-tests-of-seeking-stdin-in-rpmbuild 2011-09-08
17:20:31.146534389 -0400
-+++ Python-2.7.2/Lib/test/test_file.py 2011-09-08 17:24:45.016517030 -0400
-@@ -154,6 +154,7 @@ class OtherFileTests(unittest.TestCase):
- f.close()
- self.fail('%r is an invalid file mode' % mode)
-
-+ @unittest._skipInRpmBuild('seems not to raise the exception when run in
Koji')
- def testStdin(self):
- # This causes the interpreter to exit on OSF1 v5.1.
- if sys.platform != 'osf1V5':
diff --git a/python.spec b/python.spec
index 83920a7..e53b506 100644
--- a/python.spec
+++ b/python.spec
@@ -1149,7 +1149,7 @@ done
%patch133 -p1
%patch134 -p1
%patch135 -p1
-%patch136 -p1
+%patch136 -p1 -b .stdin-test
%patch137 -p1
%patch138 -p1
%ifarch %{arm}
commit cc95a97b3556e07d3dc815423f27287dab23e609
Author: Tomas Radej <tradej(a)redhat.com>
Date: Wed Jan 29 14:20:07 2014 +0100
Fixed debug-build patch
diff --git a/python-2.7.3-debug-build.patch b/python-2.7.3-debug-build.patch
index 5b6cda7..d20e9d3 100644
--- a/python-2.7.3-debug-build.patch
+++ b/python-2.7.3-debug-build.patch
@@ -1,45 +1,7 @@
-diff -up Python-2.7.3/configure.ac.debug-build Python-2.7.3/configure.ac
---- Python-2.7.3/configure.ac.debug-build 2012-04-18 19:46:22.066498521 -0400
-+++ Python-2.7.3/configure.ac 2012-04-18 19:46:22.078498372 -0400
-@@ -635,7 +635,7 @@ AC_SUBST(LIBRARY)
- AC_MSG_CHECKING(LIBRARY)
- if test -z "$LIBRARY"
- then
-- LIBRARY='libpython$(VERSION).a'
-+ LIBRARY='libpython$(VERSION)$(DEBUG_EXT).a'
- fi
- AC_MSG_RESULT($LIBRARY)
-
-@@ -780,8 +780,8 @@ if test $enable_shared = "yes"; then
- INSTSONAME="$LDLIBRARY".$SOVERSION
- ;;
- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*)
-- LDLIBRARY='libpython$(VERSION).so'
-- BLDLIBRARY='-L. -lpython$(VERSION)'
-+ LDLIBRARY='libpython$(VERSION)$(DEBUG_EXT).so'
-+ BLDLIBRARY='-L. -lpython$(VERSION)$(DEBUG_EXT)'
- RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
- case $ac_sys_system in
- FreeBSD*)
-@@ -905,6 +905,14 @@ else AC_MSG_RESULT(no); Py_DEBUG='false'
- fi],
- [AC_MSG_RESULT(no)])
-
-+if test "$Py_DEBUG" = 'true'
-+then
-+ DEBUG_EXT=_d
-+ DEBUG_SUFFIX=-debug
-+fi
-+AC_SUBST(DEBUG_EXT)
-+AC_SUBST(DEBUG_SUFFIX)
-+
- # XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
- # merged with this chunk of code?
-
-diff -up Python-2.7.3/Lib/distutils/command/build_ext.py.debug-build
Python-2.7.3/Lib/distutils/command/build_ext.py
---- Python-2.7.3/Lib/distutils/command/build_ext.py.debug-build 2012-04-09
19:07:29.000000000 -0400
-+++ Python-2.7.3/Lib/distutils/command/build_ext.py 2012-04-18 19:46:22.079498360 -0400
-@@ -676,7 +676,10 @@ class build_ext (Command):
+diff -up Python-2.7.6/Lib/distutils/command/build_ext.py.debug-build
Python-2.7.6/Lib/distutils/command/build_ext.py
+--- Python-2.7.6/Lib/distutils/command/build_ext.py.debug-build 2013-11-10
08:36:40.000000000 +0100
++++ Python-2.7.6/Lib/distutils/command/build_ext.py 2014-01-29 14:13:08.815888533 +0100
+@@ -674,7 +674,10 @@ class build_ext (Command):
so_ext = get_config_var('SO')
if os.name == 'nt' and self.debug:
return os.path.join(*ext_path) + '_d' + so_ext
@@ -51,7 +13,7 @@ diff -up Python-2.7.3/Lib/distutils/command/build_ext.py.debug-build
Python-2.7.
def get_export_symbols (self, ext):
"""Return the list of symbols that a shared extension has to
-@@ -761,6 +764,8 @@ class build_ext (Command):
+@@ -759,6 +762,8 @@ class build_ext (Command):
template = "python%d.%d"
pythonlib = (template %
(sys.hexversion >> 24, (sys.hexversion >> 16)
& 0xff))
@@ -60,10 +22,10 @@ diff -up Python-2.7.3/Lib/distutils/command/build_ext.py.debug-build
Python-2.7.
return ext.libraries + [pythonlib]
else:
return ext.libraries
-diff -up Python-2.7.3/Lib/distutils/sysconfig.py.debug-build
Python-2.7.3/Lib/distutils/sysconfig.py
---- Python-2.7.3/Lib/distutils/sysconfig.py.debug-build 2012-04-18 19:46:21.988499499
-0400
-+++ Python-2.7.3/Lib/distutils/sysconfig.py 2012-04-18 19:46:22.080498348 -0400
-@@ -85,7 +85,8 @@ def get_python_inc(plat_specific=0, pref
+diff -up Python-2.7.6/Lib/distutils/sysconfig.py.debug-build
Python-2.7.6/Lib/distutils/sysconfig.py
+--- Python-2.7.6/Lib/distutils/sysconfig.py.debug-build 2014-01-29 14:13:08.770891379
+0100
++++ Python-2.7.6/Lib/distutils/sysconfig.py 2014-01-29 14:13:08.815888533 +0100
+@@ -90,7 +90,8 @@ def get_python_inc(plat_specific=0, pref
# Include is located in the srcdir
inc_dir = os.path.join(srcdir, "Include")
return inc_dir
@@ -73,7 +35,7 @@ diff -up Python-2.7.3/Lib/distutils/sysconfig.py.debug-build
Python-2.7.3/Lib/di
elif os.name == "nt":
return os.path.join(prefix, "include")
elif os.name == "os2":
-@@ -250,7 +251,7 @@ def get_makefile_filename():
+@@ -247,7 +248,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)
@@ -82,9 +44,9 @@ diff -up Python-2.7.3/Lib/distutils/sysconfig.py.debug-build
Python-2.7.3/Lib/di
def parse_config_h(fp, g=None):
-diff -up Python-2.7.3/Lib/distutils/tests/test_install.py.debug-build
Python-2.7.3/Lib/distutils/tests/test_install.py
---- Python-2.7.3/Lib/distutils/tests/test_install.py.debug-build 2012-04-18
19:46:21.997499385 -0400
-+++ Python-2.7.3/Lib/distutils/tests/test_install.py 2012-04-18 19:46:22.080498348 -0400
+diff -up Python-2.7.6/Lib/distutils/tests/test_install.py.debug-build
Python-2.7.6/Lib/distutils/tests/test_install.py
+--- Python-2.7.6/Lib/distutils/tests/test_install.py.debug-build 2014-01-29
14:13:08.779890810 +0100
++++ Python-2.7.6/Lib/distutils/tests/test_install.py 2014-01-29 14:13:08.815888533 +0100
@@ -20,8 +20,9 @@ from distutils.tests import support
@@ -96,10 +58,10 @@ diff -up Python-2.7.3/Lib/distutils/tests/test_install.py.debug-build
Python-2.7
return modname + sysconfig.get_config_var('SO')
-diff -up Python-2.7.3/Makefile.pre.in.debug-build Python-2.7.3/Makefile.pre.in
---- Python-2.7.3/Makefile.pre.in.debug-build 2012-04-18 19:46:22.073498437 -0400
-+++ Python-2.7.3/Makefile.pre.in 2012-04-18 19:48:46.336694896 -0400
-@@ -102,8 +102,8 @@ SCRIPTDIR= $(prefix)/lib64
+diff -up Python-2.7.6/Makefile.pre.in.debug-build Python-2.7.6/Makefile.pre.in
+--- Python-2.7.6/Makefile.pre.in.debug-build 2014-01-29 14:13:08.800889482 +0100
++++ Python-2.7.6/Makefile.pre.in 2014-01-29 14:17:30.929316462 +0100
+@@ -111,8 +111,8 @@ SCRIPTDIR= $(prefix)/lib64
# Detailed destination directories
BINLIBDEST= $(LIBDIR)/python$(VERSION)
LIBDEST= $(SCRIPTDIR)/python$(VERSION)
@@ -110,7 +72,7 @@ diff -up Python-2.7.3/Makefile.pre.in.debug-build
Python-2.7.3/Makefile.pre.in
LIBP= $(LIBDIR)/python$(VERSION)
# Symbols used for using shared libraries
-@@ -117,6 +117,12 @@ DESTSHARED= $(BINLIBDEST)/lib-dynload
+@@ -126,6 +126,12 @@ DESTSHARED= $(BINLIBDEST)/lib-dynload
EXE= @EXEEXT@
BUILDEXE= @BUILDEXEEXT@
@@ -123,7 +85,7 @@ diff -up Python-2.7.3/Makefile.pre.in.debug-build
Python-2.7.3/Makefile.pre.in
# Short name and location for Mac OS X Python framework
UNIVERSALSDK=@UNIVERSALSDK@
PYTHONFRAMEWORK= @PYTHONFRAMEWORK@
-@@ -180,8 +186,8 @@ LIBOBJDIR= Python/
+@@ -189,8 +195,8 @@ LIBOBJDIR= Python/
LIBOBJS= @LIBOBJS@
UNICODE_OBJS= @UNICODE_OBJS@
@@ -134,8 +96,8 @@ diff -up Python-2.7.3/Makefile.pre.in.debug-build
Python-2.7.3/Makefile.pre.in
PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@
_PYTHON_HOST_PLATFORM=@_PYTHON_HOST_PLATFORM@
-@@ -413,7 +419,7 @@ sharedmods: $(BUILDPYTHON)
- $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
+@@ -464,7 +470,7 @@ sharedmods: $(BUILDPYTHON) pybuilddir.tx
+ _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
-libpython$(VERSION).so: $(LIBRARY_OBJS)
@@ -143,7 +105,7 @@ diff -up Python-2.7.3/Makefile.pre.in.debug-build
Python-2.7.3/Makefile.pre.in
if test $(INSTSONAME) != $(LDLIBRARY); then \
$(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS)
$(LIBC) $(LIBM) $(LDLAST); \
$(LN) -f $(INSTSONAME) $@; \
-@@ -796,18 +802,18 @@ bininstall: altbininstall
+@@ -856,18 +862,18 @@ bininstall: altbininstall
then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON); \
else true; \
fi
@@ -173,7 +135,7 @@ diff -up Python-2.7.3/Makefile.pre.in.debug-build
Python-2.7.3/Makefile.pre.in
# Install the interpreter with $(VERSION) affixed
# This goes into $(exec_prefix)
-@@ -820,7 +826,7 @@ altbininstall: $(BUILDPYTHON)
+@@ -880,7 +886,7 @@ altbininstall: $(BUILDPYTHON)
else true; \
fi; \
done
@@ -182,7 +144,7 @@ diff -up Python-2.7.3/Makefile.pre.in.debug-build
Python-2.7.3/Makefile.pre.in
if test -f $(LDLIBRARY); then \
if test -n "$(DLLLIBRARY)" ; then \
$(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
-@@ -970,10 +976,11 @@ $(srcdir)/Lib/$(PLATDIR):
+@@ -1046,10 +1052,11 @@ $(srcdir)/Lib/$(PLATDIR):
fi; \
cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen
@@ -196,7 +158,7 @@ diff -up Python-2.7.3/Makefile.pre.in.debug-build
Python-2.7.3/Makefile.pre.in
# Install the include files
INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
-@@ -994,13 +1001,13 @@ inclinstall:
+@@ -1070,13 +1077,13 @@ inclinstall:
$(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
# Install the library and miscellaneous stuff needed for extending/embedding
@@ -213,7 +175,7 @@ diff -up Python-2.7.3/Makefile.pre.in.debug-build
Python-2.7.3/Makefile.pre.in
@for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \
do \
if test ! -d $(DESTDIR)$$i; then \
-@@ -1016,11 +1023,10 @@ libainstall: all python-config
+@@ -1092,11 +1099,10 @@ libainstall: all python-config
$(INSTALL_DATA) Modules/Setup $(DESTDIR)$(LIBPL)/Setup
$(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local
$(INSTALL_DATA) Modules/Setup.config $(DESTDIR)$(LIBPL)/Setup.config
@@ -227,9 +189,9 @@ diff -up Python-2.7.3/Makefile.pre.in.debug-build
Python-2.7.3/Makefile.pre.in
@if [ -s Modules/python.exp -a \
"`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ];
then \
echo; echo "Installing support files for building shared extension modules on
AIX:"; \
-diff -up Python-2.7.3/Misc/python-config.in.debug-build
Python-2.7.3/Misc/python-config.in
---- Python-2.7.3/Misc/python-config.in.debug-build 2012-04-09 19:07:33.000000000 -0400
-+++ Python-2.7.3/Misc/python-config.in 2012-04-18 19:46:22.082498324 -0400
+diff -up Python-2.7.6/Misc/python-config.in.debug-build
Python-2.7.6/Misc/python-config.in
+--- Python-2.7.6/Misc/python-config.in.debug-build 2013-11-10 08:36:41.000000000 +0100
++++ Python-2.7.6/Misc/python-config.in 2014-01-29 14:13:08.816888470 +0100
@@ -45,7 +45,7 @@ for opt in opt_flags:
elif opt in ('--libs', '--ldflags'):
@@ -239,9 +201,9 @@ diff -up Python-2.7.3/Misc/python-config.in.debug-build
Python-2.7.3/Misc/python
# add the prefix/lib/pythonX.Y/config dir, but only if there is no
# shared library in prefix/lib/.
if opt == '--ldflags':
-diff -up Python-2.7.3/Modules/makesetup.debug-build Python-2.7.3/Modules/makesetup
---- Python-2.7.3/Modules/makesetup.debug-build 2012-04-09 19:07:34.000000000 -0400
-+++ Python-2.7.3/Modules/makesetup 2012-04-18 19:46:22.083498312 -0400
+diff -up Python-2.7.6/Modules/makesetup.debug-build Python-2.7.6/Modules/makesetup
+--- Python-2.7.6/Modules/makesetup.debug-build 2013-11-10 08:36:41.000000000 +0100
++++ Python-2.7.6/Modules/makesetup 2014-01-29 14:13:08.817888407 +0100
@@ -233,7 +233,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
*$mod.o*) base=$mod;;
*) base=${mod}module;;
@@ -251,9 +213,9 @@ diff -up Python-2.7.3/Modules/makesetup.debug-build
Python-2.7.3/Modules/makeset
case $doconfig in
no) SHAREDMODS="$SHAREDMODS $file";;
esac
-diff -up Python-2.7.3/Python/dynload_shlib.c.debug-build
Python-2.7.3/Python/dynload_shlib.c
---- Python-2.7.3/Python/dynload_shlib.c.debug-build 2012-04-09 19:07:35.000000000 -0400
-+++ Python-2.7.3/Python/dynload_shlib.c 2012-04-18 19:46:22.083498312 -0400
+diff -up Python-2.7.6/Python/dynload_shlib.c.debug-build
Python-2.7.6/Python/dynload_shlib.c
+--- Python-2.7.6/Python/dynload_shlib.c.debug-build 2013-11-10 08:36:41.000000000 +0100
++++ Python-2.7.6/Python/dynload_shlib.c 2014-01-29 14:13:08.817888407 +0100
@@ -46,11 +46,16 @@ const struct filedescr _PyImport_DynLoad
{"module.exe", "rb", C_EXTENSION},
{"MODULE.EXE", "rb", C_EXTENSION},
@@ -274,9 +236,9 @@ diff -up Python-2.7.3/Python/dynload_shlib.c.debug-build
Python-2.7.3/Python/dyn
{0, 0}
};
-diff -up Python-2.7.3/Python/sysmodule.c.debug-build Python-2.7.3/Python/sysmodule.c
---- Python-2.7.3/Python/sysmodule.c.debug-build 2012-04-09 19:07:35.000000000 -0400
-+++ Python-2.7.3/Python/sysmodule.c 2012-04-18 19:46:22.083498312 -0400
+diff -up Python-2.7.6/Python/sysmodule.c.debug-build Python-2.7.6/Python/sysmodule.c
+--- Python-2.7.6/Python/sysmodule.c.debug-build 2013-11-10 08:36:41.000000000 +0100
++++ Python-2.7.6/Python/sysmodule.c 2014-01-29 14:13:08.817888407 +0100
@@ -1506,6 +1506,12 @@ _PySys_Init(void)
PyString_FromString("legacy"));
#endif
@@ -290,3 +252,41 @@ diff -up Python-2.7.3/Python/sysmodule.c.debug-build
Python-2.7.3/Python/sysmodu
#undef SET_SYS_FROM_STRING
if (PyErr_Occurred())
return NULL;
+diff -up Python-2.7.6/configure.ac.debug-build Python-2.7.6/configure.ac
+--- Python-2.7.6/configure.ac.debug-build 2014-01-29 14:13:08.796889735 +0100
++++ Python-2.7.6/configure.ac 2014-01-29 14:13:08.814888597 +0100
+@@ -738,7 +738,7 @@ AC_SUBST(LIBRARY)
+ AC_MSG_CHECKING(LIBRARY)
+ if test -z "$LIBRARY"
+ then
+- LIBRARY='libpython$(VERSION).a'
++ LIBRARY='libpython$(VERSION)$(DEBUG_EXT).a'
+ fi
+ AC_MSG_RESULT($LIBRARY)
+
+@@ -884,8 +884,8 @@ if test $enable_shared = "yes"; then
+ INSTSONAME="$LDLIBRARY".$SOVERSION
+ ;;
+ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*)
+- LDLIBRARY='libpython$(VERSION).so'
+- BLDLIBRARY='-L. -lpython$(VERSION)'
++ LDLIBRARY='libpython$(VERSION)$(DEBUG_EXT).so'
++ BLDLIBRARY='-L. -lpython$(VERSION)$(DEBUG_EXT)'
+ RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
+ case $ac_sys_system in
+ FreeBSD*)
+@@ -1028,6 +1028,14 @@ else AC_MSG_RESULT(no); Py_DEBUG='false'
+ fi],
+ [AC_MSG_RESULT(no)])
+
++if test "$Py_DEBUG" = 'true'
++then
++ DEBUG_EXT=_d
++ DEBUG_SUFFIX=-debug
++fi
++AC_SUBST(DEBUG_EXT)
++AC_SUBST(DEBUG_SUFFIX)
++
+ # XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
+ # merged with this chunk of code?
+
commit 8dfcdaa46dacf1a3ac719b9828b6901fa4f63053
Author: Tomas Radej <tradej(a)redhat.com>
Date: Wed Jan 29 14:13:02 2014 +0100
Fixed no-static-lib patch
diff --git a/00111-no-static-lib.patch b/00111-no-static-lib.patch
index 2f4fdd6..70dfb77 100644
--- a/00111-no-static-lib.patch
+++ b/00111-no-static-lib.patch
@@ -1,7 +1,7 @@
-diff -up Python-2.7.3/Makefile.pre.in.no-static-lib Python-2.7.3/Makefile.pre.in
---- Python-2.7.3/Makefile.pre.in.no-static-lib 2013-02-19 14:03:40.801993224 -0500
-+++ Python-2.7.3/Makefile.pre.in 2013-02-19 14:04:44.070988898 -0500
-@@ -397,7 +397,7 @@ coverage:
+diff -up Python-2.7.6/Makefile.pre.in.no-static-lib Python-2.7.6/Makefile.pre.in
+--- Python-2.7.6/Makefile.pre.in.no-static-lib 2014-01-29 13:58:32.933226720 +0100
++++ Python-2.7.6/Makefile.pre.in 2014-01-29 14:10:25.002247272 +0100
+@@ -437,7 +437,7 @@ coverage:
# Build the interpreter
@@ -10,8 +10,8 @@ diff -up Python-2.7.3/Makefile.pre.in.no-static-lib
Python-2.7.3/Makefile.pre.in
$(LINKCC) $(CFLAGS) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
Modules/python.o \
$(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
-@@ -413,18 +413,6 @@ sharedmods: $(BUILDPYTHON)
- $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
+@@ -464,18 +464,6 @@ sharedmods: $(BUILDPYTHON) pybuilddir.tx
+ _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
-# Build static library
@@ -29,7 +29,7 @@ diff -up Python-2.7.3/Makefile.pre.in.no-static-lib
Python-2.7.3/Makefile.pre.in
libpython$(VERSION).so: $(LIBRARY_OBJS)
if test $(INSTSONAME) != $(LDLIBRARY); then \
$(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS)
$(LIBC) $(LIBM) $(LDLAST); \
-@@ -1021,18 +1009,6 @@ libainstall: all python-config
+@@ -1097,18 +1085,6 @@ libainstall: all python-config
else true; \
fi; \
done
commit 7455bcf3aaa44c49c04a24f11b82c921e4fb1c56
Author: Tomas Radej <tradej(a)redhat.com>
Date: Wed Jan 29 13:58:24 2014 +0100
Fixed lib64 patch
diff --git a/python-2.7.3-lib64.patch b/python-2.7.3-lib64.patch
index 71f32c5..678d916 100644
--- a/python-2.7.3-lib64.patch
+++ b/python-2.7.3-lib64.patch
@@ -1,6 +1,6 @@
-diff -up Python-2.7.3/Lib/distutils/command/install.py.lib64
Python-2.7.3/Lib/distutils/command/install.py
---- Python-2.7.3/Lib/distutils/command/install.py.lib64 2012-04-09 19:07:29.000000000
-0400
-+++ Python-2.7.3/Lib/distutils/command/install.py 2013-02-19 13:58:20.446015129 -0500
+diff -up Python-2.7.6/Lib/distutils/command/install.py.lib64
Python-2.7.6/Lib/distutils/command/install.py
+--- Python-2.7.6/Lib/distutils/command/install.py.lib64 2013-11-10 08:36:40.000000000
+0100
++++ Python-2.7.6/Lib/distutils/command/install.py 2014-01-29 13:51:19.779590378 +0100
@@ -42,14 +42,14 @@ else:
INSTALL_SCHEMES = {
'unix_prefix': {
@@ -18,10 +18,10 @@ diff -up Python-2.7.3/Lib/distutils/command/install.py.lib64
Python-2.7.3/Lib/di
'headers': '$base/include/python/$dist_name',
'scripts': '$base/bin',
'data' : '$base',
-diff -up Python-2.7.3/Lib/distutils/sysconfig.py.lib64
Python-2.7.3/Lib/distutils/sysconfig.py
---- Python-2.7.3/Lib/distutils/sysconfig.py.lib64 2012-04-09 19:07:29.000000000 -0400
-+++ Python-2.7.3/Lib/distutils/sysconfig.py 2013-02-19 13:58:20.446015129 -0500
-@@ -114,8 +114,12 @@ def get_python_lib(plat_specific=0, stan
+diff -up Python-2.7.6/Lib/distutils/sysconfig.py.lib64
Python-2.7.6/Lib/distutils/sysconfig.py
+--- Python-2.7.6/Lib/distutils/sysconfig.py.lib64 2013-11-10 08:36:40.000000000 +0100
++++ Python-2.7.6/Lib/distutils/sysconfig.py 2014-01-29 13:51:19.779590378 +0100
+@@ -119,8 +119,12 @@ def get_python_lib(plat_specific=0, stan
prefix = plat_specific and EXEC_PREFIX or PREFIX
if os.name == "posix":
@@ -35,10 +35,10 @@ diff -up Python-2.7.3/Lib/distutils/sysconfig.py.lib64
Python-2.7.3/Lib/distutil
if standard_lib:
return libpython
else:
-diff -up Python-2.7.3/Lib/site.py.lib64 Python-2.7.3/Lib/site.py
---- Python-2.7.3/Lib/site.py.lib64 2012-04-09 19:07:31.000000000 -0400
-+++ Python-2.7.3/Lib/site.py 2013-02-19 13:58:20.447015128 -0500
-@@ -300,12 +300,16 @@ def getsitepackages():
+diff -up Python-2.7.6/Lib/site.py.lib64 Python-2.7.6/Lib/site.py
+--- Python-2.7.6/Lib/site.py.lib64 2013-11-10 08:36:40.000000000 +0100
++++ Python-2.7.6/Lib/site.py 2014-01-29 13:51:19.779590378 +0100
+@@ -288,12 +288,16 @@ def getsitepackages():
if sys.platform in ('os2emx', 'riscos'):
sitepackages.append(os.path.join(prefix, "Lib",
"site-packages"))
elif os.sep == '/':
@@ -55,9 +55,9 @@ diff -up Python-2.7.3/Lib/site.py.lib64 Python-2.7.3/Lib/site.py
sitepackages.append(os.path.join(prefix, "lib",
"site-packages"))
if sys.platform == "darwin":
# for framework builds *only* we add the standard Apple
-diff -up Python-2.7.3/Lib/test/test_site.py.lib64 Python-2.7.3/Lib/test/test_site.py
---- Python-2.7.3/Lib/test/test_site.py.lib64 2012-04-09 19:07:32.000000000 -0400
-+++ Python-2.7.3/Lib/test/test_site.py 2013-02-19 13:58:20.447015128 -0500
+diff -up Python-2.7.6/Lib/test/test_site.py.lib64 Python-2.7.6/Lib/test/test_site.py
+--- Python-2.7.6/Lib/test/test_site.py.lib64 2013-11-10 08:36:40.000000000 +0100
++++ Python-2.7.6/Lib/test/test_site.py 2014-01-29 13:51:19.780590315 +0100
@@ -241,17 +241,20 @@ class HelperFunctionsTests(unittest.Test
self.assertEqual(dirs[2], wanted)
elif os.sep == '/':
@@ -83,10 +83,10 @@ diff -up Python-2.7.3/Lib/test/test_site.py.lib64
Python-2.7.3/Lib/test/test_sit
self.assertEqual(dirs[1], wanted)
class PthFile(object):
-diff -up Python-2.7.3/Makefile.pre.in.lib64 Python-2.7.3/Makefile.pre.in
---- Python-2.7.3/Makefile.pre.in.lib64 2013-02-19 13:58:20.435015131 -0500
-+++ Python-2.7.3/Makefile.pre.in 2013-02-19 13:58:20.447015128 -0500
-@@ -97,7 +97,7 @@ LIBDIR= @libdir@
+diff -up Python-2.7.6/Makefile.pre.in.lib64 Python-2.7.6/Makefile.pre.in
+--- Python-2.7.6/Makefile.pre.in.lib64 2014-01-29 13:51:19.773590757 +0100
++++ Python-2.7.6/Makefile.pre.in 2014-01-29 13:51:19.780590315 +0100
+@@ -106,7 +106,7 @@ LIBDIR= @libdir@
MANDIR= @mandir@
INCLUDEDIR= @includedir@
CONFINCLUDEDIR= $(exec_prefix)/include
@@ -95,9 +95,30 @@ diff -up Python-2.7.3/Makefile.pre.in.lib64
Python-2.7.3/Makefile.pre.in
# Detailed destination directories
BINLIBDEST= $(LIBDIR)/python$(VERSION)
-diff -up Python-2.7.3/Modules/getpath.c.lib64 Python-2.7.3/Modules/getpath.c
---- Python-2.7.3/Modules/getpath.c.lib64 2012-04-09 19:07:34.000000000 -0400
-+++ Python-2.7.3/Modules/getpath.c 2013-02-19 13:58:20.448015128 -0500
+diff -up Python-2.7.6/Modules/Setup.dist.lib64 Python-2.7.6/Modules/Setup.dist
+--- Python-2.7.6/Modules/Setup.dist.lib64 2014-01-29 13:51:19.768591073 +0100
++++ Python-2.7.6/Modules/Setup.dist 2014-01-29 13:51:19.781590252 +0100
+@@ -416,7 +416,7 @@ gdbm gdbmmodule.c -lgdbm
+ # Edit the variables DB and DBLIBVERto point to the db top directory
+ # and the subdirectory of PORT where you built it.
+ DBINC=/usr/include/libdb
+-DBLIB=/usr/lib
++DBLIB=/usr/lib64
+ _bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb
+
+ # Historical Berkeley DB 1.85
+@@ -462,7 +462,7 @@ cPickle cPickle.c
+ # Andrew Kuchling's zlib module.
+ # This require zlib 1.1.3 (or later).
+ # See
http://www.gzip.org/zlib/
+-zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
++zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib64 -lz
+
+ # Interface to the Expat XML parser
+ #
+diff -up Python-2.7.6/Modules/getpath.c.lib64 Python-2.7.6/Modules/getpath.c
+--- Python-2.7.6/Modules/getpath.c.lib64 2013-11-10 08:36:41.000000000 +0100
++++ Python-2.7.6/Modules/getpath.c 2014-01-29 13:51:19.781590252 +0100
@@ -117,8 +117,8 @@
#endif
@@ -118,7 +139,7 @@ diff -up Python-2.7.3/Modules/getpath.c.lib64
Python-2.7.3/Modules/getpath.c
static void
reduce(char *dir)
-@@ -528,7 +528,7 @@ calculate_path(void)
+@@ -543,7 +543,7 @@ calculate_path(void)
}
else
strncpy(zip_path, PREFIX, MAXPATHLEN);
@@ -127,7 +148,7 @@ diff -up Python-2.7.3/Modules/getpath.c.lib64
Python-2.7.3/Modules/getpath.c
bufsz = strlen(zip_path); /* Replace "00" with version */
zip_path[bufsz - 6] = VERSION[0];
zip_path[bufsz - 5] = VERSION[2];
-@@ -538,7 +538,7 @@ calculate_path(void)
+@@ -553,7 +553,7 @@ calculate_path(void)
fprintf(stderr,
"Could not find platform dependent libraries
<exec_prefix>\n");
strncpy(exec_prefix, EXEC_PREFIX, MAXPATHLEN);
@@ -136,40 +157,19 @@ diff -up Python-2.7.3/Modules/getpath.c.lib64
Python-2.7.3/Modules/getpath.c
}
/* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */
-diff -up Python-2.7.3/Modules/Setup.dist.lib64 Python-2.7.3/Modules/Setup.dist
---- Python-2.7.3/Modules/Setup.dist.lib64 2013-02-19 13:58:20.442015131 -0500
-+++ Python-2.7.3/Modules/Setup.dist 2013-02-19 14:02:25.255998391 -0500
-@@ -413,7 +413,7 @@ gdbm gdbmmodule.c -lgdbm
- # Edit the variables DB and DBLIBVERto point to the db top directory
- # and the subdirectory of PORT where you built it.
- DBINC=/usr/include/libdb
--DBLIB=/usr/lib
-+DBLIB=/usr/lib64
- _bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb
-
- # Historical Berkeley DB 1.85
-@@ -459,7 +459,7 @@ cPickle cPickle.c
- # Andrew Kuchling's zlib module.
- # This require zlib 1.1.3 (or later).
- # See
http://www.gzip.org/zlib/
--zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
-+zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib64 -lz
-
- # Interface to the Expat XML parser
- #
-diff -up Python-2.7.3/setup.py.lib64 Python-2.7.3/setup.py
---- Python-2.7.3/setup.py.lib64 2012-04-09 19:07:36.000000000 -0400
-+++ Python-2.7.3/setup.py 2013-02-19 13:58:20.449015129 -0500
-@@ -369,7 +369,7 @@ class PyBuildExt(build_ext):
-
+diff -up Python-2.7.6/setup.py.lib64 Python-2.7.6/setup.py
+--- Python-2.7.6/setup.py.lib64 2013-11-10 08:36:41.000000000 +0100
++++ Python-2.7.6/setup.py 2014-01-29 13:56:02.713716528 +0100
+@@ -438,7 +438,7 @@ class PyBuildExt(build_ext):
def detect_modules(self):
# Ensure that /usr/local is always used
-- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
-+ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib64')
- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
- self.add_gcc_paths()
- self.add_multiarch_paths()
-@@ -677,11 +677,11 @@ class PyBuildExt(build_ext):
+ if not cross_compiling:
+- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
++ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib64')
+ add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+ if cross_compiling:
+ self.add_gcc_paths()
+@@ -758,11 +758,11 @@ class PyBuildExt(build_ext):
elif curses_library:
readline_libs.append(curses_library)
elif self.compiler.find_library_file(lib_dirs +
@@ -183,7 +183,7 @@ diff -up Python-2.7.3/setup.py.lib64 Python-2.7.3/setup.py
extra_link_args=readline_extra_link_args,
libraries=readline_libs) )
else:
-@@ -715,8 +715,8 @@ class PyBuildExt(build_ext):
+@@ -797,8 +797,8 @@ class PyBuildExt(build_ext):
if krb5_h:
ssl_incs += krb5_h
ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
commit 485c86512c22d8b34c59584eb20a8bc6334df9eb
Author: Tomas Radej <tradej(a)redhat.com>
Date: Wed Jan 29 11:16:53 2014 +0100
Updated to v2.7.6
diff --git a/python.spec b/python.spec
index ef51166..83920a7 100644
--- a/python.spec
+++ b/python.spec
@@ -105,8 +105,8 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
# Remember to also rebase python-docs when changing this:
-Version: 2.7.5
-Release: 11%{?dist}
+Version: 2.7.6
+Release: 1%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -2044,6 +2044,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Wed Jan 29 2014 Tomas Radej <tradej(a)redhat.com> - 2.7.6-1
+- Updated to v2.7.6
+
* Wed Jan 15 2014 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.5-11
- Make library-files user writable to get rid of
Permission Denied in buildlog from debuginfo-packaging
diff --git a/sources b/sources
index ac5febc..04234bd 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-5eea8462f69ab1369d32f9c4cd6272ab Python-2.7.5.tar.xz
+bcf93efa8eaf383c98ed3ce40b763497 Python-2.7.6.tar.xz
commit 19530b3653abb3c3991f90473b11b75beeea981b
Author: Matej Stuchlik <mstuchli(a)redhat.com>
Date: Wed Jan 15 13:27:43 2014 +0100
Make library-files user writable
diff --git a/python.spec b/python.spec
index 5f3ad9a..ef51166 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.5
-Release: 10%{?dist}
+Release: 11%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1622,6 +1622,11 @@ sed \
%endif # with_debug_build
%endif # with_systemtap
+# Make library-files user writable
+/usr/bin/chmod 755 %{buildroot}%{dynload_dir}/*.so
+/usr/bin/chmod 755 %{buildroot}%{_libdir}/libpython%{pybasever}.so.1.0
+/usr/bin/chmod 755 %{buildroot}%{_libdir}/libpython%{pybasever}_d.so.1.0
+
# ======================================================
# Running the upstream test suite
@@ -2039,6 +2044,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Wed Jan 15 2014 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.5-11
+- Make library-files user writable to get rid of
+ Permission Denied in buildlog from debuginfo-packaging
+
* Tue Jan 14 2014 Dennis Gilmore <dennis(a)ausil.us> - 2.7.5-10
- enable valgrind support on 32 bit arm
commit d86077a9e2640f1c5f460365764f6226e2478a39
Author: Dennis Gilmore <dennis(a)ausil.us>
Date: Tue Jan 14 09:31:55 2014 -0600
enable valgrind support on 32 bit arm
diff --git a/python.spec b/python.spec
index 41bb29d..5f3ad9a 100644
--- a/python.spec
+++ b/python.spec
@@ -45,7 +45,7 @@
%global with_systemtap 1
# some arches don't have valgrind so we need to disable its support on them
-%ifarch %{ix86} x86_64 ppc %{power64} s390x
+%ifarch %{arm} %{ix86} x86_64 ppc %{power64} s390x
%global with_valgrind 1
%else
%global with_valgrind 0
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.5
-Release: 9%{?dist}
+Release: 10%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -2039,6 +2039,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Tue Jan 14 2014 Dennis Gilmore <dennis(a)ausil.us> - 2.7.5-10
+- enable valgrind support on 32 bit arm
+
* Tue Nov 12 2013 Tomas Radej <tradej(a)redhat.com> - 2.7.5-9
- Import get_python_version in bdist_rpm
Resolves: rhbz#1029082
commit c8f7a0a385504fc6d3d614c39d5dd7a2331a3219
Author: Tomas Radej <tradej(a)redhat.com>
Date: Tue Nov 12 14:17:30 2013 +0100
Import get_python_version in bdist_rpm
Resolves: rhbz#1029082
diff --git a/00190-get_python_version.patch b/00190-get_python_version.patch
new file mode 100644
index 0000000..822cd96
--- /dev/null
+++ b/00190-get_python_version.patch
@@ -0,0 +1,11 @@
+diff -r 2a38df26e009 Lib/distutils/command/bdist_rpm.py
+--- a/Lib/distutils/command/bdist_rpm.py Tue Sep 03 11:39:06 2013 -0500
++++ b/Lib/distutils/command/bdist_rpm.py Wed Sep 04 19:49:37 2013 +0200
+@@ -14,6 +14,7 @@
+ from distutils.file_util import write_file
+ from distutils.errors import (DistutilsOptionError, DistutilsPlatformError,
+ DistutilsFileError, DistutilsExecError)
++from distutils.sysconfig import get_python_version
+ from distutils import log
+
+ class bdist_rpm (Command):
diff --git a/python.spec b/python.spec
index c5efbad..41bb29d 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.5
-Release: 8%{?dist}
+Release: 9%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -852,6 +852,12 @@ Patch188:
00188-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch
# rhbz#1008154 (patch by Attila Fazekas)
Patch189: 00189-gdb-py-bt-dont-raise-exception-from-eval.patch
+# 00190 #
+#
+# Importing get_python_version in bdist_rpm
+#
http://bugs.python.org/issue18045
+# rhbz#1029082
+Patch190: 00190-get_python_version.patch
# (New patches go here ^^^)
#
@@ -1203,6 +1209,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch187 -p1
%patch188 -p1
%patch189 -p1
+%patch190 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -2032,6 +2039,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Tue Nov 12 2013 Tomas Radej <tradej(a)redhat.com> - 2.7.5-9
+- Import get_python_version in bdist_rpm
+Resolves: rhbz#1029082
+
* Tue Oct 08 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-8
- Fix processing gdb py-bt command in eval calls.
Resolves: rhbz#1008154
commit 8adf4f656cba1160528f7f0ea71088e466ae51dd
Author: Tomas Radej <tradej(a)redhat.com>
Date: Tue Nov 12 13:53:47 2013 +0100
Removed trailing whitespace in spec
diff --git a/python.spec b/python.spec
index 7b602ff..c5efbad 100644
--- a/python.spec
+++ b/python.spec
@@ -62,7 +62,7 @@
#
# These errors are ignored by the normal python build, and aren't normally a
# problem in the buildroots since /usr/bin/python isn't present.
-#
+#
# However, for the case where we're rebuilding the python srpm on a machine
# that does have python installed we need to set this to avoid
# brp-python-bytecompile treating these as fatal errors:
@@ -75,7 +75,7 @@
# patch 52 (valgrind)
# patch 55 (systemtap)
# patch 145 (linux2)
-#
+#
# For patch 55 (systemtap), we need to get a new header for configure to use
#
# configure.in requires autoconf-2.65, but the version in Fedora is currently
@@ -228,7 +228,7 @@ Source7: pynche
# - unicodedata unicodedata.c # static Unicode character database
# - _locale _localemodule.c
# - fcntl fcntlmodule.c # fcntl(2) and ioctl(2)
-# - spwd spwdmodule.c # spwd(3)
+# - spwd spwdmodule.c # spwd(3)
# - grp grpmodule.c # grp(3)
# - select selectmodule.c # select(2); not on ancient System V
# - mmap mmapmodule.c # Memory-mapped files
@@ -285,22 +285,22 @@ Patch4: python-2.5-cflags.patch
# though the proposed upstream patches are, alas, different
Patch6: python-2.5.1-plural-fix.patch
-# This patch was listed in the changelog as:
+# This patch was listed in the changelog as:
# * Fri Sep 14 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-11
-# - fix encoding of sqlite .py files to work around weird encoding problem
+# - fix encoding of sqlite .py files to work around weird encoding problem
# in Turkish (#283331)
# A traceback attached to rhbz 244016 shows the problem most clearly: a
# traceback on attempting to import the sqlite module, with:
# "SyntaxError: encoding problem: with BOM (__init__.py, line 1)"
# This seems to come from Parser/tokenizer.c:check_coding_spec
# Our patch changes two source files within sqlite3, removing the
-# "coding: ISO-8859-1" specs and character E4 = U+00E4 =
-# LATIN SMALL LETTER A WITH DIAERESIS from in ghaering's surname.
+# "coding: ISO-8859-1" specs and character E4 = U+00E4 =
+# LATIN SMALL LETTER A WITH DIAERESIS from in ghaering's surname.
#
# It may be that the conversion of "ISO-8859-1" to "iso-8859-1" is
thwarted
# by the implementation of "tolower" in the Turkish locale; see:
#
https://bugzilla.redhat.com/show_bug.cgi?id=191096#c9
-#
+#
# TODO: Not yet sent upstream, and appears to me (dmalcolm 2010-01-29) that
# it may be papering over a symptom
Patch7: python-2.5.1-sqlite-encoding.patch
@@ -370,9 +370,9 @@ Patch111: 00111-no-static-lib.patch
# the same .py and .pyc files, using "_d.so" to signify a debug build of an
# extension module.
#
-# Based on Debian's patch for the same,
+# Based on Debian's patch for the same,
#
http://patch-tracker.debian.org/patch/series/view/python2.6/2.6.5-2/debug...
-#
+#
# (which was itself based on the upstream Windows build), but with some
# changes:
#
@@ -391,7 +391,7 @@ Patch111: 00111-no-static-lib.patch
# to add the _d there, when building an extension. This way, "make
sharedlibs"
# can build ctypes, by finding the sysmtem libffi.so (rather than failing to
# find "libffi_d.so"), and builds the module as _ctypes_d.so
-#
+#
# * Similarly, update build_ext:get_libraries handling of Py_ENABLE_SHARED by
# appending "_d" to the python library's name for the debug configuration
#
@@ -885,7 +885,7 @@ Patch5000: 05000-autotool-intermediates.patch
%if %{main_python}
Obsoletes: Distutils
Provides: Distutils
-Obsoletes: python2
+Obsoletes: python2
Provides: python2 = %{version}
Obsoletes: python-elementtree <= 1.2.6
Obsoletes: python-sqlite < 2.3.2
@@ -982,9 +982,9 @@ Provides: python2-tools = %{version}
%endif
%description tools
-This package includes several tools to help with the development of Python
-programs, including IDLE (an IDE with editing and debugging facilities), a
-color editor (pynche), and a python gettext program (pygettext.py).
+This package includes several tools to help with the development of Python
+programs, including IDLE (an IDE with editing and debugging facilities), a
+color editor (pynche), and a python gettext program (pygettext.py).
%package -n %{tkinter}
Summary: A graphical user interface for the Python scripting language
@@ -1261,7 +1261,7 @@ exit 1
# Define a function, for how to perform a "build" of python for a given
# configuration:
BuildPython() {
- ConfName=$1
+ ConfName=$1
BinaryName=$2
SymlinkName=$3
ExtraConfigArgs=$4
@@ -1357,7 +1357,7 @@ done
InstallPython() {
- ConfName=$1
+ ConfName=$1
BinaryName=$2
PyInstSoName=$3
@@ -1382,7 +1382,7 @@ make install DESTDIR=%{buildroot}
#
# See
https://fedoraproject.org/wiki/Features/EasierPythonDebugging for more
# information
-#
+#
# Initially I tried:
# /usr/lib/libpython2.6.so.1.0-gdb.py
# but doing so generated noise when ldconfig was rerun (rhbz:562980)
@@ -1424,7 +1424,7 @@ InstallPython optimized \
%{py_INSTSONAME_optimized}
-# Fix the interpreter path in binaries installed by distutils
+# Fix the interpreter path in binaries installed by distutils
# (which changes them by itself)
# Make sure we preserve the file permissions
for fixed in %{buildroot}%{_bindir}/pydoc; do
@@ -1578,7 +1578,7 @@ for Module in %{buildroot}/%{dynload_dir}/*.so ; do
*_d.so)
ldd $Module | grep %{py_INSTSONAME_optimized} &&
(echo Debug module $Module linked against optimized
%{py_INSTSONAME_optimized} ; exit 1)
-
+
;;
*)
ldd $Module | grep %{py_INSTSONAME_debug} &&
@@ -2015,15 +2015,15 @@ rm -fr %{buildroot}
# We put the debug-gdb.py file inside /usr/lib/debug to avoid noise from
# ldconfig (rhbz:562980).
-#
+#
# The /usr/lib/rpm/redhat/macros defines the __debug_package macro to use
# debugfiles.list, and it appears that everything below /usr/lib/debug and
# (/usr/src/debug) gets added to this file (via LISTFILES) in
# /usr/lib/rpm/find-debuginfo.sh
-#
+#
# Hence by installing it below /usr/lib/debug we ensure it is added to the
# -debuginfo subpackage
-# (if it doesn't, then the rpmbuild ought to fail since the debug-gdb.py
+# (if it doesn't, then the rpmbuild ought to fail since the debug-gdb.py
# payload file would be unpackaged)
@@ -2728,7 +2728,7 @@ directories (bug 531901)
- fix marshalling of objects in xmlrpclib (python bug #1739842)
* Fri Sep 14 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-11
-- fix encoding of sqlite .py files to work around weird encoding problem
+- fix encoding of sqlite .py files to work around weird encoding problem
in Turkish (#283331)
* Mon Sep 10 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-10
@@ -2751,7 +2751,7 @@ directories (bug 531901)
* Wed Jun 27 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-4
- fix _elementtree.so build (#245703)
-- ensure that extension modules we expect are actually built rather than
+- ensure that extension modules we expect are actually built rather than
having them silently fall out of the package
* Tue Jun 26 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-3
@@ -2793,7 +2793,7 @@ directories (bug 531901)
* Mon Dec 11 2006 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-3
- fix atexit traceback with failed syslog logger (#218214)
-- split libpython into python-libs subpackage for multilib apps
+- split libpython into python-libs subpackage for multilib apps
embedding python interpreters
* Wed Dec 6 2006 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-2
@@ -2801,14 +2801,14 @@ directories (bug 531901)
* Tue Dec 5 2006 Jeremy Katz <katzj(a)redhat.com>
- support db 4.5
-- obsolete python-elementtree; since it requires some code tweaks, don't
+- obsolete python-elementtree; since it requires some code tweaks, don't
provide it
- obsolete old python-sqlite; provide the version that's actually included
* Mon Oct 30 2006 Jeremy Katz <katzj(a)redhat.com>
- fix _md5 and _sha modules (Robert Sheck)
- no longer provide optik compat; it's been a couple of years now
-- no longer provide the old shm module; if this is still needed, let's
+- no longer provide the old shm module; if this is still needed, let's
build it separately
- no longer provide japanese codecs; should be a separate package
@@ -2909,7 +2909,7 @@ directories (bug 531901)
- Fix bug #169046 more correctly.
* Thu Sep 22 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-7
-- Fixed bug #169046 (realpath is unsafe); thanks to
+- Fixed bug #169046 (realpath is unsafe); thanks to
Peter Jones <pjones(a)redhat.com> and Arjan van de Ven <arjanv(a)redhat.com>
for
diagnosing and the patch.
@@ -3098,11 +3098,11 @@ directories (bug 531901)
- Fixed bug #84966: path in byte-compiled code still wrong
* Thu Feb 20 2003 Jeremy Katz <katzj(a)redhat.com> 2.2.2-23
-- ftp uri's should be able to specify being rooted at the root instead of
+- ftp uri's should be able to specify being rooted at the root instead of
where you login via ftp (#84692)
* Mon Feb 10 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-22
-- Using newer Japanese codecs (1.4.9). Thanks to
+- Using newer Japanese codecs (1.4.9). Thanks to
Peter Bowen <pzb(a)datastacks.com> for pointing this out.
* Thu Feb 6 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-21
@@ -3139,7 +3139,7 @@ directories (bug 531901)
- pick up OpenSSL cflags and ldflags from pkgconfig if available
* Thu Jan 2 2003 Jeremy Katz <katzj(a)redhat.com> 2.2.2-8
-- urllib2 didn't support non-anonymous ftp. add support based on how
+- urllib2 didn't support non-anonymous ftp. add support based on how
urllib did it (#80676, #78168)
* Mon Dec 16 2002 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-7
@@ -3162,7 +3162,7 @@ directories (bug 531901)
- Fixed configuration patch to add -lcrypt when compiling cryptmodule.c
2.2.2-4
-- Spec file change from Matt Wilson <msw(a)redhat.com> to disable linking
+- Spec file change from Matt Wilson <msw(a)redhat.com> to disable linking
with the C++ compiler.
* Mon Nov 11 2002 Mihai Ibanescu <misa(a)redhat.com>
@@ -3246,11 +3246,11 @@ directories (bug 531901)
- 2.2.1 - a bugfix-only release
* Fri Apr 12 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-16
-- the same, but in builddirs - this will remove them from the
+- the same, but in builddirs - this will remove them from the
docs package, which doesn't look in the buildroot for files.
* Fri Apr 12 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-15
-- Get rid of temporary files and .cvsignores included
+- Get rid of temporary files and .cvsignores included
in the tarball and make install
* Fri Apr 5 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-14
@@ -3288,7 +3288,7 @@ directories (bug 531901)
can happen when you mix db2 and db4 in a single application)
* Thu Jan 24 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-4
-- Obsolete subpackages if necesarry
+- Obsolete subpackages if necesarry
- provide versioned python2
- build with db4
@@ -3301,7 +3301,7 @@ directories (bug 531901)
* Fri Dec 14 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.11c1
- 2.2 RC 1
-- Don't include the _tkinter module in the main package - it's
+- Don't include the _tkinter module in the main package - it's
already in the tkiter packace
- Turn off the mpzmodule, something broke in the buildroot
commit c86b2c6e570b509a2763391457ddba46b1e0018c
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Tue Oct 8 14:04:54 2013 +0200
Fix processing gdb py-bt command in eval calls.
Resolves: rhbz#1008154
diff --git a/00189-gdb-py-bt-dont-raise-exception-from-eval.patch
b/00189-gdb-py-bt-dont-raise-exception-from-eval.patch
new file mode 100644
index 0000000..4e82859
--- /dev/null
+++ b/00189-gdb-py-bt-dont-raise-exception-from-eval.patch
@@ -0,0 +1,11 @@
+--- Python-2.7.5-orig/Tools/gdb/libpython.py 2013-05-12 03:32:54.000000000 +0000
++++ Python-2.7.5-orig/Tools/gdb/libpython.py 2013-09-15 09:56:25.494000000 +0000
+@@ -887,6 +887,8 @@
+ newline character'''
+ if self.is_optimized_out():
+ return '(frame information optimized out)'
++ if self.filename() == '<string>':
++ return '(in an eval block)'
+ with open(self.filename(), 'r') as f:
+ all_lines = f.readlines()
+ # Convert from 1-based current_line_num to 0-based list offset:
diff --git a/python.spec b/python.spec
index 7a66e3b..7b602ff 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.5
-Release: 7%{?dist}
+Release: 8%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -846,6 +846,13 @@ Patch187: 00187-add-RPATH-to-pyexpat.patch
# rhbz#998430
Patch188: 00188-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch
+# 00189 #
+# Fixes gdb py-bt command not to raise exception while processing
+# statements from eval
+# rhbz#1008154 (patch by Attila Fazekas)
+Patch189: 00189-gdb-py-bt-dont-raise-exception-from-eval.patch
+
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -1195,6 +1202,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch186 -p1
%patch187 -p1
%patch188 -p1
+%patch189 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -2024,6 +2032,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Tue Oct 08 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-8
+- Fix processing gdb py-bt command in eval calls.
+Resolves: rhbz#1008154
+
* Tue Sep 03 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-7
- Removed ancient Obsolete: python-sqlite2.
commit 3df1286ee41d425c08f4de7654da38bf448a6fcb
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Tue Sep 3 10:45:32 2013 +0200
Removed ancient Obsolete: python-sqlite2.
diff --git a/python.spec b/python.spec
index b803c62..7a66e3b 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.5
-Release: 6%{?dist}
+Release: 7%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -893,12 +893,6 @@ Provides: python-uuid = 1.31
#
https://fedoraproject.org/wiki/Features/RemovePyXML#How_To_Test
Obsoletes: PyXML <= 0.8.4-29
-# python-sqlite2-2.3.5-5.fc18 was retired. Obsolete the old package here
-# so it gets uninstalled on updates
-%if 0%{?fedora} >= 17
-Obsoletes: python-sqlite2 <= 2.3.5-6
-%endif
-
# python-argparse is part of python as of version 2.7
# drop this Provides in F17
# (having Obsoletes here caused problems with multilib; see rhbz#667984)
@@ -2030,6 +2024,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Tue Sep 03 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-7
+- Removed ancient Obsolete: python-sqlite2.
+
* Mon Aug 26 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-6
- Sync back/renumber patches to stay consistent with rhel.
commit 609f532ac260fa450470113eda84af049675d4b8
Merge: 159ddfd 4e26fc2
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Mon Aug 26 09:44:01 2013 +0200
Merge branch 'f20'
Conflicts:
python.spec
commit 4e26fc2842862776c2bd6309619dce1233037bb9
Merge: 6f65730 a9f6e89
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Mon Aug 26 09:39:29 2013 +0200
Merge branch 'f19' into f20
Conflicts:
python.spec
diff --cc python.spec
index 3953bcf,75d4b9a..b803c62
--- a/python.spec
+++ b/python.spec
@@@ -106,7 -106,7 +106,7 @@@ Summary: An interpreted, interactive, o
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.5
--Release: 5%{?dist}
++Release: 6%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@@ -2010,12 -2030,12 +2030,15 @@@ rm -fr %{buildroot
# ======================================================
%changelog
-* Mon Aug 26 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-5
++* Mon Aug 26 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-6
+ - Sync back/renumber patches to stay consistent with rhel.
+
-* Mon Aug 19 2013 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.5-4
+* Mon Aug 19 2013 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.5-5
- Added fix for CVE-2013-4238 (rhbz#998430)
+* Sun Aug 04 2013 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.7.5-4
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
+
* Mon Jul 08 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-3
- Fix build with libffi containing multilib wrapper for ffi.h (rhbz#979696).
commit a9f6e899c8c1de12872cc226d440ffaaf5eb6f1d
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Mon Aug 26 09:37:19 2013 +0200
Sync back/renumber patches to stay consistent with rhel.
diff --git a/00185-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch
b/00185-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch
deleted file mode 100644
index e215589..0000000
--- a/00185-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch
+++ /dev/null
@@ -1,247 +0,0 @@
-diff -r 9ddc63c039ba Lib/test/nullbytecert.pem
---- /dev/null Thu Jan 01 00:00:00 1970 +0000
-+++ b/Lib/test/nullbytecert.pem Sun Aug 11 18:13:17 2013 +0200
-@@ -0,0 +1,90 @@
-+Certificate:
-+ Data:
-+ Version: 3 (0x2)
-+ Serial Number: 0 (0x0)
-+ Signature Algorithm: sha1WithRSAEncryption
-+ Issuer: C=US, ST=Oregon, L=Beaverton, O=Python Software Foundation, OU=Python
Core Development,
CN=null.python.org\x00example.org/emailAddress=python-dev@python.org
-+ Validity
-+ Not Before: Aug 7 13:11:52 2013 GMT
-+ Not After : Aug 7 13:12:52 2013 GMT
-+ Subject: C=US, ST=Oregon, L=Beaverton, O=Python Software Foundation, OU=Python
Core Development,
CN=null.python.org\x00example.org/emailAddress=python-dev@python.org
-+ Subject Public Key Info:
-+ Public Key Algorithm: rsaEncryption
-+ Public-Key: (2048 bit)
-+ Modulus:
-+ 00:b5:ea:ed:c9:fb:46:7d:6f:3b:76:80:dd:3a:f3:
-+ 03:94:0b:a7:a6:db:ec:1d:df:ff:23:74:08:9d:97:
-+ 16:3f:a3:a4:7b:3e:1b:0e:96:59:25:03:a7:26:e2:
-+ 88:a9:cf:79:cd:f7:04:56:b0:ab:79:32:6e:59:c1:
-+ 32:30:54:eb:58:a8:cb:91:f0:42:a5:64:27:cb:d4:
-+ 56:31:88:52:ad:cf:bd:7f:f0:06:64:1f:cc:27:b8:
-+ a3:8b:8c:f3:d8:29:1f:25:0b:f5:46:06:1b:ca:02:
-+ 45:ad:7b:76:0a:9c:bf:bb:b9:ae:0d:16:ab:60:75:
-+ ae:06:3e:9c:7c:31:dc:92:2f:29:1a:e0:4b:0c:91:
-+ 90:6c:e9:37:c5:90:d7:2a:d7:97:15:a3:80:8f:5d:
-+ 7b:49:8f:54:30:d4:97:2c:1c:5b:37:b5:ab:69:30:
-+ 68:43:d3:33:78:4b:02:60:f5:3c:44:80:a1:8f:e7:
-+ f0:0f:d1:5e:87:9e:46:cf:62:fc:f9:bf:0c:65:12:
-+ f1:93:c8:35:79:3f:c8:ec:ec:47:f5:ef:be:44:d5:
-+ ae:82:1e:2d:9a:9f:98:5a:67:65:e1:74:70:7c:cb:
-+ d3:c2:ce:0e:45:49:27:dc:e3:2d:d4:fb:48:0e:2f:
-+ 9e:77:b8:14:46:c0:c4:36:ca:02:ae:6a:91:8c:da:
-+ 2f:85
-+ Exponent: 65537 (0x10001)
-+ X509v3 extensions:
-+ X509v3 Basic Constraints: critical
-+ CA:FALSE
-+ X509v3 Subject Key Identifier:
-+ 88:5A:55:C0:52:FF:61:CD:52:A3:35:0F:EA:5A:9C:24:38:22:F7:5C
-+ X509v3 Key Usage:
-+ Digital Signature, Non Repudiation, Key Encipherment
-+ X509v3 Subject Alternative Name:
-+ *************************************************************
-+ WARNING: The values for DNS, email and URI are WRONG. OpenSSL
-+ doesn't print the text after a NULL byte.
-+ *************************************************************
-+
DNS:altnull.python.org, email:null@python.org,
URI:http://null.python.org, IP Address:192.0.2.1, IP Address:2001:DB8:0:0:0:0:0:1
-+ Signature Algorithm: sha1WithRSAEncryption
-+ ac:4f:45:ef:7d:49:a8:21:70:8e:88:59:3e:d4:36:42:70:f5:
-+ a3:bd:8b:d7:a8:d0:58:f6:31:4a:b1:a4:a6:dd:6f:d9:e8:44:
-+ 3c:b6:0a:71:d6:7f:b1:08:61:9d:60:ce:75:cf:77:0c:d2:37:
-+ 86:02:8d:5e:5d:f9:0f:71:b4:16:a8:c1:3d:23:1c:f1:11:b3:
-+ 56:6e:ca:d0:8d:34:94:e6:87:2a:99:f2:ae:ae:cc:c2:e8:86:
-+ de:08:a8:7f:c5:05:fa:6f:81:a7:82:e6:d0:53:9d:34:f4:ac:
-+ 3e:40:fe:89:57:7a:29:a4:91:7e:0b:c6:51:31:e5:10:2f:a4:
-+ 60:76:cd:95:51:1a:be:8b:a1:b0:fd:ad:52:bd:d7:1b:87:60:
-+ d2:31:c7:17:c4:18:4f:2d:08:25:a3:a7:4f:b7:92:ca:e2:f5:
-+ 25:f1:54:75:81:9d:b3:3d:61:a2:f7:da:ed:e1:c6:6f:2c:60:
-+ 1f:d8:6f:c5:92:05:ab:c9:09:62:49:a9:14:ad:55:11:cc:d6:
-+ 4a:19:94:99:97:37:1d:81:5f:8b:cf:a3:a8:96:44:51:08:3d:
-+ 0b:05:65:12:eb:b6:70:80:88:48:72:4f:c6:c2:da:cf:cd:8e:
-+ 5b:ba:97:2f:60:b4:96:56:49:5e:3a:43:76:63:04:be:2a:f6:
-+ c1:ca:a9:94
-+-----BEGIN CERTIFICATE-----
-+MIIE2DCCA8CgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBxTELMAkGA1UEBhMCVVMx
-+DzANBgNVBAgMBk9yZWdvbjESMBAGA1UEBwwJQmVhdmVydG9uMSMwIQYDVQQKDBpQ
-+eXRob24gU29mdHdhcmUgRm91bmRhdGlvbjEgMB4GA1UECwwXUHl0aG9uIENvcmUg
-+RGV2ZWxvcG1lbnQxJDAiBgNVBAMMG251bGwucHl0aG9uLm9yZwBleGFtcGxlLm9y
-+ZzEkMCIGCSqGSIb3DQEJARYVcHl0aG9uLWRldkBweXRob24ub3JnMB4XDTEzMDgw
-+NzEzMTE1MloXDTEzMDgwNzEzMTI1MlowgcUxCzAJBgNVBAYTAlVTMQ8wDQYDVQQI
-+DAZPcmVnb24xEjAQBgNVBAcMCUJlYXZlcnRvbjEjMCEGA1UECgwaUHl0aG9uIFNv
-+ZnR3YXJlIEZvdW5kYXRpb24xIDAeBgNVBAsMF1B5dGhvbiBDb3JlIERldmVsb3Bt
-+ZW50MSQwIgYDVQQDDBtudWxsLnB5dGhvbi5vcmcAZXhhbXBsZS5vcmcxJDAiBgkq
-+hkiG9w0BCQEWFXB5dGhvbi1kZXZAcHl0aG9uLm9yZzCCASIwDQYJKoZIhvcNAQEB
-+BQADggEPADCCAQoCggEBALXq7cn7Rn1vO3aA3TrzA5QLp6bb7B3f/yN0CJ2XFj+j
-+pHs+Gw6WWSUDpybiiKnPec33BFawq3kyblnBMjBU61ioy5HwQqVkJ8vUVjGIUq3P
-+vX/wBmQfzCe4o4uM89gpHyUL9UYGG8oCRa17dgqcv7u5rg0Wq2B1rgY+nHwx3JIv
-+KRrgSwyRkGzpN8WQ1yrXlxWjgI9de0mPVDDUlywcWze1q2kwaEPTM3hLAmD1PESA
-+oY/n8A/RXoeeRs9i/Pm/DGUS8ZPINXk/yOzsR/XvvkTVroIeLZqfmFpnZeF0cHzL
-+08LODkVJJ9zjLdT7SA4vnne4FEbAxDbKAq5qkYzaL4UCAwEAAaOB0DCBzTAMBgNV
-+HRMBAf8EAjAAMB0GA1UdDgQWBBSIWlXAUv9hzVKjNQ/qWpwkOCL3XDALBgNVHQ8E
-+BAMCBeAwgZAGA1UdEQSBiDCBhYIeYWx0bnVsbC5weXRob24ub3JnAGV4YW1wbGUu
-+Y29tgSBudWxsQHB5dGhvbi5vcmcAdXNlckBleGFtcGxlLm9yZ4YpaHR0cDovL251
-+bGwucHl0aG9uLm9yZwBodHRwOi8vZXhhbXBsZS5vcmeHBMAAAgGHECABDbgAAAAA
-+AAAAAAAAAAEwDQYJKoZIhvcNAQEFBQADggEBAKxPRe99SaghcI6IWT7UNkJw9aO9
-+i9eo0Fj2MUqxpKbdb9noRDy2CnHWf7EIYZ1gznXPdwzSN4YCjV5d+Q9xtBaowT0j
-+HPERs1ZuytCNNJTmhyqZ8q6uzMLoht4IqH/FBfpvgaeC5tBTnTT0rD5A/olXeimk
-+kX4LxlEx5RAvpGB2zZVRGr6LobD9rVK91xuHYNIxxxfEGE8tCCWjp0+3ksri9SXx
-+VHWBnbM9YaL32u3hxm8sYB/Yb8WSBavJCWJJqRStVRHM1koZlJmXNx2BX4vPo6iW
-+RFEIPQsFZRLrtnCAiEhyT8bC2s/Njlu6ly9gtJZWSV46Q3ZjBL4q9sHKqZQ=
-+-----END CERTIFICATE-----
-diff -r 9ddc63c039ba Lib/test/test_ssl.py
---- a/Lib/test/test_ssl.py Sun Aug 11 13:04:50 2013 +0300
-+++ b/Lib/test/test_ssl.py Sun Aug 11 18:13:17 2013 +0200
-@@ -25,6 +25,7 @@
- HOST = test_support.HOST
- CERTFILE = None
- SVN_PYTHON_ORG_ROOT_CERT = None
-+NULLBYTECERT = None
-
- def handle_error(prefix):
- exc_format = ' '.join(traceback.format_exception(*sys.exc_info()))
-@@ -123,6 +124,27 @@
- ('DNS', 'projects.forum.nokia.com'))
- )
-
-+ def test_parse_cert_CVE_2013_4073(self):
-+ p = ssl._ssl._test_decode_cert(NULLBYTECERT)
-+ if test_support.verbose:
-+ sys.stdout.write("\n" + pprint.pformat(p) + "\n")
-+ subject = ((('countryName', 'US'),),
-+ (('stateOrProvinceName', 'Oregon'),),
-+ (('localityName', 'Beaverton'),),
-+ (('organizationName', 'Python Software
Foundation'),),
-+ (('organizationalUnitName', 'Python Core
Development'),),
-+ (('commonName', 'null.python.org\x00example.org'),),
-+ (('emailAddress', 'python-dev(a)python.org'),))
-+ self.assertEqual(p['subject'], subject)
-+ self.assertEqual(p['issuer'], subject)
-+ self.assertEqual(p['subjectAltName'],
-+ (('DNS', 'altnull.python.org\x00example.com'),
-+ ('email',
'null@python.org\x00user(a)example.org'),
-+ ('URI',
'http://null.python.org\x00http://example.org'),
-+ ('IP Address', '192.0.2.1'),
-+ ('IP Address', '2001:DB8:0:0:0:0:0:1\n'))
-+ )
-+
- def test_DER_to_PEM(self):
- with open(SVN_PYTHON_ORG_ROOT_CERT, 'r') as f:
- pem = f.read()
-@@ -1360,7 +1382,7 @@
-
-
- def test_main(verbose=False):
-- global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, NOKIACERT
-+ global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, NOKIACERT, NULLBYTECERT
- CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir,
- "keycert.pem")
- SVN_PYTHON_ORG_ROOT_CERT = os.path.join(
-@@ -1368,10 +1390,13 @@
- "https_svn_python_org_root.pem")
- NOKIACERT = os.path.join(os.path.dirname(__file__) or os.curdir,
- "nokia.pem")
-+ NULLBYTECERT = os.path.join(os.path.dirname(__file__) or os.curdir,
-+ "nullbytecert.pem")
-
- if (not os.path.exists(CERTFILE) or
- not os.path.exists(SVN_PYTHON_ORG_ROOT_CERT) or
-- not os.path.exists(NOKIACERT)):
-+ not os.path.exists(NOKIACERT) or
-+ not os.path.exists(NULLBYTECERT)):
- raise test_support.TestFailed("Can't read certificate files!")
-
- tests = [BasicTests, BasicSocketTests]
-diff -r 9ddc63c039ba Modules/_ssl.c
---- a/Modules/_ssl.c Sun Aug 11 13:04:50 2013 +0300
-+++ b/Modules/_ssl.c Sun Aug 11 18:13:17 2013 +0200
-@@ -741,8 +741,13 @@
-
- /* get a rendering of each name in the set of names */
-
-+ int gntype;
-+ ASN1_STRING *as = NULL;
-+
- name = sk_GENERAL_NAME_value(names, j);
-- if (name->type == GEN_DIRNAME) {
-+ gntype = name-> type;
-+ switch (gntype) {
-+ case GEN_DIRNAME:
-
- /* we special-case DirName as a tuple of tuples of attributes */
-
-@@ -764,11 +769,61 @@
- goto fail;
- }
- PyTuple_SET_ITEM(t, 1, v);
-+ break;
-
-- } else {
-+ case GEN_EMAIL:
-+ case GEN_DNS:
-+ case GEN_URI:
-+ /* GENERAL_NAME_print() doesn't handle NUL bytes in ASN1_string
-+ correctly. */
-+ t = PyTuple_New(2);
-+ if (t == NULL)
-+ goto fail;
-+ switch (gntype) {
-+ case GEN_EMAIL:
-+ v = PyUnicode_FromString("email");
-+ as = name->d.rfc822Name;
-+ break;
-+ case GEN_DNS:
-+ v = PyUnicode_FromString("DNS");
-+ as = name->d.dNSName;
-+ break;
-+ case GEN_URI:
-+ v = PyUnicode_FromString("URI");
-+ as = name->d.uniformResourceIdentifier;
-+ break;
-+ }
-+ if (v == NULL) {
-+ Py_DECREF(t);
-+ goto fail;
-+ }
-+ PyTuple_SET_ITEM(t, 0, v);
-+ v = PyString_FromStringAndSize((char *)ASN1_STRING_data(as),
-+ ASN1_STRING_length(as));
-+ if (v == NULL) {
-+ Py_DECREF(t);
-+ goto fail;
-+ }
-+ PyTuple_SET_ITEM(t, 1, v);
-+ break;
-
-+ default:
- /* for everything else, we use the OpenSSL print form */
--
-+ switch (gntype) {
-+ /* check for new general name type */
-+ case GEN_OTHERNAME:
-+ case GEN_X400:
-+ case GEN_EDIPARTY:
-+ case GEN_IPADD:
-+ case GEN_RID:
-+ break;
-+ default:
-+ if (PyErr_Warn(PyExc_RuntimeWarning,
-+ "Unknown general name type") == -1) {
-+ goto fail;
-+ }
-+ break;
-+ }
- (void) BIO_reset(biobuf);
- GENERAL_NAME_print(biobuf, name);
- len = BIO_gets(biobuf, buf, sizeof(buf)-1);
-@@ -794,6 +849,7 @@
- goto fail;
- }
- PyTuple_SET_ITEM(t, 1, v);
-+ break;
- }
-
- /* and add that rendering to the list */
diff --git a/00185-urllib2-honors-noproxy-for-ftp.patch
b/00185-urllib2-honors-noproxy-for-ftp.patch
new file mode 100644
index 0000000..b26c4d4
--- /dev/null
+++ b/00185-urllib2-honors-noproxy-for-ftp.patch
@@ -0,0 +1,12 @@
+diff -up Python-2.7.5/Lib/urllib2.py.orig Python-2.7.5/Lib/urllib2.py
+--- Python-2.7.5/Lib/urllib2.py.orig 2013-07-17 12:22:58.595525622 +0200
++++ Python-2.7.5/Lib/urllib2.py 2013-07-17 12:19:59.875898030 +0200
+@@ -728,6 +728,8 @@ class ProxyHandler(BaseHandler):
+ if proxy_type is None:
+ proxy_type = orig_type
+
++ req.get_host()
++
+ if req.host and proxy_bypass(req.host):
+ return None
+
diff --git a/00186-memory-leak-marshalc.patch b/00186-memory-leak-marshalc.patch
new file mode 100644
index 0000000..19fb175
--- /dev/null
+++ b/00186-memory-leak-marshalc.patch
@@ -0,0 +1,57 @@
+--- Python-2.7.5/Python/marshal.c 2013-05-12 05:32:53.000000000 +0200
++++ /home/rkuska/hg/cpython/Python/marshal.c 2013-07-18 10:33:26.392486235 +0200
+@@ -88,7 +88,7 @@
+ }
+
+ static void
+-w_string(char *s, Py_ssize_t n, WFILE *p)
++w_string(const char *s, Py_ssize_t n, WFILE *p)
+ {
+ if (p->fp != NULL) {
+ fwrite(s, 1, n, p->fp);
+@@ -141,6 +141,13 @@
+ # define W_SIZE w_long
+ #endif
+
++static void
++w_pstring(const char *s, Py_ssize_t n, WFILE *p)
++{
++ W_SIZE(n, p);
++ w_string(s, n, p);
++}
++
+ /* We assume that Python longs are stored internally in base some power of
+ 2**15; for the sake of portability we'll always read and write them in base
+ exactly 2**15. */
+@@ -338,9 +345,7 @@
+ else {
+ w_byte(TYPE_STRING, p);
+ }
+- n = PyString_GET_SIZE(v);
+- W_SIZE(n, p);
+- w_string(PyString_AS_STRING(v), n, p);
++ w_pstring(PyBytes_AS_STRING(v), PyString_GET_SIZE(v), p);
+ }
+ #ifdef Py_USING_UNICODE
+ else if (PyUnicode_CheckExact(v)) {
+@@ -352,9 +357,7 @@
+ return;
+ }
+ w_byte(TYPE_UNICODE, p);
+- n = PyString_GET_SIZE(utf8);
+- W_SIZE(n, p);
+- w_string(PyString_AS_STRING(utf8), n, p);
++ w_pstring(PyString_AS_STRING(utf8), PyString_GET_SIZE(utf8), p);
+ Py_DECREF(utf8);
+ }
+ #endif
+@@ -441,8 +444,7 @@
+ PyBufferProcs *pb = v->ob_type->tp_as_buffer;
+ w_byte(TYPE_STRING, p);
+ n = (*pb->bf_getreadbuffer)(v, 0, (void **)&s);
+- W_SIZE(n, p);
+- w_string(s, n, p);
++ w_pstring(s, n, p);
+ }
+ else {
+ w_byte(TYPE_UNKNOWN, p);
diff --git a/00187-add-RPATH-to-pyexpat.patch b/00187-add-RPATH-to-pyexpat.patch
new file mode 100644
index 0000000..0ac5227
--- /dev/null
+++ b/00187-add-RPATH-to-pyexpat.patch
@@ -0,0 +1,25 @@
+diff -r e8b8279ca118 setup.py
+--- a/setup.py Sun Jul 21 21:57:52 2013 -0400
++++ b/setup.py Tue Aug 20 09:45:31 2013 +0200
+@@ -1480,12 +1480,21 @@
+ 'expat/xmltok_impl.h'
+ ]
+
++ # Add an explicit RPATH to pyexpat.so pointing at the directory
++ # containing the system expat (which has the extra XML_SetHashSalt
++ # symbol), to avoid an ImportError with a link error if there's an
++ # LD_LIBRARY_PATH containing a "vanilla" build of expat (without the
++ # symbol) (rhbz#833271):
++ EXPAT_RPATH = '/usr/lib64' if sys.maxint == 0x7fffffffffffffff else
'/usr/lib'
++
++
+ exts.append(Extension('pyexpat',
+ define_macros = define_macros,
+ include_dirs = expat_inc,
+ libraries = expat_lib,
+ sources = ['pyexpat.c'] + expat_sources,
+ depends = expat_depends,
++ extra_link_args = ['-Wl,-rpath,%s' % EXPAT_RPATH]
+ ))
+
+ # Fredrik Lundh's cElementTree module. Note that this also
diff --git a/00188-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch
b/00188-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch
new file mode 100644
index 0000000..e215589
--- /dev/null
+++ b/00188-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch
@@ -0,0 +1,247 @@
+diff -r 9ddc63c039ba Lib/test/nullbytecert.pem
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ b/Lib/test/nullbytecert.pem Sun Aug 11 18:13:17 2013 +0200
+@@ -0,0 +1,90 @@
++Certificate:
++ Data:
++ Version: 3 (0x2)
++ Serial Number: 0 (0x0)
++ Signature Algorithm: sha1WithRSAEncryption
++ Issuer: C=US, ST=Oregon, L=Beaverton, O=Python Software Foundation, OU=Python
Core Development,
CN=null.python.org\x00example.org/emailAddress=python-dev@python.org
++ Validity
++ Not Before: Aug 7 13:11:52 2013 GMT
++ Not After : Aug 7 13:12:52 2013 GMT
++ Subject: C=US, ST=Oregon, L=Beaverton, O=Python Software Foundation, OU=Python
Core Development,
CN=null.python.org\x00example.org/emailAddress=python-dev@python.org
++ Subject Public Key Info:
++ Public Key Algorithm: rsaEncryption
++ Public-Key: (2048 bit)
++ Modulus:
++ 00:b5:ea:ed:c9:fb:46:7d:6f:3b:76:80:dd:3a:f3:
++ 03:94:0b:a7:a6:db:ec:1d:df:ff:23:74:08:9d:97:
++ 16:3f:a3:a4:7b:3e:1b:0e:96:59:25:03:a7:26:e2:
++ 88:a9:cf:79:cd:f7:04:56:b0:ab:79:32:6e:59:c1:
++ 32:30:54:eb:58:a8:cb:91:f0:42:a5:64:27:cb:d4:
++ 56:31:88:52:ad:cf:bd:7f:f0:06:64:1f:cc:27:b8:
++ a3:8b:8c:f3:d8:29:1f:25:0b:f5:46:06:1b:ca:02:
++ 45:ad:7b:76:0a:9c:bf:bb:b9:ae:0d:16:ab:60:75:
++ ae:06:3e:9c:7c:31:dc:92:2f:29:1a:e0:4b:0c:91:
++ 90:6c:e9:37:c5:90:d7:2a:d7:97:15:a3:80:8f:5d:
++ 7b:49:8f:54:30:d4:97:2c:1c:5b:37:b5:ab:69:30:
++ 68:43:d3:33:78:4b:02:60:f5:3c:44:80:a1:8f:e7:
++ f0:0f:d1:5e:87:9e:46:cf:62:fc:f9:bf:0c:65:12:
++ f1:93:c8:35:79:3f:c8:ec:ec:47:f5:ef:be:44:d5:
++ ae:82:1e:2d:9a:9f:98:5a:67:65:e1:74:70:7c:cb:
++ d3:c2:ce:0e:45:49:27:dc:e3:2d:d4:fb:48:0e:2f:
++ 9e:77:b8:14:46:c0:c4:36:ca:02:ae:6a:91:8c:da:
++ 2f:85
++ Exponent: 65537 (0x10001)
++ X509v3 extensions:
++ X509v3 Basic Constraints: critical
++ CA:FALSE
++ X509v3 Subject Key Identifier:
++ 88:5A:55:C0:52:FF:61:CD:52:A3:35:0F:EA:5A:9C:24:38:22:F7:5C
++ X509v3 Key Usage:
++ Digital Signature, Non Repudiation, Key Encipherment
++ X509v3 Subject Alternative Name:
++ *************************************************************
++ WARNING: The values for DNS, email and URI are WRONG. OpenSSL
++ doesn't print the text after a NULL byte.
++ *************************************************************
++
DNS:altnull.python.org, email:null@python.org,
URI:http://null.python.org, IP Address:192.0.2.1, IP Address:2001:DB8:0:0:0:0:0:1
++ Signature Algorithm: sha1WithRSAEncryption
++ ac:4f:45:ef:7d:49:a8:21:70:8e:88:59:3e:d4:36:42:70:f5:
++ a3:bd:8b:d7:a8:d0:58:f6:31:4a:b1:a4:a6:dd:6f:d9:e8:44:
++ 3c:b6:0a:71:d6:7f:b1:08:61:9d:60:ce:75:cf:77:0c:d2:37:
++ 86:02:8d:5e:5d:f9:0f:71:b4:16:a8:c1:3d:23:1c:f1:11:b3:
++ 56:6e:ca:d0:8d:34:94:e6:87:2a:99:f2:ae:ae:cc:c2:e8:86:
++ de:08:a8:7f:c5:05:fa:6f:81:a7:82:e6:d0:53:9d:34:f4:ac:
++ 3e:40:fe:89:57:7a:29:a4:91:7e:0b:c6:51:31:e5:10:2f:a4:
++ 60:76:cd:95:51:1a:be:8b:a1:b0:fd:ad:52:bd:d7:1b:87:60:
++ d2:31:c7:17:c4:18:4f:2d:08:25:a3:a7:4f:b7:92:ca:e2:f5:
++ 25:f1:54:75:81:9d:b3:3d:61:a2:f7:da:ed:e1:c6:6f:2c:60:
++ 1f:d8:6f:c5:92:05:ab:c9:09:62:49:a9:14:ad:55:11:cc:d6:
++ 4a:19:94:99:97:37:1d:81:5f:8b:cf:a3:a8:96:44:51:08:3d:
++ 0b:05:65:12:eb:b6:70:80:88:48:72:4f:c6:c2:da:cf:cd:8e:
++ 5b:ba:97:2f:60:b4:96:56:49:5e:3a:43:76:63:04:be:2a:f6:
++ c1:ca:a9:94
++-----BEGIN CERTIFICATE-----
++MIIE2DCCA8CgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBxTELMAkGA1UEBhMCVVMx
++DzANBgNVBAgMBk9yZWdvbjESMBAGA1UEBwwJQmVhdmVydG9uMSMwIQYDVQQKDBpQ
++eXRob24gU29mdHdhcmUgRm91bmRhdGlvbjEgMB4GA1UECwwXUHl0aG9uIENvcmUg
++RGV2ZWxvcG1lbnQxJDAiBgNVBAMMG251bGwucHl0aG9uLm9yZwBleGFtcGxlLm9y
++ZzEkMCIGCSqGSIb3DQEJARYVcHl0aG9uLWRldkBweXRob24ub3JnMB4XDTEzMDgw
++NzEzMTE1MloXDTEzMDgwNzEzMTI1MlowgcUxCzAJBgNVBAYTAlVTMQ8wDQYDVQQI
++DAZPcmVnb24xEjAQBgNVBAcMCUJlYXZlcnRvbjEjMCEGA1UECgwaUHl0aG9uIFNv
++ZnR3YXJlIEZvdW5kYXRpb24xIDAeBgNVBAsMF1B5dGhvbiBDb3JlIERldmVsb3Bt
++ZW50MSQwIgYDVQQDDBtudWxsLnB5dGhvbi5vcmcAZXhhbXBsZS5vcmcxJDAiBgkq
++hkiG9w0BCQEWFXB5dGhvbi1kZXZAcHl0aG9uLm9yZzCCASIwDQYJKoZIhvcNAQEB
++BQADggEPADCCAQoCggEBALXq7cn7Rn1vO3aA3TrzA5QLp6bb7B3f/yN0CJ2XFj+j
++pHs+Gw6WWSUDpybiiKnPec33BFawq3kyblnBMjBU61ioy5HwQqVkJ8vUVjGIUq3P
++vX/wBmQfzCe4o4uM89gpHyUL9UYGG8oCRa17dgqcv7u5rg0Wq2B1rgY+nHwx3JIv
++KRrgSwyRkGzpN8WQ1yrXlxWjgI9de0mPVDDUlywcWze1q2kwaEPTM3hLAmD1PESA
++oY/n8A/RXoeeRs9i/Pm/DGUS8ZPINXk/yOzsR/XvvkTVroIeLZqfmFpnZeF0cHzL
++08LODkVJJ9zjLdT7SA4vnne4FEbAxDbKAq5qkYzaL4UCAwEAAaOB0DCBzTAMBgNV
++HRMBAf8EAjAAMB0GA1UdDgQWBBSIWlXAUv9hzVKjNQ/qWpwkOCL3XDALBgNVHQ8E
++BAMCBeAwgZAGA1UdEQSBiDCBhYIeYWx0bnVsbC5weXRob24ub3JnAGV4YW1wbGUu
++Y29tgSBudWxsQHB5dGhvbi5vcmcAdXNlckBleGFtcGxlLm9yZ4YpaHR0cDovL251
++bGwucHl0aG9uLm9yZwBodHRwOi8vZXhhbXBsZS5vcmeHBMAAAgGHECABDbgAAAAA
++AAAAAAAAAAEwDQYJKoZIhvcNAQEFBQADggEBAKxPRe99SaghcI6IWT7UNkJw9aO9
++i9eo0Fj2MUqxpKbdb9noRDy2CnHWf7EIYZ1gznXPdwzSN4YCjV5d+Q9xtBaowT0j
++HPERs1ZuytCNNJTmhyqZ8q6uzMLoht4IqH/FBfpvgaeC5tBTnTT0rD5A/olXeimk
++kX4LxlEx5RAvpGB2zZVRGr6LobD9rVK91xuHYNIxxxfEGE8tCCWjp0+3ksri9SXx
++VHWBnbM9YaL32u3hxm8sYB/Yb8WSBavJCWJJqRStVRHM1koZlJmXNx2BX4vPo6iW
++RFEIPQsFZRLrtnCAiEhyT8bC2s/Njlu6ly9gtJZWSV46Q3ZjBL4q9sHKqZQ=
++-----END CERTIFICATE-----
+diff -r 9ddc63c039ba Lib/test/test_ssl.py
+--- a/Lib/test/test_ssl.py Sun Aug 11 13:04:50 2013 +0300
++++ b/Lib/test/test_ssl.py Sun Aug 11 18:13:17 2013 +0200
+@@ -25,6 +25,7 @@
+ HOST = test_support.HOST
+ CERTFILE = None
+ SVN_PYTHON_ORG_ROOT_CERT = None
++NULLBYTECERT = None
+
+ def handle_error(prefix):
+ exc_format = ' '.join(traceback.format_exception(*sys.exc_info()))
+@@ -123,6 +124,27 @@
+ ('DNS', 'projects.forum.nokia.com'))
+ )
+
++ def test_parse_cert_CVE_2013_4073(self):
++ p = ssl._ssl._test_decode_cert(NULLBYTECERT)
++ if test_support.verbose:
++ sys.stdout.write("\n" + pprint.pformat(p) + "\n")
++ subject = ((('countryName', 'US'),),
++ (('stateOrProvinceName', 'Oregon'),),
++ (('localityName', 'Beaverton'),),
++ (('organizationName', 'Python Software
Foundation'),),
++ (('organizationalUnitName', 'Python Core
Development'),),
++ (('commonName', 'null.python.org\x00example.org'),),
++ (('emailAddress', 'python-dev(a)python.org'),))
++ self.assertEqual(p['subject'], subject)
++ self.assertEqual(p['issuer'], subject)
++ self.assertEqual(p['subjectAltName'],
++ (('DNS', 'altnull.python.org\x00example.com'),
++ ('email',
'null@python.org\x00user(a)example.org'),
++ ('URI',
'http://null.python.org\x00http://example.org'),
++ ('IP Address', '192.0.2.1'),
++ ('IP Address', '2001:DB8:0:0:0:0:0:1\n'))
++ )
++
+ def test_DER_to_PEM(self):
+ with open(SVN_PYTHON_ORG_ROOT_CERT, 'r') as f:
+ pem = f.read()
+@@ -1360,7 +1382,7 @@
+
+
+ def test_main(verbose=False):
+- global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, NOKIACERT
++ global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, NOKIACERT, NULLBYTECERT
+ CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir,
+ "keycert.pem")
+ SVN_PYTHON_ORG_ROOT_CERT = os.path.join(
+@@ -1368,10 +1390,13 @@
+ "https_svn_python_org_root.pem")
+ NOKIACERT = os.path.join(os.path.dirname(__file__) or os.curdir,
+ "nokia.pem")
++ NULLBYTECERT = os.path.join(os.path.dirname(__file__) or os.curdir,
++ "nullbytecert.pem")
+
+ if (not os.path.exists(CERTFILE) or
+ not os.path.exists(SVN_PYTHON_ORG_ROOT_CERT) or
+- not os.path.exists(NOKIACERT)):
++ not os.path.exists(NOKIACERT) or
++ not os.path.exists(NULLBYTECERT)):
+ raise test_support.TestFailed("Can't read certificate files!")
+
+ tests = [BasicTests, BasicSocketTests]
+diff -r 9ddc63c039ba Modules/_ssl.c
+--- a/Modules/_ssl.c Sun Aug 11 13:04:50 2013 +0300
++++ b/Modules/_ssl.c Sun Aug 11 18:13:17 2013 +0200
+@@ -741,8 +741,13 @@
+
+ /* get a rendering of each name in the set of names */
+
++ int gntype;
++ ASN1_STRING *as = NULL;
++
+ name = sk_GENERAL_NAME_value(names, j);
+- if (name->type == GEN_DIRNAME) {
++ gntype = name-> type;
++ switch (gntype) {
++ case GEN_DIRNAME:
+
+ /* we special-case DirName as a tuple of tuples of attributes */
+
+@@ -764,11 +769,61 @@
+ goto fail;
+ }
+ PyTuple_SET_ITEM(t, 1, v);
++ break;
+
+- } else {
++ case GEN_EMAIL:
++ case GEN_DNS:
++ case GEN_URI:
++ /* GENERAL_NAME_print() doesn't handle NUL bytes in ASN1_string
++ correctly. */
++ t = PyTuple_New(2);
++ if (t == NULL)
++ goto fail;
++ switch (gntype) {
++ case GEN_EMAIL:
++ v = PyUnicode_FromString("email");
++ as = name->d.rfc822Name;
++ break;
++ case GEN_DNS:
++ v = PyUnicode_FromString("DNS");
++ as = name->d.dNSName;
++ break;
++ case GEN_URI:
++ v = PyUnicode_FromString("URI");
++ as = name->d.uniformResourceIdentifier;
++ break;
++ }
++ if (v == NULL) {
++ Py_DECREF(t);
++ goto fail;
++ }
++ PyTuple_SET_ITEM(t, 0, v);
++ v = PyString_FromStringAndSize((char *)ASN1_STRING_data(as),
++ ASN1_STRING_length(as));
++ if (v == NULL) {
++ Py_DECREF(t);
++ goto fail;
++ }
++ PyTuple_SET_ITEM(t, 1, v);
++ break;
+
++ default:
+ /* for everything else, we use the OpenSSL print form */
+-
++ switch (gntype) {
++ /* check for new general name type */
++ case GEN_OTHERNAME:
++ case GEN_X400:
++ case GEN_EDIPARTY:
++ case GEN_IPADD:
++ case GEN_RID:
++ break;
++ default:
++ if (PyErr_Warn(PyExc_RuntimeWarning,
++ "Unknown general name type") == -1) {
++ goto fail;
++ }
++ break;
++ }
+ (void) BIO_reset(biobuf);
+ GENERAL_NAME_print(biobuf, name);
+ len = BIO_gets(biobuf, buf, sizeof(buf)-1);
+@@ -794,6 +849,7 @@
+ goto fail;
+ }
+ PyTuple_SET_ITEM(t, 1, v);
++ break;
+ }
+
+ /* and add that rendering to the list */
diff --git a/python.spec b/python.spec
index 441eb3a..75d4b9a 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.5
-Release: 4%{?dist}
+Release: 5%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -823,11 +823,28 @@ Patch181: 00181-allow-arbitrary-timeout-in-condition-wait.patch
Patch184: 00184-ctypes-should-build-with-libffi-multilib-wrapper.patch
# 00185 #
+# Makes urllib2 honor "no_proxy" enviroment variable for "ftp:" URLs
+# when ftp_proxy is set
+Patch185: 00185-urllib2-honors-noproxy-for-ftp.patch
+
+# 00186 #
+# Fix memory leak of variable utf8 in marshal.c
+Patch186: 00186-memory-leak-marshalc.patch
+
+# 00187 #
+# Add an explicit RPATH to pyexpat.so pointing at the directory
+# containing the system expat (which has the extra XML_SetHashSalt
+# symbol), to avoid an ImportError with a link error if there's an
+# LD_LIBRARY_PATH containing a "vanilla" build of expat (without the
+# symbol)
+Patch187: 00187-add-RPATH-to-pyexpat.patch
+
+# 00188 #
# Fix for CVE-2013-4238 --
-# SSL module fails to handle NULL bytes inside subjectAltNames general names
(CVE-2013-4238)
+# SSL module fails to handle NULL bytes inside subjectAltNames general names
#
http://bugs.python.org/issue18709
# rhbz#998430
-Patch185: 00185-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch
+Patch188: 00188-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch
# (New patches go here ^^^)
#
@@ -1181,6 +1198,9 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
# 00183: not for python 2
%patch184 -p1
%patch185 -p1
+%patch186 -p1
+%patch187 -p1
+%patch188 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -2010,6 +2030,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Mon Aug 26 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-5
+- Sync back/renumber patches to stay consistent with rhel.
+
* Mon Aug 19 2013 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.5-4
- Added fix for CVE-2013-4238 (rhbz#998430)
commit 748ca84fcaac88f42dc72f4c71f906ed9696a77e
Author: Matej Stuchlik <mstuchli(a)redhat.com>
Date: Thu Aug 22 10:08:46 2013 +0200
Added fix for CVE-2013-4238 (rhbz#998430)
diff --git a/00185-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch
b/00185-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch
new file mode 100644
index 0000000..e215589
--- /dev/null
+++ b/00185-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch
@@ -0,0 +1,247 @@
+diff -r 9ddc63c039ba Lib/test/nullbytecert.pem
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ b/Lib/test/nullbytecert.pem Sun Aug 11 18:13:17 2013 +0200
+@@ -0,0 +1,90 @@
++Certificate:
++ Data:
++ Version: 3 (0x2)
++ Serial Number: 0 (0x0)
++ Signature Algorithm: sha1WithRSAEncryption
++ Issuer: C=US, ST=Oregon, L=Beaverton, O=Python Software Foundation, OU=Python
Core Development,
CN=null.python.org\x00example.org/emailAddress=python-dev@python.org
++ Validity
++ Not Before: Aug 7 13:11:52 2013 GMT
++ Not After : Aug 7 13:12:52 2013 GMT
++ Subject: C=US, ST=Oregon, L=Beaverton, O=Python Software Foundation, OU=Python
Core Development,
CN=null.python.org\x00example.org/emailAddress=python-dev@python.org
++ Subject Public Key Info:
++ Public Key Algorithm: rsaEncryption
++ Public-Key: (2048 bit)
++ Modulus:
++ 00:b5:ea:ed:c9:fb:46:7d:6f:3b:76:80:dd:3a:f3:
++ 03:94:0b:a7:a6:db:ec:1d:df:ff:23:74:08:9d:97:
++ 16:3f:a3:a4:7b:3e:1b:0e:96:59:25:03:a7:26:e2:
++ 88:a9:cf:79:cd:f7:04:56:b0:ab:79:32:6e:59:c1:
++ 32:30:54:eb:58:a8:cb:91:f0:42:a5:64:27:cb:d4:
++ 56:31:88:52:ad:cf:bd:7f:f0:06:64:1f:cc:27:b8:
++ a3:8b:8c:f3:d8:29:1f:25:0b:f5:46:06:1b:ca:02:
++ 45:ad:7b:76:0a:9c:bf:bb:b9:ae:0d:16:ab:60:75:
++ ae:06:3e:9c:7c:31:dc:92:2f:29:1a:e0:4b:0c:91:
++ 90:6c:e9:37:c5:90:d7:2a:d7:97:15:a3:80:8f:5d:
++ 7b:49:8f:54:30:d4:97:2c:1c:5b:37:b5:ab:69:30:
++ 68:43:d3:33:78:4b:02:60:f5:3c:44:80:a1:8f:e7:
++ f0:0f:d1:5e:87:9e:46:cf:62:fc:f9:bf:0c:65:12:
++ f1:93:c8:35:79:3f:c8:ec:ec:47:f5:ef:be:44:d5:
++ ae:82:1e:2d:9a:9f:98:5a:67:65:e1:74:70:7c:cb:
++ d3:c2:ce:0e:45:49:27:dc:e3:2d:d4:fb:48:0e:2f:
++ 9e:77:b8:14:46:c0:c4:36:ca:02:ae:6a:91:8c:da:
++ 2f:85
++ Exponent: 65537 (0x10001)
++ X509v3 extensions:
++ X509v3 Basic Constraints: critical
++ CA:FALSE
++ X509v3 Subject Key Identifier:
++ 88:5A:55:C0:52:FF:61:CD:52:A3:35:0F:EA:5A:9C:24:38:22:F7:5C
++ X509v3 Key Usage:
++ Digital Signature, Non Repudiation, Key Encipherment
++ X509v3 Subject Alternative Name:
++ *************************************************************
++ WARNING: The values for DNS, email and URI are WRONG. OpenSSL
++ doesn't print the text after a NULL byte.
++ *************************************************************
++
DNS:altnull.python.org, email:null@python.org,
URI:http://null.python.org, IP Address:192.0.2.1, IP Address:2001:DB8:0:0:0:0:0:1
++ Signature Algorithm: sha1WithRSAEncryption
++ ac:4f:45:ef:7d:49:a8:21:70:8e:88:59:3e:d4:36:42:70:f5:
++ a3:bd:8b:d7:a8:d0:58:f6:31:4a:b1:a4:a6:dd:6f:d9:e8:44:
++ 3c:b6:0a:71:d6:7f:b1:08:61:9d:60:ce:75:cf:77:0c:d2:37:
++ 86:02:8d:5e:5d:f9:0f:71:b4:16:a8:c1:3d:23:1c:f1:11:b3:
++ 56:6e:ca:d0:8d:34:94:e6:87:2a:99:f2:ae:ae:cc:c2:e8:86:
++ de:08:a8:7f:c5:05:fa:6f:81:a7:82:e6:d0:53:9d:34:f4:ac:
++ 3e:40:fe:89:57:7a:29:a4:91:7e:0b:c6:51:31:e5:10:2f:a4:
++ 60:76:cd:95:51:1a:be:8b:a1:b0:fd:ad:52:bd:d7:1b:87:60:
++ d2:31:c7:17:c4:18:4f:2d:08:25:a3:a7:4f:b7:92:ca:e2:f5:
++ 25:f1:54:75:81:9d:b3:3d:61:a2:f7:da:ed:e1:c6:6f:2c:60:
++ 1f:d8:6f:c5:92:05:ab:c9:09:62:49:a9:14:ad:55:11:cc:d6:
++ 4a:19:94:99:97:37:1d:81:5f:8b:cf:a3:a8:96:44:51:08:3d:
++ 0b:05:65:12:eb:b6:70:80:88:48:72:4f:c6:c2:da:cf:cd:8e:
++ 5b:ba:97:2f:60:b4:96:56:49:5e:3a:43:76:63:04:be:2a:f6:
++ c1:ca:a9:94
++-----BEGIN CERTIFICATE-----
++MIIE2DCCA8CgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBxTELMAkGA1UEBhMCVVMx
++DzANBgNVBAgMBk9yZWdvbjESMBAGA1UEBwwJQmVhdmVydG9uMSMwIQYDVQQKDBpQ
++eXRob24gU29mdHdhcmUgRm91bmRhdGlvbjEgMB4GA1UECwwXUHl0aG9uIENvcmUg
++RGV2ZWxvcG1lbnQxJDAiBgNVBAMMG251bGwucHl0aG9uLm9yZwBleGFtcGxlLm9y
++ZzEkMCIGCSqGSIb3DQEJARYVcHl0aG9uLWRldkBweXRob24ub3JnMB4XDTEzMDgw
++NzEzMTE1MloXDTEzMDgwNzEzMTI1MlowgcUxCzAJBgNVBAYTAlVTMQ8wDQYDVQQI
++DAZPcmVnb24xEjAQBgNVBAcMCUJlYXZlcnRvbjEjMCEGA1UECgwaUHl0aG9uIFNv
++ZnR3YXJlIEZvdW5kYXRpb24xIDAeBgNVBAsMF1B5dGhvbiBDb3JlIERldmVsb3Bt
++ZW50MSQwIgYDVQQDDBtudWxsLnB5dGhvbi5vcmcAZXhhbXBsZS5vcmcxJDAiBgkq
++hkiG9w0BCQEWFXB5dGhvbi1kZXZAcHl0aG9uLm9yZzCCASIwDQYJKoZIhvcNAQEB
++BQADggEPADCCAQoCggEBALXq7cn7Rn1vO3aA3TrzA5QLp6bb7B3f/yN0CJ2XFj+j
++pHs+Gw6WWSUDpybiiKnPec33BFawq3kyblnBMjBU61ioy5HwQqVkJ8vUVjGIUq3P
++vX/wBmQfzCe4o4uM89gpHyUL9UYGG8oCRa17dgqcv7u5rg0Wq2B1rgY+nHwx3JIv
++KRrgSwyRkGzpN8WQ1yrXlxWjgI9de0mPVDDUlywcWze1q2kwaEPTM3hLAmD1PESA
++oY/n8A/RXoeeRs9i/Pm/DGUS8ZPINXk/yOzsR/XvvkTVroIeLZqfmFpnZeF0cHzL
++08LODkVJJ9zjLdT7SA4vnne4FEbAxDbKAq5qkYzaL4UCAwEAAaOB0DCBzTAMBgNV
++HRMBAf8EAjAAMB0GA1UdDgQWBBSIWlXAUv9hzVKjNQ/qWpwkOCL3XDALBgNVHQ8E
++BAMCBeAwgZAGA1UdEQSBiDCBhYIeYWx0bnVsbC5weXRob24ub3JnAGV4YW1wbGUu
++Y29tgSBudWxsQHB5dGhvbi5vcmcAdXNlckBleGFtcGxlLm9yZ4YpaHR0cDovL251
++bGwucHl0aG9uLm9yZwBodHRwOi8vZXhhbXBsZS5vcmeHBMAAAgGHECABDbgAAAAA
++AAAAAAAAAAEwDQYJKoZIhvcNAQEFBQADggEBAKxPRe99SaghcI6IWT7UNkJw9aO9
++i9eo0Fj2MUqxpKbdb9noRDy2CnHWf7EIYZ1gznXPdwzSN4YCjV5d+Q9xtBaowT0j
++HPERs1ZuytCNNJTmhyqZ8q6uzMLoht4IqH/FBfpvgaeC5tBTnTT0rD5A/olXeimk
++kX4LxlEx5RAvpGB2zZVRGr6LobD9rVK91xuHYNIxxxfEGE8tCCWjp0+3ksri9SXx
++VHWBnbM9YaL32u3hxm8sYB/Yb8WSBavJCWJJqRStVRHM1koZlJmXNx2BX4vPo6iW
++RFEIPQsFZRLrtnCAiEhyT8bC2s/Njlu6ly9gtJZWSV46Q3ZjBL4q9sHKqZQ=
++-----END CERTIFICATE-----
+diff -r 9ddc63c039ba Lib/test/test_ssl.py
+--- a/Lib/test/test_ssl.py Sun Aug 11 13:04:50 2013 +0300
++++ b/Lib/test/test_ssl.py Sun Aug 11 18:13:17 2013 +0200
+@@ -25,6 +25,7 @@
+ HOST = test_support.HOST
+ CERTFILE = None
+ SVN_PYTHON_ORG_ROOT_CERT = None
++NULLBYTECERT = None
+
+ def handle_error(prefix):
+ exc_format = ' '.join(traceback.format_exception(*sys.exc_info()))
+@@ -123,6 +124,27 @@
+ ('DNS', 'projects.forum.nokia.com'))
+ )
+
++ def test_parse_cert_CVE_2013_4073(self):
++ p = ssl._ssl._test_decode_cert(NULLBYTECERT)
++ if test_support.verbose:
++ sys.stdout.write("\n" + pprint.pformat(p) + "\n")
++ subject = ((('countryName', 'US'),),
++ (('stateOrProvinceName', 'Oregon'),),
++ (('localityName', 'Beaverton'),),
++ (('organizationName', 'Python Software
Foundation'),),
++ (('organizationalUnitName', 'Python Core
Development'),),
++ (('commonName', 'null.python.org\x00example.org'),),
++ (('emailAddress', 'python-dev(a)python.org'),))
++ self.assertEqual(p['subject'], subject)
++ self.assertEqual(p['issuer'], subject)
++ self.assertEqual(p['subjectAltName'],
++ (('DNS', 'altnull.python.org\x00example.com'),
++ ('email',
'null@python.org\x00user(a)example.org'),
++ ('URI',
'http://null.python.org\x00http://example.org'),
++ ('IP Address', '192.0.2.1'),
++ ('IP Address', '2001:DB8:0:0:0:0:0:1\n'))
++ )
++
+ def test_DER_to_PEM(self):
+ with open(SVN_PYTHON_ORG_ROOT_CERT, 'r') as f:
+ pem = f.read()
+@@ -1360,7 +1382,7 @@
+
+
+ def test_main(verbose=False):
+- global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, NOKIACERT
++ global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, NOKIACERT, NULLBYTECERT
+ CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir,
+ "keycert.pem")
+ SVN_PYTHON_ORG_ROOT_CERT = os.path.join(
+@@ -1368,10 +1390,13 @@
+ "https_svn_python_org_root.pem")
+ NOKIACERT = os.path.join(os.path.dirname(__file__) or os.curdir,
+ "nokia.pem")
++ NULLBYTECERT = os.path.join(os.path.dirname(__file__) or os.curdir,
++ "nullbytecert.pem")
+
+ if (not os.path.exists(CERTFILE) or
+ not os.path.exists(SVN_PYTHON_ORG_ROOT_CERT) or
+- not os.path.exists(NOKIACERT)):
++ not os.path.exists(NOKIACERT) or
++ not os.path.exists(NULLBYTECERT)):
+ raise test_support.TestFailed("Can't read certificate files!")
+
+ tests = [BasicTests, BasicSocketTests]
+diff -r 9ddc63c039ba Modules/_ssl.c
+--- a/Modules/_ssl.c Sun Aug 11 13:04:50 2013 +0300
++++ b/Modules/_ssl.c Sun Aug 11 18:13:17 2013 +0200
+@@ -741,8 +741,13 @@
+
+ /* get a rendering of each name in the set of names */
+
++ int gntype;
++ ASN1_STRING *as = NULL;
++
+ name = sk_GENERAL_NAME_value(names, j);
+- if (name->type == GEN_DIRNAME) {
++ gntype = name-> type;
++ switch (gntype) {
++ case GEN_DIRNAME:
+
+ /* we special-case DirName as a tuple of tuples of attributes */
+
+@@ -764,11 +769,61 @@
+ goto fail;
+ }
+ PyTuple_SET_ITEM(t, 1, v);
++ break;
+
+- } else {
++ case GEN_EMAIL:
++ case GEN_DNS:
++ case GEN_URI:
++ /* GENERAL_NAME_print() doesn't handle NUL bytes in ASN1_string
++ correctly. */
++ t = PyTuple_New(2);
++ if (t == NULL)
++ goto fail;
++ switch (gntype) {
++ case GEN_EMAIL:
++ v = PyUnicode_FromString("email");
++ as = name->d.rfc822Name;
++ break;
++ case GEN_DNS:
++ v = PyUnicode_FromString("DNS");
++ as = name->d.dNSName;
++ break;
++ case GEN_URI:
++ v = PyUnicode_FromString("URI");
++ as = name->d.uniformResourceIdentifier;
++ break;
++ }
++ if (v == NULL) {
++ Py_DECREF(t);
++ goto fail;
++ }
++ PyTuple_SET_ITEM(t, 0, v);
++ v = PyString_FromStringAndSize((char *)ASN1_STRING_data(as),
++ ASN1_STRING_length(as));
++ if (v == NULL) {
++ Py_DECREF(t);
++ goto fail;
++ }
++ PyTuple_SET_ITEM(t, 1, v);
++ break;
+
++ default:
+ /* for everything else, we use the OpenSSL print form */
+-
++ switch (gntype) {
++ /* check for new general name type */
++ case GEN_OTHERNAME:
++ case GEN_X400:
++ case GEN_EDIPARTY:
++ case GEN_IPADD:
++ case GEN_RID:
++ break;
++ default:
++ if (PyErr_Warn(PyExc_RuntimeWarning,
++ "Unknown general name type") == -1) {
++ goto fail;
++ }
++ break;
++ }
+ (void) BIO_reset(biobuf);
+ GENERAL_NAME_print(biobuf, name);
+ len = BIO_gets(biobuf, buf, sizeof(buf)-1);
+@@ -794,6 +849,7 @@
+ goto fail;
+ }
+ PyTuple_SET_ITEM(t, 1, v);
++ break;
+ }
+
+ /* and add that rendering to the list */
diff --git a/python.spec b/python.spec
index 51eb7d7..441eb3a 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.5
-Release: 3%{?dist}
+Release: 4%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -822,6 +822,12 @@ Patch181: 00181-allow-arbitrary-timeout-in-condition-wait.patch
# We patch this by also accepting "#define ffi_wrapper_h"
Patch184: 00184-ctypes-should-build-with-libffi-multilib-wrapper.patch
+# 00185 #
+# Fix for CVE-2013-4238 --
+# SSL module fails to handle NULL bytes inside subjectAltNames general names
(CVE-2013-4238)
+#
http://bugs.python.org/issue18709
+# rhbz#998430
+Patch185: 00185-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch
# (New patches go here ^^^)
#
@@ -1174,6 +1180,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
# 00182: not for python 2
# 00183: not for python 2
%patch184 -p1
+%patch185 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -2003,6 +2010,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Mon Aug 19 2013 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.5-4
+- Added fix for CVE-2013-4238 (rhbz#998430)
+
* Mon Jul 08 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-3
- Fix build with libffi containing multilib wrapper for ffi.h (rhbz#979696).
commit 6f6573092076b9db074157c1bc85bbf7404d5d86
Author: Matej Stuchlik <mstuchli(a)redhat.com>
Date: Wed Aug 21 20:05:58 2013 +0200
Added fix for CVE-2013-4238 (rhbz#998430)
diff --git a/00185-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch
b/00185-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch
new file mode 100644
index 0000000..e215589
--- /dev/null
+++ b/00185-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch
@@ -0,0 +1,247 @@
+diff -r 9ddc63c039ba Lib/test/nullbytecert.pem
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ b/Lib/test/nullbytecert.pem Sun Aug 11 18:13:17 2013 +0200
+@@ -0,0 +1,90 @@
++Certificate:
++ Data:
++ Version: 3 (0x2)
++ Serial Number: 0 (0x0)
++ Signature Algorithm: sha1WithRSAEncryption
++ Issuer: C=US, ST=Oregon, L=Beaverton, O=Python Software Foundation, OU=Python
Core Development,
CN=null.python.org\x00example.org/emailAddress=python-dev@python.org
++ Validity
++ Not Before: Aug 7 13:11:52 2013 GMT
++ Not After : Aug 7 13:12:52 2013 GMT
++ Subject: C=US, ST=Oregon, L=Beaverton, O=Python Software Foundation, OU=Python
Core Development,
CN=null.python.org\x00example.org/emailAddress=python-dev@python.org
++ Subject Public Key Info:
++ Public Key Algorithm: rsaEncryption
++ Public-Key: (2048 bit)
++ Modulus:
++ 00:b5:ea:ed:c9:fb:46:7d:6f:3b:76:80:dd:3a:f3:
++ 03:94:0b:a7:a6:db:ec:1d:df:ff:23:74:08:9d:97:
++ 16:3f:a3:a4:7b:3e:1b:0e:96:59:25:03:a7:26:e2:
++ 88:a9:cf:79:cd:f7:04:56:b0:ab:79:32:6e:59:c1:
++ 32:30:54:eb:58:a8:cb:91:f0:42:a5:64:27:cb:d4:
++ 56:31:88:52:ad:cf:bd:7f:f0:06:64:1f:cc:27:b8:
++ a3:8b:8c:f3:d8:29:1f:25:0b:f5:46:06:1b:ca:02:
++ 45:ad:7b:76:0a:9c:bf:bb:b9:ae:0d:16:ab:60:75:
++ ae:06:3e:9c:7c:31:dc:92:2f:29:1a:e0:4b:0c:91:
++ 90:6c:e9:37:c5:90:d7:2a:d7:97:15:a3:80:8f:5d:
++ 7b:49:8f:54:30:d4:97:2c:1c:5b:37:b5:ab:69:30:
++ 68:43:d3:33:78:4b:02:60:f5:3c:44:80:a1:8f:e7:
++ f0:0f:d1:5e:87:9e:46:cf:62:fc:f9:bf:0c:65:12:
++ f1:93:c8:35:79:3f:c8:ec:ec:47:f5:ef:be:44:d5:
++ ae:82:1e:2d:9a:9f:98:5a:67:65:e1:74:70:7c:cb:
++ d3:c2:ce:0e:45:49:27:dc:e3:2d:d4:fb:48:0e:2f:
++ 9e:77:b8:14:46:c0:c4:36:ca:02:ae:6a:91:8c:da:
++ 2f:85
++ Exponent: 65537 (0x10001)
++ X509v3 extensions:
++ X509v3 Basic Constraints: critical
++ CA:FALSE
++ X509v3 Subject Key Identifier:
++ 88:5A:55:C0:52:FF:61:CD:52:A3:35:0F:EA:5A:9C:24:38:22:F7:5C
++ X509v3 Key Usage:
++ Digital Signature, Non Repudiation, Key Encipherment
++ X509v3 Subject Alternative Name:
++ *************************************************************
++ WARNING: The values for DNS, email and URI are WRONG. OpenSSL
++ doesn't print the text after a NULL byte.
++ *************************************************************
++
DNS:altnull.python.org, email:null@python.org,
URI:http://null.python.org, IP Address:192.0.2.1, IP Address:2001:DB8:0:0:0:0:0:1
++ Signature Algorithm: sha1WithRSAEncryption
++ ac:4f:45:ef:7d:49:a8:21:70:8e:88:59:3e:d4:36:42:70:f5:
++ a3:bd:8b:d7:a8:d0:58:f6:31:4a:b1:a4:a6:dd:6f:d9:e8:44:
++ 3c:b6:0a:71:d6:7f:b1:08:61:9d:60:ce:75:cf:77:0c:d2:37:
++ 86:02:8d:5e:5d:f9:0f:71:b4:16:a8:c1:3d:23:1c:f1:11:b3:
++ 56:6e:ca:d0:8d:34:94:e6:87:2a:99:f2:ae:ae:cc:c2:e8:86:
++ de:08:a8:7f:c5:05:fa:6f:81:a7:82:e6:d0:53:9d:34:f4:ac:
++ 3e:40:fe:89:57:7a:29:a4:91:7e:0b:c6:51:31:e5:10:2f:a4:
++ 60:76:cd:95:51:1a:be:8b:a1:b0:fd:ad:52:bd:d7:1b:87:60:
++ d2:31:c7:17:c4:18:4f:2d:08:25:a3:a7:4f:b7:92:ca:e2:f5:
++ 25:f1:54:75:81:9d:b3:3d:61:a2:f7:da:ed:e1:c6:6f:2c:60:
++ 1f:d8:6f:c5:92:05:ab:c9:09:62:49:a9:14:ad:55:11:cc:d6:
++ 4a:19:94:99:97:37:1d:81:5f:8b:cf:a3:a8:96:44:51:08:3d:
++ 0b:05:65:12:eb:b6:70:80:88:48:72:4f:c6:c2:da:cf:cd:8e:
++ 5b:ba:97:2f:60:b4:96:56:49:5e:3a:43:76:63:04:be:2a:f6:
++ c1:ca:a9:94
++-----BEGIN CERTIFICATE-----
++MIIE2DCCA8CgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBxTELMAkGA1UEBhMCVVMx
++DzANBgNVBAgMBk9yZWdvbjESMBAGA1UEBwwJQmVhdmVydG9uMSMwIQYDVQQKDBpQ
++eXRob24gU29mdHdhcmUgRm91bmRhdGlvbjEgMB4GA1UECwwXUHl0aG9uIENvcmUg
++RGV2ZWxvcG1lbnQxJDAiBgNVBAMMG251bGwucHl0aG9uLm9yZwBleGFtcGxlLm9y
++ZzEkMCIGCSqGSIb3DQEJARYVcHl0aG9uLWRldkBweXRob24ub3JnMB4XDTEzMDgw
++NzEzMTE1MloXDTEzMDgwNzEzMTI1MlowgcUxCzAJBgNVBAYTAlVTMQ8wDQYDVQQI
++DAZPcmVnb24xEjAQBgNVBAcMCUJlYXZlcnRvbjEjMCEGA1UECgwaUHl0aG9uIFNv
++ZnR3YXJlIEZvdW5kYXRpb24xIDAeBgNVBAsMF1B5dGhvbiBDb3JlIERldmVsb3Bt
++ZW50MSQwIgYDVQQDDBtudWxsLnB5dGhvbi5vcmcAZXhhbXBsZS5vcmcxJDAiBgkq
++hkiG9w0BCQEWFXB5dGhvbi1kZXZAcHl0aG9uLm9yZzCCASIwDQYJKoZIhvcNAQEB
++BQADggEPADCCAQoCggEBALXq7cn7Rn1vO3aA3TrzA5QLp6bb7B3f/yN0CJ2XFj+j
++pHs+Gw6WWSUDpybiiKnPec33BFawq3kyblnBMjBU61ioy5HwQqVkJ8vUVjGIUq3P
++vX/wBmQfzCe4o4uM89gpHyUL9UYGG8oCRa17dgqcv7u5rg0Wq2B1rgY+nHwx3JIv
++KRrgSwyRkGzpN8WQ1yrXlxWjgI9de0mPVDDUlywcWze1q2kwaEPTM3hLAmD1PESA
++oY/n8A/RXoeeRs9i/Pm/DGUS8ZPINXk/yOzsR/XvvkTVroIeLZqfmFpnZeF0cHzL
++08LODkVJJ9zjLdT7SA4vnne4FEbAxDbKAq5qkYzaL4UCAwEAAaOB0DCBzTAMBgNV
++HRMBAf8EAjAAMB0GA1UdDgQWBBSIWlXAUv9hzVKjNQ/qWpwkOCL3XDALBgNVHQ8E
++BAMCBeAwgZAGA1UdEQSBiDCBhYIeYWx0bnVsbC5weXRob24ub3JnAGV4YW1wbGUu
++Y29tgSBudWxsQHB5dGhvbi5vcmcAdXNlckBleGFtcGxlLm9yZ4YpaHR0cDovL251
++bGwucHl0aG9uLm9yZwBodHRwOi8vZXhhbXBsZS5vcmeHBMAAAgGHECABDbgAAAAA
++AAAAAAAAAAEwDQYJKoZIhvcNAQEFBQADggEBAKxPRe99SaghcI6IWT7UNkJw9aO9
++i9eo0Fj2MUqxpKbdb9noRDy2CnHWf7EIYZ1gznXPdwzSN4YCjV5d+Q9xtBaowT0j
++HPERs1ZuytCNNJTmhyqZ8q6uzMLoht4IqH/FBfpvgaeC5tBTnTT0rD5A/olXeimk
++kX4LxlEx5RAvpGB2zZVRGr6LobD9rVK91xuHYNIxxxfEGE8tCCWjp0+3ksri9SXx
++VHWBnbM9YaL32u3hxm8sYB/Yb8WSBavJCWJJqRStVRHM1koZlJmXNx2BX4vPo6iW
++RFEIPQsFZRLrtnCAiEhyT8bC2s/Njlu6ly9gtJZWSV46Q3ZjBL4q9sHKqZQ=
++-----END CERTIFICATE-----
+diff -r 9ddc63c039ba Lib/test/test_ssl.py
+--- a/Lib/test/test_ssl.py Sun Aug 11 13:04:50 2013 +0300
++++ b/Lib/test/test_ssl.py Sun Aug 11 18:13:17 2013 +0200
+@@ -25,6 +25,7 @@
+ HOST = test_support.HOST
+ CERTFILE = None
+ SVN_PYTHON_ORG_ROOT_CERT = None
++NULLBYTECERT = None
+
+ def handle_error(prefix):
+ exc_format = ' '.join(traceback.format_exception(*sys.exc_info()))
+@@ -123,6 +124,27 @@
+ ('DNS', 'projects.forum.nokia.com'))
+ )
+
++ def test_parse_cert_CVE_2013_4073(self):
++ p = ssl._ssl._test_decode_cert(NULLBYTECERT)
++ if test_support.verbose:
++ sys.stdout.write("\n" + pprint.pformat(p) + "\n")
++ subject = ((('countryName', 'US'),),
++ (('stateOrProvinceName', 'Oregon'),),
++ (('localityName', 'Beaverton'),),
++ (('organizationName', 'Python Software
Foundation'),),
++ (('organizationalUnitName', 'Python Core
Development'),),
++ (('commonName', 'null.python.org\x00example.org'),),
++ (('emailAddress', 'python-dev(a)python.org'),))
++ self.assertEqual(p['subject'], subject)
++ self.assertEqual(p['issuer'], subject)
++ self.assertEqual(p['subjectAltName'],
++ (('DNS', 'altnull.python.org\x00example.com'),
++ ('email',
'null@python.org\x00user(a)example.org'),
++ ('URI',
'http://null.python.org\x00http://example.org'),
++ ('IP Address', '192.0.2.1'),
++ ('IP Address', '2001:DB8:0:0:0:0:0:1\n'))
++ )
++
+ def test_DER_to_PEM(self):
+ with open(SVN_PYTHON_ORG_ROOT_CERT, 'r') as f:
+ pem = f.read()
+@@ -1360,7 +1382,7 @@
+
+
+ def test_main(verbose=False):
+- global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, NOKIACERT
++ global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, NOKIACERT, NULLBYTECERT
+ CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir,
+ "keycert.pem")
+ SVN_PYTHON_ORG_ROOT_CERT = os.path.join(
+@@ -1368,10 +1390,13 @@
+ "https_svn_python_org_root.pem")
+ NOKIACERT = os.path.join(os.path.dirname(__file__) or os.curdir,
+ "nokia.pem")
++ NULLBYTECERT = os.path.join(os.path.dirname(__file__) or os.curdir,
++ "nullbytecert.pem")
+
+ if (not os.path.exists(CERTFILE) or
+ not os.path.exists(SVN_PYTHON_ORG_ROOT_CERT) or
+- not os.path.exists(NOKIACERT)):
++ not os.path.exists(NOKIACERT) or
++ not os.path.exists(NULLBYTECERT)):
+ raise test_support.TestFailed("Can't read certificate files!")
+
+ tests = [BasicTests, BasicSocketTests]
+diff -r 9ddc63c039ba Modules/_ssl.c
+--- a/Modules/_ssl.c Sun Aug 11 13:04:50 2013 +0300
++++ b/Modules/_ssl.c Sun Aug 11 18:13:17 2013 +0200
+@@ -741,8 +741,13 @@
+
+ /* get a rendering of each name in the set of names */
+
++ int gntype;
++ ASN1_STRING *as = NULL;
++
+ name = sk_GENERAL_NAME_value(names, j);
+- if (name->type == GEN_DIRNAME) {
++ gntype = name-> type;
++ switch (gntype) {
++ case GEN_DIRNAME:
+
+ /* we special-case DirName as a tuple of tuples of attributes */
+
+@@ -764,11 +769,61 @@
+ goto fail;
+ }
+ PyTuple_SET_ITEM(t, 1, v);
++ break;
+
+- } else {
++ case GEN_EMAIL:
++ case GEN_DNS:
++ case GEN_URI:
++ /* GENERAL_NAME_print() doesn't handle NUL bytes in ASN1_string
++ correctly. */
++ t = PyTuple_New(2);
++ if (t == NULL)
++ goto fail;
++ switch (gntype) {
++ case GEN_EMAIL:
++ v = PyUnicode_FromString("email");
++ as = name->d.rfc822Name;
++ break;
++ case GEN_DNS:
++ v = PyUnicode_FromString("DNS");
++ as = name->d.dNSName;
++ break;
++ case GEN_URI:
++ v = PyUnicode_FromString("URI");
++ as = name->d.uniformResourceIdentifier;
++ break;
++ }
++ if (v == NULL) {
++ Py_DECREF(t);
++ goto fail;
++ }
++ PyTuple_SET_ITEM(t, 0, v);
++ v = PyString_FromStringAndSize((char *)ASN1_STRING_data(as),
++ ASN1_STRING_length(as));
++ if (v == NULL) {
++ Py_DECREF(t);
++ goto fail;
++ }
++ PyTuple_SET_ITEM(t, 1, v);
++ break;
+
++ default:
+ /* for everything else, we use the OpenSSL print form */
+-
++ switch (gntype) {
++ /* check for new general name type */
++ case GEN_OTHERNAME:
++ case GEN_X400:
++ case GEN_EDIPARTY:
++ case GEN_IPADD:
++ case GEN_RID:
++ break;
++ default:
++ if (PyErr_Warn(PyExc_RuntimeWarning,
++ "Unknown general name type") == -1) {
++ goto fail;
++ }
++ break;
++ }
+ (void) BIO_reset(biobuf);
+ GENERAL_NAME_print(biobuf, name);
+ len = BIO_gets(biobuf, buf, sizeof(buf)-1);
+@@ -794,6 +849,7 @@
+ goto fail;
+ }
+ PyTuple_SET_ITEM(t, 1, v);
++ break;
+ }
+
+ /* and add that rendering to the list */
diff --git a/python.spec b/python.spec
index 3992888..3953bcf 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.5
-Release: 4%{?dist}
+Release: 5%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -822,6 +822,12 @@ Patch181: 00181-allow-arbitrary-timeout-in-condition-wait.patch
# We patch this by also accepting "#define ffi_wrapper_h"
Patch184: 00184-ctypes-should-build-with-libffi-multilib-wrapper.patch
+# 00185 #
+# Fix for CVE-2013-4238 --
+# SSL module fails to handle NULL bytes inside subjectAltNames general names
(CVE-2013-4238)
+#
http://bugs.python.org/issue18709
+# rhbz#998430
+Patch185: 00185-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch
# (New patches go here ^^^)
#
@@ -1174,6 +1180,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
# 00182: not for python 2
# 00183: not for python 2
%patch184 -p1
+%patch185 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -2003,6 +2010,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Mon Aug 19 2013 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.5-5
+- Added fix for CVE-2013-4238 (rhbz#998430)
+
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.7.5-4
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
commit 159ddfd3dd754ee0938a1783ee6b1a85f694d4a5
Author: Matej Stuchlik <mstuchli(a)redhat.com>
Date: Wed Aug 21 11:00:00 2013 +0200
Added fix for CVE-2013-4238 (rhbz#998430)
diff --git a/00185-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch
b/00185-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch
new file mode 100644
index 0000000..e215589
--- /dev/null
+++ b/00185-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch
@@ -0,0 +1,247 @@
+diff -r 9ddc63c039ba Lib/test/nullbytecert.pem
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ b/Lib/test/nullbytecert.pem Sun Aug 11 18:13:17 2013 +0200
+@@ -0,0 +1,90 @@
++Certificate:
++ Data:
++ Version: 3 (0x2)
++ Serial Number: 0 (0x0)
++ Signature Algorithm: sha1WithRSAEncryption
++ Issuer: C=US, ST=Oregon, L=Beaverton, O=Python Software Foundation, OU=Python
Core Development,
CN=null.python.org\x00example.org/emailAddress=python-dev@python.org
++ Validity
++ Not Before: Aug 7 13:11:52 2013 GMT
++ Not After : Aug 7 13:12:52 2013 GMT
++ Subject: C=US, ST=Oregon, L=Beaverton, O=Python Software Foundation, OU=Python
Core Development,
CN=null.python.org\x00example.org/emailAddress=python-dev@python.org
++ Subject Public Key Info:
++ Public Key Algorithm: rsaEncryption
++ Public-Key: (2048 bit)
++ Modulus:
++ 00:b5:ea:ed:c9:fb:46:7d:6f:3b:76:80:dd:3a:f3:
++ 03:94:0b:a7:a6:db:ec:1d:df:ff:23:74:08:9d:97:
++ 16:3f:a3:a4:7b:3e:1b:0e:96:59:25:03:a7:26:e2:
++ 88:a9:cf:79:cd:f7:04:56:b0:ab:79:32:6e:59:c1:
++ 32:30:54:eb:58:a8:cb:91:f0:42:a5:64:27:cb:d4:
++ 56:31:88:52:ad:cf:bd:7f:f0:06:64:1f:cc:27:b8:
++ a3:8b:8c:f3:d8:29:1f:25:0b:f5:46:06:1b:ca:02:
++ 45:ad:7b:76:0a:9c:bf:bb:b9:ae:0d:16:ab:60:75:
++ ae:06:3e:9c:7c:31:dc:92:2f:29:1a:e0:4b:0c:91:
++ 90:6c:e9:37:c5:90:d7:2a:d7:97:15:a3:80:8f:5d:
++ 7b:49:8f:54:30:d4:97:2c:1c:5b:37:b5:ab:69:30:
++ 68:43:d3:33:78:4b:02:60:f5:3c:44:80:a1:8f:e7:
++ f0:0f:d1:5e:87:9e:46:cf:62:fc:f9:bf:0c:65:12:
++ f1:93:c8:35:79:3f:c8:ec:ec:47:f5:ef:be:44:d5:
++ ae:82:1e:2d:9a:9f:98:5a:67:65:e1:74:70:7c:cb:
++ d3:c2:ce:0e:45:49:27:dc:e3:2d:d4:fb:48:0e:2f:
++ 9e:77:b8:14:46:c0:c4:36:ca:02:ae:6a:91:8c:da:
++ 2f:85
++ Exponent: 65537 (0x10001)
++ X509v3 extensions:
++ X509v3 Basic Constraints: critical
++ CA:FALSE
++ X509v3 Subject Key Identifier:
++ 88:5A:55:C0:52:FF:61:CD:52:A3:35:0F:EA:5A:9C:24:38:22:F7:5C
++ X509v3 Key Usage:
++ Digital Signature, Non Repudiation, Key Encipherment
++ X509v3 Subject Alternative Name:
++ *************************************************************
++ WARNING: The values for DNS, email and URI are WRONG. OpenSSL
++ doesn't print the text after a NULL byte.
++ *************************************************************
++
DNS:altnull.python.org, email:null@python.org,
URI:http://null.python.org, IP Address:192.0.2.1, IP Address:2001:DB8:0:0:0:0:0:1
++ Signature Algorithm: sha1WithRSAEncryption
++ ac:4f:45:ef:7d:49:a8:21:70:8e:88:59:3e:d4:36:42:70:f5:
++ a3:bd:8b:d7:a8:d0:58:f6:31:4a:b1:a4:a6:dd:6f:d9:e8:44:
++ 3c:b6:0a:71:d6:7f:b1:08:61:9d:60:ce:75:cf:77:0c:d2:37:
++ 86:02:8d:5e:5d:f9:0f:71:b4:16:a8:c1:3d:23:1c:f1:11:b3:
++ 56:6e:ca:d0:8d:34:94:e6:87:2a:99:f2:ae:ae:cc:c2:e8:86:
++ de:08:a8:7f:c5:05:fa:6f:81:a7:82:e6:d0:53:9d:34:f4:ac:
++ 3e:40:fe:89:57:7a:29:a4:91:7e:0b:c6:51:31:e5:10:2f:a4:
++ 60:76:cd:95:51:1a:be:8b:a1:b0:fd:ad:52:bd:d7:1b:87:60:
++ d2:31:c7:17:c4:18:4f:2d:08:25:a3:a7:4f:b7:92:ca:e2:f5:
++ 25:f1:54:75:81:9d:b3:3d:61:a2:f7:da:ed:e1:c6:6f:2c:60:
++ 1f:d8:6f:c5:92:05:ab:c9:09:62:49:a9:14:ad:55:11:cc:d6:
++ 4a:19:94:99:97:37:1d:81:5f:8b:cf:a3:a8:96:44:51:08:3d:
++ 0b:05:65:12:eb:b6:70:80:88:48:72:4f:c6:c2:da:cf:cd:8e:
++ 5b:ba:97:2f:60:b4:96:56:49:5e:3a:43:76:63:04:be:2a:f6:
++ c1:ca:a9:94
++-----BEGIN CERTIFICATE-----
++MIIE2DCCA8CgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBxTELMAkGA1UEBhMCVVMx
++DzANBgNVBAgMBk9yZWdvbjESMBAGA1UEBwwJQmVhdmVydG9uMSMwIQYDVQQKDBpQ
++eXRob24gU29mdHdhcmUgRm91bmRhdGlvbjEgMB4GA1UECwwXUHl0aG9uIENvcmUg
++RGV2ZWxvcG1lbnQxJDAiBgNVBAMMG251bGwucHl0aG9uLm9yZwBleGFtcGxlLm9y
++ZzEkMCIGCSqGSIb3DQEJARYVcHl0aG9uLWRldkBweXRob24ub3JnMB4XDTEzMDgw
++NzEzMTE1MloXDTEzMDgwNzEzMTI1MlowgcUxCzAJBgNVBAYTAlVTMQ8wDQYDVQQI
++DAZPcmVnb24xEjAQBgNVBAcMCUJlYXZlcnRvbjEjMCEGA1UECgwaUHl0aG9uIFNv
++ZnR3YXJlIEZvdW5kYXRpb24xIDAeBgNVBAsMF1B5dGhvbiBDb3JlIERldmVsb3Bt
++ZW50MSQwIgYDVQQDDBtudWxsLnB5dGhvbi5vcmcAZXhhbXBsZS5vcmcxJDAiBgkq
++hkiG9w0BCQEWFXB5dGhvbi1kZXZAcHl0aG9uLm9yZzCCASIwDQYJKoZIhvcNAQEB
++BQADggEPADCCAQoCggEBALXq7cn7Rn1vO3aA3TrzA5QLp6bb7B3f/yN0CJ2XFj+j
++pHs+Gw6WWSUDpybiiKnPec33BFawq3kyblnBMjBU61ioy5HwQqVkJ8vUVjGIUq3P
++vX/wBmQfzCe4o4uM89gpHyUL9UYGG8oCRa17dgqcv7u5rg0Wq2B1rgY+nHwx3JIv
++KRrgSwyRkGzpN8WQ1yrXlxWjgI9de0mPVDDUlywcWze1q2kwaEPTM3hLAmD1PESA
++oY/n8A/RXoeeRs9i/Pm/DGUS8ZPINXk/yOzsR/XvvkTVroIeLZqfmFpnZeF0cHzL
++08LODkVJJ9zjLdT7SA4vnne4FEbAxDbKAq5qkYzaL4UCAwEAAaOB0DCBzTAMBgNV
++HRMBAf8EAjAAMB0GA1UdDgQWBBSIWlXAUv9hzVKjNQ/qWpwkOCL3XDALBgNVHQ8E
++BAMCBeAwgZAGA1UdEQSBiDCBhYIeYWx0bnVsbC5weXRob24ub3JnAGV4YW1wbGUu
++Y29tgSBudWxsQHB5dGhvbi5vcmcAdXNlckBleGFtcGxlLm9yZ4YpaHR0cDovL251
++bGwucHl0aG9uLm9yZwBodHRwOi8vZXhhbXBsZS5vcmeHBMAAAgGHECABDbgAAAAA
++AAAAAAAAAAEwDQYJKoZIhvcNAQEFBQADggEBAKxPRe99SaghcI6IWT7UNkJw9aO9
++i9eo0Fj2MUqxpKbdb9noRDy2CnHWf7EIYZ1gznXPdwzSN4YCjV5d+Q9xtBaowT0j
++HPERs1ZuytCNNJTmhyqZ8q6uzMLoht4IqH/FBfpvgaeC5tBTnTT0rD5A/olXeimk
++kX4LxlEx5RAvpGB2zZVRGr6LobD9rVK91xuHYNIxxxfEGE8tCCWjp0+3ksri9SXx
++VHWBnbM9YaL32u3hxm8sYB/Yb8WSBavJCWJJqRStVRHM1koZlJmXNx2BX4vPo6iW
++RFEIPQsFZRLrtnCAiEhyT8bC2s/Njlu6ly9gtJZWSV46Q3ZjBL4q9sHKqZQ=
++-----END CERTIFICATE-----
+diff -r 9ddc63c039ba Lib/test/test_ssl.py
+--- a/Lib/test/test_ssl.py Sun Aug 11 13:04:50 2013 +0300
++++ b/Lib/test/test_ssl.py Sun Aug 11 18:13:17 2013 +0200
+@@ -25,6 +25,7 @@
+ HOST = test_support.HOST
+ CERTFILE = None
+ SVN_PYTHON_ORG_ROOT_CERT = None
++NULLBYTECERT = None
+
+ def handle_error(prefix):
+ exc_format = ' '.join(traceback.format_exception(*sys.exc_info()))
+@@ -123,6 +124,27 @@
+ ('DNS', 'projects.forum.nokia.com'))
+ )
+
++ def test_parse_cert_CVE_2013_4073(self):
++ p = ssl._ssl._test_decode_cert(NULLBYTECERT)
++ if test_support.verbose:
++ sys.stdout.write("\n" + pprint.pformat(p) + "\n")
++ subject = ((('countryName', 'US'),),
++ (('stateOrProvinceName', 'Oregon'),),
++ (('localityName', 'Beaverton'),),
++ (('organizationName', 'Python Software
Foundation'),),
++ (('organizationalUnitName', 'Python Core
Development'),),
++ (('commonName', 'null.python.org\x00example.org'),),
++ (('emailAddress', 'python-dev(a)python.org'),))
++ self.assertEqual(p['subject'], subject)
++ self.assertEqual(p['issuer'], subject)
++ self.assertEqual(p['subjectAltName'],
++ (('DNS', 'altnull.python.org\x00example.com'),
++ ('email',
'null@python.org\x00user(a)example.org'),
++ ('URI',
'http://null.python.org\x00http://example.org'),
++ ('IP Address', '192.0.2.1'),
++ ('IP Address', '2001:DB8:0:0:0:0:0:1\n'))
++ )
++
+ def test_DER_to_PEM(self):
+ with open(SVN_PYTHON_ORG_ROOT_CERT, 'r') as f:
+ pem = f.read()
+@@ -1360,7 +1382,7 @@
+
+
+ def test_main(verbose=False):
+- global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, NOKIACERT
++ global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, NOKIACERT, NULLBYTECERT
+ CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir,
+ "keycert.pem")
+ SVN_PYTHON_ORG_ROOT_CERT = os.path.join(
+@@ -1368,10 +1390,13 @@
+ "https_svn_python_org_root.pem")
+ NOKIACERT = os.path.join(os.path.dirname(__file__) or os.curdir,
+ "nokia.pem")
++ NULLBYTECERT = os.path.join(os.path.dirname(__file__) or os.curdir,
++ "nullbytecert.pem")
+
+ if (not os.path.exists(CERTFILE) or
+ not os.path.exists(SVN_PYTHON_ORG_ROOT_CERT) or
+- not os.path.exists(NOKIACERT)):
++ not os.path.exists(NOKIACERT) or
++ not os.path.exists(NULLBYTECERT)):
+ raise test_support.TestFailed("Can't read certificate files!")
+
+ tests = [BasicTests, BasicSocketTests]
+diff -r 9ddc63c039ba Modules/_ssl.c
+--- a/Modules/_ssl.c Sun Aug 11 13:04:50 2013 +0300
++++ b/Modules/_ssl.c Sun Aug 11 18:13:17 2013 +0200
+@@ -741,8 +741,13 @@
+
+ /* get a rendering of each name in the set of names */
+
++ int gntype;
++ ASN1_STRING *as = NULL;
++
+ name = sk_GENERAL_NAME_value(names, j);
+- if (name->type == GEN_DIRNAME) {
++ gntype = name-> type;
++ switch (gntype) {
++ case GEN_DIRNAME:
+
+ /* we special-case DirName as a tuple of tuples of attributes */
+
+@@ -764,11 +769,61 @@
+ goto fail;
+ }
+ PyTuple_SET_ITEM(t, 1, v);
++ break;
+
+- } else {
++ case GEN_EMAIL:
++ case GEN_DNS:
++ case GEN_URI:
++ /* GENERAL_NAME_print() doesn't handle NUL bytes in ASN1_string
++ correctly. */
++ t = PyTuple_New(2);
++ if (t == NULL)
++ goto fail;
++ switch (gntype) {
++ case GEN_EMAIL:
++ v = PyUnicode_FromString("email");
++ as = name->d.rfc822Name;
++ break;
++ case GEN_DNS:
++ v = PyUnicode_FromString("DNS");
++ as = name->d.dNSName;
++ break;
++ case GEN_URI:
++ v = PyUnicode_FromString("URI");
++ as = name->d.uniformResourceIdentifier;
++ break;
++ }
++ if (v == NULL) {
++ Py_DECREF(t);
++ goto fail;
++ }
++ PyTuple_SET_ITEM(t, 0, v);
++ v = PyString_FromStringAndSize((char *)ASN1_STRING_data(as),
++ ASN1_STRING_length(as));
++ if (v == NULL) {
++ Py_DECREF(t);
++ goto fail;
++ }
++ PyTuple_SET_ITEM(t, 1, v);
++ break;
+
++ default:
+ /* for everything else, we use the OpenSSL print form */
+-
++ switch (gntype) {
++ /* check for new general name type */
++ case GEN_OTHERNAME:
++ case GEN_X400:
++ case GEN_EDIPARTY:
++ case GEN_IPADD:
++ case GEN_RID:
++ break;
++ default:
++ if (PyErr_Warn(PyExc_RuntimeWarning,
++ "Unknown general name type") == -1) {
++ goto fail;
++ }
++ break;
++ }
+ (void) BIO_reset(biobuf);
+ GENERAL_NAME_print(biobuf, name);
+ len = BIO_gets(biobuf, buf, sizeof(buf)-1);
+@@ -794,6 +849,7 @@
+ goto fail;
+ }
+ PyTuple_SET_ITEM(t, 1, v);
++ break;
+ }
+
+ /* and add that rendering to the list */
diff --git a/python.spec b/python.spec
index 3992888..3953bcf 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.5
-Release: 4%{?dist}
+Release: 5%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -822,6 +822,12 @@ Patch181: 00181-allow-arbitrary-timeout-in-condition-wait.patch
# We patch this by also accepting "#define ffi_wrapper_h"
Patch184: 00184-ctypes-should-build-with-libffi-multilib-wrapper.patch
+# 00185 #
+# Fix for CVE-2013-4238 --
+# SSL module fails to handle NULL bytes inside subjectAltNames general names
(CVE-2013-4238)
+#
http://bugs.python.org/issue18709
+# rhbz#998430
+Patch185: 00185-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch
# (New patches go here ^^^)
#
@@ -1174,6 +1180,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
# 00182: not for python 2
# 00183: not for python 2
%patch184 -p1
+%patch185 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -2003,6 +2010,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Mon Aug 19 2013 Matej Stuchlik <mstuchli(a)redhat.com> - 2.7.5-5
+- Added fix for CVE-2013-4238 (rhbz#998430)
+
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.7.5-4
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
commit 3fcf68f0db397a97e56e5c13d29f75fafc71cf2a
Author: Dennis Gilmore <dennis(a)ausil.us>
Date: Sun Aug 4 01:10:51 2013 -0500
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
diff --git a/python.spec b/python.spec
index 51eb7d7..3992888 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.5
-Release: 3%{?dist}
+Release: 4%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -2003,6 +2003,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Sun Aug 04 2013 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.7.5-4
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
+
* Mon Jul 08 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-3
- Fix build with libffi containing multilib wrapper for ffi.h (rhbz#979696).
commit 7d2a68252b21bbf51849cf4617ccde698d31a689
Merge: 1526d92 dfec9da
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Mon Jul 8 11:38:19 2013 +0200
Merge branch 'master' into f19
Conflicts:
python.spec
commit dfec9da098a0748a38a7babae63facffd68f448d
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Mon Jul 8 10:36:47 2013 +0200
Fix build with libffi containing multilib wrapper for ffi.h (rhbz#979696).
diff --git a/00184-ctypes-should-build-with-libffi-multilib-wrapper.patch
b/00184-ctypes-should-build-with-libffi-multilib-wrapper.patch
new file mode 100644
index 0000000..53d9dae
--- /dev/null
+++ b/00184-ctypes-should-build-with-libffi-multilib-wrapper.patch
@@ -0,0 +1,12 @@
+--- Python-3.3.2/setup.py.orig 2013-07-01 15:23:24.377711044 +0200
++++ Python-3.3.2/setup.py 2013-07-01 15:23:34.094676496 +0200
+@@ -1882,7 +1882,8 @@
+ if not line:
+ ffi_inc = None
+ break
+- if line.startswith('#define LIBFFI_H'):
++ if line.startswith('#define LIBFFI_H') or \
++ line.startswith('#define ffi_wrapper_h'):
+ break
+ ffi_lib = None
+ if ffi_inc is not None:
diff --git a/python.spec b/python.spec
index a1ddcb0..51eb7d7 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.5
-Release: 2%{?dist}
+Release: 3%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -806,6 +806,22 @@ Patch180: 00180-python-add-support-for-ppc64p7.patch
# Doesn't apply to Python 3, where this is fixed otherwise and works.
Patch181: 00181-allow-arbitrary-timeout-in-condition-wait.patch
+# 00182 #
+# python3.spec had
+# Patch182: 00182-fix-test_gdb-test_threads.patch
+
+# 00183 #
+# python3.spec has
+# Patch183: 00183-cve-2013-2099-fix-ssl-match_hostname-dos.patch
+
+# 00184 #
+# Fix for
https://bugzilla.redhat.com/show_bug.cgi?id=979696
+# Fixes build of ctypes against libffi with multilib wrapper
+# Python recognizes ffi.h only if it contains "#define LIBFFI_H",
+# but the wrapper doesn't contain that, which makes the build fail
+# We patch this by also accepting "#define ffi_wrapper_h"
+Patch184: 00184-ctypes-should-build-with-libffi-multilib-wrapper.patch
+
# (New patches go here ^^^)
#
@@ -1155,6 +1171,9 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
# 00179: not for python 2
%patch180 -p1
%patch181 -p1
+# 00182: not for python 2
+# 00183: not for python 2
+%patch184 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -1984,6 +2003,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Mon Jul 08 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-3
+- Fix build with libffi containing multilib wrapper for ffi.h (rhbz#979696).
+
* Mon Jul 08 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-2
- Obsolete PyXML as requested in rhbz#981137.
commit 337742430d40a0045f0ff1371d3b03e7a266bb6b
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Mon Jul 8 09:48:59 2013 +0200
Obsolete PyXML as requested in rhbz#981137.
diff --git a/python.spec b/python.spec
index c80aefc..a1ddcb0 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.5
-Release: 1%{?dist}
+Release: 2%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -850,6 +850,9 @@ Obsoletes: python-hashlib < 20081120
Provides: python-hashlib = 20081120
Obsoletes: python-uuid < 1.31
Provides: python-uuid = 1.31
+# obsolete, not provide PyXML as proposed in feature
+#
https://fedoraproject.org/wiki/Features/RemovePyXML#How_To_Test
+Obsoletes: PyXML <= 0.8.4-29
# python-sqlite2-2.3.5-5.fc18 was retired. Obsolete the old package here
# so it gets uninstalled on updates
@@ -1981,6 +1984,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Mon Jul 08 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-2
+- Obsolete PyXML as requested in rhbz#981137.
+
* Thu May 16 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-1
- Updated to Python 2.7.5.
- Refreshed patches: 0 (config), 102 (lib64), 121 (add Modules to build path),
commit 1526d92d52afeab6745c93272433b847e5c9f5f8
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Thu May 16 15:15:46 2013 +0200
Updated to Python 2.7.5.
- Refreshed patches: 0 (config), 102 (lib64), 121 (add Modules to build path),
153 (gdb test noise)
- Dropped patches: 126, 127 (big endian issues, both fixed upstream),
175 (configure -Wformat, fixed upstream)
- Synced patch numbers with python3.spec.
diff --git a/00121-add-Modules-to-build-path.patch
b/00121-add-Modules-to-build-path.patch
new file mode 100644
index 0000000..6e3294d
--- /dev/null
+++ b/00121-add-Modules-to-build-path.patch
@@ -0,0 +1,13 @@
+--- Python-2.7.5/Lib/site.py.orig 2013-05-16 12:47:55.000000000 +0200
++++ Python-2.7.5/Lib/site.py 2013-05-16 12:56:20.089058109 +0200
+@@ -529,6 +529,10 @@ def main():
+
+ abs__file__()
+ known_paths = removeduppaths()
++ from sysconfig import is_python_build
++ if is_python_build():
++ from _sysconfigdata import build_time_vars
++ sys.path.append(os.path.join(build_time_vars['abs_builddir'],
'Modules'))
+ if ENABLE_USER_SITE is None:
+ ENABLE_USER_SITE = check_enableusersite()
+ known_paths = addusersitepackages(known_paths)
diff --git a/00121-revert-r79310.patch b/00121-revert-r79310.patch
deleted file mode 100644
index 02b0d47..0000000
--- a/00121-revert-r79310.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -up Python-2.7.3/Lib/site.py.00121 Python-2.7.3/Lib/site.py
---- Python-2.7.3/Lib/site.py.00121 2013-02-19 14:07:19.156978291 -0500
-+++ Python-2.7.3/Lib/site.py 2013-02-19 14:07:19.233978288 -0500
-@@ -123,7 +123,7 @@ def addbuilddir():
- s = "build/lib.%s-%.3s" % (get_platform(), sys.version)
- if hasattr(sys, 'gettotalrefcount'):
- s += '-pydebug'
-- s = os.path.join(os.path.dirname(sys.path.pop()), s)
-+ s = os.path.join(os.path.dirname(sys.path[-1]), s)
- sys.path.append(s)
-
-
-diff -up Python-2.7.3/Misc/NEWS.00121 Python-2.7.3/Misc/NEWS
diff --git a/00153-fix-test_gdb-noise.patch b/00153-fix-test_gdb-noise.patch
index 0495d95..50a0917 100644
--- a/00153-fix-test_gdb-noise.patch
+++ b/00153-fix-test_gdb-noise.patch
@@ -16,20 +16,16 @@
'run']
if cmds_after_breakpoint:
commands += cmds_after_breakpoint
-@@ -135,8 +144,16 @@ class DebuggerTests(unittest.TestCase):
- 'Do you need "set solib-search-path" or '
- '"set sysroot"?\n',
- '')
-+ err = '\n'.join([line
-+ for line in err.splitlines()
-+ if not line.startswith('warning: Unable to open')
-+ if not line.startswith('Missing separate debuginfo
for')
-+ if not line.startswith('Try: yum --disablerepo=')
-+ # In case 'set print entry-values no' failed:
-+ if not line.startswith('Undefined set print
command')])
-
- # Ensure no unexpected error messages:
-+ self.maxDiff = None
- self.assertEqual(err, '')
-
- return out
+--- Lib/test/test_gdb.py.old 2012-04-11 21:04:01.367073855 -0400
++++ Lib/test/test_gdb.py 2012-04-12 08:52:58.320288761 -0400
+@@ -144,6 +153,10 @@
+ 'Do you need "set solib-search-path" or '
+ '"set sysroot"?',
+ )
++ ignore_patterns += ('warning: Unable to open',
++ 'Missing separate debuginfo for',
++ 'Try: yum --disablerepo=',
++ 'Undefined set print command')
+ for line in errlines:
+ if not line.startswith(ignore_patterns):
+ unexpected_errlines.append(line)
diff --git a/00176-allow-arbitrary-timeout-in-condition-wait.patch
b/00176-allow-arbitrary-timeout-in-condition-wait.patch
deleted file mode 100644
index 665965d..0000000
--- a/00176-allow-arbitrary-timeout-in-condition-wait.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-diff --git a/Lib/threading.py b/Lib/threading.py
-index cb49c4a..c9795a5 100644
---- a/Lib/threading.py
-+++ b/Lib/threading.py
-@@ -305,7 +305,7 @@ class _Condition(_Verbose):
- else:
- return True
-
-- def wait(self, timeout=None):
-+ def wait(self, timeout=None, balancing=True):
- """Wait until notified or until a timeout occurs.
-
- If the calling thread has not acquired the lock when this method is
-@@ -354,7 +354,10 @@ class _Condition(_Verbose):
- remaining = endtime - _time()
- if remaining <= 0:
- break
-- delay = min(delay * 2, remaining, .05)
-+ if balancing:
-+ delay = min(delay * 2, remaining, 0.05)
-+ else:
-+ delay = remaining
- _sleep(delay)
- if not gotit:
- if __debug__:
-@@ -599,7 +602,7 @@ class _Event(_Verbose):
- finally:
- self.__cond.release()
-
-- def wait(self, timeout=None):
-+ def wait(self, timeout=None, balancing=True):
- """Block until the internal flag is true.
-
- If the internal flag is true on entry, return immediately. Otherwise,
-@@ -617,7 +620,7 @@ class _Event(_Verbose):
- self.__cond.acquire()
- try:
- if not self.__flag:
-- self.__cond.wait(timeout)
-+ self.__cond.wait(timeout, balancing)
- return self.__flag
- finally:
- self.__cond.release()
-@@ -908,7 +911,7 @@ class Thread(_Verbose):
- if 'dummy_threading' not in _sys.modules:
- raise
-
-- def join(self, timeout=None):
-+ def join(self, timeout=None, balancing=True):
- """Wait until the thread terminates.
-
- This blocks the calling thread until the thread whose join() method is
-@@ -957,7 +960,7 @@ class Thread(_Verbose):
- if __debug__:
- self._note("%s.join(): timed out", self)
- break
-- self.__block.wait(delay)
-+ self.__block.wait(delay, balancing)
- else:
- if __debug__:
- self._note("%s.join(): thread stopped", self)
-@@ -1143,7 +1146,7 @@ class _DummyThread(Thread):
- def _set_daemon(self):
- return True
-
-- def join(self, timeout=None):
-+ def join(self, timeout=None, balancing=True):
- assert False, "cannot join a dummy thread"
-
-
diff --git a/00177-python-add-support-for-ppc64p7.patch
b/00177-python-add-support-for-ppc64p7.patch
deleted file mode 100644
index 022944a..0000000
--- a/00177-python-add-support-for-ppc64p7.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -r de35eae9048a config.sub
---- a/config.sub Wed Apr 24 23:33:20 2013 +0200
-+++ b/config.sub Thu Apr 25 08:51:00 2013 +0200
-@@ -1008,7 +1008,7 @@
- ;;
- ppc64) basic_machine=powerpc64-unknown
- ;;
-- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
-+ ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed
's/^[^-]*-//'`
- ;;
- ppc64le | powerpc64little | ppc64-le | powerpc64-little)
- basic_machine=powerpc64le-unknown
diff --git a/00180-python-add-support-for-ppc64p7.patch
b/00180-python-add-support-for-ppc64p7.patch
new file mode 100644
index 0000000..022944a
--- /dev/null
+++ b/00180-python-add-support-for-ppc64p7.patch
@@ -0,0 +1,12 @@
+diff -r de35eae9048a config.sub
+--- a/config.sub Wed Apr 24 23:33:20 2013 +0200
++++ b/config.sub Thu Apr 25 08:51:00 2013 +0200
+@@ -1008,7 +1008,7 @@
+ ;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed
's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
diff --git a/00181-allow-arbitrary-timeout-in-condition-wait.patch
b/00181-allow-arbitrary-timeout-in-condition-wait.patch
new file mode 100644
index 0000000..665965d
--- /dev/null
+++ b/00181-allow-arbitrary-timeout-in-condition-wait.patch
@@ -0,0 +1,70 @@
+diff --git a/Lib/threading.py b/Lib/threading.py
+index cb49c4a..c9795a5 100644
+--- a/Lib/threading.py
++++ b/Lib/threading.py
+@@ -305,7 +305,7 @@ class _Condition(_Verbose):
+ else:
+ return True
+
+- def wait(self, timeout=None):
++ def wait(self, timeout=None, balancing=True):
+ """Wait until notified or until a timeout occurs.
+
+ If the calling thread has not acquired the lock when this method is
+@@ -354,7 +354,10 @@ class _Condition(_Verbose):
+ remaining = endtime - _time()
+ if remaining <= 0:
+ break
+- delay = min(delay * 2, remaining, .05)
++ if balancing:
++ delay = min(delay * 2, remaining, 0.05)
++ else:
++ delay = remaining
+ _sleep(delay)
+ if not gotit:
+ if __debug__:
+@@ -599,7 +602,7 @@ class _Event(_Verbose):
+ finally:
+ self.__cond.release()
+
+- def wait(self, timeout=None):
++ def wait(self, timeout=None, balancing=True):
+ """Block until the internal flag is true.
+
+ If the internal flag is true on entry, return immediately. Otherwise,
+@@ -617,7 +620,7 @@ class _Event(_Verbose):
+ self.__cond.acquire()
+ try:
+ if not self.__flag:
+- self.__cond.wait(timeout)
++ self.__cond.wait(timeout, balancing)
+ return self.__flag
+ finally:
+ self.__cond.release()
+@@ -908,7 +911,7 @@ class Thread(_Verbose):
+ if 'dummy_threading' not in _sys.modules:
+ raise
+
+- def join(self, timeout=None):
++ def join(self, timeout=None, balancing=True):
+ """Wait until the thread terminates.
+
+ This blocks the calling thread until the thread whose join() method is
+@@ -957,7 +960,7 @@ class Thread(_Verbose):
+ if __debug__:
+ self._note("%s.join(): timed out", self)
+ break
+- self.__block.wait(delay)
++ self.__block.wait(delay, balancing)
+ else:
+ if __debug__:
+ self._note("%s.join(): thread stopped", self)
+@@ -1143,7 +1146,7 @@ class _DummyThread(Thread):
+ def _set_daemon(self):
+ return True
+
+- def join(self, timeout=None):
++ def join(self, timeout=None, balancing=True):
+ assert False, "cannot join a dummy thread"
+
+
diff --git a/05000-autotool-intermediates.patch b/05000-autotool-intermediates.patch
index 4a40a56..cfedc25 100644
--- a/05000-autotool-intermediates.patch
+++ b/05000-autotool-intermediates.patch
@@ -87,15 +87,6 @@ diff -up ./configure.autotool-intermediates ./configure
# XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
# merged with this chunk of code?
-@@ -6253,7 +6271,7 @@ then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc supports ParseTuple
__format__" >&5
- $as_echo_n "checking whether gcc supports ParseTuple __format__... "
>&6; }
- save_CFLAGS=$CFLAGS
-- CFLAGS="$CFLAGS -Werror"
-+ CFLAGS="$CFLAGS -Werror -Wformat"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
-
@@ -9958,6 +9976,50 @@ $as_echo "no" >&6; }
fi
diff --git a/python-2.7.1-config.patch b/python-2.7.1-config.patch
index 7815d15..6976d5c 100644
--- a/python-2.7.1-config.patch
+++ b/python-2.7.1-config.patch
@@ -9,7 +9,7 @@
# GNU readline. Unlike previous Python incarnations, GNU readline is
# now incorporated in an optional module, configured in the Setup file
-@@ -163,74 +163,74 @@ GLHACK=-Dclear=__GLclear
+@@ -163,77 +163,77 @@ GLHACK=-Dclear=__GLclear
# it, depending on your system -- see the GNU readline instructions.
# It's okay for this to be a shared library, too.
@@ -57,6 +57,9 @@
-#_locale _localemodule.c # -lintl
+_locale _localemodule.c # -lintl
+ # Standard I/O baseline
+ #_io -I$(srcdir)/Modules/_io _io/bufferedio.c _io/bytesio.c _io/fileio.c _io/iobase.c
_io/_iomodule.c _io/stringio.c _io/textio.c
+
# Modules with some UNIX dependencies -- on by default:
# (If you have a really backward UNIX, select and socket may not be
@@ -80,7 +83,7 @@
+_csv _csv.c
# Socket module helper for socket(2)
--#_socket socketmodule.c
+-#_socket socketmodule.c timemodule.c
+_socket socketmodule.c timemodule.c
# Socket module helper for SSL support; you must comment out the other
diff --git a/python-2.7.3-lib64.patch b/python-2.7.3-lib64.patch
index 9578b7f..71f32c5 100644
--- a/python-2.7.3-lib64.patch
+++ b/python-2.7.3-lib64.patch
@@ -167,8 +167,8 @@ diff -up Python-2.7.3/setup.py.lib64 Python-2.7.3/setup.py
- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
+ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib64')
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+ self.add_gcc_paths()
self.add_multiarch_paths()
-
@@ -677,11 +677,11 @@ class PyBuildExt(build_ext):
elif curses_library:
readline_libs.append(curses_library)
diff --git a/python.spec b/python.spec
index d8cad9a..c80aefc 100644
--- a/python.spec
+++ b/python.spec
@@ -105,8 +105,8 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
# Remember to also rebase python-docs when changing this:
-Version: 2.7.4
-Release: 5%{?dist}
+Version: 2.7.5
+Release: 1%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -459,9 +459,8 @@ Patch114: 00114-statvfs-f_flag-constants.patch
# File
"/home/david/rpmbuild/BUILDROOT/python-2.7-0.1.rc2.fc14.x86_64/usr/lib64/python2.7/struct.py",
line 1, in <module>
# from _struct import *
# ImportError: No module named _struct
-#
-# For now, revert this patch:
-Patch121: 00121-revert-r79310.patch
+# This patch adds the build Modules directory to build path.
+Patch121: 00121-add-Modules-to-build-path.patch
# 00125 #
# COUNT_ALLOCS is useful for debugging, but the upstream behaviour of always
@@ -471,13 +470,11 @@ Patch121: 00121-revert-r79310.patch
# Not yet sent upstream
Patch125: 00125-less-verbose-COUNT_ALLOCS.patch
-# Fix dbm module on big-endian 64-bit
-# Sent upstream as
http://bugs.python.org/issue9687 (rhbz#626756)
-Patch126: fix-dbm_contains-on-64bit-bigendian.patch
+# Upstream as of Python 2.7.5
+# Patch126: fix-dbm_contains-on-64bit-bigendian.patch
-# Fix test_structmember on big-endian 64-bit
-# Sent upstream as
http://bugs.python.org/issue9960
-Patch127: fix-test_structmember-on-64bit-bigendian.patch
+# Upstream as of Python 2.7.5
+# Patch127: fix-test_structmember-on-64bit-bigendian.patch
# 2.7.1 (in r84230) added a test to test_abc which fails if python is
# configured with COUNT_ALLOCS, which is the case for our debug build
@@ -772,27 +769,42 @@ Patch173: 00173-workaround-ENOPROTOOPT-in-bind_port.patch
Patch174: 00174-fix-for-usr-move.patch
# 00175 #
-# Fix for configure.ac mistakenly detecting
-# checking whether gcc supports ParseTuple __format__... yes
-# when it doesn't, when compiling with gcc 4.8
-#
-# Sent upstream as
http://bugs.python.org/issue17547
-# (rhbz#927358)
-Patch175: 00175-fix-configure-Wformat.patch
+# Upstream as of Python 2.7.5
+# Patch175: 00175-fix-configure-Wformat.patch
# 00176 #
+# python3.spec had:
+# Patch176: 00176-upstream-issue16754-so-extension.patch
+# doesn't affect python2
+
+# 00177 #
+# python3.spec has
+# Patch177: 00177-platform-unicode.patch
+# Does not affect python2
+
+# 00178 #
+# python3.spec has
+# Patch178: 00178-dont-duplicate-flags-in-sysconfig.patch
+# Does not affect python2 AFAICS (different sysconfig values initialization)
+
+# 00179 #
+# python3.spec has
+# Patch179: 00179-dont-raise-error-on-gdb-corrupted-frames-in-backtrace.patch
+# Doesn't seem to affect python2
+
+# 00180 #
+# Enable building on ppc64p7
+# Not appropriate for upstream, Fedora-specific naming
+Patch180: 00180-python-add-support-for-ppc64p7.patch
+
+# 00181 #
# Allow arbitrary timeout for Condition.wait, as reported in
#
https://bugzilla.redhat.com/show_bug.cgi?id=917709
# Upstream doesn't want this:
http://bugs.python.org/issue17748
# But we have no better solution downstream yet, and since there is
# no API breakage, we apply this patch.
# Doesn't apply to Python 3, where this is fixed otherwise and works.
-Patch176: 00176-allow-arbitrary-timeout-in-condition-wait.patch
-
-# 00177 #
-# Enable building on ppc64p7
-# Not appropriate for upstream, Fedora-specific naming
-Patch177: 00177-python-add-support-for-ppc64p7.patch
+Patch181: 00181-allow-arbitrary-timeout-in-condition-wait.patch
# (New patches go here ^^^)
@@ -1074,8 +1086,8 @@ done
%patch121 -p1
%patch125 -p1 -b .less-verbose-COUNT_ALLOCS
-%patch126 -p0 -b .fix-dbm_contains-on-64bit-bigendian
-%patch127 -p1 -b .fix-test_structmember-on-64bit-bigendian
+# 00126: upstream as of Python 2.7.5
+# 00127: upstream as of Python 2.7.5
%patch128 -p1
%patch130 -p1
@@ -1133,9 +1145,13 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
# 00171: upstream as of Python 2.7.4
%patch173 -p1
%patch174 -p1 -b .fix-for-usr-move
-%patch175 -p1 -b .fix-configure-Wformat
-%patch176 -p1
-%patch177 -p1
+# 00175: upstream as of Python 2.7.5
+# 00176: not for python 2
+# 00177: not for python 2
+# 00178: not for python 2
+# 00179: not for python 2
+%patch180 -p1
+%patch181 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -1965,6 +1981,14 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu May 16 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-1
+- Updated to Python 2.7.5.
+- Refreshed patches: 0 (config), 102 (lib64), 121 (add Modules to build path),
+153 (gdb test noise)
+- Dropped patches: 126, 127 (big endian issues, both fixed upstream),
+175 (configure -Wformat, fixed upstream)
+- Synced patch numbers with python3.spec.
+
* Tue May 14 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.4-5
- fix multilib issue in python-tools due to /usr/bin/pynche (source 7;
rhbz#831437)
diff --git a/sources b/sources
index 5359ae4..ac5febc 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-86909785aa1ff13b49d87737b75b5f54 Python-2.7.4.tar.xz
+5eea8462f69ab1369d32f9c4cd6272ab Python-2.7.5.tar.xz
commit 7b42f48700ac0821a3dcafb0f5cf46e00e9cf6ee
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Thu May 16 15:15:46 2013 +0200
Updated to Python 2.7.5.
- Refreshed patches: 0 (config), 102 (lib64), 121 (add Modules to build path),
153 (gdb test noise)
- Dropped patches: 126, 127 (big endian issues, both fixed upstream),
175 (configure -Wformat, fixed upstream)
- Synced patch numbers with python3.spec.
diff --git a/00121-add-Modules-to-build-path.patch
b/00121-add-Modules-to-build-path.patch
new file mode 100644
index 0000000..6e3294d
--- /dev/null
+++ b/00121-add-Modules-to-build-path.patch
@@ -0,0 +1,13 @@
+--- Python-2.7.5/Lib/site.py.orig 2013-05-16 12:47:55.000000000 +0200
++++ Python-2.7.5/Lib/site.py 2013-05-16 12:56:20.089058109 +0200
+@@ -529,6 +529,10 @@ def main():
+
+ abs__file__()
+ known_paths = removeduppaths()
++ from sysconfig import is_python_build
++ if is_python_build():
++ from _sysconfigdata import build_time_vars
++ sys.path.append(os.path.join(build_time_vars['abs_builddir'],
'Modules'))
+ if ENABLE_USER_SITE is None:
+ ENABLE_USER_SITE = check_enableusersite()
+ known_paths = addusersitepackages(known_paths)
diff --git a/00121-revert-r79310.patch b/00121-revert-r79310.patch
deleted file mode 100644
index 02b0d47..0000000
--- a/00121-revert-r79310.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -up Python-2.7.3/Lib/site.py.00121 Python-2.7.3/Lib/site.py
---- Python-2.7.3/Lib/site.py.00121 2013-02-19 14:07:19.156978291 -0500
-+++ Python-2.7.3/Lib/site.py 2013-02-19 14:07:19.233978288 -0500
-@@ -123,7 +123,7 @@ def addbuilddir():
- s = "build/lib.%s-%.3s" % (get_platform(), sys.version)
- if hasattr(sys, 'gettotalrefcount'):
- s += '-pydebug'
-- s = os.path.join(os.path.dirname(sys.path.pop()), s)
-+ s = os.path.join(os.path.dirname(sys.path[-1]), s)
- sys.path.append(s)
-
-
-diff -up Python-2.7.3/Misc/NEWS.00121 Python-2.7.3/Misc/NEWS
diff --git a/00153-fix-test_gdb-noise.patch b/00153-fix-test_gdb-noise.patch
index 0495d95..50a0917 100644
--- a/00153-fix-test_gdb-noise.patch
+++ b/00153-fix-test_gdb-noise.patch
@@ -16,20 +16,16 @@
'run']
if cmds_after_breakpoint:
commands += cmds_after_breakpoint
-@@ -135,8 +144,16 @@ class DebuggerTests(unittest.TestCase):
- 'Do you need "set solib-search-path" or '
- '"set sysroot"?\n',
- '')
-+ err = '\n'.join([line
-+ for line in err.splitlines()
-+ if not line.startswith('warning: Unable to open')
-+ if not line.startswith('Missing separate debuginfo
for')
-+ if not line.startswith('Try: yum --disablerepo=')
-+ # In case 'set print entry-values no' failed:
-+ if not line.startswith('Undefined set print
command')])
-
- # Ensure no unexpected error messages:
-+ self.maxDiff = None
- self.assertEqual(err, '')
-
- return out
+--- Lib/test/test_gdb.py.old 2012-04-11 21:04:01.367073855 -0400
++++ Lib/test/test_gdb.py 2012-04-12 08:52:58.320288761 -0400
+@@ -144,6 +153,10 @@
+ 'Do you need "set solib-search-path" or '
+ '"set sysroot"?',
+ )
++ ignore_patterns += ('warning: Unable to open',
++ 'Missing separate debuginfo for',
++ 'Try: yum --disablerepo=',
++ 'Undefined set print command')
+ for line in errlines:
+ if not line.startswith(ignore_patterns):
+ unexpected_errlines.append(line)
diff --git a/00176-allow-arbitrary-timeout-in-condition-wait.patch
b/00176-allow-arbitrary-timeout-in-condition-wait.patch
deleted file mode 100644
index 665965d..0000000
--- a/00176-allow-arbitrary-timeout-in-condition-wait.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-diff --git a/Lib/threading.py b/Lib/threading.py
-index cb49c4a..c9795a5 100644
---- a/Lib/threading.py
-+++ b/Lib/threading.py
-@@ -305,7 +305,7 @@ class _Condition(_Verbose):
- else:
- return True
-
-- def wait(self, timeout=None):
-+ def wait(self, timeout=None, balancing=True):
- """Wait until notified or until a timeout occurs.
-
- If the calling thread has not acquired the lock when this method is
-@@ -354,7 +354,10 @@ class _Condition(_Verbose):
- remaining = endtime - _time()
- if remaining <= 0:
- break
-- delay = min(delay * 2, remaining, .05)
-+ if balancing:
-+ delay = min(delay * 2, remaining, 0.05)
-+ else:
-+ delay = remaining
- _sleep(delay)
- if not gotit:
- if __debug__:
-@@ -599,7 +602,7 @@ class _Event(_Verbose):
- finally:
- self.__cond.release()
-
-- def wait(self, timeout=None):
-+ def wait(self, timeout=None, balancing=True):
- """Block until the internal flag is true.
-
- If the internal flag is true on entry, return immediately. Otherwise,
-@@ -617,7 +620,7 @@ class _Event(_Verbose):
- self.__cond.acquire()
- try:
- if not self.__flag:
-- self.__cond.wait(timeout)
-+ self.__cond.wait(timeout, balancing)
- return self.__flag
- finally:
- self.__cond.release()
-@@ -908,7 +911,7 @@ class Thread(_Verbose):
- if 'dummy_threading' not in _sys.modules:
- raise
-
-- def join(self, timeout=None):
-+ def join(self, timeout=None, balancing=True):
- """Wait until the thread terminates.
-
- This blocks the calling thread until the thread whose join() method is
-@@ -957,7 +960,7 @@ class Thread(_Verbose):
- if __debug__:
- self._note("%s.join(): timed out", self)
- break
-- self.__block.wait(delay)
-+ self.__block.wait(delay, balancing)
- else:
- if __debug__:
- self._note("%s.join(): thread stopped", self)
-@@ -1143,7 +1146,7 @@ class _DummyThread(Thread):
- def _set_daemon(self):
- return True
-
-- def join(self, timeout=None):
-+ def join(self, timeout=None, balancing=True):
- assert False, "cannot join a dummy thread"
-
-
diff --git a/00177-python-add-support-for-ppc64p7.patch
b/00177-python-add-support-for-ppc64p7.patch
deleted file mode 100644
index 022944a..0000000
--- a/00177-python-add-support-for-ppc64p7.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -r de35eae9048a config.sub
---- a/config.sub Wed Apr 24 23:33:20 2013 +0200
-+++ b/config.sub Thu Apr 25 08:51:00 2013 +0200
-@@ -1008,7 +1008,7 @@
- ;;
- ppc64) basic_machine=powerpc64-unknown
- ;;
-- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
-+ ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed
's/^[^-]*-//'`
- ;;
- ppc64le | powerpc64little | ppc64-le | powerpc64-little)
- basic_machine=powerpc64le-unknown
diff --git a/00180-python-add-support-for-ppc64p7.patch
b/00180-python-add-support-for-ppc64p7.patch
new file mode 100644
index 0000000..022944a
--- /dev/null
+++ b/00180-python-add-support-for-ppc64p7.patch
@@ -0,0 +1,12 @@
+diff -r de35eae9048a config.sub
+--- a/config.sub Wed Apr 24 23:33:20 2013 +0200
++++ b/config.sub Thu Apr 25 08:51:00 2013 +0200
+@@ -1008,7 +1008,7 @@
+ ;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed
's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
diff --git a/00181-allow-arbitrary-timeout-in-condition-wait.patch
b/00181-allow-arbitrary-timeout-in-condition-wait.patch
new file mode 100644
index 0000000..665965d
--- /dev/null
+++ b/00181-allow-arbitrary-timeout-in-condition-wait.patch
@@ -0,0 +1,70 @@
+diff --git a/Lib/threading.py b/Lib/threading.py
+index cb49c4a..c9795a5 100644
+--- a/Lib/threading.py
++++ b/Lib/threading.py
+@@ -305,7 +305,7 @@ class _Condition(_Verbose):
+ else:
+ return True
+
+- def wait(self, timeout=None):
++ def wait(self, timeout=None, balancing=True):
+ """Wait until notified or until a timeout occurs.
+
+ If the calling thread has not acquired the lock when this method is
+@@ -354,7 +354,10 @@ class _Condition(_Verbose):
+ remaining = endtime - _time()
+ if remaining <= 0:
+ break
+- delay = min(delay * 2, remaining, .05)
++ if balancing:
++ delay = min(delay * 2, remaining, 0.05)
++ else:
++ delay = remaining
+ _sleep(delay)
+ if not gotit:
+ if __debug__:
+@@ -599,7 +602,7 @@ class _Event(_Verbose):
+ finally:
+ self.__cond.release()
+
+- def wait(self, timeout=None):
++ def wait(self, timeout=None, balancing=True):
+ """Block until the internal flag is true.
+
+ If the internal flag is true on entry, return immediately. Otherwise,
+@@ -617,7 +620,7 @@ class _Event(_Verbose):
+ self.__cond.acquire()
+ try:
+ if not self.__flag:
+- self.__cond.wait(timeout)
++ self.__cond.wait(timeout, balancing)
+ return self.__flag
+ finally:
+ self.__cond.release()
+@@ -908,7 +911,7 @@ class Thread(_Verbose):
+ if 'dummy_threading' not in _sys.modules:
+ raise
+
+- def join(self, timeout=None):
++ def join(self, timeout=None, balancing=True):
+ """Wait until the thread terminates.
+
+ This blocks the calling thread until the thread whose join() method is
+@@ -957,7 +960,7 @@ class Thread(_Verbose):
+ if __debug__:
+ self._note("%s.join(): timed out", self)
+ break
+- self.__block.wait(delay)
++ self.__block.wait(delay, balancing)
+ else:
+ if __debug__:
+ self._note("%s.join(): thread stopped", self)
+@@ -1143,7 +1146,7 @@ class _DummyThread(Thread):
+ def _set_daemon(self):
+ return True
+
+- def join(self, timeout=None):
++ def join(self, timeout=None, balancing=True):
+ assert False, "cannot join a dummy thread"
+
+
diff --git a/05000-autotool-intermediates.patch b/05000-autotool-intermediates.patch
index 4a40a56..cfedc25 100644
--- a/05000-autotool-intermediates.patch
+++ b/05000-autotool-intermediates.patch
@@ -87,15 +87,6 @@ diff -up ./configure.autotool-intermediates ./configure
# XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
# merged with this chunk of code?
-@@ -6253,7 +6271,7 @@ then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc supports ParseTuple
__format__" >&5
- $as_echo_n "checking whether gcc supports ParseTuple __format__... "
>&6; }
- save_CFLAGS=$CFLAGS
-- CFLAGS="$CFLAGS -Werror"
-+ CFLAGS="$CFLAGS -Werror -Wformat"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
-
@@ -9958,6 +9976,50 @@ $as_echo "no" >&6; }
fi
diff --git a/python-2.7.1-config.patch b/python-2.7.1-config.patch
index 7815d15..6976d5c 100644
--- a/python-2.7.1-config.patch
+++ b/python-2.7.1-config.patch
@@ -9,7 +9,7 @@
# GNU readline. Unlike previous Python incarnations, GNU readline is
# now incorporated in an optional module, configured in the Setup file
-@@ -163,74 +163,74 @@ GLHACK=-Dclear=__GLclear
+@@ -163,77 +163,77 @@ GLHACK=-Dclear=__GLclear
# it, depending on your system -- see the GNU readline instructions.
# It's okay for this to be a shared library, too.
@@ -57,6 +57,9 @@
-#_locale _localemodule.c # -lintl
+_locale _localemodule.c # -lintl
+ # Standard I/O baseline
+ #_io -I$(srcdir)/Modules/_io _io/bufferedio.c _io/bytesio.c _io/fileio.c _io/iobase.c
_io/_iomodule.c _io/stringio.c _io/textio.c
+
# Modules with some UNIX dependencies -- on by default:
# (If you have a really backward UNIX, select and socket may not be
@@ -80,7 +83,7 @@
+_csv _csv.c
# Socket module helper for socket(2)
--#_socket socketmodule.c
+-#_socket socketmodule.c timemodule.c
+_socket socketmodule.c timemodule.c
# Socket module helper for SSL support; you must comment out the other
diff --git a/python-2.7.3-lib64.patch b/python-2.7.3-lib64.patch
index 9578b7f..71f32c5 100644
--- a/python-2.7.3-lib64.patch
+++ b/python-2.7.3-lib64.patch
@@ -167,8 +167,8 @@ diff -up Python-2.7.3/setup.py.lib64 Python-2.7.3/setup.py
- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
+ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib64')
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+ self.add_gcc_paths()
self.add_multiarch_paths()
-
@@ -677,11 +677,11 @@ class PyBuildExt(build_ext):
elif curses_library:
readline_libs.append(curses_library)
diff --git a/python.spec b/python.spec
index d8cad9a..c80aefc 100644
--- a/python.spec
+++ b/python.spec
@@ -105,8 +105,8 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
# Remember to also rebase python-docs when changing this:
-Version: 2.7.4
-Release: 5%{?dist}
+Version: 2.7.5
+Release: 1%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -459,9 +459,8 @@ Patch114: 00114-statvfs-f_flag-constants.patch
# File
"/home/david/rpmbuild/BUILDROOT/python-2.7-0.1.rc2.fc14.x86_64/usr/lib64/python2.7/struct.py",
line 1, in <module>
# from _struct import *
# ImportError: No module named _struct
-#
-# For now, revert this patch:
-Patch121: 00121-revert-r79310.patch
+# This patch adds the build Modules directory to build path.
+Patch121: 00121-add-Modules-to-build-path.patch
# 00125 #
# COUNT_ALLOCS is useful for debugging, but the upstream behaviour of always
@@ -471,13 +470,11 @@ Patch121: 00121-revert-r79310.patch
# Not yet sent upstream
Patch125: 00125-less-verbose-COUNT_ALLOCS.patch
-# Fix dbm module on big-endian 64-bit
-# Sent upstream as
http://bugs.python.org/issue9687 (rhbz#626756)
-Patch126: fix-dbm_contains-on-64bit-bigendian.patch
+# Upstream as of Python 2.7.5
+# Patch126: fix-dbm_contains-on-64bit-bigendian.patch
-# Fix test_structmember on big-endian 64-bit
-# Sent upstream as
http://bugs.python.org/issue9960
-Patch127: fix-test_structmember-on-64bit-bigendian.patch
+# Upstream as of Python 2.7.5
+# Patch127: fix-test_structmember-on-64bit-bigendian.patch
# 2.7.1 (in r84230) added a test to test_abc which fails if python is
# configured with COUNT_ALLOCS, which is the case for our debug build
@@ -772,27 +769,42 @@ Patch173: 00173-workaround-ENOPROTOOPT-in-bind_port.patch
Patch174: 00174-fix-for-usr-move.patch
# 00175 #
-# Fix for configure.ac mistakenly detecting
-# checking whether gcc supports ParseTuple __format__... yes
-# when it doesn't, when compiling with gcc 4.8
-#
-# Sent upstream as
http://bugs.python.org/issue17547
-# (rhbz#927358)
-Patch175: 00175-fix-configure-Wformat.patch
+# Upstream as of Python 2.7.5
+# Patch175: 00175-fix-configure-Wformat.patch
# 00176 #
+# python3.spec had:
+# Patch176: 00176-upstream-issue16754-so-extension.patch
+# doesn't affect python2
+
+# 00177 #
+# python3.spec has
+# Patch177: 00177-platform-unicode.patch
+# Does not affect python2
+
+# 00178 #
+# python3.spec has
+# Patch178: 00178-dont-duplicate-flags-in-sysconfig.patch
+# Does not affect python2 AFAICS (different sysconfig values initialization)
+
+# 00179 #
+# python3.spec has
+# Patch179: 00179-dont-raise-error-on-gdb-corrupted-frames-in-backtrace.patch
+# Doesn't seem to affect python2
+
+# 00180 #
+# Enable building on ppc64p7
+# Not appropriate for upstream, Fedora-specific naming
+Patch180: 00180-python-add-support-for-ppc64p7.patch
+
+# 00181 #
# Allow arbitrary timeout for Condition.wait, as reported in
#
https://bugzilla.redhat.com/show_bug.cgi?id=917709
# Upstream doesn't want this:
http://bugs.python.org/issue17748
# But we have no better solution downstream yet, and since there is
# no API breakage, we apply this patch.
# Doesn't apply to Python 3, where this is fixed otherwise and works.
-Patch176: 00176-allow-arbitrary-timeout-in-condition-wait.patch
-
-# 00177 #
-# Enable building on ppc64p7
-# Not appropriate for upstream, Fedora-specific naming
-Patch177: 00177-python-add-support-for-ppc64p7.patch
+Patch181: 00181-allow-arbitrary-timeout-in-condition-wait.patch
# (New patches go here ^^^)
@@ -1074,8 +1086,8 @@ done
%patch121 -p1
%patch125 -p1 -b .less-verbose-COUNT_ALLOCS
-%patch126 -p0 -b .fix-dbm_contains-on-64bit-bigendian
-%patch127 -p1 -b .fix-test_structmember-on-64bit-bigendian
+# 00126: upstream as of Python 2.7.5
+# 00127: upstream as of Python 2.7.5
%patch128 -p1
%patch130 -p1
@@ -1133,9 +1145,13 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
# 00171: upstream as of Python 2.7.4
%patch173 -p1
%patch174 -p1 -b .fix-for-usr-move
-%patch175 -p1 -b .fix-configure-Wformat
-%patch176 -p1
-%patch177 -p1
+# 00175: upstream as of Python 2.7.5
+# 00176: not for python 2
+# 00177: not for python 2
+# 00178: not for python 2
+# 00179: not for python 2
+%patch180 -p1
+%patch181 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -1965,6 +1981,14 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu May 16 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.5-1
+- Updated to Python 2.7.5.
+- Refreshed patches: 0 (config), 102 (lib64), 121 (add Modules to build path),
+153 (gdb test noise)
+- Dropped patches: 126, 127 (big endian issues, both fixed upstream),
+175 (configure -Wformat, fixed upstream)
+- Synced patch numbers with python3.spec.
+
* Tue May 14 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.4-5
- fix multilib issue in python-tools due to /usr/bin/pynche (source 7;
rhbz#831437)
diff --git a/sources b/sources
index 5359ae4..ac5febc 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-86909785aa1ff13b49d87737b75b5f54 Python-2.7.4.tar.xz
+5eea8462f69ab1369d32f9c4cd6272ab Python-2.7.5.tar.xz
commit d2b9971f178c615136a9816f542030fe542c996d
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Tue May 14 15:53:21 2013 -0400
2.7.4-5: fix multilib issue in python-tools due to pynche (rhbz#831437)
* Tue May 14 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.4-5
- fix multilib issue in python-tools due to /usr/bin/pynche (source 7;
rhbz#831437)
diff --git a/pynche b/pynche
new file mode 100644
index 0000000..368d740
--- /dev/null
+++ b/pynche
@@ -0,0 +1,2 @@
+#!/bin/bash
+exec `python -c "from distutils.sysconfig import get_python_lib;
print(get_python_lib(plat_specific = True))"`/pynche/pynche
diff --git a/python.spec b/python.spec
index 4b67c63..d8cad9a 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.4
-Release: 4%{?dist}
+Release: 5%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -195,6 +195,7 @@ Source5: pyfuntop.stp
# __python2, python2_sitelib, python2_sitearch, python2_version
Source6: macros.python2
+Source7: pynche
# Modules/Setup.dist is ultimately used by the "makesetup" script to construct
# the Makefile and config.c
@@ -1394,13 +1395,10 @@ mv %{buildroot}/%{_mandir}/man1/python.1
%{buildroot}/%{_mandir}/man1/python%{py
mkdir -p ${RPM_BUILD_ROOT}%{site_packages}
#pynche
-cat > ${RPM_BUILD_ROOT}%{_bindir}/pynche << EOF
-#!/bin/bash
-exec %{site_packages}/pynche/pynche
-EOF
+install -p -m755 %{SOURCE7} ${RPM_BUILD_ROOT}%{_bindir}/pynche
chmod 755 ${RPM_BUILD_ROOT}%{_bindir}/pynche
rm -f Tools/pynche/*.pyw
-cp -r Tools/pynche \
+cp -rp Tools/pynche \
${RPM_BUILD_ROOT}%{site_packages}/
mv Tools/pynche/README Tools/pynche/README.pynche
@@ -1967,6 +1965,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Tue May 14 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.4-5
+- fix multilib issue in python-tools due to /usr/bin/pynche (source 7;
+rhbz#831437)
+
* Thu May 02 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.4-4
- Add patch that enables building on ppc64p7.
commit e0483e0c2aa2a487225141867f3f02725f9a8396
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Tue May 14 15:49:20 2013 -0400
2.7.4-5: fix multilib issue in python-tools due to pynche (rhbz#831437)
* Tue May 14 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.4-5
- fix multilib issue in python-tools due to /usr/bin/pynche (source 7;
rhbz#831437)
diff --git a/pynche b/pynche
new file mode 100644
index 0000000..368d740
--- /dev/null
+++ b/pynche
@@ -0,0 +1,2 @@
+#!/bin/bash
+exec `python -c "from distutils.sysconfig import get_python_lib;
print(get_python_lib(plat_specific = True))"`/pynche/pynche
diff --git a/python.spec b/python.spec
index 4b67c63..d8cad9a 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.4
-Release: 4%{?dist}
+Release: 5%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -195,6 +195,7 @@ Source5: pyfuntop.stp
# __python2, python2_sitelib, python2_sitearch, python2_version
Source6: macros.python2
+Source7: pynche
# Modules/Setup.dist is ultimately used by the "makesetup" script to construct
# the Makefile and config.c
@@ -1394,13 +1395,10 @@ mv %{buildroot}/%{_mandir}/man1/python.1
%{buildroot}/%{_mandir}/man1/python%{py
mkdir -p ${RPM_BUILD_ROOT}%{site_packages}
#pynche
-cat > ${RPM_BUILD_ROOT}%{_bindir}/pynche << EOF
-#!/bin/bash
-exec %{site_packages}/pynche/pynche
-EOF
+install -p -m755 %{SOURCE7} ${RPM_BUILD_ROOT}%{_bindir}/pynche
chmod 755 ${RPM_BUILD_ROOT}%{_bindir}/pynche
rm -f Tools/pynche/*.pyw
-cp -r Tools/pynche \
+cp -rp Tools/pynche \
${RPM_BUILD_ROOT}%{site_packages}/
mv Tools/pynche/README Tools/pynche/README.pynche
@@ -1967,6 +1965,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Tue May 14 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.4-5
+- fix multilib issue in python-tools due to /usr/bin/pynche (source 7;
+rhbz#831437)
+
* Thu May 02 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.4-4
- Add patch that enables building on ppc64p7.
commit 695023596ea27e344b41376680bf9d9a2bf8b6fd
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Thu May 2 09:12:06 2013 +0200
Add patch that enables building on ppc64p7.
diff --git a/00177-python-add-support-for-ppc64p7.patch
b/00177-python-add-support-for-ppc64p7.patch
new file mode 100644
index 0000000..022944a
--- /dev/null
+++ b/00177-python-add-support-for-ppc64p7.patch
@@ -0,0 +1,12 @@
+diff -r de35eae9048a config.sub
+--- a/config.sub Wed Apr 24 23:33:20 2013 +0200
++++ b/config.sub Thu Apr 25 08:51:00 2013 +0200
+@@ -1008,7 +1008,7 @@
+ ;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed
's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
diff --git a/python.spec b/python.spec
index 260a29f..4b67c63 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.4
-Release: 3%{?dist}
+Release: 4%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -788,6 +788,12 @@ Patch175: 00175-fix-configure-Wformat.patch
# Doesn't apply to Python 3, where this is fixed otherwise and works.
Patch176: 00176-allow-arbitrary-timeout-in-condition-wait.patch
+# 00177 #
+# Enable building on ppc64p7
+# Not appropriate for upstream, Fedora-specific naming
+Patch177: 00177-python-add-support-for-ppc64p7.patch
+
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -1128,6 +1134,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch174 -p1 -b .fix-for-usr-move
%patch175 -p1 -b .fix-configure-Wformat
%patch176 -p1
+%patch177 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -1960,6 +1967,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu May 02 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.4-4
+- Add patch that enables building on ppc64p7.
+
* Mon Apr 22 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.4-3
- Allow arbitrary timeout in Condition.wait (rhbz#917709).
commit cd7ed90ba4cfe98c877ebe2cc39276acb1a8080a
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Thu May 2 09:12:06 2013 +0200
Add patch that enables building on ppc64p7.
diff --git a/00177-python-add-support-for-ppc64p7.patch
b/00177-python-add-support-for-ppc64p7.patch
new file mode 100644
index 0000000..022944a
--- /dev/null
+++ b/00177-python-add-support-for-ppc64p7.patch
@@ -0,0 +1,12 @@
+diff -r de35eae9048a config.sub
+--- a/config.sub Wed Apr 24 23:33:20 2013 +0200
++++ b/config.sub Thu Apr 25 08:51:00 2013 +0200
+@@ -1008,7 +1008,7 @@
+ ;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed
's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
diff --git a/python.spec b/python.spec
index 260a29f..4b67c63 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.4
-Release: 3%{?dist}
+Release: 4%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -788,6 +788,12 @@ Patch175: 00175-fix-configure-Wformat.patch
# Doesn't apply to Python 3, where this is fixed otherwise and works.
Patch176: 00176-allow-arbitrary-timeout-in-condition-wait.patch
+# 00177 #
+# Enable building on ppc64p7
+# Not appropriate for upstream, Fedora-specific naming
+Patch177: 00177-python-add-support-for-ppc64p7.patch
+
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -1128,6 +1134,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch174 -p1 -b .fix-for-usr-move
%patch175 -p1 -b .fix-configure-Wformat
%patch176 -p1
+%patch177 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -1960,6 +1967,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu May 02 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.4-4
+- Add patch that enables building on ppc64p7.
+
* Mon Apr 22 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.4-3
- Allow arbitrary timeout in Condition.wait (rhbz#917709).
commit 383dbe37b6a5d0161c0e8e529427c88d1a906263
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Mon Apr 22 09:09:16 2013 +0200
Allow arbitrary timeout in Condition.wait (rhbz#917709).
diff --git a/00176-allow-arbitrary-timeout-in-condition-wait.patch
b/00176-allow-arbitrary-timeout-in-condition-wait.patch
new file mode 100644
index 0000000..665965d
--- /dev/null
+++ b/00176-allow-arbitrary-timeout-in-condition-wait.patch
@@ -0,0 +1,70 @@
+diff --git a/Lib/threading.py b/Lib/threading.py
+index cb49c4a..c9795a5 100644
+--- a/Lib/threading.py
++++ b/Lib/threading.py
+@@ -305,7 +305,7 @@ class _Condition(_Verbose):
+ else:
+ return True
+
+- def wait(self, timeout=None):
++ def wait(self, timeout=None, balancing=True):
+ """Wait until notified or until a timeout occurs.
+
+ If the calling thread has not acquired the lock when this method is
+@@ -354,7 +354,10 @@ class _Condition(_Verbose):
+ remaining = endtime - _time()
+ if remaining <= 0:
+ break
+- delay = min(delay * 2, remaining, .05)
++ if balancing:
++ delay = min(delay * 2, remaining, 0.05)
++ else:
++ delay = remaining
+ _sleep(delay)
+ if not gotit:
+ if __debug__:
+@@ -599,7 +602,7 @@ class _Event(_Verbose):
+ finally:
+ self.__cond.release()
+
+- def wait(self, timeout=None):
++ def wait(self, timeout=None, balancing=True):
+ """Block until the internal flag is true.
+
+ If the internal flag is true on entry, return immediately. Otherwise,
+@@ -617,7 +620,7 @@ class _Event(_Verbose):
+ self.__cond.acquire()
+ try:
+ if not self.__flag:
+- self.__cond.wait(timeout)
++ self.__cond.wait(timeout, balancing)
+ return self.__flag
+ finally:
+ self.__cond.release()
+@@ -908,7 +911,7 @@ class Thread(_Verbose):
+ if 'dummy_threading' not in _sys.modules:
+ raise
+
+- def join(self, timeout=None):
++ def join(self, timeout=None, balancing=True):
+ """Wait until the thread terminates.
+
+ This blocks the calling thread until the thread whose join() method is
+@@ -957,7 +960,7 @@ class Thread(_Verbose):
+ if __debug__:
+ self._note("%s.join(): timed out", self)
+ break
+- self.__block.wait(delay)
++ self.__block.wait(delay, balancing)
+ else:
+ if __debug__:
+ self._note("%s.join(): thread stopped", self)
+@@ -1143,7 +1146,7 @@ class _DummyThread(Thread):
+ def _set_daemon(self):
+ return True
+
+- def join(self, timeout=None):
++ def join(self, timeout=None, balancing=True):
+ assert False, "cannot join a dummy thread"
+
+
diff --git a/python.spec b/python.spec
index 1c0ab0d..260a29f 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.4
-Release: 2%{?dist}
+Release: 3%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -779,6 +779,14 @@ Patch174: 00174-fix-for-usr-move.patch
# (rhbz#927358)
Patch175: 00175-fix-configure-Wformat.patch
+# 00176 #
+# Allow arbitrary timeout for Condition.wait, as reported in
+#
https://bugzilla.redhat.com/show_bug.cgi?id=917709
+# Upstream doesn't want this:
http://bugs.python.org/issue17748
+# But we have no better solution downstream yet, and since there is
+# no API breakage, we apply this patch.
+# Doesn't apply to Python 3, where this is fixed otherwise and works.
+Patch176: 00176-allow-arbitrary-timeout-in-condition-wait.patch
# (New patches go here ^^^)
#
@@ -1119,6 +1127,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch173 -p1
%patch174 -p1 -b .fix-for-usr-move
%patch175 -p1 -b .fix-configure-Wformat
+%patch176 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -1951,6 +1960,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Mon Apr 22 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.4-3
+- Allow arbitrary timeout in Condition.wait (rhbz#917709).
+
* Thu Apr 11 2013 Kalev Lember <kalevlember(a)gmail.com> - 2.7.4-2
- Build with libdb 5.3 instead of libdb4
- Refreshed patches: 0 (config), 102 (lib64)
commit a31104cb33751911591074037a2e83c9c05b5f08
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Mon Apr 22 09:09:16 2013 +0200
Allow arbitrary timeout in Condition.wait (rhbz#917709).
diff --git a/00176-allow-arbitrary-timeout-in-condition-wait.patch
b/00176-allow-arbitrary-timeout-in-condition-wait.patch
new file mode 100644
index 0000000..665965d
--- /dev/null
+++ b/00176-allow-arbitrary-timeout-in-condition-wait.patch
@@ -0,0 +1,70 @@
+diff --git a/Lib/threading.py b/Lib/threading.py
+index cb49c4a..c9795a5 100644
+--- a/Lib/threading.py
++++ b/Lib/threading.py
+@@ -305,7 +305,7 @@ class _Condition(_Verbose):
+ else:
+ return True
+
+- def wait(self, timeout=None):
++ def wait(self, timeout=None, balancing=True):
+ """Wait until notified or until a timeout occurs.
+
+ If the calling thread has not acquired the lock when this method is
+@@ -354,7 +354,10 @@ class _Condition(_Verbose):
+ remaining = endtime - _time()
+ if remaining <= 0:
+ break
+- delay = min(delay * 2, remaining, .05)
++ if balancing:
++ delay = min(delay * 2, remaining, 0.05)
++ else:
++ delay = remaining
+ _sleep(delay)
+ if not gotit:
+ if __debug__:
+@@ -599,7 +602,7 @@ class _Event(_Verbose):
+ finally:
+ self.__cond.release()
+
+- def wait(self, timeout=None):
++ def wait(self, timeout=None, balancing=True):
+ """Block until the internal flag is true.
+
+ If the internal flag is true on entry, return immediately. Otherwise,
+@@ -617,7 +620,7 @@ class _Event(_Verbose):
+ self.__cond.acquire()
+ try:
+ if not self.__flag:
+- self.__cond.wait(timeout)
++ self.__cond.wait(timeout, balancing)
+ return self.__flag
+ finally:
+ self.__cond.release()
+@@ -908,7 +911,7 @@ class Thread(_Verbose):
+ if 'dummy_threading' not in _sys.modules:
+ raise
+
+- def join(self, timeout=None):
++ def join(self, timeout=None, balancing=True):
+ """Wait until the thread terminates.
+
+ This blocks the calling thread until the thread whose join() method is
+@@ -957,7 +960,7 @@ class Thread(_Verbose):
+ if __debug__:
+ self._note("%s.join(): timed out", self)
+ break
+- self.__block.wait(delay)
++ self.__block.wait(delay, balancing)
+ else:
+ if __debug__:
+ self._note("%s.join(): thread stopped", self)
+@@ -1143,7 +1146,7 @@ class _DummyThread(Thread):
+ def _set_daemon(self):
+ return True
+
+- def join(self, timeout=None):
++ def join(self, timeout=None, balancing=True):
+ assert False, "cannot join a dummy thread"
+
+
diff --git a/python.spec b/python.spec
index 1c0ab0d..260a29f 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.4
-Release: 2%{?dist}
+Release: 3%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -779,6 +779,14 @@ Patch174: 00174-fix-for-usr-move.patch
# (rhbz#927358)
Patch175: 00175-fix-configure-Wformat.patch
+# 00176 #
+# Allow arbitrary timeout for Condition.wait, as reported in
+#
https://bugzilla.redhat.com/show_bug.cgi?id=917709
+# Upstream doesn't want this:
http://bugs.python.org/issue17748
+# But we have no better solution downstream yet, and since there is
+# no API breakage, we apply this patch.
+# Doesn't apply to Python 3, where this is fixed otherwise and works.
+Patch176: 00176-allow-arbitrary-timeout-in-condition-wait.patch
# (New patches go here ^^^)
#
@@ -1119,6 +1127,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch173 -p1
%patch174 -p1 -b .fix-for-usr-move
%patch175 -p1 -b .fix-configure-Wformat
+%patch176 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -1951,6 +1960,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Mon Apr 22 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.4-3
+- Allow arbitrary timeout in Condition.wait (rhbz#917709).
+
* Thu Apr 11 2013 Kalev Lember <kalevlember(a)gmail.com> - 2.7.4-2
- Build with libdb 5.3 instead of libdb4
- Refreshed patches: 0 (config), 102 (lib64)
commit 8cbd1db2b11f86d288a8c62a00a9bceeabaa8256
Author: Kalev Lember <kalevlember(a)gmail.com>
Date: Thu Apr 11 13:20:13 2013 +0200
Build with libdb 5.3 instead of libdb4
- Refreshed patches: 0 (config), 102 (lib64)
- Dropped patches: 54 (db4 version), 159 (db4 include path adjustment)
diff --git a/00159-correct-libdb-include-path.patch
b/00159-correct-libdb-include-path.patch
deleted file mode 100644
index f96fc20..0000000
--- a/00159-correct-libdb-include-path.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- Python-2.7.3/Modules/Setup.dist.orig 2012-07-17 09:05:45.000000000 +0200
-+++ Python-2.7.3/Modules/Setup.dist 2012-07-17 09:06:01.011696892 +0200
-@@ -412,7 +412,7 @@
- # Edit the variables DB and DBLIBVERto point to the db top directory
- # and the subdirectory of PORT where you built it.
- DBLIBVER=4.8
--DBINC=/usr/include/db4
-+DBINC=/usr/include/libdb4
- DBLIB=/usr/lib
- _bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
-
diff --git a/python-2.6.4-setup-db48.patch b/python-2.6.4-setup-db48.patch
deleted file mode 100644
index c9f5f5c..0000000
--- a/python-2.6.4-setup-db48.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -up Python-2.6.4/Modules/Setup.dist.setup-db48 Python-2.6.4/Modules/Setup.dist
---- Python-2.6.4/Modules/Setup.dist.setup-db48 2009-12-17 22:05:07.000020150 -0500
-+++ Python-2.6.4/Modules/Setup.dist 2009-12-17 22:05:12.545015367 -0500
-@@ -411,7 +411,7 @@ gdbm gdbmmodule.c -lgdbm
- #
- # Edit the variables DB and DBLIBVERto point to the db top directory
- # and the subdirectory of PORT where you built it.
--DBLIBVER=4.7
-+DBLIBVER=4.8
- DBINC=/usr/include/db4
- DBLIB=/usr/lib
- _bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
-
diff --git a/python-2.7.1-config.patch b/python-2.7.1-config.patch
index ea1c5d6..7815d15 100644
--- a/python-2.7.1-config.patch
+++ b/python-2.7.1-config.patch
@@ -213,7 +213,7 @@
# Sleepycat Berkeley DB interface.
-@@ -412,11 +412,10 @@ GLHACK=-Dclear=__GLclear
+@@ -412,11 +412,9 @@ GLHACK=-Dclear=__GLclear
#
# Edit the variables DB and DBLIBVERto point to the db top directory
# and the subdirectory of PORT where you built it.
@@ -222,10 +222,9 @@
-#DBINC=$(DB)/include
-#DBLIB=$(DB)/lib
-#_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
-+DBLIBVER=4.7
-+DBINC=/usr/include/db4
++DBINC=/usr/include/libdb
+DBLIB=/usr/lib
-+_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
++_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb
# Historical Berkeley DB 1.85
#
diff --git a/python-2.7.3-lib64.patch b/python-2.7.3-lib64.patch
index 7b02a01..9578b7f 100644
--- a/python-2.7.3-lib64.patch
+++ b/python-2.7.3-lib64.patch
@@ -140,12 +140,12 @@ diff -up Python-2.7.3/Modules/Setup.dist.lib64
Python-2.7.3/Modules/Setup.dist
--- Python-2.7.3/Modules/Setup.dist.lib64 2013-02-19 13:58:20.442015131 -0500
+++ Python-2.7.3/Modules/Setup.dist 2013-02-19 14:02:25.255998391 -0500
@@ -413,7 +413,7 @@ gdbm gdbmmodule.c -lgdbm
+ # Edit the variables DB and DBLIBVERto point to the db top directory
# and the subdirectory of PORT where you built it.
- DBLIBVER=4.8
- DBINC=/usr/include/db4
+ DBINC=/usr/include/libdb
-DBLIB=/usr/lib
+DBLIB=/usr/lib64
- _bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
+ _bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb
# Historical Berkeley DB 1.85
@@ -459,7 +459,7 @@ cPickle cPickle.c
diff --git a/python.spec b/python.spec
index a24175e..1c0ab0d 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.4
-Release: 1%{?dist}
+Release: 2%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -124,9 +124,6 @@ BuildRequires: autoconf
BuildRequires: bluez-libs-devel
BuildRequires: bzip2
BuildRequires: bzip2-devel
-%if 0%{?fedora} && 0%{?fedora} < 18 || 0%{?rhel} && 0%{?rhel} < 7
-BuildRequires: db4-devel >= 4.8
-%endif
# expat 2.1.0 added the symbol XML_SetHashSalt without bumping SONAME. We use
# it (in pyexpat) in order to enable the fix in Python-2.7.3 for CVE-2012-0876:
@@ -139,9 +136,7 @@ BuildRequires: gdbm-devel
%endif
BuildRequires: glibc-devel
BuildRequires: gmp-devel
-%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
-BuildRequires: libdb4-devel
-%endif
+BuildRequires: libdb-devel
BuildRequires: libffi-devel
BuildRequires: libGL-devel
BuildRequires: libX11-devel
@@ -334,9 +329,6 @@ Patch16: python-2.6-rpath.patch
# super() as it's an old-style class
Patch17: python-2.6.4-distutils-rpath.patch
-# Patch setup.py so that it links against db-4.8:
-Patch54: python-2.6.4-setup-db48.patch
-
# 00055 #
# Systemtap support: add statically-defined probe points
# Patch based on upstream bug:
http://bugs.python.org/issue4111
@@ -680,13 +672,6 @@ Patch157: 00157-uid-gid-overflows.patch
# Upstream as of Python 2.7.4
# Patch158: 00158-fix-hashlib-leak.patch
-# 00159 #
-# From F18 on, there is a libdb4 package, that replaces db4. It places header
-# files in "/usr/include/libdb4", not in "/usr/include/db4", this
patch
-# fixes this.
-# Downstream only modification.
-Patch159: 00159-correct-libdb-include-path.patch
-
# 00160 #
# python3.spec's
# Patch160: 00160-disable-test_fs_holes-in-rpm-build.patch
@@ -1044,8 +1029,6 @@ done
# Try not disabling egg-infos, bz#414711
#patch50 -p1 -b .egginfo
-%patch54 -p1 -b .setup-db48
-
# patch101: upstream as of Python 2.7.4
%if "%{_lib}" == "lib64"
%patch102 -p1 -b .lib64
@@ -1119,7 +1102,6 @@ done
%patch156 -p1
%patch157 -p1
# 00158: upstream as of Python 2.7.4
-%patch159 -p1 -F 3
# 00160: not for python 2
# 00161: not for python 2 yet
# 00162: not for python 2 yet
@@ -1969,6 +1951,11 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu Apr 11 2013 Kalev Lember <kalevlember(a)gmail.com> - 2.7.4-2
+- Build with libdb 5.3 instead of libdb4
+- Refreshed patches: 0 (config), 102 (lib64)
+- Dropped patches: 54 (db4 version), 159 (db4 include path adjustment)
+
* Mon Apr 08 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.4-1
- Updated to Python 2.7.4.
- Refreshed patches: 0 (config), 7 (sqlite encoding), 16 (rpath in config),
commit 4fd811cc743e7af38bfbfcae59c27e94c7c7f1b6
Author: Kalev Lember <kalevlember(a)gmail.com>
Date: Thu Apr 11 13:20:13 2013 +0200
Build with libdb 5.3 instead of libdb4
- Refreshed patches: 0 (config), 102 (lib64)
- Dropped patches: 54 (db4 version), 159 (db4 include path adjustment)
diff --git a/00159-correct-libdb-include-path.patch
b/00159-correct-libdb-include-path.patch
deleted file mode 100644
index f96fc20..0000000
--- a/00159-correct-libdb-include-path.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- Python-2.7.3/Modules/Setup.dist.orig 2012-07-17 09:05:45.000000000 +0200
-+++ Python-2.7.3/Modules/Setup.dist 2012-07-17 09:06:01.011696892 +0200
-@@ -412,7 +412,7 @@
- # Edit the variables DB and DBLIBVERto point to the db top directory
- # and the subdirectory of PORT where you built it.
- DBLIBVER=4.8
--DBINC=/usr/include/db4
-+DBINC=/usr/include/libdb4
- DBLIB=/usr/lib
- _bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
-
diff --git a/python-2.6.4-setup-db48.patch b/python-2.6.4-setup-db48.patch
deleted file mode 100644
index c9f5f5c..0000000
--- a/python-2.6.4-setup-db48.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -up Python-2.6.4/Modules/Setup.dist.setup-db48 Python-2.6.4/Modules/Setup.dist
---- Python-2.6.4/Modules/Setup.dist.setup-db48 2009-12-17 22:05:07.000020150 -0500
-+++ Python-2.6.4/Modules/Setup.dist 2009-12-17 22:05:12.545015367 -0500
-@@ -411,7 +411,7 @@ gdbm gdbmmodule.c -lgdbm
- #
- # Edit the variables DB and DBLIBVERto point to the db top directory
- # and the subdirectory of PORT where you built it.
--DBLIBVER=4.7
-+DBLIBVER=4.8
- DBINC=/usr/include/db4
- DBLIB=/usr/lib
- _bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
-
diff --git a/python-2.7.1-config.patch b/python-2.7.1-config.patch
index ea1c5d6..7815d15 100644
--- a/python-2.7.1-config.patch
+++ b/python-2.7.1-config.patch
@@ -213,7 +213,7 @@
# Sleepycat Berkeley DB interface.
-@@ -412,11 +412,10 @@ GLHACK=-Dclear=__GLclear
+@@ -412,11 +412,9 @@ GLHACK=-Dclear=__GLclear
#
# Edit the variables DB and DBLIBVERto point to the db top directory
# and the subdirectory of PORT where you built it.
@@ -222,10 +222,9 @@
-#DBINC=$(DB)/include
-#DBLIB=$(DB)/lib
-#_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
-+DBLIBVER=4.7
-+DBINC=/usr/include/db4
++DBINC=/usr/include/libdb
+DBLIB=/usr/lib
-+_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
++_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb
# Historical Berkeley DB 1.85
#
diff --git a/python-2.7.3-lib64.patch b/python-2.7.3-lib64.patch
index 7b02a01..9578b7f 100644
--- a/python-2.7.3-lib64.patch
+++ b/python-2.7.3-lib64.patch
@@ -140,12 +140,12 @@ diff -up Python-2.7.3/Modules/Setup.dist.lib64
Python-2.7.3/Modules/Setup.dist
--- Python-2.7.3/Modules/Setup.dist.lib64 2013-02-19 13:58:20.442015131 -0500
+++ Python-2.7.3/Modules/Setup.dist 2013-02-19 14:02:25.255998391 -0500
@@ -413,7 +413,7 @@ gdbm gdbmmodule.c -lgdbm
+ # Edit the variables DB and DBLIBVERto point to the db top directory
# and the subdirectory of PORT where you built it.
- DBLIBVER=4.8
- DBINC=/usr/include/db4
+ DBINC=/usr/include/libdb
-DBLIB=/usr/lib
+DBLIB=/usr/lib64
- _bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
+ _bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb
# Historical Berkeley DB 1.85
@@ -459,7 +459,7 @@ cPickle cPickle.c
diff --git a/python.spec b/python.spec
index a24175e..1c0ab0d 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.4
-Release: 1%{?dist}
+Release: 2%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -124,9 +124,6 @@ BuildRequires: autoconf
BuildRequires: bluez-libs-devel
BuildRequires: bzip2
BuildRequires: bzip2-devel
-%if 0%{?fedora} && 0%{?fedora} < 18 || 0%{?rhel} && 0%{?rhel} < 7
-BuildRequires: db4-devel >= 4.8
-%endif
# expat 2.1.0 added the symbol XML_SetHashSalt without bumping SONAME. We use
# it (in pyexpat) in order to enable the fix in Python-2.7.3 for CVE-2012-0876:
@@ -139,9 +136,7 @@ BuildRequires: gdbm-devel
%endif
BuildRequires: glibc-devel
BuildRequires: gmp-devel
-%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
-BuildRequires: libdb4-devel
-%endif
+BuildRequires: libdb-devel
BuildRequires: libffi-devel
BuildRequires: libGL-devel
BuildRequires: libX11-devel
@@ -334,9 +329,6 @@ Patch16: python-2.6-rpath.patch
# super() as it's an old-style class
Patch17: python-2.6.4-distutils-rpath.patch
-# Patch setup.py so that it links against db-4.8:
-Patch54: python-2.6.4-setup-db48.patch
-
# 00055 #
# Systemtap support: add statically-defined probe points
# Patch based on upstream bug:
http://bugs.python.org/issue4111
@@ -680,13 +672,6 @@ Patch157: 00157-uid-gid-overflows.patch
# Upstream as of Python 2.7.4
# Patch158: 00158-fix-hashlib-leak.patch
-# 00159 #
-# From F18 on, there is a libdb4 package, that replaces db4. It places header
-# files in "/usr/include/libdb4", not in "/usr/include/db4", this
patch
-# fixes this.
-# Downstream only modification.
-Patch159: 00159-correct-libdb-include-path.patch
-
# 00160 #
# python3.spec's
# Patch160: 00160-disable-test_fs_holes-in-rpm-build.patch
@@ -1044,8 +1029,6 @@ done
# Try not disabling egg-infos, bz#414711
#patch50 -p1 -b .egginfo
-%patch54 -p1 -b .setup-db48
-
# patch101: upstream as of Python 2.7.4
%if "%{_lib}" == "lib64"
%patch102 -p1 -b .lib64
@@ -1119,7 +1102,6 @@ done
%patch156 -p1
%patch157 -p1
# 00158: upstream as of Python 2.7.4
-%patch159 -p1 -F 3
# 00160: not for python 2
# 00161: not for python 2 yet
# 00162: not for python 2 yet
@@ -1969,6 +1951,11 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu Apr 11 2013 Kalev Lember <kalevlember(a)gmail.com> - 2.7.4-2
+- Build with libdb 5.3 instead of libdb4
+- Refreshed patches: 0 (config), 102 (lib64)
+- Dropped patches: 54 (db4 version), 159 (db4 include path adjustment)
+
* Mon Apr 08 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.4-1
- Updated to Python 2.7.4.
- Refreshed patches: 0 (config), 7 (sqlite encoding), 16 (rpath in config),
commit 302c82620e990b3538540a3f126927a3223ed37f
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Wed Apr 10 10:29:51 2013 +0200
Again that annoying dist-git but which makes it seems that staged files were commited,
but they werent...
diff --git a/sources b/sources
index d0fe0cc..5359ae4 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-62c4c1699170078c469f79ddfed21bc0 Python-2.7.3.tar.xz
+86909785aa1ff13b49d87737b75b5f54 Python-2.7.4.tar.xz
commit 6a2d1e30e2f875f6cf79e50b048aa95cd7720865
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Tue Apr 9 10:54:58 2013 +0200
Updated to Python 2.7.4.
- Refreshed patches: 0 (config), 7 (sqlite encoding), 16 (rpath in config),
55 (systemtap), 111 (no static lib), 112 (debug build), 113 (more
configuration flags), 130 (add extension to python config), 134 (fix
COUNT_ALLOCS in test_sys), 146 (haslib FIPS), 147 (add debug malloc stats),
153 (fix gdb test noise), 157 (uid, gid overflow - fixed upstream, just
keeping few more downstream tests), 165 (crypt module salt backport),
175 (fix configure Wformat), 5000 (regenerated autotooling patch)
- Dropped patches: 101 (lib64 regex; merged upstream), 171 (exception on
missing /dev/urandom; merged upstream), 172 (poll for multiprocessing socket
connection; merged upstream)
diff --git a/00055-systemtap.patch b/00055-systemtap.patch
index 8c81e9d..67ec005 100644
--- a/00055-systemtap.patch
+++ b/00055-systemtap.patch
@@ -1,6 +1,6 @@
-diff -up Python-2.7rc1/configure.in.systemtap Python-2.7rc1/configure.in
---- Python-2.7rc1/configure.in.systemtap 2010-06-06 10:53:15.514975012 -0400
-+++ Python-2.7rc1/configure.in 2010-06-06 10:53:15.520974361 -0400
+diff -up Python-2.7rc1/configure.ac.systemtap Python-2.7rc1/configure.ac
+--- Python-2.7rc1/configure.ac.systemtap 2010-06-06 10:53:15.514975012 -0400
++++ Python-2.7rc1/configure.ac 2010-06-06 10:53:15.520974361 -0400
@@ -2616,6 +2616,38 @@ if test "$with_valgrind" != no; then
)
fi
@@ -87,9 +87,9 @@ diff -up Python-2.7rc1/Makefile.pre.in.systemtap
Python-2.7rc1/Makefile.pre.in
@@ -1251,7 +1264,7 @@ Python/thread.o: @THREADHEADERS@
.PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
.PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
- .PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean
--.PHONY: smelly funny patchcheck
-+.PHONY: smelly funny patchcheck buildinclude
+ .PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean
+-.PHONY: smelly funny patchcheck touch altmaninstall
++.PHONY: smelly funny patchcheck touch altmaninstall buildinclude
.PHONY: gdbhooks
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
diff --git a/00111-no-static-lib.patch b/00111-no-static-lib.patch
index c331454..2f4fdd6 100644
--- a/00111-no-static-lib.patch
+++ b/00111-no-static-lib.patch
@@ -11,8 +11,8 @@ diff -up Python-2.7.3/Makefile.pre.in.no-static-lib
Python-2.7.3/Makefile.pre.in
Modules/python.o \
$(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
@@ -413,18 +413,6 @@ sharedmods: $(BUILDPYTHON)
- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)'
./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
- esac
+ $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
+ $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
-# Build static library
-# avoid long command lines, same as LIBRARY_OBJS
diff --git a/00113-more-configuration-flags.patch b/00113-more-configuration-flags.patch
index 9ee3180..2d447b2 100644
--- a/00113-more-configuration-flags.patch
+++ b/00113-more-configuration-flags.patch
@@ -1,6 +1,6 @@
-diff -up Python-2.6.5/configure.in.more-configuration-flags Python-2.6.5/configure.in
---- Python-2.6.5/configure.in.more-configuration-flags 2010-05-24 18:51:25.410111792
-0400
-+++ Python-2.6.5/configure.in 2010-05-24 18:59:23.954986388 -0400
+diff -up Python-2.6.5/configure.ac.more-configuration-flags Python-2.6.5/configure.ac
+--- Python-2.6.5/configure.ac.more-configuration-flags 2010-05-24 18:51:25.410111792
-0400
++++ Python-2.6.5/configure.ac 2010-05-24 18:59:23.954986388 -0400
@@ -2515,6 +2515,30 @@ else AC_MSG_RESULT(no)
fi],
[AC_MSG_RESULT(no)])
diff --git a/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch
b/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch
index 362145e..38381ef 100644
--- a/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch
+++ b/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch
@@ -3,11 +3,11 @@
@@ -734,6 +734,11 @@ class SizeofTest(unittest.TestCase):
# (PyTypeObject + PyNumberMethods + PyMappingMethods +
# PySequenceMethods + PyBufferProcs)
- s = size(vh + 'P2P15Pl4PP9PP11PI') + size('41P 10P 3P 6P')
+ s = vsize('P2P15Pl4PP9PP11PI') + struct.calcsize('41P 10P 3P
6P')
+
+ # COUNT_ALLOCS adds further fields to the end of a PyTypeObject:
+ if hasattr(sys, 'getcounts'):
-+ s += size('5P')
++ s += size('P')
+
class newstyleclass(object):
pass
diff --git a/00146-hashlib-fips.patch b/00146-hashlib-fips.patch
index 8616296..c67eb3b 100644
--- a/00146-hashlib-fips.patch
+++ b/00146-hashlib-fips.patch
@@ -67,7 +67,7 @@ diff -up Python-2.7.2/Lib/hashlib.py.hashlib-fips
Python-2.7.2/Lib/hashlib.py
- except ImportError:
- pass # no extension module, this hash is unsupported.
-
-- raise ValueError('unsupported hash type %s' % name)
+- raise ValueError('unsupported hash type ' + name)
-
-
def __get_openssl_constructor(name):
@@ -199,9 +199,9 @@ diff -up Python-2.7.2/Lib/test/test_hashlib.py.hashlib-fips
Python-2.7.2/Lib/tes
c.hexdigest()
def test_algorithms_attribute(self):
-@@ -115,27 +113,9 @@ class HashLibTestCase(unittest.TestCase)
- else:
- self.assertTrue(0 == "hashlib didn't reject bogus hash name")
+@@ -115,28 +113,9 @@ class HashLibTestCase(unittest.TestCase)
+ self.assertRaises(ValueError, hashlib.new, 'spam spam spam spam spam')
+ self.assertRaises(TypeError, hashlib.new, 1)
- def test_get_builtin_constructor(self):
- get_builtin_constructor = hashlib.__dict__[
@@ -220,6 +220,7 @@ diff -up Python-2.7.2/Lib/test/test_hashlib.py.hashlib-fips
Python-2.7.2/Lib/tes
- sys.modules['_md5'] = _md5
- else:
- del sys.modules['_md5']
+- self.assertRaises(TypeError, get_builtin_constructor, 3)
-
def test_hexdigest(self):
for name in self.supported_hash_names:
@@ -366,7 +367,7 @@ diff -up Python-2.7.2/Modules/_hashopenssl.c.hashlib-fips
Python-2.7.2/Modules/_
+} EVPCachedInfo;
-#define DEFINE_CONSTS_FOR_NEW(Name) \
-- static PyObject *CONST_ ## Name ## _name_obj; \
+- static PyObject *CONST_ ## Name ## _name_obj = NULL; \
- static EVP_MD_CTX CONST_new_ ## Name ## _ctx; \
- static EVP_MD_CTX *CONST_new_ ## Name ## _ctx_p = NULL;
+#define DEFINE_CONSTS_FOR_NEW(Name) \
@@ -513,7 +514,7 @@ diff -up Python-2.7.2/Modules/_hashopenssl.c.hashlib-fips
Python-2.7.2/Modules/_
return NULL;
}
-@@ -484,55 +556,118 @@ EVP_new(PyObject *self, PyObject *args,
+@@ -484,58 +556,118 @@ EVP_new(PyObject *self, PyObject *args,
digest = EVP_get_digestbyname(name);
ret_obj = EVPnew(name_obj, digest, NULL, (unsigned char*)view.buf,
@@ -615,12 +616,15 @@ diff -up Python-2.7.2/Modules/_hashopenssl.c.hashlib-fips
Python-2.7.2/Modules/_
" hash object; optionally initialized with a string") \
}
--/* used in the init function to setup a constructor */
+-/* used in the init function to setup a constructor: initialize OpenSSL
+- constructor constants if they haven't been initialized already. */
-#define INIT_CONSTRUCTOR_CONSTANTS(NAME) do { \
+- if (CONST_ ## NAME ## _name_obj == NULL) { \
- CONST_ ## NAME ## _name_obj = PyString_FromString(#NAME); \
-- if (EVP_get_digestbyname(#NAME)) { \
-- CONST_new_ ## NAME ## _ctx_p = &CONST_new_ ## NAME ## _ctx; \
-- EVP_DigestInit(CONST_new_ ## NAME ## _ctx_p, EVP_get_digestbyname(#NAME)); \
+- if (EVP_get_digestbyname(#NAME)) { \
+- CONST_new_ ## NAME ## _ctx_p = &CONST_new_ ## NAME ## _ctx; \
+- EVP_DigestInit(CONST_new_ ## NAME ## _ctx_p, EVP_get_digestbyname(#NAME));
\
+- } \
- } \
+/*
+ Macro/function pair to set up the constructors.
diff --git a/00147-add-debug-malloc-stats.patch b/00147-add-debug-malloc-stats.patch
index 25e8970..0ab8c94 100644
--- a/00147-add-debug-malloc-stats.patch
+++ b/00147-add-debug-malloc-stats.patch
@@ -75,8 +75,8 @@ diff -up Python-2.7.2/Include/object.h.add-debug-malloc-stats
Python-2.7.2/Inclu
--- Python-2.7.2/Include/object.h.add-debug-malloc-stats 2011-06-11 11:46:23.000000000
-0400
+++ Python-2.7.2/Include/object.h 2011-09-16 19:03:25.108821625 -0400
@@ -980,6 +980,13 @@ PyAPI_DATA(PyObject *) _PyTrash_delete_l
- else \
- _PyTrash_deposit_object((PyObject*)op);
+ _PyTrash_thread_deposit_object((PyObject*)op); \
+ } while (0);
+PyAPI_FUNC(void)
+_PyDebugAllocatorStats(FILE *out, const char *block_name, int num_blocks,
@@ -165,7 +165,7 @@ diff -up Python-2.7.2/Lib/test/test_sys.py.add-debug-malloc-stats
Python-2.7.2/L
+
class SizeofTest(unittest.TestCase):
- TPFLAGS_HAVE_GC = 1<<14
+ def setUp(self):
diff -up Python-2.7.2/Objects/classobject.c.add-debug-malloc-stats
Python-2.7.2/Objects/classobject.c
--- Python-2.7.2/Objects/classobject.c.add-debug-malloc-stats 2011-06-11
11:46:27.000000000 -0400
+++ Python-2.7.2/Objects/classobject.c 2011-09-16 19:03:25.110821625 -0400
@@ -542,8 +542,8 @@ diff -up Python-2.7.2/Objects/stringobject.c.add-debug-malloc-stats
Python-2.7.2
--- Python-2.7.2/Objects/stringobject.c.add-debug-malloc-stats 2011-06-11
11:46:27.000000000 -0400
+++ Python-2.7.2/Objects/stringobject.c 2011-09-16 19:03:25.116821625 -0400
@@ -4822,3 +4822,43 @@ void _Py_ReleaseInternedStrings(void)
- Py_DECREF(interned);
- interned = NULL;
+ PyDict_Clear(interned);
+ Py_CLEAR(interned);
}
+
+void _PyString_DebugMallocStats(FILE *out)
diff --git a/00153-fix-test_gdb-noise.patch b/00153-fix-test_gdb-noise.patch
index bc5ee63..0495d95 100644
--- a/00153-fix-test_gdb-noise.patch
+++ b/00153-fix-test_gdb-noise.patch
@@ -17,8 +17,8 @@
if cmds_after_breakpoint:
commands += cmds_after_breakpoint
@@ -135,8 +144,16 @@ class DebuggerTests(unittest.TestCase):
- err = err.replace("warning: Cannot initialize thread debugging"
- " library: Debugger service failed\n",
+ 'Do you need "set solib-search-path" or '
+ '"set sysroot"?\n',
'')
+ err = '\n'.join([line
+ for line in err.splitlines()
diff --git a/00157-uid-gid-overflows.patch b/00157-uid-gid-overflows.patch
index 0d6abb5..13546bb 100644
--- a/00157-uid-gid-overflows.patch
+++ b/00157-uid-gid-overflows.patch
@@ -1,44 +1,3 @@
-diff -up Python-2.7.3/Include/modsupport.h.uid-gid-overflows
Python-2.7.3/Include/modsupport.h
---- Python-2.7.3/Include/modsupport.h.uid-gid-overflows 2012-04-09 19:07:29.000000000
-0400
-+++ Python-2.7.3/Include/modsupport.h 2012-06-26 14:52:03.739471150 -0400
-@@ -8,6 +8,7 @@ extern "C" {
- /* Module support interface */
-
- #include <stdarg.h>
-+#include <sys/types.h>
-
- /* If PY_SSIZE_T_CLEAN is defined, each functions treats #-specifier
- to mean Py_ssize_t */
-@@ -128,6 +129,17 @@ PyAPI_FUNC(PyObject *) Py_InitModule4(co
-
- PyAPI_DATA(char *) _Py_PackageContext;
-
-+/*
-+ Non-standard extension: support for dealing with uid_t and gid_t without
-+ integer overflow
-+ */
-+
-+PyAPI_FUNC(PyObject *) _PyObject_FromUid(uid_t uid);
-+PyAPI_FUNC(PyObject *) _PyObject_FromGid(gid_t gid);
-+
-+PyAPI_FUNC(int) _PyArg_ParseUid(PyObject *in_obj, uid_t *out_uid);
-+PyAPI_FUNC(int) _PyArg_ParseGid(PyObject *in_obj, gid_t *out_gid);
-+
- #ifdef __cplusplus
- }
- #endif
-diff -up Python-2.7.3/Lib/test/test_grp.py.uid-gid-overflows
Python-2.7.3/Lib/test/test_grp.py
---- Python-2.7.3/Lib/test/test_grp.py.uid-gid-overflows 2012-04-09 19:07:31.000000000
-0400
-+++ Python-2.7.3/Lib/test/test_grp.py 2012-06-26 14:51:36.000817929 -0400
-@@ -16,7 +16,7 @@ class GroupDatabaseTestCase(unittest.Tes
- self.assertEqual(value[1], value.gr_passwd)
- self.assertIsInstance(value.gr_passwd, basestring)
- self.assertEqual(value[2], value.gr_gid)
-- self.assertIsInstance(value.gr_gid, int)
-+ self.assertIsInstance(value.gr_gid, (int, long))
- self.assertEqual(value[3], value.gr_mem)
- self.assertIsInstance(value.gr_mem, list)
-
diff -up Python-2.7.3/Lib/test/test_os.py.uid-gid-overflows
Python-2.7.3/Lib/test/test_os.py
--- Python-2.7.3/Lib/test/test_os.py.uid-gid-overflows 2012-04-09 19:07:32.000000000
-0400
+++ Python-2.7.3/Lib/test/test_os.py 2012-06-26 14:51:36.000817929 -0400
@@ -88,649 +47,3 @@ diff -up Python-2.7.3/Lib/test/test_os.py.uid-gid-overflows
Python-2.7.3/Lib/tes
self.assertRaises(OverflowError, os.setregid, 1<<32, 0)
self.assertRaises(OverflowError, os.setregid, 0, 1<<32)
-diff -up Python-2.7.3/Lib/test/test_posix.py.uid-gid-overflows
Python-2.7.3/Lib/test/test_posix.py
---- Python-2.7.3/Lib/test/test_posix.py.uid-gid-overflows 2012-04-09 19:07:32.000000000
-0400
-+++ Python-2.7.3/Lib/test/test_posix.py 2012-06-26 14:51:36.001817916 -0400
-@@ -217,7 +217,7 @@ class PosixTester(unittest.TestCase):
- if hasattr(posix, 'stat'):
- self.assertTrue(posix.stat(test_support.TESTFN))
-
-- def _test_all_chown_common(self, chown_func, first_param):
-+ def _test_all_chown_common(self, chown_func, stat_func, first_param):
- """Common code for chown, fchown and lchown
tests."""
- if os.getuid() == 0:
- try:
-@@ -237,6 +237,13 @@ class PosixTester(unittest.TestCase):
-
- # test a successful chown call
- chown_func(first_param, os.getuid(), os.getgid())
-+ self.assertEqual(stat_func(first_param).st_uid, os.getuid())
-+ self.assertEqual(stat_func(first_param).st_gid, os.getgid())
-+
-+ # verify that -1 works as a "do-nothing" option:
-+ chown_func(first_param, -1, -1)
-+ self.assertEqual(stat_func(first_param).st_uid, os.getuid())
-+ self.assertEqual(stat_func(first_param).st_gid, os.getgid())
-
- @unittest.skipUnless(hasattr(posix, 'chown'), "test needs
os.chown()")
- def test_chown(self):
-@@ -246,7 +253,7 @@ class PosixTester(unittest.TestCase):
-
- # re-create the file
- open(test_support.TESTFN, 'w').close()
-- self._test_all_chown_common(posix.chown, test_support.TESTFN)
-+ self._test_all_chown_common(posix.chown, posix.stat, test_support.TESTFN)
-
- @unittest.skipUnless(hasattr(posix, 'fchown'), "test needs
os.fchown()")
- def test_fchown(self):
-@@ -256,7 +263,7 @@ class PosixTester(unittest.TestCase):
- test_file = open(test_support.TESTFN, 'w')
- try:
- fd = test_file.fileno()
-- self._test_all_chown_common(posix.fchown, fd)
-+ self._test_all_chown_common(posix.fchown, posix.fstat, fd)
- finally:
- test_file.close()
-
-@@ -265,7 +272,7 @@ class PosixTester(unittest.TestCase):
- os.unlink(test_support.TESTFN)
- # create a symlink
- os.symlink(_DUMMY_SYMLINK, test_support.TESTFN)
-- self._test_all_chown_common(posix.lchown, test_support.TESTFN)
-+ self._test_all_chown_common(posix.lchown, posix.lstat, test_support.TESTFN)
-
- def test_chdir(self):
- if hasattr(posix, 'chdir'):
-diff -up Python-2.7.3/Lib/test/test_pwd.py.uid-gid-overflows
Python-2.7.3/Lib/test/test_pwd.py
---- Python-2.7.3/Lib/test/test_pwd.py.uid-gid-overflows 2012-04-09 19:07:32.000000000
-0400
-+++ Python-2.7.3/Lib/test/test_pwd.py 2012-06-26 14:51:36.001817916 -0400
-@@ -18,9 +18,9 @@ class PwdTest(unittest.TestCase):
- self.assertEqual(e[1], e.pw_passwd)
- self.assertIsInstance(e.pw_passwd, basestring)
- self.assertEqual(e[2], e.pw_uid)
-- self.assertIsInstance(e.pw_uid, int)
-+ self.assertIsInstance(e.pw_uid, (int, long))
- self.assertEqual(e[3], e.pw_gid)
-- self.assertIsInstance(e.pw_gid, int)
-+ self.assertIsInstance(e.pw_gid, (int, long))
- self.assertEqual(e[4], e.pw_gecos)
- self.assertIsInstance(e.pw_gecos, basestring)
- self.assertEqual(e[5], e.pw_dir)
-@@ -87,9 +87,9 @@ class PwdTest(unittest.TestCase):
- # In some cases, byuids isn't a complete list of all users in the
- # system, so if we try to pick a value not in byuids (via a perturbing
- # loop, say), pwd.getpwuid() might still be able to find data for that
-- # uid. Using sys.maxint may provoke the same problems, but hopefully
-+ # uid. Using 2**32 - 2 may provoke the same problems, but hopefully
- # it will be a more repeatable failure.
-- fakeuid = sys.maxint
-+ fakeuid = 2**32 - 2
- self.assertNotIn(fakeuid, byuids)
- self.assertRaises(KeyError, pwd.getpwuid, fakeuid)
-
-diff -up Python-2.7.3/Modules/grpmodule.c.uid-gid-overflows
Python-2.7.3/Modules/grpmodule.c
---- Python-2.7.3/Modules/grpmodule.c.uid-gid-overflows 2012-04-09 19:07:34.000000000
-0400
-+++ Python-2.7.3/Modules/grpmodule.c 2012-06-26 14:51:36.002817904 -0400
-@@ -70,7 +70,7 @@ mkgrent(struct group *p)
- Py_INCREF(Py_None);
- }
- #endif
-- SET(setIndex++, PyInt_FromLong((long) p->gr_gid));
-+ SET(setIndex++, _PyObject_FromGid(p->gr_gid));
- SET(setIndex++, w);
- #undef SET
-
-@@ -85,18 +85,15 @@ mkgrent(struct group *p)
- static PyObject *
- grp_getgrgid(PyObject *self, PyObject *pyo_id)
- {
-- PyObject *py_int_id;
-- unsigned int gid;
-+ gid_t gid;
- struct group *p;
-
-- py_int_id = PyNumber_Int(pyo_id);
-- if (!py_int_id)
-- return NULL;
-- gid = PyInt_AS_LONG(py_int_id);
-- Py_DECREF(py_int_id);
-+ if (!_PyArg_ParseGid(pyo_id, &gid)) {
-+ return NULL;
-+ }
-
- if ((p = getgrgid(gid)) == NULL) {
-- PyErr_Format(PyExc_KeyError, "getgrgid(): gid not found: %d", gid);
-+ PyErr_Format(PyExc_KeyError, "getgrgid(): gid not found: %lu",
(unsigned long)gid);
- return NULL;
- }
- return mkgrent(p);
-diff -up Python-2.7.3/Modules/posixmodule.c.uid-gid-overflows
Python-2.7.3/Modules/posixmodule.c
---- Python-2.7.3/Modules/posixmodule.c.uid-gid-overflows 2012-06-26 14:51:35.864819629
-0400
-+++ Python-2.7.3/Modules/posixmodule.c 2012-06-26 14:51:36.005817868 -0400
-@@ -1305,8 +1305,8 @@ _pystat_fromstructstat(STRUCT_STAT *st)
- PyStructSequence_SET_ITEM(v, 2, PyInt_FromLong((long)st->st_dev));
- #endif
- PyStructSequence_SET_ITEM(v, 3, PyInt_FromLong((long)st->st_nlink));
-- PyStructSequence_SET_ITEM(v, 4, PyInt_FromLong((long)st->st_uid));
-- PyStructSequence_SET_ITEM(v, 5, PyInt_FromLong((long)st->st_gid));
-+ PyStructSequence_SET_ITEM(v, 4, _PyObject_FromUid(st->st_uid));
-+ PyStructSequence_SET_ITEM(v, 5, _PyObject_FromGid(st->st_gid));
- #ifdef HAVE_LARGEFILE_SUPPORT
- PyStructSequence_SET_ITEM(v, 6,
- PyLong_FromLongLong((PY_LONG_LONG)st->st_size));
-@@ -1883,14 +1883,16 @@ static PyObject *
- posix_chown(PyObject *self, PyObject *args)
- {
- char *path = NULL;
-- long uid, gid;
-+ uid_t uid;
-+ gid_t gid;
- int res;
-- if (!PyArg_ParseTuple(args, "etll:chown",
-+ if (!PyArg_ParseTuple(args, "etO&O&:chown",
- Py_FileSystemDefaultEncoding, &path,
-- &uid, &gid))
-+ _PyArg_ParseUid, &uid,
-+ _PyArg_ParseGid, &gid))
- return NULL;
- Py_BEGIN_ALLOW_THREADS
-- res = chown(path, (uid_t) uid, (gid_t) gid);
-+ res = chown(path, uid, gid);
- Py_END_ALLOW_THREADS
- if (res < 0)
- return posix_error_with_allocated_filename(path);
-@@ -1910,12 +1912,15 @@ static PyObject *
- posix_fchown(PyObject *self, PyObject *args)
- {
- int fd;
-- long uid, gid;
-+ uid_t uid;
-+ gid_t gid;
- int res;
-- if (!PyArg_ParseTuple(args, "ill:chown", &fd, &uid, &gid))
-+ if (!PyArg_ParseTuple(args, "iO&O&:chown", &fd,
-+ _PyArg_ParseUid, &uid,
-+ _PyArg_ParseGid, &gid))
- return NULL;
- Py_BEGIN_ALLOW_THREADS
-- res = fchown(fd, (uid_t) uid, (gid_t) gid);
-+ res = fchown(fd, uid, gid);
- Py_END_ALLOW_THREADS
- if (res < 0)
- return posix_error();
-@@ -1933,14 +1938,16 @@ static PyObject *
- posix_lchown(PyObject *self, PyObject *args)
- {
- char *path = NULL;
-- long uid, gid;
-+ uid_t uid;
-+ gid_t gid;
- int res;
-- if (!PyArg_ParseTuple(args, "etll:lchown",
-+ if (!PyArg_ParseTuple(args, "etO&O&:lchown",
- Py_FileSystemDefaultEncoding, &path,
-- &uid, &gid))
-+ _PyArg_ParseUid, &uid,
-+ _PyArg_ParseGid, &gid))
- return NULL;
- Py_BEGIN_ALLOW_THREADS
-- res = lchown(path, (uid_t) uid, (gid_t) gid);
-+ res = lchown(path, uid, gid);
- Py_END_ALLOW_THREADS
- if (res < 0)
- return posix_error_with_allocated_filename(path);
-@@ -3841,7 +3848,7 @@ Return the current process's effective g
- static PyObject *
- posix_getegid(PyObject *self, PyObject *noargs)
- {
-- return PyInt_FromLong((long)getegid());
-+ return _PyObject_FromGid(getegid());
- }
- #endif
-
-@@ -3854,7 +3861,7 @@ Return the current process's effective u
- static PyObject *
- posix_geteuid(PyObject *self, PyObject *noargs)
- {
-- return PyInt_FromLong((long)geteuid());
-+ return _PyObject_FromUid(geteuid());
- }
- #endif
-
-@@ -3867,7 +3874,7 @@ Return the current process's group id.")
- static PyObject *
- posix_getgid(PyObject *self, PyObject *noargs)
- {
-- return PyInt_FromLong((long)getgid());
-+ return _PyObject_FromGid(getgid());
- }
- #endif
-
-@@ -3942,7 +3949,7 @@ posix_getgroups(PyObject *self, PyObject
- if (result != NULL) {
- int i;
- for (i = 0; i < n; ++i) {
-- PyObject *o = PyInt_FromLong((long)alt_grouplist[i]);
-+ PyObject *o = _PyObject_FromGid(alt_grouplist[i]);
- if (o == NULL) {
- Py_DECREF(result);
- result = NULL;
-@@ -3971,12 +3978,13 @@ static PyObject *
- posix_initgroups(PyObject *self, PyObject *args)
- {
- char *username;
-- long gid;
-+ gid_t gid;
-
-- if (!PyArg_ParseTuple(args, "sl:initgroups", &username, &gid))
-+ if (!PyArg_ParseTuple(args, "sO&:initgroups", &username,
-+ _PyArg_ParseGid, &gid))
- return NULL;
-
-- if (initgroups(username, (gid_t) gid) == -1)
-+ if (initgroups(username, gid) == -1)
- return PyErr_SetFromErrno(PyExc_OSError);
-
- Py_INCREF(Py_None);
-@@ -4090,7 +4098,7 @@ Return the current process's user id.");
- static PyObject *
- posix_getuid(PyObject *self, PyObject *noargs)
- {
-- return PyInt_FromLong((long)getuid());
-+ return _PyObject_FromUid(getuid());
- }
- #endif
-
-@@ -5736,15 +5744,9 @@ Set the current process's user id.");
- static PyObject *
- posix_setuid(PyObject *self, PyObject *args)
- {
-- long uid_arg;
- uid_t uid;
-- if (!PyArg_ParseTuple(args, "l:setuid", &uid_arg))
-+ if (!PyArg_ParseTuple(args, "O&:setuid", _PyArg_ParseUid, &uid))
- return NULL;
-- uid = uid_arg;
-- if (uid != uid_arg) {
-- PyErr_SetString(PyExc_OverflowError, "user id too big");
-- return NULL;
-- }
- if (setuid(uid) < 0)
- return posix_error();
- Py_INCREF(Py_None);
-@@ -5761,15 +5763,9 @@ Set the current process's effective user
- static PyObject *
- posix_seteuid (PyObject *self, PyObject *args)
- {
-- long euid_arg;
- uid_t euid;
-- if (!PyArg_ParseTuple(args, "l", &euid_arg))
-+ if (!PyArg_ParseTuple(args, "O&:seteuid", _PyArg_ParseUid,
&euid))
- return NULL;
-- euid = euid_arg;
-- if (euid != euid_arg) {
-- PyErr_SetString(PyExc_OverflowError, "user id too big");
-- return NULL;
-- }
- if (seteuid(euid) < 0) {
- return posix_error();
- } else {
-@@ -5787,15 +5783,9 @@ Set the current process's effective grou
- static PyObject *
- posix_setegid (PyObject *self, PyObject *args)
- {
-- long egid_arg;
- gid_t egid;
-- if (!PyArg_ParseTuple(args, "l", &egid_arg))
-+ if (!PyArg_ParseTuple(args, "O&:setegid", _PyArg_ParseGid,
&egid))
- return NULL;
-- egid = egid_arg;
-- if (egid != egid_arg) {
-- PyErr_SetString(PyExc_OverflowError, "group id too big");
-- return NULL;
-- }
- if (setegid(egid) < 0) {
- return posix_error();
- } else {
-@@ -5813,23 +5803,11 @@ Set the current process's real and effec
- static PyObject *
- posix_setreuid (PyObject *self, PyObject *args)
- {
-- long ruid_arg, euid_arg;
- uid_t ruid, euid;
-- if (!PyArg_ParseTuple(args, "ll", &ruid_arg, &euid_arg))
-+ if (!PyArg_ParseTuple(args, "O&O&",
-+ _PyArg_ParseUid, &ruid,
-+ _PyArg_ParseUid, &euid))
- return NULL;
-- if (ruid_arg == -1)
-- ruid = (uid_t)-1; /* let the compiler choose how -1 fits */
-- else
-- ruid = ruid_arg; /* otherwise, assign from our long */
-- if (euid_arg == -1)
-- euid = (uid_t)-1;
-- else
-- euid = euid_arg;
-- if ((euid_arg != -1 && euid != euid_arg) ||
-- (ruid_arg != -1 && ruid != ruid_arg)) {
-- PyErr_SetString(PyExc_OverflowError, "user id too big");
-- return NULL;
-- }
- if (setreuid(ruid, euid) < 0) {
- return posix_error();
- } else {
-@@ -5847,23 +5825,11 @@ Set the current process's real and effec
- static PyObject *
- posix_setregid (PyObject *self, PyObject *args)
- {
-- long rgid_arg, egid_arg;
- gid_t rgid, egid;
-- if (!PyArg_ParseTuple(args, "ll", &rgid_arg, &egid_arg))
-+ if (!PyArg_ParseTuple(args, "O&O&",
-+ _PyArg_ParseGid, &rgid,
-+ _PyArg_ParseGid, &egid))
- return NULL;
-- if (rgid_arg == -1)
-- rgid = (gid_t)-1; /* let the compiler choose how -1 fits */
-- else
-- rgid = rgid_arg; /* otherwise, assign from our long */
-- if (egid_arg == -1)
-- egid = (gid_t)-1;
-- else
-- egid = egid_arg;
-- if ((egid_arg != -1 && egid != egid_arg) ||
-- (rgid_arg != -1 && rgid != rgid_arg)) {
-- PyErr_SetString(PyExc_OverflowError, "group id too big");
-- return NULL;
-- }
- if (setregid(rgid, egid) < 0) {
- return posix_error();
- } else {
-@@ -5881,15 +5847,9 @@ Set the current process's group id.");
- static PyObject *
- posix_setgid(PyObject *self, PyObject *args)
- {
-- long gid_arg;
- gid_t gid;
-- if (!PyArg_ParseTuple(args, "l:setgid", &gid_arg))
-- return NULL;
-- gid = gid_arg;
-- if (gid != gid_arg) {
-- PyErr_SetString(PyExc_OverflowError, "group id too big");
-+ if (!PyArg_ParseTuple(args, "O&:setgid", _PyArg_ParseGid, &gid))
- return NULL;
-- }
- if (setgid(gid) < 0)
- return posix_error();
- Py_INCREF(Py_None);
-@@ -5922,39 +5882,10 @@ posix_setgroups(PyObject *self, PyObject
- elem = PySequence_GetItem(groups, i);
- if (!elem)
- return NULL;
-- if (!PyInt_Check(elem)) {
-- if (!PyLong_Check(elem)) {
-- PyErr_SetString(PyExc_TypeError,
-- "groups must be integers");
-- Py_DECREF(elem);
-- return NULL;
-- } else {
-- unsigned long x = PyLong_AsUnsignedLong(elem);
-- if (PyErr_Occurred()) {
-- PyErr_SetString(PyExc_TypeError,
-- "group id too big");
-- Py_DECREF(elem);
-- return NULL;
-- }
-- grouplist[i] = x;
-- /* read back to see if it fits in gid_t */
-- if (grouplist[i] != x) {
-- PyErr_SetString(PyExc_TypeError,
-- "group id too big");
-- Py_DECREF(elem);
-- return NULL;
-- }
-- }
-- } else {
-- long x = PyInt_AsLong(elem);
-- grouplist[i] = x;
-- if (grouplist[i] != x) {
-- PyErr_SetString(PyExc_TypeError,
-- "group id too big");
-- Py_DECREF(elem);
-- return NULL;
-- }
-- }
-+ if (!_PyArg_ParseGid(elem, &grouplist[i])) {
-+ Py_DECREF(elem);
-+ return NULL;
-+ }
- Py_DECREF(elem);
- }
-
-@@ -8576,9 +8507,11 @@ Set the current process's real, effectiv
- static PyObject*
- posix_setresuid (PyObject *self, PyObject *args)
- {
-- /* We assume uid_t is no larger than a long. */
-- long ruid, euid, suid;
-- if (!PyArg_ParseTuple(args, "lll", &ruid, &euid, &suid))
-+ uid_t ruid, euid, suid;
-+ if (!PyArg_ParseTuple(args, "O&O&O&",
-+ _PyArg_ParseUid, &ruid,
-+ _PyArg_ParseUid, &euid,
-+ _PyArg_ParseUid, &suid))
- return NULL;
- if (setresuid(ruid, euid, suid) < 0)
- return posix_error();
-@@ -8594,9 +8527,12 @@ Set the current process's real, effectiv
- static PyObject*
- posix_setresgid (PyObject *self, PyObject *args)
- {
-- /* We assume uid_t is no larger than a long. */
-- long rgid, egid, sgid;
-- if (!PyArg_ParseTuple(args, "lll", &rgid, &egid, &sgid))
-+ gid_t rgid, egid, sgid;
-+ if (!PyArg_ParseTuple(args, "O&O&O&",
-+ _PyArg_ParseGid, &rgid,
-+ _PyArg_ParseGid, &egid,
-+ _PyArg_ParseGid, &sgid))
-+
- return NULL;
- if (setresgid(rgid, egid, sgid) < 0)
- return posix_error();
-@@ -8613,14 +8549,13 @@ static PyObject*
- posix_getresuid (PyObject *self, PyObject *noargs)
- {
- uid_t ruid, euid, suid;
-- long l_ruid, l_euid, l_suid;
-+ PyObject *obj_ruid, *obj_euid, *obj_suid;
- if (getresuid(&ruid, &euid, &suid) < 0)
- return posix_error();
-- /* Force the values into long's as we don't know the size of uid_t. */
-- l_ruid = ruid;
-- l_euid = euid;
-- l_suid = suid;
-- return Py_BuildValue("(lll)", l_ruid, l_euid, l_suid);
-+ obj_ruid = _PyObject_FromUid(ruid);
-+ obj_euid = _PyObject_FromUid(euid);
-+ obj_suid = _PyObject_FromUid(suid);
-+ return Py_BuildValue("(NNN)", obj_ruid, obj_euid, obj_suid);
- }
- #endif
-
-@@ -8632,15 +8567,14 @@ Get tuple of the current process's real,
- static PyObject*
- posix_getresgid (PyObject *self, PyObject *noargs)
- {
-- uid_t rgid, egid, sgid;
-- long l_rgid, l_egid, l_sgid;
-+ gid_t rgid, egid, sgid;
-+ PyObject *obj_rgid, *obj_egid, *obj_sgid;
- if (getresgid(&rgid, &egid, &sgid) < 0)
- return posix_error();
-- /* Force the values into long's as we don't know the size of uid_t. */
-- l_rgid = rgid;
-- l_egid = egid;
-- l_sgid = sgid;
-- return Py_BuildValue("(lll)", l_rgid, l_egid, l_sgid);
-+ obj_rgid = _PyObject_FromGid(rgid);
-+ obj_egid = _PyObject_FromGid(egid);
-+ obj_sgid = _PyObject_FromGid(sgid);
-+ return Py_BuildValue("(NNN)", obj_rgid, obj_egid, obj_sgid);
- }
- #endif
-
-diff -up Python-2.7.3/Modules/pwdmodule.c.uid-gid-overflows
Python-2.7.3/Modules/pwdmodule.c
---- Python-2.7.3/Modules/pwdmodule.c.uid-gid-overflows 2012-04-09 19:07:34.000000000
-0400
-+++ Python-2.7.3/Modules/pwdmodule.c 2012-06-26 14:51:36.006817855 -0400
-@@ -73,8 +73,8 @@ mkpwent(struct passwd *p)
- #else
- SETS(setIndex++, p->pw_passwd);
- #endif
-- SETI(setIndex++, p->pw_uid);
-- SETI(setIndex++, p->pw_gid);
-+ PyStructSequence_SET_ITEM(v, setIndex++, _PyObject_FromUid(p->pw_uid));
-+ PyStructSequence_SET_ITEM(v, setIndex++, _PyObject_FromGid(p->pw_gid));
- #ifdef __VMS
- SETS(setIndex++, "");
- #else
-@@ -103,13 +103,14 @@ See help(pwd) for more on password datab
- static PyObject *
- pwd_getpwuid(PyObject *self, PyObject *args)
- {
-- unsigned int uid;
-+ uid_t uid;
- struct passwd *p;
-- if (!PyArg_ParseTuple(args, "I:getpwuid", &uid))
-+ if (!PyArg_ParseTuple(args, "O&:getpwuid",
-+ _PyArg_ParseUid, &uid))
- return NULL;
- if ((p = getpwuid(uid)) == NULL) {
- PyErr_Format(PyExc_KeyError,
-- "getpwuid(): uid not found: %d", uid);
-+ "getpwuid(): uid not found: %lu", (unsigned long)uid);
- return NULL;
- }
- return mkpwent(p);
-diff -up Python-2.7.3/Python/getargs.c.uid-gid-overflows Python-2.7.3/Python/getargs.c
---- Python-2.7.3/Python/getargs.c.uid-gid-overflows 2012-04-09 19:07:35.000000000 -0400
-+++ Python-2.7.3/Python/getargs.c 2012-06-26 14:51:36.007817842 -0400
-@@ -4,6 +4,7 @@
- #include "Python.h"
-
- #include <ctype.h>
-+#include <limits.h>
-
-
- #ifdef __cplusplus
-@@ -1902,6 +1903,110 @@ _PyArg_NoKeywords(const char *funcname,
- funcname);
- return 0;
- }
-+
-+PyObject *
-+_PyObject_FromUid(uid_t uid)
-+{
-+ if (uid <= (uid_t)LONG_MAX) {
-+ return PyInt_FromLong((uid_t)uid);
-+ } else {
-+ return PyLong_FromUnsignedLong((uid_t)uid);
-+ }
-+}
-+
-+PyObject *
-+_PyObject_FromGid(gid_t gid)
-+{
-+ if (gid <= (gid_t)LONG_MAX) {
-+ return PyInt_FromLong((gid_t)gid);
-+ } else {
-+ return PyLong_FromUnsignedLong((gid_t)gid);
-+ }
-+}
-+
-+int
-+_PyArg_ParseUid(PyObject *in_obj, uid_t *out_uid)
-+{
-+ PyObject *index, *number = NULL;
-+ long sl;
-+ unsigned long ul;
-+
-+ assert(out_uid);
-+
-+ index = PyNumber_Index(in_obj);
-+ if (index != NULL) {
-+ number = PyNumber_Long(index);
-+ Py_DECREF(index);
-+ }
-+ if (number == NULL) {
-+ PyErr_SetString(PyExc_TypeError, "user id must be integer");
-+ return 0;
-+ }
-+
-+ /* Special case: support -1 (e.g. for use by chown) */
-+ sl = PyLong_AsLong(number);
-+ if (PyErr_Occurred()) {
-+ PyErr_Clear();
-+ } else if (sl == -1) {
-+ Py_DECREF(number);
-+ *out_uid = (uid_t)-1;
-+ return 1;
-+ }
-+
-+ /* Otherwise, it must be >= 0 */
-+ ul = PyLong_AsUnsignedLong(number);
-+ Py_DECREF(number);
-+ *out_uid = ul;
-+ /* read back the value to see if it fitted in uid_t */
-+ if (PyErr_Occurred() || *out_uid != ul) {
-+ PyErr_SetString(PyExc_OverflowError,
-+ "user id is not in range(-1, 2^32-1)");
-+ return 0;
-+ }
-+ return 1;
-+}
-+
-+int
-+_PyArg_ParseGid(PyObject *in_obj, gid_t *out_gid)
-+{
-+ PyObject *index, *number = NULL;
-+ long sl;
-+ unsigned long ul;
-+
-+ assert(out_gid);
-+
-+ index = PyNumber_Index(in_obj);
-+ if (index != NULL) {
-+ number = PyNumber_Long(index);
-+ Py_DECREF(index);
-+ }
-+ if (number == NULL) {
-+ PyErr_SetString(PyExc_TypeError, "group id must be integer");
-+ return 0;
-+ }
-+
-+ /* Special case: support -1 (e.g. for use by chown) */
-+ sl = PyLong_AsLong(number);
-+ if (PyErr_Occurred()) {
-+ PyErr_Clear();
-+ } else if (sl == -1) {
-+ Py_DECREF(number);
-+ *out_gid = (gid_t)-1;
-+ return 1;
-+ }
-+
-+ ul = PyLong_AsUnsignedLong(number);
-+ Py_DECREF(number);
-+ *out_gid = ul;
-+ /* read back the value to see if it fitted in gid_t */
-+ if (PyErr_Occurred() || *out_gid != ul) {
-+ PyErr_SetString(PyExc_OverflowError,
-+ "group id is not in range(-1, 2^32-1)");
-+ return 0;
-+ }
-+ return 1;
-+}
-+
- #ifdef __cplusplus
- };
- #endif
diff --git a/00165-crypt-module-salt-backport.patch
b/00165-crypt-module-salt-backport.patch
index 6714fa1..4308b4c 100644
--- a/00165-crypt-module-salt-backport.patch
+++ b/00165-crypt-module-salt-backport.patch
@@ -266,7 +266,7 @@ diff -up Python-2.7.3/Modules/Setup.dist.crypt-module-salt-backport
Python-2.7.3
#
# First, look at Setup.config; configure may have set this for you.
--crypt cryptmodule.c -lcrypt # crypt(3); needs -lcrypt on some systems
+-crypt cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some systems
+_crypt _cryptmodule.c -lcrypt # crypt(3); needs -lcrypt on some systems
diff --git a/00170-gc-assertions.patch b/00170-gc-assertions.patch
index 088f84d..3fb37ff 100644
--- a/00170-gc-assertions.patch
+++ b/00170-gc-assertions.patch
@@ -7,9 +7,9 @@ diff -up Python-2.7.3/Lib/test/test_gc.py.gc-assertions
Python-2.7.3/Lib/test/te
+from test.test_support import verbose, run_unittest, import_module
import sys
+import sysconfig
+ import time
import gc
import weakref
-
@@ -32,6 +33,8 @@ class GC_Detector(object):
self.wr = weakref.ref(C1055820(666), it_happened)
diff --git a/00175-fix-configure-Wformat.patch b/00175-fix-configure-Wformat.patch
index b57208c..d527ab0 100644
--- a/00175-fix-configure-Wformat.patch
+++ b/00175-fix-configure-Wformat.patch
@@ -1,6 +1,6 @@
-diff -up Python-2.7.3/configure.in.fix-configure-Wformat Python-2.7.3/configure.in
---- Python-2.7.3/configure.in.fix-configure-Wformat 2013-03-25 15:15:18.473888383 -0400
-+++ Python-2.7.3/configure.in 2013-03-25 15:15:32.513887426 -0400
+diff -up Python-2.7.3/configure.ac.fix-configure-Wformat Python-2.7.3/configure.ac
+--- Python-2.7.3/configure.ac.fix-configure-Wformat 2013-03-25 15:15:18.473888383 -0400
++++ Python-2.7.3/configure.ac 2013-03-25 15:15:32.513887426 -0400
@@ -1200,7 +1200,7 @@ if test "$GCC" = "yes"
then
AC_MSG_CHECKING(whether gcc supports ParseTuple __format__)
diff --git a/05000-autotool-intermediates.patch b/05000-autotool-intermediates.patch
index 2847d47..4a40a56 100644
--- a/05000-autotool-intermediates.patch
+++ b/05000-autotool-intermediates.patch
@@ -1,44 +1,7 @@
diff -up ./configure.autotool-intermediates ./configure
---- ./configure.autotool-intermediates 2013-03-25 15:25:30.438846538 -0400
-+++ ./configure 2013-03-25 15:25:32.496846397 -0400
-@@ -1,7 +1,7 @@
- #! /bin/sh
- # From configure.in Revision.
- # Guess values for system-dependent variables and create Makefiles.
--# Generated by GNU Autoconf 2.67 for python 2.7.
-+# Generated by GNU Autoconf 2.68 for python 2.7.
- #
- # Report bugs to <
http://bugs.python.org/>.
- #
-@@ -92,6 +92,7 @@ fi
- IFS=" "" $as_nl"
-
- # Find who we are. Look in the path if we contain no directory separator.
-+as_myself=
- case $0 in #((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-@@ -217,11 +218,18 @@ IFS=$as_save_IFS
- # We cannot yet assume a decent shell, so we have to provide a
- # neutralization value for shells without unset; and this also
- # works around shells that cannot unset nonexistent variables.
-+ # Preserve -v and -x to the replacement shell.
- BASH_ENV=/dev/null
- ENV=/dev/null
- (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
- export CONFIG_SHELL
-- exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
-+ case $- in # ((((
-+ *v*x* | *x*v* ) as_opts=-vx ;;
-+ *v* ) as_opts=-v ;;
-+ *x* ) as_opts=-x ;;
-+ * ) as_opts= ;;
-+ esac
-+ exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
- fi
-
- if test x$as_have_required = xno; then :
-@@ -611,6 +619,8 @@ TRUE
+--- ./configure.autotool-intermediates 2013-04-09 11:24:01.024185796 +0200
++++ ./configure 2013-04-09 11:24:01.780183954 +0200
+@@ -639,6 +639,8 @@ TRUE
MACHDEP_OBJS
DYNLOADFILE
DLINCLDIR
@@ -47,16 +10,16 @@ diff -up ./configure.autotool-intermediates ./configure
THREADOBJ
LDLAST
USE_THREAD_MODULE
-@@ -631,6 +641,8 @@ OTHER_LIBTOOL_OPT
+@@ -659,6 +661,8 @@ OTHER_LIBTOOL_OPT
UNIVERSAL_ARCH_FLAGS
BASECFLAGS
OPT
+DEBUG_SUFFIX
+DEBUG_EXT
LN
+ MKDIR_P
INSTALL_DATA
- INSTALL_SCRIPT
-@@ -752,8 +764,11 @@ with_pth
+@@ -795,8 +799,11 @@ with_pth
enable_ipv6
with_doc_strings
with_tsc
@@ -68,16 +31,7 @@ diff -up ./configure.autotool-intermediates ./configure
with_wctype_functions
with_fpectl
with_libm
-@@ -1174,7 +1189,7 @@ Try \`$0 --help' for more information"
- $as_echo "$as_me: WARNING: you should use --build, --host, --target"
>&2
- expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null
&&
- $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-- : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
-+ : "${build_alias=$ac_option} ${host_alias=$ac_option}
${target_alias=$ac_option}"
- ;;
-
- esac
-@@ -1427,8 +1442,11 @@ Optional Packages:
+@@ -1472,8 +1479,11 @@ Optional Packages:
--with-pth use GNU pth threading libraries
--with(out)-doc-strings disable/enable documentation strings
--with(out)-tsc enable/disable timestamp counter profile
@@ -89,461 +43,7 @@ diff -up ./configure.autotool-intermediates ./configure
--with-wctype-functions use wctype.h functions
--with-fpectl enable SIGFPE catching
--with-libm=STRING math library
-@@ -1511,7 +1529,7 @@ test -n "$ac_init_help" && exit $ac_stat
- if $ac_init_version; then
- cat <<\_ACEOF
- python configure 2.7
--generated by GNU Autoconf 2.67
-+generated by GNU Autoconf 2.68
-
- Copyright (C) 2010 Free Software Foundation, Inc.
- This configure script is free software; the Free Software Foundation
-@@ -1557,7 +1575,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
- fi
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
- } # ac_fn_c_try_compile
-@@ -1594,7 +1612,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
- fi
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
- } # ac_fn_c_try_cpp
-@@ -1607,10 +1625,10 @@ fi
- ac_fn_c_check_header_mongrel ()
- {
- as_lineno=${as_lineno-"$1"}
as_lineno_stack=as_lineno_stack=$as_lineno_stack
-- if eval "test \"\${$3+set}\"" = set; then :
-+ if eval \${$3+:} false; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
- $as_echo_n "checking for $2... " >&6; }
--if eval "test \"\${$3+set}\"" = set; then :
-+if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
- fi
- eval ac_res=\$$3
-@@ -1677,7 +1695,7 @@ $as_echo "$as_me: WARNING: $2: proceedin
- esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
- $as_echo_n "checking for $2... " >&6; }
--if eval "test \"\${$3+set}\"" = set; then :
-+if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- eval "$3=\$ac_header_compiler"
-@@ -1686,7 +1704,7 @@ eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
- $as_echo "$ac_res" >&6; }
- fi
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
- } # ac_fn_c_check_header_mongrel
-
-@@ -1727,7 +1745,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
- ac_retval=$ac_status
- fi
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
- } # ac_fn_c_try_run
-@@ -1741,7 +1759,7 @@ ac_fn_c_check_header_compile ()
- as_lineno=${as_lineno-"$1"}
as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
- $as_echo_n "checking for $2... " >&6; }
--if eval "test \"\${$3+set}\"" = set; then :
-+if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -1759,7 +1777,7 @@ fi
- eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
- $as_echo "$ac_res" >&6; }
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
- } # ac_fn_c_check_header_compile
-
-@@ -1804,7 +1822,7 @@ fi
- # interfere with the next link command; also delete a directory that is
- # left behind by Apple's compiler. We do this before executing the actions.
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
- } # ac_fn_c_try_link
-@@ -1818,7 +1836,7 @@ ac_fn_c_check_type ()
- as_lineno=${as_lineno-"$1"}
as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
- $as_echo_n "checking for $2... " >&6; }
--if eval "test \"\${$3+set}\"" = set; then :
-+if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- eval "$3=no"
-@@ -1859,7 +1877,7 @@ fi
- eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
- $as_echo "$ac_res" >&6; }
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
- } # ac_fn_c_check_type
-
-@@ -1872,7 +1890,7 @@ ac_fn_c_find_uintX_t ()
- as_lineno=${as_lineno-"$1"}
as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5
- $as_echo_n "checking for uint$2_t... " >&6; }
--if eval "test \"\${$3+set}\"" = set; then :
-+if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- eval "$3=no"
-@@ -1912,7 +1930,7 @@ fi
- eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
- $as_echo "$ac_res" >&6; }
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
- } # ac_fn_c_find_uintX_t
-
-@@ -1925,7 +1943,7 @@ ac_fn_c_find_intX_t ()
- as_lineno=${as_lineno-"$1"}
as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5
- $as_echo_n "checking for int$2_t... " >&6; }
--if eval "test \"\${$3+set}\"" = set; then :
-+if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- eval "$3=no"
-@@ -1986,7 +2004,7 @@ fi
- eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
- $as_echo "$ac_res" >&6; }
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
- } # ac_fn_c_find_intX_t
-
-@@ -2163,7 +2181,7 @@ rm -f core *.core core.conftest.* gmon.o
- rm -f conftest.val
-
- fi
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
- } # ac_fn_c_compute_int
-@@ -2176,7 +2194,7 @@ ac_fn_c_check_func ()
- as_lineno=${as_lineno-"$1"}
as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
- $as_echo_n "checking for $2... " >&6; }
--if eval "test \"\${$3+set}\"" = set; then :
-+if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -2231,7 +2249,7 @@ fi
- eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
- $as_echo "$ac_res" >&6; }
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
- } # ac_fn_c_check_func
-
-@@ -2244,7 +2262,7 @@ ac_fn_c_check_member ()
- as_lineno=${as_lineno-"$1"}
as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
- $as_echo_n "checking for $2.$3... " >&6; }
--if eval "test \"\${$4+set}\"" = set; then :
-+if eval \${$4+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -2288,7 +2306,7 @@ fi
- eval ac_res=\$$4
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
- $as_echo "$ac_res" >&6; }
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
- } # ac_fn_c_check_member
-
-@@ -2303,7 +2321,7 @@ ac_fn_c_check_decl ()
- as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/)
0& (/g'`
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is
declared" >&5
- $as_echo_n "checking whether $as_decl_name is declared... " >&6; }
--if eval "test \"\${$3+set}\"" = set; then :
-+if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -2334,7 +2352,7 @@ fi
- eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
- $as_echo "$ac_res" >&6; }
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
- } # ac_fn_c_check_decl
- cat >config.log <<_ACEOF
-@@ -2342,7 +2360,7 @@ This file contains any messages produced
- running configure, to aid debugging if configure makes a mistake.
-
- It was created by python $as_me 2.7, which was
--generated by GNU Autoconf 2.67. Invocation command line was
-+generated by GNU Autoconf 2.68. Invocation command line was
-
- $ $0 $@
-
-@@ -2600,7 +2618,7 @@ $as_echo "$as_me: loading site script $a
- || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error $? "failed to load site script $ac_site_file
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- fi
- done
-
-@@ -3241,7 +3259,7 @@ if test -n "$ac_tool_prefix"; then
- set dummy ${ac_tool_prefix}gcc; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_CC+set}" = set; then :
-+if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$CC"; then
-@@ -3281,7 +3299,7 @@ if test -z "$ac_cv_prog_CC"; then
- set dummy gcc; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
-+if ${ac_cv_prog_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$ac_ct_CC"; then
-@@ -3334,7 +3352,7 @@ if test -z "$CC"; then
- set dummy ${ac_tool_prefix}cc; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_CC+set}" = set; then :
-+if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$CC"; then
-@@ -3374,7 +3392,7 @@ if test -z "$CC"; then
- set dummy cc; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_CC+set}" = set; then :
-+if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$CC"; then
-@@ -3433,7 +3451,7 @@ if test -z "$CC"; then
- set dummy $ac_tool_prefix$ac_prog; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_CC+set}" = set; then :
-+if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$CC"; then
-@@ -3477,7 +3495,7 @@ do
- set dummy $ac_prog; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
-+if ${ac_cv_prog_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$ac_ct_CC"; then
-@@ -3532,7 +3550,7 @@ fi
- test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}:
error: in \`$ac_pwd':" >&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error $? "no acceptable C compiler found in \$PATH
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
-
- # Provide some information about the compiler.
- $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version"
>&5
-@@ -3647,7 +3665,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "C compiler cannot create executables
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
- $as_echo "yes" >&6; }
-@@ -3690,7 +3708,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error $? "cannot compute suffix of executables: cannot compile and link
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- fi
- rm -f conftest conftest$ac_cv_exeext
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
-@@ -3749,7 +3767,7 @@ $as_echo "$ac_try_echo"; } >&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error $? "cannot run C compiled programs.
- If you meant to cross compile, use \`--host'.
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- fi
- fi
- fi
-@@ -3760,7 +3778,7 @@ rm -f conftest.$ac_ext conftest$ac_cv_ex
- ac_clean_files=$ac_clean_files_save
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files"
>&5
- $as_echo_n "checking for suffix of object files... " >&6; }
--if test "${ac_cv_objext+set}" = set; then :
-+if ${ac_cv_objext+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -3801,7 +3819,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error $? "cannot compute suffix of object files: cannot compile
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- fi
- rm -f conftest.$ac_cv_objext conftest.$ac_ext
- fi
-@@ -3811,7 +3829,7 @@ OBJEXT=$ac_cv_objext
- ac_objext=$OBJEXT
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C
compiler" >&5
- $as_echo_n "checking whether we are using the GNU C compiler... " >&6;
}
--if test "${ac_cv_c_compiler_gnu+set}" = set; then :
-+if ${ac_cv_c_compiler_gnu+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -3848,7 +3866,7 @@ ac_test_CFLAGS=${CFLAGS+set}
- ac_save_CFLAGS=$CFLAGS
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g"
>&5
- $as_echo_n "checking whether $CC accepts -g... " >&6; }
--if test "${ac_cv_prog_cc_g+set}" = set; then :
-+if ${ac_cv_prog_cc_g+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_save_c_werror_flag=$ac_c_werror_flag
-@@ -3926,7 +3944,7 @@ else
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO
C89" >&5
- $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
--if test "${ac_cv_prog_cc_c89+set}" = set; then :
-+if ${ac_cv_prog_cc_c89+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_cv_prog_cc_c89=no
-@@ -4065,7 +4083,7 @@ then
- set dummy g++; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_path_CXX+set}" = set; then :
-+if ${ac_cv_path_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- case $CXX in
-@@ -4106,7 +4124,7 @@ fi
- set dummy c++; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_path_CXX+set}" = set; then :
-+if ${ac_cv_path_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- case $CXX in
-@@ -4157,7 +4175,7 @@ do
- set dummy $ac_prog; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_CXX+set}" = set; then :
-+if ${ac_cv_prog_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$CXX"; then
-@@ -4228,7 +4246,7 @@ if test -n "$CPP" && test -d "$CPP";
the
- CPP=
- fi
- if test -z "$CPP"; then
-- if test "${ac_cv_prog_CPP+set}" = set; then :
-+ if ${ac_cv_prog_CPP+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- # Double quotes because CPP needs to be expanded
-@@ -4344,7 +4362,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- fi
-
- ac_ext=c
-@@ -4356,7 +4374,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines
and -e" >&5
- $as_echo_n "checking for grep that handles long lines and -e... " >&6;
}
--if test "${ac_cv_path_GREP+set}" = set; then :
-+if ${ac_cv_path_GREP+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -z "$GREP"; then
-@@ -4419,7 +4437,7 @@ $as_echo "$ac_cv_path_GREP" >&6; }
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
- $as_echo_n "checking for egrep... " >&6; }
--if test "${ac_cv_path_EGREP+set}" = set; then :
-+if ${ac_cv_path_EGREP+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
-@@ -4486,7 +4504,7 @@ $as_echo "$ac_cv_path_EGREP" >&6; }
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files"
>&5
- $as_echo_n "checking for ANSI C header files... " >&6; }
--if test "${ac_cv_header_stdc+set}" = set; then :
-+if ${ac_cv_header_stdc+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -4615,7 +4633,7 @@ done
-
-
- ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h"
"ac_cv_header_minix_config_h" "$ac_includes_default"
--if test "x$ac_cv_header_minix_config_h" = x""yes; then :
-+if test "x$ac_cv_header_minix_config_h" = xyes; then :
- MINIX=yes
- else
- MINIX=
-@@ -4637,7 +4655,7 @@ $as_echo "#define _MINIX 1" >>confdefs.h
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define
__EXTENSIONS__" >&5
- $as_echo_n "checking whether it is safe to define __EXTENSIONS__... "
>&6; }
--if test "${ac_cv_safe_to_define___extensions__+set}" = set; then :
-+if ${ac_cv_safe_to_define___extensions__+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -4747,7 +4765,7 @@ esac
+@@ -5171,7 +5181,7 @@ esac
$as_echo_n "checking LIBRARY... " >&6; }
if test -z "$LIBRARY"
then
@@ -552,7 +52,7 @@ diff -up ./configure.autotool-intermediates ./configure
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBRARY" >&5
$as_echo "$LIBRARY" >&6; }
-@@ -4921,8 +4939,8 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>
+@@ -5343,8 +5353,8 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>
INSTSONAME="$LDLIBRARY".$SOVERSION
;;
Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*)
@@ -563,7 +63,7 @@ diff -up ./configure.autotool-intermediates ./configure
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
case $ac_sys_system in
FreeBSD*)
-@@ -4945,7 +4963,7 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>
+@@ -5367,7 +5377,7 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>
;;
OSF*)
LDLIBRARY='libpython$(VERSION).so'
@@ -572,61 +72,7 @@ diff -up ./configure.autotool-intermediates ./configure
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
;;
atheos*)
-@@ -4981,7 +4999,7 @@ if test -n "$ac_tool_prefix"; then
- set dummy ${ac_tool_prefix}ranlib; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_RANLIB+set}" = set; then :
-+if ${ac_cv_prog_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$RANLIB"; then
-@@ -5021,7 +5039,7 @@ if test -z "$ac_cv_prog_RANLIB"; then
- set dummy ranlib; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then :
-+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$ac_ct_RANLIB"; then
-@@ -5075,7 +5093,7 @@ do
- set dummy $ac_prog; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_AR+set}" = set; then :
-+if ${ac_cv_prog_AR+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$AR"; then
-@@ -5125,7 +5143,7 @@ fi
- set dummy svnversion; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_SVNVERSION+set}" = set; then :
-+if ${ac_cv_prog_SVNVERSION+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$SVNVERSION"; then
-@@ -5173,7 +5191,7 @@ fi
- set dummy hg; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_HAS_HG+set}" = set; then :
-+if ${ac_cv_prog_HAS_HG+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$HAS_HG"; then
-@@ -5272,7 +5290,7 @@ ac_configure="$SHELL $ac_aux_dir/configu
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible
install" >&5
- $as_echo_n "checking for a BSD-compatible install... " >&6; }
- if test -z "$INSTALL"; then
--if test "${ac_cv_path_install+set}" = set; then :
-+if ${ac_cv_path_install+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-@@ -5384,6 +5402,14 @@ $as_echo "no" >&6; }
+@@ -5894,6 +5904,14 @@ $as_echo "no" >&6; }
fi
@@ -641,34 +87,7 @@ diff -up ./configure.autotool-intermediates ./configure
# XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
# merged with this chunk of code?
-@@ -5460,7 +5486,7 @@ yes)
- $as_echo_n "checking whether $CC accepts -fno-strict-aliasing... " >&6;
}
- ac_save_cc="$CC"
- CC="$CC -fno-strict-aliasing"
-- if test "${ac_cv_no_strict_aliasing_ok+set}" = set; then :
-+ if ${ac_cv_no_strict_aliasing_ok+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -5650,7 +5676,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts
-OPT:Olimit=0" >&5
- $as_echo_n "checking whether $CC accepts -OPT:Olimit=0... " >&6; }
--if test "${ac_cv_opt_olimit_ok+set}" = set; then :
-+if ${ac_cv_opt_olimit_ok+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_save_cc="$CC"
-@@ -5692,7 +5718,7 @@ if test $ac_cv_opt_olimit_ok = yes; then
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Olimit
1500" >&5
- $as_echo_n "checking whether $CC accepts -Olimit 1500... " >&6; }
-- if test "${ac_cv_olimit_ok+set}" = set; then :
-+ if ${ac_cv_olimit_ok+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_save_cc="$CC"
-@@ -5731,7 +5757,7 @@ then
+@@ -6253,7 +6271,7 @@ then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc supports ParseTuple
__format__" >&5
$as_echo_n "checking whether gcc supports ParseTuple __format__... "
>&6; }
save_CFLAGS=$CFLAGS
@@ -677,821 +96,7 @@ diff -up ./configure.autotool-intermediates ./configure
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-@@ -5770,7 +5796,7 @@ fi
- # options before we can check whether -Kpthread improves anything.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads are available
without options" >&5
- $as_echo_n "checking whether pthreads are available without options... "
>&6; }
--if test "${ac_cv_pthread_is_default+set}" = set; then :
-+if ${ac_cv_pthread_is_default+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test "$cross_compiling" = yes; then :
-@@ -5823,7 +5849,7 @@ else
- # function available.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts
-Kpthread" >&5
- $as_echo_n "checking whether $CC accepts -Kpthread... " >&6; }
--if test "${ac_cv_kpthread+set}" = set; then :
-+if ${ac_cv_kpthread+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_save_cc="$CC"
-@@ -5872,7 +5898,7 @@ then
- # function available.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts
-Kthread" >&5
- $as_echo_n "checking whether $CC accepts -Kthread... " >&6; }
--if test "${ac_cv_kthread+set}" = set; then :
-+if ${ac_cv_kthread+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_save_cc="$CC"
-@@ -5921,7 +5947,7 @@ then
- # function available.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts
-pthread" >&5
- $as_echo_n "checking whether $CC accepts -pthread... " >&6; }
--if test "${ac_cv_thread+set}" = set; then :
-+if ${ac_cv_thread+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_save_cc="$CC"
-@@ -6006,7 +6032,7 @@ CXX="$ac_save_cxx"
- # checks for header files
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files"
>&5
- $as_echo_n "checking for ANSI C header files... " >&6; }
--if test "${ac_cv_header_stdc+set}" = set; then :
-+if ${ac_cv_header_stdc+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -6145,7 +6171,7 @@ for ac_hdr in dirent.h sys/ndir.h sys/di
- as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines
DIR" >&5
- $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; }
--if eval "test \"\${$as_ac_Header+set}\"" = set; then :
-+if eval \${$as_ac_Header+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -6185,7 +6211,7 @@ done
- if test $ac_header_dirent = dirent.h; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing
opendir" >&5
- $as_echo_n "checking for library containing opendir... " >&6; }
--if test "${ac_cv_search_opendir+set}" = set; then :
-+if ${ac_cv_search_opendir+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_func_search_save_LIBS=$LIBS
-@@ -6219,11 +6245,11 @@ for ac_lib in '' dir; do
- fi
- rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
-- if test "${ac_cv_search_opendir+set}" = set; then :
-+ if ${ac_cv_search_opendir+:} false; then :
- break
- fi
- done
--if test "${ac_cv_search_opendir+set}" = set; then :
-+if ${ac_cv_search_opendir+:} false; then :
-
- else
- ac_cv_search_opendir=no
-@@ -6242,7 +6268,7 @@ fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing
opendir" >&5
- $as_echo_n "checking for library containing opendir... " >&6; }
--if test "${ac_cv_search_opendir+set}" = set; then :
-+if ${ac_cv_search_opendir+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_func_search_save_LIBS=$LIBS
-@@ -6276,11 +6302,11 @@ for ac_lib in '' x; do
- fi
- rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
-- if test "${ac_cv_search_opendir+set}" = set; then :
-+ if ${ac_cv_search_opendir+:} false; then :
- break
- fi
- done
--if test "${ac_cv_search_opendir+set}" = set; then :
-+if ${ac_cv_search_opendir+:} false; then :
-
- else
- ac_cv_search_opendir=no
-@@ -6300,7 +6326,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sys/types.h defines
makedev" >&5
- $as_echo_n "checking whether sys/types.h defines makedev... " >&6; }
--if test "${ac_cv_header_sys_types_h_makedev+set}" = set; then :
-+if ${ac_cv_header_sys_types_h_makedev+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -6328,7 +6354,7 @@ $as_echo "$ac_cv_header_sys_types_h_make
-
- if test $ac_cv_header_sys_types_h_makedev = no; then
- ac_fn_c_check_header_mongrel "$LINENO" "sys/mkdev.h"
"ac_cv_header_sys_mkdev_h" "$ac_includes_default"
--if test "x$ac_cv_header_sys_mkdev_h" = x""yes; then :
-+if test "x$ac_cv_header_sys_mkdev_h" = xyes; then :
-
- $as_echo "#define MAJOR_IN_MKDEV 1" >>confdefs.h
-
-@@ -6338,7 +6364,7 @@ fi
-
- if test $ac_cv_header_sys_mkdev_h = no; then
- ac_fn_c_check_header_mongrel "$LINENO" "sys/sysmacros.h"
"ac_cv_header_sys_sysmacros_h" "$ac_includes_default"
--if test "x$ac_cv_header_sys_sysmacros_h" = x""yes; then :
-+if test "x$ac_cv_header_sys_sysmacros_h" = xyes; then :
-
- $as_echo "#define MAJOR_IN_SYSMACROS 1" >>confdefs.h
-
-@@ -6358,7 +6384,7 @@ do :
- #endif
-
- "
--if test "x$ac_cv_header_term_h" = x""yes; then :
-+if test "x$ac_cv_header_term_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_TERM_H 1
- _ACEOF
-@@ -6380,7 +6406,7 @@ do :
- #endif
-
- "
--if test "x$ac_cv_header_linux_netlink_h" = x""yes; then :
-+if test "x$ac_cv_header_linux_netlink_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_LINUX_NETLINK_H 1
- _ACEOF
-@@ -6543,7 +6569,7 @@ EOF
-
- # Type availability checks
- ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t"
"$ac_includes_default"
--if test "x$ac_cv_type_mode_t" = x""yes; then :
-+if test "x$ac_cv_type_mode_t" = xyes; then :
-
- else
-
-@@ -6554,7 +6580,7 @@ _ACEOF
- fi
-
- ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t"
"$ac_includes_default"
--if test "x$ac_cv_type_off_t" = x""yes; then :
-+if test "x$ac_cv_type_off_t" = xyes; then :
-
- else
-
-@@ -6565,7 +6591,7 @@ _ACEOF
- fi
-
- ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t"
"$ac_includes_default"
--if test "x$ac_cv_type_pid_t" = x""yes; then :
-+if test "x$ac_cv_type_pid_t" = xyes; then :
-
- else
-
-@@ -6581,7 +6607,7 @@ cat >>confdefs.h <<_ACEOF
- _ACEOF
-
- ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t"
"$ac_includes_default"
--if test "x$ac_cv_type_size_t" = x""yes; then :
-+if test "x$ac_cv_type_size_t" = xyes; then :
-
- else
-
-@@ -6593,7 +6619,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h"
>&5
- $as_echo_n "checking for uid_t in sys/types.h... " >&6; }
--if test "${ac_cv_type_uid_t+set}" = set; then :
-+if ${ac_cv_type_uid_t+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -6672,7 +6698,7 @@ _ACEOF
- esac
-
- ac_fn_c_check_type "$LINENO" "ssize_t"
"ac_cv_type_ssize_t" "$ac_includes_default"
--if test "x$ac_cv_type_ssize_t" = x""yes; then :
-+if test "x$ac_cv_type_ssize_t" = xyes; then :
-
- $as_echo "#define HAVE_SSIZE_T 1" >>confdefs.h
-
-@@ -6687,7 +6713,7 @@ fi
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5
- $as_echo_n "checking size of int... " >&6; }
--if test "${ac_cv_sizeof_int+set}" = set; then :
-+if ${ac_cv_sizeof_int+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))"
"ac_cv_sizeof_int" "$ac_includes_default"; then :
-@@ -6697,7 +6723,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (int)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_int=0
- fi
-@@ -6720,7 +6746,7 @@ _ACEOF
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
- $as_echo_n "checking size of long... " >&6; }
--if test "${ac_cv_sizeof_long+set}" = set; then :
-+if ${ac_cv_sizeof_long+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))"
"ac_cv_sizeof_long" "$ac_includes_default"; then :
-@@ -6730,7 +6756,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (long)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_long=0
- fi
-@@ -6753,7 +6779,7 @@ _ACEOF
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5
- $as_echo_n "checking size of void *... " >&6; }
--if test "${ac_cv_sizeof_void_p+set}" = set; then :
-+if ${ac_cv_sizeof_void_p+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))"
"ac_cv_sizeof_void_p" "$ac_includes_default"; then :
-@@ -6763,7 +6789,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (void *)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_void_p=0
- fi
-@@ -6786,7 +6812,7 @@ _ACEOF
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5
- $as_echo_n "checking size of short... " >&6; }
--if test "${ac_cv_sizeof_short+set}" = set; then :
-+if ${ac_cv_sizeof_short+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))"
"ac_cv_sizeof_short" "$ac_includes_default"; then :
-@@ -6796,7 +6822,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (short)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_short=0
- fi
-@@ -6819,7 +6845,7 @@ _ACEOF
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of float" >&5
- $as_echo_n "checking size of float... " >&6; }
--if test "${ac_cv_sizeof_float+set}" = set; then :
-+if ${ac_cv_sizeof_float+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (float))"
"ac_cv_sizeof_float" "$ac_includes_default"; then :
-@@ -6829,7 +6855,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (float)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_float=0
- fi
-@@ -6852,7 +6878,7 @@ _ACEOF
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of double" >&5
- $as_echo_n "checking size of double... " >&6; }
--if test "${ac_cv_sizeof_double+set}" = set; then :
-+if ${ac_cv_sizeof_double+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (double))"
"ac_cv_sizeof_double" "$ac_includes_default"; then :
-@@ -6862,7 +6888,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (double)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_double=0
- fi
-@@ -6885,7 +6911,7 @@ _ACEOF
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of fpos_t" >&5
- $as_echo_n "checking size of fpos_t... " >&6; }
--if test "${ac_cv_sizeof_fpos_t+set}" = set; then :
-+if ${ac_cv_sizeof_fpos_t+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (fpos_t))"
"ac_cv_sizeof_fpos_t" "$ac_includes_default"; then :
-@@ -6895,7 +6921,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (fpos_t)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_fpos_t=0
- fi
-@@ -6918,7 +6944,7 @@ _ACEOF
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5
- $as_echo_n "checking size of size_t... " >&6; }
--if test "${ac_cv_sizeof_size_t+set}" = set; then :
-+if ${ac_cv_sizeof_size_t+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))"
"ac_cv_sizeof_size_t" "$ac_includes_default"; then :
-@@ -6928,7 +6954,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (size_t)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_size_t=0
- fi
-@@ -6951,7 +6977,7 @@ _ACEOF
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of pid_t" >&5
- $as_echo_n "checking size of pid_t... " >&6; }
--if test "${ac_cv_sizeof_pid_t+set}" = set; then :
-+if ${ac_cv_sizeof_pid_t+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pid_t))"
"ac_cv_sizeof_pid_t" "$ac_includes_default"; then :
-@@ -6961,7 +6987,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (pid_t)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_pid_t=0
- fi
-@@ -7011,7 +7037,7 @@ if test "$have_long_long" = yes ; then
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long"
>&5
- $as_echo_n "checking size of long long... " >&6; }
--if test "${ac_cv_sizeof_long_long+set}" = set; then :
-+if ${ac_cv_sizeof_long_long+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))"
"ac_cv_sizeof_long_long" "$ac_includes_default"; then :
-@@ -7021,7 +7047,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (long long)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_long_long=0
- fi
-@@ -7072,7 +7098,7 @@ if test "$have_long_double" = yes ; then
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long double"
>&5
- $as_echo_n "checking size of long double... " >&6; }
--if test "${ac_cv_sizeof_long_double+set}" = set; then :
-+if ${ac_cv_sizeof_long_double+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long
double))" "ac_cv_sizeof_long_double"
"$ac_includes_default"; then :
-@@ -7082,7 +7108,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (long double)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_long_double=0
- fi
-@@ -7133,7 +7159,7 @@ if test "$have_c99_bool" = yes ; then
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of _Bool" >&5
- $as_echo_n "checking size of _Bool... " >&6; }
--if test "${ac_cv_sizeof__Bool+set}" = set; then :
-+if ${ac_cv_sizeof__Bool+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (_Bool))"
"ac_cv_sizeof__Bool" "$ac_includes_default"; then :
-@@ -7143,7 +7169,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (_Bool)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof__Bool=0
- fi
-@@ -7169,7 +7195,7 @@ ac_fn_c_check_type "$LINENO" "uintptr_t"
- #include <inttypes.h>
- #endif
- "
--if test "x$ac_cv_type_uintptr_t" = x""yes; then :
-+if test "x$ac_cv_type_uintptr_t" = xyes; then :
-
- cat >>confdefs.h <<_ACEOF
- #define HAVE_UINTPTR_T 1
-@@ -7181,7 +7207,7 @@ _ACEOF
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of uintptr_t"
>&5
- $as_echo_n "checking size of uintptr_t... " >&6; }
--if test "${ac_cv_sizeof_uintptr_t+set}" = set; then :
-+if ${ac_cv_sizeof_uintptr_t+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (uintptr_t))"
"ac_cv_sizeof_uintptr_t" "$ac_includes_default"; then :
-@@ -7191,7 +7217,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (uintptr_t)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_uintptr_t=0
- fi
-@@ -7217,7 +7243,7 @@ fi
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5
- $as_echo_n "checking size of off_t... " >&6; }
--if test "${ac_cv_sizeof_off_t+set}" = set; then :
-+if ${ac_cv_sizeof_off_t+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))"
"ac_cv_sizeof_off_t" "
-@@ -7232,7 +7258,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (off_t)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_off_t=0
- fi
-@@ -7276,7 +7302,7 @@ fi
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of time_t" >&5
- $as_echo_n "checking size of time_t... " >&6; }
--if test "${ac_cv_sizeof_time_t+set}" = set; then :
-+if ${ac_cv_sizeof_time_t+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (time_t))"
"ac_cv_sizeof_time_t" "
-@@ -7294,7 +7320,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (time_t)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_time_t=0
- fi
-@@ -7350,7 +7376,7 @@ if test "$have_pthread_t" = yes ; then
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of pthread_t"
>&5
- $as_echo_n "checking size of pthread_t... " >&6; }
--if test "${ac_cv_sizeof_pthread_t+set}" = set; then :
-+if ${ac_cv_sizeof_pthread_t+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pthread_t))"
"ac_cv_sizeof_pthread_t" "
-@@ -7365,7 +7391,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (pthread_t)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_pthread_t=0
- fi
-@@ -7877,7 +7903,7 @@ $as_echo "$SHLIBS" >&6; }
- # checks for libraries
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl"
>&5
- $as_echo_n "checking for dlopen in -ldl... " >&6; }
--if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
-+if ${ac_cv_lib_dl_dlopen+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -7911,7 +7937,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen"
>&5
- $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
--if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
-+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_LIBDL 1
- _ACEOF
-@@ -7922,7 +7948,7 @@ fi
- # Dynamic linking for SunOS/Solaris and SYSV
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld"
>&5
- $as_echo_n "checking for shl_load in -ldld... " >&6; }
--if test "${ac_cv_lib_dld_shl_load+set}" = set; then :
-+if ${ac_cv_lib_dld_shl_load+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -7956,7 +7982,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load"
>&5
- $as_echo "$ac_cv_lib_dld_shl_load" >&6; }
--if test "x$ac_cv_lib_dld_shl_load" = x""yes; then :
-+if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_LIBDLD 1
- _ACEOF
-@@ -7970,7 +7996,7 @@ fi
- if test "$with_threads" = "yes" -o -z "$with_threads";
then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing
sem_init" >&5
- $as_echo_n "checking for library containing sem_init... " >&6; }
--if test "${ac_cv_search_sem_init+set}" = set; then :
-+if ${ac_cv_search_sem_init+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_func_search_save_LIBS=$LIBS
-@@ -8004,11 +8030,11 @@ for ac_lib in '' pthread rt posix4; do
- fi
- rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
-- if test "${ac_cv_search_sem_init+set}" = set; then :
-+ if ${ac_cv_search_sem_init+:} false; then :
- break
- fi
- done
--if test "${ac_cv_search_sem_init+set}" = set; then :
-+if ${ac_cv_search_sem_init+:} false; then :
-
- else
- ac_cv_search_sem_init=no
-@@ -8031,7 +8057,7 @@ fi
- # check if we need libintl for locale functions
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for textdomain in -lintl"
>&5
- $as_echo_n "checking for textdomain in -lintl... " >&6; }
--if test "${ac_cv_lib_intl_textdomain+set}" = set; then :
-+if ${ac_cv_lib_intl_textdomain+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -8065,7 +8091,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_textdomain"
>&5
- $as_echo "$ac_cv_lib_intl_textdomain" >&6; }
--if test "x$ac_cv_lib_intl_textdomain" = x""yes; then :
-+if test "x$ac_cv_lib_intl_textdomain" = xyes; then :
-
- $as_echo "#define WITH_LIBINTL 1" >>confdefs.h
-
-@@ -8112,7 +8138,7 @@ esac
- # BeOS' sockets are stashed in libnet.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for t_open in -lnsl"
>&5
- $as_echo_n "checking for t_open in -lnsl... " >&6; }
--if test "${ac_cv_lib_nsl_t_open+set}" = set; then :
-+if ${ac_cv_lib_nsl_t_open+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -8146,13 +8172,13 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_t_open"
>&5
- $as_echo "$ac_cv_lib_nsl_t_open" >&6; }
--if test "x$ac_cv_lib_nsl_t_open" = x""yes; then :
-+if test "x$ac_cv_lib_nsl_t_open" = xyes; then :
- LIBS="-lnsl $LIBS"
- fi
- # SVR4
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket"
>&5
- $as_echo_n "checking for socket in -lsocket... " >&6; }
--if test "${ac_cv_lib_socket_socket+set}" = set; then :
-+if ${ac_cv_lib_socket_socket+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -8186,7 +8212,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket"
>&5
- $as_echo "$ac_cv_lib_socket_socket" >&6; }
--if test "x$ac_cv_lib_socket_socket" = x""yes; then :
-+if test "x$ac_cv_lib_socket_socket" = xyes; then :
- LIBS="-lsocket $LIBS"
- fi
- # SVR4 sockets
-@@ -8195,7 +8221,7 @@ case "$ac_sys_system" in
- BeOS*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lnet"
>&5
- $as_echo_n "checking for socket in -lnet... " >&6; }
--if test "${ac_cv_lib_net_socket+set}" = set; then :
-+if ${ac_cv_lib_net_socket+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -8229,7 +8255,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_net_socket"
>&5
- $as_echo "$ac_cv_lib_net_socket" >&6; }
--if test "x$ac_cv_lib_net_socket" = x""yes; then :
-+if test "x$ac_cv_lib_net_socket" = xyes; then :
- LIBS="-lnet $LIBS"
- fi
- # BeOS
-@@ -8257,7 +8283,7 @@ if test -n "$ac_tool_prefix"; then
- set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
-+if ${ac_cv_path_PKG_CONFIG+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- case $PKG_CONFIG in
-@@ -8300,7 +8326,7 @@ if test -z "$ac_cv_path_PKG_CONFIG"; the
- set dummy pkg-config; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
-+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- case $ac_pt_PKG_CONFIG in
-@@ -8568,7 +8594,7 @@ $as_echo "$unistd_defines_pthreads" >&6;
- $as_echo "#define _REENTRANT 1" >>confdefs.h
-
- ac_fn_c_check_header_mongrel "$LINENO" "cthreads.h"
"ac_cv_header_cthreads_h" "$ac_includes_default"
--if test "x$ac_cv_header_cthreads_h" = x""yes; then :
-+if test "x$ac_cv_header_cthreads_h" = xyes; then :
- $as_echo "#define WITH_THREAD 1" >>confdefs.h
-
- $as_echo "#define C_THREADS 1" >>confdefs.h
-@@ -8581,7 +8607,7 @@ $as_echo "#define HURD_C_THREADS 1" >>co
- else
-
- ac_fn_c_check_header_mongrel "$LINENO" "mach/cthreads.h"
"ac_cv_header_mach_cthreads_h" "$ac_includes_default"
--if test "x$ac_cv_header_mach_cthreads_h" = x""yes; then :
-+if test "x$ac_cv_header_mach_cthreads_h" = xyes; then :
- $as_echo "#define WITH_THREAD 1" >>confdefs.h
-
- $as_echo "#define C_THREADS 1" >>confdefs.h
-@@ -8643,7 +8669,7 @@ else
-
- LIBS=$_libs
- ac_fn_c_check_func "$LINENO" "pthread_detach"
"ac_cv_func_pthread_detach"
--if test "x$ac_cv_func_pthread_detach" = x""yes; then :
-+if test "x$ac_cv_func_pthread_detach" = xyes; then :
- $as_echo "#define WITH_THREAD 1" >>confdefs.h
-
- posix_threads=yes
-@@ -8651,7 +8677,7 @@ if test "x$ac_cv_func_pthread_detach" =
- else
-
- ac_fn_c_check_header_mongrel "$LINENO" "atheos/threads.h"
"ac_cv_header_atheos_threads_h" "$ac_includes_default"
--if test "x$ac_cv_header_atheos_threads_h" = x""yes; then :
-+if test "x$ac_cv_header_atheos_threads_h" = xyes; then :
- $as_echo "#define WITH_THREAD 1" >>confdefs.h
-
-
-@@ -8661,7 +8687,7 @@ $as_echo "#define ATHEOS_THREADS 1" >>co
- else
-
- ac_fn_c_check_header_mongrel "$LINENO" "kernel/OS.h"
"ac_cv_header_kernel_OS_h" "$ac_includes_default"
--if test "x$ac_cv_header_kernel_OS_h" = x""yes; then :
-+if test "x$ac_cv_header_kernel_OS_h" = xyes; then :
- $as_echo "#define WITH_THREAD 1" >>confdefs.h
-
-
-@@ -8672,7 +8698,7 @@ else
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in
-lpthreads" >&5
- $as_echo_n "checking for pthread_create in -lpthreads... " >&6; }
--if test "${ac_cv_lib_pthreads_pthread_create+set}" = set; then :
-+if ${ac_cv_lib_pthreads_pthread_create+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -8706,7 +8732,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_pthreads_pthread_create" >&5
- $as_echo "$ac_cv_lib_pthreads_pthread_create" >&6; }
--if test "x$ac_cv_lib_pthreads_pthread_create" = x""yes; then :
-+if test "x$ac_cv_lib_pthreads_pthread_create" = xyes; then :
- $as_echo "#define WITH_THREAD 1" >>confdefs.h
-
- posix_threads=yes
-@@ -8716,7 +8742,7 @@ else
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in
-lc_r" >&5
- $as_echo_n "checking for pthread_create in -lc_r... " >&6; }
--if test "${ac_cv_lib_c_r_pthread_create+set}" = set; then :
-+if ${ac_cv_lib_c_r_pthread_create+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -8750,7 +8776,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_c_r_pthread_create" >&5
- $as_echo "$ac_cv_lib_c_r_pthread_create" >&6; }
--if test "x$ac_cv_lib_c_r_pthread_create" = x""yes; then :
-+if test "x$ac_cv_lib_c_r_pthread_create" = xyes; then :
- $as_echo "#define WITH_THREAD 1" >>confdefs.h
-
- posix_threads=yes
-@@ -8760,7 +8786,7 @@ else
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __pthread_create_system
in -lpthread" >&5
- $as_echo_n "checking for __pthread_create_system in -lpthread... " >&6;
}
--if test "${ac_cv_lib_pthread___pthread_create_system+set}" = set; then :
-+if ${ac_cv_lib_pthread___pthread_create_system+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -8794,7 +8820,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_pthread___pthread_create_system" >&5
- $as_echo "$ac_cv_lib_pthread___pthread_create_system" >&6; }
--if test "x$ac_cv_lib_pthread___pthread_create_system" = x""yes; then
:
-+if test "x$ac_cv_lib_pthread___pthread_create_system" = xyes; then :
- $as_echo "#define WITH_THREAD 1" >>confdefs.h
-
- posix_threads=yes
-@@ -8804,7 +8830,7 @@ else
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in
-lcma" >&5
- $as_echo_n "checking for pthread_create in -lcma... " >&6; }
--if test "${ac_cv_lib_cma_pthread_create+set}" = set; then :
-+if ${ac_cv_lib_cma_pthread_create+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -8838,7 +8864,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_cma_pthread_create" >&5
- $as_echo "$ac_cv_lib_cma_pthread_create" >&6; }
--if test "x$ac_cv_lib_cma_pthread_create" = x""yes; then :
-+if test "x$ac_cv_lib_cma_pthread_create" = xyes; then :
- $as_echo "#define WITH_THREAD 1" >>confdefs.h
-
- posix_threads=yes
-@@ -8878,7 +8904,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for usconfig in -lmpc"
>&5
- $as_echo_n "checking for usconfig in -lmpc... " >&6; }
--if test "${ac_cv_lib_mpc_usconfig+set}" = set; then :
-+if ${ac_cv_lib_mpc_usconfig+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -8912,7 +8938,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mpc_usconfig"
>&5
- $as_echo "$ac_cv_lib_mpc_usconfig" >&6; }
--if test "x$ac_cv_lib_mpc_usconfig" = x""yes; then :
-+if test "x$ac_cv_lib_mpc_usconfig" = xyes; then :
- $as_echo "#define WITH_THREAD 1" >>confdefs.h
-
- LIBS="$LIBS -lmpc"
-@@ -8924,7 +8950,7 @@ fi
- if test "$posix_threads" != "yes"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thr_create in
-lthread" >&5
- $as_echo_n "checking for thr_create in -lthread... " >&6; }
--if test "${ac_cv_lib_thread_thr_create+set}" = set; then :
-+if ${ac_cv_lib_thread_thr_create+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -8958,7 +8984,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_thread_thr_create"
>&5
- $as_echo "$ac_cv_lib_thread_thr_create" >&6; }
--if test "x$ac_cv_lib_thread_thr_create" = x""yes; then :
-+if test "x$ac_cv_lib_thread_thr_create" = xyes; then :
- $as_echo "#define WITH_THREAD 1" >>confdefs.h
-
- LIBS="$LIBS -lthread"
-@@ -9003,7 +9029,7 @@ $as_echo "#define HAVE_BROKEN_POSIX_SEMA
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if PTHREAD_SCOPE_SYSTEM is
supported" >&5
- $as_echo_n "checking if PTHREAD_SCOPE_SYSTEM is supported... " >&6; }
-- if test "${ac_cv_pthread_system_supported+set}" = set; then :
-+ if ${ac_cv_pthread_system_supported+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test "$cross_compiling" = yes; then :
-@@ -9046,7 +9072,7 @@ $as_echo "#define PTHREAD_SYSTEM_SCHED_S
- for ac_func in pthread_sigmask
- do :
- ac_fn_c_check_func "$LINENO" "pthread_sigmask"
"ac_cv_func_pthread_sigmask"
--if test "x$ac_cv_func_pthread_sigmask" = x""yes; then :
-+if test "x$ac_cv_func_pthread_sigmask" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_PTHREAD_SIGMASK 1
- _ACEOF
-@@ -9399,6 +9425,50 @@ $as_echo "no" >&6; }
+@@ -9958,6 +9976,50 @@ $as_echo "no" >&6; }
fi
@@ -1542,16 +147,7 @@ diff -up ./configure.autotool-intermediates ./configure
# Check for Python-specific malloc support
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-pymalloc"
>&5
$as_echo_n "checking for --with-pymalloc... " >&6; }
-@@ -9436,7 +9506,7 @@ fi
- $as_echo "$with_valgrind" >&6; }
- if test "$with_valgrind" != no; then
- ac_fn_c_check_header_mongrel "$LINENO" "valgrind/valgrind.h"
"ac_cv_header_valgrind_valgrind_h" "$ac_includes_default"
--if test "x$ac_cv_header_valgrind_valgrind_h" = x""yes; then :
-+if test "x$ac_cv_header_valgrind_valgrind_h" = xyes; then :
-
- $as_echo "#define WITH_VALGRIND 1" >>confdefs.h
-
-@@ -9448,6 +9518,46 @@ fi
+@@ -10007,6 +10069,46 @@ fi
fi
@@ -1598,1109 +194,9 @@ diff -up ./configure.autotool-intermediates ./configure
# Check for --with-wctype-functions
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-wctype-functions"
>&5
$as_echo_n "checking for --with-wctype-functions... " >&6; }
-@@ -9480,7 +9590,7 @@ DLINCLDIR=.
- for ac_func in dlopen
- do :
- ac_fn_c_check_func "$LINENO" "dlopen"
"ac_cv_func_dlopen"
--if test "x$ac_cv_func_dlopen" = x""yes; then :
-+if test "x$ac_cv_func_dlopen" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_DLOPEN 1
- _ACEOF
-@@ -9810,7 +9920,7 @@ rm -f core conftest.err conftest.$ac_obj
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flock declaration"
>&5
- $as_echo_n "checking for flock declaration... " >&6; }
--if test "${ac_cv_flock_decl+set}" = set; then :
-+if ${ac_cv_flock_decl+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -9840,7 +9950,7 @@ if test "x${ac_cv_flock_decl}" = xyes; t
- for ac_func in flock
- do :
- ac_fn_c_check_func "$LINENO" "flock" "ac_cv_func_flock"
--if test "x$ac_cv_func_flock" = x""yes; then :
-+if test "x$ac_cv_func_flock" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_FLOCK 1
- _ACEOF
-@@ -9848,7 +9958,7 @@ _ACEOF
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flock in -lbsd"
>&5
- $as_echo_n "checking for flock in -lbsd... " >&6; }
--if test "${ac_cv_lib_bsd_flock+set}" = set; then :
-+if ${ac_cv_lib_bsd_flock+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -9882,7 +9992,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_flock"
>&5
- $as_echo "$ac_cv_lib_bsd_flock" >&6; }
--if test "x$ac_cv_lib_bsd_flock" = x""yes; then :
-+if test "x$ac_cv_lib_bsd_flock" = xyes; then :
- $as_echo "#define HAVE_FLOCK 1" >>confdefs.h
-
-
-@@ -9959,7 +10069,7 @@ do
- set dummy $ac_prog; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_TRUE+set}" = set; then :
-+if ${ac_cv_prog_TRUE+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$TRUE"; then
-@@ -9999,7 +10109,7 @@ test -n "$TRUE" || TRUE="/bin/true"
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lc"
>&5
- $as_echo_n "checking for inet_aton in -lc... " >&6; }
--if test "${ac_cv_lib_c_inet_aton+set}" = set; then :
-+if ${ac_cv_lib_c_inet_aton+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -10033,12 +10143,12 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_inet_aton"
>&5
- $as_echo "$ac_cv_lib_c_inet_aton" >&6; }
--if test "x$ac_cv_lib_c_inet_aton" = x""yes; then :
-+if test "x$ac_cv_lib_c_inet_aton" = xyes; then :
- $ac_cv_prog_TRUE
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lresolv"
>&5
- $as_echo_n "checking for inet_aton in -lresolv... " >&6; }
--if test "${ac_cv_lib_resolv_inet_aton+set}" = set; then :
-+if ${ac_cv_lib_resolv_inet_aton+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -10072,7 +10182,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_inet_aton"
>&5
- $as_echo "$ac_cv_lib_resolv_inet_aton" >&6; }
--if test "x$ac_cv_lib_resolv_inet_aton" = x""yes; then :
-+if test "x$ac_cv_lib_resolv_inet_aton" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_LIBRESOLV 1
- _ACEOF
-@@ -10089,7 +10199,7 @@ fi
- # exit Python
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for chflags" >&5
- $as_echo_n "checking for chflags... " >&6; }
--if test "${ac_cv_have_chflags+set}" = set; then :
-+if ${ac_cv_have_chflags+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test "$cross_compiling" = yes; then :
-@@ -10123,7 +10233,7 @@ fi
- $as_echo "$ac_cv_have_chflags" >&6; }
- if test "$ac_cv_have_chflags" = cross ; then
- ac_fn_c_check_func "$LINENO" "chflags"
"ac_cv_func_chflags"
--if test "x$ac_cv_func_chflags" = x""yes; then :
-+if test "x$ac_cv_func_chflags" = xyes; then :
- ac_cv_have_chflags="yes"
- else
- ac_cv_have_chflags="no"
-@@ -10138,7 +10248,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lchflags" >&5
- $as_echo_n "checking for lchflags... " >&6; }
--if test "${ac_cv_have_lchflags+set}" = set; then :
-+if ${ac_cv_have_lchflags+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test "$cross_compiling" = yes; then :
-@@ -10172,7 +10282,7 @@ fi
- $as_echo "$ac_cv_have_lchflags" >&6; }
- if test "$ac_cv_have_lchflags" = cross ; then
- ac_fn_c_check_func "$LINENO" "lchflags"
"ac_cv_func_lchflags"
--if test "x$ac_cv_func_lchflags" = x""yes; then :
-+if test "x$ac_cv_func_lchflags" = xyes; then :
- ac_cv_have_lchflags="yes"
- else
- ac_cv_have_lchflags="no"
-@@ -10196,7 +10306,7 @@ esac
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateCopy in -lz"
>&5
- $as_echo_n "checking for inflateCopy in -lz... " >&6; }
--if test "${ac_cv_lib_z_inflateCopy+set}" = set; then :
-+if ${ac_cv_lib_z_inflateCopy+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -10230,7 +10340,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflateCopy"
>&5
- $as_echo "$ac_cv_lib_z_inflateCopy" >&6; }
--if test "x$ac_cv_lib_z_inflateCopy" = x""yes; then :
-+if test "x$ac_cv_lib_z_inflateCopy" = xyes; then :
-
- $as_echo "#define HAVE_ZLIB_COPY 1" >>confdefs.h
-
-@@ -10373,7 +10483,7 @@ rm -f core conftest.err conftest.$ac_obj
- for ac_func in openpty
- do :
- ac_fn_c_check_func "$LINENO" "openpty"
"ac_cv_func_openpty"
--if test "x$ac_cv_func_openpty" = x""yes; then :
-+if test "x$ac_cv_func_openpty" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_OPENPTY 1
- _ACEOF
-@@ -10381,7 +10491,7 @@ _ACEOF
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openpty in -lutil"
>&5
- $as_echo_n "checking for openpty in -lutil... " >&6; }
--if test "${ac_cv_lib_util_openpty+set}" = set; then :
-+if ${ac_cv_lib_util_openpty+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -10415,13 +10525,13 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_openpty"
>&5
- $as_echo "$ac_cv_lib_util_openpty" >&6; }
--if test "x$ac_cv_lib_util_openpty" = x""yes; then :
-+if test "x$ac_cv_lib_util_openpty" = xyes; then :
- $as_echo "#define HAVE_OPENPTY 1" >>confdefs.h
- LIBS="$LIBS -lutil"
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openpty in -lbsd"
>&5
- $as_echo_n "checking for openpty in -lbsd... " >&6; }
--if test "${ac_cv_lib_bsd_openpty+set}" = set; then :
-+if ${ac_cv_lib_bsd_openpty+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -10455,7 +10565,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_openpty"
>&5
- $as_echo "$ac_cv_lib_bsd_openpty" >&6; }
--if test "x$ac_cv_lib_bsd_openpty" = x""yes; then :
-+if test "x$ac_cv_lib_bsd_openpty" = xyes; then :
- $as_echo "#define HAVE_OPENPTY 1" >>confdefs.h
- LIBS="$LIBS -lbsd"
- fi
-@@ -10470,7 +10580,7 @@ done
- for ac_func in forkpty
- do :
- ac_fn_c_check_func "$LINENO" "forkpty"
"ac_cv_func_forkpty"
--if test "x$ac_cv_func_forkpty" = x""yes; then :
-+if test "x$ac_cv_func_forkpty" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_FORKPTY 1
- _ACEOF
-@@ -10478,7 +10588,7 @@ _ACEOF
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for forkpty in -lutil"
>&5
- $as_echo_n "checking for forkpty in -lutil... " >&6; }
--if test "${ac_cv_lib_util_forkpty+set}" = set; then :
-+if ${ac_cv_lib_util_forkpty+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -10512,13 +10622,13 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_forkpty"
>&5
- $as_echo "$ac_cv_lib_util_forkpty" >&6; }
--if test "x$ac_cv_lib_util_forkpty" = x""yes; then :
-+if test "x$ac_cv_lib_util_forkpty" = xyes; then :
- $as_echo "#define HAVE_FORKPTY 1" >>confdefs.h
- LIBS="$LIBS -lutil"
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for forkpty in -lbsd"
>&5
- $as_echo_n "checking for forkpty in -lbsd... " >&6; }
--if test "${ac_cv_lib_bsd_forkpty+set}" = set; then :
-+if ${ac_cv_lib_bsd_forkpty+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -10552,7 +10662,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_forkpty"
>&5
- $as_echo "$ac_cv_lib_bsd_forkpty" >&6; }
--if test "x$ac_cv_lib_bsd_forkpty" = x""yes; then :
-+if test "x$ac_cv_lib_bsd_forkpty" = xyes; then :
- $as_echo "#define HAVE_FORKPTY 1" >>confdefs.h
- LIBS="$LIBS -lbsd"
- fi
-@@ -10569,7 +10679,7 @@ done
- for ac_func in memmove
- do :
- ac_fn_c_check_func "$LINENO" "memmove"
"ac_cv_func_memmove"
--if test "x$ac_cv_func_memmove" = x""yes; then :
-+if test "x$ac_cv_func_memmove" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_MEMMOVE 1
- _ACEOF
-@@ -10593,7 +10703,7 @@ done
-
-
- ac_fn_c_check_func "$LINENO" "dup2" "ac_cv_func_dup2"
--if test "x$ac_cv_func_dup2" = x""yes; then :
-+if test "x$ac_cv_func_dup2" = xyes; then :
- $as_echo "#define HAVE_DUP2 1" >>confdefs.h
-
- else
-@@ -10606,7 +10716,7 @@ esac
- fi
-
- ac_fn_c_check_func "$LINENO" "getcwd" "ac_cv_func_getcwd"
--if test "x$ac_cv_func_getcwd" = x""yes; then :
-+if test "x$ac_cv_func_getcwd" = xyes; then :
- $as_echo "#define HAVE_GETCWD 1" >>confdefs.h
-
- else
-@@ -10619,7 +10729,7 @@ esac
- fi
-
- ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup"
--if test "x$ac_cv_func_strdup" = x""yes; then :
-+if test "x$ac_cv_func_strdup" = xyes; then :
- $as_echo "#define HAVE_STRDUP 1" >>confdefs.h
-
- else
-@@ -10635,7 +10745,7 @@ fi
- for ac_func in getpgrp
- do :
- ac_fn_c_check_func "$LINENO" "getpgrp"
"ac_cv_func_getpgrp"
--if test "x$ac_cv_func_getpgrp" = x""yes; then :
-+if test "x$ac_cv_func_getpgrp" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_GETPGRP 1
- _ACEOF
-@@ -10663,7 +10773,7 @@ done
- for ac_func in setpgrp
- do :
- ac_fn_c_check_func "$LINENO" "setpgrp"
"ac_cv_func_setpgrp"
--if test "x$ac_cv_func_setpgrp" = x""yes; then :
-+if test "x$ac_cv_func_setpgrp" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_SETPGRP 1
- _ACEOF
-@@ -10691,7 +10801,7 @@ done
- for ac_func in gettimeofday
- do :
- ac_fn_c_check_func "$LINENO" "gettimeofday"
"ac_cv_func_gettimeofday"
--if test "x$ac_cv_func_gettimeofday" = x""yes; then :
-+if test "x$ac_cv_func_gettimeofday" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_GETTIMEOFDAY 1
- _ACEOF
-@@ -10793,7 +10903,7 @@ if test $have_getaddrinfo = yes
- then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking getaddrinfo bug"
>&5
- $as_echo_n "checking getaddrinfo bug... " >&6; }
-- if test "${ac_cv_buggy_getaddrinfo+set}" = set; then :
-+ if ${ac_cv_buggy_getaddrinfo+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test "$cross_compiling" = yes; then :
-@@ -10922,7 +11032,7 @@ fi
- for ac_func in getnameinfo
- do :
- ac_fn_c_check_func "$LINENO" "getnameinfo"
"ac_cv_func_getnameinfo"
--if test "x$ac_cv_func_getnameinfo" = x""yes; then :
-+if test "x$ac_cv_func_getnameinfo" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_GETNAMEINFO 1
- _ACEOF
-@@ -10934,7 +11044,7 @@ done
- # checks for structures
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may
both be included" >&5
- $as_echo_n "checking whether time.h and sys/time.h may both be included... "
>&6; }
--if test "${ac_cv_header_time+set}" = set; then :
-+if ${ac_cv_header_time+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -10969,7 +11079,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in
sys/time.h or time.h" >&5
- $as_echo_n "checking whether struct tm is in sys/time.h or time.h... "
>&6; }
--if test "${ac_cv_struct_tm+set}" = set; then :
-+if ${ac_cv_struct_tm+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -11006,7 +11116,7 @@ ac_fn_c_check_member "$LINENO" "struct t
- #include <$ac_cv_struct_tm>
-
- "
--if test "x$ac_cv_member_struct_tm_tm_zone" = x""yes; then :
-+if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then :
-
- cat >>confdefs.h <<_ACEOF
- #define HAVE_STRUCT_TM_TM_ZONE 1
-@@ -11022,7 +11132,7 @@ $as_echo "#define HAVE_TM_ZONE 1" >>conf
- else
- ac_fn_c_check_decl "$LINENO" "tzname"
"ac_cv_have_decl_tzname" "#include <time.h>
- "
--if test "x$ac_cv_have_decl_tzname" = x""yes; then :
-+if test "x$ac_cv_have_decl_tzname" = xyes; then :
- ac_have_decl=1
- else
- ac_have_decl=0
-@@ -11034,7 +11144,7 @@ _ACEOF
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5
- $as_echo_n "checking for tzname... " >&6; }
--if test "${ac_cv_var_tzname+set}" = set; then :
-+if ${ac_cv_var_tzname+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -11070,7 +11180,7 @@ $as_echo "#define HAVE_TZNAME 1" >>confd
- fi
-
- ac_fn_c_check_member "$LINENO" "struct stat" "st_rdev"
"ac_cv_member_struct_stat_st_rdev" "$ac_includes_default"
--if test "x$ac_cv_member_struct_stat_st_rdev" = x""yes; then :
-+if test "x$ac_cv_member_struct_stat_st_rdev" = xyes; then :
-
- cat >>confdefs.h <<_ACEOF
- #define HAVE_STRUCT_STAT_ST_RDEV 1
-@@ -11080,7 +11190,7 @@ _ACEOF
- fi
-
- ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize"
"ac_cv_member_struct_stat_st_blksize" "$ac_includes_default"
--if test "x$ac_cv_member_struct_stat_st_blksize" = x""yes; then :
-+if test "x$ac_cv_member_struct_stat_st_blksize" = xyes; then :
-
- cat >>confdefs.h <<_ACEOF
- #define HAVE_STRUCT_STAT_ST_BLKSIZE 1
-@@ -11090,7 +11200,7 @@ _ACEOF
- fi
-
- ac_fn_c_check_member "$LINENO" "struct stat" "st_flags"
"ac_cv_member_struct_stat_st_flags" "$ac_includes_default"
--if test "x$ac_cv_member_struct_stat_st_flags" = x""yes; then :
-+if test "x$ac_cv_member_struct_stat_st_flags" = xyes; then :
-
- cat >>confdefs.h <<_ACEOF
- #define HAVE_STRUCT_STAT_ST_FLAGS 1
-@@ -11100,7 +11210,7 @@ _ACEOF
- fi
-
- ac_fn_c_check_member "$LINENO" "struct stat" "st_gen"
"ac_cv_member_struct_stat_st_gen" "$ac_includes_default"
--if test "x$ac_cv_member_struct_stat_st_gen" = x""yes; then :
-+if test "x$ac_cv_member_struct_stat_st_gen" = xyes; then :
-
- cat >>confdefs.h <<_ACEOF
- #define HAVE_STRUCT_STAT_ST_GEN 1
-@@ -11110,7 +11220,7 @@ _ACEOF
- fi
-
- ac_fn_c_check_member "$LINENO" "struct stat"
"st_birthtime" "ac_cv_member_struct_stat_st_birthtime"
"$ac_includes_default"
--if test "x$ac_cv_member_struct_stat_st_birthtime" = x""yes; then :
-+if test "x$ac_cv_member_struct_stat_st_birthtime" = xyes; then :
-
- cat >>confdefs.h <<_ACEOF
- #define HAVE_STRUCT_STAT_ST_BIRTHTIME 1
-@@ -11120,7 +11230,7 @@ _ACEOF
- fi
-
- ac_fn_c_check_member "$LINENO" "struct stat" "st_blocks"
"ac_cv_member_struct_stat_st_blocks" "$ac_includes_default"
--if test "x$ac_cv_member_struct_stat_st_blocks" = x""yes; then :
-+if test "x$ac_cv_member_struct_stat_st_blocks" = xyes; then :
-
- cat >>confdefs.h <<_ACEOF
- #define HAVE_STRUCT_STAT_ST_BLOCKS 1
-@@ -11142,7 +11252,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for time.h that defines
altzone" >&5
- $as_echo_n "checking for time.h that defines altzone... " >&6; }
--if test "${ac_cv_header_time_altzone+set}" = set; then :
-+if ${ac_cv_header_time_altzone+:} false; then :
- $as_echo_n "(cached) " >&6
- else
-
-@@ -11206,7 +11316,7 @@ $as_echo "$was_it_defined" >&6; }
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for addrinfo" >&5
- $as_echo_n "checking for addrinfo... " >&6; }
--if test "${ac_cv_struct_addrinfo+set}" = set; then :
-+if ${ac_cv_struct_addrinfo+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -11238,7 +11348,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_storage"
>&5
- $as_echo_n "checking for sockaddr_storage... " >&6; }
--if test "${ac_cv_struct_sockaddr_storage+set}" = set; then :
-+if ${ac_cv_struct_sockaddr_storage+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -11274,7 +11384,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned"
>&5
- $as_echo_n "checking whether char is unsigned... " >&6; }
--if test "${ac_cv_c_char_unsigned+set}" = set; then :
-+if ${ac_cv_c_char_unsigned+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -11306,7 +11416,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming
const" >&5
- $as_echo_n "checking for an ANSI C-conforming const... " >&6; }
--if test "${ac_cv_c_const+set}" = set; then :
-+if ${ac_cv_c_const+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -11594,7 +11704,7 @@ $as_echo "$va_list_is_array" >&6; }
-
-
- ac_fn_c_check_func "$LINENO" "gethostbyname_r"
"ac_cv_func_gethostbyname_r"
--if test "x$ac_cv_func_gethostbyname_r" = x""yes; then :
-+if test "x$ac_cv_func_gethostbyname_r" = xyes; then :
-
- $as_echo "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h
-
-@@ -11725,7 +11835,7 @@ else
- for ac_func in gethostbyname
- do :
- ac_fn_c_check_func "$LINENO" "gethostbyname"
"ac_cv_func_gethostbyname"
--if test "x$ac_cv_func_gethostbyname" = x""yes; then :
-+if test "x$ac_cv_func_gethostbyname" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_GETHOSTBYNAME 1
- _ACEOF
-@@ -11747,12 +11857,12 @@ fi
-
- # Linux requires this for correct f.p. operations
- ac_fn_c_check_func "$LINENO" "__fpu_control"
"ac_cv_func___fpu_control"
--if test "x$ac_cv_func___fpu_control" = x""yes; then :
-+if test "x$ac_cv_func___fpu_control" = xyes; then :
-
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __fpu_control in
-lieee" >&5
- $as_echo_n "checking for __fpu_control in -lieee... " >&6; }
--if test "${ac_cv_lib_ieee___fpu_control+set}" = set; then :
-+if ${ac_cv_lib_ieee___fpu_control+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -11786,7 +11896,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_ieee___fpu_control" >&5
- $as_echo "$ac_cv_lib_ieee___fpu_control" >&6; }
--if test "x$ac_cv_lib_ieee___fpu_control" = x""yes; then :
-+if test "x$ac_cv_lib_ieee___fpu_control" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_LIBIEEE 1
- _ACEOF
-@@ -11881,7 +11991,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C doubles are
little-endian IEEE 754 binary64" >&5
- $as_echo_n "checking whether C doubles are little-endian IEEE 754 binary64...
" >&6; }
--if test "${ac_cv_little_endian_double+set}" = set; then :
-+if ${ac_cv_little_endian_double+:} false; then :
- $as_echo_n "(cached) " >&6
- else
-
-@@ -11923,7 +12033,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C doubles are big-endian
IEEE 754 binary64" >&5
- $as_echo_n "checking whether C doubles are big-endian IEEE 754 binary64... "
>&6; }
--if test "${ac_cv_big_endian_double+set}" = set; then :
-+if ${ac_cv_big_endian_double+:} false; then :
- $as_echo_n "(cached) " >&6
- else
-
-@@ -11969,7 +12079,7 @@ fi
- # conversions work.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C doubles are ARM
mixed-endian IEEE 754 binary64" >&5
- $as_echo_n "checking whether C doubles are ARM mixed-endian IEEE 754 binary64...
" >&6; }
--if test "${ac_cv_mixed_endian_double+set}" = set; then :
-+if ${ac_cv_mixed_endian_double+:} false; then :
- $as_echo_n "(cached) " >&6
- else
-
-@@ -12117,7 +12227,7 @@ LIBS="$LIBS $LIBM"
- # -0. on some architectures.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether tanh preserves the sign
of zero" >&5
- $as_echo_n "checking whether tanh preserves the sign of zero... " >&6;
}
--if test "${ac_cv_tanh_preserves_zero_sign+set}" = set; then :
-+if ${ac_cv_tanh_preserves_zero_sign+:} false; then :
- $as_echo_n "(cached) " >&6
- else
-
-@@ -12185,7 +12295,7 @@ done
-
- ac_fn_c_check_decl "$LINENO" "isinf"
"ac_cv_have_decl_isinf" "#include <math.h>
- "
--if test "x$ac_cv_have_decl_isinf" = x""yes; then :
-+if test "x$ac_cv_have_decl_isinf" = xyes; then :
- ac_have_decl=1
- else
- ac_have_decl=0
-@@ -12196,7 +12306,7 @@ cat >>confdefs.h <<_ACEOF
- _ACEOF
- ac_fn_c_check_decl "$LINENO" "isnan"
"ac_cv_have_decl_isnan" "#include <math.h>
- "
--if test "x$ac_cv_have_decl_isnan" = x""yes; then :
-+if test "x$ac_cv_have_decl_isnan" = xyes; then :
- ac_have_decl=1
- else
- ac_have_decl=0
-@@ -12207,7 +12317,7 @@ cat >>confdefs.h <<_ACEOF
- _ACEOF
- ac_fn_c_check_decl "$LINENO" "isfinite"
"ac_cv_have_decl_isfinite" "#include <math.h>
- "
--if test "x$ac_cv_have_decl_isfinite" = x""yes; then :
-+if test "x$ac_cv_have_decl_isfinite" = xyes; then :
- ac_have_decl=1
- else
- ac_have_decl=0
-@@ -12227,7 +12337,7 @@ LIBS=$LIBS_SAVE
- # sem_open results in a 'Signal 12' error.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX semaphores are
enabled" >&5
- $as_echo_n "checking whether POSIX semaphores are enabled... " >&6; }
--if test "${ac_cv_posix_semaphores_enabled+set}" = set; then :
-+if ${ac_cv_posix_semaphores_enabled+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test "$cross_compiling" = yes; then :
-@@ -12278,7 +12388,7 @@ fi
- # Multiprocessing check for broken sem_getvalue
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken sem_getvalue"
>&5
- $as_echo_n "checking for broken sem_getvalue... " >&6; }
--if test "${ac_cv_broken_sem_getvalue+set}" = set; then :
-+if ${ac_cv_broken_sem_getvalue+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test "$cross_compiling" = yes; then :
-@@ -12343,7 +12453,7 @@ no)
- 15|30)
- ;;
- *)
-- as_fn_error $? "bad value $enable_big_digits for --enable-big-digits; value
should be 15 or 30" "$LINENO" 5 ;;
-+ as_fn_error $? "bad value $enable_big_digits for --enable-big-digits; value
should be 15 or 30" "$LINENO" 5 ;;
- esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_big_digits"
>&5
- $as_echo "$enable_big_digits" >&6; }
-@@ -12361,7 +12471,7 @@ fi
-
- # check for wchar.h
- ac_fn_c_check_header_mongrel "$LINENO" "wchar.h"
"ac_cv_header_wchar_h" "$ac_includes_default"
--if test "x$ac_cv_header_wchar_h" = x""yes; then :
-+if test "x$ac_cv_header_wchar_h" = xyes; then :
-
-
- $as_echo "#define HAVE_WCHAR_H 1" >>confdefs.h
-@@ -12384,7 +12494,7 @@ then
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of wchar_t" >&5
- $as_echo_n "checking size of wchar_t... " >&6; }
--if test "${ac_cv_sizeof_wchar_t+set}" = set; then :
-+if ${ac_cv_sizeof_wchar_t+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (wchar_t))"
"ac_cv_sizeof_wchar_t" "#include <wchar.h>
-@@ -12395,7 +12505,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (wchar_t)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_wchar_t=0
- fi
-@@ -12450,7 +12560,7 @@ then
- # check whether wchar_t is signed or not
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wchar_t is signed"
>&5
- $as_echo_n "checking whether wchar_t is signed... " >&6; }
-- if test "${ac_cv_wchar_t_signed+set}" = set; then :
-+ if ${ac_cv_wchar_t_signed+:} false; then :
- $as_echo_n "(cached) " >&6
- else
-
-@@ -12514,7 +12624,7 @@ ucs4) unicode_size="4"
- $as_echo "#define Py_UNICODE_SIZE 4" >>confdefs.h
-
- ;;
--*) as_fn_error $? "invalid value for --enable-unicode. Use either ucs2 or ucs4
(lowercase)." "$LINENO" 5 ;;
-+*) as_fn_error $? "invalid value for --enable-unicode. Use either ucs2 or ucs4
(lowercase)." "$LINENO" 5 ;;
- esac
-
-
-@@ -12561,7 +12671,7 @@ fi
- # check for endianness
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is
bigendian" >&5
- $as_echo_n "checking whether byte ordering is bigendian... " >&6; }
--if test "${ac_cv_c_bigendian+set}" = set; then :
-+if ${ac_cv_c_bigendian+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_cv_c_bigendian=unknown
-@@ -12780,7 +12890,7 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUI
- ;; #(
- *)
- as_fn_error $? "unknown endianness
-- presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
-+ presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
- esac
-
-
-@@ -12788,7 +12898,7 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUI
- # or fills with zeros (like the Cray J90, according to Tim Peters).
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether right shift extends the
sign bit" >&5
- $as_echo_n "checking whether right shift extends the sign bit... " >&6;
}
--if test "${ac_cv_rshift_extends_sign+set}" = set; then :
-+if ${ac_cv_rshift_extends_sign+:} false; then :
- $as_echo_n "(cached) " >&6
- else
-
-@@ -12827,7 +12937,7 @@ fi
- # check for getc_unlocked and related locking functions
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getc_unlocked() and
friends" >&5
- $as_echo_n "checking for getc_unlocked() and friends... " >&6; }
--if test "${ac_cv_have_getc_unlocked+set}" = set; then :
-+if ${ac_cv_have_getc_unlocked+:} false; then :
- $as_echo_n "(cached) " >&6
- else
-
-@@ -12925,7 +13035,7 @@ fi
- # check for readline 2.1
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_callback_handler_install
in -lreadline" >&5
- $as_echo_n "checking for rl_callback_handler_install in -lreadline... "
>&6; }
--if test "${ac_cv_lib_readline_rl_callback_handler_install+set}" = set; then :
-+if ${ac_cv_lib_readline_rl_callback_handler_install+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -12959,7 +13069,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_readline_rl_callback_handler_install" >&5
- $as_echo "$ac_cv_lib_readline_rl_callback_handler_install" >&6; }
--if test "x$ac_cv_lib_readline_rl_callback_handler_install" = x""yes;
then :
-+if test "x$ac_cv_lib_readline_rl_callback_handler_install" = xyes; then :
-
- $as_echo "#define HAVE_RL_CALLBACK 1" >>confdefs.h
-
-@@ -13011,7 +13121,7 @@ fi
- # check for readline 4.0
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_pre_input_hook in
-lreadline" >&5
- $as_echo_n "checking for rl_pre_input_hook in -lreadline... " >&6; }
--if test "${ac_cv_lib_readline_rl_pre_input_hook+set}" = set; then :
-+if ${ac_cv_lib_readline_rl_pre_input_hook+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -13045,7 +13155,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_readline_rl_pre_input_hook" >&5
- $as_echo "$ac_cv_lib_readline_rl_pre_input_hook" >&6; }
--if test "x$ac_cv_lib_readline_rl_pre_input_hook" = x""yes; then :
-+if test "x$ac_cv_lib_readline_rl_pre_input_hook" = xyes; then :
-
- $as_echo "#define HAVE_RL_PRE_INPUT_HOOK 1" >>confdefs.h
-
-@@ -13055,7 +13165,7 @@ fi
- # also in 4.0
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for
rl_completion_display_matches_hook in -lreadline" >&5
- $as_echo_n "checking for rl_completion_display_matches_hook in -lreadline... "
>&6; }
--if test "${ac_cv_lib_readline_rl_completion_display_matches_hook+set}" = set;
then :
-+if ${ac_cv_lib_readline_rl_completion_display_matches_hook+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -13089,7 +13199,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_readline_rl_completion_display_matches_hook" >&5
- $as_echo "$ac_cv_lib_readline_rl_completion_display_matches_hook" >&6;
}
--if test "x$ac_cv_lib_readline_rl_completion_display_matches_hook" =
x""yes; then :
-+if test "x$ac_cv_lib_readline_rl_completion_display_matches_hook" = xyes; then
:
-
- $as_echo "#define HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK 1"
>>confdefs.h
-
-@@ -13099,7 +13209,7 @@ fi
- # check for readline 4.2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_matches in
-lreadline" >&5
- $as_echo_n "checking for rl_completion_matches in -lreadline... " >&6;
}
--if test "${ac_cv_lib_readline_rl_completion_matches+set}" = set; then :
-+if ${ac_cv_lib_readline_rl_completion_matches+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -13133,7 +13243,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_readline_rl_completion_matches" >&5
- $as_echo "$ac_cv_lib_readline_rl_completion_matches" >&6; }
--if test "x$ac_cv_lib_readline_rl_completion_matches" = x""yes; then
:
-+if test "x$ac_cv_lib_readline_rl_completion_matches" = xyes; then :
-
- $as_echo "#define HAVE_RL_COMPLETION_MATCHES 1" >>confdefs.h
-
-@@ -13174,7 +13284,7 @@ LIBS=$LIBS_no_readline
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken nice()"
>&5
- $as_echo_n "checking for broken nice()... " >&6; }
--if test "${ac_cv_broken_nice+set}" = set; then :
-+if ${ac_cv_broken_nice+:} false; then :
- $as_echo_n "(cached) " >&6
- else
-
-@@ -13215,7 +13325,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken poll()"
>&5
- $as_echo_n "checking for broken poll()... " >&6; }
--if test "${ac_cv_broken_poll+set}" = set; then :
-+if ${ac_cv_broken_poll+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test "$cross_compiling" = yes; then :
-@@ -13270,7 +13380,7 @@ ac_fn_c_check_member "$LINENO" "struct t
- #include <$ac_cv_struct_tm>
-
- "
--if test "x$ac_cv_member_struct_tm_tm_zone" = x""yes; then :
-+if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then :
-
- cat >>confdefs.h <<_ACEOF
- #define HAVE_STRUCT_TM_TM_ZONE 1
-@@ -13286,7 +13396,7 @@ $as_echo "#define HAVE_TM_ZONE 1" >>conf
- else
- ac_fn_c_check_decl "$LINENO" "tzname"
"ac_cv_have_decl_tzname" "#include <time.h>
- "
--if test "x$ac_cv_have_decl_tzname" = x""yes; then :
-+if test "x$ac_cv_have_decl_tzname" = xyes; then :
- ac_have_decl=1
- else
- ac_have_decl=0
-@@ -13298,7 +13408,7 @@ _ACEOF
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5
- $as_echo_n "checking for tzname... " >&6; }
--if test "${ac_cv_var_tzname+set}" = set; then :
-+if ${ac_cv_var_tzname+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -13337,7 +13447,7 @@ fi
- # check tzset(3) exists and works like we expect it to
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working tzset()"
>&5
- $as_echo_n "checking for working tzset()... " >&6; }
--if test "${ac_cv_working_tzset+set}" = set; then :
-+if ${ac_cv_working_tzset+:} false; then :
- $as_echo_n "(cached) " >&6
- else
-
-@@ -13434,7 +13544,7 @@ fi
- # Look for subsecond timestamps in struct stat
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tv_nsec in struct stat"
>&5
- $as_echo_n "checking for tv_nsec in struct stat... " >&6; }
--if test "${ac_cv_stat_tv_nsec+set}" = set; then :
-+if ${ac_cv_stat_tv_nsec+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -13471,7 +13581,7 @@ fi
- # Look for BSD style subsecond timestamps in struct stat
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tv_nsec2 in struct stat"
>&5
- $as_echo_n "checking for tv_nsec2 in struct stat... " >&6; }
--if test "${ac_cv_stat_tv_nsec2+set}" = set; then :
-+if ${ac_cv_stat_tv_nsec2+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -13508,7 +13618,7 @@ fi
- # On HP/UX 11.0, mvwdelch is a block with a return statement
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mvwdelch is an
expression" >&5
- $as_echo_n "checking whether mvwdelch is an expression... " >&6; }
--if test "${ac_cv_mvwdelch_is_expression+set}" = set; then :
-+if ${ac_cv_mvwdelch_is_expression+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -13545,7 +13655,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether WINDOW has _flags"
>&5
- $as_echo_n "checking whether WINDOW has _flags... " >&6; }
--if test "${ac_cv_window_has_flags+set}" = set; then :
-+if ${ac_cv_window_has_flags+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -13693,7 +13803,7 @@ if test "$have_long_long" = yes
- then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for %lld and %llu printf()
format support" >&5
- $as_echo_n "checking for %lld and %llu printf() format support... "
>&6; }
-- if test "${ac_cv_have_long_long_format+set}" = set; then :
-+ if ${ac_cv_have_long_long_format+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test "$cross_compiling" = yes; then :
-@@ -13764,7 +13874,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for %zd printf() format
support" >&5
- $as_echo_n "checking for %zd printf() format support... " >&6; }
--if test "${ac_cv_have_size_t_format+set}" = set; then :
-+if ${ac_cv_have_size_t_format+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test "$cross_compiling" = yes; then :
-@@ -13837,7 +13947,7 @@ ac_fn_c_check_type "$LINENO" "socklen_t"
- #endif
-
- "
--if test "x$ac_cv_type_socklen_t" = x""yes; then :
-+if test "x$ac_cv_type_socklen_t" = xyes; then :
-
- else
-
-@@ -13942,10 +14052,21 @@ $as_echo "$as_me: WARNING: cache variabl
- :end' >>confcache
- if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
- if test -w "$cache_file"; then
-- test "x$cache_file" != "x/dev/null" &&
-+ if test "x$cache_file" != "x/dev/null"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file"
>&5
- $as_echo "$as_me: updating cache $cache_file" >&6;}
-- cat confcache >$cache_file
-+ if test ! -f "$cache_file" || test -h "$cache_file"; then
-+ cat confcache >"$cache_file"
-+ else
-+ case $cache_file in #(
-+ */* | ?:*)
-+ mv -f confcache "$cache_file"$$ &&
-+ mv -f "$cache_file"$$ "$cache_file" ;; #(
-+ *)
-+ mv -f confcache "$cache_file" ;;
-+ esac
-+ fi
-+ fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache
$cache_file" >&5
- $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
-@@ -13978,7 +14099,7 @@ LTLIBOBJS=$ac_ltlibobjs
-
-
-
--: ${CONFIG_STATUS=./config.status}
-+: "${CONFIG_STATUS=./config.status}"
- ac_write_fail=0
- ac_clean_files_save=$ac_clean_files
- ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-@@ -14079,6 +14200,7 @@ fi
- IFS=" "" $as_nl"
-
- # Find who we are. Look in the path if we contain no directory separator.
-+as_myself=
- case $0 in #((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-@@ -14386,7 +14508,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri
- # values after options handling.
- ac_log="
- This file was extended by python $as_me 2.7, which was
--generated by GNU Autoconf 2.67. Invocation command line was
-+generated by GNU Autoconf 2.68. Invocation command line was
-
- CONFIG_FILES = $CONFIG_FILES
- CONFIG_HEADERS = $CONFIG_HEADERS
-@@ -14448,7 +14570,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_writ
- ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //;
s/[\\""\`\$]/\\\\&/g'`"
- ac_cs_version="\\
- python config.status 2.7
--configured by $0, generated by GNU Autoconf 2.67,
-+configured by $0, generated by GNU Autoconf 2.68,
- with options \\"\$ac_cs_config\\"
-
- Copyright (C) 2010 Free Software Foundation, Inc.
-@@ -14580,7 +14702,7 @@ do
- "Misc/python.pc") CONFIG_FILES="$CONFIG_FILES Misc/python.pc"
;;
- "Modules/ld_so_aix") CONFIG_FILES="$CONFIG_FILES
Modules/ld_so_aix" ;;
-
-- *) as_fn_error $? "invalid argument: \`$ac_config_target'"
"$LINENO" 5 ;;
-+ *) as_fn_error $? "invalid argument: \`$ac_config_target'"
"$LINENO" 5;;
- esac
- done
-
-@@ -14602,9 +14724,10 @@ fi
- # after its creation but before its name has been assigned to `$tmp'.
- $debug ||
- {
-- tmp=
-+ tmp= ac_tmp=
- trap 'exit_status=$?
-- { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; }
&& exit $exit_status
-+ : "${ac_tmp:=$tmp}"
-+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit
$exit_status
- ' 0
- trap 'as_fn_exit 1' 1 2 13 15
- }
-@@ -14612,12 +14735,13 @@ $debug ||
-
- {
- tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null`
&&
-- test -n "$tmp" && test -d "$tmp"
-+ test -d "$tmp"
- } ||
- {
- tmp=./conf$$-$RANDOM
- (umask 077 && mkdir "$tmp")
- } || as_fn_error $? "cannot create a temporary directory in ."
"$LINENO" 5
-+ac_tmp=$tmp
-
- # Set up the scripts for CONFIG_FILES section.
- # No need to generate them if there are no CONFIG_FILES.
-@@ -14639,7 +14763,7 @@ else
- ac_cs_awk_cr=$ac_cr
- fi
-
--echo 'BEGIN {' >"$tmp/subs1.awk" &&
-+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
- _ACEOF
-
-
-@@ -14667,7 +14791,7 @@ done
- rm -f conf$$subs.sh
-
- cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
--cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
-+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
- _ACEOF
- sed -n '
- h
-@@ -14715,7 +14839,7 @@ t delim
- rm -f conf$$subs.awk
- cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- _ACAWK
--cat >>"\$tmp/subs1.awk" <<_ACAWK &&
-+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
- for (key in S) S_is_set[key] = 1
- FS = ""
-
-@@ -14747,7 +14871,7 @@ if sed "s/$ac_cr//" < /dev/null > /dev/n
- sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
- else
- cat
--fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
-+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
- || as_fn_error $? "could not setup config files machinery"
"$LINENO" 5
- _ACEOF
-
-@@ -14781,7 +14905,7 @@ fi # test -n "$CONFIG_FILES"
- # No need to generate them if there are no CONFIG_HEADERS.
- # This happens for instance with `./config.status Makefile'.
- if test -n "$CONFIG_HEADERS"; then
--cat >"$tmp/defines.awk" <<\_ACAWK ||
-+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
- BEGIN {
- _ACEOF
-
-@@ -14793,8 +14917,8 @@ _ACEOF
- # handling of long lines.
- ac_delim='%!_!# '
- for ac_last_try in false false :; do
-- ac_t=`sed -n "/$ac_delim/p" confdefs.h`
-- if test -z "$ac_t"; then
-+ ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
-+ if test -z "$ac_tt"; then
- break
- elif $ac_last_try; then
- as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
-@@ -14895,7 +15019,7 @@ do
- esac
- case $ac_mode$ac_tag in
- :[FHL]*:*);;
-- :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO"
5 ;;
-+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO"
5;;
- :[FH]-) ac_tag=-:-;;
- :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
- esac
-@@ -14914,7 +15038,7 @@ do
- for ac_f
- do
- case $ac_f in
-- -) ac_f="$tmp/stdin";;
-+ -) ac_f="$ac_tmp/stdin";;
- *) # Look for the file first in the build tree, then in the source tree
- # (if the path is not absolute). The absolute path cannot be DOS-style,
- # because $ac_f cannot contain `:'.
-@@ -14923,7 +15047,7 @@ do
- [\\/$]*) false;;
- *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
- esac ||
-- as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5
;;
-+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO"
5;;
- esac
- case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed
"s/'/'\\\\\\\\''/g"`;; esac
- as_fn_append ac_file_inputs " '$ac_f'"
-@@ -14949,8 +15073,8 @@ $as_echo "$as_me: creating $ac_file" >&6
- esac
-
- case $ac_tag in
-- *:-:* | *:-) cat >"$tmp/stdin" \
-- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
-+ *:-:* | *:-) cat >"$ac_tmp/stdin" \
-+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
- esac
- ;;
- esac
-@@ -15080,21 +15204,22 @@ s&@abs_top_builddir@&$ac_abs_top_builddi
- s&@INSTALL@&$ac_INSTALL&;t t
- $ac_datarootdir_hack
- "
--eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f
"$tmp/subs.awk" >$tmp/out \
-- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f
"$ac_tmp/subs.awk" \
-+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file"
"$LINENO" 5
-
- test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
-- { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n
"$ac_out"; } &&
-- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z
"$ac_out"; } &&
-+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n
"$ac_out"; } &&
-+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
-+ "$ac_tmp/out"`; test -z "$ac_out"; } &&
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference
to the variable \`datarootdir'
- which seems to be undefined. Please make sure it is defined" >&5
- $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable
\`datarootdir'
- which seems to be undefined. Please make sure it is defined" >&2;}
-
-- rm -f "$tmp/stdin"
-+ rm -f "$ac_tmp/stdin"
- case $ac_file in
-- -) cat "$tmp/out" && rm -f "$tmp/out";;
-- *) rm -f "$ac_file" && mv "$tmp/out"
"$ac_file";;
-+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
-+ *) rm -f "$ac_file" && mv "$ac_tmp/out"
"$ac_file";;
- esac \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- ;;
-@@ -15105,20 +15230,20 @@ which seems to be undefined. Please mak
- if test x"$ac_file" != x-; then
- {
- $as_echo "/* $configure_input */" \
-- && eval '$AWK -f "$tmp/defines.awk"'
"$ac_file_inputs"
-- } >"$tmp/config.h" \
-+ && eval '$AWK -f "$ac_tmp/defines.awk"'
"$ac_file_inputs"
-+ } >"$ac_tmp/config.h" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-- if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1;
then
-+ if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1;
then
- { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged"
>&5
- $as_echo "$as_me: $ac_file is unchanged" >&6;}
- else
- rm -f "$ac_file"
-- mv "$tmp/config.h" "$ac_file" \
-+ mv "$ac_tmp/config.h" "$ac_file" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- fi
- else
- $as_echo "/* $configure_input */" \
-- && eval '$AWK -f "$tmp/defines.awk"'
"$ac_file_inputs" \
-+ && eval '$AWK -f "$ac_tmp/defines.awk"'
"$ac_file_inputs" \
- || as_fn_error $? "could not create -" "$LINENO" 5
- fi
- ;;
diff -up ./pyconfig.h.in.autotool-intermediates ./pyconfig.h.in
---- ./pyconfig.h.in.autotool-intermediates 2013-03-25 15:25:30.435846538 -0400
-+++ ./pyconfig.h.in 2013-03-25 15:25:33.030846360 -0400
+--- ./pyconfig.h.in.autotool-intermediates 2013-04-09 11:24:01.020185806 +0200
++++ ./pyconfig.h.in 2013-04-09 11:24:02.088183204 +0200
@@ -18,6 +18,12 @@
/* Define this if you have BeOS threads. */
#undef BEOS_THREADS
@@ -2714,7 +210,7 @@ diff -up ./pyconfig.h.in.autotool-intermediates ./pyconfig.h.in
/* Define if you have the Mach cthreads package */
#undef C_THREADS
-@@ -1107,12 +1113,6 @@
+@@ -1119,12 +1125,6 @@
/* Define to profile with the Pentium timestamp counter */
#undef WITH_TSC
diff --git a/python-2.5.1-sqlite-encoding.patch b/python-2.5.1-sqlite-encoding.patch
index 97235d8..ff2a3f8 100644
--- a/python-2.5.1-sqlite-encoding.patch
+++ b/python-2.5.1-sqlite-encoding.patch
@@ -2,7 +2,7 @@ diff -up Python-2.5.1/Lib/sqlite3/dbapi2.py.encoding
Python-2.5.1/Lib/sqlite3/db
--- Python-2.5.1/Lib/sqlite3/dbapi2.py.encoding 2007-09-14 10:41:50.000000000 -0400
+++ Python-2.5.1/Lib/sqlite3/dbapi2.py 2007-09-14 10:42:00.000000000 -0400
@@ -1,7 +1,6 @@
--#-*- coding: ISO-8859-1 -*-
+-# -*- coding: iso-8859-1 -*-
# pysqlite2/dbapi2.py: the DB-API 2.0 interface
#
-# Copyright (C) 2004-2005 Gerhard Hring <gh(a)ghaering.de>
diff --git a/python-2.6-rpath.patch b/python-2.6-rpath.patch
index a668926..43e3ec4 100644
--- a/python-2.6-rpath.patch
+++ b/python-2.6-rpath.patch
@@ -1,6 +1,6 @@
-diff -up Python-2.6/configure.in.rpath Python-2.6/configure.in
---- Python-2.6/configure.in.rpath 2008-11-24 02:51:06.000000000 -0500
-+++ Python-2.6/configure.in 2008-11-24 02:51:21.000000000 -0500
+diff -up Python-2.6/configure.ac.rpath Python-2.6/configure.ac
+--- Python-2.6/configure.ac.rpath 2008-11-24 02:51:06.000000000 -0500
++++ Python-2.6/configure.ac 2008-11-24 02:51:21.000000000 -0500
@@ -729,7 +729,7 @@ if test $enable_shared = "yes"; then
;;
OSF*)
diff --git a/python-2.7.1-config.patch b/python-2.7.1-config.patch
index 0bb790e..ea1c5d6 100644
--- a/python-2.7.1-config.patch
+++ b/python-2.7.1-config.patch
@@ -1,6 +1,5 @@
-diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dist
---- Python-2.7.1/Modules/Setup.dist.rhconfig 2010-08-21 07:40:30.000000000 -0400
-+++ Python-2.7.1/Modules/Setup.dist 2010-12-23 15:47:12.111059967 -0500
+--- Python-2.7.4/Modules/Setup.dist.rhconfig 2013-04-06 16:02:34.000000000 +0200
++++ Python-2.7.4/Modules/Setup.dist 2013-04-08 10:05:16.369985654 +0200
@@ -153,7 +153,7 @@ GLHACK=-Dclear=__GLclear
# modules are to be built as shared libraries (see above for more
# detail; also note that *static* reverses this effect):
@@ -10,7 +9,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
# GNU readline. Unlike previous Python incarnations, GNU readline is
# now incorporated in an optional module, configured in the Setup file
-@@ -163,73 +163,73 @@ GLHACK=-Dclear=__GLclear
+@@ -163,74 +163,74 @@ GLHACK=-Dclear=__GLclear
# it, depending on your system -- see the GNU readline instructions.
# It's okay for this to be a shared library, too.
@@ -29,9 +28,6 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
-#_testcapi _testcapimodule.c # Python C API test module
-#_random _randommodule.c # Random number generator
-#_collections _collectionsmodule.c # Container types
--#itertools itertoolsmodule.c # Functions creating iterators for efficient looping
--#strop stropmodule.c # String manipulations
--#_functools _functoolsmodule.c # Tools for working with functions and callable objects
+array arraymodule.c # array objects
+cmath cmathmodule.c _math.c # -lm # complex math library functions
+math mathmodule.c _math.c # -lm # math library functions, e.g. sin()
@@ -41,6 +37,10 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
+_testcapi _testcapimodule.c # Python C API test module
+_random _randommodule.c # Random number generator
+_collections _collectionsmodule.c # Container types
+ #_heapq _heapqmodule.c # Heapq type
+-#itertools itertoolsmodule.c # Functions creating iterators for efficient looping
+-#strop stropmodule.c # String manipulations
+-#_functools _functoolsmodule.c # Tools for working with functions and callable objects
+itertools itertoolsmodule.c # Functions creating iterators for efficient looping
+strop stropmodule.c # String manipulations
+_functools _functoolsmodule.c # Tools for working with functions and callable objects
@@ -81,7 +81,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
# Socket module helper for socket(2)
-#_socket socketmodule.c
-+_socket socketmodule.c
++_socket socketmodule.c timemodule.c
# Socket module helper for SSL support; you must comment out the other
# socket line above, and possibly edit the SSL variable:
@@ -99,7 +99,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
# First, look at Setup.config; configure may have set this for you.
-#crypt cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some systems
-+crypt cryptmodule.c -lcrypt # crypt(3); needs -lcrypt on some systems
++crypt cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some systems
# Some more UNIX dependent modules -- off by default, since these
@@ -114,7 +114,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
# Multimedia modules -- off by default.
-@@ -237,8 +237,8 @@ GLHACK=-Dclear=__GLclear
+@@ -238,8 +238,8 @@ GLHACK=-Dclear=__GLclear
# #993173 says audioop works on 64-bit platforms, though.
# These represent audio samples or images as strings:
@@ -125,7 +125,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
# Note that the _md5 and _sha modules are normally only built if the
-@@ -248,14 +248,14 @@ GLHACK=-Dclear=__GLclear
+@@ -249,14 +249,14 @@ GLHACK=-Dclear=__GLclear
# Message-Digest Algorithm, described in RFC 1321. The necessary files
# md5.c and md5.h are included here.
@@ -144,7 +144,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
# SGI IRIX specific modules -- off by default.
-@@ -302,12 +302,12 @@ GLHACK=-Dclear=__GLclear
+@@ -303,12 +303,12 @@ GLHACK=-Dclear=__GLclear
# A Linux specific module -- off by default; this may also work on
# some *BSDs.
@@ -159,7 +159,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
# The _tkinter module.
-@@ -322,7 +322,7 @@ GLHACK=-Dclear=__GLclear
+@@ -323,7 +323,7 @@ GLHACK=-Dclear=__GLclear
# every system.
# *** Always uncomment this (leave the leading underscore in!):
@@ -168,7 +168,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
# *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
# -L/usr/local/lib \
# *** Uncomment and edit to reflect where your Tcl/Tk headers are:
-@@ -332,7 +332,7 @@ GLHACK=-Dclear=__GLclear
+@@ -333,7 +333,7 @@ GLHACK=-Dclear=__GLclear
# *** Or uncomment this for Solaris:
# -I/usr/openwin/include \
# *** Uncomment and edit for Tix extension only:
@@ -177,7 +177,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
# *** Uncomment and edit for BLT extension only:
# -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \
# *** Uncomment and edit for PIL (TkImaging) extension only:
-@@ -341,7 +341,7 @@ GLHACK=-Dclear=__GLclear
+@@ -342,7 +342,7 @@ GLHACK=-Dclear=__GLclear
# *** Uncomment and edit for TOGL extension only:
# -DWITH_TOGL togl.c \
# *** Uncomment and edit to reflect your Tcl/Tk versions:
@@ -186,7 +186,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
# *** Uncomment and edit to reflect where your X11 libraries are:
# -L/usr/X11R6/lib \
# *** Or uncomment this for Solaris:
-@@ -351,7 +351,7 @@ GLHACK=-Dclear=__GLclear
+@@ -352,7 +352,7 @@ GLHACK=-Dclear=__GLclear
# *** Uncomment for AIX:
# -lld \
# *** Always uncomment this; X11 libraries to link with:
@@ -195,7 +195,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
# Lance Ellinghaus's syslog module
#syslog syslogmodule.c # syslog daemon interface
-@@ -373,7 +373,7 @@ GLHACK=-Dclear=__GLclear
+@@ -374,7 +374,7 @@ GLHACK=-Dclear=__GLclear
# it is a highly experimental and dangerous device for calling
# *arbitrary* C functions in *arbitrary* shared libraries:
@@ -204,7 +204,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
# Modules that provide persistent dictionary-like semantics. You will
-@@ -396,7 +396,7 @@ GLHACK=-Dclear=__GLclear
+@@ -397,7 +397,7 @@ GLHACK=-Dclear=__GLclear
#
# First, look at Setup.config; configure may have set this for you.
@@ -213,7 +213,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
# Sleepycat Berkeley DB interface.
-@@ -411,11 +411,10 @@ GLHACK=-Dclear=__GLclear
+@@ -412,11 +412,10 @@ GLHACK=-Dclear=__GLclear
#
# Edit the variables DB and DBLIBVERto point to the db top directory
# and the subdirectory of PORT where you built it.
@@ -229,7 +229,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
# Historical Berkeley DB 1.85
#
-@@ -430,14 +429,14 @@ GLHACK=-Dclear=__GLclear
+@@ -431,14 +430,14 @@ GLHACK=-Dclear=__GLclear
# Helper module for various ascii-encoders
@@ -248,7 +248,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
# Lee Busby's SIGFPE modules.
-@@ -460,7 +459,7 @@ GLHACK=-Dclear=__GLclear
+@@ -461,7 +460,7 @@ GLHACK=-Dclear=__GLclear
# Andrew Kuchling's zlib module.
# This require zlib 1.1.3 (or later).
# See
http://www.gzip.org/zlib/
@@ -257,7 +257,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
# Interface to the Expat XML parser
#
-@@ -479,14 +478,14 @@ GLHACK=-Dclear=__GLclear
+@@ -480,14 +479,14 @@ GLHACK=-Dclear=__GLclear
# Hye-Shik Chang's CJKCodecs
# multibytecodec is required for all the other CJK codec modules
diff --git a/python-2.7.2-add-extension-suffix-to-python-config.patch
b/python-2.7.2-add-extension-suffix-to-python-config.patch
index 4d56867..d1ff052 100644
--- a/python-2.7.2-add-extension-suffix-to-python-config.patch
+++ b/python-2.7.2-add-extension-suffix-to-python-config.patch
@@ -11,7 +11,7 @@ diff -up
Python-2.7.2/Misc/python-config.in.add-extension-suffix-to-python-confi
def exit_with_usage(code=1):
print >>sys.stderr, "Usage: %s [%s]" % (sys.argv[0],
@@ -54,3 +54,5 @@ for opt in opt_flags:
- libs.extend(getvar('LINKFORSHARED').split())
+ libs.extend(getvar('LINKFORSHARED').split())
print ' '.join(libs)
+ elif opt == '--extension-suffix':
diff --git a/python-2.7.3-debug-build.patch b/python-2.7.3-debug-build.patch
index b44c9eb..5b6cda7 100644
--- a/python-2.7.3-debug-build.patch
+++ b/python-2.7.3-debug-build.patch
@@ -1,6 +1,6 @@
-diff -up Python-2.7.3/configure.in.debug-build Python-2.7.3/configure.in
---- Python-2.7.3/configure.in.debug-build 2012-04-18 19:46:22.066498521 -0400
-+++ Python-2.7.3/configure.in 2012-04-18 19:46:22.078498372 -0400
+diff -up Python-2.7.3/configure.ac.debug-build Python-2.7.3/configure.ac
+--- Python-2.7.3/configure.ac.debug-build 2012-04-18 19:46:22.066498521 -0400
++++ Python-2.7.3/configure.ac 2012-04-18 19:46:22.078498372 -0400
@@ -635,7 +635,7 @@ AC_SUBST(LIBRARY)
AC_MSG_CHECKING(LIBRARY)
if test -z "$LIBRARY"
@@ -75,7 +75,7 @@ diff -up Python-2.7.3/Lib/distutils/sysconfig.py.debug-build
Python-2.7.3/Lib/di
elif os.name == "os2":
@@ -250,7 +251,7 @@ def get_makefile_filename():
if python_build:
- return os.path.join(os.path.dirname(sys.executable), "Makefile")
+ return os.path.join(project_base, "Makefile")
lib_dir = get_python_lib(plat_specific=1, standard_lib=1)
- return os.path.join(lib_dir, "config", "Makefile")
+ return os.path.join(lib_dir, "config" + (sys.pydebug and
"-debug" or ""), "Makefile")
@@ -132,11 +132,11 @@ diff -up Python-2.7.3/Makefile.pre.in.debug-build
Python-2.7.3/Makefile.pre.in
+PYTHON= python$(DEBUG_SUFFIX)$(EXE)
+BUILDPYTHON= python$(DEBUG_SUFFIX)$(BUILDEXE)
- # The task to run while instrument when building the profile-opt target
- PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck
+ PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@
+ _PYTHON_HOST_PLATFORM=@_PYTHON_HOST_PLATFORM@
@@ -413,7 +419,7 @@ sharedmods: $(BUILDPYTHON)
- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)'
./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
- esac
+ $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
+ $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
-libpython$(VERSION).so: $(LIBRARY_OBJS)
+libpython$(VERSION)$(DEBUG_EXT).so: $(LIBRARY_OBJS)
@@ -183,7 +183,7 @@ diff -up Python-2.7.3/Makefile.pre.in.debug-build
Python-2.7.3/Makefile.pre.in
if test -n "$(DLLLIBRARY)" ; then \
$(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
@@ -970,10 +976,11 @@ $(srcdir)/Lib/$(PLATDIR):
- export EXE; EXE="$(BUILDEXE)"; \
+ fi; \
cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen
-python-config: $(srcdir)/Misc/python-config.in
diff --git a/python.spec b/python.spec
index 4d3b299..a24175e 100644
--- a/python.spec
+++ b/python.spec
@@ -105,8 +105,8 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
# Remember to also rebase python-docs when changing this:
-Version: 2.7.3
-Release: 35%{?dist}
+Version: 2.7.4
+Release: 1%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -345,19 +345,8 @@ Patch54: python-2.6.4-setup-db48.patch
# for 2.7rc1 by dmalcolm:
Patch55: 00055-systemtap.patch
-# "lib64 patches"
-# This patch seems to be associated with bug 122304, which was
-#
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=93184...
-# and is now
-#
http://bugs.python.org/issue931848
-# However, as it stands this patch is merely a copy of:
-#
http://svn.python.org/view/python/trunk/Lib/test/test_re.py?r1=35825&...
-# which is already upstream
-# Earlier versions of the patch (from the "dist-pkgs" CVS repo within RH)
-# contained additional changes that applied fixes to the internals of the regex
-# module, but these appear to have all been applied as part of
-#
http://bugs.python.org/issue931848
-Patch101: 00101-lib64-regex.patch
+# Upstream as of Python 2.7.4
+# Patch101: 00101-lib64-regex.patch
# Only used when "%{_lib}" == "lib64"
# Fixup various paths throughout the build and in distutils from "lib" to
"lib64",
@@ -688,14 +677,8 @@ Patch156: 00156-gdb-autoload-safepath.patch
# (rhbz#697470)
Patch157: 00157-uid-gid-overflows.patch
-# 00158 #
-# This patch fixes a memory leak in _hashlib module, as reported in
-# RHBZ #836285; upstream report
http://bugs.python.org/issue15219.
-# The patch has been accepted upstream, so this should be commented out
-# when packaging next upstream release.
-# The fix for Fedora specific "implement_specific_EVP_new()" function
-# has been merged into patch 00146.
-Patch158: 00158-fix-hashlib-leak.patch
+# Upstream as of Python 2.7.4
+# Patch158: 00158-fix-hashlib-leak.patch
# 00159 #
# From F18 on, there is a libdb4 package, that replaces db4. It places header
@@ -782,28 +765,11 @@ Patch169:
00169-avoid-implicit-usage-of-md5-in-multiprocessing.patch
# (rhbz#850013)
Patch170: 00170-gc-assertions.patch
-# 00171 #
-# Fix os.urandom() so that it raises NotImplementedError rather than OSError
-# if /dev/urandom can't be opened (e.g. in some chroots), given that callers
-# such as the random module have handler code expecting NotImplementedError
-# (regression introduced by hash randomization patch)
-#
-# Cherrypick of
http://hg.python.org/cpython/rev/edbf37ace03c/ from upstream
-# (rhbz#907383;
http://bugs.python.org/issue15340)
-Patch171: 00171-raise-correct-exception-when-dev-urandom-is-missing.patch
+# Upstream as of Python 2.7.4
+# Patch171: 00171-raise-correct-exception-when-dev-urandom-is-missing.patch
-# 00172 #
-# Port _multiprocessing.Connection.poll() to use the "poll" syscall, rather
-# than "select", allowing large numbers of subprocesses
-#
-# Based on this sequence of upstream patches to 2.7:
-#
http://hg.python.org/cpython/rev/c5c27b84d7af/
-#
http://hg.python.org/cpython/rev/7cf4ea64f603/
-#
http://hg.python.org/cpython/rev/da5e520a7ba5/
-#
http://hg.python.org/cpython/rev/f07435fa6736/
-#
-#(rhbz#849992;
http://bugs.python.org/issue10527)
-Patch172: 00172-use-poll-for-multiprocessing-socket-connection.patch
+# Upstream as of Python 2.7.4
+# Patch172: 00172-use-poll-for-multiprocessing-socket-connection.patch
# 00173 #
# Workaround for ENOPROTOOPT seen in Koji within
@@ -1080,7 +1046,7 @@ done
%patch54 -p1 -b .setup-db48
-%patch101 -p1 -b .lib64-regex
+# patch101: upstream as of Python 2.7.4
%if "%{_lib}" == "lib64"
%patch102 -p1 -b .lib64
%patch103 -p1 -b .lib64-sysconfig
@@ -1152,7 +1118,7 @@ done
%patch155 -p1
%patch156 -p1
%patch157 -p1
-%patch158 -p1
+# 00158: upstream as of Python 2.7.4
%patch159 -p1 -F 3
# 00160: not for python 2
# 00161: not for python 2 yet
@@ -1166,8 +1132,8 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch168 -p1
%patch169 -p1
%patch170 -p1
-%patch171 -p1 -b .raise-correct-exception-when-dev-urandom-is-missing
-%patch172 -p1
+# 00171: upstream as of Python 2.7.4
+# 00171: upstream as of Python 2.7.4
%patch173 -p1
%patch174 -p1 -b .fix-for-usr-move
%patch175 -p1 -b .fix-configure-Wformat
@@ -2003,6 +1969,19 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Mon Apr 08 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.4-1
+- Updated to Python 2.7.4.
+- Refreshed patches: 0 (config), 7 (sqlite encoding), 16 (rpath in config),
+55 (systemtap), 111 (no static lib), 112 (debug build), 113 (more
+configuration flags), 130 (add extension to python config), 134 (fix
+COUNT_ALLOCS in test_sys), 146 (haslib FIPS), 147 (add debug malloc stats),
+153 (fix gdb test noise), 157 (uid, gid overflow - fixed upstream, just
+keeping few more downstream tests), 165 (crypt module salt backport),
+175 (fix configure Wformat), 5000 (regenerated autotooling patch)
+- Dropped patches: 101 (lib64 regex; merged upstream), 171 (exception on
+missing /dev/urandom; merged upstream), 172 (poll for multiprocessing socket
+connection; merged upstream)
+
* Mon Mar 25 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-35
- fix gcc 4.8 incompatibility (rhbz#927358); regenerate autotool intermediates
commit a30193e75fa9150f8b2e4c78ac82a35c3cb6b6de
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Wed Apr 10 10:29:51 2013 +0200
Again that annoying dist-git but which makes it seems that staged files were commited,
but they werent...
diff --git a/sources b/sources
index d0fe0cc..5359ae4 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-62c4c1699170078c469f79ddfed21bc0 Python-2.7.3.tar.xz
+86909785aa1ff13b49d87737b75b5f54 Python-2.7.4.tar.xz
commit 43e7c42fbab1e41491789a5b2ab9f3a037bc097f
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Tue Apr 9 10:54:58 2013 +0200
Updated to Python 2.7.4.
- Refreshed patches: 0 (config), 7 (sqlite encoding), 16 (rpath in config),
55 (systemtap), 111 (no static lib), 112 (debug build), 113 (more
configuration flags), 130 (add extension to python config), 134 (fix
COUNT_ALLOCS in test_sys), 146 (haslib FIPS), 147 (add debug malloc stats),
153 (fix gdb test noise), 157 (uid, gid overflow - fixed upstream, just
keeping few more downstream tests), 165 (crypt module salt backport),
175 (fix configure Wformat), 5000 (regenerated autotooling patch)
- Dropped patches: 101 (lib64 regex; merged upstream), 171 (exception on
missing /dev/urandom; merged upstream), 172 (poll for multiprocessing socket
connection; merged upstream)
diff --git a/00055-systemtap.patch b/00055-systemtap.patch
index 8c81e9d..67ec005 100644
--- a/00055-systemtap.patch
+++ b/00055-systemtap.patch
@@ -1,6 +1,6 @@
-diff -up Python-2.7rc1/configure.in.systemtap Python-2.7rc1/configure.in
---- Python-2.7rc1/configure.in.systemtap 2010-06-06 10:53:15.514975012 -0400
-+++ Python-2.7rc1/configure.in 2010-06-06 10:53:15.520974361 -0400
+diff -up Python-2.7rc1/configure.ac.systemtap Python-2.7rc1/configure.ac
+--- Python-2.7rc1/configure.ac.systemtap 2010-06-06 10:53:15.514975012 -0400
++++ Python-2.7rc1/configure.ac 2010-06-06 10:53:15.520974361 -0400
@@ -2616,6 +2616,38 @@ if test "$with_valgrind" != no; then
)
fi
@@ -87,9 +87,9 @@ diff -up Python-2.7rc1/Makefile.pre.in.systemtap
Python-2.7rc1/Makefile.pre.in
@@ -1251,7 +1264,7 @@ Python/thread.o: @THREADHEADERS@
.PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
.PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
- .PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean
--.PHONY: smelly funny patchcheck
-+.PHONY: smelly funny patchcheck buildinclude
+ .PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean
+-.PHONY: smelly funny patchcheck touch altmaninstall
++.PHONY: smelly funny patchcheck touch altmaninstall buildinclude
.PHONY: gdbhooks
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
diff --git a/00111-no-static-lib.patch b/00111-no-static-lib.patch
index c331454..2f4fdd6 100644
--- a/00111-no-static-lib.patch
+++ b/00111-no-static-lib.patch
@@ -11,8 +11,8 @@ diff -up Python-2.7.3/Makefile.pre.in.no-static-lib
Python-2.7.3/Makefile.pre.in
Modules/python.o \
$(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
@@ -413,18 +413,6 @@ sharedmods: $(BUILDPYTHON)
- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)'
./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
- esac
+ $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
+ $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
-# Build static library
-# avoid long command lines, same as LIBRARY_OBJS
diff --git a/00113-more-configuration-flags.patch b/00113-more-configuration-flags.patch
index 9ee3180..2d447b2 100644
--- a/00113-more-configuration-flags.patch
+++ b/00113-more-configuration-flags.patch
@@ -1,6 +1,6 @@
-diff -up Python-2.6.5/configure.in.more-configuration-flags Python-2.6.5/configure.in
---- Python-2.6.5/configure.in.more-configuration-flags 2010-05-24 18:51:25.410111792
-0400
-+++ Python-2.6.5/configure.in 2010-05-24 18:59:23.954986388 -0400
+diff -up Python-2.6.5/configure.ac.more-configuration-flags Python-2.6.5/configure.ac
+--- Python-2.6.5/configure.ac.more-configuration-flags 2010-05-24 18:51:25.410111792
-0400
++++ Python-2.6.5/configure.ac 2010-05-24 18:59:23.954986388 -0400
@@ -2515,6 +2515,30 @@ else AC_MSG_RESULT(no)
fi],
[AC_MSG_RESULT(no)])
diff --git a/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch
b/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch
index 362145e..38381ef 100644
--- a/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch
+++ b/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch
@@ -3,11 +3,11 @@
@@ -734,6 +734,11 @@ class SizeofTest(unittest.TestCase):
# (PyTypeObject + PyNumberMethods + PyMappingMethods +
# PySequenceMethods + PyBufferProcs)
- s = size(vh + 'P2P15Pl4PP9PP11PI') + size('41P 10P 3P 6P')
+ s = vsize('P2P15Pl4PP9PP11PI') + struct.calcsize('41P 10P 3P
6P')
+
+ # COUNT_ALLOCS adds further fields to the end of a PyTypeObject:
+ if hasattr(sys, 'getcounts'):
-+ s += size('5P')
++ s += size('P')
+
class newstyleclass(object):
pass
diff --git a/00146-hashlib-fips.patch b/00146-hashlib-fips.patch
index 8616296..c67eb3b 100644
--- a/00146-hashlib-fips.patch
+++ b/00146-hashlib-fips.patch
@@ -67,7 +67,7 @@ diff -up Python-2.7.2/Lib/hashlib.py.hashlib-fips
Python-2.7.2/Lib/hashlib.py
- except ImportError:
- pass # no extension module, this hash is unsupported.
-
-- raise ValueError('unsupported hash type %s' % name)
+- raise ValueError('unsupported hash type ' + name)
-
-
def __get_openssl_constructor(name):
@@ -199,9 +199,9 @@ diff -up Python-2.7.2/Lib/test/test_hashlib.py.hashlib-fips
Python-2.7.2/Lib/tes
c.hexdigest()
def test_algorithms_attribute(self):
-@@ -115,27 +113,9 @@ class HashLibTestCase(unittest.TestCase)
- else:
- self.assertTrue(0 == "hashlib didn't reject bogus hash name")
+@@ -115,28 +113,9 @@ class HashLibTestCase(unittest.TestCase)
+ self.assertRaises(ValueError, hashlib.new, 'spam spam spam spam spam')
+ self.assertRaises(TypeError, hashlib.new, 1)
- def test_get_builtin_constructor(self):
- get_builtin_constructor = hashlib.__dict__[
@@ -220,6 +220,7 @@ diff -up Python-2.7.2/Lib/test/test_hashlib.py.hashlib-fips
Python-2.7.2/Lib/tes
- sys.modules['_md5'] = _md5
- else:
- del sys.modules['_md5']
+- self.assertRaises(TypeError, get_builtin_constructor, 3)
-
def test_hexdigest(self):
for name in self.supported_hash_names:
@@ -366,7 +367,7 @@ diff -up Python-2.7.2/Modules/_hashopenssl.c.hashlib-fips
Python-2.7.2/Modules/_
+} EVPCachedInfo;
-#define DEFINE_CONSTS_FOR_NEW(Name) \
-- static PyObject *CONST_ ## Name ## _name_obj; \
+- static PyObject *CONST_ ## Name ## _name_obj = NULL; \
- static EVP_MD_CTX CONST_new_ ## Name ## _ctx; \
- static EVP_MD_CTX *CONST_new_ ## Name ## _ctx_p = NULL;
+#define DEFINE_CONSTS_FOR_NEW(Name) \
@@ -513,7 +514,7 @@ diff -up Python-2.7.2/Modules/_hashopenssl.c.hashlib-fips
Python-2.7.2/Modules/_
return NULL;
}
-@@ -484,55 +556,118 @@ EVP_new(PyObject *self, PyObject *args,
+@@ -484,58 +556,118 @@ EVP_new(PyObject *self, PyObject *args,
digest = EVP_get_digestbyname(name);
ret_obj = EVPnew(name_obj, digest, NULL, (unsigned char*)view.buf,
@@ -615,12 +616,15 @@ diff -up Python-2.7.2/Modules/_hashopenssl.c.hashlib-fips
Python-2.7.2/Modules/_
" hash object; optionally initialized with a string") \
}
--/* used in the init function to setup a constructor */
+-/* used in the init function to setup a constructor: initialize OpenSSL
+- constructor constants if they haven't been initialized already. */
-#define INIT_CONSTRUCTOR_CONSTANTS(NAME) do { \
+- if (CONST_ ## NAME ## _name_obj == NULL) { \
- CONST_ ## NAME ## _name_obj = PyString_FromString(#NAME); \
-- if (EVP_get_digestbyname(#NAME)) { \
-- CONST_new_ ## NAME ## _ctx_p = &CONST_new_ ## NAME ## _ctx; \
-- EVP_DigestInit(CONST_new_ ## NAME ## _ctx_p, EVP_get_digestbyname(#NAME)); \
+- if (EVP_get_digestbyname(#NAME)) { \
+- CONST_new_ ## NAME ## _ctx_p = &CONST_new_ ## NAME ## _ctx; \
+- EVP_DigestInit(CONST_new_ ## NAME ## _ctx_p, EVP_get_digestbyname(#NAME));
\
+- } \
- } \
+/*
+ Macro/function pair to set up the constructors.
diff --git a/00147-add-debug-malloc-stats.patch b/00147-add-debug-malloc-stats.patch
index 25e8970..0ab8c94 100644
--- a/00147-add-debug-malloc-stats.patch
+++ b/00147-add-debug-malloc-stats.patch
@@ -75,8 +75,8 @@ diff -up Python-2.7.2/Include/object.h.add-debug-malloc-stats
Python-2.7.2/Inclu
--- Python-2.7.2/Include/object.h.add-debug-malloc-stats 2011-06-11 11:46:23.000000000
-0400
+++ Python-2.7.2/Include/object.h 2011-09-16 19:03:25.108821625 -0400
@@ -980,6 +980,13 @@ PyAPI_DATA(PyObject *) _PyTrash_delete_l
- else \
- _PyTrash_deposit_object((PyObject*)op);
+ _PyTrash_thread_deposit_object((PyObject*)op); \
+ } while (0);
+PyAPI_FUNC(void)
+_PyDebugAllocatorStats(FILE *out, const char *block_name, int num_blocks,
@@ -165,7 +165,7 @@ diff -up Python-2.7.2/Lib/test/test_sys.py.add-debug-malloc-stats
Python-2.7.2/L
+
class SizeofTest(unittest.TestCase):
- TPFLAGS_HAVE_GC = 1<<14
+ def setUp(self):
diff -up Python-2.7.2/Objects/classobject.c.add-debug-malloc-stats
Python-2.7.2/Objects/classobject.c
--- Python-2.7.2/Objects/classobject.c.add-debug-malloc-stats 2011-06-11
11:46:27.000000000 -0400
+++ Python-2.7.2/Objects/classobject.c 2011-09-16 19:03:25.110821625 -0400
@@ -542,8 +542,8 @@ diff -up Python-2.7.2/Objects/stringobject.c.add-debug-malloc-stats
Python-2.7.2
--- Python-2.7.2/Objects/stringobject.c.add-debug-malloc-stats 2011-06-11
11:46:27.000000000 -0400
+++ Python-2.7.2/Objects/stringobject.c 2011-09-16 19:03:25.116821625 -0400
@@ -4822,3 +4822,43 @@ void _Py_ReleaseInternedStrings(void)
- Py_DECREF(interned);
- interned = NULL;
+ PyDict_Clear(interned);
+ Py_CLEAR(interned);
}
+
+void _PyString_DebugMallocStats(FILE *out)
diff --git a/00153-fix-test_gdb-noise.patch b/00153-fix-test_gdb-noise.patch
index bc5ee63..0495d95 100644
--- a/00153-fix-test_gdb-noise.patch
+++ b/00153-fix-test_gdb-noise.patch
@@ -17,8 +17,8 @@
if cmds_after_breakpoint:
commands += cmds_after_breakpoint
@@ -135,8 +144,16 @@ class DebuggerTests(unittest.TestCase):
- err = err.replace("warning: Cannot initialize thread debugging"
- " library: Debugger service failed\n",
+ 'Do you need "set solib-search-path" or '
+ '"set sysroot"?\n',
'')
+ err = '\n'.join([line
+ for line in err.splitlines()
diff --git a/00157-uid-gid-overflows.patch b/00157-uid-gid-overflows.patch
index 0d6abb5..13546bb 100644
--- a/00157-uid-gid-overflows.patch
+++ b/00157-uid-gid-overflows.patch
@@ -1,44 +1,3 @@
-diff -up Python-2.7.3/Include/modsupport.h.uid-gid-overflows
Python-2.7.3/Include/modsupport.h
---- Python-2.7.3/Include/modsupport.h.uid-gid-overflows 2012-04-09 19:07:29.000000000
-0400
-+++ Python-2.7.3/Include/modsupport.h 2012-06-26 14:52:03.739471150 -0400
-@@ -8,6 +8,7 @@ extern "C" {
- /* Module support interface */
-
- #include <stdarg.h>
-+#include <sys/types.h>
-
- /* If PY_SSIZE_T_CLEAN is defined, each functions treats #-specifier
- to mean Py_ssize_t */
-@@ -128,6 +129,17 @@ PyAPI_FUNC(PyObject *) Py_InitModule4(co
-
- PyAPI_DATA(char *) _Py_PackageContext;
-
-+/*
-+ Non-standard extension: support for dealing with uid_t and gid_t without
-+ integer overflow
-+ */
-+
-+PyAPI_FUNC(PyObject *) _PyObject_FromUid(uid_t uid);
-+PyAPI_FUNC(PyObject *) _PyObject_FromGid(gid_t gid);
-+
-+PyAPI_FUNC(int) _PyArg_ParseUid(PyObject *in_obj, uid_t *out_uid);
-+PyAPI_FUNC(int) _PyArg_ParseGid(PyObject *in_obj, gid_t *out_gid);
-+
- #ifdef __cplusplus
- }
- #endif
-diff -up Python-2.7.3/Lib/test/test_grp.py.uid-gid-overflows
Python-2.7.3/Lib/test/test_grp.py
---- Python-2.7.3/Lib/test/test_grp.py.uid-gid-overflows 2012-04-09 19:07:31.000000000
-0400
-+++ Python-2.7.3/Lib/test/test_grp.py 2012-06-26 14:51:36.000817929 -0400
-@@ -16,7 +16,7 @@ class GroupDatabaseTestCase(unittest.Tes
- self.assertEqual(value[1], value.gr_passwd)
- self.assertIsInstance(value.gr_passwd, basestring)
- self.assertEqual(value[2], value.gr_gid)
-- self.assertIsInstance(value.gr_gid, int)
-+ self.assertIsInstance(value.gr_gid, (int, long))
- self.assertEqual(value[3], value.gr_mem)
- self.assertIsInstance(value.gr_mem, list)
-
diff -up Python-2.7.3/Lib/test/test_os.py.uid-gid-overflows
Python-2.7.3/Lib/test/test_os.py
--- Python-2.7.3/Lib/test/test_os.py.uid-gid-overflows 2012-04-09 19:07:32.000000000
-0400
+++ Python-2.7.3/Lib/test/test_os.py 2012-06-26 14:51:36.000817929 -0400
@@ -88,649 +47,3 @@ diff -up Python-2.7.3/Lib/test/test_os.py.uid-gid-overflows
Python-2.7.3/Lib/tes
self.assertRaises(OverflowError, os.setregid, 1<<32, 0)
self.assertRaises(OverflowError, os.setregid, 0, 1<<32)
-diff -up Python-2.7.3/Lib/test/test_posix.py.uid-gid-overflows
Python-2.7.3/Lib/test/test_posix.py
---- Python-2.7.3/Lib/test/test_posix.py.uid-gid-overflows 2012-04-09 19:07:32.000000000
-0400
-+++ Python-2.7.3/Lib/test/test_posix.py 2012-06-26 14:51:36.001817916 -0400
-@@ -217,7 +217,7 @@ class PosixTester(unittest.TestCase):
- if hasattr(posix, 'stat'):
- self.assertTrue(posix.stat(test_support.TESTFN))
-
-- def _test_all_chown_common(self, chown_func, first_param):
-+ def _test_all_chown_common(self, chown_func, stat_func, first_param):
- """Common code for chown, fchown and lchown
tests."""
- if os.getuid() == 0:
- try:
-@@ -237,6 +237,13 @@ class PosixTester(unittest.TestCase):
-
- # test a successful chown call
- chown_func(first_param, os.getuid(), os.getgid())
-+ self.assertEqual(stat_func(first_param).st_uid, os.getuid())
-+ self.assertEqual(stat_func(first_param).st_gid, os.getgid())
-+
-+ # verify that -1 works as a "do-nothing" option:
-+ chown_func(first_param, -1, -1)
-+ self.assertEqual(stat_func(first_param).st_uid, os.getuid())
-+ self.assertEqual(stat_func(first_param).st_gid, os.getgid())
-
- @unittest.skipUnless(hasattr(posix, 'chown'), "test needs
os.chown()")
- def test_chown(self):
-@@ -246,7 +253,7 @@ class PosixTester(unittest.TestCase):
-
- # re-create the file
- open(test_support.TESTFN, 'w').close()
-- self._test_all_chown_common(posix.chown, test_support.TESTFN)
-+ self._test_all_chown_common(posix.chown, posix.stat, test_support.TESTFN)
-
- @unittest.skipUnless(hasattr(posix, 'fchown'), "test needs
os.fchown()")
- def test_fchown(self):
-@@ -256,7 +263,7 @@ class PosixTester(unittest.TestCase):
- test_file = open(test_support.TESTFN, 'w')
- try:
- fd = test_file.fileno()
-- self._test_all_chown_common(posix.fchown, fd)
-+ self._test_all_chown_common(posix.fchown, posix.fstat, fd)
- finally:
- test_file.close()
-
-@@ -265,7 +272,7 @@ class PosixTester(unittest.TestCase):
- os.unlink(test_support.TESTFN)
- # create a symlink
- os.symlink(_DUMMY_SYMLINK, test_support.TESTFN)
-- self._test_all_chown_common(posix.lchown, test_support.TESTFN)
-+ self._test_all_chown_common(posix.lchown, posix.lstat, test_support.TESTFN)
-
- def test_chdir(self):
- if hasattr(posix, 'chdir'):
-diff -up Python-2.7.3/Lib/test/test_pwd.py.uid-gid-overflows
Python-2.7.3/Lib/test/test_pwd.py
---- Python-2.7.3/Lib/test/test_pwd.py.uid-gid-overflows 2012-04-09 19:07:32.000000000
-0400
-+++ Python-2.7.3/Lib/test/test_pwd.py 2012-06-26 14:51:36.001817916 -0400
-@@ -18,9 +18,9 @@ class PwdTest(unittest.TestCase):
- self.assertEqual(e[1], e.pw_passwd)
- self.assertIsInstance(e.pw_passwd, basestring)
- self.assertEqual(e[2], e.pw_uid)
-- self.assertIsInstance(e.pw_uid, int)
-+ self.assertIsInstance(e.pw_uid, (int, long))
- self.assertEqual(e[3], e.pw_gid)
-- self.assertIsInstance(e.pw_gid, int)
-+ self.assertIsInstance(e.pw_gid, (int, long))
- self.assertEqual(e[4], e.pw_gecos)
- self.assertIsInstance(e.pw_gecos, basestring)
- self.assertEqual(e[5], e.pw_dir)
-@@ -87,9 +87,9 @@ class PwdTest(unittest.TestCase):
- # In some cases, byuids isn't a complete list of all users in the
- # system, so if we try to pick a value not in byuids (via a perturbing
- # loop, say), pwd.getpwuid() might still be able to find data for that
-- # uid. Using sys.maxint may provoke the same problems, but hopefully
-+ # uid. Using 2**32 - 2 may provoke the same problems, but hopefully
- # it will be a more repeatable failure.
-- fakeuid = sys.maxint
-+ fakeuid = 2**32 - 2
- self.assertNotIn(fakeuid, byuids)
- self.assertRaises(KeyError, pwd.getpwuid, fakeuid)
-
-diff -up Python-2.7.3/Modules/grpmodule.c.uid-gid-overflows
Python-2.7.3/Modules/grpmodule.c
---- Python-2.7.3/Modules/grpmodule.c.uid-gid-overflows 2012-04-09 19:07:34.000000000
-0400
-+++ Python-2.7.3/Modules/grpmodule.c 2012-06-26 14:51:36.002817904 -0400
-@@ -70,7 +70,7 @@ mkgrent(struct group *p)
- Py_INCREF(Py_None);
- }
- #endif
-- SET(setIndex++, PyInt_FromLong((long) p->gr_gid));
-+ SET(setIndex++, _PyObject_FromGid(p->gr_gid));
- SET(setIndex++, w);
- #undef SET
-
-@@ -85,18 +85,15 @@ mkgrent(struct group *p)
- static PyObject *
- grp_getgrgid(PyObject *self, PyObject *pyo_id)
- {
-- PyObject *py_int_id;
-- unsigned int gid;
-+ gid_t gid;
- struct group *p;
-
-- py_int_id = PyNumber_Int(pyo_id);
-- if (!py_int_id)
-- return NULL;
-- gid = PyInt_AS_LONG(py_int_id);
-- Py_DECREF(py_int_id);
-+ if (!_PyArg_ParseGid(pyo_id, &gid)) {
-+ return NULL;
-+ }
-
- if ((p = getgrgid(gid)) == NULL) {
-- PyErr_Format(PyExc_KeyError, "getgrgid(): gid not found: %d", gid);
-+ PyErr_Format(PyExc_KeyError, "getgrgid(): gid not found: %lu",
(unsigned long)gid);
- return NULL;
- }
- return mkgrent(p);
-diff -up Python-2.7.3/Modules/posixmodule.c.uid-gid-overflows
Python-2.7.3/Modules/posixmodule.c
---- Python-2.7.3/Modules/posixmodule.c.uid-gid-overflows 2012-06-26 14:51:35.864819629
-0400
-+++ Python-2.7.3/Modules/posixmodule.c 2012-06-26 14:51:36.005817868 -0400
-@@ -1305,8 +1305,8 @@ _pystat_fromstructstat(STRUCT_STAT *st)
- PyStructSequence_SET_ITEM(v, 2, PyInt_FromLong((long)st->st_dev));
- #endif
- PyStructSequence_SET_ITEM(v, 3, PyInt_FromLong((long)st->st_nlink));
-- PyStructSequence_SET_ITEM(v, 4, PyInt_FromLong((long)st->st_uid));
-- PyStructSequence_SET_ITEM(v, 5, PyInt_FromLong((long)st->st_gid));
-+ PyStructSequence_SET_ITEM(v, 4, _PyObject_FromUid(st->st_uid));
-+ PyStructSequence_SET_ITEM(v, 5, _PyObject_FromGid(st->st_gid));
- #ifdef HAVE_LARGEFILE_SUPPORT
- PyStructSequence_SET_ITEM(v, 6,
- PyLong_FromLongLong((PY_LONG_LONG)st->st_size));
-@@ -1883,14 +1883,16 @@ static PyObject *
- posix_chown(PyObject *self, PyObject *args)
- {
- char *path = NULL;
-- long uid, gid;
-+ uid_t uid;
-+ gid_t gid;
- int res;
-- if (!PyArg_ParseTuple(args, "etll:chown",
-+ if (!PyArg_ParseTuple(args, "etO&O&:chown",
- Py_FileSystemDefaultEncoding, &path,
-- &uid, &gid))
-+ _PyArg_ParseUid, &uid,
-+ _PyArg_ParseGid, &gid))
- return NULL;
- Py_BEGIN_ALLOW_THREADS
-- res = chown(path, (uid_t) uid, (gid_t) gid);
-+ res = chown(path, uid, gid);
- Py_END_ALLOW_THREADS
- if (res < 0)
- return posix_error_with_allocated_filename(path);
-@@ -1910,12 +1912,15 @@ static PyObject *
- posix_fchown(PyObject *self, PyObject *args)
- {
- int fd;
-- long uid, gid;
-+ uid_t uid;
-+ gid_t gid;
- int res;
-- if (!PyArg_ParseTuple(args, "ill:chown", &fd, &uid, &gid))
-+ if (!PyArg_ParseTuple(args, "iO&O&:chown", &fd,
-+ _PyArg_ParseUid, &uid,
-+ _PyArg_ParseGid, &gid))
- return NULL;
- Py_BEGIN_ALLOW_THREADS
-- res = fchown(fd, (uid_t) uid, (gid_t) gid);
-+ res = fchown(fd, uid, gid);
- Py_END_ALLOW_THREADS
- if (res < 0)
- return posix_error();
-@@ -1933,14 +1938,16 @@ static PyObject *
- posix_lchown(PyObject *self, PyObject *args)
- {
- char *path = NULL;
-- long uid, gid;
-+ uid_t uid;
-+ gid_t gid;
- int res;
-- if (!PyArg_ParseTuple(args, "etll:lchown",
-+ if (!PyArg_ParseTuple(args, "etO&O&:lchown",
- Py_FileSystemDefaultEncoding, &path,
-- &uid, &gid))
-+ _PyArg_ParseUid, &uid,
-+ _PyArg_ParseGid, &gid))
- return NULL;
- Py_BEGIN_ALLOW_THREADS
-- res = lchown(path, (uid_t) uid, (gid_t) gid);
-+ res = lchown(path, uid, gid);
- Py_END_ALLOW_THREADS
- if (res < 0)
- return posix_error_with_allocated_filename(path);
-@@ -3841,7 +3848,7 @@ Return the current process's effective g
- static PyObject *
- posix_getegid(PyObject *self, PyObject *noargs)
- {
-- return PyInt_FromLong((long)getegid());
-+ return _PyObject_FromGid(getegid());
- }
- #endif
-
-@@ -3854,7 +3861,7 @@ Return the current process's effective u
- static PyObject *
- posix_geteuid(PyObject *self, PyObject *noargs)
- {
-- return PyInt_FromLong((long)geteuid());
-+ return _PyObject_FromUid(geteuid());
- }
- #endif
-
-@@ -3867,7 +3874,7 @@ Return the current process's group id.")
- static PyObject *
- posix_getgid(PyObject *self, PyObject *noargs)
- {
-- return PyInt_FromLong((long)getgid());
-+ return _PyObject_FromGid(getgid());
- }
- #endif
-
-@@ -3942,7 +3949,7 @@ posix_getgroups(PyObject *self, PyObject
- if (result != NULL) {
- int i;
- for (i = 0; i < n; ++i) {
-- PyObject *o = PyInt_FromLong((long)alt_grouplist[i]);
-+ PyObject *o = _PyObject_FromGid(alt_grouplist[i]);
- if (o == NULL) {
- Py_DECREF(result);
- result = NULL;
-@@ -3971,12 +3978,13 @@ static PyObject *
- posix_initgroups(PyObject *self, PyObject *args)
- {
- char *username;
-- long gid;
-+ gid_t gid;
-
-- if (!PyArg_ParseTuple(args, "sl:initgroups", &username, &gid))
-+ if (!PyArg_ParseTuple(args, "sO&:initgroups", &username,
-+ _PyArg_ParseGid, &gid))
- return NULL;
-
-- if (initgroups(username, (gid_t) gid) == -1)
-+ if (initgroups(username, gid) == -1)
- return PyErr_SetFromErrno(PyExc_OSError);
-
- Py_INCREF(Py_None);
-@@ -4090,7 +4098,7 @@ Return the current process's user id.");
- static PyObject *
- posix_getuid(PyObject *self, PyObject *noargs)
- {
-- return PyInt_FromLong((long)getuid());
-+ return _PyObject_FromUid(getuid());
- }
- #endif
-
-@@ -5736,15 +5744,9 @@ Set the current process's user id.");
- static PyObject *
- posix_setuid(PyObject *self, PyObject *args)
- {
-- long uid_arg;
- uid_t uid;
-- if (!PyArg_ParseTuple(args, "l:setuid", &uid_arg))
-+ if (!PyArg_ParseTuple(args, "O&:setuid", _PyArg_ParseUid, &uid))
- return NULL;
-- uid = uid_arg;
-- if (uid != uid_arg) {
-- PyErr_SetString(PyExc_OverflowError, "user id too big");
-- return NULL;
-- }
- if (setuid(uid) < 0)
- return posix_error();
- Py_INCREF(Py_None);
-@@ -5761,15 +5763,9 @@ Set the current process's effective user
- static PyObject *
- posix_seteuid (PyObject *self, PyObject *args)
- {
-- long euid_arg;
- uid_t euid;
-- if (!PyArg_ParseTuple(args, "l", &euid_arg))
-+ if (!PyArg_ParseTuple(args, "O&:seteuid", _PyArg_ParseUid,
&euid))
- return NULL;
-- euid = euid_arg;
-- if (euid != euid_arg) {
-- PyErr_SetString(PyExc_OverflowError, "user id too big");
-- return NULL;
-- }
- if (seteuid(euid) < 0) {
- return posix_error();
- } else {
-@@ -5787,15 +5783,9 @@ Set the current process's effective grou
- static PyObject *
- posix_setegid (PyObject *self, PyObject *args)
- {
-- long egid_arg;
- gid_t egid;
-- if (!PyArg_ParseTuple(args, "l", &egid_arg))
-+ if (!PyArg_ParseTuple(args, "O&:setegid", _PyArg_ParseGid,
&egid))
- return NULL;
-- egid = egid_arg;
-- if (egid != egid_arg) {
-- PyErr_SetString(PyExc_OverflowError, "group id too big");
-- return NULL;
-- }
- if (setegid(egid) < 0) {
- return posix_error();
- } else {
-@@ -5813,23 +5803,11 @@ Set the current process's real and effec
- static PyObject *
- posix_setreuid (PyObject *self, PyObject *args)
- {
-- long ruid_arg, euid_arg;
- uid_t ruid, euid;
-- if (!PyArg_ParseTuple(args, "ll", &ruid_arg, &euid_arg))
-+ if (!PyArg_ParseTuple(args, "O&O&",
-+ _PyArg_ParseUid, &ruid,
-+ _PyArg_ParseUid, &euid))
- return NULL;
-- if (ruid_arg == -1)
-- ruid = (uid_t)-1; /* let the compiler choose how -1 fits */
-- else
-- ruid = ruid_arg; /* otherwise, assign from our long */
-- if (euid_arg == -1)
-- euid = (uid_t)-1;
-- else
-- euid = euid_arg;
-- if ((euid_arg != -1 && euid != euid_arg) ||
-- (ruid_arg != -1 && ruid != ruid_arg)) {
-- PyErr_SetString(PyExc_OverflowError, "user id too big");
-- return NULL;
-- }
- if (setreuid(ruid, euid) < 0) {
- return posix_error();
- } else {
-@@ -5847,23 +5825,11 @@ Set the current process's real and effec
- static PyObject *
- posix_setregid (PyObject *self, PyObject *args)
- {
-- long rgid_arg, egid_arg;
- gid_t rgid, egid;
-- if (!PyArg_ParseTuple(args, "ll", &rgid_arg, &egid_arg))
-+ if (!PyArg_ParseTuple(args, "O&O&",
-+ _PyArg_ParseGid, &rgid,
-+ _PyArg_ParseGid, &egid))
- return NULL;
-- if (rgid_arg == -1)
-- rgid = (gid_t)-1; /* let the compiler choose how -1 fits */
-- else
-- rgid = rgid_arg; /* otherwise, assign from our long */
-- if (egid_arg == -1)
-- egid = (gid_t)-1;
-- else
-- egid = egid_arg;
-- if ((egid_arg != -1 && egid != egid_arg) ||
-- (rgid_arg != -1 && rgid != rgid_arg)) {
-- PyErr_SetString(PyExc_OverflowError, "group id too big");
-- return NULL;
-- }
- if (setregid(rgid, egid) < 0) {
- return posix_error();
- } else {
-@@ -5881,15 +5847,9 @@ Set the current process's group id.");
- static PyObject *
- posix_setgid(PyObject *self, PyObject *args)
- {
-- long gid_arg;
- gid_t gid;
-- if (!PyArg_ParseTuple(args, "l:setgid", &gid_arg))
-- return NULL;
-- gid = gid_arg;
-- if (gid != gid_arg) {
-- PyErr_SetString(PyExc_OverflowError, "group id too big");
-+ if (!PyArg_ParseTuple(args, "O&:setgid", _PyArg_ParseGid, &gid))
- return NULL;
-- }
- if (setgid(gid) < 0)
- return posix_error();
- Py_INCREF(Py_None);
-@@ -5922,39 +5882,10 @@ posix_setgroups(PyObject *self, PyObject
- elem = PySequence_GetItem(groups, i);
- if (!elem)
- return NULL;
-- if (!PyInt_Check(elem)) {
-- if (!PyLong_Check(elem)) {
-- PyErr_SetString(PyExc_TypeError,
-- "groups must be integers");
-- Py_DECREF(elem);
-- return NULL;
-- } else {
-- unsigned long x = PyLong_AsUnsignedLong(elem);
-- if (PyErr_Occurred()) {
-- PyErr_SetString(PyExc_TypeError,
-- "group id too big");
-- Py_DECREF(elem);
-- return NULL;
-- }
-- grouplist[i] = x;
-- /* read back to see if it fits in gid_t */
-- if (grouplist[i] != x) {
-- PyErr_SetString(PyExc_TypeError,
-- "group id too big");
-- Py_DECREF(elem);
-- return NULL;
-- }
-- }
-- } else {
-- long x = PyInt_AsLong(elem);
-- grouplist[i] = x;
-- if (grouplist[i] != x) {
-- PyErr_SetString(PyExc_TypeError,
-- "group id too big");
-- Py_DECREF(elem);
-- return NULL;
-- }
-- }
-+ if (!_PyArg_ParseGid(elem, &grouplist[i])) {
-+ Py_DECREF(elem);
-+ return NULL;
-+ }
- Py_DECREF(elem);
- }
-
-@@ -8576,9 +8507,11 @@ Set the current process's real, effectiv
- static PyObject*
- posix_setresuid (PyObject *self, PyObject *args)
- {
-- /* We assume uid_t is no larger than a long. */
-- long ruid, euid, suid;
-- if (!PyArg_ParseTuple(args, "lll", &ruid, &euid, &suid))
-+ uid_t ruid, euid, suid;
-+ if (!PyArg_ParseTuple(args, "O&O&O&",
-+ _PyArg_ParseUid, &ruid,
-+ _PyArg_ParseUid, &euid,
-+ _PyArg_ParseUid, &suid))
- return NULL;
- if (setresuid(ruid, euid, suid) < 0)
- return posix_error();
-@@ -8594,9 +8527,12 @@ Set the current process's real, effectiv
- static PyObject*
- posix_setresgid (PyObject *self, PyObject *args)
- {
-- /* We assume uid_t is no larger than a long. */
-- long rgid, egid, sgid;
-- if (!PyArg_ParseTuple(args, "lll", &rgid, &egid, &sgid))
-+ gid_t rgid, egid, sgid;
-+ if (!PyArg_ParseTuple(args, "O&O&O&",
-+ _PyArg_ParseGid, &rgid,
-+ _PyArg_ParseGid, &egid,
-+ _PyArg_ParseGid, &sgid))
-+
- return NULL;
- if (setresgid(rgid, egid, sgid) < 0)
- return posix_error();
-@@ -8613,14 +8549,13 @@ static PyObject*
- posix_getresuid (PyObject *self, PyObject *noargs)
- {
- uid_t ruid, euid, suid;
-- long l_ruid, l_euid, l_suid;
-+ PyObject *obj_ruid, *obj_euid, *obj_suid;
- if (getresuid(&ruid, &euid, &suid) < 0)
- return posix_error();
-- /* Force the values into long's as we don't know the size of uid_t. */
-- l_ruid = ruid;
-- l_euid = euid;
-- l_suid = suid;
-- return Py_BuildValue("(lll)", l_ruid, l_euid, l_suid);
-+ obj_ruid = _PyObject_FromUid(ruid);
-+ obj_euid = _PyObject_FromUid(euid);
-+ obj_suid = _PyObject_FromUid(suid);
-+ return Py_BuildValue("(NNN)", obj_ruid, obj_euid, obj_suid);
- }
- #endif
-
-@@ -8632,15 +8567,14 @@ Get tuple of the current process's real,
- static PyObject*
- posix_getresgid (PyObject *self, PyObject *noargs)
- {
-- uid_t rgid, egid, sgid;
-- long l_rgid, l_egid, l_sgid;
-+ gid_t rgid, egid, sgid;
-+ PyObject *obj_rgid, *obj_egid, *obj_sgid;
- if (getresgid(&rgid, &egid, &sgid) < 0)
- return posix_error();
-- /* Force the values into long's as we don't know the size of uid_t. */
-- l_rgid = rgid;
-- l_egid = egid;
-- l_sgid = sgid;
-- return Py_BuildValue("(lll)", l_rgid, l_egid, l_sgid);
-+ obj_rgid = _PyObject_FromGid(rgid);
-+ obj_egid = _PyObject_FromGid(egid);
-+ obj_sgid = _PyObject_FromGid(sgid);
-+ return Py_BuildValue("(NNN)", obj_rgid, obj_egid, obj_sgid);
- }
- #endif
-
-diff -up Python-2.7.3/Modules/pwdmodule.c.uid-gid-overflows
Python-2.7.3/Modules/pwdmodule.c
---- Python-2.7.3/Modules/pwdmodule.c.uid-gid-overflows 2012-04-09 19:07:34.000000000
-0400
-+++ Python-2.7.3/Modules/pwdmodule.c 2012-06-26 14:51:36.006817855 -0400
-@@ -73,8 +73,8 @@ mkpwent(struct passwd *p)
- #else
- SETS(setIndex++, p->pw_passwd);
- #endif
-- SETI(setIndex++, p->pw_uid);
-- SETI(setIndex++, p->pw_gid);
-+ PyStructSequence_SET_ITEM(v, setIndex++, _PyObject_FromUid(p->pw_uid));
-+ PyStructSequence_SET_ITEM(v, setIndex++, _PyObject_FromGid(p->pw_gid));
- #ifdef __VMS
- SETS(setIndex++, "");
- #else
-@@ -103,13 +103,14 @@ See help(pwd) for more on password datab
- static PyObject *
- pwd_getpwuid(PyObject *self, PyObject *args)
- {
-- unsigned int uid;
-+ uid_t uid;
- struct passwd *p;
-- if (!PyArg_ParseTuple(args, "I:getpwuid", &uid))
-+ if (!PyArg_ParseTuple(args, "O&:getpwuid",
-+ _PyArg_ParseUid, &uid))
- return NULL;
- if ((p = getpwuid(uid)) == NULL) {
- PyErr_Format(PyExc_KeyError,
-- "getpwuid(): uid not found: %d", uid);
-+ "getpwuid(): uid not found: %lu", (unsigned long)uid);
- return NULL;
- }
- return mkpwent(p);
-diff -up Python-2.7.3/Python/getargs.c.uid-gid-overflows Python-2.7.3/Python/getargs.c
---- Python-2.7.3/Python/getargs.c.uid-gid-overflows 2012-04-09 19:07:35.000000000 -0400
-+++ Python-2.7.3/Python/getargs.c 2012-06-26 14:51:36.007817842 -0400
-@@ -4,6 +4,7 @@
- #include "Python.h"
-
- #include <ctype.h>
-+#include <limits.h>
-
-
- #ifdef __cplusplus
-@@ -1902,6 +1903,110 @@ _PyArg_NoKeywords(const char *funcname,
- funcname);
- return 0;
- }
-+
-+PyObject *
-+_PyObject_FromUid(uid_t uid)
-+{
-+ if (uid <= (uid_t)LONG_MAX) {
-+ return PyInt_FromLong((uid_t)uid);
-+ } else {
-+ return PyLong_FromUnsignedLong((uid_t)uid);
-+ }
-+}
-+
-+PyObject *
-+_PyObject_FromGid(gid_t gid)
-+{
-+ if (gid <= (gid_t)LONG_MAX) {
-+ return PyInt_FromLong((gid_t)gid);
-+ } else {
-+ return PyLong_FromUnsignedLong((gid_t)gid);
-+ }
-+}
-+
-+int
-+_PyArg_ParseUid(PyObject *in_obj, uid_t *out_uid)
-+{
-+ PyObject *index, *number = NULL;
-+ long sl;
-+ unsigned long ul;
-+
-+ assert(out_uid);
-+
-+ index = PyNumber_Index(in_obj);
-+ if (index != NULL) {
-+ number = PyNumber_Long(index);
-+ Py_DECREF(index);
-+ }
-+ if (number == NULL) {
-+ PyErr_SetString(PyExc_TypeError, "user id must be integer");
-+ return 0;
-+ }
-+
-+ /* Special case: support -1 (e.g. for use by chown) */
-+ sl = PyLong_AsLong(number);
-+ if (PyErr_Occurred()) {
-+ PyErr_Clear();
-+ } else if (sl == -1) {
-+ Py_DECREF(number);
-+ *out_uid = (uid_t)-1;
-+ return 1;
-+ }
-+
-+ /* Otherwise, it must be >= 0 */
-+ ul = PyLong_AsUnsignedLong(number);
-+ Py_DECREF(number);
-+ *out_uid = ul;
-+ /* read back the value to see if it fitted in uid_t */
-+ if (PyErr_Occurred() || *out_uid != ul) {
-+ PyErr_SetString(PyExc_OverflowError,
-+ "user id is not in range(-1, 2^32-1)");
-+ return 0;
-+ }
-+ return 1;
-+}
-+
-+int
-+_PyArg_ParseGid(PyObject *in_obj, gid_t *out_gid)
-+{
-+ PyObject *index, *number = NULL;
-+ long sl;
-+ unsigned long ul;
-+
-+ assert(out_gid);
-+
-+ index = PyNumber_Index(in_obj);
-+ if (index != NULL) {
-+ number = PyNumber_Long(index);
-+ Py_DECREF(index);
-+ }
-+ if (number == NULL) {
-+ PyErr_SetString(PyExc_TypeError, "group id must be integer");
-+ return 0;
-+ }
-+
-+ /* Special case: support -1 (e.g. for use by chown) */
-+ sl = PyLong_AsLong(number);
-+ if (PyErr_Occurred()) {
-+ PyErr_Clear();
-+ } else if (sl == -1) {
-+ Py_DECREF(number);
-+ *out_gid = (gid_t)-1;
-+ return 1;
-+ }
-+
-+ ul = PyLong_AsUnsignedLong(number);
-+ Py_DECREF(number);
-+ *out_gid = ul;
-+ /* read back the value to see if it fitted in gid_t */
-+ if (PyErr_Occurred() || *out_gid != ul) {
-+ PyErr_SetString(PyExc_OverflowError,
-+ "group id is not in range(-1, 2^32-1)");
-+ return 0;
-+ }
-+ return 1;
-+}
-+
- #ifdef __cplusplus
- };
- #endif
diff --git a/00165-crypt-module-salt-backport.patch
b/00165-crypt-module-salt-backport.patch
index 6714fa1..4308b4c 100644
--- a/00165-crypt-module-salt-backport.patch
+++ b/00165-crypt-module-salt-backport.patch
@@ -266,7 +266,7 @@ diff -up Python-2.7.3/Modules/Setup.dist.crypt-module-salt-backport
Python-2.7.3
#
# First, look at Setup.config; configure may have set this for you.
--crypt cryptmodule.c -lcrypt # crypt(3); needs -lcrypt on some systems
+-crypt cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some systems
+_crypt _cryptmodule.c -lcrypt # crypt(3); needs -lcrypt on some systems
diff --git a/00170-gc-assertions.patch b/00170-gc-assertions.patch
index 088f84d..3fb37ff 100644
--- a/00170-gc-assertions.patch
+++ b/00170-gc-assertions.patch
@@ -7,9 +7,9 @@ diff -up Python-2.7.3/Lib/test/test_gc.py.gc-assertions
Python-2.7.3/Lib/test/te
+from test.test_support import verbose, run_unittest, import_module
import sys
+import sysconfig
+ import time
import gc
import weakref
-
@@ -32,6 +33,8 @@ class GC_Detector(object):
self.wr = weakref.ref(C1055820(666), it_happened)
diff --git a/00175-fix-configure-Wformat.patch b/00175-fix-configure-Wformat.patch
index b57208c..d527ab0 100644
--- a/00175-fix-configure-Wformat.patch
+++ b/00175-fix-configure-Wformat.patch
@@ -1,6 +1,6 @@
-diff -up Python-2.7.3/configure.in.fix-configure-Wformat Python-2.7.3/configure.in
---- Python-2.7.3/configure.in.fix-configure-Wformat 2013-03-25 15:15:18.473888383 -0400
-+++ Python-2.7.3/configure.in 2013-03-25 15:15:32.513887426 -0400
+diff -up Python-2.7.3/configure.ac.fix-configure-Wformat Python-2.7.3/configure.ac
+--- Python-2.7.3/configure.ac.fix-configure-Wformat 2013-03-25 15:15:18.473888383 -0400
++++ Python-2.7.3/configure.ac 2013-03-25 15:15:32.513887426 -0400
@@ -1200,7 +1200,7 @@ if test "$GCC" = "yes"
then
AC_MSG_CHECKING(whether gcc supports ParseTuple __format__)
diff --git a/05000-autotool-intermediates.patch b/05000-autotool-intermediates.patch
index 2847d47..4a40a56 100644
--- a/05000-autotool-intermediates.patch
+++ b/05000-autotool-intermediates.patch
@@ -1,44 +1,7 @@
diff -up ./configure.autotool-intermediates ./configure
---- ./configure.autotool-intermediates 2013-03-25 15:25:30.438846538 -0400
-+++ ./configure 2013-03-25 15:25:32.496846397 -0400
-@@ -1,7 +1,7 @@
- #! /bin/sh
- # From configure.in Revision.
- # Guess values for system-dependent variables and create Makefiles.
--# Generated by GNU Autoconf 2.67 for python 2.7.
-+# Generated by GNU Autoconf 2.68 for python 2.7.
- #
- # Report bugs to <
http://bugs.python.org/>.
- #
-@@ -92,6 +92,7 @@ fi
- IFS=" "" $as_nl"
-
- # Find who we are. Look in the path if we contain no directory separator.
-+as_myself=
- case $0 in #((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-@@ -217,11 +218,18 @@ IFS=$as_save_IFS
- # We cannot yet assume a decent shell, so we have to provide a
- # neutralization value for shells without unset; and this also
- # works around shells that cannot unset nonexistent variables.
-+ # Preserve -v and -x to the replacement shell.
- BASH_ENV=/dev/null
- ENV=/dev/null
- (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
- export CONFIG_SHELL
-- exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
-+ case $- in # ((((
-+ *v*x* | *x*v* ) as_opts=-vx ;;
-+ *v* ) as_opts=-v ;;
-+ *x* ) as_opts=-x ;;
-+ * ) as_opts= ;;
-+ esac
-+ exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
- fi
-
- if test x$as_have_required = xno; then :
-@@ -611,6 +619,8 @@ TRUE
+--- ./configure.autotool-intermediates 2013-04-09 11:24:01.024185796 +0200
++++ ./configure 2013-04-09 11:24:01.780183954 +0200
+@@ -639,6 +639,8 @@ TRUE
MACHDEP_OBJS
DYNLOADFILE
DLINCLDIR
@@ -47,16 +10,16 @@ diff -up ./configure.autotool-intermediates ./configure
THREADOBJ
LDLAST
USE_THREAD_MODULE
-@@ -631,6 +641,8 @@ OTHER_LIBTOOL_OPT
+@@ -659,6 +661,8 @@ OTHER_LIBTOOL_OPT
UNIVERSAL_ARCH_FLAGS
BASECFLAGS
OPT
+DEBUG_SUFFIX
+DEBUG_EXT
LN
+ MKDIR_P
INSTALL_DATA
- INSTALL_SCRIPT
-@@ -752,8 +764,11 @@ with_pth
+@@ -795,8 +799,11 @@ with_pth
enable_ipv6
with_doc_strings
with_tsc
@@ -68,16 +31,7 @@ diff -up ./configure.autotool-intermediates ./configure
with_wctype_functions
with_fpectl
with_libm
-@@ -1174,7 +1189,7 @@ Try \`$0 --help' for more information"
- $as_echo "$as_me: WARNING: you should use --build, --host, --target"
>&2
- expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null
&&
- $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-- : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
-+ : "${build_alias=$ac_option} ${host_alias=$ac_option}
${target_alias=$ac_option}"
- ;;
-
- esac
-@@ -1427,8 +1442,11 @@ Optional Packages:
+@@ -1472,8 +1479,11 @@ Optional Packages:
--with-pth use GNU pth threading libraries
--with(out)-doc-strings disable/enable documentation strings
--with(out)-tsc enable/disable timestamp counter profile
@@ -89,461 +43,7 @@ diff -up ./configure.autotool-intermediates ./configure
--with-wctype-functions use wctype.h functions
--with-fpectl enable SIGFPE catching
--with-libm=STRING math library
-@@ -1511,7 +1529,7 @@ test -n "$ac_init_help" && exit $ac_stat
- if $ac_init_version; then
- cat <<\_ACEOF
- python configure 2.7
--generated by GNU Autoconf 2.67
-+generated by GNU Autoconf 2.68
-
- Copyright (C) 2010 Free Software Foundation, Inc.
- This configure script is free software; the Free Software Foundation
-@@ -1557,7 +1575,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
- fi
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
- } # ac_fn_c_try_compile
-@@ -1594,7 +1612,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
- fi
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
- } # ac_fn_c_try_cpp
-@@ -1607,10 +1625,10 @@ fi
- ac_fn_c_check_header_mongrel ()
- {
- as_lineno=${as_lineno-"$1"}
as_lineno_stack=as_lineno_stack=$as_lineno_stack
-- if eval "test \"\${$3+set}\"" = set; then :
-+ if eval \${$3+:} false; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
- $as_echo_n "checking for $2... " >&6; }
--if eval "test \"\${$3+set}\"" = set; then :
-+if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
- fi
- eval ac_res=\$$3
-@@ -1677,7 +1695,7 @@ $as_echo "$as_me: WARNING: $2: proceedin
- esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
- $as_echo_n "checking for $2... " >&6; }
--if eval "test \"\${$3+set}\"" = set; then :
-+if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- eval "$3=\$ac_header_compiler"
-@@ -1686,7 +1704,7 @@ eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
- $as_echo "$ac_res" >&6; }
- fi
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
- } # ac_fn_c_check_header_mongrel
-
-@@ -1727,7 +1745,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
- ac_retval=$ac_status
- fi
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
- } # ac_fn_c_try_run
-@@ -1741,7 +1759,7 @@ ac_fn_c_check_header_compile ()
- as_lineno=${as_lineno-"$1"}
as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
- $as_echo_n "checking for $2... " >&6; }
--if eval "test \"\${$3+set}\"" = set; then :
-+if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -1759,7 +1777,7 @@ fi
- eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
- $as_echo "$ac_res" >&6; }
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
- } # ac_fn_c_check_header_compile
-
-@@ -1804,7 +1822,7 @@ fi
- # interfere with the next link command; also delete a directory that is
- # left behind by Apple's compiler. We do this before executing the actions.
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
- } # ac_fn_c_try_link
-@@ -1818,7 +1836,7 @@ ac_fn_c_check_type ()
- as_lineno=${as_lineno-"$1"}
as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
- $as_echo_n "checking for $2... " >&6; }
--if eval "test \"\${$3+set}\"" = set; then :
-+if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- eval "$3=no"
-@@ -1859,7 +1877,7 @@ fi
- eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
- $as_echo "$ac_res" >&6; }
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
- } # ac_fn_c_check_type
-
-@@ -1872,7 +1890,7 @@ ac_fn_c_find_uintX_t ()
- as_lineno=${as_lineno-"$1"}
as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5
- $as_echo_n "checking for uint$2_t... " >&6; }
--if eval "test \"\${$3+set}\"" = set; then :
-+if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- eval "$3=no"
-@@ -1912,7 +1930,7 @@ fi
- eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
- $as_echo "$ac_res" >&6; }
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
- } # ac_fn_c_find_uintX_t
-
-@@ -1925,7 +1943,7 @@ ac_fn_c_find_intX_t ()
- as_lineno=${as_lineno-"$1"}
as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5
- $as_echo_n "checking for int$2_t... " >&6; }
--if eval "test \"\${$3+set}\"" = set; then :
-+if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- eval "$3=no"
-@@ -1986,7 +2004,7 @@ fi
- eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
- $as_echo "$ac_res" >&6; }
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
- } # ac_fn_c_find_intX_t
-
-@@ -2163,7 +2181,7 @@ rm -f core *.core core.conftest.* gmon.o
- rm -f conftest.val
-
- fi
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
- } # ac_fn_c_compute_int
-@@ -2176,7 +2194,7 @@ ac_fn_c_check_func ()
- as_lineno=${as_lineno-"$1"}
as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
- $as_echo_n "checking for $2... " >&6; }
--if eval "test \"\${$3+set}\"" = set; then :
-+if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -2231,7 +2249,7 @@ fi
- eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
- $as_echo "$ac_res" >&6; }
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
- } # ac_fn_c_check_func
-
-@@ -2244,7 +2262,7 @@ ac_fn_c_check_member ()
- as_lineno=${as_lineno-"$1"}
as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
- $as_echo_n "checking for $2.$3... " >&6; }
--if eval "test \"\${$4+set}\"" = set; then :
-+if eval \${$4+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -2288,7 +2306,7 @@ fi
- eval ac_res=\$$4
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
- $as_echo "$ac_res" >&6; }
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
- } # ac_fn_c_check_member
-
-@@ -2303,7 +2321,7 @@ ac_fn_c_check_decl ()
- as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/)
0& (/g'`
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is
declared" >&5
- $as_echo_n "checking whether $as_decl_name is declared... " >&6; }
--if eval "test \"\${$3+set}\"" = set; then :
-+if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -2334,7 +2352,7 @@ fi
- eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
- $as_echo "$ac_res" >&6; }
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
- } # ac_fn_c_check_decl
- cat >config.log <<_ACEOF
-@@ -2342,7 +2360,7 @@ This file contains any messages produced
- running configure, to aid debugging if configure makes a mistake.
-
- It was created by python $as_me 2.7, which was
--generated by GNU Autoconf 2.67. Invocation command line was
-+generated by GNU Autoconf 2.68. Invocation command line was
-
- $ $0 $@
-
-@@ -2600,7 +2618,7 @@ $as_echo "$as_me: loading site script $a
- || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error $? "failed to load site script $ac_site_file
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- fi
- done
-
-@@ -3241,7 +3259,7 @@ if test -n "$ac_tool_prefix"; then
- set dummy ${ac_tool_prefix}gcc; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_CC+set}" = set; then :
-+if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$CC"; then
-@@ -3281,7 +3299,7 @@ if test -z "$ac_cv_prog_CC"; then
- set dummy gcc; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
-+if ${ac_cv_prog_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$ac_ct_CC"; then
-@@ -3334,7 +3352,7 @@ if test -z "$CC"; then
- set dummy ${ac_tool_prefix}cc; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_CC+set}" = set; then :
-+if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$CC"; then
-@@ -3374,7 +3392,7 @@ if test -z "$CC"; then
- set dummy cc; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_CC+set}" = set; then :
-+if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$CC"; then
-@@ -3433,7 +3451,7 @@ if test -z "$CC"; then
- set dummy $ac_tool_prefix$ac_prog; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_CC+set}" = set; then :
-+if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$CC"; then
-@@ -3477,7 +3495,7 @@ do
- set dummy $ac_prog; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
-+if ${ac_cv_prog_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$ac_ct_CC"; then
-@@ -3532,7 +3550,7 @@ fi
- test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}:
error: in \`$ac_pwd':" >&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error $? "no acceptable C compiler found in \$PATH
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
-
- # Provide some information about the compiler.
- $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version"
>&5
-@@ -3647,7 +3665,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "C compiler cannot create executables
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
- $as_echo "yes" >&6; }
-@@ -3690,7 +3708,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error $? "cannot compute suffix of executables: cannot compile and link
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- fi
- rm -f conftest conftest$ac_cv_exeext
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
-@@ -3749,7 +3767,7 @@ $as_echo "$ac_try_echo"; } >&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error $? "cannot run C compiled programs.
- If you meant to cross compile, use \`--host'.
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- fi
- fi
- fi
-@@ -3760,7 +3778,7 @@ rm -f conftest.$ac_ext conftest$ac_cv_ex
- ac_clean_files=$ac_clean_files_save
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files"
>&5
- $as_echo_n "checking for suffix of object files... " >&6; }
--if test "${ac_cv_objext+set}" = set; then :
-+if ${ac_cv_objext+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -3801,7 +3819,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error $? "cannot compute suffix of object files: cannot compile
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- fi
- rm -f conftest.$ac_cv_objext conftest.$ac_ext
- fi
-@@ -3811,7 +3829,7 @@ OBJEXT=$ac_cv_objext
- ac_objext=$OBJEXT
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C
compiler" >&5
- $as_echo_n "checking whether we are using the GNU C compiler... " >&6;
}
--if test "${ac_cv_c_compiler_gnu+set}" = set; then :
-+if ${ac_cv_c_compiler_gnu+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -3848,7 +3866,7 @@ ac_test_CFLAGS=${CFLAGS+set}
- ac_save_CFLAGS=$CFLAGS
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g"
>&5
- $as_echo_n "checking whether $CC accepts -g... " >&6; }
--if test "${ac_cv_prog_cc_g+set}" = set; then :
-+if ${ac_cv_prog_cc_g+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_save_c_werror_flag=$ac_c_werror_flag
-@@ -3926,7 +3944,7 @@ else
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO
C89" >&5
- $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
--if test "${ac_cv_prog_cc_c89+set}" = set; then :
-+if ${ac_cv_prog_cc_c89+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_cv_prog_cc_c89=no
-@@ -4065,7 +4083,7 @@ then
- set dummy g++; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_path_CXX+set}" = set; then :
-+if ${ac_cv_path_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- case $CXX in
-@@ -4106,7 +4124,7 @@ fi
- set dummy c++; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_path_CXX+set}" = set; then :
-+if ${ac_cv_path_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- case $CXX in
-@@ -4157,7 +4175,7 @@ do
- set dummy $ac_prog; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_CXX+set}" = set; then :
-+if ${ac_cv_prog_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$CXX"; then
-@@ -4228,7 +4246,7 @@ if test -n "$CPP" && test -d "$CPP";
the
- CPP=
- fi
- if test -z "$CPP"; then
-- if test "${ac_cv_prog_CPP+set}" = set; then :
-+ if ${ac_cv_prog_CPP+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- # Double quotes because CPP needs to be expanded
-@@ -4344,7 +4362,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- fi
-
- ac_ext=c
-@@ -4356,7 +4374,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines
and -e" >&5
- $as_echo_n "checking for grep that handles long lines and -e... " >&6;
}
--if test "${ac_cv_path_GREP+set}" = set; then :
-+if ${ac_cv_path_GREP+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -z "$GREP"; then
-@@ -4419,7 +4437,7 @@ $as_echo "$ac_cv_path_GREP" >&6; }
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
- $as_echo_n "checking for egrep... " >&6; }
--if test "${ac_cv_path_EGREP+set}" = set; then :
-+if ${ac_cv_path_EGREP+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
-@@ -4486,7 +4504,7 @@ $as_echo "$ac_cv_path_EGREP" >&6; }
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files"
>&5
- $as_echo_n "checking for ANSI C header files... " >&6; }
--if test "${ac_cv_header_stdc+set}" = set; then :
-+if ${ac_cv_header_stdc+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -4615,7 +4633,7 @@ done
-
-
- ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h"
"ac_cv_header_minix_config_h" "$ac_includes_default"
--if test "x$ac_cv_header_minix_config_h" = x""yes; then :
-+if test "x$ac_cv_header_minix_config_h" = xyes; then :
- MINIX=yes
- else
- MINIX=
-@@ -4637,7 +4655,7 @@ $as_echo "#define _MINIX 1" >>confdefs.h
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define
__EXTENSIONS__" >&5
- $as_echo_n "checking whether it is safe to define __EXTENSIONS__... "
>&6; }
--if test "${ac_cv_safe_to_define___extensions__+set}" = set; then :
-+if ${ac_cv_safe_to_define___extensions__+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -4747,7 +4765,7 @@ esac
+@@ -5171,7 +5181,7 @@ esac
$as_echo_n "checking LIBRARY... " >&6; }
if test -z "$LIBRARY"
then
@@ -552,7 +52,7 @@ diff -up ./configure.autotool-intermediates ./configure
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBRARY" >&5
$as_echo "$LIBRARY" >&6; }
-@@ -4921,8 +4939,8 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>
+@@ -5343,8 +5353,8 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>
INSTSONAME="$LDLIBRARY".$SOVERSION
;;
Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*)
@@ -563,7 +63,7 @@ diff -up ./configure.autotool-intermediates ./configure
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
case $ac_sys_system in
FreeBSD*)
-@@ -4945,7 +4963,7 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>
+@@ -5367,7 +5377,7 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>
;;
OSF*)
LDLIBRARY='libpython$(VERSION).so'
@@ -572,61 +72,7 @@ diff -up ./configure.autotool-intermediates ./configure
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
;;
atheos*)
-@@ -4981,7 +4999,7 @@ if test -n "$ac_tool_prefix"; then
- set dummy ${ac_tool_prefix}ranlib; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_RANLIB+set}" = set; then :
-+if ${ac_cv_prog_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$RANLIB"; then
-@@ -5021,7 +5039,7 @@ if test -z "$ac_cv_prog_RANLIB"; then
- set dummy ranlib; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then :
-+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$ac_ct_RANLIB"; then
-@@ -5075,7 +5093,7 @@ do
- set dummy $ac_prog; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_AR+set}" = set; then :
-+if ${ac_cv_prog_AR+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$AR"; then
-@@ -5125,7 +5143,7 @@ fi
- set dummy svnversion; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_SVNVERSION+set}" = set; then :
-+if ${ac_cv_prog_SVNVERSION+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$SVNVERSION"; then
-@@ -5173,7 +5191,7 @@ fi
- set dummy hg; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_HAS_HG+set}" = set; then :
-+if ${ac_cv_prog_HAS_HG+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$HAS_HG"; then
-@@ -5272,7 +5290,7 @@ ac_configure="$SHELL $ac_aux_dir/configu
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible
install" >&5
- $as_echo_n "checking for a BSD-compatible install... " >&6; }
- if test -z "$INSTALL"; then
--if test "${ac_cv_path_install+set}" = set; then :
-+if ${ac_cv_path_install+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-@@ -5384,6 +5402,14 @@ $as_echo "no" >&6; }
+@@ -5894,6 +5904,14 @@ $as_echo "no" >&6; }
fi
@@ -641,34 +87,7 @@ diff -up ./configure.autotool-intermediates ./configure
# XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
# merged with this chunk of code?
-@@ -5460,7 +5486,7 @@ yes)
- $as_echo_n "checking whether $CC accepts -fno-strict-aliasing... " >&6;
}
- ac_save_cc="$CC"
- CC="$CC -fno-strict-aliasing"
-- if test "${ac_cv_no_strict_aliasing_ok+set}" = set; then :
-+ if ${ac_cv_no_strict_aliasing_ok+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -5650,7 +5676,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts
-OPT:Olimit=0" >&5
- $as_echo_n "checking whether $CC accepts -OPT:Olimit=0... " >&6; }
--if test "${ac_cv_opt_olimit_ok+set}" = set; then :
-+if ${ac_cv_opt_olimit_ok+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_save_cc="$CC"
-@@ -5692,7 +5718,7 @@ if test $ac_cv_opt_olimit_ok = yes; then
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Olimit
1500" >&5
- $as_echo_n "checking whether $CC accepts -Olimit 1500... " >&6; }
-- if test "${ac_cv_olimit_ok+set}" = set; then :
-+ if ${ac_cv_olimit_ok+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_save_cc="$CC"
-@@ -5731,7 +5757,7 @@ then
+@@ -6253,7 +6271,7 @@ then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc supports ParseTuple
__format__" >&5
$as_echo_n "checking whether gcc supports ParseTuple __format__... "
>&6; }
save_CFLAGS=$CFLAGS
@@ -677,821 +96,7 @@ diff -up ./configure.autotool-intermediates ./configure
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-@@ -5770,7 +5796,7 @@ fi
- # options before we can check whether -Kpthread improves anything.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads are available
without options" >&5
- $as_echo_n "checking whether pthreads are available without options... "
>&6; }
--if test "${ac_cv_pthread_is_default+set}" = set; then :
-+if ${ac_cv_pthread_is_default+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test "$cross_compiling" = yes; then :
-@@ -5823,7 +5849,7 @@ else
- # function available.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts
-Kpthread" >&5
- $as_echo_n "checking whether $CC accepts -Kpthread... " >&6; }
--if test "${ac_cv_kpthread+set}" = set; then :
-+if ${ac_cv_kpthread+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_save_cc="$CC"
-@@ -5872,7 +5898,7 @@ then
- # function available.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts
-Kthread" >&5
- $as_echo_n "checking whether $CC accepts -Kthread... " >&6; }
--if test "${ac_cv_kthread+set}" = set; then :
-+if ${ac_cv_kthread+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_save_cc="$CC"
-@@ -5921,7 +5947,7 @@ then
- # function available.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts
-pthread" >&5
- $as_echo_n "checking whether $CC accepts -pthread... " >&6; }
--if test "${ac_cv_thread+set}" = set; then :
-+if ${ac_cv_thread+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_save_cc="$CC"
-@@ -6006,7 +6032,7 @@ CXX="$ac_save_cxx"
- # checks for header files
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files"
>&5
- $as_echo_n "checking for ANSI C header files... " >&6; }
--if test "${ac_cv_header_stdc+set}" = set; then :
-+if ${ac_cv_header_stdc+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -6145,7 +6171,7 @@ for ac_hdr in dirent.h sys/ndir.h sys/di
- as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines
DIR" >&5
- $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; }
--if eval "test \"\${$as_ac_Header+set}\"" = set; then :
-+if eval \${$as_ac_Header+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -6185,7 +6211,7 @@ done
- if test $ac_header_dirent = dirent.h; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing
opendir" >&5
- $as_echo_n "checking for library containing opendir... " >&6; }
--if test "${ac_cv_search_opendir+set}" = set; then :
-+if ${ac_cv_search_opendir+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_func_search_save_LIBS=$LIBS
-@@ -6219,11 +6245,11 @@ for ac_lib in '' dir; do
- fi
- rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
-- if test "${ac_cv_search_opendir+set}" = set; then :
-+ if ${ac_cv_search_opendir+:} false; then :
- break
- fi
- done
--if test "${ac_cv_search_opendir+set}" = set; then :
-+if ${ac_cv_search_opendir+:} false; then :
-
- else
- ac_cv_search_opendir=no
-@@ -6242,7 +6268,7 @@ fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing
opendir" >&5
- $as_echo_n "checking for library containing opendir... " >&6; }
--if test "${ac_cv_search_opendir+set}" = set; then :
-+if ${ac_cv_search_opendir+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_func_search_save_LIBS=$LIBS
-@@ -6276,11 +6302,11 @@ for ac_lib in '' x; do
- fi
- rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
-- if test "${ac_cv_search_opendir+set}" = set; then :
-+ if ${ac_cv_search_opendir+:} false; then :
- break
- fi
- done
--if test "${ac_cv_search_opendir+set}" = set; then :
-+if ${ac_cv_search_opendir+:} false; then :
-
- else
- ac_cv_search_opendir=no
-@@ -6300,7 +6326,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sys/types.h defines
makedev" >&5
- $as_echo_n "checking whether sys/types.h defines makedev... " >&6; }
--if test "${ac_cv_header_sys_types_h_makedev+set}" = set; then :
-+if ${ac_cv_header_sys_types_h_makedev+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -6328,7 +6354,7 @@ $as_echo "$ac_cv_header_sys_types_h_make
-
- if test $ac_cv_header_sys_types_h_makedev = no; then
- ac_fn_c_check_header_mongrel "$LINENO" "sys/mkdev.h"
"ac_cv_header_sys_mkdev_h" "$ac_includes_default"
--if test "x$ac_cv_header_sys_mkdev_h" = x""yes; then :
-+if test "x$ac_cv_header_sys_mkdev_h" = xyes; then :
-
- $as_echo "#define MAJOR_IN_MKDEV 1" >>confdefs.h
-
-@@ -6338,7 +6364,7 @@ fi
-
- if test $ac_cv_header_sys_mkdev_h = no; then
- ac_fn_c_check_header_mongrel "$LINENO" "sys/sysmacros.h"
"ac_cv_header_sys_sysmacros_h" "$ac_includes_default"
--if test "x$ac_cv_header_sys_sysmacros_h" = x""yes; then :
-+if test "x$ac_cv_header_sys_sysmacros_h" = xyes; then :
-
- $as_echo "#define MAJOR_IN_SYSMACROS 1" >>confdefs.h
-
-@@ -6358,7 +6384,7 @@ do :
- #endif
-
- "
--if test "x$ac_cv_header_term_h" = x""yes; then :
-+if test "x$ac_cv_header_term_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_TERM_H 1
- _ACEOF
-@@ -6380,7 +6406,7 @@ do :
- #endif
-
- "
--if test "x$ac_cv_header_linux_netlink_h" = x""yes; then :
-+if test "x$ac_cv_header_linux_netlink_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_LINUX_NETLINK_H 1
- _ACEOF
-@@ -6543,7 +6569,7 @@ EOF
-
- # Type availability checks
- ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t"
"$ac_includes_default"
--if test "x$ac_cv_type_mode_t" = x""yes; then :
-+if test "x$ac_cv_type_mode_t" = xyes; then :
-
- else
-
-@@ -6554,7 +6580,7 @@ _ACEOF
- fi
-
- ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t"
"$ac_includes_default"
--if test "x$ac_cv_type_off_t" = x""yes; then :
-+if test "x$ac_cv_type_off_t" = xyes; then :
-
- else
-
-@@ -6565,7 +6591,7 @@ _ACEOF
- fi
-
- ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t"
"$ac_includes_default"
--if test "x$ac_cv_type_pid_t" = x""yes; then :
-+if test "x$ac_cv_type_pid_t" = xyes; then :
-
- else
-
-@@ -6581,7 +6607,7 @@ cat >>confdefs.h <<_ACEOF
- _ACEOF
-
- ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t"
"$ac_includes_default"
--if test "x$ac_cv_type_size_t" = x""yes; then :
-+if test "x$ac_cv_type_size_t" = xyes; then :
-
- else
-
-@@ -6593,7 +6619,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h"
>&5
- $as_echo_n "checking for uid_t in sys/types.h... " >&6; }
--if test "${ac_cv_type_uid_t+set}" = set; then :
-+if ${ac_cv_type_uid_t+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -6672,7 +6698,7 @@ _ACEOF
- esac
-
- ac_fn_c_check_type "$LINENO" "ssize_t"
"ac_cv_type_ssize_t" "$ac_includes_default"
--if test "x$ac_cv_type_ssize_t" = x""yes; then :
-+if test "x$ac_cv_type_ssize_t" = xyes; then :
-
- $as_echo "#define HAVE_SSIZE_T 1" >>confdefs.h
-
-@@ -6687,7 +6713,7 @@ fi
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5
- $as_echo_n "checking size of int... " >&6; }
--if test "${ac_cv_sizeof_int+set}" = set; then :
-+if ${ac_cv_sizeof_int+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))"
"ac_cv_sizeof_int" "$ac_includes_default"; then :
-@@ -6697,7 +6723,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (int)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_int=0
- fi
-@@ -6720,7 +6746,7 @@ _ACEOF
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
- $as_echo_n "checking size of long... " >&6; }
--if test "${ac_cv_sizeof_long+set}" = set; then :
-+if ${ac_cv_sizeof_long+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))"
"ac_cv_sizeof_long" "$ac_includes_default"; then :
-@@ -6730,7 +6756,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (long)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_long=0
- fi
-@@ -6753,7 +6779,7 @@ _ACEOF
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5
- $as_echo_n "checking size of void *... " >&6; }
--if test "${ac_cv_sizeof_void_p+set}" = set; then :
-+if ${ac_cv_sizeof_void_p+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))"
"ac_cv_sizeof_void_p" "$ac_includes_default"; then :
-@@ -6763,7 +6789,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (void *)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_void_p=0
- fi
-@@ -6786,7 +6812,7 @@ _ACEOF
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5
- $as_echo_n "checking size of short... " >&6; }
--if test "${ac_cv_sizeof_short+set}" = set; then :
-+if ${ac_cv_sizeof_short+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))"
"ac_cv_sizeof_short" "$ac_includes_default"; then :
-@@ -6796,7 +6822,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (short)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_short=0
- fi
-@@ -6819,7 +6845,7 @@ _ACEOF
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of float" >&5
- $as_echo_n "checking size of float... " >&6; }
--if test "${ac_cv_sizeof_float+set}" = set; then :
-+if ${ac_cv_sizeof_float+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (float))"
"ac_cv_sizeof_float" "$ac_includes_default"; then :
-@@ -6829,7 +6855,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (float)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_float=0
- fi
-@@ -6852,7 +6878,7 @@ _ACEOF
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of double" >&5
- $as_echo_n "checking size of double... " >&6; }
--if test "${ac_cv_sizeof_double+set}" = set; then :
-+if ${ac_cv_sizeof_double+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (double))"
"ac_cv_sizeof_double" "$ac_includes_default"; then :
-@@ -6862,7 +6888,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (double)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_double=0
- fi
-@@ -6885,7 +6911,7 @@ _ACEOF
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of fpos_t" >&5
- $as_echo_n "checking size of fpos_t... " >&6; }
--if test "${ac_cv_sizeof_fpos_t+set}" = set; then :
-+if ${ac_cv_sizeof_fpos_t+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (fpos_t))"
"ac_cv_sizeof_fpos_t" "$ac_includes_default"; then :
-@@ -6895,7 +6921,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (fpos_t)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_fpos_t=0
- fi
-@@ -6918,7 +6944,7 @@ _ACEOF
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5
- $as_echo_n "checking size of size_t... " >&6; }
--if test "${ac_cv_sizeof_size_t+set}" = set; then :
-+if ${ac_cv_sizeof_size_t+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))"
"ac_cv_sizeof_size_t" "$ac_includes_default"; then :
-@@ -6928,7 +6954,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (size_t)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_size_t=0
- fi
-@@ -6951,7 +6977,7 @@ _ACEOF
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of pid_t" >&5
- $as_echo_n "checking size of pid_t... " >&6; }
--if test "${ac_cv_sizeof_pid_t+set}" = set; then :
-+if ${ac_cv_sizeof_pid_t+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pid_t))"
"ac_cv_sizeof_pid_t" "$ac_includes_default"; then :
-@@ -6961,7 +6987,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (pid_t)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_pid_t=0
- fi
-@@ -7011,7 +7037,7 @@ if test "$have_long_long" = yes ; then
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long"
>&5
- $as_echo_n "checking size of long long... " >&6; }
--if test "${ac_cv_sizeof_long_long+set}" = set; then :
-+if ${ac_cv_sizeof_long_long+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))"
"ac_cv_sizeof_long_long" "$ac_includes_default"; then :
-@@ -7021,7 +7047,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (long long)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_long_long=0
- fi
-@@ -7072,7 +7098,7 @@ if test "$have_long_double" = yes ; then
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long double"
>&5
- $as_echo_n "checking size of long double... " >&6; }
--if test "${ac_cv_sizeof_long_double+set}" = set; then :
-+if ${ac_cv_sizeof_long_double+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long
double))" "ac_cv_sizeof_long_double"
"$ac_includes_default"; then :
-@@ -7082,7 +7108,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (long double)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_long_double=0
- fi
-@@ -7133,7 +7159,7 @@ if test "$have_c99_bool" = yes ; then
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of _Bool" >&5
- $as_echo_n "checking size of _Bool... " >&6; }
--if test "${ac_cv_sizeof__Bool+set}" = set; then :
-+if ${ac_cv_sizeof__Bool+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (_Bool))"
"ac_cv_sizeof__Bool" "$ac_includes_default"; then :
-@@ -7143,7 +7169,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (_Bool)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof__Bool=0
- fi
-@@ -7169,7 +7195,7 @@ ac_fn_c_check_type "$LINENO" "uintptr_t"
- #include <inttypes.h>
- #endif
- "
--if test "x$ac_cv_type_uintptr_t" = x""yes; then :
-+if test "x$ac_cv_type_uintptr_t" = xyes; then :
-
- cat >>confdefs.h <<_ACEOF
- #define HAVE_UINTPTR_T 1
-@@ -7181,7 +7207,7 @@ _ACEOF
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of uintptr_t"
>&5
- $as_echo_n "checking size of uintptr_t... " >&6; }
--if test "${ac_cv_sizeof_uintptr_t+set}" = set; then :
-+if ${ac_cv_sizeof_uintptr_t+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (uintptr_t))"
"ac_cv_sizeof_uintptr_t" "$ac_includes_default"; then :
-@@ -7191,7 +7217,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (uintptr_t)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_uintptr_t=0
- fi
-@@ -7217,7 +7243,7 @@ fi
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5
- $as_echo_n "checking size of off_t... " >&6; }
--if test "${ac_cv_sizeof_off_t+set}" = set; then :
-+if ${ac_cv_sizeof_off_t+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))"
"ac_cv_sizeof_off_t" "
-@@ -7232,7 +7258,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (off_t)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_off_t=0
- fi
-@@ -7276,7 +7302,7 @@ fi
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of time_t" >&5
- $as_echo_n "checking size of time_t... " >&6; }
--if test "${ac_cv_sizeof_time_t+set}" = set; then :
-+if ${ac_cv_sizeof_time_t+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (time_t))"
"ac_cv_sizeof_time_t" "
-@@ -7294,7 +7320,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (time_t)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_time_t=0
- fi
-@@ -7350,7 +7376,7 @@ if test "$have_pthread_t" = yes ; then
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of pthread_t"
>&5
- $as_echo_n "checking size of pthread_t... " >&6; }
--if test "${ac_cv_sizeof_pthread_t+set}" = set; then :
-+if ${ac_cv_sizeof_pthread_t+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pthread_t))"
"ac_cv_sizeof_pthread_t" "
-@@ -7365,7 +7391,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (pthread_t)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_pthread_t=0
- fi
-@@ -7877,7 +7903,7 @@ $as_echo "$SHLIBS" >&6; }
- # checks for libraries
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl"
>&5
- $as_echo_n "checking for dlopen in -ldl... " >&6; }
--if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
-+if ${ac_cv_lib_dl_dlopen+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -7911,7 +7937,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen"
>&5
- $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
--if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
-+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_LIBDL 1
- _ACEOF
-@@ -7922,7 +7948,7 @@ fi
- # Dynamic linking for SunOS/Solaris and SYSV
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld"
>&5
- $as_echo_n "checking for shl_load in -ldld... " >&6; }
--if test "${ac_cv_lib_dld_shl_load+set}" = set; then :
-+if ${ac_cv_lib_dld_shl_load+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -7956,7 +7982,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load"
>&5
- $as_echo "$ac_cv_lib_dld_shl_load" >&6; }
--if test "x$ac_cv_lib_dld_shl_load" = x""yes; then :
-+if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_LIBDLD 1
- _ACEOF
-@@ -7970,7 +7996,7 @@ fi
- if test "$with_threads" = "yes" -o -z "$with_threads";
then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing
sem_init" >&5
- $as_echo_n "checking for library containing sem_init... " >&6; }
--if test "${ac_cv_search_sem_init+set}" = set; then :
-+if ${ac_cv_search_sem_init+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_func_search_save_LIBS=$LIBS
-@@ -8004,11 +8030,11 @@ for ac_lib in '' pthread rt posix4; do
- fi
- rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
-- if test "${ac_cv_search_sem_init+set}" = set; then :
-+ if ${ac_cv_search_sem_init+:} false; then :
- break
- fi
- done
--if test "${ac_cv_search_sem_init+set}" = set; then :
-+if ${ac_cv_search_sem_init+:} false; then :
-
- else
- ac_cv_search_sem_init=no
-@@ -8031,7 +8057,7 @@ fi
- # check if we need libintl for locale functions
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for textdomain in -lintl"
>&5
- $as_echo_n "checking for textdomain in -lintl... " >&6; }
--if test "${ac_cv_lib_intl_textdomain+set}" = set; then :
-+if ${ac_cv_lib_intl_textdomain+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -8065,7 +8091,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_textdomain"
>&5
- $as_echo "$ac_cv_lib_intl_textdomain" >&6; }
--if test "x$ac_cv_lib_intl_textdomain" = x""yes; then :
-+if test "x$ac_cv_lib_intl_textdomain" = xyes; then :
-
- $as_echo "#define WITH_LIBINTL 1" >>confdefs.h
-
-@@ -8112,7 +8138,7 @@ esac
- # BeOS' sockets are stashed in libnet.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for t_open in -lnsl"
>&5
- $as_echo_n "checking for t_open in -lnsl... " >&6; }
--if test "${ac_cv_lib_nsl_t_open+set}" = set; then :
-+if ${ac_cv_lib_nsl_t_open+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -8146,13 +8172,13 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_t_open"
>&5
- $as_echo "$ac_cv_lib_nsl_t_open" >&6; }
--if test "x$ac_cv_lib_nsl_t_open" = x""yes; then :
-+if test "x$ac_cv_lib_nsl_t_open" = xyes; then :
- LIBS="-lnsl $LIBS"
- fi
- # SVR4
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket"
>&5
- $as_echo_n "checking for socket in -lsocket... " >&6; }
--if test "${ac_cv_lib_socket_socket+set}" = set; then :
-+if ${ac_cv_lib_socket_socket+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -8186,7 +8212,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket"
>&5
- $as_echo "$ac_cv_lib_socket_socket" >&6; }
--if test "x$ac_cv_lib_socket_socket" = x""yes; then :
-+if test "x$ac_cv_lib_socket_socket" = xyes; then :
- LIBS="-lsocket $LIBS"
- fi
- # SVR4 sockets
-@@ -8195,7 +8221,7 @@ case "$ac_sys_system" in
- BeOS*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lnet"
>&5
- $as_echo_n "checking for socket in -lnet... " >&6; }
--if test "${ac_cv_lib_net_socket+set}" = set; then :
-+if ${ac_cv_lib_net_socket+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -8229,7 +8255,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_net_socket"
>&5
- $as_echo "$ac_cv_lib_net_socket" >&6; }
--if test "x$ac_cv_lib_net_socket" = x""yes; then :
-+if test "x$ac_cv_lib_net_socket" = xyes; then :
- LIBS="-lnet $LIBS"
- fi
- # BeOS
-@@ -8257,7 +8283,7 @@ if test -n "$ac_tool_prefix"; then
- set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
-+if ${ac_cv_path_PKG_CONFIG+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- case $PKG_CONFIG in
-@@ -8300,7 +8326,7 @@ if test -z "$ac_cv_path_PKG_CONFIG"; the
- set dummy pkg-config; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
-+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- case $ac_pt_PKG_CONFIG in
-@@ -8568,7 +8594,7 @@ $as_echo "$unistd_defines_pthreads" >&6;
- $as_echo "#define _REENTRANT 1" >>confdefs.h
-
- ac_fn_c_check_header_mongrel "$LINENO" "cthreads.h"
"ac_cv_header_cthreads_h" "$ac_includes_default"
--if test "x$ac_cv_header_cthreads_h" = x""yes; then :
-+if test "x$ac_cv_header_cthreads_h" = xyes; then :
- $as_echo "#define WITH_THREAD 1" >>confdefs.h
-
- $as_echo "#define C_THREADS 1" >>confdefs.h
-@@ -8581,7 +8607,7 @@ $as_echo "#define HURD_C_THREADS 1" >>co
- else
-
- ac_fn_c_check_header_mongrel "$LINENO" "mach/cthreads.h"
"ac_cv_header_mach_cthreads_h" "$ac_includes_default"
--if test "x$ac_cv_header_mach_cthreads_h" = x""yes; then :
-+if test "x$ac_cv_header_mach_cthreads_h" = xyes; then :
- $as_echo "#define WITH_THREAD 1" >>confdefs.h
-
- $as_echo "#define C_THREADS 1" >>confdefs.h
-@@ -8643,7 +8669,7 @@ else
-
- LIBS=$_libs
- ac_fn_c_check_func "$LINENO" "pthread_detach"
"ac_cv_func_pthread_detach"
--if test "x$ac_cv_func_pthread_detach" = x""yes; then :
-+if test "x$ac_cv_func_pthread_detach" = xyes; then :
- $as_echo "#define WITH_THREAD 1" >>confdefs.h
-
- posix_threads=yes
-@@ -8651,7 +8677,7 @@ if test "x$ac_cv_func_pthread_detach" =
- else
-
- ac_fn_c_check_header_mongrel "$LINENO" "atheos/threads.h"
"ac_cv_header_atheos_threads_h" "$ac_includes_default"
--if test "x$ac_cv_header_atheos_threads_h" = x""yes; then :
-+if test "x$ac_cv_header_atheos_threads_h" = xyes; then :
- $as_echo "#define WITH_THREAD 1" >>confdefs.h
-
-
-@@ -8661,7 +8687,7 @@ $as_echo "#define ATHEOS_THREADS 1" >>co
- else
-
- ac_fn_c_check_header_mongrel "$LINENO" "kernel/OS.h"
"ac_cv_header_kernel_OS_h" "$ac_includes_default"
--if test "x$ac_cv_header_kernel_OS_h" = x""yes; then :
-+if test "x$ac_cv_header_kernel_OS_h" = xyes; then :
- $as_echo "#define WITH_THREAD 1" >>confdefs.h
-
-
-@@ -8672,7 +8698,7 @@ else
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in
-lpthreads" >&5
- $as_echo_n "checking for pthread_create in -lpthreads... " >&6; }
--if test "${ac_cv_lib_pthreads_pthread_create+set}" = set; then :
-+if ${ac_cv_lib_pthreads_pthread_create+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -8706,7 +8732,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_pthreads_pthread_create" >&5
- $as_echo "$ac_cv_lib_pthreads_pthread_create" >&6; }
--if test "x$ac_cv_lib_pthreads_pthread_create" = x""yes; then :
-+if test "x$ac_cv_lib_pthreads_pthread_create" = xyes; then :
- $as_echo "#define WITH_THREAD 1" >>confdefs.h
-
- posix_threads=yes
-@@ -8716,7 +8742,7 @@ else
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in
-lc_r" >&5
- $as_echo_n "checking for pthread_create in -lc_r... " >&6; }
--if test "${ac_cv_lib_c_r_pthread_create+set}" = set; then :
-+if ${ac_cv_lib_c_r_pthread_create+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -8750,7 +8776,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_c_r_pthread_create" >&5
- $as_echo "$ac_cv_lib_c_r_pthread_create" >&6; }
--if test "x$ac_cv_lib_c_r_pthread_create" = x""yes; then :
-+if test "x$ac_cv_lib_c_r_pthread_create" = xyes; then :
- $as_echo "#define WITH_THREAD 1" >>confdefs.h
-
- posix_threads=yes
-@@ -8760,7 +8786,7 @@ else
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __pthread_create_system
in -lpthread" >&5
- $as_echo_n "checking for __pthread_create_system in -lpthread... " >&6;
}
--if test "${ac_cv_lib_pthread___pthread_create_system+set}" = set; then :
-+if ${ac_cv_lib_pthread___pthread_create_system+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -8794,7 +8820,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_pthread___pthread_create_system" >&5
- $as_echo "$ac_cv_lib_pthread___pthread_create_system" >&6; }
--if test "x$ac_cv_lib_pthread___pthread_create_system" = x""yes; then
:
-+if test "x$ac_cv_lib_pthread___pthread_create_system" = xyes; then :
- $as_echo "#define WITH_THREAD 1" >>confdefs.h
-
- posix_threads=yes
-@@ -8804,7 +8830,7 @@ else
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in
-lcma" >&5
- $as_echo_n "checking for pthread_create in -lcma... " >&6; }
--if test "${ac_cv_lib_cma_pthread_create+set}" = set; then :
-+if ${ac_cv_lib_cma_pthread_create+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -8838,7 +8864,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_cma_pthread_create" >&5
- $as_echo "$ac_cv_lib_cma_pthread_create" >&6; }
--if test "x$ac_cv_lib_cma_pthread_create" = x""yes; then :
-+if test "x$ac_cv_lib_cma_pthread_create" = xyes; then :
- $as_echo "#define WITH_THREAD 1" >>confdefs.h
-
- posix_threads=yes
-@@ -8878,7 +8904,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for usconfig in -lmpc"
>&5
- $as_echo_n "checking for usconfig in -lmpc... " >&6; }
--if test "${ac_cv_lib_mpc_usconfig+set}" = set; then :
-+if ${ac_cv_lib_mpc_usconfig+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -8912,7 +8938,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mpc_usconfig"
>&5
- $as_echo "$ac_cv_lib_mpc_usconfig" >&6; }
--if test "x$ac_cv_lib_mpc_usconfig" = x""yes; then :
-+if test "x$ac_cv_lib_mpc_usconfig" = xyes; then :
- $as_echo "#define WITH_THREAD 1" >>confdefs.h
-
- LIBS="$LIBS -lmpc"
-@@ -8924,7 +8950,7 @@ fi
- if test "$posix_threads" != "yes"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thr_create in
-lthread" >&5
- $as_echo_n "checking for thr_create in -lthread... " >&6; }
--if test "${ac_cv_lib_thread_thr_create+set}" = set; then :
-+if ${ac_cv_lib_thread_thr_create+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -8958,7 +8984,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_thread_thr_create"
>&5
- $as_echo "$ac_cv_lib_thread_thr_create" >&6; }
--if test "x$ac_cv_lib_thread_thr_create" = x""yes; then :
-+if test "x$ac_cv_lib_thread_thr_create" = xyes; then :
- $as_echo "#define WITH_THREAD 1" >>confdefs.h
-
- LIBS="$LIBS -lthread"
-@@ -9003,7 +9029,7 @@ $as_echo "#define HAVE_BROKEN_POSIX_SEMA
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if PTHREAD_SCOPE_SYSTEM is
supported" >&5
- $as_echo_n "checking if PTHREAD_SCOPE_SYSTEM is supported... " >&6; }
-- if test "${ac_cv_pthread_system_supported+set}" = set; then :
-+ if ${ac_cv_pthread_system_supported+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test "$cross_compiling" = yes; then :
-@@ -9046,7 +9072,7 @@ $as_echo "#define PTHREAD_SYSTEM_SCHED_S
- for ac_func in pthread_sigmask
- do :
- ac_fn_c_check_func "$LINENO" "pthread_sigmask"
"ac_cv_func_pthread_sigmask"
--if test "x$ac_cv_func_pthread_sigmask" = x""yes; then :
-+if test "x$ac_cv_func_pthread_sigmask" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_PTHREAD_SIGMASK 1
- _ACEOF
-@@ -9399,6 +9425,50 @@ $as_echo "no" >&6; }
+@@ -9958,6 +9976,50 @@ $as_echo "no" >&6; }
fi
@@ -1542,16 +147,7 @@ diff -up ./configure.autotool-intermediates ./configure
# Check for Python-specific malloc support
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-pymalloc"
>&5
$as_echo_n "checking for --with-pymalloc... " >&6; }
-@@ -9436,7 +9506,7 @@ fi
- $as_echo "$with_valgrind" >&6; }
- if test "$with_valgrind" != no; then
- ac_fn_c_check_header_mongrel "$LINENO" "valgrind/valgrind.h"
"ac_cv_header_valgrind_valgrind_h" "$ac_includes_default"
--if test "x$ac_cv_header_valgrind_valgrind_h" = x""yes; then :
-+if test "x$ac_cv_header_valgrind_valgrind_h" = xyes; then :
-
- $as_echo "#define WITH_VALGRIND 1" >>confdefs.h
-
-@@ -9448,6 +9518,46 @@ fi
+@@ -10007,6 +10069,46 @@ fi
fi
@@ -1598,1109 +194,9 @@ diff -up ./configure.autotool-intermediates ./configure
# Check for --with-wctype-functions
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-wctype-functions"
>&5
$as_echo_n "checking for --with-wctype-functions... " >&6; }
-@@ -9480,7 +9590,7 @@ DLINCLDIR=.
- for ac_func in dlopen
- do :
- ac_fn_c_check_func "$LINENO" "dlopen"
"ac_cv_func_dlopen"
--if test "x$ac_cv_func_dlopen" = x""yes; then :
-+if test "x$ac_cv_func_dlopen" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_DLOPEN 1
- _ACEOF
-@@ -9810,7 +9920,7 @@ rm -f core conftest.err conftest.$ac_obj
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flock declaration"
>&5
- $as_echo_n "checking for flock declaration... " >&6; }
--if test "${ac_cv_flock_decl+set}" = set; then :
-+if ${ac_cv_flock_decl+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -9840,7 +9950,7 @@ if test "x${ac_cv_flock_decl}" = xyes; t
- for ac_func in flock
- do :
- ac_fn_c_check_func "$LINENO" "flock" "ac_cv_func_flock"
--if test "x$ac_cv_func_flock" = x""yes; then :
-+if test "x$ac_cv_func_flock" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_FLOCK 1
- _ACEOF
-@@ -9848,7 +9958,7 @@ _ACEOF
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flock in -lbsd"
>&5
- $as_echo_n "checking for flock in -lbsd... " >&6; }
--if test "${ac_cv_lib_bsd_flock+set}" = set; then :
-+if ${ac_cv_lib_bsd_flock+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -9882,7 +9992,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_flock"
>&5
- $as_echo "$ac_cv_lib_bsd_flock" >&6; }
--if test "x$ac_cv_lib_bsd_flock" = x""yes; then :
-+if test "x$ac_cv_lib_bsd_flock" = xyes; then :
- $as_echo "#define HAVE_FLOCK 1" >>confdefs.h
-
-
-@@ -9959,7 +10069,7 @@ do
- set dummy $ac_prog; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_TRUE+set}" = set; then :
-+if ${ac_cv_prog_TRUE+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$TRUE"; then
-@@ -9999,7 +10109,7 @@ test -n "$TRUE" || TRUE="/bin/true"
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lc"
>&5
- $as_echo_n "checking for inet_aton in -lc... " >&6; }
--if test "${ac_cv_lib_c_inet_aton+set}" = set; then :
-+if ${ac_cv_lib_c_inet_aton+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -10033,12 +10143,12 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_inet_aton"
>&5
- $as_echo "$ac_cv_lib_c_inet_aton" >&6; }
--if test "x$ac_cv_lib_c_inet_aton" = x""yes; then :
-+if test "x$ac_cv_lib_c_inet_aton" = xyes; then :
- $ac_cv_prog_TRUE
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lresolv"
>&5
- $as_echo_n "checking for inet_aton in -lresolv... " >&6; }
--if test "${ac_cv_lib_resolv_inet_aton+set}" = set; then :
-+if ${ac_cv_lib_resolv_inet_aton+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -10072,7 +10182,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_inet_aton"
>&5
- $as_echo "$ac_cv_lib_resolv_inet_aton" >&6; }
--if test "x$ac_cv_lib_resolv_inet_aton" = x""yes; then :
-+if test "x$ac_cv_lib_resolv_inet_aton" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_LIBRESOLV 1
- _ACEOF
-@@ -10089,7 +10199,7 @@ fi
- # exit Python
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for chflags" >&5
- $as_echo_n "checking for chflags... " >&6; }
--if test "${ac_cv_have_chflags+set}" = set; then :
-+if ${ac_cv_have_chflags+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test "$cross_compiling" = yes; then :
-@@ -10123,7 +10233,7 @@ fi
- $as_echo "$ac_cv_have_chflags" >&6; }
- if test "$ac_cv_have_chflags" = cross ; then
- ac_fn_c_check_func "$LINENO" "chflags"
"ac_cv_func_chflags"
--if test "x$ac_cv_func_chflags" = x""yes; then :
-+if test "x$ac_cv_func_chflags" = xyes; then :
- ac_cv_have_chflags="yes"
- else
- ac_cv_have_chflags="no"
-@@ -10138,7 +10248,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lchflags" >&5
- $as_echo_n "checking for lchflags... " >&6; }
--if test "${ac_cv_have_lchflags+set}" = set; then :
-+if ${ac_cv_have_lchflags+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test "$cross_compiling" = yes; then :
-@@ -10172,7 +10282,7 @@ fi
- $as_echo "$ac_cv_have_lchflags" >&6; }
- if test "$ac_cv_have_lchflags" = cross ; then
- ac_fn_c_check_func "$LINENO" "lchflags"
"ac_cv_func_lchflags"
--if test "x$ac_cv_func_lchflags" = x""yes; then :
-+if test "x$ac_cv_func_lchflags" = xyes; then :
- ac_cv_have_lchflags="yes"
- else
- ac_cv_have_lchflags="no"
-@@ -10196,7 +10306,7 @@ esac
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateCopy in -lz"
>&5
- $as_echo_n "checking for inflateCopy in -lz... " >&6; }
--if test "${ac_cv_lib_z_inflateCopy+set}" = set; then :
-+if ${ac_cv_lib_z_inflateCopy+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -10230,7 +10340,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflateCopy"
>&5
- $as_echo "$ac_cv_lib_z_inflateCopy" >&6; }
--if test "x$ac_cv_lib_z_inflateCopy" = x""yes; then :
-+if test "x$ac_cv_lib_z_inflateCopy" = xyes; then :
-
- $as_echo "#define HAVE_ZLIB_COPY 1" >>confdefs.h
-
-@@ -10373,7 +10483,7 @@ rm -f core conftest.err conftest.$ac_obj
- for ac_func in openpty
- do :
- ac_fn_c_check_func "$LINENO" "openpty"
"ac_cv_func_openpty"
--if test "x$ac_cv_func_openpty" = x""yes; then :
-+if test "x$ac_cv_func_openpty" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_OPENPTY 1
- _ACEOF
-@@ -10381,7 +10491,7 @@ _ACEOF
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openpty in -lutil"
>&5
- $as_echo_n "checking for openpty in -lutil... " >&6; }
--if test "${ac_cv_lib_util_openpty+set}" = set; then :
-+if ${ac_cv_lib_util_openpty+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -10415,13 +10525,13 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_openpty"
>&5
- $as_echo "$ac_cv_lib_util_openpty" >&6; }
--if test "x$ac_cv_lib_util_openpty" = x""yes; then :
-+if test "x$ac_cv_lib_util_openpty" = xyes; then :
- $as_echo "#define HAVE_OPENPTY 1" >>confdefs.h
- LIBS="$LIBS -lutil"
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openpty in -lbsd"
>&5
- $as_echo_n "checking for openpty in -lbsd... " >&6; }
--if test "${ac_cv_lib_bsd_openpty+set}" = set; then :
-+if ${ac_cv_lib_bsd_openpty+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -10455,7 +10565,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_openpty"
>&5
- $as_echo "$ac_cv_lib_bsd_openpty" >&6; }
--if test "x$ac_cv_lib_bsd_openpty" = x""yes; then :
-+if test "x$ac_cv_lib_bsd_openpty" = xyes; then :
- $as_echo "#define HAVE_OPENPTY 1" >>confdefs.h
- LIBS="$LIBS -lbsd"
- fi
-@@ -10470,7 +10580,7 @@ done
- for ac_func in forkpty
- do :
- ac_fn_c_check_func "$LINENO" "forkpty"
"ac_cv_func_forkpty"
--if test "x$ac_cv_func_forkpty" = x""yes; then :
-+if test "x$ac_cv_func_forkpty" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_FORKPTY 1
- _ACEOF
-@@ -10478,7 +10588,7 @@ _ACEOF
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for forkpty in -lutil"
>&5
- $as_echo_n "checking for forkpty in -lutil... " >&6; }
--if test "${ac_cv_lib_util_forkpty+set}" = set; then :
-+if ${ac_cv_lib_util_forkpty+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -10512,13 +10622,13 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_forkpty"
>&5
- $as_echo "$ac_cv_lib_util_forkpty" >&6; }
--if test "x$ac_cv_lib_util_forkpty" = x""yes; then :
-+if test "x$ac_cv_lib_util_forkpty" = xyes; then :
- $as_echo "#define HAVE_FORKPTY 1" >>confdefs.h
- LIBS="$LIBS -lutil"
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for forkpty in -lbsd"
>&5
- $as_echo_n "checking for forkpty in -lbsd... " >&6; }
--if test "${ac_cv_lib_bsd_forkpty+set}" = set; then :
-+if ${ac_cv_lib_bsd_forkpty+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -10552,7 +10662,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_forkpty"
>&5
- $as_echo "$ac_cv_lib_bsd_forkpty" >&6; }
--if test "x$ac_cv_lib_bsd_forkpty" = x""yes; then :
-+if test "x$ac_cv_lib_bsd_forkpty" = xyes; then :
- $as_echo "#define HAVE_FORKPTY 1" >>confdefs.h
- LIBS="$LIBS -lbsd"
- fi
-@@ -10569,7 +10679,7 @@ done
- for ac_func in memmove
- do :
- ac_fn_c_check_func "$LINENO" "memmove"
"ac_cv_func_memmove"
--if test "x$ac_cv_func_memmove" = x""yes; then :
-+if test "x$ac_cv_func_memmove" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_MEMMOVE 1
- _ACEOF
-@@ -10593,7 +10703,7 @@ done
-
-
- ac_fn_c_check_func "$LINENO" "dup2" "ac_cv_func_dup2"
--if test "x$ac_cv_func_dup2" = x""yes; then :
-+if test "x$ac_cv_func_dup2" = xyes; then :
- $as_echo "#define HAVE_DUP2 1" >>confdefs.h
-
- else
-@@ -10606,7 +10716,7 @@ esac
- fi
-
- ac_fn_c_check_func "$LINENO" "getcwd" "ac_cv_func_getcwd"
--if test "x$ac_cv_func_getcwd" = x""yes; then :
-+if test "x$ac_cv_func_getcwd" = xyes; then :
- $as_echo "#define HAVE_GETCWD 1" >>confdefs.h
-
- else
-@@ -10619,7 +10729,7 @@ esac
- fi
-
- ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup"
--if test "x$ac_cv_func_strdup" = x""yes; then :
-+if test "x$ac_cv_func_strdup" = xyes; then :
- $as_echo "#define HAVE_STRDUP 1" >>confdefs.h
-
- else
-@@ -10635,7 +10745,7 @@ fi
- for ac_func in getpgrp
- do :
- ac_fn_c_check_func "$LINENO" "getpgrp"
"ac_cv_func_getpgrp"
--if test "x$ac_cv_func_getpgrp" = x""yes; then :
-+if test "x$ac_cv_func_getpgrp" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_GETPGRP 1
- _ACEOF
-@@ -10663,7 +10773,7 @@ done
- for ac_func in setpgrp
- do :
- ac_fn_c_check_func "$LINENO" "setpgrp"
"ac_cv_func_setpgrp"
--if test "x$ac_cv_func_setpgrp" = x""yes; then :
-+if test "x$ac_cv_func_setpgrp" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_SETPGRP 1
- _ACEOF
-@@ -10691,7 +10801,7 @@ done
- for ac_func in gettimeofday
- do :
- ac_fn_c_check_func "$LINENO" "gettimeofday"
"ac_cv_func_gettimeofday"
--if test "x$ac_cv_func_gettimeofday" = x""yes; then :
-+if test "x$ac_cv_func_gettimeofday" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_GETTIMEOFDAY 1
- _ACEOF
-@@ -10793,7 +10903,7 @@ if test $have_getaddrinfo = yes
- then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking getaddrinfo bug"
>&5
- $as_echo_n "checking getaddrinfo bug... " >&6; }
-- if test "${ac_cv_buggy_getaddrinfo+set}" = set; then :
-+ if ${ac_cv_buggy_getaddrinfo+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test "$cross_compiling" = yes; then :
-@@ -10922,7 +11032,7 @@ fi
- for ac_func in getnameinfo
- do :
- ac_fn_c_check_func "$LINENO" "getnameinfo"
"ac_cv_func_getnameinfo"
--if test "x$ac_cv_func_getnameinfo" = x""yes; then :
-+if test "x$ac_cv_func_getnameinfo" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_GETNAMEINFO 1
- _ACEOF
-@@ -10934,7 +11044,7 @@ done
- # checks for structures
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may
both be included" >&5
- $as_echo_n "checking whether time.h and sys/time.h may both be included... "
>&6; }
--if test "${ac_cv_header_time+set}" = set; then :
-+if ${ac_cv_header_time+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -10969,7 +11079,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in
sys/time.h or time.h" >&5
- $as_echo_n "checking whether struct tm is in sys/time.h or time.h... "
>&6; }
--if test "${ac_cv_struct_tm+set}" = set; then :
-+if ${ac_cv_struct_tm+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -11006,7 +11116,7 @@ ac_fn_c_check_member "$LINENO" "struct t
- #include <$ac_cv_struct_tm>
-
- "
--if test "x$ac_cv_member_struct_tm_tm_zone" = x""yes; then :
-+if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then :
-
- cat >>confdefs.h <<_ACEOF
- #define HAVE_STRUCT_TM_TM_ZONE 1
-@@ -11022,7 +11132,7 @@ $as_echo "#define HAVE_TM_ZONE 1" >>conf
- else
- ac_fn_c_check_decl "$LINENO" "tzname"
"ac_cv_have_decl_tzname" "#include <time.h>
- "
--if test "x$ac_cv_have_decl_tzname" = x""yes; then :
-+if test "x$ac_cv_have_decl_tzname" = xyes; then :
- ac_have_decl=1
- else
- ac_have_decl=0
-@@ -11034,7 +11144,7 @@ _ACEOF
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5
- $as_echo_n "checking for tzname... " >&6; }
--if test "${ac_cv_var_tzname+set}" = set; then :
-+if ${ac_cv_var_tzname+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -11070,7 +11180,7 @@ $as_echo "#define HAVE_TZNAME 1" >>confd
- fi
-
- ac_fn_c_check_member "$LINENO" "struct stat" "st_rdev"
"ac_cv_member_struct_stat_st_rdev" "$ac_includes_default"
--if test "x$ac_cv_member_struct_stat_st_rdev" = x""yes; then :
-+if test "x$ac_cv_member_struct_stat_st_rdev" = xyes; then :
-
- cat >>confdefs.h <<_ACEOF
- #define HAVE_STRUCT_STAT_ST_RDEV 1
-@@ -11080,7 +11190,7 @@ _ACEOF
- fi
-
- ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize"
"ac_cv_member_struct_stat_st_blksize" "$ac_includes_default"
--if test "x$ac_cv_member_struct_stat_st_blksize" = x""yes; then :
-+if test "x$ac_cv_member_struct_stat_st_blksize" = xyes; then :
-
- cat >>confdefs.h <<_ACEOF
- #define HAVE_STRUCT_STAT_ST_BLKSIZE 1
-@@ -11090,7 +11200,7 @@ _ACEOF
- fi
-
- ac_fn_c_check_member "$LINENO" "struct stat" "st_flags"
"ac_cv_member_struct_stat_st_flags" "$ac_includes_default"
--if test "x$ac_cv_member_struct_stat_st_flags" = x""yes; then :
-+if test "x$ac_cv_member_struct_stat_st_flags" = xyes; then :
-
- cat >>confdefs.h <<_ACEOF
- #define HAVE_STRUCT_STAT_ST_FLAGS 1
-@@ -11100,7 +11210,7 @@ _ACEOF
- fi
-
- ac_fn_c_check_member "$LINENO" "struct stat" "st_gen"
"ac_cv_member_struct_stat_st_gen" "$ac_includes_default"
--if test "x$ac_cv_member_struct_stat_st_gen" = x""yes; then :
-+if test "x$ac_cv_member_struct_stat_st_gen" = xyes; then :
-
- cat >>confdefs.h <<_ACEOF
- #define HAVE_STRUCT_STAT_ST_GEN 1
-@@ -11110,7 +11220,7 @@ _ACEOF
- fi
-
- ac_fn_c_check_member "$LINENO" "struct stat"
"st_birthtime" "ac_cv_member_struct_stat_st_birthtime"
"$ac_includes_default"
--if test "x$ac_cv_member_struct_stat_st_birthtime" = x""yes; then :
-+if test "x$ac_cv_member_struct_stat_st_birthtime" = xyes; then :
-
- cat >>confdefs.h <<_ACEOF
- #define HAVE_STRUCT_STAT_ST_BIRTHTIME 1
-@@ -11120,7 +11230,7 @@ _ACEOF
- fi
-
- ac_fn_c_check_member "$LINENO" "struct stat" "st_blocks"
"ac_cv_member_struct_stat_st_blocks" "$ac_includes_default"
--if test "x$ac_cv_member_struct_stat_st_blocks" = x""yes; then :
-+if test "x$ac_cv_member_struct_stat_st_blocks" = xyes; then :
-
- cat >>confdefs.h <<_ACEOF
- #define HAVE_STRUCT_STAT_ST_BLOCKS 1
-@@ -11142,7 +11252,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for time.h that defines
altzone" >&5
- $as_echo_n "checking for time.h that defines altzone... " >&6; }
--if test "${ac_cv_header_time_altzone+set}" = set; then :
-+if ${ac_cv_header_time_altzone+:} false; then :
- $as_echo_n "(cached) " >&6
- else
-
-@@ -11206,7 +11316,7 @@ $as_echo "$was_it_defined" >&6; }
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for addrinfo" >&5
- $as_echo_n "checking for addrinfo... " >&6; }
--if test "${ac_cv_struct_addrinfo+set}" = set; then :
-+if ${ac_cv_struct_addrinfo+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -11238,7 +11348,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_storage"
>&5
- $as_echo_n "checking for sockaddr_storage... " >&6; }
--if test "${ac_cv_struct_sockaddr_storage+set}" = set; then :
-+if ${ac_cv_struct_sockaddr_storage+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -11274,7 +11384,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned"
>&5
- $as_echo_n "checking whether char is unsigned... " >&6; }
--if test "${ac_cv_c_char_unsigned+set}" = set; then :
-+if ${ac_cv_c_char_unsigned+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -11306,7 +11416,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming
const" >&5
- $as_echo_n "checking for an ANSI C-conforming const... " >&6; }
--if test "${ac_cv_c_const+set}" = set; then :
-+if ${ac_cv_c_const+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -11594,7 +11704,7 @@ $as_echo "$va_list_is_array" >&6; }
-
-
- ac_fn_c_check_func "$LINENO" "gethostbyname_r"
"ac_cv_func_gethostbyname_r"
--if test "x$ac_cv_func_gethostbyname_r" = x""yes; then :
-+if test "x$ac_cv_func_gethostbyname_r" = xyes; then :
-
- $as_echo "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h
-
-@@ -11725,7 +11835,7 @@ else
- for ac_func in gethostbyname
- do :
- ac_fn_c_check_func "$LINENO" "gethostbyname"
"ac_cv_func_gethostbyname"
--if test "x$ac_cv_func_gethostbyname" = x""yes; then :
-+if test "x$ac_cv_func_gethostbyname" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_GETHOSTBYNAME 1
- _ACEOF
-@@ -11747,12 +11857,12 @@ fi
-
- # Linux requires this for correct f.p. operations
- ac_fn_c_check_func "$LINENO" "__fpu_control"
"ac_cv_func___fpu_control"
--if test "x$ac_cv_func___fpu_control" = x""yes; then :
-+if test "x$ac_cv_func___fpu_control" = xyes; then :
-
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __fpu_control in
-lieee" >&5
- $as_echo_n "checking for __fpu_control in -lieee... " >&6; }
--if test "${ac_cv_lib_ieee___fpu_control+set}" = set; then :
-+if ${ac_cv_lib_ieee___fpu_control+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -11786,7 +11896,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_ieee___fpu_control" >&5
- $as_echo "$ac_cv_lib_ieee___fpu_control" >&6; }
--if test "x$ac_cv_lib_ieee___fpu_control" = x""yes; then :
-+if test "x$ac_cv_lib_ieee___fpu_control" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_LIBIEEE 1
- _ACEOF
-@@ -11881,7 +11991,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C doubles are
little-endian IEEE 754 binary64" >&5
- $as_echo_n "checking whether C doubles are little-endian IEEE 754 binary64...
" >&6; }
--if test "${ac_cv_little_endian_double+set}" = set; then :
-+if ${ac_cv_little_endian_double+:} false; then :
- $as_echo_n "(cached) " >&6
- else
-
-@@ -11923,7 +12033,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C doubles are big-endian
IEEE 754 binary64" >&5
- $as_echo_n "checking whether C doubles are big-endian IEEE 754 binary64... "
>&6; }
--if test "${ac_cv_big_endian_double+set}" = set; then :
-+if ${ac_cv_big_endian_double+:} false; then :
- $as_echo_n "(cached) " >&6
- else
-
-@@ -11969,7 +12079,7 @@ fi
- # conversions work.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C doubles are ARM
mixed-endian IEEE 754 binary64" >&5
- $as_echo_n "checking whether C doubles are ARM mixed-endian IEEE 754 binary64...
" >&6; }
--if test "${ac_cv_mixed_endian_double+set}" = set; then :
-+if ${ac_cv_mixed_endian_double+:} false; then :
- $as_echo_n "(cached) " >&6
- else
-
-@@ -12117,7 +12227,7 @@ LIBS="$LIBS $LIBM"
- # -0. on some architectures.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether tanh preserves the sign
of zero" >&5
- $as_echo_n "checking whether tanh preserves the sign of zero... " >&6;
}
--if test "${ac_cv_tanh_preserves_zero_sign+set}" = set; then :
-+if ${ac_cv_tanh_preserves_zero_sign+:} false; then :
- $as_echo_n "(cached) " >&6
- else
-
-@@ -12185,7 +12295,7 @@ done
-
- ac_fn_c_check_decl "$LINENO" "isinf"
"ac_cv_have_decl_isinf" "#include <math.h>
- "
--if test "x$ac_cv_have_decl_isinf" = x""yes; then :
-+if test "x$ac_cv_have_decl_isinf" = xyes; then :
- ac_have_decl=1
- else
- ac_have_decl=0
-@@ -12196,7 +12306,7 @@ cat >>confdefs.h <<_ACEOF
- _ACEOF
- ac_fn_c_check_decl "$LINENO" "isnan"
"ac_cv_have_decl_isnan" "#include <math.h>
- "
--if test "x$ac_cv_have_decl_isnan" = x""yes; then :
-+if test "x$ac_cv_have_decl_isnan" = xyes; then :
- ac_have_decl=1
- else
- ac_have_decl=0
-@@ -12207,7 +12317,7 @@ cat >>confdefs.h <<_ACEOF
- _ACEOF
- ac_fn_c_check_decl "$LINENO" "isfinite"
"ac_cv_have_decl_isfinite" "#include <math.h>
- "
--if test "x$ac_cv_have_decl_isfinite" = x""yes; then :
-+if test "x$ac_cv_have_decl_isfinite" = xyes; then :
- ac_have_decl=1
- else
- ac_have_decl=0
-@@ -12227,7 +12337,7 @@ LIBS=$LIBS_SAVE
- # sem_open results in a 'Signal 12' error.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX semaphores are
enabled" >&5
- $as_echo_n "checking whether POSIX semaphores are enabled... " >&6; }
--if test "${ac_cv_posix_semaphores_enabled+set}" = set; then :
-+if ${ac_cv_posix_semaphores_enabled+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test "$cross_compiling" = yes; then :
-@@ -12278,7 +12388,7 @@ fi
- # Multiprocessing check for broken sem_getvalue
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken sem_getvalue"
>&5
- $as_echo_n "checking for broken sem_getvalue... " >&6; }
--if test "${ac_cv_broken_sem_getvalue+set}" = set; then :
-+if ${ac_cv_broken_sem_getvalue+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test "$cross_compiling" = yes; then :
-@@ -12343,7 +12453,7 @@ no)
- 15|30)
- ;;
- *)
-- as_fn_error $? "bad value $enable_big_digits for --enable-big-digits; value
should be 15 or 30" "$LINENO" 5 ;;
-+ as_fn_error $? "bad value $enable_big_digits for --enable-big-digits; value
should be 15 or 30" "$LINENO" 5 ;;
- esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_big_digits"
>&5
- $as_echo "$enable_big_digits" >&6; }
-@@ -12361,7 +12471,7 @@ fi
-
- # check for wchar.h
- ac_fn_c_check_header_mongrel "$LINENO" "wchar.h"
"ac_cv_header_wchar_h" "$ac_includes_default"
--if test "x$ac_cv_header_wchar_h" = x""yes; then :
-+if test "x$ac_cv_header_wchar_h" = xyes; then :
-
-
- $as_echo "#define HAVE_WCHAR_H 1" >>confdefs.h
-@@ -12384,7 +12494,7 @@ then
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of wchar_t" >&5
- $as_echo_n "checking size of wchar_t... " >&6; }
--if test "${ac_cv_sizeof_wchar_t+set}" = set; then :
-+if ${ac_cv_sizeof_wchar_t+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (wchar_t))"
"ac_cv_sizeof_wchar_t" "#include <wchar.h>
-@@ -12395,7 +12505,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (wchar_t)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_wchar_t=0
- fi
-@@ -12450,7 +12560,7 @@ then
- # check whether wchar_t is signed or not
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wchar_t is signed"
>&5
- $as_echo_n "checking whether wchar_t is signed... " >&6; }
-- if test "${ac_cv_wchar_t_signed+set}" = set; then :
-+ if ${ac_cv_wchar_t_signed+:} false; then :
- $as_echo_n "(cached) " >&6
- else
-
-@@ -12514,7 +12624,7 @@ ucs4) unicode_size="4"
- $as_echo "#define Py_UNICODE_SIZE 4" >>confdefs.h
-
- ;;
--*) as_fn_error $? "invalid value for --enable-unicode. Use either ucs2 or ucs4
(lowercase)." "$LINENO" 5 ;;
-+*) as_fn_error $? "invalid value for --enable-unicode. Use either ucs2 or ucs4
(lowercase)." "$LINENO" 5 ;;
- esac
-
-
-@@ -12561,7 +12671,7 @@ fi
- # check for endianness
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is
bigendian" >&5
- $as_echo_n "checking whether byte ordering is bigendian... " >&6; }
--if test "${ac_cv_c_bigendian+set}" = set; then :
-+if ${ac_cv_c_bigendian+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_cv_c_bigendian=unknown
-@@ -12780,7 +12890,7 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUI
- ;; #(
- *)
- as_fn_error $? "unknown endianness
-- presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
-+ presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
- esac
-
-
-@@ -12788,7 +12898,7 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUI
- # or fills with zeros (like the Cray J90, according to Tim Peters).
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether right shift extends the
sign bit" >&5
- $as_echo_n "checking whether right shift extends the sign bit... " >&6;
}
--if test "${ac_cv_rshift_extends_sign+set}" = set; then :
-+if ${ac_cv_rshift_extends_sign+:} false; then :
- $as_echo_n "(cached) " >&6
- else
-
-@@ -12827,7 +12937,7 @@ fi
- # check for getc_unlocked and related locking functions
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getc_unlocked() and
friends" >&5
- $as_echo_n "checking for getc_unlocked() and friends... " >&6; }
--if test "${ac_cv_have_getc_unlocked+set}" = set; then :
-+if ${ac_cv_have_getc_unlocked+:} false; then :
- $as_echo_n "(cached) " >&6
- else
-
-@@ -12925,7 +13035,7 @@ fi
- # check for readline 2.1
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_callback_handler_install
in -lreadline" >&5
- $as_echo_n "checking for rl_callback_handler_install in -lreadline... "
>&6; }
--if test "${ac_cv_lib_readline_rl_callback_handler_install+set}" = set; then :
-+if ${ac_cv_lib_readline_rl_callback_handler_install+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -12959,7 +13069,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_readline_rl_callback_handler_install" >&5
- $as_echo "$ac_cv_lib_readline_rl_callback_handler_install" >&6; }
--if test "x$ac_cv_lib_readline_rl_callback_handler_install" = x""yes;
then :
-+if test "x$ac_cv_lib_readline_rl_callback_handler_install" = xyes; then :
-
- $as_echo "#define HAVE_RL_CALLBACK 1" >>confdefs.h
-
-@@ -13011,7 +13121,7 @@ fi
- # check for readline 4.0
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_pre_input_hook in
-lreadline" >&5
- $as_echo_n "checking for rl_pre_input_hook in -lreadline... " >&6; }
--if test "${ac_cv_lib_readline_rl_pre_input_hook+set}" = set; then :
-+if ${ac_cv_lib_readline_rl_pre_input_hook+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -13045,7 +13155,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_readline_rl_pre_input_hook" >&5
- $as_echo "$ac_cv_lib_readline_rl_pre_input_hook" >&6; }
--if test "x$ac_cv_lib_readline_rl_pre_input_hook" = x""yes; then :
-+if test "x$ac_cv_lib_readline_rl_pre_input_hook" = xyes; then :
-
- $as_echo "#define HAVE_RL_PRE_INPUT_HOOK 1" >>confdefs.h
-
-@@ -13055,7 +13165,7 @@ fi
- # also in 4.0
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for
rl_completion_display_matches_hook in -lreadline" >&5
- $as_echo_n "checking for rl_completion_display_matches_hook in -lreadline... "
>&6; }
--if test "${ac_cv_lib_readline_rl_completion_display_matches_hook+set}" = set;
then :
-+if ${ac_cv_lib_readline_rl_completion_display_matches_hook+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -13089,7 +13199,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_readline_rl_completion_display_matches_hook" >&5
- $as_echo "$ac_cv_lib_readline_rl_completion_display_matches_hook" >&6;
}
--if test "x$ac_cv_lib_readline_rl_completion_display_matches_hook" =
x""yes; then :
-+if test "x$ac_cv_lib_readline_rl_completion_display_matches_hook" = xyes; then
:
-
- $as_echo "#define HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK 1"
>>confdefs.h
-
-@@ -13099,7 +13209,7 @@ fi
- # check for readline 4.2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_matches in
-lreadline" >&5
- $as_echo_n "checking for rl_completion_matches in -lreadline... " >&6;
}
--if test "${ac_cv_lib_readline_rl_completion_matches+set}" = set; then :
-+if ${ac_cv_lib_readline_rl_completion_matches+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -13133,7 +13243,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_readline_rl_completion_matches" >&5
- $as_echo "$ac_cv_lib_readline_rl_completion_matches" >&6; }
--if test "x$ac_cv_lib_readline_rl_completion_matches" = x""yes; then
:
-+if test "x$ac_cv_lib_readline_rl_completion_matches" = xyes; then :
-
- $as_echo "#define HAVE_RL_COMPLETION_MATCHES 1" >>confdefs.h
-
-@@ -13174,7 +13284,7 @@ LIBS=$LIBS_no_readline
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken nice()"
>&5
- $as_echo_n "checking for broken nice()... " >&6; }
--if test "${ac_cv_broken_nice+set}" = set; then :
-+if ${ac_cv_broken_nice+:} false; then :
- $as_echo_n "(cached) " >&6
- else
-
-@@ -13215,7 +13325,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken poll()"
>&5
- $as_echo_n "checking for broken poll()... " >&6; }
--if test "${ac_cv_broken_poll+set}" = set; then :
-+if ${ac_cv_broken_poll+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test "$cross_compiling" = yes; then :
-@@ -13270,7 +13380,7 @@ ac_fn_c_check_member "$LINENO" "struct t
- #include <$ac_cv_struct_tm>
-
- "
--if test "x$ac_cv_member_struct_tm_tm_zone" = x""yes; then :
-+if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then :
-
- cat >>confdefs.h <<_ACEOF
- #define HAVE_STRUCT_TM_TM_ZONE 1
-@@ -13286,7 +13396,7 @@ $as_echo "#define HAVE_TM_ZONE 1" >>conf
- else
- ac_fn_c_check_decl "$LINENO" "tzname"
"ac_cv_have_decl_tzname" "#include <time.h>
- "
--if test "x$ac_cv_have_decl_tzname" = x""yes; then :
-+if test "x$ac_cv_have_decl_tzname" = xyes; then :
- ac_have_decl=1
- else
- ac_have_decl=0
-@@ -13298,7 +13408,7 @@ _ACEOF
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5
- $as_echo_n "checking for tzname... " >&6; }
--if test "${ac_cv_var_tzname+set}" = set; then :
-+if ${ac_cv_var_tzname+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -13337,7 +13447,7 @@ fi
- # check tzset(3) exists and works like we expect it to
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working tzset()"
>&5
- $as_echo_n "checking for working tzset()... " >&6; }
--if test "${ac_cv_working_tzset+set}" = set; then :
-+if ${ac_cv_working_tzset+:} false; then :
- $as_echo_n "(cached) " >&6
- else
-
-@@ -13434,7 +13544,7 @@ fi
- # Look for subsecond timestamps in struct stat
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tv_nsec in struct stat"
>&5
- $as_echo_n "checking for tv_nsec in struct stat... " >&6; }
--if test "${ac_cv_stat_tv_nsec+set}" = set; then :
-+if ${ac_cv_stat_tv_nsec+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -13471,7 +13581,7 @@ fi
- # Look for BSD style subsecond timestamps in struct stat
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tv_nsec2 in struct stat"
>&5
- $as_echo_n "checking for tv_nsec2 in struct stat... " >&6; }
--if test "${ac_cv_stat_tv_nsec2+set}" = set; then :
-+if ${ac_cv_stat_tv_nsec2+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -13508,7 +13618,7 @@ fi
- # On HP/UX 11.0, mvwdelch is a block with a return statement
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mvwdelch is an
expression" >&5
- $as_echo_n "checking whether mvwdelch is an expression... " >&6; }
--if test "${ac_cv_mvwdelch_is_expression+set}" = set; then :
-+if ${ac_cv_mvwdelch_is_expression+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -13545,7 +13655,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether WINDOW has _flags"
>&5
- $as_echo_n "checking whether WINDOW has _flags... " >&6; }
--if test "${ac_cv_window_has_flags+set}" = set; then :
-+if ${ac_cv_window_has_flags+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -13693,7 +13803,7 @@ if test "$have_long_long" = yes
- then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for %lld and %llu printf()
format support" >&5
- $as_echo_n "checking for %lld and %llu printf() format support... "
>&6; }
-- if test "${ac_cv_have_long_long_format+set}" = set; then :
-+ if ${ac_cv_have_long_long_format+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test "$cross_compiling" = yes; then :
-@@ -13764,7 +13874,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for %zd printf() format
support" >&5
- $as_echo_n "checking for %zd printf() format support... " >&6; }
--if test "${ac_cv_have_size_t_format+set}" = set; then :
-+if ${ac_cv_have_size_t_format+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test "$cross_compiling" = yes; then :
-@@ -13837,7 +13947,7 @@ ac_fn_c_check_type "$LINENO" "socklen_t"
- #endif
-
- "
--if test "x$ac_cv_type_socklen_t" = x""yes; then :
-+if test "x$ac_cv_type_socklen_t" = xyes; then :
-
- else
-
-@@ -13942,10 +14052,21 @@ $as_echo "$as_me: WARNING: cache variabl
- :end' >>confcache
- if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
- if test -w "$cache_file"; then
-- test "x$cache_file" != "x/dev/null" &&
-+ if test "x$cache_file" != "x/dev/null"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file"
>&5
- $as_echo "$as_me: updating cache $cache_file" >&6;}
-- cat confcache >$cache_file
-+ if test ! -f "$cache_file" || test -h "$cache_file"; then
-+ cat confcache >"$cache_file"
-+ else
-+ case $cache_file in #(
-+ */* | ?:*)
-+ mv -f confcache "$cache_file"$$ &&
-+ mv -f "$cache_file"$$ "$cache_file" ;; #(
-+ *)
-+ mv -f confcache "$cache_file" ;;
-+ esac
-+ fi
-+ fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache
$cache_file" >&5
- $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
-@@ -13978,7 +14099,7 @@ LTLIBOBJS=$ac_ltlibobjs
-
-
-
--: ${CONFIG_STATUS=./config.status}
-+: "${CONFIG_STATUS=./config.status}"
- ac_write_fail=0
- ac_clean_files_save=$ac_clean_files
- ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-@@ -14079,6 +14200,7 @@ fi
- IFS=" "" $as_nl"
-
- # Find who we are. Look in the path if we contain no directory separator.
-+as_myself=
- case $0 in #((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-@@ -14386,7 +14508,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri
- # values after options handling.
- ac_log="
- This file was extended by python $as_me 2.7, which was
--generated by GNU Autoconf 2.67. Invocation command line was
-+generated by GNU Autoconf 2.68. Invocation command line was
-
- CONFIG_FILES = $CONFIG_FILES
- CONFIG_HEADERS = $CONFIG_HEADERS
-@@ -14448,7 +14570,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_writ
- ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //;
s/[\\""\`\$]/\\\\&/g'`"
- ac_cs_version="\\
- python config.status 2.7
--configured by $0, generated by GNU Autoconf 2.67,
-+configured by $0, generated by GNU Autoconf 2.68,
- with options \\"\$ac_cs_config\\"
-
- Copyright (C) 2010 Free Software Foundation, Inc.
-@@ -14580,7 +14702,7 @@ do
- "Misc/python.pc") CONFIG_FILES="$CONFIG_FILES Misc/python.pc"
;;
- "Modules/ld_so_aix") CONFIG_FILES="$CONFIG_FILES
Modules/ld_so_aix" ;;
-
-- *) as_fn_error $? "invalid argument: \`$ac_config_target'"
"$LINENO" 5 ;;
-+ *) as_fn_error $? "invalid argument: \`$ac_config_target'"
"$LINENO" 5;;
- esac
- done
-
-@@ -14602,9 +14724,10 @@ fi
- # after its creation but before its name has been assigned to `$tmp'.
- $debug ||
- {
-- tmp=
-+ tmp= ac_tmp=
- trap 'exit_status=$?
-- { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; }
&& exit $exit_status
-+ : "${ac_tmp:=$tmp}"
-+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit
$exit_status
- ' 0
- trap 'as_fn_exit 1' 1 2 13 15
- }
-@@ -14612,12 +14735,13 @@ $debug ||
-
- {
- tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null`
&&
-- test -n "$tmp" && test -d "$tmp"
-+ test -d "$tmp"
- } ||
- {
- tmp=./conf$$-$RANDOM
- (umask 077 && mkdir "$tmp")
- } || as_fn_error $? "cannot create a temporary directory in ."
"$LINENO" 5
-+ac_tmp=$tmp
-
- # Set up the scripts for CONFIG_FILES section.
- # No need to generate them if there are no CONFIG_FILES.
-@@ -14639,7 +14763,7 @@ else
- ac_cs_awk_cr=$ac_cr
- fi
-
--echo 'BEGIN {' >"$tmp/subs1.awk" &&
-+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
- _ACEOF
-
-
-@@ -14667,7 +14791,7 @@ done
- rm -f conf$$subs.sh
-
- cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
--cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
-+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
- _ACEOF
- sed -n '
- h
-@@ -14715,7 +14839,7 @@ t delim
- rm -f conf$$subs.awk
- cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- _ACAWK
--cat >>"\$tmp/subs1.awk" <<_ACAWK &&
-+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
- for (key in S) S_is_set[key] = 1
- FS = ""
-
-@@ -14747,7 +14871,7 @@ if sed "s/$ac_cr//" < /dev/null > /dev/n
- sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
- else
- cat
--fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
-+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
- || as_fn_error $? "could not setup config files machinery"
"$LINENO" 5
- _ACEOF
-
-@@ -14781,7 +14905,7 @@ fi # test -n "$CONFIG_FILES"
- # No need to generate them if there are no CONFIG_HEADERS.
- # This happens for instance with `./config.status Makefile'.
- if test -n "$CONFIG_HEADERS"; then
--cat >"$tmp/defines.awk" <<\_ACAWK ||
-+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
- BEGIN {
- _ACEOF
-
-@@ -14793,8 +14917,8 @@ _ACEOF
- # handling of long lines.
- ac_delim='%!_!# '
- for ac_last_try in false false :; do
-- ac_t=`sed -n "/$ac_delim/p" confdefs.h`
-- if test -z "$ac_t"; then
-+ ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
-+ if test -z "$ac_tt"; then
- break
- elif $ac_last_try; then
- as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
-@@ -14895,7 +15019,7 @@ do
- esac
- case $ac_mode$ac_tag in
- :[FHL]*:*);;
-- :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO"
5 ;;
-+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO"
5;;
- :[FH]-) ac_tag=-:-;;
- :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
- esac
-@@ -14914,7 +15038,7 @@ do
- for ac_f
- do
- case $ac_f in
-- -) ac_f="$tmp/stdin";;
-+ -) ac_f="$ac_tmp/stdin";;
- *) # Look for the file first in the build tree, then in the source tree
- # (if the path is not absolute). The absolute path cannot be DOS-style,
- # because $ac_f cannot contain `:'.
-@@ -14923,7 +15047,7 @@ do
- [\\/$]*) false;;
- *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
- esac ||
-- as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5
;;
-+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO"
5;;
- esac
- case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed
"s/'/'\\\\\\\\''/g"`;; esac
- as_fn_append ac_file_inputs " '$ac_f'"
-@@ -14949,8 +15073,8 @@ $as_echo "$as_me: creating $ac_file" >&6
- esac
-
- case $ac_tag in
-- *:-:* | *:-) cat >"$tmp/stdin" \
-- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
-+ *:-:* | *:-) cat >"$ac_tmp/stdin" \
-+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
- esac
- ;;
- esac
-@@ -15080,21 +15204,22 @@ s&@abs_top_builddir@&$ac_abs_top_builddi
- s&@INSTALL@&$ac_INSTALL&;t t
- $ac_datarootdir_hack
- "
--eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f
"$tmp/subs.awk" >$tmp/out \
-- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f
"$ac_tmp/subs.awk" \
-+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file"
"$LINENO" 5
-
- test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
-- { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n
"$ac_out"; } &&
-- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z
"$ac_out"; } &&
-+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n
"$ac_out"; } &&
-+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
-+ "$ac_tmp/out"`; test -z "$ac_out"; } &&
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference
to the variable \`datarootdir'
- which seems to be undefined. Please make sure it is defined" >&5
- $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable
\`datarootdir'
- which seems to be undefined. Please make sure it is defined" >&2;}
-
-- rm -f "$tmp/stdin"
-+ rm -f "$ac_tmp/stdin"
- case $ac_file in
-- -) cat "$tmp/out" && rm -f "$tmp/out";;
-- *) rm -f "$ac_file" && mv "$tmp/out"
"$ac_file";;
-+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
-+ *) rm -f "$ac_file" && mv "$ac_tmp/out"
"$ac_file";;
- esac \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- ;;
-@@ -15105,20 +15230,20 @@ which seems to be undefined. Please mak
- if test x"$ac_file" != x-; then
- {
- $as_echo "/* $configure_input */" \
-- && eval '$AWK -f "$tmp/defines.awk"'
"$ac_file_inputs"
-- } >"$tmp/config.h" \
-+ && eval '$AWK -f "$ac_tmp/defines.awk"'
"$ac_file_inputs"
-+ } >"$ac_tmp/config.h" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-- if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1;
then
-+ if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1;
then
- { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged"
>&5
- $as_echo "$as_me: $ac_file is unchanged" >&6;}
- else
- rm -f "$ac_file"
-- mv "$tmp/config.h" "$ac_file" \
-+ mv "$ac_tmp/config.h" "$ac_file" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- fi
- else
- $as_echo "/* $configure_input */" \
-- && eval '$AWK -f "$tmp/defines.awk"'
"$ac_file_inputs" \
-+ && eval '$AWK -f "$ac_tmp/defines.awk"'
"$ac_file_inputs" \
- || as_fn_error $? "could not create -" "$LINENO" 5
- fi
- ;;
diff -up ./pyconfig.h.in.autotool-intermediates ./pyconfig.h.in
---- ./pyconfig.h.in.autotool-intermediates 2013-03-25 15:25:30.435846538 -0400
-+++ ./pyconfig.h.in 2013-03-25 15:25:33.030846360 -0400
+--- ./pyconfig.h.in.autotool-intermediates 2013-04-09 11:24:01.020185806 +0200
++++ ./pyconfig.h.in 2013-04-09 11:24:02.088183204 +0200
@@ -18,6 +18,12 @@
/* Define this if you have BeOS threads. */
#undef BEOS_THREADS
@@ -2714,7 +210,7 @@ diff -up ./pyconfig.h.in.autotool-intermediates ./pyconfig.h.in
/* Define if you have the Mach cthreads package */
#undef C_THREADS
-@@ -1107,12 +1113,6 @@
+@@ -1119,12 +1125,6 @@
/* Define to profile with the Pentium timestamp counter */
#undef WITH_TSC
diff --git a/python-2.5.1-sqlite-encoding.patch b/python-2.5.1-sqlite-encoding.patch
index 97235d8..ff2a3f8 100644
--- a/python-2.5.1-sqlite-encoding.patch
+++ b/python-2.5.1-sqlite-encoding.patch
@@ -2,7 +2,7 @@ diff -up Python-2.5.1/Lib/sqlite3/dbapi2.py.encoding
Python-2.5.1/Lib/sqlite3/db
--- Python-2.5.1/Lib/sqlite3/dbapi2.py.encoding 2007-09-14 10:41:50.000000000 -0400
+++ Python-2.5.1/Lib/sqlite3/dbapi2.py 2007-09-14 10:42:00.000000000 -0400
@@ -1,7 +1,6 @@
--#-*- coding: ISO-8859-1 -*-
+-# -*- coding: iso-8859-1 -*-
# pysqlite2/dbapi2.py: the DB-API 2.0 interface
#
-# Copyright (C) 2004-2005 Gerhard Hring <gh(a)ghaering.de>
diff --git a/python-2.6-rpath.patch b/python-2.6-rpath.patch
index a668926..43e3ec4 100644
--- a/python-2.6-rpath.patch
+++ b/python-2.6-rpath.patch
@@ -1,6 +1,6 @@
-diff -up Python-2.6/configure.in.rpath Python-2.6/configure.in
---- Python-2.6/configure.in.rpath 2008-11-24 02:51:06.000000000 -0500
-+++ Python-2.6/configure.in 2008-11-24 02:51:21.000000000 -0500
+diff -up Python-2.6/configure.ac.rpath Python-2.6/configure.ac
+--- Python-2.6/configure.ac.rpath 2008-11-24 02:51:06.000000000 -0500
++++ Python-2.6/configure.ac 2008-11-24 02:51:21.000000000 -0500
@@ -729,7 +729,7 @@ if test $enable_shared = "yes"; then
;;
OSF*)
diff --git a/python-2.7.1-config.patch b/python-2.7.1-config.patch
index 0bb790e..ea1c5d6 100644
--- a/python-2.7.1-config.patch
+++ b/python-2.7.1-config.patch
@@ -1,6 +1,5 @@
-diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dist
---- Python-2.7.1/Modules/Setup.dist.rhconfig 2010-08-21 07:40:30.000000000 -0400
-+++ Python-2.7.1/Modules/Setup.dist 2010-12-23 15:47:12.111059967 -0500
+--- Python-2.7.4/Modules/Setup.dist.rhconfig 2013-04-06 16:02:34.000000000 +0200
++++ Python-2.7.4/Modules/Setup.dist 2013-04-08 10:05:16.369985654 +0200
@@ -153,7 +153,7 @@ GLHACK=-Dclear=__GLclear
# modules are to be built as shared libraries (see above for more
# detail; also note that *static* reverses this effect):
@@ -10,7 +9,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
# GNU readline. Unlike previous Python incarnations, GNU readline is
# now incorporated in an optional module, configured in the Setup file
-@@ -163,73 +163,73 @@ GLHACK=-Dclear=__GLclear
+@@ -163,74 +163,74 @@ GLHACK=-Dclear=__GLclear
# it, depending on your system -- see the GNU readline instructions.
# It's okay for this to be a shared library, too.
@@ -29,9 +28,6 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
-#_testcapi _testcapimodule.c # Python C API test module
-#_random _randommodule.c # Random number generator
-#_collections _collectionsmodule.c # Container types
--#itertools itertoolsmodule.c # Functions creating iterators for efficient looping
--#strop stropmodule.c # String manipulations
--#_functools _functoolsmodule.c # Tools for working with functions and callable objects
+array arraymodule.c # array objects
+cmath cmathmodule.c _math.c # -lm # complex math library functions
+math mathmodule.c _math.c # -lm # math library functions, e.g. sin()
@@ -41,6 +37,10 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
+_testcapi _testcapimodule.c # Python C API test module
+_random _randommodule.c # Random number generator
+_collections _collectionsmodule.c # Container types
+ #_heapq _heapqmodule.c # Heapq type
+-#itertools itertoolsmodule.c # Functions creating iterators for efficient looping
+-#strop stropmodule.c # String manipulations
+-#_functools _functoolsmodule.c # Tools for working with functions and callable objects
+itertools itertoolsmodule.c # Functions creating iterators for efficient looping
+strop stropmodule.c # String manipulations
+_functools _functoolsmodule.c # Tools for working with functions and callable objects
@@ -81,7 +81,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
# Socket module helper for socket(2)
-#_socket socketmodule.c
-+_socket socketmodule.c
++_socket socketmodule.c timemodule.c
# Socket module helper for SSL support; you must comment out the other
# socket line above, and possibly edit the SSL variable:
@@ -99,7 +99,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
# First, look at Setup.config; configure may have set this for you.
-#crypt cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some systems
-+crypt cryptmodule.c -lcrypt # crypt(3); needs -lcrypt on some systems
++crypt cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some systems
# Some more UNIX dependent modules -- off by default, since these
@@ -114,7 +114,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
# Multimedia modules -- off by default.
-@@ -237,8 +237,8 @@ GLHACK=-Dclear=__GLclear
+@@ -238,8 +238,8 @@ GLHACK=-Dclear=__GLclear
# #993173 says audioop works on 64-bit platforms, though.
# These represent audio samples or images as strings:
@@ -125,7 +125,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
# Note that the _md5 and _sha modules are normally only built if the
-@@ -248,14 +248,14 @@ GLHACK=-Dclear=__GLclear
+@@ -249,14 +249,14 @@ GLHACK=-Dclear=__GLclear
# Message-Digest Algorithm, described in RFC 1321. The necessary files
# md5.c and md5.h are included here.
@@ -144,7 +144,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
# SGI IRIX specific modules -- off by default.
-@@ -302,12 +302,12 @@ GLHACK=-Dclear=__GLclear
+@@ -303,12 +303,12 @@ GLHACK=-Dclear=__GLclear
# A Linux specific module -- off by default; this may also work on
# some *BSDs.
@@ -159,7 +159,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
# The _tkinter module.
-@@ -322,7 +322,7 @@ GLHACK=-Dclear=__GLclear
+@@ -323,7 +323,7 @@ GLHACK=-Dclear=__GLclear
# every system.
# *** Always uncomment this (leave the leading underscore in!):
@@ -168,7 +168,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
# *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
# -L/usr/local/lib \
# *** Uncomment and edit to reflect where your Tcl/Tk headers are:
-@@ -332,7 +332,7 @@ GLHACK=-Dclear=__GLclear
+@@ -333,7 +333,7 @@ GLHACK=-Dclear=__GLclear
# *** Or uncomment this for Solaris:
# -I/usr/openwin/include \
# *** Uncomment and edit for Tix extension only:
@@ -177,7 +177,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
# *** Uncomment and edit for BLT extension only:
# -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \
# *** Uncomment and edit for PIL (TkImaging) extension only:
-@@ -341,7 +341,7 @@ GLHACK=-Dclear=__GLclear
+@@ -342,7 +342,7 @@ GLHACK=-Dclear=__GLclear
# *** Uncomment and edit for TOGL extension only:
# -DWITH_TOGL togl.c \
# *** Uncomment and edit to reflect your Tcl/Tk versions:
@@ -186,7 +186,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
# *** Uncomment and edit to reflect where your X11 libraries are:
# -L/usr/X11R6/lib \
# *** Or uncomment this for Solaris:
-@@ -351,7 +351,7 @@ GLHACK=-Dclear=__GLclear
+@@ -352,7 +352,7 @@ GLHACK=-Dclear=__GLclear
# *** Uncomment for AIX:
# -lld \
# *** Always uncomment this; X11 libraries to link with:
@@ -195,7 +195,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
# Lance Ellinghaus's syslog module
#syslog syslogmodule.c # syslog daemon interface
-@@ -373,7 +373,7 @@ GLHACK=-Dclear=__GLclear
+@@ -374,7 +374,7 @@ GLHACK=-Dclear=__GLclear
# it is a highly experimental and dangerous device for calling
# *arbitrary* C functions in *arbitrary* shared libraries:
@@ -204,7 +204,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
# Modules that provide persistent dictionary-like semantics. You will
-@@ -396,7 +396,7 @@ GLHACK=-Dclear=__GLclear
+@@ -397,7 +397,7 @@ GLHACK=-Dclear=__GLclear
#
# First, look at Setup.config; configure may have set this for you.
@@ -213,7 +213,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
# Sleepycat Berkeley DB interface.
-@@ -411,11 +411,10 @@ GLHACK=-Dclear=__GLclear
+@@ -412,11 +412,10 @@ GLHACK=-Dclear=__GLclear
#
# Edit the variables DB and DBLIBVERto point to the db top directory
# and the subdirectory of PORT where you built it.
@@ -229,7 +229,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
# Historical Berkeley DB 1.85
#
-@@ -430,14 +429,14 @@ GLHACK=-Dclear=__GLclear
+@@ -431,14 +430,14 @@ GLHACK=-Dclear=__GLclear
# Helper module for various ascii-encoders
@@ -248,7 +248,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
# Lee Busby's SIGFPE modules.
-@@ -460,7 +459,7 @@ GLHACK=-Dclear=__GLclear
+@@ -461,7 +460,7 @@ GLHACK=-Dclear=__GLclear
# Andrew Kuchling's zlib module.
# This require zlib 1.1.3 (or later).
# See
http://www.gzip.org/zlib/
@@ -257,7 +257,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig
Python-2.7.1/Modules/Setup.dis
# Interface to the Expat XML parser
#
-@@ -479,14 +478,14 @@ GLHACK=-Dclear=__GLclear
+@@ -480,14 +479,14 @@ GLHACK=-Dclear=__GLclear
# Hye-Shik Chang's CJKCodecs
# multibytecodec is required for all the other CJK codec modules
diff --git a/python-2.7.2-add-extension-suffix-to-python-config.patch
b/python-2.7.2-add-extension-suffix-to-python-config.patch
index 4d56867..d1ff052 100644
--- a/python-2.7.2-add-extension-suffix-to-python-config.patch
+++ b/python-2.7.2-add-extension-suffix-to-python-config.patch
@@ -11,7 +11,7 @@ diff -up
Python-2.7.2/Misc/python-config.in.add-extension-suffix-to-python-confi
def exit_with_usage(code=1):
print >>sys.stderr, "Usage: %s [%s]" % (sys.argv[0],
@@ -54,3 +54,5 @@ for opt in opt_flags:
- libs.extend(getvar('LINKFORSHARED').split())
+ libs.extend(getvar('LINKFORSHARED').split())
print ' '.join(libs)
+ elif opt == '--extension-suffix':
diff --git a/python-2.7.3-debug-build.patch b/python-2.7.3-debug-build.patch
index b44c9eb..5b6cda7 100644
--- a/python-2.7.3-debug-build.patch
+++ b/python-2.7.3-debug-build.patch
@@ -1,6 +1,6 @@
-diff -up Python-2.7.3/configure.in.debug-build Python-2.7.3/configure.in
---- Python-2.7.3/configure.in.debug-build 2012-04-18 19:46:22.066498521 -0400
-+++ Python-2.7.3/configure.in 2012-04-18 19:46:22.078498372 -0400
+diff -up Python-2.7.3/configure.ac.debug-build Python-2.7.3/configure.ac
+--- Python-2.7.3/configure.ac.debug-build 2012-04-18 19:46:22.066498521 -0400
++++ Python-2.7.3/configure.ac 2012-04-18 19:46:22.078498372 -0400
@@ -635,7 +635,7 @@ AC_SUBST(LIBRARY)
AC_MSG_CHECKING(LIBRARY)
if test -z "$LIBRARY"
@@ -75,7 +75,7 @@ diff -up Python-2.7.3/Lib/distutils/sysconfig.py.debug-build
Python-2.7.3/Lib/di
elif os.name == "os2":
@@ -250,7 +251,7 @@ def get_makefile_filename():
if python_build:
- return os.path.join(os.path.dirname(sys.executable), "Makefile")
+ return os.path.join(project_base, "Makefile")
lib_dir = get_python_lib(plat_specific=1, standard_lib=1)
- return os.path.join(lib_dir, "config", "Makefile")
+ return os.path.join(lib_dir, "config" + (sys.pydebug and
"-debug" or ""), "Makefile")
@@ -132,11 +132,11 @@ diff -up Python-2.7.3/Makefile.pre.in.debug-build
Python-2.7.3/Makefile.pre.in
+PYTHON= python$(DEBUG_SUFFIX)$(EXE)
+BUILDPYTHON= python$(DEBUG_SUFFIX)$(BUILDEXE)
- # The task to run while instrument when building the profile-opt target
- PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck
+ PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@
+ _PYTHON_HOST_PLATFORM=@_PYTHON_HOST_PLATFORM@
@@ -413,7 +419,7 @@ sharedmods: $(BUILDPYTHON)
- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)'
./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
- esac
+ $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
+ $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
-libpython$(VERSION).so: $(LIBRARY_OBJS)
+libpython$(VERSION)$(DEBUG_EXT).so: $(LIBRARY_OBJS)
@@ -183,7 +183,7 @@ diff -up Python-2.7.3/Makefile.pre.in.debug-build
Python-2.7.3/Makefile.pre.in
if test -n "$(DLLLIBRARY)" ; then \
$(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
@@ -970,10 +976,11 @@ $(srcdir)/Lib/$(PLATDIR):
- export EXE; EXE="$(BUILDEXE)"; \
+ fi; \
cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen
-python-config: $(srcdir)/Misc/python-config.in
diff --git a/python.spec b/python.spec
index 4d3b299..a24175e 100644
--- a/python.spec
+++ b/python.spec
@@ -105,8 +105,8 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
# Remember to also rebase python-docs when changing this:
-Version: 2.7.3
-Release: 35%{?dist}
+Version: 2.7.4
+Release: 1%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -345,19 +345,8 @@ Patch54: python-2.6.4-setup-db48.patch
# for 2.7rc1 by dmalcolm:
Patch55: 00055-systemtap.patch
-# "lib64 patches"
-# This patch seems to be associated with bug 122304, which was
-#
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=93184...
-# and is now
-#
http://bugs.python.org/issue931848
-# However, as it stands this patch is merely a copy of:
-#
http://svn.python.org/view/python/trunk/Lib/test/test_re.py?r1=35825&...
-# which is already upstream
-# Earlier versions of the patch (from the "dist-pkgs" CVS repo within RH)
-# contained additional changes that applied fixes to the internals of the regex
-# module, but these appear to have all been applied as part of
-#
http://bugs.python.org/issue931848
-Patch101: 00101-lib64-regex.patch
+# Upstream as of Python 2.7.4
+# Patch101: 00101-lib64-regex.patch
# Only used when "%{_lib}" == "lib64"
# Fixup various paths throughout the build and in distutils from "lib" to
"lib64",
@@ -688,14 +677,8 @@ Patch156: 00156-gdb-autoload-safepath.patch
# (rhbz#697470)
Patch157: 00157-uid-gid-overflows.patch
-# 00158 #
-# This patch fixes a memory leak in _hashlib module, as reported in
-# RHBZ #836285; upstream report
http://bugs.python.org/issue15219.
-# The patch has been accepted upstream, so this should be commented out
-# when packaging next upstream release.
-# The fix for Fedora specific "implement_specific_EVP_new()" function
-# has been merged into patch 00146.
-Patch158: 00158-fix-hashlib-leak.patch
+# Upstream as of Python 2.7.4
+# Patch158: 00158-fix-hashlib-leak.patch
# 00159 #
# From F18 on, there is a libdb4 package, that replaces db4. It places header
@@ -782,28 +765,11 @@ Patch169:
00169-avoid-implicit-usage-of-md5-in-multiprocessing.patch
# (rhbz#850013)
Patch170: 00170-gc-assertions.patch
-# 00171 #
-# Fix os.urandom() so that it raises NotImplementedError rather than OSError
-# if /dev/urandom can't be opened (e.g. in some chroots), given that callers
-# such as the random module have handler code expecting NotImplementedError
-# (regression introduced by hash randomization patch)
-#
-# Cherrypick of
http://hg.python.org/cpython/rev/edbf37ace03c/ from upstream
-# (rhbz#907383;
http://bugs.python.org/issue15340)
-Patch171: 00171-raise-correct-exception-when-dev-urandom-is-missing.patch
+# Upstream as of Python 2.7.4
+# Patch171: 00171-raise-correct-exception-when-dev-urandom-is-missing.patch
-# 00172 #
-# Port _multiprocessing.Connection.poll() to use the "poll" syscall, rather
-# than "select", allowing large numbers of subprocesses
-#
-# Based on this sequence of upstream patches to 2.7:
-#
http://hg.python.org/cpython/rev/c5c27b84d7af/
-#
http://hg.python.org/cpython/rev/7cf4ea64f603/
-#
http://hg.python.org/cpython/rev/da5e520a7ba5/
-#
http://hg.python.org/cpython/rev/f07435fa6736/
-#
-#(rhbz#849992;
http://bugs.python.org/issue10527)
-Patch172: 00172-use-poll-for-multiprocessing-socket-connection.patch
+# Upstream as of Python 2.7.4
+# Patch172: 00172-use-poll-for-multiprocessing-socket-connection.patch
# 00173 #
# Workaround for ENOPROTOOPT seen in Koji within
@@ -1080,7 +1046,7 @@ done
%patch54 -p1 -b .setup-db48
-%patch101 -p1 -b .lib64-regex
+# patch101: upstream as of Python 2.7.4
%if "%{_lib}" == "lib64"
%patch102 -p1 -b .lib64
%patch103 -p1 -b .lib64-sysconfig
@@ -1152,7 +1118,7 @@ done
%patch155 -p1
%patch156 -p1
%patch157 -p1
-%patch158 -p1
+# 00158: upstream as of Python 2.7.4
%patch159 -p1 -F 3
# 00160: not for python 2
# 00161: not for python 2 yet
@@ -1166,8 +1132,8 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch168 -p1
%patch169 -p1
%patch170 -p1
-%patch171 -p1 -b .raise-correct-exception-when-dev-urandom-is-missing
-%patch172 -p1
+# 00171: upstream as of Python 2.7.4
+# 00171: upstream as of Python 2.7.4
%patch173 -p1
%patch174 -p1 -b .fix-for-usr-move
%patch175 -p1 -b .fix-configure-Wformat
@@ -2003,6 +1969,19 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Mon Apr 08 2013 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.4-1
+- Updated to Python 2.7.4.
+- Refreshed patches: 0 (config), 7 (sqlite encoding), 16 (rpath in config),
+55 (systemtap), 111 (no static lib), 112 (debug build), 113 (more
+configuration flags), 130 (add extension to python config), 134 (fix
+COUNT_ALLOCS in test_sys), 146 (haslib FIPS), 147 (add debug malloc stats),
+153 (fix gdb test noise), 157 (uid, gid overflow - fixed upstream, just
+keeping few more downstream tests), 165 (crypt module salt backport),
+175 (fix configure Wformat), 5000 (regenerated autotooling patch)
+- Dropped patches: 101 (lib64 regex; merged upstream), 171 (exception on
+missing /dev/urandom; merged upstream), 172 (poll for multiprocessing socket
+connection; merged upstream)
+
* Mon Mar 25 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-35
- fix gcc 4.8 incompatibility (rhbz#927358); regenerate autotool intermediates
commit bc9fa6b8687f901c2aa5436596d3134938f7a3c1
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Mon Mar 25 15:40:44 2013 -0400
2.7.3-35: fix gcc 4.8 incompatibility (rhbz#927358)
* Mon Mar 25 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-35
- fix gcc 4.8 incompatibility (rhbz#927358); regenerate autotool intermediates
diff --git a/00175-fix-configure-Wformat.patch b/00175-fix-configure-Wformat.patch
new file mode 100644
index 0000000..b57208c
--- /dev/null
+++ b/00175-fix-configure-Wformat.patch
@@ -0,0 +1,12 @@
+diff -up Python-2.7.3/configure.in.fix-configure-Wformat Python-2.7.3/configure.in
+--- Python-2.7.3/configure.in.fix-configure-Wformat 2013-03-25 15:15:18.473888383 -0400
++++ Python-2.7.3/configure.in 2013-03-25 15:15:32.513887426 -0400
+@@ -1200,7 +1200,7 @@ if test "$GCC" = "yes"
+ then
+ AC_MSG_CHECKING(whether gcc supports ParseTuple __format__)
+ save_CFLAGS=$CFLAGS
+- CFLAGS="$CFLAGS -Werror"
++ CFLAGS="$CFLAGS -Werror -Wformat"
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([[void f(char*,...)__attribute((format(PyArg_ParseTuple, 1, 2)));]],
[[]])
+ ],[
diff --git a/05000-autotool-intermediates.patch b/05000-autotool-intermediates.patch
index 790cd27..2847d47 100644
--- a/05000-autotool-intermediates.patch
+++ b/05000-autotool-intermediates.patch
@@ -1,6 +1,6 @@
diff -up ./configure.autotool-intermediates ./configure
---- ./configure.autotool-intermediates 2012-04-11 18:35:27.009518662 -0400
-+++ ./configure 2012-04-11 18:35:27.852508123 -0400
+--- ./configure.autotool-intermediates 2013-03-25 15:25:30.438846538 -0400
++++ ./configure 2013-03-25 15:25:32.496846397 -0400
@@ -1,7 +1,7 @@
#! /bin/sh
# From configure.in Revision.
@@ -668,6 +668,15 @@ diff -up ./configure.autotool-intermediates ./configure
$as_echo_n "(cached) " >&6
else
ac_save_cc="$CC"
+@@ -5731,7 +5757,7 @@ then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc supports ParseTuple
__format__" >&5
+ $as_echo_n "checking whether gcc supports ParseTuple __format__... "
>&6; }
+ save_CFLAGS=$CFLAGS
+- CFLAGS="$CFLAGS -Werror"
++ CFLAGS="$CFLAGS -Werror -Wformat"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+
@@ -5770,7 +5796,7 @@ fi
# options before we can check whether -Kpthread improves anything.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads are available
without options" >&5
@@ -1338,7 +1347,7 @@ diff -up ./configure.autotool-intermediates ./configure
$as_echo "#define WITH_THREAD 1" >>confdefs.h
posix_threads=yes
-@@ -8651,7 +8677,7 @@ if test "x$ac_cv_func_pthread_detach" =
+@@ -8651,7 +8677,7 @@ if test "x$ac_cv_func_pthread_detach" =
else
ac_fn_c_check_header_mongrel "$LINENO" "atheos/threads.h"
"ac_cv_header_atheos_threads_h" "$ac_includes_default"
@@ -2690,8 +2699,8 @@ diff -up ./configure.autotool-intermediates ./configure
fi
;;
diff -up ./pyconfig.h.in.autotool-intermediates ./pyconfig.h.in
---- ./pyconfig.h.in.autotool-intermediates 2012-04-11 18:35:27.002518749 -0400
-+++ ./pyconfig.h.in 2012-04-11 18:35:28.133504610 -0400
+--- ./pyconfig.h.in.autotool-intermediates 2013-03-25 15:25:30.435846538 -0400
++++ ./pyconfig.h.in 2013-03-25 15:25:33.030846360 -0400
@@ -18,6 +18,12 @@
/* Define this if you have BeOS threads. */
#undef BEOS_THREADS
diff --git a/python.spec b/python.spec
index 536f2e9..4d3b299 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.3
-Release: 34%{?dist}
+Release: 35%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -819,6 +819,16 @@ Patch173: 00173-workaround-ENOPROTOOPT-in-bind_port.patch
# e.g. cmpi-bindings under systemd (rhbz#817554):
Patch174: 00174-fix-for-usr-move.patch
+# 00175 #
+# Fix for configure.ac mistakenly detecting
+# checking whether gcc supports ParseTuple __format__... yes
+# when it doesn't, when compiling with gcc 4.8
+#
+# Sent upstream as
http://bugs.python.org/issue17547
+# (rhbz#927358)
+Patch175: 00175-fix-configure-Wformat.patch
+
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -1160,6 +1170,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch172 -p1
%patch173 -p1
%patch174 -p1 -b .fix-for-usr-move
+%patch175 -p1 -b .fix-configure-Wformat
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -1992,6 +2003,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Mon Mar 25 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-35
+- fix gcc 4.8 incompatibility (rhbz#927358); regenerate autotool intermediates
+
* Wed Mar 6 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-34
- restrict scope of workaround for cmpi-bindings issue to avoid breaking
in-tree running of test_sys and test_subprocess (rhbz#817554)
commit 1b2a274a94e296f929715acd189bbe6c028861b1
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Wed Mar 6 16:38:05 2013 -0500
2.7.3-34: restrict scope of workaround for cmpi-bindings issue (rhbz#817554)
* Wed Mar 6 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-34
- restrict scope of workaround for cmpi-bindings issue to avoid breaking
in-tree running of test_sys and test_subprocess (rhbz#817554)
diff --git a/00174-fix-for-usr-move.patch b/00174-fix-for-usr-move.patch
index 640986e..b48dc5c 100644
--- a/00174-fix-for-usr-move.patch
+++ b/00174-fix-for-usr-move.patch
@@ -1,6 +1,6 @@
diff -up Python-2.7.3/Modules/getpath.c.fix-for-usr-move Python-2.7.3/Modules/getpath.c
--- Python-2.7.3/Modules/getpath.c.fix-for-usr-move 2013-03-06 14:25:32.801828698 -0500
-+++ Python-2.7.3/Modules/getpath.c 2013-03-06 14:59:05.399691078 -0500
++++ Python-2.7.3/Modules/getpath.c 2013-03-06 15:59:30.872443168 -0500
@@ -510,6 +510,24 @@ calculate_path(void)
MAXPATHLEN bytes long.
*/
@@ -11,7 +11,7 @@ diff -up Python-2.7.3/Modules/getpath.c.fix-for-usr-move
Python-2.7.3/Modules/ge
+ "/lib[64]/python2.7/os.py" via the /lib -> /usr/lib symlink for
+
https://fedoraproject.org/wiki/Features/UsrMove
+ */
-+ if (argv0_path[0] == '\0') {
++ if (argv0_path[0] == '\0' && 0 == strcmp(prog,
"cmpi_swig")) {
+ /*
+ We have an empty argv0_path, presumably because prog aka
+ Py_GetProgramName() was not found on $PATH.
diff --git a/python.spec b/python.spec
index 15081d3..536f2e9 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.3
-Release: 33%{?dist}
+Release: 34%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1992,6 +1992,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Wed Mar 6 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-34
+- restrict scope of workaround for cmpi-bindings issue to avoid breaking
+in-tree running of test_sys and test_subprocess (rhbz#817554)
+
* Wed Mar 6 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-33
- add workaround for cmpi-bindings issue (rhbz#817554)
commit 4e8ad3c0992c75b72400b3a99c7886d275142ebc
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Wed Mar 6 15:03:56 2013 -0500
2.7.3-33: add workaround for cmpi-bindings issue (rhbz#817554)
* Wed Mar 6 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-33
- add workaround for cmpi-bindings issue (rhbz#817554)
diff --git a/00174-fix-for-usr-move.patch b/00174-fix-for-usr-move.patch
new file mode 100644
index 0000000..640986e
--- /dev/null
+++ b/00174-fix-for-usr-move.patch
@@ -0,0 +1,28 @@
+diff -up Python-2.7.3/Modules/getpath.c.fix-for-usr-move Python-2.7.3/Modules/getpath.c
+--- Python-2.7.3/Modules/getpath.c.fix-for-usr-move 2013-03-06 14:25:32.801828698 -0500
++++ Python-2.7.3/Modules/getpath.c 2013-03-06 14:59:05.399691078 -0500
+@@ -510,6 +510,24 @@ calculate_path(void)
+ MAXPATHLEN bytes long.
+ */
+
++ /*
++ Workaround for rhbz#817554, where an empty argv0_path erroneously
++ locates "prefix" as "/lib[64]/python2.7" due to it finding
++ "/lib[64]/python2.7/os.py" via the /lib -> /usr/lib symlink for
++
https://fedoraproject.org/wiki/Features/UsrMove
++ */
++ if (argv0_path[0] == '\0') {
++ /*
++ We have an empty argv0_path, presumably because prog aka
++ Py_GetProgramName() was not found on $PATH.
++
++ Set argv0_path to "/usr/" so that search_for_prefix() and
++ search_for_exec_prefix() don't erroneously pick up
++ on /lib/ via the UsrMove symlink:
++ */
++ strcpy(argv0_path, "/usr/");
++ }
++
+ if (!(pfound = search_for_prefix(argv0_path, home))) {
+ if (!Py_FrozenFlag)
+ fprintf(stderr,
diff --git a/python.spec b/python.spec
index 2514b6d..15081d3 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.3
-Release: 32%{?dist}
+Release: 33%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -811,6 +811,14 @@ Patch172: 00172-use-poll-for-multiprocessing-socket-connection.patch
# (rhbz#913732)
Patch173: 00173-workaround-ENOPROTOOPT-in-bind_port.patch
+# 00174 #
+# Workaround for failure to set up prefix/exec_prefix when running
+# an embededed libpython that sets Py_SetProgramName() to a name not
+# on $PATH when run from the root directory due to
+#
https://fedoraproject.org/wiki/Features/UsrMove
+# e.g. cmpi-bindings under systemd (rhbz#817554):
+Patch174: 00174-fix-for-usr-move.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -1151,6 +1159,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch171 -p1 -b .raise-correct-exception-when-dev-urandom-is-missing
%patch172 -p1
%patch173 -p1
+%patch174 -p1 -b .fix-for-usr-move
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -1983,6 +1992,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Wed Mar 6 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-33
+- add workaround for cmpi-bindings issue (rhbz#817554)
+
* Mon Mar 4 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-32
- add workaround for ENOPROTOOPT seen running selftests in Koji
(rhbz#913732)
commit d542bae2c2089f4a13f6aca59f0ea962997db1cf
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Mon Mar 4 16:18:16 2013 -0500
2.7.3-32: add workaround for ENOPROTOOPT seen running selftests in Koji (rhbz#913732)
* Mon Mar 4 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-32
- add workaround for ENOPROTOOPT seen running selftests in Koji
(rhbz#913732)
diff --git a/00173-workaround-ENOPROTOOPT-in-bind_port.patch
b/00173-workaround-ENOPROTOOPT-in-bind_port.patch
new file mode 100644
index 0000000..eb34610
--- /dev/null
+++ b/00173-workaround-ENOPROTOOPT-in-bind_port.patch
@@ -0,0 +1,13 @@
+diff -up Python-2.7.3/Lib/test/test_support.py.rhbz913732
Python-2.7.3/Lib/test/test_support.py
+--- Python-2.7.3/Lib/test/test_support.py.rhbz913732 2013-03-04 16:11:53.757315921 -0500
++++ Python-2.7.3/Lib/test/test_support.py 2013-03-04 16:12:11.331314722 -0500
+@@ -304,7 +304,8 @@ def bind_port(sock, host=HOST):
+ if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR) == 1:
+ raise TestFailed("tests should never set the SO_REUSEADDR "
\
+ "socket option on TCP/IP sockets!")
+- if hasattr(socket, 'SO_REUSEPORT'):
++ if hasattr(socket, 'SO_REUSEPORT') \
++ and 'WITHIN_PYTHON_RPM_BUILD' not in os.environ: # rhbz#913732
+ if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) == 1:
+ raise TestFailed("tests should never set the SO_REUSEPORT "
\
+ "socket option on TCP/IP sockets!")
diff --git a/python.spec b/python.spec
index 8db914d..2514b6d 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.3
-Release: 31%{?dist}
+Release: 32%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -805,6 +805,11 @@ Patch171:
00171-raise-correct-exception-when-dev-urandom-is-missing.patch
#(rhbz#849992;
http://bugs.python.org/issue10527)
Patch172: 00172-use-poll-for-multiprocessing-socket-connection.patch
+# 00173 #
+# Workaround for ENOPROTOOPT seen in Koji within
+# test.test_support.bind_port()
+# (rhbz#913732)
+Patch173: 00173-workaround-ENOPROTOOPT-in-bind_port.patch
# (New patches go here ^^^)
#
@@ -1145,6 +1150,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch170 -p1
%patch171 -p1 -b .raise-correct-exception-when-dev-urandom-is-missing
%patch172 -p1
+%patch173 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -1977,6 +1983,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Mon Mar 4 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-32
+- add workaround for ENOPROTOOPT seen running selftests in Koji
+(rhbz#913732)
+
* Mon Mar 4 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-31
- remove config flag from /etc/rpm/macros.python2
commit 6b3f9096ed22808ce42d190a8d87e03560fd8564
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Sun Mar 3 20:01:53 2013 -0500
2.7.3-31: remove config flag from /etc/rpm/macros.python2
See
https://fedorahosted.org/fpc/ticket/259
diff --git a/python.spec b/python.spec
index d85b481..8db914d 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.3
-Release: 30%{?dist}
+Release: 31%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1796,7 +1796,7 @@ rm -fr %{buildroot}
%endif
%{_bindir}/python%{pybasever}-config
%{_libdir}/libpython%{pybasever}.so
-%config(noreplace) %{_sysconfdir}/rpm/macros.python2
+%{_sysconfdir}/rpm/macros.python2
%files tools
%defattr(-,root,root,755)
@@ -1977,6 +1977,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Mon Mar 4 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-31
+- remove config flag from /etc/rpm/macros.python2
+
* Fri Feb 22 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-30
- remove __debug_package macro from comment
commit 4ad35ac4a756addbc69efa81e23fecf1c8800182
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Fri Feb 22 13:36:34 2013 -0500
2.7.3-30: remove __debug_package macro from comment
* Fri Feb 22 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-30
- remove __debug_package macro from comment
diff --git a/python.spec b/python.spec
index 26e8549..d85b481 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.3
-Release: 29%{?dist}
+Release: 30%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1961,7 +1961,7 @@ rm -fr %{buildroot}
# We put the debug-gdb.py file inside /usr/lib/debug to avoid noise from
# ldconfig (rhbz:562980).
#
-# The /usr/lib/rpm/redhat/macros defines %__debug_package to use
+# The /usr/lib/rpm/redhat/macros defines the __debug_package macro to use
# debugfiles.list, and it appears that everything below /usr/lib/debug and
# (/usr/src/debug) gets added to this file (via LISTFILES) in
# /usr/lib/rpm/find-debuginfo.sh
@@ -1977,6 +1977,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Fri Feb 22 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-30
+- remove __debug_package macro from comment
+
* Fri Feb 22 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-29
- drop -b from application of patch 157 (uid/gid overflows)
commit 899afa849cc03da42a374d54cf49da52bf49cee4
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Fri Feb 22 13:03:09 2013 -0500
2.7.3-29: drop -b from application of patch 157 (uid/gid overflows)
* Fri Feb 22 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-29
- drop -b from application of patch 157 (uid/gid overflows)
diff --git a/python.spec b/python.spec
index 33e40e7..26e8549 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.3
-Release: 28%{?dist}
+Release: 29%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1128,7 +1128,7 @@ done
# 00154: not for python 2
%patch155 -p1
%patch156 -p1
-%patch157 -p1 -b .uid-gid-overflows
+%patch157 -p1
%patch158 -p1
%patch159 -p1 -F 3
# 00160: not for python 2
@@ -1977,6 +1977,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Fri Feb 22 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-29
+- drop -b from application of patch 157 (uid/gid overflows)
+
* Fri Feb 22 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-28
- fix bogus dates in changelog
commit 169b37d778d60b65930c4f3731381e7265cc11f0
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Fri Feb 22 12:10:58 2013 -0500
2.7.3-28: fix bogus dates in changelog
* Fri Feb 22 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-28
- fix bogus dates in changelog
rpm was emitting:
warning: bogus date in %changelog: Wed Jun 7 2003 Mihai Ibanescu
<misa(a)redhat.com> 2.2.3-2
warning: bogus date in %changelog: Tue Jun 6 2003 Mihai Ibanescu
<misa(a)redhat.com> 2.2.3-1
Note that commit bfd896bfafe7f37df3d96189fde31bec50ba0cae has:
Author: cvsdist <cvsdist(a)fedoraproject.org>
Date: Thu Sep 9 11:03:21 2004 +0000
auto-import changelog data from python-2.2.3-7.src.rpm
[...snip...]
Sat Jun 07 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.3-2
- Rebuilt
Fri Jun 06 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.3-1
- Upgraded to 2.2.3
and:
$ python -c "from datetime import *; d1 = date(2003, 6, 7);
print(d1.isoformat()); print(d1.isoweekday())"
2003-06-07
6
where isoweekday 6 is indeed Saturday
diff --git a/python.spec b/python.spec
index 71ddbfd..33e40e7 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.3
-Release: 27%{?dist}
+Release: 28%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1977,6 +1977,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Fri Feb 22 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-28
+- fix bogus dates in changelog
+
* Thu Feb 21 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-27
- port _multiprocessing.Connection.poll() to use the "poll" syscall, rather
than "select", allowing large numbers of subprocesses (patch 172;
@@ -2938,10 +2941,10 @@ directories (bug 531901)
* Mon Jun 9 2003 Elliot Lee <sopwith(a)redhat.com> 2.2.3-3
- rebuilt
-* Wed Jun 7 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.3-2
+* Sat Jun 7 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.3-2
- Rebuilt
-* Tue Jun 6 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.3-1
+* Fri Jun 6 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.3-1
- Upgraded to 2.2.3
* Wed Apr 2 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-28
commit 2938c661975c582a54dca69a7dc212f12673afa8
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Thu Feb 21 17:11:13 2013 -0500
2.7.3-27: port _multiprocessing.Connection to use the "poll" syscall (patch
172; rhbz#849992)
* Thu Feb 21 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-27
- port _multiprocessing.Connection.poll() to use the "poll" syscall, rather
than "select", allowing large numbers of subprocesses (patch 172;
rhbz#849992)
diff --git a/00172-use-poll-for-multiprocessing-socket-connection.patch
b/00172-use-poll-for-multiprocessing-socket-connection.patch
new file mode 100644
index 0000000..5b2f626
--- /dev/null
+++ b/00172-use-poll-for-multiprocessing-socket-connection.patch
@@ -0,0 +1,87 @@
+diff -up
Python-2.7.3/Doc/library/asyncore.rst.use-poll-for-multiprocessing-socket-connection
Python-2.7.3/Doc/library/asyncore.rst
+---
Python-2.7.3/Doc/library/asyncore.rst.use-poll-for-multiprocessing-socket-connection 2013-02-21
15:21:41.204812979 -0500
++++ Python-2.7.3/Doc/library/asyncore.rst 2013-02-21 15:21:41.211812976 -0500
+@@ -318,13 +318,10 @@ connections and dispatches the incoming
+
+ def handle_accept(self):
+ pair = self.accept()
+- if pair is None:
+- pass
+- else:
++ if pair is not None:
+ sock, addr = pair
+ print 'Incoming connection from %s' % repr(addr)
+ handler = EchoHandler(sock)
+
+ server = EchoServer('localhost', 8080)
+ asyncore.loop()
+-
+diff -up
Python-2.7.3/Lib/multiprocessing/connection.py.use-poll-for-multiprocessing-socket-connection
Python-2.7.3/Lib/multiprocessing/connection.py
+diff -up
Python-2.7.3/Lib/test/test_multiprocessing.py.use-poll-for-multiprocessing-socket-connection
Python-2.7.3/Lib/test/test_multiprocessing.py
+---
Python-2.7.3/Lib/test/test_multiprocessing.py.use-poll-for-multiprocessing-socket-connection 2013-02-21
15:21:41.199812979 -0500
++++ Python-2.7.3/Lib/test/test_multiprocessing.py 2013-02-21 15:21:41.208812978 -0500
+@@ -1452,6 +1452,7 @@ class _TestConnection(BaseTestCase):
+ self.assertTimingAlmostEqual(poll.elapsed, TIMEOUT1)
+
+ conn.send(None)
++ time.sleep(.1)
+
+ self.assertEqual(poll(TIMEOUT1), True)
+ self.assertTimingAlmostEqual(poll.elapsed, 0)
+diff -up
Python-2.7.3/Modules/_multiprocessing/socket_connection.c.use-poll-for-multiprocessing-socket-connection
Python-2.7.3/Modules/_multiprocessing/socket_connection.c
+---
Python-2.7.3/Modules/_multiprocessing/socket_connection.c.use-poll-for-multiprocessing-socket-connection 2013-02-21
15:21:41.201812979 -0500
++++ Python-2.7.3/Modules/_multiprocessing/socket_connection.c 2013-02-21
15:21:41.215812978 -0500
+@@ -8,6 +8,10 @@
+
+ #include "multiprocessing.h"
+
++#if defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)
++# include "poll.h"
++#endif
++
+ #ifdef MS_WINDOWS
+ # define WRITE(h, buffer, length) send((SOCKET)h, buffer, length, 0)
+ # define READ(h, buffer, length) recv((SOCKET)h, buffer, length, 0)
+@@ -155,6 +159,34 @@ conn_recv_string(ConnectionObject *conn,
+ static int
+ conn_poll(ConnectionObject *conn, double timeout, PyThreadState *_save)
+ {
++#if defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)
++ int res;
++ struct pollfd p;
++
++ p.fd = (int)conn->handle;
++ p.events = POLLIN | POLLPRI;
++ p.revents = 0;
++
++ if (timeout < 0) {
++ res = poll(&p, 1, -1);
++ } else {
++ res = poll(&p, 1, (int)(timeout * 1000 + 0.5));
++ }
++
++ if (res < 0) {
++ return MP_SOCKET_ERROR;
++ } else if (p.revents & (POLLNVAL|POLLERR)) {
++ Py_BLOCK_THREADS
++ PyErr_SetString(PyExc_IOError, "poll() gave POLLNVAL or POLLERR");
++ Py_UNBLOCK_THREADS
++ return MP_EXCEPTION_HAS_BEEN_SET;
++ } else if (p.revents != 0) {
++ return TRUE;
++ } else {
++ assert(res == 0);
++ return FALSE;
++ }
++#else
+ int res;
+ fd_set rfds;
+
+@@ -190,6 +222,7 @@ conn_poll(ConnectionObject *conn, double
+ assert(res == 0);
+ return FALSE;
+ }
++#endif
+ }
+
+ /*
diff --git a/python.spec b/python.spec
index 1309c89..71ddbfd 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.3
-Release: 26%{?dist}
+Release: 27%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -792,6 +792,20 @@ Patch170: 00170-gc-assertions.patch
# (rhbz#907383;
http://bugs.python.org/issue15340)
Patch171: 00171-raise-correct-exception-when-dev-urandom-is-missing.patch
+# 00172 #
+# Port _multiprocessing.Connection.poll() to use the "poll" syscall, rather
+# than "select", allowing large numbers of subprocesses
+#
+# Based on this sequence of upstream patches to 2.7:
+#
http://hg.python.org/cpython/rev/c5c27b84d7af/
+#
http://hg.python.org/cpython/rev/7cf4ea64f603/
+#
http://hg.python.org/cpython/rev/da5e520a7ba5/
+#
http://hg.python.org/cpython/rev/f07435fa6736/
+#
+#(rhbz#849992;
http://bugs.python.org/issue10527)
+Patch172: 00172-use-poll-for-multiprocessing-socket-connection.patch
+
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -1130,6 +1144,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch169 -p1
%patch170 -p1
%patch171 -p1 -b .raise-correct-exception-when-dev-urandom-is-missing
+%patch172 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -1962,6 +1977,11 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu Feb 21 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-27
+- port _multiprocessing.Connection.poll() to use the "poll" syscall, rather
+than "select", allowing large numbers of subprocesses (patch 172;
+rhbz#849992)
+
* Thu Feb 21 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-26
- raise correct exception in os.urandom() when /dev/urandom is missing
(patch 171; rhbz#907383)
commit c9c381fa337e2c08191acdb9600b530864023214
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Thu Feb 21 14:44:28 2013 -0500
2.7.3-26: raise correct exception in os.urandom() when /dev/urandom is missing (patch
171; rhbz#907383)
* Thu Feb 21 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-26
- raise correct exception in os.urandom() when /dev/urandom is missing
(patch 171; rhbz#907383)
diff --git a/00171-raise-correct-exception-when-dev-urandom-is-missing.patch
b/00171-raise-correct-exception-when-dev-urandom-is-missing.patch
new file mode 100644
index 0000000..1b26e51
--- /dev/null
+++ b/00171-raise-correct-exception-when-dev-urandom-is-missing.patch
@@ -0,0 +1,14 @@
+diff -up Python-2.7.3/Misc/NEWS.raise-correct-exception-when-dev-urandom-is-missing
Python-2.7.3/Misc/NEWS
+diff -up Python-2.7.3/Python/random.c.raise-correct-exception-when-dev-urandom-is-missing
Python-2.7.3/Python/random.c
+---
Python-2.7.3/Python/random.c.raise-correct-exception-when-dev-urandom-is-missing 2012-04-09
19:07:35.000000000 -0400
++++ Python-2.7.3/Python/random.c 2013-02-21 14:39:01.020988043 -0500
+@@ -165,7 +165,8 @@ dev_urandom_python(char *buffer, Py_ssiz
+ Py_END_ALLOW_THREADS
+ if (fd < 0)
+ {
+- PyErr_SetFromErrnoWithFilename(PyExc_OSError, "/dev/urandom");
++ PyErr_SetString(PyExc_NotImplementedError,
++ "/dev/urandom (or equivalent) not found");
+ return -1;
+ }
+
diff --git a/python.spec b/python.spec
index 29f1547..1309c89 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.3
-Release: 25%{?dist}
+Release: 26%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -782,6 +782,16 @@ Patch169: 00169-avoid-implicit-usage-of-md5-in-multiprocessing.patch
# (rhbz#850013)
Patch170: 00170-gc-assertions.patch
+# 00171 #
+# Fix os.urandom() so that it raises NotImplementedError rather than OSError
+# if /dev/urandom can't be opened (e.g. in some chroots), given that callers
+# such as the random module have handler code expecting NotImplementedError
+# (regression introduced by hash randomization patch)
+#
+# Cherrypick of
http://hg.python.org/cpython/rev/edbf37ace03c/ from upstream
+# (rhbz#907383;
http://bugs.python.org/issue15340)
+Patch171: 00171-raise-correct-exception-when-dev-urandom-is-missing.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -1119,6 +1129,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch168 -p1
%patch169 -p1
%patch170 -p1
+%patch171 -p1 -b .raise-correct-exception-when-dev-urandom-is-missing
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -1951,6 +1962,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu Feb 21 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-26
+- raise correct exception in os.urandom() when /dev/urandom is missing
+(patch 171; rhbz#907383)
+
* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-25
- in debug builds, try to print repr() when a C-level assert fails in the
garbage collector (typically indicating a reference-counting error somewhere
commit 6a2708e308b57d4ed37dd4dba9ed6944b2229927
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Wed Feb 20 16:45:56 2013 -0500
2.7.3-25: in debug builds, try to print repr() when a C-level assert fails in the
garbage collector (patch 170; rhbz#850013)
* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-25
- in debug builds, try to print repr() when a C-level assert fails in the
garbage collector (typically indicating a reference-counting error somewhere
else e.g in an extension module) (patch 170; rhbz#850013)
diff --git a/00170-gc-assertions.patch b/00170-gc-assertions.patch
new file mode 100644
index 0000000..088f84d
--- /dev/null
+++ b/00170-gc-assertions.patch
@@ -0,0 +1,276 @@
+diff -up Python-2.7.3/Lib/test/test_gc.py.gc-assertions Python-2.7.3/Lib/test/test_gc.py
+--- Python-2.7.3/Lib/test/test_gc.py.gc-assertions 2013-02-20 16:28:20.890536607 -0500
++++ Python-2.7.3/Lib/test/test_gc.py 2013-02-20 16:39:52.720489297 -0500
+@@ -1,6 +1,7 @@
+ import unittest
+-from test.test_support import verbose, run_unittest
++from test.test_support import verbose, run_unittest, import_module
+ import sys
++import sysconfig
+ import gc
+ import weakref
+
+@@ -32,6 +33,8 @@ class GC_Detector(object):
+ self.wr = weakref.ref(C1055820(666), it_happened)
+
+
++BUILT_WITH_NDEBUG = ('-DNDEBUG' in
sysconfig.get_config_vars()['PY_CFLAGS'])
++
+ ### Tests
+ ###############################################################################
+
+@@ -476,6 +479,49 @@ class GCTests(unittest.TestCase):
+ # would be damaged, with an empty __dict__.
+ self.assertEqual(x, None)
+
++ @unittest.skipIf(BUILT_WITH_NDEBUG,
++ 'built with -NDEBUG')
++ def test_refcount_errors(self):
++ # Verify the "handling" of objects with broken refcounts
++
++ import_module("ctypes") #skip if not supported
++
++ import subprocess
++ code = '''if 1:
++ a = []
++ b = [a]
++
++ # Simulate the refcount of "a" being too low (compared to the
++ # references held on it by live data), but keeping it above zero
++ # (to avoid deallocating it):
++ import ctypes
++ ctypes.pythonapi.Py_DecRef(ctypes.py_object(a))
++
++ # The garbage collector should now have a fatal error when it reaches
++ # the broken object:
++ import gc
++ gc.collect()
++ '''
++ p = subprocess.Popen([sys.executable, "-c", code],
++ stdout=subprocess.PIPE,
++ stderr=subprocess.PIPE)
++ stdout, stderr = p.communicate()
++ p.stdout.close()
++ p.stderr.close()
++ # Verify that stderr has a useful error message:
++ self.assertRegexpMatches(stderr,
++ b'Modules/gcmodule.c:[0-9]+: visit_decref: Assertion
"gc->gc.gc_refs != 0" failed.')
++ self.assertRegexpMatches(stderr,
++ b'refcount was too small')
++ self.assertRegexpMatches(stderr,
++ b'object : \[\]')
++ self.assertRegexpMatches(stderr,
++ b'type : list')
++ self.assertRegexpMatches(stderr,
++ b'refcount: 1')
++ self.assertRegexpMatches(stderr,
++ b'address : 0x[0-9a-f]+')
++
+ class GCTogglingTests(unittest.TestCase):
+ def setUp(self):
+ gc.enable()
+diff -up Python-2.7.3/Modules/gcmodule.c.gc-assertions Python-2.7.3/Modules/gcmodule.c
+--- Python-2.7.3/Modules/gcmodule.c.gc-assertions 2012-04-09 19:07:34.000000000 -0400
++++ Python-2.7.3/Modules/gcmodule.c 2013-02-20 16:28:21.029536600 -0500
+@@ -21,6 +21,73 @@
+ #include "Python.h"
+ #include "frameobject.h" /* for PyFrame_ClearFreeList */
+
++/*
++ Define a pair of assertion macros.
++
++ These work like the regular C assert(), in that they will abort the
++ process with a message on stderr if the given condition fails to hold,
++ but compile away to nothing if NDEBUG is defined.
++
++ However, before aborting, Python will also try to call _PyObject_Dump() on
++ the given object. This may be of use when investigating bugs in which a
++ particular object is corrupt (e.g. buggy a tp_visit method in an extension
++ module breaking the garbage collector), to help locate the broken objects.
++
++ The WITH_MSG variant allows you to supply an additional message that Python
++ will attempt to print to stderr, after the object dump.
++*/
++#ifdef NDEBUG
++/* No debugging: compile away the assertions: */
++#define PyObject_ASSERT_WITH_MSG(obj, expr, msg) ((void)0)
++#else
++/* With debugging: generate checks: */
++#define PyObject_ASSERT_WITH_MSG(obj, expr, msg) \
++ ((expr) \
++ ? (void)(0) \
++ : _PyObject_AssertFailed((obj), \
++ (msg), \
++ (__STRING(expr)), \
++ (__FILE__), \
++ (__LINE__), \
++ (__PRETTY_FUNCTION__)))
++#endif
++
++#define PyObject_ASSERT(obj, expr) \
++ PyObject_ASSERT_WITH_MSG(obj, expr, NULL)
++
++static void _PyObject_AssertFailed(PyObject *, const char *,
++ const char *, const char *, int,
++ const char *);
++
++static void
++_PyObject_AssertFailed(PyObject *obj, const char *msg, const char *expr,
++ const char *file, int line, const char *function)
++{
++ fprintf(stderr,
++ "%s:%d: %s: Assertion \"%s\" failed.\n",
++ file, line, function, expr);
++ if (msg) {
++ fprintf(stderr, "%s\n", msg);
++ }
++
++ fflush(stderr);
++
++ if (obj) {
++ /* This might succeed or fail, but we're about to abort, so at least
++ try to provide any extra info we can: */
++ _PyObject_Dump(obj);
++ }
++ else {
++ fprintf(stderr, "NULL object\n");
++ }
++
++ fflush(stdout);
++ fflush(stderr);
++
++ /* Terminate the process: */
++ abort();
++}
++
+ /* Get an object's GC head */
+ #define AS_GC(o) ((PyGC_Head *)(o)-1)
+
+@@ -288,7 +355,8 @@ update_refs(PyGC_Head *containers)
+ {
+ PyGC_Head *gc = containers->gc.gc_next;
+ for (; gc != containers; gc = gc->gc.gc_next) {
+- assert(gc->gc.gc_refs == GC_REACHABLE);
++ PyObject_ASSERT(FROM_GC(gc),
++ gc->gc.gc_refs == GC_REACHABLE);
+ gc->gc.gc_refs = Py_REFCNT(FROM_GC(gc));
+ /* Python's cyclic gc should never see an incoming refcount
+ * of 0: if something decref'ed to 0, it should have been
+@@ -308,7 +376,8 @@ update_refs(PyGC_Head *containers)
+ * so serious that maybe this should be a release-build
+ * check instead of an assert?
+ */
+- assert(gc->gc.gc_refs != 0);
++ PyObject_ASSERT(FROM_GC(gc),
++ gc->gc.gc_refs != 0);
+ }
+ }
+
+@@ -323,7 +392,9 @@ visit_decref(PyObject *op, void *data)
+ * generation being collected, which can be recognized
+ * because only they have positive gc_refs.
+ */
+- assert(gc->gc.gc_refs != 0); /* else refcount was too small */
++ PyObject_ASSERT_WITH_MSG(FROM_GC(gc),
++ gc->gc.gc_refs != 0,
++ "refcount was too small");
+ if (gc->gc.gc_refs > 0)
+ gc->gc.gc_refs--;
+ }
+@@ -383,9 +454,10 @@ visit_reachable(PyObject *op, PyGC_Head
+ * If gc_refs == GC_UNTRACKED, it must be ignored.
+ */
+ else {
+- assert(gc_refs > 0
+- || gc_refs == GC_REACHABLE
+- || gc_refs == GC_UNTRACKED);
++ PyObject_ASSERT(FROM_GC(gc),
++ gc_refs > 0
++ || gc_refs == GC_REACHABLE
++ || gc_refs == GC_UNTRACKED);
+ }
+ }
+ return 0;
+@@ -427,7 +499,7 @@ move_unreachable(PyGC_Head *young, PyGC_
+ */
+ PyObject *op = FROM_GC(gc);
+ traverseproc traverse = Py_TYPE(op)->tp_traverse;
+- assert(gc->gc.gc_refs > 0);
++ PyObject_ASSERT(op, gc->gc.gc_refs > 0);
+ gc->gc.gc_refs = GC_REACHABLE;
+ (void) traverse(op,
+ (visitproc)visit_reachable,
+@@ -494,7 +566,8 @@ move_finalizers(PyGC_Head *unreachable,
+ for (gc = unreachable->gc.gc_next; gc != unreachable; gc = next) {
+ PyObject *op = FROM_GC(gc);
+
+- assert(IS_TENTATIVELY_UNREACHABLE(op));
++ PyObject_ASSERT(op, IS_TENTATIVELY_UNREACHABLE(op));
++
+ next = gc->gc.gc_next;
+
+ if (has_finalizer(op)) {
+@@ -570,7 +643,7 @@ handle_weakrefs(PyGC_Head *unreachable,
+ PyWeakReference **wrlist;
+
+ op = FROM_GC(gc);
+- assert(IS_TENTATIVELY_UNREACHABLE(op));
++ PyObject_ASSERT(op, IS_TENTATIVELY_UNREACHABLE(op));
+ next = gc->gc.gc_next;
+
+ if (! PyType_SUPPORTS_WEAKREFS(Py_TYPE(op)))
+@@ -591,9 +664,9 @@ handle_weakrefs(PyGC_Head *unreachable,
+ * the callback pointer intact. Obscure: it also
+ * changes *wrlist.
+ */
+- assert(wr->wr_object == op);
++ PyObject_ASSERT(wr->wr_object, wr->wr_object == op);
+ _PyWeakref_ClearRef(wr);
+- assert(wr->wr_object == Py_None);
++ PyObject_ASSERT(wr->wr_object, wr->wr_object == Py_None);
+ if (wr->wr_callback == NULL)
+ continue; /* no callback */
+
+@@ -627,7 +700,7 @@ handle_weakrefs(PyGC_Head *unreachable,
+ */
+ if (IS_TENTATIVELY_UNREACHABLE(wr))
+ continue;
+- assert(IS_REACHABLE(wr));
++ PyObject_ASSERT(op, IS_REACHABLE(wr));
+
+ /* Create a new reference so that wr can't go away
+ * before we can process it again.
+@@ -636,7 +709,8 @@ handle_weakrefs(PyGC_Head *unreachable,
+
+ /* Move wr to wrcb_to_call, for the next pass. */
+ wrasgc = AS_GC(wr);
+- assert(wrasgc != next); /* wrasgc is reachable, but
++ PyObject_ASSERT(op, wrasgc != next);
++ /* wrasgc is reachable, but
+ next isn't, so they can't
+ be the same */
+ gc_list_move(wrasgc, &wrcb_to_call);
+@@ -652,11 +726,11 @@ handle_weakrefs(PyGC_Head *unreachable,
+
+ gc = wrcb_to_call.gc.gc_next;
+ op = FROM_GC(gc);
+- assert(IS_REACHABLE(op));
+- assert(PyWeakref_Check(op));
++ PyObject_ASSERT(op, IS_REACHABLE(op));
++ PyObject_ASSERT(op, PyWeakref_Check(op));
+ wr = (PyWeakReference *)op;
+ callback = wr->wr_callback;
+- assert(callback != NULL);
++ PyObject_ASSERT(op, callback != NULL);
+
+ /* copy-paste of weakrefobject.c's handle_callback() */
+ temp = PyObject_CallFunctionObjArgs(callback, wr, NULL);
+@@ -759,7 +833,7 @@ delete_garbage(PyGC_Head *collectable, P
+ PyGC_Head *gc = collectable->gc.gc_next;
+ PyObject *op = FROM_GC(gc);
+
+- assert(IS_TENTATIVELY_UNREACHABLE(op));
++ PyObject_ASSERT(op, IS_TENTATIVELY_UNREACHABLE(op));
+ if (debug & DEBUG_SAVEALL) {
+ PyList_Append(garbage, op);
+ }
diff --git a/python.spec b/python.spec
index f7b4dac..29f1547 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.3
-Release: 24%{?dist}
+Release: 25%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -771,6 +771,17 @@ Patch168: 00168-distutils-cflags.patch
# (rhbz#879695)
Patch169: 00169-avoid-implicit-usage-of-md5-in-multiprocessing.patch
+# 00170 #
+# In debug builds, try to print repr() when a C-level assert fails in the
+# garbage collector (typically indicating a reference-counting error
+# somewhere else e.g in an extension module)
+# Backported to 2.7 from a patch I sent upstream for py3k
+#
http://bugs.python.org/issue9263 (rhbz#614680)
+# hiding the proposed new macros/functions within gcmodule.c to avoid exposing
+# them within the extension API.
+# (rhbz#850013)
+Patch170: 00170-gc-assertions.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -1107,6 +1118,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch167 -p1
%patch168 -p1
%patch169 -p1
+%patch170 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -1939,6 +1951,11 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-25
+- in debug builds, try to print repr() when a C-level assert fails in the
+garbage collector (typically indicating a reference-counting error somewhere
+else e.g in an extension module) (patch 170; rhbz#850013)
+
* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-24
- move lib2to3/tests from python-libs to python-test (rhbz#850056)
commit 8b819675253e8c45dd1b877d705c1eae2ed9e76b
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Wed Feb 20 15:50:47 2013 -0500
2.7.3-24: move lib2to3/tests from python-libs to python-test (rhbz#850056)
* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-24
- move lib2to3/tests from python-libs to python-test (rhbz#850056)
diff --git a/python.spec b/python.spec
index 2873931..f7b4dac 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.3
-Release: 23%{?dist}
+Release: 24%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1709,6 +1709,7 @@ rm -fr %{buildroot}
%dir %{pylibdir}/json
%{pylibdir}/json/*.py*
%{pylibdir}/lib2to3
+%exclude %{pylibdir}/lib2to3/tests
%{pylibdir}/logging
%{pylibdir}/multiprocessing
%{pylibdir}/plat-linux2
@@ -1785,6 +1786,7 @@ rm -fr %{buildroot}
%{pylibdir}/distutils/tests
%{pylibdir}/email/test
%{pylibdir}/json/tests
+%{pylibdir}/lib2to3/tests
%{pylibdir}/sqlite3/test
%{pylibdir}/test/*
# These two are shipped in the main subpackage:
@@ -1937,6 +1939,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-24
+- move lib2to3/tests from python-libs to python-test (rhbz#850056)
+
* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-23
- use SHA-256 rather than implicitly using MD5 within the challenge handling
in multiprocessing.connection (patch 169; rhbz#879695)
commit 41aa0d34f7037b69d9a615cfb8d36a3ebccecf4b
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Wed Feb 20 15:25:17 2013 -0500
2.7.3-23: use SHA-256 rather than MD5 in multiprocessing.connection (patch 169;
rhbz#879695)
* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-23
- use SHA-256 rather than implicitly using MD5 within the challenge handling
in multiprocessing.connection (patch 169; rhbz#879695)
diff --git a/00169-avoid-implicit-usage-of-md5-in-multiprocessing.patch
b/00169-avoid-implicit-usage-of-md5-in-multiprocessing.patch
new file mode 100644
index 0000000..debf92f
--- /dev/null
+++ b/00169-avoid-implicit-usage-of-md5-in-multiprocessing.patch
@@ -0,0 +1,41 @@
+diff --git a/Lib/multiprocessing/connection.py b/Lib/multiprocessing/connection.py
+--- a/Lib/multiprocessing/connection.py
++++ b/Lib/multiprocessing/connection.py
+@@ -41,6 +41,10 @@
+ # A very generous timeout when it comes to local connections...
+ CONNECTION_TIMEOUT = 20.
+
++# The hmac module implicitly defaults to using MD5.
++# Support using a stronger algorithm for the challenge/response code:
++HMAC_DIGEST_NAME='sha256'
++
+ _mmap_counter = itertools.count()
+
+ default_family = 'AF_INET'
+@@ -700,12 +704,16 @@
+ WELCOME = b'#WELCOME#'
+ FAILURE = b'#FAILURE#'
+
++def get_digestmod_for_hmac():
++ import hashlib
++ return getattr(hashlib, HMAC_DIGEST_NAME)
++
+ def deliver_challenge(connection, authkey):
+ import hmac
+ assert isinstance(authkey, bytes)
+ message = os.urandom(MESSAGE_LENGTH)
+ connection.send_bytes(CHALLENGE + message)
+- digest = hmac.new(authkey, message).digest()
++ digest = hmac.new(authkey, message, get_digestmod_for_hmac()).digest()
+ response = connection.recv_bytes(256) # reject large message
+ if response == digest:
+ connection.send_bytes(WELCOME)
+@@ -719,7 +727,7 @@
+ message = connection.recv_bytes(256) # reject large message
+ assert message[:len(CHALLENGE)] == CHALLENGE, 'message = %r' % message
+ message = message[len(CHALLENGE):]
+- digest = hmac.new(authkey, message).digest()
++ digest = hmac.new(authkey, message, get_digestmod_for_hmac()).digest()
+ connection.send_bytes(digest)
+ response = connection.recv_bytes(256) # reject large message
+ if response != WELCOME:
diff --git a/python.spec b/python.spec
index 309c258..2873931 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.3
-Release: 22%{?dist}
+Release: 23%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -763,6 +763,14 @@ Patch167:
00167-disable-stack-navigation-tests-when-optimized-in-test_gdb.patch
# (rhbz#849994)
Patch168: 00168-distutils-cflags.patch
+# 00169 #
+# Use SHA-256 rather than implicitly using MD5 within the challenge handling
+# in multiprocessing.connection
+#
+# Sent upstream as
http://bugs.python.org/issue17258
+# (rhbz#879695)
+Patch169: 00169-avoid-implicit-usage-of-md5-in-multiprocessing.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -1098,6 +1106,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch166 -p1
%patch167 -p1
%patch168 -p1
+%patch169 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -1928,6 +1937,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-23
+- use SHA-256 rather than implicitly using MD5 within the challenge handling
+in multiprocessing.connection (patch 169; rhbz#879695)
+
* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-22
- fix a problem with distutils.sysconfig when CFLAGS is defined in the
environment (patch 168; rhbz#849994)
commit 01cf2c167eea6e4243facb4bbd5f87ba5ea128fb
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Wed Feb 20 13:57:29 2013 -0500
2.7.3-22: fix a problem with distutils.sysconfig when CFLAGS is defined in the
environment (patch 168; rhbz#849994)
* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-22
- fix a problem with distutils.sysconfig when CFLAGS is defined in the
environment (patch 168; rhbz#849994)
diff --git a/00168-distutils-cflags.patch b/00168-distutils-cflags.patch
new file mode 100644
index 0000000..0c4a8df
--- /dev/null
+++ b/00168-distutils-cflags.patch
@@ -0,0 +1,12 @@
+diff -up Python-2.6.6/Lib/distutils/sysconfig.py.distutils-cflags
Python-2.6.6/Lib/distutils/sysconfig.py
+--- Python-2.6.6/Lib/distutils/sysconfig.py.distutils-cflags 2011-08-12
17:18:17.833091153 -0400
++++ Python-2.6.6/Lib/distutils/sysconfig.py 2011-08-12 17:18:27.449106938 -0400
+@@ -187,7 +187,7 @@ def customize_compiler(compiler):
+ if 'LDFLAGS' in os.environ:
+ ldshared = ldshared + ' ' + os.environ['LDFLAGS']
+ if 'CFLAGS' in os.environ:
+- cflags = opt + ' ' + os.environ['CFLAGS']
++ cflags = cflags + ' ' + os.environ['CFLAGS']
+ ldshared = ldshared + ' ' + os.environ['CFLAGS']
+ if 'CPPFLAGS' in os.environ:
+ cpp = cpp + ' ' + os.environ['CPPFLAGS']
diff --git a/python.spec b/python.spec
index 8b10604..309c258 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.3
-Release: 21%{?dist}
+Release: 22%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -751,6 +751,18 @@ Patch166: 00166-fix-fake-repr-in-gdb-hooks.patch
# Not yet sent upstream
Patch167: 00167-disable-stack-navigation-tests-when-optimized-in-test_gdb.patch
+# 00168 #
+# Update distutils.sysconfig so that if CFLAGS is defined in the environment,
+# when building extension modules, it is appended to the full compilation
+# flags from Python's Makefile, rather than instead reducing the compilation
+# flags to the subset within OPT and adding it to those.
+#
+# In particular, this should ensure that "-fno-strict-aliasing" is used by
+# "python setup.py build" even when CFLAGS is defined in the environment.
+#
+# (rhbz#849994)
+Patch168: 00168-distutils-cflags.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -1085,6 +1097,7 @@ done
mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch166 -p1
%patch167 -p1
+%patch168 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -1915,6 +1928,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-22
+- fix a problem with distutils.sysconfig when CFLAGS is defined in the
+environment (patch 168; rhbz#849994)
+
* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-21
- don't run any stack navigation tests in test_gdb for optimized builds
(patch 167; rhbz#912025)
commit d63f6bd94f3dcbcbaa3ece4e37eccfe4cb972032
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Wed Feb 20 12:33:39 2013 -0500
2.7.3-21: don't run any stack navigation tests in test_gdb for optimized builds
(rhbz#912025)
* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-21
- don't run any stack navigation tests in test_gdb for optimized builds
(patch 167; rhbz#912025)
diff --git a/00167-disable-stack-navigation-tests-when-optimized-in-test_gdb.patch
b/00167-disable-stack-navigation-tests-when-optimized-in-test_gdb.patch
new file mode 100644
index 0000000..3fa94fb
--- /dev/null
+++ b/00167-disable-stack-navigation-tests-when-optimized-in-test_gdb.patch
@@ -0,0 +1,43 @@
+diff -up
Python-2.7.3/Lib/test/test_gdb.py.disable-stack-navigation-tests-when-optimized-in-test_gdb
Python-2.7.3/Lib/test/test_gdb.py
+---
Python-2.7.3/Lib/test/test_gdb.py.disable-stack-navigation-tests-when-optimized-in-test_gdb 2013-02-20
12:27:05.669526425 -0500
++++ Python-2.7.3/Lib/test/test_gdb.py 2013-02-20 12:27:05.715526422 -0500
+@@ -653,10 +653,10 @@ class PyListTests(DebuggerTests):
+ ' 3 def foo(a, b, c):\n',
+ bt)
+
++(a)unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands")
++(a)unittest.skipIf(python_is_optimized(),
++ "Python was compiled with optimizations")
+ class StackNavigationTests(DebuggerTests):
+- @unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down
commands")
+- @unittest.skipIf(python_is_optimized(),
+- "Python was compiled with optimizations")
+ def test_pyup_command(self):
+ 'Verify that the "py-up" command works'
+ bt = self.get_stack_trace(script=self.get_sample_script(),
+@@ -667,7 +667,6 @@ class StackNavigationTests(DebuggerTests
+ baz\(a, b, c\)
+ $''')
+
+- @unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down
commands")
+ def test_down_at_bottom(self):
+ 'Verify handling of "py-down" at the bottom of the stack'
+ bt = self.get_stack_trace(script=self.get_sample_script(),
+@@ -675,7 +674,6 @@ $''')
+ self.assertEndsWith(bt,
+ 'Unable to find a newer python frame\n')
+
+- @unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down
commands")
+ def test_up_at_top(self):
+ 'Verify handling of "py-up" at the top of the stack'
+ bt = self.get_stack_trace(script=self.get_sample_script(),
+@@ -683,9 +681,6 @@ $''')
+ self.assertEndsWith(bt,
+ 'Unable to find an older python frame\n')
+
+- @unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down
commands")
+- @unittest.skipIf(python_is_optimized(),
+- "Python was compiled with optimizations")
+ def test_up_then_down(self):
+ 'Verify "py-up" followed by "py-down"'
+ bt = self.get_stack_trace(script=self.get_sample_script(),
diff --git a/python.spec b/python.spec
index 2f8414f..8b10604 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.3
-Release: 20%{?dist}
+Release: 21%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -742,6 +742,15 @@ Patch165: 00165-crypt-module-salt-backport.patch
# Not yet sent upstream
Patch166: 00166-fix-fake-repr-in-gdb-hooks.patch
+# 00167 #
+# Don't run any of the stack navigation tests in test_gdb when Python is
+# optimized, since there appear to be many different ways in which gdb can
+# fail to read the PyFrameObject* for arbitrary places in the callstack,
+# presumably due to compiler optimization (rhbz#912025)
+#
+# Not yet sent upstream
+Patch167: 00167-disable-stack-navigation-tests-when-optimized-in-test_gdb.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -1075,6 +1084,7 @@ done
%patch165 -p1
mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch166 -p1
+%patch167 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -1905,6 +1915,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-21
+- don't run any stack navigation tests in test_gdb for optimized builds
+(patch 167; rhbz#912025)
+
* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-20
- s/cryptmodule/_cryptmodule/ in package payload (rhbz#835021)
commit 187fefb3fb884cf0dbcfe2d591f3e8971f1d028c
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Tue Feb 19 20:52:54 2013 -0500
2.7.3-20: s/cryptmodule/_cryptmodule/ in package payload (rhbz#835021)
* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-20
- s/cryptmodule/_cryptmodule/ in package payload (rhbz#835021)
diff --git a/python.spec b/python.spec
index f1174d4..2f8414f 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.3
-Release: 19%{?dist}
+Release: 20%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1617,7 +1617,7 @@ rm -fr %{buildroot}
%{dynload_dir}/cPickle.so
%{dynload_dir}/cStringIO.so
%{dynload_dir}/cmathmodule.so
-%{dynload_dir}/cryptmodule.so
+%{dynload_dir}/_cryptmodule.so
%{dynload_dir}/datetime.so
%{dynload_dir}/dbm.so
%{dynload_dir}/dlmodule.so
@@ -1817,7 +1817,7 @@ rm -fr %{buildroot}
%{dynload_dir}/cPickle_d.so
%{dynload_dir}/cStringIO_d.so
%{dynload_dir}/cmathmodule_d.so
-%{dynload_dir}/cryptmodule_d.so
+%{dynload_dir}/_cryptmodule_d.so
%{dynload_dir}/datetime_d.so
%{dynload_dir}/dbm_d.so
%{dynload_dir}/dlmodule_d.so
@@ -1905,6 +1905,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Wed Feb 20 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-20
+- s/cryptmodule/_cryptmodule/ in package payload (rhbz#835021)
+
* Tue Feb 19 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-19
- bulletproof the gdb debugging hooks against a failure seen in ARM builds
(patch 166; rhbz#912025)
commit a0eea8701ec8091b9a4228b3a4bd529e68194c29
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Tue Feb 19 17:22:57 2013 -0500
2.7.3-19: bulletproof gdb debugging hooks to fix FTFBS on ARM (rhbz#912025)
* Tue Feb 19 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-19
- bulletproof the gdb debugging hooks against a failure seen in ARM builds
(patch 166; rhbz#912025)
- re-enable make check on ARM (rhbz#912025)
diff --git a/00166-fix-fake-repr-in-gdb-hooks.patch
b/00166-fix-fake-repr-in-gdb-hooks.patch
new file mode 100644
index 0000000..bfd2459
--- /dev/null
+++ b/00166-fix-fake-repr-in-gdb-hooks.patch
@@ -0,0 +1,125 @@
+diff -up Python-2.7.3/Tools/gdb/libpython.py.fix-fake-repr-in-gdb-hooks
Python-2.7.3/Tools/gdb/libpython.py
+--- Python-2.7.3/Tools/gdb/libpython.py.fix-fake-repr-in-gdb-hooks 2013-02-19
17:21:33.541181366 -0500
++++ Python-2.7.3/Tools/gdb/libpython.py 2013-02-19 17:21:42.090180782 -0500
+@@ -105,6 +105,24 @@ class TruncatedStringIO(object):
+ def getvalue(self):
+ return self._val
+
++class FakeProxy(object):
++ """
++ Class representing a non-descript PyObject* value in the inferior
++ process for when we don't have a custom scraper, intended to have
++ a sane repr().
++ """
++ def __init__(self, tp_name, address):
++ self.tp_name = tp_name
++ self.address = address
++
++ def __repr__(self):
++ # For the NULL pointer, we have no way of knowing a type, so
++ # special-case it as per
++ #
http://bugs.python.org/issue8032#msg100882
++ if self.address == 0:
++ return '0x0'
++ return '<%s at remote 0x%x>' % (self.tp_name, self.address)
++
+ class PyObjectPtr(object):
+ """
+ Class wrapping a gdb.Value that's a either a (PyObject*) within the
+@@ -232,28 +250,8 @@ class PyObjectPtr(object):
+ visiting object graphs with loops). Analogous to Py_ReprEnter and
+ Py_ReprLeave
+ '''
+-
+- class FakeRepr(object):
+- """
+- Class representing a non-descript PyObject* value in the inferior
+- process for when we don't have a custom scraper, intended to have
+- a sane repr().
+- """
+-
+- def __init__(self, tp_name, address):
+- self.tp_name = tp_name
+- self.address = address
+-
+- def __repr__(self):
+- # For the NULL pointer, we have no way of knowing a type, so
+- # special-case it as per
+- #
http://bugs.python.org/issue8032#msg100882
+- if self.address == 0:
+- return '0x0'
+- return '<%s at remote 0x%x>' % (self.tp_name,
self.address)
+-
+- return FakeRepr(self.safe_tp_name(),
+- long(self._gdbval))
++ return FakeProxy(self.safe_tp_name(),
++ long(self._gdbval))
+
+ def write_repr(self, out, visited):
+ '''
+@@ -384,7 +382,7 @@ def _write_instance_repr(out, visited, n
+ if not first:
+ out.write(', ')
+ first = False
+- out.write(pyop_arg.proxyval(visited))
++ out.write(str(pyop_arg.proxyval(visited)))
+ out.write('=')
+ pyop_val.write_repr(out, visited)
+ out.write(')')
+@@ -785,6 +783,8 @@ class PyNoneStructPtr(PyObjectPtr):
+ def proxyval(self, visited):
+ return None
+
++class CantReadFilename(ValueError):
++ pass
+
+ class PyFrameObjectPtr(PyObjectPtr):
+ _typename = 'PyFrameObject'
+@@ -861,7 +861,10 @@ class PyFrameObjectPtr(PyObjectPtr):
+ '''Get the path of the current Python source file, as a
string'''
+ if self.is_optimized_out():
+ return '(frame information optimized out)'
+- return self.co_filename.proxyval(set())
++ value = self.co_filename.proxyval(set())
++ if isinstance(value, FakeProxy):
++ raise CantReadFilename('unable to extract filename)')
++ return value
+
+ def current_line_num(self):
+ '''Get current line number as an integer (1-based)
+@@ -907,7 +910,7 @@ class PyFrameObjectPtr(PyObjectPtr):
+ out.write(', ')
+ first = False
+
+- out.write(pyop_name.proxyval(visited))
++ out.write(str(pyop_name.proxyval(visited)))
+ out.write('=')
+ pyop_value.write_repr(out, visited)
+
+@@ -1252,8 +1255,11 @@ class Frame(object):
+ if pyop:
+ sys.stdout.write('#%i %s\n' % (self.get_index(),
pyop.get_truncated_repr(MAX_OUTPUT_LEN)))
+ if not pyop.is_optimized_out():
+- line = pyop.current_line()
+- sys.stdout.write(' %s\n' % line.strip())
++ try:
++ line = pyop.current_line()
++ sys.stdout.write(' %s\n' % line.strip())
++ except CantReadFilename:
++ sys.stdout.write(' %s\n' % '(unable to read
filename)')
+ else:
+ sys.stdout.write('#%i (unable to read python frame
information)\n' % self.get_index())
+ else:
+@@ -1303,7 +1309,11 @@ class PyList(gdb.Command):
+ print 'Unable to read information on python frame'
+ return
+
+- filename = pyop.filename()
++ try:
++ filename = pyop.filename()
++ except CantReadFilename:
++ print "Unable to extract filename from python frame"
++ return
+ lineno = pyop.current_line_num()
+
+ if start is None:
diff --git a/python.spec b/python.spec
index 5e9d1c0..f1174d4 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.3
-Release: 18%{?dist}
+Release: 19%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -735,6 +735,13 @@ Patch159: 00159-correct-libdb-include-path.patch
# within 2.7
Patch165: 00165-crypt-module-salt-backport.patch
+# 00166 #
+# Bulletproof the gdb debugging hooks against the case where co_filename for
+# a frame can't be read from the inferior process (rhbz#912025)
+#
+# Not yet sent upstream
+Patch166: 00166-fix-fake-repr-in-gdb-hooks.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -1067,6 +1074,7 @@ done
# 00164: not for python 2 yet
%patch165 -p1
mv Modules/cryptmodule.c Modules/_cryptmodule.c
+%patch166 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -1488,7 +1496,6 @@ sed \
# ======================================================
%check
-%ifnarch %{arm}
topdir=$(pwd)
CheckPython() {
ConfName=$1
@@ -1538,8 +1545,6 @@ CheckPython \
%endif # run_selftest_suite
-# arm
-%endif
# ======================================================
# Cleaning up
@@ -1900,6 +1905,11 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Tue Feb 19 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-19
+- bulletproof the gdb debugging hooks against a failure seen in ARM builds
+(patch 166; rhbz#912025)
+- re-enable make check on ARM (rhbz#912025)
+
* Tue Feb 19 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-18
- backport pre-canned ways of salting a password to the "crypt" module from
3.3
(rhbz#835021)
commit 9fa4f38a5bbbd30b3b6fc68379efb35910573fd0
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Tue Feb 19 17:05:23 2013 -0500
2.7.3-18: backport pre-canned ways of salting a password to the "crypt"
module from 3.3 (rhbz#835021)
* Tue Feb 19 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-18
- backport pre-canned ways of salting a password to the "crypt" module from
3.3
(rhbz#835021)
diff --git a/00165-crypt-module-salt-backport.patch
b/00165-crypt-module-salt-backport.patch
new file mode 100644
index 0000000..6714fa1
--- /dev/null
+++ b/00165-crypt-module-salt-backport.patch
@@ -0,0 +1,285 @@
+diff -up Python-2.7.3/Doc/library/crypt.rst.crypt-module-salt-backport
Python-2.7.3/Doc/library/crypt.rst
+--- Python-2.7.3/Doc/library/crypt.rst.crypt-module-salt-backport 2012-04-09
19:07:28.000000000 -0400
++++ Python-2.7.3/Doc/library/crypt.rst 2013-02-19 16:44:20.465334062 -0500
+@@ -16,9 +16,9 @@
+
+ This module implements an interface to the :manpage:`crypt(3)` routine, which is
+ a one-way hash function based upon a modified DES algorithm; see the Unix man
+-page for further details. Possible uses include allowing Python scripts to
+-accept typed passwords from the user, or attempting to crack Unix passwords with
+-a dictionary.
++page for further details. Possible uses include storing hashed passwords
++so you can check passwords without storing the actual password, or attempting
++to crack Unix passwords with a dictionary.
+
+ .. index:: single: crypt(3)
+
+@@ -27,15 +27,81 @@ the :manpage:`crypt(3)` routine in the r
+ extensions available on the current implementation will also be available on
+ this module.
+
++Hashing Methods
++---------------
+
+-.. function:: crypt(word, salt)
++The :mod:`crypt` module defines the list of hashing methods (not all methods
++are available on all platforms):
++
++.. data:: METHOD_SHA512
++
++ A Modular Crypt Format method with 16 character salt and 86 character
++ hash. This is the strongest method.
++
++.. versionadded:: 3.3
++
++.. data:: METHOD_SHA256
++
++ Another Modular Crypt Format method with 16 character salt and 43
++ character hash.
++
++.. versionadded:: 3.3
++
++.. data:: METHOD_MD5
++
++ Another Modular Crypt Format method with 8 character salt and 22
++ character hash.
++
++.. versionadded:: 3.3
++
++.. data:: METHOD_CRYPT
++
++ The traditional method with a 2 character salt and 13 characters of
++ hash. This is the weakest method.
++
++.. versionadded:: 3.3
++
++
++Module Attributes
++-----------------
++
++
++.. attribute:: methods
++
++ A list of available password hashing algorithms, as
++ ``crypt.METHOD_*`` objects. This list is sorted from strongest to
++ weakest, and is guaranteed to have at least ``crypt.METHOD_CRYPT``.
++
++.. versionadded:: 3.3
++
++
++Module Functions
++----------------
++
++The :mod:`crypt` module defines the following functions:
++
++.. function:: crypt(word, salt=None)
+
+ *word* will usually be a user's password as typed at a prompt or in a graphical
+- interface. *salt* is usually a random two-character string which will be used
+- to perturb the DES algorithm in one of 4096 ways. The characters in *salt* must
+- be in the set ``[./a-zA-Z0-9]``. Returns the hashed password as a string, which
+- will be composed of characters from the same alphabet as the salt (the first two
+- characters represent the salt itself).
++ interface. The optional *salt* is either a string as returned from
++ :func:`mksalt`, one of the ``crypt.METHOD_*`` values (though not all
++ may be available on all platforms), or a full encrypted password
++ including salt, as returned by this function. If *salt* is not
++ provided, the strongest method will be used (as returned by
++ :func:`methods`.
++
++ Checking a password is usually done by passing the plain-text password
++ as *word* and the full results of a previous :func:`crypt` call,
++ which should be the same as the results of this call.
++
++ *salt* (either a random 2 or 16 character string, possibly prefixed with
++ ``$digit$`` to indicate the method) which will be used to perturb the
++ encryption algorithm. The characters in *salt* must be in the set
++ ``[./a-zA-Z0-9]``, with the exception of Modular Crypt Format which
++ prefixes a ``$digit$``.
++
++ Returns the hashed password as a string, which will be composed of
++ characters from the same alphabet as the salt.
+
+ .. index:: single: crypt(3)
+
+@@ -43,6 +109,27 @@ this module.
+ different sizes in the *salt*, it is recommended to use the full crypted
+ password as salt when checking for a password.
+
++.. versionchanged:: 3.3
++ Before version 3.3, *salt* must be specified as a string and cannot
++ accept ``crypt.METHOD_*`` values (which don't exist anyway).
++
++
++.. function:: mksalt(method=None)
++
++ Return a randomly generated salt of the specified method. If no
++ *method* is given, the strongest method available as returned by
++ :func:`methods` is used.
++
++ The return value is a string either of 2 characters in length for
++ ``crypt.METHOD_CRYPT``, or 19 characters starting with ``$digit$`` and
++ 16 random characters from the set ``[./a-zA-Z0-9]``, suitable for
++ passing as the *salt* argument to :func:`crypt`.
++
++.. versionadded:: 3.3
++
++Examples
++--------
++
+ A simple example illustrating typical use::
+
+ import crypt, getpass, pwd
+@@ -59,3 +146,11 @@ A simple example illustrating typical us
+ else:
+ return 1
+
++To generate a hash of a password using the strongest available method and
++check it against the original::
++
++ import crypt
++
++ hashed = crypt.crypt(plaintext)
++ if hashed != crypt.crypt(plaintext, hashed):
++ raise "Hashed version doesn't validate against original"
+diff -up Python-2.7.3/Lib/crypt.py.crypt-module-salt-backport Python-2.7.3/Lib/crypt.py
+--- Python-2.7.3/Lib/crypt.py.crypt-module-salt-backport 2013-02-19 16:44:20.465334062
-0500
++++ Python-2.7.3/Lib/crypt.py 2013-02-19 16:49:56.425311089 -0500
+@@ -0,0 +1,71 @@
++"""Wrapper to the POSIX crypt library call and associated functionality.
++
++Note that the ``methods`` and ``METHOD_*`` attributes are non-standard
++extensions to Python 2.7, backported from 3.3"""
++
++import _crypt
++import string as _string
++from random import SystemRandom as _SystemRandom
++from collections import namedtuple as _namedtuple
++
++
++_saltchars = _string.ascii_letters + _string.digits + './'
++_sr = _SystemRandom()
++
++
++class _Method(_namedtuple('_Method', 'name ident salt_chars
total_size')):
++
++ """Class representing a salt method per the Modular Crypt Format or
the
++ legacy 2-character crypt method."""
++
++ def __repr__(self):
++ return '<crypt.METHOD_%s>' % self.name
++
++
++def mksalt(method=None):
++ """Generate a salt for the specified method.
++
++ If not specified, the strongest available method will be used.
++
++ This is a non-standard extension to Python 2.7, backported from 3.3
++ """
++ if method is None:
++ method = methods[0]
++ s = '$%s$' % method.ident if method.ident else ''
++ s += ''.join(_sr.sample(_saltchars, method.salt_chars))
++ return s
++
++
++def crypt(word, salt=None):
++ """Return a string representing the one-way hash of a password, with
a salt
++ prepended.
++
++ If ``salt`` is not specified or is ``None``, the strongest
++ available method will be selected and a salt generated. Otherwise,
++ ``salt`` may be one of the ``crypt.METHOD_*`` values, or a string as
++ returned by ``crypt.mksalt()``.
++
++ Note that these are non-standard extensions to Python 2.7's crypt.crypt()
++ entrypoint, backported from 3.3: the standard Python 2.7 crypt.crypt()
++ entrypoint requires two strings as the parameters, and does not support
++ keyword arguments.
++ """
++ if salt is None or isinstance(salt, _Method):
++ salt = mksalt(salt)
++ return _crypt.crypt(word, salt)
++
++
++# available salting/crypto methods
++METHOD_CRYPT = _Method('CRYPT', None, 2, 13)
++METHOD_MD5 = _Method('MD5', '1', 8, 34)
++METHOD_SHA256 = _Method('SHA256', '5', 16, 63)
++METHOD_SHA512 = _Method('SHA512', '6', 16, 106)
++
++methods = []
++for _method in (METHOD_SHA512, METHOD_SHA256, METHOD_MD5):
++ _result = crypt('', _method)
++ if _result and len(_result) == _method.total_size:
++ methods.append(_method)
++methods.append(METHOD_CRYPT)
++del _result, _method
++
+diff -up Python-2.7.3/Lib/test/test_crypt.py.crypt-module-salt-backport
Python-2.7.3/Lib/test/test_crypt.py
+--- Python-2.7.3/Lib/test/test_crypt.py.crypt-module-salt-backport 2012-04-09
19:07:31.000000000 -0400
++++ Python-2.7.3/Lib/test/test_crypt.py 2013-02-19 16:44:20.465334062 -0500
+@@ -10,6 +10,25 @@ class CryptTestCase(unittest.TestCase):
+ if test_support.verbose:
+ print 'Test encryption: ', c
+
++ def test_salt(self):
++ self.assertEqual(len(crypt._saltchars), 64)
++ for method in crypt.methods:
++ salt = crypt.mksalt(method)
++ self.assertEqual(len(salt),
++ method.salt_chars + (3 if method.ident else 0))
++
++ def test_saltedcrypt(self):
++ for method in crypt.methods:
++ pw = crypt.crypt('assword', method)
++ self.assertEqual(len(pw), method.total_size)
++ pw = crypt.crypt('assword', crypt.mksalt(method))
++ self.assertEqual(len(pw), method.total_size)
++
++ def test_methods(self):
++ # Gurantee that METHOD_CRYPT is the last method in crypt.methods.
++ self.assertTrue(len(crypt.methods) >= 1)
++ self.assertEqual(crypt.METHOD_CRYPT, crypt.methods[-1])
++
+ def test_main():
+ test_support.run_unittest(CryptTestCase)
+
+diff -up Python-2.7.3/Modules/cryptmodule.c.crypt-module-salt-backport
Python-2.7.3/Modules/cryptmodule.c
+--- Python-2.7.3/Modules/cryptmodule.c.crypt-module-salt-backport 2012-04-09
19:07:34.000000000 -0400
++++ Python-2.7.3/Modules/cryptmodule.c 2013-02-19 16:44:20.466334063 -0500
+@@ -43,7 +43,7 @@ static PyMethodDef crypt_methods[] = {
+ };
+
+ PyMODINIT_FUNC
+-initcrypt(void)
++init_crypt(void)
+ {
+- Py_InitModule("crypt", crypt_methods);
++ Py_InitModule("_crypt", crypt_methods);
+ }
+diff -up Python-2.7.3/Modules/Setup.dist.crypt-module-salt-backport
Python-2.7.3/Modules/Setup.dist
+--- Python-2.7.3/Modules/Setup.dist.crypt-module-salt-backport 2013-02-19
16:44:20.463334063 -0500
++++ Python-2.7.3/Modules/Setup.dist 2013-02-19 16:44:20.466334063 -0500
+@@ -221,7 +221,7 @@ _ssl _ssl.c \
+ #
+ # First, look at Setup.config; configure may have set this for you.
+
+-crypt cryptmodule.c -lcrypt # crypt(3); needs -lcrypt on some systems
++_crypt _cryptmodule.c -lcrypt # crypt(3); needs -lcrypt on some systems
+
+
+ # Some more UNIX dependent modules -- off by default, since these
+diff -up Python-2.7.3/setup.py.crypt-module-salt-backport Python-2.7.3/setup.py
+--- Python-2.7.3/setup.py.crypt-module-salt-backport 2013-02-19 16:44:20.425334067 -0500
++++ Python-2.7.3/setup.py 2013-02-19 16:44:20.466334063 -0500
+@@ -693,7 +693,7 @@ class PyBuildExt(build_ext):
+ libs = ['crypt']
+ else:
+ libs = []
+- exts.append( Extension('crypt', ['cryptmodule.c'],
libraries=libs) )
++ exts.append( Extension('_crypt', ['_cryptmodule.c'],
libraries=libs) )
+
+ # CSV files
+ exts.append( Extension('_csv', ['_csv.c']) )
diff --git a/python.spec b/python.spec
index c712da3..5e9d1c0 100644
--- a/python.spec
+++ b/python.spec
@@ -106,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.3
-Release: 17%{?dist}
+Release: 18%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -722,6 +722,19 @@ Patch159: 00159-correct-libdb-include-path.patch
# python3.spec has:
# Patch163: 00163-disable-parts-of-test_socket-in-rpm-build.patch
+# 00164 #
+# python3.spec has:
+# Patch164: 00164-disable-interrupted_write-tests-on-ppc.patch
+
+# 00165 #
+# Backport to Python 2 from Python 3.3 of improvements to the "crypt" module
+# adding precanned ways of salting a password (rhbz#835021)
+# Based on r88500 patch to py3k from Python 3.3
+# plus 6482dd1c11ed, 0586c699d467, 62994662676a, 74a1110a3b50, plus edits
+# to docstrings to note that this additional functionality is not standard
+# within 2.7
+Patch165: 00165-crypt-module-salt-backport.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -1051,6 +1064,10 @@ done
# 00161: not for python 2 yet
# 00162: not for python 2 yet
# 00163: not for python 2 yet
+# 00164: not for python 2 yet
+%patch165 -p1
+mv Modules/cryptmodule.c Modules/_cryptmodule.c
+
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -1883,6 +1900,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Tue Feb 19 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-18
+- backport pre-canned ways of salting a password to the "crypt" module from
3.3
+(rhbz#835021)
+
* Tue Feb 19 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-17
- remove "_default_patch_fuzz" directive to avoid patches being silently
misapplied (refresh patch 1, patch 101, patch 102, patch 111, patch 121,
commit 42d74be7420b3f424e74b1eed5fb4a48dfa33716
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Tue Feb 19 15:19:54 2013 -0500
2.7.3-17: remove "_default_patch_fuzz" directive
* Tue Feb 19 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-17
- remove "_default_patch_fuzz" directive to avoid patches being silently
misapplied (refresh patch 1, patch 101, patch 102, patch 111, patch 121,
patch 158; rename patch 1, patch 101, patch 121; apply patch 54 before the
lib64 patches to avoid fuzz problems caused by the conditional application
of the lib64 patches)
diff --git a/00001-pydocnogui.patch b/00001-pydocnogui.patch
new file mode 100644
index 0000000..3b34842
--- /dev/null
+++ b/00001-pydocnogui.patch
@@ -0,0 +1,38 @@
+diff -up Python-2.7.3/Lib/pydoc.py.no_gui Python-2.7.3/Lib/pydoc.py
+--- Python-2.7.3/Lib/pydoc.py.no_gui 2012-04-09 19:07:31.000000000 -0400
++++ Python-2.7.3/Lib/pydoc.py 2013-02-19 13:48:44.480054515 -0500
+@@ -19,9 +19,6 @@ of all available modules.
+ Run "pydoc -p <port>" to start an HTTP server on a given port on the
+ local machine to generate documentation web pages.
+
+-For platforms without a command line, "pydoc -g" starts the HTTP server
+-and also pops up a little window for controlling it.
+-
+ Run "pydoc -w <name>" to write out the HTML documentation for a module
+ to a file named "<name>.html".
+
+@@ -2290,9 +2287,6 @@ def cli():
+ writing = 0
+
+ for opt, val in opts:
+- if opt == '-g':
+- gui()
+- return
+ if opt == '-k':
+ apropos(val)
+ return
+@@ -2346,13 +2340,10 @@ def cli():
+ %s -p <port>
+ Start an HTTP server on the given port on the local machine.
+
+-%s -g
+- Pop up a graphical interface for finding and serving documentation.
+-
+ %s -w <name> ...
+ Write out the HTML documentation for a module to a file in the current
+ directory. If <name> contains a '%s', it is treated as a filename;
if
+ it names a directory, documentation is written for all the contents.
+-""" % (cmd, os.sep, cmd, cmd, cmd, cmd, os.sep)
++""" % (cmd, os.sep, cmd, cmd, cmd, os.sep)
+
+ if __name__ == '__main__': cli()
diff --git a/00101-lib64-regex.patch b/00101-lib64-regex.patch
new file mode 100644
index 0000000..e399390
--- /dev/null
+++ b/00101-lib64-regex.patch
@@ -0,0 +1,19 @@
+diff -up Python-2.7.3/Lib/test/test_re.py.lib64-regex Python-2.7.3/Lib/test/test_re.py
+--- Python-2.7.3/Lib/test/test_re.py.lib64-regex 2012-04-09 19:07:32.000000000 -0400
++++ Python-2.7.3/Lib/test/test_re.py 2013-02-19 13:53:57.624033102 -0500
+@@ -757,6 +757,15 @@ class ReTests(unittest.TestCase):
+ self.assertRaises(TypeError, re.finditer, "a", {})
+ self.assertRaises(OverflowError, _sre.compile, "abc", 0,
[long_overflow])
+
++ def test_bug_931848(self):
++ try:
++ unicode
++ except NameError:
++ pass
++ pattern = eval('u"[\u002E\u3002\uFF0E\uFF61]"')
++ self.assertEqual(re.compile(pattern).split("a.b.c"),
++ ['a','b','c'])
++
+ def run_re_tests():
+ from test.re_tests import tests, SUCCEED, FAIL, SYNTAX_ERROR
+ if verbose:
diff --git a/00111-no-static-lib.patch b/00111-no-static-lib.patch
index 61375b3..c331454 100644
--- a/00111-no-static-lib.patch
+++ b/00111-no-static-lib.patch
@@ -1,7 +1,7 @@
-diff -up Python-2.7rc1/Makefile.pre.in.no-static-lib Python-2.7rc1/Makefile.pre.in
---- Python-2.7rc1/Makefile.pre.in.no-static-lib 2010-06-06 14:47:52.929975429 -0400
-+++ Python-2.7rc1/Makefile.pre.in 2010-06-06 14:48:34.163350302 -0400
-@@ -393,7 +393,7 @@ coverage:
+diff -up Python-2.7.3/Makefile.pre.in.no-static-lib Python-2.7.3/Makefile.pre.in
+--- Python-2.7.3/Makefile.pre.in.no-static-lib 2013-02-19 14:03:40.801993224 -0500
++++ Python-2.7.3/Makefile.pre.in 2013-02-19 14:04:44.070988898 -0500
+@@ -397,7 +397,7 @@ coverage:
# Build the interpreter
@@ -10,8 +10,8 @@ diff -up Python-2.7rc1/Makefile.pre.in.no-static-lib
Python-2.7rc1/Makefile.pre.
$(LINKCC) $(CFLAGS) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
Modules/python.o \
$(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
-@@ -409,18 +409,6 @@ sharedmods: $(BUILDPYTHON)
- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)'
LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py
build;; \
+@@ -413,18 +413,6 @@ sharedmods: $(BUILDPYTHON)
+ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)'
./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
esac
-# Build static library
@@ -28,8 +28,8 @@ diff -up Python-2.7rc1/Makefile.pre.in.no-static-lib
Python-2.7rc1/Makefile.pre.
-
libpython$(VERSION).so: $(LIBRARY_OBJS)
if test $(INSTSONAME) != $(LDLIBRARY); then \
- $(LDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS)
$(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
-@@ -1002,18 +990,6 @@ libainstall: all python-config
+ $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS)
$(LIBC) $(LIBM) $(LDLAST); \
+@@ -1021,18 +1009,6 @@ libainstall: all python-config
else true; \
fi; \
done
diff --git a/00121-revert-r79310.patch b/00121-revert-r79310.patch
new file mode 100644
index 0000000..02b0d47
--- /dev/null
+++ b/00121-revert-r79310.patch
@@ -0,0 +1,13 @@
+diff -up Python-2.7.3/Lib/site.py.00121 Python-2.7.3/Lib/site.py
+--- Python-2.7.3/Lib/site.py.00121 2013-02-19 14:07:19.156978291 -0500
++++ Python-2.7.3/Lib/site.py 2013-02-19 14:07:19.233978288 -0500
+@@ -123,7 +123,7 @@ def addbuilddir():
+ s = "build/lib.%s-%.3s" % (get_platform(), sys.version)
+ if hasattr(sys, 'gettotalrefcount'):
+ s += '-pydebug'
+- s = os.path.join(os.path.dirname(sys.path.pop()), s)
++ s = os.path.join(os.path.dirname(sys.path[-1]), s)
+ sys.path.append(s)
+
+
+diff -up Python-2.7.3/Misc/NEWS.00121 Python-2.7.3/Misc/NEWS
diff --git a/00158-fix-hashlib-leak.patch b/00158-fix-hashlib-leak.patch
index e8fcf1c..12e7866 100644
--- a/00158-fix-hashlib-leak.patch
+++ b/00158-fix-hashlib-leak.patch
@@ -1,7 +1,7 @@
-diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py
---- a/Lib/test/test_hashlib.py
-+++ b/Lib/test/test_hashlib.py
-@@ -108,12 +108,8 @@ class HashLibTestCase(unittest.TestCase)
+diff -up Python-2.7.3/Lib/test/test_hashlib.py.fix-hashlib-leak
Python-2.7.3/Lib/test/test_hashlib.py
+--- Python-2.7.3/Lib/test/test_hashlib.py.fix-hashlib-leak 2013-02-19 14:13:44.000000000
-0500
++++ Python-2.7.3/Lib/test/test_hashlib.py 2013-02-19 14:14:31.319948742 -0500
+@@ -106,12 +106,8 @@ class HashLibTestCase(unittest.TestCase)
_algo.islower()]))
def test_unknown_hash(self):
@@ -14,12 +14,12 @@ diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py
+ self.assertRaises(ValueError, hashlib.new, 'spam spam spam spam spam')
+ self.assertRaises(TypeError, hashlib.new, 1)
- def test_get_builtin_constructor(self):
- get_builtin_constructor = hashlib.__dict__[
-diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c
---- a/Modules/_hashopenssl.c
-+++ b/Modules/_hashopenssl.c
-@@ -477,6 +477,7 @@ EVP_new(PyObject *self, PyObject *args,
+ def test_hexdigest(self):
+ for name in self.supported_hash_names:
+diff -up Python-2.7.3/Modules/_hashopenssl.c.fix-hashlib-leak
Python-2.7.3/Modules/_hashopenssl.c
+--- Python-2.7.3/Modules/_hashopenssl.c.fix-hashlib-leak 2013-02-19 14:13:44.646951933
-0500
++++ Python-2.7.3/Modules/_hashopenssl.c 2013-02-19 14:13:44.715951929 -0500
+@@ -549,6 +549,7 @@ EVP_new(PyObject *self, PyObject *args,
}
if (!PyArg_Parse(name_obj, "s", &name)) {
diff --git a/Python-2.2.1-pydocnogui.patch b/Python-2.2.1-pydocnogui.patch
deleted file mode 100644
index da22ac3..0000000
--- a/Python-2.2.1-pydocnogui.patch
+++ /dev/null
@@ -1,37 +0,0 @@
---- Python-2.2.1/Lib/pydoc.py.nogui 2002-07-08 18:32:47.000000000 -0400
-+++ Python-2.2.1/Lib/pydoc.py 2002-07-08 18:33:37.000000000 -0400
-@@ -18,9 +18,6 @@
- Run "pydoc -p <port>" to start an HTTP server on a given port on the
- local machine to generate documentation web pages.
-
--For platforms without a command line, "pydoc -g" starts the HTTP server
--and also pops up a little window for controlling it.
--
- Run "pydoc -w <name>" to write out the HTML documentation for a module
- to a file named "<name>.html".
- """
-@@ -2043,9 +2040,6 @@
- writing = 0
-
- for opt, val in opts:
-- if opt == '-g':
-- gui()
-- return
- if opt == '-k':
- apropos(val)
- return
-@@ -2099,13 +2093,10 @@
- %s -p <port>
- Start an HTTP server on the given port on the local machine.
-
--%s -g
-- Pop up a graphical interface for finding and serving documentation.
--
- %s -w <name> ...
- Write out the HTML documentation for a module to a file in the current
- directory. If <name> contains a '%s', it is treated as a filename;
if
- it names a directory, documentation is written for all the contents.
--""" % (cmd, os.sep, cmd, cmd, cmd, cmd, os.sep)
-+""" % (cmd, os.sep, cmd, cmd, cmd, os.sep)
-
- if __name__ == '__main__': cli()
diff --git a/python-2.3.4-lib64-regex.patch b/python-2.3.4-lib64-regex.patch
deleted file mode 100644
index 2b38d4c..0000000
--- a/python-2.3.4-lib64-regex.patch
+++ /dev/null
@@ -1,18 +0,0 @@
---- Python-2.3.4/Lib/test/test_re.py 2004-04-20 23:32:33.000000000 +0200
-+++ Python-2.3.4/Lib/test/test_re.py.lib64-regex 2004-05-29 17:36:52.000000000 +0200
-@@ -497,6 +497,15 @@
- self.assert_(re.compile('bug_926075') is not
- re.compile(eval("u'bug_926075'")))
-
-+ def test_bug_931848(self):
-+ try:
-+ unicode
-+ except NameError:
-+ pass
-+ pattern = eval('u"[\u002E\u3002\uFF0E\uFF61]"')
-+ self.assertEqual(re.compile(pattern).split("a.b.c"),
-+ ['a','b','c'])
-+
- def run_re_tests():
- from test.re_tests import benchmarks, tests, SUCCEED, FAIL, SYNTAX_ERROR
- if verbose:
diff --git a/python-2.7.3-lib64.patch b/python-2.7.3-lib64.patch
index 470b48b..7b02a01 100644
--- a/python-2.7.3-lib64.patch
+++ b/python-2.7.3-lib64.patch
@@ -1,6 +1,6 @@
diff -up Python-2.7.3/Lib/distutils/command/install.py.lib64
Python-2.7.3/Lib/distutils/command/install.py
--- Python-2.7.3/Lib/distutils/command/install.py.lib64 2012-04-09 19:07:29.000000000
-0400
-+++ Python-2.7.3/Lib/distutils/command/install.py 2012-04-11 17:56:41.848587174 -0400
++++ Python-2.7.3/Lib/distutils/command/install.py 2013-02-19 13:58:20.446015129 -0500
@@ -42,14 +42,14 @@ else:
INSTALL_SCHEMES = {
'unix_prefix': {
@@ -20,7 +20,7 @@ diff -up Python-2.7.3/Lib/distutils/command/install.py.lib64
Python-2.7.3/Lib/di
'data' : '$base',
diff -up Python-2.7.3/Lib/distutils/sysconfig.py.lib64
Python-2.7.3/Lib/distutils/sysconfig.py
--- Python-2.7.3/Lib/distutils/sysconfig.py.lib64 2012-04-09 19:07:29.000000000 -0400
-+++ Python-2.7.3/Lib/distutils/sysconfig.py 2012-04-11 17:56:41.849587162 -0400
++++ Python-2.7.3/Lib/distutils/sysconfig.py 2013-02-19 13:58:20.446015129 -0500
@@ -114,8 +114,12 @@ def get_python_lib(plat_specific=0, stan
prefix = plat_specific and EXEC_PREFIX or PREFIX
@@ -37,7 +37,7 @@ diff -up Python-2.7.3/Lib/distutils/sysconfig.py.lib64
Python-2.7.3/Lib/distutil
else:
diff -up Python-2.7.3/Lib/site.py.lib64 Python-2.7.3/Lib/site.py
--- Python-2.7.3/Lib/site.py.lib64 2012-04-09 19:07:31.000000000 -0400
-+++ Python-2.7.3/Lib/site.py 2012-04-11 17:56:41.850587149 -0400
++++ Python-2.7.3/Lib/site.py 2013-02-19 13:58:20.447015128 -0500
@@ -300,12 +300,16 @@ def getsitepackages():
if sys.platform in ('os2emx', 'riscos'):
sitepackages.append(os.path.join(prefix, "Lib",
"site-packages"))
@@ -57,7 +57,7 @@ diff -up Python-2.7.3/Lib/site.py.lib64 Python-2.7.3/Lib/site.py
# for framework builds *only* we add the standard Apple
diff -up Python-2.7.3/Lib/test/test_site.py.lib64 Python-2.7.3/Lib/test/test_site.py
--- Python-2.7.3/Lib/test/test_site.py.lib64 2012-04-09 19:07:32.000000000 -0400
-+++ Python-2.7.3/Lib/test/test_site.py 2012-04-11 17:58:52.981947780 -0400
++++ Python-2.7.3/Lib/test/test_site.py 2013-02-19 13:58:20.447015128 -0500
@@ -241,17 +241,20 @@ class HelperFunctionsTests(unittest.Test
self.assertEqual(dirs[2], wanted)
elif os.sep == '/':
@@ -84,8 +84,8 @@ diff -up Python-2.7.3/Lib/test/test_site.py.lib64
Python-2.7.3/Lib/test/test_sit
class PthFile(object):
diff -up Python-2.7.3/Makefile.pre.in.lib64 Python-2.7.3/Makefile.pre.in
---- Python-2.7.3/Makefile.pre.in.lib64 2012-04-11 17:56:41.829587411 -0400
-+++ Python-2.7.3/Makefile.pre.in 2012-04-11 17:56:41.852587123 -0400
+--- Python-2.7.3/Makefile.pre.in.lib64 2013-02-19 13:58:20.435015131 -0500
++++ Python-2.7.3/Makefile.pre.in 2013-02-19 13:58:20.447015128 -0500
@@ -97,7 +97,7 @@ LIBDIR= @libdir@
MANDIR= @mandir@
INCLUDEDIR= @includedir@
@@ -97,7 +97,7 @@ diff -up Python-2.7.3/Makefile.pre.in.lib64
Python-2.7.3/Makefile.pre.in
BINLIBDEST= $(LIBDIR)/python$(VERSION)
diff -up Python-2.7.3/Modules/getpath.c.lib64 Python-2.7.3/Modules/getpath.c
--- Python-2.7.3/Modules/getpath.c.lib64 2012-04-09 19:07:34.000000000 -0400
-+++ Python-2.7.3/Modules/getpath.c 2012-04-11 17:56:41.853587110 -0400
++++ Python-2.7.3/Modules/getpath.c 2013-02-19 13:58:20.448015128 -0500
@@ -117,8 +117,8 @@
#endif
@@ -137,11 +137,11 @@ diff -up Python-2.7.3/Modules/getpath.c.lib64
Python-2.7.3/Modules/getpath.c
/* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */
diff -up Python-2.7.3/Modules/Setup.dist.lib64 Python-2.7.3/Modules/Setup.dist
---- Python-2.7.3/Modules/Setup.dist.lib64 2012-04-11 17:56:41.820587523 -0400
-+++ Python-2.7.3/Modules/Setup.dist 2012-04-11 17:56:41.854587097 -0400
+--- Python-2.7.3/Modules/Setup.dist.lib64 2013-02-19 13:58:20.442015131 -0500
++++ Python-2.7.3/Modules/Setup.dist 2013-02-19 14:02:25.255998391 -0500
@@ -413,7 +413,7 @@ gdbm gdbmmodule.c -lgdbm
# and the subdirectory of PORT where you built it.
- DBLIBVER=4.7
+ DBLIBVER=4.8
DBINC=/usr/include/db4
-DBLIB=/usr/lib
+DBLIB=/usr/lib64
@@ -159,7 +159,7 @@ diff -up Python-2.7.3/Modules/Setup.dist.lib64
Python-2.7.3/Modules/Setup.dist
#
diff -up Python-2.7.3/setup.py.lib64 Python-2.7.3/setup.py
--- Python-2.7.3/setup.py.lib64 2012-04-09 19:07:36.000000000 -0400
-+++ Python-2.7.3/setup.py 2012-04-11 17:56:41.856587073 -0400
++++ Python-2.7.3/setup.py 2013-02-19 13:58:20.449015129 -0500
@@ -369,7 +369,7 @@ class PyBuildExt(build_ext):
def detect_modules(self):
diff --git a/python-2.7rc2-r79310.patch b/python-2.7rc2-r79310.patch
deleted file mode 100644
index ee92932..0000000
--- a/python-2.7rc2-r79310.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Index: Misc/NEWS
-===================================================================
---- Misc/NEWS (revision 79309)
-+++ Misc/NEWS (revision 79310)
-@@ -29,6 +29,9 @@
- Library
- -------
-
-+- Issue #8205: Remove the "Modules" directory from sys.path when Python is
-+ running from the build directory (POSIX only).
-+
- - Issue #7667: Fix doctest failures with non-ASCII paths.
-
- - Issue #7512: shutil.copystat() could raise an OSError when the filesystem
-Index: Lib/site.py
-===================================================================
---- Lib/site.py (revision 79309)
-+++ Lib/site.py (revision 79310)
-@@ -118,7 +118,7 @@
- s = "build/lib.%s-%.3s" % (get_platform(), sys.version)
- if hasattr(sys, 'gettotalrefcount'):
- s += '-pydebug'
-- s = os.path.join(os.path.dirname(sys.path[-1]), s)
-+ s = os.path.join(os.path.dirname(sys.path.pop()), s)
- sys.path.append(s)
-
-
diff --git a/python.spec b/python.spec
index 576c8a0..c712da3 100644
--- a/python.spec
+++ b/python.spec
@@ -6,8 +6,6 @@
#global __python_ver 27
%global unicode ucs4
-%global _default_patch_fuzz 2
-
%if "%{__python_ver}" != "EMPTY"
%global main_python 0
%global python python%{__python_ver}
@@ -108,7 +106,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.3
-Release: 16%{?dist}
+Release: 17%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -277,7 +275,7 @@ Patch0: python-2.7.1-config.patch
# in 2.2.1-12 as a response to the -g option needing TkInter installed
# (Red Hat Linux 8)
# Not upstream
-Patch1: Python-2.2.1-pydocnogui.patch
+Patch1: 00001-pydocnogui.patch
# Add $(CFLAGS) to the linker arguments when linking the "python" binary
# since some architectures (sparc64) need this (rhbz:199373).
@@ -359,7 +357,7 @@ Patch55: 00055-systemtap.patch
# contained additional changes that applied fixes to the internals of the regex
# module, but these appear to have all been applied as part of
#
http://bugs.python.org/issue931848
-Patch101: python-2.3.4-lib64-regex.patch
+Patch101: 00101-lib64-regex.patch
# Only used when "%{_lib}" == "lib64"
# Fixup various paths throughout the build and in distutils from "lib" to
"lib64",
@@ -481,7 +479,7 @@ Patch114: 00114-statvfs-f_flag-constants.patch
# ImportError: No module named _struct
#
# For now, revert this patch:
-Patch121: python-2.7rc2-r79310.patch
+Patch121: 00121-revert-r79310.patch
# 00125 #
# COUNT_ALLOCS is useful for debugging, but the upstream behaviour of always
@@ -973,6 +971,8 @@ done
# Try not disabling egg-infos, bz#414711
#patch50 -p1 -b .egginfo
+%patch54 -p1 -b .setup-db48
+
%patch101 -p1 -b .lib64-regex
%if "%{_lib}" == "lib64"
%patch102 -p1 -b .lib64
@@ -987,7 +987,6 @@ done
%patch16 -p1 -b .rpath
%patch17 -p1 -b .distutils-rpath
-%patch54 -p1 -b .setup-db48
%if 0%{?with_systemtap}
%patch55 -p1 -b .systemtap
%endif
@@ -1002,7 +1001,7 @@ done
# patch115: upstream as of Python 2.7.3
-%patch121 -p0 -R
+%patch121 -p1
%patch125 -p1 -b .less-verbose-COUNT_ALLOCS
%patch126 -p0 -b .fix-dbm_contains-on-64bit-bigendian
%patch127 -p1 -b .fix-test_structmember-on-64bit-bigendian
@@ -1884,6 +1883,13 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Tue Feb 19 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-17
+- remove "_default_patch_fuzz" directive to avoid patches being silently
+misapplied (refresh patch 1, patch 101, patch 102, patch 111, patch 121,
+patch 158; rename patch 1, patch 101, patch 121; apply patch 54 before the
+lib64 patches to avoid fuzz problems caused by the conditional application
+of the lib64 patches)
+
* Mon Feb 18 2013 Peter Robinson <pbrobinson(a)fedoraproject.org> 2.7.3-16
- disable make check on ARM for the moment until 912025 is fixed
commit c4cd8d3495bc4ff3ac8bce347562e9bd0c34dddd
Author: Peter Robinson <pbrobinson(a)gmail.com>
Date: Mon Feb 18 13:27:21 2013 +0000
disable make check on ARM for the moment until 912025 is fixed
diff --git a/python.spec b/python.spec
index 6dd1286..576c8a0 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.3
-Release: 15%{?dist}
+Release: 16%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1472,6 +1472,7 @@ sed \
# ======================================================
%check
+%ifnarch %{arm}
topdir=$(pwd)
CheckPython() {
ConfName=$1
@@ -1521,6 +1522,8 @@ CheckPython \
%endif # run_selftest_suite
+# arm
+%endif
# ======================================================
# Cleaning up
@@ -1881,6 +1884,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Mon Feb 18 2013 Peter Robinson <pbrobinson(a)fedoraproject.org> 2.7.3-16
+- disable make check on ARM for the moment until 912025 is fixed
+
* Mon Feb 11 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-15
- add aarch64 (rhbz#909783)
commit 8ac2b8e352c227bb02b6542988337be5f3d405d8
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Sun Feb 10 23:28:21 2013 -0500
2.7.3-15: add aarch64 (rhbz#909783)
diff --git a/python.spec b/python.spec
index 916031f..6dd1286 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.3
-Release: 14%{?dist}
+Release: 15%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1372,7 +1372,7 @@ install -d %{buildroot}/usr/lib/python%{pybasever}/site-packages
%global _pyconfig32_h pyconfig-32.h
%global _pyconfig64_h pyconfig-64.h
-%ifarch %{power64} s390x x86_64 ia64 alpha sparc64
+%ifarch %{power64} s390x x86_64 ia64 alpha sparc64 aarch64
%global _pyconfig_h %{_pyconfig64_h}
%else
%global _pyconfig_h %{_pyconfig32_h}
@@ -1445,7 +1445,7 @@ done
# Install a tapset for this libpython into tapsetdir, fixing up the path to the
# library:
mkdir -p %{buildroot}%{tapsetdir}
-%ifarch %{power64} s390x x86_64 ia64 alpha sparc64
+%ifarch %{power64} s390x x86_64 ia64 alpha sparc64 aarch64
%global libpython_stp_optimized libpython%{pybasever}-64.stp
%global libpython_stp_debug libpython%{pybasever}-debug-64.stp
%else
@@ -1881,6 +1881,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Mon Feb 11 2013 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-15
+- add aarch64 (rhbz#909783)
+
* Thu Nov 29 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-14
- add BR on bluez-libs-devel (rhbz#879720)
commit f9657ea51b16828853d82c7979734b62e5289e8c
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Tue Dec 11 15:38:01 2012 -0500
2.7.3-14: add BR on bluez-libs-devel (rhbz#879720)
diff --git a/python.spec b/python.spec
index bf7217d..916031f 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.3
-Release: 13%{?dist}
+Release: 14%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -123,6 +123,7 @@ Provides: python(abi) = %{pybasever}
# (keep this list alphabetized)
BuildRequires: autoconf
+BuildRequires: bluez-libs-devel
BuildRequires: bzip2
BuildRequires: bzip2-devel
%if 0%{?fedora} && 0%{?fedora} < 18 || 0%{?rhel} && 0%{?rhel} < 7
@@ -1880,6 +1881,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu Nov 29 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-14
+- add BR on bluez-libs-devel (rhbz#879720)
+
* Thu Aug 9 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-13
- remove f18 conditional from patch 159
commit 095994d780e30baf7e8c58a20243acc7a0f0c867
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Wed Oct 10 10:31:01 2012 +0200
Modify the conditional dependencies to also cover rhel.
diff --git a/python.spec b/python.spec
index 8faf050..bf7217d 100644
--- a/python.spec
+++ b/python.spec
@@ -125,7 +125,7 @@ Provides: python(abi) = %{pybasever}
BuildRequires: autoconf
BuildRequires: bzip2
BuildRequires: bzip2-devel
-%if 0%{?fedora} < 18
+%if 0%{?fedora} && 0%{?fedora} < 18 || 0%{?rhel} && 0%{?rhel} < 7
BuildRequires: db4-devel >= 4.8
%endif
@@ -140,7 +140,7 @@ BuildRequires: gdbm-devel
%endif
BuildRequires: glibc-devel
BuildRequires: gmp-devel
-%if 0%{?fedora} >= 18
+%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
BuildRequires: libdb4-devel
%endif
BuildRequires: libffi-devel
commit 94afdf81759eb25d7734a234d5da3c241e5986f9
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Thu Aug 9 10:57:09 2012 -0400
2.7.3-13: remove f18 conditional from patch 159
diff --git a/python.spec b/python.spec
index c2b5791..8faf050 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.3
-Release: 12%{?dist}
+Release: 13%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1046,9 +1046,7 @@ done
%patch156 -p1
%patch157 -p1 -b .uid-gid-overflows
%patch158 -p1
-%if 0%{?fedora} >= 18
%patch159 -p1 -F 3
-%endif
# 00160: not for python 2
# 00161: not for python 2 yet
# 00162: not for python 2 yet
@@ -1882,6 +1880,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu Aug 9 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-13
+- remove f18 conditional from patch 159
+
* Fri Jul 27 2012 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.7.3-12
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
commit 4baa563fe9dee0d7b2bd9e2a29f8c952779cc17a
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Mon Aug 6 16:27:00 2012 -0400
add notes on python3 patches
diff --git a/python.spec b/python.spec
index a9f96c3..c2b5791 100644
--- a/python.spec
+++ b/python.spec
@@ -689,7 +689,7 @@ Patch156: 00156-gdb-autoload-safepath.patch
# (rhbz#697470)
Patch157: 00157-uid-gid-overflows.patch
-# 00158
+# 00158 #
# This patch fixes a memory leak in _hashlib module, as reported in
# RHBZ #836285; upstream report
http://bugs.python.org/issue15219.
# The patch has been accepted upstream, so this should be commented out
@@ -698,12 +698,31 @@ Patch157: 00157-uid-gid-overflows.patch
# has been merged into patch 00146.
Patch158: 00158-fix-hashlib-leak.patch
+# 00159 #
# From F18 on, there is a libdb4 package, that replaces db4. It places header
# files in "/usr/include/libdb4", not in "/usr/include/db4", this
patch
# fixes this.
# Downstream only modification.
Patch159: 00159-correct-libdb-include-path.patch
+# 00160 #
+# python3.spec's
+# Patch160: 00160-disable-test_fs_holes-in-rpm-build.patch
+# is not relevant for Python 2
+
+# 00161 #
+# python3.spec has:
+# Patch161: 00161-fix-test_tools-directory.patch
+# which will likely become relevant for Python 2 next time we rebase
+
+# 00162 #
+# python3.spec has:
+# Patch162: 00162-distutils-sysconfig-fix-CC-options.patch
+
+# 00163 #
+# python3.spec has:
+# Patch163: 00163-disable-parts-of-test_socket-in-rpm-build.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -1030,7 +1049,10 @@ done
%if 0%{?fedora} >= 18
%patch159 -p1 -F 3
%endif
-
+# 00160: not for python 2
+# 00161: not for python 2 yet
+# 00162: not for python 2 yet
+# 00163: not for python 2 yet
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
commit 0653dca0d0205c46ab1d14ef2fe2690c2891073a
Author: Dennis Gilmore <dennis(a)ausil.us>
Date: Fri Jul 27 01:12:15 2012 -0500
Rebuilt for
https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
diff --git a/python.spec b/python.spec
index cabda17..a9f96c3 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.3
-Release: 11%{?dist}
+Release: 12%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1860,6 +1860,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Fri Jul 27 2012 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.7.3-12
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
+
* Tue Jul 17 2012 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.3-11
- fix memory leak in module _hashlib (patch 158, rhbz#836285)
- fix db4 include path for libdb4 package (f18 and above) (patch 159)
commit 53b3ff6168674bc1194f4ce6b24d4c8fcba03142
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Tue Jul 24 08:51:48 2012 +0200
fix db4 include path for libdb4 package (f18 and above)
diff --git a/00159-correct-libdb-include-path.patch
b/00159-correct-libdb-include-path.patch
new file mode 100644
index 0000000..f96fc20
--- /dev/null
+++ b/00159-correct-libdb-include-path.patch
@@ -0,0 +1,11 @@
+--- Python-2.7.3/Modules/Setup.dist.orig 2012-07-17 09:05:45.000000000 +0200
++++ Python-2.7.3/Modules/Setup.dist 2012-07-17 09:06:01.011696892 +0200
+@@ -412,7 +412,7 @@
+ # Edit the variables DB and DBLIBVERto point to the db top directory
+ # and the subdirectory of PORT where you built it.
+ DBLIBVER=4.8
+-DBINC=/usr/include/db4
++DBINC=/usr/include/libdb4
+ DBLIB=/usr/lib
+ _bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
+
diff --git a/python.spec b/python.spec
index 701c1c6..cabda17 100644
--- a/python.spec
+++ b/python.spec
@@ -125,7 +125,9 @@ Provides: python(abi) = %{pybasever}
BuildRequires: autoconf
BuildRequires: bzip2
BuildRequires: bzip2-devel
+%if 0%{?fedora} < 18
BuildRequires: db4-devel >= 4.8
+%endif
# expat 2.1.0 added the symbol XML_SetHashSalt without bumping SONAME. We use
# it (in pyexpat) in order to enable the fix in Python-2.7.3 for CVE-2012-0876:
@@ -138,6 +140,9 @@ BuildRequires: gdbm-devel
%endif
BuildRequires: glibc-devel
BuildRequires: gmp-devel
+%if 0%{?fedora} >= 18
+BuildRequires: libdb4-devel
+%endif
BuildRequires: libffi-devel
BuildRequires: libGL-devel
BuildRequires: libX11-devel
@@ -693,6 +698,12 @@ Patch157: 00157-uid-gid-overflows.patch
# has been merged into patch 00146.
Patch158: 00158-fix-hashlib-leak.patch
+# From F18 on, there is a libdb4 package, that replaces db4. It places header
+# files in "/usr/include/libdb4", not in "/usr/include/db4", this
patch
+# fixes this.
+# Downstream only modification.
+Patch159: 00159-correct-libdb-include-path.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -1016,6 +1027,9 @@ done
%patch156 -p1
%patch157 -p1 -b .uid-gid-overflows
%patch158 -p1
+%if 0%{?fedora} >= 18
+%patch159 -p1 -F 3
+%endif
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -1848,6 +1862,7 @@ rm -fr %{buildroot}
%changelog
* Tue Jul 17 2012 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.3-11
- fix memory leak in module _hashlib (patch 158, rhbz#836285)
+- fix db4 include path for libdb4 package (f18 and above) (patch 159)
* Tue Jun 26 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-10
- fix missing include in uid/gid handling patch (patch 157; rhbz#830405)
commit 5fd54b3bd3ca30415289504e359ebb21dfe862c8
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Tue Jul 24 08:51:00 2012 +0200
fix memory leak in module _hashlib (patch 158, rhbz#836285)
diff --git a/00146-hashlib-fips.patch b/00146-hashlib-fips.patch
index 2f42857..8616296 100644
--- a/00146-hashlib-fips.patch
+++ b/00146-hashlib-fips.patch
@@ -513,7 +513,7 @@ diff -up Python-2.7.2/Modules/_hashopenssl.c.hashlib-fips
Python-2.7.2/Modules/_
return NULL;
}
-@@ -484,55 +556,116 @@ EVP_new(PyObject *self, PyObject *args,
+@@ -484,55 +556,118 @@ EVP_new(PyObject *self, PyObject *args,
digest = EVP_get_digestbyname(name);
ret_obj = EVPnew(name_obj, digest, NULL, (unsigned char*)view.buf,
@@ -601,6 +601,8 @@ diff -up Python-2.7.2/Modules/_hashopenssl.c.hashlib-fips
Python-2.7.2/Modules/_
+ }
+ }
+
++ PyBuffer_Release(&view);
++
+ return ret_obj;
+}
+
@@ -658,7 +660,7 @@ diff -up Python-2.7.2/Modules/_hashopenssl.c.hashlib-fips
Python-2.7.2/Modules/_
GEN_CONSTRUCTOR(md5)
GEN_CONSTRUCTOR(sha1)
#ifdef _OPENSSL_SUPPORTS_SHA2
-@@ -565,13 +698,10 @@ init_hashlib(void)
+@@ -565,13 +700,10 @@ init_hashlib(void)
{
PyObject *m;
diff --git a/00158-fix-hashlib-leak.patch b/00158-fix-hashlib-leak.patch
new file mode 100644
index 0000000..e8fcf1c
--- /dev/null
+++ b/00158-fix-hashlib-leak.patch
@@ -0,0 +1,29 @@
+diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py
+--- a/Lib/test/test_hashlib.py
++++ b/Lib/test/test_hashlib.py
+@@ -108,12 +108,8 @@ class HashLibTestCase(unittest.TestCase)
+ _algo.islower()]))
+
+ def test_unknown_hash(self):
+- try:
+- hashlib.new('spam spam spam spam spam')
+- except ValueError:
+- pass
+- else:
+- self.assertTrue(0 == "hashlib didn't reject bogus hash name")
++ self.assertRaises(ValueError, hashlib.new, 'spam spam spam spam spam')
++ self.assertRaises(TypeError, hashlib.new, 1)
+
+ def test_get_builtin_constructor(self):
+ get_builtin_constructor = hashlib.__dict__[
+diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c
+--- a/Modules/_hashopenssl.c
++++ b/Modules/_hashopenssl.c
+@@ -477,6 +477,7 @@ EVP_new(PyObject *self, PyObject *args,
+ }
+
+ if (!PyArg_Parse(name_obj, "s", &name)) {
++ PyBuffer_Release(&view);
+ PyErr_SetString(PyExc_TypeError, "name must be a string");
+ return NULL;
+ }
diff --git a/python.spec b/python.spec
index 6a37977..701c1c6 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.3
-Release: 10%{?dist}
+Release: 11%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -684,6 +684,15 @@ Patch156: 00156-gdb-autoload-safepath.patch
# (rhbz#697470)
Patch157: 00157-uid-gid-overflows.patch
+# 00158
+# This patch fixes a memory leak in _hashlib module, as reported in
+# RHBZ #836285; upstream report
http://bugs.python.org/issue15219.
+# The patch has been accepted upstream, so this should be commented out
+# when packaging next upstream release.
+# The fix for Fedora specific "implement_specific_EVP_new()" function
+# has been merged into patch 00146.
+Patch158: 00158-fix-hashlib-leak.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -1006,6 +1015,7 @@ done
%patch155 -p1
%patch156 -p1
%patch157 -p1 -b .uid-gid-overflows
+%patch158 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -1836,6 +1846,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Tue Jul 17 2012 Bohuslav Kabrda <bkabrda(a)redhat.com> - 2.7.3-11
+- fix memory leak in module _hashlib (patch 158, rhbz#836285)
+
* Tue Jun 26 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-10
- fix missing include in uid/gid handling patch (patch 157; rhbz#830405)
commit 7e989460dec6afc658fee1ebfcb93118976bf8ce
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Tue Jun 26 14:53:28 2012 -0400
2.7.3-10: fix missing include in uid/gid handling patch (patch 157; rhbz#830405)
diff --git a/00157-uid-gid-overflows.patch b/00157-uid-gid-overflows.patch
index dc533fd..0d6abb5 100644
--- a/00157-uid-gid-overflows.patch
+++ b/00157-uid-gid-overflows.patch
@@ -1,7 +1,15 @@
diff -up Python-2.7.3/Include/modsupport.h.uid-gid-overflows
Python-2.7.3/Include/modsupport.h
--- Python-2.7.3/Include/modsupport.h.uid-gid-overflows 2012-04-09 19:07:29.000000000
-0400
-+++ Python-2.7.3/Include/modsupport.h 2012-05-15 18:57:52.215433846 -0400
-@@ -128,6 +128,17 @@ PyAPI_FUNC(PyObject *) Py_InitModule4(co
++++ Python-2.7.3/Include/modsupport.h 2012-06-26 14:52:03.739471150 -0400
+@@ -8,6 +8,7 @@ extern "C" {
+ /* Module support interface */
+
+ #include <stdarg.h>
++#include <sys/types.h>
+
+ /* If PY_SSIZE_T_CLEAN is defined, each functions treats #-specifier
+ to mean Py_ssize_t */
+@@ -128,6 +129,17 @@ PyAPI_FUNC(PyObject *) Py_InitModule4(co
PyAPI_DATA(char *) _Py_PackageContext;
@@ -21,7 +29,7 @@ diff -up Python-2.7.3/Include/modsupport.h.uid-gid-overflows
Python-2.7.3/Includ
#endif
diff -up Python-2.7.3/Lib/test/test_grp.py.uid-gid-overflows
Python-2.7.3/Lib/test/test_grp.py
--- Python-2.7.3/Lib/test/test_grp.py.uid-gid-overflows 2012-04-09 19:07:31.000000000
-0400
-+++ Python-2.7.3/Lib/test/test_grp.py 2012-05-15 18:57:52.216433855 -0400
++++ Python-2.7.3/Lib/test/test_grp.py 2012-06-26 14:51:36.000817929 -0400
@@ -16,7 +16,7 @@ class GroupDatabaseTestCase(unittest.Tes
self.assertEqual(value[1], value.gr_passwd)
self.assertIsInstance(value.gr_passwd, basestring)
@@ -33,7 +41,7 @@ diff -up Python-2.7.3/Lib/test/test_grp.py.uid-gid-overflows
Python-2.7.3/Lib/te
diff -up Python-2.7.3/Lib/test/test_os.py.uid-gid-overflows
Python-2.7.3/Lib/test/test_os.py
--- Python-2.7.3/Lib/test/test_os.py.uid-gid-overflows 2012-04-09 19:07:32.000000000
-0400
-+++ Python-2.7.3/Lib/test/test_os.py 2012-05-15 18:57:52.217433864 -0400
++++ Python-2.7.3/Lib/test/test_os.py 2012-06-26 14:51:36.000817929 -0400
@@ -677,30 +677,36 @@ if sys.platform != 'win32':
def test_setuid(self):
if os.getuid() != 0:
@@ -82,7 +90,7 @@ diff -up Python-2.7.3/Lib/test/test_os.py.uid-gid-overflows
Python-2.7.3/Lib/tes
diff -up Python-2.7.3/Lib/test/test_posix.py.uid-gid-overflows
Python-2.7.3/Lib/test/test_posix.py
--- Python-2.7.3/Lib/test/test_posix.py.uid-gid-overflows 2012-04-09 19:07:32.000000000
-0400
-+++ Python-2.7.3/Lib/test/test_posix.py 2012-05-15 18:57:52.218433873 -0400
++++ Python-2.7.3/Lib/test/test_posix.py 2012-06-26 14:51:36.001817916 -0400
@@ -217,7 +217,7 @@ class PosixTester(unittest.TestCase):
if hasattr(posix, 'stat'):
self.assertTrue(posix.stat(test_support.TESTFN))
@@ -135,7 +143,7 @@ diff -up Python-2.7.3/Lib/test/test_posix.py.uid-gid-overflows
Python-2.7.3/Lib/
if hasattr(posix, 'chdir'):
diff -up Python-2.7.3/Lib/test/test_pwd.py.uid-gid-overflows
Python-2.7.3/Lib/test/test_pwd.py
--- Python-2.7.3/Lib/test/test_pwd.py.uid-gid-overflows 2012-04-09 19:07:32.000000000
-0400
-+++ Python-2.7.3/Lib/test/test_pwd.py 2012-05-17 14:53:04.353015373 -0400
++++ Python-2.7.3/Lib/test/test_pwd.py 2012-06-26 14:51:36.001817916 -0400
@@ -18,9 +18,9 @@ class PwdTest(unittest.TestCase):
self.assertEqual(e[1], e.pw_passwd)
self.assertIsInstance(e.pw_passwd, basestring)
@@ -162,7 +170,7 @@ diff -up Python-2.7.3/Lib/test/test_pwd.py.uid-gid-overflows
Python-2.7.3/Lib/te
diff -up Python-2.7.3/Modules/grpmodule.c.uid-gid-overflows
Python-2.7.3/Modules/grpmodule.c
--- Python-2.7.3/Modules/grpmodule.c.uid-gid-overflows 2012-04-09 19:07:34.000000000
-0400
-+++ Python-2.7.3/Modules/grpmodule.c 2012-05-15 18:57:52.220433893 -0400
++++ Python-2.7.3/Modules/grpmodule.c 2012-06-26 14:51:36.002817904 -0400
@@ -70,7 +70,7 @@ mkgrent(struct group *p)
Py_INCREF(Py_None);
}
@@ -197,8 +205,8 @@ diff -up Python-2.7.3/Modules/grpmodule.c.uid-gid-overflows
Python-2.7.3/Modules
}
return mkgrent(p);
diff -up Python-2.7.3/Modules/posixmodule.c.uid-gid-overflows
Python-2.7.3/Modules/posixmodule.c
---- Python-2.7.3/Modules/posixmodule.c.uid-gid-overflows 2012-05-15 18:57:50.823420672
-0400
-+++ Python-2.7.3/Modules/posixmodule.c 2012-05-16 11:40:54.975642353 -0400
+--- Python-2.7.3/Modules/posixmodule.c.uid-gid-overflows 2012-06-26 14:51:35.864819629
-0400
++++ Python-2.7.3/Modules/posixmodule.c 2012-06-26 14:51:36.005817868 -0400
@@ -1305,8 +1305,8 @@ _pystat_fromstructstat(STRUCT_STAT *st)
PyStructSequence_SET_ITEM(v, 2, PyInt_FromLong((long)st->st_dev));
#endif
@@ -574,7 +582,7 @@ diff -up Python-2.7.3/Modules/posixmodule.c.uid-gid-overflows
Python-2.7.3/Modul
diff -up Python-2.7.3/Modules/pwdmodule.c.uid-gid-overflows
Python-2.7.3/Modules/pwdmodule.c
--- Python-2.7.3/Modules/pwdmodule.c.uid-gid-overflows 2012-04-09 19:07:34.000000000
-0400
-+++ Python-2.7.3/Modules/pwdmodule.c 2012-05-17 14:47:20.263191561 -0400
++++ Python-2.7.3/Modules/pwdmodule.c 2012-06-26 14:51:36.006817855 -0400
@@ -73,8 +73,8 @@ mkpwent(struct passwd *p)
#else
SETS(setIndex++, p->pw_passwd);
@@ -606,7 +614,7 @@ diff -up Python-2.7.3/Modules/pwdmodule.c.uid-gid-overflows
Python-2.7.3/Modules
return mkpwent(p);
diff -up Python-2.7.3/Python/getargs.c.uid-gid-overflows Python-2.7.3/Python/getargs.c
--- Python-2.7.3/Python/getargs.c.uid-gid-overflows 2012-04-09 19:07:35.000000000 -0400
-+++ Python-2.7.3/Python/getargs.c 2012-05-15 18:57:52.229433979 -0400
++++ Python-2.7.3/Python/getargs.c 2012-06-26 14:51:36.007817842 -0400
@@ -4,6 +4,7 @@
#include "Python.h"
@@ -615,7 +623,7 @@ diff -up Python-2.7.3/Python/getargs.c.uid-gid-overflows
Python-2.7.3/Python/get
#ifdef __cplusplus
-@@ -1902,6 +1903,110 @@ _PyArg_NoKeywords(const char *funcname,
+@@ -1902,6 +1903,110 @@ _PyArg_NoKeywords(const char *funcname,
funcname);
return 0;
}
diff --git a/python.spec b/python.spec
index 46bf3c8..6a37977 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.3
-Release: 9%{?dist}
+Release: 10%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1836,6 +1836,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Tue Jun 26 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-10
+- fix missing include in uid/gid handling patch (patch 157; rhbz#830405)
+
* Fri Jun 22 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-9
- use rpm macro for power64 (rhbz#834653)
commit 663654f40ffd9cd7f1c42dd5a27ec7125180ead4
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Fri Jun 22 13:30:17 2012 -0400
2.7.3-9: use rpm macro for power64 (rhbz#834653)
diff --git a/python.spec b/python.spec
index 90c2100..46bf3c8 100644
--- a/python.spec
+++ b/python.spec
@@ -47,7 +47,7 @@
%global with_systemtap 1
# some arches don't have valgrind so we need to disable its support on them
-%ifarch %{ix86} x86_64 ppc ppc64 s390x
+%ifarch %{ix86} x86_64 ppc %{power64} s390x
%global with_valgrind 1
%else
%global with_valgrind 0
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.3
-Release: 8%{?dist}
+Release: 9%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -970,7 +970,7 @@ done
%patch130 -p1
-%ifarch ppc ppc64
+%ifarch ppc %{power64}
%patch131 -p1
%endif
@@ -1129,7 +1129,7 @@ LD_LIBRARY_PATH="$topdir/$ConfDir"
PATH=$PATH:$topdir/$ConfDir make -s EXTRA_CFL
BuildPython debug \
python-debug \
python%{pybasever}-debug \
-%ifarch %{ix86} x86_64 ppc ppc64
+%ifarch %{ix86} x86_64 ppc %{power64}
"--with-pydebug --with-tsc --with-count-allocs --with-call-profile" \
%else
"--with-pydebug --with-count-allocs --with-call-profile" \
@@ -1327,7 +1327,7 @@ install -d %{buildroot}/usr/lib/python%{pybasever}/site-packages
%global _pyconfig32_h pyconfig-32.h
%global _pyconfig64_h pyconfig-64.h
-%ifarch ppc64 s390x x86_64 ia64 alpha sparc64
+%ifarch %{power64} s390x x86_64 ia64 alpha sparc64
%global _pyconfig_h %{_pyconfig64_h}
%else
%global _pyconfig_h %{_pyconfig32_h}
@@ -1400,7 +1400,7 @@ done
# Install a tapset for this libpython into tapsetdir, fixing up the path to the
# library:
mkdir -p %{buildroot}%{tapsetdir}
-%ifarch ppc64 s390x x86_64 ia64 alpha sparc64
+%ifarch %{power64} s390x x86_64 ia64 alpha sparc64
%global libpython_stp_optimized libpython%{pybasever}-64.stp
%global libpython_stp_debug libpython%{pybasever}-debug-64.stp
%else
@@ -1836,6 +1836,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Fri Jun 22 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-9
+- use rpm macro for power64 (rhbz#834653)
+
* Tue May 15 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-8
- update uid/gid handling to avoid int overflows seen with uid/gid
values >= 2^31 on 32-bit architectures (patch 157; rhbz#697470)
commit a96f75325baa1c29a1bd96e0d662980fd8771968
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Fri May 18 14:53:34 2012 -0400
2.7.3-8: update uid/gid handling (patch 157; rhbz#697470)
* Tue May 15 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-8
- update uid/gid handling to avoid int overflows seen with uid/gid
values >= 2^31 on 32-bit architectures (patch 157; rhbz#697470)
diff --git a/00157-uid-gid-overflows.patch b/00157-uid-gid-overflows.patch
new file mode 100644
index 0000000..dc533fd
--- /dev/null
+++ b/00157-uid-gid-overflows.patch
@@ -0,0 +1,728 @@
+diff -up Python-2.7.3/Include/modsupport.h.uid-gid-overflows
Python-2.7.3/Include/modsupport.h
+--- Python-2.7.3/Include/modsupport.h.uid-gid-overflows 2012-04-09 19:07:29.000000000
-0400
++++ Python-2.7.3/Include/modsupport.h 2012-05-15 18:57:52.215433846 -0400
+@@ -128,6 +128,17 @@ PyAPI_FUNC(PyObject *) Py_InitModule4(co
+
+ PyAPI_DATA(char *) _Py_PackageContext;
+
++/*
++ Non-standard extension: support for dealing with uid_t and gid_t without
++ integer overflow
++ */
++
++PyAPI_FUNC(PyObject *) _PyObject_FromUid(uid_t uid);
++PyAPI_FUNC(PyObject *) _PyObject_FromGid(gid_t gid);
++
++PyAPI_FUNC(int) _PyArg_ParseUid(PyObject *in_obj, uid_t *out_uid);
++PyAPI_FUNC(int) _PyArg_ParseGid(PyObject *in_obj, gid_t *out_gid);
++
+ #ifdef __cplusplus
+ }
+ #endif
+diff -up Python-2.7.3/Lib/test/test_grp.py.uid-gid-overflows
Python-2.7.3/Lib/test/test_grp.py
+--- Python-2.7.3/Lib/test/test_grp.py.uid-gid-overflows 2012-04-09 19:07:31.000000000
-0400
++++ Python-2.7.3/Lib/test/test_grp.py 2012-05-15 18:57:52.216433855 -0400
+@@ -16,7 +16,7 @@ class GroupDatabaseTestCase(unittest.Tes
+ self.assertEqual(value[1], value.gr_passwd)
+ self.assertIsInstance(value.gr_passwd, basestring)
+ self.assertEqual(value[2], value.gr_gid)
+- self.assertIsInstance(value.gr_gid, int)
++ self.assertIsInstance(value.gr_gid, (int, long))
+ self.assertEqual(value[3], value.gr_mem)
+ self.assertIsInstance(value.gr_mem, list)
+
+diff -up Python-2.7.3/Lib/test/test_os.py.uid-gid-overflows
Python-2.7.3/Lib/test/test_os.py
+--- Python-2.7.3/Lib/test/test_os.py.uid-gid-overflows 2012-04-09 19:07:32.000000000
-0400
++++ Python-2.7.3/Lib/test/test_os.py 2012-05-15 18:57:52.217433864 -0400
+@@ -677,30 +677,36 @@ if sys.platform != 'win32':
+ def test_setuid(self):
+ if os.getuid() != 0:
+ self.assertRaises(os.error, os.setuid, 0)
++ self.assertRaises(TypeError, os.setuid, 'not an int')
+ self.assertRaises(OverflowError, os.setuid, 1<<32)
+
+ if hasattr(os, 'setgid'):
+ def test_setgid(self):
+ if os.getuid() != 0:
+ self.assertRaises(os.error, os.setgid, 0)
++ self.assertRaises(TypeError, os.setgid, 'not an int')
+ self.assertRaises(OverflowError, os.setgid, 1<<32)
+
+ if hasattr(os, 'seteuid'):
+ def test_seteuid(self):
+ if os.getuid() != 0:
+ self.assertRaises(os.error, os.seteuid, 0)
++ self.assertRaises(TypeError, os.seteuid, 'not an int')
+ self.assertRaises(OverflowError, os.seteuid, 1<<32)
+
+ if hasattr(os, 'setegid'):
+ def test_setegid(self):
+ if os.getuid() != 0:
+ self.assertRaises(os.error, os.setegid, 0)
++ self.assertRaises(TypeError, os.setegid, 'not an int')
+ self.assertRaises(OverflowError, os.setegid, 1<<32)
+
+ if hasattr(os, 'setreuid'):
+ def test_setreuid(self):
+ if os.getuid() != 0:
+ self.assertRaises(os.error, os.setreuid, 0, 0)
++ self.assertRaises(TypeError, os.setreuid, 'not an int', 0)
++ self.assertRaises(TypeError, os.setreuid, 0, 'not an int')
+ self.assertRaises(OverflowError, os.setreuid, 1<<32, 0)
+ self.assertRaises(OverflowError, os.setreuid, 0, 1<<32)
+
+@@ -715,6 +721,8 @@ if sys.platform != 'win32':
+ def test_setregid(self):
+ if os.getuid() != 0:
+ self.assertRaises(os.error, os.setregid, 0, 0)
++ self.assertRaises(TypeError, os.setregid, 'not an int', 0)
++ self.assertRaises(TypeError, os.setregid, 0, 'not an int')
+ self.assertRaises(OverflowError, os.setregid, 1<<32, 0)
+ self.assertRaises(OverflowError, os.setregid, 0, 1<<32)
+
+diff -up Python-2.7.3/Lib/test/test_posix.py.uid-gid-overflows
Python-2.7.3/Lib/test/test_posix.py
+--- Python-2.7.3/Lib/test/test_posix.py.uid-gid-overflows 2012-04-09 19:07:32.000000000
-0400
++++ Python-2.7.3/Lib/test/test_posix.py 2012-05-15 18:57:52.218433873 -0400
+@@ -217,7 +217,7 @@ class PosixTester(unittest.TestCase):
+ if hasattr(posix, 'stat'):
+ self.assertTrue(posix.stat(test_support.TESTFN))
+
+- def _test_all_chown_common(self, chown_func, first_param):
++ def _test_all_chown_common(self, chown_func, stat_func, first_param):
+ """Common code for chown, fchown and lchown
tests."""
+ if os.getuid() == 0:
+ try:
+@@ -237,6 +237,13 @@ class PosixTester(unittest.TestCase):
+
+ # test a successful chown call
+ chown_func(first_param, os.getuid(), os.getgid())
++ self.assertEqual(stat_func(first_param).st_uid, os.getuid())
++ self.assertEqual(stat_func(first_param).st_gid, os.getgid())
++
++ # verify that -1 works as a "do-nothing" option:
++ chown_func(first_param, -1, -1)
++ self.assertEqual(stat_func(first_param).st_uid, os.getuid())
++ self.assertEqual(stat_func(first_param).st_gid, os.getgid())
+
+ @unittest.skipUnless(hasattr(posix, 'chown'), "test needs
os.chown()")
+ def test_chown(self):
+@@ -246,7 +253,7 @@ class PosixTester(unittest.TestCase):
+
+ # re-create the file
+ open(test_support.TESTFN, 'w').close()
+- self._test_all_chown_common(posix.chown, test_support.TESTFN)
++ self._test_all_chown_common(posix.chown, posix.stat, test_support.TESTFN)
+
+ @unittest.skipUnless(hasattr(posix, 'fchown'), "test needs
os.fchown()")
+ def test_fchown(self):
+@@ -256,7 +263,7 @@ class PosixTester(unittest.TestCase):
+ test_file = open(test_support.TESTFN, 'w')
+ try:
+ fd = test_file.fileno()
+- self._test_all_chown_common(posix.fchown, fd)
++ self._test_all_chown_common(posix.fchown, posix.fstat, fd)
+ finally:
+ test_file.close()
+
+@@ -265,7 +272,7 @@ class PosixTester(unittest.TestCase):
+ os.unlink(test_support.TESTFN)
+ # create a symlink
+ os.symlink(_DUMMY_SYMLINK, test_support.TESTFN)
+- self._test_all_chown_common(posix.lchown, test_support.TESTFN)
++ self._test_all_chown_common(posix.lchown, posix.lstat, test_support.TESTFN)
+
+ def test_chdir(self):
+ if hasattr(posix, 'chdir'):
+diff -up Python-2.7.3/Lib/test/test_pwd.py.uid-gid-overflows
Python-2.7.3/Lib/test/test_pwd.py
+--- Python-2.7.3/Lib/test/test_pwd.py.uid-gid-overflows 2012-04-09 19:07:32.000000000
-0400
++++ Python-2.7.3/Lib/test/test_pwd.py 2012-05-17 14:53:04.353015373 -0400
+@@ -18,9 +18,9 @@ class PwdTest(unittest.TestCase):
+ self.assertEqual(e[1], e.pw_passwd)
+ self.assertIsInstance(e.pw_passwd, basestring)
+ self.assertEqual(e[2], e.pw_uid)
+- self.assertIsInstance(e.pw_uid, int)
++ self.assertIsInstance(e.pw_uid, (int, long))
+ self.assertEqual(e[3], e.pw_gid)
+- self.assertIsInstance(e.pw_gid, int)
++ self.assertIsInstance(e.pw_gid, (int, long))
+ self.assertEqual(e[4], e.pw_gecos)
+ self.assertIsInstance(e.pw_gecos, basestring)
+ self.assertEqual(e[5], e.pw_dir)
+@@ -87,9 +87,9 @@ class PwdTest(unittest.TestCase):
+ # In some cases, byuids isn't a complete list of all users in the
+ # system, so if we try to pick a value not in byuids (via a perturbing
+ # loop, say), pwd.getpwuid() might still be able to find data for that
+- # uid. Using sys.maxint may provoke the same problems, but hopefully
++ # uid. Using 2**32 - 2 may provoke the same problems, but hopefully
+ # it will be a more repeatable failure.
+- fakeuid = sys.maxint
++ fakeuid = 2**32 - 2
+ self.assertNotIn(fakeuid, byuids)
+ self.assertRaises(KeyError, pwd.getpwuid, fakeuid)
+
+diff -up Python-2.7.3/Modules/grpmodule.c.uid-gid-overflows
Python-2.7.3/Modules/grpmodule.c
+--- Python-2.7.3/Modules/grpmodule.c.uid-gid-overflows 2012-04-09 19:07:34.000000000
-0400
++++ Python-2.7.3/Modules/grpmodule.c 2012-05-15 18:57:52.220433893 -0400
+@@ -70,7 +70,7 @@ mkgrent(struct group *p)
+ Py_INCREF(Py_None);
+ }
+ #endif
+- SET(setIndex++, PyInt_FromLong((long) p->gr_gid));
++ SET(setIndex++, _PyObject_FromGid(p->gr_gid));
+ SET(setIndex++, w);
+ #undef SET
+
+@@ -85,18 +85,15 @@ mkgrent(struct group *p)
+ static PyObject *
+ grp_getgrgid(PyObject *self, PyObject *pyo_id)
+ {
+- PyObject *py_int_id;
+- unsigned int gid;
++ gid_t gid;
+ struct group *p;
+
+- py_int_id = PyNumber_Int(pyo_id);
+- if (!py_int_id)
+- return NULL;
+- gid = PyInt_AS_LONG(py_int_id);
+- Py_DECREF(py_int_id);
++ if (!_PyArg_ParseGid(pyo_id, &gid)) {
++ return NULL;
++ }
+
+ if ((p = getgrgid(gid)) == NULL) {
+- PyErr_Format(PyExc_KeyError, "getgrgid(): gid not found: %d", gid);
++ PyErr_Format(PyExc_KeyError, "getgrgid(): gid not found: %lu",
(unsigned long)gid);
+ return NULL;
+ }
+ return mkgrent(p);
+diff -up Python-2.7.3/Modules/posixmodule.c.uid-gid-overflows
Python-2.7.3/Modules/posixmodule.c
+--- Python-2.7.3/Modules/posixmodule.c.uid-gid-overflows 2012-05-15 18:57:50.823420672
-0400
++++ Python-2.7.3/Modules/posixmodule.c 2012-05-16 11:40:54.975642353 -0400
+@@ -1305,8 +1305,8 @@ _pystat_fromstructstat(STRUCT_STAT *st)
+ PyStructSequence_SET_ITEM(v, 2, PyInt_FromLong((long)st->st_dev));
+ #endif
+ PyStructSequence_SET_ITEM(v, 3, PyInt_FromLong((long)st->st_nlink));
+- PyStructSequence_SET_ITEM(v, 4, PyInt_FromLong((long)st->st_uid));
+- PyStructSequence_SET_ITEM(v, 5, PyInt_FromLong((long)st->st_gid));
++ PyStructSequence_SET_ITEM(v, 4, _PyObject_FromUid(st->st_uid));
++ PyStructSequence_SET_ITEM(v, 5, _PyObject_FromGid(st->st_gid));
+ #ifdef HAVE_LARGEFILE_SUPPORT
+ PyStructSequence_SET_ITEM(v, 6,
+ PyLong_FromLongLong((PY_LONG_LONG)st->st_size));
+@@ -1883,14 +1883,16 @@ static PyObject *
+ posix_chown(PyObject *self, PyObject *args)
+ {
+ char *path = NULL;
+- long uid, gid;
++ uid_t uid;
++ gid_t gid;
+ int res;
+- if (!PyArg_ParseTuple(args, "etll:chown",
++ if (!PyArg_ParseTuple(args, "etO&O&:chown",
+ Py_FileSystemDefaultEncoding, &path,
+- &uid, &gid))
++ _PyArg_ParseUid, &uid,
++ _PyArg_ParseGid, &gid))
+ return NULL;
+ Py_BEGIN_ALLOW_THREADS
+- res = chown(path, (uid_t) uid, (gid_t) gid);
++ res = chown(path, uid, gid);
+ Py_END_ALLOW_THREADS
+ if (res < 0)
+ return posix_error_with_allocated_filename(path);
+@@ -1910,12 +1912,15 @@ static PyObject *
+ posix_fchown(PyObject *self, PyObject *args)
+ {
+ int fd;
+- long uid, gid;
++ uid_t uid;
++ gid_t gid;
+ int res;
+- if (!PyArg_ParseTuple(args, "ill:chown", &fd, &uid, &gid))
++ if (!PyArg_ParseTuple(args, "iO&O&:chown", &fd,
++ _PyArg_ParseUid, &uid,
++ _PyArg_ParseGid, &gid))
+ return NULL;
+ Py_BEGIN_ALLOW_THREADS
+- res = fchown(fd, (uid_t) uid, (gid_t) gid);
++ res = fchown(fd, uid, gid);
+ Py_END_ALLOW_THREADS
+ if (res < 0)
+ return posix_error();
+@@ -1933,14 +1938,16 @@ static PyObject *
+ posix_lchown(PyObject *self, PyObject *args)
+ {
+ char *path = NULL;
+- long uid, gid;
++ uid_t uid;
++ gid_t gid;
+ int res;
+- if (!PyArg_ParseTuple(args, "etll:lchown",
++ if (!PyArg_ParseTuple(args, "etO&O&:lchown",
+ Py_FileSystemDefaultEncoding, &path,
+- &uid, &gid))
++ _PyArg_ParseUid, &uid,
++ _PyArg_ParseGid, &gid))
+ return NULL;
+ Py_BEGIN_ALLOW_THREADS
+- res = lchown(path, (uid_t) uid, (gid_t) gid);
++ res = lchown(path, uid, gid);
+ Py_END_ALLOW_THREADS
+ if (res < 0)
+ return posix_error_with_allocated_filename(path);
+@@ -3841,7 +3848,7 @@ Return the current process's effective g
+ static PyObject *
+ posix_getegid(PyObject *self, PyObject *noargs)
+ {
+- return PyInt_FromLong((long)getegid());
++ return _PyObject_FromGid(getegid());
+ }
+ #endif
+
+@@ -3854,7 +3861,7 @@ Return the current process's effective u
+ static PyObject *
+ posix_geteuid(PyObject *self, PyObject *noargs)
+ {
+- return PyInt_FromLong((long)geteuid());
++ return _PyObject_FromUid(geteuid());
+ }
+ #endif
+
+@@ -3867,7 +3874,7 @@ Return the current process's group id.")
+ static PyObject *
+ posix_getgid(PyObject *self, PyObject *noargs)
+ {
+- return PyInt_FromLong((long)getgid());
++ return _PyObject_FromGid(getgid());
+ }
+ #endif
+
+@@ -3942,7 +3949,7 @@ posix_getgroups(PyObject *self, PyObject
+ if (result != NULL) {
+ int i;
+ for (i = 0; i < n; ++i) {
+- PyObject *o = PyInt_FromLong((long)alt_grouplist[i]);
++ PyObject *o = _PyObject_FromGid(alt_grouplist[i]);
+ if (o == NULL) {
+ Py_DECREF(result);
+ result = NULL;
+@@ -3971,12 +3978,13 @@ static PyObject *
+ posix_initgroups(PyObject *self, PyObject *args)
+ {
+ char *username;
+- long gid;
++ gid_t gid;
+
+- if (!PyArg_ParseTuple(args, "sl:initgroups", &username, &gid))
++ if (!PyArg_ParseTuple(args, "sO&:initgroups", &username,
++ _PyArg_ParseGid, &gid))
+ return NULL;
+
+- if (initgroups(username, (gid_t) gid) == -1)
++ if (initgroups(username, gid) == -1)
+ return PyErr_SetFromErrno(PyExc_OSError);
+
+ Py_INCREF(Py_None);
+@@ -4090,7 +4098,7 @@ Return the current process's user id.");
+ static PyObject *
+ posix_getuid(PyObject *self, PyObject *noargs)
+ {
+- return PyInt_FromLong((long)getuid());
++ return _PyObject_FromUid(getuid());
+ }
+ #endif
+
+@@ -5736,15 +5744,9 @@ Set the current process's user id.");
+ static PyObject *
+ posix_setuid(PyObject *self, PyObject *args)
+ {
+- long uid_arg;
+ uid_t uid;
+- if (!PyArg_ParseTuple(args, "l:setuid", &uid_arg))
++ if (!PyArg_ParseTuple(args, "O&:setuid", _PyArg_ParseUid, &uid))
+ return NULL;
+- uid = uid_arg;
+- if (uid != uid_arg) {
+- PyErr_SetString(PyExc_OverflowError, "user id too big");
+- return NULL;
+- }
+ if (setuid(uid) < 0)
+ return posix_error();
+ Py_INCREF(Py_None);
+@@ -5761,15 +5763,9 @@ Set the current process's effective user
+ static PyObject *
+ posix_seteuid (PyObject *self, PyObject *args)
+ {
+- long euid_arg;
+ uid_t euid;
+- if (!PyArg_ParseTuple(args, "l", &euid_arg))
++ if (!PyArg_ParseTuple(args, "O&:seteuid", _PyArg_ParseUid,
&euid))
+ return NULL;
+- euid = euid_arg;
+- if (euid != euid_arg) {
+- PyErr_SetString(PyExc_OverflowError, "user id too big");
+- return NULL;
+- }
+ if (seteuid(euid) < 0) {
+ return posix_error();
+ } else {
+@@ -5787,15 +5783,9 @@ Set the current process's effective grou
+ static PyObject *
+ posix_setegid (PyObject *self, PyObject *args)
+ {
+- long egid_arg;
+ gid_t egid;
+- if (!PyArg_ParseTuple(args, "l", &egid_arg))
++ if (!PyArg_ParseTuple(args, "O&:setegid", _PyArg_ParseGid,
&egid))
+ return NULL;
+- egid = egid_arg;
+- if (egid != egid_arg) {
+- PyErr_SetString(PyExc_OverflowError, "group id too big");
+- return NULL;
+- }
+ if (setegid(egid) < 0) {
+ return posix_error();
+ } else {
+@@ -5813,23 +5803,11 @@ Set the current process's real and effec
+ static PyObject *
+ posix_setreuid (PyObject *self, PyObject *args)
+ {
+- long ruid_arg, euid_arg;
+ uid_t ruid, euid;
+- if (!PyArg_ParseTuple(args, "ll", &ruid_arg, &euid_arg))
++ if (!PyArg_ParseTuple(args, "O&O&",
++ _PyArg_ParseUid, &ruid,
++ _PyArg_ParseUid, &euid))
+ return NULL;
+- if (ruid_arg == -1)
+- ruid = (uid_t)-1; /* let the compiler choose how -1 fits */
+- else
+- ruid = ruid_arg; /* otherwise, assign from our long */
+- if (euid_arg == -1)
+- euid = (uid_t)-1;
+- else
+- euid = euid_arg;
+- if ((euid_arg != -1 && euid != euid_arg) ||
+- (ruid_arg != -1 && ruid != ruid_arg)) {
+- PyErr_SetString(PyExc_OverflowError, "user id too big");
+- return NULL;
+- }
+ if (setreuid(ruid, euid) < 0) {
+ return posix_error();
+ } else {
+@@ -5847,23 +5825,11 @@ Set the current process's real and effec
+ static PyObject *
+ posix_setregid (PyObject *self, PyObject *args)
+ {
+- long rgid_arg, egid_arg;
+ gid_t rgid, egid;
+- if (!PyArg_ParseTuple(args, "ll", &rgid_arg, &egid_arg))
++ if (!PyArg_ParseTuple(args, "O&O&",
++ _PyArg_ParseGid, &rgid,
++ _PyArg_ParseGid, &egid))
+ return NULL;
+- if (rgid_arg == -1)
+- rgid = (gid_t)-1; /* let the compiler choose how -1 fits */
+- else
+- rgid = rgid_arg; /* otherwise, assign from our long */
+- if (egid_arg == -1)
+- egid = (gid_t)-1;
+- else
+- egid = egid_arg;
+- if ((egid_arg != -1 && egid != egid_arg) ||
+- (rgid_arg != -1 && rgid != rgid_arg)) {
+- PyErr_SetString(PyExc_OverflowError, "group id too big");
+- return NULL;
+- }
+ if (setregid(rgid, egid) < 0) {
+ return posix_error();
+ } else {
+@@ -5881,15 +5847,9 @@ Set the current process's group id.");
+ static PyObject *
+ posix_setgid(PyObject *self, PyObject *args)
+ {
+- long gid_arg;
+ gid_t gid;
+- if (!PyArg_ParseTuple(args, "l:setgid", &gid_arg))
+- return NULL;
+- gid = gid_arg;
+- if (gid != gid_arg) {
+- PyErr_SetString(PyExc_OverflowError, "group id too big");
++ if (!PyArg_ParseTuple(args, "O&:setgid", _PyArg_ParseGid, &gid))
+ return NULL;
+- }
+ if (setgid(gid) < 0)
+ return posix_error();
+ Py_INCREF(Py_None);
+@@ -5922,39 +5882,10 @@ posix_setgroups(PyObject *self, PyObject
+ elem = PySequence_GetItem(groups, i);
+ if (!elem)
+ return NULL;
+- if (!PyInt_Check(elem)) {
+- if (!PyLong_Check(elem)) {
+- PyErr_SetString(PyExc_TypeError,
+- "groups must be integers");
+- Py_DECREF(elem);
+- return NULL;
+- } else {
+- unsigned long x = PyLong_AsUnsignedLong(elem);
+- if (PyErr_Occurred()) {
+- PyErr_SetString(PyExc_TypeError,
+- "group id too big");
+- Py_DECREF(elem);
+- return NULL;
+- }
+- grouplist[i] = x;
+- /* read back to see if it fits in gid_t */
+- if (grouplist[i] != x) {
+- PyErr_SetString(PyExc_TypeError,
+- "group id too big");
+- Py_DECREF(elem);
+- return NULL;
+- }
+- }
+- } else {
+- long x = PyInt_AsLong(elem);
+- grouplist[i] = x;
+- if (grouplist[i] != x) {
+- PyErr_SetString(PyExc_TypeError,
+- "group id too big");
+- Py_DECREF(elem);
+- return NULL;
+- }
+- }
++ if (!_PyArg_ParseGid(elem, &grouplist[i])) {
++ Py_DECREF(elem);
++ return NULL;
++ }
+ Py_DECREF(elem);
+ }
+
+@@ -8576,9 +8507,11 @@ Set the current process's real, effectiv
+ static PyObject*
+ posix_setresuid (PyObject *self, PyObject *args)
+ {
+- /* We assume uid_t is no larger than a long. */
+- long ruid, euid, suid;
+- if (!PyArg_ParseTuple(args, "lll", &ruid, &euid, &suid))
++ uid_t ruid, euid, suid;
++ if (!PyArg_ParseTuple(args, "O&O&O&",
++ _PyArg_ParseUid, &ruid,
++ _PyArg_ParseUid, &euid,
++ _PyArg_ParseUid, &suid))
+ return NULL;
+ if (setresuid(ruid, euid, suid) < 0)
+ return posix_error();
+@@ -8594,9 +8527,12 @@ Set the current process's real, effectiv
+ static PyObject*
+ posix_setresgid (PyObject *self, PyObject *args)
+ {
+- /* We assume uid_t is no larger than a long. */
+- long rgid, egid, sgid;
+- if (!PyArg_ParseTuple(args, "lll", &rgid, &egid, &sgid))
++ gid_t rgid, egid, sgid;
++ if (!PyArg_ParseTuple(args, "O&O&O&",
++ _PyArg_ParseGid, &rgid,
++ _PyArg_ParseGid, &egid,
++ _PyArg_ParseGid, &sgid))
++
+ return NULL;
+ if (setresgid(rgid, egid, sgid) < 0)
+ return posix_error();
+@@ -8613,14 +8549,13 @@ static PyObject*
+ posix_getresuid (PyObject *self, PyObject *noargs)
+ {
+ uid_t ruid, euid, suid;
+- long l_ruid, l_euid, l_suid;
++ PyObject *obj_ruid, *obj_euid, *obj_suid;
+ if (getresuid(&ruid, &euid, &suid) < 0)
+ return posix_error();
+- /* Force the values into long's as we don't know the size of uid_t. */
+- l_ruid = ruid;
+- l_euid = euid;
+- l_suid = suid;
+- return Py_BuildValue("(lll)", l_ruid, l_euid, l_suid);
++ obj_ruid = _PyObject_FromUid(ruid);
++ obj_euid = _PyObject_FromUid(euid);
++ obj_suid = _PyObject_FromUid(suid);
++ return Py_BuildValue("(NNN)", obj_ruid, obj_euid, obj_suid);
+ }
+ #endif
+
+@@ -8632,15 +8567,14 @@ Get tuple of the current process's real,
+ static PyObject*
+ posix_getresgid (PyObject *self, PyObject *noargs)
+ {
+- uid_t rgid, egid, sgid;
+- long l_rgid, l_egid, l_sgid;
++ gid_t rgid, egid, sgid;
++ PyObject *obj_rgid, *obj_egid, *obj_sgid;
+ if (getresgid(&rgid, &egid, &sgid) < 0)
+ return posix_error();
+- /* Force the values into long's as we don't know the size of uid_t. */
+- l_rgid = rgid;
+- l_egid = egid;
+- l_sgid = sgid;
+- return Py_BuildValue("(lll)", l_rgid, l_egid, l_sgid);
++ obj_rgid = _PyObject_FromGid(rgid);
++ obj_egid = _PyObject_FromGid(egid);
++ obj_sgid = _PyObject_FromGid(sgid);
++ return Py_BuildValue("(NNN)", obj_rgid, obj_egid, obj_sgid);
+ }
+ #endif
+
+diff -up Python-2.7.3/Modules/pwdmodule.c.uid-gid-overflows
Python-2.7.3/Modules/pwdmodule.c
+--- Python-2.7.3/Modules/pwdmodule.c.uid-gid-overflows 2012-04-09 19:07:34.000000000
-0400
++++ Python-2.7.3/Modules/pwdmodule.c 2012-05-17 14:47:20.263191561 -0400
+@@ -73,8 +73,8 @@ mkpwent(struct passwd *p)
+ #else
+ SETS(setIndex++, p->pw_passwd);
+ #endif
+- SETI(setIndex++, p->pw_uid);
+- SETI(setIndex++, p->pw_gid);
++ PyStructSequence_SET_ITEM(v, setIndex++, _PyObject_FromUid(p->pw_uid));
++ PyStructSequence_SET_ITEM(v, setIndex++, _PyObject_FromGid(p->pw_gid));
+ #ifdef __VMS
+ SETS(setIndex++, "");
+ #else
+@@ -103,13 +103,14 @@ See help(pwd) for more on password datab
+ static PyObject *
+ pwd_getpwuid(PyObject *self, PyObject *args)
+ {
+- unsigned int uid;
++ uid_t uid;
+ struct passwd *p;
+- if (!PyArg_ParseTuple(args, "I:getpwuid", &uid))
++ if (!PyArg_ParseTuple(args, "O&:getpwuid",
++ _PyArg_ParseUid, &uid))
+ return NULL;
+ if ((p = getpwuid(uid)) == NULL) {
+ PyErr_Format(PyExc_KeyError,
+- "getpwuid(): uid not found: %d", uid);
++ "getpwuid(): uid not found: %lu", (unsigned long)uid);
+ return NULL;
+ }
+ return mkpwent(p);
+diff -up Python-2.7.3/Python/getargs.c.uid-gid-overflows Python-2.7.3/Python/getargs.c
+--- Python-2.7.3/Python/getargs.c.uid-gid-overflows 2012-04-09 19:07:35.000000000 -0400
++++ Python-2.7.3/Python/getargs.c 2012-05-15 18:57:52.229433979 -0400
+@@ -4,6 +4,7 @@
+ #include "Python.h"
+
+ #include <ctype.h>
++#include <limits.h>
+
+
+ #ifdef __cplusplus
+@@ -1902,6 +1903,110 @@ _PyArg_NoKeywords(const char *funcname,
+ funcname);
+ return 0;
+ }
++
++PyObject *
++_PyObject_FromUid(uid_t uid)
++{
++ if (uid <= (uid_t)LONG_MAX) {
++ return PyInt_FromLong((uid_t)uid);
++ } else {
++ return PyLong_FromUnsignedLong((uid_t)uid);
++ }
++}
++
++PyObject *
++_PyObject_FromGid(gid_t gid)
++{
++ if (gid <= (gid_t)LONG_MAX) {
++ return PyInt_FromLong((gid_t)gid);
++ } else {
++ return PyLong_FromUnsignedLong((gid_t)gid);
++ }
++}
++
++int
++_PyArg_ParseUid(PyObject *in_obj, uid_t *out_uid)
++{
++ PyObject *index, *number = NULL;
++ long sl;
++ unsigned long ul;
++
++ assert(out_uid);
++
++ index = PyNumber_Index(in_obj);
++ if (index != NULL) {
++ number = PyNumber_Long(index);
++ Py_DECREF(index);
++ }
++ if (number == NULL) {
++ PyErr_SetString(PyExc_TypeError, "user id must be integer");
++ return 0;
++ }
++
++ /* Special case: support -1 (e.g. for use by chown) */
++ sl = PyLong_AsLong(number);
++ if (PyErr_Occurred()) {
++ PyErr_Clear();
++ } else if (sl == -1) {
++ Py_DECREF(number);
++ *out_uid = (uid_t)-1;
++ return 1;
++ }
++
++ /* Otherwise, it must be >= 0 */
++ ul = PyLong_AsUnsignedLong(number);
++ Py_DECREF(number);
++ *out_uid = ul;
++ /* read back the value to see if it fitted in uid_t */
++ if (PyErr_Occurred() || *out_uid != ul) {
++ PyErr_SetString(PyExc_OverflowError,
++ "user id is not in range(-1, 2^32-1)");
++ return 0;
++ }
++ return 1;
++}
++
++int
++_PyArg_ParseGid(PyObject *in_obj, gid_t *out_gid)
++{
++ PyObject *index, *number = NULL;
++ long sl;
++ unsigned long ul;
++
++ assert(out_gid);
++
++ index = PyNumber_Index(in_obj);
++ if (index != NULL) {
++ number = PyNumber_Long(index);
++ Py_DECREF(index);
++ }
++ if (number == NULL) {
++ PyErr_SetString(PyExc_TypeError, "group id must be integer");
++ return 0;
++ }
++
++ /* Special case: support -1 (e.g. for use by chown) */
++ sl = PyLong_AsLong(number);
++ if (PyErr_Occurred()) {
++ PyErr_Clear();
++ } else if (sl == -1) {
++ Py_DECREF(number);
++ *out_gid = (gid_t)-1;
++ return 1;
++ }
++
++ ul = PyLong_AsUnsignedLong(number);
++ Py_DECREF(number);
++ *out_gid = ul;
++ /* read back the value to see if it fitted in gid_t */
++ if (PyErr_Occurred() || *out_gid != ul) {
++ PyErr_SetString(PyExc_OverflowError,
++ "group id is not in range(-1, 2^32-1)");
++ return 0;
++ }
++ return 1;
++}
++
+ #ifdef __cplusplus
+ };
+ #endif
diff --git a/python.spec b/python.spec
index b8a50d8..90c2100 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.3
-Release: 7%{?dist}
+Release: 8%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -668,6 +668,22 @@ Patch155: 00155-avoid-ctypes-thunks.patch
# Not yet sent upstream
Patch156: 00156-gdb-autoload-safepath.patch
+# 00157 #
+# Update uid/gid handling throughout the standard library: uid_t and gid_t are
+# unsigned 32-bit values, but existing code often passed them through C long
+# values, which are signed 32-bit values on 32-bit architectures, leading to
+# negative int objects for uid/gid values >= 2^31 on 32-bit architectures.
+#
+# Introduce _PyObject_FromUid/Gid to convert uid_t/gid_t values to python
+# objects, using int objects where the value will fit (long objects otherwise),
+# and _PyArg_ParseUid/Gid to convert int/long to uid_t/gid_t, with -1 allowed
+# as a special case (since this is given special meaning by the chown syscall)
+#
+# Update standard library to use this throughout for uid/gid values, so that
+# very large uid/gid values are round-trippable, and -1 remains usable.
+# (rhbz#697470)
+Patch157: 00157-uid-gid-overflows.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -989,6 +1005,7 @@ done
# 00154: not for python 2
%patch155 -p1
%patch156 -p1
+%patch157 -p1 -b .uid-gid-overflows
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -1819,6 +1836,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Tue May 15 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-8
+- update uid/gid handling to avoid int overflows seen with uid/gid
+values >= 2^31 on 32-bit architectures (patch 157; rhbz#697470)
+
* Fri May 4 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-7
- renumber autotools patch from 300 to 5000
- specfile cleanups
commit 48617b34b769c71fcd8e5a0585967b8e6730d70e
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Fri May 11 19:35:48 2012 -0400
add notes on upstream status of various patches
diff --git a/python.spec b/python.spec
index a1351bb..b8a50d8 100644
--- a/python.spec
+++ b/python.spec
@@ -376,6 +376,7 @@ Patch104: 00104-lib64-fix-for-test_install.patch
# 00111 #
# Patch the Makefile.pre.in so that the generated Makefile doesn't try to build
# a libpythonMAJOR.MINOR.a (bug 550692):
+# Downstream only: not appropriate for upstream
Patch111: 00111-no-static-lib.patch
# 00112 #
@@ -448,11 +449,13 @@ Patch112: python-2.7.3-debug-build.patch
# described at
http://svn.python.org/projects/python/trunk/Misc/SpecialBuilds.txt
# so that if they are enabled, they will be in that build's pyconfig.h, so that
# extension modules will reliably use them
+# Not yet sent upstream
Patch113: 00113-more-configuration-flags.patch
# 00114 #
# Add flags for statvfs.f_flag to the constant list in posixmodule (i.e. "os")
# (rhbz:553020); partially upstream as
http://bugs.python.org/issue7647
+# Not yet sent upstream
Patch114: 00114-statvfs-f_flag-constants.patch
# Upstream as of Python 2.7.3:
@@ -479,7 +482,7 @@ Patch121: python-2.7rc2-r79310.patch
# emitting debug info to stdout on exit is too verbose and makes it harder to
# use the debug build. Add a "PYTHONDUMPCOUNTS" environment variable which
# must be set to enable the output on exit
-# Not yet sent upstream:
+# Not yet sent upstream
Patch125: 00125-less-verbose-COUNT_ALLOCS.patch
# Fix dbm module on big-endian 64-bit
@@ -574,6 +577,7 @@ Patch140: 00140-skip-test_ctypes-known-failure-on-sparc.patch
# 00141 #
# Fix test_gc's test_newinstance case when configured with COUNT_ALLOCS:
+# Not yet sent upstream
Patch141: 00141-fix-test_gc_with_COUNT_ALLOCS.patch
# 00142 #
@@ -644,6 +648,7 @@ Patch147: 00147-add-debug-malloc-stats.patch
# Strip out lines of the form "warning: Unable to open ..." from gdb's
stderr
# when running test_gdb.py; also cope with change to gdb in F17 onwards in
# which values are printed as "v@entry" rather than just "v":
+# Not yet sent upstream
Patch153: 00153-fix-test_gdb-noise.patch
# 00154 #
@@ -660,6 +665,7 @@ Patch155: 00155-avoid-ctypes-thunks.patch
# Recent builds of gdb will only auto-load scripts from certain safe
# locations. Turn off this protection when running test_gdb in the selftest
# suite to ensure that it can load our -gdb.py script (rhbz#817072):
+# Not yet sent upstream
Patch156: 00156-gdb-autoload-safepath.patch
# (New patches go here ^^^)
commit e85703c5ddf22f454d143689cbb86146c4d270f9
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Fri May 11 18:42:11 2012 -0400
add link to upstream report for patch 147
diff --git a/python.spec b/python.spec
index 2e9db28..a1351bb 100644
--- a/python.spec
+++ b/python.spec
@@ -615,7 +615,7 @@ Patch146: 00146-hashlib-fips.patch
# 00147 #
# Add a sys._debugmallocstats() function
# Based on patch 202 from RHEL 5's python.spec, with updates from rhbz#737198
-# Not yet sent upstream
+# Sent upstream as
http://bugs.python.org/issue14785
Patch147: 00147-add-debug-malloc-stats.patch
# 00148 #
commit f522dd7cec6513ec38203997b0b3e4afcaa20bfe
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Fri May 4 15:52:41 2012 -0400
reorder the %configure arguments (alphabetically) to help with python vs python3
diffs
diff --git a/python.spec b/python.spec
index e5c1f3f..2e9db28 100644
--- a/python.spec
+++ b/python.spec
@@ -1059,18 +1059,18 @@ BuildPython() {
%configure \
--enable-ipv6 \
- --enable-unicode=%{unicode} \
--enable-shared \
+ --enable-unicode=%{unicode} \
+ --with-dbmliborder=gdbm:ndbm:bdb \
+ --with-system-expat \
--with-system-ffi \
-%if 0%{?with_valgrind}
- --with-valgrind \
-%endif
%if 0%{?with_systemtap}
--with-dtrace \
--with-tapset-install-dir=%{tapsetdir} \
%endif
- --with-system-expat \
- --with-dbmliborder=gdbm:ndbm:bdb \
+%if 0%{?with_valgrind}
+ --with-valgrind \
+%endif
$ExtraConfigArgs \
%{nil}
commit 4989575f9a288ea565a1fa98c095cc55a410443d
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Fri May 4 15:42:02 2012 -0400
2.7.3-7: renumber autotools patch from 300 to 5000
diff --git a/05000-autotool-intermediates.patch b/05000-autotool-intermediates.patch
new file mode 100644
index 0000000..790cd27
--- /dev/null
+++ b/05000-autotool-intermediates.patch
@@ -0,0 +1,2720 @@
+diff -up ./configure.autotool-intermediates ./configure
+--- ./configure.autotool-intermediates 2012-04-11 18:35:27.009518662 -0400
++++ ./configure 2012-04-11 18:35:27.852508123 -0400
+@@ -1,7 +1,7 @@
+ #! /bin/sh
+ # From configure.in Revision.
+ # Guess values for system-dependent variables and create Makefiles.
+-# Generated by GNU Autoconf 2.67 for python 2.7.
++# Generated by GNU Autoconf 2.68 for python 2.7.
+ #
+ # Report bugs to <
http://bugs.python.org/>.
+ #
+@@ -92,6 +92,7 @@ fi
+ IFS=" "" $as_nl"
+
+ # Find who we are. Look in the path if we contain no directory separator.
++as_myself=
+ case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+@@ -217,11 +218,18 @@ IFS=$as_save_IFS
+ # We cannot yet assume a decent shell, so we have to provide a
+ # neutralization value for shells without unset; and this also
+ # works around shells that cannot unset nonexistent variables.
++ # Preserve -v and -x to the replacement shell.
+ BASH_ENV=/dev/null
+ ENV=/dev/null
+ (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+ export CONFIG_SHELL
+- exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
++ case $- in # ((((
++ *v*x* | *x*v* ) as_opts=-vx ;;
++ *v* ) as_opts=-v ;;
++ *x* ) as_opts=-x ;;
++ * ) as_opts= ;;
++ esac
++ exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+ fi
+
+ if test x$as_have_required = xno; then :
+@@ -611,6 +619,8 @@ TRUE
+ MACHDEP_OBJS
+ DYNLOADFILE
+ DLINCLDIR
++DTRACEHDRS
++DTRACEOBJS
+ THREADOBJ
+ LDLAST
+ USE_THREAD_MODULE
+@@ -631,6 +641,8 @@ OTHER_LIBTOOL_OPT
+ UNIVERSAL_ARCH_FLAGS
+ BASECFLAGS
+ OPT
++DEBUG_SUFFIX
++DEBUG_EXT
+ LN
+ INSTALL_DATA
+ INSTALL_SCRIPT
+@@ -752,8 +764,11 @@ with_pth
+ enable_ipv6
+ with_doc_strings
+ with_tsc
++with_count_allocs
++with_call_profile
+ with_pymalloc
+ with_valgrind
++with_dtrace
+ with_wctype_functions
+ with_fpectl
+ with_libm
+@@ -1174,7 +1189,7 @@ Try \`$0 --help' for more information"
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target"
>&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null
&&
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+- : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
++ : "${build_alias=$ac_option} ${host_alias=$ac_option}
${target_alias=$ac_option}"
+ ;;
+
+ esac
+@@ -1427,8 +1442,11 @@ Optional Packages:
+ --with-pth use GNU pth threading libraries
+ --with(out)-doc-strings disable/enable documentation strings
+ --with(out)-tsc enable/disable timestamp counter profile
++ --with(out)count-allocs enable/disable per-type instance accounting
++ --with(out)-call-profile enable/disable statistics on function call invocation
+ --with(out)-pymalloc disable/enable specialized mallocs
+ --with-valgrind Enable Valgrind support
++ --with(out)-dtrace disable/enable dtrace support
+ --with-wctype-functions use wctype.h functions
+ --with-fpectl enable SIGFPE catching
+ --with-libm=STRING math library
+@@ -1511,7 +1529,7 @@ test -n "$ac_init_help" && exit $ac_stat
+ if $ac_init_version; then
+ cat <<\_ACEOF
+ python configure 2.7
+-generated by GNU Autoconf 2.67
++generated by GNU Autoconf 2.68
+
+ Copyright (C) 2010 Free Software Foundation, Inc.
+ This configure script is free software; the Free Software Foundation
+@@ -1557,7 +1575,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+ fi
+- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+ } # ac_fn_c_try_compile
+@@ -1594,7 +1612,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+ fi
+- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+ } # ac_fn_c_try_cpp
+@@ -1607,10 +1625,10 @@ fi
+ ac_fn_c_check_header_mongrel ()
+ {
+ as_lineno=${as_lineno-"$1"}
as_lineno_stack=as_lineno_stack=$as_lineno_stack
+- if eval "test \"\${$3+set}\"" = set; then :
++ if eval \${$3+:} false; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+ $as_echo_n "checking for $2... " >&6; }
+-if eval "test \"\${$3+set}\"" = set; then :
++if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+ fi
+ eval ac_res=\$$3
+@@ -1677,7 +1695,7 @@ $as_echo "$as_me: WARNING: $2: proceedin
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+ $as_echo_n "checking for $2... " >&6; }
+-if eval "test \"\${$3+set}\"" = set; then :
++if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ eval "$3=\$ac_header_compiler"
+@@ -1686,7 +1704,7 @@ eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+ $as_echo "$ac_res" >&6; }
+ fi
+- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+ } # ac_fn_c_check_header_mongrel
+
+@@ -1727,7 +1745,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
+ ac_retval=$ac_status
+ fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+ } # ac_fn_c_try_run
+@@ -1741,7 +1759,7 @@ ac_fn_c_check_header_compile ()
+ as_lineno=${as_lineno-"$1"}
as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+ $as_echo_n "checking for $2... " >&6; }
+-if eval "test \"\${$3+set}\"" = set; then :
++if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -1759,7 +1777,7 @@ fi
+ eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+ $as_echo "$ac_res" >&6; }
+- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+ } # ac_fn_c_check_header_compile
+
+@@ -1804,7 +1822,7 @@ fi
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+ } # ac_fn_c_try_link
+@@ -1818,7 +1836,7 @@ ac_fn_c_check_type ()
+ as_lineno=${as_lineno-"$1"}
as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+ $as_echo_n "checking for $2... " >&6; }
+-if eval "test \"\${$3+set}\"" = set; then :
++if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ eval "$3=no"
+@@ -1859,7 +1877,7 @@ fi
+ eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+ $as_echo "$ac_res" >&6; }
+- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+ } # ac_fn_c_check_type
+
+@@ -1872,7 +1890,7 @@ ac_fn_c_find_uintX_t ()
+ as_lineno=${as_lineno-"$1"}
as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5
+ $as_echo_n "checking for uint$2_t... " >&6; }
+-if eval "test \"\${$3+set}\"" = set; then :
++if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ eval "$3=no"
+@@ -1912,7 +1930,7 @@ fi
+ eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+ $as_echo "$ac_res" >&6; }
+- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+ } # ac_fn_c_find_uintX_t
+
+@@ -1925,7 +1943,7 @@ ac_fn_c_find_intX_t ()
+ as_lineno=${as_lineno-"$1"}
as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5
+ $as_echo_n "checking for int$2_t... " >&6; }
+-if eval "test \"\${$3+set}\"" = set; then :
++if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ eval "$3=no"
+@@ -1986,7 +2004,7 @@ fi
+ eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+ $as_echo "$ac_res" >&6; }
+- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+ } # ac_fn_c_find_intX_t
+
+@@ -2163,7 +2181,7 @@ rm -f core *.core core.conftest.* gmon.o
+ rm -f conftest.val
+
+ fi
+- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+ } # ac_fn_c_compute_int
+@@ -2176,7 +2194,7 @@ ac_fn_c_check_func ()
+ as_lineno=${as_lineno-"$1"}
as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+ $as_echo_n "checking for $2... " >&6; }
+-if eval "test \"\${$3+set}\"" = set; then :
++if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -2231,7 +2249,7 @@ fi
+ eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+ $as_echo "$ac_res" >&6; }
+- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+ } # ac_fn_c_check_func
+
+@@ -2244,7 +2262,7 @@ ac_fn_c_check_member ()
+ as_lineno=${as_lineno-"$1"}
as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
+ $as_echo_n "checking for $2.$3... " >&6; }
+-if eval "test \"\${$4+set}\"" = set; then :
++if eval \${$4+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -2288,7 +2306,7 @@ fi
+ eval ac_res=\$$4
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+ $as_echo "$ac_res" >&6; }
+- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+ } # ac_fn_c_check_member
+
+@@ -2303,7 +2321,7 @@ ac_fn_c_check_decl ()
+ as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/)
0& (/g'`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is
declared" >&5
+ $as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+-if eval "test \"\${$3+set}\"" = set; then :
++if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -2334,7 +2352,7 @@ fi
+ eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+ $as_echo "$ac_res" >&6; }
+- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+ } # ac_fn_c_check_decl
+ cat >config.log <<_ACEOF
+@@ -2342,7 +2360,7 @@ This file contains any messages produced
+ running configure, to aid debugging if configure makes a mistake.
+
+ It was created by python $as_me 2.7, which was
+-generated by GNU Autoconf 2.67. Invocation command line was
++generated by GNU Autoconf 2.68. Invocation command line was
+
+ $ $0 $@
+
+@@ -2600,7 +2618,7 @@ $as_echo "$as_me: loading site script $a
+ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error $? "failed to load site script $ac_site_file
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ done
+
+@@ -3241,7 +3259,7 @@ if test -n "$ac_tool_prefix"; then
+ set dummy ${ac_tool_prefix}gcc; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if test "${ac_cv_prog_CC+set}" = set; then :
++if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$CC"; then
+@@ -3281,7 +3299,7 @@ if test -z "$ac_cv_prog_CC"; then
+ set dummy gcc; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
++if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$ac_ct_CC"; then
+@@ -3334,7 +3352,7 @@ if test -z "$CC"; then
+ set dummy ${ac_tool_prefix}cc; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if test "${ac_cv_prog_CC+set}" = set; then :
++if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$CC"; then
+@@ -3374,7 +3392,7 @@ if test -z "$CC"; then
+ set dummy cc; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if test "${ac_cv_prog_CC+set}" = set; then :
++if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$CC"; then
+@@ -3433,7 +3451,7 @@ if test -z "$CC"; then
+ set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if test "${ac_cv_prog_CC+set}" = set; then :
++if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$CC"; then
+@@ -3477,7 +3495,7 @@ do
+ set dummy $ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
++if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$ac_ct_CC"; then
+@@ -3532,7 +3550,7 @@ fi
+ test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}:
error: in \`$ac_pwd':" >&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error $? "no acceptable C compiler found in \$PATH
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+
+ # Provide some information about the compiler.
+ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version"
>&5
+@@ -3647,7 +3665,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "C compiler cannot create executables
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ $as_echo "yes" >&6; }
+@@ -3690,7 +3708,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ rm -f conftest conftest$ac_cv_exeext
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+@@ -3749,7 +3767,7 @@ $as_echo "$ac_try_echo"; } >&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error $? "cannot run C compiled programs.
+ If you meant to cross compile, use \`--host'.
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ fi
+ fi
+@@ -3760,7 +3778,7 @@ rm -f conftest.$ac_ext conftest$ac_cv_ex
+ ac_clean_files=$ac_clean_files_save
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files"
>&5
+ $as_echo_n "checking for suffix of object files... " >&6; }
+-if test "${ac_cv_objext+set}" = set; then :
++if ${ac_cv_objext+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -3801,7 +3819,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error $? "cannot compute suffix of object files: cannot compile
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ rm -f conftest.$ac_cv_objext conftest.$ac_ext
+ fi
+@@ -3811,7 +3829,7 @@ OBJEXT=$ac_cv_objext
+ ac_objext=$OBJEXT
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C
compiler" >&5
+ $as_echo_n "checking whether we are using the GNU C compiler... " >&6;
}
+-if test "${ac_cv_c_compiler_gnu+set}" = set; then :
++if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -3848,7 +3866,7 @@ ac_test_CFLAGS=${CFLAGS+set}
+ ac_save_CFLAGS=$CFLAGS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g"
>&5
+ $as_echo_n "checking whether $CC accepts -g... " >&6; }
+-if test "${ac_cv_prog_cc_g+set}" = set; then :
++if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+@@ -3926,7 +3944,7 @@ else
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO
C89" >&5
+ $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+-if test "${ac_cv_prog_cc_c89+set}" = set; then :
++if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_cv_prog_cc_c89=no
+@@ -4065,7 +4083,7 @@ then
+ set dummy g++; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if test "${ac_cv_path_CXX+set}" = set; then :
++if ${ac_cv_path_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ case $CXX in
+@@ -4106,7 +4124,7 @@ fi
+ set dummy c++; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if test "${ac_cv_path_CXX+set}" = set; then :
++if ${ac_cv_path_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ case $CXX in
+@@ -4157,7 +4175,7 @@ do
+ set dummy $ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if test "${ac_cv_prog_CXX+set}" = set; then :
++if ${ac_cv_prog_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$CXX"; then
+@@ -4228,7 +4246,7 @@ if test -n "$CPP" && test -d "$CPP";
the
+ CPP=
+ fi
+ if test -z "$CPP"; then
+- if test "${ac_cv_prog_CPP+set}" = set; then :
++ if ${ac_cv_prog_CPP+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ # Double quotes because CPP needs to be expanded
+@@ -4344,7 +4362,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ fi
+
+ ac_ext=c
+@@ -4356,7 +4374,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines
and -e" >&5
+ $as_echo_n "checking for grep that handles long lines and -e... " >&6;
}
+-if test "${ac_cv_path_GREP+set}" = set; then :
++if ${ac_cv_path_GREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test -z "$GREP"; then
+@@ -4419,7 +4437,7 @@ $as_echo "$ac_cv_path_GREP" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+ $as_echo_n "checking for egrep... " >&6; }
+-if test "${ac_cv_path_EGREP+set}" = set; then :
++if ${ac_cv_path_EGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+@@ -4486,7 +4504,7 @@ $as_echo "$ac_cv_path_EGREP" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files"
>&5
+ $as_echo_n "checking for ANSI C header files... " >&6; }
+-if test "${ac_cv_header_stdc+set}" = set; then :
++if ${ac_cv_header_stdc+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -4615,7 +4633,7 @@ done
+
+
+ ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h"
"ac_cv_header_minix_config_h" "$ac_includes_default"
+-if test "x$ac_cv_header_minix_config_h" = x""yes; then :
++if test "x$ac_cv_header_minix_config_h" = xyes; then :
+ MINIX=yes
+ else
+ MINIX=
+@@ -4637,7 +4655,7 @@ $as_echo "#define _MINIX 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define
__EXTENSIONS__" >&5
+ $as_echo_n "checking whether it is safe to define __EXTENSIONS__... "
>&6; }
+-if test "${ac_cv_safe_to_define___extensions__+set}" = set; then :
++if ${ac_cv_safe_to_define___extensions__+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -4747,7 +4765,7 @@ esac
+ $as_echo_n "checking LIBRARY... " >&6; }
+ if test -z "$LIBRARY"
+ then
+- LIBRARY='libpython$(VERSION).a'
++ LIBRARY='libpython$(VERSION)$(DEBUG_EXT).a'
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBRARY" >&5
+ $as_echo "$LIBRARY" >&6; }
+@@ -4921,8 +4939,8 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>
+ INSTSONAME="$LDLIBRARY".$SOVERSION
+ ;;
+ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*)
+- LDLIBRARY='libpython$(VERSION).so'
+- BLDLIBRARY='-L. -lpython$(VERSION)'
++ LDLIBRARY='libpython$(VERSION)$(DEBUG_EXT).so'
++ BLDLIBRARY='-L. -lpython$(VERSION)$(DEBUG_EXT)'
+ RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
+ case $ac_sys_system in
+ FreeBSD*)
+@@ -4945,7 +4963,7 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>
+ ;;
+ OSF*)
+ LDLIBRARY='libpython$(VERSION).so'
+- BLDLIBRARY='-rpath $(LIBDIR) -L. -lpython$(VERSION)'
++ BLDLIBRARY='-L. -lpython$(VERSION)'
+ RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
+ ;;
+ atheos*)
+@@ -4981,7 +4999,7 @@ if test -n "$ac_tool_prefix"; then
+ set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if test "${ac_cv_prog_RANLIB+set}" = set; then :
++if ${ac_cv_prog_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$RANLIB"; then
+@@ -5021,7 +5039,7 @@ if test -z "$ac_cv_prog_RANLIB"; then
+ set dummy ranlib; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then :
++if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$ac_ct_RANLIB"; then
+@@ -5075,7 +5093,7 @@ do
+ set dummy $ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if test "${ac_cv_prog_AR+set}" = set; then :
++if ${ac_cv_prog_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$AR"; then
+@@ -5125,7 +5143,7 @@ fi
+ set dummy svnversion; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if test "${ac_cv_prog_SVNVERSION+set}" = set; then :
++if ${ac_cv_prog_SVNVERSION+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$SVNVERSION"; then
+@@ -5173,7 +5191,7 @@ fi
+ set dummy hg; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if test "${ac_cv_prog_HAS_HG+set}" = set; then :
++if ${ac_cv_prog_HAS_HG+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$HAS_HG"; then
+@@ -5272,7 +5290,7 @@ ac_configure="$SHELL $ac_aux_dir/configu
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible
install" >&5
+ $as_echo_n "checking for a BSD-compatible install... " >&6; }
+ if test -z "$INSTALL"; then
+-if test "${ac_cv_path_install+set}" = set; then :
++if ${ac_cv_path_install+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+@@ -5384,6 +5402,14 @@ $as_echo "no" >&6; }
+ fi
+
+
++if test "$Py_DEBUG" = 'true'
++then
++ DEBUG_EXT=_d
++ DEBUG_SUFFIX=-debug
++fi
++
++
++
+ # XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
+ # merged with this chunk of code?
+
+@@ -5460,7 +5486,7 @@ yes)
+ $as_echo_n "checking whether $CC accepts -fno-strict-aliasing... " >&6;
}
+ ac_save_cc="$CC"
+ CC="$CC -fno-strict-aliasing"
+- if test "${ac_cv_no_strict_aliasing_ok+set}" = set; then :
++ if ${ac_cv_no_strict_aliasing_ok+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -5650,7 +5676,7 @@ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts
-OPT:Olimit=0" >&5
+ $as_echo_n "checking whether $CC accepts -OPT:Olimit=0... " >&6; }
+-if test "${ac_cv_opt_olimit_ok+set}" = set; then :
++if ${ac_cv_opt_olimit_ok+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_save_cc="$CC"
+@@ -5692,7 +5718,7 @@ if test $ac_cv_opt_olimit_ok = yes; then
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Olimit
1500" >&5
+ $as_echo_n "checking whether $CC accepts -Olimit 1500... " >&6; }
+- if test "${ac_cv_olimit_ok+set}" = set; then :
++ if ${ac_cv_olimit_ok+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_save_cc="$CC"
+@@ -5770,7 +5796,7 @@ fi
+ # options before we can check whether -Kpthread improves anything.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads are available
without options" >&5
+ $as_echo_n "checking whether pthreads are available without options... "
>&6; }
+-if test "${ac_cv_pthread_is_default+set}" = set; then :
++if ${ac_cv_pthread_is_default+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test "$cross_compiling" = yes; then :
+@@ -5823,7 +5849,7 @@ else
+ # function available.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts
-Kpthread" >&5
+ $as_echo_n "checking whether $CC accepts -Kpthread... " >&6; }
+-if test "${ac_cv_kpthread+set}" = set; then :
++if ${ac_cv_kpthread+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_save_cc="$CC"
+@@ -5872,7 +5898,7 @@ then
+ # function available.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts
-Kthread" >&5
+ $as_echo_n "checking whether $CC accepts -Kthread... " >&6; }
+-if test "${ac_cv_kthread+set}" = set; then :
++if ${ac_cv_kthread+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_save_cc="$CC"
+@@ -5921,7 +5947,7 @@ then
+ # function available.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts
-pthread" >&5
+ $as_echo_n "checking whether $CC accepts -pthread... " >&6; }
+-if test "${ac_cv_thread+set}" = set; then :
++if ${ac_cv_thread+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_save_cc="$CC"
+@@ -6006,7 +6032,7 @@ CXX="$ac_save_cxx"
+ # checks for header files
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files"
>&5
+ $as_echo_n "checking for ANSI C header files... " >&6; }
+-if test "${ac_cv_header_stdc+set}" = set; then :
++if ${ac_cv_header_stdc+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -6145,7 +6171,7 @@ for ac_hdr in dirent.h sys/ndir.h sys/di
+ as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines
DIR" >&5
+ $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; }
+-if eval "test \"\${$as_ac_Header+set}\"" = set; then :
++if eval \${$as_ac_Header+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -6185,7 +6211,7 @@ done
+ if test $ac_header_dirent = dirent.h; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing
opendir" >&5
+ $as_echo_n "checking for library containing opendir... " >&6; }
+-if test "${ac_cv_search_opendir+set}" = set; then :
++if ${ac_cv_search_opendir+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_func_search_save_LIBS=$LIBS
+@@ -6219,11 +6245,11 @@ for ac_lib in '' dir; do
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+- if test "${ac_cv_search_opendir+set}" = set; then :
++ if ${ac_cv_search_opendir+:} false; then :
+ break
+ fi
+ done
+-if test "${ac_cv_search_opendir+set}" = set; then :
++if ${ac_cv_search_opendir+:} false; then :
+
+ else
+ ac_cv_search_opendir=no
+@@ -6242,7 +6268,7 @@ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing
opendir" >&5
+ $as_echo_n "checking for library containing opendir... " >&6; }
+-if test "${ac_cv_search_opendir+set}" = set; then :
++if ${ac_cv_search_opendir+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_func_search_save_LIBS=$LIBS
+@@ -6276,11 +6302,11 @@ for ac_lib in '' x; do
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+- if test "${ac_cv_search_opendir+set}" = set; then :
++ if ${ac_cv_search_opendir+:} false; then :
+ break
+ fi
+ done
+-if test "${ac_cv_search_opendir+set}" = set; then :
++if ${ac_cv_search_opendir+:} false; then :
+
+ else
+ ac_cv_search_opendir=no
+@@ -6300,7 +6326,7 @@ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sys/types.h defines
makedev" >&5
+ $as_echo_n "checking whether sys/types.h defines makedev... " >&6; }
+-if test "${ac_cv_header_sys_types_h_makedev+set}" = set; then :
++if ${ac_cv_header_sys_types_h_makedev+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -6328,7 +6354,7 @@ $as_echo "$ac_cv_header_sys_types_h_make
+
+ if test $ac_cv_header_sys_types_h_makedev = no; then
+ ac_fn_c_check_header_mongrel "$LINENO" "sys/mkdev.h"
"ac_cv_header_sys_mkdev_h" "$ac_includes_default"
+-if test "x$ac_cv_header_sys_mkdev_h" = x""yes; then :
++if test "x$ac_cv_header_sys_mkdev_h" = xyes; then :
+
+ $as_echo "#define MAJOR_IN_MKDEV 1" >>confdefs.h
+
+@@ -6338,7 +6364,7 @@ fi
+
+ if test $ac_cv_header_sys_mkdev_h = no; then
+ ac_fn_c_check_header_mongrel "$LINENO" "sys/sysmacros.h"
"ac_cv_header_sys_sysmacros_h" "$ac_includes_default"
+-if test "x$ac_cv_header_sys_sysmacros_h" = x""yes; then :
++if test "x$ac_cv_header_sys_sysmacros_h" = xyes; then :
+
+ $as_echo "#define MAJOR_IN_SYSMACROS 1" >>confdefs.h
+
+@@ -6358,7 +6384,7 @@ do :
+ #endif
+
+ "
+-if test "x$ac_cv_header_term_h" = x""yes; then :
++if test "x$ac_cv_header_term_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_TERM_H 1
+ _ACEOF
+@@ -6380,7 +6406,7 @@ do :
+ #endif
+
+ "
+-if test "x$ac_cv_header_linux_netlink_h" = x""yes; then :
++if test "x$ac_cv_header_linux_netlink_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_LINUX_NETLINK_H 1
+ _ACEOF
+@@ -6543,7 +6569,7 @@ EOF
+
+ # Type availability checks
+ ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t"
"$ac_includes_default"
+-if test "x$ac_cv_type_mode_t" = x""yes; then :
++if test "x$ac_cv_type_mode_t" = xyes; then :
+
+ else
+
+@@ -6554,7 +6580,7 @@ _ACEOF
+ fi
+
+ ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t"
"$ac_includes_default"
+-if test "x$ac_cv_type_off_t" = x""yes; then :
++if test "x$ac_cv_type_off_t" = xyes; then :
+
+ else
+
+@@ -6565,7 +6591,7 @@ _ACEOF
+ fi
+
+ ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t"
"$ac_includes_default"
+-if test "x$ac_cv_type_pid_t" = x""yes; then :
++if test "x$ac_cv_type_pid_t" = xyes; then :
+
+ else
+
+@@ -6581,7 +6607,7 @@ cat >>confdefs.h <<_ACEOF
+ _ACEOF
+
+ ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t"
"$ac_includes_default"
+-if test "x$ac_cv_type_size_t" = x""yes; then :
++if test "x$ac_cv_type_size_t" = xyes; then :
+
+ else
+
+@@ -6593,7 +6619,7 @@ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h"
>&5
+ $as_echo_n "checking for uid_t in sys/types.h... " >&6; }
+-if test "${ac_cv_type_uid_t+set}" = set; then :
++if ${ac_cv_type_uid_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -6672,7 +6698,7 @@ _ACEOF
+ esac
+
+ ac_fn_c_check_type "$LINENO" "ssize_t"
"ac_cv_type_ssize_t" "$ac_includes_default"
+-if test "x$ac_cv_type_ssize_t" = x""yes; then :
++if test "x$ac_cv_type_ssize_t" = xyes; then :
+
+ $as_echo "#define HAVE_SSIZE_T 1" >>confdefs.h
+
+@@ -6687,7 +6713,7 @@ fi
+ # This bug is HP SR number 8606223364.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5
+ $as_echo_n "checking size of int... " >&6; }
+-if test "${ac_cv_sizeof_int+set}" = set; then :
++if ${ac_cv_sizeof_int+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))"
"ac_cv_sizeof_int" "$ac_includes_default"; then :
+@@ -6697,7 +6723,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "cannot compute sizeof (int)
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_int=0
+ fi
+@@ -6720,7 +6746,7 @@ _ACEOF
+ # This bug is HP SR number 8606223364.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
+ $as_echo_n "checking size of long... " >&6; }
+-if test "${ac_cv_sizeof_long+set}" = set; then :
++if ${ac_cv_sizeof_long+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))"
"ac_cv_sizeof_long" "$ac_includes_default"; then :
+@@ -6730,7 +6756,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "cannot compute sizeof (long)
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_long=0
+ fi
+@@ -6753,7 +6779,7 @@ _ACEOF
+ # This bug is HP SR number 8606223364.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5
+ $as_echo_n "checking size of void *... " >&6; }
+-if test "${ac_cv_sizeof_void_p+set}" = set; then :
++if ${ac_cv_sizeof_void_p+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))"
"ac_cv_sizeof_void_p" "$ac_includes_default"; then :
+@@ -6763,7 +6789,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "cannot compute sizeof (void *)
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_void_p=0
+ fi
+@@ -6786,7 +6812,7 @@ _ACEOF
+ # This bug is HP SR number 8606223364.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5
+ $as_echo_n "checking size of short... " >&6; }
+-if test "${ac_cv_sizeof_short+set}" = set; then :
++if ${ac_cv_sizeof_short+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))"
"ac_cv_sizeof_short" "$ac_includes_default"; then :
+@@ -6796,7 +6822,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "cannot compute sizeof (short)
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_short=0
+ fi
+@@ -6819,7 +6845,7 @@ _ACEOF
+ # This bug is HP SR number 8606223364.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of float" >&5
+ $as_echo_n "checking size of float... " >&6; }
+-if test "${ac_cv_sizeof_float+set}" = set; then :
++if ${ac_cv_sizeof_float+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (float))"
"ac_cv_sizeof_float" "$ac_includes_default"; then :
+@@ -6829,7 +6855,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "cannot compute sizeof (float)
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_float=0
+ fi
+@@ -6852,7 +6878,7 @@ _ACEOF
+ # This bug is HP SR number 8606223364.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of double" >&5
+ $as_echo_n "checking size of double... " >&6; }
+-if test "${ac_cv_sizeof_double+set}" = set; then :
++if ${ac_cv_sizeof_double+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (double))"
"ac_cv_sizeof_double" "$ac_includes_default"; then :
+@@ -6862,7 +6888,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "cannot compute sizeof (double)
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_double=0
+ fi
+@@ -6885,7 +6911,7 @@ _ACEOF
+ # This bug is HP SR number 8606223364.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of fpos_t" >&5
+ $as_echo_n "checking size of fpos_t... " >&6; }
+-if test "${ac_cv_sizeof_fpos_t+set}" = set; then :
++if ${ac_cv_sizeof_fpos_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (fpos_t))"
"ac_cv_sizeof_fpos_t" "$ac_includes_default"; then :
+@@ -6895,7 +6921,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "cannot compute sizeof (fpos_t)
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_fpos_t=0
+ fi
+@@ -6918,7 +6944,7 @@ _ACEOF
+ # This bug is HP SR number 8606223364.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5
+ $as_echo_n "checking size of size_t... " >&6; }
+-if test "${ac_cv_sizeof_size_t+set}" = set; then :
++if ${ac_cv_sizeof_size_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))"
"ac_cv_sizeof_size_t" "$ac_includes_default"; then :
+@@ -6928,7 +6954,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "cannot compute sizeof (size_t)
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_size_t=0
+ fi
+@@ -6951,7 +6977,7 @@ _ACEOF
+ # This bug is HP SR number 8606223364.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of pid_t" >&5
+ $as_echo_n "checking size of pid_t... " >&6; }
+-if test "${ac_cv_sizeof_pid_t+set}" = set; then :
++if ${ac_cv_sizeof_pid_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pid_t))"
"ac_cv_sizeof_pid_t" "$ac_includes_default"; then :
+@@ -6961,7 +6987,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "cannot compute sizeof (pid_t)
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_pid_t=0
+ fi
+@@ -7011,7 +7037,7 @@ if test "$have_long_long" = yes ; then
+ # This bug is HP SR number 8606223364.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long"
>&5
+ $as_echo_n "checking size of long long... " >&6; }
+-if test "${ac_cv_sizeof_long_long+set}" = set; then :
++if ${ac_cv_sizeof_long_long+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))"
"ac_cv_sizeof_long_long" "$ac_includes_default"; then :
+@@ -7021,7 +7047,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "cannot compute sizeof (long long)
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_long_long=0
+ fi
+@@ -7072,7 +7098,7 @@ if test "$have_long_double" = yes ; then
+ # This bug is HP SR number 8606223364.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long double"
>&5
+ $as_echo_n "checking size of long double... " >&6; }
+-if test "${ac_cv_sizeof_long_double+set}" = set; then :
++if ${ac_cv_sizeof_long_double+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long
double))" "ac_cv_sizeof_long_double"
"$ac_includes_default"; then :
+@@ -7082,7 +7108,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "cannot compute sizeof (long double)
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_long_double=0
+ fi
+@@ -7133,7 +7159,7 @@ if test "$have_c99_bool" = yes ; then
+ # This bug is HP SR number 8606223364.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of _Bool" >&5
+ $as_echo_n "checking size of _Bool... " >&6; }
+-if test "${ac_cv_sizeof__Bool+set}" = set; then :
++if ${ac_cv_sizeof__Bool+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (_Bool))"
"ac_cv_sizeof__Bool" "$ac_includes_default"; then :
+@@ -7143,7 +7169,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "cannot compute sizeof (_Bool)
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof__Bool=0
+ fi
+@@ -7169,7 +7195,7 @@ ac_fn_c_check_type "$LINENO" "uintptr_t"
+ #include <inttypes.h>
+ #endif
+ "
+-if test "x$ac_cv_type_uintptr_t" = x""yes; then :
++if test "x$ac_cv_type_uintptr_t" = xyes; then :
+
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_UINTPTR_T 1
+@@ -7181,7 +7207,7 @@ _ACEOF
+ # This bug is HP SR number 8606223364.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of uintptr_t"
>&5
+ $as_echo_n "checking size of uintptr_t... " >&6; }
+-if test "${ac_cv_sizeof_uintptr_t+set}" = set; then :
++if ${ac_cv_sizeof_uintptr_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (uintptr_t))"
"ac_cv_sizeof_uintptr_t" "$ac_includes_default"; then :
+@@ -7191,7 +7217,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "cannot compute sizeof (uintptr_t)
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_uintptr_t=0
+ fi
+@@ -7217,7 +7243,7 @@ fi
+ # This bug is HP SR number 8606223364.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5
+ $as_echo_n "checking size of off_t... " >&6; }
+-if test "${ac_cv_sizeof_off_t+set}" = set; then :
++if ${ac_cv_sizeof_off_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))"
"ac_cv_sizeof_off_t" "
+@@ -7232,7 +7258,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "cannot compute sizeof (off_t)
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_off_t=0
+ fi
+@@ -7276,7 +7302,7 @@ fi
+ # This bug is HP SR number 8606223364.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of time_t" >&5
+ $as_echo_n "checking size of time_t... " >&6; }
+-if test "${ac_cv_sizeof_time_t+set}" = set; then :
++if ${ac_cv_sizeof_time_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (time_t))"
"ac_cv_sizeof_time_t" "
+@@ -7294,7 +7320,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "cannot compute sizeof (time_t)
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_time_t=0
+ fi
+@@ -7350,7 +7376,7 @@ if test "$have_pthread_t" = yes ; then
+ # This bug is HP SR number 8606223364.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of pthread_t"
>&5
+ $as_echo_n "checking size of pthread_t... " >&6; }
+-if test "${ac_cv_sizeof_pthread_t+set}" = set; then :
++if ${ac_cv_sizeof_pthread_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pthread_t))"
"ac_cv_sizeof_pthread_t" "
+@@ -7365,7 +7391,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "cannot compute sizeof (pthread_t)
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_pthread_t=0
+ fi
+@@ -7877,7 +7903,7 @@ $as_echo "$SHLIBS" >&6; }
+ # checks for libraries
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl"
>&5
+ $as_echo_n "checking for dlopen in -ldl... " >&6; }
+-if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
++if ${ac_cv_lib_dl_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -7911,7 +7937,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen"
>&5
+ $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+-if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
++if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_LIBDL 1
+ _ACEOF
+@@ -7922,7 +7948,7 @@ fi
+ # Dynamic linking for SunOS/Solaris and SYSV
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld"
>&5
+ $as_echo_n "checking for shl_load in -ldld... " >&6; }
+-if test "${ac_cv_lib_dld_shl_load+set}" = set; then :
++if ${ac_cv_lib_dld_shl_load+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -7956,7 +7982,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load"
>&5
+ $as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+-if test "x$ac_cv_lib_dld_shl_load" = x""yes; then :
++if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_LIBDLD 1
+ _ACEOF
+@@ -7970,7 +7996,7 @@ fi
+ if test "$with_threads" = "yes" -o -z "$with_threads";
then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing
sem_init" >&5
+ $as_echo_n "checking for library containing sem_init... " >&6; }
+-if test "${ac_cv_search_sem_init+set}" = set; then :
++if ${ac_cv_search_sem_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_func_search_save_LIBS=$LIBS
+@@ -8004,11 +8030,11 @@ for ac_lib in '' pthread rt posix4; do
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+- if test "${ac_cv_search_sem_init+set}" = set; then :
++ if ${ac_cv_search_sem_init+:} false; then :
+ break
+ fi
+ done
+-if test "${ac_cv_search_sem_init+set}" = set; then :
++if ${ac_cv_search_sem_init+:} false; then :
+
+ else
+ ac_cv_search_sem_init=no
+@@ -8031,7 +8057,7 @@ fi
+ # check if we need libintl for locale functions
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for textdomain in -lintl"
>&5
+ $as_echo_n "checking for textdomain in -lintl... " >&6; }
+-if test "${ac_cv_lib_intl_textdomain+set}" = set; then :
++if ${ac_cv_lib_intl_textdomain+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -8065,7 +8091,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_textdomain"
>&5
+ $as_echo "$ac_cv_lib_intl_textdomain" >&6; }
+-if test "x$ac_cv_lib_intl_textdomain" = x""yes; then :
++if test "x$ac_cv_lib_intl_textdomain" = xyes; then :
+
+ $as_echo "#define WITH_LIBINTL 1" >>confdefs.h
+
+@@ -8112,7 +8138,7 @@ esac
+ # BeOS' sockets are stashed in libnet.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for t_open in -lnsl"
>&5
+ $as_echo_n "checking for t_open in -lnsl... " >&6; }
+-if test "${ac_cv_lib_nsl_t_open+set}" = set; then :
++if ${ac_cv_lib_nsl_t_open+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -8146,13 +8172,13 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_t_open"
>&5
+ $as_echo "$ac_cv_lib_nsl_t_open" >&6; }
+-if test "x$ac_cv_lib_nsl_t_open" = x""yes; then :
++if test "x$ac_cv_lib_nsl_t_open" = xyes; then :
+ LIBS="-lnsl $LIBS"
+ fi
+ # SVR4
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket"
>&5
+ $as_echo_n "checking for socket in -lsocket... " >&6; }
+-if test "${ac_cv_lib_socket_socket+set}" = set; then :
++if ${ac_cv_lib_socket_socket+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -8186,7 +8212,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket"
>&5
+ $as_echo "$ac_cv_lib_socket_socket" >&6; }
+-if test "x$ac_cv_lib_socket_socket" = x""yes; then :
++if test "x$ac_cv_lib_socket_socket" = xyes; then :
+ LIBS="-lsocket $LIBS"
+ fi
+ # SVR4 sockets
+@@ -8195,7 +8221,7 @@ case "$ac_sys_system" in
+ BeOS*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lnet"
>&5
+ $as_echo_n "checking for socket in -lnet... " >&6; }
+-if test "${ac_cv_lib_net_socket+set}" = set; then :
++if ${ac_cv_lib_net_socket+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -8229,7 +8255,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_net_socket"
>&5
+ $as_echo "$ac_cv_lib_net_socket" >&6; }
+-if test "x$ac_cv_lib_net_socket" = x""yes; then :
++if test "x$ac_cv_lib_net_socket" = xyes; then :
+ LIBS="-lnet $LIBS"
+ fi
+ # BeOS
+@@ -8257,7 +8283,7 @@ if test -n "$ac_tool_prefix"; then
+ set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
++if ${ac_cv_path_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ case $PKG_CONFIG in
+@@ -8300,7 +8326,7 @@ if test -z "$ac_cv_path_PKG_CONFIG"; the
+ set dummy pkg-config; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
++if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ case $ac_pt_PKG_CONFIG in
+@@ -8568,7 +8594,7 @@ $as_echo "$unistd_defines_pthreads" >&6;
+ $as_echo "#define _REENTRANT 1" >>confdefs.h
+
+ ac_fn_c_check_header_mongrel "$LINENO" "cthreads.h"
"ac_cv_header_cthreads_h" "$ac_includes_default"
+-if test "x$ac_cv_header_cthreads_h" = x""yes; then :
++if test "x$ac_cv_header_cthreads_h" = xyes; then :
+ $as_echo "#define WITH_THREAD 1" >>confdefs.h
+
+ $as_echo "#define C_THREADS 1" >>confdefs.h
+@@ -8581,7 +8607,7 @@ $as_echo "#define HURD_C_THREADS 1" >>co
+ else
+
+ ac_fn_c_check_header_mongrel "$LINENO" "mach/cthreads.h"
"ac_cv_header_mach_cthreads_h" "$ac_includes_default"
+-if test "x$ac_cv_header_mach_cthreads_h" = x""yes; then :
++if test "x$ac_cv_header_mach_cthreads_h" = xyes; then :
+ $as_echo "#define WITH_THREAD 1" >>confdefs.h
+
+ $as_echo "#define C_THREADS 1" >>confdefs.h
+@@ -8643,7 +8669,7 @@ else
+
+ LIBS=$_libs
+ ac_fn_c_check_func "$LINENO" "pthread_detach"
"ac_cv_func_pthread_detach"
+-if test "x$ac_cv_func_pthread_detach" = x""yes; then :
++if test "x$ac_cv_func_pthread_detach" = xyes; then :
+ $as_echo "#define WITH_THREAD 1" >>confdefs.h
+
+ posix_threads=yes
+@@ -8651,7 +8677,7 @@ if test "x$ac_cv_func_pthread_detach" =
+ else
+
+ ac_fn_c_check_header_mongrel "$LINENO" "atheos/threads.h"
"ac_cv_header_atheos_threads_h" "$ac_includes_default"
+-if test "x$ac_cv_header_atheos_threads_h" = x""yes; then :
++if test "x$ac_cv_header_atheos_threads_h" = xyes; then :
+ $as_echo "#define WITH_THREAD 1" >>confdefs.h
+
+
+@@ -8661,7 +8687,7 @@ $as_echo "#define ATHEOS_THREADS 1" >>co
+ else
+
+ ac_fn_c_check_header_mongrel "$LINENO" "kernel/OS.h"
"ac_cv_header_kernel_OS_h" "$ac_includes_default"
+-if test "x$ac_cv_header_kernel_OS_h" = x""yes; then :
++if test "x$ac_cv_header_kernel_OS_h" = xyes; then :
+ $as_echo "#define WITH_THREAD 1" >>confdefs.h
+
+
+@@ -8672,7 +8698,7 @@ else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in
-lpthreads" >&5
+ $as_echo_n "checking for pthread_create in -lpthreads... " >&6; }
+-if test "${ac_cv_lib_pthreads_pthread_create+set}" = set; then :
++if ${ac_cv_lib_pthreads_pthread_create+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -8706,7 +8732,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_pthreads_pthread_create" >&5
+ $as_echo "$ac_cv_lib_pthreads_pthread_create" >&6; }
+-if test "x$ac_cv_lib_pthreads_pthread_create" = x""yes; then :
++if test "x$ac_cv_lib_pthreads_pthread_create" = xyes; then :
+ $as_echo "#define WITH_THREAD 1" >>confdefs.h
+
+ posix_threads=yes
+@@ -8716,7 +8742,7 @@ else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in
-lc_r" >&5
+ $as_echo_n "checking for pthread_create in -lc_r... " >&6; }
+-if test "${ac_cv_lib_c_r_pthread_create+set}" = set; then :
++if ${ac_cv_lib_c_r_pthread_create+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -8750,7 +8776,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_c_r_pthread_create" >&5
+ $as_echo "$ac_cv_lib_c_r_pthread_create" >&6; }
+-if test "x$ac_cv_lib_c_r_pthread_create" = x""yes; then :
++if test "x$ac_cv_lib_c_r_pthread_create" = xyes; then :
+ $as_echo "#define WITH_THREAD 1" >>confdefs.h
+
+ posix_threads=yes
+@@ -8760,7 +8786,7 @@ else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __pthread_create_system
in -lpthread" >&5
+ $as_echo_n "checking for __pthread_create_system in -lpthread... " >&6;
}
+-if test "${ac_cv_lib_pthread___pthread_create_system+set}" = set; then :
++if ${ac_cv_lib_pthread___pthread_create_system+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -8794,7 +8820,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_pthread___pthread_create_system" >&5
+ $as_echo "$ac_cv_lib_pthread___pthread_create_system" >&6; }
+-if test "x$ac_cv_lib_pthread___pthread_create_system" = x""yes; then
:
++if test "x$ac_cv_lib_pthread___pthread_create_system" = xyes; then :
+ $as_echo "#define WITH_THREAD 1" >>confdefs.h
+
+ posix_threads=yes
+@@ -8804,7 +8830,7 @@ else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in
-lcma" >&5
+ $as_echo_n "checking for pthread_create in -lcma... " >&6; }
+-if test "${ac_cv_lib_cma_pthread_create+set}" = set; then :
++if ${ac_cv_lib_cma_pthread_create+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -8838,7 +8864,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_cma_pthread_create" >&5
+ $as_echo "$ac_cv_lib_cma_pthread_create" >&6; }
+-if test "x$ac_cv_lib_cma_pthread_create" = x""yes; then :
++if test "x$ac_cv_lib_cma_pthread_create" = xyes; then :
+ $as_echo "#define WITH_THREAD 1" >>confdefs.h
+
+ posix_threads=yes
+@@ -8878,7 +8904,7 @@ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for usconfig in -lmpc"
>&5
+ $as_echo_n "checking for usconfig in -lmpc... " >&6; }
+-if test "${ac_cv_lib_mpc_usconfig+set}" = set; then :
++if ${ac_cv_lib_mpc_usconfig+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -8912,7 +8938,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mpc_usconfig"
>&5
+ $as_echo "$ac_cv_lib_mpc_usconfig" >&6; }
+-if test "x$ac_cv_lib_mpc_usconfig" = x""yes; then :
++if test "x$ac_cv_lib_mpc_usconfig" = xyes; then :
+ $as_echo "#define WITH_THREAD 1" >>confdefs.h
+
+ LIBS="$LIBS -lmpc"
+@@ -8924,7 +8950,7 @@ fi
+ if test "$posix_threads" != "yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thr_create in
-lthread" >&5
+ $as_echo_n "checking for thr_create in -lthread... " >&6; }
+-if test "${ac_cv_lib_thread_thr_create+set}" = set; then :
++if ${ac_cv_lib_thread_thr_create+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -8958,7 +8984,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_thread_thr_create"
>&5
+ $as_echo "$ac_cv_lib_thread_thr_create" >&6; }
+-if test "x$ac_cv_lib_thread_thr_create" = x""yes; then :
++if test "x$ac_cv_lib_thread_thr_create" = xyes; then :
+ $as_echo "#define WITH_THREAD 1" >>confdefs.h
+
+ LIBS="$LIBS -lthread"
+@@ -9003,7 +9029,7 @@ $as_echo "#define HAVE_BROKEN_POSIX_SEMA
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if PTHREAD_SCOPE_SYSTEM is
supported" >&5
+ $as_echo_n "checking if PTHREAD_SCOPE_SYSTEM is supported... " >&6; }
+- if test "${ac_cv_pthread_system_supported+set}" = set; then :
++ if ${ac_cv_pthread_system_supported+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test "$cross_compiling" = yes; then :
+@@ -9046,7 +9072,7 @@ $as_echo "#define PTHREAD_SYSTEM_SCHED_S
+ for ac_func in pthread_sigmask
+ do :
+ ac_fn_c_check_func "$LINENO" "pthread_sigmask"
"ac_cv_func_pthread_sigmask"
+-if test "x$ac_cv_func_pthread_sigmask" = x""yes; then :
++if test "x$ac_cv_func_pthread_sigmask" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_PTHREAD_SIGMASK 1
+ _ACEOF
+@@ -9399,6 +9425,50 @@ $as_echo "no" >&6; }
+ fi
+
+
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-count-allocs"
>&5
++$as_echo_n "checking for --with-count-allocs... " >&6; }
++
++# Check whether --with-count-allocs was given.
++if test "${with_count_allocs+set}" = set; then :
++ withval=$with_count_allocs;
++if test "$withval" != no
++then
++
++$as_echo "#define COUNT_ALLOCS 1" >>confdefs.h
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
++$as_echo "yes" >&6; }
++else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-call-profile"
>&5
++$as_echo_n "checking for --with-call-profile... " >&6; }
++
++# Check whether --with-call-profile was given.
++if test "${with_call_profile+set}" = set; then :
++ withval=$with_call_profile;
++if test "$withval" != no
++then
++
++$as_echo "#define CALL_PROFILE 1" >>confdefs.h
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
++$as_echo "yes" >&6; }
++else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
+ # Check for Python-specific malloc support
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-pymalloc"
>&5
+ $as_echo_n "checking for --with-pymalloc... " >&6; }
+@@ -9436,7 +9506,7 @@ fi
+ $as_echo "$with_valgrind" >&6; }
+ if test "$with_valgrind" != no; then
+ ac_fn_c_check_header_mongrel "$LINENO" "valgrind/valgrind.h"
"ac_cv_header_valgrind_valgrind_h" "$ac_includes_default"
+-if test "x$ac_cv_header_valgrind_valgrind_h" = x""yes; then :
++if test "x$ac_cv_header_valgrind_valgrind_h" = xyes; then :
+
+ $as_echo "#define WITH_VALGRIND 1" >>confdefs.h
+
+@@ -9448,6 +9518,46 @@ fi
+
+ fi
+
++# Check for dtrace support
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-dtrace"
>&5
++$as_echo_n "checking for --with-dtrace... " >&6; }
++
++# Check whether --with-dtrace was given.
++if test "${with_dtrace+set}" = set; then :
++ withval=$with_dtrace;
++fi
++
++
++if test ! -z "$with_dtrace"
++then
++ if dtrace -G -o /dev/null -s $srcdir/Include/pydtrace.d 2>/dev/null
++ then
++
++$as_echo "#define WITH_DTRACE 1" >>confdefs.h
++
++ with_dtrace="Sun"
++ DTRACEOBJS="Python/dtrace.o"
++ DTRADEHDRS=""
++ elif dtrace -h -o /dev/null -s $srcdir/Include/pydtrace.d
++ then
++
++$as_echo "#define WITH_DTRACE 1" >>confdefs.h
++
++ with_dtrace="Apple"
++ DTRACEOBJS=""
++ DTRADEHDRS="pydtrace.h"
++ else
++ with_dtrace="no"
++ fi
++else
++ with_dtrace="no"
++fi
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_dtrace" >&5
++$as_echo "$with_dtrace" >&6; }
++
++
++
+ # Check for --with-wctype-functions
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-wctype-functions"
>&5
+ $as_echo_n "checking for --with-wctype-functions... " >&6; }
+@@ -9480,7 +9590,7 @@ DLINCLDIR=.
+ for ac_func in dlopen
+ do :
+ ac_fn_c_check_func "$LINENO" "dlopen"
"ac_cv_func_dlopen"
+-if test "x$ac_cv_func_dlopen" = x""yes; then :
++if test "x$ac_cv_func_dlopen" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_DLOPEN 1
+ _ACEOF
+@@ -9810,7 +9920,7 @@ rm -f core conftest.err conftest.$ac_obj
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flock declaration"
>&5
+ $as_echo_n "checking for flock declaration... " >&6; }
+-if test "${ac_cv_flock_decl+set}" = set; then :
++if ${ac_cv_flock_decl+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -9840,7 +9950,7 @@ if test "x${ac_cv_flock_decl}" = xyes; t
+ for ac_func in flock
+ do :
+ ac_fn_c_check_func "$LINENO" "flock" "ac_cv_func_flock"
+-if test "x$ac_cv_func_flock" = x""yes; then :
++if test "x$ac_cv_func_flock" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_FLOCK 1
+ _ACEOF
+@@ -9848,7 +9958,7 @@ _ACEOF
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flock in -lbsd"
>&5
+ $as_echo_n "checking for flock in -lbsd... " >&6; }
+-if test "${ac_cv_lib_bsd_flock+set}" = set; then :
++if ${ac_cv_lib_bsd_flock+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -9882,7 +9992,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_flock"
>&5
+ $as_echo "$ac_cv_lib_bsd_flock" >&6; }
+-if test "x$ac_cv_lib_bsd_flock" = x""yes; then :
++if test "x$ac_cv_lib_bsd_flock" = xyes; then :
+ $as_echo "#define HAVE_FLOCK 1" >>confdefs.h
+
+
+@@ -9959,7 +10069,7 @@ do
+ set dummy $ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if test "${ac_cv_prog_TRUE+set}" = set; then :
++if ${ac_cv_prog_TRUE+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$TRUE"; then
+@@ -9999,7 +10109,7 @@ test -n "$TRUE" || TRUE="/bin/true"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lc"
>&5
+ $as_echo_n "checking for inet_aton in -lc... " >&6; }
+-if test "${ac_cv_lib_c_inet_aton+set}" = set; then :
++if ${ac_cv_lib_c_inet_aton+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -10033,12 +10143,12 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_inet_aton"
>&5
+ $as_echo "$ac_cv_lib_c_inet_aton" >&6; }
+-if test "x$ac_cv_lib_c_inet_aton" = x""yes; then :
++if test "x$ac_cv_lib_c_inet_aton" = xyes; then :
+ $ac_cv_prog_TRUE
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lresolv"
>&5
+ $as_echo_n "checking for inet_aton in -lresolv... " >&6; }
+-if test "${ac_cv_lib_resolv_inet_aton+set}" = set; then :
++if ${ac_cv_lib_resolv_inet_aton+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -10072,7 +10182,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_inet_aton"
>&5
+ $as_echo "$ac_cv_lib_resolv_inet_aton" >&6; }
+-if test "x$ac_cv_lib_resolv_inet_aton" = x""yes; then :
++if test "x$ac_cv_lib_resolv_inet_aton" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_LIBRESOLV 1
+ _ACEOF
+@@ -10089,7 +10199,7 @@ fi
+ # exit Python
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for chflags" >&5
+ $as_echo_n "checking for chflags... " >&6; }
+-if test "${ac_cv_have_chflags+set}" = set; then :
++if ${ac_cv_have_chflags+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test "$cross_compiling" = yes; then :
+@@ -10123,7 +10233,7 @@ fi
+ $as_echo "$ac_cv_have_chflags" >&6; }
+ if test "$ac_cv_have_chflags" = cross ; then
+ ac_fn_c_check_func "$LINENO" "chflags"
"ac_cv_func_chflags"
+-if test "x$ac_cv_func_chflags" = x""yes; then :
++if test "x$ac_cv_func_chflags" = xyes; then :
+ ac_cv_have_chflags="yes"
+ else
+ ac_cv_have_chflags="no"
+@@ -10138,7 +10248,7 @@ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lchflags" >&5
+ $as_echo_n "checking for lchflags... " >&6; }
+-if test "${ac_cv_have_lchflags+set}" = set; then :
++if ${ac_cv_have_lchflags+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test "$cross_compiling" = yes; then :
+@@ -10172,7 +10282,7 @@ fi
+ $as_echo "$ac_cv_have_lchflags" >&6; }
+ if test "$ac_cv_have_lchflags" = cross ; then
+ ac_fn_c_check_func "$LINENO" "lchflags"
"ac_cv_func_lchflags"
+-if test "x$ac_cv_func_lchflags" = x""yes; then :
++if test "x$ac_cv_func_lchflags" = xyes; then :
+ ac_cv_have_lchflags="yes"
+ else
+ ac_cv_have_lchflags="no"
+@@ -10196,7 +10306,7 @@ esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateCopy in -lz"
>&5
+ $as_echo_n "checking for inflateCopy in -lz... " >&6; }
+-if test "${ac_cv_lib_z_inflateCopy+set}" = set; then :
++if ${ac_cv_lib_z_inflateCopy+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -10230,7 +10340,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflateCopy"
>&5
+ $as_echo "$ac_cv_lib_z_inflateCopy" >&6; }
+-if test "x$ac_cv_lib_z_inflateCopy" = x""yes; then :
++if test "x$ac_cv_lib_z_inflateCopy" = xyes; then :
+
+ $as_echo "#define HAVE_ZLIB_COPY 1" >>confdefs.h
+
+@@ -10373,7 +10483,7 @@ rm -f core conftest.err conftest.$ac_obj
+ for ac_func in openpty
+ do :
+ ac_fn_c_check_func "$LINENO" "openpty"
"ac_cv_func_openpty"
+-if test "x$ac_cv_func_openpty" = x""yes; then :
++if test "x$ac_cv_func_openpty" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_OPENPTY 1
+ _ACEOF
+@@ -10381,7 +10491,7 @@ _ACEOF
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openpty in -lutil"
>&5
+ $as_echo_n "checking for openpty in -lutil... " >&6; }
+-if test "${ac_cv_lib_util_openpty+set}" = set; then :
++if ${ac_cv_lib_util_openpty+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -10415,13 +10525,13 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_openpty"
>&5
+ $as_echo "$ac_cv_lib_util_openpty" >&6; }
+-if test "x$ac_cv_lib_util_openpty" = x""yes; then :
++if test "x$ac_cv_lib_util_openpty" = xyes; then :
+ $as_echo "#define HAVE_OPENPTY 1" >>confdefs.h
+ LIBS="$LIBS -lutil"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openpty in -lbsd"
>&5
+ $as_echo_n "checking for openpty in -lbsd... " >&6; }
+-if test "${ac_cv_lib_bsd_openpty+set}" = set; then :
++if ${ac_cv_lib_bsd_openpty+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -10455,7 +10565,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_openpty"
>&5
+ $as_echo "$ac_cv_lib_bsd_openpty" >&6; }
+-if test "x$ac_cv_lib_bsd_openpty" = x""yes; then :
++if test "x$ac_cv_lib_bsd_openpty" = xyes; then :
+ $as_echo "#define HAVE_OPENPTY 1" >>confdefs.h
+ LIBS="$LIBS -lbsd"
+ fi
+@@ -10470,7 +10580,7 @@ done
+ for ac_func in forkpty
+ do :
+ ac_fn_c_check_func "$LINENO" "forkpty"
"ac_cv_func_forkpty"
+-if test "x$ac_cv_func_forkpty" = x""yes; then :
++if test "x$ac_cv_func_forkpty" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_FORKPTY 1
+ _ACEOF
+@@ -10478,7 +10588,7 @@ _ACEOF
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for forkpty in -lutil"
>&5
+ $as_echo_n "checking for forkpty in -lutil... " >&6; }
+-if test "${ac_cv_lib_util_forkpty+set}" = set; then :
++if ${ac_cv_lib_util_forkpty+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -10512,13 +10622,13 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_forkpty"
>&5
+ $as_echo "$ac_cv_lib_util_forkpty" >&6; }
+-if test "x$ac_cv_lib_util_forkpty" = x""yes; then :
++if test "x$ac_cv_lib_util_forkpty" = xyes; then :
+ $as_echo "#define HAVE_FORKPTY 1" >>confdefs.h
+ LIBS="$LIBS -lutil"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for forkpty in -lbsd"
>&5
+ $as_echo_n "checking for forkpty in -lbsd... " >&6; }
+-if test "${ac_cv_lib_bsd_forkpty+set}" = set; then :
++if ${ac_cv_lib_bsd_forkpty+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -10552,7 +10662,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_forkpty"
>&5
+ $as_echo "$ac_cv_lib_bsd_forkpty" >&6; }
+-if test "x$ac_cv_lib_bsd_forkpty" = x""yes; then :
++if test "x$ac_cv_lib_bsd_forkpty" = xyes; then :
+ $as_echo "#define HAVE_FORKPTY 1" >>confdefs.h
+ LIBS="$LIBS -lbsd"
+ fi
+@@ -10569,7 +10679,7 @@ done
+ for ac_func in memmove
+ do :
+ ac_fn_c_check_func "$LINENO" "memmove"
"ac_cv_func_memmove"
+-if test "x$ac_cv_func_memmove" = x""yes; then :
++if test "x$ac_cv_func_memmove" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_MEMMOVE 1
+ _ACEOF
+@@ -10593,7 +10703,7 @@ done
+
+
+ ac_fn_c_check_func "$LINENO" "dup2" "ac_cv_func_dup2"
+-if test "x$ac_cv_func_dup2" = x""yes; then :
++if test "x$ac_cv_func_dup2" = xyes; then :
+ $as_echo "#define HAVE_DUP2 1" >>confdefs.h
+
+ else
+@@ -10606,7 +10716,7 @@ esac
+ fi
+
+ ac_fn_c_check_func "$LINENO" "getcwd" "ac_cv_func_getcwd"
+-if test "x$ac_cv_func_getcwd" = x""yes; then :
++if test "x$ac_cv_func_getcwd" = xyes; then :
+ $as_echo "#define HAVE_GETCWD 1" >>confdefs.h
+
+ else
+@@ -10619,7 +10729,7 @@ esac
+ fi
+
+ ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup"
+-if test "x$ac_cv_func_strdup" = x""yes; then :
++if test "x$ac_cv_func_strdup" = xyes; then :
+ $as_echo "#define HAVE_STRDUP 1" >>confdefs.h
+
+ else
+@@ -10635,7 +10745,7 @@ fi
+ for ac_func in getpgrp
+ do :
+ ac_fn_c_check_func "$LINENO" "getpgrp"
"ac_cv_func_getpgrp"
+-if test "x$ac_cv_func_getpgrp" = x""yes; then :
++if test "x$ac_cv_func_getpgrp" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_GETPGRP 1
+ _ACEOF
+@@ -10663,7 +10773,7 @@ done
+ for ac_func in setpgrp
+ do :
+ ac_fn_c_check_func "$LINENO" "setpgrp"
"ac_cv_func_setpgrp"
+-if test "x$ac_cv_func_setpgrp" = x""yes; then :
++if test "x$ac_cv_func_setpgrp" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_SETPGRP 1
+ _ACEOF
+@@ -10691,7 +10801,7 @@ done
+ for ac_func in gettimeofday
+ do :
+ ac_fn_c_check_func "$LINENO" "gettimeofday"
"ac_cv_func_gettimeofday"
+-if test "x$ac_cv_func_gettimeofday" = x""yes; then :
++if test "x$ac_cv_func_gettimeofday" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_GETTIMEOFDAY 1
+ _ACEOF
+@@ -10793,7 +10903,7 @@ if test $have_getaddrinfo = yes
+ then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking getaddrinfo bug"
>&5
+ $as_echo_n "checking getaddrinfo bug... " >&6; }
+- if test "${ac_cv_buggy_getaddrinfo+set}" = set; then :
++ if ${ac_cv_buggy_getaddrinfo+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test "$cross_compiling" = yes; then :
+@@ -10922,7 +11032,7 @@ fi
+ for ac_func in getnameinfo
+ do :
+ ac_fn_c_check_func "$LINENO" "getnameinfo"
"ac_cv_func_getnameinfo"
+-if test "x$ac_cv_func_getnameinfo" = x""yes; then :
++if test "x$ac_cv_func_getnameinfo" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_GETNAMEINFO 1
+ _ACEOF
+@@ -10934,7 +11044,7 @@ done
+ # checks for structures
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may
both be included" >&5
+ $as_echo_n "checking whether time.h and sys/time.h may both be included... "
>&6; }
+-if test "${ac_cv_header_time+set}" = set; then :
++if ${ac_cv_header_time+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -10969,7 +11079,7 @@ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in
sys/time.h or time.h" >&5
+ $as_echo_n "checking whether struct tm is in sys/time.h or time.h... "
>&6; }
+-if test "${ac_cv_struct_tm+set}" = set; then :
++if ${ac_cv_struct_tm+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -11006,7 +11116,7 @@ ac_fn_c_check_member "$LINENO" "struct t
+ #include <$ac_cv_struct_tm>
+
+ "
+-if test "x$ac_cv_member_struct_tm_tm_zone" = x""yes; then :
++if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then :
+
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_STRUCT_TM_TM_ZONE 1
+@@ -11022,7 +11132,7 @@ $as_echo "#define HAVE_TM_ZONE 1" >>conf
+ else
+ ac_fn_c_check_decl "$LINENO" "tzname"
"ac_cv_have_decl_tzname" "#include <time.h>
+ "
+-if test "x$ac_cv_have_decl_tzname" = x""yes; then :
++if test "x$ac_cv_have_decl_tzname" = xyes; then :
+ ac_have_decl=1
+ else
+ ac_have_decl=0
+@@ -11034,7 +11144,7 @@ _ACEOF
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5
+ $as_echo_n "checking for tzname... " >&6; }
+-if test "${ac_cv_var_tzname+set}" = set; then :
++if ${ac_cv_var_tzname+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -11070,7 +11180,7 @@ $as_echo "#define HAVE_TZNAME 1" >>confd
+ fi
+
+ ac_fn_c_check_member "$LINENO" "struct stat" "st_rdev"
"ac_cv_member_struct_stat_st_rdev" "$ac_includes_default"
+-if test "x$ac_cv_member_struct_stat_st_rdev" = x""yes; then :
++if test "x$ac_cv_member_struct_stat_st_rdev" = xyes; then :
+
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_STRUCT_STAT_ST_RDEV 1
+@@ -11080,7 +11190,7 @@ _ACEOF
+ fi
+
+ ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize"
"ac_cv_member_struct_stat_st_blksize" "$ac_includes_default"
+-if test "x$ac_cv_member_struct_stat_st_blksize" = x""yes; then :
++if test "x$ac_cv_member_struct_stat_st_blksize" = xyes; then :
+
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_STRUCT_STAT_ST_BLKSIZE 1
+@@ -11090,7 +11200,7 @@ _ACEOF
+ fi
+
+ ac_fn_c_check_member "$LINENO" "struct stat" "st_flags"
"ac_cv_member_struct_stat_st_flags" "$ac_includes_default"
+-if test "x$ac_cv_member_struct_stat_st_flags" = x""yes; then :
++if test "x$ac_cv_member_struct_stat_st_flags" = xyes; then :
+
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_STRUCT_STAT_ST_FLAGS 1
+@@ -11100,7 +11210,7 @@ _ACEOF
+ fi
+
+ ac_fn_c_check_member "$LINENO" "struct stat" "st_gen"
"ac_cv_member_struct_stat_st_gen" "$ac_includes_default"
+-if test "x$ac_cv_member_struct_stat_st_gen" = x""yes; then :
++if test "x$ac_cv_member_struct_stat_st_gen" = xyes; then :
+
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_STRUCT_STAT_ST_GEN 1
+@@ -11110,7 +11220,7 @@ _ACEOF
+ fi
+
+ ac_fn_c_check_member "$LINENO" "struct stat"
"st_birthtime" "ac_cv_member_struct_stat_st_birthtime"
"$ac_includes_default"
+-if test "x$ac_cv_member_struct_stat_st_birthtime" = x""yes; then :
++if test "x$ac_cv_member_struct_stat_st_birthtime" = xyes; then :
+
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_STRUCT_STAT_ST_BIRTHTIME 1
+@@ -11120,7 +11230,7 @@ _ACEOF
+ fi
+
+ ac_fn_c_check_member "$LINENO" "struct stat" "st_blocks"
"ac_cv_member_struct_stat_st_blocks" "$ac_includes_default"
+-if test "x$ac_cv_member_struct_stat_st_blocks" = x""yes; then :
++if test "x$ac_cv_member_struct_stat_st_blocks" = xyes; then :
+
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_STRUCT_STAT_ST_BLOCKS 1
+@@ -11142,7 +11252,7 @@ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for time.h that defines
altzone" >&5
+ $as_echo_n "checking for time.h that defines altzone... " >&6; }
+-if test "${ac_cv_header_time_altzone+set}" = set; then :
++if ${ac_cv_header_time_altzone+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+
+@@ -11206,7 +11316,7 @@ $as_echo "$was_it_defined" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for addrinfo" >&5
+ $as_echo_n "checking for addrinfo... " >&6; }
+-if test "${ac_cv_struct_addrinfo+set}" = set; then :
++if ${ac_cv_struct_addrinfo+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -11238,7 +11348,7 @@ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_storage"
>&5
+ $as_echo_n "checking for sockaddr_storage... " >&6; }
+-if test "${ac_cv_struct_sockaddr_storage+set}" = set; then :
++if ${ac_cv_struct_sockaddr_storage+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -11274,7 +11384,7 @@ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned"
>&5
+ $as_echo_n "checking whether char is unsigned... " >&6; }
+-if test "${ac_cv_c_char_unsigned+set}" = set; then :
++if ${ac_cv_c_char_unsigned+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -11306,7 +11416,7 @@ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming
const" >&5
+ $as_echo_n "checking for an ANSI C-conforming const... " >&6; }
+-if test "${ac_cv_c_const+set}" = set; then :
++if ${ac_cv_c_const+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -11594,7 +11704,7 @@ $as_echo "$va_list_is_array" >&6; }
+
+
+ ac_fn_c_check_func "$LINENO" "gethostbyname_r"
"ac_cv_func_gethostbyname_r"
+-if test "x$ac_cv_func_gethostbyname_r" = x""yes; then :
++if test "x$ac_cv_func_gethostbyname_r" = xyes; then :
+
+ $as_echo "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h
+
+@@ -11725,7 +11835,7 @@ else
+ for ac_func in gethostbyname
+ do :
+ ac_fn_c_check_func "$LINENO" "gethostbyname"
"ac_cv_func_gethostbyname"
+-if test "x$ac_cv_func_gethostbyname" = x""yes; then :
++if test "x$ac_cv_func_gethostbyname" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_GETHOSTBYNAME 1
+ _ACEOF
+@@ -11747,12 +11857,12 @@ fi
+
+ # Linux requires this for correct f.p. operations
+ ac_fn_c_check_func "$LINENO" "__fpu_control"
"ac_cv_func___fpu_control"
+-if test "x$ac_cv_func___fpu_control" = x""yes; then :
++if test "x$ac_cv_func___fpu_control" = xyes; then :
+
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __fpu_control in
-lieee" >&5
+ $as_echo_n "checking for __fpu_control in -lieee... " >&6; }
+-if test "${ac_cv_lib_ieee___fpu_control+set}" = set; then :
++if ${ac_cv_lib_ieee___fpu_control+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -11786,7 +11896,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_ieee___fpu_control" >&5
+ $as_echo "$ac_cv_lib_ieee___fpu_control" >&6; }
+-if test "x$ac_cv_lib_ieee___fpu_control" = x""yes; then :
++if test "x$ac_cv_lib_ieee___fpu_control" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_LIBIEEE 1
+ _ACEOF
+@@ -11881,7 +11991,7 @@ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C doubles are
little-endian IEEE 754 binary64" >&5
+ $as_echo_n "checking whether C doubles are little-endian IEEE 754 binary64...
" >&6; }
+-if test "${ac_cv_little_endian_double+set}" = set; then :
++if ${ac_cv_little_endian_double+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+
+@@ -11923,7 +12033,7 @@ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C doubles are big-endian
IEEE 754 binary64" >&5
+ $as_echo_n "checking whether C doubles are big-endian IEEE 754 binary64... "
>&6; }
+-if test "${ac_cv_big_endian_double+set}" = set; then :
++if ${ac_cv_big_endian_double+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+
+@@ -11969,7 +12079,7 @@ fi
+ # conversions work.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C doubles are ARM
mixed-endian IEEE 754 binary64" >&5
+ $as_echo_n "checking whether C doubles are ARM mixed-endian IEEE 754 binary64...
" >&6; }
+-if test "${ac_cv_mixed_endian_double+set}" = set; then :
++if ${ac_cv_mixed_endian_double+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+
+@@ -12117,7 +12227,7 @@ LIBS="$LIBS $LIBM"
+ # -0. on some architectures.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether tanh preserves the sign
of zero" >&5
+ $as_echo_n "checking whether tanh preserves the sign of zero... " >&6;
}
+-if test "${ac_cv_tanh_preserves_zero_sign+set}" = set; then :
++if ${ac_cv_tanh_preserves_zero_sign+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+
+@@ -12185,7 +12295,7 @@ done
+
+ ac_fn_c_check_decl "$LINENO" "isinf"
"ac_cv_have_decl_isinf" "#include <math.h>
+ "
+-if test "x$ac_cv_have_decl_isinf" = x""yes; then :
++if test "x$ac_cv_have_decl_isinf" = xyes; then :
+ ac_have_decl=1
+ else
+ ac_have_decl=0
+@@ -12196,7 +12306,7 @@ cat >>confdefs.h <<_ACEOF
+ _ACEOF
+ ac_fn_c_check_decl "$LINENO" "isnan"
"ac_cv_have_decl_isnan" "#include <math.h>
+ "
+-if test "x$ac_cv_have_decl_isnan" = x""yes; then :
++if test "x$ac_cv_have_decl_isnan" = xyes; then :
+ ac_have_decl=1
+ else
+ ac_have_decl=0
+@@ -12207,7 +12317,7 @@ cat >>confdefs.h <<_ACEOF
+ _ACEOF
+ ac_fn_c_check_decl "$LINENO" "isfinite"
"ac_cv_have_decl_isfinite" "#include <math.h>
+ "
+-if test "x$ac_cv_have_decl_isfinite" = x""yes; then :
++if test "x$ac_cv_have_decl_isfinite" = xyes; then :
+ ac_have_decl=1
+ else
+ ac_have_decl=0
+@@ -12227,7 +12337,7 @@ LIBS=$LIBS_SAVE
+ # sem_open results in a 'Signal 12' error.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX semaphores are
enabled" >&5
+ $as_echo_n "checking whether POSIX semaphores are enabled... " >&6; }
+-if test "${ac_cv_posix_semaphores_enabled+set}" = set; then :
++if ${ac_cv_posix_semaphores_enabled+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test "$cross_compiling" = yes; then :
+@@ -12278,7 +12388,7 @@ fi
+ # Multiprocessing check for broken sem_getvalue
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken sem_getvalue"
>&5
+ $as_echo_n "checking for broken sem_getvalue... " >&6; }
+-if test "${ac_cv_broken_sem_getvalue+set}" = set; then :
++if ${ac_cv_broken_sem_getvalue+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test "$cross_compiling" = yes; then :
+@@ -12343,7 +12453,7 @@ no)
+ 15|30)
+ ;;
+ *)
+- as_fn_error $? "bad value $enable_big_digits for --enable-big-digits; value
should be 15 or 30" "$LINENO" 5 ;;
++ as_fn_error $? "bad value $enable_big_digits for --enable-big-digits; value
should be 15 or 30" "$LINENO" 5 ;;
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_big_digits"
>&5
+ $as_echo "$enable_big_digits" >&6; }
+@@ -12361,7 +12471,7 @@ fi
+
+ # check for wchar.h
+ ac_fn_c_check_header_mongrel "$LINENO" "wchar.h"
"ac_cv_header_wchar_h" "$ac_includes_default"
+-if test "x$ac_cv_header_wchar_h" = x""yes; then :
++if test "x$ac_cv_header_wchar_h" = xyes; then :
+
+
+ $as_echo "#define HAVE_WCHAR_H 1" >>confdefs.h
+@@ -12384,7 +12494,7 @@ then
+ # This bug is HP SR number 8606223364.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of wchar_t" >&5
+ $as_echo_n "checking size of wchar_t... " >&6; }
+-if test "${ac_cv_sizeof_wchar_t+set}" = set; then :
++if ${ac_cv_sizeof_wchar_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (wchar_t))"
"ac_cv_sizeof_wchar_t" "#include <wchar.h>
+@@ -12395,7 +12505,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "cannot compute sizeof (wchar_t)
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_wchar_t=0
+ fi
+@@ -12450,7 +12560,7 @@ then
+ # check whether wchar_t is signed or not
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wchar_t is signed"
>&5
+ $as_echo_n "checking whether wchar_t is signed... " >&6; }
+- if test "${ac_cv_wchar_t_signed+set}" = set; then :
++ if ${ac_cv_wchar_t_signed+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+
+@@ -12514,7 +12624,7 @@ ucs4) unicode_size="4"
+ $as_echo "#define Py_UNICODE_SIZE 4" >>confdefs.h
+
+ ;;
+-*) as_fn_error $? "invalid value for --enable-unicode. Use either ucs2 or ucs4
(lowercase)." "$LINENO" 5 ;;
++*) as_fn_error $? "invalid value for --enable-unicode. Use either ucs2 or ucs4
(lowercase)." "$LINENO" 5 ;;
+ esac
+
+
+@@ -12561,7 +12671,7 @@ fi
+ # check for endianness
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is
bigendian" >&5
+ $as_echo_n "checking whether byte ordering is bigendian... " >&6; }
+-if test "${ac_cv_c_bigendian+set}" = set; then :
++if ${ac_cv_c_bigendian+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_cv_c_bigendian=unknown
+@@ -12780,7 +12890,7 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUI
+ ;; #(
+ *)
+ as_fn_error $? "unknown endianness
+- presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
++ presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
+ esac
+
+
+@@ -12788,7 +12898,7 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUI
+ # or fills with zeros (like the Cray J90, according to Tim Peters).
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether right shift extends the
sign bit" >&5
+ $as_echo_n "checking whether right shift extends the sign bit... " >&6;
}
+-if test "${ac_cv_rshift_extends_sign+set}" = set; then :
++if ${ac_cv_rshift_extends_sign+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+
+@@ -12827,7 +12937,7 @@ fi
+ # check for getc_unlocked and related locking functions
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getc_unlocked() and
friends" >&5
+ $as_echo_n "checking for getc_unlocked() and friends... " >&6; }
+-if test "${ac_cv_have_getc_unlocked+set}" = set; then :
++if ${ac_cv_have_getc_unlocked+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+
+@@ -12925,7 +13035,7 @@ fi
+ # check for readline 2.1
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_callback_handler_install
in -lreadline" >&5
+ $as_echo_n "checking for rl_callback_handler_install in -lreadline... "
>&6; }
+-if test "${ac_cv_lib_readline_rl_callback_handler_install+set}" = set; then :
++if ${ac_cv_lib_readline_rl_callback_handler_install+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -12959,7 +13069,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_readline_rl_callback_handler_install" >&5
+ $as_echo "$ac_cv_lib_readline_rl_callback_handler_install" >&6; }
+-if test "x$ac_cv_lib_readline_rl_callback_handler_install" = x""yes;
then :
++if test "x$ac_cv_lib_readline_rl_callback_handler_install" = xyes; then :
+
+ $as_echo "#define HAVE_RL_CALLBACK 1" >>confdefs.h
+
+@@ -13011,7 +13121,7 @@ fi
+ # check for readline 4.0
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_pre_input_hook in
-lreadline" >&5
+ $as_echo_n "checking for rl_pre_input_hook in -lreadline... " >&6; }
+-if test "${ac_cv_lib_readline_rl_pre_input_hook+set}" = set; then :
++if ${ac_cv_lib_readline_rl_pre_input_hook+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -13045,7 +13155,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_readline_rl_pre_input_hook" >&5
+ $as_echo "$ac_cv_lib_readline_rl_pre_input_hook" >&6; }
+-if test "x$ac_cv_lib_readline_rl_pre_input_hook" = x""yes; then :
++if test "x$ac_cv_lib_readline_rl_pre_input_hook" = xyes; then :
+
+ $as_echo "#define HAVE_RL_PRE_INPUT_HOOK 1" >>confdefs.h
+
+@@ -13055,7 +13165,7 @@ fi
+ # also in 4.0
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for
rl_completion_display_matches_hook in -lreadline" >&5
+ $as_echo_n "checking for rl_completion_display_matches_hook in -lreadline... "
>&6; }
+-if test "${ac_cv_lib_readline_rl_completion_display_matches_hook+set}" = set;
then :
++if ${ac_cv_lib_readline_rl_completion_display_matches_hook+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -13089,7 +13199,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_readline_rl_completion_display_matches_hook" >&5
+ $as_echo "$ac_cv_lib_readline_rl_completion_display_matches_hook" >&6;
}
+-if test "x$ac_cv_lib_readline_rl_completion_display_matches_hook" =
x""yes; then :
++if test "x$ac_cv_lib_readline_rl_completion_display_matches_hook" = xyes; then
:
+
+ $as_echo "#define HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK 1"
>>confdefs.h
+
+@@ -13099,7 +13209,7 @@ fi
+ # check for readline 4.2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_matches in
-lreadline" >&5
+ $as_echo_n "checking for rl_completion_matches in -lreadline... " >&6;
}
+-if test "${ac_cv_lib_readline_rl_completion_matches+set}" = set; then :
++if ${ac_cv_lib_readline_rl_completion_matches+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -13133,7 +13243,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_readline_rl_completion_matches" >&5
+ $as_echo "$ac_cv_lib_readline_rl_completion_matches" >&6; }
+-if test "x$ac_cv_lib_readline_rl_completion_matches" = x""yes; then
:
++if test "x$ac_cv_lib_readline_rl_completion_matches" = xyes; then :
+
+ $as_echo "#define HAVE_RL_COMPLETION_MATCHES 1" >>confdefs.h
+
+@@ -13174,7 +13284,7 @@ LIBS=$LIBS_no_readline
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken nice()"
>&5
+ $as_echo_n "checking for broken nice()... " >&6; }
+-if test "${ac_cv_broken_nice+set}" = set; then :
++if ${ac_cv_broken_nice+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+
+@@ -13215,7 +13325,7 @@ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken poll()"
>&5
+ $as_echo_n "checking for broken poll()... " >&6; }
+-if test "${ac_cv_broken_poll+set}" = set; then :
++if ${ac_cv_broken_poll+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test "$cross_compiling" = yes; then :
+@@ -13270,7 +13380,7 @@ ac_fn_c_check_member "$LINENO" "struct t
+ #include <$ac_cv_struct_tm>
+
+ "
+-if test "x$ac_cv_member_struct_tm_tm_zone" = x""yes; then :
++if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then :
+
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_STRUCT_TM_TM_ZONE 1
+@@ -13286,7 +13396,7 @@ $as_echo "#define HAVE_TM_ZONE 1" >>conf
+ else
+ ac_fn_c_check_decl "$LINENO" "tzname"
"ac_cv_have_decl_tzname" "#include <time.h>
+ "
+-if test "x$ac_cv_have_decl_tzname" = x""yes; then :
++if test "x$ac_cv_have_decl_tzname" = xyes; then :
+ ac_have_decl=1
+ else
+ ac_have_decl=0
+@@ -13298,7 +13408,7 @@ _ACEOF
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5
+ $as_echo_n "checking for tzname... " >&6; }
+-if test "${ac_cv_var_tzname+set}" = set; then :
++if ${ac_cv_var_tzname+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -13337,7 +13447,7 @@ fi
+ # check tzset(3) exists and works like we expect it to
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working tzset()"
>&5
+ $as_echo_n "checking for working tzset()... " >&6; }
+-if test "${ac_cv_working_tzset+set}" = set; then :
++if ${ac_cv_working_tzset+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+
+@@ -13434,7 +13544,7 @@ fi
+ # Look for subsecond timestamps in struct stat
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tv_nsec in struct stat"
>&5
+ $as_echo_n "checking for tv_nsec in struct stat... " >&6; }
+-if test "${ac_cv_stat_tv_nsec+set}" = set; then :
++if ${ac_cv_stat_tv_nsec+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -13471,7 +13581,7 @@ fi
+ # Look for BSD style subsecond timestamps in struct stat
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tv_nsec2 in struct stat"
>&5
+ $as_echo_n "checking for tv_nsec2 in struct stat... " >&6; }
+-if test "${ac_cv_stat_tv_nsec2+set}" = set; then :
++if ${ac_cv_stat_tv_nsec2+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -13508,7 +13618,7 @@ fi
+ # On HP/UX 11.0, mvwdelch is a block with a return statement
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mvwdelch is an
expression" >&5
+ $as_echo_n "checking whether mvwdelch is an expression... " >&6; }
+-if test "${ac_cv_mvwdelch_is_expression+set}" = set; then :
++if ${ac_cv_mvwdelch_is_expression+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -13545,7 +13655,7 @@ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether WINDOW has _flags"
>&5
+ $as_echo_n "checking whether WINDOW has _flags... " >&6; }
+-if test "${ac_cv_window_has_flags+set}" = set; then :
++if ${ac_cv_window_has_flags+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -13693,7 +13803,7 @@ if test "$have_long_long" = yes
+ then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for %lld and %llu printf()
format support" >&5
+ $as_echo_n "checking for %lld and %llu printf() format support... "
>&6; }
+- if test "${ac_cv_have_long_long_format+set}" = set; then :
++ if ${ac_cv_have_long_long_format+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test "$cross_compiling" = yes; then :
+@@ -13764,7 +13874,7 @@ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for %zd printf() format
support" >&5
+ $as_echo_n "checking for %zd printf() format support... " >&6; }
+-if test "${ac_cv_have_size_t_format+set}" = set; then :
++if ${ac_cv_have_size_t_format+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test "$cross_compiling" = yes; then :
+@@ -13837,7 +13947,7 @@ ac_fn_c_check_type "$LINENO" "socklen_t"
+ #endif
+
+ "
+-if test "x$ac_cv_type_socklen_t" = x""yes; then :
++if test "x$ac_cv_type_socklen_t" = xyes; then :
+
+ else
+
+@@ -13942,10 +14052,21 @@ $as_echo "$as_me: WARNING: cache variabl
+ :end' >>confcache
+ if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+- test "x$cache_file" != "x/dev/null" &&
++ if test "x$cache_file" != "x/dev/null"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file"
>&5
+ $as_echo "$as_me: updating cache $cache_file" >&6;}
+- cat confcache >$cache_file
++ if test ! -f "$cache_file" || test -h "$cache_file"; then
++ cat confcache >"$cache_file"
++ else
++ case $cache_file in #(
++ */* | ?:*)
++ mv -f confcache "$cache_file"$$ &&
++ mv -f "$cache_file"$$ "$cache_file" ;; #(
++ *)
++ mv -f confcache "$cache_file" ;;
++ esac
++ fi
++ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache
$cache_file" >&5
+ $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+@@ -13978,7 +14099,7 @@ LTLIBOBJS=$ac_ltlibobjs
+
+
+
+-: ${CONFIG_STATUS=./config.status}
++: "${CONFIG_STATUS=./config.status}"
+ ac_write_fail=0
+ ac_clean_files_save=$ac_clean_files
+ ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+@@ -14079,6 +14200,7 @@ fi
+ IFS=" "" $as_nl"
+
+ # Find who we are. Look in the path if we contain no directory separator.
++as_myself=
+ case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+@@ -14386,7 +14508,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri
+ # values after options handling.
+ ac_log="
+ This file was extended by python $as_me 2.7, which was
+-generated by GNU Autoconf 2.67. Invocation command line was
++generated by GNU Autoconf 2.68. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+@@ -14448,7 +14570,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_writ
+ ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //;
s/[\\""\`\$]/\\\\&/g'`"
+ ac_cs_version="\\
+ python config.status 2.7
+-configured by $0, generated by GNU Autoconf 2.67,
++configured by $0, generated by GNU Autoconf 2.68,
+ with options \\"\$ac_cs_config\\"
+
+ Copyright (C) 2010 Free Software Foundation, Inc.
+@@ -14580,7 +14702,7 @@ do
+ "Misc/python.pc") CONFIG_FILES="$CONFIG_FILES Misc/python.pc"
;;
+ "Modules/ld_so_aix") CONFIG_FILES="$CONFIG_FILES
Modules/ld_so_aix" ;;
+
+- *) as_fn_error $? "invalid argument: \`$ac_config_target'"
"$LINENO" 5 ;;
++ *) as_fn_error $? "invalid argument: \`$ac_config_target'"
"$LINENO" 5;;
+ esac
+ done
+
+@@ -14602,9 +14724,10 @@ fi
+ # after its creation but before its name has been assigned to `$tmp'.
+ $debug ||
+ {
+- tmp=
++ tmp= ac_tmp=
+ trap 'exit_status=$?
+- { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; }
&& exit $exit_status
++ : "${ac_tmp:=$tmp}"
++ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit
$exit_status
+ ' 0
+ trap 'as_fn_exit 1' 1 2 13 15
+ }
+@@ -14612,12 +14735,13 @@ $debug ||
+
+ {
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null`
&&
+- test -n "$tmp" && test -d "$tmp"
++ test -d "$tmp"
+ } ||
+ {
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+ } || as_fn_error $? "cannot create a temporary directory in ."
"$LINENO" 5
++ac_tmp=$tmp
+
+ # Set up the scripts for CONFIG_FILES section.
+ # No need to generate them if there are no CONFIG_FILES.
+@@ -14639,7 +14763,7 @@ else
+ ac_cs_awk_cr=$ac_cr
+ fi
+
+-echo 'BEGIN {' >"$tmp/subs1.awk" &&
++echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+ _ACEOF
+
+
+@@ -14667,7 +14791,7 @@ done
+ rm -f conf$$subs.sh
+
+ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+-cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
++cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+ _ACEOF
+ sed -n '
+ h
+@@ -14715,7 +14839,7 @@ t delim
+ rm -f conf$$subs.awk
+ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ _ACAWK
+-cat >>"\$tmp/subs1.awk" <<_ACAWK &&
++cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+
+@@ -14747,7 +14871,7 @@ if sed "s/$ac_cr//" < /dev/null > /dev/n
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+ else
+ cat
+-fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
++fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+ || as_fn_error $? "could not setup config files machinery"
"$LINENO" 5
+ _ACEOF
+
+@@ -14781,7 +14905,7 @@ fi # test -n "$CONFIG_FILES"
+ # No need to generate them if there are no CONFIG_HEADERS.
+ # This happens for instance with `./config.status Makefile'.
+ if test -n "$CONFIG_HEADERS"; then
+-cat >"$tmp/defines.awk" <<\_ACAWK ||
++cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+ BEGIN {
+ _ACEOF
+
+@@ -14793,8 +14917,8 @@ _ACEOF
+ # handling of long lines.
+ ac_delim='%!_!# '
+ for ac_last_try in false false :; do
+- ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+- if test -z "$ac_t"; then
++ ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
++ if test -z "$ac_tt"; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+@@ -14895,7 +15019,7 @@ do
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+- :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO"
5 ;;
++ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO"
5;;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+@@ -14914,7 +15038,7 @@ do
+ for ac_f
+ do
+ case $ac_f in
+- -) ac_f="$tmp/stdin";;
++ -) ac_f="$ac_tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+@@ -14923,7 +15047,7 @@ do
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+- as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5
;;
++ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO"
5;;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed
"s/'/'\\\\\\\\''/g"`;; esac
+ as_fn_append ac_file_inputs " '$ac_f'"
+@@ -14949,8 +15073,8 @@ $as_echo "$as_me: creating $ac_file" >&6
+ esac
+
+ case $ac_tag in
+- *:-:* | *:-) cat >"$tmp/stdin" \
+- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
++ *:-:* | *:-) cat >"$ac_tmp/stdin" \
++ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+ esac
+ ;;
+ esac
+@@ -15080,21 +15204,22 @@ s&@abs_top_builddir@&$ac_abs_top_builddi
+ s&@INSTALL@&$ac_INSTALL&;t t
+ $ac_datarootdir_hack
+ "
+-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f
"$tmp/subs.awk" >$tmp/out \
+- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
++eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f
"$ac_tmp/subs.awk" \
++ >$ac_tmp/out || as_fn_error $? "could not create $ac_file"
"$LINENO" 5
+
+ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+- { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n
"$ac_out"; } &&
+- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z
"$ac_out"; } &&
++ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n
"$ac_out"; } &&
++ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
++ "$ac_tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference
to the variable \`datarootdir'
+ which seems to be undefined. Please make sure it is defined" >&5
+ $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable
\`datarootdir'
+ which seems to be undefined. Please make sure it is defined" >&2;}
+
+- rm -f "$tmp/stdin"
++ rm -f "$ac_tmp/stdin"
+ case $ac_file in
+- -) cat "$tmp/out" && rm -f "$tmp/out";;
+- *) rm -f "$ac_file" && mv "$tmp/out"
"$ac_file";;
++ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
++ *) rm -f "$ac_file" && mv "$ac_tmp/out"
"$ac_file";;
+ esac \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+@@ -15105,20 +15230,20 @@ which seems to be undefined. Please mak
+ if test x"$ac_file" != x-; then
+ {
+ $as_echo "/* $configure_input */" \
+- && eval '$AWK -f "$tmp/defines.awk"'
"$ac_file_inputs"
+- } >"$tmp/config.h" \
++ && eval '$AWK -f "$ac_tmp/defines.awk"'
"$ac_file_inputs"
++ } >"$ac_tmp/config.h" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+- if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1;
then
++ if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1;
then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged"
>&5
+ $as_echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ rm -f "$ac_file"
+- mv "$tmp/config.h" "$ac_file" \
++ mv "$ac_tmp/config.h" "$ac_file" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ fi
+ else
+ $as_echo "/* $configure_input */" \
+- && eval '$AWK -f "$tmp/defines.awk"'
"$ac_file_inputs" \
++ && eval '$AWK -f "$ac_tmp/defines.awk"'
"$ac_file_inputs" \
+ || as_fn_error $? "could not create -" "$LINENO" 5
+ fi
+ ;;
+diff -up ./pyconfig.h.in.autotool-intermediates ./pyconfig.h.in
+--- ./pyconfig.h.in.autotool-intermediates 2012-04-11 18:35:27.002518749 -0400
++++ ./pyconfig.h.in 2012-04-11 18:35:28.133504610 -0400
+@@ -18,6 +18,12 @@
+ /* Define this if you have BeOS threads. */
+ #undef BEOS_THREADS
+
++/* Define to keep records on function call invocation */
++#undef CALL_PROFILE
++
++/* Define to keep records of the number of instances of each type */
++#undef COUNT_ALLOCS
++
+ /* Define if you have the Mach cthreads package */
+ #undef C_THREADS
+
+@@ -1107,12 +1113,6 @@
+ /* Define to profile with the Pentium timestamp counter */
+ #undef WITH_TSC
+
+-/* Define to keep records of the number of instances of each type */
+-#undef COUNT_ALLOCS
+-
+-/* Define to keep records on function call invocation */
+-#undef CALL_PROFILE
+-
+ /* Define if you want pymalloc to be disabled when running under valgrind */
+ #undef WITH_VALGRIND
+
diff --git a/autotool-intermediates.patch b/autotool-intermediates.patch
deleted file mode 100644
index 790cd27..0000000
--- a/autotool-intermediates.patch
+++ /dev/null
@@ -1,2720 +0,0 @@
-diff -up ./configure.autotool-intermediates ./configure
---- ./configure.autotool-intermediates 2012-04-11 18:35:27.009518662 -0400
-+++ ./configure 2012-04-11 18:35:27.852508123 -0400
-@@ -1,7 +1,7 @@
- #! /bin/sh
- # From configure.in Revision.
- # Guess values for system-dependent variables and create Makefiles.
--# Generated by GNU Autoconf 2.67 for python 2.7.
-+# Generated by GNU Autoconf 2.68 for python 2.7.
- #
- # Report bugs to <
http://bugs.python.org/>.
- #
-@@ -92,6 +92,7 @@ fi
- IFS=" "" $as_nl"
-
- # Find who we are. Look in the path if we contain no directory separator.
-+as_myself=
- case $0 in #((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-@@ -217,11 +218,18 @@ IFS=$as_save_IFS
- # We cannot yet assume a decent shell, so we have to provide a
- # neutralization value for shells without unset; and this also
- # works around shells that cannot unset nonexistent variables.
-+ # Preserve -v and -x to the replacement shell.
- BASH_ENV=/dev/null
- ENV=/dev/null
- (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
- export CONFIG_SHELL
-- exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
-+ case $- in # ((((
-+ *v*x* | *x*v* ) as_opts=-vx ;;
-+ *v* ) as_opts=-v ;;
-+ *x* ) as_opts=-x ;;
-+ * ) as_opts= ;;
-+ esac
-+ exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
- fi
-
- if test x$as_have_required = xno; then :
-@@ -611,6 +619,8 @@ TRUE
- MACHDEP_OBJS
- DYNLOADFILE
- DLINCLDIR
-+DTRACEHDRS
-+DTRACEOBJS
- THREADOBJ
- LDLAST
- USE_THREAD_MODULE
-@@ -631,6 +641,8 @@ OTHER_LIBTOOL_OPT
- UNIVERSAL_ARCH_FLAGS
- BASECFLAGS
- OPT
-+DEBUG_SUFFIX
-+DEBUG_EXT
- LN
- INSTALL_DATA
- INSTALL_SCRIPT
-@@ -752,8 +764,11 @@ with_pth
- enable_ipv6
- with_doc_strings
- with_tsc
-+with_count_allocs
-+with_call_profile
- with_pymalloc
- with_valgrind
-+with_dtrace
- with_wctype_functions
- with_fpectl
- with_libm
-@@ -1174,7 +1189,7 @@ Try \`$0 --help' for more information"
- $as_echo "$as_me: WARNING: you should use --build, --host, --target"
>&2
- expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null
&&
- $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-- : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
-+ : "${build_alias=$ac_option} ${host_alias=$ac_option}
${target_alias=$ac_option}"
- ;;
-
- esac
-@@ -1427,8 +1442,11 @@ Optional Packages:
- --with-pth use GNU pth threading libraries
- --with(out)-doc-strings disable/enable documentation strings
- --with(out)-tsc enable/disable timestamp counter profile
-+ --with(out)count-allocs enable/disable per-type instance accounting
-+ --with(out)-call-profile enable/disable statistics on function call invocation
- --with(out)-pymalloc disable/enable specialized mallocs
- --with-valgrind Enable Valgrind support
-+ --with(out)-dtrace disable/enable dtrace support
- --with-wctype-functions use wctype.h functions
- --with-fpectl enable SIGFPE catching
- --with-libm=STRING math library
-@@ -1511,7 +1529,7 @@ test -n "$ac_init_help" && exit $ac_stat
- if $ac_init_version; then
- cat <<\_ACEOF
- python configure 2.7
--generated by GNU Autoconf 2.67
-+generated by GNU Autoconf 2.68
-
- Copyright (C) 2010 Free Software Foundation, Inc.
- This configure script is free software; the Free Software Foundation
-@@ -1557,7 +1575,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
- fi
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
- } # ac_fn_c_try_compile
-@@ -1594,7 +1612,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
- fi
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
- } # ac_fn_c_try_cpp
-@@ -1607,10 +1625,10 @@ fi
- ac_fn_c_check_header_mongrel ()
- {
- as_lineno=${as_lineno-"$1"}
as_lineno_stack=as_lineno_stack=$as_lineno_stack
-- if eval "test \"\${$3+set}\"" = set; then :
-+ if eval \${$3+:} false; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
- $as_echo_n "checking for $2... " >&6; }
--if eval "test \"\${$3+set}\"" = set; then :
-+if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
- fi
- eval ac_res=\$$3
-@@ -1677,7 +1695,7 @@ $as_echo "$as_me: WARNING: $2: proceedin
- esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
- $as_echo_n "checking for $2... " >&6; }
--if eval "test \"\${$3+set}\"" = set; then :
-+if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- eval "$3=\$ac_header_compiler"
-@@ -1686,7 +1704,7 @@ eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
- $as_echo "$ac_res" >&6; }
- fi
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
- } # ac_fn_c_check_header_mongrel
-
-@@ -1727,7 +1745,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
- ac_retval=$ac_status
- fi
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
- } # ac_fn_c_try_run
-@@ -1741,7 +1759,7 @@ ac_fn_c_check_header_compile ()
- as_lineno=${as_lineno-"$1"}
as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
- $as_echo_n "checking for $2... " >&6; }
--if eval "test \"\${$3+set}\"" = set; then :
-+if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -1759,7 +1777,7 @@ fi
- eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
- $as_echo "$ac_res" >&6; }
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
- } # ac_fn_c_check_header_compile
-
-@@ -1804,7 +1822,7 @@ fi
- # interfere with the next link command; also delete a directory that is
- # left behind by Apple's compiler. We do this before executing the actions.
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
- } # ac_fn_c_try_link
-@@ -1818,7 +1836,7 @@ ac_fn_c_check_type ()
- as_lineno=${as_lineno-"$1"}
as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
- $as_echo_n "checking for $2... " >&6; }
--if eval "test \"\${$3+set}\"" = set; then :
-+if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- eval "$3=no"
-@@ -1859,7 +1877,7 @@ fi
- eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
- $as_echo "$ac_res" >&6; }
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
- } # ac_fn_c_check_type
-
-@@ -1872,7 +1890,7 @@ ac_fn_c_find_uintX_t ()
- as_lineno=${as_lineno-"$1"}
as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5
- $as_echo_n "checking for uint$2_t... " >&6; }
--if eval "test \"\${$3+set}\"" = set; then :
-+if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- eval "$3=no"
-@@ -1912,7 +1930,7 @@ fi
- eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
- $as_echo "$ac_res" >&6; }
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
- } # ac_fn_c_find_uintX_t
-
-@@ -1925,7 +1943,7 @@ ac_fn_c_find_intX_t ()
- as_lineno=${as_lineno-"$1"}
as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5
- $as_echo_n "checking for int$2_t... " >&6; }
--if eval "test \"\${$3+set}\"" = set; then :
-+if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- eval "$3=no"
-@@ -1986,7 +2004,7 @@ fi
- eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
- $as_echo "$ac_res" >&6; }
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
- } # ac_fn_c_find_intX_t
-
-@@ -2163,7 +2181,7 @@ rm -f core *.core core.conftest.* gmon.o
- rm -f conftest.val
-
- fi
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
- } # ac_fn_c_compute_int
-@@ -2176,7 +2194,7 @@ ac_fn_c_check_func ()
- as_lineno=${as_lineno-"$1"}
as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
- $as_echo_n "checking for $2... " >&6; }
--if eval "test \"\${$3+set}\"" = set; then :
-+if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -2231,7 +2249,7 @@ fi
- eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
- $as_echo "$ac_res" >&6; }
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
- } # ac_fn_c_check_func
-
-@@ -2244,7 +2262,7 @@ ac_fn_c_check_member ()
- as_lineno=${as_lineno-"$1"}
as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
- $as_echo_n "checking for $2.$3... " >&6; }
--if eval "test \"\${$4+set}\"" = set; then :
-+if eval \${$4+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -2288,7 +2306,7 @@ fi
- eval ac_res=\$$4
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
- $as_echo "$ac_res" >&6; }
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
- } # ac_fn_c_check_member
-
-@@ -2303,7 +2321,7 @@ ac_fn_c_check_decl ()
- as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/)
0& (/g'`
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is
declared" >&5
- $as_echo_n "checking whether $as_decl_name is declared... " >&6; }
--if eval "test \"\${$3+set}\"" = set; then :
-+if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -2334,7 +2352,7 @@ fi
- eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
- $as_echo "$ac_res" >&6; }
-- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
-+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
- } # ac_fn_c_check_decl
- cat >config.log <<_ACEOF
-@@ -2342,7 +2360,7 @@ This file contains any messages produced
- running configure, to aid debugging if configure makes a mistake.
-
- It was created by python $as_me 2.7, which was
--generated by GNU Autoconf 2.67. Invocation command line was
-+generated by GNU Autoconf 2.68. Invocation command line was
-
- $ $0 $@
-
-@@ -2600,7 +2618,7 @@ $as_echo "$as_me: loading site script $a
- || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error $? "failed to load site script $ac_site_file
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- fi
- done
-
-@@ -3241,7 +3259,7 @@ if test -n "$ac_tool_prefix"; then
- set dummy ${ac_tool_prefix}gcc; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_CC+set}" = set; then :
-+if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$CC"; then
-@@ -3281,7 +3299,7 @@ if test -z "$ac_cv_prog_CC"; then
- set dummy gcc; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
-+if ${ac_cv_prog_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$ac_ct_CC"; then
-@@ -3334,7 +3352,7 @@ if test -z "$CC"; then
- set dummy ${ac_tool_prefix}cc; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_CC+set}" = set; then :
-+if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$CC"; then
-@@ -3374,7 +3392,7 @@ if test -z "$CC"; then
- set dummy cc; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_CC+set}" = set; then :
-+if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$CC"; then
-@@ -3433,7 +3451,7 @@ if test -z "$CC"; then
- set dummy $ac_tool_prefix$ac_prog; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_CC+set}" = set; then :
-+if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$CC"; then
-@@ -3477,7 +3495,7 @@ do
- set dummy $ac_prog; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
-+if ${ac_cv_prog_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$ac_ct_CC"; then
-@@ -3532,7 +3550,7 @@ fi
- test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}:
error: in \`$ac_pwd':" >&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error $? "no acceptable C compiler found in \$PATH
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
-
- # Provide some information about the compiler.
- $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version"
>&5
-@@ -3647,7 +3665,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "C compiler cannot create executables
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
- $as_echo "yes" >&6; }
-@@ -3690,7 +3708,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error $? "cannot compute suffix of executables: cannot compile and link
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- fi
- rm -f conftest conftest$ac_cv_exeext
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
-@@ -3749,7 +3767,7 @@ $as_echo "$ac_try_echo"; } >&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error $? "cannot run C compiled programs.
- If you meant to cross compile, use \`--host'.
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- fi
- fi
- fi
-@@ -3760,7 +3778,7 @@ rm -f conftest.$ac_ext conftest$ac_cv_ex
- ac_clean_files=$ac_clean_files_save
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files"
>&5
- $as_echo_n "checking for suffix of object files... " >&6; }
--if test "${ac_cv_objext+set}" = set; then :
-+if ${ac_cv_objext+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -3801,7 +3819,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error $? "cannot compute suffix of object files: cannot compile
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- fi
- rm -f conftest.$ac_cv_objext conftest.$ac_ext
- fi
-@@ -3811,7 +3829,7 @@ OBJEXT=$ac_cv_objext
- ac_objext=$OBJEXT
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C
compiler" >&5
- $as_echo_n "checking whether we are using the GNU C compiler... " >&6;
}
--if test "${ac_cv_c_compiler_gnu+set}" = set; then :
-+if ${ac_cv_c_compiler_gnu+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -3848,7 +3866,7 @@ ac_test_CFLAGS=${CFLAGS+set}
- ac_save_CFLAGS=$CFLAGS
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g"
>&5
- $as_echo_n "checking whether $CC accepts -g... " >&6; }
--if test "${ac_cv_prog_cc_g+set}" = set; then :
-+if ${ac_cv_prog_cc_g+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_save_c_werror_flag=$ac_c_werror_flag
-@@ -3926,7 +3944,7 @@ else
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO
C89" >&5
- $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
--if test "${ac_cv_prog_cc_c89+set}" = set; then :
-+if ${ac_cv_prog_cc_c89+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_cv_prog_cc_c89=no
-@@ -4065,7 +4083,7 @@ then
- set dummy g++; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_path_CXX+set}" = set; then :
-+if ${ac_cv_path_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- case $CXX in
-@@ -4106,7 +4124,7 @@ fi
- set dummy c++; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_path_CXX+set}" = set; then :
-+if ${ac_cv_path_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- case $CXX in
-@@ -4157,7 +4175,7 @@ do
- set dummy $ac_prog; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_CXX+set}" = set; then :
-+if ${ac_cv_prog_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$CXX"; then
-@@ -4228,7 +4246,7 @@ if test -n "$CPP" && test -d "$CPP";
the
- CPP=
- fi
- if test -z "$CPP"; then
-- if test "${ac_cv_prog_CPP+set}" = set; then :
-+ if ${ac_cv_prog_CPP+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- # Double quotes because CPP needs to be expanded
-@@ -4344,7 +4362,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- fi
-
- ac_ext=c
-@@ -4356,7 +4374,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines
and -e" >&5
- $as_echo_n "checking for grep that handles long lines and -e... " >&6;
}
--if test "${ac_cv_path_GREP+set}" = set; then :
-+if ${ac_cv_path_GREP+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -z "$GREP"; then
-@@ -4419,7 +4437,7 @@ $as_echo "$ac_cv_path_GREP" >&6; }
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
- $as_echo_n "checking for egrep... " >&6; }
--if test "${ac_cv_path_EGREP+set}" = set; then :
-+if ${ac_cv_path_EGREP+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
-@@ -4486,7 +4504,7 @@ $as_echo "$ac_cv_path_EGREP" >&6; }
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files"
>&5
- $as_echo_n "checking for ANSI C header files... " >&6; }
--if test "${ac_cv_header_stdc+set}" = set; then :
-+if ${ac_cv_header_stdc+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -4615,7 +4633,7 @@ done
-
-
- ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h"
"ac_cv_header_minix_config_h" "$ac_includes_default"
--if test "x$ac_cv_header_minix_config_h" = x""yes; then :
-+if test "x$ac_cv_header_minix_config_h" = xyes; then :
- MINIX=yes
- else
- MINIX=
-@@ -4637,7 +4655,7 @@ $as_echo "#define _MINIX 1" >>confdefs.h
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define
__EXTENSIONS__" >&5
- $as_echo_n "checking whether it is safe to define __EXTENSIONS__... "
>&6; }
--if test "${ac_cv_safe_to_define___extensions__+set}" = set; then :
-+if ${ac_cv_safe_to_define___extensions__+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -4747,7 +4765,7 @@ esac
- $as_echo_n "checking LIBRARY... " >&6; }
- if test -z "$LIBRARY"
- then
-- LIBRARY='libpython$(VERSION).a'
-+ LIBRARY='libpython$(VERSION)$(DEBUG_EXT).a'
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBRARY" >&5
- $as_echo "$LIBRARY" >&6; }
-@@ -4921,8 +4939,8 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>
- INSTSONAME="$LDLIBRARY".$SOVERSION
- ;;
- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*)
-- LDLIBRARY='libpython$(VERSION).so'
-- BLDLIBRARY='-L. -lpython$(VERSION)'
-+ LDLIBRARY='libpython$(VERSION)$(DEBUG_EXT).so'
-+ BLDLIBRARY='-L. -lpython$(VERSION)$(DEBUG_EXT)'
- RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
- case $ac_sys_system in
- FreeBSD*)
-@@ -4945,7 +4963,7 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>
- ;;
- OSF*)
- LDLIBRARY='libpython$(VERSION).so'
-- BLDLIBRARY='-rpath $(LIBDIR) -L. -lpython$(VERSION)'
-+ BLDLIBRARY='-L. -lpython$(VERSION)'
- RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
- ;;
- atheos*)
-@@ -4981,7 +4999,7 @@ if test -n "$ac_tool_prefix"; then
- set dummy ${ac_tool_prefix}ranlib; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_RANLIB+set}" = set; then :
-+if ${ac_cv_prog_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$RANLIB"; then
-@@ -5021,7 +5039,7 @@ if test -z "$ac_cv_prog_RANLIB"; then
- set dummy ranlib; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then :
-+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$ac_ct_RANLIB"; then
-@@ -5075,7 +5093,7 @@ do
- set dummy $ac_prog; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_AR+set}" = set; then :
-+if ${ac_cv_prog_AR+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$AR"; then
-@@ -5125,7 +5143,7 @@ fi
- set dummy svnversion; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_SVNVERSION+set}" = set; then :
-+if ${ac_cv_prog_SVNVERSION+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$SVNVERSION"; then
-@@ -5173,7 +5191,7 @@ fi
- set dummy hg; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_HAS_HG+set}" = set; then :
-+if ${ac_cv_prog_HAS_HG+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$HAS_HG"; then
-@@ -5272,7 +5290,7 @@ ac_configure="$SHELL $ac_aux_dir/configu
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible
install" >&5
- $as_echo_n "checking for a BSD-compatible install... " >&6; }
- if test -z "$INSTALL"; then
--if test "${ac_cv_path_install+set}" = set; then :
-+if ${ac_cv_path_install+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-@@ -5384,6 +5402,14 @@ $as_echo "no" >&6; }
- fi
-
-
-+if test "$Py_DEBUG" = 'true'
-+then
-+ DEBUG_EXT=_d
-+ DEBUG_SUFFIX=-debug
-+fi
-+
-+
-+
- # XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
- # merged with this chunk of code?
-
-@@ -5460,7 +5486,7 @@ yes)
- $as_echo_n "checking whether $CC accepts -fno-strict-aliasing... " >&6;
}
- ac_save_cc="$CC"
- CC="$CC -fno-strict-aliasing"
-- if test "${ac_cv_no_strict_aliasing_ok+set}" = set; then :
-+ if ${ac_cv_no_strict_aliasing_ok+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -5650,7 +5676,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts
-OPT:Olimit=0" >&5
- $as_echo_n "checking whether $CC accepts -OPT:Olimit=0... " >&6; }
--if test "${ac_cv_opt_olimit_ok+set}" = set; then :
-+if ${ac_cv_opt_olimit_ok+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_save_cc="$CC"
-@@ -5692,7 +5718,7 @@ if test $ac_cv_opt_olimit_ok = yes; then
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Olimit
1500" >&5
- $as_echo_n "checking whether $CC accepts -Olimit 1500... " >&6; }
-- if test "${ac_cv_olimit_ok+set}" = set; then :
-+ if ${ac_cv_olimit_ok+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_save_cc="$CC"
-@@ -5770,7 +5796,7 @@ fi
- # options before we can check whether -Kpthread improves anything.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads are available
without options" >&5
- $as_echo_n "checking whether pthreads are available without options... "
>&6; }
--if test "${ac_cv_pthread_is_default+set}" = set; then :
-+if ${ac_cv_pthread_is_default+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test "$cross_compiling" = yes; then :
-@@ -5823,7 +5849,7 @@ else
- # function available.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts
-Kpthread" >&5
- $as_echo_n "checking whether $CC accepts -Kpthread... " >&6; }
--if test "${ac_cv_kpthread+set}" = set; then :
-+if ${ac_cv_kpthread+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_save_cc="$CC"
-@@ -5872,7 +5898,7 @@ then
- # function available.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts
-Kthread" >&5
- $as_echo_n "checking whether $CC accepts -Kthread... " >&6; }
--if test "${ac_cv_kthread+set}" = set; then :
-+if ${ac_cv_kthread+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_save_cc="$CC"
-@@ -5921,7 +5947,7 @@ then
- # function available.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts
-pthread" >&5
- $as_echo_n "checking whether $CC accepts -pthread... " >&6; }
--if test "${ac_cv_thread+set}" = set; then :
-+if ${ac_cv_thread+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_save_cc="$CC"
-@@ -6006,7 +6032,7 @@ CXX="$ac_save_cxx"
- # checks for header files
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files"
>&5
- $as_echo_n "checking for ANSI C header files... " >&6; }
--if test "${ac_cv_header_stdc+set}" = set; then :
-+if ${ac_cv_header_stdc+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -6145,7 +6171,7 @@ for ac_hdr in dirent.h sys/ndir.h sys/di
- as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines
DIR" >&5
- $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; }
--if eval "test \"\${$as_ac_Header+set}\"" = set; then :
-+if eval \${$as_ac_Header+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -6185,7 +6211,7 @@ done
- if test $ac_header_dirent = dirent.h; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing
opendir" >&5
- $as_echo_n "checking for library containing opendir... " >&6; }
--if test "${ac_cv_search_opendir+set}" = set; then :
-+if ${ac_cv_search_opendir+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_func_search_save_LIBS=$LIBS
-@@ -6219,11 +6245,11 @@ for ac_lib in '' dir; do
- fi
- rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
-- if test "${ac_cv_search_opendir+set}" = set; then :
-+ if ${ac_cv_search_opendir+:} false; then :
- break
- fi
- done
--if test "${ac_cv_search_opendir+set}" = set; then :
-+if ${ac_cv_search_opendir+:} false; then :
-
- else
- ac_cv_search_opendir=no
-@@ -6242,7 +6268,7 @@ fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing
opendir" >&5
- $as_echo_n "checking for library containing opendir... " >&6; }
--if test "${ac_cv_search_opendir+set}" = set; then :
-+if ${ac_cv_search_opendir+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_func_search_save_LIBS=$LIBS
-@@ -6276,11 +6302,11 @@ for ac_lib in '' x; do
- fi
- rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
-- if test "${ac_cv_search_opendir+set}" = set; then :
-+ if ${ac_cv_search_opendir+:} false; then :
- break
- fi
- done
--if test "${ac_cv_search_opendir+set}" = set; then :
-+if ${ac_cv_search_opendir+:} false; then :
-
- else
- ac_cv_search_opendir=no
-@@ -6300,7 +6326,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sys/types.h defines
makedev" >&5
- $as_echo_n "checking whether sys/types.h defines makedev... " >&6; }
--if test "${ac_cv_header_sys_types_h_makedev+set}" = set; then :
-+if ${ac_cv_header_sys_types_h_makedev+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -6328,7 +6354,7 @@ $as_echo "$ac_cv_header_sys_types_h_make
-
- if test $ac_cv_header_sys_types_h_makedev = no; then
- ac_fn_c_check_header_mongrel "$LINENO" "sys/mkdev.h"
"ac_cv_header_sys_mkdev_h" "$ac_includes_default"
--if test "x$ac_cv_header_sys_mkdev_h" = x""yes; then :
-+if test "x$ac_cv_header_sys_mkdev_h" = xyes; then :
-
- $as_echo "#define MAJOR_IN_MKDEV 1" >>confdefs.h
-
-@@ -6338,7 +6364,7 @@ fi
-
- if test $ac_cv_header_sys_mkdev_h = no; then
- ac_fn_c_check_header_mongrel "$LINENO" "sys/sysmacros.h"
"ac_cv_header_sys_sysmacros_h" "$ac_includes_default"
--if test "x$ac_cv_header_sys_sysmacros_h" = x""yes; then :
-+if test "x$ac_cv_header_sys_sysmacros_h" = xyes; then :
-
- $as_echo "#define MAJOR_IN_SYSMACROS 1" >>confdefs.h
-
-@@ -6358,7 +6384,7 @@ do :
- #endif
-
- "
--if test "x$ac_cv_header_term_h" = x""yes; then :
-+if test "x$ac_cv_header_term_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_TERM_H 1
- _ACEOF
-@@ -6380,7 +6406,7 @@ do :
- #endif
-
- "
--if test "x$ac_cv_header_linux_netlink_h" = x""yes; then :
-+if test "x$ac_cv_header_linux_netlink_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_LINUX_NETLINK_H 1
- _ACEOF
-@@ -6543,7 +6569,7 @@ EOF
-
- # Type availability checks
- ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t"
"$ac_includes_default"
--if test "x$ac_cv_type_mode_t" = x""yes; then :
-+if test "x$ac_cv_type_mode_t" = xyes; then :
-
- else
-
-@@ -6554,7 +6580,7 @@ _ACEOF
- fi
-
- ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t"
"$ac_includes_default"
--if test "x$ac_cv_type_off_t" = x""yes; then :
-+if test "x$ac_cv_type_off_t" = xyes; then :
-
- else
-
-@@ -6565,7 +6591,7 @@ _ACEOF
- fi
-
- ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t"
"$ac_includes_default"
--if test "x$ac_cv_type_pid_t" = x""yes; then :
-+if test "x$ac_cv_type_pid_t" = xyes; then :
-
- else
-
-@@ -6581,7 +6607,7 @@ cat >>confdefs.h <<_ACEOF
- _ACEOF
-
- ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t"
"$ac_includes_default"
--if test "x$ac_cv_type_size_t" = x""yes; then :
-+if test "x$ac_cv_type_size_t" = xyes; then :
-
- else
-
-@@ -6593,7 +6619,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h"
>&5
- $as_echo_n "checking for uid_t in sys/types.h... " >&6; }
--if test "${ac_cv_type_uid_t+set}" = set; then :
-+if ${ac_cv_type_uid_t+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -6672,7 +6698,7 @@ _ACEOF
- esac
-
- ac_fn_c_check_type "$LINENO" "ssize_t"
"ac_cv_type_ssize_t" "$ac_includes_default"
--if test "x$ac_cv_type_ssize_t" = x""yes; then :
-+if test "x$ac_cv_type_ssize_t" = xyes; then :
-
- $as_echo "#define HAVE_SSIZE_T 1" >>confdefs.h
-
-@@ -6687,7 +6713,7 @@ fi
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5
- $as_echo_n "checking size of int... " >&6; }
--if test "${ac_cv_sizeof_int+set}" = set; then :
-+if ${ac_cv_sizeof_int+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))"
"ac_cv_sizeof_int" "$ac_includes_default"; then :
-@@ -6697,7 +6723,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (int)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_int=0
- fi
-@@ -6720,7 +6746,7 @@ _ACEOF
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
- $as_echo_n "checking size of long... " >&6; }
--if test "${ac_cv_sizeof_long+set}" = set; then :
-+if ${ac_cv_sizeof_long+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))"
"ac_cv_sizeof_long" "$ac_includes_default"; then :
-@@ -6730,7 +6756,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (long)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_long=0
- fi
-@@ -6753,7 +6779,7 @@ _ACEOF
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5
- $as_echo_n "checking size of void *... " >&6; }
--if test "${ac_cv_sizeof_void_p+set}" = set; then :
-+if ${ac_cv_sizeof_void_p+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))"
"ac_cv_sizeof_void_p" "$ac_includes_default"; then :
-@@ -6763,7 +6789,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (void *)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_void_p=0
- fi
-@@ -6786,7 +6812,7 @@ _ACEOF
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5
- $as_echo_n "checking size of short... " >&6; }
--if test "${ac_cv_sizeof_short+set}" = set; then :
-+if ${ac_cv_sizeof_short+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))"
"ac_cv_sizeof_short" "$ac_includes_default"; then :
-@@ -6796,7 +6822,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (short)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_short=0
- fi
-@@ -6819,7 +6845,7 @@ _ACEOF
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of float" >&5
- $as_echo_n "checking size of float... " >&6; }
--if test "${ac_cv_sizeof_float+set}" = set; then :
-+if ${ac_cv_sizeof_float+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (float))"
"ac_cv_sizeof_float" "$ac_includes_default"; then :
-@@ -6829,7 +6855,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (float)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_float=0
- fi
-@@ -6852,7 +6878,7 @@ _ACEOF
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of double" >&5
- $as_echo_n "checking size of double... " >&6; }
--if test "${ac_cv_sizeof_double+set}" = set; then :
-+if ${ac_cv_sizeof_double+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (double))"
"ac_cv_sizeof_double" "$ac_includes_default"; then :
-@@ -6862,7 +6888,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (double)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_double=0
- fi
-@@ -6885,7 +6911,7 @@ _ACEOF
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of fpos_t" >&5
- $as_echo_n "checking size of fpos_t... " >&6; }
--if test "${ac_cv_sizeof_fpos_t+set}" = set; then :
-+if ${ac_cv_sizeof_fpos_t+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (fpos_t))"
"ac_cv_sizeof_fpos_t" "$ac_includes_default"; then :
-@@ -6895,7 +6921,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (fpos_t)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_fpos_t=0
- fi
-@@ -6918,7 +6944,7 @@ _ACEOF
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5
- $as_echo_n "checking size of size_t... " >&6; }
--if test "${ac_cv_sizeof_size_t+set}" = set; then :
-+if ${ac_cv_sizeof_size_t+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))"
"ac_cv_sizeof_size_t" "$ac_includes_default"; then :
-@@ -6928,7 +6954,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (size_t)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_size_t=0
- fi
-@@ -6951,7 +6977,7 @@ _ACEOF
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of pid_t" >&5
- $as_echo_n "checking size of pid_t... " >&6; }
--if test "${ac_cv_sizeof_pid_t+set}" = set; then :
-+if ${ac_cv_sizeof_pid_t+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pid_t))"
"ac_cv_sizeof_pid_t" "$ac_includes_default"; then :
-@@ -6961,7 +6987,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (pid_t)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_pid_t=0
- fi
-@@ -7011,7 +7037,7 @@ if test "$have_long_long" = yes ; then
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long"
>&5
- $as_echo_n "checking size of long long... " >&6; }
--if test "${ac_cv_sizeof_long_long+set}" = set; then :
-+if ${ac_cv_sizeof_long_long+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))"
"ac_cv_sizeof_long_long" "$ac_includes_default"; then :
-@@ -7021,7 +7047,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (long long)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_long_long=0
- fi
-@@ -7072,7 +7098,7 @@ if test "$have_long_double" = yes ; then
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long double"
>&5
- $as_echo_n "checking size of long double... " >&6; }
--if test "${ac_cv_sizeof_long_double+set}" = set; then :
-+if ${ac_cv_sizeof_long_double+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long
double))" "ac_cv_sizeof_long_double"
"$ac_includes_default"; then :
-@@ -7082,7 +7108,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (long double)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_long_double=0
- fi
-@@ -7133,7 +7159,7 @@ if test "$have_c99_bool" = yes ; then
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of _Bool" >&5
- $as_echo_n "checking size of _Bool... " >&6; }
--if test "${ac_cv_sizeof__Bool+set}" = set; then :
-+if ${ac_cv_sizeof__Bool+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (_Bool))"
"ac_cv_sizeof__Bool" "$ac_includes_default"; then :
-@@ -7143,7 +7169,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (_Bool)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof__Bool=0
- fi
-@@ -7169,7 +7195,7 @@ ac_fn_c_check_type "$LINENO" "uintptr_t"
- #include <inttypes.h>
- #endif
- "
--if test "x$ac_cv_type_uintptr_t" = x""yes; then :
-+if test "x$ac_cv_type_uintptr_t" = xyes; then :
-
- cat >>confdefs.h <<_ACEOF
- #define HAVE_UINTPTR_T 1
-@@ -7181,7 +7207,7 @@ _ACEOF
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of uintptr_t"
>&5
- $as_echo_n "checking size of uintptr_t... " >&6; }
--if test "${ac_cv_sizeof_uintptr_t+set}" = set; then :
-+if ${ac_cv_sizeof_uintptr_t+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (uintptr_t))"
"ac_cv_sizeof_uintptr_t" "$ac_includes_default"; then :
-@@ -7191,7 +7217,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (uintptr_t)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_uintptr_t=0
- fi
-@@ -7217,7 +7243,7 @@ fi
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5
- $as_echo_n "checking size of off_t... " >&6; }
--if test "${ac_cv_sizeof_off_t+set}" = set; then :
-+if ${ac_cv_sizeof_off_t+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))"
"ac_cv_sizeof_off_t" "
-@@ -7232,7 +7258,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (off_t)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_off_t=0
- fi
-@@ -7276,7 +7302,7 @@ fi
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of time_t" >&5
- $as_echo_n "checking size of time_t... " >&6; }
--if test "${ac_cv_sizeof_time_t+set}" = set; then :
-+if ${ac_cv_sizeof_time_t+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (time_t))"
"ac_cv_sizeof_time_t" "
-@@ -7294,7 +7320,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (time_t)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_time_t=0
- fi
-@@ -7350,7 +7376,7 @@ if test "$have_pthread_t" = yes ; then
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of pthread_t"
>&5
- $as_echo_n "checking size of pthread_t... " >&6; }
--if test "${ac_cv_sizeof_pthread_t+set}" = set; then :
-+if ${ac_cv_sizeof_pthread_t+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pthread_t))"
"ac_cv_sizeof_pthread_t" "
-@@ -7365,7 +7391,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (pthread_t)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_pthread_t=0
- fi
-@@ -7877,7 +7903,7 @@ $as_echo "$SHLIBS" >&6; }
- # checks for libraries
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl"
>&5
- $as_echo_n "checking for dlopen in -ldl... " >&6; }
--if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
-+if ${ac_cv_lib_dl_dlopen+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -7911,7 +7937,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen"
>&5
- $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
--if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
-+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_LIBDL 1
- _ACEOF
-@@ -7922,7 +7948,7 @@ fi
- # Dynamic linking for SunOS/Solaris and SYSV
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld"
>&5
- $as_echo_n "checking for shl_load in -ldld... " >&6; }
--if test "${ac_cv_lib_dld_shl_load+set}" = set; then :
-+if ${ac_cv_lib_dld_shl_load+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -7956,7 +7982,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load"
>&5
- $as_echo "$ac_cv_lib_dld_shl_load" >&6; }
--if test "x$ac_cv_lib_dld_shl_load" = x""yes; then :
-+if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_LIBDLD 1
- _ACEOF
-@@ -7970,7 +7996,7 @@ fi
- if test "$with_threads" = "yes" -o -z "$with_threads";
then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing
sem_init" >&5
- $as_echo_n "checking for library containing sem_init... " >&6; }
--if test "${ac_cv_search_sem_init+set}" = set; then :
-+if ${ac_cv_search_sem_init+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_func_search_save_LIBS=$LIBS
-@@ -8004,11 +8030,11 @@ for ac_lib in '' pthread rt posix4; do
- fi
- rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
-- if test "${ac_cv_search_sem_init+set}" = set; then :
-+ if ${ac_cv_search_sem_init+:} false; then :
- break
- fi
- done
--if test "${ac_cv_search_sem_init+set}" = set; then :
-+if ${ac_cv_search_sem_init+:} false; then :
-
- else
- ac_cv_search_sem_init=no
-@@ -8031,7 +8057,7 @@ fi
- # check if we need libintl for locale functions
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for textdomain in -lintl"
>&5
- $as_echo_n "checking for textdomain in -lintl... " >&6; }
--if test "${ac_cv_lib_intl_textdomain+set}" = set; then :
-+if ${ac_cv_lib_intl_textdomain+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -8065,7 +8091,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_textdomain"
>&5
- $as_echo "$ac_cv_lib_intl_textdomain" >&6; }
--if test "x$ac_cv_lib_intl_textdomain" = x""yes; then :
-+if test "x$ac_cv_lib_intl_textdomain" = xyes; then :
-
- $as_echo "#define WITH_LIBINTL 1" >>confdefs.h
-
-@@ -8112,7 +8138,7 @@ esac
- # BeOS' sockets are stashed in libnet.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for t_open in -lnsl"
>&5
- $as_echo_n "checking for t_open in -lnsl... " >&6; }
--if test "${ac_cv_lib_nsl_t_open+set}" = set; then :
-+if ${ac_cv_lib_nsl_t_open+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -8146,13 +8172,13 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_t_open"
>&5
- $as_echo "$ac_cv_lib_nsl_t_open" >&6; }
--if test "x$ac_cv_lib_nsl_t_open" = x""yes; then :
-+if test "x$ac_cv_lib_nsl_t_open" = xyes; then :
- LIBS="-lnsl $LIBS"
- fi
- # SVR4
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket"
>&5
- $as_echo_n "checking for socket in -lsocket... " >&6; }
--if test "${ac_cv_lib_socket_socket+set}" = set; then :
-+if ${ac_cv_lib_socket_socket+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -8186,7 +8212,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket"
>&5
- $as_echo "$ac_cv_lib_socket_socket" >&6; }
--if test "x$ac_cv_lib_socket_socket" = x""yes; then :
-+if test "x$ac_cv_lib_socket_socket" = xyes; then :
- LIBS="-lsocket $LIBS"
- fi
- # SVR4 sockets
-@@ -8195,7 +8221,7 @@ case "$ac_sys_system" in
- BeOS*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lnet"
>&5
- $as_echo_n "checking for socket in -lnet... " >&6; }
--if test "${ac_cv_lib_net_socket+set}" = set; then :
-+if ${ac_cv_lib_net_socket+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -8229,7 +8255,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_net_socket"
>&5
- $as_echo "$ac_cv_lib_net_socket" >&6; }
--if test "x$ac_cv_lib_net_socket" = x""yes; then :
-+if test "x$ac_cv_lib_net_socket" = xyes; then :
- LIBS="-lnet $LIBS"
- fi
- # BeOS
-@@ -8257,7 +8283,7 @@ if test -n "$ac_tool_prefix"; then
- set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
-+if ${ac_cv_path_PKG_CONFIG+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- case $PKG_CONFIG in
-@@ -8300,7 +8326,7 @@ if test -z "$ac_cv_path_PKG_CONFIG"; the
- set dummy pkg-config; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
-+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- case $ac_pt_PKG_CONFIG in
-@@ -8568,7 +8594,7 @@ $as_echo "$unistd_defines_pthreads" >&6;
- $as_echo "#define _REENTRANT 1" >>confdefs.h
-
- ac_fn_c_check_header_mongrel "$LINENO" "cthreads.h"
"ac_cv_header_cthreads_h" "$ac_includes_default"
--if test "x$ac_cv_header_cthreads_h" = x""yes; then :
-+if test "x$ac_cv_header_cthreads_h" = xyes; then :
- $as_echo "#define WITH_THREAD 1" >>confdefs.h
-
- $as_echo "#define C_THREADS 1" >>confdefs.h
-@@ -8581,7 +8607,7 @@ $as_echo "#define HURD_C_THREADS 1" >>co
- else
-
- ac_fn_c_check_header_mongrel "$LINENO" "mach/cthreads.h"
"ac_cv_header_mach_cthreads_h" "$ac_includes_default"
--if test "x$ac_cv_header_mach_cthreads_h" = x""yes; then :
-+if test "x$ac_cv_header_mach_cthreads_h" = xyes; then :
- $as_echo "#define WITH_THREAD 1" >>confdefs.h
-
- $as_echo "#define C_THREADS 1" >>confdefs.h
-@@ -8643,7 +8669,7 @@ else
-
- LIBS=$_libs
- ac_fn_c_check_func "$LINENO" "pthread_detach"
"ac_cv_func_pthread_detach"
--if test "x$ac_cv_func_pthread_detach" = x""yes; then :
-+if test "x$ac_cv_func_pthread_detach" = xyes; then :
- $as_echo "#define WITH_THREAD 1" >>confdefs.h
-
- posix_threads=yes
-@@ -8651,7 +8677,7 @@ if test "x$ac_cv_func_pthread_detach" =
- else
-
- ac_fn_c_check_header_mongrel "$LINENO" "atheos/threads.h"
"ac_cv_header_atheos_threads_h" "$ac_includes_default"
--if test "x$ac_cv_header_atheos_threads_h" = x""yes; then :
-+if test "x$ac_cv_header_atheos_threads_h" = xyes; then :
- $as_echo "#define WITH_THREAD 1" >>confdefs.h
-
-
-@@ -8661,7 +8687,7 @@ $as_echo "#define ATHEOS_THREADS 1" >>co
- else
-
- ac_fn_c_check_header_mongrel "$LINENO" "kernel/OS.h"
"ac_cv_header_kernel_OS_h" "$ac_includes_default"
--if test "x$ac_cv_header_kernel_OS_h" = x""yes; then :
-+if test "x$ac_cv_header_kernel_OS_h" = xyes; then :
- $as_echo "#define WITH_THREAD 1" >>confdefs.h
-
-
-@@ -8672,7 +8698,7 @@ else
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in
-lpthreads" >&5
- $as_echo_n "checking for pthread_create in -lpthreads... " >&6; }
--if test "${ac_cv_lib_pthreads_pthread_create+set}" = set; then :
-+if ${ac_cv_lib_pthreads_pthread_create+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -8706,7 +8732,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_pthreads_pthread_create" >&5
- $as_echo "$ac_cv_lib_pthreads_pthread_create" >&6; }
--if test "x$ac_cv_lib_pthreads_pthread_create" = x""yes; then :
-+if test "x$ac_cv_lib_pthreads_pthread_create" = xyes; then :
- $as_echo "#define WITH_THREAD 1" >>confdefs.h
-
- posix_threads=yes
-@@ -8716,7 +8742,7 @@ else
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in
-lc_r" >&5
- $as_echo_n "checking for pthread_create in -lc_r... " >&6; }
--if test "${ac_cv_lib_c_r_pthread_create+set}" = set; then :
-+if ${ac_cv_lib_c_r_pthread_create+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -8750,7 +8776,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_c_r_pthread_create" >&5
- $as_echo "$ac_cv_lib_c_r_pthread_create" >&6; }
--if test "x$ac_cv_lib_c_r_pthread_create" = x""yes; then :
-+if test "x$ac_cv_lib_c_r_pthread_create" = xyes; then :
- $as_echo "#define WITH_THREAD 1" >>confdefs.h
-
- posix_threads=yes
-@@ -8760,7 +8786,7 @@ else
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __pthread_create_system
in -lpthread" >&5
- $as_echo_n "checking for __pthread_create_system in -lpthread... " >&6;
}
--if test "${ac_cv_lib_pthread___pthread_create_system+set}" = set; then :
-+if ${ac_cv_lib_pthread___pthread_create_system+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -8794,7 +8820,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_pthread___pthread_create_system" >&5
- $as_echo "$ac_cv_lib_pthread___pthread_create_system" >&6; }
--if test "x$ac_cv_lib_pthread___pthread_create_system" = x""yes; then
:
-+if test "x$ac_cv_lib_pthread___pthread_create_system" = xyes; then :
- $as_echo "#define WITH_THREAD 1" >>confdefs.h
-
- posix_threads=yes
-@@ -8804,7 +8830,7 @@ else
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in
-lcma" >&5
- $as_echo_n "checking for pthread_create in -lcma... " >&6; }
--if test "${ac_cv_lib_cma_pthread_create+set}" = set; then :
-+if ${ac_cv_lib_cma_pthread_create+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -8838,7 +8864,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_cma_pthread_create" >&5
- $as_echo "$ac_cv_lib_cma_pthread_create" >&6; }
--if test "x$ac_cv_lib_cma_pthread_create" = x""yes; then :
-+if test "x$ac_cv_lib_cma_pthread_create" = xyes; then :
- $as_echo "#define WITH_THREAD 1" >>confdefs.h
-
- posix_threads=yes
-@@ -8878,7 +8904,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for usconfig in -lmpc"
>&5
- $as_echo_n "checking for usconfig in -lmpc... " >&6; }
--if test "${ac_cv_lib_mpc_usconfig+set}" = set; then :
-+if ${ac_cv_lib_mpc_usconfig+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -8912,7 +8938,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mpc_usconfig"
>&5
- $as_echo "$ac_cv_lib_mpc_usconfig" >&6; }
--if test "x$ac_cv_lib_mpc_usconfig" = x""yes; then :
-+if test "x$ac_cv_lib_mpc_usconfig" = xyes; then :
- $as_echo "#define WITH_THREAD 1" >>confdefs.h
-
- LIBS="$LIBS -lmpc"
-@@ -8924,7 +8950,7 @@ fi
- if test "$posix_threads" != "yes"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thr_create in
-lthread" >&5
- $as_echo_n "checking for thr_create in -lthread... " >&6; }
--if test "${ac_cv_lib_thread_thr_create+set}" = set; then :
-+if ${ac_cv_lib_thread_thr_create+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -8958,7 +8984,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_thread_thr_create"
>&5
- $as_echo "$ac_cv_lib_thread_thr_create" >&6; }
--if test "x$ac_cv_lib_thread_thr_create" = x""yes; then :
-+if test "x$ac_cv_lib_thread_thr_create" = xyes; then :
- $as_echo "#define WITH_THREAD 1" >>confdefs.h
-
- LIBS="$LIBS -lthread"
-@@ -9003,7 +9029,7 @@ $as_echo "#define HAVE_BROKEN_POSIX_SEMA
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if PTHREAD_SCOPE_SYSTEM is
supported" >&5
- $as_echo_n "checking if PTHREAD_SCOPE_SYSTEM is supported... " >&6; }
-- if test "${ac_cv_pthread_system_supported+set}" = set; then :
-+ if ${ac_cv_pthread_system_supported+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test "$cross_compiling" = yes; then :
-@@ -9046,7 +9072,7 @@ $as_echo "#define PTHREAD_SYSTEM_SCHED_S
- for ac_func in pthread_sigmask
- do :
- ac_fn_c_check_func "$LINENO" "pthread_sigmask"
"ac_cv_func_pthread_sigmask"
--if test "x$ac_cv_func_pthread_sigmask" = x""yes; then :
-+if test "x$ac_cv_func_pthread_sigmask" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_PTHREAD_SIGMASK 1
- _ACEOF
-@@ -9399,6 +9425,50 @@ $as_echo "no" >&6; }
- fi
-
-
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-count-allocs"
>&5
-+$as_echo_n "checking for --with-count-allocs... " >&6; }
-+
-+# Check whether --with-count-allocs was given.
-+if test "${with_count_allocs+set}" = set; then :
-+ withval=$with_count_allocs;
-+if test "$withval" != no
-+then
-+
-+$as_echo "#define COUNT_ALLOCS 1" >>confdefs.h
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-+$as_echo "yes" >&6; }
-+else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+else
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-call-profile"
>&5
-+$as_echo_n "checking for --with-call-profile... " >&6; }
-+
-+# Check whether --with-call-profile was given.
-+if test "${with_call_profile+set}" = set; then :
-+ withval=$with_call_profile;
-+if test "$withval" != no
-+then
-+
-+$as_echo "#define CALL_PROFILE 1" >>confdefs.h
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-+$as_echo "yes" >&6; }
-+else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+else
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+
- # Check for Python-specific malloc support
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-pymalloc"
>&5
- $as_echo_n "checking for --with-pymalloc... " >&6; }
-@@ -9436,7 +9506,7 @@ fi
- $as_echo "$with_valgrind" >&6; }
- if test "$with_valgrind" != no; then
- ac_fn_c_check_header_mongrel "$LINENO" "valgrind/valgrind.h"
"ac_cv_header_valgrind_valgrind_h" "$ac_includes_default"
--if test "x$ac_cv_header_valgrind_valgrind_h" = x""yes; then :
-+if test "x$ac_cv_header_valgrind_valgrind_h" = xyes; then :
-
- $as_echo "#define WITH_VALGRIND 1" >>confdefs.h
-
-@@ -9448,6 +9518,46 @@ fi
-
- fi
-
-+# Check for dtrace support
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-dtrace"
>&5
-+$as_echo_n "checking for --with-dtrace... " >&6; }
-+
-+# Check whether --with-dtrace was given.
-+if test "${with_dtrace+set}" = set; then :
-+ withval=$with_dtrace;
-+fi
-+
-+
-+if test ! -z "$with_dtrace"
-+then
-+ if dtrace -G -o /dev/null -s $srcdir/Include/pydtrace.d 2>/dev/null
-+ then
-+
-+$as_echo "#define WITH_DTRACE 1" >>confdefs.h
-+
-+ with_dtrace="Sun"
-+ DTRACEOBJS="Python/dtrace.o"
-+ DTRADEHDRS=""
-+ elif dtrace -h -o /dev/null -s $srcdir/Include/pydtrace.d
-+ then
-+
-+$as_echo "#define WITH_DTRACE 1" >>confdefs.h
-+
-+ with_dtrace="Apple"
-+ DTRACEOBJS=""
-+ DTRADEHDRS="pydtrace.h"
-+ else
-+ with_dtrace="no"
-+ fi
-+else
-+ with_dtrace="no"
-+fi
-+
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_dtrace" >&5
-+$as_echo "$with_dtrace" >&6; }
-+
-+
-+
- # Check for --with-wctype-functions
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-wctype-functions"
>&5
- $as_echo_n "checking for --with-wctype-functions... " >&6; }
-@@ -9480,7 +9590,7 @@ DLINCLDIR=.
- for ac_func in dlopen
- do :
- ac_fn_c_check_func "$LINENO" "dlopen"
"ac_cv_func_dlopen"
--if test "x$ac_cv_func_dlopen" = x""yes; then :
-+if test "x$ac_cv_func_dlopen" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_DLOPEN 1
- _ACEOF
-@@ -9810,7 +9920,7 @@ rm -f core conftest.err conftest.$ac_obj
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flock declaration"
>&5
- $as_echo_n "checking for flock declaration... " >&6; }
--if test "${ac_cv_flock_decl+set}" = set; then :
-+if ${ac_cv_flock_decl+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -9840,7 +9950,7 @@ if test "x${ac_cv_flock_decl}" = xyes; t
- for ac_func in flock
- do :
- ac_fn_c_check_func "$LINENO" "flock" "ac_cv_func_flock"
--if test "x$ac_cv_func_flock" = x""yes; then :
-+if test "x$ac_cv_func_flock" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_FLOCK 1
- _ACEOF
-@@ -9848,7 +9958,7 @@ _ACEOF
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flock in -lbsd"
>&5
- $as_echo_n "checking for flock in -lbsd... " >&6; }
--if test "${ac_cv_lib_bsd_flock+set}" = set; then :
-+if ${ac_cv_lib_bsd_flock+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -9882,7 +9992,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_flock"
>&5
- $as_echo "$ac_cv_lib_bsd_flock" >&6; }
--if test "x$ac_cv_lib_bsd_flock" = x""yes; then :
-+if test "x$ac_cv_lib_bsd_flock" = xyes; then :
- $as_echo "#define HAVE_FLOCK 1" >>confdefs.h
-
-
-@@ -9959,7 +10069,7 @@ do
- set dummy $ac_prog; ac_word=$2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
- $as_echo_n "checking for $ac_word... " >&6; }
--if test "${ac_cv_prog_TRUE+set}" = set; then :
-+if ${ac_cv_prog_TRUE+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test -n "$TRUE"; then
-@@ -9999,7 +10109,7 @@ test -n "$TRUE" || TRUE="/bin/true"
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lc"
>&5
- $as_echo_n "checking for inet_aton in -lc... " >&6; }
--if test "${ac_cv_lib_c_inet_aton+set}" = set; then :
-+if ${ac_cv_lib_c_inet_aton+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -10033,12 +10143,12 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_inet_aton"
>&5
- $as_echo "$ac_cv_lib_c_inet_aton" >&6; }
--if test "x$ac_cv_lib_c_inet_aton" = x""yes; then :
-+if test "x$ac_cv_lib_c_inet_aton" = xyes; then :
- $ac_cv_prog_TRUE
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lresolv"
>&5
- $as_echo_n "checking for inet_aton in -lresolv... " >&6; }
--if test "${ac_cv_lib_resolv_inet_aton+set}" = set; then :
-+if ${ac_cv_lib_resolv_inet_aton+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -10072,7 +10182,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_inet_aton"
>&5
- $as_echo "$ac_cv_lib_resolv_inet_aton" >&6; }
--if test "x$ac_cv_lib_resolv_inet_aton" = x""yes; then :
-+if test "x$ac_cv_lib_resolv_inet_aton" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_LIBRESOLV 1
- _ACEOF
-@@ -10089,7 +10199,7 @@ fi
- # exit Python
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for chflags" >&5
- $as_echo_n "checking for chflags... " >&6; }
--if test "${ac_cv_have_chflags+set}" = set; then :
-+if ${ac_cv_have_chflags+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test "$cross_compiling" = yes; then :
-@@ -10123,7 +10233,7 @@ fi
- $as_echo "$ac_cv_have_chflags" >&6; }
- if test "$ac_cv_have_chflags" = cross ; then
- ac_fn_c_check_func "$LINENO" "chflags"
"ac_cv_func_chflags"
--if test "x$ac_cv_func_chflags" = x""yes; then :
-+if test "x$ac_cv_func_chflags" = xyes; then :
- ac_cv_have_chflags="yes"
- else
- ac_cv_have_chflags="no"
-@@ -10138,7 +10248,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lchflags" >&5
- $as_echo_n "checking for lchflags... " >&6; }
--if test "${ac_cv_have_lchflags+set}" = set; then :
-+if ${ac_cv_have_lchflags+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test "$cross_compiling" = yes; then :
-@@ -10172,7 +10282,7 @@ fi
- $as_echo "$ac_cv_have_lchflags" >&6; }
- if test "$ac_cv_have_lchflags" = cross ; then
- ac_fn_c_check_func "$LINENO" "lchflags"
"ac_cv_func_lchflags"
--if test "x$ac_cv_func_lchflags" = x""yes; then :
-+if test "x$ac_cv_func_lchflags" = xyes; then :
- ac_cv_have_lchflags="yes"
- else
- ac_cv_have_lchflags="no"
-@@ -10196,7 +10306,7 @@ esac
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateCopy in -lz"
>&5
- $as_echo_n "checking for inflateCopy in -lz... " >&6; }
--if test "${ac_cv_lib_z_inflateCopy+set}" = set; then :
-+if ${ac_cv_lib_z_inflateCopy+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -10230,7 +10340,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflateCopy"
>&5
- $as_echo "$ac_cv_lib_z_inflateCopy" >&6; }
--if test "x$ac_cv_lib_z_inflateCopy" = x""yes; then :
-+if test "x$ac_cv_lib_z_inflateCopy" = xyes; then :
-
- $as_echo "#define HAVE_ZLIB_COPY 1" >>confdefs.h
-
-@@ -10373,7 +10483,7 @@ rm -f core conftest.err conftest.$ac_obj
- for ac_func in openpty
- do :
- ac_fn_c_check_func "$LINENO" "openpty"
"ac_cv_func_openpty"
--if test "x$ac_cv_func_openpty" = x""yes; then :
-+if test "x$ac_cv_func_openpty" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_OPENPTY 1
- _ACEOF
-@@ -10381,7 +10491,7 @@ _ACEOF
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openpty in -lutil"
>&5
- $as_echo_n "checking for openpty in -lutil... " >&6; }
--if test "${ac_cv_lib_util_openpty+set}" = set; then :
-+if ${ac_cv_lib_util_openpty+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -10415,13 +10525,13 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_openpty"
>&5
- $as_echo "$ac_cv_lib_util_openpty" >&6; }
--if test "x$ac_cv_lib_util_openpty" = x""yes; then :
-+if test "x$ac_cv_lib_util_openpty" = xyes; then :
- $as_echo "#define HAVE_OPENPTY 1" >>confdefs.h
- LIBS="$LIBS -lutil"
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openpty in -lbsd"
>&5
- $as_echo_n "checking for openpty in -lbsd... " >&6; }
--if test "${ac_cv_lib_bsd_openpty+set}" = set; then :
-+if ${ac_cv_lib_bsd_openpty+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -10455,7 +10565,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_openpty"
>&5
- $as_echo "$ac_cv_lib_bsd_openpty" >&6; }
--if test "x$ac_cv_lib_bsd_openpty" = x""yes; then :
-+if test "x$ac_cv_lib_bsd_openpty" = xyes; then :
- $as_echo "#define HAVE_OPENPTY 1" >>confdefs.h
- LIBS="$LIBS -lbsd"
- fi
-@@ -10470,7 +10580,7 @@ done
- for ac_func in forkpty
- do :
- ac_fn_c_check_func "$LINENO" "forkpty"
"ac_cv_func_forkpty"
--if test "x$ac_cv_func_forkpty" = x""yes; then :
-+if test "x$ac_cv_func_forkpty" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_FORKPTY 1
- _ACEOF
-@@ -10478,7 +10588,7 @@ _ACEOF
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for forkpty in -lutil"
>&5
- $as_echo_n "checking for forkpty in -lutil... " >&6; }
--if test "${ac_cv_lib_util_forkpty+set}" = set; then :
-+if ${ac_cv_lib_util_forkpty+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -10512,13 +10622,13 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_forkpty"
>&5
- $as_echo "$ac_cv_lib_util_forkpty" >&6; }
--if test "x$ac_cv_lib_util_forkpty" = x""yes; then :
-+if test "x$ac_cv_lib_util_forkpty" = xyes; then :
- $as_echo "#define HAVE_FORKPTY 1" >>confdefs.h
- LIBS="$LIBS -lutil"
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for forkpty in -lbsd"
>&5
- $as_echo_n "checking for forkpty in -lbsd... " >&6; }
--if test "${ac_cv_lib_bsd_forkpty+set}" = set; then :
-+if ${ac_cv_lib_bsd_forkpty+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -10552,7 +10662,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_forkpty"
>&5
- $as_echo "$ac_cv_lib_bsd_forkpty" >&6; }
--if test "x$ac_cv_lib_bsd_forkpty" = x""yes; then :
-+if test "x$ac_cv_lib_bsd_forkpty" = xyes; then :
- $as_echo "#define HAVE_FORKPTY 1" >>confdefs.h
- LIBS="$LIBS -lbsd"
- fi
-@@ -10569,7 +10679,7 @@ done
- for ac_func in memmove
- do :
- ac_fn_c_check_func "$LINENO" "memmove"
"ac_cv_func_memmove"
--if test "x$ac_cv_func_memmove" = x""yes; then :
-+if test "x$ac_cv_func_memmove" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_MEMMOVE 1
- _ACEOF
-@@ -10593,7 +10703,7 @@ done
-
-
- ac_fn_c_check_func "$LINENO" "dup2" "ac_cv_func_dup2"
--if test "x$ac_cv_func_dup2" = x""yes; then :
-+if test "x$ac_cv_func_dup2" = xyes; then :
- $as_echo "#define HAVE_DUP2 1" >>confdefs.h
-
- else
-@@ -10606,7 +10716,7 @@ esac
- fi
-
- ac_fn_c_check_func "$LINENO" "getcwd" "ac_cv_func_getcwd"
--if test "x$ac_cv_func_getcwd" = x""yes; then :
-+if test "x$ac_cv_func_getcwd" = xyes; then :
- $as_echo "#define HAVE_GETCWD 1" >>confdefs.h
-
- else
-@@ -10619,7 +10729,7 @@ esac
- fi
-
- ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup"
--if test "x$ac_cv_func_strdup" = x""yes; then :
-+if test "x$ac_cv_func_strdup" = xyes; then :
- $as_echo "#define HAVE_STRDUP 1" >>confdefs.h
-
- else
-@@ -10635,7 +10745,7 @@ fi
- for ac_func in getpgrp
- do :
- ac_fn_c_check_func "$LINENO" "getpgrp"
"ac_cv_func_getpgrp"
--if test "x$ac_cv_func_getpgrp" = x""yes; then :
-+if test "x$ac_cv_func_getpgrp" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_GETPGRP 1
- _ACEOF
-@@ -10663,7 +10773,7 @@ done
- for ac_func in setpgrp
- do :
- ac_fn_c_check_func "$LINENO" "setpgrp"
"ac_cv_func_setpgrp"
--if test "x$ac_cv_func_setpgrp" = x""yes; then :
-+if test "x$ac_cv_func_setpgrp" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_SETPGRP 1
- _ACEOF
-@@ -10691,7 +10801,7 @@ done
- for ac_func in gettimeofday
- do :
- ac_fn_c_check_func "$LINENO" "gettimeofday"
"ac_cv_func_gettimeofday"
--if test "x$ac_cv_func_gettimeofday" = x""yes; then :
-+if test "x$ac_cv_func_gettimeofday" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_GETTIMEOFDAY 1
- _ACEOF
-@@ -10793,7 +10903,7 @@ if test $have_getaddrinfo = yes
- then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking getaddrinfo bug"
>&5
- $as_echo_n "checking getaddrinfo bug... " >&6; }
-- if test "${ac_cv_buggy_getaddrinfo+set}" = set; then :
-+ if ${ac_cv_buggy_getaddrinfo+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test "$cross_compiling" = yes; then :
-@@ -10922,7 +11032,7 @@ fi
- for ac_func in getnameinfo
- do :
- ac_fn_c_check_func "$LINENO" "getnameinfo"
"ac_cv_func_getnameinfo"
--if test "x$ac_cv_func_getnameinfo" = x""yes; then :
-+if test "x$ac_cv_func_getnameinfo" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_GETNAMEINFO 1
- _ACEOF
-@@ -10934,7 +11044,7 @@ done
- # checks for structures
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may
both be included" >&5
- $as_echo_n "checking whether time.h and sys/time.h may both be included... "
>&6; }
--if test "${ac_cv_header_time+set}" = set; then :
-+if ${ac_cv_header_time+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -10969,7 +11079,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in
sys/time.h or time.h" >&5
- $as_echo_n "checking whether struct tm is in sys/time.h or time.h... "
>&6; }
--if test "${ac_cv_struct_tm+set}" = set; then :
-+if ${ac_cv_struct_tm+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -11006,7 +11116,7 @@ ac_fn_c_check_member "$LINENO" "struct t
- #include <$ac_cv_struct_tm>
-
- "
--if test "x$ac_cv_member_struct_tm_tm_zone" = x""yes; then :
-+if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then :
-
- cat >>confdefs.h <<_ACEOF
- #define HAVE_STRUCT_TM_TM_ZONE 1
-@@ -11022,7 +11132,7 @@ $as_echo "#define HAVE_TM_ZONE 1" >>conf
- else
- ac_fn_c_check_decl "$LINENO" "tzname"
"ac_cv_have_decl_tzname" "#include <time.h>
- "
--if test "x$ac_cv_have_decl_tzname" = x""yes; then :
-+if test "x$ac_cv_have_decl_tzname" = xyes; then :
- ac_have_decl=1
- else
- ac_have_decl=0
-@@ -11034,7 +11144,7 @@ _ACEOF
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5
- $as_echo_n "checking for tzname... " >&6; }
--if test "${ac_cv_var_tzname+set}" = set; then :
-+if ${ac_cv_var_tzname+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -11070,7 +11180,7 @@ $as_echo "#define HAVE_TZNAME 1" >>confd
- fi
-
- ac_fn_c_check_member "$LINENO" "struct stat" "st_rdev"
"ac_cv_member_struct_stat_st_rdev" "$ac_includes_default"
--if test "x$ac_cv_member_struct_stat_st_rdev" = x""yes; then :
-+if test "x$ac_cv_member_struct_stat_st_rdev" = xyes; then :
-
- cat >>confdefs.h <<_ACEOF
- #define HAVE_STRUCT_STAT_ST_RDEV 1
-@@ -11080,7 +11190,7 @@ _ACEOF
- fi
-
- ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize"
"ac_cv_member_struct_stat_st_blksize" "$ac_includes_default"
--if test "x$ac_cv_member_struct_stat_st_blksize" = x""yes; then :
-+if test "x$ac_cv_member_struct_stat_st_blksize" = xyes; then :
-
- cat >>confdefs.h <<_ACEOF
- #define HAVE_STRUCT_STAT_ST_BLKSIZE 1
-@@ -11090,7 +11200,7 @@ _ACEOF
- fi
-
- ac_fn_c_check_member "$LINENO" "struct stat" "st_flags"
"ac_cv_member_struct_stat_st_flags" "$ac_includes_default"
--if test "x$ac_cv_member_struct_stat_st_flags" = x""yes; then :
-+if test "x$ac_cv_member_struct_stat_st_flags" = xyes; then :
-
- cat >>confdefs.h <<_ACEOF
- #define HAVE_STRUCT_STAT_ST_FLAGS 1
-@@ -11100,7 +11210,7 @@ _ACEOF
- fi
-
- ac_fn_c_check_member "$LINENO" "struct stat" "st_gen"
"ac_cv_member_struct_stat_st_gen" "$ac_includes_default"
--if test "x$ac_cv_member_struct_stat_st_gen" = x""yes; then :
-+if test "x$ac_cv_member_struct_stat_st_gen" = xyes; then :
-
- cat >>confdefs.h <<_ACEOF
- #define HAVE_STRUCT_STAT_ST_GEN 1
-@@ -11110,7 +11220,7 @@ _ACEOF
- fi
-
- ac_fn_c_check_member "$LINENO" "struct stat"
"st_birthtime" "ac_cv_member_struct_stat_st_birthtime"
"$ac_includes_default"
--if test "x$ac_cv_member_struct_stat_st_birthtime" = x""yes; then :
-+if test "x$ac_cv_member_struct_stat_st_birthtime" = xyes; then :
-
- cat >>confdefs.h <<_ACEOF
- #define HAVE_STRUCT_STAT_ST_BIRTHTIME 1
-@@ -11120,7 +11230,7 @@ _ACEOF
- fi
-
- ac_fn_c_check_member "$LINENO" "struct stat" "st_blocks"
"ac_cv_member_struct_stat_st_blocks" "$ac_includes_default"
--if test "x$ac_cv_member_struct_stat_st_blocks" = x""yes; then :
-+if test "x$ac_cv_member_struct_stat_st_blocks" = xyes; then :
-
- cat >>confdefs.h <<_ACEOF
- #define HAVE_STRUCT_STAT_ST_BLOCKS 1
-@@ -11142,7 +11252,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for time.h that defines
altzone" >&5
- $as_echo_n "checking for time.h that defines altzone... " >&6; }
--if test "${ac_cv_header_time_altzone+set}" = set; then :
-+if ${ac_cv_header_time_altzone+:} false; then :
- $as_echo_n "(cached) " >&6
- else
-
-@@ -11206,7 +11316,7 @@ $as_echo "$was_it_defined" >&6; }
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for addrinfo" >&5
- $as_echo_n "checking for addrinfo... " >&6; }
--if test "${ac_cv_struct_addrinfo+set}" = set; then :
-+if ${ac_cv_struct_addrinfo+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -11238,7 +11348,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_storage"
>&5
- $as_echo_n "checking for sockaddr_storage... " >&6; }
--if test "${ac_cv_struct_sockaddr_storage+set}" = set; then :
-+if ${ac_cv_struct_sockaddr_storage+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -11274,7 +11384,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned"
>&5
- $as_echo_n "checking whether char is unsigned... " >&6; }
--if test "${ac_cv_c_char_unsigned+set}" = set; then :
-+if ${ac_cv_c_char_unsigned+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -11306,7 +11416,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming
const" >&5
- $as_echo_n "checking for an ANSI C-conforming const... " >&6; }
--if test "${ac_cv_c_const+set}" = set; then :
-+if ${ac_cv_c_const+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -11594,7 +11704,7 @@ $as_echo "$va_list_is_array" >&6; }
-
-
- ac_fn_c_check_func "$LINENO" "gethostbyname_r"
"ac_cv_func_gethostbyname_r"
--if test "x$ac_cv_func_gethostbyname_r" = x""yes; then :
-+if test "x$ac_cv_func_gethostbyname_r" = xyes; then :
-
- $as_echo "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h
-
-@@ -11725,7 +11835,7 @@ else
- for ac_func in gethostbyname
- do :
- ac_fn_c_check_func "$LINENO" "gethostbyname"
"ac_cv_func_gethostbyname"
--if test "x$ac_cv_func_gethostbyname" = x""yes; then :
-+if test "x$ac_cv_func_gethostbyname" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_GETHOSTBYNAME 1
- _ACEOF
-@@ -11747,12 +11857,12 @@ fi
-
- # Linux requires this for correct f.p. operations
- ac_fn_c_check_func "$LINENO" "__fpu_control"
"ac_cv_func___fpu_control"
--if test "x$ac_cv_func___fpu_control" = x""yes; then :
-+if test "x$ac_cv_func___fpu_control" = xyes; then :
-
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __fpu_control in
-lieee" >&5
- $as_echo_n "checking for __fpu_control in -lieee... " >&6; }
--if test "${ac_cv_lib_ieee___fpu_control+set}" = set; then :
-+if ${ac_cv_lib_ieee___fpu_control+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -11786,7 +11896,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_ieee___fpu_control" >&5
- $as_echo "$ac_cv_lib_ieee___fpu_control" >&6; }
--if test "x$ac_cv_lib_ieee___fpu_control" = x""yes; then :
-+if test "x$ac_cv_lib_ieee___fpu_control" = xyes; then :
- cat >>confdefs.h <<_ACEOF
- #define HAVE_LIBIEEE 1
- _ACEOF
-@@ -11881,7 +11991,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C doubles are
little-endian IEEE 754 binary64" >&5
- $as_echo_n "checking whether C doubles are little-endian IEEE 754 binary64...
" >&6; }
--if test "${ac_cv_little_endian_double+set}" = set; then :
-+if ${ac_cv_little_endian_double+:} false; then :
- $as_echo_n "(cached) " >&6
- else
-
-@@ -11923,7 +12033,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C doubles are big-endian
IEEE 754 binary64" >&5
- $as_echo_n "checking whether C doubles are big-endian IEEE 754 binary64... "
>&6; }
--if test "${ac_cv_big_endian_double+set}" = set; then :
-+if ${ac_cv_big_endian_double+:} false; then :
- $as_echo_n "(cached) " >&6
- else
-
-@@ -11969,7 +12079,7 @@ fi
- # conversions work.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C doubles are ARM
mixed-endian IEEE 754 binary64" >&5
- $as_echo_n "checking whether C doubles are ARM mixed-endian IEEE 754 binary64...
" >&6; }
--if test "${ac_cv_mixed_endian_double+set}" = set; then :
-+if ${ac_cv_mixed_endian_double+:} false; then :
- $as_echo_n "(cached) " >&6
- else
-
-@@ -12117,7 +12227,7 @@ LIBS="$LIBS $LIBM"
- # -0. on some architectures.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether tanh preserves the sign
of zero" >&5
- $as_echo_n "checking whether tanh preserves the sign of zero... " >&6;
}
--if test "${ac_cv_tanh_preserves_zero_sign+set}" = set; then :
-+if ${ac_cv_tanh_preserves_zero_sign+:} false; then :
- $as_echo_n "(cached) " >&6
- else
-
-@@ -12185,7 +12295,7 @@ done
-
- ac_fn_c_check_decl "$LINENO" "isinf"
"ac_cv_have_decl_isinf" "#include <math.h>
- "
--if test "x$ac_cv_have_decl_isinf" = x""yes; then :
-+if test "x$ac_cv_have_decl_isinf" = xyes; then :
- ac_have_decl=1
- else
- ac_have_decl=0
-@@ -12196,7 +12306,7 @@ cat >>confdefs.h <<_ACEOF
- _ACEOF
- ac_fn_c_check_decl "$LINENO" "isnan"
"ac_cv_have_decl_isnan" "#include <math.h>
- "
--if test "x$ac_cv_have_decl_isnan" = x""yes; then :
-+if test "x$ac_cv_have_decl_isnan" = xyes; then :
- ac_have_decl=1
- else
- ac_have_decl=0
-@@ -12207,7 +12317,7 @@ cat >>confdefs.h <<_ACEOF
- _ACEOF
- ac_fn_c_check_decl "$LINENO" "isfinite"
"ac_cv_have_decl_isfinite" "#include <math.h>
- "
--if test "x$ac_cv_have_decl_isfinite" = x""yes; then :
-+if test "x$ac_cv_have_decl_isfinite" = xyes; then :
- ac_have_decl=1
- else
- ac_have_decl=0
-@@ -12227,7 +12337,7 @@ LIBS=$LIBS_SAVE
- # sem_open results in a 'Signal 12' error.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX semaphores are
enabled" >&5
- $as_echo_n "checking whether POSIX semaphores are enabled... " >&6; }
--if test "${ac_cv_posix_semaphores_enabled+set}" = set; then :
-+if ${ac_cv_posix_semaphores_enabled+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test "$cross_compiling" = yes; then :
-@@ -12278,7 +12388,7 @@ fi
- # Multiprocessing check for broken sem_getvalue
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken sem_getvalue"
>&5
- $as_echo_n "checking for broken sem_getvalue... " >&6; }
--if test "${ac_cv_broken_sem_getvalue+set}" = set; then :
-+if ${ac_cv_broken_sem_getvalue+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test "$cross_compiling" = yes; then :
-@@ -12343,7 +12453,7 @@ no)
- 15|30)
- ;;
- *)
-- as_fn_error $? "bad value $enable_big_digits for --enable-big-digits; value
should be 15 or 30" "$LINENO" 5 ;;
-+ as_fn_error $? "bad value $enable_big_digits for --enable-big-digits; value
should be 15 or 30" "$LINENO" 5 ;;
- esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_big_digits"
>&5
- $as_echo "$enable_big_digits" >&6; }
-@@ -12361,7 +12471,7 @@ fi
-
- # check for wchar.h
- ac_fn_c_check_header_mongrel "$LINENO" "wchar.h"
"ac_cv_header_wchar_h" "$ac_includes_default"
--if test "x$ac_cv_header_wchar_h" = x""yes; then :
-+if test "x$ac_cv_header_wchar_h" = xyes; then :
-
-
- $as_echo "#define HAVE_WCHAR_H 1" >>confdefs.h
-@@ -12384,7 +12494,7 @@ then
- # This bug is HP SR number 8606223364.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of wchar_t" >&5
- $as_echo_n "checking size of wchar_t... " >&6; }
--if test "${ac_cv_sizeof_wchar_t+set}" = set; then :
-+if ${ac_cv_sizeof_wchar_t+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (wchar_t))"
"ac_cv_sizeof_wchar_t" "#include <wchar.h>
-@@ -12395,7 +12505,7 @@ else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
- $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- as_fn_error 77 "cannot compute sizeof (wchar_t)
--See \`config.log' for more details" "$LINENO" 5 ; }
-+See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_wchar_t=0
- fi
-@@ -12450,7 +12560,7 @@ then
- # check whether wchar_t is signed or not
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wchar_t is signed"
>&5
- $as_echo_n "checking whether wchar_t is signed... " >&6; }
-- if test "${ac_cv_wchar_t_signed+set}" = set; then :
-+ if ${ac_cv_wchar_t_signed+:} false; then :
- $as_echo_n "(cached) " >&6
- else
-
-@@ -12514,7 +12624,7 @@ ucs4) unicode_size="4"
- $as_echo "#define Py_UNICODE_SIZE 4" >>confdefs.h
-
- ;;
--*) as_fn_error $? "invalid value for --enable-unicode. Use either ucs2 or ucs4
(lowercase)." "$LINENO" 5 ;;
-+*) as_fn_error $? "invalid value for --enable-unicode. Use either ucs2 or ucs4
(lowercase)." "$LINENO" 5 ;;
- esac
-
-
-@@ -12561,7 +12671,7 @@ fi
- # check for endianness
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is
bigendian" >&5
- $as_echo_n "checking whether byte ordering is bigendian... " >&6; }
--if test "${ac_cv_c_bigendian+set}" = set; then :
-+if ${ac_cv_c_bigendian+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_cv_c_bigendian=unknown
-@@ -12780,7 +12890,7 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUI
- ;; #(
- *)
- as_fn_error $? "unknown endianness
-- presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
-+ presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
- esac
-
-
-@@ -12788,7 +12898,7 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUI
- # or fills with zeros (like the Cray J90, according to Tim Peters).
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether right shift extends the
sign bit" >&5
- $as_echo_n "checking whether right shift extends the sign bit... " >&6;
}
--if test "${ac_cv_rshift_extends_sign+set}" = set; then :
-+if ${ac_cv_rshift_extends_sign+:} false; then :
- $as_echo_n "(cached) " >&6
- else
-
-@@ -12827,7 +12937,7 @@ fi
- # check for getc_unlocked and related locking functions
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getc_unlocked() and
friends" >&5
- $as_echo_n "checking for getc_unlocked() and friends... " >&6; }
--if test "${ac_cv_have_getc_unlocked+set}" = set; then :
-+if ${ac_cv_have_getc_unlocked+:} false; then :
- $as_echo_n "(cached) " >&6
- else
-
-@@ -12925,7 +13035,7 @@ fi
- # check for readline 2.1
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_callback_handler_install
in -lreadline" >&5
- $as_echo_n "checking for rl_callback_handler_install in -lreadline... "
>&6; }
--if test "${ac_cv_lib_readline_rl_callback_handler_install+set}" = set; then :
-+if ${ac_cv_lib_readline_rl_callback_handler_install+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -12959,7 +13069,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_readline_rl_callback_handler_install" >&5
- $as_echo "$ac_cv_lib_readline_rl_callback_handler_install" >&6; }
--if test "x$ac_cv_lib_readline_rl_callback_handler_install" = x""yes;
then :
-+if test "x$ac_cv_lib_readline_rl_callback_handler_install" = xyes; then :
-
- $as_echo "#define HAVE_RL_CALLBACK 1" >>confdefs.h
-
-@@ -13011,7 +13121,7 @@ fi
- # check for readline 4.0
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_pre_input_hook in
-lreadline" >&5
- $as_echo_n "checking for rl_pre_input_hook in -lreadline... " >&6; }
--if test "${ac_cv_lib_readline_rl_pre_input_hook+set}" = set; then :
-+if ${ac_cv_lib_readline_rl_pre_input_hook+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -13045,7 +13155,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_readline_rl_pre_input_hook" >&5
- $as_echo "$ac_cv_lib_readline_rl_pre_input_hook" >&6; }
--if test "x$ac_cv_lib_readline_rl_pre_input_hook" = x""yes; then :
-+if test "x$ac_cv_lib_readline_rl_pre_input_hook" = xyes; then :
-
- $as_echo "#define HAVE_RL_PRE_INPUT_HOOK 1" >>confdefs.h
-
-@@ -13055,7 +13165,7 @@ fi
- # also in 4.0
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for
rl_completion_display_matches_hook in -lreadline" >&5
- $as_echo_n "checking for rl_completion_display_matches_hook in -lreadline... "
>&6; }
--if test "${ac_cv_lib_readline_rl_completion_display_matches_hook+set}" = set;
then :
-+if ${ac_cv_lib_readline_rl_completion_display_matches_hook+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -13089,7 +13199,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_readline_rl_completion_display_matches_hook" >&5
- $as_echo "$ac_cv_lib_readline_rl_completion_display_matches_hook" >&6;
}
--if test "x$ac_cv_lib_readline_rl_completion_display_matches_hook" =
x""yes; then :
-+if test "x$ac_cv_lib_readline_rl_completion_display_matches_hook" = xyes; then
:
-
- $as_echo "#define HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK 1"
>>confdefs.h
-
-@@ -13099,7 +13209,7 @@ fi
- # check for readline 4.2
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_matches in
-lreadline" >&5
- $as_echo_n "checking for rl_completion_matches in -lreadline... " >&6;
}
--if test "${ac_cv_lib_readline_rl_completion_matches+set}" = set; then :
-+if ${ac_cv_lib_readline_rl_completion_matches+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
-@@ -13133,7 +13243,7 @@ LIBS=$ac_check_lib_save_LIBS
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_readline_rl_completion_matches" >&5
- $as_echo "$ac_cv_lib_readline_rl_completion_matches" >&6; }
--if test "x$ac_cv_lib_readline_rl_completion_matches" = x""yes; then
:
-+if test "x$ac_cv_lib_readline_rl_completion_matches" = xyes; then :
-
- $as_echo "#define HAVE_RL_COMPLETION_MATCHES 1" >>confdefs.h
-
-@@ -13174,7 +13284,7 @@ LIBS=$LIBS_no_readline
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken nice()"
>&5
- $as_echo_n "checking for broken nice()... " >&6; }
--if test "${ac_cv_broken_nice+set}" = set; then :
-+if ${ac_cv_broken_nice+:} false; then :
- $as_echo_n "(cached) " >&6
- else
-
-@@ -13215,7 +13325,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken poll()"
>&5
- $as_echo_n "checking for broken poll()... " >&6; }
--if test "${ac_cv_broken_poll+set}" = set; then :
-+if ${ac_cv_broken_poll+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test "$cross_compiling" = yes; then :
-@@ -13270,7 +13380,7 @@ ac_fn_c_check_member "$LINENO" "struct t
- #include <$ac_cv_struct_tm>
-
- "
--if test "x$ac_cv_member_struct_tm_tm_zone" = x""yes; then :
-+if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then :
-
- cat >>confdefs.h <<_ACEOF
- #define HAVE_STRUCT_TM_TM_ZONE 1
-@@ -13286,7 +13396,7 @@ $as_echo "#define HAVE_TM_ZONE 1" >>conf
- else
- ac_fn_c_check_decl "$LINENO" "tzname"
"ac_cv_have_decl_tzname" "#include <time.h>
- "
--if test "x$ac_cv_have_decl_tzname" = x""yes; then :
-+if test "x$ac_cv_have_decl_tzname" = xyes; then :
- ac_have_decl=1
- else
- ac_have_decl=0
-@@ -13298,7 +13408,7 @@ _ACEOF
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5
- $as_echo_n "checking for tzname... " >&6; }
--if test "${ac_cv_var_tzname+set}" = set; then :
-+if ${ac_cv_var_tzname+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -13337,7 +13447,7 @@ fi
- # check tzset(3) exists and works like we expect it to
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working tzset()"
>&5
- $as_echo_n "checking for working tzset()... " >&6; }
--if test "${ac_cv_working_tzset+set}" = set; then :
-+if ${ac_cv_working_tzset+:} false; then :
- $as_echo_n "(cached) " >&6
- else
-
-@@ -13434,7 +13544,7 @@ fi
- # Look for subsecond timestamps in struct stat
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tv_nsec in struct stat"
>&5
- $as_echo_n "checking for tv_nsec in struct stat... " >&6; }
--if test "${ac_cv_stat_tv_nsec+set}" = set; then :
-+if ${ac_cv_stat_tv_nsec+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -13471,7 +13581,7 @@ fi
- # Look for BSD style subsecond timestamps in struct stat
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tv_nsec2 in struct stat"
>&5
- $as_echo_n "checking for tv_nsec2 in struct stat... " >&6; }
--if test "${ac_cv_stat_tv_nsec2+set}" = set; then :
-+if ${ac_cv_stat_tv_nsec2+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -13508,7 +13618,7 @@ fi
- # On HP/UX 11.0, mvwdelch is a block with a return statement
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mvwdelch is an
expression" >&5
- $as_echo_n "checking whether mvwdelch is an expression... " >&6; }
--if test "${ac_cv_mvwdelch_is_expression+set}" = set; then :
-+if ${ac_cv_mvwdelch_is_expression+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -13545,7 +13655,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether WINDOW has _flags"
>&5
- $as_echo_n "checking whether WINDOW has _flags... " >&6; }
--if test "${ac_cv_window_has_flags+set}" = set; then :
-+if ${ac_cv_window_has_flags+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-@@ -13693,7 +13803,7 @@ if test "$have_long_long" = yes
- then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for %lld and %llu printf()
format support" >&5
- $as_echo_n "checking for %lld and %llu printf() format support... "
>&6; }
-- if test "${ac_cv_have_long_long_format+set}" = set; then :
-+ if ${ac_cv_have_long_long_format+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test "$cross_compiling" = yes; then :
-@@ -13764,7 +13874,7 @@ fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for %zd printf() format
support" >&5
- $as_echo_n "checking for %zd printf() format support... " >&6; }
--if test "${ac_cv_have_size_t_format+set}" = set; then :
-+if ${ac_cv_have_size_t_format+:} false; then :
- $as_echo_n "(cached) " >&6
- else
- if test "$cross_compiling" = yes; then :
-@@ -13837,7 +13947,7 @@ ac_fn_c_check_type "$LINENO" "socklen_t"
- #endif
-
- "
--if test "x$ac_cv_type_socklen_t" = x""yes; then :
-+if test "x$ac_cv_type_socklen_t" = xyes; then :
-
- else
-
-@@ -13942,10 +14052,21 @@ $as_echo "$as_me: WARNING: cache variabl
- :end' >>confcache
- if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
- if test -w "$cache_file"; then
-- test "x$cache_file" != "x/dev/null" &&
-+ if test "x$cache_file" != "x/dev/null"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file"
>&5
- $as_echo "$as_me: updating cache $cache_file" >&6;}
-- cat confcache >$cache_file
-+ if test ! -f "$cache_file" || test -h "$cache_file"; then
-+ cat confcache >"$cache_file"
-+ else
-+ case $cache_file in #(
-+ */* | ?:*)
-+ mv -f confcache "$cache_file"$$ &&
-+ mv -f "$cache_file"$$ "$cache_file" ;; #(
-+ *)
-+ mv -f confcache "$cache_file" ;;
-+ esac
-+ fi
-+ fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache
$cache_file" >&5
- $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
-@@ -13978,7 +14099,7 @@ LTLIBOBJS=$ac_ltlibobjs
-
-
-
--: ${CONFIG_STATUS=./config.status}
-+: "${CONFIG_STATUS=./config.status}"
- ac_write_fail=0
- ac_clean_files_save=$ac_clean_files
- ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-@@ -14079,6 +14200,7 @@ fi
- IFS=" "" $as_nl"
-
- # Find who we are. Look in the path if we contain no directory separator.
-+as_myself=
- case $0 in #((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-@@ -14386,7 +14508,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri
- # values after options handling.
- ac_log="
- This file was extended by python $as_me 2.7, which was
--generated by GNU Autoconf 2.67. Invocation command line was
-+generated by GNU Autoconf 2.68. Invocation command line was
-
- CONFIG_FILES = $CONFIG_FILES
- CONFIG_HEADERS = $CONFIG_HEADERS
-@@ -14448,7 +14570,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_writ
- ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //;
s/[\\""\`\$]/\\\\&/g'`"
- ac_cs_version="\\
- python config.status 2.7
--configured by $0, generated by GNU Autoconf 2.67,
-+configured by $0, generated by GNU Autoconf 2.68,
- with options \\"\$ac_cs_config\\"
-
- Copyright (C) 2010 Free Software Foundation, Inc.
-@@ -14580,7 +14702,7 @@ do
- "Misc/python.pc") CONFIG_FILES="$CONFIG_FILES Misc/python.pc"
;;
- "Modules/ld_so_aix") CONFIG_FILES="$CONFIG_FILES
Modules/ld_so_aix" ;;
-
-- *) as_fn_error $? "invalid argument: \`$ac_config_target'"
"$LINENO" 5 ;;
-+ *) as_fn_error $? "invalid argument: \`$ac_config_target'"
"$LINENO" 5;;
- esac
- done
-
-@@ -14602,9 +14724,10 @@ fi
- # after its creation but before its name has been assigned to `$tmp'.
- $debug ||
- {
-- tmp=
-+ tmp= ac_tmp=
- trap 'exit_status=$?
-- { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; }
&& exit $exit_status
-+ : "${ac_tmp:=$tmp}"
-+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit
$exit_status
- ' 0
- trap 'as_fn_exit 1' 1 2 13 15
- }
-@@ -14612,12 +14735,13 @@ $debug ||
-
- {
- tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null`
&&
-- test -n "$tmp" && test -d "$tmp"
-+ test -d "$tmp"
- } ||
- {
- tmp=./conf$$-$RANDOM
- (umask 077 && mkdir "$tmp")
- } || as_fn_error $? "cannot create a temporary directory in ."
"$LINENO" 5
-+ac_tmp=$tmp
-
- # Set up the scripts for CONFIG_FILES section.
- # No need to generate them if there are no CONFIG_FILES.
-@@ -14639,7 +14763,7 @@ else
- ac_cs_awk_cr=$ac_cr
- fi
-
--echo 'BEGIN {' >"$tmp/subs1.awk" &&
-+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
- _ACEOF
-
-
-@@ -14667,7 +14791,7 @@ done
- rm -f conf$$subs.sh
-
- cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
--cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
-+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
- _ACEOF
- sed -n '
- h
-@@ -14715,7 +14839,7 @@ t delim
- rm -f conf$$subs.awk
- cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- _ACAWK
--cat >>"\$tmp/subs1.awk" <<_ACAWK &&
-+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
- for (key in S) S_is_set[key] = 1
- FS = ""
-
-@@ -14747,7 +14871,7 @@ if sed "s/$ac_cr//" < /dev/null > /dev/n
- sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
- else
- cat
--fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
-+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
- || as_fn_error $? "could not setup config files machinery"
"$LINENO" 5
- _ACEOF
-
-@@ -14781,7 +14905,7 @@ fi # test -n "$CONFIG_FILES"
- # No need to generate them if there are no CONFIG_HEADERS.
- # This happens for instance with `./config.status Makefile'.
- if test -n "$CONFIG_HEADERS"; then
--cat >"$tmp/defines.awk" <<\_ACAWK ||
-+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
- BEGIN {
- _ACEOF
-
-@@ -14793,8 +14917,8 @@ _ACEOF
- # handling of long lines.
- ac_delim='%!_!# '
- for ac_last_try in false false :; do
-- ac_t=`sed -n "/$ac_delim/p" confdefs.h`
-- if test -z "$ac_t"; then
-+ ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
-+ if test -z "$ac_tt"; then
- break
- elif $ac_last_try; then
- as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
-@@ -14895,7 +15019,7 @@ do
- esac
- case $ac_mode$ac_tag in
- :[FHL]*:*);;
-- :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO"
5 ;;
-+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO"
5;;
- :[FH]-) ac_tag=-:-;;
- :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
- esac
-@@ -14914,7 +15038,7 @@ do
- for ac_f
- do
- case $ac_f in
-- -) ac_f="$tmp/stdin";;
-+ -) ac_f="$ac_tmp/stdin";;
- *) # Look for the file first in the build tree, then in the source tree
- # (if the path is not absolute). The absolute path cannot be DOS-style,
- # because $ac_f cannot contain `:'.
-@@ -14923,7 +15047,7 @@ do
- [\\/$]*) false;;
- *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
- esac ||
-- as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5
;;
-+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO"
5;;
- esac
- case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed
"s/'/'\\\\\\\\''/g"`;; esac
- as_fn_append ac_file_inputs " '$ac_f'"
-@@ -14949,8 +15073,8 @@ $as_echo "$as_me: creating $ac_file" >&6
- esac
-
- case $ac_tag in
-- *:-:* | *:-) cat >"$tmp/stdin" \
-- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
-+ *:-:* | *:-) cat >"$ac_tmp/stdin" \
-+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
- esac
- ;;
- esac
-@@ -15080,21 +15204,22 @@ s&@abs_top_builddir@&$ac_abs_top_builddi
- s&@INSTALL@&$ac_INSTALL&;t t
- $ac_datarootdir_hack
- "
--eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f
"$tmp/subs.awk" >$tmp/out \
-- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f
"$ac_tmp/subs.awk" \
-+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file"
"$LINENO" 5
-
- test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
-- { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n
"$ac_out"; } &&
-- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z
"$ac_out"; } &&
-+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n
"$ac_out"; } &&
-+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
-+ "$ac_tmp/out"`; test -z "$ac_out"; } &&
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference
to the variable \`datarootdir'
- which seems to be undefined. Please make sure it is defined" >&5
- $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable
\`datarootdir'
- which seems to be undefined. Please make sure it is defined" >&2;}
-
-- rm -f "$tmp/stdin"
-+ rm -f "$ac_tmp/stdin"
- case $ac_file in
-- -) cat "$tmp/out" && rm -f "$tmp/out";;
-- *) rm -f "$ac_file" && mv "$tmp/out"
"$ac_file";;
-+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
-+ *) rm -f "$ac_file" && mv "$ac_tmp/out"
"$ac_file";;
- esac \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- ;;
-@@ -15105,20 +15230,20 @@ which seems to be undefined. Please mak
- if test x"$ac_file" != x-; then
- {
- $as_echo "/* $configure_input */" \
-- && eval '$AWK -f "$tmp/defines.awk"'
"$ac_file_inputs"
-- } >"$tmp/config.h" \
-+ && eval '$AWK -f "$ac_tmp/defines.awk"'
"$ac_file_inputs"
-+ } >"$ac_tmp/config.h" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-- if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1;
then
-+ if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1;
then
- { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged"
>&5
- $as_echo "$as_me: $ac_file is unchanged" >&6;}
- else
- rm -f "$ac_file"
-- mv "$tmp/config.h" "$ac_file" \
-+ mv "$ac_tmp/config.h" "$ac_file" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- fi
- else
- $as_echo "/* $configure_input */" \
-- && eval '$AWK -f "$tmp/defines.awk"'
"$ac_file_inputs" \
-+ && eval '$AWK -f "$ac_tmp/defines.awk"'
"$ac_file_inputs" \
- || as_fn_error $? "could not create -" "$LINENO" 5
- fi
- ;;
-diff -up ./pyconfig.h.in.autotool-intermediates ./pyconfig.h.in
---- ./pyconfig.h.in.autotool-intermediates 2012-04-11 18:35:27.002518749 -0400
-+++ ./pyconfig.h.in 2012-04-11 18:35:28.133504610 -0400
-@@ -18,6 +18,12 @@
- /* Define this if you have BeOS threads. */
- #undef BEOS_THREADS
-
-+/* Define to keep records on function call invocation */
-+#undef CALL_PROFILE
-+
-+/* Define to keep records of the number of instances of each type */
-+#undef COUNT_ALLOCS
-+
- /* Define if you have the Mach cthreads package */
- #undef C_THREADS
-
-@@ -1107,12 +1113,6 @@
- /* Define to profile with the Pentium timestamp counter */
- #undef WITH_TSC
-
--/* Define to keep records of the number of instances of each type */
--#undef COUNT_ALLOCS
--
--/* Define to keep records on function call invocation */
--#undef CALL_PROFILE
--
- /* Define if you want pymalloc to be disabled when running under valgrind */
- #undef WITH_VALGRIND
-
diff --git a/python.spec b/python.spec
index cd4781a..e5c1f3f 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.3
-Release: 6%{?dist}
+Release: 7%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -685,7 +685,7 @@ Patch156: 00156-gdb-autoload-safepath.patch
# This is the generated patch to "configure"; see the description of
# %{regenerate_autotooling_patch}
# above:
-Patch300: autotool-intermediates.patch
+Patch5000: 05000-autotool-intermediates.patch
# ======================================================
# Additional metadata, and subpackages
@@ -991,7 +991,7 @@ find -name "*~" |xargs rm -f
%if ! 0%{regenerate_autotooling_patch}
# Normally we apply the patch to "configure"
# We don't apply the patch if we're working towards regenerating it
-%patch300 -p0 -b .autotool-intermediates
+%patch5000 -p0 -b .autotool-intermediates
%endif
@@ -1031,7 +1031,7 @@ PATH=~/autoconf-2.65/bin:$PATH autoconf
autoheader
# Regenerate the patch:
-gendiff . .autotool-intermediates > %{PATCH300}
+gendiff . .autotool-intermediates > %{PATCH5000}
# Exit the build
@@ -1813,6 +1813,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Fri May 4 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-7
+- renumber autotools patch from 300 to 5000
+- specfile cleanups
+
* Mon Apr 30 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-6
- try again to fix test_gdb.py (patch 156; rhbz#817072)
commit 6ad7fbc57f3f7d0a0b06337cbc4eaacfa99eb555
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Fri May 4 15:24:43 2012 -0400
add markers to make it easier to diff python.spec and python3.spec
diff --git a/python.spec b/python.spec
index a18ad2f..cd4781a 100644
--- a/python.spec
+++ b/python.spec
@@ -46,7 +46,7 @@
%global with_systemtap 1
-# some arches dont have valgrind so we need to disable its support on them
+# some arches don't have valgrind so we need to disable its support on them
%ifarch %{ix86} x86_64 ppc ppc64 s390x
%global with_valgrind 1
%else
@@ -333,6 +333,7 @@ Patch17: python-2.6.4-distutils-rpath.patch
# Patch setup.py so that it links against db-4.8:
Patch54: python-2.6.4-setup-db48.patch
+# 00055 #
# Systemtap support: add statically-defined probe points
# Patch based on upstream bug:
http://bugs.python.org/issue4111
# fixed up by mjw and wcohen for 2.6.2, then fixed up by dmalcolm for 2.6.4
@@ -367,14 +368,17 @@ Patch102: python-2.7.3-lib64.patch
# and platform-specific code go to /usr/lib64 not /usr/lib, on 64-bit archs:
Patch103: python-2.7-lib64-sysconfig.patch
+# 00104 #
# Only used when "%{_lib}" == "lib64"
# Another lib64 fix, for distutils/tests/test_install.py; not upstream:
Patch104: 00104-lib64-fix-for-test_install.patch
+# 00111 #
# Patch the Makefile.pre.in so that the generated Makefile doesn't try to build
# a libpythonMAJOR.MINOR.a (bug 550692):
Patch111: 00111-no-static-lib.patch
+# 00112 #
# Patch to support building both optimized vs debug stacks DSO ABIs, sharing
# the same .py and .pyc files, using "_d.so" to signify a debug build of an
# extension module.
@@ -439,12 +443,14 @@ Patch111: 00111-no-static-lib.patch
Patch112: python-2.7.3-debug-build.patch
+# 00113 #
# Add configure-time support for the COUNT_ALLOCS and CALL_PROFILE options
# described at
http://svn.python.org/projects/python/trunk/Misc/SpecialBuilds.txt
# so that if they are enabled, they will be in that build's pyconfig.h, so that
# extension modules will reliably use them
Patch113: 00113-more-configuration-flags.patch
+# 00114 #
# Add flags for statvfs.f_flag to the constant list in posixmodule (i.e. "os")
# (rhbz:553020); partially upstream as
http://bugs.python.org/issue7647
Patch114: 00114-statvfs-f_flag-constants.patch
@@ -468,6 +474,7 @@ Patch114: 00114-statvfs-f_flag-constants.patch
# For now, revert this patch:
Patch121: python-2.7rc2-r79310.patch
+# 00125 #
# COUNT_ALLOCS is useful for debugging, but the upstream behaviour of always
# emitting debug info to stdout on exit is too verbose and makes it harder to
# use the debug build. Add a "PYTHONDUMPCOUNTS" environment variable which
@@ -489,6 +496,7 @@ Patch127: fix-test_structmember-on-64bit-bigendian.patch
# Not yet sent upstream
Patch128: python-2.7.1-fix_test_abc_with_COUNT_ALLOCS.patch
+# 00130 #
# Add "--extension-suffix" option to python-config and python-debug-config
# (rhbz#732808)
#
@@ -505,12 +513,14 @@ Patch128: python-2.7.1-fix_test_abc_with_COUNT_ALLOCS.patch
# Not yet sent upstream
Patch130: python-2.7.2-add-extension-suffix-to-python-config.patch
+# 00131 #
# The four tests in test_io built on top of check_interrupted_write_retry
# fail when built in Koji, for ppc and ppc64; for some reason, the SIGALRM
# handlers are never called, and the call to write runs to completion
# (rhbz#732998)
Patch131: 00131-disable-tests-in-test_io.patch
+# 00132 #
# Add non-standard hooks to unittest for use in the "check" phase below, when
# running selftests within the build:
# @unittest._skipInRpmBuild(reason)
@@ -524,53 +534,67 @@ Patch131: 00131-disable-tests-in-test_io.patch
# these unittest hooks in their own "check" phases)
Patch132: 00132-add-rpmbuild-hooks-to-unittest.patch
+# 00133 #
# "dl" is deprecated, and test_dl doesn't work on 64-bit builds:
Patch133: 00133-skip-test_dl.patch
+# 00134 #
# Fix a failure in test_sys.py when configured with COUNT_ALLOCS enabled
# Not yet sent upstream
Patch134: 00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch
+# 00135 #
# Skip "test_callback_in_cycle_resurrection" in a debug build, where it fails:
# Not yet sent upstream
Patch135: 00135-skip-test-within-test_weakref-in-debug-build.patch
+# 00136 #
# Some tests try to seek on sys.stdin, but don't work as expected when run
# within Koji/mock; skip them within the rpm build:
Patch136: 00136-skip-tests-of-seeking-stdin-in-rpmbuild.patch
+# 00137 #
# Some tests within distutils fail when run in an rpmbuild:
Patch137: 00137-skip-distutils-tests-that-fail-in-rpmbuild.patch
+# 00138 #
# Fixup some tests within distutils to work with how debug builds are set up:
Patch138: 00138-fix-distutils-tests-in-debug-build.patch
+# 00139 #
# ARM-specific: skip known failure in test_float:
#
http://bugs.python.org/issue8265 (rhbz#706253)
Patch139: 00139-skip-test_float-known-failure-on-arm.patch
+# 00140 #
# Sparc-specific: skip known failure in test_ctypes:
#
http://bugs.python.org/issue8314 (rhbz#711584)
# which appears to be a libffi bug
Patch140: 00140-skip-test_ctypes-known-failure-on-sparc.patch
+# 00141 #
# Fix test_gc's test_newinstance case when configured with COUNT_ALLOCS:
Patch141: 00141-fix-test_gc_with_COUNT_ALLOCS.patch
+# 00142 #
# Some pty tests fail when run in mock (rhbz#714627):
Patch142: 00142-skip-failing-pty-tests-in-rpmbuild.patch
+# 00143 #
# Fix the --with-tsc option on ppc64, and rework it on 32-bit ppc to avoid
# aliasing violations (rhbz#698726)
# Sent upstream as
http://bugs.python.org/issue12872
Patch143: 00143-tsc-on-ppc.patch
+# 00144 #
# (Optionally) disable the gdbm module:
Patch144: 00144-no-gdbm.patch
+# 00145 #
# Upstream as of Python 2.7.3:
# Patch145: 00145-force-sys-platform-to-be-linux2.patch
+# 00146 #
# Support OpenSSL FIPS mode (e.g. when OPENSSL_FORCE_FIPS_MODE=1 is set)
# - handle failures from OpenSSL (e.g. on attempts to use MD5 in a
# FIPS-enforcing environment)
@@ -588,41 +612,51 @@ Patch144: 00144-no-gdbm.patch
# (rhbz#563986)
Patch146: 00146-hashlib-fips.patch
+# 00147 #
# Add a sys._debugmallocstats() function
# Based on patch 202 from RHEL 5's python.spec, with updates from rhbz#737198
# Not yet sent upstream
Patch147: 00147-add-debug-malloc-stats.patch
+# 00148 #
# Upstream as of Python 2.7.3:
# Patch148: 00148-gdbm-1.9-magic-values.patch
+# 00149 #
# python3.spec's
# Patch149: 00149-backport-issue11254-pycache-bytecompilation-fix.patch
# is not relevant for Python 2
+# 00150 #
# python3.spec has:
# Patch150: 00150-disable-rAssertAlmostEqual-cmath-on-ppc.patch
# as a workaround for a glibc bug on PPC (bz #750811)
+# 00151 #
# Upstream as of Python 2.7.3:
# Patch151: 00151-fork-deadlock.patch
+# 00152 #
# python3.spec has:
# Patch152: 00152-fix-test-gdb-regex.patch
+# 00153 #
# Strip out lines of the form "warning: Unable to open ..." from gdb's
stderr
# when running test_gdb.py; also cope with change to gdb in F17 onwards in
# which values are printed as "v@entry" rather than just "v":
Patch153: 00153-fix-test_gdb-noise.patch
+# 00154 #
# python3.spec on f15 has:
# Patch154: 00154-skip-urllib-test-requiring-working-DNS.patch
+# 00155 #
# Avoid allocating thunks in ctypes unless absolutely necessary, to avoid
# generating SELinux denials on "import ctypes" and "import uuid"
when
# embedding Python within httpd (rhbz#814391)
Patch155: 00155-avoid-ctypes-thunks.patch
+# 00156 #
# Recent builds of gdb will only auto-load scripts from certain safe
# locations. Turn off this protection when running test_gdb in the selftest
# suite to ensure that it can load our -gdb.py script (rhbz#817072):
commit 1fa9c84f237d8822d26b9b229a4d68eed5b667c3
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Mon Apr 30 16:20:26 2012 -0400
2.7.3-6: try again to fix test_gdb.py (patch 156; rhbz#817072)
* Mon Apr 30 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-6
- try again to fix test_gdb.py (patch 156; rhbz#817072)
diff --git a/00156-gdb-autoload-safepath.patch b/00156-gdb-autoload-safepath.patch
index 258c89d..54a5a6e 100644
--- a/00156-gdb-autoload-safepath.patch
+++ b/00156-gdb-autoload-safepath.patch
@@ -1,16 +1,52 @@
diff -up Python-2.7.3/Lib/test/test_gdb.py.gdb-autoload-safepath
Python-2.7.3/Lib/test/test_gdb.py
---- Python-2.7.3/Lib/test/test_gdb.py.gdb-autoload-safepath 2012-04-30 12:55:43.372351709
-0400
-+++ Python-2.7.3/Lib/test/test_gdb.py 2012-04-30 12:58:24.355339144 -0400
-@@ -111,6 +111,12 @@ class DebuggerTests(unittest.TestCase):
- # Disable this:
- 'set print entry-values no',
+--- Python-2.7.3/Lib/test/test_gdb.py.gdb-autoload-safepath 2012-04-30 15:53:57.254045220
-0400
++++ Python-2.7.3/Lib/test/test_gdb.py 2012-04-30 16:19:19.569941124 -0400
+@@ -54,6 +54,19 @@ def gdb_has_frame_select():
+
+ HAS_PYUP_PYDOWN = gdb_has_frame_select()
-+ # Recent GDBs will only auto-load scripts from certain safe
-+ # locations.
-+ # Turn off this protection during the build to ensure that
-+ # our -gdb.py script can be loaded (rhbz#817072):
-+ 'set auto-load safe-path /',
++def gdb_has_autoload_safepath():
++ # Recent GDBs will only auto-load scripts from certain safe
++ # locations, so we will need to turn off this protection.
++ # However, if the GDB doesn't have it, then the following
++ # command will generate noise on stderr (rhbz#817072):
++ cmd = "--eval-command=set auto-load safe-path /"
++ p = subprocess.Popen(["gdb", "--batch", cmd],
++ stderr=subprocess.PIPE)
++ _, stderr = p.communicate()
++ return '"on" or "off" expected.' not in stderr
++
++HAS_AUTOLOAD_SAFEPATH = gdb_has_autoload_safepath()
+
+ class DebuggerTests(unittest.TestCase):
+
+ """Test that the debugger can debug Python."""
+@@ -112,15 +125,28 @@ class DebuggerTests(unittest.TestCase):
+ 'set print entry-values no',
+
'run']
++
++ if HAS_AUTOLOAD_SAFEPATH:
++ # Recent GDBs will only auto-load scripts from certain safe
++ # locations.
++ # Where necessary, turn off this protection to ensure that
++ # our -gdb.py script can be loaded - but not on earlier gdb builds
++ # as this would generate noise on stderr (rhbz#817072):
++ init_commands = ['set auto-load safe-path /']
++ else:
++ init_commands = []
++
if cmds_after_breakpoint:
commands += cmds_after_breakpoint
+ else:
+ commands += ['backtrace']
+
++ # print init_commands
+ # print commands
+
+ # Use "commands" to generate the arguments with which to invoke
"gdb":
+ args = ["gdb", "--batch"]
++ args += ['--init-eval-command=%s' % cmd for cmd in init_commands]
+ args += ['--eval-command=%s' % cmd for cmd in commands]
+ args += ["--args",
+ sys.executable]
diff --git a/python.spec b/python.spec
index b5ae554..a18ad2f 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.3
-Release: 5%{?dist}
+Release: 6%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -624,8 +624,8 @@ Patch153: 00153-fix-test_gdb-noise.patch
Patch155: 00155-avoid-ctypes-thunks.patch
# Recent builds of gdb will only auto-load scripts from certain safe
-# locations. Turn off this protection during the build to ensure that our
-# -gdb.py script can be loaded when running test_gdb (rhbz#817072):
+# locations. Turn off this protection when running test_gdb in the selftest
+# suite to ensure that it can load our -gdb.py script (rhbz#817072):
Patch156: 00156-gdb-autoload-safepath.patch
# (New patches go here ^^^)
@@ -1779,6 +1779,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Mon Apr 30 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-6
+- try again to fix test_gdb.py (patch 156; rhbz#817072)
+
* Mon Apr 30 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-5
- fix test_gdb.py (patch 156; rhbz#817072)
commit 9261681cd04196e1c4370b4888c9dfeff2b19f66
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Mon Apr 30 13:04:36 2012 -0400
2.7.3-5: fix test_gdb.py (patch 156; rhbz#817072)
* Mon Apr 30 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-5
- fix test_gdb.py (patch 156; rhbz#817072)
diff --git a/00156-gdb-autoload-safepath.patch b/00156-gdb-autoload-safepath.patch
new file mode 100644
index 0000000..258c89d
--- /dev/null
+++ b/00156-gdb-autoload-safepath.patch
@@ -0,0 +1,16 @@
+diff -up Python-2.7.3/Lib/test/test_gdb.py.gdb-autoload-safepath
Python-2.7.3/Lib/test/test_gdb.py
+--- Python-2.7.3/Lib/test/test_gdb.py.gdb-autoload-safepath 2012-04-30 12:55:43.372351709
-0400
++++ Python-2.7.3/Lib/test/test_gdb.py 2012-04-30 12:58:24.355339144 -0400
+@@ -111,6 +111,12 @@ class DebuggerTests(unittest.TestCase):
+ # Disable this:
+ 'set print entry-values no',
+
++ # Recent GDBs will only auto-load scripts from certain safe
++ # locations.
++ # Turn off this protection during the build to ensure that
++ # our -gdb.py script can be loaded (rhbz#817072):
++ 'set auto-load safe-path /',
++
+ 'run']
+ if cmds_after_breakpoint:
+ commands += cmds_after_breakpoint
diff --git a/python.spec b/python.spec
index a565c9b..b5ae554 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.3
-Release: 4%{?dist}
+Release: 5%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -623,6 +623,11 @@ Patch153: 00153-fix-test_gdb-noise.patch
# embedding Python within httpd (rhbz#814391)
Patch155: 00155-avoid-ctypes-thunks.patch
+# Recent builds of gdb will only auto-load scripts from certain safe
+# locations. Turn off this protection during the build to ensure that our
+# -gdb.py script can be loaded when running test_gdb (rhbz#817072):
+Patch156: 00156-gdb-autoload-safepath.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -943,6 +948,7 @@ done
%patch153 -p0
# 00154: not for python 2
%patch155 -p1
+%patch156 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -1773,6 +1779,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Mon Apr 30 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-5
+- fix test_gdb.py (patch 156; rhbz#817072)
+
* Fri Apr 20 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-4
- avoid allocating thunks in ctypes unless absolutely necessary, to avoid
generating SELinux denials on "import ctypes" and "import uuid" when
embedding
commit 7461fe5163d36a83893db6a696f5cc6a74cb6b51
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Fri Apr 20 15:02:19 2012 -0400
2.7.3-4: avoid allocating thunks in ctypes unless absolutely necessary (patch 155;
rhbz#814391)
* Fri Apr 20 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-4
- avoid allocating thunks in ctypes unless absolutely necessary, to avoid
generating SELinux denials on "import ctypes" and "import uuid"
when embedding
Python within httpd (patch 155; rhbz#814391)
diff --git a/00155-avoid-ctypes-thunks.patch b/00155-avoid-ctypes-thunks.patch
new file mode 100644
index 0000000..92dd668
--- /dev/null
+++ b/00155-avoid-ctypes-thunks.patch
@@ -0,0 +1,15 @@
+diff -up Python-2.7.3/Lib/ctypes/__init__.py.rhbz814391
Python-2.7.3/Lib/ctypes/__init__.py
+--- Python-2.7.3/Lib/ctypes/__init__.py.rhbz814391 2012-04-20 14:51:19.390990244 -0400
++++ Python-2.7.3/Lib/ctypes/__init__.py 2012-04-20 14:51:45.141668316 -0400
+@@ -272,11 +272,6 @@ def _reset_cache():
+ # _SimpleCData.c_char_p_from_param
+ POINTER(c_char).from_param = c_char_p.from_param
+ _pointer_type_cache[None] = c_void_p
+- # XXX for whatever reasons, creating the first instance of a callback
+- # function is needed for the unittests on Win64 to succeed. This MAY
+- # be a compiler bug, since the problem occurs only when _ctypes is
+- # compiled with the MS SDK compiler. Or an uninitialized variable?
+- CFUNCTYPE(c_int)(lambda: None)
+
+ try:
+ from _ctypes import set_conversion_mode
diff --git a/python.spec b/python.spec
index 6efe975..a565c9b 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.3
-Release: 3%{?dist}
+Release: 4%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -615,6 +615,14 @@ Patch147: 00147-add-debug-malloc-stats.patch
# which values are printed as "v@entry" rather than just "v":
Patch153: 00153-fix-test_gdb-noise.patch
+# python3.spec on f15 has:
+# Patch154: 00154-skip-urllib-test-requiring-working-DNS.patch
+
+# Avoid allocating thunks in ctypes unless absolutely necessary, to avoid
+# generating SELinux denials on "import ctypes" and "import uuid"
when
+# embedding Python within httpd (rhbz#814391)
+Patch155: 00155-avoid-ctypes-thunks.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -933,6 +941,8 @@ done
# 00151: upstream as of Python 2.7.3
# 00152: not for python 2
%patch153 -p0
+# 00154: not for python 2
+%patch155 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -1763,6 +1773,11 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Fri Apr 20 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-4
+- avoid allocating thunks in ctypes unless absolutely necessary, to avoid
+generating SELinux denials on "import ctypes" and "import uuid" when
embedding
+Python within httpd (patch 155; rhbz#814391)
+
* Thu Apr 19 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-3
- add explicit version requirements on expat to avoid linkage problems with
XML_SetHashSalt
commit 067ca193f685d896edbbea96fc456246aa414543
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Thu Apr 19 14:09:01 2012 -0400
2.7.3-3: add explicit version requirements on expat
* Thu Apr 19 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-3
- add explicit version requirements on expat to avoid linkage problems with
XML_SetHashSalt
diff --git a/python.spec b/python.spec
index 393befc..6efe975 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.3
-Release: 2%{?dist}
+Release: 3%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -126,7 +126,11 @@ BuildRequires: autoconf
BuildRequires: bzip2
BuildRequires: bzip2-devel
BuildRequires: db4-devel >= 4.8
-BuildRequires: expat-devel
+
+# expat 2.1.0 added the symbol XML_SetHashSalt without bumping SONAME. We use
+# it (in pyexpat) in order to enable the fix in Python-2.7.3 for CVE-2012-0876:
+BuildRequires: expat-devel >= 2.1.0
+
BuildRequires: findutils
BuildRequires: gcc-c++
%if %{with_gdbm}
@@ -696,6 +700,12 @@ Group: Applications/System
# Needed for ctypes, to load libraries, worked around for Live CDs size
# Requires: binutils
+# expat 2.1.0 added the symbol XML_SetHashSalt without bumping SONAME. We use
+# this symbol (in pyexpat), so we must explicitly state this dependency to
+# prevent "import pyexpat" from failing with a linker error if someone
hasn't
+# yet upgraded expat:
+Requires: expat >= 2.1.0
+
%description libs
This package contains runtime libraries for use by Python:
- the libpython dynamic library, for use by applications that embed Python as
@@ -1753,6 +1763,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu Apr 19 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-3
+- add explicit version requirements on expat to avoid linkage problems with
+XML_SetHashSalt
+
* Wed Apr 18 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-2
- fix -config symlinks (patch 112; rhbz#813836)
commit 9345b0fcac103756a5aacbb8a49d996b23bf0450
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Wed Apr 18 20:19:10 2012 -0400
2.7.3-2: fix -config symlinks (patch 112; rhbz#813836)
* Wed Apr 18 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-2
- fix -config symlinks (patch 112; rhbz#813836)
diff --git a/python-2.7.3-debug-build.patch b/python-2.7.3-debug-build.patch
index d17bf5d..b44c9eb 100644
--- a/python-2.7.3-debug-build.patch
+++ b/python-2.7.3-debug-build.patch
@@ -1,6 +1,6 @@
diff -up Python-2.7.3/configure.in.debug-build Python-2.7.3/configure.in
---- Python-2.7.3/configure.in.debug-build 2012-04-13 00:13:53.923498660 -0400
-+++ Python-2.7.3/configure.in 2012-04-13 00:13:53.929498585 -0400
+--- Python-2.7.3/configure.in.debug-build 2012-04-18 19:46:22.066498521 -0400
++++ Python-2.7.3/configure.in 2012-04-18 19:46:22.078498372 -0400
@@ -635,7 +635,7 @@ AC_SUBST(LIBRARY)
AC_MSG_CHECKING(LIBRARY)
if test -z "$LIBRARY"
@@ -38,7 +38,7 @@ diff -up Python-2.7.3/configure.in.debug-build
Python-2.7.3/configure.in
diff -up Python-2.7.3/Lib/distutils/command/build_ext.py.debug-build
Python-2.7.3/Lib/distutils/command/build_ext.py
--- Python-2.7.3/Lib/distutils/command/build_ext.py.debug-build 2012-04-09
19:07:29.000000000 -0400
-+++ Python-2.7.3/Lib/distutils/command/build_ext.py 2012-04-13 00:13:53.930498573 -0400
++++ Python-2.7.3/Lib/distutils/command/build_ext.py 2012-04-18 19:46:22.079498360 -0400
@@ -676,7 +676,10 @@ class build_ext (Command):
so_ext = get_config_var('SO')
if os.name == 'nt' and self.debug:
@@ -61,8 +61,8 @@ diff -up Python-2.7.3/Lib/distutils/command/build_ext.py.debug-build
Python-2.7.
else:
return ext.libraries
diff -up Python-2.7.3/Lib/distutils/sysconfig.py.debug-build
Python-2.7.3/Lib/distutils/sysconfig.py
---- Python-2.7.3/Lib/distutils/sysconfig.py.debug-build 2012-04-13 00:13:53.899498961
-0400
-+++ Python-2.7.3/Lib/distutils/sysconfig.py 2012-04-13 00:13:53.930498573 -0400
+--- Python-2.7.3/Lib/distutils/sysconfig.py.debug-build 2012-04-18 19:46:21.988499499
-0400
++++ Python-2.7.3/Lib/distutils/sysconfig.py 2012-04-18 19:46:22.080498348 -0400
@@ -85,7 +85,8 @@ def get_python_inc(plat_specific=0, pref
# Include is located in the srcdir
inc_dir = os.path.join(srcdir, "Include")
@@ -83,8 +83,8 @@ diff -up Python-2.7.3/Lib/distutils/sysconfig.py.debug-build
Python-2.7.3/Lib/di
def parse_config_h(fp, g=None):
diff -up Python-2.7.3/Lib/distutils/tests/test_install.py.debug-build
Python-2.7.3/Lib/distutils/tests/test_install.py
---- Python-2.7.3/Lib/distutils/tests/test_install.py.debug-build 2012-04-13
00:14:36.177970408 -0400
-+++ Python-2.7.3/Lib/distutils/tests/test_install.py 2012-04-13 00:15:20.675414113 -0400
+--- Python-2.7.3/Lib/distutils/tests/test_install.py.debug-build 2012-04-18
19:46:21.997499385 -0400
++++ Python-2.7.3/Lib/distutils/tests/test_install.py 2012-04-18 19:46:22.080498348 -0400
@@ -20,8 +20,9 @@ from distutils.tests import support
@@ -97,8 +97,8 @@ diff -up Python-2.7.3/Lib/distutils/tests/test_install.py.debug-build
Python-2.7
diff -up Python-2.7.3/Makefile.pre.in.debug-build Python-2.7.3/Makefile.pre.in
---- Python-2.7.3/Makefile.pre.in.debug-build 2012-04-13 00:13:53.927498611 -0400
-+++ Python-2.7.3/Makefile.pre.in 2012-04-13 00:13:53.931498561 -0400
+--- Python-2.7.3/Makefile.pre.in.debug-build 2012-04-18 19:46:22.073498437 -0400
++++ Python-2.7.3/Makefile.pre.in 2012-04-18 19:48:46.336694896 -0400
@@ -102,8 +102,8 @@ SCRIPTDIR= $(prefix)/lib64
# Detailed destination directories
BINLIBDEST= $(LIBDIR)/python$(VERSION)
@@ -143,20 +143,36 @@ diff -up Python-2.7.3/Makefile.pre.in.debug-build
Python-2.7.3/Makefile.pre.in
if test $(INSTSONAME) != $(LDLIBRARY); then \
$(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS)
$(LIBC) $(LIBM) $(LDLAST); \
$(LN) -f $(INSTSONAME) $@; \
-@@ -798,10 +804,10 @@ bininstall: altbininstall
+@@ -796,18 +802,18 @@ bininstall: altbininstall
+ then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON); \
+ else true; \
fi
- (cd $(DESTDIR)$(BINDIR); $(LN) -s python2$(EXE) $(PYTHON))
- -rm -f $(DESTDIR)$(BINDIR)/python2$(EXE)
+- (cd $(DESTDIR)$(BINDIR); $(LN) -s python2$(EXE) $(PYTHON))
+- -rm -f $(DESTDIR)$(BINDIR)/python2$(EXE)
- (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(EXE) python2$(EXE))
-+ (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(DEBUG_SUFFIX)$(EXE) python2$(EXE))
-+ -rm -f $(DESTDIR)$(BINDIR)/python$(DEBUG_SUFFIX)-config
-+ (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(DEBUG_SUFFIX)-config
python2-config)
- -rm -f $(DESTDIR)$(BINDIR)/python2-config
+- -rm -f $(DESTDIR)$(BINDIR)/python2-config
- (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python2-config)
- -rm -f $(DESTDIR)$(BINDIR)/python-config
- (cd $(DESTDIR)$(BINDIR); $(LN) -s python2-config python-config)
+- (cd $(DESTDIR)$(BINDIR); $(LN) -s python2-config python-config)
++ (cd $(DESTDIR)$(BINDIR); $(LN) -s python2$(DEBUG_SUFFIX)$(EXE) $(PYTHON))
++ -rm -f $(DESTDIR)$(BINDIR)/python2$(DEBUG_SUFFIX)$(EXE)
++ (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(DEBUG_SUFFIX)$(EXE)
python2$(DEBUG_SUFFIX)$(EXE))
++ -rm -f $(DESTDIR)$(BINDIR)/python2$(DEBUG_SUFFIX)-config
++ (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(DEBUG_SUFFIX)-config
python2$(DEBUG_SUFFIX)-config)
++ -rm -f $(DESTDIR)$(BINDIR)/python$(DEBUG_SUFFIX)-config
++ (cd $(DESTDIR)$(BINDIR); $(LN) -s python2$(DEBUG_SUFFIX)-config
python$(DEBUG_SUFFIX)-config)
-test -d $(DESTDIR)$(LIBPC) || $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(LIBPC)
- -rm -f $(DESTDIR)$(LIBPC)/python2.pc
+- -rm -f $(DESTDIR)$(LIBPC)/python2.pc
+- (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python2.pc)
+- -rm -f $(DESTDIR)$(LIBPC)/python.pc
+- (cd $(DESTDIR)$(LIBPC); $(LN) -s python2.pc python.pc)
++ -rm -f $(DESTDIR)$(LIBPC)/python2$(DEBUG_SUFFIX).pc
++ (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION)$(DEBUG_SUFFIX).pc
python2$(DEBUG_SUFFIX).pc)
++ -rm -f $(DESTDIR)$(LIBPC)/python$(DEBUG_SUFFIX).pc
++ (cd $(DESTDIR)$(LIBPC); $(LN) -s python2$(DEBUG_SUFFIX).pc python$(DEBUG_SUFFIX).pc)
+
+ # Install the interpreter with $(VERSION) affixed
+ # This goes into $(exec_prefix)
@@ -820,7 +826,7 @@ altbininstall: $(BUILDPYTHON)
else true; \
fi; \
@@ -197,8 +213,12 @@ diff -up Python-2.7.3/Makefile.pre.in.debug-build
Python-2.7.3/Makefile.pre.in
@for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \
do \
if test ! -d $(DESTDIR)$$i; then \
-@@ -1019,8 +1026,7 @@ libainstall: all python-config
- $(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc
+@@ -1016,11 +1023,10 @@ libainstall: all python-config
+ $(INSTALL_DATA) Modules/Setup $(DESTDIR)$(LIBPL)/Setup
+ $(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local
+ $(INSTALL_DATA) Modules/Setup.config $(DESTDIR)$(LIBPL)/Setup.config
+- $(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc
++ $(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION)$(DEBUG_SUFFIX).pc
$(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
$(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
- $(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(VERSION)-config
@@ -209,7 +229,7 @@ diff -up Python-2.7.3/Makefile.pre.in.debug-build
Python-2.7.3/Makefile.pre.in
echo; echo "Installing support files for building shared extension modules on
AIX:"; \
diff -up Python-2.7.3/Misc/python-config.in.debug-build
Python-2.7.3/Misc/python-config.in
--- Python-2.7.3/Misc/python-config.in.debug-build 2012-04-09 19:07:33.000000000 -0400
-+++ Python-2.7.3/Misc/python-config.in 2012-04-13 00:13:53.931498561 -0400
++++ Python-2.7.3/Misc/python-config.in 2012-04-18 19:46:22.082498324 -0400
@@ -45,7 +45,7 @@ for opt in opt_flags:
elif opt in ('--libs', '--ldflags'):
@@ -221,7 +241,7 @@ diff -up Python-2.7.3/Misc/python-config.in.debug-build
Python-2.7.3/Misc/python
if opt == '--ldflags':
diff -up Python-2.7.3/Modules/makesetup.debug-build Python-2.7.3/Modules/makesetup
--- Python-2.7.3/Modules/makesetup.debug-build 2012-04-09 19:07:34.000000000 -0400
-+++ Python-2.7.3/Modules/makesetup 2012-04-13 00:13:53.931498561 -0400
++++ Python-2.7.3/Modules/makesetup 2012-04-18 19:46:22.083498312 -0400
@@ -233,7 +233,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
*$mod.o*) base=$mod;;
*) base=${mod}module;;
@@ -233,7 +253,7 @@ diff -up Python-2.7.3/Modules/makesetup.debug-build
Python-2.7.3/Modules/makeset
esac
diff -up Python-2.7.3/Python/dynload_shlib.c.debug-build
Python-2.7.3/Python/dynload_shlib.c
--- Python-2.7.3/Python/dynload_shlib.c.debug-build 2012-04-09 19:07:35.000000000 -0400
-+++ Python-2.7.3/Python/dynload_shlib.c 2012-04-13 00:13:53.931498561 -0400
++++ Python-2.7.3/Python/dynload_shlib.c 2012-04-18 19:46:22.083498312 -0400
@@ -46,11 +46,16 @@ const struct filedescr _PyImport_DynLoad
{"module.exe", "rb", C_EXTENSION},
{"MODULE.EXE", "rb", C_EXTENSION},
@@ -256,7 +276,7 @@ diff -up Python-2.7.3/Python/dynload_shlib.c.debug-build
Python-2.7.3/Python/dyn
diff -up Python-2.7.3/Python/sysmodule.c.debug-build Python-2.7.3/Python/sysmodule.c
--- Python-2.7.3/Python/sysmodule.c.debug-build 2012-04-09 19:07:35.000000000 -0400
-+++ Python-2.7.3/Python/sysmodule.c 2012-04-13 00:13:53.932498549 -0400
++++ Python-2.7.3/Python/sysmodule.c 2012-04-18 19:46:22.083498312 -0400
@@ -1506,6 +1506,12 @@ _PySys_Init(void)
PyString_FromString("legacy"));
#endif
diff --git a/python.spec b/python.spec
index e8f7ebf..393befc 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.3
-Release: 1%{?dist}
+Release: 2%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1169,10 +1169,6 @@ cp -a save_bits_of_test/* %{buildroot}/%{pylibdir}/test
fi
%if %{main_python}
-ln -s python2.7-debug-config %{buildroot}%{_bindir}/python-debug-config
-%if 0%{?with_debug_build}
-ln -s python-debug %{buildroot}%{_bindir}/python2-debug
-%endif # with_debug_build
%else
mv %{buildroot}%{_bindir}/python %{buildroot}%{_bindir}/%{python}
%if 0%{?with_debug_build}
@@ -1573,6 +1569,7 @@ rm -fr %{buildroot}
%doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit
%if %{main_python}
%{_bindir}/python-config
+%{_bindir}/python2-config
%endif
%{_bindir}/python%{pybasever}-config
%{_libdir}/libpython%{pybasever}.so
@@ -1712,10 +1709,14 @@ rm -fr %{buildroot}
# Analog of the -devel subpackage's files:
%dir %{pylibdir}/config-debug
+%{_libdir}/pkgconfig/python-%{pybasever}-debug.pc
+%{_libdir}/pkgconfig/python-debug.pc
+%{_libdir}/pkgconfig/python2-debug.pc
%{pylibdir}/config-debug/*
%{_includedir}/python%{pybasever}-debug/*.h
%if %{main_python}
%{_bindir}/python-debug-config
+%{_bindir}/python2-debug-config
%endif
%{_bindir}/python%{pybasever}-debug-config
%{_libdir}/libpython%{pybasever}_d.so
@@ -1752,6 +1753,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Wed Apr 18 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-2
+- fix -config symlinks (patch 112; rhbz#813836)
+
* Wed Apr 11 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-1
- 2.7.3: refresh patch 102 (lib64); drop upstream patches 11 (ascii-to-lower),
115 (pydoc robustness), 145 (linux2), 148 (gdbm magic values), 151 (deadlock
commit b0a6ae18b357c63aa7594fb622ca8e42cecb3f63
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Fri Apr 13 10:36:12 2012 -0400
2.7.3-1
* Wed Apr 11 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-1
- 2.7.3: refresh patch 102 (lib64); drop upstream patches 11 (ascii-to-lower),
115 (pydoc robustness), 145 (linux2), 148 (gdbm magic values), 151 (deadlock
in fork); refresh patch 112 (debug build); revise patch 127
(test_structmember); fix test_gdb (patch 153); refresh patch 137 (distutils
tests); add python2.pc to python-devel; regenerate the autotool intermediates
patch (patch 300)
diff --git a/00137-skip-distutils-tests-that-fail-in-rpmbuild.patch
b/00137-skip-distutils-tests-that-fail-in-rpmbuild.patch
index b1a55cd..8653772 100644
--- a/00137-skip-distutils-tests-that-fail-in-rpmbuild.patch
+++ b/00137-skip-distutils-tests-that-fail-in-rpmbuild.patch
@@ -1,6 +1,6 @@
-diff -up
Python-2.7.2/Lib/distutils/tests/test_bdist_rpm.py.mark-tests-that-fail-in-rpmbuild
Python-2.7.2/Lib/distutils/tests/test_bdist_rpm.py
----
Python-2.7.2/Lib/distutils/tests/test_bdist_rpm.py.mark-tests-that-fail-in-rpmbuild 2011-09-08
17:28:19.170502386 -0400
-+++ Python-2.7.2/Lib/distutils/tests/test_bdist_rpm.py 2011-09-08 17:48:40.608418864
-0400
+diff -up
Python-2.7.3/Lib/distutils/tests/test_bdist_rpm.py.mark-tests-that-fail-in-rpmbuild
Python-2.7.3/Lib/distutils/tests/test_bdist_rpm.py
+---
Python-2.7.3/Lib/distutils/tests/test_bdist_rpm.py.mark-tests-that-fail-in-rpmbuild 2012-04-09
19:07:29.000000000 -0400
++++ Python-2.7.3/Lib/distutils/tests/test_bdist_rpm.py 2012-04-13 00:20:08.223819263
-0400
@@ -24,6 +24,7 @@ setup(name='foo', version='0.1', py_modu
"""
@@ -9,14 +9,4 @@ diff -up
Python-2.7.2/Lib/distutils/tests/test_bdist_rpm.py.mark-tests-that-fail
class BuildRpmTestCase(support.TempdirManager,
support.LoggingSilencer,
unittest.TestCase):
-diff -up
Python-2.7.2/Lib/distutils/tests/test_build_ext.py.mark-tests-that-fail-in-rpmbuild
Python-2.7.2/Lib/distutils/tests/test_build_ext.py
----
Python-2.7.2/Lib/distutils/tests/test_build_ext.py.mark-tests-that-fail-in-rpmbuild 2011-09-08
16:07:25.033834312 -0400
-+++ Python-2.7.2/Lib/distutils/tests/test_build_ext.py 2011-09-08 17:43:15.656441082
-0400
-@@ -69,6 +69,7 @@ class BuildExtTestCase(support.TempdirMa
- name, equals, value = runshared.partition('=')
- cmd.library_dirs = value.split(os.pathsep)
-
-+ @unittest._skipInRpmBuild('fails when run from build dir with /usr/bin/ld:
cannot find -lpython2.7')
- @unittest.skipIf(not os.path.exists(_XX_MODULE_PATH),
- 'xxmodule.c not found')
- def test_build_ext(self):
+diff -up
Python-2.7.3/Lib/distutils/tests/test_build_ext.py.mark-tests-that-fail-in-rpmbuild
Python-2.7.3/Lib/distutils/tests/test_build_ext.py
diff --git a/00145-force-sys-platform-to-be-linux2.patch
b/00145-force-sys-platform-to-be-linux2.patch
deleted file mode 100644
index efa3bcd..0000000
--- a/00145-force-sys-platform-to-be-linux2.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-diff -up Python-2.7.2/configure.in.linux2 Python-2.7.2/configure.in
---- Python-2.7.2/configure.in.linux2 2011-09-13 23:18:19.237252000 -0400
-+++ Python-2.7.2/configure.in 2011-09-13 23:18:19.494252001 -0400
-@@ -293,6 +293,7 @@ then
- MACHDEP="$ac_md_system$ac_md_release"
-
- case $MACHDEP in
-+ linux*) MACHDEP="linux2";;
- cygwin*) MACHDEP="cygwin";;
- darwin*) MACHDEP="darwin";;
- atheos*) MACHDEP="atheos";;
-diff -up Python-2.7.2/configure.linux2 Python-2.7.2/configure
---- Python-2.7.2/configure.linux2 2011-06-11 11:46:28.000000000 -0400
-+++ Python-2.7.2/configure 2011-09-13 23:18:19.489252001 -0400
-@@ -3003,6 +3003,7 @@ then
- MACHDEP="$ac_md_system$ac_md_release"
-
- case $MACHDEP in
-+ linux*) MACHDEP="linux2";;
- cygwin*) MACHDEP="cygwin";;
- darwin*) MACHDEP="darwin";;
- atheos*) MACHDEP="atheos";;
-diff -up Python-2.7.2/Misc/NEWS.linux2 Python-2.7.2/Misc/NEWS
diff --git a/00151-fork-deadlock.patch b/00151-fork-deadlock.patch
deleted file mode 100644
index 6b1bcff..0000000
--- a/00151-fork-deadlock.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-
-# HG changeset patch
-# User Charles-Franois Natali <neologix(a)free.fr>
-# Date 1328209039 -3600
-# Node ID c3649173d093ce3bb2f887c1b4c3207196f1f453
-# Parent 0b8917fc6db55d371573398c2ae29b120be40a19
-Issue #13817: After fork(), reinit the ad-hoc TLS implementation earlier to fix
-a random deadlock when fork() is called in a multithreaded process in debug
-mode, and make PyOS_AfterFork() more robust.
-
-diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
---- a/Lib/test/test_threading.py
-+++ b/Lib/test/test_threading.py
-@@ -635,6 +635,29 @@ class ThreadJoinOnShutdown(BaseTestCase)
- output = "end of worker thread\nend of main thread\n"
- self.assertScriptHasOutput(script, output)
-
-+ @unittest.skipUnless(hasattr(os, 'fork'), "needs os.fork()")
-+ def test_reinit_tls_after_fork(self):
-+ # Issue #13817: fork() would deadlock in a multithreaded program with
-+ # the ad-hoc TLS implementation.
-+
-+ def do_fork_and_wait():
-+ # just fork a child process and wait it
-+ pid = os.fork()
-+ if pid > 0:
-+ os.waitpid(pid, 0)
-+ else:
-+ os._exit(0)
-+
-+ # start a bunch of threads that will fork() child processes
-+ threads = []
-+ for i in range(16):
-+ t = threading.Thread(target=do_fork_and_wait)
-+ threads.append(t)
-+ t.start()
-+
-+ for t in threads:
-+ t.join()
-+
-
- class ThreadingExceptionTests(BaseTestCase):
- # A RuntimeError should be raised if Thread.start() is called
-diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
---- a/Modules/signalmodule.c
-+++ b/Modules/signalmodule.c
-@@ -976,11 +976,13 @@ void
- PyOS_AfterFork(void)
- {
- #ifdef WITH_THREAD
-+ /* PyThread_ReInitTLS() must be called early, to make sure that the TLS API
-+ * can be called safely. */
-+ PyThread_ReInitTLS();
- _PyGILState_Reinit();
- PyEval_ReInitThreads();
- main_thread = PyThread_get_thread_ident();
- main_pid = getpid();
- _PyImport_ReInitLock();
-- PyThread_ReInitTLS();
- #endif
- }
-
diff --git a/00152-fix-test-gdb-regex.patch b/00152-fix-test-gdb-regex.patch
new file mode 100644
index 0000000..4e31c2e
--- /dev/null
+++ b/00152-fix-test-gdb-regex.patch
@@ -0,0 +1,11 @@
+--- Lib/test/test_gdb.py.old 2012-04-11 19:35:13.512681203 -0400
++++ Lib/test/test_gdb.py 2012-04-11 19:39:52.567192540 -0400
+@@ -159,7 +159,7 @@ class DebuggerTests(unittest.TestCase):
+ # gdb can insert additional '\n' and space characters in various places
+ # in its output, depending on the width of the terminal it's connected
+ # to (using its "wrap_here" function)
+- m =
re.match('.*#0\s+builtin_id\s+\(self\=.*,\s+v=\s*(.*?)\)\s+at\s+Python/bltinmodule.c.*',
++ m =
re.match('.*#0\s+builtin_id\s+\(self\=.*,\s+v=\s*(.*?)\)\s+at\s+\S*Python/bltinmodule.c.*',
+ gdb_output, re.DOTALL)
+ if not m:
+ self.fail('Unexpected gdb output: %r\n%s' % (gdb_output,
gdb_output))
diff --git a/00153-fix-test_gdb-noise.patch b/00153-fix-test_gdb-noise.patch
new file mode 100644
index 0000000..bc5ee63
--- /dev/null
+++ b/00153-fix-test_gdb-noise.patch
@@ -0,0 +1,35 @@
+--- Lib/test/test_gdb.py.old 2012-04-11 21:04:01.367073855 -0400
++++ Lib/test/test_gdb.py 2012-04-12 08:52:58.320288761 -0400
+@@ -96,6 +96,15 @@ class DebuggerTests(unittest.TestCase):
+ # Generate a list of commands in gdb's language:
+ commands = ['set breakpoint pending yes',
+ 'break %s' % breakpoint,
++
++ # GDB as of Fedora 17 onwards can distinguish between the
++ # value of a variable at entry vs current value:
++ #
http://sourceware.org/gdb/onlinedocs/gdb/Variables.html
++ # which leads to the selftests failing with errors like this:
++ # AssertionError: 'v@entry=()' != '()'
++ # Disable this:
++ 'set print entry-values no',
++
+ 'run']
+ if cmds_after_breakpoint:
+ commands += cmds_after_breakpoint
+@@ -135,8 +144,16 @@ class DebuggerTests(unittest.TestCase):
+ err = err.replace("warning: Cannot initialize thread debugging"
+ " library: Debugger service failed\n",
+ '')
++ err = '\n'.join([line
++ for line in err.splitlines()
++ if not line.startswith('warning: Unable to open')
++ if not line.startswith('Missing separate debuginfo
for')
++ if not line.startswith('Try: yum --disablerepo=')
++ # In case 'set print entry-values no' failed:
++ if not line.startswith('Undefined set print
command')])
+
+ # Ensure no unexpected error messages:
++ self.maxDiff = None
+ self.assertEqual(err, '')
+
+ return out
diff --git a/autotool-intermediates.patch b/autotool-intermediates.patch
index 68eefe9..790cd27 100644
--- a/autotool-intermediates.patch
+++ b/autotool-intermediates.patch
@@ -1,7 +1,44 @@
diff -up ./configure.autotool-intermediates ./configure
---- ./configure.autotool-intermediates 2011-06-13 15:27:20.710308004 -0400
-+++ ./configure 2011-06-13 15:27:22.862308004 -0400
-@@ -619,6 +619,8 @@ TRUE
+--- ./configure.autotool-intermediates 2012-04-11 18:35:27.009518662 -0400
++++ ./configure 2012-04-11 18:35:27.852508123 -0400
+@@ -1,7 +1,7 @@
+ #! /bin/sh
+ # From configure.in Revision.
+ # Guess values for system-dependent variables and create Makefiles.
+-# Generated by GNU Autoconf 2.67 for python 2.7.
++# Generated by GNU Autoconf 2.68 for python 2.7.
+ #
+ # Report bugs to <
http://bugs.python.org/>.
+ #
+@@ -92,6 +92,7 @@ fi
+ IFS=" "" $as_nl"
+
+ # Find who we are. Look in the path if we contain no directory separator.
++as_myself=
+ case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+@@ -217,11 +218,18 @@ IFS=$as_save_IFS
+ # We cannot yet assume a decent shell, so we have to provide a
+ # neutralization value for shells without unset; and this also
+ # works around shells that cannot unset nonexistent variables.
++ # Preserve -v and -x to the replacement shell.
+ BASH_ENV=/dev/null
+ ENV=/dev/null
+ (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+ export CONFIG_SHELL
+- exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
++ case $- in # ((((
++ *v*x* | *x*v* ) as_opts=-vx ;;
++ *v* ) as_opts=-v ;;
++ *x* ) as_opts=-x ;;
++ * ) as_opts= ;;
++ esac
++ exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+ fi
+
+ if test x$as_have_required = xno; then :
+@@ -611,6 +619,8 @@ TRUE
MACHDEP_OBJS
DYNLOADFILE
DLINCLDIR
@@ -10,7 +47,7 @@ diff -up ./configure.autotool-intermediates ./configure
THREADOBJ
LDLAST
USE_THREAD_MODULE
-@@ -639,6 +641,8 @@ OTHER_LIBTOOL_OPT
+@@ -631,6 +641,8 @@ OTHER_LIBTOOL_OPT
UNIVERSAL_ARCH_FLAGS
BASECFLAGS
OPT
@@ -19,7 +56,7 @@ diff -up ./configure.autotool-intermediates ./configure
LN
INSTALL_DATA
INSTALL_SCRIPT
-@@ -760,8 +764,11 @@ with_pth
+@@ -752,8 +764,11 @@ with_pth
enable_ipv6
with_doc_strings
with_tsc
@@ -31,17 +68,16 @@ diff -up ./configure.autotool-intermediates ./configure
with_wctype_functions
with_fpectl
with_libm
-@@ -777,7 +784,8 @@ CFLAGS
- LDFLAGS
- LIBS
- CPPFLAGS
--CPP'
-+CPP
-+CPPFLAGS'
+@@ -1174,7 +1189,7 @@ Try \`$0 --help' for more information"
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target"
>&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null
&&
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+- : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
++ : "${build_alias=$ac_option} ${host_alias=$ac_option}
${target_alias=$ac_option}"
+ ;;
-
- # Initialize some variables set by options.
-@@ -1435,8 +1443,11 @@ Optional Packages:
+ esac
+@@ -1427,8 +1442,11 @@ Optional Packages:
--with-pth use GNU pth threading libraries
--with(out)-doc-strings disable/enable documentation strings
--with(out)-tsc enable/disable timestamp counter profile
@@ -53,7 +89,461 @@ diff -up ./configure.autotool-intermediates ./configure
--with-wctype-functions use wctype.h functions
--with-fpectl enable SIGFPE catching
--with-libm=STRING math library
-@@ -4754,7 +4765,7 @@ esac
+@@ -1511,7 +1529,7 @@ test -n "$ac_init_help" && exit $ac_stat
+ if $ac_init_version; then
+ cat <<\_ACEOF
+ python configure 2.7
+-generated by GNU Autoconf 2.67
++generated by GNU Autoconf 2.68
+
+ Copyright (C) 2010 Free Software Foundation, Inc.
+ This configure script is free software; the Free Software Foundation
+@@ -1557,7 +1575,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+ fi
+- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+ } # ac_fn_c_try_compile
+@@ -1594,7 +1612,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+ fi
+- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+ } # ac_fn_c_try_cpp
+@@ -1607,10 +1625,10 @@ fi
+ ac_fn_c_check_header_mongrel ()
+ {
+ as_lineno=${as_lineno-"$1"}
as_lineno_stack=as_lineno_stack=$as_lineno_stack
+- if eval "test \"\${$3+set}\"" = set; then :
++ if eval \${$3+:} false; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+ $as_echo_n "checking for $2... " >&6; }
+-if eval "test \"\${$3+set}\"" = set; then :
++if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+ fi
+ eval ac_res=\$$3
+@@ -1677,7 +1695,7 @@ $as_echo "$as_me: WARNING: $2: proceedin
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+ $as_echo_n "checking for $2... " >&6; }
+-if eval "test \"\${$3+set}\"" = set; then :
++if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ eval "$3=\$ac_header_compiler"
+@@ -1686,7 +1704,7 @@ eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+ $as_echo "$ac_res" >&6; }
+ fi
+- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+ } # ac_fn_c_check_header_mongrel
+
+@@ -1727,7 +1745,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
+ ac_retval=$ac_status
+ fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+ } # ac_fn_c_try_run
+@@ -1741,7 +1759,7 @@ ac_fn_c_check_header_compile ()
+ as_lineno=${as_lineno-"$1"}
as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+ $as_echo_n "checking for $2... " >&6; }
+-if eval "test \"\${$3+set}\"" = set; then :
++if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -1759,7 +1777,7 @@ fi
+ eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+ $as_echo "$ac_res" >&6; }
+- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+ } # ac_fn_c_check_header_compile
+
+@@ -1804,7 +1822,7 @@ fi
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+ } # ac_fn_c_try_link
+@@ -1818,7 +1836,7 @@ ac_fn_c_check_type ()
+ as_lineno=${as_lineno-"$1"}
as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+ $as_echo_n "checking for $2... " >&6; }
+-if eval "test \"\${$3+set}\"" = set; then :
++if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ eval "$3=no"
+@@ -1859,7 +1877,7 @@ fi
+ eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+ $as_echo "$ac_res" >&6; }
+- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+ } # ac_fn_c_check_type
+
+@@ -1872,7 +1890,7 @@ ac_fn_c_find_uintX_t ()
+ as_lineno=${as_lineno-"$1"}
as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5
+ $as_echo_n "checking for uint$2_t... " >&6; }
+-if eval "test \"\${$3+set}\"" = set; then :
++if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ eval "$3=no"
+@@ -1912,7 +1930,7 @@ fi
+ eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+ $as_echo "$ac_res" >&6; }
+- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+ } # ac_fn_c_find_uintX_t
+
+@@ -1925,7 +1943,7 @@ ac_fn_c_find_intX_t ()
+ as_lineno=${as_lineno-"$1"}
as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5
+ $as_echo_n "checking for int$2_t... " >&6; }
+-if eval "test \"\${$3+set}\"" = set; then :
++if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ eval "$3=no"
+@@ -1986,7 +2004,7 @@ fi
+ eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+ $as_echo "$ac_res" >&6; }
+- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+ } # ac_fn_c_find_intX_t
+
+@@ -2163,7 +2181,7 @@ rm -f core *.core core.conftest.* gmon.o
+ rm -f conftest.val
+
+ fi
+- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+ } # ac_fn_c_compute_int
+@@ -2176,7 +2194,7 @@ ac_fn_c_check_func ()
+ as_lineno=${as_lineno-"$1"}
as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+ $as_echo_n "checking for $2... " >&6; }
+-if eval "test \"\${$3+set}\"" = set; then :
++if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -2231,7 +2249,7 @@ fi
+ eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+ $as_echo "$ac_res" >&6; }
+- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+ } # ac_fn_c_check_func
+
+@@ -2244,7 +2262,7 @@ ac_fn_c_check_member ()
+ as_lineno=${as_lineno-"$1"}
as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
+ $as_echo_n "checking for $2.$3... " >&6; }
+-if eval "test \"\${$4+set}\"" = set; then :
++if eval \${$4+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -2288,7 +2306,7 @@ fi
+ eval ac_res=\$$4
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+ $as_echo "$ac_res" >&6; }
+- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+ } # ac_fn_c_check_member
+
+@@ -2303,7 +2321,7 @@ ac_fn_c_check_decl ()
+ as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/)
0& (/g'`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is
declared" >&5
+ $as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+-if eval "test \"\${$3+set}\"" = set; then :
++if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -2334,7 +2352,7 @@ fi
+ eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+ $as_echo "$ac_res" >&6; }
+- eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=;
unset as_lineno;}
++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+ } # ac_fn_c_check_decl
+ cat >config.log <<_ACEOF
+@@ -2342,7 +2360,7 @@ This file contains any messages produced
+ running configure, to aid debugging if configure makes a mistake.
+
+ It was created by python $as_me 2.7, which was
+-generated by GNU Autoconf 2.67. Invocation command line was
++generated by GNU Autoconf 2.68. Invocation command line was
+
+ $ $0 $@
+
+@@ -2600,7 +2618,7 @@ $as_echo "$as_me: loading site script $a
+ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error $? "failed to load site script $ac_site_file
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ done
+
+@@ -3241,7 +3259,7 @@ if test -n "$ac_tool_prefix"; then
+ set dummy ${ac_tool_prefix}gcc; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if test "${ac_cv_prog_CC+set}" = set; then :
++if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$CC"; then
+@@ -3281,7 +3299,7 @@ if test -z "$ac_cv_prog_CC"; then
+ set dummy gcc; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
++if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$ac_ct_CC"; then
+@@ -3334,7 +3352,7 @@ if test -z "$CC"; then
+ set dummy ${ac_tool_prefix}cc; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if test "${ac_cv_prog_CC+set}" = set; then :
++if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$CC"; then
+@@ -3374,7 +3392,7 @@ if test -z "$CC"; then
+ set dummy cc; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if test "${ac_cv_prog_CC+set}" = set; then :
++if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$CC"; then
+@@ -3433,7 +3451,7 @@ if test -z "$CC"; then
+ set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if test "${ac_cv_prog_CC+set}" = set; then :
++if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$CC"; then
+@@ -3477,7 +3495,7 @@ do
+ set dummy $ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
++if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$ac_ct_CC"; then
+@@ -3532,7 +3550,7 @@ fi
+ test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}:
error: in \`$ac_pwd':" >&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error $? "no acceptable C compiler found in \$PATH
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+
+ # Provide some information about the compiler.
+ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version"
>&5
+@@ -3647,7 +3665,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "C compiler cannot create executables
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ $as_echo "yes" >&6; }
+@@ -3690,7 +3708,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ rm -f conftest conftest$ac_cv_exeext
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+@@ -3749,7 +3767,7 @@ $as_echo "$ac_try_echo"; } >&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error $? "cannot run C compiled programs.
+ If you meant to cross compile, use \`--host'.
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ fi
+ fi
+@@ -3760,7 +3778,7 @@ rm -f conftest.$ac_ext conftest$ac_cv_ex
+ ac_clean_files=$ac_clean_files_save
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files"
>&5
+ $as_echo_n "checking for suffix of object files... " >&6; }
+-if test "${ac_cv_objext+set}" = set; then :
++if ${ac_cv_objext+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -3801,7 +3819,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error $? "cannot compute suffix of object files: cannot compile
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ rm -f conftest.$ac_cv_objext conftest.$ac_ext
+ fi
+@@ -3811,7 +3829,7 @@ OBJEXT=$ac_cv_objext
+ ac_objext=$OBJEXT
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C
compiler" >&5
+ $as_echo_n "checking whether we are using the GNU C compiler... " >&6;
}
+-if test "${ac_cv_c_compiler_gnu+set}" = set; then :
++if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -3848,7 +3866,7 @@ ac_test_CFLAGS=${CFLAGS+set}
+ ac_save_CFLAGS=$CFLAGS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g"
>&5
+ $as_echo_n "checking whether $CC accepts -g... " >&6; }
+-if test "${ac_cv_prog_cc_g+set}" = set; then :
++if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+@@ -3926,7 +3944,7 @@ else
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO
C89" >&5
+ $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+-if test "${ac_cv_prog_cc_c89+set}" = set; then :
++if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_cv_prog_cc_c89=no
+@@ -4065,7 +4083,7 @@ then
+ set dummy g++; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if test "${ac_cv_path_CXX+set}" = set; then :
++if ${ac_cv_path_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ case $CXX in
+@@ -4106,7 +4124,7 @@ fi
+ set dummy c++; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if test "${ac_cv_path_CXX+set}" = set; then :
++if ${ac_cv_path_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ case $CXX in
+@@ -4157,7 +4175,7 @@ do
+ set dummy $ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if test "${ac_cv_prog_CXX+set}" = set; then :
++if ${ac_cv_prog_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$CXX"; then
+@@ -4228,7 +4246,7 @@ if test -n "$CPP" && test -d "$CPP";
the
+ CPP=
+ fi
+ if test -z "$CPP"; then
+- if test "${ac_cv_prog_CPP+set}" = set; then :
++ if ${ac_cv_prog_CPP+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ # Double quotes because CPP needs to be expanded
+@@ -4344,7 +4362,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ fi
+
+ ac_ext=c
+@@ -4356,7 +4374,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines
and -e" >&5
+ $as_echo_n "checking for grep that handles long lines and -e... " >&6;
}
+-if test "${ac_cv_path_GREP+set}" = set; then :
++if ${ac_cv_path_GREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test -z "$GREP"; then
+@@ -4419,7 +4437,7 @@ $as_echo "$ac_cv_path_GREP" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+ $as_echo_n "checking for egrep... " >&6; }
+-if test "${ac_cv_path_EGREP+set}" = set; then :
++if ${ac_cv_path_EGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+@@ -4486,7 +4504,7 @@ $as_echo "$ac_cv_path_EGREP" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files"
>&5
+ $as_echo_n "checking for ANSI C header files... " >&6; }
+-if test "${ac_cv_header_stdc+set}" = set; then :
++if ${ac_cv_header_stdc+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -4615,7 +4633,7 @@ done
+
+
+ ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h"
"ac_cv_header_minix_config_h" "$ac_includes_default"
+-if test "x$ac_cv_header_minix_config_h" = x""yes; then :
++if test "x$ac_cv_header_minix_config_h" = xyes; then :
+ MINIX=yes
+ else
+ MINIX=
+@@ -4637,7 +4655,7 @@ $as_echo "#define _MINIX 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define
__EXTENSIONS__" >&5
+ $as_echo_n "checking whether it is safe to define __EXTENSIONS__... "
>&6; }
+-if test "${ac_cv_safe_to_define___extensions__+set}" = set; then :
++if ${ac_cv_safe_to_define___extensions__+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -4747,7 +4765,7 @@ esac
$as_echo_n "checking LIBRARY... " >&6; }
if test -z "$LIBRARY"
then
@@ -62,10 +552,10 @@ diff -up ./configure.autotool-intermediates ./configure
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBRARY" >&5
$as_echo "$LIBRARY" >&6; }
-@@ -4928,8 +4939,8 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>
+@@ -4921,8 +4939,8 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>
INSTSONAME="$LDLIBRARY".$SOVERSION
;;
- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*)
+ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*)
- LDLIBRARY='libpython$(VERSION).so'
- BLDLIBRARY='-L. -lpython$(VERSION)'
+ LDLIBRARY='libpython$(VERSION)$(DEBUG_EXT).so'
@@ -73,7 +563,7 @@ diff -up ./configure.autotool-intermediates ./configure
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
case $ac_sys_system in
FreeBSD*)
-@@ -4952,7 +4963,7 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>
+@@ -4945,7 +4963,7 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>
;;
OSF*)
LDLIBRARY='libpython$(VERSION).so'
@@ -82,7 +572,61 @@ diff -up ./configure.autotool-intermediates ./configure
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
;;
atheos*)
-@@ -5391,6 +5402,14 @@ $as_echo "no" >&6; }
+@@ -4981,7 +4999,7 @@ if test -n "$ac_tool_prefix"; then
+ set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if test "${ac_cv_prog_RANLIB+set}" = set; then :
++if ${ac_cv_prog_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$RANLIB"; then
+@@ -5021,7 +5039,7 @@ if test -z "$ac_cv_prog_RANLIB"; then
+ set dummy ranlib; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then :
++if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$ac_ct_RANLIB"; then
+@@ -5075,7 +5093,7 @@ do
+ set dummy $ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if test "${ac_cv_prog_AR+set}" = set; then :
++if ${ac_cv_prog_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$AR"; then
+@@ -5125,7 +5143,7 @@ fi
+ set dummy svnversion; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if test "${ac_cv_prog_SVNVERSION+set}" = set; then :
++if ${ac_cv_prog_SVNVERSION+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$SVNVERSION"; then
+@@ -5173,7 +5191,7 @@ fi
+ set dummy hg; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if test "${ac_cv_prog_HAS_HG+set}" = set; then :
++if ${ac_cv_prog_HAS_HG+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$HAS_HG"; then
+@@ -5272,7 +5290,7 @@ ac_configure="$SHELL $ac_aux_dir/configu
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible
install" >&5
+ $as_echo_n "checking for a BSD-compatible install... " >&6; }
+ if test -z "$INSTALL"; then
+-if test "${ac_cv_path_install+set}" = set; then :
++if ${ac_cv_path_install+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+@@ -5384,6 +5402,14 @@ $as_echo "no" >&6; }
fi
@@ -97,7 +641,848 @@ diff -up ./configure.autotool-intermediates ./configure
# XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
# merged with this chunk of code?
-@@ -9403,6 +9422,50 @@ $as_echo "no" >&6; }
+@@ -5460,7 +5486,7 @@ yes)
+ $as_echo_n "checking whether $CC accepts -fno-strict-aliasing... " >&6;
}
+ ac_save_cc="$CC"
+ CC="$CC -fno-strict-aliasing"
+- if test "${ac_cv_no_strict_aliasing_ok+set}" = set; then :
++ if ${ac_cv_no_strict_aliasing_ok+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -5650,7 +5676,7 @@ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts
-OPT:Olimit=0" >&5
+ $as_echo_n "checking whether $CC accepts -OPT:Olimit=0... " >&6; }
+-if test "${ac_cv_opt_olimit_ok+set}" = set; then :
++if ${ac_cv_opt_olimit_ok+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_save_cc="$CC"
+@@ -5692,7 +5718,7 @@ if test $ac_cv_opt_olimit_ok = yes; then
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Olimit
1500" >&5
+ $as_echo_n "checking whether $CC accepts -Olimit 1500... " >&6; }
+- if test "${ac_cv_olimit_ok+set}" = set; then :
++ if ${ac_cv_olimit_ok+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_save_cc="$CC"
+@@ -5770,7 +5796,7 @@ fi
+ # options before we can check whether -Kpthread improves anything.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads are available
without options" >&5
+ $as_echo_n "checking whether pthreads are available without options... "
>&6; }
+-if test "${ac_cv_pthread_is_default+set}" = set; then :
++if ${ac_cv_pthread_is_default+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test "$cross_compiling" = yes; then :
+@@ -5823,7 +5849,7 @@ else
+ # function available.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts
-Kpthread" >&5
+ $as_echo_n "checking whether $CC accepts -Kpthread... " >&6; }
+-if test "${ac_cv_kpthread+set}" = set; then :
++if ${ac_cv_kpthread+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_save_cc="$CC"
+@@ -5872,7 +5898,7 @@ then
+ # function available.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts
-Kthread" >&5
+ $as_echo_n "checking whether $CC accepts -Kthread... " >&6; }
+-if test "${ac_cv_kthread+set}" = set; then :
++if ${ac_cv_kthread+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_save_cc="$CC"
+@@ -5921,7 +5947,7 @@ then
+ # function available.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts
-pthread" >&5
+ $as_echo_n "checking whether $CC accepts -pthread... " >&6; }
+-if test "${ac_cv_thread+set}" = set; then :
++if ${ac_cv_thread+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_save_cc="$CC"
+@@ -6006,7 +6032,7 @@ CXX="$ac_save_cxx"
+ # checks for header files
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files"
>&5
+ $as_echo_n "checking for ANSI C header files... " >&6; }
+-if test "${ac_cv_header_stdc+set}" = set; then :
++if ${ac_cv_header_stdc+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -6145,7 +6171,7 @@ for ac_hdr in dirent.h sys/ndir.h sys/di
+ as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines
DIR" >&5
+ $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; }
+-if eval "test \"\${$as_ac_Header+set}\"" = set; then :
++if eval \${$as_ac_Header+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -6185,7 +6211,7 @@ done
+ if test $ac_header_dirent = dirent.h; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing
opendir" >&5
+ $as_echo_n "checking for library containing opendir... " >&6; }
+-if test "${ac_cv_search_opendir+set}" = set; then :
++if ${ac_cv_search_opendir+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_func_search_save_LIBS=$LIBS
+@@ -6219,11 +6245,11 @@ for ac_lib in '' dir; do
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+- if test "${ac_cv_search_opendir+set}" = set; then :
++ if ${ac_cv_search_opendir+:} false; then :
+ break
+ fi
+ done
+-if test "${ac_cv_search_opendir+set}" = set; then :
++if ${ac_cv_search_opendir+:} false; then :
+
+ else
+ ac_cv_search_opendir=no
+@@ -6242,7 +6268,7 @@ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing
opendir" >&5
+ $as_echo_n "checking for library containing opendir... " >&6; }
+-if test "${ac_cv_search_opendir+set}" = set; then :
++if ${ac_cv_search_opendir+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_func_search_save_LIBS=$LIBS
+@@ -6276,11 +6302,11 @@ for ac_lib in '' x; do
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+- if test "${ac_cv_search_opendir+set}" = set; then :
++ if ${ac_cv_search_opendir+:} false; then :
+ break
+ fi
+ done
+-if test "${ac_cv_search_opendir+set}" = set; then :
++if ${ac_cv_search_opendir+:} false; then :
+
+ else
+ ac_cv_search_opendir=no
+@@ -6300,7 +6326,7 @@ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sys/types.h defines
makedev" >&5
+ $as_echo_n "checking whether sys/types.h defines makedev... " >&6; }
+-if test "${ac_cv_header_sys_types_h_makedev+set}" = set; then :
++if ${ac_cv_header_sys_types_h_makedev+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -6328,7 +6354,7 @@ $as_echo "$ac_cv_header_sys_types_h_make
+
+ if test $ac_cv_header_sys_types_h_makedev = no; then
+ ac_fn_c_check_header_mongrel "$LINENO" "sys/mkdev.h"
"ac_cv_header_sys_mkdev_h" "$ac_includes_default"
+-if test "x$ac_cv_header_sys_mkdev_h" = x""yes; then :
++if test "x$ac_cv_header_sys_mkdev_h" = xyes; then :
+
+ $as_echo "#define MAJOR_IN_MKDEV 1" >>confdefs.h
+
+@@ -6338,7 +6364,7 @@ fi
+
+ if test $ac_cv_header_sys_mkdev_h = no; then
+ ac_fn_c_check_header_mongrel "$LINENO" "sys/sysmacros.h"
"ac_cv_header_sys_sysmacros_h" "$ac_includes_default"
+-if test "x$ac_cv_header_sys_sysmacros_h" = x""yes; then :
++if test "x$ac_cv_header_sys_sysmacros_h" = xyes; then :
+
+ $as_echo "#define MAJOR_IN_SYSMACROS 1" >>confdefs.h
+
+@@ -6358,7 +6384,7 @@ do :
+ #endif
+
+ "
+-if test "x$ac_cv_header_term_h" = x""yes; then :
++if test "x$ac_cv_header_term_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_TERM_H 1
+ _ACEOF
+@@ -6380,7 +6406,7 @@ do :
+ #endif
+
+ "
+-if test "x$ac_cv_header_linux_netlink_h" = x""yes; then :
++if test "x$ac_cv_header_linux_netlink_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_LINUX_NETLINK_H 1
+ _ACEOF
+@@ -6543,7 +6569,7 @@ EOF
+
+ # Type availability checks
+ ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t"
"$ac_includes_default"
+-if test "x$ac_cv_type_mode_t" = x""yes; then :
++if test "x$ac_cv_type_mode_t" = xyes; then :
+
+ else
+
+@@ -6554,7 +6580,7 @@ _ACEOF
+ fi
+
+ ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t"
"$ac_includes_default"
+-if test "x$ac_cv_type_off_t" = x""yes; then :
++if test "x$ac_cv_type_off_t" = xyes; then :
+
+ else
+
+@@ -6565,7 +6591,7 @@ _ACEOF
+ fi
+
+ ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t"
"$ac_includes_default"
+-if test "x$ac_cv_type_pid_t" = x""yes; then :
++if test "x$ac_cv_type_pid_t" = xyes; then :
+
+ else
+
+@@ -6581,7 +6607,7 @@ cat >>confdefs.h <<_ACEOF
+ _ACEOF
+
+ ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t"
"$ac_includes_default"
+-if test "x$ac_cv_type_size_t" = x""yes; then :
++if test "x$ac_cv_type_size_t" = xyes; then :
+
+ else
+
+@@ -6593,7 +6619,7 @@ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h"
>&5
+ $as_echo_n "checking for uid_t in sys/types.h... " >&6; }
+-if test "${ac_cv_type_uid_t+set}" = set; then :
++if ${ac_cv_type_uid_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -6672,7 +6698,7 @@ _ACEOF
+ esac
+
+ ac_fn_c_check_type "$LINENO" "ssize_t"
"ac_cv_type_ssize_t" "$ac_includes_default"
+-if test "x$ac_cv_type_ssize_t" = x""yes; then :
++if test "x$ac_cv_type_ssize_t" = xyes; then :
+
+ $as_echo "#define HAVE_SSIZE_T 1" >>confdefs.h
+
+@@ -6687,7 +6713,7 @@ fi
+ # This bug is HP SR number 8606223364.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5
+ $as_echo_n "checking size of int... " >&6; }
+-if test "${ac_cv_sizeof_int+set}" = set; then :
++if ${ac_cv_sizeof_int+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))"
"ac_cv_sizeof_int" "$ac_includes_default"; then :
+@@ -6697,7 +6723,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "cannot compute sizeof (int)
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_int=0
+ fi
+@@ -6720,7 +6746,7 @@ _ACEOF
+ # This bug is HP SR number 8606223364.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
+ $as_echo_n "checking size of long... " >&6; }
+-if test "${ac_cv_sizeof_long+set}" = set; then :
++if ${ac_cv_sizeof_long+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))"
"ac_cv_sizeof_long" "$ac_includes_default"; then :
+@@ -6730,7 +6756,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "cannot compute sizeof (long)
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_long=0
+ fi
+@@ -6753,7 +6779,7 @@ _ACEOF
+ # This bug is HP SR number 8606223364.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5
+ $as_echo_n "checking size of void *... " >&6; }
+-if test "${ac_cv_sizeof_void_p+set}" = set; then :
++if ${ac_cv_sizeof_void_p+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))"
"ac_cv_sizeof_void_p" "$ac_includes_default"; then :
+@@ -6763,7 +6789,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "cannot compute sizeof (void *)
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_void_p=0
+ fi
+@@ -6786,7 +6812,7 @@ _ACEOF
+ # This bug is HP SR number 8606223364.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5
+ $as_echo_n "checking size of short... " >&6; }
+-if test "${ac_cv_sizeof_short+set}" = set; then :
++if ${ac_cv_sizeof_short+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))"
"ac_cv_sizeof_short" "$ac_includes_default"; then :
+@@ -6796,7 +6822,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "cannot compute sizeof (short)
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_short=0
+ fi
+@@ -6819,7 +6845,7 @@ _ACEOF
+ # This bug is HP SR number 8606223364.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of float" >&5
+ $as_echo_n "checking size of float... " >&6; }
+-if test "${ac_cv_sizeof_float+set}" = set; then :
++if ${ac_cv_sizeof_float+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (float))"
"ac_cv_sizeof_float" "$ac_includes_default"; then :
+@@ -6829,7 +6855,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "cannot compute sizeof (float)
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_float=0
+ fi
+@@ -6852,7 +6878,7 @@ _ACEOF
+ # This bug is HP SR number 8606223364.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of double" >&5
+ $as_echo_n "checking size of double... " >&6; }
+-if test "${ac_cv_sizeof_double+set}" = set; then :
++if ${ac_cv_sizeof_double+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (double))"
"ac_cv_sizeof_double" "$ac_includes_default"; then :
+@@ -6862,7 +6888,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "cannot compute sizeof (double)
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_double=0
+ fi
+@@ -6885,7 +6911,7 @@ _ACEOF
+ # This bug is HP SR number 8606223364.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of fpos_t" >&5
+ $as_echo_n "checking size of fpos_t... " >&6; }
+-if test "${ac_cv_sizeof_fpos_t+set}" = set; then :
++if ${ac_cv_sizeof_fpos_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (fpos_t))"
"ac_cv_sizeof_fpos_t" "$ac_includes_default"; then :
+@@ -6895,7 +6921,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "cannot compute sizeof (fpos_t)
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_fpos_t=0
+ fi
+@@ -6918,7 +6944,7 @@ _ACEOF
+ # This bug is HP SR number 8606223364.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5
+ $as_echo_n "checking size of size_t... " >&6; }
+-if test "${ac_cv_sizeof_size_t+set}" = set; then :
++if ${ac_cv_sizeof_size_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))"
"ac_cv_sizeof_size_t" "$ac_includes_default"; then :
+@@ -6928,7 +6954,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "cannot compute sizeof (size_t)
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_size_t=0
+ fi
+@@ -6951,7 +6977,7 @@ _ACEOF
+ # This bug is HP SR number 8606223364.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of pid_t" >&5
+ $as_echo_n "checking size of pid_t... " >&6; }
+-if test "${ac_cv_sizeof_pid_t+set}" = set; then :
++if ${ac_cv_sizeof_pid_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pid_t))"
"ac_cv_sizeof_pid_t" "$ac_includes_default"; then :
+@@ -6961,7 +6987,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "cannot compute sizeof (pid_t)
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_pid_t=0
+ fi
+@@ -7011,7 +7037,7 @@ if test "$have_long_long" = yes ; then
+ # This bug is HP SR number 8606223364.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long"
>&5
+ $as_echo_n "checking size of long long... " >&6; }
+-if test "${ac_cv_sizeof_long_long+set}" = set; then :
++if ${ac_cv_sizeof_long_long+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))"
"ac_cv_sizeof_long_long" "$ac_includes_default"; then :
+@@ -7021,7 +7047,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "cannot compute sizeof (long long)
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_long_long=0
+ fi
+@@ -7072,7 +7098,7 @@ if test "$have_long_double" = yes ; then
+ # This bug is HP SR number 8606223364.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long double"
>&5
+ $as_echo_n "checking size of long double... " >&6; }
+-if test "${ac_cv_sizeof_long_double+set}" = set; then :
++if ${ac_cv_sizeof_long_double+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long
double))" "ac_cv_sizeof_long_double"
"$ac_includes_default"; then :
+@@ -7082,7 +7108,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "cannot compute sizeof (long double)
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_long_double=0
+ fi
+@@ -7133,7 +7159,7 @@ if test "$have_c99_bool" = yes ; then
+ # This bug is HP SR number 8606223364.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of _Bool" >&5
+ $as_echo_n "checking size of _Bool... " >&6; }
+-if test "${ac_cv_sizeof__Bool+set}" = set; then :
++if ${ac_cv_sizeof__Bool+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (_Bool))"
"ac_cv_sizeof__Bool" "$ac_includes_default"; then :
+@@ -7143,7 +7169,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "cannot compute sizeof (_Bool)
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof__Bool=0
+ fi
+@@ -7169,7 +7195,7 @@ ac_fn_c_check_type "$LINENO" "uintptr_t"
+ #include <inttypes.h>
+ #endif
+ "
+-if test "x$ac_cv_type_uintptr_t" = x""yes; then :
++if test "x$ac_cv_type_uintptr_t" = xyes; then :
+
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_UINTPTR_T 1
+@@ -7181,7 +7207,7 @@ _ACEOF
+ # This bug is HP SR number 8606223364.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of uintptr_t"
>&5
+ $as_echo_n "checking size of uintptr_t... " >&6; }
+-if test "${ac_cv_sizeof_uintptr_t+set}" = set; then :
++if ${ac_cv_sizeof_uintptr_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (uintptr_t))"
"ac_cv_sizeof_uintptr_t" "$ac_includes_default"; then :
+@@ -7191,7 +7217,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "cannot compute sizeof (uintptr_t)
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_uintptr_t=0
+ fi
+@@ -7217,7 +7243,7 @@ fi
+ # This bug is HP SR number 8606223364.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5
+ $as_echo_n "checking size of off_t... " >&6; }
+-if test "${ac_cv_sizeof_off_t+set}" = set; then :
++if ${ac_cv_sizeof_off_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))"
"ac_cv_sizeof_off_t" "
+@@ -7232,7 +7258,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "cannot compute sizeof (off_t)
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_off_t=0
+ fi
+@@ -7276,7 +7302,7 @@ fi
+ # This bug is HP SR number 8606223364.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of time_t" >&5
+ $as_echo_n "checking size of time_t... " >&6; }
+-if test "${ac_cv_sizeof_time_t+set}" = set; then :
++if ${ac_cv_sizeof_time_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (time_t))"
"ac_cv_sizeof_time_t" "
+@@ -7294,7 +7320,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "cannot compute sizeof (time_t)
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_time_t=0
+ fi
+@@ -7350,7 +7376,7 @@ if test "$have_pthread_t" = yes ; then
+ # This bug is HP SR number 8606223364.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of pthread_t"
>&5
+ $as_echo_n "checking size of pthread_t... " >&6; }
+-if test "${ac_cv_sizeof_pthread_t+set}" = set; then :
++if ${ac_cv_sizeof_pthread_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pthread_t))"
"ac_cv_sizeof_pthread_t" "
+@@ -7365,7 +7391,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "cannot compute sizeof (pthread_t)
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_pthread_t=0
+ fi
+@@ -7877,7 +7903,7 @@ $as_echo "$SHLIBS" >&6; }
+ # checks for libraries
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl"
>&5
+ $as_echo_n "checking for dlopen in -ldl... " >&6; }
+-if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
++if ${ac_cv_lib_dl_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -7911,7 +7937,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen"
>&5
+ $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+-if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
++if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_LIBDL 1
+ _ACEOF
+@@ -7922,7 +7948,7 @@ fi
+ # Dynamic linking for SunOS/Solaris and SYSV
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld"
>&5
+ $as_echo_n "checking for shl_load in -ldld... " >&6; }
+-if test "${ac_cv_lib_dld_shl_load+set}" = set; then :
++if ${ac_cv_lib_dld_shl_load+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -7956,7 +7982,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load"
>&5
+ $as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+-if test "x$ac_cv_lib_dld_shl_load" = x""yes; then :
++if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_LIBDLD 1
+ _ACEOF
+@@ -7970,7 +7996,7 @@ fi
+ if test "$with_threads" = "yes" -o -z "$with_threads";
then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing
sem_init" >&5
+ $as_echo_n "checking for library containing sem_init... " >&6; }
+-if test "${ac_cv_search_sem_init+set}" = set; then :
++if ${ac_cv_search_sem_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_func_search_save_LIBS=$LIBS
+@@ -8004,11 +8030,11 @@ for ac_lib in '' pthread rt posix4; do
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+- if test "${ac_cv_search_sem_init+set}" = set; then :
++ if ${ac_cv_search_sem_init+:} false; then :
+ break
+ fi
+ done
+-if test "${ac_cv_search_sem_init+set}" = set; then :
++if ${ac_cv_search_sem_init+:} false; then :
+
+ else
+ ac_cv_search_sem_init=no
+@@ -8031,7 +8057,7 @@ fi
+ # check if we need libintl for locale functions
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for textdomain in -lintl"
>&5
+ $as_echo_n "checking for textdomain in -lintl... " >&6; }
+-if test "${ac_cv_lib_intl_textdomain+set}" = set; then :
++if ${ac_cv_lib_intl_textdomain+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -8065,7 +8091,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_textdomain"
>&5
+ $as_echo "$ac_cv_lib_intl_textdomain" >&6; }
+-if test "x$ac_cv_lib_intl_textdomain" = x""yes; then :
++if test "x$ac_cv_lib_intl_textdomain" = xyes; then :
+
+ $as_echo "#define WITH_LIBINTL 1" >>confdefs.h
+
+@@ -8112,7 +8138,7 @@ esac
+ # BeOS' sockets are stashed in libnet.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for t_open in -lnsl"
>&5
+ $as_echo_n "checking for t_open in -lnsl... " >&6; }
+-if test "${ac_cv_lib_nsl_t_open+set}" = set; then :
++if ${ac_cv_lib_nsl_t_open+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -8146,13 +8172,13 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_t_open"
>&5
+ $as_echo "$ac_cv_lib_nsl_t_open" >&6; }
+-if test "x$ac_cv_lib_nsl_t_open" = x""yes; then :
++if test "x$ac_cv_lib_nsl_t_open" = xyes; then :
+ LIBS="-lnsl $LIBS"
+ fi
+ # SVR4
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket"
>&5
+ $as_echo_n "checking for socket in -lsocket... " >&6; }
+-if test "${ac_cv_lib_socket_socket+set}" = set; then :
++if ${ac_cv_lib_socket_socket+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -8186,7 +8212,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket"
>&5
+ $as_echo "$ac_cv_lib_socket_socket" >&6; }
+-if test "x$ac_cv_lib_socket_socket" = x""yes; then :
++if test "x$ac_cv_lib_socket_socket" = xyes; then :
+ LIBS="-lsocket $LIBS"
+ fi
+ # SVR4 sockets
+@@ -8195,7 +8221,7 @@ case "$ac_sys_system" in
+ BeOS*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lnet"
>&5
+ $as_echo_n "checking for socket in -lnet... " >&6; }
+-if test "${ac_cv_lib_net_socket+set}" = set; then :
++if ${ac_cv_lib_net_socket+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -8229,7 +8255,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_net_socket"
>&5
+ $as_echo "$ac_cv_lib_net_socket" >&6; }
+-if test "x$ac_cv_lib_net_socket" = x""yes; then :
++if test "x$ac_cv_lib_net_socket" = xyes; then :
+ LIBS="-lnet $LIBS"
+ fi
+ # BeOS
+@@ -8257,7 +8283,7 @@ if test -n "$ac_tool_prefix"; then
+ set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
++if ${ac_cv_path_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ case $PKG_CONFIG in
+@@ -8300,7 +8326,7 @@ if test -z "$ac_cv_path_PKG_CONFIG"; the
+ set dummy pkg-config; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
++if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ case $ac_pt_PKG_CONFIG in
+@@ -8568,7 +8594,7 @@ $as_echo "$unistd_defines_pthreads" >&6;
+ $as_echo "#define _REENTRANT 1" >>confdefs.h
+
+ ac_fn_c_check_header_mongrel "$LINENO" "cthreads.h"
"ac_cv_header_cthreads_h" "$ac_includes_default"
+-if test "x$ac_cv_header_cthreads_h" = x""yes; then :
++if test "x$ac_cv_header_cthreads_h" = xyes; then :
+ $as_echo "#define WITH_THREAD 1" >>confdefs.h
+
+ $as_echo "#define C_THREADS 1" >>confdefs.h
+@@ -8581,7 +8607,7 @@ $as_echo "#define HURD_C_THREADS 1" >>co
+ else
+
+ ac_fn_c_check_header_mongrel "$LINENO" "mach/cthreads.h"
"ac_cv_header_mach_cthreads_h" "$ac_includes_default"
+-if test "x$ac_cv_header_mach_cthreads_h" = x""yes; then :
++if test "x$ac_cv_header_mach_cthreads_h" = xyes; then :
+ $as_echo "#define WITH_THREAD 1" >>confdefs.h
+
+ $as_echo "#define C_THREADS 1" >>confdefs.h
+@@ -8643,7 +8669,7 @@ else
+
+ LIBS=$_libs
+ ac_fn_c_check_func "$LINENO" "pthread_detach"
"ac_cv_func_pthread_detach"
+-if test "x$ac_cv_func_pthread_detach" = x""yes; then :
++if test "x$ac_cv_func_pthread_detach" = xyes; then :
+ $as_echo "#define WITH_THREAD 1" >>confdefs.h
+
+ posix_threads=yes
+@@ -8651,7 +8677,7 @@ if test "x$ac_cv_func_pthread_detach" =
+ else
+
+ ac_fn_c_check_header_mongrel "$LINENO" "atheos/threads.h"
"ac_cv_header_atheos_threads_h" "$ac_includes_default"
+-if test "x$ac_cv_header_atheos_threads_h" = x""yes; then :
++if test "x$ac_cv_header_atheos_threads_h" = xyes; then :
+ $as_echo "#define WITH_THREAD 1" >>confdefs.h
+
+
+@@ -8661,7 +8687,7 @@ $as_echo "#define ATHEOS_THREADS 1" >>co
+ else
+
+ ac_fn_c_check_header_mongrel "$LINENO" "kernel/OS.h"
"ac_cv_header_kernel_OS_h" "$ac_includes_default"
+-if test "x$ac_cv_header_kernel_OS_h" = x""yes; then :
++if test "x$ac_cv_header_kernel_OS_h" = xyes; then :
+ $as_echo "#define WITH_THREAD 1" >>confdefs.h
+
+
+@@ -8672,7 +8698,7 @@ else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in
-lpthreads" >&5
+ $as_echo_n "checking for pthread_create in -lpthreads... " >&6; }
+-if test "${ac_cv_lib_pthreads_pthread_create+set}" = set; then :
++if ${ac_cv_lib_pthreads_pthread_create+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -8706,7 +8732,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_pthreads_pthread_create" >&5
+ $as_echo "$ac_cv_lib_pthreads_pthread_create" >&6; }
+-if test "x$ac_cv_lib_pthreads_pthread_create" = x""yes; then :
++if test "x$ac_cv_lib_pthreads_pthread_create" = xyes; then :
+ $as_echo "#define WITH_THREAD 1" >>confdefs.h
+
+ posix_threads=yes
+@@ -8716,7 +8742,7 @@ else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in
-lc_r" >&5
+ $as_echo_n "checking for pthread_create in -lc_r... " >&6; }
+-if test "${ac_cv_lib_c_r_pthread_create+set}" = set; then :
++if ${ac_cv_lib_c_r_pthread_create+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -8750,7 +8776,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_c_r_pthread_create" >&5
+ $as_echo "$ac_cv_lib_c_r_pthread_create" >&6; }
+-if test "x$ac_cv_lib_c_r_pthread_create" = x""yes; then :
++if test "x$ac_cv_lib_c_r_pthread_create" = xyes; then :
+ $as_echo "#define WITH_THREAD 1" >>confdefs.h
+
+ posix_threads=yes
+@@ -8760,7 +8786,7 @@ else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __pthread_create_system
in -lpthread" >&5
+ $as_echo_n "checking for __pthread_create_system in -lpthread... " >&6;
}
+-if test "${ac_cv_lib_pthread___pthread_create_system+set}" = set; then :
++if ${ac_cv_lib_pthread___pthread_create_system+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -8794,7 +8820,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_pthread___pthread_create_system" >&5
+ $as_echo "$ac_cv_lib_pthread___pthread_create_system" >&6; }
+-if test "x$ac_cv_lib_pthread___pthread_create_system" = x""yes; then
:
++if test "x$ac_cv_lib_pthread___pthread_create_system" = xyes; then :
+ $as_echo "#define WITH_THREAD 1" >>confdefs.h
+
+ posix_threads=yes
+@@ -8804,7 +8830,7 @@ else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in
-lcma" >&5
+ $as_echo_n "checking for pthread_create in -lcma... " >&6; }
+-if test "${ac_cv_lib_cma_pthread_create+set}" = set; then :
++if ${ac_cv_lib_cma_pthread_create+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -8838,7 +8864,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_cma_pthread_create" >&5
+ $as_echo "$ac_cv_lib_cma_pthread_create" >&6; }
+-if test "x$ac_cv_lib_cma_pthread_create" = x""yes; then :
++if test "x$ac_cv_lib_cma_pthread_create" = xyes; then :
+ $as_echo "#define WITH_THREAD 1" >>confdefs.h
+
+ posix_threads=yes
+@@ -8878,7 +8904,7 @@ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for usconfig in -lmpc"
>&5
+ $as_echo_n "checking for usconfig in -lmpc... " >&6; }
+-if test "${ac_cv_lib_mpc_usconfig+set}" = set; then :
++if ${ac_cv_lib_mpc_usconfig+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -8912,7 +8938,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mpc_usconfig"
>&5
+ $as_echo "$ac_cv_lib_mpc_usconfig" >&6; }
+-if test "x$ac_cv_lib_mpc_usconfig" = x""yes; then :
++if test "x$ac_cv_lib_mpc_usconfig" = xyes; then :
+ $as_echo "#define WITH_THREAD 1" >>confdefs.h
+
+ LIBS="$LIBS -lmpc"
+@@ -8924,7 +8950,7 @@ fi
+ if test "$posix_threads" != "yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thr_create in
-lthread" >&5
+ $as_echo_n "checking for thr_create in -lthread... " >&6; }
+-if test "${ac_cv_lib_thread_thr_create+set}" = set; then :
++if ${ac_cv_lib_thread_thr_create+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -8958,7 +8984,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_thread_thr_create"
>&5
+ $as_echo "$ac_cv_lib_thread_thr_create" >&6; }
+-if test "x$ac_cv_lib_thread_thr_create" = x""yes; then :
++if test "x$ac_cv_lib_thread_thr_create" = xyes; then :
+ $as_echo "#define WITH_THREAD 1" >>confdefs.h
+
+ LIBS="$LIBS -lthread"
+@@ -9003,7 +9029,7 @@ $as_echo "#define HAVE_BROKEN_POSIX_SEMA
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if PTHREAD_SCOPE_SYSTEM is
supported" >&5
+ $as_echo_n "checking if PTHREAD_SCOPE_SYSTEM is supported... " >&6; }
+- if test "${ac_cv_pthread_system_supported+set}" = set; then :
++ if ${ac_cv_pthread_system_supported+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test "$cross_compiling" = yes; then :
+@@ -9046,7 +9072,7 @@ $as_echo "#define PTHREAD_SYSTEM_SCHED_S
+ for ac_func in pthread_sigmask
+ do :
+ ac_fn_c_check_func "$LINENO" "pthread_sigmask"
"ac_cv_func_pthread_sigmask"
+-if test "x$ac_cv_func_pthread_sigmask" = x""yes; then :
++if test "x$ac_cv_func_pthread_sigmask" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_PTHREAD_SIGMASK 1
+ _ACEOF
+@@ -9399,6 +9425,50 @@ $as_echo "no" >&6; }
fi
@@ -148,7 +1533,16 @@ diff -up ./configure.autotool-intermediates ./configure
# Check for Python-specific malloc support
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-pymalloc"
>&5
$as_echo_n "checking for --with-pymalloc... " >&6; }
-@@ -9452,6 +9515,46 @@ fi
+@@ -9436,7 +9506,7 @@ fi
+ $as_echo "$with_valgrind" >&6; }
+ if test "$with_valgrind" != no; then
+ ac_fn_c_check_header_mongrel "$LINENO" "valgrind/valgrind.h"
"ac_cv_header_valgrind_valgrind_h" "$ac_includes_default"
+-if test "x$ac_cv_header_valgrind_valgrind_h" = x""yes; then :
++if test "x$ac_cv_header_valgrind_valgrind_h" = xyes; then :
+
+ $as_echo "#define WITH_VALGRIND 1" >>confdefs.h
+
+@@ -9448,6 +9518,46 @@ fi
fi
@@ -195,9 +1589,1109 @@ diff -up ./configure.autotool-intermediates ./configure
# Check for --with-wctype-functions
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-wctype-functions"
>&5
$as_echo_n "checking for --with-wctype-functions... " >&6; }
+@@ -9480,7 +9590,7 @@ DLINCLDIR=.
+ for ac_func in dlopen
+ do :
+ ac_fn_c_check_func "$LINENO" "dlopen"
"ac_cv_func_dlopen"
+-if test "x$ac_cv_func_dlopen" = x""yes; then :
++if test "x$ac_cv_func_dlopen" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_DLOPEN 1
+ _ACEOF
+@@ -9810,7 +9920,7 @@ rm -f core conftest.err conftest.$ac_obj
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flock declaration"
>&5
+ $as_echo_n "checking for flock declaration... " >&6; }
+-if test "${ac_cv_flock_decl+set}" = set; then :
++if ${ac_cv_flock_decl+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -9840,7 +9950,7 @@ if test "x${ac_cv_flock_decl}" = xyes; t
+ for ac_func in flock
+ do :
+ ac_fn_c_check_func "$LINENO" "flock" "ac_cv_func_flock"
+-if test "x$ac_cv_func_flock" = x""yes; then :
++if test "x$ac_cv_func_flock" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_FLOCK 1
+ _ACEOF
+@@ -9848,7 +9958,7 @@ _ACEOF
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flock in -lbsd"
>&5
+ $as_echo_n "checking for flock in -lbsd... " >&6; }
+-if test "${ac_cv_lib_bsd_flock+set}" = set; then :
++if ${ac_cv_lib_bsd_flock+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -9882,7 +9992,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_flock"
>&5
+ $as_echo "$ac_cv_lib_bsd_flock" >&6; }
+-if test "x$ac_cv_lib_bsd_flock" = x""yes; then :
++if test "x$ac_cv_lib_bsd_flock" = xyes; then :
+ $as_echo "#define HAVE_FLOCK 1" >>confdefs.h
+
+
+@@ -9959,7 +10069,7 @@ do
+ set dummy $ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+-if test "${ac_cv_prog_TRUE+set}" = set; then :
++if ${ac_cv_prog_TRUE+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test -n "$TRUE"; then
+@@ -9999,7 +10109,7 @@ test -n "$TRUE" || TRUE="/bin/true"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lc"
>&5
+ $as_echo_n "checking for inet_aton in -lc... " >&6; }
+-if test "${ac_cv_lib_c_inet_aton+set}" = set; then :
++if ${ac_cv_lib_c_inet_aton+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -10033,12 +10143,12 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_inet_aton"
>&5
+ $as_echo "$ac_cv_lib_c_inet_aton" >&6; }
+-if test "x$ac_cv_lib_c_inet_aton" = x""yes; then :
++if test "x$ac_cv_lib_c_inet_aton" = xyes; then :
+ $ac_cv_prog_TRUE
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lresolv"
>&5
+ $as_echo_n "checking for inet_aton in -lresolv... " >&6; }
+-if test "${ac_cv_lib_resolv_inet_aton+set}" = set; then :
++if ${ac_cv_lib_resolv_inet_aton+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -10072,7 +10182,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_inet_aton"
>&5
+ $as_echo "$ac_cv_lib_resolv_inet_aton" >&6; }
+-if test "x$ac_cv_lib_resolv_inet_aton" = x""yes; then :
++if test "x$ac_cv_lib_resolv_inet_aton" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_LIBRESOLV 1
+ _ACEOF
+@@ -10089,7 +10199,7 @@ fi
+ # exit Python
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for chflags" >&5
+ $as_echo_n "checking for chflags... " >&6; }
+-if test "${ac_cv_have_chflags+set}" = set; then :
++if ${ac_cv_have_chflags+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test "$cross_compiling" = yes; then :
+@@ -10123,7 +10233,7 @@ fi
+ $as_echo "$ac_cv_have_chflags" >&6; }
+ if test "$ac_cv_have_chflags" = cross ; then
+ ac_fn_c_check_func "$LINENO" "chflags"
"ac_cv_func_chflags"
+-if test "x$ac_cv_func_chflags" = x""yes; then :
++if test "x$ac_cv_func_chflags" = xyes; then :
+ ac_cv_have_chflags="yes"
+ else
+ ac_cv_have_chflags="no"
+@@ -10138,7 +10248,7 @@ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lchflags" >&5
+ $as_echo_n "checking for lchflags... " >&6; }
+-if test "${ac_cv_have_lchflags+set}" = set; then :
++if ${ac_cv_have_lchflags+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test "$cross_compiling" = yes; then :
+@@ -10172,7 +10282,7 @@ fi
+ $as_echo "$ac_cv_have_lchflags" >&6; }
+ if test "$ac_cv_have_lchflags" = cross ; then
+ ac_fn_c_check_func "$LINENO" "lchflags"
"ac_cv_func_lchflags"
+-if test "x$ac_cv_func_lchflags" = x""yes; then :
++if test "x$ac_cv_func_lchflags" = xyes; then :
+ ac_cv_have_lchflags="yes"
+ else
+ ac_cv_have_lchflags="no"
+@@ -10196,7 +10306,7 @@ esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateCopy in -lz"
>&5
+ $as_echo_n "checking for inflateCopy in -lz... " >&6; }
+-if test "${ac_cv_lib_z_inflateCopy+set}" = set; then :
++if ${ac_cv_lib_z_inflateCopy+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -10230,7 +10340,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflateCopy"
>&5
+ $as_echo "$ac_cv_lib_z_inflateCopy" >&6; }
+-if test "x$ac_cv_lib_z_inflateCopy" = x""yes; then :
++if test "x$ac_cv_lib_z_inflateCopy" = xyes; then :
+
+ $as_echo "#define HAVE_ZLIB_COPY 1" >>confdefs.h
+
+@@ -10373,7 +10483,7 @@ rm -f core conftest.err conftest.$ac_obj
+ for ac_func in openpty
+ do :
+ ac_fn_c_check_func "$LINENO" "openpty"
"ac_cv_func_openpty"
+-if test "x$ac_cv_func_openpty" = x""yes; then :
++if test "x$ac_cv_func_openpty" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_OPENPTY 1
+ _ACEOF
+@@ -10381,7 +10491,7 @@ _ACEOF
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openpty in -lutil"
>&5
+ $as_echo_n "checking for openpty in -lutil... " >&6; }
+-if test "${ac_cv_lib_util_openpty+set}" = set; then :
++if ${ac_cv_lib_util_openpty+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -10415,13 +10525,13 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_openpty"
>&5
+ $as_echo "$ac_cv_lib_util_openpty" >&6; }
+-if test "x$ac_cv_lib_util_openpty" = x""yes; then :
++if test "x$ac_cv_lib_util_openpty" = xyes; then :
+ $as_echo "#define HAVE_OPENPTY 1" >>confdefs.h
+ LIBS="$LIBS -lutil"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openpty in -lbsd"
>&5
+ $as_echo_n "checking for openpty in -lbsd... " >&6; }
+-if test "${ac_cv_lib_bsd_openpty+set}" = set; then :
++if ${ac_cv_lib_bsd_openpty+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -10455,7 +10565,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_openpty"
>&5
+ $as_echo "$ac_cv_lib_bsd_openpty" >&6; }
+-if test "x$ac_cv_lib_bsd_openpty" = x""yes; then :
++if test "x$ac_cv_lib_bsd_openpty" = xyes; then :
+ $as_echo "#define HAVE_OPENPTY 1" >>confdefs.h
+ LIBS="$LIBS -lbsd"
+ fi
+@@ -10470,7 +10580,7 @@ done
+ for ac_func in forkpty
+ do :
+ ac_fn_c_check_func "$LINENO" "forkpty"
"ac_cv_func_forkpty"
+-if test "x$ac_cv_func_forkpty" = x""yes; then :
++if test "x$ac_cv_func_forkpty" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_FORKPTY 1
+ _ACEOF
+@@ -10478,7 +10588,7 @@ _ACEOF
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for forkpty in -lutil"
>&5
+ $as_echo_n "checking for forkpty in -lutil... " >&6; }
+-if test "${ac_cv_lib_util_forkpty+set}" = set; then :
++if ${ac_cv_lib_util_forkpty+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -10512,13 +10622,13 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_forkpty"
>&5
+ $as_echo "$ac_cv_lib_util_forkpty" >&6; }
+-if test "x$ac_cv_lib_util_forkpty" = x""yes; then :
++if test "x$ac_cv_lib_util_forkpty" = xyes; then :
+ $as_echo "#define HAVE_FORKPTY 1" >>confdefs.h
+ LIBS="$LIBS -lutil"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for forkpty in -lbsd"
>&5
+ $as_echo_n "checking for forkpty in -lbsd... " >&6; }
+-if test "${ac_cv_lib_bsd_forkpty+set}" = set; then :
++if ${ac_cv_lib_bsd_forkpty+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -10552,7 +10662,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_forkpty"
>&5
+ $as_echo "$ac_cv_lib_bsd_forkpty" >&6; }
+-if test "x$ac_cv_lib_bsd_forkpty" = x""yes; then :
++if test "x$ac_cv_lib_bsd_forkpty" = xyes; then :
+ $as_echo "#define HAVE_FORKPTY 1" >>confdefs.h
+ LIBS="$LIBS -lbsd"
+ fi
+@@ -10569,7 +10679,7 @@ done
+ for ac_func in memmove
+ do :
+ ac_fn_c_check_func "$LINENO" "memmove"
"ac_cv_func_memmove"
+-if test "x$ac_cv_func_memmove" = x""yes; then :
++if test "x$ac_cv_func_memmove" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_MEMMOVE 1
+ _ACEOF
+@@ -10593,7 +10703,7 @@ done
+
+
+ ac_fn_c_check_func "$LINENO" "dup2" "ac_cv_func_dup2"
+-if test "x$ac_cv_func_dup2" = x""yes; then :
++if test "x$ac_cv_func_dup2" = xyes; then :
+ $as_echo "#define HAVE_DUP2 1" >>confdefs.h
+
+ else
+@@ -10606,7 +10716,7 @@ esac
+ fi
+
+ ac_fn_c_check_func "$LINENO" "getcwd" "ac_cv_func_getcwd"
+-if test "x$ac_cv_func_getcwd" = x""yes; then :
++if test "x$ac_cv_func_getcwd" = xyes; then :
+ $as_echo "#define HAVE_GETCWD 1" >>confdefs.h
+
+ else
+@@ -10619,7 +10729,7 @@ esac
+ fi
+
+ ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup"
+-if test "x$ac_cv_func_strdup" = x""yes; then :
++if test "x$ac_cv_func_strdup" = xyes; then :
+ $as_echo "#define HAVE_STRDUP 1" >>confdefs.h
+
+ else
+@@ -10635,7 +10745,7 @@ fi
+ for ac_func in getpgrp
+ do :
+ ac_fn_c_check_func "$LINENO" "getpgrp"
"ac_cv_func_getpgrp"
+-if test "x$ac_cv_func_getpgrp" = x""yes; then :
++if test "x$ac_cv_func_getpgrp" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_GETPGRP 1
+ _ACEOF
+@@ -10663,7 +10773,7 @@ done
+ for ac_func in setpgrp
+ do :
+ ac_fn_c_check_func "$LINENO" "setpgrp"
"ac_cv_func_setpgrp"
+-if test "x$ac_cv_func_setpgrp" = x""yes; then :
++if test "x$ac_cv_func_setpgrp" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_SETPGRP 1
+ _ACEOF
+@@ -10691,7 +10801,7 @@ done
+ for ac_func in gettimeofday
+ do :
+ ac_fn_c_check_func "$LINENO" "gettimeofday"
"ac_cv_func_gettimeofday"
+-if test "x$ac_cv_func_gettimeofday" = x""yes; then :
++if test "x$ac_cv_func_gettimeofday" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_GETTIMEOFDAY 1
+ _ACEOF
+@@ -10793,7 +10903,7 @@ if test $have_getaddrinfo = yes
+ then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking getaddrinfo bug"
>&5
+ $as_echo_n "checking getaddrinfo bug... " >&6; }
+- if test "${ac_cv_buggy_getaddrinfo+set}" = set; then :
++ if ${ac_cv_buggy_getaddrinfo+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test "$cross_compiling" = yes; then :
+@@ -10922,7 +11032,7 @@ fi
+ for ac_func in getnameinfo
+ do :
+ ac_fn_c_check_func "$LINENO" "getnameinfo"
"ac_cv_func_getnameinfo"
+-if test "x$ac_cv_func_getnameinfo" = x""yes; then :
++if test "x$ac_cv_func_getnameinfo" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_GETNAMEINFO 1
+ _ACEOF
+@@ -10934,7 +11044,7 @@ done
+ # checks for structures
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may
both be included" >&5
+ $as_echo_n "checking whether time.h and sys/time.h may both be included... "
>&6; }
+-if test "${ac_cv_header_time+set}" = set; then :
++if ${ac_cv_header_time+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -10969,7 +11079,7 @@ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in
sys/time.h or time.h" >&5
+ $as_echo_n "checking whether struct tm is in sys/time.h or time.h... "
>&6; }
+-if test "${ac_cv_struct_tm+set}" = set; then :
++if ${ac_cv_struct_tm+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -11006,7 +11116,7 @@ ac_fn_c_check_member "$LINENO" "struct t
+ #include <$ac_cv_struct_tm>
+
+ "
+-if test "x$ac_cv_member_struct_tm_tm_zone" = x""yes; then :
++if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then :
+
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_STRUCT_TM_TM_ZONE 1
+@@ -11022,7 +11132,7 @@ $as_echo "#define HAVE_TM_ZONE 1" >>conf
+ else
+ ac_fn_c_check_decl "$LINENO" "tzname"
"ac_cv_have_decl_tzname" "#include <time.h>
+ "
+-if test "x$ac_cv_have_decl_tzname" = x""yes; then :
++if test "x$ac_cv_have_decl_tzname" = xyes; then :
+ ac_have_decl=1
+ else
+ ac_have_decl=0
+@@ -11034,7 +11144,7 @@ _ACEOF
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5
+ $as_echo_n "checking for tzname... " >&6; }
+-if test "${ac_cv_var_tzname+set}" = set; then :
++if ${ac_cv_var_tzname+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -11070,7 +11180,7 @@ $as_echo "#define HAVE_TZNAME 1" >>confd
+ fi
+
+ ac_fn_c_check_member "$LINENO" "struct stat" "st_rdev"
"ac_cv_member_struct_stat_st_rdev" "$ac_includes_default"
+-if test "x$ac_cv_member_struct_stat_st_rdev" = x""yes; then :
++if test "x$ac_cv_member_struct_stat_st_rdev" = xyes; then :
+
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_STRUCT_STAT_ST_RDEV 1
+@@ -11080,7 +11190,7 @@ _ACEOF
+ fi
+
+ ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize"
"ac_cv_member_struct_stat_st_blksize" "$ac_includes_default"
+-if test "x$ac_cv_member_struct_stat_st_blksize" = x""yes; then :
++if test "x$ac_cv_member_struct_stat_st_blksize" = xyes; then :
+
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_STRUCT_STAT_ST_BLKSIZE 1
+@@ -11090,7 +11200,7 @@ _ACEOF
+ fi
+
+ ac_fn_c_check_member "$LINENO" "struct stat" "st_flags"
"ac_cv_member_struct_stat_st_flags" "$ac_includes_default"
+-if test "x$ac_cv_member_struct_stat_st_flags" = x""yes; then :
++if test "x$ac_cv_member_struct_stat_st_flags" = xyes; then :
+
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_STRUCT_STAT_ST_FLAGS 1
+@@ -11100,7 +11210,7 @@ _ACEOF
+ fi
+
+ ac_fn_c_check_member "$LINENO" "struct stat" "st_gen"
"ac_cv_member_struct_stat_st_gen" "$ac_includes_default"
+-if test "x$ac_cv_member_struct_stat_st_gen" = x""yes; then :
++if test "x$ac_cv_member_struct_stat_st_gen" = xyes; then :
+
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_STRUCT_STAT_ST_GEN 1
+@@ -11110,7 +11220,7 @@ _ACEOF
+ fi
+
+ ac_fn_c_check_member "$LINENO" "struct stat"
"st_birthtime" "ac_cv_member_struct_stat_st_birthtime"
"$ac_includes_default"
+-if test "x$ac_cv_member_struct_stat_st_birthtime" = x""yes; then :
++if test "x$ac_cv_member_struct_stat_st_birthtime" = xyes; then :
+
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_STRUCT_STAT_ST_BIRTHTIME 1
+@@ -11120,7 +11230,7 @@ _ACEOF
+ fi
+
+ ac_fn_c_check_member "$LINENO" "struct stat" "st_blocks"
"ac_cv_member_struct_stat_st_blocks" "$ac_includes_default"
+-if test "x$ac_cv_member_struct_stat_st_blocks" = x""yes; then :
++if test "x$ac_cv_member_struct_stat_st_blocks" = xyes; then :
+
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_STRUCT_STAT_ST_BLOCKS 1
+@@ -11142,7 +11252,7 @@ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for time.h that defines
altzone" >&5
+ $as_echo_n "checking for time.h that defines altzone... " >&6; }
+-if test "${ac_cv_header_time_altzone+set}" = set; then :
++if ${ac_cv_header_time_altzone+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+
+@@ -11206,7 +11316,7 @@ $as_echo "$was_it_defined" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for addrinfo" >&5
+ $as_echo_n "checking for addrinfo... " >&6; }
+-if test "${ac_cv_struct_addrinfo+set}" = set; then :
++if ${ac_cv_struct_addrinfo+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -11238,7 +11348,7 @@ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_storage"
>&5
+ $as_echo_n "checking for sockaddr_storage... " >&6; }
+-if test "${ac_cv_struct_sockaddr_storage+set}" = set; then :
++if ${ac_cv_struct_sockaddr_storage+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -11274,7 +11384,7 @@ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned"
>&5
+ $as_echo_n "checking whether char is unsigned... " >&6; }
+-if test "${ac_cv_c_char_unsigned+set}" = set; then :
++if ${ac_cv_c_char_unsigned+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -11306,7 +11416,7 @@ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming
const" >&5
+ $as_echo_n "checking for an ANSI C-conforming const... " >&6; }
+-if test "${ac_cv_c_const+set}" = set; then :
++if ${ac_cv_c_const+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -11594,7 +11704,7 @@ $as_echo "$va_list_is_array" >&6; }
+
+
+ ac_fn_c_check_func "$LINENO" "gethostbyname_r"
"ac_cv_func_gethostbyname_r"
+-if test "x$ac_cv_func_gethostbyname_r" = x""yes; then :
++if test "x$ac_cv_func_gethostbyname_r" = xyes; then :
+
+ $as_echo "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h
+
+@@ -11725,7 +11835,7 @@ else
+ for ac_func in gethostbyname
+ do :
+ ac_fn_c_check_func "$LINENO" "gethostbyname"
"ac_cv_func_gethostbyname"
+-if test "x$ac_cv_func_gethostbyname" = x""yes; then :
++if test "x$ac_cv_func_gethostbyname" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_GETHOSTBYNAME 1
+ _ACEOF
+@@ -11747,12 +11857,12 @@ fi
+
+ # Linux requires this for correct f.p. operations
+ ac_fn_c_check_func "$LINENO" "__fpu_control"
"ac_cv_func___fpu_control"
+-if test "x$ac_cv_func___fpu_control" = x""yes; then :
++if test "x$ac_cv_func___fpu_control" = xyes; then :
+
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __fpu_control in
-lieee" >&5
+ $as_echo_n "checking for __fpu_control in -lieee... " >&6; }
+-if test "${ac_cv_lib_ieee___fpu_control+set}" = set; then :
++if ${ac_cv_lib_ieee___fpu_control+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -11786,7 +11896,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_ieee___fpu_control" >&5
+ $as_echo "$ac_cv_lib_ieee___fpu_control" >&6; }
+-if test "x$ac_cv_lib_ieee___fpu_control" = x""yes; then :
++if test "x$ac_cv_lib_ieee___fpu_control" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_LIBIEEE 1
+ _ACEOF
+@@ -11881,7 +11991,7 @@ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C doubles are
little-endian IEEE 754 binary64" >&5
+ $as_echo_n "checking whether C doubles are little-endian IEEE 754 binary64...
" >&6; }
+-if test "${ac_cv_little_endian_double+set}" = set; then :
++if ${ac_cv_little_endian_double+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+
+@@ -11923,7 +12033,7 @@ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C doubles are big-endian
IEEE 754 binary64" >&5
+ $as_echo_n "checking whether C doubles are big-endian IEEE 754 binary64... "
>&6; }
+-if test "${ac_cv_big_endian_double+set}" = set; then :
++if ${ac_cv_big_endian_double+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+
+@@ -11969,7 +12079,7 @@ fi
+ # conversions work.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C doubles are ARM
mixed-endian IEEE 754 binary64" >&5
+ $as_echo_n "checking whether C doubles are ARM mixed-endian IEEE 754 binary64...
" >&6; }
+-if test "${ac_cv_mixed_endian_double+set}" = set; then :
++if ${ac_cv_mixed_endian_double+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+
+@@ -12117,7 +12227,7 @@ LIBS="$LIBS $LIBM"
+ # -0. on some architectures.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether tanh preserves the sign
of zero" >&5
+ $as_echo_n "checking whether tanh preserves the sign of zero... " >&6;
}
+-if test "${ac_cv_tanh_preserves_zero_sign+set}" = set; then :
++if ${ac_cv_tanh_preserves_zero_sign+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+
+@@ -12185,7 +12295,7 @@ done
+
+ ac_fn_c_check_decl "$LINENO" "isinf"
"ac_cv_have_decl_isinf" "#include <math.h>
+ "
+-if test "x$ac_cv_have_decl_isinf" = x""yes; then :
++if test "x$ac_cv_have_decl_isinf" = xyes; then :
+ ac_have_decl=1
+ else
+ ac_have_decl=0
+@@ -12196,7 +12306,7 @@ cat >>confdefs.h <<_ACEOF
+ _ACEOF
+ ac_fn_c_check_decl "$LINENO" "isnan"
"ac_cv_have_decl_isnan" "#include <math.h>
+ "
+-if test "x$ac_cv_have_decl_isnan" = x""yes; then :
++if test "x$ac_cv_have_decl_isnan" = xyes; then :
+ ac_have_decl=1
+ else
+ ac_have_decl=0
+@@ -12207,7 +12317,7 @@ cat >>confdefs.h <<_ACEOF
+ _ACEOF
+ ac_fn_c_check_decl "$LINENO" "isfinite"
"ac_cv_have_decl_isfinite" "#include <math.h>
+ "
+-if test "x$ac_cv_have_decl_isfinite" = x""yes; then :
++if test "x$ac_cv_have_decl_isfinite" = xyes; then :
+ ac_have_decl=1
+ else
+ ac_have_decl=0
+@@ -12227,7 +12337,7 @@ LIBS=$LIBS_SAVE
+ # sem_open results in a 'Signal 12' error.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX semaphores are
enabled" >&5
+ $as_echo_n "checking whether POSIX semaphores are enabled... " >&6; }
+-if test "${ac_cv_posix_semaphores_enabled+set}" = set; then :
++if ${ac_cv_posix_semaphores_enabled+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test "$cross_compiling" = yes; then :
+@@ -12278,7 +12388,7 @@ fi
+ # Multiprocessing check for broken sem_getvalue
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken sem_getvalue"
>&5
+ $as_echo_n "checking for broken sem_getvalue... " >&6; }
+-if test "${ac_cv_broken_sem_getvalue+set}" = set; then :
++if ${ac_cv_broken_sem_getvalue+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test "$cross_compiling" = yes; then :
+@@ -12343,7 +12453,7 @@ no)
+ 15|30)
+ ;;
+ *)
+- as_fn_error $? "bad value $enable_big_digits for --enable-big-digits; value
should be 15 or 30" "$LINENO" 5 ;;
++ as_fn_error $? "bad value $enable_big_digits for --enable-big-digits; value
should be 15 or 30" "$LINENO" 5 ;;
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_big_digits"
>&5
+ $as_echo "$enable_big_digits" >&6; }
+@@ -12361,7 +12471,7 @@ fi
+
+ # check for wchar.h
+ ac_fn_c_check_header_mongrel "$LINENO" "wchar.h"
"ac_cv_header_wchar_h" "$ac_includes_default"
+-if test "x$ac_cv_header_wchar_h" = x""yes; then :
++if test "x$ac_cv_header_wchar_h" = xyes; then :
+
+
+ $as_echo "#define HAVE_WCHAR_H 1" >>confdefs.h
+@@ -12384,7 +12494,7 @@ then
+ # This bug is HP SR number 8606223364.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of wchar_t" >&5
+ $as_echo_n "checking size of wchar_t... " >&6; }
+-if test "${ac_cv_sizeof_wchar_t+set}" = set; then :
++if ${ac_cv_sizeof_wchar_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (wchar_t))"
"ac_cv_sizeof_wchar_t" "#include <wchar.h>
+@@ -12395,7 +12505,7 @@ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':"
>&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error 77 "cannot compute sizeof (wchar_t)
+-See \`config.log' for more details" "$LINENO" 5 ; }
++See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_wchar_t=0
+ fi
+@@ -12450,7 +12560,7 @@ then
+ # check whether wchar_t is signed or not
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wchar_t is signed"
>&5
+ $as_echo_n "checking whether wchar_t is signed... " >&6; }
+- if test "${ac_cv_wchar_t_signed+set}" = set; then :
++ if ${ac_cv_wchar_t_signed+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+
+@@ -12514,7 +12624,7 @@ ucs4) unicode_size="4"
+ $as_echo "#define Py_UNICODE_SIZE 4" >>confdefs.h
+
+ ;;
+-*) as_fn_error $? "invalid value for --enable-unicode. Use either ucs2 or ucs4
(lowercase)." "$LINENO" 5 ;;
++*) as_fn_error $? "invalid value for --enable-unicode. Use either ucs2 or ucs4
(lowercase)." "$LINENO" 5 ;;
+ esac
+
+
+@@ -12561,7 +12671,7 @@ fi
+ # check for endianness
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is
bigendian" >&5
+ $as_echo_n "checking whether byte ordering is bigendian... " >&6; }
+-if test "${ac_cv_c_bigendian+set}" = set; then :
++if ${ac_cv_c_bigendian+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_cv_c_bigendian=unknown
+@@ -12780,7 +12890,7 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUI
+ ;; #(
+ *)
+ as_fn_error $? "unknown endianness
+- presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
++ presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
+ esac
+
+
+@@ -12788,7 +12898,7 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUI
+ # or fills with zeros (like the Cray J90, according to Tim Peters).
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether right shift extends the
sign bit" >&5
+ $as_echo_n "checking whether right shift extends the sign bit... " >&6;
}
+-if test "${ac_cv_rshift_extends_sign+set}" = set; then :
++if ${ac_cv_rshift_extends_sign+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+
+@@ -12827,7 +12937,7 @@ fi
+ # check for getc_unlocked and related locking functions
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getc_unlocked() and
friends" >&5
+ $as_echo_n "checking for getc_unlocked() and friends... " >&6; }
+-if test "${ac_cv_have_getc_unlocked+set}" = set; then :
++if ${ac_cv_have_getc_unlocked+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+
+@@ -12925,7 +13035,7 @@ fi
+ # check for readline 2.1
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_callback_handler_install
in -lreadline" >&5
+ $as_echo_n "checking for rl_callback_handler_install in -lreadline... "
>&6; }
+-if test "${ac_cv_lib_readline_rl_callback_handler_install+set}" = set; then :
++if ${ac_cv_lib_readline_rl_callback_handler_install+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -12959,7 +13069,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_readline_rl_callback_handler_install" >&5
+ $as_echo "$ac_cv_lib_readline_rl_callback_handler_install" >&6; }
+-if test "x$ac_cv_lib_readline_rl_callback_handler_install" = x""yes;
then :
++if test "x$ac_cv_lib_readline_rl_callback_handler_install" = xyes; then :
+
+ $as_echo "#define HAVE_RL_CALLBACK 1" >>confdefs.h
+
+@@ -13011,7 +13121,7 @@ fi
+ # check for readline 4.0
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_pre_input_hook in
-lreadline" >&5
+ $as_echo_n "checking for rl_pre_input_hook in -lreadline... " >&6; }
+-if test "${ac_cv_lib_readline_rl_pre_input_hook+set}" = set; then :
++if ${ac_cv_lib_readline_rl_pre_input_hook+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -13045,7 +13155,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_readline_rl_pre_input_hook" >&5
+ $as_echo "$ac_cv_lib_readline_rl_pre_input_hook" >&6; }
+-if test "x$ac_cv_lib_readline_rl_pre_input_hook" = x""yes; then :
++if test "x$ac_cv_lib_readline_rl_pre_input_hook" = xyes; then :
+
+ $as_echo "#define HAVE_RL_PRE_INPUT_HOOK 1" >>confdefs.h
+
+@@ -13055,7 +13165,7 @@ fi
+ # also in 4.0
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for
rl_completion_display_matches_hook in -lreadline" >&5
+ $as_echo_n "checking for rl_completion_display_matches_hook in -lreadline... "
>&6; }
+-if test "${ac_cv_lib_readline_rl_completion_display_matches_hook+set}" = set;
then :
++if ${ac_cv_lib_readline_rl_completion_display_matches_hook+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -13089,7 +13199,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_readline_rl_completion_display_matches_hook" >&5
+ $as_echo "$ac_cv_lib_readline_rl_completion_display_matches_hook" >&6;
}
+-if test "x$ac_cv_lib_readline_rl_completion_display_matches_hook" =
x""yes; then :
++if test "x$ac_cv_lib_readline_rl_completion_display_matches_hook" = xyes; then
:
+
+ $as_echo "#define HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK 1"
>>confdefs.h
+
+@@ -13099,7 +13209,7 @@ fi
+ # check for readline 4.2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_matches in
-lreadline" >&5
+ $as_echo_n "checking for rl_completion_matches in -lreadline... " >&6;
}
+-if test "${ac_cv_lib_readline_rl_completion_matches+set}" = set; then :
++if ${ac_cv_lib_readline_rl_completion_matches+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -13133,7 +13243,7 @@ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result:
$ac_cv_lib_readline_rl_completion_matches" >&5
+ $as_echo "$ac_cv_lib_readline_rl_completion_matches" >&6; }
+-if test "x$ac_cv_lib_readline_rl_completion_matches" = x""yes; then
:
++if test "x$ac_cv_lib_readline_rl_completion_matches" = xyes; then :
+
+ $as_echo "#define HAVE_RL_COMPLETION_MATCHES 1" >>confdefs.h
+
+@@ -13174,7 +13284,7 @@ LIBS=$LIBS_no_readline
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken nice()"
>&5
+ $as_echo_n "checking for broken nice()... " >&6; }
+-if test "${ac_cv_broken_nice+set}" = set; then :
++if ${ac_cv_broken_nice+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+
+@@ -13215,7 +13325,7 @@ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken poll()"
>&5
+ $as_echo_n "checking for broken poll()... " >&6; }
+-if test "${ac_cv_broken_poll+set}" = set; then :
++if ${ac_cv_broken_poll+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test "$cross_compiling" = yes; then :
+@@ -13270,7 +13380,7 @@ ac_fn_c_check_member "$LINENO" "struct t
+ #include <$ac_cv_struct_tm>
+
+ "
+-if test "x$ac_cv_member_struct_tm_tm_zone" = x""yes; then :
++if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then :
+
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_STRUCT_TM_TM_ZONE 1
+@@ -13286,7 +13396,7 @@ $as_echo "#define HAVE_TM_ZONE 1" >>conf
+ else
+ ac_fn_c_check_decl "$LINENO" "tzname"
"ac_cv_have_decl_tzname" "#include <time.h>
+ "
+-if test "x$ac_cv_have_decl_tzname" = x""yes; then :
++if test "x$ac_cv_have_decl_tzname" = xyes; then :
+ ac_have_decl=1
+ else
+ ac_have_decl=0
+@@ -13298,7 +13408,7 @@ _ACEOF
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5
+ $as_echo_n "checking for tzname... " >&6; }
+-if test "${ac_cv_var_tzname+set}" = set; then :
++if ${ac_cv_var_tzname+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -13337,7 +13447,7 @@ fi
+ # check tzset(3) exists and works like we expect it to
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working tzset()"
>&5
+ $as_echo_n "checking for working tzset()... " >&6; }
+-if test "${ac_cv_working_tzset+set}" = set; then :
++if ${ac_cv_working_tzset+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+
+@@ -13434,7 +13544,7 @@ fi
+ # Look for subsecond timestamps in struct stat
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tv_nsec in struct stat"
>&5
+ $as_echo_n "checking for tv_nsec in struct stat... " >&6; }
+-if test "${ac_cv_stat_tv_nsec+set}" = set; then :
++if ${ac_cv_stat_tv_nsec+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -13471,7 +13581,7 @@ fi
+ # Look for BSD style subsecond timestamps in struct stat
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tv_nsec2 in struct stat"
>&5
+ $as_echo_n "checking for tv_nsec2 in struct stat... " >&6; }
+-if test "${ac_cv_stat_tv_nsec2+set}" = set; then :
++if ${ac_cv_stat_tv_nsec2+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -13508,7 +13618,7 @@ fi
+ # On HP/UX 11.0, mvwdelch is a block with a return statement
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mvwdelch is an
expression" >&5
+ $as_echo_n "checking whether mvwdelch is an expression... " >&6; }
+-if test "${ac_cv_mvwdelch_is_expression+set}" = set; then :
++if ${ac_cv_mvwdelch_is_expression+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -13545,7 +13655,7 @@ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether WINDOW has _flags"
>&5
+ $as_echo_n "checking whether WINDOW has _flags... " >&6; }
+-if test "${ac_cv_window_has_flags+set}" = set; then :
++if ${ac_cv_window_has_flags+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -13693,7 +13803,7 @@ if test "$have_long_long" = yes
+ then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for %lld and %llu printf()
format support" >&5
+ $as_echo_n "checking for %lld and %llu printf() format support... "
>&6; }
+- if test "${ac_cv_have_long_long_format+set}" = set; then :
++ if ${ac_cv_have_long_long_format+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test "$cross_compiling" = yes; then :
+@@ -13764,7 +13874,7 @@ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for %zd printf() format
support" >&5
+ $as_echo_n "checking for %zd printf() format support... " >&6; }
+-if test "${ac_cv_have_size_t_format+set}" = set; then :
++if ${ac_cv_have_size_t_format+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+ if test "$cross_compiling" = yes; then :
+@@ -13837,7 +13947,7 @@ ac_fn_c_check_type "$LINENO" "socklen_t"
+ #endif
+
+ "
+-if test "x$ac_cv_type_socklen_t" = x""yes; then :
++if test "x$ac_cv_type_socklen_t" = xyes; then :
+
+ else
+
+@@ -13942,10 +14052,21 @@ $as_echo "$as_me: WARNING: cache variabl
+ :end' >>confcache
+ if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+- test "x$cache_file" != "x/dev/null" &&
++ if test "x$cache_file" != "x/dev/null"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file"
>&5
+ $as_echo "$as_me: updating cache $cache_file" >&6;}
+- cat confcache >$cache_file
++ if test ! -f "$cache_file" || test -h "$cache_file"; then
++ cat confcache >"$cache_file"
++ else
++ case $cache_file in #(
++ */* | ?:*)
++ mv -f confcache "$cache_file"$$ &&
++ mv -f "$cache_file"$$ "$cache_file" ;; #(
++ *)
++ mv -f confcache "$cache_file" ;;
++ esac
++ fi
++ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache
$cache_file" >&5
+ $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+@@ -13978,7 +14099,7 @@ LTLIBOBJS=$ac_ltlibobjs
+
+
+
+-: ${CONFIG_STATUS=./config.status}
++: "${CONFIG_STATUS=./config.status}"
+ ac_write_fail=0
+ ac_clean_files_save=$ac_clean_files
+ ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+@@ -14079,6 +14200,7 @@ fi
+ IFS=" "" $as_nl"
+
+ # Find who we are. Look in the path if we contain no directory separator.
++as_myself=
+ case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+@@ -14386,7 +14508,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri
+ # values after options handling.
+ ac_log="
+ This file was extended by python $as_me 2.7, which was
+-generated by GNU Autoconf 2.67. Invocation command line was
++generated by GNU Autoconf 2.68. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+@@ -14448,7 +14570,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_writ
+ ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //;
s/[\\""\`\$]/\\\\&/g'`"
+ ac_cs_version="\\
+ python config.status 2.7
+-configured by $0, generated by GNU Autoconf 2.67,
++configured by $0, generated by GNU Autoconf 2.68,
+ with options \\"\$ac_cs_config\\"
+
+ Copyright (C) 2010 Free Software Foundation, Inc.
+@@ -14580,7 +14702,7 @@ do
+ "Misc/python.pc") CONFIG_FILES="$CONFIG_FILES Misc/python.pc"
;;
+ "Modules/ld_so_aix") CONFIG_FILES="$CONFIG_FILES
Modules/ld_so_aix" ;;
+
+- *) as_fn_error $? "invalid argument: \`$ac_config_target'"
"$LINENO" 5 ;;
++ *) as_fn_error $? "invalid argument: \`$ac_config_target'"
"$LINENO" 5;;
+ esac
+ done
+
+@@ -14602,9 +14724,10 @@ fi
+ # after its creation but before its name has been assigned to `$tmp'.
+ $debug ||
+ {
+- tmp=
++ tmp= ac_tmp=
+ trap 'exit_status=$?
+- { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; }
&& exit $exit_status
++ : "${ac_tmp:=$tmp}"
++ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit
$exit_status
+ ' 0
+ trap 'as_fn_exit 1' 1 2 13 15
+ }
+@@ -14612,12 +14735,13 @@ $debug ||
+
+ {
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null`
&&
+- test -n "$tmp" && test -d "$tmp"
++ test -d "$tmp"
+ } ||
+ {
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+ } || as_fn_error $? "cannot create a temporary directory in ."
"$LINENO" 5
++ac_tmp=$tmp
+
+ # Set up the scripts for CONFIG_FILES section.
+ # No need to generate them if there are no CONFIG_FILES.
+@@ -14639,7 +14763,7 @@ else
+ ac_cs_awk_cr=$ac_cr
+ fi
+
+-echo 'BEGIN {' >"$tmp/subs1.awk" &&
++echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+ _ACEOF
+
+
+@@ -14667,7 +14791,7 @@ done
+ rm -f conf$$subs.sh
+
+ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+-cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
++cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+ _ACEOF
+ sed -n '
+ h
+@@ -14715,7 +14839,7 @@ t delim
+ rm -f conf$$subs.awk
+ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ _ACAWK
+-cat >>"\$tmp/subs1.awk" <<_ACAWK &&
++cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+
+@@ -14747,7 +14871,7 @@ if sed "s/$ac_cr//" < /dev/null > /dev/n
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+ else
+ cat
+-fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
++fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+ || as_fn_error $? "could not setup config files machinery"
"$LINENO" 5
+ _ACEOF
+
+@@ -14781,7 +14905,7 @@ fi # test -n "$CONFIG_FILES"
+ # No need to generate them if there are no CONFIG_HEADERS.
+ # This happens for instance with `./config.status Makefile'.
+ if test -n "$CONFIG_HEADERS"; then
+-cat >"$tmp/defines.awk" <<\_ACAWK ||
++cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+ BEGIN {
+ _ACEOF
+
+@@ -14793,8 +14917,8 @@ _ACEOF
+ # handling of long lines.
+ ac_delim='%!_!# '
+ for ac_last_try in false false :; do
+- ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+- if test -z "$ac_t"; then
++ ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
++ if test -z "$ac_tt"; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+@@ -14895,7 +15019,7 @@ do
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+- :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO"
5 ;;
++ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO"
5;;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+@@ -14914,7 +15038,7 @@ do
+ for ac_f
+ do
+ case $ac_f in
+- -) ac_f="$tmp/stdin";;
++ -) ac_f="$ac_tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+@@ -14923,7 +15047,7 @@ do
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+- as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5
;;
++ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO"
5;;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed
"s/'/'\\\\\\\\''/g"`;; esac
+ as_fn_append ac_file_inputs " '$ac_f'"
+@@ -14949,8 +15073,8 @@ $as_echo "$as_me: creating $ac_file" >&6
+ esac
+
+ case $ac_tag in
+- *:-:* | *:-) cat >"$tmp/stdin" \
+- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
++ *:-:* | *:-) cat >"$ac_tmp/stdin" \
++ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+ esac
+ ;;
+ esac
+@@ -15080,21 +15204,22 @@ s&@abs_top_builddir@&$ac_abs_top_builddi
+ s&@INSTALL@&$ac_INSTALL&;t t
+ $ac_datarootdir_hack
+ "
+-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f
"$tmp/subs.awk" >$tmp/out \
+- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
++eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f
"$ac_tmp/subs.awk" \
++ >$ac_tmp/out || as_fn_error $? "could not create $ac_file"
"$LINENO" 5
+
+ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+- { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n
"$ac_out"; } &&
+- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z
"$ac_out"; } &&
++ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n
"$ac_out"; } &&
++ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
++ "$ac_tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference
to the variable \`datarootdir'
+ which seems to be undefined. Please make sure it is defined" >&5
+ $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable
\`datarootdir'
+ which seems to be undefined. Please make sure it is defined" >&2;}
+
+- rm -f "$tmp/stdin"
++ rm -f "$ac_tmp/stdin"
+ case $ac_file in
+- -) cat "$tmp/out" && rm -f "$tmp/out";;
+- *) rm -f "$ac_file" && mv "$tmp/out"
"$ac_file";;
++ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
++ *) rm -f "$ac_file" && mv "$ac_tmp/out"
"$ac_file";;
+ esac \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+@@ -15105,20 +15230,20 @@ which seems to be undefined. Please mak
+ if test x"$ac_file" != x-; then
+ {
+ $as_echo "/* $configure_input */" \
+- && eval '$AWK -f "$tmp/defines.awk"'
"$ac_file_inputs"
+- } >"$tmp/config.h" \
++ && eval '$AWK -f "$ac_tmp/defines.awk"'
"$ac_file_inputs"
++ } >"$ac_tmp/config.h" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+- if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1;
then
++ if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1;
then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged"
>&5
+ $as_echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ rm -f "$ac_file"
+- mv "$tmp/config.h" "$ac_file" \
++ mv "$ac_tmp/config.h" "$ac_file" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ fi
+ else
+ $as_echo "/* $configure_input */" \
+- && eval '$AWK -f "$tmp/defines.awk"'
"$ac_file_inputs" \
++ && eval '$AWK -f "$ac_tmp/defines.awk"'
"$ac_file_inputs" \
+ || as_fn_error $? "could not create -" "$LINENO" 5
+ fi
+ ;;
diff -up ./pyconfig.h.in.autotool-intermediates ./pyconfig.h.in
---- ./pyconfig.h.in.autotool-intermediates 2011-06-13 15:27:20.702308004 -0400
-+++ ./pyconfig.h.in 2011-06-13 15:27:23.433308006 -0400
+--- ./pyconfig.h.in.autotool-intermediates 2012-04-11 18:35:27.002518749 -0400
++++ ./pyconfig.h.in 2012-04-11 18:35:28.133504610 -0400
@@ -18,6 +18,12 @@
/* Define this if you have BeOS threads. */
#undef BEOS_THREADS
@@ -211,7 +2705,7 @@ diff -up ./pyconfig.h.in.autotool-intermediates ./pyconfig.h.in
/* Define if you have the Mach cthreads package */
#undef C_THREADS
-@@ -1104,12 +1110,6 @@
+@@ -1107,12 +1113,6 @@
/* Define to profile with the Pentium timestamp counter */
#undef WITH_TSC
@@ -224,13 +2718,3 @@ diff -up ./pyconfig.h.in.autotool-intermediates ./pyconfig.h.in
/* Define if you want pymalloc to be disabled when running under valgrind */
#undef WITH_VALGRIND
-@@ -1146,6 +1146,9 @@
- /* This must be defined on some systems to enable large file support. */
- #undef _LARGEFILE_SOURCE
-
-+/* This must be defined on AIX systems to enable large file support. */
-+#undef _LARGE_FILES
-+
- /* Define to 1 if on MINIX. */
- #undef _MINIX
-
diff --git a/fix-test_structmember-on-64bit-bigendian.patch
b/fix-test_structmember-on-64bit-bigendian.patch
index a250dea..a91b6db 100644
--- a/fix-test_structmember-on-64bit-bigendian.patch
+++ b/fix-test_structmember-on-64bit-bigendian.patch
@@ -1,21 +1,12 @@
-Index: Modules/_testcapimodule.c
-===================================================================
---- Modules/_testcapimodule.c (revision 85001)
-+++ Modules/_testcapimodule.c (working copy)
-@@ -5,6 +5,7 @@
- * standard Python regression test, via Lib/test/test_capi.py.
- */
-
-+#define PY_SSIZE_T_CLEAN
- #include "Python.h"
- #include <float.h>
- #include "structmember.h"
-@@ -593,7 +594,7 @@
- {
- PyObject *tuple, *obj;
- Py_UNICODE *value;
-- int len;
-+ Py_ssize_t len;
-
- /* issue4122: Undefined reference to _Py_ascii_whitespace on Windows */
- /* Just use the macro and check that it compiles */
+diff -up Python-2.7.3/Modules/_testcapimodule.c.fix-test_structmember-on-64bit-bigendian
Python-2.7.3/Modules/_testcapimodule.c
+---
Python-2.7.3/Modules/_testcapimodule.c.fix-test_structmember-on-64bit-bigendian 2012-04-09
19:07:33.000000000 -0400
++++ Python-2.7.3/Modules/_testcapimodule.c 2012-04-12 17:42:55.725766488 -0400
+@@ -1813,7 +1813,7 @@ test_structmembers_new(PyTypeObject *typ
+ ;
+ test_structmembers *ob;
+ const char *s = NULL;
+- Py_ssize_t string_len = 0;
++ int string_len = 0;
+ ob = PyObject_New(test_structmembers, type);
+ if (ob == NULL)
+ return NULL;
diff --git a/make-pydoc-more-robust-001.patch b/make-pydoc-more-robust-001.patch
deleted file mode 100644
index ed2de4e..0000000
--- a/make-pydoc-more-robust-001.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-Index: Lib/pydoc.py
-===================================================================
---- Lib/pydoc.py (revision 76636)
-+++ Lib/pydoc.py (working copy)
-@@ -1961,10 +1961,14 @@
- if modname[-9:] == '.__init__':
- modname = modname[:-9] + ' (package)'
- print modname, desc and '- ' + desc
-+ def onerror(modname):
-+ # Ignore non-ImportError exceptions raised whilst trying to
-+ # import modules
-+ pass
- try: import warnings
- except ImportError: pass
- else: warnings.filterwarnings('ignore') # ignore problems during import
-- ModuleScanner().run(callback, key)
-+ ModuleScanner().run(callback, key, onerror=onerror)
-
- # --------------------------------------------------- web browser interface
-
diff --git a/python-2.7.1-lib64.patch b/python-2.7.1-lib64.patch
deleted file mode 100644
index 4b07470..0000000
--- a/python-2.7.1-lib64.patch
+++ /dev/null
@@ -1,199 +0,0 @@
-diff -up Python-2.7.1/Lib/distutils/command/install.py.lib64
Python-2.7.1/Lib/distutils/command/install.py
---- Python-2.7.1/Lib/distutils/command/install.py.lib64 2010-05-05 15:09:31.000000000
-0400
-+++ Python-2.7.1/Lib/distutils/command/install.py 2010-12-23 15:51:19.422062062 -0500
-@@ -42,14 +42,14 @@ else:
- INSTALL_SCHEMES = {
- 'unix_prefix': {
- 'purelib': '$base/lib/python$py_version_short/site-packages',
-- 'platlib':
'$platbase/lib/python$py_version_short/site-packages',
-+ 'platlib':
'$platbase/lib64/python$py_version_short/site-packages',
- 'headers': '$base/include/python$py_version_short/$dist_name',
- 'scripts': '$base/bin',
- 'data' : '$base',
- },
- 'unix_home': {
- 'purelib': '$base/lib/python',
-- 'platlib': '$base/lib/python',
-+ 'platlib': '$base/lib64/python',
- 'headers': '$base/include/python/$dist_name',
- 'scripts': '$base/bin',
- 'data' : '$base',
-diff -up Python-2.7.1/Lib/distutils/sysconfig.py.lib64
Python-2.7.1/Lib/distutils/sysconfig.py
---- Python-2.7.1/Lib/distutils/sysconfig.py.lib64 2010-11-06 10:16:30.000000000 -0400
-+++ Python-2.7.1/Lib/distutils/sysconfig.py 2010-12-23 15:51:19.423063652 -0500
-@@ -114,8 +114,12 @@ def get_python_lib(plat_specific=0, stan
- prefix = plat_specific and EXEC_PREFIX or PREFIX
-
- if os.name == "posix":
-+ if plat_specific or standard_lib:
-+ lib = "lib64"
-+ else:
-+ lib = "lib"
- libpython = os.path.join(prefix,
-- "lib", "python" +
get_python_version())
-+ lib, "python" + get_python_version())
- if standard_lib:
- return libpython
- else:
-diff -up Python-2.7.1/Lib/site.py.lib64 Python-2.7.1/Lib/site.py
---- Python-2.7.1/Lib/site.py.lib64 2010-10-12 18:53:51.000000000 -0400
-+++ Python-2.7.1/Lib/site.py 2010-12-23 15:51:19.424063606 -0500
-@@ -290,12 +290,16 @@ def getsitepackages():
- if sys.platform in ('os2emx', 'riscos'):
- sitepackages.append(os.path.join(prefix, "Lib",
"site-packages"))
- elif os.sep == '/':
-+ sitepackages.append(os.path.join(prefix, "lib64",
-+ "python" + sys.version[:3],
-+ "site-packages"))
- sitepackages.append(os.path.join(prefix, "lib",
- "python" + sys.version[:3],
- "site-packages"))
- sitepackages.append(os.path.join(prefix, "lib",
"site-python"))
- else:
- sitepackages.append(prefix)
-+ sitepackages.append(os.path.join(prefix, "lib64",
"site-packages"))
- sitepackages.append(os.path.join(prefix, "lib",
"site-packages"))
- if sys.platform == "darwin":
- # for framework builds *only* we add the standard Apple
-diff -up Python-2.7.1/Lib/test/test_site.py.lib64 Python-2.7.1/Lib/test/test_site.py
---- Python-2.7.1/Lib/test/test_site.py.lib64 2010-11-21 08:34:58.000000000 -0500
-+++ Python-2.7.1/Lib/test/test_site.py 2010-12-23 15:55:19.782935931 -0500
-@@ -169,17 +169,20 @@ class HelperFunctionsTests(unittest.Test
- wanted = os.path.join('xoxo', 'Lib',
'site-packages')
- self.assertEqual(dirs[0], wanted)
- elif os.sep == '/':
-- self.assertEqual(len(dirs), 2)
-+ self.assertEquals(len(dirs), 3)
-+ wanted = os.path.join('xoxo', 'lib64', 'python' +
sys.version[:3],
-+ 'site-packages')
-+ self.assertEquals(dirs[0], wanted)
- wanted = os.path.join('xoxo', 'lib', 'python' +
sys.version[:3],
- 'site-packages')
-- self.assertEqual(dirs[0], wanted)
-+ self.assertEquals(dirs[1], wanted)
- wanted = os.path.join('xoxo', 'lib', 'site-python')
-- self.assertEqual(dirs[1], wanted)
-+ self.assertEquals(dirs[2], wanted)
- else:
-- self.assertEqual(len(dirs), 2)
-- self.assertEqual(dirs[0], 'xoxo')
-- wanted = os.path.join('xoxo', 'lib',
'site-packages')
-- self.assertEqual(dirs[1], wanted)
-+ self.assertEquals(len(dirs), 2)
-+ self.assertEquals(dirs[0], 'xoxo')
-+ wanted = os.path.join('xoxo', 'lib64',
'site-packages')
-+ self.assertEquals(dirs[1], wanted)
-
- # let's try the specific Apple location
- if (sys.platform == "darwin" and
-diff -up Python-2.7.1/Makefile.pre.in.lib64 Python-2.7.1/Makefile.pre.in
---- Python-2.7.1/Makefile.pre.in.lib64 2010-12-23 15:51:19.407063264 -0500
-+++ Python-2.7.1/Makefile.pre.in 2010-12-23 15:51:19.426063917 -0500
-@@ -94,7 +94,7 @@ LIBDIR= @libdir@
- MANDIR= @mandir@
- INCLUDEDIR= @includedir@
- CONFINCLUDEDIR= $(exec_prefix)/include
--SCRIPTDIR= $(prefix)/lib
-+SCRIPTDIR= $(prefix)/lib64
-
- # Detailed destination directories
- BINLIBDEST= $(LIBDIR)/python$(VERSION)
-diff -up Python-2.7.1/Modules/getpath.c.lib64 Python-2.7.1/Modules/getpath.c
---- Python-2.7.1/Modules/getpath.c.lib64 2010-10-07 19:37:08.000000000 -0400
-+++ Python-2.7.1/Modules/getpath.c 2010-12-23 15:51:19.427063291 -0500
-@@ -117,8 +117,8 @@
- #endif
-
- #ifndef PYTHONPATH
--#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
-- EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
-+#define PYTHONPATH PREFIX "/lib64/python" VERSION ":" \
-+ EXEC_PREFIX "/lib64/python" VERSION "/lib-dynload"
- #endif
-
- #ifndef LANDMARK
-@@ -129,7 +129,7 @@ static char prefix[MAXPATHLEN+1];
- static char exec_prefix[MAXPATHLEN+1];
- static char progpath[MAXPATHLEN+1];
- static char *module_search_path = NULL;
--static char lib_python[] = "lib/python" VERSION;
-+static char lib_python[] = "lib64/python" VERSION;
-
- static void
- reduce(char *dir)
-@@ -528,7 +528,7 @@ calculate_path(void)
- }
- else
- strncpy(zip_path, PREFIX, MAXPATHLEN);
-- joinpath(zip_path, "lib/python00.zip");
-+ joinpath(zip_path, "lib64/python00.zip");
- bufsz = strlen(zip_path); /* Replace "00" with version */
- zip_path[bufsz - 6] = VERSION[0];
- zip_path[bufsz - 5] = VERSION[2];
-@@ -538,7 +538,7 @@ calculate_path(void)
- fprintf(stderr,
- "Could not find platform dependent libraries
<exec_prefix>\n");
- strncpy(exec_prefix, EXEC_PREFIX, MAXPATHLEN);
-- joinpath(exec_prefix, "lib/lib-dynload");
-+ joinpath(exec_prefix, "lib64/lib-dynload");
- }
- /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */
-
-diff -up Python-2.7.1/Modules/Setup.dist.lib64 Python-2.7.1/Modules/Setup.dist
---- Python-2.7.1/Modules/Setup.dist.lib64 2010-12-23 15:51:19.400104130 -0500
-+++ Python-2.7.1/Modules/Setup.dist 2010-12-23 15:51:19.427063291 -0500
-@@ -413,7 +413,7 @@ gdbm gdbmmodule.c -lgdbm
- # and the subdirectory of PORT where you built it.
- DBLIBVER=4.7
- DBINC=/usr/include/db4
--DBLIB=/usr/lib
-+DBLIB=/usr/lib64
- _bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
-
- # Historical Berkeley DB 1.85
-@@ -459,7 +459,7 @@ cPickle cPickle.c
- # Andrew Kuchling's zlib module.
- # This require zlib 1.1.3 (or later).
- # See
http://www.gzip.org/zlib/
--zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
-+zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib64 -lz
-
- # Interface to the Expat XML parser
- #
-diff -up Python-2.7.1/setup.py.lib64 Python-2.7.1/setup.py
---- Python-2.7.1/setup.py.lib64 2010-10-31 12:40:21.000000000 -0400
-+++ Python-2.7.1/setup.py 2010-12-23 15:51:19.428064129 -0500
-@@ -347,7 +347,7 @@ class PyBuildExt(build_ext):
-
- def detect_modules(self):
- # Ensure that /usr/local is always used
-- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
-+ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib64')
- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
-
- # Add paths specified in the environment variables LDFLAGS and
-@@ -654,11 +654,11 @@ class PyBuildExt(build_ext):
- elif curses_library:
- readline_libs.append(curses_library)
- elif self.compiler.find_library_file(lib_dirs +
-- ['/usr/lib/termcap'],
-+ ['/usr/lib64/termcap'],
- 'termcap'):
- readline_libs.append('termcap')
- exts.append( Extension('readline', ['readline.c'],
-- library_dirs=['/usr/lib/termcap'],
-+ library_dirs=['/usr/lib64/termcap'],
- extra_link_args=readline_extra_link_args,
- libraries=readline_libs) )
- else:
-@@ -692,8 +692,8 @@ class PyBuildExt(build_ext):
- if krb5_h:
- ssl_incs += krb5_h
- ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
-- ['/usr/local/ssl/lib',
-- '/usr/contrib/ssl/lib/'
-+ ['/usr/local/ssl/lib64',
-+ '/usr/contrib/ssl/lib64/'
- ] )
-
- if (ssl_incs is not None and
diff --git a/python-2.7.3-debug-build.patch b/python-2.7.3-debug-build.patch
new file mode 100644
index 0000000..d17bf5d
--- /dev/null
+++ b/python-2.7.3-debug-build.patch
@@ -0,0 +1,272 @@
+diff -up Python-2.7.3/configure.in.debug-build Python-2.7.3/configure.in
+--- Python-2.7.3/configure.in.debug-build 2012-04-13 00:13:53.923498660 -0400
++++ Python-2.7.3/configure.in 2012-04-13 00:13:53.929498585 -0400
+@@ -635,7 +635,7 @@ AC_SUBST(LIBRARY)
+ AC_MSG_CHECKING(LIBRARY)
+ if test -z "$LIBRARY"
+ then
+- LIBRARY='libpython$(VERSION).a'
++ LIBRARY='libpython$(VERSION)$(DEBUG_EXT).a'
+ fi
+ AC_MSG_RESULT($LIBRARY)
+
+@@ -780,8 +780,8 @@ if test $enable_shared = "yes"; then
+ INSTSONAME="$LDLIBRARY".$SOVERSION
+ ;;
+ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*)
+- LDLIBRARY='libpython$(VERSION).so'
+- BLDLIBRARY='-L. -lpython$(VERSION)'
++ LDLIBRARY='libpython$(VERSION)$(DEBUG_EXT).so'
++ BLDLIBRARY='-L. -lpython$(VERSION)$(DEBUG_EXT)'
+ RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
+ case $ac_sys_system in
+ FreeBSD*)
+@@ -905,6 +905,14 @@ else AC_MSG_RESULT(no); Py_DEBUG='false'
+ fi],
+ [AC_MSG_RESULT(no)])
+
++if test "$Py_DEBUG" = 'true'
++then
++ DEBUG_EXT=_d
++ DEBUG_SUFFIX=-debug
++fi
++AC_SUBST(DEBUG_EXT)
++AC_SUBST(DEBUG_SUFFIX)
++
+ # XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
+ # merged with this chunk of code?
+
+diff -up Python-2.7.3/Lib/distutils/command/build_ext.py.debug-build
Python-2.7.3/Lib/distutils/command/build_ext.py
+--- Python-2.7.3/Lib/distutils/command/build_ext.py.debug-build 2012-04-09
19:07:29.000000000 -0400
++++ Python-2.7.3/Lib/distutils/command/build_ext.py 2012-04-13 00:13:53.930498573 -0400
+@@ -676,7 +676,10 @@ class build_ext (Command):
+ so_ext = get_config_var('SO')
+ if os.name == 'nt' and self.debug:
+ return os.path.join(*ext_path) + '_d' + so_ext
+- return os.path.join(*ext_path) + so_ext
++
++ # Similarly, extensions in debug mode are named 'module_d.so', to
++ # avoid adding the _d to the SO config variable:
++ return os.path.join(*ext_path) + (sys.pydebug and "_d" or
"") + so_ext
+
+ def get_export_symbols (self, ext):
+ """Return the list of symbols that a shared extension has to
+@@ -761,6 +764,8 @@ class build_ext (Command):
+ template = "python%d.%d"
+ pythonlib = (template %
+ (sys.hexversion >> 24, (sys.hexversion >> 16)
& 0xff))
++ if sys.pydebug:
++ pythonlib += '_d'
+ return ext.libraries + [pythonlib]
+ else:
+ return ext.libraries
+diff -up Python-2.7.3/Lib/distutils/sysconfig.py.debug-build
Python-2.7.3/Lib/distutils/sysconfig.py
+--- Python-2.7.3/Lib/distutils/sysconfig.py.debug-build 2012-04-13 00:13:53.899498961
-0400
++++ Python-2.7.3/Lib/distutils/sysconfig.py 2012-04-13 00:13:53.930498573 -0400
+@@ -85,7 +85,8 @@ 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())
++ return os.path.join(prefix, "include",
++ "python" + get_python_version() + (sys.pydebug and
'-debug' or ''))
+ elif os.name == "nt":
+ return os.path.join(prefix, "include")
+ elif os.name == "os2":
+@@ -250,7 +251,7 @@ def get_makefile_filename():
+ if python_build:
+ return os.path.join(os.path.dirname(sys.executable), "Makefile")
+ lib_dir = get_python_lib(plat_specific=1, standard_lib=1)
+- return os.path.join(lib_dir, "config", "Makefile")
++ return os.path.join(lib_dir, "config" + (sys.pydebug and
"-debug" or ""), "Makefile")
+
+
+ def parse_config_h(fp, g=None):
+diff -up Python-2.7.3/Lib/distutils/tests/test_install.py.debug-build
Python-2.7.3/Lib/distutils/tests/test_install.py
+--- Python-2.7.3/Lib/distutils/tests/test_install.py.debug-build 2012-04-13
00:14:36.177970408 -0400
++++ Python-2.7.3/Lib/distutils/tests/test_install.py 2012-04-13 00:15:20.675414113 -0400
+@@ -20,8 +20,9 @@ from distutils.tests import support
+
+
+ def _make_ext_name(modname):
+- if os.name == 'nt' and sys.executable.endswith('_d.exe'):
++ if sys.pydebug:
+ modname += '_d'
++
+ return modname + sysconfig.get_config_var('SO')
+
+
+diff -up Python-2.7.3/Makefile.pre.in.debug-build Python-2.7.3/Makefile.pre.in
+--- Python-2.7.3/Makefile.pre.in.debug-build 2012-04-13 00:13:53.927498611 -0400
++++ Python-2.7.3/Makefile.pre.in 2012-04-13 00:13:53.931498561 -0400
+@@ -102,8 +102,8 @@ SCRIPTDIR= $(prefix)/lib64
+ # Detailed destination directories
+ BINLIBDEST= $(LIBDIR)/python$(VERSION)
+ LIBDEST= $(SCRIPTDIR)/python$(VERSION)
+-INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
+-CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)
++INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)$(DEBUG_SUFFIX)
++CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)$(DEBUG_SUFFIX)
+ LIBP= $(LIBDIR)/python$(VERSION)
+
+ # Symbols used for using shared libraries
+@@ -117,6 +117,12 @@ DESTSHARED= $(BINLIBDEST)/lib-dynload
+ EXE= @EXEEXT@
+ BUILDEXE= @BUILDEXEEXT@
+
++# DEBUG_EXT is used by ELF files (names and SONAMEs); it will be "_d" for a
debug build
++# DEBUG_SUFFIX is used by filesystem paths; it will be "-debug" for a debug
build
++# Both will be empty in an optimized build
++DEBUG_EXT= @DEBUG_EXT@
++DEBUG_SUFFIX= @DEBUG_SUFFIX@
++
+ # Short name and location for Mac OS X Python framework
+ UNIVERSALSDK=@UNIVERSALSDK@
+ PYTHONFRAMEWORK= @PYTHONFRAMEWORK@
+@@ -180,8 +186,8 @@ LIBOBJDIR= Python/
+ LIBOBJS= @LIBOBJS@
+ UNICODE_OBJS= @UNICODE_OBJS@
+
+-PYTHON= python$(EXE)
+-BUILDPYTHON= python$(BUILDEXE)
++PYTHON= python$(DEBUG_SUFFIX)$(EXE)
++BUILDPYTHON= python$(DEBUG_SUFFIX)$(BUILDEXE)
+
+ # The task to run while instrument when building the profile-opt target
+ PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck
+@@ -413,7 +419,7 @@ sharedmods: $(BUILDPYTHON)
+ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)'
./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
+ esac
+
+-libpython$(VERSION).so: $(LIBRARY_OBJS)
++libpython$(VERSION)$(DEBUG_EXT).so: $(LIBRARY_OBJS)
+ if test $(INSTSONAME) != $(LDLIBRARY); then \
+ $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS)
$(LIBC) $(LIBM) $(LDLAST); \
+ $(LN) -f $(INSTSONAME) $@; \
+@@ -798,10 +804,10 @@ bininstall: altbininstall
+ fi
+ (cd $(DESTDIR)$(BINDIR); $(LN) -s python2$(EXE) $(PYTHON))
+ -rm -f $(DESTDIR)$(BINDIR)/python2$(EXE)
+- (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(EXE) python2$(EXE))
++ (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(DEBUG_SUFFIX)$(EXE) python2$(EXE))
++ -rm -f $(DESTDIR)$(BINDIR)/python$(DEBUG_SUFFIX)-config
++ (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(DEBUG_SUFFIX)-config
python2-config)
+ -rm -f $(DESTDIR)$(BINDIR)/python2-config
+- (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python2-config)
+- -rm -f $(DESTDIR)$(BINDIR)/python-config
+ (cd $(DESTDIR)$(BINDIR); $(LN) -s python2-config python-config)
+ -test -d $(DESTDIR)$(LIBPC) || $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(LIBPC)
+ -rm -f $(DESTDIR)$(LIBPC)/python2.pc
+@@ -820,7 +826,7 @@ altbininstall: $(BUILDPYTHON)
+ else true; \
+ fi; \
+ done
+- $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE)
++ $(INSTALL_PROGRAM) $(BUILDPYTHON)
$(DESTDIR)$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)$(EXE)
+ if test -f $(LDLIBRARY); then \
+ if test -n "$(DLLLIBRARY)" ; then \
+ $(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
+@@ -970,10 +976,11 @@ $(srcdir)/Lib/$(PLATDIR):
+ export EXE; EXE="$(BUILDEXE)"; \
+ cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen
+
+-python-config: $(srcdir)/Misc/python-config.in
++python$(DEBUG_SUFFIX)-config: $(srcdir)/Misc/python-config.in
+ # 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
++ sed -e "s,@EXENAME@,$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)$(EXE)," <
$(srcdir)/Misc/python-config.in >python$(DEBUG_SUFFIX)-config
++
+
+ # Install the include files
+ INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
+@@ -994,13 +1001,13 @@ inclinstall:
+ $(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
+
+ # Install the library and miscellaneous stuff needed for extending/embedding
+-# This goes into $(exec_prefix)
+-LIBPL= $(LIBP)/config
++# This goes into $(exec_prefix)$(DEBUG_SUFFIX)
++LIBPL= $(LIBP)/config$(DEBUG_SUFFIX)
+
+ # pkgconfig directory
+ LIBPC= $(LIBDIR)/pkgconfig
+
+-libainstall: all python-config
++libainstall: all python$(DEBUG_SUFFIX)-config
+ @for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \
+ do \
+ if test ! -d $(DESTDIR)$$i; then \
+@@ -1019,8 +1026,7 @@ libainstall: all python-config
+ $(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc
+ $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
+ $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
+- $(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(VERSION)-config
+- rm python-config
++ $(INSTALL_SCRIPT) python$(DEBUG_SUFFIX)-config
$(DESTDIR)$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)-config
+ @if [ -s Modules/python.exp -a \
+ "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ];
then \
+ echo; echo "Installing support files for building shared extension modules on
AIX:"; \
+diff -up Python-2.7.3/Misc/python-config.in.debug-build
Python-2.7.3/Misc/python-config.in
+--- Python-2.7.3/Misc/python-config.in.debug-build 2012-04-09 19:07:33.000000000 -0400
++++ Python-2.7.3/Misc/python-config.in 2012-04-13 00:13:53.931498561 -0400
+@@ -45,7 +45,7 @@ for opt in opt_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
""))
+ # add the prefix/lib/pythonX.Y/config dir, but only if there is no
+ # shared library in prefix/lib/.
+ if opt == '--ldflags':
+diff -up Python-2.7.3/Modules/makesetup.debug-build Python-2.7.3/Modules/makesetup
+--- Python-2.7.3/Modules/makesetup.debug-build 2012-04-09 19:07:34.000000000 -0400
++++ Python-2.7.3/Modules/makesetup 2012-04-13 00:13:53.931498561 -0400
+@@ -233,7 +233,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
+ *$mod.o*) base=$mod;;
+ *) base=${mod}module;;
+ esac
+- file="$srcdir/$base\$(SO)"
++ file="$srcdir/$base\$(DEBUG_EXT)\$(SO)"
+ case $doconfig in
+ no) SHAREDMODS="$SHAREDMODS $file";;
+ esac
+diff -up Python-2.7.3/Python/dynload_shlib.c.debug-build
Python-2.7.3/Python/dynload_shlib.c
+--- Python-2.7.3/Python/dynload_shlib.c.debug-build 2012-04-09 19:07:35.000000000 -0400
++++ Python-2.7.3/Python/dynload_shlib.c 2012-04-13 00:13:53.931498561 -0400
+@@ -46,11 +46,16 @@ const struct filedescr _PyImport_DynLoad
+ {"module.exe", "rb", C_EXTENSION},
+ {"MODULE.EXE", "rb", C_EXTENSION},
+ #else
++#ifdef Py_DEBUG
++ {"_d.so", "rb", C_EXTENSION},
++ {"module_d.so", "rb", C_EXTENSION},
++#else
+ {".so", "rb", C_EXTENSION},
+ {"module.so", "rb", C_EXTENSION},
+-#endif
+-#endif
+-#endif
++#endif /* Py_DEBUG */
++#endif /* __VMS */
++#endif /* defined(PYOS_OS2) && defined(PYCC_GCC) */
++#endif /* __CYGWIN__ */
+ {0, 0}
+ };
+
+diff -up Python-2.7.3/Python/sysmodule.c.debug-build Python-2.7.3/Python/sysmodule.c
+--- Python-2.7.3/Python/sysmodule.c.debug-build 2012-04-09 19:07:35.000000000 -0400
++++ Python-2.7.3/Python/sysmodule.c 2012-04-13 00:13:53.932498549 -0400
+@@ -1506,6 +1506,12 @@ _PySys_Init(void)
+ PyString_FromString("legacy"));
+ #endif
+
++#ifdef Py_DEBUG
++ PyDict_SetItemString(sysdict, "pydebug", Py_True);
++#else
++ PyDict_SetItemString(sysdict, "pydebug", Py_False);
++#endif
++
+ #undef SET_SYS_FROM_STRING
+ if (PyErr_Occurred())
+ return NULL;
diff --git a/python-2.7.3-lib64.patch b/python-2.7.3-lib64.patch
new file mode 100644
index 0000000..470b48b
--- /dev/null
+++ b/python-2.7.3-lib64.patch
@@ -0,0 +1,196 @@
+diff -up Python-2.7.3/Lib/distutils/command/install.py.lib64
Python-2.7.3/Lib/distutils/command/install.py
+--- Python-2.7.3/Lib/distutils/command/install.py.lib64 2012-04-09 19:07:29.000000000
-0400
++++ Python-2.7.3/Lib/distutils/command/install.py 2012-04-11 17:56:41.848587174 -0400
+@@ -42,14 +42,14 @@ else:
+ INSTALL_SCHEMES = {
+ 'unix_prefix': {
+ 'purelib': '$base/lib/python$py_version_short/site-packages',
+- 'platlib':
'$platbase/lib/python$py_version_short/site-packages',
++ 'platlib':
'$platbase/lib64/python$py_version_short/site-packages',
+ 'headers': '$base/include/python$py_version_short/$dist_name',
+ 'scripts': '$base/bin',
+ 'data' : '$base',
+ },
+ 'unix_home': {
+ 'purelib': '$base/lib/python',
+- 'platlib': '$base/lib/python',
++ 'platlib': '$base/lib64/python',
+ 'headers': '$base/include/python/$dist_name',
+ 'scripts': '$base/bin',
+ 'data' : '$base',
+diff -up Python-2.7.3/Lib/distutils/sysconfig.py.lib64
Python-2.7.3/Lib/distutils/sysconfig.py
+--- Python-2.7.3/Lib/distutils/sysconfig.py.lib64 2012-04-09 19:07:29.000000000 -0400
++++ Python-2.7.3/Lib/distutils/sysconfig.py 2012-04-11 17:56:41.849587162 -0400
+@@ -114,8 +114,12 @@ def get_python_lib(plat_specific=0, stan
+ prefix = plat_specific and EXEC_PREFIX or PREFIX
+
+ if os.name == "posix":
++ if plat_specific or standard_lib:
++ lib = "lib64"
++ else:
++ lib = "lib"
+ libpython = os.path.join(prefix,
+- "lib", "python" +
get_python_version())
++ lib, "python" + get_python_version())
+ if standard_lib:
+ return libpython
+ else:
+diff -up Python-2.7.3/Lib/site.py.lib64 Python-2.7.3/Lib/site.py
+--- Python-2.7.3/Lib/site.py.lib64 2012-04-09 19:07:31.000000000 -0400
++++ Python-2.7.3/Lib/site.py 2012-04-11 17:56:41.850587149 -0400
+@@ -300,12 +300,16 @@ def getsitepackages():
+ if sys.platform in ('os2emx', 'riscos'):
+ sitepackages.append(os.path.join(prefix, "Lib",
"site-packages"))
+ elif os.sep == '/':
++ sitepackages.append(os.path.join(prefix, "lib64",
++ "python" + sys.version[:3],
++ "site-packages"))
+ sitepackages.append(os.path.join(prefix, "lib",
+ "python" + sys.version[:3],
+ "site-packages"))
+ sitepackages.append(os.path.join(prefix, "lib",
"site-python"))
+ else:
+ sitepackages.append(prefix)
++ sitepackages.append(os.path.join(prefix, "lib64",
"site-packages"))
+ sitepackages.append(os.path.join(prefix, "lib",
"site-packages"))
+ if sys.platform == "darwin":
+ # for framework builds *only* we add the standard Apple
+diff -up Python-2.7.3/Lib/test/test_site.py.lib64 Python-2.7.3/Lib/test/test_site.py
+--- Python-2.7.3/Lib/test/test_site.py.lib64 2012-04-09 19:07:32.000000000 -0400
++++ Python-2.7.3/Lib/test/test_site.py 2012-04-11 17:58:52.981947780 -0400
+@@ -241,17 +241,20 @@ class HelperFunctionsTests(unittest.Test
+ self.assertEqual(dirs[2], wanted)
+ elif os.sep == '/':
+ # OS X non-framwework builds, Linux, FreeBSD, etc
+- self.assertEqual(len(dirs), 2)
+- wanted = os.path.join('xoxo', 'lib', 'python' +
sys.version[:3],
++ self.assertEqual(len(dirs), 3)
++ wanted = os.path.join('xoxo', 'lib64', 'python' +
sys.version[:3],
+ 'site-packages')
+ self.assertEqual(dirs[0], wanted)
+- wanted = os.path.join('xoxo', 'lib', 'site-python')
++ wanted = os.path.join('xoxo', 'lib', 'python' +
sys.version[:3],
++ 'site-packages')
+ self.assertEqual(dirs[1], wanted)
++ wanted = os.path.join('xoxo', 'lib', 'site-python')
++ self.assertEqual(dirs[2], wanted)
+ else:
+ # other platforms
+ self.assertEqual(len(dirs), 2)
+ self.assertEqual(dirs[0], 'xoxo')
+- wanted = os.path.join('xoxo', 'lib',
'site-packages')
++ wanted = os.path.join('xoxo', 'lib64',
'site-packages')
+ self.assertEqual(dirs[1], wanted)
+
+ class PthFile(object):
+diff -up Python-2.7.3/Makefile.pre.in.lib64 Python-2.7.3/Makefile.pre.in
+--- Python-2.7.3/Makefile.pre.in.lib64 2012-04-11 17:56:41.829587411 -0400
++++ Python-2.7.3/Makefile.pre.in 2012-04-11 17:56:41.852587123 -0400
+@@ -97,7 +97,7 @@ LIBDIR= @libdir@
+ MANDIR= @mandir@
+ INCLUDEDIR= @includedir@
+ CONFINCLUDEDIR= $(exec_prefix)/include
+-SCRIPTDIR= $(prefix)/lib
++SCRIPTDIR= $(prefix)/lib64
+
+ # Detailed destination directories
+ BINLIBDEST= $(LIBDIR)/python$(VERSION)
+diff -up Python-2.7.3/Modules/getpath.c.lib64 Python-2.7.3/Modules/getpath.c
+--- Python-2.7.3/Modules/getpath.c.lib64 2012-04-09 19:07:34.000000000 -0400
++++ Python-2.7.3/Modules/getpath.c 2012-04-11 17:56:41.853587110 -0400
+@@ -117,8 +117,8 @@
+ #endif
+
+ #ifndef PYTHONPATH
+-#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
+- EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
++#define PYTHONPATH PREFIX "/lib64/python" VERSION ":" \
++ EXEC_PREFIX "/lib64/python" VERSION "/lib-dynload"
+ #endif
+
+ #ifndef LANDMARK
+@@ -129,7 +129,7 @@ static char prefix[MAXPATHLEN+1];
+ static char exec_prefix[MAXPATHLEN+1];
+ static char progpath[MAXPATHLEN+1];
+ static char *module_search_path = NULL;
+-static char lib_python[] = "lib/python" VERSION;
++static char lib_python[] = "lib64/python" VERSION;
+
+ static void
+ reduce(char *dir)
+@@ -528,7 +528,7 @@ calculate_path(void)
+ }
+ else
+ strncpy(zip_path, PREFIX, MAXPATHLEN);
+- joinpath(zip_path, "lib/python00.zip");
++ joinpath(zip_path, "lib64/python00.zip");
+ bufsz = strlen(zip_path); /* Replace "00" with version */
+ zip_path[bufsz - 6] = VERSION[0];
+ zip_path[bufsz - 5] = VERSION[2];
+@@ -538,7 +538,7 @@ calculate_path(void)
+ fprintf(stderr,
+ "Could not find platform dependent libraries
<exec_prefix>\n");
+ strncpy(exec_prefix, EXEC_PREFIX, MAXPATHLEN);
+- joinpath(exec_prefix, "lib/lib-dynload");
++ joinpath(exec_prefix, "lib64/lib-dynload");
+ }
+ /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */
+
+diff -up Python-2.7.3/Modules/Setup.dist.lib64 Python-2.7.3/Modules/Setup.dist
+--- Python-2.7.3/Modules/Setup.dist.lib64 2012-04-11 17:56:41.820587523 -0400
++++ Python-2.7.3/Modules/Setup.dist 2012-04-11 17:56:41.854587097 -0400
+@@ -413,7 +413,7 @@ gdbm gdbmmodule.c -lgdbm
+ # and the subdirectory of PORT where you built it.
+ DBLIBVER=4.7
+ DBINC=/usr/include/db4
+-DBLIB=/usr/lib
++DBLIB=/usr/lib64
+ _bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
+
+ # Historical Berkeley DB 1.85
+@@ -459,7 +459,7 @@ cPickle cPickle.c
+ # Andrew Kuchling's zlib module.
+ # This require zlib 1.1.3 (or later).
+ # See
http://www.gzip.org/zlib/
+-zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
++zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib64 -lz
+
+ # Interface to the Expat XML parser
+ #
+diff -up Python-2.7.3/setup.py.lib64 Python-2.7.3/setup.py
+--- Python-2.7.3/setup.py.lib64 2012-04-09 19:07:36.000000000 -0400
++++ Python-2.7.3/setup.py 2012-04-11 17:56:41.856587073 -0400
+@@ -369,7 +369,7 @@ class PyBuildExt(build_ext):
+
+ def detect_modules(self):
+ # Ensure that /usr/local is always used
+- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
++ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib64')
+ add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+ self.add_multiarch_paths()
+
+@@ -677,11 +677,11 @@ class PyBuildExt(build_ext):
+ elif curses_library:
+ readline_libs.append(curses_library)
+ elif self.compiler.find_library_file(lib_dirs +
+- ['/usr/lib/termcap'],
++ ['/usr/lib64/termcap'],
+ 'termcap'):
+ readline_libs.append('termcap')
+ exts.append( Extension('readline', ['readline.c'],
+- library_dirs=['/usr/lib/termcap'],
++ library_dirs=['/usr/lib64/termcap'],
+ extra_link_args=readline_extra_link_args,
+ libraries=readline_libs) )
+ else:
+@@ -715,8 +715,8 @@ class PyBuildExt(build_ext):
+ if krb5_h:
+ ssl_incs += krb5_h
+ ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
+- ['/usr/local/ssl/lib',
+- '/usr/contrib/ssl/lib/'
++ ['/usr/local/ssl/lib64',
++ '/usr/contrib/ssl/lib64/'
+ ] )
+
+ if (ssl_incs is not None and
diff --git a/python-2.7rc1-codec-ascii-tolower.patch
b/python-2.7rc1-codec-ascii-tolower.patch
deleted file mode 100644
index bd70c40..0000000
--- a/python-2.7rc1-codec-ascii-tolower.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -up Python-2.7rc1/Python/codecs.c.ascii-tolower Python-2.7rc1/Python/codecs.c
---- Python-2.7rc1/Python/codecs.c.ascii-tolower 2010-05-09 10:46:46.000000000 -0400
-+++ Python-2.7rc1/Python/codecs.c 2010-06-06 05:06:15.373100357 -0400
-@@ -45,6 +45,11 @@ int PyCodec_Register(PyObject *search_fu
- return -1;
- }
-
-+/* isupper() forced into the ASCII Locale */
-+#define ascii_isupper(x) (((x) >= 0x41) && ((x) <= 0x5A))
-+/* tolower() forced into the ASCII Locale */
-+#define ascii_tolower(x) (ascii_isupper(x) ? ((x) + 0x20) : (x))
-+
- /* Convert a string to a normalized Python string: all characters are
- converted to lower case, spaces are replaced with underscores. */
-
-@@ -70,7 +75,7 @@ PyObject *normalizestring(const char *st
- if (ch == ' ')
- ch = '-';
- else
-- ch = tolower(Py_CHARMASK(ch));
-+ ch = ascii_tolower(Py_CHARMASK(ch));
- p[i] = ch;
- }
- return v;
diff --git a/python-2.7rc1-debug-build.patch b/python-2.7rc1-debug-build.patch
deleted file mode 100644
index e3cc3ac..0000000
--- a/python-2.7rc1-debug-build.patch
+++ /dev/null
@@ -1,257 +0,0 @@
-diff -up Python-2.7rc2/configure.in.debug-build Python-2.7rc2/configure.in
---- Python-2.7rc2/configure.in.debug-build 2010-06-24 12:59:28.166319997 -0400
-+++ Python-2.7rc2/configure.in 2010-06-24 12:59:28.179376823 -0400
-@@ -641,7 +641,7 @@ AC_SUBST(LIBRARY)
- AC_MSG_CHECKING(LIBRARY)
- if test -z "$LIBRARY"
- then
-- LIBRARY='libpython$(VERSION).a'
-+ LIBRARY='libpython$(VERSION)$(DEBUG_EXT).a'
- fi
- AC_MSG_RESULT($LIBRARY)
-
-@@ -786,8 +786,8 @@ if test $enable_shared = "yes"; then
- INSTSONAME="$LDLIBRARY".$SOVERSION
- ;;
- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*)
-- LDLIBRARY='libpython$(VERSION).so'
-- BLDLIBRARY='-L. -lpython$(VERSION)'
-+ LDLIBRARY='libpython$(VERSION)$(DEBUG_EXT).so'
-+ BLDLIBRARY='-L. -lpython$(VERSION)$(DEBUG_EXT)'
- RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
- case $ac_sys_system in
- FreeBSD*)
-@@ -892,6 +892,14 @@ else AC_MSG_RESULT(no); Py_DEBUG='false'
- fi],
- [AC_MSG_RESULT(no)])
-
-+if test "$Py_DEBUG" = 'true'
-+then
-+ DEBUG_EXT=_d
-+ DEBUG_SUFFIX=-debug
-+fi
-+AC_SUBST(DEBUG_EXT)
-+AC_SUBST(DEBUG_SUFFIX)
-+
- # XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
- # merged with this chunk of code?
-
-diff -up Python-2.7rc2/Lib/distutils/command/build_ext.py.debug-build
Python-2.7rc2/Lib/distutils/command/build_ext.py
---- Python-2.7rc2/Lib/distutils/command/build_ext.py.debug-build 2010-04-01
14:17:09.000000000 -0400
-+++ Python-2.7rc2/Lib/distutils/command/build_ext.py 2010-06-24 12:59:28.179376823 -0400
-@@ -677,7 +677,10 @@ class build_ext (Command):
- so_ext = get_config_var('SO')
- if os.name == 'nt' and self.debug:
- return os.path.join(*ext_path) + '_d' + so_ext
-- return os.path.join(*ext_path) + so_ext
-+
-+ # Similarly, extensions in debug mode are named 'module_d.so', to
-+ # avoid adding the _d to the SO config variable:
-+ return os.path.join(*ext_path) + (sys.pydebug and "_d" or
"") + so_ext
-
- def get_export_symbols (self, ext):
- """Return the list of symbols that a shared extension has to
-@@ -760,6 +763,8 @@ class build_ext (Command):
- template = "python%d.%d"
- pythonlib = (template %
- (sys.hexversion >> 24, (sys.hexversion >> 16)
& 0xff))
-+ if sys.pydebug:
-+ pythonlib += '_d'
- return ext.libraries + [pythonlib]
- else:
- return ext.libraries
-diff -up Python-2.7rc2/Lib/distutils/sysconfig.py.debug-build
Python-2.7rc2/Lib/distutils/sysconfig.py
---- Python-2.7rc2/Lib/distutils/sysconfig.py.debug-build 2010-06-24 12:59:28.145319202
-0400
-+++ Python-2.7rc2/Lib/distutils/sysconfig.py 2010-06-24 12:59:28.180381519 -0400
-@@ -85,7 +85,8 @@ 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())
-+ return os.path.join(prefix, "include",
-+ "python" + get_python_version() + (sys.pydebug and
'-debug' or ''))
- elif os.name == "nt":
- return os.path.join(prefix, "include")
- elif os.name == "os2":
-@@ -211,7 +212,7 @@ def get_makefile_filename():
- if python_build:
- return os.path.join(os.path.dirname(sys.executable), "Makefile")
- lib_dir = get_python_lib(plat_specific=1, standard_lib=1)
-- return os.path.join(lib_dir, "config", "Makefile")
-+ return os.path.join(lib_dir, "config" + (sys.pydebug and
"-debug" or ""), "Makefile")
-
-
- def parse_config_h(fp, g=None):
-diff -up Python-2.7rc2/Makefile.pre.in.debug-build Python-2.7rc2/Makefile.pre.in
---- Python-2.7rc2/Makefile.pre.in.debug-build 2010-06-24 12:59:28.175377249 -0400
-+++ Python-2.7rc2/Makefile.pre.in 2010-06-24 13:01:24.559945307 -0400
-@@ -99,8 +99,8 @@ SCRIPTDIR= $(prefix)/lib64
- # Detailed destination directories
- BINLIBDEST= $(LIBDIR)/python$(VERSION)
- LIBDEST= $(SCRIPTDIR)/python$(VERSION)
--INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
--CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)
-+INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)$(DEBUG_SUFFIX)
-+CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)$(DEBUG_SUFFIX)
- LIBP= $(LIBDIR)/python$(VERSION)
-
- # Symbols used for using shared libraries
-@@ -114,6 +114,12 @@ DESTSHARED= $(BINLIBDEST)/lib-dynload
- EXE= @EXEEXT@
- BUILDEXE= @BUILDEXEEXT@
-
-+# DEBUG_EXT is used by ELF files (names and SONAMEs); it will be "_d" for a
debug build
-+# DEBUG_SUFFIX is used by filesystem paths; it will be "-debug" for a debug
build
-+# Both will be empty in an optimized build
-+DEBUG_EXT= @DEBUG_EXT@
-+DEBUG_SUFFIX= @DEBUG_SUFFIX@
-+
- # Short name and location for Mac OS X Python framework
- UNIVERSALSDK=@UNIVERSALSDK@
- PYTHONFRAMEWORK= @PYTHONFRAMEWORK@
-@@ -177,8 +183,8 @@ LIBOBJDIR= Python/
- LIBOBJS= @LIBOBJS@
- UNICODE_OBJS= @UNICODE_OBJS@
-
--PYTHON= python$(EXE)
--BUILDPYTHON= python$(BUILDEXE)
-+PYTHON= python$(DEBUG_SUFFIX)$(EXE)
-+BUILDPYTHON= python$(DEBUG_SUFFIX)$(BUILDEXE)
-
- # The task to run while instrument when building the profile-opt target
- PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck
-@@ -409,7 +415,7 @@ sharedmods: $(BUILDPYTHON)
- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)'
LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py
build;; \
- esac
-
--libpython$(VERSION).so: $(LIBRARY_OBJS)
-+libpython$(VERSION)$(DEBUG_EXT).so: $(LIBRARY_OBJS)
- if test $(INSTSONAME) != $(LDLIBRARY); then \
- $(LDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS)
$(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
- $(LN) -f $(INSTSONAME) $@; \
-@@ -788,9 +794,9 @@ bininstall: altbininstall
- then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON); \
- else true; \
- fi
-- (cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON))
-- -rm -f $(DESTDIR)$(BINDIR)/python-config
-- (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python-config)
-+ (cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(DEBUG_SUFFIX)$(EXE) $(PYTHON))
-+ -rm -f $(DESTDIR)$(BINDIR)/python$(DEBUG_SUFFIX)-config
-+ (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(DEBUG_SUFFIX)-config
python$(DEBUG_SUFFIX)-config)
- -test -d $(DESTDIR)$(LIBPC) || $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(LIBPC)
- -rm -f $(DESTDIR)$(LIBPC)/python.pc
- (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python.pc)
-@@ -806,7 +812,7 @@ altbininstall: $(BUILDPYTHON)
- else true; \
- fi; \
- done
-- $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE)
-+ $(INSTALL_PROGRAM) $(BUILDPYTHON)
$(DESTDIR)$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)$(EXE)
- if test -f $(LDLIBRARY); then \
- if test -n "$(DLLLIBRARY)" ; then \
- $(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
-@@ -951,10 +957,11 @@ $(srcdir)/Lib/$(PLATDIR):
- export EXE; EXE="$(BUILDEXE)"; \
- cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen
-
--python-config: $(srcdir)/Misc/python-config.in
-+python$(DEBUG_SUFFIX)-config: $(srcdir)/Misc/python-config.in
- # 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
-+ sed -e "s,@EXENAME@,$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)$(EXE)," <
$(srcdir)/Misc/python-config.in >python$(DEBUG_SUFFIX)-config
-+
-
- # Install the include files
- INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
-@@ -975,13 +982,13 @@ inclinstall:
- $(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
-
- # Install the library and miscellaneous stuff needed for extending/embedding
--# This goes into $(exec_prefix)
--LIBPL= $(LIBP)/config
-+# This goes into $(exec_prefix)$(DEBUG_SUFFIX)
-+LIBPL= $(LIBP)/config$(DEBUG_SUFFIX)
-
- # pkgconfig directory
- LIBPC= $(LIBDIR)/pkgconfig
-
--libainstall: all python-config
-+libainstall: all python$(DEBUG_SUFFIX)-config
- @for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \
- do \
- if test ! -d $(DESTDIR)$$i; then \
-@@ -1000,8 +1007,7 @@ libainstall: all python-config
- $(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc
- $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
- $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
-- $(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(VERSION)-config
-- rm python-config
-+ $(INSTALL_SCRIPT) python$(DEBUG_SUFFIX)-config
$(DESTDIR)$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)-config
- @if [ -s Modules/python.exp -a \
- "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ];
then \
- echo; echo "Installing support files for building shared extension modules on
AIX:"; \
-diff -up Python-2.7rc2/Misc/python-config.in.debug-build
Python-2.7rc2/Misc/python-config.in
---- Python-2.7rc2/Misc/python-config.in.debug-build 2010-03-18 20:08:44.000000000 -0400
-+++ Python-2.7rc2/Misc/python-config.in 2010-06-24 12:59:28.182375371 -0400
-@@ -45,7 +45,7 @@ for opt in opt_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
""))
- # add the prefix/lib/pythonX.Y/config dir, but only if there is no
- # shared library in prefix/lib/.
- if opt == '--ldflags':
-diff -up Python-2.7rc2/Modules/makesetup.debug-build Python-2.7rc2/Modules/makesetup
---- Python-2.7rc2/Modules/makesetup.debug-build 2007-09-05 07:47:34.000000000 -0400
-+++ Python-2.7rc2/Modules/makesetup 2010-06-24 12:59:28.182375371 -0400
-@@ -233,7 +233,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
- *$mod.o*) base=$mod;;
- *) base=${mod}module;;
- esac
-- file="$srcdir/$base\$(SO)"
-+ file="$srcdir/$base\$(DEBUG_EXT)\$(SO)"
- case $doconfig in
- no) SHAREDMODS="$SHAREDMODS $file";;
- esac
-diff -up Python-2.7rc2/Python/dynload_shlib.c.debug-build
Python-2.7rc2/Python/dynload_shlib.c
---- Python-2.7rc2/Python/dynload_shlib.c.debug-build 2010-05-09 10:46:46.000000000 -0400
-+++ Python-2.7rc2/Python/dynload_shlib.c 2010-06-24 12:59:28.183377733 -0400
-@@ -46,11 +46,16 @@ const struct filedescr _PyImport_DynLoad
- {"module.exe", "rb", C_EXTENSION},
- {"MODULE.EXE", "rb", C_EXTENSION},
- #else
-+#ifdef Py_DEBUG
-+ {"_d.so", "rb", C_EXTENSION},
-+ {"module_d.so", "rb", C_EXTENSION},
-+#else
- {".so", "rb", C_EXTENSION},
- {"module.so", "rb", C_EXTENSION},
--#endif
--#endif
--#endif
-+#endif /* Py_DEBUG */
-+#endif /* __VMS */
-+#endif /* defined(PYOS_OS2) && defined(PYCC_GCC) */
-+#endif /* __CYGWIN__ */
- {0, 0}
- };
-
-diff -up Python-2.7rc2/Python/sysmodule.c.debug-build Python-2.7rc2/Python/sysmodule.c
---- Python-2.7rc2/Python/sysmodule.c.debug-build 2010-05-21 13:12:38.000000000 -0400
-+++ Python-2.7rc2/Python/sysmodule.c 2010-06-24 12:59:28.184375034 -0400
-@@ -1557,6 +1557,12 @@ _PySys_Init(void)
- PyString_FromString("legacy"));
- #endif
-
-+#ifdef Py_DEBUG
-+ PyDict_SetItemString(sysdict, "pydebug", Py_True);
-+#else
-+ PyDict_SetItemString(sysdict, "pydebug", Py_False);
-+#endif
-+
- #undef SET_SYS_FROM_STRING
- if (PyErr_Occurred())
- return NULL;
diff --git a/python.spec b/python.spec
index 4e81890..e8f7ebf 100644
--- a/python.spec
+++ b/python.spec
@@ -107,8 +107,8 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
# Remember to also rebase python-docs when changing this:
-Version: 2.7.2
-Release: 20%{?dist}
+Version: 2.7.3
+Release: 1%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -308,11 +308,8 @@ Patch7: python-2.5.1-sqlite-encoding.patch
# (rhbz:307221)
Patch10: python-2.7rc1-binutils-no-dep.patch
-# FIXME: appears to relate to:
-#* Tue Oct 30 2007 James Antill <jantill(a)redhat.com> - 2.5.1-15
-#- Do codec lowercase in C Locale.
-#- Resolves: 207134 191096
-Patch11: python-2.7rc1-codec-ascii-tolower.patch
+# Upstream as of Python 2.7.3:
+# Patch11: python-2.7rc1-codec-ascii-tolower.patch
# Add various constants to the socketmodule (rhbz#436560):
# TODO: these patches were added in 2.5.1-22 and 2.5.1-24 but appear not to
@@ -358,7 +355,7 @@ Patch101: python-2.3.4-lib64-regex.patch
# and add the /usr/lib64/pythonMAJOR.MINOR/site-packages to sitedirs, in front of
# /usr/lib/pythonMAJOR.MINOR/site-packages
# Not upstream
-Patch102: python-2.7.1-lib64.patch
+Patch102: python-2.7.3-lib64.patch
# Python 2.7 split out much of the path-handling from distutils/sysconfig.py to
# a new sysconfig.py (in r77704).
@@ -435,7 +432,7 @@ Patch111: 00111-no-static-lib.patch
#
# See also patch 130 below
#
-Patch112: python-2.7rc1-debug-build.patch
+Patch112: python-2.7.3-debug-build.patch
# Add configure-time support for the COUNT_ALLOCS and CALL_PROFILE options
@@ -448,9 +445,8 @@ Patch113: 00113-more-configuration-flags.patch
# (rhbz:553020); partially upstream as
http://bugs.python.org/issue7647
Patch114: 00114-statvfs-f_flag-constants.patch
-# Make "pydoc -k" more robust in the face of broken modules
-# (rhbz:461419; patch sent upstream as
http://bugs.python.org/issue7425 )
-Patch115: make-pydoc-more-robust-001.patch
+# Upstream as of Python 2.7.3:
+# Patch115: make-pydoc-more-robust-001.patch
# Upstream r79310 removed the "Modules" directory from sys.path when Python is
# running from the build directory on POSIX to fix a unit test (issue #8205).
@@ -568,12 +564,8 @@ Patch143: 00143-tsc-on-ppc.patch
# (Optionally) disable the gdbm module:
Patch144: 00144-no-gdbm.patch
-# Force MACHDEP and thus sys.platform to be "linux2" even on systems with
-# linux 3, given that the distinction is meaningless (especially in Koji, where
-# "uname" reflects the kernel running _outside_ the mock-provided chroot).
-#
-# Backport of part of fix for
http://bugs.python.org/issue12326
-Patch145: 00145-force-sys-platform-to-be-linux2.patch
+# Upstream as of Python 2.7.3:
+# Patch145: 00145-force-sys-platform-to-be-linux2.patch
# Support OpenSSL FIPS mode (e.g. when OPENSSL_FORCE_FIPS_MODE=1 is set)
# - handle failures from OpenSSL (e.g. on attempts to use MD5 in a
@@ -597,9 +589,8 @@ Patch146: 00146-hashlib-fips.patch
# Not yet sent upstream
Patch147: 00147-add-debug-malloc-stats.patch
-# Cherrypick fix for dbm version detection to cope with gdbm-1.9's magic values
-# Taken from upstream
http://bugs.python.org/issue13007 (rhbz#742242)
-Patch148: 00148-gdbm-1.9-magic-values.patch
+# Upstream as of Python 2.7.3:
+# Patch148: 00148-gdbm-1.9-magic-values.patch
# python3.spec's
# Patch149: 00149-backport-issue11254-pycache-bytecompilation-fix.patch
@@ -609,10 +600,16 @@ Patch148: 00148-gdbm-1.9-magic-values.patch
# Patch150: 00150-disable-rAssertAlmostEqual-cmath-on-ppc.patch
# as a workaround for a glibc bug on PPC (bz #750811)
-# Fix deadlock in fork:
-#
https://bugzilla.redhat.com/show_bug.cgi?id=787712
-#
http://bugs.python.org/issue13817
-Patch151: 00151-fork-deadlock.patch
+# Upstream as of Python 2.7.3:
+# Patch151: 00151-fork-deadlock.patch
+
+# python3.spec has:
+# Patch152: 00152-fix-test-gdb-regex.patch
+
+# Strip out lines of the form "warning: Unable to open ..." from gdb's
stderr
+# when running test_gdb.py; also cope with change to gdb in F17 onwards in
+# which values are printed as "v@entry" rather than just "v":
+Patch153: 00153-fix-test_gdb-noise.patch
# (New patches go here ^^^)
#
@@ -865,7 +862,7 @@ done
%endif
%patch10 -p1 -b .binutils-no-dep
-%patch11 -p1 -b .ascii-tolower
+# patch11: upstream as of Python 2.7.3
%patch13 -p1 -b .socketmodule
%patch14 -p1 -b .socketmodule2
%patch16 -p1 -b .rpath
@@ -884,12 +881,12 @@ done
%patch114 -p1 -b .statvfs-f-flag-constants
-%patch115 -p0
+# patch115: upstream as of Python 2.7.3
%patch121 -p0 -R
%patch125 -p1 -b .less-verbose-COUNT_ALLOCS
%patch126 -p0 -b .fix-dbm_contains-on-64bit-bigendian
-%patch127 -p0 -b .fix-test_structmember-on-64bit-bigendian
+%patch127 -p1 -b .fix-test_structmember-on-64bit-bigendian
%patch128 -p1
%patch130 -p1
@@ -917,13 +914,15 @@ done
%if !%{with_gdbm}
%patch144 -p1
%endif
-%patch145 -p1 -b .linux2
+# 00145: upstream as of Python 2.7.3
%patch146 -p1
%patch147 -p1
-%patch148 -p1
+# 00148: upstream as of Python 2.7.3
# 00149: not for python 2
# 00150: not for python 2
-%patch151 -p1
+# 00151: upstream as of Python 2.7.3
+# 00152: not for python 2
+%patch153 -p0
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -1170,7 +1169,7 @@ cp -a save_bits_of_test/* %{buildroot}/%{pylibdir}/test
fi
%if %{main_python}
-ln -s python %{buildroot}%{_bindir}/python2
+ln -s python2.7-debug-config %{buildroot}%{_bindir}/python-debug-config
%if 0%{?with_debug_build}
ln -s python-debug %{buildroot}%{_bindir}/python2-debug
%endif # with_debug_build
@@ -1565,6 +1564,7 @@ rm -fr %{buildroot}
%defattr(-,root,root,-)
%{_libdir}/pkgconfig/python-%{pybasever}.pc
%{_libdir}/pkgconfig/python.pc
+%{_libdir}/pkgconfig/python2.pc
%{pylibdir}/config/*
%exclude %{pylibdir}/config/Makefile
%{pylibdir}/distutils/command/wininst-*.exe
@@ -1752,6 +1752,14 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Wed Apr 11 2012 David Malcolm <dmalcolm(a)redhat.com> - 2.7.3-1
+- 2.7.3: refresh patch 102 (lib64); drop upstream patches 11 (ascii-to-lower),
+115 (pydoc robustness), 145 (linux2), 148 (gdbm magic values), 151 (deadlock
+in fork); refresh patch 112 (debug build); revise patch 127
+(test_structmember); fix test_gdb (patch 153); refresh patch 137 (distutils
+tests); add python2.pc to python-devel; regenerate the autotool intermediates
+patch (patch 300)
+
* Sat Feb 25 2012 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.2-20
- fix deadlock issue (#787712)
diff --git a/sources b/sources
index c3dd414..d0fe0cc 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-75c87a80c6ddb0b785a57ea3583e04fa Python-2.7.2.tar.xz
+62c4c1699170078c469f79ddfed21bc0 Python-2.7.3.tar.xz
commit cd507002d5e7ba238d412b198c444909bae3369a
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Thu Mar 22 14:55:25 2012 -0400
specfile cleanups
Put the patches in numerical order, and rename:
python-3.2.2-fork-deadlock.patch -> 00151-fork-deadlock.patch
so that it contains the patch number
diff --git a/00151-fork-deadlock.patch b/00151-fork-deadlock.patch
new file mode 100644
index 0000000..6b1bcff
--- /dev/null
+++ b/00151-fork-deadlock.patch
@@ -0,0 +1,62 @@
+
+# HG changeset patch
+# User Charles-Franois Natali <neologix(a)free.fr>
+# Date 1328209039 -3600
+# Node ID c3649173d093ce3bb2f887c1b4c3207196f1f453
+# Parent 0b8917fc6db55d371573398c2ae29b120be40a19
+Issue #13817: After fork(), reinit the ad-hoc TLS implementation earlier to fix
+a random deadlock when fork() is called in a multithreaded process in debug
+mode, and make PyOS_AfterFork() more robust.
+
+diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
+--- a/Lib/test/test_threading.py
++++ b/Lib/test/test_threading.py
+@@ -635,6 +635,29 @@ class ThreadJoinOnShutdown(BaseTestCase)
+ output = "end of worker thread\nend of main thread\n"
+ self.assertScriptHasOutput(script, output)
+
++ @unittest.skipUnless(hasattr(os, 'fork'), "needs os.fork()")
++ def test_reinit_tls_after_fork(self):
++ # Issue #13817: fork() would deadlock in a multithreaded program with
++ # the ad-hoc TLS implementation.
++
++ def do_fork_and_wait():
++ # just fork a child process and wait it
++ pid = os.fork()
++ if pid > 0:
++ os.waitpid(pid, 0)
++ else:
++ os._exit(0)
++
++ # start a bunch of threads that will fork() child processes
++ threads = []
++ for i in range(16):
++ t = threading.Thread(target=do_fork_and_wait)
++ threads.append(t)
++ t.start()
++
++ for t in threads:
++ t.join()
++
+
+ class ThreadingExceptionTests(BaseTestCase):
+ # A RuntimeError should be raised if Thread.start() is called
+diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
+--- a/Modules/signalmodule.c
++++ b/Modules/signalmodule.c
+@@ -976,11 +976,13 @@ void
+ PyOS_AfterFork(void)
+ {
+ #ifdef WITH_THREAD
++ /* PyThread_ReInitTLS() must be called early, to make sure that the TLS API
++ * can be called safely. */
++ PyThread_ReInitTLS();
+ _PyGILState_Reinit();
+ PyEval_ReInitThreads();
+ main_thread = PyThread_get_thread_ident();
+ main_pid = getpid();
+ _PyImport_ReInitLock();
+- PyThread_ReInitTLS();
+ #endif
+ }
+
diff --git a/python-3.2.2-fork-deadlock.patch b/python-3.2.2-fork-deadlock.patch
deleted file mode 100644
index 6b1bcff..0000000
--- a/python-3.2.2-fork-deadlock.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-
-# HG changeset patch
-# User Charles-Franois Natali <neologix(a)free.fr>
-# Date 1328209039 -3600
-# Node ID c3649173d093ce3bb2f887c1b4c3207196f1f453
-# Parent 0b8917fc6db55d371573398c2ae29b120be40a19
-Issue #13817: After fork(), reinit the ad-hoc TLS implementation earlier to fix
-a random deadlock when fork() is called in a multithreaded process in debug
-mode, and make PyOS_AfterFork() more robust.
-
-diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
---- a/Lib/test/test_threading.py
-+++ b/Lib/test/test_threading.py
-@@ -635,6 +635,29 @@ class ThreadJoinOnShutdown(BaseTestCase)
- output = "end of worker thread\nend of main thread\n"
- self.assertScriptHasOutput(script, output)
-
-+ @unittest.skipUnless(hasattr(os, 'fork'), "needs os.fork()")
-+ def test_reinit_tls_after_fork(self):
-+ # Issue #13817: fork() would deadlock in a multithreaded program with
-+ # the ad-hoc TLS implementation.
-+
-+ def do_fork_and_wait():
-+ # just fork a child process and wait it
-+ pid = os.fork()
-+ if pid > 0:
-+ os.waitpid(pid, 0)
-+ else:
-+ os._exit(0)
-+
-+ # start a bunch of threads that will fork() child processes
-+ threads = []
-+ for i in range(16):
-+ t = threading.Thread(target=do_fork_and_wait)
-+ threads.append(t)
-+ t.start()
-+
-+ for t in threads:
-+ t.join()
-+
-
- class ThreadingExceptionTests(BaseTestCase):
- # A RuntimeError should be raised if Thread.start() is called
-diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
---- a/Modules/signalmodule.c
-+++ b/Modules/signalmodule.c
-@@ -976,11 +976,13 @@ void
- PyOS_AfterFork(void)
- {
- #ifdef WITH_THREAD
-+ /* PyThread_ReInitTLS() must be called early, to make sure that the TLS API
-+ * can be called safely. */
-+ PyThread_ReInitTLS();
- _PyGILState_Reinit();
- PyEval_ReInitThreads();
- main_thread = PyThread_get_thread_ident();
- main_pid = getpid();
- _PyImport_ReInitLock();
-- PyThread_ReInitTLS();
- #endif
- }
-
diff --git a/python.spec b/python.spec
index b39ebd1..4e81890 100644
--- a/python.spec
+++ b/python.spec
@@ -601,15 +601,19 @@ Patch147: 00147-add-debug-malloc-stats.patch
# Taken from upstream
http://bugs.python.org/issue13007 (rhbz#742242)
Patch148: 00148-gdbm-1.9-magic-values.patch
-# Fix deadlock in fork:
-#
https://bugzilla.redhat.com/show_bug.cgi?id=787712
-#
http://bugs.python.org/issue13817
-Patch151: python-3.2.2-fork-deadlock.patch
-
# python3.spec's
# Patch149: 00149-backport-issue11254-pycache-bytecompilation-fix.patch
# is not relevant for Python 2
+# python3.spec has:
+# Patch150: 00150-disable-rAssertAlmostEqual-cmath-on-ppc.patch
+# as a workaround for a glibc bug on PPC (bz #750811)
+
+# Fix deadlock in fork:
+#
https://bugzilla.redhat.com/show_bug.cgi?id=787712
+#
http://bugs.python.org/issue13817
+Patch151: 00151-fork-deadlock.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -918,6 +922,7 @@ done
%patch147 -p1
%patch148 -p1
# 00149: not for python 2
+# 00150: not for python 2
%patch151 -p1
commit 9bf1f8f3bb1f47074db70e957142c99a91c3e673
Author: Thomas Spura <thomas.spura(a)gmail.com>
Date: Sat Feb 25 21:34:30 2012 +0100
fix deadlock issue
diff --git a/python-3.2.2-fork-deadlock.patch b/python-3.2.2-fork-deadlock.patch
new file mode 100644
index 0000000..6b1bcff
--- /dev/null
+++ b/python-3.2.2-fork-deadlock.patch
@@ -0,0 +1,62 @@
+
+# HG changeset patch
+# User Charles-Franois Natali <neologix(a)free.fr>
+# Date 1328209039 -3600
+# Node ID c3649173d093ce3bb2f887c1b4c3207196f1f453
+# Parent 0b8917fc6db55d371573398c2ae29b120be40a19
+Issue #13817: After fork(), reinit the ad-hoc TLS implementation earlier to fix
+a random deadlock when fork() is called in a multithreaded process in debug
+mode, and make PyOS_AfterFork() more robust.
+
+diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
+--- a/Lib/test/test_threading.py
++++ b/Lib/test/test_threading.py
+@@ -635,6 +635,29 @@ class ThreadJoinOnShutdown(BaseTestCase)
+ output = "end of worker thread\nend of main thread\n"
+ self.assertScriptHasOutput(script, output)
+
++ @unittest.skipUnless(hasattr(os, 'fork'), "needs os.fork()")
++ def test_reinit_tls_after_fork(self):
++ # Issue #13817: fork() would deadlock in a multithreaded program with
++ # the ad-hoc TLS implementation.
++
++ def do_fork_and_wait():
++ # just fork a child process and wait it
++ pid = os.fork()
++ if pid > 0:
++ os.waitpid(pid, 0)
++ else:
++ os._exit(0)
++
++ # start a bunch of threads that will fork() child processes
++ threads = []
++ for i in range(16):
++ t = threading.Thread(target=do_fork_and_wait)
++ threads.append(t)
++ t.start()
++
++ for t in threads:
++ t.join()
++
+
+ class ThreadingExceptionTests(BaseTestCase):
+ # A RuntimeError should be raised if Thread.start() is called
+diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
+--- a/Modules/signalmodule.c
++++ b/Modules/signalmodule.c
+@@ -976,11 +976,13 @@ void
+ PyOS_AfterFork(void)
+ {
+ #ifdef WITH_THREAD
++ /* PyThread_ReInitTLS() must be called early, to make sure that the TLS API
++ * can be called safely. */
++ PyThread_ReInitTLS();
+ _PyGILState_Reinit();
+ PyEval_ReInitThreads();
+ main_thread = PyThread_get_thread_ident();
+ main_pid = getpid();
+ _PyImport_ReInitLock();
+- PyThread_ReInitTLS();
+ #endif
+ }
+
diff --git a/python.spec b/python.spec
index d82a615..b39ebd1 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.2
-Release: 19%{?dist}
+Release: 20%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -601,6 +601,11 @@ Patch147: 00147-add-debug-malloc-stats.patch
# Taken from upstream
http://bugs.python.org/issue13007 (rhbz#742242)
Patch148: 00148-gdbm-1.9-magic-values.patch
+# Fix deadlock in fork:
+#
https://bugzilla.redhat.com/show_bug.cgi?id=787712
+#
http://bugs.python.org/issue13817
+Patch151: python-3.2.2-fork-deadlock.patch
+
# python3.spec's
# Patch149: 00149-backport-issue11254-pycache-bytecompilation-fix.patch
# is not relevant for Python 2
@@ -913,6 +918,7 @@ done
%patch147 -p1
%patch148 -p1
# 00149: not for python 2
+%patch151 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -1741,6 +1747,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Sat Feb 25 2012 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.2-20
+- fix deadlock issue (#787712)
+
* Fri Feb 17 2012 Toshio Kuratomi <toshio(a)fedoraproject.org> - 2.7.2-19
- Obsolete python-sqlite2
commit e36d6e71124e0a7b326f6777b924c544ba6ac0fe
Author: Toshio Kuratomi <toshio(a)fedoraproject.org>
Date: Fri Feb 17 18:43:27 2012 -0800
Obsolete python-sqlite2
diff --git a/python.spec b/python.spec
index 5a26f8a..d82a615 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.2
-Release: 18%{?dist}
+Release: 19%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -649,6 +649,12 @@ Provides: python-hashlib = 20081120
Obsoletes: python-uuid < 1.31
Provides: python-uuid = 1.31
+# python-sqlite2-2.3.5-5.fc18 was retired. Obsolete the old package here
+# so it gets uninstalled on updates
+%if 0%{?fedora} >= 17
+Obsoletes: python-sqlite2 <= 2.3.5-6
+%endif
+
# python-argparse is part of python as of version 2.7
# drop this Provides in F17
# (having Obsoletes here caused problems with multilib; see rhbz#667984)
@@ -1735,6 +1741,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Fri Feb 17 2012 Toshio Kuratomi <toshio(a)fedoraproject.org> - 2.7.2-19
+- Obsolete python-sqlite2
+
* Thu Nov 24 2011 Ville Skytt <ville.skytta(a)iki.fi> - 2.7.2-18
- Build with $RPM_LD_FLAGS (#756862).
- Use xz-compressed source tarball.
commit 0473b081d86185281f9d3542ed6aa3a0953e6260
Author: Ville Skytt <ville.skytta(a)iki.fi>
Date: Thu Nov 24 23:59:22 2011 +0200
Build with $RPM_LD_FLAGS (#756862).
Use xz-compressed source tarball.
diff --git a/.gitignore b/.gitignore
index c2cf9a1..dafa321 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1 @@
-Python-2.7.tar.bz2
-/Python-2.7.1.tar.bz2
-/Python-2.7.2.tar.bz2
+/*.tar.*
diff --git a/python.spec b/python.spec
index c098721..5a26f8a 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.2
-Release: 17%{?dist}
+Release: 18%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -167,7 +167,7 @@ BuildRequires: zlib-devel
# Source code and patches
# =======================
-Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
+Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz
# Work around bug 562906 until it's fixed in rpm-build by providing a fixed
# version of pythondeps.sh:
@@ -930,6 +930,7 @@ export CXXFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC
-fwrapv"
export CPPFLAGS="$(pkg-config --cflags-only-I libffi)"
export OPT="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv"
export LINKCC="gcc"
+export LDFLAGS="$RPM_LD_FLAGS"
if pkg-config openssl ; then
export CFLAGS="$CFLAGS $(pkg-config --cflags openssl)"
export LDFLAGS="$LDFLAGS $(pkg-config --libs-only-L openssl)"
@@ -1734,6 +1735,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu Nov 24 2011 Ville Skytt <ville.skytta(a)iki.fi> - 2.7.2-18
+- Build with $RPM_LD_FLAGS (#756862).
+- Use xz-compressed source tarball.
+
* Wed Oct 26 2011 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.7.2-17
- Rebuilt for glibc bug#747377
diff --git a/sources b/sources
index 44a6a4f..c3dd414 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-ba7b2f11ffdbf195ee0d111b9455a5bd Python-2.7.2.tar.bz2
+75c87a80c6ddb0b785a57ea3583e04fa Python-2.7.2.tar.xz
commit efe08214a2222ae48f1772a0c3f5e97cf3641b4e
Author: Dennis Gilmore <dennis(a)ausil.us>
Date: Wed Oct 26 19:19:42 2011 -0500
- Rebuilt for glibc bug#747377
diff --git a/python.spec b/python.spec
index e7b117d..c098721 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.2
-Release: 16%{?dist}
+Release: 17%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1734,6 +1734,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Wed Oct 26 2011 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.7.2-17
+- Rebuilt for glibc bug#747377
+
* Fri Sep 30 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-16
- re-enable gdbm (patch 148; rhbz#742242)
commit df914e1fa2c48ec1542dbf256b03547c5044e23d
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Mon Oct 10 17:19:56 2011 -0400
add note about patch 149 (python3 only)
diff --git a/python.spec b/python.spec
index 5bb7b35..e7b117d 100644
--- a/python.spec
+++ b/python.spec
@@ -601,6 +601,10 @@ Patch147: 00147-add-debug-malloc-stats.patch
# Taken from upstream
http://bugs.python.org/issue13007 (rhbz#742242)
Patch148: 00148-gdbm-1.9-magic-values.patch
+# python3.spec's
+# Patch149: 00149-backport-issue11254-pycache-bytecompilation-fix.patch
+# is not relevant for Python 2
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -902,6 +906,8 @@ done
%patch146 -p1
%patch147 -p1
%patch148 -p1
+# 00149: not for python 2
+
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
commit 05e8316d54fa859f672c723ac939897731a0a2dd
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Fri Sep 30 16:45:14 2011 -0400
re-enable gdbm (patch 148; rhbz#742242)
* Fri Sep 30 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-16
- re-enable gdbm (patch 148; rhbz#742242)
diff --git a/00148-gdbm-1.9-magic-values.patch b/00148-gdbm-1.9-magic-values.patch
new file mode 100644
index 0000000..5f1d881
--- /dev/null
+++ b/00148-gdbm-1.9-magic-values.patch
@@ -0,0 +1,13 @@
+diff -up Python-2.7.2/Lib/whichdb.py.gdbm-1.9-magic Python-2.7.2/Lib/whichdb.py
+--- Python-2.7.2/Lib/whichdb.py.gdbm-1.9-magic 2011-06-11 11:46:26.000000000 -0400
++++ Python-2.7.2/Lib/whichdb.py 2011-09-30 15:45:21.778872290 -0400
+@@ -91,7 +91,7 @@ def whichdb(filename):
+ return ""
+
+ # Check for GNU dbm
+- if magic == 0x13579ace:
++ if magic in (0x13579ace, 0x13579acd, 0x13579acf):
+ return "gdbm"
+
+ # Check for old Berkeley db hash file format v2
+diff -up Python-2.7.2/Misc/NEWS.gdbm-1.9-magic Python-2.7.2/Misc/NEWS
diff --git a/python.spec b/python.spec
index e438863..5bb7b35 100644
--- a/python.spec
+++ b/python.spec
@@ -53,7 +53,7 @@
%global with_valgrind 0
%endif
-%global with_gdbm 0
+%global with_gdbm 1
# Turn this to 0 to turn off the "check" phase:
%global run_selftest_suite 1
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.2
-Release: 15%{?dist}
+Release: 16%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -597,6 +597,10 @@ Patch146: 00146-hashlib-fips.patch
# Not yet sent upstream
Patch147: 00147-add-debug-malloc-stats.patch
+# Cherrypick fix for dbm version detection to cope with gdbm-1.9's magic values
+# Taken from upstream
http://bugs.python.org/issue13007 (rhbz#742242)
+Patch148: 00148-gdbm-1.9-magic-values.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -605,7 +609,7 @@ Patch147: 00147-add-debug-malloc-stats.patch
# - use the same patch number across both specfiles for conceptually-equivalent
# fixes, ideally with the same name
#
-# - when a patch is relevan to both specfiles, use the same introductory
+# - when a patch is relevant to both specfiles, use the same introductory
# comment in both specfiles where possible (to improve "diff" output when
# comparing them)
#
@@ -897,6 +901,7 @@ done
%patch145 -p1 -b .linux2
%patch146 -p1
%patch147 -p1
+%patch148 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -982,6 +987,7 @@ BuildPython() {
--with-tapset-install-dir=%{tapsetdir} \
%endif
--with-system-expat \
+ --with-dbmliborder=gdbm:ndbm:bdb \
$ExtraConfigArgs \
%{nil}
@@ -1722,6 +1728,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Fri Sep 30 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-16
+- re-enable gdbm (patch 148; rhbz#742242)
+
* Fri Sep 16 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-15
- add a sys._debugmallocstats() function (patch 147)
commit 044ee6e9ae8c69ce15e7bcedc6ad65354c2a0ff9
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Fri Sep 16 19:08:10 2011 -0400
fix patch 147 (_debugmallocstats)
diff --git a/00147-add-debug-malloc-stats.patch b/00147-add-debug-malloc-stats.patch
index ab0644d..25e8970 100644
--- a/00147-add-debug-malloc-stats.patch
+++ b/00147-add-debug-malloc-stats.patch
@@ -1,7 +1,6 @@
-diff -up Python-2.7.2/Include/classobject.h.add-debug-malloc-stats
Python-2.7.2/Include/classobject.h
diff -up Python-2.7.2/Include/dictobject.h.add-debug-malloc-stats
Python-2.7.2/Include/dictobject.h
---- Python-2.7.2/Include/dictobject.h.add-debug-malloc-stats 2011-09-16
17:35:22.304872006 -0400
-+++ Python-2.7.2/Include/dictobject.h 2011-09-16 17:39:53.486869422 -0400
+--- Python-2.7.2/Include/dictobject.h.add-debug-malloc-stats 2011-06-11
11:46:23.000000000 -0400
++++ Python-2.7.2/Include/dictobject.h 2011-09-16 19:03:25.105821625 -0400
@@ -150,6 +150,8 @@ PyAPI_FUNC(PyObject *) PyDict_GetItemStr
PyAPI_FUNC(int) PyDict_SetItemString(PyObject *dp, const char *key, PyObject *item);
PyAPI_FUNC(int) PyDict_DelItemString(PyObject *dp, const char *key);
@@ -13,7 +12,7 @@ diff -up Python-2.7.2/Include/dictobject.h.add-debug-malloc-stats
Python-2.7.2/I
#endif
diff -up Python-2.7.2/Include/floatobject.h.add-debug-malloc-stats
Python-2.7.2/Include/floatobject.h
--- Python-2.7.2/Include/floatobject.h.add-debug-malloc-stats 2011-06-11
11:46:23.000000000 -0400
-+++ Python-2.7.2/Include/floatobject.h 2011-09-16 17:13:54.589884287 -0400
++++ Python-2.7.2/Include/floatobject.h 2011-09-16 19:03:25.106821625 -0400
@@ -132,6 +132,7 @@ PyAPI_FUNC(PyObject *) _PyFloat_FormatAd
failure. Used in builtin_round in bltinmodule.c. */
PyAPI_FUNC(PyObject *) _Py_double_round(double x, int ndigits);
@@ -23,8 +22,8 @@ diff -up Python-2.7.2/Include/floatobject.h.add-debug-malloc-stats
Python-2.7.2/
#ifdef __cplusplus
diff -up Python-2.7.2/Include/frameobject.h.add-debug-malloc-stats
Python-2.7.2/Include/frameobject.h
---- Python-2.7.2/Include/frameobject.h.add-debug-malloc-stats 2011-09-16
17:35:44.023871801 -0400
-+++ Python-2.7.2/Include/frameobject.h 2011-09-16 17:40:10.230869260 -0400
+--- Python-2.7.2/Include/frameobject.h.add-debug-malloc-stats 2011-06-11
11:46:23.000000000 -0400
++++ Python-2.7.2/Include/frameobject.h 2011-09-16 19:03:25.107821625 -0400
@@ -80,6 +80,8 @@ PyAPI_FUNC(void) PyFrame_FastToLocals(Py
PyAPI_FUNC(int) PyFrame_ClearFreeList(void);
@@ -36,7 +35,7 @@ diff -up Python-2.7.2/Include/frameobject.h.add-debug-malloc-stats
Python-2.7.2/
diff -up Python-2.7.2/Include/intobject.h.add-debug-malloc-stats
Python-2.7.2/Include/intobject.h
--- Python-2.7.2/Include/intobject.h.add-debug-malloc-stats 2011-06-11 11:46:23.000000000
-0400
-+++ Python-2.7.2/Include/intobject.h 2011-09-16 17:13:54.589884287 -0400
++++ Python-2.7.2/Include/intobject.h 2011-09-16 19:03:25.107821625 -0400
@@ -74,6 +74,8 @@ PyAPI_FUNC(PyObject *) _PyInt_FormatAdva
char *format_spec,
Py_ssize_t format_spec_len);
@@ -47,8 +46,8 @@ diff -up Python-2.7.2/Include/intobject.h.add-debug-malloc-stats
Python-2.7.2/In
}
#endif
diff -up Python-2.7.2/Include/listobject.h.add-debug-malloc-stats
Python-2.7.2/Include/listobject.h
---- Python-2.7.2/Include/listobject.h.add-debug-malloc-stats 2011-09-16
17:35:56.608871678 -0400
-+++ Python-2.7.2/Include/listobject.h 2011-09-16 17:40:25.526869113 -0400
+--- Python-2.7.2/Include/listobject.h.add-debug-malloc-stats 2011-06-11
11:46:23.000000000 -0400
++++ Python-2.7.2/Include/listobject.h 2011-09-16 19:03:25.107821625 -0400
@@ -62,6 +62,8 @@ PyAPI_FUNC(PyObject *) _PyList_Extend(Py
#define PyList_SET_ITEM(op, i, v) (((PyListObject *)(op))->ob_item[i] = (v))
#define PyList_GET_SIZE(op) Py_SIZE(op)
@@ -59,8 +58,8 @@ diff -up Python-2.7.2/Include/listobject.h.add-debug-malloc-stats
Python-2.7.2/I
}
#endif
diff -up Python-2.7.2/Include/methodobject.h.add-debug-malloc-stats
Python-2.7.2/Include/methodobject.h
---- Python-2.7.2/Include/methodobject.h.add-debug-malloc-stats 2011-09-16
17:36:06.264871587 -0400
-+++ Python-2.7.2/Include/methodobject.h 2011-09-16 17:40:50.949868868 -0400
+--- Python-2.7.2/Include/methodobject.h.add-debug-malloc-stats 2011-06-11
11:46:23.000000000 -0400
++++ Python-2.7.2/Include/methodobject.h 2011-09-16 19:03:25.108821625 -0400
@@ -87,6 +87,10 @@ typedef struct {
PyAPI_FUNC(int) PyCFunction_ClearFreeList(void);
@@ -74,7 +73,7 @@ diff -up Python-2.7.2/Include/methodobject.h.add-debug-malloc-stats
Python-2.7.2
#endif
diff -up Python-2.7.2/Include/object.h.add-debug-malloc-stats
Python-2.7.2/Include/object.h
--- Python-2.7.2/Include/object.h.add-debug-malloc-stats 2011-06-11 11:46:23.000000000
-0400
-+++ Python-2.7.2/Include/object.h 2011-09-16 17:13:54.590884287 -0400
++++ Python-2.7.2/Include/object.h 2011-09-16 19:03:25.108821625 -0400
@@ -980,6 +980,13 @@ PyAPI_DATA(PyObject *) _PyTrash_delete_l
else \
_PyTrash_deposit_object((PyObject*)op);
@@ -91,7 +90,7 @@ diff -up Python-2.7.2/Include/object.h.add-debug-malloc-stats
Python-2.7.2/Inclu
#endif
diff -up Python-2.7.2/Include/objimpl.h.add-debug-malloc-stats
Python-2.7.2/Include/objimpl.h
--- Python-2.7.2/Include/objimpl.h.add-debug-malloc-stats 2011-06-11 11:46:23.000000000
-0400
-+++ Python-2.7.2/Include/objimpl.h 2011-09-16 17:13:54.590884287 -0400
++++ Python-2.7.2/Include/objimpl.h 2011-09-16 19:03:25.108821625 -0400
@@ -101,13 +101,13 @@ PyAPI_FUNC(void) PyObject_Free(void *);
/* Macros */
@@ -107,10 +106,9 @@ diff -up Python-2.7.2/Include/objimpl.h.add-debug-malloc-stats
Python-2.7.2/Incl
PyAPI_FUNC(void *) _PyObject_DebugMallocApi(char api, size_t nbytes);
PyAPI_FUNC(void *) _PyObject_DebugReallocApi(char api, void *p, size_t nbytes);
PyAPI_FUNC(void) _PyObject_DebugFreeApi(char api, void *p);
-diff -up Python-2.7.2/Include/setobject.h.add-debug-malloc-stats
Python-2.7.2/Include/setobject.h
diff -up Python-2.7.2/Include/stringobject.h.add-debug-malloc-stats
Python-2.7.2/Include/stringobject.h
--- Python-2.7.2/Include/stringobject.h.add-debug-malloc-stats 2011-06-11
11:46:23.000000000 -0400
-+++ Python-2.7.2/Include/stringobject.h 2011-09-16 17:13:54.591884287 -0400
++++ Python-2.7.2/Include/stringobject.h 2011-09-16 19:03:25.109821625 -0400
@@ -204,6 +204,8 @@ PyAPI_FUNC(PyObject *) _PyBytes_FormatAd
char *format_spec,
Py_ssize_t format_spec_len);
@@ -120,10 +118,9 @@ diff -up Python-2.7.2/Include/stringobject.h.add-debug-malloc-stats
Python-2.7.2
#ifdef __cplusplus
}
#endif
-diff -up Python-2.7.2/Include/tupleobject.h.add-debug-malloc-stats
Python-2.7.2/Include/tupleobject.h
diff -up Python-2.7.2/Include/unicodeobject.h.add-debug-malloc-stats
Python-2.7.2/Include/unicodeobject.h
--- Python-2.7.2/Include/unicodeobject.h.add-debug-malloc-stats 2011-06-11
11:46:23.000000000 -0400
-+++ Python-2.7.2/Include/unicodeobject.h 2011-09-16 17:13:54.591884287 -0400
++++ Python-2.7.2/Include/unicodeobject.h 2011-09-16 19:03:25.109821625 -0400
@@ -1406,6 +1406,8 @@ PyAPI_FUNC(int) _PyUnicode_IsAlpha(
Py_UNICODE ch /* Unicode character */
);
@@ -134,8 +131,8 @@ diff -up Python-2.7.2/Include/unicodeobject.h.add-debug-malloc-stats
Python-2.7.
}
#endif
diff -up Python-2.7.2/Lib/test/test_sys.py.add-debug-malloc-stats
Python-2.7.2/Lib/test/test_sys.py
---- Python-2.7.2/Lib/test/test_sys.py.add-debug-malloc-stats 2011-09-16
18:15:38.495848962 -0400
-+++ Python-2.7.2/Lib/test/test_sys.py 2011-09-16 18:32:37.048839249 -0400
+--- Python-2.7.2/Lib/test/test_sys.py.add-debug-malloc-stats 2011-09-16
19:03:25.048821626 -0400
++++ Python-2.7.2/Lib/test/test_sys.py 2011-09-16 19:03:25.110821625 -0400
@@ -473,6 +473,32 @@ class SysModuleTest(unittest.TestCase):
p.wait()
self.assertIn(executable, ["''", repr(sys.executable)])
@@ -170,8 +167,8 @@ diff -up Python-2.7.2/Lib/test/test_sys.py.add-debug-malloc-stats
Python-2.7.2/L
TPFLAGS_HAVE_GC = 1<<14
diff -up Python-2.7.2/Objects/classobject.c.add-debug-malloc-stats
Python-2.7.2/Objects/classobject.c
---- Python-2.7.2/Objects/classobject.c.add-debug-malloc-stats 2011-09-16
17:32:27.712873672 -0400
-+++ Python-2.7.2/Objects/classobject.c 2011-09-16 18:01:44.375856916 -0400
+--- Python-2.7.2/Objects/classobject.c.add-debug-malloc-stats 2011-06-11
11:46:27.000000000 -0400
++++ Python-2.7.2/Objects/classobject.c 2011-09-16 19:03:25.110821625 -0400
@@ -2670,3 +2670,12 @@ PyMethod_Fini(void)
{
(void)PyMethod_ClearFreeList();
@@ -186,8 +183,8 @@ diff -up Python-2.7.2/Objects/classobject.c.add-debug-malloc-stats
Python-2.7.2/
+ numfree, sizeof(PyMethodObject));
+}
diff -up Python-2.7.2/Objects/dictobject.c.add-debug-malloc-stats
Python-2.7.2/Objects/dictobject.c
---- Python-2.7.2/Objects/dictobject.c.add-debug-malloc-stats 2011-09-16
17:32:55.336873422 -0400
-+++ Python-2.7.2/Objects/dictobject.c 2011-09-16 18:02:13.967856635 -0400
+--- Python-2.7.2/Objects/dictobject.c.add-debug-malloc-stats 2011-06-11
11:46:27.000000000 -0400
++++ Python-2.7.2/Objects/dictobject.c 2011-09-16 19:03:25.111821625 -0400
@@ -225,6 +225,15 @@ show_track(void)
static PyDictObject *free_list[PyDict_MAXFREELIST];
static int numfree = 0;
@@ -206,7 +203,7 @@ diff -up Python-2.7.2/Objects/dictobject.c.add-debug-malloc-stats
Python-2.7.2/O
{
diff -up Python-2.7.2/Objects/floatobject.c.add-debug-malloc-stats
Python-2.7.2/Objects/floatobject.c
--- Python-2.7.2/Objects/floatobject.c.add-debug-malloc-stats 2011-06-11
11:46:27.000000000 -0400
-+++ Python-2.7.2/Objects/floatobject.c 2011-09-16 17:43:43.695867228 -0400
++++ Python-2.7.2/Objects/floatobject.c 2011-09-16 19:03:25.111821625 -0400
@@ -35,6 +35,22 @@ typedef struct _floatblock PyFloatBlock;
static PyFloatBlock *block_list = NULL;
static PyFloatObject *free_list = NULL;
@@ -231,8 +228,8 @@ diff -up Python-2.7.2/Objects/floatobject.c.add-debug-malloc-stats
Python-2.7.2/
fill_free_list(void)
{
diff -up Python-2.7.2/Objects/frameobject.c.add-debug-malloc-stats
Python-2.7.2/Objects/frameobject.c
---- Python-2.7.2/Objects/frameobject.c.add-debug-malloc-stats 2011-09-16
17:33:08.129873287 -0400
-+++ Python-2.7.2/Objects/frameobject.c 2011-09-16 18:07:58.743853347 -0400
+--- Python-2.7.2/Objects/frameobject.c.add-debug-malloc-stats 2011-06-11
11:46:27.000000000 -0400
++++ Python-2.7.2/Objects/frameobject.c 2011-09-16 19:03:25.112821625 -0400
@@ -980,3 +980,13 @@ PyFrame_Fini(void)
Py_XDECREF(builtin_object);
builtin_object = NULL;
@@ -249,7 +246,7 @@ diff -up Python-2.7.2/Objects/frameobject.c.add-debug-malloc-stats
Python-2.7.2/
+
diff -up Python-2.7.2/Objects/intobject.c.add-debug-malloc-stats
Python-2.7.2/Objects/intobject.c
--- Python-2.7.2/Objects/intobject.c.add-debug-malloc-stats 2011-06-11 11:46:27.000000000
-0400
-+++ Python-2.7.2/Objects/intobject.c 2011-09-16 17:44:27.776866803 -0400
++++ Python-2.7.2/Objects/intobject.c 2011-09-16 19:03:25.112821625 -0400
@@ -44,6 +44,23 @@ typedef struct _intblock PyIntBlock;
static PyIntBlock *block_list = NULL;
static PyIntObject *free_list = NULL;
@@ -275,8 +272,8 @@ diff -up Python-2.7.2/Objects/intobject.c.add-debug-malloc-stats
Python-2.7.2/Ob
fill_free_list(void)
{
diff -up Python-2.7.2/Objects/listobject.c.add-debug-malloc-stats
Python-2.7.2/Objects/listobject.c
---- Python-2.7.2/Objects/listobject.c.add-debug-malloc-stats 2011-09-16
17:33:18.008873189 -0400
-+++ Python-2.7.2/Objects/listobject.c 2011-09-16 18:08:54.167852819 -0400
+--- Python-2.7.2/Objects/listobject.c.add-debug-malloc-stats 2011-06-11
11:46:27.000000000 -0400
++++ Python-2.7.2/Objects/listobject.c 2011-09-16 19:03:25.113821625 -0400
@@ -109,6 +109,15 @@ PyList_Fini(void)
}
}
@@ -294,8 +291,8 @@ diff -up Python-2.7.2/Objects/listobject.c.add-debug-malloc-stats
Python-2.7.2/O
PyList_New(Py_ssize_t size)
{
diff -up Python-2.7.2/Objects/methodobject.c.add-debug-malloc-stats
Python-2.7.2/Objects/methodobject.c
---- Python-2.7.2/Objects/methodobject.c.add-debug-malloc-stats 2011-09-16
17:33:29.656873081 -0400
-+++ Python-2.7.2/Objects/methodobject.c 2011-09-16 18:08:10.607853235 -0400
+--- Python-2.7.2/Objects/methodobject.c.add-debug-malloc-stats 2011-06-11
11:46:27.000000000 -0400
++++ Python-2.7.2/Objects/methodobject.c 2011-09-16 19:03:25.113821625 -0400
@@ -412,6 +412,15 @@ PyCFunction_Fini(void)
(void)PyCFunction_ClearFreeList();
}
@@ -314,7 +311,7 @@ diff -up Python-2.7.2/Objects/methodobject.c.add-debug-malloc-stats
Python-2.7.2
existing C extensions can call.
diff -up Python-2.7.2/Objects/object.c.add-debug-malloc-stats
Python-2.7.2/Objects/object.c
--- Python-2.7.2/Objects/object.c.add-debug-malloc-stats 2011-06-11 11:46:27.000000000
-0400
-+++ Python-2.7.2/Objects/object.c 2011-09-16 17:56:21.031860008 -0400
++++ Python-2.7.2/Objects/object.c 2011-09-16 19:04:46.463820849 -0400
@@ -2334,6 +2334,23 @@ PyMem_Free(void *p)
PyMem_FREE(p);
}
@@ -322,18 +319,18 @@ diff -up Python-2.7.2/Objects/object.c.add-debug-malloc-stats
Python-2.7.2/Objec
+void
+_PyObject_DebugTypeStats(FILE *out)
+{
-+ _PyString_DebugMallocStats(out);
-+ _PyCFunction_DebugMallocStats(out);
-+ _PyDict_DebugMallocStats(out);
-+ _PyFloat_DebugMallocStats(out);
-+ _PyFrame_DebugMallocStats(out);
-+ _PyInt_DebugMallocStats(out);
-+ _PyList_DebugMallocStats(out);
-+ _PyMethod_DebugMallocStats(out);
-+ _PySet_DebugMallocStats(out);
-+ _PyTuple_DebugMallocStats(out);
++ _PyString_DebugMallocStats(out);
++ _PyCFunction_DebugMallocStats(out);
++ _PyDict_DebugMallocStats(out);
++ _PyFloat_DebugMallocStats(out);
++ _PyFrame_DebugMallocStats(out);
++ _PyInt_DebugMallocStats(out);
++ _PyList_DebugMallocStats(out);
++ _PyMethod_DebugMallocStats(out);
++ _PySet_DebugMallocStats(out);
++ _PyTuple_DebugMallocStats(out);
+#if Py_USING_UNICODE
-+ _PyUnicode_DebugMallocStats(out);
++ _PyUnicode_DebugMallocStats(out);
+#endif
+}
@@ -341,7 +338,7 @@ diff -up Python-2.7.2/Objects/object.c.add-debug-malloc-stats
Python-2.7.2/Objec
etc. Container objects that may recursively contain themselves,
diff -up Python-2.7.2/Objects/obmalloc.c.add-debug-malloc-stats
Python-2.7.2/Objects/obmalloc.c
--- Python-2.7.2/Objects/obmalloc.c.add-debug-malloc-stats 2011-06-11 11:46:27.000000000
-0400
-+++ Python-2.7.2/Objects/obmalloc.c 2011-09-16 18:29:17.935841149 -0400
++++ Python-2.7.2/Objects/obmalloc.c 2011-09-16 19:03:25.114821625 -0400
@@ -508,12 +508,10 @@ static struct arena_object* usable_arena
/* Number of arenas allocated that haven't been free()'d. */
static size_t narenas_currently_allocated = 0;
@@ -522,8 +519,8 @@ diff -up Python-2.7.2/Objects/obmalloc.c.add-debug-malloc-stats
Python-2.7.2/Obj
/* Make this function last so gcc won't inline it since the definition is
* after the reference.
diff -up Python-2.7.2/Objects/setobject.c.add-debug-malloc-stats
Python-2.7.2/Objects/setobject.c
---- Python-2.7.2/Objects/setobject.c.add-debug-malloc-stats 2011-09-16 17:33:42.223872963
-0400
-+++ Python-2.7.2/Objects/setobject.c 2011-09-16 18:09:12.870852640 -0400
+--- Python-2.7.2/Objects/setobject.c.add-debug-malloc-stats 2011-06-11 11:46:27.000000000
-0400
++++ Python-2.7.2/Objects/setobject.c 2011-09-16 19:03:25.115821625 -0400
@@ -1088,6 +1088,16 @@ PySet_Fini(void)
Py_CLEAR(emptyfrozenset);
}
@@ -543,7 +540,7 @@ diff -up Python-2.7.2/Objects/setobject.c.add-debug-malloc-stats
Python-2.7.2/Ob
{
diff -up Python-2.7.2/Objects/stringobject.c.add-debug-malloc-stats
Python-2.7.2/Objects/stringobject.c
--- Python-2.7.2/Objects/stringobject.c.add-debug-malloc-stats 2011-06-11
11:46:27.000000000 -0400
-+++ Python-2.7.2/Objects/stringobject.c 2011-09-16 17:46:41.015865533 -0400
++++ Python-2.7.2/Objects/stringobject.c 2011-09-16 19:03:25.116821625 -0400
@@ -4822,3 +4822,43 @@ void _Py_ReleaseInternedStrings(void)
Py_DECREF(interned);
interned = NULL;
@@ -589,8 +586,8 @@ diff -up Python-2.7.2/Objects/stringobject.c.add-debug-malloc-stats
Python-2.7.2
+ "mortal/immortal\n", mortal_size, immortal_size);
+}
diff -up Python-2.7.2/Objects/tupleobject.c.add-debug-malloc-stats
Python-2.7.2/Objects/tupleobject.c
---- Python-2.7.2/Objects/tupleobject.c.add-debug-malloc-stats 2011-09-16
17:33:54.008872848 -0400
-+++ Python-2.7.2/Objects/tupleobject.c 2011-09-16 18:07:05.575853855 -0400
+--- Python-2.7.2/Objects/tupleobject.c.add-debug-malloc-stats 2011-06-11
11:46:27.000000000 -0400
++++ Python-2.7.2/Objects/tupleobject.c 2011-09-16 19:03:25.116821625 -0400
@@ -44,6 +44,22 @@ show_track(void)
}
#endif
@@ -616,7 +613,7 @@ diff -up Python-2.7.2/Objects/tupleobject.c.add-debug-malloc-stats
Python-2.7.2/
PyTuple_New(register Py_ssize_t size)
diff -up Python-2.7.2/Objects/unicodeobject.c.add-debug-malloc-stats
Python-2.7.2/Objects/unicodeobject.c
--- Python-2.7.2/Objects/unicodeobject.c.add-debug-malloc-stats 2011-06-11
11:46:27.000000000 -0400
-+++ Python-2.7.2/Objects/unicodeobject.c 2011-09-16 17:27:15.119876653 -0400
++++ Python-2.7.2/Objects/unicodeobject.c 2011-09-16 19:03:25.118821625 -0400
@@ -8883,6 +8883,12 @@ _PyUnicode_Fini(void)
(void)PyUnicode_ClearFreeList();
}
@@ -630,9 +627,21 @@ diff -up Python-2.7.2/Objects/unicodeobject.c.add-debug-malloc-stats
Python-2.7.
#ifdef __cplusplus
}
#endif
+diff -up Python-2.7.2/Python/pythonrun.c.add-debug-malloc-stats
Python-2.7.2/Python/pythonrun.c
+--- Python-2.7.2/Python/pythonrun.c.add-debug-malloc-stats 2011-09-16 19:03:25.025821626
-0400
++++ Python-2.7.2/Python/pythonrun.c 2011-09-16 19:03:25.118821625 -0400
+@@ -549,7 +549,7 @@ Py_Finalize(void)
+ #endif /* Py_TRACE_REFS */
+ #ifdef PYMALLOC_DEBUG
+ if (Py_GETENV("PYTHONMALLOCSTATS"))
+- _PyObject_DebugMallocStats();
++ _PyObject_DebugMallocStats(stderr);
+ #endif
+
+ call_ll_exitfuncs();
diff -up Python-2.7.2/Python/sysmodule.c.add-debug-malloc-stats
Python-2.7.2/Python/sysmodule.c
---- Python-2.7.2/Python/sysmodule.c.add-debug-malloc-stats 2011-09-16 17:13:54.475884288
-0400
-+++ Python-2.7.2/Python/sysmodule.c 2011-09-16 17:47:22.648865136 -0400
+--- Python-2.7.2/Python/sysmodule.c.add-debug-malloc-stats 2011-09-16 19:03:25.007821626
-0400
++++ Python-2.7.2/Python/sysmodule.c 2011-09-16 19:03:25.119821625 -0400
@@ -872,6 +872,57 @@ a 11-tuple where the entries in the tupl
extern "C" {
#endif
commit a43d18ff331708af4d9cfd8358a4593f8d0bb418
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Fri Sep 16 18:41:28 2011 -0400
add a sys._debugmallocstats() function (patch 147)
* Fri Sep 16 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-15
- add a sys._debugmallocstats() function (patch 147)
diff --git a/00147-add-debug-malloc-stats.patch b/00147-add-debug-malloc-stats.patch
new file mode 100644
index 0000000..ab0644d
--- /dev/null
+++ b/00147-add-debug-malloc-stats.patch
@@ -0,0 +1,702 @@
+diff -up Python-2.7.2/Include/classobject.h.add-debug-malloc-stats
Python-2.7.2/Include/classobject.h
+diff -up Python-2.7.2/Include/dictobject.h.add-debug-malloc-stats
Python-2.7.2/Include/dictobject.h
+--- Python-2.7.2/Include/dictobject.h.add-debug-malloc-stats 2011-09-16
17:35:22.304872006 -0400
++++ Python-2.7.2/Include/dictobject.h 2011-09-16 17:39:53.486869422 -0400
+@@ -150,6 +150,8 @@ PyAPI_FUNC(PyObject *) PyDict_GetItemStr
+ PyAPI_FUNC(int) PyDict_SetItemString(PyObject *dp, const char *key, PyObject *item);
+ PyAPI_FUNC(int) PyDict_DelItemString(PyObject *dp, const char *key);
+
++PyAPI_FUNC(void) _PyDict_DebugMallocStats(FILE *out);
++
+ #ifdef __cplusplus
+ }
+ #endif
+diff -up Python-2.7.2/Include/floatobject.h.add-debug-malloc-stats
Python-2.7.2/Include/floatobject.h
+--- Python-2.7.2/Include/floatobject.h.add-debug-malloc-stats 2011-06-11
11:46:23.000000000 -0400
++++ Python-2.7.2/Include/floatobject.h 2011-09-16 17:13:54.589884287 -0400
+@@ -132,6 +132,7 @@ PyAPI_FUNC(PyObject *) _PyFloat_FormatAd
+ failure. Used in builtin_round in bltinmodule.c. */
+ PyAPI_FUNC(PyObject *) _Py_double_round(double x, int ndigits);
+
++PyAPI_FUNC(void) _PyFloat_DebugMallocStats(FILE* out);
+
+
+ #ifdef __cplusplus
+diff -up Python-2.7.2/Include/frameobject.h.add-debug-malloc-stats
Python-2.7.2/Include/frameobject.h
+--- Python-2.7.2/Include/frameobject.h.add-debug-malloc-stats 2011-09-16
17:35:44.023871801 -0400
++++ Python-2.7.2/Include/frameobject.h 2011-09-16 17:40:10.230869260 -0400
+@@ -80,6 +80,8 @@ PyAPI_FUNC(void) PyFrame_FastToLocals(Py
+
+ PyAPI_FUNC(int) PyFrame_ClearFreeList(void);
+
++PyAPI_FUNC(void) _PyFrame_DebugMallocStats(FILE *out);
++
+ /* Return the line of code the frame is currently executing. */
+ PyAPI_FUNC(int) PyFrame_GetLineNumber(PyFrameObject *);
+
+diff -up Python-2.7.2/Include/intobject.h.add-debug-malloc-stats
Python-2.7.2/Include/intobject.h
+--- Python-2.7.2/Include/intobject.h.add-debug-malloc-stats 2011-06-11 11:46:23.000000000
-0400
++++ Python-2.7.2/Include/intobject.h 2011-09-16 17:13:54.589884287 -0400
+@@ -74,6 +74,8 @@ PyAPI_FUNC(PyObject *) _PyInt_FormatAdva
+ char *format_spec,
+ Py_ssize_t format_spec_len);
+
++PyAPI_FUNC(void) _PyInt_DebugMallocStats(FILE *out);
++
+ #ifdef __cplusplus
+ }
+ #endif
+diff -up Python-2.7.2/Include/listobject.h.add-debug-malloc-stats
Python-2.7.2/Include/listobject.h
+--- Python-2.7.2/Include/listobject.h.add-debug-malloc-stats 2011-09-16
17:35:56.608871678 -0400
++++ Python-2.7.2/Include/listobject.h 2011-09-16 17:40:25.526869113 -0400
+@@ -62,6 +62,8 @@ PyAPI_FUNC(PyObject *) _PyList_Extend(Py
+ #define PyList_SET_ITEM(op, i, v) (((PyListObject *)(op))->ob_item[i] = (v))
+ #define PyList_GET_SIZE(op) Py_SIZE(op)
+
++PyAPI_FUNC(void) _PyList_DebugMallocStats(FILE *out);
++
+ #ifdef __cplusplus
+ }
+ #endif
+diff -up Python-2.7.2/Include/methodobject.h.add-debug-malloc-stats
Python-2.7.2/Include/methodobject.h
+--- Python-2.7.2/Include/methodobject.h.add-debug-malloc-stats 2011-09-16
17:36:06.264871587 -0400
++++ Python-2.7.2/Include/methodobject.h 2011-09-16 17:40:50.949868868 -0400
+@@ -87,6 +87,10 @@ typedef struct {
+
+ PyAPI_FUNC(int) PyCFunction_ClearFreeList(void);
+
++PyAPI_FUNC(void) _PyCFunction_DebugMallocStats(FILE *out);
++PyAPI_FUNC(void) _PyMethod_DebugMallocStats(FILE *out);
++
++
+ #ifdef __cplusplus
+ }
+ #endif
+diff -up Python-2.7.2/Include/object.h.add-debug-malloc-stats
Python-2.7.2/Include/object.h
+--- Python-2.7.2/Include/object.h.add-debug-malloc-stats 2011-06-11 11:46:23.000000000
-0400
++++ Python-2.7.2/Include/object.h 2011-09-16 17:13:54.590884287 -0400
+@@ -980,6 +980,13 @@ PyAPI_DATA(PyObject *) _PyTrash_delete_l
+ else \
+ _PyTrash_deposit_object((PyObject*)op);
+
++PyAPI_FUNC(void)
++_PyDebugAllocatorStats(FILE *out, const char *block_name, int num_blocks,
++ size_t sizeof_block);
++
++PyAPI_FUNC(void)
++_PyObject_DebugTypeStats(FILE *out);
++
+ #ifdef __cplusplus
+ }
+ #endif
+diff -up Python-2.7.2/Include/objimpl.h.add-debug-malloc-stats
Python-2.7.2/Include/objimpl.h
+--- Python-2.7.2/Include/objimpl.h.add-debug-malloc-stats 2011-06-11 11:46:23.000000000
-0400
++++ Python-2.7.2/Include/objimpl.h 2011-09-16 17:13:54.590884287 -0400
+@@ -101,13 +101,13 @@ PyAPI_FUNC(void) PyObject_Free(void *);
+
+ /* Macros */
+ #ifdef WITH_PYMALLOC
++PyAPI_FUNC(void) _PyObject_DebugMallocStats(FILE *out);
+ #ifdef PYMALLOC_DEBUG /* WITH_PYMALLOC && PYMALLOC_DEBUG */
+ PyAPI_FUNC(void *) _PyObject_DebugMalloc(size_t nbytes);
+ PyAPI_FUNC(void *) _PyObject_DebugRealloc(void *p, size_t nbytes);
+ PyAPI_FUNC(void) _PyObject_DebugFree(void *p);
+ PyAPI_FUNC(void) _PyObject_DebugDumpAddress(const void *p);
+ PyAPI_FUNC(void) _PyObject_DebugCheckAddress(const void *p);
+-PyAPI_FUNC(void) _PyObject_DebugMallocStats(void);
+ PyAPI_FUNC(void *) _PyObject_DebugMallocApi(char api, size_t nbytes);
+ PyAPI_FUNC(void *) _PyObject_DebugReallocApi(char api, void *p, size_t nbytes);
+ PyAPI_FUNC(void) _PyObject_DebugFreeApi(char api, void *p);
+diff -up Python-2.7.2/Include/setobject.h.add-debug-malloc-stats
Python-2.7.2/Include/setobject.h
+diff -up Python-2.7.2/Include/stringobject.h.add-debug-malloc-stats
Python-2.7.2/Include/stringobject.h
+--- Python-2.7.2/Include/stringobject.h.add-debug-malloc-stats 2011-06-11
11:46:23.000000000 -0400
++++ Python-2.7.2/Include/stringobject.h 2011-09-16 17:13:54.591884287 -0400
+@@ -204,6 +204,8 @@ PyAPI_FUNC(PyObject *) _PyBytes_FormatAd
+ char *format_spec,
+ Py_ssize_t format_spec_len);
+
++PyAPI_FUNC(void) _PyString_DebugMallocStats(FILE *out);
++
+ #ifdef __cplusplus
+ }
+ #endif
+diff -up Python-2.7.2/Include/tupleobject.h.add-debug-malloc-stats
Python-2.7.2/Include/tupleobject.h
+diff -up Python-2.7.2/Include/unicodeobject.h.add-debug-malloc-stats
Python-2.7.2/Include/unicodeobject.h
+--- Python-2.7.2/Include/unicodeobject.h.add-debug-malloc-stats 2011-06-11
11:46:23.000000000 -0400
++++ Python-2.7.2/Include/unicodeobject.h 2011-09-16 17:13:54.591884287 -0400
+@@ -1406,6 +1406,8 @@ PyAPI_FUNC(int) _PyUnicode_IsAlpha(
+ Py_UNICODE ch /* Unicode character */
+ );
+
++PyAPI_FUNC(void) _PyUnicode_DebugMallocStats(FILE *out);
++
+ #ifdef __cplusplus
+ }
+ #endif
+diff -up Python-2.7.2/Lib/test/test_sys.py.add-debug-malloc-stats
Python-2.7.2/Lib/test/test_sys.py
+--- Python-2.7.2/Lib/test/test_sys.py.add-debug-malloc-stats 2011-09-16
18:15:38.495848962 -0400
++++ Python-2.7.2/Lib/test/test_sys.py 2011-09-16 18:32:37.048839249 -0400
+@@ -473,6 +473,32 @@ class SysModuleTest(unittest.TestCase):
+ p.wait()
+ self.assertIn(executable, ["''", repr(sys.executable)])
+
++ def test_debugmallocstats(self):
++ # Test sys._debugmallocstats()
++
++ import subprocess
++
++ # Verify the default of writing to stderr:
++ p = subprocess.Popen([sys.executable,
++ '-c', 'import sys;
sys._debugmallocstats()'],
++ stderr=subprocess.PIPE)
++ out, err = p.communicate()
++ p.wait()
++ self.assertIn("arenas allocated current", err)
++
++ # Verify that we can redirect the output to a file (not a file-like
++ # object, though):
++ with open('mallocstats.txt', 'w') as out:
++ sys._debugmallocstats(out)
++ result = open('mallocstats.txt').read()
++ self.assertIn("arenas allocated current", result)
++ os.unlink('mallocstats.txt')
++
++ # Verify that the destination must be a file:
++ with self.assertRaises(TypeError):
++ sys._debugmallocstats(42)
++
++
+ class SizeofTest(unittest.TestCase):
+
+ TPFLAGS_HAVE_GC = 1<<14
+diff -up Python-2.7.2/Objects/classobject.c.add-debug-malloc-stats
Python-2.7.2/Objects/classobject.c
+--- Python-2.7.2/Objects/classobject.c.add-debug-malloc-stats 2011-09-16
17:32:27.712873672 -0400
++++ Python-2.7.2/Objects/classobject.c 2011-09-16 18:01:44.375856916 -0400
+@@ -2670,3 +2670,12 @@ PyMethod_Fini(void)
+ {
+ (void)PyMethod_ClearFreeList();
+ }
++
++/* Print summary info about the state of the optimized allocator */
++void
++_PyMethod_DebugMallocStats(FILE *out)
++{
++ _PyDebugAllocatorStats(out,
++ "free PyMethodObject",
++ numfree, sizeof(PyMethodObject));
++}
+diff -up Python-2.7.2/Objects/dictobject.c.add-debug-malloc-stats
Python-2.7.2/Objects/dictobject.c
+--- Python-2.7.2/Objects/dictobject.c.add-debug-malloc-stats 2011-09-16
17:32:55.336873422 -0400
++++ Python-2.7.2/Objects/dictobject.c 2011-09-16 18:02:13.967856635 -0400
+@@ -225,6 +225,15 @@ show_track(void)
+ static PyDictObject *free_list[PyDict_MAXFREELIST];
+ static int numfree = 0;
+
++/* Print summary info about the state of the optimized allocator */
++void
++_PyDict_DebugMallocStats(FILE *out)
++{
++ _PyDebugAllocatorStats(out,
++ "free PyDictObject", numfree,
sizeof(PyDictObject));
++}
++
++
+ void
+ PyDict_Fini(void)
+ {
+diff -up Python-2.7.2/Objects/floatobject.c.add-debug-malloc-stats
Python-2.7.2/Objects/floatobject.c
+--- Python-2.7.2/Objects/floatobject.c.add-debug-malloc-stats 2011-06-11
11:46:27.000000000 -0400
++++ Python-2.7.2/Objects/floatobject.c 2011-09-16 17:43:43.695867228 -0400
+@@ -35,6 +35,22 @@ typedef struct _floatblock PyFloatBlock;
+ static PyFloatBlock *block_list = NULL;
+ static PyFloatObject *free_list = NULL;
+
++/* Print summary info about the state of the optimized allocator */
++void
++_PyFloat_DebugMallocStats(FILE *out)
++{
++ int num_blocks = 0;
++ PyFloatBlock *block;
++
++ /* Walk the block list, counting */
++ for (block = block_list; block ; block = block->next) {
++ num_blocks++;
++ }
++
++ _PyDebugAllocatorStats(out,
++ "PyFloatBlock", num_blocks, sizeof(PyFloatBlock));
++}
++
+ static PyFloatObject *
+ fill_free_list(void)
+ {
+diff -up Python-2.7.2/Objects/frameobject.c.add-debug-malloc-stats
Python-2.7.2/Objects/frameobject.c
+--- Python-2.7.2/Objects/frameobject.c.add-debug-malloc-stats 2011-09-16
17:33:08.129873287 -0400
++++ Python-2.7.2/Objects/frameobject.c 2011-09-16 18:07:58.743853347 -0400
+@@ -980,3 +980,13 @@ PyFrame_Fini(void)
+ Py_XDECREF(builtin_object);
+ builtin_object = NULL;
+ }
++
++/* Print summary info about the state of the optimized allocator */
++void
++_PyFrame_DebugMallocStats(FILE *out)
++{
++ _PyDebugAllocatorStats(out,
++ "free PyFrameObject",
++ numfree, sizeof(PyFrameObject));
++}
++
+diff -up Python-2.7.2/Objects/intobject.c.add-debug-malloc-stats
Python-2.7.2/Objects/intobject.c
+--- Python-2.7.2/Objects/intobject.c.add-debug-malloc-stats 2011-06-11 11:46:27.000000000
-0400
++++ Python-2.7.2/Objects/intobject.c 2011-09-16 17:44:27.776866803 -0400
+@@ -44,6 +44,23 @@ typedef struct _intblock PyIntBlock;
+ static PyIntBlock *block_list = NULL;
+ static PyIntObject *free_list = NULL;
+
++
++/* Print summary info about the state of the optimized allocator */
++void
++_PyInt_DebugMallocStats(FILE *out)
++{
++ int num_blocks = 0;
++ PyIntBlock *block;
++
++ /* Walk the block list, counting */
++ for (block = block_list; block ; block = block->next) {
++ num_blocks++;
++ }
++
++ _PyDebugAllocatorStats(out,
++ "PyIntBlock", num_blocks, sizeof(PyIntBlock));
++}
++
+ static PyIntObject *
+ fill_free_list(void)
+ {
+diff -up Python-2.7.2/Objects/listobject.c.add-debug-malloc-stats
Python-2.7.2/Objects/listobject.c
+--- Python-2.7.2/Objects/listobject.c.add-debug-malloc-stats 2011-09-16
17:33:18.008873189 -0400
++++ Python-2.7.2/Objects/listobject.c 2011-09-16 18:08:54.167852819 -0400
+@@ -109,6 +109,15 @@ PyList_Fini(void)
+ }
+ }
+
++/* Print summary info about the state of the optimized allocator */
++void
++_PyList_DebugMallocStats(FILE *out)
++{
++ _PyDebugAllocatorStats(out,
++ "free PyListObject",
++ numfree, sizeof(PyListObject));
++}
++
+ PyObject *
+ PyList_New(Py_ssize_t size)
+ {
+diff -up Python-2.7.2/Objects/methodobject.c.add-debug-malloc-stats
Python-2.7.2/Objects/methodobject.c
+--- Python-2.7.2/Objects/methodobject.c.add-debug-malloc-stats 2011-09-16
17:33:29.656873081 -0400
++++ Python-2.7.2/Objects/methodobject.c 2011-09-16 18:08:10.607853235 -0400
+@@ -412,6 +412,15 @@ PyCFunction_Fini(void)
+ (void)PyCFunction_ClearFreeList();
+ }
+
++/* Print summary info about the state of the optimized allocator */
++void
++_PyCFunction_DebugMallocStats(FILE *out)
++{
++ _PyDebugAllocatorStats(out,
++ "free PyCFunction",
++ numfree, sizeof(PyCFunction));
++}
++
+ /* PyCFunction_New() is now just a macro that calls PyCFunction_NewEx(),
+ but it's part of the API so we need to keep a function around that
+ existing C extensions can call.
+diff -up Python-2.7.2/Objects/object.c.add-debug-malloc-stats
Python-2.7.2/Objects/object.c
+--- Python-2.7.2/Objects/object.c.add-debug-malloc-stats 2011-06-11 11:46:27.000000000
-0400
++++ Python-2.7.2/Objects/object.c 2011-09-16 17:56:21.031860008 -0400
+@@ -2334,6 +2334,23 @@ PyMem_Free(void *p)
+ PyMem_FREE(p);
+ }
+
++void
++_PyObject_DebugTypeStats(FILE *out)
++{
++ _PyString_DebugMallocStats(out);
++ _PyCFunction_DebugMallocStats(out);
++ _PyDict_DebugMallocStats(out);
++ _PyFloat_DebugMallocStats(out);
++ _PyFrame_DebugMallocStats(out);
++ _PyInt_DebugMallocStats(out);
++ _PyList_DebugMallocStats(out);
++ _PyMethod_DebugMallocStats(out);
++ _PySet_DebugMallocStats(out);
++ _PyTuple_DebugMallocStats(out);
++#if Py_USING_UNICODE
++ _PyUnicode_DebugMallocStats(out);
++#endif
++}
+
+ /* These methods are used to control infinite recursion in repr, str, print,
+ etc. Container objects that may recursively contain themselves,
+diff -up Python-2.7.2/Objects/obmalloc.c.add-debug-malloc-stats
Python-2.7.2/Objects/obmalloc.c
+--- Python-2.7.2/Objects/obmalloc.c.add-debug-malloc-stats 2011-06-11 11:46:27.000000000
-0400
++++ Python-2.7.2/Objects/obmalloc.c 2011-09-16 18:29:17.935841149 -0400
+@@ -508,12 +508,10 @@ static struct arena_object* usable_arena
+ /* Number of arenas allocated that haven't been free()'d. */
+ static size_t narenas_currently_allocated = 0;
+
+-#ifdef PYMALLOC_DEBUG
+ /* Total number of times malloc() called to allocate an arena. */
+ static size_t ntimes_arena_allocated = 0;
+ /* High water mark (max value ever seen) for narenas_currently_allocated. */
+ static size_t narenas_highwater = 0;
+-#endif
+
+ /* Allocate a new arena. If we run out of memory, return NULL. Else
+ * allocate a new arena, and return the address of an arena_object
+@@ -528,7 +526,7 @@ new_arena(void)
+
+ #ifdef PYMALLOC_DEBUG
+ if (Py_GETENV("PYTHONMALLOCSTATS"))
+- _PyObject_DebugMallocStats();
++ _PyObject_DebugMallocStats(stderr);
+ #endif
+ if (unused_arena_objects == NULL) {
+ uint i;
+@@ -588,11 +586,9 @@ new_arena(void)
+ }
+
+ ++narenas_currently_allocated;
+-#ifdef PYMALLOC_DEBUG
+ ++ntimes_arena_allocated;
+ if (narenas_currently_allocated > narenas_highwater)
+ narenas_highwater = narenas_currently_allocated;
+-#endif
+ arenaobj->freepools = NULL;
+ /* pool_address <- first pool-aligned address in the arena
+ nfreepools <- number of whole pools that fit after alignment */
+@@ -1694,17 +1690,19 @@ _PyObject_DebugDumpAddress(const void *p
+ }
+ }
+
++#endif /* PYMALLOC_DEBUG */
++
+ static size_t
+-printone(const char* msg, size_t value)
++printone(FILE *out, const char* msg, size_t value)
+ {
+ int i, k;
+ char buf[100];
+ size_t origvalue = value;
+
+- fputs(msg, stderr);
++ fputs(msg, out);
+ for (i = (int)strlen(msg); i < 35; ++i)
+- fputc(' ', stderr);
+- fputc('=', stderr);
++ fputc(' ', out);
++ fputc('=', out);
+
+ /* Write the value with commas. */
+ i = 22;
+@@ -1725,17 +1723,32 @@ printone(const char* msg, size_t value)
+
+ while (i >= 0)
+ buf[i--] = ' ';
+- fputs(buf, stderr);
++ fputs(buf, out);
+
+ return origvalue;
+ }
+
+-/* Print summary info to stderr about the state of pymalloc's structures.
++void
++_PyDebugAllocatorStats(FILE *out,
++ const char *block_name, int num_blocks, size_t sizeof_block)
++{
++ char buf1[128];
++ char buf2[128];
++ PyOS_snprintf(buf1, sizeof(buf1),
++ "%d %ss * %zd bytes each",
++ num_blocks, block_name, sizeof_block);
++ PyOS_snprintf(buf2, sizeof(buf2),
++ "%48s ", buf1);
++ (void)printone(out, buf2, num_blocks * sizeof_block);
++}
++
++
++/* Print summary info to "out" about the state of pymalloc's structures.
+ * In Py_DEBUG mode, also perform some expensive internal consistency
+ * checks.
+ */
+ void
+-_PyObject_DebugMallocStats(void)
++_PyObject_DebugMallocStats(FILE *out)
+ {
+ uint i;
+ const uint numclasses = SMALL_REQUEST_THRESHOLD >> ALIGNMENT_SHIFT;
+@@ -1764,7 +1777,7 @@ _PyObject_DebugMallocStats(void)
+ size_t total;
+ char buf[128];
+
+- fprintf(stderr, "Small block threshold = %d, in %u size classes.\n",
++ fprintf(out, "Small block threshold = %d, in %u size classes.\n",
+ SMALL_REQUEST_THRESHOLD, numclasses);
+
+ for (i = 0; i < numclasses; ++i)
+@@ -1818,10 +1831,10 @@ _PyObject_DebugMallocStats(void)
+ }
+ assert(narenas == narenas_currently_allocated);
+
+- fputc('\n', stderr);
++ fputc('\n', out);
+ fputs("class size num pools blocks in use avail blocks\n"
+ "----- ---- --------- ------------- ------------\n",
+- stderr);
++ out);
+
+ for (i = 0; i < numclasses; ++i) {
+ size_t p = numpools[i];
+@@ -1832,7 +1845,7 @@ _PyObject_DebugMallocStats(void)
+ assert(b == 0 && f == 0);
+ continue;
+ }
+- fprintf(stderr, "%5u %6u "
++ fprintf(out, "%5u %6u "
+ "%11" PY_FORMAT_SIZE_T "u "
+ "%15" PY_FORMAT_SIZE_T "u "
+ "%13" PY_FORMAT_SIZE_T "u\n",
+@@ -1842,36 +1855,35 @@ _PyObject_DebugMallocStats(void)
+ pool_header_bytes += p * POOL_OVERHEAD;
+ quantization += p * ((POOL_SIZE - POOL_OVERHEAD) % size);
+ }
+- fputc('\n', stderr);
+- (void)printone("# times object malloc called", serialno);
+-
+- (void)printone("# arenas allocated total", ntimes_arena_allocated);
+- (void)printone("# arenas reclaimed", ntimes_arena_allocated - narenas);
+- (void)printone("# arenas highwater mark", narenas_highwater);
+- (void)printone("# arenas allocated current", narenas);
++ fputc('\n', out);
++#ifdef PYMALLOC_DEBUG
++ (void)printone(out, "# times object malloc called", serialno);
++#endif
++ (void)printone(out, "# arenas allocated total", ntimes_arena_allocated);
++ (void)printone(out, "# arenas reclaimed", ntimes_arena_allocated -
narenas);
++ (void)printone(out, "# arenas highwater mark", narenas_highwater);
++ (void)printone(out, "# arenas allocated current", narenas);
+
+ PyOS_snprintf(buf, sizeof(buf),
+ "%" PY_FORMAT_SIZE_T "u arenas * %d bytes/arena",
+ narenas, ARENA_SIZE);
+- (void)printone(buf, narenas * ARENA_SIZE);
++ (void)printone(out, buf, narenas * ARENA_SIZE);
+
+- fputc('\n', stderr);
++ fputc('\n', out);
+
+- total = printone("# bytes in allocated blocks", allocated_bytes);
+- total += printone("# bytes in available blocks", available_bytes);
++ total = printone(out, "# bytes in allocated blocks", allocated_bytes);
++ total += printone(out, "# bytes in available blocks", available_bytes);
+
+ PyOS_snprintf(buf, sizeof(buf),
+ "%u unused pools * %d bytes", numfreepools, POOL_SIZE);
+- total += printone(buf, (size_t)numfreepools * POOL_SIZE);
++ total += printone(out, buf, (size_t)numfreepools * POOL_SIZE);
+
+- total += printone("# bytes lost to pool headers", pool_header_bytes);
+- total += printone("# bytes lost to quantization", quantization);
+- total += printone("# bytes lost to arena alignment", arena_alignment);
+- (void)printone("Total", total);
++ total += printone(out, "# bytes lost to pool headers",
pool_header_bytes);
++ total += printone(out, "# bytes lost to quantization", quantization);
++ total += printone(out, "# bytes lost to arena alignment",
arena_alignment);
++ (void)printone(out, "Total", total);
+ }
+
+-#endif /* PYMALLOC_DEBUG */
+-
+ #ifdef Py_USING_MEMORY_DEBUGGER
+ /* Make this function last so gcc won't inline it since the definition is
+ * after the reference.
+diff -up Python-2.7.2/Objects/setobject.c.add-debug-malloc-stats
Python-2.7.2/Objects/setobject.c
+--- Python-2.7.2/Objects/setobject.c.add-debug-malloc-stats 2011-09-16 17:33:42.223872963
-0400
++++ Python-2.7.2/Objects/setobject.c 2011-09-16 18:09:12.870852640 -0400
+@@ -1088,6 +1088,16 @@ PySet_Fini(void)
+ Py_CLEAR(emptyfrozenset);
+ }
+
++/* Print summary info about the state of the optimized allocator */
++void
++_PySet_DebugMallocStats(FILE *out)
++{
++ _PyDebugAllocatorStats(out,
++ "free PySetObject",
++ numfree, sizeof(PySetObject));
++}
++
++
+ static PyObject *
+ set_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+ {
+diff -up Python-2.7.2/Objects/stringobject.c.add-debug-malloc-stats
Python-2.7.2/Objects/stringobject.c
+--- Python-2.7.2/Objects/stringobject.c.add-debug-malloc-stats 2011-06-11
11:46:27.000000000 -0400
++++ Python-2.7.2/Objects/stringobject.c 2011-09-16 17:46:41.015865533 -0400
+@@ -4822,3 +4822,43 @@ void _Py_ReleaseInternedStrings(void)
+ Py_DECREF(interned);
+ interned = NULL;
+ }
++
++void _PyString_DebugMallocStats(FILE *out)
++{
++ ssize_t i;
++ int num_immortal = 0, num_mortal = 0;
++ ssize_t immortal_size = 0, mortal_size = 0;
++
++ if (interned == NULL || !PyDict_Check(interned))
++ return;
++
++ for (i = 0; i <= ((PyDictObject*)interned)->ma_mask; i++) {
++ PyDictEntry *ep = ((PyDictObject*)interned)->ma_table + i;
++ PyObject *pvalue = ep->me_value;
++ if (pvalue != NULL) {
++ PyStringObject *s = (PyStringObject *)ep->me_key;
++
++ switch (s->ob_sstate) {
++ case SSTATE_NOT_INTERNED:
++ /* XXX Shouldn't happen */
++ break;
++ case SSTATE_INTERNED_IMMORTAL:
++ num_immortal ++;
++ immortal_size += s->ob_size;
++ break;
++ case SSTATE_INTERNED_MORTAL:
++ num_mortal ++;
++ mortal_size += s->ob_size;
++ break;
++ default:
++ Py_FatalError("Inconsistent interned string state.");
++ }
++ }
++ }
++
++ fprintf(out, "%d mortal interned strings\n", num_mortal);
++ fprintf(out, "%d immortal interned strings\n", num_immortal);
++ fprintf(out, "total size of all interned strings: "
++ "%zi/%zi "
++ "mortal/immortal\n", mortal_size, immortal_size);
++}
+diff -up Python-2.7.2/Objects/tupleobject.c.add-debug-malloc-stats
Python-2.7.2/Objects/tupleobject.c
+--- Python-2.7.2/Objects/tupleobject.c.add-debug-malloc-stats 2011-09-16
17:33:54.008872848 -0400
++++ Python-2.7.2/Objects/tupleobject.c 2011-09-16 18:07:05.575853855 -0400
+@@ -44,6 +44,22 @@ show_track(void)
+ }
+ #endif
+
++/* Print summary info about the state of the optimized allocator */
++void
++_PyTuple_DebugMallocStats(FILE *out)
++{
++#if PyTuple_MAXSAVESIZE > 0
++ int i;
++ char buf[128];
++ for (i = 1; i < PyTuple_MAXSAVESIZE; i++) {
++ PyOS_snprintf(buf, sizeof(buf),
++ "free %d-sized PyTupleObject", i);
++ _PyDebugAllocatorStats(out,
++ buf,
++ numfree[i], _PyObject_VAR_SIZE(&PyTuple_Type, i));
++ }
++#endif
++}
+
+ PyObject *
+ PyTuple_New(register Py_ssize_t size)
+diff -up Python-2.7.2/Objects/unicodeobject.c.add-debug-malloc-stats
Python-2.7.2/Objects/unicodeobject.c
+--- Python-2.7.2/Objects/unicodeobject.c.add-debug-malloc-stats 2011-06-11
11:46:27.000000000 -0400
++++ Python-2.7.2/Objects/unicodeobject.c 2011-09-16 17:27:15.119876653 -0400
+@@ -8883,6 +8883,12 @@ _PyUnicode_Fini(void)
+ (void)PyUnicode_ClearFreeList();
+ }
+
++void _PyUnicode_DebugMallocStats(FILE *out)
++{
++ _PyDebugAllocatorStats(out, "free PyUnicodeObject", numfree,
++ sizeof(PyUnicodeObject));
++}
++
+ #ifdef __cplusplus
+ }
+ #endif
+diff -up Python-2.7.2/Python/sysmodule.c.add-debug-malloc-stats
Python-2.7.2/Python/sysmodule.c
+--- Python-2.7.2/Python/sysmodule.c.add-debug-malloc-stats 2011-09-16 17:13:54.475884288
-0400
++++ Python-2.7.2/Python/sysmodule.c 2011-09-16 17:47:22.648865136 -0400
+@@ -872,6 +872,57 @@ a 11-tuple where the entries in the tupl
+ extern "C" {
+ #endif
+
++static PyObject *
++sys_debugmallocstats(PyObject *self, PyObject *args)
++{
++ PyObject *file = NULL;
++ FILE *fp;
++
++ if (!PyArg_ParseTuple(args, "|O!",
++ &PyFile_Type, &file)) {
++ return NULL;
++ }
++ if (!file) {
++ /* Default to sys.stderr: */
++ file = PySys_GetObject("stderr");
++ if (!file) {
++ PyErr_SetString(PyExc_ValueError, "sys.stderr not set");
++ return NULL;
++ }
++ if (!PyFile_Check(file)) {
++ PyErr_SetString(PyExc_TypeError, "sys.stderr is not a file");
++ return NULL;
++ }
++ }
++
++ Py_INCREF(file);
++ /* OK, we now own a ref on non-NULL "file" */
++
++ fp = PyFile_AsFile(file);
++ if (!fp) {
++ PyErr_SetString(PyExc_ValueError, "file is closed");
++ Py_DECREF(file);
++ return NULL;
++ }
++
++ _PyObject_DebugMallocStats(fp);
++ fputc('\n', fp);
++ _PyObject_DebugTypeStats(fp);
++
++ Py_DECREF(file);
++
++ Py_RETURN_NONE;
++}
++PyDoc_STRVAR(debugmallocstats_doc,
++"_debugmallocstats([file])\n\
++\n\
++Print summary info to the given file (or sys.stderr) about the state of\n\
++pymalloc's structures.\n\
++\n\
++In Py_DEBUG mode, also perform some expensive internal consistency\n\
++checks.\n\
++");
++
+ #ifdef Py_TRACE_REFS
+ /* Defined in objects.c because it uses static globals if that file */
+ extern PyObject *_Py_GetObjects(PyObject *, PyObject *);
+@@ -970,6 +1021,8 @@ static PyMethodDef sys_methods[] = {
+ {"settrace", sys_settrace, METH_O, settrace_doc},
+ {"gettrace", sys_gettrace, METH_NOARGS, gettrace_doc},
+ {"call_tracing", sys_call_tracing, METH_VARARGS, call_tracing_doc},
++ {"_debugmallocstats", sys_debugmallocstats, METH_VARARGS,
++ debugmallocstats_doc},
+ {NULL, NULL} /* sentinel */
+ };
+
diff --git a/python.spec b/python.spec
index 3d08dff..e438863 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.2
-Release: 14%{?dist}
+Release: 15%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -592,6 +592,11 @@ Patch145: 00145-force-sys-platform-to-be-linux2.patch
# (rhbz#563986)
Patch146: 00146-hashlib-fips.patch
+# Add a sys._debugmallocstats() function
+# Based on patch 202 from RHEL 5's python.spec, with updates from rhbz#737198
+# Not yet sent upstream
+Patch147: 00147-add-debug-malloc-stats.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -891,6 +896,7 @@ done
%endif
%patch145 -p1 -b .linux2
%patch146 -p1
+%patch147 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -1716,6 +1722,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Fri Sep 16 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-15
+- add a sys._debugmallocstats() function (patch 147)
+
* Wed Sep 14 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-14
- support OpenSSL FIPS mode in _hashlib and hashlib; don't build the _md5 and
_sha* modules, relying on _hashlib in hashlib, and thus within md5 etc
commit 99133297f3463797b58aa65d493feed572d9664e
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Wed Sep 14 01:26:38 2011 -0400
support OpenSSL FIPS mode in _hashlib and hashlib
* Wed Sep 14 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-14
- support OpenSSL FIPS mode in _hashlib and hashlib; don't build the _md5 and
_sha* modules, relying on _hashlib in hashlib, and thus within md5 etc
(rhbz#563986; patch 146)
diff --git a/00146-hashlib-fips.patch b/00146-hashlib-fips.patch
new file mode 100644
index 0000000..2f42857
--- /dev/null
+++ b/00146-hashlib-fips.patch
@@ -0,0 +1,723 @@
+diff -up Python-2.7.2/Lib/hashlib.py.hashlib-fips Python-2.7.2/Lib/hashlib.py
+--- Python-2.7.2/Lib/hashlib.py.hashlib-fips 2011-06-11 11:46:24.000000000 -0400
++++ Python-2.7.2/Lib/hashlib.py 2011-09-14 00:21:26.194252001 -0400
+@@ -6,9 +6,12 @@
+
+ __doc__ = """hashlib module - A common interface to many hash functions.
+
+-new(name, string='') - returns a new hash object implementing the
+- given hash function; initializing the hash
+- using the given string data.
++new(name, string='', usedforsecurity=True)
++ - returns a new hash object implementing the given hash function;
++ initializing the hash using the given string data.
++
++ "usedforsecurity" is a non-standard extension for better supporting
++ FIPS-compliant environments (see below)
+
+ Named constructor functions are also available, these are much faster
+ than using new():
+@@ -24,6 +27,20 @@ the zlib module.
+ Choose your hash function wisely. Some have known collision weaknesses.
+ sha384 and sha512 will be slow on 32 bit platforms.
+
++Our implementation of hashlib uses OpenSSL.
++
++OpenSSL has a "FIPS mode", which, if enabled, may restrict the available
hashes
++to only those that are compliant with FIPS regulations. For example, it may
++deny the use of MD5, on the grounds that this is not secure for uses such as
++authentication, system integrity checking, or digital signatures.
++
++If you need to use such a hash for non-security purposes (such as indexing into
++a data structure for speed), you can override the keyword argument
++"usedforsecurity" from True to False to signify that your code is not relying
++on the hash for security purposes, and this will allow the hash to be usable
++even in FIPS mode. This is not a standard feature of Python 2.7's hashlib, and
++is included here to better support FIPS mode.
++
+ Hash objects have these methods:
+ - update(arg): Update the hash object with the string arg. Repeated calls
+ are equivalent to a single call with the concatenation of all
+@@ -63,74 +80,39 @@ algorithms = __always_supported
+ __all__ = __always_supported + ('new', 'algorithms')
+
+
+-def __get_builtin_constructor(name):
+- try:
+- if name in ('SHA1', 'sha1'):
+- import _sha
+- return _sha.new
+- elif name in ('MD5', 'md5'):
+- import _md5
+- return _md5.new
+- elif name in ('SHA256', 'sha256', 'SHA224',
'sha224'):
+- import _sha256
+- bs = name[3:]
+- if bs == '256':
+- return _sha256.sha256
+- elif bs == '224':
+- return _sha256.sha224
+- elif name in ('SHA512', 'sha512', 'SHA384',
'sha384'):
+- import _sha512
+- bs = name[3:]
+- if bs == '512':
+- return _sha512.sha512
+- elif bs == '384':
+- return _sha512.sha384
+- except ImportError:
+- pass # no extension module, this hash is unsupported.
+-
+- raise ValueError('unsupported hash type %s' % name)
+-
+-
+ def __get_openssl_constructor(name):
+ try:
+ f = getattr(_hashlib, 'openssl_' + name)
+ # Allow the C module to raise ValueError. The function will be
+ # defined but the hash not actually available thanks to OpenSSL.
+- f()
++ #
++ # We pass "usedforsecurity=False" to disable FIPS-based restrictions:
++ # at this stage we're merely seeing if the function is callable,
++ # rather than using it for actual work.
++ f(usedforsecurity=False)
+ # Use the C function directly (very fast)
+ return f
+ except (AttributeError, ValueError):
+- return __get_builtin_constructor(name)
++ raise
+
+-
+-def __py_new(name, string=''):
+- """new(name, string='') - Return a new hashing object using
the named algorithm;
+- optionally initialized with a string.
+- """
+- return __get_builtin_constructor(name)(string)
+-
+-
+-def __hash_new(name, string=''):
++def __hash_new(name, string='', usedforsecurity=True):
+ """new(name, string='') - Return a new hashing object using
the named algorithm;
+ optionally initialized with a string.
++ Override 'usedforsecurity' to False when using for non-security purposes in
++ a FIPS environment
+ """
+ try:
+- return _hashlib.new(name, string)
++ return _hashlib.new(name, string, usedforsecurity)
+ except ValueError:
+- # If the _hashlib module (OpenSSL) doesn't support the named
+- # hash, try using our builtin implementations.
+- # This allows for SHA224/256 and SHA384/512 support even though
+- # the OpenSSL library prior to 0.9.8 doesn't provide them.
+- return __get_builtin_constructor(name)(string)
+-
++ raise
+
+ try:
+ import _hashlib
+ new = __hash_new
+ __get_hash = __get_openssl_constructor
+ except ImportError:
+- new = __py_new
+- __get_hash = __get_builtin_constructor
++ # We don't build the legacy modules
++ raise
+
+ for __func_name in __always_supported:
+ # try them all, some may not work due to the OpenSSL
+@@ -143,4 +125,4 @@ for __func_name in __always_supported:
+
+ # Cleanup locals()
+ del __always_supported, __func_name, __get_hash
+-del __py_new, __hash_new, __get_openssl_constructor
++del __hash_new, __get_openssl_constructor
+diff -up Python-2.7.2/Lib/test/test_hashlib.py.hashlib-fips
Python-2.7.2/Lib/test/test_hashlib.py
+--- Python-2.7.2/Lib/test/test_hashlib.py.hashlib-fips 2011-06-11 11:46:25.000000000
-0400
++++ Python-2.7.2/Lib/test/test_hashlib.py 2011-09-14 01:08:55.525254195 -0400
+@@ -32,6 +32,19 @@ def hexstr(s):
+ r = r + h[(i >> 4) & 0xF] + h[i & 0xF]
+ return r
+
++def openssl_enforces_fips():
++ # Use the "openssl" command (if present) to try to determine if the local
++ # OpenSSL is configured to enforce FIPS
++ from subprocess import Popen, PIPE
++ try:
++ p = Popen(['openssl', 'md5'],
++ stdin=PIPE, stdout=PIPE, stderr=PIPE)
++ except OSError:
++ # "openssl" command not found
++ return False
++ stdout, stderr = p.communicate(input=b'abc')
++ return b'unknown cipher' in stderr
++OPENSSL_ENFORCES_FIPS = openssl_enforces_fips()
+
+ class HashLibTestCase(unittest.TestCase):
+ supported_hash_names = ( 'md5', 'MD5', 'sha1',
'SHA1',
+@@ -61,10 +74,10 @@ class HashLibTestCase(unittest.TestCase)
+ # of hashlib.new given the algorithm name.
+ for algorithm, constructors in self.constructors_to_test.items():
+ constructors.add(getattr(hashlib, algorithm))
+- def _test_algorithm_via_hashlib_new(data=None, _alg=algorithm):
++ def _test_algorithm_via_hashlib_new(data=None, _alg=algorithm,
usedforsecurity=True):
+ if data is None:
+- return hashlib.new(_alg)
+- return hashlib.new(_alg, data)
++ return hashlib.new(_alg, usedforsecurity=usedforsecurity)
++ return hashlib.new(_alg, data, usedforsecurity=usedforsecurity)
+ constructors.add(_test_algorithm_via_hashlib_new)
+
+ _hashlib = self._conditional_import_module('_hashlib')
+@@ -78,28 +91,13 @@ class HashLibTestCase(unittest.TestCase)
+ if constructor:
+ constructors.add(constructor)
+
+- _md5 = self._conditional_import_module('_md5')
+- if _md5:
+- self.constructors_to_test['md5'].add(_md5.new)
+- _sha = self._conditional_import_module('_sha')
+- if _sha:
+- self.constructors_to_test['sha1'].add(_sha.new)
+- _sha256 = self._conditional_import_module('_sha256')
+- if _sha256:
+- self.constructors_to_test['sha224'].add(_sha256.sha224)
+- self.constructors_to_test['sha256'].add(_sha256.sha256)
+- _sha512 = self._conditional_import_module('_sha512')
+- if _sha512:
+- self.constructors_to_test['sha384'].add(_sha512.sha384)
+- self.constructors_to_test['sha512'].add(_sha512.sha512)
+-
+ super(HashLibTestCase, self).__init__(*args, **kwargs)
+
+ def test_hash_array(self):
+ a = array.array("b", range(10))
+ constructors = self.constructors_to_test.itervalues()
+ for cons in itertools.chain.from_iterable(constructors):
+- c = cons(a)
++ c = cons(a, usedforsecurity=False)
+ c.hexdigest()
+
+ def test_algorithms_attribute(self):
+@@ -115,27 +113,9 @@ class HashLibTestCase(unittest.TestCase)
+ else:
+ self.assertTrue(0 == "hashlib didn't reject bogus hash name")
+
+- def test_get_builtin_constructor(self):
+- get_builtin_constructor = hashlib.__dict__[
+- '__get_builtin_constructor']
+- self.assertRaises(ValueError, get_builtin_constructor, 'test')
+- try:
+- import _md5
+- except ImportError:
+- pass
+- # This forces an ImportError for "import _md5" statements
+- sys.modules['_md5'] = None
+- try:
+- self.assertRaises(ValueError, get_builtin_constructor, 'md5')
+- finally:
+- if '_md5' in locals():
+- sys.modules['_md5'] = _md5
+- else:
+- del sys.modules['_md5']
+-
+ def test_hexdigest(self):
+ for name in self.supported_hash_names:
+- h = hashlib.new(name)
++ h = hashlib.new(name, usedforsecurity=False)
+ self.assertTrue(hexstr(h.digest()) == h.hexdigest())
+
+ def test_large_update(self):
+@@ -145,16 +125,16 @@ class HashLibTestCase(unittest.TestCase)
+ abcs = aas + bees + cees
+
+ for name in self.supported_hash_names:
+- m1 = hashlib.new(name)
++ m1 = hashlib.new(name, usedforsecurity=False)
+ m1.update(aas)
+ m1.update(bees)
+ m1.update(cees)
+
+- m2 = hashlib.new(name)
++ m2 = hashlib.new(name, usedforsecurity=False)
+ m2.update(abcs)
+ self.assertEqual(m1.digest(), m2.digest(), name+' update problem.')
+
+- m3 = hashlib.new(name, abcs)
++ m3 = hashlib.new(name, abcs, usedforsecurity=False)
+ self.assertEqual(m1.digest(), m3.digest(), name+' new problem.')
+
+ def check(self, name, data, digest):
+@@ -162,7 +142,7 @@ class HashLibTestCase(unittest.TestCase)
+ # 2 is for hashlib.name(...) and hashlib.new(name, ...)
+ self.assertGreaterEqual(len(constructors), 2)
+ for hash_object_constructor in constructors:
+- computed = hash_object_constructor(data).hexdigest()
++ computed = hash_object_constructor(data, usedforsecurity=False).hexdigest()
+ self.assertEqual(
+ computed, digest,
+ "Hash algorithm %s constructed using %s returned
hexdigest"
+@@ -172,7 +152,8 @@ class HashLibTestCase(unittest.TestCase)
+
+ def check_unicode(self, algorithm_name):
+ # Unicode objects are not allowed as input.
+- expected = hashlib.new(algorithm_name, str(u'spam')).hexdigest()
++ expected = hashlib.new(algorithm_name, str(u'spam'),
++ usedforsecurity=False).hexdigest()
+ self.check(algorithm_name, u'spam', expected)
+
+ def test_unicode(self):
+@@ -354,6 +335,70 @@ class HashLibTestCase(unittest.TestCase)
+
+ self.assertEqual(expected_hash, hasher.hexdigest())
+
++ def test_issue9146(self):
++ # Ensure that various ways to use "MD5" from "hashlib"
don't segfault:
++ m = hashlib.md5(usedforsecurity=False)
++ m.update(b'abc\n')
++ self.assertEquals(m.hexdigest(), "0bee89b07a248e27c83fc3d5951213c1")
++
++ m = hashlib.new('md5', usedforsecurity=False)
++ m.update(b'abc\n')
++ self.assertEquals(m.hexdigest(), "0bee89b07a248e27c83fc3d5951213c1")
++
++ m = hashlib.md5(b'abc\n', usedforsecurity=False)
++ self.assertEquals(m.hexdigest(), "0bee89b07a248e27c83fc3d5951213c1")
++
++ m = hashlib.new('md5', b'abc\n', usedforsecurity=False)
++ self.assertEquals(m.hexdigest(), "0bee89b07a248e27c83fc3d5951213c1")
++
++ def assertRaisesUnknownCipher(self, callable_obj=None, *args, **kwargs):
++ try:
++ callable_obj(*args, **kwargs)
++ except ValueError, e:
++ if not e.args[0].endswith('unknown cipher'):
++ self.fail('Incorrect exception raised')
++ else:
++ self.fail('Exception was not raised')
++
++ @unittest.skipUnless(OPENSSL_ENFORCES_FIPS,
++ 'FIPS enforcement required for this test.')
++ def test_hashlib_fips_mode(self):
++ # Ensure that we raise a ValueError on vanilla attempts to use MD5
++ # in hashlib in a FIPS-enforced setting:
++ self.assertRaisesUnknownCipher(hashlib.md5)
++ self.assertRaisesUnknownCipher(hashlib.new, 'md5')
++
++ @unittest.skipUnless(OPENSSL_ENFORCES_FIPS,
++ 'FIPS enforcement required for this test.')
++ def test_hashopenssl_fips_mode(self):
++ # Verify the _hashlib module's handling of md5:
++ import _hashlib
++
++ assert hasattr(_hashlib, 'openssl_md5')
++
++ # Ensure that _hashlib raises a ValueError on vanilla attempts to
++ # use MD5 in a FIPS-enforced setting:
++ self.assertRaisesUnknownCipher(_hashlib.openssl_md5)
++ self.assertRaisesUnknownCipher(_hashlib.new, 'md5')
++
++ # Ensure that in such a setting we can whitelist a callsite with
++ # usedforsecurity=False and have it succeed:
++ m = _hashlib.openssl_md5(usedforsecurity=False)
++ m.update('abc\n')
++ self.assertEquals(m.hexdigest(), "0bee89b07a248e27c83fc3d5951213c1")
++
++ m = _hashlib.new('md5', usedforsecurity=False)
++ m.update('abc\n')
++ self.assertEquals(m.hexdigest(), "0bee89b07a248e27c83fc3d5951213c1")
++
++ m = _hashlib.openssl_md5('abc\n', usedforsecurity=False)
++ self.assertEquals(m.hexdigest(), "0bee89b07a248e27c83fc3d5951213c1")
++
++ m = _hashlib.new('md5', 'abc\n', usedforsecurity=False)
++ self.assertEquals(m.hexdigest(), "0bee89b07a248e27c83fc3d5951213c1")
++
++
++
+ def test_main():
+ test_support.run_unittest(HashLibTestCase)
+
+diff -up Python-2.7.2/Modules/_hashopenssl.c.hashlib-fips
Python-2.7.2/Modules/_hashopenssl.c
+--- Python-2.7.2/Modules/_hashopenssl.c.hashlib-fips 2011-06-11 11:46:26.000000000 -0400
++++ Python-2.7.2/Modules/_hashopenssl.c 2011-09-14 00:21:26.199252001 -0400
+@@ -36,6 +36,8 @@
+ #endif
+
+ /* EVP is the preferred interface to hashing in OpenSSL */
++#include <openssl/ssl.h>
++#include <openssl/err.h>
+ #include <openssl/evp.h>
+
+ #define MUNCH_SIZE INT_MAX
+@@ -65,11 +67,19 @@ typedef struct {
+
+ static PyTypeObject EVPtype;
+
++/* Struct to hold all the cached information we need on a specific algorithm.
++ We have one of these per algorithm */
++typedef struct {
++ PyObject *name_obj;
++ EVP_MD_CTX ctxs[2];
++ /* ctx_ptrs will point to ctxs unless an error occurred, when it will
++ be NULL: */
++ EVP_MD_CTX *ctx_ptrs[2];
++ PyObject *error_msgs[2];
++} EVPCachedInfo;
+
+-#define DEFINE_CONSTS_FOR_NEW(Name) \
+- static PyObject *CONST_ ## Name ## _name_obj; \
+- static EVP_MD_CTX CONST_new_ ## Name ## _ctx; \
+- static EVP_MD_CTX *CONST_new_ ## Name ## _ctx_p = NULL;
++#define DEFINE_CONSTS_FOR_NEW(Name) \
++ static EVPCachedInfo cached_info_ ##Name;
+
+ DEFINE_CONSTS_FOR_NEW(md5)
+ DEFINE_CONSTS_FOR_NEW(sha1)
+@@ -115,6 +125,48 @@ EVP_hash(EVPobject *self, const void *vp
+ }
+ }
+
++static void
++mc_ctx_init(EVP_MD_CTX *ctx, int usedforsecurity)
++{
++ EVP_MD_CTX_init(ctx);
++
++ /*
++ If the user has declared that this digest is being used in a
++ non-security role (e.g. indexing into a data structure), set
++ the exception flag for openssl to allow it
++ */
++ if (!usedforsecurity) {
++#ifdef EVP_MD_CTX_FLAG_NON_FIPS_ALLOW
++ EVP_MD_CTX_set_flags(ctx,
++ EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
++#endif
++ }
++}
++
++/* Get an error msg for the last error as a PyObject */
++static PyObject *
++error_msg_for_last_error(void)
++{
++ char *errstr;
++
++ errstr = ERR_error_string(ERR_peek_last_error(), NULL);
++ ERR_clear_error();
++
++ return PyString_FromString(errstr); /* Can be NULL */
++}
++
++static void
++set_evp_exception(void)
++{
++ char *errstr;
++
++ errstr = ERR_error_string(ERR_peek_last_error(), NULL);
++ ERR_clear_error();
++
++ PyErr_SetString(PyExc_ValueError, errstr);
++}
++
++
+ /* Internal methods for a hash object */
+
+ static void
+@@ -313,14 +365,15 @@ EVP_repr(PyObject *self)
+ static int
+ EVP_tp_init(EVPobject *self, PyObject *args, PyObject *kwds)
+ {
+- static char *kwlist[] = {"name", "string", NULL};
++ static char *kwlist[] = {"name", "string",
"usedforsecurity", NULL};
+ PyObject *name_obj = NULL;
++ int usedforsecurity = 1;
+ Py_buffer view = { 0 };
+ char *nameStr;
+ const EVP_MD *digest;
+
+- if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|s*:HASH", kwlist,
+- &name_obj, &view)) {
++ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|s*i:HASH", kwlist,
++ &name_obj, &view, &usedforsecurity)) {
+ return -1;
+ }
+
+@@ -336,7 +389,12 @@ EVP_tp_init(EVPobject *self, PyObject *a
+ PyBuffer_Release(&view);
+ return -1;
+ }
+- EVP_DigestInit(&self->ctx, digest);
++ mc_ctx_init(&self->ctx, usedforsecurity);
++ if (!EVP_DigestInit_ex(&self->ctx, digest, NULL)) {
++ set_evp_exception();
++ PyBuffer_Release(&view);
++ return -1;
++ }
+
+ self->name = name_obj;
+ Py_INCREF(self->name);
+@@ -420,7 +478,8 @@ static PyTypeObject EVPtype = {
+ static PyObject *
+ EVPnew(PyObject *name_obj,
+ const EVP_MD *digest, const EVP_MD_CTX *initial_ctx,
+- const unsigned char *cp, Py_ssize_t len)
++ const unsigned char *cp, Py_ssize_t len,
++ int usedforsecurity)
+ {
+ EVPobject *self;
+
+@@ -435,7 +494,12 @@ EVPnew(PyObject *name_obj,
+ if (initial_ctx) {
+ EVP_MD_CTX_copy(&self->ctx, initial_ctx);
+ } else {
+- EVP_DigestInit(&self->ctx, digest);
++ mc_ctx_init(&self->ctx, usedforsecurity);
++ if (!EVP_DigestInit_ex(&self->ctx, digest, NULL)) {
++ set_evp_exception();
++ Py_DECREF(self);
++ return NULL;
++ }
+ }
+
+ if (cp && len) {
+@@ -459,20 +523,28 @@ PyDoc_STRVAR(EVP_new__doc__,
+ An optional string argument may be provided and will be\n\
+ automatically hashed.\n\
+ \n\
+-The MD5 and SHA1 algorithms are always supported.\n");
++The MD5 and SHA1 algorithms are always supported.\n\
++\n\
++An optional \"usedforsecurity=True\" keyword argument is provided for use
in\n\
++environments that enforce FIPS-based restrictions. Some implementations of\n\
++OpenSSL can be configured to prevent the usage of non-secure algorithms (such\n\
++as MD5). If you have a non-security use for these algorithms (e.g. a hash\n\
++table), you can override this argument by marking the callsite as\n\
++\"usedforsecurity=False\".");
+
+ static PyObject *
+ EVP_new(PyObject *self, PyObject *args, PyObject *kwdict)
+ {
+- static char *kwlist[] = {"name", "string", NULL};
++ static char *kwlist[] = {"name", "string",
"usedforsecurity", NULL};
+ PyObject *name_obj = NULL;
+ Py_buffer view = { 0 };
+ PyObject *ret_obj;
+ char *name;
+ const EVP_MD *digest;
++ int usedforsecurity = 1;
+
+- if (!PyArg_ParseTupleAndKeywords(args, kwdict, "O|s*:new", kwlist,
+- &name_obj, &view)) {
++ if (!PyArg_ParseTupleAndKeywords(args, kwdict, "O|s*i:new", kwlist,
++ &name_obj, &view, &usedforsecurity)) {
+ return NULL;
+ }
+
+@@ -484,55 +556,116 @@ EVP_new(PyObject *self, PyObject *args,
+ digest = EVP_get_digestbyname(name);
+
+ ret_obj = EVPnew(name_obj, digest, NULL, (unsigned char*)view.buf,
+- view.len);
++ view.len, usedforsecurity);
+ PyBuffer_Release(&view);
+
+ return ret_obj;
+ }
+
+ /*
+- * This macro generates constructor function definitions for specific
+- * hash algorithms. These constructors are much faster than calling
+- * the generic one passing it a python string and are noticably
+- * faster than calling a python new() wrapper. Thats important for
++ * This macro and function generates a family of constructor function
++ * definitions for specific hash algorithms. These constructors are much
++ * faster than calling the generic one passing it a python string and are
++ * noticably faster than calling a python new() wrapper. That's important for
+ * code that wants to make hashes of a bunch of small strings.
+ */
+ #define GEN_CONSTRUCTOR(NAME) \
+ static PyObject * \
+- EVP_new_ ## NAME (PyObject *self, PyObject *args) \
++ EVP_new_ ## NAME (PyObject *self, PyObject *args, PyObject *kwdict) \
+ { \
+- Py_buffer view = { 0 }; \
+- PyObject *ret_obj; \
+- \
+- if (!PyArg_ParseTuple(args, "|s*:" #NAME , &view)) { \
+- return NULL; \
+- } \
+- \
+- ret_obj = EVPnew( \
+- CONST_ ## NAME ## _name_obj, \
+- NULL, \
+- CONST_new_ ## NAME ## _ctx_p, \
+- (unsigned char*)view.buf, view.len); \
+- PyBuffer_Release(&view); \
+- return ret_obj; \
++ return implement_specific_EVP_new(self, args, kwdict, \
++ "|s*i:" #NAME, \
++ &cached_info_ ## NAME ); \
+ }
+
++static PyObject *
++implement_specific_EVP_new(PyObject *self, PyObject *args, PyObject *kwdict,
++ const char *format,
++ EVPCachedInfo *cached_info)
++{
++ static char *kwlist[] = {"string", "usedforsecurity", NULL};
++ Py_buffer view = { 0 };
++ int usedforsecurity = 1;
++ int idx;
++ PyObject *ret_obj = NULL;
++
++ assert(cached_info);
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwdict, format, kwlist,
++ &view, &usedforsecurity)) {
++ return NULL;
++ }
++
++ idx = usedforsecurity ? 1 : 0;
++
++ /*
++ * If an error occurred during creation of the global content, the ctx_ptr
++ * will be NULL, and the error_msg will hopefully be non-NULL:
++ */
++ if (cached_info->ctx_ptrs[idx]) {
++ /* We successfully initialized this context; copy it: */
++ ret_obj = EVPnew(cached_info->name_obj,
++ NULL,
++ cached_info->ctx_ptrs[idx],
++ (unsigned char*)view.buf, view.len,
++ usedforsecurity);
++ } else {
++ /* Some kind of error happened initializing the global context for
++ this (digest, usedforsecurity) pair.
++ Raise an exception with the saved error message: */
++ if (cached_info->error_msgs[idx]) {
++ PyErr_SetObject(PyExc_ValueError, cached_info->error_msgs[idx]);
++ } else {
++ PyErr_SetString(PyExc_ValueError, "Error initializing hash");
++ }
++ }
++
++ return ret_obj;
++}
++
+ /* a PyMethodDef structure for the constructor */
+ #define CONSTRUCTOR_METH_DEF(NAME) \
+- {"openssl_" #NAME, (PyCFunction)EVP_new_ ## NAME, METH_VARARGS, \
++ {"openssl_" #NAME, (PyCFunction)EVP_new_ ## NAME, \
++ METH_VARARGS |METH_KEYWORDS, \
+ PyDoc_STR("Returns a " #NAME \
+ " hash object; optionally initialized with a string") \
+ }
+
+-/* used in the init function to setup a constructor */
+-#define INIT_CONSTRUCTOR_CONSTANTS(NAME) do { \
+- CONST_ ## NAME ## _name_obj = PyString_FromString(#NAME); \
+- if (EVP_get_digestbyname(#NAME)) { \
+- CONST_new_ ## NAME ## _ctx_p = &CONST_new_ ## NAME ## _ctx; \
+- EVP_DigestInit(CONST_new_ ## NAME ## _ctx_p, EVP_get_digestbyname(#NAME)); \
+- } \
++/*
++ Macro/function pair to set up the constructors.
++
++ Try to initialize a context for each hash twice, once with
++ EVP_MD_CTX_FLAG_NON_FIPS_ALLOW and once without.
++
++ Any that have errors during initialization will end up wit a NULL ctx_ptrs
++ entry, and err_msgs will be set (unless we're very low on memory)
++*/
++#define INIT_CONSTRUCTOR_CONSTANTS(NAME) do { \
++ init_constructor_constant(&cached_info_ ## NAME, #NAME); \
+ } while (0);
+
++static void
++init_constructor_constant(EVPCachedInfo *cached_info, const char *name)
++{
++ assert(cached_info);
++ cached_info->name_obj = PyString_FromString(name);
++ if (EVP_get_digestbyname(name)) {
++ int i;
++ for (i=0; i<2; i++) {
++ mc_ctx_init(&cached_info->ctxs[i], i);
++ if (EVP_DigestInit_ex(&cached_info->ctxs[i],
++ EVP_get_digestbyname(name), NULL)) {
++ /* Success: */
++ cached_info->ctx_ptrs[i] = &cached_info->ctxs[i];
++ } else {
++ /* Failure: */
++ cached_info->ctx_ptrs[i] = NULL;
++ cached_info->error_msgs[i] = error_msg_for_last_error();
++ }
++ }
++ }
++}
++
+ GEN_CONSTRUCTOR(md5)
+ GEN_CONSTRUCTOR(sha1)
+ #ifdef _OPENSSL_SUPPORTS_SHA2
+@@ -565,13 +698,10 @@ init_hashlib(void)
+ {
+ PyObject *m;
+
++ SSL_load_error_strings();
++ SSL_library_init();
+ OpenSSL_add_all_digests();
+
+- /* TODO build EVP_functions openssl_* entries dynamically based
+- * on what hashes are supported rather than listing many
+- * but having some be unsupported. Only init appropriate
+- * constants. */
+-
+ Py_TYPE(&EVPtype) = &PyType_Type;
+ if (PyType_Ready(&EVPtype) < 0)
+ return;
+diff -up Python-2.7.2/Modules/Setup.dist.hashlib-fips Python-2.7.2/Modules/Setup.dist
+--- Python-2.7.2/Modules/Setup.dist.hashlib-fips 2011-09-14 00:21:26.163252001 -0400
++++ Python-2.7.2/Modules/Setup.dist 2011-09-14 00:21:26.201252001 -0400
+@@ -248,14 +248,14 @@ imageop imageop.c # Operations on images
+ # Message-Digest Algorithm, described in RFC 1321. The necessary files
+ # md5.c and md5.h are included here.
+
+-_md5 md5module.c md5.c
++#_md5 md5module.c md5.c
+
+
+ # The _sha module implements the SHA checksum algorithms.
+ # (NIST's Secure Hash Algorithms.)
+-_sha shamodule.c
+-_sha256 sha256module.c
+-_sha512 sha512module.c
++#_sha shamodule.c
++#_sha256 sha256module.c
++#_sha512 sha512module.c
+
+
+ # SGI IRIX specific modules -- off by default.
+diff -up Python-2.7.2/setup.py.hashlib-fips Python-2.7.2/setup.py
+--- Python-2.7.2/setup.py.hashlib-fips 2011-09-14 00:21:25.722252001 -0400
++++ Python-2.7.2/setup.py 2011-09-14 00:21:26.203252001 -0400
+@@ -768,21 +768,6 @@ class PyBuildExt(build_ext):
+ print ("warning: openssl 0x%08x is too old for _hashlib" %
+ openssl_ver)
+ missing.append('_hashlib')
+- if COMPILED_WITH_PYDEBUG or not have_usable_openssl:
+- # The _sha module implements the SHA1 hash algorithm.
+- exts.append( Extension('_sha', ['shamodule.c']) )
+- # The _md5 module implements the RSA Data Security, Inc. MD5
+- # Message-Digest Algorithm, described in RFC 1321. The
+- # necessary files md5.c and md5.h are included here.
+- exts.append( Extension('_md5',
+- sources = ['md5module.c', 'md5.c'],
+- depends = ['md5.h']) )
+-
+- min_sha2_openssl_ver = 0x00908000
+- if COMPILED_WITH_PYDEBUG or openssl_ver < min_sha2_openssl_ver:
+- # OpenSSL doesn't do these until 0.9.8 so we'll bring our own hash
+- exts.append( Extension('_sha256', ['sha256module.c']) )
+- exts.append( Extension('_sha512', ['sha512module.c']) )
+
+ # Modules that provide persistent dictionary-like semantics. You will
+ # probably want to arrange for at least one of them to be available on
diff --git a/python.spec b/python.spec
index bb7b210..3d08dff 100644
--- a/python.spec
+++ b/python.spec
@@ -108,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.2
-Release: 13%{?dist}
+Release: 14%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -575,6 +575,23 @@ Patch144: 00144-no-gdbm.patch
# Backport of part of fix for
http://bugs.python.org/issue12326
Patch145: 00145-force-sys-platform-to-be-linux2.patch
+# Support OpenSSL FIPS mode (e.g. when OPENSSL_FORCE_FIPS_MODE=1 is set)
+# - handle failures from OpenSSL (e.g. on attempts to use MD5 in a
+# FIPS-enforcing environment)
+# - add a new "usedforsecurity" keyword argument to the various digest
+# algorithms in hashlib so that you can whitelist a callsite with
+# "usedforsecurity=False"
+# (sent upstream for python 3 as
http://bugs.python.org/issue9216; this is a
+# backport to python 2.7; see RHEL6 patch 119)
+# - enforce usage of the _hashlib implementation: don't fall back to the _md5
+# and _sha* modules (leading to clearer error messages if fips selftests
+# fail)
+# - don't build the _md5 and _sha* modules; rely on the _hashlib implementation
+# of hashlib (for example, md5.py will use _hashlib's implementation of MD5,
+# if permitted by the FIPS setting)
+# (rhbz#563986)
+Patch146: 00146-hashlib-fips.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -790,6 +807,16 @@ done
# Remove embedded copy of zlib:
rm -r Modules/zlib || exit 1
+# Don't build upstream Python's implementation of these crypto algorithms;
+# instead rely on _hashlib and OpenSSL.
+#
+# For example, in our builds md5.py uses always uses hashlib.md5 (rather than
+# falling back to _md5 when hashlib.md5 is not available); hashlib.md5 is
+# implemented within _hashlib via OpenSSL (and thus respects FIPS mode)
+for f in md5module.c md5.c shamodule.c sha256module.c sha512module.c; do
+ rm Modules/$f
+done
+
#
# Apply patches:
#
@@ -863,6 +890,7 @@ rm -r Modules/zlib || exit 1
%patch144 -p1
%endif
%patch145 -p1 -b .linux2
+%patch146 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -1392,13 +1420,9 @@ rm -fr %{buildroot}
%{dynload_dir}/_json.so
%{dynload_dir}/_localemodule.so
%{dynload_dir}/_lsprof.so
-%{dynload_dir}/_md5module.so
%{dynload_dir}/_multibytecodecmodule.so
%{dynload_dir}/_multiprocessing.so
%{dynload_dir}/_randommodule.so
-%{dynload_dir}/_sha256module.so
-%{dynload_dir}/_sha512module.so
-%{dynload_dir}/_shamodule.so
%{dynload_dir}/_socketmodule.so
%{dynload_dir}/_sqlite3.so
%{dynload_dir}/_ssl.so
@@ -1594,13 +1618,9 @@ rm -fr %{buildroot}
%{dynload_dir}/_json_d.so
%{dynload_dir}/_localemodule_d.so
%{dynload_dir}/_lsprof_d.so
-%{dynload_dir}/_md5module_d.so
%{dynload_dir}/_multibytecodecmodule_d.so
%{dynload_dir}/_multiprocessing_d.so
%{dynload_dir}/_randommodule_d.so
-%{dynload_dir}/_sha256module_d.so
-%{dynload_dir}/_sha512module_d.so
-%{dynload_dir}/_shamodule_d.so
%{dynload_dir}/_socketmodule_d.so
%{dynload_dir}/_sqlite3_d.so
%{dynload_dir}/_ssl_d.so
@@ -1696,6 +1716,11 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Wed Sep 14 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-14
+- support OpenSSL FIPS mode in _hashlib and hashlib; don't build the _md5 and
+_sha* modules, relying on _hashlib in hashlib, and thus within md5 etc
+(rhbz#563986; patch 146)
+
* Wed Sep 14 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-13
- force sys.platform to be "linux2" (patch 145)
commit bc10ab792a3c042e5b9e89a39290bab24af5e799
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Tue Sep 13 23:55:20 2011 -0400
force sys.platform to be "linux2" (patch 145)
* Wed Sep 14 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-13
- force sys.platform to be "linux2" (patch 145)
diff --git a/00145-force-sys-platform-to-be-linux2.patch
b/00145-force-sys-platform-to-be-linux2.patch
new file mode 100644
index 0000000..efa3bcd
--- /dev/null
+++ b/00145-force-sys-platform-to-be-linux2.patch
@@ -0,0 +1,23 @@
+diff -up Python-2.7.2/configure.in.linux2 Python-2.7.2/configure.in
+--- Python-2.7.2/configure.in.linux2 2011-09-13 23:18:19.237252000 -0400
++++ Python-2.7.2/configure.in 2011-09-13 23:18:19.494252001 -0400
+@@ -293,6 +293,7 @@ then
+ MACHDEP="$ac_md_system$ac_md_release"
+
+ case $MACHDEP in
++ linux*) MACHDEP="linux2";;
+ cygwin*) MACHDEP="cygwin";;
+ darwin*) MACHDEP="darwin";;
+ atheos*) MACHDEP="atheos";;
+diff -up Python-2.7.2/configure.linux2 Python-2.7.2/configure
+--- Python-2.7.2/configure.linux2 2011-06-11 11:46:28.000000000 -0400
++++ Python-2.7.2/configure 2011-09-13 23:18:19.489252001 -0400
+@@ -3003,6 +3003,7 @@ then
+ MACHDEP="$ac_md_system$ac_md_release"
+
+ case $MACHDEP in
++ linux*) MACHDEP="linux2";;
+ cygwin*) MACHDEP="cygwin";;
+ darwin*) MACHDEP="darwin";;
+ atheos*) MACHDEP="atheos";;
+diff -up Python-2.7.2/Misc/NEWS.linux2 Python-2.7.2/Misc/NEWS
diff --git a/python.spec b/python.spec
index c7cb627..bb7b210 100644
--- a/python.spec
+++ b/python.spec
@@ -55,6 +55,9 @@
%global with_gdbm 0
+# Turn this to 0 to turn off the "check" phase:
+%global run_selftest_suite 1
+
# Some of the files below /usr/lib/pythonMAJOR.MINOR/test (e.g. bad_coding.py)
# are deliberately invalid, leading to SyntaxError exceptions if they get
# byte-compiled.
@@ -73,6 +76,7 @@
# patch 4 (CFLAGS)
# patch 52 (valgrind)
# patch 55 (systemtap)
+# patch 145 (linux2)
#
# For patch 55 (systemtap), we need to get a new header for configure to use
#
@@ -104,7 +108,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.2
-Release: 12%{?dist}
+Release: 13%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -564,6 +568,13 @@ Patch143: 00143-tsc-on-ppc.patch
# (Optionally) disable the gdbm module:
Patch144: 00144-no-gdbm.patch
+# Force MACHDEP and thus sys.platform to be "linux2" even on systems with
+# linux 3, given that the distinction is meaningless (especially in Koji, where
+# "uname" reflects the kernel running _outside_ the mock-provided chroot).
+#
+# Backport of part of fix for
http://bugs.python.org/issue12326
+Patch145: 00145-force-sys-platform-to-be-linux2.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -851,6 +862,7 @@ rm -r Modules/zlib || exit 1
%if !%{with_gdbm}
%patch144 -p1
%endif
+%patch145 -p1 -b .linux2
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -1308,6 +1320,8 @@ CheckPython() {
}
+%if 0%{run_selftest_suite}
+
# Check each of the configurations:
%if 0%{?with_debug_build}
CheckPython \
@@ -1318,6 +1332,9 @@ CheckPython \
optimized \
python%{pybasever}
+%endif # run_selftest_suite
+
+
# ======================================================
# Cleaning up
# ======================================================
@@ -1679,6 +1696,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Wed Sep 14 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-13
+- force sys.platform to be "linux2" (patch 145)
+
* Tue Sep 13 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-12
- disable gdbm module to prepare for gdbm soname bump
commit 5764ad1aeebffdfbbaddafb63e929cca1f2fe5b9
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Tue Sep 13 14:37:20 2011 -0400
disable gdbm module to prepare for gdbm soname bump
* Tue Sep 13 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-12
- disable gdbm module to prepare for gdbm soname bump
diff --git a/00144-no-gdbm.patch b/00144-no-gdbm.patch
new file mode 100644
index 0000000..0378d44
--- /dev/null
+++ b/00144-no-gdbm.patch
@@ -0,0 +1,12 @@
+diff -up Python-2.7.2/Modules/Setup.dist.no-gdbm Python-2.7.2/Modules/Setup.dist
+--- Python-2.7.2/Modules/Setup.dist.no-gdbm 2011-09-13 14:25:43.496095926 -0400
++++ Python-2.7.2/Modules/Setup.dist 2011-09-13 14:25:46.491095724 -0400
+@@ -396,7 +396,7 @@ dl dlmodule.c
+ #
+ # First, look at Setup.config; configure may have set this for you.
+
+-gdbm gdbmmodule.c -lgdbm
++# gdbm gdbmmodule.c -lgdbm
+
+
+ # Sleepycat Berkeley DB interface.
diff --git a/python.spec b/python.spec
index 032aa98..c7cb627 100644
--- a/python.spec
+++ b/python.spec
@@ -53,6 +53,8 @@
%global with_valgrind 0
%endif
+%global with_gdbm 0
+
# Some of the files below /usr/lib/pythonMAJOR.MINOR/test (e.g. bad_coding.py)
# are deliberately invalid, leading to SyntaxError exceptions if they get
# byte-compiled.
@@ -102,7 +104,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.2
-Release: 11%{?dist}
+Release: 12%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -123,7 +125,9 @@ BuildRequires: db4-devel >= 4.8
BuildRequires: expat-devel
BuildRequires: findutils
BuildRequires: gcc-c++
+%if %{with_gdbm}
BuildRequires: gdbm-devel
+%endif
BuildRequires: glibc-devel
BuildRequires: gmp-devel
BuildRequires: libffi-devel
@@ -557,6 +561,9 @@ Patch142: 00142-skip-failing-pty-tests-in-rpmbuild.patch
# Sent upstream as
http://bugs.python.org/issue12872
Patch143: 00143-tsc-on-ppc.patch
+# (Optionally) disable the gdbm module:
+Patch144: 00144-no-gdbm.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -841,6 +848,9 @@ rm -r Modules/zlib || exit 1
%patch141 -p1
%patch142 -p1
%patch143 -p1 -b .tsc-on-ppc
+%if !%{with_gdbm}
+%patch144 -p1
+%endif
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -1389,7 +1399,9 @@ rm -fr %{buildroot}
%{dynload_dir}/dlmodule.so
%{dynload_dir}/fcntlmodule.so
%{dynload_dir}/future_builtins.so
+%if %{with_gdbm}
%{dynload_dir}/gdbmmodule.so
+%endif
%{dynload_dir}/grpmodule.so
%{dynload_dir}/imageop.so
%{dynload_dir}/itertoolsmodule.so
@@ -1589,7 +1601,9 @@ rm -fr %{buildroot}
%{dynload_dir}/dlmodule_d.so
%{dynload_dir}/fcntlmodule_d.so
%{dynload_dir}/future_builtins_d.so
+%if %{with_gdbm}
%{dynload_dir}/gdbmmodule_d.so
+%endif
%{dynload_dir}/grpmodule_d.so
%{dynload_dir}/imageop_d.so
%{dynload_dir}/itertoolsmodule_d.so
@@ -1665,6 +1679,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Tue Sep 13 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-12
+- disable gdbm module to prepare for gdbm soname bump
+
* Mon Sep 12 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-11
- rename and renumber patches for consistency with python3.spec (55, 111, 113,
114, 125, 131, 129 to 143)
commit e165474d905e492e238952baf8baa240d5b23a0f
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Mon Sep 12 17:38:37 2011 -0400
rename and renumber patches for consistency with python3.spec
diff --git a/00055-systemtap.patch b/00055-systemtap.patch
new file mode 100644
index 0000000..8c81e9d
--- /dev/null
+++ b/00055-systemtap.patch
@@ -0,0 +1,198 @@
+diff -up Python-2.7rc1/configure.in.systemtap Python-2.7rc1/configure.in
+--- Python-2.7rc1/configure.in.systemtap 2010-06-06 10:53:15.514975012 -0400
++++ Python-2.7rc1/configure.in 2010-06-06 10:53:15.520974361 -0400
+@@ -2616,6 +2616,38 @@ if test "$with_valgrind" != no; then
+ )
+ fi
+
++# Check for dtrace support
++AC_MSG_CHECKING(for --with-dtrace)
++AC_ARG_WITH(dtrace,
++ AC_HELP_STRING(--with(out)-dtrace, disable/enable dtrace support))
++
++if test ! -z "$with_dtrace"
++then
++ if dtrace -G -o /dev/null -s $srcdir/Include/pydtrace.d 2>/dev/null
++ then
++ AC_DEFINE(WITH_DTRACE, 1,
++ [Define if you want to compile in Dtrace support])
++ with_dtrace="Sun"
++ DTRACEOBJS="Python/dtrace.o"
++ DTRADEHDRS=""
++ elif dtrace -h -o /dev/null -s $srcdir/Include/pydtrace.d
++ then
++ AC_DEFINE(WITH_DTRACE, 1,
++ [Define if you want to compile in Dtrace support])
++ with_dtrace="Apple"
++ DTRACEOBJS=""
++ DTRADEHDRS="pydtrace.h"
++ else
++ with_dtrace="no"
++ fi
++else
++ with_dtrace="no"
++fi
++
++AC_MSG_RESULT($with_dtrace)
++AC_SUBST(DTRACEOBJS)
++AC_SUBST(DTRACEHDRS)
++
+ # Check for --with-wctype-functions
+ AC_MSG_CHECKING(for --with-wctype-functions)
+ AC_ARG_WITH(wctype-functions,
+diff -up Python-2.7rc1/Include/pydtrace.d.systemtap Python-2.7rc1/Include/pydtrace.d
+--- Python-2.7rc1/Include/pydtrace.d.systemtap 2010-06-06 10:53:15.520974361 -0400
++++ Python-2.7rc1/Include/pydtrace.d 2010-06-06 10:53:15.520974361 -0400
+@@ -0,0 +1,10 @@
++provider python {
++ probe function__entry(const char *, const char *, int);
++ probe function__return(const char *, const char *, int);
++};
++
++#pragma D attributes Evolving/Evolving/Common provider python provider
++#pragma D attributes Private/Private/Common provider python module
++#pragma D attributes Private/Private/Common provider python function
++#pragma D attributes Evolving/Evolving/Common provider python name
++#pragma D attributes Evolving/Evolving/Common provider python args
+diff -up Python-2.7rc1/Makefile.pre.in.systemtap Python-2.7rc1/Makefile.pre.in
+--- Python-2.7rc1/Makefile.pre.in.systemtap 2010-06-06 10:53:15.488978775 -0400
++++ Python-2.7rc1/Makefile.pre.in 2010-06-06 11:05:30.411100568 -0400
+@@ -298,6 +298,7 @@ PYTHON_OBJS= \
+ Python/formatter_unicode.o \
+ Python/formatter_string.o \
+ Python/$(DYNLOADFILE) \
++ @DTRACEOBJS@ \
+ $(LIBOBJS) \
+ $(MACHDEP_OBJS) \
+ $(THREADOBJ)
+@@ -599,6 +600,18 @@ Python/formatter_unicode.o: $(srcdir)/Py
+ Python/formatter_string.o: $(srcdir)/Python/formatter_string.c \
+ $(STRINGLIB_HEADERS)
+
++# Only needed with --with-dtrace
++buildinclude:
++ mkdir -p Include
++
++Include/pydtrace.h: buildinclude $(srcdir)/Include/pydtrace.d
++ dtrace -o $@ $(DFLAGS) -C -h -s $(srcdir)/Include/pydtrace.d
++
++Python/ceval.o: Include/pydtrace.h
++
++Python/dtrace.o: buildinclude $(srcdir)/Include/pydtrace.d Python/ceval.o
++ dtrace -o $@ $(DFLAGS) -C -G -s $(srcdir)/Include/pydtrace.d Python/ceval.o
++
+ ############################################################################
+ # Header files
+
+@@ -1251,7 +1264,7 @@ Python/thread.o: @THREADHEADERS@
+ .PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
+ .PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
+ .PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean
+-.PHONY: smelly funny patchcheck
++.PHONY: smelly funny patchcheck buildinclude
+ .PHONY: gdbhooks
+
+ # IF YOU PUT ANYTHING HERE IT WILL GO AWAY
+diff -up Python-2.7rc1/pyconfig.h.in.systemtap Python-2.7rc1/pyconfig.h.in
+--- Python-2.7rc1/pyconfig.h.in.systemtap 2010-05-08 07:04:18.000000000 -0400
++++ Python-2.7rc1/pyconfig.h.in 2010-06-06 10:53:15.521974070 -0400
+@@ -1074,6 +1074,9 @@
+ /* Define if you want documentation strings in extension modules */
+ #undef WITH_DOC_STRINGS
+
++/* Define if you want to compile in Dtrace support */
++#undef WITH_DTRACE
++
+ /* Define if you want to use the new-style (Openstep, Rhapsody, MacOS) dynamic
+ linker (dyld) instead of the old-style (NextStep) dynamic linker (rld).
+ Dyld is necessary to support frameworks. */
+diff -up Python-2.7rc1/Python/ceval.c.systemtap Python-2.7rc1/Python/ceval.c
+--- Python-2.7rc1/Python/ceval.c.systemtap 2010-05-09 10:46:46.000000000 -0400
++++ Python-2.7rc1/Python/ceval.c 2010-06-06 11:08:40.683100500 -0400
+@@ -19,6 +19,10 @@
+
+ #include <ctype.h>
+
++#ifdef WITH_DTRACE
++#include "pydtrace.h"
++#endif
++
+ #ifndef WITH_TSC
+
+ #define READ_TIMESTAMP(var)
+@@ -671,6 +675,55 @@ PyEval_EvalCode(PyCodeObject *co, PyObje
+ NULL);
+ }
+
++#ifdef WITH_DTRACE
++static void
++dtrace_entry(PyFrameObject *f)
++{
++ const char *filename;
++ const char *fname;
++ int lineno;
++
++ filename = PyString_AsString(f->f_code->co_filename);
++ fname = PyString_AsString(f->f_code->co_name);
++ lineno = PyCode_Addr2Line(f->f_code, f->f_lasti);
++
++ PYTHON_FUNCTION_ENTRY((char *)filename, (char *)fname, lineno);
++
++ /*
++ * Currently a USDT tail-call will not receive the correct arguments.
++ * Disable the tail call here.
++ */
++#if defined(__sparc)
++ asm("nop");
++#endif
++}
++
++static void
++dtrace_return(PyFrameObject *f)
++{
++ const char *filename;
++ const char *fname;
++ int lineno;
++
++ filename = PyString_AsString(f->f_code->co_filename);
++ fname = PyString_AsString(f->f_code->co_name);
++ lineno = PyCode_Addr2Line(f->f_code, f->f_lasti);
++ PYTHON_FUNCTION_RETURN((char *)filename, (char *)fname, lineno);
++
++ /*
++ * Currently a USDT tail-call will not receive the correct arguments.
++ * Disable the tail call here.
++ */
++#if defined(__sparc)
++ asm("nop");
++#endif
++}
++#else
++#define PYTHON_FUNCTION_ENTRY_ENABLED() 0
++#define PYTHON_FUNCTION_RETURN_ENABLED() 0
++#define dtrace_entry(f)
++#define dtrace_return(f)
++#endif
+
+ /* Interpreter main loop */
+
+@@ -909,6 +962,9 @@ PyEval_EvalFrameEx(PyFrameObject *f, int
+ }
+ }
+
++ if (PYTHON_FUNCTION_ENTRY_ENABLED())
++ dtrace_entry(f);
++
+ co = f->f_code;
+ names = co->co_names;
+ consts = co->co_consts;
+@@ -3000,6 +3056,9 @@ fast_yield:
+
+ /* pop frame */
+ exit_eval_frame:
++ if (PYTHON_FUNCTION_RETURN_ENABLED())
++ dtrace_return(f);
++
+ Py_LeaveRecursiveCall();
+ tstate->frame = f->f_back;
+
diff --git a/00111-no-static-lib.patch b/00111-no-static-lib.patch
new file mode 100644
index 0000000..61375b3
--- /dev/null
+++ b/00111-no-static-lib.patch
@@ -0,0 +1,50 @@
+diff -up Python-2.7rc1/Makefile.pre.in.no-static-lib Python-2.7rc1/Makefile.pre.in
+--- Python-2.7rc1/Makefile.pre.in.no-static-lib 2010-06-06 14:47:52.929975429 -0400
++++ Python-2.7rc1/Makefile.pre.in 2010-06-06 14:48:34.163350302 -0400
+@@ -393,7 +393,7 @@ coverage:
+
+
+ # Build the interpreter
+-$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
++$(BUILDPYTHON): Modules/python.o $(LDLIBRARY)
+ $(LINKCC) $(CFLAGS) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
+ Modules/python.o \
+ $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
+@@ -409,18 +409,6 @@ sharedmods: $(BUILDPYTHON)
+ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)'
LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py
build;; \
+ esac
+
+-# Build static library
+-# avoid long command lines, same as LIBRARY_OBJS
+-$(LIBRARY): $(LIBRARY_OBJS)
+- -rm -f $@
+- $(AR) $(ARFLAGS) $@ Modules/getbuildinfo.o
+- $(AR) $(ARFLAGS) $@ $(PARSER_OBJS)
+- $(AR) $(ARFLAGS) $@ $(OBJECT_OBJS)
+- $(AR) $(ARFLAGS) $@ $(PYTHON_OBJS)
+- $(AR) $(ARFLAGS) $@ $(MODULE_OBJS) $(SIGNAL_OBJS)
+- $(AR) $(ARFLAGS) $@ $(MODOBJS)
+- $(RANLIB) $@
+-
+ libpython$(VERSION).so: $(LIBRARY_OBJS)
+ if test $(INSTSONAME) != $(LDLIBRARY); then \
+ $(LDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS)
$(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
+@@ -1002,18 +990,6 @@ libainstall: all python-config
+ else true; \
+ fi; \
+ done
+- @if test -d $(LIBRARY); then :; else \
+- if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
+- if test "$(SO)" = .dll; then \
+- $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
+- else \
+- $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
+- $(RANLIB) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
+- fi; \
+- else \
+- echo Skip install of $(LIBRARY) - use make frameworkinstall; \
+- fi; \
+- fi
+ $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
+ $(INSTALL_DATA) Modules/python.o $(DESTDIR)$(LIBPL)/python.o
+ $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
diff --git a/00113-more-configuration-flags.patch b/00113-more-configuration-flags.patch
new file mode 100644
index 0000000..9ee3180
--- /dev/null
+++ b/00113-more-configuration-flags.patch
@@ -0,0 +1,50 @@
+diff -up Python-2.6.5/configure.in.more-configuration-flags Python-2.6.5/configure.in
+--- Python-2.6.5/configure.in.more-configuration-flags 2010-05-24 18:51:25.410111792
-0400
++++ Python-2.6.5/configure.in 2010-05-24 18:59:23.954986388 -0400
+@@ -2515,6 +2515,30 @@ else AC_MSG_RESULT(no)
+ fi],
+ [AC_MSG_RESULT(no)])
+
++AC_MSG_CHECKING(for --with-count-allocs)
++AC_ARG_WITH(count-allocs,
++[ --with(out)count-allocs enable/disable per-type instance accounting], [
++if test "$withval" != no
++then
++ AC_DEFINE(COUNT_ALLOCS, 1,
++ [Define to keep records of the number of instances of each type])
++ AC_MSG_RESULT(yes)
++else AC_MSG_RESULT(no)
++fi],
++[AC_MSG_RESULT(no)])
++
++AC_MSG_CHECKING(for --with-call-profile)
++AC_ARG_WITH(call-profile,
++[ --with(out)-call-profile enable/disable statistics on function call invocation], [
++if test "$withval" != no
++then
++ AC_DEFINE(CALL_PROFILE, 1,
++ [Define to keep records on function call invocation])
++ AC_MSG_RESULT(yes)
++else AC_MSG_RESULT(no)
++fi],
++[AC_MSG_RESULT(no)])
++
+ # Check for Python-specific malloc support
+ AC_MSG_CHECKING(for --with-pymalloc)
+ AC_ARG_WITH(pymalloc,
+diff -up Python-2.6.5/pyconfig.h.in.more-configuration-flags Python-2.6.5/pyconfig.h.in
+--- Python-2.6.5/pyconfig.h.in.more-configuration-flags 2010-05-24 18:51:45.677988086
-0400
++++ Python-2.6.5/pyconfig.h.in 2010-05-24 19:00:44.163987730 -0400
+@@ -1019,6 +1019,12 @@
+ /* Define to profile with the Pentium timestamp counter */
+ #undef WITH_TSC
+
++/* Define to keep records of the number of instances of each type */
++#undef COUNT_ALLOCS
++
++/* Define to keep records on function call invocation */
++#undef CALL_PROFILE
++
+ /* Define if you want pymalloc to be disabled when running under valgrind */
+ #undef WITH_VALGRIND
+
diff --git a/00114-statvfs-f_flag-constants.patch b/00114-statvfs-f_flag-constants.patch
new file mode 100644
index 0000000..83e7b59
--- /dev/null
+++ b/00114-statvfs-f_flag-constants.patch
@@ -0,0 +1,47 @@
+diff -up Python-2.7rc1/Modules/posixmodule.c.statvfs-f-flag-constants
Python-2.7rc1/Modules/posixmodule.c
+--- Python-2.7rc1/Modules/posixmodule.c.statvfs-f-flag-constants 2010-05-15
17:45:30.000000000 -0400
++++ Python-2.7rc1/Modules/posixmodule.c 2010-06-07 22:54:16.162068624 -0400
+@@ -9174,6 +9174,43 @@ all_ins(PyObject *d)
+ #endif
+ #endif
+
++ /* These came from statvfs.h */
++#ifdef ST_RDONLY
++ if (ins(d, "ST_RDONLY", (long)ST_RDONLY)) return -1;
++#endif /* ST_RDONLY */
++#ifdef ST_NOSUID
++ if (ins(d, "ST_NOSUID", (long)ST_NOSUID)) return -1;
++#endif /* ST_NOSUID */
++
++ /* GNU extensions */
++#ifdef ST_NODEV
++ if (ins(d, "ST_NODEV", (long)ST_NODEV)) return -1;
++#endif /* ST_NODEV */
++#ifdef ST_NOEXEC
++ if (ins(d, "ST_NOEXEC", (long)ST_NOEXEC)) return -1;
++#endif /* ST_NOEXEC */
++#ifdef ST_SYNCHRONOUS
++ if (ins(d, "ST_SYNCHRONOUS", (long)ST_SYNCHRONOUS)) return -1;
++#endif /* ST_SYNCHRONOUS */
++#ifdef ST_MANDLOCK
++ if (ins(d, "ST_MANDLOCK", (long)ST_MANDLOCK)) return -1;
++#endif /* ST_MANDLOCK */
++#ifdef ST_WRITE
++ if (ins(d, "ST_WRITE", (long)ST_WRITE)) return -1;
++#endif /* ST_WRITE */
++#ifdef ST_APPEND
++ if (ins(d, "ST_APPEND", (long)ST_APPEND)) return -1;
++#endif /* ST_APPEND */
++#ifdef ST_NOATIME
++ if (ins(d, "ST_NOATIME", (long)ST_NOATIME)) return -1;
++#endif /* ST_NOATIME */
++#ifdef ST_NODIRATIME
++ if (ins(d, "ST_NODIRATIME", (long)ST_NODIRATIME)) return -1;
++#endif /* ST_NODIRATIME */
++#ifdef ST_RELATIME
++ if (ins(d, "ST_RELATIME", (long)ST_RELATIME)) return -1;
++#endif /* ST_RELATIME */
++
+ #if defined(PYOS_OS2)
+ if (insertvalues(d)) return -1;
+ #endif
diff --git a/00125-less-verbose-COUNT_ALLOCS.patch
b/00125-less-verbose-COUNT_ALLOCS.patch
new file mode 100644
index 0000000..8cef015
--- /dev/null
+++ b/00125-less-verbose-COUNT_ALLOCS.patch
@@ -0,0 +1,20 @@
+diff -up Python-2.7/Python/pythonrun.c.less-verbose-COUNT_ALLOCS
Python-2.7/Python/pythonrun.c
+--- Python-2.7/Python/pythonrun.c.less-verbose-COUNT_ALLOCS 2010-08-17 14:49:33.321913909
-0400
++++ Python-2.7/Python/pythonrun.c 2010-08-17 14:54:48.750910403 -0400
+@@ -470,7 +470,15 @@ Py_Finalize(void)
+
+ /* Debugging stuff */
+ #ifdef COUNT_ALLOCS
+- dump_counts(stdout);
++ /* This is a downstream Fedora modification.
++ The upstream default with COUNT_ALLOCS is to always dump the counts to
++ stdout on exit. For our debug builds its useful to have the info from
++ COUNT_ALLOCS available, but the stdout info here gets in the way, so
++ we make it optional, wrapping it in an environment variable (modelled
++ on the other PYTHONDUMP* env variables):
++ */
++ if (Py_GETENV("PYTHONDUMPCOUNTS"))
++ dump_counts(stdout);
+ #endif
+
+ PRINT_TOTAL_REFS();
diff --git a/00131-disable-tests-in-test_io.patch b/00131-disable-tests-in-test_io.patch
new file mode 100644
index 0000000..d81a2d0
--- /dev/null
+++ b/00131-disable-tests-in-test_io.patch
@@ -0,0 +1,11 @@
+diff -up Python-2.7.2/Lib/test/test_io.py.disable-tests-in-test_io
Python-2.7.2/Lib/test/test_io.py
+--- Python-2.7.2/Lib/test/test_io.py.disable-tests-in-test_io 2011-09-01
14:18:45.963304089 -0400
++++ Python-2.7.2/Lib/test/test_io.py 2011-09-01 15:08:53.796098413 -0400
+@@ -2669,6 +2669,7 @@ class SignalsTest(unittest.TestCase):
+ self.check_interrupted_read_retry(lambda x: x,
+ mode="r")
+
++ @unittest.skip('rhbz#732998')
+ @unittest.skipUnless(threading, 'Threading required for this test.')
+ def check_interrupted_write_retry(self, item, **fdopen_kwargs):
+ """Check that a buffered write, when it gets interrupted (either
diff --git a/00143-tsc-on-ppc.patch b/00143-tsc-on-ppc.patch
new file mode 100644
index 0000000..447c6e3
--- /dev/null
+++ b/00143-tsc-on-ppc.patch
@@ -0,0 +1,58 @@
+diff -up Python-2.7.2/Python/ceval.c.tsc-on-ppc Python-2.7.2/Python/ceval.c
+--- Python-2.7.2/Python/ceval.c.tsc-on-ppc 2011-08-23 14:59:48.051300849 -0400
++++ Python-2.7.2/Python/ceval.c 2011-08-23 15:33:25.412162902 -0400
+@@ -37,24 +37,42 @@ typedef unsigned long long uint64;
+ */
+ #if defined(__ppc__) || defined (__powerpc__)
+
+-#define READ_TIMESTAMP(var) ppc_getcounter(&var)
++#if defined( __powerpc64__) || defined(__LP64__)
++/* 64-bit PowerPC */
++#define READ_TIMESTAMP(var) ppc64_getcounter(&var)
++static void
++ppc64_getcounter(uint64 *v)
++{
++ /* On 64-bit PowerPC we can read the 64-bit timebase directly into a
++ 64-bit register */
++ uint64 timebase;
++#ifdef _ARCH_PWR4
++ asm volatile ("mfspr %0,268" : "=r" (timebase));
++#else
++ asm volatile ("mftb %0" : "=r" (timebase));
++#endif
++ *v = timebase;
++}
++
++#else
++/* 32-bit PowerPC */
++#define READ_TIMESTAMP(var) ppc32_getcounter(&var)
+
+ static void
+-ppc_getcounter(uint64 *v)
++ppc32_getcounter(uint64 *v)
+ {
+- register unsigned long tbu, tb, tbu2;
++ union { long long ll; long ii[2]; } u;
++ long tmp;
+
+ loop:
+- asm volatile ("mftbu %0" : "=r" (tbu) );
+- asm volatile ("mftb %0" : "=r" (tb) );
+- asm volatile ("mftbu %0" : "=r" (tbu2));
+- if (__builtin_expect(tbu != tbu2, 0)) goto loop;
+-
+- /* The slightly peculiar way of writing the next lines is
+- compiled better by GCC than any other way I tried. */
+- ((long*)(v))[0] = tbu;
+- ((long*)(v))[1] = tb;
++ asm volatile ("mftbu %0" : "=r" (u.ii[0]) );
++ asm volatile ("mftb %0" : "=r" (u.ii[1]) );
++ asm volatile ("mftbu %0" : "=r" (tmp));
++ if (__builtin_expect(u.ii[0] != tmp, 0)) goto loop;
++
++ *v = u.ll;
+ }
++#endif /* powerpc 32/64 bit */
+
+ #elif defined(__i386__)
+
diff --git a/less-verbose-COUNT_ALLOCS.patch b/less-verbose-COUNT_ALLOCS.patch
deleted file mode 100644
index 8cef015..0000000
--- a/less-verbose-COUNT_ALLOCS.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-diff -up Python-2.7/Python/pythonrun.c.less-verbose-COUNT_ALLOCS
Python-2.7/Python/pythonrun.c
---- Python-2.7/Python/pythonrun.c.less-verbose-COUNT_ALLOCS 2010-08-17 14:49:33.321913909
-0400
-+++ Python-2.7/Python/pythonrun.c 2010-08-17 14:54:48.750910403 -0400
-@@ -470,7 +470,15 @@ Py_Finalize(void)
-
- /* Debugging stuff */
- #ifdef COUNT_ALLOCS
-- dump_counts(stdout);
-+ /* This is a downstream Fedora modification.
-+ The upstream default with COUNT_ALLOCS is to always dump the counts to
-+ stdout on exit. For our debug builds its useful to have the info from
-+ COUNT_ALLOCS available, but the stdout info here gets in the way, so
-+ we make it optional, wrapping it in an environment variable (modelled
-+ on the other PYTHONDUMP* env variables):
-+ */
-+ if (Py_GETENV("PYTHONDUMPCOUNTS"))
-+ dump_counts(stdout);
- #endif
-
- PRINT_TOTAL_REFS();
diff --git a/python-2.6.5-more-configuration-flags.patch
b/python-2.6.5-more-configuration-flags.patch
deleted file mode 100644
index 9ee3180..0000000
--- a/python-2.6.5-more-configuration-flags.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-diff -up Python-2.6.5/configure.in.more-configuration-flags Python-2.6.5/configure.in
---- Python-2.6.5/configure.in.more-configuration-flags 2010-05-24 18:51:25.410111792
-0400
-+++ Python-2.6.5/configure.in 2010-05-24 18:59:23.954986388 -0400
-@@ -2515,6 +2515,30 @@ else AC_MSG_RESULT(no)
- fi],
- [AC_MSG_RESULT(no)])
-
-+AC_MSG_CHECKING(for --with-count-allocs)
-+AC_ARG_WITH(count-allocs,
-+[ --with(out)count-allocs enable/disable per-type instance accounting], [
-+if test "$withval" != no
-+then
-+ AC_DEFINE(COUNT_ALLOCS, 1,
-+ [Define to keep records of the number of instances of each type])
-+ AC_MSG_RESULT(yes)
-+else AC_MSG_RESULT(no)
-+fi],
-+[AC_MSG_RESULT(no)])
-+
-+AC_MSG_CHECKING(for --with-call-profile)
-+AC_ARG_WITH(call-profile,
-+[ --with(out)-call-profile enable/disable statistics on function call invocation], [
-+if test "$withval" != no
-+then
-+ AC_DEFINE(CALL_PROFILE, 1,
-+ [Define to keep records on function call invocation])
-+ AC_MSG_RESULT(yes)
-+else AC_MSG_RESULT(no)
-+fi],
-+[AC_MSG_RESULT(no)])
-+
- # Check for Python-specific malloc support
- AC_MSG_CHECKING(for --with-pymalloc)
- AC_ARG_WITH(pymalloc,
-diff -up Python-2.6.5/pyconfig.h.in.more-configuration-flags Python-2.6.5/pyconfig.h.in
---- Python-2.6.5/pyconfig.h.in.more-configuration-flags 2010-05-24 18:51:45.677988086
-0400
-+++ Python-2.6.5/pyconfig.h.in 2010-05-24 19:00:44.163987730 -0400
-@@ -1019,6 +1019,12 @@
- /* Define to profile with the Pentium timestamp counter */
- #undef WITH_TSC
-
-+/* Define to keep records of the number of instances of each type */
-+#undef COUNT_ALLOCS
-+
-+/* Define to keep records on function call invocation */
-+#undef CALL_PROFILE
-+
- /* Define if you want pymalloc to be disabled when running under valgrind */
- #undef WITH_VALGRIND
-
diff --git a/python-2.7.2-disable-tests-in-test_io.patch
b/python-2.7.2-disable-tests-in-test_io.patch
deleted file mode 100644
index d81a2d0..0000000
--- a/python-2.7.2-disable-tests-in-test_io.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -up Python-2.7.2/Lib/test/test_io.py.disable-tests-in-test_io
Python-2.7.2/Lib/test/test_io.py
---- Python-2.7.2/Lib/test/test_io.py.disable-tests-in-test_io 2011-09-01
14:18:45.963304089 -0400
-+++ Python-2.7.2/Lib/test/test_io.py 2011-09-01 15:08:53.796098413 -0400
-@@ -2669,6 +2669,7 @@ class SignalsTest(unittest.TestCase):
- self.check_interrupted_read_retry(lambda x: x,
- mode="r")
-
-+ @unittest.skip('rhbz#732998')
- @unittest.skipUnless(threading, 'Threading required for this test.')
- def check_interrupted_write_retry(self, item, **fdopen_kwargs):
- """Check that a buffered write, when it gets interrupted (either
diff --git a/python-2.7.2-tsc-on-ppc.patch b/python-2.7.2-tsc-on-ppc.patch
deleted file mode 100644
index 447c6e3..0000000
--- a/python-2.7.2-tsc-on-ppc.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-diff -up Python-2.7.2/Python/ceval.c.tsc-on-ppc Python-2.7.2/Python/ceval.c
---- Python-2.7.2/Python/ceval.c.tsc-on-ppc 2011-08-23 14:59:48.051300849 -0400
-+++ Python-2.7.2/Python/ceval.c 2011-08-23 15:33:25.412162902 -0400
-@@ -37,24 +37,42 @@ typedef unsigned long long uint64;
- */
- #if defined(__ppc__) || defined (__powerpc__)
-
--#define READ_TIMESTAMP(var) ppc_getcounter(&var)
-+#if defined( __powerpc64__) || defined(__LP64__)
-+/* 64-bit PowerPC */
-+#define READ_TIMESTAMP(var) ppc64_getcounter(&var)
-+static void
-+ppc64_getcounter(uint64 *v)
-+{
-+ /* On 64-bit PowerPC we can read the 64-bit timebase directly into a
-+ 64-bit register */
-+ uint64 timebase;
-+#ifdef _ARCH_PWR4
-+ asm volatile ("mfspr %0,268" : "=r" (timebase));
-+#else
-+ asm volatile ("mftb %0" : "=r" (timebase));
-+#endif
-+ *v = timebase;
-+}
-+
-+#else
-+/* 32-bit PowerPC */
-+#define READ_TIMESTAMP(var) ppc32_getcounter(&var)
-
- static void
--ppc_getcounter(uint64 *v)
-+ppc32_getcounter(uint64 *v)
- {
-- register unsigned long tbu, tb, tbu2;
-+ union { long long ll; long ii[2]; } u;
-+ long tmp;
-
- loop:
-- asm volatile ("mftbu %0" : "=r" (tbu) );
-- asm volatile ("mftb %0" : "=r" (tb) );
-- asm volatile ("mftbu %0" : "=r" (tbu2));
-- if (__builtin_expect(tbu != tbu2, 0)) goto loop;
--
-- /* The slightly peculiar way of writing the next lines is
-- compiled better by GCC than any other way I tried. */
-- ((long*)(v))[0] = tbu;
-- ((long*)(v))[1] = tb;
-+ asm volatile ("mftbu %0" : "=r" (u.ii[0]) );
-+ asm volatile ("mftb %0" : "=r" (u.ii[1]) );
-+ asm volatile ("mftbu %0" : "=r" (tmp));
-+ if (__builtin_expect(u.ii[0] != tmp, 0)) goto loop;
-+
-+ *v = u.ll;
- }
-+#endif /* powerpc 32/64 bit */
-
- #elif defined(__i386__)
-
diff --git a/python-2.7rc1-dtrace.patch b/python-2.7rc1-dtrace.patch
deleted file mode 100644
index 8c81e9d..0000000
--- a/python-2.7rc1-dtrace.patch
+++ /dev/null
@@ -1,198 +0,0 @@
-diff -up Python-2.7rc1/configure.in.systemtap Python-2.7rc1/configure.in
---- Python-2.7rc1/configure.in.systemtap 2010-06-06 10:53:15.514975012 -0400
-+++ Python-2.7rc1/configure.in 2010-06-06 10:53:15.520974361 -0400
-@@ -2616,6 +2616,38 @@ if test "$with_valgrind" != no; then
- )
- fi
-
-+# Check for dtrace support
-+AC_MSG_CHECKING(for --with-dtrace)
-+AC_ARG_WITH(dtrace,
-+ AC_HELP_STRING(--with(out)-dtrace, disable/enable dtrace support))
-+
-+if test ! -z "$with_dtrace"
-+then
-+ if dtrace -G -o /dev/null -s $srcdir/Include/pydtrace.d 2>/dev/null
-+ then
-+ AC_DEFINE(WITH_DTRACE, 1,
-+ [Define if you want to compile in Dtrace support])
-+ with_dtrace="Sun"
-+ DTRACEOBJS="Python/dtrace.o"
-+ DTRADEHDRS=""
-+ elif dtrace -h -o /dev/null -s $srcdir/Include/pydtrace.d
-+ then
-+ AC_DEFINE(WITH_DTRACE, 1,
-+ [Define if you want to compile in Dtrace support])
-+ with_dtrace="Apple"
-+ DTRACEOBJS=""
-+ DTRADEHDRS="pydtrace.h"
-+ else
-+ with_dtrace="no"
-+ fi
-+else
-+ with_dtrace="no"
-+fi
-+
-+AC_MSG_RESULT($with_dtrace)
-+AC_SUBST(DTRACEOBJS)
-+AC_SUBST(DTRACEHDRS)
-+
- # Check for --with-wctype-functions
- AC_MSG_CHECKING(for --with-wctype-functions)
- AC_ARG_WITH(wctype-functions,
-diff -up Python-2.7rc1/Include/pydtrace.d.systemtap Python-2.7rc1/Include/pydtrace.d
---- Python-2.7rc1/Include/pydtrace.d.systemtap 2010-06-06 10:53:15.520974361 -0400
-+++ Python-2.7rc1/Include/pydtrace.d 2010-06-06 10:53:15.520974361 -0400
-@@ -0,0 +1,10 @@
-+provider python {
-+ probe function__entry(const char *, const char *, int);
-+ probe function__return(const char *, const char *, int);
-+};
-+
-+#pragma D attributes Evolving/Evolving/Common provider python provider
-+#pragma D attributes Private/Private/Common provider python module
-+#pragma D attributes Private/Private/Common provider python function
-+#pragma D attributes Evolving/Evolving/Common provider python name
-+#pragma D attributes Evolving/Evolving/Common provider python args
-diff -up Python-2.7rc1/Makefile.pre.in.systemtap Python-2.7rc1/Makefile.pre.in
---- Python-2.7rc1/Makefile.pre.in.systemtap 2010-06-06 10:53:15.488978775 -0400
-+++ Python-2.7rc1/Makefile.pre.in 2010-06-06 11:05:30.411100568 -0400
-@@ -298,6 +298,7 @@ PYTHON_OBJS= \
- Python/formatter_unicode.o \
- Python/formatter_string.o \
- Python/$(DYNLOADFILE) \
-+ @DTRACEOBJS@ \
- $(LIBOBJS) \
- $(MACHDEP_OBJS) \
- $(THREADOBJ)
-@@ -599,6 +600,18 @@ Python/formatter_unicode.o: $(srcdir)/Py
- Python/formatter_string.o: $(srcdir)/Python/formatter_string.c \
- $(STRINGLIB_HEADERS)
-
-+# Only needed with --with-dtrace
-+buildinclude:
-+ mkdir -p Include
-+
-+Include/pydtrace.h: buildinclude $(srcdir)/Include/pydtrace.d
-+ dtrace -o $@ $(DFLAGS) -C -h -s $(srcdir)/Include/pydtrace.d
-+
-+Python/ceval.o: Include/pydtrace.h
-+
-+Python/dtrace.o: buildinclude $(srcdir)/Include/pydtrace.d Python/ceval.o
-+ dtrace -o $@ $(DFLAGS) -C -G -s $(srcdir)/Include/pydtrace.d Python/ceval.o
-+
- ############################################################################
- # Header files
-
-@@ -1251,7 +1264,7 @@ Python/thread.o: @THREADHEADERS@
- .PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
- .PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
- .PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean
--.PHONY: smelly funny patchcheck
-+.PHONY: smelly funny patchcheck buildinclude
- .PHONY: gdbhooks
-
- # IF YOU PUT ANYTHING HERE IT WILL GO AWAY
-diff -up Python-2.7rc1/pyconfig.h.in.systemtap Python-2.7rc1/pyconfig.h.in
---- Python-2.7rc1/pyconfig.h.in.systemtap 2010-05-08 07:04:18.000000000 -0400
-+++ Python-2.7rc1/pyconfig.h.in 2010-06-06 10:53:15.521974070 -0400
-@@ -1074,6 +1074,9 @@
- /* Define if you want documentation strings in extension modules */
- #undef WITH_DOC_STRINGS
-
-+/* Define if you want to compile in Dtrace support */
-+#undef WITH_DTRACE
-+
- /* Define if you want to use the new-style (Openstep, Rhapsody, MacOS) dynamic
- linker (dyld) instead of the old-style (NextStep) dynamic linker (rld).
- Dyld is necessary to support frameworks. */
-diff -up Python-2.7rc1/Python/ceval.c.systemtap Python-2.7rc1/Python/ceval.c
---- Python-2.7rc1/Python/ceval.c.systemtap 2010-05-09 10:46:46.000000000 -0400
-+++ Python-2.7rc1/Python/ceval.c 2010-06-06 11:08:40.683100500 -0400
-@@ -19,6 +19,10 @@
-
- #include <ctype.h>
-
-+#ifdef WITH_DTRACE
-+#include "pydtrace.h"
-+#endif
-+
- #ifndef WITH_TSC
-
- #define READ_TIMESTAMP(var)
-@@ -671,6 +675,55 @@ PyEval_EvalCode(PyCodeObject *co, PyObje
- NULL);
- }
-
-+#ifdef WITH_DTRACE
-+static void
-+dtrace_entry(PyFrameObject *f)
-+{
-+ const char *filename;
-+ const char *fname;
-+ int lineno;
-+
-+ filename = PyString_AsString(f->f_code->co_filename);
-+ fname = PyString_AsString(f->f_code->co_name);
-+ lineno = PyCode_Addr2Line(f->f_code, f->f_lasti);
-+
-+ PYTHON_FUNCTION_ENTRY((char *)filename, (char *)fname, lineno);
-+
-+ /*
-+ * Currently a USDT tail-call will not receive the correct arguments.
-+ * Disable the tail call here.
-+ */
-+#if defined(__sparc)
-+ asm("nop");
-+#endif
-+}
-+
-+static void
-+dtrace_return(PyFrameObject *f)
-+{
-+ const char *filename;
-+ const char *fname;
-+ int lineno;
-+
-+ filename = PyString_AsString(f->f_code->co_filename);
-+ fname = PyString_AsString(f->f_code->co_name);
-+ lineno = PyCode_Addr2Line(f->f_code, f->f_lasti);
-+ PYTHON_FUNCTION_RETURN((char *)filename, (char *)fname, lineno);
-+
-+ /*
-+ * Currently a USDT tail-call will not receive the correct arguments.
-+ * Disable the tail call here.
-+ */
-+#if defined(__sparc)
-+ asm("nop");
-+#endif
-+}
-+#else
-+#define PYTHON_FUNCTION_ENTRY_ENABLED() 0
-+#define PYTHON_FUNCTION_RETURN_ENABLED() 0
-+#define dtrace_entry(f)
-+#define dtrace_return(f)
-+#endif
-
- /* Interpreter main loop */
-
-@@ -909,6 +962,9 @@ PyEval_EvalFrameEx(PyFrameObject *f, int
- }
- }
-
-+ if (PYTHON_FUNCTION_ENTRY_ENABLED())
-+ dtrace_entry(f);
-+
- co = f->f_code;
- names = co->co_names;
- consts = co->co_consts;
-@@ -3000,6 +3056,9 @@ fast_yield:
-
- /* pop frame */
- exit_eval_frame:
-+ if (PYTHON_FUNCTION_RETURN_ENABLED())
-+ dtrace_return(f);
-+
- Py_LeaveRecursiveCall();
- tstate->frame = f->f_back;
-
diff --git a/python-2.7rc1-no-static-lib.patch b/python-2.7rc1-no-static-lib.patch
deleted file mode 100644
index 61375b3..0000000
--- a/python-2.7rc1-no-static-lib.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-diff -up Python-2.7rc1/Makefile.pre.in.no-static-lib Python-2.7rc1/Makefile.pre.in
---- Python-2.7rc1/Makefile.pre.in.no-static-lib 2010-06-06 14:47:52.929975429 -0400
-+++ Python-2.7rc1/Makefile.pre.in 2010-06-06 14:48:34.163350302 -0400
-@@ -393,7 +393,7 @@ coverage:
-
-
- # Build the interpreter
--$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
-+$(BUILDPYTHON): Modules/python.o $(LDLIBRARY)
- $(LINKCC) $(CFLAGS) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
- Modules/python.o \
- $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
-@@ -409,18 +409,6 @@ sharedmods: $(BUILDPYTHON)
- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)'
LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py
build;; \
- esac
-
--# Build static library
--# avoid long command lines, same as LIBRARY_OBJS
--$(LIBRARY): $(LIBRARY_OBJS)
-- -rm -f $@
-- $(AR) $(ARFLAGS) $@ Modules/getbuildinfo.o
-- $(AR) $(ARFLAGS) $@ $(PARSER_OBJS)
-- $(AR) $(ARFLAGS) $@ $(OBJECT_OBJS)
-- $(AR) $(ARFLAGS) $@ $(PYTHON_OBJS)
-- $(AR) $(ARFLAGS) $@ $(MODULE_OBJS) $(SIGNAL_OBJS)
-- $(AR) $(ARFLAGS) $@ $(MODOBJS)
-- $(RANLIB) $@
--
- libpython$(VERSION).so: $(LIBRARY_OBJS)
- if test $(INSTSONAME) != $(LDLIBRARY); then \
- $(LDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS)
$(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
-@@ -1002,18 +990,6 @@ libainstall: all python-config
- else true; \
- fi; \
- done
-- @if test -d $(LIBRARY); then :; else \
-- if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
-- if test "$(SO)" = .dll; then \
-- $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
-- else \
-- $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
-- $(RANLIB) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
-- fi; \
-- else \
-- echo Skip install of $(LIBRARY) - use make frameworkinstall; \
-- fi; \
-- fi
- $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
- $(INSTALL_DATA) Modules/python.o $(DESTDIR)$(LIBPL)/python.o
- $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
diff --git a/python-2.7rc1-statvfs-f_flag-constants.patch
b/python-2.7rc1-statvfs-f_flag-constants.patch
deleted file mode 100644
index 83e7b59..0000000
--- a/python-2.7rc1-statvfs-f_flag-constants.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-diff -up Python-2.7rc1/Modules/posixmodule.c.statvfs-f-flag-constants
Python-2.7rc1/Modules/posixmodule.c
---- Python-2.7rc1/Modules/posixmodule.c.statvfs-f-flag-constants 2010-05-15
17:45:30.000000000 -0400
-+++ Python-2.7rc1/Modules/posixmodule.c 2010-06-07 22:54:16.162068624 -0400
-@@ -9174,6 +9174,43 @@ all_ins(PyObject *d)
- #endif
- #endif
-
-+ /* These came from statvfs.h */
-+#ifdef ST_RDONLY
-+ if (ins(d, "ST_RDONLY", (long)ST_RDONLY)) return -1;
-+#endif /* ST_RDONLY */
-+#ifdef ST_NOSUID
-+ if (ins(d, "ST_NOSUID", (long)ST_NOSUID)) return -1;
-+#endif /* ST_NOSUID */
-+
-+ /* GNU extensions */
-+#ifdef ST_NODEV
-+ if (ins(d, "ST_NODEV", (long)ST_NODEV)) return -1;
-+#endif /* ST_NODEV */
-+#ifdef ST_NOEXEC
-+ if (ins(d, "ST_NOEXEC", (long)ST_NOEXEC)) return -1;
-+#endif /* ST_NOEXEC */
-+#ifdef ST_SYNCHRONOUS
-+ if (ins(d, "ST_SYNCHRONOUS", (long)ST_SYNCHRONOUS)) return -1;
-+#endif /* ST_SYNCHRONOUS */
-+#ifdef ST_MANDLOCK
-+ if (ins(d, "ST_MANDLOCK", (long)ST_MANDLOCK)) return -1;
-+#endif /* ST_MANDLOCK */
-+#ifdef ST_WRITE
-+ if (ins(d, "ST_WRITE", (long)ST_WRITE)) return -1;
-+#endif /* ST_WRITE */
-+#ifdef ST_APPEND
-+ if (ins(d, "ST_APPEND", (long)ST_APPEND)) return -1;
-+#endif /* ST_APPEND */
-+#ifdef ST_NOATIME
-+ if (ins(d, "ST_NOATIME", (long)ST_NOATIME)) return -1;
-+#endif /* ST_NOATIME */
-+#ifdef ST_NODIRATIME
-+ if (ins(d, "ST_NODIRATIME", (long)ST_NODIRATIME)) return -1;
-+#endif /* ST_NODIRATIME */
-+#ifdef ST_RELATIME
-+ if (ins(d, "ST_RELATIME", (long)ST_RELATIME)) return -1;
-+#endif /* ST_RELATIME */
-+
- #if defined(PYOS_OS2)
- if (insertvalues(d)) return -1;
- #endif
diff --git a/python.spec b/python.spec
index c2b6cb9..032aa98 100644
--- a/python.spec
+++ b/python.spec
@@ -102,7 +102,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.2
-Release: 10%{?dist}
+Release: 11%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -329,7 +329,7 @@ Patch54: python-2.6.4-setup-db48.patch
# fixed up by mjw and wcohen for 2.6.2, then fixed up by dmalcolm for 2.6.4
# then rewritten by mjw (attachment 390110 of rhbz 545179), then reformatted
# for 2.7rc1 by dmalcolm:
-Patch55: python-2.7rc1-dtrace.patch
+Patch55: 00055-systemtap.patch
# "lib64 patches"
# This patch seems to be associated with bug 122304, which was
@@ -364,7 +364,7 @@ Patch104: 00104-lib64-fix-for-test_install.patch
# Patch the Makefile.pre.in so that the generated Makefile doesn't try to build
# a libpythonMAJOR.MINOR.a (bug 550692):
-Patch111: python-2.7rc1-no-static-lib.patch
+Patch111: 00111-no-static-lib.patch
# Patch to support building both optimized vs debug stacks DSO ABIs, sharing
# the same .py and .pyc files, using "_d.so" to signify a debug build of an
@@ -434,11 +434,11 @@ Patch112: python-2.7rc1-debug-build.patch
# described at
http://svn.python.org/projects/python/trunk/Misc/SpecialBuilds.txt
# so that if they are enabled, they will be in that build's pyconfig.h, so that
# extension modules will reliably use them
-Patch113: python-2.6.5-more-configuration-flags.patch
+Patch113: 00113-more-configuration-flags.patch
# Add flags for statvfs.f_flag to the constant list in posixmodule (i.e. "os")
# (rhbz:553020); partially upstream as
http://bugs.python.org/issue7647
-Patch114: python-2.7rc1-statvfs-f_flag-constants.patch
+Patch114: 00114-statvfs-f_flag-constants.patch
# Make "pydoc -k" more robust in the face of broken modules
# (rhbz:461419; patch sent upstream as
http://bugs.python.org/issue7425 )
@@ -465,7 +465,7 @@ Patch121: python-2.7rc2-r79310.patch
# use the debug build. Add a "PYTHONDUMPCOUNTS" environment variable which
# must be set to enable the output on exit
# Not yet sent upstream:
-Patch125: less-verbose-COUNT_ALLOCS.patch
+Patch125: 00125-less-verbose-COUNT_ALLOCS.patch
# Fix dbm module on big-endian 64-bit
# Sent upstream as
http://bugs.python.org/issue9687 (rhbz#626756)
@@ -481,11 +481,6 @@ Patch127: fix-test_structmember-on-64bit-bigendian.patch
# Not yet sent upstream
Patch128: python-2.7.1-fix_test_abc_with_COUNT_ALLOCS.patch
-# Fix the --with-tsc option on ppc64, and rework it on 32-bit ppc to avoid
-# aliasing violations (rhbz#698726)
-# Sent upstream as
http://bugs.python.org/issue12872
-Patch129: python-2.7.2-tsc-on-ppc.patch
-
# Add "--extension-suffix" option to python-config and python-debug-config
# (rhbz#732808)
#
@@ -506,7 +501,7 @@ Patch130: python-2.7.2-add-extension-suffix-to-python-config.patch
# fail when built in Koji, for ppc and ppc64; for some reason, the SIGALRM
# handlers are never called, and the call to write runs to completion
# (rhbz#732998)
-Patch131: python-2.7.2-disable-tests-in-test_io.patch
+Patch131: 00131-disable-tests-in-test_io.patch
# Add non-standard hooks to unittest for use in the "check" phase below, when
# running selftests within the build:
@@ -557,6 +552,11 @@ Patch141: 00141-fix-test_gc_with_COUNT_ALLOCS.patch
# Some pty tests fail when run in mock (rhbz#714627):
Patch142: 00142-skip-failing-pty-tests-in-rpmbuild.patch
+# Fix the --with-tsc option on ppc64, and rework it on 32-bit ppc to avoid
+# aliasing violations (rhbz#698726)
+# Sent upstream as
http://bugs.python.org/issue12872
+Patch143: 00143-tsc-on-ppc.patch
+
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora 17
onwards,
@@ -818,7 +818,7 @@ rm -r Modules/zlib || exit 1
%patch126 -p0 -b .fix-dbm_contains-on-64bit-bigendian
%patch127 -p0 -b .fix-test_structmember-on-64bit-bigendian
%patch128 -p1
-%patch129 -p1 -b .tsc-on-ppc
+
%patch130 -p1
%ifarch ppc ppc64
@@ -840,6 +840,7 @@ rm -r Modules/zlib || exit 1
%endif
%patch141 -p1
%patch142 -p1
+%patch143 -p1 -b .tsc-on-ppc
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -1664,6 +1665,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Mon Sep 12 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-11
+- rename and renumber patches for consistency with python3.spec (55, 111, 113,
+114, 125, 131, 129 to 143)
+
* Sat Sep 10 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-10
- rewrite of "check", introducing downstream-only hooks for skipping specific
cases in an rpmbuild (patch 132), and fixing/skipping failing tests in a more
commit bbbca2ccff122d4e4920f2db11c91f80dcb38063
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Sat Sep 10 08:24:34 2011 -0400
minor fixes to reduce python/python3 delta
Rename patch 300 to the name used in python3.spec
diff --git a/autotool-intermediates.patch b/autotool-intermediates.patch
new file mode 100644
index 0000000..68eefe9
--- /dev/null
+++ b/autotool-intermediates.patch
@@ -0,0 +1,236 @@
+diff -up ./configure.autotool-intermediates ./configure
+--- ./configure.autotool-intermediates 2011-06-13 15:27:20.710308004 -0400
++++ ./configure 2011-06-13 15:27:22.862308004 -0400
+@@ -619,6 +619,8 @@ TRUE
+ MACHDEP_OBJS
+ DYNLOADFILE
+ DLINCLDIR
++DTRACEHDRS
++DTRACEOBJS
+ THREADOBJ
+ LDLAST
+ USE_THREAD_MODULE
+@@ -639,6 +641,8 @@ OTHER_LIBTOOL_OPT
+ UNIVERSAL_ARCH_FLAGS
+ BASECFLAGS
+ OPT
++DEBUG_SUFFIX
++DEBUG_EXT
+ LN
+ INSTALL_DATA
+ INSTALL_SCRIPT
+@@ -760,8 +764,11 @@ with_pth
+ enable_ipv6
+ with_doc_strings
+ with_tsc
++with_count_allocs
++with_call_profile
+ with_pymalloc
+ with_valgrind
++with_dtrace
+ with_wctype_functions
+ with_fpectl
+ with_libm
+@@ -777,7 +784,8 @@ CFLAGS
+ LDFLAGS
+ LIBS
+ CPPFLAGS
+-CPP'
++CPP
++CPPFLAGS'
+
+
+ # Initialize some variables set by options.
+@@ -1435,8 +1443,11 @@ Optional Packages:
+ --with-pth use GNU pth threading libraries
+ --with(out)-doc-strings disable/enable documentation strings
+ --with(out)-tsc enable/disable timestamp counter profile
++ --with(out)count-allocs enable/disable per-type instance accounting
++ --with(out)-call-profile enable/disable statistics on function call invocation
+ --with(out)-pymalloc disable/enable specialized mallocs
+ --with-valgrind Enable Valgrind support
++ --with(out)-dtrace disable/enable dtrace support
+ --with-wctype-functions use wctype.h functions
+ --with-fpectl enable SIGFPE catching
+ --with-libm=STRING math library
+@@ -4754,7 +4765,7 @@ esac
+ $as_echo_n "checking LIBRARY... " >&6; }
+ if test -z "$LIBRARY"
+ then
+- LIBRARY='libpython$(VERSION).a'
++ LIBRARY='libpython$(VERSION)$(DEBUG_EXT).a'
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBRARY" >&5
+ $as_echo "$LIBRARY" >&6; }
+@@ -4928,8 +4939,8 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>
+ INSTSONAME="$LDLIBRARY".$SOVERSION
+ ;;
+ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*)
+- LDLIBRARY='libpython$(VERSION).so'
+- BLDLIBRARY='-L. -lpython$(VERSION)'
++ LDLIBRARY='libpython$(VERSION)$(DEBUG_EXT).so'
++ BLDLIBRARY='-L. -lpython$(VERSION)$(DEBUG_EXT)'
+ RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
+ case $ac_sys_system in
+ FreeBSD*)
+@@ -4952,7 +4963,7 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>
+ ;;
+ OSF*)
+ LDLIBRARY='libpython$(VERSION).so'
+- BLDLIBRARY='-rpath $(LIBDIR) -L. -lpython$(VERSION)'
++ BLDLIBRARY='-L. -lpython$(VERSION)'
+ RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
+ ;;
+ atheos*)
+@@ -5391,6 +5402,14 @@ $as_echo "no" >&6; }
+ fi
+
+
++if test "$Py_DEBUG" = 'true'
++then
++ DEBUG_EXT=_d
++ DEBUG_SUFFIX=-debug
++fi
++
++
++
+ # XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
+ # merged with this chunk of code?
+
+@@ -9403,6 +9422,50 @@ $as_echo "no" >&6; }
+ fi
+
+
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-count-allocs"
>&5
++$as_echo_n "checking for --with-count-allocs... " >&6; }
++
++# Check whether --with-count-allocs was given.
++if test "${with_count_allocs+set}" = set; then :
++ withval=$with_count_allocs;
++if test "$withval" != no
++then
++
++$as_echo "#define COUNT_ALLOCS 1" >>confdefs.h
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
++$as_echo "yes" >&6; }
++else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-call-profile"
>&5
++$as_echo_n "checking for --with-call-profile... " >&6; }
++
++# Check whether --with-call-profile was given.
++if test "${with_call_profile+set}" = set; then :
++ withval=$with_call_profile;
++if test "$withval" != no
++then
++
++$as_echo "#define CALL_PROFILE 1" >>confdefs.h
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
++$as_echo "yes" >&6; }
++else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
+ # Check for Python-specific malloc support
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-pymalloc"
>&5
+ $as_echo_n "checking for --with-pymalloc... " >&6; }
+@@ -9452,6 +9515,46 @@ fi
+
+ fi
+
++# Check for dtrace support
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-dtrace"
>&5
++$as_echo_n "checking for --with-dtrace... " >&6; }
++
++# Check whether --with-dtrace was given.
++if test "${with_dtrace+set}" = set; then :
++ withval=$with_dtrace;
++fi
++
++
++if test ! -z "$with_dtrace"
++then
++ if dtrace -G -o /dev/null -s $srcdir/Include/pydtrace.d 2>/dev/null
++ then
++
++$as_echo "#define WITH_DTRACE 1" >>confdefs.h
++
++ with_dtrace="Sun"
++ DTRACEOBJS="Python/dtrace.o"
++ DTRADEHDRS=""
++ elif dtrace -h -o /dev/null -s $srcdir/Include/pydtrace.d
++ then
++
++$as_echo "#define WITH_DTRACE 1" >>confdefs.h
++
++ with_dtrace="Apple"
++ DTRACEOBJS=""
++ DTRADEHDRS="pydtrace.h"
++ else
++ with_dtrace="no"
++ fi
++else
++ with_dtrace="no"
++fi
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_dtrace" >&5
++$as_echo "$with_dtrace" >&6; }
++
++
++
+ # Check for --with-wctype-functions
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-wctype-functions"
>&5
+ $as_echo_n "checking for --with-wctype-functions... " >&6; }
+diff -up ./pyconfig.h.in.autotool-intermediates ./pyconfig.h.in
+--- ./pyconfig.h.in.autotool-intermediates 2011-06-13 15:27:20.702308004 -0400
++++ ./pyconfig.h.in 2011-06-13 15:27:23.433308006 -0400
+@@ -18,6 +18,12 @@
+ /* Define this if you have BeOS threads. */
+ #undef BEOS_THREADS
+
++/* Define to keep records on function call invocation */
++#undef CALL_PROFILE
++
++/* Define to keep records of the number of instances of each type */
++#undef COUNT_ALLOCS
++
+ /* Define if you have the Mach cthreads package */
+ #undef C_THREADS
+
+@@ -1104,12 +1110,6 @@
+ /* Define to profile with the Pentium timestamp counter */
+ #undef WITH_TSC
+
+-/* Define to keep records of the number of instances of each type */
+-#undef COUNT_ALLOCS
+-
+-/* Define to keep records on function call invocation */
+-#undef CALL_PROFILE
+-
+ /* Define if you want pymalloc to be disabled when running under valgrind */
+ #undef WITH_VALGRIND
+
+@@ -1146,6 +1146,9 @@
+ /* This must be defined on some systems to enable large file support. */
+ #undef _LARGEFILE_SOURCE
+
++/* This must be defined on AIX systems to enable large file support. */
++#undef _LARGE_FILES
++
+ /* Define to 1 if on MINIX. */
+ #undef _MINIX
+
diff --git a/python-2.7-autotool-intermediates.patch
b/python-2.7-autotool-intermediates.patch
deleted file mode 100644
index 68eefe9..0000000
--- a/python-2.7-autotool-intermediates.patch
+++ /dev/null
@@ -1,236 +0,0 @@
-diff -up ./configure.autotool-intermediates ./configure
---- ./configure.autotool-intermediates 2011-06-13 15:27:20.710308004 -0400
-+++ ./configure 2011-06-13 15:27:22.862308004 -0400
-@@ -619,6 +619,8 @@ TRUE
- MACHDEP_OBJS
- DYNLOADFILE
- DLINCLDIR
-+DTRACEHDRS
-+DTRACEOBJS
- THREADOBJ
- LDLAST
- USE_THREAD_MODULE
-@@ -639,6 +641,8 @@ OTHER_LIBTOOL_OPT
- UNIVERSAL_ARCH_FLAGS
- BASECFLAGS
- OPT
-+DEBUG_SUFFIX
-+DEBUG_EXT
- LN
- INSTALL_DATA
- INSTALL_SCRIPT
-@@ -760,8 +764,11 @@ with_pth
- enable_ipv6
- with_doc_strings
- with_tsc
-+with_count_allocs
-+with_call_profile
- with_pymalloc
- with_valgrind
-+with_dtrace
- with_wctype_functions
- with_fpectl
- with_libm
-@@ -777,7 +784,8 @@ CFLAGS
- LDFLAGS
- LIBS
- CPPFLAGS
--CPP'
-+CPP
-+CPPFLAGS'
-
-
- # Initialize some variables set by options.
-@@ -1435,8 +1443,11 @@ Optional Packages:
- --with-pth use GNU pth threading libraries
- --with(out)-doc-strings disable/enable documentation strings
- --with(out)-tsc enable/disable timestamp counter profile
-+ --with(out)count-allocs enable/disable per-type instance accounting
-+ --with(out)-call-profile enable/disable statistics on function call invocation
- --with(out)-pymalloc disable/enable specialized mallocs
- --with-valgrind Enable Valgrind support
-+ --with(out)-dtrace disable/enable dtrace support
- --with-wctype-functions use wctype.h functions
- --with-fpectl enable SIGFPE catching
- --with-libm=STRING math library
-@@ -4754,7 +4765,7 @@ esac
- $as_echo_n "checking LIBRARY... " >&6; }
- if test -z "$LIBRARY"
- then
-- LIBRARY='libpython$(VERSION).a'
-+ LIBRARY='libpython$(VERSION)$(DEBUG_EXT).a'
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBRARY" >&5
- $as_echo "$LIBRARY" >&6; }
-@@ -4928,8 +4939,8 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>
- INSTSONAME="$LDLIBRARY".$SOVERSION
- ;;
- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*)
-- LDLIBRARY='libpython$(VERSION).so'
-- BLDLIBRARY='-L. -lpython$(VERSION)'
-+ LDLIBRARY='libpython$(VERSION)$(DEBUG_EXT).so'
-+ BLDLIBRARY='-L. -lpython$(VERSION)$(DEBUG_EXT)'
- RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
- case $ac_sys_system in
- FreeBSD*)
-@@ -4952,7 +4963,7 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>
- ;;
- OSF*)
- LDLIBRARY='libpython$(VERSION).so'
-- BLDLIBRARY='-rpath $(LIBDIR) -L. -lpython$(VERSION)'
-+ BLDLIBRARY='-L. -lpython$(VERSION)'
- RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
- ;;
- atheos*)
-@@ -5391,6 +5402,14 @@ $as_echo "no" >&6; }
- fi
-
-
-+if test "$Py_DEBUG" = 'true'
-+then
-+ DEBUG_EXT=_d
-+ DEBUG_SUFFIX=-debug
-+fi
-+
-+
-+
- # XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
- # merged with this chunk of code?
-
-@@ -9403,6 +9422,50 @@ $as_echo "no" >&6; }
- fi
-
-
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-count-allocs"
>&5
-+$as_echo_n "checking for --with-count-allocs... " >&6; }
-+
-+# Check whether --with-count-allocs was given.
-+if test "${with_count_allocs+set}" = set; then :
-+ withval=$with_count_allocs;
-+if test "$withval" != no
-+then
-+
-+$as_echo "#define COUNT_ALLOCS 1" >>confdefs.h
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-+$as_echo "yes" >&6; }
-+else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+else
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-call-profile"
>&5
-+$as_echo_n "checking for --with-call-profile... " >&6; }
-+
-+# Check whether --with-call-profile was given.
-+if test "${with_call_profile+set}" = set; then :
-+ withval=$with_call_profile;
-+if test "$withval" != no
-+then
-+
-+$as_echo "#define CALL_PROFILE 1" >>confdefs.h
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-+$as_echo "yes" >&6; }
-+else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+else
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+
- # Check for Python-specific malloc support
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-pymalloc"
>&5
- $as_echo_n "checking for --with-pymalloc... " >&6; }
-@@ -9452,6 +9515,46 @@ fi
-
- fi
-
-+# Check for dtrace support
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-dtrace"
>&5
-+$as_echo_n "checking for --with-dtrace... " >&6; }
-+
-+# Check whether --with-dtrace was given.
-+if test "${with_dtrace+set}" = set; then :
-+ withval=$with_dtrace;
-+fi
-+
-+
-+if test ! -z "$with_dtrace"
-+then
-+ if dtrace -G -o /dev/null -s $srcdir/Include/pydtrace.d 2>/dev/null
-+ then
-+
-+$as_echo "#define WITH_DTRACE 1" >>confdefs.h
-+
-+ with_dtrace="Sun"
-+ DTRACEOBJS="Python/dtrace.o"
-+ DTRADEHDRS=""
-+ elif dtrace -h -o /dev/null -s $srcdir/Include/pydtrace.d
-+ then
-+
-+$as_echo "#define WITH_DTRACE 1" >>confdefs.h
-+
-+ with_dtrace="Apple"
-+ DTRACEOBJS=""
-+ DTRADEHDRS="pydtrace.h"
-+ else
-+ with_dtrace="no"
-+ fi
-+else
-+ with_dtrace="no"
-+fi
-+
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_dtrace" >&5
-+$as_echo "$with_dtrace" >&6; }
-+
-+
-+
- # Check for --with-wctype-functions
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-wctype-functions"
>&5
- $as_echo_n "checking for --with-wctype-functions... " >&6; }
-diff -up ./pyconfig.h.in.autotool-intermediates ./pyconfig.h.in
---- ./pyconfig.h.in.autotool-intermediates 2011-06-13 15:27:20.702308004 -0400
-+++ ./pyconfig.h.in 2011-06-13 15:27:23.433308006 -0400
-@@ -18,6 +18,12 @@
- /* Define this if you have BeOS threads. */
- #undef BEOS_THREADS
-
-+/* Define to keep records on function call invocation */
-+#undef CALL_PROFILE
-+
-+/* Define to keep records of the number of instances of each type */
-+#undef COUNT_ALLOCS
-+
- /* Define if you have the Mach cthreads package */
- #undef C_THREADS
-
-@@ -1104,12 +1110,6 @@
- /* Define to profile with the Pentium timestamp counter */
- #undef WITH_TSC
-
--/* Define to keep records of the number of instances of each type */
--#undef COUNT_ALLOCS
--
--/* Define to keep records on function call invocation */
--#undef CALL_PROFILE
--
- /* Define if you want pymalloc to be disabled when running under valgrind */
- #undef WITH_VALGRIND
-
-@@ -1146,6 +1146,9 @@
- /* This must be defined on some systems to enable large file support. */
- #undef _LARGEFILE_SOURCE
-
-+/* This must be defined on AIX systems to enable large file support. */
-+#undef _LARGE_FILES
-+
- /* Define to 1 if on MINIX. */
- #undef _MINIX
-
diff --git a/python.spec b/python.spec
index 30eb36a..c2b6cb9 100644
--- a/python.spec
+++ b/python.spec
@@ -580,7 +580,7 @@ Patch142: 00142-skip-failing-pty-tests-in-rpmbuild.patch
# This is the generated patch to "configure"; see the description of
# %{regenerate_autotooling_patch}
# above:
-Patch300: python-2.7-autotool-intermediates.patch
+Patch300: autotool-intermediates.patch
# ======================================================
# Additional metadata, and subpackages
@@ -1285,7 +1285,7 @@ CheckPython() {
fi
%endif
- # Actually invoke regrtest.py, setting "WITHIN_PYTHON_RPM_BUILD" so that the
+ # Run the upstream test suite, setting "WITHIN_PYTHON_RPM_BUILD" so that the
# our non-standard decorators take effect on the relevant tests:
# @unittest._skipInRpmBuild(reason)
# @unittest._expectedFailureInRpmBuild
@@ -1645,7 +1645,6 @@ rm -fr %{buildroot}
%endif # with_debug_build
-
# We put the debug-gdb.py file inside /usr/lib/debug to avoid noise from
# ldconfig (rhbz:562980).
#
commit 866e9292651403b113045cfd33d238c57cd3201e
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Sat Sep 10 07:55:07 2011 -0400
rewrite of %check: fine-grained test exclusions
* Sat Sep 10 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-10
- rewrite of "check", introducing downstream-only hooks for skipping
specific
cases in an rpmbuild (patch 132), and fixing/skipping failing tests in a more
fine-grained manner than before (patches 104, 133-142)
diff --git a/00104-lib64-fix-for-test_install.patch
b/00104-lib64-fix-for-test_install.patch
new file mode 100644
index 0000000..7852bf6
--- /dev/null
+++ b/00104-lib64-fix-for-test_install.patch
@@ -0,0 +1,13 @@
+--- Python-2.7.2/Lib/distutils/tests/test_install.py.lib64 2011-09-08 17:51:57.851405376
-0400
++++ Python-2.7.2/Lib/distutils/tests/test_install.py 2011-09-08 18:40:46.754205096 -0400
+@@ -41,8 +41,9 @@ class InstallTestCase(support.TempdirMan
+ self.assertEqual(got, expected)
+
+ libdir = os.path.join(destination, "lib", "python")
++ platlibdir = os.path.join(destination, "lib64", "python")
+ check_path(cmd.install_lib, libdir)
+- check_path(cmd.install_platlib, libdir)
++ check_path(cmd.install_platlib, platlibdir)
+ check_path(cmd.install_purelib, libdir)
+ check_path(cmd.install_headers,
+ os.path.join(destination, "include", "python",
"foopkg"))
diff --git a/00132-add-rpmbuild-hooks-to-unittest.patch
b/00132-add-rpmbuild-hooks-to-unittest.patch
new file mode 100644
index 0000000..e63395f
--- /dev/null
+++ b/00132-add-rpmbuild-hooks-to-unittest.patch
@@ -0,0 +1,68 @@
+diff -up Python-2.7.2/Lib/unittest/case.py.add-rpmbuild-hooks-to-unittest
Python-2.7.2/Lib/unittest/case.py
+--- Python-2.7.2/Lib/unittest/case.py.add-rpmbuild-hooks-to-unittest 2011-09-08
14:45:47.677169191 -0400
++++ Python-2.7.2/Lib/unittest/case.py 2011-09-08 16:01:36.287858159 -0400
+@@ -1,6 +1,7 @@
+ """Test case implementation"""
+
+ import collections
++import os
+ import sys
+ import functools
+ import difflib
+@@ -94,6 +95,43 @@ def expectedFailure(func):
+ return wrapper
+
+
++# Non-standard/downstream-only hooks for handling issues with specific test
++# cases:
++
++def _skipInRpmBuild(reason):
++ """
++ Non-standard/downstream-only decorator for marking a specific unit test
++ to be skipped when run within the %check of an rpmbuild.
++
++ Specifically, this takes effect when WITHIN_PYTHON_RPM_BUILD is set within
++ the environment, and has no effect otherwise.
++ """
++ if 'WITHIN_PYTHON_RPM_BUILD' in os.environ:
++ return skip(reason)
++ else:
++ return _id
++
++def _expectedFailureInRpmBuild(func):
++ """
++ Non-standard/downstream-only decorator for marking a specific unit test
++ as expected to fail within the %check of an rpmbuild.
++
++ Specifically, this takes effect when WITHIN_PYTHON_RPM_BUILD is set within
++ the environment, and has no effect otherwise.
++ """
++ @functools.wraps(func)
++ def wrapper(*args, **kwargs):
++ if 'WITHIN_PYTHON_RPM_BUILD' in os.environ:
++ try:
++ func(*args, **kwargs)
++ except Exception:
++ raise _ExpectedFailure(sys.exc_info())
++ raise _UnexpectedSuccess
++ else:
++ # Call directly:
++ func(*args, **kwargs)
++ return wrapper
++
+ class _AssertRaisesContext(object):
+ """A context manager used to implement TestCase.assertRaises*
methods."""
+
+diff -up Python-2.7.2/Lib/unittest/__init__.py.add-rpmbuild-hooks-to-unittest
Python-2.7.2/Lib/unittest/__init__.py
+--- Python-2.7.2/Lib/unittest/__init__.py.add-rpmbuild-hooks-to-unittest 2011-09-08
14:59:39.534112310 -0400
++++ Python-2.7.2/Lib/unittest/__init__.py 2011-09-08 15:07:09.191081562 -0400
+@@ -57,7 +57,8 @@ __unittest = True
+
+ from .result import TestResult
+ from .case import (TestCase, FunctionTestCase, SkipTest, skip, skipIf,
+- skipUnless, expectedFailure)
++ skipUnless, expectedFailure,
++ _skipInRpmBuild, _expectedFailureInRpmBuild)
+ from .suite import BaseTestSuite, TestSuite
+ from .loader import (TestLoader, defaultTestLoader, makeSuite, getTestCaseNames,
+ findTestCases)
diff --git a/00133-skip-test_dl.patch b/00133-skip-test_dl.patch
new file mode 100644
index 0000000..04ad05b
--- /dev/null
+++ b/00133-skip-test_dl.patch
@@ -0,0 +1,13 @@
+diff -up Python-2.7.2/Lib/test/test_dl.py.skip-test_dl Python-2.7.2/Lib/test/test_dl.py
+--- Python-2.7.2/Lib/test/test_dl.py.skip-test_dl 2011-09-08 15:18:40.529034289 -0400
++++ Python-2.7.2/Lib/test/test_dl.py 2011-09-08 16:29:45.184742670 -0400
+@@ -13,6 +13,9 @@ sharedlibs = [
+ ('/usr/lib/libc.dylib', 'getpid'),
+ ]
+
++# (also, "dl" is deprecated in favor of ctypes)
++(a)unittest._skipInRpmBuild('fails on 64-bit builds: '
++ 'module dl requires sizeof(int) == sizeof(long) == sizeof(char*)')
+ def test_main():
+ for s, func in sharedlibs:
+ try:
diff --git a/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch
b/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch
new file mode 100644
index 0000000..362145e
--- /dev/null
+++ b/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch
@@ -0,0 +1,14 @@
+--- Python-2.7.2/Lib/test/test_sys.py.mark-tests-that-fail-in-rpmbuild 2011-09-08
18:02:31.627362039 -0400
++++ Python-2.7.2/Lib/test/test_sys.py 2011-09-08 18:15:29.450308851 -0400
+@@ -734,6 +734,11 @@ class SizeofTest(unittest.TestCase):
+ # (PyTypeObject + PyNumberMethods + PyMappingMethods +
+ # PySequenceMethods + PyBufferProcs)
+ s = size(vh + 'P2P15Pl4PP9PP11PI') + size('41P 10P 3P 6P')
++
++ # COUNT_ALLOCS adds further fields to the end of a PyTypeObject:
++ if hasattr(sys, 'getcounts'):
++ s += size('5P')
++
+ class newstyleclass(object):
+ pass
+ check(newstyleclass, s)
diff --git a/00135-skip-test-within-test_weakref-in-debug-build.patch
b/00135-skip-test-within-test_weakref-in-debug-build.patch
new file mode 100644
index 0000000..e464aa9
--- /dev/null
+++ b/00135-skip-test-within-test_weakref-in-debug-build.patch
@@ -0,0 +1,18 @@
+diff -up
Python-2.7.2/Lib/test/test_weakref.py.skip-test-within-test_weakref-in-debug-build
Python-2.7.2/Lib/test/test_weakref.py
+---
Python-2.7.2/Lib/test/test_weakref.py.skip-test-within-test_weakref-in-debug-build 2011-09-08
17:55:09.675392260 -0400
++++ Python-2.7.2/Lib/test/test_weakref.py 2011-09-08 17:59:08.857375903 -0400
+@@ -550,6 +550,14 @@ class ReferencesTestCase(TestBase):
+ del c1, c2, C, D
+ gc.collect()
+
++ # In a debug build, this fails with:
++ # AssertionError: Lists differ: [] != ['C went away']
++ # Second list contains 1 additional elements.
++ # First extra element 0:
++ # C went away
++ # - []
++ # + ['C went away']
++ @unittest.skipIf(hasattr(sys, 'getobjects'), 'debug build')
+ def test_callback_in_cycle_resurrection(self):
+ import gc
+
diff --git a/00136-skip-tests-of-seeking-stdin-in-rpmbuild.patch
b/00136-skip-tests-of-seeking-stdin-in-rpmbuild.patch
new file mode 100644
index 0000000..845fb2a
--- /dev/null
+++ b/00136-skip-tests-of-seeking-stdin-in-rpmbuild.patch
@@ -0,0 +1,22 @@
+diff -up Python-2.7.2/Lib/test/test_file2k.py.skip-tests-of-seeking-stdin-in-rpmbuild
Python-2.7.2/Lib/test/test_file2k.py
+---
Python-2.7.2/Lib/test/test_file2k.py.skip-tests-of-seeking-stdin-in-rpmbuild 2011-09-08
17:23:50.922520729 -0400
++++ Python-2.7.2/Lib/test/test_file2k.py 2011-09-08 17:24:41.368517277 -0400
+@@ -213,6 +213,7 @@ class OtherFileTests(unittest.TestCase):
+ else:
+ f.close()
+
++ @unittest._skipInRpmBuild('seems not to raise the exception when run in
Koji')
+ def testStdin(self):
+ # This causes the interpreter to exit on OSF1 v5.1.
+ if sys.platform != 'osf1V5':
+diff -up Python-2.7.2/Lib/test/test_file.py.skip-tests-of-seeking-stdin-in-rpmbuild
Python-2.7.2/Lib/test/test_file.py
+--- Python-2.7.2/Lib/test/test_file.py.skip-tests-of-seeking-stdin-in-rpmbuild 2011-09-08
17:20:31.146534389 -0400
++++ Python-2.7.2/Lib/test/test_file.py 2011-09-08 17:24:45.016517030 -0400
+@@ -154,6 +154,7 @@ class OtherFileTests(unittest.TestCase):
+ f.close()
+ self.fail('%r is an invalid file mode' % mode)
+
++ @unittest._skipInRpmBuild('seems not to raise the exception when run in
Koji')
+ def testStdin(self):
+ # This causes the interpreter to exit on OSF1 v5.1.
+ if sys.platform != 'osf1V5':
diff --git a/00137-skip-distutils-tests-that-fail-in-rpmbuild.patch
b/00137-skip-distutils-tests-that-fail-in-rpmbuild.patch
new file mode 100644
index 0000000..b1a55cd
--- /dev/null
+++ b/00137-skip-distutils-tests-that-fail-in-rpmbuild.patch
@@ -0,0 +1,22 @@
+diff -up
Python-2.7.2/Lib/distutils/tests/test_bdist_rpm.py.mark-tests-that-fail-in-rpmbuild
Python-2.7.2/Lib/distutils/tests/test_bdist_rpm.py
+---
Python-2.7.2/Lib/distutils/tests/test_bdist_rpm.py.mark-tests-that-fail-in-rpmbuild 2011-09-08
17:28:19.170502386 -0400
++++ Python-2.7.2/Lib/distutils/tests/test_bdist_rpm.py 2011-09-08 17:48:40.608418864
-0400
+@@ -24,6 +24,7 @@ setup(name='foo', version='0.1', py_modu
+
+ """
+
++(a)unittest._skipInRpmBuild("don't try to nest one rpm build inside another rpm
build")
+ class BuildRpmTestCase(support.TempdirManager,
+ support.LoggingSilencer,
+ unittest.TestCase):
+diff -up
Python-2.7.2/Lib/distutils/tests/test_build_ext.py.mark-tests-that-fail-in-rpmbuild
Python-2.7.2/Lib/distutils/tests/test_build_ext.py
+---
Python-2.7.2/Lib/distutils/tests/test_build_ext.py.mark-tests-that-fail-in-rpmbuild 2011-09-08
16:07:25.033834312 -0400
++++ Python-2.7.2/Lib/distutils/tests/test_build_ext.py 2011-09-08 17:43:15.656441082
-0400
+@@ -69,6 +69,7 @@ class BuildExtTestCase(support.TempdirMa
+ name, equals, value = runshared.partition('=')
+ cmd.library_dirs = value.split(os.pathsep)
+
++ @unittest._skipInRpmBuild('fails when run from build dir with /usr/bin/ld:
cannot find -lpython2.7')
+ @unittest.skipIf(not os.path.exists(_XX_MODULE_PATH),
+ 'xxmodule.c not found')
+ def test_build_ext(self):
diff --git a/00138-fix-distutils-tests-in-debug-build.patch
b/00138-fix-distutils-tests-in-debug-build.patch
new file mode 100644
index 0000000..0bfda90
--- /dev/null
+++ b/00138-fix-distutils-tests-in-debug-build.patch
@@ -0,0 +1,68 @@
+diff -up
Python-2.7.2/Lib/distutils/tests/test_build_ext.py.mark-tests-that-fail-in-rpmbuild
Python-2.7.2/Lib/distutils/tests/test_build_ext.py
+---
Python-2.7.2/Lib/distutils/tests/test_build_ext.py.mark-tests-that-fail-in-rpmbuild 2011-09-08
16:07:25.033834312 -0400
++++ Python-2.7.2/Lib/distutils/tests/test_build_ext.py 2011-09-08 17:43:15.656441082
-0400
+@@ -330,6 +332,7 @@ class BuildExtTestCase(support.TempdirMa
+ self.assertEqual(lastdir, 'bar')
+
+ def test_ext_fullpath(self):
++ debug_ext = sysconfig.get_config_var("DEBUG_EXT")
+ ext = sysconfig.get_config_vars()['SO']
+ dist = Distribution()
+ cmd = build_ext(dist)
+@@ -337,14 +340,14 @@ class BuildExtTestCase(support.TempdirMa
+ cmd.distribution.package_dir = {'': 'src'}
+ cmd.distribution.packages = ['lxml', 'lxml.html']
+ curdir = os.getcwd()
+- wanted = os.path.join(curdir, 'src', 'lxml', 'etree' +
ext)
++ wanted = os.path.join(curdir, 'src', 'lxml', 'etree' +
debug_ext + ext)
+ path = cmd.get_ext_fullpath('lxml.etree')
+ self.assertEqual(wanted, path)
+
+ # building lxml.etree not inplace
+ cmd.inplace = 0
+ cmd.build_lib = os.path.join(curdir, 'tmpdir')
+- wanted = os.path.join(curdir, 'tmpdir', 'lxml', 'etree'
+ ext)
++ wanted = os.path.join(curdir, 'tmpdir', 'lxml', 'etree'
+ debug_ext + ext)
+ path = cmd.get_ext_fullpath('lxml.etree')
+ self.assertEqual(wanted, path)
+
+@@ -354,13 +357,13 @@ class BuildExtTestCase(support.TempdirMa
+ cmd.distribution.packages = ['twisted',
'twisted.runner.portmap']
+ path = cmd.get_ext_fullpath('twisted.runner.portmap')
+ wanted = os.path.join(curdir, 'tmpdir', 'twisted',
'runner',
+- 'portmap' + ext)
++ 'portmap' + debug_ext + ext)
+ self.assertEqual(wanted, path)
+
+ # building twisted.runner.portmap inplace
+ cmd.inplace = 1
+ path = cmd.get_ext_fullpath('twisted.runner.portmap')
+- wanted = os.path.join(curdir, 'twisted', 'runner',
'portmap' + ext)
++ wanted = os.path.join(curdir, 'twisted', 'runner',
'portmap' + debug_ext + ext)
+ self.assertEqual(wanted, path)
+
+ def test_build_ext_inplace(self):
+@@ -373,8 +376,9 @@ class BuildExtTestCase(support.TempdirMa
+ cmd.distribution.package_dir = {'': 'src'}
+ cmd.distribution.packages = ['lxml', 'lxml.html']
+ curdir = os.getcwd()
++ debug_ext = sysconfig.get_config_var("DEBUG_EXT")
+ ext = sysconfig.get_config_var("SO")
+- wanted = os.path.join(curdir, 'src', 'lxml', 'etree' +
ext)
++ wanted = os.path.join(curdir, 'src', 'lxml', 'etree' +
debug_ext + ext)
+ path = cmd.get_ext_fullpath('lxml.etree')
+ self.assertEqual(wanted, path)
+
+@@ -412,10 +416,11 @@ class BuildExtTestCase(support.TempdirMa
+ dist = Distribution({'name': 'UpdateManager'})
+ cmd = build_ext(dist)
+ cmd.ensure_finalized()
++ debug_ext = sysconfig.get_config_var("DEBUG_EXT")
+ ext = sysconfig.get_config_var("SO")
+ ext_name = os.path.join('UpdateManager', 'fdsend')
+ ext_path = cmd.get_ext_fullpath(ext_name)
+- wanted = os.path.join(cmd.build_lib, 'UpdateManager', 'fdsend' +
ext)
++ wanted = os.path.join(cmd.build_lib, 'UpdateManager', 'fdsend' +
debug_ext + ext)
+ self.assertEqual(ext_path, wanted)
+
+ def test_build_ext_path_cross_platform(self):
diff --git a/00139-skip-test_float-known-failure-on-arm.patch
b/00139-skip-test_float-known-failure-on-arm.patch
new file mode 100644
index 0000000..9d0bfad
--- /dev/null
+++ b/00139-skip-test_float-known-failure-on-arm.patch
@@ -0,0 +1,11 @@
+diff -up Python-2.7.2/Lib/test/test_float.py.skip-test_float-known-failure-on-arm
Python-2.7.2/Lib/test/test_float.py
+--- Python-2.7.2/Lib/test/test_float.py.skip-test_float-known-failure-on-arm 2011-09-08
19:34:09.000986128 -0400
++++ Python-2.7.2/Lib/test/test_float.py 2011-09-08 19:34:57.969982779 -0400
+@@ -1072,6 +1072,7 @@ class HexFloatTestCase(unittest.TestCase
+ self.identical(got, expected)
+
+
++ @unittest.skip('Known failure on ARM:
http://bugs.python.org/issue8265')
+ def test_from_hex(self):
+ MIN = self.MIN;
+ MAX = self.MAX;
diff --git a/00140-skip-test_ctypes-known-failure-on-sparc.patch
b/00140-skip-test_ctypes-known-failure-on-sparc.patch
new file mode 100644
index 0000000..95aa41e
--- /dev/null
+++ b/00140-skip-test_ctypes-known-failure-on-sparc.patch
@@ -0,0 +1,11 @@
+diff -up
Python-2.7.2/Lib/ctypes/test/test_callbacks.py.skip-test_ctypes-known-failure-on-sparc
Python-2.7.2/Lib/ctypes/test/test_callbacks.py
+---
Python-2.7.2/Lib/ctypes/test/test_callbacks.py.skip-test_ctypes-known-failure-on-sparc 2011-09-08
19:42:35.541951490 -0400
++++ Python-2.7.2/Lib/ctypes/test/test_callbacks.py 2011-09-08 19:43:40.676947036 -0400
+@@ -67,6 +67,7 @@ class Callbacks(unittest.TestCase):
+ self.check_type(c_longlong, 42)
+ self.check_type(c_longlong, -42)
+
++ @unittest.skip('Known failure on Sparc:
http://bugs.python.org/issue8314')
+ def test_ulonglong(self):
+ # test some 64-bit values, with and without msb set.
+ self.check_type(c_ulonglong, 10955412242170339782)
diff --git a/00141-fix-test_gc_with_COUNT_ALLOCS.patch
b/00141-fix-test_gc_with_COUNT_ALLOCS.patch
new file mode 100644
index 0000000..d5bf3c9
--- /dev/null
+++ b/00141-fix-test_gc_with_COUNT_ALLOCS.patch
@@ -0,0 +1,24 @@
+diff -up Python-2.7.2/Lib/test/test_gc.py.fix-test_gc_with_COUNT_ALLOCS
Python-2.7.2/Lib/test/test_gc.py
+--- Python-2.7.2/Lib/test/test_gc.py.fix-test_gc_with_COUNT_ALLOCS 2011-09-08
19:49:13.045924309 -0400
++++ Python-2.7.2/Lib/test/test_gc.py 2011-09-08 19:50:07.035920617 -0400
+@@ -102,11 +102,17 @@ class GCTests(unittest.TestCase):
+ del a
+ self.assertNotEqual(gc.collect(), 0)
+ del B, C
+- self.assertNotEqual(gc.collect(), 0)
++ if hasattr(sys, 'getcounts'):
++ self.assertEqual(gc.collect(), 0)
++ else:
++ self.assertNotEqual(gc.collect(), 0)
+ A.a = A()
+ del A
+- self.assertNotEqual(gc.collect(), 0)
+- self.assertEqual(gc.collect(), 0)
++ if hasattr(sys, 'getcounts'):
++ self.assertEqual(gc.collect(), 0)
++ else:
++ self.assertNotEqual(gc.collect(), 0)
++ self.assertEqual(gc.collect(), 0)
+
+ def test_method(self):
+ # Tricky: self.__init__ is a bound method, it references the instance.
diff --git a/00142-skip-failing-pty-tests-in-rpmbuild.patch
b/00142-skip-failing-pty-tests-in-rpmbuild.patch
new file mode 100644
index 0000000..414ffcd
--- /dev/null
+++ b/00142-skip-failing-pty-tests-in-rpmbuild.patch
@@ -0,0 +1,22 @@
+diff -up Python-2.7.2/Lib/test/test_openpty.py.skip-failing-pty-tests-in-rpmbuild
Python-2.7.2/Lib/test/test_openpty.py
+--- Python-2.7.2/Lib/test/test_openpty.py.skip-failing-pty-tests-in-rpmbuild 2011-09-09
05:09:28.698920379 -0400
++++ Python-2.7.2/Lib/test/test_openpty.py 2011-09-09 05:10:54.805914490 -0400
+@@ -8,6 +8,7 @@ if not hasattr(os, "openpty"):
+
+
+ class OpenptyTest(unittest.TestCase):
++ @unittest._skipInRpmBuild('sometimes fails in Koji, possibly due to a mock issue
(rhbz#714627)')
+ def test(self):
+ master, slave = os.openpty()
+ if not os.isatty(slave):
+diff -up Python-2.7.2/Lib/test/test_pty.py.skip-failing-pty-tests-in-rpmbuild
Python-2.7.2/Lib/test/test_pty.py
+--- Python-2.7.2/Lib/test/test_pty.py.skip-failing-pty-tests-in-rpmbuild 2011-09-09
05:09:36.781919825 -0400
++++ Python-2.7.2/Lib/test/test_pty.py 2011-09-09 05:11:14.741913127 -0400
+@@ -109,6 +109,7 @@ class PtyTest(unittest.TestCase):
+ os.close(master_fd)
+
+
++ @unittest._skipInRpmBuild('sometimes fails in Koji, possibly due to a mock issue
(rhbz#714627)')
+ def test_fork(self):
+ debug("calling pty.fork()")
+ pid, master_fd = pty.fork()
diff --git a/python.spec b/python.spec
index fbc987e..30eb36a 100644
--- a/python.spec
+++ b/python.spec
@@ -102,7 +102,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.2
-Release: 9%{?dist}
+Release: 10%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -358,6 +358,10 @@ Patch102: python-2.7.1-lib64.patch
# and platform-specific code go to /usr/lib64 not /usr/lib, on 64-bit archs:
Patch103: python-2.7-lib64-sysconfig.patch
+# Only used when "%{_lib}" == "lib64"
+# Another lib64 fix, for distutils/tests/test_install.py; not upstream:
+Patch104: 00104-lib64-fix-for-test_install.patch
+
# Patch the Makefile.pre.in so that the generated Makefile doesn't try to build
# a libpythonMAJOR.MINOR.a (bug 550692):
Patch111: python-2.7rc1-no-static-lib.patch
@@ -504,6 +508,75 @@ Patch130: python-2.7.2-add-extension-suffix-to-python-config.patch
# (rhbz#732998)
Patch131: python-2.7.2-disable-tests-in-test_io.patch
+# Add non-standard hooks to unittest for use in the "check" phase below, when
+# running selftests within the build:
+# @unittest._skipInRpmBuild(reason)
+# for tests that hang or fail intermittently within the build environment, and:
+# @unittest._expectedFailureInRpmBuild
+# for tests that always fail within the build environment
+#
+# The hooks only take effect if WITHIN_PYTHON_RPM_BUILD is set in the
+# environment, which we set manually in the appropriate portion of the "check"
+# phase below (and which potentially other python-* rpms could set, to reuse
+# these unittest hooks in their own "check" phases)
+Patch132: 00132-add-rpmbuild-hooks-to-unittest.patch
+
+# "dl" is deprecated, and test_dl doesn't work on 64-bit builds:
+Patch133: 00133-skip-test_dl.patch
+
+# Fix a failure in test_sys.py when configured with COUNT_ALLOCS enabled
+# Not yet sent upstream
+Patch134: 00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch
+
+# Skip "test_callback_in_cycle_resurrection" in a debug build, where it fails:
+# Not yet sent upstream
+Patch135: 00135-skip-test-within-test_weakref-in-debug-build.patch
+
+# Some tests try to seek on sys.stdin, but don't work as expected when run
+# within Koji/mock; skip them within the rpm build:
+Patch136: 00136-skip-tests-of-seeking-stdin-in-rpmbuild.patch
+
+# Some tests within distutils fail when run in an rpmbuild:
+Patch137: 00137-skip-distutils-tests-that-fail-in-rpmbuild.patch
+
+# Fixup some tests within distutils to work with how debug builds are set up:
+Patch138: 00138-fix-distutils-tests-in-debug-build.patch
+
+# ARM-specific: skip known failure in test_float:
+#
http://bugs.python.org/issue8265 (rhbz#706253)
+Patch139: 00139-skip-test_float-known-failure-on-arm.patch
+
+# Sparc-specific: skip known failure in test_ctypes:
+#
http://bugs.python.org/issue8314 (rhbz#711584)
+# which appears to be a libffi bug
+Patch140: 00140-skip-test_ctypes-known-failure-on-sparc.patch
+
+# Fix test_gc's test_newinstance case when configured with COUNT_ALLOCS:
+Patch141: 00141-fix-test_gc_with_COUNT_ALLOCS.patch
+
+# Some pty tests fail when run in mock (rhbz#714627):
+Patch142: 00142-skip-failing-pty-tests-in-rpmbuild.patch
+
+# (New patches go here ^^^)
+#
+# When adding new patches to "python" and "python3" in Fedora 17
onwards,
+# please try to keep the patch numbers in-sync between the two specfiles:
+#
+# - use the same patch number across both specfiles for conceptually-equivalent
+# fixes, ideally with the same name
+#
+# - when a patch is relevan to both specfiles, use the same introductory
+# comment in both specfiles where possible (to improve "diff" output when
+# comparing them)
+#
+# - when a patch is only relevant for one of the two specfiles, leave a gap
+# in the patch numbering in the other specfile, adding a comment when
+# omitting a patch, both in the manifest section here, and in the "prep"
+# phase below
+#
+# Hopefully this will make it easier to ensure that all relevant fixes are
+# applied to both versions.
+
# This is the generated patch to "configure"; see the description of
# %{regenerate_autotooling_patch}
# above:
@@ -715,6 +788,7 @@ rm -r Modules/zlib || exit 1
%if "%{_lib}" == "lib64"
%patch102 -p1 -b .lib64
%patch103 -p1 -b .lib64-sysconfig
+%patch104 -p1
%endif
%patch10 -p1 -b .binutils-no-dep
@@ -751,6 +825,22 @@ rm -r Modules/zlib || exit 1
%patch131 -p1
%endif
+%patch132 -p1
+%patch133 -p1
+%patch134 -p1
+%patch135 -p1
+%patch136 -p1
+%patch137 -p1
+%patch138 -p1
+%ifarch %{arm}
+%patch139 -p1
+%endif
+%ifarch %{sparc}
+%patch140 -p1
+%endif
+%patch141 -p1
+%patch142 -p1
+
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -1180,240 +1270,6 @@ CheckPython() {
echo STARTING: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName
- # Notes about disabled tests:
- #
- # test_argparse:
- # fails when in a full build, but works when run standalone; seems to be
- #
http://bugs.python.org/issue9553 (needs COLUMNS=80 in the environment)
- #
- # test_distutils:
- # fails with
- # /usr/bin/ld: cannot find -lpython2.7
- # in: test_build_ext (distutils.tests.test_build_ext.BuildExtTestCase)
- # test_get_outputs (distutils.tests.test_build_ext.BuildExtTestCase)
- #
- # test_dl:
- # fails with:
- # <type 'exceptions.SystemError'>: module dl requires sizeof(int) ==
- # sizeof(long) == sizeof(char*)
- # on 64-bit builds, and the module is deprecated in favour of ctypes
- #
- # test_gdb:
- # very dependent on GCC version
- #
- # test_http*
- # I've seen occasional hangs in some http tests when running the test suite
- # inside Koji on Python 3. For that reason I exclude them
- #
- # test_socket.py:
- # Can fail on Koji build with:
- # gaierror: [Errno -3] Temporary failure in name resolution
- #
- # test_urllib2
- # Can fail on Koji build with:
- # gaierror: [Errno -3] Temporary failure in name resolution
- #
- #
- ###########################################################################
- # TO BE INVESTIGATED:
- ###########################################################################
- #
- # test_file:
- # Fails in Koji with:
- # ======================================================================
- # FAIL: testStdin (test.test_file.COtherFileTests)
- # ----------------------------------------------------------------------
- # Traceback (most recent call last):
- # File "/builddir/build/BUILD/Python-2.7/Lib/test/test_file.py", line 160,
in testStdin
- # self.assertRaises((IOError, ValueError), sys.stdin.seek, -1)
- # AssertionError: (<type 'exceptions.IOError'>, <type
'exceptions.ValueError'>) not raised
- # ======================================================================
- # FAIL: testStdin (test.test_file.PyOtherFileTests)
- # ----------------------------------------------------------------------
- # Traceback (most recent call last):
- # File "/builddir/build/BUILD/Python-2.7/Lib/test/test_file.py", line 160,
in testStdin
- # self.assertRaises((IOError, ValueError), sys.stdin.seek, -1)
- # AssertionError: (<type 'exceptions.IOError'>, <type
'exceptions.ValueError'>) not raised
- # ----------------------------------------------------------------------
- #
- # test_file2k:
- # Fails in Koji on with:
- # ======================================================================
- # FAIL: testStdin (test.test_file2k.OtherFileTests)
- # ----------------------------------------------------------------------
- # Traceback (most recent call last):
- # File "/builddir/build/BUILD/Python-2.7/Lib/test/test_file2k.py", line
211, in testStdin
- # self.assertRaises(IOError, sys.stdin.seek, -1)
- # AssertionError: IOError not raised
- # ----------------------------------------------------------------------
- #
- # test_openpty:
- # Fails in Koji, possibly due to a mock issue (rhbz#714627)
- # ======================================================================
- # ERROR: test (test.test_openpty.OpenptyTest)
- # ----------------------------------------------------------------------
- # Traceback (most recent call last):
- # File "/builddir/build/BUILD/Python-2.7.2/Lib/test/test_openpty.py", line
12, in test
- # master, slave = os.openpty()
- # OSError: [Errno 2] No such file or directory
- # ----------------------------------------------------------------------
- #
- # test_pty:
- # Fails in Koji, possibly due to a mock issue (rhbz#714627)
- # ======================================================================
- # ERROR: test_fork (test.test_pty.PtyTest)
- # ----------------------------------------------------------------------
- # Traceback (most recent call last):
- # File "/builddir/build/BUILD/Python-2.7.2/Lib/test/test_pty.py", line
114, in test_fork
- # pid, master_fd = pty.fork()
- # File "/builddir/build/BUILD/Python-2.7.2/Lib/pty.py", line 107, in fork
- # master_fd, slave_fd = openpty()
- # File "/builddir/build/BUILD/Python-2.7.2/Lib/pty.py", line 29, in
openpty
- # master_fd, slave_name = _open_terminal()
- # File "/builddir/build/BUILD/Python-2.7.2/Lib/pty.py", line 70, in
_open_terminal
- # raise os.error, 'out of pty devices'
- # OSError: out of pty devices
- # ----------------------------------------------------------------------
- #
- # test_subprocess:
- # Fails in Koji with:
- # ======================================================================
- # ERROR: test_leaking_fds_on_error (test.test_subprocess.ProcessTestCase)
- # ----------------------------------------------------------------------
- # Traceback (most recent call last):
- # File "/builddir/build/BUILD/Python-2.7/Lib/test/test_subprocess.py",
line 534, in test_leaking_fds_on_error
- # raise c.exception
- # OSError: [Errno 13] Permission denied
- # ======================================================================
- # ERROR: test_leaking_fds_on_error (test.test_subprocess.ProcessTestCaseNoPoll)
- # ----------------------------------------------------------------------
- # Traceback (most recent call last):
- # File "/builddir/build/BUILD/Python-2.7/Lib/test/test_subprocess.py",
line 534, in test_leaking_fds_on_error
- # raise c.exception
- # OSError: [Errno 13] Permission denied
- # ----------------------------------------------------------------------
- #
- EXCLUDED_TESTS="test_argparse \
- test_distutils \
- test_dl \
- test_gdb \
- test_http_cookies \
- test_httplib \
- test_socket \
- test_urllib2 \
- test_file \
- test_file2k \
- test_openpty \
- test_pty \
- test_subprocess \
- %{nil}"
-
- #
- # Additional architecture-specific test exclusions:
- #
-
- # ARM-specific test exclusions (see rhbz#706253):
- # test_float:
- # This is upstream bug:
http://bugs.python.org/issue8265
- # ======================================================================
- # FAIL: test_from_hex (test.test_float.HexFloatTestCase)
- # ----------------------------------------------------------------------
- # Traceback (most recent call last):
- # File "/builddir/build/BUILD/Python-2.7/Lib/test/test_float.py", line
1204, in test_from_hex
- # self.identical(fromHex('0x0.ffffffffffffd6p-1022'), MIN-3*TINY)
- # File "/builddir/build/BUILD/Python-2.7/Lib/test/test_float.py", line
914, in identical
- # self.fail('%r not identical to %r' % (x, y))
- # AssertionError: 2.2250738585072e-308 not identical to 2.2250738585071984e-308
- # ----------------------------------------------------------------------
-%ifarch %{arm}
- EXCLUDED_TESTS="$EXCLUDED_TESTS \
- test_float \
- %{nil}"
-%endif
-
-
- # Sparc-specific test exclusions (see rhbz#711584):
- # test_ctypes:
- # This is upstream bug:
http://bugs.python.org/issue8314
- # which appears to be a libffi bug
- # ======================================================================
- # FAIL: test_ulonglong (ctypes.test.test_callbacks.Callbacks)
- # ----------------------------------------------------------------------
- # Traceback (most recent call last):
- # File
"/builddir/build/BUILD/Python-2.7.1/Lib/ctypes/test/test_callbacks.py",
- # line 72, in test_ulonglong
- # self.check_type(c_ulonglong, 10955412242170339782)
- # File
"/builddir/build/BUILD/Python-2.7.1/Lib/ctypes/test/test_callbacks.py",
- # line 31, in check_type
- # self.assertEqual(result, arg)
- # AssertionError: 10955412241121898851L != 10955412242170339782L
- # ----------------------------------------------------------------------
-%ifarch %{sparc}
- EXCLUDED_TESTS="$EXCLUDED_TESTS \
- test_ctypes \
- %{nil}"
-%endif
-
- # Debug build shows some additional failures (to be investigated):
- #
- # test_gc:
- # ======================================================================
- # FAIL: test_newinstance (__main__.GCTests)
- # ----------------------------------------------------------------------
- # Traceback (most recent call last):
- # File "Lib/test/test_gc.py", line 105, in test_newinstance
- # self.assertNotEqual(gc.collect(), 0)
- # AssertionError: 0 == 0
- #
- # ----------------------------------------------------------------------
- #
- # test_sys:
- # ======================================================================
- # FAIL: test_objecttypes (__main__.SizeofTest)
- # ----------------------------------------------------------------------
- # Traceback (most recent call last):
- # File "Lib/test/test_sys.py", line 739, in test_objecttypes
- # check(newstyleclass, s)
- # File "Lib/test/test_sys.py", line 510, in check_sizeof
- # self.assertEqual(result, size, msg)
- # AssertionError: wrong size for <type 'type'>: got 960, expected 920
- #
- # ----------------------------------------------------------------------
- # which is this code:
- # # type
- # # (PyTypeObject + PyNumberMethods + PyMappingMethods +
- # # PySequenceMethods + PyBufferProcs)
- # s = size(vh + 'P2P15Pl4PP9PP11PI') + size('41P 10P 3P 6P')
- # class newstyleclass(object):
- # pass
- # check(newstyleclass, s)
- #
- # test_weakref:
- # ======================================================================
- # FAIL: test_callback_in_cycle_resurrection (__main__.ReferencesTestCase)
- # ----------------------------------------------------------------------
- # Traceback (most recent call last):
- # File "Lib/test/test_weakref.py", line 591, in
test_callback_in_cycle_resurrection
- # self.assertEqual(alist, ["C went away"])
- # AssertionError: Lists differ: [] != ['C went away']
- #
- # Second list contains 1 additional elements.
- # First extra element 0:
- # C went away
- #
- # - []
- # + ['C went away']
- #
- # ----------------------------------------------------------------------
- #
- if [ "$ConfName" = "debug" ] ; then
- EXCLUDED_TESTS="$EXCLUDED_TESTS \
- test_gc \
- test_sys \
- test_weakref \
- %{nil}"
- fi
-
# Note that we're running the tests using the version of the code in the
# builddir, not in the buildroot.
@@ -1429,8 +1285,11 @@ CheckPython() {
fi
%endif
- # Actually invoke regrtest.py:
- EXTRATESTOPTS="$EXTRATESTOPTS -x $EXCLUDED_TESTS" make test
+ # Actually invoke regrtest.py, setting "WITHIN_PYTHON_RPM_BUILD" so that the
+ # our non-standard decorators take effect on the relevant tests:
+ # @unittest._skipInRpmBuild(reason)
+ # @unittest._expectedFailureInRpmBuild
+ WITHIN_PYTHON_RPM_BUILD= EXTRATESTOPTS="$EXTRATESTOPTS" make test
popd
@@ -1806,6 +1665,11 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Sat Sep 10 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-10
+- rewrite of "check", introducing downstream-only hooks for skipping specific
+cases in an rpmbuild (patch 132), and fixing/skipping failing tests in a more
+fine-grained manner than before (patches 104, 133-142)
+
* Thu Sep 1 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-9
- run selftests with "--verbose"
- disable parts of test_io on ppc (rhbz#732998)
commit e252525e39cf5e0755986490d367ddcf79430875
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Thu Sep 1 16:46:48 2011 -0400
run selftests with "--verbose"; disable parts of test_io on ppc
(rhbz#732998)
diff --git a/python-2.7.2-disable-tests-in-test_io.patch
b/python-2.7.2-disable-tests-in-test_io.patch
new file mode 100644
index 0000000..d81a2d0
--- /dev/null
+++ b/python-2.7.2-disable-tests-in-test_io.patch
@@ -0,0 +1,11 @@
+diff -up Python-2.7.2/Lib/test/test_io.py.disable-tests-in-test_io
Python-2.7.2/Lib/test/test_io.py
+--- Python-2.7.2/Lib/test/test_io.py.disable-tests-in-test_io 2011-09-01
14:18:45.963304089 -0400
++++ Python-2.7.2/Lib/test/test_io.py 2011-09-01 15:08:53.796098413 -0400
+@@ -2669,6 +2669,7 @@ class SignalsTest(unittest.TestCase):
+ self.check_interrupted_read_retry(lambda x: x,
+ mode="r")
+
++ @unittest.skip('rhbz#732998')
+ @unittest.skipUnless(threading, 'Threading required for this test.')
+ def check_interrupted_write_retry(self, item, **fdopen_kwargs):
+ """Check that a buffered write, when it gets interrupted (either
diff --git a/python.spec b/python.spec
index b63152f..fbc987e 100644
--- a/python.spec
+++ b/python.spec
@@ -102,7 +102,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.2
-Release: 8%{?dist}
+Release: 9%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -498,6 +498,12 @@ Patch129: python-2.7.2-tsc-on-ppc.patch
# Not yet sent upstream
Patch130: python-2.7.2-add-extension-suffix-to-python-config.patch
+# The four tests in test_io built on top of check_interrupted_write_retry
+# fail when built in Koji, for ppc and ppc64; for some reason, the SIGALRM
+# handlers are never called, and the call to write runs to completion
+# (rhbz#732998)
+Patch131: python-2.7.2-disable-tests-in-test_io.patch
+
# This is the generated patch to "configure"; see the description of
# %{regenerate_autotooling_patch}
# above:
@@ -741,6 +747,10 @@ rm -r Modules/zlib || exit 1
%patch129 -p1 -b .tsc-on-ppc
%patch130 -p1
+%ifarch ppc ppc64
+%patch131 -p1
+%endif
+
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -1409,7 +1419,7 @@ CheckPython() {
pushd $ConfDir
- EXTRATESTOPTS="--verbose3"
+ EXTRATESTOPTS="--verbose"
%if 0%{?with_huntrleaks}
# Try to detect reference leaks on debug builds. By default this means
@@ -1796,6 +1806,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu Sep 1 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-9
+- run selftests with "--verbose"
+- disable parts of test_io on ppc (rhbz#732998)
+
* Tue Aug 23 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-8
- add --extension-suffix option to python-config (patch 130; rhbz#732808)
commit e958211a21122b66cb106a4228bee6d667432608
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Wed Aug 31 17:58:37 2011 -0400
python-2.7.2-tsc-on-ppc.patch now reported upstream
diff --git a/python.spec b/python.spec
index ff0113d..b63152f 100644
--- a/python.spec
+++ b/python.spec
@@ -479,7 +479,7 @@ Patch128: python-2.7.1-fix_test_abc_with_COUNT_ALLOCS.patch
# Fix the --with-tsc option on ppc64, and rework it on 32-bit ppc to avoid
# aliasing violations (rhbz#698726)
-# Not yet sent upstream
+# Sent upstream as
http://bugs.python.org/issue12872
Patch129: python-2.7.2-tsc-on-ppc.patch
# Add "--extension-suffix" option to python-config and python-debug-config
commit 73e351dac166f3a4567871a07e3b11f34286a2ca
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Tue Aug 23 18:28:07 2011 -0400
add --extension-suffix option to python-config (patch 130; rhbz#732808)
diff --git a/python-2.7.2-add-extension-suffix-to-python-config.patch
b/python-2.7.2-add-extension-suffix-to-python-config.patch
new file mode 100644
index 0000000..4d56867
--- /dev/null
+++ b/python-2.7.2-add-extension-suffix-to-python-config.patch
@@ -0,0 +1,18 @@
+diff -up Python-2.7.2/Misc/python-config.in.add-extension-suffix-to-python-config
Python-2.7.2/Misc/python-config.in
+--- Python-2.7.2/Misc/python-config.in.add-extension-suffix-to-python-config 2011-08-23
18:15:41.832497124 -0400
++++ Python-2.7.2/Misc/python-config.in 2011-08-23 18:17:25.854490011 -0400
+@@ -6,7 +6,7 @@ import getopt
+ from distutils import sysconfig
+
+ valid_opts = ['prefix', 'exec-prefix', 'includes',
'libs', 'cflags',
+- 'ldflags', 'help']
++ 'ldflags', 'extension-suffix', 'help']
+
+ def exit_with_usage(code=1):
+ print >>sys.stderr, "Usage: %s [%s]" % (sys.argv[0],
+@@ -54,3 +54,5 @@ for opt in opt_flags:
+ libs.extend(getvar('LINKFORSHARED').split())
+ print ' '.join(libs)
+
++ elif opt == '--extension-suffix':
++ print (sys.pydebug and "_d" or "") +
sysconfig.get_config_var('SO')
diff --git a/python.spec b/python.spec
index 7f2951b..ff0113d 100644
--- a/python.spec
+++ b/python.spec
@@ -102,7 +102,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.2
-Release: 7%{?dist}
+Release: 8%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -420,7 +420,9 @@ Patch111: python-2.7rc1-no-static-lib.patch
# * Similarly, we add DEBUG_SUFFIX within python-config and
# python$(VERSION)-config, so that the two configuration get different paths
# for these.
-
+#
+# See also patch 130 below
+#
Patch112: python-2.7rc1-debug-build.patch
@@ -480,6 +482,22 @@ Patch128: python-2.7.1-fix_test_abc_with_COUNT_ALLOCS.patch
# Not yet sent upstream
Patch129: python-2.7.2-tsc-on-ppc.patch
+# Add "--extension-suffix" option to python-config and python-debug-config
+# (rhbz#732808)
+#
+# This is adapted from 3.2's PEP-3149 support.
+#
+# Fedora's debug build has some non-standard features (see also patch 112
+# above), though largely shared with Debian/Ubuntu and Windows
+#
+# In particular, SO in the Makefile is currently always just ".so" for our
+# python 2 optimized builds, but for python 2 debug it should be '_d.so', to
+# distinguish the debug vs optimized ABI, following the pattern in the above
+# patch.
+#
+# Not yet sent upstream
+Patch130: python-2.7.2-add-extension-suffix-to-python-config.patch
+
# This is the generated patch to "configure"; see the description of
# %{regenerate_autotooling_patch}
# above:
@@ -721,6 +739,7 @@ rm -r Modules/zlib || exit 1
%patch127 -p0 -b .fix-test_structmember-on-64bit-bigendian
%patch128 -p1
%patch129 -p1 -b .tsc-on-ppc
+%patch130 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -1777,6 +1796,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Tue Aug 23 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-8
+- add --extension-suffix option to python-config (patch 130; rhbz#732808)
+
* Tue Aug 23 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-7
- re-enable and fix the --with-tsc option on ppc64, and rework it on 32-bit
ppc to avoid aliasing violations (patch 129; rhbz#698726)
commit 92ed49e1f9a286b6ee791a29f6b25be191d0c4c5
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Tue Aug 23 16:44:23 2011 -0400
ppc --with-tsc fixes
re-enable and fix the --with-tsc option on ppc64, and rework it on
32-bit ppc to avoid aliasing violations (patch 129; rhbz#698726)
diff --git a/python-2.7.2-tsc-on-ppc.patch b/python-2.7.2-tsc-on-ppc.patch
new file mode 100644
index 0000000..447c6e3
--- /dev/null
+++ b/python-2.7.2-tsc-on-ppc.patch
@@ -0,0 +1,58 @@
+diff -up Python-2.7.2/Python/ceval.c.tsc-on-ppc Python-2.7.2/Python/ceval.c
+--- Python-2.7.2/Python/ceval.c.tsc-on-ppc 2011-08-23 14:59:48.051300849 -0400
++++ Python-2.7.2/Python/ceval.c 2011-08-23 15:33:25.412162902 -0400
+@@ -37,24 +37,42 @@ typedef unsigned long long uint64;
+ */
+ #if defined(__ppc__) || defined (__powerpc__)
+
+-#define READ_TIMESTAMP(var) ppc_getcounter(&var)
++#if defined( __powerpc64__) || defined(__LP64__)
++/* 64-bit PowerPC */
++#define READ_TIMESTAMP(var) ppc64_getcounter(&var)
++static void
++ppc64_getcounter(uint64 *v)
++{
++ /* On 64-bit PowerPC we can read the 64-bit timebase directly into a
++ 64-bit register */
++ uint64 timebase;
++#ifdef _ARCH_PWR4
++ asm volatile ("mfspr %0,268" : "=r" (timebase));
++#else
++ asm volatile ("mftb %0" : "=r" (timebase));
++#endif
++ *v = timebase;
++}
++
++#else
++/* 32-bit PowerPC */
++#define READ_TIMESTAMP(var) ppc32_getcounter(&var)
+
+ static void
+-ppc_getcounter(uint64 *v)
++ppc32_getcounter(uint64 *v)
+ {
+- register unsigned long tbu, tb, tbu2;
++ union { long long ll; long ii[2]; } u;
++ long tmp;
+
+ loop:
+- asm volatile ("mftbu %0" : "=r" (tbu) );
+- asm volatile ("mftb %0" : "=r" (tb) );
+- asm volatile ("mftbu %0" : "=r" (tbu2));
+- if (__builtin_expect(tbu != tbu2, 0)) goto loop;
+-
+- /* The slightly peculiar way of writing the next lines is
+- compiled better by GCC than any other way I tried. */
+- ((long*)(v))[0] = tbu;
+- ((long*)(v))[1] = tb;
++ asm volatile ("mftbu %0" : "=r" (u.ii[0]) );
++ asm volatile ("mftb %0" : "=r" (u.ii[1]) );
++ asm volatile ("mftbu %0" : "=r" (tmp));
++ if (__builtin_expect(u.ii[0] != tmp, 0)) goto loop;
++
++ *v = u.ll;
+ }
++#endif /* powerpc 32/64 bit */
+
+ #elif defined(__i386__)
+
diff --git a/python.spec b/python.spec
index 93c5c7d..7f2951b 100644
--- a/python.spec
+++ b/python.spec
@@ -102,7 +102,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.2
-Release: 6%{?dist}
+Release: 7%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -475,6 +475,10 @@ Patch127: fix-test_structmember-on-64bit-bigendian.patch
# Not yet sent upstream
Patch128: python-2.7.1-fix_test_abc_with_COUNT_ALLOCS.patch
+# Fix the --with-tsc option on ppc64, and rework it on 32-bit ppc to avoid
+# aliasing violations (rhbz#698726)
+# Not yet sent upstream
+Patch129: python-2.7.2-tsc-on-ppc.patch
# This is the generated patch to "configure"; see the description of
# %{regenerate_autotooling_patch}
@@ -716,6 +720,7 @@ rm -r Modules/zlib || exit 1
%patch126 -p0 -b .fix-dbm_contains-on-64bit-bigendian
%patch127 -p0 -b .fix-test_structmember-on-64bit-bigendian
%patch128 -p1
+%patch129 -p1 -b .tsc-on-ppc
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -836,7 +841,7 @@ LD_LIBRARY_PATH="$topdir/$ConfDir"
PATH=$PATH:$topdir/$ConfDir make -s EXTRA_CFL
BuildPython debug \
python-debug \
python%{pybasever}-debug \
-%ifarch %{ix86} x86_64 ppc
+%ifarch %{ix86} x86_64 ppc ppc64
"--with-pydebug --with-tsc --with-count-allocs --with-call-profile" \
%else
"--with-pydebug --with-count-allocs --with-call-profile" \
@@ -1772,6 +1777,10 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Tue Aug 23 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-7
+- re-enable and fix the --with-tsc option on ppc64, and rework it on 32-bit
+ppc to avoid aliasing violations (patch 129; rhbz#698726)
+
* Tue Aug 23 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-6
- don't use --with-tsc on ppc64 debug builds (rhbz#698726)
commit 76e85fb7737abc82d729292607f9e2759645e29c
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Tue Aug 23 14:23:31 2011 -0400
don't use --with-tsc on ppc64 debug builds (rhbz#698726)
diff --git a/python.spec b/python.spec
index 205f8f9..93c5c7d 100644
--- a/python.spec
+++ b/python.spec
@@ -102,7 +102,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.2
-Release: 5%{?dist}
+Release: 6%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -836,7 +836,7 @@ LD_LIBRARY_PATH="$topdir/$ConfDir"
PATH=$PATH:$topdir/$ConfDir make -s EXTRA_CFL
BuildPython debug \
python-debug \
python%{pybasever}-debug \
-%ifarch %{ix86} x86_64 ppc ppc64
+%ifarch %{ix86} x86_64 ppc
"--with-pydebug --with-tsc --with-count-allocs --with-call-profile" \
%else
"--with-pydebug --with-count-allocs --with-call-profile" \
@@ -1772,6 +1772,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Tue Aug 23 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-6
+- don't use --with-tsc on ppc64 debug builds (rhbz#698726)
+
* Thu Aug 18 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-5
- add rpm macros file (rhbz#731800)
commit 7e7a694abb4f9ae80bf63a15dd645b255c389d76
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Mon Aug 22 15:36:09 2011 -0400
Remove stray comment header that was unintentionally within postun scriptlet
(rhbz#732475)
diff --git a/python.spec b/python.spec
index 22f7f1b..205f8f9 100644
--- a/python.spec
+++ b/python.spec
@@ -1431,9 +1431,6 @@ rm -fr %{buildroot}
%postun libs -p /sbin/ldconfig
-# ======================================================
-# Manifests of the various subpackages
-# ======================================================
%files
%defattr(-, root, root, -)
commit 85867c0a81ff2e52d71e69dc846a3c0efd3fed46
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Thu Aug 18 15:25:42 2011 -0400
add rpm macros file (rhbz#731800)
diff --git a/macros.python2 b/macros.python2
new file mode 100644
index 0000000..982b51f
--- /dev/null
+++ b/macros.python2
@@ -0,0 +1,4 @@
+%__python2 /usr/bin/python2
+%python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib;
print(get_python_lib())")
+%python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib;
print(get_python_lib(1))")
+%python2_version %(%{__python2} -c "import sys;
sys.stdout.write(sys.version[:3])")
diff --git a/python.spec b/python.spec
index 78ec2e8..22f7f1b 100644
--- a/python.spec
+++ b/python.spec
@@ -102,7 +102,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.2
-Release: 4%{?dist}
+Release: 5%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -180,6 +180,11 @@ Source4: systemtap-example.stp
# Written by dmalcolm; not yet sent upstream
Source5: pyfuntop.stp
+# Supply various useful macros for building python 2 modules:
+# __python2, python2_sitelib, python2_sitearch, python2_version
+Source6: macros.python2
+
+
# Modules/Setup.dist is ultimately used by the "makesetup" script to construct
# the Makefile and config.c
#
@@ -1073,6 +1078,10 @@ sed -i -e
"s/'pyconfig.h'/'%{_pyconfig_h}'/" \
%{buildroot}%{pylibdir}/distutils/sysconfig.py \
%{buildroot}%{pylibdir}/sysconfig.py
+# Install macros for rpm:
+mkdir -p %{buildroot}/%{_sysconfdir}/rpm
+install -m 644 %{SOURCE6} %{buildroot}/%{_sysconfdir}/rpm
+
# Ensure that the curses module was linked against libncursesw.so, rather than
# libncurses.so (bug 539917)
ldd %{buildroot}/%{dynload_dir}/_curses*.so \
@@ -1587,6 +1596,7 @@ rm -fr %{buildroot}
%endif
%{_bindir}/python%{pybasever}-config
%{_libdir}/libpython%{pybasever}.so
+%config(noreplace) %{_sysconfdir}/rpm/macros.python2
%files tools
%defattr(-,root,root,755)
@@ -1765,6 +1775,9 @@ rm -fr %{buildroot}
# ======================================================
%changelog
+* Thu Aug 18 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-5
+- add rpm macros file (rhbz#731800)
+
* Fri Jul 8 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-4
- cleanup of BuildRequires; add comment headings to specfile sections
commit 4f38fe7b1b9e13bb86c2d30e6581c4ea7f15599a
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Fri Jul 8 12:36:16 2011 -0400
cleanup of BuildRequires; add comment headings to specfile sections
diff --git a/python.spec b/python.spec
index e4d3c90..78ec2e8 100644
--- a/python.spec
+++ b/python.spec
@@ -1,3 +1,7 @@
+# ======================================================
+# Conditionals and other variables controlling the build
+# ======================================================
+
%{!?__python_ver:%global __python_ver EMPTY}
#global __python_ver 27
%global unicode ucs4
@@ -90,16 +94,71 @@
# the rest of the build
%global regenerate_autotooling_patch 0
+
+# ==================
+# Top-level metadata
+# ==================
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.2
-Release: 3%{?dist}
+Release: 4%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
Provides: python-abi = %{pybasever}
Provides: python(abi) = %{pybasever}
+
+
+# =======================
+# Build-time requirements
+# =======================
+
+# (keep this list alphabetized)
+
+BuildRequires: autoconf
+BuildRequires: bzip2
+BuildRequires: bzip2-devel
+BuildRequires: db4-devel >= 4.8
+BuildRequires: expat-devel
+BuildRequires: findutils
+BuildRequires: gcc-c++
+BuildRequires: gdbm-devel
+BuildRequires: glibc-devel
+BuildRequires: gmp-devel
+BuildRequires: libffi-devel
+BuildRequires: libGL-devel
+BuildRequires: libX11-devel
+BuildRequires: ncurses-devel
+BuildRequires: openssl-devel
+BuildRequires: pkgconfig
+BuildRequires: readline-devel
+BuildRequires: sqlite-devel
+
+%if 0%{?with_systemtap}
+BuildRequires: systemtap-sdt-devel
+# (this introduces a circular dependency, in that systemtap-sdt-devel's
+# /usr/bin/dtrace is a python script)
+%global tapsetdir /usr/share/systemtap/tapset
+%endif # with_systemtap
+
+BuildRequires: tar
+BuildRequires: tcl-devel
+BuildRequires: tix-devel
+BuildRequires: tk-devel
+
+%if 0%{?with_valgrind}
+BuildRequires: valgrind-devel
+%endif
+
+BuildRequires: zlib-devel
+
+
+
+# =======================
+# Source code and patches
+# =======================
+
Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
# Work around bug 562906 until it's fixed in rpm-build by providing a fixed
@@ -417,6 +476,10 @@ Patch128: python-2.7.1-fix_test_abc_with_COUNT_ALLOCS.patch
# above:
Patch300: python-2.7-autotool-intermediates.patch
+# ======================================================
+# Additional metadata, and subpackages
+# ======================================================
+
%if %{main_python}
Obsoletes: Distutils
Provides: Distutils
@@ -439,22 +502,6 @@ Provides: python-argparse = %{version}-%{release}
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-BuildRequires: readline-devel, openssl-devel, gmp-devel
-BuildRequires: ncurses-devel, gdbm-devel, zlib-devel, expat-devel
-BuildRequires: libGL-devel tk tix gcc-c++ libX11-devel glibc-devel
-BuildRequires: bzip2 tar findutils pkgconfig tcl-devel tk-devel
-BuildRequires: tix-devel bzip2-devel sqlite-devel
-BuildRequires: autoconf
-BuildRequires: db4-devel >= 4.8
-BuildRequires: libffi-devel
-%if 0%{?with_valgrind}
-BuildRequires: valgrind-devel
-%endif
-
-%if 0%{?with_systemtap}
-BuildRequires: systemtap-sdt-devel
-%global tapsetdir /usr/share/systemtap/tapset
-%endif
URL:
http://www.python.org/
@@ -531,7 +578,6 @@ color editor (pynche), and a python gettext program (pygettext.py).
%package -n %{tkinter}
Summary: A graphical user interface for the Python scripting language
Group: Development/Languages
-BuildRequires: tcl, tk
Requires: %{name} = %{version}-%{release}
%if %{main_python}
Obsoletes: tkinter2
@@ -593,6 +639,11 @@ suffix ("foo_d.so" rather than "foo.so") so that
each Python implementation can
load its own extensions.
%endif # with_debug_build
+
+# ======================================================
+# The prep phase of the build:
+# ======================================================
+
%prep
%setup -q -n Python-%{version}
@@ -670,6 +721,11 @@ find -name "*~" |xargs rm -f
%patch300 -p0 -b .autotool-intermediates
%endif
+
+# ======================================================
+# Configuring and building the code:
+# ======================================================
+
%build
topdir=$(pwd)
export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv"
@@ -789,6 +845,11 @@ BuildPython optimized \
"" \
true
+
+# ======================================================
+# Installing the built code:
+# ======================================================
+
%install
topdir=$(pwd)
rm -rf %{buildroot}
@@ -1062,6 +1123,11 @@ sed \
%endif # with_debug_build
%endif # with_systemtap
+
+# ======================================================
+# Running the upstream test suite
+# ======================================================
+
%check
topdir=$(pwd)
CheckPython() {
@@ -1339,13 +1405,27 @@ CheckPython \
optimized \
python%{pybasever}
+# ======================================================
+# Cleaning up
+# ======================================================
+
%clean
rm -fr %{buildroot}
+
+# ======================================================
+# Scriptlets
+# ======================================================
+
%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
+
+# ======================================================
+# Manifests of the various subpackages
+# ======================================================
+
%files
%defattr(-, root, root, -)
%doc LICENSE README
@@ -1679,7 +1759,15 @@ rm -fr %{buildroot}
# (if it doesn't, then the rpmbuild ought to fail since the debug-gdb.py
# payload file would be unpackaged)
+
+# ======================================================
+# Finally, the changelog:
+# ======================================================
+
%changelog
+* Fri Jul 8 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-4
+- cleanup of BuildRequires; add comment headings to specfile sections
+
* Wed Jun 22 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-3
- reorganize test exclusions (test_openpty and test_pty seem to be failing on
every arch, not just the explicitly-listed ones)
commit c4cfb20f2c867f30eb10611e974974937dabf77a
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Wed Jun 22 14:57:53 2011 -0400
reorganize test exclusions (test_openpty and test_pty seem to be failing on every
arch, not just the explicitly-listed ones)
diff --git a/python.spec b/python.spec
index 7ce62e6..e4d3c90 100644
--- a/python.spec
+++ b/python.spec
@@ -94,7 +94,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.2
-Release: 2%{?dist}
+Release: 3%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1138,6 +1138,34 @@ CheckPython() {
# AssertionError: IOError not raised
# ----------------------------------------------------------------------
#
+ # test_openpty:
+ # Fails in Koji, possibly due to a mock issue (rhbz#714627)
+ # ======================================================================
+ # ERROR: test (test.test_openpty.OpenptyTest)
+ # ----------------------------------------------------------------------
+ # Traceback (most recent call last):
+ # File "/builddir/build/BUILD/Python-2.7.2/Lib/test/test_openpty.py", line
12, in test
+ # master, slave = os.openpty()
+ # OSError: [Errno 2] No such file or directory
+ # ----------------------------------------------------------------------
+ #
+ # test_pty:
+ # Fails in Koji, possibly due to a mock issue (rhbz#714627)
+ # ======================================================================
+ # ERROR: test_fork (test.test_pty.PtyTest)
+ # ----------------------------------------------------------------------
+ # Traceback (most recent call last):
+ # File "/builddir/build/BUILD/Python-2.7.2/Lib/test/test_pty.py", line
114, in test_fork
+ # pid, master_fd = pty.fork()
+ # File "/builddir/build/BUILD/Python-2.7.2/Lib/pty.py", line 107, in fork
+ # master_fd, slave_fd = openpty()
+ # File "/builddir/build/BUILD/Python-2.7.2/Lib/pty.py", line 29, in
openpty
+ # master_fd, slave_name = _open_terminal()
+ # File "/builddir/build/BUILD/Python-2.7.2/Lib/pty.py", line 70, in
_open_terminal
+ # raise os.error, 'out of pty devices'
+ # OSError: out of pty devices
+ # ----------------------------------------------------------------------
+ #
# test_subprocess:
# Fails in Koji with:
# ======================================================================
@@ -1166,28 +1194,55 @@ CheckPython() {
test_urllib2 \
test_file \
test_file2k \
+ test_openpty \
+ test_pty \
test_subprocess \
%{nil}"
- # arch-specific exclusions follow
+
+ #
+ # Additional architecture-specific test exclusions:
+ #
+
+ # ARM-specific test exclusions (see rhbz#706253):
+ # test_float:
+ # This is upstream bug:
http://bugs.python.org/issue8265
+ # ======================================================================
+ # FAIL: test_from_hex (test.test_float.HexFloatTestCase)
+ # ----------------------------------------------------------------------
+ # Traceback (most recent call last):
+ # File "/builddir/build/BUILD/Python-2.7/Lib/test/test_float.py", line
1204, in test_from_hex
+ # self.identical(fromHex('0x0.ffffffffffffd6p-1022'), MIN-3*TINY)
+ # File "/builddir/build/BUILD/Python-2.7/Lib/test/test_float.py", line
914, in identical
+ # self.fail('%r not identical to %r' % (x, y))
+ # AssertionError: 2.2250738585072e-308 not identical to 2.2250738585071984e-308
+ # ----------------------------------------------------------------------
%ifarch %{arm}
EXCLUDED_TESTS="$EXCLUDED_TESTS \
test_float \
%{nil}"
-%else
+%endif
+
+
+ # Sparc-specific test exclusions (see rhbz#711584):
+ # test_ctypes:
+ # This is upstream bug:
http://bugs.python.org/issue8314
+ # which appears to be a libffi bug
+ # ======================================================================
+ # FAIL: test_ulonglong (ctypes.test.test_callbacks.Callbacks)
+ # ----------------------------------------------------------------------
+ # Traceback (most recent call last):
+ # File
"/builddir/build/BUILD/Python-2.7.1/Lib/ctypes/test/test_callbacks.py",
+ # line 72, in test_ulonglong
+ # self.check_type(c_ulonglong, 10955412242170339782)
+ # File
"/builddir/build/BUILD/Python-2.7.1/Lib/ctypes/test/test_callbacks.py",
+ # line 31, in check_type
+ # self.assertEqual(result, arg)
+ # AssertionError: 10955412241121898851L != 10955412242170339782L
+ # ----------------------------------------------------------------------
%ifarch %{sparc}
EXCLUDED_TESTS="$EXCLUDED_TESTS \
test_ctypes \
- test_openpty \
- test_pty \
%{nil}"
-%else
-%ifarch s390 s390x
- EXCLUDED_TESTS="$EXCLUDED_TESTS \
- test_openpty \
- test_pty \
- %{nil}"
-%endif
-%endif
%endif
# Debug build shows some additional failures (to be investigated):
@@ -1625,6 +1680,10 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Wed Jun 22 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-3
+- reorganize test exclusions (test_openpty and test_pty seem to be failing on
+every arch, not just the explicitly-listed ones)
+
* Mon Jun 13 2011 Dan Hork <dan[at]danny.cz> - 2.7.2-2
- add s390(x) excluded tests
commit 093a2cb27a2bd5dec35d3fbd2b72d713b1a0cac2
Author: Dan Hork <dan(a)danny.cz>
Date: Tue Jun 14 00:01:28 2011 +0200
add s390(x) excluded tests
diff --git a/python.spec b/python.spec
index 732a803..7ce62e6 100644
--- a/python.spec
+++ b/python.spec
@@ -94,7 +94,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.2
-Release: 1%{?dist}
+Release: 2%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1156,7 +1156,6 @@ CheckPython() {
# OSError: [Errno 13] Permission denied
# ----------------------------------------------------------------------
#
-%ifarch %{arm}
EXCLUDED_TESTS="test_argparse \
test_distutils \
test_dl \
@@ -1168,40 +1167,28 @@ CheckPython() {
test_file \
test_file2k \
test_subprocess \
+ %{nil}"
+ # arch-specific exclusions follow
+%ifarch %{arm}
+ EXCLUDED_TESTS="$EXCLUDED_TESTS \
test_float \
%{nil}"
%else
%ifarch %{sparc}
- EXCLUDED_TESTS="test_argparse \
- test_distutils \
- test_dl \
- test_gdb \
- test_http_cookies \
- test_httplib \
- test_socket \
- test_urllib2 \
- test_file \
- test_file2k \
- test_subprocess \
+ EXCLUDED_TESTS="$EXCLUDED_TESTS \
test_ctypes \
test_openpty \
test_pty \
%{nil}"
%else
- EXCLUDED_TESTS="test_argparse \
- test_distutils \
- test_dl \
- test_gdb \
- test_http_cookies \
- test_httplib \
- test_socket \
- test_urllib2 \
- test_file \
- test_file2k \
- test_subprocess \
+%ifarch s390 s390x
+ EXCLUDED_TESTS="$EXCLUDED_TESTS \
+ test_openpty \
+ test_pty \
%{nil}"
%endif
%endif
+%endif
# Debug build shows some additional failures (to be investigated):
#
@@ -1638,6 +1625,9 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Mon Jun 13 2011 Dan Hork <dan[at]danny.cz> - 2.7.2-2
+- add s390(x) excluded tests
+
* Mon Jun 13 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-1
- 2.7.2; drop upstreamed patches: patch 122 (parallel make fix), patch 124
(test_commands and SELinux), patch 130 (ppc preprocessor macro in debug
@@ -1648,7 +1638,7 @@ intermediates patch (patch 300)
- fix sparc building by excluding failing tests RHBZ#711584
* Mon May 23 2011 Peter Robinson <pbrobinson(a)gmail.com> - 2.7.1-8
-- fix compile on ARM by exlcuding failing tests on arm - RHBZ #706253
+- fix compile on ARM by excluding failing tests on arm - RHBZ #706253
* Tue Apr 12 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.1-7
- fix "import decimal" in the Turkish locale (patch 131; rhbz#694928)
commit 25640e30a2290536ee11f87a2f0e71b452e2581b
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Mon Jun 13 17:19:37 2011 -0400
2.7.2
* Mon Jun 13 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-1
- 2.7.2; drop upstreamed patches: patch 122 (parallel make fix), patch 124
(test_commands and SELinux), patch 130 (ppc preprocessor macro in debug
build); patch 131 (decimal in Turkish locale); regenerate the autotool
intermediates patch (patch 300)
diff --git a/.gitignore b/.gitignore
index c33d58f..c2cf9a1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
Python-2.7.tar.bz2
/Python-2.7.1.tar.bz2
+/Python-2.7.2.tar.bz2
diff --git a/python-2.7-autotool-intermediates.patch
b/python-2.7-autotool-intermediates.patch
index 6e1184e..68eefe9 100644
--- a/python-2.7-autotool-intermediates.patch
+++ b/python-2.7-autotool-intermediates.patch
@@ -1,14 +1,7 @@
diff -up ./configure.autotool-intermediates ./configure
---- ./configure.autotool-intermediates 2010-12-23 16:14:04.399059791 -0500
-+++ ./configure 2010-12-23 16:14:05.922060430 -0500
-@@ -1,5 +1,5 @@
- #! /bin/sh
--# From configure.in Revision: 86043 .
-+# From configure.in Revision: 86076 .
- # Guess values for system-dependent variables and create Makefiles.
- # Generated by GNU Autoconf 2.65 for python 2.7.
- #
-@@ -611,6 +611,8 @@ TRUE
+--- ./configure.autotool-intermediates 2011-06-13 15:27:20.710308004 -0400
++++ ./configure 2011-06-13 15:27:22.862308004 -0400
+@@ -619,6 +619,8 @@ TRUE
MACHDEP_OBJS
DYNLOADFILE
DLINCLDIR
@@ -17,7 +10,7 @@ diff -up ./configure.autotool-intermediates ./configure
THREADOBJ
LDLAST
USE_THREAD_MODULE
-@@ -631,6 +633,8 @@ OTHER_LIBTOOL_OPT
+@@ -639,6 +641,8 @@ OTHER_LIBTOOL_OPT
UNIVERSAL_ARCH_FLAGS
BASECFLAGS
OPT
@@ -26,7 +19,7 @@ diff -up ./configure.autotool-intermediates ./configure
LN
INSTALL_DATA
INSTALL_SCRIPT
-@@ -748,8 +752,11 @@ with_pth
+@@ -760,8 +764,11 @@ with_pth
enable_ipv6
with_doc_strings
with_tsc
@@ -38,7 +31,17 @@ diff -up ./configure.autotool-intermediates ./configure
with_wctype_functions
with_fpectl
with_libm
-@@ -1422,8 +1429,11 @@ Optional Packages:
+@@ -777,7 +784,8 @@ CFLAGS
+ LDFLAGS
+ LIBS
+ CPPFLAGS
+-CPP'
++CPP
++CPPFLAGS'
+
+
+ # Initialize some variables set by options.
+@@ -1435,8 +1443,11 @@ Optional Packages:
--with-pth use GNU pth threading libraries
--with(out)-doc-strings disable/enable documentation strings
--with(out)-tsc enable/disable timestamp counter profile
@@ -50,35 +53,7 @@ diff -up ./configure.autotool-intermediates ./configure
--with-wctype-functions use wctype.h functions
--with-fpectl enable SIGFPE catching
--with-libm=STRING math library
-@@ -1934,11 +1944,11 @@ else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
- $ac_includes_default
-- enum { N = $2 / 2 - 1 };
- int
- main ()
- {
--static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) <<
N) - 1) * 2 + 1))];
-+static int test_array [1 - 2 * !(enum { N = $2 / 2 - 1 };
-+ 0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))];
- test_array [0] = 0
-
- ;
-@@ -1949,11 +1959,11 @@ if ac_fn_c_try_compile "$LINENO"; then :
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
- $ac_includes_default
-- enum { N = $2 / 2 - 1 };
- int
- main ()
- {
--static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) -
1) * 2 + 1)
-+static int test_array [1 - 2 * !(enum { N = $2 / 2 - 1 };
-+ ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1)
- < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))];
- test_array [0] = 0
-
-@@ -4739,7 +4749,7 @@ esac
+@@ -4754,7 +4765,7 @@ esac
$as_echo_n "checking LIBRARY... " >&6; }
if test -z "$LIBRARY"
then
@@ -87,7 +62,7 @@ diff -up ./configure.autotool-intermediates ./configure
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBRARY" >&5
$as_echo "$LIBRARY" >&6; }
-@@ -4913,8 +4923,8 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>
+@@ -4928,8 +4939,8 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>
INSTSONAME="$LDLIBRARY".$SOVERSION
;;
Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*)
@@ -98,7 +73,7 @@ diff -up ./configure.autotool-intermediates ./configure
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
case $ac_sys_system in
FreeBSD*)
-@@ -4937,7 +4947,7 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>
+@@ -4952,7 +4963,7 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>
;;
OSF*)
LDLIBRARY='libpython$(VERSION).so'
@@ -107,7 +82,7 @@ diff -up ./configure.autotool-intermediates ./configure
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
;;
atheos*)
-@@ -5318,6 +5328,14 @@ $as_echo "no" >&6; }
+@@ -5391,6 +5402,14 @@ $as_echo "no" >&6; }
fi
@@ -122,7 +97,7 @@ diff -up ./configure.autotool-intermediates ./configure
# XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
# merged with this chunk of code?
-@@ -9341,6 +9359,50 @@ $as_echo "no" >&6; }
+@@ -9403,6 +9422,50 @@ $as_echo "no" >&6; }
fi
@@ -173,7 +148,7 @@ diff -up ./configure.autotool-intermediates ./configure
# Check for Python-specific malloc support
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-pymalloc"
>&5
$as_echo_n "checking for --with-pymalloc... " >&6; }
-@@ -9390,6 +9452,46 @@ fi
+@@ -9452,6 +9515,46 @@ fi
fi
@@ -221,8 +196,8 @@ diff -up ./configure.autotool-intermediates ./configure
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-wctype-functions"
>&5
$as_echo_n "checking for --with-wctype-functions... " >&6; }
diff -up ./pyconfig.h.in.autotool-intermediates ./pyconfig.h.in
---- ./pyconfig.h.in.autotool-intermediates 2010-12-23 16:14:04.396063268 -0500
-+++ ./pyconfig.h.in 2010-12-23 16:14:06.242367491 -0500
+--- ./pyconfig.h.in.autotool-intermediates 2011-06-13 15:27:20.702308004 -0400
++++ ./pyconfig.h.in 2011-06-13 15:27:23.433308006 -0400
@@ -18,6 +18,12 @@
/* Define this if you have BeOS threads. */
#undef BEOS_THREADS
@@ -249,3 +224,13 @@ diff -up ./pyconfig.h.in.autotool-intermediates ./pyconfig.h.in
/* Define if you want pymalloc to be disabled when running under valgrind */
#undef WITH_VALGRIND
+@@ -1146,6 +1146,9 @@
+ /* This must be defined on some systems to enable large file support. */
+ #undef _LARGEFILE_SOURCE
+
++/* This must be defined on AIX systems to enable large file support. */
++#undef _LARGE_FILES
++
+ /* Define to 1 if on MINIX. */
+ #undef _MINIX
+
diff --git a/python.spec b/python.spec
index 0aa20c2..732a803 100644
--- a/python.spec
+++ b/python.spec
@@ -93,8 +93,8 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
# Remember to also rebase python-docs when changing this:
-Version: 2.7.1
-Release: 9%{?dist}
+Version: 2.7.2
+Release: 1%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -390,16 +390,6 @@ Patch115: make-pydoc-more-robust-001.patch
# For now, revert this patch:
Patch121: python-2.7rc2-r79310.patch
-# Fix race condition in parallel make that could lead to graminit.c failing
-# to compile, or linker errors with "undefined reference to
-# `_PyParser_Grammar'":
-# Not yet sent upstream:
-Patch122: python-2.7-fix-parallel-make.patch
-
-# test_commmands fails on SELinux systems due to a change in the output
-# of "ls" (
http://bugs.python.org/issue7108)
-Patch124: fix-test_commands-expected-ls-output-issue7108.patch
-
# COUNT_ALLOCS is useful for debugging, but the upstream behaviour of always
# emitting debug info to stdout on exit is too verbose and makes it harder to
# use the debug build. Add a "PYTHONDUMPCOUNTS" environment variable which
@@ -421,15 +411,6 @@ Patch127: fix-test_structmember-on-64bit-bigendian.patch
# Not yet sent upstream
Patch128: python-2.7.1-fix_test_abc_with_COUNT_ALLOCS.patch
-# Use the correct preprocessor definition to detect ppc:
-# See
http://bugs.python.org/issue10655 and rhbz#661510
-Patch130: python-3.2b2-fix-ppc-debug-build.patch
-
-# Fix "import decimal" in the Turkish locale (rhbz#694928)
-# Based on upstream commit:
-#
http://hg.python.org/cpython/rev/b4b1f557d563/
-Patch131: python-2.7.1-fix-decimal-in-turkish-locale.patch
-
# This is the generated patch to "configure"; see the description of
# %{regenerate_autotooling_patch}
@@ -675,14 +656,10 @@ rm -r Modules/zlib || exit 1
%patch115 -p0
%patch121 -p0 -R
-%patch122 -p1 -b .fix-parallel-make
-%patch124 -p1
%patch125 -p1 -b .less-verbose-COUNT_ALLOCS
%patch126 -p0 -b .fix-dbm_contains-on-64bit-bigendian
%patch127 -p0 -b .fix-test_structmember-on-64bit-bigendian
%patch128 -p1
-%patch130 -p1
-%patch131 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -1661,6 +1638,12 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Mon Jun 13 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.2-1
+- 2.7.2; drop upstreamed patches: patch 122 (parallel make fix), patch 124
+(test_commands and SELinux), patch 130 (ppc preprocessor macro in debug
+build); patch 131 (decimal in Turkish locale); regenerate the autotool
+intermediates patch (patch 300)
+
* Tue Jun 07 2011 Dennis Gilmore <dennis(a)ausil.us> - 2.7.1-9
- fix sparc building by excluding failing tests RHBZ#711584
diff --git a/sources b/sources
index afab837..44a6a4f 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-aa27bc25725137ba155910bd8e5ddc4f Python-2.7.1.tar.bz2
+ba7b2f11ffdbf195ee0d111b9455a5bd Python-2.7.2.tar.bz2
commit 83e90d9c5b5942bd6fd73ee6c961265803f919e1
Author: Dennis Gilmore <dennis(a)ausil.us>
Date: Tue Jun 7 15:00:01 2011 -0500
* Tue Jun 07 2011 Dennis Gilmore <dennis(a)ausil.us> - 2.7.1-9
- fix sparc building by excluding failing tests RHBZ#711584
diff --git a/python.spec b/python.spec
index 175805a..0aa20c2 100644
--- a/python.spec
+++ b/python.spec
@@ -94,7 +94,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.1
-Release: 8%{?dist}
+Release: 9%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1193,6 +1193,23 @@ CheckPython() {
test_subprocess \
test_float \
%{nil}"
+%else
+%ifarch %{sparc}
+ EXCLUDED_TESTS="test_argparse \
+ test_distutils \
+ test_dl \
+ test_gdb \
+ test_http_cookies \
+ test_httplib \
+ test_socket \
+ test_urllib2 \
+ test_file \
+ test_file2k \
+ test_subprocess \
+ test_ctypes \
+ test_openpty \
+ test_pty \
+ %{nil}"
%else
EXCLUDED_TESTS="test_argparse \
test_distutils \
@@ -1207,6 +1224,7 @@ CheckPython() {
test_subprocess \
%{nil}"
%endif
+%endif
# Debug build shows some additional failures (to be investigated):
#
@@ -1643,6 +1661,9 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Tue Jun 07 2011 Dennis Gilmore <dennis(a)ausil.us> - 2.7.1-9
+- fix sparc building by excluding failing tests RHBZ#711584
+
* Mon May 23 2011 Peter Robinson <pbrobinson(a)gmail.com> - 2.7.1-8
- fix compile on ARM by exlcuding failing tests on arm - RHBZ #706253
commit cb0349a5999fdd8adecacd290732f5838aa874c6
Merge: 895f921 599d1aa
Author: Peter Robinson <pbrobinson(a)gmail.com>
Date: Mon May 23 11:00:47 2011 +0100
fix merge, fix compile on ARM by exlcuding failing tests on arm - RHBZ #706253
commit 599d1aa47d600dd4f01f6518fb1c712602723cef
Author: Peter Robinson <pbrobinson(a)gmail.com>
Date: Mon May 23 10:16:50 2011 +0100
fix compile on ARM by exlcuding failing tests on arm - RHBZ #706253
diff --git a/python.spec b/python.spec
index b88602f..175805a 100644
--- a/python.spec
+++ b/python.spec
@@ -94,7 +94,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.1
-Release: 7%{?dist}
+Release: 8%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1179,6 +1179,7 @@ CheckPython() {
# OSError: [Errno 13] Permission denied
# ----------------------------------------------------------------------
#
+%ifarch %{arm}
EXCLUDED_TESTS="test_argparse \
test_distutils \
test_dl \
@@ -1190,8 +1191,23 @@ CheckPython() {
test_file \
test_file2k \
test_subprocess \
+ test_float \
%{nil}"
-
+%else
+ EXCLUDED_TESTS="test_argparse \
+ test_distutils \
+ test_dl \
+ test_gdb \
+ test_http_cookies \
+ test_httplib \
+ test_socket \
+ test_urllib2 \
+ test_file \
+ test_file2k \
+ test_subprocess \
+ %{nil}"
+%endif
+
# Debug build shows some additional failures (to be investigated):
#
# test_gc:
@@ -1627,6 +1643,9 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Mon May 23 2011 Peter Robinson <pbrobinson(a)gmail.com> - 2.7.1-8
+- fix compile on ARM by exlcuding failing tests on arm - RHBZ #706253
+
* Tue Apr 12 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.1-7
- fix "import decimal" in the Turkish locale (patch 131; rhbz#694928)
commit 94723519482fe34730362bf0eb99dfd59411d479
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Tue Apr 12 11:32:15 2011 -0400
fix "import decimal" in the Turkish locale (patch 131; rhbz#694928)
diff --git a/python-2.7.1-fix-decimal-in-turkish-locale.patch
b/python-2.7.1-fix-decimal-in-turkish-locale.patch
new file mode 100644
index 0000000..4645542
--- /dev/null
+++ b/python-2.7.1-fix-decimal-in-turkish-locale.patch
@@ -0,0 +1,50 @@
+diff -up Python-2.7.1/Lib/decimal.py.fix-decimal-in-turkish-locale
Python-2.7.1/Lib/decimal.py
+--- Python-2.7.1/Lib/decimal.py.fix-decimal-in-turkish-locale 2010-07-08
17:22:54.000000000 -0400
++++ Python-2.7.1/Lib/decimal.py 2011-04-12 11:30:40.850350842 -0400
+@@ -1720,8 +1720,6 @@ class Decimal(object):
+ # here self was representable to begin with; return unchanged
+ return Decimal(self)
+
+- _pick_rounding_function = {}
+-
+ # for each of the rounding functions below:
+ # self is a finite, nonzero Decimal
+ # prec is an integer satisfying 0 <= prec < len(self._int)
+@@ -1788,6 +1786,17 @@ class Decimal(object):
+ else:
+ return -self._round_down(prec)
+
++ _pick_rounding_function = dict(
++ ROUND_DOWN = '_round_down',
++ ROUND_UP = '_round_up',
++ ROUND_HALF_UP = '_round_half_up',
++ ROUND_HALF_DOWN = '_round_half_down',
++ ROUND_HALF_EVEN = '_round_half_even',
++ ROUND_CEILING = '_round_ceiling',
++ ROUND_FLOOR = '_round_floor',
++ ROUND_05UP = '_round_05up',
++ )
++
+ def fma(self, other, third, context=None):
+ """Fused multiply-add.
+
+@@ -3705,18 +3714,6 @@ _numbers.Number.register(Decimal)
+
+ ##### Context class #######################################################
+
+-
+-# get rounding method function:
+-rounding_functions = [name for name in Decimal.__dict__.keys()
+- if name.startswith('_round_')]
+-for name in rounding_functions:
+- # name is like _round_half_even, goes to the global ROUND_HALF_EVEN value.
+- globalname = name[1:].upper()
+- val = globals()[globalname]
+- Decimal._pick_rounding_function[val] = name
+-
+-del name, val, globalname, rounding_functions
+-
+ class _ContextManager(object):
+ """Context manager class to support localcontext().
+
+diff -up Python-2.7.1/Misc/NEWS.fix-decimal-in-turkish-locale Python-2.7.1/Misc/NEWS
diff --git a/python.spec b/python.spec
index efe0d3d..b88602f 100644
--- a/python.spec
+++ b/python.spec
@@ -94,7 +94,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.1
-Release: 6%{?dist}
+Release: 7%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -425,6 +425,11 @@ Patch128: python-2.7.1-fix_test_abc_with_COUNT_ALLOCS.patch
# See
http://bugs.python.org/issue10655 and rhbz#661510
Patch130: python-3.2b2-fix-ppc-debug-build.patch
+# Fix "import decimal" in the Turkish locale (rhbz#694928)
+# Based on upstream commit:
+#
http://hg.python.org/cpython/rev/b4b1f557d563/
+Patch131: python-2.7.1-fix-decimal-in-turkish-locale.patch
+
# This is the generated patch to "configure"; see the description of
# %{regenerate_autotooling_patch}
@@ -677,6 +682,7 @@ rm -r Modules/zlib || exit 1
%patch127 -p0 -b .fix-test_structmember-on-64bit-bigendian
%patch128 -p1
%patch130 -p1
+%patch131 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -1621,6 +1627,9 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Tue Apr 12 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.1-7
+- fix "import decimal" in the Turkish locale (patch 131; rhbz#694928)
+
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.7.1-6
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
commit 895f921d7b3a1e5ade5779033bdf9a1291eac6ec
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Tue Apr 12 08:06:25 2011 -0400
fix "import decimal" in the Turkish locale (patch 131; rhbz#694928)
diff --git a/python-2.7.1-fix-decimal-in-turkish-locale.patch
b/python-2.7.1-fix-decimal-in-turkish-locale.patch
new file mode 100644
index 0000000..4645542
--- /dev/null
+++ b/python-2.7.1-fix-decimal-in-turkish-locale.patch
@@ -0,0 +1,50 @@
+diff -up Python-2.7.1/Lib/decimal.py.fix-decimal-in-turkish-locale
Python-2.7.1/Lib/decimal.py
+--- Python-2.7.1/Lib/decimal.py.fix-decimal-in-turkish-locale 2010-07-08
17:22:54.000000000 -0400
++++ Python-2.7.1/Lib/decimal.py 2011-04-12 11:30:40.850350842 -0400
+@@ -1720,8 +1720,6 @@ class Decimal(object):
+ # here self was representable to begin with; return unchanged
+ return Decimal(self)
+
+- _pick_rounding_function = {}
+-
+ # for each of the rounding functions below:
+ # self is a finite, nonzero Decimal
+ # prec is an integer satisfying 0 <= prec < len(self._int)
+@@ -1788,6 +1786,17 @@ class Decimal(object):
+ else:
+ return -self._round_down(prec)
+
++ _pick_rounding_function = dict(
++ ROUND_DOWN = '_round_down',
++ ROUND_UP = '_round_up',
++ ROUND_HALF_UP = '_round_half_up',
++ ROUND_HALF_DOWN = '_round_half_down',
++ ROUND_HALF_EVEN = '_round_half_even',
++ ROUND_CEILING = '_round_ceiling',
++ ROUND_FLOOR = '_round_floor',
++ ROUND_05UP = '_round_05up',
++ )
++
+ def fma(self, other, third, context=None):
+ """Fused multiply-add.
+
+@@ -3705,18 +3714,6 @@ _numbers.Number.register(Decimal)
+
+ ##### Context class #######################################################
+
+-
+-# get rounding method function:
+-rounding_functions = [name for name in Decimal.__dict__.keys()
+- if name.startswith('_round_')]
+-for name in rounding_functions:
+- # name is like _round_half_even, goes to the global ROUND_HALF_EVEN value.
+- globalname = name[1:].upper()
+- val = globals()[globalname]
+- Decimal._pick_rounding_function[val] = name
+-
+-del name, val, globalname, rounding_functions
+-
+ class _ContextManager(object):
+ """Context manager class to support localcontext().
+
+diff -up Python-2.7.1/Misc/NEWS.fix-decimal-in-turkish-locale Python-2.7.1/Misc/NEWS
diff --git a/python.spec b/python.spec
index efe0d3d..b88602f 100644
--- a/python.spec
+++ b/python.spec
@@ -94,7 +94,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.1
-Release: 6%{?dist}
+Release: 7%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -425,6 +425,11 @@ Patch128: python-2.7.1-fix_test_abc_with_COUNT_ALLOCS.patch
# See
http://bugs.python.org/issue10655 and rhbz#661510
Patch130: python-3.2b2-fix-ppc-debug-build.patch
+# Fix "import decimal" in the Turkish locale (rhbz#694928)
+# Based on upstream commit:
+#
http://hg.python.org/cpython/rev/b4b1f557d563/
+Patch131: python-2.7.1-fix-decimal-in-turkish-locale.patch
+
# This is the generated patch to "configure"; see the description of
# %{regenerate_autotooling_patch}
@@ -677,6 +682,7 @@ rm -r Modules/zlib || exit 1
%patch127 -p0 -b .fix-test_structmember-on-64bit-bigendian
%patch128 -p1
%patch130 -p1
+%patch131 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -1621,6 +1627,9 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Tue Apr 12 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.1-7
+- fix "import decimal" in the Turkish locale (patch 131; rhbz#694928)
+
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.7.1-6
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
commit 489369c26eabf41a1261e64f01de983676902db8
Author: Dennis Gilmore <dennis(a)ausil.us>
Date: Wed Feb 9 11:47:45 2011 -0600
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
diff --git a/python.spec b/python.spec
index 753467c2..efe0d3d 100644
--- a/python.spec
+++ b/python.spec
@@ -94,7 +94,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.1
-Release: 5%{?dist}
+Release: 6%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1621,6 +1621,9 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Wed Feb 09 2011 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.7.1-6
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
+
* Fri Jan 21 2011 Toshio Kuratomi <toshio(a)fedoraproject.org> - 2.7.1-5
- Switch from setting OPT to setting EXTRA_CFLAGS so we don't overwrite the
DNDEBUG flag
commit 970523cf96fedff5c7b17c29642498adeb6c513a
Author: Toshio Kuratomi <toshio(a)fedoraproject.org>
Date: Fri Jan 21 11:59:02 2011 -0800
- Switch from setting OPT to setting EXTRA_CFLAGS so we don't overwrite the
DNDEBUG flag
diff --git a/python.spec b/python.spec
index 927b394..753467c2 100644
--- a/python.spec
+++ b/python.spec
@@ -94,7 +94,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.1
-Release: 4%{?dist}
+Release: 5%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -760,7 +760,7 @@ BuildPython() {
$ExtraConfigArgs \
%{nil}
-make OPT="$CFLAGS" %{?_smp_mflags}
+make EXTRA_CFLAGS="$CFLAGS" %{?_smp_mflags}
# We need to fix shebang lines across the full source tree.
#
@@ -780,7 +780,7 @@ fi
# Rebuild with new python
# We need a link to a versioned python in the build directory
ln -s $BinaryName $SymlinkName
-LD_LIBRARY_PATH="$topdir/$ConfDir" PATH=$PATH:$topdir/$ConfDir make -s
OPT="$CFLAGS" %{?_smp_mflags}
+LD_LIBRARY_PATH="$topdir/$ConfDir" PATH=$PATH:$topdir/$ConfDir make -s
EXTRA_CFLAGS="$CFLAGS" %{?_smp_mflags}
popd
echo FINISHED: BUILD OF PYTHON FOR CONFIGURATION: $ConfDir
@@ -1621,6 +1621,10 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Fri Jan 21 2011 Toshio Kuratomi <toshio(a)fedoraproject.org> - 2.7.1-5
+- Switch from setting OPT to setting EXTRA_CFLAGS so we don't overwrite the
+ DNDEBUG flag
+
* Fri Jan 7 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.1-4
- for now, drop "obsoletes" of python-argparse, since it interracts badly with
multilib (rhbz#667984)
commit f81cc6682129531a473f488d14ec4ea988c9f854
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Fri Jan 7 15:42:22 2011 -0500
for now, drop "obsoletes" of python-argparse, since it interracts badly with
multilib (rhbz#667984)
diff --git a/python.spec b/python.spec
index 055aee7..927b394 100644
--- a/python.spec
+++ b/python.spec
@@ -94,7 +94,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.1
-Release: 3%{?dist}
+Release: 4%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -102,12 +102,6 @@ Provides: python-abi = %{pybasever}
Provides: python(abi) = %{pybasever}
Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
-# python-argparse is part of python as of version 2.7
-# drop this Provides/Obsoletes in F17
-Provides: python-argparse = %{version}-%{release}
-Obsoletes: python-argparse < 1.1-3
-
-
# Work around bug 562906 until it's fixed in rpm-build by providing a fixed
# version of pythondeps.sh:
Source2: pythondeps.sh
@@ -451,6 +445,11 @@ Obsoletes: python-hashlib < 20081120
Provides: python-hashlib = 20081120
Obsoletes: python-uuid < 1.31
Provides: python-uuid = 1.31
+
+# python-argparse is part of python as of version 2.7
+# drop this Provides in F17
+# (having Obsoletes here caused problems with multilib; see rhbz#667984)
+Provides: python-argparse = %{version}-%{release}
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -1622,6 +1621,10 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Fri Jan 7 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.1-4
+- for now, drop "obsoletes" of python-argparse, since it interracts badly with
+multilib (rhbz#667984)
+
* Fri Jan 7 2011 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.1-3
- obsolete/provide python-argparse (new in 2.7)
commit 6159c1e8c7abd66bca9c9703bdf066f70297a448
Author: Thomas Spura <tomspur(a)fedoraproject.org>
Date: Fri Jan 7 01:02:26 2011 +0100
obsolete/provide python-argparse (new in 2.7)
diff --git a/python.spec b/python.spec
index c9990e5..055aee7 100644
--- a/python.spec
+++ b/python.spec
@@ -94,7 +94,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.1
-Release: 2%{?dist}
+Release: 3%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -102,6 +102,11 @@ Provides: python-abi = %{pybasever}
Provides: python(abi) = %{pybasever}
Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
+# python-argparse is part of python as of version 2.7
+# drop this Provides/Obsoletes in F17
+Provides: python-argparse = %{version}-%{release}
+Obsoletes: python-argparse < 1.1-3
+
# Work around bug 562906 until it's fixed in rpm-build by providing a fixed
# version of pythondeps.sh:
@@ -1617,6 +1622,9 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Fri Jan 7 2011 Thomas Spura <tomspur(a)fedoraproject.org> - 2.7.1-3
+- obsolete/provide python-argparse (new in 2.7)
+
* Thu Jan 6 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.1-2
- fix the ppc build of the debug configuration (patch 130; rhbz#661510)
commit 1b4e012f7f0641de3284a442f75cfd350b17b986
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Thu Jan 6 11:29:20 2011 -0500
fix the ppc build of the debug configuration (patch 130; rhbz#661510)
diff --git a/python-3.2b2-fix-ppc-debug-build.patch
b/python-3.2b2-fix-ppc-debug-build.patch
new file mode 100644
index 0000000..e9c7176
--- /dev/null
+++ b/python-3.2b2-fix-ppc-debug-build.patch
@@ -0,0 +1,19 @@
+diff -up Python-3.2b2/Python/ceval.c.fix-ppc-debug-build Python-3.2b2/Python/ceval.c
+--- Python-3.2b2/Python/ceval.c.fix-ppc-debug-build 2011-01-05 16:37:27.007598805 -0500
++++ Python-3.2b2/Python/ceval.c 2011-01-05 16:45:06.562652472 -0500
+@@ -30,10 +30,11 @@
+
+ typedef unsigned long long uint64;
+
+-#if defined(__ppc__) /* <- Don't know if this is the correct symbol; this
+- section should work for GCC on any PowerPC
+- platform, irrespective of OS.
+- POWER? Who knows :-) */
++/* PowerPC suppport.
++ "__ppc__" appears to be the preprocessor definition to detect on OS X,
whereas
++ "__powerpc__" appears to be the correct one for Linux with GCC
++*/
++#if defined(__ppc__) || defined (__powerpc__)
+
+ #define READ_TIMESTAMP(var) ppc_getcounter(&var)
+
diff --git a/python.spec b/python.spec
index 3372f4e..c9990e5 100644
--- a/python.spec
+++ b/python.spec
@@ -94,7 +94,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.1
-Release: 1%{?dist}
+Release: 2%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -422,6 +422,11 @@ Patch127: fix-test_structmember-on-64bit-bigendian.patch
# Not yet sent upstream
Patch128: python-2.7.1-fix_test_abc_with_COUNT_ALLOCS.patch
+# Use the correct preprocessor definition to detect ppc:
+# See
http://bugs.python.org/issue10655 and rhbz#661510
+Patch130: python-3.2b2-fix-ppc-debug-build.patch
+
+
# This is the generated patch to "configure"; see the description of
# %{regenerate_autotooling_patch}
# above:
@@ -667,6 +672,7 @@ rm -r Modules/zlib || exit 1
%patch126 -p0 -b .fix-dbm_contains-on-64bit-bigendian
%patch127 -p0 -b .fix-test_structmember-on-64bit-bigendian
%patch128 -p1
+%patch130 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -1611,6 +1617,9 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Thu Jan 6 2011 David Malcolm <dmalcolm(a)redhat.com> - 2.7.1-2
+- fix the ppc build of the debug configuration (patch 130; rhbz#661510)
+
* Thu Dec 23 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7.1-1
- 2.7.1, reworking patch 0 (config), patch 102 (lib64); drop upstream
patch 56 (cfgparse), patch 110 (ctypes/SELinux/noexecmem), patch 119 (expat
commit c0b7f3900dd061d2322ead2a27e518e33a68b79d
Author: Dan Hork <dan(a)danny.cz>
Date: Tue Jan 4 15:52:53 2011 +0100
remove the tarball for 2.7 from sources so it's not downloaded during build
diff --git a/sources b/sources
index bcb898f..afab837 100644
--- a/sources
+++ b/sources
@@ -1,2 +1 @@
-0e8c9ec32abf5b732bea7d91b38c3339 Python-2.7.tar.bz2
aa27bc25725137ba155910bd8e5ddc4f Python-2.7.1.tar.bz2
commit 38234095e16b67c1fcace7380493514933759e88
Author: Dan Hork <dan(a)danny.cz>
Date: Tue Jan 4 15:46:43 2011 +0100
sync the architectures where valgrind is available with the valgrind package
diff --git a/python.spec b/python.spec
index dfafa41..3372f4e 100644
--- a/python.spec
+++ b/python.spec
@@ -43,10 +43,10 @@
%global with_systemtap 1
# some arches dont have valgrind so we need to disable its support on them
-%ifarch %{sparc} s390 s390x
-%global with_valgrind 0
-%else
+%ifarch %{ix86} x86_64 ppc ppc64 s390x
%global with_valgrind 1
+%else
+%global with_valgrind 0
%endif
# Some of the files below /usr/lib/pythonMAJOR.MINOR/test (e.g. bad_coding.py)
commit 86785292faab9fb51b65a3c9fc4813e33e53376f
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Wed Dec 29 04:37:48 2010 -0500
Upload the sources this time
diff --git a/.gitignore b/.gitignore
index 4a2f615..c33d58f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
Python-2.7.tar.bz2
+/Python-2.7.1.tar.bz2
diff --git a/sources b/sources
index 2c0d3aa..bcb898f 100644
--- a/sources
+++ b/sources
@@ -1 +1,2 @@
0e8c9ec32abf5b732bea7d91b38c3339 Python-2.7.tar.bz2
+aa27bc25725137ba155910bd8e5ddc4f Python-2.7.1.tar.bz2
commit 037535ac40f5bc01c17f6333f7d31412b5417571
Merge: 4b97eeb fdfb460
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Tue Dec 28 22:48:27 2010 -0500
Merge branch 'master' of
ssh://pkgs.fedoraproject.org/python
Conflicts:
python.spec
diff --cc python.spec
index 4bb13e1,e624318..dfafa41
--- a/python.spec
+++ b/python.spec
@@@ -1611,13 -1642,9 +1611,16 @@@ rm -fr %{buildroot
# payload file would be unpackaged)
%changelog
+* Thu Dec 23 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7.1-1
+- 2.7.1, reworking patch 0 (config), patch 102 (lib64); drop upstream
+patch 56 (cfgparse), patch 110 (ctypes/SELinux/noexecmem), patch 119 (expat
+compat), patch 123 (2to3 on "from itertools import *")
+- fix test_abc's test_cache_leak in the debug build (patch 128)
+- drop _weakref.so from manifest (_weakref became a core module in r84230)
+
+ * Wed Sep 29 2010 jkeating - 2.7-13
+ - Rebuilt for gcc bug 634757
+
* Mon Sep 27 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-12
- fix test_structmember on 64bit-bigendian (patch 127)
commit 4b97eebe22c8c5db58ae65cdc7e79c3ccd45b0a4
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Tue Dec 28 22:46:51 2010 -0500
* Thu Dec 23 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7.1-1
- 2.7.1, reworking patch 0 (config), patch 102 (lib64); drop upstream
patch 56 (cfgparse), patch 110 (ctypes/SELinux/noexecmem), patch 119 (expat
compat), patch 123 (2to3 on "from itertools import *")
- fix test_abc's test_cache_leak in the debug build (patch 128)
- drop _weakref.so from manifest (_weakref became a core module in r84230)
diff --git a/python-2.7-autotool-intermediates.patch
b/python-2.7-autotool-intermediates.patch
index 8f83847..6e1184e 100644
--- a/python-2.7-autotool-intermediates.patch
+++ b/python-2.7-autotool-intermediates.patch
@@ -1,10 +1,10 @@
diff -up ./configure.autotool-intermediates ./configure
---- ./configure.autotool-intermediates 2010-07-08 13:12:59.973249048 -0400
-+++ ./configure 2010-07-08 13:13:00.827247975 -0400
+--- ./configure.autotool-intermediates 2010-12-23 16:14:04.399059791 -0500
++++ ./configure 2010-12-23 16:14:05.922060430 -0500
@@ -1,5 +1,5 @@
#! /bin/sh
--# From configure.in Revision: 81509 .
-+# From configure.in Revision: 81582 .
+-# From configure.in Revision: 86043 .
++# From configure.in Revision: 86076 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.65 for python 2.7.
#
@@ -50,6 +50,34 @@ diff -up ./configure.autotool-intermediates ./configure
--with-wctype-functions use wctype.h functions
--with-fpectl enable SIGFPE catching
--with-libm=STRING math library
+@@ -1934,11 +1944,11 @@ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+ $ac_includes_default
+- enum { N = $2 / 2 - 1 };
+ int
+ main ()
+ {
+-static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) <<
N) - 1) * 2 + 1))];
++static int test_array [1 - 2 * !(enum { N = $2 / 2 - 1 };
++ 0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))];
+ test_array [0] = 0
+
+ ;
+@@ -1949,11 +1959,11 @@ if ac_fn_c_try_compile "$LINENO"; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+ $ac_includes_default
+- enum { N = $2 / 2 - 1 };
+ int
+ main ()
+ {
+-static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) -
1) * 2 + 1)
++static int test_array [1 - 2 * !(enum { N = $2 / 2 - 1 };
++ ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1)
+ < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))];
+ test_array [0] = 0
+
@@ -4739,7 +4749,7 @@ esac
$as_echo_n "checking LIBRARY... " >&6; }
if test -z "$LIBRARY"
@@ -79,7 +107,7 @@ diff -up ./configure.autotool-intermediates ./configure
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
;;
atheos*)
-@@ -5314,6 +5324,14 @@ $as_echo "no" >&6; }
+@@ -5318,6 +5328,14 @@ $as_echo "no" >&6; }
fi
@@ -94,7 +122,7 @@ diff -up ./configure.autotool-intermediates ./configure
# XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
# merged with this chunk of code?
-@@ -9326,6 +9344,50 @@ $as_echo "no" >&6; }
+@@ -9341,6 +9359,50 @@ $as_echo "no" >&6; }
fi
@@ -145,7 +173,7 @@ diff -up ./configure.autotool-intermediates ./configure
# Check for Python-specific malloc support
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-pymalloc"
>&5
$as_echo_n "checking for --with-pymalloc... " >&6; }
-@@ -9375,6 +9437,46 @@ fi
+@@ -9390,6 +9452,46 @@ fi
fi
@@ -193,8 +221,8 @@ diff -up ./configure.autotool-intermediates ./configure
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-wctype-functions"
>&5
$as_echo_n "checking for --with-wctype-functions... " >&6; }
diff -up ./pyconfig.h.in.autotool-intermediates ./pyconfig.h.in
---- ./pyconfig.h.in.autotool-intermediates 2010-07-08 13:12:59.970252469 -0400
-+++ ./pyconfig.h.in 2010-07-08 13:13:01.066127223 -0400
+--- ./pyconfig.h.in.autotool-intermediates 2010-12-23 16:14:04.396063268 -0500
++++ ./pyconfig.h.in 2010-12-23 16:14:06.242367491 -0500
@@ -18,6 +18,12 @@
/* Define this if you have BeOS threads. */
#undef BEOS_THREADS
@@ -208,7 +236,7 @@ diff -up ./pyconfig.h.in.autotool-intermediates ./pyconfig.h.in
/* Define if you have the Mach cthreads package */
#undef C_THREADS
-@@ -1098,12 +1104,6 @@
+@@ -1104,12 +1110,6 @@
/* Define to profile with the Pentium timestamp counter */
#undef WITH_TSC
diff --git a/python-2.7.1-config.patch b/python-2.7.1-config.patch
new file mode 100644
index 0000000..0bb790e
--- /dev/null
+++ b/python-2.7.1-config.patch
@@ -0,0 +1,281 @@
+diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dist
+--- Python-2.7.1/Modules/Setup.dist.rhconfig 2010-08-21 07:40:30.000000000 -0400
++++ Python-2.7.1/Modules/Setup.dist 2010-12-23 15:47:12.111059967 -0500
+@@ -153,7 +153,7 @@ GLHACK=-Dclear=__GLclear
+ # modules are to be built as shared libraries (see above for more
+ # detail; also note that *static* reverses this effect):
+
+-#*shared*
++*shared*
+
+ # GNU readline. Unlike previous Python incarnations, GNU readline is
+ # now incorporated in an optional module, configured in the Setup file
+@@ -163,73 +163,73 @@ GLHACK=-Dclear=__GLclear
+ # it, depending on your system -- see the GNU readline instructions.
+ # It's okay for this to be a shared library, too.
+
+-#readline readline.c -lreadline -ltermcap
++readline readline.c -lreadline -ltermcap
+
+
+ # Modules that should always be present (non UNIX dependent):
+
+-#array arraymodule.c # array objects
+-#cmath cmathmodule.c _math.c # -lm # complex math library functions
+-#math mathmodule.c _math.c # -lm # math library functions, e.g. sin()
+-#_struct _struct.c # binary structure packing/unpacking
+-#time timemodule.c # -lm # time operations and variables
+-#operator operator.c # operator.add() and similar goodies
+-#_testcapi _testcapimodule.c # Python C API test module
+-#_random _randommodule.c # Random number generator
+-#_collections _collectionsmodule.c # Container types
+-#itertools itertoolsmodule.c # Functions creating iterators for efficient looping
+-#strop stropmodule.c # String manipulations
+-#_functools _functoolsmodule.c # Tools for working with functions and callable objects
++array arraymodule.c # array objects
++cmath cmathmodule.c _math.c # -lm # complex math library functions
++math mathmodule.c _math.c # -lm # math library functions, e.g. sin()
++_struct _struct.c # binary structure packing/unpacking
++time timemodule.c # -lm # time operations and variables
++operator operator.c # operator.add() and similar goodies
++_testcapi _testcapimodule.c # Python C API test module
++_random _randommodule.c # Random number generator
++_collections _collectionsmodule.c # Container types
++itertools itertoolsmodule.c # Functions creating iterators for efficient looping
++strop stropmodule.c # String manipulations
++_functools _functoolsmodule.c # Tools for working with functions and callable objects
+ #_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI
_elementtree.c # elementtree accelerator
+ #_pickle _pickle.c # pickle accelerator
+ #datetime datetimemodule.c # date/time type
+-#_bisect _bisectmodule.c # Bisection algorithms
++_bisect _bisectmodule.c # Bisection algorithms
+
+-#unicodedata unicodedata.c # static Unicode character database
++unicodedata unicodedata.c # static Unicode character database
+
+ # access to ISO C locale support
+-#_locale _localemodule.c # -lintl
++_locale _localemodule.c # -lintl
+
+
+ # Modules with some UNIX dependencies -- on by default:
+ # (If you have a really backward UNIX, select and socket may not be
+ # supported...)
+
+-#fcntl fcntlmodule.c # fcntl(2) and ioctl(2)
+-#spwd spwdmodule.c # spwd(3)
+-#grp grpmodule.c # grp(3)
+-#select selectmodule.c # select(2); not on ancient System V
++fcntl fcntlmodule.c # fcntl(2) and ioctl(2)
++spwd spwdmodule.c # spwd(3)
++grp grpmodule.c # grp(3)
++select selectmodule.c # select(2); not on ancient System V
+
+ # Memory-mapped files (also works on Win32).
+-#mmap mmapmodule.c
++mmap mmapmodule.c
+
+ # CSV file helper
+-#_csv _csv.c
++_csv _csv.c
+
+ # Socket module helper for socket(2)
+-#_socket socketmodule.c
++_socket socketmodule.c
+
+ # Socket module helper for SSL support; you must comment out the other
+ # socket line above, and possibly edit the SSL variable:
+ #SSL=/usr/local/ssl
+-#_ssl _ssl.c \
+-# -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
+-# -L$(SSL)/lib -lssl -lcrypto
++_ssl _ssl.c \
++ -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
++ -L$(SSL)/lib -lssl -lcrypto
+
+ # The crypt module is now disabled by default because it breaks builds
+ # on many systems (where -lcrypt is needed), e.g. Linux (I believe).
+ #
+ # First, look at Setup.config; configure may have set this for you.
+
+-#crypt cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some systems
++crypt cryptmodule.c -lcrypt # crypt(3); needs -lcrypt on some systems
+
+
+ # Some more UNIX dependent modules -- off by default, since these
+ # are not supported by all UNIX systems:
+
+-#nis nismodule.c -lnsl # Sun yellow pages -- not everywhere
+-#termios termios.c # Steen Lumholt's termios module
+-#resource resource.c # Jeremy Hylton's rlimit interface
++nis nismodule.c -lnsl # Sun yellow pages -- not everywhere
++termios termios.c # Steen Lumholt's termios module
++resource resource.c # Jeremy Hylton's rlimit interface
+
+
+ # Multimedia modules -- off by default.
+@@ -237,8 +237,8 @@ GLHACK=-Dclear=__GLclear
+ # #993173 says audioop works on 64-bit platforms, though.
+ # These represent audio samples or images as strings:
+
+-#audioop audioop.c # Operations on audio samples
+-#imageop imageop.c # Operations on images
++audioop audioop.c # Operations on audio samples
++imageop imageop.c # Operations on images
+
+
+ # Note that the _md5 and _sha modules are normally only built if the
+@@ -248,14 +248,14 @@ GLHACK=-Dclear=__GLclear
+ # Message-Digest Algorithm, described in RFC 1321. The necessary files
+ # md5.c and md5.h are included here.
+
+-#_md5 md5module.c md5.c
++_md5 md5module.c md5.c
+
+
+ # The _sha module implements the SHA checksum algorithms.
+ # (NIST's Secure Hash Algorithms.)
+-#_sha shamodule.c
+-#_sha256 sha256module.c
+-#_sha512 sha512module.c
++_sha shamodule.c
++_sha256 sha256module.c
++_sha512 sha512module.c
+
+
+ # SGI IRIX specific modules -- off by default.
+@@ -302,12 +302,12 @@ GLHACK=-Dclear=__GLclear
+ # A Linux specific module -- off by default; this may also work on
+ # some *BSDs.
+
+-#linuxaudiodev linuxaudiodev.c
++linuxaudiodev linuxaudiodev.c
+
+
+ # George Neville-Neil's timing module:
+
+-#timing timingmodule.c
++timing timingmodule.c
+
+
+ # The _tkinter module.
+@@ -322,7 +322,7 @@ GLHACK=-Dclear=__GLclear
+ # every system.
+
+ # *** Always uncomment this (leave the leading underscore in!):
+-# _tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \
++_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \
+ # *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
+ # -L/usr/local/lib \
+ # *** Uncomment and edit to reflect where your Tcl/Tk headers are:
+@@ -332,7 +332,7 @@ GLHACK=-Dclear=__GLclear
+ # *** Or uncomment this for Solaris:
+ # -I/usr/openwin/include \
+ # *** Uncomment and edit for Tix extension only:
+-# -DWITH_TIX -ltix8.1.8.2 \
++ -DWITH_TIX -ltix \
+ # *** Uncomment and edit for BLT extension only:
+ # -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \
+ # *** Uncomment and edit for PIL (TkImaging) extension only:
+@@ -341,7 +341,7 @@ GLHACK=-Dclear=__GLclear
+ # *** Uncomment and edit for TOGL extension only:
+ # -DWITH_TOGL togl.c \
+ # *** Uncomment and edit to reflect your Tcl/Tk versions:
+-# -ltk8.2 -ltcl8.2 \
++ -ltk -ltcl \
+ # *** Uncomment and edit to reflect where your X11 libraries are:
+ # -L/usr/X11R6/lib \
+ # *** Or uncomment this for Solaris:
+@@ -351,7 +351,7 @@ GLHACK=-Dclear=__GLclear
+ # *** Uncomment for AIX:
+ # -lld \
+ # *** Always uncomment this; X11 libraries to link with:
+-# -lX11
++ -lX11
+
+ # Lance Ellinghaus's syslog module
+ #syslog syslogmodule.c # syslog daemon interface
+@@ -373,7 +373,7 @@ GLHACK=-Dclear=__GLclear
+ # it is a highly experimental and dangerous device for calling
+ # *arbitrary* C functions in *arbitrary* shared libraries:
+
+-#dl dlmodule.c
++dl dlmodule.c
+
+
+ # Modules that provide persistent dictionary-like semantics. You will
+@@ -396,7 +396,7 @@ GLHACK=-Dclear=__GLclear
+ #
+ # First, look at Setup.config; configure may have set this for you.
+
+-#gdbm gdbmmodule.c -I/usr/local/include -L/usr/local/lib -lgdbm
++gdbm gdbmmodule.c -lgdbm
+
+
+ # Sleepycat Berkeley DB interface.
+@@ -411,11 +411,10 @@ GLHACK=-Dclear=__GLclear
+ #
+ # Edit the variables DB and DBLIBVERto point to the db top directory
+ # and the subdirectory of PORT where you built it.
+-#DB=/usr/local/BerkeleyDB.4.0
+-#DBLIBVER=4.0
+-#DBINC=$(DB)/include
+-#DBLIB=$(DB)/lib
+-#_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
++DBLIBVER=4.7
++DBINC=/usr/include/db4
++DBLIB=/usr/lib
++_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
+
+ # Historical Berkeley DB 1.85
+ #
+@@ -430,14 +429,14 @@ GLHACK=-Dclear=__GLclear
+
+
+ # Helper module for various ascii-encoders
+-#binascii binascii.c
++binascii binascii.c
+
+ # Fred Drake's interface to the Python parser
+-#parser parsermodule.c
++parser parsermodule.c
+
+ # cStringIO and cPickle
+-#cStringIO cStringIO.c
+-#cPickle cPickle.c
++cStringIO cStringIO.c
++cPickle cPickle.c
+
+
+ # Lee Busby's SIGFPE modules.
+@@ -460,7 +459,7 @@ GLHACK=-Dclear=__GLclear
+ # Andrew Kuchling's zlib module.
+ # This require zlib 1.1.3 (or later).
+ # See
http://www.gzip.org/zlib/
+-#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
++zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
+
+ # Interface to the Expat XML parser
+ #
+@@ -479,14 +478,14 @@ GLHACK=-Dclear=__GLclear
+ # Hye-Shik Chang's CJKCodecs
+
+ # multibytecodec is required for all the other CJK codec modules
+-#_multibytecodec cjkcodecs/multibytecodec.c
++_multibytecodec cjkcodecs/multibytecodec.c
+
+-#_codecs_cn cjkcodecs/_codecs_cn.c
+-#_codecs_hk cjkcodecs/_codecs_hk.c
+-#_codecs_iso2022 cjkcodecs/_codecs_iso2022.c
+-#_codecs_jp cjkcodecs/_codecs_jp.c
+-#_codecs_kr cjkcodecs/_codecs_kr.c
+-#_codecs_tw cjkcodecs/_codecs_tw.c
++_codecs_cn cjkcodecs/_codecs_cn.c
++_codecs_hk cjkcodecs/_codecs_hk.c
++_codecs_iso2022 cjkcodecs/_codecs_iso2022.c
++_codecs_jp cjkcodecs/_codecs_jp.c
++_codecs_kr cjkcodecs/_codecs_kr.c
++_codecs_tw cjkcodecs/_codecs_tw.c
+
+ # Example -- included for reference only:
+ # xx xxmodule.c
diff --git a/python-2.7.1-fix_test_abc_with_COUNT_ALLOCS.patch
b/python-2.7.1-fix_test_abc_with_COUNT_ALLOCS.patch
new file mode 100644
index 0000000..bb38281
--- /dev/null
+++ b/python-2.7.1-fix_test_abc_with_COUNT_ALLOCS.patch
@@ -0,0 +1,27 @@
+diff -up Python-2.7.1/Lib/test/test_abc.py.cache_leak Python-2.7.1/Lib/test/test_abc.py
+--- Python-2.7.1/Lib/test/test_abc.py.cache_leak 2010-12-28 18:06:35.551938356 -0500
++++ Python-2.7.1/Lib/test/test_abc.py 2010-12-28 18:09:09.021059202 -0500
+@@ -3,6 +3,8 @@
+
+ """Unit tests for abc.py."""
+
++import sys
++
+ import unittest, weakref
+ from test import test_support
+
+@@ -229,8 +231,12 @@ class TestABC(unittest.TestCase):
+ # Trigger cache.
+ C().f()
+ del C
+- test_support.gc_collect()
+- self.assertEqual(r(), None)
++ # This doesn't work in our debug build, presumably due to its use
++ # of COUNT_ALLOCS, which makes heap-allocated types immortal (once
++ # they've ever had an instance):
++ if not hasattr(sys, 'getcounts'):
++ test_support.gc_collect()
++ self.assertEqual(r(), None)
+
+ def test_main():
+ test_support.run_unittest(TestABC)
diff --git a/python-2.7.1-lib64.patch b/python-2.7.1-lib64.patch
new file mode 100644
index 0000000..4b07470
--- /dev/null
+++ b/python-2.7.1-lib64.patch
@@ -0,0 +1,199 @@
+diff -up Python-2.7.1/Lib/distutils/command/install.py.lib64
Python-2.7.1/Lib/distutils/command/install.py
+--- Python-2.7.1/Lib/distutils/command/install.py.lib64 2010-05-05 15:09:31.000000000
-0400
++++ Python-2.7.1/Lib/distutils/command/install.py 2010-12-23 15:51:19.422062062 -0500
+@@ -42,14 +42,14 @@ else:
+ INSTALL_SCHEMES = {
+ 'unix_prefix': {
+ 'purelib': '$base/lib/python$py_version_short/site-packages',
+- 'platlib':
'$platbase/lib/python$py_version_short/site-packages',
++ 'platlib':
'$platbase/lib64/python$py_version_short/site-packages',
+ 'headers': '$base/include/python$py_version_short/$dist_name',
+ 'scripts': '$base/bin',
+ 'data' : '$base',
+ },
+ 'unix_home': {
+ 'purelib': '$base/lib/python',
+- 'platlib': '$base/lib/python',
++ 'platlib': '$base/lib64/python',
+ 'headers': '$base/include/python/$dist_name',
+ 'scripts': '$base/bin',
+ 'data' : '$base',
+diff -up Python-2.7.1/Lib/distutils/sysconfig.py.lib64
Python-2.7.1/Lib/distutils/sysconfig.py
+--- Python-2.7.1/Lib/distutils/sysconfig.py.lib64 2010-11-06 10:16:30.000000000 -0400
++++ Python-2.7.1/Lib/distutils/sysconfig.py 2010-12-23 15:51:19.423063652 -0500
+@@ -114,8 +114,12 @@ def get_python_lib(plat_specific=0, stan
+ prefix = plat_specific and EXEC_PREFIX or PREFIX
+
+ if os.name == "posix":
++ if plat_specific or standard_lib:
++ lib = "lib64"
++ else:
++ lib = "lib"
+ libpython = os.path.join(prefix,
+- "lib", "python" +
get_python_version())
++ lib, "python" + get_python_version())
+ if standard_lib:
+ return libpython
+ else:
+diff -up Python-2.7.1/Lib/site.py.lib64 Python-2.7.1/Lib/site.py
+--- Python-2.7.1/Lib/site.py.lib64 2010-10-12 18:53:51.000000000 -0400
++++ Python-2.7.1/Lib/site.py 2010-12-23 15:51:19.424063606 -0500
+@@ -290,12 +290,16 @@ def getsitepackages():
+ if sys.platform in ('os2emx', 'riscos'):
+ sitepackages.append(os.path.join(prefix, "Lib",
"site-packages"))
+ elif os.sep == '/':
++ sitepackages.append(os.path.join(prefix, "lib64",
++ "python" + sys.version[:3],
++ "site-packages"))
+ sitepackages.append(os.path.join(prefix, "lib",
+ "python" + sys.version[:3],
+ "site-packages"))
+ sitepackages.append(os.path.join(prefix, "lib",
"site-python"))
+ else:
+ sitepackages.append(prefix)
++ sitepackages.append(os.path.join(prefix, "lib64",
"site-packages"))
+ sitepackages.append(os.path.join(prefix, "lib",
"site-packages"))
+ if sys.platform == "darwin":
+ # for framework builds *only* we add the standard Apple
+diff -up Python-2.7.1/Lib/test/test_site.py.lib64 Python-2.7.1/Lib/test/test_site.py
+--- Python-2.7.1/Lib/test/test_site.py.lib64 2010-11-21 08:34:58.000000000 -0500
++++ Python-2.7.1/Lib/test/test_site.py 2010-12-23 15:55:19.782935931 -0500
+@@ -169,17 +169,20 @@ class HelperFunctionsTests(unittest.Test
+ wanted = os.path.join('xoxo', 'Lib',
'site-packages')
+ self.assertEqual(dirs[0], wanted)
+ elif os.sep == '/':
+- self.assertEqual(len(dirs), 2)
++ self.assertEquals(len(dirs), 3)
++ wanted = os.path.join('xoxo', 'lib64', 'python' +
sys.version[:3],
++ 'site-packages')
++ self.assertEquals(dirs[0], wanted)
+ wanted = os.path.join('xoxo', 'lib', 'python' +
sys.version[:3],
+ 'site-packages')
+- self.assertEqual(dirs[0], wanted)
++ self.assertEquals(dirs[1], wanted)
+ wanted = os.path.join('xoxo', 'lib', 'site-python')
+- self.assertEqual(dirs[1], wanted)
++ self.assertEquals(dirs[2], wanted)
+ else:
+- self.assertEqual(len(dirs), 2)
+- self.assertEqual(dirs[0], 'xoxo')
+- wanted = os.path.join('xoxo', 'lib',
'site-packages')
+- self.assertEqual(dirs[1], wanted)
++ self.assertEquals(len(dirs), 2)
++ self.assertEquals(dirs[0], 'xoxo')
++ wanted = os.path.join('xoxo', 'lib64',
'site-packages')
++ self.assertEquals(dirs[1], wanted)
+
+ # let's try the specific Apple location
+ if (sys.platform == "darwin" and
+diff -up Python-2.7.1/Makefile.pre.in.lib64 Python-2.7.1/Makefile.pre.in
+--- Python-2.7.1/Makefile.pre.in.lib64 2010-12-23 15:51:19.407063264 -0500
++++ Python-2.7.1/Makefile.pre.in 2010-12-23 15:51:19.426063917 -0500
+@@ -94,7 +94,7 @@ LIBDIR= @libdir@
+ MANDIR= @mandir@
+ INCLUDEDIR= @includedir@
+ CONFINCLUDEDIR= $(exec_prefix)/include
+-SCRIPTDIR= $(prefix)/lib
++SCRIPTDIR= $(prefix)/lib64
+
+ # Detailed destination directories
+ BINLIBDEST= $(LIBDIR)/python$(VERSION)
+diff -up Python-2.7.1/Modules/getpath.c.lib64 Python-2.7.1/Modules/getpath.c
+--- Python-2.7.1/Modules/getpath.c.lib64 2010-10-07 19:37:08.000000000 -0400
++++ Python-2.7.1/Modules/getpath.c 2010-12-23 15:51:19.427063291 -0500
+@@ -117,8 +117,8 @@
+ #endif
+
+ #ifndef PYTHONPATH
+-#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
+- EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
++#define PYTHONPATH PREFIX "/lib64/python" VERSION ":" \
++ EXEC_PREFIX "/lib64/python" VERSION "/lib-dynload"
+ #endif
+
+ #ifndef LANDMARK
+@@ -129,7 +129,7 @@ static char prefix[MAXPATHLEN+1];
+ static char exec_prefix[MAXPATHLEN+1];
+ static char progpath[MAXPATHLEN+1];
+ static char *module_search_path = NULL;
+-static char lib_python[] = "lib/python" VERSION;
++static char lib_python[] = "lib64/python" VERSION;
+
+ static void
+ reduce(char *dir)
+@@ -528,7 +528,7 @@ calculate_path(void)
+ }
+ else
+ strncpy(zip_path, PREFIX, MAXPATHLEN);
+- joinpath(zip_path, "lib/python00.zip");
++ joinpath(zip_path, "lib64/python00.zip");
+ bufsz = strlen(zip_path); /* Replace "00" with version */
+ zip_path[bufsz - 6] = VERSION[0];
+ zip_path[bufsz - 5] = VERSION[2];
+@@ -538,7 +538,7 @@ calculate_path(void)
+ fprintf(stderr,
+ "Could not find platform dependent libraries
<exec_prefix>\n");
+ strncpy(exec_prefix, EXEC_PREFIX, MAXPATHLEN);
+- joinpath(exec_prefix, "lib/lib-dynload");
++ joinpath(exec_prefix, "lib64/lib-dynload");
+ }
+ /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */
+
+diff -up Python-2.7.1/Modules/Setup.dist.lib64 Python-2.7.1/Modules/Setup.dist
+--- Python-2.7.1/Modules/Setup.dist.lib64 2010-12-23 15:51:19.400104130 -0500
++++ Python-2.7.1/Modules/Setup.dist 2010-12-23 15:51:19.427063291 -0500
+@@ -413,7 +413,7 @@ gdbm gdbmmodule.c -lgdbm
+ # and the subdirectory of PORT where you built it.
+ DBLIBVER=4.7
+ DBINC=/usr/include/db4
+-DBLIB=/usr/lib
++DBLIB=/usr/lib64
+ _bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
+
+ # Historical Berkeley DB 1.85
+@@ -459,7 +459,7 @@ cPickle cPickle.c
+ # Andrew Kuchling's zlib module.
+ # This require zlib 1.1.3 (or later).
+ # See
http://www.gzip.org/zlib/
+-zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
++zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib64 -lz
+
+ # Interface to the Expat XML parser
+ #
+diff -up Python-2.7.1/setup.py.lib64 Python-2.7.1/setup.py
+--- Python-2.7.1/setup.py.lib64 2010-10-31 12:40:21.000000000 -0400
++++ Python-2.7.1/setup.py 2010-12-23 15:51:19.428064129 -0500
+@@ -347,7 +347,7 @@ class PyBuildExt(build_ext):
+
+ def detect_modules(self):
+ # Ensure that /usr/local is always used
+- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
++ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib64')
+ add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+
+ # Add paths specified in the environment variables LDFLAGS and
+@@ -654,11 +654,11 @@ class PyBuildExt(build_ext):
+ elif curses_library:
+ readline_libs.append(curses_library)
+ elif self.compiler.find_library_file(lib_dirs +
+- ['/usr/lib/termcap'],
++ ['/usr/lib64/termcap'],
+ 'termcap'):
+ readline_libs.append('termcap')
+ exts.append( Extension('readline', ['readline.c'],
+- library_dirs=['/usr/lib/termcap'],
++ library_dirs=['/usr/lib64/termcap'],
+ extra_link_args=readline_extra_link_args,
+ libraries=readline_libs) )
+ else:
+@@ -692,8 +692,8 @@ class PyBuildExt(build_ext):
+ if krb5_h:
+ ssl_incs += krb5_h
+ ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
+- ['/usr/local/ssl/lib',
+- '/usr/contrib/ssl/lib/'
++ ['/usr/local/ssl/lib64',
++ '/usr/contrib/ssl/lib64/'
+ ] )
+
+ if (ssl_incs is not None and
diff --git a/python-2.7rc1-config.patch b/python-2.7rc1-config.patch
deleted file mode 100644
index a858305..0000000
--- a/python-2.7rc1-config.patch
+++ /dev/null
@@ -1,283 +0,0 @@
-diff -up Python-2.7rc1/Modules/Setup.dist.rhconfig Python-2.7rc1/Modules/Setup.dist
---- Python-2.7rc1/Modules/Setup.dist.rhconfig 2009-12-21 10:22:00.000000000 -0500
-+++ Python-2.7rc1/Modules/Setup.dist 2010-06-05 23:51:30.579225134 -0400
-@@ -152,7 +152,7 @@ GLHACK=-Dclear=__GLclear
- # modules are to be built as shared libraries (see above for more
- # detail; also note that *static* reverses this effect):
-
--#*shared*
-+*shared*
-
- # GNU readline. Unlike previous Python incarnations, GNU readline is
- # now incorporated in an optional module, configured in the Setup file
-@@ -162,74 +162,74 @@ GLHACK=-Dclear=__GLclear
- # it, depending on your system -- see the GNU readline instructions.
- # It's okay for this to be a shared library, too.
-
--#readline readline.c -lreadline -ltermcap
-+readline readline.c -lreadline -ltermcap
-
-
- # Modules that should always be present (non UNIX dependent):
-
--#array arraymodule.c # array objects
--#cmath cmathmodule.c _math.c # -lm # complex math library functions
--#math mathmodule.c _math.c # -lm # math library functions, e.g. sin()
--#_struct _struct.c # binary structure packing/unpacking
--#time timemodule.c # -lm # time operations and variables
--#operator operator.c # operator.add() and similar goodies
--#_weakref _weakref.c # basic weak reference support
--#_testcapi _testcapimodule.c # Python C API test module
--#_random _randommodule.c # Random number generator
--#_collections _collectionsmodule.c # Container types
--#itertools itertoolsmodule.c # Functions creating iterators for efficient looping
--#strop stropmodule.c # String manipulations
--#_functools _functoolsmodule.c # Tools for working with functions and callable objects
-+array arraymodule.c # array objects
-+cmath cmathmodule.c _math.c # -lm # complex math library functions
-+math mathmodule.c _math.c # -lm # math library functions, e.g. sin()
-+_struct _struct.c # binary structure packing/unpacking
-+time timemodule.c # -lm # time operations and variables
-+operator operator.c # operator.add() and similar goodies
-+_weakref _weakref.c # basic weak reference support
-+_testcapi _testcapimodule.c # Python C API test module
-+_random _randommodule.c # Random number generator
-+_collections _collectionsmodule.c # Container types
-+itertools itertoolsmodule.c # Functions creating iterators for efficient looping
-+strop stropmodule.c # String manipulations
-+_functools _functoolsmodule.c # Tools for working with functions and callable objects
- #_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI
_elementtree.c # elementtree accelerator
- #_pickle _pickle.c # pickle accelerator
- #datetime datetimemodule.c # date/time type
--#_bisect _bisectmodule.c # Bisection algorithms
-+_bisect _bisectmodule.c # Bisection algorithms
-
--#unicodedata unicodedata.c # static Unicode character database
-+unicodedata unicodedata.c # static Unicode character database
-
- # access to ISO C locale support
--#_locale _localemodule.c # -lintl
-+_locale _localemodule.c # -lintl
-
-
- # Modules with some UNIX dependencies -- on by default:
- # (If you have a really backward UNIX, select and socket may not be
- # supported...)
-
--#fcntl fcntlmodule.c # fcntl(2) and ioctl(2)
--#spwd spwdmodule.c # spwd(3)
--#grp grpmodule.c # grp(3)
--#select selectmodule.c # select(2); not on ancient System V
-+fcntl fcntlmodule.c # fcntl(2) and ioctl(2)
-+spwd spwdmodule.c # spwd(3)
-+grp grpmodule.c # grp(3)
-+select selectmodule.c # select(2); not on ancient System V
-
- # Memory-mapped files (also works on Win32).
--#mmap mmapmodule.c
-+mmap mmapmodule.c
-
- # CSV file helper
--#_csv _csv.c
-+_csv _csv.c
-
- # Socket module helper for socket(2)
--#_socket socketmodule.c
-+_socket socketmodule.c
-
- # Socket module helper for SSL support; you must comment out the other
- # socket line above, and possibly edit the SSL variable:
- #SSL=/usr/local/ssl
--#_ssl _ssl.c \
--# -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
--# -L$(SSL)/lib -lssl -lcrypto
-+_ssl _ssl.c \
-+ -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-+ -L$(SSL)/lib -lssl -lcrypto
-
- # The crypt module is now disabled by default because it breaks builds
- # on many systems (where -lcrypt is needed), e.g. Linux (I believe).
- #
- # First, look at Setup.config; configure may have set this for you.
-
--#crypt cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some systems
-+crypt cryptmodule.c -lcrypt # crypt(3); needs -lcrypt on some systems
-
-
- # Some more UNIX dependent modules -- off by default, since these
- # are not supported by all UNIX systems:
-
--#nis nismodule.c -lnsl # Sun yellow pages -- not everywhere
--#termios termios.c # Steen Lumholt's termios module
--#resource resource.c # Jeremy Hylton's rlimit interface
-+nis nismodule.c -lnsl # Sun yellow pages -- not everywhere
-+termios termios.c # Steen Lumholt's termios module
-+resource resource.c # Jeremy Hylton's rlimit interface
-
-
- # Multimedia modules -- off by default.
-@@ -237,8 +237,8 @@ GLHACK=-Dclear=__GLclear
- # #993173 says audioop works on 64-bit platforms, though.
- # These represent audio samples or images as strings:
-
--#audioop audioop.c # Operations on audio samples
--#imageop imageop.c # Operations on images
-+audioop audioop.c # Operations on audio samples
-+imageop imageop.c # Operations on images
-
-
- # Note that the _md5 and _sha modules are normally only built if the
-@@ -248,14 +248,14 @@ GLHACK=-Dclear=__GLclear
- # Message-Digest Algorithm, described in RFC 1321. The necessary files
- # md5.c and md5.h are included here.
-
--#_md5 md5module.c md5.c
-+_md5 md5module.c md5.c
-
-
- # The _sha module implements the SHA checksum algorithms.
- # (NIST's Secure Hash Algorithms.)
--#_sha shamodule.c
--#_sha256 sha256module.c
--#_sha512 sha512module.c
-+_sha shamodule.c
-+_sha256 sha256module.c
-+_sha512 sha512module.c
-
-
- # SGI IRIX specific modules -- off by default.
-@@ -302,12 +302,12 @@ GLHACK=-Dclear=__GLclear
- # A Linux specific module -- off by default; this may also work on
- # some *BSDs.
-
--#linuxaudiodev linuxaudiodev.c
-+linuxaudiodev linuxaudiodev.c
-
-
- # George Neville-Neil's timing module:
-
--#timing timingmodule.c
-+timing timingmodule.c
-
-
- # The _tkinter module.
-@@ -322,7 +322,7 @@ GLHACK=-Dclear=__GLclear
- # every system.
-
- # *** Always uncomment this (leave the leading underscore in!):
--# _tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \
-+_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \
- # *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
- # -L/usr/local/lib \
- # *** Uncomment and edit to reflect where your Tcl/Tk headers are:
-@@ -332,7 +332,7 @@ GLHACK=-Dclear=__GLclear
- # *** Or uncomment this for Solaris:
- # -I/usr/openwin/include \
- # *** Uncomment and edit for Tix extension only:
--# -DWITH_TIX -ltix8.1.8.2 \
-+ -DWITH_TIX -ltix \
- # *** Uncomment and edit for BLT extension only:
- # -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \
- # *** Uncomment and edit for PIL (TkImaging) extension only:
-@@ -341,7 +341,7 @@ GLHACK=-Dclear=__GLclear
- # *** Uncomment and edit for TOGL extension only:
- # -DWITH_TOGL togl.c \
- # *** Uncomment and edit to reflect your Tcl/Tk versions:
--# -ltk8.2 -ltcl8.2 \
-+ -ltk -ltcl \
- # *** Uncomment and edit to reflect where your X11 libraries are:
- # -L/usr/X11R6/lib \
- # *** Or uncomment this for Solaris:
-@@ -351,7 +351,7 @@ GLHACK=-Dclear=__GLclear
- # *** Uncomment for AIX:
- # -lld \
- # *** Always uncomment this; X11 libraries to link with:
--# -lX11
-+ -lX11
-
- # Lance Ellinghaus's syslog module
- #syslog syslogmodule.c # syslog daemon interface
-@@ -373,7 +373,7 @@ GLHACK=-Dclear=__GLclear
- # it is a highly experimental and dangerous device for calling
- # *arbitrary* C functions in *arbitrary* shared libraries:
-
--#dl dlmodule.c
-+dl dlmodule.c
-
-
- # Modules that provide persistent dictionary-like semantics. You will
-@@ -396,7 +396,7 @@ GLHACK=-Dclear=__GLclear
- #
- # First, look at Setup.config; configure may have set this for you.
-
--#gdbm gdbmmodule.c -I/usr/local/include -L/usr/local/lib -lgdbm
-+gdbm gdbmmodule.c -lgdbm
-
-
- # Sleepycat Berkeley DB interface.
-@@ -411,11 +411,10 @@ GLHACK=-Dclear=__GLclear
- #
- # Edit the variables DB and DBLIBVERto point to the db top directory
- # and the subdirectory of PORT where you built it.
--#DB=/usr/local/BerkeleyDB.4.0
--#DBLIBVER=4.0
--#DBINC=$(DB)/include
--#DBLIB=$(DB)/lib
--#_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
-+DBLIBVER=4.7
-+DBINC=/usr/include/db4
-+DBLIB=/usr/lib
-+_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
-
- # Historical Berkeley DB 1.85
- #
-@@ -430,14 +429,14 @@ GLHACK=-Dclear=__GLclear
-
-
- # Helper module for various ascii-encoders
--#binascii binascii.c
-+binascii binascii.c
-
- # Fred Drake's interface to the Python parser
--#parser parsermodule.c
-+parser parsermodule.c
-
- # cStringIO and cPickle
--#cStringIO cStringIO.c
--#cPickle cPickle.c
-+cStringIO cStringIO.c
-+cPickle cPickle.c
-
-
- # Lee Busby's SIGFPE modules.
-@@ -460,7 +459,7 @@ GLHACK=-Dclear=__GLclear
- # Andrew Kuchling's zlib module.
- # This require zlib 1.1.3 (or later).
- # See
http://www.gzip.org/zlib/
--#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
-+zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
-
- # Interface to the Expat XML parser
- #
-@@ -479,14 +478,14 @@ GLHACK=-Dclear=__GLclear
- # Hye-Shik Chang's CJKCodecs
-
- # multibytecodec is required for all the other CJK codec modules
--#_multibytecodec cjkcodecs/multibytecodec.c
-+_multibytecodec cjkcodecs/multibytecodec.c
-
--#_codecs_cn cjkcodecs/_codecs_cn.c
--#_codecs_hk cjkcodecs/_codecs_hk.c
--#_codecs_iso2022 cjkcodecs/_codecs_iso2022.c
--#_codecs_jp cjkcodecs/_codecs_jp.c
--#_codecs_kr cjkcodecs/_codecs_kr.c
--#_codecs_tw cjkcodecs/_codecs_tw.c
-+_codecs_cn cjkcodecs/_codecs_cn.c
-+_codecs_hk cjkcodecs/_codecs_hk.c
-+_codecs_iso2022 cjkcodecs/_codecs_iso2022.c
-+_codecs_jp cjkcodecs/_codecs_jp.c
-+_codecs_kr cjkcodecs/_codecs_kr.c
-+_codecs_tw cjkcodecs/_codecs_tw.c
-
- # Example -- included for reference only:
- # xx xxmodule.c
diff --git a/python-2.7rc1-lib64.patch b/python-2.7rc1-lib64.patch
deleted file mode 100644
index 78e7b93..0000000
--- a/python-2.7rc1-lib64.patch
+++ /dev/null
@@ -1,196 +0,0 @@
-diff -up Python-2.7/Lib/distutils/command/install.py.lib64
Python-2.7/Lib/distutils/command/install.py
---- Python-2.7/Lib/distutils/command/install.py.lib64 2010-05-05 15:09:31.000000000
-0400
-+++ Python-2.7/Lib/distutils/command/install.py 2010-08-16 15:49:49.998271662 -0400
-@@ -42,14 +42,14 @@ else:
- INSTALL_SCHEMES = {
- 'unix_prefix': {
- 'purelib': '$base/lib/python$py_version_short/site-packages',
-- 'platlib':
'$platbase/lib/python$py_version_short/site-packages',
-+ 'platlib':
'$platbase/lib64/python$py_version_short/site-packages',
- 'headers': '$base/include/python$py_version_short/$dist_name',
- 'scripts': '$base/bin',
- 'data' : '$base',
- },
- 'unix_home': {
- 'purelib': '$base/lib/python',
-- 'platlib': '$base/lib/python',
-+ 'platlib': '$base/lib64/python',
- 'headers': '$base/include/python/$dist_name',
- 'scripts': '$base/bin',
- 'data' : '$base',
-diff -up Python-2.7/Lib/distutils/sysconfig.py.lib64
Python-2.7/Lib/distutils/sysconfig.py
---- Python-2.7/Lib/distutils/sysconfig.py.lib64 2010-05-05 15:09:31.000000000 -0400
-+++ Python-2.7/Lib/distutils/sysconfig.py 2010-08-16 15:49:49.998271662 -0400
-@@ -114,8 +114,12 @@ def get_python_lib(plat_specific=0, stan
- prefix = plat_specific and EXEC_PREFIX or PREFIX
-
- if os.name == "posix":
-+ if plat_specific or standard_lib:
-+ lib = "lib64"
-+ else:
-+ lib = "lib"
- libpython = os.path.join(prefix,
-- "lib", "python" +
get_python_version())
-+ lib, "python" + get_python_version())
- if standard_lib:
- return libpython
- else:
-diff -up Python-2.7/Lib/site.py.lib64 Python-2.7/Lib/site.py
---- Python-2.7/Lib/site.py.lib64 2010-06-03 17:21:03.000000000 -0400
-+++ Python-2.7/Lib/site.py 2010-08-16 15:49:49.998271662 -0400
-@@ -286,12 +286,16 @@ def getsitepackages():
- if sys.platform in ('os2emx', 'riscos'):
- sitepackages.append(os.path.join(prefix, "Lib",
"site-packages"))
- elif os.sep == '/':
-+ sitepackages.append(os.path.join(prefix, "lib64",
-+ "python" + sys.version[:3],
-+ "site-packages"))
- sitepackages.append(os.path.join(prefix, "lib",
- "python" + sys.version[:3],
- "site-packages"))
- sitepackages.append(os.path.join(prefix, "lib",
"site-python"))
- else:
- sitepackages.append(prefix)
-+ sitepackages.append(os.path.join(prefix, "lib64",
"site-packages"))
- sitepackages.append(os.path.join(prefix, "lib",
"site-packages"))
- if sys.platform == "darwin":
- # for framework builds *only* we add the standard Apple
-diff -up Python-2.7/Lib/test/test_site.py.lib64 Python-2.7/Lib/test/test_site.py
---- Python-2.7/Lib/test/test_site.py.lib64 2010-08-16 15:49:56.149022511 -0400
-+++ Python-2.7/Lib/test/test_site.py 2010-08-16 15:49:58.268901184 -0400
-@@ -169,16 +169,19 @@ class HelperFunctionsTests(unittest.Test
- wanted = os.path.join('xoxo', 'Lib',
'site-packages')
- self.assertEquals(dirs[0], wanted)
- elif os.sep == '/':
-- self.assertTrue(len(dirs), 2)
-- wanted = os.path.join('xoxo', 'lib', 'python' +
sys.version[:3],
-+ self.assertEquals(len(dirs), 3)
-+ wanted = os.path.join('xoxo', 'lib64', 'python' +
sys.version[:3],
- 'site-packages')
- self.assertEquals(dirs[0], wanted)
-- wanted = os.path.join('xoxo', 'lib', 'site-python')
-+ wanted = os.path.join('xoxo', 'lib', 'python' +
sys.version[:3],
-+ 'site-packages')
- self.assertEquals(dirs[1], wanted)
-+ wanted = os.path.join('xoxo', 'lib', 'site-python')
-+ self.assertEquals(dirs[2], wanted)
- else:
-- self.assertTrue(len(dirs), 2)
-+ self.assertEquals(len(dirs), 2)
- self.assertEquals(dirs[0], 'xoxo')
-- wanted = os.path.join('xoxo', 'lib',
'site-packages')
-+ wanted = os.path.join('xoxo', 'lib64',
'site-packages')
- self.assertEquals(dirs[1], wanted)
-
- # let's try the specific Apple location
-diff -up Python-2.7/Makefile.pre.in.lib64 Python-2.7/Makefile.pre.in
---- Python-2.7/Makefile.pre.in.lib64 2010-08-16 15:49:49.992272080 -0400
-+++ Python-2.7/Makefile.pre.in 2010-08-16 15:49:49.999271826 -0400
-@@ -94,7 +94,7 @@ LIBDIR= @libdir@
- MANDIR= @mandir@
- INCLUDEDIR= @includedir@
- CONFINCLUDEDIR= $(exec_prefix)/include
--SCRIPTDIR= $(prefix)/lib
-+SCRIPTDIR= $(prefix)/lib64
-
- # Detailed destination directories
- BINLIBDEST= $(LIBDIR)/python$(VERSION)
-diff -up Python-2.7/Modules/getpath.c.lib64 Python-2.7/Modules/getpath.c
---- Python-2.7/Modules/getpath.c.lib64 2010-05-09 10:46:46.000000000 -0400
-+++ Python-2.7/Modules/getpath.c 2010-08-16 15:49:49.999271826 -0400
-@@ -117,8 +117,8 @@
- #endif
-
- #ifndef PYTHONPATH
--#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
-- EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
-+#define PYTHONPATH PREFIX "/lib64/python" VERSION ":" \
-+ EXEC_PREFIX "/lib64/python" VERSION "/lib-dynload"
- #endif
-
- #ifndef LANDMARK
-@@ -129,7 +129,7 @@ static char prefix[MAXPATHLEN+1];
- static char exec_prefix[MAXPATHLEN+1];
- static char progpath[MAXPATHLEN+1];
- static char *module_search_path = NULL;
--static char lib_python[] = "lib/python" VERSION;
-+static char lib_python[] = "lib64/python" VERSION;
-
- static void
- reduce(char *dir)
-@@ -524,7 +524,7 @@ calculate_path(void)
- }
- else
- strncpy(zip_path, PREFIX, MAXPATHLEN);
-- joinpath(zip_path, "lib/python00.zip");
-+ joinpath(zip_path, "lib64/python00.zip");
- bufsz = strlen(zip_path); /* Replace "00" with version */
- zip_path[bufsz - 6] = VERSION[0];
- zip_path[bufsz - 5] = VERSION[2];
-@@ -534,7 +534,7 @@ calculate_path(void)
- fprintf(stderr,
- "Could not find platform dependent libraries
<exec_prefix>\n");
- strncpy(exec_prefix, EXEC_PREFIX, MAXPATHLEN);
-- joinpath(exec_prefix, "lib/lib-dynload");
-+ joinpath(exec_prefix, "lib64/lib-dynload");
- }
- /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */
-
-diff -up Python-2.7/Modules/Setup.dist.lib64 Python-2.7/Modules/Setup.dist
---- Python-2.7/Modules/Setup.dist.lib64 2010-08-16 15:49:49.988272889 -0400
-+++ Python-2.7/Modules/Setup.dist 2010-08-16 15:49:49.999271826 -0400
-@@ -413,7 +413,7 @@ gdbm gdbmmodule.c -lgdbm
- # and the subdirectory of PORT where you built it.
- DBLIBVER=4.7
- DBINC=/usr/include/db4
--DBLIB=/usr/lib
-+DBLIB=/usr/lib64
- _bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
-
- # Historical Berkeley DB 1.85
-@@ -459,7 +459,7 @@ cPickle cPickle.c
- # Andrew Kuchling's zlib module.
- # This require zlib 1.1.3 (or later).
- # See
http://www.gzip.org/zlib/
--zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
-+zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib64 -lz
-
- # Interface to the Expat XML parser
- #
-diff -up Python-2.7/setup.py.lib64 Python-2.7/setup.py
---- Python-2.7/setup.py.lib64 2010-06-27 08:36:16.000000000 -0400
-+++ Python-2.7/setup.py 2010-08-16 15:49:50.000271774 -0400
-@@ -347,7 +347,7 @@ class PyBuildExt(build_ext):
-
- def detect_modules(self):
- # Ensure that /usr/local is always used
-- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
-+ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib64')
- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
-
- # Add paths specified in the environment variables LDFLAGS and
-@@ -643,11 +643,11 @@ class PyBuildExt(build_ext):
- elif curses_library:
- readline_libs.append(curses_library)
- elif self.compiler.find_library_file(lib_dirs +
-- ['/usr/lib/termcap'],
-+ ['/usr/lib64/termcap'],
- 'termcap'):
- readline_libs.append('termcap')
- exts.append( Extension('readline', ['readline.c'],
-- library_dirs=['/usr/lib/termcap'],
-+ library_dirs=['/usr/lib64/termcap'],
- extra_link_args=readline_extra_link_args,
- libraries=readline_libs) )
- else:
-@@ -681,8 +681,8 @@ class PyBuildExt(build_ext):
- if krb5_h:
- ssl_incs += krb5_h
- ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
-- ['/usr/local/ssl/lib',
-- '/usr/contrib/ssl/lib/'
-+ ['/usr/local/ssl/lib64',
-+ '/usr/contrib/ssl/lib64/'
- ] )
-
- if (ssl_incs is not None and
diff --git a/python.spec b/python.spec
index 3475d99..4bb13e1 100644
--- a/python.spec
+++ b/python.spec
@@ -93,8 +93,8 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
# Remember to also rebase python-docs when changing this:
-Version: 2.7
-Release: 12%{?dist}
+Version: 2.7.1
+Release: 1%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -188,7 +188,7 @@ Source5: pyfuntop.stp
# - _codecs_jp cjkcodecs/_codecs_jp.c
# - _codecs_kr cjkcodecs/_codecs_kr.c
# - _codecs_tw cjkcodecs/_codecs_tw.c
-Patch0: python-2.7rc1-config.patch
+Patch0: python-2.7.1-config.patch
# Removes the "-g" option from "pydoc", for some reason; I believe
# (dmalcolm 2010-01-29) that this was introduced in this change:
@@ -268,11 +268,6 @@ Patch54: python-2.6.4-setup-db48.patch
# for 2.7rc1 by dmalcolm:
Patch55: python-2.7rc1-dtrace.patch
-# Backported fix from upstream for regression in ConfigParse's handling
-# of None values
-#
http://bugs.python.org/issue7005#msg115417
-Patch56: python-2.7-r84443-cfgparse.patch
-
# "lib64 patches"
# This patch seems to be associated with bug 122304, which was
#
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=93184...
@@ -292,7 +287,7 @@ Patch101: python-2.3.4-lib64-regex.patch
# and add the /usr/lib64/pythonMAJOR.MINOR/site-packages to sitedirs, in front of
# /usr/lib/pythonMAJOR.MINOR/site-packages
# Not upstream
-Patch102: python-2.7rc1-lib64.patch
+Patch102: python-2.7.1-lib64.patch
# Python 2.7 split out much of the path-handling from distutils/sysconfig.py to
# a new sysconfig.py (in r77704).
@@ -300,19 +295,6 @@ Patch102: python-2.7rc1-lib64.patch
# and platform-specific code go to /usr/lib64 not /usr/lib, on 64-bit archs:
Patch103: python-2.7-lib64-sysconfig.patch
-# rhbz#488396: rework the ctypes module to use ffi_closure_alloc and
-# ffi_closure_free, rather than malloc_closure.c, since the latter tries to
-# mmap pages with PROT_READ | PROT_WRITE | PROT_EXEC, which SELinux frowns upon.
-#
-# Patch sent upstream as
http://bugs.python.org/issue5504 which also contains
-# a rebasing of the upstream copy of libffi to one containing the
-# memory-management hooks.
-#
-# This is the same as that patch, but without the rebasing of libffi
-# (since we use the system copy of libffi), and rebased against 2.7 (which
-# has had a whitespace cleanup):
-Patch110: python-2.7rc1-ctypes-noexecmem.patch
-
# Patch the Makefile.pre.in so that the generated Makefile doesn't try to build
# a libpythonMAJOR.MINOR.a (bug 550692):
Patch111: python-2.7rc1-no-static-lib.patch
@@ -393,11 +375,6 @@ Patch114: python-2.7rc1-statvfs-f_flag-constants.patch
# (rhbz:461419; patch sent upstream as
http://bugs.python.org/issue7425 )
Patch115: make-pydoc-more-robust-001.patch
-# Fix an incompatibility between pyexpat and the system expat-2.0.1 that led to
-# a segfault running test_pyexpat.py (rhbz:583931)
-# Sent upstream as
http://bugs.python.org/issue9054
-Patch119: python-2.6.5-fix-expat-issue9054.patch
-
# Upstream r79310 removed the "Modules" directory from sys.path when Python is
# running from the build directory on POSIX to fix a unit test (issue #8205).
# This seems to have broken the compileall.py done in "make install": it
cannot
@@ -420,11 +397,6 @@ Patch121: python-2.7rc2-r79310.patch
# Not yet sent upstream:
Patch122: python-2.7-fix-parallel-make.patch
-# Fix traceback in 2to3 on "from itertools import *"
-# This is
http://bugs.python.org/issue8892 (see also rhbz#600036)
-# Cherrypicked from r82530 upstream:
-Patch123: python-2.7-fix-2to3-itertools-import-star.patch
-
# test_commmands fails on SELinux systems due to a change in the output
# of "ls" (
http://bugs.python.org/issue7108)
Patch124: fix-test_commands-expected-ls-output-issue7108.patch
@@ -444,6 +416,12 @@ Patch126: fix-dbm_contains-on-64bit-bigendian.patch
# Sent upstream as
http://bugs.python.org/issue9960
Patch127: fix-test_structmember-on-64bit-bigendian.patch
+# 2.7.1 (in r84230) added a test to test_abc which fails if python is
+# configured with COUNT_ALLOCS, which is the case for our debug build
+# (the COUNT_ALLOCS instrumentation keeps "C" alive).
+# Not yet sent upstream
+Patch128: python-2.7.1-fix_test_abc_with_COUNT_ALLOCS.patch
+
# This is the generated patch to "configure"; see the description of
# %{regenerate_autotooling_patch}
# above:
@@ -672,10 +650,6 @@ rm -r Modules/zlib || exit 1
%patch55 -p1 -b .systemtap
%endif
-%patch56 -p0 -b .cfgparse
-
-%patch110 -p1 -b .selinux
-
%patch111 -p1 -b .no-static-lib
%patch112 -p1 -b .debug-build
@@ -686,16 +660,13 @@ rm -r Modules/zlib || exit 1
%patch115 -p0
-%patch119 -p0 -b .fix-expat-issue9054
%patch121 -p0 -R
%patch122 -p1 -b .fix-parallel-make
-pushd Lib
-%patch123 -p0
-popd
%patch124 -p1
%patch125 -p1 -b .less-verbose-COUNT_ALLOCS
%patch126 -p0 -b .fix-dbm_contains-on-64bit-bigendian
%patch127 -p0 -b .fix-test_structmember-on-64bit-bigendian
+%patch128 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -1356,7 +1327,6 @@ rm -fr %{buildroot}
%{dynload_dir}/_sqlite3.so
%{dynload_dir}/_ssl.so
%{dynload_dir}/_struct.so
-%{dynload_dir}/_weakref.so
%{dynload_dir}/arraymodule.so
%{dynload_dir}/audioop.so
%{dynload_dir}/binascii.so
@@ -1556,7 +1526,6 @@ rm -fr %{buildroot}
%{dynload_dir}/_sqlite3_d.so
%{dynload_dir}/_ssl_d.so
%{dynload_dir}/_struct_d.so
-%{dynload_dir}/_weakref_d.so
%{dynload_dir}/arraymodule_d.so
%{dynload_dir}/audioop_d.so
%{dynload_dir}/binascii_d.so
@@ -1642,6 +1611,13 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Thu Dec 23 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7.1-1
+- 2.7.1, reworking patch 0 (config), patch 102 (lib64); drop upstream
+patch 56 (cfgparse), patch 110 (ctypes/SELinux/noexecmem), patch 119 (expat
+compat), patch 123 (2to3 on "from itertools import *")
+- fix test_abc's test_cache_leak in the debug build (patch 128)
+- drop _weakref.so from manifest (_weakref became a core module in r84230)
+
* Mon Sep 27 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-12
- fix test_structmember on 64bit-bigendian (patch 127)
commit fdfb460a8568f449cb8599b6c757193e47e6e3e2
Author: Jesse Keating <jkeating(a)redhat.com>
Date: Wed Sep 29 15:08:20 2010 -0700
- Rebuilt for gcc bug 634757
diff --git a/python.spec b/python.spec
index 3475d99..e624318 100644
--- a/python.spec
+++ b/python.spec
@@ -94,7 +94,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7
-Release: 12%{?dist}
+Release: 13%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -1642,6 +1642,9 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Wed Sep 29 2010 jkeating - 2.7-13
+- Rebuilt for gcc bug 634757
+
* Mon Sep 27 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-12
- fix test_structmember on 64bit-bigendian (patch 127)
commit edea14de2e6680db5955892913044b19c131a311
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Mon Sep 27 13:44:59 2010 -0400
fix test_structmember on 64bit-bigendian (patch 127)
diff --git a/fix-test_structmember-on-64bit-bigendian.patch
b/fix-test_structmember-on-64bit-bigendian.patch
new file mode 100644
index 0000000..a250dea
--- /dev/null
+++ b/fix-test_structmember-on-64bit-bigendian.patch
@@ -0,0 +1,21 @@
+Index: Modules/_testcapimodule.c
+===================================================================
+--- Modules/_testcapimodule.c (revision 85001)
++++ Modules/_testcapimodule.c (working copy)
+@@ -5,6 +5,7 @@
+ * standard Python regression test, via Lib/test/test_capi.py.
+ */
+
++#define PY_SSIZE_T_CLEAN
+ #include "Python.h"
+ #include <float.h>
+ #include "structmember.h"
+@@ -593,7 +594,7 @@
+ {
+ PyObject *tuple, *obj;
+ Py_UNICODE *value;
+- int len;
++ Py_ssize_t len;
+
+ /* issue4122: Undefined reference to _Py_ascii_whitespace on Windows */
+ /* Just use the macro and check that it compiles */
diff --git a/python.spec b/python.spec
index e54d1ad..3475d99 100644
--- a/python.spec
+++ b/python.spec
@@ -94,7 +94,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7
-Release: 11%{?dist}
+Release: 12%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -440,6 +440,10 @@ Patch125: less-verbose-COUNT_ALLOCS.patch
# Sent upstream as
http://bugs.python.org/issue9687 (rhbz#626756)
Patch126: fix-dbm_contains-on-64bit-bigendian.patch
+# Fix test_structmember on big-endian 64-bit
+# Sent upstream as
http://bugs.python.org/issue9960
+Patch127: fix-test_structmember-on-64bit-bigendian.patch
+
# This is the generated patch to "configure"; see the description of
# %{regenerate_autotooling_patch}
# above:
@@ -691,6 +695,7 @@ popd
%patch124 -p1
%patch125 -p1 -b .less-verbose-COUNT_ALLOCS
%patch126 -p0 -b .fix-dbm_contains-on-64bit-bigendian
+%patch127 -p0 -b .fix-test_structmember-on-64bit-bigendian
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -1637,6 +1642,9 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Mon Sep 27 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-12
+- fix test_structmember on 64bit-bigendian (patch 127)
+
* Fri Sep 24 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-11
- fix dbm_contains on 64bit-bigendian (patch 126; rhbz#626756)
commit e8c4a5d5d2828c105ba45e358503bbbf5130d241
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Fri Sep 24 19:09:23 2010 -0400
fix dbm_contains on 64bit-bigendian (patch 126; rhbz#626756)
diff --git a/fix-dbm_contains-on-64bit-bigendian.patch
b/fix-dbm_contains-on-64bit-bigendian.patch
new file mode 100644
index 0000000..e9ed979
--- /dev/null
+++ b/fix-dbm_contains-on-64bit-bigendian.patch
@@ -0,0 +1,25 @@
+Index: Modules/dbmmodule.c
+===================================================================
+--- Modules/dbmmodule.c (revision 84317)
++++ Modules/dbmmodule.c (working copy)
+@@ -168,12 +168,18 @@
+ dbm_contains(register dbmobject *dp, PyObject *v)
+ {
+ datum key, val;
++ Py_ssize_t dsize;
+
+- if (PyString_AsStringAndSize(v, (char **)&key.dptr,
+- (Py_ssize_t *)&key.dsize)) {
++ if (PyString_AsStringAndSize(v, (char **)&key.dptr, &dsize)) {
+ return -1;
+ }
+
++ /* Coerce from Py_ssize_t down to int: */
++ if (dsize > INT_MAX) {
++ return -1;
++ }
++ key.dsize = dsize;
++
+ /* Expand check_dbmobject_open to return -1 */
+ if (dp->di_dbm == NULL) {
+ PyErr_SetString(DbmError, "DBM object has already been closed");
diff --git a/python.spec b/python.spec
index e10de18..e54d1ad 100644
--- a/python.spec
+++ b/python.spec
@@ -94,7 +94,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7
-Release: 10%{?dist}
+Release: 11%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -436,6 +436,10 @@ Patch124: fix-test_commands-expected-ls-output-issue7108.patch
# Not yet sent upstream:
Patch125: less-verbose-COUNT_ALLOCS.patch
+# Fix dbm module on big-endian 64-bit
+# Sent upstream as
http://bugs.python.org/issue9687 (rhbz#626756)
+Patch126: fix-dbm_contains-on-64bit-bigendian.patch
+
# This is the generated patch to "configure"; see the description of
# %{regenerate_autotooling_patch}
# above:
@@ -686,6 +690,7 @@ pushd Lib
popd
%patch124 -p1
%patch125 -p1 -b .less-verbose-COUNT_ALLOCS
+%patch126 -p0 -b .fix-dbm_contains-on-64bit-bigendian
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -1632,6 +1637,9 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Fri Sep 24 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-11
+- fix dbm_contains on 64bit-bigendian (patch 126; rhbz#626756)
+
* Thu Sep 16 2010 Toshio Kuratomi <toshio(a)fedoraproject.org> - 2.7-10
- backport a patch to fix a change in behaviour in configparse.
commit 7211207a678128bf904a9588aabd4c5c7999d18a
Author: Toshio Kuratomi <toshio(a)fedoraproject.org>
Date: Thu Sep 16 13:42:05 2010 -0400
- backport a patch to fix a change in behaviour in configparse.
diff --git a/python-2.7-r84443-cfgparse.patch b/python-2.7-r84443-cfgparse.patch
new file mode 100644
index 0000000..eed6e5f
--- /dev/null
+++ b/python-2.7-r84443-cfgparse.patch
@@ -0,0 +1,66 @@
+Index: Lib/ConfigParser.py
+===================================================================
+--- Lib/ConfigParser.py.orig
++++ Lib/ConfigParser.py
+@@ -399,11 +399,10 @@ class RawConfigParser:
+ fp.write("[%s]\n" % section)
+ for (key, value) in self._sections[section].items():
+ if key != "__name__":
+- if value is None:
+- fp.write("%s\n" % (key))
+- else:
+- fp.write("%s = %s\n" %
+- (key, str(value).replace('\n',
'\n\t')))
++ if (value is not None) or (self._optcre == self.OPTCRE):
++ key = " = ".join((key,
str(value).replace('\n', '\n\t')))
++ fp.write("%s\n" % (key))
++
+ fp.write("\n")
+
+ def remove_option(self, section, option):
+Index: Lib/test/test_cfgparser.py
+===================================================================
+--- Lib/test/test_cfgparser.py.orig
++++ Lib/test/test_cfgparser.py
+@@ -493,6 +493,33 @@ class SafeConfigParserTestCaseNoValue(Sa
+ allow_no_value = True
+
+
++class Issue7005TestCase(unittest.TestCase):
++ """Test output when None is set() as a value and allow_no_value ==
False.
++
++
http://bugs.python.org/issue7005
++
++ """
++
++ expected_output = "[section]\noption = None\n\n"
++
++ def prepare(self, config_class):
++ # This is the default, but that's the point.
++ cp = config_class(allow_no_value=False)
++ cp.add_section("section")
++ cp.set("section", "option", None)
++ sio = StringIO.StringIO()
++ cp.write(sio)
++ return sio.getvalue()
++
++ def test_none_as_value_stringified(self):
++ output = self.prepare(ConfigParser.ConfigParser)
++ self.assertEqual(output, self.expected_output)
++
++ def test_none_as_value_stringified_raw(self):
++ output = self.prepare(ConfigParser.RawConfigParser)
++ self.assertEqual(output, self.expected_output)
++
++
+ class SortedTestCase(RawConfigParserTestCase):
+ def newconfig(self, defaults=None):
+ self.cf = self.config_class(defaults=defaults, dict_type=SortedDict)
+@@ -524,6 +551,7 @@ def test_main():
+ RawConfigParserTestCase,
+ SafeConfigParserTestCase,
+ SortedTestCase,
++ Issue7005TestCase,
+ SafeConfigParserTestCaseNoValue,
+ )
+
diff --git a/python.spec b/python.spec
index 40f4c79..e10de18 100644
--- a/python.spec
+++ b/python.spec
@@ -94,7 +94,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7
-Release: 9%{?dist}
+Release: 10%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@@ -268,6 +268,11 @@ Patch54: python-2.6.4-setup-db48.patch
# for 2.7rc1 by dmalcolm:
Patch55: python-2.7rc1-dtrace.patch
+# Backported fix from upstream for regression in ConfigParse's handling
+# of None values
+#
http://bugs.python.org/issue7005#msg115417
+Patch56: python-2.7-r84443-cfgparse.patch
+
# "lib64 patches"
# This patch seems to be associated with bug 122304, which was
#
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=93184...
@@ -659,6 +664,8 @@ rm -r Modules/zlib || exit 1
%patch55 -p1 -b .systemtap
%endif
+%patch56 -p0 -b .cfgparse
+
%patch110 -p1 -b .selinux
%patch111 -p1 -b .no-static-lib
@@ -1625,6 +1632,9 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Thu Sep 16 2010 Toshio Kuratomi <toshio(a)fedoraproject.org> - 2.7-10
+- backport a patch to fix a change in behaviour in configparse.
+
* Thu Sep 9 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-9
- move most of the payload of the core package to the libs subpackage, given
that the libs aren't meaningfully usable without the standard libraries
commit 2ec5b35c5f46414d8bb1eb5874e3f788967d76e3
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Thu Sep 9 14:44:48 2010 -0400
* Thu Sep 9 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-9
- move most of the payload of the core package to the libs subpackage, given
that the libs aren't meaningfully usable without the standard libraries
diff --git a/python.spec b/python.spec
index 8be62e9..40f4c79 100644
--- a/python.spec
+++ b/python.spec
@@ -94,9 +94,10 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7
-Release: 8%{?dist}
+Release: 9%{?dist}
License: Python
Group: Development/Languages
+Requires: %{python}-libs%{?_isa} = %{version}-%{release}
Provides: python-abi = %{pybasever}
Provides: python(abi) = %{pybasever}
Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
@@ -481,24 +482,26 @@ Mac and MFC).
Programmers can write new built-in modules for Python in C or C++.
Python can be used as an extension language for applications that need
-a programmable interface. This package contains most of the standard
-Python modules, as well as modules for interfacing to the Tix widget
-set for Tk and RPM.
+a programmable interface.
Note that documentation for Python is provided in the python-docs
package.
+This package provides the "python" executable; most of the actual
+implementation is within the "python-libs" package.
+
%package libs
-Summary: The libraries for python runtime
+Summary: Runtime libraries for Python
Group: Applications/System
-Requires: %{name} = %{version}-%{release}
+
# Needed for ctypes, to load libraries, worked around for Live CDs size
# Requires: binutils
%description libs
-The python interpreter can be embedded into applications wanting to
-use python as an embedded scripting language. The python-libs package
-provides the libraries needed for this.
+This package contains runtime libraries for use by Python:
+- the libpython dynamic library, for use by applications that embed Python as
+a scripting language, and by the main "python" executable
+- the Python standard library
%package devel
Summary: The libraries and header files needed for Python development
@@ -1297,6 +1300,9 @@ rm -fr %{buildroot}
%{_bindir}/python%{pybasever}
%{_mandir}/*/*
+%files libs
+%defattr(-,root,root,-)
+%doc LICENSE README
%dir %{pylibdir}
%dir %{dynload_dir}
%{dynload_dir}/Python-%{version}-py%{pybasever}.egg-info
@@ -1417,16 +1423,13 @@ rm -fr %{buildroot}
%endif
# "Makefile" and the config-32/64.h file are needed by
-# distutils/sysconfig.py:_init_posix(), so we include them in the core
+# distutils/sysconfig.py:_init_posix(), so we include them in the libs
# package, along with their parent directories (bug 531901):
%dir %{pylibdir}/config
%{pylibdir}/config/Makefile
%dir %{_includedir}/python%{pybasever}
%{_includedir}/python%{pybasever}/%{_pyconfig_h}
-%files libs
-%defattr(-,root,root,-)
-%doc LICENSE README
%{_libdir}/%{py_INSTSONAME_optimized}
%if 0%{?with_systemtap}
%{tapsetdir}/%{libpython_stp_optimized}
@@ -1501,7 +1504,8 @@ rm -fr %{buildroot}
%endif
%{_bindir}/python%{pybasever}-debug
-# ...with debug builds of the built-in "extension" modules:
+# Analog of the -libs subpackage's files, with debug builds of the built-in
+# "extension" modules:
%{dynload_dir}/_bisectmodule_d.so
%{dynload_dir}/_bsddb_d.so
%{dynload_dir}/_codecs_cn_d.so
@@ -1578,7 +1582,6 @@ rm -fr %{buildroot}
# do for the regular build above (bug 531901), since they're all in one package
# now; they're listed below, under "-devel":
-# Analog of the -libs subpackage's files:
%{_libdir}/%{py_INSTSONAME_debug}
%if 0%{?with_systemtap}
%{tapsetdir}/%{libpython_stp_debug}
@@ -1622,6 +1625,10 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Thu Sep 9 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-9
+- move most of the payload of the core package to the libs subpackage, given
+that the libs aren't meaningfully usable without the standard libraries
+
* Wed Aug 18 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-8
- add %%check section
- update lib64 patch (patch 102) to fix expected output in test_site.py on
commit 5810c5d8b1c876ccc4c547cc71cf20520dd27d85
Author: David Malcolm <dmalcolm(a)redhat.com>
Date: Wed Aug 18 13:35:32 2010 -0400
2.7-8: add a %check
* Wed Aug 18 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-8
- add %%check section
- update lib64 patch (patch 102) to fix expected output in test_site.py on
64-bit systems
- patch test_commands.py to work with SELinux (patch 124)
- patch the debug build's usage of COUNT_ALLOCS to be less verbose (patch 125)
diff --git a/fix-test_commands-expected-ls-output-issue7108.patch
b/fix-test_commands-expected-ls-output-issue7108.patch
new file mode 100644
index 0000000..e270ec5
--- /dev/null
+++ b/fix-test_commands-expected-ls-output-issue7108.patch
@@ -0,0 +1,12 @@
+diff -up Python-2.7/Lib/test/test_commands.py.gnu-ls-output
Python-2.7/Lib/test/test_commands.py
+--- Python-2.7/Lib/test/test_commands.py.gnu-ls-output 2010-08-17 11:31:35.714913918
-0400
++++ Python-2.7/Lib/test/test_commands.py 2010-08-17 11:37:08.913911808 -0400
+@@ -50,7 +50,7 @@ class CommandTests(unittest.TestCase):
+ # Note that the first case above has a space in the group name
+ # while the second one has a space in both names.
+ pat = r'''d......... # It is a directory.
+- \+? # It may have ACLs.
++ [.+@]? # It may have alt access (SELinux, ACLs or metadata
('@' OS X).
+ \s+\d+ # It has some number of links.
+ [^/]* # Skip user, group, size, and date.
+ /\. # and end with the name of the file.
diff --git a/less-verbose-COUNT_ALLOCS.patch b/less-verbose-COUNT_ALLOCS.patch
new file mode 100644
index 0000000..8cef015
--- /dev/null
+++ b/less-verbose-COUNT_ALLOCS.patch
@@ -0,0 +1,20 @@
+diff -up Python-2.7/Python/pythonrun.c.less-verbose-COUNT_ALLOCS
Python-2.7/Python/pythonrun.c
+--- Python-2.7/Python/pythonrun.c.less-verbose-COUNT_ALLOCS 2010-08-17 14:49:33.321913909
-0400
++++ Python-2.7/Python/pythonrun.c 2010-08-17 14:54:48.750910403 -0400
+@@ -470,7 +470,15 @@ Py_Finalize(void)
+
+ /* Debugging stuff */
+ #ifdef COUNT_ALLOCS
+- dump_counts(stdout);
++ /* This is a downstream Fedora modification.
++ The upstream default with COUNT_ALLOCS is to always dump the counts to
++ stdout on exit. For our debug builds its useful to have the info from
++ COUNT_ALLOCS available, but the stdout info here gets in the way, so
++ we make it optional, wrapping it in an environment variable (modelled
++ on the other PYTHONDUMP* env variables):
++ */
++ if (Py_GETENV("PYTHONDUMPCOUNTS"))
++ dump_counts(stdout);
+ #endif
+
+ PRINT_TOTAL_REFS();
diff --git a/python-2.7rc1-lib64.patch b/python-2.7rc1-lib64.patch
index 9462e82..78e7b93 100644
--- a/python-2.7rc1-lib64.patch
+++ b/python-2.7rc1-lib64.patch
@@ -1,6 +1,6 @@
-diff -up Python-2.7rc1/Lib/distutils/command/install.py.lib64
Python-2.7rc1/Lib/distutils/command/install.py
---- Python-2.7rc1/Lib/distutils/command/install.py.lib64 2010-05-05 15:09:31.000000000
-0400
-+++ Python-2.7rc1/Lib/distutils/command/install.py 2010-06-05 23:53:24.802224367 -0400
+diff -up Python-2.7/Lib/distutils/command/install.py.lib64
Python-2.7/Lib/distutils/command/install.py
+--- Python-2.7/Lib/distutils/command/install.py.lib64 2010-05-05 15:09:31.000000000
-0400
++++ Python-2.7/Lib/distutils/command/install.py 2010-08-16 15:49:49.998271662 -0400
@@ -42,14 +42,14 @@ else:
INSTALL_SCHEMES = {
'unix_prefix': {
@@ -18,9 +18,9 @@ diff -up Python-2.7rc1/Lib/distutils/command/install.py.lib64
Python-2.7rc1/Lib/
'headers': '$base/include/python/$dist_name',
'scripts': '$base/bin',
'data' : '$base',
-diff -up Python-2.7rc1/Lib/distutils/sysconfig.py.lib64
Python-2.7rc1/Lib/distutils/sysconfig.py
---- Python-2.7rc1/Lib/distutils/sysconfig.py.lib64 2010-05-05 15:09:31.000000000 -0400
-+++ Python-2.7rc1/Lib/distutils/sysconfig.py 2010-06-05 23:53:24.803224186 -0400
+diff -up Python-2.7/Lib/distutils/sysconfig.py.lib64
Python-2.7/Lib/distutils/sysconfig.py
+--- Python-2.7/Lib/distutils/sysconfig.py.lib64 2010-05-05 15:09:31.000000000 -0400
++++ Python-2.7/Lib/distutils/sysconfig.py 2010-08-16 15:49:49.998271662 -0400
@@ -114,8 +114,12 @@ def get_python_lib(plat_specific=0, stan
prefix = plat_specific and EXEC_PREFIX or PREFIX
@@ -35,9 +35,9 @@ diff -up Python-2.7rc1/Lib/distutils/sysconfig.py.lib64
Python-2.7rc1/Lib/distut
if standard_lib:
return libpython
else:
-diff -up Python-2.7rc1/Lib/site.py.lib64 Python-2.7rc1/Lib/site.py
---- Python-2.7rc1/Lib/site.py.lib64 2010-06-03 17:21:03.000000000 -0400
-+++ Python-2.7rc1/Lib/site.py 2010-06-06 04:56:41.504986054 -0400
+diff -up Python-2.7/Lib/site.py.lib64 Python-2.7/Lib/site.py
+--- Python-2.7/Lib/site.py.lib64 2010-06-03 17:21:03.000000000 -0400
++++ Python-2.7/Lib/site.py 2010-08-16 15:49:49.998271662 -0400
@@ -286,12 +286,16 @@ def getsitepackages():
if sys.platform in ('os2emx', 'riscos'):
sitepackages.append(os.path.join(prefix, "Lib",
"site-packages"))
@@ -55,9 +55,37 @@ diff -up Python-2.7rc1/Lib/site.py.lib64 Python-2.7rc1/Lib/site.py
sitepackages.append(os.path.join(prefix, "lib",
"site-packages"))
if sys.platform == "darwin":
# for framework builds *only* we add the standard Apple
-diff -up Python-2.7rc1/Makefile.pre.in.lib64 Python-2.7rc1/Makefile.pre.in
---- Python-2.7rc1/Makefile.pre.in.lib64 2010-06-05 23:53:24.000000000 -0400
-+++ Python-2.7rc1/Makefile.pre.in 2010-06-06 04:57:25.280017307 -0400
+diff -up Python-2.7/Lib/test/test_site.py.lib64 Python-2.7/Lib/test/test_site.py
+--- Python-2.7/Lib/test/test_site.py.lib64 2010-08-16 15:49:56.149022511 -0400
++++ Python-2.7/Lib/test/test_site.py 2010-08-16 15:49:58.268901184 -0400
+@@ -169,16 +169,19 @@ class HelperFunctionsTests(unittest.Test
+ wanted = os.path.join('xoxo', 'Lib',
'site-packages')
+ self.assertEquals(dirs[0], wanted)
+ elif os.sep == '/':
+- self.assertTrue(len(dirs), 2)
+- wanted = os.path.join('xoxo', 'lib', 'python' +
sys.version[:3],
++ self.assertEquals(len(dirs), 3)
++ wanted = os.path.join('xoxo', 'lib64', 'python' +
sys.version[:3],
+ 'site-packages')
+ self.assertEquals(dirs[0], wanted)
+- wanted = os.path.join('xoxo', 'lib', 'site-python')
++ wanted = os.path.join('xoxo', 'lib', 'python' +
sys.version[:3],
++ 'site-packages')
+ self.assertEquals(dirs[1], wanted)
++ wanted = os.path.join('xoxo', 'lib', 'site-python')
++ self.assertEquals(dirs[2], wanted)
+ else:
+- self.assertTrue(len(dirs), 2)
++ self.assertEquals(len(dirs), 2)
+ self.assertEquals(dirs[0], 'xoxo')
+- wanted = os.path.join('xoxo', 'lib',
'site-packages')
++ wanted = os.path.join('xoxo', 'lib64',
'site-packages')
+ self.assertEquals(dirs[1], wanted)
+
+ # let's try the specific Apple location
+diff -up Python-2.7/Makefile.pre.in.lib64 Python-2.7/Makefile.pre.in
+--- Python-2.7/Makefile.pre.in.lib64 2010-08-16 15:49:49.992272080 -0400
++++ Python-2.7/Makefile.pre.in 2010-08-16 15:49:49.999271826 -0400
@@ -94,7 +94,7 @@ LIBDIR= @libdir@
MANDIR= @mandir@
INCLUDEDIR= @includedir@
@@ -67,9 +95,9 @@ diff -up Python-2.7rc1/Makefile.pre.in.lib64
Python-2.7rc1/Makefile.pre.in
# Detailed destination directories
BINLIBDEST= $(LIBDIR)/python$(VERSION)
-diff -up Python-2.7rc1/Modules/getpath.c.lib64 Python-2.7rc1/Modules/getpath.c
---- Python-2.7rc1/Modules/getpath.c.lib64 2010-05-09 10:46:46.000000000 -0400
-+++ Python-2.7rc1/Modules/getpath.c 2010-06-06 04:58:53.840226352 -0400
+diff -up Python-2.7/Modules/getpath.c.lib64 Python-2.7/Modules/getpath.c
+--- Python-2.7/Modules/getpath.c.lib64 2010-05-09 10:46:46.000000000 -0400
++++ Python-2.7/Modules/getpath.c 2010-08-16 15:49:49.999271826 -0400
@@ -117,8 +117,8 @@
#endif
@@ -108,9 +136,9 @@ diff -up Python-2.7rc1/Modules/getpath.c.lib64
Python-2.7rc1/Modules/getpath.c
}
/* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */
-diff -up Python-2.7rc1/Modules/Setup.dist.lib64 Python-2.7rc1/Modules/Setup.dist
---- Python-2.7rc1/Modules/Setup.dist.lib64 2010-06-05 23:53:24.792224061 -0400
-+++ Python-2.7rc1/Modules/Setup.dist 2010-06-05 23:53:24.845009526 -0400
+diff -up Python-2.7/Modules/Setup.dist.lib64 Python-2.7/Modules/Setup.dist
+--- Python-2.7/Modules/Setup.dist.lib64 2010-08-16 15:49:49.988272889 -0400
++++ Python-2.7/Modules/Setup.dist 2010-08-16 15:49:49.999271826 -0400
@@ -413,7 +413,7 @@ gdbm gdbmmodule.c -lgdbm
# and the subdirectory of PORT where you built it.
DBLIBVER=4.7
@@ -129,9 +157,9 @@ diff -up Python-2.7rc1/Modules/Setup.dist.lib64
Python-2.7rc1/Modules/Setup.dist
# Interface to the Expat XML parser
#
-diff -up Python-2.7rc1/setup.py.lib64 Python-2.7rc1/setup.py
---- Python-2.7rc1/setup.py.lib64 2010-06-04 05:49:20.000000000 -0400
-+++ Python-2.7rc1/setup.py 2010-06-06 05:00:36.653100371 -0400
+diff -up Python-2.7/setup.py.lib64 Python-2.7/setup.py
+--- Python-2.7/setup.py.lib64 2010-06-27 08:36:16.000000000 -0400
++++ Python-2.7/setup.py 2010-08-16 15:49:50.000271774 -0400
@@ -347,7 +347,7 @@ class PyBuildExt(build_ext):
def detect_modules(self):
diff --git a/python.spec b/python.spec
index 731983d..8be62e9 100644
--- a/python.spec
+++ b/python.spec
@@ -35,6 +35,9 @@
%global with_debug_build 1
+# Disabled for now:
+%global with_huntrleaks 0
+
%global with_gdb_hooks 1
%global with_systemtap 1
@@ -91,7 +94,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7
-Release: 7%{?dist}
+Release: 8%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -416,6 +419,17 @@ Patch122: python-2.7-fix-parallel-make.patch
# Cherrypicked from r82530 upstream:
Patch123: python-2.7-fix-2to3-itertools-import-star.patch
+# test_commmands fails on SELinux systems due to a change in the output
+# of "ls" (
http://bugs.python.org/issue7108)
+Patch124: fix-test_commands-expected-ls-output-issue7108.patch
+
+# COUNT_ALLOCS is useful for debugging, but the upstream behaviour of always
+# emitting debug info to stdout on exit is too verbose and makes it harder to
+# use the debug build. Add a "PYTHONDUMPCOUNTS" environment variable which
+# must be set to enable the output on exit
+# Not yet sent upstream:
+Patch125: less-verbose-COUNT_ALLOCS.patch
+
# This is the generated patch to "configure"; see the description of
# %{regenerate_autotooling_patch}
# above:
@@ -659,7 +673,9 @@ rm -r Modules/zlib || exit 1
%patch122 -p1 -b .fix-parallel-make
pushd Lib
%patch123 -p0
-popd
+popd
+%patch124 -p1
+%patch125 -p1 -b .less-verbose-COUNT_ALLOCS
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -1062,6 +1078,207 @@ sed \
%endif # with_debug_build
%endif # with_systemtap
+%check
+topdir=$(pwd)
+CheckPython() {
+ ConfName=$1
+ BinaryName=$2
+ ConfDir=$(pwd)/build/$ConfName
+
+ echo STARTING: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName
+
+ # Notes about disabled tests:
+ #
+ # test_argparse:
+ # fails when in a full build, but works when run standalone; seems to be
+ #
http://bugs.python.org/issue9553 (needs COLUMNS=80 in the environment)
+ #
+ # test_distutils:
+ # fails with
+ # /usr/bin/ld: cannot find -lpython2.7
+ # in: test_build_ext (distutils.tests.test_build_ext.BuildExtTestCase)
+ # test_get_outputs (distutils.tests.test_build_ext.BuildExtTestCase)
+ #
+ # test_dl:
+ # fails with:
+ # <type 'exceptions.SystemError'>: module dl requires sizeof(int) ==
+ # sizeof(long) == sizeof(char*)
+ # on 64-bit builds, and the module is deprecated in favour of ctypes
+ #
+ # test_gdb:
+ # very dependent on GCC version
+ #
+ # test_http*
+ # I've seen occasional hangs in some http tests when running the test suite
+ # inside Koji on Python 3. For that reason I exclude them
+ #
+ # test_socket.py:
+ # Can fail on Koji build with:
+ # gaierror: [Errno -3] Temporary failure in name resolution
+ #
+ # test_urllib2
+ # Can fail on Koji build with:
+ # gaierror: [Errno -3] Temporary failure in name resolution
+ #
+ #
+ ###########################################################################
+ # TO BE INVESTIGATED:
+ ###########################################################################
+ #
+ # test_file:
+ # Fails in Koji with:
+ # ======================================================================
+ # FAIL: testStdin (test.test_file.COtherFileTests)
+ # ----------------------------------------------------------------------
+ # Traceback (most recent call last):
+ # File "/builddir/build/BUILD/Python-2.7/Lib/test/test_file.py", line 160,
in testStdin
+ # self.assertRaises((IOError, ValueError), sys.stdin.seek, -1)
+ # AssertionError: (<type 'exceptions.IOError'>, <type
'exceptions.ValueError'>) not raised
+ # ======================================================================
+ # FAIL: testStdin (test.test_file.PyOtherFileTests)
+ # ----------------------------------------------------------------------
+ # Traceback (most recent call last):
+ # File "/builddir/build/BUILD/Python-2.7/Lib/test/test_file.py", line 160,
in testStdin
+ # self.assertRaises((IOError, ValueError), sys.stdin.seek, -1)
+ # AssertionError: (<type 'exceptions.IOError'>, <type
'exceptions.ValueError'>) not raised
+ # ----------------------------------------------------------------------
+ #
+ # test_file2k:
+ # Fails in Koji on with:
+ # ======================================================================
+ # FAIL: testStdin (test.test_file2k.OtherFileTests)
+ # ----------------------------------------------------------------------
+ # Traceback (most recent call last):
+ # File "/builddir/build/BUILD/Python-2.7/Lib/test/test_file2k.py", line
211, in testStdin
+ # self.assertRaises(IOError, sys.stdin.seek, -1)
+ # AssertionError: IOError not raised
+ # ----------------------------------------------------------------------
+ #
+ # test_subprocess:
+ # Fails in Koji with:
+ # ======================================================================
+ # ERROR: test_leaking_fds_on_error (test.test_subprocess.ProcessTestCase)
+ # ----------------------------------------------------------------------
+ # Traceback (most recent call last):
+ # File "/builddir/build/BUILD/Python-2.7/Lib/test/test_subprocess.py",
line 534, in test_leaking_fds_on_error
+ # raise c.exception
+ # OSError: [Errno 13] Permission denied
+ # ======================================================================
+ # ERROR: test_leaking_fds_on_error (test.test_subprocess.ProcessTestCaseNoPoll)
+ # ----------------------------------------------------------------------
+ # Traceback (most recent call last):
+ # File "/builddir/build/BUILD/Python-2.7/Lib/test/test_subprocess.py",
line 534, in test_leaking_fds_on_error
+ # raise c.exception
+ # OSError: [Errno 13] Permission denied
+ # ----------------------------------------------------------------------
+ #
+ EXCLUDED_TESTS="test_argparse \
+ test_distutils \
+ test_dl \
+ test_gdb \
+ test_http_cookies \
+ test_httplib \
+ test_socket \
+ test_urllib2 \
+ test_file \
+ test_file2k \
+ test_subprocess \
+ %{nil}"
+
+ # Debug build shows some additional failures (to be investigated):
+ #
+ # test_gc:
+ # ======================================================================
+ # FAIL: test_newinstance (__main__.GCTests)
+ # ----------------------------------------------------------------------
+ # Traceback (most recent call last):
+ # File "Lib/test/test_gc.py", line 105, in test_newinstance
+ # self.assertNotEqual(gc.collect(), 0)
+ # AssertionError: 0 == 0
+ #
+ # ----------------------------------------------------------------------
+ #
+ # test_sys:
+ # ======================================================================
+ # FAIL: test_objecttypes (__main__.SizeofTest)
+ # ----------------------------------------------------------------------
+ # Traceback (most recent call last):
+ # File "Lib/test/test_sys.py", line 739, in test_objecttypes
+ # check(newstyleclass, s)
+ # File "Lib/test/test_sys.py", line 510, in check_sizeof
+ # self.assertEqual(result, size, msg)
+ # AssertionError: wrong size for <type 'type'>: got 960, expected 920
+ #
+ # ----------------------------------------------------------------------
+ # which is this code:
+ # # type
+ # # (PyTypeObject + PyNumberMethods + PyMappingMethods +
+ # # PySequenceMethods + PyBufferProcs)
+ # s = size(vh + 'P2P15Pl4PP9PP11PI') + size('41P 10P 3P 6P')
+ # class newstyleclass(object):
+ # pass
+ # check(newstyleclass, s)
+ #
+ # test_weakref:
+ # ======================================================================
+ # FAIL: test_callback_in_cycle_resurrection (__main__.ReferencesTestCase)
+ # ----------------------------------------------------------------------
+ # Traceback (most recent call last):
+ # File "Lib/test/test_weakref.py", line 591, in
test_callback_in_cycle_resurrection
+ # self.assertEqual(alist, ["C went away"])
+ # AssertionError: Lists differ: [] != ['C went away']
+ #
+ # Second list contains 1 additional elements.
+ # First extra element 0:
+ # C went away
+ #
+ # - []
+ # + ['C went away']
+ #
+ # ----------------------------------------------------------------------
+ #
+ if [ "$ConfName" = "debug" ] ; then
+ EXCLUDED_TESTS="$EXCLUDED_TESTS \
+ test_gc \
+ test_sys \
+ test_weakref \
+ %{nil}"
+ fi
+
+ # Note that we're running the tests using the version of the code in the
+ # builddir, not in the buildroot.
+
+ pushd $ConfDir
+
+ EXTRATESTOPTS="--verbose3"
+
+%if 0%{?with_huntrleaks}
+ # Try to detect reference leaks on debug builds. By default this means
+ # running every test 10 times (6 to stabilize, then 4 to watch):
+ if [ "$ConfName" = "debug" ] ; then
+ EXTRATESTOPTS="$EXTRATESTOPTS --huntrleaks : "
+ fi
+%endif
+
+ # Actually invoke regrtest.py:
+ EXTRATESTOPTS="$EXTRATESTOPTS -x $EXCLUDED_TESTS" make test
+
+ popd
+
+ echo FINISHED: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName
+
+}
+
+# Check each of the configurations:
+%if 0%{?with_debug_build}
+CheckPython \
+ debug \
+ python%{pybasever}-debug
+%endif # with_debug_build
+CheckPython \
+ optimized \
+ python%{pybasever}
+
%clean
rm -fr %{buildroot}
@@ -1405,6 +1622,13 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Wed Aug 18 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-8
+- add %%check section
+- update lib64 patch (patch 102) to fix expected output in test_site.py on
+64-bit systems
+- patch test_commands.py to work with SELinux (patch 124)
+- patch the debug build's usage of COUNT_ALLOCS to be less verbose (patch 125)
+
* Mon Jul 26 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-7
- fixup missing -lcrypt to "crypt" module in config patch (patch 0)
commit 188e0e5db82372153fa84dc98b75f0560c7dfa07
Author: Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org>
Date: Thu Jul 29 10:08:36 2010 +0000
dist-git conversion
diff --git a/.cvsignore b/.cvsignore
deleted file mode 100644
index 4a2f615..0000000
--- a/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-Python-2.7.tar.bz2
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..4a2f615
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+Python-2.7.tar.bz2
diff --git a/Makefile b/Makefile
deleted file mode 100644
index d62a95c..0000000
--- a/Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
-# Makefile for source rpm: python
-# $Id: Makefile,v 1.2 2007/10/15 19:19:17 notting Exp $
-NAME := python
-SPECFILE = $(firstword $(wildcard *.spec))
-
-define find-makefile-common
-for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f
$$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo
"$$d/Makefile.common" ; break ; fi ; done
-endef
-
-MAKEFILE_COMMON := $(shell $(find-makefile-common))
-
-ifeq ($(MAKEFILE_COMMON),)
-# attempt a checkout
-define checkout-makefile-common
-test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo
"common/Makefile.common" ; } || { echo "ERROR: I can't figure out how
to checkout the 'common' module." ; exit -1 ; } >&2
-endef
-
-MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
-endif
-
-include $(MAKEFILE_COMMON)
diff --git a/import.log b/import.log
deleted file mode 100644
index 39ae828..0000000
--- a/import.log
+++ /dev/null
@@ -1 +0,0 @@
-python-2_6-1:HEAD:python-2.6-1.src.rpm:1227924213
commit 7eccae04780daedacc2f15a3ef958ba2a3bbdbb5
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Mon Jul 26 18:12:31 2010 +0000
- fixup missing -lcrypt to "crypt" module in config patch (patch 0)
diff --git a/python-2.7rc1-config.patch b/python-2.7rc1-config.patch
index 6d8daf3..a858305 100644
--- a/python-2.7rc1-config.patch
+++ b/python-2.7rc1-config.patch
@@ -101,7 +101,7 @@ diff -up Python-2.7rc1/Modules/Setup.dist.rhconfig
Python-2.7rc1/Modules/Setup.d
# First, look at Setup.config; configure may have set this for you.
-#crypt cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some systems
-+crypt cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some systems
++crypt cryptmodule.c -lcrypt # crypt(3); needs -lcrypt on some systems
# Some more UNIX dependent modules -- off by default, since these
diff --git a/python.spec b/python.spec
index 91a4a57..731983d 100644
--- a/python.spec
+++ b/python.spec
@@ -91,7 +91,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7
-Release: 6%{?dist}
+Release: 7%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -1405,6 +1405,9 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Mon Jul 26 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-7
+- fixup missing -lcrypt to "crypt" module in config patch (patch 0)
+
* Mon Jul 26 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-6
- re-enable systemtap
- cherrypick upstream patch to 2to3 for "from itertools import *"
commit cff1b4f3d975b297a420d259f86c6f5d68e1e861
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Mon Jul 26 13:04:32 2010 +0000
- re-enable systemtap
- cherrypick upstream patch to 2to3 for "from itertools import *" traceback
(patch 123)
diff --git a/python-2.7-fix-2to3-itertools-import-star.patch
b/python-2.7-fix-2to3-itertools-import-star.patch
new file mode 100644
index 0000000..2f12c9b
--- /dev/null
+++ b/python-2.7-fix-2to3-itertools-import-star.patch
@@ -0,0 +1,30 @@
+Index: lib2to3/tests/test_fixers.py
+===================================================================
+--- lib2to3/tests/test_fixers.py (revision 82529)
++++ lib2to3/tests/test_fixers.py (revision 82530)
+@@ -3670,7 +3670,11 @@
+ a = "from itertools import bar, filterfalse, foo"
+ self.check(b, a)
+
++ def test_import_star(self):
++ s = "from itertools import *"
++ self.unchanged(s)
+
++
+ def test_unchanged(self):
+ s = "from itertools import foo"
+ self.unchanged(s)
+Index: lib2to3/fixes/fix_itertools_imports.py
+===================================================================
+--- lib2to3/fixes/fix_itertools_imports.py (revision 82529)
++++ lib2to3/fixes/fix_itertools_imports.py (revision 82530)
+@@ -20,6 +20,9 @@
+ if child.type == token.NAME:
+ member = child.value
+ name_node = child
++ elif child.type == token.STAR:
++ # Just leave the import as is.
++ return
+ else:
+ assert child.type == syms.import_as_name
+ name_node = child.children[0]
diff --git a/python.spec b/python.spec
index 4f76c82..91a4a57 100644
--- a/python.spec
+++ b/python.spec
@@ -37,7 +37,7 @@
%global with_gdb_hooks 1
-%global with_systemtap 0
+%global with_systemtap 1
# some arches dont have valgrind so we need to disable its support on them
%ifarch %{sparc} s390 s390x
@@ -91,7 +91,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7
-Release: 5%{?dist}
+Release: 6%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -411,6 +411,11 @@ Patch121: python-2.7rc2-r79310.patch
# Not yet sent upstream:
Patch122: python-2.7-fix-parallel-make.patch
+# Fix traceback in 2to3 on "from itertools import *"
+# This is
http://bugs.python.org/issue8892 (see also rhbz#600036)
+# Cherrypicked from r82530 upstream:
+Patch123: python-2.7-fix-2to3-itertools-import-star.patch
+
# This is the generated patch to "configure"; see the description of
# %{regenerate_autotooling_patch}
# above:
@@ -652,6 +657,9 @@ rm -r Modules/zlib || exit 1
%patch119 -p0 -b .fix-expat-issue9054
%patch121 -p0 -R
%patch122 -p1 -b .fix-parallel-make
+pushd Lib
+%patch123 -p0
+popd
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -1397,6 +1405,11 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Mon Jul 26 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-6
+- re-enable systemtap
+- cherrypick upstream patch to 2to3 for "from itertools import *"
+traceback (patch 123)
+
* Thu Jul 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-5
- disable systemtap for now (dtrace is failing on startup due to the bug
mentioned in 2.7-4)
commit b95f6cc2ca6a009f97436c6aa16cfd70547353d9
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Thu Jul 22 20:04:43 2010 +0000
- disable systemtap for now (dtrace is failing on startup due to the bug
mentioned in 2.7-4)
- provide relative path to python binary when running pathfix.py
- fix parallel make (patch 122)
diff --git a/python-2.7-fix-parallel-make.patch b/python-2.7-fix-parallel-make.patch
new file mode 100644
index 0000000..c43e141
--- /dev/null
+++ b/python-2.7-fix-parallel-make.patch
@@ -0,0 +1,37 @@
+diff -up Python-2.7/Makefile.pre.in.fix-parallel-make Python-2.7/Makefile.pre.in
+--- Python-2.7/Makefile.pre.in.fix-parallel-make 2010-07-22 15:01:39.567996932 -0400
++++ Python-2.7/Makefile.pre.in 2010-07-22 15:47:02.437998509 -0400
+@@ -207,6 +207,7 @@ SIGNAL_OBJS= @SIGNAL_OBJS@
+
+ ##########################################################################
+ # Grammar
++GRAMMAR_STAMP= $(srcdir)/grammar-stamp
+ GRAMMAR_H= $(srcdir)/Include/graminit.h
+ GRAMMAR_C= $(srcdir)/Python/graminit.c
+ GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar
+@@ -530,10 +531,24 @@ Modules/getpath.o: $(srcdir)/Modules/get
+ Modules/python.o: $(srcdir)/Modules/python.c
+ $(MAINCC) -c $(PY_CFLAGS) -o $@ $(srcdir)/Modules/python.c
+
++# GNU "make" interprets rules with two dependents as two copies of the rule.
++#
++# In a parallel build this can lead to pgen being run twice, once for each of
++# GRAMMAR_H and GRAMMAR_C, leading to race conditions in which the compiler
++# reads a partially-overwritten copy of one of these files, leading to syntax
++# errors (or linker errors if the fragment happens to be syntactically valid C)
++#
++# See
http://www.gnu.org/software/hello/manual/automake/Multiple-Outputs.html
++# for more information
++#
++# Introduce ".grammar-stamp" as a contrived single output from PGEN to avoid
++# this:
++$(GRAMMAR_H) $(GRAMMAR_C): $(GRAMMAR_STAMP)
+
+-$(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
++$(GRAMMAR_STAMP): $(PGEN) $(GRAMMAR_INPUT)
+ -@$(INSTALL) -d Include
+ -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
++ touch $(GRAMMAR_STAMP)
+
+ $(PGEN): $(PGENOBJS)
+ $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
diff --git a/python.spec b/python.spec
index e4c647f..4f76c82 100644
--- a/python.spec
+++ b/python.spec
@@ -37,7 +37,7 @@
%global with_gdb_hooks 1
-%global with_systemtap 1
+%global with_systemtap 0
# some arches dont have valgrind so we need to disable its support on them
%ifarch %{sparc} s390 s390x
@@ -91,7 +91,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7
-Release: 4%{?dist}
+Release: 5%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -405,6 +405,12 @@ Patch119: python-2.6.5-fix-expat-issue9054.patch
# For now, revert this patch:
Patch121: python-2.7rc2-r79310.patch
+# Fix race condition in parallel make that could lead to graminit.c failing
+# to compile, or linker errors with "undefined reference to
+# `_PyParser_Grammar'":
+# Not yet sent upstream:
+Patch122: python-2.7-fix-parallel-make.patch
+
# This is the generated patch to "configure"; see the description of
# %{regenerate_autotooling_patch}
# above:
@@ -645,6 +651,7 @@ rm -r Modules/zlib || exit 1
%patch119 -p0 -b .fix-expat-issue9054
%patch121 -p0 -R
+%patch122 -p1 -b .fix-parallel-make
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -739,7 +746,7 @@ make OPT="$CFLAGS" %{?_smp_mflags}
# optimized python binary:
if $PathFixWithThisBinary
then
- LD_LIBRARY_PATH="$topdir/$ConfDir" $BinaryName \
+ LD_LIBRARY_PATH="$topdir/$ConfDir" ./$BinaryName \
$topdir/Tools/scripts/pathfix.py \
-i "%{_bindir}/env $BinaryName" \
$topdir
@@ -1390,6 +1397,12 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Thu Jul 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-5
+- disable systemtap for now (dtrace is failing on startup due to the bug
+mentioned in 2.7-4)
+- provide relative path to python binary when running pathfix.py
+- fix parallel make (patch 122)
+
* Thu Jul 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-4
- fix reference to pyconfig.h in sysconfig that led to failure on startup if
python-devel was not installed
commit a8ca61b1fbabf63f46f1fcfba4ffcdeb492172d3
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Thu Jul 22 17:38:16 2010 +0000
- fix reference to pyconfig.h in sysconfig that led to failure on startup
if python-devel was not installed
diff --git a/python.spec b/python.spec
index 9a442e3..e4c647f 100644
--- a/python.spec
+++ b/python.spec
@@ -91,7 +91,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7
-Release: 3%{?dist}
+Release: 4%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -987,7 +987,15 @@ done
ln -s ../../libpython%{pybasever}.so
%{buildroot}%{pylibdir}/config/libpython%{pybasever}.so
# Fix for bug 201434: make sure distutils looks at the right pyconfig.h file
-sed -i -e "s/'pyconfig.h'/'%{_pyconfig_h}'/"
%{buildroot}%{pylibdir}/distutils/sysconfig.py
+# Similar for sysconfig: sysconfig.get_config_h_filename tries to locate
+# pyconfig.h so it can be parsed, and needs to do this at runtime in site.py
+# when python starts up.
+#
+# Split this out so it goes directly to the pyconfig-32.h/pyconfig-64.h
+# variants:
+sed -i -e "s/'pyconfig.h'/'%{_pyconfig_h}'/" \
+ %{buildroot}%{pylibdir}/distutils/sysconfig.py \
+ %{buildroot}%{pylibdir}/sysconfig.py
# Ensure that the curses module was linked against libncursesw.so, rather than
# libncurses.so (bug 539917)
@@ -1382,6 +1390,10 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Thu Jul 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-4
+- fix reference to pyconfig.h in sysconfig that led to failure on startup if
+python-devel was not installed
+
* Thu Jul 8 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-3
- add patch to fixup the new sysconfig.py for our multilib support on
64-bit (patch 103)
commit c6247fd3985c9d5ad0366a23ff03da2de24ae3d7
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Wed Jul 21 20:48:17 2010 +0000
- add patch to fixup the new sysconfig.py for our multilib support on
64-bit (patch 103)
Thu Jul 8 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-2
- add machinery for regenerating the "configure" script in the face of
mismatching autoconf versions (patch 300)
Tue Jul 6 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-1
- 2.7 final; drop alphatag
- drop patch 117 (upstream), patch 120 (upstreamed)
- fix the commented-out __python_ver from 26 to 27
diff --git a/.cvsignore b/.cvsignore
index 19932b2..4a2f615 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -1 +1 @@
-Python-2.6.5.tar.bz2
+Python-2.7.tar.bz2
diff --git a/disable-pymalloc-on-valgrind-py26.patch
b/disable-pymalloc-on-valgrind-py26.patch
deleted file mode 100644
index de56bdc..0000000
--- a/disable-pymalloc-on-valgrind-py26.patch
+++ /dev/null
@@ -1,135 +0,0 @@
-Index: configure.in
-===================================================================
---- configure.in (revision 61828)
-+++ configure.in (working copy)
-@@ -2232,6 +2232,19 @@ then
- fi
- AC_MSG_RESULT($with_pymalloc)
-
-+# Check for Valgrind support
-+AC_MSG_CHECKING([for --with-valgrind])
-+AC_ARG_WITH([valgrind],
-+ AC_HELP_STRING([--with-valgrind], [Enable Valgrind support]),,
-+ with_valgrind=no)
-+AC_MSG_RESULT([$with_valgrind])
-+if test "$with_valgrind" != no; then
-+ AC_CHECK_HEADER([valgrind/valgrind.h],
-+ [AC_DEFINE([WITH_VALGRIND], 1, [Define if you want pymalloc to be disabled when
running under valgrind])],
-+ [AC_MSG_ERROR([Valgrind support requested but headers not available])]
-+ )
-+fi
-+
- # Check for --with-wctype-functions
- AC_MSG_CHECKING(for --with-wctype-functions)
- AC_ARG_WITH(wctype-functions,
-Index: Objects/obmalloc.c
-===================================================================
---- Objects/obmalloc.c (revision 61828)
-+++ Objects/obmalloc.c (working copy)
-@@ -2,6 +2,21 @@
-
- #ifdef WITH_PYMALLOC
-
-+#ifdef WITH_VALGRIND
-+#include <valgrind/valgrind.h>
-+
-+/* If we're using GCC, use __builtin_expect() to reduce overhead of
-+ the valgrind checks */
-+#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
-+# define UNLIKELY(value) __builtin_expect((value), 0)
-+#else
-+# define UNLIKELY(value) (value)
-+#endif
-+
-+/* -1 indicates that we haven't checked that we're running on valgrind yet. */
-+static int running_on_valgrind = -1;
-+#endif
-+
- /* An object allocator for Python.
-
- Here is an introduction to the layers of the Python memory architecture,
-@@ -726,6 +741,13 @@ PyObject_Malloc(size_t nbytes)
- poolp next;
- uint size;
-
-+#ifdef WITH_VALGRIND
-+ if (UNLIKELY(running_on_valgrind == -1))
-+ running_on_valgrind = RUNNING_ON_VALGRIND;
-+ if (UNLIKELY(running_on_valgrind))
-+ goto redirect;
-+#endif
-+
- /*
- * This implicitly redirects malloc(0).
- */
-@@ -916,6 +938,11 @@ PyObject_Free(void *p)
- if (p == NULL) /* free(NULL) has no effect */
- return;
-
-+#ifdef WITH_VALGRIND
-+ if (UNLIKELY(running_on_valgrind > 0))
-+ goto redirect;
-+#endif
-+
- pool = POOL_ADDR(p);
- if (Py_ADDRESS_IN_RANGE(p, pool)) {
- /* We allocated this address. */
-@@ -1110,6 +1137,7 @@ PyObject_Free(void *p)
- return;
- }
-
-+redirect:
- /* We didn't allocate this address. */
- free(p);
- }
-@@ -1130,6 +1158,12 @@ PyObject_Realloc(void *p, size_t nbytes)
- if (p == NULL)
- return PyObject_Malloc(nbytes);
-
-+#ifdef WITH_VALGRIND
-+ /* Treat running_on_valgrind == -1 the same as 0 */
-+ if (UNLIKELY(running_on_valgrind > 0))
-+ goto redirect;
-+#endif
-+
- pool = POOL_ADDR(p);
- if (Py_ADDRESS_IN_RANGE(p, pool)) {
- /* We're in charge of this block */
-@@ -1157,6 +1191,7 @@ PyObject_Realloc(void *p, size_t nbytes)
- }
- return bp;
- }
-+ redirect:
- /* We're not managing this block. If nbytes <=
- * SMALL_REQUEST_THRESHOLD, it's tempting to try to take over this
- * block. However, if we do, we need to copy the valid data from
-Index: Misc/NEWS
-===================================================================
---- Misc/NEWS (revision 61828)
-+++ Misc/NEWS (working copy)
-@@ -60,6 +60,11 @@ Core and builtins
-
- - Issue #2143: Fix embedded readline() hang on SSL socket EOF.
-
-+- Issue #2422: When compiled with the ``--with-valgrind`` option, the
-+ pymalloc allocator will be automatically disabled when running under
-+ Valgrind. This gives improved memory leak detection when running
-+ under Valgrind, while taking advantage of pymalloc at other times.
-+
- Library
- -------
-
-Index: pyconfig.h.in
-===================================================================
---- pyconfig.h.in (revision 61828)
-+++ pyconfig.h.in (working copy)
-@@ -958,6 +958,9 @@
- /* Define to profile with the Pentium timestamp counter */
- #undef WITH_TSC
-
-+/* Define if you want pymalloc to be disabled when running under valgrind */
-+#undef WITH_VALGRIND
-+
-
- /* Define to 1 if your processor stores words with the most significant byte
- first (like Motorola and SPARC, unlike Intel and VAX).
diff --git a/python-2.5.1-codec-ascii-tolower.patch
b/python-2.5.1-codec-ascii-tolower.patch
deleted file mode 100644
index 81a123d..0000000
--- a/python-2.5.1-codec-ascii-tolower.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-diff -rup Python-2.5.1-orig/Python/codecs.c Python-2.5.1/Python/codecs.c
---- Python-2.5.1-orig/Python/codecs.c 2006-06-23 17:16:18.000000000 -0400
-+++ Python-2.5.1/Python/codecs.c 2007-10-30 12:51:10.000000000 -0400
-@@ -45,6 +45,11 @@ int PyCodec_Register(PyObject *search_fu
- return -1;
- }
-
-+/* isupper() forced into the ASCII Locale */
-+#define ascii_isupper(x) (((x) >= 0x41) && ((x) <= 0x5A))
-+/* tolower() forced into the ASCII Locale */
-+#define ascii_tolower(x) (ascii_isupper(x) ? ((x) + 0x20) : (x))
-+
- /* Convert a string to a normalized Python string: all characters are
- converted to lower case, spaces are replaced with underscores. */
-
-@@ -70,7 +75,7 @@ PyObject *normalizestring(const char *st
- if (ch == ' ')
- ch = '-';
- else
-- ch = tolower(Py_CHARMASK(ch));
-+ ch = ascii_tolower(Py_CHARMASK(ch));
- p[i] = ch;
- }
- return v;
-Only in Python-2.5.1/Python: codecs.c~
diff --git a/python-2.5.1-socketmodule-constants.patch
b/python-2.5.1-socketmodule-constants.patch
deleted file mode 100644
index 9dd1579..0000000
--- a/python-2.5.1-socketmodule-constants.patch
+++ /dev/null
@@ -1,63 +0,0 @@
---- Python-2.5.1i-orig/Modules/socketmodule.c 2008-03-07 16:38:47.000000000 -0500
-+++ Python-2.5.1/Modules/socketmodule.c 2008-03-07 16:41:09.000000000 -0500
-@@ -4507,6 +4507,60 @@
- #ifdef SO_TYPE
- PyModule_AddIntConstant(m, "SO_TYPE", SO_TYPE);
- #endif
-+#ifdef SO_SNDBUFFORCE
-+ PyModule_AddIntConstant(m, "SO_SNDBUFFORCE", SO_SNDBUFFORCE);
-+#endif
-+#ifdef SO_RCVBUFFORCE
-+ PyModule_AddIntConstant(m, "SO_RCVBUFFORCE", SO_RCVBUFFORCE);
-+#endif
-+#ifdef SO_NO_CHECK
-+ PyModule_AddIntConstant(m, "SO_NO_CHECK", SO_NO_CHECK);
-+#endif
-+#ifdef SO_PRIORITY
-+ PyModule_AddIntConstant(m, "SO_PRIORITY", SO_PRIORITY);
-+#endif
-+#ifdef SO_BSDCOMPAT
-+ PyModule_AddIntConstant(m, "SO_BSDCOMPAT", SO_BSDCOMPAT);
-+#endif
-+#ifdef SO_PASSCRED
-+ PyModule_AddIntConstant(m, "SO_PASSCRED", SO_PASSCRED);
-+#endif
-+#ifdef SO_PEERCRED
-+ PyModule_AddIntConstant(m, "SO_PEERCRED", SO_PEERCRED);
-+#endif
-+#ifdef SO_SECURITY_AUTHENTICATION
-+ PyModule_AddIntConstant(m, "SO_SECURITY_AUTHENTICATION",
SO_SECURITY_AUTHENTICATION);
-+#endif
-+#ifdef SO_SECURITY_ENCRYPTION_TRANSPORT
-+ PyModule_AddIntConstant(m, "SO_SECURITY_ENCRYPTION_TRANSPORT",
SO_SECURITY_ENCRYPTION_TRANSPORT);
-+#endif
-+#ifdef SO_SECURITY_ENCRYPTION_NETWORK
-+ PyModule_AddIntConstant(m, "SO_SECURITY_ENCRYPTION_NETWORK",
SO_SECURITY_ENCRYPTION_NETWORK);
-+#endif
-+#ifdef SO_BINDTODEVICE
-+ PyModule_AddIntConstant(m, "SO_BINDTODEVICE", SO_BINDTODEVICE);
-+#endif
-+#ifdef SO_ATTACH_FILTER
-+ PyModule_AddIntConstant(m, "SO_ATTACH_FILTER", SO_ATTACH_FILTER);
-+#endif
-+#ifdef SO_DETACH_FILTER
-+ PyModule_AddIntConstant(m, "SO_DETACH_FILTER", SO_DETACH_FILTER);
-+#endif
-+#ifdef SO_PEERNAME
-+ PyModule_AddIntConstant(m, "SO_PEERNAME", SO_PEERNAME);
-+#endif
-+#ifdef SO_TIMESTAMP
-+ PyModule_AddIntConstant(m, "SO_TIMESTAMP", SO_TIMESTAMP);
-+#endif
-+#ifdef SO_PEERSEC
-+ PyModule_AddIntConstant(m, "SO_PEERSEC", SO_PEERSEC);
-+#endif
-+#ifdef SO_PASSSEC
-+ PyModule_AddIntConstant(m, "SO_PASSSEC", SO_PASSSEC);
-+#endif
-+#ifdef SO_TIMESTAMPNS
-+ PyModule_AddIntConstant(m, "SO_TIMESTAMPNS", SO_TIMESTAMPNS);
-+#endif
-
- /* Maximum number of connections for "listen" */
- #ifdef SOMAXCONN
diff --git a/python-2.5.1-socketmodule-constants2.patch
b/python-2.5.1-socketmodule-constants2.patch
deleted file mode 100644
index 93008b9..0000000
--- a/python-2.5.1-socketmodule-constants2.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-diff -rup Python-2.5.1-orig/Modules/socketmodule.c Python-2.5.1/Modules/socketmodule.c
---- Python-2.5.1-orig/Modules/socketmodule.c 2008-03-25 09:59:38.000000000 -0400
-+++ Python-2.5.1/Modules/socketmodule.c 2008-03-25 10:12:24.000000000 -0400
-@@ -4977,6 +4977,15 @@ init_socket(void)
- #ifdef TCP_QUICKACK
- PyModule_AddIntConstant(m, "TCP_QUICKACK", TCP_QUICKACK);
- #endif
-+#ifdef TCP_CONGESTION
-+ PyModule_AddIntConstant(m, "TCP_CONGESTION", TCP_CONGESTION);
-+#endif
-+#ifdef TCP_MD5SIG
-+ PyModule_AddIntConstant(m, "TCP_MD5SIG", TCP_MD5SIG);
-+#endif
-+#ifdef TCP_MD5SIG_MAXKEYLEN
-+ PyModule_AddIntConstant(m, "TCP_MD5SIG_MAXKEYLEN", TCP_MD5SIG_MAXKEYLEN);
-+#endif
-
-
- /* IPX options */
-Only in Python-2.5.1/Modules: socketmodule.c~
diff --git a/python-2.6-ctypes-noexecmem.patch b/python-2.6-ctypes-noexecmem.patch
deleted file mode 100644
index 8d2890e..0000000
--- a/python-2.6-ctypes-noexecmem.patch
+++ /dev/null
@@ -1,85 +0,0 @@
-diff -ur Python-2.6~/Modules/_ctypes/callbacks.c Python-2.6/Modules/_ctypes/callbacks.c
---- Python-2.6~/Modules/_ctypes/callbacks.c 2008-06-09 00:58:54.000000000 -0400
-+++ Python-2.6/Modules/_ctypes/callbacks.c 2009-03-17 00:08:38.424528546 -0400
-@@ -21,8 +21,8 @@
- Py_XDECREF(self->converters);
- Py_XDECREF(self->callable);
- Py_XDECREF(self->restype);
-- if (self->pcl)
-- FreeClosure(self->pcl);
-+ if (self->pcl_write)
-+ ffi_closure_free(self->pcl_write);
- PyObject_GC_Del(self);
- }
-
-@@ -373,7 +373,8 @@
- return NULL;
- }
-
-- p->pcl = NULL;
-+ p->pcl_exec = NULL;
-+ p->pcl_write = NULL;
- memset(&p->cif, 0, sizeof(p->cif));
- p->converters = NULL;
- p->callable = NULL;
-@@ -402,8 +403,9 @@
-
- assert(CThunk_CheckExact(p));
-
-- p->pcl = MallocClosure();
-- if (p->pcl == NULL) {
-+ p->pcl_write = ffi_closure_alloc(sizeof(ffi_closure),
-+ &p->pcl_exec);
-+ if (p->pcl_write == NULL) {
- PyErr_NoMemory();
- goto error;
- }
-@@ -448,7 +450,9 @@
- "ffi_prep_cif failed with %d", result);
- goto error;
- }
-- result = ffi_prep_closure(p->pcl, &p->cif, closure_fcn, p);
-+ result = ffi_prep_closure_loc(p->pcl_write, &p->cif, closure_fcn,
-+ p,
-+ p->pcl_exec);
- if (result != FFI_OK) {
- PyErr_Format(PyExc_RuntimeError,
- "ffi_prep_closure failed with %d", result);
-diff -ur Python-2.6~/Modules/_ctypes/_ctypes.c Python-2.6/Modules/_ctypes/_ctypes.c
---- Python-2.6~/Modules/_ctypes/_ctypes.c 2008-08-19 15:40:23.000000000 -0400
-+++ Python-2.6/Modules/_ctypes/_ctypes.c 2009-03-17 00:08:38.479530502 -0400
-@@ -3438,7 +3438,7 @@
- self->callable = callable;
-
- self->thunk = thunk;
-- *(void **)self->b_ptr = (void *)thunk->pcl;
-+ *(void **)self->b_ptr = (void *)thunk->pcl_exec;
-
- Py_INCREF((PyObject *)thunk); /* for KeepRef */
- if (-1 == KeepRef((CDataObject *)self, 0, (PyObject *)thunk)) {
-diff -ur Python-2.6~/Modules/_ctypes/ctypes.h Python-2.6/Modules/_ctypes/ctypes.h
---- Python-2.6~/Modules/_ctypes/ctypes.h 2008-07-24 07:16:45.000000000 -0400
-+++ Python-2.6/Modules/_ctypes/ctypes.h 2009-03-17 00:08:38.480528344 -0400
-@@ -95,7 +95,8 @@
-
- typedef struct {
- PyObject_VAR_HEAD
-- ffi_closure *pcl; /* the C callable */
-+ ffi_closure *pcl_write; /* the C callable, writeable */
-+ void *pcl_exec; /* the C callable, executable */
- ffi_cif cif;
- int flags;
- PyObject *converters;
-diff -ur Python-2.6~/setup.py Python-2.6/setup.py
---- Python-2.6~/setup.py 2009-03-17 00:07:54.771651851 -0400
-+++ Python-2.6/setup.py 2009-03-17 00:08:19.792558478 -0400
-@@ -1701,8 +1701,7 @@
- '_ctypes/callbacks.c',
- '_ctypes/callproc.c',
- '_ctypes/stgdict.c',
-- '_ctypes/cfield.c',
-- '_ctypes/malloc_closure.c']
-+ '_ctypes/cfield.c']
- depends = ['_ctypes/ctypes.h']
-
- if sys.platform == 'darwin':
diff --git a/python-2.6-lib64.patch b/python-2.6-lib64.patch
deleted file mode 100644
index a9812e7..0000000
--- a/python-2.6-lib64.patch
+++ /dev/null
@@ -1,173 +0,0 @@
-diff -up Python-2.6/Lib/distutils/command/install.py.lib64
Python-2.6/Lib/distutils/command/install.py
---- Python-2.6/Lib/distutils/command/install.py.lib64 2008-05-06 18:41:46.000000000
-0400
-+++ Python-2.6/Lib/distutils/command/install.py 2008-11-24 02:34:04.000000000 -0500
-@@ -42,14 +42,14 @@ else:
- INSTALL_SCHEMES = {
- 'unix_prefix': {
- 'purelib': '$base/lib/python$py_version_short/site-packages',
-- 'platlib':
'$platbase/lib/python$py_version_short/site-packages',
-+ 'platlib':
'$platbase/lib64/python$py_version_short/site-packages',
- 'headers': '$base/include/python$py_version_short/$dist_name',
- 'scripts': '$base/bin',
- 'data' : '$base',
- },
- 'unix_home': {
- 'purelib': '$base/lib/python',
-- 'platlib': '$base/lib/python',
-+ 'platlib': '$base/lib64/python',
- 'headers': '$base/include/python/$dist_name',
- 'scripts': '$base/bin',
- 'data' : '$base',
-diff -up Python-2.6/Lib/distutils/sysconfig.py.lib64
Python-2.6/Lib/distutils/sysconfig.py
---- Python-2.6/Lib/distutils/sysconfig.py.lib64 2008-06-05 08:58:24.000000000 -0400
-+++ Python-2.6/Lib/distutils/sysconfig.py 2008-11-24 02:34:04.000000000 -0500
-@@ -115,8 +115,12 @@ def get_python_lib(plat_specific=0, stan
- prefix = plat_specific and EXEC_PREFIX or PREFIX
-
- if os.name == "posix":
-+ if plat_specific or standard_lib:
-+ lib = "lib64"
-+ else:
-+ lib = "lib"
- libpython = os.path.join(prefix,
-- "lib", "python" +
get_python_version())
-+ lib, "python" + get_python_version())
- if standard_lib:
- return libpython
- else:
-diff -up Python-2.6/Lib/site.py.lib64 Python-2.6/Lib/site.py
---- Python-2.6/Lib/site.py.lib64 2008-05-10 13:36:24.000000000 -0400
-+++ Python-2.6/Lib/site.py 2008-11-24 02:35:51.000000000 -0500
-@@ -265,12 +265,16 @@ def addsitepackages(known_paths):
- if sys.platform in ('os2emx', 'riscos'):
- sitedirs.append(os.path.join(prefix, "Lib",
"site-packages"))
- elif os.sep == '/':
-+ sitedirs.append(os.path.join(prefix, "lib64",
-+ "python" + sys.version[:3],
-+ "site-packages"))
- sitedirs.append(os.path.join(prefix, "lib",
- "python" + sys.version[:3],
- "site-packages"))
- sitedirs.append(os.path.join(prefix, "lib",
"site-python"))
- else:
- sitedirs.append(prefix)
-+ sitedirs.append(os.path.join(prefix, "lib64",
"site-packages"))
- sitedirs.append(os.path.join(prefix, "lib",
"site-packages"))
-
- if sys.platform == "darwin":
-diff -up Python-2.6/Makefile.pre.in.lib64 Python-2.6/Makefile.pre.in
---- Python-2.6/Makefile.pre.in.lib64 2008-11-24 02:34:04.000000000 -0500
-+++ Python-2.6/Makefile.pre.in 2008-11-24 02:34:04.000000000 -0500
-@@ -87,11 +87,11 @@ datarootdir= @datarootdir@
-
- # Expanded directories
- BINDIR= $(exec_prefix)/bin
--LIBDIR= $(exec_prefix)/lib
-+LIBDIR= $(exec_prefix)/lib64
- MANDIR= @mandir@
- INCLUDEDIR= @includedir@
- CONFINCLUDEDIR= $(exec_prefix)/include
--SCRIPTDIR= $(prefix)/lib
-+SCRIPTDIR= $(prefix)/lib64
-
- # Detailed destination directories
- BINLIBDEST= $(LIBDIR)/python$(VERSION)
-diff -up Python-2.6/Modules/getpath.c.lib64 Python-2.6/Modules/getpath.c
---- Python-2.6/Modules/getpath.c.lib64 2007-03-10 02:38:14.000000000 -0500
-+++ Python-2.6/Modules/getpath.c 2008-11-24 02:34:04.000000000 -0500
-@@ -117,8 +117,8 @@
- #endif
-
- #ifndef PYTHONPATH
--#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
-- EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
-+#define PYTHONPATH PREFIX "/lib64/python" VERSION ":" \
-+ EXEC_PREFIX "/lib64/python" VERSION "/lib-dynload"
- #endif
-
- #ifndef LANDMARK
-@@ -129,7 +129,7 @@ static char prefix[MAXPATHLEN+1];
- static char exec_prefix[MAXPATHLEN+1];
- static char progpath[MAXPATHLEN+1];
- static char *module_search_path = NULL;
--static char lib_python[] = "lib/python" VERSION;
-+static char lib_python[] = "lib64/python" VERSION;
-
- static void
- reduce(char *dir)
-@@ -524,7 +524,7 @@ calculate_path(void)
- }
- else
- strncpy(zip_path, PREFIX, MAXPATHLEN);
-- joinpath(zip_path, "lib/python00.zip");
-+ joinpath(zip_path, "lib64/python00.zip");
- bufsz = strlen(zip_path); /* Replace "00" with version */
- zip_path[bufsz - 6] = VERSION[0];
- zip_path[bufsz - 5] = VERSION[2];
-@@ -534,7 +534,7 @@ calculate_path(void)
- fprintf(stderr,
- "Could not find platform dependent libraries
<exec_prefix>\n");
- strncpy(exec_prefix, EXEC_PREFIX, MAXPATHLEN);
-- joinpath(exec_prefix, "lib/lib-dynload");
-+ joinpath(exec_prefix, "lib64/lib-dynload");
- }
- /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */
-
-diff -up Python-2.6/Modules/Setup.dist.lib64 Python-2.6/Modules/Setup.dist
---- Python-2.6/Modules/Setup.dist.lib64 2008-11-24 02:34:04.000000000 -0500
-+++ Python-2.6/Modules/Setup.dist 2008-11-24 02:34:04.000000000 -0500
-@@ -408,7 +408,7 @@ gdbm gdbmmodule.c -I/usr/local/include -
- # and the subdirectory of PORT where you built it.
- DBLIBVER=4.7
- DBINC=/usr/include/db4
--DBLIB=/usr/lib
-+DBLIB=/usr/lib64
- _bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
-
- # Historical Berkeley DB 1.85
-@@ -454,7 +454,7 @@ cPickle cPickle.c
- # Andrew Kuchling's zlib module.
- # This require zlib 1.1.3 (or later).
- # See
http://www.gzip.org/zlib/
--zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
-+zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib64 -lz
-
- # Interface to the Expat XML parser
- #
-diff -up Python-2.6/setup.py.lib64 Python-2.6/setup.py
---- Python-2.6/setup.py.lib64 2008-11-24 02:34:04.000000000 -0500
-+++ Python-2.6/setup.py 2008-11-24 02:34:04.000000000 -0500
-@@ -310,7 +310,7 @@ class PyBuildExt(build_ext):
-
- def detect_modules(self):
- # Ensure that /usr/local is always used
-- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
-+ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib64')
- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
-
- # Add paths specified in the environment variables LDFLAGS and
-@@ -583,11 +583,11 @@ class PyBuildExt(build_ext):
- elif self.compiler.find_library_file(lib_dirs, 'curses'):
- readline_libs.append('curses')
- elif self.compiler.find_library_file(lib_dirs +
-- ['/usr/lib/termcap'],
-+ ['/usr/lib64/termcap'],
- 'termcap'):
- readline_libs.append('termcap')
- exts.append( Extension('readline', ['readline.c'],
-- library_dirs=['/usr/lib/termcap'],
-+ library_dirs=['/usr/lib64/termcap'],
- extra_link_args=readline_extra_link_args,
- libraries=readline_libs) )
- else:
-@@ -624,8 +624,8 @@ class PyBuildExt(build_ext):
- if krb5_h:
- ssl_incs += krb5_h
- ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
-- ['/usr/local/ssl/lib',
-- '/usr/contrib/ssl/lib/'
-+ ['/usr/local/ssl/lib64',
-+ '/usr/contrib/ssl/lib64/'
- ] )
-
- if (ssl_incs is not None and
diff --git a/python-2.6.2-CVE-2008-5983.patch b/python-2.6.2-CVE-2008-5983.patch
deleted file mode 100644
index de640cb..0000000
--- a/python-2.6.2-CVE-2008-5983.patch
+++ /dev/null
@@ -1,137 +0,0 @@
-diff -up Python-2.6.2/Doc/c-api/init.rst.CVE-2008-5983 Python-2.6.2/Doc/c-api/init.rst
---- Python-2.6.2/Doc/c-api/init.rst.CVE-2008-5983 2009-04-05 17:26:31.000000000 -0400
-+++ Python-2.6.2/Doc/c-api/init.rst 2010-06-04 11:19:30.750199971 -0400
-@@ -22,6 +22,7 @@ Initialization, Finalization, and Thread
- module: sys
- triple: module; search; path
- single: PySys_SetArgv()
-+ single: PySys_SetArgvEx()
- single: Py_Finalize()
-
- Initialize the Python interpreter. In an application embedding Python, this
-@@ -31,7 +32,7 @@ Initialization, Finalization, and Thread
- the table of loaded modules (``sys.modules``), and creates the fundamental
- modules :mod:`__builtin__`, :mod:`__main__` and :mod:`sys`. It also initializes
- the module search path (``sys.path``). It does not set ``sys.argv``; use
-- :cfunc:`PySys_SetArgv` for that. This is a no-op when called for a second time
-+ :cfunc:`PySys_SetArgvEx` for that. This is a no-op when called for a second time
- (without calling :cfunc:`Py_Finalize` first). There is no return value; it is a
- fatal error if the initialization fails.
-
-@@ -346,7 +347,7 @@ Initialization, Finalization, and Thread
- ``sys.version``.
-
-
--.. cfunction:: void PySys_SetArgv(int argc, char **argv)
-+.. cfunction:: void PySys_SetArgvEx(int argc, char **argv, int updatepath)
-
- .. index::
- single: main()
-@@ -361,14 +362,41 @@ Initialization, Finalization, and Thread
- string. If this function fails to initialize :data:`sys.argv`, a fatal
- condition is signalled using :cfunc:`Py_FatalError`.
-
-- This function also prepends the executed script's path to :data:`sys.path`.
-- If no script is executed (in the case of calling ``python -c`` or just the
-- interactive interpreter), the empty string is used instead.
-+ If *updatepath* is zero, this is all the function does. If *updatepath*
-+ is non-zero, the function also modifies :data:`sys.path` according to the
-+ following algorithm:
-+
-+ - If the name of an existing script is passed in ``argv[0]``, the absolute
-+ path of the directory where the script is located is prepended to
-+ :data:`sys.path`.
-+ - Otherwise (that is, if *argc* is 0 or ``argv[0]`` doesn't point
-+ to an existing file name), an empty string is prepended to
-+ :data:`sys.path`, which is the same as prepending the current working
-+ directory (``"."``).
-+
-+ .. note::
-+ It is recommended that applications embedding the Python interpreter
-+ for purposes other than executing a single script pass 0 as *updatepath*,
-+ and update :data:`sys.path` themselves if desired.
-+ See `CVE-2008-5983
<
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-5983>`_.
-+
-+ On versions before 2.6.6, you can achieve the same effect by manually
-+ popping the first :data:`sys.path` element after having called
-+ :cfunc:`PySys_SetArgv`, for example using::
-+
-+ PyRun_SimpleString("import sys; sys.path.pop(0)\n");
-+
-+ .. versionadded:: 2.6.6
-
- .. XXX impl. doesn't seem consistent in allowing 0/NULL for the params;
- check w/ Guido.
-
-
-+.. cfunction:: void PySys_SetArgv(int argc, char **argv)
-+
-+ This function works like :cfunc:`PySys_SetArgv` with *updatepath* set to 1.
-+
-+
- .. cfunction:: void Py_SetPythonHome(char *home)
-
- Set the default "home" directory, that is, the location of the standard
-diff -up Python-2.6.2/Include/sysmodule.h.CVE-2008-5983 Python-2.6.2/Include/sysmodule.h
---- Python-2.6.2/Include/sysmodule.h.CVE-2008-5983 2008-04-12 19:44:07.000000000 -0400
-+++ Python-2.6.2/Include/sysmodule.h 2010-06-04 11:19:30.747199764 -0400
-@@ -11,6 +11,7 @@ PyAPI_FUNC(PyObject *) PySys_GetObject(c
- PyAPI_FUNC(int) PySys_SetObject(char *, PyObject *);
- PyAPI_FUNC(FILE *) PySys_GetFile(char *, FILE *);
- PyAPI_FUNC(void) PySys_SetArgv(int, char **);
-+PyAPI_FUNC(void) PySys_SetArgvEx(int, char **, int);
- PyAPI_FUNC(void) PySys_SetPath(char *);
-
- PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...)
-diff -up Python-2.6.2/Misc/NEWS.CVE-2008-5983 Python-2.6.2/Misc/NEWS
---- Python-2.6.2/Misc/NEWS.CVE-2008-5983 2010-06-04 11:19:30.730199353 -0400
-+++ Python-2.6.2/Misc/NEWS 2010-06-04 11:19:30.749199965 -0400
-@@ -111,6 +111,14 @@ Core and Builtins
- Valgrind. This gives improved memory leak detection when running
- under Valgrind, while taking advantage of pymalloc at other times.
-
-+C-API
-+-----
-+
-+- Issue #5753: A new C API function, :cfunc:`PySys_SetArgvEx`, allows
-+ embedders of the interpreter to set sys.argv without also modifying
-+ sys.path. This helps fix `CVE-2008-5983
-+ <
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-5983>`_.
-+
- Library
- -------
-
-diff -up Python-2.6.2/Python/sysmodule.c.CVE-2008-5983 Python-2.6.2/Python/sysmodule.c
---- Python-2.6.2/Python/sysmodule.c.CVE-2008-5983 2009-01-13 19:08:09.000000000 -0500
-+++ Python-2.6.2/Python/sysmodule.c 2010-06-04 11:20:18.931825713 -0400
-@@ -1528,7 +1528,7 @@ makeargvobject(int argc, char **argv)
- }
-
- void
--PySys_SetArgv(int argc, char **argv)
-+PySys_SetArgvEx(int argc, char **argv, int updatepath)
- {
- #if defined(HAVE_REALPATH)
- char fullpath[MAXPATHLEN];
-@@ -1541,7 +1541,7 @@ PySys_SetArgv(int argc, char **argv)
- Py_FatalError("no mem for sys.argv");
- if (PySys_SetObject("argv", av) != 0)
- Py_FatalError("can't assign sys.argv");
-- if (path != NULL) {
-+ if (updatepath && path != NULL) {
- char *argv0 = argv[0];
- char *p = NULL;
- Py_ssize_t n = 0;
-@@ -1631,6 +1631,12 @@ PySys_SetArgv(int argc, char **argv)
- Py_DECREF(av);
- }
-
-+void
-+PySys_SetArgv(int argc, char **argv)
-+{
-+ PySys_SetArgvEx(argc, argv, 1);
-+}
-+
-
- /* APIs to write to sys.stdout or sys.stderr using a printf-like interface.
- Adapted from code submitted by Just van Rossum.
diff --git a/python-2.6.2-CVE-2010-1634.patch b/python-2.6.2-CVE-2010-1634.patch
deleted file mode 100644
index a4144eb..0000000
--- a/python-2.6.2-CVE-2010-1634.patch
+++ /dev/null
@@ -1,210 +0,0 @@
-diff -up Python-2.6.2/Modules/audioop.c.CVE-2010-1634 Python-2.6.2/Modules/audioop.c
---- Python-2.6.2/Modules/audioop.c.CVE-2010-1634 2008-07-07 13:02:59.000000000 -0400
-+++ Python-2.6.2/Modules/audioop.c 2010-06-04 11:02:45.743200233 -0400
-@@ -829,7 +829,7 @@ static PyObject *
- audioop_tostereo(PyObject *self, PyObject *args)
- {
- signed char *cp, *ncp;
-- int len, new_len, size, val1, val2, val = 0;
-+ int len, size, val1, val2, val = 0;
- double fac1, fac2, fval, maxval;
- PyObject *rv;
- int i;
-@@ -846,14 +846,13 @@ audioop_tostereo(PyObject *self, PyObjec
- return 0;
- }
-
-- new_len = len*2;
-- if (new_len < 0) {
-+ if (len > INT_MAX/2) {
- PyErr_SetString(PyExc_MemoryError,
- "not enough memory for output buffer");
- return 0;
- }
-
-- rv = PyString_FromStringAndSize(NULL, new_len);
-+ rv = PyString_FromStringAndSize(NULL, len*2);
- if ( rv == 0 )
- return 0;
- ncp = (signed char *)PyString_AsString(rv);
-@@ -1016,7 +1015,7 @@ audioop_lin2lin(PyObject *self, PyObject
- {
- signed char *cp;
- unsigned char *ncp;
-- int len, new_len, size, size2, val = 0;
-+ int len, size, size2, val = 0;
- PyObject *rv;
- int i, j;
-
-@@ -1030,13 +1029,12 @@ audioop_lin2lin(PyObject *self, PyObject
- return 0;
- }
-
-- new_len = (len/size)*size2;
-- if (new_len < 0) {
-+ if (len/size > INT_MAX/size2) {
- PyErr_SetString(PyExc_MemoryError,
- "not enough memory for output buffer");
- return 0;
- }
-- rv = PyString_FromStringAndSize(NULL, new_len);
-+ rv = PyString_FromStringAndSize(NULL, (len/size)*size2);
- if ( rv == 0 )
- return 0;
- ncp = (unsigned char *)PyString_AsString(rv);
-@@ -1072,7 +1070,6 @@ audioop_ratecv(PyObject *self, PyObject
- int chan, d, *prev_i, *cur_i, cur_o;
- PyObject *state, *samps, *str, *rv = NULL;
- int bytes_per_frame;
-- size_t alloc_size;
-
- weightA = 1;
- weightB = 0;
-@@ -1115,14 +1112,13 @@ audioop_ratecv(PyObject *self, PyObject
- inrate /= d;
- outrate /= d;
-
-- alloc_size = sizeof(int) * (unsigned)nchannels;
-- if (alloc_size < nchannels) {
-+ if ((size_t)nchannels > PY_SIZE_MAX/sizeof(int)) {
- PyErr_SetString(PyExc_MemoryError,
- "not enough memory for output buffer");
- return 0;
- }
-- prev_i = (int *) malloc(alloc_size);
-- cur_i = (int *) malloc(alloc_size);
-+ prev_i = (int *) malloc(nchannels * sizeof(int));
-+ cur_i = (int *) malloc(nchannels * sizeof(int));
- if (prev_i == NULL || cur_i == NULL) {
- (void) PyErr_NoMemory();
- goto exit;
-@@ -1159,25 +1155,16 @@ audioop_ratecv(PyObject *self, PyObject
- ceiling(len*outrate/inrate) output frames, and each frame
- requires bytes_per_frame bytes. Computing this
- without spurious overflow is the challenge; we can
-- settle for a reasonable upper bound, though. */
-- int ceiling; /* the number of output frames */
-- int nbytes; /* the number of output bytes needed */
-- int q = len / inrate;
-- /* Now len = q * inrate + r exactly (with r = len % inrate),
-- and this is less than q * inrate + inrate = (q+1)*inrate.
-- So a reasonable upper bound on len*outrate/inrate is
-- ((q+1)*inrate)*outrate/inrate =
-- (q+1)*outrate.
-- */
-- ceiling = (q+1) * outrate;
-- nbytes = ceiling * bytes_per_frame;
-- /* See whether anything overflowed; if not, get the space. */
-- if (q+1 < 0 ||
-- ceiling / outrate != q+1 ||
-- nbytes / bytes_per_frame != ceiling)
-+ settle for a reasonable upper bound, though, in this
-+ case ceiling(len/inrate) * outrate. */
-+
-+ /* compute ceiling(len/inrate) without overflow */
-+ int q = len > 0 ? 1 + (len - 1) / inrate : 0;
-+ if (outrate > INT_MAX / q / bytes_per_frame)
- str = NULL;
- else
-- str = PyString_FromStringAndSize(NULL, nbytes);
-+ str = PyString_FromStringAndSize(NULL,
-+ q * outrate *
bytes_per_frame);
-
- if (str == NULL) {
- PyErr_SetString(PyExc_MemoryError,
-@@ -1296,7 +1283,7 @@ audioop_ulaw2lin(PyObject *self, PyObjec
- unsigned char *cp;
- unsigned char cval;
- signed char *ncp;
-- int len, new_len, size, val;
-+ int len, size, val;
- PyObject *rv;
- int i;
-
-@@ -1309,18 +1296,17 @@ audioop_ulaw2lin(PyObject *self, PyObjec
- return 0;
- }
-
-- new_len = len*size;
-- if (new_len < 0) {
-+ if (len > INT_MAX/size) {
- PyErr_SetString(PyExc_MemoryError,
- "not enough memory for output buffer");
- return 0;
- }
-- rv = PyString_FromStringAndSize(NULL, new_len);
-+ rv = PyString_FromStringAndSize(NULL, len*size);
- if ( rv == 0 )
- return 0;
- ncp = (signed char *)PyString_AsString(rv);
-
-- for ( i=0; i < new_len; i += size ) {
-+ for ( i=0; i < len*size; i += size ) {
- cval = *cp++;
- val = st_ulaw2linear16(cval);
-
-@@ -1370,7 +1356,7 @@ audioop_alaw2lin(PyObject *self, PyObjec
- unsigned char *cp;
- unsigned char cval;
- signed char *ncp;
-- int len, new_len, size, val;
-+ int len, size, val;
- PyObject *rv;
- int i;
-
-@@ -1383,18 +1369,17 @@ audioop_alaw2lin(PyObject *self, PyObjec
- return 0;
- }
-
-- new_len = len*size;
-- if (new_len < 0) {
-+ if (len > INT_MAX/size) {
- PyErr_SetString(PyExc_MemoryError,
- "not enough memory for output buffer");
- return 0;
- }
-- rv = PyString_FromStringAndSize(NULL, new_len);
-+ rv = PyString_FromStringAndSize(NULL, len*size);
- if ( rv == 0 )
- return 0;
- ncp = (signed char *)PyString_AsString(rv);
-
-- for ( i=0; i < new_len; i += size ) {
-+ for ( i=0; i < len*size; i += size ) {
- cval = *cp++;
- val = st_alaw2linear16(cval);
-
-@@ -1519,7 +1504,7 @@ audioop_adpcm2lin(PyObject *self, PyObje
- {
- signed char *cp;
- signed char *ncp;
-- int len, new_len, size, valpred, step, delta, index, sign, vpdiff;
-+ int len, size, valpred, step, delta, index, sign, vpdiff;
- PyObject *rv, *str, *state;
- int i, inputbuffer = 0, bufferstep;
-
-@@ -1541,13 +1526,12 @@ audioop_adpcm2lin(PyObject *self, PyObje
- } else if ( !PyArg_ParseTuple(state, "ii", &valpred, &index)
)
- return 0;
-
-- new_len = len*size*2;
-- if (new_len < 0) {
-+ if (len > (INT_MAX/2)/size) {
- PyErr_SetString(PyExc_MemoryError,
- "not enough memory for output buffer");
- return 0;
- }
-- str = PyString_FromStringAndSize(NULL, new_len);
-+ str = PyString_FromStringAndSize(NULL, len*size*2);
- if ( str == 0 )
- return 0;
- ncp = (signed char *)PyString_AsString(str);
-@@ -1555,7 +1539,7 @@ audioop_adpcm2lin(PyObject *self, PyObje
- step = stepsizeTable[index];
- bufferstep = 0;
-
-- for ( i=0; i < new_len; i += size ) {
-+ for ( i=0; i < len*size*2; i += size ) {
- /* Step 1 - get the delta value and compute next index */
- if ( bufferstep ) {
- delta = inputbuffer & 0xf;
diff --git a/python-2.6.2-CVE-2010-2089.patch b/python-2.6.2-CVE-2010-2089.patch
deleted file mode 100644
index 92efafd..0000000
--- a/python-2.6.2-CVE-2010-2089.patch
+++ /dev/null
@@ -1,349 +0,0 @@
-From ddc63ebe9b52c0ab4ba033301e70fac89f610704 Mon Sep 17 00:00:00 2001
-From: Victor Stinner <victor.stinner(a)haypocalc.com>
-Date: Sun, 10 Jan 2010 21:10:01 +0100
-Subject: [PATCH] audioop: check that length is a multiple the size
-
-Most functions of audioop takes as input a byte string (audio data) and a size
-argument (number of bytes of a sample). Functions don't check that the byte
-string length is a multiple of the size. It leads to read and write from/to
-uninitialised memory and might crash.
-
-Example on writing into uninitilized memory:
-
- $ python -c "import audioop; audioop.reverse('X', 2)"
- Fatal Python error: Inconsistent interned string state.
- Abandon
-
-It allocates a string of 1 byte and write 2 bytes into this string => memory
-corruption.
-
-Attached patch creates audioop_check_size() and audioop_check_parameters()
-functions.
----
- Modules/audioop.c | 153 ++++++++++++++++++++++++----------------------------
- 1 files changed, 71 insertions(+), 82 deletions(-)
-
-diff --git a/Modules/audioop.c b/Modules/audioop.c
-index 42daf9b..ebb992a 100644
---- a/Modules/audioop.c
-+++ b/Modules/audioop.c
-@@ -295,6 +295,29 @@ static int stepsizeTable[89] = {
-
- static PyObject *AudioopError;
-
-+static int
-+audioop_check_size(int size)
-+{
-+ if ( size != 1 && size != 2 && size != 4 ) {
-+ PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
-+ return 0;
-+ } else {
-+ return 1;
-+ }
-+}
-+
-+static int
-+audioop_check_parameters(int len, int size)
-+{
-+ if (!audioop_check_size(size))
-+ return 0;
-+ if ( len % size != 0 ) {
-+ PyErr_SetString(AudioopError, "not a whole number of
frames");
-+ return 0;
-+ }
-+ return 1;
-+}
-+
- static PyObject *
- audioop_getsample(PyObject *self, PyObject *args)
- {
-@@ -304,10 +327,8 @@ audioop_getsample(PyObject *self, PyObject *args)
-
- if ( !PyArg_ParseTuple(args, "s#ii:getsample", &cp, &len,
&size, &i) )
- return 0;
-- if ( size != 1 && size != 2 && size != 4 ) {
-- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
-- return 0;
-- }
-+ if (!audioop_check_parameters(len, size))
-+ return NULL;
- if ( i < 0 || i >= len/size ) {
- PyErr_SetString(AudioopError, "Index out of range");
- return 0;
-@@ -328,10 +349,8 @@ audioop_max(PyObject *self, PyObject *args)
-
- if ( !PyArg_ParseTuple(args, "s#i:max", &cp, &len, &size)
)
- return 0;
-- if ( size != 1 && size != 2 && size != 4 ) {
-- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
-- return 0;
-- }
-+ if (!audioop_check_parameters(len, size))
-+ return NULL;
- for ( i=0; i<len; i+= size) {
- if ( size == 1 ) val = (int)*CHARP(cp, i);
- else if ( size == 2 ) val = (int)*SHORTP(cp, i);
-@@ -352,10 +371,8 @@ audioop_minmax(PyObject *self, PyObject *args)
-
- if (!PyArg_ParseTuple(args, "s#i:minmax", &cp, &len,
&size))
- return NULL;
-- if (size != 1 && size != 2 && size != 4) {
-- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
-+ if (!audioop_check_parameters(len, size))
- return NULL;
-- }
- for (i = 0; i < len; i += size) {
- if (size == 1) val = (int) *CHARP(cp, i);
- else if (size == 2) val = (int) *SHORTP(cp, i);
-@@ -376,10 +393,8 @@ audioop_avg(PyObject *self, PyObject *args)
-
- if ( !PyArg_ParseTuple(args, "s#i:avg", &cp, &len, &size)
)
- return 0;
-- if ( size != 1 && size != 2 && size != 4 ) {
-- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
-- return 0;
-- }
-+ if (!audioop_check_parameters(len, size))
-+ return NULL;
- for ( i=0; i<len; i+= size) {
- if ( size == 1 ) val = (int)*CHARP(cp, i);
- else if ( size == 2 ) val = (int)*SHORTP(cp, i);
-@@ -403,10 +418,8 @@ audioop_rms(PyObject *self, PyObject *args)
-
- if ( !PyArg_ParseTuple(args, "s#i:rms", &cp, &len, &size)
)
- return 0;
-- if ( size != 1 && size != 2 && size != 4 ) {
-- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
-- return 0;
-- }
-+ if (!audioop_check_parameters(len, size))
-+ return NULL;
- for ( i=0; i<len; i+= size) {
- if ( size == 1 ) val = (int)*CHARP(cp, i);
- else if ( size == 2 ) val = (int)*SHORTP(cp, i);
-@@ -614,10 +627,8 @@ audioop_avgpp(PyObject *self, PyObject *args)
-
- if ( !PyArg_ParseTuple(args, "s#i:avgpp", &cp, &len,
&size) )
- return 0;
-- if ( size != 1 && size != 2 && size != 4 ) {
-- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
-- return 0;
-- }
-+ if (!audioop_check_parameters(len, size))
-+ return NULL;
- /* Compute first delta value ahead. Also automatically makes us
- ** skip the first extreme value
- */
-@@ -671,10 +682,8 @@ audioop_maxpp(PyObject *self, PyObject *args)
-
- if ( !PyArg_ParseTuple(args, "s#i:maxpp", &cp, &len,
&size) )
- return 0;
-- if ( size != 1 && size != 2 && size != 4 ) {
-- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
-- return 0;
-- }
-+ if (!audioop_check_parameters(len, size))
-+ return NULL;
- /* Compute first delta value ahead. Also automatically makes us
- ** skip the first extreme value
- */
-@@ -722,10 +731,8 @@ audioop_cross(PyObject *self, PyObject *args)
-
- if ( !PyArg_ParseTuple(args, "s#i:cross", &cp, &len,
&size) )
- return 0;
-- if ( size != 1 && size != 2 && size != 4 ) {
-- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
-- return 0;
-- }
-+ if (!audioop_check_parameters(len, size))
-+ return NULL;
- ncross = -1;
- prevval = 17; /* Anything <> 0,1 */
- for ( i=0; i<len; i+= size) {
-@@ -750,6 +757,8 @@ audioop_mul(PyObject *self, PyObject *args)
-
- if ( !PyArg_ParseTuple(args, "s#id:mul", &cp, &len, &size,
&factor ) )
- return 0;
-+ if (!audioop_check_parameters(len, size))
-+ return NULL;
-
- if ( size == 1 ) maxval = (double) 0x7f;
- else if ( size == 2 ) maxval = (double) 0x7fff;
-@@ -792,6 +801,12 @@ audioop_tomono(PyObject *self, PyObject *args)
- if ( !PyArg_ParseTuple(args, "s#idd:tomono",
- &cp, &len, &size, &fac1, &fac2 ) )
- return 0;
-+ if (!audioop_check_parameters(len, size))
-+ return NULL;
-+ if ( ((len / size) & 1) != 0 ) {
-+ PyErr_SetString(AudioopError, "not a whole number of
frames");
-+ return NULL;
-+ }
-
- if ( size == 1 ) maxval = (double) 0x7f;
- else if ( size == 2 ) maxval = (double) 0x7fff;
-@@ -837,6 +852,8 @@ audioop_tostereo(PyObject *self, PyObject *args)
- if ( !PyArg_ParseTuple(args, "s#idd:tostereo",
- &cp, &len, &size, &fac1, &fac2 ) )
- return 0;
-+ if (!audioop_check_parameters(len, size))
-+ return NULL;
-
- if ( size == 1 ) maxval = (double) 0x7f;
- else if ( size == 2 ) maxval = (double) 0x7fff;
-@@ -896,7 +913,8 @@ audioop_add(PyObject *self, PyObject *args)
- if ( !PyArg_ParseTuple(args, "s#s#i:add",
- &cp1, &len1, &cp2, &len2, &size ) )
- return 0;
--
-+ if (!audioop_check_parameters(len1, size))
-+ return NULL;
- if ( len1 != len2 ) {
- PyErr_SetString(AudioopError, "Lengths should be the same");
- return 0;
-@@ -950,11 +968,8 @@ audioop_bias(PyObject *self, PyObject *args)
- if ( !PyArg_ParseTuple(args, "s#ii:bias",
- &cp, &len, &size , &bias) )
- return 0;
--
-- if ( size != 1 && size != 2 && size != 4) {
-- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
-- return 0;
-- }
-+ if (!audioop_check_parameters(len, size))
-+ return NULL;
-
- rv = PyString_FromStringAndSize(NULL, len);
- if ( rv == 0 )
-@@ -986,12 +1001,9 @@ audioop_reverse(PyObject *self, PyObject *args)
- if ( !PyArg_ParseTuple(args, "s#i:reverse",
- &cp, &len, &size) )
- return 0;
-+ if (!audioop_check_parameters(len, size))
-+ return NULL;
-
-- if ( size != 1 && size != 2 && size != 4 ) {
-- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
-- return 0;
-- }
--
- rv = PyString_FromStringAndSize(NULL, len);
- if ( rv == 0 )
- return 0;
-@@ -1023,12 +1035,10 @@ audioop_lin2lin(PyObject *self, PyObject *args)
- if ( !PyArg_ParseTuple(args, "s#ii:lin2lin",
- &cp, &len, &size, &size2) )
- return 0;
--
-- if ( (size != 1 && size != 2 && size != 4) ||
-- (size2 != 1 && size2 != 2 && size2 != 4)) {
-- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
-- return 0;
-- }
-+ if (!audioop_check_parameters(len, size))
-+ return NULL;
-+ if (!audioop_check_size(size2))
-+ return NULL;
-
- new_len = (len/size)*size2;
- if (new_len < 0) {
-@@ -1080,10 +1090,8 @@ audioop_ratecv(PyObject *self, PyObject *args)
- &nchannels, &inrate, &outrate, &state,
- &weightA, &weightB))
- return NULL;
-- if (size != 1 && size != 2 && size != 4) {
-- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
-+ if (!audioop_check_size(size))
- return NULL;
-- }
- if (nchannels < 1) {
- PyErr_SetString(AudioopError, "# of channels should be >=
1");
- return NULL;
-@@ -1269,11 +1277,8 @@ audioop_lin2ulaw(PyObject *self, PyObject *args)
- if ( !PyArg_ParseTuple(args, "s#i:lin2ulaw",
- &cp, &len, &size) )
- return 0 ;
--
-- if ( size != 1 && size != 2 && size != 4) {
-- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
-- return 0;
-- }
-+ if (!audioop_check_parameters(len, size))
-+ return NULL;
-
- rv = PyString_FromStringAndSize(NULL, len/size);
- if ( rv == 0 )
-@@ -1303,11 +1308,8 @@ audioop_ulaw2lin(PyObject *self, PyObject *args)
- if ( !PyArg_ParseTuple(args, "s#i:ulaw2lin",
- &cp, &len, &size) )
- return 0;
--
-- if ( size != 1 && size != 2 && size != 4) {
-- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
-- return 0;
-- }
-+ if (!audioop_check_size(size))
-+ return NULL;
-
- new_len = len*size;
- if (new_len < 0) {
-@@ -1343,11 +1345,8 @@ audioop_lin2alaw(PyObject *self, PyObject *args)
- if ( !PyArg_ParseTuple(args, "s#i:lin2alaw",
- &cp, &len, &size) )
- return 0;
--
-- if ( size != 1 && size != 2 && size != 4) {
-- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
-- return 0;
-- }
-+ if (!audioop_check_parameters(len, size))
-+ return NULL;
-
- rv = PyString_FromStringAndSize(NULL, len/size);
- if ( rv == 0 )
-@@ -1377,11 +1376,8 @@ audioop_alaw2lin(PyObject *self, PyObject *args)
- if ( !PyArg_ParseTuple(args, "s#i:alaw2lin",
- &cp, &len, &size) )
- return 0;
--
-- if ( size != 1 && size != 2 && size != 4) {
-- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
-- return 0;
-- }
-+ if (!audioop_check_size(size))
-+ return NULL;
-
- new_len = len*size;
- if (new_len < 0) {
-@@ -1418,12 +1414,8 @@ audioop_lin2adpcm(PyObject *self, PyObject *args)
- if ( !PyArg_ParseTuple(args, "s#iO:lin2adpcm",
- &cp, &len, &size, &state) )
- return 0;
--
--
-- if ( size != 1 && size != 2 && size != 4) {
-- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
-- return 0;
-- }
-+ if (!audioop_check_parameters(len, size))
-+ return NULL;
-
- str = PyString_FromStringAndSize(NULL, len/(size*2));
- if ( str == 0 )
-@@ -1526,11 +1518,8 @@ audioop_adpcm2lin(PyObject *self, PyObject *args)
- if ( !PyArg_ParseTuple(args, "s#iO:adpcm2lin",
- &cp, &len, &size, &state) )
- return 0;
--
-- if ( size != 1 && size != 2 && size != 4) {
-- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
-- return 0;
-- }
-+ if (!audioop_check_size(size))
-+ return NULL;
-
- /* Decode state, should have (value, step) */
- if ( state == Py_None ) {
---
-1.6.0.4
-
diff --git a/python-2.6.2-binutils-no-dep.patch b/python-2.6.2-binutils-no-dep.patch
deleted file mode 100644
index 57cd07c..0000000
--- a/python-2.6.2-binutils-no-dep.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff -ru Python-2.6.2-orig/Lib/ctypes/util.py Python-2.6.2/Lib/ctypes/util.py
---- Python-2.6.2-orig/Lib/ctypes/util.py 2009-01-10 12:11:11.000000000 -0500
-+++ Python-2.6.2/Lib/ctypes/util.py 2009-07-30 15:17:39.000000000 -0400
-@@ -133,7 +133,9 @@
- dump = f.read()
- rv = f.close()
- if rv == 10:
-- raise OSError, 'objdump command not found'
-+ return os.path.basename(f) # This is good for GLibc, I think,
-+ # and a dep on binutils is big (for
-+ # live CDs).
- res = re.search(r'\sSONAME\s+([^\s]+)', os.popen(cmd).read())
- if not res:
- return None
-Only in Python-2.6.2/Lib/ctypes: util.py~
diff --git a/python-2.6.2-config.patch b/python-2.6.2-config.patch
deleted file mode 100644
index 48461ee..0000000
--- a/python-2.6.2-config.patch
+++ /dev/null
@@ -1,283 +0,0 @@
-diff -up Python-2.6.2/Modules/Setup.dist.rhconfig Python-2.6.2/Modules/Setup.dist
---- Python-2.6.2/Modules/Setup.dist.rhconfig 2008-11-27 05:15:12.000000000 -0500
-+++ Python-2.6.2/Modules/Setup.dist 2010-01-25 21:11:01.508867242 -0500
-@@ -152,7 +152,7 @@ GLHACK=-Dclear=__GLclear
- # modules are to be built as shared libraries (see above for more
- # detail; also note that *static* reverses this effect):
-
--#*shared*
-+*shared*
-
- # GNU readline. Unlike previous Python incarnations, GNU readline is
- # now incorporated in an optional module, configured in the Setup file
-@@ -162,74 +162,74 @@ GLHACK=-Dclear=__GLclear
- # it, depending on your system -- see the GNU readline instructions.
- # It's okay for this to be a shared library, too.
-
--#readline readline.c -lreadline -ltermcap
-+readline readline.c -lreadline -ltermcap
-
-
- # Modules that should always be present (non UNIX dependent):
-
--#array arraymodule.c # array objects
--#cmath cmathmodule.c # -lm # complex math library functions
--#math mathmodule.c # -lm # math library functions, e.g. sin()
--#_struct _struct.c # binary structure packing/unpacking
--#time timemodule.c # -lm # time operations and variables
--#operator operator.c # operator.add() and similar goodies
--#_weakref _weakref.c # basic weak reference support
--#_testcapi _testcapimodule.c # Python C API test module
--#_random _randommodule.c # Random number generator
--#_collections _collectionsmodule.c # Container types
--#itertools itertoolsmodule.c # Functions creating iterators for efficient looping
--#strop stropmodule.c # String manipulations
--#_functools _functoolsmodule.c # Tools for working with functions and callable objects
-+array arraymodule.c # array objects
-+cmath cmathmodule.c # -lm # complex math library functions
-+math mathmodule.c # -lm # math library functions, e.g. sin()
-+_struct _struct.c # binary structure packing/unpacking
-+time timemodule.c # -lm # time operations and variables
-+operator operator.c # operator.add() and similar goodies
-+_weakref _weakref.c # basic weak reference support
-+_testcapi _testcapimodule.c # Python C API test module
-+_random _randommodule.c # Random number generator
-+_collections _collectionsmodule.c # Container types
-+itertools itertoolsmodule.c # Functions creating iterators for efficient looping
-+strop stropmodule.c # String manipulations
-+_functools _functoolsmodule.c # Tools for working with functions and callable objects
- #_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI
_elementtree.c # elementtree accelerator
- #_pickle _pickle.c # pickle accelerator
- #datetime datetimemodule.c # date/time type
--#_bisect _bisectmodule.c # Bisection algorithms
-+_bisect _bisectmodule.c # Bisection algorithms
-
--#unicodedata unicodedata.c # static Unicode character database
-+unicodedata unicodedata.c # static Unicode character database
-
- # access to ISO C locale support
--#_locale _localemodule.c # -lintl
-+_locale _localemodule.c # -lintl
-
-
- # Modules with some UNIX dependencies -- on by default:
- # (If you have a really backward UNIX, select and socket may not be
- # supported...)
-
--#fcntl fcntlmodule.c # fcntl(2) and ioctl(2)
--#spwd spwdmodule.c # spwd(3)
--#grp grpmodule.c # grp(3)
--#select selectmodule.c # select(2); not on ancient System V
-+fcntl fcntlmodule.c # fcntl(2) and ioctl(2)
-+spwd spwdmodule.c # spwd(3)
-+grp grpmodule.c # grp(3)
-+select selectmodule.c # select(2); not on ancient System V
-
- # Memory-mapped files (also works on Win32).
--#mmap mmapmodule.c
-+mmap mmapmodule.c
-
- # CSV file helper
--#_csv _csv.c
-+_csv _csv.c
-
- # Socket module helper for socket(2)
--#_socket socketmodule.c
-+_socket socketmodule.c
-
- # Socket module helper for SSL support; you must comment out the other
- # socket line above, and possibly edit the SSL variable:
- #SSL=/usr/local/ssl
--#_ssl _ssl.c \
--# -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
--# -L$(SSL)/lib -lssl -lcrypto
-+_ssl _ssl.c \
-+ -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-+ -L$(SSL)/lib -lssl -lcrypto
-
- # The crypt module is now disabled by default because it breaks builds
- # on many systems (where -lcrypt is needed), e.g. Linux (I believe).
- #
- # First, look at Setup.config; configure may have set this for you.
-
--#crypt cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some systems
-+crypt cryptmodule.c -lcrypt # crypt(3); needs -lcrypt on some systems
-
-
- # Some more UNIX dependent modules -- off by default, since these
- # are not supported by all UNIX systems:
-
--#nis nismodule.c -lnsl # Sun yellow pages -- not everywhere
--#termios termios.c # Steen Lumholt's termios module
--#resource resource.c # Jeremy Hylton's rlimit interface
-+nis nismodule.c -lnsl # Sun yellow pages -- not everywhere
-+termios termios.c # Steen Lumholt's termios module
-+resource resource.c # Jeremy Hylton's rlimit interface
-
-
- # Multimedia modules -- off by default.
-@@ -237,8 +237,8 @@ GLHACK=-Dclear=__GLclear
- # #993173 says audioop works on 64-bit platforms, though.
- # These represent audio samples or images as strings:
-
--#audioop audioop.c # Operations on audio samples
--#imageop imageop.c # Operations on images
-+audioop audioop.c # Operations on audio samples
-+imageop imageop.c # Operations on images
-
-
- # Note that the _md5 and _sha modules are normally only built if the
-@@ -248,14 +248,14 @@ GLHACK=-Dclear=__GLclear
- # Message-Digest Algorithm, described in RFC 1321. The necessary files
- # md5.c and md5.h are included here.
-
--#_md5 md5module.c md5.c
-+_md5 md5module.c md5.c
-
-
- # The _sha module implements the SHA checksum algorithms.
- # (NIST's Secure Hash Algorithms.)
--#_sha shamodule.c
--#_sha256 sha256module.c
--#_sha512 sha512module.c
-+_sha shamodule.c
-+_sha256 sha256module.c
-+_sha512 sha512module.c
-
-
- # SGI IRIX specific modules -- off by default.
-@@ -302,12 +302,12 @@ GLHACK=-Dclear=__GLclear
- # A Linux specific module -- off by default; this may also work on
- # some *BSDs.
-
--#linuxaudiodev linuxaudiodev.c
-+linuxaudiodev linuxaudiodev.c
-
-
- # George Neville-Neil's timing module:
-
--#timing timingmodule.c
-+timing timingmodule.c
-
-
- # The _tkinter module.
-@@ -322,7 +322,7 @@ GLHACK=-Dclear=__GLclear
- # every system.
-
- # *** Always uncomment this (leave the leading underscore in!):
--# _tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \
-+_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \
- # *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
- # -L/usr/local/lib \
- # *** Uncomment and edit to reflect where your Tcl/Tk headers are:
-@@ -332,7 +332,7 @@ GLHACK=-Dclear=__GLclear
- # *** Or uncomment this for Solaris:
- # -I/usr/openwin/include \
- # *** Uncomment and edit for Tix extension only:
--# -DWITH_TIX -ltix8.1.8.2 \
-+ -DWITH_TIX -ltix \
- # *** Uncomment and edit for BLT extension only:
- # -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \
- # *** Uncomment and edit for PIL (TkImaging) extension only:
-@@ -341,7 +341,7 @@ GLHACK=-Dclear=__GLclear
- # *** Uncomment and edit for TOGL extension only:
- # -DWITH_TOGL togl.c \
- # *** Uncomment and edit to reflect your Tcl/Tk versions:
--# -ltk8.2 -ltcl8.2 \
-+ -ltk -ltcl \
- # *** Uncomment and edit to reflect where your X11 libraries are:
- # -L/usr/X11R6/lib \
- # *** Or uncomment this for Solaris:
-@@ -351,7 +351,7 @@ GLHACK=-Dclear=__GLclear
- # *** Uncomment for AIX:
- # -lld \
- # *** Always uncomment this; X11 libraries to link with:
--# -lX11
-+ -lX11
-
- # Lance Ellinghaus's syslog module
- #syslog syslogmodule.c # syslog daemon interface
-@@ -373,7 +373,7 @@ GLHACK=-Dclear=__GLclear
- # it is a highly experimental and dangerous device for calling
- # *arbitrary* C functions in *arbitrary* shared libraries:
-
--#dl dlmodule.c
-+dl dlmodule.c
-
-
- # Modules that provide persistent dictionary-like semantics. You will
-@@ -396,7 +396,7 @@ GLHACK=-Dclear=__GLclear
- #
- # First, look at Setup.config; configure may have set this for you.
-
--#gdbm gdbmmodule.c -I/usr/local/include -L/usr/local/lib -lgdbm
-+gdbm gdbmmodule.c -lgdbm
-
-
- # Sleepycat Berkeley DB interface.
-@@ -411,11 +411,10 @@ GLHACK=-Dclear=__GLclear
- #
- # Edit the variables DB and DBLIBVERto point to the db top directory
- # and the subdirectory of PORT where you built it.
--#DB=/usr/local/BerkeleyDB.4.0
--#DBLIBVER=4.0
--#DBINC=$(DB)/include
--#DBLIB=$(DB)/lib
--#_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
-+DBLIBVER=4.7
-+DBINC=/usr/include/db4
-+DBLIB=/usr/lib
-+_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
-
- # Historical Berkeley DB 1.85
- #
-@@ -430,14 +429,14 @@ GLHACK=-Dclear=__GLclear
-
-
- # Helper module for various ascii-encoders
--#binascii binascii.c
-+binascii binascii.c
-
- # Fred Drake's interface to the Python parser
--#parser parsermodule.c
-+parser parsermodule.c
-
- # cStringIO and cPickle
--#cStringIO cStringIO.c
--#cPickle cPickle.c
-+cStringIO cStringIO.c
-+cPickle cPickle.c
-
-
- # Lee Busby's SIGFPE modules.
-@@ -460,7 +459,7 @@ GLHACK=-Dclear=__GLclear
- # Andrew Kuchling's zlib module.
- # This require zlib 1.1.3 (or later).
- # See
http://www.gzip.org/zlib/
--#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
-+zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
-
- # Interface to the Expat XML parser
- #
-@@ -479,14 +478,14 @@ GLHACK=-Dclear=__GLclear
- # Hye-Shik Chang's CJKCodecs
-
- # multibytecodec is required for all the other CJK codec modules
--#_multibytecodec cjkcodecs/multibytecodec.c
-+_multibytecodec cjkcodecs/multibytecodec.c
-
--#_codecs_cn cjkcodecs/_codecs_cn.c
--#_codecs_hk cjkcodecs/_codecs_hk.c
--#_codecs_iso2022 cjkcodecs/_codecs_iso2022.c
--#_codecs_jp cjkcodecs/_codecs_jp.c
--#_codecs_kr cjkcodecs/_codecs_kr.c
--#_codecs_tw cjkcodecs/_codecs_tw.c
-+_codecs_cn cjkcodecs/_codecs_cn.c
-+_codecs_hk cjkcodecs/_codecs_hk.c
-+_codecs_iso2022 cjkcodecs/_codecs_iso2022.c
-+_codecs_jp cjkcodecs/_codecs_jp.c
-+_codecs_kr cjkcodecs/_codecs_kr.c
-+_codecs_tw cjkcodecs/_codecs_tw.c
-
- # Example -- included for reference only:
- # xx xxmodule.c
diff --git a/python-2.6.2-with-system-expat.patch b/python-2.6.2-with-system-expat.patch
deleted file mode 100644
index 2510aef..0000000
--- a/python-2.6.2-with-system-expat.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-diff -up Python-2.6.2/configure.in.expat Python-2.6.2/configure.in
---- Python-2.6.2/configure.in.expat 2010-01-25 21:46:42.700858981 -0500
-+++ Python-2.6.2/configure.in 2010-01-25 21:46:54.710857387 -0500
-@@ -1898,6 +1898,13 @@ LIBS="$withval $LIBS"
- ],
- [AC_MSG_RESULT(no)])
-
-+# Check for use of the system expat library
-+AC_MSG_CHECKING(for --with-system-expat)
-+AC_ARG_WITH(system_expat,
-+ AC_HELP_STRING(--with-system-expat, build pyexpat module using an installed
expat library))
-+
-+AC_MSG_RESULT($with_system_expat)
-+
- # Check for use of the system libffi library
- AC_MSG_CHECKING(for --with-system-ffi)
- AC_ARG_WITH(system_ffi,
-diff -up Python-2.6.2/setup.py.expat Python-2.6.2/setup.py
---- Python-2.6.2/setup.py.expat 2010-01-25 21:46:48.490911125 -0500
-+++ Python-2.6.2/setup.py 2010-01-25 21:46:54.711857933 -0500
-@@ -1196,19 +1196,26 @@ class PyBuildExt(build_ext):
- #
- # More information on Expat can be found at
www.libexpat.org.
- #
-- expatinc = os.path.join(os.getcwd(), srcdir, 'Modules',
'expat')
-- define_macros = [
-- ('HAVE_EXPAT_CONFIG_H', '1'),
-- ]
-+ if '--with-system-expat' in
sysconfig.get_config_var("CONFIG_ARGS"):
-+ expat_inc = []
-+ define_macros = []
-+ expat_lib = ['expat']
-+ expat_sources = []
-+ else:
-+ expat_inc = [os.path.join(os.getcwd(), srcdir, 'Modules',
'expat')]
-+ define_macros = [
-+ ('HAVE_EXPAT_CONFIG_H', '1'),
-+ ]
-+ expat_lib = []
-+ expat_sources = ['expat/xmlparse.c',
-+ 'expat/xmlrole.c',
-+ 'expat/xmltok.c']
-
- exts.append(Extension('pyexpat',
- define_macros = define_macros,
-- include_dirs = [expatinc],
-- sources = ['pyexpat.c',
-- 'expat/xmlparse.c',
-- 'expat/xmlrole.c',
-- 'expat/xmltok.c',
-- ],
-+ include_dirs = expat_inc,
-+ libraries = expat_lib,
-+ sources = ['pyexpat.c'] + expat_sources
- ))
-
- # Fredrik Lundh's cElementTree module. Note that this also
-@@ -1218,7 +1225,8 @@ class PyBuildExt(build_ext):
- define_macros.append(('USE_PYEXPAT_CAPI', None))
- exts.append(Extension('_elementtree',
- define_macros = define_macros,
-- include_dirs = [expatinc],
-+ include_dirs = expat_inc,
-+ libraries = expat_lib,
- sources = ['_elementtree.c'],
- ))
- else:
diff --git a/python-2.6.4-dtrace.patch b/python-2.6.4-dtrace.patch
deleted file mode 100644
index bab99d8..0000000
--- a/python-2.6.4-dtrace.patch
+++ /dev/null
@@ -1,196 +0,0 @@
-diff -up Python-2.6.4/configure.in.systemtap Python-2.6.4/configure.in
---- Python-2.6.4/configure.in.systemtap 2009-12-18 15:37:15.632242686 -0500
-+++ Python-2.6.4/configure.in 2009-12-18 15:37:15.713244483 -0500
-@@ -2481,6 +2481,38 @@ if test "$with_valgrind" != no; then
- )
- fi
-
-+# Check for dtrace support
-+AC_MSG_CHECKING(for --with-dtrace)
-+AC_ARG_WITH(dtrace,
-+ AC_HELP_STRING(--with(out)-dtrace, disable/enable dtrace support))
-+
-+if test ! -z "$with_dtrace"
-+then
-+ if dtrace -G -o /dev/null -s $srcdir/Include/pydtrace.d 2>/dev/null
-+ then
-+ AC_DEFINE(WITH_DTRACE, 1,
-+ [Define if you want to compile in Dtrace support])
-+ with_dtrace="Sun"
-+ DTRACEOBJS="Python/dtrace.o"
-+ DTRADEHDRS=""
-+ elif dtrace -h -o /dev/null -s $srcdir/Include/pydtrace.d
-+ then
-+ AC_DEFINE(WITH_DTRACE, 1,
-+ [Define if you want to compile in Dtrace support])
-+ with_dtrace="Apple"
-+ DTRACEOBJS=""
-+ DTRADEHDRS="pydtrace.h"
-+ else
-+ with_dtrace="no"
-+ fi
-+else
-+ with_dtrace="no"
-+fi
-+
-+AC_MSG_RESULT($with_dtrace)
-+AC_SUBST(DTRACEOBJS)
-+AC_SUBST(DTRACEHDRS)
-+
- # Check for --with-wctype-functions
- AC_MSG_CHECKING(for --with-wctype-functions)
- AC_ARG_WITH(wctype-functions,
-diff -up Python-2.6.4/Include/pydtrace.d.systemtap Python-2.6.4/Include/pydtrace.d
---- Python-2.6.4/Include/pydtrace.d.systemtap 2009-12-18 15:37:15.697243772 -0500
-+++ Python-2.6.4/Include/pydtrace.d 2009-12-18 15:37:15.697243772 -0500
-@@ -0,0 +1,10 @@
-+provider python {
-+ probe function__entry(const char *, const char *, int);
-+ probe function__return(const char *, const char *, int);
-+};
-+
-+#pragma D attributes Evolving/Evolving/Common provider python provider
-+#pragma D attributes Private/Private/Common provider python module
-+#pragma D attributes Private/Private/Common provider python function
-+#pragma D attributes Evolving/Evolving/Common provider python name
-+#pragma D attributes Evolving/Evolving/Common provider python args
-diff -up Python-2.6.4/Makefile.pre.in.systemtap Python-2.6.4/Makefile.pre.in
---- Python-2.6.4/Makefile.pre.in.systemtap 2009-12-18 15:37:15.399242581 -0500
-+++ Python-2.6.4/Makefile.pre.in 2009-12-18 15:37:15.715242573 -0500
-@@ -290,6 +290,7 @@ PYTHON_OBJS= \
- Python/formatter_unicode.o \
- Python/formatter_string.o \
- Python/$(DYNLOADFILE) \
-+ @DTRACEOBJS@ \
- $(LIBOBJS) \
- $(MACHDEP_OBJS) \
- $(THREADOBJ)
-@@ -577,6 +578,18 @@ Python/formatter_unicode.o: $(srcdir)/Py
- Python/formatter_string.o: $(srcdir)/Python/formatter_string.c \
- $(STRINGLIB_HEADERS)
-
-+# Only needed with --with-dtrace
-+buildinclude:
-+ mkdir -p Include
-+
-+Include/pydtrace.h: buildinclude $(srcdir)/Include/pydtrace.d
-+ dtrace -o $@ $(DFLAGS) -C -h -s $(srcdir)/Include/pydtrace.d
-+
-+Python/ceval.o: Include/pydtrace.h
-+
-+Python/dtrace.o: buildinclude $(srcdir)/Include/pydtrace.d Python/ceval.o
-+ dtrace -o $@ $(DFLAGS) -C -G -s $(srcdir)/Include/pydtrace.d Python/ceval.o
-+
- ############################################################################
- # Header files
-
-@@ -1213,6 +1231,6 @@ Python/thread.o: @THREADHEADERS@
- .PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
- .PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
- .PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean
--.PHONY: smelly funny patchcheck
-+.PHONY: smelly funny patchcheck buildinclude
-
- # IF YOU PUT ANYTHING HERE IT WILL GO AWAY
-diff -up Python-2.6.4/pyconfig.h.in.systemtap Python-2.6.4/pyconfig.h.in
---- Python-2.6.4/pyconfig.h.in.systemtap 2009-12-18 15:37:15.649243175 -0500
-+++ Python-2.6.4/pyconfig.h.in 2009-12-18 15:37:15.719242803 -0500
-@@ -964,6 +989,9 @@
- /* Define if you want documentation strings in extension modules */
- #undef WITH_DOC_STRINGS
-
-+/* Define if you want to compile in Dtrace support */
-+#undef WITH_DTRACE
-+
- /* Define if you want to use the new-style (Openstep, Rhapsody, MacOS) dynamic
- linker (dyld) instead of the old-style (NextStep) dynamic linker (rld).
- Dyld is necessary to support frameworks. */
-diff -up Python-2.6.4/Python/ceval.c.systemtap Python-2.6.4/Python/ceval.c
---- Python-2.6.4/Python/ceval.c.systemtap 2009-05-30 17:43:48.000000000 -0400
-+++ Python-2.6.4/Python/ceval.c 2009-12-18 15:37:15.723242474 -0500
-@@ -19,6 +19,10 @@
-
- #include <ctype.h>
-
-+#ifdef WITH_DTRACE
-+#include "pydtrace.h"
-+#endif
-+
- #ifndef WITH_TSC
-
- #define READ_TIMESTAMP(var)
-@@ -527,6 +531,55 @@ PyEval_EvalCode(PyCodeObject *co, PyObje
- NULL);
- }
-
-+#ifdef WITH_DTRACE
-+static void
-+dtrace_entry(PyFrameObject *f)
-+{
-+ const char *filename;
-+ const char *fname;
-+ int lineno;
-+
-+ filename = PyString_AsString(f->f_code->co_filename);
-+ fname = PyString_AsString(f->f_code->co_name);
-+ lineno = PyCode_Addr2Line(f->f_code, f->f_lasti);
-+
-+ PYTHON_FUNCTION_ENTRY((char *)filename, (char *)fname, lineno);
-+
-+ /*
-+ * Currently a USDT tail-call will not receive the correct arguments.
-+ * Disable the tail call here.
-+ */
-+#if defined(__sparc)
-+ asm("nop");
-+#endif
-+}
-+
-+static void
-+dtrace_return(PyFrameObject *f)
-+{
-+ const char *filename;
-+ const char *fname;
-+ int lineno;
-+
-+ filename = PyString_AsString(f->f_code->co_filename);
-+ fname = PyString_AsString(f->f_code->co_name);
-+ lineno = PyCode_Addr2Line(f->f_code, f->f_lasti);
-+ PYTHON_FUNCTION_RETURN((char *)filename, (char *)fname, lineno);
-+
-+ /*
-+ * Currently a USDT tail-call will not receive the correct arguments.
-+ * Disable the tail call here.
-+ */
-+#if defined(__sparc)
-+ asm("nop");
-+#endif
-+}
-+#else
-+#define PYTHON_FUNCTION_ENTRY_ENABLED() 0
-+#define PYTHON_FUNCTION_RETURN_ENABLED() 0
-+#define dtrace_entry(f)
-+#define dtrace_return(f)
-+#endif
-
- /* Interpreter main loop */
-
-@@ -763,6 +891,9 @@ PyEval_EvalFrameEx(PyFrameObject *f, int
- }
- }
-
-+ if (PYTHON_FUNCTION_ENTRY_ENABLED())
-+ dtrace_entry(f);
-+
- co = f->f_code;
- names = co->co_names;
- consts = co->co_consts;
-@@ -2723,6 +2863,8 @@ fast_yield:
-
- /* pop frame */
- exit_eval_frame:
-+ if (PYTHON_FUNCTION_RETURN_ENABLED())
-+ dtrace_return(f);
- Py_LeaveRecursiveCall();
- tstate->frame = f->f_back;
-
diff --git a/python-2.6.4-no-static-lib.patch b/python-2.6.4-no-static-lib.patch
deleted file mode 100644
index 57caafc..0000000
--- a/python-2.6.4-no-static-lib.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-diff -up Python-2.6.4/Makefile.pre.in.no-static-lib Python-2.6.4/Makefile.pre.in
---- Python-2.6.4/Makefile.pre.in.no-static-lib 2010-01-18 13:11:10.975859689 -0500
-+++ Python-2.6.4/Makefile.pre.in 2010-01-18 13:14:27.524859334 -0500
-@@ -382,7 +382,7 @@ coverage:
-
-
- # Build the interpreter
--$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
-+$(BUILDPYTHON): Modules/python.o $(LDLIBRARY)
- $(LINKCC) $(CFLAGS) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
- Modules/python.o \
- $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
-@@ -398,18 +398,6 @@ sharedmods: $(BUILDPYTHON)
- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)'
./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
- esac
-
--# Build static library
--# avoid long command lines, same as LIBRARY_OBJS
--$(LIBRARY): $(LIBRARY_OBJS)
-- -rm -f $@
-- $(AR) cr $@ Modules/getbuildinfo.o
-- $(AR) cr $@ $(PARSER_OBJS)
-- $(AR) cr $@ $(OBJECT_OBJS)
-- $(AR) cr $@ $(PYTHON_OBJS)
-- $(AR) cr $@ $(MODULE_OBJS) $(SIGNAL_OBJS)
-- $(AR) cr $@ $(MODOBJS)
-- $(RANLIB) $@
--
- libpython$(VERSION).so: $(LIBRARY_OBJS)
- if test $(INSTSONAME) != $(LDLIBRARY); then \
- $(LDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS)
$(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
-@@ -945,18 +933,6 @@ libainstall: all
- else true; \
- fi; \
- done
-- @if test -d $(LIBRARY); then :; else \
-- if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
-- if test "$(SO)" = .dll; then \
-- $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
-- else \
-- $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
-- $(RANLIB) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
-- fi; \
-- else \
-- echo Skip install of $(LIBRARY) - use make frameworkinstall; \
-- fi; \
-- fi
- $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
- $(INSTALL_DATA) Modules/python.o $(DESTDIR)$(LIBPL)/python.o
- $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
diff --git a/python-2.6.5-db48.patch b/python-2.6.5-db48.patch
deleted file mode 100644
index d07a42a..0000000
--- a/python-2.6.5-db48.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-Index: setup.py
-===================================================================
---- setup.py (revision 78973)
-+++ setup.py (revision 78974)
-@@ -707,7 +707,7 @@
- # a release. Most open source OSes come with one or more
- # versions of BerkeleyDB already installed.
-
-- max_db_ver = (4, 7)
-+ max_db_ver = (4, 8)
- min_db_ver = (3, 3)
- db_setup_debug = False # verbose debug prints from this script?
-
-Index: Lib/bsddb/test/test_basics.py
-===================================================================
---- Lib/bsddb/test/test_basics.py (revision 78973)
-+++ Lib/bsddb/test/test_basics.py (revision 78974)
-@@ -1000,11 +1000,12 @@
- # # See
http://bugs.python.org/issue3307
- # self.assertRaises(db.DBInvalidArgError, db.DB, None, 65535)
-
-- def test02_DBEnv_dealloc(self):
-- #
http://bugs.python.org/issue3885
-- import gc
-- self.assertRaises(db.DBInvalidArgError, db.DBEnv, ~db.DB_RPCCLIENT)
-- gc.collect()
-+ if db.version() < (4, 8) :
-+ def test02_DBEnv_dealloc(self):
-+ #
http://bugs.python.org/issue3885
-+ import gc
-+ self.assertRaises(db.DBInvalidArgError, db.DBEnv, ~db.DB_RPCCLIENT)
-+ gc.collect()
-
-
- #----------------------------------------------------------------------
-Index: Lib/bsddb/test/test_distributed_transactions.py
-===================================================================
---- Lib/bsddb/test/test_distributed_transactions.py (revision 78973)
-+++ Lib/bsddb/test/test_distributed_transactions.py (revision 78974)
-@@ -35,7 +35,7 @@
- db.DB_INIT_TXN | db.DB_INIT_LOG | db.DB_INIT_MPOOL |
- db.DB_INIT_LOCK, 0666)
- self.db = db.DB(self.dbenv)
-- self.db.set_re_len(db.DB_XIDDATASIZE)
-+ self.db.set_re_len(db.DB_GID_SIZE)
- if must_open_db :
- if db.version() > (4,1) :
- txn=self.dbenv.txn_begin()
-@@ -76,7 +76,7 @@
- # let them be garbage collected.
- for i in xrange(self.num_txns) :
- txn = self.dbenv.txn_begin()
-- gid = "%%%dd" %db.DB_XIDDATASIZE
-+ gid = "%%%dd" %db.DB_GID_SIZE
- gid = adapt(gid %i)
- self.db.put(i, gid, txn=txn, flags=db.DB_APPEND)
- txns.add(gid)
-Index: Modules/_bsddb.c
-===================================================================
---- Modules/_bsddb.c (revision 78973)
-+++ Modules/_bsddb.c (revision 78974)
-@@ -215,7 +215,11 @@
- #define DB_BUFFER_SMALL ENOMEM
- #endif
-
-+#if (DBVER < 48)
-+#define DB_GID_SIZE DB_XIDDATASIZE
-+#endif
-
-+
- /* --------------------------------------------------------------------- */
- /* Structure definitions */
-
-@@ -4501,7 +4505,11 @@
- DBTxnObject *txn;
- #define PREPLIST_LEN 16
- DB_PREPLIST preplist[PREPLIST_LEN];
-+#if (DBVER < 48)
- long retp;
-+#else
-+ u_int32_t retp;
-+#endif
-
- CHECK_ENV_NOT_CLOSED(self);
-
-@@ -4522,7 +4530,7 @@
- flags=DB_NEXT; /* Prepare for next loop pass */
- for (i=0; i<retp; i++) {
- gid=PyBytes_FromStringAndSize((char *)(preplist[i].gid),
-- DB_XIDDATASIZE);
-+ DB_GID_SIZE);
- if (!gid) {
- Py_DECREF(list);
- return NULL;
-@@ -5047,6 +5055,7 @@
- }
-
-
-+#if (DBVER < 48)
- static PyObject*
- DBEnv_set_rpc_server(DBEnvObject* self, PyObject* args, PyObject* kwargs)
- {
-@@ -5068,6 +5077,7 @@
- RETURN_IF_ERR();
- RETURN_NONE();
- }
-+#endif
-
- static PyObject*
- DBEnv_set_verbose(DBEnvObject* self, PyObject* args)
-@@ -5949,9 +5959,9 @@
- if (!PyArg_ParseTuple(args, "s#:prepare", &gid, &gid_size))
- return NULL;
-
-- if (gid_size != DB_XIDDATASIZE) {
-+ if (gid_size != DB_GID_SIZE) {
- PyErr_SetString(PyExc_TypeError,
-- "gid must be DB_XIDDATASIZE bytes long");
-+ "gid must be DB_GID_SIZE bytes long");
- return NULL;
- }
-
-@@ -6541,8 +6551,10 @@
- #endif
- {"set_get_returns_none",(PyCFunction)DBEnv_set_get_returns_none,
METH_VARARGS},
- {"txn_recover", (PyCFunction)DBEnv_txn_recover, METH_NOARGS},
-+#if (DBVER < 48)
- {"set_rpc_server", (PyCFunction)DBEnv_set_rpc_server,
- METH_VARARGS||METH_KEYWORDS},
-+#endif
- {"set_verbose", (PyCFunction)DBEnv_set_verbose, METH_VARARGS},
- #if (DBVER >= 42)
- {"get_verbose", (PyCFunction)DBEnv_get_verbose, METH_VARARGS},
-@@ -7091,6 +7103,7 @@
- ADD_INT(d, DB_MAX_PAGES);
- ADD_INT(d, DB_MAX_RECORDS);
-
-+#if (DBVER < 48)
- #if (DBVER >= 42)
- ADD_INT(d, DB_RPCCLIENT);
- #else
-@@ -7098,7 +7111,11 @@
- /* allow apps to be written using DB_RPCCLIENT on older Berkeley DB */
- _addIntToDict(d, "DB_RPCCLIENT", DB_CLIENT);
- #endif
-+#endif
-+
-+#if (DBVER < 48)
- ADD_INT(d, DB_XA_CREATE);
-+#endif
-
- ADD_INT(d, DB_CREATE);
- ADD_INT(d, DB_NOMMAP);
-@@ -7115,7 +7132,13 @@
- ADD_INT(d, DB_INIT_TXN);
- ADD_INT(d, DB_JOINENV);
-
-+#if (DBVER >= 48)
-+ ADD_INT(d, DB_GID_SIZE);
-+#else
- ADD_INT(d, DB_XIDDATASIZE);
-+ /* Allow new code to work in old BDB releases */
-+ _addIntToDict(d, "DB_GID_SIZE", DB_XIDDATASIZE);
-+#endif
-
- ADD_INT(d, DB_RECOVER);
- ADD_INT(d, DB_RECOVER_FATAL);
diff --git a/python-2.6.5-debug-build.patch b/python-2.6.5-debug-build.patch
deleted file mode 100644
index 6310e3d..0000000
--- a/python-2.6.5-debug-build.patch
+++ /dev/null
@@ -1,240 +0,0 @@
-diff -up Python-2.6.5/configure.in.debug-build Python-2.6.5/configure.in
---- Python-2.6.5/configure.in.debug-build 2010-05-19 17:09:31.975902056 -0400
-+++ Python-2.6.5/configure.in 2010-05-19 17:09:31.986901987 -0400
-@@ -620,7 +620,7 @@ AC_SUBST(LIBRARY)
- AC_MSG_CHECKING(LIBRARY)
- if test -z "$LIBRARY"
- then
-- LIBRARY='libpython$(VERSION).a'
-+ LIBRARY='libpython$(VERSION)$(DEBUG_EXT).a'
- fi
- AC_MSG_RESULT($LIBRARY)
-
-@@ -748,8 +748,8 @@ if test $enable_shared = "yes"; then
- INSTSONAME="$LDLIBRARY".$SOVERSION
- ;;
- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*)
-- LDLIBRARY='libpython$(VERSION).so'
-- BLDLIBRARY='-L. -lpython$(VERSION)'
-+ LDLIBRARY='libpython$(VERSION)$(DEBUG_EXT).so'
-+ BLDLIBRARY='-L. -lpython$(VERSION)$(DEBUG_EXT)'
- RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
- case $ac_sys_system in
- FreeBSD*)
-@@ -847,6 +847,14 @@ else AC_MSG_RESULT(no); Py_DEBUG='false'
- fi],
- [AC_MSG_RESULT(no)])
-
-+if test "$Py_DEBUG" = 'true'
-+then
-+ DEBUG_EXT=_d
-+ DEBUG_SUFFIX=-debug
-+fi
-+AC_SUBST(DEBUG_EXT)
-+AC_SUBST(DEBUG_SUFFIX)
-+
- # XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
- # merged with this chunk of code?
-
-diff -up Python-2.6.5/Lib/distutils/command/build_ext.py.debug-build
Python-2.6.5/Lib/distutils/command/build_ext.py
---- Python-2.6.5/Lib/distutils/command/build_ext.py.debug-build 2009-10-13
17:17:34.000000000 -0400
-+++ Python-2.6.5/Lib/distutils/command/build_ext.py 2010-05-19 18:17:14.678196678 -0400
-@@ -677,7 +677,10 @@ class build_ext (Command):
- so_ext = get_config_var('SO')
- if os.name == 'nt' and self.debug:
- return apply(os.path.join, ext_path) + '_d' + so_ext
-- return os.path.join(*ext_path) + so_ext
-+
-+ # Similarly, extensions in debug mode are named 'module_d.so', to
-+ # avoid adding the _d to the SO config variable:
-+ return os.path.join(*ext_path) + (sys.pydebug and "_d" or
"") + so_ext
-
- def get_export_symbols (self, ext):
- """Return the list of symbols that a shared extension has to
-@@ -760,6 +763,8 @@ class build_ext (Command):
- template = "python%d.%d"
- pythonlib = (template %
- (sys.hexversion >> 24, (sys.hexversion >> 16)
& 0xff))
-+ if sys.pydebug:
-+ pythonlib += '_d'
- return ext.libraries + [pythonlib]
- else:
- return ext.libraries
-diff -up Python-2.6.5/Lib/distutils/sysconfig.py.debug-build
Python-2.6.5/Lib/distutils/sysconfig.py
---- Python-2.6.5/Lib/distutils/sysconfig.py.debug-build 2010-05-19 17:09:31.926155519
-0400
-+++ Python-2.6.5/Lib/distutils/sysconfig.py 2010-05-19 17:09:31.987902863 -0400
-@@ -81,7 +81,8 @@ def get_python_inc(plat_specific=0, pref
- if not os.path.exists(inc_dir):
- inc_dir = os.path.join(os.path.dirname(base), "Include")
- return inc_dir
-- return os.path.join(prefix, "include", "python" +
get_python_version())
-+ return os.path.join(prefix, "include",
-+ "python" + get_python_version() + (sys.pydebug and
'-debug' or ''))
- elif os.name == "nt":
- return os.path.join(prefix, "include")
- elif os.name == "mac":
-@@ -224,7 +225,7 @@ def get_makefile_filename():
- if python_build:
- return os.path.join(os.path.dirname(sys.executable), "Makefile")
- lib_dir = get_python_lib(plat_specific=1, standard_lib=1)
-- return os.path.join(lib_dir, "config", "Makefile")
-+ return os.path.join(lib_dir, "config" + (sys.pydebug and
"-debug" or ""), "Makefile")
-
-
- def parse_config_h(fp, g=None):
-diff -up Python-2.6.5/Makefile.pre.in.debug-build Python-2.6.5/Makefile.pre.in
---- Python-2.6.5/Makefile.pre.in.debug-build 2010-05-19 17:09:31.984901988 -0400
-+++ Python-2.6.5/Makefile.pre.in 2010-05-19 17:09:31.987902863 -0400
-@@ -96,8 +96,8 @@ SCRIPTDIR= $(prefix)/lib64
- # Detailed destination directories
- BINLIBDEST= $(LIBDIR)/python$(VERSION)
- LIBDEST= $(SCRIPTDIR)/python$(VERSION)
--INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
--CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)
-+INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)$(DEBUG_SUFFIX)
-+CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)$(DEBUG_SUFFIX)
- LIBP= $(LIBDIR)/python$(VERSION)
-
- # Symbols used for using shared libraries
-@@ -110,6 +110,12 @@ DESTSHARED= $(BINLIBDEST)/lib-dynload
- EXE= @EXEEXT@
- BUILDEXE= @BUILDEXEEXT@
-
-+# DEBUG_EXT is used by ELF files (names and SONAMEs); it will be "_d" for a
debug build
-+# DEBUG_SUFFIX is used by filesystem paths; it will be "-debug" for a debug
build
-+# Both will be empty in an optimized build
-+DEBUG_EXT= @DEBUG_EXT@
-+DEBUG_SUFFIX= @DEBUG_SUFFIX@
-+
- # Short name and location for Mac OS X Python framework
- UNIVERSALSDK=@UNIVERSALSDK@
- PYTHONFRAMEWORK= @PYTHONFRAMEWORK@
-@@ -173,8 +179,8 @@ LIBOBJDIR= Python/
- LIBOBJS= @LIBOBJS@
- UNICODE_OBJS= @UNICODE_OBJS@
-
--PYTHON= python$(EXE)
--BUILDPYTHON= python$(BUILDEXE)
-+PYTHON= python$(DEBUG_SUFFIX)$(EXE)
-+BUILDPYTHON= python$(DEBUG_SUFFIX)$(BUILDEXE)
-
- # The task to run while instrument when building the profile-opt target
- PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck
-@@ -399,7 +405,7 @@ sharedmods: $(BUILDPYTHON)
- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)'
./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
- esac
-
--libpython$(VERSION).so: $(LIBRARY_OBJS)
-+libpython$(VERSION)$(DEBUG_EXT).so: $(LIBRARY_OBJS)
- if test $(INSTSONAME) != $(LDLIBRARY); then \
- $(LDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS)
$(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
- $(LN) -f $(INSTSONAME) $@; \
-@@ -761,9 +767,9 @@ bininstall: altbininstall
- then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON); \
- else true; \
- fi
-- (cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON))
-- -rm -f $(DESTDIR)$(BINDIR)/python-config
-- (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python-config)
-+ (cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(DEBUG_SUFFIX)$(EXE) $(PYTHON))
-+ -rm -f $(DESTDIR)$(BINDIR)/python$(DEBUG_SUFFIX)-config
-+ (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(DEBUG_SUFFIX)-config
python$(DEBUG_SUFFIX)-config)
-
- # Install the interpreter with $(VERSION) affixed
- # This goes into $(exec_prefix)
-@@ -776,7 +782,7 @@ altbininstall: $(BUILDPYTHON)
- else true; \
- fi; \
- done
-- $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE)
-+ $(INSTALL_PROGRAM) $(BUILDPYTHON)
$(DESTDIR)$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)$(EXE)
- if test -f $(LDLIBRARY); then \
- if test -n "$(DLLLIBRARY)" ; then \
- $(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
-@@ -935,8 +941,8 @@ inclinstall:
- $(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
-
- # Install the library and miscellaneous stuff needed for extending/embedding
--# This goes into $(exec_prefix)
--LIBPL= $(LIBP)/config
-+# This goes into $(exec_prefix)$(DEBUG_SUFFIX)
-+LIBPL= $(LIBP)/config$(DEBUG_SUFFIX)
- libainstall: all
- @for i in $(LIBDIR) $(LIBP) $(LIBPL); \
- do \
-@@ -957,9 +963,9 @@ libainstall: all
- $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
- # 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
-- $(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(VERSION)-config
-- rm python-config
-+ sed -e "s,@EXENAME@,$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)$(EXE)," <
$(srcdir)/Misc/python-config.in >python$(DEBUG_SUFFIX)-config
-+ $(INSTALL_SCRIPT) python$(DEBUG_SUFFIX)-config
$(DESTDIR)$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)-config
-+ rm python$(DEBUG_SUFFIX)-config
- @if [ -s Modules/python.exp -a \
- "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ];
then \
- echo; echo "Installing support files for building shared extension modules on
AIX:"; \
-diff -up Python-2.6.5/Misc/python-config.in.debug-build
Python-2.6.5/Misc/python-config.in
---- Python-2.6.5/Misc/python-config.in.debug-build 2007-03-31 14:56:11.000000000 -0400
-+++ Python-2.6.5/Misc/python-config.in 2010-05-19 17:09:31.987902863 -0400
-@@ -44,7 +44,7 @@ elif opt in ('--includes', '--cflags'):
-
- 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
""))
- # add the prefix/lib/pythonX.Y/config dir, but only if there is no
- # shared library in prefix/lib/.
- if opt == '--ldflags' and not getvar('Py_ENABLE_SHARED'):
-diff -up Python-2.6.5/Modules/makesetup.debug-build Python-2.6.5/Modules/makesetup
---- Python-2.6.5/Modules/makesetup.debug-build 2007-09-05 07:47:34.000000000 -0400
-+++ Python-2.6.5/Modules/makesetup 2010-05-19 17:09:31.987902863 -0400
-@@ -233,7 +233,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
- *$mod.o*) base=$mod;;
- *) base=${mod}module;;
- esac
-- file="$srcdir/$base\$(SO)"
-+ file="$srcdir/$base\$(DEBUG_EXT)\$(SO)"
- case $doconfig in
- no) SHAREDMODS="$SHAREDMODS $file";;
- esac
-diff -up Python-2.6.5/Python/dynload_shlib.c.debug-build
Python-2.6.5/Python/dynload_shlib.c
---- Python-2.6.5/Python/dynload_shlib.c.debug-build 2006-01-03 20:30:17.000000000 -0500
-+++ Python-2.6.5/Python/dynload_shlib.c 2010-05-19 17:09:31.988902536 -0400
-@@ -46,11 +46,16 @@ const struct filedescr _PyImport_DynLoad
- {"module.exe", "rb", C_EXTENSION},
- {"MODULE.EXE", "rb", C_EXTENSION},
- #else
-+#ifdef Py_DEBUG
-+ {"_d.so", "rb", C_EXTENSION},
-+ {"module_d.so", "rb", C_EXTENSION},
-+#else
- {".so", "rb", C_EXTENSION},
- {"module.so", "rb", C_EXTENSION},
--#endif
--#endif
--#endif
-+#endif /* Py_DEBUG */
-+#endif /* __VMS */
-+#endif /* defined(PYOS_OS2) && defined(PYCC_GCC) */
-+#endif /* __CYGWIN__ */
- {0, 0}
- };
-
-diff -up Python-2.6.5/Python/sysmodule.c.debug-build Python-2.6.5/Python/sysmodule.c
---- Python-2.6.5/Python/sysmodule.c.debug-build 2010-03-03 07:31:33.000000000 -0500
-+++ Python-2.6.5/Python/sysmodule.c 2010-05-19 17:09:31.988902536 -0400
-@@ -1436,6 +1436,12 @@ _PySys_Init(void)
- FlagsType.tp_init = NULL;
- FlagsType.tp_new = NULL;
-
-+#ifdef Py_DEBUG
-+ PyDict_SetItemString(sysdict, "pydebug", Py_True);
-+#else
-+ PyDict_SetItemString(sysdict, "pydebug", Py_False);
-+#endif
-+
- #undef SET_SYS_FROM_STRING
- if (PyErr_Occurred())
- return NULL;
diff --git a/python-2.6.5-remove-PyUnicodeDecodeError_Create-assertions-issue9058.patch
b/python-2.6.5-remove-PyUnicodeDecodeError_Create-assertions-issue9058.patch
deleted file mode 100644
index 113305a..0000000
--- a/python-2.6.5-remove-PyUnicodeDecodeError_Create-assertions-issue9058.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-Index: Objects/exceptions.c
-===================================================================
---- Objects/exceptions.c (revision 82153)
-+++ Objects/exceptions.c (working copy)
-@@ -1784,9 +1784,6 @@
- const char *encoding, const char *object, Py_ssize_t length,
- Py_ssize_t start, Py_ssize_t end, const char *reason)
- {
-- assert(length < INT_MAX);
-- assert(start < INT_MAX);
-- assert(end < INT_MAX);
- return PyObject_CallFunction(PyExc_UnicodeDecodeError, "ss#nns",
- encoding, object, length, start, end, reason);
- }
diff --git a/python-2.6.5-statvfs-f_flag-constants.patch
b/python-2.6.5-statvfs-f_flag-constants.patch
deleted file mode 100644
index 4b3390d..0000000
--- a/python-2.6.5-statvfs-f_flag-constants.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 21fda4c78000d78cb1824fdf0373031d07f5325a Mon Sep 17 00:00:00 2001
-From: Peter Jones <pjones(a)redhat.com>
-Date: Wed, 6 Jan 2010 15:22:38 -0500
-Subject: [PATCH] Add flags for statvfs.f_flag to constant list.
-
-You really need these to figure out what statvfs is trying to say to
-you, so add them here.
----
- Modules/posixmodule.c | 37 +++++++++++++++++++++++++++++++++++++
- 1 files changed, 37 insertions(+), 0 deletions(-)
-
-diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
-index ebdbc8d..d79013b 100644
---- a/Modules/posixmodule.c
-+++ b/Modules/posixmodule.c
-@@ -8990,6 +8990,43 @@ all_ins(PyObject *d)
- #endif
- #endif
-
-+ /* These came from statvfs.h */
-+#ifdef ST_RDONLY
-+ if (ins(d, "ST_RDONLY", (long)ST_RDONLY)) return -1;
-+#endif /* ST_RDONLY */
-+#ifdef ST_NOSUID
-+ if (ins(d, "ST_NOSUID", (long)ST_NOSUID)) return -1;
-+#endif /* ST_NOSUID */
-+
-+ /* GNU extensions */
-+#ifdef ST_NODEV
-+ if (ins(d, "ST_NODEV", (long)ST_NODEV)) return -1;
-+#endif /* ST_NODEV */
-+#ifdef ST_NOEXEC
-+ if (ins(d, "ST_NOEXEC", (long)ST_NOEXEC)) return -1;
-+#endif /* ST_NOEXEC */
-+#ifdef ST_SYNCHRONOUS
-+ if (ins(d, "ST_SYNCHRONOUS", (long)ST_SYNCHRONOUS)) return -1;
-+#endif /* ST_SYNCHRONOUS */
-+#ifdef ST_MANDLOCK
-+ if (ins(d, "ST_MANDLOCK", (long)ST_MANDLOCK)) return -1;
-+#endif /* ST_MANDLOCK */
-+#ifdef ST_WRITE
-+ if (ins(d, "ST_WRITE", (long)ST_WRITE)) return -1;
-+#endif /* ST_WRITE */
-+#ifdef ST_APPEND
-+ if (ins(d, "ST_APPEND", (long)ST_APPEND)) return -1;
-+#endif /* ST_APPEND */
-+#ifdef ST_NOATIME
-+ if (ins(d, "ST_NOATIME", (long)ST_NOATIME)) return -1;
-+#endif /* ST_NOATIME */
-+#ifdef ST_NODIRATIME
-+ if (ins(d, "ST_NODIRATIME", (long)ST_NODIRATIME)) return -1;
-+#endif /* ST_NODIRATIME */
-+#ifdef ST_RELATIME
-+ if (ins(d, "ST_RELATIME", (long)ST_RELATIME)) return -1;
-+#endif /* ST_RELATIME */
-+
- #if defined(PYOS_OS2)
- if (insertvalues(d)) return -1;
- #endif
---
-1.6.6
-
diff --git a/python-2.7-autotool-intermediates.patch
b/python-2.7-autotool-intermediates.patch
new file mode 100644
index 0000000..8f83847
--- /dev/null
+++ b/python-2.7-autotool-intermediates.patch
@@ -0,0 +1,223 @@
+diff -up ./configure.autotool-intermediates ./configure
+--- ./configure.autotool-intermediates 2010-07-08 13:12:59.973249048 -0400
++++ ./configure 2010-07-08 13:13:00.827247975 -0400
+@@ -1,5 +1,5 @@
+ #! /bin/sh
+-# From configure.in Revision: 81509 .
++# From configure.in Revision: 81582 .
+ # Guess values for system-dependent variables and create Makefiles.
+ # Generated by GNU Autoconf 2.65 for python 2.7.
+ #
+@@ -611,6 +611,8 @@ TRUE
+ MACHDEP_OBJS
+ DYNLOADFILE
+ DLINCLDIR
++DTRACEHDRS
++DTRACEOBJS
+ THREADOBJ
+ LDLAST
+ USE_THREAD_MODULE
+@@ -631,6 +633,8 @@ OTHER_LIBTOOL_OPT
+ UNIVERSAL_ARCH_FLAGS
+ BASECFLAGS
+ OPT
++DEBUG_SUFFIX
++DEBUG_EXT
+ LN
+ INSTALL_DATA
+ INSTALL_SCRIPT
+@@ -748,8 +752,11 @@ with_pth
+ enable_ipv6
+ with_doc_strings
+ with_tsc
++with_count_allocs
++with_call_profile
+ with_pymalloc
+ with_valgrind
++with_dtrace
+ with_wctype_functions
+ with_fpectl
+ with_libm
+@@ -1422,8 +1429,11 @@ Optional Packages:
+ --with-pth use GNU pth threading libraries
+ --with(out)-doc-strings disable/enable documentation strings
+ --with(out)-tsc enable/disable timestamp counter profile
++ --with(out)count-allocs enable/disable per-type instance accounting
++ --with(out)-call-profile enable/disable statistics on function call invocation
+ --with(out)-pymalloc disable/enable specialized mallocs
+ --with-valgrind Enable Valgrind support
++ --with(out)-dtrace disable/enable dtrace support
+ --with-wctype-functions use wctype.h functions
+ --with-fpectl enable SIGFPE catching
+ --with-libm=STRING math library
+@@ -4739,7 +4749,7 @@ esac
+ $as_echo_n "checking LIBRARY... " >&6; }
+ if test -z "$LIBRARY"
+ then
+- LIBRARY='libpython$(VERSION).a'
++ LIBRARY='libpython$(VERSION)$(DEBUG_EXT).a'
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBRARY" >&5
+ $as_echo "$LIBRARY" >&6; }
+@@ -4913,8 +4923,8 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>
+ INSTSONAME="$LDLIBRARY".$SOVERSION
+ ;;
+ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*)
+- LDLIBRARY='libpython$(VERSION).so'
+- BLDLIBRARY='-L. -lpython$(VERSION)'
++ LDLIBRARY='libpython$(VERSION)$(DEBUG_EXT).so'
++ BLDLIBRARY='-L. -lpython$(VERSION)$(DEBUG_EXT)'
+ RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
+ case $ac_sys_system in
+ FreeBSD*)
+@@ -4937,7 +4947,7 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>
+ ;;
+ OSF*)
+ LDLIBRARY='libpython$(VERSION).so'
+- BLDLIBRARY='-rpath $(LIBDIR) -L. -lpython$(VERSION)'
++ BLDLIBRARY='-L. -lpython$(VERSION)'
+ RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
+ ;;
+ atheos*)
+@@ -5314,6 +5324,14 @@ $as_echo "no" >&6; }
+ fi
+
+
++if test "$Py_DEBUG" = 'true'
++then
++ DEBUG_EXT=_d
++ DEBUG_SUFFIX=-debug
++fi
++
++
++
+ # XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
+ # merged with this chunk of code?
+
+@@ -9326,6 +9344,50 @@ $as_echo "no" >&6; }
+ fi
+
+
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-count-allocs"
>&5
++$as_echo_n "checking for --with-count-allocs... " >&6; }
++
++# Check whether --with-count-allocs was given.
++if test "${with_count_allocs+set}" = set; then :
++ withval=$with_count_allocs;
++if test "$withval" != no
++then
++
++$as_echo "#define COUNT_ALLOCS 1" >>confdefs.h
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
++$as_echo "yes" >&6; }
++else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-call-profile"
>&5
++$as_echo_n "checking for --with-call-profile... " >&6; }
++
++# Check whether --with-call-profile was given.
++if test "${with_call_profile+set}" = set; then :
++ withval=$with_call_profile;
++if test "$withval" != no
++then
++
++$as_echo "#define CALL_PROFILE 1" >>confdefs.h
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
++$as_echo "yes" >&6; }
++else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
+ # Check for Python-specific malloc support
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-pymalloc"
>&5
+ $as_echo_n "checking for --with-pymalloc... " >&6; }
+@@ -9375,6 +9437,46 @@ fi
+
+ fi
+
++# Check for dtrace support
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-dtrace"
>&5
++$as_echo_n "checking for --with-dtrace... " >&6; }
++
++# Check whether --with-dtrace was given.
++if test "${with_dtrace+set}" = set; then :
++ withval=$with_dtrace;
++fi
++
++
++if test ! -z "$with_dtrace"
++then
++ if dtrace -G -o /dev/null -s $srcdir/Include/pydtrace.d 2>/dev/null
++ then
++
++$as_echo "#define WITH_DTRACE 1" >>confdefs.h
++
++ with_dtrace="Sun"
++ DTRACEOBJS="Python/dtrace.o"
++ DTRADEHDRS=""
++ elif dtrace -h -o /dev/null -s $srcdir/Include/pydtrace.d
++ then
++
++$as_echo "#define WITH_DTRACE 1" >>confdefs.h
++
++ with_dtrace="Apple"
++ DTRACEOBJS=""
++ DTRADEHDRS="pydtrace.h"
++ else
++ with_dtrace="no"
++ fi
++else
++ with_dtrace="no"
++fi
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_dtrace" >&5
++$as_echo "$with_dtrace" >&6; }
++
++
++
+ # Check for --with-wctype-functions
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-wctype-functions"
>&5
+ $as_echo_n "checking for --with-wctype-functions... " >&6; }
+diff -up ./pyconfig.h.in.autotool-intermediates ./pyconfig.h.in
+--- ./pyconfig.h.in.autotool-intermediates 2010-07-08 13:12:59.970252469 -0400
++++ ./pyconfig.h.in 2010-07-08 13:13:01.066127223 -0400
+@@ -18,6 +18,12 @@
+ /* Define this if you have BeOS threads. */
+ #undef BEOS_THREADS
+
++/* Define to keep records on function call invocation */
++#undef CALL_PROFILE
++
++/* Define to keep records of the number of instances of each type */
++#undef COUNT_ALLOCS
++
+ /* Define if you have the Mach cthreads package */
+ #undef C_THREADS
+
+@@ -1098,12 +1104,6 @@
+ /* Define to profile with the Pentium timestamp counter */
+ #undef WITH_TSC
+
+-/* Define to keep records of the number of instances of each type */
+-#undef COUNT_ALLOCS
+-
+-/* Define to keep records on function call invocation */
+-#undef CALL_PROFILE
+-
+ /* Define if you want pymalloc to be disabled when running under valgrind */
+ #undef WITH_VALGRIND
+
diff --git a/python-2.7-lib64-sysconfig.patch b/python-2.7-lib64-sysconfig.patch
new file mode 100644
index 0000000..0cef361
--- /dev/null
+++ b/python-2.7-lib64-sysconfig.patch
@@ -0,0 +1,44 @@
+diff -up Python-2.7/Lib/sysconfig.py.lib64-sysconfig Python-2.7/Lib/sysconfig.py
+--- Python-2.7/Lib/sysconfig.py.lib64-sysconfig 2010-07-08 14:18:41.386898476 -0400
++++ Python-2.7/Lib/sysconfig.py 2010-07-08 14:22:02.837896461 -0400
+@@ -7,20 +7,20 @@ from os.path import pardir, realpath
+
+ _INSTALL_SCHEMES = {
+ 'posix_prefix': {
+- 'stdlib': '{base}/lib/python{py_version_short}',
+- 'platstdlib': '{platbase}/lib/python{py_version_short}',
++ 'stdlib': '{base}/lib64/python{py_version_short}',
++ 'platstdlib': '{platbase}/lib64/python{py_version_short}',
+ 'purelib': '{base}/lib/python{py_version_short}/site-packages',
+- 'platlib':
'{platbase}/lib/python{py_version_short}/site-packages',
++ 'platlib':
'{platbase}/lib64/python{py_version_short}/site-packages',
+ 'include': '{base}/include/python{py_version_short}',
+ 'platinclude': '{platbase}/include/python{py_version_short}',
+ 'scripts': '{base}/bin',
+ 'data': '{base}',
+ },
+ 'posix_home': {
+- 'stdlib': '{base}/lib/python',
+- 'platstdlib': '{base}/lib/python',
++ 'stdlib': '{base}/lib64/python',
++ 'platstdlib': '{base}/lib64/python',
+ 'purelib': '{base}/lib/python',
+- 'platlib': '{base}/lib/python',
++ 'platlib': '{base}/lib64/python',
+ 'include': '{base}/include/python',
+ 'platinclude': '{base}/include/python',
+ 'scripts': '{base}/bin',
+@@ -65,10 +65,10 @@ _INSTALL_SCHEMES = {
+ 'data' : '{userbase}',
+ },
+ 'posix_user': {
+- 'stdlib': '{userbase}/lib/python{py_version_short}',
+- 'platstdlib': '{userbase}/lib/python{py_version_short}',
++ 'stdlib': '{userbase}/lib64/python{py_version_short}',
++ 'platstdlib': '{userbase}/lib64/python{py_version_short}',
+ 'purelib':
'{userbase}/lib/python{py_version_short}/site-packages',
+- 'platlib':
'{userbase}/lib/python{py_version_short}/site-packages',
++ 'platlib':
'{userbase}/lib64/python{py_version_short}/site-packages',
+ 'include': '{userbase}/include/python{py_version_short}',
+ 'scripts': '{userbase}/bin',
+ 'data' : '{userbase}',
diff --git a/python-2.7rc1-binutils-no-dep.patch b/python-2.7rc1-binutils-no-dep.patch
new file mode 100644
index 0000000..ee6157c
--- /dev/null
+++ b/python-2.7rc1-binutils-no-dep.patch
@@ -0,0 +1,14 @@
+diff -up Python-2.7rc1/Lib/ctypes/util.py.binutils-no-dep
Python-2.7rc1/Lib/ctypes/util.py
+--- Python-2.7rc1/Lib/ctypes/util.py.binutils-no-dep 2010-03-15 09:42:23.000000000 -0400
++++ Python-2.7rc1/Lib/ctypes/util.py 2010-06-06 05:03:02.155975210 -0400
+@@ -140,7 +140,9 @@ elif os.name == "posix":
+ dump = f.read()
+ rv = f.close()
+ if rv == 10:
+- raise OSError, 'objdump command not found'
++ return os.path.basename(f) # This is good for GLibc, I think,
++ # and a dep on binutils is big (for
++ # live CDs).
+ f = os.popen(cmd)
+ try:
+ data = f.read()
diff --git a/python-2.7rc1-codec-ascii-tolower.patch
b/python-2.7rc1-codec-ascii-tolower.patch
new file mode 100644
index 0000000..bd70c40
--- /dev/null
+++ b/python-2.7rc1-codec-ascii-tolower.patch
@@ -0,0 +1,24 @@
+diff -up Python-2.7rc1/Python/codecs.c.ascii-tolower Python-2.7rc1/Python/codecs.c
+--- Python-2.7rc1/Python/codecs.c.ascii-tolower 2010-05-09 10:46:46.000000000 -0400
++++ Python-2.7rc1/Python/codecs.c 2010-06-06 05:06:15.373100357 -0400
+@@ -45,6 +45,11 @@ int PyCodec_Register(PyObject *search_fu
+ return -1;
+ }
+
++/* isupper() forced into the ASCII Locale */
++#define ascii_isupper(x) (((x) >= 0x41) && ((x) <= 0x5A))
++/* tolower() forced into the ASCII Locale */
++#define ascii_tolower(x) (ascii_isupper(x) ? ((x) + 0x20) : (x))
++
+ /* Convert a string to a normalized Python string: all characters are
+ converted to lower case, spaces are replaced with underscores. */
+
+@@ -70,7 +75,7 @@ PyObject *normalizestring(const char *st
+ if (ch == ' ')
+ ch = '-';
+ else
+- ch = tolower(Py_CHARMASK(ch));
++ ch = ascii_tolower(Py_CHARMASK(ch));
+ p[i] = ch;
+ }
+ return v;
diff --git a/python-2.7rc1-config.patch b/python-2.7rc1-config.patch
new file mode 100644
index 0000000..6d8daf3
--- /dev/null
+++ b/python-2.7rc1-config.patch
@@ -0,0 +1,283 @@
+diff -up Python-2.7rc1/Modules/Setup.dist.rhconfig Python-2.7rc1/Modules/Setup.dist
+--- Python-2.7rc1/Modules/Setup.dist.rhconfig 2009-12-21 10:22:00.000000000 -0500
++++ Python-2.7rc1/Modules/Setup.dist 2010-06-05 23:51:30.579225134 -0400
+@@ -152,7 +152,7 @@ GLHACK=-Dclear=__GLclear
+ # modules are to be built as shared libraries (see above for more
+ # detail; also note that *static* reverses this effect):
+
+-#*shared*
++*shared*
+
+ # GNU readline. Unlike previous Python incarnations, GNU readline is
+ # now incorporated in an optional module, configured in the Setup file
+@@ -162,74 +162,74 @@ GLHACK=-Dclear=__GLclear
+ # it, depending on your system -- see the GNU readline instructions.
+ # It's okay for this to be a shared library, too.
+
+-#readline readline.c -lreadline -ltermcap
++readline readline.c -lreadline -ltermcap
+
+
+ # Modules that should always be present (non UNIX dependent):
+
+-#array arraymodule.c # array objects
+-#cmath cmathmodule.c _math.c # -lm # complex math library functions
+-#math mathmodule.c _math.c # -lm # math library functions, e.g. sin()
+-#_struct _struct.c # binary structure packing/unpacking
+-#time timemodule.c # -lm # time operations and variables
+-#operator operator.c # operator.add() and similar goodies
+-#_weakref _weakref.c # basic weak reference support
+-#_testcapi _testcapimodule.c # Python C API test module
+-#_random _randommodule.c # Random number generator
+-#_collections _collectionsmodule.c # Container types
+-#itertools itertoolsmodule.c # Functions creating iterators for efficient looping
+-#strop stropmodule.c # String manipulations
+-#_functools _functoolsmodule.c # Tools for working with functions and callable objects
++array arraymodule.c # array objects
++cmath cmathmodule.c _math.c # -lm # complex math library functions
++math mathmodule.c _math.c # -lm # math library functions, e.g. sin()
++_struct _struct.c # binary structure packing/unpacking
++time timemodule.c # -lm # time operations and variables
++operator operator.c # operator.add() and similar goodies
++_weakref _weakref.c # basic weak reference support
++_testcapi _testcapimodule.c # Python C API test module
++_random _randommodule.c # Random number generator
++_collections _collectionsmodule.c # Container types
++itertools itertoolsmodule.c # Functions creating iterators for efficient looping
++strop stropmodule.c # String manipulations
++_functools _functoolsmodule.c # Tools for working with functions and callable objects
+ #_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI
_elementtree.c # elementtree accelerator
+ #_pickle _pickle.c # pickle accelerator
+ #datetime datetimemodule.c # date/time type
+-#_bisect _bisectmodule.c # Bisection algorithms
++_bisect _bisectmodule.c # Bisection algorithms
+
+-#unicodedata unicodedata.c # static Unicode character database
++unicodedata unicodedata.c # static Unicode character database
+
+ # access to ISO C locale support
+-#_locale _localemodule.c # -lintl
++_locale _localemodule.c # -lintl
+
+
+ # Modules with some UNIX dependencies -- on by default:
+ # (If you have a really backward UNIX, select and socket may not be
+ # supported...)
+
+-#fcntl fcntlmodule.c # fcntl(2) and ioctl(2)
+-#spwd spwdmodule.c # spwd(3)
+-#grp grpmodule.c # grp(3)
+-#select selectmodule.c # select(2); not on ancient System V
++fcntl fcntlmodule.c # fcntl(2) and ioctl(2)
++spwd spwdmodule.c # spwd(3)
++grp grpmodule.c # grp(3)
++select selectmodule.c # select(2); not on ancient System V
+
+ # Memory-mapped files (also works on Win32).
+-#mmap mmapmodule.c
++mmap mmapmodule.c
+
+ # CSV file helper
+-#_csv _csv.c
++_csv _csv.c
+
+ # Socket module helper for socket(2)
+-#_socket socketmodule.c
++_socket socketmodule.c
+
+ # Socket module helper for SSL support; you must comment out the other
+ # socket line above, and possibly edit the SSL variable:
+ #SSL=/usr/local/ssl
+-#_ssl _ssl.c \
+-# -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
+-# -L$(SSL)/lib -lssl -lcrypto
++_ssl _ssl.c \
++ -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
++ -L$(SSL)/lib -lssl -lcrypto
+
+ # The crypt module is now disabled by default because it breaks builds
+ # on many systems (where -lcrypt is needed), e.g. Linux (I believe).
+ #
+ # First, look at Setup.config; configure may have set this for you.
+
+-#crypt cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some systems
++crypt cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some systems
+
+
+ # Some more UNIX dependent modules -- off by default, since these
+ # are not supported by all UNIX systems:
+
+-#nis nismodule.c -lnsl # Sun yellow pages -- not everywhere
+-#termios termios.c # Steen Lumholt's termios module
+-#resource resource.c # Jeremy Hylton's rlimit interface
++nis nismodule.c -lnsl # Sun yellow pages -- not everywhere
++termios termios.c # Steen Lumholt's termios module
++resource resource.c # Jeremy Hylton's rlimit interface
+
+
+ # Multimedia modules -- off by default.
+@@ -237,8 +237,8 @@ GLHACK=-Dclear=__GLclear
+ # #993173 says audioop works on 64-bit platforms, though.
+ # These represent audio samples or images as strings:
+
+-#audioop audioop.c # Operations on audio samples
+-#imageop imageop.c # Operations on images
++audioop audioop.c # Operations on audio samples
++imageop imageop.c # Operations on images
+
+
+ # Note that the _md5 and _sha modules are normally only built if the
+@@ -248,14 +248,14 @@ GLHACK=-Dclear=__GLclear
+ # Message-Digest Algorithm, described in RFC 1321. The necessary files
+ # md5.c and md5.h are included here.
+
+-#_md5 md5module.c md5.c
++_md5 md5module.c md5.c
+
+
+ # The _sha module implements the SHA checksum algorithms.
+ # (NIST's Secure Hash Algorithms.)
+-#_sha shamodule.c
+-#_sha256 sha256module.c
+-#_sha512 sha512module.c
++_sha shamodule.c
++_sha256 sha256module.c
++_sha512 sha512module.c
+
+
+ # SGI IRIX specific modules -- off by default.
+@@ -302,12 +302,12 @@ GLHACK=-Dclear=__GLclear
+ # A Linux specific module -- off by default; this may also work on
+ # some *BSDs.
+
+-#linuxaudiodev linuxaudiodev.c
++linuxaudiodev linuxaudiodev.c
+
+
+ # George Neville-Neil's timing module:
+
+-#timing timingmodule.c
++timing timingmodule.c
+
+
+ # The _tkinter module.
+@@ -322,7 +322,7 @@ GLHACK=-Dclear=__GLclear
+ # every system.
+
+ # *** Always uncomment this (leave the leading underscore in!):
+-# _tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \
++_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \
+ # *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
+ # -L/usr/local/lib \
+ # *** Uncomment and edit to reflect where your Tcl/Tk headers are:
+@@ -332,7 +332,7 @@ GLHACK=-Dclear=__GLclear
+ # *** Or uncomment this for Solaris:
+ # -I/usr/openwin/include \
+ # *** Uncomment and edit for Tix extension only:
+-# -DWITH_TIX -ltix8.1.8.2 \
++ -DWITH_TIX -ltix \
+ # *** Uncomment and edit for BLT extension only:
+ # -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \
+ # *** Uncomment and edit for PIL (TkImaging) extension only:
+@@ -341,7 +341,7 @@ GLHACK=-Dclear=__GLclear
+ # *** Uncomment and edit for TOGL extension only:
+ # -DWITH_TOGL togl.c \
+ # *** Uncomment and edit to reflect your Tcl/Tk versions:
+-# -ltk8.2 -ltcl8.2 \
++ -ltk -ltcl \
+ # *** Uncomment and edit to reflect where your X11 libraries are:
+ # -L/usr/X11R6/lib \
+ # *** Or uncomment this for Solaris:
+@@ -351,7 +351,7 @@ GLHACK=-Dclear=__GLclear
+ # *** Uncomment for AIX:
+ # -lld \
+ # *** Always uncomment this; X11 libraries to link with:
+-# -lX11
++ -lX11
+
+ # Lance Ellinghaus's syslog module
+ #syslog syslogmodule.c # syslog daemon interface
+@@ -373,7 +373,7 @@ GLHACK=-Dclear=__GLclear
+ # it is a highly experimental and dangerous device for calling
+ # *arbitrary* C functions in *arbitrary* shared libraries:
+
+-#dl dlmodule.c
++dl dlmodule.c
+
+
+ # Modules that provide persistent dictionary-like semantics. You will
+@@ -396,7 +396,7 @@ GLHACK=-Dclear=__GLclear
+ #
+ # First, look at Setup.config; configure may have set this for you.
+
+-#gdbm gdbmmodule.c -I/usr/local/include -L/usr/local/lib -lgdbm
++gdbm gdbmmodule.c -lgdbm
+
+
+ # Sleepycat Berkeley DB interface.
+@@ -411,11 +411,10 @@ GLHACK=-Dclear=__GLclear
+ #
+ # Edit the variables DB and DBLIBVERto point to the db top directory
+ # and the subdirectory of PORT where you built it.
+-#DB=/usr/local/BerkeleyDB.4.0
+-#DBLIBVER=4.0
+-#DBINC=$(DB)/include
+-#DBLIB=$(DB)/lib
+-#_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
++DBLIBVER=4.7
++DBINC=/usr/include/db4
++DBLIB=/usr/lib
++_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
+
+ # Historical Berkeley DB 1.85
+ #
+@@ -430,14 +429,14 @@ GLHACK=-Dclear=__GLclear
+
+
+ # Helper module for various ascii-encoders
+-#binascii binascii.c
++binascii binascii.c
+
+ # Fred Drake's interface to the Python parser
+-#parser parsermodule.c
++parser parsermodule.c
+
+ # cStringIO and cPickle
+-#cStringIO cStringIO.c
+-#cPickle cPickle.c
++cStringIO cStringIO.c
++cPickle cPickle.c
+
+
+ # Lee Busby's SIGFPE modules.
+@@ -460,7 +459,7 @@ GLHACK=-Dclear=__GLclear
+ # Andrew Kuchling's zlib module.
+ # This require zlib 1.1.3 (or later).
+ # See
http://www.gzip.org/zlib/
+-#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
++zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
+
+ # Interface to the Expat XML parser
+ #
+@@ -479,14 +478,14 @@ GLHACK=-Dclear=__GLclear
+ # Hye-Shik Chang's CJKCodecs
+
+ # multibytecodec is required for all the other CJK codec modules
+-#_multibytecodec cjkcodecs/multibytecodec.c
++_multibytecodec cjkcodecs/multibytecodec.c
+
+-#_codecs_cn cjkcodecs/_codecs_cn.c
+-#_codecs_hk cjkcodecs/_codecs_hk.c
+-#_codecs_iso2022 cjkcodecs/_codecs_iso2022.c
+-#_codecs_jp cjkcodecs/_codecs_jp.c
+-#_codecs_kr cjkcodecs/_codecs_kr.c
+-#_codecs_tw cjkcodecs/_codecs_tw.c
++_codecs_cn cjkcodecs/_codecs_cn.c
++_codecs_hk cjkcodecs/_codecs_hk.c
++_codecs_iso2022 cjkcodecs/_codecs_iso2022.c
++_codecs_jp cjkcodecs/_codecs_jp.c
++_codecs_kr cjkcodecs/_codecs_kr.c
++_codecs_tw cjkcodecs/_codecs_tw.c
+
+ # Example -- included for reference only:
+ # xx xxmodule.c
diff --git a/python-2.7rc1-ctypes-noexecmem.patch b/python-2.7rc1-ctypes-noexecmem.patch
new file mode 100644
index 0000000..ccc2e68
--- /dev/null
+++ b/python-2.7rc1-ctypes-noexecmem.patch
@@ -0,0 +1,85 @@
+diff -up Python-2.7rc1/Modules/_ctypes/callbacks.c.selinux
Python-2.7rc1/Modules/_ctypes/callbacks.c
+--- Python-2.7rc1/Modules/_ctypes/callbacks.c.selinux 2010-05-09 10:46:46.000000000
-0400
++++ Python-2.7rc1/Modules/_ctypes/callbacks.c 2010-06-08 08:44:18.357366200 -0400
+@@ -21,8 +21,8 @@ CThunkObject_dealloc(PyObject *_self)
+ Py_XDECREF(self->converters);
+ Py_XDECREF(self->callable);
+ Py_XDECREF(self->restype);
+- if (self->pcl)
+- _ctypes_free_closure(self->pcl);
++ if (self->pcl_write)
++ ffi_closure_free(self->pcl_write);
+ PyObject_GC_Del(self);
+ }
+
+@@ -391,7 +391,8 @@ static CThunkObject* CThunkObject_new(Py
+ return NULL;
+ }
+
+- p->pcl = NULL;
++ p->pcl_exec = NULL;
++ p->pcl_write = NULL;
+ memset(&p->cif, 0, sizeof(p->cif));
+ p->converters = NULL;
+ p->callable = NULL;
+@@ -421,8 +422,9 @@ CThunkObject *_ctypes_alloc_callback(PyO
+
+ assert(CThunk_CheckExact(p));
+
+- p->pcl = _ctypes_alloc_closure();
+- if (p->pcl == NULL) {
++ p->pcl_write = ffi_closure_alloc(sizeof(ffi_closure),
++ &p->pcl_exec);
++ if (p->pcl_write == NULL) {
+ PyErr_NoMemory();
+ goto error;
+ }
+@@ -467,7 +469,9 @@ CThunkObject *_ctypes_alloc_callback(PyO
+ "ffi_prep_cif failed with %d", result);
+ goto error;
+ }
+- result = ffi_prep_closure(p->pcl, &p->cif, closure_fcn, p);
++ result = ffi_prep_closure_loc(p->pcl_write, &p->cif, closure_fcn,
++ p,
++ p->pcl_exec);
+ if (result != FFI_OK) {
+ PyErr_Format(PyExc_RuntimeError,
+ "ffi_prep_closure failed with %d", result);
+diff -up Python-2.7rc1/Modules/_ctypes/_ctypes.c.selinux
Python-2.7rc1/Modules/_ctypes/_ctypes.c
+--- Python-2.7rc1/Modules/_ctypes/_ctypes.c.selinux 2010-05-09 10:46:46.000000000 -0400
++++ Python-2.7rc1/Modules/_ctypes/_ctypes.c 2010-06-07 23:19:39.950146038 -0400
+@@ -3463,7 +3463,7 @@ PyCFuncPtr_new(PyTypeObject *type, PyObj
+ self->callable = callable;
+
+ self->thunk = thunk;
+- *(void **)self->b_ptr = (void *)thunk->pcl;
++ *(void **)self->b_ptr = (void *)thunk->pcl_exec;
+
+ Py_INCREF((PyObject *)thunk); /* for KeepRef */
+ if (-1 == KeepRef((CDataObject *)self, 0, (PyObject *)thunk)) {
+diff -up Python-2.7rc1/Modules/_ctypes/ctypes.h.selinux
Python-2.7rc1/Modules/_ctypes/ctypes.h
+--- Python-2.7rc1/Modules/_ctypes/ctypes.h.selinux 2010-05-09 10:46:46.000000000 -0400
++++ Python-2.7rc1/Modules/_ctypes/ctypes.h 2010-06-07 23:19:39.950146038 -0400
+@@ -95,7 +95,8 @@ struct tagCDataObject {
+
+ typedef struct {
+ PyObject_VAR_HEAD
+- ffi_closure *pcl; /* the C callable */
++ ffi_closure *pcl_write; /* the C callable, writeable */
++ void *pcl_exec; /* the C callable, executable */
+ ffi_cif cif;
+ int flags;
+ PyObject *converters;
+diff -up Python-2.7rc1/setup.py.selinux Python-2.7rc1/setup.py
+--- Python-2.7rc1/setup.py.selinux 2010-06-07 23:19:39.922147795 -0400
++++ Python-2.7rc1/setup.py 2010-06-07 23:19:39.951145942 -0400
+@@ -1864,8 +1864,7 @@ class PyBuildExt(build_ext):
+ '_ctypes/callbacks.c',
+ '_ctypes/callproc.c',
+ '_ctypes/stgdict.c',
+- '_ctypes/cfield.c',
+- '_ctypes/malloc_closure.c']
++ '_ctypes/cfield.c']
+ depends = ['_ctypes/ctypes.h']
+
+ if sys.platform == 'darwin':
diff --git a/python-2.7rc1-debug-build.patch b/python-2.7rc1-debug-build.patch
new file mode 100644
index 0000000..e3cc3ac
--- /dev/null
+++ b/python-2.7rc1-debug-build.patch
@@ -0,0 +1,257 @@
+diff -up Python-2.7rc2/configure.in.debug-build Python-2.7rc2/configure.in
+--- Python-2.7rc2/configure.in.debug-build 2010-06-24 12:59:28.166319997 -0400
++++ Python-2.7rc2/configure.in 2010-06-24 12:59:28.179376823 -0400
+@@ -641,7 +641,7 @@ AC_SUBST(LIBRARY)
+ AC_MSG_CHECKING(LIBRARY)
+ if test -z "$LIBRARY"
+ then
+- LIBRARY='libpython$(VERSION).a'
++ LIBRARY='libpython$(VERSION)$(DEBUG_EXT).a'
+ fi
+ AC_MSG_RESULT($LIBRARY)
+
+@@ -786,8 +786,8 @@ if test $enable_shared = "yes"; then
+ INSTSONAME="$LDLIBRARY".$SOVERSION
+ ;;
+ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*)
+- LDLIBRARY='libpython$(VERSION).so'
+- BLDLIBRARY='-L. -lpython$(VERSION)'
++ LDLIBRARY='libpython$(VERSION)$(DEBUG_EXT).so'
++ BLDLIBRARY='-L. -lpython$(VERSION)$(DEBUG_EXT)'
+ RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
+ case $ac_sys_system in
+ FreeBSD*)
+@@ -892,6 +892,14 @@ else AC_MSG_RESULT(no); Py_DEBUG='false'
+ fi],
+ [AC_MSG_RESULT(no)])
+
++if test "$Py_DEBUG" = 'true'
++then
++ DEBUG_EXT=_d
++ DEBUG_SUFFIX=-debug
++fi
++AC_SUBST(DEBUG_EXT)
++AC_SUBST(DEBUG_SUFFIX)
++
+ # XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
+ # merged with this chunk of code?
+
+diff -up Python-2.7rc2/Lib/distutils/command/build_ext.py.debug-build
Python-2.7rc2/Lib/distutils/command/build_ext.py
+--- Python-2.7rc2/Lib/distutils/command/build_ext.py.debug-build 2010-04-01
14:17:09.000000000 -0400
++++ Python-2.7rc2/Lib/distutils/command/build_ext.py 2010-06-24 12:59:28.179376823 -0400
+@@ -677,7 +677,10 @@ class build_ext (Command):
+ so_ext = get_config_var('SO')
+ if os.name == 'nt' and self.debug:
+ return os.path.join(*ext_path) + '_d' + so_ext
+- return os.path.join(*ext_path) + so_ext
++
++ # Similarly, extensions in debug mode are named 'module_d.so', to
++ # avoid adding the _d to the SO config variable:
++ return os.path.join(*ext_path) + (sys.pydebug and "_d" or
"") + so_ext
+
+ def get_export_symbols (self, ext):
+ """Return the list of symbols that a shared extension has to
+@@ -760,6 +763,8 @@ class build_ext (Command):
+ template = "python%d.%d"
+ pythonlib = (template %
+ (sys.hexversion >> 24, (sys.hexversion >> 16)
& 0xff))
++ if sys.pydebug:
++ pythonlib += '_d'
+ return ext.libraries + [pythonlib]
+ else:
+ return ext.libraries
+diff -up Python-2.7rc2/Lib/distutils/sysconfig.py.debug-build
Python-2.7rc2/Lib/distutils/sysconfig.py
+--- Python-2.7rc2/Lib/distutils/sysconfig.py.debug-build 2010-06-24 12:59:28.145319202
-0400
++++ Python-2.7rc2/Lib/distutils/sysconfig.py 2010-06-24 12:59:28.180381519 -0400
+@@ -85,7 +85,8 @@ 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())
++ return os.path.join(prefix, "include",
++ "python" + get_python_version() + (sys.pydebug and
'-debug' or ''))
+ elif os.name == "nt":
+ return os.path.join(prefix, "include")
+ elif os.name == "os2":
+@@ -211,7 +212,7 @@ def get_makefile_filename():
+ if python_build:
+ return os.path.join(os.path.dirname(sys.executable), "Makefile")
+ lib_dir = get_python_lib(plat_specific=1, standard_lib=1)
+- return os.path.join(lib_dir, "config", "Makefile")
++ return os.path.join(lib_dir, "config" + (sys.pydebug and
"-debug" or ""), "Makefile")
+
+
+ def parse_config_h(fp, g=None):
+diff -up Python-2.7rc2/Makefile.pre.in.debug-build Python-2.7rc2/Makefile.pre.in
+--- Python-2.7rc2/Makefile.pre.in.debug-build 2010-06-24 12:59:28.175377249 -0400
++++ Python-2.7rc2/Makefile.pre.in 2010-06-24 13:01:24.559945307 -0400
+@@ -99,8 +99,8 @@ SCRIPTDIR= $(prefix)/lib64
+ # Detailed destination directories
+ BINLIBDEST= $(LIBDIR)/python$(VERSION)
+ LIBDEST= $(SCRIPTDIR)/python$(VERSION)
+-INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
+-CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)
++INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)$(DEBUG_SUFFIX)
++CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)$(DEBUG_SUFFIX)
+ LIBP= $(LIBDIR)/python$(VERSION)
+
+ # Symbols used for using shared libraries
+@@ -114,6 +114,12 @@ DESTSHARED= $(BINLIBDEST)/lib-dynload
+ EXE= @EXEEXT@
+ BUILDEXE= @BUILDEXEEXT@
+
++# DEBUG_EXT is used by ELF files (names and SONAMEs); it will be "_d" for a
debug build
++# DEBUG_SUFFIX is used by filesystem paths; it will be "-debug" for a debug
build
++# Both will be empty in an optimized build
++DEBUG_EXT= @DEBUG_EXT@
++DEBUG_SUFFIX= @DEBUG_SUFFIX@
++
+ # Short name and location for Mac OS X Python framework
+ UNIVERSALSDK=@UNIVERSALSDK@
+ PYTHONFRAMEWORK= @PYTHONFRAMEWORK@
+@@ -177,8 +183,8 @@ LIBOBJDIR= Python/
+ LIBOBJS= @LIBOBJS@
+ UNICODE_OBJS= @UNICODE_OBJS@
+
+-PYTHON= python$(EXE)
+-BUILDPYTHON= python$(BUILDEXE)
++PYTHON= python$(DEBUG_SUFFIX)$(EXE)
++BUILDPYTHON= python$(DEBUG_SUFFIX)$(BUILDEXE)
+
+ # The task to run while instrument when building the profile-opt target
+ PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck
+@@ -409,7 +415,7 @@ sharedmods: $(BUILDPYTHON)
+ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)'
LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py
build;; \
+ esac
+
+-libpython$(VERSION).so: $(LIBRARY_OBJS)
++libpython$(VERSION)$(DEBUG_EXT).so: $(LIBRARY_OBJS)
+ if test $(INSTSONAME) != $(LDLIBRARY); then \
+ $(LDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS)
$(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
+ $(LN) -f $(INSTSONAME) $@; \
+@@ -788,9 +794,9 @@ bininstall: altbininstall
+ then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON); \
+ else true; \
+ fi
+- (cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON))
+- -rm -f $(DESTDIR)$(BINDIR)/python-config
+- (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python-config)
++ (cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(DEBUG_SUFFIX)$(EXE) $(PYTHON))
++ -rm -f $(DESTDIR)$(BINDIR)/python$(DEBUG_SUFFIX)-config
++ (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(DEBUG_SUFFIX)-config
python$(DEBUG_SUFFIX)-config)
+ -test -d $(DESTDIR)$(LIBPC) || $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(LIBPC)
+ -rm -f $(DESTDIR)$(LIBPC)/python.pc
+ (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python.pc)
+@@ -806,7 +812,7 @@ altbininstall: $(BUILDPYTHON)
+ else true; \
+ fi; \
+ done
+- $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE)
++ $(INSTALL_PROGRAM) $(BUILDPYTHON)
$(DESTDIR)$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)$(EXE)
+ if test -f $(LDLIBRARY); then \
+ if test -n "$(DLLLIBRARY)" ; then \
+ $(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
+@@ -951,10 +957,11 @@ $(srcdir)/Lib/$(PLATDIR):
+ export EXE; EXE="$(BUILDEXE)"; \
+ cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen
+
+-python-config: $(srcdir)/Misc/python-config.in
++python$(DEBUG_SUFFIX)-config: $(srcdir)/Misc/python-config.in
+ # 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
++ sed -e "s,@EXENAME@,$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)$(EXE)," <
$(srcdir)/Misc/python-config.in >python$(DEBUG_SUFFIX)-config
++
+
+ # Install the include files
+ INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
+@@ -975,13 +982,13 @@ inclinstall:
+ $(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
+
+ # Install the library and miscellaneous stuff needed for extending/embedding
+-# This goes into $(exec_prefix)
+-LIBPL= $(LIBP)/config
++# This goes into $(exec_prefix)$(DEBUG_SUFFIX)
++LIBPL= $(LIBP)/config$(DEBUG_SUFFIX)
+
+ # pkgconfig directory
+ LIBPC= $(LIBDIR)/pkgconfig
+
+-libainstall: all python-config
++libainstall: all python$(DEBUG_SUFFIX)-config
+ @for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \
+ do \
+ if test ! -d $(DESTDIR)$$i; then \
+@@ -1000,8 +1007,7 @@ libainstall: all python-config
+ $(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc
+ $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
+ $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
+- $(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(VERSION)-config
+- rm python-config
++ $(INSTALL_SCRIPT) python$(DEBUG_SUFFIX)-config
$(DESTDIR)$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)-config
+ @if [ -s Modules/python.exp -a \
+ "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ];
then \
+ echo; echo "Installing support files for building shared extension modules on
AIX:"; \
+diff -up Python-2.7rc2/Misc/python-config.in.debug-build
Python-2.7rc2/Misc/python-config.in
+--- Python-2.7rc2/Misc/python-config.in.debug-build 2010-03-18 20:08:44.000000000 -0400
++++ Python-2.7rc2/Misc/python-config.in 2010-06-24 12:59:28.182375371 -0400
+@@ -45,7 +45,7 @@ for opt in opt_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
""))
+ # add the prefix/lib/pythonX.Y/config dir, but only if there is no
+ # shared library in prefix/lib/.
+ if opt == '--ldflags':
+diff -up Python-2.7rc2/Modules/makesetup.debug-build Python-2.7rc2/Modules/makesetup
+--- Python-2.7rc2/Modules/makesetup.debug-build 2007-09-05 07:47:34.000000000 -0400
++++ Python-2.7rc2/Modules/makesetup 2010-06-24 12:59:28.182375371 -0400
+@@ -233,7 +233,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
+ *$mod.o*) base=$mod;;
+ *) base=${mod}module;;
+ esac
+- file="$srcdir/$base\$(SO)"
++ file="$srcdir/$base\$(DEBUG_EXT)\$(SO)"
+ case $doconfig in
+ no) SHAREDMODS="$SHAREDMODS $file";;
+ esac
+diff -up Python-2.7rc2/Python/dynload_shlib.c.debug-build
Python-2.7rc2/Python/dynload_shlib.c
+--- Python-2.7rc2/Python/dynload_shlib.c.debug-build 2010-05-09 10:46:46.000000000 -0400
++++ Python-2.7rc2/Python/dynload_shlib.c 2010-06-24 12:59:28.183377733 -0400
+@@ -46,11 +46,16 @@ const struct filedescr _PyImport_DynLoad
+ {"module.exe", "rb", C_EXTENSION},
+ {"MODULE.EXE", "rb", C_EXTENSION},
+ #else
++#ifdef Py_DEBUG
++ {"_d.so", "rb", C_EXTENSION},
++ {"module_d.so", "rb", C_EXTENSION},
++#else
+ {".so", "rb", C_EXTENSION},
+ {"module.so", "rb", C_EXTENSION},
+-#endif
+-#endif
+-#endif
++#endif /* Py_DEBUG */
++#endif /* __VMS */
++#endif /* defined(PYOS_OS2) && defined(PYCC_GCC) */
++#endif /* __CYGWIN__ */
+ {0, 0}
+ };
+
+diff -up Python-2.7rc2/Python/sysmodule.c.debug-build Python-2.7rc2/Python/sysmodule.c
+--- Python-2.7rc2/Python/sysmodule.c.debug-build 2010-05-21 13:12:38.000000000 -0400
++++ Python-2.7rc2/Python/sysmodule.c 2010-06-24 12:59:28.184375034 -0400
+@@ -1557,6 +1557,12 @@ _PySys_Init(void)
+ PyString_FromString("legacy"));
+ #endif
+
++#ifdef Py_DEBUG
++ PyDict_SetItemString(sysdict, "pydebug", Py_True);
++#else
++ PyDict_SetItemString(sysdict, "pydebug", Py_False);
++#endif
++
+ #undef SET_SYS_FROM_STRING
+ if (PyErr_Occurred())
+ return NULL;
diff --git a/python-2.7rc1-dtrace.patch b/python-2.7rc1-dtrace.patch
new file mode 100644
index 0000000..8c81e9d
--- /dev/null
+++ b/python-2.7rc1-dtrace.patch
@@ -0,0 +1,198 @@
+diff -up Python-2.7rc1/configure.in.systemtap Python-2.7rc1/configure.in
+--- Python-2.7rc1/configure.in.systemtap 2010-06-06 10:53:15.514975012 -0400
++++ Python-2.7rc1/configure.in 2010-06-06 10:53:15.520974361 -0400
+@@ -2616,6 +2616,38 @@ if test "$with_valgrind" != no; then
+ )
+ fi
+
++# Check for dtrace support
++AC_MSG_CHECKING(for --with-dtrace)
++AC_ARG_WITH(dtrace,
++ AC_HELP_STRING(--with(out)-dtrace, disable/enable dtrace support))
++
++if test ! -z "$with_dtrace"
++then
++ if dtrace -G -o /dev/null -s $srcdir/Include/pydtrace.d 2>/dev/null
++ then
++ AC_DEFINE(WITH_DTRACE, 1,
++ [Define if you want to compile in Dtrace support])
++ with_dtrace="Sun"
++ DTRACEOBJS="Python/dtrace.o"
++ DTRADEHDRS=""
++ elif dtrace -h -o /dev/null -s $srcdir/Include/pydtrace.d
++ then
++ AC_DEFINE(WITH_DTRACE, 1,
++ [Define if you want to compile in Dtrace support])
++ with_dtrace="Apple"
++ DTRACEOBJS=""
++ DTRADEHDRS="pydtrace.h"
++ else
++ with_dtrace="no"
++ fi
++else
++ with_dtrace="no"
++fi
++
++AC_MSG_RESULT($with_dtrace)
++AC_SUBST(DTRACEOBJS)
++AC_SUBST(DTRACEHDRS)
++
+ # Check for --with-wctype-functions
+ AC_MSG_CHECKING(for --with-wctype-functions)
+ AC_ARG_WITH(wctype-functions,
+diff -up Python-2.7rc1/Include/pydtrace.d.systemtap Python-2.7rc1/Include/pydtrace.d
+--- Python-2.7rc1/Include/pydtrace.d.systemtap 2010-06-06 10:53:15.520974361 -0400
++++ Python-2.7rc1/Include/pydtrace.d 2010-06-06 10:53:15.520974361 -0400
+@@ -0,0 +1,10 @@
++provider python {
++ probe function__entry(const char *, const char *, int);
++ probe function__return(const char *, const char *, int);
++};
++
++#pragma D attributes Evolving/Evolving/Common provider python provider
++#pragma D attributes Private/Private/Common provider python module
++#pragma D attributes Private/Private/Common provider python function
++#pragma D attributes Evolving/Evolving/Common provider python name
++#pragma D attributes Evolving/Evolving/Common provider python args
+diff -up Python-2.7rc1/Makefile.pre.in.systemtap Python-2.7rc1/Makefile.pre.in
+--- Python-2.7rc1/Makefile.pre.in.systemtap 2010-06-06 10:53:15.488978775 -0400
++++ Python-2.7rc1/Makefile.pre.in 2010-06-06 11:05:30.411100568 -0400
+@@ -298,6 +298,7 @@ PYTHON_OBJS= \
+ Python/formatter_unicode.o \
+ Python/formatter_string.o \
+ Python/$(DYNLOADFILE) \
++ @DTRACEOBJS@ \
+ $(LIBOBJS) \
+ $(MACHDEP_OBJS) \
+ $(THREADOBJ)
+@@ -599,6 +600,18 @@ Python/formatter_unicode.o: $(srcdir)/Py
+ Python/formatter_string.o: $(srcdir)/Python/formatter_string.c \
+ $(STRINGLIB_HEADERS)
+
++# Only needed with --with-dtrace
++buildinclude:
++ mkdir -p Include
++
++Include/pydtrace.h: buildinclude $(srcdir)/Include/pydtrace.d
++ dtrace -o $@ $(DFLAGS) -C -h -s $(srcdir)/Include/pydtrace.d
++
++Python/ceval.o: Include/pydtrace.h
++
++Python/dtrace.o: buildinclude $(srcdir)/Include/pydtrace.d Python/ceval.o
++ dtrace -o $@ $(DFLAGS) -C -G -s $(srcdir)/Include/pydtrace.d Python/ceval.o
++
+ ############################################################################
+ # Header files
+
+@@ -1251,7 +1264,7 @@ Python/thread.o: @THREADHEADERS@
+ .PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
+ .PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
+ .PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean
+-.PHONY: smelly funny patchcheck
++.PHONY: smelly funny patchcheck buildinclude
+ .PHONY: gdbhooks
+
+ # IF YOU PUT ANYTHING HERE IT WILL GO AWAY
+diff -up Python-2.7rc1/pyconfig.h.in.systemtap Python-2.7rc1/pyconfig.h.in
+--- Python-2.7rc1/pyconfig.h.in.systemtap 2010-05-08 07:04:18.000000000 -0400
++++ Python-2.7rc1/pyconfig.h.in 2010-06-06 10:53:15.521974070 -0400
+@@ -1074,6 +1074,9 @@
+ /* Define if you want documentation strings in extension modules */
+ #undef WITH_DOC_STRINGS
+
++/* Define if you want to compile in Dtrace support */
++#undef WITH_DTRACE
++
+ /* Define if you want to use the new-style (Openstep, Rhapsody, MacOS) dynamic
+ linker (dyld) instead of the old-style (NextStep) dynamic linker (rld).
+ Dyld is necessary to support frameworks. */
+diff -up Python-2.7rc1/Python/ceval.c.systemtap Python-2.7rc1/Python/ceval.c
+--- Python-2.7rc1/Python/ceval.c.systemtap 2010-05-09 10:46:46.000000000 -0400
++++ Python-2.7rc1/Python/ceval.c 2010-06-06 11:08:40.683100500 -0400
+@@ -19,6 +19,10 @@
+
+ #include <ctype.h>
+
++#ifdef WITH_DTRACE
++#include "pydtrace.h"
++#endif
++
+ #ifndef WITH_TSC
+
+ #define READ_TIMESTAMP(var)
+@@ -671,6 +675,55 @@ PyEval_EvalCode(PyCodeObject *co, PyObje
+ NULL);
+ }
+
++#ifdef WITH_DTRACE
++static void
++dtrace_entry(PyFrameObject *f)
++{
++ const char *filename;
++ const char *fname;
++ int lineno;
++
++ filename = PyString_AsString(f->f_code->co_filename);
++ fname = PyString_AsString(f->f_code->co_name);
++ lineno = PyCode_Addr2Line(f->f_code, f->f_lasti);
++
++ PYTHON_FUNCTION_ENTRY((char *)filename, (char *)fname, lineno);
++
++ /*
++ * Currently a USDT tail-call will not receive the correct arguments.
++ * Disable the tail call here.
++ */
++#if defined(__sparc)
++ asm("nop");
++#endif
++}
++
++static void
++dtrace_return(PyFrameObject *f)
++{
++ const char *filename;
++ const char *fname;
++ int lineno;
++
++ filename = PyString_AsString(f->f_code->co_filename);
++ fname = PyString_AsString(f->f_code->co_name);
++ lineno = PyCode_Addr2Line(f->f_code, f->f_lasti);
++ PYTHON_FUNCTION_RETURN((char *)filename, (char *)fname, lineno);
++
++ /*
++ * Currently a USDT tail-call will not receive the correct arguments.
++ * Disable the tail call here.
++ */
++#if defined(__sparc)
++ asm("nop");
++#endif
++}
++#else
++#define PYTHON_FUNCTION_ENTRY_ENABLED() 0
++#define PYTHON_FUNCTION_RETURN_ENABLED() 0
++#define dtrace_entry(f)
++#define dtrace_return(f)
++#endif
+
+ /* Interpreter main loop */
+
+@@ -909,6 +962,9 @@ PyEval_EvalFrameEx(PyFrameObject *f, int
+ }
+ }
+
++ if (PYTHON_FUNCTION_ENTRY_ENABLED())
++ dtrace_entry(f);
++
+ co = f->f_code;
+ names = co->co_names;
+ consts = co->co_consts;
+@@ -3000,6 +3056,9 @@ fast_yield:
+
+ /* pop frame */
+ exit_eval_frame:
++ if (PYTHON_FUNCTION_RETURN_ENABLED())
++ dtrace_return(f);
++
+ Py_LeaveRecursiveCall();
+ tstate->frame = f->f_back;
+
diff --git a/python-2.7rc1-lib64.patch b/python-2.7rc1-lib64.patch
new file mode 100644
index 0000000..9462e82
--- /dev/null
+++ b/python-2.7rc1-lib64.patch
@@ -0,0 +1,168 @@
+diff -up Python-2.7rc1/Lib/distutils/command/install.py.lib64
Python-2.7rc1/Lib/distutils/command/install.py
+--- Python-2.7rc1/Lib/distutils/command/install.py.lib64 2010-05-05 15:09:31.000000000
-0400
++++ Python-2.7rc1/Lib/distutils/command/install.py 2010-06-05 23:53:24.802224367 -0400
+@@ -42,14 +42,14 @@ else:
+ INSTALL_SCHEMES = {
+ 'unix_prefix': {
+ 'purelib': '$base/lib/python$py_version_short/site-packages',
+- 'platlib':
'$platbase/lib/python$py_version_short/site-packages',
++ 'platlib':
'$platbase/lib64/python$py_version_short/site-packages',
+ 'headers': '$base/include/python$py_version_short/$dist_name',
+ 'scripts': '$base/bin',
+ 'data' : '$base',
+ },
+ 'unix_home': {
+ 'purelib': '$base/lib/python',
+- 'platlib': '$base/lib/python',
++ 'platlib': '$base/lib64/python',
+ 'headers': '$base/include/python/$dist_name',
+ 'scripts': '$base/bin',
+ 'data' : '$base',
+diff -up Python-2.7rc1/Lib/distutils/sysconfig.py.lib64
Python-2.7rc1/Lib/distutils/sysconfig.py
+--- Python-2.7rc1/Lib/distutils/sysconfig.py.lib64 2010-05-05 15:09:31.000000000 -0400
++++ Python-2.7rc1/Lib/distutils/sysconfig.py 2010-06-05 23:53:24.803224186 -0400
+@@ -114,8 +114,12 @@ def get_python_lib(plat_specific=0, stan
+ prefix = plat_specific and EXEC_PREFIX or PREFIX
+
+ if os.name == "posix":
++ if plat_specific or standard_lib:
++ lib = "lib64"
++ else:
++ lib = "lib"
+ libpython = os.path.join(prefix,
+- "lib", "python" +
get_python_version())
++ lib, "python" + get_python_version())
+ if standard_lib:
+ return libpython
+ else:
+diff -up Python-2.7rc1/Lib/site.py.lib64 Python-2.7rc1/Lib/site.py
+--- Python-2.7rc1/Lib/site.py.lib64 2010-06-03 17:21:03.000000000 -0400
++++ Python-2.7rc1/Lib/site.py 2010-06-06 04:56:41.504986054 -0400
+@@ -286,12 +286,16 @@ def getsitepackages():
+ if sys.platform in ('os2emx', 'riscos'):
+ sitepackages.append(os.path.join(prefix, "Lib",
"site-packages"))
+ elif os.sep == '/':
++ sitepackages.append(os.path.join(prefix, "lib64",
++ "python" + sys.version[:3],
++ "site-packages"))
+ sitepackages.append(os.path.join(prefix, "lib",
+ "python" + sys.version[:3],
+ "site-packages"))
+ sitepackages.append(os.path.join(prefix, "lib",
"site-python"))
+ else:
+ sitepackages.append(prefix)
++ sitepackages.append(os.path.join(prefix, "lib64",
"site-packages"))
+ sitepackages.append(os.path.join(prefix, "lib",
"site-packages"))
+ if sys.platform == "darwin":
+ # for framework builds *only* we add the standard Apple
+diff -up Python-2.7rc1/Makefile.pre.in.lib64 Python-2.7rc1/Makefile.pre.in
+--- Python-2.7rc1/Makefile.pre.in.lib64 2010-06-05 23:53:24.000000000 -0400
++++ Python-2.7rc1/Makefile.pre.in 2010-06-06 04:57:25.280017307 -0400
+@@ -94,7 +94,7 @@ LIBDIR= @libdir@
+ MANDIR= @mandir@
+ INCLUDEDIR= @includedir@
+ CONFINCLUDEDIR= $(exec_prefix)/include
+-SCRIPTDIR= $(prefix)/lib
++SCRIPTDIR= $(prefix)/lib64
+
+ # Detailed destination directories
+ BINLIBDEST= $(LIBDIR)/python$(VERSION)
+diff -up Python-2.7rc1/Modules/getpath.c.lib64 Python-2.7rc1/Modules/getpath.c
+--- Python-2.7rc1/Modules/getpath.c.lib64 2010-05-09 10:46:46.000000000 -0400
++++ Python-2.7rc1/Modules/getpath.c 2010-06-06 04:58:53.840226352 -0400
+@@ -117,8 +117,8 @@
+ #endif
+
+ #ifndef PYTHONPATH
+-#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
+- EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
++#define PYTHONPATH PREFIX "/lib64/python" VERSION ":" \
++ EXEC_PREFIX "/lib64/python" VERSION "/lib-dynload"
+ #endif
+
+ #ifndef LANDMARK
+@@ -129,7 +129,7 @@ static char prefix[MAXPATHLEN+1];
+ static char exec_prefix[MAXPATHLEN+1];
+ static char progpath[MAXPATHLEN+1];
+ static char *module_search_path = NULL;
+-static char lib_python[] = "lib/python" VERSION;
++static char lib_python[] = "lib64/python" VERSION;
+
+ static void
+ reduce(char *dir)
+@@ -524,7 +524,7 @@ calculate_path(void)
+ }
+ else
+ strncpy(zip_path, PREFIX, MAXPATHLEN);
+- joinpath(zip_path, "lib/python00.zip");
++ joinpath(zip_path, "lib64/python00.zip");
+ bufsz = strlen(zip_path); /* Replace "00" with version */
+ zip_path[bufsz - 6] = VERSION[0];
+ zip_path[bufsz - 5] = VERSION[2];
+@@ -534,7 +534,7 @@ calculate_path(void)
+ fprintf(stderr,
+ "Could not find platform dependent libraries
<exec_prefix>\n");
+ strncpy(exec_prefix, EXEC_PREFIX, MAXPATHLEN);
+- joinpath(exec_prefix, "lib/lib-dynload");
++ joinpath(exec_prefix, "lib64/lib-dynload");
+ }
+ /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */
+
+diff -up Python-2.7rc1/Modules/Setup.dist.lib64 Python-2.7rc1/Modules/Setup.dist
+--- Python-2.7rc1/Modules/Setup.dist.lib64 2010-06-05 23:53:24.792224061 -0400
++++ Python-2.7rc1/Modules/Setup.dist 2010-06-05 23:53:24.845009526 -0400
+@@ -413,7 +413,7 @@ gdbm gdbmmodule.c -lgdbm
+ # and the subdirectory of PORT where you built it.
+ DBLIBVER=4.7
+ DBINC=/usr/include/db4
+-DBLIB=/usr/lib
++DBLIB=/usr/lib64
+ _bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
+
+ # Historical Berkeley DB 1.85
+@@ -459,7 +459,7 @@ cPickle cPickle.c
+ # Andrew Kuchling's zlib module.
+ # This require zlib 1.1.3 (or later).
+ # See
http://www.gzip.org/zlib/
+-zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
++zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib64 -lz
+
+ # Interface to the Expat XML parser
+ #
+diff -up Python-2.7rc1/setup.py.lib64 Python-2.7rc1/setup.py
+--- Python-2.7rc1/setup.py.lib64 2010-06-04 05:49:20.000000000 -0400
++++ Python-2.7rc1/setup.py 2010-06-06 05:00:36.653100371 -0400
+@@ -347,7 +347,7 @@ class PyBuildExt(build_ext):
+
+ def detect_modules(self):
+ # Ensure that /usr/local is always used
+- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
++ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib64')
+ add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+
+ # Add paths specified in the environment variables LDFLAGS and
+@@ -643,11 +643,11 @@ class PyBuildExt(build_ext):
+ elif curses_library:
+ readline_libs.append(curses_library)
+ elif self.compiler.find_library_file(lib_dirs +
+- ['/usr/lib/termcap'],
++ ['/usr/lib64/termcap'],
+ 'termcap'):
+ readline_libs.append('termcap')
+ exts.append( Extension('readline', ['readline.c'],
+- library_dirs=['/usr/lib/termcap'],
++ library_dirs=['/usr/lib64/termcap'],
+ extra_link_args=readline_extra_link_args,
+ libraries=readline_libs) )
+ else:
+@@ -681,8 +681,8 @@ class PyBuildExt(build_ext):
+ if krb5_h:
+ ssl_incs += krb5_h
+ ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
+- ['/usr/local/ssl/lib',
+- '/usr/contrib/ssl/lib/'
++ ['/usr/local/ssl/lib64',
++ '/usr/contrib/ssl/lib64/'
+ ] )
+
+ if (ssl_incs is not None and
diff --git a/python-2.7rc1-no-static-lib.patch b/python-2.7rc1-no-static-lib.patch
new file mode 100644
index 0000000..61375b3
--- /dev/null
+++ b/python-2.7rc1-no-static-lib.patch
@@ -0,0 +1,50 @@
+diff -up Python-2.7rc1/Makefile.pre.in.no-static-lib Python-2.7rc1/Makefile.pre.in
+--- Python-2.7rc1/Makefile.pre.in.no-static-lib 2010-06-06 14:47:52.929975429 -0400
++++ Python-2.7rc1/Makefile.pre.in 2010-06-06 14:48:34.163350302 -0400
+@@ -393,7 +393,7 @@ coverage:
+
+
+ # Build the interpreter
+-$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
++$(BUILDPYTHON): Modules/python.o $(LDLIBRARY)
+ $(LINKCC) $(CFLAGS) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
+ Modules/python.o \
+ $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
+@@ -409,18 +409,6 @@ sharedmods: $(BUILDPYTHON)
+ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)'
LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py
build;; \
+ esac
+
+-# Build static library
+-# avoid long command lines, same as LIBRARY_OBJS
+-$(LIBRARY): $(LIBRARY_OBJS)
+- -rm -f $@
+- $(AR) $(ARFLAGS) $@ Modules/getbuildinfo.o
+- $(AR) $(ARFLAGS) $@ $(PARSER_OBJS)
+- $(AR) $(ARFLAGS) $@ $(OBJECT_OBJS)
+- $(AR) $(ARFLAGS) $@ $(PYTHON_OBJS)
+- $(AR) $(ARFLAGS) $@ $(MODULE_OBJS) $(SIGNAL_OBJS)
+- $(AR) $(ARFLAGS) $@ $(MODOBJS)
+- $(RANLIB) $@
+-
+ libpython$(VERSION).so: $(LIBRARY_OBJS)
+ if test $(INSTSONAME) != $(LDLIBRARY); then \
+ $(LDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS)
$(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
+@@ -1002,18 +990,6 @@ libainstall: all python-config
+ else true; \
+ fi; \
+ done
+- @if test -d $(LIBRARY); then :; else \
+- if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
+- if test "$(SO)" = .dll; then \
+- $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
+- else \
+- $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
+- $(RANLIB) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
+- fi; \
+- else \
+- echo Skip install of $(LIBRARY) - use make frameworkinstall; \
+- fi; \
+- fi
+ $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
+ $(INSTALL_DATA) Modules/python.o $(DESTDIR)$(LIBPL)/python.o
+ $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
diff --git a/python-2.7rc1-socketmodule-constants.patch
b/python-2.7rc1-socketmodule-constants.patch
new file mode 100644
index 0000000..c32e103
--- /dev/null
+++ b/python-2.7rc1-socketmodule-constants.patch
@@ -0,0 +1,64 @@
+--- Python-2.7rc1/Modules/socketmodule.c.socketmodule 2010-05-09 10:46:46.000000000
-0400
++++ Python-2.7rc1/Modules/socketmodule.c 2010-06-07 23:04:19.374234780 -0400
+@@ -4783,6 +4783,61 @@ init_socket(void)
+ PyModule_AddIntConstant(m, "SO_SETFIB", SO_SETFIB);
+ #endif
+
++#ifdef SO_SNDBUFFORCE
++ PyModule_AddIntConstant(m, "SO_SNDBUFFORCE", SO_SNDBUFFORCE);
++#endif
++#ifdef SO_RCVBUFFORCE
++ PyModule_AddIntConstant(m, "SO_RCVBUFFORCE", SO_RCVBUFFORCE);
++#endif
++#ifdef SO_NO_CHECK
++ PyModule_AddIntConstant(m, "SO_NO_CHECK", SO_NO_CHECK);
++#endif
++#ifdef SO_PRIORITY
++ PyModule_AddIntConstant(m, "SO_PRIORITY", SO_PRIORITY);
++#endif
++#ifdef SO_BSDCOMPAT
++ PyModule_AddIntConstant(m, "SO_BSDCOMPAT", SO_BSDCOMPAT);
++#endif
++#ifdef SO_PASSCRED
++ PyModule_AddIntConstant(m, "SO_PASSCRED", SO_PASSCRED);
++#endif
++#ifdef SO_PEERCRED
++ PyModule_AddIntConstant(m, "SO_PEERCRED", SO_PEERCRED);
++#endif
++#ifdef SO_SECURITY_AUTHENTICATION
++ PyModule_AddIntConstant(m, "SO_SECURITY_AUTHENTICATION",
SO_SECURITY_AUTHENTICATION);
++#endif
++#ifdef SO_SECURITY_ENCRYPTION_TRANSPORT
++ PyModule_AddIntConstant(m, "SO_SECURITY_ENCRYPTION_TRANSPORT",
SO_SECURITY_ENCRYPTION_TRANSPORT);
++#endif
++#ifdef SO_SECURITY_ENCRYPTION_NETWORK
++ PyModule_AddIntConstant(m, "SO_SECURITY_ENCRYPTION_NETWORK",
SO_SECURITY_ENCRYPTION_NETWORK);
++#endif
++#ifdef SO_BINDTODEVICE
++ PyModule_AddIntConstant(m, "SO_BINDTODEVICE", SO_BINDTODEVICE);
++#endif
++#ifdef SO_ATTACH_FILTER
++ PyModule_AddIntConstant(m, "SO_ATTACH_FILTER", SO_ATTACH_FILTER);
++#endif
++#ifdef SO_DETACH_FILTER
++ PyModule_AddIntConstant(m, "SO_DETACH_FILTER", SO_DETACH_FILTER);
++#endif
++#ifdef SO_PEERNAME
++ PyModule_AddIntConstant(m, "SO_PEERNAME", SO_PEERNAME);
++#endif
++#ifdef SO_TIMESTAMP
++ PyModule_AddIntConstant(m, "SO_TIMESTAMP", SO_TIMESTAMP);
++#endif
++#ifdef SO_PEERSEC
++ PyModule_AddIntConstant(m, "SO_PEERSEC", SO_PEERSEC);
++#endif
++#ifdef SO_PASSSEC
++ PyModule_AddIntConstant(m, "SO_PASSSEC", SO_PASSSEC);
++#endif
++#ifdef SO_TIMESTAMPNS
++ PyModule_AddIntConstant(m, "SO_TIMESTAMPNS", SO_TIMESTAMPNS);
++#endif
++
+ /* Maximum number of connections for "listen" */
+ #ifdef SOMAXCONN
+ PyModule_AddIntConstant(m, "SOMAXCONN", SOMAXCONN);
diff --git a/python-2.7rc1-socketmodule-constants2.patch
b/python-2.7rc1-socketmodule-constants2.patch
new file mode 100644
index 0000000..896ac88
--- /dev/null
+++ b/python-2.7rc1-socketmodule-constants2.patch
@@ -0,0 +1,19 @@
+diff -up Python-2.7rc1/Modules/socketmodule.c.socketmodule2
Python-2.7rc1/Modules/socketmodule.c
+--- Python-2.7rc1/Modules/socketmodule.c.socketmodule2 2010-06-07 23:06:59.133498087
-0400
++++ Python-2.7rc1/Modules/socketmodule.c 2010-06-07 23:11:51.249520087 -0400
+@@ -5253,6 +5253,15 @@ init_socket(void)
+ #ifdef TCP_QUICKACK
+ PyModule_AddIntConstant(m, "TCP_QUICKACK", TCP_QUICKACK);
+ #endif
++#ifdef TCP_CONGESTION
++ PyModule_AddIntConstant(m, "TCP_CONGESTION", TCP_CONGESTION);
++#endif
++#ifdef TCP_MD5SIG
++ PyModule_AddIntConstant(m, "TCP_MD5SIG", TCP_MD5SIG);
++#endif
++#ifdef TCP_MD5SIG_MAXKEYLEN
++ PyModule_AddIntConstant(m, "TCP_MD5SIG_MAXKEYLEN", TCP_MD5SIG_MAXKEYLEN);
++#endif
+
+
+ /* IPX options */
diff --git a/python-2.7rc1-statvfs-f_flag-constants.patch
b/python-2.7rc1-statvfs-f_flag-constants.patch
new file mode 100644
index 0000000..83e7b59
--- /dev/null
+++ b/python-2.7rc1-statvfs-f_flag-constants.patch
@@ -0,0 +1,47 @@
+diff -up Python-2.7rc1/Modules/posixmodule.c.statvfs-f-flag-constants
Python-2.7rc1/Modules/posixmodule.c
+--- Python-2.7rc1/Modules/posixmodule.c.statvfs-f-flag-constants 2010-05-15
17:45:30.000000000 -0400
++++ Python-2.7rc1/Modules/posixmodule.c 2010-06-07 22:54:16.162068624 -0400
+@@ -9174,6 +9174,43 @@ all_ins(PyObject *d)
+ #endif
+ #endif
+
++ /* These came from statvfs.h */
++#ifdef ST_RDONLY
++ if (ins(d, "ST_RDONLY", (long)ST_RDONLY)) return -1;
++#endif /* ST_RDONLY */
++#ifdef ST_NOSUID
++ if (ins(d, "ST_NOSUID", (long)ST_NOSUID)) return -1;
++#endif /* ST_NOSUID */
++
++ /* GNU extensions */
++#ifdef ST_NODEV
++ if (ins(d, "ST_NODEV", (long)ST_NODEV)) return -1;
++#endif /* ST_NODEV */
++#ifdef ST_NOEXEC
++ if (ins(d, "ST_NOEXEC", (long)ST_NOEXEC)) return -1;
++#endif /* ST_NOEXEC */
++#ifdef ST_SYNCHRONOUS
++ if (ins(d, "ST_SYNCHRONOUS", (long)ST_SYNCHRONOUS)) return -1;
++#endif /* ST_SYNCHRONOUS */
++#ifdef ST_MANDLOCK
++ if (ins(d, "ST_MANDLOCK", (long)ST_MANDLOCK)) return -1;
++#endif /* ST_MANDLOCK */
++#ifdef ST_WRITE
++ if (ins(d, "ST_WRITE", (long)ST_WRITE)) return -1;
++#endif /* ST_WRITE */
++#ifdef ST_APPEND
++ if (ins(d, "ST_APPEND", (long)ST_APPEND)) return -1;
++#endif /* ST_APPEND */
++#ifdef ST_NOATIME
++ if (ins(d, "ST_NOATIME", (long)ST_NOATIME)) return -1;
++#endif /* ST_NOATIME */
++#ifdef ST_NODIRATIME
++ if (ins(d, "ST_NODIRATIME", (long)ST_NODIRATIME)) return -1;
++#endif /* ST_NODIRATIME */
++#ifdef ST_RELATIME
++ if (ins(d, "ST_RELATIME", (long)ST_RELATIME)) return -1;
++#endif /* ST_RELATIME */
++
+ #if defined(PYOS_OS2)
+ if (insertvalues(d)) return -1;
+ #endif
diff --git a/python-2.7rc2-r79310.patch b/python-2.7rc2-r79310.patch
new file mode 100644
index 0000000..ee92932
--- /dev/null
+++ b/python-2.7rc2-r79310.patch
@@ -0,0 +1,27 @@
+Index: Misc/NEWS
+===================================================================
+--- Misc/NEWS (revision 79309)
++++ Misc/NEWS (revision 79310)
+@@ -29,6 +29,9 @@
+ Library
+ -------
+
++- Issue #8205: Remove the "Modules" directory from sys.path when Python is
++ running from the build directory (POSIX only).
++
+ - Issue #7667: Fix doctest failures with non-ASCII paths.
+
+ - Issue #7512: shutil.copystat() could raise an OSError when the filesystem
+Index: Lib/site.py
+===================================================================
+--- Lib/site.py (revision 79309)
++++ Lib/site.py (revision 79310)
+@@ -118,7 +118,7 @@
+ s = "build/lib.%s-%.3s" % (get_platform(), sys.version)
+ if hasattr(sys, 'gettotalrefcount'):
+ s += '-pydebug'
+- s = os.path.join(os.path.dirname(sys.path[-1]), s)
++ s = os.path.join(os.path.dirname(sys.path.pop()), s)
+ sys.path.append(s)
+
+
diff --git a/python.spec b/python.spec
index 1d6b674..9a442e3 100644
--- a/python.spec
+++ b/python.spec
@@ -1,5 +1,5 @@
%{!?__python_ver:%global __python_ver EMPTY}
-#global __python_ver 26
+#global __python_ver 27
%global unicode ucs4
%global _default_patch_fuzz 2
@@ -14,7 +14,7 @@
%global tkinter tkinter
%endif
-%global pybasever 2.6
+%global pybasever 2.7
%global pylibdir %{_libdir}/python%{pybasever}
%global tools_dir %{pylibdir}/Tools
%global demo_dir %{pylibdir}/Demo
@@ -59,11 +59,39 @@
#
%global _python_bytecompile_errors_terminate_build 0
+# We need to get a newer configure generated out of configure.in for the following
+# patches:
+# patch 4 (CFLAGS)
+# patch 52 (valgrind)
+# patch 55 (systemtap)
+#
+# For patch 55 (systemtap), we need to get a new header for configure to use
+#
+# configure.in requires autoconf-2.65, but the version in Fedora is currently
+# autoconf-2.66
+#
+# For now, we'll generate a patch to the generated configure script and
+# pyconfig.h.in on a machine that has a local copy of autoconf 2.65
+#
+# Instructions on obtaining such a copy can be seen at
+#
http://bugs.python.org/issue7997
+#
+# To make it easy to regenerate the patch, this specfile can be run in two
+# ways:
+# (i) regenerate_autotooling_patch 0 : the normal approach: prep the
+# source tree using a pre-generated patch to the "configure" script, and do a
+# full build
+# (ii) regenerate_autotooling_patch 1 : intended to be run on a developer's
+# workstation: prep the source tree without patching configure, then rerun a
+# local copy of autoconf-2.65, regenerate the patch, then exit, without doing
+# the rest of the build
+%global regenerate_autotooling_patch 0
+
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
# Remember to also rebase python-docs when changing this:
-Version: 2.6.5
-Release: 17%{?dist}
+Version: 2.7
+Release: 3%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -71,23 +99,6 @@ Provides: python(abi) = %{pybasever}
Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
-# We install a collection of hooks for gdb that make it easier to debug
-# executables linked against libpython (such as /usr/lib/python itself)
-#
-# These hooks are implemented in Python itself
-#
-# gdb-archer looks for them in the same path as the ELF file, with a -gdb.py suffix.
-# We put them in the debuginfo package by installing them to e.g.:
-# /usr/lib/debug/usr/lib/libpython2.6.so.1.0.debug-gdb.py
-#
-# See
https://fedoraproject.org/wiki/Features/EasierPythonDebugging for more
-# information
-#
-# Downloaded from:
-#
http://bugs.python.org/issue8032
-# This is Tools/gdb/libpython.py from v5 of the patch
-Source1: python-gdb.py
-
# Work around bug 562906 until it's fixed in rpm-build by providing a fixed
# version of pythondeps.sh:
Source2: pythondeps.sh
@@ -173,7 +184,7 @@ Source5: pyfuntop.stp
# - _codecs_jp cjkcodecs/_codecs_jp.c
# - _codecs_kr cjkcodecs/_codecs_kr.c
# - _codecs_tw cjkcodecs/_codecs_tw.c
-Patch0: python-2.6.2-config.patch
+Patch0: python-2.7rc1-config.patch
# Removes the "-g" option from "pydoc", for some reason; I believe
# (dmalcolm 2010-01-29) that this was introduced in this change:
@@ -183,10 +194,6 @@ Patch0: python-2.6.2-config.patch
# Not upstream
Patch1: Python-2.2.1-pydocnogui.patch
-# Fixup configure.in and setup.py to build against system expat library.
-# Adapted from
http://svn.python.org/view?view=rev&revision=77169
-Patch3: python-2.6.2-with-system-expat.patch
-
# Add $(CFLAGS) to the linker arguments when linking the "python" binary
# since some architectures (sparc64) need this (rhbz:199373).
# Not yet filed upstream
@@ -224,19 +231,19 @@ Patch7: python-2.5.1-sqlite-encoding.patch
# SONAME from a library; we avoid this, apparently to minimize space
# requirements on the live CD:
# (rhbz:307221)
-Patch10: python-2.6.2-binutils-no-dep.patch
+Patch10: python-2.7rc1-binutils-no-dep.patch
# FIXME: appears to relate to:
#* Tue Oct 30 2007 James Antill <jantill(a)redhat.com> - 2.5.1-15
#- Do codec lowercase in C Locale.
#- Resolves: 207134 191096
-Patch11: python-2.5.1-codec-ascii-tolower.patch
+Patch11: python-2.7rc1-codec-ascii-tolower.patch
# Add various constants to the socketmodule (rhbz#436560):
# TODO: these patches were added in 2.5.1-22 and 2.5.1-24 but appear not to
# have been sent upstream yet:
-Patch13: python-2.5.1-socketmodule-constants.patch
-Patch14: python-2.5.1-socketmodule-constants2.patch
+Patch13: python-2.7rc1-socketmodule-constants.patch
+Patch14: python-2.7rc1-socketmodule-constants2.patch
# Remove an "-rpath $(LIBDIR)" argument from the linkage args in configure.in:
# FIXME: is this for OSF, not Linux?
@@ -247,28 +254,15 @@ Patch16: python-2.6-rpath.patch
# super() as it's an old-style class
Patch17: python-2.6.4-distutils-rpath.patch
-# Fix distutils to follow the Fedora/RHEL/CentOS policies of having .pyo files
-Patch51: python-2.6-distutils_rpm.patch
-
-# Automatically disable arena allocator when run under valgrind:
-# From
http://bugs.python.org/issue2422
-#
http://bugs.python.org/file9872/disable-pymalloc-on-valgrind-py26.patch
-# with the "configure" part removed; appears to be identical to the version
committed to 2.7
-Patch52: disable-pymalloc-on-valgrind-py26.patch
-
-
-# Upstream patch to compile against db-4.8
-#
http://bugs.python.org/issue6949
-# Based on
http://svn.python.org/view?view=rev&revision=78974
-Patch53: python-2.6.5-db48.patch
-# ...and a further patch to setup.py so that it links against 4.8:
+# Patch setup.py so that it links against db-4.8:
Patch54: python-2.6.4-setup-db48.patch
# Systemtap support: add statically-defined probe points
# Patch based on upstream bug:
http://bugs.python.org/issue4111
# fixed up by mjw and wcohen for 2.6.2, then fixed up by dmalcolm for 2.6.4
-# then rewritten by mjw (attachment 390110 of rhbz 545179)
-Patch55: python-2.6.4-dtrace.patch
+# then rewritten by mjw (attachment 390110 of rhbz 545179), then reformatted
+# for 2.7rc1 by dmalcolm:
+Patch55: python-2.7rc1-dtrace.patch
# "lib64 patches"
# This patch seems to be associated with bug 122304, which was
@@ -289,7 +283,13 @@ Patch101: python-2.3.4-lib64-regex.patch
# and add the /usr/lib64/pythonMAJOR.MINOR/site-packages to sitedirs, in front of
# /usr/lib/pythonMAJOR.MINOR/site-packages
# Not upstream
-Patch102: python-2.6-lib64.patch
+Patch102: python-2.7rc1-lib64.patch
+
+# Python 2.7 split out much of the path-handling from distutils/sysconfig.py to
+# a new sysconfig.py (in r77704).
+# We need to make equivalent changes to that new file to ensure that the stdlib
+# and platform-specific code go to /usr/lib64 not /usr/lib, on 64-bit archs:
+Patch103: python-2.7-lib64-sysconfig.patch
# rhbz#488396: rework the ctypes module to use ffi_closure_alloc and
# ffi_closure_free, rather than malloc_closure.c, since the latter tries to
@@ -299,13 +299,14 @@ Patch102: python-2.6-lib64.patch
# a rebasing of the upstream copy of libffi to one containing the
# memory-management hooks.
#
-# This appears to be the same as that patch, but without the rebasing of libffi
-# (since we use the system copy of libffi):
-Patch110: python-2.6-ctypes-noexecmem.patch
+# This is the same as that patch, but without the rebasing of libffi
+# (since we use the system copy of libffi), and rebased against 2.7 (which
+# has had a whitespace cleanup):
+Patch110: python-2.7rc1-ctypes-noexecmem.patch
# Patch the Makefile.pre.in so that the generated Makefile doesn't try to build
# a libpythonMAJOR.MINOR.a (bug 550692):
-Patch111: python-2.6.4-no-static-lib.patch
+Patch111: python-2.7rc1-no-static-lib.patch
# Patch to support building both optimized vs debug stacks DSO ABIs, sharing
# the same .py and .pyc files, using "_d.so" to signify a debug build of an
@@ -366,7 +367,7 @@ Patch111: python-2.6.4-no-static-lib.patch
# python$(VERSION)-config, so that the two configuration get different paths
# for these.
-Patch112: python-2.6.5-debug-build.patch
+Patch112: python-2.7rc1-debug-build.patch
# Add configure-time support for the COUNT_ALLOCS and CALL_PROFILE options
@@ -377,34 +378,37 @@ Patch113: python-2.6.5-more-configuration-flags.patch
# Add flags for statvfs.f_flag to the constant list in posixmodule (i.e. "os")
# (rhbz:553020); partially upstream as
http://bugs.python.org/issue7647
-Patch114: python-2.6.5-statvfs-f_flag-constants.patch
+Patch114: python-2.7rc1-statvfs-f_flag-constants.patch
# Make "pydoc -k" more robust in the face of broken modules
# (rhbz:461419; patch sent upstream as
http://bugs.python.org/issue7425 )
Patch115: make-pydoc-more-robust-001.patch
-# CVE-2010-1634: fix various integer overflow checks in the audioop module
-# This is the difference from r81031 to r81080 (i.e r81046 and r81080), but
-# backported to the old layout before the whitespeace cleanup to
-# release26-maint (in r81031):
-Patch116: python-2.6.2-CVE-2010-1634.patch
-
-# CVE-2010-2089: verify sizes/lengths within audioop module:
-Patch117: python-2.6.2-CVE-2010-2089.patch
-
-# CVE-2008-5983: the new PySys_SetArgvEx entry point from r81399 (backported to
-# the old layout before the whitespeace cleanup of release26-maint in r81031):
-Patch118: python-2.6.2-CVE-2008-5983.patch
-
# Fix an incompatibility between pyexpat and the system expat-2.0.1 that led to
# a segfault running test_pyexpat.py (rhbz:583931)
# Sent upstream as
http://bugs.python.org/issue9054
Patch119: python-2.6.5-fix-expat-issue9054.patch
-# Stop python bailing out with an assertion failure when UnicodeDecodeErrors
-# occur on very large buffers (rhbz:540518)
-# Sent upstream as
http://bugs.python.org/issue9058
-Patch120: python-2.6.5-remove-PyUnicodeDecodeError_Create-assertions-issue9058.patch
+# Upstream r79310 removed the "Modules" directory from sys.path when Python is
+# running from the build directory on POSIX to fix a unit test (issue #8205).
+# This seems to have broken the compileall.py done in "make install": it
cannot
+# find shared library extension modules at this point in the build (sys.path
+# does not contain DESTDIR/usr/lib(64)/python-2.7/lib-dynload for some reason),
+# leading to the build failing with:
+# Traceback (most recent call last):
+# File
"/home/david/rpmbuild/BUILDROOT/python-2.7-0.1.rc2.fc14.x86_64/usr/lib64/python2.7/compileall.py",
line 17, in <module>
+# import struct
+# File
"/home/david/rpmbuild/BUILDROOT/python-2.7-0.1.rc2.fc14.x86_64/usr/lib64/python2.7/struct.py",
line 1, in <module>
+# from _struct import *
+# ImportError: No module named _struct
+#
+# For now, revert this patch:
+Patch121: python-2.7rc2-r79310.patch
+
+# This is the generated patch to "configure"; see the description of
+# %{regenerate_autotooling_patch}
+# above:
+Patch300: python-2.7-autotool-intermediates.patch
%if %{main_python}
Obsoletes: Distutils
@@ -475,6 +479,7 @@ provides the libraries needed for this.
Summary: The libraries and header files needed for Python development
Group: Development/Libraries
Requires: %{python}%{?_isa} = %{version}-%{release}
+Requires: pkgconfig
# Needed here because of the migration of Makefile from -devel to the main
# package
Conflicts: %{python} < %{version}-%{release}
@@ -600,7 +605,6 @@ rm -r Modules/zlib || exit 1
# Apply patches:
#
%patch0 -p1 -b .rhconfig
-%patch3 -p1 -b .expat
%patch1 -p1 -b .no_gui
%patch4 -p1 -b .cflags
%patch6 -p1 -b .plural
@@ -612,6 +616,7 @@ rm -r Modules/zlib || exit 1
%patch101 -p1 -b .lib64-regex
%if "%{_lib}" == "lib64"
%patch102 -p1 -b .lib64
+%patch103 -p1 -b .lib64-sysconfig
%endif
%patch10 -p1 -b .binutils-no-dep
@@ -621,9 +626,6 @@ rm -r Modules/zlib || exit 1
%patch16 -p1 -b .rpath
%patch17 -p1 -b .distutils-rpath
-%patch51 -p1 -b .brprpm
-%patch52 -p0 -b .valgrind
-%patch53 -p0 -b .db48
%patch54 -p1 -b .setup-db48
%if 0%{?with_systemtap}
%patch55 -p1 -b .systemtap
@@ -641,15 +643,18 @@ rm -r Modules/zlib || exit 1
%patch115 -p0
-%patch116 -p1 -b .CVE-2010-1634
-%patch117 -p1 -b .CVE-2010-2089
-%patch118 -p1 -b .CVE-2008-5983
%patch119 -p0 -b .fix-expat-issue9054
-%patch120 -p0 -b .remove-unicode-decode-error-assertions-issue9058
+%patch121 -p0 -R
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
+%if ! 0%{regenerate_autotooling_patch}
+# Normally we apply the patch to "configure"
+# We don't apply the patch if we're working towards regenerating it
+%patch300 -p0 -b .autotool-intermediates
+%endif
+
%build
topdir=$(pwd)
export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv"
@@ -664,17 +669,30 @@ fi
# Force CC
export CC=gcc
-# We need to get a newer configure generated out of configure.in for the following
-# patches:
-# patch 4 (CFLAGS)
-# patch 52 (valgrind)
-# patch 55 (systemtap)
-# Rerun autoconf:
-autoconf
+%if 0%{regenerate_autotooling_patch}
+# If enabled, this code regenerates the patch to "configure", using a
+# local copy of autoconf-2.65, then exits the build
+#
+# The following assumes that the copy is installed to ~/autoconf-2.65/bin
+# as per these instructions:
+#
http://bugs.python.org/issue7997
+
+for f in pyconfig.h.in configure ; do
+ cp $f $f.autotool-intermediates ;
+done
-# For patch 55 (systemtap), we need to get a new header for configure to use:
+# Rerun the autotools:
+PATH=~/autoconf-2.65/bin:$PATH autoconf
autoheader
+# Regenerate the patch:
+gendiff . .autotool-intermediates > %{PATCH300}
+
+
+# Exit the build
+exit 1
+%endif
+
# Define a function, for how to perform a "build" of python for a given
# configuration:
BuildPython() {
@@ -781,11 +799,18 @@ InstallPython() {
make install DESTDIR=%{buildroot}
-# Copy up the gdb hooks into place; the python file will be autoloaded by gdb
-# when visiting libpython.so, provided that the python file is installed to the
-# same path as the library (or its .debug file) plus a "-gdb.py" suffix, e.g:
-# /usr/lib/debug/usr/lib64/libpython2.6.so.1.0.debug-gdb.py
+# We install a collection of hooks for gdb that make it easier to debug
+# executables linked against libpython (such as /usr/lib/python itself)
+#
+# These hooks are implemented in Python itself
+#
+# gdb-archer looks for them in the same path as the ELF file, with a -gdb.py suffix.
+# We put them in the debuginfo package by installing them to e.g.:
+# /usr/lib/debug/usr/lib/libpython2.6.so.1.0.debug-gdb.py
# (note that the debug path is /usr/lib/debug for both 32/64 bit)
+#
+# See
https://fedoraproject.org/wiki/Features/EasierPythonDebugging for more
+# information
#
# Initially I tried:
# /usr/lib/libpython2.6.so.1.0-gdb.py
@@ -796,7 +821,7 @@ DirHoldingGdbPy=%{_prefix}/lib/debug/%{_libdir}
PathOfGdbPy=$DirHoldingGdbPy/$PyInstSoName.debug-gdb.py
mkdir -p %{buildroot}$DirHoldingGdbPy
-cp %{SOURCE1} %{buildroot}$PathOfGdbPy
+cp $topdir/Tools/gdb/libpython.py %{buildroot}$PathOfGdbPy
# Manually byte-compile the file, in case find-debuginfo.sh is run before
# brp-python-bytecompile, so that the .pyc/.pyo files are properly listed in
@@ -869,15 +894,6 @@ mv %{buildroot}/%{_mandir}/man1/python.1
%{buildroot}/%{_mandir}/man1/python%{py
mkdir -p ${RPM_BUILD_ROOT}%{site_packages}
-#modulator
-cat > ${RPM_BUILD_ROOT}%{_bindir}/modulator << EOF
-#!/bin/bash
-exec %{site_packages}/modulator/modulator.py
-EOF
-chmod 755 ${RPM_BUILD_ROOT}%{_bindir}/modulator
-cp -r Tools/modulator \
- ${RPM_BUILD_ROOT}%{site_packages}/
-
#pynche
cat > ${RPM_BUILD_ROOT}%{_bindir}/pynche << EOF
#!/bin/bash
@@ -888,7 +904,6 @@ rm -f Tools/pynche/*.pyw
cp -r Tools/pynche \
${RPM_BUILD_ROOT}%{site_packages}/
-mv Tools/modulator/README Tools/modulator/README.modulator
mv Tools/pynche/README Tools/pynche/README.pynche
#gettext
@@ -915,8 +930,6 @@ find %{buildroot}/ -name "*.bat"|xargs rm -f
find . -name "*~"|xargs rm -f
find . -name ".cvsignore"|xargs rm -f
#zero length
-rm -f %{buildroot}%{site_packages}/modulator/Templates/copyright
-
rm -f %{buildroot}%{pylibdir}/LICENSE.txt
@@ -924,7 +937,6 @@ rm -f %{buildroot}%{pylibdir}/LICENSE.txt
%if !%{main_python}
pushd %{buildroot}%{_bindir}
mv idle idle%{__python_ver}
-mv modulator modulator%{__python_ver}
mv pynche pynche%{__python_ver}
mv pygettext.py pygettext%{__python_ver}.py
mv msgfmt.py msgfmt%{__python_ver}.py
@@ -1050,7 +1062,6 @@ rm -fr %{buildroot}
%{dynload_dir}/Python-%{version}-py%{pybasever}.egg-info
%{dynload_dir}/_bisectmodule.so
%{dynload_dir}/_bsddb.so
-%{dynload_dir}/_bytesio.so
%{dynload_dir}/_codecs_cn.so
%{dynload_dir}/_codecs_hk.so
%{dynload_dir}/_codecs_iso2022.so
@@ -1063,11 +1074,11 @@ rm -fr %{buildroot}
%{dynload_dir}/_curses.so
%{dynload_dir}/_curses_panel.so
%{dynload_dir}/_elementtree.so
-%{dynload_dir}/_fileio.so
%{dynload_dir}/_functoolsmodule.so
%{dynload_dir}/_hashlib.so
%{dynload_dir}/_heapq.so
%{dynload_dir}/_hotshot.so
+%{dynload_dir}/_io.so
%{dynload_dir}/_json.so
%{dynload_dir}/_localemodule.so
%{dynload_dir}/_lsprof.so
@@ -1101,7 +1112,7 @@ rm -fr %{buildroot}
%{dynload_dir}/imageop.so
%{dynload_dir}/itertoolsmodule.so
%{dynload_dir}/linuxaudiodev.so
-%{dynload_dir}/mathmodule.so
+%{dynload_dir}/math.so
%{dynload_dir}/mmapmodule.so
%{dynload_dir}/nismodule.so
%{dynload_dir}/operator.so
@@ -1144,17 +1155,20 @@ rm -fr %{buildroot}
%{pylibdir}/encodings
%{pylibdir}/hotshot
%{pylibdir}/idlelib
+%{pylibdir}/importlib
%dir %{pylibdir}/json
%{pylibdir}/json/*.py*
%{pylibdir}/lib2to3
%{pylibdir}/logging
%{pylibdir}/multiprocessing
%{pylibdir}/plat-linux2
+%{pylibdir}/pydoc_data
%dir %{pylibdir}/sqlite3
%{pylibdir}/sqlite3/*.py*
%dir %{pylibdir}/test
%{pylibdir}/test/test_support.py*
%{pylibdir}/test/__init__.py*
+%{pylibdir}/unittest
%{pylibdir}/wsgiref
%{pylibdir}/xml
%if "%{_lib}" == "lib64"
@@ -1181,6 +1195,8 @@ rm -fr %{buildroot}
%files devel
%defattr(-,root,root,-)
+%{_libdir}/pkgconfig/python-%{pybasever}.pc
+%{_libdir}/pkgconfig/python.pc
%{pylibdir}/config/*
%exclude %{pylibdir}/config/Makefile
%{pylibdir}/distutils/command/wininst-*.exe
@@ -1195,14 +1211,11 @@ rm -fr %{buildroot}
%files tools
%defattr(-,root,root,755)
-%doc Tools/modulator/README.modulator
%doc Tools/pynche/README.pynche
-%{site_packages}/modulator
%{site_packages}/pynche
%{_bindir}/smtpd*.py*
%{_bindir}/2to3*
%{_bindir}/idle*
-%{_bindir}/modulator*
%{_bindir}/pynche*
%{_bindir}/pygettext*.py*
%{_bindir}/msgfmt*.py*
@@ -1251,7 +1264,6 @@ rm -fr %{buildroot}
# ...with debug builds of the built-in "extension" modules:
%{dynload_dir}/_bisectmodule_d.so
%{dynload_dir}/_bsddb_d.so
-%{dynload_dir}/_bytesio_d.so
%{dynload_dir}/_codecs_cn_d.so
%{dynload_dir}/_codecs_hk_d.so
%{dynload_dir}/_codecs_iso2022_d.so
@@ -1264,11 +1276,11 @@ rm -fr %{buildroot}
%{dynload_dir}/_curses_d.so
%{dynload_dir}/_curses_panel_d.so
%{dynload_dir}/_elementtree_d.so
-%{dynload_dir}/_fileio_d.so
%{dynload_dir}/_functoolsmodule_d.so
%{dynload_dir}/_hashlib_d.so
%{dynload_dir}/_heapq_d.so
%{dynload_dir}/_hotshot_d.so
+%{dynload_dir}/_io_d.so
%{dynload_dir}/_json_d.so
%{dynload_dir}/_localemodule_d.so
%{dynload_dir}/_lsprof_d.so
@@ -1302,7 +1314,7 @@ rm -fr %{buildroot}
%{dynload_dir}/imageop_d.so
%{dynload_dir}/itertoolsmodule_d.so
%{dynload_dir}/linuxaudiodev_d.so
-%{dynload_dir}/mathmodule_d.so
+%{dynload_dir}/math_d.so
%{dynload_dir}/mmapmodule_d.so
%{dynload_dir}/nismodule_d.so
%{dynload_dir}/operator_d.so
@@ -1370,6 +1382,43 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Thu Jul 8 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-3
+- add patch to fixup the new sysconfig.py for our multilib support on
+64-bit (patch 103)
+
+* Thu Jul 8 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-2
+- add machinery for regenerating the "configure" script in the face of
+mismatching autoconf versions (patch 300)
+
+* Tue Jul 6 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-1
+- 2.7 final; drop alphatag
+- drop patch 117 (upstream), patch 120 (upstreamed)
+- fix the commented-out __python_ver from 26 to 27
+
+* Tue Jun 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-0.1.rc2
+- 2.7rc2
+- revert r79310 (patch 121)
+- remove modulator: upstream removed it in r78338
+- rename mathmodule(_d).so to math(_d).so in manifests (appears to be changed
+by r76861)
+- _bytesio(_d).so and _filesio(_d).so were consolidated into _io(_d).so in
+r73394 (upstream issue 6215)
+- use the gdb hooks from the upstream tarball, rather than keeping our own
+copy. The upstream version has some whitespace changes, a new write_repr for
+unicode objects, and various bulletproofings for being run on older gdbs
+
+* Tue Jun 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.7-0.1.rc1
+- 2.7rc1:
+ - rework patches to apply against 2.7 (which among other changes has had a
+whitespace cleanup of the .c code): .rhconfig (patch0), .binutils-no-dep
+(patch10), .ascii-tolower (patch11), .socketmodule (patch13), .socketmodule2
+(patch14), .systemtap (patch55), .lib64 (patch102), .selinux (patch110),
+.no-static-lib (patch111), .debug-build (patch112), .statvfs-f-flag-constants
+(patch114), ..CVE-2010-2089 (patch117)
+ - drop upstream patches: .expat (patch3), .brprpm (patch51), .valgrind
+(patch52), .db48 (patch53), .CVE-2010-1634 (patch 116), .CVE-2008-5983 (patch
+118)
+
* Tue Jun 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-17
- Stop python bailing out with an assertion failure when UnicodeDecodeErrors
occur on very large buffers (patch 120, upstream issue 9058)
diff --git a/sources b/sources
index 488aa1f..2c0d3aa 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-6bef0417e71a1a1737ccf5750420fdb3 Python-2.6.5.tar.bz2
+0e8c9ec32abf5b732bea7d91b38c3339 Python-2.7.tar.bz2
commit 500aee5ba1e55275f4e001e3cbbaeb13590c8003
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Tue Jun 22 19:07:26 2010 +0000
updated version of patch
diff --git a/python-2.6.5-remove-PyUnicodeDecodeError_Create-assertions-issue9058.patch
b/python-2.6.5-remove-PyUnicodeDecodeError_Create-assertions-issue9058.patch
index 02d5fe6..113305a 100644
--- a/python-2.6.5-remove-PyUnicodeDecodeError_Create-assertions-issue9058.patch
+++ b/python-2.6.5-remove-PyUnicodeDecodeError_Create-assertions-issue9058.patch
@@ -2,24 +2,13 @@ Index: Objects/exceptions.c
===================================================================
--- Objects/exceptions.c (revision 82153)
+++ Objects/exceptions.c (working copy)
-@@ -1784,11 +1784,15 @@
+@@ -1784,9 +1784,6 @@
const char *encoding, const char *object, Py_ssize_t length,
Py_ssize_t start, Py_ssize_t end, const char *reason)
{
- assert(length < INT_MAX);
- assert(start < INT_MAX);
- assert(end < INT_MAX);
-- return PyObject_CallFunction(PyExc_UnicodeDecodeError, "ss#nns",
-- encoding, object, length, start, end, reason);
-+ PyObject *str;
-+
-+ str = PyString_FromStringAndSize(object, length);
-+
-+ if (!str)
-+ return NULL;
-+
-+ return PyObject_CallFunction(PyExc_UnicodeDecodeError, "sNnns",
-+ encoding, str, start, end, reason);
+ return PyObject_CallFunction(PyExc_UnicodeDecodeError, "ss#nns",
+ encoding, object, length, start, end, reason);
}
-
-
commit 468e2badf21e80bd22475ab9c59afc261746d0ff
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Tue Jun 22 18:40:57 2010 +0000
- Stop python bailing out with an assertion failure when
UnicodeDecodeErrors occur on very large buffers (patch 120, upstream
issue 9058)
diff --git a/python-2.6.5-remove-PyUnicodeDecodeError_Create-assertions-issue9058.patch
b/python-2.6.5-remove-PyUnicodeDecodeError_Create-assertions-issue9058.patch
new file mode 100644
index 0000000..02d5fe6
--- /dev/null
+++ b/python-2.6.5-remove-PyUnicodeDecodeError_Create-assertions-issue9058.patch
@@ -0,0 +1,25 @@
+Index: Objects/exceptions.c
+===================================================================
+--- Objects/exceptions.c (revision 82153)
++++ Objects/exceptions.c (working copy)
+@@ -1784,11 +1784,15 @@
+ const char *encoding, const char *object, Py_ssize_t length,
+ Py_ssize_t start, Py_ssize_t end, const char *reason)
+ {
+- assert(length < INT_MAX);
+- assert(start < INT_MAX);
+- assert(end < INT_MAX);
+- return PyObject_CallFunction(PyExc_UnicodeDecodeError, "ss#nns",
+- encoding, object, length, start, end, reason);
++ PyObject *str;
++
++ str = PyString_FromStringAndSize(object, length);
++
++ if (!str)
++ return NULL;
++
++ return PyObject_CallFunction(PyExc_UnicodeDecodeError, "sNnns",
++ encoding, str, start, end, reason);
+ }
+
+
diff --git a/python.spec b/python.spec
index 6243acc..1d6b674 100644
--- a/python.spec
+++ b/python.spec
@@ -63,7 +63,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.6.5
-Release: 16%{?dist}
+Release: 17%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -401,6 +401,11 @@ Patch118: python-2.6.2-CVE-2008-5983.patch
# Sent upstream as
http://bugs.python.org/issue9054
Patch119: python-2.6.5-fix-expat-issue9054.patch
+# Stop python bailing out with an assertion failure when UnicodeDecodeErrors
+# occur on very large buffers (rhbz:540518)
+# Sent upstream as
http://bugs.python.org/issue9058
+Patch120: python-2.6.5-remove-PyUnicodeDecodeError_Create-assertions-issue9058.patch
+
%if %{main_python}
Obsoletes: Distutils
Provides: Distutils
@@ -640,6 +645,7 @@ rm -r Modules/zlib || exit 1
%patch117 -p1 -b .CVE-2010-2089
%patch118 -p1 -b .CVE-2008-5983
%patch119 -p0 -b .fix-expat-issue9054
+%patch120 -p0 -b .remove-unicode-decode-error-assertions-issue9058
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -1364,6 +1370,10 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Tue Jun 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-17
+- Stop python bailing out with an assertion failure when UnicodeDecodeErrors
+occur on very large buffers (patch 120, upstream issue 9058)
+
* Mon Jun 21 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-16
- Fix an incompatibility between pyexpat and the system expat-2.0.1 that led to
a segfault running test_pyexpat.py (patch 119; upstream issue 9054)
commit 908bb70bf7cb010aa546d9fba6109611bf25048a
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Mon Jun 21 22:36:03 2010 +0000
- Fix an incompatibility between pyexpat and the system expat-2.0.1 that
led to a segfault running test_pyexpat.py (patch 119; upstream issue
9054)
diff --git a/python-2.6.5-fix-expat-issue9054.patch
b/python-2.6.5-fix-expat-issue9054.patch
new file mode 100644
index 0000000..f1a4640
--- /dev/null
+++ b/python-2.6.5-fix-expat-issue9054.patch
@@ -0,0 +1,14 @@
+Index: Modules/pyexpat.c
+===================================================================
+--- Modules/pyexpat.c (revision 81539)
++++ Modules/pyexpat.c (working copy)
+@@ -415,6 +415,9 @@
+ PyObject *args;
+ PyObject *temp;
+
++ if (!have_handler(self, CharacterData))
++ return -1;
++
+ args = PyTuple_New(1);
+ if (args == NULL)
+ return -1;
diff --git a/python.spec b/python.spec
index a5395c5..6243acc 100644
--- a/python.spec
+++ b/python.spec
@@ -63,7 +63,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.6.5
-Release: 15%{?dist}
+Release: 16%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -396,6 +396,10 @@ Patch117: python-2.6.2-CVE-2010-2089.patch
# the old layout before the whitespeace cleanup of release26-maint in r81031):
Patch118: python-2.6.2-CVE-2008-5983.patch
+# Fix an incompatibility between pyexpat and the system expat-2.0.1 that led to
+# a segfault running test_pyexpat.py (rhbz:583931)
+# Sent upstream as
http://bugs.python.org/issue9054
+Patch119: python-2.6.5-fix-expat-issue9054.patch
%if %{main_python}
Obsoletes: Distutils
@@ -635,6 +639,7 @@ rm -r Modules/zlib || exit 1
%patch116 -p1 -b .CVE-2010-1634
%patch117 -p1 -b .CVE-2010-2089
%patch118 -p1 -b .CVE-2008-5983
+%patch119 -p0 -b .fix-expat-issue9054
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -1359,6 +1364,10 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Mon Jun 21 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-16
+- Fix an incompatibility between pyexpat and the system expat-2.0.1 that led to
+a segfault running test_pyexpat.py (patch 119; upstream issue 9054)
+
* Tue Jun 8 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-15
- add a flag to make it easy to turn off the debug build when troubleshooting
the rpm build
commit f078d6094f3b82292cf4b7898fbfd2065df60bb7
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Tue Jun 8 15:25:02 2010 +0000
- add a flag to make it easy to turn off the debug build when
troubleshooting the rpm build
diff --git a/python.spec b/python.spec
index 2426c57..a5395c5 100644
--- a/python.spec
+++ b/python.spec
@@ -33,6 +33,8 @@
%global py_INSTSONAME_optimized libpython%{pybasever}.so.%{py_SOVERSION}
%global py_INSTSONAME_debug libpython%{pybasever}_d.so.%{py_SOVERSION}
+%global with_debug_build 1
+
%global with_gdb_hooks 1
%global with_systemtap 1
@@ -61,7 +63,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.6.5
-Release: 14%{?dist}
+Release: 15%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -530,6 +532,7 @@ never used in production.
You might want to install the python-test package if you're developing python
code that uses more than just unittest and/or test_support.py.
+%if 0%{?with_debug_build}
%package debug
Summary: Debug version of the Python runtime
Group: Applications/System
@@ -560,6 +563,7 @@ It shares installation directories with the standard Python runtime,
so that
.py and .pyc files can be shared. All compiled extension modules gain a "_d"
suffix ("foo_d.so" rather than "foo.so") so that each Python
implementation can
load its own extensions.
+%endif # with_debug_build
%prep
%setup -q -n Python-%{version}
@@ -723,6 +727,7 @@ LD_LIBRARY_PATH="$topdir/$ConfDir"
PATH=$PATH:$topdir/$ConfDir make -s OPT="$CFL
# Use "BuildPython" to support building with different configurations:
+%if 0%{?with_debug_build}
BuildPython debug \
python-debug \
python%{pybasever}-debug \
@@ -732,6 +737,7 @@ BuildPython debug \
"--with-pydebug --with-count-allocs --with-call-profile" \
%endif
false
+%endif # with_debug_build
BuildPython optimized \
python \
@@ -799,9 +805,11 @@ LD_LIBRARY_PATH="$topdir/$ConfDir"
$topdir/$ConfDir/$BinaryName -O \
# Use "InstallPython" to support building with different configurations:
# Install the "debug" build first, so that we can move some files aside
+%if 0%{?with_debug_build}
InstallPython debug \
python%{pybasever}-debug \
%{py_INSTSONAME_debug}
+%endif # with_debug_build
# Now the optimized build:
InstallPython optimized \
@@ -835,10 +843,14 @@ fi
%if %{main_python}
ln -s python %{buildroot}%{_bindir}/python2
+%if 0%{?with_debug_build}
ln -s python-debug %{buildroot}%{_bindir}/python2-debug
+%endif # with_debug_build
%else
mv %{buildroot}%{_bindir}/python %{buildroot}%{_bindir}/%{python}
+%if 0%{?with_debug_build}
mv %{buildroot}%{_bindir}/python-debug %{buildroot}%{_bindir}/%{python}-debug
+%endif # with_debug_build
mv %{buildroot}/%{_mandir}/man1/python.1
%{buildroot}/%{_mandir}/man1/python%{pybasever}.1
%endif
@@ -927,7 +939,14 @@ install -d %{buildroot}/usr/lib/python%{pybasever}/site-packages
%else
%global _pyconfig_h %{_pyconfig32_h}
%endif
-for PyIncludeDir in python%{pybasever} python%{pybasever}-debug ; do
+
+%if 0%{?with_debug_build}
+%global PyIncludeDirs python%{pybasever} python%{pybasever}-debug
+%else
+%global PyIncludeDirs python%{pybasever}
+%endif
+
+for PyIncludeDir in %{PyIncludeDirs} ; do
mv %{buildroot}%{_includedir}/$PyIncludeDir/pyconfig.h \
%{buildroot}%{_includedir}/$PyIncludeDir/%{_pyconfig_h}
cat > %{buildroot}%{_includedir}/$PyIncludeDir/pyconfig.h << EOF
@@ -989,10 +1008,12 @@ sed \
%{SOURCE3} \
%{buildroot}%{tapsetdir}/%{libpython_stp_optimized}
+%if 0%{?with_debug_build}
sed \
-e "s|LIBRARY_PATH|%{_libdir}/%{py_INSTSONAME_debug}|" \
%{SOURCE3} \
%{buildroot}%{tapsetdir}/%{libpython_stp_debug}
+%endif #
with_debug_build
%endif # with_systemtap
%clean
@@ -1205,6 +1226,7 @@ rm -fr %{buildroot}
# Hence the manifest is the combination of analogous files in the manifests of
# all of the other subpackages
+%if 0%{?with_debug_build}
%files debug
%defattr(-,root,root,-)
@@ -1320,6 +1342,9 @@ rm -fr %{buildroot}
%{dynload_dir}/_ctypes_test_d.so
%{dynload_dir}/_testcapimodule_d.so
+%endif # with_debug_build
+
+
# We put the debug-gdb.py file inside /usr/lib/debug to avoid noise from
# ldconfig (rhbz:562980).
#
@@ -1334,6 +1359,10 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Tue Jun 8 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-15
+- add a flag to make it easy to turn off the debug build when troubleshooting
+the rpm build
+
* Sat Jun 5 2010 Dan Hork <dan[at]danny.cz> - 2.6.5-14
- reading the timestamp counter is available only on some arches (see Python/ceval.c)
- disable --with-valgrind on s390(x) arches
commit 0c63f17a1df02254300c4065e2ed31c3ae54f743
Author: Dan Hork <sharkcz(a)fedoraproject.org>
Date: Sat Jun 5 08:11:11 2010 +0000
- reading the timestamp counter is available only on some arches (see
Python/ceval.c)
- disable --with-valgrind on s390(x) arches
diff --git a/python.spec b/python.spec
index 99209af..2426c57 100644
--- a/python.spec
+++ b/python.spec
@@ -37,8 +37,8 @@
%global with_systemtap 1
-# sparc arches dont have valgrind so we need to disable its support on them
-%ifarch %{sparc}
+# some arches dont have valgrind so we need to disable its support on them
+%ifarch %{sparc} s390 s390x
%global with_valgrind 0
%else
%global with_valgrind 1
@@ -61,7 +61,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.6.5
-Release: 13%{?dist}
+Release: 14%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -726,7 +726,11 @@ LD_LIBRARY_PATH="$topdir/$ConfDir"
PATH=$PATH:$topdir/$ConfDir make -s OPT="$CFL
BuildPython debug \
python-debug \
python%{pybasever}-debug \
+%ifarch %{ix86} x86_64 ppc ppc64
"--with-pydebug --with-tsc --with-count-allocs --with-call-profile" \
+%else
+ "--with-pydebug --with-count-allocs --with-call-profile" \
+%endif
false
BuildPython optimized \
@@ -1330,6 +1334,10 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Sat Jun 5 2010 Dan Hork <dan[at]danny.cz> - 2.6.5-14
+- reading the timestamp counter is available only on some arches (see Python/ceval.c)
+- disable --with-valgrind on s390(x) arches
+
* Fri Jun 4 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-13
- ensure that the compiler is invoked with "-fwrapv" (rhbz#594819)
- CVE-2010-1634: fix various integer overflow checks in the audioop
commit 20184a0a2f6bd349e1eeed30b1608bb6371ae8fd
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Fri Jun 4 21:11:42 2010 +0000
fix patch numbers in %changelog
diff --git a/python.spec b/python.spec
index 61681b3..99209af 100644
--- a/python.spec
+++ b/python.spec
@@ -1333,9 +1333,9 @@ rm -fr %{buildroot}
* Fri Jun 4 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-13
- ensure that the compiler is invoked with "-fwrapv" (rhbz#594819)
- CVE-2010-1634: fix various integer overflow checks in the audioop
-module (patch 113)
-- CVE-2010-2089: further checks within the audioop module (patch 114)
-- CVE-2008-5983: the new PySys_SetArgvEx entry point from r81399 (patch 115)
+module (patch 116)
+- CVE-2010-2089: further checks within the audioop module (patch 117)
+- CVE-2008-5983: the new PySys_SetArgvEx entry point from r81399 (patch 118)
* Thu May 27 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-12
- make "pydoc -k" more robust in the face of broken modules (rhbz:461419,
patch115)
commit 94e8505fb94e56466ebef707806e8b4ecc22fc67
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Fri Jun 4 18:05:41 2010 +0000
- ensure that the compiler is invoked with "-fwrapv" (rhbz#594819)
- CVE-2010-1634: fix various integer overflow checks in the audioop module
(patch 113)
- CVE-2010-2089: further checks within the audioop module (patch 114)
- CVE-2008-5983: the new PySys_SetArgvEx entry point from r81399 (patch
115)
diff --git a/python-2.6.2-CVE-2008-5983.patch b/python-2.6.2-CVE-2008-5983.patch
new file mode 100644
index 0000000..de640cb
--- /dev/null
+++ b/python-2.6.2-CVE-2008-5983.patch
@@ -0,0 +1,137 @@
+diff -up Python-2.6.2/Doc/c-api/init.rst.CVE-2008-5983 Python-2.6.2/Doc/c-api/init.rst
+--- Python-2.6.2/Doc/c-api/init.rst.CVE-2008-5983 2009-04-05 17:26:31.000000000 -0400
++++ Python-2.6.2/Doc/c-api/init.rst 2010-06-04 11:19:30.750199971 -0400
+@@ -22,6 +22,7 @@ Initialization, Finalization, and Thread
+ module: sys
+ triple: module; search; path
+ single: PySys_SetArgv()
++ single: PySys_SetArgvEx()
+ single: Py_Finalize()
+
+ Initialize the Python interpreter. In an application embedding Python, this
+@@ -31,7 +32,7 @@ Initialization, Finalization, and Thread
+ the table of loaded modules (``sys.modules``), and creates the fundamental
+ modules :mod:`__builtin__`, :mod:`__main__` and :mod:`sys`. It also initializes
+ the module search path (``sys.path``). It does not set ``sys.argv``; use
+- :cfunc:`PySys_SetArgv` for that. This is a no-op when called for a second time
++ :cfunc:`PySys_SetArgvEx` for that. This is a no-op when called for a second time
+ (without calling :cfunc:`Py_Finalize` first). There is no return value; it is a
+ fatal error if the initialization fails.
+
+@@ -346,7 +347,7 @@ Initialization, Finalization, and Thread
+ ``sys.version``.
+
+
+-.. cfunction:: void PySys_SetArgv(int argc, char **argv)
++.. cfunction:: void PySys_SetArgvEx(int argc, char **argv, int updatepath)
+
+ .. index::
+ single: main()
+@@ -361,14 +362,41 @@ Initialization, Finalization, and Thread
+ string. If this function fails to initialize :data:`sys.argv`, a fatal
+ condition is signalled using :cfunc:`Py_FatalError`.
+
+- This function also prepends the executed script's path to :data:`sys.path`.
+- If no script is executed (in the case of calling ``python -c`` or just the
+- interactive interpreter), the empty string is used instead.
++ If *updatepath* is zero, this is all the function does. If *updatepath*
++ is non-zero, the function also modifies :data:`sys.path` according to the
++ following algorithm:
++
++ - If the name of an existing script is passed in ``argv[0]``, the absolute
++ path of the directory where the script is located is prepended to
++ :data:`sys.path`.
++ - Otherwise (that is, if *argc* is 0 or ``argv[0]`` doesn't point
++ to an existing file name), an empty string is prepended to
++ :data:`sys.path`, which is the same as prepending the current working
++ directory (``"."``).
++
++ .. note::
++ It is recommended that applications embedding the Python interpreter
++ for purposes other than executing a single script pass 0 as *updatepath*,
++ and update :data:`sys.path` themselves if desired.
++ See `CVE-2008-5983
<
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-5983>`_.
++
++ On versions before 2.6.6, you can achieve the same effect by manually
++ popping the first :data:`sys.path` element after having called
++ :cfunc:`PySys_SetArgv`, for example using::
++
++ PyRun_SimpleString("import sys; sys.path.pop(0)\n");
++
++ .. versionadded:: 2.6.6
+
+ .. XXX impl. doesn't seem consistent in allowing 0/NULL for the params;
+ check w/ Guido.
+
+
++.. cfunction:: void PySys_SetArgv(int argc, char **argv)
++
++ This function works like :cfunc:`PySys_SetArgv` with *updatepath* set to 1.
++
++
+ .. cfunction:: void Py_SetPythonHome(char *home)
+
+ Set the default "home" directory, that is, the location of the standard
+diff -up Python-2.6.2/Include/sysmodule.h.CVE-2008-5983 Python-2.6.2/Include/sysmodule.h
+--- Python-2.6.2/Include/sysmodule.h.CVE-2008-5983 2008-04-12 19:44:07.000000000 -0400
++++ Python-2.6.2/Include/sysmodule.h 2010-06-04 11:19:30.747199764 -0400
+@@ -11,6 +11,7 @@ PyAPI_FUNC(PyObject *) PySys_GetObject(c
+ PyAPI_FUNC(int) PySys_SetObject(char *, PyObject *);
+ PyAPI_FUNC(FILE *) PySys_GetFile(char *, FILE *);
+ PyAPI_FUNC(void) PySys_SetArgv(int, char **);
++PyAPI_FUNC(void) PySys_SetArgvEx(int, char **, int);
+ PyAPI_FUNC(void) PySys_SetPath(char *);
+
+ PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...)
+diff -up Python-2.6.2/Misc/NEWS.CVE-2008-5983 Python-2.6.2/Misc/NEWS
+--- Python-2.6.2/Misc/NEWS.CVE-2008-5983 2010-06-04 11:19:30.730199353 -0400
++++ Python-2.6.2/Misc/NEWS 2010-06-04 11:19:30.749199965 -0400
+@@ -111,6 +111,14 @@ Core and Builtins
+ Valgrind. This gives improved memory leak detection when running
+ under Valgrind, while taking advantage of pymalloc at other times.
+
++C-API
++-----
++
++- Issue #5753: A new C API function, :cfunc:`PySys_SetArgvEx`, allows
++ embedders of the interpreter to set sys.argv without also modifying
++ sys.path. This helps fix `CVE-2008-5983
++ <
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-5983>`_.
++
+ Library
+ -------
+
+diff -up Python-2.6.2/Python/sysmodule.c.CVE-2008-5983 Python-2.6.2/Python/sysmodule.c
+--- Python-2.6.2/Python/sysmodule.c.CVE-2008-5983 2009-01-13 19:08:09.000000000 -0500
++++ Python-2.6.2/Python/sysmodule.c 2010-06-04 11:20:18.931825713 -0400
+@@ -1528,7 +1528,7 @@ makeargvobject(int argc, char **argv)
+ }
+
+ void
+-PySys_SetArgv(int argc, char **argv)
++PySys_SetArgvEx(int argc, char **argv, int updatepath)
+ {
+ #if defined(HAVE_REALPATH)
+ char fullpath[MAXPATHLEN];
+@@ -1541,7 +1541,7 @@ PySys_SetArgv(int argc, char **argv)
+ Py_FatalError("no mem for sys.argv");
+ if (PySys_SetObject("argv", av) != 0)
+ Py_FatalError("can't assign sys.argv");
+- if (path != NULL) {
++ if (updatepath && path != NULL) {
+ char *argv0 = argv[0];
+ char *p = NULL;
+ Py_ssize_t n = 0;
+@@ -1631,6 +1631,12 @@ PySys_SetArgv(int argc, char **argv)
+ Py_DECREF(av);
+ }
+
++void
++PySys_SetArgv(int argc, char **argv)
++{
++ PySys_SetArgvEx(argc, argv, 1);
++}
++
+
+ /* APIs to write to sys.stdout or sys.stderr using a printf-like interface.
+ Adapted from code submitted by Just van Rossum.
diff --git a/python-2.6.2-CVE-2010-1634.patch b/python-2.6.2-CVE-2010-1634.patch
new file mode 100644
index 0000000..a4144eb
--- /dev/null
+++ b/python-2.6.2-CVE-2010-1634.patch
@@ -0,0 +1,210 @@
+diff -up Python-2.6.2/Modules/audioop.c.CVE-2010-1634 Python-2.6.2/Modules/audioop.c
+--- Python-2.6.2/Modules/audioop.c.CVE-2010-1634 2008-07-07 13:02:59.000000000 -0400
++++ Python-2.6.2/Modules/audioop.c 2010-06-04 11:02:45.743200233 -0400
+@@ -829,7 +829,7 @@ static PyObject *
+ audioop_tostereo(PyObject *self, PyObject *args)
+ {
+ signed char *cp, *ncp;
+- int len, new_len, size, val1, val2, val = 0;
++ int len, size, val1, val2, val = 0;
+ double fac1, fac2, fval, maxval;
+ PyObject *rv;
+ int i;
+@@ -846,14 +846,13 @@ audioop_tostereo(PyObject *self, PyObjec
+ return 0;
+ }
+
+- new_len = len*2;
+- if (new_len < 0) {
++ if (len > INT_MAX/2) {
+ PyErr_SetString(PyExc_MemoryError,
+ "not enough memory for output buffer");
+ return 0;
+ }
+
+- rv = PyString_FromStringAndSize(NULL, new_len);
++ rv = PyString_FromStringAndSize(NULL, len*2);
+ if ( rv == 0 )
+ return 0;
+ ncp = (signed char *)PyString_AsString(rv);
+@@ -1016,7 +1015,7 @@ audioop_lin2lin(PyObject *self, PyObject
+ {
+ signed char *cp;
+ unsigned char *ncp;
+- int len, new_len, size, size2, val = 0;
++ int len, size, size2, val = 0;
+ PyObject *rv;
+ int i, j;
+
+@@ -1030,13 +1029,12 @@ audioop_lin2lin(PyObject *self, PyObject
+ return 0;
+ }
+
+- new_len = (len/size)*size2;
+- if (new_len < 0) {
++ if (len/size > INT_MAX/size2) {
+ PyErr_SetString(PyExc_MemoryError,
+ "not enough memory for output buffer");
+ return 0;
+ }
+- rv = PyString_FromStringAndSize(NULL, new_len);
++ rv = PyString_FromStringAndSize(NULL, (len/size)*size2);
+ if ( rv == 0 )
+ return 0;
+ ncp = (unsigned char *)PyString_AsString(rv);
+@@ -1072,7 +1070,6 @@ audioop_ratecv(PyObject *self, PyObject
+ int chan, d, *prev_i, *cur_i, cur_o;
+ PyObject *state, *samps, *str, *rv = NULL;
+ int bytes_per_frame;
+- size_t alloc_size;
+
+ weightA = 1;
+ weightB = 0;
+@@ -1115,14 +1112,13 @@ audioop_ratecv(PyObject *self, PyObject
+ inrate /= d;
+ outrate /= d;
+
+- alloc_size = sizeof(int) * (unsigned)nchannels;
+- if (alloc_size < nchannels) {
++ if ((size_t)nchannels > PY_SIZE_MAX/sizeof(int)) {
+ PyErr_SetString(PyExc_MemoryError,
+ "not enough memory for output buffer");
+ return 0;
+ }
+- prev_i = (int *) malloc(alloc_size);
+- cur_i = (int *) malloc(alloc_size);
++ prev_i = (int *) malloc(nchannels * sizeof(int));
++ cur_i = (int *) malloc(nchannels * sizeof(int));
+ if (prev_i == NULL || cur_i == NULL) {
+ (void) PyErr_NoMemory();
+ goto exit;
+@@ -1159,25 +1155,16 @@ audioop_ratecv(PyObject *self, PyObject
+ ceiling(len*outrate/inrate) output frames, and each frame
+ requires bytes_per_frame bytes. Computing this
+ without spurious overflow is the challenge; we can
+- settle for a reasonable upper bound, though. */
+- int ceiling; /* the number of output frames */
+- int nbytes; /* the number of output bytes needed */
+- int q = len / inrate;
+- /* Now len = q * inrate + r exactly (with r = len % inrate),
+- and this is less than q * inrate + inrate = (q+1)*inrate.
+- So a reasonable upper bound on len*outrate/inrate is
+- ((q+1)*inrate)*outrate/inrate =
+- (q+1)*outrate.
+- */
+- ceiling = (q+1) * outrate;
+- nbytes = ceiling * bytes_per_frame;
+- /* See whether anything overflowed; if not, get the space. */
+- if (q+1 < 0 ||
+- ceiling / outrate != q+1 ||
+- nbytes / bytes_per_frame != ceiling)
++ settle for a reasonable upper bound, though, in this
++ case ceiling(len/inrate) * outrate. */
++
++ /* compute ceiling(len/inrate) without overflow */
++ int q = len > 0 ? 1 + (len - 1) / inrate : 0;
++ if (outrate > INT_MAX / q / bytes_per_frame)
+ str = NULL;
+ else
+- str = PyString_FromStringAndSize(NULL, nbytes);
++ str = PyString_FromStringAndSize(NULL,
++ q * outrate *
bytes_per_frame);
+
+ if (str == NULL) {
+ PyErr_SetString(PyExc_MemoryError,
+@@ -1296,7 +1283,7 @@ audioop_ulaw2lin(PyObject *self, PyObjec
+ unsigned char *cp;
+ unsigned char cval;
+ signed char *ncp;
+- int len, new_len, size, val;
++ int len, size, val;
+ PyObject *rv;
+ int i;
+
+@@ -1309,18 +1296,17 @@ audioop_ulaw2lin(PyObject *self, PyObjec
+ return 0;
+ }
+
+- new_len = len*size;
+- if (new_len < 0) {
++ if (len > INT_MAX/size) {
+ PyErr_SetString(PyExc_MemoryError,
+ "not enough memory for output buffer");
+ return 0;
+ }
+- rv = PyString_FromStringAndSize(NULL, new_len);
++ rv = PyString_FromStringAndSize(NULL, len*size);
+ if ( rv == 0 )
+ return 0;
+ ncp = (signed char *)PyString_AsString(rv);
+
+- for ( i=0; i < new_len; i += size ) {
++ for ( i=0; i < len*size; i += size ) {
+ cval = *cp++;
+ val = st_ulaw2linear16(cval);
+
+@@ -1370,7 +1356,7 @@ audioop_alaw2lin(PyObject *self, PyObjec
+ unsigned char *cp;
+ unsigned char cval;
+ signed char *ncp;
+- int len, new_len, size, val;
++ int len, size, val;
+ PyObject *rv;
+ int i;
+
+@@ -1383,18 +1369,17 @@ audioop_alaw2lin(PyObject *self, PyObjec
+ return 0;
+ }
+
+- new_len = len*size;
+- if (new_len < 0) {
++ if (len > INT_MAX/size) {
+ PyErr_SetString(PyExc_MemoryError,
+ "not enough memory for output buffer");
+ return 0;
+ }
+- rv = PyString_FromStringAndSize(NULL, new_len);
++ rv = PyString_FromStringAndSize(NULL, len*size);
+ if ( rv == 0 )
+ return 0;
+ ncp = (signed char *)PyString_AsString(rv);
+
+- for ( i=0; i < new_len; i += size ) {
++ for ( i=0; i < len*size; i += size ) {
+ cval = *cp++;
+ val = st_alaw2linear16(cval);
+
+@@ -1519,7 +1504,7 @@ audioop_adpcm2lin(PyObject *self, PyObje
+ {
+ signed char *cp;
+ signed char *ncp;
+- int len, new_len, size, valpred, step, delta, index, sign, vpdiff;
++ int len, size, valpred, step, delta, index, sign, vpdiff;
+ PyObject *rv, *str, *state;
+ int i, inputbuffer = 0, bufferstep;
+
+@@ -1541,13 +1526,12 @@ audioop_adpcm2lin(PyObject *self, PyObje
+ } else if ( !PyArg_ParseTuple(state, "ii", &valpred, &index)
)
+ return 0;
+
+- new_len = len*size*2;
+- if (new_len < 0) {
++ if (len > (INT_MAX/2)/size) {
+ PyErr_SetString(PyExc_MemoryError,
+ "not enough memory for output buffer");
+ return 0;
+ }
+- str = PyString_FromStringAndSize(NULL, new_len);
++ str = PyString_FromStringAndSize(NULL, len*size*2);
+ if ( str == 0 )
+ return 0;
+ ncp = (signed char *)PyString_AsString(str);
+@@ -1555,7 +1539,7 @@ audioop_adpcm2lin(PyObject *self, PyObje
+ step = stepsizeTable[index];
+ bufferstep = 0;
+
+- for ( i=0; i < new_len; i += size ) {
++ for ( i=0; i < len*size*2; i += size ) {
+ /* Step 1 - get the delta value and compute next index */
+ if ( bufferstep ) {
+ delta = inputbuffer & 0xf;
diff --git a/python-2.6.2-CVE-2010-2089.patch b/python-2.6.2-CVE-2010-2089.patch
new file mode 100644
index 0000000..92efafd
--- /dev/null
+++ b/python-2.6.2-CVE-2010-2089.patch
@@ -0,0 +1,349 @@
+From ddc63ebe9b52c0ab4ba033301e70fac89f610704 Mon Sep 17 00:00:00 2001
+From: Victor Stinner <victor.stinner(a)haypocalc.com>
+Date: Sun, 10 Jan 2010 21:10:01 +0100
+Subject: [PATCH] audioop: check that length is a multiple the size
+
+Most functions of audioop takes as input a byte string (audio data) and a size
+argument (number of bytes of a sample). Functions don't check that the byte
+string length is a multiple of the size. It leads to read and write from/to
+uninitialised memory and might crash.
+
+Example on writing into uninitilized memory:
+
+ $ python -c "import audioop; audioop.reverse('X', 2)"
+ Fatal Python error: Inconsistent interned string state.
+ Abandon
+
+It allocates a string of 1 byte and write 2 bytes into this string => memory
+corruption.
+
+Attached patch creates audioop_check_size() and audioop_check_parameters()
+functions.
+---
+ Modules/audioop.c | 153 ++++++++++++++++++++++++----------------------------
+ 1 files changed, 71 insertions(+), 82 deletions(-)
+
+diff --git a/Modules/audioop.c b/Modules/audioop.c
+index 42daf9b..ebb992a 100644
+--- a/Modules/audioop.c
++++ b/Modules/audioop.c
+@@ -295,6 +295,29 @@ static int stepsizeTable[89] = {
+
+ static PyObject *AudioopError;
+
++static int
++audioop_check_size(int size)
++{
++ if ( size != 1 && size != 2 && size != 4 ) {
++ PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
++ return 0;
++ } else {
++ return 1;
++ }
++}
++
++static int
++audioop_check_parameters(int len, int size)
++{
++ if (!audioop_check_size(size))
++ return 0;
++ if ( len % size != 0 ) {
++ PyErr_SetString(AudioopError, "not a whole number of
frames");
++ return 0;
++ }
++ return 1;
++}
++
+ static PyObject *
+ audioop_getsample(PyObject *self, PyObject *args)
+ {
+@@ -304,10 +327,8 @@ audioop_getsample(PyObject *self, PyObject *args)
+
+ if ( !PyArg_ParseTuple(args, "s#ii:getsample", &cp, &len,
&size, &i) )
+ return 0;
+- if ( size != 1 && size != 2 && size != 4 ) {
+- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
+- return 0;
+- }
++ if (!audioop_check_parameters(len, size))
++ return NULL;
+ if ( i < 0 || i >= len/size ) {
+ PyErr_SetString(AudioopError, "Index out of range");
+ return 0;
+@@ -328,10 +349,8 @@ audioop_max(PyObject *self, PyObject *args)
+
+ if ( !PyArg_ParseTuple(args, "s#i:max", &cp, &len, &size)
)
+ return 0;
+- if ( size != 1 && size != 2 && size != 4 ) {
+- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
+- return 0;
+- }
++ if (!audioop_check_parameters(len, size))
++ return NULL;
+ for ( i=0; i<len; i+= size) {
+ if ( size == 1 ) val = (int)*CHARP(cp, i);
+ else if ( size == 2 ) val = (int)*SHORTP(cp, i);
+@@ -352,10 +371,8 @@ audioop_minmax(PyObject *self, PyObject *args)
+
+ if (!PyArg_ParseTuple(args, "s#i:minmax", &cp, &len,
&size))
+ return NULL;
+- if (size != 1 && size != 2 && size != 4) {
+- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
++ if (!audioop_check_parameters(len, size))
+ return NULL;
+- }
+ for (i = 0; i < len; i += size) {
+ if (size == 1) val = (int) *CHARP(cp, i);
+ else if (size == 2) val = (int) *SHORTP(cp, i);
+@@ -376,10 +393,8 @@ audioop_avg(PyObject *self, PyObject *args)
+
+ if ( !PyArg_ParseTuple(args, "s#i:avg", &cp, &len, &size)
)
+ return 0;
+- if ( size != 1 && size != 2 && size != 4 ) {
+- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
+- return 0;
+- }
++ if (!audioop_check_parameters(len, size))
++ return NULL;
+ for ( i=0; i<len; i+= size) {
+ if ( size == 1 ) val = (int)*CHARP(cp, i);
+ else if ( size == 2 ) val = (int)*SHORTP(cp, i);
+@@ -403,10 +418,8 @@ audioop_rms(PyObject *self, PyObject *args)
+
+ if ( !PyArg_ParseTuple(args, "s#i:rms", &cp, &len, &size)
)
+ return 0;
+- if ( size != 1 && size != 2 && size != 4 ) {
+- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
+- return 0;
+- }
++ if (!audioop_check_parameters(len, size))
++ return NULL;
+ for ( i=0; i<len; i+= size) {
+ if ( size == 1 ) val = (int)*CHARP(cp, i);
+ else if ( size == 2 ) val = (int)*SHORTP(cp, i);
+@@ -614,10 +627,8 @@ audioop_avgpp(PyObject *self, PyObject *args)
+
+ if ( !PyArg_ParseTuple(args, "s#i:avgpp", &cp, &len,
&size) )
+ return 0;
+- if ( size != 1 && size != 2 && size != 4 ) {
+- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
+- return 0;
+- }
++ if (!audioop_check_parameters(len, size))
++ return NULL;
+ /* Compute first delta value ahead. Also automatically makes us
+ ** skip the first extreme value
+ */
+@@ -671,10 +682,8 @@ audioop_maxpp(PyObject *self, PyObject *args)
+
+ if ( !PyArg_ParseTuple(args, "s#i:maxpp", &cp, &len,
&size) )
+ return 0;
+- if ( size != 1 && size != 2 && size != 4 ) {
+- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
+- return 0;
+- }
++ if (!audioop_check_parameters(len, size))
++ return NULL;
+ /* Compute first delta value ahead. Also automatically makes us
+ ** skip the first extreme value
+ */
+@@ -722,10 +731,8 @@ audioop_cross(PyObject *self, PyObject *args)
+
+ if ( !PyArg_ParseTuple(args, "s#i:cross", &cp, &len,
&size) )
+ return 0;
+- if ( size != 1 && size != 2 && size != 4 ) {
+- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
+- return 0;
+- }
++ if (!audioop_check_parameters(len, size))
++ return NULL;
+ ncross = -1;
+ prevval = 17; /* Anything <> 0,1 */
+ for ( i=0; i<len; i+= size) {
+@@ -750,6 +757,8 @@ audioop_mul(PyObject *self, PyObject *args)
+
+ if ( !PyArg_ParseTuple(args, "s#id:mul", &cp, &len, &size,
&factor ) )
+ return 0;
++ if (!audioop_check_parameters(len, size))
++ return NULL;
+
+ if ( size == 1 ) maxval = (double) 0x7f;
+ else if ( size == 2 ) maxval = (double) 0x7fff;
+@@ -792,6 +801,12 @@ audioop_tomono(PyObject *self, PyObject *args)
+ if ( !PyArg_ParseTuple(args, "s#idd:tomono",
+ &cp, &len, &size, &fac1, &fac2 ) )
+ return 0;
++ if (!audioop_check_parameters(len, size))
++ return NULL;
++ if ( ((len / size) & 1) != 0 ) {
++ PyErr_SetString(AudioopError, "not a whole number of
frames");
++ return NULL;
++ }
+
+ if ( size == 1 ) maxval = (double) 0x7f;
+ else if ( size == 2 ) maxval = (double) 0x7fff;
+@@ -837,6 +852,8 @@ audioop_tostereo(PyObject *self, PyObject *args)
+ if ( !PyArg_ParseTuple(args, "s#idd:tostereo",
+ &cp, &len, &size, &fac1, &fac2 ) )
+ return 0;
++ if (!audioop_check_parameters(len, size))
++ return NULL;
+
+ if ( size == 1 ) maxval = (double) 0x7f;
+ else if ( size == 2 ) maxval = (double) 0x7fff;
+@@ -896,7 +913,8 @@ audioop_add(PyObject *self, PyObject *args)
+ if ( !PyArg_ParseTuple(args, "s#s#i:add",
+ &cp1, &len1, &cp2, &len2, &size ) )
+ return 0;
+-
++ if (!audioop_check_parameters(len1, size))
++ return NULL;
+ if ( len1 != len2 ) {
+ PyErr_SetString(AudioopError, "Lengths should be the same");
+ return 0;
+@@ -950,11 +968,8 @@ audioop_bias(PyObject *self, PyObject *args)
+ if ( !PyArg_ParseTuple(args, "s#ii:bias",
+ &cp, &len, &size , &bias) )
+ return 0;
+-
+- if ( size != 1 && size != 2 && size != 4) {
+- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
+- return 0;
+- }
++ if (!audioop_check_parameters(len, size))
++ return NULL;
+
+ rv = PyString_FromStringAndSize(NULL, len);
+ if ( rv == 0 )
+@@ -986,12 +1001,9 @@ audioop_reverse(PyObject *self, PyObject *args)
+ if ( !PyArg_ParseTuple(args, "s#i:reverse",
+ &cp, &len, &size) )
+ return 0;
++ if (!audioop_check_parameters(len, size))
++ return NULL;
+
+- if ( size != 1 && size != 2 && size != 4 ) {
+- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
+- return 0;
+- }
+-
+ rv = PyString_FromStringAndSize(NULL, len);
+ if ( rv == 0 )
+ return 0;
+@@ -1023,12 +1035,10 @@ audioop_lin2lin(PyObject *self, PyObject *args)
+ if ( !PyArg_ParseTuple(args, "s#ii:lin2lin",
+ &cp, &len, &size, &size2) )
+ return 0;
+-
+- if ( (size != 1 && size != 2 && size != 4) ||
+- (size2 != 1 && size2 != 2 && size2 != 4)) {
+- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
+- return 0;
+- }
++ if (!audioop_check_parameters(len, size))
++ return NULL;
++ if (!audioop_check_size(size2))
++ return NULL;
+
+ new_len = (len/size)*size2;
+ if (new_len < 0) {
+@@ -1080,10 +1090,8 @@ audioop_ratecv(PyObject *self, PyObject *args)
+ &nchannels, &inrate, &outrate, &state,
+ &weightA, &weightB))
+ return NULL;
+- if (size != 1 && size != 2 && size != 4) {
+- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
++ if (!audioop_check_size(size))
+ return NULL;
+- }
+ if (nchannels < 1) {
+ PyErr_SetString(AudioopError, "# of channels should be >=
1");
+ return NULL;
+@@ -1269,11 +1277,8 @@ audioop_lin2ulaw(PyObject *self, PyObject *args)
+ if ( !PyArg_ParseTuple(args, "s#i:lin2ulaw",
+ &cp, &len, &size) )
+ return 0 ;
+-
+- if ( size != 1 && size != 2 && size != 4) {
+- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
+- return 0;
+- }
++ if (!audioop_check_parameters(len, size))
++ return NULL;
+
+ rv = PyString_FromStringAndSize(NULL, len/size);
+ if ( rv == 0 )
+@@ -1303,11 +1308,8 @@ audioop_ulaw2lin(PyObject *self, PyObject *args)
+ if ( !PyArg_ParseTuple(args, "s#i:ulaw2lin",
+ &cp, &len, &size) )
+ return 0;
+-
+- if ( size != 1 && size != 2 && size != 4) {
+- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
+- return 0;
+- }
++ if (!audioop_check_size(size))
++ return NULL;
+
+ new_len = len*size;
+ if (new_len < 0) {
+@@ -1343,11 +1345,8 @@ audioop_lin2alaw(PyObject *self, PyObject *args)
+ if ( !PyArg_ParseTuple(args, "s#i:lin2alaw",
+ &cp, &len, &size) )
+ return 0;
+-
+- if ( size != 1 && size != 2 && size != 4) {
+- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
+- return 0;
+- }
++ if (!audioop_check_parameters(len, size))
++ return NULL;
+
+ rv = PyString_FromStringAndSize(NULL, len/size);
+ if ( rv == 0 )
+@@ -1377,11 +1376,8 @@ audioop_alaw2lin(PyObject *self, PyObject *args)
+ if ( !PyArg_ParseTuple(args, "s#i:alaw2lin",
+ &cp, &len, &size) )
+ return 0;
+-
+- if ( size != 1 && size != 2 && size != 4) {
+- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
+- return 0;
+- }
++ if (!audioop_check_size(size))
++ return NULL;
+
+ new_len = len*size;
+ if (new_len < 0) {
+@@ -1418,12 +1414,8 @@ audioop_lin2adpcm(PyObject *self, PyObject *args)
+ if ( !PyArg_ParseTuple(args, "s#iO:lin2adpcm",
+ &cp, &len, &size, &state) )
+ return 0;
+-
+-
+- if ( size != 1 && size != 2 && size != 4) {
+- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
+- return 0;
+- }
++ if (!audioop_check_parameters(len, size))
++ return NULL;
+
+ str = PyString_FromStringAndSize(NULL, len/(size*2));
+ if ( str == 0 )
+@@ -1526,11 +1518,8 @@ audioop_adpcm2lin(PyObject *self, PyObject *args)
+ if ( !PyArg_ParseTuple(args, "s#iO:adpcm2lin",
+ &cp, &len, &size, &state) )
+ return 0;
+-
+- if ( size != 1 && size != 2 && size != 4) {
+- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4");
+- return 0;
+- }
++ if (!audioop_check_size(size))
++ return NULL;
+
+ /* Decode state, should have (value, step) */
+ if ( state == Py_None ) {
+--
+1.6.0.4
+
diff --git a/python.spec b/python.spec
index cbd42a9..61681b3 100644
--- a/python.spec
+++ b/python.spec
@@ -61,7 +61,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.6.5
-Release: 12%{?dist}
+Release: 13%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -381,6 +381,20 @@ Patch114: python-2.6.5-statvfs-f_flag-constants.patch
# (rhbz:461419; patch sent upstream as
http://bugs.python.org/issue7425 )
Patch115: make-pydoc-more-robust-001.patch
+# CVE-2010-1634: fix various integer overflow checks in the audioop module
+# This is the difference from r81031 to r81080 (i.e r81046 and r81080), but
+# backported to the old layout before the whitespeace cleanup to
+# release26-maint (in r81031):
+Patch116: python-2.6.2-CVE-2010-1634.patch
+
+# CVE-2010-2089: verify sizes/lengths within audioop module:
+Patch117: python-2.6.2-CVE-2010-2089.patch
+
+# CVE-2008-5983: the new PySys_SetArgvEx entry point from r81399 (backported to
+# the old layout before the whitespeace cleanup of release26-maint in r81031):
+Patch118: python-2.6.2-CVE-2008-5983.patch
+
+
%if %{main_python}
Obsoletes: Distutils
Provides: Distutils
@@ -614,15 +628,19 @@ rm -r Modules/zlib || exit 1
%patch115 -p0
+%patch116 -p1 -b .CVE-2010-1634
+%patch117 -p1 -b .CVE-2010-2089
+%patch118 -p1 -b .CVE-2008-5983
+
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
%build
topdir=$(pwd)
-export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC"
-export CXXFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC"
+export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv"
+export CXXFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv"
export CPPFLAGS="$(pkg-config --cflags-only-I libffi)"
-export OPT="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC"
+export OPT="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv"
export LINKCC="gcc"
if pkg-config openssl ; then
export CFLAGS="$CFLAGS $(pkg-config --cflags openssl)"
@@ -1312,6 +1330,13 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Fri Jun 4 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-13
+- ensure that the compiler is invoked with "-fwrapv" (rhbz#594819)
+- CVE-2010-1634: fix various integer overflow checks in the audioop
+module (patch 113)
+- CVE-2010-2089: further checks within the audioop module (patch 114)
+- CVE-2008-5983: the new PySys_SetArgvEx entry point from r81399 (patch 115)
+
* Thu May 27 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-12
- make "pydoc -k" more robust in the face of broken modules (rhbz:461419,
patch115)
commit 96cf82c82fcb8375837500baa209bc2a20d3cc10
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Thu May 27 15:37:54 2010 +0000
- make "pydoc -k" more robust in the face of broken modules (rhbz:461419,
patch115)
diff --git a/make-pydoc-more-robust-001.patch b/make-pydoc-more-robust-001.patch
new file mode 100644
index 0000000..ed2de4e
--- /dev/null
+++ b/make-pydoc-more-robust-001.patch
@@ -0,0 +1,20 @@
+Index: Lib/pydoc.py
+===================================================================
+--- Lib/pydoc.py (revision 76636)
++++ Lib/pydoc.py (working copy)
+@@ -1961,10 +1961,14 @@
+ if modname[-9:] == '.__init__':
+ modname = modname[:-9] + ' (package)'
+ print modname, desc and '- ' + desc
++ def onerror(modname):
++ # Ignore non-ImportError exceptions raised whilst trying to
++ # import modules
++ pass
+ try: import warnings
+ except ImportError: pass
+ else: warnings.filterwarnings('ignore') # ignore problems during import
+- ModuleScanner().run(callback, key)
++ ModuleScanner().run(callback, key, onerror=onerror)
+
+ # --------------------------------------------------- web browser interface
+
diff --git a/python.spec b/python.spec
index f0baffe..cbd42a9 100644
--- a/python.spec
+++ b/python.spec
@@ -61,7 +61,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.6.5
-Release: 11%{?dist}
+Release: 12%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -377,6 +377,10 @@ Patch113: python-2.6.5-more-configuration-flags.patch
# (rhbz:553020); partially upstream as
http://bugs.python.org/issue7647
Patch114: python-2.6.5-statvfs-f_flag-constants.patch
+# Make "pydoc -k" more robust in the face of broken modules
+# (rhbz:461419; patch sent upstream as
http://bugs.python.org/issue7425 )
+Patch115: make-pydoc-more-robust-001.patch
+
%if %{main_python}
Obsoletes: Distutils
Provides: Distutils
@@ -608,6 +612,8 @@ rm -r Modules/zlib || exit 1
%patch114 -p1 -b .statvfs-f-flag-constants
+%patch115 -p0
+
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -1306,6 +1312,9 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Thu May 27 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-12
+- make "pydoc -k" more robust in the face of broken modules (rhbz:461419,
patch115)
+
* Wed May 26 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-11
- add flags for statvfs.f_flag to the constant list in posixmodule (i.e. "os")
(patch 114)
commit 1b84fe311895e8d1323a9f953fd123ab4730ea16
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Wed May 26 10:28:54 2010 +0000
- add flags for statvfs.f_flag to the constant list in posixmodule (i.e.
"os") (patch 114)
diff --git a/python-2.6.5-statvfs-f_flag-constants.patch
b/python-2.6.5-statvfs-f_flag-constants.patch
new file mode 100644
index 0000000..4b3390d
--- /dev/null
+++ b/python-2.6.5-statvfs-f_flag-constants.patch
@@ -0,0 +1,62 @@
+From 21fda4c78000d78cb1824fdf0373031d07f5325a Mon Sep 17 00:00:00 2001
+From: Peter Jones <pjones(a)redhat.com>
+Date: Wed, 6 Jan 2010 15:22:38 -0500
+Subject: [PATCH] Add flags for statvfs.f_flag to constant list.
+
+You really need these to figure out what statvfs is trying to say to
+you, so add them here.
+---
+ Modules/posixmodule.c | 37 +++++++++++++++++++++++++++++++++++++
+ 1 files changed, 37 insertions(+), 0 deletions(-)
+
+diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
+index ebdbc8d..d79013b 100644
+--- a/Modules/posixmodule.c
++++ b/Modules/posixmodule.c
+@@ -8990,6 +8990,43 @@ all_ins(PyObject *d)
+ #endif
+ #endif
+
++ /* These came from statvfs.h */
++#ifdef ST_RDONLY
++ if (ins(d, "ST_RDONLY", (long)ST_RDONLY)) return -1;
++#endif /* ST_RDONLY */
++#ifdef ST_NOSUID
++ if (ins(d, "ST_NOSUID", (long)ST_NOSUID)) return -1;
++#endif /* ST_NOSUID */
++
++ /* GNU extensions */
++#ifdef ST_NODEV
++ if (ins(d, "ST_NODEV", (long)ST_NODEV)) return -1;
++#endif /* ST_NODEV */
++#ifdef ST_NOEXEC
++ if (ins(d, "ST_NOEXEC", (long)ST_NOEXEC)) return -1;
++#endif /* ST_NOEXEC */
++#ifdef ST_SYNCHRONOUS
++ if (ins(d, "ST_SYNCHRONOUS", (long)ST_SYNCHRONOUS)) return -1;
++#endif /* ST_SYNCHRONOUS */
++#ifdef ST_MANDLOCK
++ if (ins(d, "ST_MANDLOCK", (long)ST_MANDLOCK)) return -1;
++#endif /* ST_MANDLOCK */
++#ifdef ST_WRITE
++ if (ins(d, "ST_WRITE", (long)ST_WRITE)) return -1;
++#endif /* ST_WRITE */
++#ifdef ST_APPEND
++ if (ins(d, "ST_APPEND", (long)ST_APPEND)) return -1;
++#endif /* ST_APPEND */
++#ifdef ST_NOATIME
++ if (ins(d, "ST_NOATIME", (long)ST_NOATIME)) return -1;
++#endif /* ST_NOATIME */
++#ifdef ST_NODIRATIME
++ if (ins(d, "ST_NODIRATIME", (long)ST_NODIRATIME)) return -1;
++#endif /* ST_NODIRATIME */
++#ifdef ST_RELATIME
++ if (ins(d, "ST_RELATIME", (long)ST_RELATIME)) return -1;
++#endif /* ST_RELATIME */
++
+ #if defined(PYOS_OS2)
+ if (insertvalues(d)) return -1;
+ #endif
+--
+1.6.6
+
diff --git a/python.spec b/python.spec
index b13e9a6..f0baffe 100644
--- a/python.spec
+++ b/python.spec
@@ -61,7 +61,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.6.5
-Release: 10%{?dist}
+Release: 11%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -373,6 +373,10 @@ Patch112: python-2.6.5-debug-build.patch
# extension modules will reliably use them
Patch113: python-2.6.5-more-configuration-flags.patch
+# Add flags for statvfs.f_flag to the constant list in posixmodule (i.e. "os")
+# (rhbz:553020); partially upstream as
http://bugs.python.org/issue7647
+Patch114: python-2.6.5-statvfs-f_flag-constants.patch
+
%if %{main_python}
Obsoletes: Distutils
Provides: Distutils
@@ -602,6 +606,8 @@ rm -r Modules/zlib || exit 1
%patch113 -p1 -b .more-configuration-flags
+%patch114 -p1 -b .statvfs-f-flag-constants
+
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -1300,6 +1306,10 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Wed May 26 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-11
+- add flags for statvfs.f_flag to the constant list in posixmodule (i.e. "os")
+(patch 114)
+
* Tue May 25 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-10
- add configure-time support for COUNT_ALLOCS and CALL_PROFILE debug options
(patch 113); enable them and the WITH_TSC option within the debug build
commit ab11e4c10f6fef4e2e993ef446953df0f0dbb840
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Tue May 25 16:13:29 2010 +0000
- add configure-time support for COUNT_ALLOCS and CALL_PROFILE debug
options (patch 113); enable them and the WITH_TSC option within the
debug build
diff --git a/python-2.6.5-more-configuration-flags.patch
b/python-2.6.5-more-configuration-flags.patch
new file mode 100644
index 0000000..9ee3180
--- /dev/null
+++ b/python-2.6.5-more-configuration-flags.patch
@@ -0,0 +1,50 @@
+diff -up Python-2.6.5/configure.in.more-configuration-flags Python-2.6.5/configure.in
+--- Python-2.6.5/configure.in.more-configuration-flags 2010-05-24 18:51:25.410111792
-0400
++++ Python-2.6.5/configure.in 2010-05-24 18:59:23.954986388 -0400
+@@ -2515,6 +2515,30 @@ else AC_MSG_RESULT(no)
+ fi],
+ [AC_MSG_RESULT(no)])
+
++AC_MSG_CHECKING(for --with-count-allocs)
++AC_ARG_WITH(count-allocs,
++[ --with(out)count-allocs enable/disable per-type instance accounting], [
++if test "$withval" != no
++then
++ AC_DEFINE(COUNT_ALLOCS, 1,
++ [Define to keep records of the number of instances of each type])
++ AC_MSG_RESULT(yes)
++else AC_MSG_RESULT(no)
++fi],
++[AC_MSG_RESULT(no)])
++
++AC_MSG_CHECKING(for --with-call-profile)
++AC_ARG_WITH(call-profile,
++[ --with(out)-call-profile enable/disable statistics on function call invocation], [
++if test "$withval" != no
++then
++ AC_DEFINE(CALL_PROFILE, 1,
++ [Define to keep records on function call invocation])
++ AC_MSG_RESULT(yes)
++else AC_MSG_RESULT(no)
++fi],
++[AC_MSG_RESULT(no)])
++
+ # Check for Python-specific malloc support
+ AC_MSG_CHECKING(for --with-pymalloc)
+ AC_ARG_WITH(pymalloc,
+diff -up Python-2.6.5/pyconfig.h.in.more-configuration-flags Python-2.6.5/pyconfig.h.in
+--- Python-2.6.5/pyconfig.h.in.more-configuration-flags 2010-05-24 18:51:45.677988086
-0400
++++ Python-2.6.5/pyconfig.h.in 2010-05-24 19:00:44.163987730 -0400
+@@ -1019,6 +1019,12 @@
+ /* Define to profile with the Pentium timestamp counter */
+ #undef WITH_TSC
+
++/* Define to keep records of the number of instances of each type */
++#undef COUNT_ALLOCS
++
++/* Define to keep records on function call invocation */
++#undef CALL_PROFILE
++
+ /* Define if you want pymalloc to be disabled when running under valgrind */
+ #undef WITH_VALGRIND
+
diff --git a/python.spec b/python.spec
index 34ca97e..b13e9a6 100644
--- a/python.spec
+++ b/python.spec
@@ -61,7 +61,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.6.5
-Release: 9%{?dist}
+Release: 10%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -366,6 +366,13 @@ Patch111: python-2.6.4-no-static-lib.patch
Patch112: python-2.6.5-debug-build.patch
+
+# Add configure-time support for the COUNT_ALLOCS and CALL_PROFILE options
+# described at
http://svn.python.org/projects/python/trunk/Misc/SpecialBuilds.txt
+# so that if they are enabled, they will be in that build's pyconfig.h, so that
+# extension modules will reliably use them
+Patch113: python-2.6.5-more-configuration-flags.patch
+
%if %{main_python}
Obsoletes: Distutils
Provides: Distutils
@@ -593,6 +600,8 @@ rm -r Modules/zlib || exit 1
%patch112 -p1 -b .debug-build
+%patch113 -p1 -b .more-configuration-flags
+
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -687,7 +696,7 @@ LD_LIBRARY_PATH="$topdir/$ConfDir"
PATH=$PATH:$topdir/$ConfDir make -s OPT="$CFL
BuildPython debug \
python-debug \
python%{pybasever}-debug \
- "--with-pydebug" \
+ "--with-pydebug --with-tsc --with-count-allocs --with-call-profile" \
false
BuildPython optimized \
@@ -1291,6 +1300,10 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Tue May 25 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-10
+- add configure-time support for COUNT_ALLOCS and CALL_PROFILE debug options
+(patch 113); enable them and the WITH_TSC option within the debug build
+
* Tue May 18 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-9
- build and install two different configurations of Python: debug and standard,
packaging the debug build in a new "python-debug" subpackage (patch 112)
commit f020abd35954981b383884105dad425ba9c6637a
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Thu May 20 19:16:46 2010 +0000
- build and install two different configurations of Python: debug and
standard, packaging the debug build in a new "python-debug" subpackage
(patch 112)
diff --git a/python-2.6.5-debug-build.patch b/python-2.6.5-debug-build.patch
new file mode 100644
index 0000000..6310e3d
--- /dev/null
+++ b/python-2.6.5-debug-build.patch
@@ -0,0 +1,240 @@
+diff -up Python-2.6.5/configure.in.debug-build Python-2.6.5/configure.in
+--- Python-2.6.5/configure.in.debug-build 2010-05-19 17:09:31.975902056 -0400
++++ Python-2.6.5/configure.in 2010-05-19 17:09:31.986901987 -0400
+@@ -620,7 +620,7 @@ AC_SUBST(LIBRARY)
+ AC_MSG_CHECKING(LIBRARY)
+ if test -z "$LIBRARY"
+ then
+- LIBRARY='libpython$(VERSION).a'
++ LIBRARY='libpython$(VERSION)$(DEBUG_EXT).a'
+ fi
+ AC_MSG_RESULT($LIBRARY)
+
+@@ -748,8 +748,8 @@ if test $enable_shared = "yes"; then
+ INSTSONAME="$LDLIBRARY".$SOVERSION
+ ;;
+ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*)
+- LDLIBRARY='libpython$(VERSION).so'
+- BLDLIBRARY='-L. -lpython$(VERSION)'
++ LDLIBRARY='libpython$(VERSION)$(DEBUG_EXT).so'
++ BLDLIBRARY='-L. -lpython$(VERSION)$(DEBUG_EXT)'
+ RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
+ case $ac_sys_system in
+ FreeBSD*)
+@@ -847,6 +847,14 @@ else AC_MSG_RESULT(no); Py_DEBUG='false'
+ fi],
+ [AC_MSG_RESULT(no)])
+
++if test "$Py_DEBUG" = 'true'
++then
++ DEBUG_EXT=_d
++ DEBUG_SUFFIX=-debug
++fi
++AC_SUBST(DEBUG_EXT)
++AC_SUBST(DEBUG_SUFFIX)
++
+ # XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
+ # merged with this chunk of code?
+
+diff -up Python-2.6.5/Lib/distutils/command/build_ext.py.debug-build
Python-2.6.5/Lib/distutils/command/build_ext.py
+--- Python-2.6.5/Lib/distutils/command/build_ext.py.debug-build 2009-10-13
17:17:34.000000000 -0400
++++ Python-2.6.5/Lib/distutils/command/build_ext.py 2010-05-19 18:17:14.678196678 -0400
+@@ -677,7 +677,10 @@ class build_ext (Command):
+ so_ext = get_config_var('SO')
+ if os.name == 'nt' and self.debug:
+ return apply(os.path.join, ext_path) + '_d' + so_ext
+- return os.path.join(*ext_path) + so_ext
++
++ # Similarly, extensions in debug mode are named 'module_d.so', to
++ # avoid adding the _d to the SO config variable:
++ return os.path.join(*ext_path) + (sys.pydebug and "_d" or
"") + so_ext
+
+ def get_export_symbols (self, ext):
+ """Return the list of symbols that a shared extension has to
+@@ -760,6 +763,8 @@ class build_ext (Command):
+ template = "python%d.%d"
+ pythonlib = (template %
+ (sys.hexversion >> 24, (sys.hexversion >> 16)
& 0xff))
++ if sys.pydebug:
++ pythonlib += '_d'
+ return ext.libraries + [pythonlib]
+ else:
+ return ext.libraries
+diff -up Python-2.6.5/Lib/distutils/sysconfig.py.debug-build
Python-2.6.5/Lib/distutils/sysconfig.py
+--- Python-2.6.5/Lib/distutils/sysconfig.py.debug-build 2010-05-19 17:09:31.926155519
-0400
++++ Python-2.6.5/Lib/distutils/sysconfig.py 2010-05-19 17:09:31.987902863 -0400
+@@ -81,7 +81,8 @@ def get_python_inc(plat_specific=0, pref
+ if not os.path.exists(inc_dir):
+ inc_dir = os.path.join(os.path.dirname(base), "Include")
+ return inc_dir
+- return os.path.join(prefix, "include", "python" +
get_python_version())
++ return os.path.join(prefix, "include",
++ "python" + get_python_version() + (sys.pydebug and
'-debug' or ''))
+ elif os.name == "nt":
+ return os.path.join(prefix, "include")
+ elif os.name == "mac":
+@@ -224,7 +225,7 @@ def get_makefile_filename():
+ if python_build:
+ return os.path.join(os.path.dirname(sys.executable), "Makefile")
+ lib_dir = get_python_lib(plat_specific=1, standard_lib=1)
+- return os.path.join(lib_dir, "config", "Makefile")
++ return os.path.join(lib_dir, "config" + (sys.pydebug and
"-debug" or ""), "Makefile")
+
+
+ def parse_config_h(fp, g=None):
+diff -up Python-2.6.5/Makefile.pre.in.debug-build Python-2.6.5/Makefile.pre.in
+--- Python-2.6.5/Makefile.pre.in.debug-build 2010-05-19 17:09:31.984901988 -0400
++++ Python-2.6.5/Makefile.pre.in 2010-05-19 17:09:31.987902863 -0400
+@@ -96,8 +96,8 @@ SCRIPTDIR= $(prefix)/lib64
+ # Detailed destination directories
+ BINLIBDEST= $(LIBDIR)/python$(VERSION)
+ LIBDEST= $(SCRIPTDIR)/python$(VERSION)
+-INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
+-CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)
++INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)$(DEBUG_SUFFIX)
++CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)$(DEBUG_SUFFIX)
+ LIBP= $(LIBDIR)/python$(VERSION)
+
+ # Symbols used for using shared libraries
+@@ -110,6 +110,12 @@ DESTSHARED= $(BINLIBDEST)/lib-dynload
+ EXE= @EXEEXT@
+ BUILDEXE= @BUILDEXEEXT@
+
++# DEBUG_EXT is used by ELF files (names and SONAMEs); it will be "_d" for a
debug build
++# DEBUG_SUFFIX is used by filesystem paths; it will be "-debug" for a debug
build
++# Both will be empty in an optimized build
++DEBUG_EXT= @DEBUG_EXT@
++DEBUG_SUFFIX= @DEBUG_SUFFIX@
++
+ # Short name and location for Mac OS X Python framework
+ UNIVERSALSDK=@UNIVERSALSDK@
+ PYTHONFRAMEWORK= @PYTHONFRAMEWORK@
+@@ -173,8 +179,8 @@ LIBOBJDIR= Python/
+ LIBOBJS= @LIBOBJS@
+ UNICODE_OBJS= @UNICODE_OBJS@
+
+-PYTHON= python$(EXE)
+-BUILDPYTHON= python$(BUILDEXE)
++PYTHON= python$(DEBUG_SUFFIX)$(EXE)
++BUILDPYTHON= python$(DEBUG_SUFFIX)$(BUILDEXE)
+
+ # The task to run while instrument when building the profile-opt target
+ PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck
+@@ -399,7 +405,7 @@ sharedmods: $(BUILDPYTHON)
+ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)'
./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
+ esac
+
+-libpython$(VERSION).so: $(LIBRARY_OBJS)
++libpython$(VERSION)$(DEBUG_EXT).so: $(LIBRARY_OBJS)
+ if test $(INSTSONAME) != $(LDLIBRARY); then \
+ $(LDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS)
$(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
+ $(LN) -f $(INSTSONAME) $@; \
+@@ -761,9 +767,9 @@ bininstall: altbininstall
+ then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON); \
+ else true; \
+ fi
+- (cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON))
+- -rm -f $(DESTDIR)$(BINDIR)/python-config
+- (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python-config)
++ (cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(DEBUG_SUFFIX)$(EXE) $(PYTHON))
++ -rm -f $(DESTDIR)$(BINDIR)/python$(DEBUG_SUFFIX)-config
++ (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(DEBUG_SUFFIX)-config
python$(DEBUG_SUFFIX)-config)
+
+ # Install the interpreter with $(VERSION) affixed
+ # This goes into $(exec_prefix)
+@@ -776,7 +782,7 @@ altbininstall: $(BUILDPYTHON)
+ else true; \
+ fi; \
+ done
+- $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE)
++ $(INSTALL_PROGRAM) $(BUILDPYTHON)
$(DESTDIR)$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)$(EXE)
+ if test -f $(LDLIBRARY); then \
+ if test -n "$(DLLLIBRARY)" ; then \
+ $(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
+@@ -935,8 +941,8 @@ inclinstall:
+ $(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
+
+ # Install the library and miscellaneous stuff needed for extending/embedding
+-# This goes into $(exec_prefix)
+-LIBPL= $(LIBP)/config
++# This goes into $(exec_prefix)$(DEBUG_SUFFIX)
++LIBPL= $(LIBP)/config$(DEBUG_SUFFIX)
+ libainstall: all
+ @for i in $(LIBDIR) $(LIBP) $(LIBPL); \
+ do \
+@@ -957,9 +963,9 @@ libainstall: all
+ $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
+ # 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
+- $(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(VERSION)-config
+- rm python-config
++ sed -e "s,@EXENAME@,$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)$(EXE)," <
$(srcdir)/Misc/python-config.in >python$(DEBUG_SUFFIX)-config
++ $(INSTALL_SCRIPT) python$(DEBUG_SUFFIX)-config
$(DESTDIR)$(BINDIR)/python$(VERSION)$(DEBUG_SUFFIX)-config
++ rm python$(DEBUG_SUFFIX)-config
+ @if [ -s Modules/python.exp -a \
+ "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ];
then \
+ echo; echo "Installing support files for building shared extension modules on
AIX:"; \
+diff -up Python-2.6.5/Misc/python-config.in.debug-build
Python-2.6.5/Misc/python-config.in
+--- Python-2.6.5/Misc/python-config.in.debug-build 2007-03-31 14:56:11.000000000 -0400
++++ Python-2.6.5/Misc/python-config.in 2010-05-19 17:09:31.987902863 -0400
+@@ -44,7 +44,7 @@ elif opt in ('--includes', '--cflags'):
+
+ 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
""))
+ # add the prefix/lib/pythonX.Y/config dir, but only if there is no
+ # shared library in prefix/lib/.
+ if opt == '--ldflags' and not getvar('Py_ENABLE_SHARED'):
+diff -up Python-2.6.5/Modules/makesetup.debug-build Python-2.6.5/Modules/makesetup
+--- Python-2.6.5/Modules/makesetup.debug-build 2007-09-05 07:47:34.000000000 -0400
++++ Python-2.6.5/Modules/makesetup 2010-05-19 17:09:31.987902863 -0400
+@@ -233,7 +233,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
+ *$mod.o*) base=$mod;;
+ *) base=${mod}module;;
+ esac
+- file="$srcdir/$base\$(SO)"
++ file="$srcdir/$base\$(DEBUG_EXT)\$(SO)"
+ case $doconfig in
+ no) SHAREDMODS="$SHAREDMODS $file";;
+ esac
+diff -up Python-2.6.5/Python/dynload_shlib.c.debug-build
Python-2.6.5/Python/dynload_shlib.c
+--- Python-2.6.5/Python/dynload_shlib.c.debug-build 2006-01-03 20:30:17.000000000 -0500
++++ Python-2.6.5/Python/dynload_shlib.c 2010-05-19 17:09:31.988902536 -0400
+@@ -46,11 +46,16 @@ const struct filedescr _PyImport_DynLoad
+ {"module.exe", "rb", C_EXTENSION},
+ {"MODULE.EXE", "rb", C_EXTENSION},
+ #else
++#ifdef Py_DEBUG
++ {"_d.so", "rb", C_EXTENSION},
++ {"module_d.so", "rb", C_EXTENSION},
++#else
+ {".so", "rb", C_EXTENSION},
+ {"module.so", "rb", C_EXTENSION},
+-#endif
+-#endif
+-#endif
++#endif /* Py_DEBUG */
++#endif /* __VMS */
++#endif /* defined(PYOS_OS2) && defined(PYCC_GCC) */
++#endif /* __CYGWIN__ */
+ {0, 0}
+ };
+
+diff -up Python-2.6.5/Python/sysmodule.c.debug-build Python-2.6.5/Python/sysmodule.c
+--- Python-2.6.5/Python/sysmodule.c.debug-build 2010-03-03 07:31:33.000000000 -0500
++++ Python-2.6.5/Python/sysmodule.c 2010-05-19 17:09:31.988902536 -0400
+@@ -1436,6 +1436,12 @@ _PySys_Init(void)
+ FlagsType.tp_init = NULL;
+ FlagsType.tp_new = NULL;
+
++#ifdef Py_DEBUG
++ PyDict_SetItemString(sysdict, "pydebug", Py_True);
++#else
++ PyDict_SetItemString(sysdict, "pydebug", Py_False);
++#endif
++
+ #undef SET_SYS_FROM_STRING
+ if (PyErr_Occurred())
+ return NULL;
diff --git a/python.spec b/python.spec
index 8fb90ea..34ca97e 100644
--- a/python.spec
+++ b/python.spec
@@ -30,7 +30,8 @@
# (if these get out of sync, the payload of the libs subpackage will fail
# and halt the build)
%global py_SOVERSION 1.0
-%global py_INSTSONAME libpython%{pybasever}.so.%{py_SOVERSION}
+%global py_INSTSONAME_optimized libpython%{pybasever}.so.%{py_SOVERSION}
+%global py_INSTSONAME_debug libpython%{pybasever}_d.so.%{py_SOVERSION}
%global with_gdb_hooks 1
@@ -60,7 +61,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.6.5
-Release: 8%{?dist}
+Release: 9%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -304,6 +305,66 @@ Patch110: python-2.6-ctypes-noexecmem.patch
# a libpythonMAJOR.MINOR.a (bug 550692):
Patch111: python-2.6.4-no-static-lib.patch
+# Patch to support building both optimized vs debug stacks DSO ABIs, sharing
+# the same .py and .pyc files, using "_d.so" to signify a debug build of an
+# extension module.
+#
+# Based on Debian's patch for the same,
+#
http://patch-tracker.debian.org/patch/series/view/python2.6/2.6.5-2/debug...
+#
+# (which was itself based on the upstream Windows build), but with some
+# changes:
+#
+# * Debian's patch to dynload_shlib.c looks for module_d.so, then module.so,
+# but this can potentially find a module built against the wrong DSO ABI. We
+# instead search for just module_d.so in a debug build
+#
+# * We remove this change from configure.in's build of the Makefile:
+# SO=$DEBUG_EXT.so
+# so that sysconfig.py:customize_compiler stays with shared_lib_extension='.so'
+# on debug builds, so that UnixCCompiler.find_library_file can find system
+# libraries (otherwise "make sharedlibs" fails to find system libraries,
+# erroneously looking e.g. for "libffi_d.so" rather than
"libffi.so")
+#
+# * We change Lib/distutils/command/build_ext.py:build_ext.get_ext_filename
+# to add the _d there, when building an extension. This way, "make
sharedlibs"
+# can build ctypes, by finding the sysmtem libffi.so (rather than failing to
+# find "libffi_d.so"), and builds the module as _ctypes_d.so
+#
+# * Similarly, update build_ext:get_libraries handling of Py_ENABLE_SHARED by
+# appending "_d" to the python library's name for the debug configuration
+#
+# * We modify Modules/makesetup to add the "_d" to the generated Makefile
+# rules for the various Modules/*.so targets
+#
+# This may introduce issues when building an extension that links directly
+# against another extension (e.g. users of NumPy?), but seems more robust when
+# searching for external libraries
+#
+# * We don't change Lib/distutils/command/build.py: build.build_purelib to
+# embed plat_specifier, leaving it as is, as pure python builds should be
+# unaffected by these differences (we'll be sharing the .py and .pyc files)
+#
+# * We introduce DEBUG_SUFFIX as well as DEBUG_EXT:
+# - DEBUG_EXT is used by ELF files (names and SONAMEs); it will be "_d"
for
+# a debug build
+# - DEBUG_SUFFIX is used by filesystem paths; it will be "-debug" for a
+# debug build
+#
+# Both will be empty in an optimized build. "_d" contains characters that
+# are valid ELF metadata, but this leads to various ugly filesystem paths (such
+# as the include path), and DEBUG_SUFFIX allows these paths to have more natural
+# names. Changing this requires changes elsewhere in the distutils code.
+#
+# * We add DEBUG_SUFFIX to PYTHON in the Makefile, so that the two
+# configurations build parallel-installable binaries with different names
+# ("python-debug" vs "python").
+#
+# * Similarly, we add DEBUG_SUFFIX within python-config and
+# python$(VERSION)-config, so that the two configuration get different paths
+# for these.
+
+Patch112: python-2.6.5-debug-build.patch
%if %{main_python}
Obsoletes: Distutils
@@ -440,6 +501,37 @@ never used in production.
You might want to install the python-test package if you're developing python
code that uses more than just unittest and/or test_support.py.
+%package debug
+Summary: Debug version of the Python runtime
+Group: Applications/System
+
+# The debug build is an all-in-one package version of the regular build, and
+# shares the same .py/.pyc files and directories as the regular build. Hence
+# we depend on all of the subpackages of the regular build:
+Requires: %{name}%{?_isa} = %{version}-%{release}
+Requires: %{name}-libs%{?_isa} = %{version}-%{release}
+Requires: %{name}-devel%{?_isa} = %{version}-%{release}
+Requires: %{name}-test%{?_isa} = %{version}-%{release}
+Requires: tkinter%{?_isa} = %{version}-%{release}
+Requires: %{name}-tools%{?_isa} = %{version}-%{release}
+
+%description debug
+python-debug provides a version of the Python runtime with numerous debugging
+features enabled, aimed at advanced Python users, such as developers of Python
+extension modules.
+
+This version uses more memory and will be slower than the regular Python build,
+but is useful for tracking down reference-counting issues, and other bugs.
+
+The bytecodes are unchanged, so that .pyc files are compatible between the two
+version of Python, but the debugging features mean that C/C++ extension modules
+are ABI-incompatible with those built for the standard runtime.
+
+It shares installation directories with the standard Python runtime, so that
+.py and .pyc files can be shared. All compiled extension modules gain a "_d"
+suffix ("foo_d.so" rather than "foo.so") so that each Python
implementation can
+load its own extensions.
+
%prep
%setup -q -n Python-%{version}
@@ -499,6 +591,8 @@ rm -r Modules/zlib || exit 1
%patch111 -p1 -b .no-static-lib
+%patch112 -p1 -b .debug-build
+
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -527,7 +621,25 @@ autoconf
# For patch 55 (systemtap), we need to get a new header for configure to use:
autoheader
-# Use the freshly created "configure" script:
+# Define a function, for how to perform a "build" of python for a given
+# configuration:
+BuildPython() {
+ ConfName=$1
+ BinaryName=$2
+ SymlinkName=$3
+ ExtraConfigArgs=$4
+ PathFixWithThisBinary=$5
+
+ ConfDir=build/$ConfName
+
+ echo STARTING: BUILD OF PYTHON FOR CONFIGURATION: $ConfName - %{_bindir}/$BinaryName
+ mkdir -p $ConfDir
+
+ pushd $ConfDir
+
+ # Use the freshly created "configure" script, but in the directory two
above:
+ %global _configure $topdir/configure
+
%configure \
--enable-ipv6 \
--enable-unicode=%{unicode} \
@@ -540,18 +652,52 @@ autoheader
--with-dtrace \
--with-tapset-install-dir=%{tapsetdir} \
%endif
- --with-system-expat
+ --with-system-expat \
+ $ExtraConfigArgs \
+ %{nil}
make OPT="$CFLAGS" %{?_smp_mflags}
-LD_LIBRARY_PATH="$topdir" $topdir/python Tools/scripts/pathfix.py -i
"%{_bindir}/env python%{pybasever}" .
+
+# We need to fix shebang lines across the full source tree.
+#
+# We do this using the pathfix.py script, which requires one of the
+# freshly-built Python binaries.
+#
+# We use the optimized python binary, and make the shebangs point at that same
+# optimized python binary:
+if $PathFixWithThisBinary
+then
+ LD_LIBRARY_PATH="$topdir/$ConfDir" $BinaryName \
+ $topdir/Tools/scripts/pathfix.py \
+ -i "%{_bindir}/env $BinaryName" \
+ $topdir
+fi
+
# Rebuild with new python
# We need a link to a versioned python in the build directory
-ln -s python python%{pybasever}
-LD_LIBRARY_PATH="$topdir" PATH=$PATH:$topdir make -s OPT="$CFLAGS"
%{?_smp_mflags}
+ln -s $BinaryName $SymlinkName
+LD_LIBRARY_PATH="$topdir/$ConfDir" PATH=$PATH:$topdir/$ConfDir make -s
OPT="$CFLAGS" %{?_smp_mflags}
+
+ popd
+ echo FINISHED: BUILD OF PYTHON FOR CONFIGURATION: $ConfDir
+}
+# Use "BuildPython" to support building with different configurations:
+BuildPython debug \
+ python-debug \
+ python%{pybasever}-debug \
+ "--with-pydebug" \
+ false
+
+BuildPython optimized \
+ python \
+ python%{pybasever} \
+ "" \
+ true
%install
+topdir=$(pwd)
rm -rf %{buildroot}
mkdir -p %{buildroot}%{_prefix} %{buildroot}%{_mandir}
@@ -560,7 +706,66 @@ for f in distutils/command/install distutils/sysconfig; do
rm -f Lib/$f.py.lib64
done
+InstallPython() {
+
+ ConfName=$1
+ BinaryName=$2
+ PyInstSoName=$3
+
+ ConfDir=build/$ConfName
+
+ echo STARTING: INSTALL OF PYTHON FOR CONFIGURATION: $ConfName - %{_bindir}/$BinaryName
+ mkdir -p $ConfDir
+
+ pushd $ConfDir
+
make install DESTDIR=%{buildroot}
+
+# Copy up the gdb hooks into place; the python file will be autoloaded by gdb
+# when visiting libpython.so, provided that the python file is installed to the
+# same path as the library (or its .debug file) plus a "-gdb.py" suffix, e.g:
+# /usr/lib/debug/usr/lib64/libpython2.6.so.1.0.debug-gdb.py
+# (note that the debug path is /usr/lib/debug for both 32/64 bit)
+#
+# Initially I tried:
+# /usr/lib/libpython2.6.so.1.0-gdb.py
+# but doing so generated noise when ldconfig was rerun (rhbz:562980)
+#
+%if 0%{?with_gdb_hooks}
+DirHoldingGdbPy=%{_prefix}/lib/debug/%{_libdir}
+PathOfGdbPy=$DirHoldingGdbPy/$PyInstSoName.debug-gdb.py
+
+mkdir -p %{buildroot}$DirHoldingGdbPy
+cp %{SOURCE1} %{buildroot}$PathOfGdbPy
+
+# Manually byte-compile the file, in case find-debuginfo.sh is run before
+# brp-python-bytecompile, so that the .pyc/.pyo files are properly listed in
+# the debuginfo manifest:
+LD_LIBRARY_PATH="$topdir/$ConfDir" $topdir/$ConfDir/$BinaryName \
+ -c "import compileall; import sys;
compileall.compile_dir('%{buildroot}$DirHoldingGdbPy',
ddir='$DirHoldingGdbPy')"
+
+LD_LIBRARY_PATH="$topdir/$ConfDir" $topdir/$ConfDir/$BinaryName -O \
+ -c "import compileall; import sys;
compileall.compile_dir('%{buildroot}$DirHoldingGdbPy',
ddir='$DirHoldingGdbPy')"
+%endif # with_gdb_hooks
+
+ popd
+
+ echo FINISHED: INSTALL OF PYTHON FOR CONFIGURATION: $ConfName
+}
+
+# Use "InstallPython" to support building with different configurations:
+
+# Install the "debug" build first, so that we can move some files aside
+InstallPython debug \
+ python%{pybasever}-debug \
+ %{py_INSTSONAME_debug}
+
+# Now the optimized build:
+InstallPython optimized \
+ python%{pybasever} \
+ %{py_INSTSONAME_optimized}
+
+
# Fix the interpreter path in binaries installed by distutils
# (which changes them by itself)
# Make sure we preserve the file permissions
@@ -587,8 +792,10 @@ fi
%if %{main_python}
ln -s python %{buildroot}%{_bindir}/python2
+ln -s python-debug %{buildroot}%{_bindir}/python2-debug
%else
mv %{buildroot}%{_bindir}/python %{buildroot}%{_bindir}/%{python}
+mv %{buildroot}%{_bindir}/python-debug %{buildroot}%{_bindir}/%{python}-debug
mv %{buildroot}/%{_mandir}/man1/python.1
%{buildroot}/%{_mandir}/man1/python%{pybasever}.1
%endif
@@ -677,9 +884,10 @@ install -d %{buildroot}/usr/lib/python%{pybasever}/site-packages
%else
%global _pyconfig_h %{_pyconfig32_h}
%endif
-mv %{buildroot}%{_includedir}/python%{pybasever}/pyconfig.h \
- %{buildroot}%{_includedir}/python%{pybasever}/%{_pyconfig_h}
-cat > %{buildroot}%{_includedir}/python%{pybasever}/pyconfig.h << EOF
+for PyIncludeDir in python%{pybasever} python%{pybasever}-debug ; do
+ mv %{buildroot}%{_includedir}/$PyIncludeDir/pyconfig.h \
+ %{buildroot}%{_includedir}/$PyIncludeDir/%{_pyconfig_h}
+ cat > %{buildroot}%{_includedir}/$PyIncludeDir/pyconfig.h << EOF
#include <bits/wordsize.h>
#if __WORDSIZE == 32
@@ -690,6 +898,7 @@ cat > %{buildroot}%{_includedir}/python%{pybasever}/pyconfig.h
<< EOF
#error "Unknown word size"
#endif
EOF
+done
ln -s ../../libpython%{pybasever}.so
%{buildroot}%{pylibdir}/config/libpython%{pybasever}.so
# Fix for bug 201434: make sure distutils looks at the right pyconfig.h file
@@ -701,31 +910,21 @@ ldd %{buildroot}/%{dynload_dir}/_curses*.so \
| grep curses \
| grep libncurses.so && (echo "_curses.so linked against
libncurses.so" ; exit 1)
-
-# Copy up the gdb hooks into place; the python file will be autoloaded by gdb
-# when visiting libpython.so, provided that the python file is installed to the
-# same path as the library (or its .debug file) plus a "-gdb.py" suffix, e.g:
-# /usr/lib/debug/usr/lib64/libpython2.6.so.1.0.debug-gdb.py
-# (note that the debug path is /usr/lib/debug for both 32/64 bit)
-#
-# Initially I tried:
-# /usr/lib/libpython2.6.so.1.0-gdb.py
-# but doing so generated noise when ldconfig was rerun (rhbz:562980)
-#
-%if 0%{?with_gdb_hooks}
-%global dir_holding_gdb_py %{_prefix}/lib/debug/%{_libdir}
-%global path_of_gdb_py %{dir_holding_gdb_py}/%{py_INSTSONAME}.debug-gdb.py
-
-mkdir -p %{buildroot}%{dir_holding_gdb_py}
-cp %{SOURCE1} %{buildroot}%{path_of_gdb_py}
-
-# Manually byte-compile the file, in case find-debuginfo.sh is run before
-# brp-python-bytecompile, so that the .pyc/.pyo files are properly listed in
-# the debuginfo manifest:
-LD_LIBRARY_PATH=. ./python -c "import compileall; import sys;
compileall.compile_dir('%{buildroot}%{dir_holding_gdb_py}',
ddir='%{dir_holding_gdb_py}')"
-
-LD_LIBRARY_PATH=. ./python -O -c "import compileall; import sys;
compileall.compile_dir('%{buildroot}%{dir_holding_gdb_py}',
ddir='%{dir_holding_gdb_py}')"
-%endif # with_gdb_hooks
+# Ensure that the debug modules are linked against the debug libpython, and
+# likewise for the optimized modules and libpython:
+for Module in %{buildroot}/%{dynload_dir}/*.so ; do
+ case $Module in
+ *_d.so)
+ ldd $Module | grep %{py_INSTSONAME_optimized} &&
+ (echo Debug module $Module linked against optimized
%{py_INSTSONAME_optimized} ; exit 1)
+
+ ;;
+ *)
+ ldd $Module | grep %{py_INSTSONAME_debug} &&
+ (echo Optimized module $Module linked against debug
%{py_INSTSONAME_optimized} ; exit 1)
+ ;;
+ esac
+done
#
# Systemtap hooks:
@@ -735,15 +934,22 @@ LD_LIBRARY_PATH=. ./python -O -c "import compileall; import
sys; compileall.comp
# library:
mkdir -p %{buildroot}%{tapsetdir}
%ifarch ppc64 s390x x86_64 ia64 alpha sparc64
-%global libpython_stp libpython%{pybasever}-64.stp
+%global libpython_stp_optimized libpython%{pybasever}-64.stp
+%global libpython_stp_debug libpython%{pybasever}-debug-64.stp
%else
-%global libpython_stp libpython%{pybasever}-32.stp
+%global libpython_stp_optimized libpython%{pybasever}-32.stp
+%global libpython_stp_debug libpython%{pybasever}-debug-32.stp
%endif
sed \
- -e "s|LIBRARY_PATH|%{_libdir}/%{py_INSTSONAME}|" \
+ -e "s|LIBRARY_PATH|%{_libdir}/%{py_INSTSONAME_optimized}|" \
+ %{SOURCE3} \
+ > %{buildroot}%{tapsetdir}/%{libpython_stp_optimized}
+
+sed \
+ -e "s|LIBRARY_PATH|%{_libdir}/%{py_INSTSONAME_debug}|" \
%{SOURCE3} \
- > %{buildroot}%{tapsetdir}/%{libpython_stp}
+ > %{buildroot}%{tapsetdir}/%{libpython_stp_debug}
%endif # with_systemtap
%clean
@@ -753,7 +959,6 @@ rm -fr %{buildroot}
%postun libs -p /sbin/ldconfig
-
%files
%defattr(-, root, root, -)
%doc LICENSE README
@@ -893,9 +1098,9 @@ rm -fr %{buildroot}
%files libs
%defattr(-,root,root,-)
%doc LICENSE README
-%{_libdir}/%{py_INSTSONAME}
+%{_libdir}/%{py_INSTSONAME_optimized}
%if 0%{?with_systemtap}
-%{tapsetdir}/%{libpython_stp}
+%{tapsetdir}/%{libpython_stp_optimized}
%doc systemtap-example.stp pyfuntop.stp
%endif
@@ -950,6 +1155,128 @@ rm -fr %{buildroot}
%{dynload_dir}/_ctypes_test.so
%{dynload_dir}/_testcapimodule.so
+
+# We don't bother splitting the debug build out into further subpackages:
+# if you need it, you're probably a developer.
+
+# Hence the manifest is the combination of analogous files in the manifests of
+# all of the other subpackages
+
+%files debug
+%defattr(-,root,root,-)
+
+# Analog of the core subpackage's files:
+%{_bindir}/%{python}-debug
+%if %{main_python}
+%{_bindir}/python2-debug
+%endif
+%{_bindir}/python%{pybasever}-debug
+
+# ...with debug builds of the built-in "extension" modules:
+%{dynload_dir}/_bisectmodule_d.so
+%{dynload_dir}/_bsddb_d.so
+%{dynload_dir}/_bytesio_d.so
+%{dynload_dir}/_codecs_cn_d.so
+%{dynload_dir}/_codecs_hk_d.so
+%{dynload_dir}/_codecs_iso2022_d.so
+%{dynload_dir}/_codecs_jp_d.so
+%{dynload_dir}/_codecs_kr_d.so
+%{dynload_dir}/_codecs_tw_d.so
+%{dynload_dir}/_collectionsmodule_d.so
+%{dynload_dir}/_csv_d.so
+%{dynload_dir}/_ctypes_d.so
+%{dynload_dir}/_curses_d.so
+%{dynload_dir}/_curses_panel_d.so
+%{dynload_dir}/_elementtree_d.so
+%{dynload_dir}/_fileio_d.so
+%{dynload_dir}/_functoolsmodule_d.so
+%{dynload_dir}/_hashlib_d.so
+%{dynload_dir}/_heapq_d.so
+%{dynload_dir}/_hotshot_d.so
+%{dynload_dir}/_json_d.so
+%{dynload_dir}/_localemodule_d.so
+%{dynload_dir}/_lsprof_d.so
+%{dynload_dir}/_md5module_d.so
+%{dynload_dir}/_multibytecodecmodule_d.so
+%{dynload_dir}/_multiprocessing_d.so
+%{dynload_dir}/_randommodule_d.so
+%{dynload_dir}/_sha256module_d.so
+%{dynload_dir}/_sha512module_d.so
+%{dynload_dir}/_shamodule_d.so
+%{dynload_dir}/_socketmodule_d.so
+%{dynload_dir}/_sqlite3_d.so
+%{dynload_dir}/_ssl_d.so
+%{dynload_dir}/_struct_d.so
+%{dynload_dir}/_weakref_d.so
+%{dynload_dir}/arraymodule_d.so
+%{dynload_dir}/audioop_d.so
+%{dynload_dir}/binascii_d.so
+%{dynload_dir}/bz2_d.so
+%{dynload_dir}/cPickle_d.so
+%{dynload_dir}/cStringIO_d.so
+%{dynload_dir}/cmathmodule_d.so
+%{dynload_dir}/cryptmodule_d.so
+%{dynload_dir}/datetime_d.so
+%{dynload_dir}/dbm_d.so
+%{dynload_dir}/dlmodule_d.so
+%{dynload_dir}/fcntlmodule_d.so
+%{dynload_dir}/future_builtins_d.so
+%{dynload_dir}/gdbmmodule_d.so
+%{dynload_dir}/grpmodule_d.so
+%{dynload_dir}/imageop_d.so
+%{dynload_dir}/itertoolsmodule_d.so
+%{dynload_dir}/linuxaudiodev_d.so
+%{dynload_dir}/mathmodule_d.so
+%{dynload_dir}/mmapmodule_d.so
+%{dynload_dir}/nismodule_d.so
+%{dynload_dir}/operator_d.so
+%{dynload_dir}/ossaudiodev_d.so
+%{dynload_dir}/parsermodule_d.so
+%{dynload_dir}/pyexpat_d.so
+%{dynload_dir}/readline_d.so
+%{dynload_dir}/resource_d.so
+%{dynload_dir}/selectmodule_d.so
+%{dynload_dir}/spwdmodule_d.so
+%{dynload_dir}/stropmodule_d.so
+%{dynload_dir}/syslog_d.so
+%{dynload_dir}/termios_d.so
+%{dynload_dir}/timemodule_d.so
+%{dynload_dir}/timingmodule_d.so
+%{dynload_dir}/unicodedata_d.so
+%{dynload_dir}/xxsubtype_d.so
+%{dynload_dir}/zlibmodule_d.so
+
+# No need to split things out the "Makefile" and the config-32/64.h file as we
+# do for the regular build above (bug 531901), since they're all in one package
+# now; they're listed below, under "-devel":
+
+# Analog of the -libs subpackage's files:
+%{_libdir}/%{py_INSTSONAME_debug}
+%if 0%{?with_systemtap}
+%{tapsetdir}/%{libpython_stp_debug}
+%endif
+
+# Analog of the -devel subpackage's files:
+%dir %{pylibdir}/config-debug
+%{pylibdir}/config-debug/*
+%{_includedir}/python%{pybasever}-debug/*.h
+%if %{main_python}
+%{_bindir}/python-debug-config
+%endif
+%{_bindir}/python%{pybasever}-debug-config
+%{_libdir}/libpython%{pybasever}_d.so
+
+# Analog of the -tools subpackage's files:
+# None for now; we could build precanned versions that have the appropriate
+# shebang if needed
+
+# Analog of the tkinter subpackage's files:
+%{dynload_dir}/_tkinter_d.so
+
+# Analog of the -test subpackage's files:
+%{dynload_dir}/_ctypes_test_d.so
+%{dynload_dir}/_testcapimodule_d.so
+
# We put the debug-gdb.py file inside /usr/lib/debug to avoid noise from
# ldconfig (rhbz:562980).
#
@@ -964,6 +1291,10 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Tue May 18 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-9
+- build and install two different configurations of Python: debug and standard,
+packaging the debug build in a new "python-debug" subpackage (patch 112)
+
* Tue May 4 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-8
- don't delete wsgiref.egg-info (rhbz:588426)
commit 66ec06a0ac7cfdd0810d06b2ffc81834e828afb4
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Tue May 4 19:45:07 2010 +0000
don't delete wsgiref.egg-info (rhbz:588426)
diff --git a/python.spec b/python.spec
index 7ecca60..8fb90ea 100644
--- a/python.spec
+++ b/python.spec
@@ -60,7 +60,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.6.5
-Release: 7%{?dist}
+Release: 8%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -695,9 +695,6 @@ ln -s ../../libpython%{pybasever}.so
%{buildroot}%{pylibdir}/config/libpython%{p
# Fix for bug 201434: make sure distutils looks at the right pyconfig.h file
sed -i -e "s/'pyconfig.h'/'%{_pyconfig_h}'/"
%{buildroot}%{pylibdir}/distutils/sysconfig.py
-# Get rid of egg-info files (core python modules are installed through rpms)
-rm %{buildroot}%{pylibdir}/*.egg-info
-
# Ensure that the curses module was linked against libncursesw.so, rather than
# libncurses.so (bug 539917)
ldd %{buildroot}/%{dynload_dir}/_curses*.so \
@@ -848,6 +845,7 @@ rm -fr %{buildroot}
%{site_packages}/README
%{pylibdir}/*.py*
%{pylibdir}/*.doc
+%{pylibdir}/wsgiref.egg-info
%dir %{pylibdir}/bsddb
%{pylibdir}/bsddb/*.py*
%{pylibdir}/compiler
@@ -966,6 +964,9 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Tue May 4 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-8
+- don't delete wsgiref.egg-info (rhbz:588426)
+
* Mon Apr 26 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-7
- disable --with-valgrind on sparc arches
commit 000d1758a5ca4a0f6af02b544c63c8c976c207bb
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Mon Apr 26 19:15:58 2010 +0000
disable --with-valgrind on sparc arches
diff --git a/python.spec b/python.spec
index 3c6fdf1..7ecca60 100644
--- a/python.spec
+++ b/python.spec
@@ -36,6 +36,13 @@
%global with_systemtap 1
+# sparc arches dont have valgrind so we need to disable its support on them
+%ifarch %{sparc}
+%global with_valgrind 0
+%else
+%global with_valgrind 1
+%endif
+
# Some of the files below /usr/lib/pythonMAJOR.MINOR/test (e.g. bad_coding.py)
# are deliberately invalid, leading to SyntaxError exceptions if they get
# byte-compiled.
@@ -53,7 +60,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.6.5
-Release: 6%{?dist}
+Release: 7%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -323,7 +330,9 @@ BuildRequires: tix-devel bzip2-devel sqlite-devel
BuildRequires: autoconf
BuildRequires: db4-devel >= 4.8
BuildRequires: libffi-devel
+%if 0%{?with_valgrind}
BuildRequires: valgrind-devel
+%endif
%if 0%{?with_systemtap}
BuildRequires: systemtap-sdt-devel
@@ -524,12 +533,14 @@ autoheader
--enable-unicode=%{unicode} \
--enable-shared \
--with-system-ffi \
- --with-system-expat \
+%if 0%{?with_valgrind}
+ --with-valgrind \
+%endif
%if 0%{?with_systemtap}
--with-dtrace \
--with-tapset-install-dir=%{tapsetdir} \
%endif
- --with-valgrind
+ --with-system-expat
make OPT="$CFLAGS" %{?_smp_mflags}
LD_LIBRARY_PATH="$topdir" $topdir/python Tools/scripts/pathfix.py -i
"%{_bindir}/env python%{pybasever}" .
@@ -955,6 +966,9 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Mon Apr 26 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-7
+- disable --with-valgrind on sparc arches
+
* Mon Apr 12 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-6
- move the "bdist_wininst" command's template .exe files from the core
package
to the devel subpackage, to save space (rhbz:525469)
commit 76814571d0c1752936c6d100fca33815aa7dec50
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Mon Apr 12 15:54:48 2010 +0000
- move the "bdist_wininst" command's template .exe files from the core
package to the devel subpackage, to save space (rhbz:525469)
- fix stray doublelisting of config directory wildcard in devel subpackage
diff --git a/python.spec b/python.spec
index 35563ce..3c6fdf1 100644
--- a/python.spec
+++ b/python.spec
@@ -53,7 +53,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.6.5
-Release: 5%{?dist}
+Release: 6%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -848,6 +848,7 @@ rm -fr %{buildroot}
%{pylibdir}/distutils/*.py*
%{pylibdir}/distutils/README
%{pylibdir}/distutils/command
+%exclude %{pylibdir}/distutils/command/wininst-*.exe
%dir %{pylibdir}/email
%{pylibdir}/email/*.py*
%{pylibdir}/email/mime
@@ -893,6 +894,7 @@ rm -fr %{buildroot}
%defattr(-,root,root,-)
%{pylibdir}/config/*
%exclude %{pylibdir}/config/Makefile
+%{pylibdir}/distutils/command/wininst-*.exe
%{_includedir}/python%{pybasever}/*.h
%exclude %{_includedir}/python%{pybasever}/%{_pyconfig_h}
%doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit
@@ -900,7 +902,6 @@ rm -fr %{buildroot}
%{_bindir}/python-config
%endif
%{_bindir}/python%{pybasever}-config
-%{pylibdir}/config/*
%{_libdir}/libpython%{pybasever}.so
%files tools
@@ -954,6 +955,11 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Mon Apr 12 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-6
+- move the "bdist_wininst" command's template .exe files from the core
package
+to the devel subpackage, to save space (rhbz:525469)
+- fix stray doublelisting of config directory wildcard in devel subpackage
+
* Wed Mar 31 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-5
- update python-gdb.py from v4 to v5 (improving performance and stability,
adding commands)
commit 01f3a7f78bdf7aa9ddff28325546277db443909b
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Thu Apr 1 02:45:00 2010 +0000
update python-gdb.py from v4 to v5 (improving performance and stability,
adding commands)
diff --git a/python-gdb.py b/python-gdb.py
index 44099a9..640b7f6 100644
--- a/python-gdb.py
+++ b/python-gdb.py
@@ -23,6 +23,15 @@ holding three PyObject* that turn out to be PyStringObject* instances,
we can
generate a proxy value within the gdb process that is a list of strings:
["foo", "bar", "baz"]
+Doing so can be expensive for complicated graphs of objects, and could take
+some time, so we also have a "write_repr" method that writes a representation
+of the data to a file-like object. This allows us to stop the traversal by
+having the file-like object raise an exception if it gets too much data.
+
+With both "proxyval" and "write_repr" we keep track of the set of all
addresses
+visited so far in the traversal, to avoid infinite recursion due to cycles in
+the graph of object references.
+
We try to defer gdb.lookup_type() invocations for python types until as late as
possible: for a dynamically linked python binary, when the process starts in
the debugger, the libpython.so hasn't been dynamically loaded yet, so none of
@@ -55,6 +64,8 @@ Py_TPFLAGS_BASE_EXC_SUBCLASS = (1L << 30)
Py_TPFLAGS_TYPE_SUBCLASS = (1L << 31)
+MAX_OUTPUT_LEN=1024
+
class NullPyObjectPtr(RuntimeError):
pass
@@ -63,7 +74,7 @@ def safety_limit(val):
# Given a integer value from the process being debugged, limit it to some
# safety threshold so that arbitrary breakage within said process doesn't
# break the gdb process too much (e.g. sizes of iterations, sizes of lists)
- return min(val, 100)
+ return min(val, 1000)
def safe_range(val):
@@ -72,6 +83,28 @@ def safe_range(val):
return xrange(safety_limit(val))
+class StringTruncated(RuntimeError):
+ pass
+
+class TruncatedStringIO(object):
+ '''Similar to cStringIO, but can truncate the output by raising a
+ StringTruncated exception'''
+ def __init__(self, maxlen=None):
+ self._val = ''
+ self.maxlen = maxlen
+
+ def write(self, data):
+ if self.maxlen:
+ if len(data) + len(self._val) > self.maxlen:
+ # Truncation:
+ self._val += data[0:self.maxlen - len(self._val)]
+ raise StringTruncated()
+
+ self._val += data
+
+ def getvalue(self):
+ return self._val
+
class PyObjectPtr(object):
"""
Class wrapping a gdb.Value that's a either a (PyObject*) within the
@@ -125,12 +158,54 @@ class PyObjectPtr(object):
# General case: look it up inside the object:
return self._gdbval.dereference()[name]
+ def pyop_field(self, name):
+ '''
+ Get a PyObjectPtr for the given PyObject* field within this PyObject,
+ coping with some python 2 versus python 3 differences.
+ '''
+ return PyObjectPtr.from_pyobject_ptr(self.field(name))
+
+ def write_field_repr(self, name, out, visited):
+ '''
+ Extract the PyObject* field named "name", and write its representation
+ to file-like object "out"
+ '''
+ field_obj = self.pyop_field(name)
+ field_obj.write_repr(out, visited)
+
+ def get_truncated_repr(self, maxlen):
+ '''
+ Get a repr-like string for the data, but truncate it at "maxlen" bytes
+ (ending the object graph traversal as soon as you do)
+ '''
+ out = TruncatedStringIO(maxlen)
+ try:
+ self.write_repr(out, set())
+ except StringTruncated:
+ # Truncation occurred:
+ return out.getvalue() + '...(truncated)'
+
+ # No truncation occurred:
+ return out.getvalue()
+
def type(self):
return PyTypeObjectPtr(self.field('ob_type'))
def is_null(self):
return 0 == long(self._gdbval)
+ def is_optimized_out(self):
+ '''
+ Is the value of the underlying PyObject* visible to the debugger?
+
+ This can vary with the precise version of the compiler used to build
+ Python, and the precise version of gdb.
+
+ See e.g.
https://bugzilla.redhat.com/show_bug.cgi?id=556975 with
+ PyEval_EvalFrameEx's "f"
+ '''
+ return self._gdbval.is_optimized_out
+
def safe_tp_name(self):
try:
return self.type().field('tp_name').string()
@@ -180,6 +255,16 @@ class PyObjectPtr(object):
return FakeRepr(self.safe_tp_name(),
long(self._gdbval))
+ def write_repr(self, out, visited):
+ '''
+ Write a string representation of the value scraped from the inferior
+ process to "out", a file-like object.
+ '''
+ # Default implementation: generate a proxy value and write its repr
+ # However, this could involve a lot of work for complicated objects,
+ # so for derived classes we specialize this
+ return out.write(repr(self.proxyval(visited)))
+
@classmethod
def subclass_from_type(cls, t):
'''
@@ -217,6 +302,7 @@ class PyObjectPtr(object):
'frame': PyFrameObjectPtr,
'set' : PySetObjectPtr,
'frozenset' : PySetObjectPtr,
+ 'builtin_function_or_method' : PyCFunctionObjectPtr,
}
if tp_name in name_map:
return name_map[tp_name]
@@ -283,6 +369,28 @@ class ProxyAlreadyVisited(object):
def __repr__(self):
return self._rep
+
+def _write_instance_repr(out, visited, name, pyop_attrdict, address):
+ '''Shared code for use by old-style and new-style classes:
+ write a representation to file-like object "out"'''
+ out.write('<')
+ out.write(name)
+
+ # Write dictionary of instance attributes:
+ if isinstance(pyop_attrdict, PyDictObjectPtr):
+ out.write('(')
+ first = True
+ for pyop_arg, pyop_val in pyop_attrdict.iteritems():
+ if not first:
+ out.write(', ')
+ first = False
+ out.write(pyop_arg.proxyval(visited))
+ out.write('=')
+ pyop_val.write_repr(out, visited)
+ out.write(')')
+ out.write(' at remote 0x%x>' % address)
+
+
class InstanceProxy(object):
def __init__(self, cl_name, attrdict, address):
@@ -299,8 +407,7 @@ class InstanceProxy(object):
else:
return '<%s at remote 0x%x>' % (self.cl_name,
self.address)
-
-
+
def _PyObject_VAR_SIZE(typeobj, nitems):
return ( ( typeobj.field('tp_basicsize') +
nitems * typeobj.field('tp_itemsize') +
@@ -311,19 +418,11 @@ def _PyObject_VAR_SIZE(typeobj, nitems):
class HeapTypeObjectPtr(PyObjectPtr):
_typename = 'PyObject'
- def proxyval(self, visited):
+ def get_attr_dict(self):
'''
- Support for new-style classes.
-
- Currently we just locate the dictionary using a transliteration to
- python of _PyObject_GetDictPtr, ignoring descriptors
+ Get the PyDictObject ptr representing the attribute dictionary
+ (or None if there's a problem)
'''
- # Guard against infinite loops:
- if self.as_address() in visited:
- return ProxyAlreadyVisited('<...>')
- visited.add(self.as_address())
-
- attr_dict = {}
try:
typeobj = self.type()
dictoffset = int_from_int(typeobj.field('tp_dictoffset'))
@@ -341,16 +440,47 @@ class HeapTypeObjectPtr(PyObjectPtr):
dictptr = self._gdbval.cast(_type_char_ptr) + dictoffset
PyObjectPtrPtr = PyObjectPtr.get_gdb_type().pointer()
dictptr = dictptr.cast(PyObjectPtrPtr)
- attr_dict =
PyObjectPtr.from_pyobject_ptr(dictptr.dereference()).proxyval(visited)
+ return PyObjectPtr.from_pyobject_ptr(dictptr.dereference())
except RuntimeError:
# Corrupt data somewhere; fail safe
pass
+ # Not found, or some kind of error:
+ return None
+
+ def proxyval(self, visited):
+ '''
+ Support for new-style classes.
+
+ Currently we just locate the dictionary using a transliteration to
+ python of _PyObject_GetDictPtr, ignoring descriptors
+ '''
+ # Guard against infinite loops:
+ if self.as_address() in visited:
+ return ProxyAlreadyVisited('<...>')
+ visited.add(self.as_address())
+
+ pyop_attr_dict = self.get_attr_dict()
+ if pyop_attr_dict:
+ attr_dict = pyop_attr_dict.proxyval(visited)
+ else:
+ attr_dict = {}
tp_name = self.safe_tp_name()
# New-style class:
return InstanceProxy(tp_name, attr_dict, long(self._gdbval))
+ def write_repr(self, out, visited):
+ # Guard against infinite loops:
+ if self.as_address() in visited:
+ out.write('<...>')
+ return
+ visited.add(self.as_address())
+
+ pyop_attrdict = self.get_attr_dict()
+ _write_instance_repr(out, visited,
+ self.safe_tp_name(), pyop_attrdict, self.as_address())
+
class ProxyException(Exception):
def __init__(self, tp_name, args):
self.tp_name = tp_name
@@ -371,10 +501,20 @@ class PyBaseExceptionObjectPtr(PyObjectPtr):
if self.as_address() in visited:
return ProxyAlreadyVisited('(...)')
visited.add(self.as_address())
- arg_proxy =
PyObjectPtr.from_pyobject_ptr(self.field('args')).proxyval(visited)
+ arg_proxy = self.pyop_field('args').proxyval(visited)
return ProxyException(self.safe_tp_name(),
arg_proxy)
+ def write_repr(self, out, visited):
+ # Guard against infinite loops:
+ if self.as_address() in visited:
+ out.write('(...)')
+ return
+ visited.add(self.as_address())
+
+ out.write(self.safe_tp_name())
+ self.write_field_repr('args', out, visited)
+
class PyBoolObjectPtr(PyObjectPtr):
"""
Class wrapping a gdb.Value that's a PyBoolObject* i.e. one of the two
@@ -397,6 +537,43 @@ class PyClassObjectPtr(PyObjectPtr):
_typename = 'PyClassObject'
+class BuiltInFunctionProxy(object):
+ def __init__(self, ml_name):
+ self.ml_name = ml_name
+
+ def __repr__(self):
+ return "<built-in function %s>" % self.ml_name
+
+class BuiltInMethodProxy(object):
+ def __init__(self, ml_name, pyop_m_self):
+ self.ml_name = ml_name
+ self.pyop_m_self = pyop_m_self
+
+ def __repr__(self):
+ return ('<built-in method %s of %s object at remote 0x%x>'
+ % (self.ml_name,
+ self.pyop_m_self.safe_tp_name(),
+ self.pyop_m_self.as_address())
+ )
+
+class PyCFunctionObjectPtr(PyObjectPtr):
+ """
+ Class wrapping a gdb.Value that's a PyCFunctionObject*
+ (see Include/methodobject.h and Objects/methodobject.c)
+ """
+ _typename = 'PyCFunctionObject'
+
+ def proxyval(self, visited):
+ m_ml = self.field('m_ml') # m_ml is a (PyMethodDef*)
+ ml_name = m_ml['ml_name'].string()
+
+ pyop_m_self = self.pyop_field('m_self')
+ if pyop_m_self.is_null():
+ return BuiltInFunctionProxy(ml_name)
+ else:
+ return BuiltInMethodProxy(ml_name, pyop_m_self)
+
+
class PyCodeObjectPtr(PyObjectPtr):
"""
Class wrapping a gdb.Value that's a PyCodeObject* i.e. a <code> instance
@@ -411,7 +588,7 @@ class PyCodeObjectPtr(PyObjectPtr):
Analogous to PyCode_Addr2Line; translated from pseudocode in
Objects/lnotab_notes.txt
'''
- co_lnotab =
PyObjectPtr.from_pyobject_ptr(self.field('co_lnotab')).proxyval(set())
+ co_lnotab = self.pyop_field('co_lnotab').proxyval(set())
# Initialize lineno to co_firstlineno as per PyCode_Addr2Line
# not 0, as lnotab_notes.txt has it:
@@ -425,6 +602,7 @@ class PyCodeObjectPtr(PyObjectPtr):
lineno += ord(line_incr)
return lineno
+
class PyDictObjectPtr(PyObjectPtr):
"""
Class wrapping a gdb.Value that's a PyDictObject* i.e. a dict instance
@@ -432,6 +610,18 @@ class PyDictObjectPtr(PyObjectPtr):
"""
_typename = 'PyDictObject'
+ def iteritems(self):
+ '''
+ Yields a sequence of (PyObjectPtr key, PyObjectPtr value) pairs,
+ analagous to dict.iteritems()
+ '''
+ for i in safe_range(self.field('ma_mask') + 1):
+ ep = self.field('ma_table') + i
+ pyop_value = PyObjectPtr.from_pyobject_ptr(ep['me_value'])
+ if not pyop_value.is_null():
+ pyop_key = PyObjectPtr.from_pyobject_ptr(ep['me_key'])
+ yield (pyop_key, pyop_value)
+
def proxyval(self, visited):
# Guard against infinite loops:
if self.as_address() in visited:
@@ -439,14 +629,29 @@ class PyDictObjectPtr(PyObjectPtr):
visited.add(self.as_address())
result = {}
- for i in safe_range(self.field('ma_mask') + 1):
- ep = self.field('ma_table') + i
- pvalue = PyObjectPtr.from_pyobject_ptr(ep['me_value'])
- if not pvalue.is_null():
- pkey = PyObjectPtr.from_pyobject_ptr(ep['me_key'])
- result[pkey.proxyval(visited)] = pvalue.proxyval(visited)
+ for pyop_key, pyop_value in self.iteritems():
+ proxy_key = pyop_key.proxyval(visited)
+ proxy_value = pyop_value.proxyval(visited)
+ result[proxy_key] = proxy_value
return result
+ def write_repr(self, out, visited):
+ # Guard against infinite loops:
+ if self.as_address() in visited:
+ out.write('{...}')
+ return
+ visited.add(self.as_address())
+
+ out.write('{')
+ first = True
+ for pyop_key, pyop_value in self.iteritems():
+ if not first:
+ out.write(', ')
+ first = False
+ pyop_key.write_repr(out, visited)
+ out.write(': ')
+ pyop_value.write_repr(out, visited)
+ out.write('}')
class PyInstanceObjectPtr(PyObjectPtr):
_typename = 'PyInstanceObject'
@@ -458,16 +663,34 @@ class PyInstanceObjectPtr(PyObjectPtr):
visited.add(self.as_address())
# Get name of class:
- in_class = PyObjectPtr.from_pyobject_ptr(self.field('in_class'))
- cl_name =
PyObjectPtr.from_pyobject_ptr(in_class.field('cl_name')).proxyval(visited)
+ in_class = self.pyop_field('in_class')
+ cl_name = in_class.pyop_field('cl_name').proxyval(visited)
# Get dictionary of instance attributes:
- in_dict =
PyObjectPtr.from_pyobject_ptr(self.field('in_dict')).proxyval(visited)
+ in_dict = self.pyop_field('in_dict').proxyval(visited)
# Old-style class:
return InstanceProxy(cl_name, in_dict, long(self._gdbval))
+ def write_repr(self, out, visited):
+ # Guard against infinite loops:
+ if self.as_address() in visited:
+ out.write('<...>')
+ return
+ visited.add(self.as_address())
+
+ # Old-style class:
+
+ # Get name of class:
+ in_class = self.pyop_field('in_class')
+ cl_name = in_class.pyop_field('cl_name').proxyval(visited)
+
+ # Get dictionary of instance attributes:
+ pyop_in_dict = self.pyop_field('in_dict')
+ _write_instance_repr(out, visited,
+ cl_name, pyop_in_dict, self.as_address())
+
class PyIntObjectPtr(PyObjectPtr):
_typename = 'PyIntObject'
@@ -493,6 +716,20 @@ class PyListObjectPtr(PyObjectPtr):
for i in safe_range(int_from_int(self.field('ob_size')))]
return result
+ def write_repr(self, out, visited):
+ # Guard against infinite loops:
+ if self.as_address() in visited:
+ out.write('[...]')
+ return
+ visited.add(self.as_address())
+
+ out.write('[')
+ for i in safe_range(int_from_int(self.field('ob_size'))):
+ if i > 0:
+ out.write(', ')
+ element = PyObjectPtr.from_pyobject_ptr(self[i])
+ element.write_repr(out, visited)
+ out.write(']')
class PyLongObjectPtr(PyObjectPtr):
_typename = 'PyLongObject'
@@ -524,7 +761,6 @@ class PyLongObjectPtr(PyObjectPtr):
if gdb.lookup_type('digit').sizeof == 2:
SHIFT = 15L
else:
- # FIXME: I haven't yet tested this case
SHIFT = 30L
digits = [long(ob_digit[i]) * 2**(SHIFT*i)
@@ -549,10 +785,129 @@ class PyNoneStructPtr(PyObjectPtr):
class PyFrameObjectPtr(PyObjectPtr):
_typename = 'PyFrameObject'
- def __str__(self):
- fi = FrameInfo(self)
- return str(fi)
+ def __init__(self, gdbval, cast_to):
+ PyObjectPtr.__init__(self, gdbval, cast_to)
+
+ if not self.is_optimized_out():
+ self.co = PyCodeObjectPtr.from_pyobject_ptr(self.field('f_code'))
+ self.co_name = self.co.pyop_field('co_name')
+ self.co_filename = self.co.pyop_field('co_filename')
+
+ self.f_lineno = int_from_int(self.field('f_lineno'))
+ self.f_lasti = int_from_int(self.field('f_lasti'))
+ self.co_nlocals = int_from_int(self.co.field('co_nlocals'))
+ self.co_varnames =
PyTupleObjectPtr.from_pyobject_ptr(self.co.field('co_varnames'))
+
+ def iter_locals(self):
+ '''
+ Yield a sequence of (name,value) pairs of PyObjectPtr instances, for
+ the local variables of this frame
+ '''
+ if self.is_optimized_out():
+ return
+
+ f_localsplus = self.field('f_localsplus')
+ for i in safe_range(self.co_nlocals):
+ pyop_value = PyObjectPtr.from_pyobject_ptr(f_localsplus[i])
+ if not pyop_value.is_null():
+ pyop_name = PyObjectPtr.from_pyobject_ptr(self.co_varnames[i])
+ yield (pyop_name, pyop_value)
+ def iter_globals(self):
+ '''
+ Yield a sequence of (name,value) pairs of PyObjectPtr instances, for
+ the global variables of this frame
+ '''
+ if self.is_optimized_out():
+ return
+
+ pyop_globals = self.pyop_field('f_globals')
+ return pyop_globals.iteritems()
+
+ def iter_builtins(self):
+ '''
+ Yield a sequence of (name,value) pairs of PyObjectPtr instances, for
+ the builtin variables
+ '''
+ if self.is_optimized_out():
+ return
+
+ pyop_builtins = self.pyop_field('f_builtins')
+ return pyop_builtins.iteritems()
+
+ def get_var_by_name(self, name):
+ '''
+ Look for the named local variable, returning a (PyObjectPtr, scope) pair
+ where scope is a string 'local', 'global', 'builtin'
+
+ If not found, return (None, None)
+ '''
+ for pyop_name, pyop_value in self.iter_locals():
+ if name == pyop_name.proxyval(set()):
+ return pyop_value, 'local'
+ for pyop_name, pyop_value in self.iter_globals():
+ if name == pyop_name.proxyval(set()):
+ return pyop_value, 'global'
+ for pyop_name, pyop_value in self.iter_builtins():
+ if name == pyop_name.proxyval(set()):
+ return pyop_value, 'builtin'
+ return None, None
+
+ def filename(self):
+ '''Get the path of the current Python source file, as a
string'''
+ if self.is_optimized_out():
+ return '(frame information optimized out)'
+ return self.co_filename.proxyval(set())
+
+ def current_line_num(self):
+ '''Get current line number as an integer (1-based)
+
+ Translated from PyFrame_GetLineNumber and PyCode_Addr2Line
+
+ See Objects/lnotab_notes.txt
+ '''
+ if self.is_optimized_out():
+ return None
+ f_trace = self.field('f_trace')
+ if long(f_trace) != 0:
+ # we have a non-NULL f_trace:
+ return self.f_lineno
+ else:
+ #try:
+ return self.co.addr2line(self.f_lasti)
+ #except ValueError:
+ # return self.f_lineno
+
+ def current_line(self):
+ '''Get the text of the current source line as a string, with a
trailing
+ newline character'''
+ if self.is_optimized_out():
+ return '(frame information optimized out)'
+ with open(self.filename(), 'r') as f:
+ all_lines = f.readlines()
+ # Convert from 1-based current_line_num to 0-based list offset:
+ return all_lines[self.current_line_num()-1]
+
+ def write_repr(self, out, visited):
+ if self.is_optimized_out():
+ out.write('(frame information optimized out)')
+ return
+ out.write('Frame 0x%x, for file %s, line %i, in %s ('
+ % (self.as_address(),
+ self.co_filename,
+ self.current_line_num(),
+ self.co_name))
+ first = True
+ for pyop_name, pyop_value in self.iter_locals():
+ if not first:
+ out.write(', ')
+ first = False
+
+ out.write(pyop_name.proxyval(visited))
+ out.write('=')
+ pyop_value.write_repr(out, visited)
+
+ out.write(')')
class PySetObjectPtr(PyObjectPtr):
_typename = 'PySetObject'
@@ -577,6 +932,32 @@ class PySetObjectPtr(PyObjectPtr):
else:
return set(members)
+ def write_repr(self, out, visited):
+ out.write(self.safe_tp_name())
+
+ # Guard against infinite loops:
+ if self.as_address() in visited:
+ out.write('(...)')
+ return
+ visited.add(self.as_address())
+
+ out.write('([')
+ first = True
+ table = self.field('table')
+ for i in safe_range(self.field('mask')+1):
+ setentry = table[i]
+ key = setentry['key']
+ if key != 0:
+ pyop_key = PyObjectPtr.from_pyobject_ptr(key)
+ key_proxy = pyop_key.proxyval(visited) # FIXME!
+ if key_proxy != '<dummy key>':
+ if not first:
+ out.write(', ')
+ first = False
+ pyop_key.write_repr(out, visited)
+ out.write('])')
+
+
class PyStringObjectPtr(PyObjectPtr):
_typename = 'PyStringObject'
@@ -589,7 +970,6 @@ class PyStringObjectPtr(PyObjectPtr):
def proxyval(self, visited):
return str(self)
-
class PyTupleObjectPtr(PyObjectPtr):
_typename = 'PyTupleObject'
@@ -608,6 +988,23 @@ class PyTupleObjectPtr(PyObjectPtr):
for i in
safe_range(int_from_int(self.field('ob_size')))])
return result
+ def write_repr(self, out, visited):
+ # Guard against infinite loops:
+ if self.as_address() in visited:
+ out.write('(...)')
+ return
+ visited.add(self.as_address())
+
+ out.write('(')
+ for i in safe_range(int_from_int(self.field('ob_size'))):
+ if i > 0:
+ out.write(', ')
+ element = PyObjectPtr.from_pyobject_ptr(self[i])
+ element.write_repr(out, visited)
+ if self.field('ob_size') == 1:
+ out.write(',)')
+ else:
+ out.write(')')
class PyTypeObjectPtr(PyObjectPtr):
_typename = 'PyTypeObject'
@@ -641,77 +1038,12 @@ def stringify(val):
# TODO: repr() puts everything on one line; pformat can be nicer, but
# can lead to v.long results; this function isolates the choice
if True:
- return repr(val)
+ return repr(val)
else:
from pprint import pformat
return pformat(val)
-class FrameInfo:
- '''
- Class representing all of the information we can scrape about a
- PyFrameObject*
- '''
- def __init__(self, fval):
- self.fval = fval
- self.co = PyCodeObjectPtr.from_pyobject_ptr(fval.field('f_code'))
- self.co_name = PyObjectPtr.from_pyobject_ptr(self.co.field('co_name'))
- self.co_filename =
PyObjectPtr.from_pyobject_ptr(self.co.field('co_filename'))
- self.f_lineno = int_from_int(fval.field('f_lineno'))
- self.f_lasti = int_from_int(fval.field('f_lasti'))
- self.co_nlocals = int_from_int(self.co.field('co_nlocals'))
- self.co_varnames =
PyTupleObjectPtr.from_pyobject_ptr(self.co.field('co_varnames'))
- self.locals = [] # list of kv pairs
- f_localsplus = self.fval.field('f_localsplus')
- for i in safe_range(self.co_nlocals):
- #print 'i=%i' % i
- value = PyObjectPtr.from_pyobject_ptr(f_localsplus[i])
- if not value.is_null():
- name = PyObjectPtr.from_pyobject_ptr(self.co_varnames[i])
- #print 'name=%s' % name
- value = value.proxyval(set())
- #print 'value=%s' % value
- self.locals.append((str(name), value))
-
- def filename(self):
- '''Get the path of the current Python source file, as a
string'''
- return self.co_filename.proxyval(set())
-
- def current_line_num(self):
- '''Get current line number as an integer (1-based)
-
- Translated from PyFrame_GetLineNumber and PyCode_Addr2Line
-
- See Objects/lnotab_notes.txt
- '''
- f_trace = self.fval.field('f_trace')
- if long(f_trace) != 0:
- # we have a non-NULL f_trace:
- return self.f_lineno
- else:
- #try:
- return self.co.addr2line(self.f_lasti)
- #except ValueError:
- # return self.f_lineno
-
- def current_line(self):
- '''Get the text of the current source line as a string, with a
trailing
- newline character'''
- with open(self.filename(), 'r') as f:
- all_lines = f.readlines()
- # Convert from 1-based current_line_num to 0-based list offset:
- return all_lines[self.current_line_num()-1]
-
- def __str__(self):
- return ('Frame 0x%x, for file %s, line %i, in %s (%s)'
- % (long(self.fval._gdbval),
- self.co_filename,
- self.current_line_num(),
- self.co_name,
- ', '.join(['%s=%s' % (k, stringify(v)) for k, v in
self.locals]))
- )
-
-
class PyObjectPtrPrinter:
"Prints a (PyObject*)"
@@ -719,29 +1051,22 @@ class PyObjectPtrPrinter:
self.gdbval = gdbval
def to_string (self):
- proxyval = PyObjectPtr.from_pyobject_ptr(self.gdbval).proxyval(set())
- return stringify(proxyval)
-
-
-class PyFrameObjectPtrPrinter(PyObjectPtrPrinter):
- "Prints a (PyFrameObject*)"
-
- def to_string (self):
pyop = PyObjectPtr.from_pyobject_ptr(self.gdbval)
- fi = FrameInfo(pyop)
- return str(fi)
-
+ if True:
+ return pyop.get_truncated_repr(MAX_OUTPUT_LEN)
+ else:
+ # Generate full proxy value then stringify it.
+ # Doing so could be expensive
+ proxyval = pyop.proxyval(set())
+ return stringify(proxyval)
def pretty_printer_lookup(gdbval):
type = gdbval.type.unqualified()
if type.code == gdb.TYPE_CODE_PTR:
type = type.target().unqualified()
t = str(type)
- if t == "PyObject":
+ if t in ("PyObject", "PyFrameObject"):
return PyObjectPtrPrinter(gdbval)
- elif t == "PyFrameObject":
- return PyFrameObjectPtrPrinter(gdbval)
-
"""
During development, I've been manually invoking the code in this way:
@@ -771,29 +1096,96 @@ def register (obj):
register (gdb.current_objfile ())
-def get_python_frame(gdb_frame):
- try:
- f = gdb_frame.read_var('f')
- return PyFrameObjectPtr.from_pyobject_ptr(f)
- except ValueError:
- return None
-def get_selected_python_frame():
- '''Try to obtain a (gdbframe, PyFrameObjectPtr) pair for the
- currently-running python code, or (None, None)'''
- gdb_frame = gdb.selected_frame()
- while gdb_frame:
- if (gdb_frame.function() is None or
- gdb_frame.function().name != 'PyEval_EvalFrameEx'):
- gdb_frame = gdb_frame.older()
- continue
+class Frame(object):
+ '''
+ Wrapper for gdb.Frame, adding various methods
+ '''
+ def __init__(self, gdbframe):
+ self._gdbframe = gdbframe
+
+ def older(self):
+ older = self._gdbframe.older()
+ if older:
+ return Frame(older)
+ else:
+ return None
+ def newer(self):
+ newer = self._gdbframe.newer()
+ if newer:
+ return Frame(newer)
+ else:
+ return None
+
+ def select(self):
+ self._gdbframe.select()
+
+ def get_index(self):
+ '''Calculate index of frame, starting at 0 for the newest frame
within
+ this thread'''
+ index = 0
+ # Go down until you reach the newest frame:
+ iter_frame = self
+ while iter_frame.newer():
+ index += 1
+ iter_frame = iter_frame.newer()
+ return index
+
+ def is_evalframeex(self):
+ if self._gdbframe.function():
+ if self._gdbframe.function().name == 'PyEval_EvalFrameEx':
+ '''
+ I believe we also need to filter on the inline
+ struct frame_id.inline_depth, only regarding frames with
+ an inline depth of 0 as actually being this function
+
+ So we reject those with type gdb.INLINE_FRAME
+ '''
+ if self._gdbframe.type() == gdb.NORMAL_FRAME:
+ # We have a PyEval_EvalFrameEx frame:
+ return True
+
+ return False
+
+ def get_pyop(self):
try:
- f = gdb_frame.read_var('f')
- return gdb_frame, PyFrameObjectPtr.from_pyobject_ptr(f)
+ f = self._gdbframe.read_var('f')
+ return PyFrameObjectPtr.from_pyobject_ptr(f)
except ValueError:
- gdb_frame = gdb_frame.older()
- return None, None
+ return None
+
+ @classmethod
+ def get_selected_frame(cls):
+ _gdbframe = gdb.selected_frame()
+ if _gdbframe:
+ return Frame(_gdbframe)
+ return None
+
+ @classmethod
+ def get_selected_python_frame(cls):
+ '''Try to obtain the Frame for the python code in the selected
frame,
+ or None'''
+ frame = cls.get_selected_frame()
+
+ while frame:
+ if frame.is_evalframeex():
+ return frame
+ frame = frame.older()
+
+ # Not found:
+ return None
+
+ def print_summary(self):
+ if self.is_evalframeex():
+ pyop = self.get_pyop()
+ if pyop:
+ sys.stdout.write('#%i %s\n' % (self.get_index(),
pyop.get_truncated_repr(MAX_OUTPUT_LEN)))
+ sys.stdout.write(pyop.current_line())
+ else:
+ sys.stdout.write('#%i (unable to read python frame
information)\n' % self.get_index())
+ else:
+ sys.stdout.write('#%i\n' % self.get_index())
class PyList(gdb.Command):
'''List the current Python source code, if any
@@ -829,14 +1221,18 @@ class PyList(gdb.Command):
if m:
start, end = map(int, m.groups())
- gdb_frame, py_frame = get_selected_python_frame()
- if not py_frame:
+ frame = Frame.get_selected_python_frame()
+ if not frame:
print 'Unable to locate python frame'
return
- fi = FrameInfo(py_frame)
- filename = fi.filename()
- lineno = fi.current_line_num()
+ pyop = frame.get_pyop()
+ if not pyop:
+ print 'Unable to read information on python frame'
+ return
+
+ filename = pyop.filename()
+ lineno = pyop.current_line_num()
if start is None:
start = lineno - 5
@@ -851,7 +1247,11 @@ class PyList(gdb.Command):
# so [start-1:end] as a python slice gives us [start, end] as a
# closed interval
for i, line in enumerate(all_lines[start-1:end]):
- sys.stdout.write('%4s %s' % (i+start, line))
+ linestr = str(i+start)
+ # Highlight current line:
+ if i + start == lineno:
+ linestr = '>' + linestr
+ sys.stdout.write('%4s %s' % (linestr, line))
# ...and register the command:
@@ -859,27 +1259,23 @@ PyList()
def move_in_stack(move_up):
'''Move up or down the stack (for the py-up/py-down
command)'''
- gdb_frame, py_frame = get_selected_python_frame()
- while gdb_frame:
+ frame = Frame.get_selected_python_frame()
+ while frame:
if move_up:
- iter_frame = gdb_frame.older()
+ iter_frame = frame.older()
else:
- iter_frame = gdb_frame.newer()
+ iter_frame = frame.newer()
if not iter_frame:
break
- if (iter_frame.function() and
- iter_frame.function().name == 'PyEval_EvalFrameEx'):
+ if iter_frame.is_evalframeex():
# Result:
iter_frame.select()
- py_frame = get_python_frame(iter_frame)
- fi = FrameInfo(py_frame)
- print fi
- sys.stdout.write(fi.current_line())
+ iter_frame.print_summary()
return
- gdb_frame = iter_frame
+ frame = iter_frame
if move_up:
print 'Unable to find an older python frame'
@@ -924,18 +1320,73 @@ class PyBacktrace(gdb.Command):
def invoke(self, args, from_tty):
- gdb_frame, py_frame = get_selected_python_frame()
- while gdb_frame:
- gdb_frame = gdb_frame.older()
+ frame = Frame.get_selected_python_frame()
+ while frame:
+ if frame.is_evalframeex():
+ frame.print_summary()
+ frame = frame.older()
- if not gdb_frame:
- break
+PyBacktrace()
- if (gdb_frame.function() and
- gdb_frame.function().name == 'PyEval_EvalFrameEx'):
- py_frame = get_python_frame(gdb_frame)
- fi = FrameInfo(py_frame)
- print ' ', fi
- sys.stdout.write(fi.current_line())
+class PyPrint(gdb.Command):
+ 'Look up the given python variable name, and print it'
+ def __init__(self):
+ gdb.Command.__init__ (self,
+ "py-print",
+ gdb.COMMAND_DATA,
+ gdb.COMPLETE_NONE)
-PyBacktrace()
+
+ def invoke(self, args, from_tty):
+ name = str(args)
+
+ frame = Frame.get_selected_python_frame()
+ if not frame:
+ print 'Unable to locate python frame'
+ return
+
+ pyop_frame = frame.get_pyop()
+ if not pyop_frame:
+ print 'Unable to read information on python frame'
+ return
+
+ pyop_var, scope = pyop_frame.get_var_by_name(name)
+
+ if pyop_var:
+ print ('%s %r = %s'
+ % (scope,
+ name,
+ pyop_var.get_truncated_repr(MAX_OUTPUT_LEN)))
+ else:
+ print '%r not found' % name
+
+PyPrint()
+
+class PyLocals(gdb.Command):
+ 'Look up the given python variable name, and print it'
+ def __init__(self):
+ gdb.Command.__init__ (self,
+ "py-locals",
+ gdb.COMMAND_DATA,
+ gdb.COMPLETE_NONE)
+
+
+ def invoke(self, args, from_tty):
+ name = str(args)
+
+ frame = Frame.get_selected_python_frame()
+ if not frame:
+ print 'Unable to locate python frame'
+ return
+
+ pyop_frame = frame.get_pyop()
+ if not pyop_frame:
+ print 'Unable to read information on python frame'
+ return
+
+ for pyop_name, pyop_value in pyop_frame.iter_locals():
+ print ('%s = %s'
+ % (pyop_name.proxyval(set()),
+ pyop_value.get_truncated_repr(MAX_OUTPUT_LEN)))
+
+PyLocals()
diff --git a/python.spec b/python.spec
index c041c61..35563ce 100644
--- a/python.spec
+++ b/python.spec
@@ -53,7 +53,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.6.5
-Release: 4%{?dist}
+Release: 5%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -75,7 +75,7 @@ Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
#
# Downloaded from:
#
http://bugs.python.org/issue8032
-# This is Tools/gdb/libpython.py from v4 of the patch
+# This is Tools/gdb/libpython.py from v5 of the patch
Source1: python-gdb.py
# Work around bug 562906 until it's fixed in rpm-build by providing a fixed
@@ -954,6 +954,10 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Wed Mar 31 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-5
+- update python-gdb.py from v4 to v5 (improving performance and stability,
+adding commands)
+
* Thu Mar 25 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-4
- update python-gdb.py from v3 to v4 (fixing infinite recursion on reference
cycles and tracebacks on bytes 0x80-0xff in strings, adding handlers for sets
commit 50d7a9abea997f89fd36300d6999aa6619f6955a
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Thu Mar 25 20:35:17 2010 +0000
update python-gdb.py from v3 to v4 (fixing infinite recursion on reference
cycles and tracebacks on bytes 0x80-0xff in strings, adding handlers
for sets and exceptions)
diff --git a/python-gdb.py b/python-gdb.py
index 204dde3..44099a9 100644
--- a/python-gdb.py
+++ b/python-gdb.py
@@ -35,6 +35,7 @@ import gdb
# Look up the gdb.Type for some standard types:
_type_char_ptr = gdb.lookup_type('char').pointer() # char*
+_type_unsigned_char_ptr = gdb.lookup_type('unsigned char').pointer() # unsigned
char*
_type_void_ptr = gdb.lookup_type('void').pointer() # void*
_type_size_t = gdb.lookup_type('size_t')
@@ -140,7 +141,7 @@ class PyObjectPtr(object):
# Can't even read the object at all?
return 'unknown'
- def proxyval(self):
+ def proxyval(self, visited):
'''
Scrape a value from the inferior process, and try to represent it
within the gdb process, whilst (hopefully) avoiding crashes when
@@ -150,6 +151,11 @@ class PyObjectPtr(object):
For example, a PyIntObject* with ob_ival 42 in the inferior process
should result in an int(42) in this process.
+
+ visited: a set of all gdb.Value pyobject pointers already visited
+ whilst generating this value (to guard against infinite recursion when
+ visiting object graphs with loops). Analogous to Py_ReprEnter and
+ Py_ReprLeave
'''
class FakeRepr(object):
@@ -209,6 +215,8 @@ class PyObjectPtr(object):
'instance': PyInstanceObjectPtr,
'NoneType': PyNoneStructPtr,
'frame': PyFrameObjectPtr,
+ 'set' : PySetObjectPtr,
+ 'frozenset' : PySetObjectPtr,
}
if tp_name in name_map:
return name_map[tp_name]
@@ -230,8 +238,8 @@ class PyObjectPtr(object):
return PyUnicodeObjectPtr
if tp_flags & Py_TPFLAGS_DICT_SUBCLASS:
return PyDictObjectPtr
- #if tp_flags & Py_TPFLAGS_BASE_EXC_SUBCLASS:
- # return something
+ if tp_flags & Py_TPFLAGS_BASE_EXC_SUBCLASS:
+ return PyBaseExceptionObjectPtr
#if tp_flags & Py_TPFLAGS_TYPE_SUBCLASS:
# return PyTypeObjectPtr
@@ -258,6 +266,22 @@ class PyObjectPtr(object):
def get_gdb_type(cls):
return gdb.lookup_type(cls._typename).pointer()
+ def as_address(self):
+ return long(self._gdbval)
+
+
+class ProxyAlreadyVisited(object):
+ '''
+ Placeholder proxy to use when protecting against infinite recursion due to
+ loops in the object graph.
+
+ Analogous to the values emitted by the users of Py_ReprEnter and Py_ReprLeave
+ '''
+ def __init__(self, rep):
+ self._rep = rep
+
+ def __repr__(self):
+ return self._rep
class InstanceProxy(object):
@@ -287,15 +311,19 @@ def _PyObject_VAR_SIZE(typeobj, nitems):
class HeapTypeObjectPtr(PyObjectPtr):
_typename = 'PyObject'
- def proxyval(self):
+ def proxyval(self, visited):
'''
Support for new-style classes.
Currently we just locate the dictionary using a transliteration to
python of _PyObject_GetDictPtr, ignoring descriptors
'''
- attr_dict = {}
+ # Guard against infinite loops:
+ if self.as_address() in visited:
+ return ProxyAlreadyVisited('<...>')
+ visited.add(self.as_address())
+ attr_dict = {}
try:
typeobj = self.type()
dictoffset = int_from_int(typeobj.field('tp_dictoffset'))
@@ -313,16 +341,39 @@ class HeapTypeObjectPtr(PyObjectPtr):
dictptr = self._gdbval.cast(_type_char_ptr) + dictoffset
PyObjectPtrPtr = PyObjectPtr.get_gdb_type().pointer()
dictptr = dictptr.cast(PyObjectPtrPtr)
- attr_dict =
PyObjectPtr.from_pyobject_ptr(dictptr.dereference()).proxyval()
+ attr_dict =
PyObjectPtr.from_pyobject_ptr(dictptr.dereference()).proxyval(visited)
except RuntimeError:
# Corrupt data somewhere; fail safe
- pass
+ pass
tp_name = self.safe_tp_name()
# New-style class:
return InstanceProxy(tp_name, attr_dict, long(self._gdbval))
+class ProxyException(Exception):
+ def __init__(self, tp_name, args):
+ self.tp_name = tp_name
+ self.args = args
+
+ def __repr__(self):
+ return '%s%r' % (self.tp_name, self.args)
+
+class PyBaseExceptionObjectPtr(PyObjectPtr):
+ """
+ Class wrapping a gdb.Value that's a PyBaseExceptionObject* i.e. an exception
+ within the process being debugged.
+ """
+ _typename = 'PyBaseExceptionObject'
+
+ def proxyval(self, visited):
+ # Guard against infinite loops:
+ if self.as_address() in visited:
+ return ProxyAlreadyVisited('(...)')
+ visited.add(self.as_address())
+ arg_proxy =
PyObjectPtr.from_pyobject_ptr(self.field('args')).proxyval(visited)
+ return ProxyException(self.safe_tp_name(),
+ arg_proxy)
class PyBoolObjectPtr(PyObjectPtr):
"""
@@ -331,7 +382,7 @@ class PyBoolObjectPtr(PyObjectPtr):
"""
_typename = 'PyBoolObject'
- def proxyval(self):
+ def proxyval(self, visited):
if int_from_int(self.field('ob_ival')):
return True
else:
@@ -360,7 +411,7 @@ class PyCodeObjectPtr(PyObjectPtr):
Analogous to PyCode_Addr2Line; translated from pseudocode in
Objects/lnotab_notes.txt
'''
- co_lnotab =
PyObjectPtr.from_pyobject_ptr(self.field('co_lnotab')).proxyval()
+ co_lnotab =
PyObjectPtr.from_pyobject_ptr(self.field('co_lnotab')).proxyval(set())
# Initialize lineno to co_firstlineno as per PyCode_Addr2Line
# not 0, as lnotab_notes.txt has it:
@@ -381,27 +432,37 @@ class PyDictObjectPtr(PyObjectPtr):
"""
_typename = 'PyDictObject'
- def proxyval(self):
+ def proxyval(self, visited):
+ # Guard against infinite loops:
+ if self.as_address() in visited:
+ return ProxyAlreadyVisited('{...}')
+ visited.add(self.as_address())
+
result = {}
for i in safe_range(self.field('ma_mask') + 1):
ep = self.field('ma_table') + i
pvalue = PyObjectPtr.from_pyobject_ptr(ep['me_value'])
if not pvalue.is_null():
pkey = PyObjectPtr.from_pyobject_ptr(ep['me_key'])
- result[pkey.proxyval()] = pvalue.proxyval()
+ result[pkey.proxyval(visited)] = pvalue.proxyval(visited)
return result
class PyInstanceObjectPtr(PyObjectPtr):
_typename = 'PyInstanceObject'
- def proxyval(self):
+ def proxyval(self, visited):
+ # Guard against infinite loops:
+ if self.as_address() in visited:
+ return ProxyAlreadyVisited('<...>')
+ visited.add(self.as_address())
+
# Get name of class:
in_class = PyObjectPtr.from_pyobject_ptr(self.field('in_class'))
- cl_name =
PyObjectPtr.from_pyobject_ptr(in_class.field('cl_name')).proxyval()
+ cl_name =
PyObjectPtr.from_pyobject_ptr(in_class.field('cl_name')).proxyval(visited)
# Get dictionary of instance attributes:
- in_dict =
PyObjectPtr.from_pyobject_ptr(self.field('in_dict')).proxyval()
+ in_dict =
PyObjectPtr.from_pyobject_ptr(self.field('in_dict')).proxyval(visited)
# Old-style class:
return InstanceProxy(cl_name, in_dict, long(self._gdbval))
@@ -410,11 +471,10 @@ class PyInstanceObjectPtr(PyObjectPtr):
class PyIntObjectPtr(PyObjectPtr):
_typename = 'PyIntObject'
- def proxyval(self):
+ def proxyval(self, visited):
result = int_from_int(self.field('ob_ival'))
return result
-
class PyListObjectPtr(PyObjectPtr):
_typename = 'PyListObject'
@@ -423,8 +483,13 @@ class PyListObjectPtr(PyObjectPtr):
field_ob_item = self.field('ob_item')
return field_ob_item[i]
- def proxyval(self):
- result = [PyObjectPtr.from_pyobject_ptr(self[i]).proxyval()
+ def proxyval(self, visited):
+ # Guard against infinite loops:
+ if self.as_address() in visited:
+ return ProxyAlreadyVisited('[...]')
+ visited.add(self.as_address())
+
+ result = [PyObjectPtr.from_pyobject_ptr(self[i]).proxyval(visited)
for i in safe_range(int_from_int(self.field('ob_size')))]
return result
@@ -432,7 +497,7 @@ class PyListObjectPtr(PyObjectPtr):
class PyLongObjectPtr(PyObjectPtr):
_typename = 'PyLongObject'
- def proxyval(self):
+ def proxyval(self, visited):
'''
Python's Include/longobjrep.h has this declaration:
struct _longobject {
@@ -477,7 +542,7 @@ class PyNoneStructPtr(PyObjectPtr):
"""
_typename = 'PyObject'
- def proxyval(self):
+ def proxyval(self, visited):
return None
@@ -489,16 +554,39 @@ class PyFrameObjectPtr(PyObjectPtr):
return str(fi)
+class PySetObjectPtr(PyObjectPtr):
+ _typename = 'PySetObject'
+
+ def proxyval(self, visited):
+ # Guard against infinite loops:
+ if self.as_address() in visited:
+ return ProxyAlreadyVisited('%s(...)' % self.safe_tp_name())
+ visited.add(self.as_address())
+
+ members = []
+ table = self.field('table')
+ for i in safe_range(self.field('mask')+1):
+ setentry = table[i]
+ key = setentry['key']
+ if key != 0:
+ key_proxy = PyObjectPtr.from_pyobject_ptr(key).proxyval(visited)
+ if key_proxy != '<dummy key>':
+ members.append(key_proxy)
+ if self.safe_tp_name() == 'frozenset':
+ return frozenset(members)
+ else:
+ return set(members)
+
class PyStringObjectPtr(PyObjectPtr):
_typename = 'PyStringObject'
def __str__(self):
field_ob_size = self.field('ob_size')
field_ob_sval = self.field('ob_sval')
- char_ptr = field_ob_sval.address.cast(_type_char_ptr)
- return ''.join([chr(field_ob_sval[i]) for i in
safe_range(field_ob_size)])
+ char_ptr = field_ob_sval.address.cast(_type_unsigned_char_ptr)
+ return ''.join([chr(char_ptr[i]) for i in safe_range(field_ob_size)])
- def proxyval(self):
+ def proxyval(self, visited):
return str(self)
@@ -510,8 +598,13 @@ class PyTupleObjectPtr(PyObjectPtr):
field_ob_item = self.field('ob_item')
return field_ob_item[i]
- def proxyval(self):
- result = tuple([PyObjectPtr.from_pyobject_ptr(self[i]).proxyval()
+ def proxyval(self, visited):
+ # Guard against infinite loops:
+ if self.as_address() in visited:
+ return ProxyAlreadyVisited('(...)')
+ visited.add(self.as_address())
+
+ result = tuple([PyObjectPtr.from_pyobject_ptr(self[i]).proxyval(visited)
for i in
safe_range(int_from_int(self.field('ob_size')))])
return result
@@ -523,7 +616,7 @@ class PyTypeObjectPtr(PyObjectPtr):
class PyUnicodeObjectPtr(PyObjectPtr):
_typename = 'PyUnicodeObject'
- def proxyval(self):
+ def proxyval(self, visited):
# From unicodeobject.h:
# Py_ssize_t length; /* Length of raw Unicode data in buffer */
# Py_UNICODE *str; /* Raw Unicode buffer */
@@ -576,13 +669,13 @@ class FrameInfo:
if not value.is_null():
name = PyObjectPtr.from_pyobject_ptr(self.co_varnames[i])
#print 'name=%s' % name
- value = value.proxyval()
+ value = value.proxyval(set())
#print 'value=%s' % value
self.locals.append((str(name), value))
def filename(self):
'''Get the path of the current Python source file, as a
string'''
- return self.co_filename.proxyval()
+ return self.co_filename.proxyval(set())
def current_line_num(self):
'''Get current line number as an integer (1-based)
@@ -626,7 +719,7 @@ class PyObjectPtrPrinter:
self.gdbval = gdbval
def to_string (self):
- proxyval = PyObjectPtr.from_pyobject_ptr(self.gdbval).proxyval()
+ proxyval = PyObjectPtr.from_pyobject_ptr(self.gdbval).proxyval(set())
return stringify(proxyval)
diff --git a/python.spec b/python.spec
index 05b6376..c041c61 100644
--- a/python.spec
+++ b/python.spec
@@ -53,7 +53,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.6.5
-Release: 3%{?dist}
+Release: 4%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -75,7 +75,7 @@ Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
#
# Downloaded from:
#
http://bugs.python.org/issue8032
-# This is Tools/gdb/libpython.py from v3 of the patch
+# This is Tools/gdb/libpython.py from v4 of the patch
Source1: python-gdb.py
# Work around bug 562906 until it's fixed in rpm-build by providing a fixed
@@ -954,6 +954,11 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Thu Mar 25 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-4
+- update python-gdb.py from v3 to v4 (fixing infinite recursion on reference
+cycles and tracebacks on bytes 0x80-0xff in strings, adding handlers for sets
+and exceptions)
+
* Wed Mar 24 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-3
- refresh gdb hooks to v3 (reworking how they are packaged)
commit 461494a51c720226ebe320202d9b7379d9b18762
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Wed Mar 24 18:30:06 2010 +0000
- refresh gdb hooks to v3 (reworking how they are packaged)
diff --git a/libpython-36a517ef7848cbd0b3dcc7371f32e47ac4c87eba.tar.gz
b/libpython-36a517ef7848cbd0b3dcc7371f32e47ac4c87eba.tar.gz
deleted file mode 100644
index 3e0959e..0000000
Binary files a/libpython-36a517ef7848cbd0b3dcc7371f32e47ac4c87eba.tar.gz and /dev/null
differ
diff --git a/python-gdb.py b/python-gdb.py
new file mode 100644
index 0000000..204dde3
--- /dev/null
+++ b/python-gdb.py
@@ -0,0 +1,848 @@
+#!/usr/bin/python
+'''
+From gdb 7 onwards, gdb's build can be configured --with-python, allowing gdb
+to be extended with Python code e.g. for library-specific data visualizations,
+such as for the C++ STL types. Documentation on this API can be seen at:
+http://sourceware.org/gdb/current/onlinedocs/gdb/Python-API.html
+
+
+This python module deals with the case when the process being debugged (the
+"inferior process" in gdb parlance) is itself python, or more specifically,
+linked against libpython. In this situation, almost every item of data is a
+(PyObject*), and having the debugger merely print their addresses is not very
+enlightening.
+
+This module embeds knowledge about the implementation details of libpython so
+that we can emit useful visualizations e.g. a string, a list, a dict, a frame
+giving file/line information and the state of local variables
+
+In particular, given a gdb.Value corresponding to a PyObject* in the inferior
+process, we can generate a "proxy value" within the gdb process. For example,
+given a PyObject* in the inferior process that is in fact a PyListObject*
+holding three PyObject* that turn out to be PyStringObject* instances, we can
+generate a proxy value within the gdb process that is a list of strings:
+ ["foo", "bar", "baz"]
+
+We try to defer gdb.lookup_type() invocations for python types until as late as
+possible: for a dynamically linked python binary, when the process starts in
+the debugger, the libpython.so hasn't been dynamically loaded yet, so none of
+the type names are known to the debugger
+
+The module also extends gdb with some python-specific commands.
+'''
+
+import gdb
+
+# Look up the gdb.Type for some standard types:
+_type_char_ptr = gdb.lookup_type('char').pointer() # char*
+_type_void_ptr = gdb.lookup_type('void').pointer() # void*
+_type_size_t = gdb.lookup_type('size_t')
+
+SIZEOF_VOID_P = _type_void_ptr.sizeof
+
+
+Py_TPFLAGS_HEAPTYPE = (1L << 9)
+
+Py_TPFLAGS_INT_SUBCLASS = (1L << 23)
+Py_TPFLAGS_LONG_SUBCLASS = (1L << 24)
+Py_TPFLAGS_LIST_SUBCLASS = (1L << 25)
+Py_TPFLAGS_TUPLE_SUBCLASS = (1L << 26)
+Py_TPFLAGS_STRING_SUBCLASS = (1L << 27)
+Py_TPFLAGS_UNICODE_SUBCLASS = (1L << 28)
+Py_TPFLAGS_DICT_SUBCLASS = (1L << 29)
+Py_TPFLAGS_BASE_EXC_SUBCLASS = (1L << 30)
+Py_TPFLAGS_TYPE_SUBCLASS = (1L << 31)
+
+
+class NullPyObjectPtr(RuntimeError):
+ pass
+
+
+def safety_limit(val):
+ # Given a integer value from the process being debugged, limit it to some
+ # safety threshold so that arbitrary breakage within said process doesn't
+ # break the gdb process too much (e.g. sizes of iterations, sizes of lists)
+ return min(val, 100)
+
+
+def safe_range(val):
+ # As per range, but don't trust the value too much: cap it to a safety
+ # threshold in case the data was corrupted
+ return xrange(safety_limit(val))
+
+
+class PyObjectPtr(object):
+ """
+ Class wrapping a gdb.Value that's a either a (PyObject*) within the
+ inferior process, or some subclass pointer e.g. (PyStringObject*)
+
+ There will be a subclass for every refined PyObject type that we care
+ about.
+
+ Note that at every stage the underlying pointer could be NULL, point
+ to corrupt data, etc; this is the debugger, after all.
+ """
+ _typename = 'PyObject'
+
+ def __init__(self, gdbval, cast_to=None):
+ if cast_to:
+ self._gdbval = gdbval.cast(cast_to)
+ else:
+ self._gdbval = gdbval
+
+ def field(self, name):
+ '''
+ Get the gdb.Value for the given field within the PyObject, coping with
+ some python 2 versus python 3 differences.
+
+ Various libpython types are defined using the "PyObject_HEAD" and
+ "PyObject_VAR_HEAD" macros.
+
+ In Python 2, this these are defined so that "ob_type" and (for a var
+ object) "ob_size" are fields of the type in question.
+
+ In Python 3, this is defined as an embedded PyVarObject type thus:
+ PyVarObject ob_base;
+ so that the "ob_size" field is located insize the "ob_base"
field, and
+ the "ob_type" is most easily accessed by casting back to a
(PyObject*).
+ '''
+ if self.is_null():
+ raise NullPyObjectPtr(self)
+
+ if name == 'ob_type':
+ pyo_ptr = self._gdbval.cast(PyObjectPtr.get_gdb_type())
+ return pyo_ptr.dereference()[name]
+
+ if name == 'ob_size':
+ try:
+ # Python 2:
+ return self._gdbval.dereference()[name]
+ except RuntimeError:
+ # Python 3:
+ return self._gdbval.dereference()['ob_base'][name]
+
+ # General case: look it up inside the object:
+ return self._gdbval.dereference()[name]
+
+ def type(self):
+ return PyTypeObjectPtr(self.field('ob_type'))
+
+ def is_null(self):
+ return 0 == long(self._gdbval)
+
+ def safe_tp_name(self):
+ try:
+ return self.type().field('tp_name').string()
+ except NullPyObjectPtr:
+ # NULL tp_name?
+ return 'unknown'
+ except RuntimeError:
+ # Can't even read the object at all?
+ return 'unknown'
+
+ def proxyval(self):
+ '''
+ Scrape a value from the inferior process, and try to represent it
+ within the gdb process, whilst (hopefully) avoiding crashes when
+ the remote data is corrupt.
+
+ Derived classes will override this.
+
+ For example, a PyIntObject* with ob_ival 42 in the inferior process
+ should result in an int(42) in this process.
+ '''
+
+ class FakeRepr(object):
+ """
+ Class representing a non-descript PyObject* value in the inferior
+ process for when we don't have a custom scraper, intended to have
+ a sane repr().
+ """
+
+ def __init__(self, tp_name, address):
+ self.tp_name = tp_name
+ self.address = address
+
+ def __repr__(self):
+ # For the NULL pointer, we have no way of knowing a type, so
+ # special-case it as per
+ #
http://bugs.python.org/issue8032#msg100882
+ if self.address == 0:
+ return '0x0'
+ return '<%s at remote 0x%x>' % (self.tp_name,
self.address)
+
+ return FakeRepr(self.safe_tp_name(),
+ long(self._gdbval))
+
+ @classmethod
+ def subclass_from_type(cls, t):
+ '''
+ Given a PyTypeObjectPtr instance wrapping a gdb.Value that's a
+ (PyTypeObject*), determine the corresponding subclass of PyObjectPtr
+ to use
+
+ Ideally, we would look up the symbols for the global types, but that
+ isn't working yet:
+ (gdb) python print gdb.lookup_symbol('PyList_Type')[0].value
+ Traceback (most recent call last):
+ File "<string>", line 1, in <module>
+ NotImplementedError: Symbol type not yet supported in Python scripts.
+ Error while executing Python code.
+
+ For now, we use tp_flags, after doing some string comparisons on the
+ tp_name for some special-cases that don't seem to be visible through
+ flags
+ '''
+ try:
+ tp_name = t.field('tp_name').string()
+ tp_flags = int(t.field('tp_flags'))
+ except RuntimeError:
+ # Handle any kind of error e.g. NULL ptrs by simply using the base
+ # class
+ return cls
+
+ #print 'tp_flags = 0x%08x' % tp_flags
+ #print 'tp_name = %r' % tp_name
+
+ name_map = {'bool': PyBoolObjectPtr,
+ 'classobj': PyClassObjectPtr,
+ 'instance': PyInstanceObjectPtr,
+ 'NoneType': PyNoneStructPtr,
+ 'frame': PyFrameObjectPtr,
+ }
+ if tp_name in name_map:
+ return name_map[tp_name]
+
+ if tp_flags & Py_TPFLAGS_HEAPTYPE:
+ return HeapTypeObjectPtr
+
+ if tp_flags & Py_TPFLAGS_INT_SUBCLASS:
+ return PyIntObjectPtr
+ if tp_flags & Py_TPFLAGS_LONG_SUBCLASS:
+ return PyLongObjectPtr
+ if tp_flags & Py_TPFLAGS_LIST_SUBCLASS:
+ return PyListObjectPtr
+ if tp_flags & Py_TPFLAGS_TUPLE_SUBCLASS:
+ return PyTupleObjectPtr
+ if tp_flags & Py_TPFLAGS_STRING_SUBCLASS:
+ return PyStringObjectPtr
+ if tp_flags & Py_TPFLAGS_UNICODE_SUBCLASS:
+ return PyUnicodeObjectPtr
+ if tp_flags & Py_TPFLAGS_DICT_SUBCLASS:
+ return PyDictObjectPtr
+ #if tp_flags & Py_TPFLAGS_BASE_EXC_SUBCLASS:
+ # return something
+ #if tp_flags & Py_TPFLAGS_TYPE_SUBCLASS:
+ # return PyTypeObjectPtr
+
+ # Use the base class:
+ return cls
+
+ @classmethod
+ def from_pyobject_ptr(cls, gdbval):
+ '''
+ Try to locate the appropriate derived class dynamically, and cast
+ the pointer accordingly.
+ '''
+ try:
+ p = PyObjectPtr(gdbval)
+ cls = cls.subclass_from_type(p.type())
+ return cls(gdbval, cast_to=cls.get_gdb_type())
+ except RuntimeError:
+ # Handle any kind of error e.g. NULL ptrs by simply using the base
+ # class
+ pass
+ return cls(gdbval)
+
+ @classmethod
+ def get_gdb_type(cls):
+ return gdb.lookup_type(cls._typename).pointer()
+
+
+class InstanceProxy(object):
+
+ def __init__(self, cl_name, attrdict, address):
+ self.cl_name = cl_name
+ self.attrdict = attrdict
+ self.address = address
+
+ def __repr__(self):
+ if isinstance(self.attrdict, dict):
+ kwargs = ', '.join(["%s=%r" % (arg, val)
+ for arg, val in self.attrdict.iteritems()])
+ return '<%s(%s) at remote 0x%x>' % (self.cl_name,
+ kwargs, self.address)
+ else:
+ return '<%s at remote 0x%x>' % (self.cl_name,
+ self.address)
+
+
+def _PyObject_VAR_SIZE(typeobj, nitems):
+ return ( ( typeobj.field('tp_basicsize') +
+ nitems * typeobj.field('tp_itemsize') +
+ (SIZEOF_VOID_P - 1)
+ ) & ~(SIZEOF_VOID_P - 1)
+ ).cast(_type_size_t)
+
+class HeapTypeObjectPtr(PyObjectPtr):
+ _typename = 'PyObject'
+
+ def proxyval(self):
+ '''
+ Support for new-style classes.
+
+ Currently we just locate the dictionary using a transliteration to
+ python of _PyObject_GetDictPtr, ignoring descriptors
+ '''
+ attr_dict = {}
+
+ try:
+ typeobj = self.type()
+ dictoffset = int_from_int(typeobj.field('tp_dictoffset'))
+ if dictoffset != 0:
+ if dictoffset < 0:
+ type_PyVarObject_ptr =
gdb.lookup_type('PyVarObject').pointer()
+ tsize =
int_from_int(self._gdbval.cast(type_PyVarObject_ptr)['ob_size'])
+ if tsize < 0:
+ tsize = -tsize
+ size = _PyObject_VAR_SIZE(typeobj, tsize)
+ dictoffset += size
+ assert dictoffset > 0
+ assert dictoffset % SIZEOF_VOID_P == 0
+
+ dictptr = self._gdbval.cast(_type_char_ptr) + dictoffset
+ PyObjectPtrPtr = PyObjectPtr.get_gdb_type().pointer()
+ dictptr = dictptr.cast(PyObjectPtrPtr)
+ attr_dict =
PyObjectPtr.from_pyobject_ptr(dictptr.dereference()).proxyval()
+ except RuntimeError:
+ # Corrupt data somewhere; fail safe
+ pass
+
+ tp_name = self.safe_tp_name()
+
+ # New-style class:
+ return InstanceProxy(tp_name, attr_dict, long(self._gdbval))
+
+
+class PyBoolObjectPtr(PyObjectPtr):
+ """
+ Class wrapping a gdb.Value that's a PyBoolObject* i.e. one of the two
+ <bool> instances (Py_True/Py_False) within the process being debugged.
+ """
+ _typename = 'PyBoolObject'
+
+ def proxyval(self):
+ if int_from_int(self.field('ob_ival')):
+ return True
+ else:
+ return False
+
+
+class PyClassObjectPtr(PyObjectPtr):
+ """
+ Class wrapping a gdb.Value that's a PyClassObject* i.e. a <classobj>
+ instance within the process being debugged.
+ """
+ _typename = 'PyClassObject'
+
+
+class PyCodeObjectPtr(PyObjectPtr):
+ """
+ Class wrapping a gdb.Value that's a PyCodeObject* i.e. a <code> instance
+ within the process being debugged.
+ """
+ _typename = 'PyCodeObject'
+
+ def addr2line(self, addrq):
+ '''
+ Get the line number for a given bytecode offset
+
+ Analogous to PyCode_Addr2Line; translated from pseudocode in
+ Objects/lnotab_notes.txt
+ '''
+ co_lnotab =
PyObjectPtr.from_pyobject_ptr(self.field('co_lnotab')).proxyval()
+
+ # Initialize lineno to co_firstlineno as per PyCode_Addr2Line
+ # not 0, as lnotab_notes.txt has it:
+ lineno = int_from_int(self.field('co_firstlineno'))
+
+ addr = 0
+ for addr_incr, line_incr in zip(co_lnotab[::2], co_lnotab[1::2]):
+ addr += ord(addr_incr)
+ if addr > addrq:
+ return lineno
+ lineno += ord(line_incr)
+ return lineno
+
+class PyDictObjectPtr(PyObjectPtr):
+ """
+ Class wrapping a gdb.Value that's a PyDictObject* i.e. a dict instance
+ within the process being debugged.
+ """
+ _typename = 'PyDictObject'
+
+ def proxyval(self):
+ result = {}
+ for i in safe_range(self.field('ma_mask') + 1):
+ ep = self.field('ma_table') + i
+ pvalue = PyObjectPtr.from_pyobject_ptr(ep['me_value'])
+ if not pvalue.is_null():
+ pkey = PyObjectPtr.from_pyobject_ptr(ep['me_key'])
+ result[pkey.proxyval()] = pvalue.proxyval()
+ return result
+
+
+class PyInstanceObjectPtr(PyObjectPtr):
+ _typename = 'PyInstanceObject'
+
+ def proxyval(self):
+ # Get name of class:
+ in_class = PyObjectPtr.from_pyobject_ptr(self.field('in_class'))
+ cl_name =
PyObjectPtr.from_pyobject_ptr(in_class.field('cl_name')).proxyval()
+
+ # Get dictionary of instance attributes:
+ in_dict =
PyObjectPtr.from_pyobject_ptr(self.field('in_dict')).proxyval()
+
+ # Old-style class:
+ return InstanceProxy(cl_name, in_dict, long(self._gdbval))
+
+
+class PyIntObjectPtr(PyObjectPtr):
+ _typename = 'PyIntObject'
+
+ def proxyval(self):
+ result = int_from_int(self.field('ob_ival'))
+ return result
+
+
+class PyListObjectPtr(PyObjectPtr):
+ _typename = 'PyListObject'
+
+ def __getitem__(self, i):
+ # Get the gdb.Value for the (PyObject*) with the given index:
+ field_ob_item = self.field('ob_item')
+ return field_ob_item[i]
+
+ def proxyval(self):
+ result = [PyObjectPtr.from_pyobject_ptr(self[i]).proxyval()
+ for i in safe_range(int_from_int(self.field('ob_size')))]
+ return result
+
+
+class PyLongObjectPtr(PyObjectPtr):
+ _typename = 'PyLongObject'
+
+ def proxyval(self):
+ '''
+ Python's Include/longobjrep.h has this declaration:
+ struct _longobject {
+ PyObject_VAR_HEAD
+ digit ob_digit[1];
+ };
+
+ with this description:
+ The absolute value of a number is equal to
+ SUM(for i=0 through abs(ob_size)-1) ob_digit[i] * 2**(SHIFT*i)
+ Negative numbers are represented with ob_size < 0;
+ zero is represented by ob_size == 0.
+
+ where SHIFT can be either:
+ #define PyLong_SHIFT 30
+ #define PyLong_SHIFT 15
+ '''
+ ob_size = long(self.field('ob_size'))
+ if ob_size == 0:
+ return 0L
+
+ ob_digit = self.field('ob_digit')
+
+ if gdb.lookup_type('digit').sizeof == 2:
+ SHIFT = 15L
+ else:
+ # FIXME: I haven't yet tested this case
+ SHIFT = 30L
+
+ digits = [long(ob_digit[i]) * 2**(SHIFT*i)
+ for i in safe_range(abs(ob_size))]
+ result = sum(digits)
+ if ob_size < 0:
+ result = -result
+ return result
+
+
+class PyNoneStructPtr(PyObjectPtr):
+ """
+ Class wrapping a gdb.Value that's a PyObject* pointing to the
+ singleton (we hope) _Py_NoneStruct with ob_type PyNone_Type
+ """
+ _typename = 'PyObject'
+
+ def proxyval(self):
+ return None
+
+
+class PyFrameObjectPtr(PyObjectPtr):
+ _typename = 'PyFrameObject'
+
+ def __str__(self):
+ fi = FrameInfo(self)
+ return str(fi)
+
+
+class PyStringObjectPtr(PyObjectPtr):
+ _typename = 'PyStringObject'
+
+ def __str__(self):
+ field_ob_size = self.field('ob_size')
+ field_ob_sval = self.field('ob_sval')
+ char_ptr = field_ob_sval.address.cast(_type_char_ptr)
+ return ''.join([chr(field_ob_sval[i]) for i in
safe_range(field_ob_size)])
+
+ def proxyval(self):
+ return str(self)
+
+
+class PyTupleObjectPtr(PyObjectPtr):
+ _typename = 'PyTupleObject'
+
+ def __getitem__(self, i):
+ # Get the gdb.Value for the (PyObject*) with the given index:
+ field_ob_item = self.field('ob_item')
+ return field_ob_item[i]
+
+ def proxyval(self):
+ result = tuple([PyObjectPtr.from_pyobject_ptr(self[i]).proxyval()
+ for i in
safe_range(int_from_int(self.field('ob_size')))])
+ return result
+
+
+class PyTypeObjectPtr(PyObjectPtr):
+ _typename = 'PyTypeObject'
+
+
+class PyUnicodeObjectPtr(PyObjectPtr):
+ _typename = 'PyUnicodeObject'
+
+ def proxyval(self):
+ # From unicodeobject.h:
+ # Py_ssize_t length; /* Length of raw Unicode data in buffer */
+ # Py_UNICODE *str; /* Raw Unicode buffer */
+ field_length = long(self.field('length'))
+ field_str = self.field('str')
+
+ # Gather a list of ints from the Py_UNICODE array; these are either
+ # UCS-2 or UCS-4 code points:
+ Py_UNICODEs = [int(field_str[i]) for i in safe_range(field_length)]
+
+ # Convert the int code points to unicode characters, and generate a
+ # local unicode instance:
+ result = u''.join([unichr(ucs) for ucs in Py_UNICODEs])
+ return result
+
+
+def int_from_int(gdbval):
+ return int(str(gdbval))
+
+
+def stringify(val):
+ # TODO: repr() puts everything on one line; pformat can be nicer, but
+ # can lead to v.long results; this function isolates the choice
+ if True:
+ return repr(val)
+ else:
+ from pprint import pformat
+ return pformat(val)
+
+
+class FrameInfo:
+ '''
+ Class representing all of the information we can scrape about a
+ PyFrameObject*
+ '''
+ def __init__(self, fval):
+ self.fval = fval
+ self.co = PyCodeObjectPtr.from_pyobject_ptr(fval.field('f_code'))
+ self.co_name = PyObjectPtr.from_pyobject_ptr(self.co.field('co_name'))
+ self.co_filename =
PyObjectPtr.from_pyobject_ptr(self.co.field('co_filename'))
+ self.f_lineno = int_from_int(fval.field('f_lineno'))
+ self.f_lasti = int_from_int(fval.field('f_lasti'))
+ self.co_nlocals = int_from_int(self.co.field('co_nlocals'))
+ self.co_varnames =
PyTupleObjectPtr.from_pyobject_ptr(self.co.field('co_varnames'))
+ self.locals = [] # list of kv pairs
+ f_localsplus = self.fval.field('f_localsplus')
+ for i in safe_range(self.co_nlocals):
+ #print 'i=%i' % i
+ value = PyObjectPtr.from_pyobject_ptr(f_localsplus[i])
+ if not value.is_null():
+ name = PyObjectPtr.from_pyobject_ptr(self.co_varnames[i])
+ #print 'name=%s' % name
+ value = value.proxyval()
+ #print 'value=%s' % value
+ self.locals.append((str(name), value))
+
+ def filename(self):
+ '''Get the path of the current Python source file, as a
string'''
+ return self.co_filename.proxyval()
+
+ def current_line_num(self):
+ '''Get current line number as an integer (1-based)
+
+ Translated from PyFrame_GetLineNumber and PyCode_Addr2Line
+
+ See Objects/lnotab_notes.txt
+ '''
+ f_trace = self.fval.field('f_trace')
+ if long(f_trace) != 0:
+ # we have a non-NULL f_trace:
+ return self.f_lineno
+ else:
+ #try:
+ return self.co.addr2line(self.f_lasti)
+ #except ValueError:
+ # return self.f_lineno
+
+ def current_line(self):
+ '''Get the text of the current source line as a string, with a
trailing
+ newline character'''
+ with open(self.filename(), 'r') as f:
+ all_lines = f.readlines()
+ # Convert from 1-based current_line_num to 0-based list offset:
+ return all_lines[self.current_line_num()-1]
+
+ def __str__(self):
+ return ('Frame 0x%x, for file %s, line %i, in %s (%s)'
+ % (long(self.fval._gdbval),
+ self.co_filename,
+ self.current_line_num(),
+ self.co_name,
+ ', '.join(['%s=%s' % (k, stringify(v)) for k, v in
self.locals]))
+ )
+
+
+class PyObjectPtrPrinter:
+ "Prints a (PyObject*)"
+
+ def __init__ (self, gdbval):
+ self.gdbval = gdbval
+
+ def to_string (self):
+ proxyval = PyObjectPtr.from_pyobject_ptr(self.gdbval).proxyval()
+ return stringify(proxyval)
+
+
+class PyFrameObjectPtrPrinter(PyObjectPtrPrinter):
+ "Prints a (PyFrameObject*)"
+
+ def to_string (self):
+ pyop = PyObjectPtr.from_pyobject_ptr(self.gdbval)
+ fi = FrameInfo(pyop)
+ return str(fi)
+
+
+def pretty_printer_lookup(gdbval):
+ type = gdbval.type.unqualified()
+ if type.code == gdb.TYPE_CODE_PTR:
+ type = type.target().unqualified()
+ t = str(type)
+ if t == "PyObject":
+ return PyObjectPtrPrinter(gdbval)
+ elif t == "PyFrameObject":
+ return PyFrameObjectPtrPrinter(gdbval)
+
+
+"""
+During development, I've been manually invoking the code in this way:
+(gdb) python
+
+import sys
+sys.path.append('/home/david/coding/python-gdb')
+import libpython
+end
+
+then reloading it after each edit like this:
+(gdb) python reload(libpython)
+
+The following code should ensure that the prettyprinter is registered
+if the code is autoloaded by gdb when visiting libpython.so, provided
+that this python file is installed to the same path as the library (or its
+.debug file) plus a "-gdb.py" suffix, e.g:
+ /usr/lib/libpython2.6.so.1.0-gdb.py
+ /usr/lib/debug/usr/lib/libpython2.6.so.1.0.debug-gdb.py
+"""
+def register (obj):
+ if obj == None:
+ obj = gdb
+
+ # Wire up the pretty-printer
+ obj.pretty_printers.append(pretty_printer_lookup)
+
+register (gdb.current_objfile ())
+
+def get_python_frame(gdb_frame):
+ try:
+ f = gdb_frame.read_var('f')
+ return PyFrameObjectPtr.from_pyobject_ptr(f)
+ except ValueError:
+ return None
+
+def get_selected_python_frame():
+ '''Try to obtain a (gdbframe, PyFrameObjectPtr) pair for the
+ currently-running python code, or (None, None)'''
+ gdb_frame = gdb.selected_frame()
+ while gdb_frame:
+ if (gdb_frame.function() is None or
+ gdb_frame.function().name != 'PyEval_EvalFrameEx'):
+ gdb_frame = gdb_frame.older()
+ continue
+
+ try:
+ f = gdb_frame.read_var('f')
+ return gdb_frame, PyFrameObjectPtr.from_pyobject_ptr(f)
+ except ValueError:
+ gdb_frame = gdb_frame.older()
+ return None, None
+
+class PyList(gdb.Command):
+ '''List the current Python source code, if any
+
+ Use
+ py-list START
+ to list at a different line number within the python source.
+
+ Use
+ py-list START, END
+ to list a specific range of lines within the python source.
+ '''
+
+ def __init__(self):
+ gdb.Command.__init__ (self,
+ "py-list",
+ gdb.COMMAND_FILES,
+ gdb.COMPLETE_NONE)
+
+
+ def invoke(self, args, from_tty):
+ import re
+
+ start = None
+ end = None
+
+ m = re.match(r'\s*(\d+)\s*', args)
+ if m:
+ start = int(m.group(0))
+ end = start + 10
+
+ m = re.match(r'\s*(\d+)\s*,\s*(\d+)\s*', args)
+ if m:
+ start, end = map(int, m.groups())
+
+ gdb_frame, py_frame = get_selected_python_frame()
+ if not py_frame:
+ print 'Unable to locate python frame'
+ return
+
+ fi = FrameInfo(py_frame)
+ filename = fi.filename()
+ lineno = fi.current_line_num()
+
+ if start is None:
+ start = lineno - 5
+ end = lineno + 5
+
+ if start<1:
+ start = 1
+
+ with open(filename, 'r') as f:
+ all_lines = f.readlines()
+ # start and end are 1-based, all_lines is 0-based;
+ # so [start-1:end] as a python slice gives us [start, end] as a
+ # closed interval
+ for i, line in enumerate(all_lines[start-1:end]):
+ sys.stdout.write('%4s %s' % (i+start, line))
+
+
+# ...and register the command:
+PyList()
+
+def move_in_stack(move_up):
+ '''Move up or down the stack (for the py-up/py-down
command)'''
+ gdb_frame, py_frame = get_selected_python_frame()
+ while gdb_frame:
+ if move_up:
+ iter_frame = gdb_frame.older()
+ else:
+ iter_frame = gdb_frame.newer()
+
+ if not iter_frame:
+ break
+
+ if (iter_frame.function() and
+ iter_frame.function().name == 'PyEval_EvalFrameEx'):
+ # Result:
+ iter_frame.select()
+ py_frame = get_python_frame(iter_frame)
+ fi = FrameInfo(py_frame)
+ print fi
+ sys.stdout.write(fi.current_line())
+ return
+
+ gdb_frame = iter_frame
+
+ if move_up:
+ print 'Unable to find an older python frame'
+ else:
+ print 'Unable to find a newer python frame'
+
+class PyUp(gdb.Command):
+ 'Select and print the python stack frame that called this one (if any)'
+ def __init__(self):
+ gdb.Command.__init__ (self,
+ "py-up",
+ gdb.COMMAND_STACK,
+ gdb.COMPLETE_NONE)
+
+
+ def invoke(self, args, from_tty):
+ move_in_stack(move_up=True)
+
+PyUp()
+
+class PyDown(gdb.Command):
+ 'Select and print the python stack frame called by this one (if any)'
+ def __init__(self):
+ gdb.Command.__init__ (self,
+ "py-down",
+ gdb.COMMAND_STACK,
+ gdb.COMPLETE_NONE)
+
+
+ def invoke(self, args, from_tty):
+ move_in_stack(move_up=False)
+
+PyDown()
+
+class PyBacktrace(gdb.Command):
+ 'Display the current python frame and all the frames within its call stack (if
any)'
+ def __init__(self):
+ gdb.Command.__init__ (self,
+ "py-bt",
+ gdb.COMMAND_STACK,
+ gdb.COMPLETE_NONE)
+
+
+ def invoke(self, args, from_tty):
+ gdb_frame, py_frame = get_selected_python_frame()
+ while gdb_frame:
+ gdb_frame = gdb_frame.older()
+
+ if not gdb_frame:
+ break
+
+ if (gdb_frame.function() and
+ gdb_frame.function().name == 'PyEval_EvalFrameEx'):
+ py_frame = get_python_frame(gdb_frame)
+ fi = FrameInfo(py_frame)
+ print ' ', fi
+ sys.stdout.write(fi.current_line())
+
+PyBacktrace()
diff --git a/python.spec b/python.spec
index 3ff90b6..05b6376 100644
--- a/python.spec
+++ b/python.spec
@@ -53,7 +53,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.6.5
-Release: 2%{?dist}
+Release: 3%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -74,9 +74,9 @@ Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
# information
#
# Downloaded from:
-#
http://fedorapeople.org/gitweb?p=dmalcolm/public_git/libpython.git;a=snap...
-Source1: libpython-36a517ef7848cbd0b3dcc7371f32e47ac4c87eba.tar.gz
-
+#
http://bugs.python.org/issue8032
+# This is Tools/gdb/libpython.py from v3 of the patch
+Source1: python-gdb.py
# Work around bug 562906 until it's fixed in rpm-build by providing a fixed
# version of pythondeps.sh:
@@ -434,12 +434,6 @@ code that uses more than just unittest and/or test_support.py.
%prep
%setup -q -n Python-%{version}
-# Unpack source archive 1 into this same dir without deleting (-D; -T suppress
-# trying to unpack source 0 again):
-%if 0%{?with_gdb_hooks}
-%setup -q -n Python-%{version} -T -D -a 1
-%endif # with_gdb_hooks
-
%if 0%{?with_systemtap}
# Provide an example of usage of the tapset:
cp -a %{SOURCE4} .
@@ -715,7 +709,7 @@ ldd %{buildroot}/%{dynload_dir}/_curses*.so \
%global path_of_gdb_py %{dir_holding_gdb_py}/%{py_INSTSONAME}.debug-gdb.py
mkdir -p %{buildroot}%{dir_holding_gdb_py}
-cp libpython/libpython.py %{buildroot}%{path_of_gdb_py}
+cp %{SOURCE1} %{buildroot}%{path_of_gdb_py}
# Manually byte-compile the file, in case find-debuginfo.sh is run before
# brp-python-bytecompile, so that the .pyc/.pyo files are properly listed in
@@ -960,6 +954,9 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Wed Mar 24 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-3
+- refresh gdb hooks to v3 (reworking how they are packaged)
+
* Mon Mar 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-2
- remove unnecessary arch-conditionality for patch 101
commit a95ca83c7155b2208609a2d06266f122f05308d6
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Wed Mar 24 16:04:07 2010 +0000
remove unnecessary arch-conditionality for patch 101
diff --git a/python.spec b/python.spec
index 50c6b6e..3ff90b6 100644
--- a/python.spec
+++ b/python.spec
@@ -53,7 +53,7 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.6.5
-Release: 1%{?dist}
+Release: 2%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -268,6 +268,10 @@ Patch55: python-2.6.4-dtrace.patch
# However, as it stands this patch is merely a copy of:
#
http://svn.python.org/view/python/trunk/Lib/test/test_re.py?r1=35825&...
# which is already upstream
+# Earlier versions of the patch (from the "dist-pkgs" CVS repo within RH)
+# contained additional changes that applied fixes to the internals of the regex
+# module, but these appear to have all been applied as part of
+#
http://bugs.python.org/issue931848
Patch101: python-2.3.4-lib64-regex.patch
# Only used when "%{_lib}" == "lib64"
@@ -468,8 +472,8 @@ rm -r Modules/zlib || exit 1
# Try not disabling egg-infos, bz#414711
#patch50 -p1 -b .egginfo
-%if "%{_lib}" == "lib64"
%patch101 -p1 -b .lib64-regex
+%if "%{_lib}" == "lib64"
%patch102 -p1 -b .lib64
%endif
@@ -488,11 +492,6 @@ rm -r Modules/zlib || exit 1
%patch55 -p1 -b .systemtap
%endif
-%ifarch alpha ia64
-# 64bit, but not lib64 arches need this too...
-%patch101 -p1 -b .lib64-regex
-%endif
-
%patch110 -p1 -b .selinux
%patch111 -p1 -b .no-static-lib
@@ -961,6 +960,9 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Mon Mar 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-2
+- remove unnecessary arch-conditionality for patch 101
+
* Fri Mar 19 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-1
- update to 2.6.5:
http://www.python.org/download/releases/2.6.5/
- replace our patch to compile against db4.8 with a patch from
commit 71fe1b9eb36037e30b90249d132e44c718f3fea0
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Sat Mar 20 15:27:45 2010 +0000
Add reminder to rebase python-docs when rebasing python
diff --git a/python.spec b/python.spec
index 0b893d9..50c6b6e 100644
--- a/python.spec
+++ b/python.spec
@@ -51,6 +51,7 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
+# Remember to also rebase python-docs when changing this:
Version: 2.6.5
Release: 1%{?dist}
License: Python
commit 912b4112f7c009114c8d263501472237126a76fd
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Sat Mar 20 04:12:53 2010 +0000
- update to 2.6.5:
http://www.python.org/download/releases/2.6.5/
- replace our patch to compile against db4.8 with a patch from upstream
(patch 53, from r78974); update patch 54 since part of it is now in
that upstream patch
- update patch 110 so that it still applies in the face of upstream r78380
diff --git a/.cvsignore b/.cvsignore
index d7ad69d..19932b2 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -1 +1 @@
-Python-2.6.4.tar.bz2
+Python-2.6.5.tar.bz2
diff --git a/python-2.6-ctypes-noexecmem.patch b/python-2.6-ctypes-noexecmem.patch
index 9ce5c0b..8d2890e 100644
--- a/python-2.6-ctypes-noexecmem.patch
+++ b/python-2.6-ctypes-noexecmem.patch
@@ -9,7 +9,7 @@ diff -ur Python-2.6~/Modules/_ctypes/callbacks.c
Python-2.6/Modules/_ctypes/call
- FreeClosure(self->pcl);
+ if (self->pcl_write)
+ ffi_closure_free(self->pcl_write);
- PyObject_Del(self);
+ PyObject_GC_Del(self);
}
@@ -373,7 +373,8 @@
diff --git a/python-2.6.4-setup-db48.patch b/python-2.6.4-setup-db48.patch
index 187f239..c9f5f5c 100644
--- a/python-2.6.4-setup-db48.patch
+++ b/python-2.6.4-setup-db48.patch
@@ -10,18 +10,4 @@ diff -up Python-2.6.4/Modules/Setup.dist.setup-db48
Python-2.6.4/Modules/Setup.d
DBINC=/usr/include/db4
DBLIB=/usr/lib
_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
-diff -up Python-2.6.4/setup.py.setup-db48 Python-2.6.4/setup.py
---- Python-2.6.4/setup.py.setup-db48 2009-12-17 22:03:58.048015993 -0500
-+++ Python-2.6.4/setup.py 2009-12-17 22:03:58.169016398 -0500
-@@ -705,9 +705,9 @@ class PyBuildExt(build_ext):
- # a release. Most open source OSes come with one or more
- # versions of BerkeleyDB already installed.
-
-- max_db_ver = (4, 7)
-+ max_db_ver = (4, 8)
- min_db_ver = (3, 3)
-- db_setup_debug = False # verbose debug prints from this script?
-+ db_setup_debug = True # verbose debug prints from this script?
-
- def allow_db_ver(db_ver):
- """Returns a boolean if the given BerkeleyDB version is
acceptable.
+
diff --git a/python-2.6.5-db48.patch b/python-2.6.5-db48.patch
new file mode 100644
index 0000000..d07a42a
--- /dev/null
+++ b/python-2.6.5-db48.patch
@@ -0,0 +1,167 @@
+Index: setup.py
+===================================================================
+--- setup.py (revision 78973)
++++ setup.py (revision 78974)
+@@ -707,7 +707,7 @@
+ # a release. Most open source OSes come with one or more
+ # versions of BerkeleyDB already installed.
+
+- max_db_ver = (4, 7)
++ max_db_ver = (4, 8)
+ min_db_ver = (3, 3)
+ db_setup_debug = False # verbose debug prints from this script?
+
+Index: Lib/bsddb/test/test_basics.py
+===================================================================
+--- Lib/bsddb/test/test_basics.py (revision 78973)
++++ Lib/bsddb/test/test_basics.py (revision 78974)
+@@ -1000,11 +1000,12 @@
+ # # See
http://bugs.python.org/issue3307
+ # self.assertRaises(db.DBInvalidArgError, db.DB, None, 65535)
+
+- def test02_DBEnv_dealloc(self):
+- #
http://bugs.python.org/issue3885
+- import gc
+- self.assertRaises(db.DBInvalidArgError, db.DBEnv, ~db.DB_RPCCLIENT)
+- gc.collect()
++ if db.version() < (4, 8) :
++ def test02_DBEnv_dealloc(self):
++ #
http://bugs.python.org/issue3885
++ import gc
++ self.assertRaises(db.DBInvalidArgError, db.DBEnv, ~db.DB_RPCCLIENT)
++ gc.collect()
+
+
+ #----------------------------------------------------------------------
+Index: Lib/bsddb/test/test_distributed_transactions.py
+===================================================================
+--- Lib/bsddb/test/test_distributed_transactions.py (revision 78973)
++++ Lib/bsddb/test/test_distributed_transactions.py (revision 78974)
+@@ -35,7 +35,7 @@
+ db.DB_INIT_TXN | db.DB_INIT_LOG | db.DB_INIT_MPOOL |
+ db.DB_INIT_LOCK, 0666)
+ self.db = db.DB(self.dbenv)
+- self.db.set_re_len(db.DB_XIDDATASIZE)
++ self.db.set_re_len(db.DB_GID_SIZE)
+ if must_open_db :
+ if db.version() > (4,1) :
+ txn=self.dbenv.txn_begin()
+@@ -76,7 +76,7 @@
+ # let them be garbage collected.
+ for i in xrange(self.num_txns) :
+ txn = self.dbenv.txn_begin()
+- gid = "%%%dd" %db.DB_XIDDATASIZE
++ gid = "%%%dd" %db.DB_GID_SIZE
+ gid = adapt(gid %i)
+ self.db.put(i, gid, txn=txn, flags=db.DB_APPEND)
+ txns.add(gid)
+Index: Modules/_bsddb.c
+===================================================================
+--- Modules/_bsddb.c (revision 78973)
++++ Modules/_bsddb.c (revision 78974)
+@@ -215,7 +215,11 @@
+ #define DB_BUFFER_SMALL ENOMEM
+ #endif
+
++#if (DBVER < 48)
++#define DB_GID_SIZE DB_XIDDATASIZE
++#endif
+
++
+ /* --------------------------------------------------------------------- */
+ /* Structure definitions */
+
+@@ -4501,7 +4505,11 @@
+ DBTxnObject *txn;
+ #define PREPLIST_LEN 16
+ DB_PREPLIST preplist[PREPLIST_LEN];
++#if (DBVER < 48)
+ long retp;
++#else
++ u_int32_t retp;
++#endif
+
+ CHECK_ENV_NOT_CLOSED(self);
+
+@@ -4522,7 +4530,7 @@
+ flags=DB_NEXT; /* Prepare for next loop pass */
+ for (i=0; i<retp; i++) {
+ gid=PyBytes_FromStringAndSize((char *)(preplist[i].gid),
+- DB_XIDDATASIZE);
++ DB_GID_SIZE);
+ if (!gid) {
+ Py_DECREF(list);
+ return NULL;
+@@ -5047,6 +5055,7 @@
+ }
+
+
++#if (DBVER < 48)
+ static PyObject*
+ DBEnv_set_rpc_server(DBEnvObject* self, PyObject* args, PyObject* kwargs)
+ {
+@@ -5068,6 +5077,7 @@
+ RETURN_IF_ERR();
+ RETURN_NONE();
+ }
++#endif
+
+ static PyObject*
+ DBEnv_set_verbose(DBEnvObject* self, PyObject* args)
+@@ -5949,9 +5959,9 @@
+ if (!PyArg_ParseTuple(args, "s#:prepare", &gid, &gid_size))
+ return NULL;
+
+- if (gid_size != DB_XIDDATASIZE) {
++ if (gid_size != DB_GID_SIZE) {
+ PyErr_SetString(PyExc_TypeError,
+- "gid must be DB_XIDDATASIZE bytes long");
++ "gid must be DB_GID_SIZE bytes long");
+ return NULL;
+ }
+
+@@ -6541,8 +6551,10 @@
+ #endif
+ {"set_get_returns_none",(PyCFunction)DBEnv_set_get_returns_none,
METH_VARARGS},
+ {"txn_recover", (PyCFunction)DBEnv_txn_recover, METH_NOARGS},
++#if (DBVER < 48)
+ {"set_rpc_server", (PyCFunction)DBEnv_set_rpc_server,
+ METH_VARARGS||METH_KEYWORDS},
++#endif
+ {"set_verbose", (PyCFunction)DBEnv_set_verbose, METH_VARARGS},
+ #if (DBVER >= 42)
+ {"get_verbose", (PyCFunction)DBEnv_get_verbose, METH_VARARGS},
+@@ -7091,6 +7103,7 @@
+ ADD_INT(d, DB_MAX_PAGES);
+ ADD_INT(d, DB_MAX_RECORDS);
+
++#if (DBVER < 48)
+ #if (DBVER >= 42)
+ ADD_INT(d, DB_RPCCLIENT);
+ #else
+@@ -7098,7 +7111,11 @@
+ /* allow apps to be written using DB_RPCCLIENT on older Berkeley DB */
+ _addIntToDict(d, "DB_RPCCLIENT", DB_CLIENT);
+ #endif
++#endif
++
++#if (DBVER < 48)
+ ADD_INT(d, DB_XA_CREATE);
++#endif
+
+ ADD_INT(d, DB_CREATE);
+ ADD_INT(d, DB_NOMMAP);
+@@ -7115,7 +7132,13 @@
+ ADD_INT(d, DB_INIT_TXN);
+ ADD_INT(d, DB_JOINENV);
+
++#if (DBVER >= 48)
++ ADD_INT(d, DB_GID_SIZE);
++#else
+ ADD_INT(d, DB_XIDDATASIZE);
++ /* Allow new code to work in old BDB releases */
++ _addIntToDict(d, "DB_GID_SIZE", DB_XIDDATASIZE);
++#endif
+
+ ADD_INT(d, DB_RECOVER);
+ ADD_INT(d, DB_RECOVER_FATAL);
diff --git a/python.spec b/python.spec
index 6c2cd97..0b893d9 100644
--- a/python.spec
+++ b/python.spec
@@ -51,8 +51,8 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
-Version: 2.6.4
-Release: 23%{?dist}
+Version: 2.6.5
+Release: 1%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -246,11 +246,11 @@ Patch51: python-2.6-distutils_rpm.patch
Patch52: disable-pymalloc-on-valgrind-py26.patch
-# Patch generated by jwboyer(a)gmail.com to compile against db-4.8, using upstream
-#
http://www.jcea.es/programacion/pybsddb.htm
-# See
https://bugzilla.redhat.com/show_bug.cgi?id=544275
-Patch53: python-2.6-update-bsddb3-4.8.patch
-# ...and a further patch to setup.py so that it searches for 4.8:
+# Upstream patch to compile against db-4.8
+#
http://bugs.python.org/issue6949
+# Based on
http://svn.python.org/view?view=rev&revision=78974
+Patch53: python-2.6.5-db48.patch
+# ...and a further patch to setup.py so that it links against 4.8:
Patch54: python-2.6.4-setup-db48.patch
# Systemtap support: add statically-defined probe points
@@ -481,7 +481,7 @@ rm -r Modules/zlib || exit 1
%patch51 -p1 -b .brprpm
%patch52 -p0 -b .valgrind
-%patch53 -p1 -b .db48
+%patch53 -p0 -b .db48
%patch54 -p1 -b .setup-db48
%if 0%{?with_systemtap}
%patch55 -p1 -b .systemtap
@@ -960,6 +960,13 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Fri Mar 19 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.5-1
+- update to 2.6.5:
http://www.python.org/download/releases/2.6.5/
+- replace our patch to compile against db4.8 with a patch from
+upstream (patch 53, from r78974); update patch 54 since part of it is now in
+that upstream patch
+- update patch 110 so that it still applies in the face of upstream r78380
+
* Tue Mar 16 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-23
- fixup distutils/unixccompiler.py to remove standard library path from
rpath (patch 17)
diff --git a/sources b/sources
index 19cf174..488aa1f 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-fee5408634a54e721a93531aba37f8c1 Python-2.6.4.tar.bz2
+6bef0417e71a1a1737ccf5750420fdb3 Python-2.6.5.tar.bz2
commit f5df1f834310948b32407933e3b8713e1121105b
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Tue Mar 16 19:33:57 2010 +0000
- fixup distutils/unixccompiler.py to remove standard library path from
rpath (patch 17)
- delete DOS batch files
diff --git a/python-2.6.4-distutils-rpath.patch b/python-2.6.4-distutils-rpath.patch
new file mode 100644
index 0000000..f156507
--- /dev/null
+++ b/python-2.6.4-distutils-rpath.patch
@@ -0,0 +1,20 @@
+diff -up Python-2.6.4/Lib/distutils/unixccompiler.py.distutils-rpath
Python-2.6.4/Lib/distutils/unixccompiler.py
+--- Python-2.6.4/Lib/distutils/unixccompiler.py.distutils-rpath 2009-09-09
04:34:06.000000000 -0400
++++ Python-2.6.4/Lib/distutils/unixccompiler.py 2010-03-15 21:33:25.000000000 -0400
+@@ -142,6 +142,16 @@ class UnixCCompiler(CCompiler):
+ if sys.platform == "cygwin":
+ exe_extension = ".exe"
+
++ def _fix_lib_args(self, libraries, library_dirs, runtime_library_dirs):
++ """Remove standard library path from rpath"""
++ libraries, library_dirs, runtime_library_dirs = \
++ CCompiler._fix_lib_args(self, libraries, library_dirs,
++ runtime_library_dirs)
++ libdir = sysconfig.get_config_var('LIBDIR')
++ if runtime_library_dirs and (libdir in runtime_library_dirs):
++ runtime_library_dirs.remove(libdir)
++ return libraries, library_dirs, runtime_library_dirs
++
+ def preprocess(self, source,
+ output_file=None, macros=None, include_dirs=None,
+ extra_preargs=None, extra_postargs=None):
diff --git a/python.spec b/python.spec
index 3377de0..6c2cd97 100644
--- a/python.spec
+++ b/python.spec
@@ -52,7 +52,7 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
Version: 2.6.4
-Release: 22%{?dist}
+Release: 23%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -231,6 +231,11 @@ Patch14: python-2.5.1-socketmodule-constants2.patch
# FIXME: is this for OSF, not Linux?
Patch16: python-2.6-rpath.patch
+# Fixup distutils/unixccompiler.py to remove standard library path from rpath:
+# Adapted from Patch0 in ivazquez' python3000 specfile, removing usage of
+# super() as it's an old-style class
+Patch17: python-2.6.4-distutils-rpath.patch
+
# Fix distutils to follow the Fedora/RHEL/CentOS policies of having .pyo files
Patch51: python-2.6-distutils_rpm.patch
@@ -472,6 +477,7 @@ rm -r Modules/zlib || exit 1
%patch13 -p1 -b .socketmodule
%patch14 -p1 -b .socketmodule2
%patch16 -p1 -b .rpath
+%patch17 -p1 -b .distutils-rpath
%patch51 -p1 -b .brprpm
%patch52 -p0 -b .valgrind
@@ -627,6 +633,7 @@ cp -ar Demo/* %{buildroot}%{demo_dir}
# Get rid of crap
find %{buildroot}/ -name "*~"|xargs rm -f
find %{buildroot}/ -name ".cvsignore"|xargs rm -f
+find %{buildroot}/ -name "*.bat"|xargs rm -f
find . -name "*~"|xargs rm -f
find . -name ".cvsignore"|xargs rm -f
#zero length
@@ -953,6 +960,11 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Tue Mar 16 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-23
+- fixup distutils/unixccompiler.py to remove standard library path from
+rpath (patch 17)
+- delete DOS batch files
+
* Fri Mar 12 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-22
- add pyfuntop.stp; allow systemtap support to be disabled
- remove trailing period from tkinter summary
commit c2224367aa267adf772a4d0a6a8dc1e873f080e9
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Sat Mar 13 00:06:34 2010 +0000
- add pyfuntop.stp; allow systemtap support to be disabled
- remove trailing period from tkinter summary
- don't own /usr/bin/python-config if you're not the main python
diff --git a/pyfuntop.stp b/pyfuntop.stp
new file mode 100644
index 0000000..f235a23
--- /dev/null
+++ b/pyfuntop.stp
@@ -0,0 +1,21 @@
+#!/usr/bin/stap
+
+global fn_calls;
+
+probe python.function.entry
+{
+ fn_calls[pid(), filename, funcname, lineno] += 1;
+}
+
+probe timer.ms(1000) {
+ printf("\033[2J\033[1;1H") /* clear screen */
+ printf("%6s %80s %6s %30s %6s\n",
+ "PID", "FILENAME", "LINE", "FUNCTION",
"CALLS")
+ foreach ([pid, filename, funcname, lineno] in fn_calls- limit 20) {
+ printf("%6d %80s %6d %30s %6d\n",
+ pid, filename, lineno, funcname,
+ fn_calls[pid, filename, funcname, lineno]);
+ }
+
+ delete fn_calls;
+}
diff --git a/python.spec b/python.spec
index 89e367f..3377de0 100644
--- a/python.spec
+++ b/python.spec
@@ -52,7 +52,7 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
Version: 2.6.4
-Release: 21%{?dist}
+Release: 22%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -92,6 +92,9 @@ Source3: libpython.stp
# Written by wcohen, mjw, dmalcolm; not yet sent upstream
Source4: systemtap-example.stp
+# Another example systemtap script that uses the tapset
+# Written by dmalcolm; not yet sent upstream
+Source5: pyfuntop.stp
# Modules/Setup.dist is ultimately used by the "makesetup" script to construct
# the Makefile and config.c
@@ -247,7 +250,7 @@ Patch54: python-2.6.4-setup-db48.patch
# Systemtap support: add statically-defined probe points
# Patch based on upstream bug:
http://bugs.python.org/issue4111
-# fixed up by mjw and mcohen for 2.6.2, then fixed up by dmalcolm for 2.6.4
+# fixed up by mjw and wcohen for 2.6.2, then fixed up by dmalcolm for 2.6.4
# then rewritten by mjw (attachment 390110 of rhbz 545179)
Patch55: python-2.6.4-dtrace.patch
@@ -387,7 +390,7 @@ programs, including IDLE (an IDE with editing and debugging
facilities), a
color editor (pynche), and a python gettext program (pygettext.py).
%package -n %{tkinter}
-Summary: A graphical user interface for the Python scripting language.
+Summary: A graphical user interface for the Python scripting language
Group: Development/Languages
BuildRequires: tcl, tk
Requires: %{name} = %{version}-%{release}
@@ -430,6 +433,7 @@ code that uses more than just unittest and/or test_support.py.
%if 0%{?with_systemtap}
# Provide an example of usage of the tapset:
cp -a %{SOURCE4} .
+cp -a %{SOURCE5} .
%endif # with_systemtap
# Ensure that we're using the system copy of various libraries, rather than
@@ -473,7 +477,9 @@ rm -r Modules/zlib || exit 1
%patch52 -p0 -b .valgrind
%patch53 -p1 -b .db48
%patch54 -p1 -b .setup-db48
+%if 0%{?with_systemtap}
%patch55 -p1 -b .systemtap
+%endif
%ifarch alpha ia64
# 64bit, but not lib64 arches need this too...
@@ -879,7 +885,7 @@ rm -fr %{buildroot}
%{_libdir}/%{py_INSTSONAME}
%if 0%{?with_systemtap}
%{tapsetdir}/%{libpython_stp}
-%doc systemtap-example.stp
+%doc systemtap-example.stp pyfuntop.stp
%endif
%files devel
@@ -889,7 +895,9 @@ rm -fr %{buildroot}
%{_includedir}/python%{pybasever}/*.h
%exclude %{_includedir}/python%{pybasever}/%{_pyconfig_h}
%doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit
+%if %{main_python}
%{_bindir}/python-config
+%endif
%{_bindir}/python%{pybasever}-config
%{pylibdir}/config/*
%{_libdir}/libpython%{pybasever}.so
@@ -945,6 +953,11 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Fri Mar 12 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-22
+- add pyfuntop.stp; allow systemtap support to be disabled
+- remove trailing period from tkinter summary
+- don't own /usr/bin/python-config if you're not the main python
+
* Thu Mar 11 2010 Marcela Malov <mmaslano(a)redhat.com> - 2.6.4-21
- rebuild with new gdbm
commit c6af0d08e7fc49359d83c4551b4dd1b771ce0ee2
Author: Marcela Malov <mmaslano(a)fedoraproject.org>
Date: Thu Mar 11 13:48:50 2010 +0000
- rebuild with new gdbm
diff --git a/python.spec b/python.spec
index a5256d6..89e367f 100644
--- a/python.spec
+++ b/python.spec
@@ -52,7 +52,7 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
Version: 2.6.4
-Release: 20%{?dist}
+Release: 21%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -945,6 +945,9 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Thu Mar 11 2010 Marcela Malov <mmaslano(a)redhat.com> - 2.6.4-21
+- rebuild with new gdbm
+
* Thu Feb 11 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-20
- avoid having the "test" subdirectory and the files within it that are in the
core subpackage also be owned by the test subpackage (rhbz:467588)
commit c905a3af793ecf13d6d2be128e688288f8d4b99e
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Thu Feb 11 20:53:12 2010 +0000
- avoid having the "test" subdirectory and the files within it that are in
the core subpackage also be owned by the test subpackage (rhbz:467588)
diff --git a/python.spec b/python.spec
index 2aec1c5..a5256d6 100644
--- a/python.spec
+++ b/python.spec
@@ -52,7 +52,7 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
Version: 2.6.4
-Release: 19%{?dist}
+Release: 20%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -924,7 +924,10 @@ rm -fr %{buildroot}
%{pylibdir}/email/test
%{pylibdir}/json/tests
%{pylibdir}/sqlite3/test
-%{pylibdir}/test
+%{pylibdir}/test/*
+# These two are shipped in the main subpackage:
+%exclude %{pylibdir}/test/test_support.py*
+%exclude %{pylibdir}/test/__init__.py*
%{dynload_dir}/_ctypes_test.so
%{dynload_dir}/_testcapimodule.so
@@ -942,6 +945,10 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Thu Feb 11 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-20
+- avoid having the "test" subdirectory and the files within it that are in the
+core subpackage also be owned by the test subpackage (rhbz:467588)
+
* Wed Feb 10 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-19
- revise the systemtap patch (patch 55:python-2.6.4-dtrace.patch) to the
new version by mjw in attachment 390110 of rhbz:545179, as this should
commit bdbb341f6f77d22d639f41432af331cc19479c6c
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Wed Feb 10 23:04:04 2010 +0000
- revise the systemtap patch (patch 55:python-2.6.4-dtrace.patch) to the
new version by mjw in attachment 390110 of rhbz:545179, as this should
eliminate the performance penalty for the case where the probes aren't
in use, and eliminate all architecture-specific code (rhbz:563541;
except on sparc)
diff --git a/python-2.6.4-dtrace.patch b/python-2.6.4-dtrace.patch
index 90ffc10..bab99d8 100644
--- a/python-2.6.4-dtrace.patch
+++ b/python-2.6.4-dtrace.patch
@@ -17,7 +17,7 @@ diff -up Python-2.6.4/configure.in.systemtap Python-2.6.4/configure.in
+ AC_DEFINE(WITH_DTRACE, 1,
+ [Define if you want to compile in Dtrace support])
+ with_dtrace="Sun"
-+ DTRACEOBJS="Python/phelper.o Python/dtrace.o"
++ DTRACEOBJS="Python/dtrace.o"
+ DTRADEHDRS=""
+ elif dtrace -h -o /dev/null -s $srcdir/Include/pydtrace.d
+ then
@@ -25,7 +25,7 @@ diff -up Python-2.6.4/configure.in.systemtap Python-2.6.4/configure.in
+ [Define if you want to compile in Dtrace support])
+ with_dtrace="Apple"
+ DTRACEOBJS=""
-+ DTRADEHDRS="phelper.h pydtrace.h"
++ DTRADEHDRS="pydtrace.h"
+ else
+ with_dtrace="no"
+ fi
@@ -40,162 +40,6 @@ diff -up Python-2.6.4/configure.in.systemtap
Python-2.6.4/configure.in
# Check for --with-wctype-functions
AC_MSG_CHECKING(for --with-wctype-functions)
AC_ARG_WITH(wctype-functions,
-diff -up Python-2.6.4/Include/frameobject.h.systemtap Python-2.6.4/Include/frameobject.h
---- Python-2.6.4/Include/frameobject.h.systemtap 2008-02-14 07:47:33.000000000 -0500
-+++ Python-2.6.4/Include/frameobject.h 2009-12-18 15:37:15.714243772 -0500
-@@ -41,6 +41,9 @@ typedef struct _frame {
- /* As of 2.3 f_lineno is only valid when tracing is active (i.e. when
- f_trace is set) -- at other times use PyCode_Addr2Line instead. */
- int f_lineno; /* Current line number */
-+#ifdef WITH_DTRACE
-+ int f_calllineno; /* line number of call site */
-+#endif
- int f_iblock; /* index in f_blockstack */
- PyTryBlock f_blockstack[CO_MAXBLOCKS]; /* for try and loop blocks */
- PyObject *f_localsplus[1]; /* locals+stack, dynamically sized */
-diff -up Python-2.6.4/Include/phelper.d.systemtap Python-2.6.4/Include/phelper.d
---- Python-2.6.4/Include/phelper.d.systemtap 2009-12-18 15:37:15.698243410 -0500
-+++ Python-2.6.4/Include/phelper.d 2009-12-18 15:37:15.697243772 -0500
-@@ -0,0 +1,139 @@
-+
-+/*
-+ * Python ustack helper. This relies on the first argument (PyFrame *) being
-+ * on the stack; see Python/ceval.c for the contortions we go through to ensure
-+ * this is the case.
-+ *
-+ * On x86, the PyFrame * is two slots up from the frame pointer; on SPARC, it's
-+ * eight.
-+ */
-+
-+/*
-+ * Yes, this is as gross as it looks. DTrace cannot handle static functions,
-+ * and our stat_impl.h has them in ILP32.
-+ */
-+#define _SYS_STAT_H
-+
-+#include <stdio.h>
-+#include <sys/types.h>
-+
-+#include "pyport.h"
-+#include "object.h"
-+#include "pystate.h"
-+#include "pyarena.h"
-+#include "pythonrun.h"
-+#include "compile.h"
-+#include "frameobject.h"
-+#include "stringobject.h"
-+
-+#if defined(__i386)
-+#define startframe PyEval_EvalFrameEx
-+#define endframe PyEval_EvalCodeEx
-+#elif defined(__amd64)
-+#define PyEval_EvalFrameEx PyEval_EvalFrameExReal
-+#define startframe PyEval_EvalFrameExReal
-+#define endframe PyEval_EvalCodeEx
-+#elif defined(__sparc)
-+#define PyEval_EvalFrameEx PyEval_EvalFrameExReal
-+#define startframe PyEval_EvalFrameEx
-+#define endframe PyEval_EvalFrameExReal
-+#endif
-+
-+#ifdef __sparcv9
-+#define STACK_BIAS (2048-1)
-+#else
-+#define STACK_BIAS 0
-+#endif
-+
-+/*
-+ * Not defining PHELPER lets us test this code as a normal D script.
-+ */
-+#ifdef PHELPER
-+
-+#define at_evalframe(addr) \
-+ ((uintptr_t)addr >= ((uintptr_t)&``startframe) && \
-+ (uintptr_t)addr < ((uintptr_t)&``endframe))
-+#define probe dtrace:helper:ustack:
-+#define print_result(r) (r)
-+
-+#if defined(__i386) || defined(__amd64)
-+#define frame_ptr_addr ((uintptr_t)arg1 + sizeof(uintptr_t) * 2)
-+#elif defined(__sparc)
-+#define frame_ptr_addr ((uintptr_t)arg1 + STACK_BIAS + sizeof(uintptr_t) * 8)
-+#else
-+#error unknown architecture
-+#endif
-+
-+#else /* PHELPER */
-+
-+#define at_evalframe(addr) (1)
-+#define probe pid$target::PyEval_EvalFrame:entry
-+#define print_result(r) (trace(r))
-+
-+#if defined(__i386) || defined(__amd64)
-+#define frame_ptr_addr ((uintptr_t)uregs[R_SP] + sizeof(uintptr_t))
-+#elif defined(__sparc)
-+/*
-+ * Not implemented: we could just use R_I0, but what's the point?
-+ */
-+#else
-+#error unknown architecture
-+#endif
-+
-+#endif /* PHELPER */
-+
-+extern uintptr_t PyEval_EvalFrameEx;
-+extern uintptr_t PyEval_EvalCodeEx;
-+
-+#define copyin_obj(addr, obj) ((obj *)copyin((uintptr_t)addr, sizeof(obj)))
-+#define pystr_addr(addr) ((char *)addr + offsetof(PyStringObject, ob_sval))
-+#define copyin_str(dest, addr, obj) \
-+ (copyinto((uintptr_t)pystr_addr(addr), obj->ob_size, (dest)))
-+#define add_str(addr, obj) \
-+ copyin_str(this->result + this->pos, addr, obj); \
-+ this->pos += obj->ob_size; \
-+ this->result[this->pos] = '\0';
-+#define add_digit(nr, div) ((nr / div) ? \
-+ (this->result[this->pos++] = '0' + ((nr / div) % 10)) : \
-+ (this->result[this->pos] = '\0'))
-+#define add_char(c) (this->result[this->pos++] = c)
-+
-+probe /at_evalframe(arg0)/
-+{
-+ this->framep = *(uintptr_t *)copyin(frame_ptr_addr, sizeof(uintptr_t));
-+ this->frameo = copyin_obj(this->framep, PyFrameObject);
-+ this->codep = this->frameo->f_code;
-+ this->lineno = this->frameo->f_calllineno;
-+ this->codeo = copyin_obj(this->codep, PyCodeObject);
-+ this->filenamep = this->codeo->co_filename;
-+ this->fnamep = this->codeo->co_name;
-+ this->filenameo = copyin_obj(this->filenamep, PyStringObject);
-+ this->fnameo = copyin_obj(this->fnamep, PyStringObject);
-+
-+ this->len = 1 + this->filenameo->ob_size + 1 + 5 + 2 +
-+ this->fnameo->ob_size + 1 + 1;
-+
-+ this->result = (char *)alloca(this->len);
-+ this->pos = 0;
-+
-+ add_char('@');
-+ add_str(this->filenamep, this->filenameo);
-+ add_char(':');
-+ add_digit(this->lineno, 10000);
-+ add_digit(this->lineno, 1000);
-+ add_digit(this->lineno, 100);
-+ add_digit(this->lineno, 10);
-+ add_digit(this->lineno, 1);
-+ add_char(' ');
-+ add_char('(');
-+ add_str(this->fnamep, this->fnameo);
-+ add_char(')');
-+ this->result[this->pos] = '\0';
-+
-+ print_result(stringof(this->result));
-+}
-+
-+probe /!at_evalframe(arg0)/
-+{
-+ NULL;
-+}
diff -up Python-2.6.4/Include/pydtrace.d.systemtap Python-2.6.4/Include/pydtrace.d
--- Python-2.6.4/Include/pydtrace.d.systemtap 2009-12-18 15:37:15.697243772 -0500
+++ Python-2.6.4/Include/pydtrace.d 2009-12-18 15:37:15.697243772 -0500
@@ -221,22 +65,17 @@ diff -up Python-2.6.4/Makefile.pre.in.systemtap
Python-2.6.4/Makefile.pre.in
$(LIBOBJS) \
$(MACHDEP_OBJS) \
$(THREADOBJ)
-@@ -577,6 +578,23 @@ Python/formatter_unicode.o: $(srcdir)/Py
+@@ -577,6 +578,18 @@ Python/formatter_unicode.o: $(srcdir)/Py
Python/formatter_string.o: $(srcdir)/Python/formatter_string.c \
$(STRINGLIB_HEADERS)
+# Only needed with --with-dtrace
+buildinclude:
+ mkdir -p Include
-+Python/phelper.o: buildinclude $(srcdir)/Include/phelper.d
-+ dtrace -o $@ -DPHELPER $(DFLAGS) $(CPPFLAGS) -C -G -s $(srcdir)/Include/phelper.d
+
+Include/pydtrace.h: buildinclude $(srcdir)/Include/pydtrace.d
+ dtrace -o $@ $(DFLAGS) -C -h -s $(srcdir)/Include/pydtrace.d
+
-+Include/phelper.h: buildinclude $(srcdir)/Include/phelper.d
-+ dtrace -o $@ $(DFLAGS) -C -h -s $(srcdir)/Python/python.d
-+
+Python/ceval.o: Include/pydtrace.h
+
+Python/dtrace.o: buildinclude $(srcdir)/Include/pydtrace.d Python/ceval.o
@@ -253,61 +92,9 @@ diff -up Python-2.6.4/Makefile.pre.in.systemtap
Python-2.6.4/Makefile.pre.in
+.PHONY: smelly funny patchcheck buildinclude
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
-diff -up Python-2.6.4/Objects/frameobject.c.systemtap Python-2.6.4/Objects/frameobject.c
---- Python-2.6.4/Objects/frameobject.c.systemtap 2009-06-01 19:27:15.000000000 -0400
-+++ Python-2.6.4/Objects/frameobject.c 2009-12-18 15:37:15.715242573 -0500
-@@ -698,6 +698,9 @@ PyFrame_New(PyThreadState *tstate, PyCod
- f->f_tstate = tstate;
-
- f->f_lasti = -1;
-+#ifdef WITH_DTRACE
-+ f->f_calllineno = code->co_firstlineno;
-+#endif
- f->f_lineno = code->co_firstlineno;
- f->f_iblock = 0;
-
diff -up Python-2.6.4/pyconfig.h.in.systemtap Python-2.6.4/pyconfig.h.in
--- Python-2.6.4/pyconfig.h.in.systemtap 2009-12-18 15:37:15.649243175 -0500
+++ Python-2.6.4/pyconfig.h.in 2009-12-18 15:37:15.719242803 -0500
-@@ -5,6 +5,9 @@
- #define Py_PYCONFIG_H
-
-
-+/* Define if building universal (internal helper macro) */
-+#undef AC_APPLE_UNIVERSAL_BUILD
-+
- /* Define for AIX if your compiler is a genuine IBM xlC/xlC_r and you want
- support for AIX C++ shared extension modules. */
- #undef AIX_GENUINE_CPLUSPLUS
-@@ -945,6 +948,28 @@
- /* Define to 1 if your <sys/time.h> declares `struct tm'. */
- #undef TM_IN_SYS_TIME
-
-+/* Enable extensions on AIX 3, Interix. */
-+#ifndef _ALL_SOURCE
-+# undef _ALL_SOURCE
-+#endif
-+/* Enable GNU extensions on systems that have them. */
-+#ifndef _GNU_SOURCE
-+# undef _GNU_SOURCE
-+#endif
-+/* Enable threading extensions on Solaris. */
-+#ifndef _POSIX_PTHREAD_SEMANTICS
-+# undef _POSIX_PTHREAD_SEMANTICS
-+#endif
-+/* Enable extensions on HP NonStop. */
-+#ifndef _TANDEM_SOURCE
-+# undef _TANDEM_SOURCE
-+#endif
-+/* Enable general extensions on Solaris. */
-+#ifndef __EXTENSIONS__
-+# undef __EXTENSIONS__
-+#endif
-+
-+
- /* Define if you want to use MacPython modules on MacOSX in unix-Python. */
- #undef USE_TOOLBOX_OBJECT_GLUE
-
@@ -964,6 +989,9 @@
/* Define if you want documentation strings in extension modules */
#undef WITH_DOC_STRINGS
@@ -318,32 +105,6 @@ diff -up Python-2.6.4/pyconfig.h.in.systemtap
Python-2.6.4/pyconfig.h.in
/* Define if you want to use the new-style (Openstep, Rhapsody, MacOS) dynamic
linker (dyld) instead of the old-style (NextStep) dynamic linker (rld).
Dyld is necessary to support frameworks. */
-@@ -1017,15 +1045,25 @@
- /* This must be defined on some systems to enable large file support. */
- #undef _LARGEFILE_SOURCE
-
-+/* Define to 1 if on MINIX. */
-+#undef _MINIX
-+
- /* Define on NetBSD to activate all library features */
- #undef _NETBSD_SOURCE
-
- /* Define _OSF_SOURCE to get the makedev macro. */
- #undef _OSF_SOURCE
-
-+/* Define to 2 if the system does not provide POSIX.1 features except with
-+ this defined. */
-+#undef _POSIX_1_SOURCE
-+
- /* Define to activate features from IEEE Stds 1003.1-2001 */
- #undef _POSIX_C_SOURCE
-
-+/* Define to 1 if you need to in order for `stat' and other things to work. */
-+#undef _POSIX_SOURCE
-+
- /* Define if you have POSIX threads, and your system does not define that. */
- #undef _POSIX_THREADS
-
diff -up Python-2.6.4/Python/ceval.c.systemtap Python-2.6.4/Python/ceval.c
--- Python-2.6.4/Python/ceval.c.systemtap 2009-05-30 17:43:48.000000000 -0400
+++ Python-2.6.4/Python/ceval.c 2009-12-18 15:37:15.723242474 -0500
@@ -414,91 +175,6 @@ diff -up Python-2.6.4/Python/ceval.c.systemtap
Python-2.6.4/Python/ceval.c
/* Interpreter main loop */
-@@ -538,9 +591,84 @@ PyEval_EvalFrame(PyFrameObject *f) {
- return PyEval_EvalFrameEx(f, 0);
- }
-
-+/*
-+ * These shenanigans look like utter madness, but what we're actually doing is
-+ * making sure that the ustack helper will see the PyFrameObject pointer on the
-+ * stack. We have two tricky cases:
-+ *
-+ * amd64
-+ *
-+ * We use up the six registers for passing arguments, meaning the call can't
-+ * use a register for passing 'f', and has to push it onto the stack in a known
-+ * location.
-+ *
-+ * And how does "throwflag" figure in to this? -PN
-+ *
-+ * SPARC
-+ *
-+ * Here the problem is that (on 32-bit) the compiler is re-using %i0 before
-+ * some calls inside PyEval_EvalFrameReal(), which means that when it's saved,
-+ * it's just some junk value rather than the real first argument. So, instead,
-+ * we trace our proxy PyEval_EvalFrame(), where we 'know' the compiler
won't
-+ * decide to re-use %i0. We also need to defeat optimization of our proxy.
-+ */
-+
-+#if defined(WITH_DTRACE)
-+
-+#if defined(__amd64)
-+PyObject *PyEval_EvalFrameExReal(long, long, long, long, long, long,
-+ PyFrameObject *, int throwflag);
-+
-+
-+
- PyObject *
- PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
- {
-+ volatile PyObject *f2;
-+ f2 = PyEval_EvalFrameExReal(0, 0, 0, 0, 0, 0, f, throwflag);
-+ return (PyObject *)f2;
-+}
-+
-+PyObject *
-+PyEval_EvalFrameExReal(long a1, long a2, long a3, long a4, long a5, long a6,
-+ PyFrameObject *f, int throwflag)
-+{
-+
-+#elif defined(__sparc)
-+
-+PyObject *PyEval_EvalFrameExReal(PyFrameObject *f, int throwflag);
-+
-+volatile int dummy;
-+
-+PyObject *
-+PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
-+{
-+ volatile PyObject *f2;
-+ f2 = PyEval_EvalFrameExReal(f, throwflag);
-+ dummy = f->ob_refcnt;
-+ return (PyObject *)f2;
-+}
-+
-+PyObject *
-+PyEval_EvalFrameExReal(PyFrameObject *f, int throwflag)
-+{
-+
-+#else /* __amd64 || __sparc */
-+
-+PyObject *
-+PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
-+{
-+
-+#endif /* __amd64 || __sparc */
-+
-+#else /* WITH_DTRACE not defined */
-+
-+PyObject *
-+PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
-+{
-+
-+#endif /* WITH_DTRACE */
-+
- #ifdef DXPAIRS
- int lastopcode = 0;
- #endif
@@ -763,6 +891,9 @@ PyEval_EvalFrameEx(PyFrameObject *f, int
}
}
@@ -509,29 +185,6 @@ diff -up Python-2.6.4/Python/ceval.c.systemtap
Python-2.6.4/Python/ceval.c
co = f->f_code;
names = co->co_names;
consts = co->co_consts;
-@@ -2383,6 +2514,10 @@ PyEval_EvalFrameEx(PyFrameObject *f, int
- PyObject **sp;
- PCALL(PCALL_ALL);
- sp = stack_pointer;
-+#ifdef WITH_DTRACE
-+ f->f_calllineno = PyCode_Addr2Line(f->f_code,
-+ f->f_lasti);
-+#endif
- #ifdef WITH_TSC
- x = call_function(&sp, oparg, &intr0, &intr1);
- #else
-@@ -2425,6 +2560,11 @@ PyEval_EvalFrameEx(PyFrameObject *f, int
- } else
- Py_INCREF(func);
- sp = stack_pointer;
-+#ifdef WITH_DTRACE
-+ f->f_calllineno = PyCode_Addr2Line(f->f_code,
-+ f->f_lasti);
-+#endif
-+
- READ_TIMESTAMP(intr0);
- x = ext_do_call(func, &sp, flags, na, nk);
- READ_TIMESTAMP(intr1);
@@ -2723,6 +2863,8 @@ fast_yield:
/* pop frame */
diff --git a/python.spec b/python.spec
index e2e345a..2aec1c5 100644
--- a/python.spec
+++ b/python.spec
@@ -52,7 +52,7 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
Version: 2.6.4
-Release: 18%{?dist}
+Release: 19%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -248,6 +248,7 @@ Patch54: python-2.6.4-setup-db48.patch
# Systemtap support: add statically-defined probe points
# Patch based on upstream bug:
http://bugs.python.org/issue4111
# fixed up by mjw and mcohen for 2.6.2, then fixed up by dmalcolm for 2.6.4
+# then rewritten by mjw (attachment 390110 of rhbz 545179)
Patch55: python-2.6.4-dtrace.patch
# "lib64 patches"
@@ -941,6 +942,13 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Wed Feb 10 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-19
+- revise the systemtap patch (patch 55:python-2.6.4-dtrace.patch) to the
+new version by mjw in attachment 390110 of rhbz:545179, as this should
+eliminate the performance penalty for the case where the probes aren't in
+use, and eliminate all architecture-specific code (rhbz:563541; except on
+sparc)
+
* Tue Feb 9 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-18
- add a systemtap tapset defining "python.function.entry" and
"python.function.return" to make it easy to use the static probepoint within
commit 3dde1c96508ada7b00fde40ce915757f72d359d2
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Tue Feb 9 22:46:34 2010 +0000
- add a systemtap tapset defining "python.function.entry" and
"python.function.return" to make it easy to use the static probepoint
within Python; add an example of using the tapset to the docs
diff --git a/libpython.stp b/libpython.stp
new file mode 100644
index 0000000..56cf2fb
--- /dev/null
+++ b/libpython.stp
@@ -0,0 +1,17 @@
+/* Systemtap tapset to make it easier to trace Python */
+
+/*
+ Define python.function.entry/return:
+*/
+probe python.function.entry =
process("python").library("LIBRARY_PATH").mark("function__entry")
+{
+ filename = user_string($arg1);
+ funcname = user_string($arg2);
+ lineno = $arg3;
+}
+probe python.function.return =
process("python").library("LIBRARY_PATH").mark("function__return")
+{
+ filename = user_string($arg1);
+ funcname = user_string($arg2);
+ lineno = $arg3;
+}
diff --git a/python.spec b/python.spec
index 425b6cf..e2e345a 100644
--- a/python.spec
+++ b/python.spec
@@ -52,7 +52,7 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
Version: 2.6.4
-Release: 17%{?dist}
+Release: 18%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -82,6 +82,16 @@ Source1: libpython-36a517ef7848cbd0b3dcc7371f32e47ac4c87eba.tar.gz
Source2: pythondeps.sh
%global __python_requires %{SOURCE2}
+# Systemtap tapset to make it easier to use the systemtap static probes
+# (actually a template; LIBRARY_PATH will get fixed up during install)
+# Written by dmalcolm; not yet sent upstream
+Source3: libpython.stp
+
+
+# Example systemtap script using the tapset
+# Written by wcohen, mjw, dmalcolm; not yet sent upstream
+Source4: systemtap-example.stp
+
# Modules/Setup.dist is ultimately used by the "makesetup" script to construct
# the Makefile and config.c
@@ -416,6 +426,11 @@ code that uses more than just unittest and/or test_support.py.
%setup -q -n Python-%{version} -T -D -a 1
%endif # with_gdb_hooks
+%if 0%{?with_systemtap}
+# Provide an example of usage of the tapset:
+cp -a %{SOURCE4} .
+%endif # with_systemtap
+
# Ensure that we're using the system copy of various libraries, rather than
# copies shipped by upstream in the tarball:
# Remove embedded copy of expat:
@@ -696,6 +711,25 @@ LD_LIBRARY_PATH=. ./python -c "import compileall; import sys;
compileall.compile
LD_LIBRARY_PATH=. ./python -O -c "import compileall; import sys;
compileall.compile_dir('%{buildroot}%{dir_holding_gdb_py}',
ddir='%{dir_holding_gdb_py}')"
%endif # with_gdb_hooks
+#
+# Systemtap hooks:
+#
+%if 0%{?with_systemtap}
+# Install a tapset for this libpython into tapsetdir, fixing up the path to the
+# library:
+mkdir -p %{buildroot}%{tapsetdir}
+%ifarch ppc64 s390x x86_64 ia64 alpha sparc64
+%global libpython_stp libpython%{pybasever}-64.stp
+%else
+%global libpython_stp libpython%{pybasever}-32.stp
+%endif
+
+sed \
+ -e "s|LIBRARY_PATH|%{_libdir}/%{py_INSTSONAME}|" \
+ %{SOURCE3} \
+ > %{buildroot}%{tapsetdir}/%{libpython_stp}
+%endif # with_systemtap
+
%clean
rm -fr %{buildroot}
@@ -842,6 +876,10 @@ rm -fr %{buildroot}
%defattr(-,root,root,-)
%doc LICENSE README
%{_libdir}/%{py_INSTSONAME}
+%if 0%{?with_systemtap}
+%{tapsetdir}/%{libpython_stp}
+%doc systemtap-example.stp
+%endif
%files devel
%defattr(-,root,root,-)
@@ -903,6 +941,11 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Tue Feb 9 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-18
+- add a systemtap tapset defining "python.function.entry" and
+"python.function.return" to make it easy to use the static probepoint within
+Python; add an example of using the tapset to the docs
+
* Tue Feb 9 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-17
- add systemtap static probes (wcohen; patch 55; rh bug #545179)
- update some comments in specfile relating to gdb work
diff --git a/systemtap-example.stp b/systemtap-example.stp
new file mode 100644
index 0000000..164333a
--- /dev/null
+++ b/systemtap-example.stp
@@ -0,0 +1,19 @@
+/*
+ Example usage of the Python systemtap tapset to show a nested view of all
+ Python function calls (and returns) across the whole system.
+
+ Run this using
+ stap systemtap-example.stp
+ to instrument all Python processes on the system, or (for example) using
+ stap systemtap-example.stp -c COMMAND
+ to instrument a specific program (implemented in Python)
+*/
+probe python.function.entry
+{
+ printf("%s => %s in %s:%d\n", thread_indent(1), funcname, filename,
lineno);
+}
+
+probe python.function.return
+{
+ printf("%s <= %s in %s:%d\n", thread_indent(-1), funcname, filename,
lineno);
+}
commit 5ae15cdb9b00837a58b39544b8adbe76af026e04
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Tue Feb 9 18:53:26 2010 +0000
- add systemtap static probes (wcohen; patch 55; rh bug #545179)
- update some comments in specfile relating to gdb work
- manually byte-compile the gdb.py file with the freshly-built python to
ensure that .pyx and .pyo files make it into the debuginfo manifest if
they are later byte-compiled after find-debuginfo.sh is run
diff --git a/python-2.6.4-dtrace.patch b/python-2.6.4-dtrace.patch
new file mode 100644
index 0000000..90ffc10
--- /dev/null
+++ b/python-2.6.4-dtrace.patch
@@ -0,0 +1,543 @@
+diff -up Python-2.6.4/configure.in.systemtap Python-2.6.4/configure.in
+--- Python-2.6.4/configure.in.systemtap 2009-12-18 15:37:15.632242686 -0500
++++ Python-2.6.4/configure.in 2009-12-18 15:37:15.713244483 -0500
+@@ -2481,6 +2481,38 @@ if test "$with_valgrind" != no; then
+ )
+ fi
+
++# Check for dtrace support
++AC_MSG_CHECKING(for --with-dtrace)
++AC_ARG_WITH(dtrace,
++ AC_HELP_STRING(--with(out)-dtrace, disable/enable dtrace support))
++
++if test ! -z "$with_dtrace"
++then
++ if dtrace -G -o /dev/null -s $srcdir/Include/pydtrace.d 2>/dev/null
++ then
++ AC_DEFINE(WITH_DTRACE, 1,
++ [Define if you want to compile in Dtrace support])
++ with_dtrace="Sun"
++ DTRACEOBJS="Python/phelper.o Python/dtrace.o"
++ DTRADEHDRS=""
++ elif dtrace -h -o /dev/null -s $srcdir/Include/pydtrace.d
++ then
++ AC_DEFINE(WITH_DTRACE, 1,
++ [Define if you want to compile in Dtrace support])
++ with_dtrace="Apple"
++ DTRACEOBJS=""
++ DTRADEHDRS="phelper.h pydtrace.h"
++ else
++ with_dtrace="no"
++ fi
++else
++ with_dtrace="no"
++fi
++
++AC_MSG_RESULT($with_dtrace)
++AC_SUBST(DTRACEOBJS)
++AC_SUBST(DTRACEHDRS)
++
+ # Check for --with-wctype-functions
+ AC_MSG_CHECKING(for --with-wctype-functions)
+ AC_ARG_WITH(wctype-functions,
+diff -up Python-2.6.4/Include/frameobject.h.systemtap Python-2.6.4/Include/frameobject.h
+--- Python-2.6.4/Include/frameobject.h.systemtap 2008-02-14 07:47:33.000000000 -0500
++++ Python-2.6.4/Include/frameobject.h 2009-12-18 15:37:15.714243772 -0500
+@@ -41,6 +41,9 @@ typedef struct _frame {
+ /* As of 2.3 f_lineno is only valid when tracing is active (i.e. when
+ f_trace is set) -- at other times use PyCode_Addr2Line instead. */
+ int f_lineno; /* Current line number */
++#ifdef WITH_DTRACE
++ int f_calllineno; /* line number of call site */
++#endif
+ int f_iblock; /* index in f_blockstack */
+ PyTryBlock f_blockstack[CO_MAXBLOCKS]; /* for try and loop blocks */
+ PyObject *f_localsplus[1]; /* locals+stack, dynamically sized */
+diff -up Python-2.6.4/Include/phelper.d.systemtap Python-2.6.4/Include/phelper.d
+--- Python-2.6.4/Include/phelper.d.systemtap 2009-12-18 15:37:15.698243410 -0500
++++ Python-2.6.4/Include/phelper.d 2009-12-18 15:37:15.697243772 -0500
+@@ -0,0 +1,139 @@
++
++/*
++ * Python ustack helper. This relies on the first argument (PyFrame *) being
++ * on the stack; see Python/ceval.c for the contortions we go through to ensure
++ * this is the case.
++ *
++ * On x86, the PyFrame * is two slots up from the frame pointer; on SPARC, it's
++ * eight.
++ */
++
++/*
++ * Yes, this is as gross as it looks. DTrace cannot handle static functions,
++ * and our stat_impl.h has them in ILP32.
++ */
++#define _SYS_STAT_H
++
++#include <stdio.h>
++#include <sys/types.h>
++
++#include "pyport.h"
++#include "object.h"
++#include "pystate.h"
++#include "pyarena.h"
++#include "pythonrun.h"
++#include "compile.h"
++#include "frameobject.h"
++#include "stringobject.h"
++
++#if defined(__i386)
++#define startframe PyEval_EvalFrameEx
++#define endframe PyEval_EvalCodeEx
++#elif defined(__amd64)
++#define PyEval_EvalFrameEx PyEval_EvalFrameExReal
++#define startframe PyEval_EvalFrameExReal
++#define endframe PyEval_EvalCodeEx
++#elif defined(__sparc)
++#define PyEval_EvalFrameEx PyEval_EvalFrameExReal
++#define startframe PyEval_EvalFrameEx
++#define endframe PyEval_EvalFrameExReal
++#endif
++
++#ifdef __sparcv9
++#define STACK_BIAS (2048-1)
++#else
++#define STACK_BIAS 0
++#endif
++
++/*
++ * Not defining PHELPER lets us test this code as a normal D script.
++ */
++#ifdef PHELPER
++
++#define at_evalframe(addr) \
++ ((uintptr_t)addr >= ((uintptr_t)&``startframe) && \
++ (uintptr_t)addr < ((uintptr_t)&``endframe))
++#define probe dtrace:helper:ustack:
++#define print_result(r) (r)
++
++#if defined(__i386) || defined(__amd64)
++#define frame_ptr_addr ((uintptr_t)arg1 + sizeof(uintptr_t) * 2)
++#elif defined(__sparc)
++#define frame_ptr_addr ((uintptr_t)arg1 + STACK_BIAS + sizeof(uintptr_t) * 8)
++#else
++#error unknown architecture
++#endif
++
++#else /* PHELPER */
++
++#define at_evalframe(addr) (1)
++#define probe pid$target::PyEval_EvalFrame:entry
++#define print_result(r) (trace(r))
++
++#if defined(__i386) || defined(__amd64)
++#define frame_ptr_addr ((uintptr_t)uregs[R_SP] + sizeof(uintptr_t))
++#elif defined(__sparc)
++/*
++ * Not implemented: we could just use R_I0, but what's the point?
++ */
++#else
++#error unknown architecture
++#endif
++
++#endif /* PHELPER */
++
++extern uintptr_t PyEval_EvalFrameEx;
++extern uintptr_t PyEval_EvalCodeEx;
++
++#define copyin_obj(addr, obj) ((obj *)copyin((uintptr_t)addr, sizeof(obj)))
++#define pystr_addr(addr) ((char *)addr + offsetof(PyStringObject, ob_sval))
++#define copyin_str(dest, addr, obj) \
++ (copyinto((uintptr_t)pystr_addr(addr), obj->ob_size, (dest)))
++#define add_str(addr, obj) \
++ copyin_str(this->result + this->pos, addr, obj); \
++ this->pos += obj->ob_size; \
++ this->result[this->pos] = '\0';
++#define add_digit(nr, div) ((nr / div) ? \
++ (this->result[this->pos++] = '0' + ((nr / div) % 10)) : \
++ (this->result[this->pos] = '\0'))
++#define add_char(c) (this->result[this->pos++] = c)
++
++probe /at_evalframe(arg0)/
++{
++ this->framep = *(uintptr_t *)copyin(frame_ptr_addr, sizeof(uintptr_t));
++ this->frameo = copyin_obj(this->framep, PyFrameObject);
++ this->codep = this->frameo->f_code;
++ this->lineno = this->frameo->f_calllineno;
++ this->codeo = copyin_obj(this->codep, PyCodeObject);
++ this->filenamep = this->codeo->co_filename;
++ this->fnamep = this->codeo->co_name;
++ this->filenameo = copyin_obj(this->filenamep, PyStringObject);
++ this->fnameo = copyin_obj(this->fnamep, PyStringObject);
++
++ this->len = 1 + this->filenameo->ob_size + 1 + 5 + 2 +
++ this->fnameo->ob_size + 1 + 1;
++
++ this->result = (char *)alloca(this->len);
++ this->pos = 0;
++
++ add_char('@');
++ add_str(this->filenamep, this->filenameo);
++ add_char(':');
++ add_digit(this->lineno, 10000);
++ add_digit(this->lineno, 1000);
++ add_digit(this->lineno, 100);
++ add_digit(this->lineno, 10);
++ add_digit(this->lineno, 1);
++ add_char(' ');
++ add_char('(');
++ add_str(this->fnamep, this->fnameo);
++ add_char(')');
++ this->result[this->pos] = '\0';
++
++ print_result(stringof(this->result));
++}
++
++probe /!at_evalframe(arg0)/
++{
++ NULL;
++}
+diff -up Python-2.6.4/Include/pydtrace.d.systemtap Python-2.6.4/Include/pydtrace.d
+--- Python-2.6.4/Include/pydtrace.d.systemtap 2009-12-18 15:37:15.697243772 -0500
++++ Python-2.6.4/Include/pydtrace.d 2009-12-18 15:37:15.697243772 -0500
+@@ -0,0 +1,10 @@
++provider python {
++ probe function__entry(const char *, const char *, int);
++ probe function__return(const char *, const char *, int);
++};
++
++#pragma D attributes Evolving/Evolving/Common provider python provider
++#pragma D attributes Private/Private/Common provider python module
++#pragma D attributes Private/Private/Common provider python function
++#pragma D attributes Evolving/Evolving/Common provider python name
++#pragma D attributes Evolving/Evolving/Common provider python args
+diff -up Python-2.6.4/Makefile.pre.in.systemtap Python-2.6.4/Makefile.pre.in
+--- Python-2.6.4/Makefile.pre.in.systemtap 2009-12-18 15:37:15.399242581 -0500
++++ Python-2.6.4/Makefile.pre.in 2009-12-18 15:37:15.715242573 -0500
+@@ -290,6 +290,7 @@ PYTHON_OBJS= \
+ Python/formatter_unicode.o \
+ Python/formatter_string.o \
+ Python/$(DYNLOADFILE) \
++ @DTRACEOBJS@ \
+ $(LIBOBJS) \
+ $(MACHDEP_OBJS) \
+ $(THREADOBJ)
+@@ -577,6 +578,23 @@ Python/formatter_unicode.o: $(srcdir)/Py
+ Python/formatter_string.o: $(srcdir)/Python/formatter_string.c \
+ $(STRINGLIB_HEADERS)
+
++# Only needed with --with-dtrace
++buildinclude:
++ mkdir -p Include
++Python/phelper.o: buildinclude $(srcdir)/Include/phelper.d
++ dtrace -o $@ -DPHELPER $(DFLAGS) $(CPPFLAGS) -C -G -s $(srcdir)/Include/phelper.d
++
++Include/pydtrace.h: buildinclude $(srcdir)/Include/pydtrace.d
++ dtrace -o $@ $(DFLAGS) -C -h -s $(srcdir)/Include/pydtrace.d
++
++Include/phelper.h: buildinclude $(srcdir)/Include/phelper.d
++ dtrace -o $@ $(DFLAGS) -C -h -s $(srcdir)/Python/python.d
++
++Python/ceval.o: Include/pydtrace.h
++
++Python/dtrace.o: buildinclude $(srcdir)/Include/pydtrace.d Python/ceval.o
++ dtrace -o $@ $(DFLAGS) -C -G -s $(srcdir)/Include/pydtrace.d Python/ceval.o
++
+ ############################################################################
+ # Header files
+
+@@ -1213,6 +1231,6 @@ Python/thread.o: @THREADHEADERS@
+ .PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
+ .PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
+ .PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean
+-.PHONY: smelly funny patchcheck
++.PHONY: smelly funny patchcheck buildinclude
+
+ # IF YOU PUT ANYTHING HERE IT WILL GO AWAY
+diff -up Python-2.6.4/Objects/frameobject.c.systemtap Python-2.6.4/Objects/frameobject.c
+--- Python-2.6.4/Objects/frameobject.c.systemtap 2009-06-01 19:27:15.000000000 -0400
++++ Python-2.6.4/Objects/frameobject.c 2009-12-18 15:37:15.715242573 -0500
+@@ -698,6 +698,9 @@ PyFrame_New(PyThreadState *tstate, PyCod
+ f->f_tstate = tstate;
+
+ f->f_lasti = -1;
++#ifdef WITH_DTRACE
++ f->f_calllineno = code->co_firstlineno;
++#endif
+ f->f_lineno = code->co_firstlineno;
+ f->f_iblock = 0;
+
+diff -up Python-2.6.4/pyconfig.h.in.systemtap Python-2.6.4/pyconfig.h.in
+--- Python-2.6.4/pyconfig.h.in.systemtap 2009-12-18 15:37:15.649243175 -0500
++++ Python-2.6.4/pyconfig.h.in 2009-12-18 15:37:15.719242803 -0500
+@@ -5,6 +5,9 @@
+ #define Py_PYCONFIG_H
+
+
++/* Define if building universal (internal helper macro) */
++#undef AC_APPLE_UNIVERSAL_BUILD
++
+ /* Define for AIX if your compiler is a genuine IBM xlC/xlC_r and you want
+ support for AIX C++ shared extension modules. */
+ #undef AIX_GENUINE_CPLUSPLUS
+@@ -945,6 +948,28 @@
+ /* Define to 1 if your <sys/time.h> declares `struct tm'. */
+ #undef TM_IN_SYS_TIME
+
++/* Enable extensions on AIX 3, Interix. */
++#ifndef _ALL_SOURCE
++# undef _ALL_SOURCE
++#endif
++/* Enable GNU extensions on systems that have them. */
++#ifndef _GNU_SOURCE
++# undef _GNU_SOURCE
++#endif
++/* Enable threading extensions on Solaris. */
++#ifndef _POSIX_PTHREAD_SEMANTICS
++# undef _POSIX_PTHREAD_SEMANTICS
++#endif
++/* Enable extensions on HP NonStop. */
++#ifndef _TANDEM_SOURCE
++# undef _TANDEM_SOURCE
++#endif
++/* Enable general extensions on Solaris. */
++#ifndef __EXTENSIONS__
++# undef __EXTENSIONS__
++#endif
++
++
+ /* Define if you want to use MacPython modules on MacOSX in unix-Python. */
+ #undef USE_TOOLBOX_OBJECT_GLUE
+
+@@ -964,6 +989,9 @@
+ /* Define if you want documentation strings in extension modules */
+ #undef WITH_DOC_STRINGS
+
++/* Define if you want to compile in Dtrace support */
++#undef WITH_DTRACE
++
+ /* Define if you want to use the new-style (Openstep, Rhapsody, MacOS) dynamic
+ linker (dyld) instead of the old-style (NextStep) dynamic linker (rld).
+ Dyld is necessary to support frameworks. */
+@@ -1017,15 +1045,25 @@
+ /* This must be defined on some systems to enable large file support. */
+ #undef _LARGEFILE_SOURCE
+
++/* Define to 1 if on MINIX. */
++#undef _MINIX
++
+ /* Define on NetBSD to activate all library features */
+ #undef _NETBSD_SOURCE
+
+ /* Define _OSF_SOURCE to get the makedev macro. */
+ #undef _OSF_SOURCE
+
++/* Define to 2 if the system does not provide POSIX.1 features except with
++ this defined. */
++#undef _POSIX_1_SOURCE
++
+ /* Define to activate features from IEEE Stds 1003.1-2001 */
+ #undef _POSIX_C_SOURCE
+
++/* Define to 1 if you need to in order for `stat' and other things to work. */
++#undef _POSIX_SOURCE
++
+ /* Define if you have POSIX threads, and your system does not define that. */
+ #undef _POSIX_THREADS
+
+diff -up Python-2.6.4/Python/ceval.c.systemtap Python-2.6.4/Python/ceval.c
+--- Python-2.6.4/Python/ceval.c.systemtap 2009-05-30 17:43:48.000000000 -0400
++++ Python-2.6.4/Python/ceval.c 2009-12-18 15:37:15.723242474 -0500
+@@ -19,6 +19,10 @@
+
+ #include <ctype.h>
+
++#ifdef WITH_DTRACE
++#include "pydtrace.h"
++#endif
++
+ #ifndef WITH_TSC
+
+ #define READ_TIMESTAMP(var)
+@@ -527,6 +531,55 @@ PyEval_EvalCode(PyCodeObject *co, PyObje
+ NULL);
+ }
+
++#ifdef WITH_DTRACE
++static void
++dtrace_entry(PyFrameObject *f)
++{
++ const char *filename;
++ const char *fname;
++ int lineno;
++
++ filename = PyString_AsString(f->f_code->co_filename);
++ fname = PyString_AsString(f->f_code->co_name);
++ lineno = PyCode_Addr2Line(f->f_code, f->f_lasti);
++
++ PYTHON_FUNCTION_ENTRY((char *)filename, (char *)fname, lineno);
++
++ /*
++ * Currently a USDT tail-call will not receive the correct arguments.
++ * Disable the tail call here.
++ */
++#if defined(__sparc)
++ asm("nop");
++#endif
++}
++
++static void
++dtrace_return(PyFrameObject *f)
++{
++ const char *filename;
++ const char *fname;
++ int lineno;
++
++ filename = PyString_AsString(f->f_code->co_filename);
++ fname = PyString_AsString(f->f_code->co_name);
++ lineno = PyCode_Addr2Line(f->f_code, f->f_lasti);
++ PYTHON_FUNCTION_RETURN((char *)filename, (char *)fname, lineno);
++
++ /*
++ * Currently a USDT tail-call will not receive the correct arguments.
++ * Disable the tail call here.
++ */
++#if defined(__sparc)
++ asm("nop");
++#endif
++}
++#else
++#define PYTHON_FUNCTION_ENTRY_ENABLED() 0
++#define PYTHON_FUNCTION_RETURN_ENABLED() 0
++#define dtrace_entry(f)
++#define dtrace_return(f)
++#endif
+
+ /* Interpreter main loop */
+
+@@ -538,9 +591,84 @@ PyEval_EvalFrame(PyFrameObject *f) {
+ return PyEval_EvalFrameEx(f, 0);
+ }
+
++/*
++ * These shenanigans look like utter madness, but what we're actually doing is
++ * making sure that the ustack helper will see the PyFrameObject pointer on the
++ * stack. We have two tricky cases:
++ *
++ * amd64
++ *
++ * We use up the six registers for passing arguments, meaning the call can't
++ * use a register for passing 'f', and has to push it onto the stack in a known
++ * location.
++ *
++ * And how does "throwflag" figure in to this? -PN
++ *
++ * SPARC
++ *
++ * Here the problem is that (on 32-bit) the compiler is re-using %i0 before
++ * some calls inside PyEval_EvalFrameReal(), which means that when it's saved,
++ * it's just some junk value rather than the real first argument. So, instead,
++ * we trace our proxy PyEval_EvalFrame(), where we 'know' the compiler
won't
++ * decide to re-use %i0. We also need to defeat optimization of our proxy.
++ */
++
++#if defined(WITH_DTRACE)
++
++#if defined(__amd64)
++PyObject *PyEval_EvalFrameExReal(long, long, long, long, long, long,
++ PyFrameObject *, int throwflag);
++
++
++
+ PyObject *
+ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
+ {
++ volatile PyObject *f2;
++ f2 = PyEval_EvalFrameExReal(0, 0, 0, 0, 0, 0, f, throwflag);
++ return (PyObject *)f2;
++}
++
++PyObject *
++PyEval_EvalFrameExReal(long a1, long a2, long a3, long a4, long a5, long a6,
++ PyFrameObject *f, int throwflag)
++{
++
++#elif defined(__sparc)
++
++PyObject *PyEval_EvalFrameExReal(PyFrameObject *f, int throwflag);
++
++volatile int dummy;
++
++PyObject *
++PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
++{
++ volatile PyObject *f2;
++ f2 = PyEval_EvalFrameExReal(f, throwflag);
++ dummy = f->ob_refcnt;
++ return (PyObject *)f2;
++}
++
++PyObject *
++PyEval_EvalFrameExReal(PyFrameObject *f, int throwflag)
++{
++
++#else /* __amd64 || __sparc */
++
++PyObject *
++PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
++{
++
++#endif /* __amd64 || __sparc */
++
++#else /* WITH_DTRACE not defined */
++
++PyObject *
++PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
++{
++
++#endif /* WITH_DTRACE */
++
+ #ifdef DXPAIRS
+ int lastopcode = 0;
+ #endif
+@@ -763,6 +891,9 @@ PyEval_EvalFrameEx(PyFrameObject *f, int
+ }
+ }
+
++ if (PYTHON_FUNCTION_ENTRY_ENABLED())
++ dtrace_entry(f);
++
+ co = f->f_code;
+ names = co->co_names;
+ consts = co->co_consts;
+@@ -2383,6 +2514,10 @@ PyEval_EvalFrameEx(PyFrameObject *f, int
+ PyObject **sp;
+ PCALL(PCALL_ALL);
+ sp = stack_pointer;
++#ifdef WITH_DTRACE
++ f->f_calllineno = PyCode_Addr2Line(f->f_code,
++ f->f_lasti);
++#endif
+ #ifdef WITH_TSC
+ x = call_function(&sp, oparg, &intr0, &intr1);
+ #else
+@@ -2425,6 +2560,11 @@ PyEval_EvalFrameEx(PyFrameObject *f, int
+ } else
+ Py_INCREF(func);
+ sp = stack_pointer;
++#ifdef WITH_DTRACE
++ f->f_calllineno = PyCode_Addr2Line(f->f_code,
++ f->f_lasti);
++#endif
++
+ READ_TIMESTAMP(intr0);
+ x = ext_do_call(func, &sp, flags, na, nk);
+ READ_TIMESTAMP(intr1);
+@@ -2723,6 +2863,8 @@ fast_yield:
+
+ /* pop frame */
+ exit_eval_frame:
++ if (PYTHON_FUNCTION_RETURN_ENABLED())
++ dtrace_return(f);
+ Py_LeaveRecursiveCall();
+ tstate->frame = f->f_back;
+
diff --git a/python.spec b/python.spec
index d2492f0..425b6cf 100644
--- a/python.spec
+++ b/python.spec
@@ -34,6 +34,7 @@
%global with_gdb_hooks 1
+%global with_systemtap 1
# Some of the files below /usr/lib/pythonMAJOR.MINOR/test (e.g. bad_coding.py)
# are deliberately invalid, leading to SyntaxError exceptions if they get
@@ -51,7 +52,7 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
Version: 2.6.4
-Release: 16%{?dist}
+Release: 17%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -64,13 +65,9 @@ Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
#
# These hooks are implemented in Python itself
#
-# We'll install them into the same path as the library, with a -gdb.py suffix
-# e.g.
-# /usr/lib/libpython2.6.so.1.0-gdb.py
-#
-# It would be better to put them in the -debuginfo subpackage e.g. here:
+# gdb-archer looks for them in the same path as the ELF file, with a -gdb.py suffix.
+# We put them in the debuginfo package by installing them to e.g.:
# /usr/lib/debug/usr/lib/libpython2.6.so.1.0.debug-gdb.py
-# but unfortunately it's hard to add custom content to a debuginfo subpackage
#
# See
https://fedoraproject.org/wiki/Features/EasierPythonDebugging for more
# information
@@ -238,6 +235,11 @@ Patch53: python-2.6-update-bsddb3-4.8.patch
# ...and a further patch to setup.py so that it searches for 4.8:
Patch54: python-2.6.4-setup-db48.patch
+# Systemtap support: add statically-defined probe points
+# Patch based on upstream bug:
http://bugs.python.org/issue4111
+# fixed up by mjw and mcohen for 2.6.2, then fixed up by dmalcolm for 2.6.4
+Patch55: python-2.6.4-dtrace.patch
+
# "lib64 patches"
# This patch seems to be associated with bug 122304, which was
#
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=93184...
@@ -299,6 +301,11 @@ BuildRequires: db4-devel >= 4.8
BuildRequires: libffi-devel
BuildRequires: valgrind-devel
+%if 0%{?with_systemtap}
+BuildRequires: systemtap-sdt-devel
+%global tapsetdir /usr/share/systemtap/tapset
+%endif
+
URL:
http://www.python.org/
%description
@@ -450,6 +457,7 @@ rm -r Modules/zlib || exit 1
%patch52 -p0 -b .valgrind
%patch53 -p1 -b .db48
%patch54 -p1 -b .setup-db48
+%patch55 -p1 -b .systemtap
%ifarch alpha ia64
# 64bit, but not lib64 arches need this too...
@@ -476,14 +484,29 @@ if pkg-config openssl ; then
fi
# Force CC
export CC=gcc
-# For patches 4 and 52, need to get a newer configure generated out of configure.in
+
+# We need to get a newer configure generated out of configure.in for the following
+# patches:
+# patch 4 (CFLAGS)
+# patch 52 (valgrind)
+# patch 55 (systemtap)
+# Rerun autoconf:
autoconf
+
+# For patch 55 (systemtap), we need to get a new header for configure to use:
+autoheader
+
+# Use the freshly created "configure" script:
%configure \
--enable-ipv6 \
--enable-unicode=%{unicode} \
--enable-shared \
--with-system-ffi \
--with-system-expat \
+%if 0%{?with_systemtap}
+ --with-dtrace \
+ --with-tapset-install-dir=%{tapsetdir} \
+%endif
--with-valgrind
make OPT="$CFLAGS" %{?_smp_mflags}
@@ -659,8 +682,18 @@ ldd %{buildroot}/%{dynload_dir}/_curses*.so \
# but doing so generated noise when ldconfig was rerun (rhbz:562980)
#
%if 0%{?with_gdb_hooks}
-mkdir -p %{buildroot}%{_prefix}/lib/debug/%{_libdir}
-cp libpython/libpython.py
%{buildroot}%{_prefix}/lib/debug/%{_libdir}/%{py_INSTSONAME}.debug-gdb.py
+%global dir_holding_gdb_py %{_prefix}/lib/debug/%{_libdir}
+%global path_of_gdb_py %{dir_holding_gdb_py}/%{py_INSTSONAME}.debug-gdb.py
+
+mkdir -p %{buildroot}%{dir_holding_gdb_py}
+cp libpython/libpython.py %{buildroot}%{path_of_gdb_py}
+
+# Manually byte-compile the file, in case find-debuginfo.sh is run before
+# brp-python-bytecompile, so that the .pyc/.pyo files are properly listed in
+# the debuginfo manifest:
+LD_LIBRARY_PATH=. ./python -c "import compileall; import sys;
compileall.compile_dir('%{buildroot}%{dir_holding_gdb_py}',
ddir='%{dir_holding_gdb_py}')"
+
+LD_LIBRARY_PATH=. ./python -O -c "import compileall; import sys;
compileall.compile_dir('%{buildroot}%{dir_holding_gdb_py}',
ddir='%{dir_holding_gdb_py}')"
%endif # with_gdb_hooks
%clean
@@ -870,6 +903,13 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
+* Tue Feb 9 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-17
+- add systemtap static probes (wcohen; patch 55; rh bug #545179)
+- update some comments in specfile relating to gdb work
+- manually byte-compile the gdb.py file with the freshly-built python to ensure
+that .pyx and .pyo files make it into the debuginfo manifest if they are later
+byte-compiled after find-debuginfo.sh is run
+
* Mon Feb 8 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-16
- move the -gdb.py file from %%{_libdir}/INSTSONAME-gdb.py to
%%{_prefix}/lib/debug/%%{_libdir}/INSTSONAME.debug-gdb.py to avoid noise from
commit 32b70397e75350ec3cbadd318029a0c31a11b4bf
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Tue Feb 9 03:00:11 2010 +0000
- move the -gdb.py file from %%{_libdir}/INSTSONAME-gdb.py to
%%{_prefix}/lib/debug/%%{_libdir}/INSTSONAME.debug-gdb.py to avoid
noise from ldconfig (bug 562980), and which should also ensure it
becomes part of the debuginfo subpackage, rather than the libs
subpackage
- introduce %%{py_SOVERSION} and %%{py_INSTSONAME} to reflect the upstream
configure script, and to avoid fragile scripts that try to figure this
out dynamically (e.g. for the -gdb.py change)
diff --git a/python.spec b/python.spec
index e80241b..d2492f0 100644
--- a/python.spec
+++ b/python.spec
@@ -22,6 +22,16 @@
%global dynload_dir %{pylibdir}/lib-dynload
%global site_packages %{pylibdir}/site-packages
+# Python's configure script defines SOVERSION, and this is used in the Makefile
+# to determine INSTSONAME, the name of the libpython DSO:
+# LDLIBRARY='libpython$(VERSION).so'
+# INSTSONAME="$LDLIBRARY".$SOVERSION
+# We mirror this here in order to make it easier to add the -gdb.py hooks.
+# (if these get out of sync, the payload of the libs subpackage will fail
+# and halt the build)
+%global py_SOVERSION 1.0
+%global py_INSTSONAME libpython%{pybasever}.so.%{py_SOVERSION}
+
%global with_gdb_hooks 1
@@ -41,7 +51,7 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
Version: 2.6.4
-Release: 15%{?dist}
+Release: 16%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -641,17 +651,16 @@ ldd %{buildroot}/%{dynload_dir}/_curses*.so \
# Copy up the gdb hooks into place; the python file will be autoloaded by gdb
# when visiting libpython.so, provided that the python file is installed to the
# same path as the library (or its .debug file) plus a "-gdb.py" suffix, e.g:
+# /usr/lib/debug/usr/lib64/libpython2.6.so.1.0.debug-gdb.py
+# (note that the debug path is /usr/lib/debug for both 32/64 bit)
+#
+# Initially I tried:
# /usr/lib/libpython2.6.so.1.0-gdb.py
+# but doing so generated noise when ldconfig was rerun (rhbz:562980)
#
-# Long term, this should probably go in the debuginfo subpackage, e.g:
-# /usr/lib/debug/usr/lib/libpython2.6.so.1.0.debug-gdb.py
-#
-# We use a for loop here to avoid having the RHS of the cp command be quoted,
-# leading to a filename with a "*" character embedded in it
%if 0%{?with_gdb_hooks}
-for lib in %{buildroot}%{_libdir}/libpython%{pybasever}.so.* ; do
- cp libpython/libpython.py ${lib}-gdb.py
-done
+mkdir -p %{buildroot}%{_prefix}/lib/debug/%{_libdir}
+cp libpython/libpython.py
%{buildroot}%{_prefix}/lib/debug/%{_libdir}/%{py_INSTSONAME}.debug-gdb.py
%endif # with_gdb_hooks
%clean
@@ -799,11 +808,7 @@ rm -fr %{buildroot}
%files libs
%defattr(-,root,root,-)
%doc LICENSE README
-%{_libdir}/libpython%{pybasever}.so.*
-%if 0%{?with_gdb_hooks}
-%{_libdir}/libpython%{pybasever}.so.*-gdb.py*
-%endif # with_gdb_hooks
-
+%{_libdir}/%{py_INSTSONAME}
%files devel
%defattr(-,root,root,-)
@@ -851,7 +856,29 @@ rm -fr %{buildroot}
%{dynload_dir}/_ctypes_test.so
%{dynload_dir}/_testcapimodule.so
+# We put the debug-gdb.py file inside /usr/lib/debug to avoid noise from
+# ldconfig (rhbz:562980).
+#
+# The /usr/lib/rpm/redhat/macros defines %__debug_package to use
+# debugfiles.list, and it appears that everything below /usr/lib/debug and
+# (/usr/src/debug) gets added to this file (via LISTFILES) in
+# /usr/lib/rpm/find-debuginfo.sh
+#
+# Hence by installing it below /usr/lib/debug we ensure it is added to the
+# -debuginfo subpackage
+# (if it doesn't, then the rpmbuild ought to fail since the debug-gdb.py
+# payload file would be unpackaged)
+
%changelog
+* Mon Feb 8 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-16
+- move the -gdb.py file from %%{_libdir}/INSTSONAME-gdb.py to
+%%{_prefix}/lib/debug/%%{_libdir}/INSTSONAME.debug-gdb.py to avoid noise from
+ldconfig (bug 562980), and which should also ensure it becomes part of the
+debuginfo subpackage, rather than the libs subpackage
+- introduce %%{py_SOVERSION} and %%{py_INSTSONAME} to reflect the upstream
+configure script, and to avoid fragile scripts that try to figure this out
+dynamically (e.g. for the -gdb.py change)
+
* Mon Feb 8 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-15
- work around bug 562906 by supplying a fixed version of pythondeps.sh
- set %%{_python_bytecompile_errors_terminate_build} to 0 to prevent the broken
commit 4bb3fe187806c51faf3fb16025a59c04230cfb6d
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Mon Feb 8 19:58:25 2010 +0000
- work around bug 562906 by supplying a fixed version of pythondeps.sh
- set %%{_python_bytecompile_errors_terminate_build} to 0 to prevent the
broken test files from killing the build on buildroots where python is
installed
diff --git a/python.spec b/python.spec
index 058e099..e80241b 100644
--- a/python.spec
+++ b/python.spec
@@ -24,10 +24,24 @@
%global with_gdb_hooks 1
+
+# Some of the files below /usr/lib/pythonMAJOR.MINOR/test (e.g. bad_coding.py)
+# are deliberately invalid, leading to SyntaxError exceptions if they get
+# byte-compiled.
+#
+# These errors are ignored by the normal python build, and aren't normally a
+# problem in the buildroots since /usr/bin/python isn't present.
+#
+# However, for the case where we're rebuilding the python srpm on a machine
+# that does have python installed we need to set this to avoid
+# brp-python-bytecompile treating these as fatal errors:
+#
+%global _python_bytecompile_errors_terminate_build 0
+
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
Version: 2.6.4
-Release: 14%{?dist}
+Release: 15%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -56,6 +70,12 @@ Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
Source1: libpython-36a517ef7848cbd0b3dcc7371f32e47ac4c87eba.tar.gz
+# Work around bug 562906 until it's fixed in rpm-build by providing a fixed
+# version of pythondeps.sh:
+Source2: pythondeps.sh
+%global __python_requires %{SOURCE2}
+
+
# Modules/Setup.dist is ultimately used by the "makesetup" script to construct
# the Makefile and config.c
#
@@ -832,6 +852,11 @@ rm -fr %{buildroot}
%{dynload_dir}/_testcapimodule.so
%changelog
+* Mon Feb 8 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-15
+- work around bug 562906 by supplying a fixed version of pythondeps.sh
+- set %%{_python_bytecompile_errors_terminate_build} to 0 to prevent the broken
+test files from killing the build on buildroots where python is installed
+
* Fri Feb 5 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-14
- add gdb hooks for easier debugging
diff --git a/pythondeps.sh b/pythondeps.sh
new file mode 100755
index 0000000..10a060a
--- /dev/null
+++ b/pythondeps.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+[ $# -ge 1 ] || {
+ cat > /dev/null
+ exit 0
+}
+
+case $1 in
+-P|--provides)
+ shift
+ # Match buildroot/payload paths of the form
+ # /PATH/OF/BUILDROOT/usr/bin/pythonMAJOR.MINOR
+ # generating a line of the form
+ # python(abi) = MAJOR.MINOR
+ # (Don't match against -config tools e.g. /usr/bin/python2.6-config)
+ grep "/usr/bin/python.\..$" \
+ | sed -e "s|.*/usr/bin/python\(.\..\)|python(abi) = \1|"
+ ;;
+-R|--requires)
+ shift
+ # Match buildroot paths of the form
+ # /PATH/OF/BUILDROOT/usr/lib/pythonMAJOR.MINOR/ and
+ # /PATH/OF/BUILDROOT/usr/lib64/pythonMAJOR.MINOR/
+ # generating (uniqely) lines of the form:
+ # python(abi) = MAJOR.MINOR
+ grep "/usr/lib[^/]*/python.\../.*" \
+ | sed -e "s|.*/usr/lib[^/]*/python\(.\..\)/.*|python(abi) = \1|g" \
+ | sort | uniq
+ ;;
+esac
+
+exit 0
commit b25d6022fc8d6ae3880fa2f5bc5a3cc83f921df3
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Sat Feb 6 00:37:39 2010 +0000
- add gdb hooks for easier debugging
diff --git a/libpython-36a517ef7848cbd0b3dcc7371f32e47ac4c87eba.tar.gz
b/libpython-36a517ef7848cbd0b3dcc7371f32e47ac4c87eba.tar.gz
new file mode 100644
index 0000000..3e0959e
Binary files /dev/null and b/libpython-36a517ef7848cbd0b3dcc7371f32e47ac4c87eba.tar.gz
differ
diff --git a/python.spec b/python.spec
index 7683e7c..058e099 100644
--- a/python.spec
+++ b/python.spec
@@ -22,16 +22,40 @@
%global dynload_dir %{pylibdir}/lib-dynload
%global site_packages %{pylibdir}/site-packages
+%global with_gdb_hooks 1
+
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
Version: 2.6.4
-Release: 13%{?dist}
+Release: 14%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
Provides: python(abi) = %{pybasever}
Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
+
+# We install a collection of hooks for gdb that make it easier to debug
+# executables linked against libpython (such as /usr/lib/python itself)
+#
+# These hooks are implemented in Python itself
+#
+# We'll install them into the same path as the library, with a -gdb.py suffix
+# e.g.
+# /usr/lib/libpython2.6.so.1.0-gdb.py
+#
+# It would be better to put them in the -debuginfo subpackage e.g. here:
+# /usr/lib/debug/usr/lib/libpython2.6.so.1.0.debug-gdb.py
+# but unfortunately it's hard to add custom content to a debuginfo subpackage
+#
+# See
https://fedoraproject.org/wiki/Features/EasierPythonDebugging for more
+# information
+#
+# Downloaded from:
+#
http://fedorapeople.org/gitweb?p=dmalcolm/public_git/libpython.git;a=snap...
+Source1: libpython-36a517ef7848cbd0b3dcc7371f32e47ac4c87eba.tar.gz
+
+
# Modules/Setup.dist is ultimately used by the "makesetup" script to construct
# the Makefile and config.c
#
@@ -349,6 +373,12 @@ code that uses more than just unittest and/or test_support.py.
%prep
%setup -q -n Python-%{version}
+# Unpack source archive 1 into this same dir without deleting (-D; -T suppress
+# trying to unpack source 0 again):
+%if 0%{?with_gdb_hooks}
+%setup -q -n Python-%{version} -T -D -a 1
+%endif # with_gdb_hooks
+
# Ensure that we're using the system copy of various libraries, rather than
# copies shipped by upstream in the tarball:
# Remove embedded copy of expat:
@@ -587,6 +617,23 @@ ldd %{buildroot}/%{dynload_dir}/_curses*.so \
| grep curses \
| grep libncurses.so && (echo "_curses.so linked against
libncurses.so" ; exit 1)
+
+# Copy up the gdb hooks into place; the python file will be autoloaded by gdb
+# when visiting libpython.so, provided that the python file is installed to the
+# same path as the library (or its .debug file) plus a "-gdb.py" suffix, e.g:
+# /usr/lib/libpython2.6.so.1.0-gdb.py
+#
+# Long term, this should probably go in the debuginfo subpackage, e.g:
+# /usr/lib/debug/usr/lib/libpython2.6.so.1.0.debug-gdb.py
+#
+# We use a for loop here to avoid having the RHS of the cp command be quoted,
+# leading to a filename with a "*" character embedded in it
+%if 0%{?with_gdb_hooks}
+for lib in %{buildroot}%{_libdir}/libpython%{pybasever}.so.* ; do
+ cp libpython/libpython.py ${lib}-gdb.py
+done
+%endif # with_gdb_hooks
+
%clean
rm -fr %{buildroot}
@@ -733,6 +780,10 @@ rm -fr %{buildroot}
%defattr(-,root,root,-)
%doc LICENSE README
%{_libdir}/libpython%{pybasever}.so.*
+%if 0%{?with_gdb_hooks}
+%{_libdir}/libpython%{pybasever}.so.*-gdb.py*
+%endif # with_gdb_hooks
+
%files devel
%defattr(-,root,root,-)
@@ -781,6 +832,9 @@ rm -fr %{buildroot}
%{dynload_dir}/_testcapimodule.so
%changelog
+* Fri Feb 5 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-14
+- add gdb hooks for easier debugging
+
* Fri Jan 29 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-13
- document all patches, and remove the commented-out ones
commit 9b458a58b3ae3778df4d58b219654c18da213db2
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Sat Jan 30 00:17:35 2010 +0000
- document all patches, and remove the commented-out ones
diff --git a/python.spec b/python.spec
index 75047da..7683e7c 100644
--- a/python.spec
+++ b/python.spec
@@ -25,33 +25,146 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
Version: 2.6.4
-Release: 12%{?dist}
+Release: 13%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
Provides: python(abi) = %{pybasever}
Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
+# Modules/Setup.dist is ultimately used by the "makesetup" script to construct
+# the Makefile and config.c
+#
+# Upstream leaves many things disabled by default, to try to make it easy as
+# possible to build the code on as many platforms as possible.
+#
+# TODO: many modules can also now be built by setup.py after the python binary
+# has been built; need to assess if we should instead build things there
+#
+# We patch it downstream as follows:
+# - various modules are built by default by upstream as static libraries;
+# we built them as shared libraries
+# - build the "readline" module (appears to also be handled by setup.py now)
+# - enable the build of the following modules:
+# - array arraymodule.c # array objects
+# - cmath cmathmodule.c # -lm # complex math library functions
+# - math mathmodule.c # -lm # math library functions, e.g. sin()
+# - _struct _struct.c # binary structure packing/unpacking
+# - time timemodule.c # -lm # time operations and variables
+# - operator operator.c # operator.add() and similar goodies
+# - _weakref _weakref.c # basic weak reference support
+# - _testcapi _testcapimodule.c # Python C API test module
+# - _random _randommodule.c # Random number generator
+# - _collections _collectionsmodule.c # Container types
+# - itertools itertoolsmodule.c
+# - strop stropmodule.c
+# - _functools _functoolsmodule.c
+# - _bisect _bisectmodule.c # Bisection algorithms
+# - unicodedata unicodedata.c # static Unicode character database
+# - _locale _localemodule.c
+# - fcntl fcntlmodule.c # fcntl(2) and ioctl(2)
+# - spwd spwdmodule.c # spwd(3)
+# - grp grpmodule.c # grp(3)
+# - select selectmodule.c # select(2); not on ancient System V
+# - mmap mmapmodule.c # Memory-mapped files
+# - _csv _csv.c # CSV file helper
+# - _socket socketmodule.c # Socket module helper for socket(2)
+# - _ssl _ssl.c
+# - crypt cryptmodule.c -lcrypt # crypt(3)
+# - nis nismodule.c -lnsl # Sun yellow pages -- not everywhere
+# - termios termios.c # Steen Lumholt's termios module
+# - resource resource.c # Jeremy Hylton's rlimit interface
+# - audioop audioop.c # Operations on audio samples
+# - imageop imageop.c # Operations on images
+# - _md5 md5module.c md5.c
+# - _sha shamodule.c
+# - _sha256 sha256module.c
+# - _sha512 sha512module.c
+# - linuxaudiodev linuxaudiodev.c
+# - timing timingmodule.c
+# - _tkinter _tkinter.c tkappinit.c
+# - dl dlmodule.c
+# - gdbm gdbmmodule.c
+# - _bsddb _bsddb.c
+# - binascii binascii.c
+# - parser parsermodule.c
+# - cStringIO cStringIO.c
+# - cPickle cPickle.c
+# - zlib zlibmodule.c
+# - _multibytecodec cjkcodecs/multibytecodec.c
+# - _codecs_cn cjkcodecs/_codecs_cn.c
+# - _codecs_hk cjkcodecs/_codecs_hk.c
+# - _codecs_iso2022 cjkcodecs/_codecs_iso2022.c
+# - _codecs_jp cjkcodecs/_codecs_jp.c
+# - _codecs_kr cjkcodecs/_codecs_kr.c
+# - _codecs_tw cjkcodecs/_codecs_tw.c
Patch0: python-2.6.2-config.patch
+
+# Removes the "-g" option from "pydoc", for some reason; I believe
+# (dmalcolm 2010-01-29) that this was introduced in this change:
+# - fix pydoc (#68082)
+# in 2.2.1-12 as a response to the -g option needing TkInter installed
+# (Red Hat Linux 8)
+# Not upstream
Patch1: Python-2.2.1-pydocnogui.patch
-#Patch2: python-2.3.4-pydocnodoc.patch
# Fixup configure.in and setup.py to build against system expat library.
# Adapted from
http://svn.python.org/view?view=rev&revision=77169
Patch3: python-2.6.2-with-system-expat.patch
+# Add $(CFLAGS) to the linker arguments when linking the "python" binary
+# since some architectures (sparc64) need this (rhbz:199373).
+# Not yet filed upstream
Patch4: python-2.5-cflags.patch
-#Patch5: python-2.5.1-ctypes-exec-stack.patch
+
+# Work around a bug in Python' gettext module relating to the
"Plural-Forms"
+# header (rhbz:252136)
+# Related to upstream issues:
+#
http://bugs.python.org/issue1448060 and
http://bugs.python.org/issue1475523
+# though the proposed upstream patches are, alas, different
Patch6: python-2.5.1-plural-fix.patch
+
+# This patch was listed in the changelog as:
+# * Fri Sep 14 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-11
+# - fix encoding of sqlite .py files to work around weird encoding problem
+# in Turkish (#283331)
+# A traceback attached to rhbz 244016 shows the problem most clearly: a
+# traceback on attempting to import the sqlite module, with:
+# "SyntaxError: encoding problem: with BOM (__init__.py, line 1)"
+# This seems to come from Parser/tokenizer.c:check_coding_spec
+# Our patch changes two source files within sqlite3, removing the
+# "coding: ISO-8859-1" specs and character E4 = U+00E4 =
+# LATIN SMALL LETTER A WITH DIAERESIS from in ghaering's surname.
+#
+# It may be that the conversion of "ISO-8859-1" to "iso-8859-1" is
thwarted
+# by the implementation of "tolower" in the Turkish locale; see:
+#
https://bugzilla.redhat.com/show_bug.cgi?id=191096#c9
+#
+# TODO: Not yet sent upstream, and appears to me (dmalcolm 2010-01-29) that
+# it may be papering over a symptom
Patch7: python-2.5.1-sqlite-encoding.patch
-#Patch8: python-2.5-xmlrpclib-marshal-objects.patch
-#Patch9: python-2.5-tkinter.patch
+
+# FIXME: Lib/ctypes/util.py posix implementation defines a function
+# _get_soname(f). Upstreams's implementation of this uses objdump to read the
+# SONAME from a library; we avoid this, apparently to minimize space
+# requirements on the live CD:
+# (rhbz:307221)
Patch10: python-2.6.2-binutils-no-dep.patch
+
+# FIXME: appears to relate to:
+#* Tue Oct 30 2007 James Antill <jantill(a)redhat.com> - 2.5.1-15
+#- Do codec lowercase in C Locale.
+#- Resolves: 207134 191096
Patch11: python-2.5.1-codec-ascii-tolower.patch
-#Patch12: python-2.5.1-pysqlite.patch
+
+# Add various constants to the socketmodule (rhbz#436560):
+# TODO: these patches were added in 2.5.1-22 and 2.5.1-24 but appear not to
+# have been sent upstream yet:
Patch13: python-2.5.1-socketmodule-constants.patch
Patch14: python-2.5.1-socketmodule-constants2.patch
-#Patch15: python-2.5.1-listdir.patch
+
+# Remove an "-rpath $(LIBDIR)" argument from the linkage args in configure.in:
+# FIXME: is this for OSF, not Linux?
Patch16: python-2.6-rpath.patch
# Fix distutils to follow the Fedora/RHEL/CentOS policies of having .pyo files
@@ -71,27 +184,39 @@ Patch53: python-2.6-update-bsddb3-4.8.patch
# ...and a further patch to setup.py so that it searches for 4.8:
Patch54: python-2.6.4-setup-db48.patch
-# upstreamed
-
-#Patch50: python-2.5-disable-egginfo.patch
-
-# lib64 patches
+# "lib64 patches"
+# This patch seems to be associated with bug 122304, which was
+#
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=93184...
+# and is now
+#
http://bugs.python.org/issue931848
+# However, as it stands this patch is merely a copy of:
+#
http://svn.python.org/view/python/trunk/Lib/test/test_re.py?r1=35825&...
+# which is already upstream
Patch101: python-2.3.4-lib64-regex.patch
+
+# Only used when "%{_lib}" == "lib64"
+# Fixup various paths throughout the build and in distutils from "lib" to
"lib64",
+# and add the /usr/lib64/pythonMAJOR.MINOR/site-packages to sitedirs, in front of
+# /usr/lib/pythonMAJOR.MINOR/site-packages
+# Not upstream
Patch102: python-2.6-lib64.patch
-# SELinux patches
+# rhbz#488396: rework the ctypes module to use ffi_closure_alloc and
+# ffi_closure_free, rather than malloc_closure.c, since the latter tries to
+# mmap pages with PROT_READ | PROT_WRITE | PROT_EXEC, which SELinux frowns upon.
+#
+# Patch sent upstream as
http://bugs.python.org/issue5504 which also contains
+# a rebasing of the upstream copy of libffi to one containing the
+# memory-management hooks.
+#
+# This appears to be the same as that patch, but without the rebasing of libffi
+# (since we use the system copy of libffi):
Patch110: python-2.6-ctypes-noexecmem.patch
# Patch the Makefile.pre.in so that the generated Makefile doesn't try to build
# a libpythonMAJOR.MINOR.a (bug 550692):
Patch111: python-2.6.4-no-static-lib.patch
-# New API from 2.6
-#Patch260: python-2.5.2-set_wakeup_fd4.patch
-
-#Patch999: python-2.5.CVE-2007-4965-int-overflow.patch
-#Patch998: python-2.5-CVE-2008-2316.patch
-
%if %{main_python}
Obsoletes: Distutils
@@ -243,12 +368,9 @@ rm -r Modules/zlib || exit 1
%patch0 -p1 -b .rhconfig
%patch3 -p1 -b .expat
%patch1 -p1 -b .no_gui
-#%%patch2 -p1 -b .no-doc
%patch4 -p1 -b .cflags
-#%%patch5 -p1 -b .ctypesexec
%patch6 -p1 -b .plural
%patch7 -p1
-#%%patch8 -p1 -b .xmlrpc
# Try not disabling egg-infos, bz#414711
#patch50 -p1 -b .egginfo
@@ -260,10 +382,8 @@ rm -r Modules/zlib || exit 1
%patch10 -p1 -b .binutils-no-dep
%patch11 -p1 -b .ascii-tolower
-#%%patch12 -p1 -b .pysqlite-2.3.3-minimal
%patch13 -p1 -b .socketmodule
%patch14 -p1 -b .socketmodule2
-#%%patch15 -p1 -b .listdir
%patch16 -p1 -b .rpath
%patch51 -p1 -b .brprpm
@@ -280,11 +400,6 @@ rm -r Modules/zlib || exit 1
%patch111 -p1 -b .no-static-lib
-#%%patch260 -p1 -b .set_wakeup_fd
-
-#%%patch999 -p1 -b .cve2007-4965
-#%%patch998 -p0 -b .cve2008-2316
-
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -666,6 +781,9 @@ rm -fr %{buildroot}
%{dynload_dir}/_testcapimodule.so
%changelog
+* Fri Jan 29 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-13
+- document all patches, and remove the commented-out ones
+
* Tue Jan 26 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-12
- Address some of the issues identified in package review (bug 226342):
- update libs requirement on base package to use %%{name} for consistency's
commit 791e9f63b0f050b4478b88a8cbd5b1cbff1a6c47
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Tue Jan 26 23:45:54 2010 +0000
- Address some of the issues identified in package review (bug 226342):
- update libs requirement on base package to use %%{name} for consistency's
sake
- convert from backticks to $() syntax throughout
- wrap value of LD_LIBRARY_PATH in quotes
- convert "/usr/bin/find" requirement to "findutils"
- remove trailing periods from summaries of -devel and -tools subpackages
- fix spelling mistake in description of -test subpackage
- convert usage of $$RPM_BUILD_ROOT to %%{buildroot} throughout, for
stylistic consistency
- supply dirmode arguments to defattr directives
diff --git a/python.spec b/python.spec
index 988c351..75047da 100644
--- a/python.spec
+++ b/python.spec
@@ -25,7 +25,7 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
Version: 2.6.4
-Release: 11%{?dist}
+Release: 12%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -113,7 +113,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u}
-n)
BuildRequires: readline-devel, openssl-devel, gmp-devel
BuildRequires: ncurses-devel, gdbm-devel, zlib-devel, expat-devel
BuildRequires: libGL-devel tk tix gcc-c++ libX11-devel glibc-devel
-BuildRequires: bzip2 tar /usr/bin/find pkgconfig tcl-devel tk-devel
+BuildRequires: bzip2 tar findutils pkgconfig tcl-devel tk-devel
BuildRequires: tix-devel bzip2-devel sqlite-devel
BuildRequires: autoconf
BuildRequires: db4-devel >= 4.8
@@ -142,7 +142,7 @@ package.
%package libs
Summary: The libraries for python runtime
Group: Applications/System
-Requires: %{python} = %{version}-%{release}
+Requires: %{name} = %{version}-%{release}
# Needed for ctypes, to load libraries, worked around for Live CDs size
# Requires: binutils
@@ -152,7 +152,7 @@ use python as an embedded scripting language. The python-libs
package
provides the libraries needed for this.
%package devel
-Summary: The libraries and header files needed for Python development.
+Summary: The libraries and header files needed for Python development
Group: Development/Libraries
Requires: %{python}%{?_isa} = %{version}-%{release}
# Needed here because of the migration of Makefile from -devel to the main
@@ -175,7 +175,7 @@ want to install the python-docs package, which contains Python
documentation.
%package tools
-Summary: A collection of development tools included with Python.
+Summary: A collection of development tools included with Python
Group: Development/Tools
Requires: %{name} = %{version}-%{release}
Requires: %{tkinter} = %{version}-%{release}
@@ -214,7 +214,7 @@ Requires: %{name} = %{version}-%{release}
%description test
-The test modules from the main python pacakge: %{name}
+The test modules from the main python package: %{name}
These have been removed to save space, as they are never or almost
never used in production.
@@ -289,15 +289,15 @@ rm -r Modules/zlib || exit 1
find -name "*~" |xargs rm -f
%build
-topdir=`pwd`
+topdir=$(pwd)
export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC"
export CXXFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC"
-export CPPFLAGS="`pkg-config --cflags-only-I libffi`"
+export CPPFLAGS="$(pkg-config --cflags-only-I libffi)"
export OPT="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC"
export LINKCC="gcc"
if pkg-config openssl ; then
- export CFLAGS="$CFLAGS `pkg-config --cflags openssl`"
- export LDFLAGS="$LDFLAGS `pkg-config --libs-only-L openssl`"
+ export CFLAGS="$CFLAGS $(pkg-config --cflags openssl)"
+ export LDFLAGS="$LDFLAGS $(pkg-config --libs-only-L openssl)"
fi
# Force CC
export CC=gcc
@@ -312,34 +312,34 @@ autoconf
--with-valgrind
make OPT="$CFLAGS" %{?_smp_mflags}
-LD_LIBRARY_PATH=$topdir $topdir/python Tools/scripts/pathfix.py -i "%{_bindir}/env
python%{pybasever}" .
+LD_LIBRARY_PATH="$topdir" $topdir/python Tools/scripts/pathfix.py -i
"%{_bindir}/env python%{pybasever}" .
# Rebuild with new python
# We need a link to a versioned python in the build directory
ln -s python python%{pybasever}
-LD_LIBRARY_PATH=$topdir PATH=$PATH:$topdir make -s OPT="$CFLAGS"
%{?_smp_mflags}
+LD_LIBRARY_PATH="$topdir" PATH=$PATH:$topdir make -s OPT="$CFLAGS"
%{?_smp_mflags}
%install
-[ -d $RPM_BUILD_ROOT ] && rm -fr $RPM_BUILD_ROOT
-mkdir -p $RPM_BUILD_ROOT/usr $RPM_BUILD_ROOT%{_mandir}
+rm -rf %{buildroot}
+mkdir -p %{buildroot}%{_prefix} %{buildroot}%{_mandir}
# Clean up patched .py files that are saved as .lib64
for f in distutils/command/install distutils/sysconfig; do
rm -f Lib/$f.py.lib64
done
-make install DESTDIR=$RPM_BUILD_ROOT
+make install DESTDIR=%{buildroot}
# Fix the interpreter path in binaries installed by distutils
# (which changes them by itself)
# Make sure we preserve the file permissions
-for fixed in $RPM_BUILD_ROOT%{_bindir}/pydoc; do
+for fixed in %{buildroot}%{_bindir}/pydoc; do
sed 's,#!.*/python$,#!%{_bindir}/env python%{pybasever},' $fixed > $fixed-
\
&& cat $fixed- > $fixed && rm -f $fixed-
done
# Junk, no point in putting in -test sub-pkg
-rm -f $RPM_BUILD_ROOT/%{pylibdir}/idlelib/testcode.py*
+rm -f %{buildroot}/%{pylibdir}/idlelib/testcode.py*
# don't include tests that are run at build time in the package
# This is documented, and used: rhbz#387401
@@ -347,18 +347,18 @@ if /bin/false; then
# Move this to -test subpackage.
mkdir save_bits_of_test
for i in test_support.py __init__.py; do
- cp -a $RPM_BUILD_ROOT/%{pylibdir}/test/$i save_bits_of_test
+ cp -a %{buildroot}/%{pylibdir}/test/$i save_bits_of_test
done
-rm -rf $RPM_BUILD_ROOT/%{pylibdir}/test
-mkdir $RPM_BUILD_ROOT/%{pylibdir}/test
-cp -a save_bits_of_test/* $RPM_BUILD_ROOT/%{pylibdir}/test
+rm -rf %{buildroot}/%{pylibdir}/test
+mkdir %{buildroot}/%{pylibdir}/test
+cp -a save_bits_of_test/* %{buildroot}/%{pylibdir}/test
fi
%if %{main_python}
-ln -s python $RPM_BUILD_ROOT%{_bindir}/python2
+ln -s python %{buildroot}%{_bindir}/python2
%else
-mv $RPM_BUILD_ROOT%{_bindir}/python $RPM_BUILD_ROOT%{_bindir}/%{python}
-mv $RPM_BUILD_ROOT/%{_mandir}/man1/python.1
$RPM_BUILD_ROOT/%{_mandir}/man1/python%{pybasever}.1
+mv %{buildroot}%{_bindir}/python %{buildroot}%{_bindir}/%{python}
+mv %{buildroot}/%{_mandir}/man1/python.1
%{buildroot}/%{_mandir}/man1/python%{pybasever}.1
%endif
# tools
@@ -388,36 +388,36 @@ mv Tools/modulator/README Tools/modulator/README.modulator
mv Tools/pynche/README Tools/pynche/README.pynche
#gettext
-install -m755 Tools/i18n/pygettext.py $RPM_BUILD_ROOT%{_bindir}/
-install -m755 Tools/i18n/msgfmt.py $RPM_BUILD_ROOT%{_bindir}/
+install -m755 Tools/i18n/pygettext.py %{buildroot}%{_bindir}/
+install -m755 Tools/i18n/msgfmt.py %{buildroot}%{_bindir}/
# Useful development tools
-install -m755 -d $RPM_BUILD_ROOT%{tools_dir}/scripts
-install Tools/README $RPM_BUILD_ROOT%{tools_dir}/
-install Tools/scripts/*py $RPM_BUILD_ROOT%{tools_dir}/scripts/
+install -m755 -d %{buildroot}%{tools_dir}/scripts
+install Tools/README %{buildroot}%{tools_dir}/
+install Tools/scripts/*py %{buildroot}%{tools_dir}/scripts/
# Documentation tools
-install -m755 -d $RPM_BUILD_ROOT%{doc_tools_dir}
-#install -m755 Doc/tools/mkhowto $RPM_BUILD_ROOT%{doc_tools_dir}
+install -m755 -d %{buildroot}%{doc_tools_dir}
+#install -m755 Doc/tools/mkhowto %{buildroot}%{doc_tools_dir}
# Useful demo scripts
-install -m755 -d $RPM_BUILD_ROOT%{demo_dir}
-cp -ar Demo/* $RPM_BUILD_ROOT%{demo_dir}
+install -m755 -d %{buildroot}%{demo_dir}
+cp -ar Demo/* %{buildroot}%{demo_dir}
# Get rid of crap
-find $RPM_BUILD_ROOT/ -name "*~"|xargs rm -f
-find $RPM_BUILD_ROOT/ -name ".cvsignore"|xargs rm -f
+find %{buildroot}/ -name "*~"|xargs rm -f
+find %{buildroot}/ -name ".cvsignore"|xargs rm -f
find . -name "*~"|xargs rm -f
find . -name ".cvsignore"|xargs rm -f
#zero length
-rm -f $RPM_BUILD_ROOT%{site_packages}/modulator/Templates/copyright
+rm -f %{buildroot}%{site_packages}/modulator/Templates/copyright
-rm -f $RPM_BUILD_ROOT%{pylibdir}/LICENSE.txt
+rm -f %{buildroot}%{pylibdir}/LICENSE.txt
#make the binaries install side by side with the main python
%if !%{main_python}
-pushd $RPM_BUILD_ROOT%{_bindir}
+pushd %{buildroot}%{_bindir}
mv idle idle%{__python_ver}
mv modulator modulator%{__python_ver}
mv pynche pynche%{__python_ver}
@@ -429,11 +429,11 @@ popd
%endif
# Fix for bug #136654
-rm -f $RPM_BUILD_ROOT%{pylibdir}/email/test/data/audiotest.au
$RPM_BUILD_ROOT%{pylibdir}/test/audiotest.au
+rm -f %{buildroot}%{pylibdir}/email/test/data/audiotest.au
%{buildroot}%{pylibdir}/test/audiotest.au
# Fix bug #143667: python should own /usr/lib/python2.x on 64-bit machines
%if "%{_lib}" == "lib64"
-install -d $RPM_BUILD_ROOT/usr/lib/python%{pybasever}/site-packages
+install -d %{buildroot}/usr/lib/python%{pybasever}/site-packages
%endif
# Make python-devel multilib-ready (bug #192747, #139911)
@@ -445,9 +445,9 @@ install -d $RPM_BUILD_ROOT/usr/lib/python%{pybasever}/site-packages
%else
%global _pyconfig_h %{_pyconfig32_h}
%endif
-mv $RPM_BUILD_ROOT%{_includedir}/python%{pybasever}/pyconfig.h \
- $RPM_BUILD_ROOT%{_includedir}/python%{pybasever}/%{_pyconfig_h}
-cat > $RPM_BUILD_ROOT%{_includedir}/python%{pybasever}/pyconfig.h << EOF
+mv %{buildroot}%{_includedir}/python%{pybasever}/pyconfig.h \
+ %{buildroot}%{_includedir}/python%{pybasever}/%{_pyconfig_h}
+cat > %{buildroot}%{_includedir}/python%{pybasever}/pyconfig.h << EOF
#include <bits/wordsize.h>
#if __WORDSIZE == 32
@@ -458,22 +458,22 @@ cat > $RPM_BUILD_ROOT%{_includedir}/python%{pybasever}/pyconfig.h
<< EOF
#error "Unknown word size"
#endif
EOF
-ln -s ../../libpython%{pybasever}.so
$RPM_BUILD_ROOT%{pylibdir}/config/libpython%{pybasever}.so
+ln -s ../../libpython%{pybasever}.so
%{buildroot}%{pylibdir}/config/libpython%{pybasever}.so
# Fix for bug 201434: make sure distutils looks at the right pyconfig.h file
-sed -i -e "s/'pyconfig.h'/'%{_pyconfig_h}'/"
$RPM_BUILD_ROOT%{pylibdir}/distutils/sysconfig.py
+sed -i -e "s/'pyconfig.h'/'%{_pyconfig_h}'/"
%{buildroot}%{pylibdir}/distutils/sysconfig.py
# Get rid of egg-info files (core python modules are installed through rpms)
-rm $RPM_BUILD_ROOT%{pylibdir}/*.egg-info
+rm %{buildroot}%{pylibdir}/*.egg-info
# Ensure that the curses module was linked against libncursesw.so, rather than
# libncurses.so (bug 539917)
-ldd $RPM_BUILD_ROOT/%{dynload_dir}/_curses*.so \
+ldd %{buildroot}/%{dynload_dir}/_curses*.so \
| grep curses \
| grep libncurses.so && (echo "_curses.so linked against
libncurses.so" ; exit 1)
%clean
-rm -fr $RPM_BUILD_ROOT
+rm -fr %{buildroot}
%post libs -p /sbin/ldconfig
@@ -481,7 +481,7 @@ rm -fr $RPM_BUILD_ROOT
%files
-%defattr(-, root, root)
+%defattr(-, root, root, -)
%doc LICENSE README
%{_bindir}/pydoc*
%{_bindir}/%{python}
@@ -615,12 +615,12 @@ rm -fr $RPM_BUILD_ROOT
%{_includedir}/python%{pybasever}/%{_pyconfig_h}
%files libs
-%defattr(-,root,root)
+%defattr(-,root,root,-)
%doc LICENSE README
%{_libdir}/libpython%{pybasever}.so.*
%files devel
-%defattr(-,root,root)
+%defattr(-,root,root,-)
%{pylibdir}/config/*
%exclude %{pylibdir}/config/Makefile
%{_includedir}/python%{pybasever}/*.h
@@ -654,7 +654,7 @@ rm -fr $RPM_BUILD_ROOT
%{dynload_dir}/_tkinter.so
%files test
-%defattr(-, root, root)
+%defattr(-, root, root, -)
%{pylibdir}/bsddb/test
%{pylibdir}/ctypes/test
%{pylibdir}/distutils/tests
@@ -666,6 +666,19 @@ rm -fr $RPM_BUILD_ROOT
%{dynload_dir}/_testcapimodule.so
%changelog
+* Tue Jan 26 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-12
+- Address some of the issues identified in package review (bug 226342):
+ - update libs requirement on base package to use %%{name} for consistency's
+sake
+ - convert from backticks to $() syntax throughout
+ - wrap value of LD_LIBRARY_PATH in quotes
+ - convert "/usr/bin/find" requirement to "findutils"
+ - remove trailing periods from summaries of -devel and -tools subpackages
+ - fix spelling mistake in description of -test subpackage
+ - convert usage of $$RPM_BUILD_ROOT to %%{buildroot} throughout, for
+stylistic consistency
+ - supply dirmode arguments to defattr directives
+
* Mon Jan 25 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-11
- update python-2.6.2-config.patch to remove downstream customization of build
of pyexpat and elementtree modules
commit 94e658aa1ab620466572903a7c430c236a365069
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Tue Jan 26 21:46:40 2010 +0000
- update python-2.6.2-config.patch to remove downstream customization of
build of pyexpat and elementtree modules
- add patch adapted from upstream (patch 3) to add support for building
against system expat; add --with-system-expat to "configure" invocation
- remove embedded copy of expat from source tree during "prep"
diff --git a/python-2.6.2-config.patch b/python-2.6.2-config.patch
index 0900e11..48461ee 100644
--- a/python-2.6.2-config.patch
+++ b/python-2.6.2-config.patch
@@ -1,7 +1,7 @@
-diff -ru Python-2.6-orig Python-2.6
---- Python-2.6.2-orig/Modules/Setup.dist 2008-11-27 05:15:12.000000000 -0500
-+++ Python-2.6.2/Modules/Setup.dist 2009-07-30 15:06:59.000000000 -0400
-@@ -152,7 +152,7 @@
+diff -up Python-2.6.2/Modules/Setup.dist.rhconfig Python-2.6.2/Modules/Setup.dist
+--- Python-2.6.2/Modules/Setup.dist.rhconfig 2008-11-27 05:15:12.000000000 -0500
++++ Python-2.6.2/Modules/Setup.dist 2010-01-25 21:11:01.508867242 -0500
+@@ -152,7 +152,7 @@ GLHACK=-Dclear=__GLclear
# modules are to be built as shared libraries (see above for more
# detail; also note that *static* reverses this effect):
@@ -10,7 +10,7 @@ diff -ru Python-2.6-orig Python-2.6
# GNU readline. Unlike previous Python incarnations, GNU readline is
# now incorporated in an optional module, configured in the Setup file
-@@ -162,74 +162,74 @@
+@@ -162,74 +162,74 @@ GLHACK=-Dclear=__GLclear
# it, depending on your system -- see the GNU readline instructions.
# It's okay for this to be a shared library, too.
@@ -33,10 +33,6 @@ diff -ru Python-2.6-orig Python-2.6
-#itertools itertoolsmodule.c # Functions creating iterators for efficient looping
-#strop stropmodule.c # String manipulations
-#_functools _functoolsmodule.c # Tools for working with functions and callable objects
--#_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI
_elementtree.c # elementtree accelerator
--#_pickle _pickle.c # pickle accelerator
--#datetime datetimemodule.c # date/time type
--#_bisect _bisectmodule.c # Bisection algorithms
+array arraymodule.c # array objects
+cmath cmathmodule.c # -lm # complex math library functions
+math mathmodule.c # -lm # math library functions, e.g. sin()
@@ -50,9 +46,10 @@ diff -ru Python-2.6-orig Python-2.6
+itertools itertoolsmodule.c # Functions creating iterators for efficient looping
+strop stropmodule.c # String manipulations
+_functools _functoolsmodule.c # Tools for working with functions and callable objects
-+_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI
_elementtree.c # elementtree accelerator
-+#_pickle _pickle.c # pickle accelerator
-+#datetime datetimemodule.c # date/time type
+ #_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI
_elementtree.c # elementtree accelerator
+ #_pickle _pickle.c # pickle accelerator
+ #datetime datetimemodule.c # date/time type
+-#_bisect _bisectmodule.c # Bisection algorithms
+_bisect _bisectmodule.c # Bisection algorithms
-#unicodedata unicodedata.c # static Unicode character database
@@ -119,7 +116,7 @@ diff -ru Python-2.6-orig Python-2.6
# Multimedia modules -- off by default.
-@@ -237,8 +237,8 @@
+@@ -237,8 +237,8 @@ GLHACK=-Dclear=__GLclear
# #993173 says audioop works on 64-bit platforms, though.
# These represent audio samples or images as strings:
@@ -130,7 +127,7 @@ diff -ru Python-2.6-orig Python-2.6
# Note that the _md5 and _sha modules are normally only built if the
-@@ -248,14 +248,14 @@
+@@ -248,14 +248,14 @@ GLHACK=-Dclear=__GLclear
# Message-Digest Algorithm, described in RFC 1321. The necessary files
# md5.c and md5.h are included here.
@@ -149,7 +146,7 @@ diff -ru Python-2.6-orig Python-2.6
# SGI IRIX specific modules -- off by default.
-@@ -302,12 +302,12 @@
+@@ -302,12 +302,12 @@ GLHACK=-Dclear=__GLclear
# A Linux specific module -- off by default; this may also work on
# some *BSDs.
@@ -164,7 +161,7 @@ diff -ru Python-2.6-orig Python-2.6
# The _tkinter module.
-@@ -322,7 +322,7 @@
+@@ -322,7 +322,7 @@ GLHACK=-Dclear=__GLclear
# every system.
# *** Always uncomment this (leave the leading underscore in!):
@@ -173,7 +170,7 @@ diff -ru Python-2.6-orig Python-2.6
# *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
# -L/usr/local/lib \
# *** Uncomment and edit to reflect where your Tcl/Tk headers are:
-@@ -332,7 +332,7 @@
+@@ -332,7 +332,7 @@ GLHACK=-Dclear=__GLclear
# *** Or uncomment this for Solaris:
# -I/usr/openwin/include \
# *** Uncomment and edit for Tix extension only:
@@ -182,7 +179,7 @@ diff -ru Python-2.6-orig Python-2.6
# *** Uncomment and edit for BLT extension only:
# -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \
# *** Uncomment and edit for PIL (TkImaging) extension only:
-@@ -341,7 +341,7 @@
+@@ -341,7 +341,7 @@ GLHACK=-Dclear=__GLclear
# *** Uncomment and edit for TOGL extension only:
# -DWITH_TOGL togl.c \
# *** Uncomment and edit to reflect your Tcl/Tk versions:
@@ -191,7 +188,7 @@ diff -ru Python-2.6-orig Python-2.6
# *** Uncomment and edit to reflect where your X11 libraries are:
# -L/usr/X11R6/lib \
# *** Or uncomment this for Solaris:
-@@ -351,7 +351,7 @@
+@@ -351,7 +351,7 @@ GLHACK=-Dclear=__GLclear
# *** Uncomment for AIX:
# -lld \
# *** Always uncomment this; X11 libraries to link with:
@@ -200,7 +197,7 @@ diff -ru Python-2.6-orig Python-2.6
# Lance Ellinghaus's syslog module
#syslog syslogmodule.c # syslog daemon interface
-@@ -373,7 +373,7 @@
+@@ -373,7 +373,7 @@ GLHACK=-Dclear=__GLclear
# it is a highly experimental and dangerous device for calling
# *arbitrary* C functions in *arbitrary* shared libraries:
@@ -209,7 +206,7 @@ diff -ru Python-2.6-orig Python-2.6
# Modules that provide persistent dictionary-like semantics. You will
-@@ -396,7 +396,7 @@
+@@ -396,7 +396,7 @@ GLHACK=-Dclear=__GLclear
#
# First, look at Setup.config; configure may have set this for you.
@@ -218,7 +215,8 @@ diff -ru Python-2.6-orig Python-2.6
# Sleepycat Berkeley DB interface.
-@@ -412,10 +412,9 @@
+@@ -411,11 +411,10 @@ GLHACK=-Dclear=__GLclear
+ #
# Edit the variables DB and DBLIBVERto point to the db top directory
# and the subdirectory of PORT where you built it.
-#DB=/usr/local/BerkeleyDB.4.0
@@ -233,7 +231,7 @@ diff -ru Python-2.6-orig Python-2.6
# Historical Berkeley DB 1.85
#
-@@ -430,14 +429,14 @@
+@@ -430,14 +429,14 @@ GLHACK=-Dclear=__GLclear
# Helper module for various ascii-encoders
@@ -252,7 +250,7 @@ diff -ru Python-2.6-orig Python-2.6
# Lee Busby's SIGFPE modules.
-@@ -460,7 +459,7 @@
+@@ -460,7 +459,7 @@ GLHACK=-Dclear=__GLclear
# Andrew Kuchling's zlib module.
# This require zlib 1.1.3 (or later).
# See
http://www.gzip.org/zlib/
@@ -261,14 +259,7 @@ diff -ru Python-2.6-orig Python-2.6
# Interface to the Expat XML parser
#
-@@ -473,20 +472,20 @@
- #
- # 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 -DUSE_PYEXPAT_CAPI
-
-
+@@ -479,14 +478,14 @@ GLHACK=-Dclear=__GLclear
# Hye-Shik Chang's CJKCodecs
# multibytecodec is required for all the other CJK codec modules
@@ -290,22 +281,3 @@ diff -ru Python-2.6-orig Python-2.6
# Example -- included for reference only:
# xx xxmodule.c
---- Python-2.6.2-orig/setup.py 2009-07-30 14:56:58.000000000 -0400
-+++ Python-2.6.2/setup.py 2009-07-30 15:07:39.000000000 -0400
-@@ -1203,7 +1203,6 @@
-
- exts.append(Extension('pyexpat',
- define_macros = define_macros,
-- include_dirs = [expatinc],
- sources = ['pyexpat.c',
- 'expat/xmlparse.c',
- 'expat/xmlrole.c',
-@@ -1218,7 +1217,6 @@
- define_macros.append(('USE_PYEXPAT_CAPI', None))
- exts.append(Extension('_elementtree',
- define_macros = define_macros,
-- include_dirs = [expatinc],
- sources = ['_elementtree.c'],
- ))
- else:
-Only in Python-2.6.2: setup.py~
diff --git a/python-2.6.2-with-system-expat.patch b/python-2.6.2-with-system-expat.patch
new file mode 100644
index 0000000..2510aef
--- /dev/null
+++ b/python-2.6.2-with-system-expat.patch
@@ -0,0 +1,67 @@
+diff -up Python-2.6.2/configure.in.expat Python-2.6.2/configure.in
+--- Python-2.6.2/configure.in.expat 2010-01-25 21:46:42.700858981 -0500
++++ Python-2.6.2/configure.in 2010-01-25 21:46:54.710857387 -0500
+@@ -1898,6 +1898,13 @@ LIBS="$withval $LIBS"
+ ],
+ [AC_MSG_RESULT(no)])
+
++# Check for use of the system expat library
++AC_MSG_CHECKING(for --with-system-expat)
++AC_ARG_WITH(system_expat,
++ AC_HELP_STRING(--with-system-expat, build pyexpat module using an installed
expat library))
++
++AC_MSG_RESULT($with_system_expat)
++
+ # Check for use of the system libffi library
+ AC_MSG_CHECKING(for --with-system-ffi)
+ AC_ARG_WITH(system_ffi,
+diff -up Python-2.6.2/setup.py.expat Python-2.6.2/setup.py
+--- Python-2.6.2/setup.py.expat 2010-01-25 21:46:48.490911125 -0500
++++ Python-2.6.2/setup.py 2010-01-25 21:46:54.711857933 -0500
+@@ -1196,19 +1196,26 @@ class PyBuildExt(build_ext):
+ #
+ # More information on Expat can be found at
www.libexpat.org.
+ #
+- expatinc = os.path.join(os.getcwd(), srcdir, 'Modules',
'expat')
+- define_macros = [
+- ('HAVE_EXPAT_CONFIG_H', '1'),
+- ]
++ if '--with-system-expat' in
sysconfig.get_config_var("CONFIG_ARGS"):
++ expat_inc = []
++ define_macros = []
++ expat_lib = ['expat']
++ expat_sources = []
++ else:
++ expat_inc = [os.path.join(os.getcwd(), srcdir, 'Modules',
'expat')]
++ define_macros = [
++ ('HAVE_EXPAT_CONFIG_H', '1'),
++ ]
++ expat_lib = []
++ expat_sources = ['expat/xmlparse.c',
++ 'expat/xmlrole.c',
++ 'expat/xmltok.c']
+
+ exts.append(Extension('pyexpat',
+ define_macros = define_macros,
+- include_dirs = [expatinc],
+- sources = ['pyexpat.c',
+- 'expat/xmlparse.c',
+- 'expat/xmlrole.c',
+- 'expat/xmltok.c',
+- ],
++ include_dirs = expat_inc,
++ libraries = expat_lib,
++ sources = ['pyexpat.c'] + expat_sources
+ ))
+
+ # Fredrik Lundh's cElementTree module. Note that this also
+@@ -1218,7 +1225,8 @@ class PyBuildExt(build_ext):
+ define_macros.append(('USE_PYEXPAT_CAPI', None))
+ exts.append(Extension('_elementtree',
+ define_macros = define_macros,
+- include_dirs = [expatinc],
++ include_dirs = expat_inc,
++ libraries = expat_lib,
+ sources = ['_elementtree.c'],
+ ))
+ else:
diff --git a/python.spec b/python.spec
index d68a2f1..988c351 100644
--- a/python.spec
+++ b/python.spec
@@ -25,7 +25,7 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
Version: 2.6.4
-Release: 10%{?dist}
+Release: 11%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -35,6 +35,11 @@ Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
Patch0: python-2.6.2-config.patch
Patch1: Python-2.2.1-pydocnogui.patch
#Patch2: python-2.3.4-pydocnodoc.patch
+
+# Fixup configure.in and setup.py to build against system expat library.
+# Adapted from
http://svn.python.org/view?view=rev&revision=77169
+Patch3: python-2.6.2-with-system-expat.patch
+
Patch4: python-2.5-cflags.patch
#Patch5: python-2.5.1-ctypes-exec-stack.patch
Patch6: python-2.5.1-plural-fix.patch
@@ -221,6 +226,9 @@ code that uses more than just unittest and/or test_support.py.
# Ensure that we're using the system copy of various libraries, rather than
# copies shipped by upstream in the tarball:
+# Remove embedded copy of expat:
+rm -r Modules/expat || exit 1
+
# Remove embedded copy of libffi:
for SUBDIR in darwin libffi libffi_arm_wince libffi_msvc libffi_osx ; do
rm -r Modules/_ctypes/$SUBDIR || exit 1 ;
@@ -233,6 +241,7 @@ rm -r Modules/zlib || exit 1
# Apply patches:
#
%patch0 -p1 -b .rhconfig
+%patch3 -p1 -b .expat
%patch1 -p1 -b .no_gui
#%%patch2 -p1 -b .no-doc
%patch4 -p1 -b .cflags
@@ -299,6 +308,7 @@ autoconf
--enable-unicode=%{unicode} \
--enable-shared \
--with-system-ffi \
+ --with-system-expat \
--with-valgrind
make OPT="$CFLAGS" %{?_smp_mflags}
@@ -656,6 +666,13 @@ rm -fr $RPM_BUILD_ROOT
%{dynload_dir}/_testcapimodule.so
%changelog
+* Mon Jan 25 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-11
+- update python-2.6.2-config.patch to remove downstream customization of build
+of pyexpat and elementtree modules
+- add patch adapted from upstream (patch 3) to add support for building against
+system expat; add --with-system-expat to "configure" invocation
+- remove embedded copy of expat from source tree during "prep"
+
* Mon Jan 25 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-10
- introduce macros for 3 directories, replacing expanded references throughout:
%%{pylibdir}, %%{dynload_dir}, %%{site_packages}
commit 05912b1cfad2c30a048fc351aa4364bb41b977bb
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Mon Jan 25 21:41:09 2010 +0000
- introduce macros for 3 directories, replacing expanded references
throughout: %%{pylibdir}, %%{dynload_dir}, %%{site_packages}
- explicitly list all lib-dynload files, rather than dynamically gathering
the payload into a temporary text file, so that we can be sure what we
are shipping; remove now-redundant testing for presence of certain .so
files
- remove embedded copy of zlib from source tree before building
diff --git a/python.spec b/python.spec
index 5c6498d..d68a2f1 100644
--- a/python.spec
+++ b/python.spec
@@ -15,14 +15,17 @@
%endif
%global pybasever 2.6
-%global tools_dir %{_libdir}/python%{pybasever}/Tools
-%global demo_dir %{_libdir}/python%{pybasever}/Demo
-%global doc_tools_dir %{_libdir}/python%{pybasever}/Doc/tools
+%global pylibdir %{_libdir}/python%{pybasever}
+%global tools_dir %{pylibdir}/Tools
+%global demo_dir %{pylibdir}/Demo
+%global doc_tools_dir %{pylibdir}/Doc/tools
+%global dynload_dir %{pylibdir}/lib-dynload
+%global site_packages %{pylibdir}/site-packages
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
Version: 2.6.4
-Release: 9%{?dist}
+Release: 10%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -216,12 +219,19 @@ code that uses more than just unittest and/or test_support.py.
%prep
%setup -q -n Python-%{version}
-# Ensure that we're using the system copy of libffi, rather than the copy
-# shipped by upstream in the tarball:
+# Ensure that we're using the system copy of various libraries, rather than
+# copies shipped by upstream in the tarball:
+# Remove embedded copy of libffi:
for SUBDIR in darwin libffi libffi_arm_wince libffi_msvc libffi_osx ; do
rm -r Modules/_ctypes/$SUBDIR || exit 1 ;
done
+# Remove embedded copy of zlib:
+rm -r Modules/zlib || exit 1
+
+#
+# Apply patches:
+#
%patch0 -p1 -b .rhconfig
%patch1 -p1 -b .no_gui
#%%patch2 -p1 -b .no-doc
@@ -319,7 +329,7 @@ for fixed in $RPM_BUILD_ROOT%{_bindir}/pydoc; do
done
# Junk, no point in putting in -test sub-pkg
-rm -f $RPM_BUILD_ROOT/%{_libdir}/python%{pybasever}/idlelib/testcode.py*
+rm -f $RPM_BUILD_ROOT/%{pylibdir}/idlelib/testcode.py*
# don't include tests that are run at build time in the package
# This is documented, and used: rhbz#387401
@@ -327,11 +337,11 @@ if /bin/false; then
# Move this to -test subpackage.
mkdir save_bits_of_test
for i in test_support.py __init__.py; do
- cp -a $RPM_BUILD_ROOT/%{_libdir}/python%{pybasever}/test/$i save_bits_of_test
+ cp -a $RPM_BUILD_ROOT/%{pylibdir}/test/$i save_bits_of_test
done
-rm -rf $RPM_BUILD_ROOT/%{_libdir}/python%{pybasever}/test
-mkdir $RPM_BUILD_ROOT/%{_libdir}/python%{pybasever}/test
-cp -a save_bits_of_test/* $RPM_BUILD_ROOT/%{_libdir}/python%{pybasever}/test
+rm -rf $RPM_BUILD_ROOT/%{pylibdir}/test
+mkdir $RPM_BUILD_ROOT/%{pylibdir}/test
+cp -a save_bits_of_test/* $RPM_BUILD_ROOT/%{pylibdir}/test
fi
%if %{main_python}
@@ -343,26 +353,26 @@ mv $RPM_BUILD_ROOT/%{_mandir}/man1/python.1
$RPM_BUILD_ROOT/%{_mandir}/man1/pyth
# tools
-mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/python%{pybasever}/site-packages
+mkdir -p ${RPM_BUILD_ROOT}%{site_packages}
#modulator
cat > ${RPM_BUILD_ROOT}%{_bindir}/modulator << EOF
#!/bin/bash
-exec %{_libdir}/python%{pybasever}/site-packages/modulator/modulator.py
+exec %{site_packages}/modulator/modulator.py
EOF
chmod 755 ${RPM_BUILD_ROOT}%{_bindir}/modulator
cp -r Tools/modulator \
- ${RPM_BUILD_ROOT}%{_libdir}/python%{pybasever}/site-packages/
+ ${RPM_BUILD_ROOT}%{site_packages}/
#pynche
cat > ${RPM_BUILD_ROOT}%{_bindir}/pynche << EOF
#!/bin/bash
-exec %{_libdir}/python%{pybasever}/site-packages/pynche/pynche
+exec %{site_packages}/pynche/pynche
EOF
chmod 755 ${RPM_BUILD_ROOT}%{_bindir}/pynche
rm -f Tools/pynche/*.pyw
cp -r Tools/pynche \
- ${RPM_BUILD_ROOT}%{_libdir}/python%{pybasever}/site-packages/
+ ${RPM_BUILD_ROOT}%{site_packages}/
mv Tools/modulator/README Tools/modulator/README.modulator
mv Tools/pynche/README Tools/pynche/README.pynche
@@ -390,9 +400,9 @@ find $RPM_BUILD_ROOT/ -name ".cvsignore"|xargs rm -f
find . -name "*~"|xargs rm -f
find . -name ".cvsignore"|xargs rm -f
#zero length
-rm -f
$RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/site-packages/modulator/Templates/copyright
+rm -f $RPM_BUILD_ROOT%{site_packages}/modulator/Templates/copyright
-rm -f $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/LICENSE.txt
+rm -f $RPM_BUILD_ROOT%{pylibdir}/LICENSE.txt
#make the binaries install side by side with the main python
@@ -408,15 +418,8 @@ mv pydoc pydoc%{__python_ver}
popd
%endif
-find $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/lib-dynload -type d | sed
"s|$RPM_BUILD_ROOT|%dir |" > dynfiles
-find $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/lib-dynload -type f | \
- grep -v "_tkinter.so$" | \
- grep -v "_ctypes_test.so$" | \
- grep -v "_testcapimodule.so$" | \
- sed "s|$RPM_BUILD_ROOT||" >> dynfiles
-
# Fix for bug #136654
-rm -f $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/email/test/data/audiotest.au
$RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/test/audiotest.au
+rm -f $RPM_BUILD_ROOT%{pylibdir}/email/test/data/audiotest.au
$RPM_BUILD_ROOT%{pylibdir}/test/audiotest.au
# Fix bug #143667: python should own /usr/lib/python2.x on 64-bit machines
%if "%{_lib}" == "lib64"
@@ -445,26 +448,17 @@ cat > $RPM_BUILD_ROOT%{_includedir}/python%{pybasever}/pyconfig.h
<< EOF
#error "Unknown word size"
#endif
EOF
-ln -s ../../libpython%{pybasever}.so
$RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/config/libpython%{pybasever}.so
+ln -s ../../libpython%{pybasever}.so
$RPM_BUILD_ROOT%{pylibdir}/config/libpython%{pybasever}.so
# Fix for bug 201434: make sure distutils looks at the right pyconfig.h file
-sed -i -e "s/'pyconfig.h'/'%{_pyconfig_h}'/"
$RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/distutils/sysconfig.py
+sed -i -e "s/'pyconfig.h'/'%{_pyconfig_h}'/"
$RPM_BUILD_ROOT%{pylibdir}/distutils/sysconfig.py
# Get rid of egg-info files (core python modules are installed through rpms)
-rm $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/*.egg-info
-
-# python's build is stupid and doesn't fail if extensions fail to build
-# let's list a few that we care about...
-for so in _bsddb.so _ctypes.so _curses.so _elementtree.so _sqlite3.so _ssl.so readline.so
_hashlib.so zlibmodule.so bz2.so pyexpat.so; do
- if [ ! -f $RPM_BUILD_ROOT/%{_libdir}/python%{pybasever}/lib-dynload/$so ]; then
- echo "Missing $so!!!"
- exit 1
- fi
-done
+rm $RPM_BUILD_ROOT%{pylibdir}/*.egg-info
# Ensure that the curses module was linked against libncursesw.so, rather than
# libncurses.so (bug 539917)
-ldd $RPM_BUILD_ROOT/%{_libdir}/python%{pybasever}/lib-dynload/_curses*.so \
+ldd $RPM_BUILD_ROOT/%{dynload_dir}/_curses*.so \
| grep curses \
| grep libncurses.so && (echo "_curses.so linked against
libncurses.so" ; exit 1)
@@ -476,7 +470,7 @@ rm -fr $RPM_BUILD_ROOT
%postun libs -p /sbin/ldconfig
-%files -f dynfiles
+%files
%defattr(-, root, root)
%doc LICENSE README
%{_bindir}/pydoc*
@@ -487,41 +481,116 @@ rm -fr $RPM_BUILD_ROOT
%{_bindir}/python%{pybasever}
%{_mandir}/*/*
-%dir %{_libdir}/python%{pybasever}
-%dir %{_libdir}/python%{pybasever}/site-packages
-%{_libdir}/python%{pybasever}/site-packages/README
-%{_libdir}/python%{pybasever}/*.py*
-%{_libdir}/python%{pybasever}/*.doc
-%dir %{_libdir}/python%{pybasever}/bsddb
-%{_libdir}/python%{pybasever}/bsddb/*.py*
-%{_libdir}/python%{pybasever}/compiler
-%dir %{_libdir}/python%{pybasever}/ctypes
-%{_libdir}/python%{pybasever}/ctypes/*.py*
-%{_libdir}/python%{pybasever}/ctypes/macholib
-%{_libdir}/python%{pybasever}/curses
-%dir %{_libdir}/python%{pybasever}/distutils
-%{_libdir}/python%{pybasever}/distutils/*.py*
-%{_libdir}/python%{pybasever}/distutils/README
-%{_libdir}/python%{pybasever}/distutils/command
-%dir %{_libdir}/python%{pybasever}/email
-%{_libdir}/python%{pybasever}/email/*.py*
-%{_libdir}/python%{pybasever}/email/mime
-%{_libdir}/python%{pybasever}/encodings
-%{_libdir}/python%{pybasever}/hotshot
-%{_libdir}/python%{pybasever}/idlelib
-%dir %{_libdir}/python%{pybasever}/json
-%{_libdir}/python%{pybasever}/json/*.py*
-%{_libdir}/python%{pybasever}/lib2to3
-%{_libdir}/python%{pybasever}/logging
-%{_libdir}/python%{pybasever}/multiprocessing
-%{_libdir}/python%{pybasever}/plat-linux2
-%dir %{_libdir}/python%{pybasever}/sqlite3
-%{_libdir}/python%{pybasever}/sqlite3/*.py*
-%dir %{_libdir}/python%{pybasever}/test
-%{_libdir}/python%{pybasever}/test/test_support.py*
-%{_libdir}/python%{pybasever}/test/__init__.py*
-%{_libdir}/python%{pybasever}/wsgiref
-%{_libdir}/python%{pybasever}/xml
+%dir %{pylibdir}
+%dir %{dynload_dir}
+%{dynload_dir}/Python-%{version}-py%{pybasever}.egg-info
+%{dynload_dir}/_bisectmodule.so
+%{dynload_dir}/_bsddb.so
+%{dynload_dir}/_bytesio.so
+%{dynload_dir}/_codecs_cn.so
+%{dynload_dir}/_codecs_hk.so
+%{dynload_dir}/_codecs_iso2022.so
+%{dynload_dir}/_codecs_jp.so
+%{dynload_dir}/_codecs_kr.so
+%{dynload_dir}/_codecs_tw.so
+%{dynload_dir}/_collectionsmodule.so
+%{dynload_dir}/_csv.so
+%{dynload_dir}/_ctypes.so
+%{dynload_dir}/_curses.so
+%{dynload_dir}/_curses_panel.so
+%{dynload_dir}/_elementtree.so
+%{dynload_dir}/_fileio.so
+%{dynload_dir}/_functoolsmodule.so
+%{dynload_dir}/_hashlib.so
+%{dynload_dir}/_heapq.so
+%{dynload_dir}/_hotshot.so
+%{dynload_dir}/_json.so
+%{dynload_dir}/_localemodule.so
+%{dynload_dir}/_lsprof.so
+%{dynload_dir}/_md5module.so
+%{dynload_dir}/_multibytecodecmodule.so
+%{dynload_dir}/_multiprocessing.so
+%{dynload_dir}/_randommodule.so
+%{dynload_dir}/_sha256module.so
+%{dynload_dir}/_sha512module.so
+%{dynload_dir}/_shamodule.so
+%{dynload_dir}/_socketmodule.so
+%{dynload_dir}/_sqlite3.so
+%{dynload_dir}/_ssl.so
+%{dynload_dir}/_struct.so
+%{dynload_dir}/_weakref.so
+%{dynload_dir}/arraymodule.so
+%{dynload_dir}/audioop.so
+%{dynload_dir}/binascii.so
+%{dynload_dir}/bz2.so
+%{dynload_dir}/cPickle.so
+%{dynload_dir}/cStringIO.so
+%{dynload_dir}/cmathmodule.so
+%{dynload_dir}/cryptmodule.so
+%{dynload_dir}/datetime.so
+%{dynload_dir}/dbm.so
+%{dynload_dir}/dlmodule.so
+%{dynload_dir}/fcntlmodule.so
+%{dynload_dir}/future_builtins.so
+%{dynload_dir}/gdbmmodule.so
+%{dynload_dir}/grpmodule.so
+%{dynload_dir}/imageop.so
+%{dynload_dir}/itertoolsmodule.so
+%{dynload_dir}/linuxaudiodev.so
+%{dynload_dir}/mathmodule.so
+%{dynload_dir}/mmapmodule.so
+%{dynload_dir}/nismodule.so
+%{dynload_dir}/operator.so
+%{dynload_dir}/ossaudiodev.so
+%{dynload_dir}/parsermodule.so
+%{dynload_dir}/pyexpat.so
+%{dynload_dir}/readline.so
+%{dynload_dir}/resource.so
+%{dynload_dir}/selectmodule.so
+%{dynload_dir}/spwdmodule.so
+%{dynload_dir}/stropmodule.so
+%{dynload_dir}/syslog.so
+%{dynload_dir}/termios.so
+%{dynload_dir}/timemodule.so
+%{dynload_dir}/timingmodule.so
+%{dynload_dir}/unicodedata.so
+%{dynload_dir}/xxsubtype.so
+%{dynload_dir}/zlibmodule.so
+
+%dir %{site_packages}
+%{site_packages}/README
+%{pylibdir}/*.py*
+%{pylibdir}/*.doc
+%dir %{pylibdir}/bsddb
+%{pylibdir}/bsddb/*.py*
+%{pylibdir}/compiler
+%dir %{pylibdir}/ctypes
+%{pylibdir}/ctypes/*.py*
+%{pylibdir}/ctypes/macholib
+%{pylibdir}/curses
+%dir %{pylibdir}/distutils
+%{pylibdir}/distutils/*.py*
+%{pylibdir}/distutils/README
+%{pylibdir}/distutils/command
+%dir %{pylibdir}/email
+%{pylibdir}/email/*.py*
+%{pylibdir}/email/mime
+%{pylibdir}/encodings
+%{pylibdir}/hotshot
+%{pylibdir}/idlelib
+%dir %{pylibdir}/json
+%{pylibdir}/json/*.py*
+%{pylibdir}/lib2to3
+%{pylibdir}/logging
+%{pylibdir}/multiprocessing
+%{pylibdir}/plat-linux2
+%dir %{pylibdir}/sqlite3
+%{pylibdir}/sqlite3/*.py*
+%dir %{pylibdir}/test
+%{pylibdir}/test/test_support.py*
+%{pylibdir}/test/__init__.py*
+%{pylibdir}/wsgiref
+%{pylibdir}/xml
%if "%{_lib}" == "lib64"
%attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}
%attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}/site-packages
@@ -530,8 +599,8 @@ rm -fr $RPM_BUILD_ROOT
# "Makefile" and the config-32/64.h file are needed by
# distutils/sysconfig.py:_init_posix(), so we include them in the core
# package, along with their parent directories (bug 531901):
-%dir %{_libdir}/python%{pybasever}/config
-%{_libdir}/python%{pybasever}/config/Makefile
+%dir %{pylibdir}/config
+%{pylibdir}/config/Makefile
%dir %{_includedir}/python%{pybasever}
%{_includedir}/python%{pybasever}/%{_pyconfig_h}
@@ -542,22 +611,22 @@ rm -fr $RPM_BUILD_ROOT
%files devel
%defattr(-,root,root)
-%{_libdir}/python%{pybasever}/config/*
-%exclude %{_libdir}/python%{pybasever}/config/Makefile
+%{pylibdir}/config/*
+%exclude %{pylibdir}/config/Makefile
%{_includedir}/python%{pybasever}/*.h
%exclude %{_includedir}/python%{pybasever}/%{_pyconfig_h}
%doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit
%{_bindir}/python-config
%{_bindir}/python%{pybasever}-config
-%{_libdir}/python%{pybasever}/config/*
+%{pylibdir}/config/*
%{_libdir}/libpython%{pybasever}.so
%files tools
%defattr(-,root,root,755)
%doc Tools/modulator/README.modulator
%doc Tools/pynche/README.pynche
-%{_libdir}/python%{pybasever}/site-packages/modulator
-%{_libdir}/python%{pybasever}/site-packages/pynche
+%{site_packages}/modulator
+%{site_packages}/pynche
%{_bindir}/smtpd*.py*
%{_bindir}/2to3*
%{_bindir}/idle*
@@ -567,26 +636,34 @@ rm -fr $RPM_BUILD_ROOT
%{_bindir}/msgfmt*.py*
%{tools_dir}
%{demo_dir}
-%{_libdir}/python%{pybasever}/Doc
+%{pylibdir}/Doc
%files -n %{tkinter}
%defattr(-,root,root,755)
-%{_libdir}/python%{pybasever}/lib-tk
-%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
+%{pylibdir}/lib-tk
+%{dynload_dir}/_tkinter.so
%files test
%defattr(-, root, root)
-%{_libdir}/python%{pybasever}/bsddb/test
-%{_libdir}/python%{pybasever}/ctypes/test
-%{_libdir}/python%{pybasever}/distutils/tests
-%{_libdir}/python%{pybasever}/email/test
-%{_libdir}/python%{pybasever}/json/tests
-%{_libdir}/python%{pybasever}/sqlite3/test
-%{_libdir}/python%{pybasever}/test
-%{_libdir}/python%{pybasever}/lib-dynload/_ctypes_test.so
-%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
+%{pylibdir}/bsddb/test
+%{pylibdir}/ctypes/test
+%{pylibdir}/distutils/tests
+%{pylibdir}/email/test
+%{pylibdir}/json/tests
+%{pylibdir}/sqlite3/test
+%{pylibdir}/test
+%{dynload_dir}/_ctypes_test.so
+%{dynload_dir}/_testcapimodule.so
%changelog
+* Mon Jan 25 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-10
+- introduce macros for 3 directories, replacing expanded references throughout:
+%%{pylibdir}, %%{dynload_dir}, %%{site_packages}
+- explicitly list all lib-dynload files, rather than dynamically gathering the
+payload into a temporary text file, so that we can be sure what we are
+shipping; remove now-redundant testing for presence of certain .so files
+- remove embedded copy of zlib from source tree before building
+
* Mon Jan 25 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-9
- change python-2.6.2-config.patch to remove our downstream change to curses
configuration in Modules/Setup.dist, so that the curses modules are built using
commit 671ce7735df7aecbb0b2a5938c0e23c913887392
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Mon Jan 25 18:42:04 2010 +0000
- change python-2.6.2-config.patch to remove our downstream change to
curses configuration in Modules/Setup.dist, so that the curses modules
are built using setup.py with the downstream default (linking against
libncursesw.so, rather than libncurses.so), rather than within the
Makefile; add a test to %%install to verify the dso files that the
curses module is linked against the correct DSO (bug 539917; changes
_cursesmodule.so -> _curses.so)
diff --git a/python-2.6.2-config.patch b/python-2.6.2-config.patch
index f7a8616..0900e11 100644
--- a/python-2.6.2-config.patch
+++ b/python-2.6.2-config.patch
@@ -200,18 +200,6 @@ diff -ru Python-2.6-orig Python-2.6
# Lance Ellinghaus's syslog module
#syslog syslogmodule.c # syslog daemon interface
-@@ -363,9 +363,9 @@
- #
- # First, look at Setup.config; configure may have set this for you.
-
--#_curses _cursesmodule.c -lcurses -ltermcap
-+_curses _cursesmodule.c -lcurses -ltermcap
- # Wrapper for the panel library that's part of ncurses and SYSV curses.
--#_curses_panel _curses_panel.c -lpanel -lncurses
-+_curses_panel _curses_panel.c -lpanel -lncurses
-
-
- # Generic (SunOS / SVR4) dynamic loading module.
@@ -373,7 +373,7 @@
# it is a highly experimental and dangerous device for calling
# *arbitrary* C functions in *arbitrary* shared libraries:
diff --git a/python.spec b/python.spec
index b64357e..5c6498d 100644
--- a/python.spec
+++ b/python.spec
@@ -22,7 +22,7 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
Version: 2.6.4
-Release: 8%{?dist}
+Release: 9%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -455,13 +455,19 @@ rm $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/*.egg-info
# python's build is stupid and doesn't fail if extensions fail to build
# let's list a few that we care about...
-for so in _bsddb.so _ctypes.so _cursesmodule.so _elementtree.so _sqlite3.so _ssl.so
readline.so _hashlib.so zlibmodule.so bz2.so pyexpat.so; do
+for so in _bsddb.so _ctypes.so _curses.so _elementtree.so _sqlite3.so _ssl.so readline.so
_hashlib.so zlibmodule.so bz2.so pyexpat.so; do
if [ ! -f $RPM_BUILD_ROOT/%{_libdir}/python%{pybasever}/lib-dynload/$so ]; then
echo "Missing $so!!!"
exit 1
fi
done
+# Ensure that the curses module was linked against libncursesw.so, rather than
+# libncurses.so (bug 539917)
+ldd $RPM_BUILD_ROOT/%{_libdir}/python%{pybasever}/lib-dynload/_curses*.so \
+ | grep curses \
+ | grep libncurses.so && (echo "_curses.so linked against
libncurses.so" ; exit 1)
+
%clean
rm -fr $RPM_BUILD_ROOT
@@ -581,6 +587,14 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
%changelog
+* Mon Jan 25 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-9
+- change python-2.6.2-config.patch to remove our downstream change to curses
+configuration in Modules/Setup.dist, so that the curses modules are built using
+setup.py with the downstream default (linking against libncursesw.so, rather
+than libncurses.so), rather than within the Makefile; add a test to %%install
+to verify the dso files that the curses module is linked against the correct
+DSO (bug 539917; changes _cursesmodule.so -> _curses.so)
+
* Fri Jan 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-8
- rebuild (bug 556975)
commit 7870ff7eed690257b4791fc20440717b5f46e1c3
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Fri Jan 22 15:49:15 2010 +0000
- rebuild (bug 556975)
diff --git a/python.spec b/python.spec
index 8ed445d..b64357e 100644
--- a/python.spec
+++ b/python.spec
@@ -22,7 +22,7 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
Version: 2.6.4
-Release: 7%{?dist}
+Release: 8%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -581,6 +581,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
%changelog
+* Fri Jan 22 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-8
+- rebuild (bug 556975)
+
* Wed Jan 20 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-7
- move lib2to3 from -tools subpackage to main package (bug 556667)
commit ad186468ee2a3f2fc82a18edc840c7690366742b
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Wed Jan 20 15:57:40 2010 +0000
- move lib2to3 from -tools subpackage to main package (bug 556667)
diff --git a/python.spec b/python.spec
index 891b9ee..8ed445d 100644
--- a/python.spec
+++ b/python.spec
@@ -22,7 +22,7 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
Version: 2.6.4
-Release: 6%{?dist}
+Release: 7%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -505,6 +505,7 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/idlelib
%dir %{_libdir}/python%{pybasever}/json
%{_libdir}/python%{pybasever}/json/*.py*
+%{_libdir}/python%{pybasever}/lib2to3
%{_libdir}/python%{pybasever}/logging
%{_libdir}/python%{pybasever}/multiprocessing
%{_libdir}/python%{pybasever}/plat-linux2
@@ -549,7 +550,6 @@ rm -fr $RPM_BUILD_ROOT
%defattr(-,root,root,755)
%doc Tools/modulator/README.modulator
%doc Tools/pynche/README.pynche
-%{_libdir}/python%{pybasever}/lib2to3
%{_libdir}/python%{pybasever}/site-packages/modulator
%{_libdir}/python%{pybasever}/site-packages/pynche
%{_bindir}/smtpd*.py*
@@ -581,6 +581,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
%changelog
+* Wed Jan 20 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-7
+- move lib2to3 from -tools subpackage to main package (bug 556667)
+
* Mon Jan 18 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-6
- patch Makefile.pre.in to avoid building static library (patch111, bug 556092)
- split up the "configure" invocation flags onto individual lines
commit 3fdd6082f97bb53fc1e95c8598b39410064fca5f
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Mon Jan 18 18:51:20 2010 +0000
- patch Makefile.pre.in to avoid building static library (patch111, bug
556092)
- split up the "configure" invocation flags onto individual lines
diff --git a/python-2.6.4-no-static-lib.patch b/python-2.6.4-no-static-lib.patch
new file mode 100644
index 0000000..57caafc
--- /dev/null
+++ b/python-2.6.4-no-static-lib.patch
@@ -0,0 +1,50 @@
+diff -up Python-2.6.4/Makefile.pre.in.no-static-lib Python-2.6.4/Makefile.pre.in
+--- Python-2.6.4/Makefile.pre.in.no-static-lib 2010-01-18 13:11:10.975859689 -0500
++++ Python-2.6.4/Makefile.pre.in 2010-01-18 13:14:27.524859334 -0500
+@@ -382,7 +382,7 @@ coverage:
+
+
+ # Build the interpreter
+-$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
++$(BUILDPYTHON): Modules/python.o $(LDLIBRARY)
+ $(LINKCC) $(CFLAGS) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
+ Modules/python.o \
+ $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
+@@ -398,18 +398,6 @@ sharedmods: $(BUILDPYTHON)
+ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)'
./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
+ esac
+
+-# Build static library
+-# avoid long command lines, same as LIBRARY_OBJS
+-$(LIBRARY): $(LIBRARY_OBJS)
+- -rm -f $@
+- $(AR) cr $@ Modules/getbuildinfo.o
+- $(AR) cr $@ $(PARSER_OBJS)
+- $(AR) cr $@ $(OBJECT_OBJS)
+- $(AR) cr $@ $(PYTHON_OBJS)
+- $(AR) cr $@ $(MODULE_OBJS) $(SIGNAL_OBJS)
+- $(AR) cr $@ $(MODOBJS)
+- $(RANLIB) $@
+-
+ libpython$(VERSION).so: $(LIBRARY_OBJS)
+ if test $(INSTSONAME) != $(LDLIBRARY); then \
+ $(LDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS)
$(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
+@@ -945,18 +933,6 @@ libainstall: all
+ else true; \
+ fi; \
+ done
+- @if test -d $(LIBRARY); then :; else \
+- if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
+- if test "$(SO)" = .dll; then \
+- $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
+- else \
+- $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
+- $(RANLIB) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
+- fi; \
+- else \
+- echo Skip install of $(LIBRARY) - use make frameworkinstall; \
+- fi; \
+- fi
+ $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
+ $(INSTALL_DATA) Modules/python.o $(DESTDIR)$(LIBPL)/python.o
+ $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
diff --git a/python.spec b/python.spec
index 98d0f4e..891b9ee 100644
--- a/python.spec
+++ b/python.spec
@@ -22,7 +22,7 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
Version: 2.6.4
-Release: 5%{?dist}
+Release: 6%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -74,6 +74,10 @@ Patch102: python-2.6-lib64.patch
# SELinux patches
Patch110: python-2.6-ctypes-noexecmem.patch
+# Patch the Makefile.pre.in so that the generated Makefile doesn't try to build
+# a libpythonMAJOR.MINOR.a (bug 550692):
+Patch111: python-2.6.4-no-static-lib.patch
+
# New API from 2.6
#Patch260: python-2.5.2-set_wakeup_fd4.patch
@@ -255,6 +259,8 @@ done
%patch110 -p1 -b .selinux
+%patch111 -p1 -b .no-static-lib
+
#%%patch260 -p1 -b .set_wakeup_fd
#%%patch999 -p1 -b .cve2007-4965
@@ -278,7 +284,12 @@ fi
export CC=gcc
# For patches 4 and 52, need to get a newer configure generated out of configure.in
autoconf
-%configure --enable-ipv6 --enable-unicode=%{unicode} --enable-shared --with-system-ffi
--with-valgrind
+%configure \
+ --enable-ipv6 \
+ --enable-unicode=%{unicode} \
+ --enable-shared \
+ --with-system-ffi \
+ --with-valgrind
make OPT="$CFLAGS" %{?_smp_mflags}
LD_LIBRARY_PATH=$topdir $topdir/python Tools/scripts/pathfix.py -i "%{_bindir}/env
python%{pybasever}" .
@@ -570,6 +581,10 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
%changelog
+* Mon Jan 18 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-6
+- patch Makefile.pre.in to avoid building static library (patch111, bug 556092)
+- split up the "configure" invocation flags onto individual lines
+
* Fri Jan 15 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-5
- replace usage of %%define with %%global
- use the %%{_isa} macro to ensure that the python-devel dependency on python
commit 0626de51348179a33a3d46d71ec2e77ceda13e2e
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Sat Jan 16 01:22:56 2010 +0000
- replace usage of %%define with %%global
- use the %%{_isa} macro to ensure that the python-devel dependency on
python is for the correct multilib arch (#555943)
- delete bundled copy of libffi to make sure we use the system one
- replace references to /usr with %%{_prefix}; replace references to
/usr/include with %%{_includedir}
diff --git a/python.spec b/python.spec
index 631b285..98d0f4e 100644
--- a/python.spec
+++ b/python.spec
@@ -1,28 +1,28 @@
-%{!?__python_ver:%define __python_ver EMPTY}
-#define __python_ver 26
-%define unicode ucs4
+%{!?__python_ver:%global __python_ver EMPTY}
+#global __python_ver 26
+%global unicode ucs4
-%define _default_patch_fuzz 2
+%global _default_patch_fuzz 2
%if "%{__python_ver}" != "EMPTY"
-%define main_python 0
-%define python python%{__python_ver}
-%define tkinter tkinter%{__python_ver}
+%global main_python 0
+%global python python%{__python_ver}
+%global tkinter tkinter%{__python_ver}
%else
-%define main_python 1
-%define python python
-%define tkinter tkinter
+%global main_python 1
+%global python python
+%global tkinter tkinter
%endif
-%define pybasever 2.6
-%define tools_dir %{_libdir}/python%{pybasever}/Tools
-%define demo_dir %{_libdir}/python%{pybasever}/Demo
-%define doc_tools_dir %{_libdir}/python%{pybasever}/Doc/tools
+%global pybasever 2.6
+%global tools_dir %{_libdir}/python%{pybasever}/Tools
+%global demo_dir %{_libdir}/python%{pybasever}/Demo
+%global doc_tools_dir %{_libdir}/python%{pybasever}/Doc/tools
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
Version: 2.6.4
-Release: 4%{?dist}
+Release: 5%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -142,7 +142,7 @@ provides the libraries needed for this.
%package devel
Summary: The libraries and header files needed for Python development.
Group: Development/Libraries
-Requires: %{python} = %{version}-%{release}
+Requires: %{python}%{?_isa} = %{version}-%{release}
# Needed here because of the migration of Makefile from -devel to the main
# package
Conflicts: %{python} < %{version}-%{release}
@@ -212,6 +212,12 @@ code that uses more than just unittest and/or test_support.py.
%prep
%setup -q -n Python-%{version}
+# Ensure that we're using the system copy of libffi, rather than the copy
+# shipped by upstream in the tarball:
+for SUBDIR in darwin libffi libffi_arm_wince libffi_msvc libffi_osx ; do
+ rm -r Modules/_ctypes/$SUBDIR || exit 1 ;
+done
+
%patch0 -p1 -b .rhconfig
%patch1 -p1 -b .no_gui
#%%patch2 -p1 -b .no-doc
@@ -407,13 +413,13 @@ install -d $RPM_BUILD_ROOT/usr/lib/python%{pybasever}/site-packages
%endif
# Make python-devel multilib-ready (bug #192747, #139911)
-%define _pyconfig32_h pyconfig-32.h
-%define _pyconfig64_h pyconfig-64.h
+%global _pyconfig32_h pyconfig-32.h
+%global _pyconfig64_h pyconfig-64.h
%ifarch ppc64 s390x x86_64 ia64 alpha sparc64
-%define _pyconfig_h %{_pyconfig64_h}
+%global _pyconfig_h %{_pyconfig64_h}
%else
-%define _pyconfig_h %{_pyconfig32_h}
+%global _pyconfig_h %{_pyconfig32_h}
%endif
mv $RPM_BUILD_ROOT%{_includedir}/python%{pybasever}/pyconfig.h \
$RPM_BUILD_ROOT%{_includedir}/python%{pybasever}/%{_pyconfig_h}
@@ -499,8 +505,8 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/wsgiref
%{_libdir}/python%{pybasever}/xml
%if "%{_lib}" == "lib64"
-%attr(0755,root,root) %dir /usr/lib/python%{pybasever}
-%attr(0755,root,root) %dir /usr/lib/python%{pybasever}/site-packages
+%attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}
+%attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}/site-packages
%endif
# "Makefile" and the config-32/64.h file are needed by
@@ -508,8 +514,8 @@ rm -fr $RPM_BUILD_ROOT
# package, along with their parent directories (bug 531901):
%dir %{_libdir}/python%{pybasever}/config
%{_libdir}/python%{pybasever}/config/Makefile
-%dir /usr/include/python%{pybasever}
-/usr/include/python%{pybasever}/%{_pyconfig_h}
+%dir %{_includedir}/python%{pybasever}
+%{_includedir}/python%{pybasever}/%{_pyconfig_h}
%files libs
%defattr(-,root,root)
@@ -520,8 +526,8 @@ rm -fr $RPM_BUILD_ROOT
%defattr(-,root,root)
%{_libdir}/python%{pybasever}/config/*
%exclude %{_libdir}/python%{pybasever}/config/Makefile
-/usr/include/python%{pybasever}/*.h
-%exclude /usr/include/python%{pybasever}/%{_pyconfig_h}
+%{_includedir}/python%{pybasever}/*.h
+%exclude %{_includedir}/python%{pybasever}/%{_pyconfig_h}
%doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit
%{_bindir}/python-config
%{_bindir}/python%{pybasever}-config
@@ -564,6 +570,14 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
%changelog
+* Fri Jan 15 2010 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-5
+- replace usage of %%define with %%global
+- use the %%{_isa} macro to ensure that the python-devel dependency on python
+is for the correct multilib arch (#555943)
+- delete bundled copy of libffi to make sure we use the system one
+- replace references to /usr with %%{_prefix}; replace references to
+/usr/include with %%{_includedir}
+
* Wed Dec 16 2009 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-4
- automatically disable arena allocator when run under valgrind (upstream
issue 2422; patch 52)
commit 562f19e10d434895265a62c44f335524c475194f
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Fri Dec 18 03:20:50 2009 +0000
- automatically disable arena allocator when run under valgrind (upstream
issue 2422; patch 52)
- add patch from Josh Boyer containing diff against upstream PyBSDDB to
make the bsddb module compile against db-4.8 (patch 53, #544275); bump
the necessary version of db4-devel to 4.8
- patch setup.py so that it searches for db-4.8, and enable debug output
for said search; make Setup.dist use db-4.8 (patch 54)
diff --git a/disable-pymalloc-on-valgrind-py26.patch
b/disable-pymalloc-on-valgrind-py26.patch
new file mode 100644
index 0000000..de56bdc
--- /dev/null
+++ b/disable-pymalloc-on-valgrind-py26.patch
@@ -0,0 +1,135 @@
+Index: configure.in
+===================================================================
+--- configure.in (revision 61828)
++++ configure.in (working copy)
+@@ -2232,6 +2232,19 @@ then
+ fi
+ AC_MSG_RESULT($with_pymalloc)
+
++# Check for Valgrind support
++AC_MSG_CHECKING([for --with-valgrind])
++AC_ARG_WITH([valgrind],
++ AC_HELP_STRING([--with-valgrind], [Enable Valgrind support]),,
++ with_valgrind=no)
++AC_MSG_RESULT([$with_valgrind])
++if test "$with_valgrind" != no; then
++ AC_CHECK_HEADER([valgrind/valgrind.h],
++ [AC_DEFINE([WITH_VALGRIND], 1, [Define if you want pymalloc to be disabled when
running under valgrind])],
++ [AC_MSG_ERROR([Valgrind support requested but headers not available])]
++ )
++fi
++
+ # Check for --with-wctype-functions
+ AC_MSG_CHECKING(for --with-wctype-functions)
+ AC_ARG_WITH(wctype-functions,
+Index: Objects/obmalloc.c
+===================================================================
+--- Objects/obmalloc.c (revision 61828)
++++ Objects/obmalloc.c (working copy)
+@@ -2,6 +2,21 @@
+
+ #ifdef WITH_PYMALLOC
+
++#ifdef WITH_VALGRIND
++#include <valgrind/valgrind.h>
++
++/* If we're using GCC, use __builtin_expect() to reduce overhead of
++ the valgrind checks */
++#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
++# define UNLIKELY(value) __builtin_expect((value), 0)
++#else
++# define UNLIKELY(value) (value)
++#endif
++
++/* -1 indicates that we haven't checked that we're running on valgrind yet. */
++static int running_on_valgrind = -1;
++#endif
++
+ /* An object allocator for Python.
+
+ Here is an introduction to the layers of the Python memory architecture,
+@@ -726,6 +741,13 @@ PyObject_Malloc(size_t nbytes)
+ poolp next;
+ uint size;
+
++#ifdef WITH_VALGRIND
++ if (UNLIKELY(running_on_valgrind == -1))
++ running_on_valgrind = RUNNING_ON_VALGRIND;
++ if (UNLIKELY(running_on_valgrind))
++ goto redirect;
++#endif
++
+ /*
+ * This implicitly redirects malloc(0).
+ */
+@@ -916,6 +938,11 @@ PyObject_Free(void *p)
+ if (p == NULL) /* free(NULL) has no effect */
+ return;
+
++#ifdef WITH_VALGRIND
++ if (UNLIKELY(running_on_valgrind > 0))
++ goto redirect;
++#endif
++
+ pool = POOL_ADDR(p);
+ if (Py_ADDRESS_IN_RANGE(p, pool)) {
+ /* We allocated this address. */
+@@ -1110,6 +1137,7 @@ PyObject_Free(void *p)
+ return;
+ }
+
++redirect:
+ /* We didn't allocate this address. */
+ free(p);
+ }
+@@ -1130,6 +1158,12 @@ PyObject_Realloc(void *p, size_t nbytes)
+ if (p == NULL)
+ return PyObject_Malloc(nbytes);
+
++#ifdef WITH_VALGRIND
++ /* Treat running_on_valgrind == -1 the same as 0 */
++ if (UNLIKELY(running_on_valgrind > 0))
++ goto redirect;
++#endif
++
+ pool = POOL_ADDR(p);
+ if (Py_ADDRESS_IN_RANGE(p, pool)) {
+ /* We're in charge of this block */
+@@ -1157,6 +1191,7 @@ PyObject_Realloc(void *p, size_t nbytes)
+ }
+ return bp;
+ }
++ redirect:
+ /* We're not managing this block. If nbytes <=
+ * SMALL_REQUEST_THRESHOLD, it's tempting to try to take over this
+ * block. However, if we do, we need to copy the valid data from
+Index: Misc/NEWS
+===================================================================
+--- Misc/NEWS (revision 61828)
++++ Misc/NEWS (working copy)
+@@ -60,6 +60,11 @@ Core and builtins
+
+ - Issue #2143: Fix embedded readline() hang on SSL socket EOF.
+
++- Issue #2422: When compiled with the ``--with-valgrind`` option, the
++ pymalloc allocator will be automatically disabled when running under
++ Valgrind. This gives improved memory leak detection when running
++ under Valgrind, while taking advantage of pymalloc at other times.
++
+ Library
+ -------
+
+Index: pyconfig.h.in
+===================================================================
+--- pyconfig.h.in (revision 61828)
++++ pyconfig.h.in (working copy)
+@@ -958,6 +958,9 @@
+ /* Define to profile with the Pentium timestamp counter */
+ #undef WITH_TSC
+
++/* Define if you want pymalloc to be disabled when running under valgrind */
++#undef WITH_VALGRIND
++
+
+ /* Define to 1 if your processor stores words with the most significant byte
+ first (like Motorola and SPARC, unlike Intel and VAX).
diff --git a/python-2.6-update-bsddb3-4.8.patch b/python-2.6-update-bsddb3-4.8.patch
new file mode 100644
index 0000000..4f25058
--- /dev/null
+++ b/python-2.6-update-bsddb3-4.8.patch
@@ -0,0 +1,3446 @@
+diff -Nupr Python-2.6.4.orig/Lib/bsddb/dbobj.py Python-2.6.4/Lib/bsddb/dbobj.py
+--- Python-2.6.4.orig/Lib/bsddb/dbobj.py 2008-07-23 07:38:42.000000000 -0400
++++ Python-2.6.4/Lib/bsddb/dbobj.py 2009-12-04 07:36:00.000000000 -0500
+@@ -110,15 +110,17 @@ class DBEnv:
+ def log_stat(self, *args, **kwargs):
+ return apply(self._cobj.log_stat, args, kwargs)
+
+- if db.version() >= (4,1):
+- def dbremove(self, *args, **kwargs):
+- return apply(self._cobj.dbremove, args, kwargs)
+- def dbrename(self, *args, **kwargs):
+- return apply(self._cobj.dbrename, args, kwargs)
+- def set_encrypt(self, *args, **kwargs):
+- return apply(self._cobj.set_encrypt, args, kwargs)
++ def dbremove(self, *args, **kwargs):
++ return apply(self._cobj.dbremove, args, kwargs)
++ def dbrename(self, *args, **kwargs):
++ return apply(self._cobj.dbrename, args, kwargs)
++ def set_encrypt(self, *args, **kwargs):
++ return apply(self._cobj.set_encrypt, args, kwargs)
+
+ if db.version() >= (4,4):
++ def fileid_reset(self, *args, **kwargs):
++ return self._cobj.fileid_reset(*args, **kwargs)
++
+ def lsn_reset(self, *args, **kwargs):
+ return apply(self._cobj.lsn_reset, args, kwargs)
+
+@@ -229,9 +231,8 @@ class DB(MutableMapping):
+ def set_get_returns_none(self, *args, **kwargs):
+ return apply(self._cobj.set_get_returns_none, args, kwargs)
+
+- if db.version() >= (4,1):
+- def set_encrypt(self, *args, **kwargs):
+- return apply(self._cobj.set_encrypt, args, kwargs)
++ def set_encrypt(self, *args, **kwargs):
++ return apply(self._cobj.set_encrypt, args, kwargs)
+
+
+ class DBSequence:
+diff -Nupr Python-2.6.4.orig/Lib/bsddb/dbtables.py Python-2.6.4/Lib/bsddb/dbtables.py
+--- Python-2.6.4.orig/Lib/bsddb/dbtables.py 2008-08-31 10:00:51.000000000 -0400
++++ Python-2.6.4/Lib/bsddb/dbtables.py 2009-12-04 07:36:00.000000000 -0500
+@@ -15,7 +15,7 @@
+ # This provides a simple database table interface built on top of
+ # the Python Berkeley DB 3 interface.
+ #
+-_cvsid = '$Id: dbtables.py 66088 2008-08-31 14:00:51Z jesus.cea $'
++_cvsid = '$Id: dbtables.py 58758 2007-11-01 21:15:36Z gregory.p.smith $'
+
+ import re
+ import sys
+@@ -659,6 +659,13 @@ class bsdTableDB :
+ a = atuple[1]
+ b = btuple[1]
+ if type(a) is type(b):
++
++ # Needed for python 3. "cmp" vanished in 3.0.1
++ def cmp(a, b) :
++ if a==b : return 0
++ if a<b : return -1
++ return 1
++
+ if isinstance(a, PrefixCond) and isinstance(b, PrefixCond):
+ # longest prefix first
+ return cmp(len(b.prefix), len(a.prefix))
+diff -Nupr Python-2.6.4.orig/Lib/bsddb/dbutils.py Python-2.6.4/Lib/bsddb/dbutils.py
+--- Python-2.6.4.orig/Lib/bsddb/dbutils.py 2008-08-31 10:00:51.000000000 -0400
++++ Python-2.6.4/Lib/bsddb/dbutils.py 2009-12-04 07:36:00.000000000 -0500
+@@ -61,7 +61,7 @@ def DeadlockWrap(function, *_args, **_kw
+ """
+ sleeptime = _deadlock_MinSleepTime
+ max_retries = _kwargs.get('max_retries', -1)
+- if _kwargs.has_key('max_retries'):
++ if 'max_retries' in _kwargs:
+ del _kwargs['max_retries']
+ while True:
+ try:
+diff -Nupr Python-2.6.4.orig/Lib/bsddb/__init__.py Python-2.6.4/Lib/bsddb/__init__.py
+--- Python-2.6.4.orig/Lib/bsddb/__init__.py 2008-09-05 14:33:51.000000000 -0400
++++ Python-2.6.4/Lib/bsddb/__init__.py 2009-12-04 07:36:00.000000000 -0500
+@@ -33,7 +33,7 @@
+ #----------------------------------------------------------------------
+
+
+-"""Support for Berkeley DB 4.0 through 4.7 with a simple interface.
++"""Support for Berkeley DB 4.1 through 4.8 with a simple interface.
+
+ For the full featured object oriented interface use the bsddb.db module
+ instead. It mirrors the Oracle Berkeley DB C API.
+@@ -42,12 +42,6 @@ instead. It mirrors the Oracle Berkeley
+ import sys
+ absolute_import = (sys.version_info[0] >= 3)
+
+-if sys.py3kwarning:
+- import warnings
+- warnings.warnpy3k("in 3.x, bsddb has been removed; "
+- "please use the pybsddb project instead",
+- DeprecationWarning, 2)
+-
+ try:
+ if __name__ == 'bsddb3':
+ # import _pybsddb binary as it should be the more recent version from
+@@ -442,8 +436,10 @@ def _checkflag(flag, file):
+ # Berkeley DB was too.
+
+ try:
+- import thread
+- del thread
++ # 2to3 automatically changes "import thread" to "import
_thread"
++ import thread as T
++ del T
++
+ except ImportError:
+ db.DB_THREAD = 0
+
+diff -Nupr Python-2.6.4.orig/Lib/bsddb/test/test_all.py
Python-2.6.4/Lib/bsddb/test/test_all.py
+--- Python-2.6.4.orig/Lib/bsddb/test/test_all.py 2008-09-03 18:07:11.000000000 -0400
++++ Python-2.6.4/Lib/bsddb/test/test_all.py 2009-12-04 07:36:00.000000000 -0500
+@@ -203,6 +203,16 @@ if sys.version_info[0] >= 3 :
+ k = bytes(k, charset)
+ return self._db.has_key(k, txn=txn)
+
++ def set_re_delim(self, c) :
++ if isinstance(c, str) : # We can use a numeric value byte too
++ c = bytes(c, charset)
++ return self._db.set_re_delim(c)
++
++ def set_re_pad(self, c) :
++ if isinstance(c, str) : # We can use a numeric value byte too
++ c = bytes(c, charset)
++ return self._db.set_re_pad(c)
++
+ def put(self, key, value, txn=None, flags=0, dlen=-1, doff=-1) :
+ if isinstance(key, str) :
+ key = bytes(key, charset)
+@@ -221,6 +231,11 @@ if sys.version_info[0] >= 3 :
+ key = bytes(key, charset)
+ return self._db.get_size(key)
+
++ def exists(self, key, *args, **kwargs) :
++ if isinstance(key, str) :
++ key = bytes(key, charset)
++ return self._db.exists(key, *args, **kwargs)
++
+ def get(self, key, default="MagicCookie", txn=None, flags=0, dlen=-1,
doff=-1) :
+ if isinstance(key, str) :
+ key = bytes(key, charset)
+@@ -288,13 +303,21 @@ if sys.version_info[0] >= 3 :
+ key = key.decode(charset)
+ data = data.decode(charset)
+ key = self._callback(key, data)
+- if (key != bsddb._db.DB_DONOTINDEX) and isinstance(key,
+- str) :
+- key = bytes(key, charset)
++ if (key != bsddb._db.DB_DONOTINDEX) :
++ if isinstance(key, str) :
++ key = bytes(key, charset)
++ elif isinstance(key, list) :
++ key2 = []
++ for i in key :
++ if isinstance(i, str) :
++ i = bytes(i, charset)
++ key2.append(i)
++ key = key2
+ return key
+
+ return self._db.associate(secondarydb._db,
+- associate_callback(callback).callback, flags=flags, txn=txn)
++ associate_callback(callback).callback, flags=flags,
++ txn=txn)
+
+ def cursor(self, txn=None, flags=0) :
+ return cursor_py3k(self._db, txn=txn, flags=flags)
+@@ -310,6 +333,12 @@ if sys.version_info[0] >= 3 :
+ def __getattr__(self, v) :
+ return getattr(self._dbenv, v)
+
++ def get_data_dirs(self) :
++ # Have to use a list comprehension and not
++ # generators, because we are supporting Python 2.3.
++ return tuple(
++ [i.decode(charset) for i in self._dbenv.get_data_dirs()])
++
+ class DBSequence_py3k(object) :
+ def __init__(self, db, *args, **kwargs) :
+ self._db=db
+@@ -332,7 +361,10 @@ if sys.version_info[0] >= 3 :
+
+ bsddb._db.DBEnv_orig = bsddb._db.DBEnv
+ bsddb._db.DB_orig = bsddb._db.DB
+- bsddb._db.DBSequence_orig = bsddb._db.DBSequence
++ if bsddb.db.version() <= (4, 3) :
++ bsddb._db.DBSequence_orig = None
++ else :
++ bsddb._db.DBSequence_orig = bsddb._db.DBSequence
+
+ def do_proxy_db_py3k(flag) :
+ flag2 = do_proxy_db_py3k.flag
+@@ -481,6 +513,7 @@ def suite(module_prefix='', timing_check
+ test_modules = [
+ 'test_associate',
+ 'test_basics',
++ 'test_dbenv',
+ 'test_compare',
+ 'test_compat',
+ 'test_cursor_pget_bug',
+@@ -489,6 +522,7 @@ def suite(module_prefix='', timing_check
+ 'test_dbtables',
+ 'test_distributed_transactions',
+ 'test_early_close',
++ 'test_fileid',
+ 'test_get_none',
+ 'test_join',
+ 'test_lock',
+diff -Nupr Python-2.6.4.orig/Lib/bsddb/test/test_associate.py
Python-2.6.4/Lib/bsddb/test/test_associate.py
+--- Python-2.6.4.orig/Lib/bsddb/test/test_associate.py 2008-08-31 10:00:51.000000000
-0400
++++ Python-2.6.4/Lib/bsddb/test/test_associate.py 2009-12-04 07:36:00.000000000 -0500
+@@ -148,12 +148,8 @@ class AssociateTestCase(unittest.TestCas
+ self.secDB = None
+ self.primary = db.DB(self.env)
+ self.primary.set_get_returns_none(2)
+- if db.version() >= (4, 1):
+- self.primary.open(self.filename, "primary", self.dbtype,
+- db.DB_CREATE | db.DB_THREAD | self.dbFlags, txn=txn)
+- else:
+- self.primary.open(self.filename, "primary", self.dbtype,
+- db.DB_CREATE | db.DB_THREAD | self.dbFlags)
++ self.primary.open(self.filename, "primary", self.dbtype,
++ db.DB_CREATE | db.DB_THREAD | self.dbFlags, txn=txn)
+
+ def closeDB(self):
+ if self.cur:
+@@ -169,12 +165,7 @@ class AssociateTestCase(unittest.TestCas
+ return self.primary
+
+
+- def test01_associateWithDB(self):
+- if verbose:
+- print '\n', '-=' * 30
+- print "Running %s.test01_associateWithDB..." % \
+- self.__class__.__name__
+-
++ def _associateWithDB(self, getGenre):
+ self.createDB()
+
+ self.secDB = db.DB(self.env)
+@@ -182,19 +173,21 @@ class AssociateTestCase(unittest.TestCas
+ self.secDB.set_get_returns_none(2)
+ self.secDB.open(self.filename, "secondary", db.DB_BTREE,
+ db.DB_CREATE | db.DB_THREAD | self.dbFlags)
+- self.getDB().associate(self.secDB, self.getGenre)
++ self.getDB().associate(self.secDB, getGenre)
+
+ self.addDataToDB(self.getDB())
+
+ self.finish_test(self.secDB)
+
+-
+- def test02_associateAfterDB(self):
++ def test01_associateWithDB(self):
+ if verbose:
+ print '\n', '-=' * 30
+- print "Running %s.test02_associateAfterDB..." % \
++ print "Running %s.test01_associateWithDB..." % \
+ self.__class__.__name__
+
++ return self._associateWithDB(self.getGenre)
++
++ def _associateAfterDB(self, getGenre) :
+ self.createDB()
+ self.addDataToDB(self.getDB())
+
+@@ -204,10 +197,35 @@ class AssociateTestCase(unittest.TestCas
+ db.DB_CREATE | db.DB_THREAD | self.dbFlags)
+
+ # adding the DB_CREATE flag will cause it to index existing records
+- self.getDB().associate(self.secDB, self.getGenre, db.DB_CREATE)
++ self.getDB().associate(self.secDB, getGenre, db.DB_CREATE)
+
+ self.finish_test(self.secDB)
+
++ def test02_associateAfterDB(self):
++ if verbose:
++ print '\n', '-=' * 30
++ print "Running %s.test02_associateAfterDB..." % \
++ self.__class__.__name__
++
++ return self._associateAfterDB(self.getGenre)
++
++ if db.version() >= (4, 6):
++ def test03_associateWithDB(self):
++ if verbose:
++ print '\n', '-=' * 30
++ print "Running %s.test03_associateWithDB..." % \
++ self.__class__.__name__
++
++ return self._associateWithDB(self.getGenreList)
++
++ def test04_associateAfterDB(self):
++ if verbose:
++ print '\n', '-=' * 30
++ print "Running %s.test04_associateAfterDB..." % \
++ self.__class__.__name__
++
++ return self._associateAfterDB(self.getGenreList)
++
+
+ def finish_test(self, secDB, txn=None):
+ # 'Blues' should not be in the secondary database
+@@ -277,6 +295,12 @@ class AssociateTestCase(unittest.TestCas
+ else:
+ return genre
+
++ def getGenreList(self, priKey, PriData) :
++ v = self.getGenre(priKey, PriData)
++ if type(v) == type("") :
++ v = [v]
++ return v
++
+
+ #----------------------------------------------------------------------
+
+@@ -322,10 +346,7 @@ class AssociateBTreeTxnTestCase(Associat
+ self.secDB.set_get_returns_none(2)
+ self.secDB.open(self.filename, "secondary", db.DB_BTREE,
+ db.DB_CREATE | db.DB_THREAD, txn=txn)
+- if db.version() >= (4,1):
+- self.getDB().associate(self.secDB, self.getGenre, txn=txn)
+- else:
+- self.getDB().associate(self.secDB, self.getGenre)
++ self.getDB().associate(self.secDB, self.getGenre, txn=txn)
+
+ self.addDataToDB(self.getDB(), txn=txn)
+ except:
+@@ -426,8 +447,7 @@ def test_suite():
+ suite.addTest(unittest.makeSuite(AssociateBTreeTestCase))
+ suite.addTest(unittest.makeSuite(AssociateRecnoTestCase))
+
+- if db.version() >= (4, 1):
+- suite.addTest(unittest.makeSuite(AssociateBTreeTxnTestCase))
++ suite.addTest(unittest.makeSuite(AssociateBTreeTxnTestCase))
+
+ suite.addTest(unittest.makeSuite(ShelveAssociateHashTestCase))
+ suite.addTest(unittest.makeSuite(ShelveAssociateBTreeTestCase))
+diff -Nupr Python-2.6.4.orig/Lib/bsddb/test/test_basics.py
Python-2.6.4/Lib/bsddb/test/test_basics.py
+--- Python-2.6.4.orig/Lib/bsddb/test/test_basics.py 2009-07-02 11:37:21.000000000 -0400
++++ Python-2.6.4/Lib/bsddb/test/test_basics.py 2009-12-04 07:36:00.000000000 -0500
+@@ -33,6 +33,7 @@ class VersionTestCase(unittest.TestCase)
+
+ class BasicTestCase(unittest.TestCase):
+ dbtype = db.DB_UNKNOWN # must be set in derived class
++ cachesize = (0, 1024*1024, 1)
+ dbopenflags = 0
+ dbsetflags = 0
+ dbmode = 0660
+@@ -43,6 +44,13 @@ class BasicTestCase(unittest.TestCase):
+
+ _numKeys = 1002 # PRIVATE. NOTE: must be an even value
+
++ import sys
++ if sys.version_info[:3] < (2, 4, 0):
++ def assertTrue(self, expr, msg=None):
++ self.failUnless(expr,msg=msg)
++ def assertFalse(self, expr, msg=None):
++ self.failIf(expr,msg=msg)
++
+ def setUp(self):
+ if self.useEnv:
+ self.homeDir=get_new_environment_path()
+@@ -50,7 +58,8 @@ class BasicTestCase(unittest.TestCase):
+ self.env = db.DBEnv()
+ self.env.set_lg_max(1024*1024)
+ self.env.set_tx_max(30)
+- self.env.set_tx_timestamp(int(time.time()))
++ self._t = int(time.time())
++ self.env.set_tx_timestamp(self._t)
+ self.env.set_flags(self.envsetflags, 1)
+ self.env.open(self.homeDir, self.envflags | db.DB_CREATE)
+ self.filename = "test"
+@@ -64,6 +73,15 @@ class BasicTestCase(unittest.TestCase):
+
+ # create and open the DB
+ self.d = db.DB(self.env)
++ if not self.useEnv :
++ if db.version() >= (4, 2) :
++ self.d.set_cachesize(*self.cachesize)
++ cachesize = self.d.get_cachesize()
++ self.assertEqual(cachesize[0], self.cachesize[0])
++ self.assertEqual(cachesize[2], self.cachesize[2])
++ # Berkeley DB expands the cache 25% accounting overhead,
++ # if the cache is small.
++ self.assertEqual(125, int(100.0*cachesize[1]/self.cachesize[1]))
+ self.d.set_flags(self.dbsetflags)
+ if self.dbname:
+ self.d.open(self.filename, self.dbname, self.dbtype,
+@@ -74,6 +92,10 @@ class BasicTestCase(unittest.TestCase):
+ dbtype = self.dbtype,
+ flags = self.dbopenflags|db.DB_CREATE)
+
++ if not self.useEnv:
++ self.assertRaises(db.DBInvalidArgError,
++ self.d.set_cachesize, *self.cachesize)
++
+ self.populateDB()
+
+
+@@ -131,7 +153,7 @@ class BasicTestCase(unittest.TestCase):
+
+ self.assertEqual(d.get('0321'), '0321-0321-0321-0321-0321')
+
+- # By default non-existent keys return None...
++ # By default non-existant keys return None...
+ self.assertEqual(d.get('abcd'), None)
+
+ # ...but they raise exceptions in other situations. Call
+@@ -276,6 +298,21 @@ class BasicTestCase(unittest.TestCase):
+ pprint(values[:10])
+
+
++ #----------------------------------------
++
++ def test02b_SequenceMethods(self):
++ d = self.d
++
++ for key in ['0002', '0101', '0401', '0701',
'0998']:
++ data = d[key]
++ self.assertEqual(data, self.makeData(key))
++ if verbose:
++ print data
++
++ self.assertTrue(hasattr(d, "__contains__"))
++ self.assertTrue("0401" in d)
++ self.assertFalse("1234" in d)
++
+
+ #----------------------------------------
+
+@@ -509,6 +546,15 @@ class BasicTestCase(unittest.TestCase):
+ self.assertEqual(old, 1)
+ self.test03_SimpleCursorStuff(get_raises_error=0, set_raises_error=0)
+
++ if db.version() >= (4, 6):
++ def test03d_SimpleCursorPriority(self) :
++ c = self.d.cursor()
++ c.set_priority(db.DB_PRIORITY_VERY_LOW) # Positional
++ self.assertEqual(db.DB_PRIORITY_VERY_LOW, c.get_priority())
++ c.set_priority(priority=db.DB_PRIORITY_HIGH) # Keyword
++ self.assertEqual(db.DB_PRIORITY_HIGH, c.get_priority())
++ c.close()
++
+ #----------------------------------------
+
+ def test04_PartialGetAndPut(self):
+@@ -562,7 +608,7 @@ class BasicTestCase(unittest.TestCase):
+ d = self.d
+ if verbose:
+ print '\n', '-=' * 30
+- print "Running %s.test99_Truncate..." % self.__class__.__name__
++ print "Running %s.test06_Truncate..." % self.__class__.__name__
+
+ d.put("abcde", "ABCDE");
+ num = d.truncate()
+@@ -582,6 +628,33 @@ class BasicTestCase(unittest.TestCase):
+
+ #----------------------------------------
+
++ if db.version() >= (4, 6):
++ def test08_exists(self) :
++ self.d.put("abcde", "ABCDE")
++ self.assert_(self.d.exists("abcde") == True,
++ "DB->exists() returns wrong value")
++ self.assert_(self.d.exists("x") == False,
++ "DB->exists() returns wrong value")
++
++ #----------------------------------------
++
++ if db.version() >= (4, 7):
++ def test_compact(self) :
++ d = self.d
++ self.assertEqual(0, d.compact(flags=db.DB_FREELIST_ONLY))
++ self.assertEqual(0, d.compact(flags=db.DB_FREELIST_ONLY))
++ d.put("abcde", "ABCDE");
++ d.put("bcde", "BCDE");
++ d.put("abc", "ABC");
++ d.put("monty", "python");
++ d.delete("abc")
++ d.delete("bcde")
++ d.compact(start='abcde', stop='monty', txn=None,
++ compact_fillpercent=42, compact_pages=1,
++ compact_timeout=50000000,
++ flags=db.DB_FREELIST_ONLY|db.DB_FREE_SPACE)
++
++ #----------------------------------------
+
+ #----------------------------------------------------------------------
+
+@@ -611,13 +684,13 @@ class BasicWithEnvTestCase(BasicTestCase
+
+ #----------------------------------------
+
+- def test08_EnvRemoveAndRename(self):
++ def test09_EnvRemoveAndRename(self):
+ if not self.env:
+ return
+
+ if verbose:
+ print '\n', '-=' * 30
+- print "Running %s.test08_EnvRemoveAndRename..." %
self.__class__.__name__
++ print "Running %s.test09_EnvRemoveAndRename..." %
self.__class__.__name__
+
+ # can't rename or remove an open DB
+ self.d.close()
+@@ -626,10 +699,6 @@ class BasicWithEnvTestCase(BasicTestCase
+ self.env.dbrename(self.filename, None, newname)
+ self.env.dbremove(newname)
+
+- # dbremove and dbrename are in 4.1 and later
+- if db.version() < (4,1):
+- del test08_EnvRemoveAndRename
+-
+ #----------------------------------------
+
+ class BasicBTreeWithEnvTestCase(BasicWithEnvTestCase):
+@@ -729,11 +798,25 @@ class BasicTransactionTestCase(BasicTest
+
+ #----------------------------------------
+
+- def test08_TxnTruncate(self):
++ if db.version() >= (4, 6):
++ def test08_exists(self) :
++ txn = self.env.txn_begin()
++ self.d.put("abcde", "ABCDE", txn=txn)
++ txn.commit()
++ txn = self.env.txn_begin()
++ self.assert_(self.d.exists("abcde", txn=txn) == True,
++ "DB->exists() returns wrong value")
++ self.assert_(self.d.exists("x", txn=txn) == False,
++ "DB->exists() returns wrong value")
++ txn.abort()
++
++ #----------------------------------------
++
++ def test09_TxnTruncate(self):
+ d = self.d
+ if verbose:
+ print '\n', '-=' * 30
+- print "Running %s.test08_TxnTruncate..." %
self.__class__.__name__
++ print "Running %s.test09_TxnTruncate..." %
self.__class__.__name__
+
+ d.put("abcde", "ABCDE");
+ txn = self.env.txn_begin()
+@@ -746,7 +829,7 @@ class BasicTransactionTestCase(BasicTest
+
+ #----------------------------------------
+
+- def test09_TxnLateUse(self):
++ def test10_TxnLateUse(self):
+ txn = self.env.txn_begin()
+ txn.abort()
+ try:
+@@ -766,6 +849,39 @@ class BasicTransactionTestCase(BasicTest
+ raise RuntimeError, "DBTxn.commit() called after DB_TXN no longer valid
w/o an exception"
+
+
++ #----------------------------------------
++
++
++ if db.version() >= (4, 4):
++ def test_txn_name(self) :
++ txn=self.env.txn_begin()
++ self.assertEqual(txn.get_name(), "")
++ txn.set_name("XXYY")
++ self.assertEqual(txn.get_name(), "XXYY")
++ txn.set_name("")
++ self.assertEqual(txn.get_name(), "")
++ txn.abort()
++
++ #----------------------------------------
++
++
++ def test_txn_set_timeout(self) :
++ txn=self.env.txn_begin()
++ txn.set_timeout(1234567, db.DB_SET_LOCK_TIMEOUT)
++ txn.set_timeout(2345678, flags=db.DB_SET_TXN_TIMEOUT)
++ txn.abort()
++
++ #----------------------------------------
++
++ if db.version() >= (4, 2) :
++ def test_get_tx_max(self) :
++ self.assertEqual(self.env.get_tx_max(), 30)
++
++ def test_get_tx_timestamp(self) :
++ self.assertEqual(self.env.get_tx_timestamp(), self._t)
++
++
++
+ class BTreeTransactionTestCase(BasicTransactionTestCase):
+ dbtype = db.DB_BTREE
+
+@@ -780,11 +896,11 @@ class BTreeRecnoTestCase(BasicTestCase):
+ dbtype = db.DB_BTREE
+ dbsetflags = db.DB_RECNUM
+
+- def test08_RecnoInBTree(self):
++ def test09_RecnoInBTree(self):
+ d = self.d
+ if verbose:
+ print '\n', '-=' * 30
+- print "Running %s.test08_RecnoInBTree..." %
self.__class__.__name__
++ print "Running %s.test09_RecnoInBTree..." %
self.__class__.__name__
+
+ rec = d.get(200)
+ self.assertEqual(type(rec), type(()))
+@@ -814,11 +930,11 @@ class BTreeRecnoWithThreadFlagTestCase(B
+ class BasicDUPTestCase(BasicTestCase):
+ dbsetflags = db.DB_DUP
+
+- def test09_DuplicateKeys(self):
++ def test10_DuplicateKeys(self):
+ d = self.d
+ if verbose:
+ print '\n', '-=' * 30
+- print "Running %s.test09_DuplicateKeys..." % \
++ print "Running %s.test10_DuplicateKeys..." % \
+ self.__class__.__name__
+
+ d.put("dup0", "before")
+@@ -887,11 +1003,11 @@ class BasicMultiDBTestCase(BasicTestCase
+ else:
+ return db.DB_BTREE
+
+- def test10_MultiDB(self):
++ def test11_MultiDB(self):
+ d1 = self.d
+ if verbose:
+ print '\n', '-=' * 30
+- print "Running %s.test10_MultiDB..." % self.__class__.__name__
++ print "Running %s.test11_MultiDB..." % self.__class__.__name__
+
+ d2 = db.DB(self.env)
+ d2.open(self.filename, "second", self.dbtype,
+@@ -1032,11 +1148,12 @@ class CrashAndBurn(unittest.TestCase) :
+ # # See
http://bugs.python.org/issue3307
+ # self.assertRaises(db.DBInvalidArgError, db.DB, None, 65535)
+
+- def test02_DBEnv_dealloc(self):
+- #
http://bugs.python.org/issue3885
+- import gc
+- self.assertRaises(db.DBInvalidArgError, db.DBEnv, ~db.DB_RPCCLIENT)
+- gc.collect()
++ if db.version() < (4, 8) :
++ def test02_DBEnv_dealloc(self):
++ #
http://bugs.python.org/issue3885
++ import gc
++ self.assertRaises(db.DBInvalidArgError, db.DBEnv, ~db.DB_RPCCLIENT)
++ gc.collect()
+
+
+ #----------------------------------------------------------------------
+diff -Nupr Python-2.6.4.orig/Lib/bsddb/test/test_compare.py
Python-2.6.4/Lib/bsddb/test/test_compare.py
+--- Python-2.6.4.orig/Lib/bsddb/test/test_compare.py 2008-08-31 10:00:51.000000000 -0400
++++ Python-2.6.4/Lib/bsddb/test/test_compare.py 2009-12-04 07:36:00.000000000 -0500
+@@ -12,6 +12,12 @@ from test_all import db, dbshelve, test_
+ get_new_environment_path, get_new_database_path
+
+
++# Needed for python 3. "cmp" vanished in 3.0.1
++def cmp(a, b) :
++ if a==b : return 0
++ if a<b : return -1
++ return 1
++
+ lexical_cmp = cmp
+
+ def lowercase_cmp(left, right):
+@@ -26,6 +32,10 @@ _expected_lexical_test_data = ['', 'CCCP
+ _expected_lowercase_test_data = ['', 'a', 'aaa', 'b',
'c', 'CC', 'cccce', 'ccccf', 'CCCP']
+
+ class ComparatorTests (unittest.TestCase):
++ if sys.version_info[:3] < (2, 4, 0):
++ def assertTrue(self, expr, msg=None):
++ self.failUnless(expr,msg=msg)
++
+ def comparator_test_helper (self, comparator, expected_data):
+ data = expected_data[:]
+
+@@ -47,7 +57,7 @@ class ComparatorTests (unittest.TestCase
+ data2.append(i)
+ data = data2
+
+- self.failUnless (data == expected_data,
++ self.assertTrue (data == expected_data,
+ "comparator `%s' is not right: %s vs. %s"
+ % (comparator, expected_data, data))
+ def test_lexical_comparator (self):
+@@ -65,6 +75,10 @@ class AbstractBtreeKeyCompareTestCase (u
+ env = None
+ db = None
+
++ if sys.version_info[:3] < (2, 4, 0):
++ def assertTrue(self, expr, msg=None):
++ self.failUnless(expr,msg=msg)
++
+ def setUp (self):
+ self.filename = self.__class__.__name__ + '.db'
+ self.homeDir = get_new_environment_path()
+@@ -115,14 +129,14 @@ class AbstractBtreeKeyCompareTestCase (u
+ rec = curs.first ()
+ while rec:
+ key, ignore = rec
+- self.failUnless (index < len (expected),
++ self.assertTrue(index < len (expected),
+ "to many values returned from cursor")
+- self.failUnless (expected[index] == key,
++ self.assertTrue(expected[index] == key,
+ "expected value `%s' at %d but got
`%s'"
+ % (expected[index], index, key))
+ index = index + 1
+ rec = curs.next ()
+- self.failUnless (index == len (expected),
++ self.assertTrue(index == len (expected),
+ "not enough values returned from cursor")
+ finally:
+ curs.close ()
+diff -Nupr Python-2.6.4.orig/Lib/bsddb/test/test_compat.py
Python-2.6.4/Lib/bsddb/test/test_compat.py
+--- Python-2.6.4.orig/Lib/bsddb/test/test_compat.py 2009-07-02 11:37:21.000000000 -0400
++++ Python-2.6.4/Lib/bsddb/test/test_compat.py 2009-12-04 07:36:00.000000000 -0500
+@@ -133,7 +133,7 @@ class CompatibilityTestCase(unittest.Tes
+ except KeyError:
+ pass
+ else:
+- self.fail("set_location on non-existent key did not raise
KeyError")
++ self.fail("set_location on non-existant key did not raise
KeyError")
+
+ f.sync()
+ f.close()
+diff -Nupr Python-2.6.4.orig/Lib/bsddb/test/test_dbenv.py
Python-2.6.4/Lib/bsddb/test/test_dbenv.py
+--- Python-2.6.4.orig/Lib/bsddb/test/test_dbenv.py 1969-12-31 19:00:00.000000000 -0500
++++ Python-2.6.4/Lib/bsddb/test/test_dbenv.py 2009-12-04 07:36:00.000000000 -0500
+@@ -0,0 +1,148 @@
++import unittest
++import os, glob
++
++from test_all import db, test_support, get_new_environment_path, \
++ get_new_database_path
++
++#----------------------------------------------------------------------
++
++class DBEnv(unittest.TestCase):
++ def setUp(self):
++ self.homeDir = get_new_environment_path()
++ self.env = db.DBEnv()
++
++ def tearDown(self):
++ del self.env
++ test_support.rmtree(self.homeDir)
++
++ if db.version() >= (4, 2) :
++ def test_setget_data_dirs(self) :
++ dirs = ("a", "b", "c", "d")
++ for i in dirs :
++ self.env.set_data_dir(i)
++ self.assertEqual(dirs, self.env.get_data_dirs())
++
++ def test_setget_cachesize(self) :
++ cachesize = (0, 512*1024*1024, 3)
++ self.env.set_cachesize(*cachesize)
++ self.assertEqual(cachesize, self.env.get_cachesize())
++
++ cachesize = (0, 1*1024*1024, 5)
++ self.env.set_cachesize(*cachesize)
++ cachesize2 = self.env.get_cachesize()
++ self.assertEqual(cachesize[0], cachesize2[0])
++ self.assertEqual(cachesize[2], cachesize2[2])
++ # Berkeley DB expands the cache 25% accounting overhead,
++ # if the cache is small.
++ self.assertEqual(125, int(100.0*cachesize2[1]/cachesize[1]))
++
++ # You can not change configuration after opening
++ # the environment.
++ self.env.open(self.homeDir, db.DB_CREATE | db.DB_INIT_MPOOL)
++ cachesize = (0, 2*1024*1024, 1)
++ self.assertRaises(db.DBInvalidArgError,
++ self.env.set_cachesize, *cachesize)
++ self.assertEqual(cachesize2, self.env.get_cachesize())
++
++ def test_set_cachesize_dbenv_db(self) :
++ # You can not configure the cachesize using
++ # the database handle, if you are using an environment.
++ d = db.DB(self.env)
++ self.assertRaises(db.DBInvalidArgError,
++ d.set_cachesize, 0, 1024*1024, 1)
++
++ def test_setget_shm_key(self) :
++ shm_key=137
++ self.env.set_shm_key(shm_key)
++ self.assertEqual(shm_key, self.env.get_shm_key())
++ self.env.set_shm_key(shm_key+1)
++ self.assertEqual(shm_key+1, self.env.get_shm_key())
++
++ # You can not change configuration after opening
++ # the environment.
++ self.env.open(self.homeDir, db.DB_CREATE | db.DB_INIT_MPOOL)
++ # If we try to reconfigure cache after opening the
++ # environment, core dump.
++ self.assertRaises(db.DBInvalidArgError,
++ self.env.set_shm_key, shm_key)
++ self.assertEqual(shm_key+1, self.env.get_shm_key())
++
++ if db.version() >= (4, 4) :
++ def test_mutex_setget_max(self) :
++ v = self.env.mutex_get_max()
++ v2 = v*2+1
++
++ self.env.mutex_set_max(v2)
++ self.assertEqual(v2, self.env.mutex_get_max())
++
++ self.env.mutex_set_max(v)
++ self.assertEqual(v, self.env.mutex_get_max())
++
++ # You can not change configuration after opening
++ # the environment.
++ self.env.open(self.homeDir, db.DB_CREATE)
++ self.assertRaises(db.DBInvalidArgError,
++ self.env.mutex_set_max, v2)
++
++ def test_mutex_setget_increment(self) :
++ v = self.env.mutex_get_increment()
++ v2 = 127
++
++ self.env.mutex_set_increment(v2)
++ self.assertEqual(v2, self.env.mutex_get_increment())
++
++ self.env.mutex_set_increment(v)
++ self.assertEqual(v, self.env.mutex_get_increment())
++
++ # You can not change configuration after opening
++ # the environment.
++ self.env.open(self.homeDir, db.DB_CREATE)
++ self.assertRaises(db.DBInvalidArgError,
++ self.env.mutex_set_increment, v2)
++
++ def test_mutex_setget_tas_spins(self) :
++ self.env.mutex_set_tas_spins(0) # Default = BDB decides
++ v = self.env.mutex_get_tas_spins()
++ v2 = v*2+1
++
++ self.env.mutex_set_tas_spins(v2)
++ self.assertEqual(v2, self.env.mutex_get_tas_spins())
++
++ self.env.mutex_set_tas_spins(v)
++ self.assertEqual(v, self.env.mutex_get_tas_spins())
++
++ # In this case, you can change configuration
++ # after opening the environment.
++ self.env.open(self.homeDir, db.DB_CREATE)
++ self.env.mutex_set_tas_spins(v2)
++
++ def test_mutex_setget_align(self) :
++ v = self.env.mutex_get_align()
++ v2 = 64
++ if v == 64 :
++ v2 = 128
++
++ self.env.mutex_set_align(v2)
++ self.assertEqual(v2, self.env.mutex_get_align())
++
++ # Requires a nonzero power of two
++ self.assertRaises(db.DBInvalidArgError,
++ self.env.mutex_set_align, 0)
++ self.assertRaises(db.DBInvalidArgError,
++ self.env.mutex_set_align, 17)
++
++ self.env.mutex_set_align(2*v2)
++ self.assertEqual(2*v2, self.env.mutex_get_align())
++
++ # You can not change configuration after opening
++ # the environment.
++ self.env.open(self.homeDir, db.DB_CREATE)
++ self.assertRaises(db.DBInvalidArgError,
++ self.env.mutex_set_align, v2)
++
++
++def test_suite():
++ return unittest.makeSuite(DBEnv)
++
++if __name__ == '__main__':
++ unittest.main(defaultTest='test_suite')
+diff -Nupr Python-2.6.4.orig/Lib/bsddb/test/test_dbtables.py
Python-2.6.4/Lib/bsddb/test/test_dbtables.py
+--- Python-2.6.4.orig/Lib/bsddb/test/test_dbtables.py 2008-08-31 10:00:51.000000000
-0400
++++ Python-2.6.4/Lib/bsddb/test/test_dbtables.py 2009-12-04 07:36:00.000000000 -0500
+@@ -18,13 +18,17 @@
+ #
+ # -- Gregory P. Smith <greg(a)krypto.org>
+ #
+-# $Id: test_dbtables.py 66088 2008-08-31 14:00:51Z jesus.cea $
++# $Id: test_dbtables.py 58532 2007-10-18 07:56:54Z gregory.p.smith $
+
+-import os, re
+-try:
+- import cPickle
+- pickle = cPickle
+-except ImportError:
++import os, re, sys
++
++if sys.version_info[0] < 3 :
++ try:
++ import cPickle
++ pickle = cPickle
++ except ImportError:
++ import pickle
++else :
+ import pickle
+
+ import unittest
+diff -Nupr Python-2.6.4.orig/Lib/bsddb/test/test_distributed_transactions.py
Python-2.6.4/Lib/bsddb/test/test_distributed_transactions.py
+--- Python-2.6.4.orig/Lib/bsddb/test/test_distributed_transactions.py 2008-08-31
10:00:51.000000000 -0400
++++ Python-2.6.4/Lib/bsddb/test/test_distributed_transactions.py 2009-12-04
07:36:00.000000000 -0500
+@@ -35,9 +35,9 @@ class DBTxn_distributed(unittest.TestCas
+ db.DB_INIT_TXN | db.DB_INIT_LOG | db.DB_INIT_MPOOL |
+ db.DB_INIT_LOCK, 0666)
+ self.db = db.DB(self.dbenv)
+- self.db.set_re_len(db.DB_XIDDATASIZE)
++ self.db.set_re_len(db.DB_GID_SIZE)
+ if must_open_db :
+- if db.version() > (4,1) :
++ if db.version() >= (4,2) :
+ txn=self.dbenv.txn_begin()
+ self.db.open(self.filename,
+ db.DB_QUEUE, db.DB_CREATE | db.DB_THREAD, 0666,
+@@ -76,7 +76,7 @@ class DBTxn_distributed(unittest.TestCas
+ # let them be garbage collected.
+ for i in xrange(self.num_txns) :
+ txn = self.dbenv.txn_begin()
+- gid = "%%%dd" %db.DB_XIDDATASIZE
++ gid = "%%%dd" %db.DB_GID_SIZE
+ gid = adapt(gid %i)
+ self.db.put(i, gid, txn=txn, flags=db.DB_APPEND)
+ txns.add(gid)
+diff -Nupr Python-2.6.4.orig/Lib/bsddb/test/test_early_close.py
Python-2.6.4/Lib/bsddb/test/test_early_close.py
+--- Python-2.6.4.orig/Lib/bsddb/test/test_early_close.py 2008-09-08 20:49:16.000000000
-0400
++++ Python-2.6.4/Lib/bsddb/test/test_early_close.py 2009-12-04 07:36:00.000000000 -0500
+@@ -155,11 +155,8 @@ class DBEnvClosedEarlyCrash(unittest.Tes
+ db.DB_INIT_LOG | db.DB_CREATE)
+ d = db.DB(dbenv)
+ txn = dbenv.txn_begin()
+- if db.version() < (4,1) :
+- d.open(self.filename, dbtype = db.DB_HASH, flags = db.DB_CREATE)
+- else :
+- d.open(self.filename, dbtype = db.DB_HASH, flags = db.DB_CREATE,
+- txn=txn)
++ d.open(self.filename, dbtype = db.DB_HASH, flags = db.DB_CREATE,
++ txn=txn)
+ d.put("XXX", "yyy", txn=txn)
+ txn.commit()
+ txn = dbenv.txn_begin()
+@@ -168,9 +165,9 @@ class DBEnvClosedEarlyCrash(unittest.Tes
+ self.assertEquals(("XXX", "yyy"), c1.first())
+ import warnings
+ # Not interested in warnings about implicit close.
+- with warnings.catch_warnings():
+- warnings.simplefilter("ignore")
+- txn.commit()
++ warnings.simplefilter("ignore")
++ txn.commit()
++ warnings.resetwarnings()
+ self.assertRaises(db.DBCursorClosedError, c2.first)
+
+ if db.version() > (4,3,0) :
+diff -Nupr Python-2.6.4.orig/Lib/bsddb/test/test_fileid.py
Python-2.6.4/Lib/bsddb/test/test_fileid.py
+--- Python-2.6.4.orig/Lib/bsddb/test/test_fileid.py 1969-12-31 19:00:00.000000000 -0500
++++ Python-2.6.4/Lib/bsddb/test/test_fileid.py 2009-12-04 07:36:00.000000000 -0500
+@@ -0,0 +1,63 @@
++"""TestCase for reseting File ID.
++"""
++
++import os
++import shutil
++import unittest
++
++from test_all import db, test_support, get_new_environment_path, get_new_database_path
++
++class FileidResetTestCase(unittest.TestCase):
++ def setUp(self):
++ self.db_path_1 = get_new_database_path()
++ self.db_path_2 = get_new_database_path()
++ self.db_env_path = get_new_environment_path()
++
++ def test_fileid_reset(self):
++ # create DB 1
++ self.db1 = db.DB()
++ self.db1.open(self.db_path_1, dbtype=db.DB_HASH,
flags=(db.DB_CREATE|db.DB_EXCL))
++ self.db1.put('spam', 'eggs')
++ self.db1.close()
++
++ shutil.copy(self.db_path_1, self.db_path_2)
++
++ self.db2 = db.DB()
++ self.db2.open(self.db_path_2, dbtype=db.DB_HASH)
++ self.db2.put('spam', 'spam')
++ self.db2.close()
++
++ self.db_env = db.DBEnv()
++ self.db_env.open(self.db_env_path, db.DB_CREATE|db.DB_INIT_MPOOL)
++
++ # use fileid_reset() here
++ self.db_env.fileid_reset(self.db_path_2)
++
++ self.db1 = db.DB(self.db_env)
++ self.db1.open(self.db_path_1, dbtype=db.DB_HASH, flags=db.DB_RDONLY)
++ self.assertEquals(self.db1.get('spam'), 'eggs')
++
++ self.db2 = db.DB(self.db_env)
++ self.db2.open(self.db_path_2, dbtype=db.DB_HASH, flags=db.DB_RDONLY)
++ self.assertEquals(self.db2.get('spam'), 'spam')
++
++ self.db1.close()
++ self.db2.close()
++
++ self.db_env.close()
++
++ def tearDown(self):
++ test_support.unlink(self.db_path_1)
++ test_support.unlink(self.db_path_2)
++ test_support.rmtree(self.db_env_path)
++
++def test_suite():
++ suite = unittest.TestSuite()
++ if db.version() >= (4, 4):
++ suite.addTest(unittest.makeSuite(FileidResetTestCase))
++ return suite
++
++if __name__ == '__main__':
++ unittest.main(defaultTest='test_suite')
++
++
+diff -Nupr Python-2.6.4.orig/Lib/bsddb/test/test_lock.py
Python-2.6.4/Lib/bsddb/test/test_lock.py
+--- Python-2.6.4.orig/Lib/bsddb/test/test_lock.py 2009-01-26 16:53:32.000000000 -0500
++++ Python-2.6.4/Lib/bsddb/test/test_lock.py 2009-12-04 07:36:00.000000000 -0500
+@@ -89,7 +89,18 @@ class LockingTestCase(unittest.TestCase)
+ for t in threads:
+ t.join()
+
+- def test03_lock_timeout(self):
++ if db.version() >= (4, 2) :
++ def test03_lock_timeout(self):
++ self.env.set_timeout(0, db.DB_SET_LOCK_TIMEOUT)
++ self.assertEqual(self.env.get_timeout(db.DB_SET_LOCK_TIMEOUT), 0)
++ self.env.set_timeout(0, db.DB_SET_TXN_TIMEOUT)
++ self.assertEqual(self.env.get_timeout(db.DB_SET_TXN_TIMEOUT), 0)
++ self.env.set_timeout(123456, db.DB_SET_LOCK_TIMEOUT)
++ self.assertEqual(self.env.get_timeout(db.DB_SET_LOCK_TIMEOUT), 123456)
++ self.env.set_timeout(7890123, db.DB_SET_TXN_TIMEOUT)
++ self.assertEqual(self.env.get_timeout(db.DB_SET_TXN_TIMEOUT), 7890123)
++
++ def test04_lock_timeout2(self):
+ self.env.set_timeout(0, db.DB_SET_LOCK_TIMEOUT)
+ self.env.set_timeout(0, db.DB_SET_TXN_TIMEOUT)
+ self.env.set_timeout(123456, db.DB_SET_LOCK_TIMEOUT)
+@@ -124,7 +135,7 @@ class LockingTestCase(unittest.TestCase)
+ self.env.lock_get,anID2, "shared lock", db.DB_LOCK_READ)
+ end_time=time.time()
+ deadlock_detection.end=True
+- self.assertTrue((end_time-start_time) >= 0.0999)
++ self.assertTrue((end_time-start_time) >= 0.1)
+ self.env.lock_put(lock)
+ t.join()
+
+diff -Nupr Python-2.6.4.orig/Lib/bsddb/test/test_pickle.py
Python-2.6.4/Lib/bsddb/test/test_pickle.py
+--- Python-2.6.4.orig/Lib/bsddb/test/test_pickle.py 2008-08-31 10:00:51.000000000 -0400
++++ Python-2.6.4/Lib/bsddb/test/test_pickle.py 2009-12-04 07:36:00.000000000 -0500
+@@ -1,10 +1,16 @@
+
+ import os
+ import pickle
+-try:
+- import cPickle
+-except ImportError:
++import sys
++
++if sys.version_info[0] < 3 :
++ try:
++ import cPickle
++ except ImportError:
++ cPickle = None
++else :
+ cPickle = None
++
+ import unittest
+
+ from test_all import db, test_support, get_new_environment_path, get_new_database_path
+diff -Nupr Python-2.6.4.orig/Lib/bsddb/test/test_recno.py
Python-2.6.4/Lib/bsddb/test/test_recno.py
+--- Python-2.6.4.orig/Lib/bsddb/test/test_recno.py 2009-07-02 11:37:21.000000000 -0400
++++ Python-2.6.4/Lib/bsddb/test/test_recno.py 2009-12-04 07:36:00.000000000 -0500
+@@ -150,7 +150,7 @@ class SimpleRecnoTestCase(unittest.TestC
+ if verbose:
+ print rec
+
+- # test that non-existent key lookups work (and that
++ # test that non-existant key lookups work (and that
+ # DBC_set_range doesn't have a memleak under valgrind)
+ rec = c.set_range(999999)
+ self.assertEqual(rec, None)
+diff -Nupr Python-2.6.4.orig/Lib/bsddb/test/test_replication.py
Python-2.6.4/Lib/bsddb/test/test_replication.py
+--- Python-2.6.4.orig/Lib/bsddb/test/test_replication.py 2008-09-17 22:47:35.000000000
-0400
++++ Python-2.6.4/Lib/bsddb/test/test_replication.py 2009-12-04 07:36:00.000000000 -0500
+@@ -119,19 +119,7 @@ class DBReplicationManager(unittest.Test
+ timeout = time.time()+10
+ while (time.time()<timeout) and not (self.confirmed_master and
self.client_startupdone) :
+ time.sleep(0.02)
+- # this fails on Windows as self.client_startupdone never gets set
+- # to True - see bug 3892. BUT - even though this assertion
+- # fails on Windows the rest of the test passes - so to prove
+- # that we let the rest of the test run. Sadly we can't
+- # make use of raising TestSkipped() here (unittest still
+- # reports it as an error), so we yell to stderr.
+- import sys
+- if sys.platform=="win32":
+- print >> sys.stderr, \
+- "XXX - windows bsddb replication fails on windows and is
skipped"
+- print >> sys.stderr, "XXX - Please see issue #3892"
+- else:
+- self.assertTrue(time.time()<timeout)
++ self.assertTrue(time.time()<timeout)
+
+ d = self.dbenvMaster.repmgr_site_list()
+ self.assertEquals(len(d), 1)
+@@ -340,6 +328,9 @@ class DBBaseReplication(DBReplicationMan
+ txn.commit()
+ break
+
++ d = self.dbenvMaster.rep_stat(flags=db.DB_STAT_CLEAR);
++ self.assertTrue("master_changes" in d)
++
+ txn=self.dbenvMaster.txn_begin()
+ self.dbMaster.put("ABC", "123", txn=txn)
+ txn.commit()
+@@ -430,6 +421,14 @@ class DBBaseReplication(DBReplicationMan
+
+ self.assertTrue(self.confirmed_master)
+
++ if db.version() >= (4,7) :
++ def test04_test_clockskew(self) :
++ fast, slow = 1234, 1230
++ self.dbenvMaster.rep_set_clockskew(fast, slow)
++ self.assertEqual((fast, slow),
++ self.dbenvMaster.rep_get_clockskew())
++ self.basic_rep_threading()
++
+ #----------------------------------------------------------------------
+
+ def test_suite():
+diff -Nupr Python-2.6.4.orig/Lib/bsddb/test/test_sequence.py
Python-2.6.4/Lib/bsddb/test/test_sequence.py
+--- Python-2.6.4.orig/Lib/bsddb/test/test_sequence.py 2008-08-31 10:00:51.000000000
-0400
++++ Python-2.6.4/Lib/bsddb/test/test_sequence.py 2009-12-04 07:36:00.000000000 -0500
+@@ -37,7 +37,7 @@ class DBSequenceTest(unittest.TestCase):
+ self.seq = db.DBSequence(self.d, flags=0)
+ start_value = 10 * self.int_32_max
+ self.assertEqual(0xA00000000, start_value)
+- self.assertEquals(None, self.seq.init_value(start_value))
++ self.assertEquals(None, self.seq.initial_value(start_value))
+ self.assertEquals(None, self.seq.open(key='id', txn=None,
flags=db.DB_CREATE))
+ self.assertEquals(start_value, self.seq.get(5))
+ self.assertEquals(start_value + 5, self.seq.get())
+@@ -77,7 +77,7 @@ class DBSequenceTest(unittest.TestCase):
+ self.seq = db.DBSequence(self.d, flags=0)
+ seq_range = (10 * self.int_32_max, 11 * self.int_32_max - 1)
+ self.assertEquals(None, self.seq.set_range(seq_range))
+- self.seq.init_value(seq_range[0])
++ self.seq.initial_value(seq_range[0])
+ self.assertEquals(None, self.seq.open(key='foo', txn=None,
flags=db.DB_CREATE))
+ self.assertEquals(seq_range, self.seq.get_range())
+
+@@ -110,7 +110,7 @@ class DBSequenceTest(unittest.TestCase):
+ value_minus=(-1L<<63)+1 # Two complement
+ self.assertEquals(-9223372036854775807L,value_minus)
+ self.seq = db.DBSequence(self.d, flags=0)
+- self.assertEquals(None, self.seq.init_value(value_plus-1))
++ self.assertEquals(None, self.seq.initial_value(value_plus-1))
+ self.assertEquals(None, self.seq.open(key='id', txn=None,
+ flags=db.DB_CREATE))
+ self.assertEquals(value_plus-1, self.seq.get(1))
+@@ -119,7 +119,7 @@ class DBSequenceTest(unittest.TestCase):
+ self.seq.remove(txn=None, flags=0)
+
+ self.seq = db.DBSequence(self.d, flags=0)
+- self.assertEquals(None, self.seq.init_value(value_minus))
++ self.assertEquals(None, self.seq.initial_value(value_minus))
+ self.assertEquals(None, self.seq.open(key='id', txn=None,
+ flags=db.DB_CREATE))
+ self.assertEquals(value_minus, self.seq.get(1))
+diff -Nupr Python-2.6.4.orig/Lib/bsddb/test_support.py
Python-2.6.4/Lib/bsddb/test_support.py
+--- Python-2.6.4.orig/Lib/bsddb/test_support.py 1969-12-31 19:00:00.000000000 -0500
++++ Python-2.6.4/Lib/bsddb/test_support.py 2009-12-04 07:36:00.000000000 -0500
+@@ -0,0 +1,54 @@
++# This module is a bridge.
++#
++# Code is copied from Python 2.6 (trunk) Lib/test/test_support.py that
++# the bsddb test suite needs even when run standalone on a python
++# version that may not have all of these.
++
++# DO NOT ADD NEW UNIQUE CODE. Copy code from the python trunk
++# trunk test_support module into here. If you need a place for your
++# own stuff specific to bsddb tests, make a bsddb.test.foo module.
++
++import errno
++import os
++import shutil
++import socket
++
++def unlink(filename):
++ try:
++ os.unlink(filename)
++ except OSError:
++ pass
++
++def rmtree(path):
++ try:
++ shutil.rmtree(path)
++ except OSError, e:
++ # Unix returns ENOENT, Windows returns ESRCH.
++ if e.errno not in (errno.ENOENT, errno.ESRCH):
++ raise
++
++def find_unused_port(family=socket.AF_INET, socktype=socket.SOCK_STREAM):
++ tempsock = socket.socket(family, socktype)
++ port = bind_port(tempsock, family=family, socktype=socktype)
++ tempsock.close()
++ del tempsock
++ return port
++
++HOST = 'localhost'
++def bind_port(sock, family, socktype, host=HOST):
++ if family == socket.AF_INET and type == socket.SOCK_STREAM:
++ if hasattr(socket, 'SO_REUSEADDR'):
++ if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR) == 1:
++ raise TestFailed("tests should never set the SO_REUSEADDR "
\
++ "socket option on TCP/IP sockets!")
++ if hasattr(socket, 'SO_REUSEPORT'):
++ if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) == 1:
++ raise TestFailed("tests should never set the SO_REUSEPORT "
\
++ "socket option on TCP/IP sockets!")
++ if hasattr(socket, 'SO_EXCLUSIVEADDRUSE'):
++ sock.setsockopt(socket.SOL_SOCKET, socket.SO_EXCLUSIVEADDRUSE, 1)
++
++ sock.bind((host, 0))
++ port = sock.getsockname()[1]
++ return port
++
+diff -Nupr Python-2.6.4.orig/Modules/_bsddb.c Python-2.6.4/Modules/_bsddb.c
+--- Python-2.6.4.orig/Modules/_bsddb.c 2008-09-23 14:54:08.000000000 -0400
++++ Python-2.6.4/Modules/_bsddb.c 2009-12-04 07:34:56.000000000 -0500
+@@ -95,7 +95,7 @@
+ #include "bsddb.h"
+ #undef COMPILING_BSDDB_C
+
+-static char *rcs_id = "$Id: _bsddb.c 66568 2008-09-23 18:54:08Z jesus.cea $";
++static char *rcs_id = "$Id: _bsddb.c 732 2009-11-05 19:39:04Z jcea $";
+
+ /* --------------------------------------------------------------------- */
+ /* Various macro definitions */
+@@ -169,9 +169,6 @@ static PyInterpreterState* _db_interpret
+
+ #endif
+
+-/* Should DB_INCOMPLETE be turned into a warning or an exception? */
+-#define INCOMPLETE_IS_WARNING 1
+-
+ /* --------------------------------------------------------------------- */
+ /* Exceptions */
+
+@@ -191,10 +188,6 @@ static PyObject* DBNoServerIDError;
+ static PyObject* DBPageNotFoundError; /* DB_PAGE_NOTFOUND */
+ static PyObject* DBSecondaryBadError; /* DB_SECONDARY_BAD */
+
+-#if !INCOMPLETE_IS_WARNING
+-static PyObject* DBIncompleteError; /* DB_INCOMPLETE */
+-#endif
+-
+ static PyObject* DBInvalidArgError; /* EINVAL */
+ static PyObject* DBAccessError; /* EACCES */
+ static PyObject* DBNoSpaceError; /* ENOSPC */
+@@ -208,6 +201,13 @@ static PyObject* DBPermissionsError;
+ #if (DBVER >= 42)
+ static PyObject* DBRepHandleDeadError; /* DB_REP_HANDLE_DEAD */
+ #endif
++#if (DBVER >= 44)
++static PyObject* DBRepLockoutError; /* DB_REP_LOCKOUT */
++#endif
++
++#if (DBVER >= 46)
++static PyObject* DBRepLeaseExpiredError; /* DB_REP_LEASE_EXPIRED */
++#endif
+
+ static PyObject* DBRepUnavailError; /* DB_REP_UNAVAIL */
+
+@@ -215,6 +215,10 @@ static PyObject* DBRepUnavailError;
+ #define DB_BUFFER_SMALL ENOMEM
+ #endif
+
++#if (DBVER < 48)
++#define DB_GID_SIZE DB_XIDDATASIZE
++#endif
++
+
+ /* --------------------------------------------------------------------- */
+ /* Structure definitions */
+@@ -667,27 +671,8 @@ static int makeDBError(int err)
+ unsigned int bytes_left;
+
+ switch (err) {
+- case 0: /* successful, no error */ break;
+-
+-#if (DBVER < 41)
+- case DB_INCOMPLETE:
+-#if INCOMPLETE_IS_WARNING
+- bytes_left = our_strlcpy(errTxt, db_strerror(err), sizeof(errTxt));
+- /* Ensure that bytes_left never goes negative */
+- if (_db_errmsg[0] && bytes_left < (sizeof(errTxt) - 4)) {
+- bytes_left = sizeof(errTxt) - bytes_left - 4 - 1;
+- assert(bytes_left >= 0);
+- strcat(errTxt, " -- ");
+- strncat(errTxt, _db_errmsg, bytes_left);
+- }
+- _db_errmsg[0] = 0;
+- exceptionRaised = PyErr_Warn(PyExc_RuntimeWarning, errTxt);
+-
+-#else /* do an exception instead */
+- errObj = DBIncompleteError;
+-#endif
+- break;
+-#endif /* DBVER < 41 */
++ case 0: /* successful, no error */
++ return 0;
+
+ case DB_KEYEMPTY: errObj = DBKeyEmptyError; break;
+ case DB_KEYEXIST: errObj = DBKeyExistError; break;
+@@ -720,6 +705,13 @@ static int makeDBError(int err)
+ #if (DBVER >= 42)
+ case DB_REP_HANDLE_DEAD : errObj = DBRepHandleDeadError; break;
+ #endif
++#if (DBVER >= 44)
++ case DB_REP_LOCKOUT : errObj = DBRepLockoutError; break;
++#endif
++
++#if (DBVER >= 46)
++ case DB_REP_LEASE_EXPIRED : errObj = DBRepLeaseExpiredError; break;
++#endif
+
+ case DB_REP_UNAVAIL : errObj = DBRepUnavailError; break;
+
+@@ -1417,10 +1409,70 @@ _db_associateCallback(DB* db, const DBT*
+ PyErr_Print();
+ }
+ }
++#if (DBVER >= 46)
++ else if (PyList_Check(result))
++ {
++ char* data;
++ Py_ssize_t size;
++ int i, listlen;
++ DBT* dbts;
++
++ listlen = PyList_Size(result);
++
++ dbts = (DBT *)malloc(sizeof(DBT) * listlen);
++
++ for (i=0; i<listlen; i++)
++ {
++ if (!PyBytes_Check(PyList_GetItem(result, i)))
++ {
++ PyErr_SetString(
++ PyExc_TypeError,
++#if (PY_VERSION_HEX < 0x03000000)
++"The list returned by DB->associate callback should be a list of
strings.");
++#else
++"The list returned by DB->associate callback should be a list of bytes.");
++#endif
++ PyErr_Print();
++ }
++
++ PyBytes_AsStringAndSize(
++ PyList_GetItem(result, i),
++ &data, &size);
++
++ CLEAR_DBT(dbts[i]);
++ dbts[i].data = malloc(size); /* TODO, check this */
++
++ if (dbts[i].data)
++ {
++ memcpy(dbts[i].data, data, size);
++ dbts[i].size = size;
++ dbts[i].ulen = dbts[i].size;
++ dbts[i].flags = DB_DBT_APPMALLOC; /* DB will free */
++ }
++ else
++ {
++ PyErr_SetString(PyExc_MemoryError,
++ "malloc failed in _db_associateCallback (list)");
++ PyErr_Print();
++ }
++ }
++
++ CLEAR_DBT(*secKey);
++
++ secKey->data = dbts;
++ secKey->size = listlen;
++ secKey->flags = DB_DBT_APPMALLOC | DB_DBT_MULTIPLE;
++ retval = 0;
++ }
++#endif
+ else {
+ PyErr_SetString(
+ PyExc_TypeError,
+- "DB associate callback should return DB_DONOTINDEX or
string.");
++#if (PY_VERSION_HEX < 0x03000000)
++"DB associate callback should return DB_DONOTINDEX/string/list of strings.");
++#else
++"DB associate callback should return DB_DONOTINDEX/bytes/list of bytes.");
++#endif
+ PyErr_Print();
+ }
+
+@@ -1439,29 +1491,18 @@ DB_associate(DBObject* self, PyObject* a
+ int err, flags=0;
+ DBObject* secondaryDB;
+ PyObject* callback;
+-#if (DBVER >= 41)
+ PyObject *txnobj = NULL;
+ DB_TXN *txn = NULL;
+ static char* kwnames[] = {"secondaryDB", "callback",
"flags", "txn",
+ NULL};
+-#else
+- static char* kwnames[] = {"secondaryDB", "callback",
"flags", NULL};
+-#endif
+
+-#if (DBVER >= 41)
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO|iO:associate",
kwnames,
+ &secondaryDB, &callback, &flags,
+ &txnobj)) {
+-#else
+- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO|i:associate", kwnames,
+- &secondaryDB, &callback, &flags)) {
+-#endif
+ return NULL;
+ }
+
+-#if (DBVER >= 41)
+ if (!checkTxnObj(txnobj, &txn)) return NULL;
+-#endif
+
+ CHECK_DB_NOT_CLOSED(self);
+ if (!DBObject_Check(secondaryDB)) {
+@@ -1497,18 +1538,11 @@ DB_associate(DBObject* self, PyObject* a
+ PyEval_InitThreads();
+ #endif
+ MYDB_BEGIN_ALLOW_THREADS;
+-#if (DBVER >= 41)
+ err = self->db->associate(self->db,
+ txn,
+ secondaryDB->db,
+ _db_associateCallback,
+ flags);
+-#else
+- err = self->db->associate(self->db,
+- secondaryDB->db,
+- _db_associateCallback,
+- flags);
+-#endif
+ MYDB_END_ALLOW_THREADS;
+
+ if (err) {
+@@ -1701,6 +1735,64 @@ DB_delete(DBObject* self, PyObject* args
+ }
+
+
++#if (DBVER >= 47)
++/*
++** This function is available since Berkeley DB 4.4,
++** but 4.6 version is so buggy that we only support
++** it from BDB 4.7 and newer.
++*/
++static PyObject*
++DB_compact(DBObject* self, PyObject* args, PyObject* kwargs)
++{
++ PyObject* txnobj = NULL;
++ PyObject *startobj = NULL, *stopobj = NULL;
++ int flags = 0;
++ DB_TXN *txn = NULL;
++ DBT *start_p = NULL, *stop_p = NULL;
++ DBT start, stop;
++ int err;
++ DB_COMPACT c_data = { 0 };
++ static char* kwnames[] = { "txn", "start", "stop",
"flags",
++ "compact_fillpercent",
"compact_pages",
++ "compact_timeout", NULL };
++
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OOOiiiI:compact",
kwnames,
++ &txnobj, &startobj, &stopobj,
&flags,
++ &c_data.compact_fillpercent,
++ &c_data.compact_pages,
++ &c_data.compact_timeout))
++ return NULL;
++
++ CHECK_DB_NOT_CLOSED(self);
++ if (!checkTxnObj(txnobj, &txn)) {
++ return NULL;
++ }
++
++ if (startobj && make_key_dbt(self, startobj, &start, NULL)) {
++ start_p = &start;
++ }
++ if (stopobj && make_key_dbt(self, stopobj, &stop, NULL)) {
++ stop_p = &stop;
++ }
++
++ MYDB_BEGIN_ALLOW_THREADS;
++ err = self->db->compact(self->db, txn, start_p, stop_p, &c_data,
++ flags, NULL);
++ MYDB_END_ALLOW_THREADS;
++
++ if (startobj)
++ FREE_DBT(start);
++ if (stopobj)
++ FREE_DBT(stop);
++
++ RETURN_IF_ERR();
++
++ return PyLong_FromUnsignedLong(c_data.compact_pages_truncated);
++}
++#endif
++
++
+ static PyObject*
+ DB_fd(DBObject* self)
+ {
+@@ -1716,6 +1808,55 @@ DB_fd(DBObject* self)
+ }
+
+
++#if (DBVER >= 46)
++static PyObject*
++DB_exists(DBObject* self, PyObject* args, PyObject* kwargs)
++{
++ int err, flags=0;
++ PyObject* txnobj = NULL;
++ PyObject* keyobj;
++ DBT key;
++ DB_TXN *txn;
++
++ static char* kwnames[] = {"key", "txn", "flags",
NULL};
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|Oi:exists", kwnames,
++ &keyobj, &txnobj, &flags))
++ return NULL;
++
++ CHECK_DB_NOT_CLOSED(self);
++ if (!make_key_dbt(self, keyobj, &key, NULL))
++ return NULL;
++ if (!checkTxnObj(txnobj, &txn)) {
++ FREE_DBT(key);
++ return NULL;
++ }
++
++ MYDB_BEGIN_ALLOW_THREADS;
++ err = self->db->exists(self->db, txn, &key, flags);
++ MYDB_END_ALLOW_THREADS;
++
++ FREE_DBT(key);
++
++ if (!err) {
++ Py_INCREF(Py_True);
++ return Py_True;
++ }
++ if ((err == DB_NOTFOUND || err == DB_KEYEMPTY)) {
++ Py_INCREF(Py_False);
++ return Py_False;
++ }
++
++ /*
++ ** If we reach there, there was an error. The
++ ** "return" should be unreachable.
++ */
++ RETURN_IF_ERR();
++ assert(0); /* This coude SHOULD be unreachable */
++ return NULL;
++}
++#endif
++
+ static PyObject*
+ DB_get(DBObject* self, PyObject* args, PyObject* kwargs)
+ {
+@@ -2114,7 +2255,6 @@ DB_open(DBObject* self, PyObject* args,
+ int err, type = DB_UNKNOWN, flags=0, mode=0660;
+ char* filename = NULL;
+ char* dbname = NULL;
+-#if (DBVER >= 41)
+ PyObject *txnobj = NULL;
+ DB_TXN *txn = NULL;
+ /* with dbname */
+@@ -2123,45 +2263,22 @@ DB_open(DBObject* self, PyObject* args,
+ /* without dbname */
+ static char* kwnames_basic[] = {
+ "filename", "dbtype", "flags", "mode",
"txn", NULL};
+-#else
+- /* with dbname */
+- static char* kwnames[] = {
+- "filename", "dbname", "dbtype", "flags",
"mode", NULL};
+- /* without dbname */
+- static char* kwnames_basic[] = {
+- "filename", "dbtype", "flags", "mode",
NULL};
+-#endif
+
+-#if (DBVER >= 41)
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "z|ziiiO:open", kwnames,
+ &filename, &dbname, &type, &flags, &mode,
+ &txnobj))
+-#else
+- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "z|ziii:open", kwnames,
+- &filename, &dbname, &type, &flags,
+- &mode))
+-#endif
+ {
+ PyErr_Clear();
+ type = DB_UNKNOWN; flags = 0; mode = 0660;
+ filename = NULL; dbname = NULL;
+-#if (DBVER >= 41)
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"z|iiiO:open",
+ kwnames_basic,
+ &filename, &type, &flags, &mode,
+ &txnobj))
+ return NULL;
+-#else
+- if (!PyArg_ParseTupleAndKeywords(args, kwargs,"z|iii:open",
+- kwnames_basic,
+- &filename, &type, &flags, &mode))
+- return NULL;
+-#endif
+ }
+
+-#if (DBVER >= 41)
+ if (!checkTxnObj(txnobj, &txn)) return NULL;
+-#endif
+
+ if (NULL == self->db) {
+ PyObject *t = Py_BuildValue("(is)", 0,
+@@ -2173,24 +2290,17 @@ DB_open(DBObject* self, PyObject* args,
+ return NULL;
+ }
+
+-#if (DBVER >= 41)
+ if (txn) { /* Can't use 'txnobj' because could be
'txnobj==Py_None' */
+ INSERT_IN_DOUBLE_LINKED_LIST_TXN(((DBTxnObject
*)txnobj)->children_dbs,self);
+ self->txn=(DBTxnObject *)txnobj;
+ } else {
+ self->txn=NULL;
+ }
+-#else
+- self->txn=NULL;
+-#endif
+
+ MYDB_BEGIN_ALLOW_THREADS;
+-#if (DBVER >= 41)
+ err = self->db->open(self->db, txn, filename, dbname, type, flags, mode);
+-#else
+- err = self->db->open(self->db, filename, dbname, type, flags, mode);
+-#endif
+ MYDB_END_ALLOW_THREADS;
++
+ if (makeDBError(err)) {
+ PyObject *dummy;
+
+@@ -2490,6 +2600,25 @@ DB_set_cachesize(DBObject* self, PyObjec
+ RETURN_NONE();
+ }
+
++#if (DBVER >= 42)
++static PyObject*
++DB_get_cachesize(DBObject* self)
++{
++ int err;
++ u_int32_t gbytes, bytes;
++ int ncache;
++
++ CHECK_DB_NOT_CLOSED(self);
++
++ MYDB_BEGIN_ALLOW_THREADS;
++ err = self->db->get_cachesize(self->db, &gbytes, &bytes,
&ncache);
++ MYDB_END_ALLOW_THREADS;
++
++ RETURN_IF_ERR();
++
++ return Py_BuildValue("(iii)", gbytes, bytes, ncache);
++}
++#endif
+
+ static PyObject*
+ DB_set_flags(DBObject* self, PyObject* args)
+@@ -2730,9 +2859,6 @@ DB_stat(DBObject* self, PyObject* args,
+ MAKE_HASH_ENTRY(pagecnt);
+ #endif
+ MAKE_HASH_ENTRY(pagesize);
+-#if (DBVER < 41)
+- MAKE_HASH_ENTRY(nelem);
+-#endif
+ MAKE_HASH_ENTRY(ffactor);
+ MAKE_HASH_ENTRY(buckets);
+ MAKE_HASH_ENTRY(free);
+@@ -2779,9 +2905,7 @@ DB_stat(DBObject* self, PyObject* args,
+ MAKE_QUEUE_ENTRY(nkeys);
+ MAKE_QUEUE_ENTRY(ndata);
+ MAKE_QUEUE_ENTRY(pagesize);
+-#if (DBVER >= 41)
+ MAKE_QUEUE_ENTRY(extentsize);
+-#endif
+ MAKE_QUEUE_ENTRY(pages);
+ MAKE_QUEUE_ENTRY(re_len);
+ MAKE_QUEUE_ENTRY(re_pad);
+@@ -2892,7 +3016,7 @@ DB_verify(DBObject* self, PyObject* args
+ PyObject *error;
+
+ error=DB_close_internal(self, 0, 1);
+- if (error ) {
++ if (error) {
+ return error;
+ }
+ }
+@@ -2930,7 +3054,6 @@ DB_set_get_returns_none(DBObject* self,
+ return NUMBER_FromLong(oldValue);
+ }
+
+-#if (DBVER >= 41)
+ static PyObject*
+ DB_set_encrypt(DBObject* self, PyObject* args, PyObject* kwargs)
+ {
+@@ -2951,7 +3074,24 @@ DB_set_encrypt(DBObject* self, PyObject*
+ RETURN_IF_ERR();
+ RETURN_NONE();
+ }
+-#endif /* DBVER >= 41 */
++
++#if (DBVER >= 42)
++static PyObject*
++DB_get_encrypt_flags(DBObject* self)
++{
++ int err;
++ u_int32_t flags;
++
++ MYDB_BEGIN_ALLOW_THREADS;
++ err = self->db->get_encrypt_flags(self->db, &flags);
++ MYDB_END_ALLOW_THREADS;
++
++ RETURN_IF_ERR();
++
++ return NUMBER_FromLong(flags);
++}
++#endif
++
+
+
+ /*-------------------------------------------------------------- */
+@@ -3097,18 +3237,11 @@ DB_ass_sub(DBObject* self, PyObject* key
+
+
+ static PyObject*
+-DB_has_key(DBObject* self, PyObject* args, PyObject* kwargs)
++_DB_has_key(DBObject* self, PyObject* keyobj, PyObject* txnobj)
+ {
+ int err;
+- PyObject* keyobj;
+- DBT key, data;
+- PyObject* txnobj = NULL;
++ DBT key;
+ DB_TXN *txn = NULL;
+- static char* kwnames[] = {"key","txn", NULL};
+-
+- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|O:has_key", kwnames,
+- &keyobj, &txnobj))
+- return NULL;
+
+ CHECK_DB_NOT_CLOSED(self);
+ if (!make_key_dbt(self, keyobj, &key, NULL))
+@@ -3118,28 +3251,77 @@ DB_has_key(DBObject* self, PyObject* arg
+ return NULL;
+ }
+
++#if (DBVER < 46)
+ /* This causes DB_BUFFER_SMALL to be returned when the db has the key because
+ it has a record but can't allocate a buffer for the data. This saves
+ having to deal with data we won't be using.
+ */
+- CLEAR_DBT(data);
+- data.flags = DB_DBT_USERMEM;
++ {
++ DBT data ;
++ CLEAR_DBT(data);
++ data.flags = DB_DBT_USERMEM;
+
++ MYDB_BEGIN_ALLOW_THREADS;
++ err = self->db->get(self->db, txn, &key, &data, 0);
++ MYDB_END_ALLOW_THREADS;
++ }
++#else
+ MYDB_BEGIN_ALLOW_THREADS;
+- err = self->db->get(self->db, txn, &key, &data, 0);
++ err = self->db->exists(self->db, txn, &key, 0);
+ MYDB_END_ALLOW_THREADS;
++#endif
++
+ FREE_DBT(key);
+
++ /*
++ ** DB_BUFFER_SMALL is only used if we use "get".
++ ** We can drop it when we only use "exists",
++ ** when we drop suport for Berkeley DB < 4.6.
++ */
+ if (err == DB_BUFFER_SMALL || err == 0) {
+- return NUMBER_FromLong(1);
++ Py_INCREF(Py_True);
++ return Py_True;
+ } else if (err == DB_NOTFOUND || err == DB_KEYEMPTY) {
+- return NUMBER_FromLong(0);
++ Py_INCREF(Py_False);
++ return Py_False;
+ }
+
+ makeDBError(err);
+ return NULL;
+ }
+
++static PyObject*
++DB_has_key(DBObject* self, PyObject* args, PyObject* kwargs)
++{
++ PyObject* keyobj;
++ PyObject* txnobj = NULL;
++ static char* kwnames[] = {"key","txn", NULL};
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|O:has_key", kwnames,
++ &keyobj, &txnobj))
++ return NULL;
++
++ return _DB_has_key(self, keyobj, txnobj);
++}
++
++
++static int DB_contains(DBObject* self, PyObject* keyobj)
++{
++ PyObject* result;
++ int result2 = 0;
++
++ result = _DB_has_key(self, keyobj, NULL) ;
++ if (result == NULL) {
++ return -1; /* Propague exception */
++ }
++ if (result != Py_False) {
++ result2 = 1;
++ }
++
++ Py_DECREF(result);
++ return result2;
++}
++
+
+ #define _KEYS_LIST 1
+ #define _VALUES_LIST 2
+@@ -3970,6 +4152,13 @@ DBC_next_nodup(DBCursorObject* self, PyO
+ return _DBCursor_get(self,DB_NEXT_NODUP,args,kwargs,"|iii:next_nodup");
+ }
+
++#if (DBVER >= 46)
++static PyObject*
++DBC_prev_dup(DBCursorObject* self, PyObject* args, PyObject *kwargs)
++{
++ return _DBCursor_get(self,DB_PREV_DUP,args,kwargs,"|iii:prev_dup");
++}
++#endif
+
+ static PyObject*
+ DBC_prev_nodup(DBCursorObject* self, PyObject* args, PyObject *kwargs)
+@@ -4012,6 +4201,44 @@ DBC_join_item(DBCursorObject* self, PyOb
+ }
+
+
++#if (DBVER >= 46)
++static PyObject*
++DBC_set_priority(DBCursorObject* self, PyObject* args, PyObject* kwargs)
++{
++ int err, priority;
++ static char* kwnames[] = { "priority", NULL };
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i:set_priority", kwnames,
++ &priority))
++ return NULL;
++
++ CHECK_CURSOR_NOT_CLOSED(self);
++
++ MYDB_BEGIN_ALLOW_THREADS;
++ err = self->dbc->set_priority(self->dbc, priority);
++ MYDB_END_ALLOW_THREADS;
++ RETURN_IF_ERR();
++ RETURN_NONE();
++}
++
++
++static PyObject*
++DBC_get_priority(DBCursorObject* self)
++{
++ int err;
++ DB_CACHE_PRIORITY priority;
++
++ CHECK_CURSOR_NOT_CLOSED(self);
++
++ MYDB_BEGIN_ALLOW_THREADS;
++ err = self->dbc->get_priority(self->dbc, &priority);
++ MYDB_END_ALLOW_THREADS;
++ RETURN_IF_ERR();
++ return NUMBER_FromLong(priority);
++}
++#endif
++
++
+
+ /* --------------------------------------------------------------------- */
+ /* DBEnv methods */
+@@ -4095,7 +4322,6 @@ DBEnv_remove(DBEnvObject* self, PyObject
+ RETURN_NONE();
+ }
+
+-#if (DBVER >= 41)
+ static PyObject*
+ DBEnv_dbremove(DBEnvObject* self, PyObject* args, PyObject* kwargs)
+ {
+@@ -4152,6 +4378,8 @@ DBEnv_dbrename(DBEnvObject* self, PyObje
+ RETURN_NONE();
+ }
+
++
++
+ static PyObject*
+ DBEnv_set_encrypt(DBEnvObject* self, PyObject* args, PyObject* kwargs)
+ {
+@@ -4172,17 +4400,57 @@ DBEnv_set_encrypt(DBEnvObject* self, PyO
+ RETURN_IF_ERR();
+ RETURN_NONE();
+ }
+-#endif /* DBVER >= 41 */
+
++#if (DBVER >= 42)
+ static PyObject*
+-DBEnv_set_timeout(DBEnvObject* self, PyObject* args, PyObject* kwargs)
++DBEnv_get_encrypt_flags(DBEnvObject* self)
+ {
+ int err;
+- u_int32_t flags=0;
+- u_int32_t timeout = 0;
+- static char* kwnames[] = { "timeout", "flags", NULL };
++ u_int32_t flags;
+
+- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ii:set_timeout", kwnames,
++ CHECK_ENV_NOT_CLOSED(self);
++
++ MYDB_BEGIN_ALLOW_THREADS;
++ err = self->db_env->get_encrypt_flags(self->db_env, &flags);
++ MYDB_END_ALLOW_THREADS;
++
++ RETURN_IF_ERR();
++
++ return NUMBER_FromLong(flags);
++}
++
++static PyObject*
++DBEnv_get_timeout(DBEnvObject* self, PyObject* args, PyObject* kwargs)
++{
++ int err;
++ int flag;
++ u_int32_t timeout;
++ static char* kwnames[] = {"flag", NULL };
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i:get_timeout", kwnames,
++ &flag)) {
++ return NULL;
++ }
++ CHECK_ENV_NOT_CLOSED(self);
++
++ MYDB_BEGIN_ALLOW_THREADS;
++ err = self->db_env->get_timeout(self->db_env, &timeout, flag);
++ MYDB_END_ALLOW_THREADS;
++ RETURN_IF_ERR();
++ return NUMBER_FromLong(timeout);
++}
++#endif
++
++
++static PyObject*
++DBEnv_set_timeout(DBEnvObject* self, PyObject* args, PyObject* kwargs)
++{
++ int err;
++ u_int32_t flags=0;
++ u_int32_t timeout = 0;
++ static char* kwnames[] = { "timeout", "flags", NULL };
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ii:set_timeout", kwnames,
+ &timeout, &flags)) {
+ return NULL;
+ }
+@@ -4210,6 +4478,25 @@ DBEnv_set_shm_key(DBEnvObject* self, PyO
+ RETURN_NONE();
+ }
+
++#if (DBVER >= 42)
++static PyObject*
++DBEnv_get_shm_key(DBEnvObject* self)
++{
++ int err;
++ long shm_key;
++
++ CHECK_ENV_NOT_CLOSED(self);
++
++ MYDB_BEGIN_ALLOW_THREADS;
++ err = self->db_env->get_shm_key(self->db_env, &shm_key);
++ MYDB_END_ALLOW_THREADS;
++
++ RETURN_IF_ERR();
++
++ return NUMBER_FromLong(shm_key);
++}
++#endif
++
+ static PyObject*
+ DBEnv_set_cachesize(DBEnvObject* self, PyObject* args)
+ {
+@@ -4227,6 +4514,26 @@ DBEnv_set_cachesize(DBEnvObject* self, P
+ RETURN_NONE();
+ }
+
++#if (DBVER >= 42)
++static PyObject*
++DBEnv_get_cachesize(DBEnvObject* self)
++{
++ int err;
++ u_int32_t gbytes, bytes;
++ int ncache;
++
++ CHECK_ENV_NOT_CLOSED(self);
++
++ MYDB_BEGIN_ALLOW_THREADS;
++ err = self->db_env->get_cachesize(self->db_env, &gbytes, &bytes,
&ncache);
++ MYDB_END_ALLOW_THREADS;
++
++ RETURN_IF_ERR();
++
++ return Py_BuildValue("(iii)", gbytes, bytes, ncache);
++}
++#endif
++
+
+ static PyObject*
+ DBEnv_set_flags(DBEnvObject* self, PyObject* args)
+@@ -4265,6 +4572,151 @@ DBEnv_log_set_config(DBEnvObject* self,
+ }
+ #endif /* DBVER >= 47 */
+
++#if (DBVER >= 44)
++static PyObject*
++DBEnv_mutex_set_max(DBEnvObject* self, PyObject* args)
++{
++ int err;
++ int value;
++
++ if (!PyArg_ParseTuple(args, "i:mutex_set_max", &value))
++ return NULL;
++
++ CHECK_ENV_NOT_CLOSED(self);
++
++ MYDB_BEGIN_ALLOW_THREADS;
++ err = self->db_env->mutex_set_max(self->db_env, value);
++ MYDB_END_ALLOW_THREADS;
++
++ RETURN_IF_ERR();
++ RETURN_NONE();
++}
++
++static PyObject*
++DBEnv_mutex_get_max(DBEnvObject* self)
++{
++ int err;
++ u_int32_t value;
++
++ CHECK_ENV_NOT_CLOSED(self);
++
++ MYDB_BEGIN_ALLOW_THREADS;
++ err = self->db_env->mutex_get_max(self->db_env, &value);
++ MYDB_END_ALLOW_THREADS;
++
++ RETURN_IF_ERR();
++
++ return NUMBER_FromLong(value);
++}
++
++static PyObject*
++DBEnv_mutex_set_align(DBEnvObject* self, PyObject* args)
++{
++ int err;
++ int align;
++
++ if (!PyArg_ParseTuple(args, "i:mutex_set_align", &align))
++ return NULL;
++
++ CHECK_ENV_NOT_CLOSED(self);
++
++ MYDB_BEGIN_ALLOW_THREADS;
++ err = self->db_env->mutex_set_align(self->db_env, align);
++ MYDB_END_ALLOW_THREADS;
++
++ RETURN_IF_ERR();
++ RETURN_NONE();
++}
++
++static PyObject*
++DBEnv_mutex_get_align(DBEnvObject* self)
++{
++ int err;
++ u_int32_t align;
++
++ CHECK_ENV_NOT_CLOSED(self);
++
++ MYDB_BEGIN_ALLOW_THREADS;
++ err = self->db_env->mutex_get_align(self->db_env, &align);
++ MYDB_END_ALLOW_THREADS;
++
++ RETURN_IF_ERR();
++
++ return NUMBER_FromLong(align);
++}
++
++static PyObject*
++DBEnv_mutex_set_increment(DBEnvObject* self, PyObject* args)
++{
++ int err;
++ int increment;
++
++ if (!PyArg_ParseTuple(args, "i:mutex_set_increment", &increment))
++ return NULL;
++
++ CHECK_ENV_NOT_CLOSED(self);
++
++ MYDB_BEGIN_ALLOW_THREADS;
++ err = self->db_env->mutex_set_increment(self->db_env, increment);
++ MYDB_END_ALLOW_THREADS;
++
++ RETURN_IF_ERR();
++ RETURN_NONE();
++}
++
++static PyObject*
++DBEnv_mutex_get_increment(DBEnvObject* self)
++{
++ int err;
++ u_int32_t increment;
++
++ CHECK_ENV_NOT_CLOSED(self);
++
++ MYDB_BEGIN_ALLOW_THREADS;
++ err = self->db_env->mutex_get_increment(self->db_env, &increment);
++ MYDB_END_ALLOW_THREADS;
++
++ RETURN_IF_ERR();
++
++ return NUMBER_FromLong(increment);
++}
++
++static PyObject*
++DBEnv_mutex_set_tas_spins(DBEnvObject* self, PyObject* args)
++{
++ int err;
++ int tas_spins;
++
++ if (!PyArg_ParseTuple(args, "i:mutex_set_tas_spins", &tas_spins))
++ return NULL;
++
++ CHECK_ENV_NOT_CLOSED(self);
++
++ MYDB_BEGIN_ALLOW_THREADS;
++ err = self->db_env->mutex_set_tas_spins(self->db_env, tas_spins);
++ MYDB_END_ALLOW_THREADS;
++
++ RETURN_IF_ERR();
++ RETURN_NONE();
++}
++
++static PyObject*
++DBEnv_mutex_get_tas_spins(DBEnvObject* self)
++{
++ int err;
++ u_int32_t tas_spins;
++
++ CHECK_ENV_NOT_CLOSED(self);
++
++ MYDB_BEGIN_ALLOW_THREADS;
++ err = self->db_env->mutex_get_tas_spins(self->db_env, &tas_spins);
++ MYDB_END_ALLOW_THREADS;
++
++ RETURN_IF_ERR();
++
++ return NUMBER_FromLong(tas_spins);
++}
++#endif
+
+ static PyObject*
+ DBEnv_set_data_dir(DBEnvObject* self, PyObject* args)
+@@ -4283,6 +4735,47 @@ DBEnv_set_data_dir(DBEnvObject* self, Py
+ RETURN_NONE();
+ }
+
++#if (DBVER >= 42)
++static PyObject*
++DBEnv_get_data_dirs(DBEnvObject* self)
++{
++ int err;
++ PyObject *tuple;
++ PyObject *item;
++ const char **dirpp;
++ int size, i;
++
++ CHECK_ENV_NOT_CLOSED(self);
++
++ MYDB_BEGIN_ALLOW_THREADS;
++ err = self->db_env->get_data_dirs(self->db_env, &dirpp);
++ MYDB_END_ALLOW_THREADS;
++
++ RETURN_IF_ERR();
++
++ /*
++ ** Calculate size. Python C API
++ ** actually allows for tuple resizing,
++ ** but this is simple enough.
++ */
++ for (size=0; *(dirpp+size) ; size++);
++
++ tuple = PyTuple_New(size);
++ if (!tuple)
++ return NULL;
++
++ for (i=0; i<size; i++) {
++ item = PyBytes_FromString (*(dirpp+i));
++ if (item == NULL) {
++ Py_DECREF(tuple);
++ tuple = NULL;
++ break;
++ }
++ PyTuple_SET_ITEM(tuple, i, item);
++ }
++ return tuple;
++}
++#endif
+
+ static PyObject*
+ DBEnv_set_lg_bsize(DBEnvObject* self, PyObject* args)
+@@ -4501,7 +4994,11 @@ DBEnv_txn_recover(DBEnvObject* self)
+ DBTxnObject *txn;
+ #define PREPLIST_LEN 16
+ DB_PREPLIST preplist[PREPLIST_LEN];
++#if (DBVER < 48)
+ long retp;
++#else
++ u_int32_t retp;
++#endif
+
+ CHECK_ENV_NOT_CLOSED(self);
+
+@@ -4522,12 +5019,12 @@ DBEnv_txn_recover(DBEnvObject* self)
+ flags=DB_NEXT; /* Prepare for next loop pass */
+ for (i=0; i<retp; i++) {
+ gid=PyBytes_FromStringAndSize((char *)(preplist[i].gid),
+- DB_XIDDATASIZE);
++ DB_GID_SIZE);
+ if (!gid) {
+ Py_DECREF(list);
+ return NULL;
+ }
+- txn=newDBTxnObject(self, NULL, preplist[i].txn, flags);
++ txn=newDBTxnObject(self, NULL, preplist[i].txn, 0);
+ if (!txn) {
+ Py_DECREF(list);
+ Py_DECREF(gid);
+@@ -4602,6 +5099,24 @@ DBEnv_txn_checkpoint(DBEnvObject* self,
+ }
+
+
++#if (DBVER >= 42)
++static PyObject*
++DBEnv_get_tx_max(DBEnvObject* self)
++{
++ int err;
++ u_int32_t max;
++
++ CHECK_ENV_NOT_CLOSED(self);
++
++ MYDB_BEGIN_ALLOW_THREADS;
++ err = self->db_env->get_tx_max(self->db_env, &max);
++ MYDB_END_ALLOW_THREADS;
++ RETURN_IF_ERR();
++ return PyLong_FromUnsignedLong(max);
++}
++#endif
++
++
+ static PyObject*
+ DBEnv_set_tx_max(DBEnvObject* self, PyObject* args)
+ {
+@@ -4611,12 +5126,31 @@ DBEnv_set_tx_max(DBEnvObject* self, PyOb
+ return NULL;
+ CHECK_ENV_NOT_CLOSED(self);
+
++ MYDB_BEGIN_ALLOW_THREADS;
+ err = self->db_env->set_tx_max(self->db_env, max);
++ MYDB_END_ALLOW_THREADS;
+ RETURN_IF_ERR();
+ RETURN_NONE();
+ }
+
+
++#if (DBVER >= 42)
++static PyObject*
++DBEnv_get_tx_timestamp(DBEnvObject* self)
++{
++ int err;
++ time_t timestamp;
++
++ CHECK_ENV_NOT_CLOSED(self);
++
++ MYDB_BEGIN_ALLOW_THREADS;
++ err = self->db_env->get_tx_timestamp(self->db_env, ×tamp);
++ MYDB_END_ALLOW_THREADS;
++ RETURN_IF_ERR();
++ return NUMBER_FromLong(timestamp);
++}
++#endif
++
+ static PyObject*
+ DBEnv_set_tx_timestamp(DBEnvObject* self, PyObject* args)
+ {
+@@ -4628,7 +5162,9 @@ DBEnv_set_tx_timestamp(DBEnvObject* self
+ return NULL;
+ CHECK_ENV_NOT_CLOSED(self);
+ timestamp = (time_t)stamp;
++ MYDB_BEGIN_ALLOW_THREADS;
+ err = self->db_env->set_tx_timestamp(self->db_env, ×tamp);
++ MYDB_END_ALLOW_THREADS;
+ RETURN_IF_ERR();
+ RETURN_NONE();
+ }
+@@ -4722,6 +5258,26 @@ DBEnv_lock_put(DBEnvObject* self, PyObje
+
+ #if (DBVER >= 44)
+ static PyObject*
++DBEnv_fileid_reset(DBEnvObject* self, PyObject* args, PyObject* kwargs)
++{
++ int err;
++ char *file;
++ u_int32_t flags = 0;
++ static char* kwnames[] = { "file", "flags", NULL};
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "z|i:fileid_reset",
kwnames,
++ &file, &flags))
++ return NULL;
++ CHECK_ENV_NOT_CLOSED(self);
++
++ MYDB_BEGIN_ALLOW_THREADS;
++ err = self->db_env->fileid_reset(self->db_env, file, flags);
++ MYDB_END_ALLOW_THREADS;
++ RETURN_IF_ERR();
++ RETURN_NONE();
++}
++
++static PyObject*
+ DBEnv_lsn_reset(DBEnvObject* self, PyObject* args, PyObject* kwargs)
+ {
+ int err;
+@@ -4777,9 +5333,6 @@ DBEnv_log_stat(DBEnvObject* self, PyObje
+ MAKE_ENTRY(lg_size);
+ MAKE_ENTRY(record);
+ #endif
+-#if (DBVER < 41)
+- MAKE_ENTRY(lg_max);
+-#endif
+ MAKE_ENTRY(w_mbytes);
+ MAKE_ENTRY(w_bytes);
+ MAKE_ENTRY(wc_mbytes);
+@@ -4832,13 +5385,8 @@ DBEnv_lock_stat(DBEnvObject* self, PyObj
+
+ #define MAKE_ENTRY(name) _addIntToDict(d, #name, sp->st_##name)
+
+-#if (DBVER < 41)
+- MAKE_ENTRY(lastid);
+-#endif
+-#if (DBVER >=41)
+ MAKE_ENTRY(id);
+ MAKE_ENTRY(cur_maxid);
+-#endif
+ MAKE_ENTRY(nmodes);
+ MAKE_ENTRY(maxlocks);
+ MAKE_ENTRY(maxlockers);
+@@ -4863,10 +5411,8 @@ DBEnv_lock_stat(DBEnvObject* self, PyObj
+ MAKE_ENTRY(lock_wait);
+ #endif
+ MAKE_ENTRY(ndeadlocks);
+-#if (DBVER >= 41)
+ MAKE_ENTRY(locktimeout);
+ MAKE_ENTRY(txntimeout);
+-#endif
+ MAKE_ENTRY(nlocktimeouts);
+ MAKE_ENTRY(ntxntimeouts);
+ #if (DBVER >= 46)
+@@ -4955,6 +5501,31 @@ DBEnv_log_archive(DBEnvObject* self, PyO
+ }
+
+
++#if (DBVER >= 43)
++static PyObject*
++DBEnv_txn_stat_print(DBEnvObject* self, PyObject* args, PyObject *kwargs)
++{
++ int err;
++ int flags=0;
++ static char* kwnames[] = { "flags", NULL };
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|i:stat_print",
++ kwnames, &flags))
++ {
++ return NULL;
++ }
++
++ CHECK_ENV_NOT_CLOSED(self);
++
++ MYDB_BEGIN_ALLOW_THREADS;
++ err = self->db_env->txn_stat_print(self->db_env, flags);
++ MYDB_END_ALLOW_THREADS;
++ RETURN_IF_ERR();
++ RETURN_NONE();
++}
++#endif
++
++
+ static PyObject*
+ DBEnv_txn_stat(DBEnvObject* self, PyObject* args)
+ {
+@@ -5047,6 +5618,7 @@ DBEnv_set_private(DBEnvObject* self, PyO
+ }
+
+
++#if (DBVER < 48)
+ static PyObject*
+ DBEnv_set_rpc_server(DBEnvObject* self, PyObject* args, PyObject* kwargs)
+ {
+@@ -5068,6 +5640,7 @@ DBEnv_set_rpc_server(DBEnvObject* self,
+ RETURN_IF_ERR();
+ RETURN_NONE();
+ }
++#endif
+
+ static PyObject*
+ DBEnv_set_verbose(DBEnvObject* self, PyObject* args)
+@@ -5551,79 +6124,248 @@ DBEnv_rep_get_nsites(DBEnvObject* self)
+ err = self->db_env->rep_get_nsites(self->db_env, &nsites);
+ MYDB_END_ALLOW_THREADS;
+ RETURN_IF_ERR();
+- return NUMBER_FromLong(nsites);
++ return NUMBER_FromLong(nsites);
++}
++
++static PyObject*
++DBEnv_rep_set_priority(DBEnvObject* self, PyObject* args)
++{
++ int err;
++ int priority;
++
++ if (!PyArg_ParseTuple(args, "i:rep_set_priority", &priority)) {
++ return NULL;
++ }
++ CHECK_ENV_NOT_CLOSED(self);
++ MYDB_BEGIN_ALLOW_THREADS;
++ err = self->db_env->rep_set_priority(self->db_env, priority);
++ MYDB_END_ALLOW_THREADS;
++ RETURN_IF_ERR();
++ RETURN_NONE();
++}
++
++static PyObject*
++DBEnv_rep_get_priority(DBEnvObject* self)
++{
++ int err;
++#if (DBVER >= 47)
++ u_int32_t priority;
++#else
++ int priority;
++#endif
++
++ CHECK_ENV_NOT_CLOSED(self);
++ MYDB_BEGIN_ALLOW_THREADS;
++ err = self->db_env->rep_get_priority(self->db_env, &priority);
++ MYDB_END_ALLOW_THREADS;
++ RETURN_IF_ERR();
++ return NUMBER_FromLong(priority);
++}
++
++static PyObject*
++DBEnv_rep_set_timeout(DBEnvObject* self, PyObject* args)
++{
++ int err;
++ int which, timeout;
++
++ if (!PyArg_ParseTuple(args, "ii:rep_set_timeout", &which,
&timeout)) {
++ return NULL;
++ }
++ CHECK_ENV_NOT_CLOSED(self);
++ MYDB_BEGIN_ALLOW_THREADS;
++ err = self->db_env->rep_set_timeout(self->db_env, which, timeout);
++ MYDB_END_ALLOW_THREADS;
++ RETURN_IF_ERR();
++ RETURN_NONE();
++}
++
++static PyObject*
++DBEnv_rep_get_timeout(DBEnvObject* self, PyObject* args)
++{
++ int err;
++ int which;
++ u_int32_t timeout;
++
++ if (!PyArg_ParseTuple(args, "i:rep_get_timeout", &which)) {
++ return NULL;
++ }
++ CHECK_ENV_NOT_CLOSED(self);
++ MYDB_BEGIN_ALLOW_THREADS;
++ err = self->db_env->rep_get_timeout(self->db_env, which, &timeout);
++ MYDB_END_ALLOW_THREADS;
++ RETURN_IF_ERR();
++ return NUMBER_FromLong(timeout);
+ }
++#endif
++
+
++#if (DBVER >= 47)
+ static PyObject*
+-DBEnv_rep_set_priority(DBEnvObject* self, PyObject* args)
++DBEnv_rep_set_clockskew(DBEnvObject* self, PyObject* args)
+ {
+ int err;
+- int priority;
++ unsigned int fast, slow;
+
+- if (!PyArg_ParseTuple(args, "i:rep_set_priority", &priority)) {
++#if (PY_VERSION_HEX >= 0x02040000)
++ if (!PyArg_ParseTuple(args,"II:rep_set_clockskew", &fast, &slow))
+ return NULL;
+- }
++#else
++ if (!PyArg_ParseTuple(args,"ii:rep_set_clockskew", &fast, &slow))
++ return NULL;
++#endif
++
+ CHECK_ENV_NOT_CLOSED(self);
++
+ MYDB_BEGIN_ALLOW_THREADS;
+- err = self->db_env->rep_set_priority(self->db_env, priority);
++ err = self->db_env->rep_set_clockskew(self->db_env, fast, slow);
+ MYDB_END_ALLOW_THREADS;
+ RETURN_IF_ERR();
+ RETURN_NONE();
+ }
+
+ static PyObject*
+-DBEnv_rep_get_priority(DBEnvObject* self)
++DBEnv_rep_get_clockskew(DBEnvObject* self)
+ {
+ int err;
+-#if (DBVER >= 47)
+- u_int32_t priority;
+-#else
+- int priority;
+-#endif
++ unsigned int fast, slow;
+
+ CHECK_ENV_NOT_CLOSED(self);
+ MYDB_BEGIN_ALLOW_THREADS;
+- err = self->db_env->rep_get_priority(self->db_env, &priority);
++ err = self->db_env->rep_get_clockskew(self->db_env, &fast, &slow);
+ MYDB_END_ALLOW_THREADS;
+ RETURN_IF_ERR();
+- return NUMBER_FromLong(priority);
++#if (PY_VERSION_HEX >= 0x02040000)
++ return Py_BuildValue("(II)", fast, slow);
++#else
++ return Py_BuildValue("(ii)", fast, slow);
++#endif
+ }
++#endif
+
++#if (DBVER >= 43)
+ static PyObject*
+-DBEnv_rep_set_timeout(DBEnvObject* self, PyObject* args)
++DBEnv_rep_stat_print(DBEnvObject* self, PyObject* args, PyObject *kwargs)
+ {
+ int err;
+- int which, timeout;
++ int flags=0;
++ static char* kwnames[] = { "flags", NULL };
+
+- if (!PyArg_ParseTuple(args, "ii:rep_set_timeout", &which,
&timeout)) {
++ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|i:rep_stat_print",
++ kwnames, &flags))
++ {
+ return NULL;
+ }
+ CHECK_ENV_NOT_CLOSED(self);
+ MYDB_BEGIN_ALLOW_THREADS;
+- err = self->db_env->rep_set_timeout(self->db_env, which, timeout);
++ err = self->db_env->rep_stat_print(self->db_env, flags);
+ MYDB_END_ALLOW_THREADS;
+ RETURN_IF_ERR();
+ RETURN_NONE();
+ }
++#endif
+
+ static PyObject*
+-DBEnv_rep_get_timeout(DBEnvObject* self, PyObject* args)
++DBEnv_rep_stat(DBEnvObject* self, PyObject* args, PyObject *kwargs)
+ {
+ int err;
+- int which;
+- u_int32_t timeout;
++ int flags=0;
++ DB_REP_STAT *statp;
++ PyObject *stats;
++ static char* kwnames[] = { "flags", NULL };
+
+- if (!PyArg_ParseTuple(args, "i:rep_get_timeout", &which)) {
++ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|i:rep_stat",
++ kwnames, &flags))
++ {
+ return NULL;
+ }
+ CHECK_ENV_NOT_CLOSED(self);
+ MYDB_BEGIN_ALLOW_THREADS;
+- err = self->db_env->rep_get_timeout(self->db_env, which, &timeout);
++ err = self->db_env->rep_stat(self->db_env, &statp, flags);
+ MYDB_END_ALLOW_THREADS;
+ RETURN_IF_ERR();
+- return NUMBER_FromLong(timeout);
+-}
++
++ stats=PyDict_New();
++ if (stats == NULL) {
++ free(statp);
++ return NULL;
++ }
++
++#define MAKE_ENTRY(name) _addIntToDict(stats, #name, statp->st_##name)
++#define MAKE_DB_LSN_ENTRY(name) _addDB_lsnToDict(stats , #name, statp->st_##name)
++
++#if (DBVER >= 44)
++ MAKE_ENTRY(bulk_fills);
++ MAKE_ENTRY(bulk_overflows);
++ MAKE_ENTRY(bulk_records);
++ MAKE_ENTRY(bulk_transfers);
++ MAKE_ENTRY(client_rerequests);
++ MAKE_ENTRY(client_svc_miss);
++ MAKE_ENTRY(client_svc_req);
++#endif
++ MAKE_ENTRY(dupmasters);
++#if (DBVER >= 43)
++ MAKE_ENTRY(egen);
++ MAKE_ENTRY(election_nvotes);
++ MAKE_ENTRY(startup_complete);
++ MAKE_ENTRY(pg_duplicated);
++ MAKE_ENTRY(pg_records);
++ MAKE_ENTRY(pg_requested);
++ MAKE_ENTRY(next_pg);
++ MAKE_ENTRY(waiting_pg);
++#endif
++ MAKE_ENTRY(election_cur_winner);
++ MAKE_ENTRY(election_gen);
++ MAKE_DB_LSN_ENTRY(election_lsn);
++ MAKE_ENTRY(election_nsites);
++ MAKE_ENTRY(election_priority);
++#if (DBVER >= 44)
++ MAKE_ENTRY(election_sec);
++ MAKE_ENTRY(election_usec);
++#endif
++ MAKE_ENTRY(election_status);
++ MAKE_ENTRY(election_tiebreaker);
++ MAKE_ENTRY(election_votes);
++ MAKE_ENTRY(elections);
++ MAKE_ENTRY(elections_won);
++ MAKE_ENTRY(env_id);
++ MAKE_ENTRY(env_priority);
++ MAKE_ENTRY(gen);
++ MAKE_ENTRY(log_duplicated);
++ MAKE_ENTRY(log_queued);
++ MAKE_ENTRY(log_queued_max);
++ MAKE_ENTRY(log_queued_total);
++ MAKE_ENTRY(log_records);
++ MAKE_ENTRY(log_requested);
++ MAKE_ENTRY(master);
++ MAKE_ENTRY(master_changes);
++#if (DBVER >= 47)
++ MAKE_ENTRY(max_lease_sec);
++ MAKE_ENTRY(max_lease_usec);
++ MAKE_DB_LSN_ENTRY(max_perm_lsn);
++#endif
++ MAKE_ENTRY(msgs_badgen);
++ MAKE_ENTRY(msgs_processed);
++ MAKE_ENTRY(msgs_recover);
++ MAKE_ENTRY(msgs_send_failures);
++ MAKE_ENTRY(msgs_sent);
++ MAKE_ENTRY(newsites);
++ MAKE_DB_LSN_ENTRY(next_lsn);
++ MAKE_ENTRY(nsites);
++ MAKE_ENTRY(nthrottles);
++ MAKE_ENTRY(outdated);
++#if (DBVER >= 46)
++ MAKE_ENTRY(startsync_delayed);
+ #endif
++ MAKE_ENTRY(status);
++ MAKE_ENTRY(txns_applied);
++ MAKE_DB_LSN_ENTRY(waiting_lsn);
++
++#undef MAKE_DB_LSN_ENTRY
++#undef MAKE_ENTRY
++
++ free(statp);
++ return stats;
++}
+
+ /* --------------------------------------------------------------------- */
+ /* REPLICATION METHODS: Replication Manager */
+@@ -5947,9 +6689,9 @@ DBTxn_prepare(DBTxnObject* self, PyObjec
+ if (!PyArg_ParseTuple(args, "s#:prepare", &gid, &gid_size))
+ return NULL;
+
+- if (gid_size != DB_XIDDATASIZE) {
++ if (gid_size != DB_GID_SIZE) {
+ PyErr_SetString(PyExc_TypeError,
+- "gid must be DB_XIDDATASIZE bytes long");
++ "gid must be DB_GID_SIZE bytes long");
+ return NULL;
+ }
+
+@@ -6064,6 +6806,76 @@ DBTxn_id(DBTxnObject* self)
+ return NUMBER_FromLong(id);
+ }
+
++
++static PyObject*
++DBTxn_set_timeout(DBTxnObject* self, PyObject* args, PyObject* kwargs)
++{
++ int err;
++ u_int32_t flags=0;
++ u_int32_t timeout = 0;
++ static char* kwnames[] = { "timeout", "flags", NULL };
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ii:set_timeout", kwnames,
++ &timeout, &flags)) {
++ return NULL;
++ }
++
++ MYDB_BEGIN_ALLOW_THREADS;
++ err = self->txn->set_timeout(self->txn, (db_timeout_t)timeout, flags);
++ MYDB_END_ALLOW_THREADS;
++
++ RETURN_IF_ERR();
++ RETURN_NONE();
++}
++
++
++#if (DBVER >= 44)
++static PyObject*
++DBTxn_set_name(DBTxnObject* self, PyObject* args)
++{
++ int err;
++ const char *name;
++
++ if (!PyArg_ParseTuple(args, "s:set_name", &name))
++ return NULL;
++
++ MYDB_BEGIN_ALLOW_THREADS;
++ err = self->txn->set_name(self->txn, name);
++ MYDB_END_ALLOW_THREADS;
++
++ RETURN_IF_ERR();
++ RETURN_NONE();
++}
++#endif
++
++
++#if (DBVER >= 44)
++static PyObject*
++DBTxn_get_name(DBTxnObject* self)
++{
++ int err;
++ const char *name;
++
++ MYDB_BEGIN_ALLOW_THREADS;
++ err = self->txn->get_name(self->txn, &name);
++ MYDB_END_ALLOW_THREADS;
++
++ RETURN_IF_ERR();
++#if (PY_VERSION_HEX < 0x03000000)
++ if (!name) {
++ return PyString_FromString("");
++ }
++ return PyString_FromString(name);
++#else
++ if (!name) {
++ return PyUnicode_FromString("");
++ }
++ return PyUnicode_FromString(name);
++#endif
++}
++#endif
++
++
+ #if (DBVER >= 43)
+ /* --------------------------------------------------------------------- */
+ /* DBSequence methods */
+@@ -6167,12 +6979,12 @@ DBSequence_get_key(DBSequenceObject* sel
+ }
+
+ static PyObject*
+-DBSequence_init_value(DBSequenceObject* self, PyObject* args)
++DBSequence_initial_value(DBSequenceObject* self, PyObject* args)
+ {
+ int err;
+ PY_LONG_LONG value;
+ db_seq_t value2;
+- if (!PyArg_ParseTuple(args,"L:init_value", &value))
++ if (!PyArg_ParseTuple(args,"L:initial_value", &value))
+ return NULL;
+ CHECK_SEQUENCE_NOT_CLOSED(self)
+
+@@ -6350,6 +7162,29 @@ DBSequence_get_range(DBSequenceObject* s
+ return Py_BuildValue("(LL)", min, max);
+ }
+
++
++static PyObject*
++DBSequence_stat_print(DBSequenceObject* self, PyObject* args, PyObject *kwargs)
++{
++ int err;
++ int flags=0;
++ static char* kwnames[] = { "flags", NULL };
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|i:stat_print",
++ kwnames, &flags))
++ {
++ return NULL;
++ }
++
++ CHECK_SEQUENCE_NOT_CLOSED(self);
++
++ MYDB_BEGIN_ALLOW_THREADS;
++ err = self->sequence->stat_print(self->sequence, flags);
++ MYDB_END_ALLOW_THREADS;
++ RETURN_IF_ERR();
++ RETURN_NONE();
++}
++
+ static PyObject*
+ DBSequence_stat(DBSequenceObject* self, PyObject* args, PyObject* kwargs)
+ {
+@@ -6401,11 +7236,18 @@ static PyMethodDef DB_methods[] = {
+ {"append", (PyCFunction)DB_append,
METH_VARARGS|METH_KEYWORDS},
+ {"associate", (PyCFunction)DB_associate,
METH_VARARGS|METH_KEYWORDS},
+ {"close", (PyCFunction)DB_close, METH_VARARGS},
++#if (DBVER >= 47)
++ {"compact", (PyCFunction)DB_compact,
METH_VARARGS|METH_KEYWORDS},
++#endif
+ {"consume", (PyCFunction)DB_consume,
METH_VARARGS|METH_KEYWORDS},
+ {"consume_wait", (PyCFunction)DB_consume_wait,
METH_VARARGS|METH_KEYWORDS},
+ {"cursor", (PyCFunction)DB_cursor,
METH_VARARGS|METH_KEYWORDS},
+ {"delete", (PyCFunction)DB_delete,
METH_VARARGS|METH_KEYWORDS},
+ {"fd", (PyCFunction)DB_fd, METH_NOARGS},
++#if (DBVER >= 46)
++ {"exists", (PyCFunction)DB_exists,
++ METH_VARARGS|METH_KEYWORDS},
++#endif
+ {"get", (PyCFunction)DB_get,
METH_VARARGS|METH_KEYWORDS},
+ {"pget", (PyCFunction)DB_pget,
METH_VARARGS|METH_KEYWORDS},
+ {"get_both", (PyCFunction)DB_get_both,
METH_VARARGS|METH_KEYWORDS},
+@@ -6424,9 +7266,14 @@ static PyMethodDef DB_methods[] = {
+ {"set_bt_minkey", (PyCFunction)DB_set_bt_minkey, METH_VARARGS},
+ {"set_bt_compare", (PyCFunction)DB_set_bt_compare, METH_O},
+ {"set_cachesize", (PyCFunction)DB_set_cachesize, METH_VARARGS},
+-#if (DBVER >= 41)
++#if (DBVER >= 42)
++ {"get_cachesize", (PyCFunction)DB_get_cachesize, METH_NOARGS},
++#endif
+ {"set_encrypt", (PyCFunction)DB_set_encrypt,
METH_VARARGS|METH_KEYWORDS},
++#if (DBVER >= 42)
++ {"get_encrypt_flags", (PyCFunction)DB_get_encrypt_flags, METH_NOARGS},
+ #endif
++
+ {"set_flags", (PyCFunction)DB_set_flags, METH_VARARGS},
+ {"set_h_ffactor", (PyCFunction)DB_set_h_ffactor, METH_VARARGS},
+ {"set_h_nelem", (PyCFunction)DB_set_h_nelem, METH_VARARGS},
+@@ -6451,6 +7298,20 @@ static PyMethodDef DB_methods[] = {
+ };
+
+
++/* We need this to support __contains__() */
++static PySequenceMethods DB_sequence = {
++ 0, /* sq_length, mapping wins here */
++ 0, /* sq_concat */
++ 0, /* sq_repeat */
++ 0, /* sq_item */
++ 0, /* sq_slice */
++ 0, /* sq_ass_item */
++ 0, /* sq_ass_slice */
++ (objobjproc)DB_contains, /* sq_contains */
++ 0, /* sq_inplace_concat */
++ 0, /* sq_inplace_repeat */
++};
++
+ static PyMappingMethods DB_mapping = {
+ DB_length, /*mp_length*/
+ (binaryfunc)DB_subscript, /*mp_subscript*/
+@@ -6481,8 +7342,17 @@ static PyMethodDef DBCursor_methods[] =
+ {"consume", (PyCFunction)DBC_consume,
METH_VARARGS|METH_KEYWORDS},
+ {"next_dup", (PyCFunction)DBC_next_dup,
METH_VARARGS|METH_KEYWORDS},
+ {"next_nodup", (PyCFunction)DBC_next_nodup,
METH_VARARGS|METH_KEYWORDS},
++#if (DBVER >= 46)
++ {"prev_dup", (PyCFunction)DBC_prev_dup,
++ METH_VARARGS|METH_KEYWORDS},
++#endif
+ {"prev_nodup", (PyCFunction)DBC_prev_nodup,
METH_VARARGS|METH_KEYWORDS},
+ {"join_item", (PyCFunction)DBC_join_item, METH_VARARGS},
++#if (DBVER >= 46)
++ {"set_priority", (PyCFunction)DBC_set_priority,
++ METH_VARARGS|METH_KEYWORDS},
++ {"get_priority", (PyCFunction)DBC_get_priority, METH_NOARGS},
++#endif
+ {NULL, NULL} /* sentinel */
+ };
+
+@@ -6491,57 +7361,94 @@ static PyMethodDef DBEnv_methods[] = {
+ {"close", (PyCFunction)DBEnv_close, METH_VARARGS},
+ {"open", (PyCFunction)DBEnv_open, METH_VARARGS},
+ {"remove", (PyCFunction)DBEnv_remove, METH_VARARGS},
+-#if (DBVER >= 41)
+ {"dbremove", (PyCFunction)DBEnv_dbremove,
METH_VARARGS|METH_KEYWORDS},
+ {"dbrename", (PyCFunction)DBEnv_dbrename,
METH_VARARGS|METH_KEYWORDS},
+ {"set_encrypt", (PyCFunction)DBEnv_set_encrypt,
METH_VARARGS|METH_KEYWORDS},
++#if (DBVER >= 42)
++ {"get_encrypt_flags", (PyCFunction)DBEnv_get_encrypt_flags, METH_NOARGS},
++ {"get_timeout", (PyCFunction)DBEnv_get_timeout,
++ METH_VARARGS|METH_KEYWORDS},
++#endif
++ {"set_timeout", (PyCFunction)DBEnv_set_timeout,
METH_VARARGS|METH_KEYWORDS},
++ {"set_shm_key", (PyCFunction)DBEnv_set_shm_key, METH_VARARGS},
++#if (DBVER >= 42)
++ {"get_shm_key", (PyCFunction)DBEnv_get_shm_key, METH_NOARGS},
++#endif
++ {"set_cachesize", (PyCFunction)DBEnv_set_cachesize, METH_VARARGS},
++#if (DBVER >= 42)
++ {"get_cachesize", (PyCFunction)DBEnv_get_cachesize, METH_NOARGS},
++#endif
++#if (DBVER >= 44)
++ {"mutex_set_max", (PyCFunction)DBEnv_mutex_set_max, METH_VARARGS},
++ {"mutex_get_max", (PyCFunction)DBEnv_mutex_get_max, METH_NOARGS},
++ {"mutex_set_align", (PyCFunction)DBEnv_mutex_set_align, METH_VARARGS},
++ {"mutex_get_align", (PyCFunction)DBEnv_mutex_get_align, METH_NOARGS},
++ {"mutex_set_increment", (PyCFunction)DBEnv_mutex_set_increment,
++ METH_VARARGS},
++ {"mutex_get_increment", (PyCFunction)DBEnv_mutex_get_increment,
++ METH_NOARGS},
++ {"mutex_set_tas_spins", (PyCFunction)DBEnv_mutex_set_tas_spins,
++ METH_VARARGS},
++ {"mutex_get_tas_spins", (PyCFunction)DBEnv_mutex_get_tas_spins,
++ METH_NOARGS},
++#endif
++ {"set_data_dir", (PyCFunction)DBEnv_set_data_dir, METH_VARARGS},
++#if (DBVER >= 42)
++ {"get_data_dirs", (PyCFunction)DBEnv_get_data_dirs, METH_NOARGS},
+ #endif
+- {"set_timeout", (PyCFunction)DBEnv_set_timeout,
METH_VARARGS|METH_KEYWORDS},
+- {"set_shm_key", (PyCFunction)DBEnv_set_shm_key, METH_VARARGS},
+- {"set_cachesize", (PyCFunction)DBEnv_set_cachesize, METH_VARARGS},
+- {"set_data_dir", (PyCFunction)DBEnv_set_data_dir, METH_VARARGS},
+- {"set_flags", (PyCFunction)DBEnv_set_flags, METH_VARARGS},
++ {"set_flags", (PyCFunction)DBEnv_set_flags, METH_VARARGS},
+ #if (DBVER >= 47)
+- {"log_set_config", (PyCFunction)DBEnv_log_set_config, METH_VARARGS},
++ {"log_set_config", (PyCFunction)DBEnv_log_set_config, METH_VARARGS},
+ #endif
+- {"set_lg_bsize", (PyCFunction)DBEnv_set_lg_bsize, METH_VARARGS},
+- {"set_lg_dir", (PyCFunction)DBEnv_set_lg_dir, METH_VARARGS},
+- {"set_lg_max", (PyCFunction)DBEnv_set_lg_max, METH_VARARGS},
++ {"set_lg_bsize", (PyCFunction)DBEnv_set_lg_bsize, METH_VARARGS},
++ {"set_lg_dir", (PyCFunction)DBEnv_set_lg_dir, METH_VARARGS},
++ {"set_lg_max", (PyCFunction)DBEnv_set_lg_max, METH_VARARGS},
+ #if (DBVER >= 42)
+- {"get_lg_max", (PyCFunction)DBEnv_get_lg_max, METH_NOARGS},
++ {"get_lg_max", (PyCFunction)DBEnv_get_lg_max, METH_NOARGS},
+ #endif
+ {"set_lg_regionmax",(PyCFunction)DBEnv_set_lg_regionmax, METH_VARARGS},
+- {"set_lk_detect", (PyCFunction)DBEnv_set_lk_detect, METH_VARARGS},
++ {"set_lk_detect", (PyCFunction)DBEnv_set_lk_detect, METH_VARARGS},
+ #if (DBVER < 45)
+- {"set_lk_max", (PyCFunction)DBEnv_set_lk_max, METH_VARARGS},
++ {"set_lk_max", (PyCFunction)DBEnv_set_lk_max, METH_VARARGS},
+ #endif
+ {"set_lk_max_locks", (PyCFunction)DBEnv_set_lk_max_locks, METH_VARARGS},
+ {"set_lk_max_lockers", (PyCFunction)DBEnv_set_lk_max_lockers,
METH_VARARGS},
+ {"set_lk_max_objects", (PyCFunction)DBEnv_set_lk_max_objects,
METH_VARARGS},
+- {"set_mp_mmapsize", (PyCFunction)DBEnv_set_mp_mmapsize, METH_VARARGS},
+- {"set_tmp_dir", (PyCFunction)DBEnv_set_tmp_dir, METH_VARARGS},
+- {"txn_begin", (PyCFunction)DBEnv_txn_begin,
METH_VARARGS|METH_KEYWORDS},
+- {"txn_checkpoint", (PyCFunction)DBEnv_txn_checkpoint, METH_VARARGS},
+- {"txn_stat", (PyCFunction)DBEnv_txn_stat, METH_VARARGS},
+- {"set_tx_max", (PyCFunction)DBEnv_set_tx_max, METH_VARARGS},
++ {"set_mp_mmapsize", (PyCFunction)DBEnv_set_mp_mmapsize, METH_VARARGS},
++ {"set_tmp_dir", (PyCFunction)DBEnv_set_tmp_dir, METH_VARARGS},
++ {"txn_begin", (PyCFunction)DBEnv_txn_begin,
METH_VARARGS|METH_KEYWORDS},
++ {"txn_checkpoint", (PyCFunction)DBEnv_txn_checkpoint, METH_VARARGS},
++ {"txn_stat", (PyCFunction)DBEnv_txn_stat, METH_VARARGS},
++#if (DBVER >= 43)
++ {"txn_stat_print", (PyCFunction)DBEnv_txn_stat_print,
++ METH_VARARGS|METH_KEYWORDS},
++#endif
++#if (DBVER >= 42)
++ {"get_tx_max", (PyCFunction)DBEnv_get_tx_max, METH_NOARGS},
++ {"get_tx_timestamp", (PyCFunction)DBEnv_get_tx_timestamp, METH_NOARGS},
++#endif
++ {"set_tx_max", (PyCFunction)DBEnv_set_tx_max, METH_VARARGS},
+ {"set_tx_timestamp", (PyCFunction)DBEnv_set_tx_timestamp, METH_VARARGS},
+- {"lock_detect", (PyCFunction)DBEnv_lock_detect, METH_VARARGS},
+- {"lock_get", (PyCFunction)DBEnv_lock_get, METH_VARARGS},
+- {"lock_id", (PyCFunction)DBEnv_lock_id, METH_NOARGS},
+- {"lock_id_free", (PyCFunction)DBEnv_lock_id_free, METH_VARARGS},
+- {"lock_put", (PyCFunction)DBEnv_lock_put, METH_VARARGS},
+- {"lock_stat", (PyCFunction)DBEnv_lock_stat, METH_VARARGS},
+- {"log_archive", (PyCFunction)DBEnv_log_archive, METH_VARARGS},
+- {"log_flush", (PyCFunction)DBEnv_log_flush, METH_NOARGS},
+- {"log_stat", (PyCFunction)DBEnv_log_stat, METH_VARARGS},
++ {"lock_detect", (PyCFunction)DBEnv_lock_detect, METH_VARARGS},
++ {"lock_get", (PyCFunction)DBEnv_lock_get, METH_VARARGS},
++ {"lock_id", (PyCFunction)DBEnv_lock_id, METH_NOARGS},
++ {"lock_id_free", (PyCFunction)DBEnv_lock_id_free, METH_VARARGS},
++ {"lock_put", (PyCFunction)DBEnv_lock_put, METH_VARARGS},
++ {"lock_stat", (PyCFunction)DBEnv_lock_stat, METH_VARARGS},
++ {"log_archive", (PyCFunction)DBEnv_log_archive, METH_VARARGS},
++ {"log_flush", (PyCFunction)DBEnv_log_flush, METH_NOARGS},
++ {"log_stat", (PyCFunction)DBEnv_log_stat, METH_VARARGS},
+ #if (DBVER >= 44)
+- {"lsn_reset", (PyCFunction)DBEnv_lsn_reset,
METH_VARARGS|METH_KEYWORDS},
++ {"fileid_reset", (PyCFunction)DBEnv_fileid_reset,
METH_VARARGS|METH_KEYWORDS},
++ {"lsn_reset", (PyCFunction)DBEnv_lsn_reset,
METH_VARARGS|METH_KEYWORDS},
+ #endif
+ {"set_get_returns_none",(PyCFunction)DBEnv_set_get_returns_none,
METH_VARARGS},
+- {"txn_recover", (PyCFunction)DBEnv_txn_recover, METH_NOARGS},
++ {"txn_recover", (PyCFunction)DBEnv_txn_recover, METH_NOARGS},
++#if (DBVER < 48)
+ {"set_rpc_server", (PyCFunction)DBEnv_set_rpc_server,
+ METH_VARARGS||METH_KEYWORDS},
+- {"set_verbose", (PyCFunction)DBEnv_set_verbose, METH_VARARGS},
++#endif
++ {"set_verbose", (PyCFunction)DBEnv_set_verbose, METH_VARARGS},
+ #if (DBVER >= 42)
+ {"get_verbose", (PyCFunction)DBEnv_get_verbose, METH_VARARGS},
+ #endif
+@@ -6579,6 +7486,17 @@ static PyMethodDef DBEnv_methods[] = {
+ {"rep_set_timeout", (PyCFunction)DBEnv_rep_set_timeout, METH_VARARGS},
+ {"rep_get_timeout", (PyCFunction)DBEnv_rep_get_timeout, METH_VARARGS},
+ #endif
++#if (DBVER >= 47)
++ {"rep_set_clockskew", (PyCFunction)DBEnv_rep_set_clockskew,
METH_VARARGS},
++ {"rep_get_clockskew", (PyCFunction)DBEnv_rep_get_clockskew,
METH_VARARGS},
++#endif
++ {"rep_stat", (PyCFunction)DBEnv_rep_stat,
++ METH_VARARGS|METH_KEYWORDS},
++#if (DBVER >= 43)
++ {"rep_stat_print", (PyCFunction)DBEnv_rep_stat_print,
++ METH_VARARGS|METH_KEYWORDS},
++#endif
++
+ #if (DBVER >= 45)
+ {"repmgr_start", (PyCFunction)DBEnv_repmgr_start,
+ METH_VARARGS|METH_KEYWORDS},
+@@ -6609,6 +7527,12 @@ static PyMethodDef DBTxn_methods[] = {
+ {"discard", (PyCFunction)DBTxn_discard, METH_NOARGS},
+ {"abort", (PyCFunction)DBTxn_abort, METH_NOARGS},
+ {"id", (PyCFunction)DBTxn_id, METH_NOARGS},
++ {"set_timeout", (PyCFunction)DBTxn_set_timeout,
++ METH_VARARGS|METH_KEYWORDS},
++#if (DBVER >= 44)
++ {"set_name", (PyCFunction)DBTxn_set_name, METH_VARARGS},
++ {"get_name", (PyCFunction)DBTxn_get_name, METH_NOARGS},
++#endif
+ {NULL, NULL} /* sentinel */
+ };
+
+@@ -6619,7 +7543,7 @@ static PyMethodDef DBSequence_methods[]
+ {"get", (PyCFunction)DBSequence_get,
METH_VARARGS|METH_KEYWORDS},
+ {"get_dbp", (PyCFunction)DBSequence_get_dbp, METH_NOARGS},
+ {"get_key", (PyCFunction)DBSequence_get_key, METH_NOARGS},
+- {"init_value", (PyCFunction)DBSequence_init_value,
METH_VARARGS},
++ {"initial_value", (PyCFunction)DBSequence_initial_value,
METH_VARARGS},
+ {"open", (PyCFunction)DBSequence_open,
METH_VARARGS|METH_KEYWORDS},
+ {"remove", (PyCFunction)DBSequence_remove,
METH_VARARGS|METH_KEYWORDS},
+ {"set_cachesize", (PyCFunction)DBSequence_set_cachesize,
METH_VARARGS},
+@@ -6629,6 +7553,8 @@ static PyMethodDef DBSequence_methods[]
+ {"set_range", (PyCFunction)DBSequence_set_range,
METH_VARARGS},
+ {"get_range", (PyCFunction)DBSequence_get_range, METH_NOARGS},
+ {"stat", (PyCFunction)DBSequence_stat,
METH_VARARGS|METH_KEYWORDS},
++ {"stat_print", (PyCFunction)DBSequence_stat_print,
++ METH_VARARGS|METH_KEYWORDS},
+ {NULL, NULL} /* sentinel */
+ };
+ #endif
+@@ -6677,7 +7603,7 @@ statichere PyTypeObject DB_Type = {
+ 0, /*tp_compare*/
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+- 0, /*tp_as_sequence*/
++ &DB_sequence,/*tp_as_sequence*/
+ &DB_mapping,/*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /* tp_call */
+@@ -7029,10 +7955,21 @@ PyMODINIT_FUNC PyInit__bsddb(void) /
+ {
+ PyObject* m;
+ PyObject* d;
+- PyObject* pybsddb_version_s = PyBytes_FromString( PY_BSDDB_VERSION );
+- PyObject* db_version_s = PyBytes_FromString( DB_VERSION_STRING );
+- PyObject* cvsid_s = PyBytes_FromString( rcs_id );
+ PyObject* py_api;
++ PyObject* pybsddb_version_s;
++ PyObject* db_version_s;
++ PyObject* cvsid_s;
++
++#if (PY_VERSION_HEX < 0x03000000)
++ pybsddb_version_s = PyString_FromString(PY_BSDDB_VERSION);
++ db_version_s = PyString_FromString(DB_VERSION_STRING);
++ cvsid_s = PyString_FromString(rcs_id);
++#else
++ /* This data should be ascii, so UTF-8 conversion is fine */
++ pybsddb_version_s = PyUnicode_FromString(PY_BSDDB_VERSION);
++ db_version_s = PyUnicode_FromString(DB_VERSION_STRING);
++ cvsid_s = PyUnicode_FromString(rcs_id);
++#endif
+
+ /* Initialize object types */
+ if ((PyType_Ready(&DB_Type) < 0)
+@@ -7089,6 +8026,7 @@ PyMODINIT_FUNC PyInit__bsddb(void) /
+ ADD_INT(d, DB_MAX_PAGES);
+ ADD_INT(d, DB_MAX_RECORDS);
+
++#if (DBVER < 48)
+ #if (DBVER >= 42)
+ ADD_INT(d, DB_RPCCLIENT);
+ #else
+@@ -7096,7 +8034,11 @@ PyMODINIT_FUNC PyInit__bsddb(void) /
+ /* allow apps to be written using DB_RPCCLIENT on older Berkeley DB */
+ _addIntToDict(d, "DB_RPCCLIENT", DB_CLIENT);
+ #endif
++#endif
++
++#if (DBVER < 48)
+ ADD_INT(d, DB_XA_CREATE);
++#endif
+
+ ADD_INT(d, DB_CREATE);
+ ADD_INT(d, DB_NOMMAP);
+@@ -7113,7 +8055,13 @@ PyMODINIT_FUNC PyInit__bsddb(void) /
+ ADD_INT(d, DB_INIT_TXN);
+ ADD_INT(d, DB_JOINENV);
+
++#if (DBVER >= 48)
++ ADD_INT(d, DB_GID_SIZE);
++#else
+ ADD_INT(d, DB_XIDDATASIZE);
++ /* Allow new code to work in old BDB releases */
++ _addIntToDict(d, "DB_GID_SIZE", DB_XIDDATASIZE);
++#endif
+
+ ADD_INT(d, DB_RECOVER);
+ ADD_INT(d, DB_RECOVER_FATAL);
+@@ -7128,6 +8076,10 @@ PyMODINIT_FUNC PyInit__bsddb(void) /
+ ADD_INT(d, DB_TXN_SYNC);
+ ADD_INT(d, DB_TXN_NOWAIT);
+
++#if (DBVER >= 46)
++ ADD_INT(d, DB_TXN_WAIT);
++#endif
++
+ ADD_INT(d, DB_EXCL);
+ ADD_INT(d, DB_FCNTL_LOCKING);
+ ADD_INT(d, DB_ODDFILESIZE);
+@@ -7233,12 +8185,6 @@ PyMODINIT_FUNC PyInit__bsddb(void) /
+ ADD_INT(d, DB_CACHED_COUNTS);
+ #endif
+
+-#if (DBVER >= 41)
+- _addIntToDict(d, "DB_CHECKPOINT", 0);
+-#else
+- ADD_INT(d, DB_CHECKPOINT);
+- ADD_INT(d, DB_CURLSN);
+-#endif
+ #if (DBVER <= 41)
+ ADD_INT(d, DB_COMMIT);
+ #endif
+@@ -7249,6 +8195,7 @@ PyMODINIT_FUNC PyInit__bsddb(void) /
+ ADD_INT(d, DB_FIRST);
+ ADD_INT(d, DB_FLUSH);
+ ADD_INT(d, DB_GET_BOTH);
++ ADD_INT(d, DB_GET_BOTH_RANGE);
+ ADD_INT(d, DB_GET_RECNO);
+ ADD_INT(d, DB_JOIN_ITEM);
+ ADD_INT(d, DB_KEYFIRST);
+@@ -7263,6 +8210,9 @@ PyMODINIT_FUNC PyInit__bsddb(void) /
+ ADD_INT(d, DB_POSITION);
+ ADD_INT(d, DB_PREV);
+ ADD_INT(d, DB_PREV_NODUP);
++#if (DBVER >= 46)
++ ADD_INT(d, DB_PREV_DUP);
++#endif
+ #if (DBVER < 45)
+ ADD_INT(d, DB_RECORDCOUNT);
+ #endif
+@@ -7278,17 +8228,18 @@ PyMODINIT_FUNC PyInit__bsddb(void) /
+ ADD_INT(d, DB_MULTIPLE_KEY);
+
+ #if (DBVER >= 44)
++ ADD_INT(d, DB_IMMUTABLE_KEY);
+ ADD_INT(d, DB_READ_UNCOMMITTED); /* replaces DB_DIRTY_READ in 4.4 */
+ ADD_INT(d, DB_READ_COMMITTED);
+ #endif
+
++#if (DBVER >= 44)
++ ADD_INT(d, DB_FREELIST_ONLY);
++ ADD_INT(d, DB_FREE_SPACE);
++#endif
++
+ ADD_INT(d, DB_DONOTINDEX);
+
+-#if (DBVER >= 41)
+- _addIntToDict(d, "DB_INCOMPLETE", 0);
+-#else
+- ADD_INT(d, DB_INCOMPLETE);
+-#endif
+ ADD_INT(d, DB_KEYEMPTY);
+ ADD_INT(d, DB_KEYEXIST);
+ ADD_INT(d, DB_LOCK_DEADLOCK);
+@@ -7309,14 +8260,15 @@ PyMODINIT_FUNC PyInit__bsddb(void) /
+ ADD_INT(d, DB_PANIC_ENVIRONMENT);
+ ADD_INT(d, DB_NOPANIC);
+
+-#if (DBVER >= 41)
+ ADD_INT(d, DB_OVERWRITE);
+-#endif
+
+-#ifdef DB_REGISTER
++#if (DBVER >= 44)
+ ADD_INT(d, DB_REGISTER);
+ #endif
+
++ ADD_INT(d, DB_EID_INVALID);
++ ADD_INT(d, DB_EID_BROADCAST);
++
+ #if (DBVER >= 42)
+ ADD_INT(d, DB_TIME_NOTGRANTED);
+ ADD_INT(d, DB_TXN_NOT_DURABLE);
+@@ -7389,6 +8341,32 @@ PyMODINIT_FUNC PyInit__bsddb(void) /
+
+ ADD_INT(d, DB_REP_MASTER);
+ ADD_INT(d, DB_REP_CLIENT);
++
++ ADD_INT(d, DB_REP_PERMANENT);
++
++#if (DBVER >= 44)
++ ADD_INT(d, DB_REP_CONF_NOAUTOINIT);
++ ADD_INT(d, DB_REP_CONF_DELAYCLIENT);
++ ADD_INT(d, DB_REP_CONF_BULK);
++ ADD_INT(d, DB_REP_CONF_NOWAIT);
++ ADD_INT(d, DB_REP_ANYWHERE);
++ ADD_INT(d, DB_REP_REREQUEST);
++#endif
++
++#if (DBVER >= 42)
++ ADD_INT(d, DB_REP_NOBUFFER);
++#endif
++
++#if (DBVER >= 46)
++ ADD_INT(d, DB_REP_LEASE_EXPIRED);
++ ADD_INT(d, DB_IGNORE_LEASE);
++#endif
++
++#if (DBVER >= 47)
++ ADD_INT(d, DB_REP_CONF_LEASE);
++ ADD_INT(d, DB_REPMGR_CONF_2SITE_STRICT);
++#endif
++
+ #if (DBVER >= 45)
+ ADD_INT(d, DB_REP_ELECTION);
+
+@@ -7400,6 +8378,11 @@ PyMODINIT_FUNC PyInit__bsddb(void) /
+ #if (DBVER >= 46)
+ ADD_INT(d, DB_REP_CHECKPOINT_DELAY);
+ ADD_INT(d, DB_REP_FULL_ELECTION_TIMEOUT);
++ ADD_INT(d, DB_REP_LEASE_TIMEOUT);
++#endif
++#if (DBVER >= 47)
++ ADD_INT(d, DB_REP_HEARTBEAT_MONITOR);
++ ADD_INT(d, DB_REP_HEARTBEAT_SEND);
+ #endif
+
+ #if (DBVER >= 45)
+@@ -7412,7 +8395,6 @@ PyMODINIT_FUNC PyInit__bsddb(void) /
+ ADD_INT(d, DB_REPMGR_ACKS_QUORUM);
+ ADD_INT(d, DB_REPMGR_CONNECTED);
+ ADD_INT(d, DB_REPMGR_DISCONNECTED);
+- ADD_INT(d, DB_STAT_CLEAR);
+ ADD_INT(d, DB_STAT_ALL);
+ #endif
+
+@@ -7428,12 +8410,16 @@ PyMODINIT_FUNC PyInit__bsddb(void) /
+ ADD_INT(d, DB_DSYNC_LOG);
+ #endif
+
+-#if (DBVER >= 41)
+ ADD_INT(d, DB_ENCRYPT_AES);
+ ADD_INT(d, DB_AUTO_COMMIT);
+-#else
+- /* allow Berkeley DB 4.1 aware apps to run on older versions */
+- _addIntToDict(d, "DB_AUTO_COMMIT", 0);
++ ADD_INT(d, DB_PRIORITY_VERY_LOW);
++ ADD_INT(d, DB_PRIORITY_LOW);
++ ADD_INT(d, DB_PRIORITY_DEFAULT);
++ ADD_INT(d, DB_PRIORITY_HIGH);
++ ADD_INT(d, DB_PRIORITY_VERY_HIGH);
++
++#if (DBVER >= 46)
++ ADD_INT(d, DB_PRIORITY_UNCHANGED);
+ #endif
+
+ ADD_INT(d, EINVAL);
+@@ -7497,10 +8483,6 @@ PyMODINIT_FUNC PyInit__bsddb(void) /
+ }
+ #endif
+
+-
+-#if !INCOMPLETE_IS_WARNING
+- MAKE_EX(DBIncompleteError);
+-#endif
+ MAKE_EX(DBCursorClosedError);
+ MAKE_EX(DBKeyEmptyError);
+ MAKE_EX(DBKeyExistError);
+@@ -7528,9 +8510,16 @@ PyMODINIT_FUNC PyInit__bsddb(void) /
+ #if (DBVER >= 42)
+ MAKE_EX(DBRepHandleDeadError);
+ #endif
++#if (DBVER >= 44)
++ MAKE_EX(DBRepLockoutError);
++#endif
+
+ MAKE_EX(DBRepUnavailError);
+
++#if (DBVER >= 46)
++ MAKE_EX(DBRepLeaseExpiredError);
++#endif
++
+ #undef MAKE_EX
+
+ /* Initiliase the C API structure and add it to the module */
+@@ -7544,7 +8533,24 @@ PyMODINIT_FUNC PyInit__bsddb(void) /
+ #endif
+ bsddb_api.makeDBError = makeDBError;
+
++ /*
++ ** Capsules exist from Python 3.1, but I
++ ** don't want to break the API compatibility
++ ** for already published Python versions.
++ */
++#if (PY_VERSION_HEX < 0x03020000)
+ py_api = PyCObject_FromVoidPtr((void*)&bsddb_api, NULL);
++#else
++ {
++ char py_api_name[250];
++
++ strcpy(py_api_name, _bsddbModuleName);
++ strcat(py_api_name, ".api");
++
++ py_api = PyCapsule_New((void*)&bsddb_api, py_api_name, NULL);
++ }
++#endif
++
+ PyDict_SetItemString(d, "api", py_api);
+ Py_DECREF(py_api);
+
+diff -Nupr Python-2.6.4.orig/Modules/bsddb.h Python-2.6.4/Modules/bsddb.h
+--- Python-2.6.4.orig/Modules/bsddb.h 2008-09-28 19:24:19.000000000 -0400
++++ Python-2.6.4/Modules/bsddb.h 2009-12-04 07:34:56.000000000 -0500
+@@ -105,7 +105,7 @@
+ #error "eek! DBVER can't handle minor versions > 9"
+ #endif
+
+-#define PY_BSDDB_VERSION "4.7.3"
++#define PY_BSDDB_VERSION "4.8.1"
+
+ /* Python object definitions */
+
+@@ -220,6 +220,7 @@ typedef struct DBSequenceObject {
+ /* To access the structure from an external module, use code like the
+ following (error checking missed out for clarity):
+
++ // If you are using Python 3.2:
+ BSDDB_api* bsddb_api;
+ PyObject* mod;
+ PyObject* cobj;
+@@ -231,6 +232,15 @@ typedef struct DBSequenceObject {
+ Py_DECREF(cobj);
+ Py_DECREF(mod);
+
++
++ // If you are using Python 3.2 or up:
++ BSDDB_api* bsddb_api;
++
++ // Use "bsddb3._pybsddb.api" if you're using
++ // the standalone pybsddb add-on.
++ bsddb_api = (void **)PyCapsule_Import("bsddb._bsddb.api", 1);
++
++
+ The structure's members must not be changed.
+ */
+
+@@ -247,7 +257,6 @@ typedef struct {
+
+ /* Functions */
+ int (*makeDBError)(int err);
+-
+ } BSDDB_api;
+
+
diff --git a/python-2.6.4-setup-db48.patch b/python-2.6.4-setup-db48.patch
new file mode 100644
index 0000000..187f239
--- /dev/null
+++ b/python-2.6.4-setup-db48.patch
@@ -0,0 +1,27 @@
+diff -up Python-2.6.4/Modules/Setup.dist.setup-db48 Python-2.6.4/Modules/Setup.dist
+--- Python-2.6.4/Modules/Setup.dist.setup-db48 2009-12-17 22:05:07.000020150 -0500
++++ Python-2.6.4/Modules/Setup.dist 2009-12-17 22:05:12.545015367 -0500
+@@ -411,7 +411,7 @@ gdbm gdbmmodule.c -lgdbm
+ #
+ # Edit the variables DB and DBLIBVERto point to the db top directory
+ # and the subdirectory of PORT where you built it.
+-DBLIBVER=4.7
++DBLIBVER=4.8
+ DBINC=/usr/include/db4
+ DBLIB=/usr/lib
+ _bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
+diff -up Python-2.6.4/setup.py.setup-db48 Python-2.6.4/setup.py
+--- Python-2.6.4/setup.py.setup-db48 2009-12-17 22:03:58.048015993 -0500
++++ Python-2.6.4/setup.py 2009-12-17 22:03:58.169016398 -0500
+@@ -705,9 +705,9 @@ class PyBuildExt(build_ext):
+ # a release. Most open source OSes come with one or more
+ # versions of BerkeleyDB already installed.
+
+- max_db_ver = (4, 7)
++ max_db_ver = (4, 8)
+ min_db_ver = (3, 3)
+- db_setup_debug = False # verbose debug prints from this script?
++ db_setup_debug = True # verbose debug prints from this script?
+
+ def allow_db_ver(db_ver):
+ """Returns a boolean if the given BerkeleyDB version is
acceptable.
diff --git a/python.spec b/python.spec
index 2bf3fba..631b285 100644
--- a/python.spec
+++ b/python.spec
@@ -22,7 +22,7 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
Version: 2.6.4
-Release: 3%{?dist}
+Release: 4%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -49,13 +49,24 @@ Patch16: python-2.6-rpath.patch
# Fix distutils to follow the Fedora/RHEL/CentOS policies of having .pyo files
Patch51: python-2.6-distutils_rpm.patch
+# Automatically disable arena allocator when run under valgrind:
+# From
http://bugs.python.org/issue2422
+#
http://bugs.python.org/file9872/disable-pymalloc-on-valgrind-py26.patch
+# with the "configure" part removed; appears to be identical to the version
committed to 2.7
+Patch52: disable-pymalloc-on-valgrind-py26.patch
+
+
+# Patch generated by jwboyer(a)gmail.com to compile against db-4.8, using upstream
+#
http://www.jcea.es/programacion/pybsddb.htm
+# See
https://bugzilla.redhat.com/show_bug.cgi?id=544275
+Patch53: python-2.6-update-bsddb3-4.8.patch
+# ...and a further patch to setup.py so that it searches for 4.8:
+Patch54: python-2.6.4-setup-db48.patch
+
# upstreamed
#Patch50: python-2.5-disable-egginfo.patch
-# new db version
-#Patch60: python-2.5.2-db47.patch
-
# lib64 patches
Patch101: python-2.3.4-lib64-regex.patch
Patch102: python-2.6-lib64.patch
@@ -93,8 +104,9 @@ BuildRequires: libGL-devel tk tix gcc-c++ libX11-devel glibc-devel
BuildRequires: bzip2 tar /usr/bin/find pkgconfig tcl-devel tk-devel
BuildRequires: tix-devel bzip2-devel sqlite-devel
BuildRequires: autoconf
-BuildRequires: db4-devel >= 4.7
+BuildRequires: db4-devel >= 4.8
BuildRequires: libffi-devel
+BuildRequires: valgrind-devel
URL:
http://www.python.org/
@@ -211,7 +223,6 @@ code that uses more than just unittest and/or test_support.py.
# Try not disabling egg-infos, bz#414711
#patch50 -p1 -b .egginfo
-#%%patch60 -p1 -b .db47
%if "%{_lib}" == "lib64"
%patch101 -p1 -b .lib64-regex
@@ -227,6 +238,9 @@ code that uses more than just unittest and/or test_support.py.
%patch16 -p1 -b .rpath
%patch51 -p1 -b .brprpm
+%patch52 -p0 -b .valgrind
+%patch53 -p1 -b .db48
+%patch54 -p1 -b .setup-db48
%ifarch alpha ia64
# 64bit, but not lib64 arches need this too...
@@ -256,9 +270,9 @@ if pkg-config openssl ; then
fi
# Force CC
export CC=gcc
-# For patch 4, need to get a newer configure generated out of configure.in
+# For patches 4 and 52, need to get a newer configure generated out of configure.in
autoconf
-%configure --enable-ipv6 --enable-unicode=%{unicode} --enable-shared --with-system-ffi
+%configure --enable-ipv6 --enable-unicode=%{unicode} --enable-shared --with-system-ffi
--with-valgrind
make OPT="$CFLAGS" %{?_smp_mflags}
LD_LIBRARY_PATH=$topdir $topdir/python Tools/scripts/pathfix.py -i "%{_bindir}/env
python%{pybasever}" .
@@ -550,6 +564,15 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
%changelog
+* Wed Dec 16 2009 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-4
+- automatically disable arena allocator when run under valgrind (upstream
+issue 2422; patch 52)
+- add patch from Josh Boyer containing diff against upstream PyBSDDB to make
+the bsddb module compile against db-4.8 (patch 53, #544275); bump the necessary
+version of db4-devel to 4.8
+- patch setup.py so that it searches for db-4.8, and enable debug output for
+said search; make Setup.dist use db-4.8 (patch 54)
+
* Thu Nov 12 2009 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-3
- fixup the build when __python_ver is set (Zach Sadecki; bug 533989); use
pybasever in the files section
commit b56c884cb8fa9e1864d250a345d3fe133aa397c2
Author: Bill Nottingham <notting(a)fedoraproject.org>
Date: Wed Nov 25 23:31:54 2009 +0000
Fix typo that causes a failure to update the common directory. (releng
#2781)
diff --git a/Makefile b/Makefile
index c6d78ed..d62a95c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,10 @@
# Makefile for source rpm: python
-# $Id: Makefile,v 1.1 2004/09/09 10:57:27 cvsdist Exp $
+# $Id: Makefile,v 1.2 2007/10/15 19:19:17 notting Exp $
NAME := python
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
-for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f
$$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo
"$$d/Makefile.common" ; break ; fi ; done
+for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f
$$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo
"$$d/Makefile.common" ; break ; fi ; done
endef
MAKEFILE_COMMON := $(shell $(find-makefile-common))
commit 1df0c9ef003be64b906bc919551606940ab009ca
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Thu Nov 12 19:36:14 2009 +0000
- fixup the build when __python_ver is set (Zach Sadecki; bug 533989); use
pybasever in the files section
diff --git a/python.spec b/python.spec
index a574770..2bf3fba 100644
--- a/python.spec
+++ b/python.spec
@@ -22,7 +22,7 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
Version: 2.6.4
-Release: 2%{?dist}
+Release: 3%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -443,9 +443,11 @@ rm -fr $RPM_BUILD_ROOT
%defattr(-, root, root)
%doc LICENSE README
%{_bindir}/pydoc*
-%{_bindir}/python
+%{_bindir}/%{python}
+%if %{main_python}
%{_bindir}/python2
-%{_bindir}/python2.6
+%endif
+%{_bindir}/python%{pybasever}
%{_mandir}/*/*
%dir %{_libdir}/python%{pybasever}
@@ -508,7 +510,7 @@ rm -fr $RPM_BUILD_ROOT
%exclude /usr/include/python%{pybasever}/%{_pyconfig_h}
%doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit
%{_bindir}/python-config
-%{_bindir}/python2.6-config
+%{_bindir}/python%{pybasever}-config
%{_libdir}/python%{pybasever}/config/*
%{_libdir}/libpython%{pybasever}.so
@@ -548,6 +550,10 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
%changelog
+* Thu Nov 12 2009 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-3
+- fixup the build when __python_ver is set (Zach Sadecki; bug 533989); use
+pybasever in the files section
+
* Thu Oct 29 2009 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-2
- "Makefile" and the config-32/64.h file are needed by distutils/sysconfig.py
_init_posix(), so we include them in the core package, along with their parent
commit 8274ac04f1bc7cda1ed084352b8af772619468e8
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Fri Oct 30 03:14:04 2009 +0000
"Makefile" and the config-32/64.h file are needed by distutils/sysconfig.py
_init_posix(), so we include them in the core package, along with their
parent directories (bug 531901)
diff --git a/python.spec b/python.spec
index 87b9a9a..a574770 100644
--- a/python.spec
+++ b/python.spec
@@ -22,7 +22,7 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
Version: 2.6.4
-Release: 1%{?dist}
+Release: 2%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -487,6 +487,14 @@ rm -fr $RPM_BUILD_ROOT
%attr(0755,root,root) %dir /usr/lib/python%{pybasever}/site-packages
%endif
+# "Makefile" and the config-32/64.h file are needed by
+# distutils/sysconfig.py:_init_posix(), so we include them in the core
+# package, along with their parent directories (bug 531901):
+%dir %{_libdir}/python%{pybasever}/config
+%{_libdir}/python%{pybasever}/config/Makefile
+%dir /usr/include/python%{pybasever}
+/usr/include/python%{pybasever}/%{_pyconfig_h}
+
%files libs
%defattr(-,root,root)
%doc LICENSE README
@@ -494,9 +502,11 @@ rm -fr $RPM_BUILD_ROOT
%files devel
%defattr(-,root,root)
-/usr/include/*
+%{_libdir}/python%{pybasever}/config/*
+%exclude %{_libdir}/python%{pybasever}/config/Makefile
+/usr/include/python%{pybasever}/*.h
+%exclude /usr/include/python%{pybasever}/%{_pyconfig_h}
%doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit
-%dir %{_libdir}/python%{pybasever}/config
%{_bindir}/python-config
%{_bindir}/python2.6-config
%{_libdir}/python%{pybasever}/config/*
@@ -538,6 +548,11 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
%changelog
+* Thu Oct 29 2009 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-2
+- "Makefile" and the config-32/64.h file are needed by distutils/sysconfig.py
+_init_posix(), so we include them in the core package, along with their parent
+directories (bug 531901)
+
* Mon Oct 26 2009 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-1
- Update to 2.6.4
commit c1f3234d449ce591910d481d03547d22b09f9b57
Author: dmalcolm <dmalcolm(a)fedoraproject.org>
Date: Tue Oct 27 07:57:25 2009 +0000
2.6.4
diff --git a/.cvsignore b/.cvsignore
index 79b09c9..d7ad69d 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -1 +1 @@
-Python-2.6.2.tar.bz2
+Python-2.6.4.tar.bz2
diff --git a/python.spec b/python.spec
index 936264b..87b9a9a 100644
--- a/python.spec
+++ b/python.spec
@@ -21,8 +21,8 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
-Version: 2.6.2
-Release: 2%{?dist}
+Version: 2.6.4
+Release: 1%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -538,6 +538,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
%changelog
+* Mon Oct 26 2009 David Malcolm <dmalcolm(a)redhat.com> - 2.6.4-1
+- Update to 2.6.4
+
* Fri Aug 21 2009 Tomas Mraz <tmraz(a)redhat.com> - 2.6.2-2
- rebuilt with new openssl
diff --git a/sources b/sources
index 18adbe6..19cf174 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-245db9f1e0f09ab7e0faaa0cf7301011 Python-2.6.2.tar.bz2
+fee5408634a54e721a93531aba37f8c1 Python-2.6.4.tar.bz2
commit 0a675ff2bcaeb533c2b70e408a23678f25b81695
Author: Tom Mrz <tmraz(a)fedoraproject.org>
Date: Fri Aug 21 15:34:49 2009 +0000
- rebuilt with new openssl
diff --git a/python.spec b/python.spec
index ebda5d3..936264b 100644
--- a/python.spec
+++ b/python.spec
@@ -22,7 +22,7 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
Version: 2.6.2
-Release: 1%{?dist}
+Release: 2%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -538,6 +538,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
%changelog
+* Fri Aug 21 2009 Tomas Mraz <tmraz(a)redhat.com> - 2.6.2-2
+- rebuilt with new openssl
+
* Mon Jul 27 2009 James Antill <james.antill(a)redhat.com> - 2.6.2-1
- Update to 2.6.2
commit 59ba18a89dd3f53f9f623e0142cc03b59f261bbf
Author: James Antill <james(a)fedoraproject.org>
Date: Thu Jul 30 21:03:26 2009 +0000
- Update to 2.6.2
diff --git a/.cvsignore b/.cvsignore
index 0f3d7fb..79b09c9 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -1 +1 @@
-Python-2.6.tar.bz2
+Python-2.6.2.tar.bz2
diff --git a/python-2.5.2-binutils-no-dep.patch b/python-2.5.2-binutils-no-dep.patch
deleted file mode 100644
index 6792c9f..0000000
--- a/python-2.5.2-binutils-no-dep.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-diff -ru Python-2.5.2-orig/Lib/ctypes/util.py Python-2.5.2/Lib/ctypes/util.py
---- Python-2.5.2-orig/Lib/ctypes/util.py 2007-09-14 16:05:26.000000000 -0400
-+++ Python-2.5.2/Lib/ctypes/util.py 2008-09-24 17:30:06.000000000 -0400
-@@ -83,9 +83,14 @@
- if not f:
- return None
- cmd = "objdump -p -j .dynamic 2>/dev/null " + f
-- res = re.search(r'\sSONAME\s+([^\s]+)', os.popen(cmd).read())
-+ try:
-+ res = re.search(r'\sSONAME\s+([^\s]+)', os.popen(cmd).read())
-+ except:
-+ res = None
- if not res:
-- return None
-+ return os.path.basename(f) # This is good for GLibc, I think,
-+ # and a dep on binutils is big (for
-+ # live CDs).
- return res.group(1)
-
- if (sys.platform.startswith("freebsd")
diff --git a/python-2.6-canonicalize.patch b/python-2.6-canonicalize.patch
deleted file mode 100644
index 10a1470..0000000
--- a/python-2.6-canonicalize.patch
+++ /dev/null
@@ -1,123 +0,0 @@
-diff -up Python-2.6/configure.in.canonicalize Python-2.6/configure.in
---- Python-2.6/configure.in.canonicalize 2008-09-07 15:18:16.000000000 -0400
-+++ Python-2.6/configure.in 2008-11-24 02:09:29.000000000 -0500
-@@ -2445,7 +2445,8 @@ fi
- AC_MSG_RESULT(MACHDEP_OBJS)
-
- # checks for library functions
--AC_CHECK_FUNCS(alarm setitimer getitimer bind_textdomain_codeset chown \
-+AC_CHECK_FUNCS(alarm setitimer getitimer bind_textdomain_codeset \
-+ canonicalize_file_name chown \
- clock confstr ctermid execv fchmod fchown fork fpathconf ftime ftruncate \
- gai_strerror getgroups getlogin getloadavg getpeername getpgid getpid \
- getpriority getpwent getspnam getspent getsid getwd \
-diff -up Python-2.6/pyconfig.h.in.canonicalize Python-2.6/pyconfig.h.in
---- Python-2.6/pyconfig.h.in.canonicalize 2008-09-07 01:15:18.000000000 -0400
-+++ Python-2.6/pyconfig.h.in 2008-11-24 02:07:11.000000000 -0500
-@@ -79,6 +79,9 @@
- /* Define to 1 if you have the `chflags' function. */
- #undef HAVE_CHFLAGS
-
-+/* Define to 1 if you have the `canonicalize_file_name' function. */
-+#undef HAVE_CANONICALIZE_FILE_NAME
-+
- /* Define to 1 if you have the `chown' function. */
- #undef HAVE_CHOWN
-
-diff -up Python-2.6/Python/sysmodule.c.canonicalize Python-2.6/Python/sysmodule.c
---- Python-2.6/Python/sysmodule.c.canonicalize 2008-07-10 13:13:55.000000000 -0400
-+++ Python-2.6/Python/sysmodule.c 2008-11-24 02:07:11.000000000 -0500
-@@ -1524,11 +1524,13 @@ makeargvobject(int argc, char **argv)
- void
- PySys_SetArgv(int argc, char **argv)
- {
-+#ifndef HAVE_CANONICALIZE_FILE_NAME
- #if defined(HAVE_REALPATH)
- char fullpath[MAXPATHLEN];
- #elif defined(MS_WINDOWS)
- char fullpath[MAX_PATH];
- #endif
-+#endif
- PyObject *av = makeargvobject(argc, argv);
- PyObject *path = PySys_GetObject("path");
- if (av == NULL)
-@@ -1540,6 +1542,64 @@ PySys_SetArgv(int argc, char **argv)
- char *p = NULL;
- Py_ssize_t n = 0;
- PyObject *a;
-+#ifdef HAVE_CANONICALIZE_FILE_NAME
-+ char *link = NULL, *argv0copy = NULL;
-+
-+ if (argc > 0 && argv0 != NULL) {
-+
-+ link = canonicalize_file_name(argv0);
-+ if (link == NULL) {
-+ link = strdup(argv0);
-+ if (!link)
-+ Py_FatalError("no mem for sys.argv");
-+ }
-+ }
-+ if (link) {
-+ if (link[0] == SEP) /* Link to absolute path */
-+ argv0 = link;
-+ else if (strchr(link, SEP) == NULL) {
-+ /* Link without path */
-+ /* strdup argv0 so we can free it
-+ unconditionally */
-+ argv0 = strdup(argv0);
-+ if (!argv0)
-+ Py_FatalError("no mem for sys.argv");
-+ free(link);
-+ } else {
-+ /* Must join(dirname(argv0), link) */
-+ char *q = strrchr(argv0, SEP);
-+ if (q == NULL) /* argv0 without path */
-+ argv0 = link;
-+ else {
-+ /* Must make a copy */
-+ argv0copy = calloc(
-+ strlen(link) + strlen(q) +1,
-+ sizeof (char));
-+ if (!argv0copy)
-+ Py_FatalError("no mem for sys.argv");
-+ strcpy(argv0copy, argv0);
-+ q = strrchr(argv0copy, SEP);
-+ strcpy(argv0copy+1, link);
-+ argv0 = argv0copy;
-+ p = NULL;
-+ free(link);
-+ }
-+ }
-+ }
-+ if (argc > 0 && argv0 != NULL) {
-+ char *q;
-+ p = strrchr(argv0, SEP);
-+ /* Test for alternate separator */
-+ q = strrchr(p ? p : argv0, '/');
-+ if (q != NULL)
-+ p = q;
-+ if (p != NULL) {
-+ n = p + 1 - argv0;
-+ if (n > 1 && p[-1] != ':')
-+ n--; /* Drop trailing separator */
-+ }
-+ }
-+#else /* ! HAVE_CANONICALIZE_FILE_NAME */
- #ifdef HAVE_READLINK
- char link[MAXPATHLEN+1];
- char argv0copy[2*MAXPATHLEN+1];
-@@ -1612,9 +1672,14 @@ PySys_SetArgv(int argc, char **argv)
- #endif /* Unix */
- }
- #endif /* All others */
-+#endif /* ! HAVE_CANONICALIZE_FILE_NAME */
- a = PyString_FromStringAndSize(argv0, n);
- if (a == NULL)
- Py_FatalError("no mem for sys.path insertion");
-+#ifdef HAVE_CANONICALIZE_FILE_NAME
-+ if (argc > 0 && argv0 != NULL)
-+ free(argv0);
-+#endif /* HAVE_CANONICALIZE_FILE_NAME */
- if (PyList_Insert(path, 0, a) < 0)
- Py_FatalError("sys.path.insert(0) failed");
- Py_DECREF(a);
diff --git a/python-2.6-config.patch b/python-2.6-config.patch
deleted file mode 100644
index 387eecb..0000000
--- a/python-2.6-config.patch
+++ /dev/null
@@ -1,337 +0,0 @@
-diff -up Python-2.6/Include/pyexpat.h.rhconfig Python-2.6/Include/pyexpat.h
---- Python-2.6/Include/pyexpat.h.rhconfig 2006-06-19 19:21:25.000000000 -0400
-+++ Python-2.6/Include/pyexpat.h 2008-11-24 02:00:47.000000000 -0500
-@@ -5,6 +5,19 @@
-
- #define PyExpat_CAPI_MAGIC "pyexpat.expat_CAPI 1.0"
-
-+#ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */
-+#if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400
-+typedef __int64 XML_Index;
-+typedef unsigned __int64 XML_Size;
-+#else
-+typedef long long XML_Index;
-+typedef unsigned long long XML_Size;
-+#endif
-+#else
-+typedef long XML_Index;
-+typedef unsigned long XML_Size;
-+#endif /* XML_LARGE_SIZE */
-+
- struct PyExpat_CAPI
- {
- char* magic; /* set to PyExpat_CAPI_MAGIC */
-diff -up Python-2.6/Modules/Setup.dist.rhconfig Python-2.6/Modules/Setup.dist
---- Python-2.6/Modules/Setup.dist.rhconfig 2008-09-21 03:31:52.000000000 -0400
-+++ Python-2.6/Modules/Setup.dist 2008-11-24 02:03:41.000000000 -0500
-@@ -152,7 +152,7 @@ GLHACK=-Dclear=__GLclear
- # modules are to be built as shared libraries (see above for more
- # detail; also note that *static* reverses this effect):
-
--#*shared*
-+*shared*
-
- # GNU readline. Unlike previous Python incarnations, GNU readline is
- # now incorporated in an optional module, configured in the Setup file
-@@ -162,69 +162,69 @@ GLHACK=-Dclear=__GLclear
- # it, depending on your system -- see the GNU readline instructions.
- # It's okay for this to be a shared library, too.
-
--#readline readline.c -lreadline -ltermcap
-+readline readline.c -lreadline -ltermcap
-
-
- # Modules that should always be present (non UNIX dependent):
-
--#array arraymodule.c # array objects
--#cmath cmathmodule.c # -lm # complex math library functions
--#math mathmodule.c # -lm # math library functions, e.g. sin()
--#_struct _struct.c # binary structure packing/unpacking
--#time timemodule.c # -lm # time operations and variables
--#operator operator.c # operator.add() and similar goodies
--#_weakref _weakref.c # basic weak reference support
--#_testcapi _testcapimodule.c # Python C API test module
--#_random _randommodule.c # Random number generator
--#_collections _collectionsmodule.c # Container types
--#itertools itertoolsmodule.c # Functions creating iterators for efficient looping
--#strop stropmodule.c # String manipulations
-+array arraymodule.c # array objects
-+cmath cmathmodule.c # -lm # complex math library functions
-+math mathmodule.c # -lm # math library functions, e.g. sin()
-+_struct _struct.c # binary structure packing/unpacking
-+time timemodule.c # -lm # time operations and variables
-+operator operator.c # operator.add() and similar goodies
-+_weakref _weakref.c # basic weak reference support
-+_testcapi _testcapimodule.c # Python C API test module
-+_random _randommodule.c # Random number generator
-+_collections _collectionsmodule.c # Container types
-+itertools itertoolsmodule.c # Functions creating iterators for efficient looping
-+strop stropmodule.c # String manipulations
-
--#unicodedata unicodedata.c # static Unicode character database
-+unicodedata unicodedata.c # static Unicode character database
-
- # access to ISO C locale support
--#_locale _localemodule.c # -lintl
-+_locale _localemodule.c # -lintl
-
-
- # Modules with some UNIX dependencies -- on by default:
- # (If you have a really backward UNIX, select and socket may not be
- # supported...)
-
--#fcntl fcntlmodule.c # fcntl(2) and ioctl(2)
--#spwd spwdmodule.c # spwd(3)
--#grp grpmodule.c # grp(3)
--#select selectmodule.c # select(2); not on ancient System V
-+fcntl fcntlmodule.c # fcntl(2) and ioctl(2)
-+spwd spwdmodule.c # spwd(3)
-+grp grpmodule.c # grp(3)
-+select selectmodule.c # select(2); not on ancient System V
-
- # Memory-mapped files (also works on Win32).
--#mmap mmapmodule.c
-+mmap mmapmodule.c
-
- # CSV file helper
--#_csv _csv.c
-+_csv _csv.c
-
- # Socket module helper for socket(2)
--#_socket socketmodule.c
-+_socket socketmodule.c
-
- # Socket module helper for SSL support; you must comment out the other
- # socket line above, and possibly edit the SSL variable:
- #SSL=/usr/local/ssl
--#_ssl _ssl.c \
--# -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
--# -L$(SSL)/lib -lssl -lcrypto
-+_ssl _ssl.c \
-+ -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-+ -L$(SSL)/lib -lssl -lcrypto
-
- # The crypt module is now disabled by default because it breaks builds
- # on many systems (where -lcrypt is needed), e.g. Linux (I believe).
- #
- # First, look at Setup.config; configure may have set this for you.
-
--#crypt cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some systems
-+crypt cryptmodule.c -lcrypt # crypt(3); needs -lcrypt on some systems
-
-
- # Some more UNIX dependent modules -- off by default, since these
- # are not supported by all UNIX systems:
-
--#nis nismodule.c -lnsl # Sun yellow pages -- not everywhere
--#termios termios.c # Steen Lumholt's termios module
--#resource resource.c # Jeremy Hylton's rlimit interface
-+nis nismodule.c -lnsl # Sun yellow pages -- not everywhere
-+termios termios.c # Steen Lumholt's termios module
-+resource resource.c # Jeremy Hylton's rlimit interface
-
-
- # Multimedia modules -- off by default.
-@@ -232,8 +232,8 @@ GLHACK=-Dclear=__GLclear
- # #993173 says audioop works on 64-bit platforms, though.
- # These represent audio samples or images as strings:
-
--#audioop audioop.c # Operations on audio samples
--#imageop imageop.c # Operations on images
-+audioop audioop.c # Operations on audio samples
-+imageop imageop.c # Operations on images
-
-
- # Note that the _md5 and _sha modules are normally only built if the
-@@ -243,14 +243,14 @@ GLHACK=-Dclear=__GLclear
- # Message-Digest Algorithm, described in RFC 1321. The necessary files
- # md5.c and md5.h are included here.
-
--#_md5 md5module.c md5.c
-+_md5 md5module.c md5.c
-
-
- # The _sha module implements the SHA checksum algorithms.
- # (NIST's Secure Hash Algorithms.)
--#_sha shamodule.c
--#_sha256 sha256module.c
--#_sha512 sha512module.c
-+_sha shamodule.c
-+_sha256 sha256module.c
-+_sha512 sha512module.c
-
-
- # SGI IRIX specific modules -- off by default.
-@@ -297,12 +297,12 @@ GLHACK=-Dclear=__GLclear
- # A Linux specific module -- off by default; this may also work on
- # some *BSDs.
-
--#linuxaudiodev linuxaudiodev.c
-+linuxaudiodev linuxaudiodev.c
-
-
- # George Neville-Neil's timing module:
-
--#timing timingmodule.c
-+timing timingmodule.c
-
-
- # The _tkinter module.
-@@ -317,7 +317,7 @@ GLHACK=-Dclear=__GLclear
- # every system.
-
- # *** Always uncomment this (leave the leading underscore in!):
--# _tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \
-+_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \
- # *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
- # -L/usr/local/lib \
- # *** Uncomment and edit to reflect where your Tcl/Tk headers are:
-@@ -327,7 +327,7 @@ GLHACK=-Dclear=__GLclear
- # *** Or uncomment this for Solaris:
- # -I/usr/openwin/include \
- # *** Uncomment and edit for Tix extension only:
--# -DWITH_TIX -ltix8.1.8.2 \
-+ -DWITH_TIX -ltix \
- # *** Uncomment and edit for BLT extension only:
- # -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \
- # *** Uncomment and edit for PIL (TkImaging) extension only:
-@@ -336,7 +336,7 @@ GLHACK=-Dclear=__GLclear
- # *** Uncomment and edit for TOGL extension only:
- # -DWITH_TOGL togl.c \
- # *** Uncomment and edit to reflect your Tcl/Tk versions:
--# -ltk8.2 -ltcl8.2 \
-+ -ltk -ltcl \
- # *** Uncomment and edit to reflect where your X11 libraries are:
- # -L/usr/X11R6/lib \
- # *** Or uncomment this for Solaris:
-@@ -346,7 +346,7 @@ GLHACK=-Dclear=__GLclear
- # *** Uncomment for AIX:
- # -lld \
- # *** Always uncomment this; X11 libraries to link with:
--# -lX11
-+ -lX11
-
- # Lance Ellinghaus's syslog module
- #syslog syslogmodule.c # syslog daemon interface
-@@ -358,9 +358,9 @@ GLHACK=-Dclear=__GLclear
- #
- # First, look at Setup.config; configure may have set this for you.
-
--#_curses _cursesmodule.c -lcurses -ltermcap
-+_curses _cursesmodule.c -lncursesw
- # Wrapper for the panel library that's part of ncurses and SYSV curses.
--#_curses_panel _curses_panel.c -lpanel -lncurses
-+_curses_panel _curses_panel.c -lpanel -lncursesw
-
-
- # Generic (SunOS / SVR4) dynamic loading module.
-@@ -368,7 +368,7 @@ GLHACK=-Dclear=__GLclear
- # it is a highly experimental and dangerous device for calling
- # *arbitrary* C functions in *arbitrary* shared libraries:
-
--#dl dlmodule.c
-+dl dlmodule.c
-
-
- # Modules that provide persistent dictionary-like semantics. You will
-@@ -391,7 +391,7 @@ GLHACK=-Dclear=__GLclear
- #
- # First, look at Setup.config; configure may have set this for you.
-
--#gdbm gdbmmodule.c -I/usr/local/include -L/usr/local/lib -lgdbm
-+gdbm gdbmmodule.c -I/usr/local/include -L/usr/local/lib -lgdbm
-
-
- # Sleepycat Berkeley DB interface.
-@@ -406,11 +406,10 @@ GLHACK=-Dclear=__GLclear
- #
- # Edit the variables DB and DBLIBVERto point to the db top directory
- # and the subdirectory of PORT where you built it.
--#DB=/usr/local/BerkeleyDB.4.0
--#DBLIBVER=4.0
--#DBINC=$(DB)/include
--#DBLIB=$(DB)/lib
--#_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
-+DBLIBVER=4.7
-+DBINC=/usr/include/db4
-+DBLIB=/usr/lib
-+_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
-
- # Historical Berkeley DB 1.85
- #
-@@ -425,14 +424,14 @@ GLHACK=-Dclear=__GLclear
-
-
- # Helper module for various ascii-encoders
--#binascii binascii.c
-+binascii binascii.c
-
- # Fred Drake's interface to the Python parser
--#parser parsermodule.c
-+parser parsermodule.c
-
- # cStringIO and cPickle
--#cStringIO cStringIO.c
--#cPickle cPickle.c
-+cStringIO cStringIO.c
-+cPickle cPickle.c
-
-
- # Lee Busby's SIGFPE modules.
-@@ -455,7 +454,7 @@ GLHACK=-Dclear=__GLclear
- # Andrew Kuchling's zlib module.
- # This require zlib 1.1.3 (or later).
- # See
http://www.gzip.org/zlib/
--#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
-+zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
-
- # Interface to the Expat XML parser
- #
-@@ -469,20 +468,20 @@ GLHACK=-Dclear=__GLclear
- # More information on Expat can be found at
www.libexpat.org.
- #
- #EXPAT_DIR=/usr/local/src/expat-1.95.2
--#pyexpat pyexpat.c -DHAVE_EXPAT_H -I$(EXPAT_DIR)/lib -L$(EXPAT_DIR) -lexpat
-+pyexpat pyexpat.c -DHAVE_EXPAT_H -lexpat
-
-
- # Hye-Shik Chang's CJKCodecs
-
- # multibytecodec is required for all the other CJK codec modules
--#_multibytecodec cjkcodecs/multibytecodec.c
-+_multibytecodec cjkcodecs/multibytecodec.c
-
--#_codecs_cn cjkcodecs/_codecs_cn.c
--#_codecs_hk cjkcodecs/_codecs_hk.c
--#_codecs_iso2022 cjkcodecs/_codecs_iso2022.c
--#_codecs_jp cjkcodecs/_codecs_jp.c
--#_codecs_kr cjkcodecs/_codecs_kr.c
--#_codecs_tw cjkcodecs/_codecs_tw.c
-+_codecs_cn cjkcodecs/_codecs_cn.c
-+_codecs_hk cjkcodecs/_codecs_hk.c
-+_codecs_iso2022 cjkcodecs/_codecs_iso2022.c
-+_codecs_jp cjkcodecs/_codecs_jp.c
-+_codecs_kr cjkcodecs/_codecs_kr.c
-+_codecs_tw cjkcodecs/_codecs_tw.c
-
- # Example -- included for reference only:
- # xx xxmodule.c
-diff -up Python-2.6/setup.py.rhconfig Python-2.6/setup.py
---- Python-2.6/setup.py.rhconfig 2008-09-29 20:15:45.000000000 -0400
-+++ Python-2.6/setup.py 2008-11-24 02:00:47.000000000 -0500
-@@ -1189,7 +1189,6 @@ class PyBuildExt(build_ext):
-
- exts.append(Extension('pyexpat',
- define_macros = define_macros,
-- include_dirs = [expatinc],
- sources = ['pyexpat.c',
- 'expat/xmlparse.c',
- 'expat/xmlrole.c',
-@@ -1204,7 +1203,6 @@ class PyBuildExt(build_ext):
- define_macros.append(('USE_PYEXPAT_CAPI', None))
- exts.append(Extension('_elementtree',
- define_macros = define_macros,
-- include_dirs = [expatinc],
- sources = ['_elementtree.c'],
- ))
- else:
diff --git a/python-2.6.2-binutils-no-dep.patch b/python-2.6.2-binutils-no-dep.patch
new file mode 100644
index 0000000..57cd07c
--- /dev/null
+++ b/python-2.6.2-binutils-no-dep.patch
@@ -0,0 +1,15 @@
+diff -ru Python-2.6.2-orig/Lib/ctypes/util.py Python-2.6.2/Lib/ctypes/util.py
+--- Python-2.6.2-orig/Lib/ctypes/util.py 2009-01-10 12:11:11.000000000 -0500
++++ Python-2.6.2/Lib/ctypes/util.py 2009-07-30 15:17:39.000000000 -0400
+@@ -133,7 +133,9 @@
+ dump = f.read()
+ rv = f.close()
+ if rv == 10:
+- raise OSError, 'objdump command not found'
++ return os.path.basename(f) # This is good for GLibc, I think,
++ # and a dep on binutils is big (for
++ # live CDs).
+ res = re.search(r'\sSONAME\s+([^\s]+)', os.popen(cmd).read())
+ if not res:
+ return None
+Only in Python-2.6.2/Lib/ctypes: util.py~
diff --git a/python-2.6.2-config.patch b/python-2.6.2-config.patch
new file mode 100644
index 0000000..f7a8616
--- /dev/null
+++ b/python-2.6.2-config.patch
@@ -0,0 +1,323 @@
+diff -ru Python-2.6-orig Python-2.6
+--- Python-2.6.2-orig/Modules/Setup.dist 2008-11-27 05:15:12.000000000 -0500
++++ Python-2.6.2/Modules/Setup.dist 2009-07-30 15:06:59.000000000 -0400
+@@ -152,7 +152,7 @@
+ # modules are to be built as shared libraries (see above for more
+ # detail; also note that *static* reverses this effect):
+
+-#*shared*
++*shared*
+
+ # GNU readline. Unlike previous Python incarnations, GNU readline is
+ # now incorporated in an optional module, configured in the Setup file
+@@ -162,74 +162,74 @@
+ # it, depending on your system -- see the GNU readline instructions.
+ # It's okay for this to be a shared library, too.
+
+-#readline readline.c -lreadline -ltermcap
++readline readline.c -lreadline -ltermcap
+
+
+ # Modules that should always be present (non UNIX dependent):
+
+-#array arraymodule.c # array objects
+-#cmath cmathmodule.c # -lm # complex math library functions
+-#math mathmodule.c # -lm # math library functions, e.g. sin()
+-#_struct _struct.c # binary structure packing/unpacking
+-#time timemodule.c # -lm # time operations and variables
+-#operator operator.c # operator.add() and similar goodies
+-#_weakref _weakref.c # basic weak reference support
+-#_testcapi _testcapimodule.c # Python C API test module
+-#_random _randommodule.c # Random number generator
+-#_collections _collectionsmodule.c # Container types
+-#itertools itertoolsmodule.c # Functions creating iterators for efficient looping
+-#strop stropmodule.c # String manipulations
+-#_functools _functoolsmodule.c # Tools for working with functions and callable objects
+-#_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI
_elementtree.c # elementtree accelerator
+-#_pickle _pickle.c # pickle accelerator
+-#datetime datetimemodule.c # date/time type
+-#_bisect _bisectmodule.c # Bisection algorithms
++array arraymodule.c # array objects
++cmath cmathmodule.c # -lm # complex math library functions
++math mathmodule.c # -lm # math library functions, e.g. sin()
++_struct _struct.c # binary structure packing/unpacking
++time timemodule.c # -lm # time operations and variables
++operator operator.c # operator.add() and similar goodies
++_weakref _weakref.c # basic weak reference support
++_testcapi _testcapimodule.c # Python C API test module
++_random _randommodule.c # Random number generator
++_collections _collectionsmodule.c # Container types
++itertools itertoolsmodule.c # Functions creating iterators for efficient looping
++strop stropmodule.c # String manipulations
++_functools _functoolsmodule.c # Tools for working with functions and callable objects
++_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI
_elementtree.c # elementtree accelerator
++#_pickle _pickle.c # pickle accelerator
++#datetime datetimemodule.c # date/time type
++_bisect _bisectmodule.c # Bisection algorithms
+
+-#unicodedata unicodedata.c # static Unicode character database
++unicodedata unicodedata.c # static Unicode character database
+
+ # access to ISO C locale support
+-#_locale _localemodule.c # -lintl
++_locale _localemodule.c # -lintl
+
+
+ # Modules with some UNIX dependencies -- on by default:
+ # (If you have a really backward UNIX, select and socket may not be
+ # supported...)
+
+-#fcntl fcntlmodule.c # fcntl(2) and ioctl(2)
+-#spwd spwdmodule.c # spwd(3)
+-#grp grpmodule.c # grp(3)
+-#select selectmodule.c # select(2); not on ancient System V
++fcntl fcntlmodule.c # fcntl(2) and ioctl(2)
++spwd spwdmodule.c # spwd(3)
++grp grpmodule.c # grp(3)
++select selectmodule.c # select(2); not on ancient System V
+
+ # Memory-mapped files (also works on Win32).
+-#mmap mmapmodule.c
++mmap mmapmodule.c
+
+ # CSV file helper
+-#_csv _csv.c
++_csv _csv.c
+
+ # Socket module helper for socket(2)
+-#_socket socketmodule.c
++_socket socketmodule.c
+
+ # Socket module helper for SSL support; you must comment out the other
+ # socket line above, and possibly edit the SSL variable:
+ #SSL=/usr/local/ssl
+-#_ssl _ssl.c \
+-# -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
+-# -L$(SSL)/lib -lssl -lcrypto
++_ssl _ssl.c \
++ -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
++ -L$(SSL)/lib -lssl -lcrypto
+
+ # The crypt module is now disabled by default because it breaks builds
+ # on many systems (where -lcrypt is needed), e.g. Linux (I believe).
+ #
+ # First, look at Setup.config; configure may have set this for you.
+
+-#crypt cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some systems
++crypt cryptmodule.c -lcrypt # crypt(3); needs -lcrypt on some systems
+
+
+ # Some more UNIX dependent modules -- off by default, since these
+ # are not supported by all UNIX systems:
+
+-#nis nismodule.c -lnsl # Sun yellow pages -- not everywhere
+-#termios termios.c # Steen Lumholt's termios module
+-#resource resource.c # Jeremy Hylton's rlimit interface
++nis nismodule.c -lnsl # Sun yellow pages -- not everywhere
++termios termios.c # Steen Lumholt's termios module
++resource resource.c # Jeremy Hylton's rlimit interface
+
+
+ # Multimedia modules -- off by default.
+@@ -237,8 +237,8 @@
+ # #993173 says audioop works on 64-bit platforms, though.
+ # These represent audio samples or images as strings:
+
+-#audioop audioop.c # Operations on audio samples
+-#imageop imageop.c # Operations on images
++audioop audioop.c # Operations on audio samples
++imageop imageop.c # Operations on images
+
+
+ # Note that the _md5 and _sha modules are normally only built if the
+@@ -248,14 +248,14 @@
+ # Message-Digest Algorithm, described in RFC 1321. The necessary files
+ # md5.c and md5.h are included here.
+
+-#_md5 md5module.c md5.c
++_md5 md5module.c md5.c
+
+
+ # The _sha module implements the SHA checksum algorithms.
+ # (NIST's Secure Hash Algorithms.)
+-#_sha shamodule.c
+-#_sha256 sha256module.c
+-#_sha512 sha512module.c
++_sha shamodule.c
++_sha256 sha256module.c
++_sha512 sha512module.c
+
+
+ # SGI IRIX specific modules -- off by default.
+@@ -302,12 +302,12 @@
+ # A Linux specific module -- off by default; this may also work on
+ # some *BSDs.
+
+-#linuxaudiodev linuxaudiodev.c
++linuxaudiodev linuxaudiodev.c
+
+
+ # George Neville-Neil's timing module:
+
+-#timing timingmodule.c
++timing timingmodule.c
+
+
+ # The _tkinter module.
+@@ -322,7 +322,7 @@
+ # every system.
+
+ # *** Always uncomment this (leave the leading underscore in!):
+-# _tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \
++_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \
+ # *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
+ # -L/usr/local/lib \
+ # *** Uncomment and edit to reflect where your Tcl/Tk headers are:
+@@ -332,7 +332,7 @@
+ # *** Or uncomment this for Solaris:
+ # -I/usr/openwin/include \
+ # *** Uncomment and edit for Tix extension only:
+-# -DWITH_TIX -ltix8.1.8.2 \
++ -DWITH_TIX -ltix \
+ # *** Uncomment and edit for BLT extension only:
+ # -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \
+ # *** Uncomment and edit for PIL (TkImaging) extension only:
+@@ -341,7 +341,7 @@
+ # *** Uncomment and edit for TOGL extension only:
+ # -DWITH_TOGL togl.c \
+ # *** Uncomment and edit to reflect your Tcl/Tk versions:
+-# -ltk8.2 -ltcl8.2 \
++ -ltk -ltcl \
+ # *** Uncomment and edit to reflect where your X11 libraries are:
+ # -L/usr/X11R6/lib \
+ # *** Or uncomment this for Solaris:
+@@ -351,7 +351,7 @@
+ # *** Uncomment for AIX:
+ # -lld \
+ # *** Always uncomment this; X11 libraries to link with:
+-# -lX11
++ -lX11
+
+ # Lance Ellinghaus's syslog module
+ #syslog syslogmodule.c # syslog daemon interface
+@@ -363,9 +363,9 @@
+ #
+ # First, look at Setup.config; configure may have set this for you.
+
+-#_curses _cursesmodule.c -lcurses -ltermcap
++_curses _cursesmodule.c -lcurses -ltermcap
+ # Wrapper for the panel library that's part of ncurses and SYSV curses.
+-#_curses_panel _curses_panel.c -lpanel -lncurses
++_curses_panel _curses_panel.c -lpanel -lncurses
+
+
+ # Generic (SunOS / SVR4) dynamic loading module.
+@@ -373,7 +373,7 @@
+ # it is a highly experimental and dangerous device for calling
+ # *arbitrary* C functions in *arbitrary* shared libraries:
+
+-#dl dlmodule.c
++dl dlmodule.c
+
+
+ # Modules that provide persistent dictionary-like semantics. You will
+@@ -396,7 +396,7 @@
+ #
+ # First, look at Setup.config; configure may have set this for you.
+
+-#gdbm gdbmmodule.c -I/usr/local/include -L/usr/local/lib -lgdbm
++gdbm gdbmmodule.c -lgdbm
+
+
+ # Sleepycat Berkeley DB interface.
+@@ -412,10 +412,9 @@
+ # Edit the variables DB and DBLIBVERto point to the db top directory
+ # and the subdirectory of PORT where you built it.
+-#DB=/usr/local/BerkeleyDB.4.0
+-#DBLIBVER=4.0
+-#DBINC=$(DB)/include
+-#DBLIB=$(DB)/lib
+-#_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
++DBLIBVER=4.7
++DBINC=/usr/include/db4
++DBLIB=/usr/lib
++_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
+
+ # Historical Berkeley DB 1.85
+ #
+@@ -430,14 +429,14 @@
+
+
+ # Helper module for various ascii-encoders
+-#binascii binascii.c
++binascii binascii.c
+
+ # Fred Drake's interface to the Python parser
+-#parser parsermodule.c
++parser parsermodule.c
+
+ # cStringIO and cPickle
+-#cStringIO cStringIO.c
+-#cPickle cPickle.c
++cStringIO cStringIO.c
++cPickle cPickle.c
+
+
+ # Lee Busby's SIGFPE modules.
+@@ -460,7 +459,7 @@
+ # Andrew Kuchling's zlib module.
+ # This require zlib 1.1.3 (or later).
+ # See
http://www.gzip.org/zlib/
+-#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
++zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
+
+ # Interface to the Expat XML parser
+ #
+@@ -473,20 +472,20 @@
+ #
+ # 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 -DUSE_PYEXPAT_CAPI
+
+
+ # Hye-Shik Chang's CJKCodecs
+
+ # multibytecodec is required for all the other CJK codec modules
+-#_multibytecodec cjkcodecs/multibytecodec.c
++_multibytecodec cjkcodecs/multibytecodec.c
+
+-#_codecs_cn cjkcodecs/_codecs_cn.c
+-#_codecs_hk cjkcodecs/_codecs_hk.c
+-#_codecs_iso2022 cjkcodecs/_codecs_iso2022.c
+-#_codecs_jp cjkcodecs/_codecs_jp.c
+-#_codecs_kr cjkcodecs/_codecs_kr.c
+-#_codecs_tw cjkcodecs/_codecs_tw.c
++_codecs_cn cjkcodecs/_codecs_cn.c
++_codecs_hk cjkcodecs/_codecs_hk.c
++_codecs_iso2022 cjkcodecs/_codecs_iso2022.c
++_codecs_jp cjkcodecs/_codecs_jp.c
++_codecs_kr cjkcodecs/_codecs_kr.c
++_codecs_tw cjkcodecs/_codecs_tw.c
+
+ # Example -- included for reference only:
+ # xx xxmodule.c
+--- Python-2.6.2-orig/setup.py 2009-07-30 14:56:58.000000000 -0400
++++ Python-2.6.2/setup.py 2009-07-30 15:07:39.000000000 -0400
+@@ -1203,7 +1203,6 @@
+
+ exts.append(Extension('pyexpat',
+ define_macros = define_macros,
+- include_dirs = [expatinc],
+ sources = ['pyexpat.c',
+ 'expat/xmlparse.c',
+ 'expat/xmlrole.c',
+@@ -1218,7 +1217,6 @@
+ define_macros.append(('USE_PYEXPAT_CAPI', None))
+ exts.append(Extension('_elementtree',
+ define_macros = define_macros,
+- include_dirs = [expatinc],
+ sources = ['_elementtree.c'],
+ ))
+ else:
+Only in Python-2.6.2: setup.py~
diff --git a/python.spec b/python.spec
index 73c7e48..ebda5d3 100644
--- a/python.spec
+++ b/python.spec
@@ -21,25 +21,24 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
-Version: 2.6
-Release: 11%{?dist}
+Version: 2.6.2
+Release: 1%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
Provides: python(abi) = %{pybasever}
Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
-Patch0: python-2.6-config.patch
+Patch0: python-2.6.2-config.patch
Patch1: Python-2.2.1-pydocnogui.patch
#Patch2: python-2.3.4-pydocnodoc.patch
-Patch3: python-2.6-canonicalize.patch
Patch4: python-2.5-cflags.patch
#Patch5: python-2.5.1-ctypes-exec-stack.patch
Patch6: python-2.5.1-plural-fix.patch
Patch7: python-2.5.1-sqlite-encoding.patch
#Patch8: python-2.5-xmlrpclib-marshal-objects.patch
#Patch9: python-2.5-tkinter.patch
-Patch10: python-2.5.2-binutils-no-dep.patch
+Patch10: python-2.6.2-binutils-no-dep.patch
Patch11: python-2.5.1-codec-ascii-tolower.patch
#Patch12: python-2.5.1-pysqlite.patch
Patch13: python-2.5.1-socketmodule-constants.patch
@@ -204,7 +203,6 @@ code that uses more than just unittest and/or test_support.py.
%patch0 -p1 -b .rhconfig
%patch1 -p1 -b .no_gui
#%%patch2 -p1 -b .no-doc
-%patch3 -p1 -b .canonicalize
%patch4 -p1 -b .cflags
#%%patch5 -p1 -b .ctypesexec
%patch6 -p1 -b .plural
@@ -540,6 +538,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
%changelog
+* Mon Jul 27 2009 James Antill <james.antill(a)redhat.com> - 2.6.2-1
+- Update to 2.6.2
+
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.6-11
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
diff --git a/sources b/sources
index f8ae11e..18adbe6 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-837476958702cb386c657b5dba61cdc5 Python-2.6.tar.bz2
+245db9f1e0f09ab7e0faaa0cf7301011 Python-2.6.2.tar.bz2
commit d62d1afef6874f949ae39f96e9cc3b8cd3e0db8f
Author: Jesse Keating <jkeating(a)fedoraproject.org>
Date: Sun Jul 26 20:00:18 2009 +0000
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
diff --git a/python.spec b/python.spec
index 50e85e7..73c7e48 100644
--- a/python.spec
+++ b/python.spec
@@ -22,7 +22,7 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
Version: 2.6
-Release: 10%{?dist}
+Release: 11%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -540,6 +540,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
%changelog
+* Sun Jul 26 2009 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.6-11
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
+
* Sat Jul 4 2009 Jonathan Steffan <jsteffan(a)fedoraproject.org> - 2.6-10
- Move python-config to devel subpackage (#506153)
- Update BuildRoot for new standard
commit f3e7a450c3abffe6f1f013fb056c82e5f6b5bf09
Author: Jonathan Steffan <jsteffan(a)fedoraproject.org>
Date: Sat Jul 4 21:27:56 2009 +0000
Move python-config to the development package. (BZ#506153)
diff --git a/python.spec b/python.spec
index 5900219..50e85e7 100644
--- a/python.spec
+++ b/python.spec
@@ -22,7 +22,7 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
Version: 2.6
-Release: 9%{?dist}
+Release: 10%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -87,7 +87,7 @@ Obsoletes: python-uuid < 1.31
Provides: python-uuid = 1.31
%endif
-BuildRoot: %{_tmppath}/%{name}-%{version}-root
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: readline-devel, openssl-devel, gmp-devel
BuildRequires: ncurses-devel, gdbm-devel, zlib-devel, expat-devel
BuildRequires: libGL-devel tk tix gcc-c++ libX11-devel glibc-devel
@@ -445,7 +445,9 @@ rm -fr $RPM_BUILD_ROOT
%defattr(-, root, root)
%doc LICENSE README
%{_bindir}/pydoc*
-%{_bindir}/python*
+%{_bindir}/python
+%{_bindir}/python2
+%{_bindir}/python2.6
%{_mandir}/*/*
%dir %{_libdir}/python%{pybasever}
@@ -497,6 +499,8 @@ rm -fr $RPM_BUILD_ROOT
/usr/include/*
%doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit
%dir %{_libdir}/python%{pybasever}/config
+%{_bindir}/python-config
+%{_bindir}/python2.6-config
%{_libdir}/python%{pybasever}/config/*
%{_libdir}/libpython%{pybasever}.so
@@ -536,6 +540,10 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
%changelog
+* Sat Jul 4 2009 Jonathan Steffan <jsteffan(a)fedoraproject.org> - 2.6-10
+- Move python-config to devel subpackage (#506153)
+- Update BuildRoot for new standard
+
* Sun Jun 28 2009 Jonathan Steffan <jsteffan(a)fedoraproject.org> - 2.6-9
- Update python-tools description (#448940)
commit 902d91a5cc5fd813150fa5496f6ec3b0cada771b
Author: Jonathan Steffan <jsteffan(a)fedoraproject.org>
Date: Sun Jun 28 18:43:28 2009 +0000
Fix #448940 - python-tools description.
diff --git a/python.spec b/python.spec
index 08f55a7..5900219 100644
--- a/python.spec
+++ b/python.spec
@@ -22,7 +22,7 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
Version: 2.6
-Release: 8%{?dist}
+Release: 9%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -162,8 +162,9 @@ Provides: python2-tools = %{version}
%endif
%description tools
-The Python package includes several development tools that are used
-to build python programs.
+This package includes several tools to help with the development of Python
+programs, including IDLE (an IDE with editing and debugging facilities), a
+color editor (pynche), and a python gettext program (pygettext.py).
%package -n %{tkinter}
Summary: A graphical user interface for the Python scripting language.
@@ -535,6 +536,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
%changelog
+* Sun Jun 28 2009 Jonathan Steffan <jsteffan(a)fedoraproject.org> - 2.6-9
+- Update python-tools description (#448940)
+
* Wed Apr 15 2009 Ignacio Vazquez-Abrams <ivazqueznet+rpm(a)gmail.com> 2.6-8
- Replace python-hashlib and python-uuid (#484715)
commit 70aee9fc392c24ee11005467674f04fe1174265c
Author: Ignacio Vazquez-Abrams <ivazquez(a)fedoraproject.org>
Date: Wed Apr 15 19:37:04 2009 +0000
Replace python-hashlib and python-uuid (#484715)
diff --git a/python.spec b/python.spec
index 87da4ac..08f55a7 100644
--- a/python.spec
+++ b/python.spec
@@ -22,7 +22,7 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
Version: 2.6
-Release: 7%{?dist}
+Release: 8%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -81,6 +81,10 @@ Obsoletes: python-sqlite < 2.3.2
Provides: python-sqlite = 2.3.2
Obsoletes: python-ctypes < 1.0.1
Provides: python-ctypes = 1.0.1
+Obsoletes: python-hashlib < 20081120
+Provides: python-hashlib = 20081120
+Obsoletes: python-uuid < 1.31
+Provides: python-uuid = 1.31
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-root
@@ -531,6 +535,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
%changelog
+* Wed Apr 15 2009 Ignacio Vazquez-Abrams <ivazqueznet+rpm(a)gmail.com> 2.6-8
+- Replace python-hashlib and python-uuid (#484715)
+
* Tue Mar 17 2009 James Antill <james(a)fedoraproject.org> - 2.6-7
- Use system libffi
- Resolves: bug#490573
commit 46f141e1042c041a91942ac10cc5ce34303bec85
Author: James Antill <james(a)fedoraproject.org>
Date: Tue Mar 17 15:38:27 2009 +0000
- Use system libffi
- Resolves: bug#490573
- Fix SELinux execmem problems
- Resolves: bug#488396
diff --git a/python-2.6-ctypes-noexecmem.patch b/python-2.6-ctypes-noexecmem.patch
new file mode 100644
index 0000000..9ce5c0b
--- /dev/null
+++ b/python-2.6-ctypes-noexecmem.patch
@@ -0,0 +1,85 @@
+diff -ur Python-2.6~/Modules/_ctypes/callbacks.c Python-2.6/Modules/_ctypes/callbacks.c
+--- Python-2.6~/Modules/_ctypes/callbacks.c 2008-06-09 00:58:54.000000000 -0400
++++ Python-2.6/Modules/_ctypes/callbacks.c 2009-03-17 00:08:38.424528546 -0400
+@@ -21,8 +21,8 @@
+ Py_XDECREF(self->converters);
+ Py_XDECREF(self->callable);
+ Py_XDECREF(self->restype);
+- if (self->pcl)
+- FreeClosure(self->pcl);
++ if (self->pcl_write)
++ ffi_closure_free(self->pcl_write);
+ PyObject_Del(self);
+ }
+
+@@ -373,7 +373,8 @@
+ return NULL;
+ }
+
+- p->pcl = NULL;
++ p->pcl_exec = NULL;
++ p->pcl_write = NULL;
+ memset(&p->cif, 0, sizeof(p->cif));
+ p->converters = NULL;
+ p->callable = NULL;
+@@ -402,8 +403,9 @@
+
+ assert(CThunk_CheckExact(p));
+
+- p->pcl = MallocClosure();
+- if (p->pcl == NULL) {
++ p->pcl_write = ffi_closure_alloc(sizeof(ffi_closure),
++ &p->pcl_exec);
++ if (p->pcl_write == NULL) {
+ PyErr_NoMemory();
+ goto error;
+ }
+@@ -448,7 +450,9 @@
+ "ffi_prep_cif failed with %d", result);
+ goto error;
+ }
+- result = ffi_prep_closure(p->pcl, &p->cif, closure_fcn, p);
++ result = ffi_prep_closure_loc(p->pcl_write, &p->cif, closure_fcn,
++ p,
++ p->pcl_exec);
+ if (result != FFI_OK) {
+ PyErr_Format(PyExc_RuntimeError,
+ "ffi_prep_closure failed with %d", result);
+diff -ur Python-2.6~/Modules/_ctypes/_ctypes.c Python-2.6/Modules/_ctypes/_ctypes.c
+--- Python-2.6~/Modules/_ctypes/_ctypes.c 2008-08-19 15:40:23.000000000 -0400
++++ Python-2.6/Modules/_ctypes/_ctypes.c 2009-03-17 00:08:38.479530502 -0400
+@@ -3438,7 +3438,7 @@
+ self->callable = callable;
+
+ self->thunk = thunk;
+- *(void **)self->b_ptr = (void *)thunk->pcl;
++ *(void **)self->b_ptr = (void *)thunk->pcl_exec;
+
+ Py_INCREF((PyObject *)thunk); /* for KeepRef */
+ if (-1 == KeepRef((CDataObject *)self, 0, (PyObject *)thunk)) {
+diff -ur Python-2.6~/Modules/_ctypes/ctypes.h Python-2.6/Modules/_ctypes/ctypes.h
+--- Python-2.6~/Modules/_ctypes/ctypes.h 2008-07-24 07:16:45.000000000 -0400
++++ Python-2.6/Modules/_ctypes/ctypes.h 2009-03-17 00:08:38.480528344 -0400
+@@ -95,7 +95,8 @@
+
+ typedef struct {
+ PyObject_VAR_HEAD
+- ffi_closure *pcl; /* the C callable */
++ ffi_closure *pcl_write; /* the C callable, writeable */
++ void *pcl_exec; /* the C callable, executable */
+ ffi_cif cif;
+ int flags;
+ PyObject *converters;
+diff -ur Python-2.6~/setup.py Python-2.6/setup.py
+--- Python-2.6~/setup.py 2009-03-17 00:07:54.771651851 -0400
++++ Python-2.6/setup.py 2009-03-17 00:08:19.792558478 -0400
+@@ -1701,8 +1701,7 @@
+ '_ctypes/callbacks.c',
+ '_ctypes/callproc.c',
+ '_ctypes/stgdict.c',
+- '_ctypes/cfield.c',
+- '_ctypes/malloc_closure.c']
++ '_ctypes/cfield.c']
+ depends = ['_ctypes/ctypes.h']
+
+ if sys.platform == 'darwin':
diff --git a/python.spec b/python.spec
index b19ca72..87da4ac 100644
--- a/python.spec
+++ b/python.spec
@@ -62,7 +62,7 @@ Patch101: python-2.3.4-lib64-regex.patch
Patch102: python-2.6-lib64.patch
# SELinux patches
-Patch110: python-2.6-lib64.patch
+Patch110: python-2.6-ctypes-noexecmem.patch
# New API from 2.6
#Patch260: python-2.5.2-set_wakeup_fd4.patch
commit bf04731dee59d724df9a44add58c348593b57e6a
Author: James Antill <james(a)fedoraproject.org>
Date: Tue Mar 17 15:18:18 2009 +0000
- Use system libffi
- Resolves: bug#490573
- Fix SELinux execmem problems
- Resolves: bug#488396
diff --git a/python.spec b/python.spec
index bf81bc9..b19ca72 100644
--- a/python.spec
+++ b/python.spec
@@ -22,7 +22,7 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
Version: 2.6
-Release: 6%{?dist}
+Release: 7%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -61,6 +61,9 @@ Patch51: python-2.6-distutils_rpm.patch
Patch101: python-2.3.4-lib64-regex.patch
Patch102: python-2.6-lib64.patch
+# SELinux patches
+Patch110: python-2.6-lib64.patch
+
# New API from 2.6
#Patch260: python-2.5.2-set_wakeup_fd4.patch
@@ -227,6 +230,8 @@ code that uses more than just unittest and/or test_support.py.
%patch101 -p1 -b .lib64-regex
%endif
+%patch110 -p1 -b .selinux
+
#%%patch260 -p1 -b .set_wakeup_fd
#%%patch999 -p1 -b .cve2007-4965
@@ -526,9 +531,11 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
%changelog
-* Tue Mar 17 2009 James Antill <james(a)fedoraproject.org> - 2.6-6
+* Tue Mar 17 2009 James Antill <james(a)fedoraproject.org> - 2.6-7
- Use system libffi
- Resolves: bug#490573
+- Fix SELinux execmem problems
+- Resolves: bug#488396
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.6-5
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
commit 5832745d3894ef80083e76cf0bc94d52bbd3cd2a
Author: James Antill <james(a)fedoraproject.org>
Date: Tue Mar 17 14:05:09 2009 +0000
- Use system libffi
- Resolves: bug#490573
diff --git a/python.spec b/python.spec
index c63aba8..bf81bc9 100644
--- a/python.spec
+++ b/python.spec
@@ -23,7 +23,6 @@ Summary: An interpreted, interactive, object-oriented programming
language
Name: %{python}
Version: 2.6
Release: 6%{?dist}
-Release: 5%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
commit 881934a20777eb0fce0db0b12fa1812b4970b30d
Author: James Antill <james(a)fedoraproject.org>
Date: Tue Mar 17 14:04:03 2009 +0000
- Use system libffi
- Resolves: bug#490573
diff --git a/python.spec b/python.spec
index 98b16be..c63aba8 100644
--- a/python.spec
+++ b/python.spec
@@ -22,6 +22,7 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
Version: 2.6
+Release: 6%{?dist}
Release: 5%{?dist}
License: Python
Group: Development/Languages
@@ -88,6 +89,7 @@ BuildRequires: bzip2 tar /usr/bin/find pkgconfig tcl-devel tk-devel
BuildRequires: tix-devel bzip2-devel sqlite-devel
BuildRequires: autoconf
BuildRequires: db4-devel >= 4.7
+BuildRequires: libffi-devel
URL:
http://www.python.org/
@@ -238,6 +240,7 @@ find -name "*~" |xargs rm -f
topdir=`pwd`
export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC"
export CXXFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC"
+export CPPFLAGS="`pkg-config --cflags-only-I libffi`"
export OPT="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC"
export LINKCC="gcc"
if pkg-config openssl ; then
@@ -248,7 +251,7 @@ fi
export CC=gcc
# For patch 4, need to get a newer configure generated out of configure.in
autoconf
-%configure --enable-ipv6 --enable-unicode=%{unicode} --enable-shared
+%configure --enable-ipv6 --enable-unicode=%{unicode} --enable-shared --with-system-ffi
make OPT="$CFLAGS" %{?_smp_mflags}
LD_LIBRARY_PATH=$topdir $topdir/python Tools/scripts/pathfix.py -i "%{_bindir}/env
python%{pybasever}" .
@@ -524,6 +527,10 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
%changelog
+* Tue Mar 17 2009 James Antill <james(a)fedoraproject.org> - 2.6-6
+- Use system libffi
+- Resolves: bug#490573
+
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.6-5
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
commit 9b39cdbf0336db3edff82e573ec625f097184972
Author: Jesse Keating <jkeating(a)fedoraproject.org>
Date: Thu Feb 26 20:29:13 2009 +0000
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
diff --git a/python.spec b/python.spec
index fc794f7..98b16be 100644
--- a/python.spec
+++ b/python.spec
@@ -22,7 +22,7 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
Version: 2.6
-Release: 4%{?dist}
+Release: 5%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -524,6 +524,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
%changelog
+* Thu Feb 26 2009 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> -
2.6-5
+- Rebuilt for
https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
+
* Fri Jan 16 2009 Tomas Mraz <tmraz(a)redhat.com> - 2.6-4
- rebuild with new openssl
commit ea2454b81420fed23439b0ee5f35b2b83a6e3985
Author: Tom Mrz <tmraz(a)fedoraproject.org>
Date: Fri Jan 16 15:33:31 2009 +0000
- rebuild with new openssl
diff --git a/python.spec b/python.spec
index 1283d3a..fc794f7 100644
--- a/python.spec
+++ b/python.spec
@@ -22,7 +22,7 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
Version: 2.6
-Release: 3%{?dist}
+Release: 4%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -524,6 +524,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
%changelog
+* Fri Jan 16 2009 Tomas Mraz <tmraz(a)redhat.com> - 2.6-4
+- rebuild with new openssl
+
* Tue Jan 6 2009 James Antill <james.antill(a)redhat.com> - 2.6-3
- Fix distutils generated rpms.
- Resolves: bug#236535
commit 5e852d723644703c86b1c0c765926ac633ae7959
Author: James Antill <james(a)fedoraproject.org>
Date: Tue Jan 6 20:05:07 2009 +0000
- Fix distutils generated rpms.
- Resolves: bug#236535
diff --git a/python-2.6-distutils_rpm.patch b/python-2.6-distutils_rpm.patch
new file mode 100644
index 0000000..296bdaf
--- /dev/null
+++ b/python-2.6-distutils_rpm.patch
@@ -0,0 +1,12 @@
+diff -ru Python-2.6-orig/Lib/distutils/command/bdist_rpm.py
Python-2.6/Lib/distutils/command/bdist_rpm.py
+--- Python-2.6-orig/Lib/distutils/command/bdist_rpm.py 2008-02-23 12:40:11.000000000
-0500
++++ Python-2.6/Lib/distutils/command/bdist_rpm.py 2009-01-06 15:02:18.000000000 -0500
+@@ -493,6 +493,7 @@
+ ('build', 'build_script', def_build),
+ ('install', 'install_script',
+ ("%s install "
++ "-O1 "
+ "--root=$RPM_BUILD_ROOT "
+ "--record=INSTALLED_FILES") % def_setup_call),
+ ('clean', 'clean_script', "rm -rf
$RPM_BUILD_ROOT"),
+Only in Python-2.6/Lib/distutils/command: bdist_rpm.py~
diff --git a/python.spec b/python.spec
index 7c639bd..1283d3a 100644
--- a/python.spec
+++ b/python.spec
@@ -22,7 +22,7 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
Version: 2.6
-Release: 2%{?dist}
+Release: 3%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -47,6 +47,9 @@ Patch14: python-2.5.1-socketmodule-constants2.patch
#Patch15: python-2.5.1-listdir.patch
Patch16: python-2.6-rpath.patch
+# Fix distutils to follow the Fedora/RHEL/CentOS policies of having .pyo files
+Patch51: python-2.6-distutils_rpm.patch
+
# upstreamed
#Patch50: python-2.5-disable-egginfo.patch
@@ -216,6 +219,8 @@ code that uses more than just unittest and/or test_support.py.
#%%patch15 -p1 -b .listdir
%patch16 -p1 -b .rpath
+%patch51 -p1 -b .brprpm
+
%ifarch alpha ia64
# 64bit, but not lib64 arches need this too...
%patch101 -p1 -b .lib64-regex
@@ -519,13 +524,17 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
%changelog
+* Tue Jan 6 2009 James Antill <james.antill(a)redhat.com> - 2.6-3
+- Fix distutils generated rpms.
+- Resolves: bug#236535
+
* Wed Dec 10 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm(a)gmail.com> - 2.6-2
- Enable -lcrypt for cryptmodule
* Fri Nov 28 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm(a)gmail.com> - 2.6-1
- Update to 2.6
-* Tue Sep 30 2008 James Antill <katzj(a)redhat.com> - 2.5.2-1
+* Tue Sep 30 2008 James Antill <james.antill(a)redhat.com> - 2.5.2-1
- Move to 2.5.2
- Fix CVE-2008-2316 hashlib overflow.
commit 1e29b88416ce92a958b44c7a2a52eafed5a363ac
Author: Ignacio Vazquez-Abrams <ivazquez(a)fedoraproject.org>
Date: Wed Dec 10 20:16:00 2008 +0000
Enable -lcrypt for cryptmodule
diff --git a/python-2.6-config.patch b/python-2.6-config.patch
index 59347c9..387eecb 100644
--- a/python-2.6-config.patch
+++ b/python-2.6-config.patch
@@ -117,7 +117,7 @@ diff -up Python-2.6/Modules/Setup.dist.rhconfig
Python-2.6/Modules/Setup.dist
# First, look at Setup.config; configure may have set this for you.
-#crypt cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some systems
-+crypt cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some systems
++crypt cryptmodule.c -lcrypt # crypt(3); needs -lcrypt on some systems
# Some more UNIX dependent modules -- off by default, since these
diff --git a/python.spec b/python.spec
index 6d323e3..7c639bd 100644
--- a/python.spec
+++ b/python.spec
@@ -22,7 +22,7 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
Version: 2.6
-Release: 1%{?dist}
+Release: 2%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -519,6 +519,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
%changelog
+* Wed Dec 10 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm(a)gmail.com> - 2.6-2
+- Enable -lcrypt for cryptmodule
+
* Fri Nov 28 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm(a)gmail.com> - 2.6-1
- Update to 2.6
commit a7ef9c10676ff6962059b5e9c605b483a6ff803f
Author: Ignacio Vazquez-Abrams <ivazquez(a)fedoraproject.org>
Date: Sat Nov 29 02:03:47 2008 +0000
Update to 2.6
diff --git a/.cvsignore b/.cvsignore
index 4446147..0f3d7fb 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -1 +1 @@
-Python-2.5.2.tar.bz2
+Python-2.6.tar.bz2
diff --git a/import.log b/import.log
new file mode 100644
index 0000000..39ae828
--- /dev/null
+++ b/import.log
@@ -0,0 +1 @@
+python-2_6-1:HEAD:python-2.6-1.src.rpm:1227924213
diff --git a/python-2.3.4-pydocnodoc.patch b/python-2.3.4-pydocnodoc.patch
deleted file mode 100644
index f2c1af3..0000000
--- a/python-2.3.4-pydocnodoc.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- Python-2.3.4/Lib/pydoc.py.no-doc 2004-07-16 11:29:01.000000000 -0400
-+++ Python-2.3.4/Lib/pydoc.py 2004-07-16 11:32:52.000000000 -0400
-@@ -1524,6 +1524,7 @@
- homedir = os.environ.get('PYTHONHOME')
- for dir in [os.environ.get('PYTHONDOCS'),
- homedir and os.path.join(homedir, 'doc'),
-+ '/usr/share/doc/python-docs-%s/html' %
split(sys.version)[0],
- os.path.join(execdir, 'doc'),
- '/usr/doc/python-docs-' + split(sys.version)[0],
- '/usr/doc/python-' + split(sys.version)[0],
diff --git a/python-2.4.1-canonicalize.patch b/python-2.4.1-canonicalize.patch
deleted file mode 100644
index 4127359..0000000
--- a/python-2.4.1-canonicalize.patch
+++ /dev/null
@@ -1,121 +0,0 @@
---- Python-2.4.1/pyconfig.h.in.canonicalize 2004-10-13 11:30:55.000000000 -0400
-+++ Python-2.4.1/pyconfig.h.in 2005-10-06 14:04:06.000000000 -0400
-@@ -58,6 +58,9 @@
- /* Define if pthread_sigmask() does not work on your system. */
- #undef HAVE_BROKEN_PTHREAD_SIGMASK
-
-+/* Define to 1 if you have the `canonicalize_file_name' function. */
-+#undef HAVE_CANONICALIZE_FILE_NAME
-+
- /* Define to 1 if you have the `chown' function. */
- #undef HAVE_CHOWN
-
---- Python-2.4.1/Python/sysmodule.c.canonicalize 2005-01-27 13:58:30.000000000 -0500
-+++ Python-2.4.1/Python/sysmodule.c 2005-10-06 14:56:37.000000000 -0400
-@@ -1168,11 +1168,13 @@
- void
- PySys_SetArgv(int argc, char **argv)
- {
-+#ifndef HAVE_CANONICALIZE_FILE_NAME
- #if defined(HAVE_REALPATH)
- char fullpath[MAXPATHLEN];
- #elif defined(MS_WINDOWS)
- char fullpath[MAX_PATH];
- #endif
-+#endif
- PyObject *av = makeargvobject(argc, argv);
- PyObject *path = PySys_GetObject("path");
- if (av == NULL)
-@@ -1184,6 +1186,64 @@
- char *p = NULL;
- int n = 0;
- PyObject *a;
-+#ifdef HAVE_CANONICALIZE_FILE_NAME
-+ char *link = NULL, *argv0copy = NULL;
-+
-+ if (argc > 0 && argv0 != NULL) {
-+
-+ link = canonicalize_file_name(argv0);
-+ if (link == NULL) {
-+ link = strdup(argv0);
-+ if (!link)
-+ Py_FatalError("no mem for sys.argv");
-+ }
-+ }
-+ if (link) {
-+ if (link[0] == SEP) /* Link to absolute path */
-+ argv0 = link;
-+ else if (strchr(link, SEP) == NULL) {
-+ /* Link without path */
-+ /* strdup argv0 so we can free it
-+ unconditionally */
-+ argv0 = strdup(argv0);
-+ if (!argv0)
-+ Py_FatalError("no mem for sys.argv");
-+ free(link);
-+ } else {
-+ /* Must join(dirname(argv0), link) */
-+ char *q = strrchr(argv0, SEP);
-+ if (q == NULL) /* argv0 without path */
-+ argv0 = link;
-+ else {
-+ /* Must make a copy */
-+ argv0copy = calloc(
-+ strlen(link) + strlen(q) +1,
-+ sizeof (char));
-+ if (!argv0copy)
-+ Py_FatalError("no mem for sys.argv");
-+ strcpy(argv0copy, argv0);
-+ q = strrchr(argv0copy, SEP);
-+ strcpy(argv0copy+1, link);
-+ argv0 = argv0copy;
-+ p = NULL;
-+ free(link);
-+ }
-+ }
-+ }
-+ if (argc > 0 && argv0 != NULL) {
-+ char *q;
-+ p = strrchr(argv0, SEP);
-+ /* Test for alternate separator */
-+ q = strrchr(p ? p : argv0, '/');
-+ if (q != NULL)
-+ p = q;
-+ if (p != NULL) {
-+ n = p + 1 - argv0;
-+ if (n > 1 && p[-1] != ':')
-+ n--; /* Drop trailing separator */
-+ }
-+ }
-+#else /* ! HAVE_CANONICALIZE_FILE_NAME */
- #ifdef HAVE_READLINK
- char link[MAXPATHLEN+1];
- char argv0copy[2*MAXPATHLEN+1];
-@@ -1256,9 +1316,14 @@
- #endif /* Unix */
- }
- #endif /* All others */
-+#endif /* ! HAVE_CANONICALIZE_FILE_NAME */
- a = PyString_FromStringAndSize(argv0, n);
- if (a == NULL)
- Py_FatalError("no mem for sys.path insertion");
-+#ifdef HAVE_CANONICALIZE_FILE_NAME
-+ if (argc > 0 && argv0 != NULL)
-+ free(argv0);
-+#endif /* HAVE_CANONICALIZE_FILE_NAME */
- if (PyList_Insert(path, 0, a) < 0)
- Py_FatalError("sys.path.insert(0) failed");
- Py_DECREF(a);
---- Python-2.4.1/configure.in.canonicalize 2005-03-28 18:23:34.000000000 -0500
-+++ Python-2.4.1/configure.in 2005-10-06 14:04:06.000000000 -0400
-@@ -2096,8 +2096,8 @@
- AC_MSG_RESULT(MACHDEP_OBJS)
-
- # checks for library functions
--AC_CHECK_FUNCS(alarm bind_textdomain_codeset chown clock confstr ctermid \
-- execv fork fpathconf ftime ftruncate \
-+AC_CHECK_FUNCS(alarm bind_textdomain_codeset canonicalize_file_name chown \
-+ clock confstr ctermid execv fork fpathconf ftime ftruncate \
- gai_strerror getgroups getlogin getloadavg getpeername getpgid getpid \
- getpriority getpwent getsid getwd \
- kill killpg lchown lstat mkfifo mknod mktime \
diff --git a/python-2.5-CVE-2008-2316.patch b/python-2.5-CVE-2008-2316.patch
deleted file mode 100644
index 450354b..0000000
--- a/python-2.5-CVE-2008-2316.patch
+++ /dev/null
@@ -1,156 +0,0 @@
-Index: Lib/test/test_hashlib.py
-===================================================================
---- Lib/test/test_hashlib.py (revision 64642)
-+++ Lib/test/test_hashlib.py (working copy)
-@@ -9,8 +9,8 @@
- import hashlib
- import unittest
- from test import test_support
-+from test.test_support import _4G, precisionbigmemtest
-
--
- def hexstr(s):
- import string
- h = string.hexdigits
-@@ -55,7 +55,6 @@
- m2.update(aas + bees + cees)
- self.assertEqual(m1.digest(), m2.digest())
-
--
- def check(self, name, data, digest):
- # test the direct constructors
- computed = getattr(hashlib, name)(data).hexdigest()
-@@ -74,8 +73,23 @@
- def test_case_md5_2(self):
- self.check('md5',
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',
- 'd174ab98d277d9f5a5611c2c9f419d9f')
-+
-+ @precisionbigmemtest(size=_4G + 5, memuse=1)
-+ def test_case_md5_huge(self, size):
-+ if size == _4G + 5:
-+ try:
-+ self.check('md5', 'A'*size,
'c9af2dff37468ce5dfee8f2cfc0a9c6d')
-+ except OverflowError:
-+ pass # 32-bit arch
-+
-+ @precisionbigmemtest(size=_4G - 1, memuse=1)
-+ def test_case_md5_uintmax(self, size):
-+ if size == _4G - 1:
-+ try:
-+ self.check('md5', 'A'*size,
'28138d306ff1b8281f1a9067e1a1a2b3')
-+ except OverflowError:
-+ pass # 32-bit arch
-
--
- # use the three examples from Federal Information Processing Standards
- # Publication 180-1, Secure Hash Standard, 1995 April 17
- #
http://www.itl.nist.gov/div897/pubs/fip180-1.htm
-Index: Modules/_hashopenssl.c
-===================================================================
---- Modules/_hashopenssl.c (revision 64642)
-+++ Modules/_hashopenssl.c (working copy)
-@@ -19,7 +19,9 @@
- /* EVP is the preferred interface to hashing in OpenSSL */
- #include <openssl/evp.h>
-
-+#define MUNCH_SIZE INT_MAX
-
-+
- #ifndef HASH_OBJ_CONSTRUCTOR
- #define HASH_OBJ_CONSTRUCTOR 0
- #endif
-@@ -164,9 +166,18 @@
- if (!PyArg_ParseTuple(args, "s#:update", &cp, &len))
- return NULL;
-
-+ if (len > 0 && len <= MUNCH_SIZE) {
- EVP_DigestUpdate(&self->ctx, cp, Py_SAFE_DOWNCAST(len, Py_ssize_t,
- unsigned int));
--
-+ } else {
-+ Py_ssize_t offset = 0;
-+ while (len) {
-+ unsigned int process = len > MUNCH_SIZE ? MUNCH_SIZE : len;
-+ EVP_DigestUpdate(&self->ctx, cp + offset, process);
-+ len -= process;
-+ offset += process;
-+ }
-+ }
- Py_INCREF(Py_None);
- return Py_None;
- }
-@@ -255,10 +266,21 @@
- self->name = name_obj;
- Py_INCREF(self->name);
-
-- if (cp && len)
-+ if (cp && len) {
-+ if (len > 0 && len <= MUNCH_SIZE) {
- EVP_DigestUpdate(&self->ctx, cp, Py_SAFE_DOWNCAST(len, Py_ssize_t,
- unsigned int));
--
-+ } else {
-+ Py_ssize_t offset = 0;
-+ while (len) {
-+ unsigned int process = len > MUNCH_SIZE ? MUNCH_SIZE : len;
-+ EVP_DigestUpdate(&self->ctx, cp + offset, process);
-+ len -= process;
-+ offset += process;
-+ }
-+ }
-+ }
-+
- return 0;
- }
- #endif
-@@ -328,7 +350,7 @@
- static PyObject *
- EVPnew(PyObject *name_obj,
- const EVP_MD *digest, const EVP_MD_CTX *initial_ctx,
-- const unsigned char *cp, unsigned int len)
-+ const unsigned char *cp, Py_ssize_t len)
- {
- EVPobject *self;
-
-@@ -346,8 +368,20 @@
- EVP_DigestInit(&self->ctx, digest);
- }
-
-- if (cp && len)
-- EVP_DigestUpdate(&self->ctx, cp, len);
-+ if (cp && len) {
-+ if (len > 0 && len <= MUNCH_SIZE) {
-+ EVP_DigestUpdate(&self->ctx, cp, Py_SAFE_DOWNCAST(len, Py_ssize_t,
-+ unsigned int));
-+ } else {
-+ Py_ssize_t offset = 0;
-+ while (len) {
-+ unsigned int process = len > MUNCH_SIZE ? MUNCH_SIZE : len;
-+ EVP_DigestUpdate(&self->ctx, cp + offset, process);
-+ len -= process;
-+ offset += process;
-+ }
-+ }
-+ }
-
- return (PyObject *)self;
- }
-@@ -384,8 +418,7 @@
-
- digest = EVP_get_digestbyname(name);
-
-- return EVPnew(name_obj, digest, NULL, cp, Py_SAFE_DOWNCAST(len, Py_ssize_t,
-- unsigned int));
-+ return EVPnew(name_obj, digest, NULL, cp, len);
- }
-
- /*
-@@ -410,7 +443,7 @@
- CONST_ ## NAME ## _name_obj, \
- NULL, \
- CONST_new_ ## NAME ## _ctx_p, \
-- cp, Py_SAFE_DOWNCAST(len, Py_ssize_t, unsigned int)); \
-+ cp, len); \
- }
-
- /* a PyMethodDef structure for the constructor */
diff --git a/python-2.5-config.patch b/python-2.5-config.patch
deleted file mode 100644
index 20b0573..0000000
--- a/python-2.5-config.patch
+++ /dev/null
@@ -1,332 +0,0 @@
---- Python-2.5.1/Include/pyexpat.h.rhconfig 2006-06-19 19:21:25.000000000 -0400
-+++ Python-2.5.1/Include/pyexpat.h 2007-06-27 10:12:45.000000000 -0400
-@@ -5,6 +5,19 @@
-
- #define PyExpat_CAPI_MAGIC "pyexpat.expat_CAPI 1.0"
-
-+#ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */
-+#if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400
-+typedef __int64 XML_Index;
-+typedef unsigned __int64 XML_Size;
-+#else
-+typedef long long XML_Index;
-+typedef unsigned long long XML_Size;
-+#endif
-+#else
-+typedef long XML_Index;
-+typedef unsigned long XML_Size;
-+#endif /* XML_LARGE_SIZE */
-+
- struct PyExpat_CAPI
- {
- char* magic; /* set to PyExpat_CAPI_MAGIC */
---- Python-2.5.1/Modules/Setup.dist.rhconfig 2006-08-06 03:26:21.000000000 -0400
-+++ Python-2.5.1/Modules/Setup.dist 2007-06-27 10:12:45.000000000 -0400
-@@ -149,7 +149,7 @@ GLHACK=-Dclear=__GLclear
- # modules are to be built as shared libraries (see above for more
- # detail; also note that *static* reverses this effect):
-
--#*shared*
-+*shared*
-
- # GNU readline. Unlike previous Python incarnations, GNU readline is
- # now incorporated in an optional module, configured in the Setup file
-@@ -159,69 +159,69 @@ GLHACK=-Dclear=__GLclear
- # it, depending on your system -- see the GNU readline instructions.
- # It's okay for this to be a shared library, too.
-
--#readline readline.c -lreadline -ltermcap
-+readline readline.c -lreadline -lncursesw
-
-
- # Modules that should always be present (non UNIX dependent):
-
--#array arraymodule.c # array objects
--#cmath cmathmodule.c # -lm # complex math library functions
--#math mathmodule.c # -lm # math library functions, e.g. sin()
--#_struct _struct.c # binary structure packing/unpacking
--#time timemodule.c # -lm # time operations and variables
--#operator operator.c # operator.add() and similar goodies
--#_weakref _weakref.c # basic weak reference support
--#_testcapi _testcapimodule.c # Python C API test module
--#_random _randommodule.c # Random number generator
--#collections collectionsmodule.c # Container types
--#itertools itertoolsmodule.c # Functions creating iterators for efficient looping
--#strop stropmodule.c # String manipulations
-+array arraymodule.c # array objects
-+cmath cmathmodule.c # -lm # complex math library functions
-+math mathmodule.c # -lm # math library functions, e.g. sin()
-+_struct _struct.c # binary structure packing/unpacking
-+time timemodule.c # -lm # time operations and variables
-+operator operator.c # operator.add() and similar goodies
-+_weakref _weakref.c # basic weak reference support
-+_testcapi _testcapimodule.c # Python C API test module
-+_random _randommodule.c # Random number generator
-+collections collectionsmodule.c # Container types
-+itertools itertoolsmodule.c # Functions creating iterators for efficient looping
-+strop stropmodule.c # String manipulations
-
--#unicodedata unicodedata.c # static Unicode character database
-+unicodedata unicodedata.c # static Unicode character database
-
- # access to ISO C locale support
--#_locale _localemodule.c # -lintl
-+_locale _localemodule.c # -lintl
-
-
- # Modules with some UNIX dependencies -- on by default:
- # (If you have a really backward UNIX, select and socket may not be
- # supported...)
-
--#fcntl fcntlmodule.c # fcntl(2) and ioctl(2)
--#spwd spwdmodule.c # spwd(3)
--#grp grpmodule.c # grp(3)
--#select selectmodule.c # select(2); not on ancient System V
-+fcntl fcntlmodule.c # fcntl(2) and ioctl(2)
-+spwd spwdmodule.c # spwd(3)
-+grp grpmodule.c # grp(3)
-+select selectmodule.c # select(2); not on ancient System V
-
- # Memory-mapped files (also works on Win32).
--#mmap mmapmodule.c
-+mmap mmapmodule.c
-
- # CSV file helper
--#_csv _csv.c
-+_csv _csv.c
-
- # Socket module helper for socket(2)
--#_socket socketmodule.c
-+_socket socketmodule.c
-
- # Socket module helper for SSL support; you must comment out the other
- # socket line above, and possibly edit the SSL variable:
- #SSL=/usr/local/ssl
--#_ssl _ssl.c \
--# -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
--# -L$(SSL)/lib -lssl -lcrypto
-+_ssl _ssl.c \
-+ -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-+ -L$(SSL)/lib -lssl -lcrypto
-
- # The crypt module is now disabled by default because it breaks builds
- # on many systems (where -lcrypt is needed), e.g. Linux (I believe).
- #
- # First, look at Setup.config; configure may have set this for you.
-
--#crypt cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some systems
-+crypt cryptmodule.c -lcrypt # crypt(3); needs -lcrypt on some systems
-
-
- # Some more UNIX dependent modules -- off by default, since these
- # are not supported by all UNIX systems:
-
--#nis nismodule.c -lnsl # Sun yellow pages -- not everywhere
--#termios termios.c # Steen Lumholt's termios module
--#resource resource.c # Jeremy Hylton's rlimit interface
-+nis nismodule.c -lnsl # Sun yellow pages -- not everywhere
-+termios termios.c # Steen Lumholt's termios module
-+resource resource.c # Jeremy Hylton's rlimit interface
-
-
- # Multimedia modules -- off by default.
-@@ -229,9 +229,9 @@ GLHACK=-Dclear=__GLclear
- # #993173 says audioop works on 64-bit platforms, though.
- # These represent audio samples or images as strings:
-
--#audioop audioop.c # Operations on audio samples
--#imageop imageop.c # Operations on images
--#rgbimg rgbimgmodule.c # Read SGI RGB image files (but coded portably)
-+audioop audioop.c # Operations on audio samples
-+imageop imageop.c # Operations on images
-+rgbimg rgbimgmodule.c # Read SGI RGB image files (but coded portably)
-
-
- # Note that the _md5 and _sha modules are normally only built if the
-@@ -241,12 +241,12 @@ GLHACK=-Dclear=__GLclear
- # Message-Digest Algorithm, described in RFC 1321. The necessary files
- # md5.c and md5.h are included here.
-
--#_md5 md5module.c md5.c
-+_md5 md5module.c md5.c
-
-
- # The _sha module implements the SHA checksum algorithm.
- # (NIST's Secure Hash Algorithm.)
--#_sha shamodule.c
-+_sha shamodule.c
-
-
- # SGI IRIX specific modules -- off by default.
-@@ -293,12 +293,12 @@ GLHACK=-Dclear=__GLclear
- # A Linux specific module -- off by default; this may also work on
- # some *BSDs.
-
--#linuxaudiodev linuxaudiodev.c
-+linuxaudiodev linuxaudiodev.c
-
-
- # George Neville-Neil's timing module:
-
--#timing timingmodule.c
-+timing timingmodule.c
-
-
- # The _tkinter module.
-@@ -313,7 +313,7 @@ GLHACK=-Dclear=__GLclear
- # every system.
-
- # *** Always uncomment this (leave the leading underscore in!):
--# _tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \
-+_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \
- # *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
- # -L/usr/local/lib \
- # *** Uncomment and edit to reflect where your Tcl/Tk headers are:
-@@ -323,7 +323,7 @@ GLHACK=-Dclear=__GLclear
- # *** Or uncomment this for Solaris:
- # -I/usr/openwin/include \
- # *** Uncomment and edit for Tix extension only:
--# -DWITH_TIX -ltix8.1.8.2 \
-+ -DWITH_TIX -ltix \
- # *** Uncomment and edit for BLT extension only:
- # -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \
- # *** Uncomment and edit for PIL (TkImaging) extension only:
-@@ -332,7 +332,7 @@ GLHACK=-Dclear=__GLclear
- # *** Uncomment and edit for TOGL extension only:
- # -DWITH_TOGL togl.c \
- # *** Uncomment and edit to reflect your Tcl/Tk versions:
--# -ltk8.2 -ltcl8.2 \
-+ -ltk -ltcl \
- # *** Uncomment and edit to reflect where your X11 libraries are:
- # -L/usr/X11R6/lib \
- # *** Or uncomment this for Solaris:
-@@ -342,7 +342,7 @@ GLHACK=-Dclear=__GLclear
- # *** Uncomment for AIX:
- # -lld \
- # *** Always uncomment this; X11 libraries to link with:
--# -lX11
-+ -lX11
-
- # Lance Ellinghaus's syslog module
- #syslog syslogmodule.c # syslog daemon interface
-@@ -354,9 +354,9 @@ GLHACK=-Dclear=__GLclear
- #
- # First, look at Setup.config; configure may have set this for you.
-
--#_curses _cursesmodule.c -lcurses -ltermcap
-+_curses _cursesmodule.c -lncursesw
- # Wrapper for the panel library that's part of ncurses and SYSV curses.
--#_curses_panel _curses_panel.c -lpanel -lncurses
-+_curses_panel _curses_panel.c -lpanel -lncursesw
-
-
- # Generic (SunOS / SVR4) dynamic loading module.
-@@ -364,7 +364,7 @@ GLHACK=-Dclear=__GLclear
- # it is a highly experimental and dangerous device for calling
- # *arbitrary* C functions in *arbitrary* shared libraries:
-
--#dl dlmodule.c
-+dl dlmodule.c
-
-
- # Modules that provide persistent dictionary-like semantics. You will
-@@ -387,7 +387,7 @@ GLHACK=-Dclear=__GLclear
- #
- # First, look at Setup.config; configure may have set this for you.
-
--#gdbm gdbmmodule.c -I/usr/local/include -L/usr/local/lib -lgdbm
-+gdbm gdbmmodule.c -I/usr/local/include -L/usr/local/lib -lgdbm
-
-
- # Sleepycat Berkeley DB interface.
-@@ -402,11 +402,10 @@ GLHACK=-Dclear=__GLclear
- #
- # Edit the variables DB and DBLIBVERto point to the db top directory
- # and the subdirectory of PORT where you built it.
--#DB=/usr/local/BerkeleyDB.4.0
--#DBLIBVER=4.0
--#DBINC=$(DB)/include
--#DBLIB=$(DB)/lib
--#_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
-+DBLIBVER=4.7
-+DBINC=/usr/include/db4
-+DBLIB=/usr/lib
-+_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
-
- # Historical Berkeley DB 1.85
- #
-@@ -421,14 +420,14 @@ GLHACK=-Dclear=__GLclear
-
-
- # Helper module for various ascii-encoders
--#binascii binascii.c
-+binascii binascii.c
-
- # Fred Drake's interface to the Python parser
--#parser parsermodule.c
-+parser parsermodule.c
-
- # cStringIO and cPickle
--#cStringIO cStringIO.c
--#cPickle cPickle.c
-+cStringIO cStringIO.c
-+cPickle cPickle.c
-
-
- # Lee Busby's SIGFPE modules.
-@@ -451,7 +450,7 @@ GLHACK=-Dclear=__GLclear
- # Andrew Kuchling's zlib module.
- # This require zlib 1.1.3 (or later).
- # See
http://www.gzip.org/zlib/
--#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
-+zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
-
- # Interface to the Expat XML parser
- #
-@@ -465,20 +464,20 @@ GLHACK=-Dclear=__GLclear
- # More information on Expat can be found at
www.libexpat.org.
- #
- #EXPAT_DIR=/usr/local/src/expat-1.95.2
--#pyexpat pyexpat.c -DHAVE_EXPAT_H -I$(EXPAT_DIR)/lib -L$(EXPAT_DIR) -lexpat
-+pyexpat pyexpat.c -DHAVE_EXPAT_H -lexpat
-
-
- # Hye-Shik Chang's CJKCodecs
-
- # multibytecodec is required for all the other CJK codec modules
--#_multibytecodec cjkcodecs/multibytecodec.c
-+_multibytecodec cjkcodecs/multibytecodec.c
-
--#_codecs_cn cjkcodecs/_codecs_cn.c
--#_codecs_hk cjkcodecs/_codecs_hk.c
--#_codecs_iso2022 cjkcodecs/_codecs_iso2022.c
--#_codecs_jp cjkcodecs/_codecs_jp.c
--#_codecs_kr cjkcodecs/_codecs_kr.c
--#_codecs_tw cjkcodecs/_codecs_tw.c
-+_codecs_cn cjkcodecs/_codecs_cn.c
-+_codecs_hk cjkcodecs/_codecs_hk.c
-+_codecs_iso2022 cjkcodecs/_codecs_iso2022.c
-+_codecs_jp cjkcodecs/_codecs_jp.c
-+_codecs_kr cjkcodecs/_codecs_kr.c
-+_codecs_tw cjkcodecs/_codecs_tw.c
-
- # Example -- included for reference only:
- # xx xxmodule.c
---- Python-2.5.1/setup.py.rhconfig 2007-06-27 10:26:41.000000000 -0400
-+++ Python-2.5.1/setup.py 2007-06-27 10:26:51.000000000 -0400
-@@ -998,7 +998,6 @@ class PyBuildExt(build_ext):
-
- exts.append(Extension('pyexpat',
- define_macros = define_macros,
-- include_dirs = [expatinc],
- sources = ['pyexpat.c',
- 'expat/xmlparse.c',
- 'expat/xmlrole.c',
-@@ -1013,7 +1012,6 @@ class PyBuildExt(build_ext):
- define_macros.append(('USE_PYEXPAT_CAPI', None))
- exts.append(Extension('_elementtree',
- define_macros = define_macros,
-- include_dirs = [expatinc],
- sources = ['_elementtree.c'],
- ))
-
diff --git a/python-2.5-disable-egginfo.patch b/python-2.5-disable-egginfo.patch
deleted file mode 100644
index 920b90c..0000000
--- a/python-2.5-disable-egginfo.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- Python-2.5/Lib/distutils/command/install.py.egginfo 2006-12-06 17:12:57.000000000
-0500
-+++ Python-2.5/Lib/distutils/command/install.py 2006-12-06 17:13:10.000000000 -0500
-@@ -601,7 +601,7 @@
- ('install_headers', has_headers),
- ('install_scripts', has_scripts),
- ('install_data', has_data),
-- ('install_egg_info', lambda self:True),
-+ ('install_egg_info', lambda self:False),
- ]
-
- # class install
diff --git a/python-2.5-lib64.patch b/python-2.5-lib64.patch
deleted file mode 100644
index 3e8c245..0000000
--- a/python-2.5-lib64.patch
+++ /dev/null
@@ -1,165 +0,0 @@
---- Python-2.5b1/Lib/distutils/command/install.py.lib64 2006-03-27 16:55:21.000000000
-0500
-+++ Python-2.5b1/Lib/distutils/command/install.py 2006-06-22 12:20:35.000000000 -0400
-@@ -39,14 +39,14 @@
- INSTALL_SCHEMES = {
- 'unix_prefix': {
- 'purelib': '$base/lib/python$py_version_short/site-packages',
-- 'platlib':
'$platbase/lib/python$py_version_short/site-packages',
-+ 'platlib':
'$platbase/lib64/python$py_version_short/site-packages',
- 'headers': '$base/include/python$py_version_short/$dist_name',
- 'scripts': '$base/bin',
- 'data' : '$base',
- },
- 'unix_home': {
- 'purelib': '$base/lib/python',
-- 'platlib': '$base/lib/python',
-+ 'platlib': '$base/lib64/python',
- 'headers': '$base/include/python/$dist_name',
- 'scripts': '$base/bin',
- 'data' : '$base',
---- Python-2.5b1/Lib/distutils/sysconfig.py.lib64 2006-05-23 08:01:11.000000000 -0400
-+++ Python-2.5b1/Lib/distutils/sysconfig.py 2006-06-22 12:20:35.000000000 -0400
-@@ -99,8 +99,12 @@
- prefix = plat_specific and EXEC_PREFIX or PREFIX
-
- if os.name == "posix":
-+ if plat_specific or standard_lib:
-+ lib = "lib64"
-+ else:
-+ lib = "lib"
- libpython = os.path.join(prefix,
-- "lib", "python" +
get_python_version())
-+ lib, "python" + get_python_version())
- if standard_lib:
- return libpython
- else:
---- Python-2.5b1/Lib/site.py.lib64 2006-06-12 04:23:02.000000000 -0400
-+++ Python-2.5b1/Lib/site.py 2006-06-22 12:20:35.000000000 -0400
-@@ -182,9 +182,14 @@
- sitedirs = [os.path.join(prefix, "Lib",
"site-packages")]
- elif os.sep == '/':
- sitedirs = [os.path.join(prefix,
-- "lib",
-+ "lib64",
- "python" + sys.version[:3],
- "site-packages"),
-+ os.path.join(prefix,
-+ "lib",
-+ "python" + sys.version[:3],
-+ "site-packages"),
-+ os.path.join(prefix, "lib64",
"site-python"),
- os.path.join(prefix, "lib",
"site-python")]
- else:
- sitedirs = [prefix, os.path.join(prefix, "lib",
"site-packages")]
---- Python-2.5b1/setup.py.lib64 2006-06-05 19:38:06.000000000 -0400
-+++ Python-2.5b1/setup.py 2006-06-22 12:22:14.000000000 -0400
-@@ -244,7 +244,7 @@
-
- def detect_modules(self):
- # Ensure that /usr/local is always used
-- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
-+ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib64')
- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
-
- # Add paths specified in the environment variables LDFLAGS and
-@@ -496,11 +496,11 @@
- elif self.compiler.find_library_file(lib_dirs, 'curses'):
- readline_libs.append('curses')
- elif self.compiler.find_library_file(lib_dirs +
-- ['/usr/lib/termcap'],
-+ ['/usr/lib64/termcap'],
- 'termcap'):
- readline_libs.append('termcap')
- exts.append( Extension('readline', ['readline.c'],
-- library_dirs=['/usr/lib/termcap'],
-+ library_dirs=['/usr/lib64/termcap'],
- extra_link_args=readline_extra_link_args,
- libraries=readline_libs) )
- if platform not in ['mac']:
-@@ -532,8 +532,8 @@
- if krb5_h:
- ssl_incs += krb5_h
- ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
-- ['/usr/local/ssl/lib',
-- '/usr/contrib/ssl/lib/'
-+ ['/usr/local/ssl/lib64',
-+ '/usr/contrib/ssl/lib64/'
- ] )
-
- if (ssl_incs is not None and
---- Python-2.5b1/Makefile.pre.in.lib64 2006-06-11 15:45:57.000000000 -0400
-+++ Python-2.5b1/Makefile.pre.in 2006-06-22 12:20:34.000000000 -0400
-@@ -84,11 +84,11 @@
-
- # Expanded directories
- BINDIR= $(exec_prefix)/bin
--LIBDIR= $(exec_prefix)/lib
-+LIBDIR= $(exec_prefix)/lib64
- MANDIR= @mandir@
- INCLUDEDIR= @includedir@
- CONFINCLUDEDIR= $(exec_prefix)/include
--SCRIPTDIR= $(prefix)/lib
-+SCRIPTDIR= $(prefix)/lib64
-
- # Detailed destination directories
- BINLIBDEST= $(LIBDIR)/python$(VERSION)
---- Python-2.5b1/Modules/Setup.dist.lib64 2006-06-22 12:20:34.000000000 -0400
-+++ Python-2.5b1/Modules/Setup.dist 2006-06-22 12:20:35.000000000 -0400
-@@ -401,7 +401,7 @@
- # and the subdirectory of PORT where you built it.
- DBLIBVER=4.3
- DBINC=/usr/include/db4
--DBLIB=/usr/lib
-+DBLIB=/usr/lib64
- _bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
-
- # Historical Berkeley DB 1.85
-@@ -447,7 +447,7 @@
- # Andrew Kuchling's zlib module.
- # This require zlib 1.1.3 (or later).
- # See
http://www.gzip.org/zlib/
--zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
-+zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib64 -lz
-
- # Interface to the Expat XML parser
- #
---- Python-2.5b1/Modules/getpath.c.lib64 2006-04-12 22:06:09.000000000 -0400
-+++ Python-2.5b1/Modules/getpath.c 2006-06-22 12:20:35.000000000 -0400
-@@ -117,8 +117,8 @@
- #endif
-
- #ifndef PYTHONPATH
--#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
-- EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
-+#define PYTHONPATH PREFIX "/lib64/python" VERSION ":" \
-+ EXEC_PREFIX "/lib64/python" VERSION "/lib-dynload"
- #endif
-
- #ifndef LANDMARK
-@@ -129,7 +129,7 @@
- static char exec_prefix[MAXPATHLEN+1];
- static char progpath[MAXPATHLEN+1];
- static char *module_search_path = NULL;
--static char lib_python[] = "lib/python" VERSION;
-+static char lib_python[] = "lib64/python" VERSION;
-
- static void
- reduce(char *dir)
-@@ -524,7 +524,7 @@
- }
- else
- strncpy(zip_path, PREFIX, MAXPATHLEN);
-- joinpath(zip_path, "lib/python00.zip");
-+ joinpath(zip_path, "lib64/python00.zip");
- bufsz = strlen(zip_path); /* Replace "00" with version */
- zip_path[bufsz - 6] = VERSION[0];
- zip_path[bufsz - 5] = VERSION[2];
-@@ -534,7 +534,7 @@
- fprintf(stderr,
- "Could not find platform dependent libraries
<exec_prefix>\n");
- strncpy(exec_prefix, EXEC_PREFIX, MAXPATHLEN);
-- joinpath(exec_prefix, "lib/lib-dynload");
-+ joinpath(exec_prefix, "lib64/lib-dynload");
- }
- /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */
-
diff --git a/python-2.5-tkinter.patch b/python-2.5-tkinter.patch
deleted file mode 100644
index f040ca1..0000000
--- a/python-2.5-tkinter.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- Python-2.5-orig/Modules/_tkinter.c 2006-08-11 22:33:36.000000000 -0400
-+++ Python-2.5/Modules/_tkinter.c 2007-10-19 01:04:42.000000000 -0400
-@@ -938,7 +938,7 @@
- #if defined(Py_UNICODE_WIDE) && TCL_UTF_MAX == 3
- Tcl_UniChar *outbuf;
- Py_ssize_t i;
-- assert(size < size * sizeof(Tcl_UniChar));
-+ assert(size == 0 || size < size * sizeof(Tcl_UniChar));
- outbuf = (Tcl_UniChar*)ckalloc(size * sizeof(Tcl_UniChar));
- if (!outbuf) {
- PyErr_NoMemory();
diff --git a/python-2.5-xmlrpclib-marshal-objects.patch
b/python-2.5-xmlrpclib-marshal-objects.patch
deleted file mode 100644
index 6930b73..0000000
--- a/python-2.5-xmlrpclib-marshal-objects.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- Python-2.5/Lib/xmlrpclib.py.orig 2007-04-10 10:29:14.000000000 -0400
-+++ Python-2.5/Lib/xmlrpclib.py 2007-06-19 12:08:04.000000000 -0400
-@@ -630,6 +630,9 @@
- try:
- f = self.dispatch[type(value)]
- except KeyError:
-- raise TypeError, "cannot marshal %s objects" % type(value)
-+ if isinstance(value, object):
-+ self.dump_instance(value, write)
-+ else:
-+ raise TypeError, "cannot marshal %s objects" % type(value)
- else:
- f(self, value, write)
diff --git a/python-2.5.1-binutils-no-dep.patch b/python-2.5.1-binutils-no-dep.patch
deleted file mode 100644
index 7880eb6..0000000
--- a/python-2.5.1-binutils-no-dep.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff -rup Python-2.5.1-orig/Lib/ctypes/util.py Python-2.5.1/Lib/ctypes/util.py
---- Python-2.5.1-orig/Lib/ctypes/util.py 2007-01-17 14:53:24.000000000 -0500
-+++ Python-2.5.1/Lib/ctypes/util.py 2007-10-24 11:06:12.000000000 -0400
-@@ -71,9 +71,13 @@ elif os.name == "posix":
- if not f:
- return None
- cmd = "objdump -p -j .dynamic 2>/dev/null " + f
-- res = re.search(r'\sSONAME\s+([^\s]+)', os.popen(cmd).read())
-+ try:
-+ res = re.search(r'\sSONAME\s+([^\s]+)', os.popen(cmd).read())
-+ except:
-+ res = None
- if not res:
-- return None
-+ return os.path.basename(f) # This is good for GLibc, I think, and a
-+ # dep on binutils is big (for live CDs).
- return res.group(1)
-
- if (sys.platform.startswith("freebsd")
-Only in Python-2.5.1/Lib/ctypes: util.py~
-Only in Python-2.5.1/Lib/ctypes: util.py.binutils-no-dep
diff --git a/python-2.5.1-ctypes-exec-stack.patch b/python-2.5.1-ctypes-exec-stack.patch
deleted file mode 100644
index 0f5c675..0000000
--- a/python-2.5.1-ctypes-exec-stack.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-diff -up Python-2.5.1/Modules/_ctypes/libffi/src/x86/unix64.S.execstack
Python-2.5.1/Modules/_ctypes/libffi/src/x86/unix64.S
---- Python-2.5.1/Modules/_ctypes/libffi/src/x86/unix64.S.execstack 2007-08-10
10:34:06.000000000 +0200
-+++ Python-2.5.1/Modules/_ctypes/libffi/src/x86/unix64.S 2007-08-10 10:34:06.000000000
+0200
-@@ -410,3 +410,7 @@ ffi_closure_unix64:
- .LEFDE3:
-
- #endif /* __x86_64__ */
-+
-+#ifdef __ELF__
-+.section .note.GNU-stack,"",%progbits
-+#endif
-diff -up Python-2.5.1/Modules/_ctypes/libffi/src/powerpc/sysv.S.execstack
Python-2.5.1/Modules/_ctypes/libffi/src/powerpc/sysv.S
---- Python-2.5.1/Modules/_ctypes/libffi/src/powerpc/sysv.S.execstack 2007-08-10
10:39:03.000000000 +0200
-+++ Python-2.5.1/Modules/_ctypes/libffi/src/powerpc/sysv.S 2007-08-10 10:39:59.000000000
+0200
-@@ -215,3 +215,7 @@ END(ffi_call_SYSV)
- .align 2
- .LEFDE1:
- #endif
-+
-+#ifdef __ELF__
-+.section .note.GNU-stack,"",%progbits
-+#endif
-diff -up Python-2.5.1/Modules/_ctypes/libffi/src/powerpc/linux64_closure.S.execstack
Python-2.5.1/Modules/_ctypes/libffi/src/powerpc/linux64_closure.S
----
Python-2.5.1/Modules/_ctypes/libffi/src/powerpc/linux64_closure.S.execstack 2007-08-10
10:39:23.000000000 +0200
-+++ Python-2.5.1/Modules/_ctypes/libffi/src/powerpc/linux64_closure.S 2007-08-10
10:39:58.000000000 +0200
-@@ -204,3 +204,7 @@ ffi_closure_LINUX64:
- .align 3
- .LEFDE1:
- #endif
-+
-+#ifdef __ELF__
-+.section .note.GNU-stack,"",%progbits
-+#endif
-diff -up Python-2.5.1/Modules/_ctypes/libffi/src/powerpc/linux64.S.execstack
Python-2.5.1/Modules/_ctypes/libffi/src/powerpc/linux64.S
---- Python-2.5.1/Modules/_ctypes/libffi/src/powerpc/linux64.S.execstack 2007-08-10
10:39:13.000000000 +0200
-+++ Python-2.5.1/Modules/_ctypes/libffi/src/powerpc/linux64.S 2007-08-10
10:40:01.000000000 +0200
-@@ -178,3 +178,7 @@ ffi_call_LINUX64:
- .align 3
- .LEFDE1:
- #endif
-+
-+#ifdef __ELF__
-+.section .note.GNU-stack,"",%progbits
-+#endif
diff --git a/python-2.5.1-db46.patch b/python-2.5.1-db46.patch
deleted file mode 100644
index a1896e6..0000000
--- a/python-2.5.1-db46.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-diff -up Python-2.5.1/setup.py.db46 Python-2.5.1/setup.py
---- Python-2.5.1/setup.py.db46 2007-08-14 12:53:45.000000000 -0400
-+++ Python-2.5.1/setup.py 2007-08-14 14:11:08.000000000 -0400
-@@ -606,9 +606,9 @@ class PyBuildExt(build_ext):
- # a release. Most open source OSes come with one or more
- # versions of BerkeleyDB already installed.
-
-- max_db_ver = (4, 5)
-+ max_db_ver = (4, 6)
- min_db_ver = (3, 3)
-- db_setup_debug = False # verbose debug prints from this script?
-+ db_setup_debug = True # verbose debug prints from this script?
-
- # construct a list of paths to look for the header file in on
- # top of the normal inc_dirs.
-@@ -623,7 +623,7 @@ class PyBuildExt(build_ext):
- '/sw/include/db3',
- ]
- # 4.x minor number specific paths
-- for x in (0,1,2,3,4,5):
-+ for x in (0,1,2,3,4,5,6):
- db_inc_paths.append('/usr/include/db4%d' % x)
- db_inc_paths.append('/usr/include/db4.%d' % x)
- db_inc_paths.append('/usr/local/BerkeleyDB.4.%d/include' % x)
-@@ -646,7 +646,7 @@ class PyBuildExt(build_ext):
- for dn in inc_dirs:
- std_variants.append(os.path.join(dn, 'db3'))
- std_variants.append(os.path.join(dn, 'db4'))
-- for x in (0,1,2,3,4):
-+ for x in (0,1,2,3,4,5,6):
- std_variants.append(os.path.join(dn, "db4%d"%x))
- std_variants.append(os.path.join(dn, "db4.%d"%x))
- for x in (2,3):
diff --git a/python-2.5.1-db47.patch b/python-2.5.1-db47.patch
deleted file mode 100644
index 3ae8364..0000000
--- a/python-2.5.1-db47.patch
+++ /dev/null
@@ -1,93 +0,0 @@
-diff -up Python-2.5.1/Modules/_bsddb.c.db46 Python-2.5.1/Modules/_bsddb.c
---- Python-2.5.1/Modules/_bsddb.c.db46 2007-01-04 21:09:06.000000000 -0500
-+++ Python-2.5.1/Modules/_bsddb.c 2008-07-10 09:58:55.000000000 -0400
-@@ -5306,11 +5306,13 @@ static PyObject*
- DBEnv_getattr(DBEnvObject* self, char *name)
- {
- if (!strcmp(name, "db_home")) {
-+ const char *home = NULL;
- CHECK_ENV_NOT_CLOSED(self);
-- if (self->db_env->db_home == NULL) {
-+ self->db_env->get_home(self->db_env, &home);
-+ if (home == NULL) {
- RETURN_NONE();
- }
-- return PyString_FromString(self->db_env->db_home);
-+ return PyString_FromString(home);
- }
-
- return Py_FindMethod(DBEnv_methods, (PyObject* )self, name);
-@@ -5932,22 +5934,37 @@ DL_EXPORT(void) init_bsddb(void)
- ADD_INT(d, DB_TIME_NOTGRANTED);
- ADD_INT(d, DB_TXN_NOT_DURABLE);
- ADD_INT(d, DB_TXN_WRITE_NOSYNC);
-- ADD_INT(d, DB_LOG_AUTOREMOVE);
-- ADD_INT(d, DB_DIRECT_LOG);
- ADD_INT(d, DB_DIRECT_DB);
- ADD_INT(d, DB_INIT_REP);
- ADD_INT(d, DB_ENCRYPT);
- ADD_INT(d, DB_CHKSUM);
- #endif
-
-+#if (DBVER >= 42) && (DBVER < 47)
-+ ADD_INT(d, DB_LOG_AUTOREMOVE);
-+ ADD_INT(d, DB_DIRECT_LOG);
-+#endif
-+
-+#if (DBVER >= 47)
-+ ADD_INT(d, DB_LOG_DIRECT);
-+ ADD_INT(d, DB_LOG_DSYNC);
-+ ADD_INT(d, DB_LOG_IN_MEMORY);
-+ ADD_INT(d, DB_LOG_AUTO_REMOVE);
-+ ADD_INT(d, DB_LOG_ZERO);
-+#endif
-+
- #if (DBVER >= 43)
-- ADD_INT(d, DB_LOG_INMEMORY);
- ADD_INT(d, DB_BUFFER_SMALL);
- ADD_INT(d, DB_SEQ_DEC);
- ADD_INT(d, DB_SEQ_INC);
- ADD_INT(d, DB_SEQ_WRAP);
- #endif
-
-+#if (DBVER >= 43) && (DBVER < 47)
-+ ADD_INT(d, DB_LOG_INMEMORY);
-+ ADD_INT(d, DB_DSYNC_LOG);
-+#endif
-+
- #if (DBVER >= 41)
- ADD_INT(d, DB_ENCRYPT_AES);
- ADD_INT(d, DB_AUTO_COMMIT);
-diff -up Python-2.5.1/setup.py.db46 Python-2.5.1/setup.py
---- Python-2.5.1/setup.py.db46 2008-07-10 09:55:08.000000000 -0400
-+++ Python-2.5.1/setup.py 2008-07-10 09:55:08.000000000 -0400
-@@ -606,9 +606,9 @@ class PyBuildExt(build_ext):
- # a release. Most open source OSes come with one or more
- # versions of BerkeleyDB already installed.
-
-- max_db_ver = (4, 5)
-+ max_db_ver = (4, 7)
- min_db_ver = (3, 3)
-- db_setup_debug = False # verbose debug prints from this script?
-+ db_setup_debug = True # verbose debug prints from this script?
-
- # construct a list of paths to look for the header file in on
- # top of the normal inc_dirs.
-@@ -623,7 +623,7 @@ class PyBuildExt(build_ext):
- '/sw/include/db3',
- ]
- # 4.x minor number specific paths
-- for x in (0,1,2,3,4,5):
-+ for x in (0,1,2,3,4,5,6,7):
- db_inc_paths.append('/usr/include/db4%d' % x)
- db_inc_paths.append('/usr/include/db4.%d' % x)
- db_inc_paths.append('/usr/local/BerkeleyDB.4.%d/include' % x)
-@@ -646,7 +646,7 @@ class PyBuildExt(build_ext):
- for dn in inc_dirs:
- std_variants.append(os.path.join(dn, 'db3'))
- std_variants.append(os.path.join(dn, 'db4'))
-- for x in (0,1,2,3,4):
-+ for x in (0,1,2,3,4,5,6,7):
- std_variants.append(os.path.join(dn, "db4%d"%x))
- std_variants.append(os.path.join(dn, "db4.%d"%x))
- for x in (2,3):
diff --git a/python-2.5.1-listdir.patch b/python-2.5.1-listdir.patch
deleted file mode 100644
index 1c4fc3f..0000000
--- a/python-2.5.1-listdir.patch
+++ /dev/null
@@ -1,18 +0,0 @@
---- Python-2.5.1/Modules/posixmodule.c.orig 2007-04-04 14:30:56.000000000 -0400
-+++ Python-2.5.1/Modules/posixmodule.c 2008-06-14 17:35:47.000000000 -0400
-@@ -2160,7 +2160,6 @@
- struct dirent *ep;
- int arg_is_unicode = 1;
-
-- errno = 0;
- if (!PyArg_ParseTuple(args, "U:listdir", &v)) {
- arg_is_unicode = 0;
- PyErr_Clear();
-@@ -2176,6 +2175,7 @@
- return NULL;
- }
- for (;;) {
-+ errno = 0;
- Py_BEGIN_ALLOW_THREADS
- ep = readdir(dirp);
- Py_END_ALLOW_THREADS
diff --git a/python-2.5.1-pysqlite.patch b/python-2.5.1-pysqlite.patch
deleted file mode 100644
index ce4f936..0000000
--- a/python-2.5.1-pysqlite.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-diff -up Python-2.5.1/Modules/_sqlite/cache.h.pysqlite
Python-2.5.1/Modules/_sqlite/cache.h
---- Python-2.5.1/Modules/_sqlite/cache.h.pysqlite 2006-04-23 16:24:26.000000000 +0100
-+++ Python-2.5.1/Modules/_sqlite/cache.h 2007-10-25 11:21:31.000000000 +0100
-@@ -64,7 +64,7 @@ extern PyTypeObject CacheType;
- int node_init(Node* self, PyObject* args, PyObject* kwargs);
- void node_dealloc(Node* self);
-
--int cache_init(Cache* self, PyObject* args, PyObject* kwargs);
-+int pysqlite_cache_init(Cache* self, PyObject* args, PyObject* kwargs);
- void cache_dealloc(Cache* self);
- PyObject* cache_get(Cache* self, PyObject* args);
-
-diff -up Python-2.5.1/Modules/_sqlite/cache.c.pysqlite
Python-2.5.1/Modules/_sqlite/cache.c
---- Python-2.5.1/Modules/_sqlite/cache.c.pysqlite 2006-04-23 16:24:26.000000000 +0100
-+++ Python-2.5.1/Modules/_sqlite/cache.c 2007-10-25 11:22:10.000000000 +0100
-@@ -54,7 +54,7 @@ void node_dealloc(Node* self)
- self->ob_type->tp_free((PyObject*)self);
- }
-
--int cache_init(Cache* self, PyObject* args, PyObject* kwargs)
-+int pysqlite_cache_init(Cache* self, PyObject* args, PyObject* kwargs)
- {
- PyObject* factory;
- int size = 10;
-@@ -352,7 +352,7 @@ PyTypeObject CacheType = {
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
-- (initproc)cache_init, /* tp_init */
-+ (initproc)pysqlite_cache_init, /* tp_init */
- 0, /* tp_alloc */
- 0, /* tp_new */
- 0 /* tp_free */
diff --git a/python-2.5.2-db47.patch b/python-2.5.2-db47.patch
deleted file mode 100644
index 5dd3af2..0000000
--- a/python-2.5.2-db47.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-diff -ru Python-2.5.2-orig/Modules/_bsddb.c Python-2.5.2/Modules/_bsddb.c
---- Python-2.5.2-orig/Modules/_bsddb.c 2008-02-03 02:26:23.000000000 -0500
-+++ Python-2.5.2/Modules/_bsddb.c 2008-09-24 17:01:50.000000000 -0400
-@@ -5335,11 +5335,13 @@
- DBEnv_getattr(DBEnvObject* self, char *name)
- {
- if (!strcmp(name, "db_home")) {
-+ const char *home = NULL;
- CHECK_ENV_NOT_CLOSED(self);
-- if (self->db_env->db_home == NULL) {
-+ self->db_env->get_home(self->db_env, &home);
-+ if (home == NULL) {
- RETURN_NONE();
- }
-- return PyString_FromString(self->db_env->db_home);
-+ return PyString_FromString(home);
- }
-
- return Py_FindMethod(DBEnv_methods, (PyObject* )self, name);
-@@ -5961,22 +5963,37 @@
- ADD_INT(d, DB_TIME_NOTGRANTED);
- ADD_INT(d, DB_TXN_NOT_DURABLE);
- ADD_INT(d, DB_TXN_WRITE_NOSYNC);
-- ADD_INT(d, DB_LOG_AUTOREMOVE);
-- ADD_INT(d, DB_DIRECT_LOG);
- ADD_INT(d, DB_DIRECT_DB);
- ADD_INT(d, DB_INIT_REP);
- ADD_INT(d, DB_ENCRYPT);
- ADD_INT(d, DB_CHKSUM);
- #endif
-
-+#if (DBVER >= 42) && (DBVER < 47)
-+ ADD_INT(d, DB_LOG_AUTOREMOVE);
-+ ADD_INT(d, DB_DIRECT_LOG);
-+#endif
-+
-+#if (DBVER >= 47)
-+ ADD_INT(d, DB_LOG_DIRECT);
-+ ADD_INT(d, DB_LOG_DSYNC);
-+ ADD_INT(d, DB_LOG_IN_MEMORY);
-+ ADD_INT(d, DB_LOG_AUTO_REMOVE);
-+ ADD_INT(d, DB_LOG_ZERO);
-+#endif
-+
- #if (DBVER >= 43)
-- ADD_INT(d, DB_LOG_INMEMORY);
- ADD_INT(d, DB_BUFFER_SMALL);
- ADD_INT(d, DB_SEQ_DEC);
- ADD_INT(d, DB_SEQ_INC);
- ADD_INT(d, DB_SEQ_WRAP);
- #endif
-
-+#if (DBVER >= 43) && (DBVER < 47)
-+ ADD_INT(d, DB_LOG_INMEMORY);
-+ ADD_INT(d, DB_DSYNC_LOG);
-+#endif
-+
- #if (DBVER >= 41)
- ADD_INT(d, DB_ENCRYPT_AES);
- ADD_INT(d, DB_AUTO_COMMIT);
-diff -ru Python-2.5.2-orig/setup.py Python-2.5.2/setup.py
---- Python-2.5.2-orig/setup.py 2008-09-24 17:01:02.000000000 -0400
-+++ Python-2.5.2/setup.py 2008-09-24 17:03:05.000000000 -0400
-@@ -608,12 +608,12 @@
- # a release. Most open source OSes come with one or more
- # versions of BerkeleyDB already installed.
-
-- max_db_ver = (4, 5)
-+ max_db_ver = (4, 7)
- # NOTE: while the _bsddb.c code links against BerkeleyDB 4.6.x
- # we leave that version disabled by default as it has proven to be
- # quite a buggy library release on many platforms.
- min_db_ver = (3, 3)
-- db_setup_debug = False # verbose debug prints from this script?
-+ db_setup_debug = True # verbose debug prints from this script?
-
- # construct a list of paths to look for the header file in on
- # top of the normal inc_dirs.
diff --git a/python-2.5.2-set_wakeup_fd4.patch b/python-2.5.2-set_wakeup_fd4.patch
deleted file mode 100644
index 77ae208..0000000
--- a/python-2.5.2-set_wakeup_fd4.patch
+++ /dev/null
@@ -1,86 +0,0 @@
-diff -ru Python-2.5.2-orig/Modules/signalmodule.c Python-2.5.2/Modules/signalmodule.c
---- Python-2.5.2-orig/Modules/signalmodule.c 2007-12-10 18:03:55.000000000 -0500
-+++ Python-2.5.2/Modules/signalmodule.c 2008-09-24 17:32:45.000000000 -0400
-@@ -12,6 +12,8 @@
-
- #include <signal.h>
-
-+#include <sys/stat.h>
-+
- #ifndef SIG_ERR
- #define SIG_ERR ((PyOS_sighandler_t)(-1))
- #endif
-@@ -75,6 +77,8 @@
- PyObject *func;
- } Handlers[NSIG];
-
-+static int wakeup_fd = -1;
-+
- /* Speed up sigcheck() when none tripped */
- static volatile sig_atomic_t is_tripped = 0;
-
-@@ -113,6 +117,7 @@
- static void
- signal_handler(int sig_num)
- {
-+ const char dummy_byte = '\0';
- #ifdef WITH_THREAD
- #ifdef WITH_PTH
- if (PyThread_get_thread_ident() != main_thread) {
-@@ -128,6 +133,8 @@
- cleared in PyErr_CheckSignals() before .tripped. */
- is_tripped = 1;
- Py_AddPendingCall(checksignals_witharg, NULL);
-+ if (wakeup_fd != -1)
-+ write(wakeup_fd, &dummy_byte, 1);
- #ifdef WITH_THREAD
- }
- #endif
-@@ -267,6 +274,39 @@
- anything else -- the callable Python object used as a handler");
-
-
-+static PyObject *
-+signal_set_wakeup_fd(PyObject *self, PyObject *args)
-+{
-+ struct stat buf;
-+ int fd, old_fd;
-+ if (!PyArg_ParseTuple(args, "i:set_wakeup_fd", &fd))
-+ return NULL;
-+#ifdef WITH_THREAD
-+ if (PyThread_get_thread_ident() != main_thread) {
-+ PyErr_SetString(PyExc_ValueError,
-+ "set_wakeup_fd only works in main thread");
-+ return NULL;
-+ }
-+#endif
-+ if (fd != -1 && fstat(fd, &buf) != 0) {
-+ PyErr_SetString(PyExc_ValueError, "invalid fd");
-+ return NULL;
-+ }
-+ old_fd = wakeup_fd;
-+ wakeup_fd = fd;
-+ return PyLong_FromLong(old_fd);
-+}
-+
-+PyDoc_STRVAR(set_wakeup_fd_doc,
-+"set_wakeup_fd(fd) -> fd\n\
-+\n\
-+Sets the fd to be written to (with '\\0') when a signal\n\
-+comes in. A library can use this to wakeup select or poll.\n\
-+The previous fd is returned.\n\
-+\n\
-+The fd must be non-blocking.");
-+
-+
- /* List of functions defined in the module */
- static PyMethodDef signal_methods[] = {
- #ifdef HAVE_ALARM
-@@ -274,6 +314,7 @@
- #endif
- {"signal", signal_signal, METH_VARARGS, signal_doc},
- {"getsignal", signal_getsignal, METH_VARARGS, getsignal_doc},
-+ {"set_wakeup_fd", signal_set_wakeup_fd, METH_VARARGS, set_wakeup_fd_doc},
- #ifdef HAVE_PAUSE
- {"pause", (PyCFunction)signal_pause,
- METH_NOARGS,pause_doc},
diff --git a/python-2.5.CVE-2007-4965-int-overflow.patch
b/python-2.5.CVE-2007-4965-int-overflow.patch
deleted file mode 100644
index ad26707..0000000
--- a/python-2.5.CVE-2007-4965-int-overflow.patch
+++ /dev/null
@@ -1,221 +0,0 @@
-diff -ru Python-2.5-orig/Modules/imageop.c Python-2.5/Modules/imageop.c
---- Python-2.5-orig/Modules/imageop.c 2006-01-19 01:09:39.000000000 -0500
-+++ Python-2.5/Modules/imageop.c 2007-10-19 01:11:33.000000000 -0400
-@@ -78,7 +78,7 @@
- char *cp, *ncp;
- short *nsp;
- Py_Int32 *nlp;
-- int len, size, x, y, newx1, newx2, newy1, newy2;
-+ int len, size, x, y, newx1, newx2, newy1, newy2, nlen;
- int ix, iy, xstep, ystep;
- PyObject *rv;
-
-@@ -90,13 +90,19 @@
- PyErr_SetString(ImageopError, "Size should be 1, 2 or 4");
- return 0;
- }
-- if ( len != size*x*y ) {
-+ if (( len != size*x*y ) ||
-+ ( size != ((len / x) / y) )) {
- PyErr_SetString(ImageopError, "String has incorrect length");
- return 0;
- }
- xstep = (newx1 < newx2)? 1 : -1;
- ystep = (newy1 < newy2)? 1 : -1;
-
-+ nlen = (abs(newx2-newx1)+1)*(abs(newy2-newy1)+1)*size;
-+ if ( size != ((nlen / (abs(newx2-newx1)+1)) / (abs(newy2-newy1)+1)) ) {
-+ PyErr_SetString(ImageopError, "String has incorrect length");
-+ return 0;
-+ }
- rv = PyString_FromStringAndSize(NULL,
- (abs(newx2-newx1)+1)*(abs(newy2-newy1)+1)*size);
- if ( rv == 0 )
-@@ -132,7 +138,7 @@
- char *cp, *ncp;
- short *nsp;
- Py_Int32 *nlp;
-- int len, size, x, y, newx, newy;
-+ int len, size, x, y, newx, newy, nlen;
- int ix, iy;
- int oix, oiy;
- PyObject *rv;
-@@ -145,12 +151,18 @@
- PyErr_SetString(ImageopError, "Size should be 1, 2 or 4");
- return 0;
- }
-- if ( len != size*x*y ) {
-+ if ( ( len != size*x*y ) ||
-+ ( size != ((len / x) / y) ) ) {
-+ PyErr_SetString(ImageopError, "String has incorrect length");
-+ return 0;
-+ }
-+ nlen = newx*newy*size;
-+ if ( size != ((nlen / newx) / newy) ) {
- PyErr_SetString(ImageopError, "String has incorrect length");
- return 0;
- }
-
-- rv = PyString_FromStringAndSize(NULL, newx*newy*size);
-+ rv = PyString_FromStringAndSize(NULL, nlen);
- if ( rv == 0 )
- return 0;
- ncp = (char *)PyString_AsString(rv);
-@@ -190,7 +202,8 @@
- PyErr_SetString(ImageopError, "Size should be 1 or 4");
- return 0;
- }
-- if ( maxx*maxy*width != len ) {
-+ if ( ( maxx*maxy*width != len ) ||
-+ ( maxx != ((len / maxy) / width) ) ) {
- PyErr_SetString(ImageopError, "String has incorrect length");
- return 0;
- }
-@@ -240,7 +253,8 @@
- if ( !PyArg_ParseTuple(args, "s#iii", &cp, &len, &x, &y,
&tres) )
- return 0;
-
-- if ( x*y != len ) {
-+ if ( ( x*y != len ) ||
-+ ( x != len / y ) ) {
- PyErr_SetString(ImageopError, "String has incorrect length");
- return 0;
- }
-@@ -281,7 +295,8 @@
- if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) )
- return 0;
-
-- if ( x*y != len ) {
-+ if ( ( x*y != len ) ||
-+ ( x != len / y ) ) {
- PyErr_SetString(ImageopError, "String has incorrect length");
- return 0;
- }
-@@ -320,7 +335,8 @@
- if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) )
- return 0;
-
-- if ( x*y != len ) {
-+ if ( ( x*y != len ) ||
-+ ( x != len / y ) ) {
- PyErr_SetString(ImageopError, "String has incorrect length");
- return 0;
- }
-@@ -358,7 +374,8 @@
- if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) )
- return 0;
-
-- if ( x*y != len ) {
-+ if ( ( x*y != len ) ||
-+ ( x != len / y ) ) {
- PyErr_SetString(ImageopError, "String has incorrect length");
- return 0;
- }
-@@ -404,7 +421,8 @@
- if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) )
- return 0;
-
-- if ( x*y != len ) {
-+ if ( ( x*y != len ) ||
-+ ( x != len / y ) ) {
- PyErr_SetString(ImageopError, "String has incorrect length");
- return 0;
- }
-@@ -443,7 +461,11 @@
- if ( !PyArg_ParseTuple(args, "s#iiii", &cp, &len, &x, &y,
&v0, &v1) )
- return 0;
-
-- nlen = x*y;
-+ nlen = x*y;
-+ if ( x != (nlen / y) ) {
-+ PyErr_SetString(ImageopError, "String has incorrect length");
-+ return 0;
-+ }
- if ( (nlen+7)/8 != len ) {
- PyErr_SetString(ImageopError, "String has incorrect length");
- return 0;
-@@ -481,6 +503,10 @@
- return 0;
-
- nlen = x*y;
-+ if ( x != (nlen / y) ) {
-+ PyErr_SetString(ImageopError, "String has incorrect length");
-+ return 0;
-+ }
- if ( (nlen+3)/4 != len ) {
- PyErr_SetString(ImageopError, "String has incorrect length");
- return 0;
-@@ -517,6 +543,10 @@
- return 0;
-
- nlen = x*y;
-+ if ( x != (nlen / y) ) {
-+ PyErr_SetString(ImageopError, "String has incorrect length");
-+ return 0;
-+ }
- if ( (nlen+1)/2 != len ) {
- PyErr_SetString(ImageopError, "String has incorrect length");
- return 0;
-@@ -554,6 +584,10 @@
- return 0;
-
- nlen = x*y;
-+ if ( x != (nlen / y) ) {
-+ PyErr_SetString(ImageopError, "String has incorrect length");
-+ return 0;
-+ }
- if ( nlen*4 != len ) {
- PyErr_SetString(ImageopError, "String has incorrect length");
- return 0;
-@@ -598,6 +632,10 @@
- return 0;
-
- nlen = x*y;
-+ if ( x != (nlen / y) ) {
-+ PyErr_SetString(ImageopError, "String has incorrect length");
-+ return 0;
-+ }
- if ( nlen != len ) {
- PyErr_SetString(ImageopError, "String has incorrect length");
- return 0;
-@@ -648,6 +686,10 @@
- return 0;
-
- nlen = x*y;
-+ if ( x != (nlen / y) ) {
-+ PyErr_SetString(ImageopError, "String has incorrect length");
-+ return 0;
-+ }
- if ( nlen*4 != len ) {
- PyErr_SetString(ImageopError, "String has incorrect length");
- return 0;
-@@ -693,6 +735,10 @@
- return 0;
-
- nlen = x*y;
-+ if ( x != (nlen / y) ) {
-+ PyErr_SetString(ImageopError, "String has incorrect length");
-+ return 0;
-+ }
- if ( nlen != len ) {
- PyErr_SetString(ImageopError, "String has incorrect length");
- return 0;
-Only in Python-2.5/Modules: imageop.c~
-Only in Python-2.5/Modules: imageop.c.cve2007-4965
-diff -ru Python-2.5-orig/Modules/rgbimgmodule.c Python-2.5/Modules/rgbimgmodule.c
---- Python-2.5-orig/Modules/rgbimgmodule.c 2006-08-11 23:18:50.000000000 -0400
-+++ Python-2.5/Modules/rgbimgmodule.c 2007-10-19 01:05:44.000000000 -0400
-@@ -299,6 +299,11 @@
- xsize = image.xsize;
- ysize = image.ysize;
- zsize = image.zsize;
-+ tablen = xsize * ysize * zsize * sizeof(Py_Int32);
-+ if (xsize != (((tablen / ysize) / zsize) / sizeof(Py_Int32))) {
-+ PyErr_NoMemory();
-+ goto finally;
-+ }
- if (rle) {
- tablen = ysize * zsize * sizeof(Py_Int32);
- starttab = (Py_Int32 *)malloc(tablen);
-Only in Python-2.5/Modules: rgbimgmodule.c.cve2007-4965
-Only in Python-2.5/Modules: _tkinter.c.tkinter
diff --git a/python-2.6-canonicalize.patch b/python-2.6-canonicalize.patch
new file mode 100644
index 0000000..10a1470
--- /dev/null
+++ b/python-2.6-canonicalize.patch
@@ -0,0 +1,123 @@
+diff -up Python-2.6/configure.in.canonicalize Python-2.6/configure.in
+--- Python-2.6/configure.in.canonicalize 2008-09-07 15:18:16.000000000 -0400
++++ Python-2.6/configure.in 2008-11-24 02:09:29.000000000 -0500
+@@ -2445,7 +2445,8 @@ fi
+ AC_MSG_RESULT(MACHDEP_OBJS)
+
+ # checks for library functions
+-AC_CHECK_FUNCS(alarm setitimer getitimer bind_textdomain_codeset chown \
++AC_CHECK_FUNCS(alarm setitimer getitimer bind_textdomain_codeset \
++ canonicalize_file_name chown \
+ clock confstr ctermid execv fchmod fchown fork fpathconf ftime ftruncate \
+ gai_strerror getgroups getlogin getloadavg getpeername getpgid getpid \
+ getpriority getpwent getspnam getspent getsid getwd \
+diff -up Python-2.6/pyconfig.h.in.canonicalize Python-2.6/pyconfig.h.in
+--- Python-2.6/pyconfig.h.in.canonicalize 2008-09-07 01:15:18.000000000 -0400
++++ Python-2.6/pyconfig.h.in 2008-11-24 02:07:11.000000000 -0500
+@@ -79,6 +79,9 @@
+ /* Define to 1 if you have the `chflags' function. */
+ #undef HAVE_CHFLAGS
+
++/* Define to 1 if you have the `canonicalize_file_name' function. */
++#undef HAVE_CANONICALIZE_FILE_NAME
++
+ /* Define to 1 if you have the `chown' function. */
+ #undef HAVE_CHOWN
+
+diff -up Python-2.6/Python/sysmodule.c.canonicalize Python-2.6/Python/sysmodule.c
+--- Python-2.6/Python/sysmodule.c.canonicalize 2008-07-10 13:13:55.000000000 -0400
++++ Python-2.6/Python/sysmodule.c 2008-11-24 02:07:11.000000000 -0500
+@@ -1524,11 +1524,13 @@ makeargvobject(int argc, char **argv)
+ void
+ PySys_SetArgv(int argc, char **argv)
+ {
++#ifndef HAVE_CANONICALIZE_FILE_NAME
+ #if defined(HAVE_REALPATH)
+ char fullpath[MAXPATHLEN];
+ #elif defined(MS_WINDOWS)
+ char fullpath[MAX_PATH];
+ #endif
++#endif
+ PyObject *av = makeargvobject(argc, argv);
+ PyObject *path = PySys_GetObject("path");
+ if (av == NULL)
+@@ -1540,6 +1542,64 @@ PySys_SetArgv(int argc, char **argv)
+ char *p = NULL;
+ Py_ssize_t n = 0;
+ PyObject *a;
++#ifdef HAVE_CANONICALIZE_FILE_NAME
++ char *link = NULL, *argv0copy = NULL;
++
++ if (argc > 0 && argv0 != NULL) {
++
++ link = canonicalize_file_name(argv0);
++ if (link == NULL) {
++ link = strdup(argv0);
++ if (!link)
++ Py_FatalError("no mem for sys.argv");
++ }
++ }
++ if (link) {
++ if (link[0] == SEP) /* Link to absolute path */
++ argv0 = link;
++ else if (strchr(link, SEP) == NULL) {
++ /* Link without path */
++ /* strdup argv0 so we can free it
++ unconditionally */
++ argv0 = strdup(argv0);
++ if (!argv0)
++ Py_FatalError("no mem for sys.argv");
++ free(link);
++ } else {
++ /* Must join(dirname(argv0), link) */
++ char *q = strrchr(argv0, SEP);
++ if (q == NULL) /* argv0 without path */
++ argv0 = link;
++ else {
++ /* Must make a copy */
++ argv0copy = calloc(
++ strlen(link) + strlen(q) +1,
++ sizeof (char));
++ if (!argv0copy)
++ Py_FatalError("no mem for sys.argv");
++ strcpy(argv0copy, argv0);
++ q = strrchr(argv0copy, SEP);
++ strcpy(argv0copy+1, link);
++ argv0 = argv0copy;
++ p = NULL;
++ free(link);
++ }
++ }
++ }
++ if (argc > 0 && argv0 != NULL) {
++ char *q;
++ p = strrchr(argv0, SEP);
++ /* Test for alternate separator */
++ q = strrchr(p ? p : argv0, '/');
++ if (q != NULL)
++ p = q;
++ if (p != NULL) {
++ n = p + 1 - argv0;
++ if (n > 1 && p[-1] != ':')
++ n--; /* Drop trailing separator */
++ }
++ }
++#else /* ! HAVE_CANONICALIZE_FILE_NAME */
+ #ifdef HAVE_READLINK
+ char link[MAXPATHLEN+1];
+ char argv0copy[2*MAXPATHLEN+1];
+@@ -1612,9 +1672,14 @@ PySys_SetArgv(int argc, char **argv)
+ #endif /* Unix */
+ }
+ #endif /* All others */
++#endif /* ! HAVE_CANONICALIZE_FILE_NAME */
+ a = PyString_FromStringAndSize(argv0, n);
+ if (a == NULL)
+ Py_FatalError("no mem for sys.path insertion");
++#ifdef HAVE_CANONICALIZE_FILE_NAME
++ if (argc > 0 && argv0 != NULL)
++ free(argv0);
++#endif /* HAVE_CANONICALIZE_FILE_NAME */
+ if (PyList_Insert(path, 0, a) < 0)
+ Py_FatalError("sys.path.insert(0) failed");
+ Py_DECREF(a);
diff --git a/python-2.6-config.patch b/python-2.6-config.patch
new file mode 100644
index 0000000..59347c9
--- /dev/null
+++ b/python-2.6-config.patch
@@ -0,0 +1,337 @@
+diff -up Python-2.6/Include/pyexpat.h.rhconfig Python-2.6/Include/pyexpat.h
+--- Python-2.6/Include/pyexpat.h.rhconfig 2006-06-19 19:21:25.000000000 -0400
++++ Python-2.6/Include/pyexpat.h 2008-11-24 02:00:47.000000000 -0500
+@@ -5,6 +5,19 @@
+
+ #define PyExpat_CAPI_MAGIC "pyexpat.expat_CAPI 1.0"
+
++#ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */
++#if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400
++typedef __int64 XML_Index;
++typedef unsigned __int64 XML_Size;
++#else
++typedef long long XML_Index;
++typedef unsigned long long XML_Size;
++#endif
++#else
++typedef long XML_Index;
++typedef unsigned long XML_Size;
++#endif /* XML_LARGE_SIZE */
++
+ struct PyExpat_CAPI
+ {
+ char* magic; /* set to PyExpat_CAPI_MAGIC */
+diff -up Python-2.6/Modules/Setup.dist.rhconfig Python-2.6/Modules/Setup.dist
+--- Python-2.6/Modules/Setup.dist.rhconfig 2008-09-21 03:31:52.000000000 -0400
++++ Python-2.6/Modules/Setup.dist 2008-11-24 02:03:41.000000000 -0500
+@@ -152,7 +152,7 @@ GLHACK=-Dclear=__GLclear
+ # modules are to be built as shared libraries (see above for more
+ # detail; also note that *static* reverses this effect):
+
+-#*shared*
++*shared*
+
+ # GNU readline. Unlike previous Python incarnations, GNU readline is
+ # now incorporated in an optional module, configured in the Setup file
+@@ -162,69 +162,69 @@ GLHACK=-Dclear=__GLclear
+ # it, depending on your system -- see the GNU readline instructions.
+ # It's okay for this to be a shared library, too.
+
+-#readline readline.c -lreadline -ltermcap
++readline readline.c -lreadline -ltermcap
+
+
+ # Modules that should always be present (non UNIX dependent):
+
+-#array arraymodule.c # array objects
+-#cmath cmathmodule.c # -lm # complex math library functions
+-#math mathmodule.c # -lm # math library functions, e.g. sin()
+-#_struct _struct.c # binary structure packing/unpacking
+-#time timemodule.c # -lm # time operations and variables
+-#operator operator.c # operator.add() and similar goodies
+-#_weakref _weakref.c # basic weak reference support
+-#_testcapi _testcapimodule.c # Python C API test module
+-#_random _randommodule.c # Random number generator
+-#_collections _collectionsmodule.c # Container types
+-#itertools itertoolsmodule.c # Functions creating iterators for efficient looping
+-#strop stropmodule.c # String manipulations
++array arraymodule.c # array objects
++cmath cmathmodule.c # -lm # complex math library functions
++math mathmodule.c # -lm # math library functions, e.g. sin()
++_struct _struct.c # binary structure packing/unpacking
++time timemodule.c # -lm # time operations and variables
++operator operator.c # operator.add() and similar goodies
++_weakref _weakref.c # basic weak reference support
++_testcapi _testcapimodule.c # Python C API test module
++_random _randommodule.c # Random number generator
++_collections _collectionsmodule.c # Container types
++itertools itertoolsmodule.c # Functions creating iterators for efficient looping
++strop stropmodule.c # String manipulations
+
+-#unicodedata unicodedata.c # static Unicode character database
++unicodedata unicodedata.c # static Unicode character database
+
+ # access to ISO C locale support
+-#_locale _localemodule.c # -lintl
++_locale _localemodule.c # -lintl
+
+
+ # Modules with some UNIX dependencies -- on by default:
+ # (If you have a really backward UNIX, select and socket may not be
+ # supported...)
+
+-#fcntl fcntlmodule.c # fcntl(2) and ioctl(2)
+-#spwd spwdmodule.c # spwd(3)
+-#grp grpmodule.c # grp(3)
+-#select selectmodule.c # select(2); not on ancient System V
++fcntl fcntlmodule.c # fcntl(2) and ioctl(2)
++spwd spwdmodule.c # spwd(3)
++grp grpmodule.c # grp(3)
++select selectmodule.c # select(2); not on ancient System V
+
+ # Memory-mapped files (also works on Win32).
+-#mmap mmapmodule.c
++mmap mmapmodule.c
+
+ # CSV file helper
+-#_csv _csv.c
++_csv _csv.c
+
+ # Socket module helper for socket(2)
+-#_socket socketmodule.c
++_socket socketmodule.c
+
+ # Socket module helper for SSL support; you must comment out the other
+ # socket line above, and possibly edit the SSL variable:
+ #SSL=/usr/local/ssl
+-#_ssl _ssl.c \
+-# -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
+-# -L$(SSL)/lib -lssl -lcrypto
++_ssl _ssl.c \
++ -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
++ -L$(SSL)/lib -lssl -lcrypto
+
+ # The crypt module is now disabled by default because it breaks builds
+ # on many systems (where -lcrypt is needed), e.g. Linux (I believe).
+ #
+ # First, look at Setup.config; configure may have set this for you.
+
+-#crypt cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some systems
++crypt cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some systems
+
+
+ # Some more UNIX dependent modules -- off by default, since these
+ # are not supported by all UNIX systems:
+
+-#nis nismodule.c -lnsl # Sun yellow pages -- not everywhere
+-#termios termios.c # Steen Lumholt's termios module
+-#resource resource.c # Jeremy Hylton's rlimit interface
++nis nismodule.c -lnsl # Sun yellow pages -- not everywhere
++termios termios.c # Steen Lumholt's termios module
++resource resource.c # Jeremy Hylton's rlimit interface
+
+
+ # Multimedia modules -- off by default.
+@@ -232,8 +232,8 @@ GLHACK=-Dclear=__GLclear
+ # #993173 says audioop works on 64-bit platforms, though.
+ # These represent audio samples or images as strings:
+
+-#audioop audioop.c # Operations on audio samples
+-#imageop imageop.c # Operations on images
++audioop audioop.c # Operations on audio samples
++imageop imageop.c # Operations on images
+
+
+ # Note that the _md5 and _sha modules are normally only built if the
+@@ -243,14 +243,14 @@ GLHACK=-Dclear=__GLclear
+ # Message-Digest Algorithm, described in RFC 1321. The necessary files
+ # md5.c and md5.h are included here.
+
+-#_md5 md5module.c md5.c
++_md5 md5module.c md5.c
+
+
+ # The _sha module implements the SHA checksum algorithms.
+ # (NIST's Secure Hash Algorithms.)
+-#_sha shamodule.c
+-#_sha256 sha256module.c
+-#_sha512 sha512module.c
++_sha shamodule.c
++_sha256 sha256module.c
++_sha512 sha512module.c
+
+
+ # SGI IRIX specific modules -- off by default.
+@@ -297,12 +297,12 @@ GLHACK=-Dclear=__GLclear
+ # A Linux specific module -- off by default; this may also work on
+ # some *BSDs.
+
+-#linuxaudiodev linuxaudiodev.c
++linuxaudiodev linuxaudiodev.c
+
+
+ # George Neville-Neil's timing module:
+
+-#timing timingmodule.c
++timing timingmodule.c
+
+
+ # The _tkinter module.
+@@ -317,7 +317,7 @@ GLHACK=-Dclear=__GLclear
+ # every system.
+
+ # *** Always uncomment this (leave the leading underscore in!):
+-# _tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \
++_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \
+ # *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
+ # -L/usr/local/lib \
+ # *** Uncomment and edit to reflect where your Tcl/Tk headers are:
+@@ -327,7 +327,7 @@ GLHACK=-Dclear=__GLclear
+ # *** Or uncomment this for Solaris:
+ # -I/usr/openwin/include \
+ # *** Uncomment and edit for Tix extension only:
+-# -DWITH_TIX -ltix8.1.8.2 \
++ -DWITH_TIX -ltix \
+ # *** Uncomment and edit for BLT extension only:
+ # -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \
+ # *** Uncomment and edit for PIL (TkImaging) extension only:
+@@ -336,7 +336,7 @@ GLHACK=-Dclear=__GLclear
+ # *** Uncomment and edit for TOGL extension only:
+ # -DWITH_TOGL togl.c \
+ # *** Uncomment and edit to reflect your Tcl/Tk versions:
+-# -ltk8.2 -ltcl8.2 \
++ -ltk -ltcl \
+ # *** Uncomment and edit to reflect where your X11 libraries are:
+ # -L/usr/X11R6/lib \
+ # *** Or uncomment this for Solaris:
+@@ -346,7 +346,7 @@ GLHACK=-Dclear=__GLclear
+ # *** Uncomment for AIX:
+ # -lld \
+ # *** Always uncomment this; X11 libraries to link with:
+-# -lX11
++ -lX11
+
+ # Lance Ellinghaus's syslog module
+ #syslog syslogmodule.c # syslog daemon interface
+@@ -358,9 +358,9 @@ GLHACK=-Dclear=__GLclear
+ #
+ # First, look at Setup.config; configure may have set this for you.
+
+-#_curses _cursesmodule.c -lcurses -ltermcap
++_curses _cursesmodule.c -lncursesw
+ # Wrapper for the panel library that's part of ncurses and SYSV curses.
+-#_curses_panel _curses_panel.c -lpanel -lncurses
++_curses_panel _curses_panel.c -lpanel -lncursesw
+
+
+ # Generic (SunOS / SVR4) dynamic loading module.
+@@ -368,7 +368,7 @@ GLHACK=-Dclear=__GLclear
+ # it is a highly experimental and dangerous device for calling
+ # *arbitrary* C functions in *arbitrary* shared libraries:
+
+-#dl dlmodule.c
++dl dlmodule.c
+
+
+ # Modules that provide persistent dictionary-like semantics. You will
+@@ -391,7 +391,7 @@ GLHACK=-Dclear=__GLclear
+ #
+ # First, look at Setup.config; configure may have set this for you.
+
+-#gdbm gdbmmodule.c -I/usr/local/include -L/usr/local/lib -lgdbm
++gdbm gdbmmodule.c -I/usr/local/include -L/usr/local/lib -lgdbm
+
+
+ # Sleepycat Berkeley DB interface.
+@@ -406,11 +406,10 @@ GLHACK=-Dclear=__GLclear
+ #
+ # Edit the variables DB and DBLIBVERto point to the db top directory
+ # and the subdirectory of PORT where you built it.
+-#DB=/usr/local/BerkeleyDB.4.0
+-#DBLIBVER=4.0
+-#DBINC=$(DB)/include
+-#DBLIB=$(DB)/lib
+-#_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
++DBLIBVER=4.7
++DBINC=/usr/include/db4
++DBLIB=/usr/lib
++_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
+
+ # Historical Berkeley DB 1.85
+ #
+@@ -425,14 +424,14 @@ GLHACK=-Dclear=__GLclear
+
+
+ # Helper module for various ascii-encoders
+-#binascii binascii.c
++binascii binascii.c
+
+ # Fred Drake's interface to the Python parser
+-#parser parsermodule.c
++parser parsermodule.c
+
+ # cStringIO and cPickle
+-#cStringIO cStringIO.c
+-#cPickle cPickle.c
++cStringIO cStringIO.c
++cPickle cPickle.c
+
+
+ # Lee Busby's SIGFPE modules.
+@@ -455,7 +454,7 @@ GLHACK=-Dclear=__GLclear
+ # Andrew Kuchling's zlib module.
+ # This require zlib 1.1.3 (or later).
+ # See
http://www.gzip.org/zlib/
+-#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
++zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
+
+ # Interface to the Expat XML parser
+ #
+@@ -469,20 +468,20 @@ GLHACK=-Dclear=__GLclear
+ # More information on Expat can be found at
www.libexpat.org.
+ #
+ #EXPAT_DIR=/usr/local/src/expat-1.95.2
+-#pyexpat pyexpat.c -DHAVE_EXPAT_H -I$(EXPAT_DIR)/lib -L$(EXPAT_DIR) -lexpat
++pyexpat pyexpat.c -DHAVE_EXPAT_H -lexpat
+
+
+ # Hye-Shik Chang's CJKCodecs
+
+ # multibytecodec is required for all the other CJK codec modules
+-#_multibytecodec cjkcodecs/multibytecodec.c
++_multibytecodec cjkcodecs/multibytecodec.c
+
+-#_codecs_cn cjkcodecs/_codecs_cn.c
+-#_codecs_hk cjkcodecs/_codecs_hk.c
+-#_codecs_iso2022 cjkcodecs/_codecs_iso2022.c
+-#_codecs_jp cjkcodecs/_codecs_jp.c
+-#_codecs_kr cjkcodecs/_codecs_kr.c
+-#_codecs_tw cjkcodecs/_codecs_tw.c
++_codecs_cn cjkcodecs/_codecs_cn.c
++_codecs_hk cjkcodecs/_codecs_hk.c
++_codecs_iso2022 cjkcodecs/_codecs_iso2022.c
++_codecs_jp cjkcodecs/_codecs_jp.c
++_codecs_kr cjkcodecs/_codecs_kr.c
++_codecs_tw cjkcodecs/_codecs_tw.c
+
+ # Example -- included for reference only:
+ # xx xxmodule.c
+diff -up Python-2.6/setup.py.rhconfig Python-2.6/setup.py
+--- Python-2.6/setup.py.rhconfig 2008-09-29 20:15:45.000000000 -0400
++++ Python-2.6/setup.py 2008-11-24 02:00:47.000000000 -0500
+@@ -1189,7 +1189,6 @@ class PyBuildExt(build_ext):
+
+ exts.append(Extension('pyexpat',
+ define_macros = define_macros,
+- include_dirs = [expatinc],
+ sources = ['pyexpat.c',
+ 'expat/xmlparse.c',
+ 'expat/xmlrole.c',
+@@ -1204,7 +1203,6 @@ class PyBuildExt(build_ext):
+ define_macros.append(('USE_PYEXPAT_CAPI', None))
+ exts.append(Extension('_elementtree',
+ define_macros = define_macros,
+- include_dirs = [expatinc],
+ sources = ['_elementtree.c'],
+ ))
+ else:
diff --git a/python-2.6-lib64.patch b/python-2.6-lib64.patch
new file mode 100644
index 0000000..a9812e7
--- /dev/null
+++ b/python-2.6-lib64.patch
@@ -0,0 +1,173 @@
+diff -up Python-2.6/Lib/distutils/command/install.py.lib64
Python-2.6/Lib/distutils/command/install.py
+--- Python-2.6/Lib/distutils/command/install.py.lib64 2008-05-06 18:41:46.000000000
-0400
++++ Python-2.6/Lib/distutils/command/install.py 2008-11-24 02:34:04.000000000 -0500
+@@ -42,14 +42,14 @@ else:
+ INSTALL_SCHEMES = {
+ 'unix_prefix': {
+ 'purelib': '$base/lib/python$py_version_short/site-packages',
+- 'platlib':
'$platbase/lib/python$py_version_short/site-packages',
++ 'platlib':
'$platbase/lib64/python$py_version_short/site-packages',
+ 'headers': '$base/include/python$py_version_short/$dist_name',
+ 'scripts': '$base/bin',
+ 'data' : '$base',
+ },
+ 'unix_home': {
+ 'purelib': '$base/lib/python',
+- 'platlib': '$base/lib/python',
++ 'platlib': '$base/lib64/python',
+ 'headers': '$base/include/python/$dist_name',
+ 'scripts': '$base/bin',
+ 'data' : '$base',
+diff -up Python-2.6/Lib/distutils/sysconfig.py.lib64
Python-2.6/Lib/distutils/sysconfig.py
+--- Python-2.6/Lib/distutils/sysconfig.py.lib64 2008-06-05 08:58:24.000000000 -0400
++++ Python-2.6/Lib/distutils/sysconfig.py 2008-11-24 02:34:04.000000000 -0500
+@@ -115,8 +115,12 @@ def get_python_lib(plat_specific=0, stan
+ prefix = plat_specific and EXEC_PREFIX or PREFIX
+
+ if os.name == "posix":
++ if plat_specific or standard_lib:
++ lib = "lib64"
++ else:
++ lib = "lib"
+ libpython = os.path.join(prefix,
+- "lib", "python" +
get_python_version())
++ lib, "python" + get_python_version())
+ if standard_lib:
+ return libpython
+ else:
+diff -up Python-2.6/Lib/site.py.lib64 Python-2.6/Lib/site.py
+--- Python-2.6/Lib/site.py.lib64 2008-05-10 13:36:24.000000000 -0400
++++ Python-2.6/Lib/site.py 2008-11-24 02:35:51.000000000 -0500
+@@ -265,12 +265,16 @@ def addsitepackages(known_paths):
+ if sys.platform in ('os2emx', 'riscos'):
+ sitedirs.append(os.path.join(prefix, "Lib",
"site-packages"))
+ elif os.sep == '/':
++ sitedirs.append(os.path.join(prefix, "lib64",
++ "python" + sys.version[:3],
++ "site-packages"))
+ sitedirs.append(os.path.join(prefix, "lib",
+ "python" + sys.version[:3],
+ "site-packages"))
+ sitedirs.append(os.path.join(prefix, "lib",
"site-python"))
+ else:
+ sitedirs.append(prefix)
++ sitedirs.append(os.path.join(prefix, "lib64",
"site-packages"))
+ sitedirs.append(os.path.join(prefix, "lib",
"site-packages"))
+
+ if sys.platform == "darwin":
+diff -up Python-2.6/Makefile.pre.in.lib64 Python-2.6/Makefile.pre.in
+--- Python-2.6/Makefile.pre.in.lib64 2008-11-24 02:34:04.000000000 -0500
++++ Python-2.6/Makefile.pre.in 2008-11-24 02:34:04.000000000 -0500
+@@ -87,11 +87,11 @@ datarootdir= @datarootdir@
+
+ # Expanded directories
+ BINDIR= $(exec_prefix)/bin
+-LIBDIR= $(exec_prefix)/lib
++LIBDIR= $(exec_prefix)/lib64
+ MANDIR= @mandir@
+ INCLUDEDIR= @includedir@
+ CONFINCLUDEDIR= $(exec_prefix)/include
+-SCRIPTDIR= $(prefix)/lib
++SCRIPTDIR= $(prefix)/lib64
+
+ # Detailed destination directories
+ BINLIBDEST= $(LIBDIR)/python$(VERSION)
+diff -up Python-2.6/Modules/getpath.c.lib64 Python-2.6/Modules/getpath.c
+--- Python-2.6/Modules/getpath.c.lib64 2007-03-10 02:38:14.000000000 -0500
++++ Python-2.6/Modules/getpath.c 2008-11-24 02:34:04.000000000 -0500
+@@ -117,8 +117,8 @@
+ #endif
+
+ #ifndef PYTHONPATH
+-#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
+- EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
++#define PYTHONPATH PREFIX "/lib64/python" VERSION ":" \
++ EXEC_PREFIX "/lib64/python" VERSION "/lib-dynload"
+ #endif
+
+ #ifndef LANDMARK
+@@ -129,7 +129,7 @@ static char prefix[MAXPATHLEN+1];
+ static char exec_prefix[MAXPATHLEN+1];
+ static char progpath[MAXPATHLEN+1];
+ static char *module_search_path = NULL;
+-static char lib_python[] = "lib/python" VERSION;
++static char lib_python[] = "lib64/python" VERSION;
+
+ static void
+ reduce(char *dir)
+@@ -524,7 +524,7 @@ calculate_path(void)
+ }
+ else
+ strncpy(zip_path, PREFIX, MAXPATHLEN);
+- joinpath(zip_path, "lib/python00.zip");
++ joinpath(zip_path, "lib64/python00.zip");
+ bufsz = strlen(zip_path); /* Replace "00" with version */
+ zip_path[bufsz - 6] = VERSION[0];
+ zip_path[bufsz - 5] = VERSION[2];
+@@ -534,7 +534,7 @@ calculate_path(void)
+ fprintf(stderr,
+ "Could not find platform dependent libraries
<exec_prefix>\n");
+ strncpy(exec_prefix, EXEC_PREFIX, MAXPATHLEN);
+- joinpath(exec_prefix, "lib/lib-dynload");
++ joinpath(exec_prefix, "lib64/lib-dynload");
+ }
+ /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */
+
+diff -up Python-2.6/Modules/Setup.dist.lib64 Python-2.6/Modules/Setup.dist
+--- Python-2.6/Modules/Setup.dist.lib64 2008-11-24 02:34:04.000000000 -0500
++++ Python-2.6/Modules/Setup.dist 2008-11-24 02:34:04.000000000 -0500
+@@ -408,7 +408,7 @@ gdbm gdbmmodule.c -I/usr/local/include -
+ # and the subdirectory of PORT where you built it.
+ DBLIBVER=4.7
+ DBINC=/usr/include/db4
+-DBLIB=/usr/lib
++DBLIB=/usr/lib64
+ _bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
+
+ # Historical Berkeley DB 1.85
+@@ -454,7 +454,7 @@ cPickle cPickle.c
+ # Andrew Kuchling's zlib module.
+ # This require zlib 1.1.3 (or later).
+ # See
http://www.gzip.org/zlib/
+-zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
++zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib64 -lz
+
+ # Interface to the Expat XML parser
+ #
+diff -up Python-2.6/setup.py.lib64 Python-2.6/setup.py
+--- Python-2.6/setup.py.lib64 2008-11-24 02:34:04.000000000 -0500
++++ Python-2.6/setup.py 2008-11-24 02:34:04.000000000 -0500
+@@ -310,7 +310,7 @@ class PyBuildExt(build_ext):
+
+ def detect_modules(self):
+ # Ensure that /usr/local is always used
+- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
++ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib64')
+ add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+
+ # Add paths specified in the environment variables LDFLAGS and
+@@ -583,11 +583,11 @@ class PyBuildExt(build_ext):
+ elif self.compiler.find_library_file(lib_dirs, 'curses'):
+ readline_libs.append('curses')
+ elif self.compiler.find_library_file(lib_dirs +
+- ['/usr/lib/termcap'],
++ ['/usr/lib64/termcap'],
+ 'termcap'):
+ readline_libs.append('termcap')
+ exts.append( Extension('readline', ['readline.c'],
+- library_dirs=['/usr/lib/termcap'],
++ library_dirs=['/usr/lib64/termcap'],
+ extra_link_args=readline_extra_link_args,
+ libraries=readline_libs) )
+ else:
+@@ -624,8 +624,8 @@ class PyBuildExt(build_ext):
+ if krb5_h:
+ ssl_incs += krb5_h
+ ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
+- ['/usr/local/ssl/lib',
+- '/usr/contrib/ssl/lib/'
++ ['/usr/local/ssl/lib64',
++ '/usr/contrib/ssl/lib64/'
+ ] )
+
+ if (ssl_incs is not None and
diff --git a/python-2.6-rpath.patch b/python-2.6-rpath.patch
new file mode 100644
index 0000000..a668926
--- /dev/null
+++ b/python-2.6-rpath.patch
@@ -0,0 +1,12 @@
+diff -up Python-2.6/configure.in.rpath Python-2.6/configure.in
+--- Python-2.6/configure.in.rpath 2008-11-24 02:51:06.000000000 -0500
++++ Python-2.6/configure.in 2008-11-24 02:51:21.000000000 -0500
+@@ -729,7 +729,7 @@ if test $enable_shared = "yes"; then
+ ;;
+ OSF*)
+ LDLIBRARY='libpython$(VERSION).so'
+- BLDLIBRARY='-rpath $(LIBDIR) -L. -lpython$(VERSION)'
++ BLDLIBRARY='-L. -lpython$(VERSION)'
+ RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
+ ;;
+ atheos*)
diff --git a/python.spec b/python.spec
index a06fe67..6d323e3 100644
--- a/python.spec
+++ b/python.spec
@@ -1,8 +1,8 @@
%{!?__python_ver:%define __python_ver EMPTY}
-#define __python_ver 25
+#define __python_ver 26
%define unicode ucs4
-%define _default_patch_fuzz 2
+%define _default_patch_fuzz 2
%if "%{__python_ver}" != "EMPTY"
%define main_python 0
@@ -14,14 +14,14 @@
%define tkinter tkinter
%endif
-%define pybasever 2.5
+%define pybasever 2.6
%define tools_dir %{_libdir}/python%{pybasever}/Tools
%define demo_dir %{_libdir}/python%{pybasever}/Demo
%define doc_tools_dir %{_libdir}/python%{pybasever}/Doc/tools
-Summary: An interpreted, interactive, object-oriented programming language.
+Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
-Version: 2.5.2
+Version: 2.6
Release: 1%{?dist}
License: Python
Group: Development/Languages
@@ -29,39 +29,40 @@ Provides: python-abi = %{pybasever}
Provides: python(abi) = %{pybasever}
Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
-Patch0: python-2.5-config.patch
+Patch0: python-2.6-config.patch
Patch1: Python-2.2.1-pydocnogui.patch
-Patch2: python-2.3.4-pydocnodoc.patch
-Patch3: python-2.4.1-canonicalize.patch
+#Patch2: python-2.3.4-pydocnodoc.patch
+Patch3: python-2.6-canonicalize.patch
Patch4: python-2.5-cflags.patch
-Patch5: python-2.5.1-ctypes-exec-stack.patch
+#Patch5: python-2.5.1-ctypes-exec-stack.patch
Patch6: python-2.5.1-plural-fix.patch
Patch7: python-2.5.1-sqlite-encoding.patch
-Patch8: python-2.5-xmlrpclib-marshal-objects.patch
-Patch9: python-2.5-tkinter.patch
+#Patch8: python-2.5-xmlrpclib-marshal-objects.patch
+#Patch9: python-2.5-tkinter.patch
Patch10: python-2.5.2-binutils-no-dep.patch
Patch11: python-2.5.1-codec-ascii-tolower.patch
-Patch12: python-2.5.1-pysqlite.patch
+#Patch12: python-2.5.1-pysqlite.patch
Patch13: python-2.5.1-socketmodule-constants.patch
Patch14: python-2.5.1-socketmodule-constants2.patch
-Patch15: python-2.5.1-listdir.patch
+#Patch15: python-2.5.1-listdir.patch
+Patch16: python-2.6-rpath.patch
# upstreamed
-Patch50: python-2.5-disable-egginfo.patch
+#Patch50: python-2.5-disable-egginfo.patch
# new db version
-Patch60: python-2.5.2-db47.patch
+#Patch60: python-2.5.2-db47.patch
# lib64 patches
Patch101: python-2.3.4-lib64-regex.patch
-Patch102: python-2.5-lib64.patch
+Patch102: python-2.6-lib64.patch
# New API from 2.6
-Patch260: python-2.5.2-set_wakeup_fd4.patch
+#Patch260: python-2.5.2-set_wakeup_fd4.patch
-Patch999: python-2.5.CVE-2007-4965-int-overflow.patch
-Patch998: python-2.5-CVE-2008-2316.patch
+#Patch999: python-2.5.CVE-2007-4965-int-overflow.patch
+#Patch998: python-2.5-CVE-2008-2316.patch
%if %{main_python}
@@ -77,13 +78,13 @@ Provides: python-ctypes = 1.0.1
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-root
-BuildPrereq: readline-devel, openssl-devel, gmp-devel
-BuildPrereq: ncurses-devel, gdbm-devel, zlib-devel, expat-devel
-BuildPrereq: libGL-devel tk tix gcc-c++ libX11-devel glibc-devel
-BuildPrereq: bzip2 tar /usr/bin/find pkgconfig tcl-devel tk-devel
-BuildPrereq: tix-devel bzip2-devel sqlite-devel
-BuildPrereq: autoconf
-BuildPrereq: db4-devel >= 4.7
+BuildRequires: readline-devel, openssl-devel, gmp-devel
+BuildRequires: ncurses-devel, gdbm-devel, zlib-devel, expat-devel
+BuildRequires: libGL-devel tk tix gcc-c++ libX11-devel glibc-devel
+BuildRequires: bzip2 tar /usr/bin/find pkgconfig tcl-devel tk-devel
+BuildRequires: tix-devel bzip2-devel sqlite-devel
+BuildRequires: autoconf
+BuildRequires: db4-devel >= 4.7
URL:
http://www.python.org/
@@ -156,7 +157,7 @@ to build python programs.
%package -n %{tkinter}
Summary: A graphical user interface for the Python scripting language.
Group: Development/Languages
-BuildPrereq: tcl, tk
+BuildRequires: tcl, tk
Requires: %{name} = %{version}-%{release}
%if %{main_python}
Obsoletes: tkinter2
@@ -190,17 +191,17 @@ code that uses more than just unittest and/or test_support.py.
%patch0 -p1 -b .rhconfig
%patch1 -p1 -b .no_gui
-%patch2 -p1 -b .no-doc
+#%%patch2 -p1 -b .no-doc
%patch3 -p1 -b .canonicalize
%patch4 -p1 -b .cflags
-%patch5 -p1 -b .ctypesexec
+#%%patch5 -p1 -b .ctypesexec
%patch6 -p1 -b .plural
%patch7 -p1
-%patch8 -p1 -b .xmlrpc
+#%%patch8 -p1 -b .xmlrpc
# Try not disabling egg-infos, bz#414711
#patch50 -p1 -b .egginfo
-%patch60 -p1 -b .db47
+#%%patch60 -p1 -b .db47
%if "%{_lib}" == "lib64"
%patch101 -p1 -b .lib64-regex
@@ -209,20 +210,21 @@ code that uses more than just unittest and/or test_support.py.
%patch10 -p1 -b .binutils-no-dep
%patch11 -p1 -b .ascii-tolower
-%patch12 -p1 -b .pysqlite-2.3.3-minimal
+#%%patch12 -p1 -b .pysqlite-2.3.3-minimal
%patch13 -p1 -b .socketmodule
-%patch14 -p1 -b .socketmodule
-%patch15 -p1 -b .socketmodule
+%patch14 -p1 -b .socketmodule2
+#%%patch15 -p1 -b .listdir
+%patch16 -p1 -b .rpath
%ifarch alpha ia64
# 64bit, but not lib64 arches need this too...
%patch101 -p1 -b .lib64-regex
%endif
-%patch260 -p1 -b .set_wakeup_fd
+#%%patch260 -p1 -b .set_wakeup_fd
-%patch999 -p1 -b .cve2007-4965
-%patch998 -p0 -b .cve2008-2316
+#%%patch999 -p1 -b .cve2007-4965
+#%%patch998 -p0 -b .cve2008-2316
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -234,8 +236,8 @@ export CXXFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC"
export OPT="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC"
export LINKCC="gcc"
if pkg-config openssl ; then
- export CFLAGS="$CFLAGS `pkg-config --cflags openssl`"
- export LDFLAGS="$LDFLAGS `pkg-config --libs-only-L openssl`"
+ export CFLAGS="$CFLAGS `pkg-config --cflags openssl`"
+ export LDFLAGS="$LDFLAGS `pkg-config --libs-only-L openssl`"
fi
# Force CC
export CC=gcc
@@ -330,7 +332,7 @@ install Tools/scripts/*py $RPM_BUILD_ROOT%{tools_dir}/scripts/
# Documentation tools
install -m755 -d $RPM_BUILD_ROOT%{doc_tools_dir}
-install -m755 Doc/tools/mkhowto $RPM_BUILD_ROOT%{doc_tools_dir}
+#install -m755 Doc/tools/mkhowto $RPM_BUILD_ROOT%{doc_tools_dir}
# Useful demo scripts
install -m755 -d $RPM_BUILD_ROOT%{demo_dir}
@@ -451,7 +453,10 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/encodings
%{_libdir}/python%{pybasever}/hotshot
%{_libdir}/python%{pybasever}/idlelib
+%dir %{_libdir}/python%{pybasever}/json
+%{_libdir}/python%{pybasever}/json/*.py*
%{_libdir}/python%{pybasever}/logging
+%{_libdir}/python%{pybasever}/multiprocessing
%{_libdir}/python%{pybasever}/plat-linux2
%dir %{_libdir}/python%{pybasever}/sqlite3
%{_libdir}/python%{pybasever}/sqlite3/*.py*
@@ -482,9 +487,11 @@ rm -fr $RPM_BUILD_ROOT
%defattr(-,root,root,755)
%doc Tools/modulator/README.modulator
%doc Tools/pynche/README.pynche
+%{_libdir}/python%{pybasever}/lib2to3
%{_libdir}/python%{pybasever}/site-packages/modulator
%{_libdir}/python%{pybasever}/site-packages/pynche
%{_bindir}/smtpd*.py*
+%{_bindir}/2to3*
%{_bindir}/idle*
%{_bindir}/modulator*
%{_bindir}/pynche*
@@ -505,12 +512,16 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/ctypes/test
%{_libdir}/python%{pybasever}/distutils/tests
%{_libdir}/python%{pybasever}/email/test
+%{_libdir}/python%{pybasever}/json/tests
%{_libdir}/python%{pybasever}/sqlite3/test
%{_libdir}/python%{pybasever}/test
%{_libdir}/python%{pybasever}/lib-dynload/_ctypes_test.so
%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
%changelog
+* Fri Nov 28 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm(a)gmail.com> - 2.6-1
+- Update to 2.6
+
* Tue Sep 30 2008 James Antill <katzj(a)redhat.com> - 2.5.2-1
- Move to 2.5.2
- Fix CVE-2008-2316 hashlib overflow.
diff --git a/python2.6-set_wakeup_fd4.patch b/python2.6-set_wakeup_fd4.patch
deleted file mode 100644
index 76920a1..0000000
--- a/python2.6-set_wakeup_fd4.patch
+++ /dev/null
@@ -1,86 +0,0 @@
-diff -rup Python-2.5.1-orig/Modules/signalmodule.c Python-2.5.1/Modules/signalmodule.c
---- Python-2.5.1-orig/Modules/signalmodule.c 2006-01-19 01:09:39.000000000 -0500
-+++ Python-2.5.1/Modules/signalmodule.c 2008-01-07 12:32:00.000000000 -0500
-@@ -12,6 +12,8 @@
-
- #include <signal.h>
-
-+#include <sys/stat.h>
-+
- #ifndef SIG_ERR
- #define SIG_ERR ((PyOS_sighandler_t)(-1))
- #endif
-@@ -75,6 +77,8 @@ static struct {
- PyObject *func;
- } Handlers[NSIG];
-
-+static int wakeup_fd = -1;
-+
- static int is_tripped = 0; /* Speed up sigcheck() when none tripped */
-
- static PyObject *DefaultHandler;
-@@ -112,6 +116,7 @@ checksignals_witharg(void * unused)
- static void
- signal_handler(int sig_num)
- {
-+ const char dummy_byte = '\0';
- #ifdef WITH_THREAD
- #ifdef WITH_PTH
- if (PyThread_get_thread_ident() != main_thread) {
-@@ -125,6 +130,8 @@ signal_handler(int sig_num)
- is_tripped++;
- Handlers[sig_num].tripped = 1;
- Py_AddPendingCall(checksignals_witharg, NULL);
-+ if (wakeup_fd != -1)
-+ write(wakeup_fd, &dummy_byte, 1);
- #ifdef WITH_THREAD
- }
- #endif
-@@ -264,6 +271,39 @@ None -- if an unknown handler is in effe
- anything else -- the callable Python object used as a handler");
-
-
-+static PyObject *
-+signal_set_wakeup_fd(PyObject *self, PyObject *args)
-+{
-+ struct stat buf;
-+ int fd, old_fd;
-+ if (!PyArg_ParseTuple(args, "i:set_wakeup_fd", &fd))
-+ return NULL;
-+#ifdef WITH_THREAD
-+ if (PyThread_get_thread_ident() != main_thread) {
-+ PyErr_SetString(PyExc_ValueError,
-+ "set_wakeup_fd only works in main thread");
-+ return NULL;
-+ }
-+#endif
-+ if (fd != -1 && fstat(fd, &buf) != 0) {
-+ PyErr_SetString(PyExc_ValueError, "invalid fd");
-+ return NULL;
-+ }
-+ old_fd = wakeup_fd;
-+ wakeup_fd = fd;
-+ return PyLong_FromLong(old_fd);
-+}
-+
-+PyDoc_STRVAR(set_wakeup_fd_doc,
-+"set_wakeup_fd(fd) -> fd\n\
-+\n\
-+Sets the fd to be written to (with '\\0') when a signal\n\
-+comes in. A library can use this to wakeup select or poll.\n\
-+The previous fd is returned.\n\
-+\n\
-+The fd must be non-blocking.");
-+
-+
- /* List of functions defined in the module */
- static PyMethodDef signal_methods[] = {
- #ifdef HAVE_ALARM
-@@ -271,6 +311,7 @@ static PyMethodDef signal_methods[] = {
- #endif
- {"signal", signal_signal, METH_VARARGS, signal_doc},
- {"getsignal", signal_getsignal, METH_VARARGS, getsignal_doc},
-+ {"set_wakeup_fd", signal_set_wakeup_fd, METH_VARARGS, set_wakeup_fd_doc},
- #ifdef HAVE_PAUSE
- {"pause", (PyCFunction)signal_pause,
- METH_NOARGS,pause_doc},
diff --git a/sources b/sources
index 3e35aea..f8ae11e 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-afb5451049eda91fbde10bd5a4b7fadc Python-2.5.2.tar.bz2
+837476958702cb386c657b5dba61cdc5 Python-2.6.tar.bz2
commit feaea240e36bf8a11ede20fce09bf80d28b0bc8e
Author: James Antill <james(a)fedoraproject.org>
Date: Tue Sep 30 19:36:58 2008 +0000
- Move to 2.5.2
- Fix CVE-2008-2316 hashlib overflow.
diff --git a/.cvsignore b/.cvsignore
index b80caad..4446147 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -1 +1 @@
-Python-2.5.1.tar.bz2
+Python-2.5.2.tar.bz2
diff --git a/python-2.5-CVE-2008-2316.patch b/python-2.5-CVE-2008-2316.patch
new file mode 100644
index 0000000..450354b
--- /dev/null
+++ b/python-2.5-CVE-2008-2316.patch
@@ -0,0 +1,156 @@
+Index: Lib/test/test_hashlib.py
+===================================================================
+--- Lib/test/test_hashlib.py (revision 64642)
++++ Lib/test/test_hashlib.py (working copy)
+@@ -9,8 +9,8 @@
+ import hashlib
+ import unittest
+ from test import test_support
++from test.test_support import _4G, precisionbigmemtest
+
+-
+ def hexstr(s):
+ import string
+ h = string.hexdigits
+@@ -55,7 +55,6 @@
+ m2.update(aas + bees + cees)
+ self.assertEqual(m1.digest(), m2.digest())
+
+-
+ def check(self, name, data, digest):
+ # test the direct constructors
+ computed = getattr(hashlib, name)(data).hexdigest()
+@@ -74,8 +73,23 @@
+ def test_case_md5_2(self):
+ self.check('md5',
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',
+ 'd174ab98d277d9f5a5611c2c9f419d9f')
++
++ @precisionbigmemtest(size=_4G + 5, memuse=1)
++ def test_case_md5_huge(self, size):
++ if size == _4G + 5:
++ try:
++ self.check('md5', 'A'*size,
'c9af2dff37468ce5dfee8f2cfc0a9c6d')
++ except OverflowError:
++ pass # 32-bit arch
++
++ @precisionbigmemtest(size=_4G - 1, memuse=1)
++ def test_case_md5_uintmax(self, size):
++ if size == _4G - 1:
++ try:
++ self.check('md5', 'A'*size,
'28138d306ff1b8281f1a9067e1a1a2b3')
++ except OverflowError:
++ pass # 32-bit arch
+
+-
+ # use the three examples from Federal Information Processing Standards
+ # Publication 180-1, Secure Hash Standard, 1995 April 17
+ #
http://www.itl.nist.gov/div897/pubs/fip180-1.htm
+Index: Modules/_hashopenssl.c
+===================================================================
+--- Modules/_hashopenssl.c (revision 64642)
++++ Modules/_hashopenssl.c (working copy)
+@@ -19,7 +19,9 @@
+ /* EVP is the preferred interface to hashing in OpenSSL */
+ #include <openssl/evp.h>
+
++#define MUNCH_SIZE INT_MAX
+
++
+ #ifndef HASH_OBJ_CONSTRUCTOR
+ #define HASH_OBJ_CONSTRUCTOR 0
+ #endif
+@@ -164,9 +166,18 @@
+ if (!PyArg_ParseTuple(args, "s#:update", &cp, &len))
+ return NULL;
+
++ if (len > 0 && len <= MUNCH_SIZE) {
+ EVP_DigestUpdate(&self->ctx, cp, Py_SAFE_DOWNCAST(len, Py_ssize_t,
+ unsigned int));
+-
++ } else {
++ Py_ssize_t offset = 0;
++ while (len) {
++ unsigned int process = len > MUNCH_SIZE ? MUNCH_SIZE : len;
++ EVP_DigestUpdate(&self->ctx, cp + offset, process);
++ len -= process;
++ offset += process;
++ }
++ }
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
+@@ -255,10 +266,21 @@
+ self->name = name_obj;
+ Py_INCREF(self->name);
+
+- if (cp && len)
++ if (cp && len) {
++ if (len > 0 && len <= MUNCH_SIZE) {
+ EVP_DigestUpdate(&self->ctx, cp, Py_SAFE_DOWNCAST(len, Py_ssize_t,
+ unsigned int));
+-
++ } else {
++ Py_ssize_t offset = 0;
++ while (len) {
++ unsigned int process = len > MUNCH_SIZE ? MUNCH_SIZE : len;
++ EVP_DigestUpdate(&self->ctx, cp + offset, process);
++ len -= process;
++ offset += process;
++ }
++ }
++ }
++
+ return 0;
+ }
+ #endif
+@@ -328,7 +350,7 @@
+ static PyObject *
+ EVPnew(PyObject *name_obj,
+ const EVP_MD *digest, const EVP_MD_CTX *initial_ctx,
+- const unsigned char *cp, unsigned int len)
++ const unsigned char *cp, Py_ssize_t len)
+ {
+ EVPobject *self;
+
+@@ -346,8 +368,20 @@
+ EVP_DigestInit(&self->ctx, digest);
+ }
+
+- if (cp && len)
+- EVP_DigestUpdate(&self->ctx, cp, len);
++ if (cp && len) {
++ if (len > 0 && len <= MUNCH_SIZE) {
++ EVP_DigestUpdate(&self->ctx, cp, Py_SAFE_DOWNCAST(len, Py_ssize_t,
++ unsigned int));
++ } else {
++ Py_ssize_t offset = 0;
++ while (len) {
++ unsigned int process = len > MUNCH_SIZE ? MUNCH_SIZE : len;
++ EVP_DigestUpdate(&self->ctx, cp + offset, process);
++ len -= process;
++ offset += process;
++ }
++ }
++ }
+
+ return (PyObject *)self;
+ }
+@@ -384,8 +418,7 @@
+
+ digest = EVP_get_digestbyname(name);
+
+- return EVPnew(name_obj, digest, NULL, cp, Py_SAFE_DOWNCAST(len, Py_ssize_t,
+- unsigned int));
++ return EVPnew(name_obj, digest, NULL, cp, len);
+ }
+
+ /*
+@@ -410,7 +443,7 @@
+ CONST_ ## NAME ## _name_obj, \
+ NULL, \
+ CONST_new_ ## NAME ## _ctx_p, \
+- cp, Py_SAFE_DOWNCAST(len, Py_ssize_t, unsigned int)); \
++ cp, len); \
+ }
+
+ /* a PyMethodDef structure for the constructor */
diff --git a/python-2.5.2-binutils-no-dep.patch b/python-2.5.2-binutils-no-dep.patch
new file mode 100644
index 0000000..6792c9f
--- /dev/null
+++ b/python-2.5.2-binutils-no-dep.patch
@@ -0,0 +1,20 @@
+diff -ru Python-2.5.2-orig/Lib/ctypes/util.py Python-2.5.2/Lib/ctypes/util.py
+--- Python-2.5.2-orig/Lib/ctypes/util.py 2007-09-14 16:05:26.000000000 -0400
++++ Python-2.5.2/Lib/ctypes/util.py 2008-09-24 17:30:06.000000000 -0400
+@@ -83,9 +83,14 @@
+ if not f:
+ return None
+ cmd = "objdump -p -j .dynamic 2>/dev/null " + f
+- res = re.search(r'\sSONAME\s+([^\s]+)', os.popen(cmd).read())
++ try:
++ res = re.search(r'\sSONAME\s+([^\s]+)', os.popen(cmd).read())
++ except:
++ res = None
+ if not res:
+- return None
++ return os.path.basename(f) # This is good for GLibc, I think,
++ # and a dep on binutils is big (for
++ # live CDs).
+ return res.group(1)
+
+ if (sys.platform.startswith("freebsd")
diff --git a/python-2.5.2-db47.patch b/python-2.5.2-db47.patch
new file mode 100644
index 0000000..5dd3af2
--- /dev/null
+++ b/python-2.5.2-db47.patch
@@ -0,0 +1,78 @@
+diff -ru Python-2.5.2-orig/Modules/_bsddb.c Python-2.5.2/Modules/_bsddb.c
+--- Python-2.5.2-orig/Modules/_bsddb.c 2008-02-03 02:26:23.000000000 -0500
++++ Python-2.5.2/Modules/_bsddb.c 2008-09-24 17:01:50.000000000 -0400
+@@ -5335,11 +5335,13 @@
+ DBEnv_getattr(DBEnvObject* self, char *name)
+ {
+ if (!strcmp(name, "db_home")) {
++ const char *home = NULL;
+ CHECK_ENV_NOT_CLOSED(self);
+- if (self->db_env->db_home == NULL) {
++ self->db_env->get_home(self->db_env, &home);
++ if (home == NULL) {
+ RETURN_NONE();
+ }
+- return PyString_FromString(self->db_env->db_home);
++ return PyString_FromString(home);
+ }
+
+ return Py_FindMethod(DBEnv_methods, (PyObject* )self, name);
+@@ -5961,22 +5963,37 @@
+ ADD_INT(d, DB_TIME_NOTGRANTED);
+ ADD_INT(d, DB_TXN_NOT_DURABLE);
+ ADD_INT(d, DB_TXN_WRITE_NOSYNC);
+- ADD_INT(d, DB_LOG_AUTOREMOVE);
+- ADD_INT(d, DB_DIRECT_LOG);
+ ADD_INT(d, DB_DIRECT_DB);
+ ADD_INT(d, DB_INIT_REP);
+ ADD_INT(d, DB_ENCRYPT);
+ ADD_INT(d, DB_CHKSUM);
+ #endif
+
++#if (DBVER >= 42) && (DBVER < 47)
++ ADD_INT(d, DB_LOG_AUTOREMOVE);
++ ADD_INT(d, DB_DIRECT_LOG);
++#endif
++
++#if (DBVER >= 47)
++ ADD_INT(d, DB_LOG_DIRECT);
++ ADD_INT(d, DB_LOG_DSYNC);
++ ADD_INT(d, DB_LOG_IN_MEMORY);
++ ADD_INT(d, DB_LOG_AUTO_REMOVE);
++ ADD_INT(d, DB_LOG_ZERO);
++#endif
++
+ #if (DBVER >= 43)
+- ADD_INT(d, DB_LOG_INMEMORY);
+ ADD_INT(d, DB_BUFFER_SMALL);
+ ADD_INT(d, DB_SEQ_DEC);
+ ADD_INT(d, DB_SEQ_INC);
+ ADD_INT(d, DB_SEQ_WRAP);
+ #endif
+
++#if (DBVER >= 43) && (DBVER < 47)
++ ADD_INT(d, DB_LOG_INMEMORY);
++ ADD_INT(d, DB_DSYNC_LOG);
++#endif
++
+ #if (DBVER >= 41)
+ ADD_INT(d, DB_ENCRYPT_AES);
+ ADD_INT(d, DB_AUTO_COMMIT);
+diff -ru Python-2.5.2-orig/setup.py Python-2.5.2/setup.py
+--- Python-2.5.2-orig/setup.py 2008-09-24 17:01:02.000000000 -0400
++++ Python-2.5.2/setup.py 2008-09-24 17:03:05.000000000 -0400
+@@ -608,12 +608,12 @@
+ # a release. Most open source OSes come with one or more
+ # versions of BerkeleyDB already installed.
+
+- max_db_ver = (4, 5)
++ max_db_ver = (4, 7)
+ # NOTE: while the _bsddb.c code links against BerkeleyDB 4.6.x
+ # we leave that version disabled by default as it has proven to be
+ # quite a buggy library release on many platforms.
+ min_db_ver = (3, 3)
+- db_setup_debug = False # verbose debug prints from this script?
++ db_setup_debug = True # verbose debug prints from this script?
+
+ # construct a list of paths to look for the header file in on
+ # top of the normal inc_dirs.
diff --git a/python-2.5.2-set_wakeup_fd4.patch b/python-2.5.2-set_wakeup_fd4.patch
new file mode 100644
index 0000000..77ae208
--- /dev/null
+++ b/python-2.5.2-set_wakeup_fd4.patch
@@ -0,0 +1,86 @@
+diff -ru Python-2.5.2-orig/Modules/signalmodule.c Python-2.5.2/Modules/signalmodule.c
+--- Python-2.5.2-orig/Modules/signalmodule.c 2007-12-10 18:03:55.000000000 -0500
++++ Python-2.5.2/Modules/signalmodule.c 2008-09-24 17:32:45.000000000 -0400
+@@ -12,6 +12,8 @@
+
+ #include <signal.h>
+
++#include <sys/stat.h>
++
+ #ifndef SIG_ERR
+ #define SIG_ERR ((PyOS_sighandler_t)(-1))
+ #endif
+@@ -75,6 +77,8 @@
+ PyObject *func;
+ } Handlers[NSIG];
+
++static int wakeup_fd = -1;
++
+ /* Speed up sigcheck() when none tripped */
+ static volatile sig_atomic_t is_tripped = 0;
+
+@@ -113,6 +117,7 @@
+ static void
+ signal_handler(int sig_num)
+ {
++ const char dummy_byte = '\0';
+ #ifdef WITH_THREAD
+ #ifdef WITH_PTH
+ if (PyThread_get_thread_ident() != main_thread) {
+@@ -128,6 +133,8 @@
+ cleared in PyErr_CheckSignals() before .tripped. */
+ is_tripped = 1;
+ Py_AddPendingCall(checksignals_witharg, NULL);
++ if (wakeup_fd != -1)
++ write(wakeup_fd, &dummy_byte, 1);
+ #ifdef WITH_THREAD
+ }
+ #endif
+@@ -267,6 +274,39 @@
+ anything else -- the callable Python object used as a handler");
+
+
++static PyObject *
++signal_set_wakeup_fd(PyObject *self, PyObject *args)
++{
++ struct stat buf;
++ int fd, old_fd;
++ if (!PyArg_ParseTuple(args, "i:set_wakeup_fd", &fd))
++ return NULL;
++#ifdef WITH_THREAD
++ if (PyThread_get_thread_ident() != main_thread) {
++ PyErr_SetString(PyExc_ValueError,
++ "set_wakeup_fd only works in main thread");
++ return NULL;
++ }
++#endif
++ if (fd != -1 && fstat(fd, &buf) != 0) {
++ PyErr_SetString(PyExc_ValueError, "invalid fd");
++ return NULL;
++ }
++ old_fd = wakeup_fd;
++ wakeup_fd = fd;
++ return PyLong_FromLong(old_fd);
++}
++
++PyDoc_STRVAR(set_wakeup_fd_doc,
++"set_wakeup_fd(fd) -> fd\n\
++\n\
++Sets the fd to be written to (with '\\0') when a signal\n\
++comes in. A library can use this to wakeup select or poll.\n\
++The previous fd is returned.\n\
++\n\
++The fd must be non-blocking.");
++
++
+ /* List of functions defined in the module */
+ static PyMethodDef signal_methods[] = {
+ #ifdef HAVE_ALARM
+@@ -274,6 +314,7 @@
+ #endif
+ {"signal", signal_signal, METH_VARARGS, signal_doc},
+ {"getsignal", signal_getsignal, METH_VARARGS, getsignal_doc},
++ {"set_wakeup_fd", signal_set_wakeup_fd, METH_VARARGS, set_wakeup_fd_doc},
+ #ifdef HAVE_PAUSE
+ {"pause", (PyCFunction)signal_pause,
+ METH_NOARGS,pause_doc},
diff --git a/python.spec b/python.spec
index 4af3e72..a06fe67 100644
--- a/python.spec
+++ b/python.spec
@@ -21,8 +21,8 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
-Version: 2.5.1
-Release: 30%{?dist}
+Version: 2.5.2
+Release: 1%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -39,7 +39,7 @@ Patch6: python-2.5.1-plural-fix.patch
Patch7: python-2.5.1-sqlite-encoding.patch
Patch8: python-2.5-xmlrpclib-marshal-objects.patch
Patch9: python-2.5-tkinter.patch
-Patch10: python-2.5.1-binutils-no-dep.patch
+Patch10: python-2.5.2-binutils-no-dep.patch
Patch11: python-2.5.1-codec-ascii-tolower.patch
Patch12: python-2.5.1-pysqlite.patch
Patch13: python-2.5.1-socketmodule-constants.patch
@@ -51,16 +51,17 @@ Patch15: python-2.5.1-listdir.patch
Patch50: python-2.5-disable-egginfo.patch
# new db version
-Patch60: python-2.5.1-db47.patch
+Patch60: python-2.5.2-db47.patch
# lib64 patches
Patch101: python-2.3.4-lib64-regex.patch
Patch102: python-2.5-lib64.patch
# New API from 2.6
-Patch260: python2.6-set_wakeup_fd4.patch
+Patch260: python-2.5.2-set_wakeup_fd4.patch
Patch999: python-2.5.CVE-2007-4965-int-overflow.patch
+Patch998: python-2.5-CVE-2008-2316.patch
%if %{main_python}
@@ -206,7 +207,6 @@ code that uses more than just unittest and/or test_support.py.
%patch102 -p1 -b .lib64
%endif
-%patch9 -p1 -b .tkinter
%patch10 -p1 -b .binutils-no-dep
%patch11 -p1 -b .ascii-tolower
%patch12 -p1 -b .pysqlite-2.3.3-minimal
@@ -222,6 +222,7 @@ code that uses more than just unittest and/or test_support.py.
%patch260 -p1 -b .set_wakeup_fd
%patch999 -p1 -b .cve2007-4965
+%patch998 -p0 -b .cve2008-2316
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -510,6 +511,10 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
%changelog
+* Tue Sep 30 2008 James Antill <katzj(a)redhat.com> - 2.5.2-1
+- Move to 2.5.2
+- Fix CVE-2008-2316 hashlib overflow.
+
* Thu Jul 17 2008 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-30
- Fix up the build for new rpm
- And actually build against db4-4.7 (#455170)
diff --git a/sources b/sources
index e8a2035..3e35aea 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-70084ffa561660f07de466c2c8c4842d Python-2.5.1.tar.bz2
+afb5451049eda91fbde10bd5a4b7fadc Python-2.5.2.tar.bz2
commit 0d7f75554451ffb44c4d382cfd558a32ee8bf861
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Thu Jul 17 17:09:22 2008 +0000
bump the release as koji seems confused into thinking a -29 already exists
diff --git a/python.spec b/python.spec
index da27d97..4af3e72 100644
--- a/python.spec
+++ b/python.spec
@@ -22,7 +22,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: 2.5.1
-Release: 29%{?dist}
+Release: 30%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -510,10 +510,8 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
%changelog
-* Thu Jul 17 2008 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-29
+* Thu Jul 17 2008 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-30
- Fix up the build for new rpm
-
-* Thu Jul 17 2008 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-28
- And actually build against db4-4.7 (#455170)
* Thu Jul 10 2008 Tom "spot" Callaway <tcallawa(a)redhat.com> - 2.5.1-27
commit 64354453eec321d8bb0f5b547fa369e7cdc991a4
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Thu Jul 17 14:23:34 2008 +0000
- Fix up the build for new rpm
diff --git a/python.spec b/python.spec
index 5035f87..da27d97 100644
--- a/python.spec
+++ b/python.spec
@@ -2,6 +2,8 @@
#define __python_ver 25
%define unicode ucs4
+%define _default_patch_fuzz 2
+
%if "%{__python_ver}" != "EMPTY"
%define main_python 0
%define python python%{__python_ver}
@@ -20,7 +22,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: 2.5.1
-Release: 28%{?dist}
+Release: 29%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -80,7 +82,7 @@ BuildPrereq: libGL-devel tk tix gcc-c++ libX11-devel glibc-devel
BuildPrereq: bzip2 tar /usr/bin/find pkgconfig tcl-devel tk-devel
BuildPrereq: tix-devel bzip2-devel sqlite-devel
BuildPrereq: autoconf
-BuildPrereq: db4-devel >= 4.6
+BuildPrereq: db4-devel >= 4.7
URL:
http://www.python.org/
@@ -199,7 +201,7 @@ code that uses more than just unittest and/or test_support.py.
#patch50 -p1 -b .egginfo
%patch60 -p1 -b .db47
-%if %{_lib} == lib64
+%if "%{_lib}" == "lib64"
%patch101 -p1 -b .lib64-regex
%patch102 -p1 -b .lib64
%endif
@@ -368,7 +370,7 @@ find $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/lib-dynload -type f
| \
rm -f $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/email/test/data/audiotest.au
$RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/test/audiotest.au
# Fix bug #143667: python should own /usr/lib/python2.x on 64-bit machines
-%if %{_lib} == lib64
+%if "%{_lib}" == "lib64"
install -d $RPM_BUILD_ROOT/usr/lib/python%{pybasever}/site-packages
%endif
@@ -457,7 +459,7 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/test/__init__.py*
%{_libdir}/python%{pybasever}/wsgiref
%{_libdir}/python%{pybasever}/xml
-%if %{_lib} == lib64
+%if "%{_lib}" == "lib64"
%attr(0755,root,root) %dir /usr/lib/python%{pybasever}
%attr(0755,root,root) %dir /usr/lib/python%{pybasever}/site-packages
%endif
@@ -508,6 +510,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
%changelog
+* Thu Jul 17 2008 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-29
+- Fix up the build for new rpm
+
* Thu Jul 17 2008 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-28
- And actually build against db4-4.7 (#455170)
commit 0495debe933056f1c4ba894451f497cc699d57b5
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Thu Jul 17 13:39:58 2008 +0000
- And actually build against db4-4.7 (#455170)
diff --git a/python-2.5-config.patch b/python-2.5-config.patch
index a752e61..20b0573 100644
--- a/python-2.5-config.patch
+++ b/python-2.5-config.patch
@@ -248,7 +248,7 @@
-#DBINC=$(DB)/include
-#DBLIB=$(DB)/lib
-#_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
-+DBLIBVER=4.6
++DBLIBVER=4.7
+DBINC=/usr/include/db4
+DBLIB=/usr/lib
+_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
diff --git a/python.spec b/python.spec
index 4bacbc0..5035f87 100644
--- a/python.spec
+++ b/python.spec
@@ -20,7 +20,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: 2.5.1
-Release: 27%{?dist}
+Release: 28%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -508,6 +508,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
%changelog
+* Thu Jul 17 2008 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-28
+- And actually build against db4-4.7 (#455170)
+
* Thu Jul 10 2008 Tom "spot" Callaway <tcallawa(a)redhat.com> - 2.5.1-27
- fix license tag
- enable support for db4-4.7
commit 2d954f71f20988056cfd5f0a4a886371fadb1939
Author: Tom Callaway <spot(a)fedoraproject.org>
Date: Thu Jul 10 14:42:32 2008 +0000
fix license tag, enable support for db4-4.7 (based on PLD patch)
diff --git a/python-2.5.1-db47.patch b/python-2.5.1-db47.patch
new file mode 100644
index 0000000..3ae8364
--- /dev/null
+++ b/python-2.5.1-db47.patch
@@ -0,0 +1,93 @@
+diff -up Python-2.5.1/Modules/_bsddb.c.db46 Python-2.5.1/Modules/_bsddb.c
+--- Python-2.5.1/Modules/_bsddb.c.db46 2007-01-04 21:09:06.000000000 -0500
++++ Python-2.5.1/Modules/_bsddb.c 2008-07-10 09:58:55.000000000 -0400
+@@ -5306,11 +5306,13 @@ static PyObject*
+ DBEnv_getattr(DBEnvObject* self, char *name)
+ {
+ if (!strcmp(name, "db_home")) {
++ const char *home = NULL;
+ CHECK_ENV_NOT_CLOSED(self);
+- if (self->db_env->db_home == NULL) {
++ self->db_env->get_home(self->db_env, &home);
++ if (home == NULL) {
+ RETURN_NONE();
+ }
+- return PyString_FromString(self->db_env->db_home);
++ return PyString_FromString(home);
+ }
+
+ return Py_FindMethod(DBEnv_methods, (PyObject* )self, name);
+@@ -5932,22 +5934,37 @@ DL_EXPORT(void) init_bsddb(void)
+ ADD_INT(d, DB_TIME_NOTGRANTED);
+ ADD_INT(d, DB_TXN_NOT_DURABLE);
+ ADD_INT(d, DB_TXN_WRITE_NOSYNC);
+- ADD_INT(d, DB_LOG_AUTOREMOVE);
+- ADD_INT(d, DB_DIRECT_LOG);
+ ADD_INT(d, DB_DIRECT_DB);
+ ADD_INT(d, DB_INIT_REP);
+ ADD_INT(d, DB_ENCRYPT);
+ ADD_INT(d, DB_CHKSUM);
+ #endif
+
++#if (DBVER >= 42) && (DBVER < 47)
++ ADD_INT(d, DB_LOG_AUTOREMOVE);
++ ADD_INT(d, DB_DIRECT_LOG);
++#endif
++
++#if (DBVER >= 47)
++ ADD_INT(d, DB_LOG_DIRECT);
++ ADD_INT(d, DB_LOG_DSYNC);
++ ADD_INT(d, DB_LOG_IN_MEMORY);
++ ADD_INT(d, DB_LOG_AUTO_REMOVE);
++ ADD_INT(d, DB_LOG_ZERO);
++#endif
++
+ #if (DBVER >= 43)
+- ADD_INT(d, DB_LOG_INMEMORY);
+ ADD_INT(d, DB_BUFFER_SMALL);
+ ADD_INT(d, DB_SEQ_DEC);
+ ADD_INT(d, DB_SEQ_INC);
+ ADD_INT(d, DB_SEQ_WRAP);
+ #endif
+
++#if (DBVER >= 43) && (DBVER < 47)
++ ADD_INT(d, DB_LOG_INMEMORY);
++ ADD_INT(d, DB_DSYNC_LOG);
++#endif
++
+ #if (DBVER >= 41)
+ ADD_INT(d, DB_ENCRYPT_AES);
+ ADD_INT(d, DB_AUTO_COMMIT);
+diff -up Python-2.5.1/setup.py.db46 Python-2.5.1/setup.py
+--- Python-2.5.1/setup.py.db46 2008-07-10 09:55:08.000000000 -0400
++++ Python-2.5.1/setup.py 2008-07-10 09:55:08.000000000 -0400
+@@ -606,9 +606,9 @@ class PyBuildExt(build_ext):
+ # a release. Most open source OSes come with one or more
+ # versions of BerkeleyDB already installed.
+
+- max_db_ver = (4, 5)
++ max_db_ver = (4, 7)
+ min_db_ver = (3, 3)
+- db_setup_debug = False # verbose debug prints from this script?
++ db_setup_debug = True # verbose debug prints from this script?
+
+ # construct a list of paths to look for the header file in on
+ # top of the normal inc_dirs.
+@@ -623,7 +623,7 @@ class PyBuildExt(build_ext):
+ '/sw/include/db3',
+ ]
+ # 4.x minor number specific paths
+- for x in (0,1,2,3,4,5):
++ for x in (0,1,2,3,4,5,6,7):
+ db_inc_paths.append('/usr/include/db4%d' % x)
+ db_inc_paths.append('/usr/include/db4.%d' % x)
+ db_inc_paths.append('/usr/local/BerkeleyDB.4.%d/include' % x)
+@@ -646,7 +646,7 @@ class PyBuildExt(build_ext):
+ for dn in inc_dirs:
+ std_variants.append(os.path.join(dn, 'db3'))
+ std_variants.append(os.path.join(dn, 'db4'))
+- for x in (0,1,2,3,4):
++ for x in (0,1,2,3,4,5,6,7):
+ std_variants.append(os.path.join(dn, "db4%d"%x))
+ std_variants.append(os.path.join(dn, "db4.%d"%x))
+ for x in (2,3):
diff --git a/python-2.5.1-listdir.patch b/python-2.5.1-listdir.patch
new file mode 100644
index 0000000..1c4fc3f
--- /dev/null
+++ b/python-2.5.1-listdir.patch
@@ -0,0 +1,18 @@
+--- Python-2.5.1/Modules/posixmodule.c.orig 2007-04-04 14:30:56.000000000 -0400
++++ Python-2.5.1/Modules/posixmodule.c 2008-06-14 17:35:47.000000000 -0400
+@@ -2160,7 +2160,6 @@
+ struct dirent *ep;
+ int arg_is_unicode = 1;
+
+- errno = 0;
+ if (!PyArg_ParseTuple(args, "U:listdir", &v)) {
+ arg_is_unicode = 0;
+ PyErr_Clear();
+@@ -2176,6 +2175,7 @@
+ return NULL;
+ }
+ for (;;) {
++ errno = 0;
+ Py_BEGIN_ALLOW_THREADS
+ ep = readdir(dirp);
+ Py_END_ALLOW_THREADS
diff --git a/python.spec b/python.spec
index c6aada1..4bacbc0 100644
--- a/python.spec
+++ b/python.spec
@@ -20,8 +20,8 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: 2.5.1
-Release: 25%{?dist}
-License: Python Software Foundation License v2
+Release: 27%{?dist}
+License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
Provides: python(abi) = %{pybasever}
@@ -42,13 +42,14 @@ Patch11: python-2.5.1-codec-ascii-tolower.patch
Patch12: python-2.5.1-pysqlite.patch
Patch13: python-2.5.1-socketmodule-constants.patch
Patch14: python-2.5.1-socketmodule-constants2.patch
+Patch15: python-2.5.1-listdir.patch
# upstreamed
Patch50: python-2.5-disable-egginfo.patch
# new db version
-Patch60: python-2.5.1-db46.patch
+Patch60: python-2.5.1-db47.patch
# lib64 patches
Patch101: python-2.3.4-lib64-regex.patch
@@ -196,7 +197,7 @@ code that uses more than just unittest and/or test_support.py.
# Try not disabling egg-infos, bz#414711
#patch50 -p1 -b .egginfo
-%patch60 -p1 -b .db46
+%patch60 -p1 -b .db47
%if %{_lib} == lib64
%patch101 -p1 -b .lib64-regex
@@ -209,6 +210,7 @@ code that uses more than just unittest and/or test_support.py.
%patch12 -p1 -b .pysqlite-2.3.3-minimal
%patch13 -p1 -b .socketmodule
%patch14 -p1 -b .socketmodule
+%patch15 -p1 -b .socketmodule
%ifarch alpha ia64
# 64bit, but not lib64 arches need this too...
@@ -506,6 +508,14 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
%changelog
+* Thu Jul 10 2008 Tom "spot" Callaway <tcallawa(a)redhat.com> - 2.5.1-27
+- fix license tag
+- enable support for db4-4.7
+
+* Sun Jun 15 2008 James Antill <jantill(a)redhat.com> - 2.5.1-26
+- Fix sporadic listdir problem
+- Resolves: bug#451494
+
* Mon Apr 7 2008 James Antill <jantill(a)redhat.com> - 2.5.1-25
- Rebuild to re-gen autoconf file due to glibc change.
- Resolves: bug#441003
commit 55f2717a1ab49c514433532c50507cfbbb260a12
Author: James Antill <james(a)fedoraproject.org>
Date: Tue Apr 8 05:14:21 2008 +0000
- Rebuild to re-gen autoconf file due to glibc change.
- Resolves: bug#441003
diff --git a/python.spec b/python.spec
index 26cfbba..c6aada1 100644
--- a/python.spec
+++ b/python.spec
@@ -20,7 +20,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: 2.5.1
-Release: 24%{?dist}
+Release: 25%{?dist}
License: Python Software Foundation License v2
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -506,6 +506,10 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
%changelog
+* Mon Apr 7 2008 James Antill <jantill(a)redhat.com> - 2.5.1-25
+- Rebuild to re-gen autoconf file due to glibc change.
+- Resolves: bug#441003
+
* Tue Mar 25 2008 James Antill <jantill(a)redhat.com> - 2.5.1-24
- Add more constants to socketmodule
commit 1146d2adee42567e4bb922fa49a38e335a098bf7
Author: James Antill <james(a)fedoraproject.org>
Date: Tue Mar 25 14:15:20 2008 +0000
- Add more constants to socketmodule
diff --git a/python-2.5.1-socketmodule-constants2.patch
b/python-2.5.1-socketmodule-constants2.patch
new file mode 100644
index 0000000..93008b9
--- /dev/null
+++ b/python-2.5.1-socketmodule-constants2.patch
@@ -0,0 +1,20 @@
+diff -rup Python-2.5.1-orig/Modules/socketmodule.c Python-2.5.1/Modules/socketmodule.c
+--- Python-2.5.1-orig/Modules/socketmodule.c 2008-03-25 09:59:38.000000000 -0400
++++ Python-2.5.1/Modules/socketmodule.c 2008-03-25 10:12:24.000000000 -0400
+@@ -4977,6 +4977,15 @@ init_socket(void)
+ #ifdef TCP_QUICKACK
+ PyModule_AddIntConstant(m, "TCP_QUICKACK", TCP_QUICKACK);
+ #endif
++#ifdef TCP_CONGESTION
++ PyModule_AddIntConstant(m, "TCP_CONGESTION", TCP_CONGESTION);
++#endif
++#ifdef TCP_MD5SIG
++ PyModule_AddIntConstant(m, "TCP_MD5SIG", TCP_MD5SIG);
++#endif
++#ifdef TCP_MD5SIG_MAXKEYLEN
++ PyModule_AddIntConstant(m, "TCP_MD5SIG_MAXKEYLEN", TCP_MD5SIG_MAXKEYLEN);
++#endif
+
+
+ /* IPX options */
+Only in Python-2.5.1/Modules: socketmodule.c~
diff --git a/python.spec b/python.spec
index eac2720..26cfbba 100644
--- a/python.spec
+++ b/python.spec
@@ -20,7 +20,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: 2.5.1
-Release: 23%{?dist}
+Release: 24%{?dist}
License: Python Software Foundation License v2
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -41,6 +41,7 @@ Patch10: python-2.5.1-binutils-no-dep.patch
Patch11: python-2.5.1-codec-ascii-tolower.patch
Patch12: python-2.5.1-pysqlite.patch
Patch13: python-2.5.1-socketmodule-constants.patch
+Patch14: python-2.5.1-socketmodule-constants2.patch
# upstreamed
@@ -207,6 +208,7 @@ code that uses more than just unittest and/or test_support.py.
%patch11 -p1 -b .ascii-tolower
%patch12 -p1 -b .pysqlite-2.3.3-minimal
%patch13 -p1 -b .socketmodule
+%patch14 -p1 -b .socketmodule
%ifarch alpha ia64
# 64bit, but not lib64 arches need this too...
@@ -504,6 +506,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
%changelog
+* Tue Mar 25 2008 James Antill <jantill(a)redhat.com> - 2.5.1-24
+- Add more constants to socketmodule
+
* Sat Mar 8 2008 James Antill <jantill(a)redhat.com> - 2.5.1-22
- Add constants to socketmodule
- Resolves: bug#436560
commit b7ef3faff5621f2fc26f3750a47818cd297b2dba
Author: James Antill <james(a)fedoraproject.org>
Date: Sat Mar 8 04:29:13 2008 +0000
- Add constants to socketmodule
- Resolves: bug#436560
diff --git a/python-2.5.1-socketmodule-constants.patch
b/python-2.5.1-socketmodule-constants.patch
new file mode 100644
index 0000000..9dd1579
--- /dev/null
+++ b/python-2.5.1-socketmodule-constants.patch
@@ -0,0 +1,63 @@
+--- Python-2.5.1i-orig/Modules/socketmodule.c 2008-03-07 16:38:47.000000000 -0500
++++ Python-2.5.1/Modules/socketmodule.c 2008-03-07 16:41:09.000000000 -0500
+@@ -4507,6 +4507,60 @@
+ #ifdef SO_TYPE
+ PyModule_AddIntConstant(m, "SO_TYPE", SO_TYPE);
+ #endif
++#ifdef SO_SNDBUFFORCE
++ PyModule_AddIntConstant(m, "SO_SNDBUFFORCE", SO_SNDBUFFORCE);
++#endif
++#ifdef SO_RCVBUFFORCE
++ PyModule_AddIntConstant(m, "SO_RCVBUFFORCE", SO_RCVBUFFORCE);
++#endif
++#ifdef SO_NO_CHECK
++ PyModule_AddIntConstant(m, "SO_NO_CHECK", SO_NO_CHECK);
++#endif
++#ifdef SO_PRIORITY
++ PyModule_AddIntConstant(m, "SO_PRIORITY", SO_PRIORITY);
++#endif
++#ifdef SO_BSDCOMPAT
++ PyModule_AddIntConstant(m, "SO_BSDCOMPAT", SO_BSDCOMPAT);
++#endif
++#ifdef SO_PASSCRED
++ PyModule_AddIntConstant(m, "SO_PASSCRED", SO_PASSCRED);
++#endif
++#ifdef SO_PEERCRED
++ PyModule_AddIntConstant(m, "SO_PEERCRED", SO_PEERCRED);
++#endif
++#ifdef SO_SECURITY_AUTHENTICATION
++ PyModule_AddIntConstant(m, "SO_SECURITY_AUTHENTICATION",
SO_SECURITY_AUTHENTICATION);
++#endif
++#ifdef SO_SECURITY_ENCRYPTION_TRANSPORT
++ PyModule_AddIntConstant(m, "SO_SECURITY_ENCRYPTION_TRANSPORT",
SO_SECURITY_ENCRYPTION_TRANSPORT);
++#endif
++#ifdef SO_SECURITY_ENCRYPTION_NETWORK
++ PyModule_AddIntConstant(m, "SO_SECURITY_ENCRYPTION_NETWORK",
SO_SECURITY_ENCRYPTION_NETWORK);
++#endif
++#ifdef SO_BINDTODEVICE
++ PyModule_AddIntConstant(m, "SO_BINDTODEVICE", SO_BINDTODEVICE);
++#endif
++#ifdef SO_ATTACH_FILTER
++ PyModule_AddIntConstant(m, "SO_ATTACH_FILTER", SO_ATTACH_FILTER);
++#endif
++#ifdef SO_DETACH_FILTER
++ PyModule_AddIntConstant(m, "SO_DETACH_FILTER", SO_DETACH_FILTER);
++#endif
++#ifdef SO_PEERNAME
++ PyModule_AddIntConstant(m, "SO_PEERNAME", SO_PEERNAME);
++#endif
++#ifdef SO_TIMESTAMP
++ PyModule_AddIntConstant(m, "SO_TIMESTAMP", SO_TIMESTAMP);
++#endif
++#ifdef SO_PEERSEC
++ PyModule_AddIntConstant(m, "SO_PEERSEC", SO_PEERSEC);
++#endif
++#ifdef SO_PASSSEC
++ PyModule_AddIntConstant(m, "SO_PASSSEC", SO_PASSSEC);
++#endif
++#ifdef SO_TIMESTAMPNS
++ PyModule_AddIntConstant(m, "SO_TIMESTAMPNS", SO_TIMESTAMPNS);
++#endif
+
+ /* Maximum number of connections for "listen" */
+ #ifdef SOMAXCONN
diff --git a/python.spec b/python.spec
index 57db3c4..eac2720 100644
--- a/python.spec
+++ b/python.spec
@@ -20,7 +20,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: 2.5.1
-Release: 22%{?dist}
+Release: 23%{?dist}
License: Python Software Foundation License v2
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -40,6 +40,7 @@ Patch9: python-2.5-tkinter.patch
Patch10: python-2.5.1-binutils-no-dep.patch
Patch11: python-2.5.1-codec-ascii-tolower.patch
Patch12: python-2.5.1-pysqlite.patch
+Patch13: python-2.5.1-socketmodule-constants.patch
# upstreamed
@@ -205,6 +206,7 @@ code that uses more than just unittest and/or test_support.py.
%patch10 -p1 -b .binutils-no-dep
%patch11 -p1 -b .ascii-tolower
%patch12 -p1 -b .pysqlite-2.3.3-minimal
+%patch13 -p1 -b .socketmodule
%ifarch alpha ia64
# 64bit, but not lib64 arches need this too...
@@ -502,6 +504,10 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
%changelog
+* Sat Mar 8 2008 James Antill <jantill(a)redhat.com> - 2.5.1-22
+- Add constants to socketmodule
+- Resolves: bug#436560
+
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng(a)fedoraproject.org> -
2.5.1-22
- Autorebuild for GCC 4.3
commit cd233e5b70a6ce53e9b0aa4ecd01a4d3b17e086a
Author: Jesse Keating <jkeating(a)fedoraproject.org>
Date: Tue Feb 19 05:51:37 2008 +0000
- Autorebuild for GCC 4.3
diff --git a/python.spec b/python.spec
index ccddbc8..57db3c4 100644
--- a/python.spec
+++ b/python.spec
@@ -20,7 +20,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: 2.5.1
-Release: 21%{?dist}
+Release: 22%{?dist}
License: Python Software Foundation License v2
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -502,6 +502,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
%changelog
+* Tue Feb 19 2008 Fedora Release Engineering <rel-eng(a)fedoraproject.org> -
2.5.1-22
+- Autorebuild for GCC 4.3
+
* Sun Jan 13 2008 Tom "spot" Callaway <tcallawa(a)redhat.com> - 2.5.1-21
- rebuild for new tk in rawhide
commit 2c97c55e4ea19311de59e211051a8bd1dded3f73
Author: Tom Callaway <spot(a)fedoraproject.org>
Date: Sun Jan 13 17:06:17 2008 +0000
rebuild for new tk
diff --git a/python.spec b/python.spec
index 0ddf27f..ccddbc8 100644
--- a/python.spec
+++ b/python.spec
@@ -20,7 +20,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: 2.5.1
-Release: 20%{?dist}
+Release: 21%{?dist}
License: Python Software Foundation License v2
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -502,6 +502,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
%changelog
+* Sun Jan 13 2008 Tom "spot" Callaway <tcallawa(a)redhat.com> - 2.5.1-21
+- rebuild for new tk in rawhide
+
* Mon Jan 7 2008 James Antill <jantill(a)redhat.com> - 2.5.1-20
- Add valgrind support files, as doc, to python-devel
- Relates: rhbz#418621
commit 267e1ad96e03a4c1def1b9cbe39e513a87de9e5c
Author: James Antill <james(a)fedoraproject.org>
Date: Mon Jan 7 17:39:04 2008 +0000
- Add valgrind support files, as doc, to python-devel
- Relates: rhbz#418621
- Add new API from 2.6, set_wakeup_fd ... use at own risk, presumably won't
- change but I have no control to guarantee that.
- Resolves: rhbz#427794
- Add gdbinit support file, as doc, to python-devel
diff --git a/python.spec b/python.spec
index 221d9ad..0ddf27f 100644
--- a/python.spec
+++ b/python.spec
@@ -20,7 +20,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: 2.5.1
-Release: 19%{?dist}
+Release: 20%{?dist}
License: Python Software Foundation License v2
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -52,6 +52,9 @@ Patch60: python-2.5.1-db46.patch
Patch101: python-2.3.4-lib64-regex.patch
Patch102: python-2.5-lib64.patch
+# New API from 2.6
+Patch260: python2.6-set_wakeup_fd4.patch
+
Patch999: python-2.5.CVE-2007-4965-int-overflow.patch
@@ -208,6 +211,8 @@ code that uses more than just unittest and/or test_support.py.
%patch101 -p1 -b .lib64-regex
%endif
+%patch260 -p1 -b .set_wakeup_fd
+
%patch999 -p1 -b .cve2007-4965
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -459,6 +464,7 @@ rm -fr $RPM_BUILD_ROOT
%files devel
%defattr(-,root,root)
/usr/include/*
+%doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit
%dir %{_libdir}/python%{pybasever}/config
%{_libdir}/python%{pybasever}/config/*
%{_libdir}/libpython%{pybasever}.so
@@ -496,6 +502,14 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
%changelog
+* Mon Jan 7 2008 James Antill <jantill(a)redhat.com> - 2.5.1-20
+- Add valgrind support files, as doc, to python-devel
+- Relates: rhbz#418621
+- Add new API from 2.6, set_wakeup_fd ... use at own risk, presumably won't
+- change but I have no control to guarantee that.
+- Resolves: rhbz#427794
+- Add gdbinit support file, as doc, to python-devel
+
* Fri Jan 4 2008 Tom "spot" Callaway <tcallawa(a)redhat.com> - 2.5.1-19
- rebuild for new tcl/tk in rawhide
diff --git a/python2.6-set_wakeup_fd4.patch b/python2.6-set_wakeup_fd4.patch
new file mode 100644
index 0000000..76920a1
--- /dev/null
+++ b/python2.6-set_wakeup_fd4.patch
@@ -0,0 +1,86 @@
+diff -rup Python-2.5.1-orig/Modules/signalmodule.c Python-2.5.1/Modules/signalmodule.c
+--- Python-2.5.1-orig/Modules/signalmodule.c 2006-01-19 01:09:39.000000000 -0500
++++ Python-2.5.1/Modules/signalmodule.c 2008-01-07 12:32:00.000000000 -0500
+@@ -12,6 +12,8 @@
+
+ #include <signal.h>
+
++#include <sys/stat.h>
++
+ #ifndef SIG_ERR
+ #define SIG_ERR ((PyOS_sighandler_t)(-1))
+ #endif
+@@ -75,6 +77,8 @@ static struct {
+ PyObject *func;
+ } Handlers[NSIG];
+
++static int wakeup_fd = -1;
++
+ static int is_tripped = 0; /* Speed up sigcheck() when none tripped */
+
+ static PyObject *DefaultHandler;
+@@ -112,6 +116,7 @@ checksignals_witharg(void * unused)
+ static void
+ signal_handler(int sig_num)
+ {
++ const char dummy_byte = '\0';
+ #ifdef WITH_THREAD
+ #ifdef WITH_PTH
+ if (PyThread_get_thread_ident() != main_thread) {
+@@ -125,6 +130,8 @@ signal_handler(int sig_num)
+ is_tripped++;
+ Handlers[sig_num].tripped = 1;
+ Py_AddPendingCall(checksignals_witharg, NULL);
++ if (wakeup_fd != -1)
++ write(wakeup_fd, &dummy_byte, 1);
+ #ifdef WITH_THREAD
+ }
+ #endif
+@@ -264,6 +271,39 @@ None -- if an unknown handler is in effe
+ anything else -- the callable Python object used as a handler");
+
+
++static PyObject *
++signal_set_wakeup_fd(PyObject *self, PyObject *args)
++{
++ struct stat buf;
++ int fd, old_fd;
++ if (!PyArg_ParseTuple(args, "i:set_wakeup_fd", &fd))
++ return NULL;
++#ifdef WITH_THREAD
++ if (PyThread_get_thread_ident() != main_thread) {
++ PyErr_SetString(PyExc_ValueError,
++ "set_wakeup_fd only works in main thread");
++ return NULL;
++ }
++#endif
++ if (fd != -1 && fstat(fd, &buf) != 0) {
++ PyErr_SetString(PyExc_ValueError, "invalid fd");
++ return NULL;
++ }
++ old_fd = wakeup_fd;
++ wakeup_fd = fd;
++ return PyLong_FromLong(old_fd);
++}
++
++PyDoc_STRVAR(set_wakeup_fd_doc,
++"set_wakeup_fd(fd) -> fd\n\
++\n\
++Sets the fd to be written to (with '\\0') when a signal\n\
++comes in. A library can use this to wakeup select or poll.\n\
++The previous fd is returned.\n\
++\n\
++The fd must be non-blocking.");
++
++
+ /* List of functions defined in the module */
+ static PyMethodDef signal_methods[] = {
+ #ifdef HAVE_ALARM
+@@ -271,6 +311,7 @@ static PyMethodDef signal_methods[] = {
+ #endif
+ {"signal", signal_signal, METH_VARARGS, signal_doc},
+ {"getsignal", signal_getsignal, METH_VARARGS, getsignal_doc},
++ {"set_wakeup_fd", signal_set_wakeup_fd, METH_VARARGS, set_wakeup_fd_doc},
+ #ifdef HAVE_PAUSE
+ {"pause", (PyCFunction)signal_pause,
+ METH_NOARGS,pause_doc},
commit ab3e7504f5f15ede84a16a56cca72e5bcbeb765a
Author: Tom Callaway <spot(a)fedoraproject.org>
Date: Fri Jan 4 15:29:24 2008 +0000
2008 typo, first one I've actually committed to CVS, not likely to be the
last.
diff --git a/python.spec b/python.spec
index bbafe36..221d9ad 100644
--- a/python.spec
+++ b/python.spec
@@ -496,7 +496,7 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
%changelog
-* Fri Jan 4 2007 Tom "spot" Callaway <tcallawa(a)redhat.com> - 2.5.1-19
+* Fri Jan 4 2008 Tom "spot" Callaway <tcallawa(a)redhat.com> - 2.5.1-19
- rebuild for new tcl/tk in rawhide
* Fri Dec 7 2007 James Antill <jantill(a)redhat.com> - 2.5.1-18
commit accb85a76cc961709771084603d810a92113a631
Author: Tom Callaway <spot(a)fedoraproject.org>
Date: Fri Jan 4 15:28:07 2008 +0000
Rebuild for new tcl/tk in rawhide
diff --git a/python.spec b/python.spec
index e2074b2..bbafe36 100644
--- a/python.spec
+++ b/python.spec
@@ -20,7 +20,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: 2.5.1
-Release: 18%{?dist}
+Release: 19%{?dist}
License: Python Software Foundation License v2
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -496,6 +496,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
%changelog
+* Fri Jan 4 2007 Tom "spot" Callaway <tcallawa(a)redhat.com> - 2.5.1-19
+- rebuild for new tcl/tk in rawhide
+
* Fri Dec 7 2007 James Antill <jantill(a)redhat.com> - 2.5.1-18
- Create a python-test sub-module, over 3MB of stuff noone wants.
- Don't remove egginfo files, try this see what happens ... may revert.
commit 860ed4856c8af7b8fc75f22f7b1dab5007b1e5a0
Author: James Antill <james(a)fedoraproject.org>
Date: Fri Dec 7 22:50:04 2007 +0000
- Create a python-test sub-module, over 3MB of stuff noone wants.
- Don't remove egginfo files, try this see what happens ... may revert.
- Resolves: rhbz#414711
diff --git a/python.spec b/python.spec
index 2db36c4..e2074b2 100644
--- a/python.spec
+++ b/python.spec
@@ -20,7 +20,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: 2.5.1
-Release: 17%{?dist}
+Release: 18%{?dist}
License: Python Software Foundation License v2
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -43,7 +43,6 @@ Patch12: python-2.5.1-pysqlite.patch
# upstreamed
-# disable egg-infos for now
Patch50: python-2.5-disable-egginfo.patch
# new db version
@@ -163,6 +162,20 @@ the Python scripting language.
You should install the tkinter package if you'd like to use a graphical
user interface for Python programming.
+%package test
+Summary: The test modules from the main python package
+Group: Development/Languages
+Requires: %{name} = %{version}-%{release}
+
+%description test
+
+The test modules from the main python pacakge: %{name}
+These have been removed to save space, as they are never or almost
+never used in production.
+
+You might want to install the python-test package if you're developing python
+code that uses more than just unittest and/or test_support.py.
+
%prep
%setup -q -n Python-%{version}
@@ -176,7 +189,8 @@ user interface for Python programming.
%patch7 -p1
%patch8 -p1 -b .xmlrpc
-%patch50 -p1 -b .egginfo
+# Try not disabling egg-infos, bz#414711
+#patch50 -p1 -b .egginfo
%patch60 -p1 -b .db46
%if %{_lib} == lib64
@@ -242,8 +256,13 @@ for fixed in $RPM_BUILD_ROOT%{_bindir}/pydoc; do
&& cat $fixed- > $fixed && rm -f $fixed-
done
+# Junk, no point in putting in -test sub-pkg
+rm -f $RPM_BUILD_ROOT/%{_libdir}/python%{pybasever}/idlelib/testcode.py*
+
# don't include tests that are run at build time in the package
# This is documented, and used: rhbz#387401
+if /bin/false; then
+ # Move this to -test subpackage.
mkdir save_bits_of_test
for i in test_support.py __init__.py; do
cp -a $RPM_BUILD_ROOT/%{_libdir}/python%{pybasever}/test/$i save_bits_of_test
@@ -251,6 +270,7 @@ done
rm -rf $RPM_BUILD_ROOT/%{_libdir}/python%{pybasever}/test
mkdir $RPM_BUILD_ROOT/%{_libdir}/python%{pybasever}/test
cp -a save_bits_of_test/* $RPM_BUILD_ROOT/%{_libdir}/python%{pybasever}/test
+fi
%if %{main_python}
ln -s python $RPM_BUILD_ROOT%{_bindir}/python2
@@ -327,7 +347,11 @@ popd
%endif
find $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/lib-dynload -type d | sed
"s|$RPM_BUILD_ROOT|%dir |" > dynfiles
-find $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/lib-dynload -type f | grep -v
"_tkinter.so$" | sed "s|$RPM_BUILD_ROOT||" >> dynfiles
+find $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/lib-dynload -type f | \
+ grep -v "_tkinter.so$" | \
+ grep -v "_ctypes_test.so$" | \
+ grep -v "_testcapimodule.so$" | \
+ sed "s|$RPM_BUILD_ROOT||" >> dynfiles
# Fix for bug #136654
rm -f $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/email/test/data/audiotest.au
$RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/test/audiotest.au
@@ -396,19 +420,30 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/site-packages/README
%{_libdir}/python%{pybasever}/*.py*
%{_libdir}/python%{pybasever}/*.doc
-%{_libdir}/python%{pybasever}/bsddb
+%dir %{_libdir}/python%{pybasever}/bsddb
+%{_libdir}/python%{pybasever}/bsddb/*.py*
%{_libdir}/python%{pybasever}/compiler
-%{_libdir}/python%{pybasever}/ctypes
+%dir %{_libdir}/python%{pybasever}/ctypes
+%{_libdir}/python%{pybasever}/ctypes/*.py*
+%{_libdir}/python%{pybasever}/ctypes/macholib
%{_libdir}/python%{pybasever}/curses
-%{_libdir}/python%{pybasever}/distutils
-%{_libdir}/python%{pybasever}/email
+%dir %{_libdir}/python%{pybasever}/distutils
+%{_libdir}/python%{pybasever}/distutils/*.py*
+%{_libdir}/python%{pybasever}/distutils/README
+%{_libdir}/python%{pybasever}/distutils/command
+%dir %{_libdir}/python%{pybasever}/email
+%{_libdir}/python%{pybasever}/email/*.py*
+%{_libdir}/python%{pybasever}/email/mime
%{_libdir}/python%{pybasever}/encodings
%{_libdir}/python%{pybasever}/hotshot
%{_libdir}/python%{pybasever}/idlelib
%{_libdir}/python%{pybasever}/logging
%{_libdir}/python%{pybasever}/plat-linux2
-%{_libdir}/python%{pybasever}/sqlite3
-%{_libdir}/python%{pybasever}/test
+%dir %{_libdir}/python%{pybasever}/sqlite3
+%{_libdir}/python%{pybasever}/sqlite3/*.py*
+%dir %{_libdir}/python%{pybasever}/test
+%{_libdir}/python%{pybasever}/test/test_support.py*
+%{_libdir}/python%{pybasever}/test/__init__.py*
%{_libdir}/python%{pybasever}/wsgiref
%{_libdir}/python%{pybasever}/xml
%if %{_lib} == lib64
@@ -449,7 +484,23 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-tk
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
+%files test
+%defattr(-, root, root)
+%{_libdir}/python%{pybasever}/bsddb/test
+%{_libdir}/python%{pybasever}/ctypes/test
+%{_libdir}/python%{pybasever}/distutils/tests
+%{_libdir}/python%{pybasever}/email/test
+%{_libdir}/python%{pybasever}/sqlite3/test
+%{_libdir}/python%{pybasever}/test
+%{_libdir}/python%{pybasever}/lib-dynload/_ctypes_test.so
+%{_libdir}/python%{pybasever}/lib-dynload/_testcapimodule.so
+
%changelog
+* Fri Dec 7 2007 James Antill <jantill(a)redhat.com> - 2.5.1-18
+- Create a python-test sub-module, over 3MB of stuff noone wants.
+- Don't remove egginfo files, try this see what happens ... may revert.
+- Resolves: rhbz#414711
+
* Mon Dec 3 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-17
- rebuild for new libssl
commit da14e7e07e46623d8dc8695d161803ca0cbf6484
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Mon Dec 3 18:36:45 2007 +0000
- rebuild for new libssl
diff --git a/python.spec b/python.spec
index 808b5c6..2db36c4 100644
--- a/python.spec
+++ b/python.spec
@@ -20,7 +20,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: 2.5.1
-Release: 16%{?dist}
+Release: 17%{?dist}
License: Python Software Foundation License v2
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -450,6 +450,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Mon Dec 3 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-17
+- rebuild for new libssl
+
* Fri Nov 30 2007 James Antill <jantill(a)redhat.com> - 2.5.1-16
- Fix pyconfig.h comment typo.
- Add back test_support.py and the __init__.py file.
commit 85670aac8c20aa62a0de343a0b089cb08205237c
Author: James Antill <james(a)fedoraproject.org>
Date: Fri Nov 30 13:42:33 2007 +0000
- Fix pyconfig.h comment typo.
- Add back test_support.py and the __init__.py file.
- Resolves: rhbz#387401
diff --git a/python.spec b/python.spec
index 9404db7..808b5c6 100644
--- a/python.spec
+++ b/python.spec
@@ -408,6 +408,7 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/logging
%{_libdir}/python%{pybasever}/plat-linux2
%{_libdir}/python%{pybasever}/sqlite3
+%{_libdir}/python%{pybasever}/test
%{_libdir}/python%{pybasever}/wsgiref
%{_libdir}/python%{pybasever}/xml
%if %{_lib} == lib64
commit 59062c044b9902a7e94ab865bce1309c6b21c8b8
Author: James Antill <james(a)fedoraproject.org>
Date: Fri Nov 30 05:31:41 2007 +0000
- Fix pyconfig.h comment typo.
- Add back test_support.py and the __init__.py file.
- Resolves: rhbz#387401
diff --git a/python-2.5-tkinter.patch b/python-2.5-tkinter.patch
new file mode 100644
index 0000000..f040ca1
--- /dev/null
+++ b/python-2.5-tkinter.patch
@@ -0,0 +1,11 @@
+--- Python-2.5-orig/Modules/_tkinter.c 2006-08-11 22:33:36.000000000 -0400
++++ Python-2.5/Modules/_tkinter.c 2007-10-19 01:04:42.000000000 -0400
+@@ -938,7 +938,7 @@
+ #if defined(Py_UNICODE_WIDE) && TCL_UTF_MAX == 3
+ Tcl_UniChar *outbuf;
+ Py_ssize_t i;
+- assert(size < size * sizeof(Tcl_UniChar));
++ assert(size == 0 || size < size * sizeof(Tcl_UniChar));
+ outbuf = (Tcl_UniChar*)ckalloc(size * sizeof(Tcl_UniChar));
+ if (!outbuf) {
+ PyErr_NoMemory();
diff --git a/python-2.5.1-binutils-no-dep.patch b/python-2.5.1-binutils-no-dep.patch
new file mode 100644
index 0000000..7880eb6
--- /dev/null
+++ b/python-2.5.1-binutils-no-dep.patch
@@ -0,0 +1,21 @@
+diff -rup Python-2.5.1-orig/Lib/ctypes/util.py Python-2.5.1/Lib/ctypes/util.py
+--- Python-2.5.1-orig/Lib/ctypes/util.py 2007-01-17 14:53:24.000000000 -0500
++++ Python-2.5.1/Lib/ctypes/util.py 2007-10-24 11:06:12.000000000 -0400
+@@ -71,9 +71,13 @@ elif os.name == "posix":
+ if not f:
+ return None
+ cmd = "objdump -p -j .dynamic 2>/dev/null " + f
+- res = re.search(r'\sSONAME\s+([^\s]+)', os.popen(cmd).read())
++ try:
++ res = re.search(r'\sSONAME\s+([^\s]+)', os.popen(cmd).read())
++ except:
++ res = None
+ if not res:
+- return None
++ return os.path.basename(f) # This is good for GLibc, I think, and a
++ # dep on binutils is big (for live CDs).
+ return res.group(1)
+
+ if (sys.platform.startswith("freebsd")
+Only in Python-2.5.1/Lib/ctypes: util.py~
+Only in Python-2.5.1/Lib/ctypes: util.py.binutils-no-dep
diff --git a/python-2.5.1-codec-ascii-tolower.patch
b/python-2.5.1-codec-ascii-tolower.patch
new file mode 100644
index 0000000..81a123d
--- /dev/null
+++ b/python-2.5.1-codec-ascii-tolower.patch
@@ -0,0 +1,25 @@
+diff -rup Python-2.5.1-orig/Python/codecs.c Python-2.5.1/Python/codecs.c
+--- Python-2.5.1-orig/Python/codecs.c 2006-06-23 17:16:18.000000000 -0400
++++ Python-2.5.1/Python/codecs.c 2007-10-30 12:51:10.000000000 -0400
+@@ -45,6 +45,11 @@ int PyCodec_Register(PyObject *search_fu
+ return -1;
+ }
+
++/* isupper() forced into the ASCII Locale */
++#define ascii_isupper(x) (((x) >= 0x41) && ((x) <= 0x5A))
++/* tolower() forced into the ASCII Locale */
++#define ascii_tolower(x) (ascii_isupper(x) ? ((x) + 0x20) : (x))
++
+ /* Convert a string to a normalized Python string: all characters are
+ converted to lower case, spaces are replaced with underscores. */
+
+@@ -70,7 +75,7 @@ PyObject *normalizestring(const char *st
+ if (ch == ' ')
+ ch = '-';
+ else
+- ch = tolower(Py_CHARMASK(ch));
++ ch = ascii_tolower(Py_CHARMASK(ch));
+ p[i] = ch;
+ }
+ return v;
+Only in Python-2.5.1/Python: codecs.c~
diff --git a/python-2.5.1-pysqlite.patch b/python-2.5.1-pysqlite.patch
new file mode 100644
index 0000000..ce4f936
--- /dev/null
+++ b/python-2.5.1-pysqlite.patch
@@ -0,0 +1,33 @@
+diff -up Python-2.5.1/Modules/_sqlite/cache.h.pysqlite
Python-2.5.1/Modules/_sqlite/cache.h
+--- Python-2.5.1/Modules/_sqlite/cache.h.pysqlite 2006-04-23 16:24:26.000000000 +0100
++++ Python-2.5.1/Modules/_sqlite/cache.h 2007-10-25 11:21:31.000000000 +0100
+@@ -64,7 +64,7 @@ extern PyTypeObject CacheType;
+ int node_init(Node* self, PyObject* args, PyObject* kwargs);
+ void node_dealloc(Node* self);
+
+-int cache_init(Cache* self, PyObject* args, PyObject* kwargs);
++int pysqlite_cache_init(Cache* self, PyObject* args, PyObject* kwargs);
+ void cache_dealloc(Cache* self);
+ PyObject* cache_get(Cache* self, PyObject* args);
+
+diff -up Python-2.5.1/Modules/_sqlite/cache.c.pysqlite
Python-2.5.1/Modules/_sqlite/cache.c
+--- Python-2.5.1/Modules/_sqlite/cache.c.pysqlite 2006-04-23 16:24:26.000000000 +0100
++++ Python-2.5.1/Modules/_sqlite/cache.c 2007-10-25 11:22:10.000000000 +0100
+@@ -54,7 +54,7 @@ void node_dealloc(Node* self)
+ self->ob_type->tp_free((PyObject*)self);
+ }
+
+-int cache_init(Cache* self, PyObject* args, PyObject* kwargs)
++int pysqlite_cache_init(Cache* self, PyObject* args, PyObject* kwargs)
+ {
+ PyObject* factory;
+ int size = 10;
+@@ -352,7 +352,7 @@ PyTypeObject CacheType = {
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+- (initproc)cache_init, /* tp_init */
++ (initproc)pysqlite_cache_init, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0 /* tp_free */
diff --git a/python-2.5.CVE-2007-4965-int-overflow.patch
b/python-2.5.CVE-2007-4965-int-overflow.patch
new file mode 100644
index 0000000..ad26707
--- /dev/null
+++ b/python-2.5.CVE-2007-4965-int-overflow.patch
@@ -0,0 +1,221 @@
+diff -ru Python-2.5-orig/Modules/imageop.c Python-2.5/Modules/imageop.c
+--- Python-2.5-orig/Modules/imageop.c 2006-01-19 01:09:39.000000000 -0500
++++ Python-2.5/Modules/imageop.c 2007-10-19 01:11:33.000000000 -0400
+@@ -78,7 +78,7 @@
+ char *cp, *ncp;
+ short *nsp;
+ Py_Int32 *nlp;
+- int len, size, x, y, newx1, newx2, newy1, newy2;
++ int len, size, x, y, newx1, newx2, newy1, newy2, nlen;
+ int ix, iy, xstep, ystep;
+ PyObject *rv;
+
+@@ -90,13 +90,19 @@
+ PyErr_SetString(ImageopError, "Size should be 1, 2 or 4");
+ return 0;
+ }
+- if ( len != size*x*y ) {
++ if (( len != size*x*y ) ||
++ ( size != ((len / x) / y) )) {
+ PyErr_SetString(ImageopError, "String has incorrect length");
+ return 0;
+ }
+ xstep = (newx1 < newx2)? 1 : -1;
+ ystep = (newy1 < newy2)? 1 : -1;
+
++ nlen = (abs(newx2-newx1)+1)*(abs(newy2-newy1)+1)*size;
++ if ( size != ((nlen / (abs(newx2-newx1)+1)) / (abs(newy2-newy1)+1)) ) {
++ PyErr_SetString(ImageopError, "String has incorrect length");
++ return 0;
++ }
+ rv = PyString_FromStringAndSize(NULL,
+ (abs(newx2-newx1)+1)*(abs(newy2-newy1)+1)*size);
+ if ( rv == 0 )
+@@ -132,7 +138,7 @@
+ char *cp, *ncp;
+ short *nsp;
+ Py_Int32 *nlp;
+- int len, size, x, y, newx, newy;
++ int len, size, x, y, newx, newy, nlen;
+ int ix, iy;
+ int oix, oiy;
+ PyObject *rv;
+@@ -145,12 +151,18 @@
+ PyErr_SetString(ImageopError, "Size should be 1, 2 or 4");
+ return 0;
+ }
+- if ( len != size*x*y ) {
++ if ( ( len != size*x*y ) ||
++ ( size != ((len / x) / y) ) ) {
++ PyErr_SetString(ImageopError, "String has incorrect length");
++ return 0;
++ }
++ nlen = newx*newy*size;
++ if ( size != ((nlen / newx) / newy) ) {
+ PyErr_SetString(ImageopError, "String has incorrect length");
+ return 0;
+ }
+
+- rv = PyString_FromStringAndSize(NULL, newx*newy*size);
++ rv = PyString_FromStringAndSize(NULL, nlen);
+ if ( rv == 0 )
+ return 0;
+ ncp = (char *)PyString_AsString(rv);
+@@ -190,7 +202,8 @@
+ PyErr_SetString(ImageopError, "Size should be 1 or 4");
+ return 0;
+ }
+- if ( maxx*maxy*width != len ) {
++ if ( ( maxx*maxy*width != len ) ||
++ ( maxx != ((len / maxy) / width) ) ) {
+ PyErr_SetString(ImageopError, "String has incorrect length");
+ return 0;
+ }
+@@ -240,7 +253,8 @@
+ if ( !PyArg_ParseTuple(args, "s#iii", &cp, &len, &x, &y,
&tres) )
+ return 0;
+
+- if ( x*y != len ) {
++ if ( ( x*y != len ) ||
++ ( x != len / y ) ) {
+ PyErr_SetString(ImageopError, "String has incorrect length");
+ return 0;
+ }
+@@ -281,7 +295,8 @@
+ if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) )
+ return 0;
+
+- if ( x*y != len ) {
++ if ( ( x*y != len ) ||
++ ( x != len / y ) ) {
+ PyErr_SetString(ImageopError, "String has incorrect length");
+ return 0;
+ }
+@@ -320,7 +335,8 @@
+ if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) )
+ return 0;
+
+- if ( x*y != len ) {
++ if ( ( x*y != len ) ||
++ ( x != len / y ) ) {
+ PyErr_SetString(ImageopError, "String has incorrect length");
+ return 0;
+ }
+@@ -358,7 +374,8 @@
+ if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) )
+ return 0;
+
+- if ( x*y != len ) {
++ if ( ( x*y != len ) ||
++ ( x != len / y ) ) {
+ PyErr_SetString(ImageopError, "String has incorrect length");
+ return 0;
+ }
+@@ -404,7 +421,8 @@
+ if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) )
+ return 0;
+
+- if ( x*y != len ) {
++ if ( ( x*y != len ) ||
++ ( x != len / y ) ) {
+ PyErr_SetString(ImageopError, "String has incorrect length");
+ return 0;
+ }
+@@ -443,7 +461,11 @@
+ if ( !PyArg_ParseTuple(args, "s#iiii", &cp, &len, &x, &y,
&v0, &v1) )
+ return 0;
+
+- nlen = x*y;
++ nlen = x*y;
++ if ( x != (nlen / y) ) {
++ PyErr_SetString(ImageopError, "String has incorrect length");
++ return 0;
++ }
+ if ( (nlen+7)/8 != len ) {
+ PyErr_SetString(ImageopError, "String has incorrect length");
+ return 0;
+@@ -481,6 +503,10 @@
+ return 0;
+
+ nlen = x*y;
++ if ( x != (nlen / y) ) {
++ PyErr_SetString(ImageopError, "String has incorrect length");
++ return 0;
++ }
+ if ( (nlen+3)/4 != len ) {
+ PyErr_SetString(ImageopError, "String has incorrect length");
+ return 0;
+@@ -517,6 +543,10 @@
+ return 0;
+
+ nlen = x*y;
++ if ( x != (nlen / y) ) {
++ PyErr_SetString(ImageopError, "String has incorrect length");
++ return 0;
++ }
+ if ( (nlen+1)/2 != len ) {
+ PyErr_SetString(ImageopError, "String has incorrect length");
+ return 0;
+@@ -554,6 +584,10 @@
+ return 0;
+
+ nlen = x*y;
++ if ( x != (nlen / y) ) {
++ PyErr_SetString(ImageopError, "String has incorrect length");
++ return 0;
++ }
+ if ( nlen*4 != len ) {
+ PyErr_SetString(ImageopError, "String has incorrect length");
+ return 0;
+@@ -598,6 +632,10 @@
+ return 0;
+
+ nlen = x*y;
++ if ( x != (nlen / y) ) {
++ PyErr_SetString(ImageopError, "String has incorrect length");
++ return 0;
++ }
+ if ( nlen != len ) {
+ PyErr_SetString(ImageopError, "String has incorrect length");
+ return 0;
+@@ -648,6 +686,10 @@
+ return 0;
+
+ nlen = x*y;
++ if ( x != (nlen / y) ) {
++ PyErr_SetString(ImageopError, "String has incorrect length");
++ return 0;
++ }
+ if ( nlen*4 != len ) {
+ PyErr_SetString(ImageopError, "String has incorrect length");
+ return 0;
+@@ -693,6 +735,10 @@
+ return 0;
+
+ nlen = x*y;
++ if ( x != (nlen / y) ) {
++ PyErr_SetString(ImageopError, "String has incorrect length");
++ return 0;
++ }
+ if ( nlen != len ) {
+ PyErr_SetString(ImageopError, "String has incorrect length");
+ return 0;
+Only in Python-2.5/Modules: imageop.c~
+Only in Python-2.5/Modules: imageop.c.cve2007-4965
+diff -ru Python-2.5-orig/Modules/rgbimgmodule.c Python-2.5/Modules/rgbimgmodule.c
+--- Python-2.5-orig/Modules/rgbimgmodule.c 2006-08-11 23:18:50.000000000 -0400
++++ Python-2.5/Modules/rgbimgmodule.c 2007-10-19 01:05:44.000000000 -0400
+@@ -299,6 +299,11 @@
+ xsize = image.xsize;
+ ysize = image.ysize;
+ zsize = image.zsize;
++ tablen = xsize * ysize * zsize * sizeof(Py_Int32);
++ if (xsize != (((tablen / ysize) / zsize) / sizeof(Py_Int32))) {
++ PyErr_NoMemory();
++ goto finally;
++ }
+ if (rle) {
+ tablen = ysize * zsize * sizeof(Py_Int32);
+ starttab = (Py_Int32 *)malloc(tablen);
+Only in Python-2.5/Modules: rgbimgmodule.c.cve2007-4965
+Only in Python-2.5/Modules: _tkinter.c.tkinter
diff --git a/python.spec b/python.spec
index bb43218..9404db7 100644
--- a/python.spec
+++ b/python.spec
@@ -20,7 +20,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: 2.5.1
-Release: 12%{?dist}
+Release: 16%{?dist}
License: Python Software Foundation License v2
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -36,6 +36,10 @@ Patch5: python-2.5.1-ctypes-exec-stack.patch
Patch6: python-2.5.1-plural-fix.patch
Patch7: python-2.5.1-sqlite-encoding.patch
Patch8: python-2.5-xmlrpclib-marshal-objects.patch
+Patch9: python-2.5-tkinter.patch
+Patch10: python-2.5.1-binutils-no-dep.patch
+Patch11: python-2.5.1-codec-ascii-tolower.patch
+Patch12: python-2.5.1-pysqlite.patch
# upstreamed
@@ -49,6 +53,8 @@ Patch60: python-2.5.1-db46.patch
Patch101: python-2.3.4-lib64-regex.patch
Patch102: python-2.5-lib64.patch
+Patch999: python-2.5.CVE-2007-4965-int-overflow.patch
+
%if %{main_python}
Obsoletes: Distutils
@@ -65,7 +71,7 @@ Provides: python-ctypes = 1.0.1
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildPrereq: readline-devel, openssl-devel, gmp-devel
BuildPrereq: ncurses-devel, gdbm-devel, zlib-devel, expat-devel
-BuildPrereq: libGL-devel tk gcc-c++ libX11-devel glibc-devel
+BuildPrereq: libGL-devel tk tix gcc-c++ libX11-devel glibc-devel
BuildPrereq: bzip2 tar /usr/bin/find pkgconfig tcl-devel tk-devel
BuildPrereq: tix-devel bzip2-devel sqlite-devel
BuildPrereq: autoconf
@@ -94,6 +100,8 @@ package.
Summary: The libraries for python runtime
Group: Applications/System
Requires: %{python} = %{version}-%{release}
+# Needed for ctypes, to load libraries, worked around for Live CDs size
+# Requires: binutils
%description libs
The python interpreter can be embedded into applications wanting to
@@ -176,11 +184,18 @@ user interface for Python programming.
%patch102 -p1 -b .lib64
%endif
+%patch9 -p1 -b .tkinter
+%patch10 -p1 -b .binutils-no-dep
+%patch11 -p1 -b .ascii-tolower
+%patch12 -p1 -b .pysqlite-2.3.3-minimal
+
%ifarch alpha ia64
# 64bit, but not lib64 arches need this too...
%patch101 -p1 -b .lib64-regex
%endif
+%patch999 -p1 -b .cve2007-4965
+
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -228,7 +243,14 @@ for fixed in $RPM_BUILD_ROOT%{_bindir}/pydoc; do
done
# don't include tests that are run at build time in the package
+# This is documented, and used: rhbz#387401
+mkdir save_bits_of_test
+for i in test_support.py __init__.py; do
+ cp -a $RPM_BUILD_ROOT/%{_libdir}/python%{pybasever}/test/$i save_bits_of_test
+done
rm -rf $RPM_BUILD_ROOT/%{_libdir}/python%{pybasever}/test
+mkdir $RPM_BUILD_ROOT/%{_libdir}/python%{pybasever}/test
+cp -a save_bits_of_test/* $RPM_BUILD_ROOT/%{_libdir}/python%{pybasever}/test
%if %{main_python}
ln -s python $RPM_BUILD_ROOT%{_bindir}/python2
@@ -334,7 +356,7 @@ cat > $RPM_BUILD_ROOT%{_includedir}/python%{pybasever}/pyconfig.h
<< EOF
#elif __WORDSIZE == 64
#include "%{_pyconfig64_h}"
#else
-#error "Unkown word size"
+#error "Unknown word size"
#endif
EOF
ln -s ../../libpython%{pybasever}.so
$RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/config/libpython%{pybasever}.so
@@ -427,6 +449,29 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Fri Nov 30 2007 James Antill <jantill(a)redhat.com> - 2.5.1-16
+- Fix pyconfig.h comment typo.
+- Add back test_support.py and the __init__.py file.
+- Resolves: rhbz#387401
+
+* Tue Oct 30 2007 James Antill <jantill(a)redhat.com> - 2.5.1-15
+- Do codec lowercase in C Locale.
+- Resolves: 207134 191096
+- Fix stupid namespacing in pysqlite, minimal upgrade to 2.3.3 pysqlite
+- Resolves: 263221
+
+* Wed Oct 24 2007 James Antill <jantill(a)redhat.com> - 2.5.1-14
+- Remove bintuils dep. for live CD ... add work around for ctypes
+
+* Mon Oct 22 2007 James Antill <jantill(a)redhat.com> - 2.5.1-13
+- Add tix buildprereq
+- Add tkinter patch
+- Resolves: #281751
+- Fix ctypes loading of libraries, add requires on binutils
+- Resolves: #307221
+- Possible fix for CVE-2007-4965 possible exploitable integer overflow
+- Resolves: #295971
+
* Tue Oct 16 2007 Mike Bonnet <mikeb(a)redhat.com> - 2.5.1-12
- fix marshalling of objects in xmlrpclib (python bug #1739842)
commit 3939a1237175be36cac1fe956724f9e8347b427a
Author: Mike Bonnet <mikeb(a)fedoraproject.org>
Date: Tue Oct 16 17:03:22 2007 +0000
fix marshalling of objects in xmlrpclib (python bug #1739842)
diff --git a/python-2.5-xmlrpclib-marshal-objects.patch
b/python-2.5-xmlrpclib-marshal-objects.patch
new file mode 100644
index 0000000..6930b73
--- /dev/null
+++ b/python-2.5-xmlrpclib-marshal-objects.patch
@@ -0,0 +1,13 @@
+--- Python-2.5/Lib/xmlrpclib.py.orig 2007-04-10 10:29:14.000000000 -0400
++++ Python-2.5/Lib/xmlrpclib.py 2007-06-19 12:08:04.000000000 -0400
+@@ -630,6 +630,9 @@
+ try:
+ f = self.dispatch[type(value)]
+ except KeyError:
+- raise TypeError, "cannot marshal %s objects" % type(value)
++ if isinstance(value, object):
++ self.dump_instance(value, write)
++ else:
++ raise TypeError, "cannot marshal %s objects" % type(value)
+ else:
+ f(self, value, write)
diff --git a/python.spec b/python.spec
index 9634415..bb43218 100644
--- a/python.spec
+++ b/python.spec
@@ -20,7 +20,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: 2.5.1
-Release: 11%{?dist}
+Release: 12%{?dist}
License: Python Software Foundation License v2
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -35,6 +35,7 @@ Patch4: python-2.5-cflags.patch
Patch5: python-2.5.1-ctypes-exec-stack.patch
Patch6: python-2.5.1-plural-fix.patch
Patch7: python-2.5.1-sqlite-encoding.patch
+Patch8: python-2.5-xmlrpclib-marshal-objects.patch
# upstreamed
@@ -165,6 +166,7 @@ user interface for Python programming.
%patch5 -p1 -b .ctypesexec
%patch6 -p1 -b .plural
%patch7 -p1
+%patch8 -p1 -b .xmlrpc
%patch50 -p1 -b .egginfo
%patch60 -p1 -b .db46
@@ -425,6 +427,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Tue Oct 16 2007 Mike Bonnet <mikeb(a)redhat.com> - 2.5.1-12
+- fix marshalling of objects in xmlrpclib (python bug #1739842)
+
* Fri Sep 14 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-11
- fix encoding of sqlite .py files to work around weird encoding problem
in Turkish (#283331)
commit ac31c5a72651a4dcdfb95ed5cf16e4eb94adc2b9
Author: Bill Nottingham <notting(a)fedoraproject.org>
Date: Mon Oct 15 19:19:17 2007 +0000
makefile update to properly grab makefile.common
diff --git a/Makefile b/Makefile
index 8de430a..c6d78ed 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,21 @@
# Makefile for source rpm: python
-# $Id$
+# $Id: Makefile,v 1.1 2004/09/09 10:57:27 cvsdist Exp $
NAME := python
SPECFILE = $(firstword $(wildcard *.spec))
-include ../common/Makefile.common
+define find-makefile-common
+for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f
$$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo
"$$d/Makefile.common" ; break ; fi ; done
+endef
+
+MAKEFILE_COMMON := $(shell $(find-makefile-common))
+
+ifeq ($(MAKEFILE_COMMON),)
+# attempt a checkout
+define checkout-makefile-common
+test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo
"common/Makefile.common" ; } || { echo "ERROR: I can't figure out how
to checkout the 'common' module." ; exit -1 ; } >&2
+endef
+
+MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
+endif
+
+include $(MAKEFILE_COMMON)
commit e574c7ed969976cdf6d72d15800a15e891ea4699
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Fri Sep 14 14:44:14 2007 +0000
- fix encoding of sqlite .py files to work around weird encoding problem in
Turkish (#283331)
diff --git a/python-2.5.1-sqlite-encoding.patch b/python-2.5.1-sqlite-encoding.patch
new file mode 100644
index 0000000..97235d8
--- /dev/null
+++ b/python-2.5.1-sqlite-encoding.patch
@@ -0,0 +1,24 @@
+diff -up Python-2.5.1/Lib/sqlite3/dbapi2.py.encoding Python-2.5.1/Lib/sqlite3/dbapi2.py
+--- Python-2.5.1/Lib/sqlite3/dbapi2.py.encoding 2007-09-14 10:41:50.000000000 -0400
++++ Python-2.5.1/Lib/sqlite3/dbapi2.py 2007-09-14 10:42:00.000000000 -0400
+@@ -1,7 +1,6 @@
+-#-*- coding: ISO-8859-1 -*-
+ # pysqlite2/dbapi2.py: the DB-API 2.0 interface
+ #
+-# Copyright (C) 2004-2005 Gerhard Hring <gh(a)ghaering.de>
++# Copyright (C) 2004-2005 Gerhard Haering <gh(a)ghaering.de>
+ #
+ # This file is part of pysqlite.
+ #
+diff -up Python-2.5.1/Lib/sqlite3/__init__.py.encoding
Python-2.5.1/Lib/sqlite3/__init__.py
+--- Python-2.5.1/Lib/sqlite3/__init__.py.encoding 2007-09-14 10:41:47.000000000 -0400
++++ Python-2.5.1/Lib/sqlite3/__init__.py 2007-09-14 10:42:06.000000000 -0400
+@@ -1,7 +1,6 @@
+-#-*- coding: ISO-8859-1 -*-
+ # pysqlite2/__init__.py: the pysqlite2 package.
+ #
+-# Copyright (C) 2005 Gerhard Hring <gh(a)ghaering.de>
++# Copyright (C) 2005 Gerhard Haering <gh(a)ghaering.de>
+ #
+ # This file is part of pysqlite.
+ #
diff --git a/python.spec b/python.spec
index 6729911..9634415 100644
--- a/python.spec
+++ b/python.spec
@@ -20,7 +20,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: 2.5.1
-Release: 10%{?dist}
+Release: 11%{?dist}
License: Python Software Foundation License v2
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -34,6 +34,7 @@ Patch3: python-2.4.1-canonicalize.patch
Patch4: python-2.5-cflags.patch
Patch5: python-2.5.1-ctypes-exec-stack.patch
Patch6: python-2.5.1-plural-fix.patch
+Patch7: python-2.5.1-sqlite-encoding.patch
# upstreamed
@@ -163,6 +164,7 @@ user interface for Python programming.
%patch4 -p1 -b .cflags
%patch5 -p1 -b .ctypesexec
%patch6 -p1 -b .plural
+%patch7 -p1
%patch50 -p1 -b .egginfo
%patch60 -p1 -b .db46
@@ -423,6 +425,10 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Fri Sep 14 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-11
+- fix encoding of sqlite .py files to work around weird encoding problem
+ in Turkish (#283331)
+
* Mon Sep 10 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-10
- work around problems with multi-line plural specification (#252136)
commit b7dfd0ae4c26e8c92a0e3418902d3632d76c4217
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Mon Sep 10 15:42:58 2007 +0000
- work around problems with multi-line plural specification (#252136)
diff --git a/python-2.5.1-plural-fix.patch b/python-2.5.1-plural-fix.patch
new file mode 100644
index 0000000..040adaf
--- /dev/null
+++ b/python-2.5.1-plural-fix.patch
@@ -0,0 +1,12 @@
+diff -up Python-2.5.1/Lib/gettext.py.plural Python-2.5.1/Lib/gettext.py
+--- Python-2.5.1/Lib/gettext.py.plural 2007-09-10 11:38:57.000000000 -0400
++++ Python-2.5.1/Lib/gettext.py 2007-09-10 11:39:00.000000000 -0400
+@@ -299,6 +299,8 @@ class GNUTranslations(NullTranslations):
+ item = item.strip()
+ if not item:
+ continue
++ if item.startswith("#"):
++ continue
+ if ':' in item:
+ k, v = item.split(':', 1)
+ k = k.strip().lower()
diff --git a/python.spec b/python.spec
index ba422ef..6729911 100644
--- a/python.spec
+++ b/python.spec
@@ -20,7 +20,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: 2.5.1
-Release: 9%{?dist}
+Release: 10%{?dist}
License: Python Software Foundation License v2
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -33,6 +33,7 @@ Patch2: python-2.3.4-pydocnodoc.patch
Patch3: python-2.4.1-canonicalize.patch
Patch4: python-2.5-cflags.patch
Patch5: python-2.5.1-ctypes-exec-stack.patch
+Patch6: python-2.5.1-plural-fix.patch
# upstreamed
@@ -161,6 +162,7 @@ user interface for Python programming.
%patch3 -p1 -b .canonicalize
%patch4 -p1 -b .cflags
%patch5 -p1 -b .ctypesexec
+%patch6 -p1 -b .plural
%patch50 -p1 -b .egginfo
%patch60 -p1 -b .db46
@@ -421,6 +423,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Mon Sep 10 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-10
+- work around problems with multi-line plural specification (#252136)
+
* Tue Aug 28 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-9
- rebuild against new expat
commit ce994f2961f85a22a94464d2d115575a99884a6f
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Tue Aug 28 13:50:29 2007 +0000
- rebuild against new expat
diff --git a/python.spec b/python.spec
index 22be4cf..ba422ef 100644
--- a/python.spec
+++ b/python.spec
@@ -20,7 +20,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: 2.5.1
-Release: 8%{?dist}
+Release: 9%{?dist}
License: Python Software Foundation License v2
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -421,6 +421,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Tue Aug 28 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-9
+- rebuild against new expat
+
* Tue Aug 14 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-8
- build against db4.6
commit c9043023c0bc6adec0172175dd4174d6ee341fd1
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Tue Aug 14 18:29:38 2007 +0000
Fix patch corrupted by manual munging
diff --git a/python-2.5.1-db46.patch b/python-2.5.1-db46.patch
index 7bfdf94..a1896e6 100644
--- a/python-2.5.1-db46.patch
+++ b/python-2.5.1-db46.patch
@@ -1,40 +1,6 @@
diff -up Python-2.5.1/setup.py.db46 Python-2.5.1/setup.py
--- Python-2.5.1/setup.py.db46 2007-08-14 12:53:45.000000000 -0400
+++ Python-2.5.1/setup.py 2007-08-14 14:11:08.000000000 -0400
-@@ -244,7 +244,7 @@ class PyBuildExt(build_ext):
-
- def detect_modules(self):
- # Ensure that /usr/local is always used
-- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
-+ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib64')
- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
-
- # Add paths specified in the environment variables LDFLAGS and
-@@ -496,11 +496,11 @@ class PyBuildExt(build_ext):
- elif self.compiler.find_library_file(lib_dirs, 'curses'):
- readline_libs.append('curses')
- elif self.compiler.find_library_file(lib_dirs +
-- ['/usr/lib/termcap'],
-+ ['/usr/lib64/termcap'],
- 'termcap'):
- readline_libs.append('termcap')
- exts.append( Extension('readline', ['readline.c'],
-- library_dirs=['/usr/lib/termcap'],
-+ library_dirs=['/usr/lib64/termcap'],
- extra_link_args=readline_extra_link_args,
- libraries=readline_libs) )
- if platform not in ['mac']:
-@@ -532,8 +532,8 @@ class PyBuildExt(build_ext):
- if krb5_h:
- ssl_incs += krb5_h
- ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
-- ['/usr/local/ssl/lib',
-- '/usr/contrib/ssl/lib/'
-+ ['/usr/local/ssl/lib64',
-+ '/usr/contrib/ssl/lib64/'
- ] )
-
- if (ssl_incs is not None and
@@ -606,9 +606,9 @@ class PyBuildExt(build_ext):
# a release. Most open source OSes come with one or more
# versions of BerkeleyDB already installed.
commit 7a22221a1cf8d8a16578e608d3606bbfc32da918
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Tue Aug 14 18:22:58 2007 +0000
another db4.6 change
diff --git a/python-2.5-config.patch b/python-2.5-config.patch
index fe30817..a752e61 100644
--- a/python-2.5-config.patch
+++ b/python-2.5-config.patch
@@ -248,7 +248,7 @@
-#DBINC=$(DB)/include
-#DBLIB=$(DB)/lib
-#_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
-+DBLIBVER=4.5
++DBLIBVER=4.6
+DBINC=/usr/include/db4
+DBLIB=/usr/lib
+_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
commit 711a490f58a1d9ca3a9e2d0a4015af17e496cae9
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Tue Aug 14 18:11:24 2007 +0000
make the build more verbose
diff --git a/python-2.5.1-db46.patch b/python-2.5.1-db46.patch
index 16f7f39..7bfdf94 100644
--- a/python-2.5.1-db46.patch
+++ b/python-2.5.1-db46.patch
@@ -1,15 +1,52 @@
diff -up Python-2.5.1/setup.py.db46 Python-2.5.1/setup.py
---- Python-2.5.1/setup.py.db46 2007-08-14 10:25:42.000000000 -0400
-+++ Python-2.5.1/setup.py 2007-08-14 10:26:11.000000000 -0400
-@@ -606,7 +606,7 @@ class PyBuildExt(build_ext):
+--- Python-2.5.1/setup.py.db46 2007-08-14 12:53:45.000000000 -0400
++++ Python-2.5.1/setup.py 2007-08-14 14:11:08.000000000 -0400
+@@ -244,7 +244,7 @@ class PyBuildExt(build_ext):
+
+ def detect_modules(self):
+ # Ensure that /usr/local is always used
+- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
++ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib64')
+ add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+
+ # Add paths specified in the environment variables LDFLAGS and
+@@ -496,11 +496,11 @@ class PyBuildExt(build_ext):
+ elif self.compiler.find_library_file(lib_dirs, 'curses'):
+ readline_libs.append('curses')
+ elif self.compiler.find_library_file(lib_dirs +
+- ['/usr/lib/termcap'],
++ ['/usr/lib64/termcap'],
+ 'termcap'):
+ readline_libs.append('termcap')
+ exts.append( Extension('readline', ['readline.c'],
+- library_dirs=['/usr/lib/termcap'],
++ library_dirs=['/usr/lib64/termcap'],
+ extra_link_args=readline_extra_link_args,
+ libraries=readline_libs) )
+ if platform not in ['mac']:
+@@ -532,8 +532,8 @@ class PyBuildExt(build_ext):
+ if krb5_h:
+ ssl_incs += krb5_h
+ ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
+- ['/usr/local/ssl/lib',
+- '/usr/contrib/ssl/lib/'
++ ['/usr/local/ssl/lib64',
++ '/usr/contrib/ssl/lib64/'
+ ] )
+
+ if (ssl_incs is not None and
+@@ -606,9 +606,9 @@ class PyBuildExt(build_ext):
# a release. Most open source OSes come with one or more
# versions of BerkeleyDB already installed.
- max_db_ver = (4, 5)
+ max_db_ver = (4, 6)
min_db_ver = (3, 3)
- db_setup_debug = False # verbose debug prints from this script?
+- db_setup_debug = False # verbose debug prints from this script?
++ db_setup_debug = True # verbose debug prints from this script?
+ # construct a list of paths to look for the header file in on
+ # top of the normal inc_dirs.
@@ -623,7 +623,7 @@ class PyBuildExt(build_ext):
'/sw/include/db3',
]
@@ -19,3 +56,12 @@ diff -up Python-2.5.1/setup.py.db46 Python-2.5.1/setup.py
db_inc_paths.append('/usr/include/db4%d' % x)
db_inc_paths.append('/usr/include/db4.%d' % x)
db_inc_paths.append('/usr/local/BerkeleyDB.4.%d/include' % x)
+@@ -646,7 +646,7 @@ class PyBuildExt(build_ext):
+ for dn in inc_dirs:
+ std_variants.append(os.path.join(dn, 'db3'))
+ std_variants.append(os.path.join(dn, 'db4'))
+- for x in (0,1,2,3,4):
++ for x in (0,1,2,3,4,5,6):
+ std_variants.append(os.path.join(dn, "db4%d"%x))
+ std_variants.append(os.path.join(dn, "db4.%d"%x))
+ for x in (2,3):
commit c4c08b19263a76d658ffe1aa594102bf7c4e58bf
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Tue Aug 14 14:45:03 2007 +0000
make sure we're not ending up with just compat-db fulfilling the
requirement
diff --git a/python.spec b/python.spec
index 0747a46..22be4cf 100644
--- a/python.spec
+++ b/python.spec
@@ -66,7 +66,7 @@ BuildPrereq: libGL-devel tk gcc-c++ libX11-devel glibc-devel
BuildPrereq: bzip2 tar /usr/bin/find pkgconfig tcl-devel tk-devel
BuildPrereq: tix-devel bzip2-devel sqlite-devel
BuildPrereq: autoconf
-BuildPrereq: db4-devel >= 4.3
+BuildPrereq: db4-devel >= 4.6
URL:
http://www.python.org/
commit 50ca1838b00da9307b61143cc45df0bdbc490403
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Tue Aug 14 14:38:32 2007 +0000
- build against db4.6
diff --git a/python-2.5.1-db46.patch b/python-2.5.1-db46.patch
new file mode 100644
index 0000000..16f7f39
--- /dev/null
+++ b/python-2.5.1-db46.patch
@@ -0,0 +1,21 @@
+diff -up Python-2.5.1/setup.py.db46 Python-2.5.1/setup.py
+--- Python-2.5.1/setup.py.db46 2007-08-14 10:25:42.000000000 -0400
++++ Python-2.5.1/setup.py 2007-08-14 10:26:11.000000000 -0400
+@@ -606,7 +606,7 @@ class PyBuildExt(build_ext):
+ # a release. Most open source OSes come with one or more
+ # versions of BerkeleyDB already installed.
+
+- max_db_ver = (4, 5)
++ max_db_ver = (4, 6)
+ min_db_ver = (3, 3)
+ db_setup_debug = False # verbose debug prints from this script?
+
+@@ -623,7 +623,7 @@ class PyBuildExt(build_ext):
+ '/sw/include/db3',
+ ]
+ # 4.x minor number specific paths
+- for x in (0,1,2,3,4,5):
++ for x in (0,1,2,3,4,5,6):
+ db_inc_paths.append('/usr/include/db4%d' % x)
+ db_inc_paths.append('/usr/include/db4.%d' % x)
+ db_inc_paths.append('/usr/local/BerkeleyDB.4.%d/include' % x)
diff --git a/python.spec b/python.spec
index e1c4676..0747a46 100644
--- a/python.spec
+++ b/python.spec
@@ -20,7 +20,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: 2.5.1
-Release: 7%{?dist}
+Release: 8%{?dist}
License: Python Software Foundation License v2
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -39,10 +39,14 @@ Patch5: python-2.5.1-ctypes-exec-stack.patch
# disable egg-infos for now
Patch50: python-2.5-disable-egginfo.patch
+# new db version
+Patch60: python-2.5.1-db46.patch
+
# lib64 patches
Patch101: python-2.3.4-lib64-regex.patch
Patch102: python-2.5-lib64.patch
+
%if %{main_python}
Obsoletes: Distutils
Provides: Distutils
@@ -159,6 +163,7 @@ user interface for Python programming.
%patch5 -p1 -b .ctypesexec
%patch50 -p1 -b .egginfo
+%patch60 -p1 -b .db46
%if %{_lib} == lib64
%patch101 -p1 -b .lib64-regex
@@ -416,6 +421,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Tue Aug 14 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-8
+- build against db4.6
+
* Tue Aug 14 2007 Dennis Gilmore <dennis(a)ausil.us> - 2.5.1-7
- add sparc64 to the list of archs for _pyconfig64_h
commit 8cf5a3127373928bf0fd8cc4a820e5a41f0bada8
Author: Dennis Gilmore <ausil(a)fedoraproject.org>
Date: Tue Aug 14 14:20:58 2007 +0000
add sparc64 to the list of archs with _pyconfig64_h
diff --git a/python.spec b/python.spec
index 1d3159f..e1c4676 100644
--- a/python.spec
+++ b/python.spec
@@ -20,7 +20,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: 2.5.1
-Release: 6%{?dist}
+Release: 7%{?dist}
License: Python Software Foundation License v2
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -308,7 +308,7 @@ install -d $RPM_BUILD_ROOT/usr/lib/python%{pybasever}/site-packages
%define _pyconfig32_h pyconfig-32.h
%define _pyconfig64_h pyconfig-64.h
-%ifarch ppc64 s390x x86_64 ia64 alpha
+%ifarch ppc64 s390x x86_64 ia64 alpha sparc64
%define _pyconfig_h %{_pyconfig64_h}
%else
%define _pyconfig_h %{_pyconfig32_h}
@@ -416,6 +416,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Tue Aug 14 2007 Dennis Gilmore <dennis(a)ausil.us> - 2.5.1-7
+- add sparc64 to the list of archs for _pyconfig64_h
+
* Fri Aug 10 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-6
- fix ctypes again on some arches (Hans de Goede, #251637)
commit 7e007c79d19caa252286ce03fe1631f5990c41a3
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Fri Aug 10 14:18:01 2007 +0000
right file name
diff --git a/python.spec b/python.spec
index 05419b7..1d3159f 100644
--- a/python.spec
+++ b/python.spec
@@ -32,7 +32,7 @@ Patch1: Python-2.2.1-pydocnogui.patch
Patch2: python-2.3.4-pydocnodoc.patch
Patch3: python-2.4.1-canonicalize.patch
Patch4: python-2.5-cflags.patch
-Patch5: python-2.5-ctypes-exec-stack.patch
+Patch5: python-2.5.1-ctypes-exec-stack.patch
# upstreamed
commit 5ee001f5b127b3de450d7362f37a076e17fc1bc7
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Fri Aug 10 14:13:15 2007 +0000
- fix ctypes again on some arches (Hans de Goede, #251637)
diff --git a/python-2.5.1-ctypes-exec-stack.patch b/python-2.5.1-ctypes-exec-stack.patch
new file mode 100644
index 0000000..0f5c675
--- /dev/null
+++ b/python-2.5.1-ctypes-exec-stack.patch
@@ -0,0 +1,44 @@
+diff -up Python-2.5.1/Modules/_ctypes/libffi/src/x86/unix64.S.execstack
Python-2.5.1/Modules/_ctypes/libffi/src/x86/unix64.S
+--- Python-2.5.1/Modules/_ctypes/libffi/src/x86/unix64.S.execstack 2007-08-10
10:34:06.000000000 +0200
++++ Python-2.5.1/Modules/_ctypes/libffi/src/x86/unix64.S 2007-08-10 10:34:06.000000000
+0200
+@@ -410,3 +410,7 @@ ffi_closure_unix64:
+ .LEFDE3:
+
+ #endif /* __x86_64__ */
++
++#ifdef __ELF__
++.section .note.GNU-stack,"",%progbits
++#endif
+diff -up Python-2.5.1/Modules/_ctypes/libffi/src/powerpc/sysv.S.execstack
Python-2.5.1/Modules/_ctypes/libffi/src/powerpc/sysv.S
+--- Python-2.5.1/Modules/_ctypes/libffi/src/powerpc/sysv.S.execstack 2007-08-10
10:39:03.000000000 +0200
++++ Python-2.5.1/Modules/_ctypes/libffi/src/powerpc/sysv.S 2007-08-10 10:39:59.000000000
+0200
+@@ -215,3 +215,7 @@ END(ffi_call_SYSV)
+ .align 2
+ .LEFDE1:
+ #endif
++
++#ifdef __ELF__
++.section .note.GNU-stack,"",%progbits
++#endif
+diff -up Python-2.5.1/Modules/_ctypes/libffi/src/powerpc/linux64_closure.S.execstack
Python-2.5.1/Modules/_ctypes/libffi/src/powerpc/linux64_closure.S
+---
Python-2.5.1/Modules/_ctypes/libffi/src/powerpc/linux64_closure.S.execstack 2007-08-10
10:39:23.000000000 +0200
++++ Python-2.5.1/Modules/_ctypes/libffi/src/powerpc/linux64_closure.S 2007-08-10
10:39:58.000000000 +0200
+@@ -204,3 +204,7 @@ ffi_closure_LINUX64:
+ .align 3
+ .LEFDE1:
+ #endif
++
++#ifdef __ELF__
++.section .note.GNU-stack,"",%progbits
++#endif
+diff -up Python-2.5.1/Modules/_ctypes/libffi/src/powerpc/linux64.S.execstack
Python-2.5.1/Modules/_ctypes/libffi/src/powerpc/linux64.S
+--- Python-2.5.1/Modules/_ctypes/libffi/src/powerpc/linux64.S.execstack 2007-08-10
10:39:13.000000000 +0200
++++ Python-2.5.1/Modules/_ctypes/libffi/src/powerpc/linux64.S 2007-08-10
10:40:01.000000000 +0200
+@@ -178,3 +178,7 @@ ffi_call_LINUX64:
+ .align 3
+ .LEFDE1:
+ #endif
++
++#ifdef __ELF__
++.section .note.GNU-stack,"",%progbits
++#endif
diff --git a/python.spec b/python.spec
index e2257b5..05419b7 100644
--- a/python.spec
+++ b/python.spec
@@ -20,7 +20,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: 2.5.1
-Release: 5%{?dist}
+Release: 6%{?dist}
License: Python Software Foundation License v2
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -32,6 +32,7 @@ Patch1: Python-2.2.1-pydocnogui.patch
Patch2: python-2.3.4-pydocnodoc.patch
Patch3: python-2.4.1-canonicalize.patch
Patch4: python-2.5-cflags.patch
+Patch5: python-2.5-ctypes-exec-stack.patch
# upstreamed
@@ -155,6 +156,7 @@ user interface for Python programming.
%patch2 -p1 -b .no-doc
%patch3 -p1 -b .canonicalize
%patch4 -p1 -b .cflags
+%patch5 -p1 -b .ctypesexec
%patch50 -p1 -b .egginfo
@@ -414,6 +416,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Fri Aug 10 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-6
+- fix ctypes again on some arches (Hans de Goede, #251637)
+
* Fri Jul 6 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-5
- link curses modules with ncursesw (#246385)
commit 7c4cd75d21b9cb881eaa759d2d61f6fdb46c9229
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Fri Jul 6 20:32:38 2007 +0000
- link curses modules with ncursesw (#246385)
diff --git a/python-2.5-config.patch b/python-2.5-config.patch
index 509224f..fe30817 100644
--- a/python-2.5-config.patch
+++ b/python-2.5-config.patch
@@ -36,7 +36,7 @@
# It's okay for this to be a shared library, too.
-#readline readline.c -lreadline -ltermcap
-+readline readline.c -lreadline -lncurses
++readline readline.c -lreadline -lncursesw
# Modules that should always be present (non UNIX dependent):
@@ -214,10 +214,10 @@
# First, look at Setup.config; configure may have set this for you.
-#_curses _cursesmodule.c -lcurses -ltermcap
-+_curses _cursesmodule.c -lncurses
++_curses _cursesmodule.c -lncursesw
# Wrapper for the panel library that's part of ncurses and SYSV curses.
-#_curses_panel _curses_panel.c -lpanel -lncurses
-+_curses_panel _curses_panel.c -lpanel -lncurses
++_curses_panel _curses_panel.c -lpanel -lncursesw
# Generic (SunOS / SVR4) dynamic loading module.
diff --git a/python.spec b/python.spec
index 674a863..e2257b5 100644
--- a/python.spec
+++ b/python.spec
@@ -20,7 +20,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: 2.5.1
-Release: 4%{?dist}
+Release: 5%{?dist}
License: Python Software Foundation License v2
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -57,7 +57,7 @@ Provides: python-ctypes = 1.0.1
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildPrereq: readline-devel, openssl-devel, gmp-devel
BuildPrereq: ncurses-devel, gdbm-devel, zlib-devel, expat-devel
-BuildPrereq: libGL-devel tk tix gcc-c++ libX11-devel glibc-devel
+BuildPrereq: libGL-devel tk gcc-c++ libX11-devel glibc-devel
BuildPrereq: bzip2 tar /usr/bin/find pkgconfig tcl-devel tk-devel
BuildPrereq: tix-devel bzip2-devel sqlite-devel
BuildPrereq: autoconf
@@ -414,6 +414,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Fri Jul 6 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-5
+- link curses modules with ncursesw (#246385)
+
* Wed Jun 27 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-4
- fix _elementtree.so build (#245703)
- ensure that extension modules we expect are actually built rather than
commit 27b03943d054fa4ec19701e52b358282c421b2d9
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Wed Jun 27 15:01:41 2007 +0000
- fix _elementtree.so build (#245703)
- ensure that extension modules we expect are actually built rather than
having them silently fall out of the package
diff --git a/python-2.5-config.patch b/python-2.5-config.patch
index c800780..509224f 100644
--- a/python-2.5-config.patch
+++ b/python-2.5-config.patch
@@ -1,5 +1,5 @@
---- Python-2.5.1/Include/pyexpat.h.rhconfig 2007-06-26 18:40:21.000000000 -0400
-+++ Python-2.5.1/Include/pyexpat.h 2007-06-26 18:41:16.000000000 -0400
+--- Python-2.5.1/Include/pyexpat.h.rhconfig 2006-06-19 19:21:25.000000000 -0400
++++ Python-2.5.1/Include/pyexpat.h 2007-06-27 10:12:45.000000000 -0400
@@ -5,6 +5,19 @@
#define PyExpat_CAPI_MAGIC "pyexpat.expat_CAPI 1.0"
@@ -21,7 +21,7 @@
{
char* magic; /* set to PyExpat_CAPI_MAGIC */
--- Python-2.5.1/Modules/Setup.dist.rhconfig 2006-08-06 03:26:21.000000000 -0400
-+++ Python-2.5.1/Modules/Setup.dist 2007-06-26 18:41:40.000000000 -0400
++++ Python-2.5.1/Modules/Setup.dist 2007-06-27 10:12:45.000000000 -0400
@@ -149,7 +149,7 @@ GLHACK=-Dclear=__GLclear
# modules are to be built as shared libraries (see above for more
# detail; also note that *static* reverses this effect):
@@ -312,3 +312,21 @@
# Example -- included for reference only:
# xx xxmodule.c
+--- Python-2.5.1/setup.py.rhconfig 2007-06-27 10:26:41.000000000 -0400
++++ Python-2.5.1/setup.py 2007-06-27 10:26:51.000000000 -0400
+@@ -998,7 +998,6 @@ class PyBuildExt(build_ext):
+
+ exts.append(Extension('pyexpat',
+ define_macros = define_macros,
+- include_dirs = [expatinc],
+ sources = ['pyexpat.c',
+ 'expat/xmlparse.c',
+ 'expat/xmlrole.c',
+@@ -1013,7 +1012,6 @@ class PyBuildExt(build_ext):
+ define_macros.append(('USE_PYEXPAT_CAPI', None))
+ exts.append(Extension('_elementtree',
+ define_macros = define_macros,
+- include_dirs = [expatinc],
+ sources = ['_elementtree.c'],
+ ))
+
diff --git a/python.spec b/python.spec
index 62362cc..674a863 100644
--- a/python.spec
+++ b/python.spec
@@ -20,7 +20,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: 2.5.1
-Release: 3%{?dist}
+Release: 4%{?dist}
License: Python Software Foundation License v2
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -332,6 +332,15 @@ sed -i -e
"s/'pyconfig.h'/'%{_pyconfig_h}'/"
$RPM_BUILD_ROOT%{_libdir}/python%{p
# Get rid of egg-info files (core python modules are installed through rpms)
rm $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/*.egg-info
+# python's build is stupid and doesn't fail if extensions fail to build
+# let's list a few that we care about...
+for so in _bsddb.so _ctypes.so _cursesmodule.so _elementtree.so _sqlite3.so _ssl.so
readline.so _hashlib.so zlibmodule.so bz2.so pyexpat.so; do
+ if [ ! -f $RPM_BUILD_ROOT/%{_libdir}/python%{pybasever}/lib-dynload/$so ]; then
+ echo "Missing $so!!!"
+ exit 1
+ fi
+done
+
%clean
rm -fr $RPM_BUILD_ROOT
@@ -405,6 +414,11 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Wed Jun 27 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-4
+- fix _elementtree.so build (#245703)
+- ensure that extension modules we expect are actually built rather than
+ having them silently fall out of the package
+
* Tue Jun 26 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-3
- link with system expat (#245703)
commit 787d5259405c2a6b724b0d322bdfbb1b98ac3e18
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Tue Jun 26 23:22:09 2007 +0000
- link with system expat (#245703)
diff --git a/python-2.5-config.patch b/python-2.5-config.patch
index ae18a25..c800780 100644
--- a/python-2.5-config.patch
+++ b/python-2.5-config.patch
@@ -1,6 +1,28 @@
---- Python-2.5/Modules/Setup.dist.rhconfig 2006-08-06 03:26:21.000000000 -0400
-+++ Python-2.5/Modules/Setup.dist 2006-10-30 16:25:16.000000000 -0500
-@@ -149,7 +149,7 @@
+--- Python-2.5.1/Include/pyexpat.h.rhconfig 2007-06-26 18:40:21.000000000 -0400
++++ Python-2.5.1/Include/pyexpat.h 2007-06-26 18:41:16.000000000 -0400
+@@ -5,6 +5,19 @@
+
+ #define PyExpat_CAPI_MAGIC "pyexpat.expat_CAPI 1.0"
+
++#ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */
++#if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400
++typedef __int64 XML_Index;
++typedef unsigned __int64 XML_Size;
++#else
++typedef long long XML_Index;
++typedef unsigned long long XML_Size;
++#endif
++#else
++typedef long XML_Index;
++typedef unsigned long XML_Size;
++#endif /* XML_LARGE_SIZE */
++
+ struct PyExpat_CAPI
+ {
+ char* magic; /* set to PyExpat_CAPI_MAGIC */
+--- Python-2.5.1/Modules/Setup.dist.rhconfig 2006-08-06 03:26:21.000000000 -0400
++++ Python-2.5.1/Modules/Setup.dist 2007-06-26 18:41:40.000000000 -0400
+@@ -149,7 +149,7 @@ GLHACK=-Dclear=__GLclear
# modules are to be built as shared libraries (see above for more
# detail; also note that *static* reverses this effect):
@@ -9,7 +31,7 @@
# GNU readline. Unlike previous Python incarnations, GNU readline is
# now incorporated in an optional module, configured in the Setup file
-@@ -159,69 +159,69 @@
+@@ -159,69 +159,69 @@ GLHACK=-Dclear=__GLclear
# it, depending on your system -- see the GNU readline instructions.
# It's okay for this to be a shared library, too.
@@ -108,7 +130,7 @@
# Multimedia modules -- off by default.
-@@ -229,9 +229,9 @@
+@@ -229,9 +229,9 @@ GLHACK=-Dclear=__GLclear
# #993173 says audioop works on 64-bit platforms, though.
# These represent audio samples or images as strings:
@@ -121,7 +143,7 @@
# Note that the _md5 and _sha modules are normally only built if the
-@@ -241,12 +241,12 @@
+@@ -241,12 +241,12 @@ GLHACK=-Dclear=__GLclear
# Message-Digest Algorithm, described in RFC 1321. The necessary files
# md5.c and md5.h are included here.
@@ -136,7 +158,7 @@
# SGI IRIX specific modules -- off by default.
-@@ -293,12 +293,12 @@
+@@ -293,12 +293,12 @@ GLHACK=-Dclear=__GLclear
# A Linux specific module -- off by default; this may also work on
# some *BSDs.
@@ -151,7 +173,7 @@
# The _tkinter module.
-@@ -313,7 +313,7 @@
+@@ -313,7 +313,7 @@ GLHACK=-Dclear=__GLclear
# every system.
# *** Always uncomment this (leave the leading underscore in!):
@@ -160,7 +182,7 @@
# *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
# -L/usr/local/lib \
# *** Uncomment and edit to reflect where your Tcl/Tk headers are:
-@@ -323,7 +323,7 @@
+@@ -323,7 +323,7 @@ GLHACK=-Dclear=__GLclear
# *** Or uncomment this for Solaris:
# -I/usr/openwin/include \
# *** Uncomment and edit for Tix extension only:
@@ -169,7 +191,7 @@
# *** Uncomment and edit for BLT extension only:
# -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \
# *** Uncomment and edit for PIL (TkImaging) extension only:
-@@ -332,7 +332,7 @@
+@@ -332,7 +332,7 @@ GLHACK=-Dclear=__GLclear
# *** Uncomment and edit for TOGL extension only:
# -DWITH_TOGL togl.c \
# *** Uncomment and edit to reflect your Tcl/Tk versions:
@@ -178,7 +200,7 @@
# *** Uncomment and edit to reflect where your X11 libraries are:
# -L/usr/X11R6/lib \
# *** Or uncomment this for Solaris:
-@@ -342,7 +342,7 @@
+@@ -342,7 +342,7 @@ GLHACK=-Dclear=__GLclear
# *** Uncomment for AIX:
# -lld \
# *** Always uncomment this; X11 libraries to link with:
@@ -187,7 +209,7 @@
# Lance Ellinghaus's syslog module
#syslog syslogmodule.c # syslog daemon interface
-@@ -354,9 +354,9 @@
+@@ -354,9 +354,9 @@ GLHACK=-Dclear=__GLclear
#
# First, look at Setup.config; configure may have set this for you.
@@ -199,7 +221,7 @@
# Generic (SunOS / SVR4) dynamic loading module.
-@@ -364,7 +364,7 @@
+@@ -364,7 +364,7 @@ GLHACK=-Dclear=__GLclear
# it is a highly experimental and dangerous device for calling
# *arbitrary* C functions in *arbitrary* shared libraries:
@@ -208,7 +230,7 @@
# Modules that provide persistent dictionary-like semantics. You will
-@@ -387,7 +387,7 @@
+@@ -387,7 +387,7 @@ GLHACK=-Dclear=__GLclear
#
# First, look at Setup.config; configure may have set this for you.
@@ -217,7 +239,7 @@
# Sleepycat Berkeley DB interface.
-@@ -402,11 +402,10 @@
+@@ -402,11 +402,10 @@ GLHACK=-Dclear=__GLclear
#
# Edit the variables DB and DBLIBVERto point to the db top directory
# and the subdirectory of PORT where you built it.
@@ -233,7 +255,7 @@
# Historical Berkeley DB 1.85
#
-@@ -421,14 +420,14 @@
+@@ -421,14 +420,14 @@ GLHACK=-Dclear=__GLclear
# Helper module for various ascii-encoders
@@ -252,7 +274,7 @@
# Lee Busby's SIGFPE modules.
-@@ -451,7 +450,7 @@
+@@ -451,7 +450,7 @@ GLHACK=-Dclear=__GLclear
# Andrew Kuchling's zlib module.
# This require zlib 1.1.3 (or later).
# See
http://www.gzip.org/zlib/
@@ -261,7 +283,14 @@
# Interface to the Expat XML parser
#
-@@ -471,14 +470,14 @@
+@@ -465,20 +464,20 @@ GLHACK=-Dclear=__GLclear
+ # More information on Expat can be found at
www.libexpat.org.
+ #
+ #EXPAT_DIR=/usr/local/src/expat-1.95.2
+-#pyexpat pyexpat.c -DHAVE_EXPAT_H -I$(EXPAT_DIR)/lib -L$(EXPAT_DIR) -lexpat
++pyexpat pyexpat.c -DHAVE_EXPAT_H -lexpat
+
+
# Hye-Shik Chang's CJKCodecs
# multibytecodec is required for all the other CJK codec modules
diff --git a/python.spec b/python.spec
index 6d038c6..62362cc 100644
--- a/python.spec
+++ b/python.spec
@@ -20,7 +20,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: 2.5.1
-Release: 2%{?dist}
+Release: 3%{?dist}
License: Python Software Foundation License v2
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -405,6 +405,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Tue Jun 26 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-3
+- link with system expat (#245703)
+
* Thu Jun 21 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-2
- rebuild to take advantage of hardlinking between identical pyc/pyo files
commit 64142ef5c678f41c57f50ed8762b79dfd90496cc
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Thu Jun 21 12:16:20 2007 +0000
- rebuild to take advantage of hardlinking between identical pyc/pyo files
diff --git a/python.spec b/python.spec
index 1b8fe67..6d038c6 100644
--- a/python.spec
+++ b/python.spec
@@ -20,7 +20,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: 2.5.1
-Release: 1%{?dist}
+Release: 2%{?dist}
License: Python Software Foundation License v2
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -405,6 +405,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Thu Jun 21 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-2
+- rebuild to take advantage of hardlinking between identical pyc/pyo files
+
* Thu May 31 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-1
- update to python 2.5.1
commit 440a06e890dd4f86d647c29cbe819a60465a4ed6
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Thu May 31 20:09:48 2007 +0000
- update to python 2.5.1
diff --git a/.cvsignore b/.cvsignore
index 21fcb88..b80caad 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -1 +1 @@
-Python-2.5.tar.bz2
+Python-2.5.1.tar.bz2
diff --git a/python-2.5-distutils-bdist-rpm.patch b/python-2.5-distutils-bdist-rpm.patch
deleted file mode 100644
index 982430b..0000000
--- a/python-2.5-distutils-bdist-rpm.patch
+++ /dev/null
@@ -1,75 +0,0 @@
---- Python-2.5a2/Lib/distutils/command/bdist_rpm.py.bdist-rpm 2005-04-15
02:17:20.000000000 -0400
-+++ Python-2.5a2/Lib/distutils/command/bdist_rpm.py 2006-06-19 09:14:28.000000000 -0400
-@@ -337,37 +337,47 @@
- if not self.keep_temp:
- rpm_cmd.append('--clean')
- rpm_cmd.append(spec_path)
-+ # Determine the binary rpm names that should be built out of this spec
-+ # file
-+ # Note that some of these may not be really built (if the file
-+ # list is empty)
-+ nvr_string = "%{name}-%{version}-%{release}"
-+ src_rpm = nvr_string + ".src.rpm"
-+ non_src_rpm = "%{arch}/" + nvr_string + ".%{arch}.rpm"
-+ q_cmd = r"rpm -q --qf '%s %s\n' --specfile '%s'" % (
-+ src_rpm, non_src_rpm, spec_path)
-+
-+ out = os.popen(q_cmd)
-+ binary_rpms = []
-+ source_rpm = None
-+ while 1:
-+ line = out.readline()
-+ if not line:
-+ break
-+ l = string.split(string.strip(line))
-+ assert(len(l) == 2)
-+ binary_rpms.append(l[1])
-+ # The source rpm is named after the first entry in the spec file
-+ if source_rpm is None:
-+ source_rpm = l[0]
-+
-+ status = out.close()
-+ if status:
-+ raise DistutilsExecError("Failed to execute: %s" % repr(q_cmd))
-+
- self.spawn(rpm_cmd)
-
-- # XXX this is a nasty hack -- we really should have a proper way to
-- # find out the names of the RPM files created; also, this assumes
-- # that RPM creates exactly one source and one binary RPM.
- if not self.dry_run:
- if not self.binary_only:
-- srpms = glob.glob(os.path.join(rpm_dir['SRPMS'],
"*.rpm"))
-- assert len(srpms) == 1, \
-- "unexpected number of SRPM files found: %s" % srpms
-- dist_file = ('bdist_rpm', 'any',
-- self._dist_path(srpms[0]))
-- self.distribution.dist_files.append(dist_file)
-- self.move_file(srpms[0], self.dist_dir)
-+ srpm = os.path.join(rpm_dir['SRPMS'], source_rpm)
-+ assert(os.path.exists(srpm))
-+ self.move_file(srpm, self.dist_dir)
-
- if not self.source_only:
-- rpms = glob.glob(os.path.join(rpm_dir['RPMS'],
"*/*.rpm"))
-- debuginfo = glob.glob(os.path.join(rpm_dir['RPMS'],
-- "*/*debuginfo*.rpm"))
-- if debuginfo:
-- rpms.remove(debuginfo[0])
-- assert len(rpms) == 1, \
-- "unexpected number of RPM files found: %s" % rpms
-- dist_file = ('bdist_rpm', get_python_version(),
-- self._dist_path(rpms[0]))
-- self.distribution.dist_files.append(dist_file)
-- self.move_file(rpms[0], self.dist_dir)
-- if debuginfo:
-- dist_file = ('bdist_rpm', get_python_version(),
-- self._dist_path(debuginfo[0]))
-- self.move_file(debuginfo[0], self.dist_dir)
-+ for rpm in binary_rpms:
-+ rpm = os.path.join(rpm_dir['RPMS'], rpm)
-+ if os.path.exists(rpm):
-+ self.move_file(rpm, self.dist_dir)
- # run()
-
- def _dist_path(self, path):
diff --git a/python-2.5-fix-invalid-assert.patch b/python-2.5-fix-invalid-assert.patch
deleted file mode 100644
index bbed09a..0000000
--- a/python-2.5-fix-invalid-assert.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff -urp Python-2.5/Lib/test/test_grammar.py Python-2.5-fixes/Lib/test/test_grammar.py
---- Python-2.5/Lib/test/test_grammar.py 2006-09-04 23:56:01.000000000 -0400
-+++ Python-2.5-fixes/Lib/test/test_grammar.py 2006-12-13 12:38:03.000000000 -0500
-@@ -709,6 +709,7 @@ x = {'one': 1, 'two': 2, 'three': 3, 'fo
-
- x = `x`
- x = `1 or 2 or 3`
-+x = `1,2`
- x = x
- x = 'x'
- x = 123
-diff -urp Python-2.5/Python/ast.c Python-2.5-fixes/Python/ast.c
---- Python-2.5/Python/ast.c 2006-09-04 23:56:01.000000000 -0400
-+++ Python-2.5-fixes/Python/ast.c 2006-12-13 12:39:30.000000000 -0500
-@@ -538,6 +538,7 @@ seq_for_testlist(struct compiling *c, co
- || TYPE(n) == listmaker
- || TYPE(n) == testlist_gexp
- || TYPE(n) == testlist_safe
-+ || TYPE(n) == testlist1
- );
-
- seq = asdl_seq_new((NCH(n) + 1) / 2, c->c_arena);
diff --git a/python-ctypes-execstack.patch b/python-ctypes-execstack.patch
deleted file mode 100644
index 40f716d..0000000
--- a/python-ctypes-execstack.patch
+++ /dev/null
@@ -1,79 +0,0 @@
---- Python-2.5/Modules/_ctypes/libffi/src/x86/unix64.S.ctypes-exec 2006-03-08
20:35:32.000000000 -0500
-+++ Python-2.5/Modules/_ctypes/libffi/src/x86/unix64.S 2007-01-03 12:48:32.000000000
-0500
-@@ -410,3 +410,5 @@
- .LEFDE3:
-
- #endif /* __x86_64__ */
-+
-+.section .note.GNU-stack,"",@progbits
---- Python-2.5/Modules/_ctypes/libffi/src/x86/sysv.S.ctypes-exec 2006-03-08
20:35:32.000000000 -0500
-+++ Python-2.5/Modules/_ctypes/libffi/src/x86/sysv.S 2007-01-03 12:48:32.000000000 -0500
-@@ -376,3 +376,5 @@
- #endif
-
- #endif /* ifndef __x86_64__ */
-+
-+.section .note.GNU-stack,"",@progbits
---- Python-2.5/Modules/_ctypes/libffi/src/s390/sysv.S.ctypes-exec 2007-01-03
12:54:40.000000000 -0500
-+++ Python-2.5/Modules/_ctypes/libffi/src/s390/sysv.S 2007-01-03 12:51:32.000000000
-0500
-@@ -427,3 +427,4 @@
-
- #endif
-
-+.section .note.GNU-stack,"",@progbits
---- Python-2.5/Modules/_ctypes/libffi/src/powerpc/linux64.S.ctypes-exec 2007-01-03
12:54:40.000000000 -0500
-+++ Python-2.5/Modules/_ctypes/libffi/src/powerpc/linux64.S 2007-01-03 12:51:51.000000000
-0500
-@@ -178,3 +178,5 @@
- .align 3
- .LEFDE1:
- #endif
-+
-+.section .note.GNU-stack,"",@progbits
----
Python-2.5/Modules/_ctypes/libffi/src/powerpc/linux64_closure.S.ctypes-exec 2007-01-03
12:54:40.000000000 -0500
-+++ Python-2.5/Modules/_ctypes/libffi/src/powerpc/linux64_closure.S 2007-01-03
12:53:51.000000000 -0500
-@@ -204,3 +204,5 @@
- .align 3
- .LEFDE1:
- #endif
-+
-+.section .note.GNU-stack,"",@progbits
---- Python-2.5/Modules/_ctypes/libffi/src/powerpc/ppc_closure.S.ctypes-exec 2007-01-03
12:54:40.000000000 -0500
-+++ Python-2.5/Modules/_ctypes/libffi/src/powerpc/ppc_closure.S 2007-01-03
12:52:35.000000000 -0500
-@@ -321,3 +321,5 @@
- .LEFDE1:
-
- #endif
-+
-+.section .note.GNU-stack,"",@progbits
---- Python-2.5/Modules/_ctypes/libffi/src/powerpc/sysv.S.ctypes-exec 2007-01-03
12:54:40.000000000 -0500
-+++ Python-2.5/Modules/_ctypes/libffi/src/powerpc/sysv.S 2007-01-03 12:51:57.000000000
-0500
-@@ -215,3 +215,5 @@
- .align 2
- .LEFDE1:
- #endif
-+
-+.section .note.GNU-stack,"",@progbits
---- Python-2.5/Modules/_ctypes/libffi/src/ia64/unix.S.ctypes-exec 2007-01-03
12:54:40.000000000 -0500
-+++ Python-2.5/Modules/_ctypes/libffi/src/ia64/unix.S 2007-01-03 12:54:05.000000000
-0500
-@@ -553,3 +553,5 @@
- data8 @pcrel(.Lld_hfa_float) // FFI_IA64_TYPE_HFA_FLOAT
- data8 @pcrel(.Lld_hfa_double) // FFI_IA64_TYPE_HFA_DOUBLE
- data8 @pcrel(.Lld_hfa_ldouble) // FFI_IA64_TYPE_HFA_LDOUBLE
-+
-+.section .note.GNU-stack,"",@progbits
---- Python-2.5/Modules/_ctypes/libffi/src/sparc/v8.S.ctypes-exec 2007-01-03
12:54:40.000000000 -0500
-+++ Python-2.5/Modules/_ctypes/libffi/src/sparc/v8.S 2007-01-03 12:54:24.000000000 -0500
-@@ -265,3 +265,5 @@
- .byte 0x1f ! uleb128 0x1f
- .align WS
- .LLEFDE2:
-+
-+.section .note.GNU-stack,"",@progbits
---- Python-2.5/Modules/_ctypes/libffi/src/sparc/v9.S.ctypes-exec 2007-01-03
12:54:40.000000000 -0500
-+++ Python-2.5/Modules/_ctypes/libffi/src/sparc/v9.S 2007-01-03 12:54:26.000000000 -0500
-@@ -300,3 +300,5 @@
- .align 8
- .LLEFDE2:
- #endif
-+
-+.section .note.GNU-stack,"",@progbits
diff --git a/python-db45.patch b/python-db45.patch
deleted file mode 100644
index 61faed2..0000000
--- a/python-db45.patch
+++ /dev/null
@@ -1,69 +0,0 @@
---- Python-2.5/setup.py.db45 2006-08-09 19:42:18.000000000 -0400
-+++ Python-2.5/setup.py 2006-12-05 16:05:43.000000000 -0500
-@@ -606,7 +606,7 @@
- # a release. Most open source OSes come with one or more
- # versions of BerkeleyDB already installed.
-
-- max_db_ver = (4, 4)
-+ max_db_ver = (4, 5)
- min_db_ver = (3, 3)
- db_setup_debug = False # verbose debug prints from this script?
-
-@@ -623,7 +623,7 @@
- '/sw/include/db3',
- ]
- # 4.x minor number specific paths
-- for x in (0,1,2,3,4):
-+ for x in (0,1,2,3,4,5):
- db_inc_paths.append('/usr/include/db4%d' % x)
- db_inc_paths.append('/usr/include/db4.%d' % x)
- db_inc_paths.append('/usr/local/BerkeleyDB.4.%d/include' % x)
---- Python-2.5/Modules/_bsddb.c.db45 2006-12-05 16:12:08.000000000 -0500
-+++ Python-2.5/Modules/_bsddb.c 2006-12-05 16:15:44.000000000 -0500
-@@ -4129,6 +4129,7 @@
- }
-
-
-+#if (DBVER < 45)
- static PyObject*
- DBEnv_set_lk_max(DBEnvObject* self, PyObject* args)
- {
-@@ -4144,7 +4145,7 @@
- RETURN_IF_ERR();
- RETURN_NONE();
- }
--
-+#endif
-
- #if (DBVER >= 32)
-
-@@ -5233,7 +5234,9 @@
- {"set_lg_regionmax",(PyCFunction)DBEnv_set_lg_regionmax, METH_VARARGS},
- #endif
- {"set_lk_detect", (PyCFunction)DBEnv_set_lk_detect, METH_VARARGS},
-+#if (DBVER <= 40)
- {"set_lk_max", (PyCFunction)DBEnv_set_lk_max, METH_VARARGS},
-+#endif
- #if (DBVER >= 32)
- {"set_lk_max_locks", (PyCFunction)DBEnv_set_lk_max_locks, METH_VARARGS},
- {"set_lk_max_lockers", (PyCFunction)DBEnv_set_lk_max_lockers,
METH_VARARGS},
-@@ -5835,7 +5838,9 @@
- ADD_INT(d, DB_AFTER);
- ADD_INT(d, DB_APPEND);
- ADD_INT(d, DB_BEFORE);
-+#if (DBVER <= 40)
- ADD_INT(d, DB_CACHED_COUNTS);
-+#endif
- #if (DBVER >= 41)
- _addIntToDict(d, "DB_CHECKPOINT", 0);
- #else
-@@ -5870,7 +5875,9 @@
- ADD_INT(d, DB_POSITION);
- ADD_INT(d, DB_PREV);
- ADD_INT(d, DB_PREV_NODUP);
-+#if (DBVER <= 40)
- ADD_INT(d, DB_RECORDCOUNT);
-+#endif
- ADD_INT(d, DB_SET);
- ADD_INT(d, DB_SET_RANGE);
- ADD_INT(d, DB_SET_RECNO);
diff --git a/python-syslog-fail-noatexittb.patch b/python-syslog-fail-noatexittb.patch
deleted file mode 100644
index ee0094b..0000000
--- a/python-syslog-fail-noatexittb.patch
+++ /dev/null
@@ -1,16 +0,0 @@
---- Python-2.4.4/Lib/logging/handlers.py.syslogexit 2006-12-05 11:41:12.000000000 -0500
-+++ Python-2.4.4/Lib/logging/handlers.py 2006-12-05 11:41:20.000000000 -0500
-@@ -586,11 +586,11 @@
- self.address = address
- self.facility = facility
- if type(address) == types.StringType:
-- self._connect_unixsocket(address)
- self.unixsocket = 1
-+ self._connect_unixsocket(address)
- else:
-- self.socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
- self.unixsocket = 0
-+ self.socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
-
- self.formatter = None
-
diff --git a/python.spec b/python.spec
index 186e275..1b8fe67 100644
--- a/python.spec
+++ b/python.spec
@@ -19,9 +19,8 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
-#Version: %{pybasever}.3
-Version: 2.5
-Release: 12%{?dist}
+Version: 2.5.1
+Release: 1%{?dist}
License: Python Software Foundation License v2
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -30,16 +29,11 @@ Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
Patch0: python-2.5-config.patch
Patch1: Python-2.2.1-pydocnogui.patch
-Patch2: python-2.5-distutils-bdist-rpm.patch
-Patch3: python-2.3.4-pydocnodoc.patch
-Patch4: python-2.4.1-canonicalize.patch
-Patch5: python-2.5-cflags.patch
-Patch6: python-db45.patch
-Patch7: python-ctypes-execstack.patch
+Patch2: python-2.3.4-pydocnodoc.patch
+Patch3: python-2.4.1-canonicalize.patch
+Patch4: python-2.5-cflags.patch
# upstreamed
-Patch25: python-syslog-fail-noatexittb.patch
-Patch26: python-2.5-fix-invalid-assert.patch
# disable egg-infos for now
Patch50: python-2.5-disable-egginfo.patch
@@ -158,14 +152,9 @@ user interface for Python programming.
%patch0 -p1 -b .rhconfig
%patch1 -p1 -b .no_gui
-%patch2 -p1 -b .bdist-rpm
-%patch3 -p1 -b .no-doc
-%patch4 -p1 -b .canonicalize
-%patch5 -p1 -b .cflags
-%patch6 -p1 -b .db45
-%patch7 -p1 -b .ctypes-exec
-%patch25 -p1 -b .syslog-atexit
-%patch26 -p1 -b .invalid-assert
+%patch2 -p1 -b .no-doc
+%patch3 -p1 -b .canonicalize
+%patch4 -p1 -b .cflags
%patch50 -p1 -b .egginfo
@@ -182,10 +171,6 @@ user interface for Python programming.
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
-# Temporary workaround to avoid confusing find-requires: don't ship the tests
-# as executable files
-chmod 0644 Lib/test/test_*.py
-
%build
topdir=`pwd`
export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC"
@@ -229,6 +214,9 @@ for fixed in $RPM_BUILD_ROOT%{_bindir}/pydoc; do
&& cat $fixed- > $fixed && rm -f $fixed-
done
+# don't include tests that are run at build time in the package
+rm -rf $RPM_BUILD_ROOT/%{_libdir}/python%{pybasever}/test
+
%if %{main_python}
ln -s python $RPM_BUILD_ROOT%{_bindir}/python2
%else
@@ -287,9 +275,6 @@ find . -name ".cvsignore"|xargs rm -f
#zero length
rm -f
$RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/site-packages/modulator/Templates/copyright
-# Clean up the testsuite - we don't need compiled files for it
-find $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/test \
- -name "*.pyc" -o -name "*.pyo" | xargs rm -f
rm -f $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/LICENSE.txt
@@ -396,7 +381,6 @@ rm -fr $RPM_BUILD_ROOT
/usr/include/*
%dir %{_libdir}/python%{pybasever}/config
%{_libdir}/python%{pybasever}/config/*
-%{_libdir}/python%{pybasever}/test
%{_libdir}/libpython%{pybasever}.so
%files tools
@@ -421,6 +405,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Thu May 31 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.1-1
+- update to python 2.5.1
+
* Mon Mar 19 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-12
- fix alpha build (#231961)
diff --git a/sources b/sources
index 99f6917..e8a2035 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-ddb7401e711354ca83b7842b733825a3 Python-2.5.tar.bz2
+70084ffa561660f07de466c2c8c4842d Python-2.5.1.tar.bz2
commit 920a5e3f5e75e4c0b2fe32a7b8e715bd5450a883
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Tue Apr 10 14:23:41 2007 +0000
- fix alpha build (#231961)
diff --git a/python.spec b/python.spec
index a59c446..186e275 100644
--- a/python.spec
+++ b/python.spec
@@ -21,7 +21,7 @@ Summary: An interpreted, interactive, object-oriented programming
language.
Name: %{python}
#Version: %{pybasever}.3
Version: 2.5
-Release: 11%{?dist}
+Release: 12%{?dist}
License: Python Software Foundation License v2
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -321,7 +321,7 @@ install -d $RPM_BUILD_ROOT/usr/lib/python%{pybasever}/site-packages
%define _pyconfig32_h pyconfig-32.h
%define _pyconfig64_h pyconfig-64.h
-%ifarch ppc64 s390x x86_64 ia64
+%ifarch ppc64 s390x x86_64 ia64 alpha
%define _pyconfig_h %{_pyconfig64_h}
%else
%define _pyconfig_h %{_pyconfig32_h}
@@ -421,6 +421,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Mon Mar 19 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-12
+- fix alpha build (#231961)
+
* Tue Feb 13 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-11
- tcl/tk was reverted; rebuild again
commit 53b3a204d2ad352b8ec81bd10494340a05d6513e
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Tue Feb 13 14:09:26 2007 +0000
- tcl/tk was reverted; rebuild again
diff --git a/python.spec b/python.spec
index f006f11..a59c446 100644
--- a/python.spec
+++ b/python.spec
@@ -21,7 +21,7 @@ Summary: An interpreted, interactive, object-oriented programming
language.
Name: %{python}
#Version: %{pybasever}.3
Version: 2.5
-Release: 10%{?dist}
+Release: 11%{?dist}
License: Python Software Foundation License v2
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -421,6 +421,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Tue Feb 13 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-11
+- tcl/tk was reverted; rebuild again
+
* Thu Feb 1 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-10
- rebuild for new tcl/tk
commit 759563caf1a71fb3fe3687f5859ef5e176ad8584
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Thu Feb 1 14:14:11 2007 +0000
- rebuild for new tcl/tk
diff --git a/python.spec b/python.spec
index c8fdfc9..f006f11 100644
--- a/python.spec
+++ b/python.spec
@@ -21,7 +21,7 @@ Summary: An interpreted, interactive, object-oriented programming
language.
Name: %{python}
#Version: %{pybasever}.3
Version: 2.5
-Release: 9%{?dist}
+Release: 10%{?dist}
License: Python Software Foundation License v2
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -421,6 +421,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Thu Feb 1 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-10
+- rebuild for new tcl/tk
+
* Tue Jan 16 2007 Miroslav Lichvar <mlichvar(a)redhat.com> - 2.5.3-9
- link with ncurses
commit 15bc50a50577561bc52fbba779eda41863c4bc62
Author: Miroslav Lichvar <mlichvar(a)fedoraproject.org>
Date: Tue Jan 16 17:27:02 2007 +0000
- link with ncurses
diff --git a/python-2.5-config.patch b/python-2.5-config.patch
index 14323fc..ae18a25 100644
--- a/python-2.5-config.patch
+++ b/python-2.5-config.patch
@@ -14,7 +14,7 @@
# It's okay for this to be a shared library, too.
-#readline readline.c -lreadline -ltermcap
-+readline readline.c -lreadline -ltermcap
++readline readline.c -lreadline -lncurses
# Modules that should always be present (non UNIX dependent):
@@ -192,7 +192,7 @@
# First, look at Setup.config; configure may have set this for you.
-#_curses _cursesmodule.c -lcurses -ltermcap
-+_curses _cursesmodule.c -lcurses -ltermcap
++_curses _cursesmodule.c -lncurses
# Wrapper for the panel library that's part of ncurses and SYSV curses.
-#_curses_panel _curses_panel.c -lpanel -lncurses
+_curses_panel _curses_panel.c -lpanel -lncurses
diff --git a/python.spec b/python.spec
index 6eb2802..c8fdfc9 100644
--- a/python.spec
+++ b/python.spec
@@ -21,7 +21,7 @@ Summary: An interpreted, interactive, object-oriented programming
language.
Name: %{python}
#Version: %{pybasever}.3
Version: 2.5
-Release: 8%{?dist}
+Release: 9%{?dist}
License: Python Software Foundation License v2
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -61,7 +61,7 @@ Provides: python-ctypes = 1.0.1
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-root
-BuildPrereq: readline-devel, libtermcap-devel, openssl-devel, gmp-devel
+BuildPrereq: readline-devel, openssl-devel, gmp-devel
BuildPrereq: ncurses-devel, gdbm-devel, zlib-devel, expat-devel
BuildPrereq: libGL-devel tk tix gcc-c++ libX11-devel glibc-devel
BuildPrereq: bzip2 tar /usr/bin/find pkgconfig tcl-devel tk-devel
@@ -421,6 +421,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Tue Jan 16 2007 Miroslav Lichvar <mlichvar(a)redhat.com> - 2.5.3-9
+- link with ncurses
+
* Sat Jan 6 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-8
- fix extensions to use shared libpython (#219564)
- all 64bit platforms need the regex fix (#122304)
commit 6520c8583b066e3302dc022f048d1232f0f642fe
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Sat Jan 6 21:43:04 2007 +0000
- fix extensions to use shared libpython (#219564)
- all 64bit platforms need the regex fix (#122304)
diff --git a/python.spec b/python.spec
index c10de75..6eb2802 100644
--- a/python.spec
+++ b/python.spec
@@ -21,7 +21,7 @@ Summary: An interpreted, interactive, object-oriented programming
language.
Name: %{python}
#Version: %{pybasever}.3
Version: 2.5
-Release: 7%{?dist}
+Release: 8%{?dist}
License: Python Software Foundation License v2
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -174,6 +174,11 @@ user interface for Python programming.
%patch102 -p1 -b .lib64
%endif
+%ifarch alpha ia64
+# 64bit, but not lib64 arches need this too...
+%patch101 -p1 -b .lib64-regex
+%endif
+
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -334,6 +339,7 @@ cat > $RPM_BUILD_ROOT%{_includedir}/python%{pybasever}/pyconfig.h
<< EOF
#error "Unkown word size"
#endif
EOF
+ln -s ../../libpython%{pybasever}.so
$RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/config/libpython%{pybasever}.so
# Fix for bug 201434: make sure distutils looks at the right pyconfig.h file
sed -i -e "s/'pyconfig.h'/'%{_pyconfig_h}'/"
$RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/distutils/sysconfig.py
@@ -363,8 +369,6 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/*.doc
%{_libdir}/python%{pybasever}/bsddb
%{_libdir}/python%{pybasever}/compiler
-%dir %{_libdir}/python%{pybasever}/config
-%{_libdir}/python%{pybasever}/config/Makefile
%{_libdir}/python%{pybasever}/ctypes
%{_libdir}/python%{pybasever}/curses
%{_libdir}/python%{pybasever}/distutils
@@ -390,7 +394,8 @@ rm -fr $RPM_BUILD_ROOT
%files devel
%defattr(-,root,root)
/usr/include/*
-%{_libdir}/python%{pybasever}/config
+%dir %{_libdir}/python%{pybasever}/config
+%{_libdir}/python%{pybasever}/config/*
%{_libdir}/python%{pybasever}/test
%{_libdir}/libpython%{pybasever}.so
@@ -416,6 +421,10 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Sat Jan 6 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-8
+- fix extensions to use shared libpython (#219564)
+- all 64bit platforms need the regex fix (#122304)
+
* Wed Jan 3 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-7
- fix ctypes to not require execstack (#220669)
commit d7072525be830483486ec15536547bc6a1340525
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Wed Jan 3 17:56:11 2007 +0000
- fix ctypes to not require execstack (#220669)
diff --git a/python-ctypes-execstack.patch b/python-ctypes-execstack.patch
new file mode 100644
index 0000000..40f716d
--- /dev/null
+++ b/python-ctypes-execstack.patch
@@ -0,0 +1,79 @@
+--- Python-2.5/Modules/_ctypes/libffi/src/x86/unix64.S.ctypes-exec 2006-03-08
20:35:32.000000000 -0500
++++ Python-2.5/Modules/_ctypes/libffi/src/x86/unix64.S 2007-01-03 12:48:32.000000000
-0500
+@@ -410,3 +410,5 @@
+ .LEFDE3:
+
+ #endif /* __x86_64__ */
++
++.section .note.GNU-stack,"",@progbits
+--- Python-2.5/Modules/_ctypes/libffi/src/x86/sysv.S.ctypes-exec 2006-03-08
20:35:32.000000000 -0500
++++ Python-2.5/Modules/_ctypes/libffi/src/x86/sysv.S 2007-01-03 12:48:32.000000000 -0500
+@@ -376,3 +376,5 @@
+ #endif
+
+ #endif /* ifndef __x86_64__ */
++
++.section .note.GNU-stack,"",@progbits
+--- Python-2.5/Modules/_ctypes/libffi/src/s390/sysv.S.ctypes-exec 2007-01-03
12:54:40.000000000 -0500
++++ Python-2.5/Modules/_ctypes/libffi/src/s390/sysv.S 2007-01-03 12:51:32.000000000
-0500
+@@ -427,3 +427,4 @@
+
+ #endif
+
++.section .note.GNU-stack,"",@progbits
+--- Python-2.5/Modules/_ctypes/libffi/src/powerpc/linux64.S.ctypes-exec 2007-01-03
12:54:40.000000000 -0500
++++ Python-2.5/Modules/_ctypes/libffi/src/powerpc/linux64.S 2007-01-03 12:51:51.000000000
-0500
+@@ -178,3 +178,5 @@
+ .align 3
+ .LEFDE1:
+ #endif
++
++.section .note.GNU-stack,"",@progbits
+---
Python-2.5/Modules/_ctypes/libffi/src/powerpc/linux64_closure.S.ctypes-exec 2007-01-03
12:54:40.000000000 -0500
++++ Python-2.5/Modules/_ctypes/libffi/src/powerpc/linux64_closure.S 2007-01-03
12:53:51.000000000 -0500
+@@ -204,3 +204,5 @@
+ .align 3
+ .LEFDE1:
+ #endif
++
++.section .note.GNU-stack,"",@progbits
+--- Python-2.5/Modules/_ctypes/libffi/src/powerpc/ppc_closure.S.ctypes-exec 2007-01-03
12:54:40.000000000 -0500
++++ Python-2.5/Modules/_ctypes/libffi/src/powerpc/ppc_closure.S 2007-01-03
12:52:35.000000000 -0500
+@@ -321,3 +321,5 @@
+ .LEFDE1:
+
+ #endif
++
++.section .note.GNU-stack,"",@progbits
+--- Python-2.5/Modules/_ctypes/libffi/src/powerpc/sysv.S.ctypes-exec 2007-01-03
12:54:40.000000000 -0500
++++ Python-2.5/Modules/_ctypes/libffi/src/powerpc/sysv.S 2007-01-03 12:51:57.000000000
-0500
+@@ -215,3 +215,5 @@
+ .align 2
+ .LEFDE1:
+ #endif
++
++.section .note.GNU-stack,"",@progbits
+--- Python-2.5/Modules/_ctypes/libffi/src/ia64/unix.S.ctypes-exec 2007-01-03
12:54:40.000000000 -0500
++++ Python-2.5/Modules/_ctypes/libffi/src/ia64/unix.S 2007-01-03 12:54:05.000000000
-0500
+@@ -553,3 +553,5 @@
+ data8 @pcrel(.Lld_hfa_float) // FFI_IA64_TYPE_HFA_FLOAT
+ data8 @pcrel(.Lld_hfa_double) // FFI_IA64_TYPE_HFA_DOUBLE
+ data8 @pcrel(.Lld_hfa_ldouble) // FFI_IA64_TYPE_HFA_LDOUBLE
++
++.section .note.GNU-stack,"",@progbits
+--- Python-2.5/Modules/_ctypes/libffi/src/sparc/v8.S.ctypes-exec 2007-01-03
12:54:40.000000000 -0500
++++ Python-2.5/Modules/_ctypes/libffi/src/sparc/v8.S 2007-01-03 12:54:24.000000000 -0500
+@@ -265,3 +265,5 @@
+ .byte 0x1f ! uleb128 0x1f
+ .align WS
+ .LLEFDE2:
++
++.section .note.GNU-stack,"",@progbits
+--- Python-2.5/Modules/_ctypes/libffi/src/sparc/v9.S.ctypes-exec 2007-01-03
12:54:40.000000000 -0500
++++ Python-2.5/Modules/_ctypes/libffi/src/sparc/v9.S 2007-01-03 12:54:26.000000000 -0500
+@@ -300,3 +300,5 @@
+ .align 8
+ .LLEFDE2:
+ #endif
++
++.section .note.GNU-stack,"",@progbits
diff --git a/python.spec b/python.spec
index 870a83b..c10de75 100644
--- a/python.spec
+++ b/python.spec
@@ -21,7 +21,7 @@ Summary: An interpreted, interactive, object-oriented programming
language.
Name: %{python}
#Version: %{pybasever}.3
Version: 2.5
-Release: 6%{?dist}
+Release: 7%{?dist}
License: Python Software Foundation License v2
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -35,6 +35,7 @@ Patch3: python-2.3.4-pydocnodoc.patch
Patch4: python-2.4.1-canonicalize.patch
Patch5: python-2.5-cflags.patch
Patch6: python-db45.patch
+Patch7: python-ctypes-execstack.patch
# upstreamed
Patch25: python-syslog-fail-noatexittb.patch
@@ -47,7 +48,6 @@ Patch50: python-2.5-disable-egginfo.patch
Patch101: python-2.3.4-lib64-regex.patch
Patch102: python-2.5-lib64.patch
-
%if %{main_python}
Obsoletes: Distutils
Provides: Distutils
@@ -163,6 +163,7 @@ user interface for Python programming.
%patch4 -p1 -b .canonicalize
%patch5 -p1 -b .cflags
%patch6 -p1 -b .db45
+%patch7 -p1 -b .ctypes-exec
%patch25 -p1 -b .syslog-atexit
%patch26 -p1 -b .invalid-assert
@@ -173,7 +174,6 @@ user interface for Python programming.
%patch102 -p1 -b .lib64
%endif
-
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -416,6 +416,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Wed Jan 3 2007 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-7
+- fix ctypes to not require execstack (#220669)
+
* Fri Dec 15 2006 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-6
- don't link against compat-db (Robert Scheck)
commit 68ac77b2148e5eace3bcf4c1f17738f5f4114844
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Fri Dec 15 16:04:04 2006 +0000
- don't link against compat-db (Robert Scheck)
diff --git a/python-2.5-config.patch b/python-2.5-config.patch
index 1010fd6..14323fc 100644
--- a/python-2.5-config.patch
+++ b/python-2.5-config.patch
@@ -226,7 +226,7 @@
-#DBINC=$(DB)/include
-#DBLIB=$(DB)/lib
-#_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
-+DBLIBVER=4.3
++DBLIBVER=4.5
+DBINC=/usr/include/db4
+DBLIB=/usr/lib
+_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
diff --git a/python.spec b/python.spec
index 89d57b4..870a83b 100644
--- a/python.spec
+++ b/python.spec
@@ -21,7 +21,7 @@ Summary: An interpreted, interactive, object-oriented programming
language.
Name: %{python}
#Version: %{pybasever}.3
Version: 2.5
-Release: 5%{?dist}
+Release: 6%{?dist}
License: Python Software Foundation License v2
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -416,6 +416,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Fri Dec 15 2006 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-6
+- don't link against compat-db (Robert Scheck)
+
* Wed Dec 13 2006 Jarod Wilson <jwilson(a)redhat.com> - 2.5.3-5
- fix invalid assert in debug mode (upstream changeset 52622)
commit 2fe2afdc322963071398f412f0daff924bbe2719
Author: Jarod Wilson <jwilson(a)fedoraproject.org>
Date: Wed Dec 13 18:16:04 2006 +0000
fix invalid assert in debug mode (upstream changeset 52622) -- required for
numpy build against python 2.5
diff --git a/python-2.5-fix-invalid-assert.patch b/python-2.5-fix-invalid-assert.patch
new file mode 100644
index 0000000..bbed09a
--- /dev/null
+++ b/python-2.5-fix-invalid-assert.patch
@@ -0,0 +1,22 @@
+diff -urp Python-2.5/Lib/test/test_grammar.py Python-2.5-fixes/Lib/test/test_grammar.py
+--- Python-2.5/Lib/test/test_grammar.py 2006-09-04 23:56:01.000000000 -0400
++++ Python-2.5-fixes/Lib/test/test_grammar.py 2006-12-13 12:38:03.000000000 -0500
+@@ -709,6 +709,7 @@ x = {'one': 1, 'two': 2, 'three': 3, 'fo
+
+ x = `x`
+ x = `1 or 2 or 3`
++x = `1,2`
+ x = x
+ x = 'x'
+ x = 123
+diff -urp Python-2.5/Python/ast.c Python-2.5-fixes/Python/ast.c
+--- Python-2.5/Python/ast.c 2006-09-04 23:56:01.000000000 -0400
++++ Python-2.5-fixes/Python/ast.c 2006-12-13 12:39:30.000000000 -0500
+@@ -538,6 +538,7 @@ seq_for_testlist(struct compiling *c, co
+ || TYPE(n) == listmaker
+ || TYPE(n) == testlist_gexp
+ || TYPE(n) == testlist_safe
++ || TYPE(n) == testlist1
+ );
+
+ seq = asdl_seq_new((NCH(n) + 1) / 2, c->c_arena);
diff --git a/python.spec b/python.spec
index 230d589..89d57b4 100644
--- a/python.spec
+++ b/python.spec
@@ -21,7 +21,7 @@ Summary: An interpreted, interactive, object-oriented programming
language.
Name: %{python}
#Version: %{pybasever}.3
Version: 2.5
-Release: 4%{?dist}
+Release: 5%{?dist}
License: Python Software Foundation License v2
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -38,6 +38,7 @@ Patch6: python-db45.patch
# upstreamed
Patch25: python-syslog-fail-noatexittb.patch
+Patch26: python-2.5-fix-invalid-assert.patch
# disable egg-infos for now
Patch50: python-2.5-disable-egginfo.patch
@@ -163,6 +164,7 @@ user interface for Python programming.
%patch5 -p1 -b .cflags
%patch6 -p1 -b .db45
%patch25 -p1 -b .syslog-atexit
+%patch26 -p1 -b .invalid-assert
%patch50 -p1 -b .egginfo
@@ -414,6 +416,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Wed Dec 13 2006 Jarod Wilson <jwilson(a)redhat.com> - 2.5.3-5
+- fix invalid assert in debug mode (upstream changeset 52622)
+
* Tue Dec 12 2006 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-4
- obsolete/provide python-ctypes (#219256)
commit 7b22577247bed58d923ae50f539e22eb2516c297
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Tue Dec 12 15:54:31 2006 +0000
- obsolete/provide python-ctypes (#219256)
diff --git a/python.spec b/python.spec
index dc244ef..230d589 100644
--- a/python.spec
+++ b/python.spec
@@ -21,7 +21,7 @@ Summary: An interpreted, interactive, object-oriented programming
language.
Name: %{python}
#Version: %{pybasever}.3
Version: 2.5
-Release: 3%{?dist}
+Release: 4%{?dist}
License: Python Software Foundation License v2
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -55,6 +55,8 @@ Provides: python2 = %{version}
Obsoletes: python-elementtree <= 1.2.6
Obsoletes: python-sqlite < 2.3.2
Provides: python-sqlite = 2.3.2
+Obsoletes: python-ctypes < 1.0.1
+Provides: python-ctypes = 1.0.1
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-root
@@ -412,6 +414,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Tue Dec 12 2006 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-4
+- obsolete/provide python-ctypes (#219256)
+
* Mon Dec 11 2006 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-3
- fix atexit traceback with failed syslog logger (#218214)
- split libpython into python-libs subpackage for multilib apps
commit 5b28df5dc672ccc4fa29136da78c791fc07af372
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Mon Dec 11 17:46:26 2006 +0000
- fix atexit traceback with failed syslog logger (#218214)
- split libpython into python-libs subpackage for multilib apps embedding
python interpreters
diff --git a/python-syslog-fail-noatexittb.patch b/python-syslog-fail-noatexittb.patch
new file mode 100644
index 0000000..ee0094b
--- /dev/null
+++ b/python-syslog-fail-noatexittb.patch
@@ -0,0 +1,16 @@
+--- Python-2.4.4/Lib/logging/handlers.py.syslogexit 2006-12-05 11:41:12.000000000 -0500
++++ Python-2.4.4/Lib/logging/handlers.py 2006-12-05 11:41:20.000000000 -0500
+@@ -586,11 +586,11 @@
+ self.address = address
+ self.facility = facility
+ if type(address) == types.StringType:
+- self._connect_unixsocket(address)
+ self.unixsocket = 1
++ self._connect_unixsocket(address)
+ else:
+- self.socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+ self.unixsocket = 0
++ self.socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+
+ self.formatter = None
+
diff --git a/python.spec b/python.spec
index 42ef151..dc244ef 100644
--- a/python.spec
+++ b/python.spec
@@ -340,9 +340,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/*.egg-info
%clean
rm -fr $RPM_BUILD_ROOT
-%post -n libs -p /sbin/ldconfig
+%post libs -p /sbin/ldconfig
-%postun -n libs -p /sbin/ldconfig
+%postun libs -p /sbin/ldconfig
%files -f dynfiles
commit 87c8da23744680fd2a6ed576d5db46f6e2080665
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Mon Dec 11 17:40:03 2006 +0000
- fix atexit traceback with failed syslog logger (#218214)
- split libpython into python-libs subpackage for multilib apps embedding
python interpreters
diff --git a/python.spec b/python.spec
index f6508b2..42ef151 100644
--- a/python.spec
+++ b/python.spec
@@ -21,8 +21,8 @@ Summary: An interpreted, interactive, object-oriented programming
language.
Name: %{python}
#Version: %{pybasever}.3
Version: 2.5
-Release: 2%{?dist}
-License: PSF - see LICENSE
+Release: 3%{?dist}
+License: Python Software Foundation License v2
Group: Development/Languages
Provides: python-abi = %{pybasever}
Provides: python(abi) = %{pybasever}
@@ -36,6 +36,9 @@ Patch4: python-2.4.1-canonicalize.patch
Patch5: python-2.5-cflags.patch
Patch6: python-db45.patch
+# upstreamed
+Patch25: python-syslog-fail-noatexittb.patch
+
# disable egg-infos for now
Patch50: python-2.5-disable-egginfo.patch
@@ -82,6 +85,16 @@ set for Tk and RPM.
Note that documentation for Python is provided in the python-docs
package.
+%package libs
+Summary: The libraries for python runtime
+Group: Applications/System
+Requires: %{python} = %{version}-%{release}
+
+%description libs
+The python interpreter can be embedded into applications wanting to
+use python as an embedded scripting language. The python-libs package
+provides the libraries needed for this.
+
%package devel
Summary: The libraries and header files needed for Python development.
Group: Development/Libraries
@@ -147,6 +160,7 @@ user interface for Python programming.
%patch4 -p1 -b .canonicalize
%patch5 -p1 -b .cflags
%patch6 -p1 -b .db45
+%patch25 -p1 -b .syslog-atexit
%patch50 -p1 -b .egginfo
@@ -326,13 +340,17 @@ rm $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/*.egg-info
%clean
rm -fr $RPM_BUILD_ROOT
+%post -n libs -p /sbin/ldconfig
+
+%postun -n libs -p /sbin/ldconfig
+
+
%files -f dynfiles
%defattr(-, root, root)
%doc LICENSE README
%{_bindir}/pydoc*
%{_bindir}/python*
%{_mandir}/*/*
-%{_libdir}/libpython%{pybasever}.so*
%dir %{_libdir}/python%{pybasever}
%dir %{_libdir}/python%{pybasever}/site-packages
@@ -360,11 +378,17 @@ rm -fr $RPM_BUILD_ROOT
%attr(0755,root,root) %dir /usr/lib/python%{pybasever}/site-packages
%endif
+%files libs
+%defattr(-,root,root)
+%doc LICENSE README
+%{_libdir}/libpython%{pybasever}.so.*
+
%files devel
%defattr(-,root,root)
/usr/include/*
%{_libdir}/python%{pybasever}/config
%{_libdir}/python%{pybasever}/test
+%{_libdir}/libpython%{pybasever}.so
%files tools
%defattr(-,root,root,755)
@@ -388,6 +412,11 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Mon Dec 11 2006 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-3
+- fix atexit traceback with failed syslog logger (#218214)
+- split libpython into python-libs subpackage for multilib apps
+ embedding python interpreters
+
* Wed Dec 6 2006 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-2
- disable installation of .egg-info files for now
commit 12cb76fad1d4852810c97ecdd49afc6416fdb19a
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Wed Dec 6 22:15:01 2006 +0000
- disable installation of .egg-info files for now
diff --git a/python-2.5-disable-egginfo.patch b/python-2.5-disable-egginfo.patch
new file mode 100644
index 0000000..920b90c
--- /dev/null
+++ b/python-2.5-disable-egginfo.patch
@@ -0,0 +1,11 @@
+--- Python-2.5/Lib/distutils/command/install.py.egginfo 2006-12-06 17:12:57.000000000
-0500
++++ Python-2.5/Lib/distutils/command/install.py 2006-12-06 17:13:10.000000000 -0500
+@@ -601,7 +601,7 @@
+ ('install_headers', has_headers),
+ ('install_scripts', has_scripts),
+ ('install_data', has_data),
+- ('install_egg_info', lambda self:True),
++ ('install_egg_info', lambda self:False),
+ ]
+
+ # class install
diff --git a/python.spec b/python.spec
index 42b91e0..f6508b2 100644
--- a/python.spec
+++ b/python.spec
@@ -21,7 +21,7 @@ Summary: An interpreted, interactive, object-oriented programming
language.
Name: %{python}
#Version: %{pybasever}.3
Version: 2.5
-Release: 1%{?dist}
+Release: 2%{?dist}
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -36,10 +36,14 @@ Patch4: python-2.4.1-canonicalize.patch
Patch5: python-2.5-cflags.patch
Patch6: python-db45.patch
+# disable egg-infos for now
+Patch50: python-2.5-disable-egginfo.patch
+
# lib64 patches
Patch101: python-2.3.4-lib64-regex.patch
Patch102: python-2.5-lib64.patch
+
%if %{main_python}
Obsoletes: Distutils
Provides: Distutils
@@ -144,6 +148,8 @@ user interface for Python programming.
%patch5 -p1 -b .cflags
%patch6 -p1 -b .db45
+%patch50 -p1 -b .egginfo
+
%if %{_lib} == lib64
%patch101 -p1 -b .lib64-regex
%patch102 -p1 -b .lib64
@@ -382,6 +388,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Wed Dec 6 2006 Jeremy Katz <katzj(a)redhat.com> - 2.5.3-2
+- disable installation of .egg-info files for now
+
* Tue Dec 5 2006 Jeremy Katz <katzj(a)redhat.com>
- support db 4.5
- obsolete python-elementtree; since it requires some code tweaks, don't
commit bca2575b8bc5dd110ec2e312c9615db2345b7880
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Tue Dec 5 21:44:25 2006 +0000
bump version add some more provides/obsoletes
diff --git a/python.spec b/python.spec
index 6ab09e3..42b91e0 100644
--- a/python.spec
+++ b/python.spec
@@ -21,7 +21,7 @@ Summary: An interpreted, interactive, object-oriented programming
language.
Name: %{python}
#Version: %{pybasever}.3
Version: 2.5
-Release: 0%{?dist}
+Release: 1%{?dist}
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -45,6 +45,9 @@ Obsoletes: Distutils
Provides: Distutils
Obsoletes: python2
Provides: python2 = %{version}
+Obsoletes: python-elementtree <= 1.2.6
+Obsoletes: python-sqlite < 2.3.2
+Provides: python-sqlite = 2.3.2
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-root
@@ -381,6 +384,9 @@ rm -fr $RPM_BUILD_ROOT
%changelog
* Tue Dec 5 2006 Jeremy Katz <katzj(a)redhat.com>
- support db 4.5
+- obsolete python-elementtree; since it requires some code tweaks, don't
+ provide it
+- obsolete old python-sqlite; provide the version that's actually included
* Mon Oct 30 2006 Jeremy Katz <katzj(a)redhat.com>
- fix _md5 and _sha modules (Robert Sheck)
commit 60b7a5f84fa3f6ea3d0d96fa99030a67a2aa018b
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Tue Dec 5 21:34:32 2006 +0000
auto-import python-2.5-0 on branch devel from python-2.5-0.src.rpm
diff --git a/.cvsignore b/.cvsignore
index df52b7f..21fcb88 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -1,5 +1 @@
-Python-2.4.1.tar.bz2
-JapaneseCodecs-1.4.11.tar.gz
-Python-2.4.2.tar.bz2
-Python-2.4.3.tar.bz2
-Python-2.4.4.tar.bz2
+Python-2.5.tar.bz2
diff --git a/python-2.5-cflags.patch b/python-2.5-cflags.patch
new file mode 100644
index 0000000..32243bf
--- /dev/null
+++ b/python-2.5-cflags.patch
@@ -0,0 +1,11 @@
+--- Python-2.5c1/Makefile.pre.in.cflags 2006-08-18 11:05:40.000000000 -0400
++++ Python-2.5c1/Makefile.pre.in 2006-08-18 11:09:26.000000000 -0400
+@@ -334,7 +334,7 @@
+
+ # Build the interpreter
+ $(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
+- $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
++ $(LINKCC) $(CFLAGS) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
+ Modules/python.o \
+ $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
+
diff --git a/python-2.5-config.patch b/python-2.5-config.patch
new file mode 100644
index 0000000..1010fd6
--- /dev/null
+++ b/python-2.5-config.patch
@@ -0,0 +1,285 @@
+--- Python-2.5/Modules/Setup.dist.rhconfig 2006-08-06 03:26:21.000000000 -0400
++++ Python-2.5/Modules/Setup.dist 2006-10-30 16:25:16.000000000 -0500
+@@ -149,7 +149,7 @@
+ # modules are to be built as shared libraries (see above for more
+ # detail; also note that *static* reverses this effect):
+
+-#*shared*
++*shared*
+
+ # GNU readline. Unlike previous Python incarnations, GNU readline is
+ # now incorporated in an optional module, configured in the Setup file
+@@ -159,69 +159,69 @@
+ # it, depending on your system -- see the GNU readline instructions.
+ # It's okay for this to be a shared library, too.
+
+-#readline readline.c -lreadline -ltermcap
++readline readline.c -lreadline -ltermcap
+
+
+ # Modules that should always be present (non UNIX dependent):
+
+-#array arraymodule.c # array objects
+-#cmath cmathmodule.c # -lm # complex math library functions
+-#math mathmodule.c # -lm # math library functions, e.g. sin()
+-#_struct _struct.c # binary structure packing/unpacking
+-#time timemodule.c # -lm # time operations and variables
+-#operator operator.c # operator.add() and similar goodies
+-#_weakref _weakref.c # basic weak reference support
+-#_testcapi _testcapimodule.c # Python C API test module
+-#_random _randommodule.c # Random number generator
+-#collections collectionsmodule.c # Container types
+-#itertools itertoolsmodule.c # Functions creating iterators for efficient looping
+-#strop stropmodule.c # String manipulations
++array arraymodule.c # array objects
++cmath cmathmodule.c # -lm # complex math library functions
++math mathmodule.c # -lm # math library functions, e.g. sin()
++_struct _struct.c # binary structure packing/unpacking
++time timemodule.c # -lm # time operations and variables
++operator operator.c # operator.add() and similar goodies
++_weakref _weakref.c # basic weak reference support
++_testcapi _testcapimodule.c # Python C API test module
++_random _randommodule.c # Random number generator
++collections collectionsmodule.c # Container types
++itertools itertoolsmodule.c # Functions creating iterators for efficient looping
++strop stropmodule.c # String manipulations
+
+-#unicodedata unicodedata.c # static Unicode character database
++unicodedata unicodedata.c # static Unicode character database
+
+ # access to ISO C locale support
+-#_locale _localemodule.c # -lintl
++_locale _localemodule.c # -lintl
+
+
+ # Modules with some UNIX dependencies -- on by default:
+ # (If you have a really backward UNIX, select and socket may not be
+ # supported...)
+
+-#fcntl fcntlmodule.c # fcntl(2) and ioctl(2)
+-#spwd spwdmodule.c # spwd(3)
+-#grp grpmodule.c # grp(3)
+-#select selectmodule.c # select(2); not on ancient System V
++fcntl fcntlmodule.c # fcntl(2) and ioctl(2)
++spwd spwdmodule.c # spwd(3)
++grp grpmodule.c # grp(3)
++select selectmodule.c # select(2); not on ancient System V
+
+ # Memory-mapped files (also works on Win32).
+-#mmap mmapmodule.c
++mmap mmapmodule.c
+
+ # CSV file helper
+-#_csv _csv.c
++_csv _csv.c
+
+ # Socket module helper for socket(2)
+-#_socket socketmodule.c
++_socket socketmodule.c
+
+ # Socket module helper for SSL support; you must comment out the other
+ # socket line above, and possibly edit the SSL variable:
+ #SSL=/usr/local/ssl
+-#_ssl _ssl.c \
+-# -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
+-# -L$(SSL)/lib -lssl -lcrypto
++_ssl _ssl.c \
++ -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
++ -L$(SSL)/lib -lssl -lcrypto
+
+ # The crypt module is now disabled by default because it breaks builds
+ # on many systems (where -lcrypt is needed), e.g. Linux (I believe).
+ #
+ # First, look at Setup.config; configure may have set this for you.
+
+-#crypt cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some systems
++crypt cryptmodule.c -lcrypt # crypt(3); needs -lcrypt on some systems
+
+
+ # Some more UNIX dependent modules -- off by default, since these
+ # are not supported by all UNIX systems:
+
+-#nis nismodule.c -lnsl # Sun yellow pages -- not everywhere
+-#termios termios.c # Steen Lumholt's termios module
+-#resource resource.c # Jeremy Hylton's rlimit interface
++nis nismodule.c -lnsl # Sun yellow pages -- not everywhere
++termios termios.c # Steen Lumholt's termios module
++resource resource.c # Jeremy Hylton's rlimit interface
+
+
+ # Multimedia modules -- off by default.
+@@ -229,9 +229,9 @@
+ # #993173 says audioop works on 64-bit platforms, though.
+ # These represent audio samples or images as strings:
+
+-#audioop audioop.c # Operations on audio samples
+-#imageop imageop.c # Operations on images
+-#rgbimg rgbimgmodule.c # Read SGI RGB image files (but coded portably)
++audioop audioop.c # Operations on audio samples
++imageop imageop.c # Operations on images
++rgbimg rgbimgmodule.c # Read SGI RGB image files (but coded portably)
+
+
+ # Note that the _md5 and _sha modules are normally only built if the
+@@ -241,12 +241,12 @@
+ # Message-Digest Algorithm, described in RFC 1321. The necessary files
+ # md5.c and md5.h are included here.
+
+-#_md5 md5module.c md5.c
++_md5 md5module.c md5.c
+
+
+ # The _sha module implements the SHA checksum algorithm.
+ # (NIST's Secure Hash Algorithm.)
+-#_sha shamodule.c
++_sha shamodule.c
+
+
+ # SGI IRIX specific modules -- off by default.
+@@ -293,12 +293,12 @@
+ # A Linux specific module -- off by default; this may also work on
+ # some *BSDs.
+
+-#linuxaudiodev linuxaudiodev.c
++linuxaudiodev linuxaudiodev.c
+
+
+ # George Neville-Neil's timing module:
+
+-#timing timingmodule.c
++timing timingmodule.c
+
+
+ # The _tkinter module.
+@@ -313,7 +313,7 @@
+ # every system.
+
+ # *** Always uncomment this (leave the leading underscore in!):
+-# _tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \
++_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \
+ # *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
+ # -L/usr/local/lib \
+ # *** Uncomment and edit to reflect where your Tcl/Tk headers are:
+@@ -323,7 +323,7 @@
+ # *** Or uncomment this for Solaris:
+ # -I/usr/openwin/include \
+ # *** Uncomment and edit for Tix extension only:
+-# -DWITH_TIX -ltix8.1.8.2 \
++ -DWITH_TIX -ltix \
+ # *** Uncomment and edit for BLT extension only:
+ # -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \
+ # *** Uncomment and edit for PIL (TkImaging) extension only:
+@@ -332,7 +332,7 @@
+ # *** Uncomment and edit for TOGL extension only:
+ # -DWITH_TOGL togl.c \
+ # *** Uncomment and edit to reflect your Tcl/Tk versions:
+-# -ltk8.2 -ltcl8.2 \
++ -ltk -ltcl \
+ # *** Uncomment and edit to reflect where your X11 libraries are:
+ # -L/usr/X11R6/lib \
+ # *** Or uncomment this for Solaris:
+@@ -342,7 +342,7 @@
+ # *** Uncomment for AIX:
+ # -lld \
+ # *** Always uncomment this; X11 libraries to link with:
+-# -lX11
++ -lX11
+
+ # Lance Ellinghaus's syslog module
+ #syslog syslogmodule.c # syslog daemon interface
+@@ -354,9 +354,9 @@
+ #
+ # First, look at Setup.config; configure may have set this for you.
+
+-#_curses _cursesmodule.c -lcurses -ltermcap
++_curses _cursesmodule.c -lcurses -ltermcap
+ # Wrapper for the panel library that's part of ncurses and SYSV curses.
+-#_curses_panel _curses_panel.c -lpanel -lncurses
++_curses_panel _curses_panel.c -lpanel -lncurses
+
+
+ # Generic (SunOS / SVR4) dynamic loading module.
+@@ -364,7 +364,7 @@
+ # it is a highly experimental and dangerous device for calling
+ # *arbitrary* C functions in *arbitrary* shared libraries:
+
+-#dl dlmodule.c
++dl dlmodule.c
+
+
+ # Modules that provide persistent dictionary-like semantics. You will
+@@ -387,7 +387,7 @@
+ #
+ # First, look at Setup.config; configure may have set this for you.
+
+-#gdbm gdbmmodule.c -I/usr/local/include -L/usr/local/lib -lgdbm
++gdbm gdbmmodule.c -I/usr/local/include -L/usr/local/lib -lgdbm
+
+
+ # Sleepycat Berkeley DB interface.
+@@ -402,11 +402,10 @@
+ #
+ # Edit the variables DB and DBLIBVERto point to the db top directory
+ # and the subdirectory of PORT where you built it.
+-#DB=/usr/local/BerkeleyDB.4.0
+-#DBLIBVER=4.0
+-#DBINC=$(DB)/include
+-#DBLIB=$(DB)/lib
+-#_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
++DBLIBVER=4.3
++DBINC=/usr/include/db4
++DBLIB=/usr/lib
++_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
+
+ # Historical Berkeley DB 1.85
+ #
+@@ -421,14 +420,14 @@
+
+
+ # Helper module for various ascii-encoders
+-#binascii binascii.c
++binascii binascii.c
+
+ # Fred Drake's interface to the Python parser
+-#parser parsermodule.c
++parser parsermodule.c
+
+ # cStringIO and cPickle
+-#cStringIO cStringIO.c
+-#cPickle cPickle.c
++cStringIO cStringIO.c
++cPickle cPickle.c
+
+
+ # Lee Busby's SIGFPE modules.
+@@ -451,7 +450,7 @@
+ # Andrew Kuchling's zlib module.
+ # This require zlib 1.1.3 (or later).
+ # See
http://www.gzip.org/zlib/
+-#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
++zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
+
+ # Interface to the Expat XML parser
+ #
+@@ -471,14 +470,14 @@
+ # Hye-Shik Chang's CJKCodecs
+
+ # multibytecodec is required for all the other CJK codec modules
+-#_multibytecodec cjkcodecs/multibytecodec.c
++_multibytecodec cjkcodecs/multibytecodec.c
+
+-#_codecs_cn cjkcodecs/_codecs_cn.c
+-#_codecs_hk cjkcodecs/_codecs_hk.c
+-#_codecs_iso2022 cjkcodecs/_codecs_iso2022.c
+-#_codecs_jp cjkcodecs/_codecs_jp.c
+-#_codecs_kr cjkcodecs/_codecs_kr.c
+-#_codecs_tw cjkcodecs/_codecs_tw.c
++_codecs_cn cjkcodecs/_codecs_cn.c
++_codecs_hk cjkcodecs/_codecs_hk.c
++_codecs_iso2022 cjkcodecs/_codecs_iso2022.c
++_codecs_jp cjkcodecs/_codecs_jp.c
++_codecs_kr cjkcodecs/_codecs_kr.c
++_codecs_tw cjkcodecs/_codecs_tw.c
+
+ # Example -- included for reference only:
+ # xx xxmodule.c
diff --git a/python-2.5-distutils-bdist-rpm.patch b/python-2.5-distutils-bdist-rpm.patch
new file mode 100644
index 0000000..982430b
--- /dev/null
+++ b/python-2.5-distutils-bdist-rpm.patch
@@ -0,0 +1,75 @@
+--- Python-2.5a2/Lib/distutils/command/bdist_rpm.py.bdist-rpm 2005-04-15
02:17:20.000000000 -0400
++++ Python-2.5a2/Lib/distutils/command/bdist_rpm.py 2006-06-19 09:14:28.000000000 -0400
+@@ -337,37 +337,47 @@
+ if not self.keep_temp:
+ rpm_cmd.append('--clean')
+ rpm_cmd.append(spec_path)
++ # Determine the binary rpm names that should be built out of this spec
++ # file
++ # Note that some of these may not be really built (if the file
++ # list is empty)
++ nvr_string = "%{name}-%{version}-%{release}"
++ src_rpm = nvr_string + ".src.rpm"
++ non_src_rpm = "%{arch}/" + nvr_string + ".%{arch}.rpm"
++ q_cmd = r"rpm -q --qf '%s %s\n' --specfile '%s'" % (
++ src_rpm, non_src_rpm, spec_path)
++
++ out = os.popen(q_cmd)
++ binary_rpms = []
++ source_rpm = None
++ while 1:
++ line = out.readline()
++ if not line:
++ break
++ l = string.split(string.strip(line))
++ assert(len(l) == 2)
++ binary_rpms.append(l[1])
++ # The source rpm is named after the first entry in the spec file
++ if source_rpm is None:
++ source_rpm = l[0]
++
++ status = out.close()
++ if status:
++ raise DistutilsExecError("Failed to execute: %s" % repr(q_cmd))
++
+ self.spawn(rpm_cmd)
+
+- # XXX this is a nasty hack -- we really should have a proper way to
+- # find out the names of the RPM files created; also, this assumes
+- # that RPM creates exactly one source and one binary RPM.
+ if not self.dry_run:
+ if not self.binary_only:
+- srpms = glob.glob(os.path.join(rpm_dir['SRPMS'],
"*.rpm"))
+- assert len(srpms) == 1, \
+- "unexpected number of SRPM files found: %s" % srpms
+- dist_file = ('bdist_rpm', 'any',
+- self._dist_path(srpms[0]))
+- self.distribution.dist_files.append(dist_file)
+- self.move_file(srpms[0], self.dist_dir)
++ srpm = os.path.join(rpm_dir['SRPMS'], source_rpm)
++ assert(os.path.exists(srpm))
++ self.move_file(srpm, self.dist_dir)
+
+ if not self.source_only:
+- rpms = glob.glob(os.path.join(rpm_dir['RPMS'],
"*/*.rpm"))
+- debuginfo = glob.glob(os.path.join(rpm_dir['RPMS'],
+- "*/*debuginfo*.rpm"))
+- if debuginfo:
+- rpms.remove(debuginfo[0])
+- assert len(rpms) == 1, \
+- "unexpected number of RPM files found: %s" % rpms
+- dist_file = ('bdist_rpm', get_python_version(),
+- self._dist_path(rpms[0]))
+- self.distribution.dist_files.append(dist_file)
+- self.move_file(rpms[0], self.dist_dir)
+- if debuginfo:
+- dist_file = ('bdist_rpm', get_python_version(),
+- self._dist_path(debuginfo[0]))
+- self.move_file(debuginfo[0], self.dist_dir)
++ for rpm in binary_rpms:
++ rpm = os.path.join(rpm_dir['RPMS'], rpm)
++ if os.path.exists(rpm):
++ self.move_file(rpm, self.dist_dir)
+ # run()
+
+ def _dist_path(self, path):
diff --git a/python-2.5-lib64.patch b/python-2.5-lib64.patch
new file mode 100644
index 0000000..3e8c245
--- /dev/null
+++ b/python-2.5-lib64.patch
@@ -0,0 +1,165 @@
+--- Python-2.5b1/Lib/distutils/command/install.py.lib64 2006-03-27 16:55:21.000000000
-0500
++++ Python-2.5b1/Lib/distutils/command/install.py 2006-06-22 12:20:35.000000000 -0400
+@@ -39,14 +39,14 @@
+ INSTALL_SCHEMES = {
+ 'unix_prefix': {
+ 'purelib': '$base/lib/python$py_version_short/site-packages',
+- 'platlib':
'$platbase/lib/python$py_version_short/site-packages',
++ 'platlib':
'$platbase/lib64/python$py_version_short/site-packages',
+ 'headers': '$base/include/python$py_version_short/$dist_name',
+ 'scripts': '$base/bin',
+ 'data' : '$base',
+ },
+ 'unix_home': {
+ 'purelib': '$base/lib/python',
+- 'platlib': '$base/lib/python',
++ 'platlib': '$base/lib64/python',
+ 'headers': '$base/include/python/$dist_name',
+ 'scripts': '$base/bin',
+ 'data' : '$base',
+--- Python-2.5b1/Lib/distutils/sysconfig.py.lib64 2006-05-23 08:01:11.000000000 -0400
++++ Python-2.5b1/Lib/distutils/sysconfig.py 2006-06-22 12:20:35.000000000 -0400
+@@ -99,8 +99,12 @@
+ prefix = plat_specific and EXEC_PREFIX or PREFIX
+
+ if os.name == "posix":
++ if plat_specific or standard_lib:
++ lib = "lib64"
++ else:
++ lib = "lib"
+ libpython = os.path.join(prefix,
+- "lib", "python" +
get_python_version())
++ lib, "python" + get_python_version())
+ if standard_lib:
+ return libpython
+ else:
+--- Python-2.5b1/Lib/site.py.lib64 2006-06-12 04:23:02.000000000 -0400
++++ Python-2.5b1/Lib/site.py 2006-06-22 12:20:35.000000000 -0400
+@@ -182,9 +182,14 @@
+ sitedirs = [os.path.join(prefix, "Lib",
"site-packages")]
+ elif os.sep == '/':
+ sitedirs = [os.path.join(prefix,
+- "lib",
++ "lib64",
+ "python" + sys.version[:3],
+ "site-packages"),
++ os.path.join(prefix,
++ "lib",
++ "python" + sys.version[:3],
++ "site-packages"),
++ os.path.join(prefix, "lib64",
"site-python"),
+ os.path.join(prefix, "lib",
"site-python")]
+ else:
+ sitedirs = [prefix, os.path.join(prefix, "lib",
"site-packages")]
+--- Python-2.5b1/setup.py.lib64 2006-06-05 19:38:06.000000000 -0400
++++ Python-2.5b1/setup.py 2006-06-22 12:22:14.000000000 -0400
+@@ -244,7 +244,7 @@
+
+ def detect_modules(self):
+ # Ensure that /usr/local is always used
+- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
++ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib64')
+ add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+
+ # Add paths specified in the environment variables LDFLAGS and
+@@ -496,11 +496,11 @@
+ elif self.compiler.find_library_file(lib_dirs, 'curses'):
+ readline_libs.append('curses')
+ elif self.compiler.find_library_file(lib_dirs +
+- ['/usr/lib/termcap'],
++ ['/usr/lib64/termcap'],
+ 'termcap'):
+ readline_libs.append('termcap')
+ exts.append( Extension('readline', ['readline.c'],
+- library_dirs=['/usr/lib/termcap'],
++ library_dirs=['/usr/lib64/termcap'],
+ extra_link_args=readline_extra_link_args,
+ libraries=readline_libs) )
+ if platform not in ['mac']:
+@@ -532,8 +532,8 @@
+ if krb5_h:
+ ssl_incs += krb5_h
+ ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
+- ['/usr/local/ssl/lib',
+- '/usr/contrib/ssl/lib/'
++ ['/usr/local/ssl/lib64',
++ '/usr/contrib/ssl/lib64/'
+ ] )
+
+ if (ssl_incs is not None and
+--- Python-2.5b1/Makefile.pre.in.lib64 2006-06-11 15:45:57.000000000 -0400
++++ Python-2.5b1/Makefile.pre.in 2006-06-22 12:20:34.000000000 -0400
+@@ -84,11 +84,11 @@
+
+ # Expanded directories
+ BINDIR= $(exec_prefix)/bin
+-LIBDIR= $(exec_prefix)/lib
++LIBDIR= $(exec_prefix)/lib64
+ MANDIR= @mandir@
+ INCLUDEDIR= @includedir@
+ CONFINCLUDEDIR= $(exec_prefix)/include
+-SCRIPTDIR= $(prefix)/lib
++SCRIPTDIR= $(prefix)/lib64
+
+ # Detailed destination directories
+ BINLIBDEST= $(LIBDIR)/python$(VERSION)
+--- Python-2.5b1/Modules/Setup.dist.lib64 2006-06-22 12:20:34.000000000 -0400
++++ Python-2.5b1/Modules/Setup.dist 2006-06-22 12:20:35.000000000 -0400
+@@ -401,7 +401,7 @@
+ # and the subdirectory of PORT where you built it.
+ DBLIBVER=4.3
+ DBINC=/usr/include/db4
+-DBLIB=/usr/lib
++DBLIB=/usr/lib64
+ _bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER)
+
+ # Historical Berkeley DB 1.85
+@@ -447,7 +447,7 @@
+ # Andrew Kuchling's zlib module.
+ # This require zlib 1.1.3 (or later).
+ # See
http://www.gzip.org/zlib/
+-zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
++zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib64 -lz
+
+ # Interface to the Expat XML parser
+ #
+--- Python-2.5b1/Modules/getpath.c.lib64 2006-04-12 22:06:09.000000000 -0400
++++ Python-2.5b1/Modules/getpath.c 2006-06-22 12:20:35.000000000 -0400
+@@ -117,8 +117,8 @@
+ #endif
+
+ #ifndef PYTHONPATH
+-#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
+- EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
++#define PYTHONPATH PREFIX "/lib64/python" VERSION ":" \
++ EXEC_PREFIX "/lib64/python" VERSION "/lib-dynload"
+ #endif
+
+ #ifndef LANDMARK
+@@ -129,7 +129,7 @@
+ static char exec_prefix[MAXPATHLEN+1];
+ static char progpath[MAXPATHLEN+1];
+ static char *module_search_path = NULL;
+-static char lib_python[] = "lib/python" VERSION;
++static char lib_python[] = "lib64/python" VERSION;
+
+ static void
+ reduce(char *dir)
+@@ -524,7 +524,7 @@
+ }
+ else
+ strncpy(zip_path, PREFIX, MAXPATHLEN);
+- joinpath(zip_path, "lib/python00.zip");
++ joinpath(zip_path, "lib64/python00.zip");
+ bufsz = strlen(zip_path); /* Replace "00" with version */
+ zip_path[bufsz - 6] = VERSION[0];
+ zip_path[bufsz - 5] = VERSION[2];
+@@ -534,7 +534,7 @@
+ fprintf(stderr,
+ "Could not find platform dependent libraries
<exec_prefix>\n");
+ strncpy(exec_prefix, EXEC_PREFIX, MAXPATHLEN);
+- joinpath(exec_prefix, "lib/lib-dynload");
++ joinpath(exec_prefix, "lib64/lib-dynload");
+ }
+ /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */
+
diff --git a/python-db45.patch b/python-db45.patch
new file mode 100644
index 0000000..61faed2
--- /dev/null
+++ b/python-db45.patch
@@ -0,0 +1,69 @@
+--- Python-2.5/setup.py.db45 2006-08-09 19:42:18.000000000 -0400
++++ Python-2.5/setup.py 2006-12-05 16:05:43.000000000 -0500
+@@ -606,7 +606,7 @@
+ # a release. Most open source OSes come with one or more
+ # versions of BerkeleyDB already installed.
+
+- max_db_ver = (4, 4)
++ max_db_ver = (4, 5)
+ min_db_ver = (3, 3)
+ db_setup_debug = False # verbose debug prints from this script?
+
+@@ -623,7 +623,7 @@
+ '/sw/include/db3',
+ ]
+ # 4.x minor number specific paths
+- for x in (0,1,2,3,4):
++ for x in (0,1,2,3,4,5):
+ db_inc_paths.append('/usr/include/db4%d' % x)
+ db_inc_paths.append('/usr/include/db4.%d' % x)
+ db_inc_paths.append('/usr/local/BerkeleyDB.4.%d/include' % x)
+--- Python-2.5/Modules/_bsddb.c.db45 2006-12-05 16:12:08.000000000 -0500
++++ Python-2.5/Modules/_bsddb.c 2006-12-05 16:15:44.000000000 -0500
+@@ -4129,6 +4129,7 @@
+ }
+
+
++#if (DBVER < 45)
+ static PyObject*
+ DBEnv_set_lk_max(DBEnvObject* self, PyObject* args)
+ {
+@@ -4144,7 +4145,7 @@
+ RETURN_IF_ERR();
+ RETURN_NONE();
+ }
+-
++#endif
+
+ #if (DBVER >= 32)
+
+@@ -5233,7 +5234,9 @@
+ {"set_lg_regionmax",(PyCFunction)DBEnv_set_lg_regionmax, METH_VARARGS},
+ #endif
+ {"set_lk_detect", (PyCFunction)DBEnv_set_lk_detect, METH_VARARGS},
++#if (DBVER <= 40)
+ {"set_lk_max", (PyCFunction)DBEnv_set_lk_max, METH_VARARGS},
++#endif
+ #if (DBVER >= 32)
+ {"set_lk_max_locks", (PyCFunction)DBEnv_set_lk_max_locks, METH_VARARGS},
+ {"set_lk_max_lockers", (PyCFunction)DBEnv_set_lk_max_lockers,
METH_VARARGS},
+@@ -5835,7 +5838,9 @@
+ ADD_INT(d, DB_AFTER);
+ ADD_INT(d, DB_APPEND);
+ ADD_INT(d, DB_BEFORE);
++#if (DBVER <= 40)
+ ADD_INT(d, DB_CACHED_COUNTS);
++#endif
+ #if (DBVER >= 41)
+ _addIntToDict(d, "DB_CHECKPOINT", 0);
+ #else
+@@ -5870,7 +5875,9 @@
+ ADD_INT(d, DB_POSITION);
+ ADD_INT(d, DB_PREV);
+ ADD_INT(d, DB_PREV_NODUP);
++#if (DBVER <= 40)
+ ADD_INT(d, DB_RECORDCOUNT);
++#endif
+ ADD_INT(d, DB_SET);
+ ADD_INT(d, DB_SET_RANGE);
+ ADD_INT(d, DB_SET_RECNO);
diff --git a/python.spec b/python.spec
index fc9bfef..6ab09e3 100644
--- a/python.spec
+++ b/python.spec
@@ -1,4 +1,5 @@
%{!?__python_ver:%define __python_ver EMPTY}
+#define __python_ver 25
%define unicode ucs4
%if "%{__python_ver}" != "EMPTY"
@@ -11,49 +12,39 @@
%define tkinter tkinter
%endif
-%define pybasever 2.4
-%define jp_codecs 1.4.11
+%define pybasever 2.5
%define tools_dir %{_libdir}/python%{pybasever}/Tools
%define demo_dir %{_libdir}/python%{pybasever}/Demo
%define doc_tools_dir %{_libdir}/python%{pybasever}/Doc/tools
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
-Version: %{pybasever}.4
-Release: 2%{?dist}
+#Version: %{pybasever}.3
+Version: 2.5
+Release: 0%{?dist}
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
Provides: python(abi) = %{pybasever}
-# optik is part of python 2.3 as optparse
-Provides: python-optik = 1.4.1
-Obsoletes: python-optik
Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
-Source5:
http://www.python.jp/pub/JapaneseCodecs/JapaneseCodecs-%{jp_codecs}.tar.gz
-Source6:
http://gigue.peabody.jhu.edu/~mdboom/omi/source/shm_source/shmmodule.c
-Source7: python-2.3.4-optik.py
-
-Patch0: python-2.4.3-config.patch
-Patch3: Python-2.2.1-pydocnogui.patch
-Patch7: python-2.3.4-lib64-regex.patch
-Patch8: python-2.4.4-lib64.patch
-Patch9: japanese-codecs-lib64.patch
-Patch13: python-2.4-distutils-bdist-rpm.patch
-Patch14: python-2.3.4-pydocnodoc.patch
-Patch15: python-2.4.1-canonicalize.patch
-Patch16: python-2.4-gen-assert.patch
-Patch17: python-2.4-webbrowser.patch
-Patch18: python-2.4.3-cflags.patch
-Patch19: python-2.4.3-locale.patch
+
+Patch0: python-2.5-config.patch
+Patch1: Python-2.2.1-pydocnogui.patch
+Patch2: python-2.5-distutils-bdist-rpm.patch
+Patch3: python-2.3.4-pydocnodoc.patch
+Patch4: python-2.4.1-canonicalize.patch
+Patch5: python-2.5-cflags.patch
+Patch6: python-db45.patch
+
+# lib64 patches
+Patch101: python-2.3.4-lib64-regex.patch
+Patch102: python-2.5-lib64.patch
%if %{main_python}
Obsoletes: Distutils
Provides: Distutils
Obsoletes: python2
Provides: python2 = %{version}
-BuildPrereq: db4-devel >= 4.3
-%else
-#BuildPrereq: db3-devel
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-root
@@ -61,8 +52,10 @@ BuildPrereq: readline-devel, libtermcap-devel, openssl-devel,
gmp-devel
BuildPrereq: ncurses-devel, gdbm-devel, zlib-devel, expat-devel
BuildPrereq: libGL-devel tk tix gcc-c++ libX11-devel glibc-devel
BuildPrereq: bzip2 tar /usr/bin/find pkgconfig tcl-devel tk-devel
-BuildPrereq: tix-devel bzip2-devel
+BuildPrereq: tix-devel bzip2-devel sqlite-devel
BuildPrereq: autoconf
+BuildPrereq: db4-devel >= 4.3
+
URL:
http://www.python.org/
%description
@@ -138,22 +131,21 @@ You should install the tkinter package if you'd like to use a
graphical
user interface for Python programming.
%prep
-%setup -q -n Python-%{version} -a 5
+%setup -q -n Python-%{version}
%patch0 -p1 -b .rhconfig
-%patch3 -p1 -b .no_gui
+%patch1 -p1 -b .no_gui
+%patch2 -p1 -b .bdist-rpm
+%patch3 -p1 -b .no-doc
+%patch4 -p1 -b .canonicalize
+%patch5 -p1 -b .cflags
+%patch6 -p1 -b .db45
+
%if %{_lib} == lib64
-%patch7 -p1 -b .lib64-regex
-%patch8 -p1 -b .lib64
-%patch9 -p0 -b .lib64-j
+%patch101 -p1 -b .lib64-regex
+%patch102 -p1 -b .lib64
%endif
-%patch13 -p1 -b .bdist-rpm
-%patch14 -p1 -b .no-doc
-%patch15 -p1 -b .canonicalize
-%patch16 -p2 -b .gen-assert
-%patch17 -p0 -b .web-browser
-%patch18 -p1 -b .cflags
-%patch19 -p2 -b .locale
+
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -162,17 +154,6 @@ find -name "*~" |xargs rm -f
# as executable files
chmod 0644 Lib/test/test_*.py
-# shm module
-cp %{SOURCE6} Modules
-cat >> Modules/Setup.dist << EOF
-
-# Shared memory module
-shm shmmodule.c
-EOF
-
-# Backwards compatible optik
-install -m 0644 %{SOURCE7} Lib/optik.py
-
%build
topdir=`pwd`
export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC"
@@ -185,13 +166,18 @@ if pkg-config openssl ; then
fi
# Force CC
export CC=gcc
-# For patch 15, need to get a newer configure generated out of configure.in
+# For patch 4, need to get a newer configure generated out of configure.in
autoconf
%configure --enable-ipv6 --enable-unicode=%{unicode} --enable-shared
make OPT="$CFLAGS" %{?_smp_mflags}
LD_LIBRARY_PATH=$topdir $topdir/python Tools/scripts/pathfix.py -i "%{_bindir}/env
python%{pybasever}" .
-make OPT="$CFLAGS" %{?_smp_mflags}
+# Rebuild with new python
+# We need a link to a versioned python in the build directory
+ln -s python python%{pybasever}
+LD_LIBRARY_PATH=$topdir PATH=$PATH:$topdir make -s OPT="$CFLAGS"
%{?_smp_mflags}
+
+
%install
[ -d $RPM_BUILD_ROOT ] && rm -fr $RPM_BUILD_ROOT
@@ -272,7 +258,7 @@ rm -f
$RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/site-packages/modulator/Templ
# Clean up the testsuite - we don't need compiled files for it
find $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/test \
-name "*.pyc" -o -name "*.pyo" | xargs rm -f
-rm -f $RPM_BUILD_ROOT%{_libdir}/python2.2/LICENSE.txt
+rm -f $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/LICENSE.txt
#make the binaries install side by side with the main python
@@ -288,14 +274,6 @@ mv pydoc pydoc%{__python_ver}
popd
%endif
-# Japanese codecs
-pushd JapaneseCodecs-%{jp_codecs}
-# We need to set LD_LIBRARY_PATH since python is now compiled as shared, and
-# we always want to use the currently compiled one
-LD_LIBRARY_PATH=$RPM_BUILD_ROOT%{_libdir} \
- ../python setup.py install --root=$RPM_BUILD_ROOT
-popd
-
find $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/lib-dynload -type d | sed
"s|$RPM_BUILD_ROOT|%dir |" > dynfiles
find $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/lib-dynload -type f | grep -v
"_tkinter.so$" | sed "s|$RPM_BUILD_ROOT||" >> dynfiles
@@ -333,6 +311,9 @@ EOF
# Fix for bug 201434: make sure distutils looks at the right pyconfig.h file
sed -i -e "s/'pyconfig.h'/'%{_pyconfig_h}'/"
$RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/distutils/sysconfig.py
+# Get rid of egg-info files (core python modules are installed through rpms)
+rm $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/*.egg-info
+
%clean
rm -fr $RPM_BUILD_ROOT
@@ -345,27 +326,26 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/libpython%{pybasever}.so*
%dir %{_libdir}/python%{pybasever}
-%{_libdir}/python%{pybasever}/site-packages/japanese.pth
%dir %{_libdir}/python%{pybasever}/site-packages
-%{_libdir}/python%{pybasever}/site-packages/japanese
%{_libdir}/python%{pybasever}/site-packages/README
-%{_libdir}/python%{pybasever}/LICENSE.txt
%{_libdir}/python%{pybasever}/*.py*
%{_libdir}/python%{pybasever}/*.doc
%{_libdir}/python%{pybasever}/bsddb
+%{_libdir}/python%{pybasever}/compiler
%dir %{_libdir}/python%{pybasever}/config
%{_libdir}/python%{pybasever}/config/Makefile
+%{_libdir}/python%{pybasever}/ctypes
%{_libdir}/python%{pybasever}/curses
%{_libdir}/python%{pybasever}/distutils
+%{_libdir}/python%{pybasever}/email
%{_libdir}/python%{pybasever}/encodings
+%{_libdir}/python%{pybasever}/hotshot
%{_libdir}/python%{pybasever}/idlelib
-%{_libdir}/python%{pybasever}/lib-old
%{_libdir}/python%{pybasever}/logging
-%{_libdir}/python%{pybasever}/xml
-%{_libdir}/python%{pybasever}/email
-%{_libdir}/python%{pybasever}/compiler
%{_libdir}/python%{pybasever}/plat-linux2
-%{_libdir}/python%{pybasever}/hotshot
+%{_libdir}/python%{pybasever}/sqlite3
+%{_libdir}/python%{pybasever}/wsgiref
+%{_libdir}/python%{pybasever}/xml
%if %{_lib} == lib64
%attr(0755,root,root) %dir /usr/lib/python%{pybasever}
%attr(0755,root,root) %dir /usr/lib/python%{pybasever}/site-packages
@@ -399,33 +379,31 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
-* Fri Nov 10 2006 Jeremy Katz <katzj(a)redhat.com> - 2.4.4-2
-- rebuild against new db
-
-* Mon Oct 23 2006 Jeremy Katz <katzj(a)redhat.com> - 2.4.4-1
-- update to 2.4.4
-
-* Sun Oct 01 2006 Jesse Keating <jkeating(a)redhat.com> - 2.4.3-18
-- rebuilt for unwind info generation, broken in gcc-4.1.1-21
+* Tue Dec 5 2006 Jeremy Katz <katzj(a)redhat.com>
+- support db 4.5
-* Tue Sep 26 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-17
-- Fixed bug #208166 / CVE-2006-4980: repr unicode buffer overflow
+* Mon Oct 30 2006 Jeremy Katz <katzj(a)redhat.com>
+- fix _md5 and _sha modules (Robert Sheck)
+- no longer provide optik compat; it's been a couple of years now
+- no longer provide the old shm module; if this is still needed, let's
+ build it separately
+- no longer provide japanese codecs; should be a separate package
-* Thu Aug 17 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-15
-- Fixed bug #201434 (distutils.sysconfig is confused by the change to make
- python-devel multilib friendly)
+* Mon Oct 23 2006 Jeremy Katz <katzj(a)redhat.com> - 2.5-0
+- update to 2.5.0 final
-* Fri Jul 21 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-14
-- Fixed bug #198971 (case conversion not locale safe in logging library)
-
-* Thu Jul 20 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-13
+* Fri Aug 18 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.99.c1
+- Updated to 2.5c1. Merged fixes from FC6 too:
- Fixed bug #199373 (on some platforms CFLAGS is needed when linking)
+- Fixed bug #198971 (case conversion not locale safe in logging library)
+- Verified bug #201434 (distutils.sysconfig is confused by the change to make
+ python-devel multilib friendly) is fixed upstream
-* Mon Jul 17 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-12
-- added dist tag back
+* Sun Jul 16 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.99.b2
+- Updated to 2.5b2 (which for comparison reasons is re-labeled 2.4.99.b2)
-* Wed Jul 12 2006 Jesse Keating <jkeating(a)redhat.com> - 2.4.3-11.FC6.1
-- rebuild
+* Fri Jun 23 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.99.b1
+- Updated to 2.5b1 (which for comparison reasons is re-labeled 2.4.99.b1)
* Tue Jun 13 2006 Jeremy Katz <katzj(a)redhat.com> - 2.4.3-11.FC6
- and fix it for real
diff --git a/sources b/sources
index 3bb92ff..99f6917 100644
--- a/sources
+++ b/sources
@@ -1,3 +1 @@
-e4f2ed866f4ce978fb54bb962eab4fdf JapaneseCodecs-1.4.11.tar.gz
-141c683447d5e76be1d2bd4829574f02 Python-2.4.3.tar.bz2
-0ba90c79175c017101100ebf5978e906 Python-2.4.4.tar.bz2
+ddb7401e711354ca83b7842b733825a3 Python-2.5.tar.bz2
commit d0fd1b0b3cd27a7357db143333cc628cce526c3a
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Fri Nov 10 19:35:09 2006 +0000
- rebuild against new db
diff --git a/python.spec b/python.spec
index be9266f..fc9bfef 100644
--- a/python.spec
+++ b/python.spec
@@ -20,7 +20,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.4
-Release: 1%{?dist}
+Release: 2%{?dist}
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -399,6 +399,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Fri Nov 10 2006 Jeremy Katz <katzj(a)redhat.com> - 2.4.4-2
+- rebuild against new db
+
* Mon Oct 23 2006 Jeremy Katz <katzj(a)redhat.com> - 2.4.4-1
- update to 2.4.4
commit 1a78970430fe42db971de9966ffc2daabeebfeb3
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Mon Oct 23 17:54:54 2006 +0000
- update to 2.4.4
diff --git a/.cvsignore b/.cvsignore
index 33e4ad5..df52b7f 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -2,3 +2,4 @@ Python-2.4.1.tar.bz2
JapaneseCodecs-1.4.11.tar.gz
Python-2.4.2.tar.bz2
Python-2.4.3.tar.bz2
+Python-2.4.4.tar.bz2
diff --git a/python.spec b/python.spec
index 6c9b707..be9266f 100644
--- a/python.spec
+++ b/python.spec
@@ -19,8 +19,8 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
-Version: %{pybasever}.3
-Release: 18%{?dist}
+Version: %{pybasever}.4
+Release: 1%{?dist}
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -36,7 +36,7 @@ Source7: python-2.3.4-optik.py
Patch0: python-2.4.3-config.patch
Patch3: Python-2.2.1-pydocnogui.patch
Patch7: python-2.3.4-lib64-regex.patch
-Patch8: python-2.4.1-lib64.patch
+Patch8: python-2.4.4-lib64.patch
Patch9: japanese-codecs-lib64.patch
Patch13: python-2.4-distutils-bdist-rpm.patch
Patch14: python-2.3.4-pydocnodoc.patch
@@ -45,7 +45,6 @@ Patch16: python-2.4-gen-assert.patch
Patch17: python-2.4-webbrowser.patch
Patch18: python-2.4.3-cflags.patch
Patch19: python-2.4.3-locale.patch
-Patch20: python-2.4.3-unicodeobject.patch
%if %{main_python}
Obsoletes: Distutils
@@ -155,7 +154,6 @@ user interface for Python programming.
%patch17 -p0 -b .web-browser
%patch18 -p1 -b .cflags
%patch19 -p2 -b .locale
-%patch20 -p3 -b .unicode-repr
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -401,6 +399,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Mon Oct 23 2006 Jeremy Katz <katzj(a)redhat.com> - 2.4.4-1
+- update to 2.4.4
+
* Sun Oct 01 2006 Jesse Keating <jkeating(a)redhat.com> - 2.4.3-18
- rebuilt for unwind info generation, broken in gcc-4.1.1-21
diff --git a/sources b/sources
index d23ae16..3bb92ff 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,3 @@
e4f2ed866f4ce978fb54bb962eab4fdf JapaneseCodecs-1.4.11.tar.gz
141c683447d5e76be1d2bd4829574f02 Python-2.4.3.tar.bz2
+0ba90c79175c017101100ebf5978e906 Python-2.4.4.tar.bz2
commit 043f5702eb22ad7b03bca5d6ab198c8b0efe446b
Author: Jesse Keating <jkeating(a)fedoraproject.org>
Date: Sun Oct 1 21:18:20 2006 +0000
bump for gcc bug
diff --git a/python.spec b/python.spec
index b4653c7..6c9b707 100644
--- a/python.spec
+++ b/python.spec
@@ -20,7 +20,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.3
-Release: 17%{?dist}
+Release: 18%{?dist}
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -401,6 +401,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Sun Oct 01 2006 Jesse Keating <jkeating(a)redhat.com> - 2.4.3-18
+- rebuilt for unwind info generation, broken in gcc-4.1.1-21
+
* Tue Sep 26 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-17
- Fixed bug #208166 / CVE-2006-4980: repr unicode buffer overflow
commit a74bf7b84336c327ad00f613bed336f78e78d6ff
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Tue Sep 26 20:37:04 2006 +0000
Fixing changelog message
diff --git a/python.spec b/python.spec
index 1ab85db..b4653c7 100644
--- a/python.spec
+++ b/python.spec
@@ -20,7 +20,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.3
-Release: 16%{?dist}
+Release: 17%{?dist}
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -401,7 +401,7 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
-* Tue Sep 26 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-8.1
+* Tue Sep 26 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-17
- Fixed bug #208166 / CVE-2006-4980: repr unicode buffer overflow
* Thu Aug 17 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-15
commit faf70c1fa20d7bf8d2de645a2126c4d00c3f47e5
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Tue Sep 26 20:05:56 2006 +0000
Fixed bug #208166 / CVE-2006-4980: repr unicode buffer overflow
diff --git a/python.spec b/python.spec
index 9f81c00..1ab85db 100644
--- a/python.spec
+++ b/python.spec
@@ -20,7 +20,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.3
-Release: 15%{?dist}
+Release: 16%{?dist}
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -45,6 +45,7 @@ Patch16: python-2.4-gen-assert.patch
Patch17: python-2.4-webbrowser.patch
Patch18: python-2.4.3-cflags.patch
Patch19: python-2.4.3-locale.patch
+Patch20: python-2.4.3-unicodeobject.patch
%if %{main_python}
Obsoletes: Distutils
@@ -154,6 +155,7 @@ user interface for Python programming.
%patch17 -p0 -b .web-browser
%patch18 -p1 -b .cflags
%patch19 -p2 -b .locale
+%patch20 -p3 -b .unicode-repr
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -399,6 +401,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Tue Sep 26 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-8.1
+- Fixed bug #208166 / CVE-2006-4980: repr unicode buffer overflow
+
* Thu Aug 17 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-15
- Fixed bug #201434 (distutils.sysconfig is confused by the change to make
python-devel multilib friendly)
commit 3af5a6059ac6e14e4344e135c1c03a9f656daa00
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Thu Aug 17 21:43:38 2006 +0000
Fixed bug #201434
diff --git a/python.spec b/python.spec
index ecda171..9f81c00 100644
--- a/python.spec
+++ b/python.spec
@@ -20,7 +20,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.3
-Release: 14%{?dist}
+Release: 15%{?dist}
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -330,6 +330,9 @@ cat > $RPM_BUILD_ROOT%{_includedir}/python%{pybasever}/pyconfig.h
<< EOF
#endif
EOF
+# Fix for bug 201434: make sure distutils looks at the right pyconfig.h file
+sed -i -e "s/'pyconfig.h'/'%{_pyconfig_h}'/"
$RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/distutils/sysconfig.py
+
%clean
rm -fr $RPM_BUILD_ROOT
@@ -396,6 +399,10 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Thu Aug 17 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-15
+- Fixed bug #201434 (distutils.sysconfig is confused by the change to make
+ python-devel multilib friendly)
+
* Fri Jul 21 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-14
- Fixed bug #198971 (case conversion not locale safe in logging library)
commit 6af7b357964a43ebaf1fa85411f6ccc3a7b2efb3
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Fri Jul 21 12:41:54 2006 +0000
Fixed bug #198971 (case conversion not locale safe in logging library)
diff --git a/python.spec b/python.spec
index 7421b3f..ecda171 100644
--- a/python.spec
+++ b/python.spec
@@ -20,7 +20,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.3
-Release: 13%{?dist}
+Release: 14%{?dist}
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -44,6 +44,7 @@ Patch15: python-2.4.1-canonicalize.patch
Patch16: python-2.4-gen-assert.patch
Patch17: python-2.4-webbrowser.patch
Patch18: python-2.4.3-cflags.patch
+Patch19: python-2.4.3-locale.patch
%if %{main_python}
Obsoletes: Distutils
@@ -152,6 +153,7 @@ user interface for Python programming.
%patch16 -p2 -b .gen-assert
%patch17 -p0 -b .web-browser
%patch18 -p1 -b .cflags
+%patch19 -p2 -b .locale
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -394,6 +396,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Fri Jul 21 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-14
+- Fixed bug #198971 (case conversion not locale safe in logging library)
+
* Thu Jul 20 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-13
- Fixed bug #199373 (on some platforms CFLAGS is needed when linking)
commit 4d8ff39217dd13b1b6c8370fa4b0a424227c3374
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Thu Jul 20 17:02:51 2006 +0000
Fixed bug #199373 (on some platforms CFLAGS is needed when linking)
diff --git a/python.spec b/python.spec
index 0766816..7421b3f 100644
--- a/python.spec
+++ b/python.spec
@@ -20,7 +20,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.3
-Release: 12%{?dist}
+Release: 13%{?dist}
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -43,6 +43,7 @@ Patch14: python-2.3.4-pydocnodoc.patch
Patch15: python-2.4.1-canonicalize.patch
Patch16: python-2.4-gen-assert.patch
Patch17: python-2.4-webbrowser.patch
+Patch18: python-2.4.3-cflags.patch
%if %{main_python}
Obsoletes: Distutils
@@ -150,6 +151,7 @@ user interface for Python programming.
%patch15 -p1 -b .canonicalize
%patch16 -p2 -b .gen-assert
%patch17 -p0 -b .web-browser
+%patch18 -p1 -b .cflags
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -392,6 +394,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Thu Jul 20 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-13
+- Fixed bug #199373 (on some platforms CFLAGS is needed when linking)
+
* Mon Jul 17 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-12
- added dist tag back
commit e9210a2ee09cd2dd7815bbab69c6833870b5fa41
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Mon Jul 17 13:14:06 2006 +0000
added dist tag back
diff --git a/python.spec b/python.spec
index 8e9b568..0766816 100644
--- a/python.spec
+++ b/python.spec
@@ -20,7 +20,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.3
-Release: 11.FC6.1
+Release: 12%{?dist}
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -392,6 +392,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Mon Jul 17 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-12
+- added dist tag back
+
* Wed Jul 12 2006 Jesse Keating <jkeating(a)redhat.com> - 2.4.3-11.FC6.1
- rebuild
commit bfb71df6712fdcf4ea5a326b7aefb0ca1d804324
Author: Jesse Keating <jkeating(a)fedoraproject.org>
Date: Wed Jul 12 07:56:21 2006 +0000
bumped for rebuild
diff --git a/python.spec b/python.spec
index 146ec5e..8e9b568 100644
--- a/python.spec
+++ b/python.spec
@@ -20,7 +20,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.3
-Release: 11.FC6
+Release: 11.FC6.1
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -392,6 +392,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Wed Jul 12 2006 Jesse Keating <jkeating(a)redhat.com> - 2.4.3-11.FC6.1
+- rebuild
+
* Tue Jun 13 2006 Jeremy Katz <katzj(a)redhat.com> - 2.4.3-11.FC6
- and fix it for real
commit 0d8e7a55cc3293fddd7ae3cd8ca0e371128ea637
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Tue Jun 13 18:18:32 2006 +0000
- and fix it for real
diff --git a/python.spec b/python.spec
index 4ad0540..146ec5e 100644
--- a/python.spec
+++ b/python.spec
@@ -20,7 +20,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.3
-Release: 10.FC6
+Release: 11.FC6
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -307,7 +307,7 @@ install -d $RPM_BUILD_ROOT/usr/lib/python%{pybasever}/site-packages
%define _pyconfig32_h pyconfig-32.h
%define _pyconfig64_h pyconfig-64.h
-%ifarch ppc64 s390x x86_64
+%ifarch ppc64 s390x x86_64 ia64
%define _pyconfig_h %{_pyconfig64_h}
%else
%define _pyconfig_h %{_pyconfig32_h}
@@ -392,6 +392,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Tue Jun 13 2006 Jeremy Katz <katzj(a)redhat.com> - 2.4.3-11.FC6
+- and fix it for real
+
* Tue Jun 13 2006 Jeremy Katz <katzj(a)redhat.com> - 2.4.3-10.FC6
- fix python-devel on ia64
commit 441dd7e8fbb3458da325fd921e92a77323e7c6c5
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Tue Jun 13 17:11:28 2006 +0000
- fix python-devel on ia64
diff --git a/python.spec b/python.spec
index 4d5d36b..4ad0540 100644
--- a/python.spec
+++ b/python.spec
@@ -20,7 +20,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.3
-Release: 9.FC6
+Release: 10.FC6
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -307,7 +307,7 @@ install -d $RPM_BUILD_ROOT/usr/lib/python%{pybasever}/site-packages
%define _pyconfig32_h pyconfig-32.h
%define _pyconfig64_h pyconfig-64.h
-%if %{_lib} == lib64
+%ifarch ppc64 s390x x86_64
%define _pyconfig_h %{_pyconfig64_h}
%else
%define _pyconfig_h %{_pyconfig32_h}
@@ -392,6 +392,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Tue Jun 13 2006 Jeremy Katz <katzj(a)redhat.com> - 2.4.3-10.FC6
+- fix python-devel on ia64
+
* Tue Jun 13 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-9
- Fixed python-devel to be multilib friendly (bug #192747, #139911)
commit 00d689b44ea2f0a369f6fed2bbe1c5eac1222f0a
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Tue Jun 13 14:34:38 2006 +0000
Fixing typo in pyconfig macros
diff --git a/python.spec b/python.spec
index 1ec0d78..4d5d36b 100644
--- a/python.spec
+++ b/python.spec
@@ -308,9 +308,9 @@ install -d $RPM_BUILD_ROOT/usr/lib/python%{pybasever}/site-packages
%define _pyconfig64_h pyconfig-64.h
%if %{_lib} == lib64
-%define _pyconfig_h %{_pyconfig64.h}
+%define _pyconfig_h %{_pyconfig64_h}
%else
-%define _pyconfig_h %{_pyconfig32.h}
+%define _pyconfig_h %{_pyconfig32_h}
%endif
mv $RPM_BUILD_ROOT%{_includedir}/python%{pybasever}/pyconfig.h \
$RPM_BUILD_ROOT%{_includedir}/python%{pybasever}/%{_pyconfig_h}
commit 80076c065e8d41d3d82ee8fac416eda97090ee27
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Tue Jun 13 14:26:43 2006 +0000
Stray SOURCE8 reference removed
diff --git a/python.spec b/python.spec
index f37739c..1ec0d78 100644
--- a/python.spec
+++ b/python.spec
@@ -303,9 +303,6 @@ rm -f
$RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/email/test/data/audiotest.au
install -d $RPM_BUILD_ROOT/usr/lib/python%{pybasever}/site-packages
%endif
-# Install pydoc wrapper (bug #193484)
-install -m 0755 %{SOURCE8} %{_bindir}/pydoc
-
# Make python-devel multilib-ready (bug #192747, #139911)
%define _pyconfig32_h pyconfig-32.h
%define _pyconfig64_h pyconfig-64.h
commit b50c49caac5169be0d28d2763996e29ff5e64220
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Tue Jun 13 14:18:36 2006 +0000
Fixing date for changelog entry
diff --git a/python.spec b/python.spec
index d4c0285..f37739c 100644
--- a/python.spec
+++ b/python.spec
@@ -395,7 +395,7 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
-* Mon Jun 12 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-9
+* Tue Jun 13 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-9
- Fixed python-devel to be multilib friendly (bug #192747, #139911)
* Tue Jun 13 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-8
commit f1d2531859367bcd48d694f5d42e6b5409a5ea2c
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Tue Jun 13 13:47:45 2006 +0000
Fixed python-devel to be multilib friendly (bug #192747, #139911)
diff --git a/python.spec b/python.spec
index efe7bdc..d4c0285 100644
--- a/python.spec
+++ b/python.spec
@@ -20,7 +20,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.3
-Release: 8.FC6
+Release: 9.FC6
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -303,6 +303,32 @@ rm -f
$RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/email/test/data/audiotest.au
install -d $RPM_BUILD_ROOT/usr/lib/python%{pybasever}/site-packages
%endif
+# Install pydoc wrapper (bug #193484)
+install -m 0755 %{SOURCE8} %{_bindir}/pydoc
+
+# Make python-devel multilib-ready (bug #192747, #139911)
+%define _pyconfig32_h pyconfig-32.h
+%define _pyconfig64_h pyconfig-64.h
+
+%if %{_lib} == lib64
+%define _pyconfig_h %{_pyconfig64.h}
+%else
+%define _pyconfig_h %{_pyconfig32.h}
+%endif
+mv $RPM_BUILD_ROOT%{_includedir}/python%{pybasever}/pyconfig.h \
+ $RPM_BUILD_ROOT%{_includedir}/python%{pybasever}/%{_pyconfig_h}
+cat > $RPM_BUILD_ROOT%{_includedir}/python%{pybasever}/pyconfig.h << EOF
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "%{_pyconfig32_h}"
+#elif __WORDSIZE == 64
+#include "%{_pyconfig64_h}"
+#else
+#error "Unkown word size"
+#endif
+EOF
+
%clean
rm -fr $RPM_BUILD_ROOT
@@ -369,6 +395,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Mon Jun 12 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-9
+- Fixed python-devel to be multilib friendly (bug #192747, #139911)
+
* Tue Jun 13 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-8
- Only copying mkhowto from the Docs - we don't need perl dependencies from
python-tools.
commit 88549951ff7881f6b1480cf84fc93bead5755930
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Tue Jun 13 12:14:02 2006 +0000
Only copying mkhowto from the Docs - we don't need perl dependencies from
python-tools.
diff --git a/python.spec b/python.spec
index 4d9c703..efe7bdc 100644
--- a/python.spec
+++ b/python.spec
@@ -15,11 +15,12 @@
%define jp_codecs 1.4.11
%define tools_dir %{_libdir}/python%{pybasever}/Tools
%define demo_dir %{_libdir}/python%{pybasever}/Demo
+%define doc_tools_dir %{_libdir}/python%{pybasever}/Doc/tools
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.3
-Release: 7.FC6
+Release: 8.FC6
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -249,8 +250,8 @@ install Tools/README $RPM_BUILD_ROOT%{tools_dir}/
install Tools/scripts/*py $RPM_BUILD_ROOT%{tools_dir}/scripts/
# Documentation tools
-%{__tar} cf - Doc/tools | \
- %{__tar} xf - -C $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}
+install -m755 -d $RPM_BUILD_ROOT%{doc_tools_dir}
+install -m755 Doc/tools/mkhowto $RPM_BUILD_ROOT%{doc_tools_dir}
# Useful demo scripts
install -m755 -d $RPM_BUILD_ROOT%{demo_dir}
@@ -368,6 +369,10 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Tue Jun 13 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-8
+- Only copying mkhowto from the Docs - we don't need perl dependencies from
+ python-tools.
+
* Mon Jun 12 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-7
- Fixed bug #121198 (webbrowser.py should use the user's preferences first)
commit 9599189c766b59830fafc9ceff59eb9b93664fd1
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Mon Jun 12 22:21:15 2006 +0000
Fixed bug #121198
diff --git a/python.spec b/python.spec
index 50756cd..4d9c703 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.3
-Release: 6.FC6
+Release: 7.FC6
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -41,6 +41,7 @@ Patch13: python-2.4-distutils-bdist-rpm.patch
Patch14: python-2.3.4-pydocnodoc.patch
Patch15: python-2.4.1-canonicalize.patch
Patch16: python-2.4-gen-assert.patch
+Patch17: python-2.4-webbrowser.patch
%if %{main_python}
Obsoletes: Distutils
@@ -147,6 +148,7 @@ user interface for Python programming.
%patch14 -p1 -b .no-doc
%patch15 -p1 -b .canonicalize
%patch16 -p2 -b .gen-assert
+%patch17 -p0 -b .web-browser
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -366,6 +368,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Mon Jun 12 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-7
+- Fixed bug #121198 (webbrowser.py should use the user's preferences first)
+
* Mon Jun 12 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-6
- Fixed bug #192592 (too aggressive assertion fails) - SF#1257960
- Fixed bug #167468 (Doc/tools not included) - added in the python-tools package
commit d6509bbe598cab6f371594ec996177297566def6
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Mon Jun 12 20:52:12 2006 +0000
pydoc was already part of the -tools package, moving into main python
package
diff --git a/python.spec b/python.spec
index 842e587..50756cd 100644
--- a/python.spec
+++ b/python.spec
@@ -31,7 +31,6 @@ Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
Source5:
http://www.python.jp/pub/JapaneseCodecs/JapaneseCodecs-%{jp_codecs}.tar.gz
Source6:
http://gigue.peabody.jhu.edu/~mdboom/omi/source/shm_source/shmmodule.c
Source7: python-2.3.4-optik.py
-Source8: pydoc
Patch0: python-2.4.3-config.patch
Patch3: Python-2.2.1-pydocnogui.patch
@@ -301,16 +300,13 @@ rm -f
$RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/email/test/data/audiotest.au
install -d $RPM_BUILD_ROOT/usr/lib/python%{pybasever}/site-packages
%endif
-# Install pydoc wrapper (bug #193484)
-install -m 0755 %{SOURCE8} %{_bindir}/pydoc
-
%clean
rm -fr $RPM_BUILD_ROOT
%files -f dynfiles
%defattr(-, root, root)
%doc LICENSE README
-%{_bindir}/pydoc
+%{_bindir}/pydoc*
%{_bindir}/python*
%{_mandir}/*/*
%{_libdir}/libpython%{pybasever}.so*
@@ -360,7 +356,6 @@ rm -fr $RPM_BUILD_ROOT
%{_bindir}/pynche*
%{_bindir}/pygettext*.py*
%{_bindir}/msgfmt*.py*
-%{_bindir}/pydoc*
%{tools_dir}
%{demo_dir}
%{_libdir}/python%{pybasever}/Doc
@@ -376,7 +371,7 @@ rm -fr $RPM_BUILD_ROOT
- Fixed bug #167468 (Doc/tools not included) - added in the python-tools package
* Thu Jun 8 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-5
-- Fixed bug #193484 (added pydoc)
+- Fixed bug #193484 (added pydoc in the main package)
* Mon Jun 5 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-4
- Added dist in the release
commit 1307d4fdc0b66b769b0ad6c200fa202937a5f3de
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Mon Jun 12 20:29:58 2006 +0000
Fixing stray %
diff --git a/python.spec b/python.spec
index d9f83ca..842e587 100644
--- a/python.spec
+++ b/python.spec
@@ -249,7 +249,7 @@ install Tools/scripts/*py $RPM_BUILD_ROOT%{tools_dir}/scripts/
# Documentation tools
%{__tar} cf - Doc/tools | \
- %{__tar} xf - -C %$RPM_BUILD_ROOT%{_libdir}/python%{pybasever}
+ %{__tar} xf - -C $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}
# Useful demo scripts
install -m755 -d $RPM_BUILD_ROOT%{demo_dir}
commit 44819ff56c9e26d13c69a8845d354400588ee708
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Mon Jun 12 19:36:01 2006 +0000
Fixed #192592 and #167468
diff --git a/python.spec b/python.spec
index e8be561..d9f83ca 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.3
-Release: 5.FC6
+Release: 6.FC6
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -41,6 +41,7 @@ Patch9: japanese-codecs-lib64.patch
Patch13: python-2.4-distutils-bdist-rpm.patch
Patch14: python-2.3.4-pydocnodoc.patch
Patch15: python-2.4.1-canonicalize.patch
+Patch16: python-2.4-gen-assert.patch
%if %{main_python}
Obsoletes: Distutils
@@ -146,6 +147,7 @@ user interface for Python programming.
%patch13 -p1 -b .bdist-rpm
%patch14 -p1 -b .no-doc
%patch15 -p1 -b .canonicalize
+%patch16 -p2 -b .gen-assert
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -245,6 +247,10 @@ install -m755 -d $RPM_BUILD_ROOT%{tools_dir}/scripts
install Tools/README $RPM_BUILD_ROOT%{tools_dir}/
install Tools/scripts/*py $RPM_BUILD_ROOT%{tools_dir}/scripts/
+# Documentation tools
+%{__tar} cf - Doc/tools | \
+ %{__tar} xf - -C %$RPM_BUILD_ROOT%{_libdir}/python%{pybasever}
+
# Useful demo scripts
install -m755 -d $RPM_BUILD_ROOT%{demo_dir}
cp -ar Demo/* $RPM_BUILD_ROOT%{demo_dir}
@@ -357,6 +363,7 @@ rm -fr $RPM_BUILD_ROOT
%{_bindir}/pydoc*
%{tools_dir}
%{demo_dir}
+%{_libdir}/python%{pybasever}/Doc
%files -n %{tkinter}
%defattr(-,root,root,755)
@@ -364,6 +371,10 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Mon Jun 12 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-6
+- Fixed bug #192592 (too aggressive assertion fails) - SF#1257960
+- Fixed bug #167468 (Doc/tools not included) - added in the python-tools package
+
* Thu Jun 8 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-5
- Fixed bug #193484 (added pydoc)
commit da026cdf7c03c50ad45e6d6a740cf5be5993deb4
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Thu Jun 8 13:58:50 2006 +0000
Fix for 193484
diff --git a/python.spec b/python.spec
index 9c5625b..e8be561 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.3
-Release: 4.FC6
+Release: 5.FC6
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -31,6 +31,7 @@ Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
Source5:
http://www.python.jp/pub/JapaneseCodecs/JapaneseCodecs-%{jp_codecs}.tar.gz
Source6:
http://gigue.peabody.jhu.edu/~mdboom/omi/source/shm_source/shmmodule.c
Source7: python-2.3.4-optik.py
+Source8: pydoc
Patch0: python-2.4.3-config.patch
Patch3: Python-2.2.1-pydocnogui.patch
@@ -294,12 +295,16 @@ rm -f
$RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/email/test/data/audiotest.au
install -d $RPM_BUILD_ROOT/usr/lib/python%{pybasever}/site-packages
%endif
+# Install pydoc wrapper (bug #193484)
+install -m 0755 %{SOURCE8} %{_bindir}/pydoc
+
%clean
rm -fr $RPM_BUILD_ROOT
%files -f dynfiles
%defattr(-, root, root)
%doc LICENSE README
+%{_bindir}/pydoc
%{_bindir}/python*
%{_mandir}/*/*
%{_libdir}/libpython%{pybasever}.so*
@@ -359,6 +364,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Thu Jun 8 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-5
+- Fixed bug #193484 (added pydoc)
+
* Mon Jun 5 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-4
- Added dist in the release
commit 6b2cb21de535d3e64447de2cb99cacf5f392a68f
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Mon Jun 5 14:48:14 2006 +0000
Dist doesn't seem to be enabled in core - manually setting it
diff --git a/python.spec b/python.spec
index 91d0d91..9c5625b 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.3
-Release: 4%{?dist}
+Release: 4.FC6
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
commit ce74b8833a95b4239ac2a27c934eb97e060ece07
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Mon Jun 5 14:40:00 2006 +0000
Added dist in the release field
diff --git a/python.spec b/python.spec
index 5fb80e7..91d0d91 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.3
-Release: 3
+Release: 4%{?dist}
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -359,6 +359,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Mon Jun 5 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-4
+- Added dist in the release
+
* Mon May 15 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-3
- rebuilt to fix broken libX11 dependency
commit 638997fae25dfed18b2281d154f10ce98ffcaa7c
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Mon May 15 13:49:52 2006 +0000
rebuilt to fix broken libX11 dependency
diff --git a/python.spec b/python.spec
index 0eec67e..5fb80e7 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.3
-Release: 2
+Release: 3
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -359,6 +359,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Mon May 15 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-3
+- rebuilt to fix broken libX11 dependency
+
* Wed Apr 12 2006 Jeremy Katz <katzj(a)redhat.com> - 2.4.3-2
- rebuild with new gcc to fix #188649
commit a0ec9b28f26bdf5f162d7236afc090cf4287c43b
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Wed Apr 12 16:47:40 2006 +0000
- rebuild with new gcc to fix #188649
diff --git a/python.spec b/python.spec
index 33210bd..0eec67e 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.3
-Release: 1
+Release: 2
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -359,6 +359,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Wed Apr 12 2006 Jeremy Katz <katzj(a)redhat.com> - 2.4.3-2
+- rebuild with new gcc to fix #188649
+
* Thu Apr 6 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-1
- Updated to 2.4.3
commit 84c6c7b51465c7e3222a2cc6333c0ecf769c4ff9
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Sat Apr 8 03:25:35 2006 +0000
Preparing for python 2.4.3
diff --git a/.cvsignore b/.cvsignore
index 4b37939..33e4ad5 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -1,3 +1,4 @@
Python-2.4.1.tar.bz2
JapaneseCodecs-1.4.11.tar.gz
Python-2.4.2.tar.bz2
+Python-2.4.3.tar.bz2
diff --git a/python.spec b/python.spec
index 2dddb0d..33210bd 100644
--- a/python.spec
+++ b/python.spec
@@ -18,8 +18,8 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
-Version: %{pybasever}.2
-Release: 3.2.1
+Version: %{pybasever}.3
+Release: 1
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -32,7 +32,7 @@ Source5:
http://www.python.jp/pub/JapaneseCodecs/JapaneseCodecs-%{jp_codecs}.tar
Source6:
http://gigue.peabody.jhu.edu/~mdboom/omi/source/shm_source/shmmodule.c
Source7: python-2.3.4-optik.py
-Patch0: python-2.4.1-config.patch
+Patch0: python-2.4.3-config.patch
Patch3: Python-2.2.1-pydocnogui.patch
Patch7: python-2.3.4-lib64-regex.patch
Patch8: python-2.4.1-lib64.patch
@@ -359,6 +359,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Thu Apr 6 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-1
+- Updated to 2.4.3
+
* Fri Feb 10 2006 Jesse Keating <jkeating(a)redhat.com> - 2.4.2-3.2.1
- bump again for double-long bug on ppc(64)
diff --git a/sources b/sources
index 2647463..d23ae16 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
e4f2ed866f4ce978fb54bb962eab4fdf JapaneseCodecs-1.4.11.tar.gz
-98db1465629693fc434d4dc52db93838 Python-2.4.2.tar.bz2
+141c683447d5e76be1d2bd4829574f02 Python-2.4.3.tar.bz2
commit 0a667e10e5a2849d7d5434444cb9c09d1b0c834c
Author: Jesse Keating <jkeating(a)fedoraproject.org>
Date: Sat Feb 11 05:23:02 2006 +0000
bump for bug in double-long on ppc(64)
diff --git a/python.spec b/python.spec
index c807d44..2dddb0d 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.2
-Release: 3.2
+Release: 3.2.1
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -359,6 +359,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Fri Feb 10 2006 Jesse Keating <jkeating(a)redhat.com> - 2.4.2-3.2.1
+- bump again for double-long bug on ppc(64)
+
* Fri Feb 10 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-3.2
- rebuilt for newer tix
commit 8f9fe484a1a119ddadf24d716f417b1b12734270
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Fri Feb 10 15:28:32 2006 +0000
Rebuilt for newer tix
diff --git a/python.spec b/python.spec
index 4d7e016..c807d44 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.2
-Release: 3.1
+Release: 3.2
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -359,6 +359,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Fri Feb 10 2006 Mihai Ibanescu <misa(a)redhat.com> - 2.4.3-3.2
+- rebuilt for newer tix
+
* Tue Feb 07 2006 Jesse Keating <jkeating(a)redhat.com> - 2.4.2-3.1
- rebuilt for new gcc4.1 snapshot and glibc changes
commit e34b638bd0dde3b6106bfeecfbc0971f6160ff01
Author: Jesse Keating <jkeating(a)fedoraproject.org>
Date: Tue Feb 7 13:39:46 2006 +0000
bump for new gcc/glibc
diff --git a/python.spec b/python.spec
index 177e6a0..4d7e016 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.2
-Release: 3
+Release: 3.1
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -359,6 +359,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Tue Feb 07 2006 Jesse Keating <jkeating(a)redhat.com> - 2.4.2-3.1
+- rebuilt for new gcc4.1 snapshot and glibc changes
+
* Fri Jan 20 2006 Mihai Ibanescu <misa(a)redhat.com> 2.4.2-3
- fixed #136654 for another instance of audiotest.au
commit a56567d9641b2b79e68ca979ca152783900a367d
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Tue Jan 24 20:42:27 2006 +0000
bugzilla: 136654 get rid of one more instance of audiotest.au
diff --git a/python.spec b/python.spec
index 28653a6..177e6a0 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.2
-Release: 2.1
+Release: 3
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -287,7 +287,7 @@ find $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/lib-dynload -type d
| sed "s|$
find $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/lib-dynload -type f | grep -v
"_tkinter.so$" | sed "s|$RPM_BUILD_ROOT||" >> dynfiles
# Fix for bug #136654
-rm -f $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/email/test/data/audiotest.au
+rm -f $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/email/test/data/audiotest.au
$RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/test/audiotest.au
# Fix bug #143667: python should own /usr/lib/python2.x on 64-bit machines
%if %{_lib} == lib64
@@ -359,6 +359,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Fri Jan 20 2006 Mihai Ibanescu <misa(a)redhat.com> 2.4.2-3
+- fixed #136654 for another instance of audiotest.au
+
* Fri Dec 09 2005 Jesse Keating <jkeating(a)redhat.com>
- rebuilt
commit c80caf618be48fe06f3e445c1d44307d69af57c9
Author: Jesse Keating <jkeating(a)fedoraproject.org>
Date: Fri Dec 9 22:42:52 2005 +0000
gcc update bump
diff --git a/python.spec b/python.spec
index 993660e..28653a6 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.2
-Release: 2
+Release: 2.1
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -359,6 +359,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Fri Dec 09 2005 Jesse Keating <jkeating(a)redhat.com>
+- rebuilt
+
* Sat Nov 19 2005 Bill Nottingham <notting(a)redhat.com> 2.4.2-2
- fix build for modular X, remove X11R6 path references
commit 773f492294b019809bc4d64f99d62864a957c07b
Author: Bill Nottingham <notting(a)fedoraproject.org>
Date: Sat Nov 19 05:24:27 2005 +0000
Remove references to obsolete X11R6 paths, fix build with modular X
diff --git a/python.spec b/python.spec
index 18054bb..993660e 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.2
-Release: 1
+Release: 2
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -54,7 +54,7 @@ BuildPrereq: db4-devel >= 4.3
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildPrereq: readline-devel, libtermcap-devel, openssl-devel, gmp-devel
BuildPrereq: ncurses-devel, gdbm-devel, zlib-devel, expat-devel
-BuildPrereq: Mesa-devel tk tix gcc-c++ xorg-x11-devel glibc-devel
+BuildPrereq: libGL-devel tk tix gcc-c++ libX11-devel glibc-devel
BuildPrereq: bzip2 tar /usr/bin/find pkgconfig tcl-devel tk-devel
BuildPrereq: tix-devel bzip2-devel
BuildPrereq: autoconf
@@ -359,6 +359,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Sat Nov 19 2005 Bill Nottingham <notting(a)redhat.com> 2.4.2-2
+- fix build for modular X, remove X11R6 path references
+
* Tue Nov 15 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.2-1
- Upgraded to 2.4.2
- BuildRequires autoconf
commit 5533529d7bd4151061b99476e6c8cb28d8015d94
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Tue Nov 15 22:23:43 2005 +0000
Building 2.4.2
diff --git a/.cvsignore b/.cvsignore
index a311fee..4b37939 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -1,2 +1,3 @@
Python-2.4.1.tar.bz2
JapaneseCodecs-1.4.11.tar.gz
+Python-2.4.2.tar.bz2
diff --git a/python.spec b/python.spec
index f42f4c8..18054bb 100644
--- a/python.spec
+++ b/python.spec
@@ -18,8 +18,8 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
-Version: %{pybasever}.1
-Release: 16
+Version: %{pybasever}.2
+Release: 1
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -57,6 +57,7 @@ BuildPrereq: ncurses-devel, gdbm-devel, zlib-devel, expat-devel
BuildPrereq: Mesa-devel tk tix gcc-c++ xorg-x11-devel glibc-devel
BuildPrereq: bzip2 tar /usr/bin/find pkgconfig tcl-devel tk-devel
BuildPrereq: tix-devel bzip2-devel
+BuildPrereq: autoconf
URL:
http://www.python.org/
%description
@@ -358,6 +359,10 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Tue Nov 15 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.2-1
+- Upgraded to 2.4.2
+- BuildRequires autoconf
+
* Wed Nov 9 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-16
- Rebuilding against newer openssl.
- XFree86-devel no longer exists
diff --git a/sources b/sources
index 80655f8..2647463 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-de3e9a8836fab6df7c7ce545331afeb3 Python-2.4.1.tar.bz2
e4f2ed866f4ce978fb54bb962eab4fdf JapaneseCodecs-1.4.11.tar.gz
+98db1465629693fc434d4dc52db93838 Python-2.4.2.tar.bz2
commit 2c41a494d949192277abeceadab22fdea81ea14a
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Wed Nov 9 16:15:39 2005 +0000
no XFree86-devel
diff --git a/python.spec b/python.spec
index 9b8a779..f42f4c8 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.1
-Release: 15
+Release: 16
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -54,7 +54,7 @@ BuildPrereq: db4-devel >= 4.3
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildPrereq: readline-devel, libtermcap-devel, openssl-devel, gmp-devel
BuildPrereq: ncurses-devel, gdbm-devel, zlib-devel, expat-devel
-BuildPrereq: Mesa-devel tk tix gcc-c++ XFree86-devel glibc-devel
+BuildPrereq: Mesa-devel tk tix gcc-c++ xorg-x11-devel glibc-devel
BuildPrereq: bzip2 tar /usr/bin/find pkgconfig tcl-devel tk-devel
BuildPrereq: tix-devel bzip2-devel
URL:
http://www.python.org/
@@ -358,8 +358,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
-* Wed Nov 9 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-15
+* Wed Nov 9 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-16
- Rebuilding against newer openssl.
+- XFree86-devel no longer exists
* Mon Sep 26 2005 Peter Jones <pjones(a)redhat.com> 2.4.1-14
- Once more -- this time, to fix -EPERM when you run it in a directory
commit 2ed6f798f98e8edf6409fa9482bf2846e686affb
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Wed Nov 9 16:06:39 2005 +0000
Rebuilding
diff --git a/python.spec b/python.spec
index ff9026d..9b8a779 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.1
-Release: 14
+Release: 15
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -358,6 +358,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Wed Nov 9 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-15
+- Rebuilding against newer openssl.
+
* Mon Sep 26 2005 Peter Jones <pjones(a)redhat.com> 2.4.1-14
- Once more -- this time, to fix -EPERM when you run it in a directory
you can't read from.
commit 91e37da552abe2959d5c9b816a4579897826ca89
Author: Peter Jones <pjones(a)fedoraproject.org>
Date: Thu Oct 6 18:59:54 2005 +0000
bump version, add changelog
diff --git a/python.spec b/python.spec
index 5abc844..ff9026d 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.1
-Release: 13
+Release: 14
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -358,6 +358,10 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Mon Sep 26 2005 Peter Jones <pjones(a)redhat.com> 2.4.1-14
+- Once more -- this time, to fix -EPERM when you run it in a directory
+ you can't read from.
+
* Mon Sep 26 2005 Peter Jones <pjones(a)redhat.com> 2.4.1-13
- So, 5 or 6 people have said it works for them with this patch...
commit fdbec0a2d85ebd325d8979c1bf47848a89b9d601
Author: Peter Jones <pjones(a)fedoraproject.org>
Date: Thu Oct 6 18:58:41 2005 +0000
return a duplicate of the input on _any_ error from
canonicalize_file_name()
diff --git a/python-2.4.1-canonicalize.patch b/python-2.4.1-canonicalize.patch
index e42fc0e..4127359 100644
--- a/python-2.4.1-canonicalize.patch
+++ b/python-2.4.1-canonicalize.patch
@@ -1,5 +1,5 @@
--- Python-2.4.1/pyconfig.h.in.canonicalize 2004-10-13 11:30:55.000000000 -0400
-+++ Python-2.4.1/pyconfig.h.in 2005-09-26 16:03:35.000000000 -0400
++++ Python-2.4.1/pyconfig.h.in 2005-10-06 14:04:06.000000000 -0400
@@ -58,6 +58,9 @@
/* Define if pthread_sigmask() does not work on your system. */
#undef HAVE_BROKEN_PTHREAD_SIGMASK
@@ -11,7 +11,7 @@
#undef HAVE_CHOWN
--- Python-2.4.1/Python/sysmodule.c.canonicalize 2005-01-27 13:58:30.000000000 -0500
-+++ Python-2.4.1/Python/sysmodule.c 2005-09-26 16:24:37.000000000 -0400
++++ Python-2.4.1/Python/sysmodule.c 2005-10-06 14:56:37.000000000 -0400
@@ -1168,11 +1168,13 @@
void
PySys_SetArgv(int argc, char **argv)
@@ -26,25 +26,22 @@
PyObject *av = makeargvobject(argc, argv);
PyObject *path = PySys_GetObject("path");
if (av == NULL)
-@@ -1184,6 +1186,67 @@
+@@ -1184,6 +1186,64 @@
char *p = NULL;
int n = 0;
PyObject *a;
+#ifdef HAVE_CANONICALIZE_FILE_NAME
+ char *link = NULL, *argv0copy = NULL;
-+ int errnum;
+
+ if (argc > 0 && argv0 != NULL) {
+
+ link = canonicalize_file_name(argv0);
-+ errnum = errno;
-+ if (link == NULL && errno == ENOENT) {
++ if (link == NULL) {
+ link = strdup(argv0);
+ if (!link)
+ Py_FatalError("no mem for sys.argv");
+ }
+ }
-+
+ if (link) {
+ if (link[0] == SEP) /* Link to absolute path */
+ argv0 = link;
@@ -94,7 +91,7 @@
#ifdef HAVE_READLINK
char link[MAXPATHLEN+1];
char argv0copy[2*MAXPATHLEN+1];
-@@ -1256,9 +1319,14 @@
+@@ -1256,9 +1316,14 @@
#endif /* Unix */
}
#endif /* All others */
@@ -103,14 +100,14 @@
if (a == NULL)
Py_FatalError("no mem for sys.path insertion");
+#ifdef HAVE_CANONICALIZE_FILE_NAME
-+ if (argv0)
++ if (argc > 0 && argv0 != NULL)
+ free(argv0);
+#endif /* HAVE_CANONICALIZE_FILE_NAME */
if (PyList_Insert(path, 0, a) < 0)
Py_FatalError("sys.path.insert(0) failed");
Py_DECREF(a);
--- Python-2.4.1/configure.in.canonicalize 2005-03-28 18:23:34.000000000 -0500
-+++ Python-2.4.1/configure.in 2005-09-26 16:03:35.000000000 -0400
++++ Python-2.4.1/configure.in 2005-10-06 14:04:06.000000000 -0400
@@ -2096,8 +2096,8 @@
AC_MSG_RESULT(MACHDEP_OBJS)
commit d81580bfcd2a6b6e0cdf0b721ec55d8db532af6a
Author: Peter Jones <pjones(a)fedoraproject.org>
Date: Mon Sep 26 22:20:29 2005 +0000
update release add changelog
diff --git a/python.spec b/python.spec
index 3a3581f..5abc844 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.1
-Release: 12
+Release: 13
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -358,6 +358,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Mon Sep 26 2005 Peter Jones <pjones(a)redhat.com> 2.4.1-13
+- So, 5 or 6 people have said it works for them with this patch...
+
* Sun Sep 25 2005 Peter Jones <pjones(a)redhat.com> 2.4.1-12
- Fixed bug #169159 (check for argc>0 and argv[0] == NULL, not just
argv[0][0]='\0')
commit 6f931e79966625e04c70e3be2aa7eb84b0864a88
Author: Peter Jones <pjones(a)fedoraproject.org>
Date: Mon Sep 26 22:19:21 2005 +0000
once more into the breach...
diff --git a/python-2.4.1-canonicalize.patch b/python-2.4.1-canonicalize.patch
index bdc631e..e42fc0e 100644
--- a/python-2.4.1-canonicalize.patch
+++ b/python-2.4.1-canonicalize.patch
@@ -1,5 +1,5 @@
--- Python-2.4.1/pyconfig.h.in.canonicalize 2004-10-13 11:30:55.000000000 -0400
-+++ Python-2.4.1/pyconfig.h.in 2005-09-25 16:30:43.000000000 -0400
++++ Python-2.4.1/pyconfig.h.in 2005-09-26 16:03:35.000000000 -0400
@@ -58,6 +58,9 @@
/* Define if pthread_sigmask() does not work on your system. */
#undef HAVE_BROKEN_PTHREAD_SIGMASK
@@ -11,7 +11,7 @@
#undef HAVE_CHOWN
--- Python-2.4.1/Python/sysmodule.c.canonicalize 2005-01-27 13:58:30.000000000 -0500
-+++ Python-2.4.1/Python/sysmodule.c 2005-09-25 16:38:47.000000000 -0400
++++ Python-2.4.1/Python/sysmodule.c 2005-09-26 16:24:37.000000000 -0400
@@ -1168,11 +1168,13 @@
void
PySys_SetArgv(int argc, char **argv)
@@ -26,41 +26,75 @@
PyObject *av = makeargvobject(argc, argv);
PyObject *path = PySys_GetObject("path");
if (av == NULL)
-@@ -1184,6 +1186,33 @@
+@@ -1184,6 +1186,67 @@
char *p = NULL;
int n = 0;
PyObject *a;
+#ifdef HAVE_CANONICALIZE_FILE_NAME
++ char *link = NULL, *argv0copy = NULL;
+ int errnum;
+
+ if (argc > 0 && argv0 != NULL) {
-+ if (argv[0][0] == '\0')
-+ /* python started with no arguments
-+ copy the empty string and move on */
-+ argv0 = strdup(argv[0]);
-+ else {
-+ argv0 = canonicalize_file_name(argv[0]);
-+ errnum = errno;
-+ if (argv0 == NULL) {
-+ if (errnum != ENOENT)
-+ Py_FatalError(strerror(errnum));
++
++ link = canonicalize_file_name(argv0);
++ errnum = errno;
++ if (link == NULL && errno == ENOENT) {
++ link = strdup(argv0);
++ if (!link)
++ Py_FatalError("no mem for sys.argv");
++ }
++ }
+
-+ /* errno == ENOENT; the input file name is
-+ empty, or at least one of the path
-+ components does not exist */
-+ /* strdup because we're going to free() it
-+ later no matter what */
-+ argv0 = strdup(argv[0]);
++ if (link) {
++ if (link[0] == SEP) /* Link to absolute path */
++ argv0 = link;
++ else if (strchr(link, SEP) == NULL) {
++ /* Link without path */
++ /* strdup argv0 so we can free it
++ unconditionally */
++ argv0 = strdup(argv0);
++ if (!argv0)
++ Py_FatalError("no mem for sys.argv");
++ free(link);
++ } else {
++ /* Must join(dirname(argv0), link) */
++ char *q = strrchr(argv0, SEP);
++ if (q == NULL) /* argv0 without path */
++ argv0 = link;
++ else {
++ /* Must make a copy */
++ argv0copy = calloc(
++ strlen(link) + strlen(q) +1,
++ sizeof (char));
++ if (!argv0copy)
++ Py_FatalError("no mem for sys.argv");
++ strcpy(argv0copy, argv0);
++ q = strrchr(argv0copy, SEP);
++ strcpy(argv0copy+1, link);
++ argv0 = argv0copy;
++ p = NULL;
++ free(link);
+ }
+ }
-+ if (argv0 == NULL)
-+ Py_FatalError("no mem for sys.argv");
++ }
++ if (argc > 0 && argv0 != NULL) {
++ char *q;
++ p = strrchr(argv0, SEP);
++ /* Test for alternate separator */
++ q = strrchr(p ? p : argv0, '/');
++ if (q != NULL)
++ p = q;
++ if (p != NULL) {
++ n = p + 1 - argv0;
++ if (n > 1 && p[-1] != ':')
++ n--; /* Drop trailing separator */
++ }
+ }
+#else /* ! HAVE_CANONICALIZE_FILE_NAME */
#ifdef HAVE_READLINK
char link[MAXPATHLEN+1];
char argv0copy[2*MAXPATHLEN+1];
-@@ -1256,9 +1285,14 @@
+@@ -1256,9 +1319,14 @@
#endif /* Unix */
}
#endif /* All others */
@@ -76,7 +110,7 @@
Py_FatalError("sys.path.insert(0) failed");
Py_DECREF(a);
--- Python-2.4.1/configure.in.canonicalize 2005-03-28 18:23:34.000000000 -0500
-+++ Python-2.4.1/configure.in 2005-09-25 16:30:43.000000000 -0400
++++ Python-2.4.1/configure.in 2005-09-26 16:03:35.000000000 -0400
@@ -2096,8 +2096,8 @@
AC_MSG_RESULT(MACHDEP_OBJS)
commit db45b4b464d6639ad022e40ece53afce7cbfea7a
Author: Peter Jones <pjones(a)fedoraproject.org>
Date: Mon Sep 26 15:16:06 2005 +0000
s390 is back, so bumping the release and rebuilding (also moving the
changelog to reflect -12, since -11 will never be released)
diff --git a/python.spec b/python.spec
index c8b535f..3a3581f 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.1
-Release: 11
+Release: 12
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -358,7 +358,7 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
-* Sun Sep 25 2005 Peter Jones <pjones(a)redhat.com> 2.4.1-11
+* Sun Sep 25 2005 Peter Jones <pjones(a)redhat.com> 2.4.1-12
- Fixed bug #169159 (check for argc>0 and argv[0] == NULL, not just
argv[0][0]='\0')
Reworked the patch from -8 a bit more.
commit a1e09b039f13740d7281e1bb4efe4fa8dd25b4cb
Author: Peter Jones <pjones(a)fedoraproject.org>
Date: Mon Sep 26 13:46:52 2005 +0000
reverting the s390 exclusion
diff --git a/python.spec b/python.spec
index 24261d2..c8b535f 100644
--- a/python.spec
+++ b/python.spec
@@ -24,7 +24,6 @@ License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
Provides: python(abi) = %{pybasever}
-ExcludeArch: s390 s390x
# optik is part of python 2.3 as optparse
Provides: python-optik = 1.4.1
Obsoletes: python-optik
commit eab66f504d3dca1186b6a44046950cb47e9a1ed4
Author: Peter Jones <pjones(a)fedoraproject.org>
Date: Mon Sep 26 13:45:45 2005 +0000
tired of waiting for people to be around who can unwedge builders will
revert immediately...
diff --git a/python.spec b/python.spec
index c8b535f..24261d2 100644
--- a/python.spec
+++ b/python.spec
@@ -24,6 +24,7 @@ License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
Provides: python(abi) = %{pybasever}
+ExcludeArch: s390 s390x
# optik is part of python 2.3 as optparse
Provides: python-optik = 1.4.1
Obsoletes: python-optik
commit 780b6f017c1a5205ec7fdc5e5ed390a731adf3b0
Author: Peter Jones <pjones(a)fedoraproject.org>
Date: Sun Sep 25 20:55:14 2005 +0000
patch mentioned in the changelog...
diff --git a/python-2.4.1-canonicalize.patch b/python-2.4.1-canonicalize.patch
index facaa2d..bdc631e 100644
--- a/python-2.4.1-canonicalize.patch
+++ b/python-2.4.1-canonicalize.patch
@@ -1,5 +1,17 @@
+--- Python-2.4.1/pyconfig.h.in.canonicalize 2004-10-13 11:30:55.000000000 -0400
++++ Python-2.4.1/pyconfig.h.in 2005-09-25 16:30:43.000000000 -0400
+@@ -58,6 +58,9 @@
+ /* Define if pthread_sigmask() does not work on your system. */
+ #undef HAVE_BROKEN_PTHREAD_SIGMASK
+
++/* Define to 1 if you have the `canonicalize_file_name' function. */
++#undef HAVE_CANONICALIZE_FILE_NAME
++
+ /* Define to 1 if you have the `chown' function. */
+ #undef HAVE_CHOWN
+
--- Python-2.4.1/Python/sysmodule.c.canonicalize 2005-01-27 13:58:30.000000000 -0500
-+++ Python-2.4.1/Python/sysmodule.c 2005-09-23 17:18:33.000000000 -0400
++++ Python-2.4.1/Python/sysmodule.c 2005-09-25 16:38:47.000000000 -0400
@@ -1168,11 +1168,13 @@
void
PySys_SetArgv(int argc, char **argv)
@@ -14,39 +26,41 @@
PyObject *av = makeargvobject(argc, argv);
PyObject *path = PySys_GetObject("path");
if (av == NULL)
-@@ -1184,6 +1186,31 @@
+@@ -1184,6 +1186,33 @@
char *p = NULL;
int n = 0;
PyObject *a;
+#ifdef HAVE_CANONICALIZE_FILE_NAME
+ int errnum;
+
-+ if (argv[0][0] == '\0')
-+ /* python started with no arguments
-+ copy the empty string and move on */
-+ argv0 = strdup(argv[0]);
-+ else {
-+ argv0 = canonicalize_file_name(argv[0]);
-+ errnum = errno;
-+ if (argv0 == NULL) {
-+ if (errnum != ENOENT)
-+ Py_FatalError(strerror(errnum));
++ if (argc > 0 && argv0 != NULL) {
++ if (argv[0][0] == '\0')
++ /* python started with no arguments
++ copy the empty string and move on */
++ argv0 = strdup(argv[0]);
++ else {
++ argv0 = canonicalize_file_name(argv[0]);
++ errnum = errno;
++ if (argv0 == NULL) {
++ if (errnum != ENOENT)
++ Py_FatalError(strerror(errnum));
+
-+ /* errnum == ENOENT; the input file name is empty, or
-+ * at least one of the path components does not exist
-+ * */
-+ /* strdup because we're going to free() it
-+ later no matter what */
-+ argv0 = strdup(argv[0]);
-+ if (argv0 == NULL)
-+ Py_FatalError("no mem for sys.argv");
-+ }
-+ }
++ /* errno == ENOENT; the input file name is
++ empty, or at least one of the path
++ components does not exist */
++ /* strdup because we're going to free() it
++ later no matter what */
++ argv0 = strdup(argv[0]);
++ }
++ }
++ if (argv0 == NULL)
++ Py_FatalError("no mem for sys.argv");
++ }
+#else /* ! HAVE_CANONICALIZE_FILE_NAME */
#ifdef HAVE_READLINK
char link[MAXPATHLEN+1];
char argv0copy[2*MAXPATHLEN+1];
-@@ -1256,9 +1283,13 @@
+@@ -1256,9 +1285,14 @@
#endif /* Unix */
}
#endif /* All others */
@@ -55,13 +69,14 @@
if (a == NULL)
Py_FatalError("no mem for sys.path insertion");
+#ifdef HAVE_CANONICALIZE_FILE_NAME
-+ free(argv0);
++ if (argv0)
++ free(argv0);
+#endif /* HAVE_CANONICALIZE_FILE_NAME */
if (PyList_Insert(path, 0, a) < 0)
Py_FatalError("sys.path.insert(0) failed");
Py_DECREF(a);
--- Python-2.4.1/configure.in.canonicalize 2005-03-28 18:23:34.000000000 -0500
-+++ Python-2.4.1/configure.in 2005-09-23 17:19:14.000000000 -0400
++++ Python-2.4.1/configure.in 2005-09-25 16:30:43.000000000 -0400
@@ -2096,8 +2096,8 @@
AC_MSG_RESULT(MACHDEP_OBJS)
@@ -73,15 +88,3 @@
gai_strerror getgroups getlogin getloadavg getpeername getpgid getpid \
getpriority getpwent getsid getwd \
kill killpg lchown lstat mkfifo mknod mktime \
---- Python-2.4.1/pyconfig.h.in.canonicalize 2004-10-13 11:30:55.000000000 -0400
-+++ Python-2.4.1/pyconfig.h.in 2005-09-23 17:19:14.000000000 -0400
-@@ -58,6 +58,9 @@
- /* Define if pthread_sigmask() does not work on your system. */
- #undef HAVE_BROKEN_PTHREAD_SIGMASK
-
-+/* Define to 1 if you have the `canonicalize_file_name' function. */
-+#undef HAVE_CANONICALIZE_FILE_NAME
-+
- /* Define to 1 if you have the `chown' function. */
- #undef HAVE_CHOWN
-
commit c2cc4f3abd87194c4059b3e9352e5c725c1a4e1d
Author: Peter Jones <pjones(a)fedoraproject.org>
Date: Sun Sep 25 20:54:34 2005 +0000
yet another fix for the fact that python will try to resolve and everything
as a symlink to set as sys.argv[0]. Really, just plain wow.
diff --git a/python.spec b/python.spec
index 8c6e56f..c8b535f 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.1
-Release: 10
+Release: 11
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -358,6 +358,11 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Sun Sep 25 2005 Peter Jones <pjones(a)redhat.com> 2.4.1-11
+- Fixed bug #169159 (check for argc>0 and argv[0] == NULL, not just
+ argv[0][0]='\0')
+ Reworked the patch from -8 a bit more.
+
* Fri Sep 23 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-10
- Fixed bug #169159 (don't let python core dump if no arguments are passed in)
Reworked the patch from -8 a bit more.
commit 7a9c92b4bb3d4680145755f0fd16eb1cb7a4527b
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Fri Sep 23 21:21:07 2005 +0000
One more time, with feeling
diff --git a/python-2.4.1-canonicalize.patch b/python-2.4.1-canonicalize.patch
index b1f8928..facaa2d 100644
--- a/python-2.4.1-canonicalize.patch
+++ b/python-2.4.1-canonicalize.patch
@@ -1,5 +1,5 @@
--- Python-2.4.1/Python/sysmodule.c.canonicalize 2005-01-27 13:58:30.000000000 -0500
-+++ Python-2.4.1/Python/sysmodule.c 2005-09-23 10:48:14.000000000 -0400
++++ Python-2.4.1/Python/sysmodule.c 2005-09-23 17:18:33.000000000 -0400
@@ -1168,11 +1168,13 @@
void
PySys_SetArgv(int argc, char **argv)
@@ -14,33 +14,39 @@
PyObject *av = makeargvobject(argc, argv);
PyObject *path = PySys_GetObject("path");
if (av == NULL)
-@@ -1184,6 +1186,25 @@
+@@ -1184,6 +1186,31 @@
char *p = NULL;
int n = 0;
PyObject *a;
+#ifdef HAVE_CANONICALIZE_FILE_NAME
+ int errnum;
+
-+ argv0 = canonicalize_file_name(argv[0]);
-+ errnum = errno;
-+ if (argv0 == NULL) {
-+ if (errnum != ENOENT)
-+ Py_FatalError(strerror(errnum));
++ if (argv[0][0] == '\0')
++ /* python started with no arguments
++ copy the empty string and move on */
++ argv0 = strdup(argv[0]);
++ else {
++ argv0 = canonicalize_file_name(argv[0]);
++ errnum = errno;
++ if (argv0 == NULL) {
++ if (errnum != ENOENT)
++ Py_FatalError(strerror(errnum));
+
-+ /* errnum == ENOENT; the input file name is empty, or
-+ * at least one of the path components does not exist
-+ * */
-+ /* strdup because we're going to free() it
-+ later no matter what */
-+ argv0 = strdup(argv[0]);
-+ if (argv0 == NULL)
-+ Py_FatalError("no mem for sys.argv");
-+ }
++ /* errnum == ENOENT; the input file name is empty, or
++ * at least one of the path components does not exist
++ * */
++ /* strdup because we're going to free() it
++ later no matter what */
++ argv0 = strdup(argv[0]);
++ if (argv0 == NULL)
++ Py_FatalError("no mem for sys.argv");
++ }
++ }
+#else /* ! HAVE_CANONICALIZE_FILE_NAME */
#ifdef HAVE_READLINK
char link[MAXPATHLEN+1];
char argv0copy[2*MAXPATHLEN+1];
-@@ -1256,9 +1277,13 @@
+@@ -1256,9 +1283,13 @@
#endif /* Unix */
}
#endif /* All others */
@@ -55,7 +61,7 @@
Py_FatalError("sys.path.insert(0) failed");
Py_DECREF(a);
--- Python-2.4.1/configure.in.canonicalize 2005-03-28 18:23:34.000000000 -0500
-+++ Python-2.4.1/configure.in 2005-09-23 10:37:30.000000000 -0400
++++ Python-2.4.1/configure.in 2005-09-23 17:19:14.000000000 -0400
@@ -2096,8 +2096,8 @@
AC_MSG_RESULT(MACHDEP_OBJS)
@@ -68,7 +74,7 @@
getpriority getpwent getsid getwd \
kill killpg lchown lstat mkfifo mknod mktime \
--- Python-2.4.1/pyconfig.h.in.canonicalize 2004-10-13 11:30:55.000000000 -0400
-+++ Python-2.4.1/pyconfig.h.in 2005-09-23 10:37:30.000000000 -0400
++++ Python-2.4.1/pyconfig.h.in 2005-09-23 17:19:14.000000000 -0400
@@ -58,6 +58,9 @@
/* Define if pthread_sigmask() does not work on your system. */
#undef HAVE_BROKEN_PTHREAD_SIGMASK
diff --git a/python.spec b/python.spec
index 54fdad3..8c6e56f 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.1
-Release: 9
+Release: 10
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -358,7 +358,7 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
-* Fri Sep 23 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-9
+* Fri Sep 23 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-10
- Fixed bug #169159 (don't let python core dump if no arguments are passed in)
Reworked the patch from -8 a bit more.
commit a101798a461f930c254927b7764810b6ac8826c8
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Fri Sep 23 20:12:16 2005 +0000
Don't let python die if no args are passed in
diff --git a/python-2.4.1-canonicalize.patch b/python-2.4.1-canonicalize.patch
index fdc9858..b1f8928 100644
--- a/python-2.4.1-canonicalize.patch
+++ b/python-2.4.1-canonicalize.patch
@@ -1,17 +1,5 @@
---- Python-2.4.1/pyconfig.h.in.canonicalize 2005-09-14 11:47:04.000000000 -0400
-+++ Python-2.4.1/pyconfig.h.in 2005-09-14 11:47:02.000000000 -0400
-@@ -58,6 +58,9 @@
- /* Define if pthread_sigmask() does not work on your system. */
- #undef HAVE_BROKEN_PTHREAD_SIGMASK
-
-+/* Define to 1 if you have the `canonicalize_file_name' function. */
-+#undef HAVE_CANONICALIZE_FILE_NAME
-+
- /* Define to 1 if you have the `chown' function. */
- #undef HAVE_CHOWN
-
---- Python-2.4.1/Python/sysmodule.c.canonicalize 2005-09-14 11:53:30.000000000 -0400
-+++ Python-2.4.1/Python/sysmodule.c 2005-09-14 11:53:30.000000000 -0400
+--- Python-2.4.1/Python/sysmodule.c.canonicalize 2005-01-27 13:58:30.000000000 -0500
++++ Python-2.4.1/Python/sysmodule.c 2005-09-23 10:48:14.000000000 -0400
@@ -1168,11 +1168,13 @@
void
PySys_SetArgv(int argc, char **argv)
@@ -26,32 +14,32 @@
PyObject *av = makeargvobject(argc, argv);
PyObject *path = PySys_GetObject("path");
if (av == NULL)
-@@ -1180,6 +1182,25 @@
- if (PySys_SetObject("argv", av) != 0)
- Py_FatalError("can't assign sys.argv");
- if (path != NULL) {
+@@ -1184,6 +1186,25 @@
+ char *p = NULL;
+ int n = 0;
+ PyObject *a;
+#ifdef HAVE_CANONICALIZE_FILE_NAME
-+ char *argv0;
-+ int n = 0;
+ int errnum;
-+ PyObject *a;
-+
++
+ argv0 = canonicalize_file_name(argv[0]);
+ errnum = errno;
+ if (argv0 == NULL) {
-+ if (errno == ENOENT)
-+ /* strdup because we're going to free() it
-+ later no matter what */
-+ argv0 = strdup(argv[0]);
-+ else
++ if (errnum != ENOENT)
+ Py_FatalError(strerror(errnum));
-+ if (!argv0)
++
++ /* errnum == ENOENT; the input file name is empty, or
++ * at least one of the path components does not exist
++ * */
++ /* strdup because we're going to free() it
++ later no matter what */
++ argv0 = strdup(argv[0]);
++ if (argv0 == NULL)
+ Py_FatalError("no mem for sys.argv");
+ }
+#else /* ! HAVE_CANONICALIZE_FILE_NAME */
- char *argv0 = argv[0];
- char *p = NULL;
- int n = 0;
+ #ifdef HAVE_READLINK
+ char link[MAXPATHLEN+1];
+ char argv0copy[2*MAXPATHLEN+1];
@@ -1256,9 +1277,13 @@
#endif /* Unix */
}
@@ -66,8 +54,8 @@
if (PyList_Insert(path, 0, a) < 0)
Py_FatalError("sys.path.insert(0) failed");
Py_DECREF(a);
---- Python-2.4.1/configure.in.canonicalize 2005-09-14 11:46:00.000000000 -0400
-+++ Python-2.4.1/configure.in 2005-09-14 11:47:22.000000000 -0400
+--- Python-2.4.1/configure.in.canonicalize 2005-03-28 18:23:34.000000000 -0500
++++ Python-2.4.1/configure.in 2005-09-23 10:37:30.000000000 -0400
@@ -2096,8 +2096,8 @@
AC_MSG_RESULT(MACHDEP_OBJS)
@@ -79,3 +67,15 @@
gai_strerror getgroups getlogin getloadavg getpeername getpgid getpid \
getpriority getpwent getsid getwd \
kill killpg lchown lstat mkfifo mknod mktime \
+--- Python-2.4.1/pyconfig.h.in.canonicalize 2004-10-13 11:30:55.000000000 -0400
++++ Python-2.4.1/pyconfig.h.in 2005-09-23 10:37:30.000000000 -0400
+@@ -58,6 +58,9 @@
+ /* Define if pthread_sigmask() does not work on your system. */
+ #undef HAVE_BROKEN_PTHREAD_SIGMASK
+
++/* Define to 1 if you have the `canonicalize_file_name' function. */
++#undef HAVE_CANONICALIZE_FILE_NAME
++
+ /* Define to 1 if you have the `chown' function. */
+ #undef HAVE_CHOWN
+
diff --git a/python.spec b/python.spec
index c514066..54fdad3 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.1
-Release: 8
+Release: 9
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -358,6 +358,10 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Fri Sep 23 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-9
+- Fixed bug #169159 (don't let python core dump if no arguments are passed in)
+ Reworked the patch from -8 a bit more.
+
* Thu Sep 22 2005 Peter Jones <pjones(a)redhat.com> 2.4.1-8
- Fix bug #169046 more correctly.
commit bcb2ee813478dfbcb44f08ea09ed49bd6d089e85
Author: Peter Jones <pjones(a)fedoraproject.org>
Date: Thu Sep 22 22:37:00 2005 +0000
bump release and changelog
diff --git a/python.spec b/python.spec
index d455571..c514066 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.1
-Release: 7
+Release: 8
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -358,6 +358,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Thu Sep 22 2005 Peter Jones <pjones(a)redhat.com> 2.4.1-8
+- Fix bug #169046 more correctly.
+
* Thu Sep 22 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-7
- Fixed bug #169046 (realpath is unsafe); thanks to
Peter Jones <pjones(a)redhat.com> and Arjan van de Ven <arjanv(a)redhat.com>
for
commit a1be1af61f6f71477d908b2f8c14e410ab8ce06e
Author: Peter Jones <pjones(a)fedoraproject.org>
Date: Thu Sep 22 22:35:36 2005 +0000
fix this up so it ignores non-file arguments correctly.
diff --git a/python-2.4.1-canonicalize.patch b/python-2.4.1-canonicalize.patch
index 0428fe1..fdc9858 100644
--- a/python-2.4.1-canonicalize.patch
+++ b/python-2.4.1-canonicalize.patch
@@ -11,20 +11,48 @@
#undef HAVE_CHOWN
--- Python-2.4.1/Python/sysmodule.c.canonicalize 2005-09-14 11:53:30.000000000 -0400
-+++ Python-2.4.1/Python/sysmodule.c 2005-09-14 11:52:04.000000000 -0400
-@@ -1184,6 +1184,11 @@
- char *p = NULL;
- int n = 0;
- PyObject *a;
++++ Python-2.4.1/Python/sysmodule.c 2005-09-14 11:53:30.000000000 -0400
+@@ -1168,11 +1168,13 @@
+ void
+ PySys_SetArgv(int argc, char **argv)
+ {
++#ifndef HAVE_CANONICALIZE_FILE_NAME
+ #if defined(HAVE_REALPATH)
+ char fullpath[MAXPATHLEN];
+ #elif defined(MS_WINDOWS)
+ char fullpath[MAX_PATH];
+ #endif
++#endif
+ PyObject *av = makeargvobject(argc, argv);
+ PyObject *path = PySys_GetObject("path");
+ if (av == NULL)
+@@ -1180,6 +1182,25 @@
+ if (PySys_SetObject("argv", av) != 0)
+ Py_FatalError("can't assign sys.argv");
+ if (path != NULL) {
+#ifdef HAVE_CANONICALIZE_FILE_NAME
-+ argv0 = canonicalize_file_name(argv0);
-+ if (argv0 == NULL)
-+ Py_FatalError("no mem for sys.argv");
++ char *argv0;
++ int n = 0;
++ int errnum;
++ PyObject *a;
++
++ argv0 = canonicalize_file_name(argv[0]);
++ errnum = errno;
++ if (argv0 == NULL) {
++ if (errno == ENOENT)
++ /* strdup because we're going to free() it
++ later no matter what */
++ argv0 = strdup(argv[0]);
++ else
++ Py_FatalError(strerror(errnum));
++ if (!argv0)
++ Py_FatalError("no mem for sys.argv");
++ }
+#else /* ! HAVE_CANONICALIZE_FILE_NAME */
- #ifdef HAVE_READLINK
- char link[MAXPATHLEN+1];
- char argv0copy[2*MAXPATHLEN+1];
-@@ -1256,9 +1261,13 @@
+ char *argv0 = argv[0];
+ char *p = NULL;
+ int n = 0;
+@@ -1256,9 +1277,13 @@
#endif /* Unix */
}
#endif /* All others */
commit edd3bba40fa67e66f2b36b20cfc9f9544abdf8b8
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Thu Sep 22 15:36:15 2005 +0000
Need to run autoconf to get the function lookup in
diff --git a/python.spec b/python.spec
index f283d34..d455571 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.1
-Release: 6
+Release: 7
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -175,6 +175,8 @@ if pkg-config openssl ; then
fi
# Force CC
export CC=gcc
+# For patch 15, need to get a newer configure generated out of configure.in
+autoconf
%configure --enable-ipv6 --enable-unicode=%{unicode} --enable-shared
make OPT="$CFLAGS" %{?_smp_mflags}
@@ -356,7 +358,7 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
-* Thu Sep 22 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-6
+* Thu Sep 22 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-7
- Fixed bug #169046 (realpath is unsafe); thanks to
Peter Jones <pjones(a)redhat.com> and Arjan van de Ven <arjanv(a)redhat.com>
for
diagnosing and the patch.
commit 43222eb1f5efe0a1230df87c0714a04caaab0682
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Thu Sep 22 15:14:41 2005 +0000
one would hope I can fix cut and paste...
diff --git a/python.spec b/python.spec
index 569bc39..f283d34 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.1
-Release: 5
+Release: 6
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -39,7 +39,7 @@ Patch8: python-2.4.1-lib64.patch
Patch9: japanese-codecs-lib64.patch
Patch13: python-2.4-distutils-bdist-rpm.patch
Patch14: python-2.3.4-pydocnodoc.patch
-Patch15: pyhton-2.4.1-canonicalize.patch
+Patch15: python-2.4.1-canonicalize.patch
%if %{main_python}
Obsoletes: Distutils
@@ -143,7 +143,7 @@ user interface for Python programming.
%endif
%patch13 -p1 -b .bdist-rpm
%patch14 -p1 -b .no-doc
-%patch14 -p1 -b .canonicalize
+%patch15 -p1 -b .canonicalize
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -356,7 +356,7 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
-* Thu Sep 22 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-5
+* Thu Sep 22 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-6
- Fixed bug #169046 (realpath is unsafe); thanks to
Peter Jones <pjones(a)redhat.com> and Arjan van de Ven <arjanv(a)redhat.com>
for
diagnosing and the patch.
commit 7ccfc388f62c0cfd8876c0e19e8f9ab5788cd97a
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Thu Sep 22 15:11:13 2005 +0000
bugzilla: 169046 Make python compile on fc5
diff --git a/python-2.4.1-canonicalize.patch b/python-2.4.1-canonicalize.patch
new file mode 100644
index 0000000..0428fe1
--- /dev/null
+++ b/python-2.4.1-canonicalize.patch
@@ -0,0 +1,53 @@
+--- Python-2.4.1/pyconfig.h.in.canonicalize 2005-09-14 11:47:04.000000000 -0400
++++ Python-2.4.1/pyconfig.h.in 2005-09-14 11:47:02.000000000 -0400
+@@ -58,6 +58,9 @@
+ /* Define if pthread_sigmask() does not work on your system. */
+ #undef HAVE_BROKEN_PTHREAD_SIGMASK
+
++/* Define to 1 if you have the `canonicalize_file_name' function. */
++#undef HAVE_CANONICALIZE_FILE_NAME
++
+ /* Define to 1 if you have the `chown' function. */
+ #undef HAVE_CHOWN
+
+--- Python-2.4.1/Python/sysmodule.c.canonicalize 2005-09-14 11:53:30.000000000 -0400
++++ Python-2.4.1/Python/sysmodule.c 2005-09-14 11:52:04.000000000 -0400
+@@ -1184,6 +1184,11 @@
+ char *p = NULL;
+ int n = 0;
+ PyObject *a;
++#ifdef HAVE_CANONICALIZE_FILE_NAME
++ argv0 = canonicalize_file_name(argv0);
++ if (argv0 == NULL)
++ Py_FatalError("no mem for sys.argv");
++#else /* ! HAVE_CANONICALIZE_FILE_NAME */
+ #ifdef HAVE_READLINK
+ char link[MAXPATHLEN+1];
+ char argv0copy[2*MAXPATHLEN+1];
+@@ -1256,9 +1261,13 @@
+ #endif /* Unix */
+ }
+ #endif /* All others */
++#endif /* ! HAVE_CANONICALIZE_FILE_NAME */
+ a = PyString_FromStringAndSize(argv0, n);
+ if (a == NULL)
+ Py_FatalError("no mem for sys.path insertion");
++#ifdef HAVE_CANONICALIZE_FILE_NAME
++ free(argv0);
++#endif /* HAVE_CANONICALIZE_FILE_NAME */
+ if (PyList_Insert(path, 0, a) < 0)
+ Py_FatalError("sys.path.insert(0) failed");
+ Py_DECREF(a);
+--- Python-2.4.1/configure.in.canonicalize 2005-09-14 11:46:00.000000000 -0400
++++ Python-2.4.1/configure.in 2005-09-14 11:47:22.000000000 -0400
+@@ -2096,8 +2096,8 @@
+ AC_MSG_RESULT(MACHDEP_OBJS)
+
+ # checks for library functions
+-AC_CHECK_FUNCS(alarm bind_textdomain_codeset chown clock confstr ctermid \
+- execv fork fpathconf ftime ftruncate \
++AC_CHECK_FUNCS(alarm bind_textdomain_codeset canonicalize_file_name chown \
++ clock confstr ctermid execv fork fpathconf ftime ftruncate \
+ gai_strerror getgroups getlogin getloadavg getpeername getpgid getpid \
+ getpriority getpwent getsid getwd \
+ kill killpg lchown lstat mkfifo mknod mktime \
diff --git a/python.spec b/python.spec
index f8c62ba..569bc39 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.1
-Release: 4
+Release: 5
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -39,6 +39,7 @@ Patch8: python-2.4.1-lib64.patch
Patch9: japanese-codecs-lib64.patch
Patch13: python-2.4-distutils-bdist-rpm.patch
Patch14: python-2.3.4-pydocnodoc.patch
+Patch15: pyhton-2.4.1-canonicalize.patch
%if %{main_python}
Obsoletes: Distutils
@@ -142,6 +143,7 @@ user interface for Python programming.
%endif
%patch13 -p1 -b .bdist-rpm
%patch14 -p1 -b .no-doc
+%patch14 -p1 -b .canonicalize
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -354,6 +356,11 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Thu Sep 22 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-5
+- Fixed bug #169046 (realpath is unsafe); thanks to
+ Peter Jones <pjones(a)redhat.com> and Arjan van de Ven <arjanv(a)redhat.com>
for
+ diagnosing and the patch.
+
* Tue Sep 20 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-4
- Fixed bug #168655 (fixes for building as python24)
commit ce25e1e75670590abc8338f8db0c52287f0a288a
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Tue Sep 20 13:21:16 2005 +0000
bugzilla: 168655 Fixes for building as python2.4
diff --git a/python.spec b/python.spec
index 11ab50d..f8c62ba 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.1
-Release: 3
+Release: 4
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -102,7 +102,7 @@ documentation.
Summary: A collection of development tools included with Python.
Group: Development/Tools
Requires: %{name} = %{version}-%{release}
-Requires: tkinter = %{version}-%{release}
+Requires: %{tkinter} = %{version}-%{release}
%if %{main_python}
Obsoletes: python2-tools
Provides: python2-tools = %{version}
@@ -265,6 +265,7 @@ mv modulator modulator%{__python_ver}
mv pynche pynche%{__python_ver}
mv pygettext.py pygettext%{__python_ver}.py
mv msgfmt.py msgfmt%{__python_ver}.py
+mv smtpd.py smtpd%{__python_ver}.py
mv pydoc pydoc%{__python_ver}
popd
%endif
@@ -337,7 +338,7 @@ rm -fr $RPM_BUILD_ROOT
%doc Tools/pynche/README.pynche
%{_libdir}/python%{pybasever}/site-packages/modulator
%{_libdir}/python%{pybasever}/site-packages/pynche
-%{_bindir}/smtpd.py*
+%{_bindir}/smtpd*.py*
%{_bindir}/idle*
%{_bindir}/modulator*
%{_bindir}/pynche*
@@ -353,6 +354,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Tue Sep 20 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-4
+- Fixed bug #168655 (fixes for building as python24)
+
* Tue Jul 26 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-3
- Fixed bug #163435 (pynche doesn't start))
commit fe0d34d1534d50812844254814a381ef77d600b0
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Tue Sep 20 12:53:31 2005 +0000
bugzilla: 163435 Fixed modulator bug
diff --git a/python.spec b/python.spec
index 84ccbc4..11ab50d 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.1
-Release: 2
+Release: 3
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -28,8 +28,6 @@ Provides: python(abi) = %{pybasever}
Provides: python-optik = 1.4.1
Obsoletes: python-optik
Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
-Source3: modulator
-Source4: pynche
Source5:
http://www.python.jp/pub/JapaneseCodecs/JapaneseCodecs-%{jp_codecs}.tar.gz
Source6:
http://gigue.peabody.jhu.edu/~mdboom/omi/source/shm_source/shmmodule.c
Source7: python-2.3.4-optik.py
@@ -211,12 +209,20 @@ mv $RPM_BUILD_ROOT/%{_mandir}/man1/python.1
$RPM_BUILD_ROOT/%{_mandir}/man1/pyth
mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/python%{pybasever}/site-packages
#modulator
-install -m 755 $RPM_SOURCE_DIR/modulator ${RPM_BUILD_ROOT}%{_bindir}/modulator
+cat > ${RPM_BUILD_ROOT}%{_bindir}/modulator << EOF
+#!/bin/bash
+exec %{_libdir}/python%{pybasever}/site-packages/modulator/modulator.py
+EOF
+chmod 755 ${RPM_BUILD_ROOT}%{_bindir}/modulator
cp -r Tools/modulator \
${RPM_BUILD_ROOT}%{_libdir}/python%{pybasever}/site-packages/
#pynche
-install -m 755 $RPM_SOURCE_DIR/pynche ${RPM_BUILD_ROOT}%{_bindir}/pynche
+cat > ${RPM_BUILD_ROOT}%{_bindir}/pynche << EOF
+#!/bin/bash
+exec %{_libdir}/python%{pybasever}/site-packages/pynche/pynche
+EOF
+chmod 755 ${RPM_BUILD_ROOT}%{_bindir}/pynche
rm -f Tools/pynche/*.pyw
cp -r Tools/pynche \
${RPM_BUILD_ROOT}%{_libdir}/python%{pybasever}/site-packages/
@@ -347,6 +353,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Tue Jul 26 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-3
+- Fixed bug #163435 (pynche doesn't start))
+
* Wed Apr 20 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-2
- Fixed bug #143667 (python should own /usr/lib/python* on 64-bit systems, for
noarch packages)
commit adb16c2713d4999f34aed41f9870228f79510a9b
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Wed Apr 20 19:40:59 2005 +0000
fixing two small bugs
diff --git a/python.spec b/python.spec
index 99bb036..84ccbc4 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.1
-Release: 1
+Release: 2
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -47,7 +47,7 @@ Obsoletes: Distutils
Provides: Distutils
Obsoletes: python2
Provides: python2 = %{version}
-BuildPrereq: db4-devel
+BuildPrereq: db4-devel >= 4.3
%else
#BuildPrereq: db3-devel
%endif
@@ -277,6 +277,11 @@ find $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/lib-dynload -type f
| grep -v
# Fix for bug #136654
rm -f $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/email/test/data/audiotest.au
+# Fix bug #143667: python should own /usr/lib/python2.x on 64-bit machines
+%if %{_lib} == lib64
+install -d $RPM_BUILD_ROOT/usr/lib/python%{pybasever}/site-packages
+%endif
+
%clean
rm -fr $RPM_BUILD_ROOT
@@ -309,6 +314,10 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/compiler
%{_libdir}/python%{pybasever}/plat-linux2
%{_libdir}/python%{pybasever}/hotshot
+%if %{_lib} == lib64
+%attr(0755,root,root) %dir /usr/lib/python%{pybasever}
+%attr(0755,root,root) %dir /usr/lib/python%{pybasever}/site-packages
+%endif
%files devel
%defattr(-,root,root)
@@ -338,6 +347,11 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Wed Apr 20 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-2
+- Fixed bug #143667 (python should own /usr/lib/python* on 64-bit systems, for
+ noarch packages)
+- Fixed bug #143419 (BuildRequires db4 is not versioned)
+
* Wed Apr 6 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-1
- updated to 2.4.1
commit 26df5075bede0f457c76dd3e7f012580c0f8cb08
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Wed Apr 6 17:57:56 2005 +0000
Rebuilding with 2.4.1
diff --git a/.cvsignore b/.cvsignore
index 91a375f..a311fee 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -1,4 +1,2 @@
-JapaneseCodecs-1.4.10.tar.gz
-Python-2.4b2.tar.bz2
-Python-2.4c1.tar.bz2
-Python-2.4.tar.bz2
+Python-2.4.1.tar.bz2
+JapaneseCodecs-1.4.11.tar.gz
diff --git a/python.spec b/python.spec
index bf53679..99bb036 100644
--- a/python.spec
+++ b/python.spec
@@ -12,14 +12,14 @@
%endif
%define pybasever 2.4
-%define jp_codecs 1.4.10
+%define jp_codecs 1.4.11
%define tools_dir %{_libdir}/python%{pybasever}/Tools
%define demo_dir %{_libdir}/python%{pybasever}/Demo
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
-Version: %{pybasever}
-Release: 6
+Version: %{pybasever}.1
+Release: 1
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -34,15 +34,13 @@ Source5:
http://www.python.jp/pub/JapaneseCodecs/JapaneseCodecs-%{jp_codecs}.tar
Source6:
http://gigue.peabody.jhu.edu/~mdboom/omi/source/shm_source/shmmodule.c
Source7: python-2.3.4-optik.py
-Patch0: python-2.4-config.patch
-Patch1: python-2.4-xmlfix.patch
+Patch0: python-2.4.1-config.patch
Patch3: Python-2.2.1-pydocnogui.patch
Patch7: python-2.3.4-lib64-regex.patch
-Patch8: python-2.4-lib64.patch
+Patch8: python-2.4.1-lib64.patch
Patch9: japanese-codecs-lib64.patch
Patch13: python-2.4-distutils-bdist-rpm.patch
Patch14: python-2.3.4-pydocnodoc.patch
-Patch16: python-2.4-db43.patch
%if %{main_python}
Obsoletes: Distutils
@@ -138,7 +136,6 @@ user interface for Python programming.
%setup -q -n Python-%{version} -a 5
%patch0 -p1 -b .rhconfig
-%patch1 -p0 -b .xmlfix
%patch3 -p1 -b .no_gui
%if %{_lib} == lib64
%patch7 -p1 -b .lib64-regex
@@ -147,7 +144,6 @@ user interface for Python programming.
%endif
%patch13 -p1 -b .bdist-rpm
%patch14 -p1 -b .no-doc
-%patch16 -p1 -b .db43
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -342,6 +338,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Wed Apr 6 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4.1-1
+- updated to 2.4.1
+
* Mon Mar 14 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4-6
- building the docs from a different source rpm, to decouple bootstrapping
python from having tetex installed
diff --git a/sources b/sources
index 0a58d45..80655f8 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-d6a211e2fe98e2f8c57a5f27684048fd JapaneseCodecs-1.4.10.tar.gz
-44c2226eff0f3fc1f2fedaa1ce596533 Python-2.4.tar.bz2
+de3e9a8836fab6df7c7ce545331afeb3 Python-2.4.1.tar.bz2
+e4f2ed866f4ce978fb54bb962eab4fdf JapaneseCodecs-1.4.11.tar.gz
commit 0fdf6c4ce2580414045bb8901bd51158b65dd0c5
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Tue Mar 15 00:41:54 2005 +0000
Attempting to use python-extras to build the documentation - this has the
added benefit of simplifying the bootstrap process
diff --git a/python.spec b/python.spec
index 68a11d7..bf53679 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}
-Release: 5
+Release: 6
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -37,14 +37,12 @@ Source7: python-2.3.4-optik.py
Patch0: python-2.4-config.patch
Patch1: python-2.4-xmlfix.patch
Patch3: Python-2.2.1-pydocnogui.patch
-Patch4: python-2.3-nowhatsnew.patch
Patch7: python-2.3.4-lib64-regex.patch
Patch8: python-2.4-lib64.patch
Patch9: japanese-codecs-lib64.patch
Patch13: python-2.4-distutils-bdist-rpm.patch
Patch14: python-2.3.4-pydocnodoc.patch
Patch16: python-2.4-db43.patch
-Patch17: python-2.4-tex-fix.patch
%if %{main_python}
Obsoletes: Distutils
@@ -58,7 +56,7 @@ BuildPrereq: db4-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildPrereq: readline-devel, libtermcap-devel, openssl-devel, gmp-devel
-BuildPrereq: ncurses-devel, gdbm-devel, zlib-devel, expat-devel, tetex-latex
+BuildPrereq: ncurses-devel, gdbm-devel, zlib-devel, expat-devel
BuildPrereq: Mesa-devel tk tix gcc-c++ XFree86-devel glibc-devel
BuildPrereq: bzip2 tar /usr/bin/find pkgconfig tcl-devel tk-devel
BuildPrereq: tix-devel bzip2-devel
@@ -118,23 +116,6 @@ Provides: python2-tools = %{version}
The Python package includes several development tools that are used
to build python programs.
-%package docs
-Summary: Documentation for the Python programming language.
-Group: Documentation
-Requires: %{name} = %{version}-%{release}
-%if %{main_python}
-Obsoletes: python2-docs
-Provides: python2-docs = %{version}
-%endif
-
-%description docs
-The python-docs package contains documentation on the Python
-programming language and interpreter. The documentation is provided
-in ASCII text files and in LaTeX source files.
-
-Install the python-docs package if you'd like to use the documentation
-for the Python language.
-
%package -n %{tkinter}
Summary: A graphical user interface for the Python scripting language.
Group: Development/Languages
@@ -159,7 +140,6 @@ user interface for Python programming.
%patch0 -p1 -b .rhconfig
%patch1 -p0 -b .xmlfix
%patch3 -p1 -b .no_gui
-%patch4 -p1
%if %{_lib} == lib64
%patch7 -p1 -b .lib64-regex
%patch8 -p1 -b .lib64
@@ -168,7 +148,6 @@ user interface for Python programming.
%patch13 -p1 -b .bdist-rpm
%patch14 -p1 -b .no-doc
%patch16 -p1 -b .db43
-%patch17 -p1 -b .tex-fix
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -206,11 +185,6 @@ make OPT="$CFLAGS" %{?_smp_mflags}
LD_LIBRARY_PATH=$topdir $topdir/python Tools/scripts/pathfix.py -i "%{_bindir}/env
python%{pybasever}" .
make OPT="$CFLAGS" %{?_smp_mflags}
-pushd Doc
-LD_LIBRARY_PATH=$topdir make PYTHON=$topdir/python
-rm html/index.html.in Makefile* info/Makefile tools/sgmlconv/Makefile
-popd
-
%install
[ -d $RPM_BUILD_ROOT ] && rm -fr $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr $RPM_BUILD_ROOT%{_mandir}
@@ -362,17 +336,16 @@ rm -fr $RPM_BUILD_ROOT
%{tools_dir}
%{demo_dir}
-%files docs
-%defattr(-,root,root,755)
-%doc Misc/NEWS Misc/README Misc/cheatsheet
-%doc Misc/HISTORY Doc/html
-
%files -n %{tkinter}
%defattr(-,root,root,755)
%{_libdir}/python%{pybasever}/lib-tk
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Mon Mar 14 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4-6
+- building the docs from a different source rpm, to decouple bootstrapping
+ python from having tetex installed
+
* Fri Mar 11 2005 Dan Williams <dcbw(a)redhat.com> 2.4-5
- Rebuild to pick up new libssl.so.5
commit 08a313593be2307ac499dc0c4ad71c97cfda6c3e
Author: Daniel Williams <dcbw(a)fedoraproject.org>
Date: Mon Mar 14 15:15:21 2005 +0000
Fix some latex errors in Documentation building
diff --git a/python.spec b/python.spec
index 7511775..68a11d7 100644
--- a/python.spec
+++ b/python.spec
@@ -44,6 +44,7 @@ Patch9: japanese-codecs-lib64.patch
Patch13: python-2.4-distutils-bdist-rpm.patch
Patch14: python-2.3.4-pydocnodoc.patch
Patch16: python-2.4-db43.patch
+Patch17: python-2.4-tex-fix.patch
%if %{main_python}
Obsoletes: Distutils
@@ -167,6 +168,7 @@ user interface for Python programming.
%patch13 -p1 -b .bdist-rpm
%patch14 -p1 -b .no-doc
%patch16 -p1 -b .db43
+%patch17 -p1 -b .tex-fix
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
commit e18538bd329c6957459d930a5cb8d208e88d3414
Author: Daniel Williams <dcbw(a)fedoraproject.org>
Date: Fri Mar 11 14:57:41 2005 +0000
Bump revision
diff --git a/python.spec b/python.spec
index c9a91fe..7511775 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}
-Release: 4
+Release: 5
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
commit 7c45c657399fe595711440add562e6591d17debf
Author: Daniel Williams <dcbw(a)fedoraproject.org>
Date: Fri Mar 11 14:56:43 2005 +0000
- Rebuild to pick up new libssl.so.5
diff --git a/python.spec b/python.spec
index cf20dac..c9a91fe 100644
--- a/python.spec
+++ b/python.spec
@@ -371,6 +371,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Fri Mar 11 2005 Dan Williams <dcbw(a)redhat.com> 2.4-5
+- Rebuild to pick up new libssl.so.5
+
* Wed Feb 2 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4-4
- Fixed security issue in SimpleXMLRPCServer.py (#146647)
commit 498896889fa90ee76a0480a10c877dd6d1ac0170
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Fri Feb 4 15:30:56 2005 +0000
Merging embargo changes back in HEAD
diff --git a/python.spec b/python.spec
index 46b3fa8..cf20dac 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}
-Release: 3
+Release: 4
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -35,6 +35,7 @@ Source6:
http://gigue.peabody.jhu.edu/~mdboom/omi/source/shm_source/shmmodule.c
Source7: python-2.3.4-optik.py
Patch0: python-2.4-config.patch
+Patch1: python-2.4-xmlfix.patch
Patch3: Python-2.2.1-pydocnogui.patch
Patch4: python-2.3-nowhatsnew.patch
Patch7: python-2.3.4-lib64-regex.patch
@@ -155,6 +156,7 @@ user interface for Python programming.
%setup -q -n Python-%{version} -a 5
%patch0 -p1 -b .rhconfig
+%patch1 -p0 -b .xmlfix
%patch3 -p1 -b .no_gui
%patch4 -p1
%if %{_lib} == lib64
@@ -369,6 +371,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Wed Feb 2 2005 Mihai Ibanescu <misa(a)redhat.com> 2.4-4
+- Fixed security issue in SimpleXMLRPCServer.py (#146647)
+
* Wed Jan 12 2005 Tim Waugh <twaugh(a)redhat.com> 2.4-3
- Rebuilt for new readline.
commit f41720b01204f9a3f4d768a78850ca0d18880392
Author: Tim Waugh <twaugh(a)fedoraproject.org>
Date: Wed Jan 12 16:11:56 2005 +0000
- Rebuilt for new readline.
diff --git a/python.spec b/python.spec
index d22bb62..46b3fa8 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}
-Release: 2
+Release: 3
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -369,6 +369,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Wed Jan 12 2005 Tim Waugh <twaugh(a)redhat.com> 2.4-3
+- Rebuilt for new readline.
+
* Mon Dec 6 2004 Jeff Johnson <jbj(a)jbj.org> 2.4-2
- db-4.3.21 returns DB_BUFFER_SMALL rather than ENOMEM (#141994).
- add Provide: python(abi) = 2.4
commit 8e4b82e418996dee2c82d1dbb4c9ff1905ecb738
Author: jbj <jbj(a)fedoraproject.org>
Date: Tue Dec 7 22:07:50 2004 +0000
- db-4.3.21 returns DB_BUFFER_SMALL rather than ENOMEM (#141994).
- add Provide: python(abi) = 2.4
- include msgfmt/pygettext *.pyc and *.pyo from brp-python-bytecompile.
diff --git a/python.spec b/python.spec
index f5c8d6e..d22bb62 100644
--- a/python.spec
+++ b/python.spec
@@ -19,10 +19,11 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}
-Release: 1
+Release: 2
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
+Provides: python(abi) = %{pybasever}
# optik is part of python 2.3 as optparse
Provides: python-optik = 1.4.1
Obsoletes: python-optik
@@ -351,8 +352,8 @@ rm -fr $RPM_BUILD_ROOT
%{_bindir}/idle*
%{_bindir}/modulator*
%{_bindir}/pynche*
-%{_bindir}/pygettext*.py
-%{_bindir}/msgfmt*.py
+%{_bindir}/pygettext*.py*
+%{_bindir}/msgfmt*.py*
%{_bindir}/pydoc*
%{tools_dir}
%{demo_dir}
@@ -368,6 +369,11 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Mon Dec 6 2004 Jeff Johnson <jbj(a)jbj.org> 2.4-2
+- db-4.3.21 returns DB_BUFFER_SMALL rather than ENOMEM (#141994).
+- add Provide: python(abi) = 2.4
+- include msgfmt/pygettext *.pyc and *.pyo from brp-python-bytecompile.
+
* Fri Dec 3 2004 Mihai Ibanescu <misa(a)redhat.com> 2.4-1
- Python-2.4.tar.bz2 (final)
commit 6828cb0bb09a87fffce3ca1fc9e0e108f3d3add5
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Fri Dec 3 14:56:19 2004 +0000
Final release of python
diff --git a/.cvsignore b/.cvsignore
index 8944e46..91a375f 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -1,3 +1,4 @@
JapaneseCodecs-1.4.10.tar.gz
Python-2.4b2.tar.bz2
Python-2.4c1.tar.bz2
+Python-2.4.tar.bz2
diff --git a/python.spec b/python.spec
index d9b71d9..f5c8d6e 100644
--- a/python.spec
+++ b/python.spec
@@ -19,15 +19,14 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}
-Release: 0.c1.1
+Release: 1
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
# optik is part of python 2.3 as optparse
Provides: python-optik = 1.4.1
Obsoletes: python-optik
-#Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
-Source:
http://www.python.org/ftp/python/%{version}/Python-%{pybasever}c1.tar.bz2
+Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
Source3: modulator
Source4: pynche
Source5:
http://www.python.jp/pub/JapaneseCodecs/JapaneseCodecs-%{jp_codecs}.tar.gz
@@ -152,8 +151,7 @@ You should install the tkinter package if you'd like to use a
graphical
user interface for Python programming.
%prep
-#%setup -q -n Python-%{version} -a 5
-%setup -q -n Python-%{pybasever}c1 -a 5
+%setup -q -n Python-%{version} -a 5
%patch0 -p1 -b .rhconfig
%patch3 -p1 -b .no_gui
@@ -370,6 +368,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Fri Dec 3 2004 Mihai Ibanescu <misa(a)redhat.com> 2.4-1
+- Python-2.4.tar.bz2 (final)
+
* Fri Nov 19 2004 Mihai Ibanescu <misa(a)redhat.com> 2.4-0.c1.1
- Python-2.4c1.tar.bz2 (release candidate 1)
diff --git a/sources b/sources
index d4f8d38..0a58d45 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
d6a211e2fe98e2f8c57a5f27684048fd JapaneseCodecs-1.4.10.tar.gz
-bb11d7670a412554c580ee1807056479 Python-2.4c1.tar.bz2
+44c2226eff0f3fc1f2fedaa1ce596533 Python-2.4.tar.bz2
commit ed1fb0b8a83d4594a498a9a2d4a23d61ae861062
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Fri Nov 19 19:57:34 2004 +0000
Building RC1
diff --git a/.cvsignore b/.cvsignore
index e05db57..8944e46 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -1,2 +1,3 @@
JapaneseCodecs-1.4.10.tar.gz
Python-2.4b2.tar.bz2
+Python-2.4c1.tar.bz2
diff --git a/python.spec b/python.spec
index d257b0f..d9b71d9 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}
-Release: 0.b2.4
+Release: 0.c1.1
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -27,7 +27,7 @@ Provides: python-abi = %{pybasever}
Provides: python-optik = 1.4.1
Obsoletes: python-optik
#Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
-Source:
http://www.python.org/ftp/python/%{version}/Python-%{pybasever}b2.tar.bz2
+Source:
http://www.python.org/ftp/python/%{version}/Python-%{pybasever}c1.tar.bz2
Source3: modulator
Source4: pynche
Source5:
http://www.python.jp/pub/JapaneseCodecs/JapaneseCodecs-%{jp_codecs}.tar.gz
@@ -42,7 +42,6 @@ Patch8: python-2.4-lib64.patch
Patch9: japanese-codecs-lib64.patch
Patch13: python-2.4-distutils-bdist-rpm.patch
Patch14: python-2.3.4-pydocnodoc.patch
-Patch15: python-2.3.4-buffer-overflow.patch
Patch16: python-2.4-db43.patch
%if %{main_python}
@@ -154,7 +153,7 @@ user interface for Python programming.
%prep
#%setup -q -n Python-%{version} -a 5
-%setup -q -n Python-%{pybasever}b2 -a 5
+%setup -q -n Python-%{pybasever}c1 -a 5
%patch0 -p1 -b .rhconfig
%patch3 -p1 -b .no_gui
@@ -166,7 +165,6 @@ user interface for Python programming.
%endif
%patch13 -p1 -b .bdist-rpm
%patch14 -p1 -b .no-doc
-%patch15 -p1 -b .buffer-overflow
%patch16 -p1 -b .db43
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -372,6 +370,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Fri Nov 19 2004 Mihai Ibanescu <misa(a)redhat.com> 2.4-0.c1.1
+- Python-2.4c1.tar.bz2 (release candidate 1)
+
* Thu Nov 11 2004 Jeff Johnson <jbj(a)jbj.org> 2.4-0.b2.4
- rebuild against db-4.3.21.
diff --git a/sources b/sources
index e2d36d9..d4f8d38 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
d6a211e2fe98e2f8c57a5f27684048fd JapaneseCodecs-1.4.10.tar.gz
-683929acb0af30a7280250f80448daa6 Python-2.4b2.tar.bz2
+bb11d7670a412554c580ee1807056479 Python-2.4c1.tar.bz2
commit 57ae32b038067cebea5911b1466aa7aa851d7c72
Author: jbj <jbj(a)fedoraproject.org>
Date: Fri Nov 12 23:50:00 2004 +0000
- rebuild against db-4.3.21.
diff --git a/python.spec b/python.spec
index dac5b67..d257b0f 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}
-Release: 0.b2.3
+Release: 0.b2.4
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -43,6 +43,7 @@ Patch9: japanese-codecs-lib64.patch
Patch13: python-2.4-distutils-bdist-rpm.patch
Patch14: python-2.3.4-pydocnodoc.patch
Patch15: python-2.3.4-buffer-overflow.patch
+Patch16: python-2.4-db43.patch
%if %{main_python}
Obsoletes: Distutils
@@ -166,6 +167,7 @@ user interface for Python programming.
%patch13 -p1 -b .bdist-rpm
%patch14 -p1 -b .no-doc
%patch15 -p1 -b .buffer-overflow
+%patch16 -p1 -b .db43
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -370,6 +372,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Thu Nov 11 2004 Jeff Johnson <jbj(a)jbj.org> 2.4-0.b2.4
+- rebuild against db-4.3.21.
+
* Mon Nov 8 2004 Jeremy Katz <katzj(a)redhat.com> - 2.4-0.b2.3
- fix the lib64 patch so that 64bit arches still look in /usr/lib/python...
commit cddc234f02a241ac247e55e28404c3137eda251f
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Tue Nov 9 01:54:59 2004 +0000
- fix the lib64 patch so that 64bit arches still look in /usr/lib/python...
diff --git a/python.spec b/python.spec
index 9257545..dac5b67 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}
-Release: 0.b2.2
+Release: 0.b2.3
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -370,6 +370,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Mon Nov 8 2004 Jeremy Katz <katzj(a)redhat.com> - 2.4-0.b2.3
+- fix the lib64 patch so that 64bit arches still look in /usr/lib/python...
+
* Mon Nov 8 2004 Jeremy Katz <katzj(a)redhat.com> - 2.4-0.b2.2
- cryptmodule still needs -lcrypt (again)
commit f61e66a9aea474fcd5d40e7143e044eb2a5dabd2
Author: Jeremy Katz <katzj(a)fedoraproject.org>
Date: Mon Nov 8 22:03:32 2004 +0000
- cryptmodule still needs -lcrypt (again)
diff --git a/python.spec b/python.spec
index e1ba65c..9257545 100644
--- a/python.spec
+++ b/python.spec
@@ -19,7 +19,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}
-Release: 0.b2.1
+Release: 0.b2.2
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -370,6 +370,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Mon Nov 8 2004 Jeremy Katz <katzj(a)redhat.com> - 2.4-0.b2.2
+- cryptmodule still needs -lcrypt (again)
+
* Thu Nov 4 2004 Mihai Ibanescu <misa(a)redhat.com> 2.4-0.b2.1
- Updated to python 2.4b2 (and labeled it 2.4-0.b2.1 to avoid breaking rpm's
version comparison)
commit f9962c609e680bead848889efc23780ed200c1ac
Author: Mihai Ibanescu <misa(a)fedoraproject.org>
Date: Thu Nov 4 22:42:22 2004 +0000
python 2.4b2 packages - yeah...
diff --git a/.cvsignore b/.cvsignore
index f7b6955..e05db57 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -1,2 +1,2 @@
-JapaneseCodecs-1.4.9.tar.gz
-Python-2.3.4.tar.bz2
+JapaneseCodecs-1.4.10.tar.gz
+Python-2.4b2.tar.bz2
diff --git a/python.spec b/python.spec
index bb6d8ee..e1ba65c 100644
--- a/python.spec
+++ b/python.spec
@@ -11,37 +11,38 @@
%define tkinter tkinter
%endif
-%define pybasever 2.3
-%define jp_codecs 1.4.9
+%define pybasever 2.4
+%define jp_codecs 1.4.10
%define tools_dir %{_libdir}/python%{pybasever}/Tools
%define demo_dir %{_libdir}/python%{pybasever}/Demo
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
-Version: %{pybasever}.4
-Release: 10
+Version: %{pybasever}
+Release: 0.b2.1
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
# optik is part of python 2.3 as optparse
Provides: python-optik = 1.4.1
Obsoletes: python-optik
-Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
+#Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
+Source:
http://www.python.org/ftp/python/%{version}/Python-%{pybasever}b2.tar.bz2
Source3: modulator
Source4: pynche
Source5:
http://www.python.jp/pub/JapaneseCodecs/JapaneseCodecs-%{jp_codecs}.tar.gz
Source6:
http://gigue.peabody.jhu.edu/~mdboom/omi/source/shm_source/shmmodule.c
Source7: python-2.3.4-optik.py
-Patch0: python-2.3-config.patch
+Patch0: python-2.4-config.patch
Patch3: Python-2.2.1-pydocnogui.patch
Patch4: python-2.3-nowhatsnew.patch
Patch7: python-2.3.4-lib64-regex.patch
-Patch8: python-2.3.2-lib64.patch
+Patch8: python-2.4-lib64.patch
Patch9: japanese-codecs-lib64.patch
-Patch12: python-2.3.2-nomkhowto.patch
-Patch13: python-2.3.4-distutils-bdist-rpm.patch
+Patch13: python-2.4-distutils-bdist-rpm.patch
Patch14: python-2.3.4-pydocnodoc.patch
+Patch15: python-2.3.4-buffer-overflow.patch
%if %{main_python}
Obsoletes: Distutils
@@ -57,8 +58,8 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildPrereq: readline-devel, libtermcap-devel, openssl-devel, gmp-devel
BuildPrereq: ncurses-devel, gdbm-devel, zlib-devel, expat-devel, tetex-latex
BuildPrereq: Mesa-devel tk tix gcc-c++ XFree86-devel glibc-devel
-BuildPrereq: gzip tar /usr/bin/find pkgconfig tcl-devel tk-devel
-BuildPrereq: tix-devel
+BuildPrereq: bzip2 tar /usr/bin/find pkgconfig tcl-devel tk-devel
+BuildPrereq: tix-devel bzip2-devel
URL:
http://www.python.org/
%description
@@ -151,7 +152,8 @@ You should install the tkinter package if you'd like to use a
graphical
user interface for Python programming.
%prep
-%setup -q -n Python-%{version} -a 5
+#%setup -q -n Python-%{version} -a 5
+%setup -q -n Python-%{pybasever}b2 -a 5
%patch0 -p1 -b .rhconfig
%patch3 -p1 -b .no_gui
@@ -161,9 +163,9 @@ user interface for Python programming.
%patch8 -p1 -b .lib64
%patch9 -p0 -b .lib64-j
%endif
-%patch12 -p1 -b .nomkhowto
%patch13 -p1 -b .bdist-rpm
%patch14 -p1 -b .no-doc
+%patch15 -p1 -b .buffer-overflow
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -198,7 +200,7 @@ export CC=gcc
%configure --enable-ipv6 --enable-unicode=%{unicode} --enable-shared
make OPT="$CFLAGS" %{?_smp_mflags}
-LD_LIBRARY_PATH=$topdir $topdir/python Tools/scripts/pathfix.py -i "/usr/bin/env
python%{pybasever}" .
+LD_LIBRARY_PATH=$topdir $topdir/python Tools/scripts/pathfix.py -i "%{_bindir}/env
python%{pybasever}" .
make OPT="$CFLAGS" %{?_smp_mflags}
pushd Doc
@@ -215,19 +217,19 @@ for f in distutils/command/install distutils/sysconfig; do
rm -f Lib/$f.py.lib64
done
-%makeinstall DESTDIR=/ MANDIR=$RPM_BUILD_ROOT%{_mandir}
INCLUDEDIR=$RPM_BUILD_ROOT%{_includedir} LIBDIR=$RPM_BUILD_ROOT%{_libdir}
SCRIPTDIR=$RPM_BUILD_ROOT%{_libdir} build_root=$RPM_BUILD_ROOT
+make install DESTDIR=$RPM_BUILD_ROOT
# Fix the interpreter path in binaries installed by distutils
# (which changes them by itself)
# Make sure we preserve the file permissions
-for fixed in $RPM_BUILD_ROOT/usr/bin/pydoc; do
- sed 's,#!.*/python$,#!/usr/bin/env python%{pybasever},' $fixed > $fixed-
\
+for fixed in $RPM_BUILD_ROOT%{_bindir}/pydoc; do
+ sed 's,#!.*/python$,#!%{_bindir}/env python%{pybasever},' $fixed > $fixed-
\
&& cat $fixed- > $fixed && rm -f $fixed-
done
%if %{main_python}
-ln -s python $RPM_BUILD_ROOT/usr/bin/python2
+ln -s python $RPM_BUILD_ROOT%{_bindir}/python2
%else
-mv $RPM_BUILD_ROOT/usr/bin/python $RPM_BUILD_ROOT/usr/bin/%{python}
+mv $RPM_BUILD_ROOT%{_bindir}/python $RPM_BUILD_ROOT%{_bindir}/%{python}
mv $RPM_BUILD_ROOT/%{_mandir}/man1/python.1
$RPM_BUILD_ROOT/%{_mandir}/man1/python%{pybasever}.1
%endif
@@ -236,12 +238,12 @@ mv $RPM_BUILD_ROOT/%{_mandir}/man1/python.1
$RPM_BUILD_ROOT/%{_mandir}/man1/pyth
mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/python%{pybasever}/site-packages
#modulator
-install -m 755 $RPM_SOURCE_DIR/modulator ${RPM_BUILD_ROOT}/usr/bin/modulator
+install -m 755 $RPM_SOURCE_DIR/modulator ${RPM_BUILD_ROOT}%{_bindir}/modulator
cp -r Tools/modulator \
${RPM_BUILD_ROOT}%{_libdir}/python%{pybasever}/site-packages/
#pynche
-install -m 755 $RPM_SOURCE_DIR/pynche ${RPM_BUILD_ROOT}/usr/bin/pynche
+install -m 755 $RPM_SOURCE_DIR/pynche ${RPM_BUILD_ROOT}%{_bindir}/pynche
rm -f Tools/pynche/*.pyw
cp -r Tools/pynche \
${RPM_BUILD_ROOT}%{_libdir}/python%{pybasever}/site-packages/
@@ -250,8 +252,8 @@ mv Tools/modulator/README Tools/modulator/README.modulator
mv Tools/pynche/README Tools/pynche/README.pynche
#gettext
-install -m755 Tools/i18n/pygettext.py $RPM_BUILD_ROOT/usr/bin/
-install -m755 Tools/i18n/msgfmt.py $RPM_BUILD_ROOT/usr/bin/
+install -m755 Tools/i18n/pygettext.py $RPM_BUILD_ROOT%{_bindir}/
+install -m755 Tools/i18n/msgfmt.py $RPM_BUILD_ROOT%{_bindir}/
# Useful development tools
install -m755 -d $RPM_BUILD_ROOT%{tools_dir}/scripts
@@ -278,7 +280,7 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/python2.2/LICENSE.txt
#make the binaries install side by side with the main python
%if !%{main_python}
-pushd $RPM_BUILD_ROOT/usr/bin
+pushd $RPM_BUILD_ROOT%{_bindir}
mv idle idle%{__python_ver}
mv modulator modulator%{__python_ver}
mv pynche pynche%{__python_ver}
@@ -290,17 +292,17 @@ popd
# Japanese codecs
pushd JapaneseCodecs-%{jp_codecs}
-LD_LIBRARY_PATH=$RPM_BUILD_ROOT/%{_libdir} PYTHONHOME=$RPM_BUILD_ROOT/usr \
- $RPM_BUILD_ROOT/usr/bin/%{python} setup.py \
-install \
---install-scripts=$RPM_BUILD_ROOT/%{_prefix}/bin \
---install-purelib=$RPM_BUILD_ROOT/%{_libdir}/python%{pybasever}/site-packages \
---install-platlib=$RPM_BUILD_ROOT/%{_libdir}/python%{pybasever}/lib-dynload \
---install-data=$RPM_BUILD_ROOT/%{_exec_prefix} \
---root=/
+# We need to set LD_LIBRARY_PATH since python is now compiled as shared, and
+# we always want to use the currently compiled one
+LD_LIBRARY_PATH=$RPM_BUILD_ROOT%{_libdir} \
+ ../python setup.py install --root=$RPM_BUILD_ROOT
popd
-find $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/lib-dynload -type f | grep -v
_tkinter.so | sed "s|$RPM_BUILD_ROOT||" > dynfiles
+find $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/lib-dynload -type d | sed
"s|$RPM_BUILD_ROOT|%dir |" > dynfiles
+find $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/lib-dynload -type f | grep -v
"_tkinter.so$" | sed "s|$RPM_BUILD_ROOT||" >> dynfiles
+
+# Fix for bug #136654
+rm -f $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/email/test/data/audiotest.au
%clean
rm -fr $RPM_BUILD_ROOT
@@ -308,15 +310,14 @@ rm -fr $RPM_BUILD_ROOT
%files -f dynfiles
%defattr(-, root, root)
%doc LICENSE README
-/usr/bin/python*
+%{_bindir}/python*
%{_mandir}/*/*
%{_libdir}/libpython%{pybasever}.so*
%dir %{_libdir}/python%{pybasever}
-%dir %{_libdir}/python%{pybasever}/lib-dynload
-%dir %{_libdir}/python%{pybasever}/lib-dynload/japanese
%{_libdir}/python%{pybasever}/site-packages/japanese.pth
%dir %{_libdir}/python%{pybasever}/site-packages
+%{_libdir}/python%{pybasever}/site-packages/japanese
%{_libdir}/python%{pybasever}/site-packages/README
%{_libdir}/python%{pybasever}/LICENSE.txt
%{_libdir}/python%{pybasever}/*.py*
@@ -348,12 +349,13 @@ rm -fr $RPM_BUILD_ROOT
%doc Tools/pynche/README.pynche
%{_libdir}/python%{pybasever}/site-packages/modulator
%{_libdir}/python%{pybasever}/site-packages/pynche
-/usr/bin/idle*
-/usr/bin/modulator*
-/usr/bin/pynche*
-/usr/bin/pygettext*.py
-/usr/bin/msgfmt*.py
-/usr/bin/pydoc*
+%{_bindir}/smtpd.py*
+%{_bindir}/idle*
+%{_bindir}/modulator*
+%{_bindir}/pynche*
+%{_bindir}/pygettext*.py
+%{_bindir}/msgfmt*.py
+%{_bindir}/pydoc*
%{tools_dir}
%{demo_dir}
@@ -368,6 +370,19 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Thu Nov 4 2004 Mihai Ibanescu <misa(a)redhat.com> 2.4-0.b2.1
+- Updated to python 2.4b2 (and labeled it 2.4-0.b2.1 to avoid breaking rpm's
+ version comparison)
+
+* Thu Nov 4 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-13
+- Fixed bug #138112 (python overflows stack buffer) - SF bug 105470
+
+* Tue Nov 2 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-12
+- Fixed bugs #131439 #136023 #137863 (.pyc/.pyo files had the buildroot added)
+
+* Tue Oct 26 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-11
+- Fixed bug #136654 (python has sketchy audio clip)
+
* Tue Aug 31 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-10
- Fixed bug #77418 (Demo dir not packaged)
- More tweaking on #19347 (Moved Tools/ under /usr/lib/python2.3/Tools)
diff --git a/sources b/sources
index ee1e112..e2d36d9 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-13198f9b425dd44fc94af45afe47b94d JapaneseCodecs-1.4.9.tar.gz
-a2c089faa2726c142419c03472fc4063 Python-2.3.4.tar.bz2
+d6a211e2fe98e2f8c57a5f27684048fd JapaneseCodecs-1.4.10.tar.gz
+683929acb0af30a7280250f80448daa6 Python-2.4b2.tar.bz2
commit d78f1e2ff9511ff74f21f7f47f60892023c8d32d
Author: cvsdist <cvsdist(a)fedoraproject.org>
Date: Thu Sep 9 11:07:18 2004 +0000
auto-import changelog data from python-2.3.4-10.src.rpm
Tue Aug 31 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-10
- Fixed bug #77418 (Demo dir not packaged)
- More tweaking on #19347 (Moved Tools/ under /usr/lib/python2.3/Tools)
diff --git a/python.spec b/python.spec
index 1b77e7a..bb6d8ee 100644
--- a/python.spec
+++ b/python.spec
@@ -13,12 +13,13 @@
%define pybasever 2.3
%define jp_codecs 1.4.9
-%define tools_dir %{_datadir}/python%{pybasever}/Tools
+%define tools_dir %{_libdir}/python%{pybasever}/Tools
+%define demo_dir %{_libdir}/python%{pybasever}/Demo
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.4
-Release: 8
+Release: 10
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -253,8 +254,13 @@ install -m755 Tools/i18n/pygettext.py $RPM_BUILD_ROOT/usr/bin/
install -m755 Tools/i18n/msgfmt.py $RPM_BUILD_ROOT/usr/bin/
# Useful development tools
-install -m755 -d $RPM_BUILD_ROOT%{tools_dir}
-install Tools/scripts/*py $RPM_BUILD_ROOT%{tools_dir}
+install -m755 -d $RPM_BUILD_ROOT%{tools_dir}/scripts
+install Tools/README $RPM_BUILD_ROOT%{tools_dir}/
+install Tools/scripts/*py $RPM_BUILD_ROOT%{tools_dir}/scripts/
+
+# Useful demo scripts
+install -m755 -d $RPM_BUILD_ROOT%{demo_dir}
+cp -ar Demo/* $RPM_BUILD_ROOT%{demo_dir}
# Get rid of crap
find $RPM_BUILD_ROOT/ -name "*~"|xargs rm -f
@@ -306,7 +312,6 @@ rm -fr $RPM_BUILD_ROOT
%{_mandir}/*/*
%{_libdir}/libpython%{pybasever}.so*
-%dir %{_datadir}/python%{pybasever}
%dir %{_libdir}/python%{pybasever}
%dir %{_libdir}/python%{pybasever}/lib-dynload
%dir %{_libdir}/python%{pybasever}/lib-dynload/japanese
@@ -350,6 +355,7 @@ rm -fr $RPM_BUILD_ROOT
/usr/bin/msgfmt*.py
/usr/bin/pydoc*
%{tools_dir}
+%{demo_dir}
%files docs
%defattr(-,root,root,755)
@@ -362,6 +368,10 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Tue Aug 31 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-10
+- Fixed bug #77418 (Demo dir not packaged)
+- More tweaking on #19347 (Moved Tools/ under /usr/lib/python2.3/Tools)
+
* Fri Aug 13 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-8
- Fixed bug #129769: Makefile in new python conflicts with older version found
in old python-devel
commit 64c8a923d36e0c0cf10b0faee40314b1877c270d
Author: cvsdist <cvsdist(a)fedoraproject.org>
Date: Thu Sep 9 11:06:50 2004 +0000
auto-import changelog data from python-2.3.4-8.src.rpm
Fri Aug 13 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-8
- Fixed bug #129769: Makefile in new python conflicts with older version
found in old python-devel
- Reorganized the spec file to get rid of the aspython2 define;
__python_ver is more powerful.
diff --git a/python.spec b/python.spec
index 805e2a2..1b77e7a 100644
--- a/python.spec
+++ b/python.spec
@@ -1,10 +1,14 @@
-%define aspython2 0
+%{!?__python_ver:%define __python_ver EMPTY}
%define unicode ucs4
-%if %{aspython2}
-%define python python2
+%if "%{__python_ver}" != "EMPTY"
+%define main_python 0
+%define python python%{__python_ver}
+%define tkinter tkinter%{__python_ver}
%else
+%define main_python 1
%define python python
+%define tkinter tkinter
%endif
%define pybasever 2.3
@@ -14,7 +18,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.4
-Release: 7
+Release: 8
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -38,16 +42,14 @@ Patch12: python-2.3.2-nomkhowto.patch
Patch13: python-2.3.4-distutils-bdist-rpm.patch
Patch14: python-2.3.4-pydocnodoc.patch
-%if !%{aspython2}
+%if %{main_python}
+Obsoletes: Distutils
+Provides: Distutils
Obsoletes: python2
Provides: python2 = %{version}
BuildPrereq: db4-devel
%else
-BuildPrereq: db3-devel
-%endif
-%if !%{aspython2}
-Obsoletes: Distutils
-Provides: Distutils
+#BuildPrereq: db3-devel
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-root
@@ -79,7 +81,10 @@ package.
Summary: The libraries and header files needed for Python development.
Group: Development/Libraries
Requires: %{python} = %{version}-%{release}
-%if !%{aspython2}
+# Needed here because of the migration of Makefile from -devel to the main
+# package
+Conflicts: %{python} < %{version}-%{release}
+%if %{main_python}
Obsoletes: python2-devel
Provides: python2-devel = %{version}-%{release}
%endif
@@ -100,7 +105,7 @@ Summary: A collection of development tools included with Python.
Group: Development/Tools
Requires: %{name} = %{version}-%{release}
Requires: tkinter = %{version}-%{release}
-%if !%{aspython2}
+%if %{main_python}
Obsoletes: python2-tools
Provides: python2-tools = %{version}
%endif
@@ -113,7 +118,7 @@ to build python programs.
Summary: Documentation for the Python programming language.
Group: Documentation
Requires: %{name} = %{version}-%{release}
-%if !%{aspython2}
+%if %{main_python}
Obsoletes: python2-docs
Provides: python2-docs = %{version}
%endif
@@ -126,25 +131,17 @@ in ASCII text files and in LaTeX source files.
Install the python-docs package if you'd like to use the documentation
for the Python language.
-%if !%{aspython2}
-%package -n tkinter
-%else
-%package -n tkinter2
-%endif
+%package -n %{tkinter}
Summary: A graphical user interface for the Python scripting language.
Group: Development/Languages
BuildPrereq: tcl, tk
Requires: %{name} = %{version}-%{release}
-%if !%{aspython2}
+%if %{main_python}
Obsoletes: tkinter2
Provides: tkinter2 = %{version}
%endif
-%if !%{aspython2}
-%description -n tkinter
-%else
-%description -n tkinter2
-%endif
+%description -n %{tkinter}
The Tkinter (Tk interface) program is an graphical user interface for
the Python scripting language.
@@ -226,11 +223,11 @@ for fixed in $RPM_BUILD_ROOT/usr/bin/pydoc; do
&& cat $fixed- > $fixed && rm -f $fixed-
done
-%if %{aspython2}
-mv $RPM_BUILD_ROOT/usr/bin/python $RPM_BUILD_ROOT/usr/bin/python2
-mv $RPM_BUILD_ROOT/%{_mandir}/man1/python.1
$RPM_BUILD_ROOT/%{_mandir}/man1/python%{pybasever}.1
-%else
+%if %{main_python}
ln -s python $RPM_BUILD_ROOT/usr/bin/python2
+%else
+mv $RPM_BUILD_ROOT/usr/bin/python $RPM_BUILD_ROOT/usr/bin/%{python}
+mv $RPM_BUILD_ROOT/%{_mandir}/man1/python.1
$RPM_BUILD_ROOT/%{_mandir}/man1/python%{pybasever}.1
%endif
# tools
@@ -273,15 +270,15 @@ find $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/test \
rm -f $RPM_BUILD_ROOT%{_libdir}/python2.2/LICENSE.txt
-#make the binaries install side by side with python 1
-%if %{aspython2}
+#make the binaries install side by side with the main python
+%if !%{main_python}
pushd $RPM_BUILD_ROOT/usr/bin
-mv idle idle2
-mv modulator modulator2
-mv pynche pynche2
-mv pygettext.py pygettext2.py
-mv msgfmt.py msgfmt2.py
-mv pydoc pydoc2
+mv idle idle%{__python_ver}
+mv modulator modulator%{__python_ver}
+mv pynche pynche%{__python_ver}
+mv pygettext.py pygettext%{__python_ver}.py
+mv msgfmt.py msgfmt%{__python_ver}.py
+mv pydoc pydoc%{__python_ver}
popd
%endif
@@ -306,14 +303,6 @@ rm -fr $RPM_BUILD_ROOT
%defattr(-, root, root)
%doc LICENSE README
/usr/bin/python*
-%if %{aspython2}
-/usr/bin/idle2
-/usr/bin/modulator2
-/usr/bin/msgfmt2.py
-/usr/bin/pydoc2
-/usr/bin/pygettext2.py
-/usr/bin/pynche2
-%endif
%{_mandir}/*/*
%{_libdir}/libpython%{pybasever}.so*
@@ -348,7 +337,6 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/config
%{_libdir}/python%{pybasever}/test
-%if !%{aspython2}
%files tools
%defattr(-,root,root,755)
%doc Tools/modulator/README.modulator
@@ -360,25 +348,26 @@ rm -fr $RPM_BUILD_ROOT
/usr/bin/pynche*
/usr/bin/pygettext*.py
/usr/bin/msgfmt*.py
-/usr/bin/pydoc
+/usr/bin/pydoc*
%{tools_dir}
-%endif
%files docs
%defattr(-,root,root,755)
%doc Misc/NEWS Misc/README Misc/cheatsheet
%doc Misc/HISTORY Doc/html
-%if !%{aspython2}
-%files -n tkinter
-%else
-%files -n tkinter2
-%endif
+%files -n %{tkinter}
%defattr(-,root,root,755)
%{_libdir}/python%{pybasever}/lib-tk
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Fri Aug 13 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-8
+- Fixed bug #129769: Makefile in new python conflicts with older version found
+ in old python-devel
+- Reorganized the spec file to get rid of the aspython2 define; __python_ver
+ is more powerful.
+
* Tue Aug 3 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-7
- Including html documentation for non-i386 arches
- Fixed #125362 (python-doc html files have japanese character encoding)
commit 8caa1f32038e92d72c5b1e7f986fbb0c61cf5a91
Author: cvsdist <cvsdist(a)fedoraproject.org>
Date: Thu Sep 9 11:06:39 2004 +0000
auto-import changelog data from python-2.3.4-7.src.rpm
Tue Aug 03 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-7
- Including html documentation for non-i386 arches
- Fixed #125362 (python-doc html files have japanese character encoding)
- Fixed #128923 (missing dependency between python and python-devel)
diff --git a/python.spec b/python.spec
index da815f2..805e2a2 100644
--- a/python.spec
+++ b/python.spec
@@ -14,7 +14,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.4
-Release: 6
+Release: 7
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -78,9 +78,10 @@ package.
%package devel
Summary: The libraries and header files needed for Python development.
Group: Development/Libraries
+Requires: %{python} = %{version}-%{release}
%if !%{aspython2}
Obsoletes: python2-devel
-Provides: python2-devel = %{version}
+Provides: python2-devel = %{version}-%{release}
%endif
%description devel
@@ -97,8 +98,8 @@ documentation.
%package tools
Summary: A collection of development tools included with Python.
Group: Development/Tools
-Requires: %{name} = %{version}
-Requires: tkinter = %{version}
+Requires: %{name} = %{version}-%{release}
+Requires: tkinter = %{version}-%{release}
%if !%{aspython2}
Obsoletes: python2-tools
Provides: python2-tools = %{version}
@@ -111,6 +112,7 @@ to build python programs.
%package docs
Summary: Documentation for the Python programming language.
Group: Documentation
+Requires: %{name} = %{version}-%{release}
%if !%{aspython2}
Obsoletes: python2-docs
Provides: python2-docs = %{version}
@@ -132,7 +134,7 @@ for the Python language.
Summary: A graphical user interface for the Python scripting language.
Group: Development/Languages
BuildPrereq: tcl, tk
-Requires: %{name} = %{version}
+Requires: %{name} = %{version}-%{release}
%if !%{aspython2}
Obsoletes: tkinter2
Provides: tkinter2 = %{version}
@@ -201,12 +203,10 @@ make OPT="$CFLAGS" %{?_smp_mflags}
LD_LIBRARY_PATH=$topdir $topdir/python Tools/scripts/pathfix.py -i "/usr/bin/env
python%{pybasever}" .
make OPT="$CFLAGS" %{?_smp_mflags}
-%ifarch i386
pushd Doc
LD_LIBRARY_PATH=$topdir make PYTHON=$topdir/python
rm html/index.html.in Makefile* info/Makefile tools/sgmlconv/Makefile
popd
-%endif
%install
[ -d $RPM_BUILD_ROOT ] && rm -fr $RPM_BUILD_ROOT
@@ -379,6 +379,11 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Tue Aug 3 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-7
+- Including html documentation for non-i386 arches
+- Fixed #125362 (python-doc html files have japanese character encoding)
+- Fixed #128923 (missing dependency between python and python-devel)
+
* Fri Jul 30 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-6
- Fixed #128030 (help() not printing anything)
- Fixed #125472 (distutils.sysconfig.get_python_lib() not returning the right
commit 2f0d566bddfdc44a736d39928226a61bb7c7195b
Author: cvsdist <cvsdist(a)fedoraproject.org>
Date: Thu Sep 9 11:06:32 2004 +0000
auto-import changelog data from python-2.3.4-6.src.rpm
Fri Jul 30 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-6
- Fixed #128030 (help() not printing anything)
- Fixed #125472 (distutils.sysconfig.get_python_lib() not returning the
right path on 64-bit systems)
- Fixed #127357 (building python as a shared library)
- Fixed #19347 (including the contents of Tools/scripts/ in python-tools)
diff --git a/python-2.3.4-pydocnodoc.patch b/python-2.3.4-pydocnodoc.patch
new file mode 100644
index 0000000..f2c1af3
--- /dev/null
+++ b/python-2.3.4-pydocnodoc.patch
@@ -0,0 +1,10 @@
+--- Python-2.3.4/Lib/pydoc.py.no-doc 2004-07-16 11:29:01.000000000 -0400
++++ Python-2.3.4/Lib/pydoc.py 2004-07-16 11:32:52.000000000 -0400
+@@ -1524,6 +1524,7 @@
+ homedir = os.environ.get('PYTHONHOME')
+ for dir in [os.environ.get('PYTHONDOCS'),
+ homedir and os.path.join(homedir, 'doc'),
++ '/usr/share/doc/python-docs-%s/html' %
split(sys.version)[0],
+ os.path.join(execdir, 'doc'),
+ '/usr/doc/python-docs-' + split(sys.version)[0],
+ '/usr/doc/python-' + split(sys.version)[0],
diff --git a/python.spec b/python.spec
index c2d5937..da815f2 100644
--- a/python.spec
+++ b/python.spec
@@ -9,11 +9,12 @@
%define pybasever 2.3
%define jp_codecs 1.4.9
+%define tools_dir %{_datadir}/python%{pybasever}/Tools
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.4
-Release: 4
+Release: 6
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -35,6 +36,7 @@ Patch8: python-2.3.2-lib64.patch
Patch9: japanese-codecs-lib64.patch
Patch12: python-2.3.2-nomkhowto.patch
Patch13: python-2.3.4-distutils-bdist-rpm.patch
+Patch14: python-2.3.4-pydocnodoc.patch
%if !%{aspython2}
Obsoletes: python2
@@ -161,6 +163,7 @@ user interface for Python programming.
%endif
%patch12 -p1 -b .nomkhowto
%patch13 -p1 -b .bdist-rpm
+%patch14 -p1 -b .no-doc
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -192,15 +195,15 @@ if pkg-config openssl ; then
fi
# Force CC
export CC=gcc
-%configure --enable-ipv6 --enable-unicode=%{unicode}
+%configure --enable-ipv6 --enable-unicode=%{unicode} --enable-shared
make OPT="$CFLAGS" %{?_smp_mflags}
-$topdir/python Tools/scripts/pathfix.py -i "/usr/bin/env python%{pybasever}" .
+LD_LIBRARY_PATH=$topdir $topdir/python Tools/scripts/pathfix.py -i "/usr/bin/env
python%{pybasever}" .
make OPT="$CFLAGS" %{?_smp_mflags}
%ifarch i386
pushd Doc
-make PYTHON=$topdir/python
+LD_LIBRARY_PATH=$topdir make PYTHON=$topdir/python
rm html/index.html.in Makefile* info/Makefile tools/sgmlconv/Makefile
popd
%endif
@@ -252,6 +255,10 @@ mv Tools/pynche/README Tools/pynche/README.pynche
install -m755 Tools/i18n/pygettext.py $RPM_BUILD_ROOT/usr/bin/
install -m755 Tools/i18n/msgfmt.py $RPM_BUILD_ROOT/usr/bin/
+# Useful development tools
+install -m755 -d $RPM_BUILD_ROOT%{tools_dir}
+install Tools/scripts/*py $RPM_BUILD_ROOT%{tools_dir}
+
# Get rid of crap
find $RPM_BUILD_ROOT/ -name "*~"|xargs rm -f
find $RPM_BUILD_ROOT/ -name ".cvsignore"|xargs rm -f
@@ -280,7 +287,8 @@ popd
# Japanese codecs
pushd JapaneseCodecs-%{jp_codecs}
-PYTHONHOME=$RPM_BUILD_ROOT/usr $RPM_BUILD_ROOT/usr/bin/%{python} setup.py \
+LD_LIBRARY_PATH=$RPM_BUILD_ROOT/%{_libdir} PYTHONHOME=$RPM_BUILD_ROOT/usr \
+ $RPM_BUILD_ROOT/usr/bin/%{python} setup.py \
install \
--install-scripts=$RPM_BUILD_ROOT/%{_prefix}/bin \
--install-purelib=$RPM_BUILD_ROOT/%{_libdir}/python%{pybasever}/site-packages \
@@ -307,7 +315,9 @@ rm -fr $RPM_BUILD_ROOT
/usr/bin/pynche2
%endif
%{_mandir}/*/*
+%{_libdir}/libpython%{pybasever}.so*
+%dir %{_datadir}/python%{pybasever}
%dir %{_libdir}/python%{pybasever}
%dir %{_libdir}/python%{pybasever}/lib-dynload
%dir %{_libdir}/python%{pybasever}/lib-dynload/japanese
@@ -351,6 +361,7 @@ rm -fr $RPM_BUILD_ROOT
/usr/bin/pygettext*.py
/usr/bin/msgfmt*.py
/usr/bin/pydoc
+%{tools_dir}
%endif
%files docs
@@ -368,6 +379,13 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Fri Jul 30 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-6
+- Fixed #128030 (help() not printing anything)
+- Fixed #125472 (distutils.sysconfig.get_python_lib() not returning the right
+ path on 64-bit systems)
+- Fixed #127357 (building python as a shared library)
+- Fixed #19347 (including the contents of Tools/scripts/ in python-tools)
+
* Tue Jun 15 2004 Elliot Lee <sopwith(a)redhat.com>
- rebuilt
commit d69cacc0e75e287e0bbe25a10b7d061c85f06d37
Author: cvsdist <cvsdist(a)fedoraproject.org>
Date: Thu Sep 9 11:06:17 2004 +0000
auto-import changelog data from python-2.3.4-4.src.rpm
Tue Jun 15 2004 Elliot Lee <sopwith(a)redhat.com>
- rebuilt
diff --git a/python.spec b/python.spec
index ce4461d..c2d5937 100644
--- a/python.spec
+++ b/python.spec
@@ -13,7 +13,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.4
-Release: 3
+Release: 4
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -368,6 +368,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Tue Jun 15 2004 Elliot Lee <sopwith(a)redhat.com>
+- rebuilt
+
* Tue Jun 8 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-3
- Added an optik.py that provides the same interface from optparse for
backward compatibility; obsoleting python-optik
commit 44438bfc5391cee8e8ade8bf2c14aa837ce223af
Author: cvsdist <cvsdist(a)fedoraproject.org>
Date: Thu Sep 9 11:06:02 2004 +0000
auto-import changelog data from python-2.3.4-3.src.rpm
Tue Jun 08 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-3
- Added an optik.py that provides the same interface from optparse for
backward compatibility; obsoleting python-optik
diff --git a/python.spec b/python.spec
index 21d1df8..ce4461d 100644
--- a/python.spec
+++ b/python.spec
@@ -13,15 +13,19 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.4
-Release: 2
+Release: 3
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
+# optik is part of python 2.3 as optparse
+Provides: python-optik = 1.4.1
+Obsoletes: python-optik
Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
Source3: modulator
Source4: pynche
Source5:
http://www.python.jp/pub/JapaneseCodecs/JapaneseCodecs-%{jp_codecs}.tar.gz
Source6:
http://gigue.peabody.jhu.edu/~mdboom/omi/source/shm_source/shmmodule.c
+Source7: python-2.3.4-optik.py
Patch0: python-2.3-config.patch
Patch3: Python-2.2.1-pydocnogui.patch
@@ -173,6 +177,9 @@ cat >> Modules/Setup.dist << EOF
shm shmmodule.c
EOF
+# Backwards compatible optik
+install -m 0644 %{SOURCE7} Lib/optik.py
+
%build
topdir=`pwd`
export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC"
@@ -361,6 +368,10 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Tue Jun 8 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-3
+- Added an optik.py that provides the same interface from optparse for
+ backward compatibility; obsoleting python-optik
+
* Mon Jun 7 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-2
- Patched bdist_rpm to allow for builds of multiple binary rpms (bug #123598)
commit dbf0728637a2f87a5657048a6f4bf01603d97811
Author: cvsdist <cvsdist(a)fedoraproject.org>
Date: Thu Sep 9 11:05:46 2004 +0000
auto-import changelog data from python-2.3.4-2.src.rpm
Mon Jun 07 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-2
- Patched bdist_rpm to allow for builds of multiple binary rpms (bug
#123598)
diff --git a/python.spec b/python.spec
index 1569cb2..21d1df8 100644
--- a/python.spec
+++ b/python.spec
@@ -13,7 +13,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.4
-Release: 1
+Release: 2
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -30,6 +30,7 @@ Patch7: python-2.3.4-lib64-regex.patch
Patch8: python-2.3.2-lib64.patch
Patch9: japanese-codecs-lib64.patch
Patch12: python-2.3.2-nomkhowto.patch
+Patch13: python-2.3.4-distutils-bdist-rpm.patch
%if !%{aspython2}
Obsoletes: python2
@@ -155,6 +156,7 @@ user interface for Python programming.
%patch9 -p0 -b .lib64-j
%endif
%patch12 -p1 -b .nomkhowto
+%patch13 -p1 -b .bdist-rpm
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -359,6 +361,9 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Mon Jun 7 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-2
+- Patched bdist_rpm to allow for builds of multiple binary rpms (bug #123598)
+
* Fri Jun 4 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-1
- Updated to 2.3.4-1 with Robert Scheck's help (bug #124764)
- Added BuildRequires: tix-devel (bug #124918)
commit f79a121c9522ba620f26ff9ac86deb445096b823
Author: cvsdist <cvsdist(a)fedoraproject.org>
Date: Thu Sep 9 11:05:41 2004 +0000
auto-import changelog data from python-2.3.4-1.src.rpm
Fri Jun 04 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-1
- Updated to 2.3.4-1 with Robert Scheck's help (bug #124764)
- Added BuildRequires: tix-devel (bug #124918)
diff --git a/.cvsignore b/.cvsignore
index c3ba62e..f7b6955 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -1,2 +1,2 @@
JapaneseCodecs-1.4.9.tar.gz
-Python-2.3.3.tar.bz2
+Python-2.3.4.tar.bz2
diff --git a/python-2.3.4-lib64-regex.patch b/python-2.3.4-lib64-regex.patch
new file mode 100644
index 0000000..2b38d4c
--- /dev/null
+++ b/python-2.3.4-lib64-regex.patch
@@ -0,0 +1,18 @@
+--- Python-2.3.4/Lib/test/test_re.py 2004-04-20 23:32:33.000000000 +0200
++++ Python-2.3.4/Lib/test/test_re.py.lib64-regex 2004-05-29 17:36:52.000000000 +0200
+@@ -497,6 +497,15 @@
+ self.assert_(re.compile('bug_926075') is not
+ re.compile(eval("u'bug_926075'")))
+
++ def test_bug_931848(self):
++ try:
++ unicode
++ except NameError:
++ pass
++ pattern = eval('u"[\u002E\u3002\uFF0E\uFF61]"')
++ self.assertEqual(re.compile(pattern).split("a.b.c"),
++ ['a','b','c'])
++
+ def run_re_tests():
+ from test.re_tests import benchmarks, tests, SUCCEED, FAIL, SYNTAX_ERROR
+ if verbose:
diff --git a/python.spec b/python.spec
index 10491bd..1569cb2 100644
--- a/python.spec
+++ b/python.spec
@@ -12,8 +12,8 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
-Version: %{pybasever}.3
-Release: 6
+Version: %{pybasever}.4
+Release: 1
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -26,11 +26,9 @@ Source6:
http://gigue.peabody.jhu.edu/~mdboom/omi/source/shm_source/shmmodule.c
Patch0: python-2.3-config.patch
Patch3: Python-2.2.1-pydocnogui.patch
Patch4: python-2.3-nowhatsnew.patch
-Patch7: python-2.3.3-lib64-regex.patch
+Patch7: python-2.3.4-lib64-regex.patch
Patch8: python-2.3.2-lib64.patch
Patch9: japanese-codecs-lib64.patch
-Patch10: python-2.2.2-urllib2-nonanonftp.patch
-Patch11: python-2.2.2-ftpuri.patch
Patch12: python-2.3.2-nomkhowto.patch
%if !%{aspython2}
@@ -50,6 +48,7 @@ BuildPrereq: readline-devel, libtermcap-devel, openssl-devel, gmp-devel
BuildPrereq: ncurses-devel, gdbm-devel, zlib-devel, expat-devel, tetex-latex
BuildPrereq: Mesa-devel tk tix gcc-c++ XFree86-devel glibc-devel
BuildPrereq: gzip tar /usr/bin/find pkgconfig tcl-devel tk-devel
+BuildPrereq: tix-devel
URL:
http://www.python.org/
%description
@@ -151,12 +150,10 @@ user interface for Python programming.
%patch3 -p1 -b .no_gui
%patch4 -p1
%if %{_lib} == lib64
-%patch7 -p0 -b .lib64-regex
+%patch7 -p1 -b .lib64-regex
%patch8 -p1 -b .lib64
%patch9 -p0 -b .lib64-j
%endif
-%patch10 -p1 -b .nonanonftp
-%patch11 -p1 -b .ftpuri
%patch12 -p1 -b .nomkhowto
# This shouldn't be necesarry, but is right now (2.2a3)
@@ -362,6 +359,10 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Fri Jun 4 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.4-1
+- Updated to 2.3.4-1 with Robert Scheck's help (bug #124764)
+- Added BuildRequires: tix-devel (bug #124918)
+
* Fri May 7 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.3-6
- Correct fix for #122304 from upstream:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=93184...
diff --git a/sources b/sources
index 1acf171..ee1e112 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
13198f9b425dd44fc94af45afe47b94d JapaneseCodecs-1.4.9.tar.gz
-70ada9f65742ab2c77a96bcd6dffd9b1 Python-2.3.3.tar.bz2
+a2c089faa2726c142419c03472fc4063 Python-2.3.4.tar.bz2
commit dfe379ccd64001b11fbcbba70836ecf20f476bde
Author: cvsdist <cvsdist(a)fedoraproject.org>
Date: Thu Sep 9 11:05:28 2004 +0000
auto-import changelog data from python-2.3.3-6.src.rpm
Fri May 07 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.3-6
- Correct fix for #122304 from upstream:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=93184...
p_id=5470
Thu May 06 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.3-4
- Fix for bug #122304 : splitting the domain name fails on 64-bit arches
- Fix for bug #120879 : including Makefile into the main package
- Requires XFree86-devel instead of -libs (see bug #118442)
diff --git a/python.spec b/python.spec
index 1b474d7..10491bd 100644
--- a/python.spec
+++ b/python.spec
@@ -13,7 +13,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.3
-Release: 3
+Release: 6
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -26,6 +26,7 @@ Source6:
http://gigue.peabody.jhu.edu/~mdboom/omi/source/shm_source/shmmodule.c
Patch0: python-2.3-config.patch
Patch3: Python-2.2.1-pydocnogui.patch
Patch4: python-2.3-nowhatsnew.patch
+Patch7: python-2.3.3-lib64-regex.patch
Patch8: python-2.3.2-lib64.patch
Patch9: japanese-codecs-lib64.patch
Patch10: python-2.2.2-urllib2-nonanonftp.patch
@@ -150,6 +151,7 @@ user interface for Python programming.
%patch3 -p1 -b .no_gui
%patch4 -p1
%if %{_lib} == lib64
+%patch7 -p0 -b .lib64-regex
%patch8 -p1 -b .lib64
%patch9 -p0 -b .lib64-j
%endif
@@ -310,6 +312,8 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/*.py*
%{_libdir}/python%{pybasever}/*.doc
%{_libdir}/python%{pybasever}/bsddb
+%dir %{_libdir}/python%{pybasever}/config
+%{_libdir}/python%{pybasever}/config/Makefile
%{_libdir}/python%{pybasever}/curses
%{_libdir}/python%{pybasever}/distutils
%{_libdir}/python%{pybasever}/encodings
@@ -358,6 +362,16 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Fri May 7 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.3-6
+- Correct fix for #122304 from upstream:
+
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=93184...
+
+* Thu May 6 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.3-4
+- Fix for bug #122304 : splitting the domain name fails on 64-bit arches
+- Fix for bug #120879 : including Makefile into the main package
+
+- Requires XFree86-devel instead of -libs (see bug #118442)
+
* Tue Mar 16 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.3-3
- Requires XFree86-devel instead of -libs (see bug #118442)
commit 81b4fc6d8658a76c79d0fb1fb473426838ed5d02
Author: cvsdist <cvsdist(a)fedoraproject.org>
Date: Thu Sep 9 11:04:38 2004 +0000
auto-import changelog data from python-2.3.3-3.src.rpm
Tue Mar 16 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.3-3
- Requires XFree86-devel instead of -libs (see bug #118442)
Tue Mar 02 2004 Elliot Lee <sopwith(a)redhat.com>
- rebuilt
Fri Feb 13 2004 Elliot Lee <sopwith(a)redhat.com>
- rebuilt
diff --git a/python.spec b/python.spec
index a8bd8e6..1b474d7 100644
--- a/python.spec
+++ b/python.spec
@@ -13,7 +13,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: %{pybasever}.3
-Release: 1
+Release: 3
License: PSF - see LICENSE
Group: Development/Languages
Provides: python-abi = %{pybasever}
@@ -47,7 +47,7 @@ Provides: Distutils
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildPrereq: readline-devel, libtermcap-devel, openssl-devel, gmp-devel
BuildPrereq: ncurses-devel, gdbm-devel, zlib-devel, expat-devel, tetex-latex
-BuildPrereq: Mesa-devel tk tix gcc-c++ XFree86-libs glibc-devel
+BuildPrereq: Mesa-devel tk tix gcc-c++ XFree86-devel glibc-devel
BuildPrereq: gzip tar /usr/bin/find pkgconfig tcl-devel tk-devel
URL:
http://www.python.org/
@@ -358,6 +358,15 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Tue Mar 16 2004 Mihai Ibanescu <misa(a)redhat.com> 2.3.3-3
+- Requires XFree86-devel instead of -libs (see bug #118442)
+
+* Tue Mar 02 2004 Elliot Lee <sopwith(a)redhat.com>
+- rebuilt
+
+* Fri Feb 13 2004 Elliot Lee <sopwith(a)redhat.com>
+- rebuilt
+
* Fri Dec 19 2003 Jeff Johnson <jbj(a)jbj.org> 2.3.3-1
- upgrade to 2.3.3.
commit d855cb18b0cf2d398f8336d510b119718533ae81
Author: cvsdist <cvsdist(a)fedoraproject.org>
Date: Thu Sep 9 11:03:56 2004 +0000
auto-import changelog data from python-2.3.3-1.src.rpm
Fri Dec 19 2003 Jeff Johnson <jbj(a)jbj.org> 2.3.3-1
- upgrade to 2.3.3.
Sat Dec 13 2003 Jeff Johnson <jbj(a)jbj.org> 2.3.2-9
- rebuild against db-4.2.52.
Fri Dec 12 2003 Jeremy Katz <katzj(a)redhat.com> 2.3.2-8
- more rebuilding for new tcl/tk
Wed Dec 03 2003 Jeff Johnson <jbj(a)jbj.org> 2.3.2-7.1
- rebuild against db-4.2.42.
Fri Nov 28 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.2-7
- rebuilt against newer tcl/tk
Mon Nov 24 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.2-6
- added a Provides: python-abi
Wed Nov 12 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.2-5
- force CC (#109268)
Sun Nov 09 2003 Jeremy Katz <katzj(a)redhat.com> 2.3.2-4
- cryptmodule still needs -lcrypt
Wed Nov 05 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.2-2
- Added patch for missing mkhowto
Thu Oct 16 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.2-1
- Updated to 2.3.2
diff --git a/.cvsignore b/.cvsignore
index 83076a6..c3ba62e 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -1,2 +1,2 @@
JapaneseCodecs-1.4.9.tar.gz
-Python-2.2.3.tgz
+Python-2.3.3.tar.bz2
diff --git a/python.spec b/python.spec
index f83e085..a8bd8e6 100644
--- a/python.spec
+++ b/python.spec
@@ -7,37 +7,30 @@
%define python python
%endif
-%define pybasever 2.2
+%define pybasever 2.3
%define jp_codecs 1.4.9
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
-Version: 2.2.3
-Release: 7
+Version: %{pybasever}.3
+Release: 1
License: PSF - see LICENSE
Group: Development/Languages
-Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tgz
-Source2: idle
+Provides: python-abi = %{pybasever}
+Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
Source3: modulator
Source4: pynche
Source5:
http://www.python.jp/pub/JapaneseCodecs/JapaneseCodecs-%{jp_codecs}.tar.gz
Source6:
http://gigue.peabody.jhu.edu/~mdboom/omi/source/shm_source/shmmodule.c
-%if !%{aspython2}
-Patch0: python-2.2.2-config2.patch
-%else
-Patch0: python-2.2.2-config.patch
-%endif
-Patch1: python-2.2b1-buildroot.patch
+Patch0: python-2.3-config.patch
Patch3: Python-2.2.1-pydocnogui.patch
-Patch4: Python-2.2.1-nowhatsnew.patch
-Patch5: Python-2.2.1-distutilrpm.patch
-Patch7: Python-2.2.1-buildroot-bytecode.patch
-Patch8: python-2.2.2-lib64.patch
+Patch4: python-2.3-nowhatsnew.patch
+Patch8: python-2.3.2-lib64.patch
Patch9: japanese-codecs-lib64.patch
Patch10: python-2.2.2-urllib2-nonanonftp.patch
Patch11: python-2.2.2-ftpuri.patch
-Patch12: python-2.2.3-gnumo.patch
+Patch12: python-2.3.2-nomkhowto.patch
%if !%{aspython2}
Obsoletes: python2
@@ -154,18 +147,15 @@ user interface for Python programming.
%setup -q -n Python-%{version} -a 5
%patch0 -p1 -b .rhconfig
-%patch1 -p1
%patch3 -p1 -b .no_gui
%patch4 -p1
-%patch5 -p1
-%patch7 -p1 -b .bad-bytecode-path
%if %{_lib} == lib64
%patch8 -p1 -b .lib64
%patch9 -p0 -b .lib64-j
%endif
%patch10 -p1 -b .nonanonftp
%patch11 -p1 -b .ftpuri
-%patch12 -p1 -b .gnumo
+%patch12 -p1 -b .nomkhowto
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -192,6 +182,8 @@ if pkg-config openssl ; then
export CFLAGS="$CFLAGS `pkg-config --cflags openssl`"
export LDFLAGS="$LDFLAGS `pkg-config --libs-only-L openssl`"
fi
+# Force CC
+export CC=gcc
%configure --enable-ipv6 --enable-unicode=%{unicode}
make OPT="$CFLAGS" %{?_smp_mflags}
@@ -232,12 +224,7 @@ ln -s python $RPM_BUILD_ROOT/usr/bin/python2
# tools
-# idle
mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/python%{pybasever}/site-packages
-install -m 755 $RPM_SOURCE_DIR/idle ${RPM_BUILD_ROOT}/usr/bin/idle
-mkdir -p $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/site-packages/idle
-cp -R Tools/idle/* $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/site-packages/idle
-
#modulator
install -m 755 $RPM_SOURCE_DIR/modulator ${RPM_BUILD_ROOT}/usr/bin/modulator
@@ -294,19 +281,13 @@ install \
--root=/
popd
-find $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/lib-dynload -type f | grep -v
_tkinter.so | grep -v japanese.pth | sed "s|$RPM_BUILD_ROOT||" >
dynfiles-all
-grep "\.so$" dynfiles-all | awk '{print "%attr(555,root,root)",
$1}' > dynfiles
-grep -v "\.so$" dynfiles-all >> dynfiles
-
-# Make the libraries user-writeable, so that we can strip them
-find $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/lib-dynload -type f \
- -name "*.so" -exec chmod 755 {} \;
+find $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/lib-dynload -type f | grep -v
_tkinter.so | sed "s|$RPM_BUILD_ROOT||" > dynfiles
%clean
rm -fr $RPM_BUILD_ROOT
%files -f dynfiles
-%defattr(-,root,root)
+%defattr(-, root, root)
%doc LICENSE README
/usr/bin/python*
%if %{aspython2}
@@ -323,13 +304,18 @@ rm -fr $RPM_BUILD_ROOT
%dir %{_libdir}/python%{pybasever}/lib-dynload
%dir %{_libdir}/python%{pybasever}/lib-dynload/japanese
%{_libdir}/python%{pybasever}/site-packages/japanese.pth
+%dir %{_libdir}/python%{pybasever}/site-packages
+%{_libdir}/python%{pybasever}/site-packages/README
+%{_libdir}/python%{pybasever}/LICENSE.txt
%{_libdir}/python%{pybasever}/*.py*
%{_libdir}/python%{pybasever}/*.doc
+%{_libdir}/python%{pybasever}/bsddb
%{_libdir}/python%{pybasever}/curses
%{_libdir}/python%{pybasever}/distutils
%{_libdir}/python%{pybasever}/encodings
+%{_libdir}/python%{pybasever}/idlelib
%{_libdir}/python%{pybasever}/lib-old
-%{_libdir}/python%{pybasever}/site-packages
+%{_libdir}/python%{pybasever}/logging
%{_libdir}/python%{pybasever}/xml
%{_libdir}/python%{pybasever}/email
%{_libdir}/python%{pybasever}/compiler
@@ -347,12 +333,8 @@ rm -fr $RPM_BUILD_ROOT
%defattr(-,root,root,755)
%doc Tools/modulator/README.modulator
%doc Tools/pynche/README.pynche
-%doc Tools/idle/*.txt
-%dir %{_libdir}/python%{pybasever}/site-packages/idle
-%dir %{_libdir}/python%{pybasever}/site-packages/modulator
-%dir %{_libdir}/python%{pybasever}/site-packages/modulator/Templates
-%dir %{_libdir}/python%{pybasever}/site-packages/pynche
-%dir %{_libdir}/python%{pybasever}/site-packages/pynche/X
+%{_libdir}/python%{pybasever}/site-packages/modulator
+%{_libdir}/python%{pybasever}/site-packages/pynche
/usr/bin/idle*
/usr/bin/modulator*
/usr/bin/pynche*
@@ -371,20 +353,53 @@ rm -fr $RPM_BUILD_ROOT
%else
%files -n tkinter2
%endif
-%defattr(755,root,root)
+%defattr(-,root,root,755)
%{_libdir}/python%{pybasever}/lib-tk
-%attr(555,root,root) %{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
+%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
-* Wed Oct 15 2003 Jeremy Katz <katzj(a)redhat.com> 2.2.3-7
-- use the simpler heuristic for finding the GNU .mo metadata
- from python 2.3 (#97796)
+* Fri Dec 19 2003 Jeff Johnson <jbj(a)jbj.org> 2.3.3-1
+- upgrade to 2.3.3.
+
+* Sat Dec 13 2003 Jeff Johnson <jbj(a)jbj.org> 2.3.2-9
+- rebuild against db-4.2.52.
+
+* Fri Dec 12 2003 Jeremy Katz <katzj(a)redhat.com> 2.3.2-8
+- more rebuilding for new tcl/tk
+
+* Wed Dec 3 2003 Jeff Johnson <jbj(a)jbj.org> 2.3.2-7.1
+- rebuild against db-4.2.42.
+
+* Fri Nov 28 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.2-7
+- rebuilt against newer tcl/tk
+
+* Mon Nov 24 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.2-6
+- added a Provides: python-abi
+
+* Wed Nov 12 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.2-5
+- force CC (#109268)
+
+* Sun Nov 9 2003 Jeremy Katz <katzj(a)redhat.com> 2.3.2-4
+- cryptmodule still needs -lcrypt
+
+* Wed Nov 5 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.2-2
+- Added patch for missing mkhowto
+
+* Thu Oct 16 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.2-1
+- Updated to 2.3.2
+
+* Thu Sep 25 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.1-1
+- 2.3.1 final
-* Mon Aug 18 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.3-6
-- lib-dynload files are not stripped (bug #97264)
+* Tue Sep 23 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3.1-0.8.RC1
+- Building the python 2.3.1 release candidate
+- Updated the lib64 patch
-* Fri Aug 8 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.3-5
-- Added missing BuildRequires (bug #101950)
+* Wed Jul 30 2003 Mihai Ibanescu <misa(a)redhat.com> 2.3-0.2
+- Building python 2.3
+- Added more BuildRequires
+- Updated the startup files for modulator and pynche; idle installs its own
+ now.
* Thu Jul 3 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.3-4
- Rebuilt against newer db4 packages (bug #98539)
diff --git a/sources b/sources
index 9454104..1acf171 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
13198f9b425dd44fc94af45afe47b94d JapaneseCodecs-1.4.9.tar.gz
-169f89f318e252dac0c54dd1b165d229 Python-2.2.3.tgz
+70ada9f65742ab2c77a96bcd6dffd9b1 Python-2.3.3.tar.bz2
commit bfd896bfafe7f37df3d96189fde31bec50ba0cae
Author: cvsdist <cvsdist(a)fedoraproject.org>
Date: Thu Sep 9 11:03:21 2004 +0000
auto-import changelog data from python-2.2.3-7.src.rpm
Wed Oct 15 2003 Jeremy Katz <katzj(a)redhat.com> 2.2.3-7
- use the simpler heuristic for finding the GNU .mo metadata from python
2.3 (#97796)
Mon Aug 18 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.3-6
- lib-dynload files are not stripped (bug #97264)
Fri Aug 08 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.3-5
- Added missing BuildRequires (bug #101950)
Thu Jul 03 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.3-4
- Rebuilt against newer db4 packages (bug #98539)
Mon Jun 09 2003 Elliot Lee <sopwith(a)redhat.com> 2.2.3-3
- rebuilt
Sat Jun 07 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.3-2
- Rebuilt
Fri Jun 06 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.3-1
- Upgraded to 2.2.3
Wed Apr 02 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-28
- Rebuilt
Wed Apr 02 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-27
- Modified the ftpuri patch conforming to
http://ietf.org/rfc/rfc1738.txt
diff --git a/.cvsignore b/.cvsignore
index 63e9c72..83076a6 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -1,2 +1,2 @@
JapaneseCodecs-1.4.9.tar.gz
-Python-2.2.2.tgz
+Python-2.2.3.tgz
diff --git a/python.spec b/python.spec
index a8fa373..f83e085 100644
--- a/python.spec
+++ b/python.spec
@@ -12,8 +12,8 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
-Version: 2.2.2
-Release: 26
+Version: 2.2.3
+Release: 7
License: PSF - see LICENSE
Group: Development/Languages
Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tgz
@@ -29,7 +29,6 @@ Patch0: python-2.2.2-config2.patch
Patch0: python-2.2.2-config.patch
%endif
Patch1: python-2.2b1-buildroot.patch
-Patch2: python-2.2-no_ndbm.patch
Patch3: Python-2.2.1-pydocnogui.patch
Patch4: Python-2.2.1-nowhatsnew.patch
Patch5: Python-2.2.1-distutilrpm.patch
@@ -38,6 +37,7 @@ Patch8: python-2.2.2-lib64.patch
Patch9: japanese-codecs-lib64.patch
Patch10: python-2.2.2-urllib2-nonanonftp.patch
Patch11: python-2.2.2-ftpuri.patch
+Patch12: python-2.2.3-gnumo.patch
%if !%{aspython2}
Obsoletes: python2
@@ -55,7 +55,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildPrereq: readline-devel, libtermcap-devel, openssl-devel, gmp-devel
BuildPrereq: ncurses-devel, gdbm-devel, zlib-devel, expat-devel, tetex-latex
BuildPrereq: Mesa-devel tk tix gcc-c++ XFree86-libs glibc-devel
-BuildPrereq: gzip tar /usr/bin/find pkgconfig
+BuildPrereq: gzip tar /usr/bin/find pkgconfig tcl-devel tk-devel
URL:
http://www.python.org/
%description
@@ -155,7 +155,6 @@ user interface for Python programming.
%patch0 -p1 -b .rhconfig
%patch1 -p1
-%patch2 -p1 -b .no_ndbm
%patch3 -p1 -b .no_gui
%patch4 -p1
%patch5 -p1
@@ -166,6 +165,7 @@ user interface for Python programming.
%endif
%patch10 -p1 -b .nonanonftp
%patch11 -p1 -b .ftpuri
+%patch12 -p1 -b .gnumo
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -294,13 +294,19 @@ install \
--root=/
popd
-find $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/lib-dynload -type f | grep -v
_tkinter.so | sed "s|$RPM_BUILD_ROOT||" > dynfiles
+find $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/lib-dynload -type f | grep -v
_tkinter.so | grep -v japanese.pth | sed "s|$RPM_BUILD_ROOT||" >
dynfiles-all
+grep "\.so$" dynfiles-all | awk '{print "%attr(555,root,root)",
$1}' > dynfiles
+grep -v "\.so$" dynfiles-all >> dynfiles
+
+# Make the libraries user-writeable, so that we can strip them
+find $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/lib-dynload -type f \
+ -name "*.so" -exec chmod 755 {} \;
%clean
rm -fr $RPM_BUILD_ROOT
%files -f dynfiles
-%defattr(-, root, root)
+%defattr(-,root,root)
%doc LICENSE README
/usr/bin/python*
%if %{aspython2}
@@ -365,11 +371,39 @@ rm -fr $RPM_BUILD_ROOT
%else
%files -n tkinter2
%endif
-%defattr(-,root,root,755)
+%defattr(755,root,root)
%{_libdir}/python%{pybasever}/lib-tk
-%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
+%attr(555,root,root) %{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Wed Oct 15 2003 Jeremy Katz <katzj(a)redhat.com> 2.2.3-7
+- use the simpler heuristic for finding the GNU .mo metadata
+ from python 2.3 (#97796)
+
+* Mon Aug 18 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.3-6
+- lib-dynload files are not stripped (bug #97264)
+
+* Fri Aug 8 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.3-5
+- Added missing BuildRequires (bug #101950)
+
+* Thu Jul 3 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.3-4
+- Rebuilt against newer db4 packages (bug #98539)
+
+* Mon Jun 9 2003 Elliot Lee <sopwith(a)redhat.com> 2.2.3-3
+- rebuilt
+
+* Wed Jun 7 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.3-2
+- Rebuilt
+
+* Tue Jun 6 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.3-1
+- Upgraded to 2.2.3
+
+* Wed Apr 2 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-28
+- Rebuilt
+
+* Wed Apr 2 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-27
+- Modified the ftpuri patch conforming to
http://ietf.org/rfc/rfc1738.txt
+
* Mon Feb 24 2003 Elliot Lee <sopwith(a)redhat.com>
- rebuilt
diff --git a/sources b/sources
index 8b5de2d..9454104 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
13198f9b425dd44fc94af45afe47b94d JapaneseCodecs-1.4.9.tar.gz
-1c1067396e5aa0299978486eb5bd1a5c Python-2.2.2.tgz
+169f89f318e252dac0c54dd1b165d229 Python-2.2.3.tgz
commit 20402fd181240acf56af4b9708495e94a846aef5
Author: cvsdist <cvsdist(a)fedoraproject.org>
Date: Thu Sep 9 11:02:53 2004 +0000
auto-import changelog data from python-2.2.2-26.src.rpm
Mon Feb 24 2003 Elliot Lee <sopwith(a)redhat.com>
- rebuilt
Mon Feb 24 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-25
- Fixed bug #84886: pydoc dies when run w/o arguments
- Fixed bug #84205: add python shm module back (used to be shipped with
1.5.2)
- Fixed bug #84966: path in byte-compiled code still wrong
Thu Feb 20 2003 Jeremy Katz <katzj(a)redhat.com> 2.2.2-23
- ftp uri's should be able to specify being rooted at the root instead of
where you login via ftp (#84692)
Mon Feb 10 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-22
- Using newer Japanese codecs (1.4.9). Thanks to Peter Bowen
<pzb(a)datastacks.com> for pointing this out.
Thu Feb 06 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-21
- Rebuild
Wed Feb 05 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-20
- Release number bumped really high: turning on UCS4 (ABI compatibility
breakage)
Fri Jan 31 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-13
- Attempt to look both in /usr/lib64 and /usr/lib/python2.2/site-packages/:
some work on python-2.2.2-lib64.patch
diff --git a/.cvsignore b/.cvsignore
index 798eee1..63e9c72 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -1,2 +1,2 @@
-JapaneseCodecs-1.4.6.tar.gz
+JapaneseCodecs-1.4.9.tar.gz
Python-2.2.2.tgz
diff --git a/Python-2.2.1-pydocnogui.patch b/Python-2.2.1-pydocnogui.patch
index 7209821..da22ac3 100644
--- a/Python-2.2.1-pydocnogui.patch
+++ b/Python-2.2.1-pydocnogui.patch
@@ -20,7 +20,7 @@
if opt == '-k':
apropos(val)
return
-@@ -2094,9 +2088,6 @@
+@@ -2099,13 +2093,10 @@
%s -p <port>
Start an HTTP server on the given port on the local machine.
@@ -30,3 +30,8 @@
%s -w <name> ...
Write out the HTML documentation for a module to a file in the current
directory. If <name> contains a '%s', it is treated as a filename;
if
+ it names a directory, documentation is written for all the contents.
+-""" % (cmd, os.sep, cmd, cmd, cmd, cmd, os.sep)
++""" % (cmd, os.sep, cmd, cmd, cmd, os.sep)
+
+ if __name__ == '__main__': cli()
diff --git a/python.spec b/python.spec
index acc5e14..a8fa373 100644
--- a/python.spec
+++ b/python.spec
@@ -1,4 +1,5 @@
%define aspython2 0
+%define unicode ucs4
%if %{aspython2}
%define python python2
@@ -7,18 +8,21 @@
%endif
%define pybasever 2.2
+%define jp_codecs 1.4.9
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: 2.2.2
-Release: 5
+Release: 26
License: PSF - see LICENSE
Group: Development/Languages
Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tgz
Source2: idle
Source3: modulator
Source4: pynche
-Source5:
http://www.python.jp/pub/JapaneseCodecs/JapaneseCodecs-1.4.6.tar.gz
+Source5:
http://www.python.jp/pub/JapaneseCodecs/JapaneseCodecs-%{jp_codecs}.tar.gz
+Source6:
http://gigue.peabody.jhu.edu/~mdboom/omi/source/shm_source/shmmodule.c
+
%if !%{aspython2}
Patch0: python-2.2.2-config2.patch
%else
@@ -31,7 +35,10 @@ Patch4: Python-2.2.1-nowhatsnew.patch
Patch5: Python-2.2.1-distutilrpm.patch
Patch7: Python-2.2.1-buildroot-bytecode.patch
Patch8: python-2.2.2-lib64.patch
-Patch9: japanese-codecs-1.4.6-lib64.patch
+Patch9: japanese-codecs-lib64.patch
+Patch10: python-2.2.2-urllib2-nonanonftp.patch
+Patch11: python-2.2.2-ftpuri.patch
+
%if !%{aspython2}
Obsoletes: python2
Provides: python2 = %{version}
@@ -43,10 +50,12 @@ BuildPrereq: db3-devel
Obsoletes: Distutils
Provides: Distutils
%endif
+
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildPrereq: readline-devel, libtermcap-devel, openssl-devel, gmp-devel
BuildPrereq: ncurses-devel, gdbm-devel, zlib-devel, expat-devel, tetex-latex
BuildPrereq: Mesa-devel tk tix gcc-c++ XFree86-libs glibc-devel
+BuildPrereq: gzip tar /usr/bin/find pkgconfig
URL:
http://www.python.org/
%description
@@ -147,39 +156,49 @@ user interface for Python programming.
%patch0 -p1 -b .rhconfig
%patch1 -p1
%patch2 -p1 -b .no_ndbm
-%patch3 -p1
+%patch3 -p1 -b .no_gui
%patch4 -p1
%patch5 -p1
%patch7 -p1 -b .bad-bytecode-path
+%if %{_lib} == lib64
%patch8 -p1 -b .lib64
%patch9 -p0 -b .lib64-j
+%endif
+%patch10 -p1 -b .nonanonftp
+%patch11 -p1 -b .ftpuri
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
-# Fix for lib/lib64
-for f in Lib/distutils/command/install.py Lib/distutils/sysconfig.py \
- Lib/site.py Modules/getpath.c Modules/Setup.dist setup.py \
- JapaneseCodecs-1.4.6/setup.py; do
- sed 's/@LIB@/%{_lib}/g' $f > $f- && cat $f- > $f
-done
+# Temporary workaround to avoid confusing find-requires: don't ship the tests
+# as executable files
+chmod 0644 Lib/test/test_*.py
+
+# shm module
+cp %{SOURCE6} Modules
+cat >> Modules/Setup.dist << EOF
-# This command drops the HTML files in the top-level build directory.
-# That's not perfect, but it will do for now.
+# Shared memory module
+shm shmmodule.c
+EOF
%build
+topdir=`pwd`
export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC"
export CXXFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC"
export OPT="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC"
export LINKCC="gcc"
-%configure --enable-ipv6 --enable-unicode=ucs2
+if pkg-config openssl ; then
+ export CFLAGS="$CFLAGS `pkg-config --cflags openssl`"
+ export LDFLAGS="$LDFLAGS `pkg-config --libs-only-L openssl`"
+fi
+%configure --enable-ipv6 --enable-unicode=%{unicode}
-make OPT="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC" %{?_smp_mflags}
-Tools/scripts/pathfix.py -i "/usr/bin/env python%{pybasever}" .
-make OPT="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC" %{?_smp_mflags}
+make OPT="$CFLAGS" %{?_smp_mflags}
+$topdir/python Tools/scripts/pathfix.py -i "/usr/bin/env python%{pybasever}" .
+make OPT="$CFLAGS" %{?_smp_mflags}
%ifarch i386
-topdir=`pwd`
pushd Doc
make PYTHON=$topdir/python
rm html/index.html.in Makefile* info/Makefile tools/sgmlconv/Makefile
@@ -190,7 +209,12 @@ popd
[ -d $RPM_BUILD_ROOT ] && rm -fr $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr $RPM_BUILD_ROOT%{_mandir}
-%makeinstall DESTDIR=/ MANDIR=$RPM_BUILD_ROOT/%{_mandir}
INCLUDEDIR=$RPM_BUILD_ROOT/%{_includedir} LIBDIR=$RPM_BUILD_ROOT/%{_libdir}
SCRIPTDIR=$RPM_BUILD_ROOT/%{_libdir} build_root=$RPM_BUILD_ROOT
+# Clean up patched .py files that are saved as .lib64
+for f in distutils/command/install distutils/sysconfig; do
+ rm -f Lib/$f.py.lib64
+done
+
+%makeinstall DESTDIR=/ MANDIR=$RPM_BUILD_ROOT%{_mandir}
INCLUDEDIR=$RPM_BUILD_ROOT%{_includedir} LIBDIR=$RPM_BUILD_ROOT%{_libdir}
SCRIPTDIR=$RPM_BUILD_ROOT%{_libdir} build_root=$RPM_BUILD_ROOT
# Fix the interpreter path in binaries installed by distutils
# (which changes them by itself)
# Make sure we preserve the file permissions
@@ -260,11 +284,12 @@ popd
%endif
# Japanese codecs
-pushd JapaneseCodecs-1.4.6
-$RPM_BUILD_ROOT/usr/bin/%{python} setup.py install \
+pushd JapaneseCodecs-%{jp_codecs}
+PYTHONHOME=$RPM_BUILD_ROOT/usr $RPM_BUILD_ROOT/usr/bin/%{python} setup.py \
+install \
--install-scripts=$RPM_BUILD_ROOT/%{_prefix}/bin \
---install-purelib=$RPM_BUILD_ROOT/%{_libdir}/%{name}%{pybasever}/site-packages \
---install-platlib=$RPM_BUILD_ROOT/%{_libdir}/%{name}%{pybasever}/lib-dynload \
+--install-purelib=$RPM_BUILD_ROOT/%{_libdir}/python%{pybasever}/site-packages \
+--install-platlib=$RPM_BUILD_ROOT/%{_libdir}/python%{pybasever}/lib-dynload \
--install-data=$RPM_BUILD_ROOT/%{_exec_prefix} \
--root=/
popd
@@ -278,6 +303,14 @@ rm -fr $RPM_BUILD_ROOT
%defattr(-, root, root)
%doc LICENSE README
/usr/bin/python*
+%if %{aspython2}
+/usr/bin/idle2
+/usr/bin/modulator2
+/usr/bin/msgfmt2.py
+/usr/bin/pydoc2
+/usr/bin/pygettext2.py
+/usr/bin/pynche2
+%endif
%{_mandir}/*/*
%dir %{_libdir}/python%{pybasever}
@@ -337,6 +370,74 @@ rm -fr $RPM_BUILD_ROOT
%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Mon Feb 24 2003 Elliot Lee <sopwith(a)redhat.com>
+- rebuilt
+
+* Mon Feb 24 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-25
+- Fixed bug #84886: pydoc dies when run w/o arguments
+- Fixed bug #84205: add python shm module back (used to be shipped with 1.5.2)
+- Fixed bug #84966: path in byte-compiled code still wrong
+
+* Thu Feb 20 2003 Jeremy Katz <katzj(a)redhat.com> 2.2.2-23
+- ftp uri's should be able to specify being rooted at the root instead of
+ where you login via ftp (#84692)
+
+* Mon Feb 10 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-22
+- Using newer Japanese codecs (1.4.9). Thanks to
+ Peter Bowen <pzb(a)datastacks.com> for pointing this out.
+
+* Thu Feb 6 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-21
+- Rebuild
+
+* Wed Feb 5 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-20
+- Release number bumped really high: turning on UCS4 (ABI compatibility
+ breakage)
+
+* Fri Jan 31 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-13
+- Attempt to look both in /usr/lib64 and /usr/lib/python2.2/site-packages/:
+ some work on python-2.2.2-lib64.patch
+
+* Thu Jan 30 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-12
+- Rebuild to incorporate the removal of .lib64 and - files.
+
+* Thu Jan 30 2003 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-11.7.3
+- Fixed bug #82544: Errata removes most tools
+- Fixed bug #82435: Python 2.2.2 errata breaks redhat-config-users
+- Removed .lib64 and - files that get installed after we fix the multilib
+ .py files.
+
+* Wed Jan 22 2003 Tim Powers <timp(a)redhat.com>
+- rebuilt
+
+* Wed Jan 15 2003 Jens Petersen <petersen(a)redhat.com> 2.2.2-10
+- rebuild to update tkinter's tcltk deps
+- convert changelog to utf-8
+
+* Tue Jan 7 2003 Nalin Dahyabhai <nalin(a)redhat.com> 2.2.2-9
+- rebuild
+
+* Fri Jan 3 2003 Nalin Dahyabhai <nalin(a)redhat.com>
+- pick up OpenSSL cflags and ldflags from pkgconfig if available
+
+* Thu Jan 2 2003 Jeremy Katz <katzj(a)redhat.com> 2.2.2-8
+- urllib2 didn't support non-anonymous ftp. add support based on how
+ urllib did it (#80676, #78168)
+
+* Mon Dec 16 2002 Mihai Ibanescu <misa(a)redhat.com> 2.2.2-7
+- Fix bug #79647 (Rebuild of SRPM fails if python isn't installed)
+- Added a bunch of missing BuildRequires found while fixing the
+ above-mentioned bug
+
+* Tue Dec 10 2002 Tim Powers <timp(a)redhat.com> 2.2.2-6
+- rebuild to fix broken tcltk deps for tkinter
+
+* Fri Nov 22 2002 Mihai Ibanescu <misa(a)redhat.com>
+2.2.2-3.7.3
+- Recompiled for 7.3 (to fix the -lcrypt bug)
+- Fix for the spurious error message at the end of the build (build-requires
+ gets confused by executable files starting with """"): make the
tests
+ non-executable.
+
* Wed Nov 20 2002 Mihai Ibanescu <misa(a)redhat.com>
2.2.2-5
- Fixed configuration patch to add -lcrypt when compiling cryptmodule.c
@@ -372,86 +473,86 @@ rm -fr $RPM_BUILD_ROOT
- Fix #53930 (Python-2.2.1-buildroot-bytecode.patch)
- Added BuildPrereq dependency on gcc-c++
-* Fri Aug 30 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-17
+* Fri Aug 30 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-17
- security fix for _execvpe
-* Tue Aug 13 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-16
+* Tue Aug 13 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-16
- Fix #71011,#71134, #58157
-* Wed Aug 7 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-15
+* Wed Aug 7 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-15
- Resurrect tkinter
- Fix for distutils (#67671)
- Fix #69962
-* Thu Jul 25 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-14
+* Thu Jul 25 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-14
- Obsolete tkinter/tkinter2 (#69838)
-* Tue Jul 23 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-13
+* Tue Jul 23 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-13
- Doc fixes (#53951) - not on alpha at the momemt
-* Mon Jul 8 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-12
+* Mon Jul 8 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-12
- fix pydoc (#68082)
-* Mon Jul 8 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-11
+* Mon Jul 8 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-11
- Add db4-devel as a BuildPrereq
* Fri Jun 21 2002 Tim Powers <timp(a)redhat.com> 2.2.1-10
- automated rebuild
-* Mon Jun 17 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-9
+* Mon Jun 17 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-9
- Add Japanese codecs (#66352)
-* Tue Jun 11 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-8
+* Tue Jun 11 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-8
- No more tkinter...
-* Wed May 29 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-7
+* Wed May 29 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-7
- Rebuild
-* Tue May 21 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-6
+* Tue May 21 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-6
- Add the email subcomponent (#65301)
-* Fri May 10 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-5
+* Fri May 10 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-5
- Rebuild
* Thu May 02 2002 Than Ngo <than(a)redhat.com> 2.2.1-4
- rebuild i new enviroment
-* Tue Apr 23 2002 Trond Eivind Glomsrd <teg(a)redhat.com>
+* Tue Apr 23 2002 Trond Eivind Glomsrd <teg(a)redhat.com>
- Use ucs2, not ucs4, to avoid breaking tkinter (#63965)
-* Mon Apr 22 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-2
+* Mon Apr 22 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-2
- Make it use db4
-* Fri Apr 12 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-1
+* Fri Apr 12 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-1
- 2.2.1 - a bugfix-only release
-* Fri Apr 12 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-16
+* Fri Apr 12 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-16
- the same, but in builddirs - this will remove them from the
docs package, which doesn't look in the buildroot for files.
-* Fri Apr 12 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-15
+* Fri Apr 12 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-15
- Get rid of temporary files and .cvsignores included
in the tarball and make install
-* Fri Apr 5 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-14
+* Fri Apr 5 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-14
- Don't own lib-tk in main package, only in tkinter (#62753)
-* Mon Mar 25 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-13
+* Mon Mar 25 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-13
- rebuild
-* Mon Mar 25 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-12
+* Mon Mar 25 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-12
- rebuild
-* Fri Mar 1 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-11
+* Fri Mar 1 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-11
- Add a not to the Distutils obsoletes test (doh!)
-* Fri Mar 1 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-10
+* Fri Mar 1 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-10
- Rebuild
-* Mon Feb 25 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-9
+* Mon Feb 25 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-9
- Only obsolete Distutils when built as python
-* Thu Feb 21 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-8
+* Thu Feb 21 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-8
- Make files in /usr/bin install side by side with python 1.5 when
- Drop explicit requirement of db4
built as python2
@@ -460,32 +561,32 @@ rm -fr $RPM_BUILD_ROOT
- Use version and pybasever macros to make updating easy
- Use _smp_mflags macro
-* Tue Jan 29 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-6
+* Tue Jan 29 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-6
- Add db4-devel to BuildPrereq
* Fri Jan 25 2002 Nalin Dahyabhai <nalin(a)redhat.com> 2.2-5
- disable ndbm support, which is db2 in disguise (really interesting things
can happen when you mix db2 and db4 in a single application)
-* Thu Jan 24 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-4
+* Thu Jan 24 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-4
- Obsolete subpackages if necesarry
- provide versioned python2
- build with db4
-* Wed Jan 16 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-3
+* Wed Jan 16 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-3
- Alpha toolchain broken. Disable build on alpha.
- New openssl
-* Wed Dec 26 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-1
+* Wed Dec 26 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-1
- 2.2 final
-* Fri Dec 14 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.11c1
+* Fri Dec 14 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.11c1
- 2.2 RC 1
- Don't include the _tkinter module in the main package - it's
already in the tkiter packace
- Turn off the mpzmodule, something broke in the buildroot
-* Wed Nov 28 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.10b2
+* Wed Nov 28 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.10b2
- Use -fPIC for OPT as well, in lack of a proper libpython.so
* Mon Nov 26 2001 Matt Wilson <msw(a)redhat.com> 2.2-0.9b2
@@ -498,44 +599,44 @@ rm -fr $RPM_BUILD_ROOT
* Fri Oct 26 2001 Matt Wilson <msw(a)redhat.com> 2.2-0.7b1
- python2ify
-* Fri Oct 19 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.5b1
+* Fri Oct 19 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.5b1
- 2.2b1
-* Sun Sep 30 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.4a4
+* Sun Sep 30 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.4a4
- 2.2a4
- Enable UCS4 support
- Enable IPv6
- Provide distutils
- Include msgfmt.py and pygettext.py
-* Fri Sep 14 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.3a3
+* Fri Sep 14 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.3a3
- Obsolete Distutils, which is now part of the main package
- Obsolete python2
-* Thu Sep 13 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.2a3
+* Thu Sep 13 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.2a3
- Add docs, tools and tkinter subpackages, to match the 1.5 layout
-* Wed Sep 12 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.1a3
+* Wed Sep 12 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.1a3
- 2.2a3
- don't build tix and blt extensions
-* Mon Aug 13 2001 Trond Eivind Glomsrd <teg(a)redhat.com>
+* Mon Aug 13 2001 Trond Eivind Glomsrd <teg(a)redhat.com>
- Add tk and tix to build dependencies
-* Sat Jul 21 2001 Trond Eivind Glomsrd <teg(a)redhat.com>
+* Sat Jul 21 2001 Trond Eivind Glomsrd <teg(a)redhat.com>
- 2.1.1 bugfix release - with a GPL compatible license
-* Fri Jul 20 2001 Trond Eivind Glomsrd <teg(a)redhat.com>
+* Fri Jul 20 2001 Trond Eivind Glomsrd <teg(a)redhat.com>
- Add new build dependencies (#49753)
* Tue Jun 26 2001 Nalin Dahyabhai <nalin(a)redhat.com>
- build with -fPIC
-* Fri Jun 1 2001 Trond Eivind Glomsrd <teg(a)redhat.com>
+* Fri Jun 1 2001 Trond Eivind Glomsrd <teg(a)redhat.com>
- 2.1
- reorganization of file includes
-* Wed Dec 20 2000 Trond Eivind Glomsrd <teg(a)redhat.com>
+* Wed Dec 20 2000 Trond Eivind Glomsrd <teg(a)redhat.com>
- fix the "requires" clause, it lacked a space causing problems
- use %%{_tmppath}
- don't define name, version etc
@@ -559,7 +660,7 @@ rm -fr $RPM_BUILD_ROOT
- add test.xml.out to files list
* Thu Oct 5 2000 Jeremy Hylton <jeremy(a)beopen.com>
-- added bin/python2.0 to files list (suggested by Martin v. Lwis)
+- added bin/python2.0 to files list (suggested by Martin v. L?)
* Tue Sep 26 2000 Jeremy Hylton <jeremy(a)beopen.com>
- updated for release 1 of 2.0b2
diff --git a/sources b/sources
index 845527f..8b5de2d 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-e784f9ad69ac6ac0eb12f105570f7908 JapaneseCodecs-1.4.6.tar.gz
+13198f9b425dd44fc94af45afe47b94d JapaneseCodecs-1.4.9.tar.gz
1c1067396e5aa0299978486eb5bd1a5c Python-2.2.2.tgz
commit d4a39597bc32ab2cf84b43a3b0c71a18d1a0e0ec
Author: cvsdist <cvsdist(a)fedoraproject.org>
Date: Thu Sep 9 11:02:27 2004 +0000
auto-import python-2.2.2-5 from python-2.2.2-5.src.rpm
diff --git a/.cvsignore b/.cvsignore
index db39ce5..798eee1 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -1,2 +1,2 @@
JapaneseCodecs-1.4.6.tar.gz
-Python-2.2.1.tgz
+Python-2.2.2.tgz
diff --git a/python.spec b/python.spec
index 4b2c087..acc5e14 100644
--- a/python.spec
+++ b/python.spec
@@ -10,8 +10,8 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
-Version: 2.2.1
-Release: 17a
+Version: 2.2.2
+Release: 5
License: PSF - see LICENSE
Group: Development/Languages
Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tgz
@@ -19,17 +19,25 @@ Source2: idle
Source3: modulator
Source4: pynche
Source5:
http://www.python.jp/pub/JapaneseCodecs/JapaneseCodecs-1.4.6.tar.gz
-Patch0: python-2.2.1-config2.patch
+%if !%{aspython2}
+Patch0: python-2.2.2-config2.patch
+%else
+Patch0: python-2.2.2-config.patch
+%endif
Patch1: python-2.2b1-buildroot.patch
Patch2: python-2.2-no_ndbm.patch
Patch3: Python-2.2.1-pydocnogui.patch
Patch4: Python-2.2.1-nowhatsnew.patch
Patch5: Python-2.2.1-distutilrpm.patch
-Patch6: Python-2.2.1-execfix.patch
+Patch7: Python-2.2.1-buildroot-bytecode.patch
+Patch8: python-2.2.2-lib64.patch
+Patch9: japanese-codecs-1.4.6-lib64.patch
%if !%{aspython2}
Obsoletes: python2
Provides: python2 = %{version}
BuildPrereq: db4-devel
+%else
+BuildPrereq: db3-devel
%endif
%if !%{aspython2}
Obsoletes: Distutils
@@ -38,7 +46,7 @@ Provides: Distutils
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildPrereq: readline-devel, libtermcap-devel, openssl-devel, gmp-devel
BuildPrereq: ncurses-devel, gdbm-devel, zlib-devel, expat-devel, tetex-latex
-BuildPrereq: Mesa-devel tk tix
+BuildPrereq: Mesa-devel tk tix gcc-c++ XFree86-libs glibc-devel
URL:
http://www.python.org/
%description
@@ -81,6 +89,7 @@ documentation.
Summary: A collection of development tools included with Python.
Group: Development/Tools
Requires: %{name} = %{version}
+Requires: tkinter = %{version}
%if !%{aspython2}
Obsoletes: python2-tools
Provides: python2-tools = %{version}
@@ -110,7 +119,6 @@ for the Python language.
%package -n tkinter
%else
%package -n tkinter2
-
%endif
Summary: A graphical user interface for the Python scripting language.
Group: Development/Languages
@@ -134,7 +142,7 @@ You should install the tkinter package if you'd like to use a
graphical
user interface for Python programming.
%prep
-%setup -q -n Python-%{version}
+%setup -q -n Python-%{version} -a 5
%patch0 -p1 -b .rhconfig
%patch1 -p1
@@ -142,22 +150,28 @@ user interface for Python programming.
%patch3 -p1
%patch4 -p1
%patch5 -p1
-%patch6 -p1
+%patch7 -p1 -b .bad-bytecode-path
+%patch8 -p1 -b .lib64
+%patch9 -p0 -b .lib64-j
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
-#setup -q -D -T -a 1 -n Python-%{version} -q
+# Fix for lib/lib64
+for f in Lib/distutils/command/install.py Lib/distutils/sysconfig.py \
+ Lib/site.py Modules/getpath.c Modules/Setup.dist setup.py \
+ JapaneseCodecs-1.4.6/setup.py; do
+ sed 's/@LIB@/%{_lib}/g' $f > $f- && cat $f- > $f
+done
+
# This command drops the HTML files in the top-level build directory.
# That's not perfect, but it will do for now.
%build
-CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC"
-CXXFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC"
-OPT="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC"
-%ifarch s390 s390x
-export LDSHARED="gcc -shared -fPIC "
-%endif
+export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC"
+export CXXFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC"
+export OPT="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC"
+export LINKCC="gcc"
%configure --enable-ipv6 --enable-unicode=ucs2
make OPT="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC" %{?_smp_mflags}
@@ -165,8 +179,9 @@ Tools/scripts/pathfix.py -i "/usr/bin/env
python%{pybasever}" .
make OPT="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC" %{?_smp_mflags}
%ifarch i386
+topdir=`pwd`
pushd Doc
-make
+make PYTHON=$topdir/python
rm html/index.html.in Makefile* info/Makefile tools/sgmlconv/Makefile
popd
%endif
@@ -175,40 +190,41 @@ popd
[ -d $RPM_BUILD_ROOT ] && rm -fr $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr $RPM_BUILD_ROOT%{_mandir}
-%makeinstall DESTDIR=/ MANDIR=$RPM_BUILD_ROOT/%{_mandir}
INCLUDEDIR=$RPM_BUILD_ROOT/%{_includedir}
-# distutils sucks. It writes the path of the interpreter in the BUILDDIR into
-# any scripts that it installs.
-sed 's,#!.*/python$,#!/usr/bin/env python%{pybasever},'
$RPM_BUILD_ROOT/usr/bin/pydoc > $RPM_BUILD_ROOT/usr/bin/pydoc-
-mv $RPM_BUILD_ROOT/usr/bin/pydoc- $RPM_BUILD_ROOT/usr/bin/pydoc
-chmod 0755 $RPM_BUILD_ROOT/usr/bin/pydoc
+%makeinstall DESTDIR=/ MANDIR=$RPM_BUILD_ROOT/%{_mandir}
INCLUDEDIR=$RPM_BUILD_ROOT/%{_includedir} LIBDIR=$RPM_BUILD_ROOT/%{_libdir}
SCRIPTDIR=$RPM_BUILD_ROOT/%{_libdir} build_root=$RPM_BUILD_ROOT
+# Fix the interpreter path in binaries installed by distutils
+# (which changes them by itself)
+# Make sure we preserve the file permissions
+for fixed in $RPM_BUILD_ROOT/usr/bin/pydoc; do
+ sed 's,#!.*/python$,#!/usr/bin/env python%{pybasever},' $fixed > $fixed-
\
+ && cat $fixed- > $fixed && rm -f $fixed-
+done
%if %{aspython2}
mv $RPM_BUILD_ROOT/usr/bin/python $RPM_BUILD_ROOT/usr/bin/python2
mv $RPM_BUILD_ROOT/%{_mandir}/man1/python.1
$RPM_BUILD_ROOT/%{_mandir}/man1/python%{pybasever}.1
%else
ln -s python $RPM_BUILD_ROOT/usr/bin/python2
-
%endif
# tools
# idle
-mkdir -p ${RPM_BUILD_ROOT}/usr/lib/python%{pybasever}/site-packages
+mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/python%{pybasever}/site-packages
install -m 755 $RPM_SOURCE_DIR/idle ${RPM_BUILD_ROOT}/usr/bin/idle
-mkdir -p $RPM_BUILD_ROOT/usr/lib/python%{pybasever}/site-packages/idle
-cp -R Tools/idle/* $RPM_BUILD_ROOT/usr/lib/python%{pybasever}/site-packages/idle
+mkdir -p $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/site-packages/idle
+cp -R Tools/idle/* $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/site-packages/idle
#modulator
install -m 755 $RPM_SOURCE_DIR/modulator ${RPM_BUILD_ROOT}/usr/bin/modulator
cp -r Tools/modulator \
- ${RPM_BUILD_ROOT}/usr/lib/python%{pybasever}/site-packages/
+ ${RPM_BUILD_ROOT}%{_libdir}/python%{pybasever}/site-packages/
#pynche
install -m 755 $RPM_SOURCE_DIR/pynche ${RPM_BUILD_ROOT}/usr/bin/pynche
-rm Tools/pynche/*.pyw
+rm -f Tools/pynche/*.pyw
cp -r Tools/pynche \
- ${RPM_BUILD_ROOT}/usr/lib/python%{pybasever}/site-packages/
+ ${RPM_BUILD_ROOT}%{_libdir}/python%{pybasever}/site-packages/
mv Tools/modulator/README Tools/modulator/README.modulator
mv Tools/pynche/README Tools/pynche/README.pynche
@@ -217,19 +233,18 @@ mv Tools/pynche/README Tools/pynche/README.pynche
install -m755 Tools/i18n/pygettext.py $RPM_BUILD_ROOT/usr/bin/
install -m755 Tools/i18n/msgfmt.py $RPM_BUILD_ROOT/usr/bin/
-find $RPM_BUILD_ROOT/usr/lib/python%{pybasever}/lib-dynload -type f |grep -v
_tkinter.so|sed "s|$RPM_BUILD_ROOT||" > dynfiles
-
# Get rid of crap
find $RPM_BUILD_ROOT/ -name "*~"|xargs rm -f
find $RPM_BUILD_ROOT/ -name ".cvsignore"|xargs rm -f
find . -name "*~"|xargs rm -f
find . -name ".cvsignore"|xargs rm -f
#zero length
-rm -f $RPM_BUILD_ROOT/usr/lib/python2.2/site-packages/modulator/Templates/copyright
+rm -f
$RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/site-packages/modulator/Templates/copyright
-# not distributing the testsuire
-rm -fr $RPM_BUILD_ROOT/usr/lib/python2.2/test
-rm -f $RPM_BUILD_ROOT/usr/lib/python2.2/LICENSE.txt
+# Clean up the testsuite - we don't need compiled files for it
+find $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/test \
+ -name "*.pyc" -o -name "*.pyo" | xargs rm -f
+rm -f $RPM_BUILD_ROOT%{_libdir}/python2.2/LICENSE.txt
#make the binaries install side by side with python 1
@@ -245,11 +260,17 @@ popd
%endif
# Japanese codecs
-tar xvzf %{SOURCE5}
pushd JapaneseCodecs-1.4.6
-$RPM_BUILD_ROOT/usr/bin/python setup.py install --record=INSTALLED_FILES
+$RPM_BUILD_ROOT/usr/bin/%{python} setup.py install \
+--install-scripts=$RPM_BUILD_ROOT/%{_prefix}/bin \
+--install-purelib=$RPM_BUILD_ROOT/%{_libdir}/%{name}%{pybasever}/site-packages \
+--install-platlib=$RPM_BUILD_ROOT/%{_libdir}/%{name}%{pybasever}/lib-dynload \
+--install-data=$RPM_BUILD_ROOT/%{_exec_prefix} \
+--root=/
popd
+find $RPM_BUILD_ROOT%{_libdir}/python%{pybasever}/lib-dynload -type f | grep -v
_tkinter.so | sed "s|$RPM_BUILD_ROOT||" > dynfiles
+
%clean
rm -fr $RPM_BUILD_ROOT
@@ -259,26 +280,28 @@ rm -fr $RPM_BUILD_ROOT
/usr/bin/python*
%{_mandir}/*/*
-%dir /usr/lib/python%{pybasever}
-%dir /usr/lib/python%{pybasever}/lib-dynload
-/usr/lib/python%{pybasever}/*.py*
-/usr/lib/python%{pybasever}/*.doc
-/usr/lib/python%{pybasever}/curses
-/usr/lib/python%{pybasever}/distutils
-/usr/lib/python%{pybasever}/encodings
-/usr/lib/python%{pybasever}/lib-old
-/usr/lib/python%{pybasever}/plat-linux2
-/usr/lib/python%{pybasever}/site-packages
-/usr/lib/python%{pybasever}/xml
-/usr/lib/python%{pybasever}/email
-/usr/lib/python%{pybasever}/compiler
-/usr/lib/python%{pybasever}/plat-linux2
-/usr/lib/python%{pybasever}/hotshot
+%dir %{_libdir}/python%{pybasever}
+%dir %{_libdir}/python%{pybasever}/lib-dynload
+%dir %{_libdir}/python%{pybasever}/lib-dynload/japanese
+%{_libdir}/python%{pybasever}/site-packages/japanese.pth
+%{_libdir}/python%{pybasever}/*.py*
+%{_libdir}/python%{pybasever}/*.doc
+%{_libdir}/python%{pybasever}/curses
+%{_libdir}/python%{pybasever}/distutils
+%{_libdir}/python%{pybasever}/encodings
+%{_libdir}/python%{pybasever}/lib-old
+%{_libdir}/python%{pybasever}/site-packages
+%{_libdir}/python%{pybasever}/xml
+%{_libdir}/python%{pybasever}/email
+%{_libdir}/python%{pybasever}/compiler
+%{_libdir}/python%{pybasever}/plat-linux2
+%{_libdir}/python%{pybasever}/hotshot
%files devel
%defattr(-,root,root)
/usr/include/*
-/usr/lib/python%{pybasever}/config
+%{_libdir}/python%{pybasever}/config
+%{_libdir}/python%{pybasever}/test
%if !%{aspython2}
%files tools
@@ -286,11 +309,11 @@ rm -fr $RPM_BUILD_ROOT
%doc Tools/modulator/README.modulator
%doc Tools/pynche/README.pynche
%doc Tools/idle/*.txt
-%dir /usr/lib/python%{pybasever}/site-packages/idle
-%dir /usr/lib/python%{pybasever}/site-packages/modulator
-%dir /usr/lib/python%{pybasever}/site-packages/modulator/Templates
-%dir /usr/lib/python%{pybasever}/site-packages/pynche
-%dir /usr/lib/python%{pybasever}/site-packages/pynche/X
+%dir %{_libdir}/python%{pybasever}/site-packages/idle
+%dir %{_libdir}/python%{pybasever}/site-packages/modulator
+%dir %{_libdir}/python%{pybasever}/site-packages/modulator/Templates
+%dir %{_libdir}/python%{pybasever}/site-packages/pynche
+%dir %{_libdir}/python%{pybasever}/site-packages/pynche/X
/usr/bin/idle*
/usr/bin/modulator*
/usr/bin/pynche*
@@ -310,10 +333,45 @@ rm -fr $RPM_BUILD_ROOT
%files -n tkinter2
%endif
%defattr(-,root,root,755)
-/usr/lib/python%{pybasever}/lib-tk
-/usr/lib/python%{pybasever}/lib-dynload/_tkinter.so
+%{_libdir}/python%{pybasever}/lib-tk
+%{_libdir}/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Wed Nov 20 2002 Mihai Ibanescu <misa(a)redhat.com>
+2.2.2-5
+- Fixed configuration patch to add -lcrypt when compiling cryptmodule.c
+
+2.2.2-4
+- Spec file change from Matt Wilson <msw(a)redhat.com> to disable linking
+ with the C++ compiler.
+
+* Mon Nov 11 2002 Mihai Ibanescu <misa(a)redhat.com>
+2.2.2-3.*
+- Merged patch from Karsten Hopp <karsten(a)redhat.de> from 2.2.1-17hammer to
+ use %%{_libdir}
+- Added XFree86-libs as BuildRequires (because of tkinter)
+- Fixed duplicate listing of plat-linux2
+- Fixed exclusion of lib-dynload/japanese
+- Added lib64 patch for the japanese codecs
+- Use setup magic instead of using tar directly on JapaneseCodecs
+
+* Tue Nov 5 2002 Mihai Ibanescu <misa(a)redhat.com>
+2.2.2-2
+- Fix #76912 (python-tools contains idle, which uses tkinter, but there is no
+ requirement of tkinter from python-tools).
+- Fix #74013 (rpm is missing the /usr/lib/python2.2/test directory)
+
+* Mon Nov 4 2002 Mihai Ibanescu <misa(a)redhat.com>
+- builds as python2 require a different libdb
+- changed the buildroot name of python to match python2 builds
+
+* Fri Nov 1 2002 Mihai Ibanescu <misa(a)redhat.com>
+- updated python to 2.2.2 and adjusted the patches accordingly
+
+* Mon Oct 21 2002 Mihai Ibanescu <misa(a)redhat.com>
+- Fix #53930 (Python-2.2.1-buildroot-bytecode.patch)
+- Added BuildPrereq dependency on gcc-c++
+
* Fri Aug 30 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-17
- security fix for _execvpe
diff --git a/sources b/sources
index bfcefe3..845527f 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
e784f9ad69ac6ac0eb12f105570f7908 JapaneseCodecs-1.4.6.tar.gz
-e7012d611602b62e36073c2fd02396a3 Python-2.2.1.tgz
+1c1067396e5aa0299978486eb5bd1a5c Python-2.2.2.tgz
commit 81cc0f163f29cd3c69c94ce66ada0c3ca169ce6a
Author: cvsdist <cvsdist(a)fedoraproject.org>
Date: Thu Sep 9 11:02:10 2004 +0000
auto-import python-2.2.1-17a from python-2.2.1-17a.src.rpm
diff --git a/python.spec b/python.spec
index e03e1ae..4b2c087 100644
--- a/python.spec
+++ b/python.spec
@@ -11,7 +11,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: 2.2.1
-Release: 17
+Release: 17a
License: PSF - see LICENSE
Group: Development/Languages
Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tgz
@@ -155,6 +155,9 @@ find -name "*~" |xargs rm -f
CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC"
CXXFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC"
OPT="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC"
+%ifarch s390 s390x
+export LDSHARED="gcc -shared -fPIC "
+%endif
%configure --enable-ipv6 --enable-unicode=ucs2
make OPT="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC" %{?_smp_mflags}
commit af6464cad587dbb6cd022fb15ca5d8af7bf9971e
Author: cvsdist <cvsdist(a)fedoraproject.org>
Date: Thu Sep 9 11:02:06 2004 +0000
auto-import python-2.2.1-17 from python-2.2.1-17.src.rpm
diff --git a/python.spec b/python.spec
index 974ed2a..e03e1ae 100644
--- a/python.spec
+++ b/python.spec
@@ -11,7 +11,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: 2.2.1
-Release: 16
+Release: 17
License: PSF - see LICENSE
Group: Development/Languages
Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tgz
@@ -25,6 +25,7 @@ Patch2: python-2.2-no_ndbm.patch
Patch3: Python-2.2.1-pydocnogui.patch
Patch4: Python-2.2.1-nowhatsnew.patch
Patch5: Python-2.2.1-distutilrpm.patch
+Patch6: Python-2.2.1-execfix.patch
%if !%{aspython2}
Obsoletes: python2
Provides: python2 = %{version}
@@ -141,6 +142,7 @@ user interface for Python programming.
%patch3 -p1
%patch4 -p1
%patch5 -p1
+%patch6 -p1
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@@ -309,6 +311,9 @@ rm -fr $RPM_BUILD_ROOT
/usr/lib/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Fri Aug 30 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-17
+- security fix for _execvpe
+
* Tue Aug 13 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-16
- Fix #71011,#71134, #58157
commit 86d7877688ab905dbe26c78d5529e35df002b8b2
Author: cvsdist <cvsdist(a)fedoraproject.org>
Date: Thu Sep 9 11:01:38 2004 +0000
auto-import python-2.2.1-16 from python-2.2.1-16.src.rpm
diff --git a/python.spec b/python.spec
index 871bc88..974ed2a 100644
--- a/python.spec
+++ b/python.spec
@@ -11,7 +11,7 @@
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{python}
Version: 2.2.1
-Release: 15
+Release: 16
License: PSF - see LICENSE
Group: Development/Languages
Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tgz
@@ -38,7 +38,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildPrereq: readline-devel, libtermcap-devel, openssl-devel, gmp-devel
BuildPrereq: ncurses-devel, gdbm-devel, zlib-devel, expat-devel, tetex-latex
BuildPrereq: Mesa-devel tk tix
-URL:
http://www.python.com/
+URL:
http://www.python.org/
%description
Python is an interpreted, interactive, object-oriented programming
@@ -180,6 +180,9 @@ chmod 0755 $RPM_BUILD_ROOT/usr/bin/pydoc
%if %{aspython2}
mv $RPM_BUILD_ROOT/usr/bin/python $RPM_BUILD_ROOT/usr/bin/python2
mv $RPM_BUILD_ROOT/%{_mandir}/man1/python.1
$RPM_BUILD_ROOT/%{_mandir}/man1/python%{pybasever}.1
+%else
+ln -s python $RPM_BUILD_ROOT/usr/bin/python2
+
%endif
# tools
@@ -248,7 +251,7 @@ rm -fr $RPM_BUILD_ROOT
%files -f dynfiles
%defattr(-, root, root)
%doc LICENSE README
-/usr/bin/*
+/usr/bin/python*
%{_mandir}/*/*
%dir /usr/lib/python%{pybasever}
@@ -288,6 +291,7 @@ rm -fr $RPM_BUILD_ROOT
/usr/bin/pynche*
/usr/bin/pygettext*.py
/usr/bin/msgfmt*.py
+/usr/bin/pydoc
%endif
%files docs
@@ -305,9 +309,13 @@ rm -fr $RPM_BUILD_ROOT
/usr/lib/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
+* Tue Aug 13 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-16
+- Fix #71011,#71134, #58157
+
* Wed Aug 7 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-15
- Resurrect tkinter
- Fix for distutils (#67671)
+- Fix #69962
* Thu Jul 25 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-14
- Obsolete tkinter/tkinter2 (#69838)
commit e0fde95b83781e4651383acdadb75000df8eb9ba
Author: cvsdist <cvsdist(a)fedoraproject.org>
Date: Thu Sep 9 11:01:34 2004 +0000
auto-import python-2.2.1-15 from python-2.2.1-15.src.rpm
diff --git a/.cvsignore b/.cvsignore
index 5a5f726..db39ce5 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -1,2 +1,2 @@
-Python-Doc.tar.gz
-py152.tgz
+JapaneseCodecs-1.4.6.tar.gz
+Python-2.2.1.tgz
diff --git a/Python-2.2.1-pydocnogui.patch b/Python-2.2.1-pydocnogui.patch
new file mode 100644
index 0000000..7209821
--- /dev/null
+++ b/Python-2.2.1-pydocnogui.patch
@@ -0,0 +1,32 @@
+--- Python-2.2.1/Lib/pydoc.py.nogui 2002-07-08 18:32:47.000000000 -0400
++++ Python-2.2.1/Lib/pydoc.py 2002-07-08 18:33:37.000000000 -0400
+@@ -18,9 +18,6 @@
+ Run "pydoc -p <port>" to start an HTTP server on a given port on the
+ local machine to generate documentation web pages.
+
+-For platforms without a command line, "pydoc -g" starts the HTTP server
+-and also pops up a little window for controlling it.
+-
+ Run "pydoc -w <name>" to write out the HTML documentation for a module
+ to a file named "<name>.html".
+ """
+@@ -2043,9 +2040,6 @@
+ writing = 0
+
+ for opt, val in opts:
+- if opt == '-g':
+- gui()
+- return
+ if opt == '-k':
+ apropos(val)
+ return
+@@ -2094,9 +2088,6 @@
+ %s -p <port>
+ Start an HTTP server on the given port on the local machine.
+
+-%s -g
+- Pop up a graphical interface for finding and serving documentation.
+-
+ %s -w <name> ...
+ Write out the HTML documentation for a module to a file in the current
+ directory. If <name> contains a '%s', it is treated as a filename;
if
diff --git a/python.spec b/python.spec
index 08459a6..871bc88 100644
--- a/python.spec
+++ b/python.spec
@@ -1,45 +1,44 @@
-#%define tcltk_major 8.3
-#%ifarch ia64
-#%define depsuffix ()(64bit)
-#%else
-#%define depsuffix %{nil}
-#%endif
-#%define tkinter_tcldeps %{expand:libtcl%%{tcltk_major}.so%%{depsuffix}
libtk%%{tcltk_major}.so%%{depsuffix} libtix4.1.%%{tcltk_major}.so%%{depsuffix}}
-
-Summary: An interpreted, interactive object-oriented programming language.
-Name: python
-Version: 1.5.2
-Release: 43.73
-License: distributable
+%define aspython2 0
+
+%if %{aspython2}
+%define python python2
+%else
+%define python python
+%endif
+
+%define pybasever 2.2
+
+Summary: An interpreted, interactive, object-oriented programming language.
+Name: %{python}
+Version: 2.2.1
+Release: 15
+License: PSF - see LICENSE
Group: Development/Languages
-Source0:
ftp://ftp.python.org/pub/python/src/py152.tgz
-Source1: Python-Doc.tar.gz
+Source:
http://www.python.org/ftp/python/%{version}/Python-%{version}.tgz
Source2: idle
Source3: modulator
Source4: pynche
-Source5: gettext.py
-Source6:
http://gigue.peabody.jhu.edu/~mdboom/omi/source/shm_source/shmmodule.c
-Source10: inspect.py
-Source11: pydoc.py
-
-Patch0: python-1.5.2-config.patch
-Patch1: python-1.4-gccbug.patch
-Patch2: Python-1.5.1-nosed.patch
-Patch3: python-1.5.2-dl-global.patch
-Patch4: python-1.5.2-pythonpath.patch
-Patch5: python-1.5.2-wdb.patch
-Patch6: python-1.5.2-wuftpd.patch
-Patch7: python-1.5.2-_locale.patch
-Patch8: python-1.5.2-tcl831.patch
-Patch9: python-1.5.2-https.patch
-Patch10: python-1.5.2-gmp4.patch
-Patch11: python-1.5.2-sec.patch
-Patch12: python-1.1.2-test-popen2.patch
-Patch13: python-1.5.2-strptime.patch
-BuildRequires: readline readline-devel zlib zlib-devel
-BuildRequires: gmp gmp-devel gdbm gdbm-devel openssl-devel tix
-Conflicts: tkinter < %{version}-%{release}
-BuildRoot: %{_tmppath}/%{name}/python-root
+Source5:
http://www.python.jp/pub/JapaneseCodecs/JapaneseCodecs-1.4.6.tar.gz
+Patch0: python-2.2.1-config2.patch
+Patch1: python-2.2b1-buildroot.patch
+Patch2: python-2.2-no_ndbm.patch
+Patch3: Python-2.2.1-pydocnogui.patch
+Patch4: Python-2.2.1-nowhatsnew.patch
+Patch5: Python-2.2.1-distutilrpm.patch
+%if !%{aspython2}
+Obsoletes: python2
+Provides: python2 = %{version}
+BuildPrereq: db4-devel
+%endif
+%if !%{aspython2}
+Obsoletes: Distutils
+Provides: Distutils
+%endif
+BuildRoot: %{_tmppath}/%{name}-%{version}-root
+BuildPrereq: readline-devel, libtermcap-devel, openssl-devel, gmp-devel
+BuildPrereq: ncurses-devel, gdbm-devel, zlib-devel, expat-devel, tetex-latex
+BuildPrereq: Mesa-devel tk tix
+URL:
http://www.python.com/
%description
Python is an interpreted, interactive, object-oriented programming
@@ -61,7 +60,10 @@ package.
%package devel
Summary: The libraries and header files needed for Python development.
Group: Development/Libraries
-Requires: python = %{version}-%{release}
+%if !%{aspython2}
+Obsoletes: python2-devel
+Provides: python2-devel = %{version}
+%endif
%description devel
The Python programming language's interpreter can be extended with
@@ -77,21 +79,23 @@ documentation.
%package tools
Summary: A collection of development tools included with Python.
Group: Development/Tools
-Requires: python = %{version}-%{release}
+Requires: %{name} = %{version}
+%if !%{aspython2}
+Obsoletes: python2-tools
+Provides: python2-tools = %{version}
+%endif
%description tools
The Python package includes several development tools that are used
-to build python programs. This package contains a selection of those
-tools, including the IDLE Python IDE.
-
-Install python-tools if you want to use these tools to develop
-Python programs. You will also need to install the python and
-tkinter packages.
+to build python programs.
%package docs
Summary: Documentation for the Python programming language.
Group: Documentation
-Conflicts: python < %{version}-%{release}
+%if !%{aspython2}
+Obsoletes: python2-docs
+Provides: python2-docs = %{version}
+%endif
%description docs
The python-docs package contains documentation on the Python
@@ -101,14 +105,27 @@ in ASCII text files and in LaTeX source files.
Install the python-docs package if you'd like to use the documentation
for the Python language.
+%if !%{aspython2}
%package -n tkinter
+%else
+%package -n tkinter2
+
+%endif
Summary: A graphical user interface for the Python scripting language.
Group: Development/Languages
-#BuildPrereq: %{tkinter_tcldeps}
-BuildPrereq: tcl >= 8.3
-Requires: python = %{version}-%{release}
+BuildPrereq: tcl, tk
+Requires: %{name} = %{version}
+%if !%{aspython2}
+Obsoletes: tkinter2
+Provides: tkinter2 = %{version}
+%endif
+%if !%{aspython2}
%description -n tkinter
+%else
+%description -n tkinter2
+%endif
+
The Tkinter (Tk interface) program is an graphical user interface for
the Python scripting language.
@@ -116,348 +133,366 @@ You should install the tkinter package if you'd like to use a
graphical
user interface for Python programming.
%prep
-%setup -q -n Python-1.5.2 -a 1
-%patch0 -p1 -b .config
+%setup -q -n Python-%{version}
-#%ifarch alpha
-#%patch1 -p1
-#%endif
-%patch2 -p1
+%patch0 -p1 -b .rhconfig
+%patch1 -p1
+%patch2 -p1 -b .no_ndbm
%patch3 -p1
%patch4 -p1
%patch5 -p1
-%patch6 -p1
-%patch7 -p1 -b ._locale
-%patch8 -p1 -b .tcl823
-%patch9 -p1 -b .https
-%patch10 -p1 -b .gmp4
-%patch11 -p1 -b .sec
-%patch12 -p1 -b .testcase
-%patch13 -p1 -b .strptime
-
-find . -name "*.nosed" -exec rm -f {} \;
-
-echo ': ${LDSHARED='gcc -shared'}' > config.cache
-echo ': ${LINKFORSHARED='-rdynamic'}' >> config.cache
-echo ': ${CCSHARED='-fPIC'}' >> config.cache
-
-cp Lib/lib-old/rand.py Lib
-cp %{SOURCE5} Lib
-# inspect.py and pydoc.py
-cp %{SOURCE10} %{SOURCE11} Lib
+# This shouldn't be necesarry, but is right now (2.2a3)
+find -name "*~" |xargs rm -f
-# shm module
-cp %{SOURCE6} Modules
-echo "shm shmmodule.c" >> Modules/Setup.in
+#setup -q -D -T -a 1 -n Python-%{version} -q
+# This command drops the HTML files in the top-level build directory.
+# That's not perfect, but it will do for now.
%build
-%ifnarch s390 s390x
-RPM_OPT_FLAGS="$RPM_OPT_FLAGS -fno-merge-constants"
+CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC"
+CXXFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC"
+OPT="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC"
+%configure --enable-ipv6 --enable-unicode=ucs2
+
+make OPT="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC" %{?_smp_mflags}
+Tools/scripts/pathfix.py -i "/usr/bin/env python%{pybasever}" .
+make OPT="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC" %{?_smp_mflags}
+
+%ifarch i386
+pushd Doc
+make
+rm html/index.html.in Makefile* info/Makefile tools/sgmlconv/Makefile
+popd
%endif
-MACHDEP=linux-%{_target_cpu} ; export MACHDEP
-%configure --with-threads
-
-make OPT="$RPM_OPT_FLAGS -fPIC" LDFLAGS=-s
%install
-rm -rf ${RPM_BUILD_ROOT}
-mkdir -p ${RPM_BUILD_ROOT}%{_prefix}/{bin,lib}
-
-#make install prefix=${RPM_BUILD_ROOT}%{_prefix}
-%makeinstall
-strip ${RPM_BUILD_ROOT}%{_bindir}/python
+[ -d $RPM_BUILD_ROOT ] && rm -fr $RPM_BUILD_ROOT
+mkdir -p $RPM_BUILD_ROOT/usr $RPM_BUILD_ROOT%{_mandir}
+
+%makeinstall DESTDIR=/ MANDIR=$RPM_BUILD_ROOT/%{_mandir}
INCLUDEDIR=$RPM_BUILD_ROOT/%{_includedir}
+# distutils sucks. It writes the path of the interpreter in the BUILDDIR into
+# any scripts that it installs.
+sed 's,#!.*/python$,#!/usr/bin/env python%{pybasever},'
$RPM_BUILD_ROOT/usr/bin/pydoc > $RPM_BUILD_ROOT/usr/bin/pydoc-
+mv $RPM_BUILD_ROOT/usr/bin/pydoc- $RPM_BUILD_ROOT/usr/bin/pydoc
+chmod 0755 $RPM_BUILD_ROOT/usr/bin/pydoc
+
+%if %{aspython2}
+mv $RPM_BUILD_ROOT/usr/bin/python $RPM_BUILD_ROOT/usr/bin/python2
+mv $RPM_BUILD_ROOT/%{_mandir}/man1/python.1
$RPM_BUILD_ROOT/%{_mandir}/man1/python%{pybasever}.1
+%endif
# tools
+
# idle
-mkdir -p ${RPM_BUILD_ROOT}%{_prefix}/lib/python1.5/site-packages
-install -m 755 $RPM_SOURCE_DIR/idle ${RPM_BUILD_ROOT}%{_bindir}/idle
-mkdir -p ${RPM_BUILD_ROOT}%{_prefix}/lib/python1.5/site-packages/idle
-cp Tools/idle/*.py \
- ${RPM_BUILD_ROOT}%{_prefix}/lib/python1.5/site-packages/idle/
-mv Tools/idle/help.txt \
- ${RPM_BUILD_ROOT}%{_prefix}/lib/python1.5/site-packages/idle/
-mv Tools/idle/extend.txt \
- ${RPM_BUILD_ROOT}%{_prefix}/lib/python1.5/site-packages/idle/
+mkdir -p ${RPM_BUILD_ROOT}/usr/lib/python%{pybasever}/site-packages
+install -m 755 $RPM_SOURCE_DIR/idle ${RPM_BUILD_ROOT}/usr/bin/idle
+mkdir -p $RPM_BUILD_ROOT/usr/lib/python%{pybasever}/site-packages/idle
+cp -R Tools/idle/* $RPM_BUILD_ROOT/usr/lib/python%{pybasever}/site-packages/idle
+
#modulator
-install -m 755 $RPM_SOURCE_DIR/modulator ${RPM_BUILD_ROOT}%{_bindir}/modulator
+install -m 755 $RPM_SOURCE_DIR/modulator ${RPM_BUILD_ROOT}/usr/bin/modulator
cp -r Tools/modulator \
- ${RPM_BUILD_ROOT}%{_prefix}/lib/python1.5/site-packages/
+ ${RPM_BUILD_ROOT}/usr/lib/python%{pybasever}/site-packages/
#pynche
-install -m 755 $RPM_SOURCE_DIR/pynche ${RPM_BUILD_ROOT}%{_bindir}/pynche
+install -m 755 $RPM_SOURCE_DIR/pynche ${RPM_BUILD_ROOT}/usr/bin/pynche
rm Tools/pynche/*.pyw
cp -r Tools/pynche \
- ${RPM_BUILD_ROOT}%{_prefix}/lib/python1.5/site-packages/
+ ${RPM_BUILD_ROOT}/usr/lib/python%{pybasever}/site-packages/
mv Tools/modulator/README Tools/modulator/README.modulator
mv Tools/pynche/README Tools/pynche/README.pynche
-rm -f modules-list.full
-for n in ${RPM_BUILD_ROOT}%{_prefix}/lib/python1.5/*; do
- [ -d $n ] || echo $n
-done >> modules-list.full
-
-for mod in ${RPM_BUILD_ROOT}%{_prefix}/lib/python1.5/lib-dynload/* ; do
- [ `basename $mod` = _tkinter.so ] || echo $mod
-done >> modules-list.full
-sed -e "s|${RPM_BUILD_ROOT}||g" < modules-list.full > modules-list
-
-#get files list for python-tools
-DIR1=${RPM_BUILD_ROOT}%{_prefix}/lib/python1.5/site-packages/pynche
-DIR2=${RPM_BUILD_ROOT}%{_prefix}/lib/python1.5/site-packages/idle
-DIR3=${RPM_BUILD_ROOT}%{_prefix}/lib/python1.5/site-packages/modulator
-
-find $DIR1 -type f | sed -e "s#^${RPM_BUILD_ROOT}##g" > python-tools.files
-find $DIR2 -type f | sed -e "s#^${RPM_BUILD_ROOT}##g" >>
python-tools.files
-find $DIR3 -type f | sed -e "s#^${RPM_BUILD_ROOT}##g" >>
python-tools.files
-
-#rebytecompile modules with the right directory names
-find $RPM_BUILD_ROOT%{_prefix}/lib/python1.5 -type f -name "*.pyc" | xargs rm
-v
-PYTHONPATH=$RPM_BUILD_ROOT%{_prefix}/lib/python1.5 $RPM_BUILD_ROOT%{_bindir}/python -c
"import compileall;
compileall.compile_dir('"$RPM_BUILD_ROOT"/usr/lib/python1.5', 4,
'/usr/lib/python1.5/site-packages')"
+#gettext
+install -m755 Tools/i18n/pygettext.py $RPM_BUILD_ROOT/usr/bin/
+install -m755 Tools/i18n/msgfmt.py $RPM_BUILD_ROOT/usr/bin/
+
+find $RPM_BUILD_ROOT/usr/lib/python%{pybasever}/lib-dynload -type f |grep -v
_tkinter.so|sed "s|$RPM_BUILD_ROOT||" > dynfiles
+
+# Get rid of crap
+find $RPM_BUILD_ROOT/ -name "*~"|xargs rm -f
+find $RPM_BUILD_ROOT/ -name ".cvsignore"|xargs rm -f
+find . -name "*~"|xargs rm -f
+find . -name ".cvsignore"|xargs rm -f
+#zero length
+rm -f $RPM_BUILD_ROOT/usr/lib/python2.2/site-packages/modulator/Templates/copyright
+
+# not distributing the testsuire
+rm -fr $RPM_BUILD_ROOT/usr/lib/python2.2/test
+rm -f $RPM_BUILD_ROOT/usr/lib/python2.2/LICENSE.txt
+
+
+#make the binaries install side by side with python 1
+%if %{aspython2}
+pushd $RPM_BUILD_ROOT/usr/bin
+mv idle idle2
+mv modulator modulator2
+mv pynche pynche2
+mv pygettext.py pygettext2.py
+mv msgfmt.py msgfmt2.py
+mv pydoc pydoc2
+popd
+%endif
-# Remove unneeded files
-rm -f Doc/.cvsignore Doc/ref/.cvsignore Doc/.latex2html-init
+# Japanese codecs
+tar xvzf %{SOURCE5}
+pushd JapaneseCodecs-1.4.6
+$RPM_BUILD_ROOT/usr/bin/python setup.py install --record=INSTALLED_FILES
+popd
%clean
-rm -rf ${RPM_BUILD_ROOT}
-rm -f modules-list modules-list.full
-
-%files -f modules-list
-%defattr(-,root,root,755)
-%{_bindir}/python*
-%dir %{_prefix}/lib/python1.5
-%{_prefix}/lib/python1.5/plat-linux-%{_target_cpu}
-%{_prefix}/lib/python1.5/lib-stdwin
-%dir %{_prefix}/lib/python1.5/lib-dynload
+rm -fr $RPM_BUILD_ROOT
+
+%files -f dynfiles
+%defattr(-, root, root)
+%doc LICENSE README
+/usr/bin/*
+%{_mandir}/*/*
+
+%dir /usr/lib/python%{pybasever}
+%dir /usr/lib/python%{pybasever}/lib-dynload
+/usr/lib/python%{pybasever}/*.py*
+/usr/lib/python%{pybasever}/*.doc
+/usr/lib/python%{pybasever}/curses
+/usr/lib/python%{pybasever}/distutils
+/usr/lib/python%{pybasever}/encodings
+/usr/lib/python%{pybasever}/lib-old
+/usr/lib/python%{pybasever}/plat-linux2
+/usr/lib/python%{pybasever}/site-packages
+/usr/lib/python%{pybasever}/xml
+/usr/lib/python%{pybasever}/email
+/usr/lib/python%{pybasever}/compiler
+/usr/lib/python%{pybasever}/plat-linux2
+/usr/lib/python%{pybasever}/hotshot
%files devel
-%defattr(-,root,root,755)
-%{_prefix}/lib/python*/test
-%{_prefix}/lib/python*/config
-%{_prefix}/include/python1.5
+%defattr(-,root,root)
+/usr/include/*
+/usr/lib/python%{pybasever}/config
-%files -f python-tools.files tools
+%if !%{aspython2}
+%files tools
%defattr(-,root,root,755)
-%doc Tools/idle/*.txt
%doc Tools/modulator/README.modulator
%doc Tools/pynche/README.pynche
-%dir %{_prefix}/lib/python1.5/site-packages/idle
-%dir %{_prefix}/lib/python1.5/site-packages/modulator
-%dir %{_prefix}/lib/python1.5/site-packages/modulator/Templates
-%dir %{_prefix}/lib/python1.5/site-packages/pynche
-%dir %{_prefix}/lib/python1.5/site-packages/pynche/X
-%{_bindir}/idle
-%{_bindir}/modulator
-%{_bindir}/pynche
+%doc Tools/idle/*.txt
+%dir /usr/lib/python%{pybasever}/site-packages/idle
+%dir /usr/lib/python%{pybasever}/site-packages/modulator
+%dir /usr/lib/python%{pybasever}/site-packages/modulator/Templates
+%dir /usr/lib/python%{pybasever}/site-packages/pynche
+%dir /usr/lib/python%{pybasever}/site-packages/pynche/X
+/usr/bin/idle*
+/usr/bin/modulator*
+/usr/bin/pynche*
+/usr/bin/pygettext*.py
+/usr/bin/msgfmt*.py
+%endif
%files docs
%defattr(-,root,root,755)
-%doc Misc/COPYRIGHT Misc/NEWS Misc/HYPE Misc/README Misc/cheatsheet Misc/BLURB*
-%doc Misc/HISTORY Doc
+%doc Misc/NEWS Misc/README Misc/cheatsheet
+%doc Misc/HISTORY Doc/html
+%if !%{aspython2}
%files -n tkinter
+%else
+%files -n tkinter2
+%endif
%defattr(-,root,root,755)
-%{_prefix}/lib/python1.5/lib-tk
-%{_prefix}/lib/python1.5/lib-dynload/_tkinter.so
+/usr/lib/python%{pybasever}/lib-tk
+/usr/lib/python%{pybasever}/lib-dynload/_tkinter.so
%changelog
-* Thu Jan 30 2003 Mihai Ibanescu <misa(a)redhat.com> 1.5.2-43
-- Rebuild
+* Wed Aug 7 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-15
+- Resurrect tkinter
+- Fix for distutils (#67671)
-* Tue Jan 14 2003 Mihai Ibanescu <misa(a)redhat.com> 1.5.2-42
-- Fixed bug #81796: python time.strptime() causes segfault on ia64
+* Thu Jul 25 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-14
+- Obsolete tkinter/tkinter2 (#69838)
-* Fri Jan 10 2003 Mihai Ibanescu <misa(a)redhat.com> 1.5.2-41
-- Fixed the https patch: writing binary data through an SSL port would bork if
- the data has nulls in it.
-- Fixed MACHDEP
+* Tue Jul 23 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-13
+- Doc fixes (#53951) - not on alpha at the momemt
-* Tue Nov 5 2002 Mihai Ibanescu <misa(a)redhat.com> 1.5.2-41
-- Removed Doc/.cvsignore
+* Mon Jul 8 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-12
+- fix pydoc (#68082)
-* Tue Nov 5 2002 Mihai Ibanescu <misa(a)redhat.com> 1.5.2-40.73
-- Fixed the security patch
-- Fixed a race condition in popen2:_test()
+* Mon Jul 8 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-11
+- Add db4-devel as a BuildPrereq
-* Wed Sep 11 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 1.5.2-38.73
-- Add security patch
+* Fri Jun 21 2002 Tim Powers <timp(a)redhat.com> 2.2.1-10
+- automated rebuild
-* Wed Apr 3 2002 Matt Wilson <msw(a)redhat.com> 1.5.2-38
-- include a new version of the https patch from gafton
-- added shm module at the request of gafton.
+* Mon Jun 17 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-9
+- Add Japanese codecs (#66352)
-* Tue Mar 26 2002 Nalin Dahyabhai <nalin(a)redhat.com> 1.5.2-37
-- backport patch to make mpzmodule happy with gmp4
+* Tue Jun 11 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-8
+- No more tkinter...
-* Mon Mar 25 2002 Nalin Dahyabhai <nalin(a)redhat.com> 1.5.2-36
-- rebuild
-
-* Fri Jun 29 2001 Florian La Roche <Florian.LaRoche(a)redhat.de>
-- do not set -fno-merge-constants on s390,s390x
-- truncate changelog due to rpm errors
-
-* Wed Jun 27 2001 Elliot Lee <sopwith(a)redhat.com>
-- -fno-merge-constants
-
-* Tue Jun 12 2001 Nalin Dahyabhai <nalin(a)redhat.com>
-- rebuild in new environment
-- s/Copyright:/License:/
-
-* Fri May 11 2001 Bernhard Rosenkraenzer <bero(a)redhat.com> 1.5.2-32
-- rebuild with new readline
-
-* Fri May 4 2001 Preston Brown <pbrown(a)redhat.com> 1.5.2-31
-- inspect.py and pydoc.py modules added
+* Wed May 29 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-7
+- Rebuild
-* Fri Mar 2 2001 Nalin Dahyabhai <nalin(a)redhat.com>
-- rebuild in new environment
+* Tue May 21 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-6
+- Add the email subcomponent (#65301)
-* Fri Jan 19 2001 Nalin Dahyabhai <nalin(a)redhat.com>
-- build even the static libs with -fPIC
-- obey RPM_OPT_FLAGS
+* Fri May 10 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-5
+- Rebuild
-* Fri Jan 19 2001 Matt Wilson <msw(a)redhat.com>
-- added gettext.py from gnome-python, closes #23212
-- did some evail buildprereq stuff to make it go on ia64
+* Thu May 02 2002 Than Ngo <than(a)redhat.com> 2.2.1-4
+- rebuild i new enviroment
-* Fri Aug 25 2000 Preston Brown <pbrown(a)redhat.com>
-- Cristian had to supply a newer version of https handling for working
- with certificates
+* Tue Apr 23 2002 Trond Eivind Glomsrd <teg(a)redhat.com>
+- Use ucs2, not ucs4, to avoid breaking tkinter (#63965)
-* Thu Aug 24 2000 Nalin Dahyabhai <nalin(a)redhat.com>
-- re-merge Preston's patch
+* Mon Apr 22 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-2
+- Make it use db4
-* Wed Aug 23 2000 Nalin Dahyabhai <nalin(a)redhat.com>
-- byte-compile modules with the correct directory paths
+* Fri Apr 12 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2.1-1
+- 2.2.1 - a bugfix-only release
-* Sun Aug 20 2000 Preston Brown <pbrown(a)redhat.com>
-- https patch
+* Fri Apr 12 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-16
+- the same, but in builddirs - this will remove them from the
+ docs package, which doesn't look in the buildroot for files.
-* Mon Jul 31 2000 Matt Wilson <msw(a)redhat.com>
-- fixed directory perms from 775 to 755 to make rpmlint shut up
+* Fri Apr 12 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-15
+- Get rid of temporary files and .cvsignores included
+ in the tarball and make install
-* Wed Jul 12 2000 Prospector <bugzilla(a)redhat.com>
-- automatic rebuild
+* Fri Apr 5 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-14
+- Don't own lib-tk in main package, only in tkinter (#62753)
-* Mon Jun 18 2000 Bill Nottingham <notting(a)redhat.com>
-- rebuild, fix dependencies
+* Mon Mar 25 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-13
+- rebuild
-* Thu Jun 15 2000 Matt Wilson <msw(a)redhat.com>
-- rebuilt against new tcltk
+* Mon Mar 25 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-12
+- rebuild
-* Sat Jun 3 2000 Jeff Johnson <jbj(a)redhat.com>
-- rebuild against tcltk 8.3.1.
+* Fri Mar 1 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-11
+- Add a not to the Distutils obsoletes test (doh!)
-* Fri Apr 28 2000 Matt Wilson <msw(a)redhat.com>
-- rebuild against gmp 3.0.1
+* Fri Mar 1 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-10
+- Rebuild
-* Wed Apr 5 2000 Bill Nottingham <notting(a)redhat.com>
-- what he said
+* Mon Feb 25 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-9
+- Only obsolete Distutils when built as python
-* Tue Mar 21 2000 Bernhard Rosenkraenzer <bero(a)redhat.com>
-- rebuild with readline 4.1
+* Thu Feb 21 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-8
+- Make files in /usr/bin install side by side with python 1.5 when
+- Drop explicit requirement of db4
+ built as python2
-* Sat Mar 18 2000 Jeff Johnson <jbj(a)redhat.com>
-- rebuild tkinter against tcl-8.2.3.
+* Thu Jan 31 2002 Elliot Lee <sopwith(a)redhat.com> 2.2-7
+- Use version and pybasever macros to make updating easy
+- Use _smp_mflags macro
-* Thu Mar 09 2000 Nalin Dahyabhai <nalin(a)redhat.com>
-- build _localemodule.so to fix bug #9385 (release 14)
+* Tue Jan 29 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-6
+- Add db4-devel to BuildPrereq
-* Tue Feb 01 2000 Cristian Gafton <gafton(a)redhat.com>
-- add patch tp fix problems talioking to wuftpd from hjl
-- rebuild to fix dependencies
+* Fri Jan 25 2002 Nalin Dahyabhai <nalin(a)redhat.com> 2.2-5
+- disable ndbm support, which is db2 in disguise (really interesting things
+ can happen when you mix db2 and db4 in a single application)
-* Mon Jan 31 2000 Nalin Dahyabhai <nalin(a)redhat.com>
-- add buildrequires lines (#8925)
+* Thu Jan 24 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-4
+- Obsolete subpackages if necesarry
+- provide versioned python2
+- build with db4
-* Mon Jan 17 2000 Nalin Dahyabhai <nalin(a)redhat.com>
-- put idle, modulator, and pynche only in python-tools
+* Wed Jan 16 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-3
+- Alpha toolchain broken. Disable build on alpha.
+- New openssl
-* Thu Dec 02 1999 Michael K. Johnson <johnsonm(a)redhat.com>
-- fixed whichdb patch to actually do something (#7458)
+* Wed Dec 26 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-1
+- 2.2 final
-* Mon Nov 22 1999 Michael K. Johnson <johnsonm(a)redhat.com>
-- link nismodule against -lnss
-- whichdb patch by Guido (
Python.org bug 97)
+* Fri Dec 14 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.11c1
+- 2.2 RC 1
+- Don't include the _tkinter module in the main package - it's
+ already in the tkiter packace
+- Turn off the mpzmodule, something broke in the buildroot
-* Fri Sep 17 1999 Tim Powers <timp(a)redhat.com>
-- added modulator and pynche to the python-tools package
-- using a files list in the %files section for python-tools
+* Wed Nov 28 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.10b2
+- Use -fPIC for OPT as well, in lack of a proper libpython.so
-* Fri Sep 17 1999 Michael K. Johnson <johnsonm(a)redhat.com>
-- added conflicts/requires between subpackages so that you cannot
- have an older tkinter installed with a new python.
-- added more tools
+* Mon Nov 26 2001 Matt Wilson <msw(a)redhat.com> 2.2-0.9b2
+- changed DESTDIR to point to / so that distutils will install dynload
+ modules properly in the installroot
-* Wed Sep 15 1999 Michael K. Johnson <johnsonm(a)redhat.com>
-- changed defattr so that executable scripts in docs stay executable
+* Fri Nov 16 2001 Matt Wilson <msw(a)redhat.com> 2.2-0.8b2
+- 2.2b2
-* Tue Aug 24 1999 Bill Nottingham <notting(a)redhat.com>
-- rebuild to fix broken tkinter.
+* Fri Oct 26 2001 Matt Wilson <msw(a)redhat.com> 2.2-0.7b1
+- python2ify
-* Mon Aug 9 1999 Matt Wilson <msw(a)redhat.com>
-- fixed bogus /usr/local/bin/python requirements
+* Fri Oct 19 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.5b1
+- 2.2b1
-* Sat Jul 17 1999 Matt Wilson <msw(a)redhat.com>
-- added patch to import global symbols until we get libtool patched
+* Sun Sep 30 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.4a4
+- 2.2a4
+- Enable UCS4 support
+- Enable IPv6
+- Provide distutils
+- Include msgfmt.py and pygettext.py
-* Sun Jul 11 1999 Matt Wilson <msw(a)redhat.com>
-- updated to 1.5.2
+* Fri Sep 14 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.3a3
+- Obsolete Distutils, which is now part of the main package
+- Obsolete python2
-* Sun Mar 21 1999 Cristian Gafton <gafton(a)redhat.com>
-- auto rebuild in the new build environment (release 10)
+* Thu Sep 13 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.2a3
+- Add docs, tools and tkinter subpackages, to match the 1.5 layout
-* Thu Mar 18 1999 Bill Nottingham <notting(a)redhat.com>
-- fix permissions in python-docs
+* Wed Sep 12 2001 Trond Eivind Glomsrd <teg(a)redhat.com> 2.2-0.1a3
+- 2.2a3
+- don't build tix and blt extensions
-* Thu Feb 11 1999 Michael Johnson <johnsonm(a)redhat.com>
-- added mpzmodule at user request (uses gmp)
-- added bsddbmodule at user request (uses db 1.85 interface)
+* Mon Aug 13 2001 Trond Eivind Glomsrd <teg(a)redhat.com>
+- Add tk and tix to build dependencies
-* Mon Feb 08 1999 Michael Johnson <johnsonm(a)redhat.com>
-- add --with-threads at user request
-- clean up spec file
+* Sat Jul 21 2001 Trond Eivind Glomsrd <teg(a)redhat.com>
+- 2.1.1 bugfix release - with a GPL compatible license
-* Fri Jan 08 1999 Michael K. Johnson <johnsonm(a)redhat.com>
-- New libc changes ndbm.h to db1/ndbm.h and -ldb to -ldb1
+* Fri Jul 20 2001 Trond Eivind Glomsrd <teg(a)redhat.com>
+- Add new build dependencies (#49753)
-* Thu Sep 3 1998 Jeff Johnson <jbj(a)redhat.com>
-- recompile for RH 5.2.
+* Tue Jun 26 2001 Nalin Dahyabhai <nalin(a)redhat.com>
+- build with -fPIC
-* Wed May 06 1998 Cristian Gafton <gafton(a)redhat.com>
-- python-docs used to require /usr/bin/sed. Changed to /bin/sed instead
+* Fri Jun 1 2001 Trond Eivind Glomsrd <teg(a)redhat.com>
+- 2.1
+- reorganization of file includes
-* Wed Apr 29 1998 Cristian Gafton <gafton(a)redhat.com>
-- fixed the spec file for version 1.5.1
-- buildroot (!)
+* Wed Dec 20 2000 Trond Eivind Glomsrd <teg(a)redhat.com>
+- fix the "requires" clause, it lacked a space causing problems
+- use %%{_tmppath}
+- don't define name, version etc
+- add the available patches from the Python home page
-* Mon Apr 20 1998 Michael K. Johnson <johnsonm(a)redhat.com>
-- updated to python 1.5.1
-- created our own Python-Doc tar file from 1.5 to substitute for the
- not-yet-released Doc package.
-- build _tkinter properly
-- use readline again
-- build crypt module again
-- install rand replacement module
-- added a few modules
+* Fri Dec 15 2000 Matt Wilson <msw(a)redhat.com>
+- added devel subpackage
-* Thu Apr 09 1998 Erik Troan <ewt(a)redhat.com>
-- updated to python 1.5
-- made /usr/lib/python1.5 file list automatically generated
+* Fri Dec 15 2000 Matt Wilson <msw(a)redhat.com>
+- modify all files to use "python2.0" as the intrepter
+- don't build the Expat bindings
+- build against db1
-* Tue Nov 04 1997 Michael K. Johnson <johnsonm(a)redhat.com>
-- Fixed dependencies for python and tkinter
+* Mon Oct 16 2000 Jeremy Hylton <jeremy(a)beopen.com>
+- updated for 2.0 final
-* Mon Nov 03 1997 Michael K. Johnson <johnsonm(a)redhat.com>
-- pulled out tk-related stuff into tkinter package
+* Mon Oct 9 2000 Jeremy Hylton <jeremy(a)beopen.com>
+- updated for 2.0c1
+- build audioop, imageop, and rgbimg extension modules
+- include xml.parsers subpackage
+- add test.xml.out to files list
-* Fri Oct 10 1997 Erik Troan <ewt(a)redhat.com>
-- bunches of scripts used /usr/local/bin/python instead of /usr/bin/python
+* Thu Oct 5 2000 Jeremy Hylton <jeremy(a)beopen.com>
+- added bin/python2.0 to files list (suggested by Martin v. Lwis)
-* Tue Sep 30 1997 Erik Troan <ewt(a)redhat.com>
-- updated for tcl/tk 8.0
+* Tue Sep 26 2000 Jeremy Hylton <jeremy(a)beopen.com>
+- updated for release 1 of 2.0b2
+- use .bz2 version of Python source
-* Thu Jul 10 1997 Erik Troan <ewt(a)redhat.com>
-- built against glibc
+* Tue Sep 12 2000 Jeremy Hylton <jeremy(a)beopen.com>
+- Version 2 of 2.0b1
+- Make the package relocatable. Thanks to Suchandra Thapa.
+- Exclude Tkinter from main RPM. If it is in a separate RPM, it is
+ easier to track Tk releases.
diff --git a/sources b/sources
index 2b497ac..bfcefe3 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-a24e1317c53d8e29367860bdc7b15cd3 Python-Doc.tar.gz
-e9d677ae6d5a3efc6937627ed8a3e752 py152.tgz
+e784f9ad69ac6ac0eb12f105570f7908 JapaneseCodecs-1.4.6.tar.gz
+e7012d611602b62e36073c2fd02396a3 Python-2.2.1.tgz
commit c8fb8c54c4881c82cb0e0ac559643b5b5f5a8dca
Author: cvsdist <cvsdist(a)fedoraproject.org>
Date: Thu Sep 9 11:01:24 2004 +0000
auto-import changelog data from python-1.5.2-43.73.src.rpm
Thu Jan 30 2003 Mihai Ibanescu <misa(a)redhat.com> 1.5.2-43
- Rebuild
Tue Jan 14 2003 Mihai Ibanescu <misa(a)redhat.com> 1.5.2-42
- Fixed bug #81796: python time.strptime() causes segfault on ia64
Fri Jan 10 2003 Mihai Ibanescu <misa(a)redhat.com> 1.5.2-41
- Fixed the https patch: writing binary data through an SSL port would bork
if the data has nulls in it.
- Fixed MACHDEP
Tue Nov 05 2002 Mihai Ibanescu <misa(a)redhat.com> 1.5.2-41
- Removed Doc/.cvsignore
Tue Nov 05 2002 Mihai Ibanescu <misa(a)redhat.com> 1.5.2-40.73
- Fixed the security patch
- Fixed a race condition in popen2:_test()
Wed Sep 11 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 1.5.2-38.73
- Add security patch
diff --git a/python.spec b/python.spec
index f4c5bc5..08459a6 100644
--- a/python.spec
+++ b/python.spec
@@ -9,7 +9,7 @@
Summary: An interpreted, interactive object-oriented programming language.
Name: python
Version: 1.5.2
-Release: 38
+Release: 43.73
License: distributable
Group: Development/Languages
Source0:
ftp://ftp.python.org/pub/python/src/py152.tgz
@@ -33,7 +33,11 @@ Patch7: python-1.5.2-_locale.patch
Patch8: python-1.5.2-tcl831.patch
Patch9: python-1.5.2-https.patch
Patch10: python-1.5.2-gmp4.patch
-BuildRequires: readline readline-devel zlib zlib-devel gmp gmp-devel gdbm gdbm-devel
+Patch11: python-1.5.2-sec.patch
+Patch12: python-1.1.2-test-popen2.patch
+Patch13: python-1.5.2-strptime.patch
+BuildRequires: readline readline-devel zlib zlib-devel
+BuildRequires: gmp gmp-devel gdbm gdbm-devel openssl-devel tix
Conflicts: tkinter < %{version}-%{release}
BuildRoot: %{_tmppath}/%{name}/python-root
@@ -127,6 +131,9 @@ user interface for Python programming.
%patch8 -p1 -b .tcl823
%patch9 -p1 -b .https
%patch10 -p1 -b .gmp4
+%patch11 -p1 -b .sec
+%patch12 -p1 -b .testcase
+%patch13 -p1 -b .strptime
find . -name "*.nosed" -exec rm -f {} \;
@@ -148,7 +155,7 @@ echo "shm shmmodule.c" >> Modules/Setup.in
%ifnarch s390 s390x
RPM_OPT_FLAGS="$RPM_OPT_FLAGS -fno-merge-constants"
%endif
-MACHDEP=linux-$RPM_ARCH ; export MACHDEP
+MACHDEP=linux-%{_target_cpu} ; export MACHDEP
%configure --with-threads
make OPT="$RPM_OPT_FLAGS -fPIC" LDFLAGS=-s
@@ -210,6 +217,9 @@ find $DIR3 -type f | sed -e "s#^${RPM_BUILD_ROOT}##g"
>> python-tools.files
find $RPM_BUILD_ROOT%{_prefix}/lib/python1.5 -type f -name "*.pyc" | xargs rm
-v
PYTHONPATH=$RPM_BUILD_ROOT%{_prefix}/lib/python1.5 $RPM_BUILD_ROOT%{_bindir}/python -c
"import compileall;
compileall.compile_dir('"$RPM_BUILD_ROOT"/usr/lib/python1.5', 4,
'/usr/lib/python1.5/site-packages')"
+# Remove unneeded files
+rm -f Doc/.cvsignore Doc/ref/.cvsignore Doc/.latex2html-init
+
%clean
rm -rf ${RPM_BUILD_ROOT}
rm -f modules-list modules-list.full
@@ -253,6 +263,27 @@ rm -f modules-list modules-list.full
%{_prefix}/lib/python1.5/lib-dynload/_tkinter.so
%changelog
+* Thu Jan 30 2003 Mihai Ibanescu <misa(a)redhat.com> 1.5.2-43
+- Rebuild
+
+* Tue Jan 14 2003 Mihai Ibanescu <misa(a)redhat.com> 1.5.2-42
+- Fixed bug #81796: python time.strptime() causes segfault on ia64
+
+* Fri Jan 10 2003 Mihai Ibanescu <misa(a)redhat.com> 1.5.2-41
+- Fixed the https patch: writing binary data through an SSL port would bork if
+ the data has nulls in it.
+- Fixed MACHDEP
+
+* Tue Nov 5 2002 Mihai Ibanescu <misa(a)redhat.com> 1.5.2-41
+- Removed Doc/.cvsignore
+
+* Tue Nov 5 2002 Mihai Ibanescu <misa(a)redhat.com> 1.5.2-40.73
+- Fixed the security patch
+- Fixed a race condition in popen2:_test()
+
+* Wed Sep 11 2002 Trond Eivind Glomsrd <teg(a)redhat.com> 1.5.2-38.73
+- Add security patch
+
* Wed Apr 3 2002 Matt Wilson <msw(a)redhat.com> 1.5.2-38
- include a new version of the https patch from gafton
- added shm module at the request of gafton.
commit c365dbf929f498a14f26ba2ff7e39e1f70a7d5a1
Author: cvsdist <cvsdist(a)fedoraproject.org>
Date: Thu Sep 9 10:59:59 2004 +0000
auto-import changelog data from python-1.5.2-38.src.rpm
Wed Apr 03 2002 Matt Wilson <msw(a)redhat.com> 1.5.2-38
- include a new version of the https patch from gafton
- added shm module at the request of gafton.
Tue Mar 26 2002 Nalin Dahyabhai <nalin(a)redhat.com> 1.5.2-37
- backport patch to make mpzmodule happy with gmp4
diff --git a/python.spec b/python.spec
index ebed6e3..f4c5bc5 100644
--- a/python.spec
+++ b/python.spec
@@ -1,15 +1,15 @@
-%define tcltk_major 8.3
-%ifarch ia64
-%define depsuffix ()(64bit)
-%else
-%define depsuffix %{nil}
-%endif
-%define tkinter_tcldeps %{expand:libtcl%%{tcltk_major}.so%%{depsuffix}
libtk%%{tcltk_major}.so%%{depsuffix} libtix4.1.%%{tcltk_major}.so%%{depsuffix}}
+#%define tcltk_major 8.3
+#%ifarch ia64
+#%define depsuffix ()(64bit)
+#%else
+#%define depsuffix %{nil}
+#%endif
+#%define tkinter_tcldeps %{expand:libtcl%%{tcltk_major}.so%%{depsuffix}
libtk%%{tcltk_major}.so%%{depsuffix} libtix4.1.%%{tcltk_major}.so%%{depsuffix}}
Summary: An interpreted, interactive object-oriented programming language.
Name: python
Version: 1.5.2
-Release: 36
+Release: 38
License: distributable
Group: Development/Languages
Source0:
ftp://ftp.python.org/pub/python/src/py152.tgz
@@ -18,6 +18,7 @@ Source2: idle
Source3: modulator
Source4: pynche
Source5: gettext.py
+Source6:
http://gigue.peabody.jhu.edu/~mdboom/omi/source/shm_source/shmmodule.c
Source10: inspect.py
Source11: pydoc.py
@@ -31,8 +32,9 @@ Patch6: python-1.5.2-wuftpd.patch
Patch7: python-1.5.2-_locale.patch
Patch8: python-1.5.2-tcl831.patch
Patch9: python-1.5.2-https.patch
+Patch10: python-1.5.2-gmp4.patch
BuildRequires: readline readline-devel zlib zlib-devel gmp gmp-devel gdbm gdbm-devel
-Conflicts: tkinter < %{PACKAGE_VERSION}
+Conflicts: tkinter < %{version}-%{release}
BuildRoot: %{_tmppath}/%{name}/python-root
%description
@@ -55,7 +57,7 @@ package.
%package devel
Summary: The libraries and header files needed for Python development.
Group: Development/Libraries
-Requires: python = %{PACKAGE_VERSION}
+Requires: python = %{version}-%{release}
%description devel
The Python programming language's interpreter can be extended with
@@ -71,7 +73,7 @@ documentation.
%package tools
Summary: A collection of development tools included with Python.
Group: Development/Tools
-Requires: python = %{PACKAGE_VERSION}
+Requires: python = %{version}-%{release}
%description tools
The Python package includes several development tools that are used
@@ -85,7 +87,7 @@ tkinter packages.
%package docs
Summary: Documentation for the Python programming language.
Group: Documentation
-Conflicts: python < %{PACKAGE_VERSION}
+Conflicts: python < %{version}-%{release}
%description docs
The python-docs package contains documentation on the Python
@@ -98,8 +100,9 @@ for the Python language.
%package -n tkinter
Summary: A graphical user interface for the Python scripting language.
Group: Development/Languages
-BuildPrereq: %{tkinter_tcldeps}
-Requires: python = %{PACKAGE_VERSION}
+#BuildPrereq: %{tkinter_tcldeps}
+BuildPrereq: tcl >= 8.3
+Requires: python = %{version}-%{release}
%description -n tkinter
The Tkinter (Tk interface) program is an graphical user interface for
@@ -123,6 +126,7 @@ user interface for Python programming.
%patch7 -p1 -b ._locale
%patch8 -p1 -b .tcl823
%patch9 -p1 -b .https
+%patch10 -p1 -b .gmp4
find . -name "*.nosed" -exec rm -f {} \;
@@ -136,6 +140,10 @@ cp %{SOURCE5} Lib
# inspect.py and pydoc.py
cp %{SOURCE10} %{SOURCE11} Lib
+# shm module
+cp %{SOURCE6} Modules
+echo "shm shmmodule.c" >> Modules/Setup.in
+
%build
%ifnarch s390 s390x
RPM_OPT_FLAGS="$RPM_OPT_FLAGS -fno-merge-constants"
@@ -245,6 +253,13 @@ rm -f modules-list modules-list.full
%{_prefix}/lib/python1.5/lib-dynload/_tkinter.so
%changelog
+* Wed Apr 3 2002 Matt Wilson <msw(a)redhat.com> 1.5.2-38
+- include a new version of the https patch from gafton
+- added shm module at the request of gafton.
+
+* Tue Mar 26 2002 Nalin Dahyabhai <nalin(a)redhat.com> 1.5.2-37
+- backport patch to make mpzmodule happy with gmp4
+
* Mon Mar 25 2002 Nalin Dahyabhai <nalin(a)redhat.com> 1.5.2-36
- rebuild
commit 89e002ad2a47038f3976dede01dafdac423d7dd8
Author: cvsdist <cvsdist(a)fedoraproject.org>
Date: Thu Sep 9 10:59:56 2004 +0000
auto-import changelog data from python-1.5.2-36.src.rpm
Mon Mar 25 2002 Nalin Dahyabhai <nalin(a)redhat.com> 1.5.2-36
- rebuild
diff --git a/python.spec b/python.spec
index 5395aa7..ebed6e3 100644
--- a/python.spec
+++ b/python.spec
@@ -9,7 +9,7 @@
Summary: An interpreted, interactive object-oriented programming language.
Name: python
Version: 1.5.2
-Release: 35
+Release: 36
License: distributable
Group: Development/Languages
Source0:
ftp://ftp.python.org/pub/python/src/py152.tgz
@@ -245,6 +245,9 @@ rm -f modules-list modules-list.full
%{_prefix}/lib/python1.5/lib-dynload/_tkinter.so
%changelog
+* Mon Mar 25 2002 Nalin Dahyabhai <nalin(a)redhat.com> 1.5.2-36
+- rebuild
+
* Fri Jun 29 2001 Florian La Roche <Florian.LaRoche(a)redhat.de>
- do not set -fno-merge-constants on s390,s390x
- truncate changelog due to rpm errors
commit 19a5b75bf5b7e2081094e9812e5460741017f69e
Author: cvsdist <cvsdist(a)fedoraproject.org>
Date: Thu Sep 9 10:58:16 2004 +0000
auto-import python-1.5.2-35 from python-1.5.2-35.src.rpm
diff --git a/python.spec b/python.spec
index 0361a43..5395aa7 100644
--- a/python.spec
+++ b/python.spec
@@ -9,7 +9,7 @@
Summary: An interpreted, interactive object-oriented programming language.
Name: python
Version: 1.5.2
-Release: 34
+Release: 35
License: distributable
Group: Development/Languages
Source0:
ftp://ftp.python.org/pub/python/src/py152.tgz
@@ -137,7 +137,9 @@ cp %{SOURCE5} Lib
cp %{SOURCE10} %{SOURCE11} Lib
%build
+%ifnarch s390 s390x
RPM_OPT_FLAGS="$RPM_OPT_FLAGS -fno-merge-constants"
+%endif
MACHDEP=linux-$RPM_ARCH ; export MACHDEP
%configure --with-threads
@@ -243,7 +245,11 @@ rm -f modules-list modules-list.full
%{_prefix}/lib/python1.5/lib-dynload/_tkinter.so
%changelog
-* Wed Jul 27 2001 Elliot Lee <sopwith(a)redhat.com>
+* Fri Jun 29 2001 Florian La Roche <Florian.LaRoche(a)redhat.de>
+- do not set -fno-merge-constants on s390,s390x
+- truncate changelog due to rpm errors
+
+* Wed Jun 27 2001 Elliot Lee <sopwith(a)redhat.com>
- -fno-merge-constants
* Tue Jun 12 2001 Nalin Dahyabhai <nalin(a)redhat.com>
commit 6b969f104381c80e533edfc6721edbecc189a57f
Author: cvsdist <cvsdist(a)fedoraproject.org>
Date: Thu Sep 9 10:58:12 2004 +0000
auto-import changelog data from python-1.5.2-34.src.rpm
Fri Jul 27 2001 Elliot Lee <sopwith(a)redhat.com>
- -fno-merge-constants
Tue Jun 12 2001 Nalin Dahyabhai <nalin(a)redhat.com>
- rebuild in new environment
- s/Copyright:/License:/
Fri May 11 2001 Bernhard Rosenkraenzer <bero(a)redhat.com> 1.5.2-32
- rebuild with new readline
Fri May 04 2001 Preston Brown <pbrown(a)redhat.com> 1.5.2-31
- inspect.py and pydoc.py modules added
diff --git a/python.spec b/python.spec
index c0fedf2..0361a43 100644
--- a/python.spec
+++ b/python.spec
@@ -9,8 +9,8 @@
Summary: An interpreted, interactive object-oriented programming language.
Name: python
Version: 1.5.2
-Release: 30
-Copyright: distributable
+Release: 34
+License: distributable
Group: Development/Languages
Source0:
ftp://ftp.python.org/pub/python/src/py152.tgz
Source1: Python-Doc.tar.gz
@@ -18,6 +18,9 @@ Source2: idle
Source3: modulator
Source4: pynche
Source5: gettext.py
+Source10: inspect.py
+Source11: pydoc.py
+
Patch0: python-1.5.2-config.patch
Patch1: python-1.4-gccbug.patch
Patch2: Python-1.5.1-nosed.patch
@@ -130,7 +133,11 @@ echo ': ${CCSHARED='-fPIC'}' >> config.cache
cp Lib/lib-old/rand.py Lib
cp %{SOURCE5} Lib
+# inspect.py and pydoc.py
+cp %{SOURCE10} %{SOURCE11} Lib
+
%build
+RPM_OPT_FLAGS="$RPM_OPT_FLAGS -fno-merge-constants"
MACHDEP=linux-$RPM_ARCH ; export MACHDEP
%configure --with-threads
@@ -236,6 +243,19 @@ rm -f modules-list modules-list.full
%{_prefix}/lib/python1.5/lib-dynload/_tkinter.so
%changelog
+* Wed Jul 27 2001 Elliot Lee <sopwith(a)redhat.com>
+- -fno-merge-constants
+
+* Tue Jun 12 2001 Nalin Dahyabhai <nalin(a)redhat.com>
+- rebuild in new environment
+- s/Copyright:/License:/
+
+* Fri May 11 2001 Bernhard Rosenkraenzer <bero(a)redhat.com> 1.5.2-32
+- rebuild with new readline
+
+* Fri May 4 2001 Preston Brown <pbrown(a)redhat.com> 1.5.2-31
+- inspect.py and pydoc.py modules added
+
* Fri Mar 2 2001 Nalin Dahyabhai <nalin(a)redhat.com>
- rebuild in new environment
commit 6b01c7b480542840ef48d3ab1d8acfcbb32f1e53
Author: cvsdist <cvsdist(a)fedoraproject.org>
Date: Thu Sep 9 10:58:02 2004 +0000
auto-import changelog data from python-1.5.2-30.src.rpm
Fri Mar 02 2001 Nalin Dahyabhai <nalin(a)redhat.com>
- rebuild in new environment
Fri Jan 19 2001 Nalin Dahyabhai <nalin(a)redhat.com>
- build even the static libs with -fPIC
- obey RPM_OPT_FLAGS
Fri Jan 19 2001 Matt Wilson <msw(a)redhat.com>
- added gettext.py from gnome-python, closes #23212
- did some evail buildprereq stuff to make it go on ia64
diff --git a/python.spec b/python.spec
index 33ac56e..c0fedf2 100644
--- a/python.spec
+++ b/python.spec
@@ -1,7 +1,15 @@
+%define tcltk_major 8.3
+%ifarch ia64
+%define depsuffix ()(64bit)
+%else
+%define depsuffix %{nil}
+%endif
+%define tkinter_tcldeps %{expand:libtcl%%{tcltk_major}.so%%{depsuffix}
libtk%%{tcltk_major}.so%%{depsuffix} libtix4.1.%%{tcltk_major}.so%%{depsuffix}}
+
Summary: An interpreted, interactive object-oriented programming language.
Name: python
Version: 1.5.2
-Release: 28
+Release: 30
Copyright: distributable
Group: Development/Languages
Source0:
ftp://ftp.python.org/pub/python/src/py152.tgz
@@ -9,6 +17,7 @@ Source1: Python-Doc.tar.gz
Source2: idle
Source3: modulator
Source4: pynche
+Source5: gettext.py
Patch0: python-1.5.2-config.patch
Patch1: python-1.4-gccbug.patch
Patch2: Python-1.5.1-nosed.patch
@@ -86,7 +95,7 @@ for the Python language.
%package -n tkinter
Summary: A graphical user interface for the Python scripting language.
Group: Development/Languages
-BuildPrereq: tcl tk
+BuildPrereq: %{tkinter_tcldeps}
Requires: python = %{PACKAGE_VERSION}
%description -n tkinter
@@ -119,12 +128,13 @@ echo ': ${LINKFORSHARED='-rdynamic'}' >>
config.cache
echo ': ${CCSHARED='-fPIC'}' >> config.cache
cp Lib/lib-old/rand.py Lib
+cp %{SOURCE5} Lib
%build
-export MACHDEP=linux-$RPM_ARCH
+MACHDEP=linux-$RPM_ARCH ; export MACHDEP
%configure --with-threads
-LDFLAGS=-s make
+make OPT="$RPM_OPT_FLAGS -fPIC" LDFLAGS=-s
%install
rm -rf ${RPM_BUILD_ROOT}
@@ -226,8 +236,16 @@ rm -f modules-list modules-list.full
%{_prefix}/lib/python1.5/lib-dynload/_tkinter.so
%changelog
-* Tue Sep 26 2000 Bill Nottingham <notting(a)redhat.com>
-- remove library specific buildprereqs:; it won't work on sparc64/ia64
+* Fri Mar 2 2001 Nalin Dahyabhai <nalin(a)redhat.com>
+- rebuild in new environment
+
+* Fri Jan 19 2001 Nalin Dahyabhai <nalin(a)redhat.com>
+- build even the static libs with -fPIC
+- obey RPM_OPT_FLAGS
+
+* Fri Jan 19 2001 Matt Wilson <msw(a)redhat.com>
+- added gettext.py from gnome-python, closes #23212
+- did some evail buildprereq stuff to make it go on ia64
* Fri Aug 25 2000 Preston Brown <pbrown(a)redhat.com>
- Cristian had to supply a newer version of https handling for working
commit ed2d2e6dae6a56ff07b4661c567403032adcaabf
Author: cvsdist <cvsdist(a)fedoraproject.org>
Date: Thu Sep 9 10:57:51 2004 +0000
auto-import changelog data from python-1.5.2-28.src.rpm
Tue Sep 26 2000 Bill Nottingham <notting(a)redhat.com>
- remove library specific buildprereqs:; it won't work on sparc64/ia64
diff --git a/python.spec b/python.spec
index bc1944e..33ac56e 100644
--- a/python.spec
+++ b/python.spec
@@ -1,10 +1,7 @@
-%define tcltk_major 8.3
-%define tkinter_tcldeps libtcl%{tcltk_major}.so libtk%{tcltk_major}.so
libtix4.1.%{tcltk_major}.so
-
Summary: An interpreted, interactive object-oriented programming language.
Name: python
Version: 1.5.2
-Release: 27
+Release: 28
Copyright: distributable
Group: Development/Languages
Source0:
ftp://ftp.python.org/pub/python/src/py152.tgz
@@ -89,7 +86,7 @@ for the Python language.
%package -n tkinter
Summary: A graphical user interface for the Python scripting language.
Group: Development/Languages
-BuildPrereq: %{tkinter_tcldeps}
+BuildPrereq: tcl tk
Requires: python = %{PACKAGE_VERSION}
%description -n tkinter
@@ -229,6 +226,9 @@ rm -f modules-list modules-list.full
%{_prefix}/lib/python1.5/lib-dynload/_tkinter.so
%changelog
+* Tue Sep 26 2000 Bill Nottingham <notting(a)redhat.com>
+- remove library specific buildprereqs:; it won't work on sparc64/ia64
+
* Fri Aug 25 2000 Preston Brown <pbrown(a)redhat.com>
- Cristian had to supply a newer version of https handling for working
with certificates
commit 412e296839b3255b5b776a454c940aca6e17e7d7
Author: cvsdist <cvsdist(a)fedoraproject.org>
Date: Thu Sep 9 10:57:47 2004 +0000
auto-import changelog data from python-1.5.2-27.src.rpm
Fri Aug 25 2000 Preston Brown <pbrown(a)redhat.com>
- Cristian had to supply a newer version of https handling for working with
certificates
Thu Aug 24 2000 Nalin Dahyabhai <nalin(a)redhat.com>
- re-merge Preston's patch
diff --git a/python.spec b/python.spec
index e61f103..bc1944e 100644
--- a/python.spec
+++ b/python.spec
@@ -4,7 +4,7 @@
Summary: An interpreted, interactive object-oriented programming language.
Name: python
Version: 1.5.2
-Release: 25
+Release: 27
Copyright: distributable
Group: Development/Languages
Source0:
ftp://ftp.python.org/pub/python/src/py152.tgz
@@ -21,6 +21,7 @@ Patch5: python-1.5.2-wdb.patch
Patch6: python-1.5.2-wuftpd.patch
Patch7: python-1.5.2-_locale.patch
Patch8: python-1.5.2-tcl831.patch
+Patch9: python-1.5.2-https.patch
BuildRequires: readline readline-devel zlib zlib-devel gmp gmp-devel gdbm gdbm-devel
Conflicts: tkinter < %{PACKAGE_VERSION}
BuildRoot: %{_tmppath}/%{name}/python-root
@@ -112,6 +113,7 @@ user interface for Python programming.
%patch6 -p1
%patch7 -p1 -b ._locale
%patch8 -p1 -b .tcl823
+%patch9 -p1 -b .https
find . -name "*.nosed" -exec rm -f {} \;
@@ -227,9 +229,19 @@ rm -f modules-list modules-list.full
%{_prefix}/lib/python1.5/lib-dynload/_tkinter.so
%changelog
+* Fri Aug 25 2000 Preston Brown <pbrown(a)redhat.com>
+- Cristian had to supply a newer version of https handling for working
+ with certificates
+
+* Thu Aug 24 2000 Nalin Dahyabhai <nalin(a)redhat.com>
+- re-merge Preston's patch
+
* Wed Aug 23 2000 Nalin Dahyabhai <nalin(a)redhat.com>
- byte-compile modules with the correct directory paths
+* Sun Aug 20 2000 Preston Brown <pbrown(a)redhat.com>
+- https patch
+
* Mon Jul 31 2000 Matt Wilson <msw(a)redhat.com>
- fixed directory perms from 775 to 755 to make rpmlint shut up
commit e4efab2b1949bde08962a6c4627f2436057fae28
Author: cvsdist <cvsdist(a)fedoraproject.org>
Date: Thu Sep 9 10:57:31 2004 +0000
auto-import changelog data from python-1.5.2-25.src.rpm
Wed Aug 23 2000 Nalin Dahyabhai <nalin(a)redhat.com>
- byte-compile modules with the correct directory paths
Mon Jul 31 2000 Matt Wilson <msw(a)redhat.com>
- fixed directory perms from 775 to 755 to make rpmlint shut up
Wed Jul 12 2000 Prospector <bugzilla(a)redhat.com>
- automatic rebuild
Sun Jun 18 2000 Bill Nottingham <notting(a)redhat.com>
- rebuild, fix dependencies
Thu Jun 15 2000 Matt Wilson <msw(a)redhat.com>
- rebuilt against new tcltk
Sat Jun 03 2000 Jeff Johnson <jbj(a)redhat.com>
- rebuild against tcltk 8.3.1.
Fri Apr 28 2000 Matt Wilson <msw(a)redhat.com>
- rebuild against gmp 3.0.1
Wed Apr 05 2000 Bill Nottingham <notting(a)redhat.com>
- what he said
Tue Mar 21 2000 Bernhard Rosenkraenzer <bero(a)redhat.com>
- rebuild with readline 4.1
Sat Mar 18 2000 Jeff Johnson <jbj(a)redhat.com>
- rebuild tkinter against tcl-8.2.3.
Thu Mar 09 2000 Nalin Dahyabhai <nalin(a)redhat.com>
- build _localemodule.so to fix bug #9385 (release 14)
Tue Feb 01 2000 Cristian Gafton <gafton(a)redhat.com>
- add patch tp fix problems talioking to wuftpd from hjl
- rebuild to fix dependencies
Mon Jan 31 2000 Nalin Dahyabhai <nalin(a)redhat.com>
- add buildrequires lines (#8925)
Mon Jan 17 2000 Nalin Dahyabhai <nalin(a)redhat.com>
- put idle, modulator, and pynche only in python-tools
Thu Dec 02 1999 Michael K. Johnson <johnsonm(a)redhat.com>
- fixed whichdb patch to actually do something (#7458)
Mon Nov 22 1999 Michael K. Johnson <johnsonm(a)redhat.com>
- link nismodule against -lnss
- whichdb patch by Guido (
Python.org bug 97)
Fri Sep 17 1999 Tim Powers <timp(a)redhat.com>
- added modulator and pynche to the python-tools package
- using a files list in the %files section for python-tools
Fri Sep 17 1999 Michael K. Johnson <johnsonm(a)redhat.com>
- added conflicts/requires between subpackages so that you cannot have an
older tkinter installed with a new python.
- added more tools
Wed Sep 15 1999 Michael K. Johnson <johnsonm(a)redhat.com>
- changed defattr so that executable scripts in docs stay executable
Tue Aug 24 1999 Bill Nottingham <notting(a)redhat.com>
- rebuild to fix broken tkinter.
Mon Aug 09 1999 Matt Wilson <msw(a)redhat.com>
- fixed bogus /usr/local/bin/python requirements
Sat Jul 17 1999 Matt Wilson <msw(a)redhat.com>
- added patch to import global symbols until we get libtool patched
Sun Jul 11 1999 Matt Wilson <msw(a)redhat.com>
- updated to 1.5.2
Sun Mar 21 1999 Cristian Gafton <gafton(a)redhat.com>
- auto rebuild in the new build environment (release 10)
Thu Mar 18 1999 Bill Nottingham <notting(a)redhat.com>
- fix permissions in python-docs
Thu Feb 11 1999 Michael Johnson <johnsonm(a)redhat.com>
- added mpzmodule at user request (uses gmp)
- added bsddbmodule at user request (uses db 1.85 interface)
Mon Feb 08 1999 Michael Johnson <johnsonm(a)redhat.com>
- add --with-threads at user request
- clean up spec file
Fri Jan 08 1999 Michael K. Johnson <johnsonm(a)redhat.com>
- New libc changes ndbm.h to db1/ndbm.h and -ldb to -ldb1
Thu Sep 03 1998 Jeff Johnson <jbj(a)redhat.com>
- recompile for RH 5.2.
Wed May 06 1998 Cristian Gafton <gafton(a)redhat.com>
- python-docs used to require /usr/bin/sed. Changed to /bin/sed instead
Wed Apr 29 1998 Cristian Gafton <gafton(a)redhat.com>
- fixed the spec file for version 1.5.1
- buildroot (!)
Mon Apr 20 1998 Michael K. Johnson <johnsonm(a)redhat.com>
- updated to python 1.5.1
- created our own Python-Doc tar file from 1.5 to substitute for the
not-yet-released Doc package.
- build _tkinter properly
- use readline again
- build crypt module again
- install rand replacement module
- added a few modules
Thu Apr 09 1998 Erik Troan <ewt(a)redhat.com>
- updated to python 1.5
- made /usr/lib/python1.5 file list automatically generated
Tue Nov 04 1997 Michael K. Johnson <johnsonm(a)redhat.com>
- Fixed dependencies for python and tkinter
Mon Nov 03 1997 Michael K. Johnson <johnsonm(a)redhat.com>
- pulled out tk-related stuff into tkinter package
Fri Oct 10 1997 Erik Troan <ewt(a)redhat.com>
- bunches of scripts used /usr/local/bin/python instead of /usr/bin/python
Tue Sep 30 1997 Erik Troan <ewt(a)redhat.com>
- updated for tcl/tk 8.0
Thu Jul 10 1997 Erik Troan <ewt(a)redhat.com>
- built against glibc
diff --git a/.cvsignore b/.cvsignore
index e69de29..5a5f726 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -0,0 +1,2 @@
+Python-Doc.tar.gz
+py152.tgz
diff --git a/python.spec b/python.spec
new file mode 100644
index 0000000..e61f103
--- /dev/null
+++ b/python.spec
@@ -0,0 +1,358 @@
+%define tcltk_major 8.3
+%define tkinter_tcldeps libtcl%{tcltk_major}.so libtk%{tcltk_major}.so
libtix4.1.%{tcltk_major}.so
+
+Summary: An interpreted, interactive object-oriented programming language.
+Name: python
+Version: 1.5.2
+Release: 25
+Copyright: distributable
+Group: Development/Languages
+Source0:
ftp://ftp.python.org/pub/python/src/py152.tgz
+Source1: Python-Doc.tar.gz
+Source2: idle
+Source3: modulator
+Source4: pynche
+Patch0: python-1.5.2-config.patch
+Patch1: python-1.4-gccbug.patch
+Patch2: Python-1.5.1-nosed.patch
+Patch3: python-1.5.2-dl-global.patch
+Patch4: python-1.5.2-pythonpath.patch
+Patch5: python-1.5.2-wdb.patch
+Patch6: python-1.5.2-wuftpd.patch
+Patch7: python-1.5.2-_locale.patch
+Patch8: python-1.5.2-tcl831.patch
+BuildRequires: readline readline-devel zlib zlib-devel gmp gmp-devel gdbm gdbm-devel
+Conflicts: tkinter < %{PACKAGE_VERSION}
+BuildRoot: %{_tmppath}/%{name}/python-root
+
+%description
+Python is an interpreted, interactive, object-oriented programming
+language often compared to Tcl, Perl, Scheme or Java. Python includes
+modules, classes, exceptions, very high level dynamic data types and
+dynamic typing. Python supports interfaces to many system calls and
+libraries, as well as to various windowing systems (X11, Motif, Tk,
+Mac and MFC).
+
+Programmers can write new built-in modules for Python in C or C++.
+Python can be used as an extension language for applications that need
+a programmable interface. This package contains most of the standard
+Python modules, as well as modules for interfacing to the Tix widget
+set for Tk and RPM.
+
+Note that documentation for Python is provided in the python-docs
+package.
+
+%package devel
+Summary: The libraries and header files needed for Python development.
+Group: Development/Libraries
+Requires: python = %{PACKAGE_VERSION}
+
+%description devel
+The Python programming language's interpreter can be extended with
+dynamically loaded extensions and can be embedded in other programs.
+This package contains the header files and libraries needed to do
+these types of tasks.
+
+Install python-devel if you want to develop Python extensions. The
+python package will also need to be installed. You'll probably also
+want to install the python-docs package, which contains Python
+documentation.
+
+%package tools
+Summary: A collection of development tools included with Python.
+Group: Development/Tools
+Requires: python = %{PACKAGE_VERSION}
+
+%description tools
+The Python package includes several development tools that are used
+to build python programs. This package contains a selection of those
+tools, including the IDLE Python IDE.
+
+Install python-tools if you want to use these tools to develop
+Python programs. You will also need to install the python and
+tkinter packages.
+
+%package docs
+Summary: Documentation for the Python programming language.
+Group: Documentation
+Conflicts: python < %{PACKAGE_VERSION}
+
+%description docs
+The python-docs package contains documentation on the Python
+programming language and interpreter. The documentation is provided
+in ASCII text files and in LaTeX source files.
+
+Install the python-docs package if you'd like to use the documentation
+for the Python language.
+
+%package -n tkinter
+Summary: A graphical user interface for the Python scripting language.
+Group: Development/Languages
+BuildPrereq: %{tkinter_tcldeps}
+Requires: python = %{PACKAGE_VERSION}
+
+%description -n tkinter
+The Tkinter (Tk interface) program is an graphical user interface for
+the Python scripting language.
+
+You should install the tkinter package if you'd like to use a graphical
+user interface for Python programming.
+
+%prep
+%setup -q -n Python-1.5.2 -a 1
+%patch0 -p1 -b .config
+
+#%ifarch alpha
+#%patch1 -p1
+#%endif
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1 -b ._locale
+%patch8 -p1 -b .tcl823
+
+find . -name "*.nosed" -exec rm -f {} \;
+
+echo ': ${LDSHARED='gcc -shared'}' > config.cache
+echo ': ${LINKFORSHARED='-rdynamic'}' >> config.cache
+echo ': ${CCSHARED='-fPIC'}' >> config.cache
+
+cp Lib/lib-old/rand.py Lib
+
+%build
+export MACHDEP=linux-$RPM_ARCH
+%configure --with-threads
+
+LDFLAGS=-s make
+
+%install
+rm -rf ${RPM_BUILD_ROOT}
+mkdir -p ${RPM_BUILD_ROOT}%{_prefix}/{bin,lib}
+
+#make install prefix=${RPM_BUILD_ROOT}%{_prefix}
+%makeinstall
+strip ${RPM_BUILD_ROOT}%{_bindir}/python
+
+# tools
+# idle
+mkdir -p ${RPM_BUILD_ROOT}%{_prefix}/lib/python1.5/site-packages
+install -m 755 $RPM_SOURCE_DIR/idle ${RPM_BUILD_ROOT}%{_bindir}/idle
+mkdir -p ${RPM_BUILD_ROOT}%{_prefix}/lib/python1.5/site-packages/idle
+cp Tools/idle/*.py \
+ ${RPM_BUILD_ROOT}%{_prefix}/lib/python1.5/site-packages/idle/
+mv Tools/idle/help.txt \
+ ${RPM_BUILD_ROOT}%{_prefix}/lib/python1.5/site-packages/idle/
+mv Tools/idle/extend.txt \
+ ${RPM_BUILD_ROOT}%{_prefix}/lib/python1.5/site-packages/idle/
+
+#modulator
+install -m 755 $RPM_SOURCE_DIR/modulator ${RPM_BUILD_ROOT}%{_bindir}/modulator
+cp -r Tools/modulator \
+ ${RPM_BUILD_ROOT}%{_prefix}/lib/python1.5/site-packages/
+
+#pynche
+install -m 755 $RPM_SOURCE_DIR/pynche ${RPM_BUILD_ROOT}%{_bindir}/pynche
+rm Tools/pynche/*.pyw
+cp -r Tools/pynche \
+ ${RPM_BUILD_ROOT}%{_prefix}/lib/python1.5/site-packages/
+
+mv Tools/modulator/README Tools/modulator/README.modulator
+mv Tools/pynche/README Tools/pynche/README.pynche
+
+rm -f modules-list.full
+for n in ${RPM_BUILD_ROOT}%{_prefix}/lib/python1.5/*; do
+ [ -d $n ] || echo $n
+done >> modules-list.full
+
+for mod in ${RPM_BUILD_ROOT}%{_prefix}/lib/python1.5/lib-dynload/* ; do
+ [ `basename $mod` = _tkinter.so ] || echo $mod
+done >> modules-list.full
+sed -e "s|${RPM_BUILD_ROOT}||g" < modules-list.full > modules-list
+
+#get files list for python-tools
+DIR1=${RPM_BUILD_ROOT}%{_prefix}/lib/python1.5/site-packages/pynche
+DIR2=${RPM_BUILD_ROOT}%{_prefix}/lib/python1.5/site-packages/idle
+DIR3=${RPM_BUILD_ROOT}%{_prefix}/lib/python1.5/site-packages/modulator
+
+find $DIR1 -type f | sed -e "s#^${RPM_BUILD_ROOT}##g" > python-tools.files
+find $DIR2 -type f | sed -e "s#^${RPM_BUILD_ROOT}##g" >>
python-tools.files
+find $DIR3 -type f | sed -e "s#^${RPM_BUILD_ROOT}##g" >>
python-tools.files
+
+#rebytecompile modules with the right directory names
+find $RPM_BUILD_ROOT%{_prefix}/lib/python1.5 -type f -name "*.pyc" | xargs rm
-v
+PYTHONPATH=$RPM_BUILD_ROOT%{_prefix}/lib/python1.5 $RPM_BUILD_ROOT%{_bindir}/python -c
"import compileall;
compileall.compile_dir('"$RPM_BUILD_ROOT"/usr/lib/python1.5', 4,
'/usr/lib/python1.5/site-packages')"
+
+%clean
+rm -rf ${RPM_BUILD_ROOT}
+rm -f modules-list modules-list.full
+
+%files -f modules-list
+%defattr(-,root,root,755)
+%{_bindir}/python*
+%dir %{_prefix}/lib/python1.5
+%{_prefix}/lib/python1.5/plat-linux-%{_target_cpu}
+%{_prefix}/lib/python1.5/lib-stdwin
+%dir %{_prefix}/lib/python1.5/lib-dynload
+
+%files devel
+%defattr(-,root,root,755)
+%{_prefix}/lib/python*/test
+%{_prefix}/lib/python*/config
+%{_prefix}/include/python1.5
+
+%files -f python-tools.files tools
+%defattr(-,root,root,755)
+%doc Tools/idle/*.txt
+%doc Tools/modulator/README.modulator
+%doc Tools/pynche/README.pynche
+%dir %{_prefix}/lib/python1.5/site-packages/idle
+%dir %{_prefix}/lib/python1.5/site-packages/modulator
+%dir %{_prefix}/lib/python1.5/site-packages/modulator/Templates
+%dir %{_prefix}/lib/python1.5/site-packages/pynche
+%dir %{_prefix}/lib/python1.5/site-packages/pynche/X
+%{_bindir}/idle
+%{_bindir}/modulator
+%{_bindir}/pynche
+
+%files docs
+%defattr(-,root,root,755)
+%doc Misc/COPYRIGHT Misc/NEWS Misc/HYPE Misc/README Misc/cheatsheet Misc/BLURB*
+%doc Misc/HISTORY Doc
+
+%files -n tkinter
+%defattr(-,root,root,755)
+%{_prefix}/lib/python1.5/lib-tk
+%{_prefix}/lib/python1.5/lib-dynload/_tkinter.so
+
+%changelog
+* Wed Aug 23 2000 Nalin Dahyabhai <nalin(a)redhat.com>
+- byte-compile modules with the correct directory paths
+
+* Mon Jul 31 2000 Matt Wilson <msw(a)redhat.com>
+- fixed directory perms from 775 to 755 to make rpmlint shut up
+
+* Wed Jul 12 2000 Prospector <bugzilla(a)redhat.com>
+- automatic rebuild
+
+* Mon Jun 18 2000 Bill Nottingham <notting(a)redhat.com>
+- rebuild, fix dependencies
+
+* Thu Jun 15 2000 Matt Wilson <msw(a)redhat.com>
+- rebuilt against new tcltk
+
+* Sat Jun 3 2000 Jeff Johnson <jbj(a)redhat.com>
+- rebuild against tcltk 8.3.1.
+
+* Fri Apr 28 2000 Matt Wilson <msw(a)redhat.com>
+- rebuild against gmp 3.0.1
+
+* Wed Apr 5 2000 Bill Nottingham <notting(a)redhat.com>
+- what he said
+
+* Tue Mar 21 2000 Bernhard Rosenkraenzer <bero(a)redhat.com>
+- rebuild with readline 4.1
+
+* Sat Mar 18 2000 Jeff Johnson <jbj(a)redhat.com>
+- rebuild tkinter against tcl-8.2.3.
+
+* Thu Mar 09 2000 Nalin Dahyabhai <nalin(a)redhat.com>
+- build _localemodule.so to fix bug #9385 (release 14)
+
+* Tue Feb 01 2000 Cristian Gafton <gafton(a)redhat.com>
+- add patch tp fix problems talioking to wuftpd from hjl
+- rebuild to fix dependencies
+
+* Mon Jan 31 2000 Nalin Dahyabhai <nalin(a)redhat.com>
+- add buildrequires lines (#8925)
+
+* Mon Jan 17 2000 Nalin Dahyabhai <nalin(a)redhat.com>
+- put idle, modulator, and pynche only in python-tools
+
+* Thu Dec 02 1999 Michael K. Johnson <johnsonm(a)redhat.com>
+- fixed whichdb patch to actually do something (#7458)
+
+* Mon Nov 22 1999 Michael K. Johnson <johnsonm(a)redhat.com>
+- link nismodule against -lnss
+- whichdb patch by Guido (
Python.org bug 97)
+
+* Fri Sep 17 1999 Tim Powers <timp(a)redhat.com>
+- added modulator and pynche to the python-tools package
+- using a files list in the %files section for python-tools
+
+* Fri Sep 17 1999 Michael K. Johnson <johnsonm(a)redhat.com>
+- added conflicts/requires between subpackages so that you cannot
+ have an older tkinter installed with a new python.
+- added more tools
+
+* Wed Sep 15 1999 Michael K. Johnson <johnsonm(a)redhat.com>
+- changed defattr so that executable scripts in docs stay executable
+
+* Tue Aug 24 1999 Bill Nottingham <notting(a)redhat.com>
+- rebuild to fix broken tkinter.
+
+* Mon Aug 9 1999 Matt Wilson <msw(a)redhat.com>
+- fixed bogus /usr/local/bin/python requirements
+
+* Sat Jul 17 1999 Matt Wilson <msw(a)redhat.com>
+- added patch to import global symbols until we get libtool patched
+
+* Sun Jul 11 1999 Matt Wilson <msw(a)redhat.com>
+- updated to 1.5.2
+
+* Sun Mar 21 1999 Cristian Gafton <gafton(a)redhat.com>
+- auto rebuild in the new build environment (release 10)
+
+* Thu Mar 18 1999 Bill Nottingham <notting(a)redhat.com>
+- fix permissions in python-docs
+
+* Thu Feb 11 1999 Michael Johnson <johnsonm(a)redhat.com>
+- added mpzmodule at user request (uses gmp)
+- added bsddbmodule at user request (uses db 1.85 interface)
+
+* Mon Feb 08 1999 Michael Johnson <johnsonm(a)redhat.com>
+- add --with-threads at user request
+- clean up spec file
+
+* Fri Jan 08 1999 Michael K. Johnson <johnsonm(a)redhat.com>
+- New libc changes ndbm.h to db1/ndbm.h and -ldb to -ldb1
+
+* Thu Sep 3 1998 Jeff Johnson <jbj(a)redhat.com>
+- recompile for RH 5.2.
+
+* Wed May 06 1998 Cristian Gafton <gafton(a)redhat.com>
+- python-docs used to require /usr/bin/sed. Changed to /bin/sed instead
+
+* Wed Apr 29 1998 Cristian Gafton <gafton(a)redhat.com>
+- fixed the spec file for version 1.5.1
+- buildroot (!)
+
+* Mon Apr 20 1998 Michael K. Johnson <johnsonm(a)redhat.com>
+- updated to python 1.5.1
+- created our own Python-Doc tar file from 1.5 to substitute for the
+ not-yet-released Doc package.
+- build _tkinter properly
+- use readline again
+- build crypt module again
+- install rand replacement module
+- added a few modules
+
+* Thu Apr 09 1998 Erik Troan <ewt(a)redhat.com>
+- updated to python 1.5
+- made /usr/lib/python1.5 file list automatically generated
+
+* Tue Nov 04 1997 Michael K. Johnson <johnsonm(a)redhat.com>
+- Fixed dependencies for python and tkinter
+
+* Mon Nov 03 1997 Michael K. Johnson <johnsonm(a)redhat.com>
+- pulled out tk-related stuff into tkinter package
+
+* Fri Oct 10 1997 Erik Troan <ewt(a)redhat.com>
+- bunches of scripts used /usr/local/bin/python instead of /usr/bin/python
+
+* Tue Sep 30 1997 Erik Troan <ewt(a)redhat.com>
+- updated for tcl/tk 8.0
+
+* Thu Jul 10 1997 Erik Troan <ewt(a)redhat.com>
+- built against glibc
diff --git a/sources b/sources
index e69de29..2b497ac 100644
--- a/sources
+++ b/sources
@@ -0,0 +1,2 @@
+a24e1317c53d8e29367860bdc7b15cd3 Python-Doc.tar.gz
+e9d677ae6d5a3efc6937627ed8a3e752 py152.tgz
commit b5cdc0a5b4edf86a0ded91e16c9cafd11f535799
Author: cvsdist <cvsdist(a)fedoraproject.org>
Date: Thu Sep 9 10:57:27 2004 +0000
Setup of module python
diff --git a/.cvsignore b/.cvsignore
new file mode 100644
index 0000000..e69de29
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..8de430a
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,6 @@
+# Makefile for source rpm: python
+# $Id$
+NAME := python
+SPECFILE = $(firstword $(wildcard *.spec))
+
+include ../common/Makefile.common
diff --git a/sources b/sources
new file mode 100644
index 0000000..e69de29