From 533ae8c5057394e2e73902c05573c5f72a22c398 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jason=20=E3=83=86=E3=82=A3=E3=83=93=E3=83=84?= Date: Wed, 13 Jan 2010 20:39:58 +0000 Subject: [PATCH 001/416] Setup of module python3 --- .cvsignore | 0 Makefile | 21 +++++++++++++++++++++ sources | 0 3 files changed, 21 insertions(+) create mode 100644 .cvsignore create mode 100644 Makefile create mode 100644 sources 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..3d37c61 --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +# Makefile for source rpm: python3 +# $Id$ +NAME := python3 +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),) +# attept 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/sources b/sources new file mode 100644 index 0000000..e69de29 From a3483f912e4224e330a7ee8d884f8d78e8bba50d Mon Sep 17 00:00:00 2001 From: dmalcolm Date: Wed, 13 Jan 2010 21:25:18 +0000 Subject: [PATCH 002/416] Initial import (from python3-3.1.1-13) --- .cvsignore | 1 + Python-3.1.1-rpath.patch | 20 + find-provides-without-python-sonames.sh | 14 + import.log | 1 + macros.python3 | 3 + ...ges-to-expected-shebang-for-test_imp.patch | 11 + python-3.1.1-config.patch | 245 ++++++++ ...b-fix-handling-of-readonly-pyc-files.patch | 12 + python-3.1.1-install-tkinter-tests.patch | 10 + python-3.1.1-lib64.patch | 164 +++++ python-3.1.1-pathfix.patch | 61 ++ python-3.1.1-remove-mimeaudio-tests.patch | 55 ++ python3.spec | 568 ++++++++++++++++++ sources | 1 + 14 files changed, 1166 insertions(+) create mode 100644 Python-3.1.1-rpath.patch create mode 100755 find-provides-without-python-sonames.sh create mode 100644 import.log create mode 100644 macros.python3 create mode 100644 python-3.1.1-apply-our-changes-to-expected-shebang-for-test_imp.patch create mode 100644 python-3.1.1-config.patch create mode 100644 python-3.1.1-importlib-fix-handling-of-readonly-pyc-files.patch create mode 100644 python-3.1.1-install-tkinter-tests.patch create mode 100644 python-3.1.1-lib64.patch create mode 100644 python-3.1.1-pathfix.patch create mode 100644 python-3.1.1-remove-mimeaudio-tests.patch create mode 100644 python3.spec diff --git a/.cvsignore b/.cvsignore index e69de29..56857ac 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1 @@ +Python-3.1.1.tar.bz2 diff --git a/Python-3.1.1-rpath.patch b/Python-3.1.1-rpath.patch new file mode 100644 index 0000000..1493af2 --- /dev/null +++ b/Python-3.1.1-rpath.patch @@ -0,0 +1,20 @@ +diff -up Python-3.1.1/Lib/distutils/unixccompiler.py.rpath Python-3.1.1/Lib/distutils/unixccompiler.py +--- Python-3.1.1/Lib/distutils/unixccompiler.py.rpath 2009-09-04 17:29:34.000000000 -0400 ++++ Python-3.1.1/Lib/distutils/unixccompiler.py 2009-09-04 17:49:54.000000000 -0400 +@@ -141,6 +141,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 = super( ++ self.__class__, self)._fix_lib_args(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): + fixed_args = self._fix_compile_args(None, macros, include_dirs) diff --git a/find-provides-without-python-sonames.sh b/find-provides-without-python-sonames.sh new file mode 100755 index 0000000..406a675 --- /dev/null +++ b/find-provides-without-python-sonames.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# The standard /usr/lib/rpm/find-provides script +# adds provides lines for all SONAME directives in all shared libraries, +# even if those libraries are not in the LD_LIBRARY_PATH + +# This leads to the rpm having a redundant Provides "foo.so" for all of the +# various foo.so Python c modules + +# So we strip out all /usr/lib/python lines first, before running them through +# the standard script: +grep -v "/usr/lib/python" | /usr/lib/rpm/find-provides + +exit 0 \ No newline at end of file diff --git a/import.log b/import.log new file mode 100644 index 0000000..1b187cb --- /dev/null +++ b/import.log @@ -0,0 +1 @@ +python3-3_1_1-13_fc12:HEAD:python3-3.1.1-13.fc12.src.rpm:1263417721 diff --git a/macros.python3 b/macros.python3 new file mode 100644 index 0000000..11636da --- /dev/null +++ b/macros.python3 @@ -0,0 +1,3 @@ +%__python3 /usr/bin/python3 +%python3_sitelib %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") +%python3_sitearch %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") diff --git a/python-3.1.1-apply-our-changes-to-expected-shebang-for-test_imp.patch b/python-3.1.1-apply-our-changes-to-expected-shebang-for-test_imp.patch new file mode 100644 index 0000000..92c3e1f --- /dev/null +++ b/python-3.1.1-apply-our-changes-to-expected-shebang-for-test_imp.patch @@ -0,0 +1,11 @@ +--- Python-3.1.1/Lib/test/test_imp.py.apply-our-changes-to-expected-shebang 2009-10-27 18:05:53.539540149 -0400 ++++ Python-3.1.1/Lib/test/test_imp.py 2009-10-27 18:06:12.138538965 -0400 +@@ -52,7 +52,7 @@ class ImportTests(unittest.TestCase): + self.assertNotEqual(fp, None) + self.assertEqual(fp.encoding, "iso-8859-1") + self.assertEqual(fp.tell(), 0) +- self.assertEqual(fp.readline(), '#!/usr/bin/env python\n') ++ self.assertEqual(fp.readline(), '#!/usr/bin/python3.1\n') + fp.close() + + fp, filename, info = imp.find_module("tokenize") diff --git a/python-3.1.1-config.patch b/python-3.1.1-config.patch new file mode 100644 index 0000000..f65027f --- /dev/null +++ b/python-3.1.1-config.patch @@ -0,0 +1,245 @@ +--- Python-3.1.1/Modules/Setup.dist.config 2009-06-04 03:30:30.000000000 -0600 ++++ Python-3.1.1/Modules/Setup.dist 2009-09-25 12:14:38.000000000 -0600 +@@ -141,7 +141,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 +@@ -151,71 +151,71 @@ + # 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 +-#atexit atexitmodule.c # Register functions to be run at interpreter-shutdown +-#_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 +-#_heapq _heapqmodule.c # Heap queue algorithm ++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 ++atexit atexitmodule.c # Register functions to be run at interpreter-shutdown ++_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 ++_heapq _heapqmodule.c # Heap queue algorithm + +-#unicodedata unicodedata.c # static Unicode character database ++unicodedata unicodedata.c # static Unicode character database + + + # 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. +@@ -223,7 +223,7 @@ + # #993173 says audioop works on 64-bit platforms, though. + # These represent audio samples or images as strings: + +-#audioop audioop.c # Operations on audio samples ++audioop audioop.c # Operations on audio samples + + + # Note that the _md5 and _sha modules are normally only built if the +@@ -238,9 +238,9 @@ + + # The _sha module implements the SHA checksum algorithms. + # (NIST's Secure Hash Algorithms.) +-#_sha shamodule.c +-#_sha256 sha256module.c +-#_sha512 sha512module.c ++_sha1 sha1module.c ++_sha256 sha256module.c ++_sha512 sha512module.c + + + # The _tkinter module. +@@ -255,7 +255,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: +@@ -265,7 +265,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: +@@ -274,7 +274,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: +@@ -284,10 +284,10 @@ + # *** 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 ++syslog syslogmodule.c # syslog daemon interface + + + # Curses support, requring the System V version of curses, often +@@ -296,9 +296,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 + + + # Modules that provide persistent dictionary-like semantics. You will +@@ -321,14 +321,14 @@ + # + # 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 + + + # 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 + + + # Lee Busby's SIGFPE modules. +@@ -351,7 +351,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 + # +@@ -364,19 +364,19 @@ + # + # 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 diff --git a/python-3.1.1-importlib-fix-handling-of-readonly-pyc-files.patch b/python-3.1.1-importlib-fix-handling-of-readonly-pyc-files.patch new file mode 100644 index 0000000..1fb201b --- /dev/null +++ b/python-3.1.1-importlib-fix-handling-of-readonly-pyc-files.patch @@ -0,0 +1,12 @@ +--- Lib/importlib/_bootstrap.py.fix-handling-of-readonly-pyc-files 2009-10-22 15:24:57.575015046 -0400 ++++ Lib/importlib/_bootstrap.py 2009-10-22 15:25:24.024016069 -0400 +@@ -522,8 +522,8 @@ class _PyPycFileLoader(PyPycLoader, _PyF + bytecode_path = self.bytecode_path(name) + if not bytecode_path: + bytecode_path = self._base_path + _suffix_list(imp.PY_COMPILED)[0] +- file = _io.FileIO(bytecode_path, 'w') # Assuming bytes. + try: ++ file = _io.FileIO(bytecode_path, 'w') # Assuming bytes. + with _closing(file) as bytecode_file: + bytecode_file.write(data) + return True diff --git a/python-3.1.1-install-tkinter-tests.patch b/python-3.1.1-install-tkinter-tests.patch new file mode 100644 index 0000000..3939678 --- /dev/null +++ b/python-3.1.1-install-tkinter-tests.patch @@ -0,0 +1,10 @@ +--- Python-3.1.1/Makefile.pre.in.install-tkinter-tests 2009-10-27 20:00:09.814539776 -0400 ++++ Python-3.1.1/Makefile.pre.in 2009-10-27 20:01:43.460549947 -0400 +@@ -835,6 +835,7 @@ EXTRAPLATDIR= @EXTRAPLATDIR@ + MACHDEPS= $(PLATDIR) $(EXTRAPLATDIR) + XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax + LIBSUBDIRS= tkinter site-packages test test/output test/data \ ++ tkinter/test tkinter/test/test_ttk tkinter/test/test_tkinter \ + test/decimaltestdata \ + encodings \ + email email/mime email/test email/test/data \ diff --git a/python-3.1.1-lib64.patch b/python-3.1.1-lib64.patch new file mode 100644 index 0000000..3053a92 --- /dev/null +++ b/python-3.1.1-lib64.patch @@ -0,0 +1,164 @@ +diff -ur Python-3.1.1.orig/Lib/distutils/command/install.py Python-3.1.1/Lib/distutils/command/install.py +--- Python-3.1.1.orig/Lib/distutils/command/install.py 2009-09-24 15:28:57.000000000 -0600 ++++ Python-3.1.1/Lib/distutils/command/install.py 2009-09-24 15:34:18.000000000 -0600 +@@ -47,14 +47,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', +diff -ur Python-3.1.1.orig/Lib/distutils/sysconfig.py Python-3.1.1/Lib/distutils/sysconfig.py +--- Python-3.1.1.orig/Lib/distutils/sysconfig.py 2009-09-24 15:29:00.000000000 -0600 ++++ Python-3.1.1/Lib/distutils/sysconfig.py 2009-09-24 15:34:18.000000000 -0600 +@@ -117,8 +117,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: +diff -ur Python-3.1.1.orig/Lib/site.py Python-3.1.1/Lib/site.py +--- Python-3.1.1.orig/Lib/site.py 2009-09-24 15:28:56.000000000 -0600 ++++ Python-3.1.1/Lib/site.py 2009-09-24 15:34:18.000000000 -0600 +@@ -258,12 +258,16 @@ + 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 -ur Python-3.1.1.orig/Makefile.pre.in Python-3.1.1/Makefile.pre.in +--- Python-3.1.1.orig/Makefile.pre.in 2009-09-24 15:26:58.000000000 -0600 ++++ Python-3.1.1/Makefile.pre.in 2009-09-24 15:34:18.000000000 -0600 +@@ -90,11 +90,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) +diff -ur Python-3.1.1.orig/Modules/getpath.c Python-3.1.1/Modules/getpath.c +--- Python-3.1.1.orig/Modules/getpath.c 2009-09-24 15:27:15.000000000 -0600 ++++ Python-3.1.1/Modules/getpath.c 2009-09-24 15:36:58.000000000 -0600 +@@ -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 wchar_t exec_prefix[MAXPATHLEN+1]; + static wchar_t progpath[MAXPATHLEN+1]; + static wchar_t *module_search_path = NULL; +-static wchar_t lib_python[] = L"lib/python" VERSION; ++static wchar_t lib_python[] = L"lib64/python" VERSION; + + /* In principle, this should use HAVE__WSTAT, and _wstat + should be detected by autoconf. However, no current +@@ -603,7 +603,7 @@ + } + else + wcsncpy(zip_path, L"" PREFIX, MAXPATHLEN); +- joinpath(zip_path, L"lib/python00.zip"); ++ joinpath(zip_path, L"lib64/python00.zip"); + bufsz = wcslen(zip_path); /* Replace "00" with version */ + zip_path[bufsz - 6] = VERSION[0]; + zip_path[bufsz - 5] = VERSION[2]; +@@ -613,7 +613,7 @@ + fprintf(stderr, + "Could not find platform dependent libraries \n"); + wcsncpy(exec_prefix, L"" EXEC_PREFIX, MAXPATHLEN); +- joinpath(exec_prefix, L"lib/lib-dynload"); ++ joinpath(exec_prefix, L"lib64/lib-dynload"); + } + /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */ + +diff -ur Python-3.1.1.orig/Modules/Setup.dist Python-3.1.1/Modules/Setup.dist +--- Python-3.1.1.orig/Modules/Setup.dist 2009-09-24 15:27:30.000000000 -0600 ++++ Python-3.1.1/Modules/Setup.dist 2009-09-24 15:45:49.000000000 -0600 +@@ -351,7 +351,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 + # +diff -ur Python-3.1.1.orig/setup.py Python-3.1.1/setup.py +--- Python-3.1.1.orig/setup.py 2009-09-24 15:26:58.000000000 -0600 ++++ Python-3.1.1/setup.py 2009-09-24 15:34:18.000000000 -0600 +@@ -295,7 +295,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 +@@ -522,11 +522,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) ) + else: +@@ -563,8 +563,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 diff --git a/python-3.1.1-pathfix.patch b/python-3.1.1-pathfix.patch new file mode 100644 index 0000000..f45409a --- /dev/null +++ b/python-3.1.1-pathfix.patch @@ -0,0 +1,61 @@ +--- Python-3.1.1.orig/Tools/scripts/pathfix.py 2009-09-24 15:27:04.000000000 -0600 ++++ Python-3.1.1/Tools/scripts/pathfix.py 2009-09-25 14:05:04.000000000 -0600 +@@ -1,4 +1,4 @@ +-#! /usr/bin/env python ++#!/usr/bin/env python3.1 + + # Change the #! line occurring in Python scripts. The new interpreter + # pathname must be given with a -i option. +@@ -43,8 +43,8 @@ + sys.exit(2) + for o, a in opts: + if o == '-i': +- new_interpreter = a +- if not new_interpreter or new_interpreter[0] != '/' or not args: ++ new_interpreter = a.encode() ++ if not new_interpreter or new_interpreter[0] != b'/'[0] or not args: + err('-i option or file-or-directory missing\n') + err(usage) + sys.exit(2) +@@ -61,7 +61,7 @@ + + ispythonprog = re.compile('^[a-zA-Z0-9_]+\.py$') + def ispython(name): +- return ispythonprog.match(name) >= 0 ++ return bool(ispythonprog.match(name)) + + def recursedown(dirname): + dbg('recursedown(%r)\n' % (dirname,)) +@@ -88,7 +88,7 @@ + def fix(filename): + ## dbg('fix(%r)\n' % (filename,)) + try: +- f = open(filename, 'r') ++ f = open(filename, 'rb') + except IOError as msg: + err('%s: cannot open: %r\n' % (filename, msg)) + return 1 +@@ -101,7 +101,7 @@ + head, tail = os.path.split(filename) + tempname = os.path.join(head, '@' + tail) + try: +- g = open(tempname, 'w') ++ g = open(tempname, 'wb') + except IOError as msg: + f.close() + err('%s: cannot create: %r\n' % (tempname, msg)) +@@ -139,11 +139,11 @@ + return 0 + + def fixline(line): +- if not line.startswith('#!'): ++ if not line.startswith(b'#!'): + return line +- if "python" not in line: ++ if b"python" not in line: + return line +- return '#! %s\n' % new_interpreter ++ return b'#!' + new_interpreter + b'\n' + + if __name__ == '__main__': + main() diff --git a/python-3.1.1-remove-mimeaudio-tests.patch b/python-3.1.1-remove-mimeaudio-tests.patch new file mode 100644 index 0000000..487ad3e --- /dev/null +++ b/python-3.1.1-remove-mimeaudio-tests.patch @@ -0,0 +1,55 @@ +--- Python-3.1.1/Lib/email/test/test_email.py.remove_mimeaudio_tests 2009-10-27 14:31:09.483539561 -0400 ++++ Python-3.1.1/Lib/email/test/test_email.py 2009-10-27 14:31:27.663548053 -0400 +@@ -926,52 +926,6 @@ Blah blah blah + + + +-# Test the basic MIMEAudio class +-class TestMIMEAudio(unittest.TestCase): +- def setUp(self): +- # Make sure we pick up the audiotest.au that lives in email/test/data. +- # In Python, there's an audiotest.au living in Lib/test but that isn't +- # included in some binary distros that don't include the test +- # package. The trailing empty string on the .join() is significant +- # since findfile() will do a dirname(). +- datadir = os.path.join(os.path.dirname(landmark), 'data', '') +- with open(findfile('audiotest.au', datadir), 'rb') as fp: +- self._audiodata = fp.read() +- self._au = MIMEAudio(self._audiodata) +- +- def test_guess_minor_type(self): +- self.assertEqual(self._au.get_content_type(), 'audio/basic') +- +- def test_encoding(self): +- payload = self._au.get_payload() +- self.assertEqual(base64.decodebytes(payload), self._audiodata) +- +- def test_checkSetMinor(self): +- au = MIMEAudio(self._audiodata, 'fish') +- self.assertEqual(au.get_content_type(), 'audio/fish') +- +- def test_add_header(self): +- eq = self.assertEqual +- unless = self.assertTrue +- self._au.add_header('Content-Disposition', 'attachment', +- filename='audiotest.au') +- eq(self._au['content-disposition'], +- 'attachment; filename="audiotest.au"') +- eq(self._au.get_params(header='content-disposition'), +- [('attachment', ''), ('filename', 'audiotest.au')]) +- eq(self._au.get_param('filename', header='content-disposition'), +- 'audiotest.au') +- missing = [] +- eq(self._au.get_param('attachment', header='content-disposition'), '') +- unless(self._au.get_param('foo', failobj=missing, +- header='content-disposition') is missing) +- # Try some missing stuff +- unless(self._au.get_param('foobar', missing) is missing) +- unless(self._au.get_param('attachment', missing, +- header='foobar') is missing) +- +- +- + # Test the basic MIMEImage class + class TestMIMEImage(unittest.TestCase): + def setUp(self): diff --git a/python3.spec b/python3.spec new file mode 100644 index 0000000..3cfea50 --- /dev/null +++ b/python3.spec @@ -0,0 +1,568 @@ +%global pybasever 3.1 +%global pylibdir %{_libdir}/python%{pybasever} + +# We want to byte-compile the .py files within the packages using the new +# python3 binary. +# +# Unfortunately, rpmbuild's infrastructure requires us to jump through some +# hoops to avoid byte-compiling with the system python 2 version: +# /usr/lib/rpm/redhat/macros sets up build policy that (amongst other things) +# defines __os_install_post. In particular, "brp-python-bytecompile" is +# invoked without an argument thus using the wrong version of python +# (/usr/bin/python, rather than the freshly built python), thus leading to +# numerous syntax errors, and incorrect magic numbers in the .pyc files. We +# thus override __os_install_post to avoid invoking this script: +%global __os_install_post /usr/lib/rpm/redhat/brp-compress \ + %{!?__debug_package:/usr/lib/rpm/redhat/brp-strip %{__strip}} \ + /usr/lib/rpm/redhat/brp-strip-static-archive %{__strip} \ + /usr/lib/rpm/redhat/brp-strip-comment-note %{__strip} %{__objdump} \ + /usr/lib/rpm/redhat/brp-python-hardlink +# to remove the invocation of brp-python-bytecompile, whilst keeping the +# invocation of brp-python-hardlink (since this should still work for python3 +# pyc/pyo files) + +Summary: Version 3 of the Python programming language aka Python 3000 +Name: python3 +Version: %{pybasever}.1 +Release: 13%{?dist} +License: Python +Group: Development/Languages +Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 + +# Avoid having various bogus auto-generated Provides lines for the various +# python c modules' SONAMEs: +Source1: find-provides-without-python-sonames.sh +%global _use_internal_dependency_generator 0 +%global __find_provides %{SOURCE1} + +# Supply various useful macros for building python 3 modules: +# __python3, python3_sitelib, python3_sitearch +Source2: macros.python3 + +Patch0: python-3.1.1-config.patch + + +# Fixup distutils/unixccompiler.py to remove standard library path from rpath: +# Was Patch0 in ivazquez' python3000 specfile: +Patch1: Python-3.1.1-rpath.patch + +# Fixup importlib/_bootstrap.py so that it correctly handles being unable to +# open .pyc files for writing +# Sent upstream as http://bugs.python.org/issue7187 +Patch2: python-3.1.1-importlib-fix-handling-of-readonly-pyc-files.patch + +# The four TestMIMEAudio tests fail due to "audiotest.au" not being packaged. +# It's simplest to remove them: +Patch3: python-3.1.1-remove-mimeaudio-tests.patch + +# ImportTests.test_issue1267 in test_imp.py reads pydoc.py's shebang line and +# checks that it read it correctly. +# +# Since we modify the shebang lines in our packaging, we also need to modify +# the expected value in this test: +Patch4: python-3.1.1-apply-our-changes-to-expected-shebang-for-test_imp.patch + +# test_tk test_ttk_guionly and test_ttk_textonly all rely on tkinter/test, but +# upstream's Makefile.pre.in doesn't install that subdirectory; patch it so that +# it does: +Patch5: python-3.1.1-install-tkinter-tests.patch +# (The resulting test support code is in the tkinter subpackage, but +# this is not a major problem) + +Patch102: python-3.1.1-lib64.patch + +# http://bugs.python.org/issue6999 -- fixed in r75062 +Patch200: python-3.1.1-pathfix.patch + + +BuildRoot: %{_tmppath}/%{name}-%{version}-root +BuildRequires: readline-devel, openssl-devel, gmp-devel +BuildRequires: ncurses-devel, gdbm-devel, zlib-devel, expat-devel +BuildRequires: libGL-devel 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: libffi-devel + +URL: http://www.python.org/ + +# See notes in bug 532118: +Provides: python(abi) = %{pybasever} + +%description +Python 3 is a new version of the language that is incompatible with the 2.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. + +%package libs +Summary: Python 3 runtime libraries +Group: Development/Libraries +#Requires: %{name} = %{version}-%{release} + +%description libs +This package contains files used to embed Python 3 into applications. + +%package devel +Summary: Libraries and header files needed for Python 3 development +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} +Conflicts: %{name} < %{version}-%{release} + +%description devel +This package contains libraries and header files used to build applications +with and native libraries for Python 3 + +%package tools +Summary: A collection of tools included with Python 3 +Group: Development/Tools +Requires: %{name} = %{version}-%{release} +Requires: %{name}-tkinter = %{version}-%{release} + +%description tools +This package contains several tools included with Python 3 + +%package tkinter +Summary: A GUI toolkit for Python 3 +Group: Development/Languages +BuildRequires: tcl, tk +Requires: %{name} = %{version}-%{release} + +%description tkinter +The Tkinter (Tk interface) program is an graphical user interface for +the Python scripting language. + +%package test +Summary: The test modules from the main python 3 package +Group: Development/Languages +Requires: %{name} = %{version}-%{release} +Requires: %{name}-tools = %{version}-%{release} + +%description test +The test modules from the main %{name} package. +These are in a separate package to save space, as they are almost never used +in production. + +You might want to install the python3-test package if you're developing +python 3 code that uses more than just unittest and/or test_support.py. + +%prep +%setup -q -n Python-%{version} +chmod +x %{SOURCE1} +%patch0 -p1 -b .config +%patch1 -p1 -b .rpath +%patch2 -p0 -b .fix-handling-of-readonly-pyc-files +%patch3 -p1 -b .remove-mimeaudio-tests +%patch4 -p1 -b .apply-our-changes-to-expected-shebang +%patch5 -p1 -b .install-tkinter-tests + +%if "%{_lib}" == "lib64" +%patch102 -p1 -b .lib64 +%endif + +%patch200 -p1 -b .pathfix + + +%build +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" +export CFLAGS="$CFLAGS `pkg-config --cflags openssl`" +export LDFLAGS="$LDFLAGS `pkg-config --libs-only-L openssl`" + +autoconf +%configure --enable-ipv6 --with-wide-unicode --enable-shared --with-system-ffi + +make OPT="$CFLAGS" %{?_smp_mflags} + + +%install +rm -fr $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT%{_prefix} $RPM_BUILD_ROOT%{_mandir} + +make install DESTDIR=$RPM_BUILD_ROOT + +mkdir -p ${RPM_BUILD_ROOT}%{pylibdir}/site-packages + +mv ${RPM_BUILD_ROOT}%{_bindir}/2to3 ${RPM_BUILD_ROOT}%{_bindir}/2to3-3 + +# Development tools +install -m755 -d ${RPM_BUILD_ROOT}%{pylibdir}/Tools +install Tools/README ${RPM_BUILD_ROOT}%{pylibdir}/Tools/ +cp -ar Tools/freeze ${RPM_BUILD_ROOT}%{pylibdir}/Tools/ +cp -ar Tools/i18n ${RPM_BUILD_ROOT}%{pylibdir}/Tools/ +cp -ar Tools/modulator ${RPM_BUILD_ROOT}%{pylibdir}/Tools/ +cp -ar Tools/pynche ${RPM_BUILD_ROOT}%{pylibdir}/Tools/ +cp -ar Tools/scripts ${RPM_BUILD_ROOT}%{pylibdir}/Tools/ + +# Documentation tools +install -m755 -d $RPM_BUILD_ROOT%{pylibdir}/Doc +cp -ar Doc/tools $RPM_BUILD_ROOT%{pylibdir}/Doc/ + +# Demo scripts +cp -ar Demo $RPM_BUILD_ROOT%{pylibdir}/ + +find $RPM_BUILD_ROOT%{pylibdir}/lib-dynload -type d | sed "s|$RPM_BUILD_ROOT|%dir |" > dynfiles +find $RPM_BUILD_ROOT%{pylibdir}/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%{pylibdir}/email/test/data/audiotest.au $RPM_BUILD_ROOT%{pylibdir}/test/audiotest.au + +%if "%{_lib}" == "lib64" +install -d $RPM_BUILD_ROOT/usr/lib/python%{pybasever}/site-packages +%endif + +# Make python3-devel multilib-ready (bug #192747, #139911) +%global _pyconfig32_h pyconfig-32.h +%global _pyconfig64_h pyconfig-64.h + +%ifarch ppc64 s390x x86_64 ia64 alpha sparc64 +%global _pyconfig_h %{_pyconfig64_h} +%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 +#include + +#if __WORDSIZE == 32 +#include "%{_pyconfig32_h}" +#elif __WORDSIZE == 64 +#include "%{_pyconfig64_h}" +#else +#error "Unknown word size" +#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%{pylibdir}/distutils/sysconfig.py + +# Switch all shebangs to refer to the specific Python version. +LD_LIBRARY_PATH=. ./python Tools/scripts/pathfix.py -i "%{_bindir}/python%{pybasever}" $RPM_BUILD_ROOT + +# Remove shebang lines from .py files that aren't executable, and +# remove executability from .py files that don't have a shebang line: +find $RPM_BUILD_ROOT -name \*.py \ + \( \( \! -perm /u+x,g+x,o+x -exec sed -e '/^#!/Q 0' -e 'Q 1' {} \; \ + -print -exec sed -i '1d' {} \; \) -o \( \ + -perm /u+x,g+x,o+x ! -exec grep -m 1 -q '^#!' {} \; \ + -exec chmod a-x {} \; \) \) + +# .xpm and .xbm files should not be executable: +find $RPM_BUILD_ROOT \ + \( -name \*.xbm -o -name \*.xpm -o -name \*.xpm.1 \) \ + -exec chmod a-x {} \; + +# Remove executable flag from files that shouldn't have it: +chmod a-x \ + $RPM_BUILD_ROOT%{pylibdir}/Demo/comparisons/patterns \ + $RPM_BUILD_ROOT%{pylibdir}/distutils/tests/Setup.sample \ + $RPM_BUILD_ROOT%{pylibdir}/Demo/rpc/test \ + $RPM_BUILD_ROOT%{pylibdir}/Tools/README \ + $RPM_BUILD_ROOT%{pylibdir}/Demo/scripts/newslist.doc \ + $RPM_BUILD_ROOT%{pylibdir}/Demo/md5test/foo + +# Get rid of DOS batch files: +find $RPM_BUILD_ROOT -name \*.bat -exec rm {} \; + +# Get rid of backup files: +find $RPM_BUILD_ROOT/ -name "*~" -exec rm -f {} \; +find . -name "*~" -exec rm -f {} \; +rm -f $RPM_BUILD_ROOT%{pylibdir}/LICENSE.txt +# Junk, no point in putting in -test sub-pkg +rm -f ${RPM_BUILD_ROOT}/%{pylibdir}/idlelib/testcode.py* + +# Get rid of stray patch file from buildroot: +rm -f $RPM_BUILD_ROOT%{pylibdir}/test/test_imp.py.apply-our-changes-to-expected-shebang # from patch 4 + +# Fix end-of-line encodings: +find $RPM_BUILD_ROOT/ -name \*.py -exec sed -i 's/\r//' {} \; + +# Fix an encoding: +iconv -f iso8859-1 -t utf-8 $RPM_BUILD_ROOT/%{pylibdir}/Demo/rpc/README > README.conv && mv -f README.conv $RPM_BUILD_ROOT/%{pylibdir}/Demo/rpc/README + +# Note that +# %{pylibdir}/Demo/distutils/test2to3/setup.py +# is in iso-8859-1 encoding, and that this is deliberate; this is test data +# for the 2to3 tool, and one of the functions of the 2to3 tool is to fixup +# character encodings within python source code + +# Do bytecompilation with the new interpreter. +LD_LIBRARY_PATH=. /usr/lib/rpm/brp-python-bytecompile ./python + +# Fixup permissions for shared libraries from non-standard 555 to standard 755: +find $RPM_BUILD_ROOT \ + -perm 555 -exec chmod 755 {} \; + +mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/rpm +install -m 644 %{SOURCE2} $RPM_BUILD_ROOT/%{_sysconfdir}/rpm + +%check +# Run the upstream test suite, using the "runtests.sh" harness from the upstream +# tarball. +# I'm seeing occasional hangs in "test_httplib" when running the test suite inside +# Koji. For that reason I exclude that one. +LD_LIBRARY_PATH=$(pwd) ./runtests.sh -x test_httplib + +# Note that we're running the tests using the version of the code in the builddir, +# not in the buildroot. + +# The harness only emits the names of the test scripts it ran, along with a +# summary of the form: +# 2 BAD +# 313 GOOD +# 22 SKIPPED +# 337 total +# As a byproduct it writes files "GOOD", "BAD", "SKIPPED", listing names of +# files (e.g. "test_imp") along with a subdirectory OUT containing files of the +# form $TEST.out +# Each such logfile starts with a line indicating the name of the test + +# Output the logs from failing tests, so that they are captured in the rpmbuild +# log: +for TESTNAME in $(cat BAD); do + cat OUT/$TESTNAME.out ; +done + +# There are 5 expected BAD results here: +# +# (1) test_distutils.py: tries to build an RPM inside the rpmbuild; I'll simply +# let this one fail for now (has trouble linking against -lpython3.1; perhaps +# LD_LIBRARY_PATH is being discarded somewhere?) +# +# (2) test_imp.py: ImportTests.test_issue1267 in test_imp.py reads pydoc.py's +# shebang line and checks that it read it correctly.tests that the shebang line +# is as expected. Unfortunately if we patch this up in the buildir (in the +# build phase), then the "make install" will try to reference +# /usr/bin/python%{pybasever} which won't exist on a clean build environment. +# So we fix up the shebang lines after this in the install phase, and expect +# this test to fail in the check phase. It ought to pass when run on the built +# RPMs +# +# (3) test_socket.py:testSockName can fail here if DNS isn't properly set up: +# my_ip_addr = socket.gethostbyname(socket.gethostname()) +# socket.gaierror: [Errno -2] Name or service not known +# +# (4) test_subprocess: merely get "errors occurred" +# +# (5) test_telnet: can get a "socket.error: [Errno 104] Connection reset by peer" +# +# Some additional tests fail when running the test suite as non-root outside of +# the build, due to permissions issues. + +%clean +rm -fr $RPM_BUILD_ROOT + +%post libs -p /sbin/ldconfig + +%postun libs -p /sbin/ldconfig + +%files -f dynfiles +%defattr(-, root, root) +%doc LICENSE README +%{_bindir}/pydoc* +%{_bindir}/python3 +%{_bindir}/python%{pybasever} +%{_mandir}/*/* +%dir %{pylibdir} +%dir %{pylibdir}/site-packages +%{pylibdir}/site-packages/README +%{pylibdir}/*.py* +%{pylibdir}/*.doc +%{pylibdir}/wsgiref.egg-info +%dir %{pylibdir}/ctypes +%{pylibdir}/ctypes/*.py* +%{pylibdir}/ctypes/macholib +%{pylibdir}/curses +%dir %{pylibdir}/dbm +%{pylibdir}/dbm/*.py* +%dir %{pylibdir}/distutils +%{pylibdir}/distutils/*.py* +%{pylibdir}/distutils/README +%{pylibdir}/distutils/command +%dir %{pylibdir}/email +%{pylibdir}/email/*.py* +%{pylibdir}/email/mime +%{pylibdir}/encodings +%{pylibdir}/html +%{pylibdir}/http +%{pylibdir}/idlelib +%dir %{pylibdir}/importlib +%{pylibdir}/importlib/*.py* +%dir %{pylibdir}/json +%{pylibdir}/json/*.py* +%{pylibdir}/logging +%{pylibdir}/multiprocessing +%{pylibdir}/plat-linux2 +%{pylibdir}/pydoc_data +%dir %{pylibdir}/sqlite3 +%{pylibdir}/sqlite3/*.py* +%dir %{pylibdir}/test +%{pylibdir}/test/__init__.py* +%{pylibdir}/urllib +%{pylibdir}/wsgiref +%{pylibdir}/xml +%{pylibdir}/xmlrpc +%if "%{_lib}" == "lib64" +%attr(0755,root,root) %dir /usr/lib/python%{pybasever} +%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 %{pylibdir}/config +%{pylibdir}/config/Makefile +%dir /usr/include/python%{pybasever} +/usr/include/python%{pybasever}/%{_pyconfig_h} + +%files libs +%defattr(-,root,root,-) +%{_libdir}/libpython%{pybasever}.so.* + +%files devel +%defattr(-,root,root) +%{pylibdir}/config/* +%exclude %{pylibdir}/config/Makefile +/usr/include/python%{pybasever}/*.h +%exclude /usr/include/python%{pybasever}/%{_pyconfig_h} +%doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit +%{_bindir}/python3-config +%{_bindir}/python%{pybasever}-config +%{_libdir}/libpython%{pybasever}.so +%{_libdir}/pkgconfig/python*.pc +%config(noreplace) %{_sysconfdir}/rpm/macros.python3 + +%files tools +%defattr(-,root,root,755) +%{pylibdir}/lib2to3 +%exclude %{pylibdir}/lib2to3/tests +%{_bindir}/2to3* +%{_bindir}/idle* +%{pylibdir}/Tools +%doc %{pylibdir}/Demo +%exclude %{pylibdir}/Demo/distutils +%exclude %{pylibdir}/Demo/md5test +%doc %{pylibdir}/Doc + +%files tkinter +%defattr(-,root,root,755) +%{pylibdir}/tkinter +%exclude %{pylibdir}/tkinter/test +%{pylibdir}/lib-dynload/_tkinter.so + +%files test +%defattr(-, root, root) +%{pylibdir}/ctypes/test +%{pylibdir}/distutils/tests +%{pylibdir}/email/test +%{pylibdir}/importlib/test +%{pylibdir}/json/tests +%{pylibdir}/sqlite3/test +%{pylibdir}/test +%{pylibdir}/lib-dynload/_ctypes_test.so +%{pylibdir}/lib-dynload/_testcapimodule.so +%{pylibdir}/lib2to3/tests +%doc %{pylibdir}/Demo/distutils +%doc %{pylibdir}/Demo/md5test +%{pylibdir}/tkinter/test + +%changelog +* Mon Jan 11 2010 David Malcolm - 3.1.1-13 +- fix permission on find-provides-without-python-sonames.sh from 775 to 755 + +* Mon Jan 11 2010 David Malcolm - 3.1.1-12 +- remove build-time requirements on tix and tk, since we already have +build-time requirements on the -devel subpackages for each of these (Thomas +Spura) +- replace usage of %%define with %%global (Thomas Spura) +- remove forcing of CC=gcc as this old workaround for bug 109268 appears to +longer be necessary +- move various test files from the "tools"/"tkinter" subpackages to the "test" +subpackage + +* Thu Jan 7 2010 David Malcolm - 3.1.1-11 +- add %%check section (thanks to Thomas Spura) +- update patch 4 to use correct shebang line +- get rid of stray patch file from buildroot + +* Tue Nov 17 2009 Andrew McNabb - 3.1.1-10 +- switched a few instances of "find |xargs" to "find -exec" for consistency. +- made the description of __os_install_post more accurate. + +* Wed Nov 4 2009 David Malcolm - 3.1.1-9 +- add macros.python3 to the -devel subpackage, containing common macros for use +when packaging python3 modules + +* Tue Nov 3 2009 David Malcolm - 3.1.1-8 +- add a provides of "python(abi)" (see bug 532118) +- fix issues identified by a.badger in package review (bug 526126, comment 39): + - use "3" thoughout metadata, rather than "3.*" + - remove conditional around "pkg-config openssl" + - use standard cleanup of RPM_BUILD_ROOT + - replace hardcoded references to /usr with _prefix macro + - stop removing egg-info files + - use /usr/bin/python3.1 rather than /use/bin/env python3.1 when fixing +up shebang lines + - stop attempting to remove no-longer-present .cvsignore files + - move the post/postun sections above the "files" sections + +* Thu Oct 29 2009 David Malcolm - 3.1.1-7 +- remove commented-away patch 51 (python-2.6-distutils_rpm.patch): the -O1 +flag is used by default in the upstream code +- "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) + +* Tue Oct 27 2009 David Malcolm - 3.1.1-6 +- reword description, based on suggestion by amcnabb +- fix the test_email and test_imp selftests (patch 3 and patch 4 respectively) +- fix the test_tk and test_ttk_* selftests (patch 5) +- fix up the specfile's handling of shebang/perms to avoid corrupting +test_httpservers.py (sed command suggested by amcnabb) + +* Thu Oct 22 2009 David Malcolm - 3.1.1-5 +- fixup importlib/_bootstrap.py so that it correctly handles being unable to +open .pyc files for writing (patch 2, upstream issue 7187) +- actually apply the rpath patch (patch 1) + +* Thu Oct 22 2009 David Malcolm - 3.1.1-4 +- update patch0's setup of the crypt module to link it against libcrypt +- update patch0 to comment "datetimemodule" back out, so that it is built +using setup.py (see Setup, option 3), thus linking it statically against +timemodule.c and thus avoiding a run-time "undefined symbol: +_PyTime_DoubleToTimet" failure on "import datetime" + +* Wed Oct 21 2009 David Malcolm - 3.1.1-3 +- remove executable flag from various files that shouldn't have it +- fix end-of-line encodings +- fix a character encoding + +* Tue Oct 20 2009 David Malcolm - 3.1.1-2 +- disable invocation of brp-python-bytecompile in postprocessing, since +it would be with the wrong version of python (adapted from ivazquez' +python3000 specfile) +- use a custom implementation of __find_provides in order to filter out bogus +provides lines for the various .so modules +- fixup distutils/unixccompiler.py to remove standard library path from rpath +(patch 1, was Patch0 in ivazquez' python3000 specfile) +- split out libraries into a -libs subpackage +- update summaries and descriptions, basing content on ivazquez' specfile +- fixup executable permissions on .py, .xpm and .xbm files, based on work in +ivazquez's specfile +- get rid of DOS batch files +- fixup permissions for shared libraries from non-standard 555 to standard 755 +- move /usr/bin/python*-config to the -devel subpackage +- mark various directories as being documentation + +* Thu Sep 24 2009 Andrew McNabb 3.1.1-1 +- Initial package for Python 3. + diff --git a/sources b/sources index e69de29..59b2b95 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +d1ddd9f16e3c6a51c7208f33518cd674 Python-3.1.1.tar.bz2 From 37de6741fa99c78bfe1d68ac0b5dca2981595dce Mon Sep 17 00:00:00 2001 From: dmalcolm Date: Wed, 13 Jan 2010 22:33:42 +0000 Subject: [PATCH 003/416] - replace references to /usr with %%{_prefix}; replace references to /usr/include with %%{_includedir} (Toshio) --- python3.spec | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/python3.spec b/python3.spec index 3cfea50..03ff214 100644 --- a/python3.spec +++ b/python3.spec @@ -24,7 +24,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 13%{?dist} +Release: 14%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 @@ -412,8 +412,8 @@ rm -fr $RPM_BUILD_ROOT %{pylibdir}/xml %{pylibdir}/xmlrpc %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 @@ -421,8 +421,8 @@ rm -fr $RPM_BUILD_ROOT # package, along with their parent directories (bug 531901): %dir %{pylibdir}/config %{pylibdir}/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,-) @@ -476,6 +476,10 @@ rm -fr $RPM_BUILD_ROOT %{pylibdir}/tkinter/test %changelog +* Wed Jan 13 2010 David Malcolm - 3.1.1-14 +- replace references to /usr with %%{_prefix}; replace references to +/usr/include with %%{_includedir} (Toshio) + * Mon Jan 11 2010 David Malcolm - 3.1.1-13 - fix permission on find-provides-without-python-sonames.sh from 775 to 755 From a9e268f9c692587bfdf677f655bd018d32ab4de5 Mon Sep 17 00:00:00 2001 From: dmalcolm Date: Fri, 15 Jan 2010 21:08:54 +0000 Subject: [PATCH 004/416] - fix the URLs output by pydoc so they point at python.org's 3.1 build of the docs, rather than the 2.6 build --- python3.spec | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 03ff214..40ab842 100644 --- a/python3.spec +++ b/python3.spec @@ -24,7 +24,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 14%{?dist} +Release: 15%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 @@ -163,6 +163,15 @@ chmod +x %{SOURCE1} %patch200 -p1 -b .pathfix +# Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there +# are many differences between 2.6 and the Python 3 library. +# +# Fix up the URLs within pydoc to point at the documentation for this +# MAJOR.MINOR version: +# +sed --in-place \ + --expression="s|http://docs.python.org/library|http://docs.python.org/%{pybasever}/library|g" \ + Lib/pydoc.py || exit 1 %build export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC" @@ -476,6 +485,10 @@ rm -fr $RPM_BUILD_ROOT %{pylibdir}/tkinter/test %changelog +* Fri Jan 15 2010 David Malcolm - 3.1.1-15 +- fix the URLs output by pydoc so they point at python.org's 3.1 build of the +docs, rather than the 2.6 build + * Wed Jan 13 2010 David Malcolm - 3.1.1-14 - replace references to /usr with %%{_prefix}; replace references to /usr/include with %%{_includedir} (Toshio) From 6859f230880f7a1e1fa73097e4de9bdb01980ad2 Mon Sep 17 00:00:00 2001 From: dmalcolm Date: Sat, 16 Jan 2010 01:20:39 +0000 Subject: [PATCH 005/416] - 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 --- python3.spec | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/python3.spec b/python3.spec index 40ab842..023c6c9 100644 --- a/python3.spec +++ b/python3.spec @@ -24,7 +24,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 15%{?dist} +Release: 16%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 @@ -107,7 +107,7 @@ This package contains files used to embed Python 3 into applications. %package devel Summary: Libraries and header files needed for Python 3 development Group: Development/Libraries -Requires: %{name} = %{version}-%{release} +Requires: %{name}%{?_isa} = %{version}-%{release} Conflicts: %{name} < %{version}-%{release} %description devel @@ -150,6 +150,13 @@ python 3 code that uses more than just unittest and/or test_support.py. %prep %setup -q -n Python-%{version} chmod +x %{SOURCE1} + +# 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 .config %patch1 -p1 -b .rpath %patch2 -p0 -b .fix-handling-of-readonly-pyc-files @@ -485,6 +492,11 @@ rm -fr $RPM_BUILD_ROOT %{pylibdir}/tkinter/test %changelog +* Fri Jan 15 2010 David Malcolm - 3.1.1-16 +- 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 + * Fri Jan 15 2010 David Malcolm - 3.1.1-15 - fix the URLs output by pydoc so they point at python.org's 3.1 build of the docs, rather than the 2.6 build From aa4aef22cccc56ab0e7957b45209502ec487cdb1 Mon Sep 17 00:00:00 2001 From: dmalcolm Date: Mon, 18 Jan 2010 17:59:07 +0000 Subject: [PATCH 006/416] - patch Makefile.pre.in to avoid building static library (patch 6, bug 556092) --- python-3.1.1-no-static-lib.patch | 50 ++++++++++++++++++++++++++++++++ python3.spec | 10 ++++++- 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 python-3.1.1-no-static-lib.patch diff --git a/python-3.1.1-no-static-lib.patch b/python-3.1.1-no-static-lib.patch new file mode 100644 index 0000000..325636e --- /dev/null +++ b/python-3.1.1-no-static-lib.patch @@ -0,0 +1,50 @@ +diff -up Python-3.1.1/Makefile.pre.in.no-static-lib Python-3.1.1/Makefile.pre.in +--- Python-3.1.1/Makefile.pre.in.no-static-lib 2010-01-17 15:42:11.945858717 -0500 ++++ Python-3.1.1/Makefile.pre.in 2010-01-17 16:44:32.788859363 -0500 +@@ -405,7 +405,7 @@ coverage: + + + # Build the interpreter +-$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY) ++$(BUILDPYTHON): Modules/python.o $(LDLIBRARY) + $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \ + Modules/python.o \ + $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) +@@ -421,18 +421,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) $(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); \ +@@ -973,18 +961,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/python3.spec b/python3.spec index 023c6c9..ca03b0f 100644 --- a/python3.spec +++ b/python3.spec @@ -24,7 +24,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 16%{?dist} +Release: 17%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 @@ -69,6 +69,10 @@ Patch5: python-3.1.1-install-tkinter-tests.patch # (The resulting test support code is in the tkinter subpackage, but # this is not a major problem) +# Patch the Makefile.pre.in so that the generated Makefile doesn't try to build +# a libpythonMAJOR.MINOR.a (bug 550692): +Patch6: python-3.1.1-no-static-lib.patch + Patch102: python-3.1.1-lib64.patch # http://bugs.python.org/issue6999 -- fixed in r75062 @@ -163,6 +167,7 @@ done %patch3 -p1 -b .remove-mimeaudio-tests %patch4 -p1 -b .apply-our-changes-to-expected-shebang %patch5 -p1 -b .install-tkinter-tests +%patch6 -p1 -b .no-static-lib %if "%{_lib}" == "lib64" %patch102 -p1 -b .lib64 @@ -492,6 +497,9 @@ rm -fr $RPM_BUILD_ROOT %{pylibdir}/tkinter/test %changelog +* Sun Jan 17 2010 David Malcolm - 3.1.1-17 +- patch Makefile.pre.in to avoid building static library (patch 6, bug 556092) + * Fri Jan 15 2010 David Malcolm - 3.1.1-16 - use the %%{_isa} macro to ensure that the python-devel dependency on python is for the correct multilib arch (#555943) From 6a82c1949acc9f8d24d0d47d443f529684639d33 Mon Sep 17 00:00:00 2001 From: dmalcolm Date: Wed, 20 Jan 2010 16:01:25 +0000 Subject: [PATCH 007/416] - move lib2to3 from -tools subpackage to main package (bug 556667) --- python3.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/python3.spec b/python3.spec index ca03b0f..8923e1a 100644 --- a/python3.spec +++ b/python3.spec @@ -24,7 +24,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 17%{?dist} +Release: 18%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 @@ -420,6 +420,8 @@ rm -fr $RPM_BUILD_ROOT %{pylibdir}/importlib/*.py* %dir %{pylibdir}/json %{pylibdir}/json/*.py* +%{pylibdir}/lib2to3 +%exclude %{pylibdir}/lib2to3/tests %{pylibdir}/logging %{pylibdir}/multiprocessing %{pylibdir}/plat-linux2 @@ -464,8 +466,6 @@ rm -fr $RPM_BUILD_ROOT %files tools %defattr(-,root,root,755) -%{pylibdir}/lib2to3 -%exclude %{pylibdir}/lib2to3/tests %{_bindir}/2to3* %{_bindir}/idle* %{pylibdir}/Tools @@ -497,6 +497,9 @@ rm -fr $RPM_BUILD_ROOT %{pylibdir}/tkinter/test %changelog +* Wed Jan 20 2010 David Malcolm - 3.1.1-18 +- move lib2to3 from -tools subpackage to main package (bug 556667) + * Sun Jan 17 2010 David Malcolm - 3.1.1-17 - patch Makefile.pre.in to avoid building static library (patch 6, bug 556092) From d5d23070151b6531ec0025039d9f2d537e9791d0 Mon Sep 17 00:00:00 2001 From: dmalcolm Date: Fri, 22 Jan 2010 22:00:30 +0000 Subject: [PATCH 008/416] - add %%py3dir macro to macros.python3 (to be used during unified python 2/3 builds for setting up the python3 copy of the source tree) --- macros.python3 | 1 + python3.spec | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/macros.python3 b/macros.python3 index 11636da..2b41d24 100644 --- a/macros.python3 +++ b/macros.python3 @@ -1,3 +1,4 @@ %__python3 /usr/bin/python3 %python3_sitelib %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") %python3_sitearch %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") +%py3dir %{_builddir}/python3-%{name}-%{version}-%{release} diff --git a/python3.spec b/python3.spec index 8923e1a..745f085 100644 --- a/python3.spec +++ b/python3.spec @@ -24,7 +24,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 18%{?dist} +Release: 19%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 @@ -497,6 +497,10 @@ rm -fr $RPM_BUILD_ROOT %{pylibdir}/tkinter/test %changelog +* Fri Jan 22 2010 David Malcolm - 3.1.1-19 +- add %%py3dir macro to macros.python3 (to be used during unified python 2/3 +builds for setting up the python3 copy of the source tree) + * Wed Jan 20 2010 David Malcolm - 3.1.1-18 - move lib2to3 from -tools subpackage to main package (bug 556667) From 113725aa7046ecb9239e4c1eb99f413fba7d4ec9 Mon Sep 17 00:00:00 2001 From: dmalcolm Date: Mon, 25 Jan 2010 18:44:42 +0000 Subject: [PATCH 009/416] - change python-3.1.1-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) --- python-3.1.1-config.patch | 12 ------------ python3.spec | 16 +++++++++++++++- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/python-3.1.1-config.patch b/python-3.1.1-config.patch index f65027f..5ec9024 100644 --- a/python-3.1.1-config.patch +++ b/python-3.1.1-config.patch @@ -176,18 +176,6 @@ # Curses support, requring the System V version of curses, often -@@ -296,9 +296,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 - - - # Modules that provide persistent dictionary-like semantics. You will @@ -321,14 +321,14 @@ # # First, look at Setup.config; configure may have set this for you. diff --git a/python3.spec b/python3.spec index 745f085..512a25b 100644 --- a/python3.spec +++ b/python3.spec @@ -24,7 +24,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 19%{?dist} +Release: 20%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 @@ -326,6 +326,12 @@ find $RPM_BUILD_ROOT \ mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/rpm install -m 644 %{SOURCE2} $RPM_BUILD_ROOT/%{_sysconfdir}/rpm +# 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) + %check # Run the upstream test suite, using the "runtests.sh" harness from the upstream # tarball. @@ -497,6 +503,14 @@ rm -fr $RPM_BUILD_ROOT %{pylibdir}/tkinter/test %changelog +* Mon Jan 25 2010 David Malcolm - 3.1.1-20 +- change python-3.1.1-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 - 3.1.1-19 - add %%py3dir macro to macros.python3 (to be used during unified python 2/3 builds for setting up the python3 copy of the source tree) From 4aab458c0417547929d0bf2035c55c448baef5fd Mon Sep 17 00:00:00 2001 From: dmalcolm Date: Thu, 28 Jan 2010 19:09:18 +0000 Subject: [PATCH 010/416] - introduce %%{dynload_dir} macro - 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 - introduce a macros.pybytecompile source file, to help with packaging python3 modules (Source3; written by Toshio) - rename "2to3-3" to "python3-2to3" to better reflect python 3 module packaging plans --- macros.pybytecompile | 12 +++++ python3.spec | 103 ++++++++++++++++++++++++++++++++++++------- 2 files changed, 100 insertions(+), 15 deletions(-) create mode 100644 macros.pybytecompile diff --git a/macros.pybytecompile b/macros.pybytecompile new file mode 100644 index 0000000..a8b79b2 --- /dev/null +++ b/macros.pybytecompile @@ -0,0 +1,12 @@ +# Note that the path could itself be a python file, or a directory + +# Python's compile_all module only works on directories, and requires a max +# recursion depth + +%py_byte_compile()\ +python_binary="%1"\ +bytecode_compilation_path="%2"\ +find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("$RPM_BUILD_ROOT")[2]) for f in sys.argv[1:]]' || :\ +\ +find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("$RPM_BUILD_ROOT")[2]) for f in sys.argv[1:]]' || :\ +%{nil} diff --git a/python3.spec b/python3.spec index 512a25b..78a4fed 100644 --- a/python3.spec +++ b/python3.spec @@ -1,5 +1,6 @@ %global pybasever 3.1 %global pylibdir %{_libdir}/python%{pybasever} +%global dynload_dir %{pylibdir}/lib-dynload # We want to byte-compile the .py files within the packages using the new # python3 binary. @@ -24,7 +25,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 20%{?dist} +Release: 21%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 @@ -39,6 +40,11 @@ Source1: find-provides-without-python-sonames.sh # __python3, python3_sitelib, python3_sitearch Source2: macros.python3 +# Supply an RPM macro "py_byte_compile" for the python3-devel subpackage +# to enable specfiles to selectively byte-compile individual files and paths +# with different Python runtimes as necessary: +Source3: macros.pybytecompile + Patch0: python-3.1.1-config.patch @@ -208,7 +214,7 @@ make install DESTDIR=$RPM_BUILD_ROOT mkdir -p ${RPM_BUILD_ROOT}%{pylibdir}/site-packages -mv ${RPM_BUILD_ROOT}%{_bindir}/2to3 ${RPM_BUILD_ROOT}%{_bindir}/2to3-3 +mv ${RPM_BUILD_ROOT}%{_bindir}/2to3 ${RPM_BUILD_ROOT}%{_bindir}/python3-2to3 # Development tools install -m755 -d ${RPM_BUILD_ROOT}%{pylibdir}/Tools @@ -226,13 +232,6 @@ cp -ar Doc/tools $RPM_BUILD_ROOT%{pylibdir}/Doc/ # Demo scripts cp -ar Demo $RPM_BUILD_ROOT%{pylibdir}/ -find $RPM_BUILD_ROOT%{pylibdir}/lib-dynload -type d | sed "s|$RPM_BUILD_ROOT|%dir |" > dynfiles -find $RPM_BUILD_ROOT%{pylibdir}/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%{pylibdir}/email/test/data/audiotest.au $RPM_BUILD_ROOT%{pylibdir}/test/audiotest.au @@ -325,10 +324,11 @@ find $RPM_BUILD_ROOT \ mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/rpm install -m 644 %{SOURCE2} $RPM_BUILD_ROOT/%{_sysconfdir}/rpm +install -m 644 %{SOURCE3} $RPM_BUILD_ROOT/%{_sysconfdir}/rpm # 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) @@ -392,7 +392,7 @@ rm -fr $RPM_BUILD_ROOT %postun libs -p /sbin/ldconfig -%files -f dynfiles +%files %defattr(-, root, root) %doc LICENSE README %{_bindir}/pydoc* @@ -400,6 +400,68 @@ rm -fr $RPM_BUILD_ROOT %{_bindir}/python%{pybasever} %{_mandir}/*/* %dir %{pylibdir} +%dir %{dynload_dir} +%{dynload_dir}/Python-%{version}-py%{pybasever}.egg-info +%{dynload_dir}/_bisectmodule.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}/_dbm.so +%{dynload_dir}/_elementtree.so +%{dynload_dir}/_gdbmmodule.so +%{dynload_dir}/_hashlib.so +%{dynload_dir}/_heapqmodule.so +%{dynload_dir}/_json.so +%{dynload_dir}/_lsprof.so +%{dynload_dir}/_multibytecodecmodule.so +%{dynload_dir}/_multiprocessing.so +%{dynload_dir}/_pickle.so +%{dynload_dir}/_randommodule.so +%{dynload_dir}/_sha1module.so +%{dynload_dir}/_sha256module.so +%{dynload_dir}/_sha512module.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}/atexitmodule.so +%{dynload_dir}/audioop.so +%{dynload_dir}/binascii.so +%{dynload_dir}/bz2.so +%{dynload_dir}/cmathmodule.so +%{dynload_dir}/cryptmodule.so +%{dynload_dir}/datetime.so +%{dynload_dir}/fcntlmodule.so +%{dynload_dir}/grpmodule.so +%{dynload_dir}/itertoolsmodule.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}/syslogmodule.so +%{dynload_dir}/termios.so +%{dynload_dir}/timemodule.so +%{dynload_dir}/unicodedata.so +%{dynload_dir}/xxsubtype.so +%{dynload_dir}/zlibmodule.so + %dir %{pylibdir}/site-packages %{pylibdir}/site-packages/README %{pylibdir}/*.py* @@ -469,10 +531,11 @@ rm -fr $RPM_BUILD_ROOT %{_libdir}/libpython%{pybasever}.so %{_libdir}/pkgconfig/python*.pc %config(noreplace) %{_sysconfdir}/rpm/macros.python3 +%config(noreplace) %{_sysconfdir}/rpm/macros.pybytecompile %files tools %defattr(-,root,root,755) -%{_bindir}/2to3* +%{_bindir}/python3-2to3 %{_bindir}/idle* %{pylibdir}/Tools %doc %{pylibdir}/Demo @@ -484,7 +547,7 @@ rm -fr $RPM_BUILD_ROOT %defattr(-,root,root,755) %{pylibdir}/tkinter %exclude %{pylibdir}/tkinter/test -%{pylibdir}/lib-dynload/_tkinter.so +%{dynload_dir}/_tkinter.so %files test %defattr(-, root, root) @@ -495,14 +558,24 @@ rm -fr $RPM_BUILD_ROOT %{pylibdir}/json/tests %{pylibdir}/sqlite3/test %{pylibdir}/test -%{pylibdir}/lib-dynload/_ctypes_test.so -%{pylibdir}/lib-dynload/_testcapimodule.so +%{dynload_dir}/_ctypes_test.so +%{dynload_dir}/_testcapimodule.so %{pylibdir}/lib2to3/tests %doc %{pylibdir}/Demo/distutils %doc %{pylibdir}/Demo/md5test %{pylibdir}/tkinter/test %changelog +* Mon Jan 25 2010 David Malcolm - 3.1.1-21 +- introduce %%{dynload_dir} macro +- 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 +- introduce a macros.pybytecompile source file, to help with packaging python3 +modules (Source3; written by Toshio) +- rename "2to3-3" to "python3-2to3" to better reflect python 3 module packaging +plans + * Mon Jan 25 2010 David Malcolm - 3.1.1-20 - change python-3.1.1-config.patch to remove our downstream change to curses configuration in Modules/Setup.dist, so that the curses modules are built using From 1ae4dd3f5ee216f23c139f77439ef00a2e4944c0 Mon Sep 17 00:00:00 2001 From: dmalcolm Date: Thu, 28 Jan 2010 19:56:39 +0000 Subject: [PATCH 011/416] - update python-3.1.1-config.patch to remove downstream customization of build of pyexpat and elementtree modules - add patch adapted from upstream (patch 7) to add support for building against system expat; add --with-system-expat to "configure" invocation - remove embedded copies of expat and zlib from source tree during "prep" --- python-3.1.1-config.patch | 45 ++++++++----------- python-3.1.1-with-system-expat.patch | 67 ++++++++++++++++++++++++++++ python3.spec | 30 +++++++++++-- 3 files changed, 112 insertions(+), 30 deletions(-) create mode 100644 python-3.1.1-with-system-expat.patch diff --git a/python-3.1.1-config.patch b/python-3.1.1-config.patch index 5ec9024..b9eec5b 100644 --- a/python-3.1.1-config.patch +++ b/python-3.1.1-config.patch @@ -1,6 +1,7 @@ ---- Python-3.1.1/Modules/Setup.dist.config 2009-06-04 03:30:30.000000000 -0600 -+++ Python-3.1.1/Modules/Setup.dist 2009-09-25 12:14:38.000000000 -0600 -@@ -141,7 +141,7 @@ +diff -up Python-3.1.1/Modules/Setup.dist.config Python-3.1.1/Modules/Setup.dist +--- Python-3.1.1/Modules/Setup.dist.config 2009-06-04 05:30:30.000000000 -0400 ++++ Python-3.1.1/Modules/Setup.dist 2010-01-25 23:08:55.179858352 -0500 +@@ -141,7 +141,7 @@ _symtable symtablemodule.c # modules are to be built as shared libraries (see above for more # detail; also note that *static* reverses this effect): @@ -9,7 +10,7 @@ # GNU readline. Unlike previous Python incarnations, GNU readline is # now incorporated in an optional module, configured in the Setup file -@@ -151,71 +151,71 @@ +@@ -151,71 +151,71 @@ _symtable symtablemodule.c # it, depending on your system -- see the GNU readline instructions. # It's okay for this to be a shared library, too. @@ -31,11 +32,6 @@ -#_collections _collectionsmodule.c # Container types -#itertools itertoolsmodule.c # Functions creating iterators for efficient looping -#atexit atexitmodule.c # Register functions to be run at interpreter-shutdown --#_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 --#_heapq _heapqmodule.c # Heap queue algorithm +array arraymodule.c # array objects +cmath cmathmodule.c # -lm # complex math library functions +math mathmodule.c # -lm # math library functions, e.g. sin() @@ -48,9 +44,12 @@ +_collections _collectionsmodule.c # Container types +itertools itertoolsmodule.c # Functions creating iterators for efficient looping +atexit atexitmodule.c # Register functions to be run at interpreter-shutdown -+_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI _elementtree.c # elementtree accelerator + #_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI _elementtree.c # elementtree accelerator +-#_pickle _pickle.c # pickle accelerator +_pickle _pickle.c # pickle accelerator -+#datetime datetimemodule.c # date/time type + #datetime datetimemodule.c # date/time type +-#_bisect _bisectmodule.c # Bisection algorithms +-#_heapq _heapqmodule.c # Heap queue algorithm +_bisect _bisectmodule.c # Bisection algorithms +_heapq _heapqmodule.c # Heap queue algorithm @@ -114,7 +113,7 @@ # Multimedia modules -- off by default. -@@ -223,7 +223,7 @@ +@@ -223,7 +223,7 @@ _symtable symtablemodule.c # #993173 says audioop works on 64-bit platforms, though. # These represent audio samples or images as strings: @@ -123,7 +122,7 @@ # Note that the _md5 and _sha modules are normally only built if the -@@ -238,9 +238,9 @@ +@@ -238,9 +238,9 @@ _symtable symtablemodule.c # The _sha module implements the SHA checksum algorithms. # (NIST's Secure Hash Algorithms.) @@ -136,7 +135,7 @@ # The _tkinter module. -@@ -255,7 +255,7 @@ +@@ -255,7 +255,7 @@ _symtable symtablemodule.c # every system. # *** Always uncomment this (leave the leading underscore in!): @@ -145,7 +144,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: -@@ -265,7 +265,7 @@ +@@ -265,7 +265,7 @@ _symtable symtablemodule.c # *** Or uncomment this for Solaris: # -I/usr/openwin/include \ # *** Uncomment and edit for Tix extension only: @@ -154,7 +153,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: -@@ -274,7 +274,7 @@ +@@ -274,7 +274,7 @@ _symtable symtablemodule.c # *** Uncomment and edit for TOGL extension only: # -DWITH_TOGL togl.c \ # *** Uncomment and edit to reflect your Tcl/Tk versions: @@ -163,7 +162,7 @@ # *** Uncomment and edit to reflect where your X11 libraries are: # -L/usr/X11R6/lib \ # *** Or uncomment this for Solaris: -@@ -284,10 +284,10 @@ +@@ -284,10 +284,10 @@ _symtable symtablemodule.c # *** Uncomment for AIX: # -lld \ # *** Always uncomment this; X11 libraries to link with: @@ -176,7 +175,7 @@ # Curses support, requring the System V version of curses, often -@@ -321,14 +321,14 @@ +@@ -321,14 +321,14 @@ _symtable symtablemodule.c # # First, look at Setup.config; configure may have set this for you. @@ -194,7 +193,7 @@ # Lee Busby's SIGFPE modules. -@@ -351,7 +351,7 @@ +@@ -351,7 +351,7 @@ _symtable symtablemodule.c # Andrew Kuchling's zlib module. # This require zlib 1.1.3 (or later). # See http://www.gzip.org/zlib/ @@ -203,13 +202,7 @@ # Interface to the Expat XML parser # -@@ -364,19 +364,19 @@ - # - # 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 - +@@ -369,14 +369,14 @@ _symtable symtablemodule.c # Hye-Shik Chang's CJKCodecs # multibytecodec is required for all the other CJK codec modules diff --git a/python-3.1.1-with-system-expat.patch b/python-3.1.1-with-system-expat.patch new file mode 100644 index 0000000..1c99bf9 --- /dev/null +++ b/python-3.1.1-with-system-expat.patch @@ -0,0 +1,67 @@ +diff -up Python-3.1.1/configure.in.expat Python-3.1.1/configure.in +--- Python-3.1.1/configure.in.expat 2010-01-25 23:02:05.488859572 -0500 ++++ Python-3.1.1/configure.in 2010-01-25 23:02:21.425857866 -0500 +@@ -1853,6 +1853,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-3.1.1/setup.py.expat Python-3.1.1/setup.py +--- Python-3.1.1/setup.py.expat 2010-01-25 23:02:11.254859198 -0500 ++++ Python-3.1.1/setup.py 2010-01-25 23:02:21.426857993 -0500 +@@ -1110,19 +1110,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 +@@ -1132,7 +1139,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/python3.spec b/python3.spec index 78a4fed..70e256c 100644 --- a/python3.spec +++ b/python3.spec @@ -25,7 +25,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 21%{?dist} +Release: 22%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 @@ -79,6 +79,10 @@ Patch5: python-3.1.1-install-tkinter-tests.patch # a libpythonMAJOR.MINOR.a (bug 550692): Patch6: python-3.1.1-no-static-lib.patch +# Fixup configure.in and setup.py to build against system expat library. +# Adapted from http://svn.python.org/view?view=rev&revision=77170 +Patch7: python-3.1.1-with-system-expat.patch + Patch102: python-3.1.1-lib64.patch # http://bugs.python.org/issue6999 -- fixed in r75062 @@ -161,12 +165,22 @@ python 3 code that uses more than just unittest and/or test_support.py. %setup -q -n Python-%{version} chmod +x %{SOURCE1} -# 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 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 + +# +# Apply patches: +# %patch0 -p1 -b .config %patch1 -p1 -b .rpath %patch2 -p0 -b .fix-handling-of-readonly-pyc-files @@ -174,6 +188,7 @@ done %patch4 -p1 -b .apply-our-changes-to-expected-shebang %patch5 -p1 -b .install-tkinter-tests %patch6 -p1 -b .no-static-lib +%patch7 -p1 -b .expat %if "%{_lib}" == "lib64" %patch102 -p1 -b .lib64 @@ -201,7 +216,7 @@ export CFLAGS="$CFLAGS `pkg-config --cflags openssl`" export LDFLAGS="$LDFLAGS `pkg-config --libs-only-L openssl`" autoconf -%configure --enable-ipv6 --with-wide-unicode --enable-shared --with-system-ffi +%configure --enable-ipv6 --with-wide-unicode --enable-shared --with-system-ffi --with-system-expat make OPT="$CFLAGS" %{?_smp_mflags} @@ -566,6 +581,13 @@ rm -fr $RPM_BUILD_ROOT %{pylibdir}/tkinter/test %changelog +* Thu Jan 28 2010 David Malcolm - 3.1.1-22 +- update python-3.1.1-config.patch to remove downstream customization of build +of pyexpat and elementtree modules +- add patch adapted from upstream (patch 7) to add support for building against +system expat; add --with-system-expat to "configure" invocation +- remove embedded copies of expat and zlib from source tree during "prep" + * Mon Jan 25 2010 David Malcolm - 3.1.1-21 - introduce %%{dynload_dir} macro - explicitly list all lib-dynload files, rather than dynamically gathering the From b2154fa79e55bed6910922a5e6c3354e1a017478 Mon Sep 17 00:00:00 2001 From: dmalcolm Date: Mon, 8 Feb 2010 20:41:07 +0000 Subject: [PATCH 012/416] - add gdb hooks for easier debugging (Source 4) --- .cvsignore | 1 + python3.spec | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++- sources | 1 + 3 files changed, 53 insertions(+), 1 deletion(-) diff --git a/.cvsignore b/.cvsignore index 56857ac..9feab04 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1,2 @@ Python-3.1.1.tar.bz2 +libpython-36a517ef7848cbd0b3dcc7371f32e47ac4c87eba.tar.gz diff --git a/python3.spec b/python3.spec index 70e256c..f61c9df 100644 --- a/python3.spec +++ b/python3.spec @@ -2,6 +2,8 @@ %global pylibdir %{_libdir}/python%{pybasever} %global dynload_dir %{pylibdir}/lib-dynload +%global with_gdb_hooks 1 + # We want to byte-compile the .py files within the packages using the new # python3 binary. # @@ -25,7 +27,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 22%{?dist} +Release: 23%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 @@ -45,6 +47,26 @@ Source2: macros.python3 # with different Python runtimes as necessary: Source3: macros.pybytecompile +# 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/libpython3.1.so.1.0-gdb.py +# +# It would be better to put them in the -debuginfo subpackage e.g. here: +# /usr/lib/debug/usr/lib/libpython3.1.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=snapshot;h=36a517ef7848cbd0b3dcc7371f32e47ac4c87eba;sf=tgz +Source4: libpython-36a517ef7848cbd0b3dcc7371f32e47ac4c87eba.tar.gz + Patch0: python-3.1.1-config.patch @@ -165,6 +187,12 @@ python 3 code that uses more than just unittest and/or test_support.py. %setup -q -n Python-%{version} chmod +x %{SOURCE1} +# Unpack source archive 4 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 4 +%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: @@ -347,6 +375,22 @@ ldd $RPM_BUILD_ROOT/%{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/libpython3.1.so.1.0-gdb.py +# +# Long term, this should probably go in the debuginfo subpackage, e.g: +# /usr/lib/debug/usr/lib/libpython3.1.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 + %check # Run the upstream test suite, using the "runtests.sh" harness from the upstream # tarball. @@ -533,6 +577,9 @@ rm -fr $RPM_BUILD_ROOT %files libs %defattr(-,root,root,-) %{_libdir}/libpython%{pybasever}.so.* +%if 0%{?with_gdb_hooks} +%{_libdir}/libpython%{pybasever}.so.*-gdb.py* +%endif # with_gdb_hooks %files devel %defattr(-,root,root) @@ -581,6 +628,9 @@ rm -fr $RPM_BUILD_ROOT %{pylibdir}/tkinter/test %changelog +* Mon Feb 8 2010 David Malcolm - 3.1.1-23 +- add gdb hooks for easier debugging (Source 4) + * Thu Jan 28 2010 David Malcolm - 3.1.1-22 - update python-3.1.1-config.patch to remove downstream customization of build of pyexpat and elementtree modules diff --git a/sources b/sources index 59b2b95..e5f0cae 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ d1ddd9f16e3c6a51c7208f33518cd674 Python-3.1.1.tar.bz2 +e9b2198d72a406698c8de07467654204 libpython-36a517ef7848cbd0b3dcc7371f32e47ac4c87eba.tar.gz From d5a5bf3c65f387385a4839feffbc1926e2f155bf Mon Sep 17 00:00:00 2001 From: dmalcolm Date: Tue, 9 Feb 2010 03:51:42 +0000 Subject: [PATCH 013/416] - 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) --- python3.spec | 66 ++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 46 insertions(+), 20 deletions(-) diff --git a/python3.spec b/python3.spec index f61c9df..2c8e826 100644 --- a/python3.spec +++ b/python3.spec @@ -2,6 +2,16 @@ %global pylibdir %{_libdir}/python%{pybasever} %global dynload_dir %{pylibdir}/lib-dynload +# 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 # We want to byte-compile the .py files within the packages using the new @@ -27,7 +37,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 23%{?dist} +Release: 24%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 @@ -50,15 +60,12 @@ Source3: macros.pybytecompile # 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 +# These hooks are implemented in Python itself (though they are for the version +# of python that gdb is linked with, in this case Python 2.6) # -# We'll install them into the same path as the library, with a -gdb.py suffix -# e.g. -# /usr/lib/libpython3.1.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/libpython3.1.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 @@ -378,17 +385,16 @@ ldd $RPM_BUILD_ROOT/%{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/libpython3.1.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/libpython3.1.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/libpython3.1.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 %check @@ -576,10 +582,7 @@ rm -fr $RPM_BUILD_ROOT %files libs %defattr(-,root,root,-) -%{_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) @@ -627,7 +630,30 @@ rm -fr $RPM_BUILD_ROOT %doc %{pylibdir}/Demo/md5test %{pylibdir}/tkinter/test +# 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 - 3.1.1-24 +- 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 - 3.1.1-23 - add gdb hooks for easier debugging (Source 4) From c969609dfe5e910fd675a14fbb6c0720597d1da3 Mon Sep 17 00:00:00 2001 From: dmalcolm Date: Fri, 12 Feb 2010 21:38:52 +0000 Subject: [PATCH 014/416] - split configure options into multiple lines for easy of editing - add systemtap static markers (wcohen, mjw, dmalcolm; patch 8), a systemtap tapset defining "python.function.entry" and "python.function.return" to make the markers easy to use (dmalcolm; source 5), and an example of using the tapset to the docs (dmalcolm; source 6) (rhbz:545179) --- libpython.stp | 17 ++ python-3.1.1-systemtap.patch | 322 +++++++++++++++++++++++++++++++++++ python3.spec | 79 ++++++++- systemtap-example.stp | 19 +++ 4 files changed, 435 insertions(+), 2 deletions(-) create mode 100644 libpython.stp create mode 100644 python-3.1.1-systemtap.patch create mode 100644 systemtap-example.stp diff --git a/libpython.stp b/libpython.stp new file mode 100644 index 0000000..862061f --- /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("python3").library("LIBRARY_PATH").mark("function__entry") +{ + filename = user_string($arg1); + funcname = user_string($arg2); + lineno = $arg3; +} +probe python.function.return = process("python3").("LIBRARY_PATH").mark("function__return") +{ + filename = user_string($arg1); + funcname = user_string($arg2); + lineno = $arg3; +} diff --git a/python-3.1.1-systemtap.patch b/python-3.1.1-systemtap.patch new file mode 100644 index 0000000..49c06f8 --- /dev/null +++ b/python-3.1.1-systemtap.patch @@ -0,0 +1,322 @@ +diff -up Python-3.1.1/configure.in.systemtap Python-3.1.1/configure.in +--- Python-3.1.1/configure.in.systemtap 2010-02-12 15:24:34.959845279 -0500 ++++ Python-3.1.1/configure.in 2010-02-12 15:24:34.965845345 -0500 +@@ -2359,6 +2359,38 @@ then + fi + AC_MSG_RESULT($with_pymalloc) + ++# 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-3.1.1/Include/pydtrace.d.systemtap Python-3.1.1/Include/pydtrace.d +--- Python-3.1.1/Include/pydtrace.d.systemtap 2010-02-12 15:24:34.966844913 -0500 ++++ Python-3.1.1/Include/pydtrace.d 2010-02-12 15:24:34.966844913 -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-3.1.1/Makefile.pre.in.systemtap Python-3.1.1/Makefile.pre.in +--- Python-3.1.1/Makefile.pre.in.systemtap 2010-02-12 15:24:34.953845073 -0500 ++++ Python-3.1.1/Makefile.pre.in 2010-02-12 15:24:34.990844336 -0500 +@@ -312,6 +312,7 @@ PYTHON_OBJS= \ + Python/dtoa.o \ + Python/formatter_unicode.o \ + Python/$(DYNLOADFILE) \ ++ @DTRACEOBJS@ \ + $(LIBOBJS) \ + $(MACHDEP_OBJS) \ + $(THREADOBJ) +@@ -592,6 +593,18 @@ Python/formatter_unicode.o: $(srcdir)/Py + $(srcdir)/Objects/stringlib/formatter.h + + ++# 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 + +@@ -1224,6 +1237,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-3.1.1/pyconfig.h.in.systemtap Python-3.1.1/pyconfig.h.in +--- Python-3.1.1/pyconfig.h.in.systemtap 2009-05-29 13:25:39.000000000 -0400 ++++ Python-3.1.1/pyconfig.h.in 2010-02-12 15:24:34.991845511 -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 +@@ -995,6 +998,28 @@ + /* Define if you want to use computed gotos in ceval.c. */ + #undef USE_COMPUTED_GOTOS + ++/* 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 a va_list is an array of some kind */ + #undef VA_LIST_IS_ARRAY + +@@ -1011,6 +1036,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. */ +@@ -1032,20 +1060,21 @@ + /* Define to profile with the Pentium timestamp counter */ + #undef WITH_TSC + +-/* Define to 1 if your processor stores words with the most significant byte +- first (like Motorola and SPARC, unlike Intel and VAX). */ +-#undef WORDS_BIGENDIAN ++/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most ++ significant byte first (like Motorola and SPARC, unlike Intel). */ ++#if defined AC_APPLE_UNIVERSAL_BUILD ++# if defined __BIG_ENDIAN__ ++# define WORDS_BIGENDIAN 1 ++# endif ++#else ++# ifndef WORDS_BIGENDIAN ++# undef WORDS_BIGENDIAN ++# endif ++#endif + + /* Define if arithmetic is subject to x87-style double rounding issue */ + #undef X87_DOUBLE_ROUNDING + +-/* Define to 1 if on AIX 3. +- System headers sometimes define this. +- We just want to avoid a redefinition error message. */ +-#ifndef _ALL_SOURCE +-# undef _ALL_SOURCE +-#endif +- + /* Define on OpenBSD to activate all library features */ + #undef _BSD_SOURCE + +@@ -1064,15 +1093,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 + +@@ -1080,12 +1119,12 @@ + #undef _REENTRANT + + /* Define for Solaris 2.5.1 so the uint32_t typedef from , +- , or is not used. If the typedef was allowed, the ++ , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ + #undef _UINT32_T + + /* Define for Solaris 2.5.1 so the uint64_t typedef from , +- , or is not used. If the typedef was allowed, the ++ , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ + #undef _UINT64_T + +diff -up Python-3.1.1/Python/ceval.c.systemtap Python-3.1.1/Python/ceval.c +--- Python-3.1.1/Python/ceval.c.systemtap 2009-05-30 17:41:10.000000000 -0400 ++++ Python-3.1.1/Python/ceval.c 2010-02-12 15:24:54.075844169 -0500 +@@ -19,6 +19,10 @@ + + #include + ++#ifdef WITH_DTRACE ++#include "pydtrace.h" ++#endif ++ + #ifndef WITH_TSC + + #define READ_TIMESTAMP(var) +@@ -655,6 +659,69 @@ PyEval_EvalCode(PyCodeObject *co, PyObje + NULL, NULL); + } + ++#ifdef WITH_DTRACE ++struct frame_marker_info ++{ ++ char *filename; ++ char *name; ++ int lineno; ++ ++ PyObject *utf8_filename; ++ PyObject *utf8_name; ++}; ++ ++static void ++get_frame_marker_info(PyFrameObject *f, struct frame_marker_info *fmi) ++{ ++ fmi->utf8_filename = PyUnicode_AsUTF8String(f->f_code->co_filename); ++ if (fmi->utf8_filename) { ++ fmi->filename = PyBytes_AsString(fmi->utf8_filename); ++ } else { ++ fmi->filename = NULL; ++ /* FIXME: clear the exception? */ ++ } ++ ++ fmi->utf8_name = PyUnicode_AsUTF8String(f->f_code->co_name); ++ if (fmi->utf8_name) { ++ fmi->name = PyBytes_AsString(fmi->utf8_name); ++ } else { ++ fmi->name = NULL; ++ /* FIXME: clear the exception? */ ++ } ++ ++ fmi->lineno = PyCode_Addr2Line(f->f_code, f->f_lasti); ++} ++ ++static void ++release_frame_marker_info(struct frame_marker_info *fmi) ++{ ++ Py_XDECREF(fmi->utf8_filename); ++ Py_XDECREF(fmi->utf8_name); ++} ++ ++static void ++dtrace_entry(PyFrameObject *f) ++{ ++ struct frame_marker_info fmi; ++ get_frame_marker_info(f, &fmi); ++ PYTHON_FUNCTION_ENTRY(fmi.filename, fmi.name, fmi.lineno); ++ release_frame_marker_info(&fmi); ++} ++ ++static void ++dtrace_return(PyFrameObject *f) ++{ ++ struct frame_marker_info fmi; ++ get_frame_marker_info(f, &fmi); ++ PYTHON_FUNCTION_RETURN(fmi.filename, fmi.name, fmi.lineno); ++ release_frame_marker_info(&fmi); ++} ++#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 */ + +@@ -1061,6 +1128,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; +@@ -2907,6 +2977,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/python3.spec b/python3.spec index 2c8e826..92f94fa 100644 --- a/python3.spec +++ b/python3.spec @@ -14,6 +14,8 @@ %global with_gdb_hooks 1 +%global with_systemtap 1 + # We want to byte-compile the .py files within the packages using the new # python3 binary. # @@ -37,7 +39,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 24%{?dist} +Release: 25%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 @@ -74,6 +76,15 @@ Source3: macros.pybytecompile # http://fedorapeople.org/gitweb?p=dmalcolm/public_git/libpython.git;a=snapshot;h=36a517ef7848cbd0b3dcc7371f32e47ac4c87eba;sf=tgz Source4: libpython-36a517ef7848cbd0b3dcc7371f32e47ac4c87eba.tar.gz +# 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 +Source5: libpython.stp + +# Example systemtap script using the tapset +# Written by wcohen, mjw, dmalcolm; not yet sent upstream +Source6: systemtap-example.stp + Patch0: python-3.1.1-config.patch @@ -112,6 +123,13 @@ Patch6: python-3.1.1-no-static-lib.patch # Adapted from http://svn.python.org/view?view=rev&revision=77170 Patch7: python-3.1.1-with-system-expat.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); ported to 3.1.1 by +# dmalcolm +Patch8: python-3.1.1-systemtap.patch + Patch102: python-3.1.1-lib64.patch # http://bugs.python.org/issue6999 -- fixed in r75062 @@ -128,6 +146,11 @@ BuildRequires: autoconf BuildRequires: db4-devel >= 4.7 BuildRequires: libffi-devel +%if 0%{?with_systemtap} +BuildRequires: systemtap-sdt-devel +%global tapsetdir /usr/share/systemtap/tapset +%endif + URL: http://www.python.org/ # See notes in bug 532118: @@ -200,6 +223,11 @@ chmod +x %{SOURCE1} %setup -q -n Python-%{version} -T -D -a 4 %endif # with_gdb_hooks +%if 0%{?with_systemtap} +# Provide an example of usage of the tapset: +cp -a %{SOURCE6} . +%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: @@ -224,6 +252,9 @@ rm -r Modules/zlib || exit 1 %patch5 -p1 -b .install-tkinter-tests %patch6 -p1 -b .no-static-lib %patch7 -p1 -b .expat +%if 0%{?with_systemtap} +%patch8 -p1 -b .systemtap +%endif %if "%{_lib}" == "lib64" %patch102 -p1 -b .lib64 @@ -251,7 +282,21 @@ export CFLAGS="$CFLAGS `pkg-config --cflags openssl`" export LDFLAGS="$LDFLAGS `pkg-config --libs-only-L openssl`" autoconf -%configure --enable-ipv6 --with-wide-unicode --enable-shared --with-system-ffi --with-system-expat + +# For patch 8 (systemtap), we need to get a new header for configure to use: +autoheader + +%configure \ + --enable-ipv6 \ + --with-wide-unicode \ + --enable-shared \ +%if 0%{?with_systemtap} + --with-dtrace \ + --with-tapset-install-dir=%{tapsetdir} \ +%endif + --with-system-ffi \ + --with-system-expat + make OPT="$CFLAGS" %{?_smp_mflags} @@ -397,6 +442,25 @@ 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 +# +# 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}|" \ + %{SOURCE5} \ + > %{buildroot}%{tapsetdir}/%{libpython_stp} +%endif # with_systemtap + %check # Run the upstream test suite, using the "runtests.sh" harness from the upstream # tarball. @@ -583,6 +647,10 @@ rm -fr $RPM_BUILD_ROOT %files libs %defattr(-,root,root,-) %{_libdir}/%{py_INSTSONAME} +%if 0%{?with_systemtap} +%{tapsetdir}/%{libpython_stp} +%doc systemtap-example.stp +%endif %files devel %defattr(-,root,root) @@ -645,6 +713,13 @@ rm -fr $RPM_BUILD_ROOT %changelog +* Fri Feb 12 2010 David Malcolm - 3.1.1-25 +- split configure options into multiple lines for easy of editing +- add systemtap static markers (wcohen, mjw, dmalcolm; patch 8), a systemtap +tapset defining "python.function.entry" and "python.function.return" to make +the markers easy to use (dmalcolm; source 5), and an example of using the +tapset to the docs (dmalcolm; source 6) (rhbz:545179) + * Mon Feb 8 2010 David Malcolm - 3.1.1-24 - move the -gdb.py file from %%{_libdir}/INSTSONAME-gdb.py to %%{_prefix}/lib/debug/%%{_libdir}/INSTSONAME.debug-gdb.py to avoid noise from 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); +} From 3d86c8fa809f4c705116c0119864d1362e69a78f Mon Sep 17 00:00:00 2001 From: tomspur Date: Mon, 15 Feb 2010 13:59:41 +0000 Subject: [PATCH 015/416] rebuild for new version of redhat-rpm-config --- python3.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/python3.spec b/python3.spec index 92f94fa..a976965 100644 --- a/python3.spec +++ b/python3.spec @@ -39,7 +39,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 25%{?dist} +Release: 26%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 @@ -305,7 +305,7 @@ make OPT="$CFLAGS" %{?_smp_mflags} rm -fr $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT%{_prefix} $RPM_BUILD_ROOT%{_mandir} -make install DESTDIR=$RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p" mkdir -p ${RPM_BUILD_ROOT}%{pylibdir}/site-packages @@ -713,6 +713,10 @@ rm -fr $RPM_BUILD_ROOT %changelog +* Mon Feb 15 2010 Thomas Spura - 3.1.1-26 +- rebuild for new package of redhat-rpm-config (rhbz:564527) +- use 'install -p' when running 'make install' + * Fri Feb 12 2010 David Malcolm - 3.1.1-25 - split configure options into multiple lines for easy of editing - add systemtap static markers (wcohen, mjw, dmalcolm; patch 8), a systemtap From 71040c91d3b51e90d32b90abe9fa9703a02f7529 Mon Sep 17 00:00:00 2001 From: dmalcolm Date: Fri, 12 Mar 2010 22:40:23 +0000 Subject: [PATCH 016/416] - add pyfuntop.stp example (source 7) - convert usage of $$RPM_BUILD_ROOT to %%{buildroot} throughout, for consistency with python.spec --- pyfuntop.stp | 21 ++++++++++++++ python3.spec | 81 +++++++++++++++++++++++++++++----------------------- 2 files changed, 67 insertions(+), 35 deletions(-) create mode 100644 pyfuntop.stp 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/python3.spec b/python3.spec index a976965..c0f1d8a 100644 --- a/python3.spec +++ b/python3.spec @@ -39,7 +39,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 26%{?dist} +Release: 27%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 @@ -85,6 +85,11 @@ Source5: libpython.stp # Written by wcohen, mjw, dmalcolm; not yet sent upstream Source6: systemtap-example.stp +# Another example systemtap script that uses the tapset +# Written by dmalcolm; not yet sent upstream +Source7: pyfuntop.stp + + Patch0: python-3.1.1-config.patch @@ -226,6 +231,7 @@ chmod +x %{SOURCE1} %if 0%{?with_systemtap} # Provide an example of usage of the tapset: cp -a %{SOURCE6} . +cp -a %{SOURCE7} . %endif # with_systemtap # Ensure that we're using the system copy of various libraries, rather than @@ -302,10 +308,10 @@ make OPT="$CFLAGS" %{?_smp_mflags} %install -rm -fr $RPM_BUILD_ROOT -mkdir -p $RPM_BUILD_ROOT%{_prefix} $RPM_BUILD_ROOT%{_mandir} +rm -fr %{buildroot} +mkdir -p %{buildroot}%{_prefix} %{buildroot}%{_mandir} -make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p" +make install DESTDIR=%{buildroot} INSTALL="install -p" mkdir -p ${RPM_BUILD_ROOT}%{pylibdir}/site-packages @@ -321,17 +327,17 @@ cp -ar Tools/pynche ${RPM_BUILD_ROOT}%{pylibdir}/Tools/ cp -ar Tools/scripts ${RPM_BUILD_ROOT}%{pylibdir}/Tools/ # Documentation tools -install -m755 -d $RPM_BUILD_ROOT%{pylibdir}/Doc -cp -ar Doc/tools $RPM_BUILD_ROOT%{pylibdir}/Doc/ +install -m755 -d %{buildroot}%{pylibdir}/Doc +cp -ar Doc/tools %{buildroot}%{pylibdir}/Doc/ # Demo scripts -cp -ar Demo $RPM_BUILD_ROOT%{pylibdir}/ +cp -ar Demo %{buildroot}%{pylibdir}/ # 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 %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 python3-devel multilib-ready (bug #192747, #139911) @@ -343,9 +349,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 #if __WORDSIZE == 32 @@ -358,51 +364,51 @@ cat > $RPM_BUILD_ROOT%{_includedir}/python%{pybasever}/pyconfig.h << EOF 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%{pylibdir}/distutils/sysconfig.py +sed -i -e "s/'pyconfig.h'/'%{_pyconfig_h}'/" %{buildroot}%{pylibdir}/distutils/sysconfig.py # Switch all shebangs to refer to the specific Python version. -LD_LIBRARY_PATH=. ./python Tools/scripts/pathfix.py -i "%{_bindir}/python%{pybasever}" $RPM_BUILD_ROOT +LD_LIBRARY_PATH=. ./python Tools/scripts/pathfix.py -i "%{_bindir}/python%{pybasever}" %{buildroot} # Remove shebang lines from .py files that aren't executable, and # remove executability from .py files that don't have a shebang line: -find $RPM_BUILD_ROOT -name \*.py \ +find %{buildroot} -name \*.py \ \( \( \! -perm /u+x,g+x,o+x -exec sed -e '/^#!/Q 0' -e 'Q 1' {} \; \ -print -exec sed -i '1d' {} \; \) -o \( \ -perm /u+x,g+x,o+x ! -exec grep -m 1 -q '^#!' {} \; \ -exec chmod a-x {} \; \) \) # .xpm and .xbm files should not be executable: -find $RPM_BUILD_ROOT \ +find %{buildroot} \ \( -name \*.xbm -o -name \*.xpm -o -name \*.xpm.1 \) \ -exec chmod a-x {} \; # Remove executable flag from files that shouldn't have it: chmod a-x \ - $RPM_BUILD_ROOT%{pylibdir}/Demo/comparisons/patterns \ - $RPM_BUILD_ROOT%{pylibdir}/distutils/tests/Setup.sample \ - $RPM_BUILD_ROOT%{pylibdir}/Demo/rpc/test \ - $RPM_BUILD_ROOT%{pylibdir}/Tools/README \ - $RPM_BUILD_ROOT%{pylibdir}/Demo/scripts/newslist.doc \ - $RPM_BUILD_ROOT%{pylibdir}/Demo/md5test/foo + %{buildroot}%{pylibdir}/Demo/comparisons/patterns \ + %{buildroot}%{pylibdir}/distutils/tests/Setup.sample \ + %{buildroot}%{pylibdir}/Demo/rpc/test \ + %{buildroot}%{pylibdir}/Tools/README \ + %{buildroot}%{pylibdir}/Demo/scripts/newslist.doc \ + %{buildroot}%{pylibdir}/Demo/md5test/foo # Get rid of DOS batch files: -find $RPM_BUILD_ROOT -name \*.bat -exec rm {} \; +find %{buildroot} -name \*.bat -exec rm {} \; # Get rid of backup files: -find $RPM_BUILD_ROOT/ -name "*~" -exec rm -f {} \; +find %{buildroot}/ -name "*~" -exec rm -f {} \; find . -name "*~" -exec rm -f {} \; -rm -f $RPM_BUILD_ROOT%{pylibdir}/LICENSE.txt +rm -f %{buildroot}%{pylibdir}/LICENSE.txt # Junk, no point in putting in -test sub-pkg rm -f ${RPM_BUILD_ROOT}/%{pylibdir}/idlelib/testcode.py* # Get rid of stray patch file from buildroot: -rm -f $RPM_BUILD_ROOT%{pylibdir}/test/test_imp.py.apply-our-changes-to-expected-shebang # from patch 4 +rm -f %{buildroot}%{pylibdir}/test/test_imp.py.apply-our-changes-to-expected-shebang # from patch 4 # Fix end-of-line encodings: -find $RPM_BUILD_ROOT/ -name \*.py -exec sed -i 's/\r//' {} \; +find %{buildroot}/ -name \*.py -exec sed -i 's/\r//' {} \; # Fix an encoding: -iconv -f iso8859-1 -t utf-8 $RPM_BUILD_ROOT/%{pylibdir}/Demo/rpc/README > README.conv && mv -f README.conv $RPM_BUILD_ROOT/%{pylibdir}/Demo/rpc/README +iconv -f iso8859-1 -t utf-8 %{buildroot}/%{pylibdir}/Demo/rpc/README > README.conv && mv -f README.conv %{buildroot}/%{pylibdir}/Demo/rpc/README # Note that # %{pylibdir}/Demo/distutils/test2to3/setup.py @@ -414,16 +420,16 @@ iconv -f iso8859-1 -t utf-8 $RPM_BUILD_ROOT/%{pylibdir}/Demo/rpc/README > README LD_LIBRARY_PATH=. /usr/lib/rpm/brp-python-bytecompile ./python # Fixup permissions for shared libraries from non-standard 555 to standard 755: -find $RPM_BUILD_ROOT \ +find %{buildroot} \ -perm 555 -exec chmod 755 {} \; -mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/rpm -install -m 644 %{SOURCE2} $RPM_BUILD_ROOT/%{_sysconfdir}/rpm -install -m 644 %{SOURCE3} $RPM_BUILD_ROOT/%{_sysconfdir}/rpm +mkdir -p %{buildroot}/%{_sysconfdir}/rpm +install -m 644 %{SOURCE2} %{buildroot}/%{_sysconfdir}/rpm +install -m 644 %{SOURCE3} %{buildroot}/%{_sysconfdir}/rpm # 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) @@ -515,7 +521,7 @@ done # the build, due to permissions issues. %clean -rm -fr $RPM_BUILD_ROOT +rm -fr %{buildroot} %post libs -p /sbin/ldconfig @@ -649,7 +655,7 @@ rm -fr $RPM_BUILD_ROOT %{_libdir}/%{py_INSTSONAME} %if 0%{?with_systemtap} %{tapsetdir}/%{libpython_stp} -%doc systemtap-example.stp +%doc systemtap-example.stp pyfuntop.stp %endif %files devel @@ -713,6 +719,11 @@ rm -fr $RPM_BUILD_ROOT %changelog +* Fri Mar 12 2010 David Malcolm - 3.1.1-27 +- add pyfuntop.stp example (source 7) +- convert usage of $$RPM_BUILD_ROOT to %%{buildroot} throughout, for +consistency with python.spec + * Mon Feb 15 2010 Thomas Spura - 3.1.1-26 - rebuild for new package of redhat-rpm-config (rhbz:564527) - use 'install -p' when running 'make install' From 536a207750d4b0cd2dba4a59ac3c6e211d09a6b1 Mon Sep 17 00:00:00 2001 From: dmalcolm Date: Sat, 20 Mar 2010 15:18:41 +0000 Subject: [PATCH 017/416] fix typo in libpython.stp (rhbz:575336) --- libpython.stp | 2 +- python3.spec | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libpython.stp b/libpython.stp index 862061f..f41da80 100644 --- a/libpython.stp +++ b/libpython.stp @@ -9,7 +9,7 @@ probe python.function.entry = process("python3").library("LIBRARY_PATH").mark("f funcname = user_string($arg2); lineno = $arg3; } -probe python.function.return = process("python3").("LIBRARY_PATH").mark("function__return") +probe python.function.return = process("python3").library("LIBRARY_PATH").mark("function__return") { filename = user_string($arg1); funcname = user_string($arg2); diff --git a/python3.spec b/python3.spec index c0f1d8a..6471035 100644 --- a/python3.spec +++ b/python3.spec @@ -39,7 +39,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 27%{?dist} +Release: 28%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 @@ -719,6 +719,9 @@ rm -fr %{buildroot} %changelog +* Sat Mar 20 2010 David Malcolm - 3.1.1-28 +- fix typo in libpython.stp (rhbz:575336) + * Fri Mar 12 2010 David Malcolm - 3.1.1-27 - add pyfuntop.stp example (source 7) - convert usage of $$RPM_BUILD_ROOT to %%{buildroot} throughout, for From eeb0b9ba0c31777e786736c6afb59865eafebfb5 Mon Sep 17 00:00:00 2001 From: dmalcolm Date: Sun, 21 Mar 2010 21:07:31 +0000 Subject: [PATCH 018/416] - update to 3.1.2: http://www.python.org/download/releases/3.1.2/ - drop upstreamed patch 2 (.pyc permissions handling) - drop upstream patch 5 (fix for the test_tk and test_ttk_* selftests) - drop upstreamed patch 200 (path-fixing script) --- .cvsignore | 2 +- ...b-fix-handling-of-readonly-pyc-files.patch | 12 ---- python-3.1.1-install-tkinter-tests.patch | 10 --- python-3.1.1-pathfix.patch | 61 ------------------- python3.spec | 29 +++------ sources | 2 +- 6 files changed, 10 insertions(+), 106 deletions(-) delete mode 100644 python-3.1.1-importlib-fix-handling-of-readonly-pyc-files.patch delete mode 100644 python-3.1.1-install-tkinter-tests.patch delete mode 100644 python-3.1.1-pathfix.patch diff --git a/.cvsignore b/.cvsignore index 9feab04..95c8574 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,2 +1,2 @@ -Python-3.1.1.tar.bz2 libpython-36a517ef7848cbd0b3dcc7371f32e47ac4c87eba.tar.gz +Python-3.1.2.tar.bz2 diff --git a/python-3.1.1-importlib-fix-handling-of-readonly-pyc-files.patch b/python-3.1.1-importlib-fix-handling-of-readonly-pyc-files.patch deleted file mode 100644 index 1fb201b..0000000 --- a/python-3.1.1-importlib-fix-handling-of-readonly-pyc-files.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- Lib/importlib/_bootstrap.py.fix-handling-of-readonly-pyc-files 2009-10-22 15:24:57.575015046 -0400 -+++ Lib/importlib/_bootstrap.py 2009-10-22 15:25:24.024016069 -0400 -@@ -522,8 +522,8 @@ class _PyPycFileLoader(PyPycLoader, _PyF - bytecode_path = self.bytecode_path(name) - if not bytecode_path: - bytecode_path = self._base_path + _suffix_list(imp.PY_COMPILED)[0] -- file = _io.FileIO(bytecode_path, 'w') # Assuming bytes. - try: -+ file = _io.FileIO(bytecode_path, 'w') # Assuming bytes. - with _closing(file) as bytecode_file: - bytecode_file.write(data) - return True diff --git a/python-3.1.1-install-tkinter-tests.patch b/python-3.1.1-install-tkinter-tests.patch deleted file mode 100644 index 3939678..0000000 --- a/python-3.1.1-install-tkinter-tests.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- Python-3.1.1/Makefile.pre.in.install-tkinter-tests 2009-10-27 20:00:09.814539776 -0400 -+++ Python-3.1.1/Makefile.pre.in 2009-10-27 20:01:43.460549947 -0400 -@@ -835,6 +835,7 @@ EXTRAPLATDIR= @EXTRAPLATDIR@ - MACHDEPS= $(PLATDIR) $(EXTRAPLATDIR) - XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax - LIBSUBDIRS= tkinter site-packages test test/output test/data \ -+ tkinter/test tkinter/test/test_ttk tkinter/test/test_tkinter \ - test/decimaltestdata \ - encodings \ - email email/mime email/test email/test/data \ diff --git a/python-3.1.1-pathfix.patch b/python-3.1.1-pathfix.patch deleted file mode 100644 index f45409a..0000000 --- a/python-3.1.1-pathfix.patch +++ /dev/null @@ -1,61 +0,0 @@ ---- Python-3.1.1.orig/Tools/scripts/pathfix.py 2009-09-24 15:27:04.000000000 -0600 -+++ Python-3.1.1/Tools/scripts/pathfix.py 2009-09-25 14:05:04.000000000 -0600 -@@ -1,4 +1,4 @@ --#! /usr/bin/env python -+#!/usr/bin/env python3.1 - - # Change the #! line occurring in Python scripts. The new interpreter - # pathname must be given with a -i option. -@@ -43,8 +43,8 @@ - sys.exit(2) - for o, a in opts: - if o == '-i': -- new_interpreter = a -- if not new_interpreter or new_interpreter[0] != '/' or not args: -+ new_interpreter = a.encode() -+ if not new_interpreter or new_interpreter[0] != b'/'[0] or not args: - err('-i option or file-or-directory missing\n') - err(usage) - sys.exit(2) -@@ -61,7 +61,7 @@ - - ispythonprog = re.compile('^[a-zA-Z0-9_]+\.py$') - def ispython(name): -- return ispythonprog.match(name) >= 0 -+ return bool(ispythonprog.match(name)) - - def recursedown(dirname): - dbg('recursedown(%r)\n' % (dirname,)) -@@ -88,7 +88,7 @@ - def fix(filename): - ## dbg('fix(%r)\n' % (filename,)) - try: -- f = open(filename, 'r') -+ f = open(filename, 'rb') - except IOError as msg: - err('%s: cannot open: %r\n' % (filename, msg)) - return 1 -@@ -101,7 +101,7 @@ - head, tail = os.path.split(filename) - tempname = os.path.join(head, '@' + tail) - try: -- g = open(tempname, 'w') -+ g = open(tempname, 'wb') - except IOError as msg: - f.close() - err('%s: cannot create: %r\n' % (tempname, msg)) -@@ -139,11 +139,11 @@ - return 0 - - def fixline(line): -- if not line.startswith('#!'): -+ if not line.startswith(b'#!'): - return line -- if "python" not in line: -+ if b"python" not in line: - return line -- return '#! %s\n' % new_interpreter -+ return b'#!' + new_interpreter + b'\n' - - if __name__ == '__main__': - main() diff --git a/python3.spec b/python3.spec index 6471035..b63e9f1 100644 --- a/python3.spec +++ b/python3.spec @@ -38,8 +38,8 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 -Version: %{pybasever}.1 -Release: 28%{?dist} +Version: %{pybasever}.2 +Release: 1%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 @@ -97,11 +97,6 @@ Patch0: python-3.1.1-config.patch # Was Patch0 in ivazquez' python3000 specfile: Patch1: Python-3.1.1-rpath.patch -# Fixup importlib/_bootstrap.py so that it correctly handles being unable to -# open .pyc files for writing -# Sent upstream as http://bugs.python.org/issue7187 -Patch2: python-3.1.1-importlib-fix-handling-of-readonly-pyc-files.patch - # The four TestMIMEAudio tests fail due to "audiotest.au" not being packaged. # It's simplest to remove them: Patch3: python-3.1.1-remove-mimeaudio-tests.patch @@ -113,13 +108,6 @@ Patch3: python-3.1.1-remove-mimeaudio-tests.patch # the expected value in this test: Patch4: python-3.1.1-apply-our-changes-to-expected-shebang-for-test_imp.patch -# test_tk test_ttk_guionly and test_ttk_textonly all rely on tkinter/test, but -# upstream's Makefile.pre.in doesn't install that subdirectory; patch it so that -# it does: -Patch5: python-3.1.1-install-tkinter-tests.patch -# (The resulting test support code is in the tkinter subpackage, but -# this is not a major problem) - # Patch the Makefile.pre.in so that the generated Makefile doesn't try to build # a libpythonMAJOR.MINOR.a (bug 550692): Patch6: python-3.1.1-no-static-lib.patch @@ -137,9 +125,6 @@ Patch8: python-3.1.1-systemtap.patch Patch102: python-3.1.1-lib64.patch -# http://bugs.python.org/issue6999 -- fixed in r75062 -Patch200: python-3.1.1-pathfix.patch - BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRequires: readline-devel, openssl-devel, gmp-devel @@ -252,10 +237,8 @@ rm -r Modules/zlib || exit 1 # %patch0 -p1 -b .config %patch1 -p1 -b .rpath -%patch2 -p0 -b .fix-handling-of-readonly-pyc-files %patch3 -p1 -b .remove-mimeaudio-tests %patch4 -p1 -b .apply-our-changes-to-expected-shebang -%patch5 -p1 -b .install-tkinter-tests %patch6 -p1 -b .no-static-lib %patch7 -p1 -b .expat %if 0%{?with_systemtap} @@ -266,8 +249,6 @@ rm -r Modules/zlib || exit 1 %patch102 -p1 -b .lib64 %endif -%patch200 -p1 -b .pathfix - # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. # @@ -719,6 +700,12 @@ rm -fr %{buildroot} %changelog +* Sun Mar 21 2010 David Malcolm - 3.1.2-1 +- update to 3.1.2: http://www.python.org/download/releases/3.1.2/ +- drop upstreamed patch 2 (.pyc permissions handling) +- drop upstream patch 5 (fix for the test_tk and test_ttk_* selftests) +- drop upstreamed patch 200 (path-fixing script) + * Sat Mar 20 2010 David Malcolm - 3.1.1-28 - fix typo in libpython.stp (rhbz:575336) diff --git a/sources b/sources index e5f0cae..342571f 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -d1ddd9f16e3c6a51c7208f33518cd674 Python-3.1.1.tar.bz2 e9b2198d72a406698c8de07467654204 libpython-36a517ef7848cbd0b3dcc7371f32e47ac4c87eba.tar.gz +45350b51b58a46b029fb06c61257e350 Python-3.1.2.tar.bz2 From 485fd76f7f375db1544ab050d7fd7788b93033b0 Mon Sep 17 00:00:00 2001 From: dmalcolm Date: Wed, 24 Mar 2010 19:57:26 +0000 Subject: [PATCH 019/416] refresh gdb hooks to v3 (reworking how they are packaged) --- python-gdb.py | 848 ++++++++++++++++++++++++++++++++++++++++++++++++++ python3.spec | 18 +- sources | 1 - 3 files changed, 856 insertions(+), 11 deletions(-) create mode 100644 python-gdb.py 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 "", line 1, in + 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 + 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 + instance within the process being debugged. + """ + _typename = 'PyClassObject' + + +class PyCodeObjectPtr(PyObjectPtr): + """ + Class wrapping a gdb.Value that's a PyCodeObject* i.e. a 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/python3.spec b/python3.spec index b63e9f1..5d8022c 100644 --- a/python3.spec +++ b/python3.spec @@ -39,7 +39,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 1%{?dist} +Release: 2%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 @@ -73,8 +73,9 @@ Source3: macros.pybytecompile # information # # Downloaded from: -# http://fedorapeople.org/gitweb?p=dmalcolm/public_git/libpython.git;a=snapshot;h=36a517ef7848cbd0b3dcc7371f32e47ac4c87eba;sf=tgz -Source4: libpython-36a517ef7848cbd0b3dcc7371f32e47ac4c87eba.tar.gz +# http://bugs.python.org/issue8032 +# This is Tools/gdb/libpython.py from v3 of the patch +Source4: python-gdb.py # Systemtap tapset to make it easier to use the systemtap static probes # (actually a template; LIBRARY_PATH will get fixed up during install) @@ -207,12 +208,6 @@ python 3 code that uses more than just unittest and/or test_support.py. %setup -q -n Python-%{version} chmod +x %{SOURCE1} -# Unpack source archive 4 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 4 -%endif # with_gdb_hooks - %if 0%{?with_systemtap} # Provide an example of usage of the tapset: cp -a %{SOURCE6} . @@ -426,7 +421,7 @@ ldd %{buildroot}/%{dynload_dir}/_curses*.so \ # %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 +cp %{SOURCE4} %{buildroot}%{_prefix}/lib/debug/%{_libdir}/%{py_INSTSONAME}.debug-gdb.py %endif # with_gdb_hooks # @@ -700,6 +695,9 @@ rm -fr %{buildroot} %changelog +* Wed Mar 24 2010 David Malcolm - 3.1.2-2 +- refresh gdb hooks to v3 (reworking how they are packaged) + * Sun Mar 21 2010 David Malcolm - 3.1.2-1 - update to 3.1.2: http://www.python.org/download/releases/3.1.2/ - drop upstreamed patch 2 (.pyc permissions handling) diff --git a/sources b/sources index 342571f..30f03d2 100644 --- a/sources +++ b/sources @@ -1,2 +1 @@ -e9b2198d72a406698c8de07467654204 libpython-36a517ef7848cbd0b3dcc7371f32e47ac4c87eba.tar.gz 45350b51b58a46b029fb06c61257e350 Python-3.1.2.tar.bz2 From da0826ad3b0eb43fced4ade908a2dffee15e426b Mon Sep 17 00:00:00 2001 From: dmalcolm Date: Thu, 25 Mar 2010 20:38:13 +0000 Subject: [PATCH 020/416] - 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) --- python-gdb.py | 151 ++++++++++++++++++++++++++++++++++++++++---------- python3.spec | 9 ++- 2 files changed, 129 insertions(+), 31 deletions(-) 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 != '': + 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/python3.spec b/python3.spec index 5d8022c..c106b67 100644 --- a/python3.spec +++ b/python3.spec @@ -39,7 +39,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 2%{?dist} +Release: 3%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 @@ -74,7 +74,7 @@ Source3: macros.pybytecompile # # 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 Source4: python-gdb.py # Systemtap tapset to make it easier to use the systemtap static probes @@ -695,6 +695,11 @@ rm -fr %{buildroot} %changelog +* Thu Mar 25 2010 David Malcolm - 3.1.2-3 +- 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 - 3.1.2-2 - refresh gdb hooks to v3 (reworking how they are packaged) From 80325d9c24cee4e984a3a027edf402bc1f686a58 Mon Sep 17 00:00:00 2001 From: dmalcolm Date: Thu, 1 Apr 2010 02:53:39 +0000 Subject: [PATCH 021/416] update python-gdb.py from v4 to v5 (improving performance and stability, adding commands) --- python-gdb.py | 775 +++++++++++++++++++++++++++++++++++++++----------- python3.spec | 8 +- 2 files changed, 619 insertions(+), 164 deletions(-) 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 "" % 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 ('' + % (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 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 != '': + 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,107 +1038,35 @@ 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*)" def __init__ (self, gdbval): 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: + +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 = self._gdbframe.read_var('f') + return PyFrameObjectPtr.from_pyobject_ptr(f) + except ValueError: + return None + + @classmethod + def get_selected_frame(cls): + _gdbframe = gdb.selected_frame() + if _gdbframe: + return Frame(_gdbframe) 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 + @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() - 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 + 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() - - 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()) + frame = Frame.get_selected_python_frame() + while frame: + if frame.is_evalframeex(): + frame.print_summary() + frame = frame.older() PyBacktrace() + +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) + + + 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/python3.spec b/python3.spec index c106b67..641f02d 100644 --- a/python3.spec +++ b/python3.spec @@ -39,7 +39,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 3%{?dist} +Release: 4%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 @@ -74,7 +74,7 @@ Source3: macros.pybytecompile # # 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 Source4: python-gdb.py # Systemtap tapset to make it easier to use the systemtap static probes @@ -695,6 +695,10 @@ rm -fr %{buildroot} %changelog +* Wed Mar 31 2010 David Malcolm - 3.1.2-4 +- update python-gdb.py from v4 to v5 (improving performance and stability, +adding commands) + * Thu Mar 25 2010 David Malcolm - 3.1.2-3 - 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 From bbd09cc947f95434d0e2484cac328a4a4355e8a2 Mon Sep 17 00:00:00 2001 From: dmalcolm Date: Tue, 13 Apr 2010 17:36:08 +0000 Subject: [PATCH 022/416] - exclude test_http_cookies when running selftests, due to hang seen on http://koji.fedoraproject.org/koji/taskinfo?taskID=2088463 (cancelled after 11 hours) - update python-gdb.py from v5 to py3k version submitted upstream --- python-gdb.py | 108 ++++++++++++++++++++++---------------------------- python3.spec | 23 +++++++---- 2 files changed, 64 insertions(+), 67 deletions(-) diff --git a/python-gdb.py b/python-gdb.py index 640b7f6..dd6d462 100644 --- a/python-gdb.py +++ b/python-gdb.py @@ -19,9 +19,10 @@ 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"] +holding three PyObject* that turn out to be PyBytesObject* instances, we can +generate a proxy value within the gdb process that is a list of bytes +instances: + [b"foo", b"bar", b"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 @@ -39,7 +40,7 @@ the type names are known to the debugger The module also extends gdb with some python-specific commands. ''' - +from __future__ import with_statement import gdb # Look up the gdb.Type for some standard types: @@ -57,7 +58,7 @@ 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_BYTES_SUBCLASS = (1L << 27) Py_TPFLAGS_UNICODE_SUBCLASS = (1L << 28) Py_TPFLAGS_DICT_SUBCLASS = (1L << 29) Py_TPFLAGS_BASE_EXC_SUBCLASS = (1L << 30) @@ -99,7 +100,7 @@ class TruncatedStringIO(object): # Truncation: self._val += data[0:self.maxlen - len(self._val)] raise StringTruncated() - + self._val += data def getvalue(self): @@ -108,7 +109,7 @@ class TruncatedStringIO(object): 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*) + inferior process, or some subclass pointer e.g. (PyBytesObject*) There will be a subclass for every refined PyObject type that we care about. @@ -120,7 +121,7 @@ class PyObjectPtr(object): def __init__(self, gdbval, cast_to=None): if cast_to: - self._gdbval = gdbval.cast(cast_to) + self._gdbval = gdbval.cast(cast_to) else: self._gdbval = gdbval @@ -148,12 +149,8 @@ class PyObjectPtr(object): 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] + pyo_ptr = self._gdbval.cast(PyVarObjectPtr.get_gdb_type()) + return pyo_ptr.dereference()[name] # General case: look it up inside the object: return self._gdbval.dereference()[name] @@ -318,8 +315,8 @@ class PyObjectPtr(object): 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_BYTES_SUBCLASS: + return PyBytesObjectPtr if tp_flags & Py_TPFLAGS_UNICODE_SUBCLASS: return PyUnicodeObjectPtr if tp_flags & Py_TPFLAGS_DICT_SUBCLASS: @@ -355,6 +352,8 @@ class PyObjectPtr(object): def as_address(self): return long(self._gdbval) +class PyVarObjectPtr(PyObjectPtr): + _typename = 'PyVarObject' class ProxyAlreadyVisited(object): ''' @@ -365,7 +364,7 @@ class ProxyAlreadyVisited(object): ''' def __init__(self, rep): self._rep = rep - + def __repr__(self): return self._rep @@ -407,7 +406,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') + @@ -446,7 +445,7 @@ class HeapTypeObjectPtr(PyObjectPtr): pass # Not found, or some kind of error: - return None + return None def proxyval(self, visited): ''' @@ -515,20 +514,6 @@ class PyBaseExceptionObjectPtr(PyObjectPtr): 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 - instances (Py_True/Py_False) within the process being debugged. - """ - _typename = 'PyBoolObject' - - def proxyval(self, visited): - 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 @@ -548,7 +533,7 @@ 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 ('' % (self.ml_name, @@ -592,7 +577,7 @@ class PyCodeObjectPtr(PyObjectPtr): # 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')) + lineno = int_from_int(self.field('co_firstlineno')) addr = 0 for addr_incr, line_incr in zip(co_lnotab[::2], co_lnotab[1::2]): @@ -630,9 +615,9 @@ class PyDictObjectPtr(PyObjectPtr): result = {} 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 + 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): @@ -690,13 +675,6 @@ class PyInstanceObjectPtr(PyObjectPtr): _write_instance_repr(out, visited, cl_name, pyop_in_dict, self.as_address()) - -class PyIntObjectPtr(PyObjectPtr): - _typename = 'PyIntObject' - - def proxyval(self, visited): - result = int_from_int(self.field('ob_ival')) - return result class PyListObjectPtr(PyObjectPtr): _typename = 'PyListObject' @@ -711,7 +689,7 @@ class PyListObjectPtr(PyObjectPtr): 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 @@ -770,6 +748,16 @@ class PyLongObjectPtr(PyObjectPtr): result = -result return result +class PyBoolObjectPtr(PyLongObjectPtr): + """ + Class wrapping a gdb.Value that's a PyBoolObject* i.e. one of the two + instances (Py_True/Py_False) within the process being debugged. + """ + def proxyval(self, visited): + if PyLongObjectPtr.proxyval(self, visited): + return True + else: + return False class PyNoneStructPtr(PyObjectPtr): """ @@ -839,7 +827,7 @@ class PyFrameObjectPtr(PyObjectPtr): ''' 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(): @@ -861,9 +849,9 @@ class PyFrameObjectPtr(PyObjectPtr): 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(): @@ -894,9 +882,9 @@ class PyFrameObjectPtr(PyObjectPtr): return out.write('Frame 0x%x, for file %s, line %i, in %s (' % (self.as_address(), - self.co_filename, + self.co_filename.proxyval(visited), self.current_line_num(), - self.co_name)) + self.co_name.proxyval(visited))) first = True for pyop_name, pyop_value in self.iter_locals(): if not first: @@ -906,7 +894,7 @@ class PyFrameObjectPtr(PyObjectPtr): out.write(pyop_name.proxyval(visited)) out.write('=') pyop_value.write_repr(out, visited) - + out.write(')') class PySetObjectPtr(PyObjectPtr): @@ -958,8 +946,8 @@ class PySetObjectPtr(PyObjectPtr): out.write('])') -class PyStringObjectPtr(PyObjectPtr): - _typename = 'PyStringObject' +class PyBytesObjectPtr(PyObjectPtr): + _typename = 'PyBytesObject' def __str__(self): field_ob_size = self.field('ob_size') @@ -1038,7 +1026,7 @@ 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) @@ -1065,7 +1053,7 @@ def pretty_printer_lookup(gdbval): if type.code == gdb.TYPE_CODE_PTR: type = type.target().unqualified() t = str(type) - if t in ("PyObject", "PyFrameObject"): + if t in ("PyObject", "PyFrameObject", "PyUnicodeObject"): return PyObjectPtrPrinter(gdbval) """ @@ -1099,7 +1087,7 @@ register (gdb.current_objfile ()) class Frame(object): ''' - Wrapper for gdb.Frame, adding various methods + Wrapper for gdb.Frame, adding various methods ''' def __init__(self, gdbframe): self._gdbframe = gdbframe @@ -1193,7 +1181,7 @@ class PyList(gdb.Command): 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. @@ -1252,8 +1240,8 @@ class PyList(gdb.Command): if i + start == lineno: linestr = '>' + linestr sys.stdout.write('%4s %s' % (linestr, line)) - - + + # ...and register the command: PyList() diff --git a/python3.spec b/python3.spec index 641f02d..9e119ff 100644 --- a/python3.spec +++ b/python3.spec @@ -39,7 +39,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 4%{?dist} +Release: 5%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 @@ -72,9 +72,12 @@ Source3: macros.pybytecompile # 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 +# This is the version from +# http://bugs.python.org/issue8380 +# +# This is Tools/gdb/libpython.py from: +# http://bugs.python.org/file16902/port-gdb7-hooks-to-py3k.patch +# when applied to r80008 of the py3k branch Source4: python-gdb.py # Systemtap tapset to make it easier to use the systemtap static probes @@ -446,9 +449,9 @@ sed \ %check # Run the upstream test suite, using the "runtests.sh" harness from the upstream # tarball. -# I'm seeing occasional hangs in "test_httplib" when running the test suite inside -# Koji. For that reason I exclude that one. -LD_LIBRARY_PATH=$(pwd) ./runtests.sh -x test_httplib +# I'm seeing occasional hangs in some http tests when running the test suite +# inside Koji. For that reason I exclude them +LD_LIBRARY_PATH=$(pwd) ./runtests.sh -x test_httplib test_http_cookies # Note that we're running the tests using the version of the code in the builddir, # not in the buildroot. @@ -695,6 +698,12 @@ rm -fr %{buildroot} %changelog +* Tue Apr 13 2010 David Malcolm - 3.1.2-5 +- exclude test_http_cookies when running selftests, due to hang seen on +http://koji.fedoraproject.org/koji/taskinfo?taskID=2088463 (cancelled after +11 hours) +- update python-gdb.py from v5 to py3k version submitted upstream + * Wed Mar 31 2010 David Malcolm - 3.1.2-4 - update python-gdb.py from v4 to v5 (improving performance and stability, adding commands) From 55cf58012d82f965f94163c9e36771b9afe1cda8 Mon Sep 17 00:00:00 2001 From: dmalcolm Date: Mon, 24 May 2010 23:45:40 +0000 Subject: [PATCH 023/416] - build and install two different configurations of Python 3: debug and standard, packaging the debug build in a new "python3-debug" subpackage (patch 103) --- python-3.1.2-debug-build.patch | 275 +++++++++++++++++++++++ python3.spec | 389 ++++++++++++++++++++++++++++++--- 2 files changed, 634 insertions(+), 30 deletions(-) create mode 100644 python-3.1.2-debug-build.patch diff --git a/python-3.1.2-debug-build.patch b/python-3.1.2-debug-build.patch new file mode 100644 index 0000000..2a71afe --- /dev/null +++ b/python-3.1.2-debug-build.patch @@ -0,0 +1,275 @@ +diff -up Python-3.1.2/configure.in.debug-build Python-3.1.2/configure.in +--- Python-3.1.2/configure.in.debug-build 2010-05-20 22:48:14.573026391 -0400 ++++ Python-3.1.2/configure.in 2010-05-20 22:48:14.580902316 -0400 +@@ -569,7 +569,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) + +@@ -711,8 +711,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*) +@@ -816,6 +816,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-3.1.2/Lib/distutils/command/build_ext.py.debug-build Python-3.1.2/Lib/distutils/command/build_ext.py +--- Python-3.1.2/Lib/distutils/command/build_ext.py.debug-build 2010-03-19 17:56:34.000000000 -0400 ++++ Python-3.1.2/Lib/distutils/command/build_ext.py 2010-05-20 22:48:14.581902928 -0400 +@@ -673,7 +673,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 +@@ -754,6 +757,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-3.1.2/Lib/distutils/sysconfig.py.debug-build Python-3.1.2/Lib/distutils/sysconfig.py +--- Python-3.1.2/Lib/distutils/sysconfig.py.debug-build 2010-05-20 22:48:14.577026372 -0400 ++++ Python-3.1.2/Lib/distutils/sysconfig.py 2010-05-20 22:48:14.581902928 -0400 +@@ -83,7 +83,8 @@ def get_python_inc(plat_specific=0, pref + else: + incdir = os.path.join(get_config_var('srcdir'), 'Include') + return os.path.normpath(incdir) +- 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": +@@ -229,7 +230,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-3.1.2/Makefile.pre.in.debug-build Python-3.1.2/Makefile.pre.in +--- Python-3.1.2/Makefile.pre.in.debug-build 2010-05-20 22:48:14.577901061 -0400 ++++ Python-3.1.2/Makefile.pre.in 2010-05-20 22:48:14.581902928 -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 +@@ -113,6 +113,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@ +@@ -176,7 +182,7 @@ LIBOBJDIR= Python/ + LIBOBJS= @LIBOBJS@ + + PYTHON= python$(EXE) +-BUILDPYTHON= python$(BUILDEXE) ++BUILDPYTHON= python$(BUILD_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 +@@ -422,7 +428,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) $@; \ +@@ -793,7 +799,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); \ +@@ -807,15 +813,15 @@ altbininstall: $(BUILDPYTHON) + fi + + bininstall: altbininstall +- -if test -f $(DESTDIR)$(BINDIR)/$(PYTHON)3$(EXE) -o -h $(DESTDIR)$(BINDIR)/$(PYTHON)3$(EXE); \ +- then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON)3$(EXE); \ ++ -if test -f $(DESTDIR)$(BINDIR)/$(PYTHON)3$(DEBUG_SUFFIX)$(EXE) -o -h $(DESTDIR)$(BINDIR)/$(PYTHON)3$(DEBUG_SUFFIX)$(EXE); \ ++ then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON)3$(DEBUG_SUFFIX)$(EXE); \ + else true; \ + fi +- (cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON)3$(EXE)) +- -rm -f $(DESTDIR)$(BINDIR)/python3-config +- (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python3-config) +- -rm -f $(DESTDIR)$(LIBPC)/python3.pc +- (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python3.pc) ++ (cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(DEBUG_SUFFIX)$(EXE) $(PYTHON)3$(DEBUG_SUFFIX)$(EXE)) ++ -rm -f $(DESTDIR)$(BINDIR)/python3$(DEBUG_SUFFIX)-config ++ (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(DEBUG_SUFFIX)-config python3$(DEBUG_SUFFIX)-config) ++ -rm -f $(DESTDIR)$(LIBPC)/python3$(DEBUG_SUFFIX).pc ++ (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION)$(DEBUG_SUFFIX).pc python3$(DEBUG_SUFFIX).pc) + + # Install the manual page + maninstall: +@@ -960,7 +966,7 @@ inclinstall: + + # Install the library and miscellaneous stuff needed for extending/embedding + # This goes into $(exec_prefix) +-LIBPL= $(LIBP)/config ++LIBPL= $(LIBP)/config$(DEBUG_SUFFIX) + + # pkgconfig directory + LIBPC= $(LIBDIR)/pkgconfig +@@ -981,14 +987,14 @@ libainstall: all + $(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 + # 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-3.1.2/Misc/python-config.in.debug-build Python-3.1.2/Misc/python-config.in +--- Python-3.1.2/Misc/python-config.in.debug-build 2007-09-01 03:27:37.000000000 -0400 ++++ Python-3.1.2/Misc/python-config.in 2010-05-20 22:48:14.582902254 -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-3.1.2/Modules/makesetup.debug-build Python-3.1.2/Modules/makesetup +--- Python-3.1.2/Modules/makesetup.debug-build 2008-06-11 01:26:20.000000000 -0400 ++++ Python-3.1.2/Modules/makesetup 2010-05-20 22:48:14.582902254 -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-3.1.2/Python/dynload_shlib.c.debug-build Python-3.1.2/Python/dynload_shlib.c +--- Python-3.1.2/Python/dynload_shlib.c.debug-build 2008-06-11 01:26:20.000000000 -0400 ++++ Python-3.1.2/Python/dynload_shlib.c 2010-05-20 22:48:14.582902254 -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-3.1.2/Python/sysmodule.c.debug-build Python-3.1.2/Python/sysmodule.c +--- Python-3.1.2/Python/sysmodule.c.debug-build 2010-03-03 06:55:53.000000000 -0500 ++++ Python-3.1.2/Python/sysmodule.c 2010-05-20 22:48:14.582902254 -0400 +@@ -1429,6 +1429,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 ++ + /* float repr style: 0.03 (short) vs 0.029999999999999999 (legacy) */ + #ifndef PY_NO_SHORT_FLOAT_REPR + SET_SYS_FROM_STRING("float_repr_style", +diff -up Python-3.1.2/runtests.sh.debug-build Python-3.1.2/runtests.sh +--- Python-3.1.2/runtests.sh.debug-build 2010-05-22 00:42:41.950889054 -0400 ++++ Python-3.1.2/runtests.sh 2010-05-22 00:54:47.503851503 -0400 +@@ -16,11 +16,14 @@ Flags (arguments starting with '-') are + regrtest.py, except for -x, which is processed here." + + # Choose the Python binary. +-case `uname` in +-Darwin) PYTHON=./python.exe;; +-CYGWIN*) PYTHON=./python.exe;; +-*) PYTHON=./python;; +-esac ++if [ -z $PYTHON ] ++then ++ case `uname` in ++ Darwin) PYTHON=./python.exe;; ++ CYGWIN*) PYTHON=./python.exe;; ++ *) PYTHON=./python;; ++ esac ++fi + + PYTHON="$PYTHON -bb" + diff --git a/python3.spec b/python3.spec index 9e119ff..f5592ae 100644 --- a/python3.spec +++ b/python3.spec @@ -10,7 +10,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 @@ -39,7 +40,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 5%{?dist} +Release: 6%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 @@ -129,6 +130,69 @@ Patch8: python-3.1.1-systemtap.patch Patch102: python-3.1.1-lib64.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-build.dpatch +# +# (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. +# +# * Patch runtests.sh to support supplying a value for PYTHON, so that we can +# run the tests against each of the builds + +Patch103: python-3.1.2-debug-build.patch BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRequires: readline-devel, openssl-devel, gmp-devel @@ -207,6 +271,37 @@ in production. You might want to install the python3-test package if you're developing python 3 code that uses more than just unittest and/or test_support.py. +%package debug +Summary: Debug version of the Python 3 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: %{name}-tkinter%{?_isa} = %{version}-%{release} +Requires: %{name}-tools%{?_isa} = %{version}-%{release} + +%description debug +python3-debug provides a version of the Python 3 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 3 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 +versions of Python 3, 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 3 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 3 implementation +can load its own extensions. + %prep %setup -q -n Python-%{version} chmod +x %{SOURCE1} @@ -247,6 +342,10 @@ rm -r Modules/zlib || exit 1 %patch102 -p1 -b .lib64 %endif +%patch103 -p1 -b .debug-build + + + # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. # @@ -258,6 +357,7 @@ sed --in-place \ Lib/pydoc.py || exit 1 %build +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`" @@ -271,6 +371,25 @@ autoconf # For patch 8 (systemtap), we need to get a new header for configure to use: autoheader +# 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 \ --with-wide-unicode \ @@ -280,18 +399,85 @@ autoheader --with-tapset-install-dir=%{tapsetdir} \ %endif --with-system-ffi \ - --with-system-expat + --with-system-expat \ + $ExtraConfigArgs \ + %{nil} make 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 -fr %{buildroot} mkdir -p %{buildroot}%{_prefix} %{buildroot}%{_mandir} +InstallPython() { + + ConfName=$1 + PyInstSoName=$2 + + ConfDir=build/$ConfName + + echo STARTING: INSTALL OF PYTHON FOR CONFIGURATION: $ConfName + mkdir -p $ConfDir + + pushd $ConfDir + make install DESTDIR=%{buildroot} INSTALL="install -p" + +# 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/libpython3.1.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/libpython3.1.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 %{SOURCE4} %{buildroot}$PathOfGdbPy +%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 \ + %{py_INSTSONAME_debug} + +# Now the optimized build: +InstallPython optimized \ + %{py_INSTSONAME_optimized} + mkdir -p ${RPM_BUILD_ROOT}%{pylibdir}/site-packages mv ${RPM_BUILD_ROOT}%{_bindir}/2to3 ${RPM_BUILD_ROOT}%{_bindir}/python3-2to3 @@ -328,9 +514,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 #if __WORDSIZE == 32 @@ -341,12 +528,16 @@ cat > %{buildroot}%{_includedir}/python%{pybasever}/pyconfig.h << EOF #error "Unknown word size" #endif EOF +done # 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 # Switch all shebangs to refer to the specific Python version. -LD_LIBRARY_PATH=. ./python Tools/scripts/pathfix.py -i "%{_bindir}/python%{pybasever}" %{buildroot} +LD_LIBRARY_PATH=./build/optimized ./build/optimized/python \ + Tools/scripts/pathfix.py \ + -i "%{_bindir}/python%{pybasever}" \ + %{buildroot} # Remove shebang lines from .py files that aren't executable, and # remove executability from .py files that don't have a shebang line: @@ -412,20 +603,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/libpython3.1.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/libpython3.1.so.1.0-gdb.py -# but doing so generated noise when ldconfig was rerun (rhbz:562980) -# -%if 0%{?with_gdb_hooks} -mkdir -p %{buildroot}%{_prefix}/lib/debug/%{_libdir} -cp %{SOURCE4} %{buildroot}%{_prefix}/lib/debug/%{_libdir}/%{py_INSTSONAME}.debug-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} ; exi 1) + + ;; + *) + ldd $Module | grep %{py_INSTSONAME_debug} && + (echo Optimized module $Module linked against debug %{py_INSTSONAME_optimized} ; exi 1) + ;; + esac +done # # Systemtap hooks: @@ -435,23 +627,39 @@ cp %{SOURCE4} %{buildroot}%{_prefix}/lib/debug/%{_libdir}/%{py_INSTSONAME}.debug # 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}|" \ - %{SOURCE5} \ - > %{buildroot}%{tapsetdir}/%{libpython_stp} + -e "s|LIBRARY_PATH|%{_libdir}/%{py_INSTSONAME_optimized}|" \ + %{SOURCE6} \ + > %{buildroot}%{tapsetdir}/%{libpython_stp_optimized} + +sed \ + -e "s|LIBRARY_PATH|%{_libdir}/%{py_INSTSONAME_debug}|" \ + %{SOURCE6} \ + > %{buildroot}%{tapsetdir}/%{libpython_stp_debug} + %endif # with_systemtap %check +topdir=$(pwd) +CheckPython() { + ConfName=$1 + ConfDir=build/$ConfName + + echo STARTING: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName + # Run the upstream test suite, using the "runtests.sh" harness from the upstream # tarball. # I'm seeing occasional hangs in some http tests when running the test suite # inside Koji. For that reason I exclude them -LD_LIBRARY_PATH=$(pwd) ./runtests.sh -x test_httplib test_http_cookies + +LD_LIBRARY_PATH=$ConfDir PYTHON=$ConfDir/python $topdir/runtests.sh -x test_httplib test_http_cookies # Note that we're running the tests using the version of the code in the builddir, # not in the buildroot. @@ -499,6 +707,15 @@ done # Some additional tests fail when running the test suite as non-root outside of # the build, due to permissions issues. + echo FINISHED: CHECKING OF PYTHON FOR CONFIGURATION: $ConfDir + +} + +# Check each of the configurations: +CheckPython debug +CheckPython optimized + + %clean rm -fr %{buildroot} @@ -631,9 +848,9 @@ rm -fr %{buildroot} %files libs %defattr(-,root,root,-) -%{_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 @@ -647,7 +864,8 @@ rm -fr %{buildroot} %{_bindir}/python3-config %{_bindir}/python%{pybasever}-config %{_libdir}/libpython%{pybasever}.so -%{_libdir}/pkgconfig/python*.pc +%{_libdir}/pkgconfig/python-%{pybasever}.pc +%{_libdir}/pkgconfig/python3.pc %config(noreplace) %{_sysconfdir}/rpm/macros.python3 %config(noreplace) %{_sysconfdir}/rpm/macros.pybytecompile @@ -683,6 +901,112 @@ rm -fr %{buildroot} %doc %{pylibdir}/Demo/md5test %{pylibdir}/tkinter/test + +# 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}/python3-debug +%{_bindir}/python%{pybasever}-debug + +# ...with debug builds of the built-in "extension" modules: +%{dynload_dir}/_bisectmodule_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}/_dbm_d.so +%{dynload_dir}/_elementtree_d.so +%{dynload_dir}/_gdbmmodule_d.so +%{dynload_dir}/_hashlib_d.so +%{dynload_dir}/_heapqmodule_d.so +%{dynload_dir}/_json_d.so +%{dynload_dir}/_lsprof_d.so +%{dynload_dir}/_multibytecodecmodule_d.so +%{dynload_dir}/_multiprocessing_d.so +%{dynload_dir}/_pickle_d.so +%{dynload_dir}/_randommodule_d.so +%{dynload_dir}/_sha1module_d.so +%{dynload_dir}/_sha256module_d.so +%{dynload_dir}/_sha512module_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}/atexitmodule_d.so +%{dynload_dir}/audioop_d.so +%{dynload_dir}/binascii_d.so +%{dynload_dir}/bz2_d.so +%{dynload_dir}/cmathmodule_d.so +%{dynload_dir}/cryptmodule_d.so +%{dynload_dir}/datetime_d.so +%{dynload_dir}/fcntlmodule_d.so +%{dynload_dir}/grpmodule_d.so +%{dynload_dir}/itertoolsmodule_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}/syslogmodule_d.so +%{dynload_dir}/termios_d.so +%{dynload_dir}/timemodule_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 +%{_bindir}/python3-debug-config +%{_bindir}/python%{pybasever}-debug-config +%{_libdir}/libpython%{pybasever}_d.so +%{_libdir}/pkgconfig/python-%{pybasever}-debug.pc +%{_libdir}/pkgconfig/python3-debug.pc + +# 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). # @@ -698,6 +1022,11 @@ rm -fr %{buildroot} %changelog +* Mon May 24 2010 David Malcolm - 3.1.2-6 +- build and install two different configurations of Python 3: debug and +standard, packaging the debug build in a new "python3-debug" subpackage +(patch 103) + * Tue Apr 13 2010 David Malcolm - 3.1.2-5 - exclude test_http_cookies when running selftests, due to hang seen on http://koji.fedoraproject.org/koji/taskinfo?taskID=2088463 (cancelled after From 021b2bcd4a257d2624d282d00ed246242678337b Mon Sep 17 00:00:00 2001 From: dmalcolm Date: Tue, 25 May 2010 17:16:11 +0000 Subject: [PATCH 024/416] - add configure-time support for COUNT_ALLOCS and CALL_PROFILE debug options (patch 104); enable them and the WITH_TSC option within the debug build --- python-3.1.2-more-configuration-flags.patch | 50 +++++++++++++++++++++ python3.spec | 16 ++++++- 2 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 python-3.1.2-more-configuration-flags.patch diff --git a/python-3.1.2-more-configuration-flags.patch b/python-3.1.2-more-configuration-flags.patch new file mode 100644 index 0000000..24df543 --- /dev/null +++ b/python-3.1.2-more-configuration-flags.patch @@ -0,0 +1,50 @@ +diff -up Python-3.1.2/configure.in.more-configuration-flags Python-3.1.2/configure.in +--- Python-3.1.2/configure.in.more-configuration-flags 2010-05-25 12:16:48.602875960 -0400 ++++ Python-3.1.2/configure.in 2010-05-25 12:16:48.609879553 -0400 +@@ -2443,6 +2443,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-3.1.2/pyconfig.h.in.more-configuration-flags Python-3.1.2/pyconfig.h.in +--- Python-3.1.2/pyconfig.h.in.more-configuration-flags 2010-05-25 12:16:48.000000000 -0400 ++++ Python-3.1.2/pyconfig.h.in 2010-05-25 12:17:54.428126399 -0400 +@@ -18,6 +18,12 @@ + /* Define if you have the Mach cthreads package */ + #undef C_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 C doubles are 64-bit IEEE 754 binary format, stored in ARM + mixed-endian order (byte order 45670123) */ + #undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 diff --git a/python3.spec b/python3.spec index f5592ae..ed8b39c 100644 --- a/python3.spec +++ b/python3.spec @@ -40,7 +40,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 6%{?dist} +Release: 7%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 @@ -194,6 +194,13 @@ Patch102: python-3.1.1-lib64.patch Patch103: python-3.1.2-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 +Patch104: python-3.1.2-more-configuration-flags.patch + + BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRequires: readline-devel, openssl-devel, gmp-devel BuildRequires: ncurses-devel, gdbm-devel, zlib-devel, expat-devel @@ -343,6 +350,7 @@ rm -r Modules/zlib || exit 1 %endif %patch103 -p1 -b .debug-build +%patch104 -p1 -b .more-configuration-flags @@ -415,7 +423,7 @@ make OPT="$CFLAGS" %{?_smp_mflags} BuildPython debug \ python-debug \ python%{pybasever}-debug \ - "--with-pydebug" \ + "--with-pydebug --with-tsc --with-count-allocs --with-call-profile" \ false BuildPython optimized \ @@ -1022,6 +1030,10 @@ rm -fr %{buildroot} %changelog +* Tue May 25 2010 David Malcolm - 3.1.2-7 +- add configure-time support for COUNT_ALLOCS and CALL_PROFILE debug options +(patch 104); enable them and the WITH_TSC option within the debug build + * Mon May 24 2010 David Malcolm - 3.1.2-6 - build and install two different configurations of Python 3: debug and standard, packaging the debug build in a new "python3-debug" subpackage From d73e38d70d3bd7c82d4a9f3dbf62053fbb407653 Mon Sep 17 00:00:00 2001 From: dmalcolm Date: Wed, 26 May 2010 10:34:27 +0000 Subject: [PATCH 025/416] - add flags for statvfs.f_flag to the constant list in posixmodule (i.e. "os") (patch 105) --- python-2.6.5-statvfs-f_flag-constants.patch | 62 +++++++++++++++++++++ python3.spec | 10 +++- 2 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 python-2.6.5-statvfs-f_flag-constants.patch 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 +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/python3.spec b/python3.spec index ed8b39c..c2595dc 100644 --- a/python3.spec +++ b/python3.spec @@ -40,7 +40,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 7%{?dist} +Release: 8%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 @@ -200,6 +200,9 @@ Patch103: python-3.1.2-debug-build.patch # extension modules will reliably use them Patch104: python-3.1.2-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 +Patch105: python-2.6.5-statvfs-f_flag-constants.patch BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRequires: readline-devel, openssl-devel, gmp-devel @@ -352,6 +355,7 @@ rm -r Modules/zlib || exit 1 %patch103 -p1 -b .debug-build %patch104 -p1 -b .more-configuration-flags +%patch105 -p1 -b .statvfs-f-flag-constants # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there @@ -1030,6 +1034,10 @@ rm -fr %{buildroot} %changelog +* Wed May 26 2010 David Malcolm - 3.1.2-8 +- add flags for statvfs.f_flag to the constant list in posixmodule (i.e. "os") +(patch 105) + * Tue May 25 2010 David Malcolm - 3.1.2-7 - add configure-time support for COUNT_ALLOCS and CALL_PROFILE debug options (patch 104); enable them and the WITH_TSC option within the debug build From 66cf571b6197859a0a2a8717426fa46a2a85becd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Thu, 27 May 2010 10:59:22 +0000 Subject: [PATCH 026/416] - reading the timestamp counter is available only on some arches (see Python/ceval.c) --- python3.spec | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index c2595dc..c3aaed8 100644 --- a/python3.spec +++ b/python3.spec @@ -40,7 +40,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 8%{?dist} +Release: 9%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 @@ -427,7 +427,11 @@ make OPT="$CFLAGS" %{?_smp_mflags} 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 \ @@ -1034,6 +1038,9 @@ rm -fr %{buildroot} %changelog +* Thu May 27 2010 Dan Horák - 3.1.2-9 +- reading the timestamp counter is available only on some arches (see Python/ceval.c) + * Wed May 26 2010 David Malcolm - 3.1.2-8 - add flags for statvfs.f_flag to the constant list in posixmodule (i.e. "os") (patch 105) From 5c9590b543d16549bdd0564c0fa282a7108428a8 Mon Sep 17 00:00:00 2001 From: dmalcolm Date: Fri, 4 Jun 2010 19:56:30 +0000 Subject: [PATCH 027/416] - ensure that the compiler is invoked with "-fwrapv" (rhbz#594819) - reformat whitespace in audioop.c (patch 106) - CVE-2010-1634: fix various integer overflow checks in the audioop module (patch 107) - CVE-2010-2089: further checks within the audioop module (patch 108) - CVE-2008-5983: the new PySys_SetArgvEx entry point from r81399 (patch 109) --- python-3.1.2-CVE-2008-5983.patch | 120 ++ python-3.1.2-CVE-2010-1634.patch | 209 ++ python-3.1.2-CVE-2010-2089.patch | 313 +++ python-3.1.2-reformat-audioop.c.patch | 2727 +++++++++++++++++++++++++ python3.spec | 35 +- 5 files changed, 3400 insertions(+), 4 deletions(-) create mode 100644 python-3.1.2-CVE-2008-5983.patch create mode 100644 python-3.1.2-CVE-2010-1634.patch create mode 100644 python-3.1.2-CVE-2010-2089.patch create mode 100644 python-3.1.2-reformat-audioop.c.patch diff --git a/python-3.1.2-CVE-2008-5983.patch b/python-3.1.2-CVE-2008-5983.patch new file mode 100644 index 0000000..f33cebb --- /dev/null +++ b/python-3.1.2-CVE-2008-5983.patch @@ -0,0 +1,120 @@ +diff -up Python-3.1.2/Doc/c-api/init.rst.CVE-2008-5983 Python-3.1.2/Doc/c-api/init.rst +--- Python-3.1.2/Doc/c-api/init.rst.CVE-2008-5983 2010-01-09 13:48:46.000000000 -0500 ++++ Python-3.1.2/Doc/c-api/init.rst 2010-06-04 15:19:26.724089244 -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:`builtins`, :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. + +@@ -344,7 +345,7 @@ Initialization, Finalization, and Thread + ``sys.version``. + + +-.. cfunction:: void PySys_SetArgv(int argc, wchar_t **argv) ++.. cfunction:: void PySys_SetArgvEx(int argc, wchar_t **argv, int updatepath) + + .. index:: + single: main() +@@ -359,14 +360,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 `_. ++ ++ On versions before 3.1.3, 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:: 3.1.3 + + .. XXX impl. doesn't seem consistent in allowing 0/NULL for the params; + check w/ Guido. + + ++.. cfunction:: void PySys_SetArgv(int argc, wchar_t **argv) ++ ++ This function works like :cfunc:`PySys_SetArgv` with *updatepath* set to 1. ++ ++ + .. cfunction:: void Py_SetPythonHome(wchar_t *home) + + Set the default "home" directory, that is, the location of the standard +diff -up Python-3.1.2/Include/sysmodule.h.CVE-2008-5983 Python-3.1.2/Include/sysmodule.h +--- Python-3.1.2/Include/sysmodule.h.CVE-2008-5983 2008-04-13 09:53:33.000000000 -0400 ++++ Python-3.1.2/Include/sysmodule.h 2010-06-04 15:19:26.721088968 -0400 +@@ -10,6 +10,7 @@ extern "C" { + PyAPI_FUNC(PyObject *) PySys_GetObject(const char *); + PyAPI_FUNC(int) PySys_SetObject(const char *, PyObject *); + PyAPI_FUNC(void) PySys_SetArgv(int, wchar_t **); ++PyAPI_FUNC(void) PySys_SetArgvEx(int, wchar_t **, int); + PyAPI_FUNC(void) PySys_SetPath(const wchar_t *); + + PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...) +diff -up Python-3.1.2/Misc/NEWS.CVE-2008-5983 Python-3.1.2/Misc/NEWS +diff -up Python-3.1.2/Python/sysmodule.c.CVE-2008-5983 Python-3.1.2/Python/sysmodule.c +--- Python-3.1.2/Python/sysmodule.c.CVE-2008-5983 2010-06-04 15:19:26.000000000 -0400 ++++ Python-3.1.2/Python/sysmodule.c 2010-06-04 15:20:59.932964188 -0400 +@@ -1561,7 +1561,7 @@ _wrealpath(const wchar_t *path, wchar_t + #endif + + void +-PySys_SetArgv(int argc, wchar_t **argv) ++PySys_SetArgvEx(int argc, wchar_t **argv, int updatepath) + { + #if defined(HAVE_REALPATH) + wchar_t fullpath[MAXPATHLEN]; +@@ -1574,7 +1574,7 @@ PySys_SetArgv(int argc, wchar_t **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) { + wchar_t *argv0 = argv[0]; + wchar_t *p = NULL; + Py_ssize_t n = 0; +@@ -1661,6 +1661,12 @@ PySys_SetArgv(int argc, wchar_t **argv) + Py_DECREF(av); + } + ++void ++PySys_SetArgv(int argc, wchar_t **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-3.1.2-CVE-2010-1634.patch b/python-3.1.2-CVE-2010-1634.patch new file mode 100644 index 0000000..f3de6ea --- /dev/null +++ b/python-3.1.2-CVE-2010-1634.patch @@ -0,0 +1,209 @@ +--- python/branches/py3k/Modules/audioop.c 2010/05/09 15:52:27 81032 ++++ python/branches/py3k/Modules/audioop.c 2010/05/11 13:09:58 81081 +@@ -834,7 +834,7 @@ + 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; +@@ -851,14 +851,13 @@ + 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 = PyBytes_FromStringAndSize(NULL, new_len); ++ rv = PyBytes_FromStringAndSize(NULL, len*2); + if ( rv == 0 ) + return 0; + ncp = (signed char *)PyBytes_AsString(rv); +@@ -1021,7 +1020,7 @@ + { + 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; + +@@ -1035,13 +1034,12 @@ + 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 = PyBytes_FromStringAndSize(NULL, new_len); ++ rv = PyBytes_FromStringAndSize(NULL, (len/size)*size2); + if ( rv == 0 ) + return 0; + ncp = (unsigned char *)PyBytes_AsString(rv); +@@ -1077,7 +1075,6 @@ + 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; +@@ -1120,14 +1117,13 @@ + inrate /= d; + outrate /= d; + +- alloc_size = sizeof(int) * (unsigned)nchannels; +- if (alloc_size < (unsigned)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; +@@ -1164,25 +1160,16 @@ + 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 = PyBytes_FromStringAndSize(NULL, nbytes); ++ str = PyBytes_FromStringAndSize(NULL, ++ q * outrate * bytes_per_frame); + + if (str == NULL) { + PyErr_SetString(PyExc_MemoryError, +@@ -1300,7 +1287,7 @@ + unsigned char *cp; + unsigned char cval; + signed char *ncp; +- int len, new_len, size, val; ++ int len, size, val; + PyObject *rv; + int i; + +@@ -1313,18 +1300,17 @@ + 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 = PyBytes_FromStringAndSize(NULL, new_len); ++ rv = PyBytes_FromStringAndSize(NULL, len*size); + if ( rv == 0 ) + return 0; + ncp = (signed char *)PyBytes_AsString(rv); + +- for ( i=0; i < new_len; i += size ) { ++ for ( i=0; i < len*size; i += size ) { + cval = *cp++; + val = st_ulaw2linear16(cval); + +@@ -1374,7 +1360,7 @@ + unsigned char *cp; + unsigned char cval; + signed char *ncp; +- int len, new_len, size, val; ++ int len, size, val; + PyObject *rv; + int i; + +@@ -1387,18 +1373,17 @@ + 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 = PyBytes_FromStringAndSize(NULL, new_len); ++ rv = PyBytes_FromStringAndSize(NULL, len*size); + if ( rv == 0 ) + return 0; + ncp = (signed char *)PyBytes_AsString(rv); + +- for ( i=0; i < new_len; i += size ) { ++ for ( i=0; i < len*size; i += size ) { + cval = *cp++; + val = st_alaw2linear16(cval); + +@@ -1523,7 +1508,7 @@ + { + 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; + +@@ -1545,13 +1530,12 @@ + } 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 = PyBytes_FromStringAndSize(NULL, new_len); ++ str = PyBytes_FromStringAndSize(NULL, len*size*2); + if ( str == 0 ) + return 0; + ncp = (signed char *)PyBytes_AsString(str); +@@ -1559,7 +1543,7 @@ + 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-3.1.2-CVE-2010-2089.patch b/python-3.1.2-CVE-2010-2089.patch new file mode 100644 index 0000000..f0098c4 --- /dev/null +++ b/python-3.1.2-CVE-2010-2089.patch @@ -0,0 +1,313 @@ +diff -up Python-3.1.2/Modules/audioop.c.CVE-2010-2089 Python-3.1.2/Modules/audioop.c +--- Python-3.1.2/Modules/audioop.c.CVE-2010-2089 2010-06-04 14:55:04.281964205 -0400 ++++ Python-3.1.2/Modules/audioop.c 2010-06-04 15:04:32.896088959 -0400 +@@ -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, PyObje + + 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 *ar + + 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 0,1 */ + for ( i=0; i INT_MAX/size2) { + PyErr_SetString(PyExc_MemoryError, +@@ -1082,10 +1101,8 @@ audioop_ratecv(PyObject *self, PyObject + &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; +@@ -1261,10 +1278,8 @@ audioop_lin2ulaw(PyObject *self, PyObjec + &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 = PyBytes_FromStringAndSize(NULL, len/size); + if ( rv == 0 ) +@@ -1295,10 +1310,8 @@ audioop_ulaw2lin(PyObject *self, PyObjec + &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; + + if (len > INT_MAX/size) { + PyErr_SetString(PyExc_MemoryError, +@@ -1334,10 +1347,8 @@ audioop_lin2alaw(PyObject *self, PyObjec + &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 = PyBytes_FromStringAndSize(NULL, len/size); + if ( rv == 0 ) +@@ -1368,10 +1379,8 @@ audioop_alaw2lin(PyObject *self, PyObjec + &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; + + if (len > INT_MAX/size) { + PyErr_SetString(PyExc_MemoryError, +@@ -1409,10 +1418,8 @@ audioop_lin2adpcm(PyObject *self, PyObje + 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 = PyBytes_FromStringAndSize(NULL, len/(size*2)); + if ( str == 0 ) +@@ -1516,10 +1523,8 @@ audioop_adpcm2lin(PyObject *self, PyObje + &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 ) { diff --git a/python-3.1.2-reformat-audioop.c.patch b/python-3.1.2-reformat-audioop.c.patch new file mode 100644 index 0000000..8592650 --- /dev/null +++ b/python-3.1.2-reformat-audioop.c.patch @@ -0,0 +1,2727 @@ +--- python/branches/py3k/Modules/audioop.c 2009/05/16 01:46:11 72674 ++++ python/branches/py3k/Modules/audioop.c 2010/05/09 15:52:27 81032 +@@ -53,13 +53,13 @@ + static PyInt16 + search(PyInt16 val, PyInt16 *table, int size) + { +- int i; ++ int i; + +- for (i = 0; i < size; i++) { +- if (val <= *table++) +- return (i); +- } +- return (size); ++ for (i = 0; i < size; i++) { ++ if (val <= *table++) ++ return (i); ++ } ++ return (size); + } + #define st_ulaw2linear16(uc) (_st_ulaw2linear16[uc]) + #define st_alaw2linear16(uc) (_st_alaw2linear16[uc]) +@@ -83,7 +83,7 @@ + -228, -212, -196, -180, -164, -148, -132, + -120, -112, -104, -96, -88, -80, -72, + -64, -56, -48, -40, -32, -24, -16, +- -8, 0, 32124, 31100, 30076, 29052, 28028, ++ -8, 0, 32124, 31100, 30076, 29052, 28028, + 27004, 25980, 24956, 23932, 22908, 21884, 20860, + 19836, 18812, 17788, 16764, 15996, 15484, 14972, + 14460, 13948, 13436, 12924, 12412, 11900, 11388, +@@ -100,8 +100,8 @@ + 372, 356, 340, 324, 308, 292, 276, + 260, 244, 228, 212, 196, 180, 164, + 148, 132, 120, 112, 104, 96, 88, +- 80, 72, 64, 56, 48, 40, 32, +- 24, 16, 8, 0 ++ 80, 72, 64, 56, 48, 40, 32, ++ 24, 16, 8, 0 + }; + + /* +@@ -137,39 +137,39 @@ + * John Wiley & Sons, pps 98-111 and 472-476. + */ + static unsigned char +-st_14linear2ulaw(PyInt16 pcm_val) /* 2's complement (14-bit range) */ ++st_14linear2ulaw(PyInt16 pcm_val) /* 2's complement (14-bit range) */ + { +- PyInt16 mask; +- PyInt16 seg; +- unsigned char uval; +- +- /* The original sox code does this in the calling function, not here */ +- pcm_val = pcm_val >> 2; +- +- /* u-law inverts all bits */ +- /* Get the sign and the magnitude of the value. */ +- if (pcm_val < 0) { +- pcm_val = -pcm_val; +- mask = 0x7F; +- } else { +- mask = 0xFF; +- } +- if ( pcm_val > CLIP ) pcm_val = CLIP; /* clip the magnitude */ +- pcm_val += (BIAS >> 2); +- +- /* Convert the scaled magnitude to segment number. */ +- seg = search(pcm_val, seg_uend, 8); +- +- /* +- * Combine the sign, segment, quantization bits; +- * and complement the code word. +- */ +- if (seg >= 8) /* out of range, return maximum value. */ +- return (unsigned char) (0x7F ^ mask); +- else { +- uval = (unsigned char) (seg << 4) | ((pcm_val >> (seg + 1)) & 0xF); +- return (uval ^ mask); +- } ++ PyInt16 mask; ++ PyInt16 seg; ++ unsigned char uval; ++ ++ /* The original sox code does this in the calling function, not here */ ++ pcm_val = pcm_val >> 2; ++ ++ /* u-law inverts all bits */ ++ /* Get the sign and the magnitude of the value. */ ++ if (pcm_val < 0) { ++ pcm_val = -pcm_val; ++ mask = 0x7F; ++ } else { ++ mask = 0xFF; ++ } ++ if ( pcm_val > CLIP ) pcm_val = CLIP; /* clip the magnitude */ ++ pcm_val += (BIAS >> 2); ++ ++ /* Convert the scaled magnitude to segment number. */ ++ seg = search(pcm_val, seg_uend, 8); ++ ++ /* ++ * Combine the sign, segment, quantization bits; ++ * and complement the code word. ++ */ ++ if (seg >= 8) /* out of range, return maximum value. */ ++ return (unsigned char) (0x7F ^ mask); ++ else { ++ uval = (unsigned char) (seg << 4) | ((pcm_val >> (seg + 1)) & 0xF); ++ return (uval ^ mask); ++ } + + } + +@@ -234,59 +234,59 @@ + * John Wiley & Sons, pps 98-111 and 472-476. + */ + static unsigned char +-st_linear2alaw(PyInt16 pcm_val) /* 2's complement (13-bit range) */ ++st_linear2alaw(PyInt16 pcm_val) /* 2's complement (13-bit range) */ + { +- PyInt16 mask; +- short seg; +- unsigned char aval; +- +- /* The original sox code does this in the calling function, not here */ +- pcm_val = pcm_val >> 3; +- +- /* A-law using even bit inversion */ +- if (pcm_val >= 0) { +- mask = 0xD5; /* sign (7th) bit = 1 */ +- } else { +- mask = 0x55; /* sign bit = 0 */ +- pcm_val = -pcm_val - 1; +- } +- +- /* Convert the scaled magnitude to segment number. */ +- seg = search(pcm_val, seg_aend, 8); +- +- /* Combine the sign, segment, and quantization bits. */ +- +- if (seg >= 8) /* out of range, return maximum value. */ +- return (unsigned char) (0x7F ^ mask); +- else { +- aval = (unsigned char) seg << SEG_SHIFT; +- if (seg < 2) +- aval |= (pcm_val >> 1) & QUANT_MASK; +- else +- aval |= (pcm_val >> seg) & QUANT_MASK; +- return (aval ^ mask); +- } ++ PyInt16 mask; ++ short seg; ++ unsigned char aval; ++ ++ /* The original sox code does this in the calling function, not here */ ++ pcm_val = pcm_val >> 3; ++ ++ /* A-law using even bit inversion */ ++ if (pcm_val >= 0) { ++ mask = 0xD5; /* sign (7th) bit = 1 */ ++ } else { ++ mask = 0x55; /* sign bit = 0 */ ++ pcm_val = -pcm_val - 1; ++ } ++ ++ /* Convert the scaled magnitude to segment number. */ ++ seg = search(pcm_val, seg_aend, 8); ++ ++ /* Combine the sign, segment, and quantization bits. */ ++ ++ if (seg >= 8) /* out of range, return maximum value. */ ++ return (unsigned char) (0x7F ^ mask); ++ else { ++ aval = (unsigned char) seg << SEG_SHIFT; ++ if (seg < 2) ++ aval |= (pcm_val >> 1) & QUANT_MASK; ++ else ++ aval |= (pcm_val >> seg) & QUANT_MASK; ++ return (aval ^ mask); ++ } + } + /* End of code taken from sox */ + + /* Intel ADPCM step variation table */ + static int indexTable[16] = { +- -1, -1, -1, -1, 2, 4, 6, 8, +- -1, -1, -1, -1, 2, 4, 6, 8, ++ -1, -1, -1, -1, 2, 4, 6, 8, ++ -1, -1, -1, -1, 2, 4, 6, 8, + }; + + static int stepsizeTable[89] = { +- 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, +- 19, 21, 23, 25, 28, 31, 34, 37, 41, 45, +- 50, 55, 60, 66, 73, 80, 88, 97, 107, 118, +- 130, 143, 157, 173, 190, 209, 230, 253, 279, 307, +- 337, 371, 408, 449, 494, 544, 598, 658, 724, 796, +- 876, 963, 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066, +- 2272, 2499, 2749, 3024, 3327, 3660, 4026, 4428, 4871, 5358, +- 5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899, +- 15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767 ++ 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, ++ 19, 21, 23, 25, 28, 31, 34, 37, 41, 45, ++ 50, 55, 60, 66, 73, 80, 88, 97, 107, 118, ++ 130, 143, 157, 173, 190, 209, 230, 253, 279, 307, ++ 337, 371, 408, 449, 494, 544, 598, 658, 724, 796, ++ 876, 963, 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066, ++ 2272, 2499, 2749, 3024, 3327, 3660, 4026, 4428, 4871, 5358, ++ 5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899, ++ 15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767 + }; +- ++ + #define CHARP(cp, i) ((signed char *)(cp+i)) + #define SHORTP(cp, i) ((short *)(cp+i)) + #define LONGP(cp, i) ((Py_Int32 *)(cp+i)) +@@ -298,137 +298,137 @@ + static PyObject * + audioop_getsample(PyObject *self, PyObject *args) + { +- signed char *cp; +- int len, size, val = 0; +- int i; +- +- 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 ( i < 0 || i >= len/size ) { +- PyErr_SetString(AudioopError, "Index out of range"); +- return 0; +- } +- if ( size == 1 ) val = (int)*CHARP(cp, i); +- else if ( size == 2 ) val = (int)*SHORTP(cp, i*2); +- else if ( size == 4 ) val = (int)*LONGP(cp, i*4); +- return PyLong_FromLong(val); ++ signed char *cp; ++ int len, size, val = 0; ++ int i; ++ ++ 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 ( i < 0 || i >= len/size ) { ++ PyErr_SetString(AudioopError, "Index out of range"); ++ return 0; ++ } ++ if ( size == 1 ) val = (int)*CHARP(cp, i); ++ else if ( size == 2 ) val = (int)*SHORTP(cp, i*2); ++ else if ( size == 4 ) val = (int)*LONGP(cp, i*4); ++ return PyLong_FromLong(val); + } + + static PyObject * + audioop_max(PyObject *self, PyObject *args) + { +- signed char *cp; +- int len, size, val = 0; +- int i; +- int max = 0; +- +- 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; +- } +- for ( i=0; i max ) max = val; +- } +- return PyLong_FromLong(max); ++ signed char *cp; ++ int len, size, val = 0; ++ int i; ++ int max = 0; ++ ++ 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; ++ } ++ for ( i=0; i max ) max = val; ++ } ++ return PyLong_FromLong(max); + } + + static PyObject * + audioop_minmax(PyObject *self, PyObject *args) + { +- signed char *cp; +- int len, size, val = 0; +- int i; +- int min = 0x7fffffff, max = -0x7fffffff; +- +- 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"); +- 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); +- else if (size == 4) val = (int) *LONGP(cp, i); +- if (val > max) max = val; +- if (val < min) min = val; +- } +- return Py_BuildValue("(ii)", min, max); ++ signed char *cp; ++ int len, size, val = 0; ++ int i; ++ int min = 0x7fffffff, max = -0x7fffffff; ++ ++ 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"); ++ 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); ++ else if (size == 4) val = (int) *LONGP(cp, i); ++ if (val > max) max = val; ++ if (val < min) min = val; ++ } ++ return Py_BuildValue("(ii)", min, max); + } + + static PyObject * + audioop_avg(PyObject *self, PyObject *args) + { +- signed char *cp; +- int len, size, val = 0; +- int i; +- double avg = 0.0; +- +- 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; +- } +- for ( i=0; i>= 1; +- len2 >>= 1; +- +- if ( len1 < len2 ) { +- PyErr_SetString(AudioopError, "First sample should be longer"); +- return 0; +- } +- sum_ri_2 = _sum2(cp2, cp2, len2); +- sum_aij_2 = _sum2(cp1, cp1, len2); +- sum_aij_ri = _sum2(cp1, cp2, len2); +- +- result = (sum_ri_2*sum_aij_2 - sum_aij_ri*sum_aij_ri) / sum_aij_2; +- +- best_result = result; +- best_j = 0; +- j = 0; +- +- for ( j=1; j<=len1-len2; j++) { +- aj_m1 = (double)cp1[j-1]; +- aj_lm1 = (double)cp1[j+len2-1]; +- +- sum_aij_2 = sum_aij_2 + aj_lm1*aj_lm1 - aj_m1*aj_m1; +- sum_aij_ri = _sum2(cp1+j, cp2, len2); +- +- result = (sum_ri_2*sum_aij_2 - sum_aij_ri*sum_aij_ri) +- / sum_aij_2; +- +- if ( result < best_result ) { +- best_result = result; +- best_j = j; +- } +- ++ short *cp1, *cp2; ++ int len1, len2; ++ int j, best_j; ++ double aj_m1, aj_lm1; ++ double sum_ri_2, sum_aij_2, sum_aij_ri, result, best_result, factor; ++ ++ /* Passing a short** for an 's' argument is correct only ++ if the string contents is aligned for interpretation ++ as short[]. Due to the definition of PyBytesObject, ++ this is currently (Python 2.6) the case. */ ++ if ( !PyArg_ParseTuple(args, "s#s#:findfit", ++ (char**)&cp1, &len1, (char**)&cp2, &len2) ) ++ return 0; ++ if ( len1 & 1 || len2 & 1 ) { ++ PyErr_SetString(AudioopError, "Strings should be even-sized"); ++ return 0; ++ } ++ len1 >>= 1; ++ len2 >>= 1; ++ ++ if ( len1 < len2 ) { ++ PyErr_SetString(AudioopError, "First sample should be longer"); ++ return 0; ++ } ++ sum_ri_2 = _sum2(cp2, cp2, len2); ++ sum_aij_2 = _sum2(cp1, cp1, len2); ++ sum_aij_ri = _sum2(cp1, cp2, len2); ++ ++ result = (sum_ri_2*sum_aij_2 - sum_aij_ri*sum_aij_ri) / sum_aij_2; ++ ++ best_result = result; ++ best_j = 0; ++ j = 0; ++ ++ for ( j=1; j<=len1-len2; j++) { ++ aj_m1 = (double)cp1[j-1]; ++ aj_lm1 = (double)cp1[j+len2-1]; ++ ++ sum_aij_2 = sum_aij_2 + aj_lm1*aj_lm1 - aj_m1*aj_m1; ++ sum_aij_ri = _sum2(cp1+j, cp2, len2); ++ ++ result = (sum_ri_2*sum_aij_2 - sum_aij_ri*sum_aij_ri) ++ / sum_aij_2; ++ ++ if ( result < best_result ) { ++ best_result = result; ++ best_j = j; + } + +- factor = _sum2(cp1+best_j, cp2, len2) / sum_ri_2; +- +- return Py_BuildValue("(if)", best_j, factor); ++ } ++ ++ factor = _sum2(cp1+best_j, cp2, len2) / sum_ri_2; ++ ++ return Py_BuildValue("(if)", best_j, factor); + } + + /* +@@ -529,28 +529,28 @@ + static PyObject * + audioop_findfactor(PyObject *self, PyObject *args) + { +- short *cp1, *cp2; +- int len1, len2; +- double sum_ri_2, sum_aij_ri, result; +- +- if ( !PyArg_ParseTuple(args, "s#s#:findfactor", +- (char**)&cp1, &len1, (char**)&cp2, &len2) ) +- return 0; +- if ( len1 & 1 || len2 & 1 ) { +- PyErr_SetString(AudioopError, "Strings should be even-sized"); +- return 0; +- } +- if ( len1 != len2 ) { +- PyErr_SetString(AudioopError, "Samples should be same size"); +- return 0; +- } +- len2 >>= 1; +- sum_ri_2 = _sum2(cp2, cp2, len2); +- sum_aij_ri = _sum2(cp1, cp2, len2); ++ short *cp1, *cp2; ++ int len1, len2; ++ double sum_ri_2, sum_aij_ri, result; ++ ++ if ( !PyArg_ParseTuple(args, "s#s#:findfactor", ++ (char**)&cp1, &len1, (char**)&cp2, &len2) ) ++ return 0; ++ if ( len1 & 1 || len2 & 1 ) { ++ PyErr_SetString(AudioopError, "Strings should be even-sized"); ++ return 0; ++ } ++ if ( len1 != len2 ) { ++ PyErr_SetString(AudioopError, "Samples should be same size"); ++ return 0; ++ } ++ len2 >>= 1; ++ sum_ri_2 = _sum2(cp2, cp2, len2); ++ sum_aij_ri = _sum2(cp1, cp2, len2); + +- result = sum_aij_ri / sum_ri_2; ++ result = sum_aij_ri / sum_ri_2; + +- return PyFloat_FromDouble(result); ++ return PyFloat_FromDouble(result); + } + + /* +@@ -560,1114 +560,1114 @@ + static PyObject * + audioop_findmax(PyObject *self, PyObject *args) + { +- short *cp1; +- int len1, len2; +- int j, best_j; +- double aj_m1, aj_lm1; +- double result, best_result; +- +- if ( !PyArg_ParseTuple(args, "s#i:findmax", +- (char**)&cp1, &len1, &len2) ) +- return 0; +- if ( len1 & 1 ) { +- PyErr_SetString(AudioopError, "Strings should be even-sized"); +- return 0; ++ short *cp1; ++ int len1, len2; ++ int j, best_j; ++ double aj_m1, aj_lm1; ++ double result, best_result; ++ ++ if ( !PyArg_ParseTuple(args, "s#i:findmax", ++ (char**)&cp1, &len1, &len2) ) ++ return 0; ++ if ( len1 & 1 ) { ++ PyErr_SetString(AudioopError, "Strings should be even-sized"); ++ return 0; ++ } ++ len1 >>= 1; ++ ++ if ( len2 < 0 || len1 < len2 ) { ++ PyErr_SetString(AudioopError, "Input sample should be longer"); ++ return 0; ++ } ++ ++ result = _sum2(cp1, cp1, len2); ++ ++ best_result = result; ++ best_j = 0; ++ j = 0; ++ ++ for ( j=1; j<=len1-len2; j++) { ++ aj_m1 = (double)cp1[j-1]; ++ aj_lm1 = (double)cp1[j+len2-1]; ++ ++ result = result + aj_lm1*aj_lm1 - aj_m1*aj_m1; ++ ++ if ( result > best_result ) { ++ best_result = result; ++ best_j = j; + } +- len1 >>= 1; +- +- if ( len2 < 0 || len1 < len2 ) { +- PyErr_SetString(AudioopError, "Input sample should be longer"); +- return 0; +- } +- +- result = _sum2(cp1, cp1, len2); + +- best_result = result; +- best_j = 0; +- j = 0; +- +- for ( j=1; j<=len1-len2; j++) { +- aj_m1 = (double)cp1[j-1]; +- aj_lm1 = (double)cp1[j+len2-1]; +- +- result = result + aj_lm1*aj_lm1 - aj_m1*aj_m1; +- +- if ( result > best_result ) { +- best_result = result; +- best_j = j; +- } +- +- } ++ } + +- return PyLong_FromLong(best_j); ++ return PyLong_FromLong(best_j); + } + + static PyObject * + audioop_avgpp(PyObject *self, PyObject *args) + { +- signed char *cp; +- int len, size, val = 0, prevval = 0, prevextremevalid = 0, +- prevextreme = 0; +- int i; +- double avg = 0.0; +- int diff, prevdiff, extremediff, nextreme = 0; +- +- 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; +- } +- /* Compute first delta value ahead. Also automatically makes us +- ** skip the first extreme value +- */ +- if ( size == 1 ) prevval = (int)*CHARP(cp, 0); +- else if ( size == 2 ) prevval = (int)*SHORTP(cp, 0); +- else if ( size == 4 ) prevval = (int)*LONGP(cp, 0); +- if ( size == 1 ) val = (int)*CHARP(cp, size); +- else if ( size == 2 ) val = (int)*SHORTP(cp, size); +- else if ( size == 4 ) val = (int)*LONGP(cp, size); +- prevdiff = val - prevval; +- +- for ( i=size; i max ) +- max = extremediff; +- } +- prevextremevalid = 1; +- prevextreme = prevval; +- } +- prevval = val; +- if ( diff != 0 ) +- prevdiff = diff; +- } +- return PyLong_FromLong(max); ++ signed char *cp; ++ int len, size, val = 0, prevval = 0, prevextremevalid = 0, ++ prevextreme = 0; ++ int i; ++ int max = 0; ++ int diff, prevdiff, extremediff; ++ ++ 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; ++ } ++ /* Compute first delta value ahead. Also automatically makes us ++ ** skip the first extreme value ++ */ ++ if ( size == 1 ) prevval = (int)*CHARP(cp, 0); ++ else if ( size == 2 ) prevval = (int)*SHORTP(cp, 0); ++ else if ( size == 4 ) prevval = (int)*LONGP(cp, 0); ++ if ( size == 1 ) val = (int)*CHARP(cp, size); ++ else if ( size == 2 ) val = (int)*SHORTP(cp, size); ++ else if ( size == 4 ) val = (int)*LONGP(cp, size); ++ prevdiff = val - prevval; ++ ++ for ( i=size; i max ) ++ max = extremediff; ++ } ++ prevextremevalid = 1; ++ prevextreme = prevval; ++ } ++ prevval = val; ++ if ( diff != 0 ) ++ prevdiff = diff; ++ } ++ return PyLong_FromLong(max); + } + + static PyObject * + audioop_cross(PyObject *self, PyObject *args) + { +- signed char *cp; +- int len, size, val = 0; +- int i; +- int prevval, ncross; +- +- 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; +- } +- ncross = -1; +- prevval = 17; /* Anything <> 0,1 */ +- for ( i=0; i> 7; +- else if ( size == 2 ) val = ((int)*SHORTP(cp, i)) >> 15; +- else if ( size == 4 ) val = ((int)*LONGP(cp, i)) >> 31; +- val = val & 1; +- if ( val != prevval ) ncross++; +- prevval = val; +- } +- return PyLong_FromLong(ncross); ++ signed char *cp; ++ int len, size, val = 0; ++ int i; ++ int prevval, ncross; ++ ++ 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; ++ } ++ ncross = -1; ++ prevval = 17; /* Anything <> 0,1 */ ++ for ( i=0; i> 7; ++ else if ( size == 2 ) val = ((int)*SHORTP(cp, i)) >> 15; ++ else if ( size == 4 ) val = ((int)*LONGP(cp, i)) >> 31; ++ val = val & 1; ++ if ( val != prevval ) ncross++; ++ prevval = val; ++ } ++ return PyLong_FromLong(ncross); + } + + static PyObject * + audioop_mul(PyObject *self, PyObject *args) + { +- signed char *cp, *ncp; +- int len, size, val = 0; +- double factor, fval, maxval; +- PyObject *rv; +- int i; +- +- if ( !PyArg_ParseTuple(args, "s#id:mul", &cp, &len, &size, &factor ) ) +- return 0; +- +- if ( size == 1 ) maxval = (double) 0x7f; +- else if ( size == 2 ) maxval = (double) 0x7fff; +- else if ( size == 4 ) maxval = (double) 0x7fffffff; +- else { +- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4"); +- return 0; +- } +- +- rv = PyBytes_FromStringAndSize(NULL, len); +- if ( rv == 0 ) +- return 0; +- ncp = (signed char *)PyBytes_AsString(rv); +- +- +- for ( i=0; i < len; i += size ) { +- if ( size == 1 ) val = (int)*CHARP(cp, i); +- else if ( size == 2 ) val = (int)*SHORTP(cp, i); +- else if ( size == 4 ) val = (int)*LONGP(cp, i); +- fval = (double)val*factor; +- if ( fval > maxval ) fval = maxval; +- else if ( fval < -maxval ) fval = -maxval; +- val = (int)fval; +- if ( size == 1 ) *CHARP(ncp, i) = (signed char)val; +- else if ( size == 2 ) *SHORTP(ncp, i) = (short)val; +- else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)val; +- } +- return rv; ++ signed char *cp, *ncp; ++ int len, size, val = 0; ++ double factor, fval, maxval; ++ PyObject *rv; ++ int i; ++ ++ if ( !PyArg_ParseTuple(args, "s#id:mul", &cp, &len, &size, &factor ) ) ++ return 0; ++ ++ if ( size == 1 ) maxval = (double) 0x7f; ++ else if ( size == 2 ) maxval = (double) 0x7fff; ++ else if ( size == 4 ) maxval = (double) 0x7fffffff; ++ else { ++ PyErr_SetString(AudioopError, "Size should be 1, 2 or 4"); ++ return 0; ++ } ++ ++ rv = PyBytes_FromStringAndSize(NULL, len); ++ if ( rv == 0 ) ++ return 0; ++ ncp = (signed char *)PyBytes_AsString(rv); ++ ++ ++ for ( i=0; i < len; i += size ) { ++ if ( size == 1 ) val = (int)*CHARP(cp, i); ++ else if ( size == 2 ) val = (int)*SHORTP(cp, i); ++ else if ( size == 4 ) val = (int)*LONGP(cp, i); ++ fval = (double)val*factor; ++ if ( fval > maxval ) fval = maxval; ++ else if ( fval < -maxval ) fval = -maxval; ++ val = (int)fval; ++ if ( size == 1 ) *CHARP(ncp, i) = (signed char)val; ++ else if ( size == 2 ) *SHORTP(ncp, i) = (short)val; ++ else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)val; ++ } ++ return rv; + } + + static PyObject * + audioop_tomono(PyObject *self, PyObject *args) + { +- Py_buffer pcp; +- signed char *cp, *ncp; +- int len, size, val1 = 0, val2 = 0; +- double fac1, fac2, fval, maxval; +- PyObject *rv; +- int i; +- +- if ( !PyArg_ParseTuple(args, "s*idd:tomono", +- &pcp, &size, &fac1, &fac2 ) ) +- return 0; +- cp = pcp.buf; +- len = pcp.len; +- +- if ( size == 1 ) maxval = (double) 0x7f; +- else if ( size == 2 ) maxval = (double) 0x7fff; +- else if ( size == 4 ) maxval = (double) 0x7fffffff; +- else { +- PyBuffer_Release(&pcp); +- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4"); +- return 0; +- } +- +- rv = PyBytes_FromStringAndSize(NULL, len/2); +- if ( rv == 0 ) +- return 0; +- ncp = (signed char *)PyBytes_AsString(rv); +- +- +- for ( i=0; i < len; i += size*2 ) { +- if ( size == 1 ) val1 = (int)*CHARP(cp, i); +- else if ( size == 2 ) val1 = (int)*SHORTP(cp, i); +- else if ( size == 4 ) val1 = (int)*LONGP(cp, i); +- if ( size == 1 ) val2 = (int)*CHARP(cp, i+1); +- else if ( size == 2 ) val2 = (int)*SHORTP(cp, i+2); +- else if ( size == 4 ) val2 = (int)*LONGP(cp, i+4); +- fval = (double)val1*fac1 + (double)val2*fac2; +- if ( fval > maxval ) fval = maxval; +- else if ( fval < -maxval ) fval = -maxval; +- val1 = (int)fval; +- if ( size == 1 ) *CHARP(ncp, i/2) = (signed char)val1; +- else if ( size == 2 ) *SHORTP(ncp, i/2) = (short)val1; +- else if ( size == 4 ) *LONGP(ncp, i/2)= (Py_Int32)val1; +- } +- PyBuffer_Release(&pcp); +- return rv; ++ Py_buffer pcp; ++ signed char *cp, *ncp; ++ int len, size, val1 = 0, val2 = 0; ++ double fac1, fac2, fval, maxval; ++ PyObject *rv; ++ int i; ++ ++ if ( !PyArg_ParseTuple(args, "s*idd:tomono", ++ &pcp, &size, &fac1, &fac2 ) ) ++ return 0; ++ cp = pcp.buf; ++ len = pcp.len; ++ ++ if ( size == 1 ) maxval = (double) 0x7f; ++ else if ( size == 2 ) maxval = (double) 0x7fff; ++ else if ( size == 4 ) maxval = (double) 0x7fffffff; ++ else { ++ PyBuffer_Release(&pcp); ++ PyErr_SetString(AudioopError, "Size should be 1, 2 or 4"); ++ return 0; ++ } ++ ++ rv = PyBytes_FromStringAndSize(NULL, len/2); ++ if ( rv == 0 ) ++ return 0; ++ ncp = (signed char *)PyBytes_AsString(rv); ++ ++ ++ for ( i=0; i < len; i += size*2 ) { ++ if ( size == 1 ) val1 = (int)*CHARP(cp, i); ++ else if ( size == 2 ) val1 = (int)*SHORTP(cp, i); ++ else if ( size == 4 ) val1 = (int)*LONGP(cp, i); ++ if ( size == 1 ) val2 = (int)*CHARP(cp, i+1); ++ else if ( size == 2 ) val2 = (int)*SHORTP(cp, i+2); ++ else if ( size == 4 ) val2 = (int)*LONGP(cp, i+4); ++ fval = (double)val1*fac1 + (double)val2*fac2; ++ if ( fval > maxval ) fval = maxval; ++ else if ( fval < -maxval ) fval = -maxval; ++ val1 = (int)fval; ++ if ( size == 1 ) *CHARP(ncp, i/2) = (signed char)val1; ++ else if ( size == 2 ) *SHORTP(ncp, i/2) = (short)val1; ++ else if ( size == 4 ) *LONGP(ncp, i/2)= (Py_Int32)val1; ++ } ++ PyBuffer_Release(&pcp); ++ return rv; + } + + static PyObject * + audioop_tostereo(PyObject *self, PyObject *args) + { +- signed char *cp, *ncp; +- int len, new_len, size, val1, val2, val = 0; +- double fac1, fac2, fval, maxval; +- PyObject *rv; +- int i; +- +- if ( !PyArg_ParseTuple(args, "s#idd:tostereo", +- &cp, &len, &size, &fac1, &fac2 ) ) +- return 0; +- +- if ( size == 1 ) maxval = (double) 0x7f; +- else if ( size == 2 ) maxval = (double) 0x7fff; +- else if ( size == 4 ) maxval = (double) 0x7fffffff; +- else { +- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4"); +- return 0; +- } +- +- new_len = len*2; +- if (new_len < 0) { +- PyErr_SetString(PyExc_MemoryError, +- "not enough memory for output buffer"); +- return 0; +- } ++ signed char *cp, *ncp; ++ int len, new_len, size, val1, val2, val = 0; ++ double fac1, fac2, fval, maxval; ++ PyObject *rv; ++ int i; ++ ++ if ( !PyArg_ParseTuple(args, "s#idd:tostereo", ++ &cp, &len, &size, &fac1, &fac2 ) ) ++ return 0; ++ ++ if ( size == 1 ) maxval = (double) 0x7f; ++ else if ( size == 2 ) maxval = (double) 0x7fff; ++ else if ( size == 4 ) maxval = (double) 0x7fffffff; ++ else { ++ PyErr_SetString(AudioopError, "Size should be 1, 2 or 4"); ++ return 0; ++ } ++ ++ new_len = len*2; ++ if (new_len < 0) { ++ PyErr_SetString(PyExc_MemoryError, ++ "not enough memory for output buffer"); ++ return 0; ++ } ++ ++ rv = PyBytes_FromStringAndSize(NULL, new_len); ++ if ( rv == 0 ) ++ return 0; ++ ncp = (signed char *)PyBytes_AsString(rv); + +- rv = PyBytes_FromStringAndSize(NULL, new_len); +- if ( rv == 0 ) +- return 0; +- ncp = (signed char *)PyBytes_AsString(rv); +- +- +- for ( i=0; i < len; i += size ) { +- if ( size == 1 ) val = (int)*CHARP(cp, i); +- else if ( size == 2 ) val = (int)*SHORTP(cp, i); +- else if ( size == 4 ) val = (int)*LONGP(cp, i); +- +- fval = (double)val*fac1; +- if ( fval > maxval ) fval = maxval; +- else if ( fval < -maxval ) fval = -maxval; +- val1 = (int)fval; +- +- fval = (double)val*fac2; +- if ( fval > maxval ) fval = maxval; +- else if ( fval < -maxval ) fval = -maxval; +- val2 = (int)fval; +- +- if ( size == 1 ) *CHARP(ncp, i*2) = (signed char)val1; +- else if ( size == 2 ) *SHORTP(ncp, i*2) = (short)val1; +- else if ( size == 4 ) *LONGP(ncp, i*2) = (Py_Int32)val1; +- +- if ( size == 1 ) *CHARP(ncp, i*2+1) = (signed char)val2; +- else if ( size == 2 ) *SHORTP(ncp, i*2+2) = (short)val2; +- else if ( size == 4 ) *LONGP(ncp, i*2+4) = (Py_Int32)val2; +- } +- return rv; ++ ++ for ( i=0; i < len; i += size ) { ++ if ( size == 1 ) val = (int)*CHARP(cp, i); ++ else if ( size == 2 ) val = (int)*SHORTP(cp, i); ++ else if ( size == 4 ) val = (int)*LONGP(cp, i); ++ ++ fval = (double)val*fac1; ++ if ( fval > maxval ) fval = maxval; ++ else if ( fval < -maxval ) fval = -maxval; ++ val1 = (int)fval; ++ ++ fval = (double)val*fac2; ++ if ( fval > maxval ) fval = maxval; ++ else if ( fval < -maxval ) fval = -maxval; ++ val2 = (int)fval; ++ ++ if ( size == 1 ) *CHARP(ncp, i*2) = (signed char)val1; ++ else if ( size == 2 ) *SHORTP(ncp, i*2) = (short)val1; ++ else if ( size == 4 ) *LONGP(ncp, i*2) = (Py_Int32)val1; ++ ++ if ( size == 1 ) *CHARP(ncp, i*2+1) = (signed char)val2; ++ else if ( size == 2 ) *SHORTP(ncp, i*2+2) = (short)val2; ++ else if ( size == 4 ) *LONGP(ncp, i*2+4) = (Py_Int32)val2; ++ } ++ return rv; + } + + static PyObject * + audioop_add(PyObject *self, PyObject *args) + { +- signed char *cp1, *cp2, *ncp; +- int len1, len2, size, val1 = 0, val2 = 0, maxval, newval; +- PyObject *rv; +- int i; +- +- if ( !PyArg_ParseTuple(args, "s#s#i:add", +- &cp1, &len1, &cp2, &len2, &size ) ) +- return 0; +- +- if ( len1 != len2 ) { +- PyErr_SetString(AudioopError, "Lengths should be the same"); +- return 0; +- } +- +- if ( size == 1 ) maxval = 0x7f; +- else if ( size == 2 ) maxval = 0x7fff; +- else if ( size == 4 ) maxval = 0x7fffffff; +- else { +- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4"); +- return 0; +- } +- +- rv = PyBytes_FromStringAndSize(NULL, len1); +- if ( rv == 0 ) +- return 0; +- ncp = (signed char *)PyBytes_AsString(rv); +- +- for ( i=0; i < len1; i += size ) { +- if ( size == 1 ) val1 = (int)*CHARP(cp1, i); +- else if ( size == 2 ) val1 = (int)*SHORTP(cp1, i); +- else if ( size == 4 ) val1 = (int)*LONGP(cp1, i); +- +- if ( size == 1 ) val2 = (int)*CHARP(cp2, i); +- else if ( size == 2 ) val2 = (int)*SHORTP(cp2, i); +- else if ( size == 4 ) val2 = (int)*LONGP(cp2, i); +- +- newval = val1 + val2; +- /* truncate in case of overflow */ +- if (newval > maxval) newval = maxval; +- else if (newval < -maxval) newval = -maxval; +- else if (size == 4 && (newval^val1) < 0 && (newval^val2) < 0) +- newval = val1 > 0 ? maxval : - maxval; +- +- if ( size == 1 ) *CHARP(ncp, i) = (signed char)newval; +- else if ( size == 2 ) *SHORTP(ncp, i) = (short)newval; +- else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)newval; +- } +- return rv; ++ signed char *cp1, *cp2, *ncp; ++ int len1, len2, size, val1 = 0, val2 = 0, maxval, newval; ++ PyObject *rv; ++ int i; ++ ++ if ( !PyArg_ParseTuple(args, "s#s#i:add", ++ &cp1, &len1, &cp2, &len2, &size ) ) ++ return 0; ++ ++ if ( len1 != len2 ) { ++ PyErr_SetString(AudioopError, "Lengths should be the same"); ++ return 0; ++ } ++ ++ if ( size == 1 ) maxval = 0x7f; ++ else if ( size == 2 ) maxval = 0x7fff; ++ else if ( size == 4 ) maxval = 0x7fffffff; ++ else { ++ PyErr_SetString(AudioopError, "Size should be 1, 2 or 4"); ++ return 0; ++ } ++ ++ rv = PyBytes_FromStringAndSize(NULL, len1); ++ if ( rv == 0 ) ++ return 0; ++ ncp = (signed char *)PyBytes_AsString(rv); ++ ++ for ( i=0; i < len1; i += size ) { ++ if ( size == 1 ) val1 = (int)*CHARP(cp1, i); ++ else if ( size == 2 ) val1 = (int)*SHORTP(cp1, i); ++ else if ( size == 4 ) val1 = (int)*LONGP(cp1, i); ++ ++ if ( size == 1 ) val2 = (int)*CHARP(cp2, i); ++ else if ( size == 2 ) val2 = (int)*SHORTP(cp2, i); ++ else if ( size == 4 ) val2 = (int)*LONGP(cp2, i); ++ ++ newval = val1 + val2; ++ /* truncate in case of overflow */ ++ if (newval > maxval) newval = maxval; ++ else if (newval < -maxval) newval = -maxval; ++ else if (size == 4 && (newval^val1) < 0 && (newval^val2) < 0) ++ newval = val1 > 0 ? maxval : - maxval; ++ ++ if ( size == 1 ) *CHARP(ncp, i) = (signed char)newval; ++ else if ( size == 2 ) *SHORTP(ncp, i) = (short)newval; ++ else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)newval; ++ } ++ return rv; + } + + static PyObject * + audioop_bias(PyObject *self, PyObject *args) + { +- signed char *cp, *ncp; +- int len, size, val = 0; +- PyObject *rv; +- int i; +- int bias; +- +- 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; +- } +- +- rv = PyBytes_FromStringAndSize(NULL, len); +- if ( rv == 0 ) +- return 0; +- ncp = (signed char *)PyBytes_AsString(rv); +- +- +- for ( i=0; i < len; i += size ) { +- if ( size == 1 ) val = (int)*CHARP(cp, i); +- else if ( size == 2 ) val = (int)*SHORTP(cp, i); +- else if ( size == 4 ) val = (int)*LONGP(cp, i); +- +- if ( size == 1 ) *CHARP(ncp, i) = (signed char)(val+bias); +- else if ( size == 2 ) *SHORTP(ncp, i) = (short)(val+bias); +- else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)(val+bias); +- } +- return rv; ++ signed char *cp, *ncp; ++ int len, size, val = 0; ++ PyObject *rv; ++ int i; ++ int bias; ++ ++ 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; ++ } ++ ++ rv = PyBytes_FromStringAndSize(NULL, len); ++ if ( rv == 0 ) ++ return 0; ++ ncp = (signed char *)PyBytes_AsString(rv); ++ ++ ++ for ( i=0; i < len; i += size ) { ++ if ( size == 1 ) val = (int)*CHARP(cp, i); ++ else if ( size == 2 ) val = (int)*SHORTP(cp, i); ++ else if ( size == 4 ) val = (int)*LONGP(cp, i); ++ ++ if ( size == 1 ) *CHARP(ncp, i) = (signed char)(val+bias); ++ else if ( size == 2 ) *SHORTP(ncp, i) = (short)(val+bias); ++ else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)(val+bias); ++ } ++ return rv; + } + + static PyObject * + audioop_reverse(PyObject *self, PyObject *args) + { +- signed char *cp; +- unsigned char *ncp; +- int len, size, val = 0; +- PyObject *rv; +- int i, j; +- +- if ( !PyArg_ParseTuple(args, "s#i:reverse", +- &cp, &len, &size) ) +- return 0; +- +- if ( size != 1 && size != 2 && size != 4 ) { +- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4"); +- return 0; +- } +- +- rv = PyBytes_FromStringAndSize(NULL, len); +- if ( rv == 0 ) +- return 0; +- ncp = (unsigned char *)PyBytes_AsString(rv); +- +- for ( i=0; i < len; i += size ) { +- if ( size == 1 ) val = ((int)*CHARP(cp, i)) << 8; +- else if ( size == 2 ) val = (int)*SHORTP(cp, i); +- else if ( size == 4 ) val = ((int)*LONGP(cp, i)) >> 16; +- +- j = len - i - size; +- +- if ( size == 1 ) *CHARP(ncp, j) = (signed char)(val >> 8); +- else if ( size == 2 ) *SHORTP(ncp, j) = (short)(val); +- else if ( size == 4 ) *LONGP(ncp, j) = (Py_Int32)(val<<16); +- } +- return rv; ++ signed char *cp; ++ unsigned char *ncp; ++ int len, size, val = 0; ++ PyObject *rv; ++ int i, j; ++ ++ if ( !PyArg_ParseTuple(args, "s#i:reverse", ++ &cp, &len, &size) ) ++ return 0; ++ ++ if ( size != 1 && size != 2 && size != 4 ) { ++ PyErr_SetString(AudioopError, "Size should be 1, 2 or 4"); ++ return 0; ++ } ++ ++ rv = PyBytes_FromStringAndSize(NULL, len); ++ if ( rv == 0 ) ++ return 0; ++ ncp = (unsigned char *)PyBytes_AsString(rv); ++ ++ for ( i=0; i < len; i += size ) { ++ if ( size == 1 ) val = ((int)*CHARP(cp, i)) << 8; ++ else if ( size == 2 ) val = (int)*SHORTP(cp, i); ++ else if ( size == 4 ) val = ((int)*LONGP(cp, i)) >> 16; ++ ++ j = len - i - size; ++ ++ if ( size == 1 ) *CHARP(ncp, j) = (signed char)(val >> 8); ++ else if ( size == 2 ) *SHORTP(ncp, j) = (short)(val); ++ else if ( size == 4 ) *LONGP(ncp, j) = (Py_Int32)(val<<16); ++ } ++ return rv; + } + + static PyObject * + audioop_lin2lin(PyObject *self, PyObject *args) + { +- signed char *cp; +- unsigned char *ncp; +- int len, new_len, size, size2, val = 0; +- PyObject *rv; +- int i, j; +- +- 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; +- } +- +- new_len = (len/size)*size2; +- if (new_len < 0) { +- PyErr_SetString(PyExc_MemoryError, +- "not enough memory for output buffer"); +- return 0; +- } +- rv = PyBytes_FromStringAndSize(NULL, new_len); +- if ( rv == 0 ) +- return 0; +- ncp = (unsigned char *)PyBytes_AsString(rv); +- +- for ( i=0, j=0; i < len; i += size, j += size2 ) { +- if ( size == 1 ) val = ((int)*CHARP(cp, i)) << 8; +- else if ( size == 2 ) val = (int)*SHORTP(cp, i); +- else if ( size == 4 ) val = ((int)*LONGP(cp, i)) >> 16; +- +- if ( size2 == 1 ) *CHARP(ncp, j) = (signed char)(val >> 8); +- else if ( size2 == 2 ) *SHORTP(ncp, j) = (short)(val); +- else if ( size2 == 4 ) *LONGP(ncp, j) = (Py_Int32)(val<<16); +- } +- return rv; ++ signed char *cp; ++ unsigned char *ncp; ++ int len, new_len, size, size2, val = 0; ++ PyObject *rv; ++ int i, j; ++ ++ 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; ++ } ++ ++ new_len = (len/size)*size2; ++ if (new_len < 0) { ++ PyErr_SetString(PyExc_MemoryError, ++ "not enough memory for output buffer"); ++ return 0; ++ } ++ rv = PyBytes_FromStringAndSize(NULL, new_len); ++ if ( rv == 0 ) ++ return 0; ++ ncp = (unsigned char *)PyBytes_AsString(rv); ++ ++ for ( i=0, j=0; i < len; i += size, j += size2 ) { ++ if ( size == 1 ) val = ((int)*CHARP(cp, i)) << 8; ++ else if ( size == 2 ) val = (int)*SHORTP(cp, i); ++ else if ( size == 4 ) val = ((int)*LONGP(cp, i)) >> 16; ++ ++ if ( size2 == 1 ) *CHARP(ncp, j) = (signed char)(val >> 8); ++ else if ( size2 == 2 ) *SHORTP(ncp, j) = (short)(val); ++ else if ( size2 == 4 ) *LONGP(ncp, j) = (Py_Int32)(val<<16); ++ } ++ return rv; + } + + static int + gcd(int a, int b) + { +- while (b > 0) { +- int tmp = a % b; +- a = b; +- b = tmp; +- } +- return a; ++ while (b > 0) { ++ int tmp = a % b; ++ a = b; ++ b = tmp; ++ } ++ return a; + } + + static PyObject * + audioop_ratecv(PyObject *self, PyObject *args) + { +- char *cp, *ncp; +- int len, size, nchannels, inrate, outrate, weightA, weightB; +- 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; +- if (!PyArg_ParseTuple(args, "s#iiiiO|ii:ratecv", &cp, &len, &size, +- &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"); +- return NULL; +- } +- if (nchannels < 1) { +- PyErr_SetString(AudioopError, "# of channels should be >= 1"); +- return NULL; +- } +- bytes_per_frame = size * nchannels; +- if (bytes_per_frame / nchannels != size) { +- /* This overflow test is rigorously correct because +- both multiplicands are >= 1. Use the argument names +- from the docs for the error msg. */ +- PyErr_SetString(PyExc_OverflowError, +- "width * nchannels too big for a C int"); +- return NULL; +- } +- if (weightA < 1 || weightB < 0) { +- PyErr_SetString(AudioopError, +- "weightA should be >= 1, weightB should be >= 0"); +- return NULL; +- } +- if (len % bytes_per_frame != 0) { +- PyErr_SetString(AudioopError, "not a whole number of frames"); +- return NULL; +- } +- if (inrate <= 0 || outrate <= 0) { +- PyErr_SetString(AudioopError, "sampling rate not > 0"); +- return NULL; +- } +- /* divide inrate and outrate by their greatest common divisor */ +- d = gcd(inrate, outrate); +- inrate /= d; +- outrate /= d; +- +- alloc_size = sizeof(int) * (unsigned)nchannels; +- if (alloc_size < (unsigned)nchannels) { +- PyErr_SetString(PyExc_MemoryError, +- "not enough memory for output buffer"); +- return 0; +- } +- prev_i = (int *) malloc(alloc_size); +- cur_i = (int *) malloc(alloc_size); +- if (prev_i == NULL || cur_i == NULL) { +- (void) PyErr_NoMemory(); ++ char *cp, *ncp; ++ int len, size, nchannels, inrate, outrate, weightA, weightB; ++ 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; ++ if (!PyArg_ParseTuple(args, "s#iiiiO|ii:ratecv", &cp, &len, &size, ++ &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"); ++ return NULL; ++ } ++ if (nchannels < 1) { ++ PyErr_SetString(AudioopError, "# of channels should be >= 1"); ++ return NULL; ++ } ++ bytes_per_frame = size * nchannels; ++ if (bytes_per_frame / nchannels != size) { ++ /* This overflow test is rigorously correct because ++ both multiplicands are >= 1. Use the argument names ++ from the docs for the error msg. */ ++ PyErr_SetString(PyExc_OverflowError, ++ "width * nchannels too big for a C int"); ++ return NULL; ++ } ++ if (weightA < 1 || weightB < 0) { ++ PyErr_SetString(AudioopError, ++ "weightA should be >= 1, weightB should be >= 0"); ++ return NULL; ++ } ++ if (len % bytes_per_frame != 0) { ++ PyErr_SetString(AudioopError, "not a whole number of frames"); ++ return NULL; ++ } ++ if (inrate <= 0 || outrate <= 0) { ++ PyErr_SetString(AudioopError, "sampling rate not > 0"); ++ return NULL; ++ } ++ /* divide inrate and outrate by their greatest common divisor */ ++ d = gcd(inrate, outrate); ++ inrate /= d; ++ outrate /= d; ++ ++ alloc_size = sizeof(int) * (unsigned)nchannels; ++ if (alloc_size < (unsigned)nchannels) { ++ PyErr_SetString(PyExc_MemoryError, ++ "not enough memory for output buffer"); ++ return 0; ++ } ++ prev_i = (int *) malloc(alloc_size); ++ cur_i = (int *) malloc(alloc_size); ++ if (prev_i == NULL || cur_i == NULL) { ++ (void) PyErr_NoMemory(); ++ goto exit; ++ } ++ ++ len /= bytes_per_frame; /* # of frames */ ++ ++ if (state == Py_None) { ++ d = -outrate; ++ for (chan = 0; chan < nchannels; chan++) ++ prev_i[chan] = cur_i[chan] = 0; ++ } ++ else { ++ if (!PyArg_ParseTuple(state, ++ "iO!;audioop.ratecv: illegal state argument", ++ &d, &PyTuple_Type, &samps)) ++ goto exit; ++ if (PyTuple_Size(samps) != nchannels) { ++ PyErr_SetString(AudioopError, ++ "illegal state argument"); ++ goto exit; ++ } ++ for (chan = 0; chan < nchannels; chan++) { ++ if (!PyArg_ParseTuple(PyTuple_GetItem(samps, chan), ++ "ii:ratecv", &prev_i[chan], ++ &cur_i[chan])) + goto exit; + } ++ } + +- len /= bytes_per_frame; /* # of frames */ ++ /* str <- Space for the output buffer. */ ++ { ++ /* There are len input frames, so we need (mathematically) ++ 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) ++ str = NULL; ++ else ++ str = PyBytes_FromStringAndSize(NULL, nbytes); + +- if (state == Py_None) { +- d = -outrate; ++ if (str == NULL) { ++ PyErr_SetString(PyExc_MemoryError, ++ "not enough memory for output buffer"); ++ goto exit; ++ } ++ } ++ ncp = PyBytes_AsString(str); ++ ++ for (;;) { ++ while (d < 0) { ++ if (len == 0) { ++ samps = PyTuple_New(nchannels); ++ if (samps == NULL) ++ goto exit; + for (chan = 0; chan < nchannels; chan++) +- prev_i[chan] = cur_i[chan] = 0; +- } +- else { +- if (!PyArg_ParseTuple(state, +- "iO!;audioop.ratecv: illegal state argument", +- &d, &PyTuple_Type, &samps)) +- goto exit; +- if (PyTuple_Size(samps) != nchannels) { +- PyErr_SetString(AudioopError, +- "illegal state argument"); +- goto exit; +- } +- for (chan = 0; chan < nchannels; chan++) { +- if (!PyArg_ParseTuple(PyTuple_GetItem(samps, chan), +- "ii:ratecv", &prev_i[chan], +- &cur_i[chan])) +- goto exit; +- } +- } +- +- /* str <- Space for the output buffer. */ +- { +- /* There are len input frames, so we need (mathematically) +- 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) +- str = NULL; +- else +- str = PyBytes_FromStringAndSize(NULL, nbytes); +- +- if (str == NULL) { +- PyErr_SetString(PyExc_MemoryError, +- "not enough memory for output buffer"); +- goto exit; +- } +- } +- ncp = PyBytes_AsString(str); +- +- for (;;) { +- while (d < 0) { +- if (len == 0) { +- samps = PyTuple_New(nchannels); +- if (samps == NULL) +- goto exit; +- for (chan = 0; chan < nchannels; chan++) +- PyTuple_SetItem(samps, chan, +- Py_BuildValue("(ii)", +- prev_i[chan], +- cur_i[chan])); +- if (PyErr_Occurred()) +- goto exit; +- /* We have checked before that the length +- * of the string fits into int. */ +- len = (int)(ncp - PyBytes_AsString(str)); +- rv = PyBytes_FromStringAndSize +- (PyBytes_AsString(str), len); +- Py_DECREF(str); +- str = rv; +- if (str == NULL) +- goto exit; +- rv = Py_BuildValue("(O(iO))", str, d, samps); +- Py_DECREF(samps); +- Py_DECREF(str); +- goto exit; /* return rv */ +- } +- for (chan = 0; chan < nchannels; chan++) { +- prev_i[chan] = cur_i[chan]; +- if (size == 1) +- cur_i[chan] = ((int)*CHARP(cp, 0)) << 8; +- else if (size == 2) +- cur_i[chan] = (int)*SHORTP(cp, 0); +- else if (size == 4) +- cur_i[chan] = ((int)*LONGP(cp, 0)) >> 16; +- cp += size; +- /* implements a simple digital filter */ +- cur_i[chan] = +- (weightA * cur_i[chan] + +- weightB * prev_i[chan]) / +- (weightA + weightB); +- } +- len--; +- d += outrate; +- } +- while (d >= 0) { +- for (chan = 0; chan < nchannels; chan++) { +- cur_o = (prev_i[chan] * d + +- cur_i[chan] * (outrate - d)) / +- outrate; +- if (size == 1) +- *CHARP(ncp, 0) = (signed char)(cur_o >> 8); +- else if (size == 2) +- *SHORTP(ncp, 0) = (short)(cur_o); +- else if (size == 4) +- *LONGP(ncp, 0) = (Py_Int32)(cur_o<<16); +- ncp += size; +- } +- d -= inrate; +- } ++ PyTuple_SetItem(samps, chan, ++ Py_BuildValue("(ii)", ++ prev_i[chan], ++ cur_i[chan])); ++ if (PyErr_Occurred()) ++ goto exit; ++ /* We have checked before that the length ++ * of the string fits into int. */ ++ len = (int)(ncp - PyBytes_AsString(str)); ++ rv = PyBytes_FromStringAndSize ++ (PyBytes_AsString(str), len); ++ Py_DECREF(str); ++ str = rv; ++ if (str == NULL) ++ goto exit; ++ rv = Py_BuildValue("(O(iO))", str, d, samps); ++ Py_DECREF(samps); ++ Py_DECREF(str); ++ goto exit; /* return rv */ ++ } ++ for (chan = 0; chan < nchannels; chan++) { ++ prev_i[chan] = cur_i[chan]; ++ if (size == 1) ++ cur_i[chan] = ((int)*CHARP(cp, 0)) << 8; ++ else if (size == 2) ++ cur_i[chan] = (int)*SHORTP(cp, 0); ++ else if (size == 4) ++ cur_i[chan] = ((int)*LONGP(cp, 0)) >> 16; ++ cp += size; ++ /* implements a simple digital filter */ ++ cur_i[chan] = ++ (weightA * cur_i[chan] + ++ weightB * prev_i[chan]) / ++ (weightA + weightB); ++ } ++ len--; ++ d += outrate; ++ } ++ while (d >= 0) { ++ for (chan = 0; chan < nchannels; chan++) { ++ cur_o = (prev_i[chan] * d + ++ cur_i[chan] * (outrate - d)) / ++ outrate; ++ if (size == 1) ++ *CHARP(ncp, 0) = (signed char)(cur_o >> 8); ++ else if (size == 2) ++ *SHORTP(ncp, 0) = (short)(cur_o); ++ else if (size == 4) ++ *LONGP(ncp, 0) = (Py_Int32)(cur_o<<16); ++ ncp += size; ++ } ++ d -= inrate; + } ++ } + exit: +- if (prev_i != NULL) +- free(prev_i); +- if (cur_i != NULL) +- free(cur_i); +- return rv; ++ if (prev_i != NULL) ++ free(prev_i); ++ if (cur_i != NULL) ++ free(cur_i); ++ return rv; + } + + static PyObject * + audioop_lin2ulaw(PyObject *self, PyObject *args) + { +- signed char *cp; +- unsigned char *ncp; +- int len, size, val = 0; +- PyObject *rv; +- int i; +- +- 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; +- } +- +- rv = PyBytes_FromStringAndSize(NULL, len/size); +- if ( rv == 0 ) +- return 0; +- ncp = (unsigned char *)PyBytes_AsString(rv); +- +- for ( i=0; i < len; i += size ) { +- if ( size == 1 ) val = ((int)*CHARP(cp, i)) << 8; +- else if ( size == 2 ) val = (int)*SHORTP(cp, i); +- else if ( size == 4 ) val = ((int)*LONGP(cp, i)) >> 16; +- +- *ncp++ = st_14linear2ulaw(val); +- } +- return rv; ++ signed char *cp; ++ unsigned char *ncp; ++ int len, size, val = 0; ++ PyObject *rv; ++ int i; ++ ++ 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; ++ } ++ ++ rv = PyBytes_FromStringAndSize(NULL, len/size); ++ if ( rv == 0 ) ++ return 0; ++ ncp = (unsigned char *)PyBytes_AsString(rv); ++ ++ for ( i=0; i < len; i += size ) { ++ if ( size == 1 ) val = ((int)*CHARP(cp, i)) << 8; ++ else if ( size == 2 ) val = (int)*SHORTP(cp, i); ++ else if ( size == 4 ) val = ((int)*LONGP(cp, i)) >> 16; ++ ++ *ncp++ = st_14linear2ulaw(val); ++ } ++ return rv; + } + + static PyObject * + audioop_ulaw2lin(PyObject *self, PyObject *args) + { +- unsigned char *cp; +- unsigned char cval; +- signed char *ncp; +- int len, new_len, size, val; +- PyObject *rv; +- int i; +- +- 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; +- } +- +- new_len = len*size; +- if (new_len < 0) { +- PyErr_SetString(PyExc_MemoryError, +- "not enough memory for output buffer"); +- return 0; +- } +- rv = PyBytes_FromStringAndSize(NULL, new_len); +- if ( rv == 0 ) +- return 0; +- ncp = (signed char *)PyBytes_AsString(rv); +- +- for ( i=0; i < new_len; i += size ) { +- cval = *cp++; +- val = st_ulaw2linear16(cval); +- +- if ( size == 1 ) *CHARP(ncp, i) = (signed char)(val >> 8); +- else if ( size == 2 ) *SHORTP(ncp, i) = (short)(val); +- else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)(val<<16); +- } +- return rv; ++ unsigned char *cp; ++ unsigned char cval; ++ signed char *ncp; ++ int len, new_len, size, val; ++ PyObject *rv; ++ int i; ++ ++ 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; ++ } ++ ++ new_len = len*size; ++ if (new_len < 0) { ++ PyErr_SetString(PyExc_MemoryError, ++ "not enough memory for output buffer"); ++ return 0; ++ } ++ rv = PyBytes_FromStringAndSize(NULL, new_len); ++ if ( rv == 0 ) ++ return 0; ++ ncp = (signed char *)PyBytes_AsString(rv); ++ ++ for ( i=0; i < new_len; i += size ) { ++ cval = *cp++; ++ val = st_ulaw2linear16(cval); ++ ++ if ( size == 1 ) *CHARP(ncp, i) = (signed char)(val >> 8); ++ else if ( size == 2 ) *SHORTP(ncp, i) = (short)(val); ++ else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)(val<<16); ++ } ++ return rv; + } + + static PyObject * + audioop_lin2alaw(PyObject *self, PyObject *args) + { +- signed char *cp; +- unsigned char *ncp; +- int len, size, val = 0; +- PyObject *rv; +- int i; +- +- 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; +- } +- +- rv = PyBytes_FromStringAndSize(NULL, len/size); +- if ( rv == 0 ) +- return 0; +- ncp = (unsigned char *)PyBytes_AsString(rv); +- +- for ( i=0; i < len; i += size ) { +- if ( size == 1 ) val = ((int)*CHARP(cp, i)) << 8; +- else if ( size == 2 ) val = (int)*SHORTP(cp, i); +- else if ( size == 4 ) val = ((int)*LONGP(cp, i)) >> 16; +- +- *ncp++ = st_linear2alaw(val); +- } +- return rv; ++ signed char *cp; ++ unsigned char *ncp; ++ int len, size, val = 0; ++ PyObject *rv; ++ int i; ++ ++ 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; ++ } ++ ++ rv = PyBytes_FromStringAndSize(NULL, len/size); ++ if ( rv == 0 ) ++ return 0; ++ ncp = (unsigned char *)PyBytes_AsString(rv); ++ ++ for ( i=0; i < len; i += size ) { ++ if ( size == 1 ) val = ((int)*CHARP(cp, i)) << 8; ++ else if ( size == 2 ) val = (int)*SHORTP(cp, i); ++ else if ( size == 4 ) val = ((int)*LONGP(cp, i)) >> 16; ++ ++ *ncp++ = st_linear2alaw(val); ++ } ++ return rv; + } + + static PyObject * + audioop_alaw2lin(PyObject *self, PyObject *args) + { +- unsigned char *cp; +- unsigned char cval; +- signed char *ncp; +- int len, new_len, size, val; +- PyObject *rv; +- int i; +- +- 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; +- } +- +- new_len = len*size; +- if (new_len < 0) { +- PyErr_SetString(PyExc_MemoryError, +- "not enough memory for output buffer"); +- return 0; +- } +- rv = PyBytes_FromStringAndSize(NULL, new_len); +- if ( rv == 0 ) +- return 0; +- ncp = (signed char *)PyBytes_AsString(rv); +- +- for ( i=0; i < new_len; i += size ) { +- cval = *cp++; +- val = st_alaw2linear16(cval); +- +- if ( size == 1 ) *CHARP(ncp, i) = (signed char)(val >> 8); +- else if ( size == 2 ) *SHORTP(ncp, i) = (short)(val); +- else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)(val<<16); +- } +- return rv; ++ unsigned char *cp; ++ unsigned char cval; ++ signed char *ncp; ++ int len, new_len, size, val; ++ PyObject *rv; ++ int i; ++ ++ 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; ++ } ++ ++ new_len = len*size; ++ if (new_len < 0) { ++ PyErr_SetString(PyExc_MemoryError, ++ "not enough memory for output buffer"); ++ return 0; ++ } ++ rv = PyBytes_FromStringAndSize(NULL, new_len); ++ if ( rv == 0 ) ++ return 0; ++ ncp = (signed char *)PyBytes_AsString(rv); ++ ++ for ( i=0; i < new_len; i += size ) { ++ cval = *cp++; ++ val = st_alaw2linear16(cval); ++ ++ if ( size == 1 ) *CHARP(ncp, i) = (signed char)(val >> 8); ++ else if ( size == 2 ) *SHORTP(ncp, i) = (short)(val); ++ else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)(val<<16); ++ } ++ return rv; + } + + static PyObject * + audioop_lin2adpcm(PyObject *self, PyObject *args) + { +- signed char *cp; +- signed char *ncp; +- int len, size, val = 0, step, valpred, delta, +- index, sign, vpdiff, diff; +- PyObject *rv, *state, *str; +- int i, outputbuffer = 0, bufferstep; +- +- 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; +- } +- +- str = PyBytes_FromStringAndSize(NULL, len/(size*2)); +- if ( str == 0 ) +- return 0; +- ncp = (signed char *)PyBytes_AsString(str); +- +- /* Decode state, should have (value, step) */ +- if ( state == Py_None ) { +- /* First time, it seems. Set defaults */ +- valpred = 0; +- step = 7; +- index = 0; +- } else if ( !PyArg_ParseTuple(state, "ii", &valpred, &index) ) +- return 0; ++ signed char *cp; ++ signed char *ncp; ++ int len, size, val = 0, step, valpred, delta, ++ index, sign, vpdiff, diff; ++ PyObject *rv, *state, *str; ++ int i, outputbuffer = 0, bufferstep; ++ ++ 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; ++ } ++ ++ str = PyBytes_FromStringAndSize(NULL, len/(size*2)); ++ if ( str == 0 ) ++ return 0; ++ ncp = (signed char *)PyBytes_AsString(str); ++ ++ /* Decode state, should have (value, step) */ ++ if ( state == Py_None ) { ++ /* First time, it seems. Set defaults */ ++ valpred = 0; ++ step = 7; ++ index = 0; ++ } else if ( !PyArg_ParseTuple(state, "ii", &valpred, &index) ) ++ return 0; ++ ++ step = stepsizeTable[index]; ++ bufferstep = 1; ++ ++ for ( i=0; i < len; i += size ) { ++ if ( size == 1 ) val = ((int)*CHARP(cp, i)) << 8; ++ else if ( size == 2 ) val = (int)*SHORTP(cp, i); ++ else if ( size == 4 ) val = ((int)*LONGP(cp, i)) >> 16; ++ ++ /* Step 1 - compute difference with previous value */ ++ diff = val - valpred; ++ sign = (diff < 0) ? 8 : 0; ++ if ( sign ) diff = (-diff); ++ ++ /* Step 2 - Divide and clamp */ ++ /* Note: ++ ** This code *approximately* computes: ++ ** delta = diff*4/step; ++ ** vpdiff = (delta+0.5)*step/4; ++ ** but in shift step bits are dropped. The net result of this ++ ** is that even if you have fast mul/div hardware you cannot ++ ** put it to good use since the fixup would be too expensive. ++ */ ++ delta = 0; ++ vpdiff = (step >> 3); + ++ if ( diff >= step ) { ++ delta = 4; ++ diff -= step; ++ vpdiff += step; ++ } ++ step >>= 1; ++ if ( diff >= step ) { ++ delta |= 2; ++ diff -= step; ++ vpdiff += step; ++ } ++ step >>= 1; ++ if ( diff >= step ) { ++ delta |= 1; ++ vpdiff += step; ++ } ++ ++ /* Step 3 - Update previous value */ ++ if ( sign ) ++ valpred -= vpdiff; ++ else ++ valpred += vpdiff; ++ ++ /* Step 4 - Clamp previous value to 16 bits */ ++ if ( valpred > 32767 ) ++ valpred = 32767; ++ else if ( valpred < -32768 ) ++ valpred = -32768; ++ ++ /* Step 5 - Assemble value, update index and step values */ ++ delta |= sign; ++ ++ index += indexTable[delta]; ++ if ( index < 0 ) index = 0; ++ if ( index > 88 ) index = 88; + step = stepsizeTable[index]; +- bufferstep = 1; + +- for ( i=0; i < len; i += size ) { +- if ( size == 1 ) val = ((int)*CHARP(cp, i)) << 8; +- else if ( size == 2 ) val = (int)*SHORTP(cp, i); +- else if ( size == 4 ) val = ((int)*LONGP(cp, i)) >> 16; +- +- /* Step 1 - compute difference with previous value */ +- diff = val - valpred; +- sign = (diff < 0) ? 8 : 0; +- if ( sign ) diff = (-diff); +- +- /* Step 2 - Divide and clamp */ +- /* Note: +- ** This code *approximately* computes: +- ** delta = diff*4/step; +- ** vpdiff = (delta+0.5)*step/4; +- ** but in shift step bits are dropped. The net result of this +- ** is that even if you have fast mul/div hardware you cannot +- ** put it to good use since the fixup would be too expensive. +- */ +- delta = 0; +- vpdiff = (step >> 3); +- +- if ( diff >= step ) { +- delta = 4; +- diff -= step; +- vpdiff += step; +- } +- step >>= 1; +- if ( diff >= step ) { +- delta |= 2; +- diff -= step; +- vpdiff += step; +- } +- step >>= 1; +- if ( diff >= step ) { +- delta |= 1; +- vpdiff += step; +- } +- +- /* Step 3 - Update previous value */ +- if ( sign ) +- valpred -= vpdiff; +- else +- valpred += vpdiff; +- +- /* Step 4 - Clamp previous value to 16 bits */ +- if ( valpred > 32767 ) +- valpred = 32767; +- else if ( valpred < -32768 ) +- valpred = -32768; +- +- /* Step 5 - Assemble value, update index and step values */ +- delta |= sign; +- +- index += indexTable[delta]; +- if ( index < 0 ) index = 0; +- if ( index > 88 ) index = 88; +- step = stepsizeTable[index]; +- +- /* Step 6 - Output value */ +- if ( bufferstep ) { +- outputbuffer = (delta << 4) & 0xf0; +- } else { +- *ncp++ = (delta & 0x0f) | outputbuffer; +- } +- bufferstep = !bufferstep; ++ /* Step 6 - Output value */ ++ if ( bufferstep ) { ++ outputbuffer = (delta << 4) & 0xf0; ++ } else { ++ *ncp++ = (delta & 0x0f) | outputbuffer; + } +- rv = Py_BuildValue("(O(ii))", str, valpred, index); +- Py_DECREF(str); +- return rv; ++ bufferstep = !bufferstep; ++ } ++ rv = Py_BuildValue("(O(ii))", str, valpred, index); ++ Py_DECREF(str); ++ return rv; + } + + static PyObject * + audioop_adpcm2lin(PyObject *self, PyObject *args) + { +- signed char *cp; +- signed char *ncp; +- int len, new_len, size, valpred, step, delta, index, sign, vpdiff; +- PyObject *rv, *str, *state; +- int i, inputbuffer = 0, bufferstep; +- +- 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; +- } +- +- /* Decode state, should have (value, step) */ +- if ( state == Py_None ) { +- /* First time, it seems. Set defaults */ +- valpred = 0; +- step = 7; +- index = 0; +- } else if ( !PyArg_ParseTuple(state, "ii", &valpred, &index) ) +- return 0; +- +- new_len = len*size*2; +- if (new_len < 0) { +- PyErr_SetString(PyExc_MemoryError, +- "not enough memory for output buffer"); +- return 0; ++ signed char *cp; ++ signed char *ncp; ++ int len, new_len, size, valpred, step, delta, index, sign, vpdiff; ++ PyObject *rv, *str, *state; ++ int i, inputbuffer = 0, bufferstep; ++ ++ 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; ++ } ++ ++ /* Decode state, should have (value, step) */ ++ if ( state == Py_None ) { ++ /* First time, it seems. Set defaults */ ++ valpred = 0; ++ step = 7; ++ index = 0; ++ } else if ( !PyArg_ParseTuple(state, "ii", &valpred, &index) ) ++ return 0; ++ ++ new_len = len*size*2; ++ if (new_len < 0) { ++ PyErr_SetString(PyExc_MemoryError, ++ "not enough memory for output buffer"); ++ return 0; ++ } ++ str = PyBytes_FromStringAndSize(NULL, new_len); ++ if ( str == 0 ) ++ return 0; ++ ncp = (signed char *)PyBytes_AsString(str); ++ ++ step = stepsizeTable[index]; ++ bufferstep = 0; ++ ++ for ( i=0; i < new_len; i += size ) { ++ /* Step 1 - get the delta value and compute next index */ ++ if ( bufferstep ) { ++ delta = inputbuffer & 0xf; ++ } else { ++ inputbuffer = *cp++; ++ delta = (inputbuffer >> 4) & 0xf; + } +- str = PyBytes_FromStringAndSize(NULL, new_len); +- if ( str == 0 ) +- return 0; +- ncp = (signed char *)PyBytes_AsString(str); + ++ bufferstep = !bufferstep; ++ ++ /* Step 2 - Find new index value (for later) */ ++ index += indexTable[delta]; ++ if ( index < 0 ) index = 0; ++ if ( index > 88 ) index = 88; ++ ++ /* Step 3 - Separate sign and magnitude */ ++ sign = delta & 8; ++ delta = delta & 7; ++ ++ /* Step 4 - Compute difference and new predicted value */ ++ /* ++ ** Computes 'vpdiff = (delta+0.5)*step/4', but see comment ++ ** in adpcm_coder. ++ */ ++ vpdiff = step >> 3; ++ if ( delta & 4 ) vpdiff += step; ++ if ( delta & 2 ) vpdiff += step>>1; ++ if ( delta & 1 ) vpdiff += step>>2; ++ ++ if ( sign ) ++ valpred -= vpdiff; ++ else ++ valpred += vpdiff; ++ ++ /* Step 5 - clamp output value */ ++ if ( valpred > 32767 ) ++ valpred = 32767; ++ else if ( valpred < -32768 ) ++ valpred = -32768; ++ ++ /* Step 6 - Update step value */ + step = stepsizeTable[index]; +- bufferstep = 0; +- +- for ( i=0; i < new_len; i += size ) { +- /* Step 1 - get the delta value and compute next index */ +- if ( bufferstep ) { +- delta = inputbuffer & 0xf; +- } else { +- inputbuffer = *cp++; +- delta = (inputbuffer >> 4) & 0xf; +- } +- +- bufferstep = !bufferstep; +- +- /* Step 2 - Find new index value (for later) */ +- index += indexTable[delta]; +- if ( index < 0 ) index = 0; +- if ( index > 88 ) index = 88; +- +- /* Step 3 - Separate sign and magnitude */ +- sign = delta & 8; +- delta = delta & 7; +- +- /* Step 4 - Compute difference and new predicted value */ +- /* +- ** Computes 'vpdiff = (delta+0.5)*step/4', but see comment +- ** in adpcm_coder. +- */ +- vpdiff = step >> 3; +- if ( delta & 4 ) vpdiff += step; +- if ( delta & 2 ) vpdiff += step>>1; +- if ( delta & 1 ) vpdiff += step>>2; +- +- if ( sign ) +- valpred -= vpdiff; +- else +- valpred += vpdiff; +- +- /* Step 5 - clamp output value */ +- if ( valpred > 32767 ) +- valpred = 32767; +- else if ( valpred < -32768 ) +- valpred = -32768; +- +- /* Step 6 - Update step value */ +- step = stepsizeTable[index]; +- +- /* Step 6 - Output value */ +- if ( size == 1 ) *CHARP(ncp, i) = (signed char)(valpred >> 8); +- else if ( size == 2 ) *SHORTP(ncp, i) = (short)(valpred); +- else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)(valpred<<16); +- } + +- rv = Py_BuildValue("(O(ii))", str, valpred, index); +- Py_DECREF(str); +- return rv; ++ /* Step 6 - Output value */ ++ if ( size == 1 ) *CHARP(ncp, i) = (signed char)(valpred >> 8); ++ else if ( size == 2 ) *SHORTP(ncp, i) = (short)(valpred); ++ else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)(valpred<<16); ++ } ++ ++ rv = Py_BuildValue("(O(ii))", str, valpred, index); ++ Py_DECREF(str); ++ return rv; + } + + static PyMethodDef audioop_methods[] = { +- { "max", audioop_max, METH_VARARGS }, +- { "minmax", audioop_minmax, METH_VARARGS }, +- { "avg", audioop_avg, METH_VARARGS }, +- { "maxpp", audioop_maxpp, METH_VARARGS }, +- { "avgpp", audioop_avgpp, METH_VARARGS }, +- { "rms", audioop_rms, METH_VARARGS }, +- { "findfit", audioop_findfit, METH_VARARGS }, +- { "findmax", audioop_findmax, METH_VARARGS }, +- { "findfactor", audioop_findfactor, METH_VARARGS }, +- { "cross", audioop_cross, METH_VARARGS }, +- { "mul", audioop_mul, METH_VARARGS }, +- { "add", audioop_add, METH_VARARGS }, +- { "bias", audioop_bias, METH_VARARGS }, +- { "ulaw2lin", audioop_ulaw2lin, METH_VARARGS }, +- { "lin2ulaw", audioop_lin2ulaw, METH_VARARGS }, +- { "alaw2lin", audioop_alaw2lin, METH_VARARGS }, +- { "lin2alaw", audioop_lin2alaw, METH_VARARGS }, +- { "lin2lin", audioop_lin2lin, METH_VARARGS }, +- { "adpcm2lin", audioop_adpcm2lin, METH_VARARGS }, +- { "lin2adpcm", audioop_lin2adpcm, METH_VARARGS }, +- { "tomono", audioop_tomono, METH_VARARGS }, +- { "tostereo", audioop_tostereo, METH_VARARGS }, +- { "getsample", audioop_getsample, METH_VARARGS }, +- { "reverse", audioop_reverse, METH_VARARGS }, +- { "ratecv", audioop_ratecv, METH_VARARGS }, +- { 0, 0 } ++ { "max", audioop_max, METH_VARARGS }, ++ { "minmax", audioop_minmax, METH_VARARGS }, ++ { "avg", audioop_avg, METH_VARARGS }, ++ { "maxpp", audioop_maxpp, METH_VARARGS }, ++ { "avgpp", audioop_avgpp, METH_VARARGS }, ++ { "rms", audioop_rms, METH_VARARGS }, ++ { "findfit", audioop_findfit, METH_VARARGS }, ++ { "findmax", audioop_findmax, METH_VARARGS }, ++ { "findfactor", audioop_findfactor, METH_VARARGS }, ++ { "cross", audioop_cross, METH_VARARGS }, ++ { "mul", audioop_mul, METH_VARARGS }, ++ { "add", audioop_add, METH_VARARGS }, ++ { "bias", audioop_bias, METH_VARARGS }, ++ { "ulaw2lin", audioop_ulaw2lin, METH_VARARGS }, ++ { "lin2ulaw", audioop_lin2ulaw, METH_VARARGS }, ++ { "alaw2lin", audioop_alaw2lin, METH_VARARGS }, ++ { "lin2alaw", audioop_lin2alaw, METH_VARARGS }, ++ { "lin2lin", audioop_lin2lin, METH_VARARGS }, ++ { "adpcm2lin", audioop_adpcm2lin, METH_VARARGS }, ++ { "lin2adpcm", audioop_lin2adpcm, METH_VARARGS }, ++ { "tomono", audioop_tomono, METH_VARARGS }, ++ { "tostereo", audioop_tostereo, METH_VARARGS }, ++ { "getsample", audioop_getsample, METH_VARARGS }, ++ { "reverse", audioop_reverse, METH_VARARGS }, ++ { "ratecv", audioop_ratecv, METH_VARARGS }, ++ { 0, 0 } + }; + + + static struct PyModuleDef audioopmodule = { +- PyModuleDef_HEAD_INIT, +- "audioop", +- NULL, +- -1, +- audioop_methods, +- NULL, +- NULL, +- NULL, +- NULL ++ PyModuleDef_HEAD_INIT, ++ "audioop", ++ NULL, ++ -1, ++ audioop_methods, ++ NULL, ++ NULL, ++ NULL, ++ NULL + }; + + PyMODINIT_FUNC + PyInit_audioop(void) + { +- PyObject *m, *d; +- m = PyModule_Create(&audioopmodule); +- if (m == NULL) +- return NULL; +- d = PyModule_GetDict(m); +- if (d == NULL) +- return NULL; +- AudioopError = PyErr_NewException("audioop.error", NULL, NULL); +- if (AudioopError != NULL) +- PyDict_SetItemString(d,"error",AudioopError); +- return m; ++ PyObject *m, *d; ++ m = PyModule_Create(&audioopmodule); ++ if (m == NULL) ++ return NULL; ++ d = PyModule_GetDict(m); ++ if (d == NULL) ++ return NULL; ++ AudioopError = PyErr_NewException("audioop.error", NULL, NULL); ++ if (AudioopError != NULL) ++ PyDict_SetItemString(d,"error",AudioopError); ++ return m; + } diff --git a/python3.spec b/python3.spec index c3aaed8..7cf210d 100644 --- a/python3.spec +++ b/python3.spec @@ -40,7 +40,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 9%{?dist} +Release: 10%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 @@ -204,6 +204,21 @@ Patch104: python-3.1.2-more-configuration-flags.patch # (rhbz:553020); partially upstream as http://bugs.python.org/issue7647 Patch105: python-2.6.5-statvfs-f_flag-constants.patch +# This is the Modules/audioop.c part of the whitespace cleanup in r81032, to make it +# easier to apply subsequent security fixes: +Patch106: python-3.1.2-reformat-audioop.c.patch + +# CVE-2010-1634: fix various integer overflow checks in the audioop module +# This is the difference from r81032 to r81081 (i.e r81047 and r81081) +Patch107: python-3.1.2-CVE-2010-1634.patch + +# CVE-2010-2089: verify sizes/lengths within audioop module: +Patch108: python-3.1.2-CVE-2010-2089.patch + +# CVE-2008-5983: the new PySys_SetArgvEx entry point from r81400 (backported to +# the old layout before the whitespace cleanup of release31-maint in r81033): +Patch109: python-3.1.2-CVE-2008-5983.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRequires: readline-devel, openssl-devel, gmp-devel BuildRequires: ncurses-devel, gdbm-devel, zlib-devel, expat-devel @@ -357,6 +372,10 @@ rm -r Modules/zlib || exit 1 %patch105 -p1 -b .statvfs-f-flag-constants +%patch106 -p3 -b .reformat-audioop +%patch107 -p3 -b .CVE-2010-1634 +%patch108 -p1 -b .CVE-2010-2089 +%patch109 -p1 -b .CVE-2008-5983 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -370,10 +389,10 @@ sed --in-place \ %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" export CFLAGS="$CFLAGS `pkg-config --cflags openssl`" export LDFLAGS="$LDFLAGS `pkg-config --libs-only-L openssl`" @@ -1038,6 +1057,14 @@ rm -fr %{buildroot} %changelog +* Fri Jun 4 2010 David Malcolm - 3.1.2-10 +- ensure that the compiler is invoked with "-fwrapv" (rhbz#594819) +- reformat whitespace in audioop.c (patch 106) +- CVE-2010-1634: fix various integer overflow checks in the audioop +module (patch 107) +- CVE-2010-2089: further checks within the audioop module (patch 108) +- CVE-2008-5983: the new PySys_SetArgvEx entry point from r81399 (patch 109) + * Thu May 27 2010 Dan Horák - 3.1.2-9 - reading the timestamp counter is available only on some arches (see Python/ceval.c) From 03b7fb2d623ad6a4c1a4e4ec7c011a6222b9214d Mon Sep 17 00:00:00 2001 From: dmalcolm Date: Fri, 2 Jul 2010 15:49:25 +0000 Subject: [PATCH 028/416] - Fix an incompatibility between pyexpat and the system expat-2.0.1 that led to a segfault running test_pyexpat.py (patch 110; upstream issue 9054; rhbz#610312) --- python-3.1.2-fix-expat-issue9054.patch | 14 ++++++++++++++ python3.spec | 13 ++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 python-3.1.2-fix-expat-issue9054.patch diff --git a/python-3.1.2-fix-expat-issue9054.patch b/python-3.1.2-fix-expat-issue9054.patch new file mode 100644 index 0000000..f1a4640 --- /dev/null +++ b/python-3.1.2-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/python3.spec b/python3.spec index 7cf210d..4f331b0 100644 --- a/python3.spec +++ b/python3.spec @@ -40,7 +40,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 10%{?dist} +Release: 11%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 @@ -219,6 +219,11 @@ Patch108: python-3.1.2-CVE-2010-2089.patch # the old layout before the whitespace cleanup of release31-maint in r81033): Patch109: python-3.1.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:610312) +# Sent upstream as http://bugs.python.org/issue9054 +Patch110: python-3.1.2-fix-expat-issue9054.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRequires: readline-devel, openssl-devel, gmp-devel BuildRequires: ncurses-devel, gdbm-devel, zlib-devel, expat-devel @@ -377,6 +382,8 @@ rm -r Modules/zlib || exit 1 %patch108 -p1 -b .CVE-2010-2089 %patch109 -p1 -b .CVE-2008-5983 +%patch110 -p0 -b .fix-expat-issue9054 + # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. # @@ -1057,6 +1064,10 @@ rm -fr %{buildroot} %changelog +* Fri Jul 2 2010 David Malcolm - 3.1.2-11 +- Fix an incompatibility between pyexpat and the system expat-2.0.1 that led to +a segfault running test_pyexpat.py (patch 110; upstream issue 9054; rhbz#610312) + * Fri Jun 4 2010 David Malcolm - 3.1.2-10 - ensure that the compiler is invoked with "-fwrapv" (rhbz#594819) - reformat whitespace in audioop.c (patch 106) From 9b81ebe91e254e6bb9272beeb880ec130d896030 Mon Sep 17 00:00:00 2001 From: dmalcolm Date: Fri, 2 Jul 2010 20:32:10 +0000 Subject: [PATCH 029/416] rebuild --- python3.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 4f331b0..4adf0a2 100644 --- a/python3.spec +++ b/python3.spec @@ -40,7 +40,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 11%{?dist} +Release: 12%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 @@ -1064,6 +1064,9 @@ rm -fr %{buildroot} %changelog +* Fri Jul 2 2010 David Malcolm - 3.1.2-12 +- rebuild + * Fri Jul 2 2010 David Malcolm - 3.1.2-11 - Fix an incompatibility between pyexpat and the system expat-2.0.1 that led to a segfault running test_pyexpat.py (patch 110; upstream issue 9054; rhbz#610312) From db6a64a5ec51905341ff17889bb6e4e19a6ab25d Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 29 Jul 2010 10:53:57 +0000 Subject: [PATCH 030/416] dist-git conversion --- .cvsignore => .gitignore | 0 Makefile | 21 --------------------- import.log | 1 - 3 files changed, 22 deletions(-) rename .cvsignore => .gitignore (100%) delete mode 100644 Makefile delete mode 100644 import.log diff --git a/.cvsignore b/.gitignore similarity index 100% rename from .cvsignore rename to .gitignore diff --git a/Makefile b/Makefile deleted file mode 100644 index 3d37c61..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: python3 -# $Id$ -NAME := python3 -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),) -# attept 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 1b187cb..0000000 --- a/import.log +++ /dev/null @@ -1 +0,0 @@ -python3-3_1_1-13_fc12:HEAD:python3-3.1.1-13.fc12.src.rpm:1263417721 From 91b78044d5f01128558248f3ae6d2cb19bc963f0 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Fri, 6 Aug 2010 17:16:23 -0400 Subject: [PATCH 031/416] * Fri Aug 6 2010 Toshio Kuratomi - 3.1.2-13 - Turn on computed-gotos. --- python3.spec | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 4adf0a2..6faac6b 100644 --- a/python3.spec +++ b/python3.spec @@ -17,6 +17,9 @@ %global with_systemtap 1 +# Change from yes to no to turn this off +%global with_computed_gotos yes + # We want to byte-compile the .py files within the packages using the new # python3 binary. # @@ -40,7 +43,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 12%{?dist} +Release: 13%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 @@ -439,6 +442,7 @@ BuildPython() { --with-system-ffi \ --with-system-expat \ $ExtraConfigArgs \ + --with-computed-gotos=%{with_computed_gotos} \ %{nil} @@ -1064,6 +1068,9 @@ rm -fr %{buildroot} %changelog +* Fri Aug 6 2010 Toshio Kuratomi - 3.1.2-13 +- Turn on computed-gotos. + * Fri Jul 2 2010 David Malcolm - 3.1.2-12 - rebuild From 4c1f6daa7c985007218e9a7e7fd6601153a5dcd0 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Thu, 19 Aug 2010 14:12:57 -0400 Subject: [PATCH 032/416] * Fri Aug 6 2010 Toshio Kuratomi - 3.1.2-13 - Turn on computed-gotos. - Fix for parallel make and graminit.c --- python-3.1-fix-parallel-make.patch | 38 ++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 python-3.1-fix-parallel-make.patch diff --git a/python-3.1-fix-parallel-make.patch b/python-3.1-fix-parallel-make.patch new file mode 100644 index 0000000..3c75b10 --- /dev/null +++ b/python-3.1-fix-parallel-make.patch @@ -0,0 +1,38 @@ +Index: Python-3.1.2/Makefile.pre.in +=================================================================== +--- Python-3.1.2.orig/Makefile.pre.in ++++ Python-3.1.2/Makefile.pre.in +@@ -215,6 +215,7 @@ IO_OBJS= \ + + ########################################################################## + # Grammar ++GRAMMAR_STAMP= $(srcdir)/grammar-stamp + GRAMMAR_H= $(srcdir)/Include/graminit.h + GRAMMAR_C= $(srcdir)/Python/graminit.c + GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar +@@ -535,9 +536,24 @@ Modules/python.o: $(srcdir)/Modules/pyth + + $(IO_OBJS): $(IO_H) + +-$(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT) ++# 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_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) From ab3441ad0dc3ec5273666351a750c428c903d2cc Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Thu, 19 Aug 2010 14:13:51 -0400 Subject: [PATCH 033/416] * Fri Aug 6 2010 Toshio Kuratomi - 3.1.2-13 - Turn on computed-gotos. - Fix for parallel make and graminit.c --- python3.spec | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 6faac6b..d12a166 100644 --- a/python3.spec +++ b/python3.spec @@ -227,6 +227,12 @@ Patch109: python-3.1.2-CVE-2008-5983.patch # Sent upstream as http://bugs.python.org/issue9054 Patch110: python-3.1.2-fix-expat-issue9054.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: +Patch111: python-3.1-fix-parallel-make.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRequires: readline-devel, openssl-devel, gmp-devel BuildRequires: ncurses-devel, gdbm-devel, zlib-devel, expat-devel @@ -387,6 +393,8 @@ rm -r Modules/zlib || exit 1 %patch110 -p0 -b .fix-expat-issue9054 +%patch111 -p1 -b .parallel-grammar + # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. # @@ -1068,8 +1076,9 @@ rm -fr %{buildroot} %changelog -* Fri Aug 6 2010 Toshio Kuratomi - 3.1.2-13 +* Thu Aug 19 2010 Toshio Kuratomi - 3.1.2-13 - Turn on computed-gotos. +- Fix for parallel make and graminit.c * Fri Jul 2 2010 David Malcolm - 3.1.2-12 - rebuild From 815994f42ade451adf5fc26d5cde4c662a9ce1b7 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sat, 21 Aug 2010 16:26:53 -0400 Subject: [PATCH 034/416] Add with_debug_build conditional --- python3.spec | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index d12a166..3c8f9ef 100644 --- a/python3.spec +++ b/python3.spec @@ -13,6 +13,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 @@ -310,6 +312,7 @@ in production. You might want to install the python3-test package if you're developing python 3 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 3 runtime Group: Applications/System @@ -462,6 +465,7 @@ make OPT="$CFLAGS" %{?_smp_mflags} # Use "BuildPython" to support building with different configurations: +%if 0%{?with_debug_build} BuildPython debug \ python-debug \ python%{pybasever}-debug \ @@ -471,6 +475,7 @@ BuildPython debug \ "--with-pydebug --with-count-allocs --with-call-profile" \ %endif false +%endif # with_debug_build BuildPython optimized \ python \ @@ -525,8 +530,10 @@ cp %{SOURCE4} %{buildroot}$PathOfGdbPy # 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 \ %{py_INSTSONAME_debug} +%endif # with_debug_build # Now the optimized build: InstallPython optimized \ @@ -568,7 +575,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 @@ -693,10 +707,12 @@ sed \ %{SOURCE6} \ > %{buildroot}%{tapsetdir}/%{libpython_stp_optimized} +%if 0%{?with_debug_build} sed \ -e "s|LIBRARY_PATH|%{_libdir}/%{py_INSTSONAME_debug}|" \ %{SOURCE6} \ > %{buildroot}%{tapsetdir}/%{libpython_stp_debug} +%endif # with_debug_build %endif # with_systemtap @@ -766,7 +782,9 @@ done } # Check each of the configurations: +%if 0%{?with_debug_build} CheckPython debug +%endif # with_debug_build CheckPython optimized @@ -962,6 +980,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,-) @@ -1061,6 +1080,8 @@ 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). # From 7eb10c8dbe3874eee9675c2cbc87a83342806cf7 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sat, 21 Aug 2010 18:08:26 -0400 Subject: [PATCH 035/416] 3.2a1 * Sat Aug 21 2010 David Malcolm - 3.2-0.0.a1 - 3.2a1; add alphatag - rework %%files in the light of PEP 3147 (__pycache__) - drop our configuration patch to Setup.dist (patch 0): setup.py should do a better job of things, and the %%files explicitly lists our modules (r82746 appears to break the old way of doing things). This leads to various modules changing from "foomodule.so" to "foo.so". It also leads to the optimized build dropping the _sha1, _sha256 and _sha512 modules, but these are provided by _hashlib; _weakref becomes a builtin module; xxsubtype goes away (it's only for testing/devel purposes) - fixup patches 3, 4, 6, 8, 102, 103, 105, 111 for the rebase - remove upstream patches: 7 (system expat), 106, 107, 108 (audioop reformat plus CVE-2010-1634 and CVE-2010-2089), 109 (CVE-2008-5983) - add machinery for rebuilding "configure" and friends, using the correct version of autoconf (patch 300) - patch the debug build's usage of COUNT_ALLOCS to be less verbose (patch 125) - "modulator" was removed upstream - drop "-b" from patch applications affecting .py files to avoid littering the installation tree --- .gitignore | 1 + autotool-intermediates.patch | 243 ++ less-verbose-COUNT_ALLOCS.patch | 20 + python-2.6.5-statvfs-f_flag-constants.patch | 62 - ...ges-to-expected-shebang-for-test_imp.patch | 11 - python-3.1.1-config.patch | 226 -- python-3.1.1-systemtap.patch | 322 -- python-3.1.1-with-system-expat.patch | 67 - python-3.1.2-CVE-2008-5983.patch | 120 - python-3.1.2-CVE-2010-1634.patch | 209 -- python-3.1.2-CVE-2010-2089.patch | 313 -- python-3.1.2-reformat-audioop.c.patch | 2727 ----------------- ...ges-to-expected-shebang-for-test_imp.patch | 12 + ...ld.patch => python-3.2a1-debug-build.patch | 147 +- ...ch => python-3.2a1-fix-parallel-make.patch | 13 +- ....1-lib64.patch => python-3.2a1-lib64.patch | 104 +- ....patch => python-3.2a1-no-static-lib.patch | 18 +- ... python-3.2a1-remove-mimeaudio-tests.patch | 10 +- python-3.2a1-statvfs-f_flag-constants.patch | 47 + python-3.2a1-systemtap.patch | 222 ++ python3.spec | 324 +- sources | 2 +- 22 files changed, 895 insertions(+), 4325 deletions(-) create mode 100644 autotool-intermediates.patch create mode 100644 less-verbose-COUNT_ALLOCS.patch delete mode 100644 python-2.6.5-statvfs-f_flag-constants.patch delete mode 100644 python-3.1.1-apply-our-changes-to-expected-shebang-for-test_imp.patch delete mode 100644 python-3.1.1-config.patch delete mode 100644 python-3.1.1-systemtap.patch delete mode 100644 python-3.1.1-with-system-expat.patch delete mode 100644 python-3.1.2-CVE-2008-5983.patch delete mode 100644 python-3.1.2-CVE-2010-1634.patch delete mode 100644 python-3.1.2-CVE-2010-2089.patch delete mode 100644 python-3.1.2-reformat-audioop.c.patch create mode 100644 python-3.2a1-apply-our-changes-to-expected-shebang-for-test_imp.patch rename python-3.1.2-debug-build.patch => python-3.2a1-debug-build.patch (64%) rename python-3.1-fix-parallel-make.patch => python-3.2a1-fix-parallel-make.patch (74%) rename python-3.1.1-lib64.patch => python-3.2a1-lib64.patch (57%) rename python-3.1.1-no-static-lib.patch => python-3.2a1-no-static-lib.patch (66%) rename python-3.1.1-remove-mimeaudio-tests.patch => python-3.2a1-remove-mimeaudio-tests.patch (82%) create mode 100644 python-3.2a1-statvfs-f_flag-constants.patch create mode 100644 python-3.2a1-systemtap.patch diff --git a/.gitignore b/.gitignore index 95c8574..43efa0f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ libpython-36a517ef7848cbd0b3dcc7371f32e47ac4c87eba.tar.gz Python-3.1.2.tar.bz2 +Python-3.2a1.tar.bz2 diff --git a/autotool-intermediates.patch b/autotool-intermediates.patch new file mode 100644 index 0000000..efbf3bf --- /dev/null +++ b/autotool-intermediates.patch @@ -0,0 +1,243 @@ +diff -up ./configure.autotool-intermediates ./configure +--- ./configure.autotool-intermediates 2010-08-02 17:58:12.238002650 -0400 ++++ ./configure 2010-08-02 17:58:20.151000507 -0400 +@@ -1,5 +1,5 @@ + #! /bin/sh +-# From configure.in Revision: 82090 . ++# From configure.in Revision: 82962 . + # Guess values for system-dependent variables and create Makefiles. + # Generated by GNU Autoconf 2.65 for python 3.2. + # +@@ -610,6 +610,8 @@ TRUE + MACHDEP_OBJS + DYNLOADFILE + DLINCLDIR ++DTRACEHDRS ++DTRACEOBJS + THREADOBJ + LDLAST + USE_THREAD_MODULE +@@ -630,6 +632,8 @@ OTHER_LIBTOOL_OPT + UNIVERSAL_ARCH_FLAGS + BASECFLAGS + OPT ++DEBUG_SUFFIX ++DEBUG_EXT + LN + INSTALL_DATA + INSTALL_SCRIPT +@@ -743,8 +747,11 @@ with_thread + 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 +@@ -1414,8 +1421,11 @@ Optional Packages: + deprecated; use --with(out)-threads + --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 +@@ -1929,11 +1939,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 + + ; +@@ -1944,11 +1954,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 + +@@ -4672,7 +4682,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; } +@@ -4843,8 +4853,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*) +@@ -5237,6 +5247,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? + +@@ -8160,6 +8178,7 @@ fi + $as_echo "$with_system_expat" >&6; } + + # Check for use of the system libffi library ++ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-system-ffi" >&5 + $as_echo_n "checking for --with-system-ffi... " >&6; } + +@@ -9144,6 +9163,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; } +@@ -9194,6 +9257,46 @@ fi + OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT" + 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-08-02 17:58:12.236001348 -0400 ++++ ./pyconfig.h.in 2010-08-02 17:58:20.000000000 -0400 +@@ -12,15 +12,15 @@ + support for AIX C++ shared extension modules. */ + #undef AIX_GENUINE_CPLUSPLUS + +-/* Define if you have the Mach cthreads package */ +-#undef C_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 ++ + /* Define if C doubles are 64-bit IEEE 754 binary format, stored in ARM + mixed-endian order (byte order 45670123) */ + #undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 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.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 -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-3.1.1-apply-our-changes-to-expected-shebang-for-test_imp.patch b/python-3.1.1-apply-our-changes-to-expected-shebang-for-test_imp.patch deleted file mode 100644 index 92c3e1f..0000000 --- a/python-3.1.1-apply-our-changes-to-expected-shebang-for-test_imp.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- Python-3.1.1/Lib/test/test_imp.py.apply-our-changes-to-expected-shebang 2009-10-27 18:05:53.539540149 -0400 -+++ Python-3.1.1/Lib/test/test_imp.py 2009-10-27 18:06:12.138538965 -0400 -@@ -52,7 +52,7 @@ class ImportTests(unittest.TestCase): - self.assertNotEqual(fp, None) - self.assertEqual(fp.encoding, "iso-8859-1") - self.assertEqual(fp.tell(), 0) -- self.assertEqual(fp.readline(), '#!/usr/bin/env python\n') -+ self.assertEqual(fp.readline(), '#!/usr/bin/python3.1\n') - fp.close() - - fp, filename, info = imp.find_module("tokenize") diff --git a/python-3.1.1-config.patch b/python-3.1.1-config.patch deleted file mode 100644 index b9eec5b..0000000 --- a/python-3.1.1-config.patch +++ /dev/null @@ -1,226 +0,0 @@ -diff -up Python-3.1.1/Modules/Setup.dist.config Python-3.1.1/Modules/Setup.dist ---- Python-3.1.1/Modules/Setup.dist.config 2009-06-04 05:30:30.000000000 -0400 -+++ Python-3.1.1/Modules/Setup.dist 2010-01-25 23:08:55.179858352 -0500 -@@ -141,7 +141,7 @@ _symtable symtablemodule.c - # 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 -@@ -151,71 +151,71 @@ _symtable symtablemodule.c - # 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 --#atexit atexitmodule.c # Register functions to be run at interpreter-shutdown -+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 -+atexit atexitmodule.c # Register functions to be run at interpreter-shutdown - #_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI _elementtree.c # elementtree accelerator --#_pickle _pickle.c # pickle accelerator -+_pickle _pickle.c # pickle accelerator - #datetime datetimemodule.c # date/time type --#_bisect _bisectmodule.c # Bisection algorithms --#_heapq _heapqmodule.c # Heap queue algorithm -+_bisect _bisectmodule.c # Bisection algorithms -+_heapq _heapqmodule.c # Heap queue algorithm - --#unicodedata unicodedata.c # static Unicode character database -+unicodedata unicodedata.c # static Unicode character database - - - # 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. -@@ -223,7 +223,7 @@ _symtable symtablemodule.c - # #993173 says audioop works on 64-bit platforms, though. - # These represent audio samples or images as strings: - --#audioop audioop.c # Operations on audio samples -+audioop audioop.c # Operations on audio samples - - - # Note that the _md5 and _sha modules are normally only built if the -@@ -238,9 +238,9 @@ _symtable symtablemodule.c - - # The _sha module implements the SHA checksum algorithms. - # (NIST's Secure Hash Algorithms.) --#_sha shamodule.c --#_sha256 sha256module.c --#_sha512 sha512module.c -+_sha1 sha1module.c -+_sha256 sha256module.c -+_sha512 sha512module.c - - - # The _tkinter module. -@@ -255,7 +255,7 @@ _symtable symtablemodule.c - # 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: -@@ -265,7 +265,7 @@ _symtable symtablemodule.c - # *** 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: -@@ -274,7 +274,7 @@ _symtable symtablemodule.c - # *** 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: -@@ -284,10 +284,10 @@ _symtable symtablemodule.c - # *** 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 -+syslog syslogmodule.c # syslog daemon interface - - - # Curses support, requring the System V version of curses, often -@@ -321,14 +321,14 @@ _symtable symtablemodule.c - # - # 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 - - - # 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 - - - # Lee Busby's SIGFPE modules. -@@ -351,7 +351,7 @@ _symtable symtablemodule.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)/lib -lz - - # Interface to the Expat XML parser - # -@@ -369,14 +369,14 @@ _symtable symtablemodule.c - # 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-3.1.1-systemtap.patch b/python-3.1.1-systemtap.patch deleted file mode 100644 index 49c06f8..0000000 --- a/python-3.1.1-systemtap.patch +++ /dev/null @@ -1,322 +0,0 @@ -diff -up Python-3.1.1/configure.in.systemtap Python-3.1.1/configure.in ---- Python-3.1.1/configure.in.systemtap 2010-02-12 15:24:34.959845279 -0500 -+++ Python-3.1.1/configure.in 2010-02-12 15:24:34.965845345 -0500 -@@ -2359,6 +2359,38 @@ then - fi - AC_MSG_RESULT($with_pymalloc) - -+# 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-3.1.1/Include/pydtrace.d.systemtap Python-3.1.1/Include/pydtrace.d ---- Python-3.1.1/Include/pydtrace.d.systemtap 2010-02-12 15:24:34.966844913 -0500 -+++ Python-3.1.1/Include/pydtrace.d 2010-02-12 15:24:34.966844913 -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-3.1.1/Makefile.pre.in.systemtap Python-3.1.1/Makefile.pre.in ---- Python-3.1.1/Makefile.pre.in.systemtap 2010-02-12 15:24:34.953845073 -0500 -+++ Python-3.1.1/Makefile.pre.in 2010-02-12 15:24:34.990844336 -0500 -@@ -312,6 +312,7 @@ PYTHON_OBJS= \ - Python/dtoa.o \ - Python/formatter_unicode.o \ - Python/$(DYNLOADFILE) \ -+ @DTRACEOBJS@ \ - $(LIBOBJS) \ - $(MACHDEP_OBJS) \ - $(THREADOBJ) -@@ -592,6 +593,18 @@ Python/formatter_unicode.o: $(srcdir)/Py - $(srcdir)/Objects/stringlib/formatter.h - - -+# 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 - -@@ -1224,6 +1237,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-3.1.1/pyconfig.h.in.systemtap Python-3.1.1/pyconfig.h.in ---- Python-3.1.1/pyconfig.h.in.systemtap 2009-05-29 13:25:39.000000000 -0400 -+++ Python-3.1.1/pyconfig.h.in 2010-02-12 15:24:34.991845511 -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 -@@ -995,6 +998,28 @@ - /* Define if you want to use computed gotos in ceval.c. */ - #undef USE_COMPUTED_GOTOS - -+/* 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 a va_list is an array of some kind */ - #undef VA_LIST_IS_ARRAY - -@@ -1011,6 +1036,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. */ -@@ -1032,20 +1060,21 @@ - /* Define to profile with the Pentium timestamp counter */ - #undef WITH_TSC - --/* Define to 1 if your processor stores words with the most significant byte -- first (like Motorola and SPARC, unlike Intel and VAX). */ --#undef WORDS_BIGENDIAN -+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most -+ significant byte first (like Motorola and SPARC, unlike Intel). */ -+#if defined AC_APPLE_UNIVERSAL_BUILD -+# if defined __BIG_ENDIAN__ -+# define WORDS_BIGENDIAN 1 -+# endif -+#else -+# ifndef WORDS_BIGENDIAN -+# undef WORDS_BIGENDIAN -+# endif -+#endif - - /* Define if arithmetic is subject to x87-style double rounding issue */ - #undef X87_DOUBLE_ROUNDING - --/* Define to 1 if on AIX 3. -- System headers sometimes define this. -- We just want to avoid a redefinition error message. */ --#ifndef _ALL_SOURCE --# undef _ALL_SOURCE --#endif -- - /* Define on OpenBSD to activate all library features */ - #undef _BSD_SOURCE - -@@ -1064,15 +1093,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 - -@@ -1080,12 +1119,12 @@ - #undef _REENTRANT - - /* Define for Solaris 2.5.1 so the uint32_t typedef from , -- , or is not used. If the typedef was allowed, the -+ , or is not used. If the typedef were allowed, the - #define below would cause a syntax error. */ - #undef _UINT32_T - - /* Define for Solaris 2.5.1 so the uint64_t typedef from , -- , or is not used. If the typedef was allowed, the -+ , or is not used. If the typedef were allowed, the - #define below would cause a syntax error. */ - #undef _UINT64_T - -diff -up Python-3.1.1/Python/ceval.c.systemtap Python-3.1.1/Python/ceval.c ---- Python-3.1.1/Python/ceval.c.systemtap 2009-05-30 17:41:10.000000000 -0400 -+++ Python-3.1.1/Python/ceval.c 2010-02-12 15:24:54.075844169 -0500 -@@ -19,6 +19,10 @@ - - #include - -+#ifdef WITH_DTRACE -+#include "pydtrace.h" -+#endif -+ - #ifndef WITH_TSC - - #define READ_TIMESTAMP(var) -@@ -655,6 +659,69 @@ PyEval_EvalCode(PyCodeObject *co, PyObje - NULL, NULL); - } - -+#ifdef WITH_DTRACE -+struct frame_marker_info -+{ -+ char *filename; -+ char *name; -+ int lineno; -+ -+ PyObject *utf8_filename; -+ PyObject *utf8_name; -+}; -+ -+static void -+get_frame_marker_info(PyFrameObject *f, struct frame_marker_info *fmi) -+{ -+ fmi->utf8_filename = PyUnicode_AsUTF8String(f->f_code->co_filename); -+ if (fmi->utf8_filename) { -+ fmi->filename = PyBytes_AsString(fmi->utf8_filename); -+ } else { -+ fmi->filename = NULL; -+ /* FIXME: clear the exception? */ -+ } -+ -+ fmi->utf8_name = PyUnicode_AsUTF8String(f->f_code->co_name); -+ if (fmi->utf8_name) { -+ fmi->name = PyBytes_AsString(fmi->utf8_name); -+ } else { -+ fmi->name = NULL; -+ /* FIXME: clear the exception? */ -+ } -+ -+ fmi->lineno = PyCode_Addr2Line(f->f_code, f->f_lasti); -+} -+ -+static void -+release_frame_marker_info(struct frame_marker_info *fmi) -+{ -+ Py_XDECREF(fmi->utf8_filename); -+ Py_XDECREF(fmi->utf8_name); -+} -+ -+static void -+dtrace_entry(PyFrameObject *f) -+{ -+ struct frame_marker_info fmi; -+ get_frame_marker_info(f, &fmi); -+ PYTHON_FUNCTION_ENTRY(fmi.filename, fmi.name, fmi.lineno); -+ release_frame_marker_info(&fmi); -+} -+ -+static void -+dtrace_return(PyFrameObject *f) -+{ -+ struct frame_marker_info fmi; -+ get_frame_marker_info(f, &fmi); -+ PYTHON_FUNCTION_RETURN(fmi.filename, fmi.name, fmi.lineno); -+ release_frame_marker_info(&fmi); -+} -+#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 */ - -@@ -1061,6 +1128,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; -@@ -2907,6 +2977,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-3.1.1-with-system-expat.patch b/python-3.1.1-with-system-expat.patch deleted file mode 100644 index 1c99bf9..0000000 --- a/python-3.1.1-with-system-expat.patch +++ /dev/null @@ -1,67 +0,0 @@ -diff -up Python-3.1.1/configure.in.expat Python-3.1.1/configure.in ---- Python-3.1.1/configure.in.expat 2010-01-25 23:02:05.488859572 -0500 -+++ Python-3.1.1/configure.in 2010-01-25 23:02:21.425857866 -0500 -@@ -1853,6 +1853,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-3.1.1/setup.py.expat Python-3.1.1/setup.py ---- Python-3.1.1/setup.py.expat 2010-01-25 23:02:11.254859198 -0500 -+++ Python-3.1.1/setup.py 2010-01-25 23:02:21.426857993 -0500 -@@ -1110,19 +1110,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 -@@ -1132,7 +1139,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-3.1.2-CVE-2008-5983.patch b/python-3.1.2-CVE-2008-5983.patch deleted file mode 100644 index f33cebb..0000000 --- a/python-3.1.2-CVE-2008-5983.patch +++ /dev/null @@ -1,120 +0,0 @@ -diff -up Python-3.1.2/Doc/c-api/init.rst.CVE-2008-5983 Python-3.1.2/Doc/c-api/init.rst ---- Python-3.1.2/Doc/c-api/init.rst.CVE-2008-5983 2010-01-09 13:48:46.000000000 -0500 -+++ Python-3.1.2/Doc/c-api/init.rst 2010-06-04 15:19:26.724089244 -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:`builtins`, :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. - -@@ -344,7 +345,7 @@ Initialization, Finalization, and Thread - ``sys.version``. - - --.. cfunction:: void PySys_SetArgv(int argc, wchar_t **argv) -+.. cfunction:: void PySys_SetArgvEx(int argc, wchar_t **argv, int updatepath) - - .. index:: - single: main() -@@ -359,14 +360,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 `_. -+ -+ On versions before 3.1.3, 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:: 3.1.3 - - .. XXX impl. doesn't seem consistent in allowing 0/NULL for the params; - check w/ Guido. - - -+.. cfunction:: void PySys_SetArgv(int argc, wchar_t **argv) -+ -+ This function works like :cfunc:`PySys_SetArgv` with *updatepath* set to 1. -+ -+ - .. cfunction:: void Py_SetPythonHome(wchar_t *home) - - Set the default "home" directory, that is, the location of the standard -diff -up Python-3.1.2/Include/sysmodule.h.CVE-2008-5983 Python-3.1.2/Include/sysmodule.h ---- Python-3.1.2/Include/sysmodule.h.CVE-2008-5983 2008-04-13 09:53:33.000000000 -0400 -+++ Python-3.1.2/Include/sysmodule.h 2010-06-04 15:19:26.721088968 -0400 -@@ -10,6 +10,7 @@ extern "C" { - PyAPI_FUNC(PyObject *) PySys_GetObject(const char *); - PyAPI_FUNC(int) PySys_SetObject(const char *, PyObject *); - PyAPI_FUNC(void) PySys_SetArgv(int, wchar_t **); -+PyAPI_FUNC(void) PySys_SetArgvEx(int, wchar_t **, int); - PyAPI_FUNC(void) PySys_SetPath(const wchar_t *); - - PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...) -diff -up Python-3.1.2/Misc/NEWS.CVE-2008-5983 Python-3.1.2/Misc/NEWS -diff -up Python-3.1.2/Python/sysmodule.c.CVE-2008-5983 Python-3.1.2/Python/sysmodule.c ---- Python-3.1.2/Python/sysmodule.c.CVE-2008-5983 2010-06-04 15:19:26.000000000 -0400 -+++ Python-3.1.2/Python/sysmodule.c 2010-06-04 15:20:59.932964188 -0400 -@@ -1561,7 +1561,7 @@ _wrealpath(const wchar_t *path, wchar_t - #endif - - void --PySys_SetArgv(int argc, wchar_t **argv) -+PySys_SetArgvEx(int argc, wchar_t **argv, int updatepath) - { - #if defined(HAVE_REALPATH) - wchar_t fullpath[MAXPATHLEN]; -@@ -1574,7 +1574,7 @@ PySys_SetArgv(int argc, wchar_t **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) { - wchar_t *argv0 = argv[0]; - wchar_t *p = NULL; - Py_ssize_t n = 0; -@@ -1661,6 +1661,12 @@ PySys_SetArgv(int argc, wchar_t **argv) - Py_DECREF(av); - } - -+void -+PySys_SetArgv(int argc, wchar_t **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-3.1.2-CVE-2010-1634.patch b/python-3.1.2-CVE-2010-1634.patch deleted file mode 100644 index f3de6ea..0000000 --- a/python-3.1.2-CVE-2010-1634.patch +++ /dev/null @@ -1,209 +0,0 @@ ---- python/branches/py3k/Modules/audioop.c 2010/05/09 15:52:27 81032 -+++ python/branches/py3k/Modules/audioop.c 2010/05/11 13:09:58 81081 -@@ -834,7 +834,7 @@ - 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; -@@ -851,14 +851,13 @@ - 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 = PyBytes_FromStringAndSize(NULL, new_len); -+ rv = PyBytes_FromStringAndSize(NULL, len*2); - if ( rv == 0 ) - return 0; - ncp = (signed char *)PyBytes_AsString(rv); -@@ -1021,7 +1020,7 @@ - { - 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; - -@@ -1035,13 +1034,12 @@ - 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 = PyBytes_FromStringAndSize(NULL, new_len); -+ rv = PyBytes_FromStringAndSize(NULL, (len/size)*size2); - if ( rv == 0 ) - return 0; - ncp = (unsigned char *)PyBytes_AsString(rv); -@@ -1077,7 +1075,6 @@ - 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; -@@ -1120,14 +1117,13 @@ - inrate /= d; - outrate /= d; - -- alloc_size = sizeof(int) * (unsigned)nchannels; -- if (alloc_size < (unsigned)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; -@@ -1164,25 +1160,16 @@ - 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 = PyBytes_FromStringAndSize(NULL, nbytes); -+ str = PyBytes_FromStringAndSize(NULL, -+ q * outrate * bytes_per_frame); - - if (str == NULL) { - PyErr_SetString(PyExc_MemoryError, -@@ -1300,7 +1287,7 @@ - unsigned char *cp; - unsigned char cval; - signed char *ncp; -- int len, new_len, size, val; -+ int len, size, val; - PyObject *rv; - int i; - -@@ -1313,18 +1300,17 @@ - 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 = PyBytes_FromStringAndSize(NULL, new_len); -+ rv = PyBytes_FromStringAndSize(NULL, len*size); - if ( rv == 0 ) - return 0; - ncp = (signed char *)PyBytes_AsString(rv); - -- for ( i=0; i < new_len; i += size ) { -+ for ( i=0; i < len*size; i += size ) { - cval = *cp++; - val = st_ulaw2linear16(cval); - -@@ -1374,7 +1360,7 @@ - unsigned char *cp; - unsigned char cval; - signed char *ncp; -- int len, new_len, size, val; -+ int len, size, val; - PyObject *rv; - int i; - -@@ -1387,18 +1373,17 @@ - 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 = PyBytes_FromStringAndSize(NULL, new_len); -+ rv = PyBytes_FromStringAndSize(NULL, len*size); - if ( rv == 0 ) - return 0; - ncp = (signed char *)PyBytes_AsString(rv); - -- for ( i=0; i < new_len; i += size ) { -+ for ( i=0; i < len*size; i += size ) { - cval = *cp++; - val = st_alaw2linear16(cval); - -@@ -1523,7 +1508,7 @@ - { - 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; - -@@ -1545,13 +1530,12 @@ - } 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 = PyBytes_FromStringAndSize(NULL, new_len); -+ str = PyBytes_FromStringAndSize(NULL, len*size*2); - if ( str == 0 ) - return 0; - ncp = (signed char *)PyBytes_AsString(str); -@@ -1559,7 +1543,7 @@ - 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-3.1.2-CVE-2010-2089.patch b/python-3.1.2-CVE-2010-2089.patch deleted file mode 100644 index f0098c4..0000000 --- a/python-3.1.2-CVE-2010-2089.patch +++ /dev/null @@ -1,313 +0,0 @@ -diff -up Python-3.1.2/Modules/audioop.c.CVE-2010-2089 Python-3.1.2/Modules/audioop.c ---- Python-3.1.2/Modules/audioop.c.CVE-2010-2089 2010-06-04 14:55:04.281964205 -0400 -+++ Python-3.1.2/Modules/audioop.c 2010-06-04 15:04:32.896088959 -0400 -@@ -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, PyObje - - 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 *ar - - 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 0,1 */ - for ( i=0; i INT_MAX/size2) { - PyErr_SetString(PyExc_MemoryError, -@@ -1082,10 +1101,8 @@ audioop_ratecv(PyObject *self, PyObject - &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; -@@ -1261,10 +1278,8 @@ audioop_lin2ulaw(PyObject *self, PyObjec - &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 = PyBytes_FromStringAndSize(NULL, len/size); - if ( rv == 0 ) -@@ -1295,10 +1310,8 @@ audioop_ulaw2lin(PyObject *self, PyObjec - &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; - - if (len > INT_MAX/size) { - PyErr_SetString(PyExc_MemoryError, -@@ -1334,10 +1347,8 @@ audioop_lin2alaw(PyObject *self, PyObjec - &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 = PyBytes_FromStringAndSize(NULL, len/size); - if ( rv == 0 ) -@@ -1368,10 +1379,8 @@ audioop_alaw2lin(PyObject *self, PyObjec - &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; - - if (len > INT_MAX/size) { - PyErr_SetString(PyExc_MemoryError, -@@ -1409,10 +1418,8 @@ audioop_lin2adpcm(PyObject *self, PyObje - 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 = PyBytes_FromStringAndSize(NULL, len/(size*2)); - if ( str == 0 ) -@@ -1516,10 +1523,8 @@ audioop_adpcm2lin(PyObject *self, PyObje - &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 ) { diff --git a/python-3.1.2-reformat-audioop.c.patch b/python-3.1.2-reformat-audioop.c.patch deleted file mode 100644 index 8592650..0000000 --- a/python-3.1.2-reformat-audioop.c.patch +++ /dev/null @@ -1,2727 +0,0 @@ ---- python/branches/py3k/Modules/audioop.c 2009/05/16 01:46:11 72674 -+++ python/branches/py3k/Modules/audioop.c 2010/05/09 15:52:27 81032 -@@ -53,13 +53,13 @@ - static PyInt16 - search(PyInt16 val, PyInt16 *table, int size) - { -- int i; -+ int i; - -- for (i = 0; i < size; i++) { -- if (val <= *table++) -- return (i); -- } -- return (size); -+ for (i = 0; i < size; i++) { -+ if (val <= *table++) -+ return (i); -+ } -+ return (size); - } - #define st_ulaw2linear16(uc) (_st_ulaw2linear16[uc]) - #define st_alaw2linear16(uc) (_st_alaw2linear16[uc]) -@@ -83,7 +83,7 @@ - -228, -212, -196, -180, -164, -148, -132, - -120, -112, -104, -96, -88, -80, -72, - -64, -56, -48, -40, -32, -24, -16, -- -8, 0, 32124, 31100, 30076, 29052, 28028, -+ -8, 0, 32124, 31100, 30076, 29052, 28028, - 27004, 25980, 24956, 23932, 22908, 21884, 20860, - 19836, 18812, 17788, 16764, 15996, 15484, 14972, - 14460, 13948, 13436, 12924, 12412, 11900, 11388, -@@ -100,8 +100,8 @@ - 372, 356, 340, 324, 308, 292, 276, - 260, 244, 228, 212, 196, 180, 164, - 148, 132, 120, 112, 104, 96, 88, -- 80, 72, 64, 56, 48, 40, 32, -- 24, 16, 8, 0 -+ 80, 72, 64, 56, 48, 40, 32, -+ 24, 16, 8, 0 - }; - - /* -@@ -137,39 +137,39 @@ - * John Wiley & Sons, pps 98-111 and 472-476. - */ - static unsigned char --st_14linear2ulaw(PyInt16 pcm_val) /* 2's complement (14-bit range) */ -+st_14linear2ulaw(PyInt16 pcm_val) /* 2's complement (14-bit range) */ - { -- PyInt16 mask; -- PyInt16 seg; -- unsigned char uval; -- -- /* The original sox code does this in the calling function, not here */ -- pcm_val = pcm_val >> 2; -- -- /* u-law inverts all bits */ -- /* Get the sign and the magnitude of the value. */ -- if (pcm_val < 0) { -- pcm_val = -pcm_val; -- mask = 0x7F; -- } else { -- mask = 0xFF; -- } -- if ( pcm_val > CLIP ) pcm_val = CLIP; /* clip the magnitude */ -- pcm_val += (BIAS >> 2); -- -- /* Convert the scaled magnitude to segment number. */ -- seg = search(pcm_val, seg_uend, 8); -- -- /* -- * Combine the sign, segment, quantization bits; -- * and complement the code word. -- */ -- if (seg >= 8) /* out of range, return maximum value. */ -- return (unsigned char) (0x7F ^ mask); -- else { -- uval = (unsigned char) (seg << 4) | ((pcm_val >> (seg + 1)) & 0xF); -- return (uval ^ mask); -- } -+ PyInt16 mask; -+ PyInt16 seg; -+ unsigned char uval; -+ -+ /* The original sox code does this in the calling function, not here */ -+ pcm_val = pcm_val >> 2; -+ -+ /* u-law inverts all bits */ -+ /* Get the sign and the magnitude of the value. */ -+ if (pcm_val < 0) { -+ pcm_val = -pcm_val; -+ mask = 0x7F; -+ } else { -+ mask = 0xFF; -+ } -+ if ( pcm_val > CLIP ) pcm_val = CLIP; /* clip the magnitude */ -+ pcm_val += (BIAS >> 2); -+ -+ /* Convert the scaled magnitude to segment number. */ -+ seg = search(pcm_val, seg_uend, 8); -+ -+ /* -+ * Combine the sign, segment, quantization bits; -+ * and complement the code word. -+ */ -+ if (seg >= 8) /* out of range, return maximum value. */ -+ return (unsigned char) (0x7F ^ mask); -+ else { -+ uval = (unsigned char) (seg << 4) | ((pcm_val >> (seg + 1)) & 0xF); -+ return (uval ^ mask); -+ } - - } - -@@ -234,59 +234,59 @@ - * John Wiley & Sons, pps 98-111 and 472-476. - */ - static unsigned char --st_linear2alaw(PyInt16 pcm_val) /* 2's complement (13-bit range) */ -+st_linear2alaw(PyInt16 pcm_val) /* 2's complement (13-bit range) */ - { -- PyInt16 mask; -- short seg; -- unsigned char aval; -- -- /* The original sox code does this in the calling function, not here */ -- pcm_val = pcm_val >> 3; -- -- /* A-law using even bit inversion */ -- if (pcm_val >= 0) { -- mask = 0xD5; /* sign (7th) bit = 1 */ -- } else { -- mask = 0x55; /* sign bit = 0 */ -- pcm_val = -pcm_val - 1; -- } -- -- /* Convert the scaled magnitude to segment number. */ -- seg = search(pcm_val, seg_aend, 8); -- -- /* Combine the sign, segment, and quantization bits. */ -- -- if (seg >= 8) /* out of range, return maximum value. */ -- return (unsigned char) (0x7F ^ mask); -- else { -- aval = (unsigned char) seg << SEG_SHIFT; -- if (seg < 2) -- aval |= (pcm_val >> 1) & QUANT_MASK; -- else -- aval |= (pcm_val >> seg) & QUANT_MASK; -- return (aval ^ mask); -- } -+ PyInt16 mask; -+ short seg; -+ unsigned char aval; -+ -+ /* The original sox code does this in the calling function, not here */ -+ pcm_val = pcm_val >> 3; -+ -+ /* A-law using even bit inversion */ -+ if (pcm_val >= 0) { -+ mask = 0xD5; /* sign (7th) bit = 1 */ -+ } else { -+ mask = 0x55; /* sign bit = 0 */ -+ pcm_val = -pcm_val - 1; -+ } -+ -+ /* Convert the scaled magnitude to segment number. */ -+ seg = search(pcm_val, seg_aend, 8); -+ -+ /* Combine the sign, segment, and quantization bits. */ -+ -+ if (seg >= 8) /* out of range, return maximum value. */ -+ return (unsigned char) (0x7F ^ mask); -+ else { -+ aval = (unsigned char) seg << SEG_SHIFT; -+ if (seg < 2) -+ aval |= (pcm_val >> 1) & QUANT_MASK; -+ else -+ aval |= (pcm_val >> seg) & QUANT_MASK; -+ return (aval ^ mask); -+ } - } - /* End of code taken from sox */ - - /* Intel ADPCM step variation table */ - static int indexTable[16] = { -- -1, -1, -1, -1, 2, 4, 6, 8, -- -1, -1, -1, -1, 2, 4, 6, 8, -+ -1, -1, -1, -1, 2, 4, 6, 8, -+ -1, -1, -1, -1, 2, 4, 6, 8, - }; - - static int stepsizeTable[89] = { -- 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, -- 19, 21, 23, 25, 28, 31, 34, 37, 41, 45, -- 50, 55, 60, 66, 73, 80, 88, 97, 107, 118, -- 130, 143, 157, 173, 190, 209, 230, 253, 279, 307, -- 337, 371, 408, 449, 494, 544, 598, 658, 724, 796, -- 876, 963, 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066, -- 2272, 2499, 2749, 3024, 3327, 3660, 4026, 4428, 4871, 5358, -- 5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899, -- 15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767 -+ 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, -+ 19, 21, 23, 25, 28, 31, 34, 37, 41, 45, -+ 50, 55, 60, 66, 73, 80, 88, 97, 107, 118, -+ 130, 143, 157, 173, 190, 209, 230, 253, 279, 307, -+ 337, 371, 408, 449, 494, 544, 598, 658, 724, 796, -+ 876, 963, 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066, -+ 2272, 2499, 2749, 3024, 3327, 3660, 4026, 4428, 4871, 5358, -+ 5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899, -+ 15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767 - }; -- -+ - #define CHARP(cp, i) ((signed char *)(cp+i)) - #define SHORTP(cp, i) ((short *)(cp+i)) - #define LONGP(cp, i) ((Py_Int32 *)(cp+i)) -@@ -298,137 +298,137 @@ - static PyObject * - audioop_getsample(PyObject *self, PyObject *args) - { -- signed char *cp; -- int len, size, val = 0; -- int i; -- -- 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 ( i < 0 || i >= len/size ) { -- PyErr_SetString(AudioopError, "Index out of range"); -- return 0; -- } -- if ( size == 1 ) val = (int)*CHARP(cp, i); -- else if ( size == 2 ) val = (int)*SHORTP(cp, i*2); -- else if ( size == 4 ) val = (int)*LONGP(cp, i*4); -- return PyLong_FromLong(val); -+ signed char *cp; -+ int len, size, val = 0; -+ int i; -+ -+ 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 ( i < 0 || i >= len/size ) { -+ PyErr_SetString(AudioopError, "Index out of range"); -+ return 0; -+ } -+ if ( size == 1 ) val = (int)*CHARP(cp, i); -+ else if ( size == 2 ) val = (int)*SHORTP(cp, i*2); -+ else if ( size == 4 ) val = (int)*LONGP(cp, i*4); -+ return PyLong_FromLong(val); - } - - static PyObject * - audioop_max(PyObject *self, PyObject *args) - { -- signed char *cp; -- int len, size, val = 0; -- int i; -- int max = 0; -- -- 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; -- } -- for ( i=0; i max ) max = val; -- } -- return PyLong_FromLong(max); -+ signed char *cp; -+ int len, size, val = 0; -+ int i; -+ int max = 0; -+ -+ 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; -+ } -+ for ( i=0; i max ) max = val; -+ } -+ return PyLong_FromLong(max); - } - - static PyObject * - audioop_minmax(PyObject *self, PyObject *args) - { -- signed char *cp; -- int len, size, val = 0; -- int i; -- int min = 0x7fffffff, max = -0x7fffffff; -- -- 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"); -- 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); -- else if (size == 4) val = (int) *LONGP(cp, i); -- if (val > max) max = val; -- if (val < min) min = val; -- } -- return Py_BuildValue("(ii)", min, max); -+ signed char *cp; -+ int len, size, val = 0; -+ int i; -+ int min = 0x7fffffff, max = -0x7fffffff; -+ -+ 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"); -+ 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); -+ else if (size == 4) val = (int) *LONGP(cp, i); -+ if (val > max) max = val; -+ if (val < min) min = val; -+ } -+ return Py_BuildValue("(ii)", min, max); - } - - static PyObject * - audioop_avg(PyObject *self, PyObject *args) - { -- signed char *cp; -- int len, size, val = 0; -- int i; -- double avg = 0.0; -- -- 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; -- } -- for ( i=0; i>= 1; -- len2 >>= 1; -- -- if ( len1 < len2 ) { -- PyErr_SetString(AudioopError, "First sample should be longer"); -- return 0; -- } -- sum_ri_2 = _sum2(cp2, cp2, len2); -- sum_aij_2 = _sum2(cp1, cp1, len2); -- sum_aij_ri = _sum2(cp1, cp2, len2); -- -- result = (sum_ri_2*sum_aij_2 - sum_aij_ri*sum_aij_ri) / sum_aij_2; -- -- best_result = result; -- best_j = 0; -- j = 0; -- -- for ( j=1; j<=len1-len2; j++) { -- aj_m1 = (double)cp1[j-1]; -- aj_lm1 = (double)cp1[j+len2-1]; -- -- sum_aij_2 = sum_aij_2 + aj_lm1*aj_lm1 - aj_m1*aj_m1; -- sum_aij_ri = _sum2(cp1+j, cp2, len2); -- -- result = (sum_ri_2*sum_aij_2 - sum_aij_ri*sum_aij_ri) -- / sum_aij_2; -- -- if ( result < best_result ) { -- best_result = result; -- best_j = j; -- } -- -+ short *cp1, *cp2; -+ int len1, len2; -+ int j, best_j; -+ double aj_m1, aj_lm1; -+ double sum_ri_2, sum_aij_2, sum_aij_ri, result, best_result, factor; -+ -+ /* Passing a short** for an 's' argument is correct only -+ if the string contents is aligned for interpretation -+ as short[]. Due to the definition of PyBytesObject, -+ this is currently (Python 2.6) the case. */ -+ if ( !PyArg_ParseTuple(args, "s#s#:findfit", -+ (char**)&cp1, &len1, (char**)&cp2, &len2) ) -+ return 0; -+ if ( len1 & 1 || len2 & 1 ) { -+ PyErr_SetString(AudioopError, "Strings should be even-sized"); -+ return 0; -+ } -+ len1 >>= 1; -+ len2 >>= 1; -+ -+ if ( len1 < len2 ) { -+ PyErr_SetString(AudioopError, "First sample should be longer"); -+ return 0; -+ } -+ sum_ri_2 = _sum2(cp2, cp2, len2); -+ sum_aij_2 = _sum2(cp1, cp1, len2); -+ sum_aij_ri = _sum2(cp1, cp2, len2); -+ -+ result = (sum_ri_2*sum_aij_2 - sum_aij_ri*sum_aij_ri) / sum_aij_2; -+ -+ best_result = result; -+ best_j = 0; -+ j = 0; -+ -+ for ( j=1; j<=len1-len2; j++) { -+ aj_m1 = (double)cp1[j-1]; -+ aj_lm1 = (double)cp1[j+len2-1]; -+ -+ sum_aij_2 = sum_aij_2 + aj_lm1*aj_lm1 - aj_m1*aj_m1; -+ sum_aij_ri = _sum2(cp1+j, cp2, len2); -+ -+ result = (sum_ri_2*sum_aij_2 - sum_aij_ri*sum_aij_ri) -+ / sum_aij_2; -+ -+ if ( result < best_result ) { -+ best_result = result; -+ best_j = j; - } - -- factor = _sum2(cp1+best_j, cp2, len2) / sum_ri_2; -- -- return Py_BuildValue("(if)", best_j, factor); -+ } -+ -+ factor = _sum2(cp1+best_j, cp2, len2) / sum_ri_2; -+ -+ return Py_BuildValue("(if)", best_j, factor); - } - - /* -@@ -529,28 +529,28 @@ - static PyObject * - audioop_findfactor(PyObject *self, PyObject *args) - { -- short *cp1, *cp2; -- int len1, len2; -- double sum_ri_2, sum_aij_ri, result; -- -- if ( !PyArg_ParseTuple(args, "s#s#:findfactor", -- (char**)&cp1, &len1, (char**)&cp2, &len2) ) -- return 0; -- if ( len1 & 1 || len2 & 1 ) { -- PyErr_SetString(AudioopError, "Strings should be even-sized"); -- return 0; -- } -- if ( len1 != len2 ) { -- PyErr_SetString(AudioopError, "Samples should be same size"); -- return 0; -- } -- len2 >>= 1; -- sum_ri_2 = _sum2(cp2, cp2, len2); -- sum_aij_ri = _sum2(cp1, cp2, len2); -+ short *cp1, *cp2; -+ int len1, len2; -+ double sum_ri_2, sum_aij_ri, result; -+ -+ if ( !PyArg_ParseTuple(args, "s#s#:findfactor", -+ (char**)&cp1, &len1, (char**)&cp2, &len2) ) -+ return 0; -+ if ( len1 & 1 || len2 & 1 ) { -+ PyErr_SetString(AudioopError, "Strings should be even-sized"); -+ return 0; -+ } -+ if ( len1 != len2 ) { -+ PyErr_SetString(AudioopError, "Samples should be same size"); -+ return 0; -+ } -+ len2 >>= 1; -+ sum_ri_2 = _sum2(cp2, cp2, len2); -+ sum_aij_ri = _sum2(cp1, cp2, len2); - -- result = sum_aij_ri / sum_ri_2; -+ result = sum_aij_ri / sum_ri_2; - -- return PyFloat_FromDouble(result); -+ return PyFloat_FromDouble(result); - } - - /* -@@ -560,1114 +560,1114 @@ - static PyObject * - audioop_findmax(PyObject *self, PyObject *args) - { -- short *cp1; -- int len1, len2; -- int j, best_j; -- double aj_m1, aj_lm1; -- double result, best_result; -- -- if ( !PyArg_ParseTuple(args, "s#i:findmax", -- (char**)&cp1, &len1, &len2) ) -- return 0; -- if ( len1 & 1 ) { -- PyErr_SetString(AudioopError, "Strings should be even-sized"); -- return 0; -+ short *cp1; -+ int len1, len2; -+ int j, best_j; -+ double aj_m1, aj_lm1; -+ double result, best_result; -+ -+ if ( !PyArg_ParseTuple(args, "s#i:findmax", -+ (char**)&cp1, &len1, &len2) ) -+ return 0; -+ if ( len1 & 1 ) { -+ PyErr_SetString(AudioopError, "Strings should be even-sized"); -+ return 0; -+ } -+ len1 >>= 1; -+ -+ if ( len2 < 0 || len1 < len2 ) { -+ PyErr_SetString(AudioopError, "Input sample should be longer"); -+ return 0; -+ } -+ -+ result = _sum2(cp1, cp1, len2); -+ -+ best_result = result; -+ best_j = 0; -+ j = 0; -+ -+ for ( j=1; j<=len1-len2; j++) { -+ aj_m1 = (double)cp1[j-1]; -+ aj_lm1 = (double)cp1[j+len2-1]; -+ -+ result = result + aj_lm1*aj_lm1 - aj_m1*aj_m1; -+ -+ if ( result > best_result ) { -+ best_result = result; -+ best_j = j; - } -- len1 >>= 1; -- -- if ( len2 < 0 || len1 < len2 ) { -- PyErr_SetString(AudioopError, "Input sample should be longer"); -- return 0; -- } -- -- result = _sum2(cp1, cp1, len2); - -- best_result = result; -- best_j = 0; -- j = 0; -- -- for ( j=1; j<=len1-len2; j++) { -- aj_m1 = (double)cp1[j-1]; -- aj_lm1 = (double)cp1[j+len2-1]; -- -- result = result + aj_lm1*aj_lm1 - aj_m1*aj_m1; -- -- if ( result > best_result ) { -- best_result = result; -- best_j = j; -- } -- -- } -+ } - -- return PyLong_FromLong(best_j); -+ return PyLong_FromLong(best_j); - } - - static PyObject * - audioop_avgpp(PyObject *self, PyObject *args) - { -- signed char *cp; -- int len, size, val = 0, prevval = 0, prevextremevalid = 0, -- prevextreme = 0; -- int i; -- double avg = 0.0; -- int diff, prevdiff, extremediff, nextreme = 0; -- -- 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; -- } -- /* Compute first delta value ahead. Also automatically makes us -- ** skip the first extreme value -- */ -- if ( size == 1 ) prevval = (int)*CHARP(cp, 0); -- else if ( size == 2 ) prevval = (int)*SHORTP(cp, 0); -- else if ( size == 4 ) prevval = (int)*LONGP(cp, 0); -- if ( size == 1 ) val = (int)*CHARP(cp, size); -- else if ( size == 2 ) val = (int)*SHORTP(cp, size); -- else if ( size == 4 ) val = (int)*LONGP(cp, size); -- prevdiff = val - prevval; -- -- for ( i=size; i max ) -- max = extremediff; -- } -- prevextremevalid = 1; -- prevextreme = prevval; -- } -- prevval = val; -- if ( diff != 0 ) -- prevdiff = diff; -- } -- return PyLong_FromLong(max); -+ signed char *cp; -+ int len, size, val = 0, prevval = 0, prevextremevalid = 0, -+ prevextreme = 0; -+ int i; -+ int max = 0; -+ int diff, prevdiff, extremediff; -+ -+ 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; -+ } -+ /* Compute first delta value ahead. Also automatically makes us -+ ** skip the first extreme value -+ */ -+ if ( size == 1 ) prevval = (int)*CHARP(cp, 0); -+ else if ( size == 2 ) prevval = (int)*SHORTP(cp, 0); -+ else if ( size == 4 ) prevval = (int)*LONGP(cp, 0); -+ if ( size == 1 ) val = (int)*CHARP(cp, size); -+ else if ( size == 2 ) val = (int)*SHORTP(cp, size); -+ else if ( size == 4 ) val = (int)*LONGP(cp, size); -+ prevdiff = val - prevval; -+ -+ for ( i=size; i max ) -+ max = extremediff; -+ } -+ prevextremevalid = 1; -+ prevextreme = prevval; -+ } -+ prevval = val; -+ if ( diff != 0 ) -+ prevdiff = diff; -+ } -+ return PyLong_FromLong(max); - } - - static PyObject * - audioop_cross(PyObject *self, PyObject *args) - { -- signed char *cp; -- int len, size, val = 0; -- int i; -- int prevval, ncross; -- -- 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; -- } -- ncross = -1; -- prevval = 17; /* Anything <> 0,1 */ -- for ( i=0; i> 7; -- else if ( size == 2 ) val = ((int)*SHORTP(cp, i)) >> 15; -- else if ( size == 4 ) val = ((int)*LONGP(cp, i)) >> 31; -- val = val & 1; -- if ( val != prevval ) ncross++; -- prevval = val; -- } -- return PyLong_FromLong(ncross); -+ signed char *cp; -+ int len, size, val = 0; -+ int i; -+ int prevval, ncross; -+ -+ 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; -+ } -+ ncross = -1; -+ prevval = 17; /* Anything <> 0,1 */ -+ for ( i=0; i> 7; -+ else if ( size == 2 ) val = ((int)*SHORTP(cp, i)) >> 15; -+ else if ( size == 4 ) val = ((int)*LONGP(cp, i)) >> 31; -+ val = val & 1; -+ if ( val != prevval ) ncross++; -+ prevval = val; -+ } -+ return PyLong_FromLong(ncross); - } - - static PyObject * - audioop_mul(PyObject *self, PyObject *args) - { -- signed char *cp, *ncp; -- int len, size, val = 0; -- double factor, fval, maxval; -- PyObject *rv; -- int i; -- -- if ( !PyArg_ParseTuple(args, "s#id:mul", &cp, &len, &size, &factor ) ) -- return 0; -- -- if ( size == 1 ) maxval = (double) 0x7f; -- else if ( size == 2 ) maxval = (double) 0x7fff; -- else if ( size == 4 ) maxval = (double) 0x7fffffff; -- else { -- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4"); -- return 0; -- } -- -- rv = PyBytes_FromStringAndSize(NULL, len); -- if ( rv == 0 ) -- return 0; -- ncp = (signed char *)PyBytes_AsString(rv); -- -- -- for ( i=0; i < len; i += size ) { -- if ( size == 1 ) val = (int)*CHARP(cp, i); -- else if ( size == 2 ) val = (int)*SHORTP(cp, i); -- else if ( size == 4 ) val = (int)*LONGP(cp, i); -- fval = (double)val*factor; -- if ( fval > maxval ) fval = maxval; -- else if ( fval < -maxval ) fval = -maxval; -- val = (int)fval; -- if ( size == 1 ) *CHARP(ncp, i) = (signed char)val; -- else if ( size == 2 ) *SHORTP(ncp, i) = (short)val; -- else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)val; -- } -- return rv; -+ signed char *cp, *ncp; -+ int len, size, val = 0; -+ double factor, fval, maxval; -+ PyObject *rv; -+ int i; -+ -+ if ( !PyArg_ParseTuple(args, "s#id:mul", &cp, &len, &size, &factor ) ) -+ return 0; -+ -+ if ( size == 1 ) maxval = (double) 0x7f; -+ else if ( size == 2 ) maxval = (double) 0x7fff; -+ else if ( size == 4 ) maxval = (double) 0x7fffffff; -+ else { -+ PyErr_SetString(AudioopError, "Size should be 1, 2 or 4"); -+ return 0; -+ } -+ -+ rv = PyBytes_FromStringAndSize(NULL, len); -+ if ( rv == 0 ) -+ return 0; -+ ncp = (signed char *)PyBytes_AsString(rv); -+ -+ -+ for ( i=0; i < len; i += size ) { -+ if ( size == 1 ) val = (int)*CHARP(cp, i); -+ else if ( size == 2 ) val = (int)*SHORTP(cp, i); -+ else if ( size == 4 ) val = (int)*LONGP(cp, i); -+ fval = (double)val*factor; -+ if ( fval > maxval ) fval = maxval; -+ else if ( fval < -maxval ) fval = -maxval; -+ val = (int)fval; -+ if ( size == 1 ) *CHARP(ncp, i) = (signed char)val; -+ else if ( size == 2 ) *SHORTP(ncp, i) = (short)val; -+ else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)val; -+ } -+ return rv; - } - - static PyObject * - audioop_tomono(PyObject *self, PyObject *args) - { -- Py_buffer pcp; -- signed char *cp, *ncp; -- int len, size, val1 = 0, val2 = 0; -- double fac1, fac2, fval, maxval; -- PyObject *rv; -- int i; -- -- if ( !PyArg_ParseTuple(args, "s*idd:tomono", -- &pcp, &size, &fac1, &fac2 ) ) -- return 0; -- cp = pcp.buf; -- len = pcp.len; -- -- if ( size == 1 ) maxval = (double) 0x7f; -- else if ( size == 2 ) maxval = (double) 0x7fff; -- else if ( size == 4 ) maxval = (double) 0x7fffffff; -- else { -- PyBuffer_Release(&pcp); -- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4"); -- return 0; -- } -- -- rv = PyBytes_FromStringAndSize(NULL, len/2); -- if ( rv == 0 ) -- return 0; -- ncp = (signed char *)PyBytes_AsString(rv); -- -- -- for ( i=0; i < len; i += size*2 ) { -- if ( size == 1 ) val1 = (int)*CHARP(cp, i); -- else if ( size == 2 ) val1 = (int)*SHORTP(cp, i); -- else if ( size == 4 ) val1 = (int)*LONGP(cp, i); -- if ( size == 1 ) val2 = (int)*CHARP(cp, i+1); -- else if ( size == 2 ) val2 = (int)*SHORTP(cp, i+2); -- else if ( size == 4 ) val2 = (int)*LONGP(cp, i+4); -- fval = (double)val1*fac1 + (double)val2*fac2; -- if ( fval > maxval ) fval = maxval; -- else if ( fval < -maxval ) fval = -maxval; -- val1 = (int)fval; -- if ( size == 1 ) *CHARP(ncp, i/2) = (signed char)val1; -- else if ( size == 2 ) *SHORTP(ncp, i/2) = (short)val1; -- else if ( size == 4 ) *LONGP(ncp, i/2)= (Py_Int32)val1; -- } -- PyBuffer_Release(&pcp); -- return rv; -+ Py_buffer pcp; -+ signed char *cp, *ncp; -+ int len, size, val1 = 0, val2 = 0; -+ double fac1, fac2, fval, maxval; -+ PyObject *rv; -+ int i; -+ -+ if ( !PyArg_ParseTuple(args, "s*idd:tomono", -+ &pcp, &size, &fac1, &fac2 ) ) -+ return 0; -+ cp = pcp.buf; -+ len = pcp.len; -+ -+ if ( size == 1 ) maxval = (double) 0x7f; -+ else if ( size == 2 ) maxval = (double) 0x7fff; -+ else if ( size == 4 ) maxval = (double) 0x7fffffff; -+ else { -+ PyBuffer_Release(&pcp); -+ PyErr_SetString(AudioopError, "Size should be 1, 2 or 4"); -+ return 0; -+ } -+ -+ rv = PyBytes_FromStringAndSize(NULL, len/2); -+ if ( rv == 0 ) -+ return 0; -+ ncp = (signed char *)PyBytes_AsString(rv); -+ -+ -+ for ( i=0; i < len; i += size*2 ) { -+ if ( size == 1 ) val1 = (int)*CHARP(cp, i); -+ else if ( size == 2 ) val1 = (int)*SHORTP(cp, i); -+ else if ( size == 4 ) val1 = (int)*LONGP(cp, i); -+ if ( size == 1 ) val2 = (int)*CHARP(cp, i+1); -+ else if ( size == 2 ) val2 = (int)*SHORTP(cp, i+2); -+ else if ( size == 4 ) val2 = (int)*LONGP(cp, i+4); -+ fval = (double)val1*fac1 + (double)val2*fac2; -+ if ( fval > maxval ) fval = maxval; -+ else if ( fval < -maxval ) fval = -maxval; -+ val1 = (int)fval; -+ if ( size == 1 ) *CHARP(ncp, i/2) = (signed char)val1; -+ else if ( size == 2 ) *SHORTP(ncp, i/2) = (short)val1; -+ else if ( size == 4 ) *LONGP(ncp, i/2)= (Py_Int32)val1; -+ } -+ PyBuffer_Release(&pcp); -+ return rv; - } - - static PyObject * - audioop_tostereo(PyObject *self, PyObject *args) - { -- signed char *cp, *ncp; -- int len, new_len, size, val1, val2, val = 0; -- double fac1, fac2, fval, maxval; -- PyObject *rv; -- int i; -- -- if ( !PyArg_ParseTuple(args, "s#idd:tostereo", -- &cp, &len, &size, &fac1, &fac2 ) ) -- return 0; -- -- if ( size == 1 ) maxval = (double) 0x7f; -- else if ( size == 2 ) maxval = (double) 0x7fff; -- else if ( size == 4 ) maxval = (double) 0x7fffffff; -- else { -- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4"); -- return 0; -- } -- -- new_len = len*2; -- if (new_len < 0) { -- PyErr_SetString(PyExc_MemoryError, -- "not enough memory for output buffer"); -- return 0; -- } -+ signed char *cp, *ncp; -+ int len, new_len, size, val1, val2, val = 0; -+ double fac1, fac2, fval, maxval; -+ PyObject *rv; -+ int i; -+ -+ if ( !PyArg_ParseTuple(args, "s#idd:tostereo", -+ &cp, &len, &size, &fac1, &fac2 ) ) -+ return 0; -+ -+ if ( size == 1 ) maxval = (double) 0x7f; -+ else if ( size == 2 ) maxval = (double) 0x7fff; -+ else if ( size == 4 ) maxval = (double) 0x7fffffff; -+ else { -+ PyErr_SetString(AudioopError, "Size should be 1, 2 or 4"); -+ return 0; -+ } -+ -+ new_len = len*2; -+ if (new_len < 0) { -+ PyErr_SetString(PyExc_MemoryError, -+ "not enough memory for output buffer"); -+ return 0; -+ } -+ -+ rv = PyBytes_FromStringAndSize(NULL, new_len); -+ if ( rv == 0 ) -+ return 0; -+ ncp = (signed char *)PyBytes_AsString(rv); - -- rv = PyBytes_FromStringAndSize(NULL, new_len); -- if ( rv == 0 ) -- return 0; -- ncp = (signed char *)PyBytes_AsString(rv); -- -- -- for ( i=0; i < len; i += size ) { -- if ( size == 1 ) val = (int)*CHARP(cp, i); -- else if ( size == 2 ) val = (int)*SHORTP(cp, i); -- else if ( size == 4 ) val = (int)*LONGP(cp, i); -- -- fval = (double)val*fac1; -- if ( fval > maxval ) fval = maxval; -- else if ( fval < -maxval ) fval = -maxval; -- val1 = (int)fval; -- -- fval = (double)val*fac2; -- if ( fval > maxval ) fval = maxval; -- else if ( fval < -maxval ) fval = -maxval; -- val2 = (int)fval; -- -- if ( size == 1 ) *CHARP(ncp, i*2) = (signed char)val1; -- else if ( size == 2 ) *SHORTP(ncp, i*2) = (short)val1; -- else if ( size == 4 ) *LONGP(ncp, i*2) = (Py_Int32)val1; -- -- if ( size == 1 ) *CHARP(ncp, i*2+1) = (signed char)val2; -- else if ( size == 2 ) *SHORTP(ncp, i*2+2) = (short)val2; -- else if ( size == 4 ) *LONGP(ncp, i*2+4) = (Py_Int32)val2; -- } -- return rv; -+ -+ for ( i=0; i < len; i += size ) { -+ if ( size == 1 ) val = (int)*CHARP(cp, i); -+ else if ( size == 2 ) val = (int)*SHORTP(cp, i); -+ else if ( size == 4 ) val = (int)*LONGP(cp, i); -+ -+ fval = (double)val*fac1; -+ if ( fval > maxval ) fval = maxval; -+ else if ( fval < -maxval ) fval = -maxval; -+ val1 = (int)fval; -+ -+ fval = (double)val*fac2; -+ if ( fval > maxval ) fval = maxval; -+ else if ( fval < -maxval ) fval = -maxval; -+ val2 = (int)fval; -+ -+ if ( size == 1 ) *CHARP(ncp, i*2) = (signed char)val1; -+ else if ( size == 2 ) *SHORTP(ncp, i*2) = (short)val1; -+ else if ( size == 4 ) *LONGP(ncp, i*2) = (Py_Int32)val1; -+ -+ if ( size == 1 ) *CHARP(ncp, i*2+1) = (signed char)val2; -+ else if ( size == 2 ) *SHORTP(ncp, i*2+2) = (short)val2; -+ else if ( size == 4 ) *LONGP(ncp, i*2+4) = (Py_Int32)val2; -+ } -+ return rv; - } - - static PyObject * - audioop_add(PyObject *self, PyObject *args) - { -- signed char *cp1, *cp2, *ncp; -- int len1, len2, size, val1 = 0, val2 = 0, maxval, newval; -- PyObject *rv; -- int i; -- -- if ( !PyArg_ParseTuple(args, "s#s#i:add", -- &cp1, &len1, &cp2, &len2, &size ) ) -- return 0; -- -- if ( len1 != len2 ) { -- PyErr_SetString(AudioopError, "Lengths should be the same"); -- return 0; -- } -- -- if ( size == 1 ) maxval = 0x7f; -- else if ( size == 2 ) maxval = 0x7fff; -- else if ( size == 4 ) maxval = 0x7fffffff; -- else { -- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4"); -- return 0; -- } -- -- rv = PyBytes_FromStringAndSize(NULL, len1); -- if ( rv == 0 ) -- return 0; -- ncp = (signed char *)PyBytes_AsString(rv); -- -- for ( i=0; i < len1; i += size ) { -- if ( size == 1 ) val1 = (int)*CHARP(cp1, i); -- else if ( size == 2 ) val1 = (int)*SHORTP(cp1, i); -- else if ( size == 4 ) val1 = (int)*LONGP(cp1, i); -- -- if ( size == 1 ) val2 = (int)*CHARP(cp2, i); -- else if ( size == 2 ) val2 = (int)*SHORTP(cp2, i); -- else if ( size == 4 ) val2 = (int)*LONGP(cp2, i); -- -- newval = val1 + val2; -- /* truncate in case of overflow */ -- if (newval > maxval) newval = maxval; -- else if (newval < -maxval) newval = -maxval; -- else if (size == 4 && (newval^val1) < 0 && (newval^val2) < 0) -- newval = val1 > 0 ? maxval : - maxval; -- -- if ( size == 1 ) *CHARP(ncp, i) = (signed char)newval; -- else if ( size == 2 ) *SHORTP(ncp, i) = (short)newval; -- else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)newval; -- } -- return rv; -+ signed char *cp1, *cp2, *ncp; -+ int len1, len2, size, val1 = 0, val2 = 0, maxval, newval; -+ PyObject *rv; -+ int i; -+ -+ if ( !PyArg_ParseTuple(args, "s#s#i:add", -+ &cp1, &len1, &cp2, &len2, &size ) ) -+ return 0; -+ -+ if ( len1 != len2 ) { -+ PyErr_SetString(AudioopError, "Lengths should be the same"); -+ return 0; -+ } -+ -+ if ( size == 1 ) maxval = 0x7f; -+ else if ( size == 2 ) maxval = 0x7fff; -+ else if ( size == 4 ) maxval = 0x7fffffff; -+ else { -+ PyErr_SetString(AudioopError, "Size should be 1, 2 or 4"); -+ return 0; -+ } -+ -+ rv = PyBytes_FromStringAndSize(NULL, len1); -+ if ( rv == 0 ) -+ return 0; -+ ncp = (signed char *)PyBytes_AsString(rv); -+ -+ for ( i=0; i < len1; i += size ) { -+ if ( size == 1 ) val1 = (int)*CHARP(cp1, i); -+ else if ( size == 2 ) val1 = (int)*SHORTP(cp1, i); -+ else if ( size == 4 ) val1 = (int)*LONGP(cp1, i); -+ -+ if ( size == 1 ) val2 = (int)*CHARP(cp2, i); -+ else if ( size == 2 ) val2 = (int)*SHORTP(cp2, i); -+ else if ( size == 4 ) val2 = (int)*LONGP(cp2, i); -+ -+ newval = val1 + val2; -+ /* truncate in case of overflow */ -+ if (newval > maxval) newval = maxval; -+ else if (newval < -maxval) newval = -maxval; -+ else if (size == 4 && (newval^val1) < 0 && (newval^val2) < 0) -+ newval = val1 > 0 ? maxval : - maxval; -+ -+ if ( size == 1 ) *CHARP(ncp, i) = (signed char)newval; -+ else if ( size == 2 ) *SHORTP(ncp, i) = (short)newval; -+ else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)newval; -+ } -+ return rv; - } - - static PyObject * - audioop_bias(PyObject *self, PyObject *args) - { -- signed char *cp, *ncp; -- int len, size, val = 0; -- PyObject *rv; -- int i; -- int bias; -- -- 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; -- } -- -- rv = PyBytes_FromStringAndSize(NULL, len); -- if ( rv == 0 ) -- return 0; -- ncp = (signed char *)PyBytes_AsString(rv); -- -- -- for ( i=0; i < len; i += size ) { -- if ( size == 1 ) val = (int)*CHARP(cp, i); -- else if ( size == 2 ) val = (int)*SHORTP(cp, i); -- else if ( size == 4 ) val = (int)*LONGP(cp, i); -- -- if ( size == 1 ) *CHARP(ncp, i) = (signed char)(val+bias); -- else if ( size == 2 ) *SHORTP(ncp, i) = (short)(val+bias); -- else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)(val+bias); -- } -- return rv; -+ signed char *cp, *ncp; -+ int len, size, val = 0; -+ PyObject *rv; -+ int i; -+ int bias; -+ -+ 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; -+ } -+ -+ rv = PyBytes_FromStringAndSize(NULL, len); -+ if ( rv == 0 ) -+ return 0; -+ ncp = (signed char *)PyBytes_AsString(rv); -+ -+ -+ for ( i=0; i < len; i += size ) { -+ if ( size == 1 ) val = (int)*CHARP(cp, i); -+ else if ( size == 2 ) val = (int)*SHORTP(cp, i); -+ else if ( size == 4 ) val = (int)*LONGP(cp, i); -+ -+ if ( size == 1 ) *CHARP(ncp, i) = (signed char)(val+bias); -+ else if ( size == 2 ) *SHORTP(ncp, i) = (short)(val+bias); -+ else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)(val+bias); -+ } -+ return rv; - } - - static PyObject * - audioop_reverse(PyObject *self, PyObject *args) - { -- signed char *cp; -- unsigned char *ncp; -- int len, size, val = 0; -- PyObject *rv; -- int i, j; -- -- if ( !PyArg_ParseTuple(args, "s#i:reverse", -- &cp, &len, &size) ) -- return 0; -- -- if ( size != 1 && size != 2 && size != 4 ) { -- PyErr_SetString(AudioopError, "Size should be 1, 2 or 4"); -- return 0; -- } -- -- rv = PyBytes_FromStringAndSize(NULL, len); -- if ( rv == 0 ) -- return 0; -- ncp = (unsigned char *)PyBytes_AsString(rv); -- -- for ( i=0; i < len; i += size ) { -- if ( size == 1 ) val = ((int)*CHARP(cp, i)) << 8; -- else if ( size == 2 ) val = (int)*SHORTP(cp, i); -- else if ( size == 4 ) val = ((int)*LONGP(cp, i)) >> 16; -- -- j = len - i - size; -- -- if ( size == 1 ) *CHARP(ncp, j) = (signed char)(val >> 8); -- else if ( size == 2 ) *SHORTP(ncp, j) = (short)(val); -- else if ( size == 4 ) *LONGP(ncp, j) = (Py_Int32)(val<<16); -- } -- return rv; -+ signed char *cp; -+ unsigned char *ncp; -+ int len, size, val = 0; -+ PyObject *rv; -+ int i, j; -+ -+ if ( !PyArg_ParseTuple(args, "s#i:reverse", -+ &cp, &len, &size) ) -+ return 0; -+ -+ if ( size != 1 && size != 2 && size != 4 ) { -+ PyErr_SetString(AudioopError, "Size should be 1, 2 or 4"); -+ return 0; -+ } -+ -+ rv = PyBytes_FromStringAndSize(NULL, len); -+ if ( rv == 0 ) -+ return 0; -+ ncp = (unsigned char *)PyBytes_AsString(rv); -+ -+ for ( i=0; i < len; i += size ) { -+ if ( size == 1 ) val = ((int)*CHARP(cp, i)) << 8; -+ else if ( size == 2 ) val = (int)*SHORTP(cp, i); -+ else if ( size == 4 ) val = ((int)*LONGP(cp, i)) >> 16; -+ -+ j = len - i - size; -+ -+ if ( size == 1 ) *CHARP(ncp, j) = (signed char)(val >> 8); -+ else if ( size == 2 ) *SHORTP(ncp, j) = (short)(val); -+ else if ( size == 4 ) *LONGP(ncp, j) = (Py_Int32)(val<<16); -+ } -+ return rv; - } - - static PyObject * - audioop_lin2lin(PyObject *self, PyObject *args) - { -- signed char *cp; -- unsigned char *ncp; -- int len, new_len, size, size2, val = 0; -- PyObject *rv; -- int i, j; -- -- 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; -- } -- -- new_len = (len/size)*size2; -- if (new_len < 0) { -- PyErr_SetString(PyExc_MemoryError, -- "not enough memory for output buffer"); -- return 0; -- } -- rv = PyBytes_FromStringAndSize(NULL, new_len); -- if ( rv == 0 ) -- return 0; -- ncp = (unsigned char *)PyBytes_AsString(rv); -- -- for ( i=0, j=0; i < len; i += size, j += size2 ) { -- if ( size == 1 ) val = ((int)*CHARP(cp, i)) << 8; -- else if ( size == 2 ) val = (int)*SHORTP(cp, i); -- else if ( size == 4 ) val = ((int)*LONGP(cp, i)) >> 16; -- -- if ( size2 == 1 ) *CHARP(ncp, j) = (signed char)(val >> 8); -- else if ( size2 == 2 ) *SHORTP(ncp, j) = (short)(val); -- else if ( size2 == 4 ) *LONGP(ncp, j) = (Py_Int32)(val<<16); -- } -- return rv; -+ signed char *cp; -+ unsigned char *ncp; -+ int len, new_len, size, size2, val = 0; -+ PyObject *rv; -+ int i, j; -+ -+ 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; -+ } -+ -+ new_len = (len/size)*size2; -+ if (new_len < 0) { -+ PyErr_SetString(PyExc_MemoryError, -+ "not enough memory for output buffer"); -+ return 0; -+ } -+ rv = PyBytes_FromStringAndSize(NULL, new_len); -+ if ( rv == 0 ) -+ return 0; -+ ncp = (unsigned char *)PyBytes_AsString(rv); -+ -+ for ( i=0, j=0; i < len; i += size, j += size2 ) { -+ if ( size == 1 ) val = ((int)*CHARP(cp, i)) << 8; -+ else if ( size == 2 ) val = (int)*SHORTP(cp, i); -+ else if ( size == 4 ) val = ((int)*LONGP(cp, i)) >> 16; -+ -+ if ( size2 == 1 ) *CHARP(ncp, j) = (signed char)(val >> 8); -+ else if ( size2 == 2 ) *SHORTP(ncp, j) = (short)(val); -+ else if ( size2 == 4 ) *LONGP(ncp, j) = (Py_Int32)(val<<16); -+ } -+ return rv; - } - - static int - gcd(int a, int b) - { -- while (b > 0) { -- int tmp = a % b; -- a = b; -- b = tmp; -- } -- return a; -+ while (b > 0) { -+ int tmp = a % b; -+ a = b; -+ b = tmp; -+ } -+ return a; - } - - static PyObject * - audioop_ratecv(PyObject *self, PyObject *args) - { -- char *cp, *ncp; -- int len, size, nchannels, inrate, outrate, weightA, weightB; -- 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; -- if (!PyArg_ParseTuple(args, "s#iiiiO|ii:ratecv", &cp, &len, &size, -- &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"); -- return NULL; -- } -- if (nchannels < 1) { -- PyErr_SetString(AudioopError, "# of channels should be >= 1"); -- return NULL; -- } -- bytes_per_frame = size * nchannels; -- if (bytes_per_frame / nchannels != size) { -- /* This overflow test is rigorously correct because -- both multiplicands are >= 1. Use the argument names -- from the docs for the error msg. */ -- PyErr_SetString(PyExc_OverflowError, -- "width * nchannels too big for a C int"); -- return NULL; -- } -- if (weightA < 1 || weightB < 0) { -- PyErr_SetString(AudioopError, -- "weightA should be >= 1, weightB should be >= 0"); -- return NULL; -- } -- if (len % bytes_per_frame != 0) { -- PyErr_SetString(AudioopError, "not a whole number of frames"); -- return NULL; -- } -- if (inrate <= 0 || outrate <= 0) { -- PyErr_SetString(AudioopError, "sampling rate not > 0"); -- return NULL; -- } -- /* divide inrate and outrate by their greatest common divisor */ -- d = gcd(inrate, outrate); -- inrate /= d; -- outrate /= d; -- -- alloc_size = sizeof(int) * (unsigned)nchannels; -- if (alloc_size < (unsigned)nchannels) { -- PyErr_SetString(PyExc_MemoryError, -- "not enough memory for output buffer"); -- return 0; -- } -- prev_i = (int *) malloc(alloc_size); -- cur_i = (int *) malloc(alloc_size); -- if (prev_i == NULL || cur_i == NULL) { -- (void) PyErr_NoMemory(); -+ char *cp, *ncp; -+ int len, size, nchannels, inrate, outrate, weightA, weightB; -+ 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; -+ if (!PyArg_ParseTuple(args, "s#iiiiO|ii:ratecv", &cp, &len, &size, -+ &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"); -+ return NULL; -+ } -+ if (nchannels < 1) { -+ PyErr_SetString(AudioopError, "# of channels should be >= 1"); -+ return NULL; -+ } -+ bytes_per_frame = size * nchannels; -+ if (bytes_per_frame / nchannels != size) { -+ /* This overflow test is rigorously correct because -+ both multiplicands are >= 1. Use the argument names -+ from the docs for the error msg. */ -+ PyErr_SetString(PyExc_OverflowError, -+ "width * nchannels too big for a C int"); -+ return NULL; -+ } -+ if (weightA < 1 || weightB < 0) { -+ PyErr_SetString(AudioopError, -+ "weightA should be >= 1, weightB should be >= 0"); -+ return NULL; -+ } -+ if (len % bytes_per_frame != 0) { -+ PyErr_SetString(AudioopError, "not a whole number of frames"); -+ return NULL; -+ } -+ if (inrate <= 0 || outrate <= 0) { -+ PyErr_SetString(AudioopError, "sampling rate not > 0"); -+ return NULL; -+ } -+ /* divide inrate and outrate by their greatest common divisor */ -+ d = gcd(inrate, outrate); -+ inrate /= d; -+ outrate /= d; -+ -+ alloc_size = sizeof(int) * (unsigned)nchannels; -+ if (alloc_size < (unsigned)nchannels) { -+ PyErr_SetString(PyExc_MemoryError, -+ "not enough memory for output buffer"); -+ return 0; -+ } -+ prev_i = (int *) malloc(alloc_size); -+ cur_i = (int *) malloc(alloc_size); -+ if (prev_i == NULL || cur_i == NULL) { -+ (void) PyErr_NoMemory(); -+ goto exit; -+ } -+ -+ len /= bytes_per_frame; /* # of frames */ -+ -+ if (state == Py_None) { -+ d = -outrate; -+ for (chan = 0; chan < nchannels; chan++) -+ prev_i[chan] = cur_i[chan] = 0; -+ } -+ else { -+ if (!PyArg_ParseTuple(state, -+ "iO!;audioop.ratecv: illegal state argument", -+ &d, &PyTuple_Type, &samps)) -+ goto exit; -+ if (PyTuple_Size(samps) != nchannels) { -+ PyErr_SetString(AudioopError, -+ "illegal state argument"); -+ goto exit; -+ } -+ for (chan = 0; chan < nchannels; chan++) { -+ if (!PyArg_ParseTuple(PyTuple_GetItem(samps, chan), -+ "ii:ratecv", &prev_i[chan], -+ &cur_i[chan])) - goto exit; - } -+ } - -- len /= bytes_per_frame; /* # of frames */ -+ /* str <- Space for the output buffer. */ -+ { -+ /* There are len input frames, so we need (mathematically) -+ 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) -+ str = NULL; -+ else -+ str = PyBytes_FromStringAndSize(NULL, nbytes); - -- if (state == Py_None) { -- d = -outrate; -+ if (str == NULL) { -+ PyErr_SetString(PyExc_MemoryError, -+ "not enough memory for output buffer"); -+ goto exit; -+ } -+ } -+ ncp = PyBytes_AsString(str); -+ -+ for (;;) { -+ while (d < 0) { -+ if (len == 0) { -+ samps = PyTuple_New(nchannels); -+ if (samps == NULL) -+ goto exit; - for (chan = 0; chan < nchannels; chan++) -- prev_i[chan] = cur_i[chan] = 0; -- } -- else { -- if (!PyArg_ParseTuple(state, -- "iO!;audioop.ratecv: illegal state argument", -- &d, &PyTuple_Type, &samps)) -- goto exit; -- if (PyTuple_Size(samps) != nchannels) { -- PyErr_SetString(AudioopError, -- "illegal state argument"); -- goto exit; -- } -- for (chan = 0; chan < nchannels; chan++) { -- if (!PyArg_ParseTuple(PyTuple_GetItem(samps, chan), -- "ii:ratecv", &prev_i[chan], -- &cur_i[chan])) -- goto exit; -- } -- } -- -- /* str <- Space for the output buffer. */ -- { -- /* There are len input frames, so we need (mathematically) -- 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) -- str = NULL; -- else -- str = PyBytes_FromStringAndSize(NULL, nbytes); -- -- if (str == NULL) { -- PyErr_SetString(PyExc_MemoryError, -- "not enough memory for output buffer"); -- goto exit; -- } -- } -- ncp = PyBytes_AsString(str); -- -- for (;;) { -- while (d < 0) { -- if (len == 0) { -- samps = PyTuple_New(nchannels); -- if (samps == NULL) -- goto exit; -- for (chan = 0; chan < nchannels; chan++) -- PyTuple_SetItem(samps, chan, -- Py_BuildValue("(ii)", -- prev_i[chan], -- cur_i[chan])); -- if (PyErr_Occurred()) -- goto exit; -- /* We have checked before that the length -- * of the string fits into int. */ -- len = (int)(ncp - PyBytes_AsString(str)); -- rv = PyBytes_FromStringAndSize -- (PyBytes_AsString(str), len); -- Py_DECREF(str); -- str = rv; -- if (str == NULL) -- goto exit; -- rv = Py_BuildValue("(O(iO))", str, d, samps); -- Py_DECREF(samps); -- Py_DECREF(str); -- goto exit; /* return rv */ -- } -- for (chan = 0; chan < nchannels; chan++) { -- prev_i[chan] = cur_i[chan]; -- if (size == 1) -- cur_i[chan] = ((int)*CHARP(cp, 0)) << 8; -- else if (size == 2) -- cur_i[chan] = (int)*SHORTP(cp, 0); -- else if (size == 4) -- cur_i[chan] = ((int)*LONGP(cp, 0)) >> 16; -- cp += size; -- /* implements a simple digital filter */ -- cur_i[chan] = -- (weightA * cur_i[chan] + -- weightB * prev_i[chan]) / -- (weightA + weightB); -- } -- len--; -- d += outrate; -- } -- while (d >= 0) { -- for (chan = 0; chan < nchannels; chan++) { -- cur_o = (prev_i[chan] * d + -- cur_i[chan] * (outrate - d)) / -- outrate; -- if (size == 1) -- *CHARP(ncp, 0) = (signed char)(cur_o >> 8); -- else if (size == 2) -- *SHORTP(ncp, 0) = (short)(cur_o); -- else if (size == 4) -- *LONGP(ncp, 0) = (Py_Int32)(cur_o<<16); -- ncp += size; -- } -- d -= inrate; -- } -+ PyTuple_SetItem(samps, chan, -+ Py_BuildValue("(ii)", -+ prev_i[chan], -+ cur_i[chan])); -+ if (PyErr_Occurred()) -+ goto exit; -+ /* We have checked before that the length -+ * of the string fits into int. */ -+ len = (int)(ncp - PyBytes_AsString(str)); -+ rv = PyBytes_FromStringAndSize -+ (PyBytes_AsString(str), len); -+ Py_DECREF(str); -+ str = rv; -+ if (str == NULL) -+ goto exit; -+ rv = Py_BuildValue("(O(iO))", str, d, samps); -+ Py_DECREF(samps); -+ Py_DECREF(str); -+ goto exit; /* return rv */ -+ } -+ for (chan = 0; chan < nchannels; chan++) { -+ prev_i[chan] = cur_i[chan]; -+ if (size == 1) -+ cur_i[chan] = ((int)*CHARP(cp, 0)) << 8; -+ else if (size == 2) -+ cur_i[chan] = (int)*SHORTP(cp, 0); -+ else if (size == 4) -+ cur_i[chan] = ((int)*LONGP(cp, 0)) >> 16; -+ cp += size; -+ /* implements a simple digital filter */ -+ cur_i[chan] = -+ (weightA * cur_i[chan] + -+ weightB * prev_i[chan]) / -+ (weightA + weightB); -+ } -+ len--; -+ d += outrate; -+ } -+ while (d >= 0) { -+ for (chan = 0; chan < nchannels; chan++) { -+ cur_o = (prev_i[chan] * d + -+ cur_i[chan] * (outrate - d)) / -+ outrate; -+ if (size == 1) -+ *CHARP(ncp, 0) = (signed char)(cur_o >> 8); -+ else if (size == 2) -+ *SHORTP(ncp, 0) = (short)(cur_o); -+ else if (size == 4) -+ *LONGP(ncp, 0) = (Py_Int32)(cur_o<<16); -+ ncp += size; -+ } -+ d -= inrate; - } -+ } - exit: -- if (prev_i != NULL) -- free(prev_i); -- if (cur_i != NULL) -- free(cur_i); -- return rv; -+ if (prev_i != NULL) -+ free(prev_i); -+ if (cur_i != NULL) -+ free(cur_i); -+ return rv; - } - - static PyObject * - audioop_lin2ulaw(PyObject *self, PyObject *args) - { -- signed char *cp; -- unsigned char *ncp; -- int len, size, val = 0; -- PyObject *rv; -- int i; -- -- 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; -- } -- -- rv = PyBytes_FromStringAndSize(NULL, len/size); -- if ( rv == 0 ) -- return 0; -- ncp = (unsigned char *)PyBytes_AsString(rv); -- -- for ( i=0; i < len; i += size ) { -- if ( size == 1 ) val = ((int)*CHARP(cp, i)) << 8; -- else if ( size == 2 ) val = (int)*SHORTP(cp, i); -- else if ( size == 4 ) val = ((int)*LONGP(cp, i)) >> 16; -- -- *ncp++ = st_14linear2ulaw(val); -- } -- return rv; -+ signed char *cp; -+ unsigned char *ncp; -+ int len, size, val = 0; -+ PyObject *rv; -+ int i; -+ -+ 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; -+ } -+ -+ rv = PyBytes_FromStringAndSize(NULL, len/size); -+ if ( rv == 0 ) -+ return 0; -+ ncp = (unsigned char *)PyBytes_AsString(rv); -+ -+ for ( i=0; i < len; i += size ) { -+ if ( size == 1 ) val = ((int)*CHARP(cp, i)) << 8; -+ else if ( size == 2 ) val = (int)*SHORTP(cp, i); -+ else if ( size == 4 ) val = ((int)*LONGP(cp, i)) >> 16; -+ -+ *ncp++ = st_14linear2ulaw(val); -+ } -+ return rv; - } - - static PyObject * - audioop_ulaw2lin(PyObject *self, PyObject *args) - { -- unsigned char *cp; -- unsigned char cval; -- signed char *ncp; -- int len, new_len, size, val; -- PyObject *rv; -- int i; -- -- 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; -- } -- -- new_len = len*size; -- if (new_len < 0) { -- PyErr_SetString(PyExc_MemoryError, -- "not enough memory for output buffer"); -- return 0; -- } -- rv = PyBytes_FromStringAndSize(NULL, new_len); -- if ( rv == 0 ) -- return 0; -- ncp = (signed char *)PyBytes_AsString(rv); -- -- for ( i=0; i < new_len; i += size ) { -- cval = *cp++; -- val = st_ulaw2linear16(cval); -- -- if ( size == 1 ) *CHARP(ncp, i) = (signed char)(val >> 8); -- else if ( size == 2 ) *SHORTP(ncp, i) = (short)(val); -- else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)(val<<16); -- } -- return rv; -+ unsigned char *cp; -+ unsigned char cval; -+ signed char *ncp; -+ int len, new_len, size, val; -+ PyObject *rv; -+ int i; -+ -+ 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; -+ } -+ -+ new_len = len*size; -+ if (new_len < 0) { -+ PyErr_SetString(PyExc_MemoryError, -+ "not enough memory for output buffer"); -+ return 0; -+ } -+ rv = PyBytes_FromStringAndSize(NULL, new_len); -+ if ( rv == 0 ) -+ return 0; -+ ncp = (signed char *)PyBytes_AsString(rv); -+ -+ for ( i=0; i < new_len; i += size ) { -+ cval = *cp++; -+ val = st_ulaw2linear16(cval); -+ -+ if ( size == 1 ) *CHARP(ncp, i) = (signed char)(val >> 8); -+ else if ( size == 2 ) *SHORTP(ncp, i) = (short)(val); -+ else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)(val<<16); -+ } -+ return rv; - } - - static PyObject * - audioop_lin2alaw(PyObject *self, PyObject *args) - { -- signed char *cp; -- unsigned char *ncp; -- int len, size, val = 0; -- PyObject *rv; -- int i; -- -- 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; -- } -- -- rv = PyBytes_FromStringAndSize(NULL, len/size); -- if ( rv == 0 ) -- return 0; -- ncp = (unsigned char *)PyBytes_AsString(rv); -- -- for ( i=0; i < len; i += size ) { -- if ( size == 1 ) val = ((int)*CHARP(cp, i)) << 8; -- else if ( size == 2 ) val = (int)*SHORTP(cp, i); -- else if ( size == 4 ) val = ((int)*LONGP(cp, i)) >> 16; -- -- *ncp++ = st_linear2alaw(val); -- } -- return rv; -+ signed char *cp; -+ unsigned char *ncp; -+ int len, size, val = 0; -+ PyObject *rv; -+ int i; -+ -+ 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; -+ } -+ -+ rv = PyBytes_FromStringAndSize(NULL, len/size); -+ if ( rv == 0 ) -+ return 0; -+ ncp = (unsigned char *)PyBytes_AsString(rv); -+ -+ for ( i=0; i < len; i += size ) { -+ if ( size == 1 ) val = ((int)*CHARP(cp, i)) << 8; -+ else if ( size == 2 ) val = (int)*SHORTP(cp, i); -+ else if ( size == 4 ) val = ((int)*LONGP(cp, i)) >> 16; -+ -+ *ncp++ = st_linear2alaw(val); -+ } -+ return rv; - } - - static PyObject * - audioop_alaw2lin(PyObject *self, PyObject *args) - { -- unsigned char *cp; -- unsigned char cval; -- signed char *ncp; -- int len, new_len, size, val; -- PyObject *rv; -- int i; -- -- 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; -- } -- -- new_len = len*size; -- if (new_len < 0) { -- PyErr_SetString(PyExc_MemoryError, -- "not enough memory for output buffer"); -- return 0; -- } -- rv = PyBytes_FromStringAndSize(NULL, new_len); -- if ( rv == 0 ) -- return 0; -- ncp = (signed char *)PyBytes_AsString(rv); -- -- for ( i=0; i < new_len; i += size ) { -- cval = *cp++; -- val = st_alaw2linear16(cval); -- -- if ( size == 1 ) *CHARP(ncp, i) = (signed char)(val >> 8); -- else if ( size == 2 ) *SHORTP(ncp, i) = (short)(val); -- else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)(val<<16); -- } -- return rv; -+ unsigned char *cp; -+ unsigned char cval; -+ signed char *ncp; -+ int len, new_len, size, val; -+ PyObject *rv; -+ int i; -+ -+ 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; -+ } -+ -+ new_len = len*size; -+ if (new_len < 0) { -+ PyErr_SetString(PyExc_MemoryError, -+ "not enough memory for output buffer"); -+ return 0; -+ } -+ rv = PyBytes_FromStringAndSize(NULL, new_len); -+ if ( rv == 0 ) -+ return 0; -+ ncp = (signed char *)PyBytes_AsString(rv); -+ -+ for ( i=0; i < new_len; i += size ) { -+ cval = *cp++; -+ val = st_alaw2linear16(cval); -+ -+ if ( size == 1 ) *CHARP(ncp, i) = (signed char)(val >> 8); -+ else if ( size == 2 ) *SHORTP(ncp, i) = (short)(val); -+ else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)(val<<16); -+ } -+ return rv; - } - - static PyObject * - audioop_lin2adpcm(PyObject *self, PyObject *args) - { -- signed char *cp; -- signed char *ncp; -- int len, size, val = 0, step, valpred, delta, -- index, sign, vpdiff, diff; -- PyObject *rv, *state, *str; -- int i, outputbuffer = 0, bufferstep; -- -- 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; -- } -- -- str = PyBytes_FromStringAndSize(NULL, len/(size*2)); -- if ( str == 0 ) -- return 0; -- ncp = (signed char *)PyBytes_AsString(str); -- -- /* Decode state, should have (value, step) */ -- if ( state == Py_None ) { -- /* First time, it seems. Set defaults */ -- valpred = 0; -- step = 7; -- index = 0; -- } else if ( !PyArg_ParseTuple(state, "ii", &valpred, &index) ) -- return 0; -+ signed char *cp; -+ signed char *ncp; -+ int len, size, val = 0, step, valpred, delta, -+ index, sign, vpdiff, diff; -+ PyObject *rv, *state, *str; -+ int i, outputbuffer = 0, bufferstep; -+ -+ 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; -+ } -+ -+ str = PyBytes_FromStringAndSize(NULL, len/(size*2)); -+ if ( str == 0 ) -+ return 0; -+ ncp = (signed char *)PyBytes_AsString(str); -+ -+ /* Decode state, should have (value, step) */ -+ if ( state == Py_None ) { -+ /* First time, it seems. Set defaults */ -+ valpred = 0; -+ step = 7; -+ index = 0; -+ } else if ( !PyArg_ParseTuple(state, "ii", &valpred, &index) ) -+ return 0; -+ -+ step = stepsizeTable[index]; -+ bufferstep = 1; -+ -+ for ( i=0; i < len; i += size ) { -+ if ( size == 1 ) val = ((int)*CHARP(cp, i)) << 8; -+ else if ( size == 2 ) val = (int)*SHORTP(cp, i); -+ else if ( size == 4 ) val = ((int)*LONGP(cp, i)) >> 16; -+ -+ /* Step 1 - compute difference with previous value */ -+ diff = val - valpred; -+ sign = (diff < 0) ? 8 : 0; -+ if ( sign ) diff = (-diff); -+ -+ /* Step 2 - Divide and clamp */ -+ /* Note: -+ ** This code *approximately* computes: -+ ** delta = diff*4/step; -+ ** vpdiff = (delta+0.5)*step/4; -+ ** but in shift step bits are dropped. The net result of this -+ ** is that even if you have fast mul/div hardware you cannot -+ ** put it to good use since the fixup would be too expensive. -+ */ -+ delta = 0; -+ vpdiff = (step >> 3); - -+ if ( diff >= step ) { -+ delta = 4; -+ diff -= step; -+ vpdiff += step; -+ } -+ step >>= 1; -+ if ( diff >= step ) { -+ delta |= 2; -+ diff -= step; -+ vpdiff += step; -+ } -+ step >>= 1; -+ if ( diff >= step ) { -+ delta |= 1; -+ vpdiff += step; -+ } -+ -+ /* Step 3 - Update previous value */ -+ if ( sign ) -+ valpred -= vpdiff; -+ else -+ valpred += vpdiff; -+ -+ /* Step 4 - Clamp previous value to 16 bits */ -+ if ( valpred > 32767 ) -+ valpred = 32767; -+ else if ( valpred < -32768 ) -+ valpred = -32768; -+ -+ /* Step 5 - Assemble value, update index and step values */ -+ delta |= sign; -+ -+ index += indexTable[delta]; -+ if ( index < 0 ) index = 0; -+ if ( index > 88 ) index = 88; - step = stepsizeTable[index]; -- bufferstep = 1; - -- for ( i=0; i < len; i += size ) { -- if ( size == 1 ) val = ((int)*CHARP(cp, i)) << 8; -- else if ( size == 2 ) val = (int)*SHORTP(cp, i); -- else if ( size == 4 ) val = ((int)*LONGP(cp, i)) >> 16; -- -- /* Step 1 - compute difference with previous value */ -- diff = val - valpred; -- sign = (diff < 0) ? 8 : 0; -- if ( sign ) diff = (-diff); -- -- /* Step 2 - Divide and clamp */ -- /* Note: -- ** This code *approximately* computes: -- ** delta = diff*4/step; -- ** vpdiff = (delta+0.5)*step/4; -- ** but in shift step bits are dropped. The net result of this -- ** is that even if you have fast mul/div hardware you cannot -- ** put it to good use since the fixup would be too expensive. -- */ -- delta = 0; -- vpdiff = (step >> 3); -- -- if ( diff >= step ) { -- delta = 4; -- diff -= step; -- vpdiff += step; -- } -- step >>= 1; -- if ( diff >= step ) { -- delta |= 2; -- diff -= step; -- vpdiff += step; -- } -- step >>= 1; -- if ( diff >= step ) { -- delta |= 1; -- vpdiff += step; -- } -- -- /* Step 3 - Update previous value */ -- if ( sign ) -- valpred -= vpdiff; -- else -- valpred += vpdiff; -- -- /* Step 4 - Clamp previous value to 16 bits */ -- if ( valpred > 32767 ) -- valpred = 32767; -- else if ( valpred < -32768 ) -- valpred = -32768; -- -- /* Step 5 - Assemble value, update index and step values */ -- delta |= sign; -- -- index += indexTable[delta]; -- if ( index < 0 ) index = 0; -- if ( index > 88 ) index = 88; -- step = stepsizeTable[index]; -- -- /* Step 6 - Output value */ -- if ( bufferstep ) { -- outputbuffer = (delta << 4) & 0xf0; -- } else { -- *ncp++ = (delta & 0x0f) | outputbuffer; -- } -- bufferstep = !bufferstep; -+ /* Step 6 - Output value */ -+ if ( bufferstep ) { -+ outputbuffer = (delta << 4) & 0xf0; -+ } else { -+ *ncp++ = (delta & 0x0f) | outputbuffer; - } -- rv = Py_BuildValue("(O(ii))", str, valpred, index); -- Py_DECREF(str); -- return rv; -+ bufferstep = !bufferstep; -+ } -+ rv = Py_BuildValue("(O(ii))", str, valpred, index); -+ Py_DECREF(str); -+ return rv; - } - - static PyObject * - audioop_adpcm2lin(PyObject *self, PyObject *args) - { -- signed char *cp; -- signed char *ncp; -- int len, new_len, size, valpred, step, delta, index, sign, vpdiff; -- PyObject *rv, *str, *state; -- int i, inputbuffer = 0, bufferstep; -- -- 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; -- } -- -- /* Decode state, should have (value, step) */ -- if ( state == Py_None ) { -- /* First time, it seems. Set defaults */ -- valpred = 0; -- step = 7; -- index = 0; -- } else if ( !PyArg_ParseTuple(state, "ii", &valpred, &index) ) -- return 0; -- -- new_len = len*size*2; -- if (new_len < 0) { -- PyErr_SetString(PyExc_MemoryError, -- "not enough memory for output buffer"); -- return 0; -+ signed char *cp; -+ signed char *ncp; -+ int len, new_len, size, valpred, step, delta, index, sign, vpdiff; -+ PyObject *rv, *str, *state; -+ int i, inputbuffer = 0, bufferstep; -+ -+ 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; -+ } -+ -+ /* Decode state, should have (value, step) */ -+ if ( state == Py_None ) { -+ /* First time, it seems. Set defaults */ -+ valpred = 0; -+ step = 7; -+ index = 0; -+ } else if ( !PyArg_ParseTuple(state, "ii", &valpred, &index) ) -+ return 0; -+ -+ new_len = len*size*2; -+ if (new_len < 0) { -+ PyErr_SetString(PyExc_MemoryError, -+ "not enough memory for output buffer"); -+ return 0; -+ } -+ str = PyBytes_FromStringAndSize(NULL, new_len); -+ if ( str == 0 ) -+ return 0; -+ ncp = (signed char *)PyBytes_AsString(str); -+ -+ step = stepsizeTable[index]; -+ bufferstep = 0; -+ -+ for ( i=0; i < new_len; i += size ) { -+ /* Step 1 - get the delta value and compute next index */ -+ if ( bufferstep ) { -+ delta = inputbuffer & 0xf; -+ } else { -+ inputbuffer = *cp++; -+ delta = (inputbuffer >> 4) & 0xf; - } -- str = PyBytes_FromStringAndSize(NULL, new_len); -- if ( str == 0 ) -- return 0; -- ncp = (signed char *)PyBytes_AsString(str); - -+ bufferstep = !bufferstep; -+ -+ /* Step 2 - Find new index value (for later) */ -+ index += indexTable[delta]; -+ if ( index < 0 ) index = 0; -+ if ( index > 88 ) index = 88; -+ -+ /* Step 3 - Separate sign and magnitude */ -+ sign = delta & 8; -+ delta = delta & 7; -+ -+ /* Step 4 - Compute difference and new predicted value */ -+ /* -+ ** Computes 'vpdiff = (delta+0.5)*step/4', but see comment -+ ** in adpcm_coder. -+ */ -+ vpdiff = step >> 3; -+ if ( delta & 4 ) vpdiff += step; -+ if ( delta & 2 ) vpdiff += step>>1; -+ if ( delta & 1 ) vpdiff += step>>2; -+ -+ if ( sign ) -+ valpred -= vpdiff; -+ else -+ valpred += vpdiff; -+ -+ /* Step 5 - clamp output value */ -+ if ( valpred > 32767 ) -+ valpred = 32767; -+ else if ( valpred < -32768 ) -+ valpred = -32768; -+ -+ /* Step 6 - Update step value */ - step = stepsizeTable[index]; -- bufferstep = 0; -- -- for ( i=0; i < new_len; i += size ) { -- /* Step 1 - get the delta value and compute next index */ -- if ( bufferstep ) { -- delta = inputbuffer & 0xf; -- } else { -- inputbuffer = *cp++; -- delta = (inputbuffer >> 4) & 0xf; -- } -- -- bufferstep = !bufferstep; -- -- /* Step 2 - Find new index value (for later) */ -- index += indexTable[delta]; -- if ( index < 0 ) index = 0; -- if ( index > 88 ) index = 88; -- -- /* Step 3 - Separate sign and magnitude */ -- sign = delta & 8; -- delta = delta & 7; -- -- /* Step 4 - Compute difference and new predicted value */ -- /* -- ** Computes 'vpdiff = (delta+0.5)*step/4', but see comment -- ** in adpcm_coder. -- */ -- vpdiff = step >> 3; -- if ( delta & 4 ) vpdiff += step; -- if ( delta & 2 ) vpdiff += step>>1; -- if ( delta & 1 ) vpdiff += step>>2; -- -- if ( sign ) -- valpred -= vpdiff; -- else -- valpred += vpdiff; -- -- /* Step 5 - clamp output value */ -- if ( valpred > 32767 ) -- valpred = 32767; -- else if ( valpred < -32768 ) -- valpred = -32768; -- -- /* Step 6 - Update step value */ -- step = stepsizeTable[index]; -- -- /* Step 6 - Output value */ -- if ( size == 1 ) *CHARP(ncp, i) = (signed char)(valpred >> 8); -- else if ( size == 2 ) *SHORTP(ncp, i) = (short)(valpred); -- else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)(valpred<<16); -- } - -- rv = Py_BuildValue("(O(ii))", str, valpred, index); -- Py_DECREF(str); -- return rv; -+ /* Step 6 - Output value */ -+ if ( size == 1 ) *CHARP(ncp, i) = (signed char)(valpred >> 8); -+ else if ( size == 2 ) *SHORTP(ncp, i) = (short)(valpred); -+ else if ( size == 4 ) *LONGP(ncp, i) = (Py_Int32)(valpred<<16); -+ } -+ -+ rv = Py_BuildValue("(O(ii))", str, valpred, index); -+ Py_DECREF(str); -+ return rv; - } - - static PyMethodDef audioop_methods[] = { -- { "max", audioop_max, METH_VARARGS }, -- { "minmax", audioop_minmax, METH_VARARGS }, -- { "avg", audioop_avg, METH_VARARGS }, -- { "maxpp", audioop_maxpp, METH_VARARGS }, -- { "avgpp", audioop_avgpp, METH_VARARGS }, -- { "rms", audioop_rms, METH_VARARGS }, -- { "findfit", audioop_findfit, METH_VARARGS }, -- { "findmax", audioop_findmax, METH_VARARGS }, -- { "findfactor", audioop_findfactor, METH_VARARGS }, -- { "cross", audioop_cross, METH_VARARGS }, -- { "mul", audioop_mul, METH_VARARGS }, -- { "add", audioop_add, METH_VARARGS }, -- { "bias", audioop_bias, METH_VARARGS }, -- { "ulaw2lin", audioop_ulaw2lin, METH_VARARGS }, -- { "lin2ulaw", audioop_lin2ulaw, METH_VARARGS }, -- { "alaw2lin", audioop_alaw2lin, METH_VARARGS }, -- { "lin2alaw", audioop_lin2alaw, METH_VARARGS }, -- { "lin2lin", audioop_lin2lin, METH_VARARGS }, -- { "adpcm2lin", audioop_adpcm2lin, METH_VARARGS }, -- { "lin2adpcm", audioop_lin2adpcm, METH_VARARGS }, -- { "tomono", audioop_tomono, METH_VARARGS }, -- { "tostereo", audioop_tostereo, METH_VARARGS }, -- { "getsample", audioop_getsample, METH_VARARGS }, -- { "reverse", audioop_reverse, METH_VARARGS }, -- { "ratecv", audioop_ratecv, METH_VARARGS }, -- { 0, 0 } -+ { "max", audioop_max, METH_VARARGS }, -+ { "minmax", audioop_minmax, METH_VARARGS }, -+ { "avg", audioop_avg, METH_VARARGS }, -+ { "maxpp", audioop_maxpp, METH_VARARGS }, -+ { "avgpp", audioop_avgpp, METH_VARARGS }, -+ { "rms", audioop_rms, METH_VARARGS }, -+ { "findfit", audioop_findfit, METH_VARARGS }, -+ { "findmax", audioop_findmax, METH_VARARGS }, -+ { "findfactor", audioop_findfactor, METH_VARARGS }, -+ { "cross", audioop_cross, METH_VARARGS }, -+ { "mul", audioop_mul, METH_VARARGS }, -+ { "add", audioop_add, METH_VARARGS }, -+ { "bias", audioop_bias, METH_VARARGS }, -+ { "ulaw2lin", audioop_ulaw2lin, METH_VARARGS }, -+ { "lin2ulaw", audioop_lin2ulaw, METH_VARARGS }, -+ { "alaw2lin", audioop_alaw2lin, METH_VARARGS }, -+ { "lin2alaw", audioop_lin2alaw, METH_VARARGS }, -+ { "lin2lin", audioop_lin2lin, METH_VARARGS }, -+ { "adpcm2lin", audioop_adpcm2lin, METH_VARARGS }, -+ { "lin2adpcm", audioop_lin2adpcm, METH_VARARGS }, -+ { "tomono", audioop_tomono, METH_VARARGS }, -+ { "tostereo", audioop_tostereo, METH_VARARGS }, -+ { "getsample", audioop_getsample, METH_VARARGS }, -+ { "reverse", audioop_reverse, METH_VARARGS }, -+ { "ratecv", audioop_ratecv, METH_VARARGS }, -+ { 0, 0 } - }; - - - static struct PyModuleDef audioopmodule = { -- PyModuleDef_HEAD_INIT, -- "audioop", -- NULL, -- -1, -- audioop_methods, -- NULL, -- NULL, -- NULL, -- NULL -+ PyModuleDef_HEAD_INIT, -+ "audioop", -+ NULL, -+ -1, -+ audioop_methods, -+ NULL, -+ NULL, -+ NULL, -+ NULL - }; - - PyMODINIT_FUNC - PyInit_audioop(void) - { -- PyObject *m, *d; -- m = PyModule_Create(&audioopmodule); -- if (m == NULL) -- return NULL; -- d = PyModule_GetDict(m); -- if (d == NULL) -- return NULL; -- AudioopError = PyErr_NewException("audioop.error", NULL, NULL); -- if (AudioopError != NULL) -- PyDict_SetItemString(d,"error",AudioopError); -- return m; -+ PyObject *m, *d; -+ m = PyModule_Create(&audioopmodule); -+ if (m == NULL) -+ return NULL; -+ d = PyModule_GetDict(m); -+ if (d == NULL) -+ return NULL; -+ AudioopError = PyErr_NewException("audioop.error", NULL, NULL); -+ if (AudioopError != NULL) -+ PyDict_SetItemString(d,"error",AudioopError); -+ return m; - } diff --git a/python-3.2a1-apply-our-changes-to-expected-shebang-for-test_imp.patch b/python-3.2a1-apply-our-changes-to-expected-shebang-for-test_imp.patch new file mode 100644 index 0000000..68eb618 --- /dev/null +++ b/python-3.2a1-apply-our-changes-to-expected-shebang-for-test_imp.patch @@ -0,0 +1,12 @@ +diff -up Python-3.2a1/Lib/test/test_imp.py.apply-our-changes-to-expected-shebang Python-3.2a1/Lib/test/test_imp.py +--- Python-3.2a1/Lib/test/test_imp.py.apply-our-changes-to-expected-shebang 2010-08-02 15:57:49.151002176 -0400 ++++ Python-3.2a1/Lib/test/test_imp.py 2010-08-02 15:58:40.428010729 -0400 +@@ -52,7 +52,7 @@ class ImportTests(unittest.TestCase): + self.assertNotEqual(fp, None) + self.assertEqual(fp.encoding, "iso-8859-1") + self.assertEqual(fp.tell(), 0) +- self.assertEqual(fp.readline(), '#!/usr/bin/env python3\n') ++ self.assertEqual(fp.readline(), '#!/usr/bin/python3.2\n') + fp.close() + + fp, filename, info = imp.find_module("tokenize") diff --git a/python-3.1.2-debug-build.patch b/python-3.2a1-debug-build.patch similarity index 64% rename from python-3.1.2-debug-build.patch rename to python-3.2a1-debug-build.patch index 2a71afe..49fb182 100644 --- a/python-3.1.2-debug-build.patch +++ b/python-3.2a1-debug-build.patch @@ -1,7 +1,7 @@ -diff -up Python-3.1.2/configure.in.debug-build Python-3.1.2/configure.in ---- Python-3.1.2/configure.in.debug-build 2010-05-20 22:48:14.573026391 -0400 -+++ Python-3.1.2/configure.in 2010-05-20 22:48:14.580902316 -0400 -@@ -569,7 +569,7 @@ AC_SUBST(LIBRARY) +diff -up Python-3.2a1/configure.in.debug-build Python-3.2a1/configure.in +--- Python-3.2a1/configure.in.debug-build 2010-08-20 16:06:24.616082276 -0400 ++++ Python-3.2a1/configure.in 2010-08-20 16:06:24.632127011 -0400 +@@ -584,7 +584,7 @@ AC_SUBST(LIBRARY) AC_MSG_CHECKING(LIBRARY) if test -z "$LIBRARY" then @@ -10,7 +10,7 @@ diff -up Python-3.1.2/configure.in.debug-build Python-3.1.2/configure.in fi AC_MSG_RESULT($LIBRARY) -@@ -711,8 +711,8 @@ if test $enable_shared = "yes"; then +@@ -726,8 +726,8 @@ if test $enable_shared = "yes"; then INSTSONAME="$LDLIBRARY".$SOVERSION ;; Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*) @@ -21,7 +21,7 @@ diff -up Python-3.1.2/configure.in.debug-build Python-3.1.2/configure.in RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH} case $ac_sys_system in FreeBSD*) -@@ -816,6 +816,14 @@ else AC_MSG_RESULT(no); Py_DEBUG='false' +@@ -825,6 +825,14 @@ else AC_MSG_RESULT(no); Py_DEBUG='false' fi], [AC_MSG_RESULT(no)]) @@ -36,9 +36,9 @@ diff -up Python-3.1.2/configure.in.debug-build Python-3.1.2/configure.in # XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be # merged with this chunk of code? -diff -up Python-3.1.2/Lib/distutils/command/build_ext.py.debug-build Python-3.1.2/Lib/distutils/command/build_ext.py ---- Python-3.1.2/Lib/distutils/command/build_ext.py.debug-build 2010-03-19 17:56:34.000000000 -0400 -+++ Python-3.1.2/Lib/distutils/command/build_ext.py 2010-05-20 22:48:14.581902928 -0400 +diff -up Python-3.2a1/Lib/distutils/command/build_ext.py.debug-build Python-3.2a1/Lib/distutils/command/build_ext.py +--- Python-3.2a1/Lib/distutils/command/build_ext.py.debug-build 2010-07-22 08:50:05.000000000 -0400 ++++ Python-3.2a1/Lib/distutils/command/build_ext.py 2010-08-20 16:06:24.633125472 -0400 @@ -673,7 +673,10 @@ class build_ext(Command): so_ext = get_config_var('SO') if os.name == 'nt' and self.debug: @@ -60,9 +60,9 @@ diff -up Python-3.1.2/Lib/distutils/command/build_ext.py.debug-build Python-3.1. return ext.libraries + [pythonlib] else: return ext.libraries -diff -up Python-3.1.2/Lib/distutils/sysconfig.py.debug-build Python-3.1.2/Lib/distutils/sysconfig.py ---- Python-3.1.2/Lib/distutils/sysconfig.py.debug-build 2010-05-20 22:48:14.577026372 -0400 -+++ Python-3.1.2/Lib/distutils/sysconfig.py 2010-05-20 22:48:14.581902928 -0400 +diff -up Python-3.2a1/Lib/distutils/sysconfig.py.debug-build Python-3.2a1/Lib/distutils/sysconfig.py +--- Python-3.2a1/Lib/distutils/sysconfig.py.debug-build 2010-08-20 16:06:24.623083865 -0400 ++++ Python-3.2a1/Lib/distutils/sysconfig.py 2010-08-20 16:06:24.633125472 -0400 @@ -83,7 +83,8 @@ def get_python_inc(plat_specific=0, pref else: incdir = os.path.join(get_config_var('srcdir'), 'Include') @@ -82,10 +82,10 @@ diff -up Python-3.1.2/Lib/distutils/sysconfig.py.debug-build Python-3.1.2/Lib/di def parse_config_h(fp, g=None): -diff -up Python-3.1.2/Makefile.pre.in.debug-build Python-3.1.2/Makefile.pre.in ---- Python-3.1.2/Makefile.pre.in.debug-build 2010-05-20 22:48:14.577901061 -0400 -+++ Python-3.1.2/Makefile.pre.in 2010-05-20 22:48:14.581902928 -0400 -@@ -99,8 +99,8 @@ SCRIPTDIR= $(prefix)/lib64 +diff -up Python-3.2a1/Makefile.pre.in.debug-build Python-3.2a1/Makefile.pre.in +--- Python-3.2a1/Makefile.pre.in.debug-build 2010-08-20 16:06:24.624081000 -0400 ++++ Python-3.2a1/Makefile.pre.in 2010-08-20 16:06:57.287084214 -0400 +@@ -105,8 +105,8 @@ SCRIPTDIR= $(prefix)/lib64 # Detailed destination directories BINLIBDEST= $(LIBDIR)/python$(VERSION) LIBDEST= $(SCRIPTDIR)/python$(VERSION) @@ -96,7 +96,7 @@ diff -up Python-3.1.2/Makefile.pre.in.debug-build Python-3.1.2/Makefile.pre.in LIBP= $(LIBDIR)/python$(VERSION) # Symbols used for using shared libraries -@@ -113,6 +113,12 @@ DESTSHARED= $(BINLIBDEST)/lib-dynload +@@ -120,6 +120,12 @@ DESTSHARED= $(BINLIBDEST)/lib-dynload EXE= @EXEEXT@ BUILDEXE= @BUILDEXEEXT@ @@ -109,7 +109,7 @@ diff -up Python-3.1.2/Makefile.pre.in.debug-build Python-3.1.2/Makefile.pre.in # Short name and location for Mac OS X Python framework UNIVERSALSDK=@UNIVERSALSDK@ PYTHONFRAMEWORK= @PYTHONFRAMEWORK@ -@@ -176,7 +182,7 @@ LIBOBJDIR= Python/ +@@ -183,7 +189,7 @@ LIBOBJDIR= Python/ LIBOBJS= @LIBOBJS@ PYTHON= python$(EXE) @@ -118,16 +118,16 @@ diff -up Python-3.1.2/Makefile.pre.in.debug-build Python-3.1.2/Makefile.pre.in # 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 -@@ -422,7 +428,7 @@ sharedmods: $(BUILDPYTHON) - *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \ +@@ -433,7 +439,7 @@ sharedmods: $(BUILDPYTHON) + *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(PY_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); \ + $(LDSHARED) $(PY_LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ $(LN) -f $(INSTSONAME) $@; \ -@@ -793,7 +799,7 @@ altbininstall: $(BUILDPYTHON) +@@ -817,7 +823,7 @@ altbininstall: $(BUILDPYTHON) else true; \ fi; \ done @@ -136,7 +136,7 @@ diff -up Python-3.1.2/Makefile.pre.in.debug-build Python-3.1.2/Makefile.pre.in if test -f $(LDLIBRARY); then \ if test -n "$(DLLLIBRARY)" ; then \ $(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \ -@@ -807,15 +813,15 @@ altbininstall: $(BUILDPYTHON) +@@ -831,15 +837,15 @@ altbininstall: $(BUILDPYTHON) fi bininstall: altbininstall @@ -159,7 +159,20 @@ diff -up Python-3.1.2/Makefile.pre.in.debug-build Python-3.1.2/Makefile.pre.in # Install the manual page maninstall: -@@ -960,7 +966,7 @@ inclinstall: +@@ -965,10 +971,10 @@ $(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) +@@ -990,12 +996,12 @@ inclinstall: # Install the library and miscellaneous stuff needed for extending/embedding # This goes into $(exec_prefix) @@ -168,7 +181,13 @@ diff -up Python-3.1.2/Makefile.pre.in.debug-build Python-3.1.2/Makefile.pre.in # pkgconfig directory LIBPC= $(LIBDIR)/pkgconfig -@@ -981,14 +987,14 @@ libainstall: all + +-libainstall: all python-config ++libainstall: all python$(DEBUG_SUFFIX)-config + @for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \ + do \ + if test ! -d $(DESTDIR)$$i; then \ +@@ -1011,11 +1017,11 @@ 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 @@ -176,32 +195,28 @@ diff -up Python-3.1.2/Makefile.pre.in.debug-build Python-3.1.2/Makefile.pre.in + $(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 - # 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-3.1.2/Misc/python-config.in.debug-build Python-3.1.2/Misc/python-config.in ---- Python-3.1.2/Misc/python-config.in.debug-build 2007-09-01 03:27:37.000000000 -0400 -+++ Python-3.1.2/Misc/python-config.in 2010-05-20 22:48:14.582902254 -0400 -@@ -44,7 +44,7 @@ elif opt in ('--includes', '--cflags'): +diff -up Python-3.2a1/Misc/python-config.in.debug-build Python-3.2a1/Misc/python-config.in +--- Python-3.2a1/Misc/python-config.in.debug-build 2010-04-06 17:30:42.000000000 -0400 ++++ Python-3.2a1/Misc/python-config.in 2010-08-20 16:06:24.635124366 -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' and not getvar('Py_ENABLE_SHARED'): -diff -up Python-3.1.2/Modules/makesetup.debug-build Python-3.1.2/Modules/makesetup ---- Python-3.1.2/Modules/makesetup.debug-build 2008-06-11 01:26:20.000000000 -0400 -+++ Python-3.1.2/Modules/makesetup 2010-05-20 22:48:14.582902254 -0400 + 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-3.2a1/Modules/makesetup.debug-build Python-3.2a1/Modules/makesetup +--- Python-3.2a1/Modules/makesetup.debug-build 2010-07-09 12:30:58.000000000 -0400 ++++ Python-3.2a1/Modules/makesetup 2010-08-20 16:06:24.635124366 -0400 @@ -233,7 +233,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' | *$mod.o*) base=$mod;; *) base=${mod}module;; @@ -211,19 +226,19 @@ diff -up Python-3.1.2/Modules/makesetup.debug-build Python-3.1.2/Modules/makeset case $doconfig in no) SHAREDMODS="$SHAREDMODS $file";; esac -diff -up Python-3.1.2/Python/dynload_shlib.c.debug-build Python-3.1.2/Python/dynload_shlib.c ---- Python-3.1.2/Python/dynload_shlib.c.debug-build 2008-06-11 01:26:20.000000000 -0400 -+++ Python-3.1.2/Python/dynload_shlib.c 2010-05-20 22:48:14.582902254 -0400 +diff -up Python-3.2a1/Python/dynload_shlib.c.debug-build Python-3.2a1/Python/dynload_shlib.c +--- Python-3.2a1/Python/dynload_shlib.c.debug-build 2010-05-09 11:52:27.000000000 -0400 ++++ Python-3.2a1/Python/dynload_shlib.c 2010-08-20 16:06:24.635124366 -0400 @@ -46,11 +46,16 @@ const struct filedescr _PyImport_DynLoad - {"module.exe", "rb", C_EXTENSION}, - {"MODULE.EXE", "rb", C_EXTENSION}, + {"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}, ++ {"_d.so", "rb", C_EXTENSION}, ++ {"module_d.so", "rb", C_EXTENSION}, +#else - {".so", "rb", C_EXTENSION}, - {"module.so", "rb", C_EXTENSION}, + {".so", "rb", C_EXTENSION}, + {"module.so", "rb", C_EXTENSION}, -#endif -#endif -#endif @@ -231,28 +246,28 @@ diff -up Python-3.1.2/Python/dynload_shlib.c.debug-build Python-3.1.2/Python/dyn +#endif /* __VMS */ +#endif /* defined(PYOS_OS2) && defined(PYCC_GCC) */ +#endif /* __CYGWIN__ */ - {0, 0} + {0, 0} }; -diff -up Python-3.1.2/Python/sysmodule.c.debug-build Python-3.1.2/Python/sysmodule.c ---- Python-3.1.2/Python/sysmodule.c.debug-build 2010-03-03 06:55:53.000000000 -0500 -+++ Python-3.1.2/Python/sysmodule.c 2010-05-20 22:48:14.582902254 -0400 -@@ -1429,6 +1429,12 @@ _PySys_Init(void) - FlagsType.tp_init = NULL; - FlagsType.tp_new = NULL; +diff -up Python-3.2a1/Python/sysmodule.c.debug-build Python-3.2a1/Python/sysmodule.c +--- Python-3.2a1/Python/sysmodule.c.debug-build 2010-07-06 06:53:30.000000000 -0400 ++++ Python-3.2a1/Python/sysmodule.c 2010-08-20 16:06:24.636251716 -0400 +@@ -1598,6 +1598,12 @@ _PySys_Init(void) + WindowsVersionType.tp_new = NULL; + #endif +#ifdef Py_DEBUG -+ PyDict_SetItemString(sysdict, "pydebug", Py_True); ++ PyDict_SetItemString(sysdict, "pydebug", Py_True); +#else -+ PyDict_SetItemString(sysdict, "pydebug", Py_False); ++ PyDict_SetItemString(sysdict, "pydebug", Py_False); +#endif + - /* float repr style: 0.03 (short) vs 0.029999999999999999 (legacy) */ + /* float repr style: 0.03 (short) vs 0.029999999999999999 (legacy) */ #ifndef PY_NO_SHORT_FLOAT_REPR - SET_SYS_FROM_STRING("float_repr_style", -diff -up Python-3.1.2/runtests.sh.debug-build Python-3.1.2/runtests.sh ---- Python-3.1.2/runtests.sh.debug-build 2010-05-22 00:42:41.950889054 -0400 -+++ Python-3.1.2/runtests.sh 2010-05-22 00:54:47.503851503 -0400 + SET_SYS_FROM_STRING("float_repr_style", +diff -up Python-3.2a1/runtests.sh.debug-build Python-3.2a1/runtests.sh +--- Python-3.2a1/runtests.sh.debug-build 2008-10-17 08:05:40.000000000 -0400 ++++ Python-3.2a1/runtests.sh 2010-08-20 16:06:24.637251276 -0400 @@ -16,11 +16,14 @@ Flags (arguments starting with '-') are regrtest.py, except for -x, which is processed here." diff --git a/python-3.1-fix-parallel-make.patch b/python-3.2a1-fix-parallel-make.patch similarity index 74% rename from python-3.1-fix-parallel-make.patch rename to python-3.2a1-fix-parallel-make.patch index 3c75b10..b6189b5 100644 --- a/python-3.1-fix-parallel-make.patch +++ b/python-3.2a1-fix-parallel-make.patch @@ -1,8 +1,7 @@ -Index: Python-3.1.2/Makefile.pre.in -=================================================================== ---- Python-3.1.2.orig/Makefile.pre.in -+++ Python-3.1.2/Makefile.pre.in -@@ -215,6 +215,7 @@ IO_OBJS= \ +diff -up Python-3.2a1/Makefile.pre.in.parallel-grammar Python-3.2a1/Makefile.pre.in +--- Python-3.2a1/Makefile.pre.in.parallel-grammar 2010-08-20 15:09:13.613527156 -0400 ++++ Python-3.2a1/Makefile.pre.in 2010-08-20 15:10:31.428135355 -0400 +@@ -222,6 +222,7 @@ IO_OBJS= \ ########################################################################## # Grammar @@ -10,7 +9,7 @@ Index: Python-3.1.2/Makefile.pre.in GRAMMAR_H= $(srcdir)/Include/graminit.h GRAMMAR_C= $(srcdir)/Python/graminit.c GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar -@@ -535,9 +536,24 @@ Modules/python.o: $(srcdir)/Modules/pyth +@@ -557,9 +558,24 @@ Modules/python.o: $(srcdir)/Modules/pyth $(IO_OBJS): $(IO_H) @@ -35,4 +34,4 @@ Index: Python-3.1.2/Makefile.pre.in + touch $(GRAMMAR_STAMP) $(PGEN): $(PGENOBJS) - $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN) + $(CC) $(OPT) $(PY_LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN) diff --git a/python-3.1.1-lib64.patch b/python-3.2a1-lib64.patch similarity index 57% rename from python-3.1.1-lib64.patch rename to python-3.2a1-lib64.patch index 3053a92..d778b5a 100644 --- a/python-3.1.1-lib64.patch +++ b/python-3.2a1-lib64.patch @@ -1,7 +1,7 @@ -diff -ur Python-3.1.1.orig/Lib/distutils/command/install.py Python-3.1.1/Lib/distutils/command/install.py ---- Python-3.1.1.orig/Lib/distutils/command/install.py 2009-09-24 15:28:57.000000000 -0600 -+++ Python-3.1.1/Lib/distutils/command/install.py 2009-09-24 15:34:18.000000000 -0600 -@@ -47,14 +47,14 @@ +diff -up Python-3.2a1/Lib/distutils/command/install.py.lib64 Python-3.2a1/Lib/distutils/command/install.py +--- Python-3.2a1/Lib/distutils/command/install.py.lib64 2010-07-22 08:50:05.000000000 -0400 ++++ Python-3.2a1/Lib/distutils/command/install.py 2010-08-02 18:33:15.667001759 -0400 +@@ -47,14 +47,14 @@ else: INSTALL_SCHEMES = { 'unix_prefix': { 'purelib': '$base/lib/python$py_version_short/site-packages', @@ -18,10 +18,10 @@ diff -ur Python-3.1.1.orig/Lib/distutils/command/install.py Python-3.1.1/Lib/dis 'headers': '$base/include/python/$dist_name', 'scripts': '$base/bin', 'data' : '$base', -diff -ur Python-3.1.1.orig/Lib/distutils/sysconfig.py Python-3.1.1/Lib/distutils/sysconfig.py ---- Python-3.1.1.orig/Lib/distutils/sysconfig.py 2009-09-24 15:29:00.000000000 -0600 -+++ Python-3.1.1/Lib/distutils/sysconfig.py 2009-09-24 15:34:18.000000000 -0600 -@@ -117,8 +117,12 @@ +diff -up Python-3.2a1/Lib/distutils/sysconfig.py.lib64 Python-3.2a1/Lib/distutils/sysconfig.py +--- Python-3.2a1/Lib/distutils/sysconfig.py.lib64 2010-07-23 05:43:17.000000000 -0400 ++++ Python-3.2a1/Lib/distutils/sysconfig.py 2010-08-02 18:33:15.669000547 -0400 +@@ -117,8 +117,12 @@ def get_python_lib(plat_specific=0, stan prefix = plat_specific and EXEC_PREFIX or PREFIX if os.name == "posix": @@ -35,35 +35,30 @@ diff -ur Python-3.1.1.orig/Lib/distutils/sysconfig.py Python-3.1.1/Lib/distutils if standard_lib: return libpython else: -diff -ur Python-3.1.1.orig/Lib/site.py Python-3.1.1/Lib/site.py ---- Python-3.1.1.orig/Lib/site.py 2009-09-24 15:28:56.000000000 -0600 -+++ Python-3.1.1/Lib/site.py 2009-09-24 15:34:18.000000000 -0600 -@@ -258,12 +258,16 @@ +diff -up Python-3.2a1/Lib/site.py.lib64 Python-3.2a1/Lib/site.py +--- Python-3.2a1/Lib/site.py.lib64 2010-06-27 17:45:24.000000000 -0400 ++++ Python-3.2a1/Lib/site.py 2010-08-02 18:34:30.584001242 -0400 +@@ -283,12 +283,16 @@ def getsitepackages(): if sys.platform in ('os2emx', 'riscos'): - sitedirs.append(os.path.join(prefix, "Lib", "site-packages")) + sitepackages.append(os.path.join(prefix, "Lib", "site-packages")) elif os.sep == '/': -+ sitedirs.append(os.path.join(prefix, "lib64", ++ sitepackages.append(os.path.join(prefix, "lib64", + "python" + sys.version[:3], + "site-packages")) - sitedirs.append(os.path.join(prefix, "lib", + sitepackages.append(os.path.join(prefix, "lib", "python" + sys.version[:3], "site-packages")) - sitedirs.append(os.path.join(prefix, "lib", "site-python")) + sitepackages.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")) - + 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": -diff -ur Python-3.1.1.orig/Makefile.pre.in Python-3.1.1/Makefile.pre.in ---- Python-3.1.1.orig/Makefile.pre.in 2009-09-24 15:26:58.000000000 -0600 -+++ Python-3.1.1/Makefile.pre.in 2009-09-24 15:34:18.000000000 -0600 -@@ -90,11 +90,11 @@ - - # Expanded directories - BINDIR= $(exec_prefix)/bin --LIBDIR= $(exec_prefix)/lib -+LIBDIR= $(exec_prefix)/lib64 + # for framework builds *only* we add the standard Apple +diff -up Python-3.2a1/Makefile.pre.in.lib64 Python-3.2a1/Makefile.pre.in +--- Python-3.2a1/Makefile.pre.in.lib64 2010-08-02 18:33:15.000000000 -0400 ++++ Python-3.2a1/Makefile.pre.in 2010-08-02 18:35:07.147000664 -0400 +@@ -100,7 +100,7 @@ LIBDIR= @libdir@ MANDIR= @mandir@ INCLUDEDIR= @includedir@ CONFINCLUDEDIR= $(exec_prefix)/include @@ -72,9 +67,9 @@ diff -ur Python-3.1.1.orig/Makefile.pre.in Python-3.1.1/Makefile.pre.in # Detailed destination directories BINLIBDEST= $(LIBDIR)/python$(VERSION) -diff -ur Python-3.1.1.orig/Modules/getpath.c Python-3.1.1/Modules/getpath.c ---- Python-3.1.1.orig/Modules/getpath.c 2009-09-24 15:27:15.000000000 -0600 -+++ Python-3.1.1/Modules/getpath.c 2009-09-24 15:36:58.000000000 -0600 +diff -up Python-3.2a1/Modules/getpath.c.lib64 Python-3.2a1/Modules/getpath.c +--- Python-3.2a1/Modules/getpath.c.lib64 2010-07-23 12:05:35.000000000 -0400 ++++ Python-3.2a1/Modules/getpath.c 2010-08-02 18:35:50.857000717 -0400 @@ -117,8 +117,8 @@ #endif @@ -86,25 +81,25 @@ diff -ur Python-3.1.1.orig/Modules/getpath.c Python-3.1.1/Modules/getpath.c #endif #ifndef LANDMARK -@@ -129,7 +129,7 @@ +@@ -129,7 +129,7 @@ static wchar_t prefix[MAXPATHLEN+1]; static wchar_t exec_prefix[MAXPATHLEN+1]; static wchar_t progpath[MAXPATHLEN+1]; static wchar_t *module_search_path = NULL; --static wchar_t lib_python[] = L"lib/python" VERSION; -+static wchar_t lib_python[] = L"lib64/python" VERSION; +-static wchar_t *lib_python = L"lib/python" VERSION; ++static wchar_t *lib_python = L"lib64/python" VERSION; /* In principle, this should use HAVE__WSTAT, and _wstat should be detected by autoconf. However, no current -@@ -603,7 +603,7 @@ +@@ -603,7 +603,7 @@ calculate_path(void) } else wcsncpy(zip_path, L"" PREFIX, MAXPATHLEN); - joinpath(zip_path, L"lib/python00.zip"); + joinpath(zip_path, L"lib64/python00.zip"); - bufsz = wcslen(zip_path); /* Replace "00" with version */ + bufsz = wcslen(zip_path); /* Replace "00" with version */ zip_path[bufsz - 6] = VERSION[0]; zip_path[bufsz - 5] = VERSION[2]; -@@ -613,7 +613,7 @@ +@@ -613,7 +613,7 @@ calculate_path(void) fprintf(stderr, "Could not find platform dependent libraries \n"); wcsncpy(exec_prefix, L"" EXEC_PREFIX, MAXPATHLEN); @@ -113,22 +108,9 @@ diff -ur Python-3.1.1.orig/Modules/getpath.c Python-3.1.1/Modules/getpath.c } /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */ -diff -ur Python-3.1.1.orig/Modules/Setup.dist Python-3.1.1/Modules/Setup.dist ---- Python-3.1.1.orig/Modules/Setup.dist 2009-09-24 15:27:30.000000000 -0600 -+++ Python-3.1.1/Modules/Setup.dist 2009-09-24 15:45:49.000000000 -0600 -@@ -351,7 +351,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 - # -diff -ur Python-3.1.1.orig/setup.py Python-3.1.1/setup.py ---- Python-3.1.1.orig/setup.py 2009-09-24 15:26:58.000000000 -0600 -+++ Python-3.1.1/setup.py 2009-09-24 15:34:18.000000000 -0600 -@@ -295,7 +295,7 @@ +--- Python-3.2a1/setup.py.lib64 2010-07-23 15:25:47.000000000 -0400 ++++ Python-3.2a1/setup.py 2010-08-02 18:36:51.521000448 -0400 +@@ -343,7 +343,7 @@ class PyBuildExt(build_ext): def detect_modules(self): # Ensure that /usr/local is always used @@ -137,13 +119,13 @@ diff -ur Python-3.1.1.orig/setup.py Python-3.1.1/setup.py add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') # Add paths specified in the environment variables LDFLAGS and -@@ -522,11 +522,11 @@ - elif self.compiler.find_library_file(lib_dirs, 'curses'): - readline_libs.append('curses') +@@ -587,11 +587,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'): +- ['/usr/lib/termcap'], ++ ['/usr/lib64/termcap'], + 'termcap'): readline_libs.append('termcap') exts.append( Extension('readline', ['readline.c'], - library_dirs=['/usr/lib/termcap'], @@ -151,7 +133,7 @@ diff -ur Python-3.1.1.orig/setup.py Python-3.1.1/setup.py extra_link_args=readline_extra_link_args, libraries=readline_libs) ) else: -@@ -563,8 +563,8 @@ +@@ -628,8 +628,8 @@ class PyBuildExt(build_ext): if krb5_h: ssl_incs += krb5_h ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, diff --git a/python-3.1.1-no-static-lib.patch b/python-3.2a1-no-static-lib.patch similarity index 66% rename from python-3.1.1-no-static-lib.patch rename to python-3.2a1-no-static-lib.patch index 325636e..6dd8147 100644 --- a/python-3.1.1-no-static-lib.patch +++ b/python-3.2a1-no-static-lib.patch @@ -1,17 +1,17 @@ -diff -up Python-3.1.1/Makefile.pre.in.no-static-lib Python-3.1.1/Makefile.pre.in ---- Python-3.1.1/Makefile.pre.in.no-static-lib 2010-01-17 15:42:11.945858717 -0500 -+++ Python-3.1.1/Makefile.pre.in 2010-01-17 16:44:32.788859363 -0500 -@@ -405,7 +405,7 @@ coverage: +diff -up Python-3.2a1/Makefile.pre.in.no-static-lib Python-3.2a1/Makefile.pre.in +--- Python-3.2a1/Makefile.pre.in.no-static-lib 2010-07-17 16:39:23.000000000 -0400 ++++ Python-3.2a1/Makefile.pre.in 2010-08-02 16:02:28.378010008 -0400 +@@ -416,7 +416,7 @@ coverage: # Build the interpreter -$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY) +$(BUILDPYTHON): Modules/python.o $(LDLIBRARY) - $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \ + $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ \ Modules/python.o \ $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) -@@ -421,18 +421,6 @@ sharedmods: $(BUILDPYTHON) - *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \ +@@ -432,18 +432,6 @@ sharedmods: $(BUILDPYTHON) + *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(PY_LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \ esac -# Build static library @@ -28,8 +28,8 @@ diff -up Python-3.1.1/Makefile.pre.in.no-static-lib Python-3.1.1/Makefile.pre.in - libpython$(VERSION).so: $(LIBRARY_OBJS) if test $(INSTSONAME) != $(LDLIBRARY); then \ - $(LDSHARED) $(LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ -@@ -973,18 +961,6 @@ libainstall: all + $(LDSHARED) $(PY_LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ +@@ -1003,18 +991,6 @@ libainstall: all python-config else true; \ fi; \ done diff --git a/python-3.1.1-remove-mimeaudio-tests.patch b/python-3.2a1-remove-mimeaudio-tests.patch similarity index 82% rename from python-3.1.1-remove-mimeaudio-tests.patch rename to python-3.2a1-remove-mimeaudio-tests.patch index 487ad3e..ff67690 100644 --- a/python-3.1.1-remove-mimeaudio-tests.patch +++ b/python-3.2a1-remove-mimeaudio-tests.patch @@ -1,6 +1,7 @@ ---- Python-3.1.1/Lib/email/test/test_email.py.remove_mimeaudio_tests 2009-10-27 14:31:09.483539561 -0400 -+++ Python-3.1.1/Lib/email/test/test_email.py 2009-10-27 14:31:27.663548053 -0400 -@@ -926,52 +926,6 @@ Blah blah blah +diff -up Python-3.2a1/Lib/email/test/test_email.py.remove-mimeaudio-tests Python-3.2a1/Lib/email/test/test_email.py +--- Python-3.2a1/Lib/email/test/test_email.py.remove-mimeaudio-tests 2010-08-02 15:52:12.397002172 -0400 ++++ Python-3.2a1/Lib/email/test/test_email.py 2010-08-02 15:52:38.132999850 -0400 +@@ -952,53 +952,6 @@ Blah blah blah @@ -22,7 +23,8 @@ - - def test_encoding(self): - payload = self._au.get_payload() -- self.assertEqual(base64.decodebytes(payload), self._audiodata) +- self.assertEqual(base64.decodebytes(bytes(payload, 'ascii')), +- self._audiodata) - - def test_checkSetMinor(self): - au = MIMEAudio(self._audiodata, 'fish') diff --git a/python-3.2a1-statvfs-f_flag-constants.patch b/python-3.2a1-statvfs-f_flag-constants.patch new file mode 100644 index 0000000..b666c1b --- /dev/null +++ b/python-3.2a1-statvfs-f_flag-constants.patch @@ -0,0 +1,47 @@ +diff -up Python-3.2a1/Modules/posixmodule.c.statvfs-f-flag-constants Python-3.2a1/Modules/posixmodule.c +--- Python-3.2a1/Modules/posixmodule.c.statvfs-f-flag-constants 2010-07-23 09:53:51.000000000 -0400 ++++ Python-3.2a1/Modules/posixmodule.c 2010-08-02 16:39:38.756000423 -0400 +@@ -8173,6 +8173,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-3.2a1-systemtap.patch b/python-3.2a1-systemtap.patch new file mode 100644 index 0000000..6770b58 --- /dev/null +++ b/python-3.2a1-systemtap.patch @@ -0,0 +1,222 @@ +diff -up Python-3.2a1/configure.in.systemtap Python-3.2a1/configure.in +--- Python-3.2a1/configure.in.systemtap 2010-07-19 03:31:40.000000000 -0400 ++++ Python-3.2a1/configure.in 2010-08-02 16:19:43.809000621 -0400 +@@ -1987,6 +1987,7 @@ AC_ARG_WITH(system_expat, + 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, + AS_HELP_STRING([--with-system-ffi], [build _ctypes module using an installed ffi library])) +@@ -2500,6 +2501,38 @@ if test "$with_valgrind" != no; then + OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT" + 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-3.2a1/Include/pydtrace.d.systemtap Python-3.2a1/Include/pydtrace.d +--- Python-3.2a1/Include/pydtrace.d.systemtap 2010-08-02 16:17:04.249000540 -0400 ++++ Python-3.2a1/Include/pydtrace.d 2010-08-02 16:17:04.249000540 -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-3.2a1/Makefile.pre.in.systemtap Python-3.2a1/Makefile.pre.in +--- Python-3.2a1/Makefile.pre.in.systemtap 2010-08-02 16:17:04.243000614 -0400 ++++ Python-3.2a1/Makefile.pre.in 2010-08-02 16:20:41.617000527 -0400 +@@ -324,6 +324,7 @@ PYTHON_OBJS= \ + Python/dtoa.o \ + Python/formatter_unicode.o \ + Python/$(DYNLOADFILE) \ ++ @DTRACEOBJS@ \ + $(LIBOBJS) \ + $(MACHDEP_OBJS) \ + $(THREADOBJ) +@@ -615,6 +616,18 @@ Python/formatter_unicode.o: $(srcdir)/Py + $(srcdir)/Objects/stringlib/formatter.h + + ++# 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 + +@@ -1248,7 +1261,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-3.2a1/pyconfig.h.in.systemtap Python-3.2a1/pyconfig.h.in +--- Python-3.2a1/pyconfig.h.in.systemtap 2010-08-02 16:18:33.696001964 -0400 ++++ Python-3.2a1/pyconfig.h.in 2010-08-02 16:21:48.566001832 -0400 +@@ -1078,6 +1078,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-3.2a1/Python/ceval.c.systemtap Python-3.2a1/Python/ceval.c +--- Python-3.2a1/Python/ceval.c.systemtap 2010-07-20 18:39:34.000000000 -0400 ++++ Python-3.2a1/Python/ceval.c 2010-08-02 16:23:58.703001000 -0400 +@@ -19,6 +19,10 @@ + + #include + ++#ifdef WITH_DTRACE ++#include "pydtrace.h" ++#endif ++ + #ifndef WITH_TSC + + #define READ_TIMESTAMP(var) +@@ -752,6 +756,70 @@ PyEval_EvalCode(PyCodeObject *co, PyObje + } + + ++#ifdef WITH_DTRACE ++struct frame_marker_info ++{ ++ char *filename; ++ char *name; ++ int lineno; ++ ++ PyObject *utf8_filename; ++ PyObject *utf8_name; ++}; ++ ++static void ++get_frame_marker_info(PyFrameObject *f, struct frame_marker_info *fmi) ++{ ++ fmi->utf8_filename = PyUnicode_AsUTF8String(f->f_code->co_filename); ++ if (fmi->utf8_filename) { ++ fmi->filename = PyBytes_AsString(fmi->utf8_filename); ++ } else { ++ fmi->filename = NULL; ++ /* FIXME: clear the exception? */ ++ } ++ ++ fmi->utf8_name = PyUnicode_AsUTF8String(f->f_code->co_name); ++ if (fmi->utf8_name) { ++ fmi->name = PyBytes_AsString(fmi->utf8_name); ++ } else { ++ fmi->name = NULL; ++ /* FIXME: clear the exception? */ ++ } ++ ++ fmi->lineno = PyCode_Addr2Line(f->f_code, f->f_lasti); ++} ++ ++static void ++release_frame_marker_info(struct frame_marker_info *fmi) ++{ ++ Py_XDECREF(fmi->utf8_filename); ++ Py_XDECREF(fmi->utf8_name); ++} ++ ++static void ++dtrace_entry(PyFrameObject *f) ++{ ++ struct frame_marker_info fmi; ++ get_frame_marker_info(f, &fmi); ++ PYTHON_FUNCTION_ENTRY(fmi.filename, fmi.name, fmi.lineno); ++ release_frame_marker_info(&fmi); ++} ++ ++static void ++dtrace_return(PyFrameObject *f) ++{ ++ struct frame_marker_info fmi; ++ get_frame_marker_info(f, &fmi); ++ PYTHON_FUNCTION_RETURN(fmi.filename, fmi.name, fmi.lineno); ++ release_frame_marker_info(&fmi); ++} ++#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 */ + + PyObject * +@@ -1156,6 +1224,10 @@ 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; +@@ -3046,6 +3118,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/python3.spec b/python3.spec index 3c8f9ef..15a8549 100644 --- a/python3.spec +++ b/python3.spec @@ -1,7 +1,20 @@ -%global pybasever 3.1 +%global pybasever 3.2 +%global alphatag a1 + %global pylibdir %{_libdir}/python%{pybasever} %global dynload_dir %{pylibdir}/lib-dynload +# All bytecode files are now in a __pycache__ subdirectory, with a name +# reflecting the version of the bytecode (to permit sharing of python libraries +# between different runtimes) +# See http://www.python.org/dev/peps/pep-3147/ +# For example, +# foo/bar.py +# now has bytecode at: +# foo/__pycache__/bar.cpython-32.pyc +# foo/__pycache__/bar.cpython-32.pyo +%global bytecode_suffixes .cpython-32.py? + # 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' @@ -42,13 +55,43 @@ # invocation of brp-python-hardlink (since this should still work for python3 # pyc/pyo files) + +# We need to get a newer configure generated out of configure.in for the following +# patches: +# patch 55 (systemtap) +# patch 103 (debug build) +# patch 104 (more config flags) +# +# 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: Version 3 of the Python programming language aka Python 3000 Name: python3 -Version: %{pybasever}.2 -Release: 13%{?dist} +Version: %{pybasever} +Release: 0.0.%{alphatag}%{?dist} License: Python Group: Development/Languages -Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 +Source: http://python.org/ftp/python/%{version}/Python-%{version}%{alphatag}.tar.bz2 # Avoid having various bogus auto-generated Provides lines for the various # python c modules' SONAMEs: @@ -100,40 +143,33 @@ Source6: systemtap-example.stp Source7: pyfuntop.stp -Patch0: python-3.1.1-config.patch - - # Fixup distutils/unixccompiler.py to remove standard library path from rpath: # Was Patch0 in ivazquez' python3000 specfile: Patch1: Python-3.1.1-rpath.patch # The four TestMIMEAudio tests fail due to "audiotest.au" not being packaged. # It's simplest to remove them: -Patch3: python-3.1.1-remove-mimeaudio-tests.patch +Patch3: python-3.2a1-remove-mimeaudio-tests.patch # ImportTests.test_issue1267 in test_imp.py reads pydoc.py's shebang line and # checks that it read it correctly. # # Since we modify the shebang lines in our packaging, we also need to modify # the expected value in this test: -Patch4: python-3.1.1-apply-our-changes-to-expected-shebang-for-test_imp.patch +Patch4: python-3.2a1-apply-our-changes-to-expected-shebang-for-test_imp.patch # Patch the Makefile.pre.in so that the generated Makefile doesn't try to build # a libpythonMAJOR.MINOR.a (bug 550692): -Patch6: python-3.1.1-no-static-lib.patch - -# Fixup configure.in and setup.py to build against system expat library. -# Adapted from http://svn.python.org/view?view=rev&revision=77170 -Patch7: python-3.1.1-with-system-expat.patch +Patch6: python-3.2a1-no-static-lib.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); ported to 3.1.1 by # dmalcolm -Patch8: python-3.1.1-systemtap.patch +Patch8: python-3.2a1-systemtap.patch -Patch102: python-3.1.1-lib64.patch +Patch102: python-3.2a1-lib64.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 @@ -197,7 +233,7 @@ Patch102: python-3.1.1-lib64.patch # * Patch runtests.sh to support supplying a value for PYTHON, so that we can # run the tests against each of the builds -Patch103: python-3.1.2-debug-build.patch +Patch103: python-3.2a1-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 @@ -207,22 +243,7 @@ Patch104: python-3.1.2-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 -Patch105: python-2.6.5-statvfs-f_flag-constants.patch - -# This is the Modules/audioop.c part of the whitespace cleanup in r81032, to make it -# easier to apply subsequent security fixes: -Patch106: python-3.1.2-reformat-audioop.c.patch - -# CVE-2010-1634: fix various integer overflow checks in the audioop module -# This is the difference from r81032 to r81081 (i.e r81047 and r81081) -Patch107: python-3.1.2-CVE-2010-1634.patch - -# CVE-2010-2089: verify sizes/lengths within audioop module: -Patch108: python-3.1.2-CVE-2010-2089.patch - -# CVE-2008-5983: the new PySys_SetArgvEx entry point from r81400 (backported to -# the old layout before the whitespace cleanup of release31-maint in r81033): -Patch109: python-3.1.2-CVE-2008-5983.patch +Patch105: python-3.2a1-statvfs-f_flag-constants.patch # Fix an incompatibility between pyexpat and the system expat-2.0.1 that led to # a segfault running test_pyexpat.py (rhbz:610312) @@ -233,7 +254,19 @@ Patch110: python-3.1.2-fix-expat-issue9054.patch # to compile, or linker errors with "undefined reference to # `_PyParser_Grammar'": # Not yet sent upstream: -Patch111: python-3.1-fix-parallel-make.patch +Patch111: python-3.2a1-fix-parallel-make.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: +Patch300: autotool-intermediates.patch BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRequires: readline-devel, openssl-devel, gmp-devel @@ -343,9 +376,10 @@ It shares installation directories with the standard Python 3 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 3 implementation can load its own extensions. +%endif # with_debug_build %prep -%setup -q -n Python-%{version} +%setup -q -n Python-%{version}%{alphatag} chmod +x %{SOURCE1} %if 0%{?with_systemtap} @@ -370,34 +404,31 @@ rm -r Modules/zlib || exit 1 # # Apply patches: # -%patch0 -p1 -b .config -%patch1 -p1 -b .rpath +%patch1 -p1 %patch3 -p1 -b .remove-mimeaudio-tests %patch4 -p1 -b .apply-our-changes-to-expected-shebang %patch6 -p1 -b .no-static-lib -%patch7 -p1 -b .expat + %if 0%{?with_systemtap} %patch8 -p1 -b .systemtap %endif %if "%{_lib}" == "lib64" -%patch102 -p1 -b .lib64 +%patch102 -p1 %endif -%patch103 -p1 -b .debug-build +%patch103 -p1 + %patch104 -p1 -b .more-configuration-flags %patch105 -p1 -b .statvfs-f-flag-constants -%patch106 -p3 -b .reformat-audioop -%patch107 -p3 -b .CVE-2010-1634 -%patch108 -p1 -b .CVE-2010-2089 -%patch109 -p1 -b .CVE-2008-5983 - %patch110 -p0 -b .fix-expat-issue9054 %patch111 -p1 -b .parallel-grammar +%patch125 -p1 -b .less-verbose-COUNT_ALLOCS + # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. # @@ -408,6 +439,12 @@ sed --in-place \ --expression="s|http://docs.python.org/library|http://docs.python.org/%{pybasever}/library|g" \ Lib/pydoc.py || exit 1 +%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" @@ -418,10 +455,28 @@ export LINKCC="gcc" export CFLAGS="$CFLAGS `pkg-config --cflags openssl`" export LDFLAGS="$LDFLAGS `pkg-config --libs-only-L openssl`" -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 patch 8 (systemtap), we need to get a new header for configure to use: -autoheader +for f in pyconfig.h.in configure ; do + cp $f $f.autotool-intermediates ; +done + +# Rerun the autotools: +PATH=~/autoconf-2.65/bin:$PATH autoreconf + +# 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: @@ -548,7 +603,6 @@ install -m755 -d ${RPM_BUILD_ROOT}%{pylibdir}/Tools install Tools/README ${RPM_BUILD_ROOT}%{pylibdir}/Tools/ cp -ar Tools/freeze ${RPM_BUILD_ROOT}%{pylibdir}/Tools/ cp -ar Tools/i18n ${RPM_BUILD_ROOT}%{pylibdir}/Tools/ -cp -ar Tools/modulator ${RPM_BUILD_ROOT}%{pylibdir}/Tools/ cp -ar Tools/pynche ${RPM_BUILD_ROOT}%{pylibdir}/Tools/ cp -ar Tools/scripts ${RPM_BUILD_ROOT}%{pylibdir}/Tools/ @@ -804,93 +858,95 @@ rm -fr %{buildroot} %{_mandir}/*/* %dir %{pylibdir} %dir %{dynload_dir} -%{dynload_dir}/Python-%{version}-py%{pybasever}.egg-info -%{dynload_dir}/_bisectmodule.so +%{dynload_dir}/Python-%{version}%{alphatag}-py%{pybasever}.egg-info +%{dynload_dir}/_bisect.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}/_collections.so %{dynload_dir}/_csv.so %{dynload_dir}/_ctypes.so %{dynload_dir}/_curses.so %{dynload_dir}/_curses_panel.so %{dynload_dir}/_dbm.so %{dynload_dir}/_elementtree.so -%{dynload_dir}/_gdbmmodule.so +%{dynload_dir}/_gdbm.so %{dynload_dir}/_hashlib.so -%{dynload_dir}/_heapqmodule.so +%{dynload_dir}/_heapq.so %{dynload_dir}/_json.so %{dynload_dir}/_lsprof.so -%{dynload_dir}/_multibytecodecmodule.so +%{dynload_dir}/_multibytecodec.so %{dynload_dir}/_multiprocessing.so %{dynload_dir}/_pickle.so -%{dynload_dir}/_randommodule.so -%{dynload_dir}/_sha1module.so -%{dynload_dir}/_sha256module.so -%{dynload_dir}/_sha512module.so -%{dynload_dir}/_socketmodule.so +%{dynload_dir}/_posixsubprocess.so +%{dynload_dir}/_random.so +%{dynload_dir}/_socket.so %{dynload_dir}/_sqlite3.so %{dynload_dir}/_ssl.so %{dynload_dir}/_struct.so -%{dynload_dir}/_weakref.so -%{dynload_dir}/arraymodule.so -%{dynload_dir}/atexitmodule.so +%{dynload_dir}/array.so +%{dynload_dir}/atexit.so %{dynload_dir}/audioop.so %{dynload_dir}/binascii.so %{dynload_dir}/bz2.so -%{dynload_dir}/cmathmodule.so -%{dynload_dir}/cryptmodule.so -%{dynload_dir}/datetime.so -%{dynload_dir}/fcntlmodule.so -%{dynload_dir}/grpmodule.so -%{dynload_dir}/itertoolsmodule.so -%{dynload_dir}/mathmodule.so -%{dynload_dir}/mmapmodule.so -%{dynload_dir}/nismodule.so +%{dynload_dir}/cmath.so +%{dynload_dir}/crypt.so +%{dynload_dir}/_datetime.so +%{dynload_dir}/fcntl.so +%{dynload_dir}/grp.so +%{dynload_dir}/itertools.so +%{dynload_dir}/math.so +%{dynload_dir}/mmap.so +%{dynload_dir}/nis.so %{dynload_dir}/operator.so %{dynload_dir}/ossaudiodev.so -%{dynload_dir}/parsermodule.so +%{dynload_dir}/parser.so %{dynload_dir}/pyexpat.so %{dynload_dir}/readline.so %{dynload_dir}/resource.so -%{dynload_dir}/selectmodule.so -%{dynload_dir}/spwdmodule.so -%{dynload_dir}/syslogmodule.so +%{dynload_dir}/select.so +%{dynload_dir}/spwd.so +%{dynload_dir}/syslog.so %{dynload_dir}/termios.so -%{dynload_dir}/timemodule.so +%{dynload_dir}/time.so %{dynload_dir}/unicodedata.so -%{dynload_dir}/xxsubtype.so -%{dynload_dir}/zlibmodule.so +%{dynload_dir}/zlib.so %dir %{pylibdir}/site-packages %{pylibdir}/site-packages/README -%{pylibdir}/*.py* -%{pylibdir}/*.doc +%{pylibdir}/*.py +%{pylibdir}/__pycache__/*%{bytecode_suffixes} %{pylibdir}/wsgiref.egg-info %dir %{pylibdir}/ctypes -%{pylibdir}/ctypes/*.py* +%{pylibdir}/ctypes/*.py +%{pylibdir}/ctypes/__pycache__/*%{bytecode_suffixes} %{pylibdir}/ctypes/macholib %{pylibdir}/curses %dir %{pylibdir}/dbm -%{pylibdir}/dbm/*.py* +%{pylibdir}/dbm/*.py +%{pylibdir}/dbm/__pycache__/*%{bytecode_suffixes} %dir %{pylibdir}/distutils -%{pylibdir}/distutils/*.py* +%{pylibdir}/distutils/*.py +%{pylibdir}/distutils/__pycache__/*%{bytecode_suffixes} %{pylibdir}/distutils/README %{pylibdir}/distutils/command %dir %{pylibdir}/email -%{pylibdir}/email/*.py* +%{pylibdir}/email/*.py +%{pylibdir}/email/__pycache__/*%{bytecode_suffixes} %{pylibdir}/email/mime %{pylibdir}/encodings %{pylibdir}/html %{pylibdir}/http %{pylibdir}/idlelib %dir %{pylibdir}/importlib -%{pylibdir}/importlib/*.py* +%{pylibdir}/importlib/*.py +%{pylibdir}/importlib/__pycache__/*%{bytecode_suffixes} %dir %{pylibdir}/json -%{pylibdir}/json/*.py* +%{pylibdir}/json/*.py +%{pylibdir}/json/__pycache__/*%{bytecode_suffixes} %{pylibdir}/lib2to3 %exclude %{pylibdir}/lib2to3/tests %{pylibdir}/logging @@ -898,9 +954,14 @@ rm -fr %{buildroot} %{pylibdir}/plat-linux2 %{pylibdir}/pydoc_data %dir %{pylibdir}/sqlite3 -%{pylibdir}/sqlite3/*.py* +%{pylibdir}/sqlite3/*.py +%{pylibdir}/sqlite3/__pycache__/*%{bytecode_suffixes} %dir %{pylibdir}/test -%{pylibdir}/test/__init__.py* +%{pylibdir}/test/__init__.py +%{pylibdir}/test/__pycache__/__init__%{bytecode_suffixes} +%dir %{pylibdir}/unittest +%{pylibdir}/unittest/*.py +%{pylibdir}/unittest/__pycache__/*%{bytecode_suffixes} %{pylibdir}/urllib %{pylibdir}/wsgiref %{pylibdir}/xml @@ -967,11 +1028,14 @@ rm -fr %{buildroot} %{pylibdir}/sqlite3/test %{pylibdir}/test %{dynload_dir}/_ctypes_test.so -%{dynload_dir}/_testcapimodule.so +%{dynload_dir}/_testcapi.so %{pylibdir}/lib2to3/tests %doc %{pylibdir}/Demo/distutils %doc %{pylibdir}/Demo/md5test %{pylibdir}/tkinter/test +%dir %{pylibdir}/unittest/test +%{pylibdir}/unittest/test/*.py +%{pylibdir}/unittest/test/__pycache__/*%{bytecode_suffixes} # We don't bother splitting the debug build out into further subpackages: @@ -989,65 +1053,65 @@ rm -fr %{buildroot} %{_bindir}/python%{pybasever}-debug # ...with debug builds of the built-in "extension" modules: -%{dynload_dir}/_bisectmodule_d.so +%{dynload_dir}/_bisect_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}/_collections_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}/_dbm_d.so %{dynload_dir}/_elementtree_d.so -%{dynload_dir}/_gdbmmodule_d.so +%{dynload_dir}/_gdbm_d.so %{dynload_dir}/_hashlib_d.so -%{dynload_dir}/_heapqmodule_d.so +%{dynload_dir}/_heapq_d.so %{dynload_dir}/_json_d.so %{dynload_dir}/_lsprof_d.so -%{dynload_dir}/_multibytecodecmodule_d.so +%{dynload_dir}/_md5_d.so +%{dynload_dir}/_multibytecodec_d.so %{dynload_dir}/_multiprocessing_d.so %{dynload_dir}/_pickle_d.so -%{dynload_dir}/_randommodule_d.so -%{dynload_dir}/_sha1module_d.so -%{dynload_dir}/_sha256module_d.so -%{dynload_dir}/_sha512module_d.so -%{dynload_dir}/_socketmodule_d.so +%{dynload_dir}/_posixsubprocess_d.so +%{dynload_dir}/_random_d.so +%{dynload_dir}/_sha1_d.so +%{dynload_dir}/_sha256_d.so +%{dynload_dir}/_sha512_d.so +%{dynload_dir}/_socket_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}/atexitmodule_d.so +%{dynload_dir}/array_d.so +%{dynload_dir}/atexit_d.so %{dynload_dir}/audioop_d.so %{dynload_dir}/binascii_d.so %{dynload_dir}/bz2_d.so -%{dynload_dir}/cmathmodule_d.so -%{dynload_dir}/cryptmodule_d.so -%{dynload_dir}/datetime_d.so -%{dynload_dir}/fcntlmodule_d.so -%{dynload_dir}/grpmodule_d.so -%{dynload_dir}/itertoolsmodule_d.so -%{dynload_dir}/mathmodule_d.so -%{dynload_dir}/mmapmodule_d.so -%{dynload_dir}/nismodule_d.so +%{dynload_dir}/cmath_d.so +%{dynload_dir}/crypt_d.so +%{dynload_dir}/_datetime_d.so +%{dynload_dir}/fcntl_d.so +%{dynload_dir}/grp_d.so +%{dynload_dir}/itertools_d.so +%{dynload_dir}/math_d.so +%{dynload_dir}/mmap_d.so +%{dynload_dir}/nis_d.so %{dynload_dir}/operator_d.so %{dynload_dir}/ossaudiodev_d.so -%{dynload_dir}/parsermodule_d.so +%{dynload_dir}/parser_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}/syslogmodule_d.so +%{dynload_dir}/select_d.so +%{dynload_dir}/spwd_d.so +%{dynload_dir}/syslog_d.so %{dynload_dir}/termios_d.so -%{dynload_dir}/timemodule_d.so +%{dynload_dir}/time_d.so %{dynload_dir}/unicodedata_d.so -%{dynload_dir}/xxsubtype_d.so -%{dynload_dir}/zlibmodule_d.so +%{dynload_dir}/zlib_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 @@ -1078,7 +1142,7 @@ rm -fr %{buildroot} # Analog of the -test subpackage's files: %{dynload_dir}/_ctypes_test_d.so -%{dynload_dir}/_testcapimodule_d.so +%{dynload_dir}/_testcapi_d.so %endif # with_debug_build @@ -1097,6 +1161,26 @@ rm -fr %{buildroot} %changelog +* Sat Aug 21 2010 David Malcolm - 3.2-0.0.a1 +- 3.2a1; add alphatag +- rework %%files in the light of PEP 3147 (__pycache__) +- drop our configuration patch to Setup.dist (patch 0): setup.py should do a +better job of things, and the %%files explicitly lists our modules (r82746 +appears to break the old way of doing things). This leads to various modules +changing from "foomodule.so" to "foo.so". It also leads to the optimized build +dropping the _sha1, _sha256 and _sha512 modules, but these are provided by +_hashlib; _weakref becomes a builtin module; xxsubtype goes away (it's only for +testing/devel purposes) +- fixup patches 3, 4, 6, 8, 102, 103, 105, 111 for the rebase +- remove upstream patches: 7 (system expat), 106, 107, 108 (audioop reformat +plus CVE-2010-1634 and CVE-2010-2089), 109 (CVE-2008-5983) +- add machinery for rebuilding "configure" and friends, using the correct +version of autoconf (patch 300) +- patch the debug build's usage of COUNT_ALLOCS to be less verbose (patch 125) +- "modulator" was removed upstream +- drop "-b" from patch applications affecting .py files to avoid littering the +installation tree + * Thu Aug 19 2010 Toshio Kuratomi - 3.1.2-13 - Turn on computed-gotos. - Fix for parallel make and graminit.c diff --git a/sources b/sources index 30f03d2..c49803c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -45350b51b58a46b029fb06c61257e350 Python-3.1.2.tar.bz2 +b371e1f7a0e98e7a0d1792823fd0f58c Python-3.2a1.tar.bz2 From 997d5a24f2ed0138ce205d7709f5a6acb52fd531 Mon Sep 17 00:00:00 2001 From: Thomas Spura Date: Sun, 22 Aug 2010 14:40:58 +0200 Subject: [PATCH 036/416] - on 64bit "stdlib" was still "/usr/lib/python*" (modify *lib64.patch) - make find-provides-without-python-sonames.sh 64bit aware --- find-provides-without-python-sonames.sh | 5 +++-- python-3.2a1-lib64.patch | 19 +++++++++++++++++++ python3.spec | 4 ++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/find-provides-without-python-sonames.sh b/find-provides-without-python-sonames.sh index 406a675..8961b87 100755 --- a/find-provides-without-python-sonames.sh +++ b/find-provides-without-python-sonames.sh @@ -9,6 +9,7 @@ # So we strip out all /usr/lib/python lines first, before running them through # the standard script: -grep -v "/usr/lib/python" | /usr/lib/rpm/find-provides +grep -v "/usr/lib/python" | grep -v "/usr/lib64/python" | \ + /usr/lib/rpm/find-provides -exit 0 \ No newline at end of file +exit 0 diff --git a/python-3.2a1-lib64.patch b/python-3.2a1-lib64.patch index d778b5a..df7eb68 100644 --- a/python-3.2a1-lib64.patch +++ b/python-3.2a1-lib64.patch @@ -144,3 +144,22 @@ diff -up Python-3.2a1/Modules/getpath.c.lib64 Python-3.2a1/Modules/getpath.c ] ) if (ssl_incs is not None and +Index: Lib/sysconfig.py +=================================================================== +--- Lib/sysconfig.py ++++ Lib/sysconfig.py 2010-08-22 14:34:38.791426924 +0200 +@@ -11,10 +11,10 @@ + + _INSTALL_SCHEMES = { + 'posix_prefix': { +- 'stdlib': '{base}/lib/python{py_version_short}', +- 'platstdlib': '{platbase}/lib/python{py_version_short}', +- 'purelib': '{base}/lib/python{py_version_short}/site-packages', +- 'platlib': '{platbase}/lib/python{py_version_short}/site-packages', ++ 'stdlib': '{base}/lib64/python{py_version_short}', ++ 'platstdlib': '{platbase}/lib64/python{py_version_short}', ++ 'purelib': '{base}/lib64/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', diff --git a/python3.spec b/python3.spec index 15a8549..381333a 100644 --- a/python3.spec +++ b/python3.spec @@ -1161,6 +1161,10 @@ rm -fr %{buildroot} %changelog +* Sun Aug 22 2010 Thomas Spura - 3.2-0.1.a1 +- on 64bit "stdlib" was still "/usr/lib/python*" (modify *lib64.patch) +- make find-provides-without-python-sonames.sh 64bit aware + * Sat Aug 21 2010 David Malcolm - 3.2-0.0.a1 - 3.2a1; add alphatag - rework %%files in the light of PEP 3147 (__pycache__) From 1559439d3f1821f03e7c98c3fc00e1a95e8603e6 Mon Sep 17 00:00:00 2001 From: Thomas Spura Date: Sun, 22 Aug 2010 14:42:27 +0200 Subject: [PATCH 037/416] correct latest patch edit... --- python-3.2a1-lib64.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python-3.2a1-lib64.patch b/python-3.2a1-lib64.patch index df7eb68..dd259c0 100644 --- a/python-3.2a1-lib64.patch +++ b/python-3.2a1-lib64.patch @@ -146,8 +146,8 @@ diff -up Python-3.2a1/Modules/getpath.c.lib64 Python-3.2a1/Modules/getpath.c if (ssl_incs is not None and Index: Lib/sysconfig.py =================================================================== ---- Lib/sysconfig.py -+++ Lib/sysconfig.py 2010-08-22 14:34:38.791426924 +0200 +--- Python-3.2a1/Lib/sysconfig.py ++++ Python-3.2a1/Lib/sysconfig.py 2010-08-22 14:34:38.791426924 +0200 @@ -11,10 +11,10 @@ _INSTALL_SCHEMES = { From 762f268f6b1777d2f00dd41c70636891d259b5d8 Mon Sep 17 00:00:00 2001 From: Thomas Spura Date: Sun, 22 Aug 2010 15:11:59 +0200 Subject: [PATCH 038/416] forgot to bump the release --- python3.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 381333a..8974f07 100644 --- a/python3.spec +++ b/python3.spec @@ -88,7 +88,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever} -Release: 0.0.%{alphatag}%{?dist} +Release: 0.1.%{alphatag}%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}%{alphatag}.tar.bz2 From 13c4a4f869cc8276b0b63cac37895daceaf1d329 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Sun, 22 Aug 2010 14:48:47 -0400 Subject: [PATCH 039/416] - Add __pycache__ directory for site-packages --- python3.spec | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/python3.spec b/python3.spec index 8974f07..571fa46 100644 --- a/python3.spec +++ b/python3.spec @@ -88,7 +88,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever} -Release: 0.1.%{alphatag}%{?dist} +Release: 0.2.%{alphatag}%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}%{alphatag}.tar.bz2 @@ -594,7 +594,7 @@ InstallPython debug \ InstallPython optimized \ %{py_INSTSONAME_optimized} -mkdir -p ${RPM_BUILD_ROOT}%{pylibdir}/site-packages +install -d -m 0755 ${RPM_BUILD_ROOT}%{pylibdir}/site-packages/__pycache__ mv ${RPM_BUILD_ROOT}%{_bindir}/2to3 ${RPM_BUILD_ROOT}%{_bindir}/python3-2to3 @@ -617,7 +617,7 @@ cp -ar Demo %{buildroot}%{pylibdir}/ rm -f %{buildroot}%{pylibdir}/email/test/data/audiotest.au %{buildroot}%{pylibdir}/test/audiotest.au %if "%{_lib}" == "lib64" -install -d %{buildroot}/usr/lib/python%{pybasever}/site-packages +install -d -m 0755 %{buildroot}/usr/lib/python%{pybasever}/site-packages/__pycache__ %endif # Make python3-devel multilib-ready (bug #192747, #139911) @@ -915,7 +915,8 @@ rm -fr %{buildroot} %{dynload_dir}/unicodedata.so %{dynload_dir}/zlib.so -%dir %{pylibdir}/site-packages +%dir %{pylibdir}/site-packages/ +%dir %{pylibdir}/site-packages/__pycache__/ %{pylibdir}/site-packages/README %{pylibdir}/*.py %{pylibdir}/__pycache__/*%{bytecode_suffixes} @@ -969,6 +970,7 @@ rm -fr %{buildroot} %if "%{_lib}" == "lib64" %attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever} %attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}/site-packages +%attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}/site-packages/__pycache__/ %endif # "Makefile" and the config-32/64.h file are needed by @@ -1161,6 +1163,9 @@ rm -fr %{buildroot} %changelog +* Sun Aug 22 2010 Toshio Kuratomi - 3.2-0.2.a1 +- Add __pycache__ directory for site-packages + * Sun Aug 22 2010 Thomas Spura - 3.2-0.1.a1 - on 64bit "stdlib" was still "/usr/lib/python*" (modify *lib64.patch) - make find-provides-without-python-sonames.sh 64bit aware From e1c7be02b9c4543cb0b26d6b9c02ea4d95fc3d4b Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Wed, 8 Sep 2010 19:01:56 -0400 Subject: [PATCH 040/416] - Move test.support to core package (rhbz#596258) - Add various missing __pycache__ directories to payload --- python3.spec | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/python3.spec b/python3.spec index 571fa46..59fc334 100644 --- a/python3.spec +++ b/python3.spec @@ -88,7 +88,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever} -Release: 0.2.%{alphatag}%{?dist} +Release: 0.3.%{alphatag}%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}%{alphatag}.tar.bz2 @@ -919,22 +919,27 @@ rm -fr %{buildroot} %dir %{pylibdir}/site-packages/__pycache__/ %{pylibdir}/site-packages/README %{pylibdir}/*.py +%dir %{pylibdir}/__pycache__/ %{pylibdir}/__pycache__/*%{bytecode_suffixes} %{pylibdir}/wsgiref.egg-info %dir %{pylibdir}/ctypes +%dir %{pylibdir}/ctypes/__pycache__/ %{pylibdir}/ctypes/*.py %{pylibdir}/ctypes/__pycache__/*%{bytecode_suffixes} %{pylibdir}/ctypes/macholib %{pylibdir}/curses %dir %{pylibdir}/dbm +%dir %{pylibdir}/dbm/__pycache__/ %{pylibdir}/dbm/*.py %{pylibdir}/dbm/__pycache__/*%{bytecode_suffixes} %dir %{pylibdir}/distutils +%dir %{pylibdir}/distutils/__pycache__/ %{pylibdir}/distutils/*.py %{pylibdir}/distutils/__pycache__/*%{bytecode_suffixes} %{pylibdir}/distutils/README %{pylibdir}/distutils/command %dir %{pylibdir}/email +%dir %{pylibdir}/email/__pycache__/ %{pylibdir}/email/*.py %{pylibdir}/email/__pycache__/*%{bytecode_suffixes} %{pylibdir}/email/mime @@ -943,9 +948,11 @@ rm -fr %{buildroot} %{pylibdir}/http %{pylibdir}/idlelib %dir %{pylibdir}/importlib +%dir %{pylibdir}/importlib/__pycache__/ %{pylibdir}/importlib/*.py %{pylibdir}/importlib/__pycache__/*%{bytecode_suffixes} %dir %{pylibdir}/json +%dir %{pylibdir}/json/__pycache__/ %{pylibdir}/json/*.py %{pylibdir}/json/__pycache__/*%{bytecode_suffixes} %{pylibdir}/lib2to3 @@ -955,12 +962,17 @@ rm -fr %{buildroot} %{pylibdir}/plat-linux2 %{pylibdir}/pydoc_data %dir %{pylibdir}/sqlite3 +%dir %{pylibdir}/sqlite3/__pycache__/ %{pylibdir}/sqlite3/*.py %{pylibdir}/sqlite3/__pycache__/*%{bytecode_suffixes} %dir %{pylibdir}/test +%dir %{pylibdir}/test/__pycache__/ %{pylibdir}/test/__init__.py +%{pylibdir}/test/support.py %{pylibdir}/test/__pycache__/__init__%{bytecode_suffixes} +%{pylibdir}/test/__pycache__/support%{bytecode_suffixes} %dir %{pylibdir}/unittest +%dir %{pylibdir}/unittest/__pycache__/ %{pylibdir}/unittest/*.py %{pylibdir}/unittest/__pycache__/*%{bytecode_suffixes} %{pylibdir}/urllib @@ -1035,9 +1047,7 @@ rm -fr %{buildroot} %doc %{pylibdir}/Demo/distutils %doc %{pylibdir}/Demo/md5test %{pylibdir}/tkinter/test -%dir %{pylibdir}/unittest/test -%{pylibdir}/unittest/test/*.py -%{pylibdir}/unittest/test/__pycache__/*%{bytecode_suffixes} +%{pylibdir}/unittest/test # We don't bother splitting the debug build out into further subpackages: @@ -1163,6 +1173,10 @@ rm -fr %{buildroot} %changelog +* Wed Sep 8 2010 David Malcolm - 3.2-0.3.a1 +- Move test.support to core package (rhbz#596258) +- Add various missing __pycache__ directories to payload + * Sun Aug 22 2010 Toshio Kuratomi - 3.2-0.2.a1 - Add __pycache__ directory for site-packages From 26c1be588d2f33c0a44cec2d5c557fdefbc83257 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Thu, 9 Sep 2010 14:52:31 -0400 Subject: [PATCH 041/416] * Thu Sep 9 2010 David Malcolm - 3.2-0.4.a1 - move most of the content of the core package to the libs subpackage, given that the libs aren't meaningfully usable without the standard libraries --- python3.spec | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/python3.spec b/python3.spec index 59fc334..6ec9621 100644 --- a/python3.spec +++ b/python3.spec @@ -88,7 +88,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever} -Release: 0.3.%{alphatag}%{?dist} +Release: 0.4.%{alphatag}%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}%{alphatag}.tar.bz2 @@ -288,6 +288,8 @@ URL: http://www.python.org/ # See notes in bug 532118: Provides: python(abi) = %{pybasever} +Requires: %{name}-libs%{?_isa} = %{version}-%{release} + %description Python 3 is a new version of the language that is incompatible with the 2.x line of releases. The language is mostly the same, but many details, especially @@ -856,6 +858,10 @@ rm -fr %{buildroot} %{_bindir}/python3 %{_bindir}/python%{pybasever} %{_mandir}/*/* + +%files libs +%defattr(-,root,root,-) +%doc LICENSE README %dir %{pylibdir} %dir %{dynload_dir} %{dynload_dir}/Python-%{version}%{alphatag}-py%{pybasever}.egg-info @@ -993,8 +999,6 @@ rm -fr %{buildroot} %dir %{_includedir}/python%{pybasever} %{_includedir}/python%{pybasever}/%{_pyconfig_h} -%files libs -%defattr(-,root,root,-) %{_libdir}/%{py_INSTSONAME_optimized} %if 0%{?with_systemtap} %{tapsetdir}/%{libpython_stp_optimized} @@ -1064,6 +1068,7 @@ rm -fr %{buildroot} %{_bindir}/python3-debug %{_bindir}/python%{pybasever}-debug +# Analog of the -libs subpackage's files: # ...with debug builds of the built-in "extension" modules: %{dynload_dir}/_bisect_d.so %{dynload_dir}/_codecs_cn_d.so @@ -1129,7 +1134,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} @@ -1173,6 +1177,10 @@ rm -fr %{buildroot} %changelog +* Thu Sep 9 2010 David Malcolm - 3.2-0.4.a1 +- move most of the content of the core package to the libs subpackage, given +that the libs aren't meaningfully usable without the standard libraries + * Wed Sep 8 2010 David Malcolm - 3.2-0.3.a1 - Move test.support to core package (rhbz#596258) - Add various missing __pycache__ directories to payload From 824c34b61eb34b3b7f0e3e3bd20eb8cd06c14087 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Wed, 17 Nov 2010 15:03:29 -0500 Subject: [PATCH 042/416] fix sysconfig to not rely on the -devel subpackage (rhbz#653058) --- python3.spec | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/python3.spec b/python3.spec index 6ec9621..ec10905 100644 --- a/python3.spec +++ b/python3.spec @@ -88,7 +88,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever} -Release: 0.4.%{alphatag}%{?dist} +Release: 0.5.%{alphatag}%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}%{alphatag}.tar.bz2 @@ -655,7 +655,15 @@ EOF done # 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 (bug 653058) +# +# 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 # Switch all shebangs to refer to the specific Python version. LD_LIBRARY_PATH=./build/optimized ./build/optimized/python \ @@ -1177,6 +1185,9 @@ rm -fr %{buildroot} %changelog +* Wed Nov 17 2010 David Malcolm - 3.2-0.5.a1 +- fix sysconfig to not rely on the -devel subpackage (rhbz#653058) + * Thu Sep 9 2010 David Malcolm - 3.2-0.4.a1 - move most of the content of the core package to the libs subpackage, given that the libs aren't meaningfully usable without the standard libraries From 5080ffc5d367eee28d2c2268675e98bde0dfcf1b Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Wed, 29 Dec 2010 13:26:29 -0500 Subject: [PATCH 043/416] * Tue Dec 28 2010 David Malcolm - 3.2-0.5.b2 - 3.2b2 - rework patch 3 (removal of mimeaudio tests), patch 6 (no static libs), patch 8 (systemtap), patch 102 (lib64) - remove patch 4 (rendered redundant by upstream r85537), patch 103 (PEP 3149), patch 110 (upstreamed expat fix), patch 111 (parallel build fix for grammar fixed upstream) - regenerate patch 300 (autotool intermediates) - workaround COUNT_ALLOCS weakref issues in test suite (patch 126, patch 127, patch 128) - stop using runtest.sh in %%check (dropped by upstream), replacing with regrtest; fixup list of failing tests - introduce "pyshortver", "SOABI_optimized" and "SOABI_debug" macros - rework manifests of shared libraries to use "SOABI_" macros, reflecting PEP 3149 - drop itertools, operator and _collections modules from the manifests as py3k commit r84058 moved these inside libpython; json/tests moved to test/json_tests - move turtle code into the tkinter subpackage --- .gitignore | 1 + autotool-intermediates.patch | 1518 ++++++++++++++++- python-3.2b2-fix-test-gc-COUNT_ALLOCS.patch | 22 + ...a1-lib64.patch => python-3.2b2-lib64.patch | 145 +- ....patch => python-3.2b2-no-static-lib.patch | 24 +- ... python-3.2b2-remove-mimeaudio-tests.patch | 12 +- ...mtap.patch => python-3.2b2-systemtap.patch | 70 +- ...-3.2b2-test-weakref-COUNT_ALLOCS_fix.patch | 17 + python-3.2b2-test_sys-COUNT_ALLOCS.patch | 13 + python3.spec | 553 +++--- sources | 1 + 11 files changed, 1910 insertions(+), 466 deletions(-) create mode 100644 python-3.2b2-fix-test-gc-COUNT_ALLOCS.patch rename python-3.2a1-lib64.patch => python-3.2b2-lib64.patch (53%) rename python-3.2a1-no-static-lib.patch => python-3.2b2-no-static-lib.patch (60%) rename python-3.2a1-remove-mimeaudio-tests.patch => python-3.2b2-remove-mimeaudio-tests.patch (86%) rename python-3.2a1-systemtap.patch => python-3.2b2-systemtap.patch (70%) create mode 100644 python-3.2b2-test-weakref-COUNT_ALLOCS_fix.patch create mode 100644 python-3.2b2-test_sys-COUNT_ALLOCS.patch diff --git a/.gitignore b/.gitignore index 43efa0f..474e8a7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ libpython-36a517ef7848cbd0b3dcc7371f32e47ac4c87eba.tar.gz Python-3.1.2.tar.bz2 Python-3.2a1.tar.bz2 +/Python-3.2b2.tar.bz2 diff --git a/autotool-intermediates.patch b/autotool-intermediates.patch index efbf3bf..8af26e3 100644 --- a/autotool-intermediates.patch +++ b/autotool-intermediates.patch @@ -1,14 +1,71 @@ diff -up ./configure.autotool-intermediates ./configure ---- ./configure.autotool-intermediates 2010-08-02 17:58:12.238002650 -0400 -+++ ./configure 2010-08-02 17:58:20.151000507 -0400 -@@ -1,5 +1,5 @@ +--- ./configure.autotool-intermediates 2010-12-28 18:47:15.206934478 -0500 ++++ ./configure 2010-12-28 18:47:21.053058461 -0500 +@@ -1,14 +1,14 @@ #! /bin/sh --# From configure.in Revision: 82090 . -+# From configure.in Revision: 82962 . + # From configure.in Revision: 87207 . # Guess values for system-dependent variables and create Makefiles. - # Generated by GNU Autoconf 2.65 for python 3.2. +-# Generated by GNU Autoconf 2.67 for python 3.2. ++# Generated by GNU Autoconf 2.65 for python 3.2. # -@@ -610,6 +610,8 @@ TRUE + # Report bugs to . + # + # + # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software +-# Foundation, Inc. ++# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, ++# Inc. + # + # + # This configure script is free software; the Free Software Foundation +@@ -320,7 +320,7 @@ $as_echo X"$as_dir" | + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" +- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" ++ } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + + + } # as_fn_mkdir_p +@@ -360,19 +360,19 @@ else + fi # as_fn_arith + + +-# as_fn_error STATUS ERROR [LINENO LOG_FD] +-# ---------------------------------------- ++# as_fn_error ERROR [LINENO LOG_FD] ++# --------------------------------- + # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are + # provided, also output the error to LOG_FD, referencing LINENO. Then exit the +-# script with STATUS, using 1 if that was 0. ++# script with status $?, using 1 if that was 0. + as_fn_error () + { +- as_status=$1; test $as_status -eq 0 && as_status=1 +- if test "$4"; then +- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack +- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 ++ as_status=$?; test $as_status -eq 0 && as_status=1 ++ if test "$3"; then ++ as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + fi +- $as_echo "$as_me: error: $2" >&2 ++ $as_echo "$as_me: error: $1" >&2 + as_fn_exit $as_status + } # as_fn_error + +@@ -534,7 +534,7 @@ test -n "$DJDIR" || exec 7<&0 &1 + + # Name of the host. +-# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, ++# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, + # so uname gets run too. + ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +@@ -611,6 +611,8 @@ TRUE MACHDEP_OBJS DYNLOADFILE DLINCLDIR @@ -17,16 +74,7 @@ diff -up ./configure.autotool-intermediates ./configure THREADOBJ LDLAST USE_THREAD_MODULE -@@ -630,6 +632,8 @@ OTHER_LIBTOOL_OPT - UNIVERSAL_ARCH_FLAGS - BASECFLAGS - OPT -+DEBUG_SUFFIX -+DEBUG_EXT - LN - INSTALL_DATA - INSTALL_SCRIPT -@@ -743,8 +747,11 @@ with_thread +@@ -748,8 +750,11 @@ with_thread enable_ipv6 with_doc_strings with_tsc @@ -35,10 +83,149 @@ diff -up ./configure.autotool-intermediates ./configure with_pymalloc with_valgrind +with_dtrace - with_wctype_functions with_fpectl with_libm -@@ -1414,8 +1421,11 @@ Optional Packages: + with_libc +@@ -828,9 +833,8 @@ do + fi + + case $ac_option in +- *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; +- *=) ac_optarg= ;; +- *) ac_optarg=yes ;; ++ *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; ++ *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. +@@ -875,7 +879,7 @@ do + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && +- as_fn_error $? "invalid feature name: $ac_useropt" ++ as_fn_error "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in +@@ -901,7 +905,7 @@ do + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && +- as_fn_error $? "invalid feature name: $ac_useropt" ++ as_fn_error "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in +@@ -1105,7 +1109,7 @@ do + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && +- as_fn_error $? "invalid package name: $ac_useropt" ++ as_fn_error "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in +@@ -1121,7 +1125,7 @@ do + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && +- as_fn_error $? "invalid package name: $ac_useropt" ++ as_fn_error "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in +@@ -1151,8 +1155,8 @@ do + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + +- -*) as_fn_error $? "unrecognized option: \`$ac_option' +-Try \`$0 --help' for more information" ++ -*) as_fn_error "unrecognized option: \`$ac_option' ++Try \`$0 --help' for more information." + ;; + + *=*) +@@ -1160,7 +1164,7 @@ Try \`$0 --help' for more information" + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) +- as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; ++ as_fn_error "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; +@@ -1178,13 +1182,13 @@ done + + if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` +- as_fn_error $? "missing argument to $ac_option" ++ as_fn_error "missing argument to $ac_option" + fi + + if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; +- fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; ++ fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac + fi +@@ -1207,7 +1211,7 @@ do + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac +- as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" ++ as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" + done + + # There might be people who depend on the old broken behavior: `$host' +@@ -1221,8 +1225,8 @@ target=$target_alias + if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe +- $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. +- If a cross compiler is detected then cross compile mode will be used" >&2 ++ $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. ++ If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +@@ -1237,9 +1241,9 @@ test "$silent" = yes && exec 6>/dev/null + ac_pwd=`pwd` && test -n "$ac_pwd" && + ac_ls_di=`ls -di .` && + ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || +- as_fn_error $? "working directory cannot be determined" ++ as_fn_error "working directory cannot be determined" + test "X$ac_ls_di" = "X$ac_pwd_ls_di" || +- as_fn_error $? "pwd does not report name of working directory" ++ as_fn_error "pwd does not report name of working directory" + + + # Find the source files, if location was not specified. +@@ -1278,11 +1282,11 @@ else + fi + if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." +- as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" ++ as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" + fi + ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" + ac_abs_confdir=`( +- cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" ++ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" + pwd)` + # When building in place, set srcdir=. + if test "$ac_abs_confdir" = "$ac_pwd"; then +@@ -1322,7 +1326,7 @@ Configuration: + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit +- -q, --quiet, --silent do not print \`checking ...' messages ++ -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files +@@ -1421,8 +1425,11 @@ Optional Packages: deprecated; use --with(out)-threads --with(out)-doc-strings disable/enable documentation strings --with(out)-tsc enable/disable timestamp counter profile @@ -47,10 +234,120 @@ diff -up ./configure.autotool-intermediates ./configure --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 -@@ -1929,11 +1939,11 @@ else + --with-libc=STRING C library +@@ -1508,9 +1515,9 @@ test -n "$ac_init_help" && exit $ac_stat + if $ac_init_version; then + cat <<\_ACEOF + python configure 3.2 +-generated by GNU Autoconf 2.67 ++generated by GNU Autoconf 2.65 + +-Copyright (C) 2010 Free Software Foundation, Inc. ++Copyright (C) 2009 Free Software Foundation, Inc. + This configure script is free software; the Free Software Foundation + gives unlimited permission to copy, distribute and modify it. + _ACEOF +@@ -1580,7 +1587,7 @@ $as_echo "$ac_try_echo"; } >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 +- test $ac_status = 0; } > conftest.i && { ++ test $ac_status = 0; } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : +@@ -1604,10 +1611,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 { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; 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 { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 + fi + eval ac_res=\$$3 +@@ -1643,7 +1650,7 @@ if ac_fn_c_try_cpp "$LINENO"; then : + else + ac_header_preproc=no + fi +-rm -f conftest.err conftest.i conftest.$ac_ext ++rm -f conftest.err conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 + $as_echo "$ac_header_preproc" >&6; } + +@@ -1666,15 +1673,17 @@ $as_echo "$as_me: WARNING: $2: see the A + $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 + $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +-( $as_echo "## -------------------------------------- ## ++( cat <<\_ASBOX ++## -------------------------------------- ## + ## Report this to http://bugs.python.org/ ## +-## -------------------------------------- ##" ++## -------------------------------------- ## ++_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; + 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 { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 + else + eval "$3=\$ac_header_compiler" +@@ -1738,7 +1747,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 { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -1815,7 +1824,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 { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 + else + eval "$3=no" +@@ -1869,7 +1878,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 { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 + else + eval "$3=no" +@@ -1899,7 +1908,8 @@ if ac_fn_c_try_compile "$LINENO"; then : + esac + fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +- if eval test \"x\$"$3"\" = x"no"; then : ++ eval as_val=\$$3 ++ if test "x$as_val" = x""no; then : + + else + break +@@ -1922,7 +1932,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 { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 + else + eval "$3=no" +@@ -1933,11 +1943,11 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default @@ -64,7 +361,7 @@ diff -up ./configure.autotool-intermediates ./configure test_array [0] = 0 ; -@@ -1944,11 +1954,11 @@ if ac_fn_c_try_compile "$LINENO"; then : +@@ -1948,11 +1958,11 @@ if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default @@ -78,50 +375,637 @@ diff -up ./configure.autotool-intermediates ./configure < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))]; test_array [0] = 0 -@@ -4672,7 +4682,7 @@ esac - $as_echo_n "checking LIBRARY... " >&6; } - if test -z "$LIBRARY" +@@ -1973,7 +1983,8 @@ fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +- if eval test \"x\$"$3"\" = x"no"; then : ++ eval as_val=\$$3 ++ if test "x$as_val" = x""no; then : + + else + break +@@ -2173,7 +2184,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 { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -2241,7 +2252,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 { as_var=$4; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -2289,18 +2300,15 @@ $as_echo "$ac_res" >&6; } + + } # ac_fn_c_check_member + +-# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES +-# --------------------------------------------- +-# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +-# accordingly. ++# ac_fn_c_check_decl LINENO SYMBOL VAR ++# ------------------------------------ ++# Tests whether SYMBOL is declared, setting cache variable VAR accordingly. + ac_fn_c_check_decl () + { + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack +- as_decl_name=`echo $2|sed 's/ *(.*//'` +- 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 : ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $2 is declared" >&5 ++$as_echo_n "checking whether $2 is declared... " >&6; } ++if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -2309,12 +2317,8 @@ $4 + int + main () + { +-#ifndef $as_decl_name +-#ifdef __cplusplus +- (void) $as_decl_use; +-#else +- (void) $as_decl_name; +-#endif ++#ifndef $2 ++ (void) $2; + #endif + + ; +@@ -2339,7 +2343,7 @@ This file contains any messages produced + running configure, to aid debugging if configure makes a mistake. + + It was created by python $as_me 3.2, which was +-generated by GNU Autoconf 2.67. Invocation command line was ++generated by GNU Autoconf 2.65. Invocation command line was + + $ $0 $@ + +@@ -2449,9 +2453,11 @@ trap 'exit_status=$? + { + echo + +- $as_echo "## ---------------- ## ++ cat <<\_ASBOX ++## ---------------- ## + ## Cache variables. ## +-## ---------------- ##" ++## ---------------- ## ++_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, + ( +@@ -2485,9 +2491,11 @@ $as_echo "$as_me: WARNING: cache variabl + ) + echo + +- $as_echo "## ----------------- ## ++ cat <<\_ASBOX ++## ----------------- ## + ## Output variables. ## +-## ----------------- ##" ++## ----------------- ## ++_ASBOX + echo + for ac_var in $ac_subst_vars + do +@@ -2500,9 +2508,11 @@ $as_echo "$as_me: WARNING: cache variabl + echo + + if test -n "$ac_subst_files"; then +- $as_echo "## ------------------- ## ++ cat <<\_ASBOX ++## ------------------- ## + ## File substitutions. ## +-## ------------------- ##" ++## ------------------- ## ++_ASBOX + echo + for ac_var in $ac_subst_files + do +@@ -2516,9 +2526,11 @@ $as_echo "$as_me: WARNING: cache variabl + fi + + if test -s confdefs.h; then +- $as_echo "## ----------- ## ++ cat <<\_ASBOX ++## ----------- ## + ## confdefs.h. ## +-## ----------- ##" ++## ----------- ## ++_ASBOX + echo + cat confdefs.h + echo +@@ -2573,12 +2585,7 @@ _ACEOF + ac_site_file1=NONE + ac_site_file2=NONE + if test -n "$CONFIG_SITE"; then +- # We do not want a PATH search for config.site. +- case $CONFIG_SITE in #(( +- -*) ac_site_file1=./$CONFIG_SITE;; +- */*) ac_site_file1=$CONFIG_SITE;; +- *) ac_site_file1=./$CONFIG_SITE;; +- esac ++ ac_site_file1=$CONFIG_SITE + elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +@@ -2593,11 +2600,7 @@ do + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 + $as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 +- . "$ac_site_file" \ +- || { { $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 ; } ++ . "$ac_site_file" + fi + done + +@@ -2673,7 +2676,7 @@ if $ac_cache_corrupted; then + $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 + $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} +- as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 ++ as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 + fi + ## -------------------- ## + ## Main body of script. ## +@@ -2774,7 +2777,7 @@ if test "${enable_universalsdk+set}" = s + UNIVERSALSDK=$enableval + if test ! -d "${UNIVERSALSDK}" + then +- as_fn_error $? "--enable-universalsdk specifies non-existing SDK: ${UNIVERSALSDK}" "$LINENO" 5 ++ as_fn_error "--enable-universalsdk specifies non-existing SDK: ${UNIVERSALSDK}" "$LINENO" 5 + fi + ;; + esac +@@ -3166,7 +3169,7 @@ $as_echo "$without_gcc" >&6; } + # If the user switches compilers, we can't believe the cache + if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC" 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; } -@@ -4843,8 +4853,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*) -@@ -5237,6 +5247,14 @@ $as_echo "no" >&6; } +- as_fn_error $? "cached CC is different -- throw away $cache_file ++ as_fn_error "cached CC is different -- throw away $cache_file + (it is also a good idea to do 'make clean' before compiling)" "$LINENO" 5 fi +@@ -3476,8 +3479,8 @@ 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? + 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 ; } ++as_fn_error "no acceptable C compiler found in \$PATH ++See \`config.log' for more details." "$LINENO" 5; } -@@ -8160,6 +8178,7 @@ fi - $as_echo "$with_system_expat" >&6; } + # Provide some information about the compiler. + $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +@@ -3591,8 +3594,9 @@ sed 's/^/| /' conftest.$ac_ext >&5 - # Check for use of the system libffi library -+ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-system-ffi" >&5 - $as_echo_n "checking for --with-system-ffi... " >&6; } + { { $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 ; } ++{ as_fn_set_status 77 ++as_fn_error "C compiler cannot create executables ++See \`config.log' for more details." "$LINENO" 5; }; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + $as_echo "yes" >&6; } +@@ -3634,8 +3638,8 @@ done + 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 ; } ++as_fn_error "cannot compute suffix of executables: cannot compile and link ++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 +@@ -3692,9 +3696,9 @@ $as_echo "$ac_try_echo"; } >&5 + 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 run C compiled programs. ++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 +@@ -3745,8 +3749,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 -@@ -9144,6 +9163,50 @@ $as_echo "no" >&6; } + { { $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 ; } ++as_fn_error "cannot compute suffix of object files: cannot compile ++See \`config.log' for more details." "$LINENO" 5; } + fi + rm -f conftest.$ac_cv_objext conftest.$ac_ext + fi +@@ -4199,7 +4203,7 @@ else + # Broken: fails on valid input. + continue + fi +-rm -f conftest.err conftest.i conftest.$ac_ext ++rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. +@@ -4215,11 +4219,11 @@ else + ac_preproc_ok=: + break + fi +-rm -f conftest.err conftest.i conftest.$ac_ext ++rm -f conftest.err conftest.$ac_ext + + done + # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +-rm -f conftest.i conftest.err conftest.$ac_ext ++rm -f conftest.err conftest.$ac_ext + if $ac_preproc_ok; then : + break + fi +@@ -4258,7 +4262,7 @@ else + # Broken: fails on valid input. + continue + fi +-rm -f conftest.err conftest.i conftest.$ac_ext ++rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. +@@ -4274,18 +4278,18 @@ else + ac_preproc_ok=: + break + fi +-rm -f conftest.err conftest.i conftest.$ac_ext ++rm -f conftest.err conftest.$ac_ext + + done + # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +-rm -f conftest.i conftest.err conftest.$ac_ext ++rm -f conftest.err conftest.$ac_ext + if $ac_preproc_ok; then : + + 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 ; } ++as_fn_error "C preprocessor \"$CPP\" fails sanity check ++See \`config.log' for more details." "$LINENO" 5; } + fi + + ac_ext=c +@@ -4346,7 +4350,7 @@ esac + done + IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then +- as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 ++ as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi + else + ac_cv_path_GREP=$GREP +@@ -4412,7 +4416,7 @@ esac + done + IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then +- as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 ++ as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi + else + ac_cv_path_EGREP=$EGREP +@@ -4544,7 +4548,8 @@ do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` + ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default + " +-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : ++eval as_val=\$$as_ac_Header ++ if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF + #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 + _ACEOF +@@ -5158,22 +5163,16 @@ bsdos*|hp*|HP*) + esac + ac_aux_dir= + for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do +- if test -f "$ac_dir/install-sh"; then +- ac_aux_dir=$ac_dir +- ac_install_sh="$ac_aux_dir/install-sh -c" +- break +- elif test -f "$ac_dir/install.sh"; then +- ac_aux_dir=$ac_dir +- ac_install_sh="$ac_aux_dir/install.sh -c" +- break +- elif test -f "$ac_dir/shtool"; then +- ac_aux_dir=$ac_dir +- ac_install_sh="$ac_aux_dir/shtool install -c" +- break +- fi ++ for ac_t in install-sh install.sh shtool; do ++ if test -f "$ac_dir/$ac_t"; then ++ ac_aux_dir=$ac_dir ++ ac_install_sh="$ac_aux_dir/$ac_t -c" ++ break 2 ++ fi ++ done + done + if test -z "$ac_aux_dir"; then +- as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 ++ as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 + fi + + # These three variables are undocumented and unsupported, +@@ -5511,7 +5510,7 @@ $as_echo "$CC" >&6; } + ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc" + + else +- as_fn_error $? "proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way" "$LINENO" 5 ++ as_fn_error "proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way" "$LINENO" 5 + + fi + +@@ -6005,7 +6004,8 @@ bluetooth/bluetooth.h linux/tipc.h spawn + do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` + ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : ++eval as_val=\$$as_ac_Header ++ if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF + #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 + _ACEOF +@@ -6019,7 +6019,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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -6046,7 +6046,8 @@ fi + eval ac_res=\$$as_ac_Header + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 + $as_echo "$ac_res" >&6; } +-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : ++eval as_val=\$$as_ac_Header ++ if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF + #define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 + _ACEOF +@@ -6566,8 +6567,9 @@ else + if test "$ac_cv_type_int" = yes; then + { { $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 ; } ++{ as_fn_set_status 77 ++as_fn_error "cannot compute sizeof (int) ++See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_int=0 + fi +@@ -6599,8 +6601,9 @@ else + if test "$ac_cv_type_long" = yes; then + { { $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 ; } ++{ as_fn_set_status 77 ++as_fn_error "cannot compute sizeof (long) ++See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_long=0 + fi +@@ -6632,8 +6635,9 @@ else + if test "$ac_cv_type_void_p" = yes; then + { { $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 ; } ++{ as_fn_set_status 77 ++as_fn_error "cannot compute sizeof (void *) ++See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_void_p=0 + fi +@@ -6665,8 +6669,9 @@ else + if test "$ac_cv_type_short" = yes; then + { { $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 ; } ++{ as_fn_set_status 77 ++as_fn_error "cannot compute sizeof (short) ++See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_short=0 + fi +@@ -6698,8 +6703,9 @@ else + if test "$ac_cv_type_float" = yes; then + { { $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 ; } ++{ as_fn_set_status 77 ++as_fn_error "cannot compute sizeof (float) ++See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_float=0 + fi +@@ -6731,8 +6737,9 @@ else + if test "$ac_cv_type_double" = yes; then + { { $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 ; } ++{ as_fn_set_status 77 ++as_fn_error "cannot compute sizeof (double) ++See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_double=0 + fi +@@ -6764,8 +6771,9 @@ else + if test "$ac_cv_type_fpos_t" = yes; then + { { $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 ; } ++{ as_fn_set_status 77 ++as_fn_error "cannot compute sizeof (fpos_t) ++See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_fpos_t=0 + fi +@@ -6797,8 +6805,9 @@ else + if test "$ac_cv_type_size_t" = yes; then + { { $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 ; } ++{ as_fn_set_status 77 ++as_fn_error "cannot compute sizeof (size_t) ++See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_size_t=0 + fi +@@ -6830,8 +6839,9 @@ else + if test "$ac_cv_type_pid_t" = yes; then + { { $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 ; } ++{ as_fn_set_status 77 ++as_fn_error "cannot compute sizeof (pid_t) ++See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_pid_t=0 + fi +@@ -6890,8 +6900,9 @@ else + if test "$ac_cv_type_long_long" = yes; then + { { $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 ; } ++{ as_fn_set_status 77 ++as_fn_error "cannot compute sizeof (long long) ++See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_long_long=0 + fi +@@ -6951,8 +6962,9 @@ else + if test "$ac_cv_type_long_double" = yes; then + { { $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 ; } ++{ as_fn_set_status 77 ++as_fn_error "cannot compute sizeof (long double) ++See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_long_double=0 + fi +@@ -7013,8 +7025,9 @@ else + if test "$ac_cv_type__Bool" = yes; then + { { $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 ; } ++{ as_fn_set_status 77 ++as_fn_error "cannot compute sizeof (_Bool) ++See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof__Bool=0 + fi +@@ -7061,8 +7074,9 @@ else + if test "$ac_cv_type_uintptr_t" = yes; then + { { $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 ; } ++{ as_fn_set_status 77 ++as_fn_error "cannot compute sizeof (uintptr_t) ++See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_uintptr_t=0 + fi +@@ -7102,8 +7116,9 @@ else + if test "$ac_cv_type_off_t" = yes; then + { { $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 ; } ++{ as_fn_set_status 77 ++as_fn_error "cannot compute sizeof (off_t) ++See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_off_t=0 + fi +@@ -7164,8 +7179,9 @@ else + if test "$ac_cv_type_time_t" = yes; then + { { $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 ; } ++{ as_fn_set_status 77 ++as_fn_error "cannot compute sizeof (time_t) ++See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_time_t=0 + fi +@@ -7236,8 +7252,9 @@ else + if test "$ac_cv_type_pthread_t" = yes; then + { { $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 ; } ++{ as_fn_set_status 77 ++as_fn_error "cannot compute sizeof (pthread_t) ++See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_pthread_t=0 + fi +@@ -7324,7 +7341,7 @@ fi + MACOSX_DEFAULT_ARCH="ppc" + ;; + *) +- as_fn_error $? "Unexpected output of 'arch' on OSX" "$LINENO" 5 ++ as_fn_error "Unexpected output of 'arch' on OSX" "$LINENO" 5 + ;; + esac + else +@@ -7336,7 +7353,7 @@ fi + MACOSX_DEFAULT_ARCH="ppc64" + ;; + *) +- as_fn_error $? "Unexpected output of 'arch' on OSX" "$LINENO" 5 ++ as_fn_error "Unexpected output of 'arch' on OSX" "$LINENO" 5 + ;; + esac + +@@ -7362,7 +7379,7 @@ $as_echo "#define WITH_NEXT_FRAMEWORK 1" + $as_echo "yes" >&6; } + if test $enable_shared = "yes" + then +- as_fn_error $? "Specifying both --enable-shared and --enable-framework is not supported, use only --enable-framework instead" "$LINENO" 5 ++ as_fn_error "Specifying both --enable-shared and --enable-framework is not supported, use only --enable-framework instead" "$LINENO" 5 + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +@@ -8158,12 +8175,12 @@ if test "${with_dbmliborder+set}" = set; + withval=$with_dbmliborder; + if test x$with_dbmliborder = xyes + then +-as_fn_error $? "proper usage is --with-dbmliborder=db1:db2:..." "$LINENO" 5 ++as_fn_error "proper usage is --with-dbmliborder=db1:db2:..." "$LINENO" 5 + else + for db in `echo $with_dbmliborder | sed 's/:/ /g'`; do + if test x$db != xndbm && test x$db != xgdbm && test x$db != xbdb + then +- as_fn_error $? "proper usage is --with-dbmliborder=db1:db2:..." "$LINENO" 5 ++ as_fn_error "proper usage is --with-dbmliborder=db1:db2:..." "$LINENO" 5 + fi + done + fi +@@ -9118,6 +9135,50 @@ $as_echo "no" >&6; } fi @@ -172,7 +1056,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; } -@@ -9194,6 +9257,46 @@ fi +@@ -9162,7 +9223,7 @@ if test "x$ac_cv_header_valgrind_valgrin + $as_echo "#define WITH_VALGRIND 1" >>confdefs.h + + else +- as_fn_error $? "Valgrind support requested but headers not available" "$LINENO" 5 ++ as_fn_error "Valgrind support requested but headers not available" "$LINENO" 5 + + fi + +@@ -9170,6 +9231,46 @@ fi OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT" fi @@ -216,12 +1109,497 @@ 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; } + # -I${DLINCLDIR} is added to the compile rule for importdl.o + + DLINCLDIR=. +@@ -9256,7 +9357,8 @@ for ac_func in alarm accept4 setitimer g + do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` + ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +-if eval test \"x\$"$as_ac_var"\" = x"yes"; then : ++eval as_val=\$$as_ac_var ++ if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF + #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 + _ACEOF +@@ -10251,7 +10353,8 @@ for ac_func in fseek64 fseeko fstatvfs f + do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` + ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +-if eval test \"x\$"$as_ac_var"\" = x"yes"; then : ++eval as_val=\$$as_ac_var ++ if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF + #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 + _ACEOF +@@ -10260,44 +10363,25 @@ fi + done + + +-ac_fn_c_check_func "$LINENO" "dup2" "ac_cv_func_dup2" +-if test "x$ac_cv_func_dup2" = x""yes; then : +- $as_echo "#define HAVE_DUP2 1" >>confdefs.h +- +-else +- case " $LIBOBJS " in +- *" dup2.$ac_objext "* ) ;; +- *) LIBOBJS="$LIBOBJS dup2.$ac_objext" +- ;; +-esac +- +-fi +- +-ac_fn_c_check_func "$LINENO" "getcwd" "ac_cv_func_getcwd" +-if test "x$ac_cv_func_getcwd" = x""yes; then : +- $as_echo "#define HAVE_GETCWD 1" >>confdefs.h +- +-else +- case " $LIBOBJS " in +- *" getcwd.$ac_objext "* ) ;; +- *) LIBOBJS="$LIBOBJS getcwd.$ac_objext" +- ;; +-esac +- +-fi +- +-ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup" +-if test "x$ac_cv_func_strdup" = x""yes; then : +- $as_echo "#define HAVE_STRDUP 1" >>confdefs.h ++for ac_func in dup2 getcwd strdup ++do : ++ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ++ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" ++eval as_val=\$$as_ac_var ++ if test "x$as_val" = x""yes; then : ++ cat >>confdefs.h <<_ACEOF ++#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 ++_ACEOF + + else + case " $LIBOBJS " in +- *" strdup.$ac_objext "* ) ;; +- *) LIBOBJS="$LIBOBJS strdup.$ac_objext" ++ *" $ac_func.$ac_objext "* ) ;; ++ *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" + ;; + esac + + fi ++done + + + for ac_func in getpgrp +@@ -11510,7 +11594,7 @@ elif test "$withval" != yes + then LIBM=$withval + { $as_echo "$as_me:${as_lineno-$LINENO}: result: set LIBM=\"$withval\"" >&5 + $as_echo "set LIBM=\"$withval\"" >&6; } +-else as_fn_error $? "proper usage is --with-libm=STRING" "$LINENO" 5 ++else as_fn_error "proper usage is --with-libm=STRING" "$LINENO" 5 + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: default LIBM=\"$LIBM\"" >&5 +@@ -11534,7 +11618,7 @@ elif test "$withval" != yes + then LIBC=$withval + { $as_echo "$as_me:${as_lineno-$LINENO}: result: set LIBC=\"$withval\"" >&5 + $as_echo "set LIBC=\"$withval\"" >&6; } +-else as_fn_error $? "proper usage is --with-libc=STRING" "$LINENO" 5 ++else as_fn_error "proper usage is --with-libc=STRING" "$LINENO" 5 + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: default LIBC=\"$LIBC\"" >&5 +@@ -11784,7 +11868,8 @@ for ac_func in acosh asinh atanh copysig + do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` + ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +-if eval test \"x\$"$as_ac_var"\" = x"yes"; then : ++eval as_val=\$$as_ac_var ++ if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF + #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 + _ACEOF +@@ -11796,7 +11881,8 @@ for ac_func in hypot lgamma log1p round + do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` + ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +-if eval test \"x\$"$as_ac_var"\" = x"yes"; then : ++eval as_val=\$$as_ac_var ++ if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF + #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 + _ACEOF +@@ -12059,7 +12145,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; } +@@ -12110,8 +12196,9 @@ else + if test "$ac_cv_type_wchar_t" = yes; then + { { $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 ; } ++{ as_fn_set_status 77 ++as_fn_error "cannot compute sizeof (wchar_t) ++See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_wchar_t=0 + fi +@@ -12480,8 +12567,8 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUI + + ;; #( + *) +- as_fn_error $? "unknown endianness +- presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; ++ as_fn_error "unknown endianness ++ presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + + +@@ -12742,7 +12829,7 @@ else + have_readline=no + + fi +-rm -f conftest.err conftest.i conftest.$ac_ext ++rm -f conftest.err conftest.$ac_ext + if test $have_readline = yes + then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -12916,7 +13003,7 @@ else + have_readline=no + + fi +-rm -f conftest.err conftest.i conftest.$ac_ext ++rm -f conftest.err conftest.$ac_ext + if test $have_readline = yes + then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -13732,7 +13819,7 @@ esac + + + case $ac_sys_system in +- OSF*) as_fn_error $? "OSF* systems are deprecated unless somebody volunteers. Check http://bugs.python.org/issue8606" "$LINENO" 5 ;; ++ OSF*) as_fn_error "OSF* systems are deprecated unless somebody volunteers. Check http://bugs.python.org/issue8606" "$LINENO" 5 ;; + esac + + ac_fn_c_check_func "$LINENO" "pipe2" "ac_cv_func_pipe2" +@@ -13850,7 +13937,6 @@ DEFS=-DHAVE_CONFIG_H + + ac_libobjs= + ac_ltlibobjs= +-U= + for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' +@@ -14013,19 +14099,19 @@ export LANGUAGE + (unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +-# as_fn_error STATUS ERROR [LINENO LOG_FD] +-# ---------------------------------------- ++# as_fn_error ERROR [LINENO LOG_FD] ++# --------------------------------- + # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are + # provided, also output the error to LOG_FD, referencing LINENO. Then exit the +-# script with STATUS, using 1 if that was 0. ++# script with status $?, using 1 if that was 0. + as_fn_error () + { +- as_status=$1; test $as_status -eq 0 && as_status=1 +- if test "$4"; then +- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack +- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 ++ as_status=$?; test $as_status -eq 0 && as_status=1 ++ if test "$3"; then ++ as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + fi +- $as_echo "$as_me: error: $2" >&2 ++ $as_echo "$as_me: error: $1" >&2 + as_fn_exit $as_status + } # as_fn_error + +@@ -14221,7 +14307,7 @@ $as_echo X"$as_dir" | + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" +- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" ++ } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + + + } # as_fn_mkdir_p +@@ -14275,7 +14361,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri + # values after options handling. + ac_log=" + This file was extended by python $as_me 3.2, which was +-generated by GNU Autoconf 2.67. Invocation command line was ++generated by GNU Autoconf 2.65. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS +@@ -14337,10 +14423,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_writ + ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" + ac_cs_version="\\ + python config.status 3.2 +-configured by $0, generated by GNU Autoconf 2.67, ++configured by $0, generated by GNU Autoconf 2.65, + with options \\"\$ac_cs_config\\" + +-Copyright (C) 2010 Free Software Foundation, Inc. ++Copyright (C) 2009 Free Software Foundation, Inc. + This config.status script is free software; the Free Software Foundation + gives unlimited permission to copy, distribute and modify it." + +@@ -14356,16 +14442,11 @@ ac_need_defaults=: + while test $# != 0 + do + case $1 in +- --*=?*) ++ --*=*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; +- --*=) +- ac_option=`expr "X$1" : 'X\([^=]*\)='` +- ac_optarg= +- ac_shift=: +- ;; + *) + ac_option=$1 + ac_optarg=$2 +@@ -14387,7 +14468,6 @@ do + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; +- '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; +@@ -14400,7 +14480,7 @@ do + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header +- as_fn_error $? "ambiguous option: \`$1' ++ as_fn_error "ambiguous option: \`$1' + Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; +@@ -14409,7 +14489,7 @@ Try \`$0 --help' for more information."; + ac_cs_silent=: ;; + + # This is an error. +- -*) as_fn_error $? "unrecognized option: \`$1' ++ -*) as_fn_error "unrecognized option: \`$1' + Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" +@@ -14468,7 +14548,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 + +@@ -14505,7 +14585,7 @@ $debug || + { + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +-} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ++} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 + + # Set up the scripts for CONFIG_FILES section. + # No need to generate them if there are no CONFIG_FILES. +@@ -14522,7 +14602,7 @@ if test "x$ac_cr" = x; then + fi + ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` + if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then +- ac_cs_awk_cr='\\r' ++ ac_cs_awk_cr='\r' + else + ac_cs_awk_cr=$ac_cr + fi +@@ -14536,18 +14616,18 @@ _ACEOF + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" + } >conf$$subs.sh || +- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +-ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ++ as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 ++ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` + ac_delim='%!_!# ' + for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || +- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ++ as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then +- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ++ as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +@@ -14636,28 +14716,20 @@ if sed "s/$ac_cr//" < /dev/null > /dev/n + else + cat + fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ +- || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 ++ || as_fn_error "could not setup config files machinery" "$LINENO" 5 + _ACEOF + +-# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +-# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and ++# VPATH may cause trouble with some makes, so we remove $(srcdir), ++# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and + # trailing colons and then remove the whole line if VPATH becomes empty + # (actually we leave an empty line to preserve line numbers). + if test "x$srcdir" = x.; then +- ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +-h +-s/// +-s/^/:/ +-s/[ ]*$/:/ +-s/:\$(srcdir):/:/g +-s/:\${srcdir}:/:/g +-s/:@srcdir@:/:/g +-s/^:*// ++ ac_vpsub='/^[ ]*VPATH[ ]*=/{ ++s/:*\$(srcdir):*/:/ ++s/:*\${srcdir}:*/:/ ++s/:*@srcdir@:*/:/ ++s/^\([^=]*=[ ]*\):*/\1/ + s/:*$// +-x +-s/\(=[ ]*\).*/\1/ +-G +-s/\n// + s/^[^=]*=[ ]*$// + }' + fi +@@ -14685,7 +14757,7 @@ for ac_last_try in false false :; do + if test -z "$ac_t"; then + break + elif $ac_last_try; then +- as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 ++ as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +@@ -14770,7 +14842,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_writ + _ACAWK + _ACEOF + cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +- as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 ++ as_fn_error "could not setup config headers machinery" "$LINENO" 5 + fi # test -n "$CONFIG_HEADERS" + + +@@ -14783,7 +14855,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 +@@ -14811,7 +14883,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 "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'" +@@ -14838,7 +14910,7 @@ $as_echo "$as_me: creating $ac_file" >&6 + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin" \ +- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; ++ || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac +@@ -14969,22 +15041,22 @@ 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 ++ || 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"; } && + { $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 ++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;} ++which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ +- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ++ || as_fn_error "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # +@@ -14995,19 +15067,19 @@ which seems to be undefined. Please mak + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" + } >"$tmp/config.h" \ +- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ++ || as_fn_error "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$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" \ +- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ++ || 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" \ +- || as_fn_error $? "could not create -" "$LINENO" 5 ++ || as_fn_error "could not create -" "$LINENO" 5 + fi + ;; + +@@ -15027,7 +15099,7 @@ _ACEOF + ac_clean_files=$ac_clean_files_save + + test $ac_write_fail = 0 || +- as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 ++ as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + + # configure is writing to config.log, and then calls config.status. +@@ -15048,7 +15120,7 @@ if test "$no_create" != yes; then + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. +- $ac_cs_success || as_fn_exit 1 ++ $ac_cs_success || as_fn_exit $? + fi + if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 diff -up ./pyconfig.h.in.autotool-intermediates ./pyconfig.h.in ---- ./pyconfig.h.in.autotool-intermediates 2010-08-02 17:58:12.236001348 -0400 -+++ ./pyconfig.h.in 2010-08-02 17:58:20.000000000 -0400 +--- ./pyconfig.h.in.autotool-intermediates 2010-12-28 18:47:15.203935226 -0500 ++++ ./pyconfig.h.in 2010-12-28 18:47:21.330060783 -0500 @@ -12,15 +12,15 @@ support for AIX C++ shared extension modules. */ #undef AIX_GENUINE_CPLUSPLUS @@ -241,3 +1619,13 @@ diff -up ./pyconfig.h.in.autotool-intermediates ./pyconfig.h.in /* Define if C doubles are 64-bit IEEE 754 binary format, stored in ARM mixed-endian order (byte order 45670123) */ #undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 +@@ -503,6 +503,9 @@ + /* Define to 1 if you have the `pause' function. */ + #undef HAVE_PAUSE + ++/* Define if the OS supports pipe2() */ ++#undef HAVE_PIPE2 ++ + /* Define to 1 if you have the `plock' function. */ + #undef HAVE_PLOCK + diff --git a/python-3.2b2-fix-test-gc-COUNT_ALLOCS.patch b/python-3.2b2-fix-test-gc-COUNT_ALLOCS.patch new file mode 100644 index 0000000..337e39e --- /dev/null +++ b/python-3.2b2-fix-test-gc-COUNT_ALLOCS.patch @@ -0,0 +1,22 @@ +diff -up Python-3.2b2/Lib/test/test_gc.py.fix-test-gc-COUNT_ALLOCS Python-3.2b2/Lib/test/test_gc.py +--- Python-3.2b2/Lib/test/test_gc.py.fix-test-gc-COUNT_ALLOCS 2010-12-28 20:39:40.779059772 -0500 ++++ Python-3.2b2/Lib/test/test_gc.py 2010-12-28 20:41:15.890940017 -0500 +@@ -102,10 +102,16 @@ 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) ++ if hasattr(sys, 'getcounts'): ++ self.assertEqual(gc.collect(), 0) ++ else: ++ self.assertNotEqual(gc.collect(), 0) + self.assertEqual(gc.collect(), 0) + + def test_method(self): diff --git a/python-3.2a1-lib64.patch b/python-3.2b2-lib64.patch similarity index 53% rename from python-3.2a1-lib64.patch rename to python-3.2b2-lib64.patch index dd259c0..8d4e91f 100644 --- a/python-3.2a1-lib64.patch +++ b/python-3.2b2-lib64.patch @@ -1,13 +1,13 @@ -diff -up Python-3.2a1/Lib/distutils/command/install.py.lib64 Python-3.2a1/Lib/distutils/command/install.py ---- Python-3.2a1/Lib/distutils/command/install.py.lib64 2010-07-22 08:50:05.000000000 -0400 -+++ Python-3.2a1/Lib/distutils/command/install.py 2010-08-02 18:33:15.667001759 -0400 +diff -up Python-3.2b2/Lib/distutils/command/install.py.lib64 Python-3.2b2/Lib/distutils/command/install.py +--- Python-3.2b2/Lib/distutils/command/install.py.lib64 2010-11-24 22:46:44.000000000 -0500 ++++ Python-3.2b2/Lib/distutils/command/install.py 2010-12-29 10:21:55.510184563 -0500 @@ -47,14 +47,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', + 'headers': '$base/include/python$py_version_short$abiflags/$dist_name', 'scripts': '$base/bin', 'data' : '$base', }, @@ -18,10 +18,10 @@ diff -up Python-3.2a1/Lib/distutils/command/install.py.lib64 Python-3.2a1/Lib/di 'headers': '$base/include/python/$dist_name', 'scripts': '$base/bin', 'data' : '$base', -diff -up Python-3.2a1/Lib/distutils/sysconfig.py.lib64 Python-3.2a1/Lib/distutils/sysconfig.py ---- Python-3.2a1/Lib/distutils/sysconfig.py.lib64 2010-07-23 05:43:17.000000000 -0400 -+++ Python-3.2a1/Lib/distutils/sysconfig.py 2010-08-02 18:33:15.669000547 -0400 -@@ -117,8 +117,12 @@ def get_python_lib(plat_specific=0, stan +diff -up Python-3.2b2/Lib/distutils/sysconfig.py.lib64 Python-3.2b2/Lib/distutils/sysconfig.py +--- Python-3.2b2/Lib/distutils/sysconfig.py.lib64 2010-11-24 14:43:47.000000000 -0500 ++++ Python-3.2b2/Lib/distutils/sysconfig.py 2010-12-29 10:21:55.510184563 -0500 +@@ -124,8 +124,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-3.2a1/Lib/distutils/sysconfig.py.lib64 Python-3.2a1/Lib/distutil if standard_lib: return libpython else: -diff -up Python-3.2a1/Lib/site.py.lib64 Python-3.2a1/Lib/site.py ---- Python-3.2a1/Lib/site.py.lib64 2010-06-27 17:45:24.000000000 -0400 -+++ Python-3.2a1/Lib/site.py 2010-08-02 18:34:30.584001242 -0400 -@@ -283,12 +283,16 @@ def getsitepackages(): +diff -up Python-3.2b2/Lib/site.py.lib64 Python-3.2b2/Lib/site.py +--- Python-3.2b2/Lib/site.py.lib64 2010-10-12 18:23:23.000000000 -0400 ++++ Python-3.2b2/Lib/site.py 2010-12-29 10:21:55.511184595 -0500 +@@ -275,12 +275,16 @@ def getsitepackages(): if sys.platform in ('os2emx', 'riscos'): sitepackages.append(os.path.join(prefix, "Lib", "site-packages")) elif os.sep == '/': @@ -55,22 +55,75 @@ diff -up Python-3.2a1/Lib/site.py.lib64 Python-3.2a1/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-3.2a1/Makefile.pre.in.lib64 Python-3.2a1/Makefile.pre.in ---- Python-3.2a1/Makefile.pre.in.lib64 2010-08-02 18:33:15.000000000 -0400 -+++ Python-3.2a1/Makefile.pre.in 2010-08-02 18:35:07.147000664 -0400 -@@ -100,7 +100,7 @@ LIBDIR= @libdir@ +diff -up Python-3.2b2/Lib/sysconfig.py.lib64 Python-3.2b2/Lib/sysconfig.py +--- Python-3.2b2/Lib/sysconfig.py.lib64 2010-11-24 20:34:47.000000000 -0500 ++++ Python-3.2b2/Lib/sysconfig.py 2010-12-29 10:21:55.512184877 -0500 +@@ -21,10 +21,10 @@ __all__ = [ + + _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}{abiflags}', + 'platinclude': +@@ -81,10 +81,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 -up Python-3.2b2/Lib/test/test_site.py.lib64 Python-3.2b2/Lib/test/test_site.py +--- Python-3.2b2/Lib/test/test_site.py.lib64 2010-12-29 10:35:12.417308989 -0500 ++++ Python-3.2b2/Lib/test/test_site.py 2010-12-29 10:36:27.124059073 -0500 +@@ -164,12 +164,15 @@ 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) +- 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: + self.assertEqual(len(dirs), 2) + self.assertEqual(dirs[0], 'xoxo') +diff -up Python-3.2b2/Makefile.pre.in.lib64 Python-3.2b2/Makefile.pre.in +--- Python-3.2b2/Makefile.pre.in.lib64 2010-12-29 10:21:55.506183982 -0500 ++++ Python-3.2b2/Makefile.pre.in 2010-12-29 10:21:55.512184877 -0500 +@@ -102,7 +102,7 @@ LIBDIR= @libdir@ MANDIR= @mandir@ INCLUDEDIR= @includedir@ CONFINCLUDEDIR= $(exec_prefix)/include -SCRIPTDIR= $(prefix)/lib +SCRIPTDIR= $(prefix)/lib64 + ABIFLAGS= @ABIFLAGS@ # Detailed destination directories - BINLIBDEST= $(LIBDIR)/python$(VERSION) -diff -up Python-3.2a1/Modules/getpath.c.lib64 Python-3.2a1/Modules/getpath.c ---- Python-3.2a1/Modules/getpath.c.lib64 2010-07-23 12:05:35.000000000 -0400 -+++ Python-3.2a1/Modules/getpath.c 2010-08-02 18:35:50.857000717 -0400 -@@ -117,8 +117,8 @@ +diff -up Python-3.2b2/Modules/getpath.c.lib64 Python-3.2b2/Modules/getpath.c +--- Python-3.2b2/Modules/getpath.c.lib64 2010-12-03 15:14:31.000000000 -0500 ++++ Python-3.2b2/Modules/getpath.c 2010-12-29 10:21:55.513184358 -0500 +@@ -122,8 +122,8 @@ #endif #ifndef PYTHONPATH @@ -81,45 +134,46 @@ diff -up Python-3.2a1/Modules/getpath.c.lib64 Python-3.2a1/Modules/getpath.c #endif #ifndef LANDMARK -@@ -129,7 +129,7 @@ static wchar_t prefix[MAXPATHLEN+1]; +@@ -134,7 +134,7 @@ static wchar_t prefix[MAXPATHLEN+1]; static wchar_t exec_prefix[MAXPATHLEN+1]; static wchar_t progpath[MAXPATHLEN+1]; static wchar_t *module_search_path = NULL; -static wchar_t *lib_python = L"lib/python" VERSION; +static wchar_t *lib_python = L"lib64/python" VERSION; - /* In principle, this should use HAVE__WSTAT, and _wstat - should be detected by autoconf. However, no current -@@ -603,7 +603,7 @@ calculate_path(void) + static void + reduce(wchar_t *dir) +@@ -582,7 +582,7 @@ calculate_path(void) } else - wcsncpy(zip_path, L"" PREFIX, MAXPATHLEN); + wcsncpy(zip_path, _prefix, MAXPATHLEN); - joinpath(zip_path, L"lib/python00.zip"); + joinpath(zip_path, L"lib64/python00.zip"); bufsz = wcslen(zip_path); /* Replace "00" with version */ zip_path[bufsz - 6] = VERSION[0]; zip_path[bufsz - 5] = VERSION[2]; -@@ -613,7 +613,7 @@ calculate_path(void) +@@ -592,7 +592,7 @@ calculate_path(void) fprintf(stderr, "Could not find platform dependent libraries \n"); - wcsncpy(exec_prefix, L"" EXEC_PREFIX, MAXPATHLEN); + wcsncpy(exec_prefix, _exec_prefix, MAXPATHLEN); - joinpath(exec_prefix, L"lib/lib-dynload"); + joinpath(exec_prefix, L"lib64/lib-dynload"); } /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */ ---- Python-3.2a1/setup.py.lib64 2010-07-23 15:25:47.000000000 -0400 -+++ Python-3.2a1/setup.py 2010-08-02 18:36:51.521000448 -0400 -@@ -343,7 +343,7 @@ class PyBuildExt(build_ext): - - def detect_modules(self): - # Ensure that /usr/local is always used +diff -up Python-3.2b2/setup.py.lib64 Python-3.2b2/setup.py +--- Python-3.2b2/setup.py.lib64 2010-12-04 13:36:03.000000000 -0500 ++++ Python-3.2b2/setup.py 2010-12-29 10:21:55.514184248 -0500 +@@ -373,7 +373,7 @@ class PyBuildExt(build_ext): + # Ensure that /usr/local is always used, but the local build + # directories (i.e. '.' and 'Include') must be first. See issue + # 10520. - 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 -@@ -587,11 +587,11 @@ class PyBuildExt(build_ext): +@@ -619,11 +619,11 @@ class PyBuildExt(build_ext): elif curses_library: readline_libs.append(curses_library) elif self.compiler.find_library_file(lib_dirs + @@ -133,7 +187,7 @@ diff -up Python-3.2a1/Modules/getpath.c.lib64 Python-3.2a1/Modules/getpath.c extra_link_args=readline_extra_link_args, libraries=readline_libs) ) else: -@@ -628,8 +628,8 @@ class PyBuildExt(build_ext): +@@ -660,8 +660,8 @@ class PyBuildExt(build_ext): if krb5_h: ssl_incs += krb5_h ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, @@ -144,22 +198,3 @@ diff -up Python-3.2a1/Modules/getpath.c.lib64 Python-3.2a1/Modules/getpath.c ] ) if (ssl_incs is not None and -Index: Lib/sysconfig.py -=================================================================== ---- Python-3.2a1/Lib/sysconfig.py -+++ Python-3.2a1/Lib/sysconfig.py 2010-08-22 14:34:38.791426924 +0200 -@@ -11,10 +11,10 @@ - - _INSTALL_SCHEMES = { - 'posix_prefix': { -- 'stdlib': '{base}/lib/python{py_version_short}', -- 'platstdlib': '{platbase}/lib/python{py_version_short}', -- 'purelib': '{base}/lib/python{py_version_short}/site-packages', -- 'platlib': '{platbase}/lib/python{py_version_short}/site-packages', -+ 'stdlib': '{base}/lib64/python{py_version_short}', -+ 'platstdlib': '{platbase}/lib64/python{py_version_short}', -+ 'purelib': '{base}/lib64/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', diff --git a/python-3.2a1-no-static-lib.patch b/python-3.2b2-no-static-lib.patch similarity index 60% rename from python-3.2a1-no-static-lib.patch rename to python-3.2b2-no-static-lib.patch index 6dd8147..3ef3bc2 100644 --- a/python-3.2a1-no-static-lib.patch +++ b/python-3.2b2-no-static-lib.patch @@ -1,17 +1,17 @@ -diff -up Python-3.2a1/Makefile.pre.in.no-static-lib Python-3.2a1/Makefile.pre.in ---- Python-3.2a1/Makefile.pre.in.no-static-lib 2010-07-17 16:39:23.000000000 -0400 -+++ Python-3.2a1/Makefile.pre.in 2010-08-02 16:02:28.378010008 -0400 -@@ -416,7 +416,7 @@ coverage: +diff -up Python-3.2b2/Makefile.pre.in.no-static-lib Python-3.2b2/Makefile.pre.in +--- Python-3.2b2/Makefile.pre.in.no-static-lib 2010-12-13 13:04:23.000000000 -0500 ++++ Python-3.2b2/Makefile.pre.in 2010-12-28 16:57:11.484065804 -0500 +@@ -420,7 +420,7 @@ coverage: # Build the interpreter -$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY) +$(BUILDPYTHON): Modules/python.o $(LDLIBRARY) - $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ \ - Modules/python.o \ - $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) -@@ -432,18 +432,6 @@ sharedmods: $(BUILDPYTHON) - *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(PY_LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \ + $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Modules/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) + + platform: $(BUILDPYTHON) +@@ -434,18 +434,6 @@ sharedmods: $(BUILDPYTHON) + *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \ esac -# Build static library @@ -26,10 +26,10 @@ diff -up Python-3.2a1/Makefile.pre.in.no-static-lib Python-3.2a1/Makefile.pre.in - $(AR) $(ARFLAGS) $@ $(MODOBJS) - $(RANLIB) $@ - - libpython$(VERSION).so: $(LIBRARY_OBJS) + libpython$(LDVERSION).so: $(LIBRARY_OBJS) if test $(INSTSONAME) != $(LDLIBRARY); then \ - $(LDSHARED) $(PY_LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ -@@ -1003,18 +991,6 @@ libainstall: all python-config + $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ +@@ -1035,18 +1023,6 @@ libainstall: all python-config else true; \ fi; \ done diff --git a/python-3.2a1-remove-mimeaudio-tests.patch b/python-3.2b2-remove-mimeaudio-tests.patch similarity index 86% rename from python-3.2a1-remove-mimeaudio-tests.patch rename to python-3.2b2-remove-mimeaudio-tests.patch index ff67690..118b7b2 100644 --- a/python-3.2a1-remove-mimeaudio-tests.patch +++ b/python-3.2b2-remove-mimeaudio-tests.patch @@ -1,10 +1,10 @@ -diff -up Python-3.2a1/Lib/email/test/test_email.py.remove-mimeaudio-tests Python-3.2a1/Lib/email/test/test_email.py ---- Python-3.2a1/Lib/email/test/test_email.py.remove-mimeaudio-tests 2010-08-02 15:52:12.397002172 -0400 -+++ Python-3.2a1/Lib/email/test/test_email.py 2010-08-02 15:52:38.132999850 -0400 -@@ -952,53 +952,6 @@ Blah blah blah +diff -up Python-3.2b2/Lib/email/test/test_email.py.remove-mimeaudio-tests Python-3.2b2/Lib/email/test/test_email.py +--- Python-3.2b2/Lib/email/test/test_email.py.remove-mimeaudio-tests 2010-12-18 13:25:38.000000000 -0500 ++++ Python-3.2b2/Lib/email/test/test_email.py 2010-12-28 16:50:34.910309105 -0500 +@@ -977,53 +977,6 @@ Blah blah blah + - -# Test the basic MIMEAudio class -class TestMIMEAudio(unittest.TestCase): - def setUp(self): @@ -51,7 +51,7 @@ diff -up Python-3.2a1/Lib/email/test/test_email.py.remove-mimeaudio-tests Python - header='foobar') is missing) - - -- +- # Test the basic MIMEImage class class TestMIMEImage(unittest.TestCase): def setUp(self): diff --git a/python-3.2a1-systemtap.patch b/python-3.2b2-systemtap.patch similarity index 70% rename from python-3.2a1-systemtap.patch rename to python-3.2b2-systemtap.patch index 6770b58..f87fc60 100644 --- a/python-3.2a1-systemtap.patch +++ b/python-3.2b2-systemtap.patch @@ -1,15 +1,7 @@ -diff -up Python-3.2a1/configure.in.systemtap Python-3.2a1/configure.in ---- Python-3.2a1/configure.in.systemtap 2010-07-19 03:31:40.000000000 -0400 -+++ Python-3.2a1/configure.in 2010-08-02 16:19:43.809000621 -0400 -@@ -1987,6 +1987,7 @@ AC_ARG_WITH(system_expat, - 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, - AS_HELP_STRING([--with-system-ffi], [build _ctypes module using an installed ffi library])) -@@ -2500,6 +2501,38 @@ if test "$with_valgrind" != no; then +diff -up Python-3.2b2/configure.in.systemtap Python-3.2b2/configure.in +--- Python-3.2b2/configure.in.systemtap 2010-12-13 02:59:39.000000000 -0500 ++++ Python-3.2b2/configure.in 2010-12-28 17:01:58.044059433 -0500 +@@ -2470,6 +2470,38 @@ if test "$with_valgrind" != no; then OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT" fi @@ -45,12 +37,12 @@ diff -up Python-3.2a1/configure.in.systemtap Python-3.2a1/configure.in +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-3.2a1/Include/pydtrace.d.systemtap Python-3.2a1/Include/pydtrace.d ---- Python-3.2a1/Include/pydtrace.d.systemtap 2010-08-02 16:17:04.249000540 -0400 -+++ Python-3.2a1/Include/pydtrace.d 2010-08-02 16:17:04.249000540 -0400 + # -I${DLINCLDIR} is added to the compile rule for importdl.o + AC_SUBST(DLINCLDIR) + DLINCLDIR=. +diff -up Python-3.2b2/Include/pydtrace.d.systemtap Python-3.2b2/Include/pydtrace.d +--- Python-3.2b2/Include/pydtrace.d.systemtap 2010-12-28 16:58:41.762936379 -0500 ++++ Python-3.2b2/Include/pydtrace.d 2010-12-28 16:58:41.762936379 -0500 @@ -0,0 +1,10 @@ +provider python { + probe function__entry(const char *, const char *, int); @@ -62,20 +54,20 @@ diff -up Python-3.2a1/Include/pydtrace.d.systemtap Python-3.2a1/Include/pydtrace +#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-3.2a1/Makefile.pre.in.systemtap Python-3.2a1/Makefile.pre.in ---- Python-3.2a1/Makefile.pre.in.systemtap 2010-08-02 16:17:04.243000614 -0400 -+++ Python-3.2a1/Makefile.pre.in 2010-08-02 16:20:41.617000527 -0400 -@@ -324,6 +324,7 @@ PYTHON_OBJS= \ - Python/dtoa.o \ +diff -up Python-3.2b2/Makefile.pre.in.systemtap Python-3.2b2/Makefile.pre.in +--- Python-3.2b2/Makefile.pre.in.systemtap 2010-12-28 16:58:41.000000000 -0500 ++++ Python-3.2b2/Makefile.pre.in 2010-12-28 17:00:58.607310089 -0500 +@@ -328,6 +328,7 @@ PYTHON_OBJS= \ Python/formatter_unicode.o \ + Python/fileutils.o \ Python/$(DYNLOADFILE) \ + @DTRACEOBJS@ \ $(LIBOBJS) \ $(MACHDEP_OBJS) \ $(THREADOBJ) -@@ -615,6 +616,18 @@ Python/formatter_unicode.o: $(srcdir)/Py - $(srcdir)/Objects/stringlib/formatter.h - +@@ -632,6 +633,18 @@ Objects/typeobject.o: $(srcdir)/Objects/ + $(srcdir)/Objects/typeslots.inc: $(srcdir)/Include/typeslots.h $(srcdir)/Objects/typeslots.py + $(PYTHON) $(srcdir)/Objects/typeslots.py < $(srcdir)/Include/typeslots.h > $(srcdir)/Objects/typeslots.inc +# Only needed with --with-dtrace +buildinclude: @@ -92,19 +84,19 @@ diff -up Python-3.2a1/Makefile.pre.in.systemtap Python-3.2a1/Makefile.pre.in ############################################################################ # Header files -@@ -1248,7 +1261,7 @@ Python/thread.o: @THREADHEADERS@ +@@ -1282,7 +1295,7 @@ Python/thread.o: @THREADHEADERS@ .PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure .PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools - .PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean + .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-3.2a1/pyconfig.h.in.systemtap Python-3.2a1/pyconfig.h.in ---- Python-3.2a1/pyconfig.h.in.systemtap 2010-08-02 16:18:33.696001964 -0400 -+++ Python-3.2a1/pyconfig.h.in 2010-08-02 16:21:48.566001832 -0400 -@@ -1078,6 +1078,9 @@ +diff -up Python-3.2b2/pyconfig.h.in.systemtap Python-3.2b2/pyconfig.h.in +--- Python-3.2b2/pyconfig.h.in.systemtap 2010-11-20 05:29:12.000000000 -0500 ++++ Python-3.2b2/pyconfig.h.in 2010-12-28 16:58:41.765937360 -0500 +@@ -1092,6 +1092,9 @@ /* Define if you want documentation strings in extension modules */ #undef WITH_DOC_STRINGS @@ -114,10 +106,10 @@ diff -up Python-3.2a1/pyconfig.h.in.systemtap Python-3.2a1/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. */ -diff -up Python-3.2a1/Python/ceval.c.systemtap Python-3.2a1/Python/ceval.c ---- Python-3.2a1/Python/ceval.c.systemtap 2010-07-20 18:39:34.000000000 -0400 -+++ Python-3.2a1/Python/ceval.c 2010-08-02 16:23:58.703001000 -0400 -@@ -19,6 +19,10 @@ +diff -up Python-3.2b2/Python/ceval.c.systemtap Python-3.2b2/Python/ceval.c +--- Python-3.2b2/Python/ceval.c.systemtap 2010-12-03 15:14:31.000000000 -0500 ++++ Python-3.2b2/Python/ceval.c 2010-12-28 16:58:41.768935588 -0500 +@@ -18,6 +18,10 @@ #include @@ -128,7 +120,7 @@ diff -up Python-3.2a1/Python/ceval.c.systemtap Python-3.2a1/Python/ceval.c #ifndef WITH_TSC #define READ_TIMESTAMP(var) -@@ -752,6 +756,70 @@ PyEval_EvalCode(PyCodeObject *co, PyObje +@@ -766,6 +770,70 @@ PyEval_EvalCode(PyObject *co, PyObject * } @@ -199,7 +191,7 @@ diff -up Python-3.2a1/Python/ceval.c.systemtap Python-3.2a1/Python/ceval.c /* Interpreter main loop */ PyObject * -@@ -1156,6 +1224,10 @@ PyEval_EvalFrameEx(PyFrameObject *f, int +@@ -1183,6 +1251,10 @@ PyEval_EvalFrameEx(PyFrameObject *f, int } } @@ -210,7 +202,7 @@ diff -up Python-3.2a1/Python/ceval.c.systemtap Python-3.2a1/Python/ceval.c co = f->f_code; names = co->co_names; consts = co->co_consts; -@@ -3046,6 +3118,9 @@ fast_yield: +@@ -3048,6 +3120,9 @@ fast_yield: /* pop frame */ exit_eval_frame: diff --git a/python-3.2b2-test-weakref-COUNT_ALLOCS_fix.patch b/python-3.2b2-test-weakref-COUNT_ALLOCS_fix.patch new file mode 100644 index 0000000..6ed7801 --- /dev/null +++ b/python-3.2b2-test-weakref-COUNT_ALLOCS_fix.patch @@ -0,0 +1,17 @@ +diff -up Python-3.2b2/Lib/test/test_weakref.py.test-weakref-COUNT_ALLOCS_fix Python-3.2b2/Lib/test/test_weakref.py +--- Python-3.2b2/Lib/test/test_weakref.py.test-weakref-COUNT_ALLOCS_fix 2010-12-28 20:33:46.963364990 -0500 ++++ Python-3.2b2/Lib/test/test_weakref.py 2010-12-28 20:35:44.115935248 -0500 +@@ -583,9 +583,10 @@ class ReferencesTestCase(TestBase): + # been cleared without their callbacks executing. OTOH, the weakref + # to C is bound to a function local (wr), and wasn't trash, so that + # callback should have been invoked when C went away. +- self.assertEqual(alist, ["C went away"]) +- # The remaining weakref should be dead now (its callback ran). +- self.assertEqual(wr(), None) ++ if not hasattr(sys, 'getcounts'): ++ self.assertEqual(alist, ["C went away"]) ++ # The remaining weakref should be dead now (its callback ran). ++ self.assertEqual(wr(), None) + + del alist[:] + gc.collect() diff --git a/python-3.2b2-test_sys-COUNT_ALLOCS.patch b/python-3.2b2-test_sys-COUNT_ALLOCS.patch new file mode 100644 index 0000000..c1871ac --- /dev/null +++ b/python-3.2b2-test_sys-COUNT_ALLOCS.patch @@ -0,0 +1,13 @@ +diff -up Python-3.2b2/Lib/test/test_sys.py.fix-test-sys-COUNT_ALLOCS Python-3.2b2/Lib/test/test_sys.py +--- Python-3.2b2/Lib/test/test_sys.py.fix-test-sys-COUNT_ALLOCS 2010-12-28 20:52:43.236310184 -0500 ++++ Python-3.2b2/Lib/test/test_sys.py 2010-12-28 20:58:09.164184094 -0500 +@@ -817,6 +817,9 @@ class SizeofTest(unittest.TestCase): + # (PyTypeObject + PyNumberMethods + PyMappingMethods + + # PySequenceMethods + PyBufferProcs) + s = size(vh + 'P2P15Pl4PP9PP11PI') + size('16Pi17P 3P 10P 2P 2P') ++ # COUNT_ALLOCS adds a further 3 Py_ssize_t and 2 pointers: ++ if hasattr(sys, 'getcounts'): ++ s += size('3P2P') + check(int, s) + # class + class newstyleclass(object): pass diff --git a/python3.spec b/python3.spec index ec10905..985bdb2 100644 --- a/python3.spec +++ b/python3.spec @@ -1,9 +1,27 @@ %global pybasever 3.2 -%global alphatag a1 + +# pybasever without the dot: +%global pyshortver 32 + +%global alphatag b2 %global pylibdir %{_libdir}/python%{pybasever} %global dynload_dir %{pylibdir}/lib-dynload +# SOABI is defined in the upstream configure.in from Python-3.2a2 onwards, +# for PEP 3149: +# http://www.python.org/dev/peps/pep-3149/ + +# ABIFLAGS, LDVERSION and SOABI are in the upstream Makefile +%global ABIFLAGS_optimized mu +%global ABIFLAGS_debug dmu + +%global LDVERSION_optimized %{pybasever}%{ABIFLAGS_optimized} +%global LDVERSION_debug %{pybasever}%{ABIFLAGS_debug} + +%global SOABI_optimized cpython-%{pyshortver}%{ABIFLAGS_optimized} +%global SOABI_debug cpython-%{pyshortver}%{ABIFLAGS_debug} + # All bytecode files are now in a __pycache__ subdirectory, with a name # reflecting the version of the bytecode (to permit sharing of python libraries # between different runtimes) @@ -23,8 +41,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_optimized libpython%{pybasever}.so.%{py_SOVERSION} -%global py_INSTSONAME_debug libpython%{pybasever}_d.so.%{py_SOVERSION} +%global py_INSTSONAME_optimized libpython%{LDVERSION_optimized}.so.%{py_SOVERSION} +%global py_INSTSONAME_debug libpython%{LDVERSION_debug}.so.%{py_SOVERSION} %global with_debug_build 1 @@ -149,91 +167,20 @@ Patch1: Python-3.1.1-rpath.patch # The four TestMIMEAudio tests fail due to "audiotest.au" not being packaged. # It's simplest to remove them: -Patch3: python-3.2a1-remove-mimeaudio-tests.patch - -# ImportTests.test_issue1267 in test_imp.py reads pydoc.py's shebang line and -# checks that it read it correctly. -# -# Since we modify the shebang lines in our packaging, we also need to modify -# the expected value in this test: -Patch4: python-3.2a1-apply-our-changes-to-expected-shebang-for-test_imp.patch +Patch3: python-3.2b2-remove-mimeaudio-tests.patch # Patch the Makefile.pre.in so that the generated Makefile doesn't try to build # a libpythonMAJOR.MINOR.a (bug 550692): -Patch6: python-3.2a1-no-static-lib.patch +Patch6: python-3.2b2-no-static-lib.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); ported to 3.1.1 by # dmalcolm -Patch8: python-3.2a1-systemtap.patch +Patch8: python-3.2b2-systemtap.patch -Patch102: python-3.2a1-lib64.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-build.dpatch -# -# (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. -# -# * Patch runtests.sh to support supplying a value for PYTHON, so that we can -# run the tests against each of the builds - -Patch103: python-3.2a1-debug-build.patch +Patch102: python-3.2b2-lib64.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 @@ -245,17 +192,6 @@ Patch104: python-3.1.2-more-configuration-flags.patch # (rhbz:553020); partially upstream as http://bugs.python.org/issue7647 Patch105: python-3.2a1-statvfs-f_flag-constants.patch -# Fix an incompatibility between pyexpat and the system expat-2.0.1 that led to -# a segfault running test_pyexpat.py (rhbz:610312) -# Sent upstream as http://bugs.python.org/issue9054 -Patch110: python-3.1.2-fix-expat-issue9054.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: -Patch111: python-3.2a1-fix-parallel-make.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 @@ -263,6 +199,20 @@ Patch111: python-3.2a1-fix-parallel-make.patch # Not yet sent upstream: Patch125: less-verbose-COUNT_ALLOCS.patch +# test_weakref's test_callback_in_cycle_resurrection doesn't work with +# COUNT_ALLOCS, as the metrics keep "C" alive. Work around this for our +# debug build: +# Not yet sent upstream +Patch126: python-3.2b2-test-weakref-COUNT_ALLOCS_fix.patch + +# Similar COUNT_ALLOCS fixes for test_gc +# Not yet sent upstream +Patch127: python-3.2b2-fix-test-gc-COUNT_ALLOCS.patch + +# Similar COUNT_ALLOCS fixes for test_sys +# Not yet sent upstream +Patch128: python-3.2b2-test_sys-COUNT_ALLOCS.patch + # This is the generated patch to "configure"; see the description of # %{regenerate_autotooling_patch} # above: @@ -408,7 +358,6 @@ rm -r Modules/zlib || exit 1 # %patch1 -p1 %patch3 -p1 -b .remove-mimeaudio-tests -%patch4 -p1 -b .apply-our-changes-to-expected-shebang %patch6 -p1 -b .no-static-lib %if 0%{?with_systemtap} @@ -419,17 +368,14 @@ rm -r Modules/zlib || exit 1 %patch102 -p1 %endif -%patch103 -p1 - %patch104 -p1 -b .more-configuration-flags %patch105 -p1 -b .statvfs-f-flag-constants -%patch110 -p0 -b .fix-expat-issue9054 - -%patch111 -p1 -b .parallel-grammar - %patch125 -p1 -b .less-verbose-COUNT_ALLOCS +%patch126 -p1 +%patch127 -p1 +%patch128 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -632,10 +578,21 @@ install -d -m 0755 %{buildroot}/usr/lib/python%{pybasever}/site-packages/__pycac %global _pyconfig_h %{_pyconfig32_h} %endif +# ABIFLAGS, LDVERSION and SOABI are in the upstream Makefile +%global ABIFLAGS_optimized mu +%global ABIFLAGS_debug dmu + +%global LDVERSION_optimized %{pybasever}%{ABIFLAGS_optimized} +%global LDVERSION_debug %{pybasever}%{ABIFLAGS_debug} + +%global SOABI_optimized cpython-%{pyshortver}%{ABIFLAGS_optimized} +%global SOABI_debug cpython-%{pyshortver}%{ABIFLAGS_debug} + %if 0%{?with_debug_build} -%global PyIncludeDirs python%{pybasever} python%{pybasever}-debug +%global PyIncludeDirs python%{LDVERSION_optimized} python%{LDVERSION_debug} + %else -%global PyIncludeDirs python%{pybasever} +%global PyIncludeDirs python%{LDVERSION_optimized} %endif for PyIncludeDir in %{PyIncludeDirs} ; do @@ -739,14 +696,14 @@ ldd %{buildroot}/%{dynload_dir}/_curses*.so \ # likewise for the optimized modules and libpython: for Module in %{buildroot}/%{dynload_dir}/*.so ; do case $Module in - *_d.so) + *.%{SOABI_debug}) ldd $Module | grep %{py_INSTSONAME_optimized} && - (echo Debug module $Module linked against optimized %{py_INSTSONAME_optimized} ; exi 1) + (echo Debug module $Module linked against optimized %{py_INSTSONAME_optimized} ; exit 1) ;; - *) + *.%{SOABI_optimized}) ldd $Module | grep %{py_INSTSONAME_debug} && - (echo Optimized module $Module linked against debug %{py_INSTSONAME_optimized} ; exi 1) + (echo Optimized module $Module linked against debug %{py_INSTSONAME_debug} ; exit 1) ;; esac done @@ -784,59 +741,30 @@ sed \ topdir=$(pwd) CheckPython() { ConfName=$1 - ConfDir=build/$ConfName + ConfDir=$(pwd)/build/$ConfName echo STARTING: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName -# Run the upstream test suite, using the "runtests.sh" harness from the upstream -# tarball. -# I'm seeing occasional hangs in some http tests when running the test suite -# inside Koji. For that reason I exclude them - -LD_LIBRARY_PATH=$ConfDir PYTHON=$ConfDir/python $topdir/runtests.sh -x test_httplib test_http_cookies +# Run the upstream test suite +LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest -x test_distutils test_httplib test_http_cookies test_socket test_telnet # Note that we're running the tests using the version of the code in the builddir, # not in the buildroot. -# The harness only emits the names of the test scripts it ran, along with a -# summary of the form: -# 2 BAD -# 313 GOOD -# 22 SKIPPED -# 337 total -# As a byproduct it writes files "GOOD", "BAD", "SKIPPED", listing names of -# files (e.g. "test_imp") along with a subdirectory OUT containing files of the -# form $TEST.out -# Each such logfile starts with a line indicating the name of the test - -# Output the logs from failing tests, so that they are captured in the rpmbuild -# log: -for TESTNAME in $(cat BAD); do - cat OUT/$TESTNAME.out ; -done - -# There are 5 expected BAD results here: +# I'm seeing occasional hangs in some http tests when running the test suite +# inside Koji. For that reason I exclude them +# +# Other known failures: # # (1) test_distutils.py: tries to build an RPM inside the rpmbuild; I'll simply # let this one fail for now (has trouble linking against -lpython3.1; perhaps # LD_LIBRARY_PATH is being discarded somewhere?) # -# (2) test_imp.py: ImportTests.test_issue1267 in test_imp.py reads pydoc.py's -# shebang line and checks that it read it correctly.tests that the shebang line -# is as expected. Unfortunately if we patch this up in the buildir (in the -# build phase), then the "make install" will try to reference -# /usr/bin/python%{pybasever} which won't exist on a clean build environment. -# So we fix up the shebang lines after this in the install phase, and expect -# this test to fail in the check phase. It ought to pass when run on the built -# RPMs -# -# (3) test_socket.py:testSockName can fail here if DNS isn't properly set up: +# (2) test_socket.py:testSockName can fail here if DNS isn't properly set up: # my_ip_addr = socket.gethostbyname(socket.gethostname()) # socket.gaierror: [Errno -2] Name or service not known # -# (4) test_subprocess: merely get "errors occurred" -# -# (5) test_telnet: can get a "socket.error: [Errno 104] Connection reset by peer" +# (3) test_telnet: can get a "socket.error: [Errno 104] Connection reset by peer" # # Some additional tests fail when running the test suite as non-root outside of # the build, due to permissions issues. @@ -865,6 +793,7 @@ rm -fr %{buildroot} %{_bindir}/pydoc* %{_bindir}/python3 %{_bindir}/python%{pybasever} +%{_bindir}/python%{pybasever}mu %{_mandir}/*/* %files libs @@ -873,61 +802,59 @@ rm -fr %{buildroot} %dir %{pylibdir} %dir %{dynload_dir} %{dynload_dir}/Python-%{version}%{alphatag}-py%{pybasever}.egg-info -%{dynload_dir}/_bisect.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}/_collections.so -%{dynload_dir}/_csv.so -%{dynload_dir}/_ctypes.so -%{dynload_dir}/_curses.so -%{dynload_dir}/_curses_panel.so -%{dynload_dir}/_dbm.so -%{dynload_dir}/_elementtree.so -%{dynload_dir}/_gdbm.so -%{dynload_dir}/_hashlib.so -%{dynload_dir}/_heapq.so -%{dynload_dir}/_json.so -%{dynload_dir}/_lsprof.so -%{dynload_dir}/_multibytecodec.so -%{dynload_dir}/_multiprocessing.so -%{dynload_dir}/_pickle.so -%{dynload_dir}/_posixsubprocess.so -%{dynload_dir}/_random.so -%{dynload_dir}/_socket.so -%{dynload_dir}/_sqlite3.so -%{dynload_dir}/_ssl.so -%{dynload_dir}/_struct.so -%{dynload_dir}/array.so -%{dynload_dir}/atexit.so -%{dynload_dir}/audioop.so -%{dynload_dir}/binascii.so -%{dynload_dir}/bz2.so -%{dynload_dir}/cmath.so -%{dynload_dir}/crypt.so -%{dynload_dir}/_datetime.so -%{dynload_dir}/fcntl.so -%{dynload_dir}/grp.so -%{dynload_dir}/itertools.so -%{dynload_dir}/math.so -%{dynload_dir}/mmap.so -%{dynload_dir}/nis.so -%{dynload_dir}/operator.so -%{dynload_dir}/ossaudiodev.so -%{dynload_dir}/parser.so -%{dynload_dir}/pyexpat.so -%{dynload_dir}/readline.so -%{dynload_dir}/resource.so -%{dynload_dir}/select.so -%{dynload_dir}/spwd.so -%{dynload_dir}/syslog.so -%{dynload_dir}/termios.so -%{dynload_dir}/time.so -%{dynload_dir}/unicodedata.so -%{dynload_dir}/zlib.so +%{dynload_dir}/_bisect.%{SOABI_optimized}.so +%{dynload_dir}/_codecs_cn.%{SOABI_optimized}.so +%{dynload_dir}/_codecs_hk.%{SOABI_optimized}.so +%{dynload_dir}/_codecs_iso2022.%{SOABI_optimized}.so +%{dynload_dir}/_codecs_jp.%{SOABI_optimized}.so +%{dynload_dir}/_codecs_kr.%{SOABI_optimized}.so +%{dynload_dir}/_codecs_tw.%{SOABI_optimized}.so +%{dynload_dir}/_csv.%{SOABI_optimized}.so +%{dynload_dir}/_ctypes.%{SOABI_optimized}.so +%{dynload_dir}/_curses.%{SOABI_optimized}.so +%{dynload_dir}/_curses_panel.%{SOABI_optimized}.so +%{dynload_dir}/_dbm.%{SOABI_optimized}.so +%{dynload_dir}/_elementtree.%{SOABI_optimized}.so +%{dynload_dir}/_gdbm.%{SOABI_optimized}.so +%{dynload_dir}/_hashlib.%{SOABI_optimized}.so +%{dynload_dir}/_heapq.%{SOABI_optimized}.so +%{dynload_dir}/_json.%{SOABI_optimized}.so +%{dynload_dir}/_lsprof.%{SOABI_optimized}.so +%{dynload_dir}/_multibytecodec.%{SOABI_optimized}.so +%{dynload_dir}/_multiprocessing.%{SOABI_optimized}.so +%{dynload_dir}/_pickle.%{SOABI_optimized}.so +%{dynload_dir}/_posixsubprocess.%{SOABI_optimized}.so +%{dynload_dir}/_random.%{SOABI_optimized}.so +%{dynload_dir}/_socket.%{SOABI_optimized}.so +%{dynload_dir}/_sqlite3.%{SOABI_optimized}.so +%{dynload_dir}/_ssl.%{SOABI_optimized}.so +%{dynload_dir}/_struct.%{SOABI_optimized}.so +%{dynload_dir}/array.%{SOABI_optimized}.so +%{dynload_dir}/atexit.%{SOABI_optimized}.so +%{dynload_dir}/audioop.%{SOABI_optimized}.so +%{dynload_dir}/binascii.%{SOABI_optimized}.so +%{dynload_dir}/bz2.%{SOABI_optimized}.so +%{dynload_dir}/cmath.%{SOABI_optimized}.so +%{dynload_dir}/crypt.%{SOABI_optimized}.so +%{dynload_dir}/_datetime.%{SOABI_optimized}.so +%{dynload_dir}/fcntl.%{SOABI_optimized}.so +%{dynload_dir}/grp.%{SOABI_optimized}.so +%{dynload_dir}/math.%{SOABI_optimized}.so +%{dynload_dir}/mmap.%{SOABI_optimized}.so +%{dynload_dir}/nis.%{SOABI_optimized}.so +%{dynload_dir}/ossaudiodev.%{SOABI_optimized}.so +%{dynload_dir}/parser.%{SOABI_optimized}.so +%{dynload_dir}/pyexpat.%{SOABI_optimized}.so +%{dynload_dir}/readline.%{SOABI_optimized}.so +%{dynload_dir}/resource.%{SOABI_optimized}.so +%{dynload_dir}/select.%{SOABI_optimized}.so +%{dynload_dir}/spwd.%{SOABI_optimized}.so +%{dynload_dir}/syslog.%{SOABI_optimized}.so +%{dynload_dir}/termios.%{SOABI_optimized}.so +%{dynload_dir}/time.%{SOABI_optimized}.so +%{dynload_dir}/unicodedata.%{SOABI_optimized}.so +%{dynload_dir}/xxlimited.%{SOABI_optimized}.so +%{dynload_dir}/zlib.%{SOABI_optimized}.so %dir %{pylibdir}/site-packages/ %dir %{pylibdir}/site-packages/__pycache__/ @@ -936,63 +863,90 @@ rm -fr %{buildroot} %dir %{pylibdir}/__pycache__/ %{pylibdir}/__pycache__/*%{bytecode_suffixes} %{pylibdir}/wsgiref.egg-info -%dir %{pylibdir}/ctypes + +%dir %{pylibdir}/concurrent/ +%dir %{pylibdir}/concurrent/__pycache__/ +%{pylibdir}/concurrent/*.py +%{pylibdir}/concurrent/__pycache__/*%{bytecode_suffixes} + +%dir %{pylibdir}/concurrent/futures/ +%dir %{pylibdir}/concurrent/futures/__pycache__/ +%{pylibdir}/concurrent/futures/*.py +%{pylibdir}/concurrent/futures/__pycache__/*%{bytecode_suffixes} + +%dir %{pylibdir}/ctypes/ %dir %{pylibdir}/ctypes/__pycache__/ %{pylibdir}/ctypes/*.py %{pylibdir}/ctypes/__pycache__/*%{bytecode_suffixes} %{pylibdir}/ctypes/macholib + %{pylibdir}/curses -%dir %{pylibdir}/dbm + +%dir %{pylibdir}/dbm/ %dir %{pylibdir}/dbm/__pycache__/ %{pylibdir}/dbm/*.py %{pylibdir}/dbm/__pycache__/*%{bytecode_suffixes} -%dir %{pylibdir}/distutils + +%dir %{pylibdir}/distutils/ %dir %{pylibdir}/distutils/__pycache__/ %{pylibdir}/distutils/*.py %{pylibdir}/distutils/__pycache__/*%{bytecode_suffixes} %{pylibdir}/distutils/README %{pylibdir}/distutils/command -%dir %{pylibdir}/email + +%dir %{pylibdir}/email/ %dir %{pylibdir}/email/__pycache__/ %{pylibdir}/email/*.py %{pylibdir}/email/__pycache__/*%{bytecode_suffixes} %{pylibdir}/email/mime + %{pylibdir}/encodings %{pylibdir}/html %{pylibdir}/http %{pylibdir}/idlelib -%dir %{pylibdir}/importlib + +%dir %{pylibdir}/importlib/ %dir %{pylibdir}/importlib/__pycache__/ %{pylibdir}/importlib/*.py %{pylibdir}/importlib/__pycache__/*%{bytecode_suffixes} -%dir %{pylibdir}/json + +%dir %{pylibdir}/json/ %dir %{pylibdir}/json/__pycache__/ %{pylibdir}/json/*.py %{pylibdir}/json/__pycache__/*%{bytecode_suffixes} + %{pylibdir}/lib2to3 %exclude %{pylibdir}/lib2to3/tests %{pylibdir}/logging %{pylibdir}/multiprocessing %{pylibdir}/plat-linux2 %{pylibdir}/pydoc_data -%dir %{pylibdir}/sqlite3 + +%dir %{pylibdir}/sqlite3/ %dir %{pylibdir}/sqlite3/__pycache__/ %{pylibdir}/sqlite3/*.py %{pylibdir}/sqlite3/__pycache__/*%{bytecode_suffixes} -%dir %{pylibdir}/test + +%dir %{pylibdir}/test/ %dir %{pylibdir}/test/__pycache__/ %{pylibdir}/test/__init__.py %{pylibdir}/test/support.py %{pylibdir}/test/__pycache__/__init__%{bytecode_suffixes} %{pylibdir}/test/__pycache__/support%{bytecode_suffixes} -%dir %{pylibdir}/unittest + +%exclude %{pylibdir}/turtle.py +%exclude %{pylibdir}/__pycache__/turtle*%{bytecode_suffixes} + +%dir %{pylibdir}/unittest/ %dir %{pylibdir}/unittest/__pycache__/ %{pylibdir}/unittest/*.py %{pylibdir}/unittest/__pycache__/*%{bytecode_suffixes} + %{pylibdir}/urllib %{pylibdir}/wsgiref %{pylibdir}/xml %{pylibdir}/xmlrpc + %if "%{_lib}" == "lib64" %attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever} %attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}/site-packages @@ -1002,10 +956,10 @@ rm -fr %{buildroot} # "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 %{pylibdir}/config -%{pylibdir}/config/Makefile -%dir %{_includedir}/python%{pybasever} -%{_includedir}/python%{pybasever}/%{_pyconfig_h} +%dir %{pylibdir}/config-%{LDVERSION_optimized}/ +%{pylibdir}/config-%{LDVERSION_optimized}/Makefile +%dir %{_includedir}/python%{LDVERSION_optimized}/ +%{_includedir}/python%{LDVERSION_optimized}/%{_pyconfig_h} %{_libdir}/%{py_INSTSONAME_optimized} %if 0%{?with_systemtap} @@ -1015,14 +969,16 @@ rm -fr %{buildroot} %files devel %defattr(-,root,root) -%{pylibdir}/config/* -%exclude %{pylibdir}/config/Makefile -/usr/include/python%{pybasever}/*.h -%exclude /usr/include/python%{pybasever}/%{_pyconfig_h} +%{pylibdir}/config-%{LDVERSION_optimized}/* +%exclude %{pylibdir}/config-%{LDVERSION_optimized}/Makefile +%{_includedir}/python%{LDVERSION_optimized}/*.h +%exclude %{_includedir}/python%{LDVERSION_optimized}/%{_pyconfig_h} %doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit %{_bindir}/python3-config %{_bindir}/python%{pybasever}-config -%{_libdir}/libpython%{pybasever}.so +%{_bindir}/python%{LDVERSION_optimized}-config +%{_libdir}/libpython%{LDVERSION_optimized}.so +%{_libdir}/pkgconfig/python-%{LDVERSION_optimized}.pc %{_libdir}/pkgconfig/python-%{pybasever}.pc %{_libdir}/pkgconfig/python3.pc %config(noreplace) %{_sysconfdir}/rpm/macros.python3 @@ -1042,7 +998,15 @@ rm -fr %{buildroot} %defattr(-,root,root,755) %{pylibdir}/tkinter %exclude %{pylibdir}/tkinter/test -%{dynload_dir}/_tkinter.so +%{dynload_dir}/_tkinter.%{SOABI_optimized}.so +%{pylibdir}/turtle.py +%{pylibdir}/__pycache__/turtle*%{bytecode_suffixes} +%dir %{pylibdir}/turtledemo +%{pylibdir}/turtledemo/*.py +%{pylibdir}/turtledemo/*.txt +%{pylibdir}/turtledemo/*.cfg +%dir %{pylibdir}/turtledemo/__pycache__/ +%{pylibdir}/turtledemo/__pycache__/*%{bytecode_suffixes} %files test %defattr(-, root, root) @@ -1050,11 +1014,10 @@ rm -fr %{buildroot} %{pylibdir}/distutils/tests %{pylibdir}/email/test %{pylibdir}/importlib/test -%{pylibdir}/json/tests %{pylibdir}/sqlite3/test %{pylibdir}/test -%{dynload_dir}/_ctypes_test.so -%{dynload_dir}/_testcapi.so +%{dynload_dir}/_ctypes_test.%{SOABI_optimized}.so +%{dynload_dir}/_testcapi.%{SOABI_optimized}.so %{pylibdir}/lib2to3/tests %doc %{pylibdir}/Demo/distutils %doc %{pylibdir}/Demo/md5test @@ -1073,70 +1036,66 @@ rm -fr %{buildroot} %defattr(-,root,root,-) # Analog of the core subpackage's files: -%{_bindir}/python3-debug -%{_bindir}/python%{pybasever}-debug +%{_bindir}/python%{LDVERSION_debug} # Analog of the -libs subpackage's files: # ...with debug builds of the built-in "extension" modules: -%{dynload_dir}/_bisect_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}/_collections_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}/_dbm_d.so -%{dynload_dir}/_elementtree_d.so -%{dynload_dir}/_gdbm_d.so -%{dynload_dir}/_hashlib_d.so -%{dynload_dir}/_heapq_d.so -%{dynload_dir}/_json_d.so -%{dynload_dir}/_lsprof_d.so -%{dynload_dir}/_md5_d.so -%{dynload_dir}/_multibytecodec_d.so -%{dynload_dir}/_multiprocessing_d.so -%{dynload_dir}/_pickle_d.so -%{dynload_dir}/_posixsubprocess_d.so -%{dynload_dir}/_random_d.so -%{dynload_dir}/_sha1_d.so -%{dynload_dir}/_sha256_d.so -%{dynload_dir}/_sha512_d.so -%{dynload_dir}/_socket_d.so -%{dynload_dir}/_sqlite3_d.so -%{dynload_dir}/_ssl_d.so -%{dynload_dir}/_struct_d.so -%{dynload_dir}/array_d.so -%{dynload_dir}/atexit_d.so -%{dynload_dir}/audioop_d.so -%{dynload_dir}/binascii_d.so -%{dynload_dir}/bz2_d.so -%{dynload_dir}/cmath_d.so -%{dynload_dir}/crypt_d.so -%{dynload_dir}/_datetime_d.so -%{dynload_dir}/fcntl_d.so -%{dynload_dir}/grp_d.so -%{dynload_dir}/itertools_d.so -%{dynload_dir}/math_d.so -%{dynload_dir}/mmap_d.so -%{dynload_dir}/nis_d.so -%{dynload_dir}/operator_d.so -%{dynload_dir}/ossaudiodev_d.so -%{dynload_dir}/parser_d.so -%{dynload_dir}/pyexpat_d.so -%{dynload_dir}/readline_d.so -%{dynload_dir}/resource_d.so -%{dynload_dir}/select_d.so -%{dynload_dir}/spwd_d.so -%{dynload_dir}/syslog_d.so -%{dynload_dir}/termios_d.so -%{dynload_dir}/time_d.so -%{dynload_dir}/unicodedata_d.so -%{dynload_dir}/zlib_d.so +%{dynload_dir}/_bisect.%{SOABI_debug}.so +%{dynload_dir}/_codecs_cn.%{SOABI_debug}.so +%{dynload_dir}/_codecs_hk.%{SOABI_debug}.so +%{dynload_dir}/_codecs_iso2022.%{SOABI_debug}.so +%{dynload_dir}/_codecs_jp.%{SOABI_debug}.so +%{dynload_dir}/_codecs_kr.%{SOABI_debug}.so +%{dynload_dir}/_codecs_tw.%{SOABI_debug}.so +%{dynload_dir}/_csv.%{SOABI_debug}.so +%{dynload_dir}/_ctypes.%{SOABI_debug}.so +%{dynload_dir}/_curses.%{SOABI_debug}.so +%{dynload_dir}/_curses_panel.%{SOABI_debug}.so +%{dynload_dir}/_dbm.%{SOABI_debug}.so +%{dynload_dir}/_elementtree.%{SOABI_debug}.so +%{dynload_dir}/_gdbm.%{SOABI_debug}.so +%{dynload_dir}/_hashlib.%{SOABI_debug}.so +%{dynload_dir}/_heapq.%{SOABI_debug}.so +%{dynload_dir}/_json.%{SOABI_debug}.so +%{dynload_dir}/_lsprof.%{SOABI_debug}.so +%{dynload_dir}/_md5.%{SOABI_debug}.so +%{dynload_dir}/_multibytecodec.%{SOABI_debug}.so +%{dynload_dir}/_multiprocessing.%{SOABI_debug}.so +%{dynload_dir}/_pickle.%{SOABI_debug}.so +%{dynload_dir}/_posixsubprocess.%{SOABI_debug}.so +%{dynload_dir}/_random.%{SOABI_debug}.so +%{dynload_dir}/_sha1.%{SOABI_debug}.so +%{dynload_dir}/_sha256.%{SOABI_debug}.so +%{dynload_dir}/_sha512.%{SOABI_debug}.so +%{dynload_dir}/_socket.%{SOABI_debug}.so +%{dynload_dir}/_sqlite3.%{SOABI_debug}.so +%{dynload_dir}/_ssl.%{SOABI_debug}.so +%{dynload_dir}/_struct.%{SOABI_debug}.so +%{dynload_dir}/array.%{SOABI_debug}.so +%{dynload_dir}/atexit.%{SOABI_debug}.so +%{dynload_dir}/audioop.%{SOABI_debug}.so +%{dynload_dir}/binascii.%{SOABI_debug}.so +%{dynload_dir}/bz2.%{SOABI_debug}.so +%{dynload_dir}/cmath.%{SOABI_debug}.so +%{dynload_dir}/crypt.%{SOABI_debug}.so +%{dynload_dir}/_datetime.%{SOABI_debug}.so +%{dynload_dir}/fcntl.%{SOABI_debug}.so +%{dynload_dir}/grp.%{SOABI_debug}.so +%{dynload_dir}/math.%{SOABI_debug}.so +%{dynload_dir}/mmap.%{SOABI_debug}.so +%{dynload_dir}/nis.%{SOABI_debug}.so +%{dynload_dir}/ossaudiodev.%{SOABI_debug}.so +%{dynload_dir}/parser.%{SOABI_debug}.so +%{dynload_dir}/pyexpat.%{SOABI_debug}.so +%{dynload_dir}/readline.%{SOABI_debug}.so +%{dynload_dir}/resource.%{SOABI_debug}.so +%{dynload_dir}/select.%{SOABI_debug}.so +%{dynload_dir}/spwd.%{SOABI_debug}.so +%{dynload_dir}/syslog.%{SOABI_debug}.so +%{dynload_dir}/termios.%{SOABI_debug}.so +%{dynload_dir}/time.%{SOABI_debug}.so +%{dynload_dir}/unicodedata.%{SOABI_debug}.so +%{dynload_dir}/zlib.%{SOABI_debug}.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 @@ -1148,25 +1107,22 @@ rm -fr %{buildroot} %endif # Analog of the -devel subpackage's files: -%dir %{pylibdir}/config-debug -%{pylibdir}/config-debug/* -%{_includedir}/python%{pybasever}-debug/*.h -%{_bindir}/python3-debug-config -%{_bindir}/python%{pybasever}-debug-config -%{_libdir}/libpython%{pybasever}_d.so -%{_libdir}/pkgconfig/python-%{pybasever}-debug.pc -%{_libdir}/pkgconfig/python3-debug.pc +%{pylibdir}/config-%{LDVERSION_debug} +%{_includedir}/python%{LDVERSION_debug} +%{_bindir}/python%{LDVERSION_debug}-config +%{_libdir}/libpython%{LDVERSION_debug}.so +%{_libdir}/pkgconfig/python-%{LDVERSION_debug}.pc # 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 +%{dynload_dir}/_tkinter.%{SOABI_debug}.so # Analog of the -test subpackage's files: -%{dynload_dir}/_ctypes_test_d.so -%{dynload_dir}/_testcapi_d.so +%{dynload_dir}/_ctypes_test.%{SOABI_debug}.so +%{dynload_dir}/_testcapi.%{SOABI_debug}.so %endif # with_debug_build @@ -1185,6 +1141,25 @@ rm -fr %{buildroot} %changelog +* Tue Dec 28 2010 David Malcolm - 3.2-0.5.b2 +- 3.2b2 +- rework patch 3 (removal of mimeaudio tests), patch 6 (no static libs), +patch 8 (systemtap), patch 102 (lib64) +- remove patch 4 (rendered redundant by upstream r85537), patch 103 (PEP 3149), +patch 110 (upstreamed expat fix), patch 111 (parallel build fix for grammar +fixed upstream) +- regenerate patch 300 (autotool intermediates) +- workaround COUNT_ALLOCS weakref issues in test suite (patch 126, patch 127, +patch 128) +- stop using runtest.sh in %%check (dropped by upstream), replacing with +regrtest; fixup list of failing tests +- introduce "pyshortver", "SOABI_optimized" and "SOABI_debug" macros +- rework manifests of shared libraries to use "SOABI_" macros, reflecting +PEP 3149 +- drop itertools, operator and _collections modules from the manifests as py3k +commit r84058 moved these inside libpython; json/tests moved to test/json_tests +- move turtle code into the tkinter subpackage + * Wed Nov 17 2010 David Malcolm - 3.2-0.5.a1 - fix sysconfig to not rely on the -devel subpackage (rhbz#653058) diff --git a/sources b/sources index c49803c..812bc20 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ b371e1f7a0e98e7a0d1792823fd0f58c Python-3.2a1.tar.bz2 +45ab5ff5edfb73ec277b1c763f3d5a42 Python-3.2b2.tar.bz2 From c23ee7db9fcc251cef82e57d4213b1e8d5ba833f Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Wed, 29 Dec 2010 16:33:14 -0500 Subject: [PATCH 044/416] work around test_subprocess failure seen in koji (patch 129) --- ...t-subprocess-with-nonreadable-path-dir.patch | 12 ++++++++++++ python3.spec | 17 ++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 python-3.2b2-fix-test-subprocess-with-nonreadable-path-dir.patch diff --git a/python-3.2b2-fix-test-subprocess-with-nonreadable-path-dir.patch b/python-3.2b2-fix-test-subprocess-with-nonreadable-path-dir.patch new file mode 100644 index 0000000..f73d57a --- /dev/null +++ b/python-3.2b2-fix-test-subprocess-with-nonreadable-path-dir.patch @@ -0,0 +1,12 @@ +diff -up Python-3.2b2/Lib/test/test_subprocess.py.non-readable-path Python-3.2b2/Lib/test/test_subprocess.py +--- Python-3.2b2/Lib/test/test_subprocess.py.non-readable-path 2010-12-29 16:25:38.498184175 -0500 ++++ Python-3.2b2/Lib/test/test_subprocess.py 2010-12-29 16:25:51.094184539 -0500 +@@ -578,7 +578,7 @@ class ProcessTestCase(BaseTestCase): + for i in range(1024): + # Windows raises IOError. Others raise OSError. + with self.assertRaises(EnvironmentError) as c: +- subprocess.Popen(['nonexisting_i_hope'], ++ subprocess.Popen(['/usr/bin/nonexisting_i_hope'], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + if c.exception.errno != errno.ENOENT: # ignore "no such file" diff --git a/python3.spec b/python3.spec index 985bdb2..a67339c 100644 --- a/python3.spec +++ b/python3.spec @@ -106,7 +106,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever} -Release: 0.5.%{alphatag}%{?dist} +Release: 0.6.%{alphatag}%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}%{alphatag}.tar.bz2 @@ -213,6 +213,17 @@ Patch127: python-3.2b2-fix-test-gc-COUNT_ALLOCS.patch # Not yet sent upstream Patch128: python-3.2b2-test_sys-COUNT_ALLOCS.patch +# In my koji builds, /root/bin is in the PATH for some reason +# This leads to test_subprocess.py failing, due to "test_leaking_fds_on_error" +# trying every dir in PATH for "nonexisting_i_hope", which leads to it raising +# OSError: [Errno 13] Permission denied +# when it tries to read /root/bin, rather than raising "No such file" +# +# Work around this by specifying an absolute path for the non-existant +# executable +# Not yet sent upstream +Patch129: python-3.2b2-fix-test-subprocess-with-nonreadable-path-dir.patch + # This is the generated patch to "configure"; see the description of # %{regenerate_autotooling_patch} # above: @@ -376,6 +387,7 @@ rm -r Modules/zlib || exit 1 %patch126 -p1 %patch127 -p1 %patch128 -p1 +%patch129 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1141,6 +1153,9 @@ rm -fr %{buildroot} %changelog +* Wed Dec 29 2010 David Malcolm - 3.2-0.6.b2 +- work around test_subprocess failure seen in koji (patch 129) + * Tue Dec 28 2010 David Malcolm - 3.2-0.5.b2 - 3.2b2 - rework patch 3 (removal of mimeaudio tests), patch 6 (no static libs), From 31a06df0c4d29b6f97f7793ff9caf470f78be932 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 4 Jan 2011 10:53:01 -0500 Subject: [PATCH 045/416] add --with-valgrind to configuration (on architectures that support this) --- python3.spec | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index a67339c..36bbe0d 100644 --- a/python3.spec +++ b/python3.spec @@ -50,6 +50,13 @@ %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 +%global with_valgrind 1 +%else +%global with_valgrind 0 +%endif + # Change from yes to no to turn this off %global with_computed_gotos yes @@ -106,7 +113,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever} -Release: 0.6.%{alphatag}%{?dist} +Release: 0.7.%{alphatag}%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}%{alphatag}.tar.bz2 @@ -238,6 +245,9 @@ BuildRequires: tix-devel bzip2-devel sqlite-devel BuildRequires: autoconf BuildRequires: db4-devel >= 4.7 BuildRequires: libffi-devel +%if 0%{?with_valgrind} +BuildRequires: valgrind-devel +%endif %if 0%{?with_systemtap} BuildRequires: systemtap-sdt-devel @@ -466,6 +476,9 @@ BuildPython() { --with-tapset-install-dir=%{tapsetdir} \ %endif --with-system-ffi \ +%if 0%{?with_valgrind} + --with-valgrind \ +%endif --with-system-expat \ $ExtraConfigArgs \ --with-computed-gotos=%{with_computed_gotos} \ @@ -1153,6 +1166,9 @@ rm -fr %{buildroot} %changelog +* Tue Jan 4 2011 David Malcolm - 3.2-0.7.b2 +- add --with-valgrind to configuration (on architectures that support this) + * Wed Dec 29 2010 David Malcolm - 3.2-0.6.b2 - work around test_subprocess failure seen in koji (patch 129) From 5659c63442be2e91eb42e60284d7a9a9ab0b80dd Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Wed, 5 Jan 2011 18:34:21 -0500 Subject: [PATCH 046/416] * Wed Jan 5 2011 David Malcolm - 3.2-0.8.b2 - set EXTRA_CFLAGS to our CFLAGS, rather than overriding OPT, fixing a linker error with dynamic annotations (when configured using --with-valgrind) - fix the ppc build of the debug configuration (patch 130; rhbz#661510) --- python-3.2b2-fix-ppc-debug-build.patch | 19 +++++++++++++++++++ python3.spec | 24 +++++++++++++++++++++--- 2 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 python-3.2b2-fix-ppc-debug-build.patch 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/python3.spec b/python3.spec index 36bbe0d..56208eb 100644 --- a/python3.spec +++ b/python3.spec @@ -113,7 +113,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever} -Release: 0.7.%{alphatag}%{?dist} +Release: 0.8.%{alphatag}%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}%{alphatag}.tar.bz2 @@ -231,6 +231,10 @@ Patch128: python-3.2b2-test_sys-COUNT_ALLOCS.patch # Not yet sent upstream Patch129: python-3.2b2-fix-test-subprocess-with-nonreadable-path-dir.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: @@ -398,6 +402,7 @@ rm -r Modules/zlib || exit 1 %patch127 -p1 %patch128 -p1 %patch129 -p1 +%patch130 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -484,8 +489,16 @@ BuildPython() { --with-computed-gotos=%{with_computed_gotos} \ %{nil} - -make OPT="$CFLAGS" %{?_smp_mflags} + # Set EXTRA_CFLAGS to our CFLAGS (rather than overriding OPT, as we've done + # in the past). + # This should fix a problem with --with-valgrind where it adds + # -DDYNAMIC_ANNOTATIONS_ENABLED=1 + # to OPT which must be passed to all compilation units in the build, + # otherwise leading to linker errors, e.g. + # missing symbol AnnotateRWLockDestroy + # + # Invoke the build: + make EXTRA_CFLAGS="$CFLAGS" %{?_smp_mflags} popd echo FINISHED: BUILD OF PYTHON FOR CONFIGURATION: $ConfDir @@ -1166,6 +1179,11 @@ rm -fr %{buildroot} %changelog +* Wed Jan 5 2011 David Malcolm - 3.2-0.8.b2 +- set EXTRA_CFLAGS to our CFLAGS, rather than overriding OPT, fixing a linker +error with dynamic annotations (when configured using --with-valgrind) +- fix the ppc build of the debug configuration (patch 130; rhbz#661510) + * Tue Jan 4 2011 David Malcolm - 3.2-0.7.b2 - add --with-valgrind to configuration (on architectures that support this) From 34c15c7789f299317178b38fe0b3a1ed1b2dcf1d Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 17 Jan 2011 16:25:14 -0500 Subject: [PATCH 047/416] 3.2rc1 * Mon Jan 17 2011 David Malcolm - 3.2-0.9.rc1 - 3.2rc1 - rework patch 6 (static lib removal) - remove upstreamed patch 130 (ppc debug build) - regenerate patch 300 (autotool intermediates) - updated packaging to reflect upstream rewrite of "Demo" (issue 7962) - added libpython3.so and 2to3-3.2 --- .gitignore | 1 + autotool-intermediates.patch | 1495 +---------------- ...patch => python-3.2rc1-no-static-lib.patch | 16 +- python3.spec | 34 +- sources | 3 +- 5 files changed, 44 insertions(+), 1505 deletions(-) rename python-3.2b2-no-static-lib.patch => python-3.2rc1-no-static-lib.patch (75%) diff --git a/.gitignore b/.gitignore index 474e8a7..84f6983 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ libpython-36a517ef7848cbd0b3dcc7371f32e47ac4c87eba.tar.gz Python-3.1.2.tar.bz2 Python-3.2a1.tar.bz2 /Python-3.2b2.tar.bz2 +/Python-3.2rc1.tar.bz2 diff --git a/autotool-intermediates.patch b/autotool-intermediates.patch index 8af26e3..fa49d8b 100644 --- a/autotool-intermediates.patch +++ b/autotool-intermediates.patch @@ -1,70 +1,13 @@ diff -up ./configure.autotool-intermediates ./configure ---- ./configure.autotool-intermediates 2010-12-28 18:47:15.206934478 -0500 -+++ ./configure 2010-12-28 18:47:21.053058461 -0500 -@@ -1,14 +1,14 @@ +--- ./configure.autotool-intermediates 2011-01-17 13:09:50.836697224 -0500 ++++ ./configure 2011-01-17 13:09:56.662690482 -0500 +@@ -1,5 +1,5 @@ #! /bin/sh - # From configure.in Revision: 87207 . +-# From configure.in Revision: 87646 . ++# From configure.in Revision: 87698 . # Guess values for system-dependent variables and create Makefiles. --# Generated by GNU Autoconf 2.67 for python 3.2. -+# Generated by GNU Autoconf 2.65 for python 3.2. + # Generated by GNU Autoconf 2.65 for python 3.2. # - # Report bugs to . - # - # - # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, --# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software --# Foundation, Inc. -+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -+# Inc. - # - # - # This configure script is free software; the Free Software Foundation -@@ -320,7 +320,7 @@ $as_echo X"$as_dir" | - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" -- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" -+ } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" - - - } # as_fn_mkdir_p -@@ -360,19 +360,19 @@ else - fi # as_fn_arith - - --# as_fn_error STATUS ERROR [LINENO LOG_FD] --# ---------------------------------------- -+# as_fn_error ERROR [LINENO LOG_FD] -+# --------------------------------- - # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are - # provided, also output the error to LOG_FD, referencing LINENO. Then exit the --# script with STATUS, using 1 if that was 0. -+# script with status $?, using 1 if that was 0. - as_fn_error () - { -- as_status=$1; test $as_status -eq 0 && as_status=1 -- if test "$4"; then -- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack -- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 -+ as_status=$?; test $as_status -eq 0 && as_status=1 -+ if test "$3"; then -+ as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack -+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 - fi -- $as_echo "$as_me: error: $2" >&2 -+ $as_echo "$as_me: error: $1" >&2 - as_fn_exit $as_status - } # as_fn_error - -@@ -534,7 +534,7 @@ test -n "$DJDIR" || exec 7<&0 &1 - - # Name of the host. --# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, -+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, - # so uname gets run too. - ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - @@ -611,6 +611,8 @@ TRUE MACHDEP_OBJS DYNLOADFILE @@ -74,7 +17,7 @@ diff -up ./configure.autotool-intermediates ./configure THREADOBJ LDLAST USE_THREAD_MODULE -@@ -748,8 +750,11 @@ with_thread +@@ -749,8 +751,11 @@ with_thread enable_ipv6 with_doc_strings with_tsc @@ -86,146 +29,7 @@ diff -up ./configure.autotool-intermediates ./configure with_fpectl with_libm with_libc -@@ -828,9 +833,8 @@ do - fi - - case $ac_option in -- *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; -- *=) ac_optarg= ;; -- *) ac_optarg=yes ;; -+ *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; -+ *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. -@@ -875,7 +879,7 @@ do - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && -- as_fn_error $? "invalid feature name: $ac_useropt" -+ as_fn_error "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in -@@ -901,7 +905,7 @@ do - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && -- as_fn_error $? "invalid feature name: $ac_useropt" -+ as_fn_error "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in -@@ -1105,7 +1109,7 @@ do - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && -- as_fn_error $? "invalid package name: $ac_useropt" -+ as_fn_error "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in -@@ -1121,7 +1125,7 @@ do - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && -- as_fn_error $? "invalid package name: $ac_useropt" -+ as_fn_error "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in -@@ -1151,8 +1155,8 @@ do - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - -- -*) as_fn_error $? "unrecognized option: \`$ac_option' --Try \`$0 --help' for more information" -+ -*) as_fn_error "unrecognized option: \`$ac_option' -+Try \`$0 --help' for more information." - ;; - - *=*) -@@ -1160,7 +1164,7 @@ Try \`$0 --help' for more information" - # Reject names that are not valid shell variable names. - case $ac_envvar in #( - '' | [0-9]* | *[!_$as_cr_alnum]* ) -- as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; -+ as_fn_error "invalid variable name: \`$ac_envvar'" ;; - esac - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; -@@ -1178,13 +1182,13 @@ done - - if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` -- as_fn_error $? "missing argument to $ac_option" -+ as_fn_error "missing argument to $ac_option" - fi - - if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; -- fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; -+ fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac - fi -@@ -1207,7 +1211,7 @@ do - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac -- as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" -+ as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" - done - - # There might be people who depend on the old broken behavior: `$host' -@@ -1221,8 +1225,8 @@ target=$target_alias - if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe -- $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. -- If a cross compiler is detected then cross compile mode will be used" >&2 -+ $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. -+ If a cross compiler is detected then cross compile mode will be used." >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -@@ -1237,9 +1241,9 @@ test "$silent" = yes && exec 6>/dev/null - ac_pwd=`pwd` && test -n "$ac_pwd" && - ac_ls_di=`ls -di .` && - ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || -- as_fn_error $? "working directory cannot be determined" -+ as_fn_error "working directory cannot be determined" - test "X$ac_ls_di" = "X$ac_pwd_ls_di" || -- as_fn_error $? "pwd does not report name of working directory" -+ as_fn_error "pwd does not report name of working directory" - - - # Find the source files, if location was not specified. -@@ -1278,11 +1282,11 @@ else - fi - if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." -- as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" -+ as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" - fi - ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" - ac_abs_confdir=`( -- cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" -+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" - pwd)` - # When building in place, set srcdir=. - if test "$ac_abs_confdir" = "$ac_pwd"; then -@@ -1322,7 +1326,7 @@ Configuration: - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit -- -q, --quiet, --silent do not print \`checking ...' messages -+ -q, --quiet, --silent do not print \`checking...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files -@@ -1421,8 +1425,11 @@ Optional Packages: +@@ -1421,8 +1426,11 @@ Optional Packages: deprecated; use --with(out)-threads --with(out)-doc-strings disable/enable documentation strings --with(out)-tsc enable/disable timestamp counter profile @@ -237,775 +41,7 @@ diff -up ./configure.autotool-intermediates ./configure --with-fpectl enable SIGFPE catching --with-libm=STRING math library --with-libc=STRING C library -@@ -1508,9 +1515,9 @@ test -n "$ac_init_help" && exit $ac_stat - if $ac_init_version; then - cat <<\_ACEOF - python configure 3.2 --generated by GNU Autoconf 2.67 -+generated by GNU Autoconf 2.65 - --Copyright (C) 2010 Free Software Foundation, Inc. -+Copyright (C) 2009 Free Software Foundation, Inc. - This configure script is free software; the Free Software Foundation - gives unlimited permission to copy, distribute and modify it. - _ACEOF -@@ -1580,7 +1587,7 @@ $as_echo "$ac_try_echo"; } >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -- test $ac_status = 0; } > conftest.i && { -+ test $ac_status = 0; } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : -@@ -1604,10 +1611,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 { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; 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 { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 - fi - eval ac_res=\$$3 -@@ -1643,7 +1650,7 @@ if ac_fn_c_try_cpp "$LINENO"; then : - else - ac_header_preproc=no - fi --rm -f conftest.err conftest.i conftest.$ac_ext -+rm -f conftest.err conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 - $as_echo "$ac_header_preproc" >&6; } - -@@ -1666,15 +1673,17 @@ $as_echo "$as_me: WARNING: $2: see the A - $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 - $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} --( $as_echo "## -------------------------------------- ## -+( cat <<\_ASBOX -+## -------------------------------------- ## - ## Report this to http://bugs.python.org/ ## --## -------------------------------------- ##" -+## -------------------------------------- ## -+_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; - 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 { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 - else - eval "$3=\$ac_header_compiler" -@@ -1738,7 +1747,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 { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -1815,7 +1824,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 { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 - else - eval "$3=no" -@@ -1869,7 +1878,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 { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 - else - eval "$3=no" -@@ -1899,7 +1908,8 @@ if ac_fn_c_try_compile "$LINENO"; then : - esac - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -- if eval test \"x\$"$3"\" = x"no"; then : -+ eval as_val=\$$3 -+ if test "x$as_val" = x""no; then : - - else - break -@@ -1922,7 +1932,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 { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 - else - eval "$3=no" -@@ -1933,11 +1943,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 - - ; -@@ -1948,11 +1958,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 - -@@ -1973,7 +1983,8 @@ fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -- if eval test \"x\$"$3"\" = x"no"; then : -+ eval as_val=\$$3 -+ if test "x$as_val" = x""no; then : - - else - break -@@ -2173,7 +2184,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 { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -2241,7 +2252,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 { as_var=$4; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -2289,18 +2300,15 @@ $as_echo "$ac_res" >&6; } - - } # ac_fn_c_check_member - --# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES --# --------------------------------------------- --# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR --# accordingly. -+# ac_fn_c_check_decl LINENO SYMBOL VAR -+# ------------------------------------ -+# Tests whether SYMBOL is declared, setting cache variable VAR accordingly. - ac_fn_c_check_decl () - { - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack -- as_decl_name=`echo $2|sed 's/ *(.*//'` -- 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 : -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $2 is declared" >&5 -+$as_echo_n "checking whether $2 is declared... " >&6; } -+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -2309,12 +2317,8 @@ $4 - int - main () - { --#ifndef $as_decl_name --#ifdef __cplusplus -- (void) $as_decl_use; --#else -- (void) $as_decl_name; --#endif -+#ifndef $2 -+ (void) $2; - #endif - - ; -@@ -2339,7 +2343,7 @@ This file contains any messages produced - running configure, to aid debugging if configure makes a mistake. - - It was created by python $as_me 3.2, which was --generated by GNU Autoconf 2.67. Invocation command line was -+generated by GNU Autoconf 2.65. Invocation command line was - - $ $0 $@ - -@@ -2449,9 +2453,11 @@ trap 'exit_status=$? - { - echo - -- $as_echo "## ---------------- ## -+ cat <<\_ASBOX -+## ---------------- ## - ## Cache variables. ## --## ---------------- ##" -+## ---------------- ## -+_ASBOX - echo - # The following way of writing the cache mishandles newlines in values, - ( -@@ -2485,9 +2491,11 @@ $as_echo "$as_me: WARNING: cache variabl - ) - echo - -- $as_echo "## ----------------- ## -+ cat <<\_ASBOX -+## ----------------- ## - ## Output variables. ## --## ----------------- ##" -+## ----------------- ## -+_ASBOX - echo - for ac_var in $ac_subst_vars - do -@@ -2500,9 +2508,11 @@ $as_echo "$as_me: WARNING: cache variabl - echo - - if test -n "$ac_subst_files"; then -- $as_echo "## ------------------- ## -+ cat <<\_ASBOX -+## ------------------- ## - ## File substitutions. ## --## ------------------- ##" -+## ------------------- ## -+_ASBOX - echo - for ac_var in $ac_subst_files - do -@@ -2516,9 +2526,11 @@ $as_echo "$as_me: WARNING: cache variabl - fi - - if test -s confdefs.h; then -- $as_echo "## ----------- ## -+ cat <<\_ASBOX -+## ----------- ## - ## confdefs.h. ## --## ----------- ##" -+## ----------- ## -+_ASBOX - echo - cat confdefs.h - echo -@@ -2573,12 +2585,7 @@ _ACEOF - ac_site_file1=NONE - ac_site_file2=NONE - if test -n "$CONFIG_SITE"; then -- # We do not want a PATH search for config.site. -- case $CONFIG_SITE in #(( -- -*) ac_site_file1=./$CONFIG_SITE;; -- */*) ac_site_file1=$CONFIG_SITE;; -- *) ac_site_file1=./$CONFIG_SITE;; -- esac -+ ac_site_file1=$CONFIG_SITE - elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -@@ -2593,11 +2600,7 @@ do - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 - $as_echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 -- . "$ac_site_file" \ -- || { { $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 ; } -+ . "$ac_site_file" - fi - done - -@@ -2673,7 +2676,7 @@ if $ac_cache_corrupted; then - $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 - $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} -- as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -+ as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 - fi - ## -------------------- ## - ## Main body of script. ## -@@ -2774,7 +2777,7 @@ if test "${enable_universalsdk+set}" = s - UNIVERSALSDK=$enableval - if test ! -d "${UNIVERSALSDK}" - then -- as_fn_error $? "--enable-universalsdk specifies non-existing SDK: ${UNIVERSALSDK}" "$LINENO" 5 -+ as_fn_error "--enable-universalsdk specifies non-existing SDK: ${UNIVERSALSDK}" "$LINENO" 5 - fi - ;; - esac -@@ -3166,7 +3169,7 @@ $as_echo "$without_gcc" >&6; } - # If the user switches compilers, we can't believe the cache - if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC" - then -- as_fn_error $? "cached CC is different -- throw away $cache_file -+ as_fn_error "cached CC is different -- throw away $cache_file - (it is also a good idea to do 'make clean' before compiling)" "$LINENO" 5 - fi - -@@ -3476,8 +3479,8 @@ 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 ; } -+as_fn_error "no acceptable C compiler found in \$PATH -+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 -@@ -3591,8 +3594,9 @@ 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 ; } -+{ as_fn_set_status 77 -+as_fn_error "C compiler cannot create executables -+See \`config.log' for more details." "$LINENO" 5; }; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 - $as_echo "yes" >&6; } -@@ -3634,8 +3638,8 @@ done - 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 ; } -+as_fn_error "cannot compute suffix of executables: cannot compile and link -+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 -@@ -3692,9 +3696,9 @@ $as_echo "$ac_try_echo"; } >&5 - 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 run C compiled programs. -+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 -@@ -3745,8 +3749,8 @@ 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 ; } -+as_fn_error "cannot compute suffix of object files: cannot compile -+See \`config.log' for more details." "$LINENO" 5; } - fi - rm -f conftest.$ac_cv_objext conftest.$ac_ext - fi -@@ -4199,7 +4203,7 @@ else - # Broken: fails on valid input. - continue - fi --rm -f conftest.err conftest.i conftest.$ac_ext -+rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. -@@ -4215,11 +4219,11 @@ else - ac_preproc_ok=: - break - fi --rm -f conftest.err conftest.i conftest.$ac_ext -+rm -f conftest.err conftest.$ac_ext - - done - # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. --rm -f conftest.i conftest.err conftest.$ac_ext -+rm -f conftest.err conftest.$ac_ext - if $ac_preproc_ok; then : - break - fi -@@ -4258,7 +4262,7 @@ else - # Broken: fails on valid input. - continue - fi --rm -f conftest.err conftest.i conftest.$ac_ext -+rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. -@@ -4274,18 +4278,18 @@ else - ac_preproc_ok=: - break - fi --rm -f conftest.err conftest.i conftest.$ac_ext -+rm -f conftest.err conftest.$ac_ext - - done - # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. --rm -f conftest.i conftest.err conftest.$ac_ext -+rm -f conftest.err conftest.$ac_ext - if $ac_preproc_ok; then : - - 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 ; } -+as_fn_error "C preprocessor \"$CPP\" fails sanity check -+See \`config.log' for more details." "$LINENO" 5; } - fi - - ac_ext=c -@@ -4346,7 +4350,7 @@ esac - done - IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then -- as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 -+ as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi - else - ac_cv_path_GREP=$GREP -@@ -4412,7 +4416,7 @@ esac - done - IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then -- as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 -+ as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi - else - ac_cv_path_EGREP=$EGREP -@@ -4544,7 +4548,8 @@ do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` - ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default - " --if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : -+eval as_val=\$$as_ac_Header -+ if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF - #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 - _ACEOF -@@ -5158,22 +5163,16 @@ bsdos*|hp*|HP*) - esac - ac_aux_dir= - for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do -- if test -f "$ac_dir/install-sh"; then -- ac_aux_dir=$ac_dir -- ac_install_sh="$ac_aux_dir/install-sh -c" -- break -- elif test -f "$ac_dir/install.sh"; then -- ac_aux_dir=$ac_dir -- ac_install_sh="$ac_aux_dir/install.sh -c" -- break -- elif test -f "$ac_dir/shtool"; then -- ac_aux_dir=$ac_dir -- ac_install_sh="$ac_aux_dir/shtool install -c" -- break -- fi -+ for ac_t in install-sh install.sh shtool; do -+ if test -f "$ac_dir/$ac_t"; then -+ ac_aux_dir=$ac_dir -+ ac_install_sh="$ac_aux_dir/$ac_t -c" -+ break 2 -+ fi -+ done - done - if test -z "$ac_aux_dir"; then -- as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 -+ as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 - fi - - # These three variables are undocumented and unsupported, -@@ -5511,7 +5510,7 @@ $as_echo "$CC" >&6; } - ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc" - - else -- as_fn_error $? "proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way" "$LINENO" 5 -+ as_fn_error "proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way" "$LINENO" 5 - - fi - -@@ -6005,7 +6004,8 @@ bluetooth/bluetooth.h linux/tipc.h spawn - do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` - ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" --if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : -+eval as_val=\$$as_ac_Header -+ if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF - #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 - _ACEOF -@@ -6019,7 +6019,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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -6046,7 +6046,8 @@ fi - eval ac_res=\$$as_ac_Header - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 - $as_echo "$ac_res" >&6; } --if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : -+eval as_val=\$$as_ac_Header -+ if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF - #define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 - _ACEOF -@@ -6566,8 +6567,9 @@ else - if test "$ac_cv_type_int" = yes; then - { { $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 ; } -+{ as_fn_set_status 77 -+as_fn_error "cannot compute sizeof (int) -+See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_int=0 - fi -@@ -6599,8 +6601,9 @@ else - if test "$ac_cv_type_long" = yes; then - { { $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 ; } -+{ as_fn_set_status 77 -+as_fn_error "cannot compute sizeof (long) -+See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_long=0 - fi -@@ -6632,8 +6635,9 @@ else - if test "$ac_cv_type_void_p" = yes; then - { { $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 ; } -+{ as_fn_set_status 77 -+as_fn_error "cannot compute sizeof (void *) -+See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_void_p=0 - fi -@@ -6665,8 +6669,9 @@ else - if test "$ac_cv_type_short" = yes; then - { { $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 ; } -+{ as_fn_set_status 77 -+as_fn_error "cannot compute sizeof (short) -+See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_short=0 - fi -@@ -6698,8 +6703,9 @@ else - if test "$ac_cv_type_float" = yes; then - { { $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 ; } -+{ as_fn_set_status 77 -+as_fn_error "cannot compute sizeof (float) -+See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_float=0 - fi -@@ -6731,8 +6737,9 @@ else - if test "$ac_cv_type_double" = yes; then - { { $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 ; } -+{ as_fn_set_status 77 -+as_fn_error "cannot compute sizeof (double) -+See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_double=0 - fi -@@ -6764,8 +6771,9 @@ else - if test "$ac_cv_type_fpos_t" = yes; then - { { $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 ; } -+{ as_fn_set_status 77 -+as_fn_error "cannot compute sizeof (fpos_t) -+See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_fpos_t=0 - fi -@@ -6797,8 +6805,9 @@ else - if test "$ac_cv_type_size_t" = yes; then - { { $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 ; } -+{ as_fn_set_status 77 -+as_fn_error "cannot compute sizeof (size_t) -+See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_size_t=0 - fi -@@ -6830,8 +6839,9 @@ else - if test "$ac_cv_type_pid_t" = yes; then - { { $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 ; } -+{ as_fn_set_status 77 -+as_fn_error "cannot compute sizeof (pid_t) -+See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_pid_t=0 - fi -@@ -6890,8 +6900,9 @@ else - if test "$ac_cv_type_long_long" = yes; then - { { $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 ; } -+{ as_fn_set_status 77 -+as_fn_error "cannot compute sizeof (long long) -+See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_long_long=0 - fi -@@ -6951,8 +6962,9 @@ else - if test "$ac_cv_type_long_double" = yes; then - { { $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 ; } -+{ as_fn_set_status 77 -+as_fn_error "cannot compute sizeof (long double) -+See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_long_double=0 - fi -@@ -7013,8 +7025,9 @@ else - if test "$ac_cv_type__Bool" = yes; then - { { $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 ; } -+{ as_fn_set_status 77 -+as_fn_error "cannot compute sizeof (_Bool) -+See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof__Bool=0 - fi -@@ -7061,8 +7074,9 @@ else - if test "$ac_cv_type_uintptr_t" = yes; then - { { $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 ; } -+{ as_fn_set_status 77 -+as_fn_error "cannot compute sizeof (uintptr_t) -+See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_uintptr_t=0 - fi -@@ -7102,8 +7116,9 @@ else - if test "$ac_cv_type_off_t" = yes; then - { { $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 ; } -+{ as_fn_set_status 77 -+as_fn_error "cannot compute sizeof (off_t) -+See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_off_t=0 - fi -@@ -7164,8 +7179,9 @@ else - if test "$ac_cv_type_time_t" = yes; then - { { $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 ; } -+{ as_fn_set_status 77 -+as_fn_error "cannot compute sizeof (time_t) -+See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_time_t=0 - fi -@@ -7236,8 +7252,9 @@ else - if test "$ac_cv_type_pthread_t" = yes; then - { { $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 ; } -+{ as_fn_set_status 77 -+as_fn_error "cannot compute sizeof (pthread_t) -+See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_pthread_t=0 - fi -@@ -7324,7 +7341,7 @@ fi - MACOSX_DEFAULT_ARCH="ppc" - ;; - *) -- as_fn_error $? "Unexpected output of 'arch' on OSX" "$LINENO" 5 -+ as_fn_error "Unexpected output of 'arch' on OSX" "$LINENO" 5 - ;; - esac - else -@@ -7336,7 +7353,7 @@ fi - MACOSX_DEFAULT_ARCH="ppc64" - ;; - *) -- as_fn_error $? "Unexpected output of 'arch' on OSX" "$LINENO" 5 -+ as_fn_error "Unexpected output of 'arch' on OSX" "$LINENO" 5 - ;; - esac - -@@ -7362,7 +7379,7 @@ $as_echo "#define WITH_NEXT_FRAMEWORK 1" - $as_echo "yes" >&6; } - if test $enable_shared = "yes" - then -- as_fn_error $? "Specifying both --enable-shared and --enable-framework is not supported, use only --enable-framework instead" "$LINENO" 5 -+ as_fn_error "Specifying both --enable-shared and --enable-framework is not supported, use only --enable-framework instead" "$LINENO" 5 - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -@@ -8158,12 +8175,12 @@ if test "${with_dbmliborder+set}" = set; - withval=$with_dbmliborder; - if test x$with_dbmliborder = xyes - then --as_fn_error $? "proper usage is --with-dbmliborder=db1:db2:..." "$LINENO" 5 -+as_fn_error "proper usage is --with-dbmliborder=db1:db2:..." "$LINENO" 5 - else - for db in `echo $with_dbmliborder | sed 's/:/ /g'`; do - if test x$db != xndbm && test x$db != xgdbm && test x$db != xbdb - then -- as_fn_error $? "proper usage is --with-dbmliborder=db1:db2:..." "$LINENO" 5 -+ as_fn_error "proper usage is --with-dbmliborder=db1:db2:..." "$LINENO" 5 - fi - done - fi -@@ -9118,6 +9135,50 @@ $as_echo "no" >&6; } +@@ -9138,6 +9146,50 @@ $as_echo "no" >&6; } fi @@ -1056,16 +92,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; } -@@ -9162,7 +9223,7 @@ if test "x$ac_cv_header_valgrind_valgrin - $as_echo "#define WITH_VALGRIND 1" >>confdefs.h - - else -- as_fn_error $? "Valgrind support requested but headers not available" "$LINENO" 5 -+ as_fn_error "Valgrind support requested but headers not available" "$LINENO" 5 - - fi - -@@ -9170,6 +9231,46 @@ fi +@@ -9190,6 +9242,46 @@ fi OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT" fi @@ -1112,494 +139,20 @@ diff -up ./configure.autotool-intermediates ./configure # -I${DLINCLDIR} is added to the compile rule for importdl.o DLINCLDIR=. -@@ -9256,7 +9357,8 @@ for ac_func in alarm accept4 setitimer g - do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` - ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" --if eval test \"x\$"$as_ac_var"\" = x"yes"; then : -+eval as_val=\$$as_ac_var -+ if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF - #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 - _ACEOF -@@ -10251,7 +10353,8 @@ for ac_func in fseek64 fseeko fstatvfs f - do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` - ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" --if eval test \"x\$"$as_ac_var"\" = x"yes"; then : -+eval as_val=\$$as_ac_var -+ if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF - #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 - _ACEOF -@@ -10260,44 +10363,25 @@ fi - done +@@ -14304,8 +14396,8 @@ esac + cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + # Files that config.status was made for. +-config_files="`echo $ac_config_files`" +-config_headers="`echo $ac_config_headers`" ++config_files="$ac_config_files" ++config_headers="$ac_config_headers" --ac_fn_c_check_func "$LINENO" "dup2" "ac_cv_func_dup2" --if test "x$ac_cv_func_dup2" = x""yes; then : -- $as_echo "#define HAVE_DUP2 1" >>confdefs.h -- --else -- case " $LIBOBJS " in -- *" dup2.$ac_objext "* ) ;; -- *) LIBOBJS="$LIBOBJS dup2.$ac_objext" -- ;; --esac -- --fi -- --ac_fn_c_check_func "$LINENO" "getcwd" "ac_cv_func_getcwd" --if test "x$ac_cv_func_getcwd" = x""yes; then : -- $as_echo "#define HAVE_GETCWD 1" >>confdefs.h -- --else -- case " $LIBOBJS " in -- *" getcwd.$ac_objext "* ) ;; -- *) LIBOBJS="$LIBOBJS getcwd.$ac_objext" -- ;; --esac -- --fi -- --ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup" --if test "x$ac_cv_func_strdup" = x""yes; then : -- $as_echo "#define HAVE_STRDUP 1" >>confdefs.h -+for ac_func in dup2 getcwd strdup -+do : -+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -+eval as_val=\$$as_ac_var -+ if test "x$as_val" = x""yes; then : -+ cat >>confdefs.h <<_ACEOF -+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -+_ACEOF - - else - case " $LIBOBJS " in -- *" strdup.$ac_objext "* ) ;; -- *) LIBOBJS="$LIBOBJS strdup.$ac_objext" -+ *" $ac_func.$ac_objext "* ) ;; -+ *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" - ;; - esac - - fi -+done - - - for ac_func in getpgrp -@@ -11510,7 +11594,7 @@ elif test "$withval" != yes - then LIBM=$withval - { $as_echo "$as_me:${as_lineno-$LINENO}: result: set LIBM=\"$withval\"" >&5 - $as_echo "set LIBM=\"$withval\"" >&6; } --else as_fn_error $? "proper usage is --with-libm=STRING" "$LINENO" 5 -+else as_fn_error "proper usage is --with-libm=STRING" "$LINENO" 5 - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: default LIBM=\"$LIBM\"" >&5 -@@ -11534,7 +11618,7 @@ elif test "$withval" != yes - then LIBC=$withval - { $as_echo "$as_me:${as_lineno-$LINENO}: result: set LIBC=\"$withval\"" >&5 - $as_echo "set LIBC=\"$withval\"" >&6; } --else as_fn_error $? "proper usage is --with-libc=STRING" "$LINENO" 5 -+else as_fn_error "proper usage is --with-libc=STRING" "$LINENO" 5 - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: default LIBC=\"$LIBC\"" >&5 -@@ -11784,7 +11868,8 @@ for ac_func in acosh asinh atanh copysig - do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` - ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" --if eval test \"x\$"$as_ac_var"\" = x"yes"; then : -+eval as_val=\$$as_ac_var -+ if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF - #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 - _ACEOF -@@ -11796,7 +11881,8 @@ for ac_func in hypot lgamma log1p round - do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` - ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" --if eval test \"x\$"$as_ac_var"\" = x"yes"; then : -+eval as_val=\$$as_ac_var -+ if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF - #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 - _ACEOF -@@ -12059,7 +12145,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; } -@@ -12110,8 +12196,9 @@ else - if test "$ac_cv_type_wchar_t" = yes; then - { { $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 ; } -+{ as_fn_set_status 77 -+as_fn_error "cannot compute sizeof (wchar_t) -+See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_wchar_t=0 - fi -@@ -12480,8 +12567,8 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUI - - ;; #( - *) -- as_fn_error $? "unknown endianness -- presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; -+ as_fn_error "unknown endianness -+ presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; - esac - - -@@ -12742,7 +12829,7 @@ else - have_readline=no - - fi --rm -f conftest.err conftest.i conftest.$ac_ext -+rm -f conftest.err conftest.$ac_ext - if test $have_readline = yes - then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -12916,7 +13003,7 @@ else - have_readline=no - - fi --rm -f conftest.err conftest.i conftest.$ac_ext -+rm -f conftest.err conftest.$ac_ext - if test $have_readline = yes - then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -13732,7 +13819,7 @@ esac - - - case $ac_sys_system in -- OSF*) as_fn_error $? "OSF* systems are deprecated unless somebody volunteers. Check http://bugs.python.org/issue8606" "$LINENO" 5 ;; -+ OSF*) as_fn_error "OSF* systems are deprecated unless somebody volunteers. Check http://bugs.python.org/issue8606" "$LINENO" 5 ;; - esac - - ac_fn_c_check_func "$LINENO" "pipe2" "ac_cv_func_pipe2" -@@ -13850,7 +13937,6 @@ DEFS=-DHAVE_CONFIG_H - - ac_libobjs= - ac_ltlibobjs= --U= - for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' -@@ -14013,19 +14099,19 @@ export LANGUAGE - (unset CDPATH) >/dev/null 2>&1 && unset CDPATH - - --# as_fn_error STATUS ERROR [LINENO LOG_FD] --# ---------------------------------------- -+# as_fn_error ERROR [LINENO LOG_FD] -+# --------------------------------- - # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are - # provided, also output the error to LOG_FD, referencing LINENO. Then exit the --# script with STATUS, using 1 if that was 0. -+# script with status $?, using 1 if that was 0. - as_fn_error () - { -- as_status=$1; test $as_status -eq 0 && as_status=1 -- if test "$4"; then -- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack -- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 -+ as_status=$?; test $as_status -eq 0 && as_status=1 -+ if test "$3"; then -+ as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack -+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 - fi -- $as_echo "$as_me: error: $2" >&2 -+ $as_echo "$as_me: error: $1" >&2 - as_fn_exit $as_status - } # as_fn_error - -@@ -14221,7 +14307,7 @@ $as_echo X"$as_dir" | - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" -- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" -+ } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" - - - } # as_fn_mkdir_p -@@ -14275,7 +14361,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri - # values after options handling. - ac_log=" - This file was extended by python $as_me 3.2, which was --generated by GNU Autoconf 2.67. Invocation command line was -+generated by GNU Autoconf 2.65. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS -@@ -14337,10 +14423,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_writ - ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" - ac_cs_version="\\ - python config.status 3.2 --configured by $0, generated by GNU Autoconf 2.67, -+configured by $0, generated by GNU Autoconf 2.65, - with options \\"\$ac_cs_config\\" - --Copyright (C) 2010 Free Software Foundation, Inc. -+Copyright (C) 2009 Free Software Foundation, Inc. - This config.status script is free software; the Free Software Foundation - gives unlimited permission to copy, distribute and modify it." - -@@ -14356,16 +14442,11 @@ ac_need_defaults=: - while test $# != 0 - do - case $1 in -- --*=?*) -+ --*=*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; -- --*=) -- ac_option=`expr "X$1" : 'X\([^=]*\)='` -- ac_optarg= -- ac_shift=: -- ;; - *) - ac_option=$1 - ac_optarg=$2 -@@ -14387,7 +14468,6 @@ do - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; -- '') as_fn_error $? "missing file argument" ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" - ac_need_defaults=false;; -@@ -14400,7 +14480,7 @@ do - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header -- as_fn_error $? "ambiguous option: \`$1' -+ as_fn_error "ambiguous option: \`$1' - Try \`$0 --help' for more information.";; - --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; -@@ -14409,7 +14489,7 @@ Try \`$0 --help' for more information."; - ac_cs_silent=: ;; - - # This is an error. -- -*) as_fn_error $? "unrecognized option: \`$1' -+ -*) as_fn_error "unrecognized option: \`$1' - Try \`$0 --help' for more information." ;; - - *) as_fn_append ac_config_targets " $1" -@@ -14468,7 +14548,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 - -@@ -14505,7 +14585,7 @@ $debug || - { - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") --} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -+} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 - - # Set up the scripts for CONFIG_FILES section. - # No need to generate them if there are no CONFIG_FILES. -@@ -14522,7 +14602,7 @@ if test "x$ac_cr" = x; then - fi - ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` - if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then -- ac_cs_awk_cr='\\r' -+ ac_cs_awk_cr='\r' - else - ac_cs_awk_cr=$ac_cr - fi -@@ -14536,18 +14616,18 @@ _ACEOF - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" - } >conf$$subs.sh || -- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 --ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` -+ as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 -+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` - ac_delim='%!_!# ' - for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || -- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -+ as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then -- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -+ as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -@@ -14636,28 +14716,20 @@ if sed "s/$ac_cr//" < /dev/null > /dev/n - else - cat - fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ -- || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 -+ || as_fn_error "could not setup config files machinery" "$LINENO" 5 _ACEOF --# VPATH may cause trouble with some makes, so we remove sole $(srcdir), --# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and -+# VPATH may cause trouble with some makes, so we remove $(srcdir), -+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and - # trailing colons and then remove the whole line if VPATH becomes empty - # (actually we leave an empty line to preserve line numbers). - if test "x$srcdir" = x.; then -- ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ --h --s/// --s/^/:/ --s/[ ]*$/:/ --s/:\$(srcdir):/:/g --s/:\${srcdir}:/:/g --s/:@srcdir@:/:/g --s/^:*// -+ ac_vpsub='/^[ ]*VPATH[ ]*=/{ -+s/:*\$(srcdir):*/:/ -+s/:*\${srcdir}:*/:/ -+s/:*@srcdir@:*/:/ -+s/^\([^=]*=[ ]*\):*/\1/ - s/:*$// --x --s/\(=[ ]*\).*/\1/ --G --s/\n// - s/^[^=]*=[ ]*$// - }' - fi -@@ -14685,7 +14757,7 @@ for ac_last_try in false false :; do - if test -z "$ac_t"; then - break - elif $ac_last_try; then -- as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 -+ as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -@@ -14770,7 +14842,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_writ - _ACAWK - _ACEOF - cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -- as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 -+ as_fn_error "could not setup config headers machinery" "$LINENO" 5 - fi # test -n "$CONFIG_HEADERS" - - -@@ -14783,7 +14855,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 -@@ -14811,7 +14883,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 "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'" -@@ -14838,7 +14910,7 @@ $as_echo "$as_me: creating $ac_file" >&6 - - case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ -- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; -+ || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; - esac -@@ -14969,22 +15041,22 @@ 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 -+ || 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"; } && - { $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 -+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;} -+which seems to be undefined. Please make sure it is defined." >&2;} - - rm -f "$tmp/stdin" - case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; - esac \ -- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 -+ || as_fn_error "could not create $ac_file" "$LINENO" 5 - ;; - :H) - # -@@ -14995,19 +15067,19 @@ which seems to be undefined. Please mak - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" - } >"$tmp/config.h" \ -- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 -+ || as_fn_error "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$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" \ -- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 -+ || 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" \ -- || as_fn_error $? "could not create -" "$LINENO" 5 -+ || as_fn_error "could not create -" "$LINENO" 5 - fi - ;; - -@@ -15027,7 +15099,7 @@ _ACEOF - ac_clean_files=$ac_clean_files_save - - test $ac_write_fail = 0 || -- as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 -+ as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 - - - # configure is writing to config.log, and then calls config.status. -@@ -15048,7 +15120,7 @@ if test "$no_create" != yes; then - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. -- $ac_cs_success || as_fn_exit 1 -+ $ac_cs_success || as_fn_exit $? - fi - if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 diff -up ./pyconfig.h.in.autotool-intermediates ./pyconfig.h.in ---- ./pyconfig.h.in.autotool-intermediates 2010-12-28 18:47:15.203935226 -0500 -+++ ./pyconfig.h.in 2010-12-28 18:47:21.330060783 -0500 +--- ./pyconfig.h.in.autotool-intermediates 2011-01-17 13:09:50.827696887 -0500 ++++ ./pyconfig.h.in 2011-01-17 13:09:56.963611199 -0500 @@ -12,15 +12,15 @@ support for AIX C++ shared extension modules. */ #undef AIX_GENUINE_CPLUSPLUS @@ -1619,13 +172,3 @@ diff -up ./pyconfig.h.in.autotool-intermediates ./pyconfig.h.in /* Define if C doubles are 64-bit IEEE 754 binary format, stored in ARM mixed-endian order (byte order 45670123) */ #undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 -@@ -503,6 +503,9 @@ - /* Define to 1 if you have the `pause' function. */ - #undef HAVE_PAUSE - -+/* Define if the OS supports pipe2() */ -+#undef HAVE_PIPE2 -+ - /* Define to 1 if you have the `plock' function. */ - #undef HAVE_PLOCK - diff --git a/python-3.2b2-no-static-lib.patch b/python-3.2rc1-no-static-lib.patch similarity index 75% rename from python-3.2b2-no-static-lib.patch rename to python-3.2rc1-no-static-lib.patch index 3ef3bc2..5b32bc7 100644 --- a/python-3.2b2-no-static-lib.patch +++ b/python-3.2rc1-no-static-lib.patch @@ -1,16 +1,16 @@ -diff -up Python-3.2b2/Makefile.pre.in.no-static-lib Python-3.2b2/Makefile.pre.in ---- Python-3.2b2/Makefile.pre.in.no-static-lib 2010-12-13 13:04:23.000000000 -0500 -+++ Python-3.2b2/Makefile.pre.in 2010-12-28 16:57:11.484065804 -0500 -@@ -420,7 +420,7 @@ coverage: +diff -up Python-3.2rc1/Makefile.pre.in.no-static-lib Python-3.2rc1/Makefile.pre.in +--- Python-3.2rc1/Makefile.pre.in.no-static-lib 2010-12-30 17:12:40.000000000 -0500 ++++ Python-3.2rc1/Makefile.pre.in 2011-01-17 12:58:32.123947161 -0500 +@@ -421,7 +421,7 @@ coverage: # Build the interpreter --$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY) -+$(BUILDPYTHON): Modules/python.o $(LDLIBRARY) +-$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) ++$(BUILDPYTHON): Modules/python.o $(LDLIBRARY) $(PY3LIBRARY) $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Modules/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) platform: $(BUILDPYTHON) -@@ -434,18 +434,6 @@ sharedmods: $(BUILDPYTHON) +@@ -435,18 +435,6 @@ sharedmods: $(BUILDPYTHON) *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \ esac @@ -29,7 +29,7 @@ diff -up Python-3.2b2/Makefile.pre.in.no-static-lib Python-3.2b2/Makefile.pre.in libpython$(LDVERSION).so: $(LIBRARY_OBJS) if test $(INSTSONAME) != $(LDLIBRARY); then \ $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ -@@ -1035,18 +1023,6 @@ libainstall: all python-config +@@ -1048,18 +1036,6 @@ libainstall: all python-config else true; \ fi; \ done diff --git a/python3.spec b/python3.spec index 56208eb..f4f23db 100644 --- a/python3.spec +++ b/python3.spec @@ -3,7 +3,7 @@ # pybasever without the dot: %global pyshortver 32 -%global alphatag b2 +%global alphatag rc1 %global pylibdir %{_libdir}/python%{pybasever} %global dynload_dir %{pylibdir}/lib-dynload @@ -113,7 +113,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever} -Release: 0.8.%{alphatag}%{?dist} +Release: 0.9.%{alphatag}%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}%{alphatag}.tar.bz2 @@ -178,7 +178,7 @@ Patch3: python-3.2b2-remove-mimeaudio-tests.patch # Patch the Makefile.pre.in so that the generated Makefile doesn't try to build # a libpythonMAJOR.MINOR.a (bug 550692): -Patch6: python-3.2b2-no-static-lib.patch +Patch6: python-3.2rc1-no-static-lib.patch # Systemtap support: add statically-defined probe points # Patch based on upstream bug: http://bugs.python.org/issue4111 @@ -231,10 +231,6 @@ Patch128: python-3.2b2-test_sys-COUNT_ALLOCS.patch # Not yet sent upstream Patch129: python-3.2b2-fix-test-subprocess-with-nonreadable-path-dir.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: @@ -402,7 +398,6 @@ rm -r Modules/zlib || exit 1 %patch127 -p1 %patch128 -p1 %patch129 -p1 -%patch130 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -597,7 +592,7 @@ install -m755 -d %{buildroot}%{pylibdir}/Doc cp -ar Doc/tools %{buildroot}%{pylibdir}/Doc/ # Demo scripts -cp -ar Demo %{buildroot}%{pylibdir}/ +cp -ar Tools/demo %{buildroot}%{pylibdir}/Tools/ # Fix for bug #136654 rm -f %{buildroot}%{pylibdir}/email/test/data/audiotest.au %{buildroot}%{pylibdir}/test/audiotest.au @@ -681,12 +676,8 @@ find %{buildroot} \ # Remove executable flag from files that shouldn't have it: chmod a-x \ - %{buildroot}%{pylibdir}/Demo/comparisons/patterns \ %{buildroot}%{pylibdir}/distutils/tests/Setup.sample \ - %{buildroot}%{pylibdir}/Demo/rpc/test \ - %{buildroot}%{pylibdir}/Tools/README \ - %{buildroot}%{pylibdir}/Demo/scripts/newslist.doc \ - %{buildroot}%{pylibdir}/Demo/md5test/foo + %{buildroot}%{pylibdir}/Tools/README # Get rid of DOS batch files: find %{buildroot} -name \*.bat -exec rm {} \; @@ -1000,6 +991,7 @@ rm -fr %{buildroot} %{_includedir}/python%{LDVERSION_optimized}/%{_pyconfig_h} %{_libdir}/%{py_INSTSONAME_optimized} +%{_libdir}/libpython3.so %if 0%{?with_systemtap} %{tapsetdir}/%{libpython_stp_optimized} %doc systemtap-example.stp pyfuntop.stp @@ -1025,11 +1017,9 @@ rm -fr %{buildroot} %files tools %defattr(-,root,root,755) %{_bindir}/python3-2to3 +%{_bindir}/2to3-%{pybasever} %{_bindir}/idle* %{pylibdir}/Tools -%doc %{pylibdir}/Demo -%exclude %{pylibdir}/Demo/distutils -%exclude %{pylibdir}/Demo/md5test %doc %{pylibdir}/Doc %files tkinter @@ -1057,8 +1047,6 @@ rm -fr %{buildroot} %{dynload_dir}/_ctypes_test.%{SOABI_optimized}.so %{dynload_dir}/_testcapi.%{SOABI_optimized}.so %{pylibdir}/lib2to3/tests -%doc %{pylibdir}/Demo/distutils -%doc %{pylibdir}/Demo/md5test %{pylibdir}/tkinter/test %{pylibdir}/unittest/test @@ -1179,6 +1167,14 @@ rm -fr %{buildroot} %changelog +* Mon Jan 17 2011 David Malcolm - 3.2-0.9.rc1 +- 3.2rc1 +- rework patch 6 (static lib removal) +- remove upstreamed patch 130 (ppc debug build) +- regenerate patch 300 (autotool intermediates) +- updated packaging to reflect upstream rewrite of "Demo" (issue 7962) +- added libpython3.so and 2to3-3.2 + * Wed Jan 5 2011 David Malcolm - 3.2-0.8.b2 - set EXTRA_CFLAGS to our CFLAGS, rather than overriding OPT, fixing a linker error with dynamic annotations (when configured using --with-valgrind) diff --git a/sources b/sources index 812bc20..470bbec 100644 --- a/sources +++ b/sources @@ -1,2 +1 @@ -b371e1f7a0e98e7a0d1792823fd0f58c Python-3.2a1.tar.bz2 -45ab5ff5edfb73ec277b1c763f3d5a42 Python-3.2b2.tar.bz2 +057cb4b2ba64e166cb0a3342bec9125e Python-3.2rc1.tar.bz2 From 3dfb714641e7b09dd86726c2436d198062b92805 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Fri, 4 Feb 2011 17:47:28 +0100 Subject: [PATCH 048/416] add support for the timestamp counter on s390(x) --- python-3.2rc1-s390-tsc.patch | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 python-3.2rc1-s390-tsc.patch diff --git a/python-3.2rc1-s390-tsc.patch b/python-3.2rc1-s390-tsc.patch new file mode 100644 index 0000000..fc4a6b9 --- /dev/null +++ b/python-3.2rc1-s390-tsc.patch @@ -0,0 +1,17 @@ +diff -up Python-3.2rc1/Python/ceval.c.s390-tsc Python-3.2rc1/Python/ceval.c +--- Python-3.2rc1/Python/ceval.c.s390-tsc 2011-02-04 05:11:27.585224435 -0500 ++++ Python-3.2rc1/Python/ceval.c 2011-02-04 05:12:38.065223933 -0500 +@@ -74,6 +74,13 @@ ppc_getcounter(uint64 *v) + "=a" (((int*)&(val))[0]), "=d" (((int*)&(val))[1])); + + ++#elif defined(__s390__) ++ ++/* covers both s390 and s390x */ ++ ++#define READ_TIMESTAMP(val) \ ++ __asm__ __volatile__("stck %0" : "=Q" (val) : : "cc") ++ + #else + + #error "Don't know how to implement timestamp counter for this architecture" From fc9ba51d30bcac67d4f7d36985a2368f6866ebce Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 8 Feb 2011 19:35:54 -0500 Subject: [PATCH 049/416] 3.2rc2 --- .gitignore | 1 + python3.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 84f6983..b48c536 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ Python-3.1.2.tar.bz2 Python-3.2a1.tar.bz2 /Python-3.2b2.tar.bz2 /Python-3.2rc1.tar.bz2 +/Python-3.2rc2.tar.bz2 diff --git a/python3.spec b/python3.spec index f4f23db..faf97b1 100644 --- a/python3.spec +++ b/python3.spec @@ -3,7 +3,7 @@ # pybasever without the dot: %global pyshortver 32 -%global alphatag rc1 +%global alphatag rc2 %global pylibdir %{_libdir}/python%{pybasever} %global dynload_dir %{pylibdir}/lib-dynload @@ -113,7 +113,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever} -Release: 0.9.%{alphatag}%{?dist} +Release: 0.10.%{alphatag}%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}%{alphatag}.tar.bz2 @@ -1167,6 +1167,9 @@ rm -fr %{buildroot} %changelog +* Mon Jan 31 2011 David Malcolm - 3.2-0.10.rc2 +- 3.2rc2 + * Mon Jan 17 2011 David Malcolm - 3.2-0.9.rc1 - 3.2rc1 - rework patch 6 (static lib removal) diff --git a/sources b/sources index 470bbec..6a1dee9 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -057cb4b2ba64e166cb0a3342bec9125e Python-3.2rc1.tar.bz2 +57ba48501a4261f3c227585b07629e27 Python-3.2rc2.tar.bz2 From fef240e443cd0a655b4fe51abc6cfc9cc1d128c0 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 9 Feb 2011 01:42:58 -0600 Subject: [PATCH 050/416] - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild --- python3.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index faf97b1..2922a5c 100644 --- a/python3.spec +++ b/python3.spec @@ -113,7 +113,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever} -Release: 0.10.%{alphatag}%{?dist} +Release: 0.11.%{alphatag}%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}%{alphatag}.tar.bz2 @@ -1167,6 +1167,9 @@ rm -fr %{buildroot} %changelog +* Wed Feb 09 2011 Fedora Release Engineering - 3.2-0.11.rc2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + * Mon Jan 31 2011 David Malcolm - 3.2-0.10.rc2 - 3.2rc2 From 3f75b3e8930d76d07e281739c07cdc362ce320de Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 14 Feb 2011 13:55:48 -0500 Subject: [PATCH 051/416] 3.2rc3 --- autotool-intermediates.patch | 3450 +++++++++++++++++++++++++++++++++- python3.spec | 8 +- 2 files changed, 3436 insertions(+), 22 deletions(-) diff --git a/autotool-intermediates.patch b/autotool-intermediates.patch index fa49d8b..c0fb3e3 100644 --- a/autotool-intermediates.patch +++ b/autotool-intermediates.patch @@ -1,14 +1,100 @@ diff -up ./configure.autotool-intermediates ./configure ---- ./configure.autotool-intermediates 2011-01-17 13:09:50.836697224 -0500 -+++ ./configure 2011-01-17 13:09:56.662690482 -0500 -@@ -1,5 +1,5 @@ +--- ./configure.autotool-intermediates 2011-02-14 12:00:34.929870493 -0500 ++++ ./configure 2011-02-14 12:00:40.794102692 -0500 +@@ -1,14 +1,14 @@ #! /bin/sh --# From configure.in Revision: 87646 . -+# From configure.in Revision: 87698 . +-# From configure.in Revision: 87698 . ++# From configure.in Revision: 88350 . # Guess values for system-dependent variables and create Makefiles. - # Generated by GNU Autoconf 2.65 for python 3.2. +-# Generated by GNU Autoconf 2.68 for python 3.2. ++# Generated by GNU Autoconf 2.65 for python 3.2. # -@@ -611,6 +611,8 @@ TRUE + # Report bugs to . + # + # + # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software +-# Foundation, Inc. ++# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, ++# Inc. + # + # + # This configure script is free software; the Free Software Foundation +@@ -92,7 +92,6 @@ 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 +@@ -218,18 +217,11 @@ 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 +- 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+"$@"} ++ exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + fi + + if test x$as_have_required = xno; then : +@@ -328,7 +320,7 @@ $as_echo X"$as_dir" | + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" +- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" ++ } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + + + } # as_fn_mkdir_p +@@ -368,19 +360,19 @@ else + fi # as_fn_arith + + +-# as_fn_error STATUS ERROR [LINENO LOG_FD] +-# ---------------------------------------- ++# as_fn_error ERROR [LINENO LOG_FD] ++# --------------------------------- + # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are + # provided, also output the error to LOG_FD, referencing LINENO. Then exit the +-# script with STATUS, using 1 if that was 0. ++# script with status $?, using 1 if that was 0. + as_fn_error () + { +- as_status=$1; test $as_status -eq 0 && as_status=1 +- if test "$4"; then +- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack +- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 ++ as_status=$?; test $as_status -eq 0 && as_status=1 ++ if test "$3"; then ++ as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + fi +- $as_echo "$as_me: error: $2" >&2 ++ $as_echo "$as_me: error: $1" >&2 + as_fn_exit $as_status + } # as_fn_error + +@@ -542,7 +534,7 @@ test -n "$DJDIR" || exec 7<&0 &1 + + # Name of the host. +-# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, ++# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, + # so uname gets run too. + ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +@@ -619,6 +611,8 @@ TRUE MACHDEP_OBJS DYNLOADFILE DLINCLDIR @@ -17,7 +103,7 @@ diff -up ./configure.autotool-intermediates ./configure THREADOBJ LDLAST USE_THREAD_MODULE -@@ -749,8 +751,11 @@ with_thread +@@ -757,8 +751,11 @@ with_thread enable_ipv6 with_doc_strings with_tsc @@ -29,7 +115,155 @@ diff -up ./configure.autotool-intermediates ./configure with_fpectl with_libm with_libc -@@ -1421,8 +1426,11 @@ Optional Packages: +@@ -837,9 +834,8 @@ do + fi + + case $ac_option in +- *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; +- *=) ac_optarg= ;; +- *) ac_optarg=yes ;; ++ *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; ++ *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. +@@ -884,7 +880,7 @@ do + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && +- as_fn_error $? "invalid feature name: $ac_useropt" ++ as_fn_error "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in +@@ -910,7 +906,7 @@ do + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && +- as_fn_error $? "invalid feature name: $ac_useropt" ++ as_fn_error "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in +@@ -1114,7 +1110,7 @@ do + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && +- as_fn_error $? "invalid package name: $ac_useropt" ++ as_fn_error "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in +@@ -1130,7 +1126,7 @@ do + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && +- as_fn_error $? "invalid package name: $ac_useropt" ++ as_fn_error "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in +@@ -1160,8 +1156,8 @@ do + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + +- -*) as_fn_error $? "unrecognized option: \`$ac_option' +-Try \`$0 --help' for more information" ++ -*) as_fn_error "unrecognized option: \`$ac_option' ++Try \`$0 --help' for more information." + ;; + + *=*) +@@ -1169,7 +1165,7 @@ Try \`$0 --help' for more information" + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) +- as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; ++ as_fn_error "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; +@@ -1179,7 +1175,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 +@@ -1187,13 +1183,13 @@ done + + if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` +- as_fn_error $? "missing argument to $ac_option" ++ as_fn_error "missing argument to $ac_option" + fi + + if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; +- fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; ++ fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac + fi +@@ -1216,7 +1212,7 @@ do + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac +- as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" ++ as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" + done + + # There might be people who depend on the old broken behavior: `$host' +@@ -1230,8 +1226,8 @@ target=$target_alias + if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe +- $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. +- If a cross compiler is detected then cross compile mode will be used" >&2 ++ $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. ++ If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +@@ -1246,9 +1242,9 @@ test "$silent" = yes && exec 6>/dev/null + ac_pwd=`pwd` && test -n "$ac_pwd" && + ac_ls_di=`ls -di .` && + ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || +- as_fn_error $? "working directory cannot be determined" ++ as_fn_error "working directory cannot be determined" + test "X$ac_ls_di" = "X$ac_pwd_ls_di" || +- as_fn_error $? "pwd does not report name of working directory" ++ as_fn_error "pwd does not report name of working directory" + + + # Find the source files, if location was not specified. +@@ -1287,11 +1283,11 @@ else + fi + if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." +- as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" ++ as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" + fi + ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" + ac_abs_confdir=`( +- cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" ++ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" + pwd)` + # When building in place, set srcdir=. + if test "$ac_abs_confdir" = "$ac_pwd"; then +@@ -1331,7 +1327,7 @@ Configuration: + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit +- -q, --quiet, --silent do not print \`checking ...' messages ++ -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files +@@ -1430,8 +1426,11 @@ Optional Packages: deprecated; use --with(out)-threads --with(out)-doc-strings disable/enable documentation strings --with(out)-tsc enable/disable timestamp counter profile @@ -41,7 +275,1747 @@ diff -up ./configure.autotool-intermediates ./configure --with-fpectl enable SIGFPE catching --with-libm=STRING math library --with-libc=STRING C library -@@ -9138,6 +9146,50 @@ $as_echo "no" >&6; } +@@ -1517,9 +1516,9 @@ test -n "$ac_init_help" && exit $ac_stat + if $ac_init_version; then + cat <<\_ACEOF + python configure 3.2 +-generated by GNU Autoconf 2.68 ++generated by GNU Autoconf 2.65 + +-Copyright (C) 2010 Free Software Foundation, Inc. ++Copyright (C) 2009 Free Software Foundation, Inc. + This configure script is free software; the Free Software Foundation + gives unlimited permission to copy, distribute and modify it. + _ACEOF +@@ -1563,7 +1562,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 + fi +- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno ++ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + + } # ac_fn_c_try_compile +@@ -1589,7 +1588,7 @@ $as_echo "$ac_try_echo"; } >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 +- test $ac_status = 0; } > conftest.i && { ++ test $ac_status = 0; } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : +@@ -1600,7 +1599,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 + fi +- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno ++ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + + } # ac_fn_c_try_cpp +@@ -1613,10 +1612,10 @@ fi + ac_fn_c_check_header_mongrel () + { + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack +- if eval \${$3+:} false; then : ++ if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 + $as_echo_n "checking for $2... " >&6; } +-if eval \${$3+:} false; then : ++if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 + fi + eval ac_res=\$$3 +@@ -1652,7 +1651,7 @@ if ac_fn_c_try_cpp "$LINENO"; then : + else + ac_header_preproc=no + fi +-rm -f conftest.err conftest.i conftest.$ac_ext ++rm -f conftest.err conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 + $as_echo "$ac_header_preproc" >&6; } + +@@ -1675,15 +1674,17 @@ $as_echo "$as_me: WARNING: $2: see the A + $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 + $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +-( $as_echo "## -------------------------------------- ## ++( cat <<\_ASBOX ++## -------------------------------------- ## + ## Report this to http://bugs.python.org/ ## +-## -------------------------------------- ##" ++## -------------------------------------- ## ++_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 + $as_echo_n "checking for $2... " >&6; } +-if eval \${$3+:} false; then : ++if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 + else + eval "$3=\$ac_header_compiler" +@@ -1692,7 +1693,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; ${as_lineno_stack:+:} unset as_lineno ++ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + + } # ac_fn_c_check_header_mongrel + +@@ -1733,7 +1734,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 + ac_retval=$ac_status + fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo +- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno ++ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + + } # ac_fn_c_try_run +@@ -1747,7 +1748,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 \${$3+:} false; then : ++if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -1765,7 +1766,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; ${as_lineno_stack:+:} unset as_lineno ++ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + + } # ac_fn_c_check_header_compile + +@@ -1810,7 +1811,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; ${as_lineno_stack:+:} unset as_lineno ++ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + + } # ac_fn_c_try_link +@@ -1824,7 +1825,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 \${$3+:} false; then : ++if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 + else + eval "$3=no" +@@ -1865,7 +1866,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; ${as_lineno_stack:+:} unset as_lineno ++ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + + } # ac_fn_c_check_type + +@@ -1878,7 +1879,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 \${$3+:} false; then : ++if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 + else + eval "$3=no" +@@ -1908,7 +1909,8 @@ if ac_fn_c_try_compile "$LINENO"; then : + esac + fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +- if eval test \"x\$"$3"\" = x"no"; then : ++ eval as_val=\$$3 ++ if test "x$as_val" = x""no; then : + + else + break +@@ -1918,7 +1920,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; ${as_lineno_stack:+:} unset as_lineno ++ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + + } # ac_fn_c_find_uintX_t + +@@ -1931,7 +1933,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 \${$3+:} false; then : ++if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 + else + eval "$3=no" +@@ -1942,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 + + ; +@@ -1957,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 + +@@ -1982,7 +1984,8 @@ fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +- if eval test \"x\$"$3"\" = x"no"; then : ++ eval as_val=\$$3 ++ if test "x$as_val" = x""no; then : + + else + break +@@ -1992,7 +1995,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; ${as_lineno_stack:+:} unset as_lineno ++ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + + } # ac_fn_c_find_intX_t + +@@ -2169,7 +2172,7 @@ rm -f core *.core core.conftest.* gmon.o + rm -f conftest.val + + fi +- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno ++ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + + } # ac_fn_c_compute_int +@@ -2182,7 +2185,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 \${$3+:} false; then : ++if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -2237,7 +2240,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; ${as_lineno_stack:+:} unset as_lineno ++ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + + } # ac_fn_c_check_func + +@@ -2250,7 +2253,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 \${$4+:} false; then : ++if { as_var=$4; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -2294,22 +2297,19 @@ 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; ${as_lineno_stack:+:} unset as_lineno ++ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + + } # ac_fn_c_check_member + +-# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES +-# --------------------------------------------- +-# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +-# accordingly. ++# ac_fn_c_check_decl LINENO SYMBOL VAR ++# ------------------------------------ ++# Tests whether SYMBOL is declared, setting cache variable VAR accordingly. + ac_fn_c_check_decl () + { + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack +- as_decl_name=`echo $2|sed 's/ *(.*//'` +- 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 \${$3+:} false; then : ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $2 is declared" >&5 ++$as_echo_n "checking whether $2 is declared... " >&6; } ++if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -2318,12 +2318,8 @@ $4 + int + main () + { +-#ifndef $as_decl_name +-#ifdef __cplusplus +- (void) $as_decl_use; +-#else +- (void) $as_decl_name; +-#endif ++#ifndef $2 ++ (void) $2; + #endif + + ; +@@ -2340,7 +2336,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; ${as_lineno_stack:+:} unset as_lineno ++ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + + } # ac_fn_c_check_decl + cat >config.log <<_ACEOF +@@ -2348,7 +2344,7 @@ This file contains any messages produced + running configure, to aid debugging if configure makes a mistake. + + It was created by python $as_me 3.2, which was +-generated by GNU Autoconf 2.68. Invocation command line was ++generated by GNU Autoconf 2.65. Invocation command line was + + $ $0 $@ + +@@ -2458,9 +2454,11 @@ trap 'exit_status=$? + { + echo + +- $as_echo "## ---------------- ## ++ cat <<\_ASBOX ++## ---------------- ## + ## Cache variables. ## +-## ---------------- ##" ++## ---------------- ## ++_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, + ( +@@ -2494,9 +2492,11 @@ $as_echo "$as_me: WARNING: cache variabl + ) + echo + +- $as_echo "## ----------------- ## ++ cat <<\_ASBOX ++## ----------------- ## + ## Output variables. ## +-## ----------------- ##" ++## ----------------- ## ++_ASBOX + echo + for ac_var in $ac_subst_vars + do +@@ -2509,9 +2509,11 @@ $as_echo "$as_me: WARNING: cache variabl + echo + + if test -n "$ac_subst_files"; then +- $as_echo "## ------------------- ## ++ cat <<\_ASBOX ++## ------------------- ## + ## File substitutions. ## +-## ------------------- ##" ++## ------------------- ## ++_ASBOX + echo + for ac_var in $ac_subst_files + do +@@ -2525,9 +2527,11 @@ $as_echo "$as_me: WARNING: cache variabl + fi + + if test -s confdefs.h; then +- $as_echo "## ----------- ## ++ cat <<\_ASBOX ++## ----------- ## + ## confdefs.h. ## +-## ----------- ##" ++## ----------- ## ++_ASBOX + echo + cat confdefs.h + echo +@@ -2582,12 +2586,7 @@ _ACEOF + ac_site_file1=NONE + ac_site_file2=NONE + if test -n "$CONFIG_SITE"; then +- # We do not want a PATH search for config.site. +- case $CONFIG_SITE in #(( +- -*) ac_site_file1=./$CONFIG_SITE;; +- */*) ac_site_file1=$CONFIG_SITE;; +- *) ac_site_file1=./$CONFIG_SITE;; +- esac ++ ac_site_file1=$CONFIG_SITE + elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +@@ -2602,11 +2601,7 @@ do + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 + $as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 +- . "$ac_site_file" \ +- || { { $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; } ++ . "$ac_site_file" + fi + done + +@@ -2682,7 +2677,7 @@ if $ac_cache_corrupted; then + $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 + $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} +- as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 ++ as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 + fi + ## -------------------- ## + ## Main body of script. ## +@@ -2783,7 +2778,7 @@ if test "${enable_universalsdk+set}" = s + UNIVERSALSDK=$enableval + if test ! -d "${UNIVERSALSDK}" + then +- as_fn_error $? "--enable-universalsdk specifies non-existing SDK: ${UNIVERSALSDK}" "$LINENO" 5 ++ as_fn_error "--enable-universalsdk specifies non-existing SDK: ${UNIVERSALSDK}" "$LINENO" 5 + fi + ;; + esac +@@ -3175,7 +3170,7 @@ $as_echo "$without_gcc" >&6; } + # If the user switches compilers, we can't believe the cache + if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC" + then +- as_fn_error $? "cached CC is different -- throw away $cache_file ++ as_fn_error "cached CC is different -- throw away $cache_file + (it is also a good idea to do 'make clean' before compiling)" "$LINENO" 5 + fi + +@@ -3195,7 +3190,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 ${ac_cv_prog_CC+:} false; then : ++if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + if test -n "$CC"; then +@@ -3235,7 +3230,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 ${ac_cv_prog_ac_ct_CC+:} false; then : ++if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + if test -n "$ac_ct_CC"; then +@@ -3288,7 +3283,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 ${ac_cv_prog_CC+:} false; then : ++if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + if test -n "$CC"; then +@@ -3328,7 +3323,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 ${ac_cv_prog_CC+:} false; then : ++if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + if test -n "$CC"; then +@@ -3387,7 +3382,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 ${ac_cv_prog_CC+:} false; then : ++if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + if test -n "$CC"; then +@@ -3431,7 +3426,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 ${ac_cv_prog_ac_ct_CC+:} false; then : ++if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + if test -n "$ac_ct_CC"; then +@@ -3485,8 +3480,8 @@ 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; } ++as_fn_error "no acceptable C compiler found in \$PATH ++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 +@@ -3600,8 +3595,9 @@ 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; } ++{ as_fn_set_status 77 ++as_fn_error "C compiler cannot create executables ++See \`config.log' for more details." "$LINENO" 5; }; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + $as_echo "yes" >&6; } +@@ -3643,8 +3639,8 @@ done + 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; } ++as_fn_error "cannot compute suffix of executables: cannot compile and link ++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 +@@ -3701,9 +3697,9 @@ $as_echo "$ac_try_echo"; } >&5 + 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 run C compiled programs. ++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 +@@ -3714,7 +3710,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 ${ac_cv_objext+:} false; then : ++if test "${ac_cv_objext+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -3754,8 +3750,8 @@ 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; } ++as_fn_error "cannot compute suffix of object files: cannot compile ++See \`config.log' for more details." "$LINENO" 5; } + fi + rm -f conftest.$ac_cv_objext conftest.$ac_ext + fi +@@ -3765,7 +3761,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 ${ac_cv_c_compiler_gnu+:} false; then : ++if test "${ac_cv_c_compiler_gnu+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -3802,7 +3798,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 ${ac_cv_prog_cc_g+:} false; then : ++if test "${ac_cv_prog_cc_g+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + ac_save_c_werror_flag=$ac_c_werror_flag +@@ -3880,7 +3876,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 ${ac_cv_prog_cc_c89+:} false; then : ++if test "${ac_cv_prog_cc_c89+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + ac_cv_prog_cc_c89=no +@@ -4015,7 +4011,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 ${ac_cv_path_CXX+:} false; then : ++if test "${ac_cv_path_CXX+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + case $CXX in +@@ -4056,7 +4052,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 ${ac_cv_path_CXX+:} false; then : ++if test "${ac_cv_path_CXX+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + case $CXX in +@@ -4107,7 +4103,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 ${ac_cv_prog_CXX+:} false; then : ++if test "${ac_cv_prog_CXX+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + if test -n "$CXX"; then +@@ -4178,7 +4174,7 @@ if test -n "$CPP" && test -d "$CPP"; the + CPP= + fi + if test -z "$CPP"; then +- if ${ac_cv_prog_CPP+:} false; then : ++ if test "${ac_cv_prog_CPP+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + # Double quotes because CPP needs to be expanded +@@ -4208,7 +4204,7 @@ else + # Broken: fails on valid input. + continue + fi +-rm -f conftest.err conftest.i conftest.$ac_ext ++rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. +@@ -4224,11 +4220,11 @@ else + ac_preproc_ok=: + break + fi +-rm -f conftest.err conftest.i conftest.$ac_ext ++rm -f conftest.err conftest.$ac_ext + + done + # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +-rm -f conftest.i conftest.err conftest.$ac_ext ++rm -f conftest.err conftest.$ac_ext + if $ac_preproc_ok; then : + break + fi +@@ -4267,7 +4263,7 @@ else + # Broken: fails on valid input. + continue + fi +-rm -f conftest.err conftest.i conftest.$ac_ext ++rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. +@@ -4283,18 +4279,18 @@ else + ac_preproc_ok=: + break + fi +-rm -f conftest.err conftest.i conftest.$ac_ext ++rm -f conftest.err conftest.$ac_ext + + done + # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +-rm -f conftest.i conftest.err conftest.$ac_ext ++rm -f conftest.err conftest.$ac_ext + if $ac_preproc_ok; then : + + 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; } ++as_fn_error "C preprocessor \"$CPP\" fails sanity check ++See \`config.log' for more details." "$LINENO" 5; } + fi + + ac_ext=c +@@ -4306,7 +4302,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 ${ac_cv_path_GREP+:} false; then : ++if test "${ac_cv_path_GREP+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + if test -z "$GREP"; then +@@ -4355,7 +4351,7 @@ esac + done + IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then +- as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 ++ as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi + else + ac_cv_path_GREP=$GREP +@@ -4369,7 +4365,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 ${ac_cv_path_EGREP+:} false; then : ++if test "${ac_cv_path_EGREP+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 +@@ -4421,7 +4417,7 @@ esac + done + IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then +- as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 ++ as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi + else + ac_cv_path_EGREP=$EGREP +@@ -4436,7 +4432,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 ${ac_cv_header_stdc+:} false; then : ++if test "${ac_cv_header_stdc+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -4553,7 +4549,8 @@ do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` + ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default + " +-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : ++eval as_val=\$$as_ac_Header ++ if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF + #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 + _ACEOF +@@ -4565,7 +4562,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" = xyes; then : ++if test "x$ac_cv_header_minix_config_h" = x""yes; then : + MINIX=yes + else + MINIX= +@@ -4587,7 +4584,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 ${ac_cv_safe_to_define___extensions__+:} false; then : ++if test "${ac_cv_safe_to_define___extensions__+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -4780,7 +4777,7 @@ $as_echo "$GNULD" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 + $as_echo_n "checking for inline... " >&6; } +-if ${ac_cv_c_inline+:} false; then : ++if test "${ac_cv_c_inline+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + ac_cv_c_inline=no +@@ -4981,7 +4978,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 ${ac_cv_prog_RANLIB+:} false; then : ++if test "${ac_cv_prog_RANLIB+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + if test -n "$RANLIB"; then +@@ -5021,7 +5018,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 ${ac_cv_prog_ac_ct_RANLIB+:} false; then : ++if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + if test -n "$ac_ct_RANLIB"; then +@@ -5075,7 +5072,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 ${ac_cv_prog_AR+:} false; then : ++if test "${ac_cv_prog_AR+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + if test -n "$AR"; then +@@ -5125,7 +5122,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 ${ac_cv_prog_SVNVERSION+:} false; then : ++if test "${ac_cv_prog_SVNVERSION+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + if test -n "$SVNVERSION"; then +@@ -5176,22 +5173,16 @@ bsdos*|hp*|HP*) + esac + ac_aux_dir= + for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do +- if test -f "$ac_dir/install-sh"; then +- ac_aux_dir=$ac_dir +- ac_install_sh="$ac_aux_dir/install-sh -c" +- break +- elif test -f "$ac_dir/install.sh"; then +- ac_aux_dir=$ac_dir +- ac_install_sh="$ac_aux_dir/install.sh -c" +- break +- elif test -f "$ac_dir/shtool"; then +- ac_aux_dir=$ac_dir +- ac_install_sh="$ac_aux_dir/shtool install -c" +- break +- fi ++ for ac_t in install-sh install.sh shtool; do ++ if test -f "$ac_dir/$ac_t"; then ++ ac_aux_dir=$ac_dir ++ ac_install_sh="$ac_aux_dir/$ac_t -c" ++ break 2 ++ fi ++ done + done + if test -z "$ac_aux_dir"; then +- as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 ++ as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 + fi + + # These three variables are undocumented and unsupported, +@@ -5220,7 +5211,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 ${ac_cv_path_install+:} false; then : ++if test "${ac_cv_path_install+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +@@ -5406,7 +5397,7 @@ $as_echo_n "checking whether $CC accepts + ac_save_cc="$CC" + CC="$CC -fno-strict-aliasing" + save_CFLAGS="$CFLAGS" +- if ${ac_cv_no_strict_aliasing+:} false; then : ++ if test "${ac_cv_no_strict_aliasing+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -5529,7 +5520,7 @@ $as_echo "$CC" >&6; } + ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc" + + else +- as_fn_error $? "proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way" "$LINENO" 5 ++ as_fn_error "proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way" "$LINENO" 5 + + fi + +@@ -5662,7 +5653,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 ${ac_cv_pthread_is_default+:} false; then : ++if test "${ac_cv_pthread_is_default+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + if test "$cross_compiling" = yes; then : +@@ -5715,7 +5706,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 ${ac_cv_kpthread+:} false; then : ++if test "${ac_cv_kpthread+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + ac_save_cc="$CC" +@@ -5764,7 +5755,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 ${ac_cv_kthread+:} false; then : ++if test "${ac_cv_kthread+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + ac_save_cc="$CC" +@@ -5813,7 +5804,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 ${ac_cv_thread+:} false; then : ++if test "${ac_cv_thread+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + ac_save_cc="$CC" +@@ -5898,7 +5889,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 ${ac_cv_header_stdc+:} false; then : ++if test "${ac_cv_header_stdc+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -6023,7 +6014,8 @@ bluetooth/bluetooth.h linux/tipc.h spawn + do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` + ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : ++eval as_val=\$$as_ac_Header ++ if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF + #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 + _ACEOF +@@ -6037,7 +6029,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 \${$as_ac_Header+:} false; then : ++if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -6064,7 +6056,8 @@ fi + eval ac_res=\$$as_ac_Header + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 + $as_echo "$ac_res" >&6; } +-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : ++eval as_val=\$$as_ac_Header ++ if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF + #define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 + _ACEOF +@@ -6077,7 +6070,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 ${ac_cv_search_opendir+:} false; then : ++if test "${ac_cv_search_opendir+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + ac_func_search_save_LIBS=$LIBS +@@ -6111,11 +6104,11 @@ for ac_lib in '' dir; do + fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext +- if ${ac_cv_search_opendir+:} false; then : ++ if test "${ac_cv_search_opendir+set}" = set; then : + break + fi + done +-if ${ac_cv_search_opendir+:} false; then : ++if test "${ac_cv_search_opendir+set}" = set; then : + + else + ac_cv_search_opendir=no +@@ -6134,7 +6127,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 ${ac_cv_search_opendir+:} false; then : ++if test "${ac_cv_search_opendir+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + ac_func_search_save_LIBS=$LIBS +@@ -6168,11 +6161,11 @@ for ac_lib in '' x; do + fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext +- if ${ac_cv_search_opendir+:} false; then : ++ if test "${ac_cv_search_opendir+set}" = set; then : + break + fi + done +-if ${ac_cv_search_opendir+:} false; then : ++if test "${ac_cv_search_opendir+set}" = set; then : + + else + ac_cv_search_opendir=no +@@ -6192,7 +6185,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 ${ac_cv_header_sys_types_h_makedev+:} false; then : ++if test "${ac_cv_header_sys_types_h_makedev+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -6220,7 +6213,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" = xyes; then : ++if test "x$ac_cv_header_sys_mkdev_h" = x""yes; then : + + $as_echo "#define MAJOR_IN_MKDEV 1" >>confdefs.h + +@@ -6230,7 +6223,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" = xyes; then : ++if test "x$ac_cv_header_sys_sysmacros_h" = x""yes; then : + + $as_echo "#define MAJOR_IN_SYSMACROS 1" >>confdefs.h + +@@ -6250,7 +6243,7 @@ do : + #endif + + " +-if test "x$ac_cv_header_term_h" = xyes; then : ++if test "x$ac_cv_header_term_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF + #define HAVE_TERM_H 1 + _ACEOF +@@ -6272,7 +6265,7 @@ do : + #endif + + " +-if test "x$ac_cv_header_linux_netlink_h" = xyes; then : ++if test "x$ac_cv_header_linux_netlink_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF + #define HAVE_LINUX_NETLINK_H 1 + _ACEOF +@@ -6431,7 +6424,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" = xyes; then : ++if test "x$ac_cv_type_mode_t" = x""yes; then : + + else + +@@ -6442,7 +6435,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" = xyes; then : ++if test "x$ac_cv_type_off_t" = x""yes; then : + + else + +@@ -6453,7 +6446,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" = xyes; then : ++if test "x$ac_cv_type_pid_t" = x""yes; then : + + else + +@@ -6469,7 +6462,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" = xyes; then : ++if test "x$ac_cv_type_size_t" = x""yes; then : + + else + +@@ -6481,7 +6474,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 ${ac_cv_type_uid_t+:} false; then : ++if test "${ac_cv_type_uid_t+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -6560,7 +6553,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" = xyes; then : ++if test "x$ac_cv_type_ssize_t" = x""yes; then : + + $as_echo "#define HAVE_SSIZE_T 1" >>confdefs.h + +@@ -6575,7 +6568,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 ${ac_cv_sizeof_int+:} false; then : ++if test "${ac_cv_sizeof_int+set}" = set; 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 : +@@ -6584,8 +6577,9 @@ else + if test "$ac_cv_type_int" = yes; then + { { $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; } ++{ as_fn_set_status 77 ++as_fn_error "cannot compute sizeof (int) ++See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_int=0 + fi +@@ -6608,7 +6602,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 ${ac_cv_sizeof_long+:} false; then : ++if test "${ac_cv_sizeof_long+set}" = set; 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 : +@@ -6617,8 +6611,9 @@ else + if test "$ac_cv_type_long" = yes; then + { { $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; } ++{ as_fn_set_status 77 ++as_fn_error "cannot compute sizeof (long) ++See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_long=0 + fi +@@ -6641,7 +6636,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 ${ac_cv_sizeof_void_p+:} false; then : ++if test "${ac_cv_sizeof_void_p+set}" = set; 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 : +@@ -6650,8 +6645,9 @@ else + if test "$ac_cv_type_void_p" = yes; then + { { $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; } ++{ as_fn_set_status 77 ++as_fn_error "cannot compute sizeof (void *) ++See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_void_p=0 + fi +@@ -6674,7 +6670,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 ${ac_cv_sizeof_short+:} false; then : ++if test "${ac_cv_sizeof_short+set}" = set; 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 : +@@ -6683,8 +6679,9 @@ else + if test "$ac_cv_type_short" = yes; then + { { $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; } ++{ as_fn_set_status 77 ++as_fn_error "cannot compute sizeof (short) ++See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_short=0 + fi +@@ -6707,7 +6704,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 ${ac_cv_sizeof_float+:} false; then : ++if test "${ac_cv_sizeof_float+set}" = set; 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 : +@@ -6716,8 +6713,9 @@ else + if test "$ac_cv_type_float" = yes; then + { { $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; } ++{ as_fn_set_status 77 ++as_fn_error "cannot compute sizeof (float) ++See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_float=0 + fi +@@ -6740,7 +6738,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 ${ac_cv_sizeof_double+:} false; then : ++if test "${ac_cv_sizeof_double+set}" = set; 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 : +@@ -6749,8 +6747,9 @@ else + if test "$ac_cv_type_double" = yes; then + { { $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; } ++{ as_fn_set_status 77 ++as_fn_error "cannot compute sizeof (double) ++See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_double=0 + fi +@@ -6773,7 +6772,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 ${ac_cv_sizeof_fpos_t+:} false; then : ++if test "${ac_cv_sizeof_fpos_t+set}" = set; 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 : +@@ -6782,8 +6781,9 @@ else + if test "$ac_cv_type_fpos_t" = yes; then + { { $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; } ++{ as_fn_set_status 77 ++as_fn_error "cannot compute sizeof (fpos_t) ++See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_fpos_t=0 + fi +@@ -6806,7 +6806,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 ${ac_cv_sizeof_size_t+:} false; then : ++if test "${ac_cv_sizeof_size_t+set}" = set; 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 : +@@ -6815,8 +6815,9 @@ else + if test "$ac_cv_type_size_t" = yes; then + { { $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; } ++{ as_fn_set_status 77 ++as_fn_error "cannot compute sizeof (size_t) ++See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_size_t=0 + fi +@@ -6839,7 +6840,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 ${ac_cv_sizeof_pid_t+:} false; then : ++if test "${ac_cv_sizeof_pid_t+set}" = set; 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 : +@@ -6848,8 +6849,9 @@ else + if test "$ac_cv_type_pid_t" = yes; then + { { $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; } ++{ as_fn_set_status 77 ++as_fn_error "cannot compute sizeof (pid_t) ++See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_pid_t=0 + fi +@@ -6899,7 +6901,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 ${ac_cv_sizeof_long_long+:} false; then : ++if test "${ac_cv_sizeof_long_long+set}" = set; 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 : +@@ -6908,8 +6910,9 @@ else + if test "$ac_cv_type_long_long" = yes; then + { { $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; } ++{ as_fn_set_status 77 ++as_fn_error "cannot compute sizeof (long long) ++See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_long_long=0 + fi +@@ -6960,7 +6963,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 ${ac_cv_sizeof_long_double+:} false; then : ++if test "${ac_cv_sizeof_long_double+set}" = set; 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 : +@@ -6969,8 +6972,9 @@ else + if test "$ac_cv_type_long_double" = yes; then + { { $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; } ++{ as_fn_set_status 77 ++as_fn_error "cannot compute sizeof (long double) ++See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_long_double=0 + fi +@@ -7022,7 +7026,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 ${ac_cv_sizeof__Bool+:} false; then : ++if test "${ac_cv_sizeof__Bool+set}" = set; 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 : +@@ -7031,8 +7035,9 @@ else + if test "$ac_cv_type__Bool" = yes; then + { { $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; } ++{ as_fn_set_status 77 ++as_fn_error "cannot compute sizeof (_Bool) ++See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof__Bool=0 + fi +@@ -7058,7 +7063,7 @@ ac_fn_c_check_type "$LINENO" "uintptr_t" + #include + #endif + " +-if test "x$ac_cv_type_uintptr_t" = xyes; then : ++if test "x$ac_cv_type_uintptr_t" = x""yes; then : + + cat >>confdefs.h <<_ACEOF + #define HAVE_UINTPTR_T 1 +@@ -7070,7 +7075,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 ${ac_cv_sizeof_uintptr_t+:} false; then : ++if test "${ac_cv_sizeof_uintptr_t+set}" = set; 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 : +@@ -7079,8 +7084,9 @@ else + if test "$ac_cv_type_uintptr_t" = yes; then + { { $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; } ++{ as_fn_set_status 77 ++as_fn_error "cannot compute sizeof (uintptr_t) ++See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_uintptr_t=0 + fi +@@ -7106,7 +7112,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 ${ac_cv_sizeof_off_t+:} false; then : ++if test "${ac_cv_sizeof_off_t+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" " +@@ -7120,8 +7126,9 @@ else + if test "$ac_cv_type_off_t" = yes; then + { { $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; } ++{ as_fn_set_status 77 ++as_fn_error "cannot compute sizeof (off_t) ++See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_off_t=0 + fi +@@ -7165,7 +7172,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 ${ac_cv_sizeof_time_t+:} false; then : ++if test "${ac_cv_sizeof_time_t+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (time_t))" "ac_cv_sizeof_time_t" " +@@ -7182,8 +7189,9 @@ else + if test "$ac_cv_type_time_t" = yes; then + { { $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; } ++{ as_fn_set_status 77 ++as_fn_error "cannot compute sizeof (time_t) ++See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_time_t=0 + fi +@@ -7240,7 +7248,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 ${ac_cv_sizeof_pthread_t+:} false; then : ++if test "${ac_cv_sizeof_pthread_t+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pthread_t))" "ac_cv_sizeof_pthread_t" " +@@ -7254,8 +7262,9 @@ else + if test "$ac_cv_type_pthread_t" = yes; then + { { $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; } ++{ as_fn_set_status 77 ++as_fn_error "cannot compute sizeof (pthread_t) ++See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_pthread_t=0 + fi +@@ -7342,7 +7351,7 @@ fi + MACOSX_DEFAULT_ARCH="ppc" + ;; + *) +- as_fn_error $? "Unexpected output of 'arch' on OSX" "$LINENO" 5 ++ as_fn_error "Unexpected output of 'arch' on OSX" "$LINENO" 5 + ;; + esac + else +@@ -7354,7 +7363,7 @@ fi + MACOSX_DEFAULT_ARCH="ppc64" + ;; + *) +- as_fn_error $? "Unexpected output of 'arch' on OSX" "$LINENO" 5 ++ as_fn_error "Unexpected output of 'arch' on OSX" "$LINENO" 5 + ;; + esac + +@@ -7380,7 +7389,7 @@ $as_echo "#define WITH_NEXT_FRAMEWORK 1" + $as_echo "yes" >&6; } + if test $enable_shared = "yes" + then +- as_fn_error $? "Specifying both --enable-shared and --enable-framework is not supported, use only --enable-framework instead" "$LINENO" 5 ++ as_fn_error "Specifying both --enable-shared and --enable-framework is not supported, use only --enable-framework instead" "$LINENO" 5 + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +@@ -7687,7 +7696,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 ${ac_cv_lib_dl_dlopen+:} false; then : ++if test "${ac_cv_lib_dl_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS +@@ -7721,7 +7730,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" = xyes; then : ++if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : + cat >>confdefs.h <<_ACEOF + #define HAVE_LIBDL 1 + _ACEOF +@@ -7732,7 +7741,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 ${ac_cv_lib_dld_shl_load+:} false; then : ++if test "${ac_cv_lib_dld_shl_load+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS +@@ -7766,7 +7775,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" = xyes; then : ++if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : + cat >>confdefs.h <<_ACEOF + #define HAVE_LIBDLD 1 + _ACEOF +@@ -7780,7 +7789,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 ${ac_cv_search_sem_init+:} false; then : ++if test "${ac_cv_search_sem_init+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + ac_func_search_save_LIBS=$LIBS +@@ -7814,11 +7823,11 @@ for ac_lib in '' pthread rt posix4; do + fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext +- if ${ac_cv_search_sem_init+:} false; then : ++ if test "${ac_cv_search_sem_init+set}" = set; then : + break + fi + done +-if ${ac_cv_search_sem_init+:} false; then : ++if test "${ac_cv_search_sem_init+set}" = set; then : + + else + ac_cv_search_sem_init=no +@@ -7841,7 +7850,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 ${ac_cv_lib_intl_textdomain+:} false; then : ++if test "${ac_cv_lib_intl_textdomain+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS +@@ -7875,7 +7884,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" = xyes; then : ++if test "x$ac_cv_lib_intl_textdomain" = x""yes; then : + + $as_echo "#define WITH_LIBINTL 1" >>confdefs.h + +@@ -7922,7 +7931,7 @@ esac + # Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl. + { $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 ${ac_cv_lib_nsl_t_open+:} false; then : ++if test "${ac_cv_lib_nsl_t_open+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS +@@ -7956,13 +7965,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" = xyes; then : ++if test "x$ac_cv_lib_nsl_t_open" = x""yes; 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 ${ac_cv_lib_socket_socket+:} false; then : ++if test "${ac_cv_lib_socket_socket+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS +@@ -7996,7 +8005,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" = xyes; then : ++if test "x$ac_cv_lib_socket_socket" = x""yes; then : + LIBS="-lsocket $LIBS" + fi + # SVR4 sockets +@@ -8022,7 +8031,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 ${ac_cv_path_PKG_CONFIG+:} false; then : ++if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + case $PKG_CONFIG in +@@ -8065,7 +8074,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 ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : ++if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + case $ac_pt_PKG_CONFIG in +@@ -8176,12 +8185,12 @@ if test "${with_dbmliborder+set}" = set; + withval=$with_dbmliborder; + if test x$with_dbmliborder = xyes + then +-as_fn_error $? "proper usage is --with-dbmliborder=db1:db2:..." "$LINENO" 5 ++as_fn_error "proper usage is --with-dbmliborder=db1:db2:..." "$LINENO" 5 + else + for db in `echo $with_dbmliborder | sed 's/:/ /g'`; do + if test x$db != xndbm && test x$db != xgdbm && test x$db != xbdb + then +- as_fn_error $? "proper usage is --with-dbmliborder=db1:db2:..." "$LINENO" 5 ++ as_fn_error "proper usage is --with-dbmliborder=db1:db2:..." "$LINENO" 5 + fi + done + fi +@@ -8347,7 +8356,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" = xyes; then : ++if test "x$ac_cv_header_cthreads_h" = x""yes; then : + $as_echo "#define WITH_THREAD 1" >>confdefs.h + + $as_echo "#define C_THREADS 1" >>confdefs.h +@@ -8360,7 +8369,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" = xyes; then : ++if test "x$ac_cv_header_mach_cthreads_h" = x""yes; then : + $as_echo "#define WITH_THREAD 1" >>confdefs.h + + $as_echo "#define C_THREADS 1" >>confdefs.h +@@ -8404,7 +8413,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" = xyes; then : ++if test "x$ac_cv_func_pthread_detach" = x""yes; then : + $as_echo "#define WITH_THREAD 1" >>confdefs.h + + posix_threads=yes +@@ -8413,7 +8422,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 ${ac_cv_lib_pthreads_pthread_create+:} false; then : ++if test "${ac_cv_lib_pthreads_pthread_create+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS +@@ -8447,7 +8456,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" = xyes; then : ++if test "x$ac_cv_lib_pthreads_pthread_create" = x""yes; then : + $as_echo "#define WITH_THREAD 1" >>confdefs.h + + posix_threads=yes +@@ -8457,7 +8466,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 ${ac_cv_lib_c_r_pthread_create+:} false; then : ++if test "${ac_cv_lib_c_r_pthread_create+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS +@@ -8491,7 +8500,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" = xyes; then : ++if test "x$ac_cv_lib_c_r_pthread_create" = x""yes; then : + $as_echo "#define WITH_THREAD 1" >>confdefs.h + + posix_threads=yes +@@ -8501,7 +8510,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 ${ac_cv_lib_pthread___pthread_create_system+:} false; then : ++if test "${ac_cv_lib_pthread___pthread_create_system+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS +@@ -8535,7 +8544,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" = xyes; then : ++if test "x$ac_cv_lib_pthread___pthread_create_system" = x""yes; then : + $as_echo "#define WITH_THREAD 1" >>confdefs.h + + posix_threads=yes +@@ -8545,7 +8554,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 ${ac_cv_lib_cma_pthread_create+:} false; then : ++if test "${ac_cv_lib_cma_pthread_create+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS +@@ -8579,7 +8588,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" = xyes; then : ++if test "x$ac_cv_lib_cma_pthread_create" = x""yes; then : + $as_echo "#define WITH_THREAD 1" >>confdefs.h + + posix_threads=yes +@@ -8611,7 +8620,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 ${ac_cv_lib_mpc_usconfig+:} false; then : ++if test "${ac_cv_lib_mpc_usconfig+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS +@@ -8645,7 +8654,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" = xyes; then : ++if test "x$ac_cv_lib_mpc_usconfig" = x""yes; then : + $as_echo "#define WITH_THREAD 1" >>confdefs.h + + LIBS="$LIBS -lmpc" +@@ -8657,7 +8666,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 ${ac_cv_lib_thread_thr_create+:} false; then : ++if test "${ac_cv_lib_thread_thr_create+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS +@@ -8691,7 +8700,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" = xyes; then : ++if test "x$ac_cv_lib_thread_thr_create" = x""yes; then : + $as_echo "#define WITH_THREAD 1" >>confdefs.h + + LIBS="$LIBS -lthread" +@@ -8740,7 +8749,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 ${ac_cv_pthread_system_supported+:} false; then : ++ if test "${ac_cv_pthread_system_supported+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + if test "$cross_compiling" = yes; then : +@@ -8783,7 +8792,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" = xyes; then : ++if test "x$ac_cv_func_pthread_sigmask" = x""yes; then : + cat >>confdefs.h <<_ACEOF + #define HAVE_PTHREAD_SIGMASK 1 + _ACEOF +@@ -9136,6 +9145,50 @@ $as_echo "no" >&6; } fi @@ -92,7 +2066,22 @@ 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; } -@@ -9190,6 +9242,46 @@ fi +@@ -9175,12 +9228,12 @@ 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" = xyes; then : ++if test "x$ac_cv_header_valgrind_valgrind_h" = x""yes; then : + + $as_echo "#define WITH_VALGRIND 1" >>confdefs.h + + else +- as_fn_error $? "Valgrind support requested but headers not available" "$LINENO" 5 ++ as_fn_error "Valgrind support requested but headers not available" "$LINENO" 5 + + fi + +@@ -9188,6 +9241,46 @@ fi OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT" fi @@ -139,20 +2128,1441 @@ diff -up ./configure.autotool-intermediates ./configure # -I${DLINCLDIR} is added to the compile rule for importdl.o DLINCLDIR=. -@@ -14304,8 +14396,8 @@ esac +@@ -9197,7 +9290,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" = xyes; then : ++if test "x$ac_cv_func_dlopen" = x""yes; then : + cat >>confdefs.h <<_ACEOF + #define HAVE_DLOPEN 1 + _ACEOF +@@ -9274,7 +9367,8 @@ for ac_func in alarm accept4 setitimer g + do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` + ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +-if eval test \"x\$"$as_ac_var"\" = x"yes"; then : ++eval as_val=\$$as_ac_var ++ if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF + #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 + _ACEOF +@@ -9524,7 +9618,7 @@ rm -f core conftest.err conftest.$ac_obj - cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - # Files that config.status was made for. --config_files="`echo $ac_config_files`" --config_headers="`echo $ac_config_headers`" -+config_files="$ac_config_files" -+config_headers="$ac_config_headers" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flock declaration" >&5 + $as_echo_n "checking for flock declaration... " >&6; } +-if ${ac_cv_flock_decl+:} false; then : ++if test "${ac_cv_flock_decl+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -9554,7 +9648,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" = xyes; then : ++if test "x$ac_cv_func_flock" = x""yes; then : + cat >>confdefs.h <<_ACEOF + #define HAVE_FLOCK 1 + _ACEOF +@@ -9562,7 +9656,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 ${ac_cv_lib_bsd_flock+:} false; then : ++if test "${ac_cv_lib_bsd_flock+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS +@@ -9596,7 +9690,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" = xyes; then : ++if test "x$ac_cv_lib_bsd_flock" = x""yes; then : + $as_echo "#define HAVE_FLOCK 1" >>confdefs.h + +@@ -9645,7 +9739,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 ${ac_cv_prog_TRUE+:} false; then : ++if test "${ac_cv_prog_TRUE+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + if test -n "$TRUE"; then +@@ -9685,7 +9779,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 ${ac_cv_lib_c_inet_aton+:} false; then : ++if test "${ac_cv_lib_c_inet_aton+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS +@@ -9719,12 +9813,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" = xyes; then : ++if test "x$ac_cv_lib_c_inet_aton" = x""yes; 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 ${ac_cv_lib_resolv_inet_aton+:} false; then : ++if test "${ac_cv_lib_resolv_inet_aton+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS +@@ -9758,7 +9852,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" = xyes; then : ++if test "x$ac_cv_lib_resolv_inet_aton" = x""yes; then : + cat >>confdefs.h <<_ACEOF + #define HAVE_LIBRESOLV 1 + _ACEOF +@@ -9775,7 +9869,7 @@ fi + # exit Python + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for chflags" >&5 + $as_echo_n "checking for chflags... " >&6; } +-if ${ac_cv_have_chflags+:} false; then : ++if test "${ac_cv_have_chflags+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + if test "$cross_compiling" = yes; then : +@@ -9809,7 +9903,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" = xyes; then : ++if test "x$ac_cv_func_chflags" = x""yes; then : + ac_cv_have_chflags="yes" + else + ac_cv_have_chflags="no" +@@ -9824,7 +9918,7 @@ fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lchflags" >&5 + $as_echo_n "checking for lchflags... " >&6; } +-if ${ac_cv_have_lchflags+:} false; then : ++if test "${ac_cv_have_lchflags+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + if test "$cross_compiling" = yes; then : +@@ -9858,7 +9952,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" = xyes; then : ++if test "x$ac_cv_func_lchflags" = x""yes; then : + ac_cv_have_lchflags="yes" + else + ac_cv_have_lchflags="no" +@@ -9882,7 +9976,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 ${ac_cv_lib_z_inflateCopy+:} false; then : ++if test "${ac_cv_lib_z_inflateCopy+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS +@@ -9916,7 +10010,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" = xyes; then : ++if test "x$ac_cv_lib_z_inflateCopy" = x""yes; then : + + $as_echo "#define HAVE_ZLIB_COPY 1" >>confdefs.h + +@@ -10059,7 +10153,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" = xyes; then : ++if test "x$ac_cv_func_openpty" = x""yes; then : + cat >>confdefs.h <<_ACEOF + #define HAVE_OPENPTY 1 + _ACEOF +@@ -10067,7 +10161,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 ${ac_cv_lib_util_openpty+:} false; then : ++if test "${ac_cv_lib_util_openpty+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS +@@ -10101,13 +10195,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" = xyes; then : ++if test "x$ac_cv_lib_util_openpty" = x""yes; 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 ${ac_cv_lib_bsd_openpty+:} false; then : ++if test "${ac_cv_lib_bsd_openpty+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS +@@ -10141,7 +10235,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" = xyes; then : ++if test "x$ac_cv_lib_bsd_openpty" = x""yes; then : + $as_echo "#define HAVE_OPENPTY 1" >>confdefs.h + LIBS="$LIBS -lbsd" + fi +@@ -10156,7 +10250,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" = xyes; then : ++if test "x$ac_cv_func_forkpty" = x""yes; then : + cat >>confdefs.h <<_ACEOF + #define HAVE_FORKPTY 1 + _ACEOF +@@ -10164,7 +10258,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 ${ac_cv_lib_util_forkpty+:} false; then : ++if test "${ac_cv_lib_util_forkpty+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS +@@ -10198,13 +10292,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" = xyes; then : ++if test "x$ac_cv_lib_util_forkpty" = x""yes; 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 ${ac_cv_lib_bsd_forkpty+:} false; then : ++if test "${ac_cv_lib_bsd_forkpty+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS +@@ -10238,7 +10332,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" = xyes; then : ++if test "x$ac_cv_lib_bsd_forkpty" = x""yes; then : + $as_echo "#define HAVE_FORKPTY 1" >>confdefs.h + LIBS="$LIBS -lbsd" + fi +@@ -10255,7 +10349,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" = xyes; then : ++if test "x$ac_cv_func_memmove" = x""yes; then : + cat >>confdefs.h <<_ACEOF + #define HAVE_MEMMOVE 1 + _ACEOF +@@ -10269,7 +10363,8 @@ for ac_func in fseek64 fseeko fstatvfs f + do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` + ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +-if eval test \"x\$"$as_ac_var"\" = x"yes"; then : ++eval as_val=\$$as_ac_var ++ if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF + #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 + _ACEOF +@@ -10278,50 +10373,31 @@ fi + done + + +-ac_fn_c_check_func "$LINENO" "dup2" "ac_cv_func_dup2" +-if test "x$ac_cv_func_dup2" = xyes; then : +- $as_echo "#define HAVE_DUP2 1" >>confdefs.h +- +-else +- case " $LIBOBJS " in +- *" dup2.$ac_objext "* ) ;; +- *) LIBOBJS="$LIBOBJS dup2.$ac_objext" +- ;; +-esac +- +-fi +- +-ac_fn_c_check_func "$LINENO" "getcwd" "ac_cv_func_getcwd" +-if test "x$ac_cv_func_getcwd" = xyes; then : +- $as_echo "#define HAVE_GETCWD 1" >>confdefs.h +- +-else +- case " $LIBOBJS " in +- *" getcwd.$ac_objext "* ) ;; +- *) LIBOBJS="$LIBOBJS getcwd.$ac_objext" +- ;; +-esac +- +-fi +- +-ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup" +-if test "x$ac_cv_func_strdup" = xyes; then : +- $as_echo "#define HAVE_STRDUP 1" >>confdefs.h ++for ac_func in dup2 getcwd strdup ++do : ++ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ++ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" ++eval as_val=\$$as_ac_var ++ if test "x$as_val" = x""yes; then : ++ cat >>confdefs.h <<_ACEOF ++#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 ++_ACEOF + + else + case " $LIBOBJS " in +- *" strdup.$ac_objext "* ) ;; +- *) LIBOBJS="$LIBOBJS strdup.$ac_objext" ++ *" $ac_func.$ac_objext "* ) ;; ++ *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" + ;; + esac + + fi ++done + + + for ac_func in getpgrp + do : + ac_fn_c_check_func "$LINENO" "getpgrp" "ac_cv_func_getpgrp" +-if test "x$ac_cv_func_getpgrp" = xyes; then : ++if test "x$ac_cv_func_getpgrp" = x""yes; then : + cat >>confdefs.h <<_ACEOF + #define HAVE_GETPGRP 1 + _ACEOF +@@ -10349,7 +10425,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" = xyes; then : ++if test "x$ac_cv_func_setpgrp" = x""yes; then : + cat >>confdefs.h <<_ACEOF + #define HAVE_SETPGRP 1 + _ACEOF +@@ -10377,7 +10453,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" = xyes; then : ++if test "x$ac_cv_func_gettimeofday" = x""yes; then : + cat >>confdefs.h <<_ACEOF + #define HAVE_GETTIMEOFDAY 1 + _ACEOF +@@ -10479,7 +10555,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 ${ac_cv_buggy_getaddrinfo+:} false; then : ++ if test "${ac_cv_buggy_getaddrinfo+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + if test "$cross_compiling" = yes; then : +@@ -10608,7 +10684,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" = xyes; then : ++if test "x$ac_cv_func_getnameinfo" = x""yes; then : + cat >>confdefs.h <<_ACEOF + #define HAVE_GETNAMEINFO 1 + _ACEOF +@@ -10620,7 +10696,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 ${ac_cv_header_time+:} false; then : ++if test "${ac_cv_header_time+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -10655,7 +10731,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 ${ac_cv_struct_tm+:} false; then : ++if test "${ac_cv_struct_tm+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -10692,7 +10768,7 @@ ac_fn_c_check_member "$LINENO" "struct t + #include <$ac_cv_struct_tm> + + " +-if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then : ++if test "x$ac_cv_member_struct_tm_tm_zone" = x""yes; then : + + cat >>confdefs.h <<_ACEOF + #define HAVE_STRUCT_TM_TM_ZONE 1 +@@ -10708,7 +10784,7 @@ $as_echo "#define HAVE_TM_ZONE 1" >>conf + else + ac_fn_c_check_decl "$LINENO" "tzname" "ac_cv_have_decl_tzname" "#include + " +-if test "x$ac_cv_have_decl_tzname" = xyes; then : ++if test "x$ac_cv_have_decl_tzname" = x""yes; then : + ac_have_decl=1 + else + ac_have_decl=0 +@@ -10720,7 +10796,7 @@ _ACEOF + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5 + $as_echo_n "checking for tzname... " >&6; } +-if ${ac_cv_var_tzname+:} false; then : ++if test "${ac_cv_var_tzname+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -10756,7 +10832,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" = xyes; then : ++if test "x$ac_cv_member_struct_stat_st_rdev" = x""yes; then : + + cat >>confdefs.h <<_ACEOF + #define HAVE_STRUCT_STAT_ST_RDEV 1 +@@ -10766,7 +10842,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" = xyes; then : ++if test "x$ac_cv_member_struct_stat_st_blksize" = x""yes; then : + + cat >>confdefs.h <<_ACEOF + #define HAVE_STRUCT_STAT_ST_BLKSIZE 1 +@@ -10776,7 +10852,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" = xyes; then : ++if test "x$ac_cv_member_struct_stat_st_flags" = x""yes; then : + + cat >>confdefs.h <<_ACEOF + #define HAVE_STRUCT_STAT_ST_FLAGS 1 +@@ -10786,7 +10862,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" = xyes; then : ++if test "x$ac_cv_member_struct_stat_st_gen" = x""yes; then : + + cat >>confdefs.h <<_ACEOF + #define HAVE_STRUCT_STAT_ST_GEN 1 +@@ -10796,7 +10872,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" = xyes; then : ++if test "x$ac_cv_member_struct_stat_st_birthtime" = x""yes; then : + + cat >>confdefs.h <<_ACEOF + #define HAVE_STRUCT_STAT_ST_BIRTHTIME 1 +@@ -10806,7 +10882,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" = xyes; then : ++if test "x$ac_cv_member_struct_stat_st_blocks" = x""yes; then : + + cat >>confdefs.h <<_ACEOF + #define HAVE_STRUCT_STAT_ST_BLOCKS 1 +@@ -10828,7 +10904,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 ${ac_cv_header_time_altzone+:} false; then : ++if test "${ac_cv_header_time_altzone+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + +@@ -10892,7 +10968,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 ${ac_cv_struct_addrinfo+:} false; then : ++if test "${ac_cv_struct_addrinfo+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -10924,7 +11000,7 @@ fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_storage" >&5 + $as_echo_n "checking for sockaddr_storage... " >&6; } +-if ${ac_cv_struct_sockaddr_storage+:} false; then : ++if test "${ac_cv_struct_sockaddr_storage+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -10960,7 +11036,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 ${ac_cv_c_char_unsigned+:} false; then : ++if test "${ac_cv_c_char_unsigned+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -10992,7 +11068,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 ${ac_cv_c_const+:} false; then : ++if test "${ac_cv_c_const+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -11280,7 +11356,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" = xyes; then : ++if test "x$ac_cv_func_gethostbyname_r" = x""yes; then : + + $as_echo "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h + +@@ -11411,7 +11487,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" = xyes; then : ++if test "x$ac_cv_func_gethostbyname" = x""yes; then : + cat >>confdefs.h <<_ACEOF + #define HAVE_GETHOSTBYNAME 1 + _ACEOF +@@ -11433,12 +11509,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" = xyes; then : ++if test "x$ac_cv_func___fpu_control" = x""yes; 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 ${ac_cv_lib_ieee___fpu_control+:} false; then : ++if test "${ac_cv_lib_ieee___fpu_control+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS +@@ -11472,7 +11548,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" = xyes; then : ++if test "x$ac_cv_lib_ieee___fpu_control" = x""yes; then : + cat >>confdefs.h <<_ACEOF + #define HAVE_LIBIEEE 1 + _ACEOF +@@ -11528,7 +11604,7 @@ elif test "$withval" != yes + then LIBM=$withval + { $as_echo "$as_me:${as_lineno-$LINENO}: result: set LIBM=\"$withval\"" >&5 + $as_echo "set LIBM=\"$withval\"" >&6; } +-else as_fn_error $? "proper usage is --with-libm=STRING" "$LINENO" 5 ++else as_fn_error "proper usage is --with-libm=STRING" "$LINENO" 5 + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: default LIBM=\"$LIBM\"" >&5 +@@ -11552,7 +11628,7 @@ elif test "$withval" != yes + then LIBC=$withval + { $as_echo "$as_me:${as_lineno-$LINENO}: result: set LIBC=\"$withval\"" >&5 + $as_echo "set LIBC=\"$withval\"" >&6; } +-else as_fn_error $? "proper usage is --with-libc=STRING" "$LINENO" 5 ++else as_fn_error "proper usage is --with-libc=STRING" "$LINENO" 5 + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: default LIBC=\"$LIBC\"" >&5 +@@ -11566,7 +11642,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 ${ac_cv_little_endian_double+:} false; then : ++if test "${ac_cv_little_endian_double+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + +@@ -11608,7 +11684,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 ${ac_cv_big_endian_double+:} false; then : ++if test "${ac_cv_big_endian_double+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + +@@ -11654,7 +11730,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 ${ac_cv_mixed_endian_double+:} false; then : ++if test "${ac_cv_mixed_endian_double+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + +@@ -11802,7 +11878,8 @@ for ac_func in acosh asinh atanh copysig + do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` + ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +-if eval test \"x\$"$as_ac_var"\" = x"yes"; then : ++eval as_val=\$$as_ac_var ++ if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF + #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 + _ACEOF +@@ -11814,7 +11891,8 @@ for ac_func in hypot lgamma log1p round + do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` + ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +-if eval test \"x\$"$as_ac_var"\" = x"yes"; then : ++eval as_val=\$$as_ac_var ++ if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF + #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 + _ACEOF +@@ -11824,7 +11902,7 @@ done + + ac_fn_c_check_decl "$LINENO" "isinf" "ac_cv_have_decl_isinf" "#include + " +-if test "x$ac_cv_have_decl_isinf" = xyes; then : ++if test "x$ac_cv_have_decl_isinf" = x""yes; then : + ac_have_decl=1 + else + ac_have_decl=0 +@@ -11835,7 +11913,7 @@ cat >>confdefs.h <<_ACEOF + _ACEOF + ac_fn_c_check_decl "$LINENO" "isnan" "ac_cv_have_decl_isnan" "#include + " +-if test "x$ac_cv_have_decl_isnan" = xyes; then : ++if test "x$ac_cv_have_decl_isnan" = x""yes; then : + ac_have_decl=1 + else + ac_have_decl=0 +@@ -11846,7 +11924,7 @@ cat >>confdefs.h <<_ACEOF + _ACEOF + ac_fn_c_check_decl "$LINENO" "isfinite" "ac_cv_have_decl_isfinite" "#include + " +-if test "x$ac_cv_have_decl_isfinite" = xyes; then : ++if test "x$ac_cv_have_decl_isfinite" = x""yes; then : + ac_have_decl=1 + else + ac_have_decl=0 +@@ -11861,7 +11939,7 @@ _ACEOF + # -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 ${ac_cv_tanh_preserves_zero_sign+:} false; then : ++if test "${ac_cv_tanh_preserves_zero_sign+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + +@@ -11909,7 +11987,7 @@ then + # -0. See issue #9920. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether log1p drops the sign of negative zero" >&5 + $as_echo_n "checking whether log1p drops the sign of negative zero... " >&6; } +- if ${ac_cv_log1p_drops_zero_sign+:} false; then : ++ if test "${ac_cv_log1p_drops_zero_sign+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + +@@ -11961,7 +12039,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 ${ac_cv_posix_semaphores_enabled+:} false; then : ++if test "${ac_cv_posix_semaphores_enabled+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + if test "$cross_compiling" = yes; then : +@@ -12012,7 +12090,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 ${ac_cv_broken_sem_getvalue+:} false; then : ++if test "${ac_cv_broken_sem_getvalue+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + if test "$cross_compiling" = yes; then : +@@ -12077,7 +12155,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; } +@@ -12095,7 +12173,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" = xyes; then : ++if test "x$ac_cv_header_wchar_h" = x""yes; then : + + + $as_echo "#define HAVE_WCHAR_H 1" >>confdefs.h +@@ -12118,7 +12196,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 ${ac_cv_sizeof_wchar_t+:} false; then : ++if test "${ac_cv_sizeof_wchar_t+set}" = set; 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 +@@ -12128,8 +12206,9 @@ else + if test "$ac_cv_type_wchar_t" = yes; then + { { $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; } ++{ as_fn_set_status 77 ++as_fn_error "cannot compute sizeof (wchar_t) ++See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_wchar_t=0 + fi +@@ -12184,7 +12263,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 ${ac_cv_wchar_t_signed+:} false; then : ++ if test "${ac_cv_wchar_t_signed+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + +@@ -12280,7 +12359,7 @@ $as_echo "$PY_UNICODE_TYPE" >&6; } + # 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 ${ac_cv_c_bigendian+:} false; then : ++if test "${ac_cv_c_bigendian+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + ac_cv_c_bigendian=unknown +@@ -12498,7 +12577,7 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUI + + ;; #( + *) +- as_fn_error $? "unknown endianness ++ as_fn_error "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + +@@ -12571,7 +12650,7 @@ $as_echo "$SO" >&6; } + # 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 ${ac_cv_rshift_extends_sign+:} false; then : ++if test "${ac_cv_rshift_extends_sign+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + +@@ -12610,7 +12689,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 ${ac_cv_have_getc_unlocked+:} false; then : ++if test "${ac_cv_have_getc_unlocked+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + +@@ -12708,7 +12787,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 ${ac_cv_lib_readline_rl_callback_handler_install+:} false; then : ++if test "${ac_cv_lib_readline_rl_callback_handler_install+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS +@@ -12742,7 +12821,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" = xyes; then : ++if test "x$ac_cv_lib_readline_rl_callback_handler_install" = x""yes; then : + + $as_echo "#define HAVE_RL_CALLBACK 1" >>confdefs.h + +@@ -12760,7 +12839,7 @@ else + have_readline=no + + fi +-rm -f conftest.err conftest.i conftest.$ac_ext ++rm -f conftest.err conftest.$ac_ext + if test $have_readline = yes + then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -12794,7 +12873,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 ${ac_cv_lib_readline_rl_pre_input_hook+:} false; then : ++if test "${ac_cv_lib_readline_rl_pre_input_hook+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS +@@ -12828,7 +12907,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" = xyes; then : ++if test "x$ac_cv_lib_readline_rl_pre_input_hook" = x""yes; then : + + $as_echo "#define HAVE_RL_PRE_INPUT_HOOK 1" >>confdefs.h + +@@ -12838,7 +12917,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 ${ac_cv_lib_readline_rl_completion_display_matches_hook+:} false; then : ++if test "${ac_cv_lib_readline_rl_completion_display_matches_hook+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS +@@ -12872,7 +12951,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" = xyes; then : ++if test "x$ac_cv_lib_readline_rl_completion_display_matches_hook" = x""yes; then : + + $as_echo "#define HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK 1" >>confdefs.h + +@@ -12882,7 +12961,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 ${ac_cv_lib_readline_rl_completion_matches+:} false; then : ++if test "${ac_cv_lib_readline_rl_completion_matches+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS +@@ -12916,7 +12995,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" = xyes; then : ++if test "x$ac_cv_lib_readline_rl_completion_matches" = x""yes; then : + + $as_echo "#define HAVE_RL_COMPLETION_MATCHES 1" >>confdefs.h + +@@ -12934,7 +13013,7 @@ else + have_readline=no + + fi +-rm -f conftest.err conftest.i conftest.$ac_ext ++rm -f conftest.err conftest.$ac_ext + if test $have_readline = yes + then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -12957,7 +13036,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 ${ac_cv_broken_nice+:} false; then : ++if test "${ac_cv_broken_nice+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + +@@ -12998,7 +13077,7 @@ fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken poll()" >&5 + $as_echo_n "checking for broken poll()... " >&6; } +-if ${ac_cv_broken_poll+:} false; then : ++if test "${ac_cv_broken_poll+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + if test "$cross_compiling" = yes; then : +@@ -13053,7 +13132,7 @@ ac_fn_c_check_member "$LINENO" "struct t + #include <$ac_cv_struct_tm> + + " +-if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then : ++if test "x$ac_cv_member_struct_tm_tm_zone" = x""yes; then : + + cat >>confdefs.h <<_ACEOF + #define HAVE_STRUCT_TM_TM_ZONE 1 +@@ -13069,7 +13148,7 @@ $as_echo "#define HAVE_TM_ZONE 1" >>conf + else + ac_fn_c_check_decl "$LINENO" "tzname" "ac_cv_have_decl_tzname" "#include + " +-if test "x$ac_cv_have_decl_tzname" = xyes; then : ++if test "x$ac_cv_have_decl_tzname" = x""yes; then : + ac_have_decl=1 + else + ac_have_decl=0 +@@ -13081,7 +13160,7 @@ _ACEOF + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5 + $as_echo_n "checking for tzname... " >&6; } +-if ${ac_cv_var_tzname+:} false; then : ++if test "${ac_cv_var_tzname+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -13120,7 +13199,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 ${ac_cv_working_tzset+:} false; then : ++if test "${ac_cv_working_tzset+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + +@@ -13217,7 +13296,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 ${ac_cv_stat_tv_nsec+:} false; then : ++if test "${ac_cv_stat_tv_nsec+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -13254,7 +13333,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 ${ac_cv_stat_tv_nsec2+:} false; then : ++if test "${ac_cv_stat_tv_nsec2+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -13291,7 +13370,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 ${ac_cv_mvwdelch_is_expression+:} false; then : ++if test "${ac_cv_mvwdelch_is_expression+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -13328,7 +13407,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 ${ac_cv_window_has_flags+:} false; then : ++if test "${ac_cv_window_has_flags+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -13476,7 +13555,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 ${ac_cv_have_long_long_format+:} false; then : ++ if test "${ac_cv_have_long_long_format+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + if test "$cross_compiling" = yes; then : +@@ -13546,7 +13625,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 ${ac_cv_have_size_t_format+:} false; then : ++if test "${ac_cv_have_size_t_format+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + if test "$cross_compiling" = yes; then : +@@ -13619,7 +13698,7 @@ ac_fn_c_check_type "$LINENO" "socklen_t" + #endif + + " +-if test "x$ac_cv_type_socklen_t" = xyes; then : ++if test "x$ac_cv_type_socklen_t" = x""yes; then : + + else + +@@ -13630,7 +13709,7 @@ fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken mbstowcs" >&5 + $as_echo_n "checking for broken mbstowcs... " >&6; } +-if ${ac_cv_broken_mbstowcs+:} false; then : ++if test "${ac_cv_broken_mbstowcs+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + if test "$cross_compiling" = yes; then : +@@ -13670,7 +13749,7 @@ fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports computed gotos" >&5 + $as_echo_n "checking whether $CC supports computed gotos... " >&6; } +-if ${ac_cv_computed_gotos+:} false; then : ++if test "${ac_cv_computed_gotos+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + if test "$cross_compiling" = yes; then : +@@ -13750,11 +13829,11 @@ esac + + + case $ac_sys_system in +- OSF*) as_fn_error $? "OSF* systems are deprecated unless somebody volunteers. Check http://bugs.python.org/issue8606" "$LINENO" 5 ;; ++ OSF*) as_fn_error "OSF* systems are deprecated unless somebody volunteers. Check http://bugs.python.org/issue8606" "$LINENO" 5 ;; + esac + + ac_fn_c_check_func "$LINENO" "pipe2" "ac_cv_func_pipe2" +-if test "x$ac_cv_func_pipe2" = xyes; then : ++if test "x$ac_cv_func_pipe2" = x""yes; then : + + $as_echo "#define HAVE_PIPE2 1" >>confdefs.h + +@@ -13849,21 +13928,10 @@ $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 +- if test "x$cache_file" != "x/dev/null"; then ++ test "x$cache_file" != "x/dev/null" && + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 + $as_echo "$as_me: updating cache $cache_file" >&6;} +- 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 ++ cat confcache >$cache_file + 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;} +@@ -13879,7 +13947,6 @@ DEFS=-DHAVE_CONFIG_H + + ac_libobjs= + ac_ltlibobjs= +-U= + for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' +@@ -13896,7 +13963,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" +@@ -13997,7 +14064,6 @@ 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 +@@ -14043,19 +14109,19 @@ export LANGUAGE + (unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +-# as_fn_error STATUS ERROR [LINENO LOG_FD] +-# ---------------------------------------- ++# as_fn_error ERROR [LINENO LOG_FD] ++# --------------------------------- + # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are + # provided, also output the error to LOG_FD, referencing LINENO. Then exit the +-# script with STATUS, using 1 if that was 0. ++# script with status $?, using 1 if that was 0. + as_fn_error () + { +- as_status=$1; test $as_status -eq 0 && as_status=1 +- if test "$4"; then +- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack +- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 ++ as_status=$?; test $as_status -eq 0 && as_status=1 ++ if test "$3"; then ++ as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + fi +- $as_echo "$as_me: error: $2" >&2 ++ $as_echo "$as_me: error: $1" >&2 + as_fn_exit $as_status + } # as_fn_error + +@@ -14251,7 +14317,7 @@ $as_echo X"$as_dir" | + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" +- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" ++ } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + + + } # as_fn_mkdir_p +@@ -14305,7 +14371,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri + # values after options handling. + ac_log=" + This file was extended by python $as_me 3.2, which was +-generated by GNU Autoconf 2.68. Invocation command line was ++generated by GNU Autoconf 2.65. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS +@@ -14367,10 +14433,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_writ + ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" + ac_cs_version="\\ + python config.status 3.2 +-configured by $0, generated by GNU Autoconf 2.68, ++configured by $0, generated by GNU Autoconf 2.65, + with options \\"\$ac_cs_config\\" + +-Copyright (C) 2010 Free Software Foundation, Inc. ++Copyright (C) 2009 Free Software Foundation, Inc. + This config.status script is free software; the Free Software Foundation + gives unlimited permission to copy, distribute and modify it." + +@@ -14386,16 +14452,11 @@ ac_need_defaults=: + while test $# != 0 + do + case $1 in +- --*=?*) ++ --*=*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; +- --*=) +- ac_option=`expr "X$1" : 'X\([^=]*\)='` +- ac_optarg= +- ac_shift=: +- ;; + *) + ac_option=$1 + ac_optarg=$2 +@@ -14417,7 +14478,6 @@ do + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; +- '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; +@@ -14430,7 +14490,7 @@ do + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header +- as_fn_error $? "ambiguous option: \`$1' ++ as_fn_error "ambiguous option: \`$1' + Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; +@@ -14439,7 +14499,7 @@ Try \`$0 --help' for more information."; + ac_cs_silent=: ;; + + # This is an error. +- -*) as_fn_error $? "unrecognized option: \`$1' ++ -*) as_fn_error "unrecognized option: \`$1' + Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" +@@ -14498,7 +14558,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 + +@@ -14520,10 +14580,9 @@ fi + # after its creation but before its name has been assigned to `$tmp'. + $debug || + { +- tmp= ac_tmp= ++ tmp= + trap 'exit_status=$? +- : "${ac_tmp:=$tmp}" +- { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ++ { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status + ' 0 + trap 'as_fn_exit 1' 1 2 13 15 + } +@@ -14531,13 +14590,12 @@ $debug || + + { + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && +- test -d "$tmp" ++ test -n "$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 ++} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 + + # Set up the scripts for CONFIG_FILES section. + # No need to generate them if there are no CONFIG_FILES. +@@ -14554,12 +14612,12 @@ if test "x$ac_cr" = x; then + fi + ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` + if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then +- ac_cs_awk_cr='\\r' ++ ac_cs_awk_cr='\r' + else + ac_cs_awk_cr=$ac_cr + fi + +-echo 'BEGIN {' >"$ac_tmp/subs1.awk" && ++echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF + +@@ -14568,18 +14626,18 @@ _ACEOF + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" + } >conf$$subs.sh || +- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +-ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ++ as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 ++ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` + ac_delim='%!_!# ' + for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || +- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ++ as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then +- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ++ as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +@@ -14587,7 +14645,7 @@ done + rm -f conf$$subs.sh + + cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +-cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && ++cat >>"\$tmp/subs1.awk" <<\\_ACAWK && + _ACEOF + sed -n ' + h +@@ -14635,7 +14693,7 @@ t delim + rm -f conf$$subs.awk + cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + _ACAWK +-cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && ++cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +@@ -14667,29 +14725,21 @@ if sed "s/$ac_cr//" < /dev/null > /dev/n + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" + else + cat +-fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ +- || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 ++fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ ++ || as_fn_error "could not setup config files machinery" "$LINENO" 5 + _ACEOF + +-# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +-# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and ++# VPATH may cause trouble with some makes, so we remove $(srcdir), ++# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and + # trailing colons and then remove the whole line if VPATH becomes empty + # (actually we leave an empty line to preserve line numbers). + if test "x$srcdir" = x.; then +- ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +-h +-s/// +-s/^/:/ +-s/[ ]*$/:/ +-s/:\$(srcdir):/:/g +-s/:\${srcdir}:/:/g +-s/:@srcdir@:/:/g +-s/^:*// ++ ac_vpsub='/^[ ]*VPATH[ ]*=/{ ++s/:*\$(srcdir):*/:/ ++s/:*\${srcdir}:*/:/ ++s/:*@srcdir@:*/:/ ++s/^\([^=]*=[ ]*\):*/\1/ + s/:*$// +-x +-s/\(=[ ]*\).*/\1/ +-G +-s/\n// + s/^[^=]*=[ ]*$// + }' + fi +@@ -14701,7 +14751,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 >"$ac_tmp/defines.awk" <<\_ACAWK || ++cat >"$tmp/defines.awk" <<\_ACAWK || + BEGIN { + _ACEOF + +@@ -14713,11 +14763,11 @@ _ACEOF + # handling of long lines. + ac_delim='%!_!# ' + for ac_last_try in false false :; do +- ac_tt=`sed -n "/$ac_delim/p" confdefs.h` +- if test -z "$ac_tt"; then ++ ac_t=`sed -n "/$ac_delim/p" confdefs.h` ++ if test -z "$ac_t"; then + break + elif $ac_last_try; then +- as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 ++ as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +@@ -14802,7 +14852,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_writ + _ACAWK + _ACEOF + cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +- as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 ++ as_fn_error "could not setup config headers machinery" "$LINENO" 5 + fi # test -n "$CONFIG_HEADERS" + + +@@ -14815,7 +14865,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 +@@ -14834,7 +14884,7 @@ do + for ac_f + do + case $ac_f in +- -) ac_f="$ac_tmp/stdin";; ++ -) ac_f="$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 `:'. +@@ -14843,7 +14893,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 "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'" +@@ -14869,8 +14919,8 @@ $as_echo "$as_me: creating $ac_file" >&6 + esac + + case $ac_tag in +- *:-:* | *:-) cat >"$ac_tmp/stdin" \ +- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; ++ *:-:* | *:-) cat >"$tmp/stdin" \ ++ || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac +@@ -15000,24 +15050,23 @@ 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 "$ac_tmp/subs.awk" \ +- >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ++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 + + test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && +- { 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"; } && ++ { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && ++ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$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 ++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;} ++which seems to be undefined. Please make sure it is defined." >&2;} + +- rm -f "$ac_tmp/stdin" ++ rm -f "$tmp/stdin" + case $ac_file in +- -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; +- *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; ++ -) cat "$tmp/out" && rm -f "$tmp/out";; ++ *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ +- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ++ || as_fn_error "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # +@@ -15026,21 +15075,21 @@ which seems to be undefined. Please mak + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ +- && 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" "$ac_tmp/config.h" >/dev/null 2>&1; then ++ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" ++ } >"$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 + { $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 "$ac_tmp/config.h" "$ac_file" \ +- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ++ mv "$tmp/config.h" "$ac_file" \ ++ || as_fn_error "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ +- && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ +- || as_fn_error $? "could not create -" "$LINENO" 5 ++ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ ++ || as_fn_error "could not create -" "$LINENO" 5 + fi + ;; + +@@ -15060,7 +15109,7 @@ _ACEOF + ac_clean_files=$ac_clean_files_save + + test $ac_write_fail = 0 || +- as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 ++ as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + + # configure is writing to config.log, and then calls config.status. +@@ -15081,7 +15130,7 @@ if test "$no_create" != yes; then + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. +- $ac_cs_success || as_fn_exit 1 ++ $ac_cs_success || as_fn_exit $? + fi + if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 diff -up ./pyconfig.h.in.autotool-intermediates ./pyconfig.h.in ---- ./pyconfig.h.in.autotool-intermediates 2011-01-17 13:09:50.827696887 -0500 -+++ ./pyconfig.h.in 2011-01-17 13:09:56.963611199 -0500 +--- ./pyconfig.h.in.autotool-intermediates 2011-02-14 12:00:34.924103677 -0500 ++++ ./pyconfig.h.in 2011-02-14 12:00:41.116907489 -0500 @@ -12,15 +12,15 @@ support for AIX C++ shared extension modules. */ #undef AIX_GENUINE_CPLUSPLUS diff --git a/python3.spec b/python3.spec index 2922a5c..0d79ab1 100644 --- a/python3.spec +++ b/python3.spec @@ -3,7 +3,7 @@ # pybasever without the dot: %global pyshortver 32 -%global alphatag rc2 +%global alphatag rc3 %global pylibdir %{_libdir}/python%{pybasever} %global dynload_dir %{pylibdir}/lib-dynload @@ -113,7 +113,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever} -Release: 0.11.%{alphatag}%{?dist} +Release: 0.12.%{alphatag}%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}%{alphatag}.tar.bz2 @@ -1167,6 +1167,10 @@ rm -fr %{buildroot} %changelog +* Mon Feb 14 2011 David Malcolm - 3.2-0.12.rc3 +- 3.2rc3 +- regenerate autotool patch + * Wed Feb 09 2011 Fedora Release Engineering - 3.2-0.11.rc2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild From bb2fef9eec4b7509f5fa3557c380a3f7442022ef Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 14 Feb 2011 13:57:03 -0500 Subject: [PATCH 052/416] Upload 3.2rc3 to lookaside --- .gitignore | 1 + sources | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b48c536..0cadc11 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ Python-3.2a1.tar.bz2 /Python-3.2b2.tar.bz2 /Python-3.2rc1.tar.bz2 /Python-3.2rc2.tar.bz2 +/Python-3.2rc3.tar.bz2 diff --git a/sources b/sources index 6a1dee9..3bc9e24 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -57ba48501a4261f3c227585b07629e27 Python-3.2rc2.tar.bz2 +25379af4bb6b0001e175d9d9b2ba4f63 Python-3.2rc3.tar.bz2 From 9640a7e460c7242ae17327b4c39e892173c0c368 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 14 Feb 2011 19:13:27 -0500 Subject: [PATCH 053/416] Add a /usr/bin/python3-debug symlink within the debug subpackage --- python3.spec | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 0d79ab1..4428f43 100644 --- a/python3.spec +++ b/python3.spec @@ -113,7 +113,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever} -Release: 0.12.%{alphatag}%{?dist} +Release: 0.13.%{alphatag}%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}%{alphatag}.tar.bz2 @@ -737,6 +737,13 @@ for Module in %{buildroot}/%{dynload_dir}/*.so ; do esac done +# Create "/usr/bin/python3-debug", a symlink to the python3 debug binary, to +# avoid the user having to know the precise version and ABI flags. (see +# e.g. rhbz#676748): +ln -s \ + %{_bindir}/python%{LDVERSION_debug} \ + %{buildroot}%{_bindir}/python3-debug + # # Systemtap hooks: # @@ -1063,6 +1070,7 @@ rm -fr %{buildroot} # Analog of the core subpackage's files: %{_bindir}/python%{LDVERSION_debug} +%{_bindir}/python3-debug # Analog of the -libs subpackage's files: # ...with debug builds of the built-in "extension" modules: @@ -1167,6 +1175,9 @@ rm -fr %{buildroot} %changelog +* Mon Feb 14 2011 David Malcolm - 3.2-0.13.rc3 +- add a /usr/bin/python3-debug symlink within the debug subpackage + * Mon Feb 14 2011 David Malcolm - 3.2-0.12.rc3 - 3.2rc3 - regenerate autotool patch From e516bd5cb9cf4f77aa518ecd3a07469bdc2ef983 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 21 Feb 2011 11:28:42 -0500 Subject: [PATCH 054/416] 3.2 --- .gitignore | 1 + autotool-intermediates.patch | 436 ++++++++++++++++++----------------- python3.spec | 15 +- sources | 2 +- 4 files changed, 234 insertions(+), 220 deletions(-) diff --git a/.gitignore b/.gitignore index 0cadc11..8883189 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ Python-3.2a1.tar.bz2 /Python-3.2rc1.tar.bz2 /Python-3.2rc2.tar.bz2 /Python-3.2rc3.tar.bz2 +/Python-3.2.tar.bz2 diff --git a/autotool-intermediates.patch b/autotool-intermediates.patch index c0fb3e3..f1c15e0 100644 --- a/autotool-intermediates.patch +++ b/autotool-intermediates.patch @@ -1,10 +1,10 @@ diff -up ./configure.autotool-intermediates ./configure ---- ./configure.autotool-intermediates 2011-02-14 12:00:34.929870493 -0500 -+++ ./configure 2011-02-14 12:00:40.794102692 -0500 +--- ./configure.autotool-intermediates 2011-02-21 10:38:12.253957171 -0500 ++++ ./configure 2011-02-21 10:38:17.476956303 -0500 @@ -1,14 +1,14 @@ #! /bin/sh --# From configure.in Revision: 87698 . -+# From configure.in Revision: 88350 . +-# From configure.in Revision: 88430 . ++# From configure.in Revision: 88440 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for python 3.2. +# Generated by GNU Autoconf 2.65 for python 3.2. @@ -1292,7 +1292,7 @@ diff -up ./configure.autotool-intermediates ./configure cat >>confdefs.h <<_ACEOF #define HAVE_LINUX_NETLINK_H 1 _ACEOF -@@ -6431,7 +6424,7 @@ EOF +@@ -6438,7 +6431,7 @@ EOF # Type availability checks ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" @@ -1301,7 +1301,7 @@ diff -up ./configure.autotool-intermediates ./configure else -@@ -6442,7 +6435,7 @@ _ACEOF +@@ -6449,7 +6442,7 @@ _ACEOF fi ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" @@ -1310,7 +1310,7 @@ diff -up ./configure.autotool-intermediates ./configure else -@@ -6453,7 +6446,7 @@ _ACEOF +@@ -6460,7 +6453,7 @@ _ACEOF fi ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" @@ -1319,7 +1319,7 @@ diff -up ./configure.autotool-intermediates ./configure else -@@ -6469,7 +6462,7 @@ cat >>confdefs.h <<_ACEOF +@@ -6476,7 +6469,7 @@ cat >>confdefs.h <<_ACEOF _ACEOF ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" @@ -1328,7 +1328,7 @@ diff -up ./configure.autotool-intermediates ./configure else -@@ -6481,7 +6474,7 @@ fi +@@ -6488,7 +6481,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; } @@ -1337,7 +1337,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -6560,7 +6553,7 @@ _ACEOF +@@ -6567,7 +6560,7 @@ _ACEOF esac ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" @@ -1346,7 +1346,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo "#define HAVE_SSIZE_T 1" >>confdefs.h -@@ -6575,7 +6568,7 @@ fi +@@ -6582,7 +6575,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; } @@ -1355,7 +1355,7 @@ diff -up ./configure.autotool-intermediates ./configure $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 : -@@ -6584,8 +6577,9 @@ else +@@ -6591,8 +6584,9 @@ else if test "$ac_cv_type_int" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} @@ -1367,7 +1367,7 @@ diff -up ./configure.autotool-intermediates ./configure else ac_cv_sizeof_int=0 fi -@@ -6608,7 +6602,7 @@ _ACEOF +@@ -6615,7 +6609,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; } @@ -1376,7 +1376,7 @@ diff -up ./configure.autotool-intermediates ./configure $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 : -@@ -6617,8 +6611,9 @@ else +@@ -6624,8 +6618,9 @@ else if test "$ac_cv_type_long" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} @@ -1388,7 +1388,7 @@ diff -up ./configure.autotool-intermediates ./configure else ac_cv_sizeof_long=0 fi -@@ -6641,7 +6636,7 @@ _ACEOF +@@ -6648,7 +6643,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; } @@ -1397,7 +1397,7 @@ diff -up ./configure.autotool-intermediates ./configure $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 : -@@ -6650,8 +6645,9 @@ else +@@ -6657,8 +6652,9 @@ else if test "$ac_cv_type_void_p" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} @@ -1409,7 +1409,7 @@ diff -up ./configure.autotool-intermediates ./configure else ac_cv_sizeof_void_p=0 fi -@@ -6674,7 +6670,7 @@ _ACEOF +@@ -6681,7 +6677,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; } @@ -1418,7 +1418,7 @@ diff -up ./configure.autotool-intermediates ./configure $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 : -@@ -6683,8 +6679,9 @@ else +@@ -6690,8 +6686,9 @@ else if test "$ac_cv_type_short" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} @@ -1430,7 +1430,7 @@ diff -up ./configure.autotool-intermediates ./configure else ac_cv_sizeof_short=0 fi -@@ -6707,7 +6704,7 @@ _ACEOF +@@ -6714,7 +6711,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; } @@ -1439,7 +1439,7 @@ diff -up ./configure.autotool-intermediates ./configure $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 : -@@ -6716,8 +6713,9 @@ else +@@ -6723,8 +6720,9 @@ else if test "$ac_cv_type_float" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} @@ -1451,7 +1451,7 @@ diff -up ./configure.autotool-intermediates ./configure else ac_cv_sizeof_float=0 fi -@@ -6740,7 +6738,7 @@ _ACEOF +@@ -6747,7 +6745,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; } @@ -1460,7 +1460,7 @@ diff -up ./configure.autotool-intermediates ./configure $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 : -@@ -6749,8 +6747,9 @@ else +@@ -6756,8 +6754,9 @@ else if test "$ac_cv_type_double" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} @@ -1472,7 +1472,7 @@ diff -up ./configure.autotool-intermediates ./configure else ac_cv_sizeof_double=0 fi -@@ -6773,7 +6772,7 @@ _ACEOF +@@ -6780,7 +6779,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; } @@ -1481,7 +1481,7 @@ diff -up ./configure.autotool-intermediates ./configure $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 : -@@ -6782,8 +6781,9 @@ else +@@ -6789,8 +6788,9 @@ else if test "$ac_cv_type_fpos_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} @@ -1493,7 +1493,7 @@ diff -up ./configure.autotool-intermediates ./configure else ac_cv_sizeof_fpos_t=0 fi -@@ -6806,7 +6806,7 @@ _ACEOF +@@ -6813,7 +6813,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; } @@ -1502,7 +1502,7 @@ diff -up ./configure.autotool-intermediates ./configure $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 : -@@ -6815,8 +6815,9 @@ else +@@ -6822,8 +6822,9 @@ else if test "$ac_cv_type_size_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} @@ -1514,7 +1514,7 @@ diff -up ./configure.autotool-intermediates ./configure else ac_cv_sizeof_size_t=0 fi -@@ -6839,7 +6840,7 @@ _ACEOF +@@ -6846,7 +6847,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; } @@ -1523,7 +1523,7 @@ diff -up ./configure.autotool-intermediates ./configure $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 : -@@ -6848,8 +6849,9 @@ else +@@ -6855,8 +6856,9 @@ else if test "$ac_cv_type_pid_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} @@ -1535,7 +1535,7 @@ diff -up ./configure.autotool-intermediates ./configure else ac_cv_sizeof_pid_t=0 fi -@@ -6899,7 +6901,7 @@ if test "$have_long_long" = yes ; then +@@ -6906,7 +6908,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; } @@ -1544,7 +1544,7 @@ diff -up ./configure.autotool-intermediates ./configure $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 : -@@ -6908,8 +6910,9 @@ else +@@ -6915,8 +6917,9 @@ else if test "$ac_cv_type_long_long" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} @@ -1556,7 +1556,7 @@ diff -up ./configure.autotool-intermediates ./configure else ac_cv_sizeof_long_long=0 fi -@@ -6960,7 +6963,7 @@ if test "$have_long_double" = yes ; then +@@ -6967,7 +6970,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; } @@ -1565,7 +1565,7 @@ diff -up ./configure.autotool-intermediates ./configure $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 : -@@ -6969,8 +6972,9 @@ else +@@ -6976,8 +6979,9 @@ else if test "$ac_cv_type_long_double" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} @@ -1577,7 +1577,7 @@ diff -up ./configure.autotool-intermediates ./configure else ac_cv_sizeof_long_double=0 fi -@@ -7022,7 +7026,7 @@ if test "$have_c99_bool" = yes ; then +@@ -7029,7 +7033,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; } @@ -1586,7 +1586,7 @@ diff -up ./configure.autotool-intermediates ./configure $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 : -@@ -7031,8 +7035,9 @@ else +@@ -7038,8 +7042,9 @@ else if test "$ac_cv_type__Bool" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} @@ -1598,7 +1598,7 @@ diff -up ./configure.autotool-intermediates ./configure else ac_cv_sizeof__Bool=0 fi -@@ -7058,7 +7063,7 @@ ac_fn_c_check_type "$LINENO" "uintptr_t" +@@ -7065,7 +7070,7 @@ ac_fn_c_check_type "$LINENO" "uintptr_t" #include #endif " @@ -1607,7 +1607,7 @@ diff -up ./configure.autotool-intermediates ./configure cat >>confdefs.h <<_ACEOF #define HAVE_UINTPTR_T 1 -@@ -7070,7 +7075,7 @@ _ACEOF +@@ -7077,7 +7082,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; } @@ -1616,7 +1616,7 @@ diff -up ./configure.autotool-intermediates ./configure $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 : -@@ -7079,8 +7084,9 @@ else +@@ -7086,8 +7091,9 @@ else if test "$ac_cv_type_uintptr_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} @@ -1628,7 +1628,7 @@ diff -up ./configure.autotool-intermediates ./configure else ac_cv_sizeof_uintptr_t=0 fi -@@ -7106,7 +7112,7 @@ fi +@@ -7113,7 +7119,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; } @@ -1637,7 +1637,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" " -@@ -7120,8 +7126,9 @@ else +@@ -7127,8 +7133,9 @@ else if test "$ac_cv_type_off_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} @@ -1649,7 +1649,7 @@ diff -up ./configure.autotool-intermediates ./configure else ac_cv_sizeof_off_t=0 fi -@@ -7165,7 +7172,7 @@ fi +@@ -7172,7 +7179,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; } @@ -1658,7 +1658,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (time_t))" "ac_cv_sizeof_time_t" " -@@ -7182,8 +7189,9 @@ else +@@ -7189,8 +7196,9 @@ else if test "$ac_cv_type_time_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} @@ -1670,7 +1670,7 @@ diff -up ./configure.autotool-intermediates ./configure else ac_cv_sizeof_time_t=0 fi -@@ -7240,7 +7248,7 @@ if test "$have_pthread_t" = yes ; then +@@ -7247,7 +7255,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; } @@ -1679,7 +1679,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pthread_t))" "ac_cv_sizeof_pthread_t" " -@@ -7254,8 +7262,9 @@ else +@@ -7261,8 +7269,9 @@ else if test "$ac_cv_type_pthread_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} @@ -1691,7 +1691,7 @@ diff -up ./configure.autotool-intermediates ./configure else ac_cv_sizeof_pthread_t=0 fi -@@ -7342,7 +7351,7 @@ fi +@@ -7349,7 +7358,7 @@ fi MACOSX_DEFAULT_ARCH="ppc" ;; *) @@ -1700,7 +1700,7 @@ diff -up ./configure.autotool-intermediates ./configure ;; esac else -@@ -7354,7 +7363,7 @@ fi +@@ -7361,7 +7370,7 @@ fi MACOSX_DEFAULT_ARCH="ppc64" ;; *) @@ -1709,7 +1709,7 @@ diff -up ./configure.autotool-intermediates ./configure ;; esac -@@ -7380,7 +7389,7 @@ $as_echo "#define WITH_NEXT_FRAMEWORK 1" +@@ -7387,7 +7396,7 @@ $as_echo "#define WITH_NEXT_FRAMEWORK 1" $as_echo "yes" >&6; } if test $enable_shared = "yes" then @@ -1718,7 +1718,7 @@ diff -up ./configure.autotool-intermediates ./configure fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -@@ -7687,7 +7696,7 @@ $as_echo "$SHLIBS" >&6; } +@@ -7694,7 +7703,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; } @@ -1727,7 +1727,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -@@ -7721,7 +7730,7 @@ LIBS=$ac_check_lib_save_LIBS +@@ -7728,7 +7737,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; } @@ -1736,7 +1736,7 @@ diff -up ./configure.autotool-intermediates ./configure cat >>confdefs.h <<_ACEOF #define HAVE_LIBDL 1 _ACEOF -@@ -7732,7 +7741,7 @@ fi +@@ -7739,7 +7748,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; } @@ -1745,7 +1745,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -@@ -7766,7 +7775,7 @@ LIBS=$ac_check_lib_save_LIBS +@@ -7773,7 +7782,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; } @@ -1754,7 +1754,7 @@ diff -up ./configure.autotool-intermediates ./configure cat >>confdefs.h <<_ACEOF #define HAVE_LIBDLD 1 _ACEOF -@@ -7780,7 +7789,7 @@ fi +@@ -7787,7 +7796,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; } @@ -1763,7 +1763,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS -@@ -7814,11 +7823,11 @@ for ac_lib in '' pthread rt posix4; do +@@ -7821,11 +7830,11 @@ for ac_lib in '' pthread rt posix4; do fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext @@ -1777,7 +1777,7 @@ diff -up ./configure.autotool-intermediates ./configure else ac_cv_search_sem_init=no -@@ -7841,7 +7850,7 @@ fi +@@ -7848,7 +7857,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; } @@ -1786,7 +1786,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -@@ -7875,7 +7884,7 @@ LIBS=$ac_check_lib_save_LIBS +@@ -7882,7 +7891,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; } @@ -1795,7 +1795,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo "#define WITH_LIBINTL 1" >>confdefs.h -@@ -7922,7 +7931,7 @@ esac +@@ -7929,7 +7938,7 @@ esac # Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for t_open in -lnsl" >&5 $as_echo_n "checking for t_open in -lnsl... " >&6; } @@ -1804,7 +1804,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -@@ -7956,13 +7965,13 @@ LIBS=$ac_check_lib_save_LIBS +@@ -7963,13 +7972,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; } @@ -1820,7 +1820,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -@@ -7996,7 +8005,7 @@ LIBS=$ac_check_lib_save_LIBS +@@ -8003,7 +8012,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; } @@ -1829,7 +1829,7 @@ diff -up ./configure.autotool-intermediates ./configure LIBS="-lsocket $LIBS" fi # SVR4 sockets -@@ -8022,7 +8031,7 @@ if test -n "$ac_tool_prefix"; then +@@ -8029,7 +8038,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; } @@ -1838,7 +1838,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in -@@ -8065,7 +8074,7 @@ if test -z "$ac_cv_path_PKG_CONFIG"; the +@@ -8072,7 +8081,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; } @@ -1847,7 +1847,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in -@@ -8176,12 +8185,12 @@ if test "${with_dbmliborder+set}" = set; +@@ -8183,12 +8192,12 @@ if test "${with_dbmliborder+set}" = set; withval=$with_dbmliborder; if test x$with_dbmliborder = xyes then @@ -1862,7 +1862,7 @@ diff -up ./configure.autotool-intermediates ./configure fi done fi -@@ -8347,7 +8356,7 @@ $as_echo "$unistd_defines_pthreads" >&6; +@@ -8354,7 +8363,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" @@ -1871,7 +1871,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo "#define WITH_THREAD 1" >>confdefs.h $as_echo "#define C_THREADS 1" >>confdefs.h -@@ -8360,7 +8369,7 @@ $as_echo "#define HURD_C_THREADS 1" >>co +@@ -8367,7 +8376,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" @@ -1880,7 +1880,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo "#define WITH_THREAD 1" >>confdefs.h $as_echo "#define C_THREADS 1" >>confdefs.h -@@ -8404,7 +8413,7 @@ else +@@ -8411,7 +8420,7 @@ else LIBS=$_libs ac_fn_c_check_func "$LINENO" "pthread_detach" "ac_cv_func_pthread_detach" @@ -1889,7 +1889,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo "#define WITH_THREAD 1" >>confdefs.h posix_threads=yes -@@ -8413,7 +8422,7 @@ else +@@ -8420,7 +8429,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; } @@ -1898,7 +1898,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -@@ -8447,7 +8456,7 @@ LIBS=$ac_check_lib_save_LIBS +@@ -8454,7 +8463,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; } @@ -1907,7 +1907,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo "#define WITH_THREAD 1" >>confdefs.h posix_threads=yes -@@ -8457,7 +8466,7 @@ else +@@ -8464,7 +8473,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; } @@ -1916,7 +1916,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -@@ -8491,7 +8500,7 @@ LIBS=$ac_check_lib_save_LIBS +@@ -8498,7 +8507,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; } @@ -1925,7 +1925,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo "#define WITH_THREAD 1" >>confdefs.h posix_threads=yes -@@ -8501,7 +8510,7 @@ else +@@ -8508,7 +8517,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; } @@ -1934,7 +1934,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -@@ -8535,7 +8544,7 @@ LIBS=$ac_check_lib_save_LIBS +@@ -8542,7 +8551,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; } @@ -1943,7 +1943,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo "#define WITH_THREAD 1" >>confdefs.h posix_threads=yes -@@ -8545,7 +8554,7 @@ else +@@ -8552,7 +8561,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; } @@ -1952,7 +1952,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -@@ -8579,7 +8588,7 @@ LIBS=$ac_check_lib_save_LIBS +@@ -8586,7 +8595,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; } @@ -1961,7 +1961,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo "#define WITH_THREAD 1" >>confdefs.h posix_threads=yes -@@ -8611,7 +8620,7 @@ fi +@@ -8618,7 +8627,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for usconfig in -lmpc" >&5 $as_echo_n "checking for usconfig in -lmpc... " >&6; } @@ -1970,7 +1970,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -@@ -8645,7 +8654,7 @@ LIBS=$ac_check_lib_save_LIBS +@@ -8652,7 +8661,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; } @@ -1979,7 +1979,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo "#define WITH_THREAD 1" >>confdefs.h LIBS="$LIBS -lmpc" -@@ -8657,7 +8666,7 @@ fi +@@ -8664,7 +8673,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; } @@ -1988,7 +1988,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -@@ -8691,7 +8700,7 @@ LIBS=$ac_check_lib_save_LIBS +@@ -8698,7 +8707,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; } @@ -1997,7 +1997,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo "#define WITH_THREAD 1" >>confdefs.h LIBS="$LIBS -lthread" -@@ -8740,7 +8749,7 @@ $as_echo "#define HAVE_BROKEN_POSIX_SEMA +@@ -8747,7 +8756,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; } @@ -2006,7 +2006,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : -@@ -8783,7 +8792,7 @@ $as_echo "#define PTHREAD_SYSTEM_SCHED_S +@@ -8790,7 +8799,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" @@ -2015,7 +2015,7 @@ diff -up ./configure.autotool-intermediates ./configure cat >>confdefs.h <<_ACEOF #define HAVE_PTHREAD_SIGMASK 1 _ACEOF -@@ -9136,6 +9145,50 @@ $as_echo "no" >&6; } +@@ -9143,6 +9152,50 @@ $as_echo "no" >&6; } fi @@ -2066,7 +2066,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; } -@@ -9175,12 +9228,12 @@ fi +@@ -9182,12 +9235,12 @@ 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" @@ -2081,7 +2081,7 @@ diff -up ./configure.autotool-intermediates ./configure fi -@@ -9188,6 +9241,46 @@ fi +@@ -9195,6 +9248,46 @@ fi OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT" fi @@ -2128,7 +2128,7 @@ diff -up ./configure.autotool-intermediates ./configure # -I${DLINCLDIR} is added to the compile rule for importdl.o DLINCLDIR=. -@@ -9197,7 +9290,7 @@ DLINCLDIR=. +@@ -9204,7 +9297,7 @@ DLINCLDIR=. for ac_func in dlopen do : ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" @@ -2137,7 +2137,7 @@ diff -up ./configure.autotool-intermediates ./configure cat >>confdefs.h <<_ACEOF #define HAVE_DLOPEN 1 _ACEOF -@@ -9274,7 +9367,8 @@ for ac_func in alarm accept4 setitimer g +@@ -9281,7 +9374,8 @@ for ac_func in alarm accept4 setitimer g do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -2147,7 +2147,7 @@ diff -up ./configure.autotool-intermediates ./configure cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF -@@ -9524,7 +9618,7 @@ rm -f core conftest.err conftest.$ac_obj +@@ -9531,7 +9625,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; } @@ -2156,7 +2156,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -9554,7 +9648,7 @@ if test "x${ac_cv_flock_decl}" = xyes; t +@@ -9561,7 +9655,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" @@ -2165,7 +2165,7 @@ diff -up ./configure.autotool-intermediates ./configure cat >>confdefs.h <<_ACEOF #define HAVE_FLOCK 1 _ACEOF -@@ -9562,7 +9656,7 @@ _ACEOF +@@ -9569,7 +9663,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; } @@ -2174,7 +2174,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -@@ -9596,7 +9690,7 @@ LIBS=$ac_check_lib_save_LIBS +@@ -9603,7 +9697,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; } @@ -2183,7 +2183,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo "#define HAVE_FLOCK 1" >>confdefs.h -@@ -9645,7 +9739,7 @@ do +@@ -9652,7 +9746,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; } @@ -2192,7 +2192,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else if test -n "$TRUE"; then -@@ -9685,7 +9779,7 @@ test -n "$TRUE" || TRUE="/bin/true" +@@ -9692,7 +9786,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; } @@ -2201,7 +2201,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -@@ -9719,12 +9813,12 @@ LIBS=$ac_check_lib_save_LIBS +@@ -9726,12 +9820,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; } @@ -2216,7 +2216,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -@@ -9758,7 +9852,7 @@ LIBS=$ac_check_lib_save_LIBS +@@ -9765,7 +9859,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; } @@ -2225,7 +2225,7 @@ diff -up ./configure.autotool-intermediates ./configure cat >>confdefs.h <<_ACEOF #define HAVE_LIBRESOLV 1 _ACEOF -@@ -9775,7 +9869,7 @@ fi +@@ -9782,7 +9876,7 @@ fi # exit Python { $as_echo "$as_me:${as_lineno-$LINENO}: checking for chflags" >&5 $as_echo_n "checking for chflags... " >&6; } @@ -2234,7 +2234,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : -@@ -9809,7 +9903,7 @@ fi +@@ -9816,7 +9910,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" @@ -2243,7 +2243,7 @@ diff -up ./configure.autotool-intermediates ./configure ac_cv_have_chflags="yes" else ac_cv_have_chflags="no" -@@ -9824,7 +9918,7 @@ fi +@@ -9831,7 +9925,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lchflags" >&5 $as_echo_n "checking for lchflags... " >&6; } @@ -2252,7 +2252,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : -@@ -9858,7 +9952,7 @@ fi +@@ -9865,7 +9959,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" @@ -2261,7 +2261,7 @@ diff -up ./configure.autotool-intermediates ./configure ac_cv_have_lchflags="yes" else ac_cv_have_lchflags="no" -@@ -9882,7 +9976,7 @@ esac +@@ -9889,7 +9983,7 @@ esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateCopy in -lz" >&5 $as_echo_n "checking for inflateCopy in -lz... " >&6; } @@ -2270,7 +2270,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -@@ -9916,7 +10010,7 @@ LIBS=$ac_check_lib_save_LIBS +@@ -9923,7 +10017,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; } @@ -2279,7 +2279,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo "#define HAVE_ZLIB_COPY 1" >>confdefs.h -@@ -10059,7 +10153,7 @@ rm -f core conftest.err conftest.$ac_obj +@@ -10066,7 +10160,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" @@ -2288,7 +2288,7 @@ diff -up ./configure.autotool-intermediates ./configure cat >>confdefs.h <<_ACEOF #define HAVE_OPENPTY 1 _ACEOF -@@ -10067,7 +10161,7 @@ _ACEOF +@@ -10074,7 +10168,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; } @@ -2297,7 +2297,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -@@ -10101,13 +10195,13 @@ LIBS=$ac_check_lib_save_LIBS +@@ -10108,13 +10202,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; } @@ -2313,7 +2313,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -@@ -10141,7 +10235,7 @@ LIBS=$ac_check_lib_save_LIBS +@@ -10148,7 +10242,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; } @@ -2322,7 +2322,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo "#define HAVE_OPENPTY 1" >>confdefs.h LIBS="$LIBS -lbsd" fi -@@ -10156,7 +10250,7 @@ done +@@ -10163,7 +10257,7 @@ done for ac_func in forkpty do : ac_fn_c_check_func "$LINENO" "forkpty" "ac_cv_func_forkpty" @@ -2331,7 +2331,7 @@ diff -up ./configure.autotool-intermediates ./configure cat >>confdefs.h <<_ACEOF #define HAVE_FORKPTY 1 _ACEOF -@@ -10164,7 +10258,7 @@ _ACEOF +@@ -10171,7 +10265,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; } @@ -2340,7 +2340,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -@@ -10198,13 +10292,13 @@ LIBS=$ac_check_lib_save_LIBS +@@ -10205,13 +10299,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; } @@ -2356,7 +2356,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -@@ -10238,7 +10332,7 @@ LIBS=$ac_check_lib_save_LIBS +@@ -10245,7 +10339,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; } @@ -2365,7 +2365,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo "#define HAVE_FORKPTY 1" >>confdefs.h LIBS="$LIBS -lbsd" fi -@@ -10255,7 +10349,7 @@ done +@@ -10262,7 +10356,7 @@ done for ac_func in memmove do : ac_fn_c_check_func "$LINENO" "memmove" "ac_cv_func_memmove" @@ -2374,7 +2374,7 @@ diff -up ./configure.autotool-intermediates ./configure cat >>confdefs.h <<_ACEOF #define HAVE_MEMMOVE 1 _ACEOF -@@ -10269,7 +10363,8 @@ for ac_func in fseek64 fseeko fstatvfs f +@@ -10276,7 +10370,8 @@ for ac_func in fseek64 fseeko fstatvfs f do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -2384,7 +2384,7 @@ diff -up ./configure.autotool-intermediates ./configure cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF -@@ -10278,50 +10373,31 @@ fi +@@ -10285,50 +10380,31 @@ fi done @@ -2448,7 +2448,7 @@ diff -up ./configure.autotool-intermediates ./configure cat >>confdefs.h <<_ACEOF #define HAVE_GETPGRP 1 _ACEOF -@@ -10349,7 +10425,7 @@ done +@@ -10356,7 +10432,7 @@ done for ac_func in setpgrp do : ac_fn_c_check_func "$LINENO" "setpgrp" "ac_cv_func_setpgrp" @@ -2457,7 +2457,7 @@ diff -up ./configure.autotool-intermediates ./configure cat >>confdefs.h <<_ACEOF #define HAVE_SETPGRP 1 _ACEOF -@@ -10377,7 +10453,7 @@ done +@@ -10384,7 +10460,7 @@ done for ac_func in gettimeofday do : ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday" @@ -2466,7 +2466,7 @@ diff -up ./configure.autotool-intermediates ./configure cat >>confdefs.h <<_ACEOF #define HAVE_GETTIMEOFDAY 1 _ACEOF -@@ -10479,7 +10555,7 @@ if test $have_getaddrinfo = yes +@@ -10486,7 +10562,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; } @@ -2475,7 +2475,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : -@@ -10608,7 +10684,7 @@ fi +@@ -10615,7 +10691,7 @@ fi for ac_func in getnameinfo do : ac_fn_c_check_func "$LINENO" "getnameinfo" "ac_cv_func_getnameinfo" @@ -2484,7 +2484,7 @@ diff -up ./configure.autotool-intermediates ./configure cat >>confdefs.h <<_ACEOF #define HAVE_GETNAMEINFO 1 _ACEOF -@@ -10620,7 +10696,7 @@ done +@@ -10627,7 +10703,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; } @@ -2493,7 +2493,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -10655,7 +10731,7 @@ fi +@@ -10662,7 +10738,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; } @@ -2502,7 +2502,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -10692,7 +10768,7 @@ ac_fn_c_check_member "$LINENO" "struct t +@@ -10699,7 +10775,7 @@ ac_fn_c_check_member "$LINENO" "struct t #include <$ac_cv_struct_tm> " @@ -2511,7 +2511,7 @@ diff -up ./configure.autotool-intermediates ./configure cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_TM_TM_ZONE 1 -@@ -10708,7 +10784,7 @@ $as_echo "#define HAVE_TM_ZONE 1" >>conf +@@ -10715,7 +10791,7 @@ $as_echo "#define HAVE_TM_ZONE 1" >>conf else ac_fn_c_check_decl "$LINENO" "tzname" "ac_cv_have_decl_tzname" "#include " @@ -2520,7 +2520,7 @@ diff -up ./configure.autotool-intermediates ./configure ac_have_decl=1 else ac_have_decl=0 -@@ -10720,7 +10796,7 @@ _ACEOF +@@ -10727,7 +10803,7 @@ _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5 $as_echo_n "checking for tzname... " >&6; } @@ -2529,7 +2529,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -10756,7 +10832,7 @@ $as_echo "#define HAVE_TZNAME 1" >>confd +@@ -10763,7 +10839,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" @@ -2538,7 +2538,7 @@ diff -up ./configure.autotool-intermediates ./configure cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_RDEV 1 -@@ -10766,7 +10842,7 @@ _ACEOF +@@ -10773,7 +10849,7 @@ _ACEOF fi ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default" @@ -2547,7 +2547,7 @@ diff -up ./configure.autotool-intermediates ./configure cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_BLKSIZE 1 -@@ -10776,7 +10852,7 @@ _ACEOF +@@ -10783,7 +10859,7 @@ _ACEOF fi ac_fn_c_check_member "$LINENO" "struct stat" "st_flags" "ac_cv_member_struct_stat_st_flags" "$ac_includes_default" @@ -2556,7 +2556,7 @@ diff -up ./configure.autotool-intermediates ./configure cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_FLAGS 1 -@@ -10786,7 +10862,7 @@ _ACEOF +@@ -10793,7 +10869,7 @@ _ACEOF fi ac_fn_c_check_member "$LINENO" "struct stat" "st_gen" "ac_cv_member_struct_stat_st_gen" "$ac_includes_default" @@ -2565,7 +2565,7 @@ diff -up ./configure.autotool-intermediates ./configure cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_GEN 1 -@@ -10796,7 +10872,7 @@ _ACEOF +@@ -10803,7 +10879,7 @@ _ACEOF fi ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtime" "ac_cv_member_struct_stat_st_birthtime" "$ac_includes_default" @@ -2574,7 +2574,7 @@ diff -up ./configure.autotool-intermediates ./configure cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_BIRTHTIME 1 -@@ -10806,7 +10882,7 @@ _ACEOF +@@ -10813,7 +10889,7 @@ _ACEOF fi ac_fn_c_check_member "$LINENO" "struct stat" "st_blocks" "ac_cv_member_struct_stat_st_blocks" "$ac_includes_default" @@ -2583,7 +2583,7 @@ diff -up ./configure.autotool-intermediates ./configure cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_BLOCKS 1 -@@ -10828,7 +10904,7 @@ fi +@@ -10835,7 +10911,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; } @@ -2592,7 +2592,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else -@@ -10892,7 +10968,7 @@ $as_echo "$was_it_defined" >&6; } +@@ -10899,7 +10975,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; } @@ -2601,7 +2601,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -10924,7 +11000,7 @@ fi +@@ -10931,7 +11007,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_storage" >&5 $as_echo_n "checking for sockaddr_storage... " >&6; } @@ -2610,7 +2610,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -10960,7 +11036,7 @@ fi +@@ -10967,7 +11043,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned" >&5 $as_echo_n "checking whether char is unsigned... " >&6; } @@ -2619,7 +2619,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -10992,7 +11068,7 @@ fi +@@ -10999,7 +11075,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; } @@ -2628,7 +2628,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -11280,7 +11356,7 @@ $as_echo "$va_list_is_array" >&6; } +@@ -11287,7 +11363,7 @@ $as_echo "$va_list_is_array" >&6; } ac_fn_c_check_func "$LINENO" "gethostbyname_r" "ac_cv_func_gethostbyname_r" @@ -2637,7 +2637,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h -@@ -11411,7 +11487,7 @@ else +@@ -11418,7 +11494,7 @@ else for ac_func in gethostbyname do : ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" @@ -2646,7 +2646,7 @@ diff -up ./configure.autotool-intermediates ./configure cat >>confdefs.h <<_ACEOF #define HAVE_GETHOSTBYNAME 1 _ACEOF -@@ -11433,12 +11509,12 @@ fi +@@ -11440,12 +11516,12 @@ fi # Linux requires this for correct f.p. operations ac_fn_c_check_func "$LINENO" "__fpu_control" "ac_cv_func___fpu_control" @@ -2661,7 +2661,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -@@ -11472,7 +11548,7 @@ LIBS=$ac_check_lib_save_LIBS +@@ -11479,7 +11555,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; } @@ -2670,7 +2670,7 @@ diff -up ./configure.autotool-intermediates ./configure cat >>confdefs.h <<_ACEOF #define HAVE_LIBIEEE 1 _ACEOF -@@ -11528,7 +11604,7 @@ elif test "$withval" != yes +@@ -11535,7 +11611,7 @@ elif test "$withval" != yes then LIBM=$withval { $as_echo "$as_me:${as_lineno-$LINENO}: result: set LIBM=\"$withval\"" >&5 $as_echo "set LIBM=\"$withval\"" >&6; } @@ -2679,7 +2679,7 @@ diff -up ./configure.autotool-intermediates ./configure fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: default LIBM=\"$LIBM\"" >&5 -@@ -11552,7 +11628,7 @@ elif test "$withval" != yes +@@ -11559,7 +11635,7 @@ elif test "$withval" != yes then LIBC=$withval { $as_echo "$as_me:${as_lineno-$LINENO}: result: set LIBC=\"$withval\"" >&5 $as_echo "set LIBC=\"$withval\"" >&6; } @@ -2688,7 +2688,7 @@ diff -up ./configure.autotool-intermediates ./configure fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: default LIBC=\"$LIBC\"" >&5 -@@ -11566,7 +11642,7 @@ fi +@@ -11573,7 +11649,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; } @@ -2697,7 +2697,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else -@@ -11608,7 +11684,7 @@ fi +@@ -11615,7 +11691,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; } @@ -2706,7 +2706,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else -@@ -11654,7 +11730,7 @@ fi +@@ -11661,7 +11737,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; } @@ -2715,7 +2715,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else -@@ -11802,7 +11878,8 @@ for ac_func in acosh asinh atanh copysig +@@ -11809,7 +11885,8 @@ for ac_func in acosh asinh atanh copysig do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -2725,7 +2725,7 @@ diff -up ./configure.autotool-intermediates ./configure cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF -@@ -11814,7 +11891,8 @@ for ac_func in hypot lgamma log1p round +@@ -11821,7 +11898,8 @@ for ac_func in hypot lgamma log1p round do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -2735,7 +2735,7 @@ diff -up ./configure.autotool-intermediates ./configure cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF -@@ -11824,7 +11902,7 @@ done +@@ -11831,7 +11909,7 @@ done ac_fn_c_check_decl "$LINENO" "isinf" "ac_cv_have_decl_isinf" "#include " @@ -2744,7 +2744,7 @@ diff -up ./configure.autotool-intermediates ./configure ac_have_decl=1 else ac_have_decl=0 -@@ -11835,7 +11913,7 @@ cat >>confdefs.h <<_ACEOF +@@ -11842,7 +11920,7 @@ cat >>confdefs.h <<_ACEOF _ACEOF ac_fn_c_check_decl "$LINENO" "isnan" "ac_cv_have_decl_isnan" "#include " @@ -2753,7 +2753,7 @@ diff -up ./configure.autotool-intermediates ./configure ac_have_decl=1 else ac_have_decl=0 -@@ -11846,7 +11924,7 @@ cat >>confdefs.h <<_ACEOF +@@ -11853,7 +11931,7 @@ cat >>confdefs.h <<_ACEOF _ACEOF ac_fn_c_check_decl "$LINENO" "isfinite" "ac_cv_have_decl_isfinite" "#include " @@ -2762,7 +2762,7 @@ diff -up ./configure.autotool-intermediates ./configure ac_have_decl=1 else ac_have_decl=0 -@@ -11861,7 +11939,7 @@ _ACEOF +@@ -11868,7 +11946,7 @@ _ACEOF # -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; } @@ -2771,7 +2771,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else -@@ -11909,7 +11987,7 @@ then +@@ -11916,7 +11994,7 @@ then # -0. See issue #9920. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether log1p drops the sign of negative zero" >&5 $as_echo_n "checking whether log1p drops the sign of negative zero... " >&6; } @@ -2780,7 +2780,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else -@@ -11961,7 +12039,7 @@ LIBS=$LIBS_SAVE +@@ -11968,7 +12046,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; } @@ -2789,7 +2789,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : -@@ -12012,7 +12090,7 @@ fi +@@ -12019,7 +12097,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; } @@ -2798,7 +2798,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : -@@ -12077,7 +12155,7 @@ no) +@@ -12084,7 +12162,7 @@ no) 15|30) ;; *) @@ -2807,7 +2807,7 @@ diff -up ./configure.autotool-intermediates ./configure esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_big_digits" >&5 $as_echo "$enable_big_digits" >&6; } -@@ -12095,7 +12173,7 @@ fi +@@ -12102,7 +12180,7 @@ fi # check for wchar.h ac_fn_c_check_header_mongrel "$LINENO" "wchar.h" "ac_cv_header_wchar_h" "$ac_includes_default" @@ -2816,7 +2816,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo "#define HAVE_WCHAR_H 1" >>confdefs.h -@@ -12118,7 +12196,7 @@ then +@@ -12125,7 +12203,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; } @@ -2825,7 +2825,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (wchar_t))" "ac_cv_sizeof_wchar_t" "#include -@@ -12128,8 +12206,9 @@ else +@@ -12135,8 +12213,9 @@ else if test "$ac_cv_type_wchar_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} @@ -2837,7 +2837,7 @@ diff -up ./configure.autotool-intermediates ./configure else ac_cv_sizeof_wchar_t=0 fi -@@ -12184,7 +12263,7 @@ then +@@ -12191,7 +12270,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; } @@ -2846,7 +2846,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else -@@ -12280,7 +12359,7 @@ $as_echo "$PY_UNICODE_TYPE" >&6; } +@@ -12287,7 +12366,7 @@ $as_echo "$PY_UNICODE_TYPE" >&6; } # 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; } @@ -2855,7 +2855,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown -@@ -12498,7 +12577,7 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUI +@@ -12505,7 +12584,7 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUI ;; #( *) @@ -2864,7 +2864,7 @@ diff -up ./configure.autotool-intermediates ./configure presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac -@@ -12571,7 +12650,7 @@ $as_echo "$SO" >&6; } +@@ -12578,7 +12657,7 @@ $as_echo "$SO" >&6; } # 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; } @@ -2873,7 +2873,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else -@@ -12610,7 +12689,7 @@ fi +@@ -12617,7 +12696,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; } @@ -2882,7 +2882,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else -@@ -12708,7 +12787,7 @@ fi +@@ -12715,7 +12794,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; } @@ -2891,7 +2891,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -@@ -12742,7 +12821,7 @@ LIBS=$ac_check_lib_save_LIBS +@@ -12749,7 +12828,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; } @@ -2900,7 +2900,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo "#define HAVE_RL_CALLBACK 1" >>confdefs.h -@@ -12760,7 +12839,7 @@ else +@@ -12767,7 +12846,7 @@ else have_readline=no fi @@ -2909,7 +2909,7 @@ diff -up ./configure.autotool-intermediates ./configure if test $have_readline = yes then cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -12794,7 +12873,7 @@ fi +@@ -12801,7 +12880,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; } @@ -2918,7 +2918,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -@@ -12828,7 +12907,7 @@ LIBS=$ac_check_lib_save_LIBS +@@ -12835,7 +12914,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; } @@ -2927,7 +2927,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo "#define HAVE_RL_PRE_INPUT_HOOK 1" >>confdefs.h -@@ -12838,7 +12917,7 @@ fi +@@ -12845,7 +12924,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; } @@ -2936,7 +2936,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -@@ -12872,7 +12951,7 @@ LIBS=$ac_check_lib_save_LIBS +@@ -12879,7 +12958,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; } @@ -2945,7 +2945,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo "#define HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK 1" >>confdefs.h -@@ -12882,7 +12961,7 @@ fi +@@ -12889,7 +12968,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; } @@ -2954,7 +2954,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -@@ -12916,7 +12995,7 @@ LIBS=$ac_check_lib_save_LIBS +@@ -12923,7 +13002,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; } @@ -2963,7 +2963,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo "#define HAVE_RL_COMPLETION_MATCHES 1" >>confdefs.h -@@ -12934,7 +13013,7 @@ else +@@ -12941,7 +13020,7 @@ else have_readline=no fi @@ -2972,7 +2972,7 @@ diff -up ./configure.autotool-intermediates ./configure if test $have_readline = yes then cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -12957,7 +13036,7 @@ LIBS=$LIBS_no_readline +@@ -12964,7 +13043,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; } @@ -2981,7 +2981,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else -@@ -12998,7 +13077,7 @@ fi +@@ -13005,7 +13084,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken poll()" >&5 $as_echo_n "checking for broken poll()... " >&6; } @@ -2990,7 +2990,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : -@@ -13053,7 +13132,7 @@ ac_fn_c_check_member "$LINENO" "struct t +@@ -13060,7 +13139,7 @@ ac_fn_c_check_member "$LINENO" "struct t #include <$ac_cv_struct_tm> " @@ -2999,7 +2999,7 @@ diff -up ./configure.autotool-intermediates ./configure cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_TM_TM_ZONE 1 -@@ -13069,7 +13148,7 @@ $as_echo "#define HAVE_TM_ZONE 1" >>conf +@@ -13076,7 +13155,7 @@ $as_echo "#define HAVE_TM_ZONE 1" >>conf else ac_fn_c_check_decl "$LINENO" "tzname" "ac_cv_have_decl_tzname" "#include " @@ -3008,7 +3008,7 @@ diff -up ./configure.autotool-intermediates ./configure ac_have_decl=1 else ac_have_decl=0 -@@ -13081,7 +13160,7 @@ _ACEOF +@@ -13088,7 +13167,7 @@ _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5 $as_echo_n "checking for tzname... " >&6; } @@ -3017,7 +3017,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -13120,7 +13199,7 @@ fi +@@ -13127,7 +13206,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; } @@ -3026,7 +3026,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else -@@ -13217,7 +13296,7 @@ fi +@@ -13224,7 +13303,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; } @@ -3035,7 +3035,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -13254,7 +13333,7 @@ fi +@@ -13261,7 +13340,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; } @@ -3044,7 +3044,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -13291,7 +13370,7 @@ fi +@@ -13298,7 +13377,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; } @@ -3053,7 +3053,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -13328,7 +13407,7 @@ fi +@@ -13335,7 +13414,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether WINDOW has _flags" >&5 $as_echo_n "checking whether WINDOW has _flags... " >&6; } @@ -3062,7 +3062,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -13476,7 +13555,7 @@ if test "$have_long_long" = yes +@@ -13483,7 +13562,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; } @@ -3071,7 +3071,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : -@@ -13546,7 +13625,7 @@ fi +@@ -13553,7 +13632,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; } @@ -3080,7 +3080,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : -@@ -13619,7 +13698,7 @@ ac_fn_c_check_type "$LINENO" "socklen_t" +@@ -13626,7 +13705,7 @@ ac_fn_c_check_type "$LINENO" "socklen_t" #endif " @@ -3089,7 +3089,7 @@ diff -up ./configure.autotool-intermediates ./configure else -@@ -13630,7 +13709,7 @@ fi +@@ -13637,7 +13716,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken mbstowcs" >&5 $as_echo_n "checking for broken mbstowcs... " >&6; } @@ -3098,7 +3098,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : -@@ -13670,7 +13749,7 @@ fi +@@ -13677,7 +13756,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports computed gotos" >&5 $as_echo_n "checking whether $CC supports computed gotos... " >&6; } @@ -3107,7 +3107,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : -@@ -13750,11 +13829,11 @@ esac +@@ -13757,11 +13836,11 @@ esac case $ac_sys_system in @@ -3121,7 +3121,7 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo "#define HAVE_PIPE2 1" >>confdefs.h -@@ -13849,21 +13928,10 @@ $as_echo "$as_me: WARNING: cache variabl +@@ -13856,21 +13935,10 @@ $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 @@ -3145,7 +3145,7 @@ diff -up ./configure.autotool-intermediates ./configure 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;} -@@ -13879,7 +13947,6 @@ DEFS=-DHAVE_CONFIG_H +@@ -13886,7 +13954,6 @@ DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= @@ -3153,7 +3153,7 @@ diff -up ./configure.autotool-intermediates ./configure for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' -@@ -13896,7 +13963,7 @@ LTLIBOBJS=$ac_ltlibobjs +@@ -13903,7 +13970,7 @@ LTLIBOBJS=$ac_ltlibobjs @@ -3162,7 +3162,7 @@ diff -up ./configure.autotool-intermediates ./configure ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -@@ -13997,7 +14064,6 @@ fi +@@ -14004,7 +14071,6 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. @@ -3170,7 +3170,7 @@ diff -up ./configure.autotool-intermediates ./configure case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -@@ -14043,19 +14109,19 @@ export LANGUAGE +@@ -14050,19 +14116,19 @@ export LANGUAGE (unset CDPATH) >/dev/null 2>&1 && unset CDPATH @@ -3198,7 +3198,7 @@ diff -up ./configure.autotool-intermediates ./configure as_fn_exit $as_status } # as_fn_error -@@ -14251,7 +14317,7 @@ $as_echo X"$as_dir" | +@@ -14258,7 +14324,7 @@ $as_echo X"$as_dir" | test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" @@ -3207,7 +3207,7 @@ diff -up ./configure.autotool-intermediates ./configure } # as_fn_mkdir_p -@@ -14305,7 +14371,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri +@@ -14312,7 +14378,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri # values after options handling. ac_log=" This file was extended by python $as_me 3.2, which was @@ -3216,7 +3216,7 @@ diff -up ./configure.autotool-intermediates ./configure CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS -@@ -14367,10 +14433,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_writ +@@ -14374,10 +14440,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_writ ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ python config.status 3.2 @@ -3229,7 +3229,7 @@ diff -up ./configure.autotool-intermediates ./configure This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." -@@ -14386,16 +14452,11 @@ ac_need_defaults=: +@@ -14393,16 +14459,11 @@ ac_need_defaults=: while test $# != 0 do case $1 in @@ -3247,7 +3247,7 @@ diff -up ./configure.autotool-intermediates ./configure *) ac_option=$1 ac_optarg=$2 -@@ -14417,7 +14478,6 @@ do +@@ -14424,7 +14485,6 @@ do $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; @@ -3255,7 +3255,7 @@ diff -up ./configure.autotool-intermediates ./configure esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; -@@ -14430,7 +14490,7 @@ do +@@ -14437,7 +14497,7 @@ do ac_need_defaults=false;; --he | --h) # Conflict between --help and --header @@ -3264,7 +3264,7 @@ diff -up ./configure.autotool-intermediates ./configure Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -@@ -14439,7 +14499,7 @@ Try \`$0 --help' for more information."; +@@ -14446,7 +14506,7 @@ Try \`$0 --help' for more information."; ac_cs_silent=: ;; # This is an error. @@ -3273,7 +3273,7 @@ diff -up ./configure.autotool-intermediates ./configure Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" -@@ -14498,7 +14558,7 @@ do +@@ -14505,7 +14565,7 @@ do "Misc/python.pc") CONFIG_FILES="$CONFIG_FILES Misc/python.pc" ;; "Modules/ld_so_aix") CONFIG_FILES="$CONFIG_FILES Modules/ld_so_aix" ;; @@ -3282,7 +3282,7 @@ diff -up ./configure.autotool-intermediates ./configure esac done -@@ -14520,10 +14580,9 @@ fi +@@ -14527,10 +14587,9 @@ fi # after its creation but before its name has been assigned to `$tmp'. $debug || { @@ -3295,7 +3295,7 @@ diff -up ./configure.autotool-intermediates ./configure ' 0 trap 'as_fn_exit 1' 1 2 13 15 } -@@ -14531,13 +14590,12 @@ $debug || +@@ -14538,13 +14597,12 @@ $debug || { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && @@ -3311,7 +3311,7 @@ diff -up ./configure.autotool-intermediates ./configure # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. -@@ -14554,12 +14612,12 @@ if test "x$ac_cr" = x; then +@@ -14561,12 +14619,12 @@ if test "x$ac_cr" = x; then fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then @@ -3326,7 +3326,7 @@ diff -up ./configure.autotool-intermediates ./configure _ACEOF -@@ -14568,18 +14626,18 @@ _ACEOF +@@ -14575,18 +14633,18 @@ _ACEOF echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || @@ -3349,7 +3349,7 @@ diff -up ./configure.autotool-intermediates ./configure else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi -@@ -14587,7 +14645,7 @@ done +@@ -14594,7 +14652,7 @@ done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 @@ -3358,7 +3358,7 @@ diff -up ./configure.autotool-intermediates ./configure _ACEOF sed -n ' h -@@ -14635,7 +14693,7 @@ t delim +@@ -14642,7 +14700,7 @@ t delim rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK @@ -3367,7 +3367,7 @@ diff -up ./configure.autotool-intermediates ./configure for (key in S) S_is_set[key] = 1 FS = "" -@@ -14667,29 +14725,21 @@ if sed "s/$ac_cr//" < /dev/null > /dev/n +@@ -14674,29 +14732,21 @@ if sed "s/$ac_cr//" < /dev/null > /dev/n sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat @@ -3406,7 +3406,7 @@ diff -up ./configure.autotool-intermediates ./configure s/^[^=]*=[ ]*$// }' fi -@@ -14701,7 +14751,7 @@ fi # test -n "$CONFIG_FILES" +@@ -14708,7 +14758,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 @@ -3415,7 +3415,7 @@ diff -up ./configure.autotool-intermediates ./configure BEGIN { _ACEOF -@@ -14713,11 +14763,11 @@ _ACEOF +@@ -14720,11 +14770,11 @@ _ACEOF # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do @@ -3430,7 +3430,7 @@ diff -up ./configure.autotool-intermediates ./configure else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi -@@ -14802,7 +14852,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_writ +@@ -14809,7 +14859,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_writ _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 @@ -3439,7 +3439,7 @@ diff -up ./configure.autotool-intermediates ./configure fi # test -n "$CONFIG_HEADERS" -@@ -14815,7 +14865,7 @@ do +@@ -14822,7 +14872,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; @@ -3448,7 +3448,7 @@ diff -up ./configure.autotool-intermediates ./configure :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac -@@ -14834,7 +14884,7 @@ do +@@ -14841,7 +14891,7 @@ do for ac_f do case $ac_f in @@ -3457,7 +3457,7 @@ diff -up ./configure.autotool-intermediates ./configure *) # 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 `:'. -@@ -14843,7 +14893,7 @@ do +@@ -14850,7 +14900,7 @@ do [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || @@ -3466,7 +3466,7 @@ diff -up ./configure.autotool-intermediates ./configure esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" -@@ -14869,8 +14919,8 @@ $as_echo "$as_me: creating $ac_file" >&6 +@@ -14876,8 +14926,8 @@ $as_echo "$as_me: creating $ac_file" >&6 esac case $ac_tag in @@ -3477,7 +3477,7 @@ diff -up ./configure.autotool-intermediates ./configure esac ;; esac -@@ -15000,24 +15050,23 @@ s&@abs_top_builddir@&$ac_abs_top_builddi +@@ -15007,24 +15057,23 @@ s&@abs_top_builddir@&$ac_abs_top_builddi s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " @@ -3512,7 +3512,7 @@ diff -up ./configure.autotool-intermediates ./configure ;; :H) # -@@ -15026,21 +15075,21 @@ which seems to be undefined. Please mak +@@ -15033,21 +15082,21 @@ which seems to be undefined. Please mak if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ @@ -3542,7 +3542,7 @@ diff -up ./configure.autotool-intermediates ./configure fi ;; -@@ -15060,7 +15109,7 @@ _ACEOF +@@ -15067,7 +15116,7 @@ _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || @@ -3551,7 +3551,7 @@ diff -up ./configure.autotool-intermediates ./configure # configure is writing to config.log, and then calls config.status. -@@ -15081,7 +15130,7 @@ if test "$no_create" != yes; then +@@ -15088,7 +15137,7 @@ if test "$no_create" != yes; then exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. @@ -3561,8 +3561,8 @@ diff -up ./configure.autotool-intermediates ./configure if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 diff -up ./pyconfig.h.in.autotool-intermediates ./pyconfig.h.in ---- ./pyconfig.h.in.autotool-intermediates 2011-02-14 12:00:34.924103677 -0500 -+++ ./pyconfig.h.in 2011-02-14 12:00:41.116907489 -0500 +--- ./pyconfig.h.in.autotool-intermediates 2011-02-21 10:38:12.252957078 -0500 ++++ ./pyconfig.h.in 2011-02-21 10:38:17.743831724 -0500 @@ -12,15 +12,15 @@ support for AIX C++ shared extension modules. */ #undef AIX_GENUINE_CPLUSPLUS @@ -3582,3 +3582,13 @@ diff -up ./pyconfig.h.in.autotool-intermediates ./pyconfig.h.in /* Define if C doubles are 64-bit IEEE 754 binary format, stored in ARM mixed-endian order (byte order 45670123) */ #undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 +@@ -1161,6 +1161,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/python3.spec b/python3.spec index 4428f43..da0df0a 100644 --- a/python3.spec +++ b/python3.spec @@ -3,8 +3,6 @@ # pybasever without the dot: %global pyshortver 32 -%global alphatag rc3 - %global pylibdir %{_libdir}/python%{pybasever} %global dynload_dir %{pylibdir}/lib-dynload @@ -113,10 +111,10 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever} -Release: 0.13.%{alphatag}%{?dist} +Release: 1%{?dist} License: Python Group: Development/Languages -Source: http://python.org/ftp/python/%{version}/Python-%{version}%{alphatag}.tar.bz2 +Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 # Avoid having various bogus auto-generated Provides lines for the various # python c modules' SONAMEs: @@ -352,7 +350,7 @@ can load its own extensions. %endif # with_debug_build %prep -%setup -q -n Python-%{version}%{alphatag} +%setup -q -n Python-%{version} chmod +x %{SOURCE1} %if 0%{?with_systemtap} @@ -837,7 +835,7 @@ rm -fr %{buildroot} %doc LICENSE README %dir %{pylibdir} %dir %{dynload_dir} -%{dynload_dir}/Python-%{version}%{alphatag}-py%{pybasever}.egg-info +%{dynload_dir}/Python-%{version}-py%{pybasever}.egg-info %{dynload_dir}/_bisect.%{SOABI_optimized}.so %{dynload_dir}/_codecs_cn.%{SOABI_optimized}.so %{dynload_dir}/_codecs_hk.%{SOABI_optimized}.so @@ -1175,6 +1173,11 @@ rm -fr %{buildroot} %changelog +* Mon Feb 21 2011 David Malcolm - 3.2-1 +- 3.2 +- drop alphatag +- regenerate autotool patch + * Mon Feb 14 2011 David Malcolm - 3.2-0.13.rc3 - add a /usr/bin/python3-debug symlink within the debug subpackage diff --git a/sources b/sources index 3bc9e24..48f3848 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -25379af4bb6b0001e175d9d9b2ba4f63 Python-3.2rc3.tar.bz2 +92e94b5b6652b96349d6362b8337811d Python-3.2.tar.bz2 From b0ba5d44f6218fe2eb159e6830f762d13d78bee3 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 19 Apr 2011 12:12:57 -0400 Subject: [PATCH 055/416] fix the libpython.stp systemtap tapset (rhbz#697730) --- python3.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/python3.spec b/python3.spec index da0df0a..18eed4f 100644 --- a/python3.spec +++ b/python3.spec @@ -111,7 +111,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever} -Release: 1%{?dist} +Release: 2%{?dist} License: Python Group: Development/Languages Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 @@ -759,13 +759,13 @@ mkdir -p %{buildroot}%{tapsetdir} sed \ -e "s|LIBRARY_PATH|%{_libdir}/%{py_INSTSONAME_optimized}|" \ - %{SOURCE6} \ + %{_sourcedir}/libpython.stp \ > %{buildroot}%{tapsetdir}/%{libpython_stp_optimized} %if 0%{?with_debug_build} sed \ -e "s|LIBRARY_PATH|%{_libdir}/%{py_INSTSONAME_debug}|" \ - %{SOURCE6} \ + %{_sourcedir}/libpython.stp \ > %{buildroot}%{tapsetdir}/%{libpython_stp_debug} %endif # with_debug_build @@ -1173,6 +1173,9 @@ rm -fr %{buildroot} %changelog +* Tue Apr 19 2011 David Malcolm - 3.2-2 +- fix the libpython.stp systemtap tapset (rhbz#697730) + * Mon Feb 21 2011 David Malcolm - 3.2-1 - 3.2 - drop alphatag From c769a6b55048db039f0e345d5415d45324de4e82 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Fri, 8 Jul 2011 12:54:16 -0400 Subject: [PATCH 056/416] cleanup of BuildRequires; add comment headings to specfile sections --- python3.spec | 119 +++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 101 insertions(+), 18 deletions(-) diff --git a/python3.spec b/python3.spec index 18eed4f..50cf0f2 100644 --- a/python3.spec +++ b/python3.spec @@ -1,3 +1,7 @@ +# ====================================================== +# Conditionals and other variables controlling the build +# ====================================================== + %global pybasever 3.2 # pybasever without the dot: @@ -108,13 +112,67 @@ %global regenerate_autotooling_patch 0 +# ================== +# Top-level metadata +# ================== Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever} -Release: 2%{?dist} +Release: 3%{?dist} License: Python Group: Development/Languages -Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 + + +# ======================= +# Build-time requirements +# ======================= + +# (keep this list alphabetized) + +BuildRequires: autoconf +BuildRequires: bzip2 +BuildRequires: bzip2-devel +BuildRequires: db4-devel >= 4.7 +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 dependency on "python", in that systemtap-sdt-devel's +# /usr/bin/dtrace is a python 2 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 # Avoid having various bogus auto-generated Provides lines for the various # python c modules' SONAMEs: @@ -235,22 +293,10 @@ Patch129: python-3.2b2-fix-test-subprocess-with-nonreadable-path-dir.patch Patch300: autotool-intermediates.patch BuildRoot: %{_tmppath}/%{name}-%{version}-root -BuildRequires: readline-devel, openssl-devel, gmp-devel -BuildRequires: ncurses-devel, gdbm-devel, zlib-devel, expat-devel -BuildRequires: libGL-devel 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: 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 +# ====================================================== +# Additional metadata, and subpackages +# ====================================================== URL: http://www.python.org/ @@ -295,7 +341,6 @@ This package contains several tools included with Python 3 %package tkinter Summary: A GUI toolkit for Python 3 Group: Development/Languages -BuildRequires: tcl, tk Requires: %{name} = %{version}-%{release} %description tkinter @@ -349,6 +394,10 @@ suffix ("foo_d.so" rather than "foo.so") so that each Python 3 implementation can load its own extensions. %endif # with_debug_build +# ====================================================== +# The prep phase of the build: +# ====================================================== + %prep %setup -q -n Python-%{version} chmod +x %{SOURCE1} @@ -413,6 +462,11 @@ sed --in-place \ %patch300 -p0 -b .autotool-intermediates %endif + +# ====================================================== +# Configuring and building the code: +# ====================================================== + %build topdir=$(pwd) export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv" @@ -517,6 +571,9 @@ BuildPython optimized \ "" \ true +# ====================================================== +# Installing the built code: +# ====================================================== %install topdir=$(pwd) @@ -771,6 +828,11 @@ sed \ %endif # with_systemtap + +# ====================================================== +# Running the upstream test suite +# ====================================================== + %check topdir=$(pwd) CheckPython() { @@ -814,13 +876,27 @@ CheckPython debug CheckPython optimized +# ====================================================== +# 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 @@ -1172,7 +1248,14 @@ rm -fr %{buildroot} # payload file would be unpackaged) +# ====================================================== +# Finally, the changelog: +# ====================================================== + %changelog +* Fri Jul 8 2011 David Malcolm - 3.2-3 +- cleanup of BuildRequires; add comment headings to specfile sections + * Tue Apr 19 2011 David Malcolm - 3.2-2 - fix the libpython.stp systemtap tapset (rhbz#697730) From 5db81fb1d8c1d926be6f2fde197eda1f29c1158a Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Fri, 8 Jul 2011 13:47:40 -0400 Subject: [PATCH 057/416] don't run test_openpty and test_pty in %%check --- python3.spec | 83 +++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 60 insertions(+), 23 deletions(-) diff --git a/python3.spec b/python3.spec index 50cf0f2..8093bd6 100644 --- a/python3.spec +++ b/python3.spec @@ -118,7 +118,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever} -Release: 3%{?dist} +Release: 4%{?dist} License: Python Group: Development/Languages @@ -841,31 +841,65 @@ CheckPython() { echo STARTING: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName -# Run the upstream test suite -LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest -x test_distutils test_httplib test_http_cookies test_socket test_telnet + # Notes about disabled tests: + # + # test_distutils.py + # This one tries to build an RPM inside the rpmbuild; I'll simply + # let this one fail for now (has trouble linking against -lpython3.1; perhaps + # LD_LIBRARY_PATH is being discarded somewhere?) + # + # 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_openpty: + # Fails in Koji, possibly due to a mock issue (rhbz#714627) + # test test_openpty failed -- Traceback (most recent call last): + # File "/builddir/build/BUILD/Python-3.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) + # test test_pty failed -- Traceback (most recent call last): + # File "/builddir/build/BUILD/Python-3.2/Lib/test/test_pty.py", line 114, in test_fork + # pid, master_fd = pty.fork() + # File "/builddir/build/BUILD/Python-3.2/Lib/pty.py", line 107, in fork + # master_fd, slave_fd = openpty() + # File "/builddir/build/BUILD/Python-3.2/Lib/pty.py", line 29, in openpty + # master_fd, slave_name = _open_terminal() + # File "/builddir/build/BUILD/Python-3.2/Lib/pty.py", line 70, in _open_terminal + # raise os.error('out of pty devices') + # OSError: out of pty devices + # + # test_socket: + # test_socket.py:testSockName can fail here if DNS isn't properly set up: + # my_ip_addr = socket.gethostbyname(socket.gethostname()) + # socket.gaierror: [Errno -2] Name or service not known + # + # test_telnet: + # can get a "socket.error: [Errno 104] Connection reset by peer" + # + # Some additional tests fail when running the test suite as non-root outside of + # the build, due to permissions issues. -# Note that we're running the tests using the version of the code in the builddir, -# not in the buildroot. + EXCLUDED_TESTS="\ + test_distutils \ + test_httplib \ + test_http_cookies \ + test_openpty \ + test_pty.py \ + test_socket \ + test_telnet \ + %{nil}" -# I'm seeing occasional hangs in some http tests when running the test suite -# inside Koji. For that reason I exclude them -# -# Other known failures: -# -# (1) test_distutils.py: tries to build an RPM inside the rpmbuild; I'll simply -# let this one fail for now (has trouble linking against -lpython3.1; perhaps -# LD_LIBRARY_PATH is being discarded somewhere?) -# -# (2) test_socket.py:testSockName can fail here if DNS isn't properly set up: -# my_ip_addr = socket.gethostbyname(socket.gethostname()) -# socket.gaierror: [Errno -2] Name or service not known -# -# (3) test_telnet: can get a "socket.error: [Errno 104] Connection reset by peer" -# -# Some additional tests fail when running the test suite as non-root outside of -# the build, due to permissions issues. + # Note that we're running the tests using the version of the code in the builddir, + # not in the buildroot. - echo FINISHED: CHECKING OF PYTHON FOR CONFIGURATION: $ConfDir + # Run the upstream test suite + LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest -x $EXCLUDED_TESTS + + echo FINISHED: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName } @@ -1253,6 +1287,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Fri Jul 8 2011 David Malcolm - 3.2-4 +- don't run test_openpty and test_pty in %%check + * Fri Jul 8 2011 David Malcolm - 3.2-3 - cleanup of BuildRequires; add comment headings to specfile sections From cfd3e15f77961b3e43b4d2308da870bc0f104a2e Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Fri, 8 Jul 2011 14:10:58 -0400 Subject: [PATCH 058/416] use the gdb hooks from the upstream tarball, rather than keeping our own copy --- python3.spec | 76 ++++++++++++++++++++++++---------------------------- 1 file changed, 35 insertions(+), 41 deletions(-) diff --git a/python3.spec b/python3.spec index 8093bd6..39acd2c 100644 --- a/python3.spec +++ b/python3.spec @@ -118,7 +118,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever} -Release: 4%{?dist} +Release: 5%{?dist} License: Python Group: Development/Languages @@ -189,27 +189,6 @@ Source2: macros.python3 # with different Python runtimes as necessary: Source3: macros.pybytecompile -# 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 (though they are for the version -# of python that gdb is linked with, in this case Python 2.6) -# -# 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/libpython3.1.so.1.0.debug-gdb.py -# -# See https://fedoraproject.org/wiki/Features/EasierPythonDebugging for more -# information -# -# This is the version from -# http://bugs.python.org/issue8380 -# -# This is Tools/gdb/libpython.py from: -# http://bugs.python.org/file16902/port-gdb7-hooks-to-py3k.patch -# when applied to r80008 of the py3k branch -Source4: python-gdb.py - # 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 @@ -594,27 +573,39 @@ InstallPython() { make install DESTDIR=%{buildroot} INSTALL="install -p" - -# 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/libpython3.1.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/libpython3.1.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 %{SOURCE4} %{buildroot}$PathOfGdbPy -%endif # with_gdb_hooks - popd + # We install a collection of hooks for gdb that make it easier to debug + # executables linked against libpython3* (such as /usr/bin/python3 itself) + # + # These hooks are implemented in Python itself (though they are for the version + # of python that gdb is linked with, in this case Python 2.7) + # + # 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/libpython3.2.so.1.0.debug-gdb.py + # + # See https://fedoraproject.org/wiki/Features/EasierPythonDebugging for more + # information + # + # 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/libpython3.2.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/libpython3.1.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 Tools/gdb/libpython.py %{buildroot}$PathOfGdbPy +%endif # with_gdb_hooks + echo FINISHED: INSTALL OF PYTHON FOR CONFIGURATION: $ConfName } @@ -1287,6 +1278,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Fri Jul 8 2011 David Malcolm - 3.2-5 +- use the gdb hooks from the upstream tarball, rather than keeping our own copy + * Fri Jul 8 2011 David Malcolm - 3.2-4 - don't run test_openpty and test_pty in %%check From cce760d4acd37396d12d0db2fe1d3be461e8f160 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 11 Jul 2011 12:04:52 -0400 Subject: [PATCH 059/416] 3.2.1 3.2.1; refresh lib64 patch (102), subprocess unit test patch (129), disabling of static library build (due to Modules/_testembed; patch 6), autotool intermediates (patch 300) --- .gitignore | 1 + autotool-intermediates.patch | 3462 +---------------- ...subprocess-with-nonreadable-path-dir.patch | 12 + ...b2-lib64.patch => python-3.2.1-lib64.patch | 70 +- ....patch => python-3.2.1-no-static-lib.patch | 21 +- ...subprocess-with-nonreadable-path-dir.patch | 12 - python3.spec | 15 +- sources | 2 +- 8 files changed, 91 insertions(+), 3504 deletions(-) create mode 100644 python-3.2.1-fix-test-subprocess-with-nonreadable-path-dir.patch rename python-3.2b2-lib64.patch => python-3.2.1-lib64.patch (76%) rename python-3.2rc1-no-static-lib.patch => python-3.2.1-no-static-lib.patch (66%) delete mode 100644 python-3.2b2-fix-test-subprocess-with-nonreadable-path-dir.patch diff --git a/.gitignore b/.gitignore index 8883189..7844dc9 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ Python-3.2a1.tar.bz2 /Python-3.2rc2.tar.bz2 /Python-3.2rc3.tar.bz2 /Python-3.2.tar.bz2 +/Python-3.2.1.tar.bz2 diff --git a/autotool-intermediates.patch b/autotool-intermediates.patch index f1c15e0..4a265a0 100644 --- a/autotool-intermediates.patch +++ b/autotool-intermediates.patch @@ -1,100 +1,7 @@ diff -up ./configure.autotool-intermediates ./configure ---- ./configure.autotool-intermediates 2011-02-21 10:38:12.253957171 -0500 -+++ ./configure 2011-02-21 10:38:17.476956303 -0500 -@@ -1,14 +1,14 @@ - #! /bin/sh --# From configure.in Revision: 88430 . -+# From configure.in Revision: 88440 . - # Guess values for system-dependent variables and create Makefiles. --# Generated by GNU Autoconf 2.68 for python 3.2. -+# Generated by GNU Autoconf 2.65 for python 3.2. - # - # Report bugs to . - # - # - # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, --# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software --# Foundation, Inc. -+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -+# Inc. - # - # - # This configure script is free software; the Free Software Foundation -@@ -92,7 +92,6 @@ 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 -@@ -218,18 +217,11 @@ 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 -- 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+"$@"} -+ exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} - fi - - if test x$as_have_required = xno; then : -@@ -328,7 +320,7 @@ $as_echo X"$as_dir" | - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" -- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" -+ } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" - - - } # as_fn_mkdir_p -@@ -368,19 +360,19 @@ else - fi # as_fn_arith - - --# as_fn_error STATUS ERROR [LINENO LOG_FD] --# ---------------------------------------- -+# as_fn_error ERROR [LINENO LOG_FD] -+# --------------------------------- - # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are - # provided, also output the error to LOG_FD, referencing LINENO. Then exit the --# script with STATUS, using 1 if that was 0. -+# script with status $?, using 1 if that was 0. - as_fn_error () - { -- as_status=$1; test $as_status -eq 0 && as_status=1 -- if test "$4"; then -- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack -- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 -+ as_status=$?; test $as_status -eq 0 && as_status=1 -+ if test "$3"; then -+ as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack -+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 - fi -- $as_echo "$as_me: error: $2" >&2 -+ $as_echo "$as_me: error: $1" >&2 - as_fn_exit $as_status - } # as_fn_error - -@@ -542,7 +534,7 @@ test -n "$DJDIR" || exec 7<&0 &1 - - # Name of the host. --# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, -+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, - # so uname gets run too. - ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -@@ -619,6 +611,8 @@ TRUE +--- ./configure.autotool-intermediates 2011-07-11 11:50:06.910425999 -0400 ++++ ./configure 2011-07-11 11:50:13.492426001 -0400 +@@ -619,6 +619,8 @@ TRUE MACHDEP_OBJS DYNLOADFILE DLINCLDIR @@ -103,7 +10,7 @@ diff -up ./configure.autotool-intermediates ./configure THREADOBJ LDLAST USE_THREAD_MODULE -@@ -757,8 +751,11 @@ with_thread +@@ -764,8 +766,11 @@ with_thread enable_ipv6 with_doc_strings with_tsc @@ -115,155 +22,17 @@ diff -up ./configure.autotool-intermediates ./configure with_fpectl with_libm with_libc -@@ -837,9 +834,8 @@ do - fi - - case $ac_option in -- *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; -- *=) ac_optarg= ;; -- *) ac_optarg=yes ;; -+ *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; -+ *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. -@@ -884,7 +880,7 @@ do - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && -- as_fn_error $? "invalid feature name: $ac_useropt" -+ as_fn_error "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in -@@ -910,7 +906,7 @@ do - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && -- as_fn_error $? "invalid feature name: $ac_useropt" -+ as_fn_error "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in -@@ -1114,7 +1110,7 @@ do - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && -- as_fn_error $? "invalid package name: $ac_useropt" -+ as_fn_error "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in -@@ -1130,7 +1126,7 @@ do - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && -- as_fn_error $? "invalid package name: $ac_useropt" -+ as_fn_error "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in -@@ -1160,8 +1156,8 @@ do - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - -- -*) as_fn_error $? "unrecognized option: \`$ac_option' --Try \`$0 --help' for more information" -+ -*) as_fn_error "unrecognized option: \`$ac_option' -+Try \`$0 --help' for more information." - ;; - - *=*) -@@ -1169,7 +1165,7 @@ Try \`$0 --help' for more information" - # Reject names that are not valid shell variable names. - case $ac_envvar in #( - '' | [0-9]* | *[!_$as_cr_alnum]* ) -- as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; -+ as_fn_error "invalid variable name: \`$ac_envvar'" ;; - esac - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; -@@ -1179,7 +1175,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 -@@ -1187,13 +1183,13 @@ done - - if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` -- as_fn_error $? "missing argument to $ac_option" -+ as_fn_error "missing argument to $ac_option" - fi - - if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; -- fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; -+ fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac - fi -@@ -1216,7 +1212,7 @@ do - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac -- as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" -+ as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" - done - - # There might be people who depend on the old broken behavior: `$host' -@@ -1230,8 +1226,8 @@ target=$target_alias - if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe -- $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. -- If a cross compiler is detected then cross compile mode will be used" >&2 -+ $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. -+ If a cross compiler is detected then cross compile mode will be used." >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -@@ -1246,9 +1242,9 @@ test "$silent" = yes && exec 6>/dev/null - ac_pwd=`pwd` && test -n "$ac_pwd" && - ac_ls_di=`ls -di .` && - ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || -- as_fn_error $? "working directory cannot be determined" -+ as_fn_error "working directory cannot be determined" - test "X$ac_ls_di" = "X$ac_pwd_ls_di" || -- as_fn_error $? "pwd does not report name of working directory" -+ as_fn_error "pwd does not report name of working directory" +@@ -781,7 +786,8 @@ CFLAGS + LDFLAGS + LIBS + CPPFLAGS +-CPP' ++CPP ++CPPFLAGS' - # Find the source files, if location was not specified. -@@ -1287,11 +1283,11 @@ else - fi - if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." -- as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" -+ as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" - fi - ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" - ac_abs_confdir=`( -- cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" -+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" - pwd)` - # When building in place, set srcdir=. - if test "$ac_abs_confdir" = "$ac_pwd"; then -@@ -1331,7 +1327,7 @@ Configuration: - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit -- -q, --quiet, --silent do not print \`checking ...' messages -+ -q, --quiet, --silent do not print \`checking...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files -@@ -1430,8 +1426,11 @@ Optional Packages: + # Initialize some variables set by options. +@@ -1437,8 +1443,11 @@ Optional Packages: deprecated; use --with(out)-threads --with(out)-doc-strings disable/enable documentation strings --with(out)-tsc enable/disable timestamp counter profile @@ -275,1747 +44,7 @@ diff -up ./configure.autotool-intermediates ./configure --with-fpectl enable SIGFPE catching --with-libm=STRING math library --with-libc=STRING C library -@@ -1517,9 +1516,9 @@ test -n "$ac_init_help" && exit $ac_stat - if $ac_init_version; then - cat <<\_ACEOF - python configure 3.2 --generated by GNU Autoconf 2.68 -+generated by GNU Autoconf 2.65 - --Copyright (C) 2010 Free Software Foundation, Inc. -+Copyright (C) 2009 Free Software Foundation, Inc. - This configure script is free software; the Free Software Foundation - gives unlimited permission to copy, distribute and modify it. - _ACEOF -@@ -1563,7 +1562,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 - fi -- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval - - } # ac_fn_c_try_compile -@@ -1589,7 +1588,7 @@ $as_echo "$ac_try_echo"; } >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -- test $ac_status = 0; } > conftest.i && { -+ test $ac_status = 0; } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : -@@ -1600,7 +1599,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 - fi -- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval - - } # ac_fn_c_try_cpp -@@ -1613,10 +1612,10 @@ fi - ac_fn_c_check_header_mongrel () - { - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack -- if eval \${$3+:} false; then : -+ if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 - $as_echo_n "checking for $2... " >&6; } --if eval \${$3+:} false; then : -+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 - fi - eval ac_res=\$$3 -@@ -1652,7 +1651,7 @@ if ac_fn_c_try_cpp "$LINENO"; then : - else - ac_header_preproc=no - fi --rm -f conftest.err conftest.i conftest.$ac_ext -+rm -f conftest.err conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 - $as_echo "$ac_header_preproc" >&6; } - -@@ -1675,15 +1674,17 @@ $as_echo "$as_me: WARNING: $2: see the A - $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 - $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} --( $as_echo "## -------------------------------------- ## -+( cat <<\_ASBOX -+## -------------------------------------- ## - ## Report this to http://bugs.python.org/ ## --## -------------------------------------- ##" -+## -------------------------------------- ## -+_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 - $as_echo_n "checking for $2... " >&6; } --if eval \${$3+:} false; then : -+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 - else - eval "$3=\$ac_header_compiler" -@@ -1692,7 +1693,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; ${as_lineno_stack:+:} unset as_lineno -+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - - } # ac_fn_c_check_header_mongrel - -@@ -1733,7 +1734,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=$ac_status - fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo -- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval - - } # ac_fn_c_try_run -@@ -1747,7 +1748,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 \${$3+:} false; then : -+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -1765,7 +1766,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; ${as_lineno_stack:+:} unset as_lineno -+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - - } # ac_fn_c_check_header_compile - -@@ -1810,7 +1811,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; ${as_lineno_stack:+:} unset as_lineno -+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval - - } # ac_fn_c_try_link -@@ -1824,7 +1825,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 \${$3+:} false; then : -+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 - else - eval "$3=no" -@@ -1865,7 +1866,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; ${as_lineno_stack:+:} unset as_lineno -+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - - } # ac_fn_c_check_type - -@@ -1878,7 +1879,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 \${$3+:} false; then : -+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 - else - eval "$3=no" -@@ -1908,7 +1909,8 @@ if ac_fn_c_try_compile "$LINENO"; then : - esac - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -- if eval test \"x\$"$3"\" = x"no"; then : -+ eval as_val=\$$3 -+ if test "x$as_val" = x""no; then : - - else - break -@@ -1918,7 +1920,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; ${as_lineno_stack:+:} unset as_lineno -+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - - } # ac_fn_c_find_uintX_t - -@@ -1931,7 +1933,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 \${$3+:} false; then : -+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 - else - eval "$3=no" -@@ -1942,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 - - ; -@@ -1957,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 - -@@ -1982,7 +1984,8 @@ fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -- if eval test \"x\$"$3"\" = x"no"; then : -+ eval as_val=\$$3 -+ if test "x$as_val" = x""no; then : - - else - break -@@ -1992,7 +1995,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; ${as_lineno_stack:+:} unset as_lineno -+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - - } # ac_fn_c_find_intX_t - -@@ -2169,7 +2172,7 @@ rm -f core *.core core.conftest.* gmon.o - rm -f conftest.val - - fi -- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval - - } # ac_fn_c_compute_int -@@ -2182,7 +2185,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 \${$3+:} false; then : -+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -2237,7 +2240,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; ${as_lineno_stack:+:} unset as_lineno -+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - - } # ac_fn_c_check_func - -@@ -2250,7 +2253,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 \${$4+:} false; then : -+if { as_var=$4; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -2294,22 +2297,19 @@ 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; ${as_lineno_stack:+:} unset as_lineno -+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - - } # ac_fn_c_check_member - --# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES --# --------------------------------------------- --# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR --# accordingly. -+# ac_fn_c_check_decl LINENO SYMBOL VAR -+# ------------------------------------ -+# Tests whether SYMBOL is declared, setting cache variable VAR accordingly. - ac_fn_c_check_decl () - { - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack -- as_decl_name=`echo $2|sed 's/ *(.*//'` -- 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 \${$3+:} false; then : -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $2 is declared" >&5 -+$as_echo_n "checking whether $2 is declared... " >&6; } -+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -2318,12 +2318,8 @@ $4 - int - main () - { --#ifndef $as_decl_name --#ifdef __cplusplus -- (void) $as_decl_use; --#else -- (void) $as_decl_name; --#endif -+#ifndef $2 -+ (void) $2; - #endif - - ; -@@ -2340,7 +2336,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; ${as_lineno_stack:+:} unset as_lineno -+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - - } # ac_fn_c_check_decl - cat >config.log <<_ACEOF -@@ -2348,7 +2344,7 @@ This file contains any messages produced - running configure, to aid debugging if configure makes a mistake. - - It was created by python $as_me 3.2, which was --generated by GNU Autoconf 2.68. Invocation command line was -+generated by GNU Autoconf 2.65. Invocation command line was - - $ $0 $@ - -@@ -2458,9 +2454,11 @@ trap 'exit_status=$? - { - echo - -- $as_echo "## ---------------- ## -+ cat <<\_ASBOX -+## ---------------- ## - ## Cache variables. ## --## ---------------- ##" -+## ---------------- ## -+_ASBOX - echo - # The following way of writing the cache mishandles newlines in values, - ( -@@ -2494,9 +2492,11 @@ $as_echo "$as_me: WARNING: cache variabl - ) - echo - -- $as_echo "## ----------------- ## -+ cat <<\_ASBOX -+## ----------------- ## - ## Output variables. ## --## ----------------- ##" -+## ----------------- ## -+_ASBOX - echo - for ac_var in $ac_subst_vars - do -@@ -2509,9 +2509,11 @@ $as_echo "$as_me: WARNING: cache variabl - echo - - if test -n "$ac_subst_files"; then -- $as_echo "## ------------------- ## -+ cat <<\_ASBOX -+## ------------------- ## - ## File substitutions. ## --## ------------------- ##" -+## ------------------- ## -+_ASBOX - echo - for ac_var in $ac_subst_files - do -@@ -2525,9 +2527,11 @@ $as_echo "$as_me: WARNING: cache variabl - fi - - if test -s confdefs.h; then -- $as_echo "## ----------- ## -+ cat <<\_ASBOX -+## ----------- ## - ## confdefs.h. ## --## ----------- ##" -+## ----------- ## -+_ASBOX - echo - cat confdefs.h - echo -@@ -2582,12 +2586,7 @@ _ACEOF - ac_site_file1=NONE - ac_site_file2=NONE - if test -n "$CONFIG_SITE"; then -- # We do not want a PATH search for config.site. -- case $CONFIG_SITE in #(( -- -*) ac_site_file1=./$CONFIG_SITE;; -- */*) ac_site_file1=$CONFIG_SITE;; -- *) ac_site_file1=./$CONFIG_SITE;; -- esac -+ ac_site_file1=$CONFIG_SITE - elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -@@ -2602,11 +2601,7 @@ do - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 - $as_echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 -- . "$ac_site_file" \ -- || { { $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; } -+ . "$ac_site_file" - fi - done - -@@ -2682,7 +2677,7 @@ if $ac_cache_corrupted; then - $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 - $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} -- as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -+ as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 - fi - ## -------------------- ## - ## Main body of script. ## -@@ -2783,7 +2778,7 @@ if test "${enable_universalsdk+set}" = s - UNIVERSALSDK=$enableval - if test ! -d "${UNIVERSALSDK}" - then -- as_fn_error $? "--enable-universalsdk specifies non-existing SDK: ${UNIVERSALSDK}" "$LINENO" 5 -+ as_fn_error "--enable-universalsdk specifies non-existing SDK: ${UNIVERSALSDK}" "$LINENO" 5 - fi - ;; - esac -@@ -3175,7 +3170,7 @@ $as_echo "$without_gcc" >&6; } - # If the user switches compilers, we can't believe the cache - if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC" - then -- as_fn_error $? "cached CC is different -- throw away $cache_file -+ as_fn_error "cached CC is different -- throw away $cache_file - (it is also a good idea to do 'make clean' before compiling)" "$LINENO" 5 - fi - -@@ -3195,7 +3190,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 ${ac_cv_prog_CC+:} false; then : -+if test "${ac_cv_prog_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - if test -n "$CC"; then -@@ -3235,7 +3230,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 ${ac_cv_prog_ac_ct_CC+:} false; then : -+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - if test -n "$ac_ct_CC"; then -@@ -3288,7 +3283,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 ${ac_cv_prog_CC+:} false; then : -+if test "${ac_cv_prog_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - if test -n "$CC"; then -@@ -3328,7 +3323,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 ${ac_cv_prog_CC+:} false; then : -+if test "${ac_cv_prog_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - if test -n "$CC"; then -@@ -3387,7 +3382,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 ${ac_cv_prog_CC+:} false; then : -+if test "${ac_cv_prog_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - if test -n "$CC"; then -@@ -3431,7 +3426,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 ${ac_cv_prog_ac_ct_CC+:} false; then : -+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - if test -n "$ac_ct_CC"; then -@@ -3485,8 +3480,8 @@ 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; } -+as_fn_error "no acceptable C compiler found in \$PATH -+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 -@@ -3600,8 +3595,9 @@ 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; } -+{ as_fn_set_status 77 -+as_fn_error "C compiler cannot create executables -+See \`config.log' for more details." "$LINENO" 5; }; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 - $as_echo "yes" >&6; } -@@ -3643,8 +3639,8 @@ done - 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; } -+as_fn_error "cannot compute suffix of executables: cannot compile and link -+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 -@@ -3701,9 +3697,9 @@ $as_echo "$ac_try_echo"; } >&5 - 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 run C compiled programs. -+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 -@@ -3714,7 +3710,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 ${ac_cv_objext+:} false; then : -+if test "${ac_cv_objext+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -3754,8 +3750,8 @@ 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; } -+as_fn_error "cannot compute suffix of object files: cannot compile -+See \`config.log' for more details." "$LINENO" 5; } - fi - rm -f conftest.$ac_cv_objext conftest.$ac_ext - fi -@@ -3765,7 +3761,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 ${ac_cv_c_compiler_gnu+:} false; then : -+if test "${ac_cv_c_compiler_gnu+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -3802,7 +3798,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 ${ac_cv_prog_cc_g+:} false; then : -+if test "${ac_cv_prog_cc_g+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - ac_save_c_werror_flag=$ac_c_werror_flag -@@ -3880,7 +3876,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 ${ac_cv_prog_cc_c89+:} false; then : -+if test "${ac_cv_prog_cc_c89+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - ac_cv_prog_cc_c89=no -@@ -4015,7 +4011,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 ${ac_cv_path_CXX+:} false; then : -+if test "${ac_cv_path_CXX+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - case $CXX in -@@ -4056,7 +4052,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 ${ac_cv_path_CXX+:} false; then : -+if test "${ac_cv_path_CXX+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - case $CXX in -@@ -4107,7 +4103,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 ${ac_cv_prog_CXX+:} false; then : -+if test "${ac_cv_prog_CXX+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - if test -n "$CXX"; then -@@ -4178,7 +4174,7 @@ if test -n "$CPP" && test -d "$CPP"; the - CPP= - fi - if test -z "$CPP"; then -- if ${ac_cv_prog_CPP+:} false; then : -+ if test "${ac_cv_prog_CPP+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - # Double quotes because CPP needs to be expanded -@@ -4208,7 +4204,7 @@ else - # Broken: fails on valid input. - continue - fi --rm -f conftest.err conftest.i conftest.$ac_ext -+rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. -@@ -4224,11 +4220,11 @@ else - ac_preproc_ok=: - break - fi --rm -f conftest.err conftest.i conftest.$ac_ext -+rm -f conftest.err conftest.$ac_ext - - done - # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. --rm -f conftest.i conftest.err conftest.$ac_ext -+rm -f conftest.err conftest.$ac_ext - if $ac_preproc_ok; then : - break - fi -@@ -4267,7 +4263,7 @@ else - # Broken: fails on valid input. - continue - fi --rm -f conftest.err conftest.i conftest.$ac_ext -+rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. -@@ -4283,18 +4279,18 @@ else - ac_preproc_ok=: - break - fi --rm -f conftest.err conftest.i conftest.$ac_ext -+rm -f conftest.err conftest.$ac_ext - - done - # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. --rm -f conftest.i conftest.err conftest.$ac_ext -+rm -f conftest.err conftest.$ac_ext - if $ac_preproc_ok; then : - - 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; } -+as_fn_error "C preprocessor \"$CPP\" fails sanity check -+See \`config.log' for more details." "$LINENO" 5; } - fi - - ac_ext=c -@@ -4306,7 +4302,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 ${ac_cv_path_GREP+:} false; then : -+if test "${ac_cv_path_GREP+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - if test -z "$GREP"; then -@@ -4355,7 +4351,7 @@ esac - done - IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then -- as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 -+ as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi - else - ac_cv_path_GREP=$GREP -@@ -4369,7 +4365,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 ${ac_cv_path_EGREP+:} false; then : -+if test "${ac_cv_path_EGREP+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 -@@ -4421,7 +4417,7 @@ esac - done - IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then -- as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 -+ as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi - else - ac_cv_path_EGREP=$EGREP -@@ -4436,7 +4432,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 ${ac_cv_header_stdc+:} false; then : -+if test "${ac_cv_header_stdc+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -4553,7 +4549,8 @@ do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` - ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default - " --if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : -+eval as_val=\$$as_ac_Header -+ if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF - #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 - _ACEOF -@@ -4565,7 +4562,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" = xyes; then : -+if test "x$ac_cv_header_minix_config_h" = x""yes; then : - MINIX=yes - else - MINIX= -@@ -4587,7 +4584,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 ${ac_cv_safe_to_define___extensions__+:} false; then : -+if test "${ac_cv_safe_to_define___extensions__+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -4780,7 +4777,7 @@ $as_echo "$GNULD" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 - $as_echo_n "checking for inline... " >&6; } --if ${ac_cv_c_inline+:} false; then : -+if test "${ac_cv_c_inline+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - ac_cv_c_inline=no -@@ -4981,7 +4978,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 ${ac_cv_prog_RANLIB+:} false; then : -+if test "${ac_cv_prog_RANLIB+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - if test -n "$RANLIB"; then -@@ -5021,7 +5018,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 ${ac_cv_prog_ac_ct_RANLIB+:} false; then : -+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - if test -n "$ac_ct_RANLIB"; then -@@ -5075,7 +5072,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 ${ac_cv_prog_AR+:} false; then : -+if test "${ac_cv_prog_AR+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - if test -n "$AR"; then -@@ -5125,7 +5122,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 ${ac_cv_prog_SVNVERSION+:} false; then : -+if test "${ac_cv_prog_SVNVERSION+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - if test -n "$SVNVERSION"; then -@@ -5176,22 +5173,16 @@ bsdos*|hp*|HP*) - esac - ac_aux_dir= - for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do -- if test -f "$ac_dir/install-sh"; then -- ac_aux_dir=$ac_dir -- ac_install_sh="$ac_aux_dir/install-sh -c" -- break -- elif test -f "$ac_dir/install.sh"; then -- ac_aux_dir=$ac_dir -- ac_install_sh="$ac_aux_dir/install.sh -c" -- break -- elif test -f "$ac_dir/shtool"; then -- ac_aux_dir=$ac_dir -- ac_install_sh="$ac_aux_dir/shtool install -c" -- break -- fi -+ for ac_t in install-sh install.sh shtool; do -+ if test -f "$ac_dir/$ac_t"; then -+ ac_aux_dir=$ac_dir -+ ac_install_sh="$ac_aux_dir/$ac_t -c" -+ break 2 -+ fi -+ done - done - if test -z "$ac_aux_dir"; then -- as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 -+ as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 - fi - - # These three variables are undocumented and unsupported, -@@ -5220,7 +5211,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 ${ac_cv_path_install+:} false; then : -+if test "${ac_cv_path_install+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -@@ -5406,7 +5397,7 @@ $as_echo_n "checking whether $CC accepts - ac_save_cc="$CC" - CC="$CC -fno-strict-aliasing" - save_CFLAGS="$CFLAGS" -- if ${ac_cv_no_strict_aliasing+:} false; then : -+ if test "${ac_cv_no_strict_aliasing+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -5529,7 +5520,7 @@ $as_echo "$CC" >&6; } - ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc" - - else -- as_fn_error $? "proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way" "$LINENO" 5 -+ as_fn_error "proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way" "$LINENO" 5 - - fi - -@@ -5662,7 +5653,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 ${ac_cv_pthread_is_default+:} false; then : -+if test "${ac_cv_pthread_is_default+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - if test "$cross_compiling" = yes; then : -@@ -5715,7 +5706,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 ${ac_cv_kpthread+:} false; then : -+if test "${ac_cv_kpthread+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - ac_save_cc="$CC" -@@ -5764,7 +5755,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 ${ac_cv_kthread+:} false; then : -+if test "${ac_cv_kthread+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - ac_save_cc="$CC" -@@ -5813,7 +5804,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 ${ac_cv_thread+:} false; then : -+if test "${ac_cv_thread+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - ac_save_cc="$CC" -@@ -5898,7 +5889,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 ${ac_cv_header_stdc+:} false; then : -+if test "${ac_cv_header_stdc+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -6023,7 +6014,8 @@ bluetooth/bluetooth.h linux/tipc.h spawn - do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` - ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" --if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : -+eval as_val=\$$as_ac_Header -+ if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF - #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 - _ACEOF -@@ -6037,7 +6029,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 \${$as_ac_Header+:} false; then : -+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -6064,7 +6056,8 @@ fi - eval ac_res=\$$as_ac_Header - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 - $as_echo "$ac_res" >&6; } --if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : -+eval as_val=\$$as_ac_Header -+ if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF - #define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 - _ACEOF -@@ -6077,7 +6070,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 ${ac_cv_search_opendir+:} false; then : -+if test "${ac_cv_search_opendir+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - ac_func_search_save_LIBS=$LIBS -@@ -6111,11 +6104,11 @@ for ac_lib in '' dir; do - fi - rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext -- if ${ac_cv_search_opendir+:} false; then : -+ if test "${ac_cv_search_opendir+set}" = set; then : - break - fi - done --if ${ac_cv_search_opendir+:} false; then : -+if test "${ac_cv_search_opendir+set}" = set; then : - - else - ac_cv_search_opendir=no -@@ -6134,7 +6127,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 ${ac_cv_search_opendir+:} false; then : -+if test "${ac_cv_search_opendir+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - ac_func_search_save_LIBS=$LIBS -@@ -6168,11 +6161,11 @@ for ac_lib in '' x; do - fi - rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext -- if ${ac_cv_search_opendir+:} false; then : -+ if test "${ac_cv_search_opendir+set}" = set; then : - break - fi - done --if ${ac_cv_search_opendir+:} false; then : -+if test "${ac_cv_search_opendir+set}" = set; then : - - else - ac_cv_search_opendir=no -@@ -6192,7 +6185,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 ${ac_cv_header_sys_types_h_makedev+:} false; then : -+if test "${ac_cv_header_sys_types_h_makedev+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -6220,7 +6213,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" = xyes; then : -+if test "x$ac_cv_header_sys_mkdev_h" = x""yes; then : - - $as_echo "#define MAJOR_IN_MKDEV 1" >>confdefs.h - -@@ -6230,7 +6223,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" = xyes; then : -+if test "x$ac_cv_header_sys_sysmacros_h" = x""yes; then : - - $as_echo "#define MAJOR_IN_SYSMACROS 1" >>confdefs.h - -@@ -6250,7 +6243,7 @@ do : - #endif - - " --if test "x$ac_cv_header_term_h" = xyes; then : -+if test "x$ac_cv_header_term_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF - #define HAVE_TERM_H 1 - _ACEOF -@@ -6272,7 +6265,7 @@ do : - #endif - - " --if test "x$ac_cv_header_linux_netlink_h" = xyes; then : -+if test "x$ac_cv_header_linux_netlink_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF - #define HAVE_LINUX_NETLINK_H 1 - _ACEOF -@@ -6438,7 +6431,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" = xyes; then : -+if test "x$ac_cv_type_mode_t" = x""yes; then : - - else - -@@ -6449,7 +6442,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" = xyes; then : -+if test "x$ac_cv_type_off_t" = x""yes; then : - - else - -@@ -6460,7 +6453,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" = xyes; then : -+if test "x$ac_cv_type_pid_t" = x""yes; then : - - else - -@@ -6476,7 +6469,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" = xyes; then : -+if test "x$ac_cv_type_size_t" = x""yes; then : - - else - -@@ -6488,7 +6481,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 ${ac_cv_type_uid_t+:} false; then : -+if test "${ac_cv_type_uid_t+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -6567,7 +6560,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" = xyes; then : -+if test "x$ac_cv_type_ssize_t" = x""yes; then : - - $as_echo "#define HAVE_SSIZE_T 1" >>confdefs.h - -@@ -6582,7 +6575,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 ${ac_cv_sizeof_int+:} false; then : -+if test "${ac_cv_sizeof_int+set}" = set; 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 : -@@ -6591,8 +6584,9 @@ else - if test "$ac_cv_type_int" = yes; then - { { $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; } -+{ as_fn_set_status 77 -+as_fn_error "cannot compute sizeof (int) -+See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_int=0 - fi -@@ -6615,7 +6609,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 ${ac_cv_sizeof_long+:} false; then : -+if test "${ac_cv_sizeof_long+set}" = set; 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 : -@@ -6624,8 +6618,9 @@ else - if test "$ac_cv_type_long" = yes; then - { { $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; } -+{ as_fn_set_status 77 -+as_fn_error "cannot compute sizeof (long) -+See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_long=0 - fi -@@ -6648,7 +6643,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 ${ac_cv_sizeof_void_p+:} false; then : -+if test "${ac_cv_sizeof_void_p+set}" = set; 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 : -@@ -6657,8 +6652,9 @@ else - if test "$ac_cv_type_void_p" = yes; then - { { $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; } -+{ as_fn_set_status 77 -+as_fn_error "cannot compute sizeof (void *) -+See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_void_p=0 - fi -@@ -6681,7 +6677,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 ${ac_cv_sizeof_short+:} false; then : -+if test "${ac_cv_sizeof_short+set}" = set; 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 : -@@ -6690,8 +6686,9 @@ else - if test "$ac_cv_type_short" = yes; then - { { $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; } -+{ as_fn_set_status 77 -+as_fn_error "cannot compute sizeof (short) -+See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_short=0 - fi -@@ -6714,7 +6711,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 ${ac_cv_sizeof_float+:} false; then : -+if test "${ac_cv_sizeof_float+set}" = set; 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 : -@@ -6723,8 +6720,9 @@ else - if test "$ac_cv_type_float" = yes; then - { { $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; } -+{ as_fn_set_status 77 -+as_fn_error "cannot compute sizeof (float) -+See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_float=0 - fi -@@ -6747,7 +6745,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 ${ac_cv_sizeof_double+:} false; then : -+if test "${ac_cv_sizeof_double+set}" = set; 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 : -@@ -6756,8 +6754,9 @@ else - if test "$ac_cv_type_double" = yes; then - { { $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; } -+{ as_fn_set_status 77 -+as_fn_error "cannot compute sizeof (double) -+See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_double=0 - fi -@@ -6780,7 +6779,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 ${ac_cv_sizeof_fpos_t+:} false; then : -+if test "${ac_cv_sizeof_fpos_t+set}" = set; 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 : -@@ -6789,8 +6788,9 @@ else - if test "$ac_cv_type_fpos_t" = yes; then - { { $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; } -+{ as_fn_set_status 77 -+as_fn_error "cannot compute sizeof (fpos_t) -+See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_fpos_t=0 - fi -@@ -6813,7 +6813,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 ${ac_cv_sizeof_size_t+:} false; then : -+if test "${ac_cv_sizeof_size_t+set}" = set; 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 : -@@ -6822,8 +6822,9 @@ else - if test "$ac_cv_type_size_t" = yes; then - { { $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; } -+{ as_fn_set_status 77 -+as_fn_error "cannot compute sizeof (size_t) -+See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_size_t=0 - fi -@@ -6846,7 +6847,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 ${ac_cv_sizeof_pid_t+:} false; then : -+if test "${ac_cv_sizeof_pid_t+set}" = set; 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 : -@@ -6855,8 +6856,9 @@ else - if test "$ac_cv_type_pid_t" = yes; then - { { $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; } -+{ as_fn_set_status 77 -+as_fn_error "cannot compute sizeof (pid_t) -+See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_pid_t=0 - fi -@@ -6906,7 +6908,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 ${ac_cv_sizeof_long_long+:} false; then : -+if test "${ac_cv_sizeof_long_long+set}" = set; 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 : -@@ -6915,8 +6917,9 @@ else - if test "$ac_cv_type_long_long" = yes; then - { { $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; } -+{ as_fn_set_status 77 -+as_fn_error "cannot compute sizeof (long long) -+See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_long_long=0 - fi -@@ -6967,7 +6970,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 ${ac_cv_sizeof_long_double+:} false; then : -+if test "${ac_cv_sizeof_long_double+set}" = set; 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 : -@@ -6976,8 +6979,9 @@ else - if test "$ac_cv_type_long_double" = yes; then - { { $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; } -+{ as_fn_set_status 77 -+as_fn_error "cannot compute sizeof (long double) -+See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_long_double=0 - fi -@@ -7029,7 +7033,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 ${ac_cv_sizeof__Bool+:} false; then : -+if test "${ac_cv_sizeof__Bool+set}" = set; 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 : -@@ -7038,8 +7042,9 @@ else - if test "$ac_cv_type__Bool" = yes; then - { { $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; } -+{ as_fn_set_status 77 -+as_fn_error "cannot compute sizeof (_Bool) -+See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof__Bool=0 - fi -@@ -7065,7 +7070,7 @@ ac_fn_c_check_type "$LINENO" "uintptr_t" - #include - #endif - " --if test "x$ac_cv_type_uintptr_t" = xyes; then : -+if test "x$ac_cv_type_uintptr_t" = x""yes; then : - - cat >>confdefs.h <<_ACEOF - #define HAVE_UINTPTR_T 1 -@@ -7077,7 +7082,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 ${ac_cv_sizeof_uintptr_t+:} false; then : -+if test "${ac_cv_sizeof_uintptr_t+set}" = set; 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 : -@@ -7086,8 +7091,9 @@ else - if test "$ac_cv_type_uintptr_t" = yes; then - { { $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; } -+{ as_fn_set_status 77 -+as_fn_error "cannot compute sizeof (uintptr_t) -+See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_uintptr_t=0 - fi -@@ -7113,7 +7119,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 ${ac_cv_sizeof_off_t+:} false; then : -+if test "${ac_cv_sizeof_off_t+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" " -@@ -7127,8 +7133,9 @@ else - if test "$ac_cv_type_off_t" = yes; then - { { $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; } -+{ as_fn_set_status 77 -+as_fn_error "cannot compute sizeof (off_t) -+See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_off_t=0 - fi -@@ -7172,7 +7179,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 ${ac_cv_sizeof_time_t+:} false; then : -+if test "${ac_cv_sizeof_time_t+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (time_t))" "ac_cv_sizeof_time_t" " -@@ -7189,8 +7196,9 @@ else - if test "$ac_cv_type_time_t" = yes; then - { { $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; } -+{ as_fn_set_status 77 -+as_fn_error "cannot compute sizeof (time_t) -+See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_time_t=0 - fi -@@ -7247,7 +7255,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 ${ac_cv_sizeof_pthread_t+:} false; then : -+if test "${ac_cv_sizeof_pthread_t+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pthread_t))" "ac_cv_sizeof_pthread_t" " -@@ -7261,8 +7269,9 @@ else - if test "$ac_cv_type_pthread_t" = yes; then - { { $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; } -+{ as_fn_set_status 77 -+as_fn_error "cannot compute sizeof (pthread_t) -+See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_pthread_t=0 - fi -@@ -7349,7 +7358,7 @@ fi - MACOSX_DEFAULT_ARCH="ppc" - ;; - *) -- as_fn_error $? "Unexpected output of 'arch' on OSX" "$LINENO" 5 -+ as_fn_error "Unexpected output of 'arch' on OSX" "$LINENO" 5 - ;; - esac - else -@@ -7361,7 +7370,7 @@ fi - MACOSX_DEFAULT_ARCH="ppc64" - ;; - *) -- as_fn_error $? "Unexpected output of 'arch' on OSX" "$LINENO" 5 -+ as_fn_error "Unexpected output of 'arch' on OSX" "$LINENO" 5 - ;; - esac - -@@ -7387,7 +7396,7 @@ $as_echo "#define WITH_NEXT_FRAMEWORK 1" - $as_echo "yes" >&6; } - if test $enable_shared = "yes" - then -- as_fn_error $? "Specifying both --enable-shared and --enable-framework is not supported, use only --enable-framework instead" "$LINENO" 5 -+ as_fn_error "Specifying both --enable-shared and --enable-framework is not supported, use only --enable-framework instead" "$LINENO" 5 - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -@@ -7694,7 +7703,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 ${ac_cv_lib_dl_dlopen+:} false; then : -+if test "${ac_cv_lib_dl_dlopen+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS -@@ -7728,7 +7737,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" = xyes; then : -+if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : - cat >>confdefs.h <<_ACEOF - #define HAVE_LIBDL 1 - _ACEOF -@@ -7739,7 +7748,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 ${ac_cv_lib_dld_shl_load+:} false; then : -+if test "${ac_cv_lib_dld_shl_load+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS -@@ -7773,7 +7782,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" = xyes; then : -+if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : - cat >>confdefs.h <<_ACEOF - #define HAVE_LIBDLD 1 - _ACEOF -@@ -7787,7 +7796,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 ${ac_cv_search_sem_init+:} false; then : -+if test "${ac_cv_search_sem_init+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - ac_func_search_save_LIBS=$LIBS -@@ -7821,11 +7830,11 @@ for ac_lib in '' pthread rt posix4; do - fi - rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext -- if ${ac_cv_search_sem_init+:} false; then : -+ if test "${ac_cv_search_sem_init+set}" = set; then : - break - fi - done --if ${ac_cv_search_sem_init+:} false; then : -+if test "${ac_cv_search_sem_init+set}" = set; then : - - else - ac_cv_search_sem_init=no -@@ -7848,7 +7857,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 ${ac_cv_lib_intl_textdomain+:} false; then : -+if test "${ac_cv_lib_intl_textdomain+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS -@@ -7882,7 +7891,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" = xyes; then : -+if test "x$ac_cv_lib_intl_textdomain" = x""yes; then : - - $as_echo "#define WITH_LIBINTL 1" >>confdefs.h - -@@ -7929,7 +7938,7 @@ esac - # Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl. - { $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 ${ac_cv_lib_nsl_t_open+:} false; then : -+if test "${ac_cv_lib_nsl_t_open+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS -@@ -7963,13 +7972,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" = xyes; then : -+if test "x$ac_cv_lib_nsl_t_open" = x""yes; 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 ${ac_cv_lib_socket_socket+:} false; then : -+if test "${ac_cv_lib_socket_socket+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS -@@ -8003,7 +8012,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" = xyes; then : -+if test "x$ac_cv_lib_socket_socket" = x""yes; then : - LIBS="-lsocket $LIBS" - fi - # SVR4 sockets -@@ -8029,7 +8038,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 ${ac_cv_path_PKG_CONFIG+:} false; then : -+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - case $PKG_CONFIG in -@@ -8072,7 +8081,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 ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : -+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - case $ac_pt_PKG_CONFIG in -@@ -8183,12 +8192,12 @@ if test "${with_dbmliborder+set}" = set; - withval=$with_dbmliborder; - if test x$with_dbmliborder = xyes - then --as_fn_error $? "proper usage is --with-dbmliborder=db1:db2:..." "$LINENO" 5 -+as_fn_error "proper usage is --with-dbmliborder=db1:db2:..." "$LINENO" 5 - else - for db in `echo $with_dbmliborder | sed 's/:/ /g'`; do - if test x$db != xndbm && test x$db != xgdbm && test x$db != xbdb - then -- as_fn_error $? "proper usage is --with-dbmliborder=db1:db2:..." "$LINENO" 5 -+ as_fn_error "proper usage is --with-dbmliborder=db1:db2:..." "$LINENO" 5 - fi - done - fi -@@ -8354,7 +8363,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" = xyes; then : -+if test "x$ac_cv_header_cthreads_h" = x""yes; then : - $as_echo "#define WITH_THREAD 1" >>confdefs.h - - $as_echo "#define C_THREADS 1" >>confdefs.h -@@ -8367,7 +8376,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" = xyes; then : -+if test "x$ac_cv_header_mach_cthreads_h" = x""yes; then : - $as_echo "#define WITH_THREAD 1" >>confdefs.h - - $as_echo "#define C_THREADS 1" >>confdefs.h -@@ -8411,7 +8420,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" = xyes; then : -+if test "x$ac_cv_func_pthread_detach" = x""yes; then : - $as_echo "#define WITH_THREAD 1" >>confdefs.h - - posix_threads=yes -@@ -8420,7 +8429,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 ${ac_cv_lib_pthreads_pthread_create+:} false; then : -+if test "${ac_cv_lib_pthreads_pthread_create+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS -@@ -8454,7 +8463,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" = xyes; then : -+if test "x$ac_cv_lib_pthreads_pthread_create" = x""yes; then : - $as_echo "#define WITH_THREAD 1" >>confdefs.h - - posix_threads=yes -@@ -8464,7 +8473,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 ${ac_cv_lib_c_r_pthread_create+:} false; then : -+if test "${ac_cv_lib_c_r_pthread_create+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS -@@ -8498,7 +8507,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" = xyes; then : -+if test "x$ac_cv_lib_c_r_pthread_create" = x""yes; then : - $as_echo "#define WITH_THREAD 1" >>confdefs.h - - posix_threads=yes -@@ -8508,7 +8517,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 ${ac_cv_lib_pthread___pthread_create_system+:} false; then : -+if test "${ac_cv_lib_pthread___pthread_create_system+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS -@@ -8542,7 +8551,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" = xyes; then : -+if test "x$ac_cv_lib_pthread___pthread_create_system" = x""yes; then : - $as_echo "#define WITH_THREAD 1" >>confdefs.h - - posix_threads=yes -@@ -8552,7 +8561,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 ${ac_cv_lib_cma_pthread_create+:} false; then : -+if test "${ac_cv_lib_cma_pthread_create+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS -@@ -8586,7 +8595,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" = xyes; then : -+if test "x$ac_cv_lib_cma_pthread_create" = x""yes; then : - $as_echo "#define WITH_THREAD 1" >>confdefs.h - - posix_threads=yes -@@ -8618,7 +8627,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 ${ac_cv_lib_mpc_usconfig+:} false; then : -+if test "${ac_cv_lib_mpc_usconfig+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS -@@ -8652,7 +8661,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" = xyes; then : -+if test "x$ac_cv_lib_mpc_usconfig" = x""yes; then : - $as_echo "#define WITH_THREAD 1" >>confdefs.h - - LIBS="$LIBS -lmpc" -@@ -8664,7 +8673,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 ${ac_cv_lib_thread_thr_create+:} false; then : -+if test "${ac_cv_lib_thread_thr_create+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS -@@ -8698,7 +8707,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" = xyes; then : -+if test "x$ac_cv_lib_thread_thr_create" = x""yes; then : - $as_echo "#define WITH_THREAD 1" >>confdefs.h - - LIBS="$LIBS -lthread" -@@ -8747,7 +8756,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 ${ac_cv_pthread_system_supported+:} false; then : -+ if test "${ac_cv_pthread_system_supported+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - if test "$cross_compiling" = yes; then : -@@ -8790,7 +8799,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" = xyes; then : -+if test "x$ac_cv_func_pthread_sigmask" = x""yes; then : - cat >>confdefs.h <<_ACEOF - #define HAVE_PTHREAD_SIGMASK 1 - _ACEOF -@@ -9143,6 +9152,50 @@ $as_echo "no" >&6; } +@@ -9284,6 +9293,50 @@ $as_echo "no" >&6; } fi @@ -2066,22 +95,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; } -@@ -9182,12 +9235,12 @@ 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" = xyes; then : -+if test "x$ac_cv_header_valgrind_valgrind_h" = x""yes; then : - - $as_echo "#define WITH_VALGRIND 1" >>confdefs.h - - else -- as_fn_error $? "Valgrind support requested but headers not available" "$LINENO" 5 -+ as_fn_error "Valgrind support requested but headers not available" "$LINENO" 5 - - fi - -@@ -9195,6 +9248,46 @@ fi +@@ -9336,6 +9389,46 @@ fi OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT" fi @@ -2128,1441 +142,9 @@ diff -up ./configure.autotool-intermediates ./configure # -I${DLINCLDIR} is added to the compile rule for importdl.o DLINCLDIR=. -@@ -9204,7 +9297,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" = xyes; then : -+if test "x$ac_cv_func_dlopen" = x""yes; then : - cat >>confdefs.h <<_ACEOF - #define HAVE_DLOPEN 1 - _ACEOF -@@ -9281,7 +9374,8 @@ for ac_func in alarm accept4 setitimer g - do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` - ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" --if eval test \"x\$"$as_ac_var"\" = x"yes"; then : -+eval as_val=\$$as_ac_var -+ if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF - #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 - _ACEOF -@@ -9531,7 +9625,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 ${ac_cv_flock_decl+:} false; then : -+if test "${ac_cv_flock_decl+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -9561,7 +9655,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" = xyes; then : -+if test "x$ac_cv_func_flock" = x""yes; then : - cat >>confdefs.h <<_ACEOF - #define HAVE_FLOCK 1 - _ACEOF -@@ -9569,7 +9663,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 ${ac_cv_lib_bsd_flock+:} false; then : -+if test "${ac_cv_lib_bsd_flock+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS -@@ -9603,7 +9697,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" = xyes; then : -+if test "x$ac_cv_lib_bsd_flock" = x""yes; then : - $as_echo "#define HAVE_FLOCK 1" >>confdefs.h - - -@@ -9652,7 +9746,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 ${ac_cv_prog_TRUE+:} false; then : -+if test "${ac_cv_prog_TRUE+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - if test -n "$TRUE"; then -@@ -9692,7 +9786,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 ${ac_cv_lib_c_inet_aton+:} false; then : -+if test "${ac_cv_lib_c_inet_aton+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS -@@ -9726,12 +9820,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" = xyes; then : -+if test "x$ac_cv_lib_c_inet_aton" = x""yes; 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 ${ac_cv_lib_resolv_inet_aton+:} false; then : -+if test "${ac_cv_lib_resolv_inet_aton+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS -@@ -9765,7 +9859,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" = xyes; then : -+if test "x$ac_cv_lib_resolv_inet_aton" = x""yes; then : - cat >>confdefs.h <<_ACEOF - #define HAVE_LIBRESOLV 1 - _ACEOF -@@ -9782,7 +9876,7 @@ fi - # exit Python - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for chflags" >&5 - $as_echo_n "checking for chflags... " >&6; } --if ${ac_cv_have_chflags+:} false; then : -+if test "${ac_cv_have_chflags+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - if test "$cross_compiling" = yes; then : -@@ -9816,7 +9910,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" = xyes; then : -+if test "x$ac_cv_func_chflags" = x""yes; then : - ac_cv_have_chflags="yes" - else - ac_cv_have_chflags="no" -@@ -9831,7 +9925,7 @@ fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lchflags" >&5 - $as_echo_n "checking for lchflags... " >&6; } --if ${ac_cv_have_lchflags+:} false; then : -+if test "${ac_cv_have_lchflags+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - if test "$cross_compiling" = yes; then : -@@ -9865,7 +9959,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" = xyes; then : -+if test "x$ac_cv_func_lchflags" = x""yes; then : - ac_cv_have_lchflags="yes" - else - ac_cv_have_lchflags="no" -@@ -9889,7 +9983,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 ${ac_cv_lib_z_inflateCopy+:} false; then : -+if test "${ac_cv_lib_z_inflateCopy+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS -@@ -9923,7 +10017,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" = xyes; then : -+if test "x$ac_cv_lib_z_inflateCopy" = x""yes; then : - - $as_echo "#define HAVE_ZLIB_COPY 1" >>confdefs.h - -@@ -10066,7 +10160,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" = xyes; then : -+if test "x$ac_cv_func_openpty" = x""yes; then : - cat >>confdefs.h <<_ACEOF - #define HAVE_OPENPTY 1 - _ACEOF -@@ -10074,7 +10168,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 ${ac_cv_lib_util_openpty+:} false; then : -+if test "${ac_cv_lib_util_openpty+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS -@@ -10108,13 +10202,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" = xyes; then : -+if test "x$ac_cv_lib_util_openpty" = x""yes; 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 ${ac_cv_lib_bsd_openpty+:} false; then : -+if test "${ac_cv_lib_bsd_openpty+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS -@@ -10148,7 +10242,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" = xyes; then : -+if test "x$ac_cv_lib_bsd_openpty" = x""yes; then : - $as_echo "#define HAVE_OPENPTY 1" >>confdefs.h - LIBS="$LIBS -lbsd" - fi -@@ -10163,7 +10257,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" = xyes; then : -+if test "x$ac_cv_func_forkpty" = x""yes; then : - cat >>confdefs.h <<_ACEOF - #define HAVE_FORKPTY 1 - _ACEOF -@@ -10171,7 +10265,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 ${ac_cv_lib_util_forkpty+:} false; then : -+if test "${ac_cv_lib_util_forkpty+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS -@@ -10205,13 +10299,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" = xyes; then : -+if test "x$ac_cv_lib_util_forkpty" = x""yes; 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 ${ac_cv_lib_bsd_forkpty+:} false; then : -+if test "${ac_cv_lib_bsd_forkpty+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS -@@ -10245,7 +10339,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" = xyes; then : -+if test "x$ac_cv_lib_bsd_forkpty" = x""yes; then : - $as_echo "#define HAVE_FORKPTY 1" >>confdefs.h - LIBS="$LIBS -lbsd" - fi -@@ -10262,7 +10356,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" = xyes; then : -+if test "x$ac_cv_func_memmove" = x""yes; then : - cat >>confdefs.h <<_ACEOF - #define HAVE_MEMMOVE 1 - _ACEOF -@@ -10276,7 +10370,8 @@ for ac_func in fseek64 fseeko fstatvfs f - do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` - ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" --if eval test \"x\$"$as_ac_var"\" = x"yes"; then : -+eval as_val=\$$as_ac_var -+ if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF - #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 - _ACEOF -@@ -10285,50 +10380,31 @@ fi - done - - --ac_fn_c_check_func "$LINENO" "dup2" "ac_cv_func_dup2" --if test "x$ac_cv_func_dup2" = xyes; then : -- $as_echo "#define HAVE_DUP2 1" >>confdefs.h -- --else -- case " $LIBOBJS " in -- *" dup2.$ac_objext "* ) ;; -- *) LIBOBJS="$LIBOBJS dup2.$ac_objext" -- ;; --esac -- --fi -- --ac_fn_c_check_func "$LINENO" "getcwd" "ac_cv_func_getcwd" --if test "x$ac_cv_func_getcwd" = xyes; then : -- $as_echo "#define HAVE_GETCWD 1" >>confdefs.h -- --else -- case " $LIBOBJS " in -- *" getcwd.$ac_objext "* ) ;; -- *) LIBOBJS="$LIBOBJS getcwd.$ac_objext" -- ;; --esac -- --fi -- --ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup" --if test "x$ac_cv_func_strdup" = xyes; then : -- $as_echo "#define HAVE_STRDUP 1" >>confdefs.h -+for ac_func in dup2 getcwd strdup -+do : -+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -+eval as_val=\$$as_ac_var -+ if test "x$as_val" = x""yes; then : -+ cat >>confdefs.h <<_ACEOF -+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -+_ACEOF - - else - case " $LIBOBJS " in -- *" strdup.$ac_objext "* ) ;; -- *) LIBOBJS="$LIBOBJS strdup.$ac_objext" -+ *" $ac_func.$ac_objext "* ) ;; -+ *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" - ;; - esac - - fi -+done - - - for ac_func in getpgrp - do : - ac_fn_c_check_func "$LINENO" "getpgrp" "ac_cv_func_getpgrp" --if test "x$ac_cv_func_getpgrp" = xyes; then : -+if test "x$ac_cv_func_getpgrp" = x""yes; then : - cat >>confdefs.h <<_ACEOF - #define HAVE_GETPGRP 1 - _ACEOF -@@ -10356,7 +10432,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" = xyes; then : -+if test "x$ac_cv_func_setpgrp" = x""yes; then : - cat >>confdefs.h <<_ACEOF - #define HAVE_SETPGRP 1 - _ACEOF -@@ -10384,7 +10460,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" = xyes; then : -+if test "x$ac_cv_func_gettimeofday" = x""yes; then : - cat >>confdefs.h <<_ACEOF - #define HAVE_GETTIMEOFDAY 1 - _ACEOF -@@ -10486,7 +10562,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 ${ac_cv_buggy_getaddrinfo+:} false; then : -+ if test "${ac_cv_buggy_getaddrinfo+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - if test "$cross_compiling" = yes; then : -@@ -10615,7 +10691,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" = xyes; then : -+if test "x$ac_cv_func_getnameinfo" = x""yes; then : - cat >>confdefs.h <<_ACEOF - #define HAVE_GETNAMEINFO 1 - _ACEOF -@@ -10627,7 +10703,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 ${ac_cv_header_time+:} false; then : -+if test "${ac_cv_header_time+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -10662,7 +10738,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 ${ac_cv_struct_tm+:} false; then : -+if test "${ac_cv_struct_tm+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -10699,7 +10775,7 @@ ac_fn_c_check_member "$LINENO" "struct t - #include <$ac_cv_struct_tm> - - " --if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then : -+if test "x$ac_cv_member_struct_tm_tm_zone" = x""yes; then : - - cat >>confdefs.h <<_ACEOF - #define HAVE_STRUCT_TM_TM_ZONE 1 -@@ -10715,7 +10791,7 @@ $as_echo "#define HAVE_TM_ZONE 1" >>conf - else - ac_fn_c_check_decl "$LINENO" "tzname" "ac_cv_have_decl_tzname" "#include - " --if test "x$ac_cv_have_decl_tzname" = xyes; then : -+if test "x$ac_cv_have_decl_tzname" = x""yes; then : - ac_have_decl=1 - else - ac_have_decl=0 -@@ -10727,7 +10803,7 @@ _ACEOF - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5 - $as_echo_n "checking for tzname... " >&6; } --if ${ac_cv_var_tzname+:} false; then : -+if test "${ac_cv_var_tzname+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -10763,7 +10839,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" = xyes; then : -+if test "x$ac_cv_member_struct_stat_st_rdev" = x""yes; then : - - cat >>confdefs.h <<_ACEOF - #define HAVE_STRUCT_STAT_ST_RDEV 1 -@@ -10773,7 +10849,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" = xyes; then : -+if test "x$ac_cv_member_struct_stat_st_blksize" = x""yes; then : - - cat >>confdefs.h <<_ACEOF - #define HAVE_STRUCT_STAT_ST_BLKSIZE 1 -@@ -10783,7 +10859,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" = xyes; then : -+if test "x$ac_cv_member_struct_stat_st_flags" = x""yes; then : - - cat >>confdefs.h <<_ACEOF - #define HAVE_STRUCT_STAT_ST_FLAGS 1 -@@ -10793,7 +10869,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" = xyes; then : -+if test "x$ac_cv_member_struct_stat_st_gen" = x""yes; then : - - cat >>confdefs.h <<_ACEOF - #define HAVE_STRUCT_STAT_ST_GEN 1 -@@ -10803,7 +10879,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" = xyes; then : -+if test "x$ac_cv_member_struct_stat_st_birthtime" = x""yes; then : - - cat >>confdefs.h <<_ACEOF - #define HAVE_STRUCT_STAT_ST_BIRTHTIME 1 -@@ -10813,7 +10889,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" = xyes; then : -+if test "x$ac_cv_member_struct_stat_st_blocks" = x""yes; then : - - cat >>confdefs.h <<_ACEOF - #define HAVE_STRUCT_STAT_ST_BLOCKS 1 -@@ -10835,7 +10911,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 ${ac_cv_header_time_altzone+:} false; then : -+if test "${ac_cv_header_time_altzone+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - -@@ -10899,7 +10975,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 ${ac_cv_struct_addrinfo+:} false; then : -+if test "${ac_cv_struct_addrinfo+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -10931,7 +11007,7 @@ fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_storage" >&5 - $as_echo_n "checking for sockaddr_storage... " >&6; } --if ${ac_cv_struct_sockaddr_storage+:} false; then : -+if test "${ac_cv_struct_sockaddr_storage+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -10967,7 +11043,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 ${ac_cv_c_char_unsigned+:} false; then : -+if test "${ac_cv_c_char_unsigned+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -10999,7 +11075,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 ${ac_cv_c_const+:} false; then : -+if test "${ac_cv_c_const+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -11287,7 +11363,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" = xyes; then : -+if test "x$ac_cv_func_gethostbyname_r" = x""yes; then : - - $as_echo "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h - -@@ -11418,7 +11494,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" = xyes; then : -+if test "x$ac_cv_func_gethostbyname" = x""yes; then : - cat >>confdefs.h <<_ACEOF - #define HAVE_GETHOSTBYNAME 1 - _ACEOF -@@ -11440,12 +11516,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" = xyes; then : -+if test "x$ac_cv_func___fpu_control" = x""yes; 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 ${ac_cv_lib_ieee___fpu_control+:} false; then : -+if test "${ac_cv_lib_ieee___fpu_control+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS -@@ -11479,7 +11555,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" = xyes; then : -+if test "x$ac_cv_lib_ieee___fpu_control" = x""yes; then : - cat >>confdefs.h <<_ACEOF - #define HAVE_LIBIEEE 1 - _ACEOF -@@ -11535,7 +11611,7 @@ elif test "$withval" != yes - then LIBM=$withval - { $as_echo "$as_me:${as_lineno-$LINENO}: result: set LIBM=\"$withval\"" >&5 - $as_echo "set LIBM=\"$withval\"" >&6; } --else as_fn_error $? "proper usage is --with-libm=STRING" "$LINENO" 5 -+else as_fn_error "proper usage is --with-libm=STRING" "$LINENO" 5 - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: default LIBM=\"$LIBM\"" >&5 -@@ -11559,7 +11635,7 @@ elif test "$withval" != yes - then LIBC=$withval - { $as_echo "$as_me:${as_lineno-$LINENO}: result: set LIBC=\"$withval\"" >&5 - $as_echo "set LIBC=\"$withval\"" >&6; } --else as_fn_error $? "proper usage is --with-libc=STRING" "$LINENO" 5 -+else as_fn_error "proper usage is --with-libc=STRING" "$LINENO" 5 - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: default LIBC=\"$LIBC\"" >&5 -@@ -11573,7 +11649,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 ${ac_cv_little_endian_double+:} false; then : -+if test "${ac_cv_little_endian_double+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - -@@ -11615,7 +11691,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 ${ac_cv_big_endian_double+:} false; then : -+if test "${ac_cv_big_endian_double+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - -@@ -11661,7 +11737,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 ${ac_cv_mixed_endian_double+:} false; then : -+if test "${ac_cv_mixed_endian_double+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - -@@ -11809,7 +11885,8 @@ for ac_func in acosh asinh atanh copysig - do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` - ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" --if eval test \"x\$"$as_ac_var"\" = x"yes"; then : -+eval as_val=\$$as_ac_var -+ if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF - #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 - _ACEOF -@@ -11821,7 +11898,8 @@ for ac_func in hypot lgamma log1p round - do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` - ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" --if eval test \"x\$"$as_ac_var"\" = x"yes"; then : -+eval as_val=\$$as_ac_var -+ if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF - #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 - _ACEOF -@@ -11831,7 +11909,7 @@ done - - ac_fn_c_check_decl "$LINENO" "isinf" "ac_cv_have_decl_isinf" "#include - " --if test "x$ac_cv_have_decl_isinf" = xyes; then : -+if test "x$ac_cv_have_decl_isinf" = x""yes; then : - ac_have_decl=1 - else - ac_have_decl=0 -@@ -11842,7 +11920,7 @@ cat >>confdefs.h <<_ACEOF - _ACEOF - ac_fn_c_check_decl "$LINENO" "isnan" "ac_cv_have_decl_isnan" "#include - " --if test "x$ac_cv_have_decl_isnan" = xyes; then : -+if test "x$ac_cv_have_decl_isnan" = x""yes; then : - ac_have_decl=1 - else - ac_have_decl=0 -@@ -11853,7 +11931,7 @@ cat >>confdefs.h <<_ACEOF - _ACEOF - ac_fn_c_check_decl "$LINENO" "isfinite" "ac_cv_have_decl_isfinite" "#include - " --if test "x$ac_cv_have_decl_isfinite" = xyes; then : -+if test "x$ac_cv_have_decl_isfinite" = x""yes; then : - ac_have_decl=1 - else - ac_have_decl=0 -@@ -11868,7 +11946,7 @@ _ACEOF - # -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 ${ac_cv_tanh_preserves_zero_sign+:} false; then : -+if test "${ac_cv_tanh_preserves_zero_sign+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - -@@ -11916,7 +11994,7 @@ then - # -0. See issue #9920. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether log1p drops the sign of negative zero" >&5 - $as_echo_n "checking whether log1p drops the sign of negative zero... " >&6; } -- if ${ac_cv_log1p_drops_zero_sign+:} false; then : -+ if test "${ac_cv_log1p_drops_zero_sign+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - -@@ -11968,7 +12046,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 ${ac_cv_posix_semaphores_enabled+:} false; then : -+if test "${ac_cv_posix_semaphores_enabled+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - if test "$cross_compiling" = yes; then : -@@ -12019,7 +12097,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 ${ac_cv_broken_sem_getvalue+:} false; then : -+if test "${ac_cv_broken_sem_getvalue+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - if test "$cross_compiling" = yes; then : -@@ -12084,7 +12162,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; } -@@ -12102,7 +12180,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" = xyes; then : -+if test "x$ac_cv_header_wchar_h" = x""yes; then : - - - $as_echo "#define HAVE_WCHAR_H 1" >>confdefs.h -@@ -12125,7 +12203,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 ${ac_cv_sizeof_wchar_t+:} false; then : -+if test "${ac_cv_sizeof_wchar_t+set}" = set; 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 -@@ -12135,8 +12213,9 @@ else - if test "$ac_cv_type_wchar_t" = yes; then - { { $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; } -+{ as_fn_set_status 77 -+as_fn_error "cannot compute sizeof (wchar_t) -+See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_wchar_t=0 - fi -@@ -12191,7 +12270,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 ${ac_cv_wchar_t_signed+:} false; then : -+ if test "${ac_cv_wchar_t_signed+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - -@@ -12287,7 +12366,7 @@ $as_echo "$PY_UNICODE_TYPE" >&6; } - # 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 ${ac_cv_c_bigendian+:} false; then : -+if test "${ac_cv_c_bigendian+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - ac_cv_c_bigendian=unknown -@@ -12505,7 +12584,7 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUI - - ;; #( - *) -- as_fn_error $? "unknown endianness -+ as_fn_error "unknown endianness - presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; - esac - -@@ -12578,7 +12657,7 @@ $as_echo "$SO" >&6; } - # 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 ${ac_cv_rshift_extends_sign+:} false; then : -+if test "${ac_cv_rshift_extends_sign+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - -@@ -12617,7 +12696,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 ${ac_cv_have_getc_unlocked+:} false; then : -+if test "${ac_cv_have_getc_unlocked+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - -@@ -12715,7 +12794,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 ${ac_cv_lib_readline_rl_callback_handler_install+:} false; then : -+if test "${ac_cv_lib_readline_rl_callback_handler_install+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS -@@ -12749,7 +12828,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" = xyes; then : -+if test "x$ac_cv_lib_readline_rl_callback_handler_install" = x""yes; then : - - $as_echo "#define HAVE_RL_CALLBACK 1" >>confdefs.h - -@@ -12767,7 +12846,7 @@ else - have_readline=no - - fi --rm -f conftest.err conftest.i conftest.$ac_ext -+rm -f conftest.err conftest.$ac_ext - if test $have_readline = yes - then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -12801,7 +12880,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 ${ac_cv_lib_readline_rl_pre_input_hook+:} false; then : -+if test "${ac_cv_lib_readline_rl_pre_input_hook+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS -@@ -12835,7 +12914,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" = xyes; then : -+if test "x$ac_cv_lib_readline_rl_pre_input_hook" = x""yes; then : - - $as_echo "#define HAVE_RL_PRE_INPUT_HOOK 1" >>confdefs.h - -@@ -12845,7 +12924,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 ${ac_cv_lib_readline_rl_completion_display_matches_hook+:} false; then : -+if test "${ac_cv_lib_readline_rl_completion_display_matches_hook+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS -@@ -12879,7 +12958,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" = xyes; then : -+if test "x$ac_cv_lib_readline_rl_completion_display_matches_hook" = x""yes; then : - - $as_echo "#define HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK 1" >>confdefs.h - -@@ -12889,7 +12968,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 ${ac_cv_lib_readline_rl_completion_matches+:} false; then : -+if test "${ac_cv_lib_readline_rl_completion_matches+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS -@@ -12923,7 +13002,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" = xyes; then : -+if test "x$ac_cv_lib_readline_rl_completion_matches" = x""yes; then : - - $as_echo "#define HAVE_RL_COMPLETION_MATCHES 1" >>confdefs.h - -@@ -12941,7 +13020,7 @@ else - have_readline=no - - fi --rm -f conftest.err conftest.i conftest.$ac_ext -+rm -f conftest.err conftest.$ac_ext - if test $have_readline = yes - then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -12964,7 +13043,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 ${ac_cv_broken_nice+:} false; then : -+if test "${ac_cv_broken_nice+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - -@@ -13005,7 +13084,7 @@ fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken poll()" >&5 - $as_echo_n "checking for broken poll()... " >&6; } --if ${ac_cv_broken_poll+:} false; then : -+if test "${ac_cv_broken_poll+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - if test "$cross_compiling" = yes; then : -@@ -13060,7 +13139,7 @@ ac_fn_c_check_member "$LINENO" "struct t - #include <$ac_cv_struct_tm> - - " --if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then : -+if test "x$ac_cv_member_struct_tm_tm_zone" = x""yes; then : - - cat >>confdefs.h <<_ACEOF - #define HAVE_STRUCT_TM_TM_ZONE 1 -@@ -13076,7 +13155,7 @@ $as_echo "#define HAVE_TM_ZONE 1" >>conf - else - ac_fn_c_check_decl "$LINENO" "tzname" "ac_cv_have_decl_tzname" "#include - " --if test "x$ac_cv_have_decl_tzname" = xyes; then : -+if test "x$ac_cv_have_decl_tzname" = x""yes; then : - ac_have_decl=1 - else - ac_have_decl=0 -@@ -13088,7 +13167,7 @@ _ACEOF - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5 - $as_echo_n "checking for tzname... " >&6; } --if ${ac_cv_var_tzname+:} false; then : -+if test "${ac_cv_var_tzname+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -13127,7 +13206,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 ${ac_cv_working_tzset+:} false; then : -+if test "${ac_cv_working_tzset+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - -@@ -13224,7 +13303,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 ${ac_cv_stat_tv_nsec+:} false; then : -+if test "${ac_cv_stat_tv_nsec+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -13261,7 +13340,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 ${ac_cv_stat_tv_nsec2+:} false; then : -+if test "${ac_cv_stat_tv_nsec2+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -13298,7 +13377,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 ${ac_cv_mvwdelch_is_expression+:} false; then : -+if test "${ac_cv_mvwdelch_is_expression+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -13335,7 +13414,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 ${ac_cv_window_has_flags+:} false; then : -+if test "${ac_cv_window_has_flags+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -@@ -13483,7 +13562,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 ${ac_cv_have_long_long_format+:} false; then : -+ if test "${ac_cv_have_long_long_format+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - if test "$cross_compiling" = yes; then : -@@ -13553,7 +13632,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 ${ac_cv_have_size_t_format+:} false; then : -+if test "${ac_cv_have_size_t_format+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - if test "$cross_compiling" = yes; then : -@@ -13626,7 +13705,7 @@ ac_fn_c_check_type "$LINENO" "socklen_t" - #endif - - " --if test "x$ac_cv_type_socklen_t" = xyes; then : -+if test "x$ac_cv_type_socklen_t" = x""yes; then : - - else - -@@ -13637,7 +13716,7 @@ fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken mbstowcs" >&5 - $as_echo_n "checking for broken mbstowcs... " >&6; } --if ${ac_cv_broken_mbstowcs+:} false; then : -+if test "${ac_cv_broken_mbstowcs+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - if test "$cross_compiling" = yes; then : -@@ -13677,7 +13756,7 @@ fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports computed gotos" >&5 - $as_echo_n "checking whether $CC supports computed gotos... " >&6; } --if ${ac_cv_computed_gotos+:} false; then : -+if test "${ac_cv_computed_gotos+set}" = set; then : - $as_echo_n "(cached) " >&6 - else - if test "$cross_compiling" = yes; then : -@@ -13757,11 +13836,11 @@ esac - - - case $ac_sys_system in -- OSF*) as_fn_error $? "OSF* systems are deprecated unless somebody volunteers. Check http://bugs.python.org/issue8606" "$LINENO" 5 ;; -+ OSF*) as_fn_error "OSF* systems are deprecated unless somebody volunteers. Check http://bugs.python.org/issue8606" "$LINENO" 5 ;; - esac - - ac_fn_c_check_func "$LINENO" "pipe2" "ac_cv_func_pipe2" --if test "x$ac_cv_func_pipe2" = xyes; then : -+if test "x$ac_cv_func_pipe2" = x""yes; then : - - $as_echo "#define HAVE_PIPE2 1" >>confdefs.h - -@@ -13856,21 +13935,10 @@ $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 -- if test "x$cache_file" != "x/dev/null"; then -+ test "x$cache_file" != "x/dev/null" && - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 - $as_echo "$as_me: updating cache $cache_file" >&6;} -- 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 -+ cat confcache >$cache_file - 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;} -@@ -13886,7 +13954,6 @@ DEFS=-DHAVE_CONFIG_H - - ac_libobjs= - ac_ltlibobjs= --U= - for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' -@@ -13903,7 +13970,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" -@@ -14004,7 +14071,6 @@ 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 -@@ -14050,19 +14116,19 @@ export LANGUAGE - (unset CDPATH) >/dev/null 2>&1 && unset CDPATH - - --# as_fn_error STATUS ERROR [LINENO LOG_FD] --# ---------------------------------------- -+# as_fn_error ERROR [LINENO LOG_FD] -+# --------------------------------- - # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are - # provided, also output the error to LOG_FD, referencing LINENO. Then exit the --# script with STATUS, using 1 if that was 0. -+# script with status $?, using 1 if that was 0. - as_fn_error () - { -- as_status=$1; test $as_status -eq 0 && as_status=1 -- if test "$4"; then -- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack -- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 -+ as_status=$?; test $as_status -eq 0 && as_status=1 -+ if test "$3"; then -+ as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack -+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 - fi -- $as_echo "$as_me: error: $2" >&2 -+ $as_echo "$as_me: error: $1" >&2 - as_fn_exit $as_status - } # as_fn_error - -@@ -14258,7 +14324,7 @@ $as_echo X"$as_dir" | - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" -- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" -+ } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" - - - } # as_fn_mkdir_p -@@ -14312,7 +14378,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri - # values after options handling. - ac_log=" - This file was extended by python $as_me 3.2, which was --generated by GNU Autoconf 2.68. Invocation command line was -+generated by GNU Autoconf 2.65. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS -@@ -14374,10 +14440,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_writ - ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" - ac_cs_version="\\ - python config.status 3.2 --configured by $0, generated by GNU Autoconf 2.68, -+configured by $0, generated by GNU Autoconf 2.65, - with options \\"\$ac_cs_config\\" - --Copyright (C) 2010 Free Software Foundation, Inc. -+Copyright (C) 2009 Free Software Foundation, Inc. - This config.status script is free software; the Free Software Foundation - gives unlimited permission to copy, distribute and modify it." - -@@ -14393,16 +14459,11 @@ ac_need_defaults=: - while test $# != 0 - do - case $1 in -- --*=?*) -+ --*=*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; -- --*=) -- ac_option=`expr "X$1" : 'X\([^=]*\)='` -- ac_optarg= -- ac_shift=: -- ;; - *) - ac_option=$1 - ac_optarg=$2 -@@ -14424,7 +14485,6 @@ do - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; -- '') as_fn_error $? "missing file argument" ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" - ac_need_defaults=false;; -@@ -14437,7 +14497,7 @@ do - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header -- as_fn_error $? "ambiguous option: \`$1' -+ as_fn_error "ambiguous option: \`$1' - Try \`$0 --help' for more information.";; - --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; -@@ -14446,7 +14506,7 @@ Try \`$0 --help' for more information."; - ac_cs_silent=: ;; - - # This is an error. -- -*) as_fn_error $? "unrecognized option: \`$1' -+ -*) as_fn_error "unrecognized option: \`$1' - Try \`$0 --help' for more information." ;; - - *) as_fn_append ac_config_targets " $1" -@@ -14505,7 +14565,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 - -@@ -14527,10 +14587,9 @@ fi - # after its creation but before its name has been assigned to `$tmp'. - $debug || - { -- tmp= ac_tmp= -+ tmp= - trap 'exit_status=$? -- : "${ac_tmp:=$tmp}" -- { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status -+ { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status - ' 0 - trap 'as_fn_exit 1' 1 2 13 15 - } -@@ -14538,13 +14597,12 @@ $debug || - - { - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && -- test -d "$tmp" -+ test -n "$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 -+} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 - - # Set up the scripts for CONFIG_FILES section. - # No need to generate them if there are no CONFIG_FILES. -@@ -14561,12 +14619,12 @@ if test "x$ac_cr" = x; then - fi - ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` - if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then -- ac_cs_awk_cr='\\r' -+ ac_cs_awk_cr='\r' - else - ac_cs_awk_cr=$ac_cr - fi - --echo 'BEGIN {' >"$ac_tmp/subs1.awk" && -+echo 'BEGIN {' >"$tmp/subs1.awk" && - _ACEOF - - -@@ -14575,18 +14633,18 @@ _ACEOF - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" - } >conf$$subs.sh || -- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 --ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` -+ as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 -+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` - ac_delim='%!_!# ' - for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || -- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -+ as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then -- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -+ as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -@@ -14594,7 +14652,7 @@ done - rm -f conf$$subs.sh - - cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 --cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && -+cat >>"\$tmp/subs1.awk" <<\\_ACAWK && - _ACEOF - sed -n ' - h -@@ -14642,7 +14700,7 @@ t delim - rm -f conf$$subs.awk - cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - _ACAWK --cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && -+cat >>"\$tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -@@ -14674,29 +14732,21 @@ if sed "s/$ac_cr//" < /dev/null > /dev/n - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" - else - cat --fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ -- || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 -+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ -+ || as_fn_error "could not setup config files machinery" "$LINENO" 5 - _ACEOF - --# VPATH may cause trouble with some makes, so we remove sole $(srcdir), --# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and -+# VPATH may cause trouble with some makes, so we remove $(srcdir), -+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and - # trailing colons and then remove the whole line if VPATH becomes empty - # (actually we leave an empty line to preserve line numbers). - if test "x$srcdir" = x.; then -- ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ --h --s/// --s/^/:/ --s/[ ]*$/:/ --s/:\$(srcdir):/:/g --s/:\${srcdir}:/:/g --s/:@srcdir@:/:/g --s/^:*// -+ ac_vpsub='/^[ ]*VPATH[ ]*=/{ -+s/:*\$(srcdir):*/:/ -+s/:*\${srcdir}:*/:/ -+s/:*@srcdir@:*/:/ -+s/^\([^=]*=[ ]*\):*/\1/ - s/:*$// --x --s/\(=[ ]*\).*/\1/ --G --s/\n// - s/^[^=]*=[ ]*$// - }' - fi -@@ -14708,7 +14758,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 >"$ac_tmp/defines.awk" <<\_ACAWK || -+cat >"$tmp/defines.awk" <<\_ACAWK || - BEGIN { - _ACEOF - -@@ -14720,11 +14770,11 @@ _ACEOF - # handling of long lines. - ac_delim='%!_!# ' - for ac_last_try in false false :; do -- ac_tt=`sed -n "/$ac_delim/p" confdefs.h` -- if test -z "$ac_tt"; then -+ ac_t=`sed -n "/$ac_delim/p" confdefs.h` -+ if test -z "$ac_t"; then - break - elif $ac_last_try; then -- as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 -+ as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -@@ -14809,7 +14859,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_writ - _ACAWK - _ACEOF - cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -- as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 -+ as_fn_error "could not setup config headers machinery" "$LINENO" 5 - fi # test -n "$CONFIG_HEADERS" - - -@@ -14822,7 +14872,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 -@@ -14841,7 +14891,7 @@ do - for ac_f - do - case $ac_f in -- -) ac_f="$ac_tmp/stdin";; -+ -) ac_f="$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 `:'. -@@ -14850,7 +14900,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 "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'" -@@ -14876,8 +14926,8 @@ $as_echo "$as_me: creating $ac_file" >&6 - esac - - case $ac_tag in -- *:-:* | *:-) cat >"$ac_tmp/stdin" \ -- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; -+ *:-:* | *:-) cat >"$tmp/stdin" \ -+ || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; - esac -@@ -15007,24 +15057,23 @@ 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 "$ac_tmp/subs.awk" \ -- >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 -+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 - - test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && -- { 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"; } && -+ { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && -+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$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 -+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;} -+which seems to be undefined. Please make sure it is defined." >&2;} - -- rm -f "$ac_tmp/stdin" -+ rm -f "$tmp/stdin" - case $ac_file in -- -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; -- *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; -+ -) cat "$tmp/out" && rm -f "$tmp/out";; -+ *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; - esac \ -- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 -+ || as_fn_error "could not create $ac_file" "$LINENO" 5 - ;; - :H) - # -@@ -15033,21 +15082,21 @@ which seems to be undefined. Please mak - if test x"$ac_file" != x-; then - { - $as_echo "/* $configure_input */" \ -- && 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" "$ac_tmp/config.h" >/dev/null 2>&1; then -+ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" -+ } >"$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 - { $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 "$ac_tmp/config.h" "$ac_file" \ -- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 -+ mv "$tmp/config.h" "$ac_file" \ -+ || as_fn_error "could not create $ac_file" "$LINENO" 5 - fi - else - $as_echo "/* $configure_input */" \ -- && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ -- || as_fn_error $? "could not create -" "$LINENO" 5 -+ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ -+ || as_fn_error "could not create -" "$LINENO" 5 - fi - ;; - -@@ -15067,7 +15116,7 @@ _ACEOF - ac_clean_files=$ac_clean_files_save - - test $ac_write_fail = 0 || -- as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 -+ as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 - - - # configure is writing to config.log, and then calls config.status. -@@ -15088,7 +15137,7 @@ if test "$no_create" != yes; then - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. -- $ac_cs_success || as_fn_exit 1 -+ $ac_cs_success || as_fn_exit $? - fi - if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 diff -up ./pyconfig.h.in.autotool-intermediates ./pyconfig.h.in ---- ./pyconfig.h.in.autotool-intermediates 2011-02-21 10:38:12.252957078 -0500 -+++ ./pyconfig.h.in 2011-02-21 10:38:17.743831724 -0500 +--- ./pyconfig.h.in.autotool-intermediates 2011-07-11 11:50:06.896426002 -0400 ++++ ./pyconfig.h.in 2011-07-11 11:50:13.965426001 -0400 @@ -12,15 +12,15 @@ support for AIX C++ shared extension modules. */ #undef AIX_GENUINE_CPLUSPLUS @@ -3582,13 +164,3 @@ diff -up ./pyconfig.h.in.autotool-intermediates ./pyconfig.h.in /* Define if C doubles are 64-bit IEEE 754 binary format, stored in ARM mixed-endian order (byte order 45670123) */ #undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 -@@ -1161,6 +1161,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-3.2.1-fix-test-subprocess-with-nonreadable-path-dir.patch b/python-3.2.1-fix-test-subprocess-with-nonreadable-path-dir.patch new file mode 100644 index 0000000..6f43c72 --- /dev/null +++ b/python-3.2.1-fix-test-subprocess-with-nonreadable-path-dir.patch @@ -0,0 +1,12 @@ +diff -up Python-3.2.1/Lib/test/test_subprocess.py.non-readable-path Python-3.2.1/Lib/test/test_subprocess.py +--- Python-3.2.1/Lib/test/test_subprocess.py.non-readable-path 2011-07-09 02:58:51.000000000 -0400 ++++ Python-3.2.1/Lib/test/test_subprocess.py 2011-07-11 11:34:16.284426005 -0400 +@@ -618,7 +618,7 @@ class ProcessTestCase(BaseTestCase): + for i in range(1024): + # Windows raises IOError. Others raise OSError. + with self.assertRaises(EnvironmentError) as c: +- subprocess.Popen(['nonexisting_i_hope'], ++ subprocess.Popen(['/usr/bin/nonexisting_i_hope'], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + # ignore errors that indicate the command was not found diff --git a/python-3.2b2-lib64.patch b/python-3.2.1-lib64.patch similarity index 76% rename from python-3.2b2-lib64.patch rename to python-3.2.1-lib64.patch index 8d4e91f..8b15e3e 100644 --- a/python-3.2b2-lib64.patch +++ b/python-3.2.1-lib64.patch @@ -1,6 +1,6 @@ -diff -up Python-3.2b2/Lib/distutils/command/install.py.lib64 Python-3.2b2/Lib/distutils/command/install.py ---- Python-3.2b2/Lib/distutils/command/install.py.lib64 2010-11-24 22:46:44.000000000 -0500 -+++ Python-3.2b2/Lib/distutils/command/install.py 2010-12-29 10:21:55.510184563 -0500 +diff -up Python-3.2.1/Lib/distutils/command/install.py.lib64 Python-3.2.1/Lib/distutils/command/install.py +--- Python-3.2.1/Lib/distutils/command/install.py.lib64 2011-07-09 02:58:46.000000000 -0400 ++++ Python-3.2.1/Lib/distutils/command/install.py 2011-07-11 11:20:45.980426001 -0400 @@ -47,14 +47,14 @@ else: INSTALL_SCHEMES = { 'unix_prefix': { @@ -18,9 +18,9 @@ diff -up Python-3.2b2/Lib/distutils/command/install.py.lib64 Python-3.2b2/Lib/di 'headers': '$base/include/python/$dist_name', 'scripts': '$base/bin', 'data' : '$base', -diff -up Python-3.2b2/Lib/distutils/sysconfig.py.lib64 Python-3.2b2/Lib/distutils/sysconfig.py ---- Python-3.2b2/Lib/distutils/sysconfig.py.lib64 2010-11-24 14:43:47.000000000 -0500 -+++ Python-3.2b2/Lib/distutils/sysconfig.py 2010-12-29 10:21:55.510184563 -0500 +diff -up Python-3.2.1/Lib/distutils/sysconfig.py.lib64 Python-3.2.1/Lib/distutils/sysconfig.py +--- Python-3.2.1/Lib/distutils/sysconfig.py.lib64 2011-07-09 02:58:47.000000000 -0400 ++++ Python-3.2.1/Lib/distutils/sysconfig.py 2011-07-11 11:20:45.981426001 -0400 @@ -124,8 +124,12 @@ def get_python_lib(plat_specific=0, stan prefix = plat_specific and EXEC_PREFIX or PREFIX @@ -35,10 +35,10 @@ diff -up Python-3.2b2/Lib/distutils/sysconfig.py.lib64 Python-3.2b2/Lib/distutil if standard_lib: return libpython else: -diff -up Python-3.2b2/Lib/site.py.lib64 Python-3.2b2/Lib/site.py ---- Python-3.2b2/Lib/site.py.lib64 2010-10-12 18:23:23.000000000 -0400 -+++ Python-3.2b2/Lib/site.py 2010-12-29 10:21:55.511184595 -0500 -@@ -275,12 +275,16 @@ def getsitepackages(): +diff -up Python-3.2.1/Lib/site.py.lib64 Python-3.2.1/Lib/site.py +--- Python-3.2.1/Lib/site.py.lib64 2011-07-09 02:58:49.000000000 -0400 ++++ Python-3.2.1/Lib/site.py 2011-07-11 11:20:45.982426001 -0400 +@@ -285,12 +285,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-3.2b2/Lib/site.py.lib64 Python-3.2b2/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-3.2b2/Lib/sysconfig.py.lib64 Python-3.2b2/Lib/sysconfig.py ---- Python-3.2b2/Lib/sysconfig.py.lib64 2010-11-24 20:34:47.000000000 -0500 -+++ Python-3.2b2/Lib/sysconfig.py 2010-12-29 10:21:55.512184877 -0500 +diff -up Python-3.2.1/Lib/sysconfig.py.lib64 Python-3.2.1/Lib/sysconfig.py +--- Python-3.2.1/Lib/sysconfig.py.lib64 2011-07-09 02:58:49.000000000 -0400 ++++ Python-3.2.1/Lib/sysconfig.py 2011-07-11 11:20:45.982426001 -0400 @@ -21,10 +21,10 @@ __all__ = [ _INSTALL_SCHEMES = { @@ -86,10 +86,10 @@ diff -up Python-3.2b2/Lib/sysconfig.py.lib64 Python-3.2b2/Lib/sysconfig.py 'include': '{userbase}/include/python{py_version_short}', 'scripts': '{userbase}/bin', 'data' : '{userbase}', -diff -up Python-3.2b2/Lib/test/test_site.py.lib64 Python-3.2b2/Lib/test/test_site.py ---- Python-3.2b2/Lib/test/test_site.py.lib64 2010-12-29 10:35:12.417308989 -0500 -+++ Python-3.2b2/Lib/test/test_site.py 2010-12-29 10:36:27.124059073 -0500 -@@ -164,12 +164,15 @@ class HelperFunctionsTests(unittest.Test +diff -up Python-3.2.1/Lib/test/test_site.py.lib64 Python-3.2.1/Lib/test/test_site.py +--- Python-3.2.1/Lib/test/test_site.py.lib64 2011-07-09 02:58:51.000000000 -0400 ++++ Python-3.2.1/Lib/test/test_site.py 2011-07-11 11:20:45.983426001 -0400 +@@ -222,12 +222,15 @@ class HelperFunctionsTests(unittest.Test wanted = os.path.join('xoxo', 'Lib', 'site-packages') self.assertEqual(dirs[0], wanted) elif os.sep == '/': @@ -108,10 +108,10 @@ diff -up Python-3.2b2/Lib/test/test_site.py.lib64 Python-3.2b2/Lib/test/test_sit else: self.assertEqual(len(dirs), 2) self.assertEqual(dirs[0], 'xoxo') -diff -up Python-3.2b2/Makefile.pre.in.lib64 Python-3.2b2/Makefile.pre.in ---- Python-3.2b2/Makefile.pre.in.lib64 2010-12-29 10:21:55.506183982 -0500 -+++ Python-3.2b2/Makefile.pre.in 2010-12-29 10:21:55.512184877 -0500 -@@ -102,7 +102,7 @@ LIBDIR= @libdir@ +diff -up Python-3.2.1/Makefile.pre.in.lib64 Python-3.2.1/Makefile.pre.in +--- Python-3.2.1/Makefile.pre.in.lib64 2011-07-11 11:20:45.974426000 -0400 ++++ Python-3.2.1/Makefile.pre.in 2011-07-11 11:20:45.984426001 -0400 +@@ -106,7 +106,7 @@ LIBDIR= @libdir@ MANDIR= @mandir@ INCLUDEDIR= @includedir@ CONFINCLUDEDIR= $(exec_prefix)/include @@ -120,9 +120,9 @@ diff -up Python-3.2b2/Makefile.pre.in.lib64 Python-3.2b2/Makefile.pre.in ABIFLAGS= @ABIFLAGS@ # Detailed destination directories -diff -up Python-3.2b2/Modules/getpath.c.lib64 Python-3.2b2/Modules/getpath.c ---- Python-3.2b2/Modules/getpath.c.lib64 2010-12-03 15:14:31.000000000 -0500 -+++ Python-3.2b2/Modules/getpath.c 2010-12-29 10:21:55.513184358 -0500 +diff -up Python-3.2.1/Modules/getpath.c.lib64 Python-3.2.1/Modules/getpath.c +--- Python-3.2.1/Modules/getpath.c.lib64 2011-07-09 02:58:54.000000000 -0400 ++++ Python-3.2.1/Modules/getpath.c 2011-07-11 11:27:44.596425999 -0400 @@ -122,8 +122,8 @@ #endif @@ -134,16 +134,16 @@ diff -up Python-3.2b2/Modules/getpath.c.lib64 Python-3.2b2/Modules/getpath.c #endif #ifndef LANDMARK -@@ -134,7 +134,7 @@ static wchar_t prefix[MAXPATHLEN+1]; - static wchar_t exec_prefix[MAXPATHLEN+1]; +@@ -135,7 +135,7 @@ static wchar_t exec_prefix[MAXPATHLEN+1] static wchar_t progpath[MAXPATHLEN+1]; static wchar_t *module_search_path = NULL; + static int module_search_path_malloced = 0; -static wchar_t *lib_python = L"lib/python" VERSION; +static wchar_t *lib_python = L"lib64/python" VERSION; static void reduce(wchar_t *dir) -@@ -582,7 +582,7 @@ calculate_path(void) +@@ -583,7 +583,7 @@ calculate_path(void) } else wcsncpy(zip_path, _prefix, MAXPATHLEN); @@ -152,7 +152,7 @@ diff -up Python-3.2b2/Modules/getpath.c.lib64 Python-3.2b2/Modules/getpath.c bufsz = wcslen(zip_path); /* Replace "00" with version */ zip_path[bufsz - 6] = VERSION[0]; zip_path[bufsz - 5] = VERSION[2]; -@@ -592,7 +592,7 @@ calculate_path(void) +@@ -593,7 +593,7 @@ calculate_path(void) fprintf(stderr, "Could not find platform dependent libraries \n"); wcsncpy(exec_prefix, _exec_prefix, MAXPATHLEN); @@ -161,19 +161,19 @@ diff -up Python-3.2b2/Modules/getpath.c.lib64 Python-3.2b2/Modules/getpath.c } /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */ -diff -up Python-3.2b2/setup.py.lib64 Python-3.2b2/setup.py ---- Python-3.2b2/setup.py.lib64 2010-12-04 13:36:03.000000000 -0500 -+++ Python-3.2b2/setup.py 2010-12-29 10:21:55.514184248 -0500 -@@ -373,7 +373,7 @@ class PyBuildExt(build_ext): +diff -up Python-3.2.1/setup.py.lib64 Python-3.2.1/setup.py +--- Python-3.2.1/setup.py.lib64 2011-07-09 02:58:56.000000000 -0400 ++++ Python-3.2.1/setup.py 2011-07-11 11:28:00.193426004 -0400 +@@ -396,7 +396,7 @@ class PyBuildExt(build_ext): # Ensure that /usr/local is always used, but the local build # directories (i.e. '.' and 'Include') must be first. See issue # 10520. - 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() - # Add paths specified in the environment variables LDFLAGS and -@@ -619,11 +619,11 @@ class PyBuildExt(build_ext): +@@ -643,11 +643,11 @@ class PyBuildExt(build_ext): elif curses_library: readline_libs.append(curses_library) elif self.compiler.find_library_file(lib_dirs + @@ -187,7 +187,7 @@ diff -up Python-3.2b2/setup.py.lib64 Python-3.2b2/setup.py extra_link_args=readline_extra_link_args, libraries=readline_libs) ) else: -@@ -660,8 +660,8 @@ class PyBuildExt(build_ext): +@@ -684,8 +684,8 @@ class PyBuildExt(build_ext): if krb5_h: ssl_incs += krb5_h ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, diff --git a/python-3.2rc1-no-static-lib.patch b/python-3.2.1-no-static-lib.patch similarity index 66% rename from python-3.2rc1-no-static-lib.patch rename to python-3.2.1-no-static-lib.patch index 5b32bc7..3a6ac8a 100644 --- a/python-3.2rc1-no-static-lib.patch +++ b/python-3.2.1-no-static-lib.patch @@ -1,7 +1,7 @@ -diff -up Python-3.2rc1/Makefile.pre.in.no-static-lib Python-3.2rc1/Makefile.pre.in ---- Python-3.2rc1/Makefile.pre.in.no-static-lib 2010-12-30 17:12:40.000000000 -0500 -+++ Python-3.2rc1/Makefile.pre.in 2011-01-17 12:58:32.123947161 -0500 -@@ -421,7 +421,7 @@ coverage: +diff -up Python-3.2.1/Makefile.pre.in.no-static-lib Python-3.2.1/Makefile.pre.in +--- Python-3.2.1/Makefile.pre.in.no-static-lib 2011-07-09 02:58:52.000000000 -0400 ++++ Python-3.2.1/Makefile.pre.in 2011-07-11 11:46:27.381425999 -0400 +@@ -425,7 +425,7 @@ coverage: # Build the interpreter @@ -10,7 +10,7 @@ diff -up Python-3.2rc1/Makefile.pre.in.no-static-lib Python-3.2rc1/Makefile.pre. $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Modules/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) platform: $(BUILDPYTHON) -@@ -435,18 +435,6 @@ sharedmods: $(BUILDPYTHON) +@@ -439,18 +439,6 @@ sharedmods: $(BUILDPYTHON) *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \ esac @@ -29,7 +29,16 @@ diff -up Python-3.2rc1/Makefile.pre.in.no-static-lib Python-3.2rc1/Makefile.pre. libpython$(LDVERSION).so: $(LIBRARY_OBJS) if test $(INSTSONAME) != $(LDLIBRARY); then \ $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ -@@ -1048,18 +1036,6 @@ libainstall: all python-config +@@ -540,7 +528,7 @@ Modules/Setup: $(srcdir)/Modules/Setup.d + echo "-----------------------------------------------"; \ + fi + +-Modules/_testembed: Modules/_testembed.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) ++Modules/_testembed: Modules/_testembed.o $(LDLIBRARY) $(PY3LIBRARY) + $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Modules/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) + + ############################################################################ +@@ -1058,18 +1046,6 @@ libainstall: all python-config else true; \ fi; \ done diff --git a/python-3.2b2-fix-test-subprocess-with-nonreadable-path-dir.patch b/python-3.2b2-fix-test-subprocess-with-nonreadable-path-dir.patch deleted file mode 100644 index f73d57a..0000000 --- a/python-3.2b2-fix-test-subprocess-with-nonreadable-path-dir.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up Python-3.2b2/Lib/test/test_subprocess.py.non-readable-path Python-3.2b2/Lib/test/test_subprocess.py ---- Python-3.2b2/Lib/test/test_subprocess.py.non-readable-path 2010-12-29 16:25:38.498184175 -0500 -+++ Python-3.2b2/Lib/test/test_subprocess.py 2010-12-29 16:25:51.094184539 -0500 -@@ -578,7 +578,7 @@ class ProcessTestCase(BaseTestCase): - for i in range(1024): - # Windows raises IOError. Others raise OSError. - with self.assertRaises(EnvironmentError) as c: -- subprocess.Popen(['nonexisting_i_hope'], -+ subprocess.Popen(['/usr/bin/nonexisting_i_hope'], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - if c.exception.errno != errno.ENOENT: # ignore "no such file" diff --git a/python3.spec b/python3.spec index 39acd2c..bf7802e 100644 --- a/python3.spec +++ b/python3.spec @@ -117,8 +117,8 @@ # ================== Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 -Version: %{pybasever} -Release: 5%{?dist} +Version: %{pybasever}.1 +Release: 1%{?dist} License: Python Group: Development/Languages @@ -213,7 +213,7 @@ Patch3: python-3.2b2-remove-mimeaudio-tests.patch # Patch the Makefile.pre.in so that the generated Makefile doesn't try to build # a libpythonMAJOR.MINOR.a (bug 550692): -Patch6: python-3.2rc1-no-static-lib.patch +Patch6: python-3.2.1-no-static-lib.patch # Systemtap support: add statically-defined probe points # Patch based on upstream bug: http://bugs.python.org/issue4111 @@ -222,7 +222,7 @@ Patch6: python-3.2rc1-no-static-lib.patch # dmalcolm Patch8: python-3.2b2-systemtap.patch -Patch102: python-3.2b2-lib64.patch +Patch102: python-3.2.1-lib64.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 @@ -264,7 +264,7 @@ Patch128: python-3.2b2-test_sys-COUNT_ALLOCS.patch # Work around this by specifying an absolute path for the non-existant # executable # Not yet sent upstream -Patch129: python-3.2b2-fix-test-subprocess-with-nonreadable-path-dir.patch +Patch129: python-3.2.1-fix-test-subprocess-with-nonreadable-path-dir.patch # This is the generated patch to "configure"; see the description of # %{regenerate_autotooling_patch} @@ -1278,6 +1278,11 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon Jul 11 2011 David Malcolm - 3.2.1-1 +- 3.2.1; refresh lib64 patch (102), subprocess unit test patch (129), disabling +of static library build (due to Modules/_testembed; patch 6), autotool +intermediates (patch 300) + * Fri Jul 8 2011 David Malcolm - 3.2-5 - use the gdb hooks from the upstream tarball, rather than keeping our own copy diff --git a/sources b/sources index 48f3848..b583b29 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -92e94b5b6652b96349d6362b8337811d Python-3.2.tar.bz2 +f0869ba3f3797aacb1f954ef24c256f3 Python-3.2.1.tar.bz2 From cdc1710678a6046df530e056b4f1eefa9396d11d Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Mon, 11 Jul 2011 21:18:56 -0500 Subject: [PATCH 060/416] disable failing tests on sparc --- python3.spec | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/python3.spec b/python3.spec index bf7802e..5ff3866 100644 --- a/python3.spec +++ b/python3.spec @@ -118,7 +118,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 1%{?dist} +Release: 2%{?dist} License: Python Group: Development/Languages @@ -874,6 +874,20 @@ CheckPython() { # Some additional tests fail when running the test suite as non-root outside of # the build, due to permissions issues. +%ifarch %{sparc} + EXCLUDED_TESTS="\ + test_distutils \ + test_httplib \ + test_http_cookies \ + test_openpty \ + test_pty.py \ + test_socket \ + test_telnet \ + test_ctypes \ + test_openpty \ + test_pty \ + %{nil}" +%else EXCLUDED_TESTS="\ test_distutils \ test_httplib \ @@ -883,7 +897,7 @@ CheckPython() { test_socket \ test_telnet \ %{nil}" - +%endif # Note that we're running the tests using the version of the code in the builddir, # not in the buildroot. @@ -1278,6 +1292,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon Jul 11 2011 Dennis Gilmore - 3.2.1-2 +- disable some tests on sparc arches + * Mon Jul 11 2011 David Malcolm - 3.2.1-1 - 3.2.1; refresh lib64 patch (102), subprocess unit test patch (129), disabling of static library build (due to Modules/_testembed; patch 6), autotool From 65e90f617be391c7453dd0241e828b9f8f5cf5a1 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Thu, 18 Aug 2011 14:17:41 -0400 Subject: [PATCH 061/416] add %python3_version to the rpm macros (rhbz#719082) --- macros.python3 | 1 + python3.spec | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/macros.python3 b/macros.python3 index 2b41d24..d6d913c 100644 --- a/macros.python3 +++ b/macros.python3 @@ -1,4 +1,5 @@ %__python3 /usr/bin/python3 %python3_sitelib %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") %python3_sitearch %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") +%python3_version %(%{__python3} -c "import sys; sys.stdout.write(sys.version[:3])") %py3dir %{_builddir}/python3-%{name}-%{version}-%{release} diff --git a/python3.spec b/python3.spec index 5ff3866..7c9246c 100644 --- a/python3.spec +++ b/python3.spec @@ -118,7 +118,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 2%{?dist} +Release: 3%{?dist} License: Python Group: Development/Languages @@ -1292,6 +1292,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Thu Aug 18 2011 David Malcolm - 3.2.1-3 +- add %%python3_version to the rpm macros (rhbz#719082) + * Mon Jul 11 2011 Dennis Gilmore - 3.2.1-2 - disable some tests on sparc arches From bd4f5e9a13e0c07f2c32bdcba465766e772f720e Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 22 Aug 2011 15:38:24 -0400 Subject: [PATCH 062/416] Fix comments within specfile (rhbz#732475) --- python3.spec | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/python3.spec b/python3.spec index 7c9246c..b20430c 100644 --- a/python3.spec +++ b/python3.spec @@ -757,6 +757,7 @@ LD_LIBRARY_PATH=. /usr/lib/rpm/brp-python-bytecompile ./python find %{buildroot} \ -perm 555 -exec chmod 755 {} \; +# Install macros for rpm: mkdir -p %{buildroot}/%{_sysconfdir}/rpm install -m 644 %{SOURCE2} %{buildroot}/%{_sysconfdir}/rpm install -m 644 %{SOURCE3} %{buildroot}/%{_sysconfdir}/rpm @@ -932,9 +933,6 @@ rm -fr %{buildroot} %postun libs -p /sbin/ldconfig -# ====================================================== -# Manifests of the various subpackages -# ====================================================== %files %defattr(-, root, root) From 4763ff864f559286fdcf5090d30db55311119ecb Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 23 Aug 2011 14:24:14 -0400 Subject: [PATCH 063/416] don't use --with-tsc on ppc64 debug builds (rhbz#698726) --- python3.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python3.spec b/python3.spec index b20430c..ac30460 100644 --- a/python3.spec +++ b/python3.spec @@ -118,7 +118,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 3%{?dist} +Release: 4%{?dist} License: Python Group: Development/Languages @@ -536,7 +536,7 @@ BuildPython() { 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" \ @@ -1290,6 +1290,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Tue Aug 23 2011 David Malcolm - 3.2.1-4 +- don't use --with-tsc on ppc64 debug builds (rhbz#698726) + * Thu Aug 18 2011 David Malcolm - 3.2.1-3 - add %%python3_version to the rpm macros (rhbz#719082) From ceb359a69b285160f7997c0b77de1dfd3567e80e Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 23 Aug 2011 16:48:59 -0400 Subject: [PATCH 064/416] 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) --- python-2.7.2-tsc-on-ppc.patch | 58 +++++++++++++++++++++++++++++++++++ python3.spec | 14 +++++++-- 2 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 python-2.7.2-tsc-on-ppc.patch 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/python3.spec b/python3.spec index ac30460..7e8d2d1 100644 --- a/python3.spec +++ b/python3.spec @@ -118,7 +118,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 4%{?dist} +Release: 5%{?dist} License: Python Group: Development/Languages @@ -266,6 +266,11 @@ Patch128: python-3.2b2-test_sys-COUNT_ALLOCS.patch # Not yet sent upstream Patch129: python-3.2.1-fix-test-subprocess-with-nonreadable-path-dir.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 +Patch130: python-2.7.2-tsc-on-ppc.patch + # This is the generated patch to "configure"; see the description of # %{regenerate_autotooling_patch} # above: @@ -424,6 +429,7 @@ rm -r Modules/zlib || exit 1 %patch127 -p1 %patch128 -p1 %patch129 -p1 +%patch130 -p1 -b .tsc-on-ppc # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -536,7 +542,7 @@ BuildPython() { 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" \ @@ -1290,6 +1296,10 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Tue Aug 23 2011 David Malcolm - 3.2.1-5 +- re-enable and fix the --with-tsc option on ppc64, and rework it on 32-bit +ppc to avoid aliasing violations (patch 130; rhbz#698726) + * Tue Aug 23 2011 David Malcolm - 3.2.1-4 - don't use --with-tsc on ppc64 debug builds (rhbz#698726) From 9a778ac8c78dfff521c676058471ab94596bc344 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Wed, 31 Aug 2011 15:08:01 -0400 Subject: [PATCH 065/416] use "--findleaks --verbose3" when running test suite --- python3.spec | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/python3.spec b/python3.spec index 7e8d2d1..3a8fc62 100644 --- a/python3.spec +++ b/python3.spec @@ -118,7 +118,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 5%{?dist} +Release: 6%{?dist} License: Python Group: Development/Languages @@ -909,7 +909,9 @@ CheckPython() { # not in the buildroot. # Run the upstream test suite - LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest -x $EXCLUDED_TESTS + LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \ + --verbose3 --findleaks \ + -x $EXCLUDED_TESTS echo FINISHED: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName @@ -1296,6 +1298,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Wed Aug 31 2011 David Malcolm - 3.2.1-6 +- use "--findleaks --verbose3" when running test suite + * Tue Aug 23 2011 David Malcolm - 3.2.1-5 - re-enable and fix the --with-tsc option on ppc64, and rework it on 32-bit ppc to avoid aliasing violations (patch 130; rhbz#698726) From d0528e355d3dd5fc59584aff3f94c0ce64c8fbd5 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Wed, 31 Aug 2011 17:57:50 -0400 Subject: [PATCH 066/416] patch 130 now reported upstream --- python3.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 3a8fc62..bdd45ce 100644 --- a/python3.spec +++ b/python3.spec @@ -268,7 +268,7 @@ Patch129: python-3.2.1-fix-test-subprocess-with-nonreadable-path-dir.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 Patch130: python-2.7.2-tsc-on-ppc.patch # This is the generated patch to "configure"; see the description of From 28391cb8f7ca7456115eb2a853f0b57775e7d1eb Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Thu, 1 Sep 2011 18:43:09 -0400 Subject: [PATCH 067/416] run selftests with "--verbose"; disable parts of test_io on ppc (rhbz#732998) --- python-2.7.2-disable-tests-in-test_io.patch | 11 +++++++++++ python3.spec | 18 ++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 python-2.7.2-disable-tests-in-test_io.patch 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/python3.spec b/python3.spec index bdd45ce..5cbdd8c 100644 --- a/python3.spec +++ b/python3.spec @@ -118,7 +118,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 6%{?dist} +Release: 7%{?dist} License: Python Group: Development/Languages @@ -271,6 +271,12 @@ Patch129: python-3.2.1-fix-test-subprocess-with-nonreadable-path-dir.patch # Sent upstream as http://bugs.python.org/issue12872 Patch130: python-2.7.2-tsc-on-ppc.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: @@ -431,6 +437,10 @@ rm -r Modules/zlib || exit 1 %patch129 -p1 %patch130 -p1 -b .tsc-on-ppc +%ifarch ppc ppc64 +%patch131 -p1 +%endif + # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. # @@ -910,7 +920,7 @@ CheckPython() { # Run the upstream test suite LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \ - --verbose3 --findleaks \ + --verbose --findleaks \ -x $EXCLUDED_TESTS echo FINISHED: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName @@ -1298,6 +1308,10 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Thu Sep 1 2011 David Malcolm - 3.2.1-7 +- run selftests with "--verbose" +- disable parts of test_io on ppc (rhbz#732998) + * Wed Aug 31 2011 David Malcolm - 3.2.1-6 - use "--findleaks --verbose3" when running test suite From 06b3c5b484f6d685b4535e1a652dc6611bef3e14 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 6 Sep 2011 12:44:03 -0400 Subject: [PATCH 068/416] 3.2.2 --- .gitignore | 1 + python3.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 7844dc9..ec6198e 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ Python-3.2a1.tar.bz2 /Python-3.2rc3.tar.bz2 /Python-3.2.tar.bz2 /Python-3.2.1.tar.bz2 +/Python-3.2.2.tar.bz2 diff --git a/python3.spec b/python3.spec index 5cbdd8c..aa537ef 100644 --- a/python3.spec +++ b/python3.spec @@ -117,8 +117,8 @@ # ================== Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 -Version: %{pybasever}.1 -Release: 7%{?dist} +Version: %{pybasever}.2 +Release: 1%{?dist} License: Python Group: Development/Languages @@ -1308,6 +1308,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Tue Sep 6 2011 David Malcolm - 3.2.2-1 +- 3.2.2 + * Thu Sep 1 2011 David Malcolm - 3.2.1-7 - run selftests with "--verbose" - disable parts of test_io on ppc (rhbz#732998) diff --git a/sources b/sources index b583b29..ba6917c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -f0869ba3f3797aacb1f954ef24c256f3 Python-3.2.1.tar.bz2 +9d763097a13a59ff53428c9e4d098a05 Python-3.2.2.tar.bz2 From 0c8875f3f6a702aaa27f4844d4ac2a2e11768171 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sat, 10 Sep 2011 07:59:22 -0400 Subject: [PATCH 069/416] rewrite of %check: fine-grained test exclusions * Sat Sep 10 2011 David Malcolm - 3.2.2-2 - 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 106, 133-142 sparsely, moving patches for consistency with python.spec: 128 to 134, 126 to 135, 127 to 141) --- 00106-lib64-fix-for-test_install.patch | 13 ++ 00132-add-rpmbuild-hooks-to-unittest.patch | 68 +++++++ ...fix-COUNT_ALLOCS-failure-in-test_sys.patch | 0 ...t-within-test_weakref-in-debug-build.patch | 0 ...istutils-tests-that-fail-in-rpmbuild.patch | 12 ++ ...skip-test_float-known-failure-on-arm.patch | 11 + ... 00141-fix-test_gc_with_COUNT_ALLOCS.patch | 0 ...2-skip-failing-pty-tests-in-rpmbuild.patch | 22 ++ python3.spec | 188 ++++++++++-------- 9 files changed, 227 insertions(+), 87 deletions(-) create mode 100644 00106-lib64-fix-for-test_install.patch create mode 100644 00132-add-rpmbuild-hooks-to-unittest.patch rename python-3.2b2-test_sys-COUNT_ALLOCS.patch => 00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch (100%) rename python-3.2b2-test-weakref-COUNT_ALLOCS_fix.patch => 00135-fix-test-within-test_weakref-in-debug-build.patch (100%) create mode 100644 00137-skip-distutils-tests-that-fail-in-rpmbuild.patch create mode 100644 00139-skip-test_float-known-failure-on-arm.patch rename python-3.2b2-fix-test-gc-COUNT_ALLOCS.patch => 00141-fix-test_gc_with_COUNT_ALLOCS.patch (100%) create mode 100644 00142-skip-failing-pty-tests-in-rpmbuild.patch diff --git a/00106-lib64-fix-for-test_install.patch b/00106-lib64-fix-for-test_install.patch new file mode 100644 index 0000000..7852bf6 --- /dev/null +++ b/00106-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..fdfbab8 --- /dev/null +++ b/00132-add-rpmbuild-hooks-to-unittest.patch @@ -0,0 +1,68 @@ +diff -up Python-3.2.2/Lib/unittest/case.py.add-rpmbuild-hooks-to-unittest Python-3.2.2/Lib/unittest/case.py +--- Python-3.2.2/Lib/unittest/case.py.add-rpmbuild-hooks-to-unittest 2011-09-03 12:16:44.000000000 -0400 ++++ Python-3.2.2/Lib/unittest/case.py 2011-09-09 06:35:16.365568382 -0400 +@@ -3,6 +3,7 @@ + import sys + import functools + import difflib ++import os + import pprint + import re + import warnings +@@ -101,6 +102,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 _AssertRaisesBaseContext(object): + + def __init__(self, expected, test_case, callable_obj=None, +diff -up Python-3.2.2/Lib/unittest/__init__.py.add-rpmbuild-hooks-to-unittest Python-3.2.2/Lib/unittest/__init__.py +--- Python-3.2.2/Lib/unittest/__init__.py.add-rpmbuild-hooks-to-unittest 2011-09-03 12:16:44.000000000 -0400 ++++ Python-3.2.2/Lib/unittest/__init__.py 2011-09-09 06:35:16.366568382 -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/python-3.2b2-test_sys-COUNT_ALLOCS.patch b/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch similarity index 100% rename from python-3.2b2-test_sys-COUNT_ALLOCS.patch rename to 00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch diff --git a/python-3.2b2-test-weakref-COUNT_ALLOCS_fix.patch b/00135-fix-test-within-test_weakref-in-debug-build.patch similarity index 100% rename from python-3.2b2-test-weakref-COUNT_ALLOCS_fix.patch rename to 00135-fix-test-within-test_weakref-in-debug-build.patch 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..8a6bc46 --- /dev/null +++ b/00137-skip-distutils-tests-that-fail-in-rpmbuild.patch @@ -0,0 +1,12 @@ +diff -up Python-3.2.2/Lib/distutils/tests/test_bdist_rpm.py.skip-distutils-tests-that-fail-in-rpmbuild Python-3.2.2/Lib/distutils/tests/test_bdist_rpm.py +--- Python-3.2.2/Lib/distutils/tests/test_bdist_rpm.py.skip-distutils-tests-that-fail-in-rpmbuild 2011-09-03 12:16:40.000000000 -0400 ++++ Python-3.2.2/Lib/distutils/tests/test_bdist_rpm.py 2011-09-10 05:04:56.328852558 -0400 +@@ -23,6 +23,7 @@ setup(name='foo', version='0.1', py_modu + + """ + ++@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-3.2.2/Lib/distutils/tests/test_build_ext.py.skip-distutils-tests-that-fail-in-rpmbuild Python-3.2.2/Lib/distutils/tests/test_build_ext.py 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/python-3.2b2-fix-test-gc-COUNT_ALLOCS.patch b/00141-fix-test_gc_with_COUNT_ALLOCS.patch similarity index 100% rename from python-3.2b2-fix-test-gc-COUNT_ALLOCS.patch rename to 00141-fix-test_gc_with_COUNT_ALLOCS.patch 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/python3.spec b/python3.spec index aa537ef..2827e6f 100644 --- a/python3.spec +++ b/python3.spec @@ -118,7 +118,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 1%{?dist} +Release: 2%{?dist} License: Python Group: Development/Languages @@ -234,6 +234,10 @@ Patch104: python-3.1.2-more-configuration-flags.patch # (rhbz:553020); partially upstream as http://bugs.python.org/issue7647 Patch105: python-3.2a1-statvfs-f_flag-constants.patch +# Only used when "%{_lib}" == "lib64" +# Another lib64 fix, for distutils/tests/test_install.py; not upstream: +Patch106: 00106-lib64-fix-for-test_install.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 @@ -241,20 +245,6 @@ Patch105: python-3.2a1-statvfs-f_flag-constants.patch # Not yet sent upstream: Patch125: less-verbose-COUNT_ALLOCS.patch -# test_weakref's test_callback_in_cycle_resurrection doesn't work with -# COUNT_ALLOCS, as the metrics keep "C" alive. Work around this for our -# debug build: -# Not yet sent upstream -Patch126: python-3.2b2-test-weakref-COUNT_ALLOCS_fix.patch - -# Similar COUNT_ALLOCS fixes for test_gc -# Not yet sent upstream -Patch127: python-3.2b2-fix-test-gc-COUNT_ALLOCS.patch - -# Similar COUNT_ALLOCS fixes for test_sys -# Not yet sent upstream -Patch128: python-3.2b2-test_sys-COUNT_ALLOCS.patch - # In my koji builds, /root/bin is in the PATH for some reason # This leads to test_subprocess.py failing, due to "test_leaking_fds_on_error" # trying every dir in PATH for "nonexisting_i_hope", which leads to it raising @@ -277,6 +267,74 @@ Patch130: python-2.7.2-tsc-on-ppc.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 + +# 00133-skip-test_dl.patch is not relevant for python3: the "dl" module no +# longer exists + +# 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 + +# test_weakref's test_callback_in_cycle_resurrection doesn't work with +# COUNT_ALLOCS, as the metrics keep "C" alive. Work around this for our +# debug build: +# Not yet sent upstream +Patch135: 00135-fix-test-within-test_weakref-in-debug-build.patch + +# Patch136: 00136-skip-tests-of-seeking-stdin-in-rpmbuild.patch does not seem +# to be needed by python3 + +# Some tests within distutils fail when run in an rpmbuild: +Patch137: 00137-skip-distutils-tests-that-fail-in-rpmbuild.patch + +# Patch138: 00138-fix-distutils-tests-in-debug-build.patch is not relevant for +# python3 + +# 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 + +# Patch140: 00140-skip-test_ctypes-known-failure-on-sparc.patch does not appear +# to be relevant for python3 + +# 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: @@ -424,6 +482,7 @@ rm -r Modules/zlib || exit 1 %if "%{_lib}" == "lib64" %patch102 -p1 +%patch106 -p1 %endif %patch104 -p1 -b .more-configuration-flags @@ -431,9 +490,7 @@ rm -r Modules/zlib || exit 1 %patch105 -p1 -b .statvfs-f-flag-constants %patch125 -p1 -b .less-verbose-COUNT_ALLOCS -%patch126 -p1 -%patch127 -p1 -%patch128 -p1 + %patch129 -p1 %patch130 -p1 -b .tsc-on-ppc @@ -441,6 +498,20 @@ rm -r Modules/zlib || exit 1 %patch131 -p1 %endif +%patch132 -p1 +# 00133: not for python3 +%patch134 -p1 +%patch135 -p1 +# 00136: not for python3 +%patch137 -p1 +# 00138: not for python3 +%ifarch %{arm} +%patch139 -p1 +%endif +# 00140: not for python3 +%patch141 -p1 +%patch142 -p1 + # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. # @@ -849,79 +920,16 @@ CheckPython() { echo STARTING: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName - # Notes about disabled tests: - # - # test_distutils.py - # This one tries to build an RPM inside the rpmbuild; I'll simply - # let this one fail for now (has trouble linking against -lpython3.1; perhaps - # LD_LIBRARY_PATH is being discarded somewhere?) - # - # 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_openpty: - # Fails in Koji, possibly due to a mock issue (rhbz#714627) - # test test_openpty failed -- Traceback (most recent call last): - # File "/builddir/build/BUILD/Python-3.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) - # test test_pty failed -- Traceback (most recent call last): - # File "/builddir/build/BUILD/Python-3.2/Lib/test/test_pty.py", line 114, in test_fork - # pid, master_fd = pty.fork() - # File "/builddir/build/BUILD/Python-3.2/Lib/pty.py", line 107, in fork - # master_fd, slave_fd = openpty() - # File "/builddir/build/BUILD/Python-3.2/Lib/pty.py", line 29, in openpty - # master_fd, slave_name = _open_terminal() - # File "/builddir/build/BUILD/Python-3.2/Lib/pty.py", line 70, in _open_terminal - # raise os.error('out of pty devices') - # OSError: out of pty devices - # - # test_socket: - # test_socket.py:testSockName can fail here if DNS isn't properly set up: - # my_ip_addr = socket.gethostbyname(socket.gethostname()) - # socket.gaierror: [Errno -2] Name or service not known - # - # test_telnet: - # can get a "socket.error: [Errno 104] Connection reset by peer" - # - # Some additional tests fail when running the test suite as non-root outside of - # the build, due to permissions issues. - -%ifarch %{sparc} - EXCLUDED_TESTS="\ - test_distutils \ - test_httplib \ - test_http_cookies \ - test_openpty \ - test_pty.py \ - test_socket \ - test_telnet \ - test_ctypes \ - test_openpty \ - test_pty \ - %{nil}" -%else - EXCLUDED_TESTS="\ - test_distutils \ - test_httplib \ - test_http_cookies \ - test_openpty \ - test_pty.py \ - test_socket \ - test_telnet \ - %{nil}" -%endif # Note that we're running the tests using the version of the code in the builddir, # not in the buildroot. - # Run the upstream test suite + # 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= \ LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \ - --verbose --findleaks \ - -x $EXCLUDED_TESTS + --verbose --findleaks echo FINISHED: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName @@ -1308,6 +1316,12 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Sat Sep 10 2011 David Malcolm - 3.2.2-2 +- 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 106, 133-142 sparsely, moving +patches for consistency with python.spec: 128 to 134, 126 to 135, 127 to 141) + * Tue Sep 6 2011 David Malcolm - 3.2.2-1 - 3.2.2 From 5a4896796b1b92a56db40d1bee419c3de8853138 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sat, 10 Sep 2011 08:23:40 -0400 Subject: [PATCH 070/416] minor fixes to reduce python/python3 delta --- python3.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python3.spec b/python3.spec index 2827e6f..5550990 100644 --- a/python3.spec +++ b/python3.spec @@ -920,8 +920,8 @@ CheckPython() { 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. + # Note that we're running the tests using the version of the code in the + # builddir, not in the buildroot. # Run the upstream test suite, setting "WITHIN_PYTHON_RPM_BUILD" so that the # our non-standard decorators take effect on the relevant tests: From c923b51771c24d357af82c12560dfa9c7d76fff3 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 12 Sep 2011 17:39:27 -0400 Subject: [PATCH 071/416] renumber and rename patches for consistency with python.spec * Mon Sep 12 2011 David Malcolm - 3.2.2-3 - renumber and rename patches for consistency with python.spec (8 to 55, 106 to 104, 6 to 111, 104 to 113, 105 to 114, 125, 131, 130 to 143) --- ...2-systemtap.patch => 00055-systemtap.patch | 0 ... => 00104-lib64-fix-for-test_install.patch | 0 ...tic-lib.patch => 00111-no-static-lib.patch | 0 ...ch => 00113-more-configuration-flags.patch | 0 ...ch => 00114-statvfs-f_flag-constants.patch | 0 ...h => 00125-less-verbose-COUNT_ALLOCS.patch | 0 ...ch => 00131-disable-tests-in-test_io.patch | 0 ...tsc-on-ppc.patch => 00143-tsc-on-ppc.patch | 0 python3.spec | 63 +++++++++++-------- 9 files changed, 37 insertions(+), 26 deletions(-) rename python-3.2b2-systemtap.patch => 00055-systemtap.patch (100%) rename 00106-lib64-fix-for-test_install.patch => 00104-lib64-fix-for-test_install.patch (100%) rename python-3.2.1-no-static-lib.patch => 00111-no-static-lib.patch (100%) rename python-3.1.2-more-configuration-flags.patch => 00113-more-configuration-flags.patch (100%) rename python-3.2a1-statvfs-f_flag-constants.patch => 00114-statvfs-f_flag-constants.patch (100%) rename less-verbose-COUNT_ALLOCS.patch => 00125-less-verbose-COUNT_ALLOCS.patch (100%) rename python-2.7.2-disable-tests-in-test_io.patch => 00131-disable-tests-in-test_io.patch (100%) rename python-2.7.2-tsc-on-ppc.patch => 00143-tsc-on-ppc.patch (100%) diff --git a/python-3.2b2-systemtap.patch b/00055-systemtap.patch similarity index 100% rename from python-3.2b2-systemtap.patch rename to 00055-systemtap.patch diff --git a/00106-lib64-fix-for-test_install.patch b/00104-lib64-fix-for-test_install.patch similarity index 100% rename from 00106-lib64-fix-for-test_install.patch rename to 00104-lib64-fix-for-test_install.patch diff --git a/python-3.2.1-no-static-lib.patch b/00111-no-static-lib.patch similarity index 100% rename from python-3.2.1-no-static-lib.patch rename to 00111-no-static-lib.patch diff --git a/python-3.1.2-more-configuration-flags.patch b/00113-more-configuration-flags.patch similarity index 100% rename from python-3.1.2-more-configuration-flags.patch rename to 00113-more-configuration-flags.patch diff --git a/python-3.2a1-statvfs-f_flag-constants.patch b/00114-statvfs-f_flag-constants.patch similarity index 100% rename from python-3.2a1-statvfs-f_flag-constants.patch rename to 00114-statvfs-f_flag-constants.patch diff --git a/less-verbose-COUNT_ALLOCS.patch b/00125-less-verbose-COUNT_ALLOCS.patch similarity index 100% rename from less-verbose-COUNT_ALLOCS.patch rename to 00125-less-verbose-COUNT_ALLOCS.patch diff --git a/python-2.7.2-disable-tests-in-test_io.patch b/00131-disable-tests-in-test_io.patch similarity index 100% rename from python-2.7.2-disable-tests-in-test_io.patch rename to 00131-disable-tests-in-test_io.patch diff --git a/python-2.7.2-tsc-on-ppc.patch b/00143-tsc-on-ppc.patch similarity index 100% rename from python-2.7.2-tsc-on-ppc.patch rename to 00143-tsc-on-ppc.patch diff --git a/python3.spec b/python3.spec index 5550990..c7a839d 100644 --- a/python3.spec +++ b/python3.spec @@ -86,8 +86,7 @@ # We need to get a newer configure generated out of configure.in for the following # patches: # patch 55 (systemtap) -# patch 103 (debug build) -# patch 104 (more config flags) +# patch 113 (more config flags) # # For patch 55 (systemtap), we need to get a new header for configure to use # @@ -118,7 +117,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 2%{?dist} +Release: 3%{?dist} License: Python Group: Development/Languages @@ -211,39 +210,42 @@ Patch1: Python-3.1.1-rpath.patch # It's simplest to remove them: Patch3: python-3.2b2-remove-mimeaudio-tests.patch -# Patch the Makefile.pre.in so that the generated Makefile doesn't try to build -# a libpythonMAJOR.MINOR.a (bug 550692): -Patch6: python-3.2.1-no-static-lib.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); ported to 3.1.1 by # dmalcolm -Patch8: python-3.2b2-systemtap.patch +Patch55: 00055-systemtap.patch Patch102: python-3.2.1-lib64.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: 00111-no-static-lib.patch + +# Patch112: python-2.7rc1-debug-build.patch: this is not relevant to Python 3, +# for 3.2 onwards + # 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 -Patch104: python-3.1.2-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 -Patch105: python-3.2a1-statvfs-f_flag-constants.patch - -# Only used when "%{_lib}" == "lib64" -# Another lib64 fix, for distutils/tests/test_install.py; not upstream: -Patch106: 00106-lib64-fix-for-test_install.patch +Patch114: 00114-statvfs-f_flag-constants.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 +Patch125: 00125-less-verbose-COUNT_ALLOCS.patch # In my koji builds, /root/bin is in the PATH for some reason # This leads to test_subprocess.py failing, due to "test_leaking_fds_on_error" @@ -256,16 +258,15 @@ Patch125: less-verbose-COUNT_ALLOCS.patch # Not yet sent upstream Patch129: python-3.2.1-fix-test-subprocess-with-nonreadable-path-dir.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 -Patch130: python-2.7.2-tsc-on-ppc.patch +# Python 2's: +# Patch130: python-2.7.2-add-extension-suffix-to-python-config.patch +# is not relevant to Python 3 (for 3.2 onwards) # 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 +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: @@ -315,6 +316,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, @@ -474,25 +480,25 @@ rm -r Modules/zlib || exit 1 # %patch1 -p1 %patch3 -p1 -b .remove-mimeaudio-tests -%patch6 -p1 -b .no-static-lib %if 0%{?with_systemtap} -%patch8 -p1 -b .systemtap +%patch55 -p1 -b .systemtap %endif %if "%{_lib}" == "lib64" %patch102 -p1 -%patch106 -p1 +%patch104 -p1 %endif -%patch104 -p1 -b .more-configuration-flags -%patch105 -p1 -b .statvfs-f-flag-constants +%patch111 -p1 +# 112: not for python3 +%patch113 -p1 +%patch114 -p1 %patch125 -p1 -b .less-verbose-COUNT_ALLOCS %patch129 -p1 -%patch130 -p1 -b .tsc-on-ppc %ifarch ppc ppc64 %patch131 -p1 @@ -511,6 +517,7 @@ rm -r Modules/zlib || exit 1 # 00140: not for python3 %patch141 -p1 %patch142 -p1 +%patch143 -p1 -b .tsc-on-ppc # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1316,6 +1323,10 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon Sep 12 2011 David Malcolm - 3.2.2-3 +- renumber and rename patches for consistency with python.spec (8 to 55, 106 +to 104, 6 to 111, 104 to 113, 105 to 114, 125, 131, 130 to 143) + * Sat Sep 10 2011 David Malcolm - 3.2.2-2 - rewrite of "check", introducing downstream-only hooks for skipping specific cases in an rpmbuild (patch 132), and fixing/skipping failing tests in a more From 5fe31d812ade592067a2e1063ae259f9a5b29562 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 13 Sep 2011 14:59:31 -0400 Subject: [PATCH 072/416] disable gdbm module to prepare for gdbm soname bump * Tue Sep 13 2011 David Malcolm - 3.2.2-4 - disable gdbm module to prepare for gdbm soname bump --- python3.spec | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index c7a839d..c2d3e33 100644 --- a/python3.spec +++ b/python3.spec @@ -59,6 +59,8 @@ %global with_valgrind 0 %endif +%global with_gdbm 0 + # Change from yes to no to turn this off %global with_computed_gotos yes @@ -117,7 +119,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 3%{?dist} +Release: 4%{?dist} License: Python Group: Development/Languages @@ -135,7 +137,9 @@ BuildRequires: db4-devel >= 4.7 BuildRequires: expat-devel BuildRequires: findutils BuildRequires: gcc-c++ +%if %{with_gdbm} BuildRequires: gdbm-devel +%endif BuildRequires: glibc-devel BuildRequires: gmp-devel BuildRequires: libffi-devel @@ -321,6 +325,11 @@ 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: +# python.spec's +# Patch144: 00144-no-gdbm.patch +# is not needed in python3.spec + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora 17 onwards, @@ -518,6 +527,7 @@ rm -r Modules/zlib || exit 1 %patch141 -p1 %patch142 -p1 %patch143 -p1 -b .tsc-on-ppc +# 00144: not for python3 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -995,7 +1005,9 @@ rm -fr %{buildroot} %{dynload_dir}/_curses_panel.%{SOABI_optimized}.so %{dynload_dir}/_dbm.%{SOABI_optimized}.so %{dynload_dir}/_elementtree.%{SOABI_optimized}.so +%if %{with_gdbm} %{dynload_dir}/_gdbm.%{SOABI_optimized}.so +%endif %{dynload_dir}/_hashlib.%{SOABI_optimized}.so %{dynload_dir}/_heapq.%{SOABI_optimized}.so %{dynload_dir}/_json.%{SOABI_optimized}.so @@ -1231,7 +1243,9 @@ rm -fr %{buildroot} %{dynload_dir}/_curses_panel.%{SOABI_debug}.so %{dynload_dir}/_dbm.%{SOABI_debug}.so %{dynload_dir}/_elementtree.%{SOABI_debug}.so +%if %{with_gdbm} %{dynload_dir}/_gdbm.%{SOABI_debug}.so +%endif %{dynload_dir}/_hashlib.%{SOABI_debug}.so %{dynload_dir}/_heapq.%{SOABI_debug}.so %{dynload_dir}/_json.%{SOABI_debug}.so @@ -1323,6 +1337,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Tue Sep 13 2011 David Malcolm - 3.2.2-4 +- disable gdbm module to prepare for gdbm soname bump + * Mon Sep 12 2011 David Malcolm - 3.2.2-3 - renumber and rename patches for consistency with python.spec (8 to 55, 106 to 104, 6 to 111, 104 to 113, 105 to 114, 125, 131, 130 to 143) From a5cef79f49350a8162bc9342da712f415d41001d Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Wed, 14 Sep 2011 00:09:45 -0400 Subject: [PATCH 073/416] add a way to easily turn off the %check section --- python3.spec | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/python3.spec b/python3.spec index c2d3e33..fd40fd3 100644 --- a/python3.spec +++ b/python3.spec @@ -64,6 +64,9 @@ # Change from yes to no to turn this off %global with_computed_gotos yes +# Turn this to 0 to turn off the "check" phase: +%global run_selftest_suite 1 + # We want to byte-compile the .py files within the packages using the new # python3 binary. # @@ -952,12 +955,16 @@ CheckPython() { } +%if 0%{run_selftest_suite} + # Check each of the configurations: %if 0%{?with_debug_build} CheckPython debug %endif # with_debug_build CheckPython optimized +%endif # run_selftest_suite + # ====================================================== # Cleaning up From 0d5c338c39da29884c8c1034ba2093486e813191 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Wed, 14 Sep 2011 00:10:15 -0400 Subject: [PATCH 074/416] add note about python.spec's patch 145 --- python3.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python3.spec b/python3.spec index fd40fd3..ac462b6 100644 --- a/python3.spec +++ b/python3.spec @@ -333,6 +333,10 @@ Patch143: 00143-tsc-on-ppc.patch # Patch144: 00144-no-gdbm.patch # is not needed in python3.spec +# python.spec's +# Patch145: 00145-force-sys-platform-to-be-linux2.patch +# is upstream for Python 3 as of 3.2.2 + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora 17 onwards, @@ -531,6 +535,7 @@ rm -r Modules/zlib || exit 1 %patch142 -p1 %patch143 -p1 -b .tsc-on-ppc # 00144: not for python3 +# 00145: not for python3 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. From 00fd884b35916be732975aa1d3cbeeb7d7968951 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Wed, 14 Sep 2011 00:10:35 -0400 Subject: [PATCH 075/416] fix builds that set with_debug_build to 0 --- python3.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python3.spec b/python3.spec index ac462b6..84d0847 100644 --- a/python3.spec +++ b/python3.spec @@ -899,9 +899,11 @@ done # Create "/usr/bin/python3-debug", a symlink to the python3 debug binary, to # avoid the user having to know the precise version and ABI flags. (see # e.g. rhbz#676748): +%if 0%{?with_debug_build} ln -s \ %{_bindir}/python%{LDVERSION_debug} \ %{buildroot}%{_bindir}/python3-debug +%endif # # Systemtap hooks: From b8f92b4cd5f02708ff77df833ffc7db506be4b9e Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Wed, 14 Sep 2011 02:17:28 -0400 Subject: [PATCH 076/416] support OpenSSL FIPS mode in _hashlib and hashlib * Wed Sep 14 2011 David Malcolm - 3.2.2-5 - support OpenSSL FIPS mode in _hashlib and hashlib; don't build the _md5 and _sha* modules, relying on _hashlib in hashlib (rhbz#563986; patch 146) --- 00146-hashlib-fips.patch | 613 +++++++++++++++++++++++++++++++++++++++ python3.spec | 36 ++- 2 files changed, 644 insertions(+), 5 deletions(-) create mode 100644 00146-hashlib-fips.patch diff --git a/00146-hashlib-fips.patch b/00146-hashlib-fips.patch new file mode 100644 index 0000000..da83205 --- /dev/null +++ b/00146-hashlib-fips.patch @@ -0,0 +1,613 @@ +diff -up Python-3.2.2/Lib/hashlib.py.hashlib-fips Python-3.2.2/Lib/hashlib.py +--- Python-3.2.2/Lib/hashlib.py.hashlib-fips 2011-09-03 12:16:41.000000000 -0400 ++++ Python-3.2.2/Lib/hashlib.py 2011-09-14 01:55:48.090252006 -0400 +@@ -23,6 +23,16 @@ the zlib module. + Choose your hash function wisely. Some have known collision weaknesses. + sha384 and sha512 will be slow on 32 bit platforms. + ++If the underlying implementation supports "FIPS mode", and this is enabled, it ++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. ++ + Hash objects have these methods: + - update(arg): Update the hash object with the bytes in arg. Repeated calls + are equivalent to a single call with the concatenation of all +@@ -96,33 +106,36 @@ def __get_openssl_constructor(name): + 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, data=b'', usedforsecurity=True): ++ """new(name, data=b'', usedforsecurity=True) - Return a new hashing object using ++ the named algorithm; optionally initialized with data (which must be bytes). + +-def __py_new(name, data=b''): +- """new(name, data=b'') - Return a new hashing object using the named algorithm; +- optionally initialized with data (which must be bytes). ++ The 'usedforsecurity' keyword argument does nothing, and is for compatibilty ++ with the OpenSSL implementation + """ + return __get_builtin_constructor(name)(data) + + +-def __hash_new(name, data=b''): +- """new(name, data=b'') - Return a new hashing object using the named algorithm; +- optionally initialized with data (which must be bytes). ++def __hash_new(name, data=b'', usedforsecurity=True): ++ """new(name, data=b'', usedforsecurity=True) - Return a new hashing object using ++ the named algorithm; optionally initialized with data (which must be bytes). ++ ++ Override 'usedforsecurity' to False when using for non-security purposes in ++ a FIPS environment + """ + try: +- return _hashlib.new(name, data) ++ return _hashlib.new(name, data, 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)(data) +- ++ raise + + try: + import _hashlib +diff -up Python-3.2.2/Lib/test/test_hashlib.py.hashlib-fips Python-3.2.2/Lib/test/test_hashlib.py +--- Python-3.2.2/Lib/test/test_hashlib.py.hashlib-fips 2011-09-03 12:16:43.000000000 -0400 ++++ Python-3.2.2/Lib/test/test_hashlib.py 2011-09-14 01:45:48.462251974 -0400 +@@ -22,6 +22,19 @@ from test.support import _4G, precisionb + # Were we compiled --with-pydebug or with #define Py_DEBUG? + COMPILED_WITH_PYDEBUG = hasattr(sys, 'gettotalrefcount') + ++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() + + def hexstr(s): + assert isinstance(s, bytes), repr(s) +@@ -31,6 +44,16 @@ def hexstr(s): + r += h[(i >> 4) & 0xF] + h[i & 0xF] + return r + ++# hashlib and _hashlib-based functions support a "usedforsecurity" keyword ++# argument, and FIPS mode requires that it be used overridden with a False ++# value for these selftests to work. Other cryptographic code within Python ++# doesn't support this keyword. ++# Modify a function to one in which "usedforsecurity=False" is added to the ++# keyword arguments: ++def suppress_fips(f): ++ def g(*args, **kwargs): ++ return f(*args, usedforsecurity=False, **kwargs) ++ return g + + class HashLibTestCase(unittest.TestCase): + supported_hash_names = ( 'md5', 'MD5', 'sha1', 'SHA1', +@@ -59,11 +82,11 @@ class HashLibTestCase(unittest.TestCase) + # For each algorithm, test the direct constructor and the use + # of hashlib.new given the algorithm name. + for algorithm, constructors in self.constructors_to_test.items(): +- constructors.add(getattr(hashlib, algorithm)) ++ constructors.add(suppress_fips(getattr(hashlib, algorithm))) + def _test_algorithm_via_hashlib_new(data=None, _alg=algorithm): + if data is None: +- return hashlib.new(_alg) +- return hashlib.new(_alg, data) ++ return suppress_fips(hashlib.new)(_alg) ++ return suppress_fips(hashlib.new)(_alg, data) + constructors.add(_test_algorithm_via_hashlib_new) + + _hashlib = self._conditional_import_module('_hashlib') +@@ -75,22 +98,7 @@ class HashLibTestCase(unittest.TestCase) + for algorithm, constructors in self.constructors_to_test.items(): + constructor = getattr(_hashlib, 'openssl_'+algorithm, None) + if constructor: +- constructors.add(constructor) +- +- _md5 = self._conditional_import_module('_md5') +- if _md5: +- self.constructors_to_test['md5'].add(_md5.md5) +- _sha1 = self._conditional_import_module('_sha1') +- if _sha1: +- self.constructors_to_test['sha1'].add(_sha1.sha1) +- _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) ++ constructors.add(suppress_fips(constructor)) + + super(HashLibTestCase, self).__init__(*args, **kwargs) + +@@ -138,7 +146,7 @@ class HashLibTestCase(unittest.TestCase) + + def test_hexdigest(self): + for name in self.supported_hash_names: +- h = hashlib.new(name) ++ h = hashlib.new(name, usedforsecurity=False) + assert isinstance(h.digest(), bytes), name + self.assertEqual(hexstr(h.digest()), h.hexdigest()) + +@@ -149,12 +157,12 @@ class HashLibTestCase(unittest.TestCase) + cees = b'c' * 126 + + 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(aas + bees + cees) + self.assertEqual(m1.digest(), m2.digest()) + +@@ -324,13 +332,13 @@ class HashLibTestCase(unittest.TestCase) + # for multithreaded operation (which is hardwired to 2048). + gil_minsize = 2048 + +- m = hashlib.md5() ++ m = hashlib.md5(usedforsecurity=False) + m.update(b'1') + m.update(b'#' * gil_minsize) + m.update(b'1') + self.assertEqual(m.hexdigest(), 'cb1e1a2cbc80be75e19935d621fb9b21') + +- m = hashlib.md5(b'x' * gil_minsize) ++ m = hashlib.md5(b'x' * gil_minsize, usedforsecurity=False) + self.assertEqual(m.hexdigest(), 'cfb767f225d58469c5de3632a8803958') + + @unittest.skipUnless(threading, 'Threading required for this test.') +@@ -370,6 +378,67 @@ 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") ++ ++ @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: ++ with self.assertRaisesRegexp(ValueError, '.*unknown cipher'): ++ m = hashlib.md5() ++ ++ if not self._conditional_import_module('_md5'): ++ with self.assertRaisesRegexp(ValueError, '.*unknown cipher'): ++ m = 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: ++ _hashlib = self._conditional_import_module('_hashlib') ++ if _hashlib: ++ assert hasattr(_hashlib, 'openssl_md5') ++ ++ # Ensure that _hashlib raises a ValueError on vanilla attempts to ++ # use MD5 in a FIPS-enforced setting: ++ with self.assertRaisesRegexp(ValueError, '.*unknown cipher'): ++ m = _hashlib.openssl_md5() ++ with self.assertRaisesRegexp(ValueError, '.*unknown cipher'): ++ m = _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(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.openssl_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 test_main(): + support.run_unittest(HashLibTestCase) + +diff -up Python-3.2.2/Modules/_hashopenssl.c.hashlib-fips Python-3.2.2/Modules/_hashopenssl.c +--- Python-3.2.2/Modules/_hashopenssl.c.hashlib-fips 2011-09-03 12:16:46.000000000 -0400 ++++ Python-3.2.2/Modules/_hashopenssl.c 2011-09-14 00:52:41.225252001 -0400 +@@ -37,6 +37,8 @@ + #endif + + /* EVP is the preferred interface to hashing in OpenSSL */ ++#include ++#include + #include + /* We use the object interface to discover what hashes OpenSSL supports. */ + #include +@@ -68,11 +70,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) +@@ -117,6 +127,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 PyUnicode_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 +@@ -303,15 +355,16 @@ EVP_repr(EVPobject *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; + PyObject *data_obj = NULL; ++ int usedforsecurity = 1; + Py_buffer view; + char *nameStr; + const EVP_MD *digest; + +- if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O:HASH", kwlist, +- &name_obj, &data_obj)) { ++ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|Oi:HASH", kwlist, ++ &name_obj, &data_obj, &usedforsecurity)) { + return -1; + } + +@@ -332,7 +385,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); +@@ -416,7 +474,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; + +@@ -431,7 +490,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) { +@@ -455,21 +519,29 @@ 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; + PyObject *data_obj = NULL; ++ int usedforsecurity = 1; + Py_buffer view = { 0 }; + PyObject *ret_obj; + char *name; + const EVP_MD *digest; + +- if (!PyArg_ParseTupleAndKeywords(args, kwdict, "O|O:new", kwlist, +- &name_obj, &data_obj)) { ++ if (!PyArg_ParseTupleAndKeywords(args, kwdict, "O|Oi:new", kwlist, ++ &name_obj, &data_obj, &usedforsecurity)) { + return NULL; + } + +@@ -483,7 +555,8 @@ EVP_new(PyObject *self, PyObject *args, + + digest = EVP_get_digestbyname(name); + +- ret_obj = EVPnew(name_obj, digest, NULL, (unsigned char*)view.buf, view.len); ++ ret_obj = EVPnew(name_obj, digest, NULL, (unsigned char*)view.buf, view.len, ++ usedforsecurity); + + if (data_obj) + PyBuffer_Release(&view); +@@ -547,55 +620,115 @@ generate_hash_name_list(void) + + + /* +- * 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) \ + { \ +- PyObject *data_obj = NULL; \ +- Py_buffer view = { 0 }; \ +- PyObject *ret_obj; \ +- \ +- if (!PyArg_ParseTuple(args, "|O:" #NAME , &data_obj)) { \ +- return NULL; \ +- } \ +- \ +- if (data_obj) \ +- GET_BUFFER_VIEW_OR_ERROUT(data_obj, &view); \ +- \ +- ret_obj = EVPnew( \ +- CONST_ ## NAME ## _name_obj, \ +- NULL, \ +- CONST_new_ ## NAME ## _ctx_p, \ +- (unsigned char*)view.buf, \ +- view.len); \ +- \ +- if (data_obj) \ +- PyBuffer_Release(&view); \ +- return ret_obj; \ ++ return implement_specific_EVP_new(self, args, kwdict, \ ++ "|Oi:" #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}; ++ PyObject *data_obj = NULL; ++ Py_buffer view = { 0 }; ++ int usedforsecurity = 1; ++ int idx; ++ PyObject *ret_obj = NULL; ++ ++ assert(cached_info); ++ ++ if (!PyArg_ParseTupleAndKeywords(args, kwdict, format, kwlist, ++ &data_obj, &usedforsecurity)) { ++ return NULL; ++ } ++ ++ if (data_obj) ++ GET_BUFFER_VIEW_OR_ERROUT(data_obj, &view); ++ ++ 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"); ++ } ++ } ++ ++ if (data_obj) ++ PyBuffer_Release(&view); ++ ++ 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 = PyUnicode_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)); \ +- } \ +-} while (0); ++/* ++ 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 with 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 = PyUnicode_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 +@@ -641,12 +774,10 @@ PyInit__hashlib(void) + { + PyObject *m, *openssl_md_meth_names; + +- OpenSSL_add_all_digests(); ++ SSL_load_error_strings(); ++ SSL_library_init(); + +- /* 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. */ ++ OpenSSL_add_all_digests(); + + Py_TYPE(&EVPtype) = &PyType_Type; + if (PyType_Ready(&EVPtype) < 0) diff --git a/python3.spec b/python3.spec index 84d0847..f102431 100644 --- a/python3.spec +++ b/python3.spec @@ -122,7 +122,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 4%{?dist} +Release: 5%{?dist} License: Python Group: Development/Languages @@ -337,6 +337,22 @@ Patch143: 00143-tsc-on-ppc.patch # Patch145: 00145-force-sys-platform-to-be-linux2.patch # is upstream for Python 3 as of 3.2.2 +# 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 ; see RHEL6 +# python 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 +# (rhbz#563986) +Patch146: 00146-hashlib-fips.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora 17 onwards, @@ -491,6 +507,15 @@ 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 hashlib.md5 is implemented within _hashlib via +# OpenSSL (and thus respects FIPS mode), and does not fall back to _md5 +for f in md5module.c sha1module.c sha256module.c sha512module.c; do + rm Modules/$f +done + # # Apply patches: # @@ -536,6 +561,7 @@ rm -r Modules/zlib || exit 1 %patch143 -p1 -b .tsc-on-ppc # 00144: not for python3 # 00145: not for python3 +%patch146 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1264,15 +1290,11 @@ rm -fr %{buildroot} %{dynload_dir}/_heapq.%{SOABI_debug}.so %{dynload_dir}/_json.%{SOABI_debug}.so %{dynload_dir}/_lsprof.%{SOABI_debug}.so -%{dynload_dir}/_md5.%{SOABI_debug}.so %{dynload_dir}/_multibytecodec.%{SOABI_debug}.so %{dynload_dir}/_multiprocessing.%{SOABI_debug}.so %{dynload_dir}/_pickle.%{SOABI_debug}.so %{dynload_dir}/_posixsubprocess.%{SOABI_debug}.so %{dynload_dir}/_random.%{SOABI_debug}.so -%{dynload_dir}/_sha1.%{SOABI_debug}.so -%{dynload_dir}/_sha256.%{SOABI_debug}.so -%{dynload_dir}/_sha512.%{SOABI_debug}.so %{dynload_dir}/_socket.%{SOABI_debug}.so %{dynload_dir}/_sqlite3.%{SOABI_debug}.so %{dynload_dir}/_ssl.%{SOABI_debug}.so @@ -1351,6 +1373,10 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Wed Sep 14 2011 David Malcolm - 3.2.2-5 +- support OpenSSL FIPS mode in _hashlib and hashlib; don't build the _md5 and +_sha* modules, relying on _hashlib in hashlib (rhbz#563986; patch 146) + * Tue Sep 13 2011 David Malcolm - 3.2.2-4 - disable gdbm module to prepare for gdbm soname bump From ab415c6cddafcf5b295bf4433c2142a84c0f8e64 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Fri, 16 Sep 2011 19:28:20 -0400 Subject: [PATCH 077/416] add a sys._debugmallocstats() function (patch 147) * Fri Sep 16 2011 David Malcolm - 3.2.2-6 - add a sys._debugmallocstats() function (patch 147) --- 00147-add-debug-malloc-stats.patch | 590 +++++++++++++++++++++++++++++ python3.spec | 11 +- 2 files changed, 600 insertions(+), 1 deletion(-) create mode 100644 00147-add-debug-malloc-stats.patch diff --git a/00147-add-debug-malloc-stats.patch b/00147-add-debug-malloc-stats.patch new file mode 100644 index 0000000..e2a8342 --- /dev/null +++ b/00147-add-debug-malloc-stats.patch @@ -0,0 +1,590 @@ +diff -up Python-3.2.2/Include/dictobject.h.add-debug-malloc-stats Python-3.2.2/Include/dictobject.h +--- Python-3.2.2/Include/dictobject.h.add-debug-malloc-stats 2011-09-03 12:16:40.000000000 -0400 ++++ Python-3.2.2/Include/dictobject.h 2011-09-16 18:57:24.969825060 -0400 +@@ -156,6 +156,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-3.2.2/Include/floatobject.h.add-debug-malloc-stats Python-3.2.2/Include/floatobject.h +--- Python-3.2.2/Include/floatobject.h.add-debug-malloc-stats 2011-09-03 12:16:40.000000000 -0400 ++++ Python-3.2.2/Include/floatobject.h 2011-09-16 18:57:24.970825060 -0400 +@@ -110,6 +110,8 @@ PyAPI_FUNC(double) _PyFloat_Unpack8(cons + /* free list api */ + PyAPI_FUNC(int) PyFloat_ClearFreeList(void); + ++PyAPI_FUNC(void) _PyFloat_DebugMallocStats(FILE* out); ++ + /* Format the object based on the format_spec, as defined in PEP 3101 + (Advanced String Formatting). */ + PyAPI_FUNC(PyObject *) _PyFloat_FormatAdvanced(PyObject *obj, +diff -up Python-3.2.2/Include/frameobject.h.add-debug-malloc-stats Python-3.2.2/Include/frameobject.h +--- Python-3.2.2/Include/frameobject.h.add-debug-malloc-stats 2011-09-03 12:16:40.000000000 -0400 ++++ Python-3.2.2/Include/frameobject.h 2011-09-16 18:57:24.970825060 -0400 +@@ -79,6 +79,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-3.2.2/Include/listobject.h.add-debug-malloc-stats Python-3.2.2/Include/listobject.h +--- Python-3.2.2/Include/listobject.h.add-debug-malloc-stats 2011-09-03 12:16:40.000000000 -0400 ++++ Python-3.2.2/Include/listobject.h 2011-09-16 18:57:24.971825060 -0400 +@@ -71,6 +71,8 @@ PyAPI_FUNC(PyObject *) _PyList_Extend(Py + #define PyList_GET_SIZE(op) Py_SIZE(op) + #endif + ++PyAPI_FUNC(void) _PyList_DebugMallocStats(FILE *out); ++ + #ifdef __cplusplus + } + #endif +diff -up Python-3.2.2/Include/methodobject.h.add-debug-malloc-stats Python-3.2.2/Include/methodobject.h +--- Python-3.2.2/Include/methodobject.h.add-debug-malloc-stats 2011-09-03 12:16:40.000000000 -0400 ++++ Python-3.2.2/Include/methodobject.h 2011-09-16 18:57:24.971825060 -0400 +@@ -81,6 +81,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-3.2.2/Include/object.h.add-debug-malloc-stats Python-3.2.2/Include/object.h +--- Python-3.2.2/Include/object.h.add-debug-malloc-stats 2011-09-03 12:16:40.000000000 -0400 ++++ Python-3.2.2/Include/object.h 2011-09-16 18:57:24.972825060 -0400 +@@ -919,6 +919,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-3.2.2/Include/objimpl.h.add-debug-malloc-stats Python-3.2.2/Include/objimpl.h +--- Python-3.2.2/Include/objimpl.h.add-debug-malloc-stats 2011-09-03 12:16:40.000000000 -0400 ++++ Python-3.2.2/Include/objimpl.h 2011-09-16 18:57:24.972825060 -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-3.2.2/Include/setobject.h.add-debug-malloc-stats Python-3.2.2/Include/setobject.h +--- Python-3.2.2/Include/setobject.h.add-debug-malloc-stats 2011-09-16 19:10:58.448817301 -0400 ++++ Python-3.2.2/Include/setobject.h 2011-09-16 19:12:16.343816559 -0400 +@@ -101,6 +101,8 @@ PyAPI_FUNC(PyObject *) PySet_Pop(PyObjec + PyAPI_FUNC(int) _PySet_Update(PyObject *set, PyObject *iterable); + #endif + ++PyAPI_FUNC(void) _PySet_DebugMallocStats(FILE *out); ++ + #ifdef __cplusplus + } + #endif +diff -up Python-3.2.2/Include/tupleobject.h.add-debug-malloc-stats Python-3.2.2/Include/tupleobject.h +--- Python-3.2.2/Include/tupleobject.h.add-debug-malloc-stats 2011-09-16 19:10:45.540817425 -0400 ++++ Python-3.2.2/Include/tupleobject.h 2011-09-16 19:12:41.446816320 -0400 +@@ -63,6 +63,7 @@ PyAPI_FUNC(void) _PyTuple_MaybeUntrack(P + #endif + + PyAPI_FUNC(int) PyTuple_ClearFreeList(void); ++PyAPI_FUNC(void) _PyTuple_DebugMallocStats(FILE *out); + + #ifdef __cplusplus + } +diff -up Python-3.2.2/Include/unicodeobject.h.add-debug-malloc-stats Python-3.2.2/Include/unicodeobject.h +--- Python-3.2.2/Include/unicodeobject.h.add-debug-malloc-stats 2011-09-03 12:16:40.000000000 -0400 ++++ Python-3.2.2/Include/unicodeobject.h 2011-09-16 18:57:24.973825060 -0400 +@@ -1670,6 +1670,8 @@ PyAPI_FUNC(Py_UNICODE*) PyUnicode_AsUnic + ); + #endif /* Py_LIMITED_API */ + ++PyAPI_FUNC(void) _PyUnicode_DebugMallocStats(FILE *out); ++ + #ifdef __cplusplus + } + #endif +diff -up Python-3.2.2/Lib/test/test_sys.py.add-debug-malloc-stats Python-3.2.2/Lib/test/test_sys.py +--- Python-3.2.2/Lib/test/test_sys.py.add-debug-malloc-stats 2011-09-16 18:57:24.940825060 -0400 ++++ Python-3.2.2/Lib/test/test_sys.py 2011-09-16 19:23:50.415809940 -0400 +@@ -564,6 +564,18 @@ class SysModuleTest(unittest.TestCase): + expected = None + self.check_fsencoding(fs_encoding, expected) + ++ def test_debugmallocstats(self): ++ # Test sys._debugmallocstats() ++ ++ import subprocess ++ ++ # Verify writing to stderr: ++ p = subprocess.Popen([sys.executable, ++ '-c', 'import sys; sys._debugmallocstats()'], ++ stderr=subprocess.PIPE) ++ out, err = p.communicate() ++ p.wait() ++ self.assertIn(b"arenas allocated current", err) + + class SizeofTest(unittest.TestCase): + +diff -up Python-3.2.2/Objects/classobject.c.add-debug-malloc-stats Python-3.2.2/Objects/classobject.c +--- Python-3.2.2/Objects/classobject.c.add-debug-malloc-stats 2011-09-03 12:16:47.000000000 -0400 ++++ Python-3.2.2/Objects/classobject.c 2011-09-16 18:57:24.975825060 -0400 +@@ -399,6 +399,15 @@ 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)); ++} ++ + /* ------------------------------------------------------------------------ + * instance method + */ +diff -up Python-3.2.2/Objects/dictobject.c.add-debug-malloc-stats Python-3.2.2/Objects/dictobject.c +--- Python-3.2.2/Objects/dictobject.c.add-debug-malloc-stats 2011-09-03 12:16:47.000000000 -0400 ++++ Python-3.2.2/Objects/dictobject.c 2011-09-16 18:57:24.976825060 -0400 +@@ -217,6 +217,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-3.2.2/Objects/floatobject.c.add-debug-malloc-stats Python-3.2.2/Objects/floatobject.c +--- Python-3.2.2/Objects/floatobject.c.add-debug-malloc-stats 2011-09-03 12:16:47.000000000 -0400 ++++ Python-3.2.2/Objects/floatobject.c 2011-09-16 18:57:24.981825060 -0400 +@@ -50,6 +50,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-3.2.2/Objects/frameobject.c.add-debug-malloc-stats Python-3.2.2/Objects/frameobject.c +--- Python-3.2.2/Objects/frameobject.c.add-debug-malloc-stats 2011-09-03 12:16:47.000000000 -0400 ++++ Python-3.2.2/Objects/frameobject.c 2011-09-16 18:57:24.982825060 -0400 +@@ -953,3 +953,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-3.2.2/Objects/listobject.c.add-debug-malloc-stats Python-3.2.2/Objects/listobject.c +--- Python-3.2.2/Objects/listobject.c.add-debug-malloc-stats 2011-09-03 12:16:47.000000000 -0400 ++++ Python-3.2.2/Objects/listobject.c 2011-09-16 18:57:24.983825060 -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-3.2.2/Objects/methodobject.c.add-debug-malloc-stats Python-3.2.2/Objects/methodobject.c +--- Python-3.2.2/Objects/methodobject.c.add-debug-malloc-stats 2011-09-03 12:16:47.000000000 -0400 ++++ Python-3.2.2/Objects/methodobject.c 2011-09-16 18:57:24.983825060 -0400 +@@ -303,6 +303,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-3.2.2/Objects/object.c.add-debug-malloc-stats Python-3.2.2/Objects/object.c +--- Python-3.2.2/Objects/object.c.add-debug-malloc-stats 2011-09-03 12:16:47.000000000 -0400 ++++ Python-3.2.2/Objects/object.c 2011-09-16 19:04:20.351821098 -0400 +@@ -1781,6 +1781,19 @@ PyMem_Free(void *p) + PyMem_FREE(p); + } + ++void ++_PyObject_DebugTypeStats(FILE *out) ++{ ++ _PyCFunction_DebugMallocStats(out); ++ _PyDict_DebugMallocStats(out); ++ _PyFloat_DebugMallocStats(out); ++ _PyFrame_DebugMallocStats(out); ++ _PyList_DebugMallocStats(out); ++ _PyMethod_DebugMallocStats(out); ++ _PySet_DebugMallocStats(out); ++ _PyTuple_DebugMallocStats(out); ++ _PyUnicode_DebugMallocStats(out); ++} + + /* These methods are used to control infinite recursion in repr, str, print, + etc. Container objects that may recursively contain themselves, +diff -up Python-3.2.2/Objects/obmalloc.c.add-debug-malloc-stats Python-3.2.2/Objects/obmalloc.c +--- Python-3.2.2/Objects/obmalloc.c.add-debug-malloc-stats 2011-09-03 12:16:47.000000000 -0400 ++++ Python-3.2.2/Objects/obmalloc.c 2011-09-16 18:57:24.985825060 -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) +@@ -1820,10 +1833,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]; +@@ -1834,7 +1847,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", +@@ -1844,36 +1857,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-3.2.2/Objects/setobject.c.add-debug-malloc-stats Python-3.2.2/Objects/setobject.c +--- Python-3.2.2/Objects/setobject.c.add-debug-malloc-stats 2011-09-03 12:16:47.000000000 -0400 ++++ Python-3.2.2/Objects/setobject.c 2011-09-16 18:57:24.986825060 -0400 +@@ -1090,6 +1090,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-3.2.2/Objects/tupleobject.c.add-debug-malloc-stats Python-3.2.2/Objects/tupleobject.c +--- Python-3.2.2/Objects/tupleobject.c.add-debug-malloc-stats 2011-09-03 12:16:47.000000000 -0400 ++++ Python-3.2.2/Objects/tupleobject.c 2011-09-16 18:57:24.987825060 -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-3.2.2/Objects/unicodeobject.c.add-debug-malloc-stats Python-3.2.2/Objects/unicodeobject.c +--- Python-3.2.2/Objects/unicodeobject.c.add-debug-malloc-stats 2011-09-03 12:16:47.000000000 -0400 ++++ Python-3.2.2/Objects/unicodeobject.c 2011-09-16 18:57:24.990825060 -0400 +@@ -10063,6 +10063,12 @@ _PyUnicode_Fini(void) + (void)PyUnicode_ClearFreeList(); + } + ++void _PyUnicode_DebugMallocStats(FILE *out) ++{ ++ _PyDebugAllocatorStats(out, "free PyUnicodeObject", numfree, ++ sizeof(PyUnicodeObject)); ++} ++ + void + PyUnicode_InternInPlace(PyObject **p) + { +diff -up Python-3.2.2/Python/pythonrun.c.add-debug-malloc-stats Python-3.2.2/Python/pythonrun.c +--- Python-3.2.2/Python/pythonrun.c.add-debug-malloc-stats 2011-09-16 19:24:44.747809422 -0400 ++++ Python-3.2.2/Python/pythonrun.c 2011-09-16 19:25:00.024809277 -0400 +@@ -547,7 +547,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-3.2.2/Python/sysmodule.c.add-debug-malloc-stats Python-3.2.2/Python/sysmodule.c +--- Python-3.2.2/Python/sysmodule.c.add-debug-malloc-stats 2011-09-03 12:16:49.000000000 -0400 ++++ Python-3.2.2/Python/sysmodule.c 2011-09-16 19:18:45.806812845 -0400 +@@ -994,6 +994,25 @@ a 11-tuple where the entries in the tupl + extern "C" { + #endif + ++static PyObject * ++sys_debugmallocstats(PyObject *self, PyObject *args) ++{ ++ _PyObject_DebugMallocStats(stderr); ++ fputc('\n', stderr); ++ _PyObject_DebugTypeStats(stderr); ++ ++ Py_RETURN_NONE; ++} ++PyDoc_STRVAR(debugmallocstats_doc, ++"_debugmallocstats([file])\n\ ++\n\ ++Print summary info to 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 *); +@@ -1090,6 +1109,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/python3.spec b/python3.spec index f102431..cb64c64 100644 --- a/python3.spec +++ b/python3.spec @@ -122,7 +122,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 5%{?dist} +Release: 6%{?dist} License: Python Group: Development/Languages @@ -353,6 +353,11 @@ Patch143: 00143-tsc-on-ppc.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, @@ -562,6 +567,7 @@ done # 00144: not for python3 # 00145: not for python3 %patch146 -p1 +%patch147 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1373,6 +1379,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Fri Sep 16 2011 David Malcolm - 3.2.2-6 +- add a sys._debugmallocstats() function (patch 147) + * Wed Sep 14 2011 David Malcolm - 3.2.2-5 - support OpenSSL FIPS mode in _hashlib and hashlib; don't build the _md5 and _sha* modules, relying on _hashlib in hashlib (rhbz#563986; patch 146) From 9b8d221300e8d8197926577f9d6282e4845bacba Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Fri, 30 Sep 2011 16:46:26 -0400 Subject: [PATCH 078/416] re-enable gdbm (patch 148; rhbz#742242) * Fri Sep 30 2011 David Malcolm - 3.2.2-7 - re-enable gdbm (patch 148; rhbz#742242) --- 00148-gdbm-1.9-magic-values.patch | 13 +++++++++++++ python3.spec | 15 ++++++++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 00148-gdbm-1.9-magic-values.patch diff --git a/00148-gdbm-1.9-magic-values.patch b/00148-gdbm-1.9-magic-values.patch new file mode 100644 index 0000000..e8ce828 --- /dev/null +++ b/00148-gdbm-1.9-magic-values.patch @@ -0,0 +1,13 @@ +diff -up Python-3.2.2/Lib/dbm/__init__.py.gdbm-1.9-magic Python-3.2.2/Lib/dbm/__init__.py +--- Python-3.2.2/Lib/dbm/__init__.py.gdbm-1.9-magic 2011-09-03 12:16:40.000000000 -0400 ++++ Python-3.2.2/Lib/dbm/__init__.py 2011-09-30 15:47:27.488863694 -0400 +@@ -166,7 +166,7 @@ def whichdb(filename): + return "" + + # Check for GNU dbm +- if magic == 0x13579ace: ++ if magic in (0x13579ace, 0x13579acd, 0x13579acf): + return "dbm.gnu" + + # Later versions of Berkeley db hash file have a 12-byte pad in +diff -up Python-3.2.2/Misc/NEWS.gdbm-1.9-magic Python-3.2.2/Misc/NEWS diff --git a/python3.spec b/python3.spec index cb64c64..a264334 100644 --- a/python3.spec +++ b/python3.spec @@ -59,7 +59,7 @@ %global with_valgrind 0 %endif -%global with_gdbm 0 +%global with_gdbm 1 # Change from yes to no to turn this off %global with_computed_gotos yes @@ -122,7 +122,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 6%{?dist} +Release: 7%{?dist} License: Python Group: Development/Languages @@ -358,6 +358,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, @@ -366,7 +370,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) # @@ -568,6 +572,7 @@ done # 00145: not for python3 %patch146 -p1 %patch147 -p1 +%patch148 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -655,6 +660,7 @@ BuildPython() { --with-valgrind \ %endif --with-system-expat \ + --with-dbmliborder=gdbm:ndbm:bdb \ $ExtraConfigArgs \ --with-computed-gotos=%{with_computed_gotos} \ %{nil} @@ -1379,6 +1385,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Fri Sep 30 2011 David Malcolm - 3.2.2-7 +- re-enable gdbm (patch 148; rhbz#742242) + * Fri Sep 16 2011 David Malcolm - 3.2.2-6 - add a sys._debugmallocstats() function (patch 147) From e2a3db4dedb92ecbe2df3545d19dc95e243d54c3 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 10 Oct 2011 17:14:54 -0400 Subject: [PATCH 079/416] 3.2.2-8: cherrypick fix for distutils not using __pycache__ when byte-compiling (rhbz#722578) * Mon Oct 10 2011 David Malcolm - 3.2.2-8 - cherrypick fix for distutils not using __pycache__ when byte-compiling files (rhbz#722578) --- ...sue11254-pycache-bytecompilation-fix.patch | 146 ++++++++++++++++++ python3.spec | 12 +- 2 files changed, 157 insertions(+), 1 deletion(-) create mode 100644 00149-backport-issue11254-pycache-bytecompilation-fix.patch diff --git a/00149-backport-issue11254-pycache-bytecompilation-fix.patch b/00149-backport-issue11254-pycache-bytecompilation-fix.patch new file mode 100644 index 0000000..d3651b0 --- /dev/null +++ b/00149-backport-issue11254-pycache-bytecompilation-fix.patch @@ -0,0 +1,146 @@ +diff -up Python-3.2.2/Doc/distutils/apiref.rst.issue11254 Python-3.2.2/Doc/distutils/apiref.rst +--- Python-3.2.2/Doc/distutils/apiref.rst.issue11254 2011-09-03 12:16:38.000000000 -0400 ++++ Python-3.2.2/Doc/distutils/apiref.rst 2011-10-10 17:01:23.167196855 -0400 +@@ -1204,9 +1204,9 @@ other utility module. + .. function:: byte_compile(py_files[, optimize=0, force=0, prefix=None, base_dir=None, verbose=1, dry_run=0, direct=None]) + + Byte-compile a collection of Python source files to either :file:`.pyc` or +- :file:`.pyo` files in the same directory. *py_files* is a list of files to +- compile; any files that don't end in :file:`.py` are silently skipped. +- *optimize* must be one of the following: ++ :file:`.pyo` files in a :file:`__pycache__` subdirectory (see :pep:`3147`). ++ *py_files* is a list of files to compile; any files that don't end in ++ :file:`.py` are silently skipped. *optimize* must be one of the following: + + * ``0`` - don't optimize (generate :file:`.pyc`) + * ``1`` - normal optimization (like ``python -O``) +@@ -1231,6 +1231,11 @@ other utility module. + is used by the script generated in indirect mode; unless you know what you're + doing, leave it set to ``None``. + ++ .. versionchanged:: 3.2.3 ++ Create ``.pyc`` or ``.pyo`` files with an :func:`import magic tag ++ ` in their name, in a :file:`__pycache__` subdirectory ++ instead of files without tag in the current directory. ++ + + .. function:: rfc822_escape(header) + +diff -up Python-3.2.2/Lib/distutils/tests/test_build_py.py.issue11254 Python-3.2.2/Lib/distutils/tests/test_build_py.py +--- Python-3.2.2/Lib/distutils/tests/test_build_py.py.issue11254 2011-09-03 12:16:40.000000000 -0400 ++++ Python-3.2.2/Lib/distutils/tests/test_build_py.py 2011-10-10 17:01:23.167196855 -0400 +@@ -3,6 +3,7 @@ + import os + import sys + import io ++import imp + import unittest + + from distutils.command.build_py import build_py +@@ -57,13 +58,15 @@ class BuildPyTestCase(support.TempdirMan + self.assertEqual(len(cmd.get_outputs()), 3) + pkgdest = os.path.join(destination, "pkg") + files = os.listdir(pkgdest) ++ pycache_dir = os.path.join(pkgdest, "__pycache__") + self.assertIn("__init__.py", files) + self.assertIn("README.txt", files) +- # XXX even with -O, distutils writes pyc, not pyo; bug? + if sys.dont_write_bytecode: +- self.assertNotIn("__init__.pyc", files) ++ self.assertFalse(os.path.exists(pycache_dir)) + else: +- self.assertIn("__init__.pyc", files) ++ # XXX even with -O, distutils writes pyc, not pyo; bug? ++ pyc_files = os.listdir(pycache_dir) ++ self.assertIn("__init__.%s.pyc" % imp.get_tag(), pyc_files) + + def test_empty_package_dir(self): + # See SF 1668596/1720897. +diff -up Python-3.2.2/Lib/distutils/tests/test_install_lib.py.issue11254 Python-3.2.2/Lib/distutils/tests/test_install_lib.py +--- Python-3.2.2/Lib/distutils/tests/test_install_lib.py.issue11254 2011-09-03 12:16:40.000000000 -0400 ++++ Python-3.2.2/Lib/distutils/tests/test_install_lib.py 2011-10-10 17:01:23.167196855 -0400 +@@ -1,6 +1,7 @@ + """Tests for distutils.command.install_data.""" + import sys + import os ++import imp + import unittest + + from distutils.command.install_lib import install_lib +@@ -32,18 +33,20 @@ class InstallLibTestCase(support.Tempdir + cmd.finalize_options() + self.assertEqual(cmd.optimize, 2) + +- @unittest.skipUnless(not sys.dont_write_bytecode, +- 'byte-compile not supported') ++ @unittest.skipIf(sys.dont_write_bytecode, 'byte-compile disabled') + def test_byte_compile(self): + pkg_dir, dist = self.create_dist() ++ os.chdir(pkg_dir) + cmd = install_lib(dist) + cmd.compile = cmd.optimize = 1 + + f = os.path.join(pkg_dir, 'foo.py') + self.write_file(f, '# python file') + cmd.byte_compile([f]) +- self.assertTrue(os.path.exists(os.path.join(pkg_dir, 'foo.pyc'))) +- self.assertTrue(os.path.exists(os.path.join(pkg_dir, 'foo.pyo'))) ++ pyc_file = imp.cache_from_source('foo.py') ++ pyo_file = imp.cache_from_source('foo.py', debug_override=False) ++ self.assertTrue(os.path.exists(pyc_file)) ++ self.assertTrue(os.path.exists(pyo_file)) + + def test_get_outputs(self): + pkg_dir, dist = self.create_dist() +diff -up Python-3.2.2/Lib/distutils/util.py.issue11254 Python-3.2.2/Lib/distutils/util.py +--- Python-3.2.2/Lib/distutils/util.py.issue11254 2011-09-03 12:16:40.000000000 -0400 ++++ Python-3.2.2/Lib/distutils/util.py 2011-10-10 17:01:23.172196793 -0400 +@@ -4,7 +4,11 @@ Miscellaneous utility functions -- anyth + one of the other *util.py modules. + """ + +-import sys, os, string, re ++import os ++import re ++import imp ++import sys ++import string + from distutils.errors import DistutilsPlatformError + from distutils.dep_util import newer + from distutils.spawn import spawn +@@ -415,9 +419,9 @@ def byte_compile (py_files, + verbose=1, dry_run=0, + direct=None): + """Byte-compile a collection of Python source files to either .pyc +- or .pyo files in the same directory. 'py_files' is a list of files +- to compile; any files that don't end in ".py" are silently skipped. +- 'optimize' must be one of the following: ++ or .pyo files in a __pycache__ subdirectory. 'py_files' is a list ++ of files to compile; any files that don't end in ".py" are silently ++ skipped. 'optimize' must be one of the following: + 0 - don't optimize (generate .pyc) + 1 - normal optimization (like "python -O") + 2 - extra optimization (like "python -OO") +@@ -529,7 +533,10 @@ byte_compile(files, optimize=%r, force=% + # Terminology from the py_compile module: + # cfile - byte-compiled file + # dfile - purported source filename (same as 'file' by default) +- cfile = file + (__debug__ and "c" or "o") ++ if optimize >= 0: ++ cfile = imp.cache_from_source(file, debug_override=not optimize) ++ else: ++ cfile = imp.cache_from_source(file) + dfile = file + if prefix: + if file[:len(prefix)] != prefix: +diff -up Python-3.2.2/Misc/ACKS.issue11254 Python-3.2.2/Misc/ACKS +--- Python-3.2.2/Misc/ACKS.issue11254 2011-09-03 12:16:45.000000000 -0400 ++++ Python-3.2.2/Misc/ACKS 2011-10-10 17:01:23.168196842 -0400 +@@ -715,6 +715,7 @@ Pierre Quentel + Brian Quinlan + Anders Qvist + Burton Radons ++Jeff Ramnani + Brodie Rao + Antti Rasinen + Sridhar Ratnakumar diff --git a/python3.spec b/python3.spec index a264334..536c3ec 100644 --- a/python3.spec +++ b/python3.spec @@ -122,7 +122,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 7%{?dist} +Release: 8%{?dist} License: Python Group: Development/Languages @@ -362,6 +362,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 +# Cherrypick fix for distutils not using __pycache__ when byte-compiling files +# Based on upstream http://bugs.python.org/issue11254 (rhbz#722578) +# (upstream commits 27a36b05caed and 651e84363001): +Patch149: 00149-backport-issue11254-pycache-bytecompilation-fix.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora 17 onwards, @@ -573,6 +578,7 @@ done %patch146 -p1 %patch147 -p1 %patch148 -p1 +%patch149 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1385,6 +1391,10 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon Oct 10 2011 David Malcolm - 3.2.2-8 +- cherrypick fix for distutils not using __pycache__ when byte-compiling +files (rhbz#722578) + * Fri Sep 30 2011 David Malcolm - 3.2.2-7 - re-enable gdbm (patch 148; rhbz#742242) From 8c9e381740ccdddd44fb026abc216546c0c821a9 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Mon, 17 Oct 2011 13:48:14 -0500 Subject: [PATCH 080/416] python3-devel missing autogenerated pkgconfig() provides (#746751) In short, use /usr/lib/rpm/redhat/find-provides intead of /usr/lib/rpm/find-provides --- find-provides-without-python-sonames.sh | 4 ++-- python3.spec | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/find-provides-without-python-sonames.sh b/find-provides-without-python-sonames.sh index 8961b87..7a9e224 100755 --- a/find-provides-without-python-sonames.sh +++ b/find-provides-without-python-sonames.sh @@ -1,6 +1,6 @@ #!/bin/bash -# The standard /usr/lib/rpm/find-provides script +# The standard find-provides script # adds provides lines for all SONAME directives in all shared libraries, # even if those libraries are not in the LD_LIBRARY_PATH @@ -10,6 +10,6 @@ # So we strip out all /usr/lib/python lines first, before running them through # the standard script: grep -v "/usr/lib/python" | grep -v "/usr/lib64/python" | \ - /usr/lib/rpm/find-provides + /usr/lib/rpm/redhat/find-provides exit 0 diff --git a/python3.spec b/python3.spec index 536c3ec..3c078b5 100644 --- a/python3.spec +++ b/python3.spec @@ -122,7 +122,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 8%{?dist} +Release: 9%{?dist} License: Python Group: Development/Languages @@ -1391,6 +1391,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon Oct 17 2011 Rex Dieter - 3.2.2-9 +- python3-devel missing autogenerated pkgconfig() provides (#746751) + * Mon Oct 10 2011 David Malcolm - 3.2.2-8 - cherrypick fix for distutils not using __pycache__ when byte-compiling files (rhbz#722578) From 1af13838fd0606e595b8dbc4cc35a717c5937037 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Thu, 8 Dec 2011 01:44:05 +0100 Subject: [PATCH 081/416] disable rAssertAlmostEqual in test_cmath on PPC (#750811) --- ...0-disable-rAssertAlmostEqual-cmath-on-ppc.patch | 11 +++++++++++ python3.spec | 14 +++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 00150-disable-rAssertAlmostEqual-cmath-on-ppc.patch diff --git a/00150-disable-rAssertAlmostEqual-cmath-on-ppc.patch b/00150-disable-rAssertAlmostEqual-cmath-on-ppc.patch new file mode 100644 index 0000000..73b6356 --- /dev/null +++ b/00150-disable-rAssertAlmostEqual-cmath-on-ppc.patch @@ -0,0 +1,11 @@ +diff -up Python-3.2.2/Lib/test/test_cmath.py.ppc Python-3.2.2/Lib/test/test_cmath.py +--- Python-3.2.2/Lib/test/test_cmath.py.ppc 2011-12-07 23:43:55.000000000 +0100 ++++ Python-3.2.2/Lib/test/test_cmath.py 2011-12-07 23:49:44.000000000 +0100 +@@ -95,6 +95,7 @@ class CMathTests(unittest.TestCase): + self.assertFloatIdentical(x.real, y.real) + self.assertFloatIdentical(x.imag, y.imag) + ++ @unittest.skip('Known failure on PPC: glibc bug https://bugzilla.redhat.com/show_bug.cgi?id=750811') + def rAssertAlmostEqual(self, a, b, rel_err = 2e-15, abs_err = 5e-323, + msg=None): + """Fail if the two floating-point numbers are not almost equal. diff --git a/python3.spec b/python3.spec index 3c078b5..11bc653 100644 --- a/python3.spec +++ b/python3.spec @@ -122,7 +122,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 9%{?dist} +Release: 10%{?dist} License: Python Group: Development/Languages @@ -367,6 +367,12 @@ Patch148: 00148-gdbm-1.9-magic-values.patch # (upstream commits 27a36b05caed and 651e84363001): Patch149: 00149-backport-issue11254-pycache-bytecompilation-fix.patch +# temporarily disable rAssertAlmostEqual in test_cmath on PPC (bz #750811) +# caused by a glibc bug. This patch can be removed when we have a glibc with +# the patch mentioned here: +# http://sourceware.org/bugzilla/show_bug.cgi?id=13472 +Patch150: 00150-disable-rAssertAlmostEqual-cmath-on-ppc.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora 17 onwards, @@ -579,6 +585,9 @@ done %patch147 -p1 %patch148 -p1 %patch149 -p1 +%ifarch ppc ppc64 +%patch150 -p1 +%endif # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1391,6 +1400,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Wed Dec 07 2011 Karsten Hopp 3.2.2-10 +- disable rAssertAlmostEqual in test_cmath on PPC (#750811) + * Mon Oct 17 2011 Rex Dieter - 3.2.2-9 - python3-devel missing autogenerated pkgconfig() provides (#746751) From 8a69a67643ea4eac77462fc307922efc9264d507 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 4 Jan 2012 22:15:40 +0200 Subject: [PATCH 082/416] Build with $RPM_LD_FLAGS (#756863). Use xz-compressed source tarball. --- .gitignore | 11 +---------- python3.spec | 10 +++++++--- sources | 2 +- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index ec6198e..dafa321 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1 @@ -libpython-36a517ef7848cbd0b3dcc7371f32e47ac4c87eba.tar.gz -Python-3.1.2.tar.bz2 -Python-3.2a1.tar.bz2 -/Python-3.2b2.tar.bz2 -/Python-3.2rc1.tar.bz2 -/Python-3.2rc2.tar.bz2 -/Python-3.2rc3.tar.bz2 -/Python-3.2.tar.bz2 -/Python-3.2.1.tar.bz2 -/Python-3.2.2.tar.bz2 +/*.tar.* diff --git a/python3.spec b/python3.spec index 11bc653..382d288 100644 --- a/python3.spec +++ b/python3.spec @@ -122,7 +122,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 10%{?dist} +Release: 11%{?dist} License: Python Group: Development/Languages @@ -178,7 +178,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 # Avoid having various bogus auto-generated Provides lines for the various # python c modules' SONAMEs: @@ -618,7 +618,7 @@ export CPPFLAGS="`pkg-config --cflags-only-I libffi`" export OPT="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv" export LINKCC="gcc" export CFLAGS="$CFLAGS `pkg-config --cflags openssl`" -export LDFLAGS="$LDFLAGS `pkg-config --libs-only-L openssl`" +export LDFLAGS="$RPM_LD_FLAGS `pkg-config --libs-only-L openssl`" %if 0%{regenerate_autotooling_patch} # If enabled, this code regenerates the patch to "configure", using a @@ -1400,6 +1400,10 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Wed Jan 4 2012 Ville Skyttä - 3.2.2-11 +- Build with $RPM_LD_FLAGS (#756863). +- Use xz-compressed source tarball. + * Wed Dec 07 2011 Karsten Hopp 3.2.2-10 - disable rAssertAlmostEqual in test_cmath on PPC (#750811) diff --git a/sources b/sources index ba6917c..fd9f0fc 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -9d763097a13a59ff53428c9e4d098a05 Python-3.2.2.tar.bz2 +3720ce9460597e49264bbb63b48b946d Python-3.2.2.tar.xz From 1c26b68ffef9648f68a2237f72fbf1438e79f652 Mon Sep 17 00:00:00 2001 From: Thomas Spura Date: Sun, 5 Feb 2012 20:32:34 +0100 Subject: [PATCH 083/416] use newly installed python for byte compiling (#787498) Signed-off-by: Thomas Spura --- python3.spec | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/python3.spec b/python3.spec index 382d288..bd0a510 100644 --- a/python3.spec +++ b/python3.spec @@ -122,7 +122,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 11%{?dist} +Release: 12%{?dist} License: Python Group: Development/Languages @@ -915,8 +915,10 @@ iconv -f iso8859-1 -t utf-8 %{buildroot}/%{pylibdir}/Demo/rpc/README > README.co # for the 2to3 tool, and one of the functions of the 2to3 tool is to fixup # character encodings within python source code -# Do bytecompilation with the new interpreter. -LD_LIBRARY_PATH=. /usr/lib/rpm/brp-python-bytecompile ./python +# Do bytecompilation with the newly installed interpreter. +LD_LIBRARY_PATH=%{buildroot}/%{dynload_dir}/ \ + PYTHONPATH="%{buildroot}/%{_libdir}python%{pybasever} %{buildroot}/%{_libdir}python%{pybasever}/site-packages" \ + /usr/lib/rpm/brp-python-bytecompile %{buildroot}%{_bindir}/python%{pybasever} # Fixup permissions for shared libraries from non-standard 555 to standard 755: find %{buildroot} \ @@ -1400,6 +1402,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Sun Feb 5 2012 Thomas Spura - 3.2.2-12 +- use newly installed python for byte compiling (#787498) + * Wed Jan 4 2012 Ville Skyttä - 3.2.2-11 - Build with $RPM_LD_FLAGS (#756863). - Use xz-compressed source tarball. From e6314e68e153bc9eec3264e28d0fda585e7d45a1 Mon Sep 17 00:00:00 2001 From: Thomas Spura Date: Mon, 6 Feb 2012 11:28:14 +0100 Subject: [PATCH 084/416] use newly installed python for byte compiling (#787498) the macros.pybytecompile way Signed-off-by: Thomas Spura --- python3.spec | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/python3.spec b/python3.spec index bd0a510..76fad62 100644 --- a/python3.spec +++ b/python3.spec @@ -122,7 +122,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 12%{?dist} +Release: 13%{?dist} License: Python Group: Development/Languages @@ -916,9 +916,11 @@ iconv -f iso8859-1 -t utf-8 %{buildroot}/%{pylibdir}/Demo/rpc/README > README.co # character encodings within python source code # Do bytecompilation with the newly installed interpreter. -LD_LIBRARY_PATH=%{buildroot}/%{dynload_dir}/ \ +# This is similar to the script in macros.pybytecompile +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" \ - /usr/lib/rpm/brp-python-bytecompile %{buildroot}%{_bindir}/python%{pybasever} + 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:]]' || : # Fixup permissions for shared libraries from non-standard 555 to standard 755: find %{buildroot} \ @@ -1402,6 +1404,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon Feb 6 2012 Thomas Spura - 3.2.2-13 +- use newly installed python for byte compiling (#787498) + * Sun Feb 5 2012 Thomas Spura - 3.2.2-12 - use newly installed python for byte compiling (#787498) From ae2fc1c0436586c7307266799ef50fec5e2edb8d Mon Sep 17 00:00:00 2001 From: Thomas Spura Date: Mon, 6 Feb 2012 11:28:14 +0100 Subject: [PATCH 085/416] use newly installed python for byte compiling (#787498) the macros.pybytecompile way Signed-off-by: Thomas Spura --- python3.spec | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/python3.spec b/python3.spec index 76fad62..46112d6 100644 --- a/python3.spec +++ b/python3.spec @@ -917,10 +917,16 @@ iconv -f iso8859-1 -t utf-8 %{buildroot}/%{pylibdir}/Demo/rpc/README > README.co # Do bytecompilation with the newly installed interpreter. # This is similar to the script in macros.pybytecompile +# 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" \ + 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} -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("%{buildroot}")[2], optimize=0) for f in sys.argv[1:]]' || : # Fixup permissions for shared libraries from non-standard 555 to standard 755: find %{buildroot} \ @@ -1404,8 +1410,8 @@ rm -fr %{buildroot} # ====================================================== %changelog -* Mon Feb 6 2012 Thomas Spura - 3.2.2-13 -- use newly installed python for byte compiling (#787498) +* Thu Feb 9 2012 Thomas Spura - 3.2.2-13 +- use newly installed python for byte compiling (now for real) * Sun Feb 5 2012 Thomas Spura - 3.2.2-12 - use newly installed python for byte compiling (#787498) From 28856627bf7413e17d327d7b3a840a7a4122b795 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Wed, 11 Apr 2012 20:20:08 -0400 Subject: [PATCH 086/416] 3.2.3-1 * Wed Apr 11 2012 David Malcolm - 3.2.3-1 - 3.2.3; refresh patch 102 (lib64); drop upstream patches 148 (gdbm magic values), 149 (__pycache__ fix); add patch 152 (test_gdb regex) --- 00148-gdbm-1.9-magic-values.patch | 13 -- ...sue11254-pycache-bytecompilation-fix.patch | 146 ------------------ 00152-fix-test-gdb-regex.patch | 11 ++ ....1-lib64.patch => python-3.2.3-lib64.patch | 60 +++---- python3.spec | 35 +++-- sources | 2 +- 6 files changed, 65 insertions(+), 202 deletions(-) delete mode 100644 00148-gdbm-1.9-magic-values.patch delete mode 100644 00149-backport-issue11254-pycache-bytecompilation-fix.patch create mode 100644 00152-fix-test-gdb-regex.patch rename python-3.2.1-lib64.patch => python-3.2.3-lib64.patch (79%) diff --git a/00148-gdbm-1.9-magic-values.patch b/00148-gdbm-1.9-magic-values.patch deleted file mode 100644 index e8ce828..0000000 --- a/00148-gdbm-1.9-magic-values.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -up Python-3.2.2/Lib/dbm/__init__.py.gdbm-1.9-magic Python-3.2.2/Lib/dbm/__init__.py ---- Python-3.2.2/Lib/dbm/__init__.py.gdbm-1.9-magic 2011-09-03 12:16:40.000000000 -0400 -+++ Python-3.2.2/Lib/dbm/__init__.py 2011-09-30 15:47:27.488863694 -0400 -@@ -166,7 +166,7 @@ def whichdb(filename): - return "" - - # Check for GNU dbm -- if magic == 0x13579ace: -+ if magic in (0x13579ace, 0x13579acd, 0x13579acf): - return "dbm.gnu" - - # Later versions of Berkeley db hash file have a 12-byte pad in -diff -up Python-3.2.2/Misc/NEWS.gdbm-1.9-magic Python-3.2.2/Misc/NEWS diff --git a/00149-backport-issue11254-pycache-bytecompilation-fix.patch b/00149-backport-issue11254-pycache-bytecompilation-fix.patch deleted file mode 100644 index d3651b0..0000000 --- a/00149-backport-issue11254-pycache-bytecompilation-fix.patch +++ /dev/null @@ -1,146 +0,0 @@ -diff -up Python-3.2.2/Doc/distutils/apiref.rst.issue11254 Python-3.2.2/Doc/distutils/apiref.rst ---- Python-3.2.2/Doc/distutils/apiref.rst.issue11254 2011-09-03 12:16:38.000000000 -0400 -+++ Python-3.2.2/Doc/distutils/apiref.rst 2011-10-10 17:01:23.167196855 -0400 -@@ -1204,9 +1204,9 @@ other utility module. - .. function:: byte_compile(py_files[, optimize=0, force=0, prefix=None, base_dir=None, verbose=1, dry_run=0, direct=None]) - - Byte-compile a collection of Python source files to either :file:`.pyc` or -- :file:`.pyo` files in the same directory. *py_files* is a list of files to -- compile; any files that don't end in :file:`.py` are silently skipped. -- *optimize* must be one of the following: -+ :file:`.pyo` files in a :file:`__pycache__` subdirectory (see :pep:`3147`). -+ *py_files* is a list of files to compile; any files that don't end in -+ :file:`.py` are silently skipped. *optimize* must be one of the following: - - * ``0`` - don't optimize (generate :file:`.pyc`) - * ``1`` - normal optimization (like ``python -O``) -@@ -1231,6 +1231,11 @@ other utility module. - is used by the script generated in indirect mode; unless you know what you're - doing, leave it set to ``None``. - -+ .. versionchanged:: 3.2.3 -+ Create ``.pyc`` or ``.pyo`` files with an :func:`import magic tag -+ ` in their name, in a :file:`__pycache__` subdirectory -+ instead of files without tag in the current directory. -+ - - .. function:: rfc822_escape(header) - -diff -up Python-3.2.2/Lib/distutils/tests/test_build_py.py.issue11254 Python-3.2.2/Lib/distutils/tests/test_build_py.py ---- Python-3.2.2/Lib/distutils/tests/test_build_py.py.issue11254 2011-09-03 12:16:40.000000000 -0400 -+++ Python-3.2.2/Lib/distutils/tests/test_build_py.py 2011-10-10 17:01:23.167196855 -0400 -@@ -3,6 +3,7 @@ - import os - import sys - import io -+import imp - import unittest - - from distutils.command.build_py import build_py -@@ -57,13 +58,15 @@ class BuildPyTestCase(support.TempdirMan - self.assertEqual(len(cmd.get_outputs()), 3) - pkgdest = os.path.join(destination, "pkg") - files = os.listdir(pkgdest) -+ pycache_dir = os.path.join(pkgdest, "__pycache__") - self.assertIn("__init__.py", files) - self.assertIn("README.txt", files) -- # XXX even with -O, distutils writes pyc, not pyo; bug? - if sys.dont_write_bytecode: -- self.assertNotIn("__init__.pyc", files) -+ self.assertFalse(os.path.exists(pycache_dir)) - else: -- self.assertIn("__init__.pyc", files) -+ # XXX even with -O, distutils writes pyc, not pyo; bug? -+ pyc_files = os.listdir(pycache_dir) -+ self.assertIn("__init__.%s.pyc" % imp.get_tag(), pyc_files) - - def test_empty_package_dir(self): - # See SF 1668596/1720897. -diff -up Python-3.2.2/Lib/distutils/tests/test_install_lib.py.issue11254 Python-3.2.2/Lib/distutils/tests/test_install_lib.py ---- Python-3.2.2/Lib/distutils/tests/test_install_lib.py.issue11254 2011-09-03 12:16:40.000000000 -0400 -+++ Python-3.2.2/Lib/distutils/tests/test_install_lib.py 2011-10-10 17:01:23.167196855 -0400 -@@ -1,6 +1,7 @@ - """Tests for distutils.command.install_data.""" - import sys - import os -+import imp - import unittest - - from distutils.command.install_lib import install_lib -@@ -32,18 +33,20 @@ class InstallLibTestCase(support.Tempdir - cmd.finalize_options() - self.assertEqual(cmd.optimize, 2) - -- @unittest.skipUnless(not sys.dont_write_bytecode, -- 'byte-compile not supported') -+ @unittest.skipIf(sys.dont_write_bytecode, 'byte-compile disabled') - def test_byte_compile(self): - pkg_dir, dist = self.create_dist() -+ os.chdir(pkg_dir) - cmd = install_lib(dist) - cmd.compile = cmd.optimize = 1 - - f = os.path.join(pkg_dir, 'foo.py') - self.write_file(f, '# python file') - cmd.byte_compile([f]) -- self.assertTrue(os.path.exists(os.path.join(pkg_dir, 'foo.pyc'))) -- self.assertTrue(os.path.exists(os.path.join(pkg_dir, 'foo.pyo'))) -+ pyc_file = imp.cache_from_source('foo.py') -+ pyo_file = imp.cache_from_source('foo.py', debug_override=False) -+ self.assertTrue(os.path.exists(pyc_file)) -+ self.assertTrue(os.path.exists(pyo_file)) - - def test_get_outputs(self): - pkg_dir, dist = self.create_dist() -diff -up Python-3.2.2/Lib/distutils/util.py.issue11254 Python-3.2.2/Lib/distutils/util.py ---- Python-3.2.2/Lib/distutils/util.py.issue11254 2011-09-03 12:16:40.000000000 -0400 -+++ Python-3.2.2/Lib/distutils/util.py 2011-10-10 17:01:23.172196793 -0400 -@@ -4,7 +4,11 @@ Miscellaneous utility functions -- anyth - one of the other *util.py modules. - """ - --import sys, os, string, re -+import os -+import re -+import imp -+import sys -+import string - from distutils.errors import DistutilsPlatformError - from distutils.dep_util import newer - from distutils.spawn import spawn -@@ -415,9 +419,9 @@ def byte_compile (py_files, - verbose=1, dry_run=0, - direct=None): - """Byte-compile a collection of Python source files to either .pyc -- or .pyo files in the same directory. 'py_files' is a list of files -- to compile; any files that don't end in ".py" are silently skipped. -- 'optimize' must be one of the following: -+ or .pyo files in a __pycache__ subdirectory. 'py_files' is a list -+ of files to compile; any files that don't end in ".py" are silently -+ skipped. 'optimize' must be one of the following: - 0 - don't optimize (generate .pyc) - 1 - normal optimization (like "python -O") - 2 - extra optimization (like "python -OO") -@@ -529,7 +533,10 @@ byte_compile(files, optimize=%r, force=% - # Terminology from the py_compile module: - # cfile - byte-compiled file - # dfile - purported source filename (same as 'file' by default) -- cfile = file + (__debug__ and "c" or "o") -+ if optimize >= 0: -+ cfile = imp.cache_from_source(file, debug_override=not optimize) -+ else: -+ cfile = imp.cache_from_source(file) - dfile = file - if prefix: - if file[:len(prefix)] != prefix: -diff -up Python-3.2.2/Misc/ACKS.issue11254 Python-3.2.2/Misc/ACKS ---- Python-3.2.2/Misc/ACKS.issue11254 2011-09-03 12:16:45.000000000 -0400 -+++ Python-3.2.2/Misc/ACKS 2011-10-10 17:01:23.168196842 -0400 -@@ -715,6 +715,7 @@ Pierre Quentel - Brian Quinlan - Anders Qvist - Burton Radons -+Jeff Ramnani - Brodie Rao - Antti Rasinen - Sridhar Ratnakumar 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/python-3.2.1-lib64.patch b/python-3.2.3-lib64.patch similarity index 79% rename from python-3.2.1-lib64.patch rename to python-3.2.3-lib64.patch index 8b15e3e..5c3cf13 100644 --- a/python-3.2.1-lib64.patch +++ b/python-3.2.3-lib64.patch @@ -1,7 +1,7 @@ -diff -up Python-3.2.1/Lib/distutils/command/install.py.lib64 Python-3.2.1/Lib/distutils/command/install.py ---- Python-3.2.1/Lib/distutils/command/install.py.lib64 2011-07-09 02:58:46.000000000 -0400 -+++ Python-3.2.1/Lib/distutils/command/install.py 2011-07-11 11:20:45.980426001 -0400 -@@ -47,14 +47,14 @@ else: +diff -up Python-3.2.3/Lib/distutils/command/install.py.lib64 Python-3.2.3/Lib/distutils/command/install.py +--- Python-3.2.3/Lib/distutils/command/install.py.lib64 2012-04-11 02:54:02.000000000 -0400 ++++ Python-3.2.3/Lib/distutils/command/install.py 2012-04-11 19:01:19.727107020 -0400 +@@ -45,14 +45,14 @@ else: INSTALL_SCHEMES = { 'unix_prefix': { 'purelib': '$base/lib/python$py_version_short/site-packages', @@ -18,10 +18,10 @@ diff -up Python-3.2.1/Lib/distutils/command/install.py.lib64 Python-3.2.1/Lib/di 'headers': '$base/include/python/$dist_name', 'scripts': '$base/bin', 'data' : '$base', -diff -up Python-3.2.1/Lib/distutils/sysconfig.py.lib64 Python-3.2.1/Lib/distutils/sysconfig.py ---- Python-3.2.1/Lib/distutils/sysconfig.py.lib64 2011-07-09 02:58:47.000000000 -0400 -+++ Python-3.2.1/Lib/distutils/sysconfig.py 2011-07-11 11:20:45.981426001 -0400 -@@ -124,8 +124,12 @@ def get_python_lib(plat_specific=0, stan +diff -up Python-3.2.3/Lib/distutils/sysconfig.py.lib64 Python-3.2.3/Lib/distutils/sysconfig.py +--- Python-3.2.3/Lib/distutils/sysconfig.py.lib64 2012-04-11 02:54:02.000000000 -0400 ++++ Python-3.2.3/Lib/distutils/sysconfig.py 2012-04-11 19:01:19.727107020 -0400 +@@ -122,8 +122,12 @@ def get_python_lib(plat_specific=0, stan prefix = plat_specific and EXEC_PREFIX or PREFIX if os.name == "posix": @@ -35,9 +35,9 @@ diff -up Python-3.2.1/Lib/distutils/sysconfig.py.lib64 Python-3.2.1/Lib/distutil if standard_lib: return libpython else: -diff -up Python-3.2.1/Lib/site.py.lib64 Python-3.2.1/Lib/site.py ---- Python-3.2.1/Lib/site.py.lib64 2011-07-09 02:58:49.000000000 -0400 -+++ Python-3.2.1/Lib/site.py 2011-07-11 11:20:45.982426001 -0400 +diff -up Python-3.2.3/Lib/site.py.lib64 Python-3.2.3/Lib/site.py +--- Python-3.2.3/Lib/site.py.lib64 2012-04-11 02:54:03.000000000 -0400 ++++ Python-3.2.3/Lib/site.py 2012-04-11 19:01:19.728107008 -0400 @@ -285,12 +285,16 @@ def getsitepackages(): if sys.platform in ('os2emx', 'riscos'): sitepackages.append(os.path.join(prefix, "Lib", "site-packages")) @@ -55,9 +55,9 @@ diff -up Python-3.2.1/Lib/site.py.lib64 Python-3.2.1/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-3.2.1/Lib/sysconfig.py.lib64 Python-3.2.1/Lib/sysconfig.py ---- Python-3.2.1/Lib/sysconfig.py.lib64 2011-07-09 02:58:49.000000000 -0400 -+++ Python-3.2.1/Lib/sysconfig.py 2011-07-11 11:20:45.982426001 -0400 +diff -up Python-3.2.3/Lib/sysconfig.py.lib64 Python-3.2.3/Lib/sysconfig.py +--- Python-3.2.3/Lib/sysconfig.py.lib64 2012-04-11 02:54:03.000000000 -0400 ++++ Python-3.2.3/Lib/sysconfig.py 2012-04-11 19:01:19.728107008 -0400 @@ -21,10 +21,10 @@ __all__ = [ _INSTALL_SCHEMES = { @@ -86,13 +86,13 @@ diff -up Python-3.2.1/Lib/sysconfig.py.lib64 Python-3.2.1/Lib/sysconfig.py 'include': '{userbase}/include/python{py_version_short}', 'scripts': '{userbase}/bin', 'data' : '{userbase}', -diff -up Python-3.2.1/Lib/test/test_site.py.lib64 Python-3.2.1/Lib/test/test_site.py ---- Python-3.2.1/Lib/test/test_site.py.lib64 2011-07-09 02:58:51.000000000 -0400 -+++ Python-3.2.1/Lib/test/test_site.py 2011-07-11 11:20:45.983426001 -0400 -@@ -222,12 +222,15 @@ class HelperFunctionsTests(unittest.Test - wanted = os.path.join('xoxo', 'Lib', 'site-packages') - self.assertEqual(dirs[0], wanted) +diff -up Python-3.2.3/Lib/test/test_site.py.lib64 Python-3.2.3/Lib/test/test_site.py +--- Python-3.2.3/Lib/test/test_site.py.lib64 2012-04-11 02:54:05.000000000 -0400 ++++ Python-3.2.3/Lib/test/test_site.py 2012-04-11 19:02:01.413585869 -0400 +@@ -236,12 +236,15 @@ 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) @@ -106,11 +106,11 @@ diff -up Python-3.2.1/Lib/test/test_site.py.lib64 Python-3.2.1/Lib/test/test_sit + 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') -diff -up Python-3.2.1/Makefile.pre.in.lib64 Python-3.2.1/Makefile.pre.in ---- Python-3.2.1/Makefile.pre.in.lib64 2011-07-11 11:20:45.974426000 -0400 -+++ Python-3.2.1/Makefile.pre.in 2011-07-11 11:20:45.984426001 -0400 +diff -up Python-3.2.3/Makefile.pre.in.lib64 Python-3.2.3/Makefile.pre.in +--- Python-3.2.3/Makefile.pre.in.lib64 2012-04-11 19:01:19.722107084 -0400 ++++ Python-3.2.3/Makefile.pre.in 2012-04-11 19:01:19.729106996 -0400 @@ -106,7 +106,7 @@ LIBDIR= @libdir@ MANDIR= @mandir@ INCLUDEDIR= @includedir@ @@ -120,9 +120,9 @@ diff -up Python-3.2.1/Makefile.pre.in.lib64 Python-3.2.1/Makefile.pre.in ABIFLAGS= @ABIFLAGS@ # Detailed destination directories -diff -up Python-3.2.1/Modules/getpath.c.lib64 Python-3.2.1/Modules/getpath.c ---- Python-3.2.1/Modules/getpath.c.lib64 2011-07-09 02:58:54.000000000 -0400 -+++ Python-3.2.1/Modules/getpath.c 2011-07-11 11:27:44.596425999 -0400 +diff -up Python-3.2.3/Modules/getpath.c.lib64 Python-3.2.3/Modules/getpath.c +--- Python-3.2.3/Modules/getpath.c.lib64 2012-04-11 02:54:07.000000000 -0400 ++++ Python-3.2.3/Modules/getpath.c 2012-04-11 19:01:19.729106996 -0400 @@ -122,8 +122,8 @@ #endif @@ -161,9 +161,9 @@ diff -up Python-3.2.1/Modules/getpath.c.lib64 Python-3.2.1/Modules/getpath.c } /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */ -diff -up Python-3.2.1/setup.py.lib64 Python-3.2.1/setup.py ---- Python-3.2.1/setup.py.lib64 2011-07-09 02:58:56.000000000 -0400 -+++ Python-3.2.1/setup.py 2011-07-11 11:28:00.193426004 -0400 +diff -up Python-3.2.3/setup.py.lib64 Python-3.2.3/setup.py +--- Python-3.2.3/setup.py.lib64 2012-04-11 02:54:08.000000000 -0400 ++++ Python-3.2.3/setup.py 2012-04-11 19:01:19.730106984 -0400 @@ -396,7 +396,7 @@ class PyBuildExt(build_ext): # Ensure that /usr/local is always used, but the local build # directories (i.e. '.' and 'Include') must be first. See issue diff --git a/python3.spec b/python3.spec index 46112d6..695cd60 100644 --- a/python3.spec +++ b/python3.spec @@ -121,8 +121,8 @@ # ================== Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 -Version: %{pybasever}.2 -Release: 13%{?dist} +Version: %{pybasever}.3 +Release: 1%{?dist} License: Python Group: Development/Languages @@ -224,7 +224,7 @@ Patch3: python-3.2b2-remove-mimeaudio-tests.patch # dmalcolm Patch55: 00055-systemtap.patch -Patch102: python-3.2.1-lib64.patch +Patch102: python-3.2.3-lib64.patch # Only used when "%{_lib}" == "lib64" # Another lib64 fix, for distutils/tests/test_install.py; not upstream: @@ -358,14 +358,11 @@ 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 3.2.3: +# Patch148: 00148-gdbm-1.9-magic-values.patch -# Cherrypick fix for distutils not using __pycache__ when byte-compiling files -# Based on upstream http://bugs.python.org/issue11254 (rhbz#722578) -# (upstream commits 27a36b05caed and 651e84363001): -Patch149: 00149-backport-issue11254-pycache-bytecompilation-fix.patch +# Upstream as of Python 3.2.3: +# Patch149: 00149-backport-issue11254-pycache-bytecompilation-fix.patch # temporarily disable rAssertAlmostEqual in test_cmath on PPC (bz #750811) # caused by a glibc bug. This patch can be removed when we have a glibc with @@ -373,6 +370,14 @@ Patch149: 00149-backport-issue11254-pycache-bytecompilation-fix.patch # http://sourceware.org/bugzilla/show_bug.cgi?id=13472 Patch150: 00150-disable-rAssertAlmostEqual-cmath-on-ppc.patch +# python.spec had: +# Patch151: 00151-fork-deadlock.patch + +# Fix a regex in test_gdb so that it doesn't choke when gdb provides a full +# path to Python/bltinmodule.c: +Patch152: 00152-fix-test-gdb-regex.patch + + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora 17 onwards, @@ -583,11 +588,13 @@ done # 00145: not for python3 %patch146 -p1 %patch147 -p1 -%patch148 -p1 -%patch149 -p1 +# 00148: upstream as of Python 3.2.3 +# 00149: upstream as of Python 3.2.3 %ifarch ppc ppc64 %patch150 -p1 %endif +# 00151: not for python3 +%patch152 -p0 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1410,6 +1417,10 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Wed Apr 11 2012 David Malcolm - 3.2.3-1 +- 3.2.3; refresh patch 102 (lib64); drop upstream patches 148 (gdbm magic +values), 149 (__pycache__ fix); add patch 152 (test_gdb regex) + * Thu Feb 9 2012 Thomas Spura - 3.2.2-13 - use newly installed python for byte compiling (now for real) diff --git a/sources b/sources index fd9f0fc..9d0aae5 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -3720ce9460597e49264bbb63b48b946d Python-3.2.2.tar.xz +187564726f2c1473d301c586acc24847 Python-3.2.3.tar.xz From 3170c0548519482a5ecda38c0234057481dce267 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Thu, 12 Apr 2012 11:18:08 -0400 Subject: [PATCH 087/416] 3.2.3-2 * Thu Apr 12 2012 David Malcolm - 3.2.3-2 - fix test_gdb (patch 153) --- 00153-fix-test_gdb-noise.patch | 35 ++++++++++++++++++++++++++++++++++ python3.spec | 10 +++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 00153-fix-test_gdb-noise.patch 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/python3.spec b/python3.spec index 695cd60..526d148 100644 --- a/python3.spec +++ b/python3.spec @@ -122,7 +122,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.3 -Release: 1%{?dist} +Release: 2%{?dist} License: Python Group: Development/Languages @@ -377,6 +377,10 @@ Patch150: 00150-disable-rAssertAlmostEqual-cmath-on-ppc.patch # path to Python/bltinmodule.c: 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 ^^^) # @@ -595,6 +599,7 @@ done %endif # 00151: not for python3 %patch152 -p0 +%patch153 -p0 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1417,6 +1422,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Thu Apr 12 2012 David Malcolm - 3.2.3-2 +- fix test_gdb (patch 153) + * Wed Apr 11 2012 David Malcolm - 3.2.3-1 - 3.2.3; refresh patch 102 (lib64); drop upstream patches 148 (gdbm magic values), 149 (__pycache__ fix); add patch 152 (test_gdb regex) From 5974f19981fb6f53706629aee004e632f41f2af2 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Fri, 20 Apr 2012 15:24:24 -0400 Subject: [PATCH 088/416] 3.2.3-3: add explicit version requirements on expat to avoid linkage problems with XML_SetHashSalt * Fri Apr 20 2012 David Malcolm - 3.2.3-3 - add explicit version requirements on expat to avoid linkage problems with XML_SetHashSalt --- python3.spec | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/python3.spec b/python3.spec index 526d148..90694ee 100644 --- a/python3.spec +++ b/python3.spec @@ -122,7 +122,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.3 -Release: 2%{?dist} +Release: 3%{?dist} License: Python Group: Development/Languages @@ -137,7 +137,11 @@ BuildRequires: autoconf BuildRequires: bzip2 BuildRequires: bzip2-devel BuildRequires: db4-devel >= 4.7 -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-3.2.3 for CVE-2012-0876: +BuildRequires: expat-devel >= 2.1.0 + BuildRequires: findutils BuildRequires: gcc-c++ %if %{with_gdbm} @@ -431,6 +435,12 @@ Summary: Python 3 runtime libraries Group: Development/Libraries #Requires: %{name} = %{version}-%{release} +# 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 files used to embed Python 3 into applications. @@ -1422,6 +1432,10 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Fri Apr 20 2012 David Malcolm - 3.2.3-3 +- add explicit version requirements on expat to avoid linkage problems with +XML_SetHashSalt + * Thu Apr 12 2012 David Malcolm - 3.2.3-2 - fix test_gdb (patch 153) From 8a28107df1670a03a12cf6a7787160f103d8d8c8 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Fri, 20 Apr 2012 15:28:39 -0400 Subject: [PATCH 089/416] 3.2.3-4: avoid allocating thunks in ctypes unless absolutely necessary (patch 155; rhbz#814391) * Fri Apr 20 2012 David Malcolm - 3.2.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) --- 00155-avoid-ctypes-thunks.patch | 15 +++++++++++++++ python3.spec | 17 ++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 00155-avoid-ctypes-thunks.patch diff --git a/00155-avoid-ctypes-thunks.patch b/00155-avoid-ctypes-thunks.patch new file mode 100644 index 0000000..f03890e --- /dev/null +++ b/00155-avoid-ctypes-thunks.patch @@ -0,0 +1,15 @@ +diff -up Python-3.2.3/Lib/ctypes/__init__.py.rhbz814391 Python-3.2.3/Lib/ctypes/__init__.py +--- Python-3.2.3/Lib/ctypes/__init__.py.rhbz814391 2012-04-20 15:12:49.017867692 -0400 ++++ Python-3.2.3/Lib/ctypes/__init__.py 2012-04-20 15:15:09.501111408 -0400 +@@ -275,11 +275,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) + + def create_unicode_buffer(init, size=None): + """create_unicode_buffer(aString) -> character array diff --git a/python3.spec b/python3.spec index 90694ee..ff3b480 100644 --- a/python3.spec +++ b/python3.spec @@ -122,7 +122,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.3 -Release: 3%{?dist} +Release: 4%{?dist} License: Python Group: Development/Languages @@ -386,6 +386,14 @@ Patch152: 00152-fix-test-gdb-regex.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, @@ -610,6 +618,8 @@ done # 00151: not for python3 %patch152 -p0 %patch153 -p0 +# 00154: not for this branch +%patch155 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1432,6 +1442,11 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Fri Apr 20 2012 David Malcolm - 3.2.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) + * Fri Apr 20 2012 David Malcolm - 3.2.3-3 - add explicit version requirements on expat to avoid linkage problems with XML_SetHashSalt From 938d1d78cefcedb5ccde5e6297a9fbbd5acdf6b3 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 1 May 2012 11:40:48 -0400 Subject: [PATCH 090/416] 3.2.3-5: fix test_gdb.py (patch 156; rhbz#817072) * Mon Apr 30 2012 David Malcolm - 3.2.3-5 - fix test_gdb.py (patch 156; rhbz#817072) --- 00156-gdb-autoload-safepath.patch | 52 +++++++++++++++++++++++++++++++ python3.spec | 11 ++++++- 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 00156-gdb-autoload-safepath.patch diff --git a/00156-gdb-autoload-safepath.patch b/00156-gdb-autoload-safepath.patch new file mode 100644 index 0000000..ac2aa40 --- /dev/null +++ b/00156-gdb-autoload-safepath.patch @@ -0,0 +1,52 @@ +diff -up Python-3.2.3/Lib/test/test_gdb.py.gdb-autoload-safepath Python-3.2.3/Lib/test/test_gdb.py +--- Python-3.2.3/Lib/test/test_gdb.py.gdb-autoload-safepath 2012-04-30 17:16:24.092706954 -0400 ++++ Python-3.2.3/Lib/test/test_gdb.py 2012-04-30 17:17:13.275703592 -0400 +@@ -46,6 +46,19 @@ def gdb_has_frame_select(): + + HAS_PYUP_PYDOWN = gdb_has_frame_select() + ++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 b'"on" or "off" expected.' not in stderr ++ ++HAS_AUTOLOAD_SAFEPATH = gdb_has_autoload_safepath() ++ + BREAKPOINT_FN='builtin_id' + + class DebuggerTests(unittest.TestCase): +@@ -106,15 +119,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/python3.spec b/python3.spec index ff3b480..a31e752 100644 --- a/python3.spec +++ b/python3.spec @@ -122,7 +122,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.3 -Release: 4%{?dist} +Release: 5%{?dist} License: Python Group: Development/Languages @@ -394,6 +394,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 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 ^^^) # # When adding new patches to "python" and "python3" in Fedora 17 onwards, @@ -620,6 +625,7 @@ done %patch153 -p0 # 00154: not for this branch %patch155 -p1 +%patch156 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1442,6 +1448,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon Apr 30 2012 David Malcolm - 3.2.3-5 +- fix test_gdb.py (patch 156; rhbz#817072) + * Fri Apr 20 2012 David Malcolm - 3.2.3-4 - avoid allocating thunks in ctypes unless absolutely necessary, to avoid generating SELinux denials on "import ctypes" and "import uuid" when embedding From 6b34963600c2b8962f556ceeb3d254274770f6ba Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Fri, 4 May 2012 15:24:50 -0400 Subject: [PATCH 091/416] add markers to make it easier to diff python.spec and python3.spec --- python3.spec | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/python3.spec b/python3.spec index a31e752..bfa9de8 100644 --- a/python3.spec +++ b/python3.spec @@ -221,6 +221,7 @@ Patch1: Python-3.1.1-rpath.patch # It's simplest to remove them: Patch3: python-3.2b2-remove-mimeaudio-tests.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 @@ -230,27 +231,33 @@ Patch55: 00055-systemtap.patch Patch102: python-3.2.3-lib64.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 # # Patch112: python-2.7rc1-debug-build.patch: this is not relevant to Python 3, # for 3.2 onwards +# 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 +# 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 @@ -269,16 +276,19 @@ Patch125: 00125-less-verbose-COUNT_ALLOCS.patch # Not yet sent upstream Patch129: python-3.2.1-fix-test-subprocess-with-nonreadable-path-dir.patch +# 00130 # # Python 2's: # Patch130: python-2.7.2-add-extension-suffix-to-python-config.patch # is not relevant to Python 3 (for 3.2 onwards) +# 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) @@ -292,55 +302,69 @@ 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 # # 00133-skip-test_dl.patch is not relevant for python3: the "dl" module no # longer exists +# 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 # # test_weakref's test_callback_in_cycle_resurrection doesn't work with # COUNT_ALLOCS, as the metrics keep "C" alive. Work around this for our # debug build: # Not yet sent upstream Patch135: 00135-fix-test-within-test_weakref-in-debug-build.patch +# 00136 # # Patch136: 00136-skip-tests-of-seeking-stdin-in-rpmbuild.patch does not seem # to be needed by python3 +# 00137 # # Some tests within distutils fail when run in an rpmbuild: Patch137: 00137-skip-distutils-tests-that-fail-in-rpmbuild.patch +# 00138 # # Patch138: 00138-fix-distutils-tests-in-debug-build.patch is not relevant for # python3 +# 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 # # Patch140: 00140-skip-test_ctypes-known-failure-on-sparc.patch does not appear # to be relevant for python3 +# 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: # python.spec's # Patch144: 00144-no-gdbm.patch # is not needed in python3.spec +# 00145 # # python.spec's # Patch145: 00145-force-sys-platform-to-be-linux2.patch # is upstream for Python 3 as of 3.2.2 +# 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) @@ -357,43 +381,53 @@ Patch143: 00143-tsc-on-ppc.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 3.2.3: # Patch148: 00148-gdbm-1.9-magic-values.patch +# 00149 # # Upstream as of Python 3.2.3: # Patch149: 00149-backport-issue11254-pycache-bytecompilation-fix.patch +# 00150 # # temporarily disable rAssertAlmostEqual in test_cmath on PPC (bz #750811) # caused by a glibc bug. This patch can be removed when we have a glibc with # the patch mentioned here: # http://sourceware.org/bugzilla/show_bug.cgi?id=13472 Patch150: 00150-disable-rAssertAlmostEqual-cmath-on-ppc.patch +# 00151 # # python.spec had: # Patch151: 00151-fork-deadlock.patch +# 00152 # # Fix a regex in test_gdb so that it doesn't choke when gdb provides a full # path to Python/bltinmodule.c: 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): From 8cb91f09cee53cfe1fdca4e87479f9abf96e17a6 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Fri, 4 May 2012 15:42:31 -0400 Subject: [PATCH 092/416] 3.2.3-6: renumber autotools patch from 300 to 5000 --- ...iates.patch => 05000-autotool-intermediates.patch | 0 python3.spec | 12 ++++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) rename autotool-intermediates.patch => 05000-autotool-intermediates.patch (100%) diff --git a/autotool-intermediates.patch b/05000-autotool-intermediates.patch similarity index 100% rename from autotool-intermediates.patch rename to 05000-autotool-intermediates.patch diff --git a/python3.spec b/python3.spec index bfa9de8..81de5ba 100644 --- a/python3.spec +++ b/python3.spec @@ -122,7 +122,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.3 -Release: 5%{?dist} +Release: 6%{?dist} License: Python Group: Development/Languages @@ -456,7 +456,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 BuildRoot: %{_tmppath}/%{name}-%{version}-root @@ -674,7 +674,7 @@ sed --in-place \ %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 @@ -708,7 +708,7 @@ done PATH=~/autoconf-2.65/bin:$PATH autoreconf # Regenerate the patch: -gendiff . .autotool-intermediates > %{PATCH300} +gendiff . .autotool-intermediates > %{PATCH5000} # Exit the build @@ -1482,6 +1482,10 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Fri May 4 2012 David Malcolm - 3.2.3-6 +- renumber autotools patch from 300 to 5000 +- specfile cleanups + * Mon Apr 30 2012 David Malcolm - 3.2.3-5 - fix test_gdb.py (patch 156; rhbz#817072) From ecc5705ec844c614bb45a8fd44c3ba4330afb984 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Fri, 4 May 2012 15:53:42 -0400 Subject: [PATCH 093/416] reorder the %configure arguments (alphabetically) to help with python vs python3 diffs --- python3.spec | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python3.spec b/python3.spec index 81de5ba..bfa2de4 100644 --- a/python3.spec +++ b/python3.spec @@ -736,20 +736,20 @@ BuildPython() { %configure \ --enable-ipv6 \ - --with-wide-unicode \ --enable-shared \ + --with-computed-gotos=%{with_computed_gotos} \ + --with-dbmliborder=gdbm:ndbm:bdb \ + --with-system-expat \ + --with-system-ffi \ + --with-wide-unicode \ %if 0%{?with_systemtap} --with-dtrace \ --with-tapset-install-dir=%{tapsetdir} \ %endif - --with-system-ffi \ %if 0%{?with_valgrind} --with-valgrind \ %endif - --with-system-expat \ - --with-dbmliborder=gdbm:ndbm:bdb \ $ExtraConfigArgs \ - --with-computed-gotos=%{with_computed_gotos} \ %{nil} # Set EXTRA_CFLAGS to our CFLAGS (rather than overriding OPT, as we've done From c04f314ee5c7131ec69025f32e87aa4256349944 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Fri, 11 May 2012 18:42:30 -0400 Subject: [PATCH 094/416] add link to upstream report for patch 147 --- python3.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index bfa2de4..4b43fa8 100644 --- a/python3.spec +++ b/python3.spec @@ -384,7 +384,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 # From bbb50840b1029d8772ce6b0b60a1a4d42da70637 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Fri, 11 May 2012 19:35:32 -0400 Subject: [PATCH 095/416] add notes on upstream status of various patches --- python3.spec | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 4b43fa8..c63b46a 100644 --- a/python3.spec +++ b/python3.spec @@ -239,6 +239,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 # @@ -250,11 +251,13 @@ Patch111: 00111-no-static-lib.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 # 00125 # @@ -262,7 +265,7 @@ Patch114: 00114-statvfs-f_flag-constants.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 # In my koji builds, /root/bin is in the PATH for some reason @@ -341,6 +344,7 @@ Patch139: 00139-skip-test_float-known-failure-on-arm.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 # @@ -409,12 +413,14 @@ Patch150: 00150-disable-rAssertAlmostEqual-cmath-on-ppc.patch # 00152 # # Fix a regex in test_gdb so that it doesn't choke when gdb provides a full # path to Python/bltinmodule.c: +# Not yet sent upstream 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": +# Not yet sent upstream Patch153: 00153-fix-test_gdb-noise.patch # 00154 # @@ -431,6 +437,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 ^^^) From 7989368053a372e8fdb5d9247541763b3720c6fe Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Fri, 18 May 2012 14:57:53 -0400 Subject: [PATCH 096/416] 3.2.3-7: update uid/gid handling (patch 157; rhbz#697470) * Tue May 15 2012 David Malcolm - 3.2.3-7 - update uid/gid handling to avoid int overflows seen with uid/gid values >= 2^31 on 32-bit architectures (patch 157; rhbz#697470) --- 00157-uid-gid-overflows.patch | 685 ++++++++++++++++++++++++++++++++++ python3.spec | 23 +- 2 files changed, 707 insertions(+), 1 deletion(-) create mode 100644 00157-uid-gid-overflows.patch diff --git a/00157-uid-gid-overflows.patch b/00157-uid-gid-overflows.patch new file mode 100644 index 0000000..2f41ef6 --- /dev/null +++ b/00157-uid-gid-overflows.patch @@ -0,0 +1,685 @@ +diff -up Python-3.2.3/Include/modsupport.h.uid-gid-overflows Python-3.2.3/Include/modsupport.h +--- Python-3.2.3/Include/modsupport.h.uid-gid-overflows 2012-05-16 11:56:26.947069274 -0400 ++++ Python-3.2.3/Include/modsupport.h 2012-05-16 11:56:26.545066073 -0400 +@@ -122,6 +122,17 @@ PyAPI_FUNC(PyObject *) PyModule_Create2( + PyAPI_DATA(char *) _Py_PackageContext; + #endif + ++/* ++ 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-3.2.3/Lib/test/test_grp.py.uid-gid-overflows Python-3.2.3/Lib/test/test_grp.py +diff -up Python-3.2.3/Lib/test/test_os.py.uid-gid-overflows Python-3.2.3/Lib/test/test_os.py +--- Python-3.2.3/Lib/test/test_os.py.uid-gid-overflows 2012-05-16 11:56:50.427256400 -0400 ++++ Python-3.2.3/Lib/test/test_os.py 2012-05-16 11:56:49.848251767 -0400 +@@ -885,30 +885,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) + +@@ -923,6 +929,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-3.2.3/Lib/test/test_posix.py.uid-gid-overflows Python-3.2.3/Lib/test/test_posix.py +--- Python-3.2.3/Lib/test/test_posix.py.uid-gid-overflows 2012-05-16 11:56:51.579265577 -0400 ++++ Python-3.2.3/Lib/test/test_posix.py 2012-05-16 11:56:47.142230218 -0400 +@@ -227,7 +227,7 @@ class PosixTester(unittest.TestCase): + else: + self.assertTrue(stat.S_ISFIFO(posix.stat(support.TESTFN).st_mode)) + +- 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: +@@ -246,6 +246,13 @@ class PosixTester(unittest.TestCase): + first_param, 0, 0) + # 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): +@@ -255,7 +262,7 @@ class PosixTester(unittest.TestCase): + + # re-create the file + open(support.TESTFN, 'w').close() +- self._test_all_chown_common(posix.chown, support.TESTFN) ++ self._test_all_chown_common(posix.chown, posix.stat, support.TESTFN) + + @unittest.skipUnless(hasattr(posix, 'fchown'), "test needs os.fchown()") + def test_fchown(self): +@@ -265,7 +272,7 @@ class PosixTester(unittest.TestCase): + test_file = open(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() + +@@ -274,7 +281,7 @@ class PosixTester(unittest.TestCase): + os.unlink(support.TESTFN) + # create a symlink + os.symlink(_DUMMY_SYMLINK, support.TESTFN) +- self._test_all_chown_common(posix.lchown, support.TESTFN) ++ self._test_all_chown_common(posix.lchown, posix.lstat, support.TESTFN) + + def test_chdir(self): + if hasattr(posix, 'chdir'): +diff -up Python-3.2.3/Lib/test/test_pwd.py.uid-gid-overflows Python-3.2.3/Lib/test/test_pwd.py +--- Python-3.2.3/Lib/test/test_pwd.py.uid-gid-overflows 2012-05-16 11:56:47.171230447 -0400 ++++ Python-3.2.3/Lib/test/test_pwd.py 2012-05-17 14:52:07.425548111 -0400 +@@ -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.maxsize ++ fakeuid = 2**32 - 2 + self.assertNotIn(fakeuid, byuids) + self.assertRaises(KeyError, pwd.getpwuid, fakeuid) + +diff -up Python-3.2.3/Modules/grpmodule.c.uid-gid-overflows Python-3.2.3/Modules/grpmodule.c +--- Python-3.2.3/Modules/grpmodule.c.uid-gid-overflows 2012-05-16 11:56:20.025014112 -0400 ++++ Python-3.2.3/Modules/grpmodule.c 2012-05-16 11:56:19.682011408 -0400 +@@ -69,7 +69,7 @@ mkgrent(struct group *p) + Py_INCREF(Py_None); + } + #endif +- SET(setIndex++, PyLong_FromLong((long) p->gr_gid)); ++ SET(setIndex++, _PyObject_FromGid(p->gr_gid)); + SET(setIndex++, w); + #undef SET + +@@ -84,18 +84,16 @@ 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_Long(pyo_id); +- if (!py_int_id) +- return NULL; +- gid = PyLong_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-3.2.3/Modules/posixmodule.c.uid-gid-overflows Python-3.2.3/Modules/posixmodule.c +--- Python-3.2.3/Modules/posixmodule.c.uid-gid-overflows 2012-05-16 11:56:23.722043536 -0400 ++++ Python-3.2.3/Modules/posixmodule.c 2012-05-16 11:56:23.836044488 -0400 +@@ -1642,8 +1642,8 @@ _pystat_fromstructstat(STRUCT_STAT *st) + PyStructSequence_SET_ITEM(v, 2, PyLong_FromLong((long)st->st_dev)); + #endif + PyStructSequence_SET_ITEM(v, 3, PyLong_FromLong((long)st->st_nlink)); +- PyStructSequence_SET_ITEM(v, 4, PyLong_FromLong((long)st->st_uid)); +- PyStructSequence_SET_ITEM(v, 5, PyLong_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)); +@@ -2172,15 +2172,17 @@ posix_chown(PyObject *self, PyObject *ar + { + PyObject *opath; + char *path; +- long uid, gid; ++ uid_t uid; ++ gid_t gid; + int res; +- if (!PyArg_ParseTuple(args, "O&ll:chown", ++ if (!PyArg_ParseTuple(args, "O&O&O&:chown", + PyUnicode_FSConverter, &opath, +- &uid, &gid)) ++ _PyArg_ParseUid, &uid, ++ _PyArg_ParseGid, &gid)) + return NULL; + path = PyBytes_AsString(opath); + 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(opath); +@@ -2200,12 +2202,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:fchown", &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(); +@@ -2224,15 +2229,17 @@ posix_lchown(PyObject *self, PyObject *a + { + PyObject *opath; + char *path; +- long uid, gid; ++ uid_t uid; ++ gid_t gid; + int res; +- if (!PyArg_ParseTuple(args, "O&ll:lchown", ++ if (!PyArg_ParseTuple(args, "O&O&O&:lchown", + PyUnicode_FSConverter, &opath, +- &uid, &gid)) ++ _PyArg_ParseUid, &uid, ++ _PyArg_ParseGid, &gid)) + return NULL; + path = PyBytes_AsString(opath); + 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(opath); +@@ -4287,7 +4294,7 @@ Return the current process's effective g + static PyObject * + posix_getegid(PyObject *self, PyObject *noargs) + { +- return PyLong_FromLong((long)getegid()); ++ return _PyObject_FromGid(getegid()); + } + #endif + +@@ -4300,7 +4307,7 @@ Return the current process's effective u + static PyObject * + posix_geteuid(PyObject *self, PyObject *noargs) + { +- return PyLong_FromLong((long)geteuid()); ++ return _PyObject_FromUid(geteuid()); + } + #endif + +@@ -4313,7 +4320,7 @@ Return the current process's group id.") + static PyObject * + posix_getgid(PyObject *self, PyObject *noargs) + { +- return PyLong_FromLong((long)getgid()); ++ return _PyObject_FromGid(getgid()); + } + #endif + +@@ -4388,7 +4395,7 @@ posix_getgroups(PyObject *self, PyObject + if (result != NULL) { + int i; + for (i = 0; i < n; ++i) { +- PyObject *o = PyLong_FromLong((long)alt_grouplist[i]); ++ PyObject *o = _PyObject_FromGid(alt_grouplist[i]); + if (o == NULL) { + Py_DECREF(result); + result = NULL; +@@ -4419,14 +4426,15 @@ posix_initgroups(PyObject *self, PyObjec + PyObject *oname; + char *username; + int res; +- long gid; ++ gid_t gid; + +- if (!PyArg_ParseTuple(args, "O&l:initgroups", +- PyUnicode_FSConverter, &oname, &gid)) ++ if (!PyArg_ParseTuple(args, "O&O&:initgroups", ++ PyUnicode_FSConverter, &oname, ++ _PyArg_ParseGid, &gid)) + return NULL; + username = PyBytes_AS_STRING(oname); + +- res = initgroups(username, (gid_t) gid); ++ res = initgroups(username, gid); + Py_DECREF(oname); + if (res == -1) + return PyErr_SetFromErrno(PyExc_OSError); +@@ -4601,7 +4609,7 @@ Return the current process's user id."); + static PyObject * + posix_getuid(PyObject *self, PyObject *noargs) + { +- return PyLong_FromLong((long)getuid()); ++ return _PyObject_FromUid(getuid()); + } + #endif + +@@ -4741,15 +4749,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)) +- return NULL; +- uid = uid_arg; +- if (uid != uid_arg) { +- PyErr_SetString(PyExc_OverflowError, "user id too big"); ++ if (!PyArg_ParseTuple(args, "O&:setuid", _PyArg_ParseUid, &uid)) + return NULL; +- } + if (setuid(uid) < 0) + return posix_error(); + Py_INCREF(Py_None); +@@ -4766,15 +4768,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)) +- return NULL; +- euid = euid_arg; +- if (euid != euid_arg) { +- PyErr_SetString(PyExc_OverflowError, "user id too big"); ++ if (!PyArg_ParseTuple(args, "O&:seteuid", _PyArg_ParseUid, &euid)) + return NULL; +- } + if (seteuid(euid) < 0) { + return posix_error(); + } else { +@@ -4792,15 +4788,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)) +- return NULL; +- egid = egid_arg; +- if (egid != egid_arg) { +- PyErr_SetString(PyExc_OverflowError, "group id too big"); ++ if (!PyArg_ParseTuple(args, "O&:setegid", _PyArg_ParseGid, &egid)) + return NULL; +- } + if (setegid(egid) < 0) { + return posix_error(); + } else { +@@ -4818,23 +4808,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)) +- 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"); ++ if (!PyArg_ParseTuple(args, "O&O&", ++ _PyArg_ParseUid, &ruid, ++ _PyArg_ParseUid, &euid)) + return NULL; +- } + if (setreuid(ruid, euid) < 0) { + return posix_error(); + } else { +@@ -4852,23 +4830,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)) +- 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"); ++ if (!PyArg_ParseTuple(args, "O&O&", ++ _PyArg_ParseGid, &rgid, ++ _PyArg_ParseGid, &egid)) + return NULL; +- } + if (setregid(rgid, egid) < 0) { + return posix_error(); + } else { +@@ -4886,15 +4852,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)) ++ if (!PyArg_ParseTuple(args, "O&:setgid", _PyArg_ParseGid, &gid)) + return NULL; +- gid = gid_arg; +- if (gid != gid_arg) { +- PyErr_SetString(PyExc_OverflowError, "group id too big"); +- return NULL; +- } + if (setgid(gid) < 0) + return posix_error(); + Py_INCREF(Py_None); +@@ -4927,27 +4887,9 @@ posix_setgroups(PyObject *self, PyObject + elem = PySequence_GetItem(groups, i); + if (!elem) + return NULL; +- if (!PyLong_Check(elem)) { +- PyErr_SetString(PyExc_TypeError, +- "groups must be integers"); ++ if (!_PyArg_ParseGid(elem, &grouplist[i])) { + 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 the value to see if it fitted in gid_t */ +- if (grouplist[i] != x) { +- PyErr_SetString(PyExc_TypeError, +- "group id too big"); +- Py_DECREF(elem); +- return NULL; +- } + } + Py_DECREF(elem); + } +@@ -7689,9 +7631,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(); +@@ -7707,9 +7651,11 @@ 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(); +@@ -7726,14 +7672,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 + +@@ -7746,14 +7691,13 @@ static PyObject* + posix_getresgid (PyObject *self, PyObject *noargs) + { + uid_t rgid, egid, sgid; +- long l_rgid, l_egid, l_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-3.2.3/Modules/pwdmodule.c.uid-gid-overflows Python-3.2.3/Modules/pwdmodule.c +--- Python-3.2.3/Modules/pwdmodule.c.uid-gid-overflows 2012-05-16 11:56:21.353024696 -0400 ++++ Python-3.2.3/Modules/pwdmodule.c 2012-05-17 14:47:37.465332677 -0400 +@@ -74,8 +74,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 +@@ -104,13 +104,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-3.2.3/Python/getargs.c.uid-gid-overflows Python-3.2.3/Python/getargs.c +--- Python-3.2.3/Python/getargs.c.uid-gid-overflows 2012-05-16 11:56:34.572130014 -0400 ++++ Python-3.2.3/Python/getargs.c 2012-05-16 11:56:34.042125832 -0400 +@@ -4,6 +4,7 @@ + #include "Python.h" + + #include ++#include + + + #ifdef __cplusplus +@@ -1789,6 +1790,102 @@ _PyArg_NoKeywords(const char *funcname, + funcname); + return 0; + } ++ ++PyObject * ++_PyObject_FromUid(uid_t uid) ++{ ++ return PyLong_FromUnsignedLong((uid_t)uid); ++} ++ ++PyObject * ++_PyObject_FromGid(gid_t gid) ++{ ++ 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/python3.spec b/python3.spec index c63b46a..4d9ca8c 100644 --- a/python3.spec +++ b/python3.spec @@ -122,7 +122,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.3 -Release: 6%{?dist} +Release: 7%{?dist} License: Python Group: Development/Languages @@ -440,6 +440,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, @@ -667,6 +683,7 @@ done # 00154: not for this branch %patch155 -p1 %patch156 -p1 +%patch157 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1489,6 +1506,10 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Tue May 15 2012 David Malcolm - 3.2.3-7 +- 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 - 3.2.3-6 - renumber autotools patch from 300 to 5000 - specfile cleanups From f011cdc3fa826cdd9f209bf987f376333ca364ca Mon Sep 17 00:00:00 2001 From: Bohuslav Kabrda Date: Thu, 7 Jun 2012 10:35:31 +0200 Subject: [PATCH 097/416] fix tapset for debug build --- python3.spec | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 4d9ca8c..fdacbdf 100644 --- a/python3.spec +++ b/python3.spec @@ -122,7 +122,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.3 -Release: 7%{?dist} +Release: 8%{?dist} License: Python Group: Development/Languages @@ -1085,8 +1085,12 @@ sed \ > %{buildroot}%{tapsetdir}/%{libpython_stp_optimized} %if 0%{?with_debug_build} +# In Python 3, python3 and python3-debug don't point to the same binary, +# so we have to replace "python3" with "python3-debug" to get systemtap +# working with debug build sed \ -e "s|LIBRARY_PATH|%{_libdir}/%{py_INSTSONAME_debug}|" \ + -e 's|"python3"|"python3-debug"|' \ %{_sourcedir}/libpython.stp \ > %{buildroot}%{tapsetdir}/%{libpython_stp_debug} %endif # with_debug_build @@ -1506,6 +1510,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Wed May 30 2012 Bohuslav Kabrda - 3.2.3-8 +- fix tapset for debug build + * Tue May 15 2012 David Malcolm - 3.2.3-7 - update uid/gid handling to avoid int overflows seen with uid/gid values >= 2^31 on 32-bit architectures (patch 157; rhbz#697470) From a25ec0b524e1b8eb86aea0e83d89119d8a132168 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 19 Jun 2012 12:01:07 -0400 Subject: [PATCH 098/416] 3.2.3-9: fix missing include in uid/gid handling patch (patch 157; rhbz#830405) --- 00157-uid-gid-overflows.patch | 45 ++++++++++++++++++++--------------- python3.spec | 5 +++- 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/00157-uid-gid-overflows.patch b/00157-uid-gid-overflows.patch index 2f41ef6..6be557d 100644 --- a/00157-uid-gid-overflows.patch +++ b/00157-uid-gid-overflows.patch @@ -1,7 +1,15 @@ diff -up Python-3.2.3/Include/modsupport.h.uid-gid-overflows Python-3.2.3/Include/modsupport.h ---- Python-3.2.3/Include/modsupport.h.uid-gid-overflows 2012-05-16 11:56:26.947069274 -0400 -+++ Python-3.2.3/Include/modsupport.h 2012-05-16 11:56:26.545066073 -0400 -@@ -122,6 +122,17 @@ PyAPI_FUNC(PyObject *) PyModule_Create2( +--- Python-3.2.3/Include/modsupport.h.uid-gid-overflows 2012-04-11 02:54:01.000000000 -0400 ++++ Python-3.2.3/Include/modsupport.h 2012-06-18 17:20:38.193527374 -0400 +@@ -8,6 +8,7 @@ extern "C" { + /* Module support interface */ + + #include ++#include + + /* If PY_SSIZE_T_CLEAN is defined, each functions treats #-specifier + to mean Py_ssize_t */ +@@ -122,6 +123,17 @@ PyAPI_FUNC(PyObject *) PyModule_Create2( PyAPI_DATA(char *) _Py_PackageContext; #endif @@ -19,10 +27,9 @@ diff -up Python-3.2.3/Include/modsupport.h.uid-gid-overflows Python-3.2.3/Includ #ifdef __cplusplus } #endif -diff -up Python-3.2.3/Lib/test/test_grp.py.uid-gid-overflows Python-3.2.3/Lib/test/test_grp.py diff -up Python-3.2.3/Lib/test/test_os.py.uid-gid-overflows Python-3.2.3/Lib/test/test_os.py ---- Python-3.2.3/Lib/test/test_os.py.uid-gid-overflows 2012-05-16 11:56:50.427256400 -0400 -+++ Python-3.2.3/Lib/test/test_os.py 2012-05-16 11:56:49.848251767 -0400 +--- Python-3.2.3/Lib/test/test_os.py.uid-gid-overflows 2012-04-11 02:54:05.000000000 -0400 ++++ Python-3.2.3/Lib/test/test_os.py 2012-06-18 17:20:18.360775320 -0400 @@ -885,30 +885,36 @@ if sys.platform != 'win32': def test_setuid(self): if os.getuid() != 0: @@ -70,8 +77,8 @@ diff -up Python-3.2.3/Lib/test/test_os.py.uid-gid-overflows Python-3.2.3/Lib/tes self.assertRaises(OverflowError, os.setregid, 0, 1<<32) diff -up Python-3.2.3/Lib/test/test_posix.py.uid-gid-overflows Python-3.2.3/Lib/test/test_posix.py ---- Python-3.2.3/Lib/test/test_posix.py.uid-gid-overflows 2012-05-16 11:56:51.579265577 -0400 -+++ Python-3.2.3/Lib/test/test_posix.py 2012-05-16 11:56:47.142230218 -0400 +--- Python-3.2.3/Lib/test/test_posix.py.uid-gid-overflows 2012-04-11 02:54:05.000000000 -0400 ++++ Python-3.2.3/Lib/test/test_posix.py 2012-06-18 17:20:18.360775320 -0400 @@ -227,7 +227,7 @@ class PosixTester(unittest.TestCase): else: self.assertTrue(stat.S_ISFIFO(posix.stat(support.TESTFN).st_mode)) @@ -123,8 +130,8 @@ diff -up Python-3.2.3/Lib/test/test_posix.py.uid-gid-overflows Python-3.2.3/Lib/ def test_chdir(self): if hasattr(posix, 'chdir'): diff -up Python-3.2.3/Lib/test/test_pwd.py.uid-gid-overflows Python-3.2.3/Lib/test/test_pwd.py ---- Python-3.2.3/Lib/test/test_pwd.py.uid-gid-overflows 2012-05-16 11:56:47.171230447 -0400 -+++ Python-3.2.3/Lib/test/test_pwd.py 2012-05-17 14:52:07.425548111 -0400 +--- Python-3.2.3/Lib/test/test_pwd.py.uid-gid-overflows 2012-04-11 02:54:05.000000000 -0400 ++++ Python-3.2.3/Lib/test/test_pwd.py 2012-06-18 17:20:18.360775320 -0400 @@ -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 @@ -138,8 +145,8 @@ diff -up Python-3.2.3/Lib/test/test_pwd.py.uid-gid-overflows Python-3.2.3/Lib/te self.assertRaises(KeyError, pwd.getpwuid, fakeuid) diff -up Python-3.2.3/Modules/grpmodule.c.uid-gid-overflows Python-3.2.3/Modules/grpmodule.c ---- Python-3.2.3/Modules/grpmodule.c.uid-gid-overflows 2012-05-16 11:56:20.025014112 -0400 -+++ Python-3.2.3/Modules/grpmodule.c 2012-05-16 11:56:19.682011408 -0400 +--- Python-3.2.3/Modules/grpmodule.c.uid-gid-overflows 2012-04-11 02:54:07.000000000 -0400 ++++ Python-3.2.3/Modules/grpmodule.c 2012-06-18 17:20:18.361775307 -0400 @@ -69,7 +69,7 @@ mkgrent(struct group *p) Py_INCREF(Py_None); } @@ -175,8 +182,8 @@ diff -up Python-3.2.3/Modules/grpmodule.c.uid-gid-overflows Python-3.2.3/Modules } return mkgrent(p); diff -up Python-3.2.3/Modules/posixmodule.c.uid-gid-overflows Python-3.2.3/Modules/posixmodule.c ---- Python-3.2.3/Modules/posixmodule.c.uid-gid-overflows 2012-05-16 11:56:23.722043536 -0400 -+++ Python-3.2.3/Modules/posixmodule.c 2012-05-16 11:56:23.836044488 -0400 +--- Python-3.2.3/Modules/posixmodule.c.uid-gid-overflows 2012-06-18 17:20:18.258776596 -0400 ++++ Python-3.2.3/Modules/posixmodule.c 2012-06-18 17:20:18.362775294 -0400 @@ -1642,8 +1642,8 @@ _pystat_fromstructstat(STRUCT_STAT *st) PyStructSequence_SET_ITEM(v, 2, PyLong_FromLong((long)st->st_dev)); #endif @@ -538,8 +545,8 @@ diff -up Python-3.2.3/Modules/posixmodule.c.uid-gid-overflows Python-3.2.3/Modul #endif diff -up Python-3.2.3/Modules/pwdmodule.c.uid-gid-overflows Python-3.2.3/Modules/pwdmodule.c ---- Python-3.2.3/Modules/pwdmodule.c.uid-gid-overflows 2012-05-16 11:56:21.353024696 -0400 -+++ Python-3.2.3/Modules/pwdmodule.c 2012-05-17 14:47:37.465332677 -0400 +--- Python-3.2.3/Modules/pwdmodule.c.uid-gid-overflows 2012-04-11 02:54:07.000000000 -0400 ++++ Python-3.2.3/Modules/pwdmodule.c 2012-06-18 17:20:18.362775294 -0400 @@ -74,8 +74,8 @@ mkpwent(struct passwd *p) #else SETS(setIndex++, p->pw_passwd); @@ -570,8 +577,8 @@ diff -up Python-3.2.3/Modules/pwdmodule.c.uid-gid-overflows Python-3.2.3/Modules } return mkpwent(p); diff -up Python-3.2.3/Python/getargs.c.uid-gid-overflows Python-3.2.3/Python/getargs.c ---- Python-3.2.3/Python/getargs.c.uid-gid-overflows 2012-05-16 11:56:34.572130014 -0400 -+++ Python-3.2.3/Python/getargs.c 2012-05-16 11:56:34.042125832 -0400 +--- Python-3.2.3/Python/getargs.c.uid-gid-overflows 2012-04-11 02:54:08.000000000 -0400 ++++ Python-3.2.3/Python/getargs.c 2012-06-18 17:20:18.363775282 -0400 @@ -4,6 +4,7 @@ #include "Python.h" @@ -580,7 +587,7 @@ diff -up Python-3.2.3/Python/getargs.c.uid-gid-overflows Python-3.2.3/Python/get #ifdef __cplusplus -@@ -1789,6 +1790,102 @@ _PyArg_NoKeywords(const char *funcname, +@@ -1789,6 +1790,102 @@ _PyArg_NoKeywords(const char *funcname, funcname); return 0; } diff --git a/python3.spec b/python3.spec index fdacbdf..f7fe76f 100644 --- a/python3.spec +++ b/python3.spec @@ -122,7 +122,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.3 -Release: 8%{?dist} +Release: 9%{?dist} License: Python Group: Development/Languages @@ -1510,6 +1510,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon Jun 18 2012 David Malcolm - 3.2.3-9 +- fix missing include in uid/gid handling patch (patch 157; rhbz#830405) + * Wed May 30 2012 Bohuslav Kabrda - 3.2.3-8 - fix tapset for debug build From cc2383541f5417adcfb8d734f6cdefecfc4f22c0 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Fri, 22 Jun 2012 13:43:37 -0400 Subject: [PATCH 099/416] 3.2.3-10: use macro for power64 (rhbz#834653) --- python3.spec | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/python3.spec b/python3.spec index f7fe76f..fd1f504 100644 --- a/python3.spec +++ b/python3.spec @@ -53,7 +53,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 @@ -122,7 +122,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.3 -Release: 9%{?dist} +Release: 10%{?dist} License: Python Group: Development/Languages @@ -650,7 +650,7 @@ done %patch129 -p1 -%ifarch ppc ppc64 +%ifarch ppc %{power64} %patch131 -p1 %endif @@ -674,7 +674,7 @@ done %patch147 -p1 # 00148: upstream as of Python 3.2.3 # 00149: upstream as of Python 3.2.3 -%ifarch ppc ppc64 +%ifarch ppc %{power64} %patch150 -p1 %endif # 00151: not for python3 @@ -797,7 +797,7 @@ BuildPython() { 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" \ @@ -912,7 +912,7 @@ install -d -m 0755 %{buildroot}/usr/lib/python%{pybasever}/site-packages/__pycac %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} @@ -1071,7 +1071,7 @@ ln -s \ # 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 @@ -1510,6 +1510,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Fri Jun 22 2012 David Malcolm - 3.2.3-10 +- use macro for power64 (rhbz#834653) + * Mon Jun 18 2012 David Malcolm - 3.2.3-9 - fix missing include in uid/gid handling patch (patch 157; rhbz#830405) From 1c94c1ae4ebfa045a6ebaf83b6f88afc55573997 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Fri, 20 Jul 2012 16:34:09 -0400 Subject: [PATCH 100/416] 3.3.0-0.1.b1: 3.2 -> 3.3 * Fri Jul 20 2012 David Malcolm - 3.3.0-0.1.b1 - 3.2 -> 3.3: https://fedoraproject.org/wiki/Features/Python_3.3 - 3.3.0b1: refresh patches 3, 55, 102, 111, 113, 114, 134, 157; drop upstream patch 147; regenenerate autotools patch; drop "--with-wide-unicode" from configure (PEP 393); "plat-linux2" -> "plat-linux" (upstream issue 12326); "bz2" -> "_bz2" and "crypt" -> "_crypt"; egg-info files are no longer shipped for stdlib (upstream issues 10645 and 12218); email/test moved to test/test_email; add /usr/bin/pyvenv[-3.3] and venv module (PEP 405); add _decimal and _lzma modules; make collections modules explicit in payload again (upstream issue 11085); add _testbuffer module to tests subpackage (added in upstream commit 3f9b3b6f7ff0) --- ...atch => 00003-remove-mimeaudio-tests.patch | 16 +- 00055-systemtap.patch | 920 ++++++++++++++---- 00111-no-static-lib.patch | 18 +- 00113-more-configuration-flags.patch | 20 +- 00114-statvfs-f_flag-constants.patch | 26 +- ...fix-COUNT_ALLOCS-failure-in-test_sys.patch | 16 +- 00147-add-debug-malloc-stats.patch | 590 ----------- 00157-uid-gid-overflows.patch | 168 ++-- 05000-autotool-intermediates.patch | 756 ++++++++++++-- ...-lib64.patch => python-3.3.0b1-lib64.patch | 78 +- python3.spec | 98 +- sources | 2 +- 12 files changed, 1648 insertions(+), 1060 deletions(-) rename python-3.2b2-remove-mimeaudio-tests.patch => 00003-remove-mimeaudio-tests.patch (67%) delete mode 100644 00147-add-debug-malloc-stats.patch rename python-3.2.3-lib64.patch => python-3.3.0b1-lib64.patch (73%) diff --git a/python-3.2b2-remove-mimeaudio-tests.patch b/00003-remove-mimeaudio-tests.patch similarity index 67% rename from python-3.2b2-remove-mimeaudio-tests.patch rename to 00003-remove-mimeaudio-tests.patch index 118b7b2..08ae10a 100644 --- a/python-3.2b2-remove-mimeaudio-tests.patch +++ b/00003-remove-mimeaudio-tests.patch @@ -1,20 +1,14 @@ -diff -up Python-3.2b2/Lib/email/test/test_email.py.remove-mimeaudio-tests Python-3.2b2/Lib/email/test/test_email.py ---- Python-3.2b2/Lib/email/test/test_email.py.remove-mimeaudio-tests 2010-12-18 13:25:38.000000000 -0500 -+++ Python-3.2b2/Lib/email/test/test_email.py 2010-12-28 16:50:34.910309105 -0500 -@@ -977,53 +977,6 @@ Blah blah blah +diff -up Python-3.3.0b1/Lib/test/test_email/test_email.py.remove-mimeaudio-tests Python-3.3.0b1/Lib/test/test_email/test_email.py +--- Python-3.3.0b1/Lib/test/test_email/test_email.py.remove-mimeaudio-tests 2012-06-26 16:19:47.000000000 -0400 ++++ Python-3.3.0b1/Lib/test/test_email/test_email.py 2012-07-20 12:04:45.316472136 -0400 +@@ -1285,47 +1285,6 @@ Blah blah blah -# Test the basic MIMEAudio class -class TestMIMEAudio(unittest.TestCase): - def setUp(self): -- # Make sure we pick up the audiotest.au that lives in email/test/data. -- # In Python, there's an audiotest.au living in Lib/test but that isn't -- # included in some binary distros that don't include the test -- # package. The trailing empty string on the .join() is significant -- # since findfile() will do a dirname(). -- datadir = os.path.join(os.path.dirname(landmark), 'data', '') -- with open(findfile('audiotest.au', datadir), 'rb') as fp: +- with openfile('audiotest.au', 'rb') as fp: - self._audiodata = fp.read() - self._au = MIMEAudio(self._audiodata) - diff --git a/00055-systemtap.patch b/00055-systemtap.patch index f87fc60..33b82d4 100644 --- a/00055-systemtap.patch +++ b/00055-systemtap.patch @@ -1,214 +1,808 @@ -diff -up Python-3.2b2/configure.in.systemtap Python-3.2b2/configure.in ---- Python-3.2b2/configure.in.systemtap 2010-12-13 02:59:39.000000000 -0500 -+++ Python-3.2b2/configure.in 2010-12-28 17:01:58.044059433 -0500 -@@ -2470,6 +2470,38 @@ if test "$with_valgrind" != no; then +diff -up Python-3.3.0b1/configure.ac.systemtap Python-3.3.0b1/configure.ac +--- Python-3.3.0b1/configure.ac.systemtap 2012-06-26 16:19:58.000000000 -0400 ++++ Python-3.3.0b1/configure.ac 2012-07-20 13:05:39.221792032 -0400 +@@ -2616,6 +2616,23 @@ if test "$with_valgrind" != no; then OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT" 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" ++# Check for systemtap support ++# On Linux, /usr/bin/dtrace is in fact a shim to SystemTap ++AC_MSG_CHECKING([for --with-systemtap]) ++AC_ARG_WITH([systemtap], ++ AC_HELP_STRING([--with(out)-systemtap], [disable/enable SystemTap support]),, ++ with_systemtap=no) ++AC_MSG_RESULT([$with_systemtap]) ++if test "$with_systemtap" != no; then ++ AC_DEFINE(WITH_SYSTEMTAP, 1, ++ [Define if you want to compile in SystemTap support]) ++ SYSTEMTAPOBJS="Python/pysystemtap.o" ++ SYSTEMTAPDEPS="\$(srcdir)/Python/pysystemtap.h" +fi + -+AC_MSG_RESULT($with_dtrace) -+AC_SUBST(DTRACEOBJS) -+AC_SUBST(DTRACEHDRS) ++AC_SUBST(SYSTEMTAPOBJS) ++AC_SUBST(SYSTEMTAPDEPS) + # -I${DLINCLDIR} is added to the compile rule for importdl.o AC_SUBST(DLINCLDIR) DLINCLDIR=. -diff -up Python-3.2b2/Include/pydtrace.d.systemtap Python-3.2b2/Include/pydtrace.d ---- Python-3.2b2/Include/pydtrace.d.systemtap 2010-12-28 16:58:41.762936379 -0500 -+++ Python-3.2b2/Include/pydtrace.d 2010-12-28 16:58:41.762936379 -0500 -@@ -0,0 +1,10 @@ -+provider python { -+ probe function__entry(const char *, const char *, int); -+ probe function__return(const char *, const char *, int); -+}; +diff -up Python-3.3.0b1/configure.systemtap Python-3.3.0b1/configure +--- Python-3.3.0b1/configure.systemtap 2012-06-26 16:19:58.000000000 -0400 ++++ Python-3.3.0b1/configure 2012-07-20 13:05:39.220792044 -0400 +@@ -638,6 +638,8 @@ TRUE + MACHDEP_OBJS + DYNLOADFILE + DLINCLDIR ++SYSTEMTAPDEPS ++SYSTEMTAPOBJS + THREADOBJ + LDLAST + USE_THREAD_MODULE +@@ -793,6 +795,7 @@ with_doc_strings + with_tsc + with_pymalloc + with_valgrind ++with_systemtap + with_fpectl + with_libm + with_libc +@@ -1468,6 +1471,7 @@ Optional Packages: + --with(out)-tsc enable/disable timestamp counter profile + --with(out)-pymalloc disable/enable specialized mallocs + --with-valgrind Enable Valgrind support ++ --with(out)-systemtap disable/enable SystemTap support + --with-fpectl enable SIGFPE catching + --with-libm=STRING math library + --with-libc=STRING C library +@@ -9639,6 +9643,31 @@ fi + OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT" + fi + ++# Check for systemtap support ++# On Linux, /usr/bin/dtrace is in fact a shim to SystemTap ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-systemtap" >&5 ++$as_echo_n "checking for --with-systemtap... " >&6; } + -+#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-3.2b2/Makefile.pre.in.systemtap Python-3.2b2/Makefile.pre.in ---- Python-3.2b2/Makefile.pre.in.systemtap 2010-12-28 16:58:41.000000000 -0500 -+++ Python-3.2b2/Makefile.pre.in 2010-12-28 17:00:58.607310089 -0500 -@@ -328,6 +328,7 @@ PYTHON_OBJS= \ ++# Check whether --with-systemtap was given. ++if test "${with_systemtap+set}" = set; then : ++ withval=$with_systemtap; ++else ++ with_systemtap=no ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_systemtap" >&5 ++$as_echo "$with_systemtap" >&6; } ++if test "$with_systemtap" != no; then ++ ++$as_echo "#define WITH_SYSTEMTAP 1" >>confdefs.h ++ ++ SYSTEMTAPOBJS="Python/pysystemtap.o" ++ SYSTEMTAPDEPS="\$(srcdir)/Python/pysystemtap.h" ++fi ++ ++ ++ ++ + # -I${DLINCLDIR} is added to the compile rule for importdl.o + + DLINCLDIR=. +diff -up Python-3.3.0b1/Doc/howto/index.rst.systemtap Python-3.3.0b1/Doc/howto/index.rst +--- Python-3.3.0b1/Doc/howto/index.rst.systemtap 2012-06-26 16:19:37.000000000 -0400 ++++ Python-3.3.0b1/Doc/howto/index.rst 2012-07-20 13:05:39.215792107 -0400 +@@ -29,4 +29,5 @@ Currently, the HOWTOs are: + webservers.rst + argparse.rst + ipaddress.rst ++ instrumentation.rst + +diff -up Python-3.3.0b1/Doc/howto/instrumentation.rst.systemtap Python-3.3.0b1/Doc/howto/instrumentation.rst +--- Python-3.3.0b1/Doc/howto/instrumentation.rst.systemtap 2012-07-20 13:05:39.215792107 -0400 ++++ Python-3.3.0b1/Doc/howto/instrumentation.rst 2012-07-20 13:05:39.215792107 -0400 +@@ -0,0 +1,295 @@ ++.. _instrumentation: ++ ++==================================== ++Instrumenting CPython with SystemTap ++==================================== ++ ++:author: David Malcolm ++ ++DTrace and SystemTap are monitoring tools, each providing a way to inspect ++what the processes on a computer system are doing. They both use ++domain-specific languages allowing a user to write scripts which: ++ ++ - filter which processes are to be observed ++ - gather data from the processes of interest ++ - generate reports on the data ++ ++As of Python 3.3, CPython can be built with embedded "markers" that can be ++observed by a SystemTap script, making it easier to monitor what the CPython ++processes on a system are doing. ++ ++.. Potentially this document could be expanded to also cover DTrace markers. ++ However, I'm not a DTrace expert. ++ ++.. I'm using ".. code-block:: c" for SystemTap scripts, as "c" is syntactically ++ the closest match that Sphinx supports ++ ++ ++Enabling the static markers ++--------------------------- ++ ++In order to build CPython with the embedded markers for SystemTap, the ++SystemTap development tools must be installed. ++ ++On a Fedora or Red Hat Enterprise Linux machine, this can be done via:: ++ ++ yum install systemtap-sdt-devel ++ ++CPython must then be configured `--with-systemtap`:: ++ ++ checking for --with-systemtap... yes ++ ++You can verify if the SystemTap static markers are present in the built ++binary by seeing if it contains a ".note.stapsdt" section. ++ ++.. code-block:: bash ++ ++ $ eu-readelf -S ./python | grep .note.stapsdt ++ [29] .note.stapsdt NOTE 0000000000000000 00308d78 000000b8 0 0 0 4 ++ ++If you've built python as a shared library (with --enable-shared), you need ++to look instead within the shared library. For example: ++ ++.. code-block:: bash ++ ++ $ eu-readelf -S libpython3.3dm.so.1.0 | grep .note.stapsdt ++ [28] .note.stapsdt NOTE 0000000000000000 00365b68 000000b8 0 0 0 4 ++ ++Earlier versions of SystemTap stored the markers in a ".probes" section. ++ ++For the curious, you can see the metadata for the static markers using this ++invocation. ++ ++.. code-block:: bash ++ ++ $ eu-readelf -x .note.stapsdt ./python ++ ++ Hex dump of section [29] '.note.stapsdt', 184 bytes at offset 0x308d78: ++ 0x00000000 08000000 45000000 03000000 73746170 ....E.......stap ++ 0x00000010 73647400 d4664b00 00000000 4fc36600 sdt..fK.....O.f. ++ 0x00000020 00000000 488d9000 00000000 70797468 ....H.......pyth ++ 0x00000030 6f6e0066 756e6374 696f6e5f 5f656e74 on.function__ent ++ 0x00000040 72790038 40257261 78203840 25726478 ry.8@%rax 8@%rdx ++ 0x00000050 202d3440 25656378 00000000 08000000 -4@%ecx........ ++ 0x00000060 46000000 03000000 73746170 73647400 F.......stapsdt. ++ 0x00000070 0d674b00 00000000 4fc36600 00000000 .gK.....O.f..... ++ 0x00000080 4a8d9000 00000000 70797468 6f6e0066 J.......python.f ++ 0x00000090 756e6374 696f6e5f 5f726574 75726e00 unction__return. ++ 0x000000a0 38402572 61782038 40257264 78202d34 8@%rax 8@%rdx -4 ++ 0x000000b0 40256563 78000000 @%ecx... ++ ++and a sufficiently modern eu-readelf can print the metadata: ++ ++.. code-block:: bash ++ ++ $ eu-readelf -n ./python ++ ++ Note section [ 1] '.note.gnu.build-id' of 36 bytes at offset 0x190: ++ Owner Data size Type ++ GNU 20 GNU_BUILD_ID ++ Build ID: a28f8db1b224530b0d38ad7b82a249cf7c3f18d6 ++ ++ Note section [27] '.note.stapsdt' of 184 bytes at offset 0x1ae884: ++ Owner Data size Type ++ stapsdt 70 Version: 3 ++ PC: 0xe0d3a, Base: 0x14b150, Semaphore: 0x3ae882 ++ Provider: python, Name: function__return, Args: '8@%rbx 8@%r13 -4@%eax' ++ stapsdt 69 Version: 3 ++ PC: 0xe0f37, Base: 0x14b150, Semaphore: 0x3ae880 ++ Provider: python, Name: function__entry, Args: '8@%rbx 8@%r13 -4@%eax' ++ ++The above metadata contains information for SystemTap describing how it can ++patch strategically-placed machine code instructions to enable the tracing ++hooks used by a SystemTap script. ++ ++ ++Static markers ++-------------- ++ ++The low-level way to use the SystemTap integration is to use the static ++markers directly. This requires you to explicitly state the binary file ++containing them. ++ ++For example, this script can be used to show the call/return hierarchy of a ++Python script: ++ ++.. code-block:: c ++ ++ probe process('python').mark("function__entry") { ++ filename = user_string($arg1); ++ funcname = user_string($arg2); ++ lineno = $arg3; ++ ++ printf("%s => %s in %s:%d\\n", ++ thread_indent(1), funcname, filename, lineno); ++ } ++ ++ probe process('python').mark("function__return") { ++ filename = user_string($arg1); ++ funcname = user_string($arg2); ++ lineno = $arg3; ++ ++ printf("%s <= %s in %s:%d\\n", ++ thread_indent(-1), funcname, filename, lineno); ++ } ++ ++It can be invoked like this: ++ ++.. code-block:: bash ++ ++ $ stap \ ++ show-call-hierarchy.stp \ ++ -c ./python test.py ++ ++The output looks like this:: ++ ++ 11408 python(8274): => __contains__ in Lib/_abcoll.py:362 ++ 11414 python(8274): => __getitem__ in Lib/os.py:425 ++ 11418 python(8274): => encode in Lib/os.py:490 ++ 11424 python(8274): <= encode in Lib/os.py:493 ++ 11428 python(8274): <= __getitem__ in Lib/os.py:426 ++ 11433 python(8274): <= __contains__ in Lib/_abcoll.py:366 ++ ++where the columns are: ++ ++ - time in microseconds since start of script ++ ++ - name of executable ++ ++ - PID of process ++ ++and the remainder indicates the call/return hierarchy as the script executes. ++ ++For a `--enable-shared` build of CPython, the markers are contained within the ++libpython shared library, and the probe's dotted path needs to reflect this. For ++example, this line from the above example:: ++ ++ probe process('python').mark("function__entry") { ++ ++should instead read:: ++ ++ probe process('python').library("libpython3.3dm.so.1.0").mark("function__entry") { ++ ++(assuming a debug build of CPython 3.3) ++ ++.. I'm reusing the "c:function" type for markers ++ ++.. c:function:: function__entry(str filename, str funcname, int lineno) ++ ++ This marker indicates that execution of a Python function has begun. It is ++ only triggered for pure-python (bytecode) functions. ++ ++ The filename, function name, and line number are provided back to the ++ tracing script as positional arguments, which must be accessed using ++ `$arg1`, `$arg2`: ++ ++ * `$arg1` : `(const char *)` filename, accessible using `user_string($arg1)` ++ ++ * `$arg2` : `(const char *)` function name, accessible using ++ `user_string($arg2)` ++ ++ * `$arg3` : `int` line number ++ ++ * `$arg4` : `(PyFrameObject *)`, the frame being executed ++ ++.. c:function:: function__return(str filename, str funcname, int lineno) ++ ++ This marker is the converse of `function__entry`, and indicates that ++ execution of a Python function has ended (either via ``return``, or via an ++ exception). It is only triggered for pure-python (bytecode) functions. ++ ++ The arguments are the same as for `function__entry` ++ ++ ++Tapsets ++------- ++ ++The higher-level way to use the SystemTap integration is to use a "tapset": ++SystemTap's equivalent of a library, which hides some of the lower-level ++details of the static markers. ++ ++Here is a tapset file, based on a non-shared build of CPython: ++ ++.. code-block:: c ++ ++ /* ++ Provide a higher-level wrapping around the function__entry and ++ function__return markers: ++ */ ++ probe python.function.entry = process("python").mark("function__entry") ++ { ++ filename = user_string($arg1); ++ funcname = user_string($arg2); ++ lineno = $arg3; ++ frameptr = $arg4 ++ } ++ probe python.function.return = process("python").mark("function__return") ++ { ++ filename = user_string($arg1); ++ funcname = user_string($arg2); ++ lineno = $arg3; ++ frameptr = $arg4 ++ } ++ ++If this file is installed in SystemTap's tapset directory (e.g. ++`/usr/share/systemtap/tapset`), then these additional probepoints become ++available: ++ ++.. c:function:: python.function.entry(str filename, str funcname, int lineno, frameptr) ++ ++ This probe point indicates that execution of a Python function has begun. ++ It is only triggered for pure-python (bytecode) functions. ++ ++.. c:function:: python.function.return(str filename, str funcname, int lineno, frameptr) ++ ++ This probe point is the converse of `python.function.return`, and indicates ++ that execution of a Python function has ended (either via ``return``, or ++ via an exception). It is only triggered for pure-python (bytecode) functions. ++ ++ ++Examples ++-------- ++This SystemTap script uses the tapset above to more cleanly implement the ++example given above of tracing the Python function-call hierarchy, without ++needing to directly name the static markers: ++ ++.. code-block:: c ++ ++ 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); ++ } ++ ++ ++The following script uses the tapset above to provide a top-like view of all ++running CPython code, showing the top 20 most frequently-entered bytecode ++frames, each second, across the whole system: ++ ++.. code-block:: c ++ ++ 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 -up Python-3.3.0b1/Lib/test/test_systemtap.py.systemtap Python-3.3.0b1/Lib/test/test_systemtap.py +--- Python-3.3.0b1/Lib/test/test_systemtap.py.systemtap 2012-07-20 13:05:39.215792107 -0400 ++++ Python-3.3.0b1/Lib/test/test_systemtap.py 2012-07-20 13:05:39.215792107 -0400 +@@ -0,0 +1,205 @@ ++# Verify that systemtap static probes work ++# ++import subprocess ++import sys ++import sysconfig ++import os ++import unittest ++ ++from test.support import run_unittest, TESTFN, unlink ++ ++if '--with-systemtap' not in sysconfig.get_config_var('CONFIG_ARGS'): ++ raise unittest.SkipTest("Python was not configured --with-systemtap") ++ ++try: ++ _, stap_version = subprocess.Popen(["stap", "-V"], ++ stdout=subprocess.PIPE, ++ stderr=subprocess.PIPE, ++ ).communicate() ++except OSError: ++ # This is what "no stap" looks like. There may, however, be other ++ # errors that manifest this way too. ++ raise unittest.SkipTest("Couldn't find stap on the path") ++ ++def invoke_systemtap_script(script, cmd): ++ # Start a child process, probing with the given systemtap script ++ # (passed as stdin to the "stap" tool) ++ # The script should be a bytes instance ++ # Return (stdout, stderr) pair ++ ++ p = subprocess.Popen(["stap", "-", '-vv', '-c', cmd], ++ stdin=subprocess.PIPE, ++ stdout=subprocess.PIPE, ++ stderr=subprocess.PIPE) ++ out, err = p.communicate(input=script) ++ return out, err ++ ++# Verify that stap can run a simple "hello world"-style script ++# This can fail for various reasons: ++# - missing kernel headers ++# - permissions (a non-root user needs to be in the "stapdev" group) ++TRIVIAL_STAP_SCRIPT = b'probe begin { println("hello world") exit () }' ++ ++out, err = invoke_systemtap_script(TRIVIAL_STAP_SCRIPT, 'true') ++if out != b'hello world\n': ++ raise unittest.SkipTest("Test systemtap script did not run; stderr was: %s" % err) ++ ++# We don't expect stderr to be empty, since we're invoking stap with "-vv": stap ++# will (we hope) generate debugging output on stderr. ++ ++def invoke_python_under_systemtap(script, pythoncode=None, pythonfile=None): ++ # Start a child python process, probing with the given systemtap script ++ # (passed as stdin to the "stap" tool) ++ # The script should be a bytes instance ++ # Return (stdout, stderr) pair ++ ++ if pythonfile: ++ pythoncmd = '%s %s' % (sys.executable, pythonfile) ++ else: ++ pythoncmd = '%s -c %r' % (sys.executable, pythoncode) ++ ++ # The process tree of a stap invocation of a command goes through ++ # something like this: ++ # stap ->fork/exec(staprun; exec stapio ->f/e(-c cmd); exec staprun -r) ++ # and this trip through setuid leads to LD_LIBRARY_PATH being dropped, ++ # which would lead to an --enable-shared build of python failing to be ++ # find its libpython, with an error like: ++ # error while loading shared libraries: libpython3.3dm.so.1.0: cannot ++ # open shared object file: No such file or directory ++ # Hence we need to jump through some hoops to expose LD_LIBRARY_PATH to ++ # the invoked python process: ++ LD_LIBRARY_PATH = os.environ.get('LD_LIBRARY_PATH', '') ++ if LD_LIBRARY_PATH: ++ pythoncmd = 'env LD_LIBRARY_PATH=%s ' % LD_LIBRARY_PATH + pythoncmd ++ ++ return invoke_systemtap_script(script, pythoncmd) ++ ++# When using the static markers, we need to supply the prefix of a systemtap ++# dotted probe point that containing the marker. ++# See http://sourceware.org/systemtap/langref/Probe_points.html ++# ++# We need to determine if this is a shared-library build ++# ++# Note that sysconfig can get this wrong; see: ++# http://bugs.python.org/issue14774 ++# ++if '--enable-shared' in sysconfig.get_config_var('CONFIG_ARGS'): ++ # For a shared-library build, the markers are in library(INSTSONAME): ++ INSTSONAME = sysconfig.get_config_var('INSTSONAME') ++ probe_prefix = 'process("%s").library("%s")' % (sys.executable, INSTSONAME) ++else: ++ # For a non-shared-library build, we can simply use sys.executable: ++ probe_prefix = 'process("%s")' % sys.executable ++ ++# The following script ought to generate lots of lines showing recursive ++# function entry and return, of the form: ++# 11408 python(8274): => __contains__ in Lib/_abcoll.py:362 ++# 11414 python(8274): => __getitem__ in Lib/os.py:425 ++# 11418 python(8274): => encode in Lib/os.py:490 ++# 11424 python(8274): <= encode in Lib/os.py:493 ++# 11428 python(8274): <= __getitem__ in Lib/os.py:426 ++# 11433 python(8274): <= __contains__ in Lib/_abcoll.py:366 ++# where the column are: ++# - time in microseconds since start of script ++# - name of executable ++# - PID of process ++# and the remainder indicates the call/return hierarchy ++ ++hierarchy_script = (''' ++probe %s.mark("function__entry") { ++ filename = user_string($arg1); ++ funcname = user_string($arg2); ++ lineno = $arg3; ++ ++ printf("%%s => %%s in %%s:%%d\\n", thread_indent(1), funcname, filename, lineno); ++} ++ ++probe %s.mark("function__return") { ++ filename = user_string($arg1); ++ funcname = user_string($arg2); ++ lineno = $arg3; ++ ++ printf("%%s <= %%s in %%s:%%d\\n", thread_indent(-1), funcname, filename, lineno); ++} ++''' % (probe_prefix, probe_prefix)).encode('utf-8') ++ ++ ++class ErrorDumper: ++ # A context manager that dumps extra information if an exception is raised, ++ # to help track down why the problem occurred ++ def __init__(self, out, err): ++ self.out = out ++ self.err = err ++ ++ def __enter__(self): ++ pass ++ ++ def __exit__(self, type_, value, traceback): ++ if type_: ++ # an exception is being raised: ++ print('stdout: %s' % out.decode()) ++ print('stderr: %s' % err.decode()) ++ ++class SystemtapTests(unittest.TestCase): ++ ++ def test_invoking_python(self): ++ # Ensure that we can invoke python under stap, with a trivial stap ++ # script: ++ out, err = invoke_python_under_systemtap( ++ b'probe begin { println("hello from stap") exit () }', ++ pythoncode="print('hello from python')") ++ with ErrorDumper(out, err): ++ self.assertIn(b'hello from stap', out) ++ self.assertIn(b'hello from python', out) ++ ++ def test_function_entry(self): ++ # Ensure that the function_entry static marker works ++ out, err = invoke_python_under_systemtap(hierarchy_script) ++ # stdout ought to contain various lines showing recursive function ++ # entry and return (see above) ++ ++ # Uncomment this for debugging purposes: ++ # print(out.decode('utf-8')) ++ ++ # Executing the cmdline-supplied "pass": ++ # 0 python(8274): => in :1 ++ # 5 python(8274): <= in :1 ++ with ErrorDumper(out, err): ++ self.assertIn(b'=> in :1', out, ++ msg="stdout: %s\nstderr: %s\n" % (out, err)) ++ ++ def test_encoding(self): ++ # Ensure that scripts and function names containing non-Latin 1 code ++ # points are handled: ++ pythonfile = TESTFN + '_☠.py' ++ try: ++ unlink(pythonfile) ++ f = open(pythonfile, "wb") ++ f.write(""" ++# Sample script with non-ASCII filename, for use by test_systemtap.py ++# Implicitly UTF-8 ++ ++def 文字化け(): ++ '''Function with non-ASCII identifier; I believe this reads "mojibake"''' ++ print("hello world!") ++ ++文字化け() ++""".encode('utf-8')) ++ f.close() ++ ++ out, err = invoke_python_under_systemtap(hierarchy_script, ++ pythonfile=pythonfile) ++ out_utf8 = out.decode('utf-8') ++ with ErrorDumper(out, err): ++ self.assertIn('=> in %s:5' % pythonfile, out_utf8) ++ self.assertIn(' => 文字化け in %s:5' % pythonfile, out_utf8) ++ self.assertIn(' <= 文字化け in %s:7' % pythonfile, out_utf8) ++ self.assertIn('<= in %s:9' % pythonfile, out_utf8) ++ finally: ++ unlink(pythonfile) ++ ++def test_main(): ++ run_unittest(SystemtapTests) ++ ++if __name__ == "__main__": ++ test_main() +diff -up Python-3.3.0b1/Makefile.pre.in.systemtap Python-3.3.0b1/Makefile.pre.in +--- Python-3.3.0b1/Makefile.pre.in.systemtap 2012-06-26 16:19:51.000000000 -0400 ++++ Python-3.3.0b1/Makefile.pre.in 2012-07-20 13:05:39.216792095 -0400 +@@ -358,6 +358,7 @@ PYTHON_OBJS= \ Python/formatter_unicode.o \ Python/fileutils.o \ Python/$(DYNLOADFILE) \ -+ @DTRACEOBJS@ \ ++ @SYSTEMTAPOBJS@ \ $(LIBOBJS) \ $(MACHDEP_OBJS) \ $(THREADOBJ) -@@ -632,6 +633,18 @@ Objects/typeobject.o: $(srcdir)/Objects/ +@@ -708,7 +709,8 @@ Objects/setobject.o: $(srcdir)/Objects/s + $(OPCODETARGETS_H): $(OPCODETARGETGEN_FILES) + $(OPCODETARGETGEN) $(OPCODETARGETS_H) + +-Python/ceval.o: $(OPCODETARGETS_H) $(srcdir)/Python/ceval_gil.h ++Python/ceval.o: $(OPCODETARGETS_H) $(srcdir)/Python/ceval_gil.h \ ++ $(srcdir)/Python/ceval_systemtap.h @SYSTEMTAPDEPS@ + + Python/formatter_unicode.o: $(srcdir)/Python/formatter_unicode.c \ + $(BYTESTR_DEPS) +@@ -719,6 +721,13 @@ Objects/typeobject.o: $(srcdir)/Objects/ $(srcdir)/Objects/typeslots.inc: $(srcdir)/Include/typeslots.h $(srcdir)/Objects/typeslots.py $(PYTHON) $(srcdir)/Objects/typeslots.py < $(srcdir)/Include/typeslots.h > $(srcdir)/Objects/typeslots.inc -+# Only needed with --with-dtrace -+buildinclude: -+ mkdir -p Include ++# Only needed with --with-systemtap; not a public header: ++$(srcdir)/Python/pysystemtap.h: $(srcdir)/Python/pysystemtap.d ++ dtrace -o $@ $(DFLAGS) -C -h -s $(srcdir)/Python/pysystemtap.d + -+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 ++Python/pysystemtap.o: $(srcdir)/Python/pysystemtap.d Python/ceval.o ++ dtrace -o $@ $(DFLAGS) -C -G -s $(srcdir)/Python/pysystemtap.d Python/ceval.o + ############################################################################ # Header files -@@ -1282,7 +1295,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 +@@ -1335,6 +1344,7 @@ clean: pycremoval + -rm -f Lib/lib2to3/*Grammar*.pickle + -rm -f $(SYSCONFIGDATA) + -rm -f Modules/_testembed Modules/_freeze_importlib ++ -rm -f $(srcdir)/Python/pysystemtap.h - # IF YOU PUT ANYTHING HERE IT WILL GO AWAY -diff -up Python-3.2b2/pyconfig.h.in.systemtap Python-3.2b2/pyconfig.h.in ---- Python-3.2b2/pyconfig.h.in.systemtap 2010-11-20 05:29:12.000000000 -0500 -+++ Python-3.2b2/pyconfig.h.in 2010-12-28 16:58:41.765937360 -0500 -@@ -1092,6 +1092,9 @@ - /* Define if you want documentation strings in extension modules */ - #undef WITH_DOC_STRINGS + profile-removal: + find . -name '*.gc??' -exec rm -f {} ';' +diff -up Python-3.3.0b1/Misc/NEWS.systemtap Python-3.3.0b1/Misc/NEWS +--- Python-3.3.0b1/Misc/NEWS.systemtap 2012-06-26 16:19:51.000000000 -0400 ++++ Python-3.3.0b1/Misc/NEWS 2012-07-20 13:05:39.217792083 -0400 +@@ -55,6 +55,11 @@ Core and Builtins -+/* Define if you want to compile in Dtrace support */ -+#undef WITH_DTRACE + - Issue #15038: Optimize python Locks on Windows. + ++- Issue #14776: Added a new --with-systemtap configure-time option, which adds ++ static markers for SystemTap so that SystemTap scripts can observe bytecode ++ frames being entered and exited and so generate reports on what Python code ++ is being exectuted. + - /* 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-3.2b2/Python/ceval.c.systemtap Python-3.2b2/Python/ceval.c ---- Python-3.2b2/Python/ceval.c.systemtap 2010-12-03 15:14:31.000000000 -0500 -+++ Python-3.2b2/Python/ceval.c 2010-12-28 16:58:41.768935588 -0500 -@@ -18,6 +18,10 @@ + Library + ------- + +diff -up Python-3.3.0b1/pyconfig.h.in.systemtap Python-3.3.0b1/pyconfig.h.in +--- Python-3.3.0b1/pyconfig.h.in.systemtap 2012-06-26 16:19:58.000000000 -0400 ++++ Python-3.3.0b1/pyconfig.h.in 2012-07-20 13:05:39.222792020 -0400 +@@ -1306,6 +1306,9 @@ + /* Define if you want to compile in Python-specific mallocs */ + #undef WITH_PYMALLOC + ++/* Define if you want to compile in SystemTap support */ ++#undef WITH_SYSTEMTAP ++ + /* Define if you want to compile in rudimentary thread support */ + #undef WITH_THREAD + +diff -up Python-3.3.0b1/Python/ceval.c.systemtap Python-3.3.0b1/Python/ceval.c +--- Python-3.3.0b1/Python/ceval.c.systemtap 2012-06-26 16:19:56.000000000 -0400 ++++ Python-3.3.0b1/Python/ceval.c 2012-07-20 13:05:39.218792070 -0400 +@@ -18,6 +18,8 @@ #include -+#ifdef WITH_DTRACE -+#include "pydtrace.h" -+#endif ++#include "ceval_systemtap.h" + #ifndef WITH_TSC #define READ_TIMESTAMP(var) -@@ -766,6 +770,70 @@ PyEval_EvalCode(PyObject *co, PyObject * - } - - -+#ifdef WITH_DTRACE -+struct frame_marker_info -+{ -+ char *filename; -+ char *name; -+ int lineno; -+ -+ PyObject *utf8_filename; -+ PyObject *utf8_name; -+}; -+ -+static void -+get_frame_marker_info(PyFrameObject *f, struct frame_marker_info *fmi) -+{ -+ fmi->utf8_filename = PyUnicode_AsUTF8String(f->f_code->co_filename); -+ if (fmi->utf8_filename) { -+ fmi->filename = PyBytes_AsString(fmi->utf8_filename); -+ } else { -+ fmi->filename = NULL; -+ /* FIXME: clear the exception? */ -+ } -+ -+ fmi->utf8_name = PyUnicode_AsUTF8String(f->f_code->co_name); -+ if (fmi->utf8_name) { -+ fmi->name = PyBytes_AsString(fmi->utf8_name); -+ } else { -+ fmi->name = NULL; -+ /* FIXME: clear the exception? */ -+ } -+ -+ fmi->lineno = PyCode_Addr2Line(f->f_code, f->f_lasti); -+} -+ -+static void -+release_frame_marker_info(struct frame_marker_info *fmi) -+{ -+ Py_XDECREF(fmi->utf8_filename); -+ Py_XDECREF(fmi->utf8_name); -+} -+ -+static void -+dtrace_entry(PyFrameObject *f) -+{ -+ struct frame_marker_info fmi; -+ get_frame_marker_info(f, &fmi); -+ PYTHON_FUNCTION_ENTRY(fmi.filename, fmi.name, fmi.lineno); -+ release_frame_marker_info(&fmi); -+} -+ -+static void -+dtrace_return(PyFrameObject *f) -+{ -+ struct frame_marker_info fmi; -+ get_frame_marker_info(f, &fmi); -+ PYTHON_FUNCTION_RETURN(fmi.filename, fmi.name, fmi.lineno); -+ release_frame_marker_info(&fmi); -+} -+#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 */ - - PyObject * -@@ -1183,6 +1251,10 @@ PyEval_EvalFrameEx(PyFrameObject *f, int +@@ -1160,6 +1162,10 @@ PyEval_EvalFrameEx(PyFrameObject *f, int } } + if (PYTHON_FUNCTION_ENTRY_ENABLED()) { -+ dtrace_entry(f); ++ systemtap_function_entry(f); + } + co = f->f_code; names = co->co_names; consts = co->co_consts; -@@ -3048,6 +3120,9 @@ fast_yield: +@@ -3077,6 +3083,11 @@ fast_yield: /* pop frame */ exit_eval_frame: ++ + if (PYTHON_FUNCTION_RETURN_ENABLED()) { -+ dtrace_return(f); ++ systemtap_function_return(f); + } ++ Py_LeaveRecursiveCall(); tstate->frame = f->f_back; +diff -up Python-3.3.0b1/Python/ceval_systemtap.h.systemtap Python-3.3.0b1/Python/ceval_systemtap.h +--- Python-3.3.0b1/Python/ceval_systemtap.h.systemtap 2012-07-20 13:05:39.218792070 -0400 ++++ Python-3.3.0b1/Python/ceval_systemtap.h 2012-07-20 13:05:39.218792070 -0400 +@@ -0,0 +1,86 @@ ++/* ++ Support for SystemTap static markers ++*/ ++ ++#ifdef WITH_SYSTEMTAP ++ ++#include "pysystemtap.h" ++ ++/* ++ A struct to hold all of the information gathered when one of the traceable ++ markers is triggered ++*/ ++struct frame_marker_info ++{ ++ PyObject *filename_obj; ++ PyObject *funcname_obj; ++ const char *filename; ++ const char *funcname; ++ int lineno; ++}; ++ ++static void ++get_frame_marker_info(PyFrameObject *f, struct frame_marker_info *fmi) ++{ ++ PyObject *ptype; ++ PyObject *pvalue; ++ PyObject *ptraceback; ++ ++ PyErr_Fetch(&ptype, &pvalue, &ptraceback); ++ ++ fmi->filename_obj = PyUnicode_EncodeFSDefault(f->f_code->co_filename); ++ if (fmi->filename_obj) { ++ fmi->filename = PyBytes_AsString(fmi->filename_obj); ++ } else { ++ fmi->filename = NULL; ++ } ++ ++ fmi->funcname_obj = PyUnicode_AsUTF8String(f->f_code->co_name); ++ if (fmi->funcname_obj) { ++ fmi->funcname = PyBytes_AsString(fmi->funcname_obj); ++ } else { ++ fmi->funcname = NULL; ++ } ++ ++ fmi->lineno = PyCode_Addr2Line(f->f_code, f->f_lasti); ++ ++ PyErr_Restore(ptype, pvalue, ptraceback); ++ ++} ++ ++static void ++release_frame_marker_info(struct frame_marker_info *fmi) ++{ ++ Py_XDECREF(fmi->filename_obj); ++ Py_XDECREF(fmi->funcname_obj); ++} ++ ++static void ++systemtap_function_entry(PyFrameObject *f) ++{ ++ struct frame_marker_info fmi; ++ get_frame_marker_info(f, &fmi); ++ PYTHON_FUNCTION_ENTRY(fmi.filename, fmi.funcname, fmi.lineno, f); ++ release_frame_marker_info(&fmi); ++} ++ ++static void ++systemtap_function_return(PyFrameObject *f) ++{ ++ struct frame_marker_info fmi; ++ get_frame_marker_info(f, &fmi); ++ PYTHON_FUNCTION_RETURN(fmi.filename, fmi.funcname, fmi.lineno, f); ++ release_frame_marker_info(&fmi); ++} ++ ++#else /* #ifdef WITH_SYSTEMTAP */ ++ ++/* ++ When configured --without-systemtap, everything compiles away to nothing: ++*/ ++#define PYTHON_FUNCTION_ENTRY_ENABLED() 0 ++#define PYTHON_FUNCTION_RETURN_ENABLED() 0 ++#define systemtap_function_entry(f) ++#define systemtap_function_return(f) ++ ++#endif +diff -up Python-3.3.0b1/Python/pysystemtap.d.systemtap Python-3.3.0b1/Python/pysystemtap.d +--- Python-3.3.0b1/Python/pysystemtap.d.systemtap 2012-07-20 13:05:39.218792070 -0400 ++++ Python-3.3.0b1/Python/pysystemtap.d 2012-07-20 13:05:39.218792070 -0400 +@@ -0,0 +1,4 @@ ++provider python { ++ probe function__entry(const char *, const char *, int, PyFrameObject *); ++ probe function__return(const char *, const char *, int, PyFrameObject *); ++}; diff --git a/00111-no-static-lib.patch b/00111-no-static-lib.patch index 3a6ac8a..8ba0fd7 100644 --- a/00111-no-static-lib.patch +++ b/00111-no-static-lib.patch @@ -1,7 +1,7 @@ -diff -up Python-3.2.1/Makefile.pre.in.no-static-lib Python-3.2.1/Makefile.pre.in ---- Python-3.2.1/Makefile.pre.in.no-static-lib 2011-07-09 02:58:52.000000000 -0400 -+++ Python-3.2.1/Makefile.pre.in 2011-07-11 11:46:27.381425999 -0400 -@@ -425,7 +425,7 @@ coverage: +diff -up Python-3.3.0b1/Makefile.pre.in.no-static-lib Python-3.3.0b1/Makefile.pre.in +--- Python-3.3.0b1/Makefile.pre.in.no-static-lib 2012-07-20 13:20:34.056605058 -0400 ++++ Python-3.3.0b1/Makefile.pre.in 2012-07-20 13:21:41.540761389 -0400 +@@ -458,7 +458,7 @@ coverage: # Build the interpreter @@ -9,8 +9,8 @@ diff -up Python-3.2.1/Makefile.pre.in.no-static-lib Python-3.2.1/Makefile.pre.in +$(BUILDPYTHON): Modules/python.o $(LDLIBRARY) $(PY3LIBRARY) $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Modules/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) - platform: $(BUILDPYTHON) -@@ -439,18 +439,6 @@ sharedmods: $(BUILDPYTHON) + platform: $(BUILDPYTHON) $(SYSCONFIGDATA) +@@ -475,18 +475,6 @@ sharedmods: $(BUILDPYTHON) $(SYSCONFIGDA *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \ esac @@ -21,7 +21,7 @@ diff -up Python-3.2.1/Makefile.pre.in.no-static-lib Python-3.2.1/Makefile.pre.in - $(AR) $(ARFLAGS) $@ Modules/getbuildinfo.o - $(AR) $(ARFLAGS) $@ $(PARSER_OBJS) - $(AR) $(ARFLAGS) $@ $(OBJECT_OBJS) -- $(AR) $(ARFLAGS) $@ $(PYTHON_OBJS) +- $(AR) $(ARFLAGS) $@ $(PYTHON_OBJS) Python/frozen.o - $(AR) $(ARFLAGS) $@ $(MODULE_OBJS) $(SIGNAL_OBJS) - $(AR) $(ARFLAGS) $@ $(MODOBJS) - $(RANLIB) $@ @@ -29,7 +29,7 @@ diff -up Python-3.2.1/Makefile.pre.in.no-static-lib Python-3.2.1/Makefile.pre.in libpython$(LDVERSION).so: $(LIBRARY_OBJS) if test $(INSTSONAME) != $(LDLIBRARY); then \ $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ -@@ -540,7 +528,7 @@ Modules/Setup: $(srcdir)/Modules/Setup.d +@@ -576,7 +564,7 @@ Modules/Setup: $(srcdir)/Modules/Setup.d echo "-----------------------------------------------"; \ fi @@ -38,7 +38,7 @@ diff -up Python-3.2.1/Makefile.pre.in.no-static-lib Python-3.2.1/Makefile.pre.in $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Modules/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) ############################################################################ -@@ -1058,18 +1046,6 @@ libainstall: all python-config +@@ -1150,18 +1138,6 @@ libainstall: all python-config else true; \ fi; \ done diff --git a/00113-more-configuration-flags.patch b/00113-more-configuration-flags.patch index 24df543..1067af1 100644 --- a/00113-more-configuration-flags.patch +++ b/00113-more-configuration-flags.patch @@ -1,7 +1,7 @@ -diff -up Python-3.1.2/configure.in.more-configuration-flags Python-3.1.2/configure.in ---- Python-3.1.2/configure.in.more-configuration-flags 2010-05-25 12:16:48.602875960 -0400 -+++ Python-3.1.2/configure.in 2010-05-25 12:16:48.609879553 -0400 -@@ -2443,6 +2443,30 @@ else AC_MSG_RESULT(no) +diff -up Python-3.3.0b1/configure.ac.more-configuration-flags Python-3.3.0b1/configure.ac +--- Python-3.3.0b1/configure.ac.more-configuration-flags 2012-07-20 13:25:33.232864839 -0400 ++++ Python-3.3.0b1/configure.ac 2012-07-20 13:25:33.314863815 -0400 +@@ -2585,6 +2585,30 @@ else AC_MSG_RESULT(no) fi], [AC_MSG_RESULT(no)]) @@ -32,12 +32,12 @@ diff -up Python-3.1.2/configure.in.more-configuration-flags Python-3.1.2/configu # Check for Python-specific malloc support AC_MSG_CHECKING(for --with-pymalloc) AC_ARG_WITH(pymalloc, -diff -up Python-3.1.2/pyconfig.h.in.more-configuration-flags Python-3.1.2/pyconfig.h.in ---- Python-3.1.2/pyconfig.h.in.more-configuration-flags 2010-05-25 12:16:48.000000000 -0400 -+++ Python-3.1.2/pyconfig.h.in 2010-05-25 12:17:54.428126399 -0400 -@@ -18,6 +18,12 @@ - /* Define if you have the Mach cthreads package */ - #undef C_THREADS +diff -up Python-3.3.0b1/pyconfig.h.in.more-configuration-flags Python-3.3.0b1/pyconfig.h.in +--- Python-3.3.0b1/pyconfig.h.in.more-configuration-flags 2012-07-20 13:25:33.000000000 -0400 ++++ Python-3.3.0b1/pyconfig.h.in 2012-07-20 13:26:02.826494869 -0400 +@@ -12,6 +12,12 @@ + support for AIX C++ shared extension modules. */ + #undef AIX_GENUINE_CPLUSPLUS +/* Define to keep records on function call invocation */ +#undef CALL_PROFILE diff --git a/00114-statvfs-f_flag-constants.patch b/00114-statvfs-f_flag-constants.patch index b666c1b..af0d780 100644 --- a/00114-statvfs-f_flag-constants.patch +++ b/00114-statvfs-f_flag-constants.patch @@ -1,18 +1,10 @@ -diff -up Python-3.2a1/Modules/posixmodule.c.statvfs-f-flag-constants Python-3.2a1/Modules/posixmodule.c ---- Python-3.2a1/Modules/posixmodule.c.statvfs-f-flag-constants 2010-07-23 09:53:51.000000000 -0400 -+++ Python-3.2a1/Modules/posixmodule.c 2010-08-02 16:39:38.756000423 -0400 -@@ -8173,6 +8173,43 @@ all_ins(PyObject *d) - #endif - #endif +diff -up Python-3.3.0b1/Modules/posixmodule.c.statvfs-f_flag-constants Python-3.3.0b1/Modules/posixmodule.c +--- Python-3.3.0b1/Modules/posixmodule.c.statvfs-f_flag-constants 2012-06-26 16:19:54.000000000 -0400 ++++ Python-3.3.0b1/Modules/posixmodule.c 2012-07-20 13:39:18.595546387 -0400 +@@ -11665,6 +11665,35 @@ all_ins(PyObject *d) + if (ins(d, "ST_NOSUID", (long)ST_NOSUID)) return -1; + #endif /* ST_NOSUID */ -+ /* 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; @@ -42,6 +34,6 @@ diff -up Python-3.2a1/Modules/posixmodule.c.statvfs-f-flag-constants Python-3.2a + if (ins(d, "ST_RELATIME", (long)ST_RELATIME)) return -1; +#endif /* ST_RELATIME */ + - #if defined(PYOS_OS2) - if (insertvalues(d)) return -1; - #endif + /* FreeBSD sendfile() constants */ + #ifdef SF_NODISKIO + if (ins(d, "SF_NODISKIO", (long)SF_NODISKIO)) return -1; diff --git a/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch b/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch index c1871ac..18549cb 100644 --- a/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch +++ b/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch @@ -1,13 +1,13 @@ -diff -up Python-3.2b2/Lib/test/test_sys.py.fix-test-sys-COUNT_ALLOCS Python-3.2b2/Lib/test/test_sys.py ---- Python-3.2b2/Lib/test/test_sys.py.fix-test-sys-COUNT_ALLOCS 2010-12-28 20:52:43.236310184 -0500 -+++ Python-3.2b2/Lib/test/test_sys.py 2010-12-28 20:58:09.164184094 -0500 -@@ -817,6 +817,9 @@ class SizeofTest(unittest.TestCase): - # (PyTypeObject + PyNumberMethods + PyMappingMethods + - # PySequenceMethods + PyBufferProcs) - s = size(vh + 'P2P15Pl4PP9PP11PI') + size('16Pi17P 3P 10P 2P 2P') +diff -up Python-3.3.0b1/Lib/test/test_sys.py.fix-COUNT_ALLOCS-failure-in-test_sys Python-3.3.0b1/Lib/test/test_sys.py +--- Python-3.3.0b1/Lib/test/test_sys.py.fix-COUNT_ALLOCS-failure-in-test_sys 2012-06-26 16:19:48.000000000 -0400 ++++ Python-3.3.0b1/Lib/test/test_sys.py 2012-07-20 13:44:23.050740172 -0400 +@@ -869,6 +869,9 @@ class SizeofTest(unittest.TestCase): + s = size(vh + 'P2P15Pl4PP9PP11PI') + size('34P 3P 10P 2P 4P') + # Separate block for PyDictKeysObject with 4 entries + s += size("PPPP") + 4*size("PPP") + # COUNT_ALLOCS adds a further 3 Py_ssize_t and 2 pointers: + if hasattr(sys, 'getcounts'): + s += size('3P2P') - check(int, s) # class class newstyleclass(object): pass + check(newstyleclass, s) diff --git a/00147-add-debug-malloc-stats.patch b/00147-add-debug-malloc-stats.patch deleted file mode 100644 index e2a8342..0000000 --- a/00147-add-debug-malloc-stats.patch +++ /dev/null @@ -1,590 +0,0 @@ -diff -up Python-3.2.2/Include/dictobject.h.add-debug-malloc-stats Python-3.2.2/Include/dictobject.h ---- Python-3.2.2/Include/dictobject.h.add-debug-malloc-stats 2011-09-03 12:16:40.000000000 -0400 -+++ Python-3.2.2/Include/dictobject.h 2011-09-16 18:57:24.969825060 -0400 -@@ -156,6 +156,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-3.2.2/Include/floatobject.h.add-debug-malloc-stats Python-3.2.2/Include/floatobject.h ---- Python-3.2.2/Include/floatobject.h.add-debug-malloc-stats 2011-09-03 12:16:40.000000000 -0400 -+++ Python-3.2.2/Include/floatobject.h 2011-09-16 18:57:24.970825060 -0400 -@@ -110,6 +110,8 @@ PyAPI_FUNC(double) _PyFloat_Unpack8(cons - /* free list api */ - PyAPI_FUNC(int) PyFloat_ClearFreeList(void); - -+PyAPI_FUNC(void) _PyFloat_DebugMallocStats(FILE* out); -+ - /* Format the object based on the format_spec, as defined in PEP 3101 - (Advanced String Formatting). */ - PyAPI_FUNC(PyObject *) _PyFloat_FormatAdvanced(PyObject *obj, -diff -up Python-3.2.2/Include/frameobject.h.add-debug-malloc-stats Python-3.2.2/Include/frameobject.h ---- Python-3.2.2/Include/frameobject.h.add-debug-malloc-stats 2011-09-03 12:16:40.000000000 -0400 -+++ Python-3.2.2/Include/frameobject.h 2011-09-16 18:57:24.970825060 -0400 -@@ -79,6 +79,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-3.2.2/Include/listobject.h.add-debug-malloc-stats Python-3.2.2/Include/listobject.h ---- Python-3.2.2/Include/listobject.h.add-debug-malloc-stats 2011-09-03 12:16:40.000000000 -0400 -+++ Python-3.2.2/Include/listobject.h 2011-09-16 18:57:24.971825060 -0400 -@@ -71,6 +71,8 @@ PyAPI_FUNC(PyObject *) _PyList_Extend(Py - #define PyList_GET_SIZE(op) Py_SIZE(op) - #endif - -+PyAPI_FUNC(void) _PyList_DebugMallocStats(FILE *out); -+ - #ifdef __cplusplus - } - #endif -diff -up Python-3.2.2/Include/methodobject.h.add-debug-malloc-stats Python-3.2.2/Include/methodobject.h ---- Python-3.2.2/Include/methodobject.h.add-debug-malloc-stats 2011-09-03 12:16:40.000000000 -0400 -+++ Python-3.2.2/Include/methodobject.h 2011-09-16 18:57:24.971825060 -0400 -@@ -81,6 +81,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-3.2.2/Include/object.h.add-debug-malloc-stats Python-3.2.2/Include/object.h ---- Python-3.2.2/Include/object.h.add-debug-malloc-stats 2011-09-03 12:16:40.000000000 -0400 -+++ Python-3.2.2/Include/object.h 2011-09-16 18:57:24.972825060 -0400 -@@ -919,6 +919,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-3.2.2/Include/objimpl.h.add-debug-malloc-stats Python-3.2.2/Include/objimpl.h ---- Python-3.2.2/Include/objimpl.h.add-debug-malloc-stats 2011-09-03 12:16:40.000000000 -0400 -+++ Python-3.2.2/Include/objimpl.h 2011-09-16 18:57:24.972825060 -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-3.2.2/Include/setobject.h.add-debug-malloc-stats Python-3.2.2/Include/setobject.h ---- Python-3.2.2/Include/setobject.h.add-debug-malloc-stats 2011-09-16 19:10:58.448817301 -0400 -+++ Python-3.2.2/Include/setobject.h 2011-09-16 19:12:16.343816559 -0400 -@@ -101,6 +101,8 @@ PyAPI_FUNC(PyObject *) PySet_Pop(PyObjec - PyAPI_FUNC(int) _PySet_Update(PyObject *set, PyObject *iterable); - #endif - -+PyAPI_FUNC(void) _PySet_DebugMallocStats(FILE *out); -+ - #ifdef __cplusplus - } - #endif -diff -up Python-3.2.2/Include/tupleobject.h.add-debug-malloc-stats Python-3.2.2/Include/tupleobject.h ---- Python-3.2.2/Include/tupleobject.h.add-debug-malloc-stats 2011-09-16 19:10:45.540817425 -0400 -+++ Python-3.2.2/Include/tupleobject.h 2011-09-16 19:12:41.446816320 -0400 -@@ -63,6 +63,7 @@ PyAPI_FUNC(void) _PyTuple_MaybeUntrack(P - #endif - - PyAPI_FUNC(int) PyTuple_ClearFreeList(void); -+PyAPI_FUNC(void) _PyTuple_DebugMallocStats(FILE *out); - - #ifdef __cplusplus - } -diff -up Python-3.2.2/Include/unicodeobject.h.add-debug-malloc-stats Python-3.2.2/Include/unicodeobject.h ---- Python-3.2.2/Include/unicodeobject.h.add-debug-malloc-stats 2011-09-03 12:16:40.000000000 -0400 -+++ Python-3.2.2/Include/unicodeobject.h 2011-09-16 18:57:24.973825060 -0400 -@@ -1670,6 +1670,8 @@ PyAPI_FUNC(Py_UNICODE*) PyUnicode_AsUnic - ); - #endif /* Py_LIMITED_API */ - -+PyAPI_FUNC(void) _PyUnicode_DebugMallocStats(FILE *out); -+ - #ifdef __cplusplus - } - #endif -diff -up Python-3.2.2/Lib/test/test_sys.py.add-debug-malloc-stats Python-3.2.2/Lib/test/test_sys.py ---- Python-3.2.2/Lib/test/test_sys.py.add-debug-malloc-stats 2011-09-16 18:57:24.940825060 -0400 -+++ Python-3.2.2/Lib/test/test_sys.py 2011-09-16 19:23:50.415809940 -0400 -@@ -564,6 +564,18 @@ class SysModuleTest(unittest.TestCase): - expected = None - self.check_fsencoding(fs_encoding, expected) - -+ def test_debugmallocstats(self): -+ # Test sys._debugmallocstats() -+ -+ import subprocess -+ -+ # Verify writing to stderr: -+ p = subprocess.Popen([sys.executable, -+ '-c', 'import sys; sys._debugmallocstats()'], -+ stderr=subprocess.PIPE) -+ out, err = p.communicate() -+ p.wait() -+ self.assertIn(b"arenas allocated current", err) - - class SizeofTest(unittest.TestCase): - -diff -up Python-3.2.2/Objects/classobject.c.add-debug-malloc-stats Python-3.2.2/Objects/classobject.c ---- Python-3.2.2/Objects/classobject.c.add-debug-malloc-stats 2011-09-03 12:16:47.000000000 -0400 -+++ Python-3.2.2/Objects/classobject.c 2011-09-16 18:57:24.975825060 -0400 -@@ -399,6 +399,15 @@ 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)); -+} -+ - /* ------------------------------------------------------------------------ - * instance method - */ -diff -up Python-3.2.2/Objects/dictobject.c.add-debug-malloc-stats Python-3.2.2/Objects/dictobject.c ---- Python-3.2.2/Objects/dictobject.c.add-debug-malloc-stats 2011-09-03 12:16:47.000000000 -0400 -+++ Python-3.2.2/Objects/dictobject.c 2011-09-16 18:57:24.976825060 -0400 -@@ -217,6 +217,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-3.2.2/Objects/floatobject.c.add-debug-malloc-stats Python-3.2.2/Objects/floatobject.c ---- Python-3.2.2/Objects/floatobject.c.add-debug-malloc-stats 2011-09-03 12:16:47.000000000 -0400 -+++ Python-3.2.2/Objects/floatobject.c 2011-09-16 18:57:24.981825060 -0400 -@@ -50,6 +50,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-3.2.2/Objects/frameobject.c.add-debug-malloc-stats Python-3.2.2/Objects/frameobject.c ---- Python-3.2.2/Objects/frameobject.c.add-debug-malloc-stats 2011-09-03 12:16:47.000000000 -0400 -+++ Python-3.2.2/Objects/frameobject.c 2011-09-16 18:57:24.982825060 -0400 -@@ -953,3 +953,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-3.2.2/Objects/listobject.c.add-debug-malloc-stats Python-3.2.2/Objects/listobject.c ---- Python-3.2.2/Objects/listobject.c.add-debug-malloc-stats 2011-09-03 12:16:47.000000000 -0400 -+++ Python-3.2.2/Objects/listobject.c 2011-09-16 18:57:24.983825060 -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-3.2.2/Objects/methodobject.c.add-debug-malloc-stats Python-3.2.2/Objects/methodobject.c ---- Python-3.2.2/Objects/methodobject.c.add-debug-malloc-stats 2011-09-03 12:16:47.000000000 -0400 -+++ Python-3.2.2/Objects/methodobject.c 2011-09-16 18:57:24.983825060 -0400 -@@ -303,6 +303,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-3.2.2/Objects/object.c.add-debug-malloc-stats Python-3.2.2/Objects/object.c ---- Python-3.2.2/Objects/object.c.add-debug-malloc-stats 2011-09-03 12:16:47.000000000 -0400 -+++ Python-3.2.2/Objects/object.c 2011-09-16 19:04:20.351821098 -0400 -@@ -1781,6 +1781,19 @@ PyMem_Free(void *p) - PyMem_FREE(p); - } - -+void -+_PyObject_DebugTypeStats(FILE *out) -+{ -+ _PyCFunction_DebugMallocStats(out); -+ _PyDict_DebugMallocStats(out); -+ _PyFloat_DebugMallocStats(out); -+ _PyFrame_DebugMallocStats(out); -+ _PyList_DebugMallocStats(out); -+ _PyMethod_DebugMallocStats(out); -+ _PySet_DebugMallocStats(out); -+ _PyTuple_DebugMallocStats(out); -+ _PyUnicode_DebugMallocStats(out); -+} - - /* These methods are used to control infinite recursion in repr, str, print, - etc. Container objects that may recursively contain themselves, -diff -up Python-3.2.2/Objects/obmalloc.c.add-debug-malloc-stats Python-3.2.2/Objects/obmalloc.c ---- Python-3.2.2/Objects/obmalloc.c.add-debug-malloc-stats 2011-09-03 12:16:47.000000000 -0400 -+++ Python-3.2.2/Objects/obmalloc.c 2011-09-16 18:57:24.985825060 -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) -@@ -1820,10 +1833,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]; -@@ -1834,7 +1847,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", -@@ -1844,36 +1857,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-3.2.2/Objects/setobject.c.add-debug-malloc-stats Python-3.2.2/Objects/setobject.c ---- Python-3.2.2/Objects/setobject.c.add-debug-malloc-stats 2011-09-03 12:16:47.000000000 -0400 -+++ Python-3.2.2/Objects/setobject.c 2011-09-16 18:57:24.986825060 -0400 -@@ -1090,6 +1090,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-3.2.2/Objects/tupleobject.c.add-debug-malloc-stats Python-3.2.2/Objects/tupleobject.c ---- Python-3.2.2/Objects/tupleobject.c.add-debug-malloc-stats 2011-09-03 12:16:47.000000000 -0400 -+++ Python-3.2.2/Objects/tupleobject.c 2011-09-16 18:57:24.987825060 -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-3.2.2/Objects/unicodeobject.c.add-debug-malloc-stats Python-3.2.2/Objects/unicodeobject.c ---- Python-3.2.2/Objects/unicodeobject.c.add-debug-malloc-stats 2011-09-03 12:16:47.000000000 -0400 -+++ Python-3.2.2/Objects/unicodeobject.c 2011-09-16 18:57:24.990825060 -0400 -@@ -10063,6 +10063,12 @@ _PyUnicode_Fini(void) - (void)PyUnicode_ClearFreeList(); - } - -+void _PyUnicode_DebugMallocStats(FILE *out) -+{ -+ _PyDebugAllocatorStats(out, "free PyUnicodeObject", numfree, -+ sizeof(PyUnicodeObject)); -+} -+ - void - PyUnicode_InternInPlace(PyObject **p) - { -diff -up Python-3.2.2/Python/pythonrun.c.add-debug-malloc-stats Python-3.2.2/Python/pythonrun.c ---- Python-3.2.2/Python/pythonrun.c.add-debug-malloc-stats 2011-09-16 19:24:44.747809422 -0400 -+++ Python-3.2.2/Python/pythonrun.c 2011-09-16 19:25:00.024809277 -0400 -@@ -547,7 +547,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-3.2.2/Python/sysmodule.c.add-debug-malloc-stats Python-3.2.2/Python/sysmodule.c ---- Python-3.2.2/Python/sysmodule.c.add-debug-malloc-stats 2011-09-03 12:16:49.000000000 -0400 -+++ Python-3.2.2/Python/sysmodule.c 2011-09-16 19:18:45.806812845 -0400 -@@ -994,6 +994,25 @@ a 11-tuple where the entries in the tupl - extern "C" { - #endif - -+static PyObject * -+sys_debugmallocstats(PyObject *self, PyObject *args) -+{ -+ _PyObject_DebugMallocStats(stderr); -+ fputc('\n', stderr); -+ _PyObject_DebugTypeStats(stderr); -+ -+ Py_RETURN_NONE; -+} -+PyDoc_STRVAR(debugmallocstats_doc, -+"_debugmallocstats([file])\n\ -+\n\ -+Print summary info to 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 *); -@@ -1090,6 +1109,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/00157-uid-gid-overflows.patch b/00157-uid-gid-overflows.patch index 6be557d..ab4cb0c 100644 --- a/00157-uid-gid-overflows.patch +++ b/00157-uid-gid-overflows.patch @@ -1,6 +1,6 @@ -diff -up Python-3.2.3/Include/modsupport.h.uid-gid-overflows Python-3.2.3/Include/modsupport.h ---- Python-3.2.3/Include/modsupport.h.uid-gid-overflows 2012-04-11 02:54:01.000000000 -0400 -+++ Python-3.2.3/Include/modsupport.h 2012-06-18 17:20:38.193527374 -0400 +diff -up Python-3.3.0b1/Include/modsupport.h.uid-gid-overflows Python-3.3.0b1/Include/modsupport.h +--- Python-3.3.0b1/Include/modsupport.h.uid-gid-overflows 2012-06-26 16:19:40.000000000 -0400 ++++ Python-3.3.0b1/Include/modsupport.h 2012-07-20 14:21:46.854688763 -0400 @@ -8,6 +8,7 @@ extern "C" { /* Module support interface */ @@ -9,7 +9,7 @@ diff -up Python-3.2.3/Include/modsupport.h.uid-gid-overflows Python-3.2.3/Includ /* If PY_SSIZE_T_CLEAN is defined, each functions treats #-specifier to mean Py_ssize_t */ -@@ -122,6 +123,17 @@ PyAPI_FUNC(PyObject *) PyModule_Create2( +@@ -125,6 +126,17 @@ PyAPI_FUNC(PyObject *) PyModule_Create2( PyAPI_DATA(char *) _Py_PackageContext; #endif @@ -27,10 +27,10 @@ diff -up Python-3.2.3/Include/modsupport.h.uid-gid-overflows Python-3.2.3/Includ #ifdef __cplusplus } #endif -diff -up Python-3.2.3/Lib/test/test_os.py.uid-gid-overflows Python-3.2.3/Lib/test/test_os.py ---- Python-3.2.3/Lib/test/test_os.py.uid-gid-overflows 2012-04-11 02:54:05.000000000 -0400 -+++ Python-3.2.3/Lib/test/test_os.py 2012-06-18 17:20:18.360775320 -0400 -@@ -885,30 +885,36 @@ if sys.platform != 'win32': +diff -up Python-3.3.0b1/Lib/test/test_os.py.uid-gid-overflows Python-3.3.0b1/Lib/test/test_os.py +--- Python-3.3.0b1/Lib/test/test_os.py.uid-gid-overflows 2012-06-26 16:19:48.000000000 -0400 ++++ Python-3.3.0b1/Lib/test/test_os.py 2012-07-20 14:21:46.856688739 -0400 +@@ -1174,30 +1174,36 @@ if sys.platform != 'win32': def test_setuid(self): if os.getuid() != 0: self.assertRaises(os.error, os.setuid, 0) @@ -67,7 +67,7 @@ diff -up Python-3.2.3/Lib/test/test_os.py.uid-gid-overflows Python-3.2.3/Lib/tes self.assertRaises(OverflowError, os.setreuid, 1<<32, 0) self.assertRaises(OverflowError, os.setreuid, 0, 1<<32) -@@ -923,6 +929,8 @@ if sys.platform != 'win32': +@@ -1212,6 +1218,8 @@ if sys.platform != 'win32': def test_setregid(self): if os.getuid() != 0: self.assertRaises(os.error, os.setregid, 0, 0) @@ -76,20 +76,16 @@ diff -up Python-3.2.3/Lib/test/test_os.py.uid-gid-overflows Python-3.2.3/Lib/tes self.assertRaises(OverflowError, os.setregid, 1<<32, 0) self.assertRaises(OverflowError, os.setregid, 0, 1<<32) -diff -up Python-3.2.3/Lib/test/test_posix.py.uid-gid-overflows Python-3.2.3/Lib/test/test_posix.py ---- Python-3.2.3/Lib/test/test_posix.py.uid-gid-overflows 2012-04-11 02:54:05.000000000 -0400 -+++ Python-3.2.3/Lib/test/test_posix.py 2012-06-18 17:20:18.360775320 -0400 -@@ -227,7 +227,7 @@ class PosixTester(unittest.TestCase): +diff -up Python-3.3.0b1/Lib/test/test_posix.py.uid-gid-overflows Python-3.3.0b1/Lib/test/test_posix.py +--- Python-3.3.0b1/Lib/test/test_posix.py.uid-gid-overflows 2012-06-26 16:19:48.000000000 -0400 ++++ Python-3.3.0b1/Lib/test/test_posix.py 2012-07-20 14:21:46.857688726 -0400 +@@ -387,10 +387,17 @@ class PosixTester(unittest.TestCase): else: self.assertTrue(stat.S_ISFIFO(posix.stat(support.TESTFN).st_mode)) - 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: -@@ -246,6 +246,13 @@ class PosixTester(unittest.TestCase): - first_param, 0, 0) # test a successful chown call chown_func(first_param, os.getuid(), os.getgid()) + self.assertEqual(stat_func(first_param).st_uid, os.getuid()) @@ -100,18 +96,18 @@ diff -up Python-3.2.3/Lib/test/test_posix.py.uid-gid-overflows Python-3.2.3/Lib/ + 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): -@@ -255,7 +262,7 @@ class PosixTester(unittest.TestCase): + if os.getuid() == 0: + try: +@@ -421,7 +428,7 @@ class PosixTester(unittest.TestCase): # re-create the file - open(support.TESTFN, 'w').close() + support.create_empty_file(support.TESTFN) - self._test_all_chown_common(posix.chown, support.TESTFN) + self._test_all_chown_common(posix.chown, posix.stat, support.TESTFN) @unittest.skipUnless(hasattr(posix, 'fchown'), "test needs os.fchown()") def test_fchown(self): -@@ -265,7 +272,7 @@ class PosixTester(unittest.TestCase): +@@ -431,7 +438,7 @@ class PosixTester(unittest.TestCase): test_file = open(support.TESTFN, 'w') try: fd = test_file.fileno() @@ -120,7 +116,7 @@ diff -up Python-3.2.3/Lib/test/test_posix.py.uid-gid-overflows Python-3.2.3/Lib/ finally: test_file.close() -@@ -274,7 +281,7 @@ class PosixTester(unittest.TestCase): +@@ -440,7 +447,7 @@ class PosixTester(unittest.TestCase): os.unlink(support.TESTFN) # create a symlink os.symlink(_DUMMY_SYMLINK, support.TESTFN) @@ -129,9 +125,9 @@ diff -up Python-3.2.3/Lib/test/test_posix.py.uid-gid-overflows Python-3.2.3/Lib/ def test_chdir(self): if hasattr(posix, 'chdir'): -diff -up Python-3.2.3/Lib/test/test_pwd.py.uid-gid-overflows Python-3.2.3/Lib/test/test_pwd.py ---- Python-3.2.3/Lib/test/test_pwd.py.uid-gid-overflows 2012-04-11 02:54:05.000000000 -0400 -+++ Python-3.2.3/Lib/test/test_pwd.py 2012-06-18 17:20:18.360775320 -0400 +diff -up Python-3.3.0b1/Lib/test/test_pwd.py.uid-gid-overflows Python-3.3.0b1/Lib/test/test_pwd.py +--- Python-3.3.0b1/Lib/test/test_pwd.py.uid-gid-overflows 2012-06-26 16:19:48.000000000 -0400 ++++ Python-3.3.0b1/Lib/test/test_pwd.py 2012-07-20 14:21:46.857688726 -0400 @@ -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 @@ -144,9 +140,9 @@ diff -up Python-3.2.3/Lib/test/test_pwd.py.uid-gid-overflows Python-3.2.3/Lib/te self.assertNotIn(fakeuid, byuids) self.assertRaises(KeyError, pwd.getpwuid, fakeuid) -diff -up Python-3.2.3/Modules/grpmodule.c.uid-gid-overflows Python-3.2.3/Modules/grpmodule.c ---- Python-3.2.3/Modules/grpmodule.c.uid-gid-overflows 2012-04-11 02:54:07.000000000 -0400 -+++ Python-3.2.3/Modules/grpmodule.c 2012-06-18 17:20:18.361775307 -0400 +diff -up Python-3.3.0b1/Modules/grpmodule.c.uid-gid-overflows Python-3.3.0b1/Modules/grpmodule.c +--- Python-3.3.0b1/Modules/grpmodule.c.uid-gid-overflows 2012-06-26 16:19:54.000000000 -0400 ++++ Python-3.3.0b1/Modules/grpmodule.c 2012-07-20 14:21:46.858688713 -0400 @@ -69,7 +69,7 @@ mkgrent(struct group *p) Py_INCREF(Py_None); } @@ -181,10 +177,10 @@ diff -up Python-3.2.3/Modules/grpmodule.c.uid-gid-overflows Python-3.2.3/Modules return NULL; } return mkgrent(p); -diff -up Python-3.2.3/Modules/posixmodule.c.uid-gid-overflows Python-3.2.3/Modules/posixmodule.c ---- Python-3.2.3/Modules/posixmodule.c.uid-gid-overflows 2012-06-18 17:20:18.258776596 -0400 -+++ Python-3.2.3/Modules/posixmodule.c 2012-06-18 17:20:18.362775294 -0400 -@@ -1642,8 +1642,8 @@ _pystat_fromstructstat(STRUCT_STAT *st) +diff -up Python-3.3.0b1/Modules/posixmodule.c.uid-gid-overflows Python-3.3.0b1/Modules/posixmodule.c +--- Python-3.3.0b1/Modules/posixmodule.c.uid-gid-overflows 2012-07-20 14:21:46.788689588 -0400 ++++ Python-3.3.0b1/Modules/posixmodule.c 2012-07-20 14:24:19.626778849 -0400 +@@ -2151,8 +2151,8 @@ _pystat_fromstructstat(STRUCT_STAT *st) PyStructSequence_SET_ITEM(v, 2, PyLong_FromLong((long)st->st_dev)); #endif PyStructSequence_SET_ITEM(v, 3, PyLong_FromLong((long)st->st_nlink)); @@ -195,29 +191,37 @@ diff -up Python-3.2.3/Modules/posixmodule.c.uid-gid-overflows Python-3.2.3/Modul #ifdef HAVE_LARGEFILE_SUPPORT PyStructSequence_SET_ITEM(v, 6, PyLong_FromLongLong((PY_LONG_LONG)st->st_size)); -@@ -2172,15 +2172,17 @@ posix_chown(PyObject *self, PyObject *ar +@@ -2957,7 +2957,6 @@ static PyObject * + posix_chown(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject *opath; - char *path; -- long uid, gid; -+ uid_t uid; -+ gid_t gid; - int res; -- if (!PyArg_ParseTuple(args, "O&ll:chown", -+ if (!PyArg_ParseTuple(args, "O&O&O&:chown", - PyUnicode_FSConverter, &opath, -- &uid, &gid)) -+ _PyArg_ParseUid, &uid, -+ _PyArg_ParseGid, &gid)) - return NULL; - path = PyBytes_AsString(opath); + path_t path; +- long uid_l, gid_l; + uid_t uid; + gid_t gid; + int dir_fd = DEFAULT_DIR_FD; +@@ -2971,9 +2970,10 @@ posix_chown(PyObject *self, PyObject *ar + #ifdef HAVE_FCHOWN + path.allow_fd = 1; + #endif +- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&ll|$O&p:chown", keywords, ++ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&O&O&|$O&p:chown", keywords, + path_converter, &path, +- &uid_l, &gid_l, ++ _PyArg_ParseUid, &uid, ++ _PyArg_ParseGid, &gid, + #ifdef HAVE_FCHOWNAT + dir_fd_converter, &dir_fd, + #else +@@ -3004,8 +3004,6 @@ posix_chown(PyObject *self, PyObject *ar + #endif + 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(opath); -@@ -2200,12 +2202,15 @@ static PyObject * +- uid = (uid_t)uid_l; +- gid = (uid_t)gid_l; + #ifdef HAVE_FCHOWN + if (path.fd != -1) + result = fchown(path.fd, uid, gid); +@@ -3049,12 +3047,15 @@ static PyObject * posix_fchown(PyObject *self, PyObject *args) { int fd; @@ -236,7 +240,7 @@ diff -up Python-3.2.3/Modules/posixmodule.c.uid-gid-overflows Python-3.2.3/Modul Py_END_ALLOW_THREADS if (res < 0) return posix_error(); -@@ -2224,15 +2229,17 @@ posix_lchown(PyObject *self, PyObject *a +@@ -3074,15 +3075,17 @@ posix_lchown(PyObject *self, PyObject *a { PyObject *opath; char *path; @@ -258,7 +262,7 @@ diff -up Python-3.2.3/Modules/posixmodule.c.uid-gid-overflows Python-3.2.3/Modul Py_END_ALLOW_THREADS if (res < 0) return posix_error_with_allocated_filename(opath); -@@ -4287,7 +4294,7 @@ Return the current process's effective g +@@ -6184,7 +6187,7 @@ Return the current process's effective g static PyObject * posix_getegid(PyObject *self, PyObject *noargs) { @@ -267,7 +271,7 @@ diff -up Python-3.2.3/Modules/posixmodule.c.uid-gid-overflows Python-3.2.3/Modul } #endif -@@ -4300,7 +4307,7 @@ Return the current process's effective u +@@ -6197,7 +6200,7 @@ Return the current process's effective u static PyObject * posix_geteuid(PyObject *self, PyObject *noargs) { @@ -276,7 +280,7 @@ diff -up Python-3.2.3/Modules/posixmodule.c.uid-gid-overflows Python-3.2.3/Modul } #endif -@@ -4313,7 +4320,7 @@ Return the current process's group id.") +@@ -6210,7 +6213,7 @@ Return the current process's group id.") static PyObject * posix_getgid(PyObject *self, PyObject *noargs) { @@ -285,7 +289,7 @@ diff -up Python-3.2.3/Modules/posixmodule.c.uid-gid-overflows Python-3.2.3/Modul } #endif -@@ -4388,7 +4395,7 @@ posix_getgroups(PyObject *self, PyObject +@@ -6349,7 +6352,7 @@ posix_getgroups(PyObject *self, PyObject if (result != NULL) { int i; for (i = 0; i < n; ++i) { @@ -294,7 +298,7 @@ diff -up Python-3.2.3/Modules/posixmodule.c.uid-gid-overflows Python-3.2.3/Modul if (o == NULL) { Py_DECREF(result); result = NULL; -@@ -4419,14 +4426,15 @@ posix_initgroups(PyObject *self, PyObjec +@@ -6380,14 +6383,15 @@ posix_initgroups(PyObject *self, PyObjec PyObject *oname; char *username; int res; @@ -314,7 +318,7 @@ diff -up Python-3.2.3/Modules/posixmodule.c.uid-gid-overflows Python-3.2.3/Modul Py_DECREF(oname); if (res == -1) return PyErr_SetFromErrno(PyExc_OSError); -@@ -4601,7 +4609,7 @@ Return the current process's user id."); +@@ -6562,7 +6566,7 @@ Return the current process's user id."); static PyObject * posix_getuid(PyObject *self, PyObject *noargs) { @@ -323,7 +327,7 @@ diff -up Python-3.2.3/Modules/posixmodule.c.uid-gid-overflows Python-3.2.3/Modul } #endif -@@ -4741,15 +4749,9 @@ Set the current process's user id."); +@@ -6702,15 +6706,9 @@ Set the current process's user id."); static PyObject * posix_setuid(PyObject *self, PyObject *args) { @@ -340,24 +344,24 @@ diff -up Python-3.2.3/Modules/posixmodule.c.uid-gid-overflows Python-3.2.3/Modul if (setuid(uid) < 0) return posix_error(); Py_INCREF(Py_None); -@@ -4766,15 +4768,9 @@ Set the current process's effective user +@@ -6727,15 +6725,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)) -- return NULL; ++ 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"); -+ if (!PyArg_ParseTuple(args, "O&:seteuid", _PyArg_ParseUid, &euid)) - return NULL; +- return NULL; - } if (seteuid(euid) < 0) { return posix_error(); } else { -@@ -4792,15 +4788,9 @@ Set the current process's effective grou +@@ -6753,15 +6745,9 @@ Set the current process's effective grou static PyObject * posix_setegid (PyObject *self, PyObject *args) { @@ -374,7 +378,7 @@ diff -up Python-3.2.3/Modules/posixmodule.c.uid-gid-overflows Python-3.2.3/Modul if (setegid(egid) < 0) { return posix_error(); } else { -@@ -4818,23 +4808,11 @@ Set the current process's real and effec +@@ -6779,23 +6765,11 @@ Set the current process's real and effec static PyObject * posix_setreuid (PyObject *self, PyObject *args) { @@ -401,7 +405,7 @@ diff -up Python-3.2.3/Modules/posixmodule.c.uid-gid-overflows Python-3.2.3/Modul if (setreuid(ruid, euid) < 0) { return posix_error(); } else { -@@ -4852,23 +4830,11 @@ Set the current process's real and effec +@@ -6813,23 +6787,11 @@ Set the current process's real and effec static PyObject * posix_setregid (PyObject *self, PyObject *args) { @@ -428,7 +432,7 @@ diff -up Python-3.2.3/Modules/posixmodule.c.uid-gid-overflows Python-3.2.3/Modul if (setregid(rgid, egid) < 0) { return posix_error(); } else { -@@ -4886,15 +4852,9 @@ Set the current process's group id."); +@@ -6847,15 +6809,9 @@ Set the current process's group id."); static PyObject * posix_setgid(PyObject *self, PyObject *args) { @@ -445,7 +449,7 @@ diff -up Python-3.2.3/Modules/posixmodule.c.uid-gid-overflows Python-3.2.3/Modul if (setgid(gid) < 0) return posix_error(); Py_INCREF(Py_None); -@@ -4927,27 +4887,9 @@ posix_setgroups(PyObject *self, PyObject +@@ -6888,27 +6844,9 @@ posix_setgroups(PyObject *self, PyObject elem = PySequence_GetItem(groups, i); if (!elem) return NULL; @@ -474,7 +478,7 @@ diff -up Python-3.2.3/Modules/posixmodule.c.uid-gid-overflows Python-3.2.3/Modul } Py_DECREF(elem); } -@@ -7689,9 +7631,11 @@ Set the current process's real, effectiv +@@ -10388,9 +10326,11 @@ Set the current process's real, effectiv static PyObject* posix_setresuid (PyObject *self, PyObject *args) { @@ -489,7 +493,7 @@ diff -up Python-3.2.3/Modules/posixmodule.c.uid-gid-overflows Python-3.2.3/Modul return NULL; if (setresuid(ruid, euid, suid) < 0) return posix_error(); -@@ -7707,9 +7651,11 @@ Set the current process's real, effectiv +@@ -10406,9 +10346,11 @@ Set the current process's real, effectiv static PyObject* posix_setresgid (PyObject *self, PyObject *args) { @@ -504,7 +508,7 @@ diff -up Python-3.2.3/Modules/posixmodule.c.uid-gid-overflows Python-3.2.3/Modul return NULL; if (setresgid(rgid, egid, sgid) < 0) return posix_error(); -@@ -7726,14 +7672,13 @@ static PyObject* +@@ -10425,14 +10367,13 @@ static PyObject* posix_getresuid (PyObject *self, PyObject *noargs) { uid_t ruid, euid, suid; @@ -524,7 +528,7 @@ diff -up Python-3.2.3/Modules/posixmodule.c.uid-gid-overflows Python-3.2.3/Modul } #endif -@@ -7746,14 +7691,13 @@ static PyObject* +@@ -10445,14 +10386,13 @@ static PyObject* posix_getresgid (PyObject *self, PyObject *noargs) { uid_t rgid, egid, sgid; @@ -544,9 +548,9 @@ diff -up Python-3.2.3/Modules/posixmodule.c.uid-gid-overflows Python-3.2.3/Modul } #endif -diff -up Python-3.2.3/Modules/pwdmodule.c.uid-gid-overflows Python-3.2.3/Modules/pwdmodule.c ---- Python-3.2.3/Modules/pwdmodule.c.uid-gid-overflows 2012-04-11 02:54:07.000000000 -0400 -+++ Python-3.2.3/Modules/pwdmodule.c 2012-06-18 17:20:18.362775294 -0400 +diff -up Python-3.3.0b1/Modules/pwdmodule.c.uid-gid-overflows Python-3.3.0b1/Modules/pwdmodule.c +--- Python-3.3.0b1/Modules/pwdmodule.c.uid-gid-overflows 2012-06-26 16:19:54.000000000 -0400 ++++ Python-3.3.0b1/Modules/pwdmodule.c 2012-07-20 14:21:46.861688675 -0400 @@ -74,8 +74,8 @@ mkpwent(struct passwd *p) #else SETS(setIndex++, p->pw_passwd); @@ -576,9 +580,9 @@ diff -up Python-3.2.3/Modules/pwdmodule.c.uid-gid-overflows Python-3.2.3/Modules return NULL; } return mkpwent(p); -diff -up Python-3.2.3/Python/getargs.c.uid-gid-overflows Python-3.2.3/Python/getargs.c ---- Python-3.2.3/Python/getargs.c.uid-gid-overflows 2012-04-11 02:54:08.000000000 -0400 -+++ Python-3.2.3/Python/getargs.c 2012-06-18 17:20:18.363775282 -0400 +diff -up Python-3.3.0b1/Python/getargs.c.uid-gid-overflows Python-3.3.0b1/Python/getargs.c +--- Python-3.3.0b1/Python/getargs.c.uid-gid-overflows 2012-06-26 16:19:57.000000000 -0400 ++++ Python-3.3.0b1/Python/getargs.c 2012-07-20 14:21:46.861688675 -0400 @@ -4,6 +4,7 @@ #include "Python.h" @@ -587,7 +591,7 @@ diff -up Python-3.2.3/Python/getargs.c.uid-gid-overflows Python-3.2.3/Python/get #ifdef __cplusplus -@@ -1789,6 +1790,102 @@ _PyArg_NoKeywords(const char *funcname, +@@ -1807,6 +1808,102 @@ _PyArg_NoKeywords(const char *funcname, funcname); return 0; } diff --git a/05000-autotool-intermediates.patch b/05000-autotool-intermediates.patch index 4a265a0..6cddbf7 100644 --- a/05000-autotool-intermediates.patch +++ b/05000-autotool-intermediates.patch @@ -1,16 +1,184 @@ diff -up ./configure.autotool-intermediates ./configure ---- ./configure.autotool-intermediates 2011-07-11 11:50:06.910425999 -0400 -+++ ./configure 2011-07-11 11:50:13.492426001 -0400 -@@ -619,6 +619,8 @@ TRUE - MACHDEP_OBJS - DYNLOADFILE - DLINCLDIR -+DTRACEHDRS -+DTRACEOBJS - THREADOBJ - LDLAST - USE_THREAD_MODULE -@@ -764,8 +766,11 @@ with_thread +--- ./configure.autotool-intermediates 2012-07-20 14:09:54.811590526 -0400 ++++ ./configure 2012-07-20 14:10:00.525519093 -0400 +@@ -1,11 +1,13 @@ + #! /bin/sh + # Guess values for system-dependent variables and create Makefiles. +-# Generated by GNU Autoconf 2.69 for python 3.3. ++# Generated by GNU Autoconf 2.68 for python 3.3. + # + # Report bugs to . + # + # +-# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. ++# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, ++# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software ++# Foundation, Inc. + # + # + # This configure script is free software; the Free Software Foundation +@@ -134,31 +136,6 @@ export LANGUAGE + # CDPATH. + (unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +-# Use a proper internal environment variable to ensure we don't fall +- # into an infinite loop, continuously re-executing ourselves. +- if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then +- _as_can_reexec=no; export _as_can_reexec; +- # 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 +-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+"$@"} +-# Admittedly, this is quite paranoid, since all the known shells bail +-# out after a failed `exec'. +-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +-as_fn_exit 255 +- fi +- # We don't want this to propagate to other subprocesses. +- { _as_can_reexec=; unset _as_can_reexec;} + if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh +@@ -192,8 +169,7 @@ if ( set x; as_fn_ret_success y && test + else + exitcode=1; echo positional parameters were not saved. + fi +-test x\$exitcode = x0 || exit 1 +-test -x / || exit 1" ++test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && +@@ -238,25 +214,21 @@ IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : +- export CONFIG_SHELL +- # 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 +-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+"$@"} +-# Admittedly, this is quite paranoid, since all the known shells bail +-# out after a failed `exec'. +-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +-exit 255 ++ # 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 ++ 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 : +@@ -359,14 +331,6 @@ $as_echo X"$as_dir" | + + + } # as_fn_mkdir_p +- +-# as_fn_executable_p FILE +-# ----------------------- +-# Test if FILE is an executable regular file. +-as_fn_executable_p () +-{ +- test -f "$1" && test -x "$1" +-} # as_fn_executable_p + # as_fn_append VAR VALUE + # ---------------------- + # Append the text in VALUE to the end of the definition contained in VAR. Take +@@ -488,10 +452,6 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + +- # If we had to re-execute with $CONFIG_SHELL, we're ensured to have +- # already done that, so ensure we don't try to do so again and fall +- # in an infinite loop. This has already happened in practice. +- _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). +@@ -526,16 +486,16 @@ if (echo >conf$$.file) 2>/dev/null; then + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. +- # In both cases, we have to default to `cp -pR'. ++ # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || +- as_ln_s='cp -pR' ++ as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else +- as_ln_s='cp -pR' ++ as_ln_s='cp -p' + fi + else +- as_ln_s='cp -pR' ++ as_ln_s='cp -p' + fi + rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file + rmdir conf$$.dir 2>/dev/null +@@ -547,8 +507,28 @@ else + as_mkdir_p=false + fi + +-as_test_x='test -x' +-as_executable_p=as_fn_executable_p ++if test -x / >/dev/null 2>&1; then ++ as_test_x='test -x' ++else ++ if ls -dL / >/dev/null 2>&1; then ++ as_ls_L_option=L ++ else ++ as_ls_L_option= ++ fi ++ as_test_x=' ++ eval sh -c '\'' ++ if test -d "$1"; then ++ test -d "$1/."; ++ else ++ case $1 in #( ++ -*)set "./$1";; ++ esac; ++ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ++ ???[sx]*):;;*)false;;esac;fi ++ '\'' sh ++ ' ++fi ++as_executable_p=$as_test_x + + # Sed expression to map a string onto a valid CPP name. + as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +@@ -793,6 +773,8 @@ with_thread enable_ipv6 with_doc_strings with_tsc @@ -18,21 +186,17 @@ diff -up ./configure.autotool-intermediates ./configure +with_call_profile with_pymalloc with_valgrind -+with_dtrace - with_fpectl - with_libm - with_libc -@@ -781,7 +786,8 @@ CFLAGS - LDFLAGS - LIBS - CPPFLAGS --CPP' -+CPP -+CPPFLAGS' - - - # Initialize some variables set by options. -@@ -1437,8 +1443,11 @@ Optional Packages: + with_systemtap +@@ -1266,6 +1248,8 @@ target=$target_alias + if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe ++ $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. ++ If a cross compiler is detected then cross compile mode will be used" >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +@@ -1469,6 +1453,8 @@ Optional Packages: deprecated; use --with(out)-threads --with(out)-doc-strings disable/enable documentation strings --with(out)-tsc enable/disable timestamp counter profile @@ -40,11 +204,328 @@ diff -up ./configure.autotool-intermediates ./configure + --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-fpectl enable SIGFPE catching - --with-libm=STRING math library - --with-libc=STRING C library -@@ -9284,6 +9293,50 @@ $as_echo "no" >&6; } + --with(out)-systemtap disable/enable SystemTap support +@@ -1556,9 +1542,9 @@ test -n "$ac_init_help" && exit $ac_stat + if $ac_init_version; then + cat <<\_ACEOF + python configure 3.3 +-generated by GNU Autoconf 2.69 ++generated by GNU Autoconf 2.68 + +-Copyright (C) 2012 Free Software Foundation, Inc. ++Copyright (C) 2010 Free Software Foundation, Inc. + This configure script is free software; the Free Software Foundation + gives unlimited permission to copy, distribute and modify it. + _ACEOF +@@ -1634,7 +1620,7 @@ $as_echo "$ac_try_echo"; } >&5 + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || +- test -x conftest$ac_exeext ++ $as_test_x conftest$ac_exeext + }; then : + ac_retval=0 + else +@@ -1932,8 +1918,7 @@ int + main () + { + static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; +-test_array [0] = 0; +-return test_array [0]; ++test_array [0] = 0 + + ; + return 0; +@@ -1987,8 +1972,7 @@ int + main () + { + static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))]; +-test_array [0] = 0; +-return test_array [0]; ++test_array [0] = 0 + + ; + return 0; +@@ -2004,8 +1988,7 @@ main () + { + static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) + < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))]; +-test_array [0] = 0; +-return test_array [0]; ++test_array [0] = 0 + + ; + return 0; +@@ -2055,8 +2038,7 @@ int + main () + { + static int test_array [1 - 2 * !(($2) >= 0)]; +-test_array [0] = 0; +-return test_array [0]; ++test_array [0] = 0 + + ; + return 0; +@@ -2072,8 +2054,7 @@ int + main () + { + static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +-test_array [0] = 0; +-return test_array [0]; ++test_array [0] = 0 + + ; + return 0; +@@ -2099,8 +2080,7 @@ int + main () + { + static int test_array [1 - 2 * !(($2) < 0)]; +-test_array [0] = 0; +-return test_array [0]; ++test_array [0] = 0 + + ; + return 0; +@@ -2116,8 +2096,7 @@ int + main () + { + static int test_array [1 - 2 * !(($2) >= $ac_mid)]; +-test_array [0] = 0; +-return test_array [0]; ++test_array [0] = 0 + + ; + return 0; +@@ -2151,8 +2130,7 @@ int + main () + { + static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +-test_array [0] = 0; +-return test_array [0]; ++test_array [0] = 0 + + ; + return 0; +@@ -2395,7 +2373,7 @@ This file contains any messages produced + running configure, to aid debugging if configure makes a mistake. + + It was created by python $as_me 3.3, which was +-generated by GNU Autoconf 2.69. Invocation command line was ++generated by GNU Autoconf 2.68. Invocation command line was + + $ $0 $@ + +@@ -2765,7 +2743,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_HAS_HG="found" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -3508,7 +3486,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -3548,7 +3526,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -3601,7 +3579,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -3642,7 +3620,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue +@@ -3700,7 +3678,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -3744,7 +3722,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -4190,7 +4168,8 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ + /* end confdefs.h. */ + #include + #include +-struct stat; ++#include ++#include + /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ + struct buf { int x; }; + FILE * (*rcsopen) (struct buf *, struct stat *, int); +@@ -4329,7 +4308,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_CXX="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -4370,7 +4349,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_CXX="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -4411,7 +4390,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_CXX="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -4460,7 +4439,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -4691,7 +4670,7 @@ do + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" +- as_fn_executable_p "$ac_path_GREP" || continue ++ { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP + case `"$ac_path_GREP" --version 2>&1` in +@@ -4757,7 +4736,7 @@ do + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" +- as_fn_executable_p "$ac_path_EGREP" || continue ++ { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP + case `"$ac_path_EGREP" --version 2>&1` in +@@ -4964,8 +4943,8 @@ else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +-# define __EXTENSIONS__ 1 +- $ac_includes_default ++# define __EXTENSIONS__ 1 ++ $ac_includes_default + int + main () + { +@@ -5359,7 +5338,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -5399,7 +5378,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -5453,7 +5432,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -5504,7 +5483,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_HAS_PYTHON="found" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -5577,7 +5556,7 @@ case $as_dir/ in #(( + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then ++ if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. +@@ -5646,7 +5625,7 @@ do + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do +- as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue ++ { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ +@@ -8538,7 +8517,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -8581,7 +8560,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -9591,6 +9570,50 @@ $as_echo "no" >&6; } fi @@ -95,72 +576,155 @@ 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; } -@@ -9336,6 +9389,46 @@ fi - OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT" +@@ -10208,7 +10231,7 @@ do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_TRUE="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 +@@ -11645,8 +11668,7 @@ int + main () + { + static int test_array [1 - 2 * !(((char) -1) < 0)]; +-test_array [0] = 0; +-return test_array [0]; ++test_array [0] = 0 + + ; + return 0; +@@ -11677,11 +11699,11 @@ else + int + main () + { +- ++/* FIXME: Include the comments suggested by Paul. */ + #ifndef __cplusplus +- /* Ultrix mips cc rejects this sort of thing. */ ++ /* Ultrix mips cc rejects this. */ + typedef int charset[2]; +- const charset cs = { 0, 0 }; ++ const charset cs; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; +@@ -11698,9 +11720,8 @@ main () + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; +- { /* SCO 3.2v4 cc rejects this sort of thing. */ +- char tx; +- char *t = &tx; ++ { /* SCO 3.2v4 cc rejects this. */ ++ char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; +@@ -11716,10 +11737,10 @@ main () + iptr p = 0; + ++p; + } +- { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying ++ { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ +- struct s { int j; const int *ap[3]; } bx; +- struct s *b = &bx; b->j = 5; ++ struct s { int j; const int *ap[3]; }; ++ struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; +@@ -15008,16 +15029,16 @@ if (echo >conf$$.file) 2>/dev/null; then + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. +- # In both cases, we have to default to `cp -pR'. ++ # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || +- as_ln_s='cp -pR' ++ as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else +- as_ln_s='cp -pR' ++ as_ln_s='cp -p' + fi + else +- as_ln_s='cp -pR' ++ as_ln_s='cp -p' + fi + rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file + rmdir conf$$.dir 2>/dev/null +@@ -15077,16 +15098,28 @@ else + as_mkdir_p=false 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; } -+ -+ -+ - # -I${DLINCLDIR} is added to the compile rule for importdl.o - - DLINCLDIR=. -diff -up ./pyconfig.h.in.autotool-intermediates ./pyconfig.h.in ---- ./pyconfig.h.in.autotool-intermediates 2011-07-11 11:50:06.896426002 -0400 -+++ ./pyconfig.h.in 2011-07-11 11:50:13.965426001 -0400 -@@ -12,15 +12,15 @@ - support for AIX C++ shared extension modules. */ - #undef AIX_GENUINE_CPLUSPLUS - --/* Define if you have the Mach cthreads package */ --#undef C_THREADS - - /* Define to keep records on function call invocation */ - #undef CALL_PROFILE +-# as_fn_executable_p FILE +-# ----------------------- +-# Test if FILE is an executable regular file. +-as_fn_executable_p () +-{ +- test -f "$1" && test -x "$1" +-} # as_fn_executable_p +-as_test_x='test -x' +-as_executable_p=as_fn_executable_p ++if test -x / >/dev/null 2>&1; then ++ as_test_x='test -x' ++else ++ if ls -dL / >/dev/null 2>&1; then ++ as_ls_L_option=L ++ else ++ as_ls_L_option= ++ fi ++ as_test_x=' ++ eval sh -c '\'' ++ if test -d "$1"; then ++ test -d "$1/."; ++ else ++ case $1 in #( ++ -*)set "./$1";; ++ esac; ++ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ++ ???[sx]*):;;*)false;;esac;fi ++ '\'' sh ++ ' ++fi ++as_executable_p=$as_test_x - /* Define to keep records of the number of instances of each type */ - #undef COUNT_ALLOCS + # Sed expression to map a string onto a valid CPP name. + as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +@@ -15108,7 +15141,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri + # values after options handling. + ac_log=" + This file was extended by python $as_me 3.3, which was +-generated by GNU Autoconf 2.69. Invocation command line was ++generated by GNU Autoconf 2.68. Invocation command line was -+/* Define if you have the Mach cthreads package */ -+#undef C_THREADS -+ - /* Define if C doubles are 64-bit IEEE 754 binary format, stored in ARM - mixed-endian order (byte order 45670123) */ - #undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS +@@ -15170,10 +15203,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_writ + ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" + ac_cs_version="\\ + python config.status 3.3 +-configured by $0, generated by GNU Autoconf 2.69, ++configured by $0, generated by GNU Autoconf 2.68, + with options \\"\$ac_cs_config\\" + +-Copyright (C) 2012 Free Software Foundation, Inc. ++Copyright (C) 2010 Free Software Foundation, Inc. + This config.status script is free software; the Free Software Foundation + gives unlimited permission to copy, distribute and modify it." + +@@ -15263,7 +15296,7 @@ fi + _ACEOF + cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + if \$ac_cs_recheck; then +- set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion ++ set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' +diff -up ./pyconfig.h.in.autotool-intermediates ./pyconfig.h.in diff --git a/python-3.2.3-lib64.patch b/python-3.3.0b1-lib64.patch similarity index 73% rename from python-3.2.3-lib64.patch rename to python-3.3.0b1-lib64.patch index 5c3cf13..110ed0d 100644 --- a/python-3.2.3-lib64.patch +++ b/python-3.3.0b1-lib64.patch @@ -1,6 +1,6 @@ -diff -up Python-3.2.3/Lib/distutils/command/install.py.lib64 Python-3.2.3/Lib/distutils/command/install.py ---- Python-3.2.3/Lib/distutils/command/install.py.lib64 2012-04-11 02:54:02.000000000 -0400 -+++ Python-3.2.3/Lib/distutils/command/install.py 2012-04-11 19:01:19.727107020 -0400 +diff -up Python-3.3.0b1/Lib/distutils/command/install.py.lib64 Python-3.3.0b1/Lib/distutils/command/install.py +--- Python-3.3.0b1/Lib/distutils/command/install.py.lib64 2012-06-26 16:19:41.000000000 -0400 ++++ Python-3.3.0b1/Lib/distutils/command/install.py 2012-07-20 13:09:38.760797382 -0400 @@ -45,14 +45,14 @@ else: INSTALL_SCHEMES = { 'unix_prefix': { @@ -18,11 +18,11 @@ diff -up Python-3.2.3/Lib/distutils/command/install.py.lib64 Python-3.2.3/Lib/di 'headers': '$base/include/python/$dist_name', 'scripts': '$base/bin', 'data' : '$base', -diff -up Python-3.2.3/Lib/distutils/sysconfig.py.lib64 Python-3.2.3/Lib/distutils/sysconfig.py ---- Python-3.2.3/Lib/distutils/sysconfig.py.lib64 2012-04-11 02:54:02.000000000 -0400 -+++ Python-3.2.3/Lib/distutils/sysconfig.py 2012-04-11 19:01:19.727107020 -0400 -@@ -122,8 +122,12 @@ def get_python_lib(plat_specific=0, stan - prefix = plat_specific and EXEC_PREFIX or PREFIX +diff -up Python-3.3.0b1/Lib/distutils/sysconfig.py.lib64 Python-3.3.0b1/Lib/distutils/sysconfig.py +--- Python-3.3.0b1/Lib/distutils/sysconfig.py.lib64 2012-06-26 16:19:41.000000000 -0400 ++++ Python-3.3.0b1/Lib/distutils/sysconfig.py 2012-07-20 13:12:48.017431348 -0400 +@@ -138,8 +138,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: @@ -35,10 +35,10 @@ diff -up Python-3.2.3/Lib/distutils/sysconfig.py.lib64 Python-3.2.3/Lib/distutil if standard_lib: return libpython else: -diff -up Python-3.2.3/Lib/site.py.lib64 Python-3.2.3/Lib/site.py ---- Python-3.2.3/Lib/site.py.lib64 2012-04-11 02:54:03.000000000 -0400 -+++ Python-3.2.3/Lib/site.py 2012-04-11 19:01:19.728107008 -0400 -@@ -285,12 +285,16 @@ def getsitepackages(): +diff -up Python-3.3.0b1/Lib/site.py.lib64 Python-3.3.0b1/Lib/site.py +--- Python-3.3.0b1/Lib/site.py.lib64 2012-06-26 16:19:45.000000000 -0400 ++++ Python-3.3.0b1/Lib/site.py 2012-07-20 13:09:38.762797357 -0400 +@@ -303,12 +303,16 @@ def getsitepackages(prefixes=None): if sys.platform in ('os2emx', 'riscos'): sitepackages.append(os.path.join(prefix, "Lib", "site-packages")) elif os.sep == '/': @@ -55,25 +55,25 @@ diff -up Python-3.2.3/Lib/site.py.lib64 Python-3.2.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-3.2.3/Lib/sysconfig.py.lib64 Python-3.2.3/Lib/sysconfig.py ---- Python-3.2.3/Lib/sysconfig.py.lib64 2012-04-11 02:54:03.000000000 -0400 -+++ Python-3.2.3/Lib/sysconfig.py 2012-04-11 19:01:19.728107008 -0400 +diff -up Python-3.3.0b1/Lib/sysconfig.py.lib64 Python-3.3.0b1/Lib/sysconfig.py +--- Python-3.3.0b1/Lib/sysconfig.py.lib64 2012-06-26 16:19:45.000000000 -0400 ++++ Python-3.3.0b1/Lib/sysconfig.py 2012-07-20 13:14:59.721784816 -0400 @@ -21,10 +21,10 @@ __all__ = [ _INSTALL_SCHEMES = { 'posix_prefix': { -- 'stdlib': '{base}/lib/python{py_version_short}', +- 'stdlib': '{installed_base}/lib/python{py_version_short}', - 'platstdlib': '{platbase}/lib/python{py_version_short}', -+ 'stdlib': '{base}/lib64/python{py_version_short}', ++ 'stdlib': '{installed_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}{abiflags}', + '{installed_base}/include/python{py_version_short}{abiflags}', 'platinclude': @@ -81,10 +81,10 @@ _INSTALL_SCHEMES = { - 'data' : '{userbase}', + 'data': '{userbase}', }, 'posix_user': { - 'stdlib': '{userbase}/lib/python{py_version_short}', @@ -85,11 +85,11 @@ diff -up Python-3.2.3/Lib/sysconfig.py.lib64 Python-3.2.3/Lib/sysconfig.py + 'platlib': '{userbase}/lib64/python{py_version_short}/site-packages', 'include': '{userbase}/include/python{py_version_short}', 'scripts': '{userbase}/bin', - 'data' : '{userbase}', -diff -up Python-3.2.3/Lib/test/test_site.py.lib64 Python-3.2.3/Lib/test/test_site.py ---- Python-3.2.3/Lib/test/test_site.py.lib64 2012-04-11 02:54:05.000000000 -0400 -+++ Python-3.2.3/Lib/test/test_site.py 2012-04-11 19:02:01.413585869 -0400 -@@ -236,12 +236,15 @@ class HelperFunctionsTests(unittest.Test + 'data': '{userbase}', +diff -up Python-3.3.0b1/Lib/test/test_site.py.lib64 Python-3.3.0b1/Lib/test/test_site.py +--- Python-3.3.0b1/Lib/test/test_site.py.lib64 2012-06-26 16:19:48.000000000 -0400 ++++ Python-3.3.0b1/Lib/test/test_site.py 2012-07-20 13:09:38.764797333 -0400 +@@ -239,12 +239,15 @@ class HelperFunctionsTests(unittest.Test self.assertEqual(dirs[2], wanted) elif os.sep == '/': # OS X non-framwework builds, Linux, FreeBSD, etc @@ -108,10 +108,10 @@ diff -up Python-3.2.3/Lib/test/test_site.py.lib64 Python-3.2.3/Lib/test/test_sit else: # other platforms self.assertEqual(len(dirs), 2) -diff -up Python-3.2.3/Makefile.pre.in.lib64 Python-3.2.3/Makefile.pre.in ---- Python-3.2.3/Makefile.pre.in.lib64 2012-04-11 19:01:19.722107084 -0400 -+++ Python-3.2.3/Makefile.pre.in 2012-04-11 19:01:19.729106996 -0400 -@@ -106,7 +106,7 @@ LIBDIR= @libdir@ +diff -up Python-3.3.0b1/Makefile.pre.in.lib64 Python-3.3.0b1/Makefile.pre.in +--- Python-3.3.0b1/Makefile.pre.in.lib64 2012-07-20 13:09:38.742797608 -0400 ++++ Python-3.3.0b1/Makefile.pre.in 2012-07-20 13:09:38.765797321 -0400 +@@ -107,7 +107,7 @@ LIBDIR= @libdir@ MANDIR= @mandir@ INCLUDEDIR= @includedir@ CONFINCLUDEDIR= $(exec_prefix)/include @@ -120,9 +120,9 @@ diff -up Python-3.2.3/Makefile.pre.in.lib64 Python-3.2.3/Makefile.pre.in ABIFLAGS= @ABIFLAGS@ # Detailed destination directories -diff -up Python-3.2.3/Modules/getpath.c.lib64 Python-3.2.3/Modules/getpath.c ---- Python-3.2.3/Modules/getpath.c.lib64 2012-04-11 02:54:07.000000000 -0400 -+++ Python-3.2.3/Modules/getpath.c 2012-04-11 19:01:19.729106996 -0400 +diff -up Python-3.3.0b1/Modules/getpath.c.lib64 Python-3.3.0b1/Modules/getpath.c +--- Python-3.3.0b1/Modules/getpath.c.lib64 2012-06-26 16:19:54.000000000 -0400 ++++ Python-3.3.0b1/Modules/getpath.c 2012-07-20 13:09:38.766797308 -0400 @@ -122,8 +122,8 @@ #endif @@ -143,7 +143,7 @@ diff -up Python-3.2.3/Modules/getpath.c.lib64 Python-3.2.3/Modules/getpath.c static void reduce(wchar_t *dir) -@@ -583,7 +583,7 @@ calculate_path(void) +@@ -669,7 +669,7 @@ calculate_path(void) } else wcsncpy(zip_path, _prefix, MAXPATHLEN); @@ -152,7 +152,7 @@ diff -up Python-3.2.3/Modules/getpath.c.lib64 Python-3.2.3/Modules/getpath.c bufsz = wcslen(zip_path); /* Replace "00" with version */ zip_path[bufsz - 6] = VERSION[0]; zip_path[bufsz - 5] = VERSION[2]; -@@ -593,7 +593,7 @@ calculate_path(void) +@@ -679,7 +679,7 @@ calculate_path(void) fprintf(stderr, "Could not find platform dependent libraries \n"); wcsncpy(exec_prefix, _exec_prefix, MAXPATHLEN); @@ -161,10 +161,10 @@ diff -up Python-3.2.3/Modules/getpath.c.lib64 Python-3.2.3/Modules/getpath.c } /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */ -diff -up Python-3.2.3/setup.py.lib64 Python-3.2.3/setup.py ---- Python-3.2.3/setup.py.lib64 2012-04-11 02:54:08.000000000 -0400 -+++ Python-3.2.3/setup.py 2012-04-11 19:01:19.730106984 -0400 -@@ -396,7 +396,7 @@ class PyBuildExt(build_ext): +diff -up Python-3.3.0b1/setup.py.lib64 Python-3.3.0b1/setup.py +--- Python-3.3.0b1/setup.py.lib64 2012-06-26 16:19:58.000000000 -0400 ++++ Python-3.3.0b1/setup.py 2012-07-20 13:09:38.767797295 -0400 +@@ -393,7 +393,7 @@ class PyBuildExt(build_ext): # Ensure that /usr/local is always used, but the local build # directories (i.e. '.' and 'Include') must be first. See issue # 10520. @@ -173,7 +173,7 @@ diff -up Python-3.2.3/setup.py.lib64 Python-3.2.3/setup.py add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') self.add_multiarch_paths() -@@ -643,11 +643,11 @@ class PyBuildExt(build_ext): +@@ -652,11 +652,11 @@ class PyBuildExt(build_ext): elif curses_library: readline_libs.append(curses_library) elif self.compiler.find_library_file(lib_dirs + @@ -187,7 +187,7 @@ diff -up Python-3.2.3/setup.py.lib64 Python-3.2.3/setup.py extra_link_args=readline_extra_link_args, libraries=readline_libs) ) else: -@@ -684,8 +684,8 @@ class PyBuildExt(build_ext): +@@ -693,8 +693,8 @@ class PyBuildExt(build_ext): if krb5_h: ssl_incs += krb5_h ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, diff --git a/python3.spec b/python3.spec index fd1f504..5867aae 100644 --- a/python3.spec +++ b/python3.spec @@ -2,10 +2,11 @@ # Conditionals and other variables controlling the build # ====================================================== -%global pybasever 3.2 +%global pybasever 3.3 +%global alphatag b1 # pybasever without the dot: -%global pyshortver 32 +%global pyshortver 33 %global pylibdir %{_libdir}/python%{pybasever} %global dynload_dir %{pylibdir}/lib-dynload @@ -14,9 +15,13 @@ # for PEP 3149: # http://www.python.org/dev/peps/pep-3149/ +# ("configure.in" became "configure.ac" in Python 3.3 onwards, and in +# backports) + # ABIFLAGS, LDVERSION and SOABI are in the upstream Makefile -%global ABIFLAGS_optimized mu -%global ABIFLAGS_debug dmu +# With Python 3.3, we lose the "u" suffix due to PEP 393 +%global ABIFLAGS_optimized m +%global ABIFLAGS_debug dm %global LDVERSION_optimized %{pybasever}%{ABIFLAGS_optimized} %global LDVERSION_debug %{pybasever}%{ABIFLAGS_debug} @@ -31,9 +36,9 @@ # For example, # foo/bar.py # now has bytecode at: -# foo/__pycache__/bar.cpython-32.pyc -# foo/__pycache__/bar.cpython-32.pyo -%global bytecode_suffixes .cpython-32.py? +# foo/__pycache__/bar.cpython-33.pyc +# foo/__pycache__/bar.cpython-33.pyo +%global bytecode_suffixes .cpython-33.py? # Python's configure script defines SOVERSION, and this is used in the Makefile # to determine INSTSONAME, the name of the libpython DSO: @@ -121,8 +126,8 @@ # ================== Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 -Version: %{pybasever}.3 -Release: 10%{?dist} +Version: %{pybasever}.0 +Release: 0.1.%{alphatag}%{?dist} License: Python Group: Development/Languages @@ -182,7 +187,7 @@ BuildRequires: zlib-devel # Source code and patches # ======================= -Source: http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz +Source: http://www.python.org/ftp/python/%{version}/Python-%{version}%{alphatag}.tar.xz # Avoid having various bogus auto-generated Provides lines for the various # python c modules' SONAMEs: @@ -219,17 +224,14 @@ Patch1: Python-3.1.1-rpath.patch # The four TestMIMEAudio tests fail due to "audiotest.au" not being packaged. # It's simplest to remove them: -Patch3: python-3.2b2-remove-mimeaudio-tests.patch +Patch3: 00003-remove-mimeaudio-tests.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); ported to 3.1.1 by -# dmalcolm +# Patch sent upstream as http://bugs.python.org/issue14776 Patch55: 00055-systemtap.patch -Patch102: python-3.2.3-lib64.patch +Patch102: python-3.3.0b1-lib64.patch # 00104 # # Only used when "%{_lib}" == "lib64" @@ -387,9 +389,9 @@ 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 +# Upstream as of Python 3.3.0 +# Patch147: 00147-add-debug-malloc-stats.patch # 00148 # # Upstream as of Python 3.2.3: @@ -594,7 +596,7 @@ can load its own extensions. # ====================================================== %prep -%setup -q -n Python-%{version} +%setup -q -n Python-%{version}%{alphatag} chmod +x %{SOURCE1} %if 0%{?with_systemtap} @@ -671,7 +673,7 @@ done # 00144: not for python3 # 00145: not for python3 %patch146 -p1 -%patch147 -p1 +# 00147: upstream as of Python 3.3.0 # 00148: upstream as of Python 3.2.3 # 00149: upstream as of Python 3.2.3 %ifarch ppc %{power64} @@ -765,10 +767,8 @@ BuildPython() { --with-dbmliborder=gdbm:ndbm:bdb \ --with-system-expat \ --with-system-ffi \ - --with-wide-unicode \ %if 0%{?with_systemtap} - --with-dtrace \ - --with-tapset-install-dir=%{tapsetdir} \ + --with-systemtap \ %endif %if 0%{?with_valgrind} --with-valgrind \ @@ -919,8 +919,8 @@ install -d -m 0755 %{buildroot}/usr/lib/python%{pybasever}/site-packages/__pycac %endif # ABIFLAGS, LDVERSION and SOABI are in the upstream Makefile -%global ABIFLAGS_optimized mu -%global ABIFLAGS_debug dmu +%global ABIFLAGS_optimized m +%global ABIFLAGS_debug dm %global LDVERSION_optimized %{pybasever}%{ABIFLAGS_optimized} %global LDVERSION_debug %{pybasever}%{ABIFLAGS_debug} @@ -1160,7 +1160,9 @@ rm -fr %{buildroot} %{_bindir}/pydoc* %{_bindir}/python3 %{_bindir}/python%{pybasever} -%{_bindir}/python%{pybasever}mu +%{_bindir}/python%{pybasever}m +%{_bindir}/pyvenv +%{_bindir}/pyvenv-3.3 %{_mandir}/*/* %files libs @@ -1168,19 +1170,21 @@ rm -fr %{buildroot} %doc LICENSE README %dir %{pylibdir} %dir %{dynload_dir} -%{dynload_dir}/Python-%{version}-py%{pybasever}.egg-info %{dynload_dir}/_bisect.%{SOABI_optimized}.so +%{dynload_dir}/_bz2.%{SOABI_optimized}.so %{dynload_dir}/_codecs_cn.%{SOABI_optimized}.so %{dynload_dir}/_codecs_hk.%{SOABI_optimized}.so %{dynload_dir}/_codecs_iso2022.%{SOABI_optimized}.so %{dynload_dir}/_codecs_jp.%{SOABI_optimized}.so %{dynload_dir}/_codecs_kr.%{SOABI_optimized}.so %{dynload_dir}/_codecs_tw.%{SOABI_optimized}.so +%{dynload_dir}/_crypt.%{SOABI_optimized}.so %{dynload_dir}/_csv.%{SOABI_optimized}.so %{dynload_dir}/_ctypes.%{SOABI_optimized}.so %{dynload_dir}/_curses.%{SOABI_optimized}.so %{dynload_dir}/_curses_panel.%{SOABI_optimized}.so %{dynload_dir}/_dbm.%{SOABI_optimized}.so +%{dynload_dir}/_decimal.%{SOABI_optimized}.so %{dynload_dir}/_elementtree.%{SOABI_optimized}.so %if %{with_gdbm} %{dynload_dir}/_gdbm.%{SOABI_optimized}.so @@ -1189,6 +1193,7 @@ rm -fr %{buildroot} %{dynload_dir}/_heapq.%{SOABI_optimized}.so %{dynload_dir}/_json.%{SOABI_optimized}.so %{dynload_dir}/_lsprof.%{SOABI_optimized}.so +%{dynload_dir}/_lzma.%{SOABI_optimized}.so %{dynload_dir}/_multibytecodec.%{SOABI_optimized}.so %{dynload_dir}/_multiprocessing.%{SOABI_optimized}.so %{dynload_dir}/_pickle.%{SOABI_optimized}.so @@ -1202,9 +1207,7 @@ rm -fr %{buildroot} %{dynload_dir}/atexit.%{SOABI_optimized}.so %{dynload_dir}/audioop.%{SOABI_optimized}.so %{dynload_dir}/binascii.%{SOABI_optimized}.so -%{dynload_dir}/bz2.%{SOABI_optimized}.so %{dynload_dir}/cmath.%{SOABI_optimized}.so -%{dynload_dir}/crypt.%{SOABI_optimized}.so %{dynload_dir}/_datetime.%{SOABI_optimized}.so %{dynload_dir}/fcntl.%{SOABI_optimized}.so %{dynload_dir}/grp.%{SOABI_optimized}.so @@ -1231,7 +1234,11 @@ rm -fr %{buildroot} %{pylibdir}/*.py %dir %{pylibdir}/__pycache__/ %{pylibdir}/__pycache__/*%{bytecode_suffixes} -%{pylibdir}/wsgiref.egg-info + +%dir %{pylibdir}/collections/ +%dir %{pylibdir}/collections/__pycache__/ +%{pylibdir}/collections/*.py +%{pylibdir}/collections/__pycache__/*%{bytecode_suffixes} %dir %{pylibdir}/concurrent/ %dir %{pylibdir}/concurrent/__pycache__/ @@ -1268,6 +1275,7 @@ rm -fr %{buildroot} %{pylibdir}/email/*.py %{pylibdir}/email/__pycache__/*%{bytecode_suffixes} %{pylibdir}/email/mime +%doc %{pylibdir}/email/architecture.rst %{pylibdir}/encodings %{pylibdir}/html @@ -1288,7 +1296,7 @@ rm -fr %{buildroot} %exclude %{pylibdir}/lib2to3/tests %{pylibdir}/logging %{pylibdir}/multiprocessing -%{pylibdir}/plat-linux2 +%{pylibdir}/plat-linux %{pylibdir}/pydoc_data %dir %{pylibdir}/sqlite3/ @@ -1312,6 +1320,13 @@ rm -fr %{buildroot} %{pylibdir}/unittest/__pycache__/*%{bytecode_suffixes} %{pylibdir}/urllib + +%dir %{pylibdir}/venv/ +%dir %{pylibdir}/venv/__pycache__/ +%{pylibdir}/venv/*.py +%{pylibdir}/venv/__pycache__/*%{bytecode_suffixes} +%{pylibdir}/venv/scripts + %{pylibdir}/wsgiref %{pylibdir}/xml %{pylibdir}/xmlrpc @@ -1380,11 +1395,11 @@ rm -fr %{buildroot} %defattr(-, root, root) %{pylibdir}/ctypes/test %{pylibdir}/distutils/tests -%{pylibdir}/email/test %{pylibdir}/importlib/test %{pylibdir}/sqlite3/test %{pylibdir}/test %{dynload_dir}/_ctypes_test.%{SOABI_optimized}.so +%{dynload_dir}/_testbuffer.%{SOABI_optimized}.so %{dynload_dir}/_testcapi.%{SOABI_optimized}.so %{pylibdir}/lib2to3/tests %{pylibdir}/tkinter/test @@ -1408,17 +1423,20 @@ rm -fr %{buildroot} # Analog of the -libs subpackage's files: # ...with debug builds of the built-in "extension" modules: %{dynload_dir}/_bisect.%{SOABI_debug}.so +%{dynload_dir}/_bz2.%{SOABI_debug}.so %{dynload_dir}/_codecs_cn.%{SOABI_debug}.so %{dynload_dir}/_codecs_hk.%{SOABI_debug}.so %{dynload_dir}/_codecs_iso2022.%{SOABI_debug}.so %{dynload_dir}/_codecs_jp.%{SOABI_debug}.so %{dynload_dir}/_codecs_kr.%{SOABI_debug}.so %{dynload_dir}/_codecs_tw.%{SOABI_debug}.so +%{dynload_dir}/_crypt.%{SOABI_debug}.so %{dynload_dir}/_csv.%{SOABI_debug}.so %{dynload_dir}/_ctypes.%{SOABI_debug}.so %{dynload_dir}/_curses.%{SOABI_debug}.so %{dynload_dir}/_curses_panel.%{SOABI_debug}.so %{dynload_dir}/_dbm.%{SOABI_debug}.so +%{dynload_dir}/_decimal.%{SOABI_debug}.so %{dynload_dir}/_elementtree.%{SOABI_debug}.so %if %{with_gdbm} %{dynload_dir}/_gdbm.%{SOABI_debug}.so @@ -1427,6 +1445,7 @@ rm -fr %{buildroot} %{dynload_dir}/_heapq.%{SOABI_debug}.so %{dynload_dir}/_json.%{SOABI_debug}.so %{dynload_dir}/_lsprof.%{SOABI_debug}.so +%{dynload_dir}/_lzma.%{SOABI_debug}.so %{dynload_dir}/_multibytecodec.%{SOABI_debug}.so %{dynload_dir}/_multiprocessing.%{SOABI_debug}.so %{dynload_dir}/_pickle.%{SOABI_debug}.so @@ -1440,9 +1459,7 @@ rm -fr %{buildroot} %{dynload_dir}/atexit.%{SOABI_debug}.so %{dynload_dir}/audioop.%{SOABI_debug}.so %{dynload_dir}/binascii.%{SOABI_debug}.so -%{dynload_dir}/bz2.%{SOABI_debug}.so %{dynload_dir}/cmath.%{SOABI_debug}.so -%{dynload_dir}/crypt.%{SOABI_debug}.so %{dynload_dir}/_datetime.%{SOABI_debug}.so %{dynload_dir}/fcntl.%{SOABI_debug}.so %{dynload_dir}/grp.%{SOABI_debug}.so @@ -1487,6 +1504,7 @@ rm -fr %{buildroot} # Analog of the -test subpackage's files: %{dynload_dir}/_ctypes_test.%{SOABI_debug}.so +%{dynload_dir}/_testbuffer.%{SOABI_debug}.so %{dynload_dir}/_testcapi.%{SOABI_debug}.so %endif # with_debug_build @@ -1510,6 +1528,18 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Fri Jul 20 2012 David Malcolm - 3.3.0-0.1.b1 +- 3.2 -> 3.3: https://fedoraproject.org/wiki/Features/Python_3.3 +- 3.3.0b1: refresh patches 3, 55, 102, 111, 113, 114, 134, 157; drop upstream +patch 147; regenenerate autotools patch; drop "--with-wide-unicode" from +configure (PEP 393); "plat-linux2" -> "plat-linux" (upstream issue 12326); +"bz2" -> "_bz2" and "crypt" -> "_crypt"; egg-info files are no longer shipped +for stdlib (upstream issues 10645 and 12218); email/test moved to +test/test_email; add /usr/bin/pyvenv[-3.3] and venv module (PEP 405); add +_decimal and _lzma modules; make collections modules explicit in payload again +(upstream issue 11085); add _testbuffer module to tests subpackage (added in +upstream commit 3f9b3b6f7ff0) + * Fri Jun 22 2012 David Malcolm - 3.2.3-10 - use macro for power64 (rhbz#834653) diff --git a/sources b/sources index 9d0aae5..b2e8d32 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -187564726f2c1473d301c586acc24847 Python-3.2.3.tar.xz +710047668636097f7557ba45953fce1a Python-3.3.0b1.tar.xz From 99240249b92c67b9f59df48b71de14fd054932e8 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sat, 21 Jul 2012 06:37:12 -0500 Subject: [PATCH 101/416] - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild --- python3.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index fd1f504..256e036 100644 --- a/python3.spec +++ b/python3.spec @@ -122,7 +122,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.3 -Release: 10%{?dist} +Release: 11%{?dist} License: Python Group: Development/Languages @@ -1510,6 +1510,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Sat Jul 21 2012 Fedora Release Engineering - 3.2.3-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + * Fri Jun 22 2012 David Malcolm - 3.2.3-10 - use macro for power64 (rhbz#834653) From a4dad5ac963722f3671bb45b6cf51c60e7e40cbd Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 23 Jul 2012 11:27:17 -0400 Subject: [PATCH 102/416] fix test_sys (patch 134) --- 00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch b/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch index 18549cb..379385f 100644 --- a/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch +++ b/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch @@ -1,11 +1,19 @@ diff -up Python-3.3.0b1/Lib/test/test_sys.py.fix-COUNT_ALLOCS-failure-in-test_sys Python-3.3.0b1/Lib/test/test_sys.py ---- Python-3.3.0b1/Lib/test/test_sys.py.fix-COUNT_ALLOCS-failure-in-test_sys 2012-06-26 16:19:48.000000000 -0400 -+++ Python-3.3.0b1/Lib/test/test_sys.py 2012-07-20 13:44:23.050740172 -0400 -@@ -869,6 +869,9 @@ class SizeofTest(unittest.TestCase): +--- Python-3.3.0b1/Lib/test/test_sys.py.fix-COUNT_ALLOCS-failure-in-test_sys 2012-07-23 11:18:52.524602807 -0400 ++++ Python-3.3.0b1/Lib/test/test_sys.py 2012-07-23 11:25:54.641325620 -0400 +@@ -863,12 +863,17 @@ class SizeofTest(unittest.TestCase): + # type + # static type: PyTypeObject + s = size(vh + 'P2P15Pl4PP9PP11PI') ++ # COUNT_ALLOCS adds a further 3 Py_ssize_t and 2 pointers: ++ if hasattr(sys, 'getcounts'): ++ s += size('3P2P') + check(int, s) + # (PyTypeObject + PyNumberMethods + PyMappingMethods + + # PySequenceMethods + PyBufferProcs + 4P) s = size(vh + 'P2P15Pl4PP9PP11PI') + size('34P 3P 10P 2P 4P') # Separate block for PyDictKeysObject with 4 entries s += size("PPPP") + 4*size("PPP") -+ # COUNT_ALLOCS adds a further 3 Py_ssize_t and 2 pointers: + if hasattr(sys, 'getcounts'): + s += size('3P2P') # class From 3b4dd24c42a177bd8bda0ebf127f199ef32364ef Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 23 Jul 2012 14:05:53 -0400 Subject: [PATCH 103/416] fix test_posix (patch 158) --- 00158-disable-test_fs_holes-in-rpm-build.patch | 11 +++++++++++ python3.spec | 9 +++++++++ 2 files changed, 20 insertions(+) create mode 100644 00158-disable-test_fs_holes-in-rpm-build.patch diff --git a/00158-disable-test_fs_holes-in-rpm-build.patch b/00158-disable-test_fs_holes-in-rpm-build.patch new file mode 100644 index 0000000..c0b0777 --- /dev/null +++ b/00158-disable-test_fs_holes-in-rpm-build.patch @@ -0,0 +1,11 @@ +diff -up Python-3.3.0b1/Lib/test/test_posix.py.disable-test_fs_holes-in-rpm-build.patch Python-3.3.0b1/Lib/test/test_posix.py +--- Python-3.3.0b1/Lib/test/test_posix.py.disable-test_fs_holes-in-rpm-build.patch 2012-07-23 13:53:11.636847977 -0400 ++++ Python-3.3.0b1/Lib/test/test_posix.py 2012-07-23 13:54:02.810208218 -0400 +@@ -1022,6 +1022,7 @@ class PosixTester(unittest.TestCase): + posix.RTLD_GLOBAL + posix.RTLD_LOCAL + ++ @unittest._skipInRpmBuild('running kernel may not match kernel in chroot') + @unittest.skipUnless(hasattr(os, 'SEEK_HOLE'), + "test needs an OS that reports file holes") + @unittest.skipIf(sys.platform in ('freebsd7', 'freebsd8', 'freebsd9'), diff --git a/python3.spec b/python3.spec index 5867aae..efba61f 100644 --- a/python3.spec +++ b/python3.spec @@ -458,6 +458,14 @@ Patch156: 00156-gdb-autoload-safepath.patch # (rhbz#697470) Patch157: 00157-uid-gid-overflows.patch +# 00158 # +# Python 3.3 added os.SEEK_DATA and os.SEEK_HOLE, which may be present in the +# header files in the build chroot, but may not be supported in the running +# kernel, hence we disable this test in an rpm build. +# Adding these was upstream issue http://bugs.python.org/issue10142 +# Not yet sent upstream +Patch158: 00158-disable-test_fs_holes-in-rpm-build.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora 17 onwards, @@ -686,6 +694,7 @@ done %patch155 -p1 %patch156 -p1 %patch157 -p1 +%patch158 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. From 66161795651949904dd556b2d1edc03d371c6751 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 23 Jul 2012 14:38:48 -0400 Subject: [PATCH 104/416] fix test_tools (patch 159) --- 00159-fix-test_tools-directory.patch | 12 ++++++++++++ python3.spec | 8 ++++++++ 2 files changed, 20 insertions(+) create mode 100644 00159-fix-test_tools-directory.patch diff --git a/00159-fix-test_tools-directory.patch b/00159-fix-test_tools-directory.patch new file mode 100644 index 0000000..def63ca --- /dev/null +++ b/00159-fix-test_tools-directory.patch @@ -0,0 +1,12 @@ +diff -up Python-3.3.0b1/Lib/test/test_tools.py.fix-test_tools-directory Python-3.3.0b1/Lib/test/test_tools.py +--- Python-3.3.0b1/Lib/test/test_tools.py.fix-test_tools-directory 2012-07-23 14:29:51.317348183 -0400 ++++ Python-3.3.0b1/Lib/test/test_tools.py 2012-07-23 14:30:09.883116080 -0400 +@@ -19,7 +19,7 @@ if not sysconfig.is_python_build(): + # and run the tests in that case too? + raise unittest.SkipTest('test irrelevant for an installed Python') + +-srcdir = sysconfig.get_config_var('projectbase') ++srcdir = sysconfig.get_config_var('srcdir') + basepath = os.path.join(os.getcwd(), srcdir, 'Tools') + scriptsdir = os.path.join(basepath, 'scripts') + print('srcdir: %r' % srcdir) diff --git a/python3.spec b/python3.spec index efba61f..b860076 100644 --- a/python3.spec +++ b/python3.spec @@ -466,6 +466,13 @@ Patch157: 00157-uid-gid-overflows.patch # Not yet sent upstream Patch158: 00158-disable-test_fs_holes-in-rpm-build.patch +# 00159 # +# http://bugs.python.org/issue13447 added tests for the Tools scripts, but +# these appear to assume that srcdir == builddir, which isn't the case for our +# builds. +# Not yet sent upstream +Patch159: 00159-fix-test_tools-directory.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora 17 onwards, @@ -695,6 +702,7 @@ done %patch156 -p1 %patch157 -p1 %patch158 -p1 +%patch159 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. From c85d3fb5f184e950542160fef17776fbb8af4720 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 23 Jul 2012 15:09:13 -0400 Subject: [PATCH 105/416] fix bad patch 159 --- 00159-fix-test_tools-directory.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/00159-fix-test_tools-directory.patch b/00159-fix-test_tools-directory.patch index def63ca..8811fb3 100644 --- a/00159-fix-test_tools-directory.patch +++ b/00159-fix-test_tools-directory.patch @@ -1,6 +1,6 @@ diff -up Python-3.3.0b1/Lib/test/test_tools.py.fix-test_tools-directory Python-3.3.0b1/Lib/test/test_tools.py ---- Python-3.3.0b1/Lib/test/test_tools.py.fix-test_tools-directory 2012-07-23 14:29:51.317348183 -0400 -+++ Python-3.3.0b1/Lib/test/test_tools.py 2012-07-23 14:30:09.883116080 -0400 +--- Python-3.3.0b1/Lib/test/test_tools.py.fix-test_tools-directory 2012-07-23 15:08:19.271494787 -0400 ++++ Python-3.3.0b1/Lib/test/test_tools.py 2012-07-23 15:08:32.183333368 -0400 @@ -19,7 +19,7 @@ if not sysconfig.is_python_build(): # and run the tests in that case too? raise unittest.SkipTest('test irrelevant for an installed Python') @@ -9,4 +9,4 @@ diff -up Python-3.3.0b1/Lib/test/test_tools.py.fix-test_tools-directory Python-3 +srcdir = sysconfig.get_config_var('srcdir') basepath = os.path.join(os.getcwd(), srcdir, 'Tools') scriptsdir = os.path.join(basepath, 'scripts') - print('srcdir: %r' % srcdir) + From 8d03cf22c738d78fcc8fee7d4c3fd90923c2f1bc Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 24 Jul 2012 06:12:06 -0400 Subject: [PATCH 106/416] workaround erroneously shared _sysconfigdata.py upstream issue #14774 --- python3.spec | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index b860076..00333d1 100644 --- a/python3.spec +++ b/python3.spec @@ -849,6 +849,12 @@ InstallPython() { pushd $ConfDir + # Workaround for http://bugs.python.org/issue14774 : Lib/_sysconfigdata.py + # is in the srcdir but contains per-config data. + # Regenerate it each time: + rm -f ../../Lib/_sysconfigdata.py + make $topdir/Lib/_sysconfigdata.py + make install DESTDIR=%{buildroot} INSTALL="install -p" popd @@ -1130,6 +1136,13 @@ CheckPython() { # Note that we're running the tests using the version of the code in the # builddir, not in the buildroot. + # Workaround for http://bugs.python.org/issue14774, as per the install + # stanza (albeit from a different directory): + rm -f Lib/_sysconfigdata.py + pushd $ConfDir + make $topdir/Lib/_sysconfigdata.py + popd + # 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) @@ -1555,7 +1568,8 @@ for stdlib (upstream issues 10645 and 12218); email/test moved to test/test_email; add /usr/bin/pyvenv[-3.3] and venv module (PEP 405); add _decimal and _lzma modules; make collections modules explicit in payload again (upstream issue 11085); add _testbuffer module to tests subpackage (added in -upstream commit 3f9b3b6f7ff0) +upstream commit 3f9b3b6f7ff0); fix test failures (patches 158 and 159); +workaround erroneously shared _sysconfigdata.py upstream issue #14774 * Fri Jun 22 2012 David Malcolm - 3.2.3-10 - use macro for power64 (rhbz#834653) From 823581e8512c6cfc509ec158e96f2c2ec6f6e4b7 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 24 Jul 2012 11:21:34 -0400 Subject: [PATCH 107/416] renumber patches (158->160, 159->161) for consistency with python.spec --- ...0-disable-test_fs_holes-in-rpm-build.patch | 0 ...ch => 00161-fix-test_tools-directory.patch | 0 python3.spec | 24 ++++++++++++++----- 3 files changed, 18 insertions(+), 6 deletions(-) rename 00158-disable-test_fs_holes-in-rpm-build.patch => 00160-disable-test_fs_holes-in-rpm-build.patch (100%) rename 00159-fix-test_tools-directory.patch => 00161-fix-test_tools-directory.patch (100%) diff --git a/00158-disable-test_fs_holes-in-rpm-build.patch b/00160-disable-test_fs_holes-in-rpm-build.patch similarity index 100% rename from 00158-disable-test_fs_holes-in-rpm-build.patch rename to 00160-disable-test_fs_holes-in-rpm-build.patch diff --git a/00159-fix-test_tools-directory.patch b/00161-fix-test_tools-directory.patch similarity index 100% rename from 00159-fix-test_tools-directory.patch rename to 00161-fix-test_tools-directory.patch diff --git a/python3.spec b/python3.spec index 00333d1..b68ef15 100644 --- a/python3.spec +++ b/python3.spec @@ -459,19 +459,29 @@ Patch156: 00156-gdb-autoload-safepath.patch Patch157: 00157-uid-gid-overflows.patch # 00158 # +# Patch158: 00158-fix-hashlib-leak.patch +# in python.spec +# TODO: python3 status? + +# 00159 # +# Patch159: 00159-correct-libdb-include-path.patch +# in python.spec +# TODO: python3 status? + +# 00160 # # Python 3.3 added os.SEEK_DATA and os.SEEK_HOLE, which may be present in the # header files in the build chroot, but may not be supported in the running # kernel, hence we disable this test in an rpm build. # Adding these was upstream issue http://bugs.python.org/issue10142 # Not yet sent upstream -Patch158: 00158-disable-test_fs_holes-in-rpm-build.patch +Patch160: 00160-disable-test_fs_holes-in-rpm-build.patch -# 00159 # +# 00161 # # http://bugs.python.org/issue13447 added tests for the Tools scripts, but # these appear to assume that srcdir == builddir, which isn't the case for our # builds. # Not yet sent upstream -Patch159: 00159-fix-test_tools-directory.patch +Patch161: 00161-fix-test_tools-directory.patch # (New patches go here ^^^) # @@ -701,8 +711,10 @@ done %patch155 -p1 %patch156 -p1 %patch157 -p1 -%patch158 -p1 -%patch159 -p1 +#00158: FIXME +#00159: FIXME +%patch160 -p1 +%patch161 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1568,7 +1580,7 @@ for stdlib (upstream issues 10645 and 12218); email/test moved to test/test_email; add /usr/bin/pyvenv[-3.3] and venv module (PEP 405); add _decimal and _lzma modules; make collections modules explicit in payload again (upstream issue 11085); add _testbuffer module to tests subpackage (added in -upstream commit 3f9b3b6f7ff0); fix test failures (patches 158 and 159); +upstream commit 3f9b3b6f7ff0); fix test failures (patches 160 and 161); workaround erroneously shared _sysconfigdata.py upstream issue #14774 * Fri Jun 22 2012 David Malcolm - 3.2.3-10 From 08ca53faca8807e231edc2a9ab4a75e4625f69e5 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 24 Jul 2012 12:06:07 -0400 Subject: [PATCH 108/416] fix distutils.sysconfig traceback (patch 162) --- 00162-distutils-sysconfig-fix-CC-options.patch | 14 ++++++++++++++ python3.spec | 10 +++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 00162-distutils-sysconfig-fix-CC-options.patch diff --git a/00162-distutils-sysconfig-fix-CC-options.patch b/00162-distutils-sysconfig-fix-CC-options.patch new file mode 100644 index 0000000..ac8d3f2 --- /dev/null +++ b/00162-distutils-sysconfig-fix-CC-options.patch @@ -0,0 +1,14 @@ +diff -up Python-3.3.0b1/Lib/distutils/sysconfig.py.fix-CC-options.patch Python-3.3.0b1/Lib/distutils/sysconfig.py +--- Python-3.3.0b1/Lib/distutils/sysconfig.py.fix-CC-options.patch 2012-07-24 11:57:43.804353959 -0400 ++++ Python-3.3.0b1/Lib/distutils/sysconfig.py 2012-07-24 11:59:38.341354843 -0400 +@@ -580,7 +580,9 @@ def get_config_vars(*args): + # skip checks if the compiler was overriden with a CC env variable + if 'CC' not in os.environ: + cc = oldcc = _config_vars['CC'] +- if not find_executable(cc): ++ # CC might contain additional arguments e.g. "gcc -pthread", so ++ # look for the first word: ++ if not find_executable(cc.split()[0]): + # Compiler is not found on the shell search PATH. + # Now search for clang, first on PATH (if the Command LIne + # Tools have been installed in / or if the user has provided diff --git a/python3.spec b/python3.spec index b68ef15..5ee688d 100644 --- a/python3.spec +++ b/python3.spec @@ -483,6 +483,12 @@ Patch160: 00160-disable-test_fs_holes-in-rpm-build.patch # Not yet sent upstream Patch161: 00161-fix-test_tools-directory.patch +# 00162 # +# Fix a bug in distutils.sysconfig.get_config_vars() in which find_executable() +# would traceback when "CC" contains options (e.g. "gcc -pthread") +# Not yet sent upstream +Patch162: 00162-distutils-sysconfig-fix-CC-options.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora 17 onwards, @@ -715,6 +721,7 @@ done #00159: FIXME %patch160 -p1 %patch161 -p1 +%patch162 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1581,7 +1588,8 @@ test/test_email; add /usr/bin/pyvenv[-3.3] and venv module (PEP 405); add _decimal and _lzma modules; make collections modules explicit in payload again (upstream issue 11085); add _testbuffer module to tests subpackage (added in upstream commit 3f9b3b6f7ff0); fix test failures (patches 160 and 161); -workaround erroneously shared _sysconfigdata.py upstream issue #14774 +workaround erroneously shared _sysconfigdata.py upstream issue #14774; fix +distutils.sysconfig traceback (patch 162) * Fri Jun 22 2012 David Malcolm - 3.2.3-10 - use macro for power64 (rhbz#834653) From f2b86e2170a1724575c44ac121840ae67ad06c07 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 24 Jul 2012 14:59:47 -0400 Subject: [PATCH 109/416] add BuildRequires: xz-devel (for _lzma module) --- python3.spec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python3.spec b/python3.spec index 5ee688d..e77335d 100644 --- a/python3.spec +++ b/python3.spec @@ -179,10 +179,10 @@ BuildRequires: tk-devel BuildRequires: valgrind-devel %endif +BuildRequires: xz-devel BuildRequires: zlib-devel - # ======================= # Source code and patches # ======================= @@ -1589,7 +1589,8 @@ _decimal and _lzma modules; make collections modules explicit in payload again (upstream issue 11085); add _testbuffer module to tests subpackage (added in upstream commit 3f9b3b6f7ff0); fix test failures (patches 160 and 161); workaround erroneously shared _sysconfigdata.py upstream issue #14774; fix -distutils.sysconfig traceback (patch 162) +distutils.sysconfig traceback (patch 162); add BuildRequires: xz-devel (for +_lzma module) * Fri Jun 22 2012 David Malcolm - 3.2.3-10 - use macro for power64 (rhbz#834653) From 48d20485dbef969c32d388eec4e1fee3cdf7fa90 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 24 Jul 2012 15:59:17 -0400 Subject: [PATCH 110/416] skip some tests within test_socket (patch 163) --- 00163-disable-parts-of-test_socket-in-rpm-build.patch | 11 +++++++++++ python3.spec | 9 ++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 00163-disable-parts-of-test_socket-in-rpm-build.patch diff --git a/00163-disable-parts-of-test_socket-in-rpm-build.patch b/00163-disable-parts-of-test_socket-in-rpm-build.patch new file mode 100644 index 0000000..0e28036 --- /dev/null +++ b/00163-disable-parts-of-test_socket-in-rpm-build.patch @@ -0,0 +1,11 @@ +diff -up Python-3.3.0b1/Lib/test/test_socket.py.disable-test_socket-in-rpm-builds Python-3.3.0b1/Lib/test/test_socket.py +--- Python-3.3.0b1/Lib/test/test_socket.py.disable-test_socket-in-rpm-builds 2012-07-24 15:02:30.823355067 -0400 ++++ Python-3.3.0b1/Lib/test/test_socket.py 2012-07-24 15:08:13.021354999 -0400 +@@ -2188,6 +2188,7 @@ class RecvmsgGenericStreamTests(RecvmsgG + # Tests which require a stream socket and can use either recvmsg() + # or recvmsg_into(). + ++ @unittest._skipInRpmBuild('fails intermittently when run within Koji') + def testRecvmsgEOF(self): + # Receive end-of-stream indicator (b"", peer socket closed). + msg, ancdata, flags, addr = self.doRecvmsg(self.serv_sock, 1024) diff --git a/python3.spec b/python3.spec index e77335d..13ac725 100644 --- a/python3.spec +++ b/python3.spec @@ -489,6 +489,12 @@ Patch161: 00161-fix-test_tools-directory.patch # Not yet sent upstream Patch162: 00162-distutils-sysconfig-fix-CC-options.patch +# 00163 # +# Some tests within test_socket fail intermittently when run inside Koji; +# disable them using unittest._skipInRpmBuild +# Not yet sent upstream +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, @@ -722,6 +728,7 @@ done %patch160 -p1 %patch161 -p1 %patch162 -p1 +%patch163 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1590,7 +1597,7 @@ _decimal and _lzma modules; make collections modules explicit in payload again upstream commit 3f9b3b6f7ff0); fix test failures (patches 160 and 161); workaround erroneously shared _sysconfigdata.py upstream issue #14774; fix distutils.sysconfig traceback (patch 162); add BuildRequires: xz-devel (for -_lzma module) +_lzma module); skip some tests within test_socket (patch 163) * Fri Jun 22 2012 David Malcolm - 3.2.3-10 - use macro for power64 (rhbz#834653) From d474ecc631198e47362b46da00cfbcc7f52de1b8 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 14 Aug 2012 01:05:00 +0200 Subject: [PATCH 111/416] disable some failing checks on PPC* (rhbz#846849) --- ...sable-interrupted_write-tests-on-ppc.patch | 52 +++++++++++++++++++ python3.spec | 14 ++++- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 00164-disable-interrupted_write-tests-on-ppc.patch diff --git a/00164-disable-interrupted_write-tests-on-ppc.patch b/00164-disable-interrupted_write-tests-on-ppc.patch new file mode 100644 index 0000000..0db8092 --- /dev/null +++ b/00164-disable-interrupted_write-tests-on-ppc.patch @@ -0,0 +1,52 @@ +diff -up Python-3.3.0b1/Lib/test/test_exceptions.py.846849 Python-3.3.0b1/Lib/test/test_exceptions.py +--- Python-3.3.0b1/Lib/test/test_exceptions.py.846849 2012-06-26 22:19:47.000000000 +0200 ++++ Python-3.3.0b1/Lib/test/test_exceptions.py 2012-08-13 17:41:28.845403486 +0200 +@@ -401,6 +401,7 @@ class ExceptionTests(unittest.TestCase): + self.assertIsNone(e.__context__) + self.assertIsNone(e.__cause__) + ++ @unittest.skip('rhbz#846849') + def testChainingDescriptors(self): + try: + raise Exception() +diff -up Python-3.3.0b1/Lib/test/test_io.py.846849 Python-3.3.0b1/Lib/test/test_io.py +--- Python-3.3.0b1/Lib/test/test_io.py.846849 2012-06-26 22:19:48.000000000 +0200 ++++ Python-3.3.0b1/Lib/test/test_io.py 2012-08-13 17:41:28.846403451 +0200 +@@ -2938,12 +2938,15 @@ class SignalsTest(unittest.TestCase): + if e.errno != errno.EBADF: + raise + ++ @unittest.skip('rhbz#846849') + def test_interrupted_write_unbuffered(self): + self.check_interrupted_write(b"xy", b"xy", mode="wb", buffering=0) + ++ @unittest.skip('rhbz#846849') + def test_interrupted_write_buffered(self): + self.check_interrupted_write(b"xy", b"xy", mode="wb") + ++ @unittest.skip('rhbz#846849') + def test_interrupted_write_text(self): + self.check_interrupted_write("xy", b"xy", mode="w", encoding="ascii") + +diff -up Python-3.3.0b1/Lib/test/test_raise.py.846849 Python-3.3.0b1/Lib/test/test_raise.py +--- Python-3.3.0b1/Lib/test/test_raise.py.846849 2012-08-13 17:42:16.719714213 +0200 ++++ Python-3.3.0b1/Lib/test/test_raise.py 2012-08-13 17:43:02.544097272 +0200 +@@ -151,6 +151,7 @@ class TestRaise(unittest.TestCase): + + class TestCause(unittest.TestCase): + ++ @unittest.skip('rhbz#846849') + def testCauseSyntax(self): + try: + try: +diff -up Python-3.3.0b1/Lib/test/test_traceback.py.846849 Python-3.3.0b1/Lib/test/test_traceback.py +--- Python-3.3.0b1/Lib/test/test_traceback.py.846849 2012-08-13 17:44:19.714374275 +0200 ++++ Python-3.3.0b1/Lib/test/test_traceback.py 2012-08-13 17:44:43.515534435 +0200 +@@ -246,6 +246,7 @@ class BaseExceptionReportingTests: + self.check_zero_div(blocks[0]) + self.assertIn('inner_raise() # Marker', blocks[2]) + ++ @unittest.skip('rhbz#846849') + def test_context_suppression(self): + try: + try: diff --git a/python3.spec b/python3.spec index 5c6d8b2..c38e0af 100644 --- a/python3.spec +++ b/python3.spec @@ -127,7 +127,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 0.1.%{alphatag}%{?dist} +Release: 0.2.%{alphatag}%{?dist} License: Python Group: Development/Languages @@ -495,6 +495,12 @@ Patch162: 00162-distutils-sysconfig-fix-CC-options.patch # Not yet sent upstream Patch163: 00163-disable-parts-of-test_socket-in-rpm-build.patch +# 0164 # +# some tests in test._io interrupted_write-* fail on PPC (rhbz#846849) +# testChainingDescriptors test in test_exceptions fails on PPc, too (rhbz#846849) +# disable those tests so that rebuilds on PPC can continue +Patch164: 00164-disable-interrupted_write-tests-on-ppc.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora 17 onwards, @@ -729,6 +735,9 @@ done %patch161 -p1 %patch162 -p1 %patch163 -p1 +%ifarch ppc %{power64} +%patch164 -p1 +%endif # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1584,6 +1593,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon Aug 13 2012 Karsten Hopp 3.3.0-0.2.b1 +- disable some failing checks on PPC* (rhbz#846849) + * Fri Aug 3 2012 David Malcolm - 3.3.0-0.1.b1 - 3.2 -> 3.3: https://fedoraproject.org/wiki/Features/Python_3.3 - 3.3.0b1: refresh patches 3, 55, 102, 111, 113, 114, 134, 157; drop upstream From 62d7207dd06806bc830fcb77d74fc758dd29f9bc Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 13 Aug 2012 21:11:12 -0400 Subject: [PATCH 112/416] 3.3.0-0.3.b2 * Mon Aug 13 2012 David Malcolm - 3.3.0-0.3.b2 - 3.3b1 -> 3.3b2; drop upstreamed patch 152; refresh patches 3, 102, 111, 134, 153, 160; regenenerate autotools patch; rework systemtap patch to work correctly when LANG=C (patch 55); importlib.test was moved to test.test_importlib upstream --- 00003-remove-mimeaudio-tests.patch | 10 +- 00055-systemtap.patch | 123 ++-- 00111-no-static-lib.patch | 18 +- ...fix-COUNT_ALLOCS-failure-in-test_sys.patch | 18 +- 00152-fix-test-gdb-regex.patch | 11 - 00153-fix-test_gdb-noise.patch | 14 +- ...0-disable-test_fs_holes-in-rpm-build.patch | 10 +- 00161-fix-test_tools-directory.patch | 12 - ...2-distutils-sysconfig-fix-CC-options.patch | 14 - 05000-autotool-intermediates.patch | 667 +----------------- python-3.3.0b1-lib64.patch | 74 +- python3.spec | 37 +- sources | 2 +- 13 files changed, 174 insertions(+), 836 deletions(-) delete mode 100644 00152-fix-test-gdb-regex.patch delete mode 100644 00161-fix-test_tools-directory.patch delete mode 100644 00162-distutils-sysconfig-fix-CC-options.patch diff --git a/00003-remove-mimeaudio-tests.patch b/00003-remove-mimeaudio-tests.patch index 08ae10a..3c5ed1d 100644 --- a/00003-remove-mimeaudio-tests.patch +++ b/00003-remove-mimeaudio-tests.patch @@ -1,8 +1,8 @@ -diff -up Python-3.3.0b1/Lib/test/test_email/test_email.py.remove-mimeaudio-tests Python-3.3.0b1/Lib/test/test_email/test_email.py ---- Python-3.3.0b1/Lib/test/test_email/test_email.py.remove-mimeaudio-tests 2012-06-26 16:19:47.000000000 -0400 -+++ Python-3.3.0b1/Lib/test/test_email/test_email.py 2012-07-20 12:04:45.316472136 -0400 -@@ -1285,47 +1285,6 @@ Blah blah blah - +diff -up cpython-59223da36dec/Lib/test/test_email/test_email.py.remove-mimeaudio-tests cpython-59223da36dec/Lib/test/test_email/test_email.py +--- cpython-59223da36dec/Lib/test/test_email/test_email.py.remove-mimeaudio-tests 2012-08-07 16:39:41.698482943 -0400 ++++ cpython-59223da36dec/Lib/test/test_email/test_email.py 2012-08-07 16:39:47.861482521 -0400 +@@ -1307,47 +1307,6 @@ Blah blah blah + if x.startswith('>From ')]), 2) -# Test the basic MIMEAudio class diff --git a/00055-systemtap.patch b/00055-systemtap.patch index 33b82d4..9375ff0 100644 --- a/00055-systemtap.patch +++ b/00055-systemtap.patch @@ -1,7 +1,7 @@ -diff -up Python-3.3.0b1/configure.ac.systemtap Python-3.3.0b1/configure.ac ---- Python-3.3.0b1/configure.ac.systemtap 2012-06-26 16:19:58.000000000 -0400 -+++ Python-3.3.0b1/configure.ac 2012-07-20 13:05:39.221792032 -0400 -@@ -2616,6 +2616,23 @@ if test "$with_valgrind" != no; then +diff -up Python-3.3.0b2/configure.ac.systemtap Python-3.3.0b2/configure.ac +--- Python-3.3.0b2/configure.ac.systemtap 2012-08-11 02:54:25.000000000 -0400 ++++ Python-3.3.0b2/configure.ac 2012-08-13 15:24:22.968120645 -0400 +@@ -2678,6 +2678,23 @@ if test "$with_valgrind" != no; then OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT" fi @@ -25,10 +25,10 @@ diff -up Python-3.3.0b1/configure.ac.systemtap Python-3.3.0b1/configure.ac # -I${DLINCLDIR} is added to the compile rule for importdl.o AC_SUBST(DLINCLDIR) DLINCLDIR=. -diff -up Python-3.3.0b1/configure.systemtap Python-3.3.0b1/configure ---- Python-3.3.0b1/configure.systemtap 2012-06-26 16:19:58.000000000 -0400 -+++ Python-3.3.0b1/configure 2012-07-20 13:05:39.220792044 -0400 -@@ -638,6 +638,8 @@ TRUE +diff -up Python-3.3.0b2/configure.systemtap Python-3.3.0b2/configure +--- Python-3.3.0b2/configure.systemtap 2012-08-11 02:54:25.000000000 -0400 ++++ Python-3.3.0b2/configure 2012-08-13 15:24:22.973120583 -0400 +@@ -618,6 +618,8 @@ TRUE MACHDEP_OBJS DYNLOADFILE DLINCLDIR @@ -37,7 +37,7 @@ diff -up Python-3.3.0b1/configure.systemtap Python-3.3.0b1/configure THREADOBJ LDLAST USE_THREAD_MODULE -@@ -793,6 +795,7 @@ with_doc_strings +@@ -779,6 +781,7 @@ with_doc_strings with_tsc with_pymalloc with_valgrind @@ -45,7 +45,7 @@ diff -up Python-3.3.0b1/configure.systemtap Python-3.3.0b1/configure with_fpectl with_libm with_libc -@@ -1468,6 +1471,7 @@ Optional Packages: +@@ -1456,6 +1459,7 @@ Optional Packages: --with(out)-tsc enable/disable timestamp counter profile --with(out)-pymalloc disable/enable specialized mallocs --with-valgrind Enable Valgrind support @@ -53,7 +53,7 @@ diff -up Python-3.3.0b1/configure.systemtap Python-3.3.0b1/configure --with-fpectl enable SIGFPE catching --with-libm=STRING math library --with-libc=STRING C library -@@ -9639,6 +9643,31 @@ fi +@@ -10065,6 +10069,31 @@ fi OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT" fi @@ -85,18 +85,18 @@ diff -up Python-3.3.0b1/configure.systemtap Python-3.3.0b1/configure # -I${DLINCLDIR} is added to the compile rule for importdl.o DLINCLDIR=. -diff -up Python-3.3.0b1/Doc/howto/index.rst.systemtap Python-3.3.0b1/Doc/howto/index.rst ---- Python-3.3.0b1/Doc/howto/index.rst.systemtap 2012-06-26 16:19:37.000000000 -0400 -+++ Python-3.3.0b1/Doc/howto/index.rst 2012-07-20 13:05:39.215792107 -0400 +diff -up Python-3.3.0b2/Doc/howto/index.rst.systemtap Python-3.3.0b2/Doc/howto/index.rst +--- Python-3.3.0b2/Doc/howto/index.rst.systemtap 2012-08-11 02:54:06.000000000 -0400 ++++ Python-3.3.0b2/Doc/howto/index.rst 2012-08-13 15:24:22.973120584 -0400 @@ -29,4 +29,5 @@ Currently, the HOWTOs are: webservers.rst argparse.rst ipaddress.rst + instrumentation.rst -diff -up Python-3.3.0b1/Doc/howto/instrumentation.rst.systemtap Python-3.3.0b1/Doc/howto/instrumentation.rst ---- Python-3.3.0b1/Doc/howto/instrumentation.rst.systemtap 2012-07-20 13:05:39.215792107 -0400 -+++ Python-3.3.0b1/Doc/howto/instrumentation.rst 2012-07-20 13:05:39.215792107 -0400 +diff -up Python-3.3.0b2/Doc/howto/instrumentation.rst.systemtap Python-3.3.0b2/Doc/howto/instrumentation.rst +--- Python-3.3.0b2/Doc/howto/instrumentation.rst.systemtap 2012-08-13 15:24:22.975120558 -0400 ++++ Python-3.3.0b2/Doc/howto/instrumentation.rst 2012-08-13 15:24:22.975120558 -0400 @@ -0,0 +1,295 @@ +.. _instrumentation: + @@ -393,10 +393,10 @@ diff -up Python-3.3.0b1/Doc/howto/instrumentation.rst.systemtap Python-3.3.0b1/D + delete fn_calls; + } + -diff -up Python-3.3.0b1/Lib/test/test_systemtap.py.systemtap Python-3.3.0b1/Lib/test/test_systemtap.py ---- Python-3.3.0b1/Lib/test/test_systemtap.py.systemtap 2012-07-20 13:05:39.215792107 -0400 -+++ Python-3.3.0b1/Lib/test/test_systemtap.py 2012-07-20 13:05:39.215792107 -0400 -@@ -0,0 +1,205 @@ +diff -up Python-3.3.0b2/Lib/test/test_systemtap.py.systemtap Python-3.3.0b2/Lib/test/test_systemtap.py +--- Python-3.3.0b2/Lib/test/test_systemtap.py.systemtap 2012-08-13 15:24:22.976120545 -0400 ++++ Python-3.3.0b2/Lib/test/test_systemtap.py 2012-08-13 15:42:44.278352371 -0400 +@@ -0,0 +1,234 @@ +# Verify that systemtap static probes work +# +import subprocess @@ -567,10 +567,10 @@ diff -up Python-3.3.0b1/Lib/test/test_systemtap.py.systemtap Python-3.3.0b1/Lib/ + self.assertIn(b'=> in :1', out, + msg="stdout: %s\nstderr: %s\n" % (out, err)) + -+ def test_encoding(self): -+ # Ensure that scripts and function names containing non-Latin 1 code ++ def test_function_encoding(self): ++ # Ensure that function names containing non-Latin 1 code + # points are handled: -+ pythonfile = TESTFN + '_☠.py' ++ pythonfile = TESTFN + try: + unlink(pythonfile) + f = open(pythonfile, "wb") @@ -597,15 +597,44 @@ diff -up Python-3.3.0b1/Lib/test/test_systemtap.py.systemtap Python-3.3.0b1/Lib/ + finally: + unlink(pythonfile) + ++ @unittest.skipIf(sys.getfilesystemencoding() == 'ascii', ++ 'the test filename is not encodable with ASCII') ++ def test_filename_encoding(self): ++ # Ensure that scripts names containing non-Latin 1 code ++ # points are handled: ++ pythonfile = TESTFN + '_☠.py' ++ try: ++ unlink(pythonfile) ++ f = open(pythonfile, "wb") ++ f.write(""" ++def foo(): ++ '''Function with non-ASCII identifier; I believe this reads "mojibake"''' ++ print("hello world!") ++ ++foo() ++""".encode('utf-8')) ++ f.close() ++ ++ out, err = invoke_python_under_systemtap(hierarchy_script, ++ pythonfile=pythonfile) ++ out_utf8 = out.decode('utf-8') ++ with ErrorDumper(out, err): ++ self.assertIn('=> in %s:2' % pythonfile, out_utf8) ++ self.assertIn(' => foo in %s:2' % pythonfile, out_utf8) ++ self.assertIn(' <= foo in %s:4' % pythonfile, out_utf8) ++ self.assertIn('<= in %s:6' % pythonfile, out_utf8) ++ finally: ++ unlink(pythonfile) ++ +def test_main(): + run_unittest(SystemtapTests) + +if __name__ == "__main__": + test_main() -diff -up Python-3.3.0b1/Makefile.pre.in.systemtap Python-3.3.0b1/Makefile.pre.in ---- Python-3.3.0b1/Makefile.pre.in.systemtap 2012-06-26 16:19:51.000000000 -0400 -+++ Python-3.3.0b1/Makefile.pre.in 2012-07-20 13:05:39.216792095 -0400 -@@ -358,6 +358,7 @@ PYTHON_OBJS= \ +diff -up Python-3.3.0b2/Makefile.pre.in.systemtap Python-3.3.0b2/Makefile.pre.in +--- Python-3.3.0b2/Makefile.pre.in.systemtap 2012-08-11 02:54:18.000000000 -0400 ++++ Python-3.3.0b2/Makefile.pre.in 2012-08-13 15:24:22.977120532 -0400 +@@ -363,6 +363,7 @@ PYTHON_OBJS= \ Python/formatter_unicode.o \ Python/fileutils.o \ Python/$(DYNLOADFILE) \ @@ -613,7 +642,7 @@ diff -up Python-3.3.0b1/Makefile.pre.in.systemtap Python-3.3.0b1/Makefile.pre.in $(LIBOBJS) \ $(MACHDEP_OBJS) \ $(THREADOBJ) -@@ -708,7 +709,8 @@ Objects/setobject.o: $(srcdir)/Objects/s +@@ -713,7 +714,8 @@ Objects/setobject.o: $(srcdir)/Objects/s $(OPCODETARGETS_H): $(OPCODETARGETGEN_FILES) $(OPCODETARGETGEN) $(OPCODETARGETS_H) @@ -623,7 +652,7 @@ diff -up Python-3.3.0b1/Makefile.pre.in.systemtap Python-3.3.0b1/Makefile.pre.in Python/formatter_unicode.o: $(srcdir)/Python/formatter_unicode.c \ $(BYTESTR_DEPS) -@@ -719,6 +721,13 @@ Objects/typeobject.o: $(srcdir)/Objects/ +@@ -724,6 +726,13 @@ Objects/typeobject.o: $(srcdir)/Objects/ $(srcdir)/Objects/typeslots.inc: $(srcdir)/Include/typeslots.h $(srcdir)/Objects/typeslots.py $(PYTHON) $(srcdir)/Objects/typeslots.py < $(srcdir)/Include/typeslots.h > $(srcdir)/Objects/typeslots.inc @@ -637,7 +666,7 @@ diff -up Python-3.3.0b1/Makefile.pre.in.systemtap Python-3.3.0b1/Makefile.pre.in ############################################################################ # Header files -@@ -1335,6 +1344,7 @@ clean: pycremoval +@@ -1343,6 +1352,7 @@ clean: pycremoval -rm -f Lib/lib2to3/*Grammar*.pickle -rm -f $(SYSCONFIGDATA) -rm -f Modules/_testembed Modules/_freeze_importlib @@ -645,10 +674,10 @@ diff -up Python-3.3.0b1/Makefile.pre.in.systemtap Python-3.3.0b1/Makefile.pre.in profile-removal: find . -name '*.gc??' -exec rm -f {} ';' -diff -up Python-3.3.0b1/Misc/NEWS.systemtap Python-3.3.0b1/Misc/NEWS ---- Python-3.3.0b1/Misc/NEWS.systemtap 2012-06-26 16:19:51.000000000 -0400 -+++ Python-3.3.0b1/Misc/NEWS 2012-07-20 13:05:39.217792083 -0400 -@@ -55,6 +55,11 @@ Core and Builtins +diff -up Python-3.3.0b2/Misc/NEWS.systemtap Python-3.3.0b2/Misc/NEWS +--- Python-3.3.0b2/Misc/NEWS.systemtap 2012-08-11 02:54:18.000000000 -0400 ++++ Python-3.3.0b2/Misc/NEWS 2012-08-13 15:24:22.980120496 -0400 +@@ -403,6 +403,11 @@ Core and Builtins - Issue #15038: Optimize python Locks on Windows. @@ -660,9 +689,9 @@ diff -up Python-3.3.0b1/Misc/NEWS.systemtap Python-3.3.0b1/Misc/NEWS Library ------- -diff -up Python-3.3.0b1/pyconfig.h.in.systemtap Python-3.3.0b1/pyconfig.h.in ---- Python-3.3.0b1/pyconfig.h.in.systemtap 2012-06-26 16:19:58.000000000 -0400 -+++ Python-3.3.0b1/pyconfig.h.in 2012-07-20 13:05:39.222792020 -0400 +diff -up Python-3.3.0b2/pyconfig.h.in.systemtap Python-3.3.0b2/pyconfig.h.in +--- Python-3.3.0b2/pyconfig.h.in.systemtap 2012-08-11 02:54:25.000000000 -0400 ++++ Python-3.3.0b2/pyconfig.h.in 2012-08-13 15:24:22.981120483 -0400 @@ -1306,6 +1306,9 @@ /* Define if you want to compile in Python-specific mallocs */ #undef WITH_PYMALLOC @@ -673,9 +702,9 @@ diff -up Python-3.3.0b1/pyconfig.h.in.systemtap Python-3.3.0b1/pyconfig.h.in /* Define if you want to compile in rudimentary thread support */ #undef WITH_THREAD -diff -up Python-3.3.0b1/Python/ceval.c.systemtap Python-3.3.0b1/Python/ceval.c ---- Python-3.3.0b1/Python/ceval.c.systemtap 2012-06-26 16:19:56.000000000 -0400 -+++ Python-3.3.0b1/Python/ceval.c 2012-07-20 13:05:39.218792070 -0400 +diff -up Python-3.3.0b2/Python/ceval.c.systemtap Python-3.3.0b2/Python/ceval.c +--- Python-3.3.0b2/Python/ceval.c.systemtap 2012-08-11 02:54:24.000000000 -0400 ++++ Python-3.3.0b2/Python/ceval.c 2012-08-13 15:24:22.982120470 -0400 @@ -18,6 +18,8 @@ #include @@ -708,9 +737,9 @@ diff -up Python-3.3.0b1/Python/ceval.c.systemtap Python-3.3.0b1/Python/ceval.c Py_LeaveRecursiveCall(); tstate->frame = f->f_back; -diff -up Python-3.3.0b1/Python/ceval_systemtap.h.systemtap Python-3.3.0b1/Python/ceval_systemtap.h ---- Python-3.3.0b1/Python/ceval_systemtap.h.systemtap 2012-07-20 13:05:39.218792070 -0400 -+++ Python-3.3.0b1/Python/ceval_systemtap.h 2012-07-20 13:05:39.218792070 -0400 +diff -up Python-3.3.0b2/Python/ceval_systemtap.h.systemtap Python-3.3.0b2/Python/ceval_systemtap.h +--- Python-3.3.0b2/Python/ceval_systemtap.h.systemtap 2012-08-13 15:24:22.983120457 -0400 ++++ Python-3.3.0b2/Python/ceval_systemtap.h 2012-08-13 15:24:22.983120457 -0400 @@ -0,0 +1,86 @@ +/* + Support for SystemTap static markers @@ -798,9 +827,9 @@ diff -up Python-3.3.0b1/Python/ceval_systemtap.h.systemtap Python-3.3.0b1/Python +#define systemtap_function_return(f) + +#endif -diff -up Python-3.3.0b1/Python/pysystemtap.d.systemtap Python-3.3.0b1/Python/pysystemtap.d ---- Python-3.3.0b1/Python/pysystemtap.d.systemtap 2012-07-20 13:05:39.218792070 -0400 -+++ Python-3.3.0b1/Python/pysystemtap.d 2012-07-20 13:05:39.218792070 -0400 +diff -up Python-3.3.0b2/Python/pysystemtap.d.systemtap Python-3.3.0b2/Python/pysystemtap.d +--- Python-3.3.0b2/Python/pysystemtap.d.systemtap 2012-08-13 15:24:22.983120457 -0400 ++++ Python-3.3.0b2/Python/pysystemtap.d 2012-08-13 15:24:22.983120457 -0400 @@ -0,0 +1,4 @@ +provider python { + probe function__entry(const char *, const char *, int, PyFrameObject *); diff --git a/00111-no-static-lib.patch b/00111-no-static-lib.patch index 8ba0fd7..91b24b8 100644 --- a/00111-no-static-lib.patch +++ b/00111-no-static-lib.patch @@ -1,7 +1,7 @@ -diff -up Python-3.3.0b1/Makefile.pre.in.no-static-lib Python-3.3.0b1/Makefile.pre.in ---- Python-3.3.0b1/Makefile.pre.in.no-static-lib 2012-07-20 13:20:34.056605058 -0400 -+++ Python-3.3.0b1/Makefile.pre.in 2012-07-20 13:21:41.540761389 -0400 -@@ -458,7 +458,7 @@ coverage: +diff -up cpython-59223da36dec/Makefile.pre.in.no-static-lib cpython-59223da36dec/Makefile.pre.in +--- cpython-59223da36dec/Makefile.pre.in.no-static-lib 2012-08-07 16:43:43.296466422 -0400 ++++ cpython-59223da36dec/Makefile.pre.in 2012-08-07 16:44:13.299464371 -0400 +@@ -464,7 +464,7 @@ coverage: # Build the interpreter @@ -10,9 +10,9 @@ diff -up Python-3.3.0b1/Makefile.pre.in.no-static-lib Python-3.3.0b1/Makefile.pr $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Modules/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) platform: $(BUILDPYTHON) $(SYSCONFIGDATA) -@@ -475,18 +475,6 @@ sharedmods: $(BUILDPYTHON) $(SYSCONFIGDA - *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \ - esac +@@ -480,18 +480,6 @@ sharedmods: $(BUILDPYTHON) $(SYSCONFIGDA + $(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 @@ -29,7 +29,7 @@ diff -up Python-3.3.0b1/Makefile.pre.in.no-static-lib Python-3.3.0b1/Makefile.pr libpython$(LDVERSION).so: $(LIBRARY_OBJS) if test $(INSTSONAME) != $(LDLIBRARY); then \ $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ -@@ -576,7 +564,7 @@ Modules/Setup: $(srcdir)/Modules/Setup.d +@@ -581,7 +569,7 @@ Modules/Setup: $(srcdir)/Modules/Setup.d echo "-----------------------------------------------"; \ fi @@ -38,7 +38,7 @@ diff -up Python-3.3.0b1/Makefile.pre.in.no-static-lib Python-3.3.0b1/Makefile.pr $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Modules/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) ############################################################################ -@@ -1150,18 +1138,6 @@ libainstall: all python-config +@@ -1155,18 +1143,6 @@ libainstall: all python-config else true; \ fi; \ done diff --git a/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch b/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch index 379385f..087705c 100644 --- a/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch +++ b/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch @@ -1,21 +1,21 @@ -diff -up Python-3.3.0b1/Lib/test/test_sys.py.fix-COUNT_ALLOCS-failure-in-test_sys Python-3.3.0b1/Lib/test/test_sys.py ---- Python-3.3.0b1/Lib/test/test_sys.py.fix-COUNT_ALLOCS-failure-in-test_sys 2012-07-23 11:18:52.524602807 -0400 -+++ Python-3.3.0b1/Lib/test/test_sys.py 2012-07-23 11:25:54.641325620 -0400 -@@ -863,12 +863,17 @@ class SizeofTest(unittest.TestCase): +diff -up Python-3.3.0b2/Lib/test/test_sys.py.fix-COUNT_ALLOCS-failure-in-test_sys Python-3.3.0b2/Lib/test/test_sys.py +--- Python-3.3.0b2/Lib/test/test_sys.py.fix-COUNT_ALLOCS-failure-in-test_sys 2012-08-11 02:54:16.000000000 -0400 ++++ Python-3.3.0b2/Lib/test/test_sys.py 2012-08-13 14:50:15.253720597 -0400 +@@ -835,12 +835,17 @@ class SizeofTest(unittest.TestCase): # type # static type: PyTypeObject - s = size(vh + 'P2P15Pl4PP9PP11PI') + s = vsize('P2n15Pl4Pn9Pn11PI') + # COUNT_ALLOCS adds a further 3 Py_ssize_t and 2 pointers: + if hasattr(sys, 'getcounts'): -+ s += size('3P2P') ++ s += struct.calcsize('3P2P') check(int, s) # (PyTypeObject + PyNumberMethods + PyMappingMethods + # PySequenceMethods + PyBufferProcs + 4P) - s = size(vh + 'P2P15Pl4PP9PP11PI') + size('34P 3P 10P 2P 4P') + s = vsize('P2n15Pl4Pn9Pn11PI') + struct.calcsize('34P 3P 10P 2P 4P') # Separate block for PyDictKeysObject with 4 entries - s += size("PPPP") + 4*size("PPP") + s += struct.calcsize("2nPn") + 4*struct.calcsize("n2P") + if hasattr(sys, 'getcounts'): -+ s += size('3P2P') ++ s += struct.calcsize('3P2P') # class class newstyleclass(object): pass check(newstyleclass, s) 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/00153-fix-test_gdb-noise.patch b/00153-fix-test_gdb-noise.patch index bc5ee63..cc9ed8c 100644 --- a/00153-fix-test_gdb-noise.patch +++ b/00153-fix-test_gdb-noise.patch @@ -1,6 +1,7 @@ ---- 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): +diff -up cpython-59223da36dec/Lib/test/test_gdb.py.fix-test_gdb-noise cpython-59223da36dec/Lib/test/test_gdb.py +--- cpython-59223da36dec/Lib/test/test_gdb.py.fix-test_gdb-noise 2012-08-07 06:10:57.000000000 -0400 ++++ cpython-59223da36dec/Lib/test/test_gdb.py 2012-08-07 17:13:46.592343113 -0400 +@@ -115,6 +115,15 @@ class DebuggerTests(unittest.TestCase): # Generate a list of commands in gdb's language: commands = ['set breakpoint pending yes', 'break %s' % breakpoint, @@ -16,10 +17,11 @@ 'run'] if cmds_after_breakpoint: commands += cmds_after_breakpoint -@@ -135,8 +144,16 @@ class DebuggerTests(unittest.TestCase): +@@ -154,8 +163,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') @@ -27,9 +29,9 @@ + 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/00160-disable-test_fs_holes-in-rpm-build.patch b/00160-disable-test_fs_holes-in-rpm-build.patch index c0b0777..9fa91d5 100644 --- a/00160-disable-test_fs_holes-in-rpm-build.patch +++ b/00160-disable-test_fs_holes-in-rpm-build.patch @@ -1,11 +1,11 @@ -diff -up Python-3.3.0b1/Lib/test/test_posix.py.disable-test_fs_holes-in-rpm-build.patch Python-3.3.0b1/Lib/test/test_posix.py ---- Python-3.3.0b1/Lib/test/test_posix.py.disable-test_fs_holes-in-rpm-build.patch 2012-07-23 13:53:11.636847977 -0400 -+++ Python-3.3.0b1/Lib/test/test_posix.py 2012-07-23 13:54:02.810208218 -0400 -@@ -1022,6 +1022,7 @@ class PosixTester(unittest.TestCase): +diff -up cpython-59223da36dec/Lib/test/test_posix.py.disable-test_fs_holes-in-rpm-build cpython-59223da36dec/Lib/test/test_posix.py +--- cpython-59223da36dec/Lib/test/test_posix.py.disable-test_fs_holes-in-rpm-build 2012-08-07 17:15:59.000000000 -0400 ++++ cpython-59223da36dec/Lib/test/test_posix.py 2012-08-07 17:16:53.528330330 -0400 +@@ -973,6 +973,7 @@ class PosixTester(unittest.TestCase): posix.RTLD_GLOBAL posix.RTLD_LOCAL + @unittest._skipInRpmBuild('running kernel may not match kernel in chroot') @unittest.skipUnless(hasattr(os, 'SEEK_HOLE'), "test needs an OS that reports file holes") - @unittest.skipIf(sys.platform in ('freebsd7', 'freebsd8', 'freebsd9'), + def test_fs_holes(self): diff --git a/00161-fix-test_tools-directory.patch b/00161-fix-test_tools-directory.patch deleted file mode 100644 index 8811fb3..0000000 --- a/00161-fix-test_tools-directory.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up Python-3.3.0b1/Lib/test/test_tools.py.fix-test_tools-directory Python-3.3.0b1/Lib/test/test_tools.py ---- Python-3.3.0b1/Lib/test/test_tools.py.fix-test_tools-directory 2012-07-23 15:08:19.271494787 -0400 -+++ Python-3.3.0b1/Lib/test/test_tools.py 2012-07-23 15:08:32.183333368 -0400 -@@ -19,7 +19,7 @@ if not sysconfig.is_python_build(): - # and run the tests in that case too? - raise unittest.SkipTest('test irrelevant for an installed Python') - --srcdir = sysconfig.get_config_var('projectbase') -+srcdir = sysconfig.get_config_var('srcdir') - basepath = os.path.join(os.getcwd(), srcdir, 'Tools') - scriptsdir = os.path.join(basepath, 'scripts') - diff --git a/00162-distutils-sysconfig-fix-CC-options.patch b/00162-distutils-sysconfig-fix-CC-options.patch deleted file mode 100644 index ac8d3f2..0000000 --- a/00162-distutils-sysconfig-fix-CC-options.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -up Python-3.3.0b1/Lib/distutils/sysconfig.py.fix-CC-options.patch Python-3.3.0b1/Lib/distutils/sysconfig.py ---- Python-3.3.0b1/Lib/distutils/sysconfig.py.fix-CC-options.patch 2012-07-24 11:57:43.804353959 -0400 -+++ Python-3.3.0b1/Lib/distutils/sysconfig.py 2012-07-24 11:59:38.341354843 -0400 -@@ -580,7 +580,9 @@ def get_config_vars(*args): - # skip checks if the compiler was overriden with a CC env variable - if 'CC' not in os.environ: - cc = oldcc = _config_vars['CC'] -- if not find_executable(cc): -+ # CC might contain additional arguments e.g. "gcc -pthread", so -+ # look for the first word: -+ if not find_executable(cc.split()[0]): - # Compiler is not found on the shell search PATH. - # Now search for clang, first on PATH (if the Command LIne - # Tools have been installed in / or if the user has provided diff --git a/05000-autotool-intermediates.patch b/05000-autotool-intermediates.patch index 6cddbf7..bd9aeca 100644 --- a/05000-autotool-intermediates.patch +++ b/05000-autotool-intermediates.patch @@ -1,184 +1,7 @@ diff -up ./configure.autotool-intermediates ./configure ---- ./configure.autotool-intermediates 2012-07-20 14:09:54.811590526 -0400 -+++ ./configure 2012-07-20 14:10:00.525519093 -0400 -@@ -1,11 +1,13 @@ - #! /bin/sh - # Guess values for system-dependent variables and create Makefiles. --# Generated by GNU Autoconf 2.69 for python 3.3. -+# Generated by GNU Autoconf 2.68 for python 3.3. - # - # Report bugs to . - # - # --# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. -+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -+# Foundation, Inc. - # - # - # This configure script is free software; the Free Software Foundation -@@ -134,31 +136,6 @@ export LANGUAGE - # CDPATH. - (unset CDPATH) >/dev/null 2>&1 && unset CDPATH - --# Use a proper internal environment variable to ensure we don't fall -- # into an infinite loop, continuously re-executing ourselves. -- if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then -- _as_can_reexec=no; export _as_can_reexec; -- # 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 --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+"$@"} --# Admittedly, this is quite paranoid, since all the known shells bail --# out after a failed `exec'. --$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 --as_fn_exit 255 -- fi -- # We don't want this to propagate to other subprocesses. -- { _as_can_reexec=; unset _as_can_reexec;} - if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh -@@ -192,8 +169,7 @@ if ( set x; as_fn_ret_success y && test - else - exitcode=1; echo positional parameters were not saved. - fi --test x\$exitcode = x0 || exit 1 --test -x / || exit 1" -+test x\$exitcode = x0 || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && -@@ -238,25 +214,21 @@ IFS=$as_save_IFS - - - if test "x$CONFIG_SHELL" != x; then : -- export CONFIG_SHELL -- # 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 --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+"$@"} --# Admittedly, this is quite paranoid, since all the known shells bail --# out after a failed `exec'. --$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 --exit 255 -+ # 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 -+ 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 : -@@ -359,14 +331,6 @@ $as_echo X"$as_dir" | - - - } # as_fn_mkdir_p -- --# as_fn_executable_p FILE --# ----------------------- --# Test if FILE is an executable regular file. --as_fn_executable_p () --{ -- test -f "$1" && test -x "$1" --} # as_fn_executable_p - # as_fn_append VAR VALUE - # ---------------------- - # Append the text in VALUE to the end of the definition contained in VAR. Take -@@ -488,10 +452,6 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - -- # If we had to re-execute with $CONFIG_SHELL, we're ensured to have -- # already done that, so ensure we don't try to do so again and fall -- # in an infinite loop. This has already happened in practice. -- _as_can_reexec=no; export _as_can_reexec - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). -@@ -526,16 +486,16 @@ if (echo >conf$$.file) 2>/dev/null; then - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. -- # In both cases, we have to default to `cp -pR'. -+ # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || -- as_ln_s='cp -pR' -+ as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else -- as_ln_s='cp -pR' -+ as_ln_s='cp -p' - fi - else -- as_ln_s='cp -pR' -+ as_ln_s='cp -p' - fi - rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file - rmdir conf$$.dir 2>/dev/null -@@ -547,8 +507,28 @@ else - as_mkdir_p=false - fi - --as_test_x='test -x' --as_executable_p=as_fn_executable_p -+if test -x / >/dev/null 2>&1; then -+ as_test_x='test -x' -+else -+ if ls -dL / >/dev/null 2>&1; then -+ as_ls_L_option=L -+ else -+ as_ls_L_option= -+ fi -+ as_test_x=' -+ eval sh -c '\'' -+ if test -d "$1"; then -+ test -d "$1/."; -+ else -+ case $1 in #( -+ -*)set "./$1";; -+ esac; -+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( -+ ???[sx]*):;;*)false;;esac;fi -+ '\'' sh -+ ' -+fi -+as_executable_p=$as_test_x - - # Sed expression to map a string onto a valid CPP name. - as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" -@@ -793,6 +773,8 @@ with_thread +--- ./configure.autotool-intermediates 2012-08-07 17:21:25.249311751 -0400 ++++ ./configure 2012-08-07 17:21:35.503311049 -0400 +@@ -779,6 +779,8 @@ with_thread enable_ipv6 with_doc_strings with_tsc @@ -187,16 +10,7 @@ diff -up ./configure.autotool-intermediates ./configure with_pymalloc with_valgrind with_systemtap -@@ -1266,6 +1248,8 @@ target=$target_alias - if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe -+ $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. -+ If a cross compiler is detected then cross compile mode will be used" >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -@@ -1469,6 +1453,8 @@ Optional Packages: +@@ -1457,6 +1459,8 @@ Optional Packages: deprecated; use --with(out)-threads --with(out)-doc-strings disable/enable documentation strings --with(out)-tsc enable/disable timestamp counter profile @@ -205,327 +19,7 @@ diff -up ./configure.autotool-intermediates ./configure --with(out)-pymalloc disable/enable specialized mallocs --with-valgrind Enable Valgrind support --with(out)-systemtap disable/enable SystemTap support -@@ -1556,9 +1542,9 @@ test -n "$ac_init_help" && exit $ac_stat - if $ac_init_version; then - cat <<\_ACEOF - python configure 3.3 --generated by GNU Autoconf 2.69 -+generated by GNU Autoconf 2.68 - --Copyright (C) 2012 Free Software Foundation, Inc. -+Copyright (C) 2010 Free Software Foundation, Inc. - This configure script is free software; the Free Software Foundation - gives unlimited permission to copy, distribute and modify it. - _ACEOF -@@ -1634,7 +1620,7 @@ $as_echo "$ac_try_echo"; } >&5 - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || -- test -x conftest$ac_exeext -+ $as_test_x conftest$ac_exeext - }; then : - ac_retval=0 - else -@@ -1932,8 +1918,7 @@ int - main () - { - static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; --test_array [0] = 0; --return test_array [0]; -+test_array [0] = 0 - - ; - return 0; -@@ -1987,8 +1972,7 @@ int - main () - { - static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))]; --test_array [0] = 0; --return test_array [0]; -+test_array [0] = 0 - - ; - return 0; -@@ -2004,8 +1988,7 @@ main () - { - static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) - < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))]; --test_array [0] = 0; --return test_array [0]; -+test_array [0] = 0 - - ; - return 0; -@@ -2055,8 +2038,7 @@ int - main () - { - static int test_array [1 - 2 * !(($2) >= 0)]; --test_array [0] = 0; --return test_array [0]; -+test_array [0] = 0 - - ; - return 0; -@@ -2072,8 +2054,7 @@ int - main () - { - static int test_array [1 - 2 * !(($2) <= $ac_mid)]; --test_array [0] = 0; --return test_array [0]; -+test_array [0] = 0 - - ; - return 0; -@@ -2099,8 +2080,7 @@ int - main () - { - static int test_array [1 - 2 * !(($2) < 0)]; --test_array [0] = 0; --return test_array [0]; -+test_array [0] = 0 - - ; - return 0; -@@ -2116,8 +2096,7 @@ int - main () - { - static int test_array [1 - 2 * !(($2) >= $ac_mid)]; --test_array [0] = 0; --return test_array [0]; -+test_array [0] = 0 - - ; - return 0; -@@ -2151,8 +2130,7 @@ int - main () - { - static int test_array [1 - 2 * !(($2) <= $ac_mid)]; --test_array [0] = 0; --return test_array [0]; -+test_array [0] = 0 - - ; - return 0; -@@ -2395,7 +2373,7 @@ This file contains any messages produced - running configure, to aid debugging if configure makes a mistake. - - It was created by python $as_me 3.3, which was --generated by GNU Autoconf 2.69. Invocation command line was -+generated by GNU Autoconf 2.68. Invocation command line was - - $ $0 $@ - -@@ -2765,7 +2743,7 @@ do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do -- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_HAS_HG="found" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 -@@ -3508,7 +3486,7 @@ do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do -- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 -@@ -3548,7 +3526,7 @@ do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do -- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 -@@ -3601,7 +3579,7 @@ do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do -- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 -@@ -3642,7 +3620,7 @@ do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do -- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue -@@ -3700,7 +3678,7 @@ do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do -- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 -@@ -3744,7 +3722,7 @@ do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do -- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 -@@ -4190,7 +4168,8 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ - /* end confdefs.h. */ - #include - #include --struct stat; -+#include -+#include - /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ - struct buf { int x; }; - FILE * (*rcsopen) (struct buf *, struct stat *, int); -@@ -4329,7 +4308,7 @@ do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do -- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_CXX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 -@@ -4370,7 +4349,7 @@ do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do -- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_CXX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 -@@ -4411,7 +4390,7 @@ do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do -- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_CXX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 -@@ -4460,7 +4439,7 @@ do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do -- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CXX="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 -@@ -4691,7 +4670,7 @@ do - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" -- as_fn_executable_p "$ac_path_GREP" || continue -+ { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue - # Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP - case `"$ac_path_GREP" --version 2>&1` in -@@ -4757,7 +4736,7 @@ do - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" -- as_fn_executable_p "$ac_path_EGREP" || continue -+ { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue - # Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP - case `"$ac_path_EGREP" --version 2>&1` in -@@ -4964,8 +4943,8 @@ else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - --# define __EXTENSIONS__ 1 -- $ac_includes_default -+# define __EXTENSIONS__ 1 -+ $ac_includes_default - int - main () - { -@@ -5359,7 +5338,7 @@ do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do -- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 -@@ -5399,7 +5378,7 @@ do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do -- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 -@@ -5453,7 +5432,7 @@ do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do -- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 -@@ -5504,7 +5483,7 @@ do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do -- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_HAS_PYTHON="found" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 -@@ -5577,7 +5556,7 @@ case $as_dir/ in #(( - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do -- if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then -+ if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. -@@ -5646,7 +5625,7 @@ do - test -z "$as_dir" && as_dir=. - for ac_prog in mkdir gmkdir; do - for ac_exec_ext in '' $ac_executable_extensions; do -- as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue -+ { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ -@@ -8538,7 +8517,7 @@ do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do -- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 -@@ -8581,7 +8560,7 @@ do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do -- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 -@@ -9591,6 +9570,50 @@ $as_echo "no" >&6; } +@@ -10017,6 +10021,50 @@ $as_echo "no" >&6; } fi @@ -576,155 +70,4 @@ 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; } -@@ -10208,7 +10231,7 @@ do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do -- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_TRUE="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 -@@ -11645,8 +11668,7 @@ int - main () - { - static int test_array [1 - 2 * !(((char) -1) < 0)]; --test_array [0] = 0; --return test_array [0]; -+test_array [0] = 0 - - ; - return 0; -@@ -11677,11 +11699,11 @@ else - int - main () - { -- -+/* FIXME: Include the comments suggested by Paul. */ - #ifndef __cplusplus -- /* Ultrix mips cc rejects this sort of thing. */ -+ /* Ultrix mips cc rejects this. */ - typedef int charset[2]; -- const charset cs = { 0, 0 }; -+ const charset cs; - /* SunOS 4.1.1 cc rejects this. */ - char const *const *pcpcc; - char **ppc; -@@ -11698,9 +11720,8 @@ main () - ++pcpcc; - ppc = (char**) pcpcc; - pcpcc = (char const *const *) ppc; -- { /* SCO 3.2v4 cc rejects this sort of thing. */ -- char tx; -- char *t = &tx; -+ { /* SCO 3.2v4 cc rejects this. */ -+ char *t; - char const *s = 0 ? (char *) 0 : (char const *) 0; - - *t++ = 0; -@@ -11716,10 +11737,10 @@ main () - iptr p = 0; - ++p; - } -- { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying -+ { /* AIX XL C 1.02.0.0 rejects this saying - "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ -- struct s { int j; const int *ap[3]; } bx; -- struct s *b = &bx; b->j = 5; -+ struct s { int j; const int *ap[3]; }; -+ struct s *b; b->j = 5; - } - { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; -@@ -15008,16 +15029,16 @@ if (echo >conf$$.file) 2>/dev/null; then - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. -- # In both cases, we have to default to `cp -pR'. -+ # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || -- as_ln_s='cp -pR' -+ as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else -- as_ln_s='cp -pR' -+ as_ln_s='cp -p' - fi - else -- as_ln_s='cp -pR' -+ as_ln_s='cp -p' - fi - rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file - rmdir conf$$.dir 2>/dev/null -@@ -15077,16 +15098,28 @@ else - as_mkdir_p=false - fi - -- --# as_fn_executable_p FILE --# ----------------------- --# Test if FILE is an executable regular file. --as_fn_executable_p () --{ -- test -f "$1" && test -x "$1" --} # as_fn_executable_p --as_test_x='test -x' --as_executable_p=as_fn_executable_p -+if test -x / >/dev/null 2>&1; then -+ as_test_x='test -x' -+else -+ if ls -dL / >/dev/null 2>&1; then -+ as_ls_L_option=L -+ else -+ as_ls_L_option= -+ fi -+ as_test_x=' -+ eval sh -c '\'' -+ if test -d "$1"; then -+ test -d "$1/."; -+ else -+ case $1 in #( -+ -*)set "./$1";; -+ esac; -+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( -+ ???[sx]*):;;*)false;;esac;fi -+ '\'' sh -+ ' -+fi -+as_executable_p=$as_test_x - - # Sed expression to map a string onto a valid CPP name. - as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" -@@ -15108,7 +15141,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri - # values after options handling. - ac_log=" - This file was extended by python $as_me 3.3, which was --generated by GNU Autoconf 2.69. Invocation command line was -+generated by GNU Autoconf 2.68. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS -@@ -15170,10 +15203,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_writ - ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" - ac_cs_version="\\ - python config.status 3.3 --configured by $0, generated by GNU Autoconf 2.69, -+configured by $0, generated by GNU Autoconf 2.68, - with options \\"\$ac_cs_config\\" - --Copyright (C) 2012 Free Software Foundation, Inc. -+Copyright (C) 2010 Free Software Foundation, Inc. - This config.status script is free software; the Free Software Foundation - gives unlimited permission to copy, distribute and modify it." - -@@ -15263,7 +15296,7 @@ fi - _ACEOF - cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - if \$ac_cs_recheck; then -- set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion -+ set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' diff -up ./pyconfig.h.in.autotool-intermediates ./pyconfig.h.in diff --git a/python-3.3.0b1-lib64.patch b/python-3.3.0b1-lib64.patch index 110ed0d..5ae03aa 100644 --- a/python-3.3.0b1-lib64.patch +++ b/python-3.3.0b1-lib64.patch @@ -1,6 +1,6 @@ -diff -up Python-3.3.0b1/Lib/distutils/command/install.py.lib64 Python-3.3.0b1/Lib/distutils/command/install.py ---- Python-3.3.0b1/Lib/distutils/command/install.py.lib64 2012-06-26 16:19:41.000000000 -0400 -+++ Python-3.3.0b1/Lib/distutils/command/install.py 2012-07-20 13:09:38.760797382 -0400 +diff -up cpython-59223da36dec/Lib/distutils/command/install.py.lib64 cpython-59223da36dec/Lib/distutils/command/install.py +--- cpython-59223da36dec/Lib/distutils/command/install.py.lib64 2012-08-07 06:10:57.000000000 -0400 ++++ cpython-59223da36dec/Lib/distutils/command/install.py 2012-08-07 16:41:00.573477549 -0400 @@ -45,14 +45,14 @@ else: INSTALL_SCHEMES = { 'unix_prefix': { @@ -18,10 +18,10 @@ diff -up Python-3.3.0b1/Lib/distutils/command/install.py.lib64 Python-3.3.0b1/Li 'headers': '$base/include/python/$dist_name', 'scripts': '$base/bin', 'data' : '$base', -diff -up Python-3.3.0b1/Lib/distutils/sysconfig.py.lib64 Python-3.3.0b1/Lib/distutils/sysconfig.py ---- Python-3.3.0b1/Lib/distutils/sysconfig.py.lib64 2012-06-26 16:19:41.000000000 -0400 -+++ Python-3.3.0b1/Lib/distutils/sysconfig.py 2012-07-20 13:12:48.017431348 -0400 -@@ -138,8 +138,12 @@ def get_python_lib(plat_specific=0, stan +diff -up cpython-59223da36dec/Lib/distutils/sysconfig.py.lib64 cpython-59223da36dec/Lib/distutils/sysconfig.py +--- cpython-59223da36dec/Lib/distutils/sysconfig.py.lib64 2012-08-07 06:10:57.000000000 -0400 ++++ cpython-59223da36dec/Lib/distutils/sysconfig.py 2012-08-07 16:41:00.573477549 -0400 +@@ -139,8 +139,12 @@ def get_python_lib(plat_specific=0, stan prefix = plat_specific and EXEC_PREFIX or PREFIX if os.name == "posix": @@ -35,9 +35,9 @@ diff -up Python-3.3.0b1/Lib/distutils/sysconfig.py.lib64 Python-3.3.0b1/Lib/dist if standard_lib: return libpython else: -diff -up Python-3.3.0b1/Lib/site.py.lib64 Python-3.3.0b1/Lib/site.py ---- Python-3.3.0b1/Lib/site.py.lib64 2012-06-26 16:19:45.000000000 -0400 -+++ Python-3.3.0b1/Lib/site.py 2012-07-20 13:09:38.762797357 -0400 +diff -up cpython-59223da36dec/Lib/site.py.lib64 cpython-59223da36dec/Lib/site.py +--- cpython-59223da36dec/Lib/site.py.lib64 2012-08-07 06:10:57.000000000 -0400 ++++ cpython-59223da36dec/Lib/site.py 2012-08-07 16:41:00.573477549 -0400 @@ -303,12 +303,16 @@ def getsitepackages(prefixes=None): if sys.platform in ('os2emx', 'riscos'): sitepackages.append(os.path.join(prefix, "Lib", "site-packages")) @@ -55,9 +55,9 @@ diff -up Python-3.3.0b1/Lib/site.py.lib64 Python-3.3.0b1/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-3.3.0b1/Lib/sysconfig.py.lib64 Python-3.3.0b1/Lib/sysconfig.py ---- Python-3.3.0b1/Lib/sysconfig.py.lib64 2012-06-26 16:19:45.000000000 -0400 -+++ Python-3.3.0b1/Lib/sysconfig.py 2012-07-20 13:14:59.721784816 -0400 +diff -up cpython-59223da36dec/Lib/sysconfig.py.lib64 cpython-59223da36dec/Lib/sysconfig.py +--- cpython-59223da36dec/Lib/sysconfig.py.lib64 2012-08-07 06:10:57.000000000 -0400 ++++ cpython-59223da36dec/Lib/sysconfig.py 2012-08-07 16:41:00.574477549 -0400 @@ -21,10 +21,10 @@ __all__ = [ _INSTALL_SCHEMES = { @@ -86,9 +86,9 @@ diff -up Python-3.3.0b1/Lib/sysconfig.py.lib64 Python-3.3.0b1/Lib/sysconfig.py 'include': '{userbase}/include/python{py_version_short}', 'scripts': '{userbase}/bin', 'data': '{userbase}', -diff -up Python-3.3.0b1/Lib/test/test_site.py.lib64 Python-3.3.0b1/Lib/test/test_site.py ---- Python-3.3.0b1/Lib/test/test_site.py.lib64 2012-06-26 16:19:48.000000000 -0400 -+++ Python-3.3.0b1/Lib/test/test_site.py 2012-07-20 13:09:38.764797333 -0400 +diff -up cpython-59223da36dec/Lib/test/test_site.py.lib64 cpython-59223da36dec/Lib/test/test_site.py +--- cpython-59223da36dec/Lib/test/test_site.py.lib64 2012-08-07 06:10:57.000000000 -0400 ++++ cpython-59223da36dec/Lib/test/test_site.py 2012-08-07 16:41:00.574477549 -0400 @@ -239,12 +239,15 @@ class HelperFunctionsTests(unittest.Test self.assertEqual(dirs[2], wanted) elif os.sep == '/': @@ -108,10 +108,10 @@ diff -up Python-3.3.0b1/Lib/test/test_site.py.lib64 Python-3.3.0b1/Lib/test/test else: # other platforms self.assertEqual(len(dirs), 2) -diff -up Python-3.3.0b1/Makefile.pre.in.lib64 Python-3.3.0b1/Makefile.pre.in ---- Python-3.3.0b1/Makefile.pre.in.lib64 2012-07-20 13:09:38.742797608 -0400 -+++ Python-3.3.0b1/Makefile.pre.in 2012-07-20 13:09:38.765797321 -0400 -@@ -107,7 +107,7 @@ LIBDIR= @libdir@ +diff -up cpython-59223da36dec/Makefile.pre.in.lib64 cpython-59223da36dec/Makefile.pre.in +--- cpython-59223da36dec/Makefile.pre.in.lib64 2012-08-07 16:41:00.557477550 -0400 ++++ cpython-59223da36dec/Makefile.pre.in 2012-08-07 16:41:00.575477549 -0400 +@@ -108,7 +108,7 @@ LIBDIR= @libdir@ MANDIR= @mandir@ INCLUDEDIR= @includedir@ CONFINCLUDEDIR= $(exec_prefix)/include @@ -120,9 +120,9 @@ diff -up Python-3.3.0b1/Makefile.pre.in.lib64 Python-3.3.0b1/Makefile.pre.in ABIFLAGS= @ABIFLAGS@ # Detailed destination directories -diff -up Python-3.3.0b1/Modules/getpath.c.lib64 Python-3.3.0b1/Modules/getpath.c ---- Python-3.3.0b1/Modules/getpath.c.lib64 2012-06-26 16:19:54.000000000 -0400 -+++ Python-3.3.0b1/Modules/getpath.c 2012-07-20 13:09:38.766797308 -0400 +diff -up cpython-59223da36dec/Modules/getpath.c.lib64 cpython-59223da36dec/Modules/getpath.c +--- cpython-59223da36dec/Modules/getpath.c.lib64 2012-08-07 06:10:57.000000000 -0400 ++++ cpython-59223da36dec/Modules/getpath.c 2012-08-07 16:41:00.575477549 -0400 @@ -122,8 +122,8 @@ #endif @@ -143,7 +143,7 @@ diff -up Python-3.3.0b1/Modules/getpath.c.lib64 Python-3.3.0b1/Modules/getpath.c static void reduce(wchar_t *dir) -@@ -669,7 +669,7 @@ calculate_path(void) +@@ -677,7 +677,7 @@ calculate_path(void) } else wcsncpy(zip_path, _prefix, MAXPATHLEN); @@ -152,7 +152,7 @@ diff -up Python-3.3.0b1/Modules/getpath.c.lib64 Python-3.3.0b1/Modules/getpath.c bufsz = wcslen(zip_path); /* Replace "00" with version */ zip_path[bufsz - 6] = VERSION[0]; zip_path[bufsz - 5] = VERSION[2]; -@@ -679,7 +679,7 @@ calculate_path(void) +@@ -687,7 +687,7 @@ calculate_path(void) fprintf(stderr, "Could not find platform dependent libraries \n"); wcsncpy(exec_prefix, _exec_prefix, MAXPATHLEN); @@ -161,19 +161,19 @@ diff -up Python-3.3.0b1/Modules/getpath.c.lib64 Python-3.3.0b1/Modules/getpath.c } /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */ -diff -up Python-3.3.0b1/setup.py.lib64 Python-3.3.0b1/setup.py ---- Python-3.3.0b1/setup.py.lib64 2012-06-26 16:19:58.000000000 -0400 -+++ Python-3.3.0b1/setup.py 2012-07-20 13:09:38.767797295 -0400 -@@ -393,7 +393,7 @@ class PyBuildExt(build_ext): - # Ensure that /usr/local is always used, but the local build +diff -up cpython-59223da36dec/setup.py.lib64 cpython-59223da36dec/setup.py +--- cpython-59223da36dec/setup.py.lib64 2012-08-07 06:10:57.000000000 -0400 ++++ cpython-59223da36dec/setup.py 2012-08-07 16:41:32.153475390 -0400 +@@ -438,7 +438,7 @@ class PyBuildExt(build_ext): # directories (i.e. '.' and 'Include') must be first. See issue # 10520. -- 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() - -@@ -652,11 +652,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') + # only change this for cross builds for 3.3, issues on Mageia + if cross_compiling: +@@ -708,11 +708,11 @@ class PyBuildExt(build_ext): elif curses_library: readline_libs.append(curses_library) elif self.compiler.find_library_file(lib_dirs + @@ -187,7 +187,7 @@ diff -up Python-3.3.0b1/setup.py.lib64 Python-3.3.0b1/setup.py extra_link_args=readline_extra_link_args, libraries=readline_libs) ) else: -@@ -693,8 +693,8 @@ class PyBuildExt(build_ext): +@@ -749,8 +749,8 @@ class PyBuildExt(build_ext): if krb5_h: ssl_incs += krb5_h ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, diff --git a/python3.spec b/python3.spec index c38e0af..8466e7f 100644 --- a/python3.spec +++ b/python3.spec @@ -3,7 +3,7 @@ # ====================================================== %global pybasever 3.3 -%global alphatag b1 +%global alphatag b2 # pybasever without the dot: %global pyshortver 33 @@ -127,7 +127,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 0.2.%{alphatag}%{?dist} +Release: 0.3.%{alphatag}%{?dist} License: Python Group: Development/Languages @@ -229,6 +229,8 @@ Patch3: 00003-remove-mimeaudio-tests.patch # 00055 # # Systemtap support: add statically-defined probe points # Patch sent upstream as http://bugs.python.org/issue14776 +# with some subsequent reworking to cope with LANG=C in an rpmbuild +# (where sys.getfilesystemencoding() == 'ascii') Patch55: 00055-systemtap.patch Patch102: python-3.3.0b1-lib64.patch @@ -415,8 +417,9 @@ Patch150: 00150-disable-rAssertAlmostEqual-cmath-on-ppc.patch # 00152 # # Fix a regex in test_gdb so that it doesn't choke when gdb provides a full # path to Python/bltinmodule.c: -# Not yet sent upstream -Patch152: 00152-fix-test-gdb-regex.patch +# Committed upstream as 77824:abcd29c9a791 as part of fix for +# http://bugs.python.org/issue12605 +# Patch152: 00152-fix-test-gdb-regex.patch # 00153 # # Strip out lines of the form "warning: Unable to open ..." from gdb's stderr @@ -477,17 +480,10 @@ Patch157: 00157-uid-gid-overflows.patch Patch160: 00160-disable-test_fs_holes-in-rpm-build.patch # 00161 # -# http://bugs.python.org/issue13447 added tests for the Tools scripts, but -# these appear to assume that srcdir == builddir, which isn't the case for our -# builds. -# Not yet sent upstream -Patch161: 00161-fix-test_tools-directory.patch +# (Was only needed for Python 3.3.0b1) # 00162 # -# Fix a bug in distutils.sysconfig.get_config_vars() in which find_executable() -# would traceback when "CC" contains options (e.g. "gcc -pthread") -# Not yet sent upstream -Patch162: 00162-distutils-sysconfig-fix-CC-options.patch +# (Was only needed for Python 3.3.0b1) # 00163 # # Some tests within test_socket fail intermittently when run inside Koji; @@ -723,8 +719,8 @@ done %patch150 -p1 %endif # 00151: not for python3 -%patch152 -p0 -%patch153 -p0 +# 00152: upstream as of Python 3.3.0b2 +%patch153 -p1 # 00154: not for this branch %patch155 -p1 %patch156 -p1 @@ -732,8 +728,8 @@ done #00158: FIXME #00159: FIXME %patch160 -p1 -%patch161 -p1 -%patch162 -p1 +# 00161: was only needed for Python 3.3.0b1 +# 00162: was only needed for Python 3.3.0b1 %patch163 -p1 %ifarch ppc %{power64} %patch164 -p1 @@ -1460,7 +1456,6 @@ rm -fr %{buildroot} %defattr(-, root, root) %{pylibdir}/ctypes/test %{pylibdir}/distutils/tests -%{pylibdir}/importlib/test %{pylibdir}/sqlite3/test %{pylibdir}/test %{dynload_dir}/_ctypes_test.%{SOABI_optimized}.so @@ -1593,6 +1588,12 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon Aug 13 2012 David Malcolm - 3.3.0-0.3.b2 +- 3.3b1 -> 3.3b2; drop upstreamed patch 152; refresh patches 3, 102, 111, +134, 153, 160; regenenerate autotools patch; rework systemtap patch to work +correctly when LANG=C (patch 55); importlib.test was moved to +test.test_importlib upstream + * Mon Aug 13 2012 Karsten Hopp 3.3.0-0.2.b1 - disable some failing checks on PPC* (rhbz#846849) diff --git a/sources b/sources index b2e8d32..470145a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -710047668636097f7557ba45953fce1a Python-3.3.0b1.tar.xz +9caeb68335bb19ef36a6bc83467b0ae4 Python-3.3.0b2.tar.xz From 92d712a0d868c29205ffe9c5ed8b95c147edc5d0 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 27 Aug 2012 12:54:05 -0400 Subject: [PATCH 113/416] 3.3.0-0.4.rc1 3.3.0b2 -> 3.3.0rc1; refresh patches 3, 55 --- 00003-remove-mimeaudio-tests.patch | 10 ++--- 00055-systemtap.patch | 70 +++++++++++++++--------------- python3.spec | 7 ++- sources | 2 +- 4 files changed, 46 insertions(+), 43 deletions(-) diff --git a/00003-remove-mimeaudio-tests.patch b/00003-remove-mimeaudio-tests.patch index 3c5ed1d..8341363 100644 --- a/00003-remove-mimeaudio-tests.patch +++ b/00003-remove-mimeaudio-tests.patch @@ -1,8 +1,8 @@ -diff -up cpython-59223da36dec/Lib/test/test_email/test_email.py.remove-mimeaudio-tests cpython-59223da36dec/Lib/test/test_email/test_email.py ---- cpython-59223da36dec/Lib/test/test_email/test_email.py.remove-mimeaudio-tests 2012-08-07 16:39:41.698482943 -0400 -+++ cpython-59223da36dec/Lib/test/test_email/test_email.py 2012-08-07 16:39:47.861482521 -0400 -@@ -1307,47 +1307,6 @@ Blah blah blah - if x.startswith('>From ')]), 2) +diff -up Python-3.3.0rc1/Lib/test/test_email/test_email.py.remove-mimeaudio-tests Python-3.3.0rc1/Lib/test/test_email/test_email.py +--- Python-3.3.0rc1/Lib/test/test_email/test_email.py.remove-mimeaudio-tests 2012-08-25 15:22:10.000000000 -0400 ++++ Python-3.3.0rc1/Lib/test/test_email/test_email.py 2012-08-27 11:00:11.936964586 -0400 +@@ -1321,47 +1321,6 @@ Blah blah blah + self.assertEqual(b.getvalue(), source + b'>From R\xc3\xb6lli\n') -# Test the basic MIMEAudio class diff --git a/00055-systemtap.patch b/00055-systemtap.patch index 9375ff0..7bc55f2 100644 --- a/00055-systemtap.patch +++ b/00055-systemtap.patch @@ -1,6 +1,6 @@ -diff -up Python-3.3.0b2/configure.ac.systemtap Python-3.3.0b2/configure.ac ---- Python-3.3.0b2/configure.ac.systemtap 2012-08-11 02:54:25.000000000 -0400 -+++ Python-3.3.0b2/configure.ac 2012-08-13 15:24:22.968120645 -0400 +diff -up Python-3.3.0rc1/configure.ac.systemtap Python-3.3.0rc1/configure.ac +--- Python-3.3.0rc1/configure.ac.systemtap 2012-08-25 15:22:13.000000000 -0400 ++++ Python-3.3.0rc1/configure.ac 2012-08-27 11:00:36.593962900 -0400 @@ -2678,6 +2678,23 @@ if test "$with_valgrind" != no; then OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT" fi @@ -25,9 +25,9 @@ diff -up Python-3.3.0b2/configure.ac.systemtap Python-3.3.0b2/configure.ac # -I${DLINCLDIR} is added to the compile rule for importdl.o AC_SUBST(DLINCLDIR) DLINCLDIR=. -diff -up Python-3.3.0b2/configure.systemtap Python-3.3.0b2/configure ---- Python-3.3.0b2/configure.systemtap 2012-08-11 02:54:25.000000000 -0400 -+++ Python-3.3.0b2/configure 2012-08-13 15:24:22.973120583 -0400 +diff -up Python-3.3.0rc1/configure.systemtap Python-3.3.0rc1/configure +--- Python-3.3.0rc1/configure.systemtap 2012-08-25 15:22:13.000000000 -0400 ++++ Python-3.3.0rc1/configure 2012-08-27 11:00:36.595962898 -0400 @@ -618,6 +618,8 @@ TRUE MACHDEP_OBJS DYNLOADFILE @@ -85,18 +85,18 @@ diff -up Python-3.3.0b2/configure.systemtap Python-3.3.0b2/configure # -I${DLINCLDIR} is added to the compile rule for importdl.o DLINCLDIR=. -diff -up Python-3.3.0b2/Doc/howto/index.rst.systemtap Python-3.3.0b2/Doc/howto/index.rst ---- Python-3.3.0b2/Doc/howto/index.rst.systemtap 2012-08-11 02:54:06.000000000 -0400 -+++ Python-3.3.0b2/Doc/howto/index.rst 2012-08-13 15:24:22.973120584 -0400 +diff -up Python-3.3.0rc1/Doc/howto/index.rst.systemtap Python-3.3.0rc1/Doc/howto/index.rst +--- Python-3.3.0rc1/Doc/howto/index.rst.systemtap 2012-08-25 15:22:08.000000000 -0400 ++++ Python-3.3.0rc1/Doc/howto/index.rst 2012-08-27 11:00:36.596962898 -0400 @@ -29,4 +29,5 @@ Currently, the HOWTOs are: webservers.rst argparse.rst ipaddress.rst + instrumentation.rst -diff -up Python-3.3.0b2/Doc/howto/instrumentation.rst.systemtap Python-3.3.0b2/Doc/howto/instrumentation.rst ---- Python-3.3.0b2/Doc/howto/instrumentation.rst.systemtap 2012-08-13 15:24:22.975120558 -0400 -+++ Python-3.3.0b2/Doc/howto/instrumentation.rst 2012-08-13 15:24:22.975120558 -0400 +diff -up Python-3.3.0rc1/Doc/howto/instrumentation.rst.systemtap Python-3.3.0rc1/Doc/howto/instrumentation.rst +--- Python-3.3.0rc1/Doc/howto/instrumentation.rst.systemtap 2012-08-27 11:00:36.596962898 -0400 ++++ Python-3.3.0rc1/Doc/howto/instrumentation.rst 2012-08-27 11:00:36.596962898 -0400 @@ -0,0 +1,295 @@ +.. _instrumentation: + @@ -393,9 +393,9 @@ diff -up Python-3.3.0b2/Doc/howto/instrumentation.rst.systemtap Python-3.3.0b2/D + delete fn_calls; + } + -diff -up Python-3.3.0b2/Lib/test/test_systemtap.py.systemtap Python-3.3.0b2/Lib/test/test_systemtap.py ---- Python-3.3.0b2/Lib/test/test_systemtap.py.systemtap 2012-08-13 15:24:22.976120545 -0400 -+++ Python-3.3.0b2/Lib/test/test_systemtap.py 2012-08-13 15:42:44.278352371 -0400 +diff -up Python-3.3.0rc1/Lib/test/test_systemtap.py.systemtap Python-3.3.0rc1/Lib/test/test_systemtap.py +--- Python-3.3.0rc1/Lib/test/test_systemtap.py.systemtap 2012-08-27 11:00:36.596962898 -0400 ++++ Python-3.3.0rc1/Lib/test/test_systemtap.py 2012-08-27 11:00:36.596962898 -0400 @@ -0,0 +1,234 @@ +# Verify that systemtap static probes work +# @@ -631,9 +631,9 @@ diff -up Python-3.3.0b2/Lib/test/test_systemtap.py.systemtap Python-3.3.0b2/Lib/ + +if __name__ == "__main__": + test_main() -diff -up Python-3.3.0b2/Makefile.pre.in.systemtap Python-3.3.0b2/Makefile.pre.in ---- Python-3.3.0b2/Makefile.pre.in.systemtap 2012-08-11 02:54:18.000000000 -0400 -+++ Python-3.3.0b2/Makefile.pre.in 2012-08-13 15:24:22.977120532 -0400 +diff -up Python-3.3.0rc1/Makefile.pre.in.systemtap Python-3.3.0rc1/Makefile.pre.in +--- Python-3.3.0rc1/Makefile.pre.in.systemtap 2012-08-25 15:22:11.000000000 -0400 ++++ Python-3.3.0rc1/Makefile.pre.in 2012-08-27 11:08:51.950929030 -0400 @@ -363,6 +363,7 @@ PYTHON_OBJS= \ Python/formatter_unicode.o \ Python/fileutils.o \ @@ -667,17 +667,17 @@ diff -up Python-3.3.0b2/Makefile.pre.in.systemtap Python-3.3.0b2/Makefile.pre.in # Header files @@ -1343,6 +1352,7 @@ clean: pycremoval - -rm -f Lib/lib2to3/*Grammar*.pickle + -rm -f $(srcdir)/Lib/lib2to3/*Grammar*.pickle -rm -f $(SYSCONFIGDATA) -rm -f Modules/_testembed Modules/_freeze_importlib + -rm -f $(srcdir)/Python/pysystemtap.h profile-removal: find . -name '*.gc??' -exec rm -f {} ';' -diff -up Python-3.3.0b2/Misc/NEWS.systemtap Python-3.3.0b2/Misc/NEWS ---- Python-3.3.0b2/Misc/NEWS.systemtap 2012-08-11 02:54:18.000000000 -0400 -+++ Python-3.3.0b2/Misc/NEWS 2012-08-13 15:24:22.980120496 -0400 -@@ -403,6 +403,11 @@ Core and Builtins +diff -up Python-3.3.0rc1/Misc/NEWS.systemtap Python-3.3.0rc1/Misc/NEWS +--- Python-3.3.0rc1/Misc/NEWS.systemtap 2012-08-25 15:22:11.000000000 -0400 ++++ Python-3.3.0rc1/Misc/NEWS 2012-08-27 11:00:36.599962901 -0400 +@@ -560,6 +560,11 @@ Core and Builtins - Issue #15038: Optimize python Locks on Windows. @@ -689,9 +689,9 @@ diff -up Python-3.3.0b2/Misc/NEWS.systemtap Python-3.3.0b2/Misc/NEWS Library ------- -diff -up Python-3.3.0b2/pyconfig.h.in.systemtap Python-3.3.0b2/pyconfig.h.in ---- Python-3.3.0b2/pyconfig.h.in.systemtap 2012-08-11 02:54:25.000000000 -0400 -+++ Python-3.3.0b2/pyconfig.h.in 2012-08-13 15:24:22.981120483 -0400 +diff -up Python-3.3.0rc1/pyconfig.h.in.systemtap Python-3.3.0rc1/pyconfig.h.in +--- Python-3.3.0rc1/pyconfig.h.in.systemtap 2012-08-25 15:22:13.000000000 -0400 ++++ Python-3.3.0rc1/pyconfig.h.in 2012-08-27 11:00:36.600962901 -0400 @@ -1306,6 +1306,9 @@ /* Define if you want to compile in Python-specific mallocs */ #undef WITH_PYMALLOC @@ -702,9 +702,9 @@ diff -up Python-3.3.0b2/pyconfig.h.in.systemtap Python-3.3.0b2/pyconfig.h.in /* Define if you want to compile in rudimentary thread support */ #undef WITH_THREAD -diff -up Python-3.3.0b2/Python/ceval.c.systemtap Python-3.3.0b2/Python/ceval.c ---- Python-3.3.0b2/Python/ceval.c.systemtap 2012-08-11 02:54:24.000000000 -0400 -+++ Python-3.3.0b2/Python/ceval.c 2012-08-13 15:24:22.982120470 -0400 +diff -up Python-3.3.0rc1/Python/ceval.c.systemtap Python-3.3.0rc1/Python/ceval.c +--- Python-3.3.0rc1/Python/ceval.c.systemtap 2012-08-25 15:22:12.000000000 -0400 ++++ Python-3.3.0rc1/Python/ceval.c 2012-08-27 11:00:36.600962901 -0400 @@ -18,6 +18,8 @@ #include @@ -737,9 +737,9 @@ diff -up Python-3.3.0b2/Python/ceval.c.systemtap Python-3.3.0b2/Python/ceval.c Py_LeaveRecursiveCall(); tstate->frame = f->f_back; -diff -up Python-3.3.0b2/Python/ceval_systemtap.h.systemtap Python-3.3.0b2/Python/ceval_systemtap.h ---- Python-3.3.0b2/Python/ceval_systemtap.h.systemtap 2012-08-13 15:24:22.983120457 -0400 -+++ Python-3.3.0b2/Python/ceval_systemtap.h 2012-08-13 15:24:22.983120457 -0400 +diff -up Python-3.3.0rc1/Python/ceval_systemtap.h.systemtap Python-3.3.0rc1/Python/ceval_systemtap.h +--- Python-3.3.0rc1/Python/ceval_systemtap.h.systemtap 2012-08-27 11:00:36.601962901 -0400 ++++ Python-3.3.0rc1/Python/ceval_systemtap.h 2012-08-27 11:00:36.601962901 -0400 @@ -0,0 +1,86 @@ +/* + Support for SystemTap static markers @@ -827,9 +827,9 @@ diff -up Python-3.3.0b2/Python/ceval_systemtap.h.systemtap Python-3.3.0b2/Python +#define systemtap_function_return(f) + +#endif -diff -up Python-3.3.0b2/Python/pysystemtap.d.systemtap Python-3.3.0b2/Python/pysystemtap.d ---- Python-3.3.0b2/Python/pysystemtap.d.systemtap 2012-08-13 15:24:22.983120457 -0400 -+++ Python-3.3.0b2/Python/pysystemtap.d 2012-08-13 15:24:22.983120457 -0400 +diff -up Python-3.3.0rc1/Python/pysystemtap.d.systemtap Python-3.3.0rc1/Python/pysystemtap.d +--- Python-3.3.0rc1/Python/pysystemtap.d.systemtap 2012-08-27 11:00:36.601962901 -0400 ++++ Python-3.3.0rc1/Python/pysystemtap.d 2012-08-27 11:00:36.601962901 -0400 @@ -0,0 +1,4 @@ +provider python { + probe function__entry(const char *, const char *, int, PyFrameObject *); diff --git a/python3.spec b/python3.spec index 8466e7f..9a4e291 100644 --- a/python3.spec +++ b/python3.spec @@ -3,7 +3,7 @@ # ====================================================== %global pybasever 3.3 -%global alphatag b2 +%global alphatag rc1 # pybasever without the dot: %global pyshortver 33 @@ -127,7 +127,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 0.3.%{alphatag}%{?dist} +Release: 0.4.%{alphatag}%{?dist} License: Python Group: Development/Languages @@ -1588,6 +1588,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon Aug 27 2012 David Malcolm - 3.3.0-0.4.rc1 +- 3.3.0b2 -> 3.3.0rc1; refresh patches 3, 55 + * Mon Aug 13 2012 David Malcolm - 3.3.0-0.3.b2 - 3.3b1 -> 3.3b2; drop upstreamed patch 152; refresh patches 3, 102, 111, 134, 153, 160; regenenerate autotools patch; rework systemtap patch to work diff --git a/sources b/sources index 470145a..f7514b7 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -9caeb68335bb19ef36a6bc83467b0ae4 Python-3.3.0b2.tar.xz +5b67eb7f471577f8429abf15a2087e7c Python-3.3.0rc1.tar.xz From 78727dec4a14119f34bd4272bab26201aac30940 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 10 Sep 2012 10:48:19 -0400 Subject: [PATCH 114/416] 3.3.0-0.5.rc2 3.3.0rc1 -> 3.3.0rc2; refresh patch 55 --- 00055-systemtap.patch | 72 +++++++++++++++++++++---------------------- python3.spec | 7 +++-- sources | 2 +- 3 files changed, 42 insertions(+), 39 deletions(-) diff --git a/00055-systemtap.patch b/00055-systemtap.patch index 7bc55f2..577538a 100644 --- a/00055-systemtap.patch +++ b/00055-systemtap.patch @@ -1,6 +1,6 @@ -diff -up Python-3.3.0rc1/configure.ac.systemtap Python-3.3.0rc1/configure.ac ---- Python-3.3.0rc1/configure.ac.systemtap 2012-08-25 15:22:13.000000000 -0400 -+++ Python-3.3.0rc1/configure.ac 2012-08-27 11:00:36.593962900 -0400 +diff -up Python-3.3.0rc2/configure.ac.systemtap Python-3.3.0rc2/configure.ac +--- Python-3.3.0rc2/configure.ac.systemtap 2012-09-09 05:11:14.000000000 -0400 ++++ Python-3.3.0rc2/configure.ac 2012-09-10 09:17:21.114511781 -0400 @@ -2678,6 +2678,23 @@ if test "$with_valgrind" != no; then OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT" fi @@ -25,9 +25,9 @@ diff -up Python-3.3.0rc1/configure.ac.systemtap Python-3.3.0rc1/configure.ac # -I${DLINCLDIR} is added to the compile rule for importdl.o AC_SUBST(DLINCLDIR) DLINCLDIR=. -diff -up Python-3.3.0rc1/configure.systemtap Python-3.3.0rc1/configure ---- Python-3.3.0rc1/configure.systemtap 2012-08-25 15:22:13.000000000 -0400 -+++ Python-3.3.0rc1/configure 2012-08-27 11:00:36.595962898 -0400 +diff -up Python-3.3.0rc2/configure.systemtap Python-3.3.0rc2/configure +--- Python-3.3.0rc2/configure.systemtap 2012-09-09 05:11:14.000000000 -0400 ++++ Python-3.3.0rc2/configure 2012-09-10 09:17:21.116511780 -0400 @@ -618,6 +618,8 @@ TRUE MACHDEP_OBJS DYNLOADFILE @@ -85,18 +85,18 @@ diff -up Python-3.3.0rc1/configure.systemtap Python-3.3.0rc1/configure # -I${DLINCLDIR} is added to the compile rule for importdl.o DLINCLDIR=. -diff -up Python-3.3.0rc1/Doc/howto/index.rst.systemtap Python-3.3.0rc1/Doc/howto/index.rst ---- Python-3.3.0rc1/Doc/howto/index.rst.systemtap 2012-08-25 15:22:08.000000000 -0400 -+++ Python-3.3.0rc1/Doc/howto/index.rst 2012-08-27 11:00:36.596962898 -0400 +diff -up Python-3.3.0rc2/Doc/howto/index.rst.systemtap Python-3.3.0rc2/Doc/howto/index.rst +--- Python-3.3.0rc2/Doc/howto/index.rst.systemtap 2012-09-09 05:10:51.000000000 -0400 ++++ Python-3.3.0rc2/Doc/howto/index.rst 2012-09-10 09:17:21.117511779 -0400 @@ -29,4 +29,5 @@ Currently, the HOWTOs are: webservers.rst argparse.rst ipaddress.rst + instrumentation.rst -diff -up Python-3.3.0rc1/Doc/howto/instrumentation.rst.systemtap Python-3.3.0rc1/Doc/howto/instrumentation.rst ---- Python-3.3.0rc1/Doc/howto/instrumentation.rst.systemtap 2012-08-27 11:00:36.596962898 -0400 -+++ Python-3.3.0rc1/Doc/howto/instrumentation.rst 2012-08-27 11:00:36.596962898 -0400 +diff -up Python-3.3.0rc2/Doc/howto/instrumentation.rst.systemtap Python-3.3.0rc2/Doc/howto/instrumentation.rst +--- Python-3.3.0rc2/Doc/howto/instrumentation.rst.systemtap 2012-09-10 09:17:21.117511779 -0400 ++++ Python-3.3.0rc2/Doc/howto/instrumentation.rst 2012-09-10 09:17:21.117511779 -0400 @@ -0,0 +1,295 @@ +.. _instrumentation: + @@ -393,9 +393,9 @@ diff -up Python-3.3.0rc1/Doc/howto/instrumentation.rst.systemtap Python-3.3.0rc1 + delete fn_calls; + } + -diff -up Python-3.3.0rc1/Lib/test/test_systemtap.py.systemtap Python-3.3.0rc1/Lib/test/test_systemtap.py ---- Python-3.3.0rc1/Lib/test/test_systemtap.py.systemtap 2012-08-27 11:00:36.596962898 -0400 -+++ Python-3.3.0rc1/Lib/test/test_systemtap.py 2012-08-27 11:00:36.596962898 -0400 +diff -up Python-3.3.0rc2/Lib/test/test_systemtap.py.systemtap Python-3.3.0rc2/Lib/test/test_systemtap.py +--- Python-3.3.0rc2/Lib/test/test_systemtap.py.systemtap 2012-09-10 09:17:21.117511779 -0400 ++++ Python-3.3.0rc2/Lib/test/test_systemtap.py 2012-09-10 09:17:21.117511779 -0400 @@ -0,0 +1,234 @@ +# Verify that systemtap static probes work +# @@ -631,9 +631,9 @@ diff -up Python-3.3.0rc1/Lib/test/test_systemtap.py.systemtap Python-3.3.0rc1/Li + +if __name__ == "__main__": + test_main() -diff -up Python-3.3.0rc1/Makefile.pre.in.systemtap Python-3.3.0rc1/Makefile.pre.in ---- Python-3.3.0rc1/Makefile.pre.in.systemtap 2012-08-25 15:22:11.000000000 -0400 -+++ Python-3.3.0rc1/Makefile.pre.in 2012-08-27 11:08:51.950929030 -0400 +diff -up Python-3.3.0rc2/Makefile.pre.in.systemtap Python-3.3.0rc2/Makefile.pre.in +--- Python-3.3.0rc2/Makefile.pre.in.systemtap 2012-09-09 05:11:05.000000000 -0400 ++++ Python-3.3.0rc2/Makefile.pre.in 2012-09-10 09:19:51.195501518 -0400 @@ -363,6 +363,7 @@ PYTHON_OBJS= \ Python/formatter_unicode.o \ Python/fileutils.o \ @@ -666,18 +666,18 @@ diff -up Python-3.3.0rc1/Makefile.pre.in.systemtap Python-3.3.0rc1/Makefile.pre. ############################################################################ # Header files -@@ -1343,6 +1352,7 @@ clean: pycremoval - -rm -f $(srcdir)/Lib/lib2to3/*Grammar*.pickle +@@ -1345,6 +1354,7 @@ clean: pycremoval + -rm -f Lib/lib2to3/*Grammar*.pickle -rm -f $(SYSCONFIGDATA) -rm -f Modules/_testembed Modules/_freeze_importlib + -rm -f $(srcdir)/Python/pysystemtap.h profile-removal: find . -name '*.gc??' -exec rm -f {} ';' -diff -up Python-3.3.0rc1/Misc/NEWS.systemtap Python-3.3.0rc1/Misc/NEWS ---- Python-3.3.0rc1/Misc/NEWS.systemtap 2012-08-25 15:22:11.000000000 -0400 -+++ Python-3.3.0rc1/Misc/NEWS 2012-08-27 11:00:36.599962901 -0400 -@@ -560,6 +560,11 @@ Core and Builtins +diff -up Python-3.3.0rc2/Misc/NEWS.systemtap Python-3.3.0rc2/Misc/NEWS +--- Python-3.3.0rc2/Misc/NEWS.systemtap 2012-09-09 05:11:05.000000000 -0400 ++++ Python-3.3.0rc2/Misc/NEWS 2012-09-10 09:17:21.120511781 -0400 +@@ -619,6 +619,11 @@ Core and Builtins - Issue #15038: Optimize python Locks on Windows. @@ -689,9 +689,9 @@ diff -up Python-3.3.0rc1/Misc/NEWS.systemtap Python-3.3.0rc1/Misc/NEWS Library ------- -diff -up Python-3.3.0rc1/pyconfig.h.in.systemtap Python-3.3.0rc1/pyconfig.h.in ---- Python-3.3.0rc1/pyconfig.h.in.systemtap 2012-08-25 15:22:13.000000000 -0400 -+++ Python-3.3.0rc1/pyconfig.h.in 2012-08-27 11:00:36.600962901 -0400 +diff -up Python-3.3.0rc2/pyconfig.h.in.systemtap Python-3.3.0rc2/pyconfig.h.in +--- Python-3.3.0rc2/pyconfig.h.in.systemtap 2012-09-09 05:11:14.000000000 -0400 ++++ Python-3.3.0rc2/pyconfig.h.in 2012-09-10 09:17:21.120511781 -0400 @@ -1306,6 +1306,9 @@ /* Define if you want to compile in Python-specific mallocs */ #undef WITH_PYMALLOC @@ -702,9 +702,9 @@ diff -up Python-3.3.0rc1/pyconfig.h.in.systemtap Python-3.3.0rc1/pyconfig.h.in /* Define if you want to compile in rudimentary thread support */ #undef WITH_THREAD -diff -up Python-3.3.0rc1/Python/ceval.c.systemtap Python-3.3.0rc1/Python/ceval.c ---- Python-3.3.0rc1/Python/ceval.c.systemtap 2012-08-25 15:22:12.000000000 -0400 -+++ Python-3.3.0rc1/Python/ceval.c 2012-08-27 11:00:36.600962901 -0400 +diff -up Python-3.3.0rc2/Python/ceval.c.systemtap Python-3.3.0rc2/Python/ceval.c +--- Python-3.3.0rc2/Python/ceval.c.systemtap 2012-09-09 05:11:12.000000000 -0400 ++++ Python-3.3.0rc2/Python/ceval.c 2012-09-10 09:17:21.122511781 -0400 @@ -18,6 +18,8 @@ #include @@ -737,9 +737,9 @@ diff -up Python-3.3.0rc1/Python/ceval.c.systemtap Python-3.3.0rc1/Python/ceval.c Py_LeaveRecursiveCall(); tstate->frame = f->f_back; -diff -up Python-3.3.0rc1/Python/ceval_systemtap.h.systemtap Python-3.3.0rc1/Python/ceval_systemtap.h ---- Python-3.3.0rc1/Python/ceval_systemtap.h.systemtap 2012-08-27 11:00:36.601962901 -0400 -+++ Python-3.3.0rc1/Python/ceval_systemtap.h 2012-08-27 11:00:36.601962901 -0400 +diff -up Python-3.3.0rc2/Python/ceval_systemtap.h.systemtap Python-3.3.0rc2/Python/ceval_systemtap.h +--- Python-3.3.0rc2/Python/ceval_systemtap.h.systemtap 2012-09-10 09:17:21.122511781 -0400 ++++ Python-3.3.0rc2/Python/ceval_systemtap.h 2012-09-10 09:17:21.122511781 -0400 @@ -0,0 +1,86 @@ +/* + Support for SystemTap static markers @@ -827,9 +827,9 @@ diff -up Python-3.3.0rc1/Python/ceval_systemtap.h.systemtap Python-3.3.0rc1/Pyth +#define systemtap_function_return(f) + +#endif -diff -up Python-3.3.0rc1/Python/pysystemtap.d.systemtap Python-3.3.0rc1/Python/pysystemtap.d ---- Python-3.3.0rc1/Python/pysystemtap.d.systemtap 2012-08-27 11:00:36.601962901 -0400 -+++ Python-3.3.0rc1/Python/pysystemtap.d 2012-08-27 11:00:36.601962901 -0400 +diff -up Python-3.3.0rc2/Python/pysystemtap.d.systemtap Python-3.3.0rc2/Python/pysystemtap.d +--- Python-3.3.0rc2/Python/pysystemtap.d.systemtap 2012-09-10 09:17:21.122511781 -0400 ++++ Python-3.3.0rc2/Python/pysystemtap.d 2012-09-10 09:17:21.122511781 -0400 @@ -0,0 +1,4 @@ +provider python { + probe function__entry(const char *, const char *, int, PyFrameObject *); diff --git a/python3.spec b/python3.spec index 9a4e291..14525f4 100644 --- a/python3.spec +++ b/python3.spec @@ -3,7 +3,7 @@ # ====================================================== %global pybasever 3.3 -%global alphatag rc1 +%global alphatag rc2 # pybasever without the dot: %global pyshortver 33 @@ -127,7 +127,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 0.4.%{alphatag}%{?dist} +Release: 0.5.%{alphatag}%{?dist} License: Python Group: Development/Languages @@ -1588,6 +1588,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon Sep 10 2012 David Malcolm - 3.3.0-0.5.rc2 +- 3.3.0rc1 -> 3.3.0rc2; refresh patch 55 + * Mon Aug 27 2012 David Malcolm - 3.3.0-0.4.rc1 - 3.3.0b2 -> 3.3.0rc1; refresh patches 3, 55 diff --git a/sources b/sources index f7514b7..54bc84f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -5b67eb7f471577f8429abf15a2087e7c Python-3.3.0rc1.tar.xz +968af637fe7860ec83e0df4fe5a58590 Python-3.3.0rc2.tar.xz From 3705b6491b278b81d0363a4bcb5266f08bc9d856 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 24 Sep 2012 16:36:40 -0400 Subject: [PATCH 115/416] 3.3.0-0.6.rc3 3.3.0rc2 -> 3.3.0rc3 --- python3.spec | 7 +++++-- sources | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/python3.spec b/python3.spec index 14525f4..ee780be 100644 --- a/python3.spec +++ b/python3.spec @@ -3,7 +3,7 @@ # ====================================================== %global pybasever 3.3 -%global alphatag rc2 +%global alphatag rc3 # pybasever without the dot: %global pyshortver 33 @@ -127,7 +127,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 0.5.%{alphatag}%{?dist} +Release: 0.6.%{alphatag}%{?dist} License: Python Group: Development/Languages @@ -1588,6 +1588,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon Sep 24 2012 David Malcolm - 3.3.0-0.6.rc3 +- 3.3.0rc2 -> 3.3.0rc3 + * Mon Sep 10 2012 David Malcolm - 3.3.0-0.5.rc2 - 3.3.0rc1 -> 3.3.0rc2; refresh patch 55 diff --git a/sources b/sources index 54bc84f..b139ef1 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -968af637fe7860ec83e0df4fe5a58590 Python-3.3.0rc2.tar.xz +796124c4ab8008c21720dcecd5411a41 Python-3.3.0rc3.tar.xz From 513a269422409ff7f19e864cbd628ca2c4395d62 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sat, 29 Sep 2012 17:54:42 -0400 Subject: [PATCH 116/416] 3.3.0 3.3.0rc3 -> 3.3.0; drop alphatag --- python3.spec | 10 ++++++---- sources | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/python3.spec b/python3.spec index ee780be..e02b762 100644 --- a/python3.spec +++ b/python3.spec @@ -3,7 +3,6 @@ # ====================================================== %global pybasever 3.3 -%global alphatag rc3 # pybasever without the dot: %global pyshortver 33 @@ -127,7 +126,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 0.6.%{alphatag}%{?dist} +Release: 1%{?dist} License: Python Group: Development/Languages @@ -187,7 +186,7 @@ BuildRequires: zlib-devel # Source code and patches # ======================= -Source: http://www.python.org/ftp/python/%{version}/Python-%{version}%{alphatag}.tar.xz +Source: http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz # Avoid having various bogus auto-generated Provides lines for the various # python c modules' SONAMEs: @@ -635,7 +634,7 @@ can load its own extensions. # ====================================================== %prep -%setup -q -n Python-%{version}%{alphatag} +%setup -q -n Python-%{version} chmod +x %{SOURCE1} %if 0%{?with_systemtap} @@ -1588,6 +1587,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Sat Sep 29 2012 David Malcolm - 3.3.0-1 +- 3.3.0rc3 -> 3.3.0; drop alphatag + * Mon Sep 24 2012 David Malcolm - 3.3.0-0.6.rc3 - 3.3.0rc2 -> 3.3.0rc3 diff --git a/sources b/sources index b139ef1..3f2585f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -796124c4ab8008c21720dcecd5411a41 Python-3.3.0rc3.tar.xz +2e7533b4009ac4adae62a7797a442e7a Python-3.3.0.tar.xz From 81ac8c85fc5a41f563d2c4aba878708a9425a6be Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 11 Dec 2012 15:42:13 -0500 Subject: [PATCH 117/416] 3.3.0-2: add BR on bluez-libs-devel (rhbz#879720) --- python3.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index e02b762..c0e807b 100644 --- a/python3.spec +++ b/python3.spec @@ -126,7 +126,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 1%{?dist} +Release: 2%{?dist} License: Python Group: Development/Languages @@ -138,6 +138,7 @@ Group: Development/Languages # (keep this list alphabetized) BuildRequires: autoconf +BuildRequires: bluez-libs-devel BuildRequires: bzip2 BuildRequires: bzip2-devel BuildRequires: db4-devel >= 4.7 @@ -1587,6 +1588,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Thu Nov 29 2012 David Malcolm - 3.3.0-2 +- add BR on bluez-libs-devel (rhbz#879720) + * Sat Sep 29 2012 David Malcolm - 3.3.0-1 - 3.3.0rc3 -> 3.3.0; drop alphatag From a2f645393c076a44c71984dd20fe34ea67877b74 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sun, 10 Feb 2013 23:30:34 -0500 Subject: [PATCH 118/416] 3.3.0-3: add aarch64 (rhbz#909783) --- python3.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/python3.spec b/python3.spec index c0e807b..eff865f 100644 --- a/python3.spec +++ b/python3.spec @@ -126,7 +126,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 2%{?dist} +Release: 3%{?dist} License: Python Group: Development/Languages @@ -966,7 +966,7 @@ install -d -m 0755 %{buildroot}/usr/lib/python%{pybasever}/site-packages/__pycac %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} @@ -1125,7 +1125,7 @@ ln -s \ # 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 @@ -1588,6 +1588,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon Feb 11 2013 David Malcolm - 3.3.0-3 +- add aarch64 (rhbz#909783) + * Thu Nov 29 2012 David Malcolm - 3.3.0-2 - add BR on bluez-libs-devel (rhbz#879720) From 19e1adc11eea263c8d8063f44e6c6ce790c345fe Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sun, 3 Mar 2013 20:05:58 -0500 Subject: [PATCH 119/416] 3.3.0-4: remove config flag from /etc/rpm/macros.{python3|pybytecompile} https://fedorahosted.org/fpc/ticket/259 --- python3.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/python3.spec b/python3.spec index eff865f..1ce8cc5 100644 --- a/python3.spec +++ b/python3.spec @@ -126,7 +126,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 3%{?dist} +Release: 4%{?dist} License: Python Group: Development/Languages @@ -1427,8 +1427,8 @@ rm -fr %{buildroot} %{_libdir}/pkgconfig/python-%{LDVERSION_optimized}.pc %{_libdir}/pkgconfig/python-%{pybasever}.pc %{_libdir}/pkgconfig/python3.pc -%config(noreplace) %{_sysconfdir}/rpm/macros.python3 -%config(noreplace) %{_sysconfdir}/rpm/macros.pybytecompile +%{_sysconfdir}/rpm/macros.python3 +%{_sysconfdir}/rpm/macros.pybytecompile %files tools %defattr(-,root,root,755) @@ -1588,6 +1588,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon Mar 4 2013 David Malcolm - 3.3.0-4 +- remove config flag from /etc/rpm/macros.{python3|pybytecompile} + * Mon Feb 11 2013 David Malcolm - 3.3.0-3 - add aarch64 (rhbz#909783) From 260ceea047a1580c1fd10aa3ce84c4ab26d1d81f Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 4 Mar 2013 16:30:51 -0500 Subject: [PATCH 120/416] 3.3.0-5: add workaround for ENOPROTOOPT seen running selftests in Koji (rhbz#913732) * Mon Mar 4 2013 David Malcolm - 3.3.0-5 - add workaround for ENOPROTOOPT seen running selftests in Koji (rhbz#913732) --- ...-workaround-ENOPROTOOPT-in-bind_port.patch | 14 +++++ python3.spec | 60 ++++++++++++++++++- 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 00173-workaround-ENOPROTOOPT-in-bind_port.patch diff --git a/00173-workaround-ENOPROTOOPT-in-bind_port.patch b/00173-workaround-ENOPROTOOPT-in-bind_port.patch new file mode 100644 index 0000000..a62c3a4 --- /dev/null +++ b/00173-workaround-ENOPROTOOPT-in-bind_port.patch @@ -0,0 +1,14 @@ +diff -up Python-3.3.0/Lib/test/support.py.rhbz913732 Python-3.3.0/Lib/test/support.py +--- Python-3.3.0/Lib/test/support.py.rhbz913732 2013-03-04 16:25:53.885258476 -0500 ++++ Python-3.3.0/Lib/test/support.py 2013-03-04 16:25:58.499258157 -0500 +@@ -544,7 +544,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 -up Python-3.3.0/Lib/test/test_support.py.rhbz913732 Python-3.3.0/Lib/test/test_support.py diff --git a/python3.spec b/python3.spec index 1ce8cc5..2950bf2 100644 --- a/python3.spec +++ b/python3.spec @@ -126,7 +126,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 4%{?dist} +Release: 5%{?dist} License: Python Group: Development/Languages @@ -497,6 +497,51 @@ Patch163: 00163-disable-parts-of-test_socket-in-rpm-build.patch # disable those tests so that rebuilds on PPC can continue Patch164: 00164-disable-interrupted_write-tests-on-ppc.patch +# 00165 # +# python.spec has: +# Patch165: 00165-crypt-module-salt-backport.patch +# which is a backport from 3.3 and thus not relevant to "python3" + +# 00166 # +# Patch166: 00166-fix-fake-repr-in-gdb-hooks.patch +# in python.spec +# TODO: python3 status? + +# 00167 # +# Patch167: 00167-disable-stack-navigation-tests-when-optimized-in-test_gdb.patch +# in python.spec +# TODO: python3 status? + +# 00168 # +# Patch168: 00168-distutils-cflags.patch +# in python.spec +# TODO: python3 status? + +# 00169 # +# Patch169: 00169-avoid-implicit-usage-of-md5-in-multiprocessing.patch +# in python.spec +# TODO: python3 status? + +# 00170 # +# Patch170: 00170-gc-assertions.patch +# in python.spec +# TODO: python3 status? + +# 00171 # +# Patch171: 00171-raise-correct-exception-when-dev-urandom-is-missing.patch +# in python.spec +# TODO: python3 status? + +# 00172 # +# Patch172: 00172-use-poll-for-multiprocessing-socket-connection.patch +# in python.spec +# TODO: python3 status? + +# 00173 # +# Workaround for ENOPROTOOPT seen in Koji withi test.support.bind_port() +# (rhbz#913732) +Patch173: 00173-workaround-ENOPROTOOPT-in-bind_port.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora 17 onwards, @@ -734,6 +779,15 @@ done %ifarch ppc %{power64} %patch164 -p1 %endif +#00165: TODO +#00166: TODO +#00167: TODO +#00168: TODO +#00169: TODO +#00170: TODO +#00171: TODO +#00172: TODO +%patch173 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1588,6 +1642,10 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon Mar 4 2013 David Malcolm - 3.3.0-5 +- add workaround for ENOPROTOOPT seen running selftests in Koji +(rhbz#913732) + * Mon Mar 4 2013 David Malcolm - 3.3.0-4 - remove config flag from /etc/rpm/macros.{python3|pybytecompile} From 42e503c07a2243ef6f12ffc5102de3d39019a54c Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Thu, 7 Mar 2013 15:45:58 +0100 Subject: [PATCH 121/416] add ppc64p7 build target, optimized for Power7 --- python3.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 2950bf2..85fbdab 100644 --- a/python3.spec +++ b/python3.spec @@ -126,7 +126,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 5%{?dist} +Release: 6%{?dist} License: Python Group: Development/Languages @@ -805,6 +805,8 @@ sed --in-place \ %patch5000 -p0 -b .autotool-intermediates %endif +# Add target for optimized Power7 binaries: +sed -i -e "s/ppc64-\*/ppc64-\* \| ppc64p7-\*/" config.sub # ====================================================== # Configuring and building the code: @@ -1642,6 +1644,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Thu Mar 07 2013 Karsten Hopp 3.3.0-6 +- add ppc64p7 build target, optimized for Power7 + * Mon Mar 4 2013 David Malcolm - 3.3.0-5 - add workaround for ENOPROTOOPT seen running selftests in Koji (rhbz#913732) From e7214707e2370f5a9083d3bfd29f2e6919682d53 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Thu, 14 Mar 2013 08:18:03 -0700 Subject: [PATCH 122/416] Fix up shared library extension (rhbz#889784) --- python3-upstream-issue16754-so-extension.patch | 11 +++++++++++ python3.spec | 11 ++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 python3-upstream-issue16754-so-extension.patch diff --git a/python3-upstream-issue16754-so-extension.patch b/python3-upstream-issue16754-so-extension.patch new file mode 100644 index 0000000..4af618a --- /dev/null +++ b/python3-upstream-issue16754-so-extension.patch @@ -0,0 +1,11 @@ +--- Python-3.3.0/Lib/distutils/sysconfig.py 2012-09-29 10:00:28.000000000 +0200 ++++ Python-3.3.0/Lib/distutils/sysconfig.py 2012-12-22 20:14:49.661337174 +0100 +@@ -228,7 +228,7 @@ def customize_compiler(compiler): + linker_exe=cc, + archiver=archiver) + +- compiler.shared_lib_extension = so_ext ++ #compiler.shared_lib_extension = so_ext + + + def get_config_h_filename(): diff --git a/python3.spec b/python3.spec index 85fbdab..4c74e0c 100644 --- a/python3.spec +++ b/python3.spec @@ -126,7 +126,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 6%{?dist} +Release: 7%{?dist} License: Python Group: Development/Languages @@ -542,6 +542,11 @@ Patch164: 00164-disable-interrupted_write-tests-on-ppc.patch # (rhbz#913732) Patch173: 00173-workaround-ENOPROTOOPT-in-bind_port.patch +# Potential patch for so extensions being wrong since SOABI in upstream python3. +# http://bugs.python.org/issue16754 +# (rhbz#889784) +Patch174: python3-upstream-issue16754-so-extension.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora 17 onwards, @@ -788,6 +793,7 @@ done #00171: TODO #00172: TODO %patch173 -p1 +%patch174 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1644,6 +1650,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Thu Mar 14 2013 Toshio Kuratomi - .0-7 +- Fix up shared library extension (rhbz#889784) + * Thu Mar 07 2013 Karsten Hopp 3.3.0-6 - add ppc64p7 build target, optimized for Power7 From 7c28d2c61c81676b361ec69972820588e2eeed31 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Fri, 15 Mar 2013 14:25:57 -0700 Subject: [PATCH 123/416] Fix error in platform.platform() when non-ascii byte strings are decoded to unicode (rhbz#922149) --- ...00174-upstream-issue16754-so-extension.patch | 0 00175-platform-unicode.patch | 13 +++++++++++++ python3.spec | 17 +++++++++++++++-- 3 files changed, 28 insertions(+), 2 deletions(-) rename python3-upstream-issue16754-so-extension.patch => 00174-upstream-issue16754-so-extension.patch (100%) create mode 100644 00175-platform-unicode.patch diff --git a/python3-upstream-issue16754-so-extension.patch b/00174-upstream-issue16754-so-extension.patch similarity index 100% rename from python3-upstream-issue16754-so-extension.patch rename to 00174-upstream-issue16754-so-extension.patch diff --git a/00175-platform-unicode.patch b/00175-platform-unicode.patch new file mode 100644 index 0000000..7d847e1 --- /dev/null +++ b/00175-platform-unicode.patch @@ -0,0 +1,13 @@ +Index: Python-3.3.0/Lib/platform.py +=================================================================== +--- Python-3.3.0.orig/Lib/platform.py ++++ Python-3.3.0/Lib/platform.py +@@ -331,7 +331,7 @@ def linux_distribution(distname='', vers + return _dist_try_harder(distname,version,id) + + # Read the first line +- with open('/etc/'+file, 'r') as f: ++ with open('/etc/'+file, 'r', encoding='utf-8', errors='surrogateescape') as f: + firstline = f.readline() + _distname, _version, _id = _parse_release_file(firstline) + diff --git a/python3.spec b/python3.spec index 4c74e0c..78e558d 100644 --- a/python3.spec +++ b/python3.spec @@ -545,7 +545,15 @@ Patch173: 00173-workaround-ENOPROTOOPT-in-bind_port.patch # Potential patch for so extensions being wrong since SOABI in upstream python3. # http://bugs.python.org/issue16754 # (rhbz#889784) -Patch174: python3-upstream-issue16754-so-extension.patch +# Does not affect python2 (python2 does not have compiled extensions with the +# problematic information) +Patch174: 00174-upstream-issue16754-so-extension.patch + +# Patch for potential unicode error when determining OS release names +# http://bugs.python.org/issue17429 +# (rhbz#922149) +# Does not affect python2 (python2 uses a byte string so it doesn't need to decode) +Patch175: 00175-platform-unicode.patch # (New patches go here ^^^) # @@ -794,6 +802,7 @@ done #00172: TODO %patch173 -p1 %patch174 -p1 +%patch175 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1650,7 +1659,11 @@ rm -fr %{buildroot} # ====================================================== %changelog -* Thu Mar 14 2013 Toshio Kuratomi - .0-7 +* Fri Mar 15 2013 Toshio Kuratomi - 3.3.0-8 +- Fix error in platform.platform() when non-ascii byte strings are decoded to + unicode (rhbz#922149) + +* Thu Mar 14 2013 Toshio Kuratomi - 3.3.0-7 - Fix up shared library extension (rhbz#889784) * Thu Mar 07 2013 Karsten Hopp 3.3.0-6 From 76e9a6b729746eb92dc60253c437218271fdf5a1 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Fri, 15 Mar 2013 14:26:38 -0700 Subject: [PATCH 124/416] Bump release and build --- python3.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 78e558d..9f3dcaa 100644 --- a/python3.spec +++ b/python3.spec @@ -126,7 +126,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 7%{?dist} +Release: 8%{?dist} License: Python Group: Development/Languages From ff7dfb66f168e51c37928ac97e6ddd2ed49f1459 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 25 Mar 2013 16:01:59 -0400 Subject: [PATCH 125/416] 3.3.0-9: renumber patches to keep them in sync with python.spec * Mon Mar 25 2013 David Malcolm - 3.3.0-9 - renumber patches to keep them in sync with python.spec Specifically, renumber: 00174 -> 00176 00175 -> 00177 --- ...176-upstream-issue16754-so-extension.patch | 0 ...code.patch => 00177-platform-unicode.patch | 0 python3.spec | 26 +++++++++++++++---- 3 files changed, 21 insertions(+), 5 deletions(-) rename 00174-upstream-issue16754-so-extension.patch => 00176-upstream-issue16754-so-extension.patch (100%) rename 00175-platform-unicode.patch => 00177-platform-unicode.patch (100%) diff --git a/00174-upstream-issue16754-so-extension.patch b/00176-upstream-issue16754-so-extension.patch similarity index 100% rename from 00174-upstream-issue16754-so-extension.patch rename to 00176-upstream-issue16754-so-extension.patch diff --git a/00175-platform-unicode.patch b/00177-platform-unicode.patch similarity index 100% rename from 00175-platform-unicode.patch rename to 00177-platform-unicode.patch diff --git a/python3.spec b/python3.spec index 9f3dcaa..83d11d9 100644 --- a/python3.spec +++ b/python3.spec @@ -126,7 +126,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 8%{?dist} +Release: 9%{?dist} License: Python Group: Development/Languages @@ -542,18 +542,29 @@ Patch164: 00164-disable-interrupted_write-tests-on-ppc.patch # (rhbz#913732) Patch173: 00173-workaround-ENOPROTOOPT-in-bind_port.patch +# 00174 # +# Patch174: 00174-fix-for-usr-move.patch +# TODO: python3 status? + +# 00175 # +# Patch175: 00175-fix-configure-Wformat.patch +# TODO: python3 status? + +# 00176 # # Potential patch for so extensions being wrong since SOABI in upstream python3. # http://bugs.python.org/issue16754 # (rhbz#889784) # Does not affect python2 (python2 does not have compiled extensions with the # problematic information) -Patch174: 00174-upstream-issue16754-so-extension.patch +Patch176: 00176-upstream-issue16754-so-extension.patch +# 00177 # # Patch for potential unicode error when determining OS release names # http://bugs.python.org/issue17429 # (rhbz#922149) # Does not affect python2 (python2 uses a byte string so it doesn't need to decode) -Patch175: 00175-platform-unicode.patch +Patch177: 00177-platform-unicode.patch + # (New patches go here ^^^) # @@ -801,8 +812,10 @@ done #00171: TODO #00172: TODO %patch173 -p1 -%patch174 -p1 -%patch175 -p1 +#00174: TODO +#00175: TODO +%patch176 -p1 +%patch177 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1659,6 +1672,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon Mar 25 2013 David Malcolm - 3.3.0-9 +- renumber patches to keep them in sync with python.spec + * Fri Mar 15 2013 Toshio Kuratomi - 3.3.0-8 - Fix error in platform.platform() when non-ascii byte strings are decoded to unicode (rhbz#922149) From b4d586e1005658bde584c457ea1c34790a298c3a Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 25 Mar 2013 16:12:35 -0400 Subject: [PATCH 126/416] 3.3.0-10: fix gcc 4.8 incompatibility (rhbz#927358) * Mon Mar 25 2013 David Malcolm - 3.3.0-10 - fix gcc 4.8 incompatibility (rhbz#927358); regenerate autotool intermediates --- 00175-fix-configure-Wformat.patch | 12 +++++++++ 05000-autotool-intermediates.patch | 41 ++++++++++++++++++------------ python3.spec | 16 +++++++++--- 3 files changed, 49 insertions(+), 20 deletions(-) create mode 100644 00175-fix-configure-Wformat.patch diff --git a/00175-fix-configure-Wformat.patch b/00175-fix-configure-Wformat.patch new file mode 100644 index 0000000..9f42568 --- /dev/null +++ b/00175-fix-configure-Wformat.patch @@ -0,0 +1,12 @@ +diff -up Python-3.3.0/configure.ac.fix-configure-Wformat Python-3.3.0/configure.ac +--- Python-3.3.0/configure.ac.fix-configure-Wformat 2013-03-25 16:09:09.127667472 -0400 ++++ Python-3.3.0/configure.ac 2013-03-25 16:09:16.442666967 -0400 +@@ -1308,7 +1308,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 bd9aeca..38df469 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-08-07 17:21:25.249311751 -0400 -+++ ./configure 2012-08-07 17:21:35.503311049 -0400 +--- ./configure.autotool-intermediates 2013-03-25 16:11:38.140657282 -0400 ++++ ./configure 2013-03-25 16:11:46.922656680 -0400 @@ -779,6 +779,8 @@ with_thread enable_ipv6 with_doc_strings @@ -19,10 +19,28 @@ diff -up ./configure.autotool-intermediates ./configure --with(out)-pymalloc disable/enable specialized mallocs --with-valgrind Enable Valgrind support --with(out)-systemtap disable/enable SystemTap support -@@ -10017,6 +10021,50 @@ $as_echo "no" >&6; } - fi +@@ -6471,7 +6475,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. */ +@@ -10008,6 +10012,50 @@ $as_echo "#define WITH_TSC 1" >>confdefs + { $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-count-allocs" >&5 +$as_echo_n "checking for --with-count-allocs... " >&6; } + @@ -58,16 +76,7 @@ diff -up ./configure.autotool-intermediates ./configure + + { $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; } + else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + $as_echo "no" >&6; } + fi diff -up ./pyconfig.h.in.autotool-intermediates ./pyconfig.h.in diff --git a/python3.spec b/python3.spec index 83d11d9..93e7a3f 100644 --- a/python3.spec +++ b/python3.spec @@ -126,7 +126,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 9%{?dist} +Release: 10%{?dist} License: Python Group: Development/Languages @@ -547,8 +547,13 @@ Patch173: 00173-workaround-ENOPROTOOPT-in-bind_port.patch # TODO: python3 status? # 00175 # -# Patch175: 00175-fix-configure-Wformat.patch -# TODO: python3 status? +# 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 # 00176 # # Potential patch for so extensions being wrong since SOABI in upstream python3. @@ -813,7 +818,7 @@ done #00172: TODO %patch173 -p1 #00174: TODO -#00175: TODO +%patch175 -p1 %patch176 -p1 %patch177 -p1 @@ -1672,6 +1677,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon Mar 25 2013 David Malcolm - 3.3.0-10 +- fix gcc 4.8 incompatibility (rhbz#927358); regenerate autotool intermediates + * Mon Mar 25 2013 David Malcolm - 3.3.0-9 - renumber patches to keep them in sync with python.spec From 58f477b403222ea6c13d5d7358551b606cddc0f8 Mon Sep 17 00:00:00 2001 From: Bohuslav Kabrda Date: Wed, 10 Apr 2013 14:30:09 +0200 Subject: [PATCH 127/416] Updated to Python 3.3.1. - Refreshed patches: 55 (systemtap), 111 (no static lib), 146 (hashlib fips), 153 (fix test_gdb noise), 157 (uid, gid overflow - fixed upstream, just keeping few more downstream tests) - Removed patches: 3 (audiotest.au made it to upstream tarball) - Removed workaround for http://bugs.python.org/issue14774, discussed in http://bugs.python.org/issue15298 and fixed in revision 24d52d3060e8. --- 00055-systemtap.patch | 6 +- 00111-no-static-lib.patch | 4 +- 00146-hashlib-fips.patch | 17 +- 00153-fix-test_gdb-noise.patch | 7 +- 00157-uid-gid-overflows.patch | 638 +----------------- 00178-dont-duplicate-flags-in-sysconfig.patch | 30 + 05000-autotool-intermediates.patch | 24 +- python3.spec | 60 +- sources | 2 +- 9 files changed, 98 insertions(+), 690 deletions(-) create mode 100644 00178-dont-duplicate-flags-in-sysconfig.patch diff --git a/00055-systemtap.patch b/00055-systemtap.patch index 577538a..90b876b 100644 --- a/00055-systemtap.patch +++ b/00055-systemtap.patch @@ -653,8 +653,8 @@ diff -up Python-3.3.0rc2/Makefile.pre.in.systemtap Python-3.3.0rc2/Makefile.pre. Python/formatter_unicode.o: $(srcdir)/Python/formatter_unicode.c \ $(BYTESTR_DEPS) @@ -724,6 +726,13 @@ Objects/typeobject.o: $(srcdir)/Objects/ - $(srcdir)/Objects/typeslots.inc: $(srcdir)/Include/typeslots.h $(srcdir)/Objects/typeslots.py - $(PYTHON) $(srcdir)/Objects/typeslots.py < $(srcdir)/Include/typeslots.h > $(srcdir)/Objects/typeslots.inc + Objects/typeslots.inc: $(srcdir)/Include/typeslots.h $(srcdir)/Objects/typeslots.py + $(PYTHON) $(srcdir)/Objects/typeslots.py < $(srcdir)/Include/typeslots.h > Objects/typeslots.inc +# Only needed with --with-systemtap; not a public header: +$(srcdir)/Python/pysystemtap.h: $(srcdir)/Python/pysystemtap.d @@ -667,8 +667,8 @@ diff -up Python-3.3.0rc2/Makefile.pre.in.systemtap Python-3.3.0rc2/Makefile.pre. # Header files @@ -1345,6 +1354,7 @@ clean: pycremoval + -rm -f pybuilddir.txt -rm -f Lib/lib2to3/*Grammar*.pickle - -rm -f $(SYSCONFIGDATA) -rm -f Modules/_testembed Modules/_freeze_importlib + -rm -f $(srcdir)/Python/pysystemtap.h diff --git a/00111-no-static-lib.patch b/00111-no-static-lib.patch index 91b24b8..bd63852 100644 --- a/00111-no-static-lib.patch +++ b/00111-no-static-lib.patch @@ -9,7 +9,7 @@ diff -up cpython-59223da36dec/Makefile.pre.in.no-static-lib cpython-59223da36dec +$(BUILDPYTHON): Modules/python.o $(LDLIBRARY) $(PY3LIBRARY) $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Modules/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) - platform: $(BUILDPYTHON) $(SYSCONFIGDATA) + platform: $(BUILDPYTHON) pybuilddir.txt @@ -480,18 +480,6 @@ sharedmods: $(BUILDPYTHON) $(SYSCONFIGDA $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build @@ -44,7 +44,7 @@ diff -up cpython-59223da36dec/Makefile.pre.in.no-static-lib cpython-59223da36dec done - @if test -d $(LIBRARY); then :; else \ - if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \ -- if test "$(SO)" = .dll; then \ +- if test "$(SHLIB_SUFFIX)" = .dll; then \ - $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \ - else \ - $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \ diff --git a/00146-hashlib-fips.patch b/00146-hashlib-fips.patch index da83205..f22d9bd 100644 --- a/00146-hashlib-fips.patch +++ b/00146-hashlib-fips.patch @@ -285,7 +285,7 @@ diff -up Python-3.2.2/Modules/_hashopenssl.c.hashlib-fips Python-3.2.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) \ @@ -444,7 +444,7 @@ diff -up Python-3.2.2/Modules/_hashopenssl.c.hashlib-fips Python-3.2.2/Modules/_ if (data_obj) PyBuffer_Release(&view); -@@ -547,55 +620,115 @@ generate_hash_name_list(void) +@@ -547,58 +620,115 @@ generate_hash_name_list(void) /* @@ -550,12 +550,15 @@ diff -up Python-3.2.2/Modules/_hashopenssl.c.hashlib-fips Python-3.2.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 { \ -- CONST_ ## NAME ## _name_obj = PyUnicode_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 (CONST_ ## NAME ## _name_obj == NULL) { \ +- CONST_ ## NAME ## _name_obj = PyUnicode_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)); \ +- } \ - } \ -} while (0); +/* diff --git a/00153-fix-test_gdb-noise.patch b/00153-fix-test_gdb-noise.patch index cc9ed8c..c65787f 100644 --- a/00153-fix-test_gdb-noise.patch +++ b/00153-fix-test_gdb-noise.patch @@ -18,10 +18,9 @@ diff -up cpython-59223da36dec/Lib/test/test_gdb.py.fix-test_gdb-noise cpython-59 if cmds_after_breakpoint: commands += cmds_after_breakpoint @@ -154,8 +163,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() + if not line.startswith('warning: Unable to open') @@ -29,7 +28,7 @@ diff -up cpython-59223da36dec/Lib/test/test_gdb.py.fix-test_gdb-noise cpython-59 + 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, '') diff --git a/00157-uid-gid-overflows.patch b/00157-uid-gid-overflows.patch index ab4cb0c..0f48df5 100644 --- a/00157-uid-gid-overflows.patch +++ b/00157-uid-gid-overflows.patch @@ -1,32 +1,3 @@ -diff -up Python-3.3.0b1/Include/modsupport.h.uid-gid-overflows Python-3.3.0b1/Include/modsupport.h ---- Python-3.3.0b1/Include/modsupport.h.uid-gid-overflows 2012-06-26 16:19:40.000000000 -0400 -+++ Python-3.3.0b1/Include/modsupport.h 2012-07-20 14:21:46.854688763 -0400 -@@ -8,6 +8,7 @@ extern "C" { - /* Module support interface */ - - #include -+#include - - /* If PY_SSIZE_T_CLEAN is defined, each functions treats #-specifier - to mean Py_ssize_t */ -@@ -125,6 +126,17 @@ PyAPI_FUNC(PyObject *) PyModule_Create2( - PyAPI_DATA(char *) _Py_PackageContext; - #endif - -+/* -+ 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-3.3.0b1/Lib/test/test_os.py.uid-gid-overflows Python-3.3.0b1/Lib/test/test_os.py --- Python-3.3.0b1/Lib/test/test_os.py.uid-gid-overflows 2012-06-26 16:19:48.000000000 -0400 +++ Python-3.3.0b1/Lib/test/test_os.py 2012-07-20 14:21:46.856688739 -0400 @@ -39,7 +10,7 @@ diff -up Python-3.3.0b1/Lib/test/test_os.py.uid-gid-overflows Python-3.3.0b1/Lib if hasattr(os, 'setgid'): def test_setgid(self): - if os.getuid() != 0: + if os.getuid() != 0 and not HAVE_WHEEL_GROUP: self.assertRaises(os.error, os.setgid, 0) + self.assertRaises(TypeError, os.setgid, 'not an int') self.assertRaises(OverflowError, os.setgid, 1<<32) @@ -53,7 +24,7 @@ diff -up Python-3.3.0b1/Lib/test/test_os.py.uid-gid-overflows Python-3.3.0b1/Lib if hasattr(os, 'setegid'): def test_setegid(self): - if os.getuid() != 0: + if os.getuid() != 0 and not HAVE_WHEEL_GROUP: self.assertRaises(os.error, os.setegid, 0) + self.assertRaises(TypeError, os.setegid, 'not an int') self.assertRaises(OverflowError, os.setegid, 1<<32) @@ -69,62 +40,13 @@ diff -up Python-3.3.0b1/Lib/test/test_os.py.uid-gid-overflows Python-3.3.0b1/Lib @@ -1212,6 +1218,8 @@ if sys.platform != 'win32': def test_setregid(self): - if os.getuid() != 0: + if os.getuid() != 0 and not HAVE_WHEEL_GROUP: 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-3.3.0b1/Lib/test/test_posix.py.uid-gid-overflows Python-3.3.0b1/Lib/test/test_posix.py ---- Python-3.3.0b1/Lib/test/test_posix.py.uid-gid-overflows 2012-06-26 16:19:48.000000000 -0400 -+++ Python-3.3.0b1/Lib/test/test_posix.py 2012-07-20 14:21:46.857688726 -0400 -@@ -387,10 +387,17 @@ class PosixTester(unittest.TestCase): - else: - self.assertTrue(stat.S_ISFIFO(posix.stat(support.TESTFN).st_mode)) - -- 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.""" - # 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()) - - if os.getuid() == 0: - try: -@@ -421,7 +428,7 @@ class PosixTester(unittest.TestCase): - - # re-create the file - support.create_empty_file(support.TESTFN) -- self._test_all_chown_common(posix.chown, support.TESTFN) -+ self._test_all_chown_common(posix.chown, posix.stat, support.TESTFN) - - @unittest.skipUnless(hasattr(posix, 'fchown'), "test needs os.fchown()") - def test_fchown(self): -@@ -431,7 +438,7 @@ class PosixTester(unittest.TestCase): - test_file = open(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() - -@@ -440,7 +447,7 @@ class PosixTester(unittest.TestCase): - os.unlink(support.TESTFN) - # create a symlink - os.symlink(_DUMMY_SYMLINK, support.TESTFN) -- self._test_all_chown_common(posix.lchown, support.TESTFN) -+ self._test_all_chown_common(posix.lchown, posix.lstat, support.TESTFN) - - def test_chdir(self): - if hasattr(posix, 'chdir'): diff -up Python-3.3.0b1/Lib/test/test_pwd.py.uid-gid-overflows Python-3.3.0b1/Lib/test/test_pwd.py --- Python-3.3.0b1/Lib/test/test_pwd.py.uid-gid-overflows 2012-06-26 16:19:48.000000000 -0400 +++ Python-3.3.0b1/Lib/test/test_pwd.py 2012-07-20 14:21:46.857688726 -0400 @@ -140,557 +62,3 @@ diff -up Python-3.3.0b1/Lib/test/test_pwd.py.uid-gid-overflows Python-3.3.0b1/Li self.assertNotIn(fakeuid, byuids) self.assertRaises(KeyError, pwd.getpwuid, fakeuid) -diff -up Python-3.3.0b1/Modules/grpmodule.c.uid-gid-overflows Python-3.3.0b1/Modules/grpmodule.c ---- Python-3.3.0b1/Modules/grpmodule.c.uid-gid-overflows 2012-06-26 16:19:54.000000000 -0400 -+++ Python-3.3.0b1/Modules/grpmodule.c 2012-07-20 14:21:46.858688713 -0400 -@@ -69,7 +69,7 @@ mkgrent(struct group *p) - Py_INCREF(Py_None); - } - #endif -- SET(setIndex++, PyLong_FromLong((long) p->gr_gid)); -+ SET(setIndex++, _PyObject_FromGid(p->gr_gid)); - SET(setIndex++, w); - #undef SET - -@@ -84,18 +84,16 @@ 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_Long(pyo_id); -- if (!py_int_id) -- return NULL; -- gid = PyLong_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-3.3.0b1/Modules/posixmodule.c.uid-gid-overflows Python-3.3.0b1/Modules/posixmodule.c ---- Python-3.3.0b1/Modules/posixmodule.c.uid-gid-overflows 2012-07-20 14:21:46.788689588 -0400 -+++ Python-3.3.0b1/Modules/posixmodule.c 2012-07-20 14:24:19.626778849 -0400 -@@ -2151,8 +2151,8 @@ _pystat_fromstructstat(STRUCT_STAT *st) - PyStructSequence_SET_ITEM(v, 2, PyLong_FromLong((long)st->st_dev)); - #endif - PyStructSequence_SET_ITEM(v, 3, PyLong_FromLong((long)st->st_nlink)); -- PyStructSequence_SET_ITEM(v, 4, PyLong_FromLong((long)st->st_uid)); -- PyStructSequence_SET_ITEM(v, 5, PyLong_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)); -@@ -2957,7 +2957,6 @@ static PyObject * - posix_chown(PyObject *self, PyObject *args, PyObject *kwargs) - { - path_t path; -- long uid_l, gid_l; - uid_t uid; - gid_t gid; - int dir_fd = DEFAULT_DIR_FD; -@@ -2971,9 +2970,10 @@ posix_chown(PyObject *self, PyObject *ar - #ifdef HAVE_FCHOWN - path.allow_fd = 1; - #endif -- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&ll|$O&p:chown", keywords, -+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&O&O&|$O&p:chown", keywords, - path_converter, &path, -- &uid_l, &gid_l, -+ _PyArg_ParseUid, &uid, -+ _PyArg_ParseGid, &gid, - #ifdef HAVE_FCHOWNAT - dir_fd_converter, &dir_fd, - #else -@@ -3004,8 +3004,6 @@ posix_chown(PyObject *self, PyObject *ar - #endif - - Py_BEGIN_ALLOW_THREADS -- uid = (uid_t)uid_l; -- gid = (uid_t)gid_l; - #ifdef HAVE_FCHOWN - if (path.fd != -1) - result = fchown(path.fd, uid, gid); -@@ -3049,12 +3047,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:fchown", &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(); -@@ -3074,15 +3075,17 @@ posix_lchown(PyObject *self, PyObject *a - { - PyObject *opath; - char *path; -- long uid, gid; -+ uid_t uid; -+ gid_t gid; - int res; -- if (!PyArg_ParseTuple(args, "O&ll:lchown", -+ if (!PyArg_ParseTuple(args, "O&O&O&:lchown", - PyUnicode_FSConverter, &opath, -- &uid, &gid)) -+ _PyArg_ParseUid, &uid, -+ _PyArg_ParseGid, &gid)) - return NULL; - path = PyBytes_AsString(opath); - 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(opath); -@@ -6184,7 +6187,7 @@ Return the current process's effective g - static PyObject * - posix_getegid(PyObject *self, PyObject *noargs) - { -- return PyLong_FromLong((long)getegid()); -+ return _PyObject_FromGid(getegid()); - } - #endif - -@@ -6197,7 +6200,7 @@ Return the current process's effective u - static PyObject * - posix_geteuid(PyObject *self, PyObject *noargs) - { -- return PyLong_FromLong((long)geteuid()); -+ return _PyObject_FromUid(geteuid()); - } - #endif - -@@ -6210,7 +6213,7 @@ Return the current process's group id.") - static PyObject * - posix_getgid(PyObject *self, PyObject *noargs) - { -- return PyLong_FromLong((long)getgid()); -+ return _PyObject_FromGid(getgid()); - } - #endif - -@@ -6349,7 +6352,7 @@ posix_getgroups(PyObject *self, PyObject - if (result != NULL) { - int i; - for (i = 0; i < n; ++i) { -- PyObject *o = PyLong_FromLong((long)alt_grouplist[i]); -+ PyObject *o = _PyObject_FromGid(alt_grouplist[i]); - if (o == NULL) { - Py_DECREF(result); - result = NULL; -@@ -6380,14 +6383,15 @@ posix_initgroups(PyObject *self, PyObjec - PyObject *oname; - char *username; - int res; -- long gid; -+ gid_t gid; - -- if (!PyArg_ParseTuple(args, "O&l:initgroups", -- PyUnicode_FSConverter, &oname, &gid)) -+ if (!PyArg_ParseTuple(args, "O&O&:initgroups", -+ PyUnicode_FSConverter, &oname, -+ _PyArg_ParseGid, &gid)) - return NULL; - username = PyBytes_AS_STRING(oname); - -- res = initgroups(username, (gid_t) gid); -+ res = initgroups(username, gid); - Py_DECREF(oname); - if (res == -1) - return PyErr_SetFromErrno(PyExc_OSError); -@@ -6562,7 +6566,7 @@ Return the current process's user id."); - static PyObject * - posix_getuid(PyObject *self, PyObject *noargs) - { -- return PyLong_FromLong((long)getuid()); -+ return _PyObject_FromUid(getuid()); - } - #endif - -@@ -6702,15 +6706,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)) -- return NULL; -- uid = uid_arg; -- if (uid != uid_arg) { -- PyErr_SetString(PyExc_OverflowError, "user id too big"); -+ if (!PyArg_ParseTuple(args, "O&:setuid", _PyArg_ParseUid, &uid)) - return NULL; -- } - if (setuid(uid) < 0) - return posix_error(); - Py_INCREF(Py_None); -@@ -6727,15 +6725,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 { -@@ -6753,15 +6745,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)) -- return NULL; -- egid = egid_arg; -- if (egid != egid_arg) { -- PyErr_SetString(PyExc_OverflowError, "group id too big"); -+ if (!PyArg_ParseTuple(args, "O&:setegid", _PyArg_ParseGid, &egid)) - return NULL; -- } - if (setegid(egid) < 0) { - return posix_error(); - } else { -@@ -6779,23 +6765,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)) -- 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"); -+ if (!PyArg_ParseTuple(args, "O&O&", -+ _PyArg_ParseUid, &ruid, -+ _PyArg_ParseUid, &euid)) - return NULL; -- } - if (setreuid(ruid, euid) < 0) { - return posix_error(); - } else { -@@ -6813,23 +6787,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)) -- 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"); -+ if (!PyArg_ParseTuple(args, "O&O&", -+ _PyArg_ParseGid, &rgid, -+ _PyArg_ParseGid, &egid)) - return NULL; -- } - if (setregid(rgid, egid) < 0) { - return posix_error(); - } else { -@@ -6847,15 +6809,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)) -+ if (!PyArg_ParseTuple(args, "O&:setgid", _PyArg_ParseGid, &gid)) - return NULL; -- gid = gid_arg; -- if (gid != gid_arg) { -- PyErr_SetString(PyExc_OverflowError, "group id too big"); -- return NULL; -- } - if (setgid(gid) < 0) - return posix_error(); - Py_INCREF(Py_None); -@@ -6888,27 +6844,9 @@ posix_setgroups(PyObject *self, PyObject - elem = PySequence_GetItem(groups, i); - if (!elem) - return NULL; -- if (!PyLong_Check(elem)) { -- PyErr_SetString(PyExc_TypeError, -- "groups must be integers"); -+ if (!_PyArg_ParseGid(elem, &grouplist[i])) { - 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 the value to see if it fitted in gid_t */ -- if (grouplist[i] != x) { -- PyErr_SetString(PyExc_TypeError, -- "group id too big"); -- Py_DECREF(elem); -- return NULL; -- } - } - Py_DECREF(elem); - } -@@ -10388,9 +10326,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(); -@@ -10406,9 +10346,11 @@ 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(); -@@ -10425,14 +10367,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 - -@@ -10445,14 +10386,13 @@ static PyObject* - posix_getresgid (PyObject *self, PyObject *noargs) - { - uid_t rgid, egid, sgid; -- long l_rgid, l_egid, l_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-3.3.0b1/Modules/pwdmodule.c.uid-gid-overflows Python-3.3.0b1/Modules/pwdmodule.c ---- Python-3.3.0b1/Modules/pwdmodule.c.uid-gid-overflows 2012-06-26 16:19:54.000000000 -0400 -+++ Python-3.3.0b1/Modules/pwdmodule.c 2012-07-20 14:21:46.861688675 -0400 -@@ -74,8 +74,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 -@@ -104,13 +104,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-3.3.0b1/Python/getargs.c.uid-gid-overflows Python-3.3.0b1/Python/getargs.c ---- Python-3.3.0b1/Python/getargs.c.uid-gid-overflows 2012-06-26 16:19:57.000000000 -0400 -+++ Python-3.3.0b1/Python/getargs.c 2012-07-20 14:21:46.861688675 -0400 -@@ -4,6 +4,7 @@ - #include "Python.h" - - #include -+#include - - - #ifdef __cplusplus -@@ -1807,6 +1808,102 @@ _PyArg_NoKeywords(const char *funcname, - funcname); - return 0; - } -+ -+PyObject * -+_PyObject_FromUid(uid_t uid) -+{ -+ return PyLong_FromUnsignedLong((uid_t)uid); -+} -+ -+PyObject * -+_PyObject_FromGid(gid_t gid) -+{ -+ 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/00178-dont-duplicate-flags-in-sysconfig.patch b/00178-dont-duplicate-flags-in-sysconfig.patch new file mode 100644 index 0000000..fc49b30 --- /dev/null +++ b/00178-dont-duplicate-flags-in-sysconfig.patch @@ -0,0 +1,30 @@ +diff -r 39b9b05c3085 Lib/distutils/sysconfig.py +--- a/Lib/distutils/sysconfig.py Wed Apr 10 00:27:23 2013 +0200 ++++ b/Lib/distutils/sysconfig.py Wed Apr 10 10:14:18 2013 +0200 +@@ -362,7 +362,10 @@ + done[n] = item = "" + if found: + after = value[m.end():] +- value = value[:m.start()] + item + after ++ value = value[:m.start()] ++ if item.strip() not in value: ++ value += item ++ value += after + if "$" in after: + notdone[name] = value + else: +diff -r 39b9b05c3085 Lib/sysconfig.py +--- a/Lib/sysconfig.py Wed Apr 10 00:27:23 2013 +0200 ++++ b/Lib/sysconfig.py Wed Apr 10 10:14:18 2013 +0200 +@@ -296,7 +296,10 @@ + + if found: + after = value[m.end():] +- value = value[:m.start()] + item + after ++ value = value[:m.start()] ++ if item.strip() not in value: ++ value += item ++ value += after + if "$" in after: + notdone[name] = value + else: diff --git a/05000-autotool-intermediates.patch b/05000-autotool-intermediates.patch index 38df469..1a0c3c6 100644 --- a/05000-autotool-intermediates.patch +++ b/05000-autotool-intermediates.patch @@ -1,7 +1,7 @@ diff -up ./configure.autotool-intermediates ./configure ---- ./configure.autotool-intermediates 2013-03-25 16:11:38.140657282 -0400 -+++ ./configure 2013-03-25 16:11:46.922656680 -0400 -@@ -779,6 +779,8 @@ with_thread +--- ./configure.autotool-intermediates 2013-04-09 14:52:49.831773426 +0200 ++++ ./configure 2013-04-09 14:52:53.204765347 +0200 +@@ -802,6 +802,8 @@ with_thread enable_ipv6 with_doc_strings with_tsc @@ -10,7 +10,7 @@ diff -up ./configure.autotool-intermediates ./configure with_pymalloc with_valgrind with_systemtap -@@ -1457,6 +1459,8 @@ Optional Packages: +@@ -1479,6 +1481,8 @@ Optional Packages: deprecated; use --with(out)-threads --with(out)-doc-strings disable/enable documentation strings --with(out)-tsc enable/disable timestamp counter profile @@ -19,7 +19,7 @@ diff -up ./configure.autotool-intermediates ./configure --with(out)-pymalloc disable/enable specialized mallocs --with-valgrind Enable Valgrind support --with(out)-systemtap disable/enable SystemTap support -@@ -6471,7 +6475,7 @@ then +@@ -6529,7 +6533,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 @@ -28,7 +28,7 @@ diff -up ./configure.autotool-intermediates ./configure cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -@@ -10008,6 +10012,50 @@ $as_echo "#define WITH_TSC 1" >>confdefs +@@ -10117,6 +10121,50 @@ $as_echo "#define WITH_TSC 1" >>confdefs { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -80,3 +80,15 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo "no" >&6; } fi diff -up ./pyconfig.h.in.autotool-intermediates ./pyconfig.h.in +--- ./pyconfig.h.in.autotool-intermediates 2013-04-09 14:52:49.829773431 +0200 ++++ ./pyconfig.h.in 2013-04-09 14:52:53.488764667 +0200 +@@ -1193,9 +1193,6 @@ + /* Define if setpgrp() must be called as setpgrp(0, 0). */ + #undef SETPGRP_HAVE_ARG + +-/* Define this to be extension of shared libraries (including the dot!). */ +-#undef SHLIB_EXT +- + /* Define if i>>j for signed int i does not extend the sign bit when i < 0 */ + #undef SIGNED_RIGHT_SHIFT_ZERO_FILLS + diff --git a/python3.spec b/python3.spec index 93e7a3f..307a3d7 100644 --- a/python3.spec +++ b/python3.spec @@ -125,8 +125,8 @@ # ================== Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 -Version: %{pybasever}.0 -Release: 10%{?dist} +Version: %{pybasever}.1 +Release: 1%{?dist} License: Python Group: Development/Languages @@ -222,9 +222,9 @@ Source7: pyfuntop.stp # Was Patch0 in ivazquez' python3000 specfile: Patch1: Python-3.1.1-rpath.patch -# The four TestMIMEAudio tests fail due to "audiotest.au" not being packaged. -# It's simplest to remove them: -Patch3: 00003-remove-mimeaudio-tests.patch +# Some tests were removed due to audiotest.au not being packaged. This was +# however added to the archive in 3.3.1, so we no longer delete the tests. +# Patch3: 00003-remove-mimeaudio-tests.patch # 00055 # # Systemtap support: add statically-defined probe points @@ -462,9 +462,7 @@ Patch156: 00156-gdb-autoload-safepath.patch Patch157: 00157-uid-gid-overflows.patch # 00158 # -# Patch158: 00158-fix-hashlib-leak.patch -# in python.spec -# TODO: python3 status? +# Upstream as of Python 3.3.1 # 00159 # # Patch159: 00159-correct-libdb-include-path.patch @@ -528,13 +526,13 @@ Patch164: 00164-disable-interrupted_write-tests-on-ppc.patch # TODO: python3 status? # 00171 # +# python.spec had: # Patch171: 00171-raise-correct-exception-when-dev-urandom-is-missing.patch -# in python.spec # TODO: python3 status? # 00172 # +# python.spec had: # Patch172: 00172-use-poll-for-multiprocessing-socket-connection.patch -# in python.spec # TODO: python3 status? # 00173 # @@ -556,12 +554,8 @@ Patch173: 00173-workaround-ENOPROTOOPT-in-bind_port.patch Patch175: 00175-fix-configure-Wformat.patch # 00176 # -# Potential patch for so extensions being wrong since SOABI in upstream python3. -# http://bugs.python.org/issue16754 -# (rhbz#889784) -# Does not affect python2 (python2 does not have compiled extensions with the -# problematic information) -Patch176: 00176-upstream-issue16754-so-extension.patch +# Fixed upstream as of Python 3.3.1 +# Patch176: 00176-upstream-issue16754-so-extension.patch # 00177 # # Patch for potential unicode error when determining OS release names @@ -570,6 +564,11 @@ Patch176: 00176-upstream-issue16754-so-extension.patch # Does not affect python2 (python2 uses a byte string so it doesn't need to decode) Patch177: 00177-platform-unicode.patch +# 00178 # +# Don't duplicate various FLAGS in sysconfig values +# http://bugs.python.org/issue17679 +# Does not affect python2 AFAICS (different sysconfig values initialization) +Patch178: 00178-dont-duplicate-flags-in-sysconfig.patch # (New patches go here ^^^) # @@ -744,7 +743,7 @@ done # Apply patches: # %patch1 -p1 -%patch3 -p1 -b .remove-mimeaudio-tests +# 3: upstream as of Python 3.3.1 %if 0%{?with_systemtap} %patch55 -p1 -b .systemtap @@ -819,8 +818,9 @@ done %patch173 -p1 #00174: TODO %patch175 -p1 -%patch176 -p1 +# 00176: upstream as of Python 3.3.1 %patch177 -p1 +%patch178 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -868,7 +868,7 @@ for f in pyconfig.h.in configure ; do done # Rerun the autotools: -PATH=~/autoconf-2.65/bin:$PATH autoreconf +autoreconf # Regenerate the patch: gendiff . .autotool-intermediates > %{PATCH5000} @@ -969,12 +969,6 @@ InstallPython() { pushd $ConfDir - # Workaround for http://bugs.python.org/issue14774 : Lib/_sysconfigdata.py - # is in the srcdir but contains per-config data. - # Regenerate it each time: - rm -f ../../Lib/_sysconfigdata.py - make $topdir/Lib/_sysconfigdata.py - make install DESTDIR=%{buildroot} INSTALL="install -p" popd @@ -1256,13 +1250,6 @@ CheckPython() { # Note that we're running the tests using the version of the code in the # builddir, not in the buildroot. - # Workaround for http://bugs.python.org/issue14774, as per the install - # stanza (albeit from a different directory): - rm -f Lib/_sysconfigdata.py - pushd $ConfDir - make $topdir/Lib/_sysconfigdata.py - popd - # 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) @@ -1677,6 +1664,15 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Tue Apr 09 2013 Bohuslav Kabrda - 3.3.1-1 +- Updated to Python 3.3.1. +- Refreshed patches: 55 (systemtap), 111 (no static lib), 146 (hashlib fips), +153 (fix test_gdb noise), 157 (uid, gid overflow - fixed upstream, just +keeping few more downstream tests) +- Removed patches: 3 (audiotest.au made it to upstream tarball) +- Removed workaround for http://bugs.python.org/issue14774, discussed in +http://bugs.python.org/issue15298 and fixed in revision 24d52d3060e8. + * Mon Mar 25 2013 David Malcolm - 3.3.0-10 - fix gcc 4.8 incompatibility (rhbz#927358); regenerate autotool intermediates diff --git a/sources b/sources index 3f2585f..b8490ab 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -2e7533b4009ac4adae62a7797a442e7a Python-3.3.0.tar.xz +993232d9f4d9b4863cc1ec69a792e9cd Python-3.3.1.tar.xz From 50232369f6457c004e0390c1d3a18b826a96c9a9 Mon Sep 17 00:00:00 2001 From: Bohuslav Kabrda Date: Wed, 10 Apr 2013 14:30:09 +0200 Subject: [PATCH 128/416] Updated to Python 3.3.1. - Refreshed patches: 55 (systemtap), 111 (no static lib), 146 (hashlib fips), 153 (fix test_gdb noise), 157 (uid, gid overflow - fixed upstream, just keeping few more downstream tests) - Removed patches: 3 (audiotest.au made it to upstream tarball) - Removed workaround for http://bugs.python.org/issue14774, discussed in http://bugs.python.org/issue15298 and fixed in revision 24d52d3060e8. --- 00055-systemtap.patch | 6 +- 00111-no-static-lib.patch | 4 +- 00146-hashlib-fips.patch | 17 +- 00153-fix-test_gdb-noise.patch | 7 +- 00157-uid-gid-overflows.patch | 638 +----------------- 00178-dont-duplicate-flags-in-sysconfig.patch | 30 + 05000-autotool-intermediates.patch | 24 +- python3.spec | 60 +- sources | 2 +- 9 files changed, 98 insertions(+), 690 deletions(-) create mode 100644 00178-dont-duplicate-flags-in-sysconfig.patch diff --git a/00055-systemtap.patch b/00055-systemtap.patch index 577538a..90b876b 100644 --- a/00055-systemtap.patch +++ b/00055-systemtap.patch @@ -653,8 +653,8 @@ diff -up Python-3.3.0rc2/Makefile.pre.in.systemtap Python-3.3.0rc2/Makefile.pre. Python/formatter_unicode.o: $(srcdir)/Python/formatter_unicode.c \ $(BYTESTR_DEPS) @@ -724,6 +726,13 @@ Objects/typeobject.o: $(srcdir)/Objects/ - $(srcdir)/Objects/typeslots.inc: $(srcdir)/Include/typeslots.h $(srcdir)/Objects/typeslots.py - $(PYTHON) $(srcdir)/Objects/typeslots.py < $(srcdir)/Include/typeslots.h > $(srcdir)/Objects/typeslots.inc + Objects/typeslots.inc: $(srcdir)/Include/typeslots.h $(srcdir)/Objects/typeslots.py + $(PYTHON) $(srcdir)/Objects/typeslots.py < $(srcdir)/Include/typeslots.h > Objects/typeslots.inc +# Only needed with --with-systemtap; not a public header: +$(srcdir)/Python/pysystemtap.h: $(srcdir)/Python/pysystemtap.d @@ -667,8 +667,8 @@ diff -up Python-3.3.0rc2/Makefile.pre.in.systemtap Python-3.3.0rc2/Makefile.pre. # Header files @@ -1345,6 +1354,7 @@ clean: pycremoval + -rm -f pybuilddir.txt -rm -f Lib/lib2to3/*Grammar*.pickle - -rm -f $(SYSCONFIGDATA) -rm -f Modules/_testembed Modules/_freeze_importlib + -rm -f $(srcdir)/Python/pysystemtap.h diff --git a/00111-no-static-lib.patch b/00111-no-static-lib.patch index 91b24b8..bd63852 100644 --- a/00111-no-static-lib.patch +++ b/00111-no-static-lib.patch @@ -9,7 +9,7 @@ diff -up cpython-59223da36dec/Makefile.pre.in.no-static-lib cpython-59223da36dec +$(BUILDPYTHON): Modules/python.o $(LDLIBRARY) $(PY3LIBRARY) $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Modules/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) - platform: $(BUILDPYTHON) $(SYSCONFIGDATA) + platform: $(BUILDPYTHON) pybuilddir.txt @@ -480,18 +480,6 @@ sharedmods: $(BUILDPYTHON) $(SYSCONFIGDA $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build @@ -44,7 +44,7 @@ diff -up cpython-59223da36dec/Makefile.pre.in.no-static-lib cpython-59223da36dec done - @if test -d $(LIBRARY); then :; else \ - if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \ -- if test "$(SO)" = .dll; then \ +- if test "$(SHLIB_SUFFIX)" = .dll; then \ - $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \ - else \ - $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \ diff --git a/00146-hashlib-fips.patch b/00146-hashlib-fips.patch index da83205..f22d9bd 100644 --- a/00146-hashlib-fips.patch +++ b/00146-hashlib-fips.patch @@ -285,7 +285,7 @@ diff -up Python-3.2.2/Modules/_hashopenssl.c.hashlib-fips Python-3.2.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) \ @@ -444,7 +444,7 @@ diff -up Python-3.2.2/Modules/_hashopenssl.c.hashlib-fips Python-3.2.2/Modules/_ if (data_obj) PyBuffer_Release(&view); -@@ -547,55 +620,115 @@ generate_hash_name_list(void) +@@ -547,58 +620,115 @@ generate_hash_name_list(void) /* @@ -550,12 +550,15 @@ diff -up Python-3.2.2/Modules/_hashopenssl.c.hashlib-fips Python-3.2.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 { \ -- CONST_ ## NAME ## _name_obj = PyUnicode_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 (CONST_ ## NAME ## _name_obj == NULL) { \ +- CONST_ ## NAME ## _name_obj = PyUnicode_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)); \ +- } \ - } \ -} while (0); +/* diff --git a/00153-fix-test_gdb-noise.patch b/00153-fix-test_gdb-noise.patch index cc9ed8c..c65787f 100644 --- a/00153-fix-test_gdb-noise.patch +++ b/00153-fix-test_gdb-noise.patch @@ -18,10 +18,9 @@ diff -up cpython-59223da36dec/Lib/test/test_gdb.py.fix-test_gdb-noise cpython-59 if cmds_after_breakpoint: commands += cmds_after_breakpoint @@ -154,8 +163,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() + if not line.startswith('warning: Unable to open') @@ -29,7 +28,7 @@ diff -up cpython-59223da36dec/Lib/test/test_gdb.py.fix-test_gdb-noise cpython-59 + 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, '') diff --git a/00157-uid-gid-overflows.patch b/00157-uid-gid-overflows.patch index ab4cb0c..0f48df5 100644 --- a/00157-uid-gid-overflows.patch +++ b/00157-uid-gid-overflows.patch @@ -1,32 +1,3 @@ -diff -up Python-3.3.0b1/Include/modsupport.h.uid-gid-overflows Python-3.3.0b1/Include/modsupport.h ---- Python-3.3.0b1/Include/modsupport.h.uid-gid-overflows 2012-06-26 16:19:40.000000000 -0400 -+++ Python-3.3.0b1/Include/modsupport.h 2012-07-20 14:21:46.854688763 -0400 -@@ -8,6 +8,7 @@ extern "C" { - /* Module support interface */ - - #include -+#include - - /* If PY_SSIZE_T_CLEAN is defined, each functions treats #-specifier - to mean Py_ssize_t */ -@@ -125,6 +126,17 @@ PyAPI_FUNC(PyObject *) PyModule_Create2( - PyAPI_DATA(char *) _Py_PackageContext; - #endif - -+/* -+ 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-3.3.0b1/Lib/test/test_os.py.uid-gid-overflows Python-3.3.0b1/Lib/test/test_os.py --- Python-3.3.0b1/Lib/test/test_os.py.uid-gid-overflows 2012-06-26 16:19:48.000000000 -0400 +++ Python-3.3.0b1/Lib/test/test_os.py 2012-07-20 14:21:46.856688739 -0400 @@ -39,7 +10,7 @@ diff -up Python-3.3.0b1/Lib/test/test_os.py.uid-gid-overflows Python-3.3.0b1/Lib if hasattr(os, 'setgid'): def test_setgid(self): - if os.getuid() != 0: + if os.getuid() != 0 and not HAVE_WHEEL_GROUP: self.assertRaises(os.error, os.setgid, 0) + self.assertRaises(TypeError, os.setgid, 'not an int') self.assertRaises(OverflowError, os.setgid, 1<<32) @@ -53,7 +24,7 @@ diff -up Python-3.3.0b1/Lib/test/test_os.py.uid-gid-overflows Python-3.3.0b1/Lib if hasattr(os, 'setegid'): def test_setegid(self): - if os.getuid() != 0: + if os.getuid() != 0 and not HAVE_WHEEL_GROUP: self.assertRaises(os.error, os.setegid, 0) + self.assertRaises(TypeError, os.setegid, 'not an int') self.assertRaises(OverflowError, os.setegid, 1<<32) @@ -69,62 +40,13 @@ diff -up Python-3.3.0b1/Lib/test/test_os.py.uid-gid-overflows Python-3.3.0b1/Lib @@ -1212,6 +1218,8 @@ if sys.platform != 'win32': def test_setregid(self): - if os.getuid() != 0: + if os.getuid() != 0 and not HAVE_WHEEL_GROUP: 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-3.3.0b1/Lib/test/test_posix.py.uid-gid-overflows Python-3.3.0b1/Lib/test/test_posix.py ---- Python-3.3.0b1/Lib/test/test_posix.py.uid-gid-overflows 2012-06-26 16:19:48.000000000 -0400 -+++ Python-3.3.0b1/Lib/test/test_posix.py 2012-07-20 14:21:46.857688726 -0400 -@@ -387,10 +387,17 @@ class PosixTester(unittest.TestCase): - else: - self.assertTrue(stat.S_ISFIFO(posix.stat(support.TESTFN).st_mode)) - -- 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.""" - # 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()) - - if os.getuid() == 0: - try: -@@ -421,7 +428,7 @@ class PosixTester(unittest.TestCase): - - # re-create the file - support.create_empty_file(support.TESTFN) -- self._test_all_chown_common(posix.chown, support.TESTFN) -+ self._test_all_chown_common(posix.chown, posix.stat, support.TESTFN) - - @unittest.skipUnless(hasattr(posix, 'fchown'), "test needs os.fchown()") - def test_fchown(self): -@@ -431,7 +438,7 @@ class PosixTester(unittest.TestCase): - test_file = open(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() - -@@ -440,7 +447,7 @@ class PosixTester(unittest.TestCase): - os.unlink(support.TESTFN) - # create a symlink - os.symlink(_DUMMY_SYMLINK, support.TESTFN) -- self._test_all_chown_common(posix.lchown, support.TESTFN) -+ self._test_all_chown_common(posix.lchown, posix.lstat, support.TESTFN) - - def test_chdir(self): - if hasattr(posix, 'chdir'): diff -up Python-3.3.0b1/Lib/test/test_pwd.py.uid-gid-overflows Python-3.3.0b1/Lib/test/test_pwd.py --- Python-3.3.0b1/Lib/test/test_pwd.py.uid-gid-overflows 2012-06-26 16:19:48.000000000 -0400 +++ Python-3.3.0b1/Lib/test/test_pwd.py 2012-07-20 14:21:46.857688726 -0400 @@ -140,557 +62,3 @@ diff -up Python-3.3.0b1/Lib/test/test_pwd.py.uid-gid-overflows Python-3.3.0b1/Li self.assertNotIn(fakeuid, byuids) self.assertRaises(KeyError, pwd.getpwuid, fakeuid) -diff -up Python-3.3.0b1/Modules/grpmodule.c.uid-gid-overflows Python-3.3.0b1/Modules/grpmodule.c ---- Python-3.3.0b1/Modules/grpmodule.c.uid-gid-overflows 2012-06-26 16:19:54.000000000 -0400 -+++ Python-3.3.0b1/Modules/grpmodule.c 2012-07-20 14:21:46.858688713 -0400 -@@ -69,7 +69,7 @@ mkgrent(struct group *p) - Py_INCREF(Py_None); - } - #endif -- SET(setIndex++, PyLong_FromLong((long) p->gr_gid)); -+ SET(setIndex++, _PyObject_FromGid(p->gr_gid)); - SET(setIndex++, w); - #undef SET - -@@ -84,18 +84,16 @@ 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_Long(pyo_id); -- if (!py_int_id) -- return NULL; -- gid = PyLong_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-3.3.0b1/Modules/posixmodule.c.uid-gid-overflows Python-3.3.0b1/Modules/posixmodule.c ---- Python-3.3.0b1/Modules/posixmodule.c.uid-gid-overflows 2012-07-20 14:21:46.788689588 -0400 -+++ Python-3.3.0b1/Modules/posixmodule.c 2012-07-20 14:24:19.626778849 -0400 -@@ -2151,8 +2151,8 @@ _pystat_fromstructstat(STRUCT_STAT *st) - PyStructSequence_SET_ITEM(v, 2, PyLong_FromLong((long)st->st_dev)); - #endif - PyStructSequence_SET_ITEM(v, 3, PyLong_FromLong((long)st->st_nlink)); -- PyStructSequence_SET_ITEM(v, 4, PyLong_FromLong((long)st->st_uid)); -- PyStructSequence_SET_ITEM(v, 5, PyLong_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)); -@@ -2957,7 +2957,6 @@ static PyObject * - posix_chown(PyObject *self, PyObject *args, PyObject *kwargs) - { - path_t path; -- long uid_l, gid_l; - uid_t uid; - gid_t gid; - int dir_fd = DEFAULT_DIR_FD; -@@ -2971,9 +2970,10 @@ posix_chown(PyObject *self, PyObject *ar - #ifdef HAVE_FCHOWN - path.allow_fd = 1; - #endif -- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&ll|$O&p:chown", keywords, -+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O&O&O&|$O&p:chown", keywords, - path_converter, &path, -- &uid_l, &gid_l, -+ _PyArg_ParseUid, &uid, -+ _PyArg_ParseGid, &gid, - #ifdef HAVE_FCHOWNAT - dir_fd_converter, &dir_fd, - #else -@@ -3004,8 +3004,6 @@ posix_chown(PyObject *self, PyObject *ar - #endif - - Py_BEGIN_ALLOW_THREADS -- uid = (uid_t)uid_l; -- gid = (uid_t)gid_l; - #ifdef HAVE_FCHOWN - if (path.fd != -1) - result = fchown(path.fd, uid, gid); -@@ -3049,12 +3047,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:fchown", &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(); -@@ -3074,15 +3075,17 @@ posix_lchown(PyObject *self, PyObject *a - { - PyObject *opath; - char *path; -- long uid, gid; -+ uid_t uid; -+ gid_t gid; - int res; -- if (!PyArg_ParseTuple(args, "O&ll:lchown", -+ if (!PyArg_ParseTuple(args, "O&O&O&:lchown", - PyUnicode_FSConverter, &opath, -- &uid, &gid)) -+ _PyArg_ParseUid, &uid, -+ _PyArg_ParseGid, &gid)) - return NULL; - path = PyBytes_AsString(opath); - 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(opath); -@@ -6184,7 +6187,7 @@ Return the current process's effective g - static PyObject * - posix_getegid(PyObject *self, PyObject *noargs) - { -- return PyLong_FromLong((long)getegid()); -+ return _PyObject_FromGid(getegid()); - } - #endif - -@@ -6197,7 +6200,7 @@ Return the current process's effective u - static PyObject * - posix_geteuid(PyObject *self, PyObject *noargs) - { -- return PyLong_FromLong((long)geteuid()); -+ return _PyObject_FromUid(geteuid()); - } - #endif - -@@ -6210,7 +6213,7 @@ Return the current process's group id.") - static PyObject * - posix_getgid(PyObject *self, PyObject *noargs) - { -- return PyLong_FromLong((long)getgid()); -+ return _PyObject_FromGid(getgid()); - } - #endif - -@@ -6349,7 +6352,7 @@ posix_getgroups(PyObject *self, PyObject - if (result != NULL) { - int i; - for (i = 0; i < n; ++i) { -- PyObject *o = PyLong_FromLong((long)alt_grouplist[i]); -+ PyObject *o = _PyObject_FromGid(alt_grouplist[i]); - if (o == NULL) { - Py_DECREF(result); - result = NULL; -@@ -6380,14 +6383,15 @@ posix_initgroups(PyObject *self, PyObjec - PyObject *oname; - char *username; - int res; -- long gid; -+ gid_t gid; - -- if (!PyArg_ParseTuple(args, "O&l:initgroups", -- PyUnicode_FSConverter, &oname, &gid)) -+ if (!PyArg_ParseTuple(args, "O&O&:initgroups", -+ PyUnicode_FSConverter, &oname, -+ _PyArg_ParseGid, &gid)) - return NULL; - username = PyBytes_AS_STRING(oname); - -- res = initgroups(username, (gid_t) gid); -+ res = initgroups(username, gid); - Py_DECREF(oname); - if (res == -1) - return PyErr_SetFromErrno(PyExc_OSError); -@@ -6562,7 +6566,7 @@ Return the current process's user id."); - static PyObject * - posix_getuid(PyObject *self, PyObject *noargs) - { -- return PyLong_FromLong((long)getuid()); -+ return _PyObject_FromUid(getuid()); - } - #endif - -@@ -6702,15 +6706,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)) -- return NULL; -- uid = uid_arg; -- if (uid != uid_arg) { -- PyErr_SetString(PyExc_OverflowError, "user id too big"); -+ if (!PyArg_ParseTuple(args, "O&:setuid", _PyArg_ParseUid, &uid)) - return NULL; -- } - if (setuid(uid) < 0) - return posix_error(); - Py_INCREF(Py_None); -@@ -6727,15 +6725,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 { -@@ -6753,15 +6745,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)) -- return NULL; -- egid = egid_arg; -- if (egid != egid_arg) { -- PyErr_SetString(PyExc_OverflowError, "group id too big"); -+ if (!PyArg_ParseTuple(args, "O&:setegid", _PyArg_ParseGid, &egid)) - return NULL; -- } - if (setegid(egid) < 0) { - return posix_error(); - } else { -@@ -6779,23 +6765,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)) -- 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"); -+ if (!PyArg_ParseTuple(args, "O&O&", -+ _PyArg_ParseUid, &ruid, -+ _PyArg_ParseUid, &euid)) - return NULL; -- } - if (setreuid(ruid, euid) < 0) { - return posix_error(); - } else { -@@ -6813,23 +6787,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)) -- 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"); -+ if (!PyArg_ParseTuple(args, "O&O&", -+ _PyArg_ParseGid, &rgid, -+ _PyArg_ParseGid, &egid)) - return NULL; -- } - if (setregid(rgid, egid) < 0) { - return posix_error(); - } else { -@@ -6847,15 +6809,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)) -+ if (!PyArg_ParseTuple(args, "O&:setgid", _PyArg_ParseGid, &gid)) - return NULL; -- gid = gid_arg; -- if (gid != gid_arg) { -- PyErr_SetString(PyExc_OverflowError, "group id too big"); -- return NULL; -- } - if (setgid(gid) < 0) - return posix_error(); - Py_INCREF(Py_None); -@@ -6888,27 +6844,9 @@ posix_setgroups(PyObject *self, PyObject - elem = PySequence_GetItem(groups, i); - if (!elem) - return NULL; -- if (!PyLong_Check(elem)) { -- PyErr_SetString(PyExc_TypeError, -- "groups must be integers"); -+ if (!_PyArg_ParseGid(elem, &grouplist[i])) { - 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 the value to see if it fitted in gid_t */ -- if (grouplist[i] != x) { -- PyErr_SetString(PyExc_TypeError, -- "group id too big"); -- Py_DECREF(elem); -- return NULL; -- } - } - Py_DECREF(elem); - } -@@ -10388,9 +10326,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(); -@@ -10406,9 +10346,11 @@ 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(); -@@ -10425,14 +10367,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 - -@@ -10445,14 +10386,13 @@ static PyObject* - posix_getresgid (PyObject *self, PyObject *noargs) - { - uid_t rgid, egid, sgid; -- long l_rgid, l_egid, l_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-3.3.0b1/Modules/pwdmodule.c.uid-gid-overflows Python-3.3.0b1/Modules/pwdmodule.c ---- Python-3.3.0b1/Modules/pwdmodule.c.uid-gid-overflows 2012-06-26 16:19:54.000000000 -0400 -+++ Python-3.3.0b1/Modules/pwdmodule.c 2012-07-20 14:21:46.861688675 -0400 -@@ -74,8 +74,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 -@@ -104,13 +104,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-3.3.0b1/Python/getargs.c.uid-gid-overflows Python-3.3.0b1/Python/getargs.c ---- Python-3.3.0b1/Python/getargs.c.uid-gid-overflows 2012-06-26 16:19:57.000000000 -0400 -+++ Python-3.3.0b1/Python/getargs.c 2012-07-20 14:21:46.861688675 -0400 -@@ -4,6 +4,7 @@ - #include "Python.h" - - #include -+#include - - - #ifdef __cplusplus -@@ -1807,6 +1808,102 @@ _PyArg_NoKeywords(const char *funcname, - funcname); - return 0; - } -+ -+PyObject * -+_PyObject_FromUid(uid_t uid) -+{ -+ return PyLong_FromUnsignedLong((uid_t)uid); -+} -+ -+PyObject * -+_PyObject_FromGid(gid_t gid) -+{ -+ 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/00178-dont-duplicate-flags-in-sysconfig.patch b/00178-dont-duplicate-flags-in-sysconfig.patch new file mode 100644 index 0000000..fc49b30 --- /dev/null +++ b/00178-dont-duplicate-flags-in-sysconfig.patch @@ -0,0 +1,30 @@ +diff -r 39b9b05c3085 Lib/distutils/sysconfig.py +--- a/Lib/distutils/sysconfig.py Wed Apr 10 00:27:23 2013 +0200 ++++ b/Lib/distutils/sysconfig.py Wed Apr 10 10:14:18 2013 +0200 +@@ -362,7 +362,10 @@ + done[n] = item = "" + if found: + after = value[m.end():] +- value = value[:m.start()] + item + after ++ value = value[:m.start()] ++ if item.strip() not in value: ++ value += item ++ value += after + if "$" in after: + notdone[name] = value + else: +diff -r 39b9b05c3085 Lib/sysconfig.py +--- a/Lib/sysconfig.py Wed Apr 10 00:27:23 2013 +0200 ++++ b/Lib/sysconfig.py Wed Apr 10 10:14:18 2013 +0200 +@@ -296,7 +296,10 @@ + + if found: + after = value[m.end():] +- value = value[:m.start()] + item + after ++ value = value[:m.start()] ++ if item.strip() not in value: ++ value += item ++ value += after + if "$" in after: + notdone[name] = value + else: diff --git a/05000-autotool-intermediates.patch b/05000-autotool-intermediates.patch index 38df469..1a0c3c6 100644 --- a/05000-autotool-intermediates.patch +++ b/05000-autotool-intermediates.patch @@ -1,7 +1,7 @@ diff -up ./configure.autotool-intermediates ./configure ---- ./configure.autotool-intermediates 2013-03-25 16:11:38.140657282 -0400 -+++ ./configure 2013-03-25 16:11:46.922656680 -0400 -@@ -779,6 +779,8 @@ with_thread +--- ./configure.autotool-intermediates 2013-04-09 14:52:49.831773426 +0200 ++++ ./configure 2013-04-09 14:52:53.204765347 +0200 +@@ -802,6 +802,8 @@ with_thread enable_ipv6 with_doc_strings with_tsc @@ -10,7 +10,7 @@ diff -up ./configure.autotool-intermediates ./configure with_pymalloc with_valgrind with_systemtap -@@ -1457,6 +1459,8 @@ Optional Packages: +@@ -1479,6 +1481,8 @@ Optional Packages: deprecated; use --with(out)-threads --with(out)-doc-strings disable/enable documentation strings --with(out)-tsc enable/disable timestamp counter profile @@ -19,7 +19,7 @@ diff -up ./configure.autotool-intermediates ./configure --with(out)-pymalloc disable/enable specialized mallocs --with-valgrind Enable Valgrind support --with(out)-systemtap disable/enable SystemTap support -@@ -6471,7 +6475,7 @@ then +@@ -6529,7 +6533,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 @@ -28,7 +28,7 @@ diff -up ./configure.autotool-intermediates ./configure cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -@@ -10008,6 +10012,50 @@ $as_echo "#define WITH_TSC 1" >>confdefs +@@ -10117,6 +10121,50 @@ $as_echo "#define WITH_TSC 1" >>confdefs { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -80,3 +80,15 @@ diff -up ./configure.autotool-intermediates ./configure $as_echo "no" >&6; } fi diff -up ./pyconfig.h.in.autotool-intermediates ./pyconfig.h.in +--- ./pyconfig.h.in.autotool-intermediates 2013-04-09 14:52:49.829773431 +0200 ++++ ./pyconfig.h.in 2013-04-09 14:52:53.488764667 +0200 +@@ -1193,9 +1193,6 @@ + /* Define if setpgrp() must be called as setpgrp(0, 0). */ + #undef SETPGRP_HAVE_ARG + +-/* Define this to be extension of shared libraries (including the dot!). */ +-#undef SHLIB_EXT +- + /* Define if i>>j for signed int i does not extend the sign bit when i < 0 */ + #undef SIGNED_RIGHT_SHIFT_ZERO_FILLS + diff --git a/python3.spec b/python3.spec index 93e7a3f..307a3d7 100644 --- a/python3.spec +++ b/python3.spec @@ -125,8 +125,8 @@ # ================== Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 -Version: %{pybasever}.0 -Release: 10%{?dist} +Version: %{pybasever}.1 +Release: 1%{?dist} License: Python Group: Development/Languages @@ -222,9 +222,9 @@ Source7: pyfuntop.stp # Was Patch0 in ivazquez' python3000 specfile: Patch1: Python-3.1.1-rpath.patch -# The four TestMIMEAudio tests fail due to "audiotest.au" not being packaged. -# It's simplest to remove them: -Patch3: 00003-remove-mimeaudio-tests.patch +# Some tests were removed due to audiotest.au not being packaged. This was +# however added to the archive in 3.3.1, so we no longer delete the tests. +# Patch3: 00003-remove-mimeaudio-tests.patch # 00055 # # Systemtap support: add statically-defined probe points @@ -462,9 +462,7 @@ Patch156: 00156-gdb-autoload-safepath.patch Patch157: 00157-uid-gid-overflows.patch # 00158 # -# Patch158: 00158-fix-hashlib-leak.patch -# in python.spec -# TODO: python3 status? +# Upstream as of Python 3.3.1 # 00159 # # Patch159: 00159-correct-libdb-include-path.patch @@ -528,13 +526,13 @@ Patch164: 00164-disable-interrupted_write-tests-on-ppc.patch # TODO: python3 status? # 00171 # +# python.spec had: # Patch171: 00171-raise-correct-exception-when-dev-urandom-is-missing.patch -# in python.spec # TODO: python3 status? # 00172 # +# python.spec had: # Patch172: 00172-use-poll-for-multiprocessing-socket-connection.patch -# in python.spec # TODO: python3 status? # 00173 # @@ -556,12 +554,8 @@ Patch173: 00173-workaround-ENOPROTOOPT-in-bind_port.patch Patch175: 00175-fix-configure-Wformat.patch # 00176 # -# Potential patch for so extensions being wrong since SOABI in upstream python3. -# http://bugs.python.org/issue16754 -# (rhbz#889784) -# Does not affect python2 (python2 does not have compiled extensions with the -# problematic information) -Patch176: 00176-upstream-issue16754-so-extension.patch +# Fixed upstream as of Python 3.3.1 +# Patch176: 00176-upstream-issue16754-so-extension.patch # 00177 # # Patch for potential unicode error when determining OS release names @@ -570,6 +564,11 @@ Patch176: 00176-upstream-issue16754-so-extension.patch # Does not affect python2 (python2 uses a byte string so it doesn't need to decode) Patch177: 00177-platform-unicode.patch +# 00178 # +# Don't duplicate various FLAGS in sysconfig values +# http://bugs.python.org/issue17679 +# Does not affect python2 AFAICS (different sysconfig values initialization) +Patch178: 00178-dont-duplicate-flags-in-sysconfig.patch # (New patches go here ^^^) # @@ -744,7 +743,7 @@ done # Apply patches: # %patch1 -p1 -%patch3 -p1 -b .remove-mimeaudio-tests +# 3: upstream as of Python 3.3.1 %if 0%{?with_systemtap} %patch55 -p1 -b .systemtap @@ -819,8 +818,9 @@ done %patch173 -p1 #00174: TODO %patch175 -p1 -%patch176 -p1 +# 00176: upstream as of Python 3.3.1 %patch177 -p1 +%patch178 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -868,7 +868,7 @@ for f in pyconfig.h.in configure ; do done # Rerun the autotools: -PATH=~/autoconf-2.65/bin:$PATH autoreconf +autoreconf # Regenerate the patch: gendiff . .autotool-intermediates > %{PATCH5000} @@ -969,12 +969,6 @@ InstallPython() { pushd $ConfDir - # Workaround for http://bugs.python.org/issue14774 : Lib/_sysconfigdata.py - # is in the srcdir but contains per-config data. - # Regenerate it each time: - rm -f ../../Lib/_sysconfigdata.py - make $topdir/Lib/_sysconfigdata.py - make install DESTDIR=%{buildroot} INSTALL="install -p" popd @@ -1256,13 +1250,6 @@ CheckPython() { # Note that we're running the tests using the version of the code in the # builddir, not in the buildroot. - # Workaround for http://bugs.python.org/issue14774, as per the install - # stanza (albeit from a different directory): - rm -f Lib/_sysconfigdata.py - pushd $ConfDir - make $topdir/Lib/_sysconfigdata.py - popd - # 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) @@ -1677,6 +1664,15 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Tue Apr 09 2013 Bohuslav Kabrda - 3.3.1-1 +- Updated to Python 3.3.1. +- Refreshed patches: 55 (systemtap), 111 (no static lib), 146 (hashlib fips), +153 (fix test_gdb noise), 157 (uid, gid overflow - fixed upstream, just +keeping few more downstream tests) +- Removed patches: 3 (audiotest.au made it to upstream tarball) +- Removed workaround for http://bugs.python.org/issue14774, discussed in +http://bugs.python.org/issue15298 and fixed in revision 24d52d3060e8. + * Mon Mar 25 2013 David Malcolm - 3.3.0-10 - fix gcc 4.8 incompatibility (rhbz#927358); regenerate autotool intermediates diff --git a/sources b/sources index 3f2585f..b8490ab 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -2e7533b4009ac4adae62a7797a442e7a Python-3.3.0.tar.xz +993232d9f4d9b4863cc1ec69a792e9cd Python-3.3.1.tar.xz From b935d25938262c5161ab89752972f642f7dea5b6 Mon Sep 17 00:00:00 2001 From: Bohuslav Kabrda Date: Wed, 24 Apr 2013 11:47:45 +0200 Subject: [PATCH 129/416] Add fix for gdb tests failing on arm, rhbz#951802. --- ...on-gdb-corrupted-frames-in-backtrace.patch | 48 +++++++++++++++++++ python3.spec | 15 +++++- 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 00179-dont-raise-error-on-gdb-corrupted-frames-in-backtrace.patch diff --git a/00179-dont-raise-error-on-gdb-corrupted-frames-in-backtrace.patch b/00179-dont-raise-error-on-gdb-corrupted-frames-in-backtrace.patch new file mode 100644 index 0000000..2112730 --- /dev/null +++ b/00179-dont-raise-error-on-gdb-corrupted-frames-in-backtrace.patch @@ -0,0 +1,48 @@ +--- a/Tools/gdb/libpython.py 2013-04-06 03:41:58.000000000 -0400 ++++ b/Tools/gdb/libpython.py 2013-04-24 03:51:04.720540343 -0400 +@@ -274,6 +274,9 @@ + self.tp_name = tp_name + self.address = address + ++ def __len__(self): ++ return len(repr(self)) ++ + def __repr__(self): + # For the NULL pointer, we have no way of knowing a type, so + # special-case it as per +@@ -881,6 +884,8 @@ + filename = self.filename() + try: + f = open(os_fsencode(filename), 'r') ++ except TypeError: # filename is FakeRepr ++ return None + except IOError: + return None + with f: +@@ -1523,9 +1528,12 @@ + + def print_summary(self): + if self.is_evalframeex(): +- pyop = self.get_pyop() +- if pyop: ++ try: ++ pyop = self.get_pyop() + line = pyop.get_truncated_repr(MAX_OUTPUT_LEN) ++ except: ++ pyop = None ++ if pyop: + write_unicode(sys.stdout, '#%i %s\n' % (self.get_index(), line)) + if not pyop.is_optimized_out(): + line = pyop.current_line() +@@ -1542,7 +1550,10 @@ + + def print_traceback(self): + if self.is_evalframeex(): +- pyop = self.get_pyop() ++ try: ++ pyop = self.get_pyop() ++ except: ++ pyop = None + if pyop: + pyop.print_traceback() + if not pyop.is_optimized_out(): diff --git a/python3.spec b/python3.spec index 307a3d7..eeeba9c 100644 --- a/python3.spec +++ b/python3.spec @@ -126,7 +126,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 1%{?dist} +Release: 2%{?dist} License: Python Group: Development/Languages @@ -570,6 +570,15 @@ Patch177: 00177-platform-unicode.patch # Does not affect python2 AFAICS (different sysconfig values initialization) Patch178: 00178-dont-duplicate-flags-in-sysconfig.patch +# 00179 # +# Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=951802 +# Reported upstream in http://bugs.python.org/issue17737 +# This patch basically looks at every frame and if it is somehow corrupted, +# it just stops printing the traceback - it doesn't fix the actual bug. +# This bug seems to only affect ARM. +# Doesn't seem to affect Python 2 AFAICS. +Patch179: 00179-dont-raise-error-on-gdb-corrupted-frames-in-backtrace.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora 17 onwards, @@ -821,6 +830,7 @@ done # 00176: upstream as of Python 3.3.1 %patch177 -p1 %patch178 -p1 +%patch179 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1664,6 +1674,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Wed Apr 24 2013 Bohuslav Kabrda - 3.3.1-2 +- Add fix for gdb tests failing on arm, rhbz#951802. + * Tue Apr 09 2013 Bohuslav Kabrda - 3.3.1-1 - Updated to Python 3.3.1. - Refreshed patches: 55 (systemtap), 111 (no static lib), 146 (hashlib fips), From 88d5ef166c7e8facc4fcd175c57daf8322ba564b Mon Sep 17 00:00:00 2001 From: Bohuslav Kabrda Date: Wed, 24 Apr 2013 11:47:45 +0200 Subject: [PATCH 130/416] Add fix for gdb tests failing on arm, rhbz#951802. --- ...on-gdb-corrupted-frames-in-backtrace.patch | 48 +++++++++++++++++++ python3.spec | 15 +++++- 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 00179-dont-raise-error-on-gdb-corrupted-frames-in-backtrace.patch diff --git a/00179-dont-raise-error-on-gdb-corrupted-frames-in-backtrace.patch b/00179-dont-raise-error-on-gdb-corrupted-frames-in-backtrace.patch new file mode 100644 index 0000000..2112730 --- /dev/null +++ b/00179-dont-raise-error-on-gdb-corrupted-frames-in-backtrace.patch @@ -0,0 +1,48 @@ +--- a/Tools/gdb/libpython.py 2013-04-06 03:41:58.000000000 -0400 ++++ b/Tools/gdb/libpython.py 2013-04-24 03:51:04.720540343 -0400 +@@ -274,6 +274,9 @@ + self.tp_name = tp_name + self.address = address + ++ def __len__(self): ++ return len(repr(self)) ++ + def __repr__(self): + # For the NULL pointer, we have no way of knowing a type, so + # special-case it as per +@@ -881,6 +884,8 @@ + filename = self.filename() + try: + f = open(os_fsencode(filename), 'r') ++ except TypeError: # filename is FakeRepr ++ return None + except IOError: + return None + with f: +@@ -1523,9 +1528,12 @@ + + def print_summary(self): + if self.is_evalframeex(): +- pyop = self.get_pyop() +- if pyop: ++ try: ++ pyop = self.get_pyop() + line = pyop.get_truncated_repr(MAX_OUTPUT_LEN) ++ except: ++ pyop = None ++ if pyop: + write_unicode(sys.stdout, '#%i %s\n' % (self.get_index(), line)) + if not pyop.is_optimized_out(): + line = pyop.current_line() +@@ -1542,7 +1550,10 @@ + + def print_traceback(self): + if self.is_evalframeex(): +- pyop = self.get_pyop() ++ try: ++ pyop = self.get_pyop() ++ except: ++ pyop = None + if pyop: + pyop.print_traceback() + if not pyop.is_optimized_out(): diff --git a/python3.spec b/python3.spec index 307a3d7..eeeba9c 100644 --- a/python3.spec +++ b/python3.spec @@ -126,7 +126,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 1%{?dist} +Release: 2%{?dist} License: Python Group: Development/Languages @@ -570,6 +570,15 @@ Patch177: 00177-platform-unicode.patch # Does not affect python2 AFAICS (different sysconfig values initialization) Patch178: 00178-dont-duplicate-flags-in-sysconfig.patch +# 00179 # +# Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=951802 +# Reported upstream in http://bugs.python.org/issue17737 +# This patch basically looks at every frame and if it is somehow corrupted, +# it just stops printing the traceback - it doesn't fix the actual bug. +# This bug seems to only affect ARM. +# Doesn't seem to affect Python 2 AFAICS. +Patch179: 00179-dont-raise-error-on-gdb-corrupted-frames-in-backtrace.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora 17 onwards, @@ -821,6 +830,7 @@ done # 00176: upstream as of Python 3.3.1 %patch177 -p1 %patch178 -p1 +%patch179 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1664,6 +1674,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Wed Apr 24 2013 Bohuslav Kabrda - 3.3.1-2 +- Add fix for gdb tests failing on arm, rhbz#951802. + * Tue Apr 09 2013 Bohuslav Kabrda - 3.3.1-1 - Updated to Python 3.3.1. - Refreshed patches: 55 (systemtap), 111 (no static lib), 146 (hashlib fips), From 69d4e5d3533e4404ae7d42d537d29fd6861a8eae Mon Sep 17 00:00:00 2001 From: Bohuslav Kabrda Date: Thu, 2 May 2013 09:41:28 +0200 Subject: [PATCH 131/416] Add patch that enables building on ppc64p7 (replace the sed, so that we get consistent with python2 spec and it's more obvious that we're doing it. --- 00180-python-add-support-for-ppc64p7.patch | 12 ++++++++++++ python3.spec | 15 +++++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 00180-python-add-support-for-ppc64p7.patch 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/python3.spec b/python3.spec index eeeba9c..481e9ca 100644 --- a/python3.spec +++ b/python3.spec @@ -126,7 +126,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 2%{?dist} +Release: 3%{?dist} License: Python Group: Development/Languages @@ -579,6 +579,11 @@ Patch178: 00178-dont-duplicate-flags-in-sysconfig.patch # Doesn't seem to affect Python 2 AFAICS. Patch179: 00179-dont-raise-error-on-gdb-corrupted-frames-in-backtrace.patch +# 00180 # +# Enable building on ppc64p7 +# Not appropriate for upstream, Fedora-specific naming +Patch180: 00180-python-add-support-for-ppc64p7.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora 17 onwards, @@ -831,6 +836,7 @@ done %patch177 -p1 %patch178 -p1 %patch179 -p1 +%patch180 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -848,9 +854,6 @@ sed --in-place \ %patch5000 -p0 -b .autotool-intermediates %endif -# Add target for optimized Power7 binaries: -sed -i -e "s/ppc64-\*/ppc64-\* \| ppc64p7-\*/" config.sub - # ====================================================== # Configuring and building the code: # ====================================================== @@ -1674,6 +1677,10 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Thu May 02 2013 Bohuslav Kabrda - 3.3.1-3 +- Add patch that enables building on ppc64p7 (replace the sed, so that +we get consistent with python2 spec and it's more obvious that we're doing it. + * Wed Apr 24 2013 Bohuslav Kabrda - 3.3.1-2 - Add fix for gdb tests failing on arm, rhbz#951802. From f9db6e6f659d4b086e5cea8b8ce0aad925ee606e Mon Sep 17 00:00:00 2001 From: Bohuslav Kabrda Date: Thu, 2 May 2013 09:41:28 +0200 Subject: [PATCH 132/416] Add patch that enables building on ppc64p7 (replace the sed, so that we get consistent with python2 spec and it's more obvious that we're doing it. --- 00180-python-add-support-for-ppc64p7.patch | 12 ++++++++++++ python3.spec | 15 +++++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 00180-python-add-support-for-ppc64p7.patch 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/python3.spec b/python3.spec index eeeba9c..481e9ca 100644 --- a/python3.spec +++ b/python3.spec @@ -126,7 +126,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 2%{?dist} +Release: 3%{?dist} License: Python Group: Development/Languages @@ -579,6 +579,11 @@ Patch178: 00178-dont-duplicate-flags-in-sysconfig.patch # Doesn't seem to affect Python 2 AFAICS. Patch179: 00179-dont-raise-error-on-gdb-corrupted-frames-in-backtrace.patch +# 00180 # +# Enable building on ppc64p7 +# Not appropriate for upstream, Fedora-specific naming +Patch180: 00180-python-add-support-for-ppc64p7.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora 17 onwards, @@ -831,6 +836,7 @@ done %patch177 -p1 %patch178 -p1 %patch179 -p1 +%patch180 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -848,9 +854,6 @@ sed --in-place \ %patch5000 -p0 -b .autotool-intermediates %endif -# Add target for optimized Power7 binaries: -sed -i -e "s/ppc64-\*/ppc64-\* \| ppc64p7-\*/" config.sub - # ====================================================== # Configuring and building the code: # ====================================================== @@ -1674,6 +1677,10 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Thu May 02 2013 Bohuslav Kabrda - 3.3.1-3 +- Add patch that enables building on ppc64p7 (replace the sed, so that +we get consistent with python2 spec and it's more obvious that we're doing it. + * Wed Apr 24 2013 Bohuslav Kabrda - 3.3.1-2 - Add fix for gdb tests failing on arm, rhbz#951802. From 721c1efdac18333767c4d2aec7ab33cd44458183 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Thu, 9 May 2013 12:12:53 -0400 Subject: [PATCH 133/416] 3.3.1-4: fix test.test_gdb.PyBtTests.test_threads on ppc64 (rhbz#960010) * Thu May 9 2013 David Malcolm - 3.3.1-4 - fix test.test_gdb.PyBtTests.test_threads on ppc64 (patch 181; rhbz#960010) --- 00181-fix-test_gdb-test_threads.patch | 13 +++++++++++++ python3.spec | 14 +++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 00181-fix-test_gdb-test_threads.patch diff --git a/00181-fix-test_gdb-test_threads.patch b/00181-fix-test_gdb-test_threads.patch new file mode 100644 index 0000000..41de5b2 --- /dev/null +++ b/00181-fix-test_gdb-test_threads.patch @@ -0,0 +1,13 @@ +diff -up Python-3.3.1/Misc/NEWS.fix-test_gdb-test_threads Python-3.3.1/Misc/NEWS +diff -up Python-3.3.1/Tools/gdb/libpython.py.fix-test_gdb-test_threads Python-3.3.1/Tools/gdb/libpython.py +--- Python-3.3.1/Tools/gdb/libpython.py.fix-test_gdb-test_threads 2013-05-09 12:12:01.621592211 -0400 ++++ Python-3.3.1/Tools/gdb/libpython.py 2013-05-09 12:12:01.632592209 -0400 +@@ -1465,7 +1465,7 @@ class Frame(object): + # This assumes the _POSIX_THREADS version of Python/ceval_gil.h: + name = self._gdbframe.name() + if name: +- return name.startswith('pthread_cond_timedwait') ++ return 'pthread_cond_timedwait' in name + + def is_gc_collect(self): + '''Is this frame "collect" within the garbage-collector?''' diff --git a/python3.spec b/python3.spec index 481e9ca..e66e9bf 100644 --- a/python3.spec +++ b/python3.spec @@ -126,7 +126,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 3%{?dist} +Release: 4%{?dist} License: Python Group: Development/Languages @@ -584,6 +584,14 @@ Patch179: 00179-dont-raise-error-on-gdb-corrupted-frames-in-backtrace.patch # Not appropriate for upstream, Fedora-specific naming Patch180: 00180-python-add-support-for-ppc64p7.patch +# 00181 # +# Fix test.test_gdb.PyBtTests.test_threads on ppc64 +# Cherrypicked from upstream commit: +# http://hg.python.org/cpython/rev/f4a6b731905a/ +# for upstream issue http://bugs.python.org/issue17833 +# (rhbz#960010) +Patch181: 00181-fix-test_gdb-test_threads.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora 17 onwards, @@ -837,6 +845,7 @@ done %patch178 -p1 %patch179 -p1 %patch180 -p1 +%patch181 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1677,6 +1686,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Thu May 9 2013 David Malcolm - 3.3.1-4 +- fix test.test_gdb.PyBtTests.test_threads on ppc64 (patch 181; rhbz#960010) + * Thu May 02 2013 Bohuslav Kabrda - 3.3.1-3 - Add patch that enables building on ppc64p7 (replace the sed, so that we get consistent with python2 spec and it's more obvious that we're doing it. From 9d658b4031a765b4b2fc7a4cfde5337736019c42 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Thu, 9 May 2013 12:19:36 -0400 Subject: [PATCH 134/416] 3.3.1-4: fix test.test_gdb.PyBtTests.test_threads on ppc64 (rhbz#960010) * Thu May 9 2013 David Malcolm - 3.3.1-4 - fix test.test_gdb.PyBtTests.test_threads on ppc64 (patch 181; rhbz#960010) --- 00181-fix-test_gdb-test_threads.patch | 13 +++++++++++++ python3.spec | 14 +++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 00181-fix-test_gdb-test_threads.patch diff --git a/00181-fix-test_gdb-test_threads.patch b/00181-fix-test_gdb-test_threads.patch new file mode 100644 index 0000000..41de5b2 --- /dev/null +++ b/00181-fix-test_gdb-test_threads.patch @@ -0,0 +1,13 @@ +diff -up Python-3.3.1/Misc/NEWS.fix-test_gdb-test_threads Python-3.3.1/Misc/NEWS +diff -up Python-3.3.1/Tools/gdb/libpython.py.fix-test_gdb-test_threads Python-3.3.1/Tools/gdb/libpython.py +--- Python-3.3.1/Tools/gdb/libpython.py.fix-test_gdb-test_threads 2013-05-09 12:12:01.621592211 -0400 ++++ Python-3.3.1/Tools/gdb/libpython.py 2013-05-09 12:12:01.632592209 -0400 +@@ -1465,7 +1465,7 @@ class Frame(object): + # This assumes the _POSIX_THREADS version of Python/ceval_gil.h: + name = self._gdbframe.name() + if name: +- return name.startswith('pthread_cond_timedwait') ++ return 'pthread_cond_timedwait' in name + + def is_gc_collect(self): + '''Is this frame "collect" within the garbage-collector?''' diff --git a/python3.spec b/python3.spec index 481e9ca..e66e9bf 100644 --- a/python3.spec +++ b/python3.spec @@ -126,7 +126,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 3%{?dist} +Release: 4%{?dist} License: Python Group: Development/Languages @@ -584,6 +584,14 @@ Patch179: 00179-dont-raise-error-on-gdb-corrupted-frames-in-backtrace.patch # Not appropriate for upstream, Fedora-specific naming Patch180: 00180-python-add-support-for-ppc64p7.patch +# 00181 # +# Fix test.test_gdb.PyBtTests.test_threads on ppc64 +# Cherrypicked from upstream commit: +# http://hg.python.org/cpython/rev/f4a6b731905a/ +# for upstream issue http://bugs.python.org/issue17833 +# (rhbz#960010) +Patch181: 00181-fix-test_gdb-test_threads.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora 17 onwards, @@ -837,6 +845,7 @@ done %patch178 -p1 %patch179 -p1 %patch180 -p1 +%patch181 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1677,6 +1686,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Thu May 9 2013 David Malcolm - 3.3.1-4 +- fix test.test_gdb.PyBtTests.test_threads on ppc64 (patch 181; rhbz#960010) + * Thu May 02 2013 Bohuslav Kabrda - 3.3.1-3 - Add patch that enables building on ppc64p7 (replace the sed, so that we get consistent with python2 spec and it's more obvious that we're doing it. From c298168d5462a13238e7e401b5524236305dd635 Mon Sep 17 00:00:00 2001 From: Bohuslav Kabrda Date: Thu, 16 May 2013 16:35:48 +0200 Subject: [PATCH 135/416] Updated to Python 3.3.2. - Refreshed patches: 153 (gdb test noise) - Dropped patches: 175 (configure -Wformat, fixed upstream) - Synced patch numbers with python.spec. --- 00153-fix-test_gdb-noise.patch | 37 ++++++++----------- ...h => 00182-fix-test_gdb-test_threads.patch | 0 05000-autotool-intermediates.patch | 22 ----------- python3.spec | 34 ++++++++++------- sources | 2 +- 5 files changed, 38 insertions(+), 57 deletions(-) rename 00181-fix-test_gdb-test_threads.patch => 00182-fix-test_gdb-test_threads.patch (100%) diff --git a/00153-fix-test_gdb-noise.patch b/00153-fix-test_gdb-noise.patch index c65787f..50a0917 100644 --- a/00153-fix-test_gdb-noise.patch +++ b/00153-fix-test_gdb-noise.patch @@ -1,7 +1,6 @@ -diff -up cpython-59223da36dec/Lib/test/test_gdb.py.fix-test_gdb-noise cpython-59223da36dec/Lib/test/test_gdb.py ---- cpython-59223da36dec/Lib/test/test_gdb.py.fix-test_gdb-noise 2012-08-07 06:10:57.000000000 -0400 -+++ cpython-59223da36dec/Lib/test/test_gdb.py 2012-08-07 17:13:46.592343113 -0400 -@@ -115,6 +115,15 @@ class DebuggerTests(unittest.TestCase): +--- 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, @@ -17,20 +16,16 @@ diff -up cpython-59223da36dec/Lib/test/test_gdb.py.fix-test_gdb-noise cpython-59 'run'] if cmds_after_breakpoint: commands += cmds_after_breakpoint -@@ -154,8 +163,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/00181-fix-test_gdb-test_threads.patch b/00182-fix-test_gdb-test_threads.patch similarity index 100% rename from 00181-fix-test_gdb-test_threads.patch rename to 00182-fix-test_gdb-test_threads.patch diff --git a/05000-autotool-intermediates.patch b/05000-autotool-intermediates.patch index 1a0c3c6..903cbf0 100644 --- a/05000-autotool-intermediates.patch +++ b/05000-autotool-intermediates.patch @@ -19,15 +19,6 @@ diff -up ./configure.autotool-intermediates ./configure --with(out)-pymalloc disable/enable specialized mallocs --with-valgrind Enable Valgrind support --with(out)-systemtap disable/enable SystemTap support -@@ -6529,7 +6533,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. */ - @@ -10117,6 +10121,50 @@ $as_echo "#define WITH_TSC 1" >>confdefs { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 @@ -79,16 +70,3 @@ diff -up ./configure.autotool-intermediates ./configure else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi -diff -up ./pyconfig.h.in.autotool-intermediates ./pyconfig.h.in ---- ./pyconfig.h.in.autotool-intermediates 2013-04-09 14:52:49.829773431 +0200 -+++ ./pyconfig.h.in 2013-04-09 14:52:53.488764667 +0200 -@@ -1193,9 +1193,6 @@ - /* Define if setpgrp() must be called as setpgrp(0, 0). */ - #undef SETPGRP_HAVE_ARG - --/* Define this to be extension of shared libraries (including the dot!). */ --#undef SHLIB_EXT -- - /* Define if i>>j for signed int i does not extend the sign bit when i < 0 */ - #undef SIGNED_RIGHT_SHIFT_ZERO_FILLS - diff --git a/python3.spec b/python3.spec index e66e9bf..a7d1d97 100644 --- a/python3.spec +++ b/python3.spec @@ -125,8 +125,8 @@ # ================== Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 -Version: %{pybasever}.1 -Release: 4%{?dist} +Version: %{pybasever}.2 +Release: 1%{?dist} License: Python Group: Development/Languages @@ -545,13 +545,8 @@ Patch173: 00173-workaround-ENOPROTOOPT-in-bind_port.patch # TODO: python3 status? # 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 3.3.2 +# Patch175: 00175-fix-configure-Wformat.patch # 00176 # # Fixed upstream as of Python 3.3.1 @@ -584,13 +579,19 @@ Patch179: 00179-dont-raise-error-on-gdb-corrupted-frames-in-backtrace.patch # Not appropriate for upstream, Fedora-specific naming Patch180: 00180-python-add-support-for-ppc64p7.patch +# 00181 # +# python.spec has +# Patch181: 00181-allow-arbitrary-timeout-in-condition-wait.patch +# Does not affect python3 + # 00181 # # Fix test.test_gdb.PyBtTests.test_threads on ppc64 # Cherrypicked from upstream commit: # http://hg.python.org/cpython/rev/f4a6b731905a/ # for upstream issue http://bugs.python.org/issue17833 # (rhbz#960010) -Patch181: 00181-fix-test_gdb-test_threads.patch +Patch182: 00182-fix-test_gdb-test_threads.patch + # (New patches go here ^^^) # @@ -815,7 +816,7 @@ done %endif # 00151: not for python3 # 00152: upstream as of Python 3.3.0b2 -%patch153 -p1 +%patch153 -p0 # 00154: not for this branch %patch155 -p1 %patch156 -p1 @@ -839,13 +840,14 @@ done #00172: TODO %patch173 -p1 #00174: TODO -%patch175 -p1 +# 00175: upstream as of Python 3.3.2 # 00176: upstream as of Python 3.3.1 %patch177 -p1 %patch178 -p1 %patch179 -p1 %patch180 -p1 -%patch181 -p1 +# 00181: not for python3 +%patch182 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1686,6 +1688,12 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Thu May 16 2013 Bohuslav Kabrda - 3.3.2-1 +- Updated to Python 3.3.2. +- Refreshed patches: 153 (gdb test noise) +- Dropped patches: 175 (configure -Wformat, fixed upstream) +- Synced patch numbers with python.spec. + * Thu May 9 2013 David Malcolm - 3.3.1-4 - fix test.test_gdb.PyBtTests.test_threads on ppc64 (patch 181; rhbz#960010) diff --git a/sources b/sources index b8490ab..acfd2af 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -993232d9f4d9b4863cc1ec69a792e9cd Python-3.3.1.tar.xz +c94b78ea3b68a9bbc9906af4d5b4fdc7 Python-3.3.2.tar.xz From a60a842ced8fcad62b87b67539a2ecfa4d21d2ec Mon Sep 17 00:00:00 2001 From: Bohuslav Kabrda Date: Thu, 16 May 2013 16:35:48 +0200 Subject: [PATCH 136/416] Updated to Python 3.3.2. - Refreshed patches: 153 (gdb test noise) - Dropped patches: 175 (configure -Wformat, fixed upstream) - Synced patch numbers with python.spec. --- 00153-fix-test_gdb-noise.patch | 37 ++++++++----------- ...h => 00182-fix-test_gdb-test_threads.patch | 0 05000-autotool-intermediates.patch | 22 ----------- python3.spec | 34 ++++++++++------- sources | 2 +- 5 files changed, 38 insertions(+), 57 deletions(-) rename 00181-fix-test_gdb-test_threads.patch => 00182-fix-test_gdb-test_threads.patch (100%) diff --git a/00153-fix-test_gdb-noise.patch b/00153-fix-test_gdb-noise.patch index c65787f..50a0917 100644 --- a/00153-fix-test_gdb-noise.patch +++ b/00153-fix-test_gdb-noise.patch @@ -1,7 +1,6 @@ -diff -up cpython-59223da36dec/Lib/test/test_gdb.py.fix-test_gdb-noise cpython-59223da36dec/Lib/test/test_gdb.py ---- cpython-59223da36dec/Lib/test/test_gdb.py.fix-test_gdb-noise 2012-08-07 06:10:57.000000000 -0400 -+++ cpython-59223da36dec/Lib/test/test_gdb.py 2012-08-07 17:13:46.592343113 -0400 -@@ -115,6 +115,15 @@ class DebuggerTests(unittest.TestCase): +--- 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, @@ -17,20 +16,16 @@ diff -up cpython-59223da36dec/Lib/test/test_gdb.py.fix-test_gdb-noise cpython-59 'run'] if cmds_after_breakpoint: commands += cmds_after_breakpoint -@@ -154,8 +163,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/00181-fix-test_gdb-test_threads.patch b/00182-fix-test_gdb-test_threads.patch similarity index 100% rename from 00181-fix-test_gdb-test_threads.patch rename to 00182-fix-test_gdb-test_threads.patch diff --git a/05000-autotool-intermediates.patch b/05000-autotool-intermediates.patch index 1a0c3c6..903cbf0 100644 --- a/05000-autotool-intermediates.patch +++ b/05000-autotool-intermediates.patch @@ -19,15 +19,6 @@ diff -up ./configure.autotool-intermediates ./configure --with(out)-pymalloc disable/enable specialized mallocs --with-valgrind Enable Valgrind support --with(out)-systemtap disable/enable SystemTap support -@@ -6529,7 +6533,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. */ - @@ -10117,6 +10121,50 @@ $as_echo "#define WITH_TSC 1" >>confdefs { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 @@ -79,16 +70,3 @@ diff -up ./configure.autotool-intermediates ./configure else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi -diff -up ./pyconfig.h.in.autotool-intermediates ./pyconfig.h.in ---- ./pyconfig.h.in.autotool-intermediates 2013-04-09 14:52:49.829773431 +0200 -+++ ./pyconfig.h.in 2013-04-09 14:52:53.488764667 +0200 -@@ -1193,9 +1193,6 @@ - /* Define if setpgrp() must be called as setpgrp(0, 0). */ - #undef SETPGRP_HAVE_ARG - --/* Define this to be extension of shared libraries (including the dot!). */ --#undef SHLIB_EXT -- - /* Define if i>>j for signed int i does not extend the sign bit when i < 0 */ - #undef SIGNED_RIGHT_SHIFT_ZERO_FILLS - diff --git a/python3.spec b/python3.spec index e66e9bf..a7d1d97 100644 --- a/python3.spec +++ b/python3.spec @@ -125,8 +125,8 @@ # ================== Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 -Version: %{pybasever}.1 -Release: 4%{?dist} +Version: %{pybasever}.2 +Release: 1%{?dist} License: Python Group: Development/Languages @@ -545,13 +545,8 @@ Patch173: 00173-workaround-ENOPROTOOPT-in-bind_port.patch # TODO: python3 status? # 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 3.3.2 +# Patch175: 00175-fix-configure-Wformat.patch # 00176 # # Fixed upstream as of Python 3.3.1 @@ -584,13 +579,19 @@ Patch179: 00179-dont-raise-error-on-gdb-corrupted-frames-in-backtrace.patch # Not appropriate for upstream, Fedora-specific naming Patch180: 00180-python-add-support-for-ppc64p7.patch +# 00181 # +# python.spec has +# Patch181: 00181-allow-arbitrary-timeout-in-condition-wait.patch +# Does not affect python3 + # 00181 # # Fix test.test_gdb.PyBtTests.test_threads on ppc64 # Cherrypicked from upstream commit: # http://hg.python.org/cpython/rev/f4a6b731905a/ # for upstream issue http://bugs.python.org/issue17833 # (rhbz#960010) -Patch181: 00181-fix-test_gdb-test_threads.patch +Patch182: 00182-fix-test_gdb-test_threads.patch + # (New patches go here ^^^) # @@ -815,7 +816,7 @@ done %endif # 00151: not for python3 # 00152: upstream as of Python 3.3.0b2 -%patch153 -p1 +%patch153 -p0 # 00154: not for this branch %patch155 -p1 %patch156 -p1 @@ -839,13 +840,14 @@ done #00172: TODO %patch173 -p1 #00174: TODO -%patch175 -p1 +# 00175: upstream as of Python 3.3.2 # 00176: upstream as of Python 3.3.1 %patch177 -p1 %patch178 -p1 %patch179 -p1 %patch180 -p1 -%patch181 -p1 +# 00181: not for python3 +%patch182 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1686,6 +1688,12 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Thu May 16 2013 Bohuslav Kabrda - 3.3.2-1 +- Updated to Python 3.3.2. +- Refreshed patches: 153 (gdb test noise) +- Dropped patches: 175 (configure -Wformat, fixed upstream) +- Synced patch numbers with python.spec. + * Thu May 9 2013 David Malcolm - 3.3.1-4 - fix test.test_gdb.PyBtTests.test_threads on ppc64 (patch 181; rhbz#960010) diff --git a/sources b/sources index b8490ab..acfd2af 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -993232d9f4d9b4863cc1ec69a792e9cd Python-3.3.1.tar.xz +c94b78ea3b68a9bbc9906af4d5b4fdc7 Python-3.3.2.tar.xz From d4ea6cd7259c332e0c009f71593b09ea45ff151a Mon Sep 17 00:00:00 2001 From: Bohuslav Kabrda Date: Thu, 16 May 2013 16:49:09 +0200 Subject: [PATCH 137/416] Drop the forgotten gdb test patch that was merged upstream --- python3.spec | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/python3.spec b/python3.spec index a7d1d97..a35ec9d 100644 --- a/python3.spec +++ b/python3.spec @@ -585,12 +585,8 @@ Patch180: 00180-python-add-support-for-ppc64p7.patch # Does not affect python3 # 00181 # -# Fix test.test_gdb.PyBtTests.test_threads on ppc64 -# Cherrypicked from upstream commit: -# http://hg.python.org/cpython/rev/f4a6b731905a/ -# for upstream issue http://bugs.python.org/issue17833 -# (rhbz#960010) -Patch182: 00182-fix-test_gdb-test_threads.patch +# Fixed upstream as of Python 3.3.2 +# Patch182: 00182-fix-test_gdb-test_threads.patch # (New patches go here ^^^) @@ -847,7 +843,7 @@ done %patch179 -p1 %patch180 -p1 # 00181: not for python3 -%patch182 -p1 +# 00182: upstream as of Python 3.3.2 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1691,7 +1687,8 @@ rm -fr %{buildroot} * Thu May 16 2013 Bohuslav Kabrda - 3.3.2-1 - Updated to Python 3.3.2. - Refreshed patches: 153 (gdb test noise) -- Dropped patches: 175 (configure -Wformat, fixed upstream) +- Dropped patches: 175 (configure -Wformat, fixed upstream), 182 (gdb +test threads) - Synced patch numbers with python.spec. * Thu May 9 2013 David Malcolm - 3.3.1-4 From fda6bedf044b9ea96b1cfc3324f575c06cf92c55 Mon Sep 17 00:00:00 2001 From: Bohuslav Kabrda Date: Thu, 16 May 2013 16:49:09 +0200 Subject: [PATCH 138/416] Drop the forgotten gdb test patch that was merged upstream --- python3.spec | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/python3.spec b/python3.spec index a7d1d97..a35ec9d 100644 --- a/python3.spec +++ b/python3.spec @@ -585,12 +585,8 @@ Patch180: 00180-python-add-support-for-ppc64p7.patch # Does not affect python3 # 00181 # -# Fix test.test_gdb.PyBtTests.test_threads on ppc64 -# Cherrypicked from upstream commit: -# http://hg.python.org/cpython/rev/f4a6b731905a/ -# for upstream issue http://bugs.python.org/issue17833 -# (rhbz#960010) -Patch182: 00182-fix-test_gdb-test_threads.patch +# Fixed upstream as of Python 3.3.2 +# Patch182: 00182-fix-test_gdb-test_threads.patch # (New patches go here ^^^) @@ -847,7 +843,7 @@ done %patch179 -p1 %patch180 -p1 # 00181: not for python3 -%patch182 -p1 +# 00182: upstream as of Python 3.3.2 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1691,7 +1687,8 @@ rm -fr %{buildroot} * Thu May 16 2013 Bohuslav Kabrda - 3.3.2-1 - Updated to Python 3.3.2. - Refreshed patches: 153 (gdb test noise) -- Dropped patches: 175 (configure -Wformat, fixed upstream) +- Dropped patches: 175 (configure -Wformat, fixed upstream), 182 (gdb +test threads) - Synced patch numbers with python.spec. * Thu May 9 2013 David Malcolm - 3.3.1-4 From 22e1cc9fb879ab1b423c8ba939738b9e7ac6a797 Mon Sep 17 00:00:00 2001 From: Bohuslav Kabrda Date: Mon, 20 May 2013 08:04:03 +0200 Subject: [PATCH 139/416] Add patch for CVE-2013-2099 (rhbz#963261). --- ...2013-2099-fix-ssl-match_hostname-dos.patch | 49 +++++++++++++++++++ python3.spec | 14 +++++- 2 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 00183-cve-2013-2099-fix-ssl-match_hostname-dos.patch diff --git a/00183-cve-2013-2099-fix-ssl-match_hostname-dos.patch b/00183-cve-2013-2099-fix-ssl-match_hostname-dos.patch new file mode 100644 index 0000000..888b43b --- /dev/null +++ b/00183-cve-2013-2099-fix-ssl-match_hostname-dos.patch @@ -0,0 +1,49 @@ +# HG changeset patch +# User Antoine Pitrou +# Date 1368892602 -7200 +# Node ID c627638753e2d25a98950585b259104a025937a9 +# Parent 9682241dc8fcb4b1aef083bd30860efa070c3d6d +Issue #17980: Fix possible abuse of ssl.match_hostname() for denial of service using certificates with many wildcards (CVE-2013-2099). + +diff --git a/Lib/ssl.py b/Lib/ssl.py +--- a/Lib/ssl.py ++++ b/Lib/ssl.py +@@ -129,9 +129,16 @@ class CertificateError(ValueError): + pass + + +-def _dnsname_to_pat(dn): ++def _dnsname_to_pat(dn, max_wildcards=1): + pats = [] + for frag in dn.split(r'.'): ++ if frag.count('*') > 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)) + if frag == '*': + # When '*' is a fragment by itself, it matches a non-empty dotless + # fragment. +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 +@@ -349,6 +349,17 @@ class BasicSocketTests(unittest.TestCase + 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*'),),)} ++ ok(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) diff --git a/python3.spec b/python3.spec index a35ec9d..93d8ab7 100644 --- a/python3.spec +++ b/python3.spec @@ -126,7 +126,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 1%{?dist} +Release: 2%{?dist} License: Python Group: Development/Languages @@ -584,10 +584,16 @@ Patch180: 00180-python-add-support-for-ppc64p7.patch # Patch181: 00181-allow-arbitrary-timeout-in-condition-wait.patch # Does not affect python3 -# 00181 # +# 00182 # # Fixed upstream as of Python 3.3.2 # Patch182: 00182-fix-test_gdb-test_threads.patch +# 00183 # +# Upstream fix for CVE-2013-2099 (ssl.match_hostname DOS) +# http://bugs.python.org/issue17980 +# http://hg.python.org/cpython/rev/c627638753e2 +Patch183: 00183-cve-2013-2099-fix-ssl-match_hostname-dos.patch + # (New patches go here ^^^) # @@ -844,6 +850,7 @@ done %patch180 -p1 # 00181: not for python3 # 00182: upstream as of Python 3.3.2 +%patch183 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1684,6 +1691,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon May 20 2013 Bohuslav Kabrda - 3.3.2-2 +- Add patch for CVE-2013-2099 (rhbz#963261). + * Thu May 16 2013 Bohuslav Kabrda - 3.3.2-1 - Updated to Python 3.3.2. - Refreshed patches: 153 (gdb test noise) From 001a27780cc890539b77728dfdee06384be4d54b Mon Sep 17 00:00:00 2001 From: Bohuslav Kabrda Date: Tue, 2 Jul 2013 08:21:42 +0200 Subject: [PATCH 140/416] Fix build with libffi containing multilib wrapper for ffi.h (rhbz#979696). --- ...should-build-with-libffi-multilib-wrapper.patch | 12 ++++++++++++ python3.spec | 14 +++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 00184-ctypes-should-build-with-libffi-multilib-wrapper.patch 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..e224fc6 --- /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/python3.spec b/python3.spec index 93d8ab7..08ad043 100644 --- a/python3.spec +++ b/python3.spec @@ -126,7 +126,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 2%{?dist} +Release: 3%{?dist} License: Python Group: Development/Languages @@ -594,6 +594,14 @@ Patch180: 00180-python-add-support-for-ppc64p7.patch # http://hg.python.org/cpython/rev/c627638753e2 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 ^^^) # @@ -851,6 +859,7 @@ done # 00181: not for python3 # 00182: upstream as of Python 3.3.2 %patch183 -p1 +%patch184 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1691,6 +1700,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Tue Jul 02 2013 Bohuslav Kabrda - 3.3.2-3 +- Fix build with libffi containing multilib wrapper for ffi.h (rhbz#979696). + * Mon May 20 2013 Bohuslav Kabrda - 3.3.2-2 - Add patch for CVE-2013-2099 (rhbz#963261). From 486eb43517e1ebc1cf5c24e1b53a3c88f83fa874 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Fri, 26 Jul 2013 12:13:47 -0500 Subject: [PATCH 141/416] disable a test that fails on arm - enable valgrind support on arm arches --- python3-arm-skip-failing-fragile-test.patch | 12 ++++++++++++ python3.spec | 14 +++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 python3-arm-skip-failing-fragile-test.patch diff --git a/python3-arm-skip-failing-fragile-test.patch b/python3-arm-skip-failing-fragile-test.patch new file mode 100644 index 0000000..affe99a --- /dev/null +++ b/python3-arm-skip-failing-fragile-test.patch @@ -0,0 +1,12 @@ +--- Python-3.3.2/Lib/test/test_gdb.py.orig 2013-07-26 09:52:15.533852708 -0500 ++++ Python-3.3.2/Lib/test/test_gdb.py 2013-07-26 12:08:36.338848587 -0500 +@@ -729,8 +729,7 @@ + foo\(1, 2, 3\) + ''') + +- @unittest.skipUnless(_thread, +- "Python was compiled without thread support") ++ @unittest.skip('Known failure on ARM: https://bugzilla.redhat.com/show_bug.cgi?id=986713') + def test_threads(self): + 'Verify that "py-bt" indicates threads that are waiting for the GIL' + cmd = ''' diff --git a/python3.spec b/python3.spec index 08ad043..96e194a 100644 --- a/python3.spec +++ b/python3.spec @@ -57,7 +57,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 %{ix86} x86_64 ppc %{power64} s390x %{arm} %global with_valgrind 1 %else %global with_valgrind 0 @@ -126,7 +126,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 3%{?dist} +Release: 4%{?dist} License: Python Group: Development/Languages @@ -342,7 +342,9 @@ Patch137: 00137-skip-distutils-tests-that-fail-in-rpmbuild.patch # http://bugs.python.org/issue8265 (rhbz#706253) Patch139: 00139-skip-test_float-known-failure-on-arm.patch -# 00140 # +# ideally short lived patch disabling a test thats fragile on different arches +Patch140: python3-arm-skip-failing-fragile-test.patch + # Patch140: 00140-skip-test_ctypes-known-failure-on-sparc.patch does not appear # to be relevant for python3 @@ -603,6 +605,7 @@ Patch183: 00183-cve-2013-2099-fix-ssl-match_hostname-dos.patch Patch184: 00184-ctypes-should-build-with-libffi-multilib-wrapper.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora 17 onwards, @@ -810,6 +813,7 @@ done # 00138: not for python3 %ifarch %{arm} %patch139 -p1 +%patch140 -p1 %endif # 00140: not for python3 %patch141 -p1 @@ -1700,6 +1704,10 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Fri Jul 26 2013 Dennis Gilmore - 3.3.2-4 +- disable a test that fails on arm +- enable valgrind support on arm arches + * Tue Jul 02 2013 Bohuslav Kabrda - 3.3.2-3 - Fix build with libffi containing multilib wrapper for ffi.h (rhbz#979696). From 24d06d1fa4bcfa2a27922c6e53bee09512bbad95 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Fri, 26 Jul 2013 15:08:13 -0500 Subject: [PATCH 142/416] fix up indentation --- python3-arm-skip-failing-fragile-test.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python3-arm-skip-failing-fragile-test.patch b/python3-arm-skip-failing-fragile-test.patch index affe99a..3c2fa09 100644 --- a/python3-arm-skip-failing-fragile-test.patch +++ b/python3-arm-skip-failing-fragile-test.patch @@ -1,12 +1,12 @@ --- Python-3.3.2/Lib/test/test_gdb.py.orig 2013-07-26 09:52:15.533852708 -0500 -+++ Python-3.3.2/Lib/test/test_gdb.py 2013-07-26 12:08:36.338848587 -0500 ++++ Python-3.3.2/Lib/test/test_gdb.py 2013-07-26 15:07:53.733623014 -0500 @@ -729,8 +729,7 @@ foo\(1, 2, 3\) ''') - @unittest.skipUnless(_thread, - "Python was compiled without thread support") -+ @unittest.skip('Known failure on ARM: https://bugzilla.redhat.com/show_bug.cgi?id=986713') ++ @unittest.skip('Known failure on ARM: https://bugzilla.redhat.com/show_bug.cgi?id=986713') def test_threads(self): 'Verify that "py-bt" indicates threads that are waiting for the GIL' cmd = ''' From fbccd698d330081dd5f4cf1c6b828a185176176d Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Fri, 26 Jul 2013 15:09:54 -0500 Subject: [PATCH 143/416] fix up indentation in arm patch --- python3.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 96e194a..2563d98 100644 --- a/python3.spec +++ b/python3.spec @@ -126,7 +126,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 4%{?dist} +Release: 5%{?dist} License: Python Group: Development/Languages @@ -1704,6 +1704,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Fri Jul 26 2013 Dennis Gilmore - 3.3.2-5 +- fix up indentation in arm patch + * Fri Jul 26 2013 Dennis Gilmore - 3.3.2-4 - disable a test that fails on arm - enable valgrind support on arm arches From 8aaa11c1b0cdd553f60b88709f460d7cd5576c4a Mon Sep 17 00:00:00 2001 From: Matej Stuchlik Date: Fri, 23 Aug 2013 10:12:43 +0200 Subject: [PATCH 144/416] Added fix for CVE-2013-4238 (rhbz#996399) --- ...-hostname-check-bypass-in-SSL-module.patch | 241 ++++++++++++++++++ python3.spec | 12 +- 2 files changed, 252 insertions(+), 1 deletion(-) create mode 100644 00185-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch 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..41db4d2 --- /dev/null +++ b/00185-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch @@ -0,0 +1,241 @@ +diff -r e0f86c3b3685 Lib/test/nullbytecert.pem +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/Lib/test/nullbytecert.pem Sun Aug 11 18:17:23 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 e0f86c3b3685 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:17:23 2013 +0200 +@@ -55,6 +55,7 @@ + WRONGCERT = data_file("XXXnonexisting.pem") + BADKEY = data_file("badkey.pem") + NOKIACERT = data_file("nokia.pem") ++NULLBYTECERT = data_file("nullbytecert.pem") + + DHFILE = data_file("dh512.pem") + BYTES_DHFILE = os.fsencode(DHFILE) +@@ -162,6 +163,27 @@ + ('DNS', 'projects.forum.nokia.com')) + ) + ++ def test_parse_cert_CVE_2013_4073(self): ++ p = ssl._ssl._test_decode_cert(NULLBYTECERT) ++ if 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@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@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() +@@ -294,6 +316,13 @@ + 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') ++ + # Slightly fake real-world example + cert = {'notAfter': 'Jun 26 21:41:46 2011 GMT', + 'subject': ((('commonName', 'linuxfrz.org'),),), +diff -r e0f86c3b3685 Modules/_ssl.c +--- a/Modules/_ssl.c Sun Aug 11 13:04:50 2013 +0300 ++++ b/Modules/_ssl.c Sun Aug 11 18:17:23 2013 +0200 +@@ -771,12 +771,14 @@ + ext->value->length)); + + for(j = 0; j < sk_GENERAL_NAME_num(names); j++) { +- + /* 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 */ + +@@ -798,11 +800,62 @@ + 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 = PyUnicode_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_WarnFormat(PyExc_RuntimeWarning, 1, ++ "Unknown general name type %d", ++ gntype) == -1) { ++ goto fail; ++ } ++ break; ++ } + (void) BIO_reset(biobuf); + GENERAL_NAME_print(biobuf, name); + len = BIO_gets(biobuf, buf, sizeof(buf)-1); +@@ -829,6 +882,7 @@ + goto fail; + } + PyTuple_SET_ITEM(t, 1, v); ++ break; + } + + /* and add that rendering to the list */ diff --git a/python3.spec b/python3.spec index 2563d98..9ad3e67 100644 --- a/python3.spec +++ b/python3.spec @@ -126,7 +126,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 5%{?dist} +Release: 6%{?dist} License: Python Group: Development/Languages @@ -604,6 +604,12 @@ Patch183: 00183-cve-2013-2099-fix-ssl-match_hostname-dos.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 +# http://bugs.python.org/issue18709 +# rhbz#996399 +Patch185: 00185-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch # (New patches go here ^^^) @@ -864,6 +870,7 @@ done # 00182: upstream as of Python 3.3.2 %patch183 -p1 %patch184 -p1 +%patch185 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1704,6 +1711,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Fri Aug 23 2013 Matej Stuchlik - 3.3.2-6 +- Added fix for CVE-2013-4238 (rhbz#996399) + * Fri Jul 26 2013 Dennis Gilmore - 3.3.2-5 - fix up indentation in arm patch From 3dbbc14e760256f1b8bf22b0a64e0234c4708ac5 Mon Sep 17 00:00:00 2001 From: Bohuslav Kabrda Date: Wed, 30 Oct 2013 10:50:01 +0100 Subject: [PATCH 145/416] Bytecompile all *.py files properly during build (rhbz#1023607) --- 00186-dont-raise-from-py_compile.patch | 41 ++++++++++++++++++++++ check-pyc-and-pyo-timestamps.py | 48 ++++++++++++++++++++++++++ python3.spec | 30 ++++++++++++++-- 3 files changed, 116 insertions(+), 3 deletions(-) create mode 100644 00186-dont-raise-from-py_compile.patch create mode 100644 check-pyc-and-pyo-timestamps.py diff --git a/00186-dont-raise-from-py_compile.patch b/00186-dont-raise-from-py_compile.patch new file mode 100644 index 0000000..1e7fb06 --- /dev/null +++ b/00186-dont-raise-from-py_compile.patch @@ -0,0 +1,41 @@ +diff -r 7fa3e824a4ee Lib/py_compile.py +--- a/Lib/py_compile.py Tue Oct 29 22:25:06 2013 -0400 ++++ b/Lib/py_compile.py Wed Oct 30 11:08:31 2013 +0100 +@@ -108,15 +108,15 @@ + byte-compile all installed files (or all files in selected + directories). + """ +- with tokenize.open(file) as f: +- try: +- st = os.fstat(f.fileno()) +- except AttributeError: +- st = os.stat(file) +- timestamp = int(st.st_mtime) +- size = st.st_size & 0xFFFFFFFF +- codestring = f.read() + try: ++ with tokenize.open(file) as f: ++ try: ++ st = os.fstat(f.fileno()) ++ except AttributeError: ++ st = os.stat(file) ++ timestamp = int(st.st_mtime) ++ size = st.st_size & 0xFFFFFFFF ++ codestring = f.read() + codeobject = builtins.compile(codestring, dfile or file, 'exec', + optimize=optimize) + except Exception as err: +diff -r 7fa3e824a4ee Lib/test/test_py_compile.py +--- a/Lib/test/test_py_compile.py Tue Oct 29 22:25:06 2013 -0400 ++++ b/Lib/test/test_py_compile.py Wed Oct 30 11:08:31 2013 +0100 +@@ -54,6 +54,10 @@ + self.assertTrue(os.path.exists(self.pyc_path)) + self.assertFalse(os.path.exists(self.cache_path)) + ++ def test_bad_coding(self): ++ bad_coding = os.path.join(os.path.dirname(__file__), 'bad_coding2.py') ++ self.assertIsNone(py_compile.compile(bad_coding, doraise=False)) ++ + def test_main(): + support.run_unittest(PyCompileTests) + diff --git a/check-pyc-and-pyo-timestamps.py b/check-pyc-and-pyo-timestamps.py new file mode 100644 index 0000000..bcd5baf --- /dev/null +++ b/check-pyc-and-pyo-timestamps.py @@ -0,0 +1,48 @@ +"""Checks if all *.pyc and *.pyo files have later mtime than their *.py files.""" + +import imp +import os +import sys + +# list of test and other files that we expect not to have bytecode +not_compiled = [ + 'test/bad_coding.py', + 'test/bad_coding2.py', + 'test/badsyntax_3131.py', + 'test/badsyntax_future3.py', + 'test/badsyntax_future4.py', + 'test/badsyntax_future5.py', + 'test/badsyntax_future6.py', + 'test/badsyntax_future7.py', + 'test/badsyntax_future8.py', + 'test/badsyntax_future9.py', + 'test/badsyntax_pep3120.py', + 'lib2to3/tests/data/bom.py', + 'lib2to3/tests/data/crlf.py', + 'lib2to3/tests/data/different_encoding.py', + 'lib2to3/tests/data/py2_test_grammar.py', + '.debug-gdb.py', +] +failed = 0 + +def bytecode_expected(source): + for f in not_compiled: + if source.endswith(f): + return False + return True + +compiled = filter(lambda f: bytecode_expected(f), sys.argv[1:]) +for f in compiled: + # check both pyo and pyc + to_check = map(lambda b: imp.cache_from_source(f, b), (True, False)) + f_mtime = os.path.getmtime(f) + for c in to_check: + c_mtime = os.path.getmtime(c) + if c_mtime < f_mtime: + sys.stderr.write('Failed bytecompilation timestamps check: ') + sys.stderr.write('Bytecode file {} is older than source file {}.\n'.format(c, f)) + failed += 1 + +if failed: + sys.stderr.write('\n{} files failed bytecompilation timestamps check.\n'.format(failed)) + sys.exit(1) diff --git a/python3.spec b/python3.spec index 9ad3e67..f445372 100644 --- a/python3.spec +++ b/python3.spec @@ -126,7 +126,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 6%{?dist} +Release: 7%{?dist} License: Python Group: Development/Languages @@ -217,6 +217,10 @@ Source6: systemtap-example.stp # Written by dmalcolm; not yet sent upstream Source7: pyfuntop.stp +# A simple script to check timestamps of bytecode files +# Run in check section with Python that is currently being built +# Written by bkabrda +Source8: check-pyc-and-pyo-timestamps.py # Fixup distutils/unixccompiler.py to remove standard library path from rpath: # Was Patch0 in ivazquez' python3000 specfile: @@ -611,6 +615,14 @@ Patch184: 00184-ctypes-should-build-with-libffi-multilib-wrapper.patch # rhbz#996399 Patch185: 00185-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch +# 00186 # +# Fix for https://bugzilla.redhat.com/show_bug.cgi?id=1023607 +# Fixes the problem of some *.py files not being bytecompiled properly +# during build. This was result of py_compile.compile raising exception +# when trying to convert test file with bad encoding, and thus not +# continuing bytecompilation for other files. +Patch186: 00186-dont-raise-from-py_compile.patch + # (New patches go here ^^^) # @@ -871,6 +883,7 @@ done %patch183 -p1 %patch184 -p1 %patch185 -p1 +%patch186 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1200,12 +1213,12 @@ iconv -f iso8859-1 -t utf-8 %{buildroot}/%{pylibdir}/Demo/rpc/README > README.co # 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" \ + 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" \ + 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], optimize=0) for f in sys.argv[1:]]' || : # Fixup permissions for shared libraries from non-standard 555 to standard 755: @@ -1287,6 +1300,14 @@ sed \ # ====================================================== %check + +# first of all, check timestamps of bytecode files +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} %{SOURCE8} + + topdir=$(pwd) CheckPython() { ConfName=$1 @@ -1711,6 +1732,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Wed Oct 30 2013 Bohuslav Kabrda - 3.3.2-7 +- Bytecompile all *.py files properly during build (rhbz#1023607) + * Fri Aug 23 2013 Matej Stuchlik - 3.3.2-6 - Added fix for CVE-2013-4238 (rhbz#996399) From f5250ecae71c9215886d2cf76d00c9f0662532be Mon Sep 17 00:00:00 2001 From: Bohuslav Kabrda Date: Tue, 5 Nov 2013 12:39:14 +0100 Subject: [PATCH 146/416] Update to Python 3.4 alpha 4. - Refreshed patches: 55 (systemtap), 102 (lib64), 111 (no static lib), 114 (statvfs flags), 132 (unittest rpmbuild hooks), 134 (fix COUNT_ALLOCS in test_sys), 143 (tsc on ppc64), 146 (hashlib fips), 153 (test gdb noise), 157 (UID+GID overflows), 173 (ENOPROTOOPT in bind_port), 186 (dont raise from py_compile) - Removed patches: 129 (test_subprocess nonreadable dir - no longer fails in Koji), 142 (the mock issue that caused this is fixed) - Added patch 187 (remove thread atfork) - will be in next version - Refreshed script for checking pyc and pyo timestamps with new ignored files. - The fips patch is disabled for now until upstream makes a final decision what to do with sha3 implementation for 3.4.0. --- 00055-systemtap.patch | 6 +- 00111-no-static-lib.patch | 4 +- 00114-statvfs-f_flag-constants.patch | 22 +- 00132-add-rpmbuild-hooks-to-unittest.patch | 6 +- ...fix-COUNT_ALLOCS-failure-in-test_sys.patch | 4 +- ...2-skip-failing-pty-tests-in-rpmbuild.patch | 22 -- 00143-tsc-on-ppc.patch | 2 +- 00146-hashlib-fips.patch | 29 ++- 00153-fix-test_gdb-noise.patch | 2 +- 00157-uid-gid-overflows.patch | 12 +- ...-workaround-ENOPROTOOPT-in-bind_port.patch | 5 +- 00182-fix-test_gdb-test_threads.patch | 13 - ...2013-2099-fix-ssl-match_hostname-dos.patch | 49 ---- ...-hostname-check-bypass-in-SSL-module.patch | 241 ------------------ 00186-dont-raise-from-py_compile.patch | 33 +-- 00187-remove-pthread-atfork.patch | 89 +++++++ check-pyc-and-pyo-timestamps.py | 2 + ...subprocess-with-nonreadable-path-dir.patch | 12 - python-3.3.0b1-lib64.patch | 6 +- python3.spec | 95 +++---- 20 files changed, 192 insertions(+), 462 deletions(-) delete mode 100644 00142-skip-failing-pty-tests-in-rpmbuild.patch delete mode 100644 00182-fix-test_gdb-test_threads.patch delete mode 100644 00183-cve-2013-2099-fix-ssl-match_hostname-dos.patch delete mode 100644 00185-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch create mode 100644 00187-remove-pthread-atfork.patch delete mode 100644 python-3.2.1-fix-test-subprocess-with-nonreadable-path-dir.patch diff --git a/00055-systemtap.patch b/00055-systemtap.patch index 90b876b..ddd5e77 100644 --- a/00055-systemtap.patch +++ b/00055-systemtap.patch @@ -650,8 +650,8 @@ diff -up Python-3.3.0rc2/Makefile.pre.in.systemtap Python-3.3.0rc2/Makefile.pre. +Python/ceval.o: $(OPCODETARGETS_H) $(srcdir)/Python/ceval_gil.h \ + $(srcdir)/Python/ceval_systemtap.h @SYSTEMTAPDEPS@ - Python/formatter_unicode.o: $(srcdir)/Python/formatter_unicode.c \ - $(BYTESTR_DEPS) + Python/frozen.o: Python/importlib.h + @@ -724,6 +726,13 @@ Objects/typeobject.o: $(srcdir)/Objects/ Objects/typeslots.inc: $(srcdir)/Include/typeslots.h $(srcdir)/Objects/typeslots.py $(PYTHON) $(srcdir)/Objects/typeslots.py < $(srcdir)/Include/typeslots.h > Objects/typeslots.inc @@ -735,8 +735,8 @@ diff -up Python-3.3.0rc2/Python/ceval.c.systemtap Python-3.3.0rc2/Python/ceval.c + } + Py_LeaveRecursiveCall(); + f->f_executing = 0; tstate->frame = f->f_back; - diff -up Python-3.3.0rc2/Python/ceval_systemtap.h.systemtap Python-3.3.0rc2/Python/ceval_systemtap.h --- Python-3.3.0rc2/Python/ceval_systemtap.h.systemtap 2012-09-10 09:17:21.122511781 -0400 +++ Python-3.3.0rc2/Python/ceval_systemtap.h 2012-09-10 09:17:21.122511781 -0400 diff --git a/00111-no-static-lib.patch b/00111-no-static-lib.patch index bd63852..f74bc87 100644 --- a/00111-no-static-lib.patch +++ b/00111-no-static-lib.patch @@ -2,7 +2,7 @@ diff -up cpython-59223da36dec/Makefile.pre.in.no-static-lib cpython-59223da36dec --- cpython-59223da36dec/Makefile.pre.in.no-static-lib 2012-08-07 16:43:43.296466422 -0400 +++ cpython-59223da36dec/Makefile.pre.in 2012-08-07 16:44:13.299464371 -0400 @@ -464,7 +464,7 @@ coverage: - + $(MAKE) coverage-lcov # Build the interpreter -$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) @@ -11,7 +11,7 @@ diff -up cpython-59223da36dec/Makefile.pre.in.no-static-lib cpython-59223da36dec platform: $(BUILDPYTHON) pybuilddir.txt @@ -480,18 +480,6 @@ sharedmods: $(BUILDPYTHON) $(SYSCONFIGDA - $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ + _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build -# Build static library diff --git a/00114-statvfs-f_flag-constants.patch b/00114-statvfs-f_flag-constants.patch index af0d780..ea99e08 100644 --- a/00114-statvfs-f_flag-constants.patch +++ b/00114-statvfs-f_flag-constants.patch @@ -2,38 +2,38 @@ diff -up Python-3.3.0b1/Modules/posixmodule.c.statvfs-f_flag-constants Python-3. --- Python-3.3.0b1/Modules/posixmodule.c.statvfs-f_flag-constants 2012-06-26 16:19:54.000000000 -0400 +++ Python-3.3.0b1/Modules/posixmodule.c 2012-07-20 13:39:18.595546387 -0400 @@ -11665,6 +11665,35 @@ all_ins(PyObject *d) - if (ins(d, "ST_NOSUID", (long)ST_NOSUID)) return -1; + if (PyModule_AddIntMacro(m, ST_NOSUID)) return -1; #endif /* ST_NOSUID */ + /* GNU extensions */ +#ifdef ST_NODEV -+ if (ins(d, "ST_NODEV", (long)ST_NODEV)) return -1; ++ if (PyModule_AddIntMacro(m, ST_NODEV)) return -1; +#endif /* ST_NODEV */ +#ifdef ST_NOEXEC -+ if (ins(d, "ST_NOEXEC", (long)ST_NOEXEC)) return -1; ++ if (PyModule_AddIntMacro(m, ST_NOEXEC)) return -1; +#endif /* ST_NOEXEC */ +#ifdef ST_SYNCHRONOUS -+ if (ins(d, "ST_SYNCHRONOUS", (long)ST_SYNCHRONOUS)) return -1; ++ if (PyModule_AddIntMacro(m, ST_SYNCHRONOUS)) return -1; +#endif /* ST_SYNCHRONOUS */ +#ifdef ST_MANDLOCK -+ if (ins(d, "ST_MANDLOCK", (long)ST_MANDLOCK)) return -1; ++ if (PyModule_AddIntMacro(m, ST_MANDLOCK)) return -1; +#endif /* ST_MANDLOCK */ +#ifdef ST_WRITE -+ if (ins(d, "ST_WRITE", (long)ST_WRITE)) return -1; ++ if (PyModule_AddIntMacro(m, ST_WRITE)) return -1; +#endif /* ST_WRITE */ +#ifdef ST_APPEND -+ if (ins(d, "ST_APPEND", (long)ST_APPEND)) return -1; ++ if (PyModule_AddIntMacro(m, ST_APPEND)) return -1; +#endif /* ST_APPEND */ +#ifdef ST_NOATIME -+ if (ins(d, "ST_NOATIME", (long)ST_NOATIME)) return -1; ++ if (PyModule_AddIntMacro(m, ST_NOATIME)) return -1; +#endif /* ST_NOATIME */ +#ifdef ST_NODIRATIME -+ if (ins(d, "ST_NODIRATIME", (long)ST_NODIRATIME)) return -1; ++ if (PyModule_AddIntMacro(m, ST_NODIRATIME)) return -1; +#endif /* ST_NODIRATIME */ +#ifdef ST_RELATIME -+ if (ins(d, "ST_RELATIME", (long)ST_RELATIME)) return -1; ++ if (PyModule_AddIntMacro(m, ST_RELATIME)) return -1; +#endif /* ST_RELATIME */ + /* FreeBSD sendfile() constants */ #ifdef SF_NODISKIO - if (ins(d, "SF_NODISKIO", (long)SF_NODISKIO)) return -1; + if (PyModule_AddIntMacro(m, SF_NODISKIO)) return -1; diff --git a/00132-add-rpmbuild-hooks-to-unittest.patch b/00132-add-rpmbuild-hooks-to-unittest.patch index fdfbab8..20930ac 100644 --- a/00132-add-rpmbuild-hooks-to-unittest.patch +++ b/00132-add-rpmbuild-hooks-to-unittest.patch @@ -6,11 +6,11 @@ diff -up Python-3.2.2/Lib/unittest/case.py.add-rpmbuild-hooks-to-unittest Python import functools import difflib +import os + import logging import pprint import re - import warnings @@ -101,6 +102,43 @@ def expectedFailure(func): - return wrapper + raise self.test_case.failureException(msg) +# Non-standard/downstream-only hooks for handling issues with specific test @@ -50,7 +50,7 @@ diff -up Python-3.2.2/Lib/unittest/case.py.add-rpmbuild-hooks-to-unittest Python + func(*args, **kwargs) + return wrapper + - class _AssertRaisesBaseContext(object): + class _AssertRaisesBaseContext(_BaseTestCaseContext): def __init__(self, expected, test_case, callable_obj=None, diff -up Python-3.2.2/Lib/unittest/__init__.py.add-rpmbuild-hooks-to-unittest Python-3.2.2/Lib/unittest/__init__.py diff --git a/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch b/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch index 087705c..afd8685 100644 --- a/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch +++ b/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch @@ -4,14 +4,14 @@ diff -up Python-3.3.0b2/Lib/test/test_sys.py.fix-COUNT_ALLOCS-failure-in-test_sy @@ -835,12 +835,17 @@ class SizeofTest(unittest.TestCase): # type # static type: PyTypeObject - s = vsize('P2n15Pl4Pn9Pn11PI') + s = vsize('P2n15Pl4Pn9Pn11PIP') + # COUNT_ALLOCS adds a further 3 Py_ssize_t and 2 pointers: + if hasattr(sys, 'getcounts'): + s += struct.calcsize('3P2P') check(int, s) # (PyTypeObject + PyNumberMethods + PyMappingMethods + # PySequenceMethods + PyBufferProcs + 4P) - s = vsize('P2n15Pl4Pn9Pn11PI') + struct.calcsize('34P 3P 10P 2P 4P') + s = vsize('P2n15Pl4Pn9Pn11PIP') + struct.calcsize('34P 3P 10P 2P 4P') # Separate block for PyDictKeysObject with 4 entries s += struct.calcsize("2nPn") + 4*struct.calcsize("n2P") + if hasattr(sys, 'getcounts'): diff --git a/00142-skip-failing-pty-tests-in-rpmbuild.patch b/00142-skip-failing-pty-tests-in-rpmbuild.patch deleted file mode 100644 index 414ffcd..0000000 --- a/00142-skip-failing-pty-tests-in-rpmbuild.patch +++ /dev/null @@ -1,22 +0,0 @@ -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/00143-tsc-on-ppc.patch b/00143-tsc-on-ppc.patch index 447c6e3..7d3e876 100644 --- a/00143-tsc-on-ppc.patch +++ b/00143-tsc-on-ppc.patch @@ -31,7 +31,7 @@ diff -up Python-2.7.2/Python/ceval.c.tsc-on-ppc Python-2.7.2/Python/ceval.c -ppc_getcounter(uint64 *v) +ppc32_getcounter(uint64 *v) { -- register unsigned long tbu, tb, tbu2; +- unsigned long tbu, tb, tbu2; + union { long long ll; long ii[2]; } u; + long tmp; diff --git a/00146-hashlib-fips.patch b/00146-hashlib-fips.patch index f22d9bd..18b6a44 100644 --- a/00146-hashlib-fips.patch +++ b/00146-hashlib-fips.patch @@ -73,9 +73,9 @@ diff -up Python-3.2.2/Lib/hashlib.py.hashlib-fips Python-3.2.2/Lib/hashlib.py diff -up Python-3.2.2/Lib/test/test_hashlib.py.hashlib-fips Python-3.2.2/Lib/test/test_hashlib.py --- Python-3.2.2/Lib/test/test_hashlib.py.hashlib-fips 2011-09-03 12:16:43.000000000 -0400 +++ Python-3.2.2/Lib/test/test_hashlib.py 2011-09-14 01:45:48.462251974 -0400 -@@ -22,6 +22,19 @@ from test.support import _4G, precisionb - # Were we compiled --with-pydebug or with #define Py_DEBUG? - COMPILED_WITH_PYDEBUG = hasattr(sys, 'gettotalrefcount') +@@ -22,6 +22,20 @@ from test.support import _4G, precisionb + c_hashlib = import_fresh_module('hashlib', fresh=['_hashlib']) + py_hashlib = import_fresh_module('hashlib', blocked=['_hashlib']) +def openssl_enforces_fips(): + # Use the "openssl" command (if present) to try to determine if the local @@ -90,9 +90,10 @@ diff -up Python-3.2.2/Lib/test/test_hashlib.py.hashlib-fips Python-3.2.2/Lib/tes + stdout, stderr = p.communicate(input=b'abc') + return b'unknown cipher' in stderr +OPENSSL_ENFORCES_FIPS = openssl_enforces_fips() - ++ def hexstr(s): assert isinstance(s, bytes), repr(s) + h = "0123456789abcdef" @@ -31,6 +44,16 @@ def hexstr(s): r += h[(i >> 4) & 0xF] + h[i & 0xF] return r @@ -146,15 +147,15 @@ diff -up Python-3.2.2/Lib/test/test_hashlib.py.hashlib-fips Python-3.2.2/Lib/tes - self.constructors_to_test['sha384'].add(_sha512.sha384) - self.constructors_to_test['sha512'].add(_sha512.sha512) + constructors.add(suppress_fips(constructor)) - - super(HashLibTestCase, self).__init__(*args, **kwargs) - + _sha3 = self._conditional_import_module('_sha3') + if _sha3: + self.constructors_to_test['sha3_224'].add(_sha3.sha3_224) @@ -138,7 +146,7 @@ class HashLibTestCase(unittest.TestCase) def test_hexdigest(self): - for name in self.supported_hash_names: -- h = hashlib.new(name) -+ h = hashlib.new(name, usedforsecurity=False) + for cons in self.hash_constructors: +- h = cons() ++ h = cons(usedforsecurity=False) assert isinstance(h.digest(), bytes), name self.assertEqual(hexstr(h.digest()), h.hexdigest()) @@ -162,14 +163,14 @@ diff -up Python-3.2.2/Lib/test/test_hashlib.py.hashlib-fips Python-3.2.2/Lib/tes cees = b'c' * 126 for name in self.supported_hash_names: -- m1 = hashlib.new(name) -+ m1 = hashlib.new(name, usedforsecurity=False) +- m1 = cons() ++ m1 = cons(usedforsecurity=False) m1.update(aas) m1.update(bees) m1.update(cees) -- m2 = hashlib.new(name) -+ m2 = hashlib.new(name, usedforsecurity=False) +- m2 = cons() ++ m2 = cons(usedforsecurity=False) m2.update(aas + bees + cees) self.assertEqual(m1.digest(), m2.digest()) diff --git a/00153-fix-test_gdb-noise.patch b/00153-fix-test_gdb-noise.patch index 50a0917..87c9396 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"?', + 'warning: Source file is more recent than executable.', ) + ignore_patterns += ('warning: Unable to open', + 'Missing separate debuginfo for', diff --git a/00157-uid-gid-overflows.patch b/00157-uid-gid-overflows.patch index 0f48df5..bf82b60 100644 --- a/00157-uid-gid-overflows.patch +++ b/00157-uid-gid-overflows.patch @@ -4,35 +4,35 @@ diff -up Python-3.3.0b1/Lib/test/test_os.py.uid-gid-overflows Python-3.3.0b1/Lib @@ -1174,30 +1174,36 @@ if sys.platform != 'win32': def test_setuid(self): if os.getuid() != 0: - self.assertRaises(os.error, os.setuid, 0) + self.assertRaises(OSError, 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 and not HAVE_WHEEL_GROUP: - self.assertRaises(os.error, os.setgid, 0) + self.assertRaises(OSError, 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(OSError, 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 and not HAVE_WHEEL_GROUP: - self.assertRaises(os.error, os.setegid, 0) + self.assertRaises(OSError, 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(OSError, 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) @@ -41,7 +41,7 @@ diff -up Python-3.3.0b1/Lib/test/test_os.py.uid-gid-overflows Python-3.3.0b1/Lib @@ -1212,6 +1218,8 @@ if sys.platform != 'win32': def test_setregid(self): if os.getuid() != 0 and not HAVE_WHEEL_GROUP: - self.assertRaises(os.error, os.setregid, 0, 0) + self.assertRaises(OSError, 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) diff --git a/00173-workaround-ENOPROTOOPT-in-bind_port.patch b/00173-workaround-ENOPROTOOPT-in-bind_port.patch index a62c3a4..498322c 100644 --- a/00173-workaround-ENOPROTOOPT-in-bind_port.patch +++ b/00173-workaround-ENOPROTOOPT-in-bind_port.patch @@ -1,6 +1,6 @@ diff -up Python-3.3.0/Lib/test/support.py.rhbz913732 Python-3.3.0/Lib/test/support.py ---- Python-3.3.0/Lib/test/support.py.rhbz913732 2013-03-04 16:25:53.885258476 -0500 -+++ Python-3.3.0/Lib/test/support.py 2013-03-04 16:25:58.499258157 -0500 +--- Python-3.4.0a4/Lib/test/support/__init__.py.rhbz913732 2013-03-04 16:25:53.885258476 -0500 ++++ Python-3.4.0a4/Lib/test/support/__init__.py 2013-03-04 16:25:58.499258157 -0500 @@ -544,7 +544,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 " \ @@ -11,4 +11,3 @@ diff -up Python-3.3.0/Lib/test/support.py.rhbz913732 Python-3.3.0/Lib/test/suppo 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 -up Python-3.3.0/Lib/test/test_support.py.rhbz913732 Python-3.3.0/Lib/test/test_support.py diff --git a/00182-fix-test_gdb-test_threads.patch b/00182-fix-test_gdb-test_threads.patch deleted file mode 100644 index 41de5b2..0000000 --- a/00182-fix-test_gdb-test_threads.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -up Python-3.3.1/Misc/NEWS.fix-test_gdb-test_threads Python-3.3.1/Misc/NEWS -diff -up Python-3.3.1/Tools/gdb/libpython.py.fix-test_gdb-test_threads Python-3.3.1/Tools/gdb/libpython.py ---- Python-3.3.1/Tools/gdb/libpython.py.fix-test_gdb-test_threads 2013-05-09 12:12:01.621592211 -0400 -+++ Python-3.3.1/Tools/gdb/libpython.py 2013-05-09 12:12:01.632592209 -0400 -@@ -1465,7 +1465,7 @@ class Frame(object): - # This assumes the _POSIX_THREADS version of Python/ceval_gil.h: - name = self._gdbframe.name() - if name: -- return name.startswith('pthread_cond_timedwait') -+ return 'pthread_cond_timedwait' in name - - def is_gc_collect(self): - '''Is this frame "collect" within the garbage-collector?''' diff --git a/00183-cve-2013-2099-fix-ssl-match_hostname-dos.patch b/00183-cve-2013-2099-fix-ssl-match_hostname-dos.patch deleted file mode 100644 index 888b43b..0000000 --- a/00183-cve-2013-2099-fix-ssl-match_hostname-dos.patch +++ /dev/null @@ -1,49 +0,0 @@ -# HG changeset patch -# User Antoine Pitrou -# Date 1368892602 -7200 -# Node ID c627638753e2d25a98950585b259104a025937a9 -# Parent 9682241dc8fcb4b1aef083bd30860efa070c3d6d -Issue #17980: Fix possible abuse of ssl.match_hostname() for denial of service using certificates with many wildcards (CVE-2013-2099). - -diff --git a/Lib/ssl.py b/Lib/ssl.py ---- a/Lib/ssl.py -+++ b/Lib/ssl.py -@@ -129,9 +129,16 @@ class CertificateError(ValueError): - pass - - --def _dnsname_to_pat(dn): -+def _dnsname_to_pat(dn, max_wildcards=1): - pats = [] - for frag in dn.split(r'.'): -+ if frag.count('*') > 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)) - if frag == '*': - # When '*' is a fragment by itself, it matches a non-empty dotless - # fragment. -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 -@@ -349,6 +349,17 @@ class BasicSocketTests(unittest.TestCase - 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*'),),)} -+ ok(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) 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 41db4d2..0000000 --- a/00185-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch +++ /dev/null @@ -1,241 +0,0 @@ -diff -r e0f86c3b3685 Lib/test/nullbytecert.pem ---- /dev/null Thu Jan 01 00:00:00 1970 +0000 -+++ b/Lib/test/nullbytecert.pem Sun Aug 11 18:17:23 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 e0f86c3b3685 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:17:23 2013 +0200 -@@ -55,6 +55,7 @@ - WRONGCERT = data_file("XXXnonexisting.pem") - BADKEY = data_file("badkey.pem") - NOKIACERT = data_file("nokia.pem") -+NULLBYTECERT = data_file("nullbytecert.pem") - - DHFILE = data_file("dh512.pem") - BYTES_DHFILE = os.fsencode(DHFILE) -@@ -162,6 +163,27 @@ - ('DNS', 'projects.forum.nokia.com')) - ) - -+ def test_parse_cert_CVE_2013_4073(self): -+ p = ssl._ssl._test_decode_cert(NULLBYTECERT) -+ if 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@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@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() -@@ -294,6 +316,13 @@ - 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') -+ - # Slightly fake real-world example - cert = {'notAfter': 'Jun 26 21:41:46 2011 GMT', - 'subject': ((('commonName', 'linuxfrz.org'),),), -diff -r e0f86c3b3685 Modules/_ssl.c ---- a/Modules/_ssl.c Sun Aug 11 13:04:50 2013 +0300 -+++ b/Modules/_ssl.c Sun Aug 11 18:17:23 2013 +0200 -@@ -771,12 +771,14 @@ - ext->value->length)); - - for(j = 0; j < sk_GENERAL_NAME_num(names); j++) { -- - /* 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 */ - -@@ -798,11 +800,62 @@ - 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 = PyUnicode_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_WarnFormat(PyExc_RuntimeWarning, 1, -+ "Unknown general name type %d", -+ gntype) == -1) { -+ goto fail; -+ } -+ break; -+ } - (void) BIO_reset(biobuf); - GENERAL_NAME_print(biobuf, name); - len = BIO_gets(biobuf, buf, sizeof(buf)-1); -@@ -829,6 +882,7 @@ - goto fail; - } - PyTuple_SET_ITEM(t, 1, v); -+ break; - } - - /* and add that rendering to the list */ diff --git a/00186-dont-raise-from-py_compile.patch b/00186-dont-raise-from-py_compile.patch index 1e7fb06..25c4a9d 100644 --- a/00186-dont-raise-from-py_compile.patch +++ b/00186-dont-raise-from-py_compile.patch @@ -1,30 +1,3 @@ -diff -r 7fa3e824a4ee Lib/py_compile.py ---- a/Lib/py_compile.py Tue Oct 29 22:25:06 2013 -0400 -+++ b/Lib/py_compile.py Wed Oct 30 11:08:31 2013 +0100 -@@ -108,15 +108,15 @@ - byte-compile all installed files (or all files in selected - directories). - """ -- with tokenize.open(file) as f: -- try: -- st = os.fstat(f.fileno()) -- except AttributeError: -- st = os.stat(file) -- timestamp = int(st.st_mtime) -- size = st.st_size & 0xFFFFFFFF -- codestring = f.read() - try: -+ with tokenize.open(file) as f: -+ try: -+ st = os.fstat(f.fileno()) -+ except AttributeError: -+ st = os.stat(file) -+ timestamp = int(st.st_mtime) -+ size = st.st_size & 0xFFFFFFFF -+ codestring = f.read() - codeobject = builtins.compile(codestring, dfile or file, 'exec', - optimize=optimize) - except Exception as err: diff -r 7fa3e824a4ee Lib/test/test_py_compile.py --- a/Lib/test/test_py_compile.py Tue Oct 29 22:25:06 2013 -0400 +++ b/Lib/test/test_py_compile.py Wed Oct 30 11:08:31 2013 +0100 @@ -36,6 +9,6 @@ diff -r 7fa3e824a4ee Lib/test/test_py_compile.py + bad_coding = os.path.join(os.path.dirname(__file__), 'bad_coding2.py') + self.assertIsNone(py_compile.compile(bad_coding, doraise=False)) + - def test_main(): - support.run_unittest(PyCompileTests) - + def test_relative_path(self): + py_compile.compile(os.path.relpath(self.source_path), + os.path.relpath(self.pyc_path)) diff --git a/00187-remove-pthread-atfork.patch b/00187-remove-pthread-atfork.patch new file mode 100644 index 0000000..04af52d --- /dev/null +++ b/00187-remove-pthread-atfork.patch @@ -0,0 +1,89 @@ +diff -r 6fdbb81b4020 -r 705f2addd0f0 Modules/_ssl.c +--- a/Modules/_ssl.c Tue Oct 29 12:14:55 2013 +0100 ++++ b/Modules/_ssl.c Tue Oct 29 21:11:55 2013 +0100 +@@ -19,9 +19,6 @@ + #ifdef WITH_THREAD + #include "pythread.h" + +-#ifdef HAVE_PTHREAD_ATFORK +-# include +-#endif + + #define PySSL_BEGIN_ALLOW_THREADS_S(save) \ + do { if (_ssl_locks_count>0) { (save) = PyEval_SaveThread(); } } while (0) +@@ -2950,64 +2947,6 @@ + Returns number of bytes read. Raises SSLError if connection to EGD\n\ + fails or if it does not provide enough data to seed PRNG."); + +-/* Seed OpenSSL's PRNG at fork(), http://bugs.python.org/issue18747 +- * +- * The parent handler seeds the PRNG from pseudo-random data like pid, the +- * current time (miliseconds or seconds) and an uninitialized array. +- * The array contains stack variables that are impossible to predict +- * on most systems, e.g. function return address (subject to ASLR), the +- * stack protection canary and automatic variables. +- * The code is inspired by Apache's ssl_rand_seed() function. +- * +- * Note: +- * The code uses pthread_atfork() until Python has a proper atfork API. The +- * handlers are not removed from the child process. A parent handler is used +- * instead of a child handler because fork() is supposed to be async-signal +- * safe but the handler calls unsafe functions. +- */ +- +-#if defined(HAVE_PTHREAD_ATFORK) && defined(WITH_THREAD) +-#define PYSSL_RAND_ATFORK 1 +- +-static void +-PySSL_RAND_atfork_parent(void) +-{ +- struct { +- char stack[128]; /* uninitialized (!) stack data, 128 is an +- arbitrary number. */ +- pid_t pid; /* current pid */ +- _PyTime_timeval tp; /* current time */ +- } seed; +- +-#ifdef WITH_VALGRIND +- VALGRIND_MAKE_MEM_DEFINED(seed.stack, sizeof(seed.stack)); +-#endif +- seed.pid = getpid(); +- _PyTime_gettimeofday(&(seed.tp)); +- RAND_add((unsigned char *)&seed, sizeof(seed), 0.0); +-} +- +-static int +-PySSL_RAND_atfork(void) +-{ +- static int registered = 0; +- int retval; +- +- if (registered) +- return 0; +- +- retval = pthread_atfork(NULL, /* prepare */ +- PySSL_RAND_atfork_parent, /* parent */ +- NULL); /* child */ +- if (retval != 0) { +- PyErr_SetFromErrno(PyExc_OSError); +- return -1; +- } +- registered = 1; +- return 0; +-} +-#endif /* HAVE_PTHREAD_ATFORK */ +- + #endif /* HAVE_OPENSSL_RAND */ + + +@@ -3623,10 +3561,5 @@ + if (r == NULL || PyModule_AddObject(m, "_OPENSSL_API_VERSION", r)) + return NULL; + +-#ifdef PYSSL_RAND_ATFORK +- if (PySSL_RAND_atfork() == -1) +- return NULL; +-#endif +- + return m; + } diff --git a/check-pyc-and-pyo-timestamps.py b/check-pyc-and-pyo-timestamps.py index bcd5baf..5fd11cc 100644 --- a/check-pyc-and-pyo-timestamps.py +++ b/check-pyc-and-pyo-timestamps.py @@ -16,10 +16,12 @@ not_compiled = [ 'test/badsyntax_future7.py', 'test/badsyntax_future8.py', 'test/badsyntax_future9.py', + 'test/badsyntax_future10.py', 'test/badsyntax_pep3120.py', 'lib2to3/tests/data/bom.py', 'lib2to3/tests/data/crlf.py', 'lib2to3/tests/data/different_encoding.py', + 'lib2to3/tests/data/false_encoding.py', 'lib2to3/tests/data/py2_test_grammar.py', '.debug-gdb.py', ] diff --git a/python-3.2.1-fix-test-subprocess-with-nonreadable-path-dir.patch b/python-3.2.1-fix-test-subprocess-with-nonreadable-path-dir.patch deleted file mode 100644 index 6f43c72..0000000 --- a/python-3.2.1-fix-test-subprocess-with-nonreadable-path-dir.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up Python-3.2.1/Lib/test/test_subprocess.py.non-readable-path Python-3.2.1/Lib/test/test_subprocess.py ---- Python-3.2.1/Lib/test/test_subprocess.py.non-readable-path 2011-07-09 02:58:51.000000000 -0400 -+++ Python-3.2.1/Lib/test/test_subprocess.py 2011-07-11 11:34:16.284426005 -0400 -@@ -618,7 +618,7 @@ class ProcessTestCase(BaseTestCase): - for i in range(1024): - # Windows raises IOError. Others raise OSError. - with self.assertRaises(EnvironmentError) as c: -- subprocess.Popen(['nonexisting_i_hope'], -+ subprocess.Popen(['/usr/bin/nonexisting_i_hope'], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - # ignore errors that indicate the command was not found diff --git a/python-3.3.0b1-lib64.patch b/python-3.3.0b1-lib64.patch index 5ae03aa..afbdc6c 100644 --- a/python-3.3.0b1-lib64.patch +++ b/python-3.3.0b1-lib64.patch @@ -39,9 +39,9 @@ diff -up cpython-59223da36dec/Lib/site.py.lib64 cpython-59223da36dec/Lib/site.py --- cpython-59223da36dec/Lib/site.py.lib64 2012-08-07 06:10:57.000000000 -0400 +++ cpython-59223da36dec/Lib/site.py 2012-08-07 16:41:00.573477549 -0400 @@ -303,12 +303,16 @@ def getsitepackages(prefixes=None): - if sys.platform in ('os2emx', 'riscos'): - sitepackages.append(os.path.join(prefix, "Lib", "site-packages")) - elif os.sep == '/': + seen.add(prefix) + + if os.sep == '/': + sitepackages.append(os.path.join(prefix, "lib64", + "python" + sys.version[:3], + "site-packages")) diff --git a/python3.spec b/python3.spec index f445372..71fa457 100644 --- a/python3.spec +++ b/python3.spec @@ -2,10 +2,13 @@ # Conditionals and other variables controlling the build # ====================================================== -%global pybasever 3.3 +%global pybasever 3.4 # pybasever without the dot: -%global pyshortver 33 +%global pyshortver 34 + +# prereleasetag +%global prerel a4 %global pylibdir %{_libdir}/python%{pybasever} %global dynload_dir %{pylibdir}/lib-dynload @@ -35,9 +38,9 @@ # For example, # foo/bar.py # now has bytecode at: -# foo/__pycache__/bar.cpython-33.pyc -# foo/__pycache__/bar.cpython-33.pyo -%global bytecode_suffixes .cpython-33.py? +# foo/__pycache__/bar.cpython-34.pyc +# foo/__pycache__/bar.cpython-34.pyo +%global bytecode_suffixes .cpython-34.py? # Python's configure script defines SOVERSION, and this is used in the Makefile # to determine INSTSONAME, the name of the libpython DSO: @@ -125,8 +128,8 @@ # ================== Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 -Version: %{pybasever}.2 -Release: 7%{?dist} +Version: %{pybasever}.0 +Release: %{?prerel:0.}1%{?prerel:.%{prerel}}%{?dist} License: Python Group: Development/Languages @@ -187,7 +190,7 @@ BuildRequires: zlib-devel # Source code and patches # ======================= -Source: http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz +Source: http://www.python.org/ftp/python/%{version}/Python-%{version}%{?prerel}.tar.xz # Avoid having various bogus auto-generated Provides lines for the various # python c modules' SONAMEs: @@ -276,17 +279,6 @@ Patch114: 00114-statvfs-f_flag-constants.patch # Not yet sent upstream Patch125: 00125-less-verbose-COUNT_ALLOCS.patch -# In my koji builds, /root/bin is in the PATH for some reason -# This leads to test_subprocess.py failing, due to "test_leaking_fds_on_error" -# trying every dir in PATH for "nonexisting_i_hope", which leads to it raising -# OSError: [Errno 13] Permission denied -# when it tries to read /root/bin, rather than raising "No such file" -# -# Work around this by specifying an absolute path for the non-existant -# executable -# Not yet sent upstream -Patch129: python-3.2.1-fix-test-subprocess-with-nonreadable-path-dir.patch - # 00130 # # Python 2's: # Patch130: python-2.7.2-add-extension-suffix-to-python-config.patch @@ -357,10 +349,6 @@ Patch140: python3-arm-skip-failing-fragile-test.patch # 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) @@ -393,7 +381,8 @@ Patch143: 00143-tsc-on-ppc.patch # - don't build the _md5 and _sha* modules; rely on the _hashlib implementation # of hashlib # (rhbz#563986) -Patch146: 00146-hashlib-fips.patch +# TODO: figure out how to update properly for sha3 +# Patch146: 00146-hashlib-fips.patch # 00147 # # Add a sys._debugmallocstats() function @@ -595,10 +584,8 @@ Patch180: 00180-python-add-support-for-ppc64p7.patch # Patch182: 00182-fix-test_gdb-test_threads.patch # 00183 # -# Upstream fix for CVE-2013-2099 (ssl.match_hostname DOS) -# http://bugs.python.org/issue17980 -# http://hg.python.org/cpython/rev/c627638753e2 -Patch183: 00183-cve-2013-2099-fix-ssl-match_hostname-dos.patch +# Fixed upstream as of Python 3.4.0a4 +# Patch183: 00183-cve-2013-2099-fix-ssl-match_hostname-dos.patch # 00184 # # Fix for https://bugzilla.redhat.com/show_bug.cgi?id=979696 @@ -609,20 +596,22 @@ Patch183: 00183-cve-2013-2099-fix-ssl-match_hostname-dos.patch 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 -# http://bugs.python.org/issue18709 -# rhbz#996399 -Patch185: 00185-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch +# Fixed upstream as of Python 3.4.0a4 +# Patch185: 00185-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch # 00186 # # Fix for https://bugzilla.redhat.com/show_bug.cgi?id=1023607 -# Fixes the problem of some *.py files not being bytecompiled properly -# during build. This was result of py_compile.compile raising exception -# when trying to convert test file with bad encoding, and thus not -# continuing bytecompilation for other files. +# Previously, this fixed a problem where some *.py files were not being +# bytecompiled properly during build. This was result of py_compile.compile +# raising exception when trying to convert test file with bad encoding, and +# thus not continuing bytecompilation for other files. +# This was fixed upstream, but the test hasn't been merged yet, so we keep it Patch186: 00186-dont-raise-from-py_compile.patch +# 00187 # +# Temporarily add this upstream patch, should be in next upstream release +Patch187: 00187-remove-pthread-atfork.patch + # (New patches go here ^^^) # @@ -762,7 +751,7 @@ can load its own extensions. # ====================================================== %prep -%setup -q -n Python-%{version} +%setup -q -n Python-%{version}%{?prerel} chmod +x %{SOURCE1} %if 0%{?with_systemtap} @@ -789,6 +778,7 @@ rm -r Modules/zlib || exit 1 # # For example, in our builds hashlib.md5 is implemented within _hashlib via # OpenSSL (and thus respects FIPS mode), and does not fall back to _md5 +# TODO: there seems to be no OpenSSL support in Python for sha3, investigate for f in md5module.c sha1module.c sha256module.c sha512module.c; do rm Modules/$f done @@ -816,8 +806,6 @@ done %patch125 -p1 -b .less-verbose-COUNT_ALLOCS -%patch129 -p1 - %ifarch ppc %{power64} %patch131 -p1 %endif @@ -835,11 +823,10 @@ done %endif # 00140: not for python3 %patch141 -p1 -%patch142 -p1 %patch143 -p1 -b .tsc-on-ppc # 00144: not for python3 # 00145: not for python3 -%patch146 -p1 +#patch146 -p1 # 00147: upstream as of Python 3.3.0 # 00148: upstream as of Python 3.2.3 # 00149: upstream as of Python 3.2.3 @@ -880,10 +867,11 @@ done %patch180 -p1 # 00181: not for python3 # 00182: upstream as of Python 3.3.2 -%patch183 -p1 -%patch184 -p1 -%patch185 -p1 +# 00183 upstream as of Python 3.4.0a4 +%patch184 -p1 +# 00185 upstream as of Python 3.4.0a4 %patch186 -p1 +%patch187 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -982,7 +970,8 @@ BuildPython() { # missing symbol AnnotateRWLockDestroy # # Invoke the build: - make EXTRA_CFLAGS="$CFLAGS" %{?_smp_mflags} + # TODO: it seems that 3.4.0a4 fails without -J1, have to figure out why + make EXTRA_CFLAGS="$CFLAGS -J1" %{?_smp_mflags} popd echo FINISHED: BUILD OF PYTHON FOR CONFIGURATION: $ConfDir @@ -1732,6 +1721,20 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon Nov 04 2013 Bohuslav Kabrda - 3.4.0-0.1.a4 +- Update to Python 3.4 alpha 4. +- Refreshed patches: 55 (systemtap), 102 (lib64), 111 (no static lib), +114 (statvfs flags), 132 (unittest rpmbuild hooks), 134 (fix COUNT_ALLOCS in +test_sys), 143 (tsc on ppc64), 146 (hashlib fips), 153 (test gdb noise), +157 (UID+GID overflows), 173 (ENOPROTOOPT in bind_port), 186 (dont raise +from py_compile) +- Removed patches: 129 (test_subprocess nonreadable dir - no longer fails in +Koji), 142 (the mock issue that caused this is fixed) +- Added patch 187 (remove thread atfork) - will be in next version +- Refreshed script for checking pyc and pyo timestamps with new ignored files. +- The fips patch is disabled for now until upstream makes a final decision +what to do with sha3 implementation for 3.4.0. + * Wed Oct 30 2013 Bohuslav Kabrda - 3.3.2-7 - Bytecompile all *.py files properly during build (rhbz#1023607) From dfb79526a33fa8566c47f83f076a9d6ac676bcfc Mon Sep 17 00:00:00 2001 From: Bohuslav Kabrda Date: Tue, 5 Nov 2013 15:38:57 +0100 Subject: [PATCH 147/416] Temporarily turn of multicore build differently, using -J1 broke test_distutils --- python3.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python3.spec b/python3.spec index 71fa457..d792c03 100644 --- a/python3.spec +++ b/python3.spec @@ -970,8 +970,8 @@ BuildPython() { # missing symbol AnnotateRWLockDestroy # # Invoke the build: - # TODO: it seems that 3.4.0a4 fails without -J1, have to figure out why - make EXTRA_CFLAGS="$CFLAGS -J1" %{?_smp_mflags} + # TODO: it seems that 3.4.0a4 fails with %{?_smp_flags}, have to figure out why + make EXTRA_CFLAGS="$CFLAGS" popd echo FINISHED: BUILD OF PYTHON FOR CONFIGURATION: $ConfDir From 54afb027bd0b97c24477a536e9b4dfb6fc45b61b Mon Sep 17 00:00:00 2001 From: Matej Stuchlik Date: Tue, 5 Nov 2013 12:22:13 +0100 Subject: [PATCH 148/416] Change behavior of ssl.match_hostname() to follow RFC 6125 (rhbz#1023742) --- ...ge-match_hostname-to-follow-RFC-6125.patch | 188 ++++++++++++++++++ python3.spec | 11 +- 2 files changed, 198 insertions(+), 1 deletion(-) create mode 100644 00187-change-match_hostname-to-follow-RFC-6125.patch diff --git a/00187-change-match_hostname-to-follow-RFC-6125.patch b/00187-change-match_hostname-to-follow-RFC-6125.patch new file mode 100644 index 0000000..0c07ecc --- /dev/null +++ b/00187-change-match_hostname-to-follow-RFC-6125.patch @@ -0,0 +1,188 @@ +--- a/Doc/library/ssl.rst ++++ b/Doc/library/ssl.rst +@@ -283,10 +283,10 @@ Certificate handling + 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`, 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. ++ 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:: +@@ -301,6 +301,13 @@ Certificate handling + + .. versionadded:: 3.2 + ++ .. versionchanged:: 3.3.3 ++ The function now follows :rfc:`6125`, section 6.4.3 and does neither ++ match multiple wildcards (e.g. ``*.*.com`` or ``*a*.example.org``) nor ++ a wildcard inside an internationalized domain names (IDN) fragment. ++ IDN A-labels such as ``www*.xn--pthon-kva.org`` are still supported, ++ but ``x*.python.org`` no longer matches ``xn--tda.python.org``. ++ + .. function:: cert_time_to_seconds(timestring) + + Returns a floating-point value containing a normal seconds-after-the-epoch +unchanged: +--- a/Lib/ssl.py ++++ b/Lib/ssl.py +@@ -129,25 +129,53 @@ class CertificateError(ValueError): + pass + + +-def _dnsname_to_pat(dn, max_wildcards=1): ++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 = [] +- for frag in dn.split(r'.'): +- if frag.count('*') > 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)) +- if frag == '*': +- # When '*' is a fragment by itself, it matches a non-empty dotless +- # fragment. +- pats.append('[^.]+') +- else: +- # Otherwise, '*' matches any dotless fragment. +- frag = re.escape(frag) +- pats.append(frag.replace(r'\*', '[^.]*')) +- return re.compile(r'\A' + r'\.'.join(pats) + r'\Z', re.IGNORECASE) ++ if not dn: ++ return False ++ ++ leftmost, *remainder = dn.split(r'.') ++ ++ 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): +unchanged: +--- a/Lib/test/test_ssl.py ++++ b/Lib/test/test_ssl.py +@@ -304,11 +304,7 @@ class BasicSocketTests(unittest.TestCase + fail(cert, 'Xa.com') + fail(cert, '.a.com') + +- cert = {'subject': ((('commonName', 'a.*.com'),),)} +- ok(cert, 'a.foo.com') +- fail(cert, 'a..com') +- fail(cert, 'a.com') +- ++ # only match one left-most wildcard + cert = {'subject': ((('commonName', 'f*.com'),),)} + ok(cert, 'foo.com') + ok(cert, 'f.com') +@@ -323,6 +319,36 @@ class BasicSocketTests(unittest.TestCase + 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 = 'püthon.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 = 'www*.pythön.org'.encode("idna").decode("ascii") ++ cert = {'subject': ((('commonName', idna),),)} ++ ok(cert, 'www.pythön.org'.encode("idna").decode("ascii")) ++ ok(cert, 'www1.pythön.org'.encode("idna").decode("ascii")) ++ fail(cert, 'ftp.pythön.org'.encode("idna").decode("ascii")) ++ fail(cert, 'pythön.org'.encode("idna").decode("ascii")) ++ + # Slightly fake real-world example + cert = {'notAfter': 'Jun 26 21:41:46 2011 GMT', + 'subject': ((('commonName', 'linuxfrz.org'),),), +@@ -383,7 +409,7 @@ class BasicSocketTests(unittest.TestCase + cert = {'subject': ((('commonName', 'a*b.com'),),)} + ok(cert, 'axxb.com') + cert = {'subject': ((('commonName', 'a*b.co*'),),)} +- ok(cert, 'axxb.com') ++ fail(cert, 'axxb.com') + cert = {'subject': ((('commonName', 'a*b*.com'),),)} + with self.assertRaises(ssl.CertificateError) as cm: + ssl.match_hostname(cert, 'axxbxxc.com') +--- a/Lib/ssl.py ++++ b/Lib/ssl.py +@@ -192,7 +192,7 @@ def match_hostname(cert, hostname): + san = cert.get('subjectAltName', ()) + for key, value in san: + if key == 'DNS': +- if _dnsname_to_pat(value).match(hostname): ++ if _dnsname_match(value, hostname): + return + dnsnames.append(value) + if not dnsnames: +@@ -203,7 +203,7 @@ def match_hostname(cert, hostname): + # XXX according to RFC 2818, the most specific Common Name + # must be used. + if key == 'commonName': +- if _dnsname_to_pat(value).match(hostname): ++ if _dnsname_match(value, hostname): + return + dnsnames.append(value) + if len(dnsnames) > 1: diff --git a/python3.spec b/python3.spec index f445372..caba63c 100644 --- a/python3.spec +++ b/python3.spec @@ -126,7 +126,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 7%{?dist} +Release: 8%{?dist} License: Python Group: Development/Languages @@ -623,6 +623,11 @@ Patch185: 00185-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch # continuing bytecompilation for other files. Patch186: 00186-dont-raise-from-py_compile.patch +# 00187 # +# Fix for rhbz#1023742 +# Change behavior of ssl.match_hostname() to follow RFC 6125 +# See http://bugs.python.org/issue17997#msg194950 for more. +Patch187: 00187-change-match_hostname-to-follow-RFC-6125.patch # (New patches go here ^^^) # @@ -884,6 +889,7 @@ done %patch184 -p1 %patch185 -p1 %patch186 -p1 +%patch187 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1732,6 +1738,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Tue Nov 05 2013 Matej Stuchlik - 3.3.2-8 +- Changed behavior of ssl.match_hostname() to follow RFC 6125 (rhbz#1023742) + * Wed Oct 30 2013 Bohuslav Kabrda - 3.3.2-7 - Bytecompile all *.py files properly during build (rhbz#1023607) From 0153564bb6b35c94ea754bc33d029fd0db0cd2ee Mon Sep 17 00:00:00 2001 From: Bohuslav Kabrda Date: Wed, 6 Nov 2013 14:58:05 +0100 Subject: [PATCH 149/416] Add a temporary workaround for lib2to3 tests failure (to be removed when we figure out things about hashlib+fips patch) --- ...ts-when-hashlib-doesnt-compile-properly.patch | 11 +++++++++++ python3.spec | 16 ++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 00188-fix-lib2to3-tests-when-hashlib-doesnt-compile-properly.patch diff --git a/00188-fix-lib2to3-tests-when-hashlib-doesnt-compile-properly.patch b/00188-fix-lib2to3-tests-when-hashlib-doesnt-compile-properly.patch new file mode 100644 index 0000000..90af30d --- /dev/null +++ b/00188-fix-lib2to3-tests-when-hashlib-doesnt-compile-properly.patch @@ -0,0 +1,11 @@ +diff -r 28c04e954bb6 Lib/lib2to3/main.py +--- a/Lib/lib2to3/main.py Tue Oct 29 22:25:55 2013 -0400 ++++ b/Lib/lib2to3/main.py Wed Nov 06 14:33:07 2013 +0100 +@@ -213,6 +213,7 @@ + + # Set up logging handler + level = logging.DEBUG if options.verbose else logging.INFO ++ logging.root.handlers = [] + logging.basicConfig(format='%(name)s: %(message)s', level=level) + logger = logging.getLogger('lib2to3.main') + diff --git a/python3.spec b/python3.spec index d792c03..e2fae48 100644 --- a/python3.spec +++ b/python3.spec @@ -612,6 +612,21 @@ Patch186: 00186-dont-raise-from-py_compile.patch # Temporarily add this upstream patch, should be in next upstream release Patch187: 00187-remove-pthread-atfork.patch +# 00188 # +# Downstream only patch that should be removed when we compile all guaranteed +# hashlib algorithms properly. The problem is this: +# - during tests, test_hashlib is imported and executed before test_lib2to3 +# - if at least one hash function has failed, trying to import it triggers an +# exception that is being caught and exception is logged: +# http://hg.python.org/cpython/file/2de806c8b070/Lib/hashlib.py#l217 +# - logging the exception makes logging module run basicConfig +# - when lib2to3 tests are run again, lib2to3 runs basicConfig again, which +# doesn't do anything, because it was run previously +# (logging.root.handlers != []), which means that the default setup +# (most importantly logging level) is not overriden. That means that a test +# relying on this will fail (test_filename_changing_on_output_single_dir) +Patch188: 00188-fix-lib2to3-tests-when-hashlib-doesnt-compile-properly.patch + # (New patches go here ^^^) # @@ -872,6 +887,7 @@ done # 00185 upstream as of Python 3.4.0a4 %patch186 -p1 %patch187 -p1 +%patch188 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. From f0b0ffc86c70e6dcf520f3b6a91540766b8d6c56 Mon Sep 17 00:00:00 2001 From: Bohuslav Kabrda Date: Thu, 7 Nov 2013 15:59:40 +0100 Subject: [PATCH 150/416] Rebase the hashlib patch + adapt it to _sha3 being used from stdlib --- 00146-hashlib-fips.patch | 191 ++++++++++++++++++++------------------- python3.spec | 8 +- 2 files changed, 102 insertions(+), 97 deletions(-) diff --git a/00146-hashlib-fips.patch b/00146-hashlib-fips.patch index 18b6a44..221ab50 100644 --- a/00146-hashlib-fips.patch +++ b/00146-hashlib-fips.patch @@ -1,7 +1,6 @@ -diff -up Python-3.2.2/Lib/hashlib.py.hashlib-fips Python-3.2.2/Lib/hashlib.py ---- Python-3.2.2/Lib/hashlib.py.hashlib-fips 2011-09-03 12:16:41.000000000 -0400 -+++ Python-3.2.2/Lib/hashlib.py 2011-09-14 01:55:48.090252006 -0400 -@@ -23,6 +23,16 @@ the zlib module. +--- Python-3.4.0a4/Lib/hashlib.py.hashlib-fips 2013-11-07 13:29:43.046881440 +0100 ++++ Python-3.4.0a4/Lib/hashlib.py 2013-11-07 13:42:04.438486289 +0100 +@@ -23,6 +23,16 @@ Choose your hash function wisely. Some have known collision weaknesses. sha384 and sha512 will be slow on 32 bit platforms. @@ -18,7 +17,27 @@ diff -up Python-3.2.2/Lib/hashlib.py.hashlib-fips Python-3.2.2/Lib/hashlib.py Hash objects have these methods: - update(arg): Update the hash object with the bytes in arg. Repeated calls are equivalent to a single call with the concatenation of all -@@ -96,33 +106,36 @@ def __get_openssl_constructor(name): +@@ -64,6 +74,19 @@ + 'algorithms_available', 'pbkdf2_hmac') + + ++import functools ++def __ignore_usedforsecurity(func): ++ """Used for sha3_* functions. Until OpenSSL implements them, we want ++ to use them from Python _sha3 module, but we want them to accept ++ usedforsecurity argument too.""" ++ # TODO: remove this function when OpenSSL implements sha3 ++ @functools.wraps(func) ++ def inner(*args, **kwargs): ++ if 'usedforsecurity' in kwargs: ++ kwargs.pop('usedforsecurity') ++ return func(*args, **kwargs) ++ return inner ++ + def __get_builtin_constructor(name): + try: + if name in ('SHA1', 'sha1'): +@@ -109,34 +132,41 @@ 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. @@ -30,16 +49,17 @@ diff -up Python-3.2.2/Lib/hashlib.py.hashlib-fips Python-3.2.2/Lib/hashlib.py # Use the C function directly (very fast) return f except (AttributeError, ValueError): -- return __get_builtin_constructor(name) -+ raise ++ # TODO: We want to just raise here when OpenSSL implements sha3 ++ # because we want to make sure that Fedora uses everything from OpenSSL + return __get_builtin_constructor(name) -+def __py_new(name, data=b'', usedforsecurity=True): -+ """new(name, data=b'', usedforsecurity=True) - Return a new hashing object using -+ the named algorithm; optionally initialized with data (which must be bytes). -def __py_new(name, data=b''): - """new(name, data=b'') - Return a new hashing object using the named algorithm; - optionally initialized with data (which must be bytes). ++def __py_new(name, data=b'', usedforsecurity=True): ++ """new(name, data=b'', usedforsecurity=True) - Return a new hashing object using ++ the named algorithm; optionally initialized with data (which must be bytes). + The 'usedforsecurity' keyword argument does nothing, and is for compatibilty + with the OpenSSL implementation """ @@ -64,16 +84,34 @@ diff -up Python-3.2.2/Lib/hashlib.py.hashlib-fips Python-3.2.2/Lib/hashlib.py - # 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)(data) -- -+ raise ++ # TODO: We want to just raise here when OpenSSL implements sha3 ++ # because we want to make sure that Fedora uses everything from OpenSSL + return __get_builtin_constructor(name)(data) +- try: import _hashlib -diff -up Python-3.2.2/Lib/test/test_hashlib.py.hashlib-fips Python-3.2.2/Lib/test/test_hashlib.py ---- Python-3.2.2/Lib/test/test_hashlib.py.hashlib-fips 2011-09-03 12:16:43.000000000 -0400 -+++ Python-3.2.2/Lib/test/test_hashlib.py 2011-09-14 01:45:48.462251974 -0400 -@@ -22,6 +22,20 @@ from test.support import _4G, precisionb + new = __hash_new +@@ -216,7 +246,10 @@ + # try them all, some may not work due to the OpenSSL + # version not supporting that algorithm. + try: +- globals()[__func_name] = __get_hash(__func_name) ++ func = __get_hash(__func_name) ++ if 'sha3_' in __func_name: ++ func = __ignore_usedforsecurity(func) ++ globals()[__func_name] = func + except ValueError: + import logging + logging.exception('code for hash %s was not found.', __func_name) +@@ -224,3 +257,4 @@ + # Cleanup locals() + del __always_supported, __func_name, __get_hash + del __py_new, __hash_new, __get_openssl_constructor ++del __ignore_usedforsecurity +--- Python-3.4.0a4/Lib/test/test_hashlib.py.hashlib-fips 2013-11-07 13:43:08.763454594 +0100 ++++ Python-3.4.0a4/Lib/test/test_hashlib.py 2013-11-07 13:55:23.233038101 +0100 +@@ -26,6 +26,20 @@ c_hashlib = import_fresh_module('hashlib', fresh=['_hashlib']) py_hashlib = import_fresh_module('hashlib', blocked=['_hashlib']) @@ -94,7 +132,7 @@ diff -up Python-3.2.2/Lib/test/test_hashlib.py.hashlib-fips Python-3.2.2/Lib/tes def hexstr(s): assert isinstance(s, bytes), repr(s) h = "0123456789abcdef" -@@ -31,6 +44,16 @@ def hexstr(s): +@@ -34,6 +48,16 @@ r += h[(i >> 4) & 0xF] + h[i & 0xF] return r @@ -111,7 +149,7 @@ diff -up Python-3.2.2/Lib/test/test_hashlib.py.hashlib-fips Python-3.2.2/Lib/tes class HashLibTestCase(unittest.TestCase): supported_hash_names = ( 'md5', 'MD5', 'sha1', 'SHA1', -@@ -59,11 +82,11 @@ class HashLibTestCase(unittest.TestCase) +@@ -66,11 +90,11 @@ # For each algorithm, test the direct constructor and the use # of hashlib.new given the algorithm name. for algorithm, constructors in self.constructors_to_test.items(): @@ -126,12 +164,13 @@ diff -up Python-3.2.2/Lib/test/test_hashlib.py.hashlib-fips Python-3.2.2/Lib/tes constructors.add(_test_algorithm_via_hashlib_new) _hashlib = self._conditional_import_module('_hashlib') -@@ -75,22 +98,7 @@ class HashLibTestCase(unittest.TestCase) +@@ -82,22 +106,9 @@ for algorithm, constructors in self.constructors_to_test.items(): constructor = getattr(_hashlib, 'openssl_'+algorithm, None) if constructor: - constructors.add(constructor) -- ++ constructors.add(suppress_fips(constructor)) + - _md5 = self._conditional_import_module('_md5') - if _md5: - self.constructors_to_test['md5'].add(_md5.md5) @@ -146,51 +185,11 @@ diff -up Python-3.2.2/Lib/test/test_hashlib.py.hashlib-fips Python-3.2.2/Lib/tes - if _sha512: - self.constructors_to_test['sha384'].add(_sha512.sha384) - self.constructors_to_test['sha512'].add(_sha512.sha512) -+ constructors.add(suppress_fips(constructor)) ++ # TODO: remove this after sha3 is available through OpenSSL _sha3 = self._conditional_import_module('_sha3') if _sha3: self.constructors_to_test['sha3_224'].add(_sha3.sha3_224) -@@ -138,7 +146,7 @@ class HashLibTestCase(unittest.TestCase) - - def test_hexdigest(self): - for cons in self.hash_constructors: -- h = cons() -+ h = cons(usedforsecurity=False) - assert isinstance(h.digest(), bytes), name - self.assertEqual(hexstr(h.digest()), h.hexdigest()) - -@@ -149,12 +157,12 @@ class HashLibTestCase(unittest.TestCase) - cees = b'c' * 126 - - for name in self.supported_hash_names: -- m1 = cons() -+ m1 = cons(usedforsecurity=False) - m1.update(aas) - m1.update(bees) - m1.update(cees) - -- m2 = cons() -+ m2 = cons(usedforsecurity=False) - m2.update(aas + bees + cees) - self.assertEqual(m1.digest(), m2.digest()) - -@@ -324,13 +332,13 @@ class HashLibTestCase(unittest.TestCase) - # for multithreaded operation (which is hardwired to 2048). - gil_minsize = 2048 - -- m = hashlib.md5() -+ m = hashlib.md5(usedforsecurity=False) - m.update(b'1') - m.update(b'#' * gil_minsize) - m.update(b'1') - self.assertEqual(m.hexdigest(), 'cb1e1a2cbc80be75e19935d621fb9b21') - -- m = hashlib.md5(b'x' * gil_minsize) -+ m = hashlib.md5(b'x' * gil_minsize, usedforsecurity=False) - self.assertEqual(m.hexdigest(), 'cfb767f225d58469c5de3632a8803958') - - @unittest.skipUnless(threading, 'Threading required for this test.') -@@ -370,6 +378,67 @@ class HashLibTestCase(unittest.TestCase) +@@ -547,6 +558,65 @@ self.assertEqual(expected_hash, hasher.hexdigest()) @@ -246,31 +245,36 @@ diff -up Python-3.2.2/Lib/test/test_hashlib.py.hashlib-fips Python-3.2.2/Lib/tes + m = _hashlib.new('md5', usedforsecurity=False) + m.update(b'abc\n') + self.assertEquals(m.hexdigest(), "0bee89b07a248e27c83fc3d5951213c1") -+ ++ + m = _hashlib.openssl_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 test_main(): - support.run_unittest(HashLibTestCase) -diff -up Python-3.2.2/Modules/_hashopenssl.c.hashlib-fips Python-3.2.2/Modules/_hashopenssl.c ---- Python-3.2.2/Modules/_hashopenssl.c.hashlib-fips 2011-09-03 12:16:46.000000000 -0400 -+++ Python-3.2.2/Modules/_hashopenssl.c 2011-09-14 00:52:41.225252001 -0400 -@@ -37,6 +37,8 @@ - #endif + class KDFTests(unittest.TestCase): + +@@ -628,6 +698,7 @@ + with self.assertRaisesRegex(ValueError, 'unsupported hash type'): + pbkdf2('unknown', b'pass', b'salt', 1) + ++ @unittest.skip('skipped on Fedora, as we always use OpenSSL pbkdf2_hmac') + def test_pbkdf2_hmac_py(self): + self._test_pbkdf2_hmac(py_hashlib.pbkdf2_hmac) + +--- Python-3.4.0a4/Modules/_hashopenssl.c.hashlib-fips 2013-11-07 13:55:47.466025086 +0100 ++++ Python-3.4.0a4/Modules/_hashopenssl.c 2013-11-07 14:14:32.745272791 +0100 +@@ -19,6 +19,8 @@ + /* EVP is the preferred interface to hashing in OpenSSL */ +#include +#include #include + #include /* We use the object interface to discover what hashes OpenSSL supports. */ - #include -@@ -68,11 +70,19 @@ typedef struct { +@@ -48,11 +50,19 @@ static PyTypeObject EVPtype; @@ -294,7 +298,7 @@ diff -up Python-3.2.2/Modules/_hashopenssl.c.hashlib-fips Python-3.2.2/Modules/_ DEFINE_CONSTS_FOR_NEW(md5) DEFINE_CONSTS_FOR_NEW(sha1) -@@ -117,6 +127,48 @@ EVP_hash(EVPobject *self, const void *vp +@@ -125,6 +135,48 @@ } } @@ -343,7 +347,7 @@ diff -up Python-3.2.2/Modules/_hashopenssl.c.hashlib-fips Python-3.2.2/Modules/_ /* Internal methods for a hash object */ static void -@@ -303,15 +355,16 @@ EVP_repr(EVPobject *self) +@@ -309,15 +361,16 @@ static int EVP_tp_init(EVPobject *self, PyObject *args, PyObject *kwds) { @@ -363,7 +367,7 @@ diff -up Python-3.2.2/Modules/_hashopenssl.c.hashlib-fips Python-3.2.2/Modules/_ return -1; } -@@ -332,7 +385,12 @@ EVP_tp_init(EVPobject *self, PyObject *a +@@ -338,7 +391,12 @@ PyBuffer_Release(&view); return -1; } @@ -377,7 +381,7 @@ diff -up Python-3.2.2/Modules/_hashopenssl.c.hashlib-fips Python-3.2.2/Modules/_ self->name = name_obj; Py_INCREF(self->name); -@@ -416,7 +474,8 @@ static PyTypeObject EVPtype = { +@@ -422,7 +480,8 @@ static PyObject * EVPnew(PyObject *name_obj, const EVP_MD *digest, const EVP_MD_CTX *initial_ctx, @@ -387,7 +391,7 @@ diff -up Python-3.2.2/Modules/_hashopenssl.c.hashlib-fips Python-3.2.2/Modules/_ { EVPobject *self; -@@ -431,7 +490,12 @@ EVPnew(PyObject *name_obj, +@@ -437,7 +495,12 @@ if (initial_ctx) { EVP_MD_CTX_copy(&self->ctx, initial_ctx); } else { @@ -401,7 +405,7 @@ diff -up Python-3.2.2/Modules/_hashopenssl.c.hashlib-fips Python-3.2.2/Modules/_ } if (cp && len) { -@@ -455,21 +519,29 @@ PyDoc_STRVAR(EVP_new__doc__, +@@ -461,21 +524,29 @@ An optional string argument may be provided and will be\n\ automatically hashed.\n\ \n\ @@ -435,7 +439,7 @@ diff -up Python-3.2.2/Modules/_hashopenssl.c.hashlib-fips Python-3.2.2/Modules/_ return NULL; } -@@ -483,7 +555,8 @@ EVP_new(PyObject *self, PyObject *args, +@@ -489,7 +560,8 @@ digest = EVP_get_digestbyname(name); @@ -445,7 +449,7 @@ diff -up Python-3.2.2/Modules/_hashopenssl.c.hashlib-fips Python-3.2.2/Modules/_ if (data_obj) PyBuffer_Release(&view); -@@ -547,58 +620,115 @@ generate_hash_name_list(void) +@@ -744,57 +816,115 @@ /* @@ -462,7 +466,7 @@ diff -up Python-3.2.2/Modules/_hashopenssl.c.hashlib-fips Python-3.2.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) \ { \ - PyObject *data_obj = NULL; \ - Py_buffer view = { 0 }; \ @@ -488,8 +492,8 @@ diff -up Python-3.2.2/Modules/_hashopenssl.c.hashlib-fips Python-3.2.2/Modules/_ + return implement_specific_EVP_new(self, args, kwdict, \ + "|Oi:" #NAME, \ + &cached_info_ ## NAME ); \ - } - ++ } ++ +static PyObject * +implement_specific_EVP_new(PyObject *self, PyObject *args, PyObject *kwdict, + const char *format, @@ -534,8 +538,8 @@ diff -up Python-3.2.2/Modules/_hashopenssl.c.hashlib-fips Python-3.2.2/Modules/_ + } else { + PyErr_SetString(PyExc_ValueError, "Error initializing hash"); + } -+ } -+ + } + + if (data_obj) + PyBuffer_Release(&view); + @@ -561,10 +565,9 @@ diff -up Python-3.2.2/Modules/_hashopenssl.c.hashlib-fips Python-3.2.2/Modules/_ - EVP_DigestInit(CONST_new_ ## NAME ## _ctx_p, EVP_get_digestbyname(#NAME)); \ - } \ - } \ --} while (0); +/* + 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. + @@ -573,7 +576,7 @@ diff -up Python-3.2.2/Modules/_hashopenssl.c.hashlib-fips Python-3.2.2/Modules/_ +*/ +#define INIT_CONSTRUCTOR_CONSTANTS(NAME) do { \ + init_constructor_constant(&cached_info_ ## NAME, #NAME); \ -+} while (0); + } while (0); +static void +init_constructor_constant(EVPCachedInfo *cached_info, const char *name) +{ @@ -595,11 +598,11 @@ diff -up Python-3.2.2/Modules/_hashopenssl.c.hashlib-fips Python-3.2.2/Modules/_ + } + } +} -+ ++ + GEN_CONSTRUCTOR(md5) GEN_CONSTRUCTOR(sha1) - #ifdef _OPENSSL_SUPPORTS_SHA2 -@@ -641,12 +774,10 @@ PyInit__hashlib(void) +@@ -845,12 +974,10 @@ { PyObject *m, *openssl_md_meth_names; diff --git a/python3.spec b/python3.spec index e2fae48..ef695e9 100644 --- a/python3.spec +++ b/python3.spec @@ -381,8 +381,10 @@ Patch143: 00143-tsc-on-ppc.patch # - don't build the _md5 and _sha* modules; rely on the _hashlib implementation # of hashlib # (rhbz#563986) -# TODO: figure out how to update properly for sha3 -# Patch146: 00146-hashlib-fips.patch +# Note: for now we're using sha3 from Python tarball, not from OpenSSL, since +# OpenSSL didn't implement it yet. When OpenSSL implements it again, +# we will need to rm -rf Modules/_sha3 in prep and adapt the patch. +Patch146: 00146-hashlib-fips.patch # 00147 # # Add a sys._debugmallocstats() function @@ -841,7 +843,7 @@ done %patch143 -p1 -b .tsc-on-ppc # 00144: not for python3 # 00145: not for python3 -#patch146 -p1 +%patch146 -p1 # 00147: upstream as of Python 3.3.0 # 00148: upstream as of Python 3.2.3 # 00149: upstream as of Python 3.2.3 From f2d9a8144badc4976c1fbdda609bdb004329964a Mon Sep 17 00:00:00 2001 From: Bohuslav Kabrda Date: Fri, 8 Nov 2013 08:09:40 +0100 Subject: [PATCH 151/416] Don't hardode Python version in venv binary, use the pybasever macro there. --- python3.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index ef695e9..1382490 100644 --- a/python3.spec +++ b/python3.spec @@ -1374,7 +1374,7 @@ rm -fr %{buildroot} %{_bindir}/python%{pybasever} %{_bindir}/python%{pybasever}m %{_bindir}/pyvenv -%{_bindir}/pyvenv-3.3 +%{_bindir}/pyvenv-%{pybasever} %{_mandir}/*/* %files libs From 84c534ef77a9975aa0a3b03bffe448e8995ec0a0 Mon Sep 17 00:00:00 2001 From: Bohuslav Kabrda Date: Fri, 8 Nov 2013 13:33:44 +0100 Subject: [PATCH 152/416] Disable tests in debug build that are irrelevant and fail because of COUNT_ALLOCS --- 00141-fix-test_gc_with_COUNT_ALLOCS.patch | 22 ------- 00141-fix-tests_with_COUNT_ALLOCS.patch | 70 +++++++++++++++++++++++ python3.spec | 6 +- 3 files changed, 73 insertions(+), 25 deletions(-) delete mode 100644 00141-fix-test_gc_with_COUNT_ALLOCS.patch create mode 100644 00141-fix-tests_with_COUNT_ALLOCS.patch 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 337e39e..0000000 --- a/00141-fix-test_gc_with_COUNT_ALLOCS.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff -up Python-3.2b2/Lib/test/test_gc.py.fix-test-gc-COUNT_ALLOCS Python-3.2b2/Lib/test/test_gc.py ---- Python-3.2b2/Lib/test/test_gc.py.fix-test-gc-COUNT_ALLOCS 2010-12-28 20:39:40.779059772 -0500 -+++ Python-3.2b2/Lib/test/test_gc.py 2010-12-28 20:41:15.890940017 -0500 -@@ -102,10 +102,16 @@ 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) -+ if hasattr(sys, 'getcounts'): -+ self.assertEqual(gc.collect(), 0) -+ else: -+ self.assertNotEqual(gc.collect(), 0) - self.assertEqual(gc.collect(), 0) - - def test_method(self): diff --git a/00141-fix-tests_with_COUNT_ALLOCS.patch b/00141-fix-tests_with_COUNT_ALLOCS.patch new file mode 100644 index 0000000..b60ee69 --- /dev/null +++ b/00141-fix-tests_with_COUNT_ALLOCS.patch @@ -0,0 +1,70 @@ +diff -r e245b0d7209b Lib/test/test_gc.py +--- a/Lib/test/test_gc.py Sun Oct 20 02:01:29 2013 -0700 ++++ b/Lib/test/test_gc.py Fri Nov 08 13:25:29 2013 +0100 +@@ -127,10 +127,16 @@ + 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) ++ if hasattr(sys, 'getcounts'): ++ self.assertEqual(gc.collect(), 0) ++ else: ++ self.assertNotEqual(gc.collect(), 0) + self.assertEqual(gc.collect(), 0) + + def test_method(self): +@@ -618,6 +624,8 @@ + stderr = run_command(code % "gc.DEBUG_SAVEALL") + self.assertNotIn(b"uncollectable objects at shutdown", stderr) + ++ @unittest.skipIf(hasattr(sys, 'getcounts'), ++ 'types are immortal if COUNT_ALLOCS is used') + def test_gc_main_module_at_shutdown(self): + # Create a reference cycle through the __main__ module and check + # it gets collected at interpreter shutdown. +@@ -632,6 +640,8 @@ + rc, out, err = assert_python_ok('-c', code) + self.assertEqual(out.strip(), b'__del__ called') + ++ @unittest.skipIf(hasattr(sys, 'getcounts'), ++ 'types are immortal if COUNT_ALLOCS is used') + def test_gc_ordinary_module_at_shutdown(self): + # Same as above, but with a non-__main__ module. + with temp_dir() as script_dir: +diff -r e245b0d7209b Lib/test/test_module.py +--- a/Lib/test/test_module.py Sun Oct 20 02:01:29 2013 -0700 ++++ b/Lib/test/test_module.py Fri Nov 08 13:25:29 2013 +0100 +@@ -81,6 +81,8 @@ + gc_collect() + self.assertEqual(f().__dict__["bar"], 4) + ++ @unittest.skipIf(hasattr(sys, 'getcounts'), ++ 'types are immortal if COUNT_ALLOCS is used') + def test_clear_dict_in_ref_cycle(self): + destroyed = [] + m = ModuleType("foo") +@@ -96,6 +98,8 @@ + gc_collect() + self.assertEqual(destroyed, [1]) + ++ @unittest.skipIf(hasattr(sys, 'getcounts'), ++ 'types are immortal if COUNT_ALLOCS is used') + def test_weakref(self): + m = ModuleType("foo") + wr = weakref.ref(m) +@@ -190,6 +194,8 @@ + self.assertEqual(r[:25], "") + ++ @unittest.skipIf(hasattr(sys, 'getcounts'), ++ 'skipping since COUNT_ALLOCS was used, see issue19527') + def test_module_finalization_at_shutdown(self): + # Module globals and builtins should still be available during shutdown + rc, out, err = assert_python_ok("-c", "from test import final_a") diff --git a/python3.spec b/python3.spec index 1382490..09a5bbf 100644 --- a/python3.spec +++ b/python3.spec @@ -345,9 +345,9 @@ Patch140: python3-arm-skip-failing-fragile-test.patch # to be relevant for python3 # 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 +# Fix test_gc and test_module tests for case when configured with COUNT_ALLOCS: +# http://bugs.python.org/issue19527 +Patch141: 00141-fix-tests_with_COUNT_ALLOCS.patch # 00143 # # Fix the --with-tsc option on ppc64, and rework it on 32-bit ppc to avoid From 671e4bf0ee7af79422ac0ce0bcecdaa4645457cd Mon Sep 17 00:00:00 2001 From: Bohuslav Kabrda Date: Fri, 8 Nov 2013 14:08:24 +0100 Subject: [PATCH 153/416] atexit now gets linked into libpython3.X.so --- python3.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/python3.spec b/python3.spec index 09a5bbf..501bfc0 100644 --- a/python3.spec +++ b/python3.spec @@ -1416,7 +1416,6 @@ rm -fr %{buildroot} %{dynload_dir}/_ssl.%{SOABI_optimized}.so %{dynload_dir}/_struct.%{SOABI_optimized}.so %{dynload_dir}/array.%{SOABI_optimized}.so -%{dynload_dir}/atexit.%{SOABI_optimized}.so %{dynload_dir}/audioop.%{SOABI_optimized}.so %{dynload_dir}/binascii.%{SOABI_optimized}.so %{dynload_dir}/cmath.%{SOABI_optimized}.so @@ -1667,7 +1666,6 @@ rm -fr %{buildroot} %{dynload_dir}/_ssl.%{SOABI_debug}.so %{dynload_dir}/_struct.%{SOABI_debug}.so %{dynload_dir}/array.%{SOABI_debug}.so -%{dynload_dir}/atexit.%{SOABI_debug}.so %{dynload_dir}/audioop.%{SOABI_debug}.so %{dynload_dir}/binascii.%{SOABI_debug}.so %{dynload_dir}/cmath.%{SOABI_debug}.so From e5c246c5f5745353863087f247ad0bee36341422 Mon Sep 17 00:00:00 2001 From: Bohuslav Kabrda Date: Fri, 8 Nov 2013 14:32:40 +0100 Subject: [PATCH 154/416] Change test/support in files to match upstream --- python3.spec | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python3.spec b/python3.spec index 501bfc0..25fb779 100644 --- a/python3.spec +++ b/python3.spec @@ -1517,10 +1517,12 @@ rm -fr %{buildroot} %dir %{pylibdir}/test/ %dir %{pylibdir}/test/__pycache__/ +%dir %{pylibdir}/test/support/ +%dir %{pylibdir}/test/support/__pycache__/ %{pylibdir}/test/__init__.py -%{pylibdir}/test/support.py %{pylibdir}/test/__pycache__/__init__%{bytecode_suffixes} -%{pylibdir}/test/__pycache__/support%{bytecode_suffixes} +%{pylibdir}/test/support/__init__.py +%{pylibdir}/test/support/__pycache__/__init__%{bytecode_suffixes} %exclude %{pylibdir}/turtle.py %exclude %{pylibdir}/__pycache__/turtle*%{bytecode_suffixes} From b282179093636d68aa917b5b98ff9e406beb2b44 Mon Sep 17 00:00:00 2001 From: Bohuslav Kabrda Date: Fri, 8 Nov 2013 14:59:25 +0100 Subject: [PATCH 155/416] Add asyncio, _sha3 and _testimportmultiple to files. --- python3.spec | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 25fb779..c7c5f66 100644 --- a/python3.spec +++ b/python3.spec @@ -795,7 +795,8 @@ rm -r Modules/zlib || exit 1 # # For example, in our builds hashlib.md5 is implemented within _hashlib via # OpenSSL (and thus respects FIPS mode), and does not fall back to _md5 -# TODO: there seems to be no OpenSSL support in Python for sha3, investigate +# TODO: there seems to be no OpenSSL support in Python for sha3 so far +# when it is there, also remove _sha3/ dir for f in md5module.c sha1module.c sha256module.c sha512module.c; do rm Modules/$f done @@ -1411,6 +1412,8 @@ rm -fr %{buildroot} %{dynload_dir}/_pickle.%{SOABI_optimized}.so %{dynload_dir}/_posixsubprocess.%{SOABI_optimized}.so %{dynload_dir}/_random.%{SOABI_optimized}.so +# TODO: remove _sha3 when it reaches OpenSSL +%{dynload_dir}/_sha3.%{SOABI_optimized}.so %{dynload_dir}/_socket.%{SOABI_optimized}.so %{dynload_dir}/_sqlite3.%{SOABI_optimized}.so %{dynload_dir}/_ssl.%{SOABI_optimized}.so @@ -1446,6 +1449,11 @@ rm -fr %{buildroot} %dir %{pylibdir}/__pycache__/ %{pylibdir}/__pycache__/*%{bytecode_suffixes} +%dir %{pylibdir}/asyncio/ +%dir %{pylibdir}/asyncio/__pycache__/ +%{pylibdir}/asyncio/*.py +%{pylibdir}/asyncio/__pycache__/*%{bytecode_suffixes} + %dir %{pylibdir}/collections/ %dir %{pylibdir}/collections/__pycache__/ %{pylibdir}/collections/*.py @@ -1613,6 +1621,7 @@ rm -fr %{buildroot} %{dynload_dir}/_ctypes_test.%{SOABI_optimized}.so %{dynload_dir}/_testbuffer.%{SOABI_optimized}.so %{dynload_dir}/_testcapi.%{SOABI_optimized}.so +%{dynload_dir}/_testimportmultiple.%{SOABI_optimized}.so %{pylibdir}/lib2to3/tests %{pylibdir}/tkinter/test %{pylibdir}/unittest/test @@ -1663,6 +1672,8 @@ rm -fr %{buildroot} %{dynload_dir}/_pickle.%{SOABI_debug}.so %{dynload_dir}/_posixsubprocess.%{SOABI_debug}.so %{dynload_dir}/_random.%{SOABI_debug}.so +# TODO: remove _sha3 when it reaches OpenSSL +%{dynload_dir}/_sha3.%{SOABI_debug}.so %{dynload_dir}/_socket.%{SOABI_debug}.so %{dynload_dir}/_sqlite3.%{SOABI_debug}.so %{dynload_dir}/_ssl.%{SOABI_debug}.so @@ -1717,6 +1728,7 @@ rm -fr %{buildroot} %{dynload_dir}/_ctypes_test.%{SOABI_debug}.so %{dynload_dir}/_testbuffer.%{SOABI_debug}.so %{dynload_dir}/_testcapi.%{SOABI_debug}.so +%{dynload_dir}/_testimportmultiple.%{SOABI_debug}.so %endif # with_debug_build From bf351679373737f7b826b0840533b203eb15e4e4 Mon Sep 17 00:00:00 2001 From: Slavek Kabrda Date: Wed, 27 Nov 2013 13:03:43 +0100 Subject: [PATCH 156/416] Update to Python 3.4 beta 1. - Refreshed patches: 102 (lib64), 111 (no static lib), 125 (less verbose COUNT ALLOCS), 141 (fix COUNT_ALLOCS in test_module), 146 (hashlib fips), 157 (UID+GID overflows), 173 (ENOPROTOOPT in bind_port) - Removed patch 00187 (remove pthread atfork; upstreamed) --- ...n-3.3.0b1-lib64.patch => 00102-lib64.patch | 80 ++++++++-------- 00111-no-static-lib.patch | 2 +- 00125-less-verbose-COUNT_ALLOCS.patch | 4 +- 00141-fix-tests_with_COUNT_ALLOCS.patch | 4 +- 00146-hashlib-fips.patch | 84 +++++++---------- 00157-uid-gid-overflows.patch | 92 +++++++++---------- ...-workaround-ENOPROTOOPT-in-bind_port.patch | 13 ++- 00187-remove-pthread-atfork.patch | 89 ------------------ python3.spec | 17 +++- 9 files changed, 139 insertions(+), 246 deletions(-) rename python-3.3.0b1-lib64.patch => 00102-lib64.patch (70%) delete mode 100644 00187-remove-pthread-atfork.patch diff --git a/python-3.3.0b1-lib64.patch b/00102-lib64.patch similarity index 70% rename from python-3.3.0b1-lib64.patch rename to 00102-lib64.patch index afbdc6c..8f21624 100644 --- a/python-3.3.0b1-lib64.patch +++ b/00102-lib64.patch @@ -1,6 +1,5 @@ -diff -up cpython-59223da36dec/Lib/distutils/command/install.py.lib64 cpython-59223da36dec/Lib/distutils/command/install.py ---- cpython-59223da36dec/Lib/distutils/command/install.py.lib64 2012-08-07 06:10:57.000000000 -0400 -+++ cpython-59223da36dec/Lib/distutils/command/install.py 2012-08-07 16:41:00.573477549 -0400 +--- Python-3.4.0b1/Lib/distutils/command/install.py.lib64 2013-11-24 21:36:54.000000000 +0100 ++++ Python-3.4.0b1/Lib/distutils/command/install.py 2013-11-27 11:10:43.821150774 +0100 @@ -45,14 +45,14 @@ else: INSTALL_SCHEMES = { 'unix_prefix': { @@ -18,10 +17,9 @@ diff -up cpython-59223da36dec/Lib/distutils/command/install.py.lib64 cpython-592 'headers': '$base/include/python/$dist_name', 'scripts': '$base/bin', 'data' : '$base', -diff -up cpython-59223da36dec/Lib/distutils/sysconfig.py.lib64 cpython-59223da36dec/Lib/distutils/sysconfig.py ---- cpython-59223da36dec/Lib/distutils/sysconfig.py.lib64 2012-08-07 06:10:57.000000000 -0400 -+++ cpython-59223da36dec/Lib/distutils/sysconfig.py 2012-08-07 16:41:00.573477549 -0400 -@@ -139,8 +139,12 @@ def get_python_lib(plat_specific=0, stan +--- Python-3.4.0b1/Lib/distutils/sysconfig.py.lib64 2013-11-24 21:36:54.000000000 +0100 ++++ Python-3.4.0b1/Lib/distutils/sysconfig.py 2013-11-27 11:10:43.821150774 +0100 +@@ -141,8 +141,12 @@ prefix = plat_specific and EXEC_PREFIX or PREFIX if os.name == "posix": @@ -35,12 +33,11 @@ diff -up cpython-59223da36dec/Lib/distutils/sysconfig.py.lib64 cpython-59223da36 if standard_lib: return libpython else: -diff -up cpython-59223da36dec/Lib/site.py.lib64 cpython-59223da36dec/Lib/site.py ---- cpython-59223da36dec/Lib/site.py.lib64 2012-08-07 06:10:57.000000000 -0400 -+++ cpython-59223da36dec/Lib/site.py 2012-08-07 16:41:00.573477549 -0400 -@@ -303,12 +303,16 @@ def getsitepackages(prefixes=None): +--- Python-3.4.0b1/Lib/site.py.lib64 2013-11-24 21:36:54.000000000 +0100 ++++ Python-3.4.0b1/Lib/site.py 2013-11-27 11:10:43.822150773 +0100 +@@ -304,12 +304,16 @@ seen.add(prefix) - + if os.sep == '/': + sitepackages.append(os.path.join(prefix, "lib64", + "python" + sys.version[:3], @@ -55,10 +52,9 @@ diff -up cpython-59223da36dec/Lib/site.py.lib64 cpython-59223da36dec/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 cpython-59223da36dec/Lib/sysconfig.py.lib64 cpython-59223da36dec/Lib/sysconfig.py ---- cpython-59223da36dec/Lib/sysconfig.py.lib64 2012-08-07 06:10:57.000000000 -0400 -+++ cpython-59223da36dec/Lib/sysconfig.py 2012-08-07 16:41:00.574477549 -0400 -@@ -21,10 +21,10 @@ __all__ = [ +--- Python-3.4.0b1/Lib/sysconfig.py.lib64 2013-11-24 21:36:54.000000000 +0100 ++++ Python-3.4.0b1/Lib/sysconfig.py 2013-11-27 11:10:43.822150773 +0100 +@@ -20,10 +20,10 @@ _INSTALL_SCHEMES = { 'posix_prefix': { @@ -72,7 +68,7 @@ diff -up cpython-59223da36dec/Lib/sysconfig.py.lib64 cpython-59223da36dec/Lib/sy 'include': '{installed_base}/include/python{py_version_short}{abiflags}', 'platinclude': -@@ -81,10 +81,10 @@ _INSTALL_SCHEMES = { +@@ -61,10 +61,10 @@ 'data': '{userbase}', }, 'posix_user': { @@ -86,10 +82,9 @@ diff -up cpython-59223da36dec/Lib/sysconfig.py.lib64 cpython-59223da36dec/Lib/sy 'include': '{userbase}/include/python{py_version_short}', 'scripts': '{userbase}/bin', 'data': '{userbase}', -diff -up cpython-59223da36dec/Lib/test/test_site.py.lib64 cpython-59223da36dec/Lib/test/test_site.py ---- cpython-59223da36dec/Lib/test/test_site.py.lib64 2012-08-07 06:10:57.000000000 -0400 -+++ cpython-59223da36dec/Lib/test/test_site.py 2012-08-07 16:41:00.574477549 -0400 -@@ -239,12 +239,15 @@ class HelperFunctionsTests(unittest.Test +--- Python-3.4.0b1/Lib/test/test_site.py.lib64 2013-11-24 21:36:55.000000000 +0100 ++++ Python-3.4.0b1/Lib/test/test_site.py 2013-11-27 11:10:43.822150773 +0100 +@@ -244,12 +244,15 @@ self.assertEqual(dirs[2], wanted) elif os.sep == '/': # OS X non-framwework builds, Linux, FreeBSD, etc @@ -108,10 +103,9 @@ diff -up cpython-59223da36dec/Lib/test/test_site.py.lib64 cpython-59223da36dec/L else: # other platforms self.assertEqual(len(dirs), 2) -diff -up cpython-59223da36dec/Makefile.pre.in.lib64 cpython-59223da36dec/Makefile.pre.in ---- cpython-59223da36dec/Makefile.pre.in.lib64 2012-08-07 16:41:00.557477550 -0400 -+++ cpython-59223da36dec/Makefile.pre.in 2012-08-07 16:41:00.575477549 -0400 -@@ -108,7 +108,7 @@ LIBDIR= @libdir@ +--- Python-3.4.0b1/Makefile.pre.in.lib64 2013-11-27 11:10:43.814150786 +0100 ++++ Python-3.4.0b1/Makefile.pre.in 2013-11-27 11:10:43.823150771 +0100 +@@ -115,7 +115,7 @@ MANDIR= @mandir@ INCLUDEDIR= @includedir@ CONFINCLUDEDIR= $(exec_prefix)/include @@ -120,9 +114,8 @@ diff -up cpython-59223da36dec/Makefile.pre.in.lib64 cpython-59223da36dec/Makefil ABIFLAGS= @ABIFLAGS@ # Detailed destination directories -diff -up cpython-59223da36dec/Modules/getpath.c.lib64 cpython-59223da36dec/Modules/getpath.c ---- cpython-59223da36dec/Modules/getpath.c.lib64 2012-08-07 06:10:57.000000000 -0400 -+++ cpython-59223da36dec/Modules/getpath.c 2012-08-07 16:41:00.575477549 -0400 +--- Python-3.4.0b1/Modules/getpath.c.lib64 2013-11-24 21:36:56.000000000 +0100 ++++ Python-3.4.0b1/Modules/getpath.c 2013-11-27 11:17:33.619449704 +0100 @@ -122,8 +122,8 @@ #endif @@ -134,16 +127,16 @@ diff -up cpython-59223da36dec/Modules/getpath.c.lib64 cpython-59223da36dec/Modul #endif #ifndef LANDMARK -@@ -135,7 +135,7 @@ static wchar_t exec_prefix[MAXPATHLEN+1] - static wchar_t progpath[MAXPATHLEN+1]; - static wchar_t *module_search_path = NULL; - static int module_search_path_malloced = 0; --static wchar_t *lib_python = L"lib/python" VERSION; -+static wchar_t *lib_python = L"lib64/python" VERSION; +@@ -498,7 +498,7 @@ + _pythonpath = _Py_char2wchar(PYTHONPATH, NULL); + _prefix = _Py_char2wchar(PREFIX, NULL); + _exec_prefix = _Py_char2wchar(EXEC_PREFIX, NULL); +- lib_python = _Py_char2wchar("lib/python" VERSION, NULL); ++ lib_python = _Py_char2wchar("lib/python64" VERSION, NULL); - static void - reduce(wchar_t *dir) -@@ -677,7 +677,7 @@ calculate_path(void) + if (!_pythonpath || !_prefix || !_exec_prefix || !lib_python) { + Py_FatalError( +@@ -687,7 +687,7 @@ } else wcsncpy(zip_path, _prefix, MAXPATHLEN); @@ -152,7 +145,7 @@ diff -up cpython-59223da36dec/Modules/getpath.c.lib64 cpython-59223da36dec/Modul bufsz = wcslen(zip_path); /* Replace "00" with version */ zip_path[bufsz - 6] = VERSION[0]; zip_path[bufsz - 5] = VERSION[2]; -@@ -687,7 +687,7 @@ calculate_path(void) +@@ -699,7 +699,7 @@ fprintf(stderr, "Could not find platform dependent libraries \n"); wcsncpy(exec_prefix, _exec_prefix, MAXPATHLEN); @@ -161,10 +154,9 @@ diff -up cpython-59223da36dec/Modules/getpath.c.lib64 cpython-59223da36dec/Modul } /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */ -diff -up cpython-59223da36dec/setup.py.lib64 cpython-59223da36dec/setup.py ---- cpython-59223da36dec/setup.py.lib64 2012-08-07 06:10:57.000000000 -0400 -+++ cpython-59223da36dec/setup.py 2012-08-07 16:41:32.153475390 -0400 -@@ -438,7 +438,7 @@ class PyBuildExt(build_ext): +--- Python-3.4.0b1/setup.py.lib64 2013-11-24 21:36:56.000000000 +0100 ++++ Python-3.4.0b1/setup.py 2013-11-27 11:10:43.824150769 +0100 +@@ -441,7 +441,7 @@ # directories (i.e. '.' and 'Include') must be first. See issue # 10520. if not cross_compiling: @@ -173,7 +165,7 @@ diff -up cpython-59223da36dec/setup.py.lib64 cpython-59223da36dec/setup.py add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') # only change this for cross builds for 3.3, issues on Mageia if cross_compiling: -@@ -708,11 +708,11 @@ class PyBuildExt(build_ext): +@@ -718,11 +718,11 @@ elif curses_library: readline_libs.append(curses_library) elif self.compiler.find_library_file(lib_dirs + @@ -187,7 +179,7 @@ diff -up cpython-59223da36dec/setup.py.lib64 cpython-59223da36dec/setup.py extra_link_args=readline_extra_link_args, libraries=readline_libs) ) else: -@@ -749,8 +749,8 @@ class PyBuildExt(build_ext): +@@ -759,8 +759,8 @@ if krb5_h: ssl_incs += krb5_h ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, diff --git a/00111-no-static-lib.patch b/00111-no-static-lib.patch index f74bc87..bd1bc40 100644 --- a/00111-no-static-lib.patch +++ b/00111-no-static-lib.patch @@ -2,7 +2,7 @@ diff -up cpython-59223da36dec/Makefile.pre.in.no-static-lib cpython-59223da36dec --- cpython-59223da36dec/Makefile.pre.in.no-static-lib 2012-08-07 16:43:43.296466422 -0400 +++ cpython-59223da36dec/Makefile.pre.in 2012-08-07 16:44:13.299464371 -0400 @@ -464,7 +464,7 @@ coverage: - $(MAKE) coverage-lcov + $(RUNSHARED) $(PYTHON_FOR_BUILD) ./Tools/clinic/clinic.py --make # Build the interpreter -$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) diff --git a/00125-less-verbose-COUNT_ALLOCS.patch b/00125-less-verbose-COUNT_ALLOCS.patch index 8cef015..8e441a2 100644 --- a/00125-less-verbose-COUNT_ALLOCS.patch +++ b/00125-less-verbose-COUNT_ALLOCS.patch @@ -16,5 +16,5 @@ diff -up Python-2.7/Python/pythonrun.c.less-verbose-COUNT_ALLOCS Python-2.7/Pyth + if (Py_GETENV("PYTHONDUMPCOUNTS")) + dump_counts(stdout); #endif - - PRINT_TOTAL_REFS(); + /* dump hash stats */ + _PyHash_Fini(); diff --git a/00141-fix-tests_with_COUNT_ALLOCS.patch b/00141-fix-tests_with_COUNT_ALLOCS.patch index b60ee69..44be26e 100644 --- a/00141-fix-tests_with_COUNT_ALLOCS.patch +++ b/00141-fix-tests_with_COUNT_ALLOCS.patch @@ -60,8 +60,8 @@ diff -r e245b0d7209b Lib/test/test_module.py m = ModuleType("foo") wr = weakref.ref(m) @@ -190,6 +194,8 @@ - self.assertEqual(r[:25], "") + self.assertEqual(r[-len(ends_with):], ends_with, + '{!r} does not end with {!r}'.format(r, ends_with)) + @unittest.skipIf(hasattr(sys, 'getcounts'), + 'skipping since COUNT_ALLOCS was used, see issue19527') diff --git a/00146-hashlib-fips.patch b/00146-hashlib-fips.patch index 221ab50..f2cd3db 100644 --- a/00146-hashlib-fips.patch +++ b/00146-hashlib-fips.patch @@ -1,5 +1,5 @@ ---- Python-3.4.0a4/Lib/hashlib.py.hashlib-fips 2013-11-07 13:29:43.046881440 +0100 -+++ Python-3.4.0a4/Lib/hashlib.py 2013-11-07 13:42:04.438486289 +0100 +--- Python-3.4.0b1/Lib/hashlib.py.hashlib-fips 2013-11-24 21:36:54.000000000 +0100 ++++ Python-3.4.0b1/Lib/hashlib.py 2013-11-27 11:45:17.073617547 +0100 @@ -23,6 +23,16 @@ Choose your hash function wisely. Some have known collision weaknesses. sha384 and sha512 will be slow on 32 bit platforms. @@ -17,27 +17,7 @@ Hash objects have these methods: - update(arg): Update the hash object with the bytes in arg. Repeated calls are equivalent to a single call with the concatenation of all -@@ -64,6 +74,19 @@ - 'algorithms_available', 'pbkdf2_hmac') - - -+import functools -+def __ignore_usedforsecurity(func): -+ """Used for sha3_* functions. Until OpenSSL implements them, we want -+ to use them from Python _sha3 module, but we want them to accept -+ usedforsecurity argument too.""" -+ # TODO: remove this function when OpenSSL implements sha3 -+ @functools.wraps(func) -+ def inner(*args, **kwargs): -+ if 'usedforsecurity' in kwargs: -+ kwargs.pop('usedforsecurity') -+ return func(*args, **kwargs) -+ return inner -+ - def __get_builtin_constructor(name): - try: - if name in ('SHA1', 'sha1'): -@@ -109,34 +132,41 @@ +@@ -108,34 +118,41 @@ 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. @@ -92,7 +72,7 @@ try: import _hashlib new = __hash_new -@@ -216,7 +246,10 @@ +@@ -215,7 +232,10 @@ # try them all, some may not work due to the OpenSSL # version not supporting that algorithm. try: @@ -104,13 +84,13 @@ except ValueError: import logging logging.exception('code for hash %s was not found.', __func_name) -@@ -224,3 +257,4 @@ +@@ -223,3 +243,4 @@ # Cleanup locals() del __always_supported, __func_name, __get_hash del __py_new, __hash_new, __get_openssl_constructor +del __ignore_usedforsecurity ---- Python-3.4.0a4/Lib/test/test_hashlib.py.hashlib-fips 2013-11-07 13:43:08.763454594 +0100 -+++ Python-3.4.0a4/Lib/test/test_hashlib.py 2013-11-07 13:55:23.233038101 +0100 +--- Python-3.4.0b1/Lib/test/test_hashlib.py.hashlib-fips 2013-11-24 21:36:55.000000000 +0100 ++++ Python-3.4.0b1/Lib/test/test_hashlib.py 2013-11-27 11:55:42.769601363 +0100 @@ -26,6 +26,20 @@ c_hashlib = import_fresh_module('hashlib', fresh=['_hashlib']) py_hashlib = import_fresh_module('hashlib', blocked=['_hashlib']) @@ -164,32 +144,37 @@ constructors.add(_test_algorithm_via_hashlib_new) _hashlib = self._conditional_import_module('_hashlib') -@@ -82,22 +106,9 @@ +@@ -82,27 +106,13 @@ for algorithm, constructors in self.constructors_to_test.items(): constructor = getattr(_hashlib, 'openssl_'+algorithm, None) if constructor: - constructors.add(constructor) + constructors.add(suppress_fips(constructor)) + def add_builtin_constructor(name): + constructor = getattr(hashlib, "__get_builtin_constructor")(name) + self.constructors_to_test[name].add(constructor) + - _md5 = self._conditional_import_module('_md5') - if _md5: -- self.constructors_to_test['md5'].add(_md5.md5) +- add_builtin_constructor('md5') - _sha1 = self._conditional_import_module('_sha1') - if _sha1: -- self.constructors_to_test['sha1'].add(_sha1.sha1) +- add_builtin_constructor('sha1') - _sha256 = self._conditional_import_module('_sha256') - if _sha256: -- self.constructors_to_test['sha224'].add(_sha256.sha224) -- self.constructors_to_test['sha256'].add(_sha256.sha256) +- add_builtin_constructor('sha224') +- add_builtin_constructor('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) +- add_builtin_constructor('sha384') +- add_builtin_constructor('sha512') +- _sha3 = self._conditional_import_module('_sha3') + # TODO: remove this after sha3 is available through OpenSSL - _sha3 = self._conditional_import_module('_sha3') if _sha3: - self.constructors_to_test['sha3_224'].add(_sha3.sha3_224) -@@ -547,6 +558,65 @@ + add_builtin_constructor('sha3_224') + add_builtin_constructor('sha3_256') +@@ -558,6 +568,65 @@ self.assertEqual(expected_hash, hasher.hexdigest()) @@ -255,7 +240,7 @@ class KDFTests(unittest.TestCase): -@@ -628,6 +698,7 @@ +@@ -639,6 +708,7 @@ with self.assertRaisesRegex(ValueError, 'unsupported hash type'): pbkdf2('unknown', b'pass', b'salt', 1) @@ -263,8 +248,8 @@ def test_pbkdf2_hmac_py(self): self._test_pbkdf2_hmac(py_hashlib.pbkdf2_hmac) ---- Python-3.4.0a4/Modules/_hashopenssl.c.hashlib-fips 2013-11-07 13:55:47.466025086 +0100 -+++ Python-3.4.0a4/Modules/_hashopenssl.c 2013-11-07 14:14:32.745272791 +0100 +--- Python-3.4.0b1/Modules/_hashopenssl.c.hashlib-fips 2013-11-24 21:36:56.000000000 +0100 ++++ Python-3.4.0b1/Modules/_hashopenssl.c 2013-11-27 12:01:57.443537463 +0100 @@ -19,6 +19,8 @@ @@ -298,7 +283,7 @@ DEFINE_CONSTS_FOR_NEW(md5) DEFINE_CONSTS_FOR_NEW(sha1) -@@ -125,6 +135,48 @@ +@@ -97,6 +107,48 @@ } } @@ -347,7 +332,7 @@ /* Internal methods for a hash object */ static void -@@ -309,15 +361,16 @@ +@@ -281,15 +333,16 @@ static int EVP_tp_init(EVPobject *self, PyObject *args, PyObject *kwds) { @@ -367,7 +352,7 @@ return -1; } -@@ -338,7 +391,12 @@ +@@ -310,7 +363,12 @@ PyBuffer_Release(&view); return -1; } @@ -381,7 +366,7 @@ self->name = name_obj; Py_INCREF(self->name); -@@ -422,7 +480,8 @@ +@@ -394,7 +452,8 @@ static PyObject * EVPnew(PyObject *name_obj, const EVP_MD *digest, const EVP_MD_CTX *initial_ctx, @@ -391,7 +376,7 @@ { EVPobject *self; -@@ -437,7 +495,12 @@ +@@ -409,7 +468,12 @@ if (initial_ctx) { EVP_MD_CTX_copy(&self->ctx, initial_ctx); } else { @@ -405,7 +390,7 @@ } if (cp && len) { -@@ -461,21 +524,29 @@ +@@ -433,21 +497,29 @@ An optional string argument may be provided and will be\n\ automatically hashed.\n\ \n\ @@ -439,7 +424,7 @@ return NULL; } -@@ -489,7 +560,8 @@ +@@ -461,7 +533,8 @@ digest = EVP_get_digestbyname(name); @@ -449,7 +434,7 @@ if (data_obj) PyBuffer_Release(&view); -@@ -744,57 +816,115 @@ +@@ -742,57 +815,115 @@ /* @@ -602,11 +587,12 @@ GEN_CONSTRUCTOR(md5) GEN_CONSTRUCTOR(sha1) -@@ -845,12 +974,10 @@ +@@ -843,13 +974,10 @@ { PyObject *m, *openssl_md_meth_names; - OpenSSL_add_all_digests(); +- ERR_load_crypto_strings(); + SSL_load_error_strings(); + SSL_library_init(); diff --git a/00157-uid-gid-overflows.patch b/00157-uid-gid-overflows.patch index bf82b60..43bd394 100644 --- a/00157-uid-gid-overflows.patch +++ b/00157-uid-gid-overflows.patch @@ -1,56 +1,54 @@ -diff -up Python-3.3.0b1/Lib/test/test_os.py.uid-gid-overflows Python-3.3.0b1/Lib/test/test_os.py ---- Python-3.3.0b1/Lib/test/test_os.py.uid-gid-overflows 2012-06-26 16:19:48.000000000 -0400 -+++ Python-3.3.0b1/Lib/test/test_os.py 2012-07-20 14:21:46.856688739 -0400 -@@ -1174,30 +1174,36 @@ if sys.platform != 'win32': - def test_setuid(self): - if os.getuid() != 0: - self.assertRaises(OSError, os.setuid, 0) -+ self.assertRaises(TypeError, os.setuid, 'not an int') - self.assertRaises(OverflowError, os.setuid, 1<<32) +--- Python-3.4.0b1/Lib/test/test_os.py.orig 2013-11-27 12:07:32.368411798 +0100 ++++ Python-3.4.0b1/Lib/test/test_os.py 2013-11-27 12:12:11.220265174 +0100 +@@ -1319,30 +1319,36 @@ + def test_setuid(self): + if os.getuid() != 0: + self.assertRaises(OSError, 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 and not HAVE_WHEEL_GROUP: - self.assertRaises(OSError, 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 and not HAVE_WHEEL_GROUP: + self.assertRaises(OSError, 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(OSError, 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(OSError, 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 and not HAVE_WHEEL_GROUP: - self.assertRaises(OSError, 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 and not HAVE_WHEEL_GROUP: + self.assertRaises(OSError, 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(OSError, 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(OSError, 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) -@@ -1212,6 +1218,8 @@ if sys.platform != 'win32': - def test_setregid(self): - if os.getuid() != 0 and not HAVE_WHEEL_GROUP: - self.assertRaises(OSError, 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) +@@ -1358,6 +1364,8 @@ + def test_setregid(self): + if os.getuid() != 0 and not HAVE_WHEEL_GROUP: + self.assertRaises(OSError, 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-3.3.0b1/Lib/test/test_pwd.py.uid-gid-overflows Python-3.3.0b1/Lib/test/test_pwd.py ---- Python-3.3.0b1/Lib/test/test_pwd.py.uid-gid-overflows 2012-06-26 16:19:48.000000000 -0400 -+++ Python-3.3.0b1/Lib/test/test_pwd.py 2012-07-20 14:21:46.857688726 -0400 -@@ -87,9 +87,9 @@ class PwdTest(unittest.TestCase): +--- Python-3.4.0b1/Lib/test/test_pwd.py.orig 2013-11-24 21:36:55.000000000 +0100 ++++ Python-3.4.0b1/Lib/test/test_pwd.py 2013-11-27 12:07:32.369411798 +0100 +@@ -89,9 +89,9 @@ # 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 diff --git a/00173-workaround-ENOPROTOOPT-in-bind_port.patch b/00173-workaround-ENOPROTOOPT-in-bind_port.patch index 498322c..8d8b0bc 100644 --- a/00173-workaround-ENOPROTOOPT-in-bind_port.patch +++ b/00173-workaround-ENOPROTOOPT-in-bind_port.patch @@ -1,13 +1,12 @@ -diff -up Python-3.3.0/Lib/test/support.py.rhbz913732 Python-3.3.0/Lib/test/support.py ---- Python-3.4.0a4/Lib/test/support/__init__.py.rhbz913732 2013-03-04 16:25:53.885258476 -0500 -+++ Python-3.4.0a4/Lib/test/support/__init__.py 2013-03-04 16:25:58.499258157 -0500 -@@ -544,7 +544,8 @@ def bind_port(sock, host=HOST): +--- Python-3.4.0b1/Lib/test/support/__init__.py.orig 2013-11-27 12:14:26.507216624 +0100 ++++ Python-3.4.0b1/Lib/test/support/__init__.py 2013-11-27 12:17:01.490805587 +0100 +@@ -593,7 +593,8 @@ 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!") + try: + if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) == 1: + raise TestFailed("tests should never set the SO_REUSEPORT " \ diff --git a/00187-remove-pthread-atfork.patch b/00187-remove-pthread-atfork.patch deleted file mode 100644 index 04af52d..0000000 --- a/00187-remove-pthread-atfork.patch +++ /dev/null @@ -1,89 +0,0 @@ -diff -r 6fdbb81b4020 -r 705f2addd0f0 Modules/_ssl.c ---- a/Modules/_ssl.c Tue Oct 29 12:14:55 2013 +0100 -+++ b/Modules/_ssl.c Tue Oct 29 21:11:55 2013 +0100 -@@ -19,9 +19,6 @@ - #ifdef WITH_THREAD - #include "pythread.h" - --#ifdef HAVE_PTHREAD_ATFORK --# include --#endif - - #define PySSL_BEGIN_ALLOW_THREADS_S(save) \ - do { if (_ssl_locks_count>0) { (save) = PyEval_SaveThread(); } } while (0) -@@ -2950,64 +2947,6 @@ - Returns number of bytes read. Raises SSLError if connection to EGD\n\ - fails or if it does not provide enough data to seed PRNG."); - --/* Seed OpenSSL's PRNG at fork(), http://bugs.python.org/issue18747 -- * -- * The parent handler seeds the PRNG from pseudo-random data like pid, the -- * current time (miliseconds or seconds) and an uninitialized array. -- * The array contains stack variables that are impossible to predict -- * on most systems, e.g. function return address (subject to ASLR), the -- * stack protection canary and automatic variables. -- * The code is inspired by Apache's ssl_rand_seed() function. -- * -- * Note: -- * The code uses pthread_atfork() until Python has a proper atfork API. The -- * handlers are not removed from the child process. A parent handler is used -- * instead of a child handler because fork() is supposed to be async-signal -- * safe but the handler calls unsafe functions. -- */ -- --#if defined(HAVE_PTHREAD_ATFORK) && defined(WITH_THREAD) --#define PYSSL_RAND_ATFORK 1 -- --static void --PySSL_RAND_atfork_parent(void) --{ -- struct { -- char stack[128]; /* uninitialized (!) stack data, 128 is an -- arbitrary number. */ -- pid_t pid; /* current pid */ -- _PyTime_timeval tp; /* current time */ -- } seed; -- --#ifdef WITH_VALGRIND -- VALGRIND_MAKE_MEM_DEFINED(seed.stack, sizeof(seed.stack)); --#endif -- seed.pid = getpid(); -- _PyTime_gettimeofday(&(seed.tp)); -- RAND_add((unsigned char *)&seed, sizeof(seed), 0.0); --} -- --static int --PySSL_RAND_atfork(void) --{ -- static int registered = 0; -- int retval; -- -- if (registered) -- return 0; -- -- retval = pthread_atfork(NULL, /* prepare */ -- PySSL_RAND_atfork_parent, /* parent */ -- NULL); /* child */ -- if (retval != 0) { -- PyErr_SetFromErrno(PyExc_OSError); -- return -1; -- } -- registered = 1; -- return 0; --} --#endif /* HAVE_PTHREAD_ATFORK */ -- - #endif /* HAVE_OPENSSL_RAND */ - - -@@ -3623,10 +3561,5 @@ - if (r == NULL || PyModule_AddObject(m, "_OPENSSL_API_VERSION", r)) - return NULL; - --#ifdef PYSSL_RAND_ATFORK -- if (PySSL_RAND_atfork() == -1) -- return NULL; --#endif -- - return m; - } diff --git a/python3.spec b/python3.spec index c7c5f66..1e61ab1 100644 --- a/python3.spec +++ b/python3.spec @@ -8,7 +8,7 @@ %global pyshortver 34 # prereleasetag -%global prerel a4 +%global prerel b1 %global pylibdir %{_libdir}/python%{pybasever} %global dynload_dir %{pylibdir}/lib-dynload @@ -240,7 +240,7 @@ Patch1: Python-3.1.1-rpath.patch # (where sys.getfilesystemencoding() == 'ascii') Patch55: 00055-systemtap.patch -Patch102: python-3.3.0b1-lib64.patch +Patch102: 00102-lib64.patch # 00104 # # Only used when "%{_lib}" == "lib64" @@ -611,8 +611,8 @@ Patch184: 00184-ctypes-should-build-with-libffi-multilib-wrapper.patch Patch186: 00186-dont-raise-from-py_compile.patch # 00187 # -# Temporarily add this upstream patch, should be in next upstream release -Patch187: 00187-remove-pthread-atfork.patch +# Fixed upstream as of Python 3.4.0b1 +# Patch187: 00187-remove-pthread-atfork.patch # 00188 # # Downstream only patch that should be removed when we compile all guaranteed @@ -889,7 +889,7 @@ done %patch184 -p1 # 00185 upstream as of Python 3.4.0a4 %patch186 -p1 -%patch187 -p1 +# 00187: upstream as of Python 3.4.0b1 %patch188 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there @@ -1751,6 +1751,13 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon Nov 25 2013 Bohuslav Kabrda - 3.4.0-0.1.b1 +- Update to Python 3.4 beta 1. +- Refreshed patches: 102 (lib64), 111 (no static lib), 125 (less verbose COUNT +ALLOCS), 141 (fix COUNT_ALLOCS in test_module), 146 (hashlib fips), +157 (UID+GID overflows), 173 (ENOPROTOOPT in bind_port) +- Removed patch 00187 (remove pthread atfork; upstreamed) + * Mon Nov 04 2013 Bohuslav Kabrda - 3.4.0-0.1.a4 - Update to Python 3.4 alpha 4. - Refreshed patches: 55 (systemtap), 102 (lib64), 111 (no static lib), From 0ef730720cd7ab286ed38a1762ea96783577ba7e Mon Sep 17 00:00:00 2001 From: Slavek Kabrda Date: Wed, 27 Nov 2013 13:33:51 +0100 Subject: [PATCH 157/416] Fix typo in lib64 patch --- 00102-lib64.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/00102-lib64.patch b/00102-lib64.patch index 8f21624..db5fd95 100644 --- a/00102-lib64.patch +++ b/00102-lib64.patch @@ -132,7 +132,7 @@ _prefix = _Py_char2wchar(PREFIX, NULL); _exec_prefix = _Py_char2wchar(EXEC_PREFIX, NULL); - lib_python = _Py_char2wchar("lib/python" VERSION, NULL); -+ lib_python = _Py_char2wchar("lib/python64" VERSION, NULL); ++ lib_python = _Py_char2wchar("lib64/python" VERSION, NULL); if (!_pythonpath || !_prefix || !_exec_prefix || !lib_python) { Py_FatalError( From aa3d055181c5413be4735d5c4cf3684a72195b79 Mon Sep 17 00:00:00 2001 From: Slavek Kabrda Date: Wed, 27 Nov 2013 13:42:09 +0100 Subject: [PATCH 158/416] Add __ignore_usedforsecurity to patch 00146 (accidentaly omitted when rebasing patch). --- 00146-hashlib-fips.patch | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/00146-hashlib-fips.patch b/00146-hashlib-fips.patch index f2cd3db..b4d38c7 100644 --- a/00146-hashlib-fips.patch +++ b/00146-hashlib-fips.patch @@ -17,7 +17,27 @@ Hash objects have these methods: - update(arg): Update the hash object with the bytes in arg. Repeated calls are equivalent to a single call with the concatenation of all -@@ -108,34 +118,41 @@ +@@ -63,6 +73,19 @@ + __all__ = __always_supported + ('new', 'algorithms_guaranteed', + 'algorithms_available', 'pbkdf2_hmac') + ++import functools ++def __ignore_usedforsecurity(func): ++ """Used for sha3_* functions. Until OpenSSL implements them, we want ++ to use them from Python _sha3 module, but we want them to accept ++ usedforsecurity argument too.""" ++ # TODO: remove this function when OpenSSL implements sha3 ++ @functools.wraps(func) ++ def inner(*args, **kwargs): ++ if 'usedforsecurity' in kwargs: ++ kwargs.pop('usedforsecurity') ++ return func(*args, **kwargs) ++ return inner ++ + + __builtin_constructor_cache = {} + +@@ -108,34 +131,41 @@ 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. @@ -72,7 +92,7 @@ try: import _hashlib new = __hash_new -@@ -215,7 +232,10 @@ +@@ -215,7 +245,10 @@ # try them all, some may not work due to the OpenSSL # version not supporting that algorithm. try: @@ -84,7 +104,7 @@ except ValueError: import logging logging.exception('code for hash %s was not found.', __func_name) -@@ -223,3 +243,4 @@ +@@ -223,3 +256,4 @@ # Cleanup locals() del __always_supported, __func_name, __get_hash del __py_new, __hash_new, __get_openssl_constructor From 8fffc96443cc58c2b1c819a4b94166e5b88ba643 Mon Sep 17 00:00:00 2001 From: Slavek Kabrda Date: Thu, 28 Nov 2013 10:07:21 +0100 Subject: [PATCH 159/416] Fix the hashlib-fips patch to work flawlessly once again --- 00146-hashlib-fips.patch | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/00146-hashlib-fips.patch b/00146-hashlib-fips.patch index b4d38c7..7cd79ef 100644 --- a/00146-hashlib-fips.patch +++ b/00146-hashlib-fips.patch @@ -109,12 +109,16 @@ del __always_supported, __func_name, __get_hash del __py_new, __hash_new, __get_openssl_constructor +del __ignore_usedforsecurity ---- Python-3.4.0b1/Lib/test/test_hashlib.py.hashlib-fips 2013-11-24 21:36:55.000000000 +0100 -+++ Python-3.4.0b1/Lib/test/test_hashlib.py 2013-11-27 11:55:42.769601363 +0100 -@@ -26,6 +26,20 @@ - c_hashlib = import_fresh_module('hashlib', fresh=['_hashlib']) - py_hashlib = import_fresh_module('hashlib', blocked=['_hashlib']) +--- Python-3.4.0b1/Lib/test/test_hashlib.py 2013-11-27 11:55:42.769601363 +0100 ++++ Python-3.4.0b1/Lib/test/test_hashlib.py 2013-11-28 09:33:03.929008508 +0100 +@@ -24,7 +24,22 @@ + COMPILED_WITH_PYDEBUG = hasattr(sys, 'gettotalrefcount') + c_hashlib = import_fresh_module('hashlib', fresh=['_hashlib']) +-py_hashlib = import_fresh_module('hashlib', blocked=['_hashlib']) ++# skipped on Fedora, since we always use OpenSSL implementation ++# py_hashlib = import_fresh_module('hashlib', blocked=['_hashlib']) ++ +def openssl_enforces_fips(): + # Use the "openssl" command (if present) to try to determine if the local + # OpenSSL is configured to enforce FIPS @@ -128,11 +132,10 @@ + stdout, stderr = p.communicate(input=b'abc') + return b'unknown cipher' in stderr +OPENSSL_ENFORCES_FIPS = openssl_enforces_fips() -+ + def hexstr(s): assert isinstance(s, bytes), repr(s) - h = "0123456789abcdef" -@@ -34,6 +48,16 @@ +@@ -34,6 +49,16 @@ r += h[(i >> 4) & 0xF] + h[i & 0xF] return r @@ -149,7 +152,7 @@ class HashLibTestCase(unittest.TestCase): supported_hash_names = ( 'md5', 'MD5', 'sha1', 'SHA1', -@@ -66,11 +90,11 @@ +@@ -66,11 +91,11 @@ # For each algorithm, test the direct constructor and the use # of hashlib.new given the algorithm name. for algorithm, constructors in self.constructors_to_test.items(): @@ -164,7 +167,7 @@ constructors.add(_test_algorithm_via_hashlib_new) _hashlib = self._conditional_import_module('_hashlib') -@@ -82,27 +106,13 @@ +@@ -82,26 +107,13 @@ for algorithm, constructors in self.constructors_to_test.items(): constructor = getattr(_hashlib, 'openssl_'+algorithm, None) if constructor: @@ -189,12 +192,21 @@ - if _sha512: - add_builtin_constructor('sha384') - add_builtin_constructor('sha512') -- _sha3 = self._conditional_import_module('_sha3') + # TODO: remove this after sha3 is available through OpenSSL + _sha3 = self._conditional_import_module('_sha3') if _sha3: add_builtin_constructor('sha3_224') - add_builtin_constructor('sha3_256') -@@ -558,6 +568,65 @@ +@@ -157,9 +169,6 @@ + else: + del sys.modules['_md5'] + self.assertRaises(TypeError, get_builtin_constructor, 3) +- constructor = get_builtin_constructor('md5') +- self.assertIs(constructor, _md5.md5) +- self.assertEqual(sorted(builtin_constructor_cache), ['MD5', 'md5']) + + def test_hexdigest(self): + for cons in self.hash_constructors: +@@ -558,6 +567,65 @@ self.assertEqual(expected_hash, hasher.hexdigest()) @@ -260,7 +272,7 @@ class KDFTests(unittest.TestCase): -@@ -639,6 +708,7 @@ +@@ -639,6 +707,7 @@ with self.assertRaisesRegex(ValueError, 'unsupported hash type'): pbkdf2('unknown', b'pass', b'salt', 1) From cb97d2916653265a7d7a033b14f406d9031a772a Mon Sep 17 00:00:00 2001 From: Slavek Kabrda Date: Thu, 28 Nov 2013 10:27:48 +0100 Subject: [PATCH 160/416] Use --without-ensurepip configuration option for now. --- python3.spec | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/python3.spec b/python3.spec index 1e61ab1..41beef6 100644 --- a/python3.spec +++ b/python3.spec @@ -1003,9 +1003,9 @@ BuildPython debug \ python-debug \ python%{pybasever}-debug \ %ifarch %{ix86} x86_64 ppc %{power64} - "--with-pydebug --with-tsc --with-count-allocs --with-call-profile" \ + "--with-pydebug --with-tsc --with-count-allocs --with-call-profile --without-ensurepip" \ %else - "--with-pydebug --with-count-allocs --with-call-profile" \ + "--with-pydebug --with-count-allocs --with-call-profile --without-ensurepip" \ %endif false %endif # with_debug_build @@ -1013,7 +1013,7 @@ BuildPython debug \ BuildPython optimized \ python \ python%{pybasever} \ - "" \ + "--without-ensurepip" \ true # ====================================================== @@ -1497,6 +1497,13 @@ rm -fr %{buildroot} %doc %{pylibdir}/email/architecture.rst %{pylibdir}/encodings + +%dir %{pylibdir}/ensurepip/ +%dir %{pylibdir}/ensurepip/__pycache__/ +%{pylibdir}/ensurepip/*.py +%{pylibdir}/ensurepip/__pycache__/*%{bytecode_suffixes} +%exclude %{pylibdir}/ensurepip/_bundled + %{pylibdir}/html %{pylibdir}/http %{pylibdir}/idlelib From 3aee76e8b684942740e3b2600f3817f0ae0c3529 Mon Sep 17 00:00:00 2001 From: Slavek Kabrda Date: Thu, 28 Nov 2013 10:43:42 +0100 Subject: [PATCH 161/416] Add opcode module to %files --- python3.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python3.spec b/python3.spec index 41beef6..d53f8eb 100644 --- a/python3.spec +++ b/python3.spec @@ -1409,6 +1409,7 @@ rm -fr %{buildroot} %{dynload_dir}/_lzma.%{SOABI_optimized}.so %{dynload_dir}/_multibytecodec.%{SOABI_optimized}.so %{dynload_dir}/_multiprocessing.%{SOABI_optimized}.so +%{dynload_dir}/_opcode.%{SOABI_optimized}.so %{dynload_dir}/_pickle.%{SOABI_optimized}.so %{dynload_dir}/_posixsubprocess.%{SOABI_optimized}.so %{dynload_dir}/_random.%{SOABI_optimized}.so @@ -1676,6 +1677,7 @@ rm -fr %{buildroot} %{dynload_dir}/_lzma.%{SOABI_debug}.so %{dynload_dir}/_multibytecodec.%{SOABI_debug}.so %{dynload_dir}/_multiprocessing.%{SOABI_debug}.so +%{dynload_dir}/_opcode.%{SOABI_debug}.so %{dynload_dir}/_pickle.%{SOABI_debug}.so %{dynload_dir}/_posixsubprocess.%{SOABI_debug}.so %{dynload_dir}/_random.%{SOABI_debug}.so From 61fd48d1a4a485f80045c2291f182066e4857652 Mon Sep 17 00:00:00 2001 From: Slavek Kabrda Date: Wed, 8 Jan 2014 10:01:56 +0100 Subject: [PATCH 162/416] Update to Python 3.4 beta 2. - Refreshed patches: 55 (systemtap), 146 (hashlib-fips), 154 (test_gdb noise) - Dropped patches: 114 (statvfs constants), 177 (platform unicode) --- 00055-systemtap.patch | 2 +- 00114-statvfs-f_flag-constants.patch | 39 --------------------------- 00146-hashlib-fips.patch | 9 +++---- 00153-fix-test_gdb-noise.patch | 4 +-- 00177-platform-unicode.patch | 13 --------- python3.spec | 40 ++++++++++++++-------------- 6 files changed, 27 insertions(+), 80 deletions(-) delete mode 100644 00114-statvfs-f_flag-constants.patch delete mode 100644 00177-platform-unicode.patch diff --git a/00055-systemtap.patch b/00055-systemtap.patch index ddd5e77..3200c15 100644 --- a/00055-systemtap.patch +++ b/00055-systemtap.patch @@ -89,9 +89,9 @@ diff -up Python-3.3.0rc2/Doc/howto/index.rst.systemtap Python-3.3.0rc2/Doc/howto --- Python-3.3.0rc2/Doc/howto/index.rst.systemtap 2012-09-09 05:10:51.000000000 -0400 +++ Python-3.3.0rc2/Doc/howto/index.rst 2012-09-10 09:17:21.117511779 -0400 @@ -29,4 +29,5 @@ Currently, the HOWTOs are: - webservers.rst argparse.rst ipaddress.rst + clinic.rst + instrumentation.rst diff -up Python-3.3.0rc2/Doc/howto/instrumentation.rst.systemtap Python-3.3.0rc2/Doc/howto/instrumentation.rst diff --git a/00114-statvfs-f_flag-constants.patch b/00114-statvfs-f_flag-constants.patch deleted file mode 100644 index ea99e08..0000000 --- a/00114-statvfs-f_flag-constants.patch +++ /dev/null @@ -1,39 +0,0 @@ -diff -up Python-3.3.0b1/Modules/posixmodule.c.statvfs-f_flag-constants Python-3.3.0b1/Modules/posixmodule.c ---- Python-3.3.0b1/Modules/posixmodule.c.statvfs-f_flag-constants 2012-06-26 16:19:54.000000000 -0400 -+++ Python-3.3.0b1/Modules/posixmodule.c 2012-07-20 13:39:18.595546387 -0400 -@@ -11665,6 +11665,35 @@ all_ins(PyObject *d) - if (PyModule_AddIntMacro(m, ST_NOSUID)) return -1; - #endif /* ST_NOSUID */ - -+ /* GNU extensions */ -+#ifdef ST_NODEV -+ if (PyModule_AddIntMacro(m, ST_NODEV)) return -1; -+#endif /* ST_NODEV */ -+#ifdef ST_NOEXEC -+ if (PyModule_AddIntMacro(m, ST_NOEXEC)) return -1; -+#endif /* ST_NOEXEC */ -+#ifdef ST_SYNCHRONOUS -+ if (PyModule_AddIntMacro(m, ST_SYNCHRONOUS)) return -1; -+#endif /* ST_SYNCHRONOUS */ -+#ifdef ST_MANDLOCK -+ if (PyModule_AddIntMacro(m, ST_MANDLOCK)) return -1; -+#endif /* ST_MANDLOCK */ -+#ifdef ST_WRITE -+ if (PyModule_AddIntMacro(m, ST_WRITE)) return -1; -+#endif /* ST_WRITE */ -+#ifdef ST_APPEND -+ if (PyModule_AddIntMacro(m, ST_APPEND)) return -1; -+#endif /* ST_APPEND */ -+#ifdef ST_NOATIME -+ if (PyModule_AddIntMacro(m, ST_NOATIME)) return -1; -+#endif /* ST_NOATIME */ -+#ifdef ST_NODIRATIME -+ if (PyModule_AddIntMacro(m, ST_NODIRATIME)) return -1; -+#endif /* ST_NODIRATIME */ -+#ifdef ST_RELATIME -+ if (PyModule_AddIntMacro(m, ST_RELATIME)) return -1; -+#endif /* ST_RELATIME */ -+ - /* FreeBSD sendfile() constants */ - #ifdef SF_NODISKIO - if (PyModule_AddIntMacro(m, SF_NODISKIO)) return -1; diff --git a/00146-hashlib-fips.patch b/00146-hashlib-fips.patch index 7cd79ef..3d92c34 100644 --- a/00146-hashlib-fips.patch +++ b/00146-hashlib-fips.patch @@ -167,7 +167,7 @@ constructors.add(_test_algorithm_via_hashlib_new) _hashlib = self._conditional_import_module('_hashlib') -@@ -82,26 +107,13 @@ +@@ -82,26 +107,12 @@ for algorithm, constructors in self.constructors_to_test.items(): constructor = getattr(_hashlib, 'openssl_'+algorithm, None) if constructor: @@ -192,10 +192,9 @@ - if _sha512: - add_builtin_constructor('sha384') - add_builtin_constructor('sha512') -+ # TODO: remove this after sha3 is available through OpenSSL - _sha3 = self._conditional_import_module('_sha3') - if _sha3: - add_builtin_constructor('sha3_224') + + super(HashLibTestCase, self).__init__(*args, **kwargs) + @@ -157,9 +169,6 @@ else: del sys.modules['_md5'] diff --git a/00153-fix-test_gdb-noise.patch b/00153-fix-test_gdb-noise.patch index 87c9396..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 @@ - '"set sysroot"?', - 'warning: Source file is more recent than executable.', + 'Missing separate debuginfo for ', + 'Try: zypper install -C ', ) + ignore_patterns += ('warning: Unable to open', + 'Missing separate debuginfo for', diff --git a/00177-platform-unicode.patch b/00177-platform-unicode.patch deleted file mode 100644 index 7d847e1..0000000 --- a/00177-platform-unicode.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: Python-3.3.0/Lib/platform.py -=================================================================== ---- Python-3.3.0.orig/Lib/platform.py -+++ Python-3.3.0/Lib/platform.py -@@ -331,7 +331,7 @@ def linux_distribution(distname='', vers - return _dist_try_harder(distname,version,id) - - # Read the first line -- with open('/etc/'+file, 'r') as f: -+ with open('/etc/'+file, 'r', encoding='utf-8', errors='surrogateescape') as f: - firstline = f.readline() - _distname, _version, _id = _parse_release_file(firstline) - diff --git a/python3.spec b/python3.spec index d53f8eb..2053757 100644 --- a/python3.spec +++ b/python3.spec @@ -8,7 +8,7 @@ %global pyshortver 34 # prereleasetag -%global prerel b1 +%global prerel b2 %global pylibdir %{_libdir}/python%{pybasever} %global dynload_dir %{pylibdir}/lib-dynload @@ -53,7 +53,7 @@ %global py_INSTSONAME_optimized libpython%{LDVERSION_optimized}.so.%{py_SOVERSION} %global py_INSTSONAME_debug libpython%{LDVERSION_debug}.so.%{py_SOVERSION} -%global with_debug_build 1 +%global with_debug_build 0 %global with_gdb_hooks 1 @@ -266,10 +266,8 @@ Patch111: 00111-no-static-lib.patch 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 3.4.0.b2 +# Patch114: 00114-statvfs-f_flag-constants.patch # 00125 # # COUNT_ALLOCS is useful for debugging, but the upstream behaviour of always @@ -381,9 +379,13 @@ Patch143: 00143-tsc-on-ppc.patch # - don't build the _md5 and _sha* modules; rely on the _hashlib implementation # of hashlib # (rhbz#563986) -# Note: for now we're using sha3 from Python tarball, not from OpenSSL, since -# OpenSSL didn't implement it yet. When OpenSSL implements it again, -# we will need to rm -rf Modules/_sha3 in prep and adapt the patch. +# Note: Up to Python 3.4.0.b1, upstream had their own implementation of what +# they assumed would become sha3. This patch was adapted to give it the +# usedforsecurity argument, even though it did nothing (OpenSSL didn't have +# sha3 implementation at that time).In 3.4.0.b2, sha3 implementation was reverted +# (see http://bugs.python.org/issue16113), but the alterations were left in the +# patch, since they may be useful again if upstream decides to rerevert sha3 +# implementation and OpenSSL still doesn't support it. For now, they're harmless. Patch146: 00146-hashlib-fips.patch # 00147 # @@ -550,11 +552,8 @@ Patch173: 00173-workaround-ENOPROTOOPT-in-bind_port.patch # Patch176: 00176-upstream-issue16754-so-extension.patch # 00177 # -# Patch for potential unicode error when determining OS release names -# http://bugs.python.org/issue17429 -# (rhbz#922149) -# Does not affect python2 (python2 uses a byte string so it doesn't need to decode) -Patch177: 00177-platform-unicode.patch +# Fixed upstream as of Python 3.4.0.b2 +# Patch177: 00177-platform-unicode.patch # 00178 # # Don't duplicate various FLAGS in sysconfig values @@ -820,7 +819,7 @@ done %patch111 -p1 # 112: not for python3 %patch113 -p1 -%patch114 -p1 +# 00114: Upstream as of Python 3.4.0.b2 %patch125 -p1 -b .less-verbose-COUNT_ALLOCS @@ -879,7 +878,7 @@ done #00174: TODO # 00175: upstream as of Python 3.3.2 # 00176: upstream as of Python 3.3.1 -%patch177 -p1 +# 00177: upstream as of Python 3.4.0.b2 %patch178 -p1 %patch179 -p1 %patch180 -p1 @@ -1413,8 +1412,6 @@ rm -fr %{buildroot} %{dynload_dir}/_pickle.%{SOABI_optimized}.so %{dynload_dir}/_posixsubprocess.%{SOABI_optimized}.so %{dynload_dir}/_random.%{SOABI_optimized}.so -# TODO: remove _sha3 when it reaches OpenSSL -%{dynload_dir}/_sha3.%{SOABI_optimized}.so %{dynload_dir}/_socket.%{SOABI_optimized}.so %{dynload_dir}/_sqlite3.%{SOABI_optimized}.so %{dynload_dir}/_ssl.%{SOABI_optimized}.so @@ -1681,8 +1678,6 @@ rm -fr %{buildroot} %{dynload_dir}/_pickle.%{SOABI_debug}.so %{dynload_dir}/_posixsubprocess.%{SOABI_debug}.so %{dynload_dir}/_random.%{SOABI_debug}.so -# TODO: remove _sha3 when it reaches OpenSSL -%{dynload_dir}/_sha3.%{SOABI_debug}.so %{dynload_dir}/_socket.%{SOABI_debug}.so %{dynload_dir}/_sqlite3.%{SOABI_debug}.so %{dynload_dir}/_ssl.%{SOABI_debug}.so @@ -1760,6 +1755,11 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Wed Jan 08 2014 Bohuslav Kabrda - 3.4.0-0.1.b2 +- Update to Python 3.4 beta 2. +- Refreshed patches: 55 (systemtap), 146 (hashlib-fips), 154 (test_gdb noise) +- Dropped patches: 114 (statvfs constants), 177 (platform unicode) + * Mon Nov 25 2013 Bohuslav Kabrda - 3.4.0-0.1.b1 - Update to Python 3.4 beta 1. - Refreshed patches: 102 (lib64), 111 (no static lib), 125 (less verbose COUNT From de14a01ddc9cc2cd7a5209020ad5460c3dcab7a6 Mon Sep 17 00:00:00 2001 From: Slavek Kabrda Date: Wed, 8 Jan 2014 10:37:25 +0100 Subject: [PATCH 163/416] Temporarily add BR: net-tools to workaround upstream reported test issue --- python3.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python3.spec b/python3.spec index 2053757..efe5d3b 100644 --- a/python3.spec +++ b/python3.spec @@ -161,6 +161,8 @@ BuildRequires: libffi-devel BuildRequires: libGL-devel BuildRequires: libX11-devel BuildRequires: ncurses-devel +# workaround http://bugs.python.org/issue19804 (test_uuid requires ifconfig) +BuildRequires: net-tools BuildRequires: openssl-devel BuildRequires: pkgconfig BuildRequires: readline-devel From db2025edc1db34cf911aacf07e32cc9cef189608 Mon Sep 17 00:00:00 2001 From: Slavek Kabrda Date: Thu, 9 Jan 2014 15:23:20 +0100 Subject: [PATCH 164/416] Fix tests introduced in beta 2 failing because of COUNT_ALLOCS --- 00141-fix-tests_with_COUNT_ALLOCS.patch | 53 +++++++++++++++++++++++++ python3.spec | 8 ++-- 2 files changed, 58 insertions(+), 3 deletions(-) diff --git a/00141-fix-tests_with_COUNT_ALLOCS.patch b/00141-fix-tests_with_COUNT_ALLOCS.patch index 44be26e..0c19f2a 100644 --- a/00141-fix-tests_with_COUNT_ALLOCS.patch +++ b/00141-fix-tests_with_COUNT_ALLOCS.patch @@ -68,3 +68,56 @@ diff -r e245b0d7209b Lib/test/test_module.py def test_module_finalization_at_shutdown(self): # Module globals and builtins should still be available during shutdown rc, out, err = assert_python_ok("-c", "from test import final_a") +--- a/Lib/test/test_io.py.orig 2014-01-09 14:43:44.000000000 +0100 ++++ b/Lib/test/test_io.py 2014-01-09 14:50:30.839597351 +0100 +@@ -2611,6 +2611,8 @@ + """.format(iomod=iomod, kwargs=kwargs) + return assert_python_ok("-c", code) + ++ @unittest.skipIf(hasattr(sys, 'getrefcount'), ++ 'types are immortal if COUNT_ALLOCS is used') + def test_create_at_shutdown_without_encoding(self): + rc, out, err = self._check_create_at_shutdown() + if err: +@@ -2621,6 +2623,8 @@ + else: + self.assertEqual("ok", out.decode().strip()) + ++ @unittest.skipIf(hasattr(sys, 'getrefcount'), ++ 'types are immortal if COUNT_ALLOCS is used') + def test_create_at_shutdown_with_encoding(self): + rc, out, err = self._check_create_at_shutdown(encoding='utf-8', + errors='strict') +--- a/Lib/test/test_logging.py.orig 2014-01-09 14:53:07.016388198 +0100 ++++ b/Lib/test/test_logging.py 2014-01-09 14:54:25.654282973 +0100 +@@ -3398,6 +3398,8 @@ + logging.setLoggerClass(logging.Logger) + self.assertEqual(logging.getLoggerClass(), logging.Logger) + ++ @unittest.skipIf(hasattr(sys, 'getcounts'), ++ 'types are immortal if COUNT_ALLOCS is used') + def test_logging_at_shutdown(self): + # Issue #20037 + code = """if 1: +--- a/Lib/test/test_threading.py.orig 2014-01-09 15:09:23.902063074 +0100 ++++ b/Lib/test/test_threading.py 2014-01-09 15:09:07.622085202 +0100 +@@ -617,6 +617,8 @@ + t.join() + self.assertRaises(ValueError, bs.release) + ++ @unittest.skipIf(hasattr(sys, 'getcounts'), ++ 'types are immortal if COUNT_ALLOCS is used') + def test_locals_at_exit(self): + # Issue #19466: thread locals must not be deleted before destructors + # are called +--- a/Lib/test/test_warnings.py.orig 2014-01-09 15:10:12.454997100 +0100 ++++ b/Lib/test/test_warnings.py 2014-01-09 15:11:14.028913478 +0100 +@@ -801,6 +801,8 @@ + self.assertEqual(retcode, 0) + + class FinalizationTest(unittest.TestCase): ++ @unittest.skipIf(hasattr(sys, 'getcounts'), ++ 'types are immortal if COUNT_ALLOCS is used') + def test_finalization(self): + # Issue #19421: warnings.warn() should not crash + # during Python finalization diff --git a/python3.spec b/python3.spec index efe5d3b..f40cf34 100644 --- a/python3.spec +++ b/python3.spec @@ -53,7 +53,7 @@ %global py_INSTSONAME_optimized libpython%{LDVERSION_optimized}.so.%{py_SOVERSION} %global py_INSTSONAME_debug libpython%{LDVERSION_debug}.so.%{py_SOVERSION} -%global with_debug_build 0 +%global with_debug_build 1 %global with_gdb_hooks 1 @@ -345,8 +345,10 @@ Patch140: python3-arm-skip-failing-fragile-test.patch # to be relevant for python3 # 00141 # -# Fix test_gc and test_module tests for case when configured with COUNT_ALLOCS: -# http://bugs.python.org/issue19527 +# Fix tests for case when tests for case when configured with +# COUNT_ALLOCS (debug build): http://bugs.python.org/issue19527 +# Applies to: test_gc, test_module, test_io, test_logging, test_warnings, +# test_threading Patch141: 00141-fix-tests_with_COUNT_ALLOCS.patch # 00143 # From a39396d0b501df1ebf6ec6f010f8829919ce4665 Mon Sep 17 00:00:00 2001 From: Slavek Kabrda Date: Tue, 4 Feb 2014 13:35:09 +0100 Subject: [PATCH 165/416] Install RPM macro files to proper directory. --- python3.spec | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/python3.spec b/python3.spec index caba63c..ff415ac 100644 --- a/python3.spec +++ b/python3.spec @@ -126,7 +126,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 8%{?dist} +Release: 9%{?dist} License: Python Group: Development/Languages @@ -1232,9 +1232,9 @@ find %{buildroot} \ -perm 555 -exec chmod 755 {} \; # Install macros for rpm: -mkdir -p %{buildroot}/%{_sysconfdir}/rpm -install -m 644 %{SOURCE2} %{buildroot}/%{_sysconfdir}/rpm -install -m 644 %{SOURCE3} %{buildroot}/%{_sysconfdir}/rpm +mkdir -p %{buildroot}/%{_rpmconfigdir}/macros.d/ +install -m 644 %{SOURCE2} %{buildroot}/%{_rpmconfigdir}/macros.d/ +install -m 644 %{SOURCE3} %{buildroot}/%{_rpmconfigdir}/macros.d/ # Ensure that the curses module was linked against libncursesw.so, rather than # libncurses.so (bug 539917) @@ -1577,8 +1577,8 @@ rm -fr %{buildroot} %{_libdir}/pkgconfig/python-%{LDVERSION_optimized}.pc %{_libdir}/pkgconfig/python-%{pybasever}.pc %{_libdir}/pkgconfig/python3.pc -%{_sysconfdir}/rpm/macros.python3 -%{_sysconfdir}/rpm/macros.pybytecompile +%{_rpmconfigdir}/macros.d/macros.python3 +%{_rpmconfigdir}/macros.d/macros.pybytecompile %files tools %defattr(-,root,root,755) @@ -1738,6 +1738,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Tue Feb 04 2014 Bohuslav Kabrda - 3.3.2-9 +- Install macros in _rpmconfigdir. + * Tue Nov 05 2013 Matej Stuchlik - 3.3.2-8 - Changed behavior of ssl.match_hostname() to follow RFC 6125 (rhbz#1023742) From c8f16f3941f17a64cba4c418c37b4ebc857a8a49 Mon Sep 17 00:00:00 2001 From: Tomas Radej Date: Mon, 10 Feb 2014 14:42:12 +0100 Subject: [PATCH 166/416] Fixed buffer overflow (upstream patch) Resolves: rhbz#1062374 --- 00192-buffer-overflow.patch | 42 +++++++++++++++++++++++++++++++++++++ python3.spec | 14 ++++++++++++- 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 00192-buffer-overflow.patch diff --git a/00192-buffer-overflow.patch b/00192-buffer-overflow.patch new file mode 100644 index 0000000..73d3ece --- /dev/null +++ b/00192-buffer-overflow.patch @@ -0,0 +1,42 @@ + +# HG changeset patch +# User Benjamin Peterson +# Date 1389672775 18000 +# Node ID 7f176a45211ff3cb85a2fbdc75f7979d642bb563 +# Parent ed1c27b68068c942c6e845bdf8e987e963d50920# Parent 9c56217e5c793685eeaf0ee224848c402bdf1e4c +merge 3.2 (#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 +@@ -4538,6 +4538,14 @@ 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): ++ self.serv_conn.send(MSG*2048) ++ + + TIPC_STYPE = 2000 + TIPC_LOWER = 200 +diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c +--- a/Modules/socketmodule.c ++++ b/Modules/socketmodule.c +@@ -2935,6 +2935,11 @@ sock_recvfrom_into(PySocketSockObject *s + if (recvlen == 0) { + /* If nbytes was not specified, use the buffer's length */ + recvlen = buflen; ++ } else if (recvlen > buflen) { ++ PyBuffer_Release(&pbuf); ++ PyErr_SetString(PyExc_ValueError, ++ "nbytes is greater than the length of the buffer"); ++ return NULL; + } + + readlen = sock_recvfrom_guts(s, buf, recvlen, flags, &addr); + diff --git a/python3.spec b/python3.spec index ff415ac..34359f7 100644 --- a/python3.spec +++ b/python3.spec @@ -126,7 +126,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 9%{?dist} +Release: 10%{?dist} License: Python Group: Development/Languages @@ -629,6 +629,13 @@ Patch186: 00186-dont-raise-from-py_compile.patch # See http://bugs.python.org/issue17997#msg194950 for more. Patch187: 00187-change-match_hostname-to-follow-RFC-6125.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, @@ -890,6 +897,7 @@ done %patch185 -p1 %patch186 -p1 %patch187 -p1 +%patch192 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1738,6 +1746,10 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon Feb 10 2014 Tomas Radej - 3.3.2-10 +- Fixed buffer overflow (upstream patch) +Resolves: rhbz#1062374 + * Tue Feb 04 2014 Bohuslav Kabrda - 3.3.2-9 - Install macros in _rpmconfigdir. From b8daf7369b0668afc22cef128bfe97ae872d3ac8 Mon Sep 17 00:00:00 2001 From: Slavek Kabrda Date: Wed, 19 Feb 2014 14:30:28 +0100 Subject: [PATCH 167/416] Enable loading sqlite extensions. Resolves: rhbz#1066938 --- python3.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 34359f7..272817b 100644 --- a/python3.spec +++ b/python3.spec @@ -126,7 +126,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 10%{?dist} +Release: 11%{?dist} License: Python Group: Development/Languages @@ -978,6 +978,7 @@ BuildPython() { --with-dbmliborder=gdbm:ndbm:bdb \ --with-system-expat \ --with-system-ffi \ + --enable-loadable-sqlite-extensions \ %if 0%{?with_systemtap} --with-systemtap \ %endif @@ -1746,6 +1747,10 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Wed Feb 19 2014 Bohuslav Kabrda - 3.3.2-11 +- Enable loading sqlite extensions. +Resolves: rhbz#1066938 + * Mon Feb 10 2014 Tomas Radej - 3.3.2-10 - Fixed buffer overflow (upstream patch) Resolves: rhbz#1062374 From bdf58d653fed5fbb5ccd0d8ca8fd3691a1426c8e Mon Sep 17 00:00:00 2001 From: Slavek Kabrda Date: Wed, 5 Mar 2014 09:02:54 +0100 Subject: [PATCH 168/416] Fix loading of pyc files by ModuleFinder.load_module. Resolves: rhbz#1060338 --- ...num-of-pycfile-bytes-in-modulefinder.patch | 65 +++++++++++++++++++ python3.spec | 14 +++- 2 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 00193-skip-correct-num-of-pycfile-bytes-in-modulefinder.patch diff --git a/00193-skip-correct-num-of-pycfile-bytes-in-modulefinder.patch b/00193-skip-correct-num-of-pycfile-bytes-in-modulefinder.patch new file mode 100644 index 0000000..bdf2e75 --- /dev/null +++ b/00193-skip-correct-num-of-pycfile-bytes-in-modulefinder.patch @@ -0,0 +1,65 @@ + +# HG changeset patch +# User Brett Cannon +# Date 1393602285 18000 +# Node ID 432cb56db05d73f55d211501bf0dfc767768923b +# Parent ade5e4922a54cb84c99ec924ab7c700a014893da +Issue #20778: Fix modulefinder to work with bytecode-only modules. + +Bug filed and initial attempt at a patch by Bohuslav Kabrda. + +diff --git a/Lib/modulefinder.py b/Lib/modulefinder.py +--- a/Lib/modulefinder.py ++++ b/Lib/modulefinder.py +@@ -287,7 +287,7 @@ class ModuleFinder: + if fp.read(4) != imp.get_magic(): + self.msgout(2, "raise ImportError: Bad magic number", pathname) + raise ImportError("Bad magic number in %s" % pathname) +- fp.read(4) ++ fp.read(8) # Skip mtime and size. + co = marshal.load(fp) + else: + co = None +diff --git a/Lib/test/test_modulefinder.py b/Lib/test/test_modulefinder.py +--- a/Lib/test/test_modulefinder.py ++++ b/Lib/test/test_modulefinder.py +@@ -1,5 +1,7 @@ + import os + import errno ++import importlib.machinery ++import py_compile + import shutil + import unittest + import tempfile +@@ -208,6 +210,14 @@ a/module.py + from . import * + """] + ++bytecode_test = [ ++ "a", ++ ["a"], ++ [], ++ [], ++ "" ++] ++ + + def open_file(path): + dirname = os.path.dirname(path) +@@ -288,6 +298,16 @@ class ModuleFinderTest(unittest.TestCase + def test_relative_imports_4(self): + self._do_test(relative_import_test_4) + ++ def test_bytecode(self): ++ base_path = os.path.join(TEST_DIR, 'a') ++ source_path = base_path + importlib.machinery.SOURCE_SUFFIXES[0] ++ bytecode_path = base_path + importlib.machinery.BYTECODE_SUFFIXES[0] ++ with open_file(source_path) as file: ++ file.write('testing_modulefinder = True\n') ++ py_compile.compile(source_path, cfile=bytecode_path) ++ os.remove(source_path) ++ self._do_test(bytecode_test) ++ + + def test_main(): + support.run_unittest(ModuleFinderTest) diff --git a/python3.spec b/python3.spec index 272817b..792c205 100644 --- a/python3.spec +++ b/python3.spec @@ -126,7 +126,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 11%{?dist} +Release: 12%{?dist} License: Python Group: Development/Languages @@ -635,6 +635,13 @@ Patch187: 00187-change-match_hostname-to-follow-RFC-6125.patch # rhbz#1062375 Patch192: 00192-buffer-overflow.patch +# 00193 +# +# Skip correct number of *.pyc file bytes in ModuleFinder.load_module +# rhbz#1060338 +# http://bugs.python.org/issue20778 +Patch193: 00193-skip-correct-num-of-pycfile-bytes-in-modulefinder.patch + # (New patches go here ^^^) # @@ -898,6 +905,7 @@ done %patch186 -p1 %patch187 -p1 %patch192 -p1 +%patch193 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1747,6 +1755,10 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Wed Mar 05 2014 Bohuslav Kabrda - 3.3.2-12 +- Fix loading of pyc files by ModuleFinder.load_module. +Resolves: rhbz#1060338 + * Wed Feb 19 2014 Bohuslav Kabrda - 3.3.2-11 - Enable loading sqlite extensions. Resolves: rhbz#1066938 From e9b7bf0d4baa2fa3a0ce39fc2377e5d5d9252639 Mon Sep 17 00:00:00 2001 From: Matej Stuchlik Date: Fri, 7 Mar 2014 10:59:27 +0100 Subject: [PATCH 169/416] Update to Python 3.4 RC2 --- 00141-fix-tests_with_COUNT_ALLOCS.patch | 20 +++++--------------- python3.spec | 2 +- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/00141-fix-tests_with_COUNT_ALLOCS.patch b/00141-fix-tests_with_COUNT_ALLOCS.patch index 0c19f2a..7193a8d 100644 --- a/00141-fix-tests_with_COUNT_ALLOCS.patch +++ b/00141-fix-tests_with_COUNT_ALLOCS.patch @@ -99,21 +99,11 @@ diff -r e245b0d7209b Lib/test/test_module.py def test_logging_at_shutdown(self): # Issue #20037 code = """if 1: ---- a/Lib/test/test_threading.py.orig 2014-01-09 15:09:23.902063074 +0100 -+++ b/Lib/test/test_threading.py 2014-01-09 15:09:07.622085202 +0100 -@@ -617,6 +617,8 @@ - t.join() - self.assertRaises(ValueError, bs.release) - -+ @unittest.skipIf(hasattr(sys, 'getcounts'), -+ 'types are immortal if COUNT_ALLOCS is used') - def test_locals_at_exit(self): - # Issue #19466: thread locals must not be deleted before destructors - # are called ---- a/Lib/test/test_warnings.py.orig 2014-01-09 15:10:12.454997100 +0100 -+++ b/Lib/test/test_warnings.py 2014-01-09 15:11:14.028913478 +0100 -@@ -801,6 +801,8 @@ - self.assertEqual(retcode, 0) + +--- a/Lib/test/test_warnings.py.orig 2014-01-09 15:10:12.454997100 +0100 ++++ b/Lib/test/test_warnings.py 2014-01-09 15:11:14.028913478 +0100 +@@ -780,6 +780,8 @@ + assert_python_ok('-c', 'pass', '-W', 'always', PYTHONPATH=cwd) class FinalizationTest(unittest.TestCase): + @unittest.skipIf(hasattr(sys, 'getcounts'), diff --git a/python3.spec b/python3.spec index f40cf34..9967e52 100644 --- a/python3.spec +++ b/python3.spec @@ -8,7 +8,7 @@ %global pyshortver 34 # prereleasetag -%global prerel b2 +%global prerel rc2 %global pylibdir %{_libdir}/python%{pybasever} %global dynload_dir %{pylibdir}/lib-dynload From 11fb599edb14569b903abafeed7fd2349d96dfbf Mon Sep 17 00:00:00 2001 From: Matej Stuchlik Date: Tue, 15 Apr 2014 09:52:32 +0200 Subject: [PATCH 170/416] Update to Python 3.4 final Also merge patches from master and add the rewheel module --- 00189-add-rewheel-module.patch | 224 ++++++++++++++++++ 00190-fix-tests-with-sqlite-3.8.4.patch | 21 ++ ...num-of-pycfile-bytes-in-modulefinder.patch | 65 +++++ python3.spec | 53 ++++- 4 files changed, 358 insertions(+), 5 deletions(-) create mode 100644 00189-add-rewheel-module.patch create mode 100644 00190-fix-tests-with-sqlite-3.8.4.patch create mode 100644 00193-skip-correct-num-of-pycfile-bytes-in-modulefinder.patch diff --git a/00189-add-rewheel-module.patch b/00189-add-rewheel-module.patch new file mode 100644 index 0000000..ad80e9f --- /dev/null +++ b/00189-add-rewheel-module.patch @@ -0,0 +1,224 @@ +unchanged: +--- Python-3.4.0rc3/Lib/ensurepip/__init__.py 2014-03-10 07:56:33.000000000 +0100 ++++ Python-3.4.0rc3-rewheel/Lib/ensurepip/__init__.py 2014-03-12 09:57:12.917120853 +0100 +@@ -1,8 +1,10 @@ + import os + import os.path + import pkgutil ++import shutil + import sys + import tempfile ++from ensurepip import rewheel + + + __all__ = ["version", "bootstrap"] +@@ -38,6 +40,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) + + +@@ -87,20 +90,40 @@ def bootstrap(*, root=None, upgrade=Fals + # omit pip and easy_install + os.environ["ENSUREPIP_OPTIONS"] = "install" + +- with tempfile.TemporaryDirectory() as tmpdir: +- # Put our bundled wheels into a temporary directory and construct the +- # additional paths that need added to sys.path +- additional_paths = [] ++ 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: +- wheel_name = "{}-{}-py2.py3-none-any.whl".format(project, version) +- whl = pkgutil.get_data( ++ whl = os.path.join( ++ os.path.dirname(__file__), + "ensurepip", +- "_bundled/{}".format(wheel_name), ++ "bundled", ++ "{}-{}-py2.py3-none-any.whl".format(project, version) + ) +- with open(os.path.join(tmpdir, wheel_name), "wb") as fp: +- fp.write(whl) ++ whls.append(whl) + +- additional_paths.append(os.path.join(tmpdir, wheel_name)) ++ with tempfile.TemporaryDirectory() as tmpdir: ++ # Put our bundled wheels into a temporary directory and construct the ++ # additional paths that need added to sys.path ++ additional_paths = [] ++ 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] +unchanged: +--- Python-3.4.0rc3/Lib/ensurepip/rewheel/__init__.py 1970-01-01 01:00:00.000000000 +0100 ++++ Python-3.4.0rc3-rewheel/Lib/ensurepip/rewheel/__init__.py 2014-03-12 09:55:30.413152104 +0100 +@@ -0,0 +1,133 @@ ++import argparse ++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] ++ records.append(os.path.join(path, 'RECORD')) ++ 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') ++ wheel_info = email.parser.Parser().parsestr(open(wheel_info_path).read()) ++ metadata_path = os.path.join(os.path.dirname(record_path), 'METADATA') ++ metadata = email.parser.Parser().parsestr(open(metadata_path).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_contents = open(os.path.join(site_dir, record_relpath)).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 +only in patch2: +unchanged: +--- Python-3.4.0/Makefile.pre.in 2014-04-01 12:02:48.188136172 +0200 ++++ Python-3.4.0-new/Makefile.pre.in 2014-04-01 12:03:23.770394025 +0200 +@@ -1140,7 +1140,7 @@ LIBSUBDIRS= tkinter tkinter/test tkinter + test/test_asyncio \ + collections concurrent concurrent/futures encodings \ + email email/mime test/test_email test/test_email/data \ +- ensurepip ensurepip/_bundled \ ++ ensurepip ensurepip/_bundled ensurepip/rewheel \ + html json test/test_json http dbm xmlrpc \ + sqlite3 sqlite3/test \ + logging csv wsgiref urllib \ diff --git a/00190-fix-tests-with-sqlite-3.8.4.patch b/00190-fix-tests-with-sqlite-3.8.4.patch new file mode 100644 index 0000000..8a94f5c --- /dev/null +++ b/00190-fix-tests-with-sqlite-3.8.4.patch @@ -0,0 +1,21 @@ + +# HG changeset patch +# User Benjamin Peterson +# Date 1394679139 18000 +# Node ID 4d626a9df062104b61c44c8a5be8b0fd52fae953 +# Parent 6f93ab911d5dafcde364013e21723259fe2c85a8# Parent dbc9e3ed5e9f1bd11240eaa971f6c75d6a7013b5 +merge 3.3 (#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.assertGreater(first_count, second_count) ++ self.assertGreaterEqual(first_count, second_count) + + def CheckCancelOperation(self): + """ + diff --git a/00193-skip-correct-num-of-pycfile-bytes-in-modulefinder.patch b/00193-skip-correct-num-of-pycfile-bytes-in-modulefinder.patch new file mode 100644 index 0000000..4a82309 --- /dev/null +++ b/00193-skip-correct-num-of-pycfile-bytes-in-modulefinder.patch @@ -0,0 +1,65 @@ + +# HG changeset patch +# User Brett Cannon +# Date 1393602285 18000 +# Node ID 432cb56db05d73f55d211501bf0dfc767768923b +# Parent ade5e4922a54cb84c99ec924ab7c700a014893da +Issue #20778: Fix modulefinder to work with bytecode-only modules. + +Bug filed and initial attempt at a patch by Bohuslav Kabrda. + +diff --git a/Lib/modulefinder.py b/Lib/modulefinder.py +--- a/Lib/modulefinder.py ++++ b/Lib/modulefinder.py +@@ -290,7 +290,7 @@ class ModuleFinder: + if fp.read(4) != imp.get_magic(): + self.msgout(2, "raise ImportError: Bad magic number", pathname) + raise ImportError("Bad magic number in %s" % pathname) +- fp.read(4) ++ fp.read(8) # Skip mtime and size. + co = marshal.load(fp) + else: + co = None +diff --git a/Lib/test/test_modulefinder.py b/Lib/test/test_modulefinder.py +--- a/Lib/test/test_modulefinder.py ++++ b/Lib/test/test_modulefinder.py +@@ -1,5 +1,7 @@ + import os + import errno ++import importlib.machinery ++import py_compile + import shutil + import unittest + import tempfile +@@ -208,6 +210,14 @@ a/module.py + from . import * + """] + ++bytecode_test = [ ++ "a", ++ ["a"], ++ [], ++ [], ++ "" ++] ++ + + def open_file(path): + dirname = os.path.dirname(path) +@@ -288,6 +298,16 @@ class ModuleFinderTest(unittest.TestCase + def test_relative_imports_4(self): + self._do_test(relative_import_test_4) + ++ def test_bytecode(self): ++ base_path = os.path.join(TEST_DIR, 'a') ++ source_path = base_path + importlib.machinery.SOURCE_SUFFIXES[0] ++ bytecode_path = base_path + importlib.machinery.BYTECODE_SUFFIXES[0] ++ with open_file(source_path) as file: ++ file.write('testing_modulefinder = True\n') ++ py_compile.compile(source_path, cfile=bytecode_path) ++ os.remove(source_path) ++ self._do_test(bytecode_test) ++ + + def test_main(): + support.run_unittest(ModuleFinderTest) diff --git a/python3.spec b/python3.spec index 9967e52..e152006 100644 --- a/python3.spec +++ b/python3.spec @@ -2,14 +2,13 @@ # Conditionals and other variables controlling the build # ====================================================== +%global with_rewheel 0 + %global pybasever 3.4 # pybasever without the dot: %global pyshortver 34 -# prereleasetag -%global prerel rc2 - %global pylibdir %{_libdir}/python%{pybasever} %global dynload_dir %{pylibdir}/lib-dynload @@ -129,7 +128,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: %{?prerel:0.}1%{?prerel:.%{prerel}}%{?dist} +Release: 1%{?dist} License: Python Group: Development/Languages @@ -187,12 +186,17 @@ BuildRequires: valgrind-devel BuildRequires: xz-devel BuildRequires: zlib-devel +%if 0%{?with_rewheel} +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%endif + # ======================= # Source code and patches # ======================= -Source: http://www.python.org/ftp/python/%{version}/Python-%{version}%{?prerel}.tar.xz +Source: http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz # Avoid having various bogus auto-generated Provides lines for the various # python c modules' SONAMEs: @@ -632,6 +636,28 @@ Patch186: 00186-dont-raise-from-py_compile.patch # relying on this will fail (test_filename_changing_on_output_single_dir) Patch188: 00188-fix-lib2to3-tests-when-hashlib-doesnt-compile-properly.patch +# 00189 # +# +# Add the rewheel module, allowing to recreate wheels from already installed +# ones +# https://github.com/bkabrda/rewheel +%if 0%{with_rewheel} +Patch189: 00189-add-rewheel-module.patch +%endif + +# 00190 # +# +# Fix tests with SQLite >= 3.8.4 +# http://bugs.python.org/issue20901 +# http://hg.python.org/cpython/rev/4d626a9df062 +Patch190: 00190-fix-tests-with-sqlite-3.8.4.patch + +# 00193 +# +# Skip correct number of *.pyc file bytes in ModuleFinder.load_module +# rhbz#1060338 +# http://bugs.python.org/issue20778 +Patch193: 00193-skip-correct-num-of-pycfile-bytes-in-modulefinder.patch # (New patches go here ^^^) # @@ -895,6 +921,13 @@ done # 00187: upstream as of Python 3.4.0b1 %patch188 -p1 +%if 0%{with_rewheel} +%patch189 -p1 +%endif + +%patch190 -p1 +%patch193 -p1 + # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. # @@ -1506,6 +1539,11 @@ rm -fr %{buildroot} %{pylibdir}/ensurepip/__pycache__/*%{bytecode_suffixes} %exclude %{pylibdir}/ensurepip/_bundled +%dir %{pylibdir}/ensurepip/rewheel/ +%dir %{pylibdir}/ensurepip/rewheel/__pycache__/ +%{pylibdir}/ensurepip/rewheel/*.py +%{pylibdir}/ensurepip/rewheel/__pycache__/*%{bytecode_suffixes} + %{pylibdir}/html %{pylibdir}/http %{pylibdir}/idlelib @@ -1759,6 +1797,11 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Tue Apr 15 2014 Matej Stuchlik - 3.4.0-1 +- Update to Python 3.4 final +- Add patch adding the rewheel module +- Merge patches from master + * Wed Jan 08 2014 Bohuslav Kabrda - 3.4.0-0.1.b2 - Update to Python 3.4 beta 2. - Refreshed patches: 55 (systemtap), 146 (hashlib-fips), 154 (test_gdb noise) From c0b9737a796625319337578f2c29f8c7bf901a3b Mon Sep 17 00:00:00 2001 From: Matej Stuchlik Date: Tue, 15 Apr 2014 11:07:53 +0200 Subject: [PATCH 171/416] Upload new sources --- sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources b/sources index acfd2af..3f1acf8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -c94b78ea3b68a9bbc9906af4d5b4fdc7 Python-3.3.2.tar.xz +77c22725e14af3d71022cbfdebff4903 Python-3.4.0.tar.xz From 7d579ea103c5cfaedfc229aea45f49db3dd0c361 Mon Sep 17 00:00:00 2001 From: Matej Stuchlik Date: Fri, 18 Apr 2014 09:50:21 +0200 Subject: [PATCH 172/416] Temporarily disable tests requiring SIGHUP (rhbz#1088233) --- python3.spec | 12 ++++++++- ...arily-disable-tests-requiring-SIGHUP.patch | 25 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 temporarily-disable-tests-requiring-SIGHUP.patch diff --git a/python3.spec b/python3.spec index e152006..54b4f31 100644 --- a/python3.spec +++ b/python3.spec @@ -128,7 +128,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 1%{?dist} +Release: 2%{?dist} License: Python Group: Development/Languages @@ -659,6 +659,10 @@ Patch190: 00190-fix-tests-with-sqlite-3.8.4.patch # http://bugs.python.org/issue20778 Patch193: 00193-skip-correct-num-of-pycfile-bytes-in-modulefinder.patch +# Tests requiring SIGHUP to work don't work in Koji +# see rhbz#1088233 +Patch194: temporarily-disable-tests-requiring-SIGHUP.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora 17 onwards, @@ -927,6 +931,7 @@ done %patch190 -p1 %patch193 -p1 +%patch194 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1539,10 +1544,12 @@ rm -fr %{buildroot} %{pylibdir}/ensurepip/__pycache__/*%{bytecode_suffixes} %exclude %{pylibdir}/ensurepip/_bundled +%if 0%{?with_rewheel} %dir %{pylibdir}/ensurepip/rewheel/ %dir %{pylibdir}/ensurepip/rewheel/__pycache__/ %{pylibdir}/ensurepip/rewheel/*.py %{pylibdir}/ensurepip/rewheel/__pycache__/*%{bytecode_suffixes} +%endif %{pylibdir}/html %{pylibdir}/http @@ -1797,6 +1804,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Tue Apr 15 2014 Matej Stuchlik - 3.4.0-2 +- Temporarily disable tests requiring SIGHUP (rhbz#1088233) + * Tue Apr 15 2014 Matej Stuchlik - 3.4.0-1 - Update to Python 3.4 final - Add patch adding the rewheel module diff --git a/temporarily-disable-tests-requiring-SIGHUP.patch b/temporarily-disable-tests-requiring-SIGHUP.patch new file mode 100644 index 0000000..130970f --- /dev/null +++ b/temporarily-disable-tests-requiring-SIGHUP.patch @@ -0,0 +1,25 @@ +diff -up Python-3.4.0/Lib/test/test_asyncio/test_events.py.orig Python-3.4.0/Lib/test/test_asyncio/test_events.py +--- Python-3.4.0/Lib/test/test_asyncio/test_events.py.orig 2014-04-15 13:18:49.696215288 +0200 ++++ Python-3.4.0/Lib/test/test_asyncio/test_events.py 2014-04-15 13:18:56.104258453 +0200 +@@ -1528,7 +1528,7 @@ class SubprocessTestsMixin: + self.loop.run_until_complete(proto.completed) + self.check_terminated(proto.returncode) + +- @unittest.skipIf(sys.platform == 'win32', "Don't have SIGHUP") ++ @unittest.skipIf(True, "Temporarily skipped (rhbz#1088233)") + def test_subprocess_send_signal(self): + proto = None + transp = None + +diff -up Python-3.4.0/Lib/test/test_asyncio/test_subprocess.py.orig Python-3.4.0/Lib/test/test_asyncio/test_subprocess.py +--- Python-3.4.0/Lib/test/test_asyncio/test_subprocess.py.orig 2014-04-17 12:03:32.777827520 +0200 ++++ Python-3.4.0/Lib/test/test_asyncio/test_subprocess.py 2014-04-17 12:04:37.614210481 +0200 +@@ -108,7 +108,7 @@ class SubprocessMixin: + else: + self.assertEqual(-signal.SIGTERM, returncode) + +- @unittest.skipIf(sys.platform == 'win32', "Don't have SIGHUP") ++ @unittest.skipIf(True, "Temporarily skipped (rhbz#1088233)") + def test_send_signal(self): + args = PROGRAM_BLOCKED + create = asyncio.create_subprocess_exec(*args, loop=self.loop) From 516eb7a2338eafeb82ac18519e0f530334b1339a Mon Sep 17 00:00:00 2001 From: Matej Stuchlik Date: Tue, 29 Apr 2014 11:26:29 +0200 Subject: [PATCH 173/416] Point __os_install_post to correct brp-* files New version of redhat-rpm-cofig no longer contains them in /usr/lib/rpm/redhat --- python3.spec | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/python3.spec b/python3.spec index 54b4f31..521cce6 100644 --- a/python3.spec +++ b/python3.spec @@ -84,11 +84,11 @@ # (/usr/bin/python, rather than the freshly built python), thus leading to # numerous syntax errors, and incorrect magic numbers in the .pyc files. We # thus override __os_install_post to avoid invoking this script: -%global __os_install_post /usr/lib/rpm/redhat/brp-compress \ - %{!?__debug_package:/usr/lib/rpm/redhat/brp-strip %{__strip}} \ - /usr/lib/rpm/redhat/brp-strip-static-archive %{__strip} \ - /usr/lib/rpm/redhat/brp-strip-comment-note %{__strip} %{__objdump} \ - /usr/lib/rpm/redhat/brp-python-hardlink +%global __os_install_post /usr/lib/rpm/brp-compress \ + %{!?__debug_package:/usr/lib/rpm/brp-strip %{__strip}} \ + /usr/lib/rpm/brp-strip-static-archive %{__strip} \ + /usr/lib/rpm/brp-strip-comment-note %{__strip} %{__objdump} \ + /usr/lib/rpm/brp-python-hardlink # to remove the invocation of brp-python-bytecompile, whilst keeping the # invocation of brp-python-hardlink (since this should still work for python3 # pyc/pyo files) @@ -128,7 +128,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 2%{?dist} +Release: 3%{?dist} License: Python Group: Development/Languages @@ -1804,6 +1804,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Tue Apr 29 2014 Matej Stuchlik - 3.4.0-3 +- Point __os_install_post to correct brp-* files + * Tue Apr 15 2014 Matej Stuchlik - 3.4.0-2 - Temporarily disable tests requiring SIGHUP (rhbz#1088233) From 86b7a9ddd956a4f3f72ef992b05f58fab25a2d43 Mon Sep 17 00:00:00 2001 From: Matej Stuchlik Date: Tue, 29 Apr 2014 14:30:05 +0200 Subject: [PATCH 174/416] Build with rewheel --- python3.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 521cce6..7878923 100644 --- a/python3.spec +++ b/python3.spec @@ -2,7 +2,7 @@ # Conditionals and other variables controlling the build # ====================================================== -%global with_rewheel 0 +%global with_rewheel 1 %global pybasever 3.4 From f498010aff91098dbc3b3e7f8eb364f0c9d2b39a Mon Sep 17 00:00:00 2001 From: Matej Stuchlik Date: Mon, 12 May 2014 09:51:48 +0200 Subject: [PATCH 175/416] Add setuptools and pip to Requires --- python3.spec | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 7878923..4069f50 100644 --- a/python3.spec +++ b/python3.spec @@ -128,7 +128,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 3%{?dist} +Release: 4%{?dist} License: Python Group: Development/Languages @@ -701,6 +701,11 @@ Provides: python(abi) = %{pybasever} Requires: %{name}-libs%{?_isa} = %{version}-%{release} +%if 0%{with_rewheel} +Requires: python-setuptools +Requires: python-pip +%endif + %description Python 3 is a new version of the language that is incompatible with the 2.x line of releases. The language is mostly the same, but many details, especially @@ -1804,6 +1809,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon May 12 2014 Matej Stuchlik - 3.4.0-4 +- Add setuptools and pip to Requires + * Tue Apr 29 2014 Matej Stuchlik - 3.4.0-3 - Point __os_install_post to correct brp-* files From 06247262fead50272b205e7b98e99450c31cacd3 Mon Sep 17 00:00:00 2001 From: Matej Stuchlik Date: Fri, 16 May 2014 15:11:42 +0200 Subject: [PATCH 176/416] Don't add declaration-after-statement for extension modules --- ...d-Werror-declaration-after-statement.patch | 86 +++++++++++++++++++ python3.spec | 14 ++- 2 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 00195-dont-add-Werror-declaration-after-statement.patch diff --git a/00195-dont-add-Werror-declaration-after-statement.patch b/00195-dont-add-Werror-declaration-after-statement.patch new file mode 100644 index 0000000..506d9ea --- /dev/null +++ b/00195-dont-add-Werror-declaration-after-statement.patch @@ -0,0 +1,86 @@ +diff --git a/Makefile.pre.in b/Makefile.pre.in +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -71,12 +71,17 @@ + BASECFLAGS= @BASECFLAGS@ + BASECPPFLAGS= @BASECPPFLAGS@ + CONFIGURE_CFLAGS= @CFLAGS@ ++# CFLAGS_NODIST is used for building the interpreter and stdlib C extensions. ++# Use it when a compiler flag should _not_ be part of the distutils CFLAGS ++# once Python is installed (Issue #21121). ++CONFIGURE_CFLAGS_NODIST=@CFLAGS_NODIST@ + CONFIGURE_CPPFLAGS= @CPPFLAGS@ + CONFIGURE_LDFLAGS= @LDFLAGS@ + # Avoid assigning CFLAGS, LDFLAGS, etc. so users can use them on the + # command line to append to these values without stomping the pre-set + # values. + PY_CFLAGS= $(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) ++PY_CFLAGS_NODIST=$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) + # Both CPPFLAGS and LDFLAGS need to contain the shell's value for setup.py to + # be able to build extension modules using the directories specified in the + # environment variables +@@ -91,7 +96,7 @@ + # Extra C flags added for building the interpreter object files. + CFLAGSFORSHARED=@CFLAGSFORSHARED@ + # C flags used for building the interpreter object files +-PY_CORE_CFLAGS= $(PY_CFLAGS) $(PY_CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE ++PY_CORE_CFLAGS= $(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE + + + # Machine-dependent subdirectories +diff --git a/configure b/configure +--- a/configure ++++ b/configure +@@ -662,6 +662,7 @@ + LIBTOOL_CRUFT + OTHER_LIBTOOL_OPT + UNIVERSAL_ARCH_FLAGS ++CFLAGS_NODIST + BASECFLAGS + OPT + ABIFLAGS +@@ -6504,7 +6505,7 @@ + + if test $ac_cv_declaration_after_statement_warning = yes + then +- BASECFLAGS="$BASECFLAGS -Werror=declaration-after-statement" ++ CFLAGS_NODIST="$CFLAGS_NODIST -Werror=declaration-after-statement" + fi + + # if using gcc on alpha, use -mieee to get (near) full IEEE 754 +diff --git a/configure.ac b/configure.ac +--- a/configure.ac ++++ b/configure.ac +@@ -1147,6 +1147,7 @@ + fi + + AC_SUBST(BASECFLAGS) ++AC_SUBST(CFLAGS_NODIST) + + # The -arch flags for universal builds on OSX + UNIVERSAL_ARCH_FLAGS= +@@ -1231,7 +1232,7 @@ + + if test $ac_cv_declaration_after_statement_warning = yes + then +- BASECFLAGS="$BASECFLAGS -Werror=declaration-after-statement" ++ CFLAGS_NODIST="$CFLAGS_NODIST -Werror=declaration-after-statement" + fi + + # if using gcc on alpha, use -mieee to get (near) full IEEE 754 +diff --git a/setup.py b/setup.py +--- a/setup.py ++++ b/setup.py +@@ -19,6 +19,12 @@ + + cross_compiling = "_PYTHON_HOST_PLATFORM" in os.environ + ++# Add special CFLAGS reserved for building the interpreter and the stdlib ++# modules (Issue #21121). ++cflags = sysconfig.get_config_var('CFLAGS') ++py_cflags_nodist = sysconfig.get_config_var('PY_CFLAGS_NODIST') ++sysconfig.get_config_vars()['CFLAGS'] = cflags + ' ' + py_cflags_nodist ++ + def get_platform(): + # cross build + if "_PYTHON_HOST_PLATFORM" in os.environ: diff --git a/python3.spec b/python3.spec index 4069f50..6425f47 100644 --- a/python3.spec +++ b/python3.spec @@ -128,7 +128,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 4%{?dist} +Release: 5%{?dist} License: Python Group: Development/Languages @@ -663,6 +663,13 @@ Patch193: 00193-skip-correct-num-of-pycfile-bytes-in-modulefinder.patch # see rhbz#1088233 Patch194: temporarily-disable-tests-requiring-SIGHUP.patch +# 00195 +# +# Don't declare Werror=declaration-after-statement for extension +# modules through setup.py +# http://bugs.python.org/issue21121 +Patch195: 00195-dont-add-Werror-declaration-after-statement.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora 17 onwards, @@ -937,6 +944,7 @@ done %patch190 -p1 %patch193 -p1 %patch194 -p1 +%patch195 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1809,6 +1817,10 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Fri May 16 2014 Matej Stuchlik - 3.4.0-5 +- Don't add Werror=declaration-after-statement for extension + modules through setup.py (PyBT#21121) + * Mon May 12 2014 Matej Stuchlik - 3.4.0-4 - Add setuptools and pip to Requires From 1746188b354ae0b1641dbeed2009913a63e538ae Mon Sep 17 00:00:00 2001 From: Matej Stuchlik Date: Sun, 18 May 2014 23:39:35 +0200 Subject: [PATCH 177/416] Disable test_faulthandler, test_gdb on aarch64 (rhbz#1045193) --- python3.spec | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/python3.spec b/python3.spec index 6425f47..123b7ad 100644 --- a/python3.spec +++ b/python3.spec @@ -128,7 +128,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 5%{?dist} +Release: 6%{?dist} License: Python Group: Development/Languages @@ -1386,7 +1386,10 @@ CheckPython() { # @unittest._expectedFailureInRpmBuild WITHIN_PYTHON_RPM_BUILD= \ LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \ - --verbose --findleaks + --verbose --findleaks \ + %ifarch %{arm} + -x test_faulthandler test_gdb + %endif echo FINISHED: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName @@ -1817,6 +1820,10 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Sun May 18 2014 Matej Stuchlik - 3.4.0-6 +- Disable test_faulthandler, test_gdb on aarch64 +Resolves: rhbz#1045193 + * Fri May 16 2014 Matej Stuchlik - 3.4.0-5 - Don't add Werror=declaration-after-statement for extension modules through setup.py (PyBT#21121) From 3a3febacac01f9d9ebb2587eb93a4c76280cc930 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= Date: Wed, 21 May 2014 12:35:44 +0200 Subject: [PATCH 178/416] - Rebuilt for https://fedoraproject.org/wiki/Changes/f21tcl86 --- python3.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 792c205..171a931 100644 --- a/python3.spec +++ b/python3.spec @@ -126,7 +126,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 12%{?dist} +Release: 13%{?dist} License: Python Group: Development/Languages @@ -1755,6 +1755,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Wed May 21 2014 Jaroslav Škarvada - 3.3.2-13 +- Rebuilt for https://fedoraproject.org/wiki/Changes/f21tcl86 + * Wed Mar 05 2014 Bohuslav Kabrda - 3.3.2-12 - Fix loading of pyc files by ModuleFinder.load_module. Resolves: rhbz#1060338 From c21eb4aa375e86f6c74e3ceee6b3461793ccf87d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 22 May 2014 13:23:29 +0200 Subject: [PATCH 179/416] Add macro %python3_version_nodots --- macros.python3 | 1 + python3.spec | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/macros.python3 b/macros.python3 index d6d913c..395af00 100644 --- a/macros.python3 +++ b/macros.python3 @@ -2,4 +2,5 @@ %python3_sitelib %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") %python3_sitearch %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") %python3_version %(%{__python3} -c "import sys; sys.stdout.write(sys.version[:3])") +%python3_version_nodots %(%{__python3} -c "import sys; sys.stdout.write(sys.version[:3].replace('.',''))") %py3dir %{_builddir}/python3-%{name}-%{version}-%{release} diff --git a/python3.spec b/python3.spec index 171a931..4fda253 100644 --- a/python3.spec +++ b/python3.spec @@ -126,7 +126,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 13%{?dist} +Release: 14%{?dist} License: Python Group: Development/Languages @@ -1755,6 +1755,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Thu May 22 2014 Miro Hrončok - 3.3.2-14 +- Add macro %%python3_version_nodots + * Wed May 21 2014 Jaroslav Škarvada - 3.3.2-13 - Rebuilt for https://fedoraproject.org/wiki/Changes/f21tcl86 From 8ab4c2d31ffea4398650ddb23c3c9f3048f5021b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 22 May 2014 13:25:18 +0200 Subject: [PATCH 180/416] Add macro %python3_version_nodots --- macros.python3 | 1 + python3.spec | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/macros.python3 b/macros.python3 index d6d913c..395af00 100644 --- a/macros.python3 +++ b/macros.python3 @@ -2,4 +2,5 @@ %python3_sitelib %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") %python3_sitearch %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") %python3_version %(%{__python3} -c "import sys; sys.stdout.write(sys.version[:3])") +%python3_version_nodots %(%{__python3} -c "import sys; sys.stdout.write(sys.version[:3].replace('.',''))") %py3dir %{_builddir}/python3-%{name}-%{version}-%{release} diff --git a/python3.spec b/python3.spec index 123b7ad..e278396 100644 --- a/python3.spec +++ b/python3.spec @@ -128,7 +128,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 6%{?dist} +Release: 7%{?dist} License: Python Group: Development/Languages @@ -1820,6 +1820,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Thu May 22 2014 Miro Hrončok - 3.4.0-7 +- Add macro %%python3_version_nodots + * Sun May 18 2014 Matej Stuchlik - 3.4.0-6 - Disable test_faulthandler, test_gdb on aarch64 Resolves: rhbz#1045193 From da5702456fe9a29451b32c3985f9225a61671777 Mon Sep 17 00:00:00 2001 From: Matej Stuchlik Date: Sun, 25 May 2014 23:35:06 +0200 Subject: [PATCH 181/416] Fix test_gdb failure on ppc64le (rhbz#1095355) --- ...6-test-gdb-match-addr-before-builtin.patch | 30 +++++++++++++++++++ python3.spec | 12 +++++++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 00196-test-gdb-match-addr-before-builtin.patch diff --git a/00196-test-gdb-match-addr-before-builtin.patch b/00196-test-gdb-match-addr-before-builtin.patch new file mode 100644 index 0000000..dc40c82 --- /dev/null +++ b/00196-test-gdb-match-addr-before-builtin.patch @@ -0,0 +1,30 @@ +Subject: python3.test gdb match addr before builtin +From: Michel Normand + +For ppc64le archi and python3... and gdb... versions +the test_gdb.py need a change of re.match to handle address before the builtin_id word. +Of course there is no error if this substring is not present. +=== +... +#0 0x00003fffb7dd0898 in builtin_id (self=, v=) at /builddir/build/BUILD/Python-3.3.2/Python/bltinmodule.c:966 +....xxxxxxxxxxxxxxxxxxxxxx <= added regexp +=== + +Signed-off-by: Michel Normand +--- + Lib/test/test_gdb.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: Python-3.3.2/Lib/test/test_gdb.py +=================================================================== +--- Python-3.3.2.orig/Lib/test/test_gdb.py ++++ Python-3.3.2/Lib/test/test_gdb.py +@@ -230,7 +230,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+\S*Python/bltinmodule.c.*', ++ m = re.match('.*#0\s+(?: 0x[0-9a-f]+\s+in\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/python3.spec b/python3.spec index e278396..f5c1464 100644 --- a/python3.spec +++ b/python3.spec @@ -128,7 +128,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 7%{?dist} +Release: 8%{?dist} License: Python Group: Development/Languages @@ -670,6 +670,11 @@ Patch194: temporarily-disable-tests-requiring-SIGHUP.patch # http://bugs.python.org/issue21121 Patch195: 00195-dont-add-Werror-declaration-after-statement.patch +# 00196 +# +# Fix test_gdb failure on ppc64le +Patch196: 00196-test-gdb-match-addr-before-builtin.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora 17 onwards, @@ -945,6 +950,7 @@ done %patch193 -p1 %patch194 -p1 %patch195 -p1 +%patch196 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1820,6 +1826,10 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Sun May 25 2014 Matej Stuchlik - 3.4.0-8 +- Fix test_gdb failure on ppc64le +Resolves: rhbz#1095355 + * Thu May 22 2014 Miro Hrončok - 3.4.0-7 - Add macro %%python3_version_nodots From e602f7a288df4597d9d1ae56d8c079da61f45c0e Mon Sep 17 00:00:00 2001 From: Matej Stuchlik Date: Mon, 26 May 2014 00:20:13 +0200 Subject: [PATCH 182/416] Update to Python 3.4.1 --- 00190-fix-tests-with-sqlite-3.8.4.patch | 21 ------ ...num-of-pycfile-bytes-in-modulefinder.patch | 65 ------------------- python3.spec | 17 +++-- sources | 2 +- ...arily-disable-tests-requiring-SIGHUP.patch | 4 +- 5 files changed, 14 insertions(+), 95 deletions(-) delete mode 100644 00190-fix-tests-with-sqlite-3.8.4.patch delete mode 100644 00193-skip-correct-num-of-pycfile-bytes-in-modulefinder.patch diff --git a/00190-fix-tests-with-sqlite-3.8.4.patch b/00190-fix-tests-with-sqlite-3.8.4.patch deleted file mode 100644 index 8a94f5c..0000000 --- a/00190-fix-tests-with-sqlite-3.8.4.patch +++ /dev/null @@ -1,21 +0,0 @@ - -# HG changeset patch -# User Benjamin Peterson -# Date 1394679139 18000 -# Node ID 4d626a9df062104b61c44c8a5be8b0fd52fae953 -# Parent 6f93ab911d5dafcde364013e21723259fe2c85a8# Parent dbc9e3ed5e9f1bd11240eaa971f6c75d6a7013b5 -merge 3.3 (#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.assertGreater(first_count, second_count) -+ self.assertGreaterEqual(first_count, second_count) - - def CheckCancelOperation(self): - """ - diff --git a/00193-skip-correct-num-of-pycfile-bytes-in-modulefinder.patch b/00193-skip-correct-num-of-pycfile-bytes-in-modulefinder.patch deleted file mode 100644 index 4a82309..0000000 --- a/00193-skip-correct-num-of-pycfile-bytes-in-modulefinder.patch +++ /dev/null @@ -1,65 +0,0 @@ - -# HG changeset patch -# User Brett Cannon -# Date 1393602285 18000 -# Node ID 432cb56db05d73f55d211501bf0dfc767768923b -# Parent ade5e4922a54cb84c99ec924ab7c700a014893da -Issue #20778: Fix modulefinder to work with bytecode-only modules. - -Bug filed and initial attempt at a patch by Bohuslav Kabrda. - -diff --git a/Lib/modulefinder.py b/Lib/modulefinder.py ---- a/Lib/modulefinder.py -+++ b/Lib/modulefinder.py -@@ -290,7 +290,7 @@ class ModuleFinder: - if fp.read(4) != imp.get_magic(): - self.msgout(2, "raise ImportError: Bad magic number", pathname) - raise ImportError("Bad magic number in %s" % pathname) -- fp.read(4) -+ fp.read(8) # Skip mtime and size. - co = marshal.load(fp) - else: - co = None -diff --git a/Lib/test/test_modulefinder.py b/Lib/test/test_modulefinder.py ---- a/Lib/test/test_modulefinder.py -+++ b/Lib/test/test_modulefinder.py -@@ -1,5 +1,7 @@ - import os - import errno -+import importlib.machinery -+import py_compile - import shutil - import unittest - import tempfile -@@ -208,6 +210,14 @@ a/module.py - from . import * - """] - -+bytecode_test = [ -+ "a", -+ ["a"], -+ [], -+ [], -+ "" -+] -+ - - def open_file(path): - dirname = os.path.dirname(path) -@@ -288,6 +298,16 @@ class ModuleFinderTest(unittest.TestCase - def test_relative_imports_4(self): - self._do_test(relative_import_test_4) - -+ def test_bytecode(self): -+ base_path = os.path.join(TEST_DIR, 'a') -+ source_path = base_path + importlib.machinery.SOURCE_SUFFIXES[0] -+ bytecode_path = base_path + importlib.machinery.BYTECODE_SUFFIXES[0] -+ with open_file(source_path) as file: -+ file.write('testing_modulefinder = True\n') -+ py_compile.compile(source_path, cfile=bytecode_path) -+ os.remove(source_path) -+ self._do_test(bytecode_test) -+ - - def test_main(): - support.run_unittest(ModuleFinderTest) diff --git a/python3.spec b/python3.spec index f5c1464..414c0c9 100644 --- a/python3.spec +++ b/python3.spec @@ -127,8 +127,8 @@ # ================== Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 -Version: %{pybasever}.0 -Release: 8%{?dist} +Version: %{pybasever}.1 +Release: 1%{?dist} License: Python Group: Development/Languages @@ -650,14 +650,16 @@ Patch189: 00189-add-rewheel-module.patch # Fix tests with SQLite >= 3.8.4 # http://bugs.python.org/issue20901 # http://hg.python.org/cpython/rev/4d626a9df062 -Patch190: 00190-fix-tests-with-sqlite-3.8.4.patch +# FIXED UPSTREAM +# Patch190: 00190-fix-tests-with-sqlite-3.8.4.patch # 00193 # # Skip correct number of *.pyc file bytes in ModuleFinder.load_module # rhbz#1060338 # http://bugs.python.org/issue20778 -Patch193: 00193-skip-correct-num-of-pycfile-bytes-in-modulefinder.patch +# FIXED UPSTREAM +# Patch193: 00193-skip-correct-num-of-pycfile-bytes-in-modulefinder.patch # Tests requiring SIGHUP to work don't work in Koji # see rhbz#1088233 @@ -946,8 +948,8 @@ done %patch189 -p1 %endif -%patch190 -p1 -%patch193 -p1 +# 00190: upstream as of Python 3.4.1 +# 00193: upstream as of Python 3.4.1 %patch194 -p1 %patch195 -p1 %patch196 -p1 @@ -1826,6 +1828,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Sun May 25 2014 Matej Stuchlik - 3.4.1-1 +- Update to Python 3.4.1 + * Sun May 25 2014 Matej Stuchlik - 3.4.0-8 - Fix test_gdb failure on ppc64le Resolves: rhbz#1095355 diff --git a/sources b/sources index 3f1acf8..f2258f0 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -77c22725e14af3d71022cbfdebff4903 Python-3.4.0.tar.xz +6cafc183b4106476dd73d5738d7f616a Python-3.4.1.tar.xz diff --git a/temporarily-disable-tests-requiring-SIGHUP.patch b/temporarily-disable-tests-requiring-SIGHUP.patch index 130970f..88ac230 100644 --- a/temporarily-disable-tests-requiring-SIGHUP.patch +++ b/temporarily-disable-tests-requiring-SIGHUP.patch @@ -8,8 +8,8 @@ diff -up Python-3.4.0/Lib/test/test_asyncio/test_events.py.orig Python-3.4.0/Lib - @unittest.skipIf(sys.platform == 'win32', "Don't have SIGHUP") + @unittest.skipIf(True, "Temporarily skipped (rhbz#1088233)") def test_subprocess_send_signal(self): - proto = None - transp = None + prog = os.path.join(os.path.dirname(__file__), 'echo.py') + diff -up Python-3.4.0/Lib/test/test_asyncio/test_subprocess.py.orig Python-3.4.0/Lib/test/test_asyncio/test_subprocess.py --- Python-3.4.0/Lib/test/test_asyncio/test_subprocess.py.orig 2014-04-17 12:03:32.777827520 +0200 From c75d3be7c820e642618d317a468e3773de91c8ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 26 May 2014 19:38:24 +0200 Subject: [PATCH 183/416] Fix multilib dependencies. Resolves: rhbz#1091815 --- python3.spec | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/python3.spec b/python3.spec index 414c0c9..d962c3f 100644 --- a/python3.spec +++ b/python3.spec @@ -128,7 +128,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 1%{?dist} +Release: 2%{?dist} License: Python Group: Development/Languages @@ -743,7 +743,8 @@ This package contains files used to embed Python 3 into applications. %package devel Summary: Libraries and header files needed for Python 3 development Group: Development/Libraries -Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: %{name} = %{version}-%{release} +Requires: %{name}-libs%{?_isa} = %{version}-%{release} Conflicts: %{name} < %{version}-%{release} %description devel @@ -1828,6 +1829,10 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon May 26 2014 Miro Hrončok - 3.4.1-2 +- Fix multilib dependencies. +Resolves: rhbz#1091815 + * Sun May 25 2014 Matej Stuchlik - 3.4.1-1 - Update to Python 3.4.1 From cfa9e5212dede627c2069b9877cec6c9d7007971 Mon Sep 17 00:00:00 2001 From: Matej Stuchlik Date: Tue, 27 May 2014 12:42:42 +0200 Subject: [PATCH 184/416] Update rewheel module --- 00189-add-rewheel-module.patch | 7 +++++-- python3.spec | 9 ++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/00189-add-rewheel-module.patch b/00189-add-rewheel-module.patch index ad80e9f..b3804b8 100644 --- a/00189-add-rewheel-module.patch +++ b/00189-add-rewheel-module.patch @@ -75,7 +75,7 @@ unchanged: unchanged: --- Python-3.4.0rc3/Lib/ensurepip/rewheel/__init__.py 1970-01-01 01:00:00.000000000 +0100 +++ Python-3.4.0rc3-rewheel/Lib/ensurepip/rewheel/__init__.py 2014-03-12 09:55:30.413152104 +0100 -@@ -0,0 +1,133 @@ +@@ -0,0 +1,136 @@ +import argparse +import csv +import email.parser @@ -126,7 +126,10 @@ unchanged: + # if we have 0 or 2 or more dirs, something is wrong... + if len(filtered) == 1: + path = filtered[0] -+ records.append(os.path.join(path, 'RECORD')) ++ 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): diff --git a/python3.spec b/python3.spec index d962c3f..c373aee 100644 --- a/python3.spec +++ b/python3.spec @@ -128,7 +128,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 2%{?dist} +Release: 3%{?dist} License: Python Group: Development/Languages @@ -1396,8 +1396,8 @@ CheckPython() { WITHIN_PYTHON_RPM_BUILD= \ LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \ --verbose --findleaks \ - %ifarch %{arm} - -x test_faulthandler test_gdb + %ifarch ppc64le + -x test_faulthandler %endif echo FINISHED: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName @@ -1829,6 +1829,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Tue May 27 2014 Matej Stuchlik - 3.4.1-3 +- Update the rewheel module + * Mon May 26 2014 Miro Hrončok - 3.4.1-2 - Fix multilib dependencies. Resolves: rhbz#1091815 From f30edc5e6d1a5f3f2842d35883bbd2cbe09de648 Mon Sep 17 00:00:00 2001 From: Slavek Kabrda Date: Tue, 27 May 2014 17:33:00 +0200 Subject: [PATCH 185/416] Use python3-*, not python-* runtime requires on setuptools and pip --- python3.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/python3.spec b/python3.spec index 9bbdca5..6223b38 100644 --- a/python3.spec +++ b/python3.spec @@ -128,7 +128,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 3%{?dist} +Release: 4%{?dist} License: Python Group: Development/Languages @@ -717,8 +717,8 @@ Provides: python(abi) = %{pybasever} Requires: %{name}-libs%{?_isa} = %{version}-%{release} %if 0%{with_rewheel} -Requires: python-setuptools -Requires: python-pip +Requires: python3-setuptools +Requires: python3-pip %endif %description @@ -1831,6 +1831,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Tue May 27 2014 Bohuslav Kabrda - 3.4.1-4 +- Use python3-*, not python-* runtime requires on setuptools and pip + * Tue May 27 2014 Matej Stuchlik - 3.4.1-3 - Update the rewheel module From aeae72b51ce0317c715702d9de736703b8c4e006 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Tue, 27 May 2014 13:17:25 -0500 Subject: [PATCH 186/416] add message about building for tcl-8.6 --- python3.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/python3.spec b/python3.spec index 6223b38..706c95b 100644 --- a/python3.spec +++ b/python3.spec @@ -1833,6 +1833,7 @@ rm -fr %{buildroot} %changelog * Tue May 27 2014 Bohuslav Kabrda - 3.4.1-4 - Use python3-*, not python-* runtime requires on setuptools and pip +- rebuild for tcl-8.6 * Tue May 27 2014 Matej Stuchlik - 3.4.1-3 - Update the rewheel module From 29b96892f1b5c872d4f066f154164c39ec5c14de Mon Sep 17 00:00:00 2001 From: Slavek Kabrda Date: Wed, 28 May 2014 09:27:08 +0200 Subject: [PATCH 187/416] Also exclude test_faulthandler on aarch64 --- python3.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 706c95b..9eae9f1 100644 --- a/python3.spec +++ b/python3.spec @@ -1395,10 +1395,12 @@ CheckPython() { # our non-standard decorators take effect on the relevant tests: # @unittest._skipInRpmBuild(reason) # @unittest._expectedFailureInRpmBuild + # test_faulthandler.test_register_chain currently fails on ppc64le and + # aarch64, see upstream bug http://bugs.python.org/issue21131 WITHIN_PYTHON_RPM_BUILD= \ LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \ --verbose --findleaks \ - %ifarch ppc64le + %ifarch ppc64le aarch64 -x test_faulthandler %endif From 3d53dceca1baf5e3d20ac3bcc1c72a32cbd7a6ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 28 May 2014 15:08:24 +0200 Subject: [PATCH 188/416] Rename python3.Xm-config script to arch specific. Resolves: rhbz#1091815 --- python3.spec | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 9eae9f1..d3b33d1 100644 --- a/python3.spec +++ b/python3.spec @@ -128,7 +128,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 4%{?dist} +Release: 5%{?dist} License: Python Group: Development/Languages @@ -1367,6 +1367,11 @@ sed \ %endif # with_systemtap +# Rename the script that differs on different arches to arch specific name +mv %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-{,%{_arch}-}config +echo -e '#!/bin/sh\nexec `dirname $0`/python%{LDVERSION_optimized}-`uname -m`-config' > \ + %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-config + chmod +x %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-config # ====================================================== # Running the upstream test suite @@ -1666,6 +1671,7 @@ rm -fr %{buildroot} %{_bindir}/python3-config %{_bindir}/python%{pybasever}-config %{_bindir}/python%{LDVERSION_optimized}-config +%{_bindir}/python%{LDVERSION_optimized}-%{_arch}-config %{_libdir}/libpython%{LDVERSION_optimized}.so %{_libdir}/pkgconfig/python-%{LDVERSION_optimized}.pc %{_libdir}/pkgconfig/python-%{pybasever}.pc @@ -1833,6 +1839,10 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Wed May 28 2014 Miro Hrončok - 3.4.1-5 +- Rename python3.Xm-config script to arch specific. +Resolves: rhbz#1091815 + * Tue May 27 2014 Bohuslav Kabrda - 3.4.1-4 - Use python3-*, not python-* runtime requires on setuptools and pip - rebuild for tcl-8.6 From 567c9678bebd59fb785a6a6fc4e93cfd3e1f01db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 29 May 2014 15:17:39 +0200 Subject: [PATCH 189/416] Forward arguments to the arch specific config script Resolves: rhbz#1102683 --- python3.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/python3.spec b/python3.spec index d3b33d1..dde76a4 100644 --- a/python3.spec +++ b/python3.spec @@ -128,7 +128,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 5%{?dist} +Release: 6%{?dist} License: Python Group: Development/Languages @@ -1369,7 +1369,7 @@ sed \ # Rename the script that differs on different arches to arch specific name mv %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-{,%{_arch}-}config -echo -e '#!/bin/sh\nexec `dirname $0`/python%{LDVERSION_optimized}-`uname -m`-config' > \ +echo -e '#!/bin/sh\nexec `dirname $0`/python%{LDVERSION_optimized}-`uname -m`-config "$@"' > \ %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-config chmod +x %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-config @@ -1839,6 +1839,10 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Thu May 29 2014 Miro Hrončok - 3.4.1-6 +- Forward arguments to the arch specific config script +Resolves: rhbz#1102683 + * Wed May 28 2014 Miro Hrončok - 3.4.1-5 - Rename python3.Xm-config script to arch specific. Resolves: rhbz#1091815 From 2a2186c47077a32af506ad0490ed62623ef760ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Thu, 29 May 2014 18:10:59 +0200 Subject: [PATCH 190/416] - update the arch list where valgrind exists - %power64 includes also ppc64le which is not supported yet --- python3.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/python3.spec b/python3.spec index dde76a4..052ecf0 100644 --- a/python3.spec +++ b/python3.spec @@ -59,7 +59,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 %{arm} +%ifarch %{ix86} x86_64 ppc ppc64 ppc64p7 s390x %{arm} %global with_valgrind 1 %else %global with_valgrind 0 @@ -128,7 +128,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 6%{?dist} +Release: 7%{?dist} License: Python Group: Development/Languages @@ -1839,6 +1839,10 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Thu May 29 2014 Dan Horák - 3.4.1-7 +- update the arch list where valgrind exists - %%power64 includes also + ppc64le which is not supported yet + * Thu May 29 2014 Miro Hrončok - 3.4.1-6 - Forward arguments to the arch specific config script Resolves: rhbz#1102683 From f188880d6c23c753712e546a55670b20d530786f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 30 May 2014 11:41:17 +0200 Subject: [PATCH 191/416] In config script, use uname -m to write the arch --- python3.spec | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/python3.spec b/python3.spec index 052ecf0..aad4eaa 100644 --- a/python3.spec +++ b/python3.spec @@ -128,7 +128,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 7%{?dist} +Release: 8%{?dist} License: Python Group: Development/Languages @@ -1368,9 +1368,11 @@ sed \ %endif # with_systemtap # Rename the script that differs on different arches to arch specific name -mv %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-{,%{_arch}-}config +mv %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-{,`uname -m`-}config echo -e '#!/bin/sh\nexec `dirname $0`/python%{LDVERSION_optimized}-`uname -m`-config "$@"' > \ %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-config +echo '[ $? -eq 127 ] && echo "Could not find python%{LDVERSION_optimized}-`uname -m`-config. Look around to see available arches." >&2' >> \ + %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-config chmod +x %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-config # ====================================================== @@ -1671,7 +1673,7 @@ rm -fr %{buildroot} %{_bindir}/python3-config %{_bindir}/python%{pybasever}-config %{_bindir}/python%{LDVERSION_optimized}-config -%{_bindir}/python%{LDVERSION_optimized}-%{_arch}-config +%{_bindir}/python%{LDVERSION_optimized}-*-config %{_libdir}/libpython%{LDVERSION_optimized}.so %{_libdir}/pkgconfig/python-%{LDVERSION_optimized}.pc %{_libdir}/pkgconfig/python-%{pybasever}.pc @@ -1839,6 +1841,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Fri May 30 2014 Miro Hrončok - 3.4.1-8 +- In config script, use uname -m to write the arch + * Thu May 29 2014 Dan Horák - 3.4.1-7 - update the arch list where valgrind exists - %%power64 includes also ppc64le which is not supported yet From 95668bdbb2159a95132df13cb8e78dc6406fabaa Mon Sep 17 00:00:00 2001 From: Matej Stuchlik Date: Fri, 30 May 2014 11:52:51 +0200 Subject: [PATCH 192/416] Add explanation of the bootstraping process --- python3.spec | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/python3.spec b/python3.spec index aad4eaa..7bc69d4 100644 --- a/python3.spec +++ b/python3.spec @@ -2,6 +2,18 @@ # Conditionals and other variables controlling the build # ====================================================== +# NOTES ON BOOTSTRAPING PYTHON 3.4: +# +# Due to dependency cycle between Python, pip, setuptools and +# wheel caused by the rewheel patch, one has to build in the +# following order: +# +# 1) python3 with with_rewheel set to 0 +# 2) python3-setuptools and python3-pip with with_rewheel set to 0 +# 3) python3-wheel +# 4) python3-setuptools and python3-pip with with_rewheel set to 1 +# 5) python3 with with_rewheel set to 1 + %global with_rewheel 1 %global pybasever 3.4 From 1014fca077e1a1a399c3718553afd5cc1d24ab9a Mon Sep 17 00:00:00 2001 From: Matej Stuchlik Date: Tue, 3 Jun 2014 22:28:46 +0200 Subject: [PATCH 193/416] Change paths to bundled projects in rewheel patch --- 00189-add-rewheel-module.patch | 6 +++--- python3.spec | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/00189-add-rewheel-module.patch b/00189-add-rewheel-module.patch index b3804b8..ddb39f9 100644 --- a/00189-add-rewheel-module.patch +++ b/00189-add-rewheel-module.patch @@ -21,7 +21,7 @@ unchanged: pip.main(args) -@@ -87,20 +90,40 @@ def bootstrap(*, root=None, upgrade=Fals +@@ -87,20 +90,39 @@ def bootstrap(*, root=None, upgrade=Fals # omit pip and easy_install os.environ["ENSUREPIP_OPTIONS"] = "install" @@ -50,9 +50,9 @@ unchanged: - whl = pkgutil.get_data( + whl = os.path.join( + os.path.dirname(__file__), - "ensurepip", +- "ensurepip", - "_bundled/{}".format(wheel_name), -+ "bundled", ++ "_bundled", + "{}-{}-py2.py3-none-any.whl".format(project, version) ) - with open(os.path.join(tmpdir, wheel_name), "wb") as fp: diff --git a/python3.spec b/python3.spec index 7bc69d4..622890c 100644 --- a/python3.spec +++ b/python3.spec @@ -140,7 +140,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 8%{?dist} +Release: 9%{?dist} License: Python Group: Development/Languages @@ -1853,6 +1853,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Tue Jun 03 2014 Matej Stuchlik - 3.4.1-9 +- Change paths to bundled projects in rewheel patch + * Fri May 30 2014 Miro Hrončok - 3.4.1-8 - In config script, use uname -m to write the arch From cb99f9f0e58934179176280671dbda223a5c2c65 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Wed, 4 Jun 2014 23:16:38 +0200 Subject: [PATCH 194/416] bump release and rebuild to link with the correct tcl/tk libs on ppcle --- python3.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 622890c..e154bee 100644 --- a/python3.spec +++ b/python3.spec @@ -140,7 +140,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 9%{?dist} +Release: 10%{?dist} License: Python Group: Development/Languages @@ -1853,6 +1853,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Wed Jun 04 2014 Karsten Hopp 3.4.1-10 +- bump release and rebuild to link with the correct tcl/tk libs on ppcle + * Tue Jun 03 2014 Matej Stuchlik - 3.4.1-9 - Change paths to bundled projects in rewheel patch From a292e5b2122f0082a73d677659f5c111ecbb6ad0 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sat, 7 Jun 2014 19:38:08 -0500 Subject: [PATCH 195/416] - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild --- python3.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index e154bee..867c42d 100644 --- a/python3.spec +++ b/python3.spec @@ -140,7 +140,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 10%{?dist} +Release: 11%{?dist} License: Python Group: Development/Languages @@ -1853,6 +1853,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Sun Jun 08 2014 Fedora Release Engineering - 3.4.1-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + * Wed Jun 04 2014 Karsten Hopp 3.4.1-10 - bump release and rebuild to link with the correct tcl/tk libs on ppcle From 9012997174030631046c5489f87c2341f07a1758 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sun, 8 Jun 2014 16:27:22 +0100 Subject: [PATCH 196/416] aarch64 has valgrind, just list those that don't support it with a ifnarch --- python3.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python3.spec b/python3.spec index 867c42d..2596e4f 100644 --- a/python3.spec +++ b/python3.spec @@ -71,7 +71,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 ppc64p7 s390x %{arm} +%ifnarch s390 ppc64le %global with_valgrind 1 %else %global with_valgrind 0 @@ -140,7 +140,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 11%{?dist} +Release: 12%{?dist} License: Python Group: Development/Languages @@ -1853,6 +1853,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Sun Jun 8 2014 Peter Robinson 3.4.1-12 +- aarch64 has valgrind, just list those that don't support it + * Sun Jun 08 2014 Fedora Release Engineering - 3.4.1-11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild From 95a55939d74997721acfb6e9b190a815c3e41fc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 30 Jun 2014 18:53:45 +0200 Subject: [PATCH 197/416] Rewrite the config wrapper from Bash to Python, so it can be interpreted with Python --- config.py | 9 +++++++++ python3.spec | 15 +++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 config.py diff --git a/config.py b/config.py new file mode 100644 index 0000000..964d5d9 --- /dev/null +++ b/config.py @@ -0,0 +1,9 @@ +#!/bin/python3 +import sys +import subprocess +ver = sys.version[:3] +arch = subprocess.check_output('uname -m'.split()).decode("utf-8").rstrip() +call = ['python{ver}m-{arch}-config'.format(ver=ver, arch=arch)] + sys.argv[1:] +retval = subprocess.call(call) +if retval == 127: + print('Could not find python{ver}m-{arch}-config. Look around to see available arches.'.format(ver=ver, arch=arch), file=sys.stderr) diff --git a/python3.spec b/python3.spec index 2596e4f..e956ab5 100644 --- a/python3.spec +++ b/python3.spec @@ -140,7 +140,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 12%{?dist} +Release: 13%{?dist} License: Python Group: Development/Languages @@ -243,6 +243,9 @@ Source7: pyfuntop.stp # Written by bkabrda Source8: check-pyc-and-pyo-timestamps.py +# Python wrapper arounf pythonXXm-config to be able to keep python3-devel multiarch +Source9: config.py + # Fixup distutils/unixccompiler.py to remove standard library path from rpath: # Was Patch0 in ivazquez' python3000 specfile: Patch1: Python-3.1.1-rpath.patch @@ -1381,11 +1384,8 @@ sed \ # Rename the script that differs on different arches to arch specific name mv %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-{,`uname -m`-}config -echo -e '#!/bin/sh\nexec `dirname $0`/python%{LDVERSION_optimized}-`uname -m`-config "$@"' > \ - %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-config -echo '[ $? -eq 127 ] && echo "Could not find python%{LDVERSION_optimized}-`uname -m`-config. Look around to see available arches." >&2' >> \ - %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-config - chmod +x %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-config +cp %{SOURCE9} %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-config +chmod +x %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-config # ====================================================== # Running the upstream test suite @@ -1853,6 +1853,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon Jun 30 2014 Miro Hrončok - 3.4.1-13 +- Rewrite the config wrapper from Bash to Python, so it can be interpreted with Python + * Sun Jun 8 2014 Peter Robinson 3.4.1-12 - aarch64 has valgrind, just list those that don't support it From 41a68301c70978d906d1b08d4aaa85337d1de3fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 30 Jun 2014 19:11:22 +0200 Subject: [PATCH 198/416] Header of config script improval --- config.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config.py b/config.py index 964d5d9..b40b483 100644 --- a/config.py +++ b/config.py @@ -1,4 +1,6 @@ -#!/bin/python3 +#!/usr/bin/python3.4m +# -*- python -*- + import sys import subprocess ver = sys.version[:3] From 8430e60b7bf430abf5981c28da74ad999ec8ddda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 1 Jul 2014 12:14:53 +0200 Subject: [PATCH 199/416] Back to Bash wrapper, as upstream in 3.4 also uses Bash for some reasons This reverts commit 95a55939d74997721acfb6e9b190a815c3e41fc1. This reverts commit 41a68301c70978d906d1b08d4aaa85337d1de3fc. --- config.py | 11 ----------- python3.spec | 15 ++++++--------- 2 files changed, 6 insertions(+), 20 deletions(-) delete mode 100644 config.py diff --git a/config.py b/config.py deleted file mode 100644 index b40b483..0000000 --- a/config.py +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/python3.4m -# -*- python -*- - -import sys -import subprocess -ver = sys.version[:3] -arch = subprocess.check_output('uname -m'.split()).decode("utf-8").rstrip() -call = ['python{ver}m-{arch}-config'.format(ver=ver, arch=arch)] + sys.argv[1:] -retval = subprocess.call(call) -if retval == 127: - print('Could not find python{ver}m-{arch}-config. Look around to see available arches.'.format(ver=ver, arch=arch), file=sys.stderr) diff --git a/python3.spec b/python3.spec index e956ab5..2596e4f 100644 --- a/python3.spec +++ b/python3.spec @@ -140,7 +140,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 13%{?dist} +Release: 12%{?dist} License: Python Group: Development/Languages @@ -243,9 +243,6 @@ Source7: pyfuntop.stp # Written by bkabrda Source8: check-pyc-and-pyo-timestamps.py -# Python wrapper arounf pythonXXm-config to be able to keep python3-devel multiarch -Source9: config.py - # Fixup distutils/unixccompiler.py to remove standard library path from rpath: # Was Patch0 in ivazquez' python3000 specfile: Patch1: Python-3.1.1-rpath.patch @@ -1384,8 +1381,11 @@ sed \ # Rename the script that differs on different arches to arch specific name mv %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-{,`uname -m`-}config -cp %{SOURCE9} %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-config -chmod +x %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-config +echo -e '#!/bin/sh\nexec `dirname $0`/python%{LDVERSION_optimized}-`uname -m`-config "$@"' > \ + %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-config +echo '[ $? -eq 127 ] && echo "Could not find python%{LDVERSION_optimized}-`uname -m`-config. Look around to see available arches." >&2' >> \ + %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-config + chmod +x %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-config # ====================================================== # Running the upstream test suite @@ -1853,9 +1853,6 @@ rm -fr %{buildroot} # ====================================================== %changelog -* Mon Jun 30 2014 Miro Hrončok - 3.4.1-13 -- Rewrite the config wrapper from Bash to Python, so it can be interpreted with Python - * Sun Jun 8 2014 Peter Robinson 3.4.1-12 - aarch64 has valgrind, just list those that don't support it From 2d77c4da1bcd0e617eb2c819207d0bbe5a32ce86 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sun, 17 Aug 2014 22:05:56 +0000 Subject: [PATCH 200/416] - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild --- python3.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 2596e4f..3a51ca0 100644 --- a/python3.spec +++ b/python3.spec @@ -140,7 +140,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 12%{?dist} +Release: 13%{?dist} License: Python Group: Development/Languages @@ -1853,6 +1853,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Sun Aug 17 2014 Fedora Release Engineering - 3.4.1-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + * Sun Jun 8 2014 Peter Robinson 3.4.1-12 - aarch64 has valgrind, just list those that don't support it From ed631dfc76b4b509db4605404db3b80545f6399a Mon Sep 17 00:00:00 2001 From: Slavek Kabrda Date: Thu, 21 Aug 2014 16:40:42 +0200 Subject: [PATCH 201/416] Update rewheel patch with fix from https://github.com/bkabrda/rewheel/pull/1 --- 00189-add-rewheel-module.patch | 71 ++++++++++++++++++---------------- python3.spec | 5 ++- 2 files changed, 42 insertions(+), 34 deletions(-) diff --git a/00189-add-rewheel-module.patch b/00189-add-rewheel-module.patch index ddb39f9..5d514be 100644 --- a/00189-add-rewheel-module.patch +++ b/00189-add-rewheel-module.patch @@ -1,6 +1,6 @@ -unchanged: ---- Python-3.4.0rc3/Lib/ensurepip/__init__.py 2014-03-10 07:56:33.000000000 +0100 -+++ Python-3.4.0rc3-rewheel/Lib/ensurepip/__init__.py 2014-03-12 09:57:12.917120853 +0100 +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 @@ -1,8 +1,10 @@ import os import os.path @@ -12,7 +12,7 @@ unchanged: __all__ = ["version", "bootstrap"] -@@ -38,6 +40,8 @@ def _run_pip(args, additional_paths=None +@@ -38,6 +40,8 @@ # Install the bundled software import pip @@ -21,14 +21,10 @@ unchanged: pip.main(args) -@@ -87,20 +90,39 @@ def bootstrap(*, root=None, upgrade=Fals +@@ -87,20 +91,39 @@ # omit pip and easy_install os.environ["ENSUREPIP_OPTIONS"] = "install" -- with tempfile.TemporaryDirectory() as tmpdir: -- # Put our bundled wheels into a temporary directory and construct the -- # additional paths that need added to sys.path -- additional_paths = [] + whls = [] + rewheel_dir = None + # try to see if we have system-wide versions of _PROJECTS @@ -45,25 +41,28 @@ unchanged: + 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: -- wheel_name = "{}-{}-py2.py3-none-any.whl".format(project, version) -- whl = pkgutil.get_data( ++ for project, version in _PROJECTS: + whl = os.path.join( + os.path.dirname(__file__), -- "ensurepip", -- "_bundled/{}".format(wheel_name), + "_bundled", + "{}-{}-py2.py3-none-any.whl".format(project, version) - ) ++ ) ++ whls.append(whl) ++ + with tempfile.TemporaryDirectory() as tmpdir: + # 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) -+ whls.append(whl) - +- - additional_paths.append(os.path.join(tmpdir, wheel_name)) -+ with tempfile.TemporaryDirectory() as tmpdir: -+ # Put our bundled wheels into a temporary directory and construct the -+ # additional paths that need added to sys.path -+ additional_paths = [] + for whl in whls: + shutil.copy(whl, tmpdir) + additional_paths.append(os.path.join(tmpdir, os.path.basename(whl))) @@ -72,11 +71,12 @@ unchanged: # Construct the arguments to be passed to the pip command args = ["install", "--no-index", "--find-links", tmpdir] -unchanged: ---- Python-3.4.0rc3/Lib/ensurepip/rewheel/__init__.py 1970-01-01 01:00:00.000000000 +0100 -+++ Python-3.4.0rc3-rewheel/Lib/ensurepip/rewheel/__init__.py 2014-03-12 09:55:30.413152104 +0100 -@@ -0,0 +1,136 @@ +diff -Nur Python-3.4.1/Lib/ensurepip/rewheel/__init__.py Python-3.4.1-rewheel/Lib/ensurepip/rewheel/__init__.py +--- Python-3.4.1/Lib/ensurepip/rewheel/__init__.py 1970-01-01 01:00:00.000000000 +0100 ++++ Python-3.4.1-rewheel/Lib/ensurepip/rewheel/__init__.py 2014-08-21 10:11:22.560320121 +0200 +@@ -0,0 +1,143 @@ +import argparse ++import codecs +import csv +import email.parser +import os @@ -162,10 +162,14 @@ unchanged: + +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') -+ wheel_info = email.parser.Parser().parsestr(open(wheel_info_path).read()) ++ 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') -+ metadata = email.parser.Parser().parsestr(open(metadata_path).read()) ++ 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') @@ -187,7 +191,9 @@ unchanged: + - list of files that shouldn't be written or need some processing + (pyc and pyo files, scripts) + """ -+ record_contents = open(os.path.join(site_dir, record_relpath)).read() ++ 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) @@ -212,11 +218,10 @@ unchanged: + else: + pass # bad RECORD or empty line + return to_write, to_omit -only in patch2: -unchanged: ---- Python-3.4.0/Makefile.pre.in 2014-04-01 12:02:48.188136172 +0200 -+++ Python-3.4.0-new/Makefile.pre.in 2014-04-01 12:03:23.770394025 +0200 -@@ -1140,7 +1140,7 @@ LIBSUBDIRS= tkinter tkinter/test tkinter +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 +@@ -1145,7 +1145,7 @@ test/test_asyncio \ collections concurrent concurrent/futures encodings \ email email/mime test/test_email test/test_email/data \ diff --git a/python3.spec b/python3.spec index 3a51ca0..0fc0639 100644 --- a/python3.spec +++ b/python3.spec @@ -140,7 +140,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 13%{?dist} +Release: 14%{?dist} License: Python Group: Development/Languages @@ -1853,6 +1853,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Thu Aug 21 2014 Slavek Kabrda - 3.4.1-14 +- Update rewheel patch with fix from https://github.com/bkabrda/rewheel/pull/1 + * Sun Aug 17 2014 Fedora Release Engineering - 3.4.1-13 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild From 8d54999cc40b74b704ce09e1fb91e4918b9dfa7f Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Sun, 7 Sep 2014 12:29:29 +0200 Subject: [PATCH 202/416] exclude test_gdb on ppc* (rhbz#1132488) --- python3.spec | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/python3.spec b/python3.spec index 0fc0639..02b9d14 100644 --- a/python3.spec +++ b/python3.spec @@ -140,7 +140,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 14%{?dist} +Release: 15%{?dist} License: Python Group: Development/Languages @@ -1420,7 +1420,10 @@ CheckPython() { LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \ --verbose --findleaks \ %ifarch ppc64le aarch64 - -x test_faulthandler + -x test_faulthandler \ + %endif + %ifarch %{power64} + -x test_gdb %endif echo FINISHED: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName @@ -1853,6 +1856,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Sun Sep 07 2014 Karsten Hopp .1-15 +- exclude test_gdb on ppc* (rhbz#1132488) + * Thu Aug 21 2014 Slavek Kabrda - 3.4.1-14 - Update rewheel patch with fix from https://github.com/bkabrda/rewheel/pull/1 From e0539fb2e7dc339695f36bbb31459b2e3c7ae749 Mon Sep 17 00:00:00 2001 From: Slavek Kabrda Date: Mon, 3 Nov 2014 15:03:12 +0100 Subject: [PATCH 203/416] Fix CVE-2014-4650 - CGIHTTPServer URL handling Resolves: rhbz#1113529 --- 00197-fix-CVE-2014-4650.patch | 34 ++++++++++++++++++++++++++++++++++ python3.spec | 17 +++++++++++++++-- 2 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 00197-fix-CVE-2014-4650.patch diff --git a/00197-fix-CVE-2014-4650.patch b/00197-fix-CVE-2014-4650.patch new file mode 100644 index 0000000..6ab8137 --- /dev/null +++ b/00197-fix-CVE-2014-4650.patch @@ -0,0 +1,34 @@ +# HG changeset patch +# User Benjamin Peterson +# Date 1402796473 25200 +# Node ID 847e288d6e93dba049c280f40979e16a1378d0f6 +# Parent 6f1f387759913d91cb307d2783b3a40c48fe7424# Parent 5676797f3a3eccaf38e2c500e77ed39c68923cc9 +merge 3.3 (#21766) + +diff --git a/Lib/http/server.py b/Lib/http/server.py +--- a/Lib/http/server.py ++++ b/Lib/http/server.py +@@ -977,7 +977,7 @@ class CGIHTTPRequestHandler(SimpleHTTPRe + (and the next character is a '/' or the end of the string). + + """ +- collapsed_path = _url_collapse_path(self.path) ++ collapsed_path = _url_collapse_path(urllib.parse.unquote(self.path)) + dir_sep = collapsed_path.find('/', 1) + head, tail = collapsed_path[:dir_sep], collapsed_path[dir_sep+1:] + if head in self.cgi_directories: +diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py +--- a/Lib/test/test_httpservers.py ++++ b/Lib/test/test_httpservers.py +@@ -485,6 +485,11 @@ class CGIHTTPServerTestCase(BaseTestCase + (res.read(), res.getheader('Content-type'), res.status)) + self.assertEqual(os.environ['SERVER_SOFTWARE'], signature) + ++ def test_urlquote_decoding_in_cgi_check(self): ++ res = self.request('/cgi-bin%2ffile1.py') ++ self.assertEqual((b'Hello World\n', 'text/html', 200), ++ (res.read(), res.getheader('Content-type'), res.status)) ++ + + class SocketlessRequestHandler(SimpleHTTPRequestHandler): + def __init__(self): diff --git a/python3.spec b/python3.spec index 02b9d14..cc4b01d 100644 --- a/python3.spec +++ b/python3.spec @@ -140,7 +140,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 15%{?dist} +Release: 16%{?dist} License: Python Group: Development/Languages @@ -689,6 +689,14 @@ Patch195: 00195-dont-add-Werror-declaration-after-statement.patch # Fix test_gdb failure on ppc64le Patch196: 00196-test-gdb-match-addr-before-builtin.patch +# 00197 +# +# The CGIHTTPServer Python module did not properly handle URL-encoded +# path separators in URLs. This may have enabled attackers to disclose a CGI +# script's source code or execute arbitrary scripts in the server's +# document root. +Patch197: 00197-fix-CVE-2014-4650.patch + # (New patches go here ^^^) # @@ -967,6 +975,7 @@ done %patch194 -p1 %patch195 -p1 %patch196 -p1 +%patch197 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1856,7 +1865,11 @@ rm -fr %{buildroot} # ====================================================== %changelog -* Sun Sep 07 2014 Karsten Hopp .1-15 +* Mon Nov 03 2014 Slavek Kabrda - 3.4.1-16 +- Fix CVE-2014-4650 - CGIHTTPServer URL handling +Resolves: rhbz#1113529 + +* Sun Sep 07 2014 Karsten Hopp 3.4.1-15 - exclude test_gdb on ppc* (rhbz#1132488) * Thu Aug 21 2014 Slavek Kabrda - 3.4.1-14 From a8e96a15a3a304941150406730bdec774c271637 Mon Sep 17 00:00:00 2001 From: Matej Stuchlik Date: Thu, 13 Nov 2014 10:58:03 +0100 Subject: [PATCH 204/416] Update to Python 3.4.2 --- 00156-gdb-autoload-safepath.patch | 2 +- ...d-Werror-declaration-after-statement.patch | 86 ------------------- 00197-fix-CVE-2014-4650.patch | 34 -------- python3.spec | 20 +++-- sources | 2 +- ...arily-disable-tests-requiring-SIGHUP.patch | 4 +- 6 files changed, 17 insertions(+), 131 deletions(-) delete mode 100644 00195-dont-add-Werror-declaration-after-statement.patch delete mode 100644 00197-fix-CVE-2014-4650.patch diff --git a/00156-gdb-autoload-safepath.patch b/00156-gdb-autoload-safepath.patch index ac2aa40..1e57e9f 100644 --- a/00156-gdb-autoload-safepath.patch +++ b/00156-gdb-autoload-safepath.patch @@ -45,7 +45,7 @@ diff -up Python-3.2.3/Lib/test/test_gdb.py.gdb-autoload-safepath Python-3.2.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/00195-dont-add-Werror-declaration-after-statement.patch b/00195-dont-add-Werror-declaration-after-statement.patch deleted file mode 100644 index 506d9ea..0000000 --- a/00195-dont-add-Werror-declaration-after-statement.patch +++ /dev/null @@ -1,86 +0,0 @@ -diff --git a/Makefile.pre.in b/Makefile.pre.in ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -71,12 +71,17 @@ - BASECFLAGS= @BASECFLAGS@ - BASECPPFLAGS= @BASECPPFLAGS@ - CONFIGURE_CFLAGS= @CFLAGS@ -+# CFLAGS_NODIST is used for building the interpreter and stdlib C extensions. -+# Use it when a compiler flag should _not_ be part of the distutils CFLAGS -+# once Python is installed (Issue #21121). -+CONFIGURE_CFLAGS_NODIST=@CFLAGS_NODIST@ - CONFIGURE_CPPFLAGS= @CPPFLAGS@ - CONFIGURE_LDFLAGS= @LDFLAGS@ - # Avoid assigning CFLAGS, LDFLAGS, etc. so users can use them on the - # command line to append to these values without stomping the pre-set - # values. - PY_CFLAGS= $(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -+PY_CFLAGS_NODIST=$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) - # Both CPPFLAGS and LDFLAGS need to contain the shell's value for setup.py to - # be able to build extension modules using the directories specified in the - # environment variables -@@ -91,7 +96,7 @@ - # Extra C flags added for building the interpreter object files. - CFLAGSFORSHARED=@CFLAGSFORSHARED@ - # C flags used for building the interpreter object files --PY_CORE_CFLAGS= $(PY_CFLAGS) $(PY_CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE -+PY_CORE_CFLAGS= $(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE - - - # Machine-dependent subdirectories -diff --git a/configure b/configure ---- a/configure -+++ b/configure -@@ -662,6 +662,7 @@ - LIBTOOL_CRUFT - OTHER_LIBTOOL_OPT - UNIVERSAL_ARCH_FLAGS -+CFLAGS_NODIST - BASECFLAGS - OPT - ABIFLAGS -@@ -6504,7 +6505,7 @@ - - if test $ac_cv_declaration_after_statement_warning = yes - then -- BASECFLAGS="$BASECFLAGS -Werror=declaration-after-statement" -+ CFLAGS_NODIST="$CFLAGS_NODIST -Werror=declaration-after-statement" - fi - - # if using gcc on alpha, use -mieee to get (near) full IEEE 754 -diff --git a/configure.ac b/configure.ac ---- a/configure.ac -+++ b/configure.ac -@@ -1147,6 +1147,7 @@ - fi - - AC_SUBST(BASECFLAGS) -+AC_SUBST(CFLAGS_NODIST) - - # The -arch flags for universal builds on OSX - UNIVERSAL_ARCH_FLAGS= -@@ -1231,7 +1232,7 @@ - - if test $ac_cv_declaration_after_statement_warning = yes - then -- BASECFLAGS="$BASECFLAGS -Werror=declaration-after-statement" -+ CFLAGS_NODIST="$CFLAGS_NODIST -Werror=declaration-after-statement" - fi - - # if using gcc on alpha, use -mieee to get (near) full IEEE 754 -diff --git a/setup.py b/setup.py ---- a/setup.py -+++ b/setup.py -@@ -19,6 +19,12 @@ - - cross_compiling = "_PYTHON_HOST_PLATFORM" in os.environ - -+# Add special CFLAGS reserved for building the interpreter and the stdlib -+# modules (Issue #21121). -+cflags = sysconfig.get_config_var('CFLAGS') -+py_cflags_nodist = sysconfig.get_config_var('PY_CFLAGS_NODIST') -+sysconfig.get_config_vars()['CFLAGS'] = cflags + ' ' + py_cflags_nodist -+ - def get_platform(): - # cross build - if "_PYTHON_HOST_PLATFORM" in os.environ: diff --git a/00197-fix-CVE-2014-4650.patch b/00197-fix-CVE-2014-4650.patch deleted file mode 100644 index 6ab8137..0000000 --- a/00197-fix-CVE-2014-4650.patch +++ /dev/null @@ -1,34 +0,0 @@ -# HG changeset patch -# User Benjamin Peterson -# Date 1402796473 25200 -# Node ID 847e288d6e93dba049c280f40979e16a1378d0f6 -# Parent 6f1f387759913d91cb307d2783b3a40c48fe7424# Parent 5676797f3a3eccaf38e2c500e77ed39c68923cc9 -merge 3.3 (#21766) - -diff --git a/Lib/http/server.py b/Lib/http/server.py ---- a/Lib/http/server.py -+++ b/Lib/http/server.py -@@ -977,7 +977,7 @@ class CGIHTTPRequestHandler(SimpleHTTPRe - (and the next character is a '/' or the end of the string). - - """ -- collapsed_path = _url_collapse_path(self.path) -+ collapsed_path = _url_collapse_path(urllib.parse.unquote(self.path)) - dir_sep = collapsed_path.find('/', 1) - head, tail = collapsed_path[:dir_sep], collapsed_path[dir_sep+1:] - if head in self.cgi_directories: -diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py ---- a/Lib/test/test_httpservers.py -+++ b/Lib/test/test_httpservers.py -@@ -485,6 +485,11 @@ class CGIHTTPServerTestCase(BaseTestCase - (res.read(), res.getheader('Content-type'), res.status)) - self.assertEqual(os.environ['SERVER_SOFTWARE'], signature) - -+ def test_urlquote_decoding_in_cgi_check(self): -+ res = self.request('/cgi-bin%2ffile1.py') -+ self.assertEqual((b'Hello World\n', 'text/html', 200), -+ (res.read(), res.getheader('Content-type'), res.status)) -+ - - class SocketlessRequestHandler(SimpleHTTPRequestHandler): - def __init__(self): diff --git a/python3.spec b/python3.spec index cc4b01d..bfe1482 100644 --- a/python3.spec +++ b/python3.spec @@ -139,8 +139,8 @@ # ================== Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 -Version: %{pybasever}.1 -Release: 16%{?dist} +Version: %{pybasever}.2 +Release: 1%{?dist} License: Python Group: Development/Languages @@ -682,7 +682,8 @@ Patch194: temporarily-disable-tests-requiring-SIGHUP.patch # Don't declare Werror=declaration-after-statement for extension # modules through setup.py # http://bugs.python.org/issue21121 -Patch195: 00195-dont-add-Werror-declaration-after-statement.patch +# FIXED UPSTREAM +# Patch195: 00195-dont-add-Werror-declaration-after-statement.patch # 00196 # @@ -695,7 +696,8 @@ Patch196: 00196-test-gdb-match-addr-before-builtin.patch # path separators in URLs. This may have enabled attackers to disclose a CGI # script's source code or execute arbitrary scripts in the server's # document root. -Patch197: 00197-fix-CVE-2014-4650.patch +# FIXED UPSTREAM +# Patch197: 00197-fix-CVE-2014-4650.patch # (New patches go here ^^^) @@ -973,9 +975,9 @@ done # 00190: upstream as of Python 3.4.1 # 00193: upstream as of Python 3.4.1 %patch194 -p1 -%patch195 -p1 +# 00195: upstream as of Python 3.4.2 %patch196 -p1 -%patch197 -p1 +# 00197: upstream as of Python 3.4.2 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1722,7 +1724,6 @@ rm -fr %{buildroot} %{pylibdir}/__pycache__/turtle*%{bytecode_suffixes} %dir %{pylibdir}/turtledemo %{pylibdir}/turtledemo/*.py -%{pylibdir}/turtledemo/*.txt %{pylibdir}/turtledemo/*.cfg %dir %{pylibdir}/turtledemo/__pycache__/ %{pylibdir}/turtledemo/__pycache__/*%{bytecode_suffixes} @@ -1865,6 +1866,11 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Thu Nov 13 2014 Matej Stuchlik - 3.4.2-1 +- Update to 3.4.2 +- Refreshed patches: 156 (gdb autoload) +- Removed: 195 (Werror declaration), 197 (CVE-2014-4650) + * Mon Nov 03 2014 Slavek Kabrda - 3.4.1-16 - Fix CVE-2014-4650 - CGIHTTPServer URL handling Resolves: rhbz#1113529 diff --git a/sources b/sources index f2258f0..849668a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -6cafc183b4106476dd73d5738d7f616a Python-3.4.1.tar.xz +36fc7327c02c6f12fa24fc9ba78039e3 Python-3.4.2.tar.xz diff --git a/temporarily-disable-tests-requiring-SIGHUP.patch b/temporarily-disable-tests-requiring-SIGHUP.patch index 88ac230..2e88678 100644 --- a/temporarily-disable-tests-requiring-SIGHUP.patch +++ b/temporarily-disable-tests-requiring-SIGHUP.patch @@ -21,5 +21,5 @@ diff -up Python-3.4.0/Lib/test/test_asyncio/test_subprocess.py.orig Python-3.4.0 - @unittest.skipIf(sys.platform == 'win32', "Don't have SIGHUP") + @unittest.skipIf(True, "Temporarily skipped (rhbz#1088233)") def test_send_signal(self): - args = PROGRAM_BLOCKED - create = asyncio.create_subprocess_exec(*args, loop=self.loop) + code = 'import time; print("sleeping", flush=True); time.sleep(3600)' + args = [sys.executable, '-c', code] From 6afc2ff1f853da2b195af10118ede45305af0ace Mon Sep 17 00:00:00 2001 From: Robert Kuska Date: Thu, 11 Dec 2014 14:39:08 +0100 Subject: [PATCH 205/416] Update tests to reflect latest changes in OpenSSL SSLv23 method --- ...lter-tests-to-reflect-sslv3-disabled.patch | 49 +++++++++++++++++++ python3.spec | 11 ++++- 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 00199-alter-tests-to-reflect-sslv3-disabled.patch 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..f35eff9 --- /dev/null +++ b/00199-alter-tests-to-reflect-sslv3-disabled.patch @@ -0,0 +1,49 @@ +diff -up Python-3.4.2/Lib/test/test_ssl.py.ssl Python-3.4.2/Lib/test/test_ssl.py +--- Python-3.4.2/Lib/test/test_ssl.py.ssl 2014-12-11 12:25:21.886928225 +0100 ++++ Python-3.4.2/Lib/test/test_ssl.py 2014-12-11 12:25:00.284746529 +0100 +@@ -674,10 +674,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(): +@@ -2149,21 +2146,18 @@ else: + 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_SSLv3, False) + try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv23, True) + try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1, True) + +- try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3, True, 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, True, ssl.CERT_OPTIONAL) + +- try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3, True, 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, 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) +@@ -2186,7 +2180,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, True, ++ try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv23, False, + client_options=ssl.OP_NO_SSLv2) + + @skip_if_broken_ubuntu_ssl diff --git a/python3.spec b/python3.spec index bfe1482..916bc6c 100644 --- a/python3.spec +++ b/python3.spec @@ -140,7 +140,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 1%{?dist} +Release: 2%{?dist} License: Python Group: Development/Languages @@ -699,6 +699,11 @@ Patch196: 00196-test-gdb-match-addr-before-builtin.patch # FIXED UPSTREAM # Patch197: 00197-fix-CVE-2014-4650.patch +# 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 ^^^) # @@ -978,6 +983,7 @@ done # 00195: upstream as of Python 3.4.2 %patch196 -p1 # 00197: upstream as of Python 3.4.2 +%patch199 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1866,6 +1872,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Thu Dec 11 2014 Robert Kuska - 3.4.2-2 +- OpenSSL disabled SSLv3 in SSLv23 method + * Thu Nov 13 2014 Matej Stuchlik - 3.4.2-1 - Update to 3.4.2 - Refreshed patches: 156 (gdb autoload) From 86a9a20d91dbbe13a03fe87a7dcf0e39f2e6136e Mon Sep 17 00:00:00 2001 From: Robert Kuska Date: Tue, 16 Dec 2014 13:41:03 +0100 Subject: [PATCH 206/416] Backport patches from other pythons versions --- 00170-gc-assertions.patch | 325 ++++++++++++++++++++++++++++ 00200-gettext-plural-fix.patch | 12 + 00201-fix-memory-leak-in-gdbm.patch | 10 + python3.spec | 32 ++- 4 files changed, 374 insertions(+), 5 deletions(-) create mode 100644 00170-gc-assertions.patch create mode 100644 00200-gettext-plural-fix.patch create mode 100644 00201-fix-memory-leak-in-gdbm.patch diff --git a/00170-gc-assertions.patch b/00170-gc-assertions.patch new file mode 100644 index 0000000..1144cc2 --- /dev/null +++ b/00170-gc-assertions.patch @@ -0,0 +1,325 @@ +Index: Include/object.h +=================================================================== +--- Include/object.h (revision 87911) ++++ Include/object.h (working copy) +@@ -914,6 +914,49 @@ + _PyObject_DebugTypeStats(FILE *out); + #endif /* ifndef Py_LIMITED_API */ + ++/* ++ 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) ++ ++/* ++ Declare and define the entrypoint even when NDEBUG is defined, to avoid ++ causing compiler/linker errors when building extensions without NDEBUG ++ against a Python built with NDEBUG defined ++*/ ++PyAPI_FUNC(void) _PyObject_AssertFailed(PyObject *, const char *, ++ const char *, const char *, int, ++ const char *); ++ + #ifdef __cplusplus + } + #endif +Index: Objects/object.c +=================================================================== +--- Objects/object.c (revision 87911) ++++ Objects/object.c (working copy) +@@ -1899,6 +1899,35 @@ + } + } + ++PyAPI_FUNC(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(); ++} ++ + #ifndef Py_TRACE_REFS + /* For Py_LIMITED_API, we need an out-of-line version of _Py_Dealloc. + Define this here, so we can undefine the macro. */ +Index: Lib/test/test_gc.py +=================================================================== +--- Lib/test/test_gc.py (revision 87911) ++++ Lib/test/test_gc.py (working copy) +@@ -1,6 +1,6 @@ + import unittest + from test.support import (verbose, refcount_test, run_unittest, +- strip_python_stderr, cpython_only) ++ strip_python_stderr, cpython_only, import_module) + from test.script_helper import assert_python_ok, make_script, temp_dir + + import sys +@@ -512,6 +512,48 @@ + self.assertEqual(len(gc.garbage), 0) + + ++ def test_refcount_errors(self): ++ self.preclean() ++ # 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.assertRegex(stderr, ++ b'Modules/gcmodule.c:[0-9]+: visit_decref: Assertion "\(\(gc\)->gc.gc_refs >> \(1\)\) != 0" failed.') ++ self.assertRegex(stderr, ++ b'refcount was too small') ++ self.assertRegex(stderr, ++ b'object : \[\]') ++ self.assertRegex(stderr, ++ b'type : list') ++ self.assertRegex(stderr, ++ b'refcount: 1') ++ self.assertRegex(stderr, ++ b'address : 0x[0-9a-f]+') ++ ++ + class GCTogglingTests(unittest.TestCase): + def setUp(self): + gc.enable() +diff -up Modules/gcmodule.c.orig2 Modules/gcmodule.c +--- Modules/gcmodule.c.orig2 2014-12-08 10:54:14.251742911 +0100 ++++ Modules/gcmodule.c 2014-12-08 10:52:45.674771917 +0100 +@@ -341,7 +341,8 @@ update_refs(PyGC_Head *containers) + { + PyGC_Head *gc = containers->gc.gc_next; + for (; gc != containers; gc = gc->gc.gc_next) { +- assert(_PyGCHead_REFS(gc) == GC_REACHABLE); ++ PyObject_ASSERT(FROM_GC(gc), ++ _PyGCHead_REFS(gc) == GC_REACHABLE); + _PyGCHead_SET_REFS(gc, 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 +@@ -361,7 +362,8 @@ update_refs(PyGC_Head *containers) + * so serious that maybe this should be a release-build + * check instead of an assert? + */ +- assert(_PyGCHead_REFS(gc) != 0); ++ PyObject_ASSERT(FROM_GC(gc), ++ _PyGCHead_REFS(gc) != 0); + } + } + +@@ -376,7 +378,9 @@ visit_decref(PyObject *op, void *data) + * generation being collected, which can be recognized + * because only they have positive gc_refs. + */ +- assert(_PyGCHead_REFS(gc) != 0); /* else refcount was too small */ ++ PyObject_ASSERT_WITH_MSG(FROM_GC(gc), ++ _PyGCHead_REFS(gc) != 0, ++ "refcount was too small"); /* else refcount was too small */ + if (_PyGCHead_REFS(gc) > 0) + _PyGCHead_DECREF(gc); + } +@@ -436,9 +440,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; +@@ -480,7 +485,7 @@ move_unreachable(PyGC_Head *young, PyGC_ + */ + PyObject *op = FROM_GC(gc); + traverseproc traverse = Py_TYPE(op)->tp_traverse; +- assert(_PyGCHead_REFS(gc) > 0); ++ PyObject_ASSERT(op, _PyGCHead_REFS(gc) > 0); + _PyGCHead_SET_REFS(gc, GC_REACHABLE); + (void) traverse(op, + (visitproc)visit_reachable, +@@ -543,7 +548,7 @@ move_legacy_finalizers(PyGC_Head *unreac + 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_legacy_finalizer(op)) { +@@ -619,7 +624,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))) +@@ -640,9 +645,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 */ + +@@ -676,7 +681,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. +@@ -685,7 +690,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); +@@ -701,11 +707,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); +@@ -822,12 +828,14 @@ check_garbage(PyGC_Head *collectable) + for (gc = collectable->gc.gc_next; gc != collectable; + gc = gc->gc.gc_next) { + _PyGCHead_SET_REFS(gc, Py_REFCNT(FROM_GC(gc))); +- assert(_PyGCHead_REFS(gc) != 0); ++ PyObject_ASSERT(FROM_GC(gc), ++ _PyGCHead_REFS(gc) != 0); + } + subtract_refs(collectable); + for (gc = collectable->gc.gc_next; gc != collectable; + gc = gc->gc.gc_next) { +- assert(_PyGCHead_REFS(gc) >= 0); ++ PyObject_ASSERT(FROM_GC(gc), ++ _PyGCHead_REFS(gc) >= 0); + if (_PyGCHead_REFS(gc) != 0) + return -1; + } +diff -up Lib/test/test_gc.py.old Lib/test/test_gc.py +--- Lib/test/test_gc.py.old 2014-12-10 11:19:33.503982288 +0100 ++++ Lib/test/test_gc.py 2014-12-10 11:21:13.220021364 +0100 +@@ -49,6 +49,8 @@ class GC_Detector(object): + # gc collects it. + self.wr = weakref.ref(C1055820(666), it_happened) + ++BUILD_WITH_NDEBUG = ('-DNDEBUG' in sysconfig.get_config_vars()['PY_CFLAGS']) ++ + @with_tp_del + class Uncollectable(object): + """Create a reference cycle with multiple __del__ methods. +@@ -854,6 +856,8 @@ class GCCallbackTests(unittest.TestCase) + self.assertEqual(len(gc.garbage), 0) + + ++ @unittest.skipIf(BUILD_WITH_NDEBUG, ++ 'built with -NDEBUG') + def test_refcount_errors(self): + self.preclean() + # Verify the "handling" of objects with broken refcounts +diff -up Lib/test/test_gc.py.old Lib/test/test_gc.py +--- Lib/test/test_gc.py.old 2014-12-10 12:50:58.252121318 +0100 ++++ Lib/test/test_gc.py 2014-12-10 12:51:08.594266653 +0100 +@@ -4,6 +4,7 @@ from test.support import (verbose, refco + from test.script_helper import assert_python_ok, make_script, temp_dir + + import sys ++import sysconfig + import time + import gc + import weakref diff --git a/00200-gettext-plural-fix.patch b/00200-gettext-plural-fix.patch new file mode 100644 index 0000000..93b817b --- /dev/null +++ b/00200-gettext-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 = b_item.decode().strip() + if not item: + continue ++ if item.startswith("#"): ++ continue + if ':' in item: + k, v = item.split(':', 1) + k = k.strip().lower() diff --git a/00201-fix-memory-leak-in-gdbm.patch b/00201-fix-memory-leak-in-gdbm.patch new file mode 100644 index 0000000..48839d5 --- /dev/null +++ b/00201-fix-memory-leak-in-gdbm.patch @@ -0,0 +1,10 @@ +--- Modules/_gdbmmodule.c.orig 2013-07-08 14:54:27.803790151 +0200 ++++ Modules/_gdbmmodule.c 2013-07-08 14:55:25.006672443 +0200 +@@ -106,6 +106,7 @@ + if(okey.dsize) free(okey.dptr); + okey=key; + } ++ if(okey.dsize) free(okey.dptr); + dp->di_size = size; + } + return dp->di_size; diff --git a/python3.spec b/python3.spec index 916bc6c..cbe48d0 100644 --- a/python3.spec +++ b/python3.spec @@ -140,7 +140,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 2%{?dist} +Release: 3%{?dist} License: Python Group: Development/Languages @@ -539,10 +539,16 @@ Patch164: 00164-disable-interrupted_write-tests-on-ppc.patch # in python.spec # TODO: python3 status? -# 00170 # -# Patch170: 00170-gc-assertions.patch -# in python.spec -# TODO: python3 status? +# 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 # 00171 # # python.spec had: @@ -704,6 +710,18 @@ Patch196: 00196-test-gdb-match-addr-before-builtin.patch # Issue: http://bugs.python.org/issue22638 Upstream discussion about SSLv3 in Python Patch199: 00199-alter-tests-to-reflect-sslv3-disabled.patch +# 00200 # +# Fix for gettext plural form headers (lines that begin with "#") +# Note: Backported from scl +Patch200: 00200-gettext-plural-fix.patch + +# 00201 # +# Fixes memory leak in gdbm module (rhbz#977308) +# This was upstreamed as a part of bigger patch, but for our purposes +# this is ok: http://bugs.python.org/issue18404 +# Note: Backported from scl +Patch201: 00201-fix-memory-leak-in-gdbm.patch + # (New patches go here ^^^) # @@ -1872,6 +1890,10 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Tue Dec 16 2014 Robert Kuska - 3.4.2-3 +- New patches: 170 (gc asserts), 200 (gettext headers), + 201 (gdbm memory leak) + * Thu Dec 11 2014 Robert Kuska - 3.4.2-2 - OpenSSL disabled SSLv3 in SSLv23 method From 70025c7217a5b9a0d4502efb121b9d62ba602ce4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Mon, 12 Jan 2015 07:02:47 -0500 Subject: [PATCH 207/416] - build with valgrind on ppc64le - disable test_gdb on s390(x) until rhbz#1181034 is resolved --- ...sable-interrupted_write-tests-on-ppc.patch | 34 +++++++++---------- python3.spec | 10 ++++-- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/00164-disable-interrupted_write-tests-on-ppc.patch b/00164-disable-interrupted_write-tests-on-ppc.patch index 0db8092..5641b4b 100644 --- a/00164-disable-interrupted_write-tests-on-ppc.patch +++ b/00164-disable-interrupted_write-tests-on-ppc.patch @@ -1,7 +1,7 @@ -diff -up Python-3.3.0b1/Lib/test/test_exceptions.py.846849 Python-3.3.0b1/Lib/test/test_exceptions.py ---- Python-3.3.0b1/Lib/test/test_exceptions.py.846849 2012-06-26 22:19:47.000000000 +0200 -+++ Python-3.3.0b1/Lib/test/test_exceptions.py 2012-08-13 17:41:28.845403486 +0200 -@@ -401,6 +401,7 @@ class ExceptionTests(unittest.TestCase): +diff -up Python-3.4.2/Lib/test/test_exceptions.py.ppc Python-3.4.2/Lib/test/test_exceptions.py +--- Python-3.4.2/Lib/test/test_exceptions.py.ppc 2014-10-08 04:18:13.000000000 -0400 ++++ Python-3.4.2/Lib/test/test_exceptions.py 2015-01-12 05:56:15.922833055 -0500 +@@ -429,6 +429,7 @@ class ExceptionTests(unittest.TestCase): self.assertIsNone(e.__context__) self.assertIsNone(e.__cause__) @@ -9,10 +9,10 @@ diff -up Python-3.3.0b1/Lib/test/test_exceptions.py.846849 Python-3.3.0b1/Lib/te def testChainingDescriptors(self): try: raise Exception() -diff -up Python-3.3.0b1/Lib/test/test_io.py.846849 Python-3.3.0b1/Lib/test/test_io.py ---- Python-3.3.0b1/Lib/test/test_io.py.846849 2012-06-26 22:19:48.000000000 +0200 -+++ Python-3.3.0b1/Lib/test/test_io.py 2012-08-13 17:41:28.846403451 +0200 -@@ -2938,12 +2938,15 @@ class SignalsTest(unittest.TestCase): +diff -up Python-3.4.2/Lib/test/test_io.py.ppc Python-3.4.2/Lib/test/test_io.py +--- Python-3.4.2/Lib/test/test_io.py.ppc 2015-01-12 05:56:15.922833055 -0500 ++++ Python-3.4.2/Lib/test/test_io.py 2015-01-12 05:58:23.482833055 -0500 +@@ -3296,12 +3296,15 @@ class SignalsTest(unittest.TestCase): if e.errno != errno.EBADF: raise @@ -25,12 +25,12 @@ diff -up Python-3.3.0b1/Lib/test/test_io.py.846849 Python-3.3.0b1/Lib/test/test_ self.check_interrupted_write(b"xy", b"xy", mode="wb") + @unittest.skip('rhbz#846849') + # Issue #22331: The test hangs on FreeBSD 7.2 + @support.requires_freebsd_version(8) def test_interrupted_write_text(self): - self.check_interrupted_write("xy", b"xy", mode="w", encoding="ascii") - -diff -up Python-3.3.0b1/Lib/test/test_raise.py.846849 Python-3.3.0b1/Lib/test/test_raise.py ---- Python-3.3.0b1/Lib/test/test_raise.py.846849 2012-08-13 17:42:16.719714213 +0200 -+++ Python-3.3.0b1/Lib/test/test_raise.py 2012-08-13 17:43:02.544097272 +0200 +diff -up Python-3.4.2/Lib/test/test_raise.py.ppc Python-3.4.2/Lib/test/test_raise.py +--- Python-3.4.2/Lib/test/test_raise.py.ppc 2014-10-08 04:18:14.000000000 -0400 ++++ Python-3.4.2/Lib/test/test_raise.py 2015-01-12 05:56:15.922833055 -0500 @@ -151,6 +151,7 @@ class TestRaise(unittest.TestCase): class TestCause(unittest.TestCase): @@ -39,10 +39,10 @@ diff -up Python-3.3.0b1/Lib/test/test_raise.py.846849 Python-3.3.0b1/Lib/test/te def testCauseSyntax(self): try: try: -diff -up Python-3.3.0b1/Lib/test/test_traceback.py.846849 Python-3.3.0b1/Lib/test/test_traceback.py ---- Python-3.3.0b1/Lib/test/test_traceback.py.846849 2012-08-13 17:44:19.714374275 +0200 -+++ Python-3.3.0b1/Lib/test/test_traceback.py 2012-08-13 17:44:43.515534435 +0200 -@@ -246,6 +246,7 @@ class BaseExceptionReportingTests: +diff -up Python-3.4.2/Lib/test/test_traceback.py.ppc Python-3.4.2/Lib/test/test_traceback.py +--- Python-3.4.2/Lib/test/test_traceback.py.ppc 2014-10-08 04:18:14.000000000 -0400 ++++ Python-3.4.2/Lib/test/test_traceback.py 2015-01-12 05:56:15.922833055 -0500 +@@ -314,6 +314,7 @@ class BaseExceptionReportingTests: self.check_zero_div(blocks[0]) self.assertIn('inner_raise() # Marker', blocks[2]) diff --git a/python3.spec b/python3.spec index cbe48d0..8857301 100644 --- a/python3.spec +++ b/python3.spec @@ -71,7 +71,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 @@ -140,7 +140,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 3%{?dist} +Release: 4%{?dist} License: Python Group: Development/Languages @@ -1457,7 +1457,7 @@ CheckPython() { %ifarch ppc64le aarch64 -x test_faulthandler \ %endif - %ifarch %{power64} + %ifarch %{power64} s390 s390x -x test_gdb %endif @@ -1890,6 +1890,10 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon Jan 12 2015 Dan Horák - 3.4.2-4 +- build with valgrind on ppc64le +- disable test_gdb on s390(x) until rhbz#1181034 is resolved + * Tue Dec 16 2014 Robert Kuska - 3.4.2-3 - New patches: 170 (gc asserts), 200 (gettext headers), 201 (gdbm memory leak) From 11842a3a5a027ca9c646810e0d36376c952e84ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 17 Feb 2015 21:45:32 +0200 Subject: [PATCH 208/416] Own systemtap dirs (#710733) --- python3.spec | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 8857301..8336069 100644 --- a/python3.spec +++ b/python3.spec @@ -140,7 +140,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 4%{?dist} +Release: 5%{?dist} License: Python Group: Development/Languages @@ -1709,6 +1709,8 @@ rm -fr %{buildroot} %{_libdir}/%{py_INSTSONAME_optimized} %{_libdir}/libpython3.so %if 0%{?with_systemtap} +%dir %(dirname %{tapsetdir}) +%dir %{tapsetdir} %{tapsetdir}/%{libpython_stp_optimized} %doc systemtap-example.stp pyfuntop.stp %endif @@ -1846,6 +1848,8 @@ rm -fr %{buildroot} %{_libdir}/%{py_INSTSONAME_debug} %if 0%{?with_systemtap} +%dir %(dirname %{tapsetdir}) +%dir %{tapsetdir} %{tapsetdir}/%{libpython_stp_debug} %endif @@ -1890,6 +1894,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Tue Feb 17 2015 Ville Skyttä - 3.4.2-5 +- Own systemtap dirs (#710733) + * Mon Jan 12 2015 Dan Horák - 3.4.2-4 - build with valgrind on ppc64le - disable test_gdb on s390(x) until rhbz#1181034 is resolved From 9d940a7ac525550ce8509c900730fb12bcde5283 Mon Sep 17 00:00:00 2001 From: Till Maas Date: Sat, 21 Feb 2015 22:29:06 +0100 Subject: [PATCH 209/416] Rebuilt for Fedora 23 Change https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code --- python3.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 8336069..fef1746 100644 --- a/python3.spec +++ b/python3.spec @@ -140,7 +140,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 5%{?dist} +Release: 6%{?dist} License: Python Group: Development/Languages @@ -1894,6 +1894,10 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Sat Feb 21 2015 Till Maas - 3.4.2-6 +- Rebuilt for Fedora 23 Change + https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code + * Tue Feb 17 2015 Ville Skyttä - 3.4.2-5 - Own systemtap dirs (#710733) From aca03e4c3a4fd6bfe760a0d3b9b8c277884b800c Mon Sep 17 00:00:00 2001 From: Matej Stuchlik Date: Wed, 25 Feb 2015 13:26:34 +0100 Subject: [PATCH 210/416] Fixed undefined behaviour in faulthandler --- ...-undefined-behaviour-in-faulthandler.patch | 41 +++++++++++++++++++ python3.spec | 9 +++- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 00202-fix-undefined-behaviour-in-faulthandler.patch diff --git a/00202-fix-undefined-behaviour-in-faulthandler.patch b/00202-fix-undefined-behaviour-in-faulthandler.patch new file mode 100644 index 0000000..b333e15 --- /dev/null +++ b/00202-fix-undefined-behaviour-in-faulthandler.patch @@ -0,0 +1,41 @@ + +# HG changeset patch +# User Victor Stinner +# Date 1423661015 -3600 +# Node ID 689092296ad31951f8f919fc06b49450e648e93d +# Parent 645f3d750be139ce0198e15e221da07b22289a92 +Issue #23433: Fix faulthandler._stack_overflow() + +Fix undefined behaviour: don't compare pointers. Use Py_uintptr_t type instead +of void*. It fixes test_faulthandler on Fedora 22 which now uses GCC 5. + +diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c +--- a/Modules/faulthandler.c ++++ b/Modules/faulthandler.c +@@ -911,12 +911,12 @@ faulthandler_fatal_error_py(PyObject *se + } + + #if defined(HAVE_SIGALTSTACK) && defined(HAVE_SIGACTION) +-static void* +-stack_overflow(void *min_sp, void *max_sp, size_t *depth) ++static Py_uintptr_t ++stack_overflow(Py_uintptr_t min_sp, Py_uintptr_t max_sp, size_t *depth) + { + /* allocate 4096 bytes on the stack at each call */ + unsigned char buffer[4096]; +- void *sp = &buffer; ++ Py_uintptr_t sp = (Py_uintptr_t)&buffer; + *depth += 1; + if (sp < min_sp || max_sp < sp) + return sp; +@@ -929,7 +929,8 @@ static PyObject * + faulthandler_stack_overflow(PyObject *self) + { + size_t depth, size; +- char *sp = (char *)&depth, *stop; ++ Py_uintptr_t sp = (Py_uintptr_t)&depth; ++ Py_uintptr_t stop; + + depth = 0; + stop = stack_overflow(sp - STACK_OVERFLOW_MAX_SIZE, + diff --git a/python3.spec b/python3.spec index fef1746..12167d8 100644 --- a/python3.spec +++ b/python3.spec @@ -140,7 +140,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 6%{?dist} +Release: 7%{?dist} License: Python Group: Development/Languages @@ -722,6 +722,8 @@ Patch200: 00200-gettext-plural-fix.patch # Note: Backported from scl Patch201: 00201-fix-memory-leak-in-gdbm.patch +Patch202: 00202-fix-undefined-behaviour-in-faulthandler.patch + # (New patches go here ^^^) # @@ -1002,6 +1004,7 @@ done %patch196 -p1 # 00197: upstream as of Python 3.4.2 %patch199 -p1 +%patch202 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1894,6 +1897,10 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Wed Feb 25 2015 Matej Stuchlik - 3.4.2-7 +- Fixed undefined behaviour in faulthandler which caused test to hang on x86_64 + (http://bugs.python.org/issue23433) + * Sat Feb 21 2015 Till Maas - 3.4.2-6 - Rebuilt for Fedora 23 Change https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code From 318f360969a625371c3aa2239bf61bc2601f5e8a Mon Sep 17 00:00:00 2001 From: Matej Stuchlik Date: Wed, 25 Mar 2015 14:35:47 +0100 Subject: [PATCH 211/416] Update to 4.3.4 --- ...istutils-tests-that-fail-in-rpmbuild.patch | 2 +- ...lter-tests-to-reflect-sslv3-disabled.patch | 49 +++++++++--------- 00203-disable-threading-test-koji.patch | 11 ++++ ...s.pybytecompile => macros.pybytecompile3.4 | 0 macros.python3 => macros.python3.4 | 0 python3.spec | 51 ++++++++++++------- ...arily-disable-tests-requiring-SIGHUP.patch | 2 +- 7 files changed, 71 insertions(+), 44 deletions(-) create mode 100644 00203-disable-threading-test-koji.patch rename macros.pybytecompile => macros.pybytecompile3.4 (100%) rename macros.python3 => macros.python3.4 (100%) diff --git a/00137-skip-distutils-tests-that-fail-in-rpmbuild.patch b/00137-skip-distutils-tests-that-fail-in-rpmbuild.patch index 8a6bc46..0457093 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-3.2.2/Lib/distutils/tests/test_bdist_rpm.py.skip-distutils-tests +@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-3.2.2/Lib/distutils/tests/test_build_ext.py.skip-distutils-tests-that-fail-in-rpmbuild Python-3.2.2/Lib/distutils/tests/test_build_ext.py diff --git a/00199-alter-tests-to-reflect-sslv3-disabled.patch b/00199-alter-tests-to-reflect-sslv3-disabled.patch index f35eff9..c7fb9ff 100644 --- a/00199-alter-tests-to-reflect-sslv3-disabled.patch +++ b/00199-alter-tests-to-reflect-sslv3-disabled.patch @@ -13,31 +13,6 @@ diff -up Python-3.4.2/Lib/test/test_ssl.py.ssl Python-3.4.2/Lib/test/test_ssl.py self.assertEqual(ssl.OP_ALL | ssl.OP_NO_SSLv2 | ssl.OP_NO_SSLv3, ctx.options) if can_clear_options(): -@@ -2149,21 +2146,18 @@ else: - 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_SSLv3, False) - try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv23, True) - try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1, True) - -- try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3, True, 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, True, ssl.CERT_OPTIONAL) - -- try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3, True, 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, 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) @@ -2186,7 +2180,7 @@ else: try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_TLSv1, False) if no_sslv2_implies_sslv3_hello(): @@ -47,3 +22,27 @@ diff -up Python-3.4.2/Lib/test/test_ssl.py.ssl Python-3.4.2/Lib/test/test_ssl.py client_options=ssl.OP_NO_SSLv2) @skip_if_broken_ubuntu_ssl +diff -up Python-3.4.3/Lib/test/test_ssl.py.foo Python-3.4.3/Lib/test/test_ssl.py +--- Python-3.4.3/Lib/test/test_ssl.py.foo 2015-03-12 10:08:58.268065970 +0100 ++++ Python-3.4.3/Lib/test/test_ssl.py 2015-03-12 10:10:09.733347118 +0100 +@@ -2168,17 +2168,17 @@ 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, True) ++ 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, True) + + if hasattr(ssl, 'PROTOCOL_SSLv3'): +- try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3, True, 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, True, ssl.CERT_OPTIONAL) + + if hasattr(ssl, 'PROTOCOL_SSLv3'): +- try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3, True, 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, True, ssl.CERT_REQUIRED) + diff --git a/00203-disable-threading-test-koji.patch b/00203-disable-threading-test-koji.patch new file mode 100644 index 0000000..70010fb --- /dev/null +++ b/00203-disable-threading-test-koji.patch @@ -0,0 +1,11 @@ +diff -up Python-3.4.3/Lib/test/test_threading.py.mstuchli Python-3.4.3/Lib/test/test_threading.py +--- Python-3.4.3/Lib/test/test_threading.py.mstuchli 2015-03-10 10:00:42.917355215 +0100 ++++ Python-3.4.3/Lib/test/test_threading.py 2015-03-10 10:00:47.735373842 +0100 +@@ -988,6 +988,7 @@ class ThreadingExceptionTests(BaseTestCa + self.assertIn("ZeroDivisionError", err) + self.assertNotIn("Unhandled exception", err) + ++ @unittest.skip('Fails in Koji due to mishandled signals') + def test_print_exception_stderr_is_none_1(self): + script = r"""if True: + import sys diff --git a/macros.pybytecompile b/macros.pybytecompile3.4 similarity index 100% rename from macros.pybytecompile rename to macros.pybytecompile3.4 diff --git a/macros.python3 b/macros.python3.4 similarity index 100% rename from macros.python3 rename to macros.python3.4 diff --git a/python3.spec b/python3.spec index 12167d8..aff858c 100644 --- a/python3.spec +++ b/python3.spec @@ -139,8 +139,8 @@ # ================== Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 -Version: %{pybasever}.2 -Release: 7%{?dist} +Version: %{pybasever}.3 +Release: 1%{?dist} License: Python Group: Development/Languages @@ -218,12 +218,12 @@ Source1: find-provides-without-python-sonames.sh # Supply various useful macros for building python 3 modules: # __python3, python3_sitelib, python3_sitearch -Source2: macros.python3 +Source2: macros.python%{pybasever} # Supply an RPM macro "py_byte_compile" for the python3-devel subpackage # to enable specfiles to selectively byte-compile individual files and paths # with different Python runtimes as necessary: -Source3: macros.pybytecompile +Source3: macros.pybytecompile%{pybasever} # Systemtap tapset to make it easier to use the systemtap static probes # (actually a template; LIBRARY_PATH will get fixed up during install) @@ -445,7 +445,8 @@ Patch150: 00150-disable-rAssertAlmostEqual-cmath-on-ppc.patch # 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 +# Upstream as of 3.4.3 +# Patch153: 00153-fix-test_gdb-noise.patch # 00154 # # python3.spec on f15 has: @@ -461,8 +462,8 @@ 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 +# Upsream as of 3.4.3 +# Patch156: 00156-gdb-autoload-safepath.patch # 00157 # # Update uid/gid handling throughout the standard library: uid_t and gid_t are @@ -722,8 +723,14 @@ Patch200: 00200-gettext-plural-fix.patch # Note: Backported from scl Patch201: 00201-fix-memory-leak-in-gdbm.patch +# 00202 # +# Fixes undefined behaviour in faulthandler which caused test to hang on x86_64 +# http://bugs.python.org/issue23433 Patch202: 00202-fix-undefined-behaviour-in-faulthandler.patch +# test_threading fails in koji dues to it's handling of signals +Patch203: 00203-disable-threading-test-koji.patch + # (New patches go here ^^^) # @@ -954,10 +961,10 @@ done %endif # 00151: not for python3 # 00152: upstream as of Python 3.3.0b2 -%patch153 -p0 +# 00153: upstream as of Python 3.4.3 # 00154: not for this branch %patch155 -p1 -%patch156 -p1 +# 00156: upstream as of 3.4.3 %patch157 -p1 #00158: FIXME #00159: FIXME @@ -1005,6 +1012,7 @@ done # 00197: upstream as of Python 3.4.2 %patch199 -p1 %patch202 -p1 +%patch203 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1067,6 +1075,7 @@ BuildPython() { SymlinkName=$3 ExtraConfigArgs=$4 PathFixWithThisBinary=$5 + MoreCFlags=$6 ConfDir=build/$ConfName @@ -1104,8 +1113,7 @@ BuildPython() { # missing symbol AnnotateRWLockDestroy # # Invoke the build: - # TODO: it seems that 3.4.0a4 fails with %{?_smp_flags}, have to figure out why - make EXTRA_CFLAGS="$CFLAGS" + make EXTRA_CFLAGS="$CFLAGS $MoreCFlags" %{?_smp_mflags} popd echo FINISHED: BUILD OF PYTHON FOR CONFIGURATION: $ConfDir @@ -1122,7 +1130,8 @@ BuildPython debug \ %else "--with-pydebug --with-count-allocs --with-call-profile --without-ensurepip" \ %endif - false + false \ + -O1 %endif # with_debug_build BuildPython optimized \ @@ -1144,6 +1153,7 @@ InstallPython() { ConfName=$1 PyInstSoName=$2 + MoreCFlags=$3 ConfDir=build/$ConfName @@ -1152,7 +1162,7 @@ InstallPython() { pushd $ConfDir -make install DESTDIR=%{buildroot} INSTALL="install -p" +make install DESTDIR=%{buildroot} INSTALL="install -p" EXTRA_CFLAGS="$MoreCFlags" popd @@ -1195,7 +1205,8 @@ make install DESTDIR=%{buildroot} INSTALL="install -p" # Install the "debug" build first, so that we can move some files aside %if 0%{?with_debug_build} InstallPython debug \ - %{py_INSTSONAME_debug} + %{py_INSTSONAME_debug} \ + -O1 %endif # with_debug_build # Now the optimized build: @@ -1457,10 +1468,11 @@ CheckPython() { WITHIN_PYTHON_RPM_BUILD= \ LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \ --verbose --findleaks \ + -x test_distutils \ %ifarch ppc64le aarch64 -x test_faulthandler \ %endif - %ifarch %{power64} s390 s390x + %ifarch %{power64} s390 s390x armv7hl -x test_gdb %endif @@ -1733,8 +1745,8 @@ rm -fr %{buildroot} %{_libdir}/pkgconfig/python-%{LDVERSION_optimized}.pc %{_libdir}/pkgconfig/python-%{pybasever}.pc %{_libdir}/pkgconfig/python3.pc -%{_rpmconfigdir}/macros.d/macros.python3 -%{_rpmconfigdir}/macros.d/macros.pybytecompile +%{_rpmconfigdir}/macros.d/macros.python%{pybasever} +%{_rpmconfigdir}/macros.d/macros.pybytecompile%{pybasever} %files tools %defattr(-,root,root,755) @@ -1897,6 +1909,11 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Thu Mar 12 2015 Matej Stuchlik - 3.4.3-1 +- Updated to 3.4.3 +- BuildPython now accepts additional build options +- Temporarily disabled test_gdb on arm (rhbz#1196181) + * Wed Feb 25 2015 Matej Stuchlik - 3.4.2-7 - Fixed undefined behaviour in faulthandler which caused test to hang on x86_64 (http://bugs.python.org/issue23433) diff --git a/temporarily-disable-tests-requiring-SIGHUP.patch b/temporarily-disable-tests-requiring-SIGHUP.patch index 2e88678..30ceb94 100644 --- a/temporarily-disable-tests-requiring-SIGHUP.patch +++ b/temporarily-disable-tests-requiring-SIGHUP.patch @@ -2,8 +2,8 @@ diff -up Python-3.4.0/Lib/test/test_asyncio/test_events.py.orig Python-3.4.0/Lib --- Python-3.4.0/Lib/test/test_asyncio/test_events.py.orig 2014-04-15 13:18:49.696215288 +0200 +++ Python-3.4.0/Lib/test/test_asyncio/test_events.py 2014-04-15 13:18:56.104258453 +0200 @@ -1528,7 +1528,7 @@ class SubprocessTestsMixin: - self.loop.run_until_complete(proto.completed) self.check_terminated(proto.returncode) + transp.close() - @unittest.skipIf(sys.platform == 'win32', "Don't have SIGHUP") + @unittest.skipIf(True, "Temporarily skipped (rhbz#1088233)") From e0a5a56c7c3994adc66b92d3913ce9235e482096 Mon Sep 17 00:00:00 2001 From: Matej Stuchlik Date: Mon, 13 Apr 2015 09:43:17 +0200 Subject: [PATCH 212/416] Add new sources for 3.4.3 --- sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources b/sources index 849668a..9900d70 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -36fc7327c02c6f12fa24fc9ba78039e3 Python-3.4.2.tar.xz +7d092d1bba6e17f0d9bd21b49e441dd5 Python-3.4.3.tar.xz From 3b7dcebf399c67228916767bb92e75dd2613baa8 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Mon, 4 May 2015 20:35:50 +0100 Subject: [PATCH 213/416] Disable test_gdb on aarch64 (rhbz#1196181), it joins all other non x86 arches --- python3.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python3.spec b/python3.spec index aff858c..01bba67 100644 --- a/python3.spec +++ b/python3.spec @@ -140,7 +140,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.3 -Release: 1%{?dist} +Release: 2%{?dist} License: Python Group: Development/Languages @@ -1472,7 +1472,7 @@ CheckPython() { %ifarch ppc64le aarch64 -x test_faulthandler \ %endif - %ifarch %{power64} s390 s390x armv7hl + %ifarch %{power64} s390 s390x armv7hl aarch64 -x test_gdb %endif @@ -1909,6 +1909,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon May 4 2015 Peter Robinson 3.4.3-2 +- Disable test_gdb on aarch64 (rhbz#1196181), it joins all other non x86 arches + * Thu Mar 12 2015 Matej Stuchlik - 3.4.3-1 - Updated to 3.4.3 - BuildPython now accepts additional build options From 6f1b657649526cba3a267f03bf973c1807719002 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Thu, 18 Jun 2015 21:30:10 +0000 Subject: [PATCH 214/416] - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild --- python3.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 01bba67..7c6b68b 100644 --- a/python3.spec +++ b/python3.spec @@ -140,7 +140,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.3 -Release: 2%{?dist} +Release: 3%{?dist} License: Python Group: Development/Languages @@ -1909,6 +1909,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Thu Jun 18 2015 Fedora Release Engineering - 3.4.3-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + * Mon May 4 2015 Peter Robinson 3.4.3-2 - Disable test_gdb on aarch64 (rhbz#1196181), it joins all other non x86 arches From 2699e3706a785759a6abda5d19c727f0b1ced3d9 Mon Sep 17 00:00:00 2001 From: Matej Stuchlik Date: Fri, 19 Jun 2015 11:56:26 +0200 Subject: [PATCH 215/416] Make relocating Python by changing _prefix work --- python3.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 7c6b68b..fcd3d15 100644 --- a/python3.spec +++ b/python3.spec @@ -1236,7 +1236,7 @@ cp -ar Tools/demo %{buildroot}%{pylibdir}/Tools/ rm -f %{buildroot}%{pylibdir}/email/test/data/audiotest.au %{buildroot}%{pylibdir}/test/audiotest.au %if "%{_lib}" == "lib64" -install -d -m 0755 %{buildroot}/usr/lib/python%{pybasever}/site-packages/__pycache__ +install -d -m 0755 %{buildroot}/%{_prefix}/lib/python%{pybasever}/site-packages/__pycache__ %endif # Make python3-devel multilib-ready (bug #192747, #139911) @@ -1912,6 +1912,10 @@ rm -fr %{buildroot} * Thu Jun 18 2015 Fedora Release Engineering - 3.4.3-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild +* Wed Jun 17 2015 Matej Stuchlik - 3.4.3-3 +- Make relocating Python by changing _prefix actually work +Resolves: rhbz#1231801 + * Mon May 4 2015 Peter Robinson 3.4.3-2 - Disable test_gdb on aarch64 (rhbz#1196181), it joins all other non x86 arches From 8f7e21547a06389b6bf34bdc897e1423a80f2c4c Mon Sep 17 00:00:00 2001 From: Matej Stuchlik Date: Fri, 19 Jun 2015 11:58:26 +0200 Subject: [PATCH 216/416] Increase testsuite's DH key size --- 00204-increase-dh-keys-size.patch | 49 +++++++++++++++++++++++++++++++ python3.spec | 20 +++++++++++-- 2 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 00204-increase-dh-keys-size.patch diff --git a/00204-increase-dh-keys-size.patch b/00204-increase-dh-keys-size.patch new file mode 100644 index 0000000..e75d992 --- /dev/null +++ b/00204-increase-dh-keys-size.patch @@ -0,0 +1,49 @@ + +# HG changeset patch +# User Benjamin Peterson +# Date 1427947446 14400 +# Node ID 1ad7c0253abe1252128d61c3d0127d22144cb354 +# Parent 47451f6e7e7528a6647dbdc435e9a9f5c13c0080 +replace 512 bit dh key with a 2014 bit one (closes #23844) + +Patch by Cédric Krier. + +diff --git a/Lib/test/dh1024.pem b/Lib/test/dh1024.pem +new file mode 100644 +--- /dev/null ++++ b/Lib/test/dh1024.pem +@@ -0,0 +1,7 @@ ++-----BEGIN DH PARAMETERS----- ++MIGHAoGBAIbzw1s9CT8SV5yv6L7esdAdZYZjPi3qWFs61CYTFFQnf2s/d09NYaJt ++rrvJhIzWavqnue71qXCf83/J3nz3FEwUU/L0mGyheVbsSHiI64wUo3u50wK5Igo0 ++RNs/LD0irs7m0icZ//hijafTU+JOBiuA8zMI+oZfU7BGuc9XrUprAgEC ++-----END DH PARAMETERS----- ++ ++Generated with: openssl dhparam -out dh1024.pem 1024 +diff --git a/Lib/test/dh512.pem b/Lib/test/dh512.pem +deleted file mode 100644 +--- a/Lib/test/dh512.pem ++++ /dev/null +@@ -1,9 +0,0 @@ +------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/test_ssl.py b/Lib/test/test_ssl.py +--- a/Lib/test/test_ssl.py ++++ b/Lib/test/test_ssl.py +@@ -64,7 +64,7 @@ BADKEY = data_file("badkey.pem") + NOKIACERT = data_file("nokia.pem") + NULLBYTECERT = data_file("nullbytecert.pem") + +-DHFILE = data_file("dh512.pem") ++DHFILE = data_file("dh1024.pem") + BYTES_DHFILE = os.fsencode(DHFILE) + + + diff --git a/python3.spec b/python3.spec index fcd3d15..6f243c3 100644 --- a/python3.spec +++ b/python3.spec @@ -140,7 +140,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.3 -Release: 3%{?dist} +Release: 4%{?dist} License: Python Group: Development/Languages @@ -731,6 +731,9 @@ Patch202: 00202-fix-undefined-behaviour-in-faulthandler.patch # test_threading fails in koji dues to it's handling of signals Patch203: 00203-disable-threading-test-koji.patch +# openssl requires DH keys to be > 768bits +Patch204: 00204-increase-dh-keys-size.patch + # (New patches go here ^^^) # @@ -909,6 +912,11 @@ for f in md5module.c sha1module.c sha256module.c sha512module.c; do rm Modules/$f done +%if 0%{with_rewheel} +%global pip_version 7.0.3 +sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/ensurepip/__init__.py +%endif + # # Apply patches: # @@ -1013,6 +1021,7 @@ done %patch199 -p1 %patch202 -p1 %patch203 -p1 +%patch204 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1131,7 +1140,7 @@ BuildPython debug \ "--with-pydebug --with-count-allocs --with-call-profile --without-ensurepip" \ %endif false \ - -O1 + -O0 %endif # with_debug_build BuildPython optimized \ @@ -1206,7 +1215,7 @@ make install DESTDIR=%{buildroot} INSTALL="install -p" EXTRA_CFLAGS="$MoreCFlags %if 0%{?with_debug_build} InstallPython debug \ %{py_INSTSONAME_debug} \ - -O1 + -O0 %endif # with_debug_build # Now the optimized build: @@ -1912,6 +1921,11 @@ rm -fr %{buildroot} * Thu Jun 18 2015 Fedora Release Engineering - 3.4.3-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild +* Wed Jun 17 2015 Matej Stuchlik - 3.4.3-4 +- Use 1024bit DH key in test_ssl +- Use -O0 when compiling -debug build +- Update pip version variable to the version we actually ship + * Wed Jun 17 2015 Matej Stuchlik - 3.4.3-3 - Make relocating Python by changing _prefix actually work Resolves: rhbz#1231801 From 8d338b77849f269e5605dc22a12e93c799a136f9 Mon Sep 17 00:00:00 2001 From: Thomas Spura Date: Mon, 29 Jun 2015 13:34:22 +0200 Subject: [PATCH 217/416] python3-devel: Require python-macros This picks up version independant macros such as python_provide. See fpc#281 and fpc#534 for more details. --- macros.python3.4 | 10 ++++++++++ python3.spec | 10 ++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/macros.python3.4 b/macros.python3.4 index 395af00..a633c72 100644 --- a/macros.python3.4 +++ b/macros.python3.4 @@ -4,3 +4,13 @@ %python3_version %(%{__python3} -c "import sys; sys.stdout.write(sys.version[:3])") %python3_version_nodots %(%{__python3} -c "import sys; sys.stdout.write(sys.version[:3].replace('.',''))") %py3dir %{_builddir}/python3-%{name}-%{version}-%{release} + +%py3_shbang_opts -s + +%py3_build() %{expand:\ +CFLAGS="%{optflags}" %{__python3} %{py_setup} %{?py_setup_args} build --executable="%{__python3} %{py3_shbang_opts}" %{?1}\ +} + +%py3_install() %{expand:\ +CFLAGS="%{optflags}" %{__python3} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?1}\ +} diff --git a/python3.spec b/python3.spec index 6f243c3..efa0cda 100644 --- a/python3.spec +++ b/python3.spec @@ -140,7 +140,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.3 -Release: 4%{?dist} +Release: 5%{?dist} License: Python Group: Development/Languages @@ -803,10 +803,12 @@ Summary: Libraries and header files needed for Python 3 development Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: %{name}-libs%{?_isa} = %{version}-%{release} +BuildRequires: python-macros +Requires: python-macros Conflicts: %{name} < %{version}-%{release} %description devel -This package contains libraries and header files used to build applications +This package contains libraries and header files used to build applications with and native libraries for Python 3 %package tools @@ -1918,6 +1920,10 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon Jun 29 2015 Thomas Spura - 3.4.3-4 +- python3-devel: Require python-macros for version independant macros such as + python_provide. See fpc#281 and fpc#534. + * Thu Jun 18 2015 Fedora Release Engineering - 3.4.3-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild From 8c7d263caba25ce45fd826cee539aade0d5f67db Mon Sep 17 00:00:00 2001 From: Matej Stuchlik Date: Wed, 12 Aug 2015 14:21:34 +0200 Subject: [PATCH 218/416] Bump pip version --- python3.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index efa0cda..6270e66 100644 --- a/python3.spec +++ b/python3.spec @@ -915,7 +915,7 @@ for f in md5module.c sha1module.c sha256module.c sha512module.c; do done %if 0%{with_rewheel} -%global pip_version 7.0.3 +%global pip_version 7.1.0 sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/ensurepip/__init__.py %endif From abb2ff8b0538a27f07bc0edebdee9c20502d4e31 Mon Sep 17 00:00:00 2001 From: Matej Stuchlik Date: Wed, 16 Sep 2015 08:36:17 +0200 Subject: [PATCH 219/416] First step towards 3.5.0 --- 00055-systemtap.patch | 19 +------ 00102-lib64.patch | 29 ++++------ 00111-no-static-lib.patch | 20 +++---- 00125-less-verbose-COUNT_ALLOCS.patch | 19 ++++--- 00132-add-rpmbuild-hooks-to-unittest.patch | 5 +- ...fix-COUNT_ALLOCS-failure-in-test_sys.patch | 4 +- 00141-fix-tests_with_COUNT_ALLOCS.patch | 4 +- ...lter-tests-to-reflect-sslv3-disabled.patch | 14 ++--- check-pyc-and-pyo-timestamps.py | 9 +++ python3.spec | 56 +++++++++++-------- 10 files changed, 88 insertions(+), 91 deletions(-) diff --git a/00055-systemtap.patch b/00055-systemtap.patch index 3200c15..5d92895 100644 --- a/00055-systemtap.patch +++ b/00055-systemtap.patch @@ -650,7 +650,7 @@ diff -up Python-3.3.0rc2/Makefile.pre.in.systemtap Python-3.3.0rc2/Makefile.pre. +Python/ceval.o: $(OPCODETARGETS_H) $(srcdir)/Python/ceval_gil.h \ + $(srcdir)/Python/ceval_systemtap.h @SYSTEMTAPDEPS@ - Python/frozen.o: Python/importlib.h + Python/frozen.o: Python/importlib.h Python/importlib_external.h @@ -724,6 +726,13 @@ Objects/typeobject.o: $(srcdir)/Objects/ Objects/typeslots.inc: $(srcdir)/Include/typeslots.h $(srcdir)/Objects/typeslots.py @@ -669,26 +669,11 @@ diff -up Python-3.3.0rc2/Makefile.pre.in.systemtap Python-3.3.0rc2/Makefile.pre. @@ -1345,6 +1354,7 @@ clean: pycremoval -rm -f pybuilddir.txt -rm -f Lib/lib2to3/*Grammar*.pickle - -rm -f Modules/_testembed Modules/_freeze_importlib + -rm -f Programs/_testembed Programs/_freeze_importlib + -rm -f $(srcdir)/Python/pysystemtap.h profile-removal: find . -name '*.gc??' -exec rm -f {} ';' -diff -up Python-3.3.0rc2/Misc/NEWS.systemtap Python-3.3.0rc2/Misc/NEWS ---- Python-3.3.0rc2/Misc/NEWS.systemtap 2012-09-09 05:11:05.000000000 -0400 -+++ Python-3.3.0rc2/Misc/NEWS 2012-09-10 09:17:21.120511781 -0400 -@@ -619,6 +619,11 @@ Core and Builtins - - - Issue #15038: Optimize python Locks on Windows. - -+- Issue #14776: Added a new --with-systemtap configure-time option, which adds -+ static markers for SystemTap so that SystemTap scripts can observe bytecode -+ frames being entered and exited and so generate reports on what Python code -+ is being exectuted. -+ - Library - ------- - diff -up Python-3.3.0rc2/pyconfig.h.in.systemtap Python-3.3.0rc2/pyconfig.h.in --- Python-3.3.0rc2/pyconfig.h.in.systemtap 2012-09-09 05:11:14.000000000 -0400 +++ Python-3.3.0rc2/pyconfig.h.in 2012-09-10 09:17:21.120511781 -0400 diff --git a/00102-lib64.patch b/00102-lib64.patch index db5fd95..be67b9b 100644 --- a/00102-lib64.patch +++ b/00102-lib64.patch @@ -35,7 +35,7 @@ else: --- Python-3.4.0b1/Lib/site.py.lib64 2013-11-24 21:36:54.000000000 +0100 +++ Python-3.4.0b1/Lib/site.py 2013-11-27 11:10:43.822150773 +0100 -@@ -304,12 +304,16 @@ +@@ -304,11 +304,15 @@ seen.add(prefix) if os.sep == '/': @@ -45,7 +45,6 @@ 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")) @@ -84,25 +83,17 @@ 'data': '{userbase}', --- Python-3.4.0b1/Lib/test/test_site.py.lib64 2013-11-24 21:36:55.000000000 +0100 +++ Python-3.4.0b1/Lib/test/test_site.py 2013-11-27 11:10:43.822150773 +0100 -@@ -244,12 +244,15 @@ - self.assertEqual(dirs[2], wanted) +@@ -244,8 +244,8 @@ + self.assertEqual(dirs[1], wanted) elif os.sep == '/': # OS X non-framwework builds, Linux, FreeBSD, etc -- self.assertEqual(len(dirs), 2) +- self.assertEqual(len(dirs), 1) - wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3], -+ self.assertEqual(len(dirs), 3) ++ self.assertEqual(len(dirs), 2) + 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) --- Python-3.4.0b1/Makefile.pre.in.lib64 2013-11-27 11:10:43.814150786 +0100 +++ Python-3.4.0b1/Makefile.pre.in 2013-11-27 11:10:43.823150771 +0100 @@ -115,7 +115,7 @@ @@ -128,11 +119,11 @@ #ifndef LANDMARK @@ -498,7 +498,7 @@ - _pythonpath = _Py_char2wchar(PYTHONPATH, NULL); - _prefix = _Py_char2wchar(PREFIX, NULL); - _exec_prefix = _Py_char2wchar(EXEC_PREFIX, NULL); -- lib_python = _Py_char2wchar("lib/python" VERSION, NULL); -+ lib_python = _Py_char2wchar("lib64/python" VERSION, NULL); + _pythonpath = Py_DecodeLocale(PYTHONPATH, NULL); + _prefix = Py_DecodeLocale(PREFIX, NULL); + _exec_prefix = Py_DecodeLocale(EXEC_PREFIX, NULL); +- lib_python = Py_DecodeLocale("lib/python" VERSION, NULL); ++ lib_python = Py_DecodeLocale("lib64/python" VERSION, NULL); if (!_pythonpath || !_prefix || !_exec_prefix || !lib_python) { Py_FatalError( diff --git a/00111-no-static-lib.patch b/00111-no-static-lib.patch index bd1bc40..d55ac0a 100644 --- a/00111-no-static-lib.patch +++ b/00111-no-static-lib.patch @@ -1,13 +1,13 @@ diff -up cpython-59223da36dec/Makefile.pre.in.no-static-lib cpython-59223da36dec/Makefile.pre.in --- cpython-59223da36dec/Makefile.pre.in.no-static-lib 2012-08-07 16:43:43.296466422 -0400 +++ cpython-59223da36dec/Makefile.pre.in 2012-08-07 16:44:13.299464371 -0400 -@@ -464,7 +464,7 @@ coverage: +@@ -550,7 +550,7 @@ clinic: $(BUILDPYTHON) $(RUNSHARED) $(PYTHON_FOR_BUILD) ./Tools/clinic/clinic.py --make # Build the interpreter --$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) -+$(BUILDPYTHON): Modules/python.o $(LDLIBRARY) $(PY3LIBRARY) - $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Modules/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) +-$(BUILDPYTHON): Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) ++$(BUILDPYTHON): Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) + $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) platform: $(BUILDPYTHON) pybuilddir.txt @@ -480,18 +480,6 @@ sharedmods: $(BUILDPYTHON) $(SYSCONFIGDA @@ -29,16 +29,16 @@ diff -up cpython-59223da36dec/Makefile.pre.in.no-static-lib cpython-59223da36dec libpython$(LDVERSION).so: $(LIBRARY_OBJS) if test $(INSTSONAME) != $(LDLIBRARY); then \ $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ -@@ -581,7 +569,7 @@ Modules/Setup: $(srcdir)/Modules/Setup.d +@@ -674,7 +674,7 @@ Modules/Setup: $(srcdir)/Modules/Setup.d echo "-----------------------------------------------"; \ fi --Modules/_testembed: Modules/_testembed.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) -+Modules/_testembed: Modules/_testembed.o $(LDLIBRARY) $(PY3LIBRARY) - $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Modules/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) +-Programs/_testembed: Programs/_testembed.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) ++Programs/_testembed: Programs/_testembed.o $(LDLIBRARY) $(PY3LIBRARY) + $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) ############################################################################ -@@ -1155,18 +1143,6 @@ libainstall: all python-config +@@ -1354,18 +1354,6 @@ libainstall: all python-config else true; \ fi; \ done @@ -55,5 +55,5 @@ diff -up cpython-59223da36dec/Makefile.pre.in.no-static-lib cpython-59223da36dec - fi; \ - fi $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c - $(INSTALL_DATA) Modules/python.o $(DESTDIR)$(LIBPL)/python.o + $(INSTALL_DATA) Programs/python.o $(DESTDIR)$(LIBPL)/python.o $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in diff --git a/00125-less-verbose-COUNT_ALLOCS.patch b/00125-less-verbose-COUNT_ALLOCS.patch index 8e441a2..fea9a4e 100644 --- a/00125-less-verbose-COUNT_ALLOCS.patch +++ b/00125-less-verbose-COUNT_ALLOCS.patch @@ -1,20 +1,21 @@ -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) +diff -up Python-3.5.0b3/Python/pylifecycle.c.ms Python-3.5.0b3/Python/pylifecycle.c +--- Python-3.5.0b3/Python/pylifecycle.c.ms 2015-07-08 10:12:40.470623896 +0200 ++++ Python-3.5.0b3/Python/pylifecycle.c 2015-07-08 10:13:50.141169162 +0200 +@@ -612,7 +612,16 @@ 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): ++ 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 /* dump hash stats */ _PyHash_Fini(); diff --git a/00132-add-rpmbuild-hooks-to-unittest.patch b/00132-add-rpmbuild-hooks-to-unittest.patch index 20930ac..041abce 100644 --- a/00132-add-rpmbuild-hooks-to-unittest.patch +++ b/00132-add-rpmbuild-hooks-to-unittest.patch @@ -9,10 +9,9 @@ diff -up Python-3.2.2/Lib/unittest/case.py.add-rpmbuild-hooks-to-unittest Python import logging import pprint import re -@@ -101,6 +102,43 @@ def expectedFailure(func): +@@ -101,5 +102,42 @@ def expectedFailure(func): raise self.test_case.failureException(msg) - +# Non-standard/downstream-only hooks for handling issues with specific test +# cases: + @@ -52,7 +51,7 @@ diff -up Python-3.2.2/Lib/unittest/case.py.add-rpmbuild-hooks-to-unittest Python + class _AssertRaisesBaseContext(_BaseTestCaseContext): - def __init__(self, expected, test_case, callable_obj=None, + def __init__(self, expected, test_case, expected_regex=None): diff -up Python-3.2.2/Lib/unittest/__init__.py.add-rpmbuild-hooks-to-unittest Python-3.2.2/Lib/unittest/__init__.py --- Python-3.2.2/Lib/unittest/__init__.py.add-rpmbuild-hooks-to-unittest 2011-09-03 12:16:44.000000000 -0400 +++ Python-3.2.2/Lib/unittest/__init__.py 2011-09-09 06:35:16.366568382 -0400 diff --git a/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch b/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch index afd8685..5fa9bd4 100644 --- a/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch +++ b/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch @@ -9,9 +9,9 @@ diff -up Python-3.3.0b2/Lib/test/test_sys.py.fix-COUNT_ALLOCS-failure-in-test_sy + if hasattr(sys, 'getcounts'): + s += struct.calcsize('3P2P') check(int, s) - # (PyTypeObject + PyNumberMethods + PyMappingMethods + + # (PyTypeObject + PyAsyncMethods + PyNumberMethods + PyMappingMethods + # PySequenceMethods + PyBufferProcs + 4P) - s = vsize('P2n15Pl4Pn9Pn11PIP') + struct.calcsize('34P 3P 10P 2P 4P') + s = vsize('P2n17Pl4Pn9Pn11PIP') + struct.calcsize('34P 3P 3P 10P 2P 4P') # Separate block for PyDictKeysObject with 4 entries s += struct.calcsize("2nPn") + 4*struct.calcsize("n2P") + if hasattr(sys, 'getcounts'): diff --git a/00141-fix-tests_with_COUNT_ALLOCS.patch b/00141-fix-tests_with_COUNT_ALLOCS.patch index 7193a8d..96a2fbf 100644 --- a/00141-fix-tests_with_COUNT_ALLOCS.patch +++ b/00141-fix-tests_with_COUNT_ALLOCS.patch @@ -100,8 +100,8 @@ diff -r e245b0d7209b Lib/test/test_module.py # Issue #20037 code = """if 1: ---- a/Lib/test/test_warnings.py.orig 2014-01-09 15:10:12.454997100 +0100 -+++ b/Lib/test/test_warnings.py 2014-01-09 15:11:14.028913478 +0100 +--- a/Lib/test/test_warnings/__init__.py.orig 2014-01-09 15:10:12.454997100 +0100 ++++ b/Lib/test/test_warnings/__init__.py 2014-01-09 15:11:14.028913478 +0100 @@ -780,6 +780,8 @@ assert_python_ok('-c', 'pass', '-W', 'always', PYTHONPATH=cwd) diff --git a/00199-alter-tests-to-reflect-sslv3-disabled.patch b/00199-alter-tests-to-reflect-sslv3-disabled.patch index c7fb9ff..68df8d5 100644 --- a/00199-alter-tests-to-reflect-sslv3-disabled.patch +++ b/00199-alter-tests-to-reflect-sslv3-disabled.patch @@ -17,7 +17,7 @@ diff -up Python-3.4.2/Lib/test/test_ssl.py.ssl Python-3.4.2/Lib/test/test_ssl.py 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, +- 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) @@ -29,20 +29,20 @@ diff -up Python-3.4.3/Lib/test/test_ssl.py.foo Python-3.4.3/Lib/test/test_ssl.py " 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, True) +- 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, 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, True, ssl.CERT_OPTIONAL) +- 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, 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, True, ssl.CERT_REQUIRED) +- 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, True, ssl.CERT_REQUIRED) + try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1, 'TLSv1', ssl.CERT_REQUIRED) diff --git a/check-pyc-and-pyo-timestamps.py b/check-pyc-and-pyo-timestamps.py index 5fd11cc..aab0cc1 100644 --- a/check-pyc-and-pyo-timestamps.py +++ b/check-pyc-and-pyo-timestamps.py @@ -17,6 +17,15 @@ not_compiled = [ 'test/badsyntax_future8.py', 'test/badsyntax_future9.py', 'test/badsyntax_future10.py', + 'test/badsyntax_async1.py', + 'test/badsyntax_async2.py', + 'test/badsyntax_async3.py', + 'test/badsyntax_async4.py', + 'test/badsyntax_async5.py', + 'test/badsyntax_async6.py', + 'test/badsyntax_async7.py', + 'test/badsyntax_async8.py', + 'test/badsyntax_async9.py', 'test/badsyntax_pep3120.py', 'lib2to3/tests/data/bom.py', 'lib2to3/tests/data/crlf.py', diff --git a/python3.spec b/python3.spec index 6270e66..13e17a8 100644 --- a/python3.spec +++ b/python3.spec @@ -14,12 +14,12 @@ # 4) python3-setuptools and python3-pip with with_rewheel set to 1 # 5) python3 with with_rewheel set to 1 -%global with_rewheel 1 +%global with_rewheel 0 -%global pybasever 3.4 +%global pybasever 3.5 # pybasever without the dot: -%global pyshortver 34 +%global pyshortver 35 %global pylibdir %{_libdir}/python%{pybasever} %global dynload_dir %{pylibdir}/lib-dynload @@ -39,8 +39,8 @@ %global LDVERSION_optimized %{pybasever}%{ABIFLAGS_optimized} %global LDVERSION_debug %{pybasever}%{ABIFLAGS_debug} -%global SOABI_optimized cpython-%{pyshortver}%{ABIFLAGS_optimized} -%global SOABI_debug cpython-%{pyshortver}%{ABIFLAGS_debug} +%global SOABI_optimized cpython-%{pyshortver}%{ABIFLAGS_optimized}-%{_arch}-linux-gnu +%global SOABI_debug cpython-%{pyshortver}%{ABIFLAGS_debug}-%{_arch}-linux-gnu # All bytecode files are now in a __pycache__ subdirectory, with a name # reflecting the version of the bytecode (to permit sharing of python libraries @@ -49,9 +49,9 @@ # For example, # foo/bar.py # now has bytecode at: -# foo/__pycache__/bar.cpython-34.pyc -# foo/__pycache__/bar.cpython-34.pyo -%global bytecode_suffixes .cpython-34.py? +# foo/__pycache__/bar.cpython-35.pyc +# foo/__pycache__/bar.cpython-35.pyo +%global bytecode_suffixes .cpython-35*.py? # Python's configure script defines SOVERSION, and this is used in the Makefile # to determine INSTSONAME, the name of the libpython DSO: @@ -83,7 +83,7 @@ %global with_computed_gotos yes # Turn this to 0 to turn off the "check" phase: -%global run_selftest_suite 1 +%global run_selftest_suite 0 # We want to byte-compile the .py files within the packages using the new # python3 binary. @@ -139,8 +139,8 @@ # ================== Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 -Version: %{pybasever}.3 -Release: 5%{?dist} +Version: %{pybasever}.0 +Release: 1%{?dist} License: Python Group: Development/Languages @@ -726,13 +726,17 @@ Patch201: 00201-fix-memory-leak-in-gdbm.patch # 00202 # # Fixes undefined behaviour in faulthandler which caused test to hang on x86_64 # http://bugs.python.org/issue23433 -Patch202: 00202-fix-undefined-behaviour-in-faulthandler.patch +# FIXED UPSTREAM +#Patch202: 00202-fix-undefined-behaviour-in-faulthandler.patch # test_threading fails in koji dues to it's handling of signals Patch203: 00203-disable-threading-test-koji.patch # openssl requires DH keys to be > 768bits -Patch204: 00204-increase-dh-keys-size.patch +# FIXED UPSTREAM +# Patch204: 00204-increase-dh-keys-size.patch + +Patch205: config-to-lib64.patch # (New patches go here ^^^) @@ -935,7 +939,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %endif -%patch111 -p1 +#%patch111 -p1 # 112: not for python3 %patch113 -p1 # 00114: Upstream as of Python 3.4.0.b2 @@ -1021,9 +1025,10 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch196 -p1 # 00197: upstream as of Python 3.4.2 %patch199 -p1 -%patch202 -p1 +# 00202: upstream as of 3.5.0b3 %patch203 -p1 -%patch204 -p1 +# 00204: upstream as of 3.5.0b3 +%patch205 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1267,8 +1272,8 @@ install -d -m 0755 %{buildroot}/%{_prefix}/lib/python%{pybasever}/site-packages/ %global LDVERSION_optimized %{pybasever}%{ABIFLAGS_optimized} %global LDVERSION_debug %{pybasever}%{ABIFLAGS_debug} -%global SOABI_optimized cpython-%{pyshortver}%{ABIFLAGS_optimized} -%global SOABI_debug cpython-%{pyshortver}%{ABIFLAGS_debug} +%global SOABI_optimized cpython-%{pyshortver}%{ABIFLAGS_optimized}-%{_arch}-linux-gnu +%global SOABI_debug cpython-%{pyshortver}%{ABIFLAGS_debug}-%{_arch}-linux-gnu %if 0%{?with_debug_build} %global PyIncludeDirs python%{LDVERSION_optimized} python%{LDVERSION_debug} @@ -1589,7 +1594,8 @@ rm -fr %{buildroot} %{dynload_dir}/spwd.%{SOABI_optimized}.so %{dynload_dir}/syslog.%{SOABI_optimized}.so %{dynload_dir}/termios.%{SOABI_optimized}.so -%{dynload_dir}/time.%{SOABI_optimized}.so +#%{dynload_dir}/time.%{SOABI_optimized}.so +%{dynload_dir}/_testmultiphase.%{SOABI_optimized}.so %{dynload_dir}/unicodedata.%{SOABI_optimized}.so %{dynload_dir}/xxlimited.%{SOABI_optimized}.so %{dynload_dir}/zlib.%{SOABI_optimized}.so @@ -1732,7 +1738,7 @@ rm -fr %{buildroot} %dir %{_includedir}/python%{LDVERSION_optimized}/ %{_includedir}/python%{LDVERSION_optimized}/%{_pyconfig_h} -%{_libdir}/%{py_INSTSONAME_optimized} +#%{_libdir}/%{py_INSTSONAME_optimized} %{_libdir}/libpython3.so %if 0%{?with_systemtap} %dir %(dirname %{tapsetdir}) @@ -1753,6 +1759,7 @@ rm -fr %{buildroot} %{_bindir}/python%{LDVERSION_optimized}-config %{_bindir}/python%{LDVERSION_optimized}-*-config %{_libdir}/libpython%{LDVERSION_optimized}.so +%{_libdir}/libpython%{LDVERSION_optimized}.so.1.0 %{_libdir}/pkgconfig/python-%{LDVERSION_optimized}.pc %{_libdir}/pkgconfig/python-%{pybasever}.pc %{_libdir}/pkgconfig/python3.pc @@ -1864,7 +1871,8 @@ rm -fr %{buildroot} %{dynload_dir}/spwd.%{SOABI_debug}.so %{dynload_dir}/syslog.%{SOABI_debug}.so %{dynload_dir}/termios.%{SOABI_debug}.so -%{dynload_dir}/time.%{SOABI_debug}.so +#%{dynload_dir}/time.%{SOABI_debug}.so +%{dynload_dir}/_testmultiphase.%{SOABI_debug}.so %{dynload_dir}/unicodedata.%{SOABI_debug}.so %{dynload_dir}/zlib.%{SOABI_debug}.so @@ -1872,7 +1880,7 @@ 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": -%{_libdir}/%{py_INSTSONAME_debug} +#%{_libdir}/%{py_INSTSONAME_debug} %if 0%{?with_systemtap} %dir %(dirname %{tapsetdir}) %dir %{tapsetdir} @@ -1884,6 +1892,7 @@ rm -fr %{buildroot} %{_includedir}/python%{LDVERSION_debug} %{_bindir}/python%{LDVERSION_debug}-config %{_libdir}/libpython%{LDVERSION_debug}.so +%{_libdir}/libpython%{LDVERSION_debug}.so.1.0 %{_libdir}/pkgconfig/python-%{LDVERSION_debug}.pc # Analog of the -tools subpackage's files: @@ -1920,6 +1929,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Tue Sep 15 2015 Matej Stuchlik - 3.5.0-1 +- Update to 3.5.0 + * Mon Jun 29 2015 Thomas Spura - 3.4.3-4 - python3-devel: Require python-macros for version independant macros such as python_provide. See fpc#281 and fpc#534. From 7035fe28761540699a1c363f3fe10af1423468f9 Mon Sep 17 00:00:00 2001 From: Robert Kuska Date: Mon, 21 Sep 2015 15:37:07 +0200 Subject: [PATCH 220/416] Remove forgotten $(LIBRARY) from Patch111 (and also enable it) --- 00111-no-static-lib.patch | 2 +- python3.spec | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/00111-no-static-lib.patch b/00111-no-static-lib.patch index d55ac0a..006bb90 100644 --- a/00111-no-static-lib.patch +++ b/00111-no-static-lib.patch @@ -6,7 +6,7 @@ diff -up cpython-59223da36dec/Makefile.pre.in.no-static-lib cpython-59223da36dec # Build the interpreter -$(BUILDPYTHON): Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) -+$(BUILDPYTHON): Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) ++$(BUILDPYTHON): Programs/python.o $(LDLIBRARY) $(PY3LIBRARY) $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) platform: $(BUILDPYTHON) pybuilddir.txt diff --git a/python3.spec b/python3.spec index 13e17a8..a384d1d 100644 --- a/python3.spec +++ b/python3.spec @@ -736,7 +736,6 @@ Patch203: 00203-disable-threading-test-koji.patch # FIXED UPSTREAM # Patch204: 00204-increase-dh-keys-size.patch -Patch205: config-to-lib64.patch # (New patches go here ^^^) @@ -939,7 +938,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %endif -#%patch111 -p1 +%patch111 -p1 # 112: not for python3 %patch113 -p1 # 00114: Upstream as of Python 3.4.0.b2 @@ -1028,7 +1027,6 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en # 00202: upstream as of 3.5.0b3 %patch203 -p1 # 00204: upstream as of 3.5.0b3 -%patch205 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. From a52deaab9aa74a2896f2e75d7f55e8b4673488db Mon Sep 17 00:00:00 2001 From: Robert Kuska Date: Mon, 21 Sep 2015 15:55:00 +0200 Subject: [PATCH 221/416] Make LIBPL variable respect libdir macro --- 00205-make-libpl-respect-lib64.patch | 12 ++++++++++++ python3.spec | 5 +++++ 2 files changed, 17 insertions(+) create mode 100644 00205-make-libpl-respect-lib64.patch diff --git a/00205-make-libpl-respect-lib64.patch b/00205-make-libpl-respect-lib64.patch new file mode 100644 index 0000000..4a6703b --- /dev/null +++ b/00205-make-libpl-respect-lib64.patch @@ -0,0 +1,12 @@ +diff -up Python-3.5.0/Makefile.pre.in.lib Python-3.5.0/Makefile.pre.in +--- Python-3.5.0/Makefile.pre.in.lib 2015-09-21 15:39:47.928286620 +0200 ++++ Python-3.5.0/Makefile.pre.in 2015-09-21 15:42:58.004042762 +0200 +@@ -1340,7 +1340,7 @@ inclinstall: + + # Install the library and miscellaneous stuff needed for extending/embedding + # This goes into $(exec_prefix) +-LIBPL= @LIBPL@ ++LIBPL= $(LIBDEST)/config-$(LDVERSION) + + # pkgconfig directory + LIBPC= $(LIBDIR)/pkgconfig diff --git a/python3.spec b/python3.spec index a384d1d..4bb612c 100644 --- a/python3.spec +++ b/python3.spec @@ -736,6 +736,10 @@ Patch203: 00203-disable-threading-test-koji.patch # FIXED UPSTREAM # Patch204: 00204-increase-dh-keys-size.patch +# LIBPL variable in makefile takes LIBPL from configure.ac +# but the LIBPL variable defined there doesn't respect libdir macro +Patch205: 00205-make-libpl-respect-lib64.patch + # (New patches go here ^^^) @@ -1027,6 +1031,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en # 00202: upstream as of 3.5.0b3 %patch203 -p1 # 00204: upstream as of 3.5.0b3 +%patch205 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. From 64cc450f086c8f5b7c1299dc214ee222957c0696 Mon Sep 17 00:00:00 2001 From: Robert Kuska Date: Wed, 23 Sep 2015 11:26:32 +0200 Subject: [PATCH 222/416] Add python-3.5.0 source files --- sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources b/sources index 9900d70..3e50267 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -7d092d1bba6e17f0d9bd21b49e441dd5 Python-3.4.3.tar.xz +d149d2812f10cbe04c042232e7964171 Python-3.5.0.tar.xz From 05bd57fd4a0224418afaec9b80fbd10c2b5f4dd1 Mon Sep 17 00:00:00 2001 From: Robert Kuska Date: Wed, 23 Sep 2015 11:30:57 +0200 Subject: [PATCH 223/416] Rename macros to 3.5 --- macros.pybytecompile3.4 => macros.pybytecompile3.5 | 0 macros.python3.4 => macros.python3.5 | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename macros.pybytecompile3.4 => macros.pybytecompile3.5 (100%) rename macros.python3.4 => macros.python3.5 (100%) diff --git a/macros.pybytecompile3.4 b/macros.pybytecompile3.5 similarity index 100% rename from macros.pybytecompile3.4 rename to macros.pybytecompile3.5 diff --git a/macros.python3.4 b/macros.python3.5 similarity index 100% rename from macros.python3.4 rename to macros.python3.5 From 08f37368e9c6faa4dad9678ad4add43b5ef06f3c Mon Sep 17 00:00:00 2001 From: Robert Kuska Date: Wed, 23 Sep 2015 15:03:18 +0200 Subject: [PATCH 224/416] Remove hf from arm triplet --- python3.spec | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/python3.spec b/python3.spec index 4bb612c..b6a8f83 100644 --- a/python3.spec +++ b/python3.spec @@ -39,8 +39,8 @@ %global LDVERSION_optimized %{pybasever}%{ABIFLAGS_optimized} %global LDVERSION_debug %{pybasever}%{ABIFLAGS_debug} -%global SOABI_optimized cpython-%{pyshortver}%{ABIFLAGS_optimized}-%{_arch}-linux-gnu -%global SOABI_debug cpython-%{pyshortver}%{ABIFLAGS_debug}-%{_arch}-linux-gnu +%global SOABI_optimized cpython-%{pyshortver}%{ABIFLAGS_optimized}-%{_arch}-linux%{_gnu} +%global SOABI_debug cpython-%{pyshortver}%{ABIFLAGS_debug}-%{_arch}-linux%{_gnu} # All bytecode files are now in a __pycache__ subdirectory, with a name # reflecting the version of the bytecode (to permit sharing of python libraries @@ -740,6 +740,10 @@ Patch203: 00203-disable-threading-test-koji.patch # but the LIBPL variable defined there doesn't respect libdir macro Patch205: 00205-make-libpl-respect-lib64.patch +# Remove hf flag from arm triplet which is used +# by debian but fedora infra uses only eabi without hf +Patch206: 00206-remove-hf-from-arm-triplet.patch + # (New patches go here ^^^) @@ -1032,6 +1036,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch203 -p1 # 00204: upstream as of 3.5.0b3 %patch205 -p1 +%patch206 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1275,8 +1280,8 @@ install -d -m 0755 %{buildroot}/%{_prefix}/lib/python%{pybasever}/site-packages/ %global LDVERSION_optimized %{pybasever}%{ABIFLAGS_optimized} %global LDVERSION_debug %{pybasever}%{ABIFLAGS_debug} -%global SOABI_optimized cpython-%{pyshortver}%{ABIFLAGS_optimized}-%{_arch}-linux-gnu -%global SOABI_debug cpython-%{pyshortver}%{ABIFLAGS_debug}-%{_arch}-linux-gnu +%global SOABI_optimized cpython-%{pyshortver}%{ABIFLAGS_optimized}-%{_arch}-linux%{_gnu} +%global SOABI_debug cpython-%{pyshortver}%{ABIFLAGS_debug}-%{_arch}-linux%{_gnu} %if 0%{?with_debug_build} %global PyIncludeDirs python%{LDVERSION_optimized} python%{LDVERSION_debug} From 2f6352e7fbba25a14791276c85c263aacbc5c2f3 Mon Sep 17 00:00:00 2001 From: Robert Kuska Date: Wed, 23 Sep 2015 15:06:03 +0200 Subject: [PATCH 225/416] Add also patch from previous commit --- 00206-remove-hf-from-arm-triplet.patch | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 00206-remove-hf-from-arm-triplet.patch diff --git a/00206-remove-hf-from-arm-triplet.patch b/00206-remove-hf-from-arm-triplet.patch new file mode 100644 index 0000000..c5f309c --- /dev/null +++ b/00206-remove-hf-from-arm-triplet.patch @@ -0,0 +1,15 @@ +diff -up Python-3.5.0/configure.ac.eabi Python-3.5.0/configure.ac +--- Python-3.5.0/configure.eabi 2015-09-23 13:52:20.756909744 +0200 ++++ Python-3.5.0/configure 2015-09-23 13:52:46.859163629 +0200 +@@ -762,9 +762,9 @@ cat >> conftest.c < Date: Wed, 14 Oct 2015 11:21:24 +0200 Subject: [PATCH 226/416] Rebuild with wheel set to 1 --- python3.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python3.spec b/python3.spec index b6a8f83..b2281e2 100644 --- a/python3.spec +++ b/python3.spec @@ -14,7 +14,7 @@ # 4) python3-setuptools and python3-pip with with_rewheel set to 1 # 5) python3 with with_rewheel set to 1 -%global with_rewheel 0 +%global with_rewheel 1 %global pybasever 3.5 @@ -140,7 +140,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 1%{?dist} +Release: 2%{?dist} License: Python Group: Development/Languages @@ -1937,6 +1937,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Wed Oct 14 2015 Robert Kuska - 3.5.0-2 +- Rebuild with wheel set to 1 + * Tue Sep 15 2015 Matej Stuchlik - 3.5.0-1 - Update to 3.5.0 From 08374589d7432f605237c68f9c63de5aa2fc25a5 Mon Sep 17 00:00:00 2001 From: Robert Kuska Date: Wed, 11 Nov 2015 10:35:39 +0100 Subject: [PATCH 227/416] Hide the private _Py_atomic_xxx symbols from public header --- 00207-hide-atomic-symbols.patch | 63 +++++++++++++++++++++++++++++++++ python3.spec | 15 ++++++-- 2 files changed, 75 insertions(+), 3 deletions(-) create mode 100644 00207-hide-atomic-symbols.patch diff --git a/00207-hide-atomic-symbols.patch b/00207-hide-atomic-symbols.patch new file mode 100644 index 0000000..d8871a0 --- /dev/null +++ b/00207-hide-atomic-symbols.patch @@ -0,0 +1,63 @@ + +# HG changeset patch +# User Victor Stinner +# Date 1442581594 -7200 +# Node ID d4fcb362f7c66b25b22ddc0d27db0cc96acc727b +# Parent d04a0954e142f873adee88ec5bc1c1d81cd46bc4 +Issue #25150: Hide the private _Py_atomic_xxx symbols from the public +Python.h header to fix a compilation error with OpenMP. PyThreadState_GET() +becomes an alias to PyThreadState_Get() to avoid ABI incompatibilies. + +It is important that the _PyThreadState_Current variable is always accessed +with the same implementation of pyatomic.h. Use the PyThreadState_Get() +function so extension modules will all reuse the same implementation. + +diff --git a/Include/pyatomic.h b/Include/pyatomic.h +--- a/Include/pyatomic.h ++++ b/Include/pyatomic.h +@@ -1,8 +1,6 @@ +-/* Issue #23644: is incompatible with C++, see: +- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60932 */ +-#if !defined(Py_LIMITED_API) && !defined(__cplusplus) + #ifndef Py_ATOMIC_H + #define Py_ATOMIC_H ++#ifdef Py_BUILD_CORE + + #include "dynamic_annotations.h" + +@@ -248,5 +246,5 @@ static __inline__ void + #define _Py_atomic_load_relaxed(ATOMIC_VAL) \ + _Py_atomic_load_explicit(ATOMIC_VAL, _Py_memory_order_relaxed) + ++#endif /* Py_BUILD_CORE */ + #endif /* Py_ATOMIC_H */ +-#endif /* Py_LIMITED_API */ +diff --git a/Include/pystate.h b/Include/pystate.h +--- a/Include/pystate.h ++++ b/Include/pystate.h +@@ -177,20 +177,13 @@ PyAPI_FUNC(int) PyThreadState_SetAsyncEx + /* Variable and macro for in-line access to current thread state */ + + /* Assuming the current thread holds the GIL, this is the +- PyThreadState for the current thread. +- +- Issue #23644: pyatomic.h is incompatible with C++ (yet). Disable +- PyThreadState_GET() optimization: declare it as an alias to +- PyThreadState_Get(), as done for limited API. */ +-#if !defined(Py_LIMITED_API) && !defined(__cplusplus) ++ PyThreadState for the current thread. */ ++#ifdef Py_BUILD_CORE + PyAPI_DATA(_Py_atomic_address) _PyThreadState_Current; +-#endif +- +-#if defined(Py_DEBUG) || defined(Py_LIMITED_API) || defined(__cplusplus) +-#define PyThreadState_GET() PyThreadState_Get() ++# define PyThreadState_GET() \ ++ ((PyThreadState*)_Py_atomic_load_relaxed(&_PyThreadState_Current)) + #else +-#define PyThreadState_GET() \ +- ((PyThreadState*)_Py_atomic_load_relaxed(&_PyThreadState_Current)) ++# define PyThreadState_GET() PyThreadState_Get() + #endif + + typedef diff --git a/python3.spec b/python3.spec index b2281e2..bcc552e 100644 --- a/python3.spec +++ b/python3.spec @@ -140,7 +140,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 2%{?dist} +Release: 3%{?dist} License: Python Group: Development/Languages @@ -744,6 +744,11 @@ Patch205: 00205-make-libpl-respect-lib64.patch # by debian but fedora infra uses only eabi without hf Patch206: 00206-remove-hf-from-arm-triplet.patch +# https://bugs.python.org/issue25150 +# Hide the private _Py_atomic_xxx symbols from the public +# Python.h header to fix a compilation error with OpenMP. +Patch207: 00207-hide-atomic-symbols.patch + # (New patches go here ^^^) @@ -1037,6 +1042,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en # 00204: upstream as of 3.5.0b3 %patch205 -p1 %patch206 -p1 +%patch207 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1746,7 +1752,7 @@ rm -fr %{buildroot} %dir %{_includedir}/python%{LDVERSION_optimized}/ %{_includedir}/python%{LDVERSION_optimized}/%{_pyconfig_h} -#%{_libdir}/%{py_INSTSONAME_optimized} +%{_libdir}/%{py_INSTSONAME_optimized} %{_libdir}/libpython3.so %if 0%{?with_systemtap} %dir %(dirname %{tapsetdir}) @@ -1888,7 +1894,7 @@ 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": -#%{_libdir}/%{py_INSTSONAME_debug} +%{_libdir}/%{py_INSTSONAME_debug} %if 0%{?with_systemtap} %dir %(dirname %{tapsetdir}) %dir %{tapsetdir} @@ -1937,6 +1943,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Wed Nov 11 2015 Robert Kuska - 3.5.0-3 +- Hide the private _Py_atomic_xxx symbols from public header + * Wed Oct 14 2015 Robert Kuska - 3.5.0-2 - Rebuild with wheel set to 1 From 0efd3d31cb9d167779a790169c65a84da7919822 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Fri, 13 Nov 2015 18:50:47 +0100 Subject: [PATCH 228/416] add correct arch for ppc64/ppc64le to fix build failure, it should be ppc64le-linux-gnu/ppc64-linux-gnu instead powerpc64le-linux-gnu/powerpc64-linux-gnu http://ppc.koji.fedoraproject.org/koji/taskinfo?taskID=2900961 --- python3-powerppc-arch.patch | 30 ++++++++++++++++++++++++++++++ python3.spec | 11 ++++++++++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 python3-powerppc-arch.patch diff --git a/python3-powerppc-arch.patch b/python3-powerppc-arch.patch new file mode 100644 index 0000000..10f0201 --- /dev/null +++ b/python3-powerppc-arch.patch @@ -0,0 +1,30 @@ +diff -up Python-3.5.0/configure.ac.than Python-3.5.0/configure.ac +--- Python-3.5.0/configure.ac.than 2015-11-13 11:51:32.039560172 -0500 ++++ Python-3.5.0/configure.ac 2015-11-13 11:52:11.670168157 -0500 +@@ -804,9 +804,9 @@ cat >> conftest.c <> conftest.c < 3.5.0-4 +- add correct arch for ppc64/ppc64le to fix build failure + * Wed Nov 11 2015 Robert Kuska - 3.5.0-3 - Hide the private _Py_atomic_xxx symbols from public header From e769a593968acf4dd3e34831034be35f5e1122c6 Mon Sep 17 00:00:00 2001 From: Robert Kuska Date: Sun, 15 Nov 2015 10:02:16 +0100 Subject: [PATCH 229/416] Remove versioned libpython from devel package --- python3.spec | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python3.spec b/python3.spec index 5b2a2d2..70de93a 100644 --- a/python3.spec +++ b/python3.spec @@ -140,7 +140,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 4%{?dist} +Release: 5%{?dist} License: Python Group: Development/Languages @@ -1779,7 +1779,6 @@ rm -fr %{buildroot} %{_bindir}/python%{LDVERSION_optimized}-config %{_bindir}/python%{LDVERSION_optimized}-*-config %{_libdir}/libpython%{LDVERSION_optimized}.so -%{_libdir}/libpython%{LDVERSION_optimized}.so.1.0 %{_libdir}/pkgconfig/python-%{LDVERSION_optimized}.pc %{_libdir}/pkgconfig/python-%{pybasever}.pc %{_libdir}/pkgconfig/python3.pc @@ -1949,6 +1948,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Sun Nov 15 2015 Robert Kuska - 3.5.0-5 +- Remove versioned libpython from devel package + * Fri Nov 13 2015 Than Ngo 3.5.0-4 - add correct arch for ppc64/ppc64le to fix build failure From 7883cb72b02699a8509ee60662eb265024f61b0e Mon Sep 17 00:00:00 2001 From: Robert Kuska Date: Mon, 14 Dec 2015 13:34:09 +0100 Subject: [PATCH 230/416] [cleanup] Remove unused patches --- 00003-remove-mimeaudio-tests.patch | 51 --- 00153-fix-test_gdb-noise.patch | 31 -- 00156-gdb-autoload-safepath.patch | 52 ---- 00175-fix-configure-Wformat.patch | 12 - 00176-upstream-issue16754-so-extension.patch | 11 - ...ge-match_hostname-to-follow-RFC-6125.patch | 188 ------------ 00192-buffer-overflow.patch | 42 --- ...num-of-pycfile-bytes-in-modulefinder.patch | 65 ---- ...-undefined-behaviour-in-faulthandler.patch | 41 --- 00204-increase-dh-keys-size.patch | 49 --- python-3.1.2-fix-expat-issue9054.patch | 14 - ...ges-to-expected-shebang-for-test_imp.patch | 12 - python-3.2a1-debug-build.patch | 290 ------------------ python-3.2a1-fix-parallel-make.patch | 37 --- python-3.2b2-fix-ppc-debug-build.patch | 19 -- python-3.2rc1-s390-tsc.patch | 17 - python3.spec | 256 ---------------- 17 files changed, 1187 deletions(-) delete mode 100644 00003-remove-mimeaudio-tests.patch delete mode 100644 00153-fix-test_gdb-noise.patch delete mode 100644 00156-gdb-autoload-safepath.patch delete mode 100644 00175-fix-configure-Wformat.patch delete mode 100644 00176-upstream-issue16754-so-extension.patch delete mode 100644 00187-change-match_hostname-to-follow-RFC-6125.patch delete mode 100644 00192-buffer-overflow.patch delete mode 100644 00193-skip-correct-num-of-pycfile-bytes-in-modulefinder.patch delete mode 100644 00202-fix-undefined-behaviour-in-faulthandler.patch delete mode 100644 00204-increase-dh-keys-size.patch delete mode 100644 python-3.1.2-fix-expat-issue9054.patch delete mode 100644 python-3.2a1-apply-our-changes-to-expected-shebang-for-test_imp.patch delete mode 100644 python-3.2a1-debug-build.patch delete mode 100644 python-3.2a1-fix-parallel-make.patch delete mode 100644 python-3.2b2-fix-ppc-debug-build.patch delete mode 100644 python-3.2rc1-s390-tsc.patch diff --git a/00003-remove-mimeaudio-tests.patch b/00003-remove-mimeaudio-tests.patch deleted file mode 100644 index 8341363..0000000 --- a/00003-remove-mimeaudio-tests.patch +++ /dev/null @@ -1,51 +0,0 @@ -diff -up Python-3.3.0rc1/Lib/test/test_email/test_email.py.remove-mimeaudio-tests Python-3.3.0rc1/Lib/test/test_email/test_email.py ---- Python-3.3.0rc1/Lib/test/test_email/test_email.py.remove-mimeaudio-tests 2012-08-25 15:22:10.000000000 -0400 -+++ Python-3.3.0rc1/Lib/test/test_email/test_email.py 2012-08-27 11:00:11.936964586 -0400 -@@ -1321,47 +1321,6 @@ Blah blah blah - self.assertEqual(b.getvalue(), source + b'>From R\xc3\xb6lli\n') - - --# Test the basic MIMEAudio class --class TestMIMEAudio(unittest.TestCase): -- def setUp(self): -- with openfile('audiotest.au', 'rb') as fp: -- self._audiodata = fp.read() -- self._au = MIMEAudio(self._audiodata) -- -- def test_guess_minor_type(self): -- self.assertEqual(self._au.get_content_type(), 'audio/basic') -- -- def test_encoding(self): -- payload = self._au.get_payload() -- self.assertEqual(base64.decodebytes(bytes(payload, 'ascii')), -- self._audiodata) -- -- def test_checkSetMinor(self): -- au = MIMEAudio(self._audiodata, 'fish') -- self.assertEqual(au.get_content_type(), 'audio/fish') -- -- def test_add_header(self): -- eq = self.assertEqual -- unless = self.assertTrue -- self._au.add_header('Content-Disposition', 'attachment', -- filename='audiotest.au') -- eq(self._au['content-disposition'], -- 'attachment; filename="audiotest.au"') -- eq(self._au.get_params(header='content-disposition'), -- [('attachment', ''), ('filename', 'audiotest.au')]) -- eq(self._au.get_param('filename', header='content-disposition'), -- 'audiotest.au') -- missing = [] -- eq(self._au.get_param('attachment', header='content-disposition'), '') -- unless(self._au.get_param('foo', failobj=missing, -- header='content-disposition') is missing) -- # Try some missing stuff -- unless(self._au.get_param('foobar', missing) is missing) -- unless(self._au.get_param('attachment', missing, -- header='foobar') is missing) -- -- -- - # Test the basic MIMEImage class - class TestMIMEImage(unittest.TestCase): - def setUp(self): diff --git a/00153-fix-test_gdb-noise.patch b/00153-fix-test_gdb-noise.patch deleted file mode 100644 index 8b0a76c..0000000 --- a/00153-fix-test_gdb-noise.patch +++ /dev/null @@ -1,31 +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 -@@ -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 ---- 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 ', - ) -+ 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/00156-gdb-autoload-safepath.patch b/00156-gdb-autoload-safepath.patch deleted file mode 100644 index 1e57e9f..0000000 --- a/00156-gdb-autoload-safepath.patch +++ /dev/null @@ -1,52 +0,0 @@ -diff -up Python-3.2.3/Lib/test/test_gdb.py.gdb-autoload-safepath Python-3.2.3/Lib/test/test_gdb.py ---- Python-3.2.3/Lib/test/test_gdb.py.gdb-autoload-safepath 2012-04-30 17:16:24.092706954 -0400 -+++ Python-3.2.3/Lib/test/test_gdb.py 2012-04-30 17:17:13.275703592 -0400 -@@ -46,6 +46,19 @@ def gdb_has_frame_select(): - - HAS_PYUP_PYDOWN = gdb_has_frame_select() - -+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 b'"on" or "off" expected.' not in stderr -+ -+HAS_AUTOLOAD_SAFEPATH = gdb_has_autoload_safepath() -+ - BREAKPOINT_FN='builtin_id' - - class DebuggerTests(unittest.TestCase): -@@ -106,15 +119,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", "-nx"] -+ 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/00175-fix-configure-Wformat.patch b/00175-fix-configure-Wformat.patch deleted file mode 100644 index 9f42568..0000000 --- a/00175-fix-configure-Wformat.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up Python-3.3.0/configure.ac.fix-configure-Wformat Python-3.3.0/configure.ac ---- Python-3.3.0/configure.ac.fix-configure-Wformat 2013-03-25 16:09:09.127667472 -0400 -+++ Python-3.3.0/configure.ac 2013-03-25 16:09:16.442666967 -0400 -@@ -1308,7 +1308,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/00176-upstream-issue16754-so-extension.patch b/00176-upstream-issue16754-so-extension.patch deleted file mode 100644 index 4af618a..0000000 --- a/00176-upstream-issue16754-so-extension.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- Python-3.3.0/Lib/distutils/sysconfig.py 2012-09-29 10:00:28.000000000 +0200 -+++ Python-3.3.0/Lib/distutils/sysconfig.py 2012-12-22 20:14:49.661337174 +0100 -@@ -228,7 +228,7 @@ def customize_compiler(compiler): - linker_exe=cc, - archiver=archiver) - -- compiler.shared_lib_extension = so_ext -+ #compiler.shared_lib_extension = so_ext - - - def get_config_h_filename(): diff --git a/00187-change-match_hostname-to-follow-RFC-6125.patch b/00187-change-match_hostname-to-follow-RFC-6125.patch deleted file mode 100644 index 0c07ecc..0000000 --- a/00187-change-match_hostname-to-follow-RFC-6125.patch +++ /dev/null @@ -1,188 +0,0 @@ ---- a/Doc/library/ssl.rst -+++ b/Doc/library/ssl.rst -@@ -283,10 +283,10 @@ Certificate handling - 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`, 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. -+ 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:: -@@ -301,6 +301,13 @@ Certificate handling - - .. versionadded:: 3.2 - -+ .. versionchanged:: 3.3.3 -+ The function now follows :rfc:`6125`, section 6.4.3 and does neither -+ match multiple wildcards (e.g. ``*.*.com`` or ``*a*.example.org``) nor -+ a wildcard inside an internationalized domain names (IDN) fragment. -+ IDN A-labels such as ``www*.xn--pthon-kva.org`` are still supported, -+ but ``x*.python.org`` no longer matches ``xn--tda.python.org``. -+ - .. function:: cert_time_to_seconds(timestring) - - Returns a floating-point value containing a normal seconds-after-the-epoch -unchanged: ---- a/Lib/ssl.py -+++ b/Lib/ssl.py -@@ -129,25 +129,53 @@ class CertificateError(ValueError): - pass - - --def _dnsname_to_pat(dn, max_wildcards=1): -+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 = [] -- for frag in dn.split(r'.'): -- if frag.count('*') > 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)) -- if frag == '*': -- # When '*' is a fragment by itself, it matches a non-empty dotless -- # fragment. -- pats.append('[^.]+') -- else: -- # Otherwise, '*' matches any dotless fragment. -- frag = re.escape(frag) -- pats.append(frag.replace(r'\*', '[^.]*')) -- return re.compile(r'\A' + r'\.'.join(pats) + r'\Z', re.IGNORECASE) -+ if not dn: -+ return False -+ -+ leftmost, *remainder = dn.split(r'.') -+ -+ 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): -unchanged: ---- a/Lib/test/test_ssl.py -+++ b/Lib/test/test_ssl.py -@@ -304,11 +304,7 @@ class BasicSocketTests(unittest.TestCase - fail(cert, 'Xa.com') - fail(cert, '.a.com') - -- cert = {'subject': ((('commonName', 'a.*.com'),),)} -- ok(cert, 'a.foo.com') -- fail(cert, 'a..com') -- fail(cert, 'a.com') -- -+ # only match one left-most wildcard - cert = {'subject': ((('commonName', 'f*.com'),),)} - ok(cert, 'foo.com') - ok(cert, 'f.com') -@@ -323,6 +319,36 @@ class BasicSocketTests(unittest.TestCase - 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 = 'püthon.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 = 'www*.pythön.org'.encode("idna").decode("ascii") -+ cert = {'subject': ((('commonName', idna),),)} -+ ok(cert, 'www.pythön.org'.encode("idna").decode("ascii")) -+ ok(cert, 'www1.pythön.org'.encode("idna").decode("ascii")) -+ fail(cert, 'ftp.pythön.org'.encode("idna").decode("ascii")) -+ fail(cert, 'pythön.org'.encode("idna").decode("ascii")) -+ - # Slightly fake real-world example - cert = {'notAfter': 'Jun 26 21:41:46 2011 GMT', - 'subject': ((('commonName', 'linuxfrz.org'),),), -@@ -383,7 +409,7 @@ class BasicSocketTests(unittest.TestCase - cert = {'subject': ((('commonName', 'a*b.com'),),)} - ok(cert, 'axxb.com') - cert = {'subject': ((('commonName', 'a*b.co*'),),)} -- ok(cert, 'axxb.com') -+ fail(cert, 'axxb.com') - cert = {'subject': ((('commonName', 'a*b*.com'),),)} - with self.assertRaises(ssl.CertificateError) as cm: - ssl.match_hostname(cert, 'axxbxxc.com') ---- a/Lib/ssl.py -+++ b/Lib/ssl.py -@@ -192,7 +192,7 @@ def match_hostname(cert, hostname): - san = cert.get('subjectAltName', ()) - for key, value in san: - if key == 'DNS': -- if _dnsname_to_pat(value).match(hostname): -+ if _dnsname_match(value, hostname): - return - dnsnames.append(value) - if not dnsnames: -@@ -203,7 +203,7 @@ def match_hostname(cert, hostname): - # XXX according to RFC 2818, the most specific Common Name - # must be used. - if key == 'commonName': -- if _dnsname_to_pat(value).match(hostname): -+ if _dnsname_match(value, hostname): - return - dnsnames.append(value) - if len(dnsnames) > 1: diff --git a/00192-buffer-overflow.patch b/00192-buffer-overflow.patch deleted file mode 100644 index 73d3ece..0000000 --- a/00192-buffer-overflow.patch +++ /dev/null @@ -1,42 +0,0 @@ - -# HG changeset patch -# User Benjamin Peterson -# Date 1389672775 18000 -# Node ID 7f176a45211ff3cb85a2fbdc75f7979d642bb563 -# Parent ed1c27b68068c942c6e845bdf8e987e963d50920# Parent 9c56217e5c793685eeaf0ee224848c402bdf1e4c -merge 3.2 (#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 -@@ -4538,6 +4538,14 @@ 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): -+ self.serv_conn.send(MSG*2048) -+ - - TIPC_STYPE = 2000 - TIPC_LOWER = 200 -diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c ---- a/Modules/socketmodule.c -+++ b/Modules/socketmodule.c -@@ -2935,6 +2935,11 @@ sock_recvfrom_into(PySocketSockObject *s - if (recvlen == 0) { - /* If nbytes was not specified, use the buffer's length */ - recvlen = buflen; -+ } else if (recvlen > buflen) { -+ PyBuffer_Release(&pbuf); -+ PyErr_SetString(PyExc_ValueError, -+ "nbytes is greater than the length of the buffer"); -+ return NULL; - } - - readlen = sock_recvfrom_guts(s, buf, recvlen, flags, &addr); - diff --git a/00193-skip-correct-num-of-pycfile-bytes-in-modulefinder.patch b/00193-skip-correct-num-of-pycfile-bytes-in-modulefinder.patch deleted file mode 100644 index bdf2e75..0000000 --- a/00193-skip-correct-num-of-pycfile-bytes-in-modulefinder.patch +++ /dev/null @@ -1,65 +0,0 @@ - -# HG changeset patch -# User Brett Cannon -# Date 1393602285 18000 -# Node ID 432cb56db05d73f55d211501bf0dfc767768923b -# Parent ade5e4922a54cb84c99ec924ab7c700a014893da -Issue #20778: Fix modulefinder to work with bytecode-only modules. - -Bug filed and initial attempt at a patch by Bohuslav Kabrda. - -diff --git a/Lib/modulefinder.py b/Lib/modulefinder.py ---- a/Lib/modulefinder.py -+++ b/Lib/modulefinder.py -@@ -287,7 +287,7 @@ class ModuleFinder: - if fp.read(4) != imp.get_magic(): - self.msgout(2, "raise ImportError: Bad magic number", pathname) - raise ImportError("Bad magic number in %s" % pathname) -- fp.read(4) -+ fp.read(8) # Skip mtime and size. - co = marshal.load(fp) - else: - co = None -diff --git a/Lib/test/test_modulefinder.py b/Lib/test/test_modulefinder.py ---- a/Lib/test/test_modulefinder.py -+++ b/Lib/test/test_modulefinder.py -@@ -1,5 +1,7 @@ - import os - import errno -+import importlib.machinery -+import py_compile - import shutil - import unittest - import tempfile -@@ -208,6 +210,14 @@ a/module.py - from . import * - """] - -+bytecode_test = [ -+ "a", -+ ["a"], -+ [], -+ [], -+ "" -+] -+ - - def open_file(path): - dirname = os.path.dirname(path) -@@ -288,6 +298,16 @@ class ModuleFinderTest(unittest.TestCase - def test_relative_imports_4(self): - self._do_test(relative_import_test_4) - -+ def test_bytecode(self): -+ base_path = os.path.join(TEST_DIR, 'a') -+ source_path = base_path + importlib.machinery.SOURCE_SUFFIXES[0] -+ bytecode_path = base_path + importlib.machinery.BYTECODE_SUFFIXES[0] -+ with open_file(source_path) as file: -+ file.write('testing_modulefinder = True\n') -+ py_compile.compile(source_path, cfile=bytecode_path) -+ os.remove(source_path) -+ self._do_test(bytecode_test) -+ - - def test_main(): - support.run_unittest(ModuleFinderTest) diff --git a/00202-fix-undefined-behaviour-in-faulthandler.patch b/00202-fix-undefined-behaviour-in-faulthandler.patch deleted file mode 100644 index b333e15..0000000 --- a/00202-fix-undefined-behaviour-in-faulthandler.patch +++ /dev/null @@ -1,41 +0,0 @@ - -# HG changeset patch -# User Victor Stinner -# Date 1423661015 -3600 -# Node ID 689092296ad31951f8f919fc06b49450e648e93d -# Parent 645f3d750be139ce0198e15e221da07b22289a92 -Issue #23433: Fix faulthandler._stack_overflow() - -Fix undefined behaviour: don't compare pointers. Use Py_uintptr_t type instead -of void*. It fixes test_faulthandler on Fedora 22 which now uses GCC 5. - -diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c ---- a/Modules/faulthandler.c -+++ b/Modules/faulthandler.c -@@ -911,12 +911,12 @@ faulthandler_fatal_error_py(PyObject *se - } - - #if defined(HAVE_SIGALTSTACK) && defined(HAVE_SIGACTION) --static void* --stack_overflow(void *min_sp, void *max_sp, size_t *depth) -+static Py_uintptr_t -+stack_overflow(Py_uintptr_t min_sp, Py_uintptr_t max_sp, size_t *depth) - { - /* allocate 4096 bytes on the stack at each call */ - unsigned char buffer[4096]; -- void *sp = &buffer; -+ Py_uintptr_t sp = (Py_uintptr_t)&buffer; - *depth += 1; - if (sp < min_sp || max_sp < sp) - return sp; -@@ -929,7 +929,8 @@ static PyObject * - faulthandler_stack_overflow(PyObject *self) - { - size_t depth, size; -- char *sp = (char *)&depth, *stop; -+ Py_uintptr_t sp = (Py_uintptr_t)&depth; -+ Py_uintptr_t stop; - - depth = 0; - stop = stack_overflow(sp - STACK_OVERFLOW_MAX_SIZE, - diff --git a/00204-increase-dh-keys-size.patch b/00204-increase-dh-keys-size.patch deleted file mode 100644 index e75d992..0000000 --- a/00204-increase-dh-keys-size.patch +++ /dev/null @@ -1,49 +0,0 @@ - -# HG changeset patch -# User Benjamin Peterson -# Date 1427947446 14400 -# Node ID 1ad7c0253abe1252128d61c3d0127d22144cb354 -# Parent 47451f6e7e7528a6647dbdc435e9a9f5c13c0080 -replace 512 bit dh key with a 2014 bit one (closes #23844) - -Patch by Cédric Krier. - -diff --git a/Lib/test/dh1024.pem b/Lib/test/dh1024.pem -new file mode 100644 ---- /dev/null -+++ b/Lib/test/dh1024.pem -@@ -0,0 +1,7 @@ -+-----BEGIN DH PARAMETERS----- -+MIGHAoGBAIbzw1s9CT8SV5yv6L7esdAdZYZjPi3qWFs61CYTFFQnf2s/d09NYaJt -+rrvJhIzWavqnue71qXCf83/J3nz3FEwUU/L0mGyheVbsSHiI64wUo3u50wK5Igo0 -+RNs/LD0irs7m0icZ//hijafTU+JOBiuA8zMI+oZfU7BGuc9XrUprAgEC -+-----END DH PARAMETERS----- -+ -+Generated with: openssl dhparam -out dh1024.pem 1024 -diff --git a/Lib/test/dh512.pem b/Lib/test/dh512.pem -deleted file mode 100644 ---- a/Lib/test/dh512.pem -+++ /dev/null -@@ -1,9 +0,0 @@ -------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/test_ssl.py b/Lib/test/test_ssl.py ---- a/Lib/test/test_ssl.py -+++ b/Lib/test/test_ssl.py -@@ -64,7 +64,7 @@ BADKEY = data_file("badkey.pem") - NOKIACERT = data_file("nokia.pem") - NULLBYTECERT = data_file("nullbytecert.pem") - --DHFILE = data_file("dh512.pem") -+DHFILE = data_file("dh1024.pem") - BYTES_DHFILE = os.fsencode(DHFILE) - - - diff --git a/python-3.1.2-fix-expat-issue9054.patch b/python-3.1.2-fix-expat-issue9054.patch deleted file mode 100644 index f1a4640..0000000 --- a/python-3.1.2-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-3.2a1-apply-our-changes-to-expected-shebang-for-test_imp.patch b/python-3.2a1-apply-our-changes-to-expected-shebang-for-test_imp.patch deleted file mode 100644 index 68eb618..0000000 --- a/python-3.2a1-apply-our-changes-to-expected-shebang-for-test_imp.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up Python-3.2a1/Lib/test/test_imp.py.apply-our-changes-to-expected-shebang Python-3.2a1/Lib/test/test_imp.py ---- Python-3.2a1/Lib/test/test_imp.py.apply-our-changes-to-expected-shebang 2010-08-02 15:57:49.151002176 -0400 -+++ Python-3.2a1/Lib/test/test_imp.py 2010-08-02 15:58:40.428010729 -0400 -@@ -52,7 +52,7 @@ class ImportTests(unittest.TestCase): - self.assertNotEqual(fp, None) - self.assertEqual(fp.encoding, "iso-8859-1") - self.assertEqual(fp.tell(), 0) -- self.assertEqual(fp.readline(), '#!/usr/bin/env python3\n') -+ self.assertEqual(fp.readline(), '#!/usr/bin/python3.2\n') - fp.close() - - fp, filename, info = imp.find_module("tokenize") diff --git a/python-3.2a1-debug-build.patch b/python-3.2a1-debug-build.patch deleted file mode 100644 index 49fb182..0000000 --- a/python-3.2a1-debug-build.patch +++ /dev/null @@ -1,290 +0,0 @@ -diff -up Python-3.2a1/configure.in.debug-build Python-3.2a1/configure.in ---- Python-3.2a1/configure.in.debug-build 2010-08-20 16:06:24.616082276 -0400 -+++ Python-3.2a1/configure.in 2010-08-20 16:06:24.632127011 -0400 -@@ -584,7 +584,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) - -@@ -726,8 +726,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*) -@@ -825,6 +825,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-3.2a1/Lib/distutils/command/build_ext.py.debug-build Python-3.2a1/Lib/distutils/command/build_ext.py ---- Python-3.2a1/Lib/distutils/command/build_ext.py.debug-build 2010-07-22 08:50:05.000000000 -0400 -+++ Python-3.2a1/Lib/distutils/command/build_ext.py 2010-08-20 16:06:24.633125472 -0400 -@@ -673,7 +673,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 -@@ -754,6 +757,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-3.2a1/Lib/distutils/sysconfig.py.debug-build Python-3.2a1/Lib/distutils/sysconfig.py ---- Python-3.2a1/Lib/distutils/sysconfig.py.debug-build 2010-08-20 16:06:24.623083865 -0400 -+++ Python-3.2a1/Lib/distutils/sysconfig.py 2010-08-20 16:06:24.633125472 -0400 -@@ -83,7 +83,8 @@ def get_python_inc(plat_specific=0, pref - else: - incdir = os.path.join(get_config_var('srcdir'), 'Include') - return os.path.normpath(incdir) -- 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": -@@ -229,7 +230,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-3.2a1/Makefile.pre.in.debug-build Python-3.2a1/Makefile.pre.in ---- Python-3.2a1/Makefile.pre.in.debug-build 2010-08-20 16:06:24.624081000 -0400 -+++ Python-3.2a1/Makefile.pre.in 2010-08-20 16:06:57.287084214 -0400 -@@ -105,8 +105,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 -@@ -120,6 +120,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@ -@@ -183,7 +189,7 @@ LIBOBJDIR= Python/ - LIBOBJS= @LIBOBJS@ - - PYTHON= python$(EXE) --BUILDPYTHON= python$(BUILDEXE) -+BUILDPYTHON= python$(BUILD_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 -@@ -433,7 +439,7 @@ sharedmods: $(BUILDPYTHON) - *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(PY_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) $(PY_LDFLAGS) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ - $(LN) -f $(INSTSONAME) $@; \ -@@ -817,7 +823,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); \ -@@ -831,15 +837,15 @@ altbininstall: $(BUILDPYTHON) - fi - - bininstall: altbininstall -- -if test -f $(DESTDIR)$(BINDIR)/$(PYTHON)3$(EXE) -o -h $(DESTDIR)$(BINDIR)/$(PYTHON)3$(EXE); \ -- then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON)3$(EXE); \ -+ -if test -f $(DESTDIR)$(BINDIR)/$(PYTHON)3$(DEBUG_SUFFIX)$(EXE) -o -h $(DESTDIR)$(BINDIR)/$(PYTHON)3$(DEBUG_SUFFIX)$(EXE); \ -+ then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON)3$(DEBUG_SUFFIX)$(EXE); \ - else true; \ - fi -- (cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON)3$(EXE)) -- -rm -f $(DESTDIR)$(BINDIR)/python3-config -- (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python3-config) -- -rm -f $(DESTDIR)$(LIBPC)/python3.pc -- (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python3.pc) -+ (cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(DEBUG_SUFFIX)$(EXE) $(PYTHON)3$(DEBUG_SUFFIX)$(EXE)) -+ -rm -f $(DESTDIR)$(BINDIR)/python3$(DEBUG_SUFFIX)-config -+ (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(DEBUG_SUFFIX)-config python3$(DEBUG_SUFFIX)-config) -+ -rm -f $(DESTDIR)$(LIBPC)/python3$(DEBUG_SUFFIX).pc -+ (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION)$(DEBUG_SUFFIX).pc python3$(DEBUG_SUFFIX).pc) - - # Install the manual page - maninstall: -@@ -965,10 +971,10 @@ $(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) -@@ -990,12 +996,12 @@ inclinstall: - - # Install the library and miscellaneous stuff needed for extending/embedding - # This goes into $(exec_prefix) --LIBPL= $(LIBP)/config -+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 \ -@@ -1011,11 +1017,11 @@ 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 -+ 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-3.2a1/Misc/python-config.in.debug-build Python-3.2a1/Misc/python-config.in ---- Python-3.2a1/Misc/python-config.in.debug-build 2010-04-06 17:30:42.000000000 -0400 -+++ Python-3.2a1/Misc/python-config.in 2010-08-20 16:06:24.635124366 -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-3.2a1/Modules/makesetup.debug-build Python-3.2a1/Modules/makesetup ---- Python-3.2a1/Modules/makesetup.debug-build 2010-07-09 12:30:58.000000000 -0400 -+++ Python-3.2a1/Modules/makesetup 2010-08-20 16:06:24.635124366 -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-3.2a1/Python/dynload_shlib.c.debug-build Python-3.2a1/Python/dynload_shlib.c ---- Python-3.2a1/Python/dynload_shlib.c.debug-build 2010-05-09 11:52:27.000000000 -0400 -+++ Python-3.2a1/Python/dynload_shlib.c 2010-08-20 16:06:24.635124366 -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-3.2a1/Python/sysmodule.c.debug-build Python-3.2a1/Python/sysmodule.c ---- Python-3.2a1/Python/sysmodule.c.debug-build 2010-07-06 06:53:30.000000000 -0400 -+++ Python-3.2a1/Python/sysmodule.c 2010-08-20 16:06:24.636251716 -0400 -@@ -1598,6 +1598,12 @@ _PySys_Init(void) - WindowsVersionType.tp_new = NULL; - #endif - -+#ifdef Py_DEBUG -+ PyDict_SetItemString(sysdict, "pydebug", Py_True); -+#else -+ PyDict_SetItemString(sysdict, "pydebug", Py_False); -+#endif -+ - /* float repr style: 0.03 (short) vs 0.029999999999999999 (legacy) */ - #ifndef PY_NO_SHORT_FLOAT_REPR - SET_SYS_FROM_STRING("float_repr_style", -diff -up Python-3.2a1/runtests.sh.debug-build Python-3.2a1/runtests.sh ---- Python-3.2a1/runtests.sh.debug-build 2008-10-17 08:05:40.000000000 -0400 -+++ Python-3.2a1/runtests.sh 2010-08-20 16:06:24.637251276 -0400 -@@ -16,11 +16,14 @@ Flags (arguments starting with '-') are - regrtest.py, except for -x, which is processed here." - - # Choose the Python binary. --case `uname` in --Darwin) PYTHON=./python.exe;; --CYGWIN*) PYTHON=./python.exe;; --*) PYTHON=./python;; --esac -+if [ -z $PYTHON ] -+then -+ case `uname` in -+ Darwin) PYTHON=./python.exe;; -+ CYGWIN*) PYTHON=./python.exe;; -+ *) PYTHON=./python;; -+ esac -+fi - - PYTHON="$PYTHON -bb" - diff --git a/python-3.2a1-fix-parallel-make.patch b/python-3.2a1-fix-parallel-make.patch deleted file mode 100644 index b6189b5..0000000 --- a/python-3.2a1-fix-parallel-make.patch +++ /dev/null @@ -1,37 +0,0 @@ -diff -up Python-3.2a1/Makefile.pre.in.parallel-grammar Python-3.2a1/Makefile.pre.in ---- Python-3.2a1/Makefile.pre.in.parallel-grammar 2010-08-20 15:09:13.613527156 -0400 -+++ Python-3.2a1/Makefile.pre.in 2010-08-20 15:10:31.428135355 -0400 -@@ -222,6 +222,7 @@ IO_OBJS= \ - - ########################################################################## - # Grammar -+GRAMMAR_STAMP= $(srcdir)/grammar-stamp - GRAMMAR_H= $(srcdir)/Include/graminit.h - GRAMMAR_C= $(srcdir)/Python/graminit.c - GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar -@@ -557,9 +558,24 @@ Modules/python.o: $(srcdir)/Modules/pyth - - $(IO_OBJS): $(IO_H) - --$(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT) -+# 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_STAMP): $(PGEN) $(GRAMMAR_INPUT) - -@$(INSTALL) -d Include - -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) -+ touch $(GRAMMAR_STAMP) - - $(PGEN): $(PGENOBJS) - $(CC) $(OPT) $(PY_LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN) 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-3.2rc1-s390-tsc.patch b/python-3.2rc1-s390-tsc.patch deleted file mode 100644 index fc4a6b9..0000000 --- a/python-3.2rc1-s390-tsc.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff -up Python-3.2rc1/Python/ceval.c.s390-tsc Python-3.2rc1/Python/ceval.c ---- Python-3.2rc1/Python/ceval.c.s390-tsc 2011-02-04 05:11:27.585224435 -0500 -+++ Python-3.2rc1/Python/ceval.c 2011-02-04 05:12:38.065223933 -0500 -@@ -74,6 +74,13 @@ ppc_getcounter(uint64 *v) - "=a" (((int*)&(val))[0]), "=d" (((int*)&(val))[1])); - - -+#elif defined(__s390__) -+ -+/* covers both s390 and s390x */ -+ -+#define READ_TIMESTAMP(val) \ -+ __asm__ __volatile__("stck %0" : "=Q" (val) : : "cc") -+ - #else - - #error "Don't know how to implement timestamp counter for this architecture" diff --git a/python3.spec b/python3.spec index 70de93a..91b2633 100644 --- a/python3.spec +++ b/python3.spec @@ -247,10 +247,6 @@ Source8: check-pyc-and-pyo-timestamps.py # Was Patch0 in ivazquez' python3000 specfile: Patch1: Python-3.1.1-rpath.patch -# Some tests were removed due to audiotest.au not being packaged. This was -# however added to the archive in 3.3.1, so we no longer delete the tests. -# Patch3: 00003-remove-mimeaudio-tests.patch - # 00055 # # Systemtap support: add statically-defined probe points # Patch sent upstream as http://bugs.python.org/issue14776 @@ -271,10 +267,6 @@ Patch104: 00104-lib64-fix-for-test_install.patch # Downstream only: not appropriate for upstream Patch111: 00111-no-static-lib.patch -# 00112 # -# Patch112: python-2.7rc1-debug-build.patch: this is not relevant to Python 3, -# for 3.2 onwards - # 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 @@ -283,10 +275,6 @@ Patch111: 00111-no-static-lib.patch # Not yet sent upstream Patch113: 00113-more-configuration-flags.patch -# 00114 # -# Upstream as of Python 3.4.0.b2 -# Patch114: 00114-statvfs-f_flag-constants.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 @@ -295,11 +283,6 @@ Patch113: 00113-more-configuration-flags.patch # Not yet sent upstream Patch125: 00125-less-verbose-COUNT_ALLOCS.patch -# 00130 # -# Python 2's: -# Patch130: python-2.7.2-add-extension-suffix-to-python-config.patch -# is not relevant to Python 3 (for 3.2 onwards) - # 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 @@ -337,18 +320,10 @@ Patch134: 00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch # Not yet sent upstream Patch135: 00135-fix-test-within-test_weakref-in-debug-build.patch -# 00136 # -# Patch136: 00136-skip-tests-of-seeking-stdin-in-rpmbuild.patch does not seem -# to be needed by python3 - # 00137 # # Some tests within distutils fail when run in an rpmbuild: Patch137: 00137-skip-distutils-tests-that-fail-in-rpmbuild.patch -# 00138 # -# Patch138: 00138-fix-distutils-tests-in-debug-build.patch is not relevant for -# python3 - # 00139 # # ARM-specific: skip known failure in test_float: # http://bugs.python.org/issue8265 (rhbz#706253) @@ -357,9 +332,6 @@ Patch139: 00139-skip-test_float-known-failure-on-arm.patch # ideally short lived patch disabling a test thats fragile on different arches Patch140: python3-arm-skip-failing-fragile-test.patch -# Patch140: 00140-skip-test_ctypes-known-failure-on-sparc.patch does not appear -# to be relevant for python3 - # 00141 # # Fix tests for case when tests for case when configured with # COUNT_ALLOCS (debug build): http://bugs.python.org/issue19527 @@ -373,17 +345,6 @@ Patch141: 00141-fix-tests_with_COUNT_ALLOCS.patch # Sent upstream as http://bugs.python.org/issue12872 Patch143: 00143-tsc-on-ppc.patch -# 00144 # -# (Optionally) disable the gdbm module: -# python.spec's -# Patch144: 00144-no-gdbm.patch -# is not needed in python3.spec - -# 00145 # -# python.spec's -# Patch145: 00145-force-sys-platform-to-be-linux2.patch -# is upstream for Python 3 as of 3.2.2 - # 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 @@ -408,20 +369,6 @@ Patch143: 00143-tsc-on-ppc.patch # implementation and OpenSSL still doesn't support it. For now, they're harmless. Patch146: 00146-hashlib-fips.patch -# 00147 # -# Add a sys._debugmallocstats() function -# Sent upstream as http://bugs.python.org/issue14785 -# Upstream as of Python 3.3.0 -# Patch147: 00147-add-debug-malloc-stats.patch - -# 00148 # -# Upstream as of Python 3.2.3: -# Patch148: 00148-gdbm-1.9-magic-values.patch - -# 00149 # -# Upstream as of Python 3.2.3: -# Patch149: 00149-backport-issue11254-pycache-bytecompilation-fix.patch - # 00150 # # temporarily disable rAssertAlmostEqual in test_cmath on PPC (bz #750811) # caused by a glibc bug. This patch can be removed when we have a glibc with @@ -429,42 +376,12 @@ Patch146: 00146-hashlib-fips.patch # http://sourceware.org/bugzilla/show_bug.cgi?id=13472 Patch150: 00150-disable-rAssertAlmostEqual-cmath-on-ppc.patch -# 00151 # -# python.spec had: -# Patch151: 00151-fork-deadlock.patch - -# 00152 # -# Fix a regex in test_gdb so that it doesn't choke when gdb provides a full -# path to Python/bltinmodule.c: -# Committed upstream as 77824:abcd29c9a791 as part of fix for -# http://bugs.python.org/issue12605 -# 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": -# Not yet sent upstream -# Upstream as of 3.4.3 -# 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): -# Upsream as of 3.4.3 -# 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 @@ -481,14 +398,6 @@ Patch155: 00155-avoid-ctypes-thunks.patch # (rhbz#697470) Patch157: 00157-uid-gid-overflows.patch -# 00158 # -# Upstream as of Python 3.3.1 - -# 00159 # -# Patch159: 00159-correct-libdb-include-path.patch -# in python.spec -# TODO: python3 status? - # 00160 # # Python 3.3 added os.SEEK_DATA and os.SEEK_HOLE, which may be present in the # header files in the build chroot, but may not be supported in the running @@ -497,12 +406,6 @@ Patch157: 00157-uid-gid-overflows.patch # Not yet sent upstream Patch160: 00160-disable-test_fs_holes-in-rpm-build.patch -# 00161 # -# (Was only needed for Python 3.3.0b1) - -# 00162 # -# (Was only needed for Python 3.3.0b1) - # 00163 # # Some tests within test_socket fail intermittently when run inside Koji; # disable them using unittest._skipInRpmBuild @@ -515,31 +418,6 @@ Patch163: 00163-disable-parts-of-test_socket-in-rpm-build.patch # disable those tests so that rebuilds on PPC can continue Patch164: 00164-disable-interrupted_write-tests-on-ppc.patch -# 00165 # -# python.spec has: -# Patch165: 00165-crypt-module-salt-backport.patch -# which is a backport from 3.3 and thus not relevant to "python3" - -# 00166 # -# Patch166: 00166-fix-fake-repr-in-gdb-hooks.patch -# in python.spec -# TODO: python3 status? - -# 00167 # -# Patch167: 00167-disable-stack-navigation-tests-when-optimized-in-test_gdb.patch -# in python.spec -# TODO: python3 status? - -# 00168 # -# Patch168: 00168-distutils-cflags.patch -# in python.spec -# TODO: python3 status? - -# 00169 # -# Patch169: 00169-avoid-implicit-usage-of-md5-in-multiprocessing.patch -# in python.spec -# TODO: python3 status? - # 00170 # # In debug builds, try to print repr() when a C-level assert fails in the # garbage collector (typically indicating a reference-counting error @@ -551,37 +429,11 @@ Patch164: 00164-disable-interrupted_write-tests-on-ppc.patch # (rhbz#850013 Patch170: 00170-gc-assertions.patch -# 00171 # -# python.spec had: -# Patch171: 00171-raise-correct-exception-when-dev-urandom-is-missing.patch -# TODO: python3 status? - -# 00172 # -# python.spec had: -# Patch172: 00172-use-poll-for-multiprocessing-socket-connection.patch -# TODO: python3 status? - # 00173 # # Workaround for ENOPROTOOPT seen in Koji withi test.support.bind_port() # (rhbz#913732) Patch173: 00173-workaround-ENOPROTOOPT-in-bind_port.patch -# 00174 # -# Patch174: 00174-fix-for-usr-move.patch -# TODO: python3 status? - -# 00175 # -# Upstream as of Python 3.3.2 -# Patch175: 00175-fix-configure-Wformat.patch - -# 00176 # -# Fixed upstream as of Python 3.3.1 -# Patch176: 00176-upstream-issue16754-so-extension.patch - -# 00177 # -# Fixed upstream as of Python 3.4.0.b2 -# Patch177: 00177-platform-unicode.patch - # 00178 # # Don't duplicate various FLAGS in sysconfig values # http://bugs.python.org/issue17679 @@ -602,19 +454,6 @@ Patch179: 00179-dont-raise-error-on-gdb-corrupted-frames-in-backtrace.patch # Not appropriate for upstream, Fedora-specific naming Patch180: 00180-python-add-support-for-ppc64p7.patch -# 00181 # -# python.spec has -# Patch181: 00181-allow-arbitrary-timeout-in-condition-wait.patch -# Does not affect python3 - -# 00182 # -# Fixed upstream as of Python 3.3.2 -# Patch182: 00182-fix-test_gdb-test_threads.patch - -# 00183 # -# Fixed upstream as of Python 3.4.0a4 -# 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 @@ -623,10 +462,6 @@ Patch180: 00180-python-add-support-for-ppc64p7.patch # We patch this by also accepting "#define ffi_wrapper_h" Patch184: 00184-ctypes-should-build-with-libffi-multilib-wrapper.patch -# 00185 # -# Fixed upstream as of Python 3.4.0a4 -# Patch185: 00185-CVE-2013-4238-hostname-check-bypass-in-SSL-module.patch - # 00186 # # Fix for https://bugzilla.redhat.com/show_bug.cgi?id=1023607 # Previously, this fixed a problem where some *.py files were not being @@ -636,10 +471,6 @@ Patch184: 00184-ctypes-should-build-with-libffi-multilib-wrapper.patch # This was fixed upstream, but the test hasn't been merged yet, so we keep it Patch186: 00186-dont-raise-from-py_compile.patch -# 00187 # -# Fixed upstream as of Python 3.4.0b1 -# Patch187: 00187-remove-pthread-atfork.patch - # 00188 # # Downstream only patch that should be removed when we compile all guaranteed # hashlib algorithms properly. The problem is this: @@ -664,48 +495,15 @@ Patch188: 00188-fix-lib2to3-tests-when-hashlib-doesnt-compile-properly.patch Patch189: 00189-add-rewheel-module.patch %endif -# 00190 # -# -# Fix tests with SQLite >= 3.8.4 -# http://bugs.python.org/issue20901 -# http://hg.python.org/cpython/rev/4d626a9df062 -# FIXED UPSTREAM -# Patch190: 00190-fix-tests-with-sqlite-3.8.4.patch - -# 00193 -# -# Skip correct number of *.pyc file bytes in ModuleFinder.load_module -# rhbz#1060338 -# http://bugs.python.org/issue20778 -# FIXED UPSTREAM -# Patch193: 00193-skip-correct-num-of-pycfile-bytes-in-modulefinder.patch - # Tests requiring SIGHUP to work don't work in Koji # see rhbz#1088233 Patch194: temporarily-disable-tests-requiring-SIGHUP.patch -# 00195 -# -# Don't declare Werror=declaration-after-statement for extension -# modules through setup.py -# http://bugs.python.org/issue21121 -# FIXED UPSTREAM -# Patch195: 00195-dont-add-Werror-declaration-after-statement.patch - # 00196 # # Fix test_gdb failure on ppc64le Patch196: 00196-test-gdb-match-addr-before-builtin.patch -# 00197 -# -# The CGIHTTPServer Python module did not properly handle URL-encoded -# path separators in URLs. This may have enabled attackers to disclose a CGI -# script's source code or execute arbitrary scripts in the server's -# document root. -# FIXED UPSTREAM -# Patch197: 00197-fix-CVE-2014-4650.patch - # 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 @@ -723,19 +521,9 @@ Patch200: 00200-gettext-plural-fix.patch # Note: Backported from scl Patch201: 00201-fix-memory-leak-in-gdbm.patch -# 00202 # -# Fixes undefined behaviour in faulthandler which caused test to hang on x86_64 -# http://bugs.python.org/issue23433 -# FIXED UPSTREAM -#Patch202: 00202-fix-undefined-behaviour-in-faulthandler.patch - # test_threading fails in koji dues to it's handling of signals Patch203: 00203-disable-threading-test-koji.patch -# openssl requires DH keys to be > 768bits -# FIXED UPSTREAM -# Patch204: 00204-increase-dh-keys-size.patch - # LIBPL variable in makefile takes LIBPL from configure.ac # but the LIBPL variable defined there doesn't respect libdir macro Patch205: 00205-make-libpl-respect-lib64.patch @@ -943,7 +731,6 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en # Apply patches: # %patch1 -p1 -# 3: upstream as of Python 3.3.1 %if 0%{?with_systemtap} %patch55 -p1 -b .systemtap @@ -956,9 +743,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch111 -p1 -# 112: not for python3 %patch113 -p1 -# 00114: Upstream as of Python 3.4.0.b2 %patch125 -p1 -b .less-verbose-COUNT_ALLOCS @@ -967,83 +752,42 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %endif %patch132 -p1 -# 00133: not for python3 %patch134 -p1 %patch135 -p1 -# 00136: not for python3 %patch137 -p1 -# 00138: not for python3 %ifarch %{arm} %patch139 -p1 %patch140 -p1 %endif -# 00140: not for python3 %patch141 -p1 %patch143 -p1 -b .tsc-on-ppc -# 00144: not for python3 -# 00145: not for python3 %patch146 -p1 -# 00147: upstream as of Python 3.3.0 -# 00148: upstream as of Python 3.2.3 -# 00149: upstream as of Python 3.2.3 %ifarch ppc %{power64} %patch150 -p1 %endif -# 00151: not for python3 -# 00152: upstream as of Python 3.3.0b2 -# 00153: upstream as of Python 3.4.3 -# 00154: not for this branch %patch155 -p1 -# 00156: upstream as of 3.4.3 %patch157 -p1 -#00158: FIXME -#00159: FIXME %patch160 -p1 -# 00161: was only needed for Python 3.3.0b1 -# 00162: was only needed for Python 3.3.0b1 %patch163 -p1 %ifarch ppc %{power64} %patch164 -p1 %endif -#00165: TODO -#00166: TODO -#00167: TODO -#00168: TODO -#00169: TODO -#00170: TODO -#00171: TODO -#00172: TODO %patch173 -p1 -#00174: TODO -# 00175: upstream as of Python 3.3.2 -# 00176: upstream as of Python 3.3.1 -# 00177: upstream as of Python 3.4.0.b2 %patch178 -p1 %patch179 -p1 %patch180 -p1 -# 00181: not for python3 -# 00182: upstream as of Python 3.3.2 -# 00183 upstream as of Python 3.4.0a4 %patch184 -p1 -# 00185 upstream as of Python 3.4.0a4 %patch186 -p1 -# 00187: upstream as of Python 3.4.0b1 %patch188 -p1 %if 0%{with_rewheel} %patch189 -p1 %endif -# 00190: upstream as of Python 3.4.1 -# 00193: upstream as of Python 3.4.1 %patch194 -p1 -# 00195: upstream as of Python 3.4.2 %patch196 -p1 -# 00197: upstream as of Python 3.4.2 %patch199 -p1 -# 00202: upstream as of 3.5.0b3 %patch203 -p1 -# 00204: upstream as of 3.5.0b3 %patch205 -p1 %patch206 -p1 %patch207 -p1 From 19aade22cbfa57dc500f5fa82229b4b9ed0b4c30 Mon Sep 17 00:00:00 2001 From: Robert Kuska Date: Mon, 14 Dec 2015 15:57:16 +0100 Subject: [PATCH 231/416] [cleanup] Remove COUNT_ALLOCS patches, see rhbz#1291325 --- 00113-more-configuration-flags.patch | 50 -------- 00125-less-verbose-COUNT_ALLOCS.patch | 21 ---- ...fix-COUNT_ALLOCS-failure-in-test_sys.patch | 21 ---- ...t-within-test_weakref-in-debug-build.patch | 17 --- 00141-fix-tests_with_COUNT_ALLOCS.patch | 113 ------------------ python3.spec | 45 ------- 6 files changed, 267 deletions(-) delete mode 100644 00113-more-configuration-flags.patch delete mode 100644 00125-less-verbose-COUNT_ALLOCS.patch delete mode 100644 00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch delete mode 100644 00135-fix-test-within-test_weakref-in-debug-build.patch delete mode 100644 00141-fix-tests_with_COUNT_ALLOCS.patch diff --git a/00113-more-configuration-flags.patch b/00113-more-configuration-flags.patch deleted file mode 100644 index 1067af1..0000000 --- a/00113-more-configuration-flags.patch +++ /dev/null @@ -1,50 +0,0 @@ -diff -up Python-3.3.0b1/configure.ac.more-configuration-flags Python-3.3.0b1/configure.ac ---- Python-3.3.0b1/configure.ac.more-configuration-flags 2012-07-20 13:25:33.232864839 -0400 -+++ Python-3.3.0b1/configure.ac 2012-07-20 13:25:33.314863815 -0400 -@@ -2585,6 +2585,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-3.3.0b1/pyconfig.h.in.more-configuration-flags Python-3.3.0b1/pyconfig.h.in ---- Python-3.3.0b1/pyconfig.h.in.more-configuration-flags 2012-07-20 13:25:33.000000000 -0400 -+++ Python-3.3.0b1/pyconfig.h.in 2012-07-20 13:26:02.826494869 -0400 -@@ -12,6 +12,12 @@ - support for AIX C++ shared extension modules. */ - #undef AIX_GENUINE_CPLUSPLUS - -+/* 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 C doubles are 64-bit IEEE 754 binary format, stored in ARM - mixed-endian order (byte order 45670123) */ - #undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 diff --git a/00125-less-verbose-COUNT_ALLOCS.patch b/00125-less-verbose-COUNT_ALLOCS.patch deleted file mode 100644 index fea9a4e..0000000 --- a/00125-less-verbose-COUNT_ALLOCS.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -up Python-3.5.0b3/Python/pylifecycle.c.ms Python-3.5.0b3/Python/pylifecycle.c ---- Python-3.5.0b3/Python/pylifecycle.c.ms 2015-07-08 10:12:40.470623896 +0200 -+++ Python-3.5.0b3/Python/pylifecycle.c 2015-07-08 10:13:50.141169162 +0200 -@@ -612,7 +612,16 @@ 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 - /* dump hash stats */ - _PyHash_Fini(); 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 5fa9bd4..0000000 --- a/00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -up Python-3.3.0b2/Lib/test/test_sys.py.fix-COUNT_ALLOCS-failure-in-test_sys Python-3.3.0b2/Lib/test/test_sys.py ---- Python-3.3.0b2/Lib/test/test_sys.py.fix-COUNT_ALLOCS-failure-in-test_sys 2012-08-11 02:54:16.000000000 -0400 -+++ Python-3.3.0b2/Lib/test/test_sys.py 2012-08-13 14:50:15.253720597 -0400 -@@ -835,12 +835,17 @@ class SizeofTest(unittest.TestCase): - # type - # static type: PyTypeObject - s = vsize('P2n15Pl4Pn9Pn11PIP') -+ # COUNT_ALLOCS adds a further 3 Py_ssize_t and 2 pointers: -+ if hasattr(sys, 'getcounts'): -+ s += struct.calcsize('3P2P') - check(int, s) - # (PyTypeObject + PyAsyncMethods + PyNumberMethods + PyMappingMethods + - # PySequenceMethods + PyBufferProcs + 4P) - s = vsize('P2n17Pl4Pn9Pn11PIP') + struct.calcsize('34P 3P 3P 10P 2P 4P') - # Separate block for PyDictKeysObject with 4 entries - s += struct.calcsize("2nPn") + 4*struct.calcsize("n2P") -+ if hasattr(sys, 'getcounts'): -+ s += struct.calcsize('3P2P') - # class - class newstyleclass(object): pass - check(newstyleclass, s) diff --git a/00135-fix-test-within-test_weakref-in-debug-build.patch b/00135-fix-test-within-test_weakref-in-debug-build.patch deleted file mode 100644 index 6ed7801..0000000 --- a/00135-fix-test-within-test_weakref-in-debug-build.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff -up Python-3.2b2/Lib/test/test_weakref.py.test-weakref-COUNT_ALLOCS_fix Python-3.2b2/Lib/test/test_weakref.py ---- Python-3.2b2/Lib/test/test_weakref.py.test-weakref-COUNT_ALLOCS_fix 2010-12-28 20:33:46.963364990 -0500 -+++ Python-3.2b2/Lib/test/test_weakref.py 2010-12-28 20:35:44.115935248 -0500 -@@ -583,9 +583,10 @@ class ReferencesTestCase(TestBase): - # been cleared without their callbacks executing. OTOH, the weakref - # to C is bound to a function local (wr), and wasn't trash, so that - # callback should have been invoked when C went away. -- self.assertEqual(alist, ["C went away"]) -- # The remaining weakref should be dead now (its callback ran). -- self.assertEqual(wr(), None) -+ if not hasattr(sys, 'getcounts'): -+ self.assertEqual(alist, ["C went away"]) -+ # The remaining weakref should be dead now (its callback ran). -+ self.assertEqual(wr(), None) - - del alist[:] - gc.collect() diff --git a/00141-fix-tests_with_COUNT_ALLOCS.patch b/00141-fix-tests_with_COUNT_ALLOCS.patch deleted file mode 100644 index 96a2fbf..0000000 --- a/00141-fix-tests_with_COUNT_ALLOCS.patch +++ /dev/null @@ -1,113 +0,0 @@ -diff -r e245b0d7209b Lib/test/test_gc.py ---- a/Lib/test/test_gc.py Sun Oct 20 02:01:29 2013 -0700 -+++ b/Lib/test/test_gc.py Fri Nov 08 13:25:29 2013 +0100 -@@ -127,10 +127,16 @@ - 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) -+ if hasattr(sys, 'getcounts'): -+ self.assertEqual(gc.collect(), 0) -+ else: -+ self.assertNotEqual(gc.collect(), 0) - self.assertEqual(gc.collect(), 0) - - def test_method(self): -@@ -618,6 +624,8 @@ - stderr = run_command(code % "gc.DEBUG_SAVEALL") - self.assertNotIn(b"uncollectable objects at shutdown", stderr) - -+ @unittest.skipIf(hasattr(sys, 'getcounts'), -+ 'types are immortal if COUNT_ALLOCS is used') - def test_gc_main_module_at_shutdown(self): - # Create a reference cycle through the __main__ module and check - # it gets collected at interpreter shutdown. -@@ -632,6 +640,8 @@ - rc, out, err = assert_python_ok('-c', code) - self.assertEqual(out.strip(), b'__del__ called') - -+ @unittest.skipIf(hasattr(sys, 'getcounts'), -+ 'types are immortal if COUNT_ALLOCS is used') - def test_gc_ordinary_module_at_shutdown(self): - # Same as above, but with a non-__main__ module. - with temp_dir() as script_dir: -diff -r e245b0d7209b Lib/test/test_module.py ---- a/Lib/test/test_module.py Sun Oct 20 02:01:29 2013 -0700 -+++ b/Lib/test/test_module.py Fri Nov 08 13:25:29 2013 +0100 -@@ -81,6 +81,8 @@ - gc_collect() - self.assertEqual(f().__dict__["bar"], 4) - -+ @unittest.skipIf(hasattr(sys, 'getcounts'), -+ 'types are immortal if COUNT_ALLOCS is used') - def test_clear_dict_in_ref_cycle(self): - destroyed = [] - m = ModuleType("foo") -@@ -96,6 +98,8 @@ - gc_collect() - self.assertEqual(destroyed, [1]) - -+ @unittest.skipIf(hasattr(sys, 'getcounts'), -+ 'types are immortal if COUNT_ALLOCS is used') - def test_weakref(self): - m = ModuleType("foo") - wr = weakref.ref(m) -@@ -190,6 +194,8 @@ - self.assertEqual(r[-len(ends_with):], ends_with, - '{!r} does not end with {!r}'.format(r, ends_with)) - -+ @unittest.skipIf(hasattr(sys, 'getcounts'), -+ 'skipping since COUNT_ALLOCS was used, see issue19527') - def test_module_finalization_at_shutdown(self): - # Module globals and builtins should still be available during shutdown - rc, out, err = assert_python_ok("-c", "from test import final_a") ---- a/Lib/test/test_io.py.orig 2014-01-09 14:43:44.000000000 +0100 -+++ b/Lib/test/test_io.py 2014-01-09 14:50:30.839597351 +0100 -@@ -2611,6 +2611,8 @@ - """.format(iomod=iomod, kwargs=kwargs) - return assert_python_ok("-c", code) - -+ @unittest.skipIf(hasattr(sys, 'getrefcount'), -+ 'types are immortal if COUNT_ALLOCS is used') - def test_create_at_shutdown_without_encoding(self): - rc, out, err = self._check_create_at_shutdown() - if err: -@@ -2621,6 +2623,8 @@ - else: - self.assertEqual("ok", out.decode().strip()) - -+ @unittest.skipIf(hasattr(sys, 'getrefcount'), -+ 'types are immortal if COUNT_ALLOCS is used') - def test_create_at_shutdown_with_encoding(self): - rc, out, err = self._check_create_at_shutdown(encoding='utf-8', - errors='strict') ---- a/Lib/test/test_logging.py.orig 2014-01-09 14:53:07.016388198 +0100 -+++ b/Lib/test/test_logging.py 2014-01-09 14:54:25.654282973 +0100 -@@ -3398,6 +3398,8 @@ - logging.setLoggerClass(logging.Logger) - self.assertEqual(logging.getLoggerClass(), logging.Logger) - -+ @unittest.skipIf(hasattr(sys, 'getcounts'), -+ 'types are immortal if COUNT_ALLOCS is used') - def test_logging_at_shutdown(self): - # Issue #20037 - code = """if 1: - ---- a/Lib/test/test_warnings/__init__.py.orig 2014-01-09 15:10:12.454997100 +0100 -+++ b/Lib/test/test_warnings/__init__.py 2014-01-09 15:11:14.028913478 +0100 -@@ -780,6 +780,8 @@ - assert_python_ok('-c', 'pass', '-W', 'always', PYTHONPATH=cwd) - - class FinalizationTest(unittest.TestCase): -+ @unittest.skipIf(hasattr(sys, 'getcounts'), -+ 'types are immortal if COUNT_ALLOCS is used') - def test_finalization(self): - # Issue #19421: warnings.warn() should not crash - # during Python finalization diff --git a/python3.spec b/python3.spec index 91b2633..437a516 100644 --- a/python3.spec +++ b/python3.spec @@ -267,22 +267,6 @@ Patch104: 00104-lib64-fix-for-test_install.patch # Downstream only: not appropriate for upstream Patch111: 00111-no-static-lib.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 - -# 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 - # 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 @@ -308,18 +292,6 @@ Patch132: 00132-add-rpmbuild-hooks-to-unittest.patch # 00133-skip-test_dl.patch is not relevant for python3: the "dl" module no # longer exists -# 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 # -# test_weakref's test_callback_in_cycle_resurrection doesn't work with -# COUNT_ALLOCS, as the metrics keep "C" alive. Work around this for our -# debug build: -# Not yet sent upstream -Patch135: 00135-fix-test-within-test_weakref-in-debug-build.patch - # 00137 # # Some tests within distutils fail when run in an rpmbuild: Patch137: 00137-skip-distutils-tests-that-fail-in-rpmbuild.patch @@ -332,13 +304,6 @@ Patch139: 00139-skip-test_float-known-failure-on-arm.patch # ideally short lived patch disabling a test thats fragile on different arches Patch140: python3-arm-skip-failing-fragile-test.patch -# 00141 # -# Fix tests for case when tests for case when configured with -# COUNT_ALLOCS (debug build): http://bugs.python.org/issue19527 -# Applies to: test_gc, test_module, test_io, test_logging, test_warnings, -# test_threading -Patch141: 00141-fix-tests_with_COUNT_ALLOCS.patch - # 00143 # # Fix the --with-tsc option on ppc64, and rework it on 32-bit ppc to avoid # aliasing violations (rhbz#698726) @@ -740,26 +705,16 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch102 -p1 %patch104 -p1 %endif - - %patch111 -p1 -%patch113 -p1 - -%patch125 -p1 -b .less-verbose-COUNT_ALLOCS - %ifarch ppc %{power64} %patch131 -p1 %endif - %patch132 -p1 -%patch134 -p1 -%patch135 -p1 %patch137 -p1 %ifarch %{arm} %patch139 -p1 %patch140 -p1 %endif -%patch141 -p1 %patch143 -p1 -b .tsc-on-ppc %patch146 -p1 %ifarch ppc %{power64} From 5182e811f0cb3d455015cd121b42b85e842ddcf8 Mon Sep 17 00:00:00 2001 From: Robert Kuska Date: Mon, 14 Dec 2015 15:57:49 +0100 Subject: [PATCH 232/416] Enable tests --- python3.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 437a516..02b3e63 100644 --- a/python3.spec +++ b/python3.spec @@ -83,7 +83,7 @@ %global with_computed_gotos yes # Turn this to 0 to turn off the "check" phase: -%global run_selftest_suite 0 +%global run_selftest_suite 1 # We want to byte-compile the .py files within the packages using the new # python3 binary. From bbc4c0dbf76bd9bc0d3b89d795244a39dcde02d9 Mon Sep 17 00:00:00 2001 From: Robert Kuska Date: Mon, 14 Dec 2015 17:00:16 +0100 Subject: [PATCH 233/416] [cleanup] Remove autotooling and its patch rhbz#1291325 --- python3.spec | 84 ---------------------------------------------------- 1 file changed, 84 deletions(-) diff --git a/python3.spec b/python3.spec index 02b3e63..b874b81 100644 --- a/python3.spec +++ b/python3.spec @@ -106,34 +106,6 @@ # pyc/pyo files) -# We need to get a newer configure generated out of configure.in for the following -# patches: -# patch 55 (systemtap) -# patch 113 (more config flags) -# -# 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 # ================== @@ -502,33 +474,6 @@ Patch206: 00206-remove-hf-from-arm-triplet.patch # Python.h header to fix a compilation error with OpenMP. Patch207: 00207-hide-atomic-symbols.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 relevant 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: -Patch5000: 05000-autotool-intermediates.patch - # add correct arch for ppc64/ppc64le # it should be ppc64le-linux-gnu/ppc64-linux-gnu instead powerpc64le-linux-gnu/powerpc64-linux-gnu Patch5001: python3-powerppc-arch.patch @@ -757,12 +702,6 @@ sed --in-place \ --expression="s|http://docs.python.org/library|http://docs.python.org/%{pybasever}/library|g" \ Lib/pydoc.py || exit 1 -%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 - %patch5001 -p1 # ====================================================== @@ -779,29 +718,6 @@ export LINKCC="gcc" export CFLAGS="$CFLAGS `pkg-config --cflags openssl`" export LDFLAGS="$RPM_LD_FLAGS `pkg-config --libs-only-L openssl`" -%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: -autoreconf - -# 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() { From e248727c4f0963582cb34a7b1b26f929839419ac Mon Sep 17 00:00:00 2001 From: Robert Kuska Date: Mon, 14 Dec 2015 19:59:02 +0100 Subject: [PATCH 234/416] Update to 3.5.1, remove unused patches (199, 207) --- 00055-systemtap.patch | 2 +- ...lter-tests-to-reflect-sslv3-disabled.patch | 48 -------------- 00207-hide-atomic-symbols.patch | 63 ------------------- python3.spec | 20 ++---- 4 files changed, 7 insertions(+), 126 deletions(-) delete mode 100644 00199-alter-tests-to-reflect-sslv3-disabled.patch delete mode 100644 00207-hide-atomic-symbols.patch diff --git a/00055-systemtap.patch b/00055-systemtap.patch index 5d92895..0ab0387 100644 --- a/00055-systemtap.patch +++ b/00055-systemtap.patch @@ -667,9 +667,9 @@ diff -up Python-3.3.0rc2/Makefile.pre.in.systemtap Python-3.3.0rc2/Makefile.pre. # Header files @@ -1345,6 +1354,7 @@ clean: pycremoval - -rm -f pybuilddir.txt -rm -f Lib/lib2to3/*Grammar*.pickle -rm -f Programs/_testembed Programs/_freeze_importlib + -rm -rf build + -rm -f $(srcdir)/Python/pysystemtap.h profile-removal: 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 68df8d5..0000000 --- a/00199-alter-tests-to-reflect-sslv3-disabled.patch +++ /dev/null @@ -1,48 +0,0 @@ -diff -up Python-3.4.2/Lib/test/test_ssl.py.ssl Python-3.4.2/Lib/test/test_ssl.py ---- Python-3.4.2/Lib/test/test_ssl.py.ssl 2014-12-11 12:25:21.886928225 +0100 -+++ Python-3.4.2/Lib/test/test_ssl.py 2014-12-11 12:25:00.284746529 +0100 -@@ -674,10 +674,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(): -@@ -2186,7 +2180,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 -up Python-3.4.3/Lib/test/test_ssl.py.foo Python-3.4.3/Lib/test/test_ssl.py ---- Python-3.4.3/Lib/test/test_ssl.py.foo 2015-03-12 10:08:58.268065970 +0100 -+++ Python-3.4.3/Lib/test/test_ssl.py 2015-03-12 10:10:09.733347118 +0100 -@@ -2168,17 +2168,17 @@ 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) - diff --git a/00207-hide-atomic-symbols.patch b/00207-hide-atomic-symbols.patch deleted file mode 100644 index d8871a0..0000000 --- a/00207-hide-atomic-symbols.patch +++ /dev/null @@ -1,63 +0,0 @@ - -# HG changeset patch -# User Victor Stinner -# Date 1442581594 -7200 -# Node ID d4fcb362f7c66b25b22ddc0d27db0cc96acc727b -# Parent d04a0954e142f873adee88ec5bc1c1d81cd46bc4 -Issue #25150: Hide the private _Py_atomic_xxx symbols from the public -Python.h header to fix a compilation error with OpenMP. PyThreadState_GET() -becomes an alias to PyThreadState_Get() to avoid ABI incompatibilies. - -It is important that the _PyThreadState_Current variable is always accessed -with the same implementation of pyatomic.h. Use the PyThreadState_Get() -function so extension modules will all reuse the same implementation. - -diff --git a/Include/pyatomic.h b/Include/pyatomic.h ---- a/Include/pyatomic.h -+++ b/Include/pyatomic.h -@@ -1,8 +1,6 @@ --/* Issue #23644: is incompatible with C++, see: -- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60932 */ --#if !defined(Py_LIMITED_API) && !defined(__cplusplus) - #ifndef Py_ATOMIC_H - #define Py_ATOMIC_H -+#ifdef Py_BUILD_CORE - - #include "dynamic_annotations.h" - -@@ -248,5 +246,5 @@ static __inline__ void - #define _Py_atomic_load_relaxed(ATOMIC_VAL) \ - _Py_atomic_load_explicit(ATOMIC_VAL, _Py_memory_order_relaxed) - -+#endif /* Py_BUILD_CORE */ - #endif /* Py_ATOMIC_H */ --#endif /* Py_LIMITED_API */ -diff --git a/Include/pystate.h b/Include/pystate.h ---- a/Include/pystate.h -+++ b/Include/pystate.h -@@ -177,20 +177,13 @@ PyAPI_FUNC(int) PyThreadState_SetAsyncEx - /* Variable and macro for in-line access to current thread state */ - - /* Assuming the current thread holds the GIL, this is the -- PyThreadState for the current thread. -- -- Issue #23644: pyatomic.h is incompatible with C++ (yet). Disable -- PyThreadState_GET() optimization: declare it as an alias to -- PyThreadState_Get(), as done for limited API. */ --#if !defined(Py_LIMITED_API) && !defined(__cplusplus) -+ PyThreadState for the current thread. */ -+#ifdef Py_BUILD_CORE - PyAPI_DATA(_Py_atomic_address) _PyThreadState_Current; --#endif -- --#if defined(Py_DEBUG) || defined(Py_LIMITED_API) || defined(__cplusplus) --#define PyThreadState_GET() PyThreadState_Get() -+# define PyThreadState_GET() \ -+ ((PyThreadState*)_Py_atomic_load_relaxed(&_PyThreadState_Current)) - #else --#define PyThreadState_GET() \ -- ((PyThreadState*)_Py_atomic_load_relaxed(&_PyThreadState_Current)) -+# define PyThreadState_GET() PyThreadState_Get() - #endif - - typedef diff --git a/python3.spec b/python3.spec index b874b81..d9c3414 100644 --- a/python3.spec +++ b/python3.spec @@ -111,8 +111,8 @@ # ================== Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 -Version: %{pybasever}.0 -Release: 5%{?dist} +Version: %{pybasever}.1 +Release: 1%{?dist} License: Python Group: Development/Languages @@ -441,11 +441,6 @@ Patch194: temporarily-disable-tests-requiring-SIGHUP.patch # Fix test_gdb failure on ppc64le Patch196: 00196-test-gdb-match-addr-before-builtin.patch -# 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 - # 00200 # # Fix for gettext plural form headers (lines that begin with "#") # Note: Backported from scl @@ -469,11 +464,6 @@ Patch205: 00205-make-libpl-respect-lib64.patch # by debian but fedora infra uses only eabi without hf Patch206: 00206-remove-hf-from-arm-triplet.patch -# https://bugs.python.org/issue25150 -# Hide the private _Py_atomic_xxx symbols from the public -# Python.h header to fix a compilation error with OpenMP. -Patch207: 00207-hide-atomic-symbols.patch - # add correct arch for ppc64/ppc64le # it should be ppc64le-linux-gnu/ppc64-linux-gnu instead powerpc64le-linux-gnu/powerpc64-linux-gnu Patch5001: python3-powerppc-arch.patch @@ -686,11 +676,9 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch194 -p1 %patch196 -p1 -%patch199 -p1 %patch203 -p1 %patch205 -p1 %patch206 -p1 -%patch207 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1563,6 +1551,10 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon Dec 14 2015 Robert Kuska - 3.5.1-1 +- Update to 3.5.1 +- Removed patch 199 and 207 (upstream) + * Sun Nov 15 2015 Robert Kuska - 3.5.0-5 - Remove versioned libpython from devel package From e06dbe093e3fe28f919a9d9f0d9e684155de6f7c Mon Sep 17 00:00:00 2001 From: Robert Kuska Date: Mon, 14 Dec 2015 20:01:49 +0100 Subject: [PATCH 235/416] Add source for 3.5.1 --- sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources b/sources index 3e50267..106fda6 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -d149d2812f10cbe04c042232e7964171 Python-3.5.0.tar.xz +e9ea6f2623fffcdd871b7b19113fde80 Python-3.5.1.tar.xz From e3c54b759572589a85d3771f86b2921810b8b114 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Mon, 21 Dec 2015 15:55:55 +0100 Subject: [PATCH 236/416] Avoid truncated _math.o files caused by parallel builds rhbz#1292461 disable failing test_with_pip (test.test_venv.EnsurePipTest) on ppc64* Use a larger stack size on ppc64 (rhbz#1292462) --- 00207-math-once.patch | 56 ++++++++++++++++++++++++ 00208-disable-test_with_pip-on-ppc.patch | 11 +++++ python3.spec | 17 +++++++ 3 files changed, 84 insertions(+) create mode 100644 00207-math-once.patch create mode 100644 00208-disable-test_with_pip-on-ppc.patch diff --git a/00207-math-once.patch b/00207-math-once.patch new file mode 100644 index 0000000..572ed59 --- /dev/null +++ b/00207-math-once.patch @@ -0,0 +1,56 @@ +--- Python-3.5.1/Makefile.pre.in.kh 2015-12-17 05:51:08.466546157 -0500 ++++ Python-3.5.1/Makefile.pre.in 2015-12-17 05:52:26.207761635 -0500 +@@ -587,11 +587,15 @@ pybuilddir.txt: $(BUILDPYTHON) + exit 1 ; \ + fi + ++# This is shared by the math and cmath modules ++Modules/_math.o: Modules/_math.c Modules/_math.h ++ $(CC) -c $(CCSHARED) $(PY_CORE_CFLAGS) -o $@ $< ++ + # Build the shared modules + # Under GNU make, MAKEFLAGS are sorted and normalized; the 's' for + # -s, --silent or --quiet is always the first char. + # Under BSD make, MAKEFLAGS might be " -s -v x=y". +-sharedmods: $(BUILDPYTHON) pybuilddir.txt ++sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o + @case "$$MAKEFLAGS" in \ + *\ -s*|s*) quiet="-q";; \ + *) quiet="";; \ +--- Python-3.5.1/Misc/NEWS.kh 2015-12-17 05:53:40.898929946 -0500 ++++ Python-3.5.1/Misc/NEWS 2015-12-17 05:54:28.599676136 -0500 +@@ -464,6 +464,10 @@ Build + - Issue #24986: It is now possible to build Python on Windows without errors + when external libraries are not available. + ++- Issue #24421: Compile Modules/_math.c once, before building extensions. ++ Previously it could fail to compile properly if the math and cmath builds ++ were concurrent. ++ + Windows + ------- + +--- Python-3.5.1/setup.py.kh 2015-12-17 06:38:30.950955607 -0500 ++++ Python-3.5.1/setup.py 2015-12-17 06:42:32.074722493 -0500 +@@ -582,13 +582,17 @@ class PyBuildExt(build_ext): + + # array objects + exts.append( Extension('array', ['arraymodule.c']) ) ++ ++ shared_math = 'Modules/_math.o' + # complex math library functions +- exts.append( Extension('cmath', ['cmathmodule.c', '_math.c'], +- depends=['_math.h'], ++ exts.append( Extension('cmath', ['cmathmodule.c'], ++ extra_objects=[shared_math], ++ depends=['_math.h', shared_math], + libraries=math_libs) ) + # math library functions, e.g. sin() +- exts.append( Extension('math', ['mathmodule.c', '_math.c'], +- depends=['_math.h'], ++ exts.append( Extension('math', ['mathmodule.c'], ++ extra_objects=[shared_math], ++ depends=['_math.h', shared_math], + libraries=math_libs) ) + + # time libraries: librt may be needed for clock_gettime() diff --git a/00208-disable-test_with_pip-on-ppc.patch b/00208-disable-test_with_pip-on-ppc.patch new file mode 100644 index 0000000..00b98ae --- /dev/null +++ b/00208-disable-test_with_pip-on-ppc.patch @@ -0,0 +1,11 @@ +diff -up Python-3.5.1/Lib/test/test_venv.py.1292467 Python-3.5.1/Lib/test/test_venv.py +--- Python-3.5.1/Lib/test/test_venv.py.1292467 2015-12-21 13:37:44.740190595 +0100 ++++ Python-3.5.1/Lib/test/test_venv.py 2015-12-21 13:40:25.707911828 +0100 +@@ -319,6 +319,7 @@ class EnsurePipTest(BaseTest): + + # Requesting pip fails without SSL (http://bugs.python.org/issue19744) + @unittest.skipIf(ssl is None, ensurepip._MISSING_SSL_MESSAGE) ++ @unittest.skip('rhbz#1292467') + def test_with_pip(self): + rmtree(self.env_dir) + with EnvironmentVarGuard() as envvars: diff --git a/python3.spec b/python3.spec index d9c3414..bb393e2 100644 --- a/python3.spec +++ b/python3.spec @@ -464,6 +464,15 @@ Patch205: 00205-make-libpl-respect-lib64.patch # by debian but fedora infra uses only eabi without hf Patch206: 00206-remove-hf-from-arm-triplet.patch +# Avoid truncated _math.o files caused by parallel builds +# modified version of https://bugs.python.org/issue24421 +# rhbz#1292461 +Patch207: 00207-math-once.patch + +# test_with_pip (test.test_venv.EnsurePipTest) fails on ppc64* +# rhbz#1292467 +Patch208: 00208-disable-test_with_pip-on-ppc.patch + # add correct arch for ppc64/ppc64le # it should be ppc64le-linux-gnu/ppc64-linux-gnu instead powerpc64le-linux-gnu/powerpc64-linux-gnu Patch5001: python3-powerppc-arch.patch @@ -679,6 +688,8 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch203 -p1 %patch205 -p1 %patch206 -p1 +%patch207 -p1 +%patch208 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -706,6 +717,7 @@ export LINKCC="gcc" export CFLAGS="$CFLAGS `pkg-config --cflags openssl`" export LDFLAGS="$RPM_LD_FLAGS `pkg-config --libs-only-L openssl`" + # Define a function, for how to perform a "build" of python for a given # configuration: BuildPython() { @@ -1087,6 +1099,11 @@ find %{buildroot} -type f -a -name "*.py" -print0 | \ PYTHONPATH="%{buildroot}%{_libdir}/python%{pybasever} %{buildroot}%{_libdir}/python%{pybasever}/site-packages" \ xargs -0 %{buildroot}%{_bindir}/python%{pybasever} %{SOURCE8} +# For ppc64 we need a larger stack than default (rhbz#1292462) +%ifarch %{power64} + ulimit -a + ulimit -s 16384 +%endif topdir=$(pwd) CheckPython() { From f8ddd4439059f7c43ad97cf8e94c0ab0b384c52f Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Mon, 21 Dec 2015 16:41:52 +0100 Subject: [PATCH 237/416] bump release --- python3.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index bb393e2..c520731 100644 --- a/python3.spec +++ b/python3.spec @@ -112,7 +112,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 1%{?dist} +Release: 2%{?dist} License: Python Group: Development/Languages From 1eeebcf2be36539fb2ace754bb55d272199b26b0 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Wed, 13 Jan 2016 12:03:23 -0700 Subject: [PATCH 238/416] Drop python3 macros, require python/python3-rpm-macros --- macros.python3.5 | 16 ---------------- python3.spec | 16 +++++++--------- 2 files changed, 7 insertions(+), 25 deletions(-) delete mode 100644 macros.python3.5 diff --git a/macros.python3.5 b/macros.python3.5 deleted file mode 100644 index a633c72..0000000 --- a/macros.python3.5 +++ /dev/null @@ -1,16 +0,0 @@ -%__python3 /usr/bin/python3 -%python3_sitelib %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") -%python3_sitearch %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") -%python3_version %(%{__python3} -c "import sys; sys.stdout.write(sys.version[:3])") -%python3_version_nodots %(%{__python3} -c "import sys; sys.stdout.write(sys.version[:3].replace('.',''))") -%py3dir %{_builddir}/python3-%{name}-%{version}-%{release} - -%py3_shbang_opts -s - -%py3_build() %{expand:\ -CFLAGS="%{optflags}" %{__python3} %{py_setup} %{?py_setup_args} build --executable="%{__python3} %{py3_shbang_opts}" %{?1}\ -} - -%py3_install() %{expand:\ -CFLAGS="%{optflags}" %{__python3} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?1}\ -} diff --git a/python3.spec b/python3.spec index c520731..927ca14 100644 --- a/python3.spec +++ b/python3.spec @@ -112,7 +112,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 2%{?dist} +Release: 3%{?dist} License: Python Group: Development/Languages @@ -188,10 +188,6 @@ Source1: find-provides-without-python-sonames.sh %global _use_internal_dependency_generator 0 %global __find_provides %{SOURCE1} -# Supply various useful macros for building python 3 modules: -# __python3, python3_sitelib, python3_sitearch -Source2: macros.python%{pybasever} - # Supply an RPM macro "py_byte_compile" for the python3-devel subpackage # to enable specfiles to selectively byte-compile individual files and paths # with different Python runtimes as necessary: @@ -520,8 +516,9 @@ Summary: Libraries and header files needed for Python 3 development Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: %{name}-libs%{?_isa} = %{version}-%{release} -BuildRequires: python-macros -Requires: python-macros +BuildRequires: python-rpm-macros +Requires: python-rpm-macros +Requires: python3-rpm-macros Conflicts: %{name} < %{version}-%{release} %description devel @@ -1012,7 +1009,6 @@ find %{buildroot} \ # Install macros for rpm: mkdir -p %{buildroot}/%{_rpmconfigdir}/macros.d/ -install -m 644 %{SOURCE2} %{buildroot}/%{_rpmconfigdir}/macros.d/ install -m 644 %{SOURCE3} %{buildroot}/%{_rpmconfigdir}/macros.d/ # Ensure that the curses module was linked against libncursesw.so, rather than @@ -1402,7 +1398,6 @@ rm -fr %{buildroot} %{_libdir}/pkgconfig/python-%{LDVERSION_optimized}.pc %{_libdir}/pkgconfig/python-%{pybasever}.pc %{_libdir}/pkgconfig/python3.pc -%{_rpmconfigdir}/macros.d/macros.python%{pybasever} %{_rpmconfigdir}/macros.d/macros.pybytecompile%{pybasever} %files tools @@ -1568,6 +1563,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Wed Jan 13 2016 Orion Poplwski - 3.5.1-2 +- Drop python3 macros, require python/python3-rpm-macros + * Mon Dec 14 2015 Robert Kuska - 3.5.1-1 - Update to 3.5.1 - Removed patch 199 and 207 (upstream) From aa74fec275a9889c70baee027e46a641c2f5af75 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 4 Feb 2016 21:30:47 +0000 Subject: [PATCH 239/416] - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild --- python3.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 927ca14..7016dca 100644 --- a/python3.spec +++ b/python3.spec @@ -112,7 +112,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 3%{?dist} +Release: 4%{?dist} License: Python Group: Development/Languages @@ -1563,6 +1563,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Thu Feb 04 2016 Fedora Release Engineering - 3.5.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + * Wed Jan 13 2016 Orion Poplwski - 3.5.1-2 - Drop python3 macros, require python/python3-rpm-macros From 82c3ceef41db9ec9ae702bffc6ccdbb6f3fe37c0 Mon Sep 17 00:00:00 2001 From: Robert Kuska Date: Wed, 24 Feb 2016 14:38:24 +0100 Subject: [PATCH 240/416] Provide python3-enum34 --- python3.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 7016dca..f905fe0 100644 --- a/python3.spec +++ b/python3.spec @@ -112,7 +112,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 4%{?dist} +Release: 5%{?dist} License: Python Group: Development/Languages @@ -507,6 +507,8 @@ Group: Development/Libraries # prevent "import pyexpat" from failing with a linker error if someone hasn't # yet upgraded expat: Requires: expat >= 2.1.0 +Provides: python3-enum34 = 1.0.4-5%{?dist} +Obsoletes: python3-enum34 < 1.0.4-5%{?dist} %description libs This package contains files used to embed Python 3 into applications. @@ -1563,6 +1565,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Wed Feb 24 2016 Robert Kuska - 3.5.1-5 +- Provide python3-enum34 + * Thu Feb 04 2016 Fedora Release Engineering - 3.5.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild From 60aba0a6b8ddcd68db99cf998574c79bf239f57c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 16 Feb 2016 18:22:04 +0100 Subject: [PATCH 241/416] Provide system python subpackages and macro Move some modules back to python3-libs --- find-provides-without-python-sonames.sh | 15 -- macros.systempython | 4 + python3.spec | 192 +++++++++++++++--------- 3 files changed, 123 insertions(+), 88 deletions(-) delete mode 100755 find-provides-without-python-sonames.sh create mode 100644 macros.systempython diff --git a/find-provides-without-python-sonames.sh b/find-provides-without-python-sonames.sh deleted file mode 100755 index 7a9e224..0000000 --- a/find-provides-without-python-sonames.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# The standard find-provides script -# adds provides lines for all SONAME directives in all shared libraries, -# even if those libraries are not in the LD_LIBRARY_PATH - -# This leads to the rpm having a redundant Provides "foo.so" for all of the -# various foo.so Python c modules - -# So we strip out all /usr/lib/python lines first, before running them through -# the standard script: -grep -v "/usr/lib/python" | grep -v "/usr/lib64/python" | \ - /usr/lib/rpm/redhat/find-provides - -exit 0 diff --git a/macros.systempython b/macros.systempython new file mode 100644 index 0000000..b7d1e91 --- /dev/null +++ b/macros.systempython @@ -0,0 +1,4 @@ +%system_python_abi %{expand: \ +%global __requires_exclude ^python\\\\(abi\\\\) = 3\\\\..$ +Requires: system-python(abi) = %{python3_version} +} diff --git a/python3.spec b/python3.spec index f905fe0..f10a160 100644 --- a/python3.spec +++ b/python3.spec @@ -112,7 +112,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 5%{?dist} +Release: 6%{?dist} License: Python Group: Development/Languages @@ -182,12 +182,6 @@ BuildRequires: python3-pip Source: http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz -# Avoid having various bogus auto-generated Provides lines for the various -# python c modules' SONAMEs: -Source1: find-provides-without-python-sonames.sh -%global _use_internal_dependency_generator 0 -%global __find_provides %{SOURCE1} - # Supply an RPM macro "py_byte_compile" for the python3-devel subpackage # to enable specfiles to selectively byte-compile individual files and paths # with different Python runtimes as necessary: @@ -211,6 +205,9 @@ Source7: pyfuntop.stp # Written by bkabrda Source8: check-pyc-and-pyo-timestamps.py +# A simple macro that enables packages to require system-python(abi) instead of python(abi) +Source9: macros.systempython + # Fixup distutils/unixccompiler.py to remove standard library path from rpath: # Was Patch0 in ivazquez' python3000 specfile: Patch1: Python-3.1.1-rpath.patch @@ -500,7 +497,7 @@ considerably, and a lot of deprecated features have finally been removed. %package libs Summary: Python 3 runtime libraries Group: Development/Libraries -#Requires: %{name} = %{version}-%{release} +Requires: system-python-libs%{?_isa} = %{version}-%{release} # 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 @@ -513,6 +510,29 @@ Obsoletes: python3-enum34 < 1.0.4-5%{?dist} %description libs This package contains files used to embed Python 3 into applications. +%package -n system-python +Summary: System Python executable +Group: Development/Libraries +Requires: system-python-libs%{?_isa} = %{version}-%{release} +Provides: system-python(abi) = %{pybasever} + +%description -n system-python +System Python TODO description + +%package -n system-python-libs +Summary: System Python runtime libraries +Group: Development/Libraries + +# Remove some requires so this does not pull python3 back +# TODO this does not work, whyyyyyyy? +#%%global __provides_exclude_from ^/usr/(lib|lib64)/python.*$ +%define __requires_exclude ^(/usr/bin/python3.*|python\\(abi\\) = 3\\..*)$ + +Requires: expat >= 2.1.0 + +%description -n system-python-libs +This package contains files used to embed System Python into applications. + %package devel Summary: Libraries and header files needed for Python 3 development Group: Development/Libraries @@ -598,7 +618,6 @@ can load its own extensions. %prep %setup -q -n Python-%{version}%{?prerel} -chmod +x %{SOURCE1} %if 0%{?with_systemtap} # Provide an example of usage of the tapset: @@ -1012,6 +1031,7 @@ find %{buildroot} \ # Install macros for rpm: mkdir -p %{buildroot}/%{_rpmconfigdir}/macros.d/ install -m 644 %{SOURCE3} %{buildroot}/%{_rpmconfigdir}/macros.d/ +install -m 644 %{SOURCE9} %{buildroot}/%{_rpmconfigdir}/macros.d/ # Ensure that the curses module was linked against libncursesw.so, rather than # libncurses.so (bug 539917) @@ -1085,6 +1105,10 @@ echo '[ $? -eq 127 ] && echo "Could not find python%{LDVERSION_optimized}-`uname %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-config chmod +x %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-config +# System Python: Copy the executable to libexec +mkdir -p %{buildroot}%{_libexecdir} +cp %{buildroot}%{_bindir}/python%{pybasever} %{buildroot}%{_libexecdir}/system-python + # ====================================================== # Running the upstream test suite # ====================================================== @@ -1161,6 +1185,10 @@ rm -fr %{buildroot} %postun libs -p /sbin/ldconfig +%post -n system-python-libs -p /sbin/ldconfig + +%postun -n system-python-libs -p /sbin/ldconfig + %files @@ -1177,6 +1205,83 @@ rm -fr %{buildroot} %files libs %defattr(-,root,root,-) %doc LICENSE README + +%{pylibdir}/lib2to3 +%exclude %{pylibdir}/lib2to3/tests + +%dir %{pylibdir}/unittest/ +%dir %{pylibdir}/unittest/__pycache__/ +%{pylibdir}/unittest/*.py +%{pylibdir}/unittest/__pycache__/*%{bytecode_suffixes} + +%dir %{pylibdir}/distutils/ +%dir %{pylibdir}/distutils/__pycache__/ +%{pylibdir}/distutils/*.py +%{pylibdir}/distutils/__pycache__/*%{bytecode_suffixes} +%{pylibdir}/distutils/README +%{pylibdir}/distutils/command + +%dir %{pylibdir}/asyncio/ +%dir %{pylibdir}/asyncio/__pycache__/ +%{pylibdir}/asyncio/*.py +%{pylibdir}/asyncio/__pycache__/*%{bytecode_suffixes} + +%dir %{pylibdir}/venv/ +%dir %{pylibdir}/venv/__pycache__/ +%{pylibdir}/venv/*.py +%{pylibdir}/venv/__pycache__/*%{bytecode_suffixes} +%{pylibdir}/venv/scripts + +%{pylibdir}/wsgiref +%{pylibdir}/xml +%{pylibdir}/xmlrpc + +%dir %{pylibdir}/ensurepip/ +%dir %{pylibdir}/ensurepip/__pycache__/ +%{pylibdir}/ensurepip/*.py +%{pylibdir}/ensurepip/__pycache__/*%{bytecode_suffixes} +%exclude %{pylibdir}/ensurepip/_bundled + +%if 0%{?with_rewheel} +%dir %{pylibdir}/ensurepip/rewheel/ +%dir %{pylibdir}/ensurepip/rewheel/__pycache__/ +%{pylibdir}/ensurepip/rewheel/*.py +%{pylibdir}/ensurepip/rewheel/__pycache__/*%{bytecode_suffixes} +%endif + +%{pylibdir}/idlelib + +%dir %{pylibdir}/test/ +%dir %{pylibdir}/test/__pycache__/ +%dir %{pylibdir}/test/support/ +%dir %{pylibdir}/test/support/__pycache__/ +%{pylibdir}/test/__init__.py +%{pylibdir}/test/__pycache__/__init__%{bytecode_suffixes} +%{pylibdir}/test/support/__init__.py +%{pylibdir}/test/support/__pycache__/__init__%{bytecode_suffixes} + +%dir %{pylibdir}/concurrent/ +%dir %{pylibdir}/concurrent/__pycache__/ +%{pylibdir}/concurrent/*.py +%{pylibdir}/concurrent/__pycache__/*%{bytecode_suffixes} + +%dir %{pylibdir}/concurrent/futures/ +%dir %{pylibdir}/concurrent/futures/__pycache__/ +%{pylibdir}/concurrent/futures/*.py +%{pylibdir}/concurrent/futures/__pycache__/*%{bytecode_suffixes} + +%{pylibdir}/pydoc_data + +################################################################################## + +%files -n system-python +%defattr(-,root,root,-) +%doc LICENSE README +%{_libexecdir}/system-python + +%files -n system-python-libs +%defattr(-,root,root,-) +%doc LICENSE README %dir %{pylibdir} %dir %{dynload_dir} %{dynload_dir}/_bisect.%{SOABI_optimized}.so @@ -1245,26 +1350,11 @@ rm -fr %{buildroot} %dir %{pylibdir}/__pycache__/ %{pylibdir}/__pycache__/*%{bytecode_suffixes} -%dir %{pylibdir}/asyncio/ -%dir %{pylibdir}/asyncio/__pycache__/ -%{pylibdir}/asyncio/*.py -%{pylibdir}/asyncio/__pycache__/*%{bytecode_suffixes} - %dir %{pylibdir}/collections/ %dir %{pylibdir}/collections/__pycache__/ %{pylibdir}/collections/*.py %{pylibdir}/collections/__pycache__/*%{bytecode_suffixes} -%dir %{pylibdir}/concurrent/ -%dir %{pylibdir}/concurrent/__pycache__/ -%{pylibdir}/concurrent/*.py -%{pylibdir}/concurrent/__pycache__/*%{bytecode_suffixes} - -%dir %{pylibdir}/concurrent/futures/ -%dir %{pylibdir}/concurrent/futures/__pycache__/ -%{pylibdir}/concurrent/futures/*.py -%{pylibdir}/concurrent/futures/__pycache__/*%{bytecode_suffixes} - %dir %{pylibdir}/ctypes/ %dir %{pylibdir}/ctypes/__pycache__/ %{pylibdir}/ctypes/*.py @@ -1278,13 +1368,6 @@ rm -fr %{buildroot} %{pylibdir}/dbm/*.py %{pylibdir}/dbm/__pycache__/*%{bytecode_suffixes} -%dir %{pylibdir}/distutils/ -%dir %{pylibdir}/distutils/__pycache__/ -%{pylibdir}/distutils/*.py -%{pylibdir}/distutils/__pycache__/*%{bytecode_suffixes} -%{pylibdir}/distutils/README -%{pylibdir}/distutils/command - %dir %{pylibdir}/email/ %dir %{pylibdir}/email/__pycache__/ %{pylibdir}/email/*.py @@ -1294,22 +1377,8 @@ rm -fr %{buildroot} %{pylibdir}/encodings -%dir %{pylibdir}/ensurepip/ -%dir %{pylibdir}/ensurepip/__pycache__/ -%{pylibdir}/ensurepip/*.py -%{pylibdir}/ensurepip/__pycache__/*%{bytecode_suffixes} -%exclude %{pylibdir}/ensurepip/_bundled - -%if 0%{?with_rewheel} -%dir %{pylibdir}/ensurepip/rewheel/ -%dir %{pylibdir}/ensurepip/rewheel/__pycache__/ -%{pylibdir}/ensurepip/rewheel/*.py -%{pylibdir}/ensurepip/rewheel/__pycache__/*%{bytecode_suffixes} -%endif - %{pylibdir}/html %{pylibdir}/http -%{pylibdir}/idlelib %dir %{pylibdir}/importlib/ %dir %{pylibdir}/importlib/__pycache__/ @@ -1321,47 +1390,20 @@ rm -fr %{buildroot} %{pylibdir}/json/*.py %{pylibdir}/json/__pycache__/*%{bytecode_suffixes} -%{pylibdir}/lib2to3 -%exclude %{pylibdir}/lib2to3/tests %{pylibdir}/logging %{pylibdir}/multiprocessing %{pylibdir}/plat-linux -%{pylibdir}/pydoc_data %dir %{pylibdir}/sqlite3/ %dir %{pylibdir}/sqlite3/__pycache__/ %{pylibdir}/sqlite3/*.py %{pylibdir}/sqlite3/__pycache__/*%{bytecode_suffixes} -%dir %{pylibdir}/test/ -%dir %{pylibdir}/test/__pycache__/ -%dir %{pylibdir}/test/support/ -%dir %{pylibdir}/test/support/__pycache__/ -%{pylibdir}/test/__init__.py -%{pylibdir}/test/__pycache__/__init__%{bytecode_suffixes} -%{pylibdir}/test/support/__init__.py -%{pylibdir}/test/support/__pycache__/__init__%{bytecode_suffixes} - %exclude %{pylibdir}/turtle.py %exclude %{pylibdir}/__pycache__/turtle*%{bytecode_suffixes} -%dir %{pylibdir}/unittest/ -%dir %{pylibdir}/unittest/__pycache__/ -%{pylibdir}/unittest/*.py -%{pylibdir}/unittest/__pycache__/*%{bytecode_suffixes} - %{pylibdir}/urllib -%dir %{pylibdir}/venv/ -%dir %{pylibdir}/venv/__pycache__/ -%{pylibdir}/venv/*.py -%{pylibdir}/venv/__pycache__/*%{bytecode_suffixes} -%{pylibdir}/venv/scripts - -%{pylibdir}/wsgiref -%{pylibdir}/xml -%{pylibdir}/xmlrpc - %if "%{_lib}" == "lib64" %attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever} %attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}/site-packages @@ -1401,6 +1443,7 @@ rm -fr %{buildroot} %{_libdir}/pkgconfig/python-%{pybasever}.pc %{_libdir}/pkgconfig/python3.pc %{_rpmconfigdir}/macros.d/macros.pybytecompile%{pybasever} +%{_rpmconfigdir}/macros.d/macros.systempython %files tools %defattr(-,root,root,755) @@ -1565,9 +1608,12 @@ rm -fr %{buildroot} # ====================================================== %changelog -* Wed Feb 24 2016 Robert Kuska - 3.5.1-5 +* Wed Feb 24 2016 Robert Kuska - 3.5.1-6 - Provide python3-enum34 +* Fri Feb 19 2016 Miro Hrončok - 3.5.1-5 +- Provide System Python packages and macros + * Thu Feb 04 2016 Fedora Release Engineering - 3.5.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild From 60fd88ff14c0b39d2e0cbe29595c9844e8bb5b11 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Thu, 25 Feb 2016 17:47:06 +0100 Subject: [PATCH 242/416] SPEC file cleanup --- python3.spec | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/python3.spec b/python3.spec index f10a160..17495a7 100644 --- a/python3.spec +++ b/python3.spec @@ -517,15 +517,14 @@ Requires: system-python-libs%{?_isa} = %{version}-%{release} Provides: system-python(abi) = %{pybasever} %description -n system-python -System Python TODO description +System Python provides a binary interpreter which uses system-python-libs, +a subset of standard Python library considered essential to run various tools, +requiring Python, that consider themselves "system tools". %package -n system-python-libs Summary: System Python runtime libraries Group: Development/Libraries -# Remove some requires so this does not pull python3 back -# TODO this does not work, whyyyyyyy? -#%%global __provides_exclude_from ^/usr/(lib|lib64)/python.*$ %define __requires_exclude ^(/usr/bin/python3.*|python\\(abi\\) = 3\\..*)$ Requires: expat >= 2.1.0 From ca48cc1b555ad83cc0c7092d90f75f0bb52e4ed6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 25 Feb 2016 21:04:08 +0100 Subject: [PATCH 243/416] Remove trailing whitespace --- python3.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 17495a7..64fcb82 100644 --- a/python3.spec +++ b/python3.spec @@ -519,7 +519,7 @@ Provides: system-python(abi) = %{pybasever} %description -n system-python System Python provides a binary interpreter which uses system-python-libs, a subset of standard Python library considered essential to run various tools, -requiring Python, that consider themselves "system tools". +requiring Python, that consider themselves "system tools". %package -n system-python-libs Summary: System Python runtime libraries From a6cf4230e2e85589b019a88fee4bbf7ccc44d358 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 4 Mar 2016 14:30:32 +0100 Subject: [PATCH 244/416] Move distutils to system-python-libs --- python3.spec | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/python3.spec b/python3.spec index 64fcb82..5e0ffa3 100644 --- a/python3.spec +++ b/python3.spec @@ -112,7 +112,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 6%{?dist} +Release: 7%{?dist} License: Python Group: Development/Languages @@ -1213,13 +1213,6 @@ rm -fr %{buildroot} %{pylibdir}/unittest/*.py %{pylibdir}/unittest/__pycache__/*%{bytecode_suffixes} -%dir %{pylibdir}/distutils/ -%dir %{pylibdir}/distutils/__pycache__/ -%{pylibdir}/distutils/*.py -%{pylibdir}/distutils/__pycache__/*%{bytecode_suffixes} -%{pylibdir}/distutils/README -%{pylibdir}/distutils/command - %dir %{pylibdir}/asyncio/ %dir %{pylibdir}/asyncio/__pycache__/ %{pylibdir}/asyncio/*.py @@ -1367,6 +1360,14 @@ rm -fr %{buildroot} %{pylibdir}/dbm/*.py %{pylibdir}/dbm/__pycache__/*%{bytecode_suffixes} +%dir %{pylibdir}/distutils/ +%dir %{pylibdir}/distutils/__pycache__/ +%{pylibdir}/distutils/*.py +%{pylibdir}/distutils/__pycache__/*%{bytecode_suffixes} +%{pylibdir}/distutils/README +%{pylibdir}/distutils/command + + %dir %{pylibdir}/email/ %dir %{pylibdir}/email/__pycache__/ %{pylibdir}/email/*.py @@ -1607,6 +1608,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Fri Mar 04 2016 Miro Hrončok - 3.5.1-7 +- Move distutils to system-python-libs + * Wed Feb 24 2016 Robert Kuska - 3.5.1-6 - Provide python3-enum34 From e7488abc3bca561893d9d936d5073d4ace2b2e21 Mon Sep 17 00:00:00 2001 From: Robert Kuska Date: Thu, 17 Mar 2016 10:18:47 +0100 Subject: [PATCH 245/416] Removed patch131 rhbz#1318565 --- 00131-disable-tests-in-test_io.patch | 11 ----------- python3.spec | 13 +++---------- 2 files changed, 3 insertions(+), 21 deletions(-) delete mode 100644 00131-disable-tests-in-test_io.patch diff --git a/00131-disable-tests-in-test_io.patch b/00131-disable-tests-in-test_io.patch deleted file mode 100644 index d81a2d0..0000000 --- a/00131-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/python3.spec b/python3.spec index 5e0ffa3..49ff1e5 100644 --- a/python3.spec +++ b/python3.spec @@ -232,13 +232,6 @@ Patch104: 00104-lib64-fix-for-test_install.patch # Downstream only: not appropriate for upstream Patch111: 00111-no-static-lib.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: @@ -466,6 +459,8 @@ Patch207: 00207-math-once.patch # rhbz#1292467 Patch208: 00208-disable-test_with_pip-on-ppc.patch +Patch209:0001-Expected-failure-hook.patch + # add correct arch for ppc64/ppc64le # it should be ppc64le-linux-gnu/ppc64-linux-gnu instead powerpc64le-linux-gnu/powerpc64-linux-gnu Patch5001: python3-powerppc-arch.patch @@ -667,9 +662,6 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch104 -p1 %endif %patch111 -p1 -%ifarch ppc %{power64} -%patch131 -p1 -%endif %patch132 -p1 %patch137 -p1 %ifarch %{arm} @@ -707,6 +699,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch206 -p1 %patch207 -p1 %patch208 -p1 +%patch209 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. From 28c36c694a58195d4d3f22a6a02c500eea1d321f Mon Sep 17 00:00:00 2001 From: Robert Kuska Date: Thu, 17 Mar 2016 10:20:48 +0100 Subject: [PATCH 246/416] Remove accidentally added patch --- python3.spec | 3 --- 1 file changed, 3 deletions(-) diff --git a/python3.spec b/python3.spec index 49ff1e5..9bd2f33 100644 --- a/python3.spec +++ b/python3.spec @@ -459,8 +459,6 @@ Patch207: 00207-math-once.patch # rhbz#1292467 Patch208: 00208-disable-test_with_pip-on-ppc.patch -Patch209:0001-Expected-failure-hook.patch - # add correct arch for ppc64/ppc64le # it should be ppc64le-linux-gnu/ppc64-linux-gnu instead powerpc64le-linux-gnu/powerpc64-linux-gnu Patch5001: python3-powerppc-arch.patch @@ -699,7 +697,6 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch206 -p1 %patch207 -p1 %patch208 -p1 -%patch209 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. From a1c0d073e20f5dc5d1f21c5f8d205c75490f821a Mon Sep 17 00:00:00 2001 From: Robert Kuska Date: Thu, 17 Mar 2016 10:40:36 +0100 Subject: [PATCH 247/416] Remove unused _expectedFailureInRpmbuild function rhbz#1301033 --- 00132-add-rpmbuild-hooks-to-unittest.patch | 23 +--------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/00132-add-rpmbuild-hooks-to-unittest.patch b/00132-add-rpmbuild-hooks-to-unittest.patch index 041abce..334dc51 100644 --- a/00132-add-rpmbuild-hooks-to-unittest.patch +++ b/00132-add-rpmbuild-hooks-to-unittest.patch @@ -9,7 +9,7 @@ diff -up Python-3.2.2/Lib/unittest/case.py.add-rpmbuild-hooks-to-unittest Python import logging import pprint import re -@@ -101,5 +102,42 @@ def expectedFailure(func): +@@ -101,5 +102,21 @@ def expectedFailure(func): raise self.test_case.failureException(msg) +# Non-standard/downstream-only hooks for handling issues with specific test @@ -27,27 +27,6 @@ diff -up Python-3.2.2/Lib/unittest/case.py.add-rpmbuild-hooks-to-unittest Python + 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 _AssertRaisesBaseContext(_BaseTestCaseContext): From f2e5fa9a56909387416302069bf40fd3b4fcbc8e Mon Sep 17 00:00:00 2001 From: Robert Kuska Date: Thu, 17 Mar 2016 10:51:32 +0100 Subject: [PATCH 248/416] Remove _expectedFailureInRpmBuild also from unittest/__init__ --- 00132-add-rpmbuild-hooks-to-unittest.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/00132-add-rpmbuild-hooks-to-unittest.patch b/00132-add-rpmbuild-hooks-to-unittest.patch index 334dc51..77dc6ec 100644 --- a/00132-add-rpmbuild-hooks-to-unittest.patch +++ b/00132-add-rpmbuild-hooks-to-unittest.patch @@ -40,7 +40,7 @@ diff -up Python-3.2.2/Lib/unittest/__init__.py.add-rpmbuild-hooks-to-unittest Py from .case import (TestCase, FunctionTestCase, SkipTest, skip, skipIf, - skipUnless, expectedFailure) + skipUnless, expectedFailure, -+ _skipInRpmBuild, _expectedFailureInRpmBuild) ++ _skipInRpmBuild) from .suite import BaseTestSuite, TestSuite from .loader import (TestLoader, defaultTestLoader, makeSuite, getTestCaseNames, findTestCases) From 83d6e884b39594f16ad9e06e1743987d23cafc9e Mon Sep 17 00:00:00 2001 From: Robert Kuska Date: Thu, 17 Mar 2016 13:01:56 +0100 Subject: [PATCH 249/416] Remove patch150 as the issue was already fixed rhbz#1318565 --- 00150-disable-rAssertAlmostEqual-cmath-on-ppc.patch | 11 ----------- python3.spec | 10 ---------- 2 files changed, 21 deletions(-) delete mode 100644 00150-disable-rAssertAlmostEqual-cmath-on-ppc.patch diff --git a/00150-disable-rAssertAlmostEqual-cmath-on-ppc.patch b/00150-disable-rAssertAlmostEqual-cmath-on-ppc.patch deleted file mode 100644 index 73b6356..0000000 --- a/00150-disable-rAssertAlmostEqual-cmath-on-ppc.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -up Python-3.2.2/Lib/test/test_cmath.py.ppc Python-3.2.2/Lib/test/test_cmath.py ---- Python-3.2.2/Lib/test/test_cmath.py.ppc 2011-12-07 23:43:55.000000000 +0100 -+++ Python-3.2.2/Lib/test/test_cmath.py 2011-12-07 23:49:44.000000000 +0100 -@@ -95,6 +95,7 @@ class CMathTests(unittest.TestCase): - self.assertFloatIdentical(x.real, y.real) - self.assertFloatIdentical(x.imag, y.imag) - -+ @unittest.skip('Known failure on PPC: glibc bug https://bugzilla.redhat.com/show_bug.cgi?id=750811') - def rAssertAlmostEqual(self, a, b, rel_err = 2e-15, abs_err = 5e-323, - msg=None): - """Fail if the two floating-point numbers are not almost equal. diff --git a/python3.spec b/python3.spec index 9bd2f33..1132dd1 100644 --- a/python3.spec +++ b/python3.spec @@ -292,13 +292,6 @@ Patch143: 00143-tsc-on-ppc.patch # implementation and OpenSSL still doesn't support it. For now, they're harmless. Patch146: 00146-hashlib-fips.patch -# 00150 # -# temporarily disable rAssertAlmostEqual in test_cmath on PPC (bz #750811) -# caused by a glibc bug. This patch can be removed when we have a glibc with -# the patch mentioned here: -# http://sourceware.org/bugzilla/show_bug.cgi?id=13472 -Patch150: 00150-disable-rAssertAlmostEqual-cmath-on-ppc.patch - # 00155 # # Avoid allocating thunks in ctypes unless absolutely necessary, to avoid # generating SELinux denials on "import ctypes" and "import uuid" when @@ -668,9 +661,6 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %endif %patch143 -p1 -b .tsc-on-ppc %patch146 -p1 -%ifarch ppc %{power64} -%patch150 -p1 -%endif %patch155 -p1 %patch157 -p1 %patch160 -p1 From 20b919fd08680e18ee30f7c074926c8f1856f485 Mon Sep 17 00:00:00 2001 From: Robert Kuska Date: Thu, 17 Mar 2016 14:35:52 +0100 Subject: [PATCH 250/416] Remove arm specific test skip patches139&140 rhbz#1318565 --- 00139-skip-test_float-known-failure-on-arm.patch | 11 ----------- python3-arm-skip-failing-fragile-test.patch | 12 ------------ python3.spec | 12 ------------ 3 files changed, 35 deletions(-) delete mode 100644 00139-skip-test_float-known-failure-on-arm.patch delete mode 100644 python3-arm-skip-failing-fragile-test.patch diff --git a/00139-skip-test_float-known-failure-on-arm.patch b/00139-skip-test_float-known-failure-on-arm.patch deleted file mode 100644 index 9d0bfad..0000000 --- a/00139-skip-test_float-known-failure-on-arm.patch +++ /dev/null @@ -1,11 +0,0 @@ -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/python3-arm-skip-failing-fragile-test.patch b/python3-arm-skip-failing-fragile-test.patch deleted file mode 100644 index 3c2fa09..0000000 --- a/python3-arm-skip-failing-fragile-test.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- Python-3.3.2/Lib/test/test_gdb.py.orig 2013-07-26 09:52:15.533852708 -0500 -+++ Python-3.3.2/Lib/test/test_gdb.py 2013-07-26 15:07:53.733623014 -0500 -@@ -729,8 +729,7 @@ - foo\(1, 2, 3\) - ''') - -- @unittest.skipUnless(_thread, -- "Python was compiled without thread support") -+ @unittest.skip('Known failure on ARM: https://bugzilla.redhat.com/show_bug.cgi?id=986713') - def test_threads(self): - 'Verify that "py-bt" indicates threads that are waiting for the GIL' - cmd = ''' diff --git a/python3.spec b/python3.spec index 1132dd1..c81b3b0 100644 --- a/python3.spec +++ b/python3.spec @@ -254,14 +254,6 @@ Patch132: 00132-add-rpmbuild-hooks-to-unittest.patch # Some tests within distutils fail when run in an rpmbuild: Patch137: 00137-skip-distutils-tests-that-fail-in-rpmbuild.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 - -# ideally short lived patch disabling a test thats fragile on different arches -Patch140: python3-arm-skip-failing-fragile-test.patch - # 00143 # # Fix the --with-tsc option on ppc64, and rework it on 32-bit ppc to avoid # aliasing violations (rhbz#698726) @@ -655,10 +647,6 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch111 -p1 %patch132 -p1 %patch137 -p1 -%ifarch %{arm} -%patch139 -p1 -%patch140 -p1 -%endif %patch143 -p1 -b .tsc-on-ppc %patch146 -p1 %patch155 -p1 From 0a93f9db1068342de8b5ea7bcca4e9355f937bd8 Mon Sep 17 00:00:00 2001 From: Robert Kuska Date: Thu, 24 Mar 2016 12:12:20 +0100 Subject: [PATCH 251/416] Remove ppc specific patch which skipped check_interrupted_write tests --- ...sable-interrupted_write-tests-on-ppc.patch | 52 ------------------- python3.spec | 9 ---- 2 files changed, 61 deletions(-) delete mode 100644 00164-disable-interrupted_write-tests-on-ppc.patch diff --git a/00164-disable-interrupted_write-tests-on-ppc.patch b/00164-disable-interrupted_write-tests-on-ppc.patch deleted file mode 100644 index 5641b4b..0000000 --- a/00164-disable-interrupted_write-tests-on-ppc.patch +++ /dev/null @@ -1,52 +0,0 @@ -diff -up Python-3.4.2/Lib/test/test_exceptions.py.ppc Python-3.4.2/Lib/test/test_exceptions.py ---- Python-3.4.2/Lib/test/test_exceptions.py.ppc 2014-10-08 04:18:13.000000000 -0400 -+++ Python-3.4.2/Lib/test/test_exceptions.py 2015-01-12 05:56:15.922833055 -0500 -@@ -429,6 +429,7 @@ class ExceptionTests(unittest.TestCase): - self.assertIsNone(e.__context__) - self.assertIsNone(e.__cause__) - -+ @unittest.skip('rhbz#846849') - def testChainingDescriptors(self): - try: - raise Exception() -diff -up Python-3.4.2/Lib/test/test_io.py.ppc Python-3.4.2/Lib/test/test_io.py ---- Python-3.4.2/Lib/test/test_io.py.ppc 2015-01-12 05:56:15.922833055 -0500 -+++ Python-3.4.2/Lib/test/test_io.py 2015-01-12 05:58:23.482833055 -0500 -@@ -3296,12 +3296,15 @@ class SignalsTest(unittest.TestCase): - if e.errno != errno.EBADF: - raise - -+ @unittest.skip('rhbz#846849') - def test_interrupted_write_unbuffered(self): - self.check_interrupted_write(b"xy", b"xy", mode="wb", buffering=0) - -+ @unittest.skip('rhbz#846849') - def test_interrupted_write_buffered(self): - self.check_interrupted_write(b"xy", b"xy", mode="wb") - -+ @unittest.skip('rhbz#846849') - # Issue #22331: The test hangs on FreeBSD 7.2 - @support.requires_freebsd_version(8) - def test_interrupted_write_text(self): -diff -up Python-3.4.2/Lib/test/test_raise.py.ppc Python-3.4.2/Lib/test/test_raise.py ---- Python-3.4.2/Lib/test/test_raise.py.ppc 2014-10-08 04:18:14.000000000 -0400 -+++ Python-3.4.2/Lib/test/test_raise.py 2015-01-12 05:56:15.922833055 -0500 -@@ -151,6 +151,7 @@ class TestRaise(unittest.TestCase): - - class TestCause(unittest.TestCase): - -+ @unittest.skip('rhbz#846849') - def testCauseSyntax(self): - try: - try: -diff -up Python-3.4.2/Lib/test/test_traceback.py.ppc Python-3.4.2/Lib/test/test_traceback.py ---- Python-3.4.2/Lib/test/test_traceback.py.ppc 2014-10-08 04:18:14.000000000 -0400 -+++ Python-3.4.2/Lib/test/test_traceback.py 2015-01-12 05:56:15.922833055 -0500 -@@ -314,6 +314,7 @@ class BaseExceptionReportingTests: - self.check_zero_div(blocks[0]) - self.assertIn('inner_raise() # Marker', blocks[2]) - -+ @unittest.skip('rhbz#846849') - def test_context_suppression(self): - try: - try: diff --git a/python3.spec b/python3.spec index c81b3b0..fa2c82a 100644 --- a/python3.spec +++ b/python3.spec @@ -320,12 +320,6 @@ Patch160: 00160-disable-test_fs_holes-in-rpm-build.patch # Not yet sent upstream Patch163: 00163-disable-parts-of-test_socket-in-rpm-build.patch -# 0164 # -# some tests in test._io interrupted_write-* fail on PPC (rhbz#846849) -# testChainingDescriptors test in test_exceptions fails on PPc, too (rhbz#846849) -# disable those tests so that rebuilds on PPC can continue -Patch164: 00164-disable-interrupted_write-tests-on-ppc.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 @@ -653,9 +647,6 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch157 -p1 %patch160 -p1 %patch163 -p1 -%ifarch ppc %{power64} -%patch164 -p1 -%endif %patch173 -p1 %patch178 -p1 %patch179 -p1 From 47ab1524060e28e389134fe60fd9f40897a846ea Mon Sep 17 00:00:00 2001 From: Robert Kuska Date: Thu, 24 Mar 2016 16:51:41 +0100 Subject: [PATCH 252/416] Actualy use gc-assertions patch --- 00170-gc-assertions.patch | 13 +++++++------ python3.spec | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/00170-gc-assertions.patch b/00170-gc-assertions.patch index 1144cc2..9e34c21 100644 --- a/00170-gc-assertions.patch +++ b/00170-gc-assertions.patch @@ -96,13 +96,14 @@ Index: Lib/test/test_gc.py =================================================================== --- Lib/test/test_gc.py (revision 87911) +++ Lib/test/test_gc.py (working copy) -@@ -1,6 +1,6 @@ +@@ -1,7 +1,7 @@ import unittest from test.support import (verbose, refcount_test, run_unittest, -- strip_python_stderr, cpython_only) -+ strip_python_stderr, cpython_only, import_module) - from test.script_helper import assert_python_ok, make_script, temp_dir - + strip_python_stderr, cpython_only, start_threads, +- temp_dir) ++ temp_dir, import_module) + from test.support.script_helper import assert_python_ok, make_script + import sys @@ -512,6 +512,48 @@ self.assertEqual(len(gc.garbage), 0) @@ -316,7 +317,7 @@ diff -up Lib/test/test_gc.py.old Lib/test/test_gc.py --- Lib/test/test_gc.py.old 2014-12-10 12:50:58.252121318 +0100 +++ Lib/test/test_gc.py 2014-12-10 12:51:08.594266653 +0100 @@ -4,6 +4,7 @@ from test.support import (verbose, refco - from test.script_helper import assert_python_ok, make_script, temp_dir + from test.support.script_helper import assert_python_ok, make_script import sys +import sysconfig diff --git a/python3.spec b/python3.spec index fa2c82a..154f9b6 100644 --- a/python3.spec +++ b/python3.spec @@ -647,6 +647,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch157 -p1 %patch160 -p1 %patch163 -p1 +%patch170 -p0 %patch173 -p1 %patch178 -p1 %patch179 -p1 From a0e3ab8621e36e705afd0c07da9f1b98c437ae3f Mon Sep 17 00:00:00 2001 From: Robert Kuska Date: Thu, 24 Mar 2016 16:53:25 +0100 Subject: [PATCH 253/416] Remove white spaces --- python3.spec | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/python3.spec b/python3.spec index 154f9b6..70b3dab 100644 --- a/python3.spec +++ b/python3.spec @@ -87,7 +87,7 @@ # We want to byte-compile the .py files within the packages using the new # python3 binary. -# +# # Unfortunately, rpmbuild's infrastructure requires us to jump through some # hoops to avoid byte-compiling with the system python 2 version: # /usr/lib/rpm/redhat/macros sets up build policy that (amongst other things) @@ -100,7 +100,7 @@ %{!?__debug_package:/usr/lib/rpm/brp-strip %{__strip}} \ /usr/lib/rpm/brp-strip-static-archive %{__strip} \ /usr/lib/rpm/brp-strip-comment-note %{__strip} %{__objdump} \ - /usr/lib/rpm/brp-python-hardlink + /usr/lib/rpm/brp-python-hardlink # to remove the invocation of brp-python-bytecompile, whilst keeping the # invocation of brp-python-hardlink (since this should still work for python3 # pyc/pyo files) @@ -320,14 +320,14 @@ Patch160: 00160-disable-test_fs_holes-in-rpm-build.patch # Not yet sent upstream Patch163: 00163-disable-parts-of-test_socket-in-rpm-build.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. +# 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 @@ -406,17 +406,17 @@ Patch194: temporarily-disable-tests-requiring-SIGHUP.patch # Fix test_gdb failure on ppc64le Patch196: 00196-test-gdb-match-addr-before-builtin.patch -# 00200 # -# Fix for gettext plural form headers (lines that begin with "#") +# 00200 # +# Fix for gettext plural form headers (lines that begin with "#") # Note: Backported from scl Patch200: 00200-gettext-plural-fix.patch -# 00201 # -# Fixes memory leak in gdbm module (rhbz#977308) -# This was upstreamed as a part of bigger patch, but for our purposes -# this is ok: http://bugs.python.org/issue18404 +# 00201 # +# Fixes memory leak in gdbm module (rhbz#977308) +# This was upstreamed as a part of bigger patch, but for our purposes +# this is ok: http://bugs.python.org/issue18404 # Note: Backported from scl -Patch201: 00201-fix-memory-leak-in-gdbm.patch +Patch201: 00201-fix-memory-leak-in-gdbm.patch # test_threading fails in koji dues to it's handling of signals Patch203: 00203-disable-threading-test-koji.patch @@ -698,7 +698,7 @@ export LDFLAGS="$RPM_LD_FLAGS `pkg-config --libs-only-L openssl`" # 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 @@ -779,7 +779,7 @@ mkdir -p %{buildroot}%{_prefix} %{buildroot}%{_mandir} InstallPython() { - ConfName=$1 + ConfName=$1 PyInstSoName=$2 MoreCFlags=$3 @@ -964,7 +964,7 @@ find %{buildroot}/ -name \*.py -exec sed -i 's/\r//' {} \; # Fix an encoding: iconv -f iso8859-1 -t utf-8 %{buildroot}/%{pylibdir}/Demo/rpc/README > README.conv && mv -f README.conv %{buildroot}/%{pylibdir}/Demo/rpc/README -# Note that +# Note that # %{pylibdir}/Demo/distutils/test2to3/setup.py # is in iso-8859-1 encoding, and that this is deliberate; this is test data # for the 2to3 tool, and one of the functions of the 2to3 tool is to fixup @@ -1005,7 +1005,7 @@ for Module in %{buildroot}/%{dynload_dir}/*.so ; do *.%{SOABI_debug}) ldd $Module | grep %{py_INSTSONAME_optimized} && (echo Debug module $Module linked against optimized %{py_INSTSONAME_optimized} ; exit 1) - + ;; *.%{SOABI_optimized}) ldd $Module | grep %{py_INSTSONAME_debug} && @@ -1088,7 +1088,7 @@ find %{buildroot} -type f -a -name "*.py" -print0 | \ topdir=$(pwd) CheckPython() { - ConfName=$1 + ConfName=$1 ConfDir=$(pwd)/build/$ConfName echo STARTING: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName @@ -1551,15 +1551,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 %__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 +# (if it doesn't, then the rpmbuild ought to fail since the debug-gdb.py # payload file would be unpackaged) @@ -1977,7 +1977,7 @@ ppc to avoid aliasing violations (patch 130; rhbz#698726) - add %%python3_version to the rpm macros (rhbz#719082) * Mon Jul 11 2011 Dennis Gilmore - 3.2.1-2 -- disable some tests on sparc arches +- disable some tests on sparc arches * Mon Jul 11 2011 David Malcolm - 3.2.1-1 - 3.2.1; refresh lib64 patch (102), subprocess unit test patch (129), disabling From c63af87347e126396c89a46c6f9067c2e8dbf254 Mon Sep 17 00:00:00 2001 From: Robert Kuska Date: Tue, 29 Mar 2016 13:15:46 +0200 Subject: [PATCH 254/416] Remove Patch173 as test.support.bind_port seems to work --- 00173-workaround-ENOPROTOOPT-in-bind_port.patch | 12 ------------ python3.spec | 8 +------- 2 files changed, 1 insertion(+), 19 deletions(-) delete mode 100644 00173-workaround-ENOPROTOOPT-in-bind_port.patch diff --git a/00173-workaround-ENOPROTOOPT-in-bind_port.patch b/00173-workaround-ENOPROTOOPT-in-bind_port.patch deleted file mode 100644 index 8d8b0bc..0000000 --- a/00173-workaround-ENOPROTOOPT-in-bind_port.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- Python-3.4.0b1/Lib/test/support/__init__.py.orig 2013-11-27 12:14:26.507216624 +0100 -+++ Python-3.4.0b1/Lib/test/support/__init__.py 2013-11-27 12:17:01.490805587 +0100 -@@ -593,7 +593,8 @@ - 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 " \ diff --git a/python3.spec b/python3.spec index 70b3dab..1c21ce0 100644 --- a/python3.spec +++ b/python3.spec @@ -331,11 +331,6 @@ Patch163: 00163-disable-parts-of-test_socket-in-rpm-build.patch # (rhbz#850013 Patch170: 00170-gc-assertions.patch -# 00173 # -# Workaround for ENOPROTOOPT seen in Koji withi test.support.bind_port() -# (rhbz#913732) -Patch173: 00173-workaround-ENOPROTOOPT-in-bind_port.patch - # 00178 # # Don't duplicate various FLAGS in sysconfig values # http://bugs.python.org/issue17679 @@ -648,11 +643,10 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch160 -p1 %patch163 -p1 %patch170 -p0 -%patch173 -p1 %patch178 -p1 %patch179 -p1 %patch180 -p1 -%patch184 -p1 +%patch184 -p1 %patch186 -p1 %patch188 -p1 From d2c2647ea92cdfdd289ccb6504da77b8e20e0358 Mon Sep 17 00:00:00 2001 From: Robert Kuska Date: Thu, 31 Mar 2016 12:33:48 +0200 Subject: [PATCH 255/416] Remove Patch179 as test_gdb pass on arm without problems --- ...on-gdb-corrupted-frames-in-backtrace.patch | 48 ------------------- python3.spec | 10 ---- 2 files changed, 58 deletions(-) delete mode 100644 00179-dont-raise-error-on-gdb-corrupted-frames-in-backtrace.patch diff --git a/00179-dont-raise-error-on-gdb-corrupted-frames-in-backtrace.patch b/00179-dont-raise-error-on-gdb-corrupted-frames-in-backtrace.patch deleted file mode 100644 index 2112730..0000000 --- a/00179-dont-raise-error-on-gdb-corrupted-frames-in-backtrace.patch +++ /dev/null @@ -1,48 +0,0 @@ ---- a/Tools/gdb/libpython.py 2013-04-06 03:41:58.000000000 -0400 -+++ b/Tools/gdb/libpython.py 2013-04-24 03:51:04.720540343 -0400 -@@ -274,6 +274,9 @@ - self.tp_name = tp_name - self.address = address - -+ def __len__(self): -+ return len(repr(self)) -+ - def __repr__(self): - # For the NULL pointer, we have no way of knowing a type, so - # special-case it as per -@@ -881,6 +884,8 @@ - filename = self.filename() - try: - f = open(os_fsencode(filename), 'r') -+ except TypeError: # filename is FakeRepr -+ return None - except IOError: - return None - with f: -@@ -1523,9 +1528,12 @@ - - def print_summary(self): - if self.is_evalframeex(): -- pyop = self.get_pyop() -- if pyop: -+ try: -+ pyop = self.get_pyop() - line = pyop.get_truncated_repr(MAX_OUTPUT_LEN) -+ except: -+ pyop = None -+ if pyop: - write_unicode(sys.stdout, '#%i %s\n' % (self.get_index(), line)) - if not pyop.is_optimized_out(): - line = pyop.current_line() -@@ -1542,7 +1550,10 @@ - - def print_traceback(self): - if self.is_evalframeex(): -- pyop = self.get_pyop() -+ try: -+ pyop = self.get_pyop() -+ except: -+ pyop = None - if pyop: - pyop.print_traceback() - if not pyop.is_optimized_out(): diff --git a/python3.spec b/python3.spec index 1c21ce0..aaa31ef 100644 --- a/python3.spec +++ b/python3.spec @@ -337,15 +337,6 @@ Patch170: 00170-gc-assertions.patch # Does not affect python2 AFAICS (different sysconfig values initialization) Patch178: 00178-dont-duplicate-flags-in-sysconfig.patch -# 00179 # -# Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=951802 -# Reported upstream in http://bugs.python.org/issue17737 -# This patch basically looks at every frame and if it is somehow corrupted, -# it just stops printing the traceback - it doesn't fix the actual bug. -# This bug seems to only affect ARM. -# Doesn't seem to affect Python 2 AFAICS. -Patch179: 00179-dont-raise-error-on-gdb-corrupted-frames-in-backtrace.patch - # 00180 # # Enable building on ppc64p7 # Not appropriate for upstream, Fedora-specific naming @@ -644,7 +635,6 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch163 -p1 %patch170 -p0 %patch178 -p1 -%patch179 -p1 %patch180 -p1 %patch184 -p1 %patch186 -p1 From 5279a7c9ec838beec62177f885a584fc990d59a0 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Mon, 13 Jun 2016 17:52:30 +0200 Subject: [PATCH 256/416] Fix possible integer overflow and heap corruption in zipimport module --- ...ent-buffer-overflow-in-zipimport-module.patch | 16 ++++++++++++++++ python3.spec | 12 +++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 00209-prevent-buffer-overflow-in-zipimport-module.patch diff --git a/00209-prevent-buffer-overflow-in-zipimport-module.patch b/00209-prevent-buffer-overflow-in-zipimport-module.patch new file mode 100644 index 0000000..ea23556 --- /dev/null +++ b/00209-prevent-buffer-overflow-in-zipimport-module.patch @@ -0,0 +1,16 @@ +diff --git a/Modules/zipimport.c b/Modules/zipimport.c +index 06abb31..914bf5d 100644 +--- a/Modules/zipimport.c ++++ b/Modules/zipimport.c +@@ -1112,6 +1112,11 @@ get_data(PyObject *archive, PyObject *toc_entry) + } + file_offset += l; /* Start of file data */ + ++ if (data_size > LONG_MAX - 1) { ++ fclose(fp); ++ PyErr_NoMemory(); ++ return NULL; ++ } + bytes_size = compress == 0 ? data_size : data_size + 1; + if (bytes_size == 0) + bytes_size++; diff --git a/python3.spec b/python3.spec index aaa31ef..7cb9e1a 100644 --- a/python3.spec +++ b/python3.spec @@ -112,7 +112,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 7%{?dist} +Release: 8%{?dist} License: Python Group: Development/Languages @@ -424,6 +424,12 @@ Patch207: 00207-math-once.patch # rhbz#1292467 Patch208: 00208-disable-test_with_pip-on-ppc.patch +# https://bugs.python.org/issue26171 +# https://hg.python.org/cpython/rev/10dad6da1b28/ +# Fix possible integer overflow and heap corruption in zipimporter.get_data() +# FIXED UPSTREAM +Patch209: 00209-prevent-buffer-overflow-in-zipimport-module.patch + # add correct arch for ppc64/ppc64le # it should be ppc64le-linux-gnu/ppc64-linux-gnu instead powerpc64le-linux-gnu/powerpc64-linux-gnu Patch5001: python3-powerppc-arch.patch @@ -651,6 +657,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch206 -p1 %patch207 -p1 %patch208 -p1 +%patch209 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1552,6 +1559,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon Jun 13 2016 Charalampos Stratakis - 3.5.1-8 +- Added patch for fixing possible integer overflow and heap corruption in zipimporter.get_data() + * Fri Mar 04 2016 Miro Hrončok - 3.5.1-7 - Move distutils to system-python-libs From 8f231d01cd1587d61c990fafd61b722294187db7 Mon Sep 17 00:00:00 2001 From: Tomas Orsava Date: Fri, 17 Jun 2016 16:14:12 +0200 Subject: [PATCH 257/416] 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#1346345: https://bugzilla.redhat.com/show_bug.cgi?id=1346345 - Fixed upstream: https://hg.python.org/cpython/rev/d590114c2394 --- ...0-Raise-an-error-when-STARTTLS-fails.patch | 35 +++++++++++++++++++ python3.spec | 18 +++++++++- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 00210-Raise-an-error-when-STARTTLS-fails.patch 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..9083e61 --- /dev/null +++ b/00210-Raise-an-error-when-STARTTLS-fails.patch @@ -0,0 +1,35 @@ +From 761db274ca898f8a92348ed5979d3d3c1b0d634a Mon Sep 17 00:00:00 2001 +From: Tomas Orsava +Date: Fri, 17 Jun 2016 16:08:11 +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#1346345: https://bugzilla.redhat.com/show_bug.cgi?id=1346345 + +Based on an upstream change by Benjamin Peterson +- in changeset 101887:d590114c2394 3.4 +- https://hg.python.org/cpython/rev/d590114c2394 +--- + Lib/smtplib.py | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/Lib/smtplib.py b/Lib/smtplib.py +index 4756973..dfbf5f9 100755 +--- a/Lib/smtplib.py ++++ b/Lib/smtplib.py +@@ -773,6 +773,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/python3.spec b/python3.spec index 7cb9e1a..dd7d5e1 100644 --- a/python3.spec +++ b/python3.spec @@ -112,7 +112,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 8%{?dist} +Release: 9%{?dist} License: Python Group: Development/Languages @@ -430,6 +430,14 @@ Patch208: 00208-disable-test_with_pip-on-ppc.patch # FIXED UPSTREAM Patch209: 00209-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#1346345: https://bugzilla.redhat.com/show_bug.cgi?id=1346345 +# FIXED UPSTREAM: https://hg.python.org/cpython/rev/d590114c2394 +# Raise an error when STARTTLS fails +Patch210: 00210-Raise-an-error-when-STARTTLS-fails.patch + # add correct arch for ppc64/ppc64le # it should be ppc64le-linux-gnu/ppc64-linux-gnu instead powerpc64le-linux-gnu/powerpc64-linux-gnu Patch5001: python3-powerppc-arch.patch @@ -658,6 +666,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch207 -p1 %patch208 -p1 %patch209 -p1 +%patch210 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1559,6 +1568,13 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Thu Jun 16 2016 Tomas Orsava - 3.5.1-9 +- 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#1346345: https://bugzilla.redhat.com/show_bug.cgi?id=1346345 +- Fixed upstream: https://hg.python.org/cpython/rev/d590114c2394 + * Mon Jun 13 2016 Charalampos Stratakis - 3.5.1-8 - Added patch for fixing possible integer overflow and heap corruption in zipimporter.get_data() From 99ac2fc8f31758394c30a123aae6a8588ea8f256 Mon Sep 17 00:00:00 2001 From: Tomas Orsava Date: Mon, 20 Jun 2016 13:14:00 +0200 Subject: [PATCH 258/416] Added an info note about adding new patches Due to an omission, it was not included in this branch yet. --- python3.spec | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/python3.spec b/python3.spec index dd7d5e1..9c912f5 100644 --- a/python3.spec +++ b/python3.spec @@ -438,6 +438,26 @@ Patch209: 00209-prevent-buffer-overflow-in-zipimport-module.patch # 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, +# 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 relevant 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. + # add correct arch for ppc64/ppc64le # it should be ppc64le-linux-gnu/ppc64-linux-gnu instead powerpc64le-linux-gnu/powerpc64-linux-gnu Patch5001: python3-powerppc-arch.patch From 347356c0991e96f023ce2b45b217c3bae994dbf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 8 Jul 2016 14:03:34 +0200 Subject: [PATCH 259/416] Move xml module to system-python-libs --- python3.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python3.spec b/python3.spec index 9c912f5..2a88e09 100644 --- a/python3.spec +++ b/python3.spec @@ -112,7 +112,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 9%{?dist} +Release: 10%{?dist} License: Python Group: Development/Languages @@ -1205,7 +1205,6 @@ rm -fr %{buildroot} %{pylibdir}/venv/scripts %{pylibdir}/wsgiref -%{pylibdir}/xml %{pylibdir}/xmlrpc %dir %{pylibdir}/ensurepip/ @@ -1383,6 +1382,7 @@ rm -fr %{buildroot} %exclude %{pylibdir}/__pycache__/turtle*%{bytecode_suffixes} %{pylibdir}/urllib +%{pylibdir}/xml %if "%{_lib}" == "lib64" %attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever} @@ -1588,6 +1588,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Fri Jul 08 2016 Miro Hrončok - 3.5.1-10 +- Move xml module to system-python-libs + * Thu Jun 16 2016 Tomas Orsava - 3.5.1-9 - Fix for: CVE-2016-0772 python: smtplib StartTLS stripping attack - Raise an error when STARTTLS fails From 92512b0b144636b67b041adce8eff6f575bb8369 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Fri, 8 Jul 2016 16:47:33 +0200 Subject: [PATCH 260/416] Fix test_pyexpat failure with Expat 2.2.0 --- 00211-fix-test-pyexpat-failure.patch | 17 +++++++++++++++++ python3.spec | 12 +++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 00211-fix-test-pyexpat-failure.patch diff --git a/00211-fix-test-pyexpat-failure.patch b/00211-fix-test-pyexpat-failure.patch new file mode 100644 index 0000000..7b40280 --- /dev/null +++ b/00211-fix-test-pyexpat-failure.patch @@ -0,0 +1,17 @@ +diff -r 682a8e36dd18 Lib/test/test_pyexpat.py +--- a/Lib/test/test_pyexpat.py Tue Jul 05 17:08:52 2016 +0300 ++++ b/Lib/test/test_pyexpat.py Thu Jul 07 17:04:35 2016 +0800 +@@ -656,11 +656,9 @@ + # \xc2\x85 is UTF-8 encoded U+0085 (NEXT LINE) + xml = b"\r\n" + parser = expat.ParserCreate() +- try: ++ err_pattern = r'XML declaration not well-formed: line 1, column \d+' ++ with self.assertRaisesRegex(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 ErrorMessageTest(unittest.TestCase): + def test_codes(self): diff --git a/python3.spec b/python3.spec index 2a88e09..01c9966 100644 --- a/python3.spec +++ b/python3.spec @@ -112,7 +112,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 10%{?dist} +Release: 11%{?dist} License: Python Group: Development/Languages @@ -438,6 +438,12 @@ Patch209: 00209-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#1353918: https://bugzilla.redhat.com/show_bug.cgi?id=1353918 +# 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, @@ -687,6 +693,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch208 -p1 %patch209 -p1 %patch210 -p1 +%patch211 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1588,6 +1595,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Fri Jul 08 2016 Charalampos Stratakis - 3.5.1-11 +- Fix test_pyexpat failure with Expat version of 2.2.0 + * Fri Jul 08 2016 Miro Hrončok - 3.5.1-10 - Move xml module to system-python-libs From 3702d0d8e2d9c1af62b1d8928cee8a90fb02d11d Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Fri, 8 Jul 2016 18:47:00 +0200 Subject: [PATCH 261/416] Refactor patch for properly fixing CVE-2016-5636 --- ...fer-overflow-in-zipimport-module-fix.patch | 39 +++++++++++++++++++ ...-buffer-overflow-in-zipimport-module.patch | 16 -------- python3.spec | 24 ++++++++---- 3 files changed, 56 insertions(+), 23 deletions(-) create mode 100644 00209-CVE-2016-5636-buffer-overflow-in-zipimport-module-fix.patch delete mode 100644 00209-prevent-buffer-overflow-in-zipimport-module.patch 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..e2c8581 --- /dev/null +++ b/00209-CVE-2016-5636-buffer-overflow-in-zipimport-module-fix.patch @@ -0,0 +1,39 @@ +From 531dfa4bcfe55d5cd1524425944b07c5b02bddf9 Mon Sep 17 00:00:00 2001 +From: Charalampos Stratakis +Date: Fri, 8 Jul 2016 17:16:41 +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 06abb31..4d0d1de 100644 +--- a/Modules/zipimport.c ++++ b/Modules/zipimport.c +@@ -1076,6 +1076,10 @@ get_data(PyObject *archive, PyObject *toc_entry) + &date, &crc)) { + return NULL; + } ++ if (data_size < 0) { ++ PyErr_Format(ZipImportError, "negative data size"); ++ return NULL; ++ } + + fp = _Py_fopen_obj(archive, "rb"); + if (!fp) +@@ -1112,6 +1116,11 @@ get_data(PyObject *archive, PyObject *toc_entry) + } + file_offset += l; /* Start of file data */ + ++ if (data_size > LONG_MAX - 1) { ++ fclose(fp); ++ PyErr_NoMemory(); ++ return NULL; ++ } + bytes_size = compress == 0 ? data_size : data_size + 1; + if (bytes_size == 0) + bytes_size++; +-- +2.7.4 + diff --git a/00209-prevent-buffer-overflow-in-zipimport-module.patch b/00209-prevent-buffer-overflow-in-zipimport-module.patch deleted file mode 100644 index ea23556..0000000 --- a/00209-prevent-buffer-overflow-in-zipimport-module.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/Modules/zipimport.c b/Modules/zipimport.c -index 06abb31..914bf5d 100644 ---- a/Modules/zipimport.c -+++ b/Modules/zipimport.c -@@ -1112,6 +1112,11 @@ get_data(PyObject *archive, PyObject *toc_entry) - } - file_offset += l; /* Start of file data */ - -+ if (data_size > LONG_MAX - 1) { -+ fclose(fp); -+ PyErr_NoMemory(); -+ return NULL; -+ } - bytes_size = compress == 0 ? data_size : data_size + 1; - if (bytes_size == 0) - bytes_size++; diff --git a/python3.spec b/python3.spec index 01c9966..d094297 100644 --- a/python3.spec +++ b/python3.spec @@ -112,7 +112,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 11%{?dist} +Release: 12%{?dist} License: Python Group: Development/Languages @@ -375,7 +375,6 @@ Patch186: 00186-dont-raise-from-py_compile.patch Patch188: 00188-fix-lib2to3-tests-when-hashlib-doesnt-compile-properly.patch # 00189 # -# # Add the rewheel module, allowing to recreate wheels from already installed # ones # https://github.com/bkabrda/rewheel @@ -383,12 +382,12 @@ Patch188: 00188-fix-lib2to3-tests-when-hashlib-doesnt-compile-properly.patch Patch189: 00189-add-rewheel-module.patch %endif +# 00194 # # Tests requiring SIGHUP to work don't work in Koji # see rhbz#1088233 Patch194: temporarily-disable-tests-requiring-SIGHUP.patch -# 00196 -# +# 00196 # # Fix test_gdb failure on ppc64le Patch196: 00196-test-gdb-match-addr-before-builtin.patch @@ -404,31 +403,39 @@ Patch200: 00200-gettext-plural-fix.patch # Note: Backported from scl Patch201: 00201-fix-memory-leak-in-gdbm.patch +# 00203 # # test_threading fails in koji dues to it's handling of signals Patch203: 00203-disable-threading-test-koji.patch +# 00205 # # LIBPL variable in makefile takes LIBPL from configure.ac # but the LIBPL variable defined there doesn't respect libdir macro Patch205: 00205-make-libpl-respect-lib64.patch +# 00206 # # Remove hf flag from arm triplet which is used # by debian but fedora infra uses only eabi without hf Patch206: 00206-remove-hf-from-arm-triplet.patch +# 00207 # # Avoid truncated _math.o files caused by parallel builds # modified version of https://bugs.python.org/issue24421 # rhbz#1292461 Patch207: 00207-math-once.patch +# 00208 # # test_with_pip (test.test_venv.EnsurePipTest) fails on ppc64* # rhbz#1292467 Patch208: 00208-disable-test_with_pip-on-ppc.patch -# https://bugs.python.org/issue26171 +# 00209 # +# CVE-2016-5636: http://seclists.org/oss-sec/2016/q2/560 +# rhbz#1345859: https://bugzilla.redhat.com/show_bug.cgi?id=1345859 # https://hg.python.org/cpython/rev/10dad6da1b28/ +# https://hg.python.org/cpython/rev/5533a9e02b21 # Fix possible integer overflow and heap corruption in zipimporter.get_data() -# FIXED UPSTREAM -Patch209: 00209-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 @@ -1595,6 +1602,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Fri Jul 08 2016 Charalampos Stratakis - 3.5.1-12 +- Refactor patch for properly fixing CVE-2016-5636 + * Fri Jul 08 2016 Charalampos Stratakis - 3.5.1-11 - Fix test_pyexpat failure with Expat version of 2.2.0 From 18346f1df188262f951685262f979c55982bb21f Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Tue, 19 Jul 2016 12:17:53 +0000 Subject: [PATCH 262/416] - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages --- python3.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index d094297..ff4a021 100644 --- a/python3.spec +++ b/python3.spec @@ -112,7 +112,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 12%{?dist} +Release: 13%{?dist} License: Python Group: Development/Languages @@ -1602,6 +1602,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Tue Jul 19 2016 Fedora Release Engineering - 3.5.1-13 +- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages + * Fri Jul 08 2016 Charalampos Stratakis - 3.5.1-12 - Refactor patch for properly fixing CVE-2016-5636 From 4bc70e0cc0a30f16574dcbd5539be950c5f5717f Mon Sep 17 00:00:00 2001 From: Michal Toman Date: Mon, 1 Aug 2016 20:24:18 +0200 Subject: [PATCH 263/416] Build properly on MIPS --- 00242-fix-mips64-triplet.patch | 42 ++++++++++++++++++++++++++++++++++ python3.spec | 24 +++++++++++++++---- 2 files changed, 61 insertions(+), 5 deletions(-) create mode 100644 00242-fix-mips64-triplet.patch diff --git a/00242-fix-mips64-triplet.patch b/00242-fix-mips64-triplet.patch new file mode 100644 index 0000000..91bf6af --- /dev/null +++ b/00242-fix-mips64-triplet.patch @@ -0,0 +1,42 @@ +diff -urp Python-3.5.0/configure p/configure +--- Python-3.5.0/configure 2016-02-25 16:12:12.615184011 +0000 ++++ p/configure 2016-02-25 16:13:01.293412517 +0000 +@@ -5133,7 +5133,7 @@ cat >> conftest.c <> conftest.c <> conftest.c <> conftest.c < - 3.5.1-14 +- Build properly on MIPS + * Tue Jul 19 2016 Fedora Release Engineering - 3.5.1-13 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages From 77a5f91947dbea6917e148dc452c091f2507136a Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Tue, 9 Aug 2016 14:27:26 +0200 Subject: [PATCH 264/416] Fix for CVE-2016-1000110 HTTPoxy attack --- ...ch => 00209-fix-test-pyexpat-failure.patch | 0 ...7-Raise-an-error-when-STARTTLS-fails.patch | 0 ...fer-overflow-in-zipimport-module-fix.patch | 0 00242-CVE-2016-1000110-httpoxy.patch | 100 ++++++++++++++++++ ...et.patch => 00243-fix-mips64-triplet.patch | 0 python3.spec | 73 +++++++------ 6 files changed, 138 insertions(+), 35 deletions(-) rename 00211-fix-test-pyexpat-failure.patch => 00209-fix-test-pyexpat-failure.patch (100%) rename 00210-Raise-an-error-when-STARTTLS-fails.patch => 00237-Raise-an-error-when-STARTTLS-fails.patch (100%) rename 00209-CVE-2016-5636-buffer-overflow-in-zipimport-module-fix.patch => 00241-CVE-2016-5636-buffer-overflow-in-zipimport-module-fix.patch (100%) create mode 100644 00242-CVE-2016-1000110-httpoxy.patch rename 00242-fix-mips64-triplet.patch => 00243-fix-mips64-triplet.patch (100%) diff --git a/00211-fix-test-pyexpat-failure.patch b/00209-fix-test-pyexpat-failure.patch similarity index 100% rename from 00211-fix-test-pyexpat-failure.patch rename to 00209-fix-test-pyexpat-failure.patch diff --git a/00210-Raise-an-error-when-STARTTLS-fails.patch b/00237-Raise-an-error-when-STARTTLS-fails.patch similarity index 100% rename from 00210-Raise-an-error-when-STARTTLS-fails.patch rename to 00237-Raise-an-error-when-STARTTLS-fails.patch diff --git a/00209-CVE-2016-5636-buffer-overflow-in-zipimport-module-fix.patch b/00241-CVE-2016-5636-buffer-overflow-in-zipimport-module-fix.patch similarity index 100% rename from 00209-CVE-2016-5636-buffer-overflow-in-zipimport-module-fix.patch rename to 00241-CVE-2016-5636-buffer-overflow-in-zipimport-module-fix.patch diff --git a/00242-CVE-2016-1000110-httpoxy.patch b/00242-CVE-2016-1000110-httpoxy.patch new file mode 100644 index 0000000..7c17b31 --- /dev/null +++ b/00242-CVE-2016-1000110-httpoxy.patch @@ -0,0 +1,100 @@ + +# HG changeset patch +# User Senthil Kumaran +# Date 1469947146 25200 +# Node ID a0ac52ed8f7918222603b584ec8fc93d9b7bc0a5 +# Parent 4cb94e561e2db9865fb4d752f2bceefca4c6819a# Parent 3c19023c9fec5a615c25598468b44fade89049ce +[merge from 3.4] - 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 #27568 Reported and patch contributed by Rémi Rampin. + +diff --git a/Doc/howto/urllib2.rst b/Doc/howto/urllib2.rst +--- a/Doc/howto/urllib2.rst ++++ b/Doc/howto/urllib2.rst +@@ -538,6 +538,11 @@ setting up a `Basic Authentication`_ han + through a proxy. However, this can be enabled by extending urllib.request as + shown in the recipe [#]_. + ++.. note:: ++ ++ ``HTTP_PROXY`` will be ignored if a variable ``REQUEST_METHOD`` is set; see ++ the documentation on :func:`~urllib.request.getproxies`. ++ + + Sockets and Layers + ================== +diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst +--- a/Doc/library/urllib.request.rst ++++ b/Doc/library/urllib.request.rst +@@ -166,6 +166,16 @@ The :mod:`urllib.request` module defines the following functions: + cannot find it, looks for proxy information from Mac OSX System + Configuration for Mac OS X and Windows Systems Registry for Windows. + ++ .. 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). ++ + + The following classes are provided: + +@@ -275,6 +285,12 @@ 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.request.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 +@@ -225,6 +225,18 @@ class ProxyTests(unittest.TestCase): + self.env.set('NO_PROXY', 'localhost, anotherdomain.com, newdomain.com') + self.assertTrue(urllib.request.proxy_bypass_environment('anotherdomain.com')) + ++ def test_proxy_cgi_ignore(self): ++ try: ++ self.env.set('HTTP_PROXY', 'http://somewhere:3128') ++ proxies = urllib.request.getproxies_environment() ++ self.assertEqual('http://somewhere:3128', proxies['http']) ++ self.env.set('REQUEST_METHOD', 'GET') ++ proxies = urllib.request.getproxies_environment() ++ self.assertNotIn('http', proxies) ++ finally: ++ self.env.unset('REQUEST_METHOD') ++ self.env.unset('HTTP_PROXY') ++ + class urlopen_HttpTests(unittest.TestCase, FakeHTTPMixin, FakeFTPMixin): + """Test urlopen() opening a fake http connection.""" + +diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py +--- a/Lib/urllib/request.py ++++ b/Lib/urllib/request.py +@@ -2394,6 +2394,12 @@ def getproxies_environment(): + 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) + return proxies + + def proxy_bypass_environment(host): + diff --git a/00242-fix-mips64-triplet.patch b/00243-fix-mips64-triplet.patch similarity index 100% rename from 00242-fix-mips64-triplet.patch rename to 00243-fix-mips64-triplet.patch diff --git a/python3.spec b/python3.spec index 4794e45..af7d7f3 100644 --- a/python3.spec +++ b/python3.spec @@ -2,7 +2,7 @@ # Conditionals and other variables controlling the build # ====================================================== -# NOTES ON BOOTSTRAPING PYTHON 3.4: +# NOTES ON BOOTSTRAPING PYTHON 3.5: # # Due to dependency cycle between Python, pip, setuptools and # wheel caused by the rewheel patch, one has to build in the @@ -112,7 +112,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 14%{?dist} +Release: 15%{?dist} License: Python Group: Development/Languages @@ -429,54 +429,52 @@ Patch207: 00207-math-once.patch Patch208: 00208-disable-test_with_pip-on-ppc.patch # 00209 # +# Fix test breakage with version 2.2.0 of Expat +# rhbz#1353918: https://bugzilla.redhat.com/show_bug.cgi?id=1353918 +# 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#1346345: https://bugzilla.redhat.com/show_bug.cgi?id=1346345 +# FIXED UPSTREAM: https://hg.python.org/cpython/rev/d590114c2394 +# 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#1345859: https://bugzilla.redhat.com/show_bug.cgi?id=1345859 # https://hg.python.org/cpython/rev/10dad6da1b28/ # https://hg.python.org/cpython/rev/5533a9e02b21 # 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 - -# 00210 # -# CVE-2016-0772 python: smtplib StartTLS stripping attack -# rhbz#1303647: https://bugzilla.redhat.com/show_bug.cgi?id=1303647 -# rhbz#1346345: https://bugzilla.redhat.com/show_bug.cgi?id=1346345 -# FIXED UPSTREAM: https://hg.python.org/cpython/rev/d590114c2394 -# 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#1353918: https://bugzilla.redhat.com/show_bug.cgi?id=1353918 -# NOT YET FIXED UPSTREAM: http://bugs.python.org/issue27369 -Patch211: 00211-fix-test-pyexpat-failure.patch +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 Rémi Rampin +# Resolves: rhbz#1359177 +Patch242: 00242-CVE-2016-1000110-httpoxy.patch + +# 00243 # # Fix the triplet used on 64-bit MIPS # rhbz#1322526: https://bugzilla.redhat.com/show_bug.cgi?id=1322526 # Upstream uses Debian-like style mips64-linux-gnuabi64 # Fedora needs the default mips64-linux-gnu -Patch242: 00242-fix-mips64-triplet.patch +Patch243: 00243-fix-mips64-triplet.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: +# When adding new patches to "python" and "python3" in Fedora, EL, etc., +# please try to keep the patch numbers in-sync between all specfiles. # -# - use the same patch number across both specfiles for conceptually-equivalent -# fixes, ideally with the same name +# More information, and a patch number catalog, is at: # -# - 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) -# -# - 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 + # add correct arch for ppc64/ppc64le # it should be ppc64le-linux-gnu/ppc64-linux-gnu instead powerpc64le-linux-gnu/powerpc64-linux-gnu @@ -706,9 +704,10 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch207 -p1 %patch208 -p1 %patch209 -p1 -%patch210 -p1 -%patch211 -p1 +%patch237 -p1 +%patch241 -p1 %patch242 -p1 +%patch243 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1613,6 +1612,10 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Tue Aug 09 2016 Charalampos Stratakis - 3.5.1-15 +- Fix for CVE-2016-1000110 HTTPoxy attack +- SPEC file cleanup + * Mon Aug 01 2016 Michal Toman - 3.5.1-14 - Build properly on MIPS From 6cd1c5f46379304831d14e0590c17b7ee458025b Mon Sep 17 00:00:00 2001 From: Tomas Orsava Date: Mon, 15 Aug 2016 12:39:18 +0200 Subject: [PATCH 265/416] Rebased to Python 3.5.2 --- 00102-lib64.patch | 85 +++++++++-------- 00146-hashlib-fips.patch | 93 ++++++++++--------- 00200-gettext-plural-fix.patch | 12 --- 00201-fix-memory-leak-in-gdbm.patch | 10 -- 00203-disable-threading-test-koji.patch | 11 --- 00207-math-once.patch | 56 ----------- 00208-disable-test_with_pip-on-ppc.patch | 11 --- ...7-Raise-an-error-when-STARTTLS-fails.patch | 35 ------- ...fer-overflow-in-zipimport-module-fix.patch | 39 -------- 00242-CVE-2016-1000110-httpoxy.patch | 57 +++++------- 05000-autotool-intermediates.patch | 72 -------------- python3.spec | 75 +++------------ 12 files changed, 128 insertions(+), 428 deletions(-) delete mode 100644 00200-gettext-plural-fix.patch delete mode 100644 00201-fix-memory-leak-in-gdbm.patch delete mode 100644 00203-disable-threading-test-koji.patch delete mode 100644 00207-math-once.patch delete mode 100644 00208-disable-test_with_pip-on-ppc.patch delete mode 100644 00237-Raise-an-error-when-STARTTLS-fails.patch delete mode 100644 00241-CVE-2016-5636-buffer-overflow-in-zipimport-module-fix.patch delete mode 100644 05000-autotool-intermediates.patch diff --git a/00102-lib64.patch b/00102-lib64.patch index be67b9b..35a442e 100644 --- a/00102-lib64.patch +++ b/00102-lib64.patch @@ -1,6 +1,8 @@ ---- Python-3.4.0b1/Lib/distutils/command/install.py.lib64 2013-11-24 21:36:54.000000000 +0100 -+++ Python-3.4.0b1/Lib/distutils/command/install.py 2013-11-27 11:10:43.821150774 +0100 -@@ -45,14 +45,14 @@ else: +diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py +index 67db007..b16fe0f 100644 +--- a/Lib/distutils/command/install.py ++++ b/Lib/distutils/command/install.py +@@ -30,14 +30,14 @@ WINDOWS_SCHEME = { INSTALL_SCHEMES = { 'unix_prefix': { 'purelib': '$base/lib/python$py_version_short/site-packages', @@ -17,9 +19,11 @@ 'headers': '$base/include/python/$dist_name', 'scripts': '$base/bin', 'data' : '$base', ---- Python-3.4.0b1/Lib/distutils/sysconfig.py.lib64 2013-11-24 21:36:54.000000000 +0100 -+++ Python-3.4.0b1/Lib/distutils/sysconfig.py 2013-11-27 11:10:43.821150774 +0100 -@@ -141,8 +141,12 @@ +diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py +index e5c493d..a4846eb 100644 +--- a/Lib/distutils/sysconfig.py ++++ b/Lib/distutils/sysconfig.py +@@ -132,8 +132,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": @@ -33,9 +37,11 @@ if standard_lib: return libpython else: ---- Python-3.4.0b1/Lib/site.py.lib64 2013-11-24 21:36:54.000000000 +0100 -+++ Python-3.4.0b1/Lib/site.py 2013-11-27 11:10:43.822150773 +0100 -@@ -304,11 +304,15 @@ +diff --git a/Lib/site.py b/Lib/site.py +index 3f78ef5..ad1033e 100644 +--- a/Lib/site.py ++++ b/Lib/site.py +@@ -303,11 +303,15 @@ def getsitepackages(prefixes=None): seen.add(prefix) if os.sep == '/': @@ -51,9 +57,11 @@ sitepackages.append(os.path.join(prefix, "lib", "site-packages")) if sys.platform == "darwin": # for framework builds *only* we add the standard Apple ---- Python-3.4.0b1/Lib/sysconfig.py.lib64 2013-11-24 21:36:54.000000000 +0100 -+++ Python-3.4.0b1/Lib/sysconfig.py 2013-11-27 11:10:43.822150773 +0100 -@@ -20,10 +20,10 @@ +diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py +index 61451b2..b021cce 100644 +--- a/Lib/sysconfig.py ++++ b/Lib/sysconfig.py +@@ -20,10 +20,10 @@ __all__ = [ _INSTALL_SCHEMES = { 'posix_prefix': { @@ -67,7 +75,7 @@ 'include': '{installed_base}/include/python{py_version_short}{abiflags}', 'platinclude': -@@ -61,10 +61,10 @@ +@@ -61,10 +61,10 @@ _INSTALL_SCHEMES = { 'data': '{userbase}', }, 'posix_user': { @@ -81,9 +89,11 @@ 'include': '{userbase}/include/python{py_version_short}', 'scripts': '{userbase}/bin', 'data': '{userbase}', ---- Python-3.4.0b1/Lib/test/test_site.py.lib64 2013-11-24 21:36:55.000000000 +0100 -+++ Python-3.4.0b1/Lib/test/test_site.py 2013-11-27 11:10:43.822150773 +0100 -@@ -244,8 +244,8 @@ +diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py +index da20a3d..f38ce06 100644 +--- a/Lib/test/test_site.py ++++ b/Lib/test/test_site.py +@@ -248,8 +248,8 @@ class HelperFunctionsTests(unittest.TestCase): self.assertEqual(dirs[1], wanted) elif os.sep == '/': # OS X non-framwework builds, Linux, FreeBSD, etc @@ -94,9 +104,11 @@ 'site-packages') self.assertEqual(dirs[0], wanted) else: ---- Python-3.4.0b1/Makefile.pre.in.lib64 2013-11-27 11:10:43.814150786 +0100 -+++ Python-3.4.0b1/Makefile.pre.in 2013-11-27 11:10:43.823150771 +0100 -@@ -115,7 +115,7 @@ +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 58d4258..e8364f0 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -125,7 +125,7 @@ LIBDIR= @libdir@ MANDIR= @mandir@ INCLUDEDIR= @includedir@ CONFINCLUDEDIR= $(exec_prefix)/include @@ -105,20 +117,11 @@ ABIFLAGS= @ABIFLAGS@ # Detailed destination directories ---- Python-3.4.0b1/Modules/getpath.c.lib64 2013-11-24 21:36:56.000000000 +0100 -+++ Python-3.4.0b1/Modules/getpath.c 2013-11-27 11:17:33.619449704 +0100 -@@ -122,8 +122,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 -@@ -498,7 +498,7 @@ +diff --git a/Modules/getpath.c b/Modules/getpath.c +index 18deb60..27ca814 100644 +--- a/Modules/getpath.c ++++ b/Modules/getpath.c +@@ -494,7 +494,7 @@ calculate_path(void) _pythonpath = Py_DecodeLocale(PYTHONPATH, NULL); _prefix = Py_DecodeLocale(PREFIX, NULL); _exec_prefix = Py_DecodeLocale(EXEC_PREFIX, NULL); @@ -127,7 +130,7 @@ if (!_pythonpath || !_prefix || !_exec_prefix || !lib_python) { Py_FatalError( -@@ -687,7 +687,7 @@ +@@ -683,7 +683,7 @@ calculate_path(void) } else wcsncpy(zip_path, _prefix, MAXPATHLEN); @@ -136,7 +139,7 @@ bufsz = wcslen(zip_path); /* Replace "00" with version */ zip_path[bufsz - 6] = VERSION[0]; zip_path[bufsz - 5] = VERSION[2]; -@@ -699,7 +699,7 @@ +@@ -695,7 +695,7 @@ calculate_path(void) fprintf(stderr, "Could not find platform dependent libraries \n"); wcsncpy(exec_prefix, _exec_prefix, MAXPATHLEN); @@ -145,9 +148,11 @@ } /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */ ---- Python-3.4.0b1/setup.py.lib64 2013-11-24 21:36:56.000000000 +0100 -+++ Python-3.4.0b1/setup.py 2013-11-27 11:10:43.824150769 +0100 -@@ -441,7 +441,7 @@ +diff --git a/setup.py b/setup.py +index be33c46..f2779cc 100644 +--- a/setup.py ++++ b/setup.py +@@ -492,7 +492,7 @@ class PyBuildExt(build_ext): # directories (i.e. '.' and 'Include') must be first. See issue # 10520. if not cross_compiling: @@ -156,7 +161,7 @@ add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') # only change this for cross builds for 3.3, issues on Mageia if cross_compiling: -@@ -718,11 +718,11 @@ +@@ -780,11 +780,11 @@ class PyBuildExt(build_ext): elif curses_library: readline_libs.append(curses_library) elif self.compiler.find_library_file(lib_dirs + @@ -170,7 +175,7 @@ extra_link_args=readline_extra_link_args, libraries=readline_libs) ) else: -@@ -759,8 +759,8 @@ +@@ -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, diff --git a/00146-hashlib-fips.patch b/00146-hashlib-fips.patch index 3d92c34..e0cdce0 100644 --- a/00146-hashlib-fips.patch +++ b/00146-hashlib-fips.patch @@ -1,6 +1,8 @@ ---- Python-3.4.0b1/Lib/hashlib.py.hashlib-fips 2013-11-24 21:36:54.000000000 +0100 -+++ Python-3.4.0b1/Lib/hashlib.py 2013-11-27 11:45:17.073617547 +0100 -@@ -23,6 +23,16 @@ +diff --git a/Lib/hashlib.py b/Lib/hashlib.py +index 316cece..b7ad879 100644 +--- a/Lib/hashlib.py ++++ b/Lib/hashlib.py +@@ -23,6 +23,16 @@ the zlib module. Choose your hash function wisely. Some have known collision weaknesses. sha384 and sha512 will be slow on 32 bit platforms. @@ -17,7 +19,7 @@ Hash objects have these methods: - update(arg): Update the hash object with the bytes in arg. Repeated calls are equivalent to a single call with the concatenation of all -@@ -63,6 +73,19 @@ +@@ -62,6 +72,18 @@ algorithms_available = set(__always_supported) __all__ = __always_supported + ('new', 'algorithms_guaranteed', 'algorithms_available', 'pbkdf2_hmac') @@ -33,11 +35,10 @@ + kwargs.pop('usedforsecurity') + return func(*args, **kwargs) + return inner -+ __builtin_constructor_cache = {} -@@ -108,34 +131,41 @@ +@@ -100,31 +122,39 @@ def __get_openssl_constructor(name): 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. @@ -88,11 +89,8 @@ + # because we want to make sure that Fedora uses everything from OpenSSL return __get_builtin_constructor(name)(data) -- - try: - import _hashlib - new = __hash_new -@@ -215,7 +245,10 @@ + +@@ -207,7 +237,10 @@ for __func_name in __always_supported: # try them all, some may not work due to the OpenSSL # version not supporting that algorithm. try: @@ -104,14 +102,17 @@ except ValueError: import logging logging.exception('code for hash %s was not found.', __func_name) -@@ -223,3 +256,4 @@ +@@ -215,3 +248,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 __ignore_usedforsecurity ---- Python-3.4.0b1/Lib/test/test_hashlib.py 2013-11-27 11:55:42.769601363 +0100 -+++ Python-3.4.0b1/Lib/test/test_hashlib.py 2013-11-28 09:33:03.929008508 +0100 -@@ -24,7 +24,22 @@ +\ No newline at end of file +diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py +index c9b113e..60e2392 100644 +--- a/Lib/test/test_hashlib.py ++++ b/Lib/test/test_hashlib.py +@@ -24,7 +24,22 @@ from test.support import _4G, bigmemtest, import_fresh_module COMPILED_WITH_PYDEBUG = hasattr(sys, 'gettotalrefcount') c_hashlib = import_fresh_module('hashlib', fresh=['_hashlib']) @@ -135,7 +136,7 @@ def hexstr(s): assert isinstance(s, bytes), repr(s) -@@ -34,6 +49,16 @@ +@@ -34,6 +49,16 @@ def hexstr(s): r += h[(i >> 4) & 0xF] + h[i & 0xF] return r @@ -152,7 +153,7 @@ class HashLibTestCase(unittest.TestCase): supported_hash_names = ( 'md5', 'MD5', 'sha1', 'SHA1', -@@ -66,11 +91,11 @@ +@@ -63,11 +88,11 @@ class HashLibTestCase(unittest.TestCase): # For each algorithm, test the direct constructor and the use # of hashlib.new given the algorithm name. for algorithm, constructors in self.constructors_to_test.items(): @@ -167,7 +168,7 @@ constructors.add(_test_algorithm_via_hashlib_new) _hashlib = self._conditional_import_module('_hashlib') -@@ -82,26 +107,12 @@ +@@ -79,27 +104,12 @@ class HashLibTestCase(unittest.TestCase): for algorithm, constructors in self.constructors_to_test.items(): constructor = getattr(_hashlib, 'openssl_'+algorithm, None) if constructor: @@ -192,10 +193,11 @@ - if _sha512: - add_builtin_constructor('sha384') - add_builtin_constructor('sha512') - +- super(HashLibTestCase, self).__init__(*args, **kwargs) -@@ -157,9 +169,6 @@ + @property +@@ -148,9 +158,6 @@ class HashLibTestCase(unittest.TestCase): else: del sys.modules['_md5'] self.assertRaises(TypeError, get_builtin_constructor, 3) @@ -205,7 +207,7 @@ def test_hexdigest(self): for cons in self.hash_constructors: -@@ -558,6 +567,65 @@ +@@ -433,6 +440,64 @@ class HashLibTestCase(unittest.TestCase): self.assertEqual(expected_hash, hasher.hexdigest()) @@ -267,21 +269,23 @@ + + m = _hashlib.new('md5', b'abc\n', usedforsecurity=False) + self.assertEquals(m.hexdigest(), "0bee89b07a248e27c83fc3d5951213c1") -+ class KDFTests(unittest.TestCase): -@@ -639,6 +707,7 @@ - with self.assertRaisesRegex(ValueError, 'unsupported hash type'): - pbkdf2('unknown', b'pass', b'salt', 1) - +@@ -516,7 +581,7 @@ class KDFTests(unittest.TestCase): + out = pbkdf2(hash_name='sha1', password=b'password', salt=b'salt', + iterations=1, dklen=None) + self.assertEqual(out, self.pbkdf2_results['sha1'][0][0]) +- + @unittest.skip('skipped on Fedora, as we always use OpenSSL pbkdf2_hmac') def test_pbkdf2_hmac_py(self): self._test_pbkdf2_hmac(py_hashlib.pbkdf2_hmac) ---- Python-3.4.0b1/Modules/_hashopenssl.c.hashlib-fips 2013-11-24 21:36:56.000000000 +0100 -+++ Python-3.4.0b1/Modules/_hashopenssl.c 2013-11-27 12:01:57.443537463 +0100 -@@ -19,6 +19,8 @@ +diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c +index 44765ac..b8cf490 100644 +--- a/Modules/_hashopenssl.c ++++ b/Modules/_hashopenssl.c +@@ -20,6 +20,8 @@ /* EVP is the preferred interface to hashing in OpenSSL */ @@ -290,7 +294,7 @@ #include #include /* We use the object interface to discover what hashes OpenSSL supports. */ -@@ -48,11 +50,19 @@ +@@ -45,11 +47,19 @@ typedef struct { static PyTypeObject EVPtype; @@ -314,7 +318,7 @@ DEFINE_CONSTS_FOR_NEW(md5) DEFINE_CONSTS_FOR_NEW(sha1) -@@ -97,6 +107,48 @@ +@@ -92,6 +102,48 @@ EVP_hash(EVPobject *self, const void *vp, Py_ssize_t len) } } @@ -363,7 +367,7 @@ /* Internal methods for a hash object */ static void -@@ -281,15 +333,16 @@ +@@ -259,15 +311,16 @@ EVP_repr(EVPobject *self) static int EVP_tp_init(EVPobject *self, PyObject *args, PyObject *kwds) { @@ -383,7 +387,7 @@ return -1; } -@@ -310,7 +363,12 @@ +@@ -288,7 +341,12 @@ EVP_tp_init(EVPobject *self, PyObject *args, PyObject *kwds) PyBuffer_Release(&view); return -1; } @@ -397,7 +401,7 @@ self->name = name_obj; Py_INCREF(self->name); -@@ -394,7 +452,8 @@ +@@ -372,7 +430,8 @@ static PyTypeObject EVPtype = { static PyObject * EVPnew(PyObject *name_obj, const EVP_MD *digest, const EVP_MD_CTX *initial_ctx, @@ -407,7 +411,7 @@ { EVPobject *self; -@@ -409,7 +468,12 @@ +@@ -387,7 +446,12 @@ EVPnew(PyObject *name_obj, if (initial_ctx) { EVP_MD_CTX_copy(&self->ctx, initial_ctx); } else { @@ -421,7 +425,7 @@ } if (cp && len) { -@@ -433,21 +497,29 @@ +@@ -411,21 +475,29 @@ PyDoc_STRVAR(EVP_new__doc__, An optional string argument may be provided and will be\n\ automatically hashed.\n\ \n\ @@ -455,17 +459,17 @@ return NULL; } -@@ -461,7 +533,8 @@ +@@ -439,7 +511,8 @@ EVP_new(PyObject *self, PyObject *args, PyObject *kwdict) digest = EVP_get_digestbyname(name); - ret_obj = EVPnew(name_obj, digest, NULL, (unsigned char*)view.buf, view.len); + ret_obj = EVPnew(name_obj, digest, NULL, (unsigned char*)view.buf, view.len, -+ usedforsecurity); ++ usedforsecurity); if (data_obj) PyBuffer_Release(&view); -@@ -742,57 +815,115 @@ +@@ -722,57 +795,114 @@ generate_hash_name_list(void) /* @@ -508,8 +512,8 @@ + return implement_specific_EVP_new(self, args, kwdict, \ + "|Oi:" #NAME, \ + &cached_info_ ## NAME ); \ -+ } -+ + } + +static PyObject * +implement_specific_EVP_new(PyObject *self, PyObject *args, PyObject *kwdict, + const char *format, @@ -554,8 +558,8 @@ + } else { + PyErr_SetString(PyExc_ValueError, "Error initializing hash"); + } - } - ++ } ++ + if (data_obj) + PyBuffer_Release(&view); + @@ -614,11 +618,10 @@ + } + } +} -+ GEN_CONSTRUCTOR(md5) GEN_CONSTRUCTOR(sha1) -@@ -843,13 +974,10 @@ +@@ -819,13 +949,10 @@ PyInit__hashlib(void) { PyObject *m, *openssl_md_meth_names; diff --git a/00200-gettext-plural-fix.patch b/00200-gettext-plural-fix.patch deleted file mode 100644 index 93b817b..0000000 --- a/00200-gettext-plural-fix.patch +++ /dev/null @@ -1,12 +0,0 @@ -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 = b_item.decode().strip() - if not item: - continue -+ if item.startswith("#"): -+ continue - if ':' in item: - k, v = item.split(':', 1) - k = k.strip().lower() diff --git a/00201-fix-memory-leak-in-gdbm.patch b/00201-fix-memory-leak-in-gdbm.patch deleted file mode 100644 index 48839d5..0000000 --- a/00201-fix-memory-leak-in-gdbm.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- Modules/_gdbmmodule.c.orig 2013-07-08 14:54:27.803790151 +0200 -+++ Modules/_gdbmmodule.c 2013-07-08 14:55:25.006672443 +0200 -@@ -106,6 +106,7 @@ - if(okey.dsize) free(okey.dptr); - okey=key; - } -+ if(okey.dsize) free(okey.dptr); - dp->di_size = size; - } - return dp->di_size; diff --git a/00203-disable-threading-test-koji.patch b/00203-disable-threading-test-koji.patch deleted file mode 100644 index 70010fb..0000000 --- a/00203-disable-threading-test-koji.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -up Python-3.4.3/Lib/test/test_threading.py.mstuchli Python-3.4.3/Lib/test/test_threading.py ---- Python-3.4.3/Lib/test/test_threading.py.mstuchli 2015-03-10 10:00:42.917355215 +0100 -+++ Python-3.4.3/Lib/test/test_threading.py 2015-03-10 10:00:47.735373842 +0100 -@@ -988,6 +988,7 @@ class ThreadingExceptionTests(BaseTestCa - self.assertIn("ZeroDivisionError", err) - self.assertNotIn("Unhandled exception", err) - -+ @unittest.skip('Fails in Koji due to mishandled signals') - def test_print_exception_stderr_is_none_1(self): - script = r"""if True: - import sys diff --git a/00207-math-once.patch b/00207-math-once.patch deleted file mode 100644 index 572ed59..0000000 --- a/00207-math-once.patch +++ /dev/null @@ -1,56 +0,0 @@ ---- Python-3.5.1/Makefile.pre.in.kh 2015-12-17 05:51:08.466546157 -0500 -+++ Python-3.5.1/Makefile.pre.in 2015-12-17 05:52:26.207761635 -0500 -@@ -587,11 +587,15 @@ pybuilddir.txt: $(BUILDPYTHON) - exit 1 ; \ - fi - -+# This is shared by the math and cmath modules -+Modules/_math.o: Modules/_math.c Modules/_math.h -+ $(CC) -c $(CCSHARED) $(PY_CORE_CFLAGS) -o $@ $< -+ - # Build the shared modules - # Under GNU make, MAKEFLAGS are sorted and normalized; the 's' for - # -s, --silent or --quiet is always the first char. - # Under BSD make, MAKEFLAGS might be " -s -v x=y". --sharedmods: $(BUILDPYTHON) pybuilddir.txt -+sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o - @case "$$MAKEFLAGS" in \ - *\ -s*|s*) quiet="-q";; \ - *) quiet="";; \ ---- Python-3.5.1/Misc/NEWS.kh 2015-12-17 05:53:40.898929946 -0500 -+++ Python-3.5.1/Misc/NEWS 2015-12-17 05:54:28.599676136 -0500 -@@ -464,6 +464,10 @@ Build - - Issue #24986: It is now possible to build Python on Windows without errors - when external libraries are not available. - -+- Issue #24421: Compile Modules/_math.c once, before building extensions. -+ Previously it could fail to compile properly if the math and cmath builds -+ were concurrent. -+ - Windows - ------- - ---- Python-3.5.1/setup.py.kh 2015-12-17 06:38:30.950955607 -0500 -+++ Python-3.5.1/setup.py 2015-12-17 06:42:32.074722493 -0500 -@@ -582,13 +582,17 @@ class PyBuildExt(build_ext): - - # array objects - exts.append( Extension('array', ['arraymodule.c']) ) -+ -+ shared_math = 'Modules/_math.o' - # complex math library functions -- exts.append( Extension('cmath', ['cmathmodule.c', '_math.c'], -- depends=['_math.h'], -+ exts.append( Extension('cmath', ['cmathmodule.c'], -+ extra_objects=[shared_math], -+ depends=['_math.h', shared_math], - libraries=math_libs) ) - # math library functions, e.g. sin() -- exts.append( Extension('math', ['mathmodule.c', '_math.c'], -- depends=['_math.h'], -+ exts.append( Extension('math', ['mathmodule.c'], -+ extra_objects=[shared_math], -+ depends=['_math.h', shared_math], - libraries=math_libs) ) - - # time libraries: librt may be needed for clock_gettime() diff --git a/00208-disable-test_with_pip-on-ppc.patch b/00208-disable-test_with_pip-on-ppc.patch deleted file mode 100644 index 00b98ae..0000000 --- a/00208-disable-test_with_pip-on-ppc.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -up Python-3.5.1/Lib/test/test_venv.py.1292467 Python-3.5.1/Lib/test/test_venv.py ---- Python-3.5.1/Lib/test/test_venv.py.1292467 2015-12-21 13:37:44.740190595 +0100 -+++ Python-3.5.1/Lib/test/test_venv.py 2015-12-21 13:40:25.707911828 +0100 -@@ -319,6 +319,7 @@ class EnsurePipTest(BaseTest): - - # Requesting pip fails without SSL (http://bugs.python.org/issue19744) - @unittest.skipIf(ssl is None, ensurepip._MISSING_SSL_MESSAGE) -+ @unittest.skip('rhbz#1292467') - def test_with_pip(self): - rmtree(self.env_dir) - with EnvironmentVarGuard() as envvars: diff --git a/00237-Raise-an-error-when-STARTTLS-fails.patch b/00237-Raise-an-error-when-STARTTLS-fails.patch deleted file mode 100644 index 9083e61..0000000 --- a/00237-Raise-an-error-when-STARTTLS-fails.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 761db274ca898f8a92348ed5979d3d3c1b0d634a Mon Sep 17 00:00:00 2001 -From: Tomas Orsava -Date: Fri, 17 Jun 2016 16:08:11 +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#1346345: https://bugzilla.redhat.com/show_bug.cgi?id=1346345 - -Based on an upstream change by Benjamin Peterson -- in changeset 101887:d590114c2394 3.4 -- https://hg.python.org/cpython/rev/d590114c2394 ---- - Lib/smtplib.py | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/Lib/smtplib.py b/Lib/smtplib.py -index 4756973..dfbf5f9 100755 ---- a/Lib/smtplib.py -+++ b/Lib/smtplib.py -@@ -773,6 +773,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/00241-CVE-2016-5636-buffer-overflow-in-zipimport-module-fix.patch b/00241-CVE-2016-5636-buffer-overflow-in-zipimport-module-fix.patch deleted file mode 100644 index e2c8581..0000000 --- a/00241-CVE-2016-5636-buffer-overflow-in-zipimport-module-fix.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 531dfa4bcfe55d5cd1524425944b07c5b02bddf9 Mon Sep 17 00:00:00 2001 -From: Charalampos Stratakis -Date: Fri, 8 Jul 2016 17:16:41 +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 06abb31..4d0d1de 100644 ---- a/Modules/zipimport.c -+++ b/Modules/zipimport.c -@@ -1076,6 +1076,10 @@ get_data(PyObject *archive, PyObject *toc_entry) - &date, &crc)) { - return NULL; - } -+ if (data_size < 0) { -+ PyErr_Format(ZipImportError, "negative data size"); -+ return NULL; -+ } - - fp = _Py_fopen_obj(archive, "rb"); - if (!fp) -@@ -1112,6 +1116,11 @@ get_data(PyObject *archive, PyObject *toc_entry) - } - file_offset += l; /* Start of file data */ - -+ if (data_size > LONG_MAX - 1) { -+ fclose(fp); -+ PyErr_NoMemory(); -+ return NULL; -+ } - bytes_size = compress == 0 ? data_size : data_size + 1; - if (bytes_size == 0) - bytes_size++; --- -2.7.4 - diff --git a/00242-CVE-2016-1000110-httpoxy.patch b/00242-CVE-2016-1000110-httpoxy.patch index 7c17b31..244ebec 100644 --- a/00242-CVE-2016-1000110-httpoxy.patch +++ b/00242-CVE-2016-1000110-httpoxy.patch @@ -1,20 +1,8 @@ - -# HG changeset patch -# User Senthil Kumaran -# Date 1469947146 25200 -# Node ID a0ac52ed8f7918222603b584ec8fc93d9b7bc0a5 -# Parent 4cb94e561e2db9865fb4d752f2bceefca4c6819a# Parent 3c19023c9fec5a615c25598468b44fade89049ce -[merge from 3.4] - 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 #27568 Reported and patch contributed by Rémi Rampin. - diff --git a/Doc/howto/urllib2.rst b/Doc/howto/urllib2.rst +index 24a4156..d2c7991 100644 --- a/Doc/howto/urllib2.rst +++ b/Doc/howto/urllib2.rst -@@ -538,6 +538,11 @@ setting up a `Basic Authentication`_ han +@@ -538,6 +538,11 @@ setting up a `Basic Authentication`_ handler: :: through a proxy. However, this can be enabled by extending urllib.request as shown in the recipe [#]_. @@ -27,11 +15,12 @@ diff --git a/Doc/howto/urllib2.rst b/Doc/howto/urllib2.rst Sockets and Layers ================== diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst +index 6c1bfb8..1291aeb 100644 --- a/Doc/library/urllib.request.rst +++ b/Doc/library/urllib.request.rst -@@ -166,6 +166,16 @@ The :mod:`urllib.request` module defines the following functions: - cannot find it, looks for proxy information from Mac OSX System - Configuration for Mac OS X and Windows Systems Registry for Windows. +@@ -173,6 +173,16 @@ The :mod:`urllib.request` module defines the following functions: + If both lowercase and uppercase environment variables exist (and disagree), + lowercase is preferred. + .. note:: + @@ -46,25 +35,25 @@ diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst The following classes are provided: -@@ -275,6 +285,12 @@ The following classes are provided: +@@ -280,6 +290,11 @@ The following classes are provided: + list of hostname suffixes, optionally with ``:port`` appended, for example + ``cern.ch,ncsa.uiuc.edu,some.host:8080``. - To disable autodetected proxy pass an empty dictionary. - -+ .. note:: ++ .. note:: + + ``HTTP_PROXY`` will be ignored if a variable ``REQUEST_METHOD`` is set; + see the documentation on :func:`~urllib.request.getproxies`. -+ + .. class:: HTTPPasswordMgr() diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py +index 5d05f8d..c26c52a 100644 --- a/Lib/test/test_urllib.py +++ b/Lib/test/test_urllib.py -@@ -225,6 +225,18 @@ class ProxyTests(unittest.TestCase): - self.env.set('NO_PROXY', 'localhost, anotherdomain.com, newdomain.com') - self.assertTrue(urllib.request.proxy_bypass_environment('anotherdomain.com')) +@@ -232,6 +232,18 @@ class ProxyTests(unittest.TestCase): + self.assertTrue(urllib.request.proxy_bypass_environment('anotherdomain.com:8888')) + self.assertTrue(urllib.request.proxy_bypass_environment('newdomain.com:1234')) + def test_proxy_cgi_ignore(self): + try: @@ -78,13 +67,14 @@ diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py + self.env.unset('REQUEST_METHOD') + self.env.unset('HTTP_PROXY') + - class urlopen_HttpTests(unittest.TestCase, FakeHTTPMixin, FakeFTPMixin): - """Test urlopen() opening a fake http connection.""" - + def test_proxy_bypass_environment_host_match(self): + bypass = urllib.request.proxy_bypass_environment + self.env.set('NO_PROXY', diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py +index 1731fe3..3be327d 100644 --- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py -@@ -2394,6 +2394,12 @@ def getproxies_environment(): +@@ -2412,6 +2412,12 @@ def getproxies_environment(): name = name.lower() if value and name[-6:] == '_proxy': proxies[name[:-6]] = value @@ -93,8 +83,7 @@ diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py + # 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) - return proxies - - def proxy_bypass_environment(host): - ++ proxies.pop('http', None) + for name, value in os.environ.items(): + if name[-6:] == '_proxy': + name = name.lower() diff --git a/05000-autotool-intermediates.patch b/05000-autotool-intermediates.patch deleted file mode 100644 index 903cbf0..0000000 --- a/05000-autotool-intermediates.patch +++ /dev/null @@ -1,72 +0,0 @@ -diff -up ./configure.autotool-intermediates ./configure ---- ./configure.autotool-intermediates 2013-04-09 14:52:49.831773426 +0200 -+++ ./configure 2013-04-09 14:52:53.204765347 +0200 -@@ -802,6 +802,8 @@ with_thread - enable_ipv6 - with_doc_strings - with_tsc -+with_count_allocs -+with_call_profile - with_pymalloc - with_valgrind - with_systemtap -@@ -1479,6 +1481,8 @@ Optional Packages: - deprecated; use --with(out)-threads - --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)-systemtap disable/enable SystemTap support -@@ -10117,6 +10121,50 @@ $as_echo "#define WITH_TSC 1" >>confdefs - - { $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-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 diff --git a/python3.spec b/python3.spec index af7d7f3..980347d 100644 --- a/python3.spec +++ b/python3.spec @@ -111,8 +111,8 @@ # ================== Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 -Version: %{pybasever}.1 -Release: 15%{?dist} +Version: %{pybasever}.2 +Release: 1%{?dist} License: Python Group: Development/Languages @@ -382,31 +382,6 @@ Patch188: 00188-fix-lib2to3-tests-when-hashlib-doesnt-compile-properly.patch Patch189: 00189-add-rewheel-module.patch %endif -# 00194 # -# Tests requiring SIGHUP to work don't work in Koji -# see rhbz#1088233 -Patch194: temporarily-disable-tests-requiring-SIGHUP.patch - -# 00196 # -# Fix test_gdb failure on ppc64le -Patch196: 00196-test-gdb-match-addr-before-builtin.patch - -# 00200 # -# Fix for gettext plural form headers (lines that begin with "#") -# Note: Backported from scl -Patch200: 00200-gettext-plural-fix.patch - -# 00201 # -# Fixes memory leak in gdbm module (rhbz#977308) -# This was upstreamed as a part of bigger patch, but for our purposes -# this is ok: http://bugs.python.org/issue18404 -# Note: Backported from scl -Patch201: 00201-fix-memory-leak-in-gdbm.patch - -# 00203 # -# test_threading fails in koji dues to it's handling of signals -Patch203: 00203-disable-threading-test-koji.patch - # 00205 # # LIBPL variable in makefile takes LIBPL from configure.ac # but the LIBPL variable defined there doesn't respect libdir macro @@ -417,40 +392,12 @@ Patch205: 00205-make-libpl-respect-lib64.patch # by debian but fedora infra uses only eabi without hf Patch206: 00206-remove-hf-from-arm-triplet.patch -# 00207 # -# Avoid truncated _math.o files caused by parallel builds -# modified version of https://bugs.python.org/issue24421 -# rhbz#1292461 -Patch207: 00207-math-once.patch - -# 00208 # -# test_with_pip (test.test_venv.EnsurePipTest) fails on ppc64* -# rhbz#1292467 -Patch208: 00208-disable-test_with_pip-on-ppc.patch - # 00209 # # Fix test breakage with version 2.2.0 of Expat # rhbz#1353918: https://bugzilla.redhat.com/show_bug.cgi?id=1353918 # 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#1346345: https://bugzilla.redhat.com/show_bug.cgi?id=1346345 -# FIXED UPSTREAM: https://hg.python.org/cpython/rev/d590114c2394 -# 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#1345859: https://bugzilla.redhat.com/show_bug.cgi?id=1345859 -# https://hg.python.org/cpython/rev/10dad6da1b28/ -# https://hg.python.org/cpython/rev/5533a9e02b21 -# 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/ @@ -659,7 +606,7 @@ for f in md5module.c sha1module.c sha256module.c sha512module.c; do done %if 0%{with_rewheel} -%global pip_version 7.1.0 +%global pip_version 8.1.2 sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/ensurepip/__init__.py %endif @@ -696,16 +643,9 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch189 -p1 %endif -%patch194 -p1 -%patch196 -p1 -%patch203 -p1 %patch205 -p1 %patch206 -p1 -%patch207 -p1 -%patch208 -p1 %patch209 -p1 -%patch237 -p1 -%patch241 -p1 %patch242 -p1 %patch243 -p1 @@ -1612,6 +1552,15 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon Aug 15 2016 Tomas Orsava - 3.5.2-1 +- Rebased to version 3.5.2 +- Set to work with pip version 8.1.2 +- Removed patches 207, 237, 241 as fixes are already contained in Python 3.5.2 +- Removed arch or environment specific patches 194, 196, 203, and 208 + as test builds indicate they are no longer needed +- Updated patches 102, 146, and 242 to work with the new Python codebase +- Removed patches 200, 201, 5000 which weren't even being applied + * Tue Aug 09 2016 Charalampos Stratakis - 3.5.1-15 - Fix for CVE-2016-1000110 HTTPoxy attack - SPEC file cleanup From ea6fb09bb5e8a4dc55c3c7baba1d574eab711d01 Mon Sep 17 00:00:00 2001 From: Tomas Orsava Date: Tue, 16 Aug 2016 14:11:24 +0200 Subject: [PATCH 266/416] New sources have to be commited separately of course --- sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources b/sources index 106fda6..aeb1966 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -e9ea6f2623fffcdd871b7b19113fde80 Python-3.5.1.tar.xz +8906efbacfcdc7c3c9198aeefafd159e Python-3.5.2.tar.xz From b2fa0070fc17759cbb41123dc7cb7b118467f771 Mon Sep 17 00:00:00 2001 From: Tomas Orsava Date: Fri, 9 Sep 2016 13:27:29 +0200 Subject: [PATCH 267/416] Fixed .pyc bytecompilation - Updated .pyc 'bytecompilation with the newly installed interpreter' to also recompile optimized .pyc files - Removed .pyo 'bytecompilation with the newly installed interpreter', as .pyo files are no more - Resolves rhbz#1373635 --- python3.spec | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/python3.spec b/python3.spec index 980347d..c88d1a0 100644 --- a/python3.spec +++ b/python3.spec @@ -112,7 +112,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 1%{?dist} +Release: 2%{?dist} License: Python Group: Development/Languages @@ -953,16 +953,11 @@ iconv -f iso8859-1 -t utf-8 %{buildroot}/%{pylibdir}/Demo/rpc/README > README.co # Do bytecompilation with the newly installed interpreter. # This is similar to the script in macros.pybytecompile -# 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} -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("%{buildroot}")[2], optimize=0) for f in sys.argv[1:]]' || : + xargs -0 %{buildroot}%{_bindir}/python%{pybasever} -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("%{buildroot}")[2], optimize=opt) for opt in range(3) for f in sys.argv[1:]]' || : # Fixup permissions for shared libraries from non-standard 555 to standard 755: find %{buildroot} \ @@ -1552,6 +1547,13 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Fri Sep 09 2016 Tomas Orsava - 3.5.2-2 +- Updated .pyc 'bytecompilation with the newly installed interpreter' to also + recompile optimized .pyc files +- Removed .pyo 'bytecompilation with the newly installed interpreter', as .pyo + files are no more +- Resolves rhbz#1373635 + * Mon Aug 15 2016 Tomas Orsava - 3.5.2-1 - Rebased to version 3.5.2 - Set to work with pip version 8.1.2 From 5941d2af7fabbec1245fc4215c4643bc19c516b8 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Mon, 12 Sep 2016 14:45:49 +0200 Subject: [PATCH 268/416] Remove unused configure flags and update %py_byte_compile macro --- macros.pybytecompile3.5 | 4 +--- python3.spec | 10 +++++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/macros.pybytecompile3.5 b/macros.pybytecompile3.5 index a8b79b2..96d1826 100644 --- a/macros.pybytecompile3.5 +++ b/macros.pybytecompile3.5 @@ -6,7 +6,5 @@ %py_byte_compile()\ python_binary="%1"\ bytecode_compilation_path="%2"\ -find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("$RPM_BUILD_ROOT")[2]) for f in sys.argv[1:]]' || :\ -\ -find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("$RPM_BUILD_ROOT")[2]) for f in sys.argv[1:]]' || :\ +find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("$RPM_BUILD_ROOT")[2]], optimize=opt) for opt in range(2) for f in sys.argv[1:]]' || :\ %{nil} diff --git a/python3.spec b/python3.spec index c88d1a0..5e106aa 100644 --- a/python3.spec +++ b/python3.spec @@ -112,7 +112,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 2%{?dist} +Release: 3%{?dist} License: Python Group: Development/Languages @@ -735,9 +735,9 @@ BuildPython debug \ python-debug \ python%{pybasever}-debug \ %ifarch %{ix86} x86_64 ppc %{power64} - "--with-pydebug --with-tsc --with-count-allocs --with-call-profile --without-ensurepip" \ + "--with-pydebug --with-tsc --without-ensurepip" \ %else - "--with-pydebug --with-count-allocs --with-call-profile --without-ensurepip" \ + "--with-pydebug --without-ensurepip" \ %endif false \ -O0 @@ -1547,6 +1547,10 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon Sep 12 2016 Charalampos Stratakis - 3.5.2-3 +- Update %py_byte_compile macro +- Remove unused configure flags (rhbz#1374357) + * Fri Sep 09 2016 Tomas Orsava - 3.5.2-2 - Updated .pyc 'bytecompilation with the newly installed interpreter' to also recompile optimized .pyc files From 1768987fbca92f1ea4820046c3f294c8b50ec949 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Tue, 13 Sep 2016 17:08:19 +0200 Subject: [PATCH 269/416] Provide python35 for ensuring upgrade path from F23->f25 --- python3.spec | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 5e106aa..3988238 100644 --- a/python3.spec +++ b/python3.spec @@ -112,7 +112,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 3%{?dist} +Release: 4%{?dist} License: Python Group: Development/Languages @@ -440,6 +440,14 @@ Provides: python(abi) = %{pybasever} Requires: %{name}-libs%{?_isa} = %{version}-%{release} +# In order to support multiple python interpreters, apart from the system python3, +# for development purposes, new packages were introduced which can be installed in parallel +# with the main python3 package (e.g. 1369688), with the naming scheme 'python', +# however in order to keep the upgrade path clean we need to Obsolete and Provide +# these packages at the main python3 package. +Obsoletes: python%{pyshortver} +Provides: python%{pyshortver} = %{version}-%{release} + %if 0%{with_rewheel} Requires: python3-setuptools Requires: python3-pip @@ -1547,6 +1555,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Wed Sep 14 2016 Charalampos Stratakis - 3.5.2-4 +- Obsolete and Provide python35 package + * Mon Sep 12 2016 Charalampos Stratakis - 3.5.2-3 - Update %py_byte_compile macro - Remove unused configure flags (rhbz#1374357) From 05c99bb32e22ed9e04f8554c851e3c21e9e6e6ca Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 8 Oct 2016 07:17:21 +0100 Subject: [PATCH 270/416] No valgrind available on riscv64. --- python3.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 3988238..da2d3d5 100644 --- a/python3.spec +++ b/python3.spec @@ -71,7 +71,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 From c3e3d7792d2ad77cd9dd71e3c0658712c7fb0153 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sun, 9 Oct 2016 11:08:09 +0100 Subject: [PATCH 271/416] Add riscv64 to list of 64 bit arches. --- python3.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index da2d3d5..97245ae 100644 --- a/python3.spec +++ b/python3.spec @@ -860,7 +860,7 @@ install -d -m 0755 %{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} From 38b026e0ce779b25113228cf0d823c0cfef758e9 Mon Sep 17 00:00:00 2001 From: Tomas Mraz Date: Tue, 11 Oct 2016 18:29:03 +0200 Subject: [PATCH 272/416] Make it build with OpenSSL-1.1.0 based on upstream patch --- Python-3.5.2-openssl11.patch | 1307 ++++++++++++++++++++++++++++++++++ python3.spec | 9 +- 2 files changed, 1315 insertions(+), 1 deletion(-) create mode 100644 Python-3.5.2-openssl11.patch diff --git a/Python-3.5.2-openssl11.patch b/Python-3.5.2-openssl11.patch new file mode 100644 index 0000000..bb9cf5d --- /dev/null +++ b/Python-3.5.2-openssl11.patch @@ -0,0 +1,1307 @@ +diff -up Python-3.5.2/Doc/library/ssl.rst.openssl11 Python-3.5.2/Doc/library/ssl.rst +--- Python-3.5.2/Doc/library/ssl.rst.openssl11 2016-06-25 23:38:35.000000000 +0200 ++++ Python-3.5.2/Doc/library/ssl.rst 2016-10-10 16:34:37.695049119 +0200 +@@ -49,6 +49,12 @@ For more sophisticated applications, the + helps manage settings and certificates, which can then be inherited + by SSL sockets created through the :meth:`SSLContext.wrap_socket` method. + ++.. versionchanged:: 3.6 ++ ++ OpenSSL 0.9.8, 1.0.0 and 1.0.1 are deprecated and no longer supported. ++ In the future the ssl module will require at least OpenSSL 1.0.2 or ++ 1.1.0. ++ + + Functions, Constants, and Exceptions + ------------------------------------ +@@ -178,7 +184,7 @@ instead. + use. Typically, the server chooses a particular protocol version, and the + client must adapt to the server's choice. Most of the versions are not + interoperable with the other versions. If not specified, the default is +- :data:`PROTOCOL_SSLv23`; it provides the most compatibility with other ++ :data:`PROTOCOL_TLS`; it provides the most compatibility with other + versions. + + Here's a table showing which versions in a client (down the side) can connect +@@ -187,11 +193,11 @@ instead. + .. table:: + + ======================== ========= ========= ========== ========= =========== =========== +- *client* / **server** **SSLv2** **SSLv3** **SSLv23** **TLSv1** **TLSv1.1** **TLSv1.2** ++ *client* / **server** **SSLv2** **SSLv3** **TLS** **TLSv1** **TLSv1.1** **TLSv1.2** + ------------------------ --------- --------- ---------- --------- ----------- ----------- + *SSLv2* yes no yes no no no + *SSLv3* no yes yes no no no +- *SSLv23* no yes yes yes yes yes ++ *TLS* (*SSLv23*) no yes yes yes yes yes + *TLSv1* no no yes yes no no + *TLSv1.1* no no yes no yes no + *TLSv1.2* no no yes no no yes +@@ -244,7 +250,7 @@ purposes. + :const:`None`, this function can choose to trust the system's default + CA certificates instead. + +- The settings are: :data:`PROTOCOL_SSLv23`, :data:`OP_NO_SSLv2`, and ++ The settings are: :data:`PROTOCOL_TLS`, :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` +@@ -316,6 +322,11 @@ Random generation + + .. versionadded:: 3.3 + ++ .. deprecated:: 3.6 ++ ++ 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 +@@ -334,7 +345,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) + +@@ -409,7 +420,7 @@ Certificate handling + 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) ++.. function:: get_server_certificate(addr, ssl_version=PROTOCOL_TLS, 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 +@@ -425,7 +436,7 @@ Certificate handling + + .. versionchanged:: 3.5 + The default *ssl_version* is changed from :data:`PROTOCOL_SSLv3` to +- :data:`PROTOCOL_SSLv23` for maximum compatibility with modern servers. ++ :data:`PROTOCOL_TLS` for maximum compatibility with modern servers. + + .. function:: DER_cert_to_PEM_cert(DER_cert_bytes) + +@@ -451,6 +462,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:: 3.4 + + .. function:: enum_certificates(store_name) +@@ -568,11 +582,21 @@ Constants + + .. versionadded:: 3.4.4 + +-.. 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:: 3.6 ++ ++.. data:: PROTOCOL_SSLv23 ++ ++ Alias for data:`PROTOCOL_TLS`. ++ ++ .. deprecated:: 3.6 ++ ++ Use data:`PROTOCOL_TLS` instead. ++ + .. data:: PROTOCOL_SSLv2 + + Selects SSL version 2 as the channel encryption protocol. +@@ -584,6 +608,10 @@ Constants + + SSL version 2 is insecure. Its use is highly discouraged. + ++ .. deprecated:: 3.6 ++ ++ OpenSSL has removed support for SSLv2. ++ + .. data:: PROTOCOL_SSLv3 + + Selects SSL version 3 as the channel encryption protocol. +@@ -595,10 +623,20 @@ Constants + + SSL version 3 is insecure. Its use is highly discouraged. + ++ .. deprecated:: 3.6 ++ ++ OpenSSL has deprecated all version specific protocols. Use the default ++ protocol data:`PROTOCOL_TLS` with flags like data:`OP_NO_SSLv3` instead. ++ + .. data:: PROTOCOL_TLSv1 + + Selects TLS version 1.0 as the channel encryption protocol. + ++ .. deprecated:: 3.6 ++ ++ OpenSSL has deprecated all version specific protocols. Use the default ++ protocol data:`PROTOCOL_TLS` with flags like data:`OP_NO_SSLv3` instead. ++ + .. data:: PROTOCOL_TLSv1_1 + + Selects TLS version 1.1 as the channel encryption protocol. +@@ -606,6 +644,11 @@ Constants + + .. versionadded:: 3.4 + ++ .. deprecated:: 3.6 ++ ++ OpenSSL has deprecated all version specific protocols. Use the default ++ protocol data:`PROTOCOL_TLS` with flags like data:`OP_NO_SSLv3` instead. ++ + .. data:: PROTOCOL_TLSv1_2 + + Selects TLS version 1.2 as the channel encryption protocol. This is the +@@ -614,6 +657,11 @@ Constants + + .. versionadded:: 3.4 + ++ .. deprecated:: 3.6 ++ ++ OpenSSL has deprecated all version specific protocols. Use the default ++ protocol data:`PROTOCOL_TLS` with flags like data:`OP_NO_SSLv3` instead. ++ + .. data:: OP_ALL + + Enables workarounds for various bugs present in other SSL implementations. +@@ -625,23 +673,32 @@ Constants + .. data:: OP_NO_SSLv2 + + Prevents an SSLv2 connection. This option is only applicable in +- conjunction with :const:`PROTOCOL_SSLv23`. It prevents the peers from ++ conjunction with :const:`PROTOCOL_TLS`. It prevents the peers from + choosing SSLv2 as the protocol version. + + .. versionadded:: 3.2 + ++ .. deprecated:: 3.6 ++ ++ SSLv2 is deprecated ++ ++ + .. data:: OP_NO_SSLv3 + + Prevents an SSLv3 connection. This option is only applicable in +- conjunction with :const:`PROTOCOL_SSLv23`. It prevents the peers from ++ conjunction with :const:`PROTOCOL_TLS`. It prevents the peers from + choosing SSLv3 as the protocol version. + + .. versionadded:: 3.2 + ++ .. deprecated:: 3.6 ++ ++ SSLv3 is deprecated ++ + .. data:: OP_NO_TLSv1 + + Prevents a TLSv1 connection. This option is only applicable in +- conjunction with :const:`PROTOCOL_SSLv23`. It prevents the peers from ++ conjunction with :const:`PROTOCOL_TLS`. It prevents the peers from + choosing TLSv1 as the protocol version. + + .. versionadded:: 3.2 +@@ -649,7 +706,7 @@ Constants + .. 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 ++ with :const:`PROTOCOL_TLS`. It prevents the peers from choosing TLSv1.1 as + the protocol version. Available only with openssl version 1.0.1+. + + .. versionadded:: 3.4 +@@ -657,7 +714,7 @@ Constants + .. 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 ++ with :const:`PROTOCOL_TLS`. It prevents the peers from choosing TLSv1.2 as + the protocol version. Available only with openssl version 1.0.1+. + + .. versionadded:: 3.4 +@@ -1081,17 +1138,21 @@ such as SSL configuration options, certi + 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) ++.. class:: SSLContext(protocol=PROTOCOL_TLS) + +- Create a new SSL context. You must pass *protocol* which must be one ++ Create a new SSL context. You may pass *protocol* which must be one + of the ``PROTOCOL_*`` constants defined in this module. +- :data:`PROTOCOL_SSLv23` is currently recommended for maximum +- interoperability. ++ :data:`PROTOCOL_TLS` is currently recommended for maximum ++ interoperability and default value. + + .. seealso:: + :func:`create_default_context` lets the :mod:`ssl` module choose + security settings for a given purpose. + ++ .. versionchanged:: 3.6 ++ ++ :data:`PROTOCOL_TLS` is the default value. ++ + + :class:`SSLContext` objects have the following methods and attributes: + +@@ -1232,6 +1293,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:: 3.5 + + .. method:: SSLContext.set_npn_protocols(protocols) +@@ -1598,7 +1662,7 @@ If you prefer to tune security settings + a context from scratch (but beware that you might not get the settings + right):: + +- >>> context = ssl.SSLContext(ssl.PROTOCOL_SSLv23) ++ >>> context = ssl.SSLContext(ssl.PROTOCOL_TLS) + >>> context.verify_mode = ssl.CERT_REQUIRED + >>> context.check_hostname = True + >>> context.load_verify_locations("/etc/ssl/certs/ca-bundle.crt") +@@ -1999,15 +2063,17 @@ Protocol versions + + SSL versions 2 and 3 are considered insecure and are 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 ++recommended to use :const:`PROTOCOL_TLS` as the protocol version and then + disable SSLv2 and SSLv3 explicitly using the :data:`SSLContext.options` + attribute:: + +- context = ssl.SSLContext(ssl.PROTOCOL_SSLv23) ++ context = ssl.SSLContext(ssl.PROTOCOL_TLS) + context.options |= ssl.OP_NO_SSLv2 + context.options |= ssl.OP_NO_SSLv3 ++ context.options |= ssl.OP_NO_TLSv1 ++ context.options |= ssl.OP_NO_TLSv1_1 + +-The SSL context created above will only allow TLSv1 and later (if ++The SSL context created above will only allow TLSv1.2 and later (if + supported by your system) connections. + + Cipher selection +diff -up Python-3.5.2/Lib/ssl.py.openssl11 Python-3.5.2/Lib/ssl.py +--- Python-3.5.2/Lib/ssl.py.openssl11 2016-06-25 23:38:36.000000000 +0200 ++++ Python-3.5.2/Lib/ssl.py 2016-10-10 16:34:37.695049119 +0200 +@@ -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 +@@ -128,9 +129,10 @@ from _ssl import _OPENSSL_API_VERSION + + _IntEnum._convert( + '_SSLMethod', __name__, +- lambda name: name.startswith('PROTOCOL_'), ++ lambda name: name.startswith('PROTOCOL_') and name != 'PROTOCOL_SSLv23', + source=_ssl) + ++PROTOCOL_SSLv23 = _SSLMethod.PROTOCOL_SSLv23 = _SSLMethod.PROTOCOL_TLS + _PROTOCOL_NAMES = {value: name for name, value in _SSLMethod.__members__.items()} + + try: +@@ -357,13 +359,13 @@ class SSLContext(_SSLContext): + __slots__ = ('protocol', '__weakref__') + _windows_cert_stores = ("CA", "ROOT") + +- def __new__(cls, protocol, *args, **kwargs): ++ def __new__(cls, protocol=PROTOCOL_TLS, *args, **kwargs): + self = _SSLContext.__new__(cls, protocol) + if protocol != _SSLv2_IF_EXISTS: + self.set_ciphers(_DEFAULT_CIPHERS) + return self + +- def __init__(self, protocol): ++ def __init__(self, protocol=PROTOCOL_TLS): + self.protocol = protocol + + def wrap_socket(self, sock, server_side=False, +@@ -438,7 +440,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 +@@ -475,7 +477,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): +@@ -666,7 +668,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, +@@ -1056,7 +1058,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): +@@ -1125,7 +1127,7 @@ def PEM_cert_to_DER_cert(pem_cert_string + d = pem_cert_string.strip()[len(PEM_HEADER):-len(PEM_FOOTER)] + return base64.decodebytes(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 -up Python-3.5.2/Lib/test/test_ssl.py.openssl11 Python-3.5.2/Lib/test/test_ssl.py +--- Python-3.5.2/Lib/test/test_ssl.py.openssl11 2016-06-25 23:38:37.000000000 +0200 ++++ Python-3.5.2/Lib/test/test_ssl.py 2016-10-10 16:37:52.812573136 +0200 +@@ -23,6 +23,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) +@@ -143,8 +146,8 @@ class BasicSocketTests(unittest.TestCase + def test_str_for_enums(self): + # Make sure that the PROTOCOL_* constants have enum-like string + # reprs. +- proto = ssl.PROTOCOL_SSLv23 +- self.assertEqual(str(proto), '_SSLMethod.PROTOCOL_SSLv23') ++ proto = ssl.PROTOCOL_TLS ++ self.assertEqual(str(proto), '_SSLMethod.PROTOCOL_TLS') + ctx = ssl.SSLContext(proto) + self.assertIs(ctx.protocol, proto) + +@@ -312,8 +315,8 @@ 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)), ++ 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)), +@@ -790,7 +793,8 @@ class ContextTests(unittest.TestCase): + def test_constructor(self): + for protocol in PROTOCOLS: + ssl.SSLContext(protocol) +- self.assertRaises(TypeError, ssl.SSLContext) ++ ctx = ssl.SSLContext() ++ self.assertEqual(ctx.protocol, ssl.PROTOCOL_TLS) + self.assertRaises(ValueError, ssl.SSLContext, -1) + self.assertRaises(ValueError, ssl.SSLContext, 42) + +@@ -811,15 +815,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 + # Ubuntu has OP_NO_SSLv3 forced on by default + self.assertEqual(0, ctx.options & ~ssl.OP_NO_SSLv3) +@@ -1155,6 +1159,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: +@@ -1750,13 +1755,13 @@ class NetworkedBIOTests(unittest.TestCas + sslobj = ctx.wrap_bio(incoming, outgoing, False, REMOTE_HOST) + self.assertIs(sslobj._sslobj.owner, sslobj) + self.assertIsNone(sslobj.cipher()) +- self.assertIsNone(sslobj.shared_ciphers()) ++ self.assertIsNotNone(sslobj.shared_ciphers()) + self.assertRaises(ValueError, sslobj.getpeercert) + if 'tls-unique' in ssl.CHANNEL_BINDING_TYPES: + self.assertIsNone(sslobj.get_channel_binding('tls-unique')) + self.ssl_io_loop(sock, incoming, outgoing, sslobj.do_handshake) + self.assertTrue(sslobj.cipher()) +- self.assertIsNone(sslobj.shared_ciphers()) ++ self.assertIsNotNone(sslobj.shared_ciphers()) + self.assertTrue(sslobj.getpeercert()) + if 'tls-unique' in ssl.CHANNEL_BINDING_TYPES: + self.assertTrue(sslobj.get_channel_binding('tls-unique')) +@@ -2980,7 +2985,7 @@ else: + with 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") +@@ -3122,24 +3127,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 +@@ -3287,13 +3304,23 @@ else: + client_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1) + client_context.verify_mode = ssl.CERT_REQUIRED + client_context.load_verify_locations(SIGNING_CA) +- client_context.set_ciphers("RC4") +- server_context.set_ciphers("AES:RC4") ++ if ssl.OPENSSL_VERSION_INFO >= (1, 0, 2): ++ client_context.set_ciphers("AES128:AES256") ++ server_context.set_ciphers("AES256") ++ alg1 = "AES256" ++ alg2 = "AES-256" ++ else: ++ client_context.set_ciphers("AES:3DES") ++ server_context.set_ciphers("3DES") ++ alg1 = "3DES" ++ alg2 = "DES-CBC3" ++ + stats = server_params_test(client_context, server_context) + ciphers = stats['server_shared_ciphers'][0] + self.assertGreater(len(ciphers), 0) + for name, tls_version, bits in ciphers: +- self.assertIn("RC4", name.split("-")) ++ if not alg1 in name.split("-") and alg2 not in name: ++ self.fail(name) + + def test_read_write_after_close_raises_valuerror(self): + context = ssl.SSLContext(ssl.PROTOCOL_SSLv23) +diff -up Python-3.5.2/Modules/_hashopenssl.c.openssl11 Python-3.5.2/Modules/_hashopenssl.c +--- Python-3.5.2/Modules/_hashopenssl.c.openssl11 2016-10-10 16:34:15.460533587 +0200 ++++ Python-3.5.2/Modules/_hashopenssl.c 2016-10-10 17:07:28.883123976 +0200 +@@ -23,7 +23,6 @@ + #include + #include + #include +-#include + /* We use the object interface to discover what hashes OpenSSL supports. */ + #include + #include "openssl/err.h" +@@ -34,11 +33,22 @@ + #define HASH_OBJ_CONSTRUCTOR 0 + #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 ++#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 +@@ -51,9 +61,6 @@ static PyTypeObject EVPtype; + 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; +@@ -69,19 +76,57 @@ DEFINE_CONSTS_FOR_NEW(sha384) + DEFINE_CONSTS_FOR_NEW(sha512) + + ++/* 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; + } +@@ -96,7 +141,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; + } +@@ -153,16 +198,19 @@ 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); ++ result = EVP_MD_CTX_copy(new_ctx_p, self->ctx); + LEAVE_HASHLIB(self); ++ return result; + } + + /* External methods for a hash object */ +@@ -178,7 +226,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; + } + +@@ -189,16 +239,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 = PyBytes_FromStringAndSize((const char *)digest, digest_size); +- EVP_MD_CTX_cleanup(&temp_ctx); ++ EVP_MD_CTX_free(temp_ctx); + return retval; + } + +@@ -209,15 +267,23 @@ 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; + unsigned int 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); + + return _Py_strhex((const char *)digest, digest_size); + } +@@ -271,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); + } + +@@ -279,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); + } + +@@ -341,8 +407,8 @@ EVP_tp_init(EVPobject *self, PyObject *a + PyBuffer_Release(&view); + return -1; + } +- mc_ctx_init(&self->ctx, usedforsecurity); +- if (!EVP_DigestInit_ex(&self->ctx, digest, NULL)) { ++ mc_ctx_init(self->ctx, usedforsecurity); ++ if (!EVP_DigestInit_ex(self->ctx, digest, NULL)) { + set_evp_exception(); + PyBuffer_Release(&view); + return -1; +@@ -444,10 +510,10 @@ 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 { +- mc_ctx_init(&self->ctx, usedforsecurity); +- if (!EVP_DigestInit_ex(&self->ctx, digest, NULL)) { ++ mc_ctx_init(self->ctx, usedforsecurity); ++ if (!EVP_DigestInit_ex(self->ctx, digest, NULL)) { + set_evp_exception(); + Py_DECREF(self); + return NULL; +@@ -526,6 +592,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 +@@ -607,37 +674,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\ +@@ -719,10 +757,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) { +@@ -890,13 +935,15 @@ init_constructor_constant(EVPCachedInfo + 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], ++ cached_info->ctx_ptrs[i] = EVP_MD_CTX_new(); ++ if (cached_info->ctx_ptrs[i] == NULL) ++ break; ++ mc_ctx_init(cached_info->ctx_ptrs[i], i); ++ if (EVP_DigestInit_ex(cached_info->ctx_ptrs[i], + EVP_get_digestbyname(name), NULL)) { +- /* Success: */ +- cached_info->ctx_ptrs[i] = &cached_info->ctxs[i]; + } else { + /* Failure: */ ++ EVP_MD_CTX_free(cached_info->ctx_ptrs[i]); + cached_info->ctx_ptrs[i] = NULL; + cached_info->error_msgs[i] = error_msg_for_last_error(); + } +diff -up Python-3.5.2/Modules/_ssl.c.openssl11 Python-3.5.2/Modules/_ssl.c +--- Python-3.5.2/Modules/_ssl.c.openssl11 2016-06-25 23:38:38.000000000 +0200 ++++ Python-3.5.2/Modules/_ssl.c 2016-10-10 16:34:37.699049212 +0200 +@@ -55,6 +55,14 @@ static PySocketModule_APIObject PySocket + #include + #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" +@@ -91,6 +99,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 + */ +@@ -113,6 +125,72 @@ struct py_ssl_library_code { + # define HAVE_ALPN + #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 int BIO_up_ref(BIO *b) ++{ ++ CRYPTO_add(&b->references, 1, CRYPTO_LOCK_BIO); ++ return 1; ++} ++ ++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, +@@ -143,7 +221,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, +@@ -524,8 +602,8 @@ newPySSLSocket(PySSLContext *sslctx, PyS + /* BIOs are reference counted and SSL_set_bio borrows our reference. + * To prevent a double free in memory_bio_dealloc() we need to take an + * extra reference here. */ +- CRYPTO_add(&inbio->bio->references, 1, CRYPTO_LOCK_BIO); +- CRYPTO_add(&outbio->bio->references, 1, CRYPTO_LOCK_BIO); ++ BIO_up_ref(inbio->bio); ++ BIO_up_ref(outbio->bio); + SSL_set_bio(self->ssl, inbio->bio, outbio->bio); + } + mode = SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER; +@@ -736,7 +814,7 @@ _create_tuple_for_X509_NAME (X509_NAME * + + /* 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); +@@ -753,7 +831,7 @@ _create_tuple_for_X509_NAME (X509_NAME * + 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); +@@ -851,18 +929,18 @@ _get_peer_alt_names (X509 *certificate) + 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 */ +@@ -1073,13 +1151,11 @@ _get_crl_dp(X509 *certificate) { + 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; +@@ -1449,14 +1525,13 @@ static PyObject * + _ssl__SSLSocket_shared_ciphers_impl(PySSLSocket *self) + /*[clinic end generated code: output=3d174ead2e42c4fd input=0bfe149da8fe6306]*/ + { +- SSL_SESSION *sess = SSL_get_session(self->ssl); + STACK_OF(SSL_CIPHER) *ciphers; + int i; + PyObject *res; + +- if (!sess || !sess->ciphers) ++ ciphers = SSL_get_ciphers(self->ssl); ++ if (!ciphers) + Py_RETURN_NONE; +- ciphers = sess->ciphers; + res = PyList_New(sk_SSL_CIPHER_num(ciphers)); + if (!res) + return NULL; +@@ -1565,9 +1640,9 @@ _ssl__SSLSocket_compression_impl(PySSLSo + 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 PyUnicode_DecodeFSDefault(short_name); +@@ -2245,8 +2320,8 @@ _ssl__SSLContext_impl(PyTypeObject *type + 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 +@@ -2308,8 +2383,9 @@ _ssl__SSLContext_impl(PyTypeObject *type + #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 + { +@@ -2576,10 +2652,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); + } + +@@ -2587,22 +2665,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; + } +@@ -2779,8 +2859,8 @@ _ssl__SSLContext_load_cert_chain_impl(Py + /*[clinic end generated code: output=9480bc1c380e2095 input=7cf9ac673cbee6fc]*/ + { + PyObject *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; ++ 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; + +@@ -2907,8 +2987,9 @@ _add_ca_certs(PySSLContext *self, void * + 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; +@@ -3434,25 +3515,24 @@ _ssl__SSLContext_cert_store_stats_impl(P + /*[clinic end generated code: output=5f356f4d9cca874d input=eb40dd0f6d0e40cf]*/ + { + 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 +@@ -3482,6 +3562,7 @@ _ssl__SSLContext_get_ca_certs_impl(PySSL + /*[clinic end generated code: output=0d58f148f37e2938 input=6887b5a09b7f9076]*/ + { + X509_STORE *store; ++ STACK_OF(X509_OBJECT) *objs; + PyObject *ci = NULL, *rlist = NULL; + int i; + +@@ -3490,17 +3571,18 @@ _ssl__SSLContext_get_ca_certs_impl(PySSL + } + + 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; + } +@@ -4364,10 +4446,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; + +@@ -4448,7 +4532,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\ +@@ -4517,11 +4601,16 @@ PyInit__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 NULL; + } ++#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 */ +@@ -4668,7 +4757,9 @@ PyInit__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 diff --git a/python3.spec b/python3.spec index 97245ae..73aca06 100644 --- a/python3.spec +++ b/python3.spec @@ -112,7 +112,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 4%{?dist} +Release: 5%{?dist} License: Python Group: Development/Languages @@ -413,6 +413,9 @@ Patch242: 00242-CVE-2016-1000110-httpoxy.patch # Fedora needs the default mips64-linux-gnu Patch243: 00243-fix-mips64-triplet.patch +# Make it build with OpenSSL-1.1.0 based on upstream patch +Patch244: Python-3.5.2-openssl11.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -656,6 +659,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch209 -p1 %patch242 -p1 %patch243 -p1 +%patch244 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1555,6 +1559,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Tue Oct 10 2016 Tomáš Mráz - 3.5.2-5 +- Make it build with OpenSSL-1.1.0 based on upstream patch + * Wed Sep 14 2016 Charalampos Stratakis - 3.5.2-4 - Obsolete and Provide python35 package From 55d65adde06c9230da88f54f92cf98d35fa37e16 Mon Sep 17 00:00:00 2001 From: Tomas Mraz Date: Tue, 11 Oct 2016 18:30:54 +0200 Subject: [PATCH 273/416] Fix changelog date in previous commit. --- python3.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 73aca06..66f3f76 100644 --- a/python3.spec +++ b/python3.spec @@ -1559,7 +1559,7 @@ rm -fr %{buildroot} # ====================================================== %changelog -* Tue Oct 10 2016 Tomáš Mráz - 3.5.2-5 +* Tue Oct 11 2016 Tomáš Mráz - 3.5.2-5 - Make it build with OpenSSL-1.1.0 based on upstream patch * Wed Sep 14 2016 Charalampos Stratakis - 3.5.2-4 From f7bd058f3c36e9e60e0fc65516a817153c8c597a Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Wed, 12 Oct 2016 16:52:17 +0200 Subject: [PATCH 274/416] Port ssl and hashlib modules to OpenSSL 1.1.0 and drop hashlib patch --- ...ort-ssl-and-hashlib-to-OpenSSL-1.1.0.patch | 307 +++++++++--------- python3.spec | 40 ++- 2 files changed, 189 insertions(+), 158 deletions(-) rename Python-3.5.2-openssl11.patch => 00247-port-ssl-and-hashlib-to-OpenSSL-1.1.0.patch (86%) diff --git a/Python-3.5.2-openssl11.patch b/00247-port-ssl-and-hashlib-to-OpenSSL-1.1.0.patch similarity index 86% rename from Python-3.5.2-openssl11.patch rename to 00247-port-ssl-and-hashlib-to-OpenSSL-1.1.0.patch index bb9cf5d..5760d67 100644 --- a/Python-3.5.2-openssl11.patch +++ b/00247-port-ssl-and-hashlib-to-OpenSSL-1.1.0.patch @@ -1,20 +1,15 @@ -diff -up Python-3.5.2/Doc/library/ssl.rst.openssl11 Python-3.5.2/Doc/library/ssl.rst ---- Python-3.5.2/Doc/library/ssl.rst.openssl11 2016-06-25 23:38:35.000000000 +0200 -+++ Python-3.5.2/Doc/library/ssl.rst 2016-10-10 16:34:37.695049119 +0200 -@@ -49,6 +49,12 @@ For more sophisticated applications, the - helps manage settings and certificates, which can then be inherited - by SSL sockets created through the :meth:`SSLContext.wrap_socket` method. - -+.. versionchanged:: 3.6 -+ -+ OpenSSL 0.9.8, 1.0.0 and 1.0.1 are deprecated and no longer supported. -+ In the future the ssl module will require at least OpenSSL 1.0.2 or -+ 1.1.0. -+ - - Functions, Constants, and Exceptions - ------------------------------------ -@@ -178,7 +184,7 @@ instead. + +# HG changeset patch +# User Christian Heimes +# Date 1473110345 -7200 +# Node ID 5c75b315152b714f7c84258ea511b461e2c06154 +# Parent 82467d0dbaea31a7971d1429ca5f4a251a995f33 +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 +@@ -178,7 +178,7 @@ instead. use. Typically, the server chooses a particular protocol version, and the client must adapt to the server's choice. Most of the versions are not interoperable with the other versions. If not specified, the default is @@ -23,7 +18,7 @@ diff -up Python-3.5.2/Doc/library/ssl.rst.openssl11 Python-3.5.2/Doc/library/ssl versions. Here's a table showing which versions in a client (down the side) can connect -@@ -187,11 +193,11 @@ instead. +@@ -187,11 +187,11 @@ instead. .. table:: ======================== ========= ========= ========== ========= =========== =========== @@ -37,7 +32,7 @@ diff -up Python-3.5.2/Doc/library/ssl.rst.openssl11 Python-3.5.2/Doc/library/ssl *TLSv1* no no yes yes no no *TLSv1.1* no no yes no yes no *TLSv1.2* no no yes no no yes -@@ -244,7 +250,7 @@ purposes. +@@ -244,7 +244,7 @@ purposes. :const:`None`, this function can choose to trust the system's default CA certificates instead. @@ -46,11 +41,11 @@ diff -up Python-3.5.2/Doc/library/ssl.rst.openssl11 Python-3.5.2/Doc/library/ssl :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` -@@ -316,6 +322,11 @@ Random generation +@@ -316,6 +316,11 @@ Random generation .. versionadded:: 3.3 -+ .. deprecated:: 3.6 ++ .. deprecated:: 3.5.3 + + OpenSSL has deprecated :func:`ssl.RAND_pseudo_bytes`, use + :func:`ssl.RAND_bytes` instead. @@ -58,7 +53,7 @@ diff -up Python-3.5.2/Doc/library/ssl.rst.openssl11 Python-3.5.2/Doc/library/ssl .. function:: RAND_status() Return ``True`` if the SSL pseudo-random number generator has been seeded -@@ -334,7 +345,7 @@ Random generation +@@ -334,7 +339,7 @@ Random generation See http://egd.sourceforge.net/ or http://prngd.sourceforge.net/ for sources of entropy-gathering daemons. @@ -67,7 +62,7 @@ diff -up Python-3.5.2/Doc/library/ssl.rst.openssl11 Python-3.5.2/Doc/library/ssl .. function:: RAND_add(bytes, entropy) -@@ -409,7 +420,7 @@ Certificate handling +@@ -409,7 +414,7 @@ Certificate handling previously. Return an integer (no fractions of a second in the input format) @@ -76,7 +71,7 @@ diff -up Python-3.5.2/Doc/library/ssl.rst.openssl11 Python-3.5.2/Doc/library/ssl 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 -@@ -425,7 +436,7 @@ Certificate handling +@@ -425,7 +430,7 @@ Certificate handling .. versionchanged:: 3.5 The default *ssl_version* is changed from :data:`PROTOCOL_SSLv3` to @@ -85,7 +80,7 @@ diff -up Python-3.5.2/Doc/library/ssl.rst.openssl11 Python-3.5.2/Doc/library/ssl .. function:: DER_cert_to_PEM_cert(DER_cert_bytes) -@@ -451,6 +462,9 @@ Certificate handling +@@ -451,6 +456,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 @@ -95,7 +90,7 @@ diff -up Python-3.5.2/Doc/library/ssl.rst.openssl11 Python-3.5.2/Doc/library/ssl .. versionadded:: 3.4 .. function:: enum_certificates(store_name) -@@ -568,11 +582,21 @@ Constants +@@ -568,11 +576,21 @@ Constants .. versionadded:: 3.4.4 @@ -105,35 +100,35 @@ diff -up Python-3.5.2/Doc/library/ssl.rst.openssl11 Python-3.5.2/Doc/library/ssl 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:: 3.6 ++ .. versionadded:: 3.5.3 + +.. data:: PROTOCOL_SSLv23 + + Alias for data:`PROTOCOL_TLS`. + -+ .. deprecated:: 3.6 ++ .. deprecated:: 3.5.3 + + Use data:`PROTOCOL_TLS` instead. + .. data:: PROTOCOL_SSLv2 Selects SSL version 2 as the channel encryption protocol. -@@ -584,6 +608,10 @@ Constants +@@ -584,6 +602,10 @@ Constants SSL version 2 is insecure. Its use is highly discouraged. -+ .. deprecated:: 3.6 ++ .. deprecated:: 3.5.3 + + OpenSSL has removed support for SSLv2. + .. data:: PROTOCOL_SSLv3 Selects SSL version 3 as the channel encryption protocol. -@@ -595,10 +623,20 @@ Constants +@@ -595,10 +617,20 @@ Constants SSL version 3 is insecure. Its use is highly discouraged. -+ .. deprecated:: 3.6 ++ .. deprecated:: 3.5.3 + + OpenSSL has deprecated all version specific protocols. Use the default + protocol data:`PROTOCOL_TLS` with flags like data:`OP_NO_SSLv3` instead. @@ -142,7 +137,7 @@ diff -up Python-3.5.2/Doc/library/ssl.rst.openssl11 Python-3.5.2/Doc/library/ssl Selects TLS version 1.0 as the channel encryption protocol. -+ .. deprecated:: 3.6 ++ .. deprecated:: 3.5.3 + + OpenSSL has deprecated all version specific protocols. Use the default + protocol data:`PROTOCOL_TLS` with flags like data:`OP_NO_SSLv3` instead. @@ -150,11 +145,11 @@ diff -up Python-3.5.2/Doc/library/ssl.rst.openssl11 Python-3.5.2/Doc/library/ssl .. data:: PROTOCOL_TLSv1_1 Selects TLS version 1.1 as the channel encryption protocol. -@@ -606,6 +644,11 @@ Constants +@@ -606,6 +638,11 @@ Constants .. versionadded:: 3.4 -+ .. deprecated:: 3.6 ++ .. deprecated:: 3.5.3 + + OpenSSL has deprecated all version specific protocols. Use the default + protocol data:`PROTOCOL_TLS` with flags like data:`OP_NO_SSLv3` instead. @@ -162,11 +157,11 @@ diff -up Python-3.5.2/Doc/library/ssl.rst.openssl11 Python-3.5.2/Doc/library/ssl .. data:: PROTOCOL_TLSv1_2 Selects TLS version 1.2 as the channel encryption protocol. This is the -@@ -614,6 +657,11 @@ Constants +@@ -614,6 +651,11 @@ Constants .. versionadded:: 3.4 -+ .. deprecated:: 3.6 ++ .. deprecated:: 3.5.3 + + OpenSSL has deprecated all version specific protocols. Use the default + protocol data:`PROTOCOL_TLS` with flags like data:`OP_NO_SSLv3` instead. @@ -174,7 +169,7 @@ diff -up Python-3.5.2/Doc/library/ssl.rst.openssl11 Python-3.5.2/Doc/library/ssl .. data:: OP_ALL Enables workarounds for various bugs present in other SSL implementations. -@@ -625,23 +673,32 @@ Constants +@@ -625,23 +667,32 @@ Constants .. data:: OP_NO_SSLv2 Prevents an SSLv2 connection. This option is only applicable in @@ -184,7 +179,7 @@ diff -up Python-3.5.2/Doc/library/ssl.rst.openssl11 Python-3.5.2/Doc/library/ssl .. versionadded:: 3.2 -+ .. deprecated:: 3.6 ++ .. deprecated:: 3.5.3 + + SSLv2 is deprecated + @@ -198,7 +193,7 @@ diff -up Python-3.5.2/Doc/library/ssl.rst.openssl11 Python-3.5.2/Doc/library/ssl .. versionadded:: 3.2 -+ .. deprecated:: 3.6 ++ .. deprecated:: 3.5.3 + + SSLv3 is deprecated + @@ -210,7 +205,7 @@ diff -up Python-3.5.2/Doc/library/ssl.rst.openssl11 Python-3.5.2/Doc/library/ssl choosing TLSv1 as the protocol version. .. versionadded:: 3.2 -@@ -649,7 +706,7 @@ Constants +@@ -649,7 +700,7 @@ Constants .. data:: OP_NO_TLSv1_1 Prevents a TLSv1.1 connection. This option is only applicable in conjunction @@ -219,7 +214,7 @@ diff -up Python-3.5.2/Doc/library/ssl.rst.openssl11 Python-3.5.2/Doc/library/ssl the protocol version. Available only with openssl version 1.0.1+. .. versionadded:: 3.4 -@@ -657,7 +714,7 @@ Constants +@@ -657,7 +708,7 @@ Constants .. data:: OP_NO_TLSv1_2 Prevents a TLSv1.2 connection. This option is only applicable in conjunction @@ -228,14 +223,15 @@ diff -up Python-3.5.2/Doc/library/ssl.rst.openssl11 Python-3.5.2/Doc/library/ssl the protocol version. Available only with openssl version 1.0.1+. .. versionadded:: 3.4 -@@ -1081,17 +1138,21 @@ such as SSL configuration options, certi +@@ -1081,17 +1132,21 @@ such as SSL configuration options, certi 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) -+.. class:: SSLContext(protocol=PROTOCOL_TLS) - +- - Create a new SSL context. You must pass *protocol* which must be one ++.. class:: SSLContext(protocol=PROTOCOL_TLS) ++ + Create a new SSL context. You may pass *protocol* which must be one of the ``PROTOCOL_*`` constants defined in this module. - :data:`PROTOCOL_SSLv23` is currently recommended for maximum @@ -247,14 +243,14 @@ diff -up Python-3.5.2/Doc/library/ssl.rst.openssl11 Python-3.5.2/Doc/library/ssl :func:`create_default_context` lets the :mod:`ssl` module choose security settings for a given purpose. -+ .. versionchanged:: 3.6 ++ .. versionchanged:: 3.5.3 + + :data:`PROTOCOL_TLS` is the default value. + :class:`SSLContext` objects have the following methods and attributes: -@@ -1232,6 +1293,9 @@ to speed up repeated connections from th +@@ -1232,6 +1287,9 @@ to speed up repeated connections from th This method will raise :exc:`NotImplementedError` if :data:`HAS_ALPN` is False. @@ -264,7 +260,7 @@ diff -up Python-3.5.2/Doc/library/ssl.rst.openssl11 Python-3.5.2/Doc/library/ssl .. versionadded:: 3.5 .. method:: SSLContext.set_npn_protocols(protocols) -@@ -1598,7 +1662,7 @@ If you prefer to tune security settings +@@ -1598,7 +1656,7 @@ If you prefer to tune security settings a context from scratch (but beware that you might not get the settings right):: @@ -273,7 +269,7 @@ diff -up Python-3.5.2/Doc/library/ssl.rst.openssl11 Python-3.5.2/Doc/library/ssl >>> context.verify_mode = ssl.CERT_REQUIRED >>> context.check_hostname = True >>> context.load_verify_locations("/etc/ssl/certs/ca-bundle.crt") -@@ -1999,15 +2063,17 @@ Protocol versions +@@ -1999,15 +2057,17 @@ Protocol versions SSL versions 2 and 3 are considered insecure and are therefore dangerous to use. If you want maximum compatibility between clients and servers, it is @@ -286,17 +282,18 @@ diff -up Python-3.5.2/Doc/library/ssl.rst.openssl11 Python-3.5.2/Doc/library/ssl + context = ssl.SSLContext(ssl.PROTOCOL_TLS) context.options |= ssl.OP_NO_SSLv2 context.options |= ssl.OP_NO_SSLv3 +- +-The SSL context created above will only allow TLSv1 and later (if + context.options |= ssl.OP_NO_TLSv1 + context.options |= ssl.OP_NO_TLSv1_1 - --The SSL context created above will only allow TLSv1 and later (if ++ +The SSL context created above will only allow TLSv1.2 and later (if supported by your system) connections. Cipher selection -diff -up Python-3.5.2/Lib/ssl.py.openssl11 Python-3.5.2/Lib/ssl.py ---- Python-3.5.2/Lib/ssl.py.openssl11 2016-06-25 23:38:36.000000000 +0200 -+++ Python-3.5.2/Lib/ssl.py 2016-10-10 16:34:37.695049119 +0200 +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 @@ -378,9 +375,9 @@ diff -up Python-3.5.2/Lib/ssl.py.openssl11 Python-3.5.2/Lib/ssl.py """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 -up Python-3.5.2/Lib/test/test_ssl.py.openssl11 Python-3.5.2/Lib/test/test_ssl.py ---- Python-3.5.2/Lib/test/test_ssl.py.openssl11 2016-06-25 23:38:37.000000000 +0200 -+++ Python-3.5.2/Lib/test/test_ssl.py 2016-10-10 16:37:52.812573136 +0200 +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 @@ -23,6 +23,9 @@ ssl = support.import_module("ssl") PROTOCOLS = sorted(ssl._PROTOCOL_NAMES) @@ -470,7 +467,7 @@ diff -up Python-3.5.2/Lib/test/test_ssl.py.openssl11 Python-3.5.2/Lib/test/test_ self.assertTrue(sslobj.getpeercert()) if 'tls-unique' in ssl.CHANNEL_BINDING_TYPES: self.assertTrue(sslobj.get_channel_binding('tls-unique')) -@@ -2980,7 +2985,7 @@ else: +@@ -2993,7 +2998,7 @@ else: with context.wrap_socket(socket.socket()) as s: self.assertIs(s.version(), None) s.connect((HOST, server.port)) @@ -479,7 +476,7 @@ diff -up Python-3.5.2/Lib/test/test_ssl.py.openssl11 Python-3.5.2/Lib/test/test_ self.assertIs(s.version(), None) @unittest.skipUnless(ssl.HAS_ECDH, "test requires ECDH-enabled OpenSSL") -@@ -3122,24 +3127,36 @@ else: +@@ -3135,24 +3140,36 @@ else: (['http/3.0', 'http/4.0'], None) ] for client_protocols, expected in protocol_tests: @@ -493,7 +490,7 @@ diff -up Python-3.5.2/Lib/test/test_ssl.py.openssl11 Python-3.5.2/Lib/test/test_ 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), @@ -503,6 +500,7 @@ diff -up Python-3.5.2/Lib/test/test_ssl.py.openssl11 Python-3.5.2/Lib/test/test_ - 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, @@ -529,7 +527,7 @@ diff -up Python-3.5.2/Lib/test/test_ssl.py.openssl11 Python-3.5.2/Lib/test/test_ def test_selected_npn_protocol(self): # selected_npn_protocol() is None unless NPN is used -@@ -3287,13 +3304,23 @@ else: +@@ -3300,13 +3317,23 @@ else: client_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1) client_context.verify_mode = ssl.CERT_REQUIRED client_context.load_verify_locations(SIGNING_CA) @@ -556,18 +554,19 @@ diff -up Python-3.5.2/Lib/test/test_ssl.py.openssl11 Python-3.5.2/Lib/test/test_ def test_read_write_after_close_raises_valuerror(self): context = ssl.SSLContext(ssl.PROTOCOL_SSLv23) -diff -up Python-3.5.2/Modules/_hashopenssl.c.openssl11 Python-3.5.2/Modules/_hashopenssl.c ---- Python-3.5.2/Modules/_hashopenssl.c.openssl11 2016-10-10 16:34:15.460533587 +0200 -+++ Python-3.5.2/Modules/_hashopenssl.c 2016-10-10 17:07:28.883123976 +0200 -@@ -23,7 +23,6 @@ - #include - #include + +diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c +--- a/Modules/_hashopenssl.c ++++ b/Modules/_hashopenssl.c +@@ -21,7 +21,6 @@ + + /* EVP is the preferred interface to hashing in OpenSSL */ #include -#include /* We use the object interface to discover what hashes OpenSSL supports. */ #include #include "openssl/err.h" -@@ -34,11 +33,22 @@ +@@ -32,11 +31,22 @@ #define HASH_OBJ_CONSTRUCTOR 0 #endif @@ -591,17 +590,15 @@ diff -up Python-3.5.2/Modules/_hashopenssl.c.openssl11 Python-3.5.2/Modules/_has #ifdef WITH_THREAD PyThread_type_lock lock; /* OpenSSL context lock */ #endif -@@ -51,9 +61,6 @@ static PyTypeObject EVPtype; - 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; -@@ -69,19 +76,57 @@ DEFINE_CONSTS_FOR_NEW(sha384) +@@ -48,7 +58,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) +@@ -59,19 +68,57 @@ DEFINE_CONSTS_FOR_NEW(sha384) DEFINE_CONSTS_FOR_NEW(sha512) @@ -664,7 +661,7 @@ diff -up Python-3.5.2/Modules/_hashopenssl.c.openssl11 Python-3.5.2/Modules/_has return retval; } -@@ -96,7 +141,7 @@ EVP_hash(EVPobject *self, const void *vp +@@ -86,7 +133,7 @@ EVP_hash(EVPobject *self, const void *vp process = MUNCH_SIZE; else process = Py_SAFE_DOWNCAST(len, Py_ssize_t, unsigned int); @@ -673,7 +670,7 @@ diff -up Python-3.5.2/Modules/_hashopenssl.c.openssl11 Python-3.5.2/Modules/_has len -= process; cp += process; } -@@ -153,16 +198,19 @@ EVP_dealloc(EVPobject *self) +@@ -101,16 +148,19 @@ EVP_dealloc(EVPobject *self) if (self->lock != NULL) PyThread_free_lock(self->lock); #endif @@ -696,7 +693,7 @@ diff -up Python-3.5.2/Modules/_hashopenssl.c.openssl11 Python-3.5.2/Modules/_has } /* External methods for a hash object */ -@@ -178,7 +226,9 @@ EVP_copy(EVPobject *self, PyObject *unus +@@ -126,7 +176,9 @@ EVP_copy(EVPobject *self, PyObject *unus if ( (newobj = newEVPobject(self->name))==NULL) return NULL; @@ -707,7 +704,7 @@ diff -up Python-3.5.2/Modules/_hashopenssl.c.openssl11 Python-3.5.2/Modules/_has return (PyObject *)newobj; } -@@ -189,16 +239,24 @@ static PyObject * +@@ -137,16 +189,24 @@ static PyObject * EVP_digest(EVPobject *self, PyObject *unused) { unsigned char digest[EVP_MAX_MD_SIZE]; @@ -737,7 +734,7 @@ diff -up Python-3.5.2/Modules/_hashopenssl.c.openssl11 Python-3.5.2/Modules/_has return retval; } -@@ -209,15 +267,23 @@ static PyObject * +@@ -157,15 +217,23 @@ static PyObject * EVP_hexdigest(EVPobject *self, PyObject *unused) { unsigned char digest[EVP_MAX_MD_SIZE]; @@ -766,7 +763,7 @@ diff -up Python-3.5.2/Modules/_hashopenssl.c.openssl11 Python-3.5.2/Modules/_has return _Py_strhex((const char *)digest, digest_size); } -@@ -271,7 +337,7 @@ static PyObject * +@@ -219,7 +287,7 @@ static PyObject * EVP_get_block_size(EVPobject *self, void *closure) { long block_size; @@ -775,7 +772,7 @@ diff -up Python-3.5.2/Modules/_hashopenssl.c.openssl11 Python-3.5.2/Modules/_has return PyLong_FromLong(block_size); } -@@ -279,7 +345,7 @@ static PyObject * +@@ -227,7 +295,7 @@ static PyObject * EVP_get_digest_size(EVPobject *self, void *closure) { long size; @@ -784,32 +781,28 @@ diff -up Python-3.5.2/Modules/_hashopenssl.c.openssl11 Python-3.5.2/Modules/_has return PyLong_FromLong(size); } -@@ -341,8 +407,8 @@ EVP_tp_init(EVPobject *self, PyObject *a +@@ -288,7 +356,7 @@ EVP_tp_init(EVPobject *self, PyObject *a PyBuffer_Release(&view); return -1; } -- mc_ctx_init(&self->ctx, usedforsecurity); -- if (!EVP_DigestInit_ex(&self->ctx, digest, NULL)) { -+ mc_ctx_init(self->ctx, usedforsecurity); -+ if (!EVP_DigestInit_ex(self->ctx, digest, NULL)) { - set_evp_exception(); - PyBuffer_Release(&view); - return -1; -@@ -444,10 +510,10 @@ EVPnew(PyObject *name_obj, +- EVP_DigestInit(&self->ctx, digest); ++ EVP_DigestInit(self->ctx, digest); + + self->name = name_obj; + Py_INCREF(self->name); +@@ -385,9 +453,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 { -- mc_ctx_init(&self->ctx, usedforsecurity); -- if (!EVP_DigestInit_ex(&self->ctx, digest, NULL)) { -+ mc_ctx_init(self->ctx, usedforsecurity); -+ if (!EVP_DigestInit_ex(self->ctx, digest, NULL)) { - set_evp_exception(); - Py_DECREF(self); - return NULL; -@@ -526,6 +592,7 @@ EVP_new(PyObject *self, PyObject *args, +- EVP_DigestInit(&self->ctx, digest); ++ EVP_DigestInit(self->ctx, digest); + } + + if (cp && len) { +@@ -453,6 +521,7 @@ EVP_new(PyObject *self, PyObject *args, #define PY_PBKDF2_HMAC 1 @@ -817,7 +810,7 @@ diff -up Python-3.5.2/Modules/_hashopenssl.c.openssl11 Python-3.5.2/Modules/_has /* Improved implementation of PKCS5_PBKDF2_HMAC() * * PKCS5_PBKDF2_HMAC_fast() hashes the password exactly one time instead of -@@ -607,37 +674,8 @@ PKCS5_PBKDF2_HMAC_fast(const char *pass, +@@ -534,37 +603,8 @@ PKCS5_PBKDF2_HMAC_fast(const char *pass, HMAC_CTX_cleanup(&hctx_tpl); return 1; } @@ -856,7 +849,7 @@ diff -up Python-3.5.2/Modules/_hashopenssl.c.openssl11 Python-3.5.2/Modules/_has PyDoc_STRVAR(pbkdf2_hmac__doc__, "pbkdf2_hmac(hash_name, password, salt, iterations, dklen=None) -> key\n\ -@@ -719,10 +757,17 @@ pbkdf2_hmac(PyObject *self, PyObject *ar +@@ -646,10 +686,17 @@ pbkdf2_hmac(PyObject *self, PyObject *ar key = PyBytes_AS_STRING(key_obj); Py_BEGIN_ALLOW_THREADS @@ -874,29 +867,18 @@ diff -up Python-3.5.2/Modules/_hashopenssl.c.openssl11 Python-3.5.2/Modules/_has Py_END_ALLOW_THREADS if (!retval) { -@@ -890,13 +935,15 @@ init_constructor_constant(EVPCachedInfo - 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], -+ cached_info->ctx_ptrs[i] = EVP_MD_CTX_new(); -+ if (cached_info->ctx_ptrs[i] == NULL) -+ break; -+ mc_ctx_init(cached_info->ctx_ptrs[i], i); -+ if (EVP_DigestInit_ex(cached_info->ctx_ptrs[i], - EVP_get_digestbyname(name), NULL)) { -- /* Success: */ -- cached_info->ctx_ptrs[i] = &cached_info->ctxs[i]; - } else { - /* Failure: */ -+ EVP_MD_CTX_free(cached_info->ctx_ptrs[i]); - cached_info->ctx_ptrs[i] = NULL; - cached_info->error_msgs[i] = error_msg_for_last_error(); - } -diff -up Python-3.5.2/Modules/_ssl.c.openssl11 Python-3.5.2/Modules/_ssl.c ---- Python-3.5.2/Modules/_ssl.c.openssl11 2016-06-25 23:38:38.000000000 +0200 -+++ Python-3.5.2/Modules/_ssl.c 2016-10-10 16:34:37.699049212 +0200 +@@ -768,7 +815,7 @@ generate_hash_name_list(void) + if (CONST_ ## NAME ## _name_obj == NULL) { \ + CONST_ ## NAME ## _name_obj = PyUnicode_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 @@ -55,6 +55,14 @@ static PySocketModule_APIObject PySocket #include #endif @@ -923,7 +905,7 @@ diff -up Python-3.5.2/Modules/_ssl.c.openssl11 Python-3.5.2/Modules/_ssl.c /* Openssl comes with TLSv1.1 and TLSv1.2 between 1.0.0h and 1.0.1 http://www.openssl.org/news/changelog.html */ -@@ -113,6 +125,72 @@ struct py_ssl_library_code { +@@ -117,6 +129,72 @@ struct py_ssl_library_code { # define HAVE_ALPN #endif @@ -996,7 +978,7 @@ diff -up Python-3.5.2/Modules/_ssl.c.openssl11 Python-3.5.2/Modules/_ssl.c enum py_ssl_error { /* these mirror ssl.h */ PY_SSL_ERROR_NONE, -@@ -143,7 +221,7 @@ enum py_ssl_cert_requirements { +@@ -147,7 +225,7 @@ enum py_ssl_cert_requirements { enum py_ssl_version { PY_SSL_VERSION_SSL2, PY_SSL_VERSION_SSL3=1, @@ -1005,7 +987,7 @@ diff -up Python-3.5.2/Modules/_ssl.c.openssl11 Python-3.5.2/Modules/_ssl.c #if HAVE_TLSv1_2 PY_SSL_VERSION_TLS1, PY_SSL_VERSION_TLS1_1, -@@ -524,8 +602,8 @@ newPySSLSocket(PySSLContext *sslctx, PyS +@@ -527,8 +605,8 @@ newPySSLSocket(PySSLContext *sslctx, PyS /* BIOs are reference counted and SSL_set_bio borrows our reference. * To prevent a double free in memory_bio_dealloc() we need to take an * extra reference here. */ @@ -1016,7 +998,7 @@ diff -up Python-3.5.2/Modules/_ssl.c.openssl11 Python-3.5.2/Modules/_ssl.c SSL_set_bio(self->ssl, inbio->bio, outbio->bio); } mode = SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER; -@@ -736,7 +814,7 @@ _create_tuple_for_X509_NAME (X509_NAME * +@@ -738,7 +816,7 @@ static PyObject * /* check to see if we've gotten to a new RDN */ if (rdn_level >= 0) { @@ -1025,7 +1007,7 @@ diff -up Python-3.5.2/Modules/_ssl.c.openssl11 Python-3.5.2/Modules/_ssl.c /* yes, new RDN */ /* add old RDN to DN */ rdnt = PyList_AsTuple(rdn); -@@ -753,7 +831,7 @@ _create_tuple_for_X509_NAME (X509_NAME * +@@ -755,7 +833,7 @@ static PyObject * goto fail0; } } @@ -1034,7 +1016,7 @@ diff -up Python-3.5.2/Modules/_ssl.c.openssl11 Python-3.5.2/Modules/_ssl.c /* now add this attribute to the current RDN */ name = X509_NAME_ENTRY_get_object(entry); -@@ -851,18 +929,18 @@ _get_peer_alt_names (X509 *certificate) +@@ -853,18 +931,18 @@ static PyObject * goto fail; } @@ -1056,7 +1038,7 @@ diff -up Python-3.5.2/Modules/_ssl.c.openssl11 Python-3.5.2/Modules/_ssl.c for(j = 0; j < sk_GENERAL_NAME_num(names); j++) { /* get a rendering of each name in the set of names */ -@@ -1073,13 +1151,11 @@ _get_crl_dp(X509 *certificate) { +@@ -1075,13 +1153,11 @@ static PyObject * int i, j; PyObject *lst, *res = NULL; @@ -1072,7 +1054,7 @@ diff -up Python-3.5.2/Modules/_ssl.c.openssl11 Python-3.5.2/Modules/_ssl.c if (dps == NULL) return Py_None; -@@ -1449,14 +1525,13 @@ static PyObject * +@@ -1451,14 +1527,13 @@ static PyObject * _ssl__SSLSocket_shared_ciphers_impl(PySSLSocket *self) /*[clinic end generated code: output=3d174ead2e42c4fd input=0bfe149da8fe6306]*/ { @@ -1089,7 +1071,7 @@ diff -up Python-3.5.2/Modules/_ssl.c.openssl11 Python-3.5.2/Modules/_ssl.c res = PyList_New(sk_SSL_CIPHER_num(ciphers)); if (!res) return NULL; -@@ -1565,9 +1640,9 @@ _ssl__SSLSocket_compression_impl(PySSLSo +@@ -1567,9 +1642,9 @@ static PyObject * if (self->ssl == NULL) Py_RETURN_NONE; comp_method = SSL_get_current_compression(self->ssl); @@ -1101,7 +1083,7 @@ diff -up Python-3.5.2/Modules/_ssl.c.openssl11 Python-3.5.2/Modules/_ssl.c if (short_name == NULL) Py_RETURN_NONE; return PyUnicode_DecodeFSDefault(short_name); -@@ -2245,8 +2320,8 @@ _ssl__SSLContext_impl(PyTypeObject *type +@@ -2255,8 +2330,8 @@ static PyObject * else if (proto_version == PY_SSL_VERSION_SSL2) ctx = SSL_CTX_new(SSLv2_method()); #endif @@ -1112,7 +1094,7 @@ diff -up Python-3.5.2/Modules/_ssl.c.openssl11 Python-3.5.2/Modules/_ssl.c else proto_version = -1; PySSL_END_ALLOW_THREADS -@@ -2308,8 +2383,9 @@ _ssl__SSLContext_impl(PyTypeObject *type +@@ -2318,8 +2393,9 @@ static 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 @@ -1124,7 +1106,7 @@ diff -up Python-3.5.2/Modules/_ssl.c.openssl11 Python-3.5.2/Modules/_ssl.c SSL_CTX_set_ecdh_auto(self->ctx, 1); #else { -@@ -2576,10 +2652,12 @@ static PyObject * +@@ -2586,10 +2662,12 @@ static PyObject * get_verify_flags(PySSLContext *self, void *c) { X509_STORE *store; @@ -1138,7 +1120,7 @@ diff -up Python-3.5.2/Modules/_ssl.c.openssl11 Python-3.5.2/Modules/_ssl.c return PyLong_FromUnsignedLong(flags); } -@@ -2587,22 +2665,24 @@ static int +@@ -2597,22 +2675,24 @@ static int set_verify_flags(PySSLContext *self, PyObject *arg, void *c) { X509_STORE *store; @@ -1166,7 +1148,7 @@ diff -up Python-3.5.2/Modules/_ssl.c.openssl11 Python-3.5.2/Modules/_ssl.c _setSSLError(NULL, 0, __FILE__, __LINE__); return -1; } -@@ -2779,8 +2859,8 @@ _ssl__SSLContext_load_cert_chain_impl(Py +@@ -2789,8 +2869,8 @@ static PyObject * /*[clinic end generated code: output=9480bc1c380e2095 input=7cf9ac673cbee6fc]*/ { PyObject *certfile_bytes = NULL, *keyfile_bytes = NULL; @@ -1177,7 +1159,7 @@ diff -up Python-3.5.2/Modules/_ssl.c.openssl11 Python-3.5.2/Modules/_ssl.c _PySSLPasswordInfo pw_info = { NULL, NULL, NULL, 0, 0 }; int r; -@@ -2907,8 +2987,9 @@ _add_ca_certs(PySSLContext *self, void * +@@ -2917,8 +2997,9 @@ static int cert = d2i_X509_bio(biobuf, NULL); } else { cert = PEM_read_bio_X509(biobuf, NULL, @@ -1189,7 +1171,7 @@ diff -up Python-3.5.2/Modules/_ssl.c.openssl11 Python-3.5.2/Modules/_ssl.c } if (cert == NULL) { break; -@@ -3434,25 +3515,24 @@ _ssl__SSLContext_cert_store_stats_impl(P +@@ -3444,25 +3525,24 @@ static PyObject * /*[clinic end generated code: output=5f356f4d9cca874d input=eb40dd0f6d0e40cf]*/ { X509_STORE *store; @@ -1222,7 +1204,7 @@ diff -up Python-3.5.2/Modules/_ssl.c.openssl11 Python-3.5.2/Modules/_ssl.c default: /* Ignore X509_LU_FAIL, X509_LU_RETRY, X509_LU_PKEY. * As far as I can tell they are internal states and never -@@ -3482,6 +3562,7 @@ _ssl__SSLContext_get_ca_certs_impl(PySSL +@@ -3492,6 +3572,7 @@ static PyObject * /*[clinic end generated code: output=0d58f148f37e2938 input=6887b5a09b7f9076]*/ { X509_STORE *store; @@ -1230,7 +1212,7 @@ diff -up Python-3.5.2/Modules/_ssl.c.openssl11 Python-3.5.2/Modules/_ssl.c PyObject *ci = NULL, *rlist = NULL; int i; -@@ -3490,17 +3571,18 @@ _ssl__SSLContext_get_ca_certs_impl(PySSL +@@ -3500,17 +3581,18 @@ static PyObject * } store = SSL_CTX_get_cert_store(self->ctx); @@ -1253,7 +1235,7 @@ diff -up Python-3.5.2/Modules/_ssl.c.openssl11 Python-3.5.2/Modules/_ssl.c if (!X509_check_ca(cert)) { continue; } -@@ -4364,10 +4446,12 @@ static PyMethodDef PySSL_methods[] = { +@@ -4374,10 +4456,12 @@ static PyMethodDef PySSL_methods[] = { }; @@ -1268,7 +1250,7 @@ diff -up Python-3.5.2/Modules/_ssl.c.openssl11 Python-3.5.2/Modules/_ssl.c static PyThread_type_lock *_ssl_locks = NULL; -@@ -4448,7 +4532,7 @@ static int _setup_ssl_threads(void) { +@@ -4458,7 +4542,7 @@ static int _setup_ssl_threads(void) { return 1; } @@ -1277,7 +1259,7 @@ diff -up Python-3.5.2/Modules/_ssl.c.openssl11 Python-3.5.2/Modules/_ssl.c PyDoc_STRVAR(module_doc, "Implementation module for SSL socket operations. See the socket module\n\ -@@ -4517,11 +4601,16 @@ PyInit__ssl(void) +@@ -4527,11 +4611,16 @@ PyInit__ssl(void) SSL_load_error_strings(); SSL_library_init(); #ifdef WITH_THREAD @@ -1294,7 +1276,7 @@ diff -up Python-3.5.2/Modules/_ssl.c.openssl11 Python-3.5.2/Modules/_ssl.c OpenSSL_add_all_algorithms(); /* Add symbols to module dict */ -@@ -4668,7 +4757,9 @@ PyInit__ssl(void) +@@ -4678,7 +4767,9 @@ PyInit__ssl(void) PY_SSL_VERSION_SSL3); #endif PyModule_AddIntConstant(m, "PROTOCOL_SSLv23", @@ -1305,3 +1287,28 @@ diff -up Python-3.5.2/Modules/_ssl.c.openssl11 Python-3.5.2/Modules/_ssl.c PyModule_AddIntConstant(m, "PROTOCOL_TLSv1", PY_SSL_VERSION_TLS1); #if HAVE_TLSv1_2 + +diff --git a/Modules/_ssl.c b/Modules/_ssl.c +--- a/Modules/_ssl.c ++++ b/Modules/_ssl.c +@@ -151,11 +151,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) +@@ -1644,7 +1639,7 @@ static PyObject * + 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 PyUnicode_DecodeFSDefault(short_name); diff --git a/python3.spec b/python3.spec index 66f3f76..863c1fc 100644 --- a/python3.spec +++ b/python3.spec @@ -112,7 +112,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 5%{?dist} +Release: 6%{?dist} License: Python Group: Development/Languages @@ -413,8 +413,12 @@ Patch242: 00242-CVE-2016-1000110-httpoxy.patch # Fedora needs the default mips64-linux-gnu Patch243: 00243-fix-mips64-triplet.patch -# Make it build with OpenSSL-1.1.0 based on upstream patch -Patch244: Python-3.5.2-openssl11.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 3.5.3 +# FIXED UPSTREAM: https://bugs.python.org/issue26470 +Patch247: 00247-port-ssl-and-hashlib-to-OpenSSL-1.1.0.patch # (New patches go here ^^^) # @@ -605,6 +609,8 @@ 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. # @@ -612,9 +618,9 @@ rm -r Modules/zlib || exit 1 # OpenSSL (and thus respects FIPS mode), and does not fall back to _md5 # TODO: there seems to be no OpenSSL support in Python for sha3 so far # when it is there, also remove _sha3/ dir -for f in md5module.c sha1module.c sha256module.c sha512module.c; do - rm Modules/$f -done +#for f in md5module.c sha1module.c sha256module.c sha512module.c; do +# rm Modules/$f +#done %if 0%{with_rewheel} %global pip_version 8.1.2 @@ -638,7 +644,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch132 -p1 %patch137 -p1 %patch143 -p1 -b .tsc-on-ppc -%patch146 -p1 +#patch146 -p1 %patch155 -p1 %patch157 -p1 %patch160 -p1 @@ -659,7 +665,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch209 -p1 %patch242 -p1 %patch243 -p1 -%patch244 -p1 +%patch247 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1226,6 +1232,12 @@ rm -fr %{buildroot} %doc LICENSE README %dir %{pylibdir} %dir %{dynload_dir} + +%{dynload_dir}/_md5.%{SOABI_optimized}.so +%{dynload_dir}/_sha256.%{SOABI_optimized}.so +%{dynload_dir}/_sha512.%{SOABI_optimized}.so +%{dynload_dir}/_sha1.%{SOABI_optimized}.so + %{dynload_dir}/_bisect.%{SOABI_optimized}.so %{dynload_dir}/_bz2.%{SOABI_optimized}.so %{dynload_dir}/_codecs_cn.%{SOABI_optimized}.so @@ -1448,6 +1460,12 @@ rm -fr %{buildroot} # Analog of the -libs subpackage's files: # ...with debug builds of the built-in "extension" modules: + +%{dynload_dir}/_md5.%{SOABI_debug}.so +%{dynload_dir}/_sha256.%{SOABI_debug}.so +%{dynload_dir}/_sha512.%{SOABI_debug}.so +%{dynload_dir}/_sha1.%{SOABI_debug}.so + %{dynload_dir}/_bisect.%{SOABI_debug}.so %{dynload_dir}/_bz2.%{SOABI_debug}.so %{dynload_dir}/_codecs_cn.%{SOABI_debug}.so @@ -1559,6 +1577,12 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Wed Oct 12 2016 Charalampos Stratakis - 3.5.2-6 +- Use proper patch numbering and base upstream branch for +porting ssl and hashlib modules to OpenSSL 1.1.0 +- Drop hashlib patch for now +- Add riscv64 arch to 64bit and no-valgrind arches + * Tue Oct 11 2016 Tomáš Mráz - 3.5.2-5 - Make it build with OpenSSL-1.1.0 based on upstream patch From ddb16c68d95603cc11233c520544adf92c3741fe Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Mon, 5 Dec 2016 13:46:29 +0100 Subject: [PATCH 275/416] Rebuild for pip version 9.0.1 --- python3.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python3.spec b/python3.spec index 863c1fc..de1f5e3 100644 --- a/python3.spec +++ b/python3.spec @@ -112,7 +112,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 6%{?dist} +Release: 7%{?dist} License: Python Group: Development/Languages @@ -623,7 +623,7 @@ rm -r Modules/zlib || exit 1 #done %if 0%{with_rewheel} -%global pip_version 8.1.2 +%global pip_version 9.0.1 sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/ensurepip/__init__.py %endif @@ -1577,6 +1577,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon Dec 05 2016 Charalampos Stratakis - 3.5.2-7 +- Set to work with pip version 9.0.1 + * Wed Oct 12 2016 Charalampos Stratakis - 3.5.2-6 - Use proper patch numbering and base upstream branch for porting ssl and hashlib modules to OpenSSL 1.1.0 From 8398dc4b6b7c1e96ba28f9297e0ed58618e107e9 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Tue, 27 Sep 2016 21:02:29 +0200 Subject: [PATCH 276/416] Update source URL to point to 3.6.0 beta1 --- python3.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index de1f5e3..999f24a 100644 --- a/python3.spec +++ b/python3.spec @@ -180,7 +180,7 @@ BuildRequires: python3-pip # Source code and patches # ======================= -Source: http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz +Source: https://www.python.org/ftp/python/3.6.0/Python-3.6.0b1.tar.xz # Supply an RPM macro "py_byte_compile" for the python3-devel subpackage # to enable specfiles to selectively byte-compile individual files and paths From b6897674bed3f4f85fd86ac0d70830df618e80af Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Tue, 27 Sep 2016 21:06:04 +0200 Subject: [PATCH 277/416] Update to 3.6.0 first beta. Rename the macros.pybytecompile3.5 file to macros.pybytecompile3.6. Rename all the respective sections in the SPEC file for python 3.6. --- ...os.pybytecompile3.5 => macros.pybytecompile3.6 | 0 python3.spec | 15 +++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) rename macros.pybytecompile3.5 => macros.pybytecompile3.6 (100%) diff --git a/macros.pybytecompile3.5 b/macros.pybytecompile3.6 similarity index 100% rename from macros.pybytecompile3.5 rename to macros.pybytecompile3.6 diff --git a/python3.spec b/python3.spec index 999f24a..573d936 100644 --- a/python3.spec +++ b/python3.spec @@ -2,7 +2,7 @@ # Conditionals and other variables controlling the build # ====================================================== -# NOTES ON BOOTSTRAPING PYTHON 3.5: +# NOTES ON BOOTSTRAPING PYTHON 3.6: # # Due to dependency cycle between Python, pip, setuptools and # wheel caused by the rewheel patch, one has to build in the @@ -14,12 +14,15 @@ # 4) python3-setuptools and python3-pip with with_rewheel set to 1 # 5) python3 with with_rewheel set to 1 +# First beta prerelease +%global prerel b1 + %global with_rewheel 1 -%global pybasever 3.5 +%global pybasever 3.6 # pybasever without the dot: -%global pyshortver 35 +%global pyshortver 36 %global pylibdir %{_libdir}/python%{pybasever} %global dynload_dir %{pylibdir}/lib-dynload @@ -51,7 +54,7 @@ # now has bytecode at: # foo/__pycache__/bar.cpython-35.pyc # foo/__pycache__/bar.cpython-35.pyo -%global bytecode_suffixes .cpython-35*.py? +%global bytecode_suffixes .cpython-36*.py? # Python's configure script defines SOVERSION, and this is used in the Makefile # to determine INSTSONAME, the name of the libpython DSO: @@ -111,8 +114,8 @@ # ================== Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 -Version: %{pybasever}.2 -Release: 7%{?dist} +Version: %{pybasever}.0 +Release: 0.1.%{?prerel}%{?dist} License: Python Group: Development/Languages From e9db5d378a51b7c26ba7e334a3de3bc2f2c29868 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Thu, 29 Sep 2016 15:21:37 +0200 Subject: [PATCH 278/416] Disable system-tap as it is now implemented upstream in a different way (upstream issue21590) --- python3.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 573d936..ba67522 100644 --- a/python3.spec +++ b/python3.spec @@ -71,7 +71,7 @@ %global with_gdb_hooks 1 -%global with_systemtap 1 +%global with_systemtap 0 # some arches don't have valgrind so we need to disable its support on them %ifnarch s390 %{mips} riscv64 From 95f9e1aed8e2178708b8f15101b508c801a7a8c1 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Thu, 29 Sep 2016 15:41:39 +0200 Subject: [PATCH 279/416] Python now uses by default the system libffi, on linux systems (upstream issue26661 and issue27979) --- python3.spec | 5 ----- 1 file changed, 5 deletions(-) diff --git a/python3.spec b/python3.spec index ba67522..6f2a462 100644 --- a/python3.spec +++ b/python3.spec @@ -604,11 +604,6 @@ cp -a %{SOURCE7} . # 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 From 0424a4f70ec7ba21682b825e67ac5bca85813558 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Thu, 29 Sep 2016 16:17:06 +0200 Subject: [PATCH 280/416] Rebased patches 102, 111, 170 in order to apply cleanly for the new sources. Dropped patches 209, 242, 247 as they are already upstream. Dropped patches 143 and 146 for now. --- 00102-lib64.patch | 26 +- 00111-no-static-lib.patch | 21 +- 00170-gc-assertions.patch | 174 +-- 00209-fix-test-pyexpat-failure.patch | 17 - 00242-CVE-2016-1000110-httpoxy.patch | 89 -- ...ort-ssl-and-hashlib-to-OpenSSL-1.1.0.patch | 1314 ----------------- python3.spec | 28 +- 7 files changed, 105 insertions(+), 1564 deletions(-) delete mode 100644 00209-fix-test-pyexpat-failure.patch delete mode 100644 00242-CVE-2016-1000110-httpoxy.patch delete mode 100644 00247-port-ssl-and-hashlib-to-OpenSSL-1.1.0.patch diff --git a/00102-lib64.patch b/00102-lib64.patch index 35a442e..8e9ae4e 100644 --- a/00102-lib64.patch +++ b/00102-lib64.patch @@ -1,5 +1,5 @@ diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py -index 67db007..b16fe0f 100644 +index 9474e9c..c0ce4c6 100644 --- a/Lib/distutils/command/install.py +++ b/Lib/distutils/command/install.py @@ -30,14 +30,14 @@ WINDOWS_SCHEME = { @@ -20,7 +20,7 @@ index 67db007..b16fe0f 100644 'scripts': '$base/bin', 'data' : '$base', diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py -index e5c493d..a4846eb 100644 +index 026cca7..6d3e077 100644 --- a/Lib/distutils/sysconfig.py +++ b/Lib/distutils/sysconfig.py @@ -132,8 +132,12 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None): @@ -38,7 +38,7 @@ index e5c493d..a4846eb 100644 return libpython else: diff --git a/Lib/site.py b/Lib/site.py -index 3f78ef5..ad1033e 100644 +index a84e3bb..ba0d3ea 100644 --- a/Lib/site.py +++ b/Lib/site.py @@ -303,11 +303,15 @@ def getsitepackages(prefixes=None): @@ -49,7 +49,7 @@ index 3f78ef5..ad1033e 100644 + "python" + sys.version[:3], + "site-packages")) sitepackages.append(os.path.join(prefix, "lib", - "python" + sys.version[:3], + "python%d.%d" % sys.version_info[:2], "site-packages")) else: sitepackages.append(prefix) @@ -58,7 +58,7 @@ index 3f78ef5..ad1033e 100644 if sys.platform == "darwin": # for framework builds *only* we add the standard Apple diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py -index 61451b2..b021cce 100644 +index b9bbfe5..2a5f29c 100644 --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py @@ -20,10 +20,10 @@ __all__ = [ @@ -90,7 +90,7 @@ index 61451b2..b021cce 100644 'scripts': '{userbase}/bin', 'data': '{userbase}', diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py -index da20a3d..f38ce06 100644 +index f698927..bc977b5 100644 --- a/Lib/test/test_site.py +++ b/Lib/test/test_site.py @@ -248,8 +248,8 @@ class HelperFunctionsTests(unittest.TestCase): @@ -98,17 +98,17 @@ index da20a3d..f38ce06 100644 elif os.sep == '/': # OS X non-framwework builds, Linux, FreeBSD, etc - self.assertEqual(len(dirs), 1) -- wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3], +- wanted = os.path.join('xoxo', 'lib', + self.assertEqual(len(dirs), 2) -+ wanted = os.path.join('xoxo', 'lib64', 'python' + sys.version[:3], ++ wanted = os.path.join('xoxo', 'lib64', + 'python%d.%d' % sys.version_info[:2], 'site-packages') self.assertEqual(dirs[0], wanted) - else: diff --git a/Makefile.pre.in b/Makefile.pre.in -index 58d4258..e8364f0 100644 +index 8fa7934..a693917 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -125,7 +125,7 @@ LIBDIR= @libdir@ +@@ -126,7 +126,7 @@ LIBDIR= @libdir@ MANDIR= @mandir@ INCLUDEDIR= @includedir@ CONFINCLUDEDIR= $(exec_prefix)/include @@ -118,7 +118,7 @@ index 58d4258..e8364f0 100644 # Detailed destination directories diff --git a/Modules/getpath.c b/Modules/getpath.c -index 18deb60..27ca814 100644 +index 65b47a3..eaa756c 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -494,7 +494,7 @@ calculate_path(void) @@ -149,7 +149,7 @@ index 18deb60..27ca814 100644 /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */ diff --git a/setup.py b/setup.py -index be33c46..f2779cc 100644 +index 0f2dfc4..da37896 100644 --- a/setup.py +++ b/setup.py @@ -492,7 +492,7 @@ class PyBuildExt(build_ext): diff --git a/00111-no-static-lib.patch b/00111-no-static-lib.patch index 006bb90..6929fda 100644 --- a/00111-no-static-lib.patch +++ b/00111-no-static-lib.patch @@ -1,19 +1,20 @@ -diff -up cpython-59223da36dec/Makefile.pre.in.no-static-lib cpython-59223da36dec/Makefile.pre.in ---- cpython-59223da36dec/Makefile.pre.in.no-static-lib 2012-08-07 16:43:43.296466422 -0400 -+++ cpython-59223da36dec/Makefile.pre.in 2012-08-07 16:44:13.299464371 -0400 -@@ -550,7 +550,7 @@ clinic: $(BUILDPYTHON) +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 70e5927..04c8e3d 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -556,7 +556,7 @@ clinic: $(BUILDPYTHON) $(srcdir)/Modules/_blake2/blake2s_impl.c $(RUNSHARED) $(PYTHON_FOR_BUILD) ./Tools/clinic/clinic.py --make # Build the interpreter -$(BUILDPYTHON): Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) -+$(BUILDPYTHON): Programs/python.o $(LDLIBRARY) $(PY3LIBRARY) ++$(BUILDPYTHON): Programs/python.o $(LDLIBRARY) $(PY3LIBRARY) $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) platform: $(BUILDPYTHON) pybuilddir.txt -@@ -480,18 +480,6 @@ sharedmods: $(BUILDPYTHON) $(SYSCONFIGDA - _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ +@@ -601,18 +601,6 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build + -# Build static library -# avoid long command lines, same as LIBRARY_OBJS -$(LIBRARY): $(LIBRARY_OBJS) @@ -22,14 +23,14 @@ diff -up cpython-59223da36dec/Makefile.pre.in.no-static-lib cpython-59223da36dec - $(AR) $(ARFLAGS) $@ $(PARSER_OBJS) - $(AR) $(ARFLAGS) $@ $(OBJECT_OBJS) - $(AR) $(ARFLAGS) $@ $(PYTHON_OBJS) Python/frozen.o -- $(AR) $(ARFLAGS) $@ $(MODULE_OBJS) $(SIGNAL_OBJS) +- $(AR) $(ARFLAGS) $@ $(MODULE_OBJS) - $(AR) $(ARFLAGS) $@ $(MODOBJS) - $(RANLIB) $@ - libpython$(LDVERSION).so: $(LIBRARY_OBJS) if test $(INSTSONAME) != $(LDLIBRARY); then \ $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ -@@ -674,7 +674,7 @@ Modules/Setup: $(srcdir)/Modules/Setup.d +@@ -702,7 +690,7 @@ Modules/Setup: $(srcdir)/Modules/Setup.dist echo "-----------------------------------------------"; \ fi @@ -38,7 +39,7 @@ diff -up cpython-59223da36dec/Makefile.pre.in.no-static-lib cpython-59223da36dec $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) ############################################################################ -@@ -1354,18 +1354,6 @@ libainstall: all python-config +@@ -1382,18 +1370,6 @@ libainstall: all python-config else true; \ fi; \ done diff --git a/00170-gc-assertions.patch b/00170-gc-assertions.patch index 9e34c21..f491733 100644 --- a/00170-gc-assertions.patch +++ b/00170-gc-assertions.patch @@ -1,8 +1,8 @@ -Index: Include/object.h -=================================================================== ---- Include/object.h (revision 87911) -+++ Include/object.h (working copy) -@@ -914,6 +914,49 @@ +diff --git a/Include/object.h b/Include/object.h +index 0c88603..e3413e8 100644 +--- a/Include/object.h ++++ b/Include/object.h +@@ -1059,6 +1059,49 @@ PyAPI_FUNC(void) _PyObject_DebugTypeStats(FILE *out); #endif /* ifndef Py_LIMITED_API */ @@ -52,63 +52,38 @@ Index: Include/object.h #ifdef __cplusplus } #endif -Index: Objects/object.c -=================================================================== ---- Objects/object.c (revision 87911) -+++ Objects/object.c (working copy) -@@ -1899,6 +1899,35 @@ - } - } - -+PyAPI_FUNC(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(); -+} -+ - #ifndef Py_TRACE_REFS - /* For Py_LIMITED_API, we need an out-of-line version of _Py_Dealloc. - Define this here, so we can undefine the macro. */ -Index: Lib/test/test_gc.py -=================================================================== ---- Lib/test/test_gc.py (revision 87911) -+++ Lib/test/test_gc.py (working copy) -@@ -1,7 +1,7 @@ +diff --git a/Lib/test/test_gc.py b/Lib/test/test_gc.py +index e727499..6efcafb 100644 +--- a/Lib/test/test_gc.py ++++ b/Lib/test/test_gc.py +@@ -1,10 +1,11 @@ import unittest from test.support import (verbose, refcount_test, run_unittest, - strip_python_stderr, cpython_only, start_threads, -- temp_dir) -+ temp_dir, import_module) + strip_python_stderr, cpython_only, start_threads, +- temp_dir, requires_type_collecting) ++ temp_dir, import_module, requires_type_collecting) from test.support.script_helper import assert_python_ok, make_script import sys -@@ -512,6 +512,48 @@ ++import sysconfig + import time + import gc + import weakref +@@ -50,6 +51,8 @@ class GC_Detector(object): + # gc collects it. + self.wr = weakref.ref(C1055820(666), it_happened) + ++BUILD_WITH_NDEBUG = ('-DNDEBUG' in sysconfig.get_config_vars()['PY_CFLAGS']) ++ + @with_tp_del + class Uncollectable(object): + """Create a reference cycle with multiple __del__ methods. +@@ -862,6 +865,50 @@ class GCCallbackTests(unittest.TestCase): self.assertEqual(len(gc.garbage), 0) ++ @unittest.skipIf(BUILD_WITH_NDEBUG, ++ 'built with -NDEBUG') + def test_refcount_errors(self): + self.preclean() + # Verify the "handling" of objects with broken refcounts @@ -154,9 +129,10 @@ Index: Lib/test/test_gc.py class GCTogglingTests(unittest.TestCase): def setUp(self): gc.enable() -diff -up Modules/gcmodule.c.orig2 Modules/gcmodule.c ---- Modules/gcmodule.c.orig2 2014-12-08 10:54:14.251742911 +0100 -+++ Modules/gcmodule.c 2014-12-08 10:52:45.674771917 +0100 +diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c +index 0c6f444..87edd5a 100644 +--- a/Modules/gcmodule.c ++++ b/Modules/gcmodule.c @@ -341,7 +341,8 @@ update_refs(PyGC_Head *containers) { PyGC_Head *gc = containers->gc.gc_next; @@ -188,7 +164,7 @@ diff -up Modules/gcmodule.c.orig2 Modules/gcmodule.c if (_PyGCHead_REFS(gc) > 0) _PyGCHead_DECREF(gc); } -@@ -436,9 +440,10 @@ visit_reachable(PyObject *op, PyGC_Head +@@ -436,9 +440,10 @@ visit_reachable(PyObject *op, PyGC_Head *reachable) * If gc_refs == GC_UNTRACKED, it must be ignored. */ else { @@ -202,7 +178,7 @@ diff -up Modules/gcmodule.c.orig2 Modules/gcmodule.c } } return 0; -@@ -480,7 +485,7 @@ move_unreachable(PyGC_Head *young, PyGC_ +@@ -480,7 +485,7 @@ move_unreachable(PyGC_Head *young, PyGC_Head *unreachable) */ PyObject *op = FROM_GC(gc); traverseproc traverse = Py_TYPE(op)->tp_traverse; @@ -211,7 +187,7 @@ diff -up Modules/gcmodule.c.orig2 Modules/gcmodule.c _PyGCHead_SET_REFS(gc, GC_REACHABLE); (void) traverse(op, (visitproc)visit_reachable, -@@ -543,7 +548,7 @@ move_legacy_finalizers(PyGC_Head *unreac +@@ -543,7 +548,7 @@ move_legacy_finalizers(PyGC_Head *unreachable, PyGC_Head *finalizers) for (gc = unreachable->gc.gc_next; gc != unreachable; gc = next) { PyObject *op = FROM_GC(gc); @@ -220,7 +196,7 @@ diff -up Modules/gcmodule.c.orig2 Modules/gcmodule.c next = gc->gc.gc_next; if (has_legacy_finalizer(op)) { -@@ -619,7 +624,7 @@ handle_weakrefs(PyGC_Head *unreachable, +@@ -619,7 +624,7 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) PyWeakReference **wrlist; op = FROM_GC(gc); @@ -229,7 +205,7 @@ diff -up Modules/gcmodule.c.orig2 Modules/gcmodule.c next = gc->gc.gc_next; if (! PyType_SUPPORTS_WEAKREFS(Py_TYPE(op))) -@@ -640,9 +645,9 @@ handle_weakrefs(PyGC_Head *unreachable, +@@ -640,9 +645,9 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) * the callback pointer intact. Obscure: it also * changes *wrlist. */ @@ -241,7 +217,7 @@ diff -up Modules/gcmodule.c.orig2 Modules/gcmodule.c if (wr->wr_callback == NULL) continue; /* no callback */ -@@ -676,7 +681,7 @@ handle_weakrefs(PyGC_Head *unreachable, +@@ -676,7 +681,7 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) */ if (IS_TENTATIVELY_UNREACHABLE(wr)) continue; @@ -250,7 +226,7 @@ diff -up Modules/gcmodule.c.orig2 Modules/gcmodule.c /* Create a new reference so that wr can't go away * before we can process it again. -@@ -685,7 +690,8 @@ handle_weakrefs(PyGC_Head *unreachable, +@@ -685,7 +690,8 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) /* Move wr to wrcb_to_call, for the next pass. */ wrasgc = AS_GC(wr); @@ -260,7 +236,7 @@ diff -up Modules/gcmodule.c.orig2 Modules/gcmodule.c next isn't, so they can't be the same */ gc_list_move(wrasgc, &wrcb_to_call); -@@ -701,11 +707,11 @@ handle_weakrefs(PyGC_Head *unreachable, +@@ -701,11 +707,11 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) gc = wrcb_to_call.gc.gc_next; op = FROM_GC(gc); @@ -292,35 +268,43 @@ diff -up Modules/gcmodule.c.orig2 Modules/gcmodule.c if (_PyGCHead_REFS(gc) != 0) return -1; } -diff -up Lib/test/test_gc.py.old Lib/test/test_gc.py ---- Lib/test/test_gc.py.old 2014-12-10 11:19:33.503982288 +0100 -+++ Lib/test/test_gc.py 2014-12-10 11:21:13.220021364 +0100 -@@ -49,6 +49,8 @@ class GC_Detector(object): - # gc collects it. - self.wr = weakref.ref(C1055820(666), it_happened) +diff --git a/Objects/object.c b/Objects/object.c +index 559794f..a47d47f 100644 +--- a/Objects/object.c ++++ b/Objects/object.c +@@ -2022,6 +2022,35 @@ _PyTrash_thread_destroy_chain(void) + } + } -+BUILD_WITH_NDEBUG = ('-DNDEBUG' in sysconfig.get_config_vars()['PY_CFLAGS']) ++PyAPI_FUNC(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); ++ } + - @with_tp_del - class Uncollectable(object): - """Create a reference cycle with multiple __del__ methods. -@@ -854,6 +856,8 @@ class GCCallbackTests(unittest.TestCase) - self.assertEqual(len(gc.garbage), 0) - - -+ @unittest.skipIf(BUILD_WITH_NDEBUG, -+ 'built with -NDEBUG') - def test_refcount_errors(self): - self.preclean() - # Verify the "handling" of objects with broken refcounts -diff -up Lib/test/test_gc.py.old Lib/test/test_gc.py ---- Lib/test/test_gc.py.old 2014-12-10 12:50:58.252121318 +0100 -+++ Lib/test/test_gc.py 2014-12-10 12:51:08.594266653 +0100 -@@ -4,6 +4,7 @@ from test.support import (verbose, refco - from test.support.script_helper import assert_python_ok, make_script - - import sys -+import sysconfig - import time - import gc - import weakref ++ 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(); ++} ++ + #ifndef Py_TRACE_REFS + /* For Py_LIMITED_API, we need an out-of-line version of _Py_Dealloc. + Define this here, so we can undefine the macro. */ diff --git a/00209-fix-test-pyexpat-failure.patch b/00209-fix-test-pyexpat-failure.patch deleted file mode 100644 index 7b40280..0000000 --- a/00209-fix-test-pyexpat-failure.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff -r 682a8e36dd18 Lib/test/test_pyexpat.py ---- a/Lib/test/test_pyexpat.py Tue Jul 05 17:08:52 2016 +0300 -+++ b/Lib/test/test_pyexpat.py Thu Jul 07 17:04:35 2016 +0800 -@@ -656,11 +656,9 @@ - # \xc2\x85 is UTF-8 encoded U+0085 (NEXT LINE) - xml = b"\r\n" - parser = expat.ParserCreate() -- try: -+ err_pattern = r'XML declaration not well-formed: line 1, column \d+' -+ with self.assertRaisesRegex(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 ErrorMessageTest(unittest.TestCase): - def test_codes(self): diff --git a/00242-CVE-2016-1000110-httpoxy.patch b/00242-CVE-2016-1000110-httpoxy.patch deleted file mode 100644 index 244ebec..0000000 --- a/00242-CVE-2016-1000110-httpoxy.patch +++ /dev/null @@ -1,89 +0,0 @@ -diff --git a/Doc/howto/urllib2.rst b/Doc/howto/urllib2.rst -index 24a4156..d2c7991 100644 ---- a/Doc/howto/urllib2.rst -+++ b/Doc/howto/urllib2.rst -@@ -538,6 +538,11 @@ setting up a `Basic Authentication`_ handler: :: - through a proxy. However, this can be enabled by extending urllib.request as - shown in the recipe [#]_. - -+.. note:: -+ -+ ``HTTP_PROXY`` will be ignored if a variable ``REQUEST_METHOD`` is set; see -+ the documentation on :func:`~urllib.request.getproxies`. -+ - - Sockets and Layers - ================== -diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst -index 6c1bfb8..1291aeb 100644 ---- a/Doc/library/urllib.request.rst -+++ b/Doc/library/urllib.request.rst -@@ -173,6 +173,16 @@ The :mod:`urllib.request` module defines the following 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). -+ - - The following classes are provided: - -@@ -280,6 +290,11 @@ The following classes are provided: - list of hostname suffixes, optionally with ``:port`` appended, for example - ``cern.ch,ncsa.uiuc.edu,some.host:8080``. - -+ .. note:: -+ -+ ``HTTP_PROXY`` will be ignored if a variable ``REQUEST_METHOD`` is set; -+ see the documentation on :func:`~urllib.request.getproxies`. -+ - - .. class:: HTTPPasswordMgr() - -diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py -index 5d05f8d..c26c52a 100644 ---- a/Lib/test/test_urllib.py -+++ b/Lib/test/test_urllib.py -@@ -232,6 +232,18 @@ class ProxyTests(unittest.TestCase): - self.assertTrue(urllib.request.proxy_bypass_environment('anotherdomain.com:8888')) - self.assertTrue(urllib.request.proxy_bypass_environment('newdomain.com:1234')) - -+ def test_proxy_cgi_ignore(self): -+ try: -+ self.env.set('HTTP_PROXY', 'http://somewhere:3128') -+ proxies = urllib.request.getproxies_environment() -+ self.assertEqual('http://somewhere:3128', proxies['http']) -+ self.env.set('REQUEST_METHOD', 'GET') -+ proxies = urllib.request.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.request.proxy_bypass_environment - self.env.set('NO_PROXY', -diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py -index 1731fe3..3be327d 100644 ---- a/Lib/urllib/request.py -+++ b/Lib/urllib/request.py -@@ -2412,6 +2412,12 @@ def getproxies_environment(): - 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) - 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 5760d67..0000000 --- a/00247-port-ssl-and-hashlib-to-OpenSSL-1.1.0.patch +++ /dev/null @@ -1,1314 +0,0 @@ - -# HG changeset patch -# User Christian Heimes -# Date 1473110345 -7200 -# Node ID 5c75b315152b714f7c84258ea511b461e2c06154 -# Parent 82467d0dbaea31a7971d1429ca5f4a251a995f33 -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 -@@ -178,7 +178,7 @@ instead. - use. Typically, the server chooses a particular protocol version, and the - client must adapt to the server's choice. Most of the versions are not - interoperable with the other versions. If not specified, the default is -- :data:`PROTOCOL_SSLv23`; it provides the most compatibility with other -+ :data:`PROTOCOL_TLS`; it provides the most compatibility with other - versions. - - Here's a table showing which versions in a client (down the side) can connect -@@ -187,11 +187,11 @@ instead. - .. table:: - - ======================== ========= ========= ========== ========= =========== =========== -- *client* / **server** **SSLv2** **SSLv3** **SSLv23** **TLSv1** **TLSv1.1** **TLSv1.2** -+ *client* / **server** **SSLv2** **SSLv3** **TLS** **TLSv1** **TLSv1.1** **TLSv1.2** - ------------------------ --------- --------- ---------- --------- ----------- ----------- - *SSLv2* yes no yes no no no - *SSLv3* no yes yes no no no -- *SSLv23* no yes yes yes yes yes -+ *TLS* (*SSLv23*) no yes yes yes yes yes - *TLSv1* no no yes yes no no - *TLSv1.1* no no yes no yes no - *TLSv1.2* no no yes no no yes -@@ -244,7 +244,7 @@ purposes. - :const:`None`, this function can choose to trust the system's default - CA certificates instead. - -- The settings are: :data:`PROTOCOL_SSLv23`, :data:`OP_NO_SSLv2`, and -+ The settings are: :data:`PROTOCOL_TLS`, :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` -@@ -316,6 +316,11 @@ Random generation - - .. versionadded:: 3.3 - -+ .. deprecated:: 3.5.3 -+ -+ 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 -@@ -334,7 +339,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) - -@@ -409,7 +414,7 @@ Certificate handling - 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) -+.. function:: get_server_certificate(addr, ssl_version=PROTOCOL_TLS, 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 -@@ -425,7 +430,7 @@ Certificate handling - - .. versionchanged:: 3.5 - The default *ssl_version* is changed from :data:`PROTOCOL_SSLv3` to -- :data:`PROTOCOL_SSLv23` for maximum compatibility with modern servers. -+ :data:`PROTOCOL_TLS` for maximum compatibility with modern servers. - - .. function:: DER_cert_to_PEM_cert(DER_cert_bytes) - -@@ -451,6 +456,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:: 3.4 - - .. function:: enum_certificates(store_name) -@@ -568,11 +576,21 @@ Constants - - .. versionadded:: 3.4.4 - --.. 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:: 3.5.3 -+ -+.. data:: PROTOCOL_SSLv23 -+ -+ Alias for data:`PROTOCOL_TLS`. -+ -+ .. deprecated:: 3.5.3 -+ -+ Use data:`PROTOCOL_TLS` instead. -+ - .. data:: PROTOCOL_SSLv2 - - Selects SSL version 2 as the channel encryption protocol. -@@ -584,6 +602,10 @@ Constants - - SSL version 2 is insecure. Its use is highly discouraged. - -+ .. deprecated:: 3.5.3 -+ -+ OpenSSL has removed support for SSLv2. -+ - .. data:: PROTOCOL_SSLv3 - - Selects SSL version 3 as the channel encryption protocol. -@@ -595,10 +617,20 @@ Constants - - SSL version 3 is insecure. Its use is highly discouraged. - -+ .. deprecated:: 3.5.3 -+ -+ OpenSSL has deprecated all version specific protocols. Use the default -+ protocol data:`PROTOCOL_TLS` with flags like data:`OP_NO_SSLv3` instead. -+ - .. data:: PROTOCOL_TLSv1 - - Selects TLS version 1.0 as the channel encryption protocol. - -+ .. deprecated:: 3.5.3 -+ -+ OpenSSL has deprecated all version specific protocols. Use the default -+ protocol data:`PROTOCOL_TLS` with flags like data:`OP_NO_SSLv3` instead. -+ - .. data:: PROTOCOL_TLSv1_1 - - Selects TLS version 1.1 as the channel encryption protocol. -@@ -606,6 +638,11 @@ Constants - - .. versionadded:: 3.4 - -+ .. deprecated:: 3.5.3 -+ -+ OpenSSL has deprecated all version specific protocols. Use the default -+ protocol data:`PROTOCOL_TLS` with flags like data:`OP_NO_SSLv3` instead. -+ - .. data:: PROTOCOL_TLSv1_2 - - Selects TLS version 1.2 as the channel encryption protocol. This is the -@@ -614,6 +651,11 @@ Constants - - .. versionadded:: 3.4 - -+ .. deprecated:: 3.5.3 -+ -+ OpenSSL has deprecated all version specific protocols. Use the default -+ protocol data:`PROTOCOL_TLS` with flags like data:`OP_NO_SSLv3` instead. -+ - .. data:: OP_ALL - - Enables workarounds for various bugs present in other SSL implementations. -@@ -625,23 +667,32 @@ Constants - .. data:: OP_NO_SSLv2 - - Prevents an SSLv2 connection. This option is only applicable in -- conjunction with :const:`PROTOCOL_SSLv23`. It prevents the peers from -+ conjunction with :const:`PROTOCOL_TLS`. It prevents the peers from - choosing SSLv2 as the protocol version. - - .. versionadded:: 3.2 - -+ .. deprecated:: 3.5.3 -+ -+ SSLv2 is deprecated -+ -+ - .. data:: OP_NO_SSLv3 - - Prevents an SSLv3 connection. This option is only applicable in -- conjunction with :const:`PROTOCOL_SSLv23`. It prevents the peers from -+ conjunction with :const:`PROTOCOL_TLS`. It prevents the peers from - choosing SSLv3 as the protocol version. - - .. versionadded:: 3.2 - -+ .. deprecated:: 3.5.3 -+ -+ SSLv3 is deprecated -+ - .. data:: OP_NO_TLSv1 - - Prevents a TLSv1 connection. This option is only applicable in -- conjunction with :const:`PROTOCOL_SSLv23`. It prevents the peers from -+ conjunction with :const:`PROTOCOL_TLS`. It prevents the peers from - choosing TLSv1 as the protocol version. - - .. versionadded:: 3.2 -@@ -649,7 +700,7 @@ Constants - .. 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 -+ with :const:`PROTOCOL_TLS`. It prevents the peers from choosing TLSv1.1 as - the protocol version. Available only with openssl version 1.0.1+. - - .. versionadded:: 3.4 -@@ -657,7 +708,7 @@ Constants - .. 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 -+ with :const:`PROTOCOL_TLS`. It prevents the peers from choosing TLSv1.2 as - the protocol version. Available only with openssl version 1.0.1+. - - .. versionadded:: 3.4 -@@ -1081,17 +1132,21 @@ such as SSL configuration options, certi - 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 -+.. class:: SSLContext(protocol=PROTOCOL_TLS) -+ -+ Create a new SSL context. You may pass *protocol* which must be one - of the ``PROTOCOL_*`` constants defined in this module. -- :data:`PROTOCOL_SSLv23` is currently recommended for maximum -- interoperability. -+ :data:`PROTOCOL_TLS` is currently recommended for maximum -+ interoperability and default value. - - .. seealso:: - :func:`create_default_context` lets the :mod:`ssl` module choose - security settings for a given purpose. - -+ .. versionchanged:: 3.5.3 -+ -+ :data:`PROTOCOL_TLS` is the default value. -+ - - :class:`SSLContext` objects have the following methods and attributes: - -@@ -1232,6 +1287,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:: 3.5 - - .. method:: SSLContext.set_npn_protocols(protocols) -@@ -1598,7 +1656,7 @@ If you prefer to tune security settings - a context from scratch (but beware that you might not get the settings - right):: - -- >>> context = ssl.SSLContext(ssl.PROTOCOL_SSLv23) -+ >>> context = ssl.SSLContext(ssl.PROTOCOL_TLS) - >>> context.verify_mode = ssl.CERT_REQUIRED - >>> context.check_hostname = True - >>> context.load_verify_locations("/etc/ssl/certs/ca-bundle.crt") -@@ -1999,15 +2057,17 @@ Protocol versions - - SSL versions 2 and 3 are considered insecure and are 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 -+recommended to use :const:`PROTOCOL_TLS` as the protocol version and then - disable SSLv2 and SSLv3 explicitly using the :data:`SSLContext.options` - attribute:: - -- context = ssl.SSLContext(ssl.PROTOCOL_SSLv23) -+ context = ssl.SSLContext(ssl.PROTOCOL_TLS) - context.options |= ssl.OP_NO_SSLv2 - context.options |= ssl.OP_NO_SSLv3 -- --The SSL context created above will only allow TLSv1 and later (if -+ context.options |= ssl.OP_NO_TLSv1 -+ context.options |= ssl.OP_NO_TLSv1_1 -+ -+The SSL context created above will only allow TLSv1.2 and later (if - supported by your system) connections. - - Cipher selection -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 -@@ -128,9 +129,10 @@ from _ssl import _OPENSSL_API_VERSION - - _IntEnum._convert( - '_SSLMethod', __name__, -- lambda name: name.startswith('PROTOCOL_'), -+ lambda name: name.startswith('PROTOCOL_') and name != 'PROTOCOL_SSLv23', - source=_ssl) - -+PROTOCOL_SSLv23 = _SSLMethod.PROTOCOL_SSLv23 = _SSLMethod.PROTOCOL_TLS - _PROTOCOL_NAMES = {value: name for name, value in _SSLMethod.__members__.items()} - - try: -@@ -357,13 +359,13 @@ class SSLContext(_SSLContext): - __slots__ = ('protocol', '__weakref__') - _windows_cert_stores = ("CA", "ROOT") - -- def __new__(cls, protocol, *args, **kwargs): -+ def __new__(cls, protocol=PROTOCOL_TLS, *args, **kwargs): - self = _SSLContext.__new__(cls, protocol) - if protocol != _SSLv2_IF_EXISTS: - self.set_ciphers(_DEFAULT_CIPHERS) - return self - -- def __init__(self, protocol): -+ def __init__(self, protocol=PROTOCOL_TLS): - self.protocol = protocol - - def wrap_socket(self, sock, server_side=False, -@@ -438,7 +440,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 -@@ -475,7 +477,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): -@@ -666,7 +668,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, -@@ -1056,7 +1058,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): -@@ -1125,7 +1127,7 @@ def PEM_cert_to_DER_cert(pem_cert_string - d = pem_cert_string.strip()[len(PEM_HEADER):-len(PEM_FOOTER)] - return base64.decodebytes(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 -@@ -23,6 +23,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) -@@ -143,8 +146,8 @@ class BasicSocketTests(unittest.TestCase - def test_str_for_enums(self): - # Make sure that the PROTOCOL_* constants have enum-like string - # reprs. -- proto = ssl.PROTOCOL_SSLv23 -- self.assertEqual(str(proto), '_SSLMethod.PROTOCOL_SSLv23') -+ proto = ssl.PROTOCOL_TLS -+ self.assertEqual(str(proto), '_SSLMethod.PROTOCOL_TLS') - ctx = ssl.SSLContext(proto) - self.assertIs(ctx.protocol, proto) - -@@ -312,8 +315,8 @@ 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)), -+ 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)), -@@ -790,7 +793,8 @@ class ContextTests(unittest.TestCase): - def test_constructor(self): - for protocol in PROTOCOLS: - ssl.SSLContext(protocol) -- self.assertRaises(TypeError, ssl.SSLContext) -+ ctx = ssl.SSLContext() -+ self.assertEqual(ctx.protocol, ssl.PROTOCOL_TLS) - self.assertRaises(ValueError, ssl.SSLContext, -1) - self.assertRaises(ValueError, ssl.SSLContext, 42) - -@@ -811,15 +815,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 - # Ubuntu has OP_NO_SSLv3 forced on by default - self.assertEqual(0, ctx.options & ~ssl.OP_NO_SSLv3) -@@ -1155,6 +1159,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: -@@ -1750,13 +1755,13 @@ class NetworkedBIOTests(unittest.TestCas - sslobj = ctx.wrap_bio(incoming, outgoing, False, REMOTE_HOST) - self.assertIs(sslobj._sslobj.owner, sslobj) - self.assertIsNone(sslobj.cipher()) -- self.assertIsNone(sslobj.shared_ciphers()) -+ self.assertIsNotNone(sslobj.shared_ciphers()) - self.assertRaises(ValueError, sslobj.getpeercert) - if 'tls-unique' in ssl.CHANNEL_BINDING_TYPES: - self.assertIsNone(sslobj.get_channel_binding('tls-unique')) - self.ssl_io_loop(sock, incoming, outgoing, sslobj.do_handshake) - self.assertTrue(sslobj.cipher()) -- self.assertIsNone(sslobj.shared_ciphers()) -+ self.assertIsNotNone(sslobj.shared_ciphers()) - self.assertTrue(sslobj.getpeercert()) - if 'tls-unique' in ssl.CHANNEL_BINDING_TYPES: - self.assertTrue(sslobj.get_channel_binding('tls-unique')) -@@ -2993,7 +2998,7 @@ else: - with 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") -@@ -3135,24 +3140,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 -@@ -3300,13 +3317,23 @@ else: - client_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1) - client_context.verify_mode = ssl.CERT_REQUIRED - client_context.load_verify_locations(SIGNING_CA) -- client_context.set_ciphers("RC4") -- server_context.set_ciphers("AES:RC4") -+ if ssl.OPENSSL_VERSION_INFO >= (1, 0, 2): -+ client_context.set_ciphers("AES128:AES256") -+ server_context.set_ciphers("AES256") -+ alg1 = "AES256" -+ alg2 = "AES-256" -+ else: -+ client_context.set_ciphers("AES:3DES") -+ server_context.set_ciphers("3DES") -+ alg1 = "3DES" -+ alg2 = "DES-CBC3" -+ - stats = server_params_test(client_context, server_context) - ciphers = stats['server_shared_ciphers'][0] - self.assertGreater(len(ciphers), 0) - for name, tls_version, bits in ciphers: -- self.assertIn("RC4", name.split("-")) -+ if not alg1 in name.split("-") and alg2 not in name: -+ self.fail(name) - - def test_read_write_after_close_raises_valuerror(self): - context = ssl.SSLContext(ssl.PROTOCOL_SSLv23) - -diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c ---- a/Modules/_hashopenssl.c -+++ b/Modules/_hashopenssl.c -@@ -21,7 +21,6 @@ - - /* EVP is the preferred interface to hashing in OpenSSL */ - #include --#include - /* We use the object interface to discover what hashes OpenSSL supports. */ - #include - #include "openssl/err.h" -@@ -32,11 +31,22 @@ - #define HASH_OBJ_CONSTRUCTOR 0 - #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 -+#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 -@@ -48,7 +58,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) -@@ -59,19 +68,57 @@ DEFINE_CONSTS_FOR_NEW(sha384) - DEFINE_CONSTS_FOR_NEW(sha512) - - -+/* 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; - } -@@ -86,7 +133,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; - } -@@ -101,16 +148,19 @@ 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); -+ result = EVP_MD_CTX_copy(new_ctx_p, self->ctx); - LEAVE_HASHLIB(self); -+ return result; - } - - /* External methods for a hash object */ -@@ -126,7 +176,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; - } - -@@ -137,16 +189,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 = PyBytes_FromStringAndSize((const char *)digest, digest_size); -- EVP_MD_CTX_cleanup(&temp_ctx); -+ EVP_MD_CTX_free(temp_ctx); - return retval; - } - -@@ -157,15 +217,23 @@ 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; - unsigned int 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); - - return _Py_strhex((const char *)digest, digest_size); - } -@@ -219,7 +287,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); - } - -@@ -227,7 +295,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); - } - -@@ -288,7 +356,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); -@@ -385,9 +453,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) { -@@ -453,6 +521,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 -@@ -534,37 +603,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\ -@@ -646,10 +686,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) { -@@ -768,7 +815,7 @@ generate_hash_name_list(void) - if (CONST_ ## NAME ## _name_obj == NULL) { \ - CONST_ ## NAME ## _name_obj = PyUnicode_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 -@@ -55,6 +55,14 @@ static PySocketModule_APIObject PySocket - #include - #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" -@@ -91,6 +99,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 - */ -@@ -117,6 +129,72 @@ struct py_ssl_library_code { - # define HAVE_ALPN - #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 int BIO_up_ref(BIO *b) -+{ -+ CRYPTO_add(&b->references, 1, CRYPTO_LOCK_BIO); -+ return 1; -+} -+ -+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, -@@ -147,7 +225,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, -@@ -527,8 +605,8 @@ newPySSLSocket(PySSLContext *sslctx, PyS - /* BIOs are reference counted and SSL_set_bio borrows our reference. - * To prevent a double free in memory_bio_dealloc() we need to take an - * extra reference here. */ -- CRYPTO_add(&inbio->bio->references, 1, CRYPTO_LOCK_BIO); -- CRYPTO_add(&outbio->bio->references, 1, CRYPTO_LOCK_BIO); -+ BIO_up_ref(inbio->bio); -+ BIO_up_ref(outbio->bio); - SSL_set_bio(self->ssl, inbio->bio, outbio->bio); - } - mode = SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER; -@@ -738,7 +816,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); -@@ -755,7 +833,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); -@@ -853,18 +931,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 */ -@@ -1075,13 +1153,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; -@@ -1451,14 +1527,13 @@ static PyObject * - _ssl__SSLSocket_shared_ciphers_impl(PySSLSocket *self) - /*[clinic end generated code: output=3d174ead2e42c4fd input=0bfe149da8fe6306]*/ - { -- SSL_SESSION *sess = SSL_get_session(self->ssl); - STACK_OF(SSL_CIPHER) *ciphers; - int i; - PyObject *res; - -- if (!sess || !sess->ciphers) -+ ciphers = SSL_get_ciphers(self->ssl); -+ if (!ciphers) - Py_RETURN_NONE; -- ciphers = sess->ciphers; - res = PyList_New(sk_SSL_CIPHER_num(ciphers)); - if (!res) - return NULL; -@@ -1567,9 +1642,9 @@ static PyObject * - 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 PyUnicode_DecodeFSDefault(short_name); -@@ -2255,8 +2330,8 @@ static 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 -@@ -2318,8 +2393,9 @@ static 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 - { -@@ -2586,10 +2662,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); - } - -@@ -2597,22 +2675,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; - } -@@ -2789,8 +2869,8 @@ static PyObject * - /*[clinic end generated code: output=9480bc1c380e2095 input=7cf9ac673cbee6fc]*/ - { - PyObject *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; -+ 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; - -@@ -2917,8 +2997,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; -@@ -3444,25 +3525,24 @@ static PyObject * - /*[clinic end generated code: output=5f356f4d9cca874d input=eb40dd0f6d0e40cf]*/ - { - 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 -@@ -3492,6 +3572,7 @@ static PyObject * - /*[clinic end generated code: output=0d58f148f37e2938 input=6887b5a09b7f9076]*/ - { - X509_STORE *store; -+ STACK_OF(X509_OBJECT) *objs; - PyObject *ci = NULL, *rlist = NULL; - int i; - -@@ -3500,17 +3581,18 @@ static PyObject * - } - - 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; - } -@@ -4374,10 +4456,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; - -@@ -4458,7 +4542,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\ -@@ -4527,11 +4611,16 @@ PyInit__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 NULL; - } -+#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 */ -@@ -4678,7 +4767,9 @@ PyInit__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 - -diff --git a/Modules/_ssl.c b/Modules/_ssl.c ---- a/Modules/_ssl.c -+++ b/Modules/_ssl.c -@@ -151,11 +151,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) -@@ -1644,7 +1639,7 @@ static PyObject * - 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 PyUnicode_DecodeFSDefault(short_name); diff --git a/python3.spec b/python3.spec index 6f2a462..b0d8d7a 100644 --- a/python3.spec +++ b/python3.spec @@ -395,20 +395,6 @@ Patch205: 00205-make-libpl-respect-lib64.patch # by debian but fedora infra uses only eabi without hf Patch206: 00206-remove-hf-from-arm-triplet.patch -# 00209 # -# Fix test breakage with version 2.2.0 of Expat -# rhbz#1353918: https://bugzilla.redhat.com/show_bug.cgi?id=1353918 -# 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 Rémi Rampin -# Resolves: rhbz#1359177 -Patch242: 00242-CVE-2016-1000110-httpoxy.patch - # 00243 # # Fix the triplet used on 64-bit MIPS # rhbz#1322526: https://bugzilla.redhat.com/show_bug.cgi?id=1322526 @@ -416,13 +402,6 @@ Patch242: 00242-CVE-2016-1000110-httpoxy.patch # Fedora needs the default mips64-linux-gnu Patch243: 00243-fix-mips64-triplet.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 3.5.3 -# 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., @@ -641,13 +620,13 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch111 -p1 %patch132 -p1 %patch137 -p1 -%patch143 -p1 -b .tsc-on-ppc +#patch143 -p1 -b .tsc-on-ppc #patch146 -p1 %patch155 -p1 %patch157 -p1 %patch160 -p1 %patch163 -p1 -%patch170 -p0 +%patch170 -p1 %patch178 -p1 %patch180 -p1 %patch184 -p1 @@ -660,10 +639,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch205 -p1 %patch206 -p1 -%patch209 -p1 -%patch242 -p1 %patch243 -p1 -%patch247 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. From 390d524690b0a73d98f1608618f3251b9ad98d82 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Thu, 29 Sep 2016 16:19:02 +0200 Subject: [PATCH 281/416] Disable test suite --- python3.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index b0d8d7a..2107279 100644 --- a/python3.spec +++ b/python3.spec @@ -86,7 +86,7 @@ %global with_computed_gotos yes # Turn this to 0 to turn off the "check" phase: -%global run_selftest_suite 1 +%global run_selftest_suite 0 # We want to byte-compile the .py files within the packages using the new # python3 binary. From 1c8e9a60f480e5d360133a1ac042c723a0d34212 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Fri, 7 Oct 2016 19:22:17 +0200 Subject: [PATCH 282/416] Add the cryptography algorithms files to the respective file sections since the hashlib patch was dropped, so we are using currently python's implementation of these algorithms instead of the OpenSSL's ones. Relevant upstream issue26470. Remove the plat-linux directory and add the system configuration data files(upstream issue28046) --- python3.spec | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/python3.spec b/python3.spec index 2107279..2f7cec5 100644 --- a/python3.spec +++ b/python3.spec @@ -52,9 +52,10 @@ # For example, # foo/bar.py # now has bytecode at: -# foo/__pycache__/bar.cpython-35.pyc -# foo/__pycache__/bar.cpython-35.pyo -%global bytecode_suffixes .cpython-36*.py? +# foo/__pycache__/bar.cpython-36.pyc +# foo/__pycache__/bar.cpython-36.opt-1.pyc +# foo/__pycache__/bar.cpython-36.opt-2.pyc +%global bytecode_suffixes .cpython-36*.pyc # Python's configure script defines SOVERSION, and this is used in the Makefile # to determine INSTSONAME, the name of the libpython DSO: @@ -1207,10 +1208,16 @@ rm -fr %{buildroot} %dir %{pylibdir} %dir %{dynload_dir} +%{dynload_dir}/_blake2.%{SOABI_optimized}.so %{dynload_dir}/_md5.%{SOABI_optimized}.so -%{dynload_dir}/_sha256.%{SOABI_optimized}.so -%{dynload_dir}/_sha512.%{SOABI_optimized}.so %{dynload_dir}/_sha1.%{SOABI_optimized}.so +%{dynload_dir}/_sha256.%{SOABI_optimized}.so +%{dynload_dir}/_sha3.%{SOABI_optimized}.so +%{dynload_dir}/_sha512.%{SOABI_optimized}.so + +%{dynload_dir}/_sysconfigdata_%{ABIFLAGS_optimized}_linux_%{_arch}-linux%{_gnu}.py +%dir %{dynload_dir}/__pycache__/ +%{dynload_dir}/__pycache__/_sysconfigdata_%{ABIFLAGS_optimized}_linux_%{_arch}-linux%{_gnu}%{bytecode_suffixes} %{dynload_dir}/_bisect.%{SOABI_optimized}.so %{dynload_dir}/_bz2.%{SOABI_optimized}.so @@ -1274,6 +1281,7 @@ rm -fr %{buildroot} %dir %{pylibdir}/site-packages/ %dir %{pylibdir}/site-packages/__pycache__/ %{pylibdir}/site-packages/README +%{pylibdir}/site-packages/README.txt %{pylibdir}/*.py %dir %{pylibdir}/__pycache__/ %{pylibdir}/__pycache__/*%{bytecode_suffixes} @@ -1328,7 +1336,6 @@ rm -fr %{buildroot} %{pylibdir}/logging %{pylibdir}/multiprocessing -%{pylibdir}/plat-linux %dir %{pylibdir}/sqlite3/ %dir %{pylibdir}/sqlite3/__pycache__/ @@ -1435,10 +1442,15 @@ rm -fr %{buildroot} # Analog of the -libs subpackage's files: # ...with debug builds of the built-in "extension" modules: +%{dynload_dir}/_blake2.%{SOABI_debug}.so %{dynload_dir}/_md5.%{SOABI_debug}.so -%{dynload_dir}/_sha256.%{SOABI_debug}.so -%{dynload_dir}/_sha512.%{SOABI_debug}.so %{dynload_dir}/_sha1.%{SOABI_debug}.so +%{dynload_dir}/_sha256.%{SOABI_debug}.so +%{dynload_dir}/_sha3.%{SOABI_debug}.so +%{dynload_dir}/_sha512.%{SOABI_debug}.so + +%{dynload_dir}/_sysconfigdata_%{ABIFLAGS_debug}_linux_%{_arch}-linux%{_gnu}.py +%{dynload_dir}/__pycache__/_sysconfigdata_%{ABIFLAGS_debug}_linux_%{_arch}-linux%{_gnu}%{bytecode_suffixes} %{dynload_dir}/_bisect.%{SOABI_debug}.so %{dynload_dir}/_bz2.%{SOABI_debug}.so From c426ceabbeffe623d4d16978e6308717913ffbf0 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Tue, 11 Oct 2016 19:47:55 +0200 Subject: [PATCH 283/416] Fix the excluded tests due to -x flag not working properly (upstream issue28409) --- python3.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python3.spec b/python3.spec index 2f7cec5..bdd19c4 100644 --- a/python3.spec +++ b/python3.spec @@ -1076,13 +1076,13 @@ CheckPython() { --verbose --findleaks \ -x test_distutils \ %ifarch ppc64le aarch64 - -x test_faulthandler \ + test_faulthandler \ %endif %ifarch %{mips64} - -x test_ctypes \ + test_ctypes \ %endif %ifarch %{power64} s390 s390x armv7hl aarch64 %{mips} - -x test_gdb + test_gdb %endif echo FINISHED: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName From 067a255b229bea094399a9b4a9a78634a4205ff0 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Tue, 11 Oct 2016 19:56:27 +0200 Subject: [PATCH 284/416] Update to 3.6.0b2 --- python3.spec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python3.spec b/python3.spec index bdd19c4..02135f4 100644 --- a/python3.spec +++ b/python3.spec @@ -14,8 +14,8 @@ # 4) python3-setuptools and python3-pip with with_rewheel set to 1 # 5) python3 with with_rewheel set to 1 -# First beta prerelease -%global prerel b1 +# Second beta prerelease +%global prerel b2 %global with_rewheel 1 @@ -116,7 +116,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 0.1.%{?prerel}%{?dist} +Release: 0.2.%{?prerel}%{?dist} License: Python Group: Development/Languages @@ -184,7 +184,7 @@ BuildRequires: python3-pip # Source code and patches # ======================= -Source: https://www.python.org/ftp/python/3.6.0/Python-3.6.0b1.tar.xz +Source: https://www.python.org/ftp/python/3.6.0/Python-3.6.0b2.tar.xz # Supply an RPM macro "py_byte_compile" for the python3-devel subpackage # to enable specfiles to selectively byte-compile individual files and paths From a744d8670aa7810bd3c7bc945cb5a732985e5c7e Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Tue, 11 Oct 2016 20:03:32 +0200 Subject: [PATCH 285/416] Drop patch 184 as it is implemented upstream now (upstream issue26661) --- python3.spec | 9 --------- 1 file changed, 9 deletions(-) diff --git a/python3.spec b/python3.spec index 02135f4..fbb41cb 100644 --- a/python3.spec +++ b/python3.spec @@ -346,14 +346,6 @@ Patch178: 00178-dont-duplicate-flags-in-sysconfig.patch # Not appropriate for upstream, Fedora-specific naming Patch180: 00180-python-add-support-for-ppc64p7.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 - # 00186 # # Fix for https://bugzilla.redhat.com/show_bug.cgi?id=1023607 # Previously, this fixed a problem where some *.py files were not being @@ -630,7 +622,6 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch170 -p1 %patch178 -p1 %patch180 -p1 -%patch184 -p1 %patch186 -p1 %patch188 -p1 From 062c68f0569463e62d3636e2e3e663117c247d23 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Tue, 11 Oct 2016 20:14:31 +0200 Subject: [PATCH 286/416] Add the files of asyncio.future's C implementation to the respective %files section (upstream issue26081) --- python3.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python3.spec b/python3.spec index fbb41cb..a66c9e8 100644 --- a/python3.spec +++ b/python3.spec @@ -1226,6 +1226,7 @@ rm -fr %{buildroot} %{dynload_dir}/_dbm.%{SOABI_optimized}.so %{dynload_dir}/_decimal.%{SOABI_optimized}.so %{dynload_dir}/_elementtree.%{SOABI_optimized}.so +%{dynload_dir}/_futures.%{SOABI_optimized}.so %if %{with_gdbm} %{dynload_dir}/_gdbm.%{SOABI_optimized}.so %endif @@ -1459,6 +1460,7 @@ rm -fr %{buildroot} %{dynload_dir}/_dbm.%{SOABI_debug}.so %{dynload_dir}/_decimal.%{SOABI_debug}.so %{dynload_dir}/_elementtree.%{SOABI_debug}.so +%{dynload_dir}/_futures.%{SOABI_debug}.so %if %{with_gdbm} %{dynload_dir}/_gdbm.%{SOABI_debug}.so %endif From ace4eac581ebdd507c5e3867bd7f73b7f67133b6 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Wed, 12 Oct 2016 14:04:47 +0200 Subject: [PATCH 287/416] Fix rewheel's module regex (related upstream issue27364 and issue28128). Enable tests. --- 00189-add-rewheel-module.patch | 2 +- python3.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/00189-add-rewheel-module.patch b/00189-add-rewheel-module.patch index 5d514be..53a26ca 100644 --- a/00189-add-rewheel-module.patch +++ b/00189-add-rewheel-module.patch @@ -119,7 +119,7 @@ diff -Nur Python-3.4.1/Lib/ensurepip/rewheel/__init__.py Python-3.4.1-rewheel/Li + 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) ++ dist_info_re = os.path.join(sp, project) + r'-[^\{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)] diff --git a/python3.spec b/python3.spec index a66c9e8..6d3ef9b 100644 --- a/python3.spec +++ b/python3.spec @@ -87,7 +87,7 @@ %global with_computed_gotos yes # Turn this to 0 to turn off the "check" phase: -%global run_selftest_suite 0 +%global run_selftest_suite 1 # We want to byte-compile the .py files within the packages using the new # python3 binary. From 1f40c0cbd186c2743dc30c3bad6773b8d49e7902 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Tue, 1 Nov 2016 15:05:11 +0100 Subject: [PATCH 288/416] Remove --with-tsc configure flag as it has been removed upstream. Also removing patch 143 related to that flag. Relevant upstream commit: https://hg.python.org/cpython/rev/2310a5b75fae --- 00143-tsc-on-ppc.patch | 58 ------------------------------------------ python3.spec | 9 +------ 2 files changed, 1 insertion(+), 66 deletions(-) delete mode 100644 00143-tsc-on-ppc.patch diff --git a/00143-tsc-on-ppc.patch b/00143-tsc-on-ppc.patch deleted file mode 100644 index 7d3e876..0000000 --- a/00143-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) - { -- 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/python3.spec b/python3.spec index 6d3ef9b..ad3399b 100644 --- a/python3.spec +++ b/python3.spec @@ -258,12 +258,6 @@ Patch132: 00132-add-rpmbuild-hooks-to-unittest.patch # Some tests within distutils fail when run in an rpmbuild: Patch137: 00137-skip-distutils-tests-that-fail-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 - # 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 @@ -613,7 +607,6 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch111 -p1 %patch132 -p1 %patch137 -p1 -#patch143 -p1 -b .tsc-on-ppc #patch146 -p1 %patch155 -p1 %patch157 -p1 @@ -719,7 +712,7 @@ BuildPython debug \ python-debug \ python%{pybasever}-debug \ %ifarch %{ix86} x86_64 ppc %{power64} - "--with-pydebug --with-tsc --without-ensurepip" \ + "--with-pydebug --without-ensurepip" \ %else "--with-pydebug --without-ensurepip" \ %endif From 1b092958f3e255956903b47f3703cdbe3a8b672e Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Wed, 2 Nov 2016 17:16:07 +0100 Subject: [PATCH 289/416] Update to 3.6.0 beta 3 Revert the -x flag workaround for excluded tests as it has been fixed upstream (upstream issue28409) Remove the _sysconfigdata_ files as they are now removed properly (upstream issue28046) Renamed _futures module to _asyncio (upstream issue28428) --- python3.spec | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/python3.spec b/python3.spec index ad3399b..459ab56 100644 --- a/python3.spec +++ b/python3.spec @@ -14,8 +14,8 @@ # 4) python3-setuptools and python3-pip with with_rewheel set to 1 # 5) python3 with with_rewheel set to 1 -# Second beta prerelease -%global prerel b2 +# Third beta prerelease +%global prerel b3 %global with_rewheel 1 @@ -116,7 +116,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 0.2.%{?prerel}%{?dist} +Release: 0.3.%{?prerel}%{?dist} License: Python Group: Development/Languages @@ -184,7 +184,7 @@ BuildRequires: python3-pip # Source code and patches # ======================= -Source: https://www.python.org/ftp/python/3.6.0/Python-3.6.0b2.tar.xz +Source: https://www.python.org/ftp/python/%{version}/Python-%{version}%{prerel}.tar.xz # Supply an RPM macro "py_byte_compile" for the python3-devel subpackage # to enable specfiles to selectively byte-compile individual files and paths @@ -1060,13 +1060,13 @@ CheckPython() { --verbose --findleaks \ -x test_distutils \ %ifarch ppc64le aarch64 - test_faulthandler \ + -x test_faulthandler \ %endif %ifarch %{mips64} - test_ctypes \ + -x test_ctypes \ %endif %ifarch %{power64} s390 s390x armv7hl aarch64 %{mips} - test_gdb + -x test_gdb %endif echo FINISHED: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName @@ -1199,10 +1199,7 @@ rm -fr %{buildroot} %{dynload_dir}/_sha3.%{SOABI_optimized}.so %{dynload_dir}/_sha512.%{SOABI_optimized}.so -%{dynload_dir}/_sysconfigdata_%{ABIFLAGS_optimized}_linux_%{_arch}-linux%{_gnu}.py -%dir %{dynload_dir}/__pycache__/ -%{dynload_dir}/__pycache__/_sysconfigdata_%{ABIFLAGS_optimized}_linux_%{_arch}-linux%{_gnu}%{bytecode_suffixes} - +%{dynload_dir}/_asyncio.%{SOABI_optimized}.so %{dynload_dir}/_bisect.%{SOABI_optimized}.so %{dynload_dir}/_bz2.%{SOABI_optimized}.so %{dynload_dir}/_codecs_cn.%{SOABI_optimized}.so @@ -1219,7 +1216,6 @@ rm -fr %{buildroot} %{dynload_dir}/_dbm.%{SOABI_optimized}.so %{dynload_dir}/_decimal.%{SOABI_optimized}.so %{dynload_dir}/_elementtree.%{SOABI_optimized}.so -%{dynload_dir}/_futures.%{SOABI_optimized}.so %if %{with_gdbm} %{dynload_dir}/_gdbm.%{SOABI_optimized}.so %endif @@ -1434,9 +1430,7 @@ rm -fr %{buildroot} %{dynload_dir}/_sha3.%{SOABI_debug}.so %{dynload_dir}/_sha512.%{SOABI_debug}.so -%{dynload_dir}/_sysconfigdata_%{ABIFLAGS_debug}_linux_%{_arch}-linux%{_gnu}.py -%{dynload_dir}/__pycache__/_sysconfigdata_%{ABIFLAGS_debug}_linux_%{_arch}-linux%{_gnu}%{bytecode_suffixes} - +%{dynload_dir}/_asyncio.%{SOABI_debug}.so %{dynload_dir}/_bisect.%{SOABI_debug}.so %{dynload_dir}/_bz2.%{SOABI_debug}.so %{dynload_dir}/_codecs_cn.%{SOABI_debug}.so @@ -1453,7 +1447,6 @@ rm -fr %{buildroot} %{dynload_dir}/_dbm.%{SOABI_debug}.so %{dynload_dir}/_decimal.%{SOABI_debug}.so %{dynload_dir}/_elementtree.%{SOABI_debug}.so -%{dynload_dir}/_futures.%{SOABI_debug}.so %if %{with_gdbm} %{dynload_dir}/_gdbm.%{SOABI_debug}.so %endif From af1b222b2b840bbfc8679baf99a0a23631320b73 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Fri, 2 Dec 2016 16:12:46 +0100 Subject: [PATCH 290/416] Enable --with-dtrace configure flag (upstream issue21590) Add patch to fix out of tree --with-dtrace build (upstream issue28787) --- 00249-fix-out-of-tree-dtrace-builds.patch | 12 ++++++++++++ python3.spec | 11 +++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 00249-fix-out-of-tree-dtrace-builds.patch diff --git a/00249-fix-out-of-tree-dtrace-builds.patch b/00249-fix-out-of-tree-dtrace-builds.patch new file mode 100644 index 0000000..d5de53c --- /dev/null +++ b/00249-fix-out-of-tree-dtrace-builds.patch @@ -0,0 +1,12 @@ +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 28df0e1..42f811c 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -867,6 +867,7 @@ Python/frozen.o: Python/importlib.h Python/importlib_external.h + # follow our naming conventions. dtrace(1) uses the output filename to generate + # an include guard, so we can't use a pipeline to transform its output. + Include/pydtrace_probes.h: $(srcdir)/Include/pydtrace.d ++ @$(MKDIR_P) Include + $(DTRACE) $(DFLAGS) -o $@ -h -s $< + : sed in-place edit with POSIX-only tools + sed 's/PYTHON_/PyDTrace_/' $@ > $@.tmp diff --git a/python3.spec b/python3.spec index 459ab56..cb177ab 100644 --- a/python3.spec +++ b/python3.spec @@ -155,12 +155,11 @@ BuildRequires: pkgconfig BuildRequires: readline-devel BuildRequires: sqlite-devel -%if 0%{?with_systemtap} BuildRequires: systemtap-sdt-devel +BuildRequires: systemtap-devel # (this introduces a dependency on "python", in that systemtap-sdt-devel's # /usr/bin/dtrace is a python 2 script) %global tapsetdir /usr/share/systemtap/tapset -%endif # with_systemtap BuildRequires: tar BuildRequires: tcl-devel @@ -389,6 +388,12 @@ Patch206: 00206-remove-hf-from-arm-triplet.patch # Fedora needs the default mips64-linux-gnu Patch243: 00243-fix-mips64-triplet.patch +# 00249 # +# Fix builds using the --with-dtrace flag as the rpmbuild +# of python is an out of tree build +# Not yet fixed upstream: http://bugs.python.org/issue28787 +Patch249: 00249-fix-out-of-tree-dtrace-builds.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -625,6 +630,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch205 -p1 %patch206 -p1 %patch243 -p1 +%patch249 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -681,6 +687,7 @@ BuildPython() { --with-system-expat \ --with-system-ffi \ --enable-loadable-sqlite-extensions \ + --with-dtrace \ %if 0%{?with_systemtap} --with-systemtap \ %endif From 3b1225f950d1529801f566642799fc83744c1d08 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Fri, 2 Dec 2016 16:20:56 +0100 Subject: [PATCH 291/416] Update to Python 3.6.0 beta 4 Disable rewheel --- python3.spec | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/python3.spec b/python3.spec index cb177ab..4b0e5f7 100644 --- a/python3.spec +++ b/python3.spec @@ -14,10 +14,10 @@ # 4) python3-setuptools and python3-pip with with_rewheel set to 1 # 5) python3 with with_rewheel set to 1 -# Third beta prerelease -%global prerel b3 +# Fourth beta prerelease +%global prerel b4 -%global with_rewheel 1 +%global with_rewheel 0 %global pybasever 3.6 @@ -116,7 +116,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 0.3.%{?prerel}%{?dist} +Release: 0.4.%{?prerel}%{?dist} License: Python Group: Development/Languages @@ -1549,6 +1549,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Fri Dec 02 2016 Charalampos Stratakis - 3.6.0-0.4.b4 +- Update to Python 3.6.0 beta 4 + * Mon Dec 05 2016 Charalampos Stratakis - 3.5.2-7 - Set to work with pip version 9.0.1 From 97cc10c62ab639ed619ca112dad683d32d697646 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Wed, 7 Dec 2016 13:55:41 +0100 Subject: [PATCH 292/416] Update to Python 3.6.0 release candidate 1 --- python3.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/python3.spec b/python3.spec index 4b0e5f7..def96b6 100644 --- a/python3.spec +++ b/python3.spec @@ -14,8 +14,8 @@ # 4) python3-setuptools and python3-pip with with_rewheel set to 1 # 5) python3 with with_rewheel set to 1 -# Fourth beta prerelease -%global prerel b4 +# First release candidate +%global prerel rc1 %global with_rewheel 0 @@ -116,7 +116,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 0.4.%{?prerel}%{?dist} +Release: 0.5.%{?prerel}%{?dist} License: Python Group: Development/Languages @@ -1549,6 +1549,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Wed Dec 07 2016 Charalampos Stratakis - 3.6.0-0.5.rc1 +- Update to Python 3.6.0 release candidate 1 + * Fri Dec 02 2016 Charalampos Stratakis - 3.6.0-0.4.b4 - Update to Python 3.6.0 beta 4 From f9258e6d7fcf34244dd3e72f93d3ef0f17533355 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Thu, 8 Dec 2016 11:29:35 +0100 Subject: [PATCH 293/416] Added patch for guarding HAVE_LONG_LONG definition in pyport.h as it is also defined by GDB, and by building GDB with python support will make GDB's compilation fail due to redefinition error. (upstream issue28898) --- ...G-definition-to-prevent-redefinition.patch | 25 +++++++++++++++++++ python3.spec | 8 ++++++ 2 files changed, 33 insertions(+) create mode 100644 00250-guard-HAVE_LONG_LONG-definition-to-prevent-redefinition.patch diff --git a/00250-guard-HAVE_LONG_LONG-definition-to-prevent-redefinition.patch b/00250-guard-HAVE_LONG_LONG-definition-to-prevent-redefinition.patch new file mode 100644 index 0000000..9084dd6 --- /dev/null +++ b/00250-guard-HAVE_LONG_LONG-definition-to-prevent-redefinition.patch @@ -0,0 +1,25 @@ + +# HG changeset patch +# User Benjamin Peterson +# Date 1481183668 28800 +# Node ID 4745d801cae2d57e3432313acd0b76b8b4cc9c75 +# Parent 148c46d180b2a1510097a1eae79845b61190c879 +guard HAVE_LONG_LONG definition to prevent redefinition (#28898) + +diff --git a/Include/pyport.h b/Include/pyport.h +--- a/Include/pyport.h ++++ b/Include/pyport.h +@@ -37,9 +37,10 @@ Used in: Py_SAFE_DOWNCAST + * integral synonyms. Only define the ones we actually need. + */ + +-// long long is required now. Define HAVE_LONG_LONG unconditionally for +-// compatibility. ++// long long is required. Ensure HAVE_LONG_LONG is defined for compatibility. ++#ifndef HAVE_LONG_LONG + #define HAVE_LONG_LONG ++#endif + #ifndef PY_LONG_LONG + #define PY_LONG_LONG long long + /* If LLONG_MAX is defined in limits.h, use that. */ + diff --git a/python3.spec b/python3.spec index def96b6..6580d84 100644 --- a/python3.spec +++ b/python3.spec @@ -394,6 +394,13 @@ Patch243: 00243-fix-mips64-triplet.patch # Not yet fixed upstream: http://bugs.python.org/issue28787 Patch249: 00249-fix-out-of-tree-dtrace-builds.patch +# 00250 # +# Guard HAVE_LONG_LONG definition in pyport.h as gdb also sets this +# and by defining it unconditionally in python will make compilation of +# gdb to fail. +# FIXED UPSTREAM: http://bugs.python.org/issue28898 +Patch250: 00250-guard-HAVE_LONG_LONG-definition-to-prevent-redefinition.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -631,6 +638,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch206 -p1 %patch243 -p1 %patch249 -p1 +%patch250 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. From d55596820d3275d1edcd429ed4550a84ba40f5d7 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Fri, 9 Dec 2016 16:23:34 +0100 Subject: [PATCH 294/416] Fix changelog entry's chronological order --- python3.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 6580d84..7901c68 100644 --- a/python3.spec +++ b/python3.spec @@ -1560,7 +1560,7 @@ rm -fr %{buildroot} * Wed Dec 07 2016 Charalampos Stratakis - 3.6.0-0.5.rc1 - Update to Python 3.6.0 release candidate 1 -* Fri Dec 02 2016 Charalampos Stratakis - 3.6.0-0.4.b4 +* Mon Dec 05 2016 Charalampos Stratakis - 3.6.0-0.4.b4 - Update to Python 3.6.0 beta 4 * Mon Dec 05 2016 Charalampos Stratakis - 3.5.2-7 From 7319c29d6062d43f15c6aefab7c7e02d0cd8a99a Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Fri, 9 Dec 2016 20:27:46 +0100 Subject: [PATCH 295/416] Upload sources for 3.6.0rc1 --- sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources b/sources index aeb1966..d215082 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -8906efbacfcdc7c3c9198aeefafd159e Python-3.5.2.tar.xz +f079686c1b76052c96b38642ab341d2e Python-3.6.0rc1.tar.xz From efda0ca6f2ad574867364dc8168b9c73138c867a Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Sat, 10 Dec 2016 15:20:04 +0100 Subject: [PATCH 296/416] Enable rewheel Use https URL --- python3.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/python3.spec b/python3.spec index 7901c68..c0b9389 100644 --- a/python3.spec +++ b/python3.spec @@ -17,7 +17,7 @@ # First release candidate %global prerel rc1 -%global with_rewheel 0 +%global with_rewheel 1 %global pybasever 3.6 @@ -116,7 +116,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 0.5.%{?prerel}%{?dist} +Release: 0.6.%{?prerel}%{?dist} License: Python Group: Development/Languages @@ -421,7 +421,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-root # Additional metadata, and subpackages # ====================================================== -URL: http://www.python.org/ +URL: https://www.python.org/ # See notes in bug 532118: Provides: python(abi) = %{pybasever} @@ -1557,6 +1557,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Fri Dec 09 2016 Charalampos Stratakis - 3.6.0-0.6.rc1 +- Enable rewheel + * Wed Dec 07 2016 Charalampos Stratakis - 3.6.0-0.5.rc1 - Update to Python 3.6.0 release candidate 1 From eefe1394164e2de6fd3d758f4eb1cc3d77d507ed Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Wed, 14 Dec 2016 13:46:15 +0100 Subject: [PATCH 297/416] Fill the missing pieces at the boostraping documentation --- python3.spec | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/python3.spec b/python3.spec index c0b9389..f89a4ee 100644 --- a/python3.spec +++ b/python3.spec @@ -4,15 +4,25 @@ # NOTES ON BOOTSTRAPING PYTHON 3.6: # -# Due to dependency cycle between Python, pip, setuptools and -# wheel caused by the rewheel patch, one has to build in the -# following order: +# Due to dependency cycle between Python, gdb, rpm, pip, setuptools and +# wheel, in order to rebase Python 3, one has to build in the following order: # -# 1) python3 with with_rewheel set to 0 -# 2) python3-setuptools and python3-pip with with_rewheel set to 0 -# 3) python3-wheel -# 4) python3-setuptools and python3-pip with with_rewheel set to 1 -# 5) python3 with with_rewheel set to 1 +# 1) gdb without python support (add %%global _without_python 1 on top of gdb's SPEC file) +# 2) python3 with with_rewheel set to 0 +# 3) gdb with python support (remove %%global _without_python 1 on top of gdb's SPEC file) +# 4) rpm +# 5) python-setuptools with bootstrap set to 1 +# 6) python-pip with build_wheel set to 0 +# 7) python-wheel with %%bcond_without bootstrap +# 8) python-setuptools with bootstrap set to 0 and also with_check set to 0 +# 9) python-pip with build_wheel set to 1 +# 10) pyparsing +# 11) python3 with with_rewheel set to 1 +# +# Then the most important packages have to be built, starting from their various leaf dependencies +# recursively. After these have been built, a targeted rebuild should be requested for the rest. +# Currently these packages are recommended to have been built before a targeted rebuild after a python abi change: +# python-sphinx, pytest, python-requests, cloud-init, dnf, anaconda, abrt. # First release candidate %global prerel rc1 From e79e900d64a9b503c98a876f6e54e343f39feaa8 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Tue, 27 Dec 2016 21:44:58 +0100 Subject: [PATCH 298/416] Update to Python 3.6.0 final Remove patch 250 as it is now upstream Upload the 3.6.0 final sources --- ...G-definition-to-prevent-redefinition.patch | 25 ------------------- python3.spec | 17 ++++--------- sources | 2 +- 3 files changed, 6 insertions(+), 38 deletions(-) delete mode 100644 00250-guard-HAVE_LONG_LONG-definition-to-prevent-redefinition.patch diff --git a/00250-guard-HAVE_LONG_LONG-definition-to-prevent-redefinition.patch b/00250-guard-HAVE_LONG_LONG-definition-to-prevent-redefinition.patch deleted file mode 100644 index 9084dd6..0000000 --- a/00250-guard-HAVE_LONG_LONG-definition-to-prevent-redefinition.patch +++ /dev/null @@ -1,25 +0,0 @@ - -# HG changeset patch -# User Benjamin Peterson -# Date 1481183668 28800 -# Node ID 4745d801cae2d57e3432313acd0b76b8b4cc9c75 -# Parent 148c46d180b2a1510097a1eae79845b61190c879 -guard HAVE_LONG_LONG definition to prevent redefinition (#28898) - -diff --git a/Include/pyport.h b/Include/pyport.h ---- a/Include/pyport.h -+++ b/Include/pyport.h -@@ -37,9 +37,10 @@ Used in: Py_SAFE_DOWNCAST - * integral synonyms. Only define the ones we actually need. - */ - --// long long is required now. Define HAVE_LONG_LONG unconditionally for --// compatibility. -+// long long is required. Ensure HAVE_LONG_LONG is defined for compatibility. -+#ifndef HAVE_LONG_LONG - #define HAVE_LONG_LONG -+#endif - #ifndef PY_LONG_LONG - #define PY_LONG_LONG long long - /* If LLONG_MAX is defined in limits.h, use that. */ - diff --git a/python3.spec b/python3.spec index f89a4ee..14aaccf 100644 --- a/python3.spec +++ b/python3.spec @@ -24,8 +24,6 @@ # Currently these packages are recommended to have been built before a targeted rebuild after a python abi change: # python-sphinx, pytest, python-requests, cloud-init, dnf, anaconda, abrt. -# First release candidate -%global prerel rc1 %global with_rewheel 1 @@ -126,7 +124,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 0.6.%{?prerel}%{?dist} +Release: 1%{?dist} License: Python Group: Development/Languages @@ -193,7 +191,7 @@ BuildRequires: python3-pip # Source code and patches # ======================= -Source: https://www.python.org/ftp/python/%{version}/Python-%{version}%{prerel}.tar.xz +Source: https://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz # Supply an RPM macro "py_byte_compile" for the python3-devel subpackage # to enable specfiles to selectively byte-compile individual files and paths @@ -404,13 +402,6 @@ Patch243: 00243-fix-mips64-triplet.patch # Not yet fixed upstream: http://bugs.python.org/issue28787 Patch249: 00249-fix-out-of-tree-dtrace-builds.patch -# 00250 # -# Guard HAVE_LONG_LONG definition in pyport.h as gdb also sets this -# and by defining it unconditionally in python will make compilation of -# gdb to fail. -# FIXED UPSTREAM: http://bugs.python.org/issue28898 -Patch250: 00250-guard-HAVE_LONG_LONG-definition-to-prevent-redefinition.patch - # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -648,7 +639,6 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch206 -p1 %patch243 -p1 %patch249 -p1 -%patch250 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1567,6 +1557,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Tue Dec 27 2016 Charalampos Stratakis - 3.6.0-1 +- Update to Python 3.6.0 final + * Fri Dec 09 2016 Charalampos Stratakis - 3.6.0-0.6.rc1 - Enable rewheel diff --git a/sources b/sources index d215082..7b47bed 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -f079686c1b76052c96b38642ab341d2e Python-3.6.0rc1.tar.xz +SHA512 (Python-3.6.0.tar.xz) = 9d06bee9172bc0bfd2d280fd1c27ea712f3258cfbfd2e2aeb734d0a6710998d5deeefc5d6e72251750dd9493d35461511ceaa187a29dea700ca238ff6ac1dbb2 From 6bb1189dedf6516082bfc230bff3eafd8f9e4770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 5 Jan 2017 18:52:42 +0100 Subject: [PATCH 299/416] Don't blow up on EL7 kernel (random generator) (rhbz#1410175) --- 00250-getentropy.patch | 171 +++++++++++++++++++++++++++++++++++++++++ python3.spec | 12 ++- 2 files changed, 182 insertions(+), 1 deletion(-) create mode 100644 00250-getentropy.patch diff --git a/00250-getentropy.patch b/00250-getentropy.patch new file mode 100644 index 0000000..6d0025a --- /dev/null +++ b/00250-getentropy.patch @@ -0,0 +1,171 @@ +diff -r ee1390c9b585 Python/random.c +--- a/Python/random.c Wed Jan 04 12:02:30 2017 +0100 ++++ b/Python/random.c Wed Jan 04 18:32:21 2017 +0100 +@@ -77,45 +77,8 @@ win32_urandom(unsigned char *buffer, Py_ + return 0; + } + +-/* 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) +-#define PY_GETENTROPY 1 +- +-/* Fill buffer with size pseudo-random bytes generated by getentropy(). +- Return 0 on success, or raise an exception and return -1 on error. +- +- If raise is zero, don't raise an exception on error. */ +-static int +-py_getentropy(char *buffer, Py_ssize_t size, int raise) +-{ +- while (size > 0) { +- Py_ssize_t len = Py_MIN(size, 256); +- int res; ++#else /* !MS_WINDOWS */ + +- if (raise) { +- Py_BEGIN_ALLOW_THREADS +- res = getentropy(buffer, len); +- Py_END_ALLOW_THREADS +- } +- else { +- res = getentropy(buffer, len); +- } +- +- if (res < 0) { +- if (raise) { +- PyErr_SetFromErrno(PyExc_OSError); +- } +- return -1; +- } +- +- buffer += len; +- size -= len; +- } +- return 0; +-} +- +-#else + + #if defined(HAVE_GETRANDOM) || defined(HAVE_GETRANDOM_SYSCALL) + #define PY_GETRANDOM 1 +@@ -217,6 +180,59 @@ py_getrandom(void *buffer, Py_ssize_t si + } + return 1; + } ++ ++/* 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) ++#define PY_GETENTROPY 1 ++ ++/* Fill buffer with size pseudo-random bytes generated by getentropy(). ++ Return 1 on success, or raise an exception and return -1 on error. ++ ++ If raise is zero, don't raise an exception on error. */ ++static int ++py_getentropy(char *buffer, Py_ssize_t size, int raise) ++{ ++ /* Is getentropy() supported by the running kernel? Set to 0 if ++ getentropy() failed with ENOSYS. */ ++ static int getentropy_works = 1; ++ ++ if (!getentropy_works) { ++ return 0; ++ } ++ ++ while (size > 0) { ++ Py_ssize_t len = Py_MIN(size, 256); ++ int res; ++ ++ if (raise) { ++ Py_BEGIN_ALLOW_THREADS ++ res = getentropy(buffer, len); ++ Py_END_ALLOW_THREADS ++ } ++ else { ++ res = getentropy(buffer, len); ++ } ++ ++ if (res < 0) { ++ /* ENOSYS: the inner syscall is not supported by the running ++ kernel. */ ++ if (errno == ENOSYS) { ++ getentropy_works = 0; ++ return 0; ++ } ++ ++ if (raise) { ++ PyErr_SetFromErrno(PyExc_OSError); ++ } ++ return -1; ++ } ++ ++ buffer += len; ++ size -= len; ++ } ++ return 1; ++} + #endif + + static struct { +@@ -236,7 +252,7 @@ dev_urandom(char *buffer, Py_ssize_t siz + { + int fd; + Py_ssize_t n; +-#ifdef PY_GETRANDOM ++#if defined(PY_GETRANDOM) || defined(PY_GETENTROPY) + int res; + #endif + +@@ -244,17 +260,20 @@ dev_urandom(char *buffer, Py_ssize_t siz + + #ifdef PY_GETRANDOM + res = py_getrandom(buffer, size, blocking, raise); ++#elif defined(PY_GETENTROPY) ++ res = py_getentropy(buffer, size, raise); ++#endif ++#if defined(PY_GETRANDOM) || defined(PY_GETENTROPY) + if (res < 0) { + return -1; + } + if (res == 1) { + return 0; + } +- /* getrandom() failed with ENOSYS or EPERM, +- fall back on reading /dev/urandom */ ++ /* function failed with ENOSYS or EPERM, fall back on reading ++ from /dev/urandom */ + #endif + +- + if (raise) { + struct _Py_stat_struct st; + +@@ -349,8 +368,8 @@ dev_urandom_close(void) + urandom_cache.fd = -1; + } + } ++#endif /* !MS_WINDOWS */ + +-#endif + + /* Fill buffer with pseudo-random bytes generated by a linear congruent + generator (LCG): +@@ -395,8 +414,6 @@ pyurandom(void *buffer, Py_ssize_t size, + + #ifdef MS_WINDOWS + return win32_urandom((unsigned char *)buffer, size, raise); +-#elif defined(PY_GETENTROPY) +- return py_getentropy(buffer, size, raise); + #else + return dev_urandom(buffer, size, blocking, raise); + #endif +@@ -491,8 +508,6 @@ void + CryptReleaseContext(hCryptProv, 0); + hCryptProv = 0; + } +-#elif defined(PY_GETENTROPY) +- /* nothing to clean */ + #else + dev_urandom_close(); + #endif diff --git a/python3.spec b/python3.spec index 14aaccf..43908f6 100644 --- a/python3.spec +++ b/python3.spec @@ -124,7 +124,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 1%{?dist} +Release: 3%{?dist} License: Python Group: Development/Languages @@ -402,6 +402,12 @@ Patch243: 00243-fix-mips64-triplet.patch # Not yet fixed upstream: http://bugs.python.org/issue28787 Patch249: 00249-fix-out-of-tree-dtrace-builds.patch +# 00250 # +# After glibc-2.24.90, Python 3 failed to start on EL7 kernel +# rhbz#1410175: https://bugzilla.redhat.com/show_bug.cgi?id=1410175 +# http://bugs.python.org/issue29157 +Patch250: 00250-getentropy.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -639,6 +645,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch206 -p1 %patch243 -p1 %patch249 -p1 +%patch250 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1557,6 +1564,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Thu Jan 05 2017 Miro Hrončok - 3.6.0-2 +- Don't blow up on EL7 kernel (random generator) (rhbz#1410175) + * Tue Dec 27 2016 Charalampos Stratakis - 3.6.0-1 - Update to Python 3.6.0 final From 1abbc727d4648834e71ded0a926dfedbbc20147d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 6 Jan 2017 11:08:15 +0100 Subject: [PATCH 300/416] Fix bogus release in %changelog --- python3.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 43908f6..da35c9a 100644 --- a/python3.spec +++ b/python3.spec @@ -1564,7 +1564,7 @@ rm -fr %{buildroot} # ====================================================== %changelog -* Thu Jan 05 2017 Miro Hrončok - 3.6.0-2 +* Thu Jan 05 2017 Miro Hrončok - 3.6.0-3 - Don't blow up on EL7 kernel (random generator) (rhbz#1410175) * Tue Dec 27 2016 Charalampos Stratakis - 3.6.0-1 From 0da740b7bce4b8deddccb997c9ad7048af82e18d Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Mon, 9 Jan 2017 13:18:07 +0100 Subject: [PATCH 301/416] Define HAVE_LONG_LONG as 1 for backwards compatibility. --- 00253-fix-HAVE_LONG_LONG-compatibility.patch | 24 ++++++++++++++++++++ python3.spec | 11 ++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 00253-fix-HAVE_LONG_LONG-compatibility.patch diff --git a/00253-fix-HAVE_LONG_LONG-compatibility.patch b/00253-fix-HAVE_LONG_LONG-compatibility.patch new file mode 100644 index 0000000..7951e63 --- /dev/null +++ b/00253-fix-HAVE_LONG_LONG-compatibility.patch @@ -0,0 +1,24 @@ + +# HG changeset patch +# User Victor Stinner +# Date 1483653533 -3600 +# Node ID fad67c66885f0bd9ebafe2a54f0fa12b5a8fe3bf +# Parent 52d671684342cd2dcc804566d4c755634d3210a8 +Issue #27961: Define HAVE_LONG_LONG as 1. + +Fix backward compatibility issue, HAVE_LONG_LONG was defined but empty, whereas +it is defined as 1 in Python 3.5. + +diff --git a/Include/pyport.h b/Include/pyport.h +--- a/Include/pyport.h ++++ b/Include/pyport.h +@@ -39,7 +39,7 @@ Used in: Py_SAFE_DOWNCAST + + // long long is required. Ensure HAVE_LONG_LONG is defined for compatibility. + #ifndef HAVE_LONG_LONG +-#define HAVE_LONG_LONG ++#define HAVE_LONG_LONG 1 + #endif + #ifndef PY_LONG_LONG + #define PY_LONG_LONG long long + diff --git a/python3.spec b/python3.spec index da35c9a..dbe32aa 100644 --- a/python3.spec +++ b/python3.spec @@ -124,7 +124,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 3%{?dist} +Release: 4%{?dist} License: Python Group: Development/Languages @@ -408,6 +408,11 @@ Patch249: 00249-fix-out-of-tree-dtrace-builds.patch # http://bugs.python.org/issue29157 Patch250: 00250-getentropy.patch +# 00253 # +# Define HAVE_LONG_LONG as 1 instead of blank for backwards compatibility +# Fixed upstream: https://hg.python.org/cpython/rev/fad67c66885f +Patch253: fix-HAVE_LONG_LONG-compatibility.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -646,6 +651,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch243 -p1 %patch249 -p1 %patch250 -p1 +%patch253 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1564,6 +1570,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon Jan 09 2017 Charalampos Stratakis - 3.6.0-4 +- Define HAVE_LONG_LONG as 1 for backwards compatibility + * Thu Jan 05 2017 Miro Hrončok - 3.6.0-3 - Don't blow up on EL7 kernel (random generator) (rhbz#1410175) From f75890a6e8c377e371190b117044b1f53d016044 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Mon, 9 Jan 2017 13:25:30 +0100 Subject: [PATCH 302/416] Fix wrong patch name --- python3.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index dbe32aa..d60791b 100644 --- a/python3.spec +++ b/python3.spec @@ -411,7 +411,7 @@ Patch250: 00250-getentropy.patch # 00253 # # Define HAVE_LONG_LONG as 1 instead of blank for backwards compatibility # Fixed upstream: https://hg.python.org/cpython/rev/fad67c66885f -Patch253: fix-HAVE_LONG_LONG-compatibility.patch +Patch253: 00253-fix-HAVE_LONG_LONG-compatibility.patch # (New patches go here ^^^) # From a5e3562540887f4b53367cd36388cc7b13d1b6c0 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Tue, 10 Jan 2017 17:01:29 +0100 Subject: [PATCH 303/416] Require glibc >= 2.24.90-26 for system-python-libs (rhbz#1410644) --- python3.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index d60791b..86d6fb1 100644 --- a/python3.spec +++ b/python3.spec @@ -124,7 +124,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 4%{?dist} +Release: 5%{?dist} License: Python Group: Development/Languages @@ -493,6 +493,8 @@ Group: Development/Libraries %define __requires_exclude ^(/usr/bin/python3.*|python\\(abi\\) = 3\\..*)$ Requires: expat >= 2.1.0 +# Python 3 built with glibc >= 2.24.90-26 needs to require it (rhbz#1410644). +Requires: glibc >= 2.24.90-26 %description -n system-python-libs This package contains files used to embed System Python into applications. @@ -1570,6 +1572,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Tue Jan 10 2017 Charalampos Stratakis - 3.6.0-5 +- Require glibc >= 2.24.90-26 for system-python-libs (rhbz#1410644) + * Mon Jan 09 2017 Charalampos Stratakis - 3.6.0-4 - Define HAVE_LONG_LONG as 1 for backwards compatibility From 69d3bbb6fe9cd56fa83ee852f88e63b6a7e4a412 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Tue, 10 Jan 2017 22:12:21 +0100 Subject: [PATCH 304/416] Always include the rewheel patch at the SRPM --- python3.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/python3.spec b/python3.spec index 86d6fb1..4ee6eb3 100644 --- a/python3.spec +++ b/python3.spec @@ -375,9 +375,7 @@ Patch188: 00188-fix-lib2to3-tests-when-hashlib-doesnt-compile-properly.patch # Add the rewheel module, allowing to recreate wheels from already installed # ones # https://github.com/bkabrda/rewheel -%if 0%{with_rewheel} Patch189: 00189-add-rewheel-module.patch -%endif # 00205 # # LIBPL variable in makefile takes LIBPL from configure.ac From ae0e9fd8d2f14a1ac50cc0147068f8368cb8becf Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Thu, 12 Jan 2017 11:15:34 +0100 Subject: [PATCH 305/416] Require arch specific glibc --- python3.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 4ee6eb3..ae9ea34 100644 --- a/python3.spec +++ b/python3.spec @@ -492,7 +492,7 @@ Group: Development/Libraries Requires: expat >= 2.1.0 # Python 3 built with glibc >= 2.24.90-26 needs to require it (rhbz#1410644). -Requires: glibc >= 2.24.90-26 +Requires: glibc%{?_isa} >= 2.24.90-26 %description -n system-python-libs This package contains files used to embed System Python into applications. From 2294d6496ca6638a84ae5b107a729e359c9d5f87 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Thu, 12 Jan 2017 17:30:38 +0100 Subject: [PATCH 306/416] Rebuild for readline 7.x Signed-off-by: Igor Gnatenko --- python3.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index ae9ea34..41f5508 100644 --- a/python3.spec +++ b/python3.spec @@ -124,7 +124,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 5%{?dist} +Release: 6%{?dist} License: Python Group: Development/Languages @@ -1570,6 +1570,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Thu Jan 12 2017 Igor Gnatenko - 3.6.0-6 +- Rebuild for readline 7.x + * Tue Jan 10 2017 Charalampos Stratakis - 3.6.0-5 - Require glibc >= 2.24.90-26 for system-python-libs (rhbz#1410644) From 79728f702eb9456be4f46e8c3db34ef59ca1b731 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Mon, 16 Jan 2017 14:28:13 +0100 Subject: [PATCH 307/416] Fix error check, so that Random.seed actually uses OS randomness (rhbz#1412275) --- ...ake-Random.seed-actually-use-OS-randomness.patch | 13 +++++++++++++ python3.spec | 12 +++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 00254-make-Random.seed-actually-use-OS-randomness.patch diff --git a/00254-make-Random.seed-actually-use-OS-randomness.patch b/00254-make-Random.seed-actually-use-OS-randomness.patch new file mode 100644 index 0000000..e5ecb38 --- /dev/null +++ b/00254-make-Random.seed-actually-use-OS-randomness.patch @@ -0,0 +1,13 @@ +diff --git a/Modules/_randommodule.c b/Modules/_randommodule.c +index 63759d5..0d3282d 100644 +--- a/Modules/_randommodule.c ++++ b/Modules/_randommodule.c +@@ -245,7 +245,7 @@ random_seed(RandomObject *self, PyObject *args) + return NULL; + + if (arg == NULL || arg == Py_None) { +- if (random_seed_urandom(self) >= 0) { ++ if (random_seed_urandom(self) < 0) { + PyErr_Clear(); + + /* Reading system entropy failed, fall back on the worst entropy: diff --git a/python3.spec b/python3.spec index 41f5508..99242fe 100644 --- a/python3.spec +++ b/python3.spec @@ -124,7 +124,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 6%{?dist} +Release: 7%{?dist} License: Python Group: Development/Languages @@ -411,6 +411,12 @@ Patch250: 00250-getentropy.patch # Fixed upstream: https://hg.python.org/cpython/rev/fad67c66885f Patch253: 00253-fix-HAVE_LONG_LONG-compatibility.patch +# 00254 # +# Fix error check, so that Random.seed actually uses OS randomness +# rhbz#1412275: https://bugzilla.redhat.com/show_bug.cgi?id=1412275 +# Fixed upstream: https://bugs.python.org/issue29085 +Patch254: 00254-make-Random.seed-actually-use-OS-randomness.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -652,6 +658,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch249 -p1 %patch250 -p1 %patch253 -p1 +%patch254 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1570,6 +1577,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon Jan 16 2017 Charalampos Stratakis - 3.6.0-7 +- Fix error check, so that Random.seed actually uses OS randomness (rhbz#1412275) + * Thu Jan 12 2017 Igor Gnatenko - 3.6.0-6 - Rebuild for readline 7.x From ae3f901913a5810beb1e3039474202ddc19136ae Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Thu, 19 Jan 2017 20:56:23 +0100 Subject: [PATCH 308/416] Skip test_aead_aes_gcm during rpmbuild --- 00258-fix-test_aead_aes_gcm.patch | 12 ++++++++++++ python3.spec | 8 ++++++++ 2 files changed, 20 insertions(+) create mode 100644 00258-fix-test_aead_aes_gcm.patch diff --git a/00258-fix-test_aead_aes_gcm.patch b/00258-fix-test_aead_aes_gcm.patch new file mode 100644 index 0000000..1d061fd --- /dev/null +++ b/00258-fix-test_aead_aes_gcm.patch @@ -0,0 +1,12 @@ +diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py +index 8992a01..74170f4 100644 +--- a/Lib/test/test_socket.py ++++ b/Lib/test/test_socket.py +@@ -5458,6 +5458,7 @@ class LinuxKernelCryptoAPI(unittest.TestCase): + self.assertEqual(dec, msg * multiplier) + + @support.requires_linux_version(4, 3) # see test_aes_cbc ++ @unittest.skip('Failure on Kernel 4.9+') + def test_aead_aes_gcm(self): + key = bytes.fromhex('c939cc13397c1d37de6ae0e1cb7c423c') + iv = bytes.fromhex('b3d8cc017cbb89b39e0f67e2') diff --git a/python3.spec b/python3.spec index 99242fe..c86f199 100644 --- a/python3.spec +++ b/python3.spec @@ -417,6 +417,12 @@ Patch253: 00253-fix-HAVE_LONG_LONG-compatibility.patch # Fixed upstream: https://bugs.python.org/issue29085 Patch254: 00254-make-Random.seed-actually-use-OS-randomness.patch +# 00258 # +# Kernel 4.9 introduced some changes to its crypto API +# making test_aead_aes_gcm fail, so skipping the test for now +# Reported upstream: http://bugs.python.org/issue29324 +Patch258: 00258-fix-test_aead_aes_gcm.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -659,6 +665,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch250 -p1 %patch253 -p1 %patch254 -p1 +%patch258 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1579,6 +1586,7 @@ rm -fr %{buildroot} %changelog * Mon Jan 16 2017 Charalampos Stratakis - 3.6.0-7 - Fix error check, so that Random.seed actually uses OS randomness (rhbz#1412275) +- Skip test_aead_aes_gcm during rpmbuild * Thu Jan 12 2017 Igor Gnatenko - 3.6.0-6 - Rebuild for readline 7.x From 738f034638325adbf8fc8165aaa498fc9fb71cc9 Mon Sep 17 00:00:00 2001 From: Tomas Orsava Date: Wed, 25 Jan 2017 14:15:32 +0100 Subject: [PATCH 309/416] Modify the runtime dependency of python3-libs on system-python-libs to use just the version and release number, but not the dist tag due to Modularity --- python3.spec | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/python3.spec b/python3.spec index c86f199..a701991 100644 --- a/python3.spec +++ b/python3.spec @@ -124,10 +124,15 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 7%{?dist} +Release: 8%{?dist} License: Python Group: Development/Languages +# Get just the release number out of the Release tag (omit the dist tag) +# This is used for python3-libs subpackage to be able to Require +# system-python-libs subpackage without using the dist tag, as it clashes +# with Modularity use cases. +%global relnum %(echo %{release} | sed 's/%{?dist}$//') # ======================= # Build-time requirements @@ -472,7 +477,7 @@ considerably, and a lot of deprecated features have finally been removed. %package libs Summary: Python 3 runtime libraries Group: Development/Libraries -Requires: system-python-libs%{?_isa} = %{version}-%{release} +Requires: system-python-libs%{?_isa} = %{version}-%{relnum} # 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 @@ -1584,6 +1589,10 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Wed Jan 25 2017 Tomas Orsava - 3.6.0-8 +- Modify the runtime dependency of python3-libs on system-python-libs to use + just the version and release number, but not the dist tag due to Modularity + * Mon Jan 16 2017 Charalampos Stratakis - 3.6.0-7 - Fix error check, so that Random.seed actually uses OS randomness (rhbz#1412275) - Skip test_aead_aes_gcm during rpmbuild From adf44e02850d40a961db9f653d0e0966a5cb72bb Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 25 Jan 2017 21:12:31 +0100 Subject: [PATCH 310/416] Revert "Modify the runtime dependency of python3-libs on system-python-libs" This broke everything, rpm/dnf/libsolv/etc. doesn't know what is *partial* dependency. Either you specify full release, or you don't specify it at all. This reverts commit 738f034638325adbf8fc8165aaa498fc9fb71cc9. Signed-off-by: Igor Gnatenko --- python3.spec | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/python3.spec b/python3.spec index a701991..c86f199 100644 --- a/python3.spec +++ b/python3.spec @@ -124,15 +124,10 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 8%{?dist} +Release: 7%{?dist} License: Python Group: Development/Languages -# Get just the release number out of the Release tag (omit the dist tag) -# This is used for python3-libs subpackage to be able to Require -# system-python-libs subpackage without using the dist tag, as it clashes -# with Modularity use cases. -%global relnum %(echo %{release} | sed 's/%{?dist}$//') # ======================= # Build-time requirements @@ -477,7 +472,7 @@ considerably, and a lot of deprecated features have finally been removed. %package libs Summary: Python 3 runtime libraries Group: Development/Libraries -Requires: system-python-libs%{?_isa} = %{version}-%{relnum} +Requires: system-python-libs%{?_isa} = %{version}-%{release} # 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 @@ -1589,10 +1584,6 @@ rm -fr %{buildroot} # ====================================================== %changelog -* Wed Jan 25 2017 Tomas Orsava - 3.6.0-8 -- Modify the runtime dependency of python3-libs on system-python-libs to use - just the version and release number, but not the dist tag due to Modularity - * Mon Jan 16 2017 Charalampos Stratakis - 3.6.0-7 - Fix error check, so that Random.seed actually uses OS randomness (rhbz#1412275) - Skip test_aead_aes_gcm during rpmbuild From d80b542352bf3094ee6e97a773e3981a1c6d5ad7 Mon Sep 17 00:00:00 2001 From: Tomas Orsava Date: Thu, 26 Jan 2017 14:06:38 +0100 Subject: [PATCH 311/416] Modify differently the runtime dependency of python3-libs on system-python-libs because previous attempt didn't work properly with dnf resolving mechanism --- python3.spec | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index c86f199..91af13e 100644 --- a/python3.spec +++ b/python3.spec @@ -124,7 +124,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 7%{?dist} +Release: 9%{?dist} License: Python Group: Development/Languages @@ -472,7 +472,12 @@ considerably, and a lot of deprecated features have finally been removed. %package libs Summary: Python 3 runtime libraries Group: Development/Libraries +# For Modularity purpose we need not to include the dist-tag int he dependency +%if %(d="%{?dist}"; [ "${d#module-base-runtime-}x" != "${d}x" ] && echo 1 || echo 0) +Requires: system-python-libs%{?_isa} = %{version} +%else Requires: system-python-libs%{?_isa} = %{version}-%{release} +%endif # 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 @@ -1584,6 +1589,14 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Thu Jan 26 2017 Tomas Orsava - 3.6.0-9 +- Modify the runtime dependency of python3-libs on system-python-libs again, + because previous attempt didn't work properly with dnf resolving mechanism + +* Wed Jan 25 2017 Tomas Orsava - 3.6.0-8 +- Modify the runtime dependency of python3-libs on system-python-libs to use + just the version and release number, but not the dist tag due to Modularity + * Mon Jan 16 2017 Charalampos Stratakis - 3.6.0-7 - Fix error check, so that Random.seed actually uses OS randomness (rhbz#1412275) - Skip test_aead_aes_gcm during rpmbuild From ea14453e6c16eb374a2d52006c1ec90366897fe6 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Wed, 1 Feb 2017 20:52:15 -0500 Subject: [PATCH 312/416] Add missing %license macro --- python3.spec | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/python3.spec b/python3.spec index 91af13e..0f704b3 100644 --- a/python3.spec +++ b/python3.spec @@ -124,7 +124,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 9%{?dist} +Release: 10%{?dist} License: Python Group: Development/Languages @@ -1155,7 +1155,8 @@ rm -fr %{buildroot} %files %defattr(-, root, root) -%doc LICENSE README +%license LICENSE +%doc README %{_bindir}/pydoc* %{_bindir}/python3 %{_bindir}/python%{pybasever} @@ -1166,7 +1167,8 @@ rm -fr %{buildroot} %files libs %defattr(-,root,root,-) -%doc LICENSE README +%license LICENSE +%doc README %{pylibdir}/lib2to3 %exclude %{pylibdir}/lib2to3/tests @@ -1230,12 +1232,14 @@ rm -fr %{buildroot} %files -n system-python %defattr(-,root,root,-) -%doc LICENSE README +%license LICENSE +%doc README %{_libexecdir}/system-python %files -n system-python-libs %defattr(-,root,root,-) -%doc LICENSE README +%license LICENSE +%doc README %dir %{pylibdir} %dir %{dynload_dir} @@ -1589,6 +1593,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Wed Feb 01 2017 Stephen Gallagher - 3.6.0-10 +- Add missing %%license macro + * Thu Jan 26 2017 Tomas Orsava - 3.6.0-9 - Modify the runtime dependency of python3-libs on system-python-libs again, because previous attempt didn't work properly with dnf resolving mechanism From 45bc6145e3e4ae715144e83c383c99a7b530dd4b Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 11 Feb 2017 11:04:03 +0000 Subject: [PATCH 313/416] - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild --- python3.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 0f704b3..bcfd9f8 100644 --- a/python3.spec +++ b/python3.spec @@ -124,7 +124,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 10%{?dist} +Release: 11%{?dist} License: Python Group: Development/Languages @@ -1593,6 +1593,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Sat Feb 11 2017 Fedora Release Engineering - 3.6.0-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + * Wed Feb 01 2017 Stephen Gallagher - 3.6.0-10 - Add missing %%license macro From 7973de8b00d4be10a162ddba58157e7a3669b043 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Fri, 17 Feb 2017 10:26:59 +0100 Subject: [PATCH 314/416] BuildRequire the new dependencies of python-setuptools when rewheel mode is enabled and add a patch to adjust the upstream test suite to account for these dependencies, since without them, the virtualenv's would not install anything in their site-packages directory thus making pip unusable inside virtualenv's. --- 00260-require-setuptools-dependencies.patch | 183 ++++++++++++++++++++ python3.spec | 20 ++- 2 files changed, 202 insertions(+), 1 deletion(-) create mode 100644 00260-require-setuptools-dependencies.patch diff --git a/00260-require-setuptools-dependencies.patch b/00260-require-setuptools-dependencies.patch new file mode 100644 index 0000000..2e3ac20 --- /dev/null +++ b/00260-require-setuptools-dependencies.patch @@ -0,0 +1,183 @@ +diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py +index 9f5d151..4dfa8a1 100644 +--- a/Lib/ensurepip/__init__.py ++++ b/Lib/ensurepip/__init__.py +@@ -8,13 +8,25 @@ import tempfile + __all__ = ["version", "bootstrap"] + + +-_SETUPTOOLS_VERSION = "28.8.0" ++_SETUPTOOLS_VERSION = "34.2.0" + + _PIP_VERSION = "9.0.1" + ++_SIX_VERSION = "1.10.0" ++ ++_APPDIRS_VERSION = "1.4.0" ++ ++_PACKAGING_VERSION = "16.8" ++ ++_PYPARSING_VERSION = "2.1.10" ++ + _PROJECTS = [ +- ("setuptools", _SETUPTOOLS_VERSION), +- ("pip", _PIP_VERSION), ++ ("setuptools", _SETUPTOOLS_VERSION), ++ ("pip", _PIP_VERSION), ++ ("six", _SIX_VERSION), ++ ("appdirs", _APPDIRS_VERSION), ++ ("packaging", _PACKAGING_VERSION), ++ ("pyparsing", _PYPARSING_VERSION) + ] + + +diff --git a/Lib/test/test_ensurepip.py b/Lib/test/test_ensurepip.py +index 9b04c18..23664c4 100644 +--- a/Lib/test/test_ensurepip.py ++++ b/Lib/test/test_ensurepip.py +@@ -40,13 +40,14 @@ class TestBootstrap(EnsurepipMixin, unittest.TestCase): + self.run_pip.assert_called_once_with( + [ + "install", "--no-index", "--find-links", +- unittest.mock.ANY, "setuptools", "pip", ++ unittest.mock.ANY, ++ "setuptools", "pip", "six", "appdirs", "packaging", "pyparsing", + ], + unittest.mock.ANY, + ) + + additional_paths = self.run_pip.call_args[0][1] +- self.assertEqual(len(additional_paths), 2) ++ self.assertEqual(len(additional_paths), 6) + + def test_bootstrapping_with_root(self): + ensurepip.bootstrap(root="/foo/bar/") +@@ -55,7 +56,7 @@ class TestBootstrap(EnsurepipMixin, unittest.TestCase): + [ + "install", "--no-index", "--find-links", + unittest.mock.ANY, "--root", "/foo/bar/", +- "setuptools", "pip", ++ "setuptools", "pip", "six", "appdirs", "packaging", "pyparsing", + ], + unittest.mock.ANY, + ) +@@ -66,7 +67,8 @@ class TestBootstrap(EnsurepipMixin, unittest.TestCase): + self.run_pip.assert_called_once_with( + [ + "install", "--no-index", "--find-links", +- unittest.mock.ANY, "--user", "setuptools", "pip", ++ unittest.mock.ANY, "--user", ++ "setuptools", "pip", "six", "appdirs", "packaging", "pyparsing", + ], + unittest.mock.ANY, + ) +@@ -77,7 +79,8 @@ class TestBootstrap(EnsurepipMixin, unittest.TestCase): + self.run_pip.assert_called_once_with( + [ + "install", "--no-index", "--find-links", +- unittest.mock.ANY, "--upgrade", "setuptools", "pip", ++ unittest.mock.ANY, "--upgrade", ++ "setuptools", "pip", "six", "appdirs", "packaging", "pyparsing", + ], + unittest.mock.ANY, + ) +@@ -88,7 +91,8 @@ class TestBootstrap(EnsurepipMixin, unittest.TestCase): + self.run_pip.assert_called_once_with( + [ + "install", "--no-index", "--find-links", +- unittest.mock.ANY, "-v", "setuptools", "pip", ++ unittest.mock.ANY, "-v", ++ "setuptools", "pip", "six", "appdirs", "packaging", "pyparsing", + ], + unittest.mock.ANY, + ) +@@ -99,7 +103,8 @@ class TestBootstrap(EnsurepipMixin, unittest.TestCase): + self.run_pip.assert_called_once_with( + [ + "install", "--no-index", "--find-links", +- unittest.mock.ANY, "-vv", "setuptools", "pip", ++ unittest.mock.ANY, "-vv", ++ "setuptools", "pip", "six", "appdirs", "packaging", "pyparsing", + ], + unittest.mock.ANY, + ) +@@ -110,7 +115,8 @@ class TestBootstrap(EnsurepipMixin, unittest.TestCase): + self.run_pip.assert_called_once_with( + [ + "install", "--no-index", "--find-links", +- unittest.mock.ANY, "-vvv", "setuptools", "pip", ++ unittest.mock.ANY, "-vvv", ++ "setuptools", "pip", "six", "appdirs", "packaging", "pyparsing", + ], + unittest.mock.ANY, + ) +@@ -186,8 +192,8 @@ class TestUninstall(EnsurepipMixin, unittest.TestCase): + + self.run_pip.assert_called_once_with( + [ +- "uninstall", "-y", "--disable-pip-version-check", "pip", +- "setuptools", ++ "uninstall", "-y", "--disable-pip-version-check", ++ "pyparsing", "packaging", "appdirs", "six", "pip", "setuptools", + ] + ) + +@@ -197,8 +203,8 @@ class TestUninstall(EnsurepipMixin, unittest.TestCase): + + self.run_pip.assert_called_once_with( + [ +- "uninstall", "-y", "--disable-pip-version-check", "-v", "pip", +- "setuptools", ++ "uninstall", "-y", "--disable-pip-version-check", "-v", ++ "pyparsing", "packaging", "appdirs", "six", "pip", "setuptools", + ] + ) + +@@ -208,8 +214,8 @@ class TestUninstall(EnsurepipMixin, unittest.TestCase): + + self.run_pip.assert_called_once_with( + [ +- "uninstall", "-y", "--disable-pip-version-check", "-vv", "pip", +- "setuptools", ++ "uninstall", "-y", "--disable-pip-version-check", "-vv", ++ "pyparsing", "packaging", "appdirs", "six", "pip", "setuptools", + ] + ) + +@@ -220,7 +226,7 @@ class TestUninstall(EnsurepipMixin, unittest.TestCase): + self.run_pip.assert_called_once_with( + [ + "uninstall", "-y", "--disable-pip-version-check", "-vvv", +- "pip", "setuptools", ++ "pyparsing", "packaging", "appdirs", "six", "pip", "setuptools", + ] + ) + +@@ -260,13 +266,14 @@ class TestBootstrappingMainFunction(EnsurepipMixin, unittest.TestCase): + self.run_pip.assert_called_once_with( + [ + "install", "--no-index", "--find-links", +- unittest.mock.ANY, "setuptools", "pip", ++ unittest.mock.ANY, ++ "setuptools", "pip", "six", "appdirs", "packaging", "pyparsing", + ], + unittest.mock.ANY, + ) + + additional_paths = self.run_pip.call_args[0][1] +- self.assertEqual(len(additional_paths), 2) ++ self.assertEqual(len(additional_paths), 6) + + class TestUninstallationMainFunction(EnsurepipMixin, unittest.TestCase): + +@@ -284,8 +291,8 @@ class TestUninstallationMainFunction(EnsurepipMixin, unittest.TestCase): + + self.run_pip.assert_called_once_with( + [ +- "uninstall", "-y", "--disable-pip-version-check", "pip", +- "setuptools", ++ "uninstall", "-y", "--disable-pip-version-check", "pyparsing", "packaging", ++ "appdirs", "six", "pip", "setuptools", + ] + ) + diff --git a/python3.spec b/python3.spec index bcfd9f8..29904b1 100644 --- a/python3.spec +++ b/python3.spec @@ -124,7 +124,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 11%{?dist} +Release: 12%{?dist} License: Python Group: Development/Languages @@ -183,6 +183,10 @@ BuildRequires: zlib-devel %if 0%{?with_rewheel} BuildRequires: python3-setuptools +BuildRequires: python3-six +BuildRequires: python3-pyparsing +BuildRequires: python3-appdirs +BuildRequires: python3-packaging BuildRequires: python3-pip %endif @@ -423,6 +427,15 @@ Patch254: 00254-make-Random.seed-actually-use-OS-randomness.patch # Reported upstream: http://bugs.python.org/issue29324 Patch258: 00258-fix-test_aead_aes_gcm.patch +# 00260 # +# setuptools from version 34.0.0 and onwards, unbundled its dependencies +# and started requiring them so when rewheel mode is enabled we will have +# to BuildRequire the new dependencies, in order for the virtualenv's to work properly +# setuptools change: https://setuptools.readthedocs.io/en/latest/history.html#v34-0-0 +# Reported upstream: http://bugs.python.org/issue29523 +# https://github.com/python/cpython/pull/67 +Patch260: 00260-require-setuptools-dependencies.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -671,6 +684,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch253 -p1 %patch254 -p1 %patch258 -p1 +%patch260 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1593,6 +1607,10 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Wed Feb 15 2017 Charalampos Stratakis - 3.6.0-12 +- BuildRequire the new dependencies of setuptools when rewheel mode is enabled +in order for the virtualenvs to work properly + * Sat Feb 11 2017 Fedora Release Engineering - 3.6.0-11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild From ef5c6fe479f00fb1dd84307ecb0f3e3aaef955a2 Mon Sep 17 00:00:00 2001 From: Michal Cyprian Date: Tue, 21 Feb 2017 10:38:18 +0100 Subject: [PATCH 315/416] Add --executable option to install.py command --- 00252-add-executable-option.patch | 45 +++++++++++++++++++++++++++++++ python3.spec | 11 +++++++- 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 00252-add-executable-option.patch 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/python3.spec b/python3.spec index 29904b1..da8010c 100644 --- a/python3.spec +++ b/python3.spec @@ -124,7 +124,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 12%{?dist} +Release: 13%{?dist} License: Python Group: Development/Languages @@ -410,6 +410,11 @@ Patch249: 00249-fix-out-of-tree-dtrace-builds.patch # http://bugs.python.org/issue29157 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 + # 00253 # # Define HAVE_LONG_LONG as 1 instead of blank for backwards compatibility # Fixed upstream: https://hg.python.org/cpython/rev/fad67c66885f @@ -681,6 +686,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch243 -p1 %patch249 -p1 %patch250 -p1 +%patch252 -p1 %patch253 -p1 %patch254 -p1 %patch258 -p1 @@ -1607,6 +1613,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Fri Feb 17 2017 Michal Cyprian - 3.6.0-13 +- Add --executable option to install.py command + * Wed Feb 15 2017 Charalampos Stratakis - 3.6.0-12 - BuildRequire the new dependencies of setuptools when rewheel mode is enabled in order for the virtualenvs to work properly From 24515db173c9d3d65e1e24fc29fb9be88227bf52 Mon Sep 17 00:00:00 2001 From: Michal Cyprian Date: Tue, 21 Feb 2017 11:17:54 +0100 Subject: [PATCH 316/416] Set values of prefix and exec_prefix to /usr/local for /usr/bin/python* executables to make pip and distutils install to the separate location - Use new %%_module_build macro --- 00251-set-python3-prefixes.patch | 36 ++++++++++++++++++++++++++++++++ python3.spec | 21 +++++++++++++++++-- 2 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 00251-set-python3-prefixes.patch diff --git a/00251-set-python3-prefixes.patch b/00251-set-python3-prefixes.patch new file mode 100644 index 0000000..c3043bf --- /dev/null +++ b/00251-set-python3-prefixes.patch @@ -0,0 +1,36 @@ +diff --git a/Lib/site.py b/Lib/site.py +index ad1033e..f2fb028 100644 +--- a/Lib/site.py ++++ b/Lib/site.py +@@ -537,6 +537,23 @@ def execusercustomize(): + (err.__class__.__name__, err)) + + ++def set_prefixes(): ++ """Set values of prefix and exec_prefix to /usr/local if executable is ++ /usr/bin/python* to make pip and distutils install into separate location. ++ ++ New value of sys.prefix is inserted to PREFIXES list that contains ++ it's previous value. Both paths /usr/lib/pythonX.Y/site-packages and ++ /usr/local/lib/pythonX.Y/site-packages will be included in sys.path. ++ """ ++ global PREFIXES ++ global ENABLE_USER_SITE ++ ++ if sys.executable.startswith("/usr/bin/python"): ++ sys.prefix = sys.exec_prefix = "/usr/local" ++ if ENABLE_USER_SITE: ++ PREFIXES.insert(0, sys.prefix) ++ ++ + def main(): + """Add standard site-specific directories to the module search path. + +@@ -550,6 +567,7 @@ def main(): + known_paths = venv(known_paths) + if ENABLE_USER_SITE is None: + ENABLE_USER_SITE = check_enableusersite() ++ set_prefixes() + known_paths = addusersitepackages(known_paths) + known_paths = addsitepackages(known_paths) + setquit() diff --git a/python3.spec b/python3.spec index da8010c..2ce5024 100644 --- a/python3.spec +++ b/python3.spec @@ -124,7 +124,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 13%{?dist} +Release: 18%{?dist} License: Python Group: Development/Languages @@ -410,6 +410,11 @@ Patch249: 00249-fix-out-of-tree-dtrace-builds.patch # http://bugs.python.org/issue29157 Patch250: 00250-getentropy.patch +# 00251 +# Set values of prefix and exec_prefix to /usr/local if executable is +# /usr/bin/python* to make pip and distutils install into separate location +Patch251: 00251-set-python3-prefixes.patch + # 00252 # Add executable option to install.py command to make it work for # scripts specified as an entry_points @@ -476,6 +481,12 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release} Obsoletes: python%{pyshortver} Provides: python%{pyshortver} = %{version}-%{release} +%if 0%{?_module_build} +Requires: system-python = %{version} +%else +Requires: system-python = %{version}-%{release} +%endif + %if 0%{with_rewheel} Requires: python3-setuptools Requires: python3-pip @@ -491,7 +502,7 @@ considerably, and a lot of deprecated features have finally been removed. Summary: Python 3 runtime libraries Group: Development/Libraries # For Modularity purpose we need not to include the dist-tag int he dependency -%if %(d="%{?dist}"; [ "${d#module-base-runtime-}x" != "${d}x" ] && echo 1 || echo 0) +%if 0%{?_module_build} Requires: system-python-libs%{?_isa} = %{version} %else Requires: system-python-libs%{?_isa} = %{version}-%{release} @@ -686,6 +697,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch243 -p1 %patch249 -p1 %patch250 -p1 +%patch251 -p1 %patch252 -p1 %patch253 -p1 %patch254 -p1 @@ -1613,6 +1625,11 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Tue Feb 21 2017 Michal Cyprian - 3.6.0-18 +- Set values of prefix and exec_prefix to /usr/local for + /usr/bin/python* executables +- Use new %%_module_build macro + * Fri Feb 17 2017 Michal Cyprian - 3.6.0-13 - Add --executable option to install.py command From bbccd649abc2d4cd646b9cc2c0889e3bd897e501 Mon Sep 17 00:00:00 2001 From: Michal Cyprian Date: Fri, 24 Feb 2017 14:57:15 +0100 Subject: [PATCH 317/416] Revert "Set values of prefix and exec_prefix to /usr/local for..." - Prevent build failures of packages using alternate build tools - This reverts commit 24515db173c9d3d65e1e24fc29fb9be88227bf52 --- 00251-set-python3-prefixes.patch | 36 -------------------------------- python3.spec | 21 +++++++------------ 2 files changed, 7 insertions(+), 50 deletions(-) delete mode 100644 00251-set-python3-prefixes.patch diff --git a/00251-set-python3-prefixes.patch b/00251-set-python3-prefixes.patch deleted file mode 100644 index c3043bf..0000000 --- a/00251-set-python3-prefixes.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff --git a/Lib/site.py b/Lib/site.py -index ad1033e..f2fb028 100644 ---- a/Lib/site.py -+++ b/Lib/site.py -@@ -537,6 +537,23 @@ def execusercustomize(): - (err.__class__.__name__, err)) - - -+def set_prefixes(): -+ """Set values of prefix and exec_prefix to /usr/local if executable is -+ /usr/bin/python* to make pip and distutils install into separate location. -+ -+ New value of sys.prefix is inserted to PREFIXES list that contains -+ it's previous value. Both paths /usr/lib/pythonX.Y/site-packages and -+ /usr/local/lib/pythonX.Y/site-packages will be included in sys.path. -+ """ -+ global PREFIXES -+ global ENABLE_USER_SITE -+ -+ if sys.executable.startswith("/usr/bin/python"): -+ sys.prefix = sys.exec_prefix = "/usr/local" -+ if ENABLE_USER_SITE: -+ PREFIXES.insert(0, sys.prefix) -+ -+ - def main(): - """Add standard site-specific directories to the module search path. - -@@ -550,6 +567,7 @@ def main(): - known_paths = venv(known_paths) - if ENABLE_USER_SITE is None: - ENABLE_USER_SITE = check_enableusersite() -+ set_prefixes() - known_paths = addusersitepackages(known_paths) - known_paths = addsitepackages(known_paths) - setquit() diff --git a/python3.spec b/python3.spec index 2ce5024..1599b60 100644 --- a/python3.spec +++ b/python3.spec @@ -124,7 +124,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 18%{?dist} +Release: 19%{?dist} License: Python Group: Development/Languages @@ -410,11 +410,6 @@ Patch249: 00249-fix-out-of-tree-dtrace-builds.patch # http://bugs.python.org/issue29157 Patch250: 00250-getentropy.patch -# 00251 -# Set values of prefix and exec_prefix to /usr/local if executable is -# /usr/bin/python* to make pip and distutils install into separate location -Patch251: 00251-set-python3-prefixes.patch - # 00252 # Add executable option to install.py command to make it work for # scripts specified as an entry_points @@ -481,12 +476,6 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release} Obsoletes: python%{pyshortver} Provides: python%{pyshortver} = %{version}-%{release} -%if 0%{?_module_build} -Requires: system-python = %{version} -%else -Requires: system-python = %{version}-%{release} -%endif - %if 0%{with_rewheel} Requires: python3-setuptools Requires: python3-pip @@ -502,7 +491,7 @@ considerably, and a lot of deprecated features have finally been removed. Summary: Python 3 runtime libraries Group: Development/Libraries # For Modularity purpose we need not to include the dist-tag int he dependency -%if 0%{?_module_build} +%if %(d="%{?dist}"; [ "${d#module-base-runtime-}x" != "${d}x" ] && echo 1 || echo 0) Requires: system-python-libs%{?_isa} = %{version} %else Requires: system-python-libs%{?_isa} = %{version}-%{release} @@ -697,7 +686,6 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch243 -p1 %patch249 -p1 %patch250 -p1 -%patch251 -p1 %patch252 -p1 %patch253 -p1 %patch254 -p1 @@ -1625,6 +1613,11 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Fri Feb 24 2017 Michal Cyprian - 3.6.0-19 +- Revert "Set values of prefix and exec_prefix to /usr/local for + /usr/bin/python* executables..." to prevent build failures + of packages using alternate build tools + * Tue Feb 21 2017 Michal Cyprian - 3.6.0-18 - Set values of prefix and exec_prefix to /usr/local for /usr/bin/python* executables From 860f392aef95af78914c856543195f77528391c9 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Tue, 28 Feb 2017 14:33:44 +0100 Subject: [PATCH 318/416] Add AppData and desktop file for IDLE 3 (rhbz#1392049) --- idle3.appdata.xml | 35 +++++++++++++++++++++++++++++++++++ idle3.desktop | 11 +++++++++++ python3.spec | 37 ++++++++++++++++++++++++++++++++++++- 3 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 idle3.appdata.xml create mode 100644 idle3.desktop diff --git a/idle3.appdata.xml b/idle3.appdata.xml new file mode 100644 index 0000000..94f87a2 --- /dev/null +++ b/idle3.appdata.xml @@ -0,0 +1,35 @@ + + + + + idle3.desktop + IDLE3 + CC0 + Python-2.0 + Python 3 Integrated Development and Learning Environment + +

+ IDLE is Python’s Integrated Development and Learning Environment. + The GUI is uniform between Windows, Unix, and Mac OS X. + IDLE provides an easy way to start writing, running, and debugging + Python code. +

+

+ IDLE is written in pure Python, and uses the tkinter GUI toolkit. + It provides: +

+
    +
  • a Python shell window (interactive interpreter) with colorizing of code input, output, and error messages,
  • +
  • a multi-window text editor with multiple undo, Python colorizing, smart indent, call tips, auto completion, and other features,
  • +
  • search within any window, replace within editor windows, and search through multiple files (grep),
  • +
  • a debugger with persistent breakpoints, stepping, and viewing of global and local namespaces.
  • +
+
+ https://docs.python.org/3/library/idle.html + + http://in.waw.pl/~zbyszek/fedora/idle3-appdata/idle3-main-window.png + http://in.waw.pl/~zbyszek/fedora/idle3-appdata/idle3-class-browser.png + http://in.waw.pl/~zbyszek/fedora/idle3-appdata/idle3-code-viewer.png + + zbyszek@in.waw.pl +
diff --git a/idle3.desktop b/idle3.desktop new file mode 100644 index 0000000..dc1d3c3 --- /dev/null +++ b/idle3.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Version=1.0 +Name=IDLE 3 +Comment=Python 3 Integrated Development and Learning Environment +Exec=idle3 %F +TryExec=idle3 +Terminal=false +Type=Application +Icon=idle3 +Categories=Development;IDE; +MimeType=text/x-python; \ No newline at end of file diff --git a/python3.spec b/python3.spec index 1599b60..7882ff6 100644 --- a/python3.spec +++ b/python3.spec @@ -124,7 +124,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 19%{?dist} +Release: 20%{?dist} License: Python Group: Development/Languages @@ -162,6 +162,8 @@ BuildRequires: openssl-devel BuildRequires: pkgconfig BuildRequires: readline-devel BuildRequires: sqlite-devel +BuildRequires: desktop-file-utils +BuildRequires: libappstream-glib BuildRequires: systemtap-sdt-devel BuildRequires: systemtap-devel @@ -223,6 +225,12 @@ Source8: check-pyc-and-pyo-timestamps.py # A simple macro that enables packages to require system-python(abi) instead of python(abi) Source9: macros.systempython +# Desktop menu entry for idle3 +Source10: idle3.desktop + +# AppData file for idle3 +Source11: idle3.appdata.xml + # Fixup distutils/unixccompiler.py to remove standard library path from rpath: # Was Patch0 in ivazquez' python3000 specfile: Patch1: Python-3.1.1-rpath.patch @@ -870,6 +878,17 @@ install -d -m 0755 ${RPM_BUILD_ROOT}%{pylibdir}/site-packages/__pycache__ mv ${RPM_BUILD_ROOT}%{_bindir}/2to3 ${RPM_BUILD_ROOT}%{_bindir}/python3-2to3 +# add idle3 to menu +install -D -m 0644 Lib/idlelib/Icons/idle_16.png ${RPM_BUILD_ROOT}%{_datadir}/icons/hicolor/16x16/apps/idle3.png +install -D -m 0644 Lib/idlelib/Icons/idle_32.png ${RPM_BUILD_ROOT}%{_datadir}/icons/hicolor/32x32/apps/idle3.png +install -D -m 0644 Lib/idlelib/Icons/idle_48.png ${RPM_BUILD_ROOT}%{_datadir}/icons/hicolor/48x48/apps/idle3.png +desktop-file-install --dir=${RPM_BUILD_ROOT}%{_datadir}/applications %{SOURCE10} + +# Install and validate appdata file +mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/appdata +cp -a %{SOURCE11} ${RPM_BUILD_ROOT}%{_datadir}/appdata +appstream-util validate-relax --nonet ${RPM_BUILD_ROOT}%{_datadir}/appdata/idle3.appdata.xml + # Development tools install -m755 -d ${RPM_BUILD_ROOT}%{pylibdir}/Tools install Tools/README ${RPM_BUILD_ROOT}%{pylibdir}/Tools/ @@ -1171,7 +1190,17 @@ rm -fr %{buildroot} %postun -n system-python-libs -p /sbin/ldconfig +%post +/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : +%postun +if [ $1 -eq 0 ] ; then + /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null + /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : +fi + +%posttrans +/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %files %defattr(-, root, root) @@ -1448,6 +1477,9 @@ rm -fr %{buildroot} %{_bindir}/idle* %{pylibdir}/Tools %doc %{pylibdir}/Doc +%{_datadir}/appdata/idle3.appdata.xml +%{_datadir}/applications/idle3.desktop +%{_datadir}/icons/hicolor/*/apps/idle3.* %files tkinter %defattr(-,root,root,755) @@ -1613,6 +1645,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Mon Feb 27 2017 Charalampos Stratakis - 3.6.0-20 +- Add desktop entry and appdata.xml file for IDLE 3 (rhbz#1392049) + * Fri Feb 24 2017 Michal Cyprian - 3.6.0-19 - Revert "Set values of prefix and exec_prefix to /usr/local for /usr/bin/python* executables..." to prevent build failures From 3b36b495e58df146c9e12fb503d60efe1509c40b Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Mon, 13 Mar 2017 14:53:53 +0100 Subject: [PATCH 319/416] Backport of PEP 538: Coercing the legacy C locale to a UTF-8 based locale Fedora self-contained change: https://fedoraproject.org/wiki/Changes/python3_c.utf-8_locale Since the backport is based on some changes done for the bpo-24932, these changes were backported as well with the 261 patch, which will be removed when python3 is rebased to 3.6.1 --- ...r-command-line-parsing-in-_testembed.patch | 104 ++++ 00262-pep538_coerce_legacy_c_locale.patch | 575 ++++++++++++++++++ python3.spec | 21 +- 3 files changed, 699 insertions(+), 1 deletion(-) create mode 100644 00261-use-proper-command-line-parsing-in-_testembed.patch create mode 100644 00262-pep538_coerce_legacy_c_locale.patch diff --git a/00261-use-proper-command-line-parsing-in-_testembed.patch b/00261-use-proper-command-line-parsing-in-_testembed.patch new file mode 100644 index 0000000..49db110 --- /dev/null +++ b/00261-use-proper-command-line-parsing-in-_testembed.patch @@ -0,0 +1,104 @@ +diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py +index 6c3625d..2a53f3d 100644 +--- a/Lib/test/test_capi.py ++++ b/Lib/test/test_capi.py +@@ -385,7 +385,7 @@ class EmbeddingTests(unittest.TestCase): + + def test_subinterps(self): + # This is just a "don't crash" test +- out, err = self.run_embedded_interpreter() ++ out, err = self.run_embedded_interpreter("repeated_init_and_subinterpreters") + if support.verbose: + print() + print(out) +diff --git a/Programs/_testembed.c b/Programs/_testembed.c +index 3968399..a68d4fa 100644 +--- a/Programs/_testembed.c ++++ b/Programs/_testembed.c +@@ -33,7 +33,7 @@ static void print_subinterp(void) + ); + } + +-static void test_repeated_init_and_subinterpreters(void) ++static int test_repeated_init_and_subinterpreters(void) + { + PyThreadState *mainstate, *substate; + #ifdef WITH_THREAD +@@ -70,6 +70,7 @@ static void test_repeated_init_and_subinterpreters(void) + PyEval_RestoreThread(mainstate); + Py_Finalize(); + } ++ return 0; + } + + /***************************************************** +@@ -103,7 +104,7 @@ static void check_stdio_details(const char *encoding, const char * errors) + Py_Finalize(); + } + +-static void test_forced_io_encoding(void) ++static int test_forced_io_encoding(void) + { + /* Check various combinations */ + printf("--- Use defaults ---\n"); +@@ -122,19 +123,51 @@ static void test_forced_io_encoding(void) + printf("Unexpected success calling Py_SetStandardStreamEncoding"); + } + Py_Finalize(); ++ return 0; + } + +-/* Different embedding tests */ +-int main(int argc, char *argv[]) ++/* ********************************************************* ++ * List of test cases and the function that implements it. ++ * ++ * Names are compared case-sensitively with the first ++ * argument. If no match is found, or no first argument was ++ * provided, the names of all test cases are printed and ++ * the exit code will be -1. ++ * ++ * The int returned from test functions is used as the exit ++ * code, and test_capi treats all non-zero exit codes as a ++ * failed test. ++ *********************************************************/ ++struct TestCase + { ++ const char *name; ++ int (*func)(void); ++}; ++ ++static struct TestCase TestCases[] = { ++ { "forced_io_encoding", test_forced_io_encoding }, ++ { "repeated_init_and_subinterpreters", test_repeated_init_and_subinterpreters }, ++ { NULL, NULL } ++}; + +- /* TODO: Check the argument string to allow for more test cases */ ++int main(int argc, char *argv[]) ++{ + if (argc > 1) { +- /* For now: assume "forced_io_encoding */ +- test_forced_io_encoding(); +- } else { +- /* Run the original embedding test case by default */ +- test_repeated_init_and_subinterpreters(); ++ for (struct TestCase *tc = TestCases; tc && tc->name; tc++) { ++ if (strcmp(argv[1], tc->name) == 0) ++ return (*tc->func)(); ++ } + } +- return 0; ++ ++ /* No match found, or no test name provided, so display usage */ ++ printf("Python " PY_VERSION " _testembed executable for embedded interpreter tests\n" ++ "Normally executed via 'EmbeddingTests' in Lib/test/test_capi.py\n\n" ++ "Usage: %s TESTNAME\n\nAll available tests:\n", argv[0]); ++ for (struct TestCase *tc = TestCases; tc && tc->name; tc++) { ++ printf(" %s\n", tc->name); ++ } ++ ++ /* Non-zero exit code will cause test_capi.py tests to fail. ++ This is intentional. */ ++ return -1; + } diff --git a/00262-pep538_coerce_legacy_c_locale.patch b/00262-pep538_coerce_legacy_c_locale.patch new file mode 100644 index 0000000..e267b50 --- /dev/null +++ b/00262-pep538_coerce_legacy_c_locale.patch @@ -0,0 +1,575 @@ +diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst +index c0e64d6..0bb28da 100644 +--- a/Doc/using/cmdline.rst ++++ b/Doc/using/cmdline.rst +@@ -711,6 +711,35 @@ conflict. + + .. versionadded:: 3.6 + ++ ++.. envvar:: PYTHONCOERCECLOCALE ++ ++ If set to a non-empty string, causes the main Python command line application ++ to skip coercing the legacy ASCII-based C locale to a more capable UTF-8 ++ based alternative. Note that this setting is checked even when the ++ :option:`-E` or :option:`-I` options are used, as it is handled prior to ++ the processing of command line options. ++ ++ If this variable is *not* set, and the current locale reported for the ++ ``LC_CTYPE`` category is the default ``C`` locale, then the Python CLI will ++ attempt to configure one of the following locales for the given locale ++ categories before loading the interpreter runtime: ++ ++ * ``C.UTF-8` (``LC_ALL``) ++ * ``C.utf8` (``LC_ALL``) ++ * ``UTF-8` (``LC_CTYPE``) ++ ++ If setting one of these locale categories succeeds, then the matching ++ environment variables will be set (both ``LC_ALL` and ``LANG`` for the ++ ``LC_ALL`` category, and ``LC_CTYPE`` for the ``LC_CTYPE`` category), ++ and (if not already set to a non-empty string) :envvar:`PYTHONIOENCODING` ++ will be set to ``utf-8:surrogateescape``. ++ ++ Availability: \*nix ++ ++ .. versionadded:: 3.7 ++ See :pep:`538` for more details. ++ + Debug-mode variables + ~~~~~~~~~~~~~~~~~~~~ + +diff --git a/Lib/test/support/script_helper.py b/Lib/test/support/script_helper.py +index 80889b1..1a1a862 100644 +--- a/Lib/test/support/script_helper.py ++++ b/Lib/test/support/script_helper.py +@@ -51,8 +51,35 @@ def interpreter_requires_environment(): + return __cached_interp_requires_environment + + +-_PythonRunResult = collections.namedtuple("_PythonRunResult", +- ("rc", "out", "err")) ++class _PythonRunResult(collections.namedtuple("_PythonRunResult", ++ ("rc", "out", "err"))): ++ """Helper for reporting Python subprocess run results""" ++ def fail(self, cmd_line): ++ """Provide helpful details about failed subcommand runs""" ++ # Limit to 80 lines to ASCII characters ++ maxlen = 80 * 100 ++ out, err = self.out, self.err ++ if len(out) > maxlen: ++ out = b'(... truncated stdout ...)' + out[-maxlen:] ++ if len(err) > maxlen: ++ err = b'(... truncated stderr ...)' + err[-maxlen:] ++ out = out.decode('ascii', 'replace').rstrip() ++ err = err.decode('ascii', 'replace').rstrip() ++ raise AssertionError("Process return code is %d\n" ++ "command line: %r\n" ++ "\n" ++ "stdout:\n" ++ "---\n" ++ "%s\n" ++ "---\n" ++ "\n" ++ "stderr:\n" ++ "---\n" ++ "%s\n" ++ "---" ++ % (self.rc, cmd_line, ++ out, ++ err)) + + + # Executing the interpreter in a subprocess +@@ -99,30 +126,7 @@ def run_python_until_end(*args, **env_vars): + def _assert_python(expected_success, *args, **env_vars): + res, cmd_line = run_python_until_end(*args, **env_vars) + if (res.rc and expected_success) or (not res.rc and not expected_success): +- # Limit to 80 lines to ASCII characters +- maxlen = 80 * 100 +- out, err = res.out, res.err +- if len(out) > maxlen: +- out = b'(... truncated stdout ...)' + out[-maxlen:] +- if len(err) > maxlen: +- err = b'(... truncated stderr ...)' + err[-maxlen:] +- out = out.decode('ascii', 'replace').rstrip() +- err = err.decode('ascii', 'replace').rstrip() +- raise AssertionError("Process return code is %d\n" +- "command line: %r\n" +- "\n" +- "stdout:\n" +- "---\n" +- "%s\n" +- "---\n" +- "\n" +- "stderr:\n" +- "---\n" +- "%s\n" +- "---" +- % (res.rc, cmd_line, +- out, +- err)) ++ res.fail(cmd_line) + return res + + def assert_python_ok(*args, **env_vars): +diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py +index 2a53f3d..ece84af 100644 +--- a/Lib/test/test_capi.py ++++ b/Lib/test/test_capi.py +@@ -386,7 +386,7 @@ class EmbeddingTests(unittest.TestCase): + def test_subinterps(self): + # This is just a "don't crash" test + out, err = self.run_embedded_interpreter("repeated_init_and_subinterpreters") +- if support.verbose: ++ if support.verbose > 1: + print() + print(out) + print(err) +@@ -404,14 +404,15 @@ class EmbeddingTests(unittest.TestCase): + def test_forced_io_encoding(self): + # Checks forced configuration of embedded interpreter IO streams + out, err = self.run_embedded_interpreter("forced_io_encoding") +- if support.verbose: ++ if support.verbose > 1: + print() + print(out) + print(err) +- expected_errors = sys.__stdout__.errors +- expected_stdin_encoding = sys.__stdin__.encoding ++ expected_errors = "surrogateescape" ++ expected_stdin_encoding = "UTF-8" + expected_pipe_encoding = self._get_default_pipe_encoding() + expected_output = '\n'.join([ ++ "Setting PYTHONIOENCODING=UTF-8:surrogateescape", + "--- Use defaults ---", + "Expected encoding: default", + "Expected errors: default", +diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py +index b71bb9f..56867fc 100644 +--- a/Lib/test/test_cmd_line.py ++++ b/Lib/test/test_cmd_line.py +@@ -9,8 +9,9 @@ import sys + import subprocess + import tempfile + from test.support import script_helper +-from test.support.script_helper import (spawn_python, kill_python, assert_python_ok, +- assert_python_failure) ++from test.support.script_helper import ( ++ spawn_python, kill_python, assert_python_ok, assert_python_failure ++) + + + # XXX (ncoghlan): Move to script_helper and make consistent with run_python +@@ -151,6 +152,7 @@ class CmdLineTest(unittest.TestCase): + env = os.environ.copy() + # Use C locale to get ascii for the locale encoding + env['LC_ALL'] = 'C' ++ env['PYTHONCOERCECLOCALE'] = '0' + code = ( + b'import locale; ' + b'print(ascii("' + undecodable + b'"), ' +diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py +index df9ebd4..63145e4 100644 +--- a/Lib/test/test_sys.py ++++ b/Lib/test/test_sys.py +@@ -680,6 +680,7 @@ class SysModuleTest(unittest.TestCase): + # Force the POSIX locale + env = os.environ.copy() + env["LC_ALL"] = "C" ++ env["PYTHONCOERCECLOCALE"] = "0" + code = '\n'.join(( + 'import sys', + 'def dump(name):', +diff --git a/Programs/_testembed.c b/Programs/_testembed.c +index a68d4fa..1494452 100644 +--- a/Programs/_testembed.c ++++ b/Programs/_testembed.c +@@ -1,4 +1,5 @@ +-#include ++#include "Python.h" ++#include "pyconfig.h" + #include + + /********************************************************* +@@ -106,6 +107,9 @@ static void check_stdio_details(const char *encoding, const char * errors) + + static int test_forced_io_encoding(void) + { ++ /* Ensure consistent "defaults" */ ++ printf("Setting PYTHONIOENCODING=UTF-8:surrogateescape\n"); ++ setenv("PYTHONIOENCODING", "UTF-8:surrogateescape", 1); + /* Check various combinations */ + printf("--- Use defaults ---\n"); + check_stdio_details(NULL, NULL); +@@ -126,6 +130,20 @@ static int test_forced_io_encoding(void) + return 0; + } + ++static int test_c_locale_warning(void) ++{ ++#ifdef PY_WARN_ON_C_LOCALE ++ /* Force use of the C locale */ ++ setenv("LC_ALL", "C", 1); ++ ++ _testembed_Py_Initialize(); ++ Py_Finalize(); ++#else ++ printf("C locale compatibility warning disabled at compile time\n"); ++#endif ++ return 0; ++} ++ + /* ********************************************************* + * List of test cases and the function that implements it. + * +@@ -147,6 +165,7 @@ struct TestCase + static struct TestCase TestCases[] = { + { "forced_io_encoding", test_forced_io_encoding }, + { "repeated_init_and_subinterpreters", test_repeated_init_and_subinterpreters }, ++ { "c_locale_warning", test_c_locale_warning }, + { NULL, NULL } + }; + +diff --git a/Programs/python.c b/Programs/python.c +index a7afbc7..b5edebb 100644 +--- a/Programs/python.c ++++ b/Programs/python.c +@@ -15,6 +15,110 @@ wmain(int argc, wchar_t **argv) + } + #else + ++/* Helpers to better handle the legacy C locale ++ * ++ * The legacy C locale assumes ASCII as the default text encoding, which ++ * causes problems not only for the CPython runtime, but also other ++ * components like GNU readline. ++ * ++ * Accordingly, when the CLI detects it, it attempts to coerce it to a ++ * more capable UTF-8 based alternative. ++ * ++ * See the documentation of the PYTHONCOERCECLOCALE setting for more details. ++ * ++ */ ++ ++#ifdef PY_COERCE_C_LOCALE ++static const char *_C_LOCALE_COERCION_WARNING = ++ "Python detected LC_CTYPE=C: %.20s coerced to %.20s (set another locale " ++ "or PYTHONCOERCECLOCALE=0 to disable this locale coercion behaviour).\n"; ++ ++typedef struct _CandidateLocale { ++ const char *locale_name; ++ int category; ++} _LocaleCoercionTarget; ++ ++static _LocaleCoercionTarget _TARGET_LOCALES[] = { ++ { "C.UTF-8", LC_ALL }, ++ { "C.utf8", LC_ALL }, ++ { "UTF-8", LC_CTYPE }, ++ { NULL, 0 } ++}; ++ ++void ++_coerce_default_locale_settings(const _LocaleCoercionTarget *target) ++{ ++ const char *newloc = target->locale_name; ++ int category = target->category; ++ ++ /* Reset locale back to currently configured defaults */ ++ setlocale(LC_ALL, ""); ++ ++ /* Set the relevant locale environment variables */ ++ if (category == LC_ALL) { ++ const char *env_vars_updated = "LC_ALL & LANG"; ++ if (setenv("LC_ALL", newloc, 1)) { ++ fprintf(stderr, ++ "Error setting LC_ALL, skipping C locale coercion\n"); ++ return; ++ } ++ if (setenv("LANG", newloc, 1)) { ++ fprintf(stderr, ++ "Error setting LANG during C locale coercion\n"); ++ env_vars_updated = "LC_ALL"; ++ } ++ fprintf(stderr, _C_LOCALE_COERCION_WARNING, env_vars_updated, newloc); ++ } else if (category == LC_CTYPE) { ++ if (setenv("LC_CTYPE", newloc, 1)) { ++ fprintf(stderr, ++ "Error setting LC_CTYPE, skipping C locale coercion\n"); ++ return; ++ } ++ fprintf(stderr, _C_LOCALE_COERCION_WARNING, "LC_CTYPE", newloc); ++ } else { ++ fprintf(stderr, "Locale coercion must target LC_ALL or LC_CTYPE\n"); ++ return; ++ } ++ ++ /* Set PYTHONIOENCODING if not already set */ ++ if (setenv("PYTHONIOENCODING", "utf-8:surrogateescape", 0)) { ++ fprintf(stderr, ++ "Error setting PYTHONIOENCODING during C locale coercion\n"); ++ } ++ ++ /* Reconfigure with the overridden environment variables */ ++ setlocale(LC_ALL, ""); ++} ++ ++void ++_handle_legacy_c_locale(void) ++{ ++ const char *coerce_c_locale = getenv("PYTHONCOERCECLOCALE"); ++ /* We ignore the Python -E and -I flags here, as we need to sort out ++ * the locale settings *before* we try to do anything with the command ++ * line arguments. For cross-platform debugging purposes, we also need ++ * to give end users a way to force even scripts that are otherwise ++ * isolated from their environment to use the legacy ASCII-centric C ++ * locale. ++ */ ++ if (coerce_c_locale == NULL || strncmp(coerce_c_locale, "0", 2) != 0) { ++ /* PYTHONCOERCECLOCALE is not set, or is not set to exactly "0" */ ++ const _LocaleCoercionTarget *target = NULL; ++ for (target = _TARGET_LOCALES; target->locale_name; target++) { ++ const char *reconfigured_locale = setlocale(target->category, ++ target->locale_name); ++ if (reconfigured_locale != NULL) { ++ /* Successfully configured locale, so make it the default */ ++ _coerce_default_locale_settings(target); ++ return; ++ } ++ } ++ ++ } ++ /* No C locale warning here, as Py_Initialize will emit one later */ ++} ++#endif ++ + int + main(int argc, char **argv) + { +@@ -49,7 +153,26 @@ main(int argc, char **argv) + return 1; + } + ++#ifdef __ANDROID__ ++ /* Passing "" to setlocale() on Android requests the C locale rather ++ * than checking environment variables, so request C.UTF-8 explicitly ++ */ ++ setlocale(LC_ALL, "C.UTF-8"); ++#else ++ /* Reconfigure the locale to the default for this process */ + setlocale(LC_ALL, ""); ++#endif ++ ++#ifdef PY_COERCE_C_LOCALE ++ /* When the LC_CTYPE category still claims to be using the C locale, ++ assume configuration error and try for a UTF-8 based locale instead */ ++ const char *ctype_loc = setlocale(LC_CTYPE, NULL); ++ if (ctype_loc != NULL && strcmp(ctype_loc, "C") == 0) { ++ _handle_legacy_c_locale(); ++ } ++#endif ++ ++ /* Convert from char to wchar_t based on the locale settings */ + for (i = 0; i < argc; i++) { + argv_copy[i] = Py_DecodeLocale(argv[i], NULL); + if (!argv_copy[i]) { +diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c +index a4f7f82..dd58dc9 100644 +--- a/Python/pylifecycle.c ++++ b/Python/pylifecycle.c +@@ -301,6 +301,31 @@ import_init(PyInterpreterState *interp, PyObject *sysmod) + } + + ++#ifdef PY_WARN_ON_C_LOCALE ++static const char *_C_LOCALE_WARNING = ++ "Python runtime initialized with LC_CTYPE=C (a locale with default ASCII " ++ "encoding), which may cause Unicode compatibility problems. Using C.UTF-8, " ++ "C.utf8, or UTF-8 (if available) as alternative Unicode-compatible " ++ "locales is recommended.\n"; ++ ++static void ++_emit_stderr_warning_for_c_locale(void) ++{ ++ const char *coerce_c_locale = getenv("PYTHONCOERCECLOCALE"); ++ /* We don't emit a warning if locale coercion has been explicitly disabled. ++ * ++ * For consistency with the corresponding check in Programs/python.c ++ * we ignore the Python -E and -I flags here. ++ */ ++ if (coerce_c_locale == NULL || strncmp(coerce_c_locale, "0", 2) != 0) { ++ const char *ctype_loc = setlocale(LC_CTYPE, NULL); ++ if (ctype_loc != NULL && strcmp(ctype_loc, "C") == 0) { ++ fprintf(stderr, "%s", _C_LOCALE_WARNING); ++ } ++ } ++} ++#endif ++ + void + _Py_InitializeEx_Private(int install_sigs, int install_importlib) + { +@@ -315,11 +340,19 @@ _Py_InitializeEx_Private(int install_sigs, int install_importlib) + initialized = 1; + _Py_Finalizing = NULL; + +-#ifdef HAVE_SETLOCALE ++#ifdef __ANDROID__ ++ /* Passing "" to setlocale() on Android requests the C locale rather ++ * than checking environment variables, so request C.UTF-8 explicitly ++ */ ++ setlocale(LC_CTYPE, "C.UTF-8"); ++#else + /* Set up the LC_CTYPE locale, so we can obtain + the locale's charset without having to switch + locales. */ + setlocale(LC_CTYPE, ""); ++#ifdef PY_WARN_ON_C_LOCALE ++ _emit_stderr_warning_for_c_locale(); ++#endif + #endif + + if ((p = Py_GETENV("PYTHONDEBUG")) && *p != '\0') +diff --git a/configure b/configure +index 6bcddb7..13052d6 100755 +--- a/configure ++++ b/configure +@@ -834,6 +834,8 @@ with_thread + enable_ipv6 + with_doc_strings + with_pymalloc ++with_c_locale_coercion ++with_c_locale_warning + with_valgrind + with_dtrace + with_fpectl +@@ -1527,6 +1529,12 @@ Optional Packages: + deprecated; use --with(out)-threads + --with(out)-doc-strings disable/enable documentation strings + --with(out)-pymalloc disable/enable specialized mallocs ++ --with(out)-c-locale-coercion ++ disable/enable C locale coercion to a UTF-8 based ++ locale ++ --with(out)-c-locale-warning ++ disable/enable locale compatibility warning in the C ++ locale + --with-valgrind Enable Valgrind support + --with(out)-dtrace disable/enable DTrace support + --with-fpectl enable SIGFPE catching +@@ -11016,6 +11024,52 @@ fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_pymalloc" >&5 + $as_echo "$with_pymalloc" >&6; } + ++# Check for --with-c-locale-coercion ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-c-locale-coercion" >&5 ++$as_echo_n "checking for --with-c-locale-coercion... " >&6; } ++ ++# Check whether --with-c-locale-coercion was given. ++if test "${with_c_locale_coercion+set}" = set; then : ++ withval=$with_c_locale_coercion; ++fi ++ ++ ++if test -z "$with_c_locale_coercion" ++then ++ with_c_locale_coercion="yes" ++fi ++if test "$with_c_locale_coercion" != "no" ++then ++ ++$as_echo "#define PY_COERCE_C_LOCALE 1" >>confdefs.h ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_c_locale_coercion" >&5 ++$as_echo "$with_c_locale_coercion" >&6; } ++ ++# Check for --with-c-locale-warning ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-c-locale-warning" >&5 ++$as_echo_n "checking for --with-c-locale-warning... " >&6; } ++ ++# Check whether --with-c-locale-warning was given. ++if test "${with_c_locale_warning+set}" = set; then : ++ withval=$with_c_locale_warning; ++fi ++ ++ ++if test -z "$with_c_locale_warning" ++then ++ with_c_locale_warning="yes" ++fi ++if test "$with_c_locale_warning" != "no" ++then ++ ++$as_echo "#define PY_WARN_ON_C_LOCALE 1" >>confdefs.h ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_c_locale_warning" >&5 ++$as_echo "$with_c_locale_warning" >&6; } ++ + # Check for Valgrind support + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-valgrind" >&5 + $as_echo_n "checking for --with-valgrind... " >&6; } +diff --git a/configure.ac b/configure.ac +index e222c21..a1653e7 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3287,6 +3287,40 @@ then + fi + AC_MSG_RESULT($with_pymalloc) + ++# Check for --with-c-locale-coercion ++AC_MSG_CHECKING(for --with-c-locale-coercion) ++AC_ARG_WITH(c-locale-coercion, ++ AS_HELP_STRING([--with(out)-c-locale-coercion], ++ [disable/enable C locale coercion to a UTF-8 based locale])) ++ ++if test -z "$with_c_locale_coercion" ++then ++ with_c_locale_coercion="yes" ++fi ++if test "$with_c_locale_coercion" != "no" ++then ++ AC_DEFINE(PY_COERCE_C_LOCALE, 1, ++ [Define if you want to coerce the C locale to a UTF-8 based locale]) ++fi ++AC_MSG_RESULT($with_c_locale_coercion) ++ ++# Check for --with-c-locale-warning ++AC_MSG_CHECKING(for --with-c-locale-warning) ++AC_ARG_WITH(c-locale-warning, ++ AS_HELP_STRING([--with(out)-c-locale-warning], ++ [disable/enable locale compatibility warning in the C locale])) ++ ++if test -z "$with_c_locale_warning" ++then ++ with_c_locale_warning="yes" ++fi ++if test "$with_c_locale_warning" != "no" ++then ++ AC_DEFINE(PY_WARN_ON_C_LOCALE, 1, ++ [Define to emit a locale compatibility warning in the C locale]) ++fi ++AC_MSG_RESULT($with_c_locale_warning) ++ + # Check for Valgrind support + AC_MSG_CHECKING([for --with-valgrind]) + AC_ARG_WITH([valgrind], +diff --git a/pyconfig.h.in b/pyconfig.h.in +index e7a836c..11e0798 100644 +--- a/pyconfig.h.in ++++ b/pyconfig.h.in +@@ -1241,9 +1241,15 @@ + /* Define as the preferred size in bits of long digits */ + #undef PYLONG_BITS_IN_DIGIT + ++/* Define if you want to coerce the C locale to a UTF-8 based locale */ ++#undef PY_COERCE_C_LOCALE ++ + /* Define to printf format modifier for Py_ssize_t */ + #undef PY_FORMAT_SIZE_T + ++/* Define to emit a locale compatibility warning in the C locale */ ++#undef PY_WARN_ON_C_LOCALE ++ + /* Define if you want to build an interpreter with many run-time checks. */ + #undef Py_DEBUG + diff --git a/python3.spec b/python3.spec index 7882ff6..85c4142 100644 --- a/python3.spec +++ b/python3.spec @@ -124,7 +124,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.0 -Release: 20%{?dist} +Release: 21%{?dist} License: Python Group: Development/Languages @@ -449,6 +449,18 @@ Patch258: 00258-fix-test_aead_aes_gcm.patch # https://github.com/python/cpython/pull/67 Patch260: 00260-require-setuptools-dependencies.patch +# 00261 # +# Use proper command line parsing in _testembed +# Fixed upstream: http://bugs.python.org/issue24932 +Patch261: 00261-use-proper-command-line-parsing-in-_testembed.patch + +# 00262 # +# Backport of PEP 538: Coercing the legacy C locale to a UTF-8 based locale +# https://www.python.org/dev/peps/pep-0538/ +# Fedora Change: https://fedoraproject.org/wiki/Changes/python3_c.utf-8_locale +# Original proposal: https://bugzilla.redhat.com/show_bug.cgi?id=1404918 +Patch262: 00262-pep538_coerce_legacy_c_locale.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -699,6 +711,8 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch254 -p1 %patch258 -p1 %patch260 -p1 +%patch261 -p1 +%patch262 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1645,6 +1659,11 @@ fi # ====================================================== %changelog +* Fri Mar 10 2017 Charalampos Stratakis - 3.6.0-21 +- Use proper command line parsing in _testembed +- Backport of PEP 538: Coercing the legacy C locale to a UTF-8 based locale + https://fedoraproject.org/wiki/Changes/python3_c.utf-8_locale + * Mon Feb 27 2017 Charalampos Stratakis - 3.6.0-20 - Add desktop entry and appdata.xml file for IDLE 3 (rhbz#1392049) From aba719b9fe1ff39da29d24bf9a43f6d80ea83362 Mon Sep 17 00:00:00 2001 From: Iryna Shcherbina Date: Tue, 14 Mar 2017 17:52:25 +0100 Subject: [PATCH 320/416] Update to Python 3.6.1 release candidate 1 - Remove patches 250, 253, 254 as the changes are already in Python 3.6.1rc1 - Update patch 157 to work with the new Python codebase - Remove README file from site-packages (upstream issue24633) - Rename README to README.rst according to upstream change (upstream PR#2) - Add patch 264 to skip a known test failure on aarch64 (upstream issue29804) --- 00157-uid-gid-overflows.patch | 24 ++- 00250-getentropy.patch | 171 ------------------ 00253-fix-HAVE_LONG_LONG-compatibility.patch | 24 --- ...ndom.seed-actually-use-OS-randomness.patch | 13 -- 00262-pep538_coerce_legacy_c_locale.patch | 2 +- 00264-skip-test-failing-on-aarch64.patch | 12 ++ python3.spec | 52 +++--- sources | 2 +- 8 files changed, 53 insertions(+), 247 deletions(-) delete mode 100644 00250-getentropy.patch delete mode 100644 00253-fix-HAVE_LONG_LONG-compatibility.patch delete mode 100644 00254-make-Random.seed-actually-use-OS-randomness.patch create mode 100644 00264-skip-test-failing-on-aarch64.patch diff --git a/00157-uid-gid-overflows.patch b/00157-uid-gid-overflows.patch index 43bd394..03f3e02 100644 --- a/00157-uid-gid-overflows.patch +++ b/00157-uid-gid-overflows.patch @@ -1,6 +1,8 @@ ---- Python-3.4.0b1/Lib/test/test_os.py.orig 2013-11-27 12:07:32.368411798 +0100 -+++ Python-3.4.0b1/Lib/test/test_os.py 2013-11-27 12:12:11.220265174 +0100 -@@ -1319,30 +1319,36 @@ +diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py +index e9fdb07..ea60e6e 100644 +--- a/Lib/test/test_os.py ++++ b/Lib/test/test_os.py +@@ -1723,30 +1723,36 @@ class PosixUidGidTests(unittest.TestCase): def test_setuid(self): if os.getuid() != 0: self.assertRaises(OSError, os.setuid, 0) @@ -37,7 +39,7 @@ self.assertRaises(OverflowError, os.setreuid, 1<<32, 0) self.assertRaises(OverflowError, os.setreuid, 0, 1<<32) -@@ -1358,6 +1364,8 @@ +@@ -1762,6 +1768,8 @@ class PosixUidGidTests(unittest.TestCase): def test_setregid(self): if os.getuid() != 0 and not HAVE_WHEEL_GROUP: self.assertRaises(OSError, os.setregid, 0, 0) @@ -46,17 +48,21 @@ self.assertRaises(OverflowError, os.setregid, 1<<32, 0) self.assertRaises(OverflowError, os.setregid, 0, 1<<32) ---- Python-3.4.0b1/Lib/test/test_pwd.py.orig 2013-11-24 21:36:55.000000000 +0100 -+++ Python-3.4.0b1/Lib/test/test_pwd.py 2013-11-27 12:07:32.369411798 +0100 -@@ -89,9 +89,9 @@ +diff --git a/Lib/test/test_pwd.py b/Lib/test/test_pwd.py +index ac9cff7..db98159 100644 +--- a/Lib/test/test_pwd.py ++++ b/Lib/test/test_pwd.py +@@ -104,11 +104,11 @@ 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. + # Android accepts a very large span of uids including sys.maxsize and + # -1; it raises KeyError with 1 or 2 for example. - fakeuid = sys.maxsize + fakeuid = 2**32 - 2 self.assertNotIn(fakeuid, byuids) - self.assertRaises(KeyError, pwd.getpwuid, fakeuid) - + if not support.is_android: + self.assertRaises(KeyError, pwd.getpwuid, fakeuid) diff --git a/00250-getentropy.patch b/00250-getentropy.patch deleted file mode 100644 index 6d0025a..0000000 --- a/00250-getentropy.patch +++ /dev/null @@ -1,171 +0,0 @@ -diff -r ee1390c9b585 Python/random.c ---- a/Python/random.c Wed Jan 04 12:02:30 2017 +0100 -+++ b/Python/random.c Wed Jan 04 18:32:21 2017 +0100 -@@ -77,45 +77,8 @@ win32_urandom(unsigned char *buffer, Py_ - return 0; - } - --/* 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) --#define PY_GETENTROPY 1 -- --/* Fill buffer with size pseudo-random bytes generated by getentropy(). -- Return 0 on success, or raise an exception and return -1 on error. -- -- If raise is zero, don't raise an exception on error. */ --static int --py_getentropy(char *buffer, Py_ssize_t size, int raise) --{ -- while (size > 0) { -- Py_ssize_t len = Py_MIN(size, 256); -- int res; -+#else /* !MS_WINDOWS */ - -- if (raise) { -- Py_BEGIN_ALLOW_THREADS -- res = getentropy(buffer, len); -- Py_END_ALLOW_THREADS -- } -- else { -- res = getentropy(buffer, len); -- } -- -- if (res < 0) { -- if (raise) { -- PyErr_SetFromErrno(PyExc_OSError); -- } -- return -1; -- } -- -- buffer += len; -- size -= len; -- } -- return 0; --} -- --#else - - #if defined(HAVE_GETRANDOM) || defined(HAVE_GETRANDOM_SYSCALL) - #define PY_GETRANDOM 1 -@@ -217,6 +180,59 @@ py_getrandom(void *buffer, Py_ssize_t si - } - return 1; - } -+ -+/* 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) -+#define PY_GETENTROPY 1 -+ -+/* Fill buffer with size pseudo-random bytes generated by getentropy(). -+ Return 1 on success, or raise an exception and return -1 on error. -+ -+ If raise is zero, don't raise an exception on error. */ -+static int -+py_getentropy(char *buffer, Py_ssize_t size, int raise) -+{ -+ /* Is getentropy() supported by the running kernel? Set to 0 if -+ getentropy() failed with ENOSYS. */ -+ static int getentropy_works = 1; -+ -+ if (!getentropy_works) { -+ return 0; -+ } -+ -+ while (size > 0) { -+ Py_ssize_t len = Py_MIN(size, 256); -+ int res; -+ -+ if (raise) { -+ Py_BEGIN_ALLOW_THREADS -+ res = getentropy(buffer, len); -+ Py_END_ALLOW_THREADS -+ } -+ else { -+ res = getentropy(buffer, len); -+ } -+ -+ if (res < 0) { -+ /* ENOSYS: the inner syscall is not supported by the running -+ kernel. */ -+ if (errno == ENOSYS) { -+ getentropy_works = 0; -+ return 0; -+ } -+ -+ if (raise) { -+ PyErr_SetFromErrno(PyExc_OSError); -+ } -+ return -1; -+ } -+ -+ buffer += len; -+ size -= len; -+ } -+ return 1; -+} - #endif - - static struct { -@@ -236,7 +252,7 @@ dev_urandom(char *buffer, Py_ssize_t siz - { - int fd; - Py_ssize_t n; --#ifdef PY_GETRANDOM -+#if defined(PY_GETRANDOM) || defined(PY_GETENTROPY) - int res; - #endif - -@@ -244,17 +260,20 @@ dev_urandom(char *buffer, Py_ssize_t siz - - #ifdef PY_GETRANDOM - res = py_getrandom(buffer, size, blocking, raise); -+#elif defined(PY_GETENTROPY) -+ res = py_getentropy(buffer, size, raise); -+#endif -+#if defined(PY_GETRANDOM) || defined(PY_GETENTROPY) - if (res < 0) { - return -1; - } - if (res == 1) { - return 0; - } -- /* getrandom() failed with ENOSYS or EPERM, -- fall back on reading /dev/urandom */ -+ /* function failed with ENOSYS or EPERM, fall back on reading -+ from /dev/urandom */ - #endif - -- - if (raise) { - struct _Py_stat_struct st; - -@@ -349,8 +368,8 @@ dev_urandom_close(void) - urandom_cache.fd = -1; - } - } -+#endif /* !MS_WINDOWS */ - --#endif - - /* Fill buffer with pseudo-random bytes generated by a linear congruent - generator (LCG): -@@ -395,8 +414,6 @@ pyurandom(void *buffer, Py_ssize_t size, - - #ifdef MS_WINDOWS - return win32_urandom((unsigned char *)buffer, size, raise); --#elif defined(PY_GETENTROPY) -- return py_getentropy(buffer, size, raise); - #else - return dev_urandom(buffer, size, blocking, raise); - #endif -@@ -491,8 +508,6 @@ void - CryptReleaseContext(hCryptProv, 0); - hCryptProv = 0; - } --#elif defined(PY_GETENTROPY) -- /* nothing to clean */ - #else - dev_urandom_close(); - #endif diff --git a/00253-fix-HAVE_LONG_LONG-compatibility.patch b/00253-fix-HAVE_LONG_LONG-compatibility.patch deleted file mode 100644 index 7951e63..0000000 --- a/00253-fix-HAVE_LONG_LONG-compatibility.patch +++ /dev/null @@ -1,24 +0,0 @@ - -# HG changeset patch -# User Victor Stinner -# Date 1483653533 -3600 -# Node ID fad67c66885f0bd9ebafe2a54f0fa12b5a8fe3bf -# Parent 52d671684342cd2dcc804566d4c755634d3210a8 -Issue #27961: Define HAVE_LONG_LONG as 1. - -Fix backward compatibility issue, HAVE_LONG_LONG was defined but empty, whereas -it is defined as 1 in Python 3.5. - -diff --git a/Include/pyport.h b/Include/pyport.h ---- a/Include/pyport.h -+++ b/Include/pyport.h -@@ -39,7 +39,7 @@ Used in: Py_SAFE_DOWNCAST - - // long long is required. Ensure HAVE_LONG_LONG is defined for compatibility. - #ifndef HAVE_LONG_LONG --#define HAVE_LONG_LONG -+#define HAVE_LONG_LONG 1 - #endif - #ifndef PY_LONG_LONG - #define PY_LONG_LONG long long - diff --git a/00254-make-Random.seed-actually-use-OS-randomness.patch b/00254-make-Random.seed-actually-use-OS-randomness.patch deleted file mode 100644 index e5ecb38..0000000 --- a/00254-make-Random.seed-actually-use-OS-randomness.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/Modules/_randommodule.c b/Modules/_randommodule.c -index 63759d5..0d3282d 100644 ---- a/Modules/_randommodule.c -+++ b/Modules/_randommodule.c -@@ -245,7 +245,7 @@ random_seed(RandomObject *self, PyObject *args) - return NULL; - - if (arg == NULL || arg == Py_None) { -- if (random_seed_urandom(self) >= 0) { -+ if (random_seed_urandom(self) < 0) { - PyErr_Clear(); - - /* Reading system entropy failed, fall back on the worst entropy: diff --git a/00262-pep538_coerce_legacy_c_locale.patch b/00262-pep538_coerce_legacy_c_locale.patch index e267b50..a13b644 100644 --- a/00262-pep538_coerce_legacy_c_locale.patch +++ b/00262-pep538_coerce_legacy_c_locale.patch @@ -151,7 +151,7 @@ index b71bb9f..56867fc 100644 @@ -9,8 +9,9 @@ import sys import subprocess import tempfile - from test.support import script_helper + from test.support import script_helper, is_android -from test.support.script_helper import (spawn_python, kill_python, assert_python_ok, - assert_python_failure) +from test.support.script_helper import ( diff --git a/00264-skip-test-failing-on-aarch64.patch b/00264-skip-test-failing-on-aarch64.patch new file mode 100644 index 0000000..edda219 --- /dev/null +++ b/00264-skip-test-failing-on-aarch64.patch @@ -0,0 +1,12 @@ +diff --git a/Lib/ctypes/test/test_structures.py b/Lib/ctypes/test/test_structures.py +index 3eded77..ad7859a 100644 +--- a/Lib/ctypes/test/test_structures.py ++++ b/Lib/ctypes/test/test_structures.py +@@ -392,6 +392,7 @@ class StructureTestCase(unittest.TestCase): + (1, 0, 0, 0, 0, 0)) + self.assertRaises(TypeError, lambda: Z(1, 2, 3, 4, 5, 6, 7)) + ++ @unittest.skip('Fails on aarch64: http://bugs.python.org/issue29804') + def test_pass_by_value(self): + # This should mirror the structure in Modules/_ctypes/_ctypes_test.c + class X(Structure): diff --git a/python3.spec b/python3.spec index 85c4142..042ff25 100644 --- a/python3.spec +++ b/python3.spec @@ -24,6 +24,8 @@ # Currently these packages are recommended to have been built before a targeted rebuild after a python abi change: # python-sphinx, pytest, python-requests, cloud-init, dnf, anaconda, abrt. +# First release cadidate +%global prerel rc1 %global with_rewheel 1 @@ -123,8 +125,8 @@ # ================== Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 -Version: %{pybasever}.0 -Release: 21%{?dist} +Version: %{pybasever}.1 +Release: 0.1.%{?prerel}%{?dist} License: Python Group: Development/Languages @@ -197,7 +199,7 @@ BuildRequires: python3-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-%{version}%{?prerel}.tar.xz # Supply an RPM macro "py_byte_compile" for the python3-devel subpackage # to enable specfiles to selectively byte-compile individual files and paths @@ -412,28 +414,11 @@ Patch243: 00243-fix-mips64-triplet.patch # Not yet fixed upstream: http://bugs.python.org/issue28787 Patch249: 00249-fix-out-of-tree-dtrace-builds.patch -# 00250 # -# After glibc-2.24.90, Python 3 failed to start on EL7 kernel -# rhbz#1410175: https://bugzilla.redhat.com/show_bug.cgi?id=1410175 -# http://bugs.python.org/issue29157 -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 -# 00253 # -# Define HAVE_LONG_LONG as 1 instead of blank for backwards compatibility -# Fixed upstream: https://hg.python.org/cpython/rev/fad67c66885f -Patch253: 00253-fix-HAVE_LONG_LONG-compatibility.patch - -# 00254 # -# Fix error check, so that Random.seed actually uses OS randomness -# rhbz#1412275: https://bugzilla.redhat.com/show_bug.cgi?id=1412275 -# Fixed upstream: https://bugs.python.org/issue29085 -Patch254: 00254-make-Random.seed-actually-use-OS-randomness.patch - # 00258 # # Kernel 4.9 introduced some changes to its crypto API # making test_aead_aes_gcm fail, so skipping the test for now @@ -470,6 +455,13 @@ Patch262: 00262-pep538_coerce_legacy_c_locale.patch # # https://fedoraproject.org/wiki/SIGs/Python/PythonPatches +# 00264 # +# test_pass_by_value was added in Python 3.6.1 and on aarch64 +# it is catching an error that was there, but wasn't tested before. +# Therefore skipping the test on aarch64 until fixed upstream. +# Reported upstream: http://bugs.python.org/issue29804 +Patch264: 00264-skip-test-failing-on-aarch64.patch + # add correct arch for ppc64/ppc64le # it should be ppc64le-linux-gnu/ppc64-linux-gnu instead powerpc64le-linux-gnu/powerpc64-linux-gnu @@ -705,15 +697,16 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch206 -p1 %patch243 -p1 %patch249 -p1 -%patch250 -p1 %patch252 -p1 -%patch253 -p1 -%patch254 -p1 %patch258 -p1 %patch260 -p1 %patch261 -p1 %patch262 -p1 +%ifarch aarch64 +%patch264 -p1 +%endif + # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. # @@ -1219,7 +1212,7 @@ fi %files %defattr(-, root, root) %license LICENSE -%doc README +%doc README.rst %{_bindir}/pydoc* %{_bindir}/python3 %{_bindir}/python%{pybasever} @@ -1231,7 +1224,7 @@ fi %files libs %defattr(-,root,root,-) %license LICENSE -%doc README +%doc README.rst %{pylibdir}/lib2to3 %exclude %{pylibdir}/lib2to3/tests @@ -1296,13 +1289,13 @@ fi %files -n system-python %defattr(-,root,root,-) %license LICENSE -%doc README +%doc README.rst %{_libexecdir}/system-python %files -n system-python-libs %defattr(-,root,root,-) %license LICENSE -%doc README +%doc README.rst %dir %{pylibdir} %dir %{dynload_dir} @@ -1375,7 +1368,6 @@ fi %dir %{pylibdir}/site-packages/ %dir %{pylibdir}/site-packages/__pycache__/ -%{pylibdir}/site-packages/README %{pylibdir}/site-packages/README.txt %{pylibdir}/*.py %dir %{pylibdir}/__pycache__/ @@ -1659,6 +1651,10 @@ fi # ====================================================== %changelog +* Thu Mar 16 2017 Iryna Shcherbina - 3.6.1-0.1.rc1 +- Update to Python 3.6.1 release candidate 1 +- Add patch 264 to skip a known test failure on aarch64 + * Fri Mar 10 2017 Charalampos Stratakis - 3.6.0-21 - Use proper command line parsing in _testembed - Backport of PEP 538: Coercing the legacy C locale to a UTF-8 based locale diff --git a/sources b/sources index 7b47bed..676f3bf 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Python-3.6.0.tar.xz) = 9d06bee9172bc0bfd2d280fd1c27ea712f3258cfbfd2e2aeb734d0a6710998d5deeefc5d6e72251750dd9493d35461511ceaa187a29dea700ca238ff6ac1dbb2 +SHA512 (Python-3.6.1rc1.tar.xz) = 21ae75db2a568ba85af5510d45c3616595ae00b9f5008d78b926340980b4728f4fd393d2ecd435d2902cd25aba50a8b98f5cdbfa651da75c8f164909bc4730be From 628b06df1b62db16171b025b2f81af03a12b774d Mon Sep 17 00:00:00 2001 From: Tomas Orsava Date: Tue, 21 Mar 2017 11:51:35 +0100 Subject: [PATCH 321/416] Fix syntax error in %py_byte_compile macro (rhbz#1433569) --- macros.pybytecompile3.6 | 2 +- python3.spec | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/macros.pybytecompile3.6 b/macros.pybytecompile3.6 index 96d1826..3968c6e 100644 --- a/macros.pybytecompile3.6 +++ b/macros.pybytecompile3.6 @@ -6,5 +6,5 @@ %py_byte_compile()\ python_binary="%1"\ bytecode_compilation_path="%2"\ -find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("$RPM_BUILD_ROOT")[2]], optimize=opt) for opt in range(2) for f in sys.argv[1:]]' || :\ +find $bytecode_compilation_path -type f -a -name "*.py" -print0 | xargs -0 $python_binary -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("$RPM_BUILD_ROOT")[2], optimize=opt) for opt in range(2) for f in sys.argv[1:]]' || :\ %{nil} diff --git a/python3.spec b/python3.spec index 042ff25..09bfb02 100644 --- a/python3.spec +++ b/python3.spec @@ -126,7 +126,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 0.1.%{?prerel}%{?dist} +Release: 0.2.%{?prerel}%{?dist} License: Python Group: Development/Languages @@ -1651,6 +1651,9 @@ fi # ====================================================== %changelog +* Tue Mar 21 2017 Tomas Orsava - 3.6.1-0.2.rc1 +- Fix syntax error in %%py_byte_compile macro (rhbz#1433569) + * Thu Mar 16 2017 Iryna Shcherbina - 3.6.1-0.1.rc1 - Update to Python 3.6.1 release candidate 1 - Add patch 264 to skip a known test failure on aarch64 From b603b2d8f9e246c69ef20284d4f1108d70ec9564 Mon Sep 17 00:00:00 2001 From: Iryna Shcherbina Date: Wed, 22 Mar 2017 11:05:15 +0100 Subject: [PATCH 322/416] Update to version 3.6.1 final --- python3.spec | 10 +++++----- sources | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/python3.spec b/python3.spec index 09bfb02..bcb9a92 100644 --- a/python3.spec +++ b/python3.spec @@ -24,9 +24,6 @@ # Currently these packages are recommended to have been built before a targeted rebuild after a python abi change: # python-sphinx, pytest, python-requests, cloud-init, dnf, anaconda, abrt. -# First release cadidate -%global prerel rc1 - %global with_rewheel 1 %global pybasever 3.6 @@ -126,7 +123,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 0.2.%{?prerel}%{?dist} +Release: 1%{?dist} License: Python Group: Development/Languages @@ -199,7 +196,7 @@ BuildRequires: python3-pip # Source code and patches # ======================= -Source: https://www.python.org/ftp/python/%{version}/Python-%{version}%{?prerel}.tar.xz +Source: https://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz # Supply an RPM macro "py_byte_compile" for the python3-devel subpackage # to enable specfiles to selectively byte-compile individual files and paths @@ -1651,6 +1648,9 @@ fi # ====================================================== %changelog +* Wed Mar 22 2017 Iryna Shcherbina - 3.6.1-1 +- Update to version 3.6.1 final + * Tue Mar 21 2017 Tomas Orsava - 3.6.1-0.2.rc1 - Fix syntax error in %%py_byte_compile macro (rhbz#1433569) diff --git a/sources b/sources index 676f3bf..9bb64d1 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Python-3.6.1rc1.tar.xz) = 21ae75db2a568ba85af5510d45c3616595ae00b9f5008d78b926340980b4728f4fd393d2ecd435d2902cd25aba50a8b98f5cdbfa651da75c8f164909bc4730be +SHA512 (Python-3.6.1.tar.xz) = 8605fb7019386fec227d4b06d06f00ae500a8a89df289bfe6141bb56196c75483a60cc0ee553930742b31cefce68add5ccf226e0f27b7b915f5026d597e1ac29 From bea97d96d29c1893f4c695da96a9d62f69618ff6 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Wed, 5 Apr 2017 18:08:56 +0200 Subject: [PATCH 323/416] Since upstream issue 23968, the platform directory changed to include the architectures, however patch205 was not updated to reflect that and as a result the Makefile and various other files were installed at another directory (rhbz#1438219). This commit updates the patch205 so the files are installed at the correct locations. --- 00205-make-libpl-respect-lib64.patch | 2 +- python3.spec | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/00205-make-libpl-respect-lib64.patch b/00205-make-libpl-respect-lib64.patch index 4a6703b..3e7c797 100644 --- a/00205-make-libpl-respect-lib64.patch +++ b/00205-make-libpl-respect-lib64.patch @@ -6,7 +6,7 @@ diff -up Python-3.5.0/Makefile.pre.in.lib Python-3.5.0/Makefile.pre.in # Install the library and miscellaneous stuff needed for extending/embedding # This goes into $(exec_prefix) -LIBPL= @LIBPL@ -+LIBPL= $(LIBDEST)/config-$(LDVERSION) ++LIBPL= $(LIBDEST)/config-$(LDVERSION)-$(MULTIARCH) # pkgconfig directory LIBPC= $(LIBDIR)/pkgconfig diff --git a/python3.spec b/python3.spec index bcb9a92..9ab4201 100644 --- a/python3.spec +++ b/python3.spec @@ -123,7 +123,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 1%{?dist} +Release: 2%{?dist} License: Python Group: Development/Languages @@ -1441,8 +1441,8 @@ fi # "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 %{pylibdir}/config-%{LDVERSION_optimized}/ -%{pylibdir}/config-%{LDVERSION_optimized}/Makefile +%dir %{pylibdir}/config-%{LDVERSION_optimized}-%{_arch}-linux%{_gnu}/ +%{pylibdir}/config-%{LDVERSION_optimized}-%{_arch}-linux%{_gnu}/Makefile %dir %{_includedir}/python%{LDVERSION_optimized}/ %{_includedir}/python%{LDVERSION_optimized}/%{_pyconfig_h} @@ -1457,8 +1457,8 @@ fi %files devel %defattr(-,root,root) -%{pylibdir}/config-%{LDVERSION_optimized}/* -%exclude %{pylibdir}/config-%{LDVERSION_optimized}/Makefile +%{pylibdir}/config-%{LDVERSION_optimized}-%{_arch}-linux%{_gnu}/* +%exclude %{pylibdir}/config-%{LDVERSION_optimized}-%{_arch}-linux%{_gnu}/Makefile %{_includedir}/python%{LDVERSION_optimized}/*.h %exclude %{_includedir}/python%{LDVERSION_optimized}/%{_pyconfig_h} %doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit @@ -1607,7 +1607,7 @@ fi %endif # Analog of the -devel subpackage's files: -%{pylibdir}/config-%{LDVERSION_debug} +%{pylibdir}/config-%{LDVERSION_debug}-%{_arch}-linux%{_gnu} %{_includedir}/python%{LDVERSION_debug} %{_bindir}/python%{LDVERSION_debug}-config %{_libdir}/libpython%{LDVERSION_debug}.so @@ -1648,6 +1648,9 @@ fi # ====================================================== %changelog +* Wed Apr 05 2017 Charalampos Stratakis - 3.6.1-2 +- Install the Makefile in its proper location (rhbz#1438219) + * Wed Mar 22 2017 Iryna Shcherbina - 3.6.1-1 - Update to version 3.6.1 final From 3a35e0ba67ad2d10d7176f0c6f1285693b3092a6 Mon Sep 17 00:00:00 2001 From: Tomas Orsava Date: Thu, 13 Apr 2017 16:20:52 +0200 Subject: [PATCH 324/416] Rename python3.Xdm-config script from -debug to be arch specific (rhbz#1179073) --- python3.spec | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/python3.spec b/python3.spec index 9ab4201..a501288 100644 --- a/python3.spec +++ b/python3.spec @@ -123,7 +123,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 2%{?dist} +Release: 3%{?dist} License: Python Group: Development/Languages @@ -1099,7 +1099,7 @@ sed \ %endif # with_systemtap -# Rename the script that differs on different arches to arch specific name +# Rename the -devel script that differs on different arches to arch specific name mv %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-{,`uname -m`-}config echo -e '#!/bin/sh\nexec `dirname $0`/python%{LDVERSION_optimized}-`uname -m`-config "$@"' > \ %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-config @@ -1107,6 +1107,14 @@ echo '[ $? -eq 127 ] && echo "Could not find python%{LDVERSION_optimized}-`uname %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-config chmod +x %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-config +# Rename the -debug script that differs on different arches to arch specific name +mv %{buildroot}%{_bindir}/python%{LDVERSION_debug}-{,`uname -m`-}config +echo -e '#!/bin/sh\nexec `dirname $0`/python%{LDVERSION_debug}-`uname -m`-config "$@"' > \ + %{buildroot}%{_bindir}/python%{LDVERSION_debug}-config +echo '[ $? -eq 127 ] && echo "Could not find python%{LDVERSION_debug}-`uname -m`-config. Look around to see available arches." >&2' >> \ + %{buildroot}%{_bindir}/python%{LDVERSION_debug}-config + chmod +x %{buildroot}%{_bindir}/python%{LDVERSION_debug}-config + # System Python: Copy the executable to libexec mkdir -p %{buildroot}%{_libexecdir} cp %{buildroot}%{_bindir}/python%{pybasever} %{buildroot}%{_libexecdir}/system-python @@ -1610,6 +1618,7 @@ fi %{pylibdir}/config-%{LDVERSION_debug}-%{_arch}-linux%{_gnu} %{_includedir}/python%{LDVERSION_debug} %{_bindir}/python%{LDVERSION_debug}-config +%{_bindir}/python%{LDVERSION_debug}-*-config %{_libdir}/libpython%{LDVERSION_debug}.so %{_libdir}/libpython%{LDVERSION_debug}.so.1.0 %{_libdir}/pkgconfig/python-%{LDVERSION_debug}.pc @@ -1648,6 +1657,10 @@ fi # ====================================================== %changelog +* Thu Apr 13 2017 Tomas Orsava - 3.6.1-3 +- Rename python3.Xdm-config script from -debug to be arch specific +Resolves: rhbz#1179073 + * Wed Apr 05 2017 Charalampos Stratakis - 3.6.1-2 - Install the Makefile in its proper location (rhbz#1438219) From 3f69bcd6281fb23f32c2a1bab786dba3ff25c697 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Tue, 18 Apr 2017 13:48:56 +0200 Subject: [PATCH 325/416] Enable link time optimizations --- python3.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/python3.spec b/python3.spec index a501288..8fff5ba 100644 --- a/python3.spec +++ b/python3.spec @@ -760,6 +760,7 @@ BuildPython() { --with-system-ffi \ --enable-loadable-sqlite-extensions \ --with-dtrace \ + --with-lto \ %if 0%{?with_systemtap} --with-systemtap \ %endif From bbbc440d2ceeb415c96bce032a266cad6450e911 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Tue, 18 Apr 2017 13:51:54 +0200 Subject: [PATCH 326/416] system-python-libs subpackage was shipping some windows executables which are used as templates, for creating windows installers for python modules. These executables are moved to the devel subpackage. Resolves: rhbz#1426257 --- python3.spec | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/python3.spec b/python3.spec index 8fff5ba..996c52e 100644 --- a/python3.spec +++ b/python3.spec @@ -123,7 +123,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 3%{?dist} +Release: 4%{?dist} License: Python Group: Development/Languages @@ -1403,7 +1403,7 @@ fi %{pylibdir}/distutils/__pycache__/*%{bytecode_suffixes} %{pylibdir}/distutils/README %{pylibdir}/distutils/command - +%exclude %{pylibdir}/distutils/command/wininst-*.exe %dir %{pylibdir}/email/ %dir %{pylibdir}/email/__pycache__/ @@ -1468,6 +1468,7 @@ fi %defattr(-,root,root) %{pylibdir}/config-%{LDVERSION_optimized}-%{_arch}-linux%{_gnu}/* %exclude %{pylibdir}/config-%{LDVERSION_optimized}-%{_arch}-linux%{_gnu}/Makefile +%{pylibdir}/distutils/command/wininst-*.exe %{_includedir}/python%{LDVERSION_optimized}/*.h %exclude %{_includedir}/python%{LDVERSION_optimized}/%{_pyconfig_h} %doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit @@ -1658,6 +1659,10 @@ fi # ====================================================== %changelog +* Tue Apr 18 2017 Charalampos Stratakis - 3.6.1-4 +- Enable link time optimizations +- Move windows executables to the devel subpackage (rhbz#1426257) + * Thu Apr 13 2017 Tomas Orsava - 3.6.1-3 - Rename python3.Xdm-config script from -debug to be arch specific Resolves: rhbz#1179073 From 31fe33b583978fe0075269527bf0eba08d233db9 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Sat, 6 May 2017 23:27:11 +0200 Subject: [PATCH 327/416] Update PEP 538 to the latest upstream implementation --- 00262-pep538_coerce_legacy_c_locale.patch | 328 ++++++++++++++-------- python3.spec | 5 +- 2 files changed, 222 insertions(+), 111 deletions(-) diff --git a/00262-pep538_coerce_legacy_c_locale.patch b/00262-pep538_coerce_legacy_c_locale.patch index a13b644..462f2aa 100644 --- a/00262-pep538_coerce_legacy_c_locale.patch +++ b/00262-pep538_coerce_legacy_c_locale.patch @@ -1,34 +1,39 @@ diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst -index c0e64d6..0bb28da 100644 +index 195f63f..0d0a127 100644 --- a/Doc/using/cmdline.rst +++ b/Doc/using/cmdline.rst -@@ -711,6 +711,35 @@ conflict. +@@ -713,6 +713,40 @@ conflict. .. versionadded:: 3.6 + +.. envvar:: PYTHONCOERCECLOCALE + -+ If set to a non-empty string, causes the main Python command line application ++ If set to the value ``0``, causes the main Python command line application + to skip coercing the legacy ASCII-based C locale to a more capable UTF-8 + based alternative. Note that this setting is checked even when the + :option:`-E` or :option:`-I` options are used, as it is handled prior to + the processing of command line options. + -+ If this variable is *not* set, and the current locale reported for the -+ ``LC_CTYPE`` category is the default ``C`` locale, then the Python CLI will -+ attempt to configure one of the following locales for the given locale -+ categories before loading the interpreter runtime: ++ If this variable is *not* set, or is set to a value other than ``0``, and ++ the current locale reported for the ``LC_CTYPE`` category is the default ++ ``C`` locale, then the Python CLI will attempt to configure one of the ++ following locales for the given locale categories before loading the ++ interpreter runtime: + -+ * ``C.UTF-8` (``LC_ALL``) -+ * ``C.utf8` (``LC_ALL``) -+ * ``UTF-8` (``LC_CTYPE``) ++ * ``C.UTF-8`` (``LC_ALL``) ++ * ``C.utf8`` (``LC_ALL``) ++ * ``UTF-8`` (``LC_CTYPE``) + + If setting one of these locale categories succeeds, then the matching -+ environment variables will be set (both ``LC_ALL` and ``LANG`` for the -+ ``LC_ALL`` category, and ``LC_CTYPE`` for the ``LC_CTYPE`` category), -+ and (if not already set to a non-empty string) :envvar:`PYTHONIOENCODING` -+ will be set to ``utf-8:surrogateescape``. ++ environment variables will be set (both ``LC_ALL`` and ``LANG`` for the ++ ``LC_ALL`` category, and ``LC_CTYPE`` for the ``LC_CTYPE`` category) in ++ the current process environment before the Python runtime is initialized. ++ ++ Configuring one of these locales (either explicitly or via the above ++ implicit locale coercion) will automatically set the error handler for ++ :data:`sys.stdin` and :data:`sys.stdout` to ``surrogateescape``. This ++ behavior can be overridden using :envvar:`PYTHONIOENCODING` as usual. + + Availability: \*nix + @@ -39,7 +44,7 @@ index c0e64d6..0bb28da 100644 ~~~~~~~~~~~~~~~~~~~~ diff --git a/Lib/test/support/script_helper.py b/Lib/test/support/script_helper.py -index 80889b1..1a1a862 100644 +index ca5f9c2..7aa460b 100644 --- a/Lib/test/support/script_helper.py +++ b/Lib/test/support/script_helper.py @@ -51,8 +51,35 @@ def interpreter_requires_environment(): @@ -80,7 +85,7 @@ index 80889b1..1a1a862 100644 # Executing the interpreter in a subprocess -@@ -99,30 +126,7 @@ def run_python_until_end(*args, **env_vars): +@@ -110,30 +137,7 @@ def run_python_until_end(*args, **env_vars): def _assert_python(expected_success, *args, **env_vars): res, cmd_line = run_python_until_end(*args, **env_vars) if (res.rc and expected_success) or (not res.rc and not expected_success): @@ -113,10 +118,28 @@ index 80889b1..1a1a862 100644 def assert_python_ok(*args, **env_vars): diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py -index 2a53f3d..ece84af 100644 +index 2a53f3d..391ca15 100644 --- a/Lib/test/test_capi.py +++ b/Lib/test/test_capi.py -@@ -386,7 +386,7 @@ class EmbeddingTests(unittest.TestCase): +@@ -369,14 +369,15 @@ class EmbeddingTests(unittest.TestCase): + def tearDown(self): + os.chdir(self.oldcwd) + +- def run_embedded_interpreter(self, *args): ++ def run_embedded_interpreter(self, *args, env=None): + """Runs a test in the embedded interpreter""" + cmd = [self.test_exe] + cmd.extend(args) + p = subprocess.Popen(cmd, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, +- universal_newlines=True) ++ universal_newlines=True, ++ env=env) + (out, err) = p.communicate() + self.assertEqual(p.returncode, 0, + "bad returncode %d, stderr is %r" % +@@ -386,7 +387,7 @@ class EmbeddingTests(unittest.TestCase): def test_subinterps(self): # This is just a "don't crash" test out, err = self.run_embedded_interpreter("repeated_init_and_subinterpreters") @@ -125,11 +148,14 @@ index 2a53f3d..ece84af 100644 print() print(out) print(err) -@@ -404,14 +404,15 @@ class EmbeddingTests(unittest.TestCase): +@@ -403,13 +404,14 @@ class EmbeddingTests(unittest.TestCase): + def test_forced_io_encoding(self): # Checks forced configuration of embedded interpreter IO streams - out, err = self.run_embedded_interpreter("forced_io_encoding") +- out, err = self.run_embedded_interpreter("forced_io_encoding") - if support.verbose: ++ env = {"PYTHONIOENCODING": "UTF-8:surrogateescape"} ++ out, err = self.run_embedded_interpreter("forced_io_encoding", env=env) + if support.verbose > 1: print() print(out) @@ -140,12 +166,9 @@ index 2a53f3d..ece84af 100644 + expected_stdin_encoding = "UTF-8" expected_pipe_encoding = self._get_default_pipe_encoding() expected_output = '\n'.join([ -+ "Setting PYTHONIOENCODING=UTF-8:surrogateescape", "--- Use defaults ---", - "Expected encoding: default", - "Expected errors: default", diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py -index b71bb9f..56867fc 100644 +index ae2bcd4..0a302ff 100644 --- a/Lib/test/test_cmd_line.py +++ b/Lib/test/test_cmd_line.py @@ -9,8 +9,9 @@ import sys @@ -181,7 +204,7 @@ index df9ebd4..63145e4 100644 'import sys', 'def dump(name):', diff --git a/Programs/_testembed.c b/Programs/_testembed.c -index a68d4fa..1494452 100644 +index a68d4fa..e28de1c 100644 --- a/Programs/_testembed.c +++ b/Programs/_testembed.c @@ -1,4 +1,5 @@ @@ -191,17 +214,7 @@ index a68d4fa..1494452 100644 #include /********************************************************* -@@ -106,6 +107,9 @@ static void check_stdio_details(const char *encoding, const char * errors) - - static int test_forced_io_encoding(void) - { -+ /* Ensure consistent "defaults" */ -+ printf("Setting PYTHONIOENCODING=UTF-8:surrogateescape\n"); -+ setenv("PYTHONIOENCODING", "UTF-8:surrogateescape", 1); - /* Check various combinations */ - printf("--- Use defaults ---\n"); - check_stdio_details(NULL, NULL); -@@ -126,6 +130,20 @@ static int test_forced_io_encoding(void) +@@ -126,6 +127,20 @@ static int test_forced_io_encoding(void) return 0; } @@ -222,7 +235,7 @@ index a68d4fa..1494452 100644 /* ********************************************************* * List of test cases and the function that implements it. * -@@ -147,6 +165,7 @@ struct TestCase +@@ -147,6 +162,7 @@ struct TestCase static struct TestCase TestCases[] = { { "forced_io_encoding", test_forced_io_encoding }, { "repeated_init_and_subinterpreters", test_repeated_init_and_subinterpreters }, @@ -231,14 +244,14 @@ index a68d4fa..1494452 100644 }; diff --git a/Programs/python.c b/Programs/python.c -index a7afbc7..b5edebb 100644 +index a7afbc7..03f8295 100644 --- a/Programs/python.c +++ b/Programs/python.c -@@ -15,6 +15,110 @@ wmain(int argc, wchar_t **argv) +@@ -15,6 +15,21 @@ wmain(int argc, wchar_t **argv) } #else -+/* Helpers to better handle the legacy C locale ++/* Access private pylifecycle helper API to better handle the legacy C locale + * + * The legacy C locale assumes ASCII as the default text encoding, which + * causes problems not only for the CPython runtime, but also other @@ -250,11 +263,100 @@ index a7afbc7..b5edebb 100644 + * See the documentation of the PYTHONCOERCECLOCALE setting for more details. + * + */ ++extern int _Py_LegacyLocaleDetected(void); ++extern void _Py_CoerceLegacyLocale(void); + -+#ifdef PY_COERCE_C_LOCALE -+static const char *_C_LOCALE_COERCION_WARNING = -+ "Python detected LC_CTYPE=C: %.20s coerced to %.20s (set another locale " -+ "or PYTHONCOERCECLOCALE=0 to disable this locale coercion behaviour).\n"; + int + main(int argc, char **argv) + { +@@ -25,7 +40,11 @@ main(int argc, char **argv) + char *oldloc; + + /* Force malloc() allocator to bootstrap Python */ ++#ifdef Py_DEBUG ++ (void)_PyMem_SetupAllocators("malloc_debug"); ++# else + (void)_PyMem_SetupAllocators("malloc"); ++# endif + + argv_copy = (wchar_t **)PyMem_RawMalloc(sizeof(wchar_t*) * (argc+1)); + argv_copy2 = (wchar_t **)PyMem_RawMalloc(sizeof(wchar_t*) * (argc+1)); +@@ -49,7 +68,21 @@ main(int argc, char **argv) + return 1; + } + ++#ifdef __ANDROID__ ++ /* Passing "" to setlocale() on Android requests the C locale rather ++ * than checking environment variables, so request C.UTF-8 explicitly ++ */ ++ setlocale(LC_ALL, "C.UTF-8"); ++#else ++ /* Reconfigure the locale to the default for this process */ + setlocale(LC_ALL, ""); ++#endif ++ ++ if (_Py_LegacyLocaleDetected()) { ++ _Py_CoerceLegacyLocale(); ++ } ++ ++ /* Convert from char to wchar_t based on the locale settings */ + for (i = 0; i < argc; i++) { + argv_copy[i] = Py_DecodeLocale(argv[i], NULL); + if (!argv_copy[i]) { +@@ -70,7 +103,11 @@ main(int argc, char **argv) + + /* Force again malloc() allocator to release memory blocks allocated + before Py_Main() */ ++#ifdef Py_DEBUG ++ (void)_PyMem_SetupAllocators("malloc_debug"); ++# else + (void)_PyMem_SetupAllocators("malloc"); ++# endif + + for (i = 0; i < argc; i++) { + PyMem_RawFree(argv_copy2[i]); +diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c +index a4f7f82..261ed34 100644 +--- a/Python/pylifecycle.c ++++ b/Python/pylifecycle.c +@@ -167,6 +167,7 @@ Py_SetStandardStreamEncoding(const char *encoding, const char *errors) + return 0; + } + ++ + /* Global initializations. Can be undone by Py_FinalizeEx(). Don't + call this twice without an intervening Py_FinalizeEx() call. When + initializations fail, a fatal error is issued and the function does +@@ -301,6 +302,173 @@ import_init(PyInterpreterState *interp, PyObject *sysmod) + } + + ++/* Helper functions to better handle the legacy C locale ++ * ++ * The legacy C locale assumes ASCII as the default text encoding, which ++ * causes problems not only for the CPython runtime, but also other ++ * components like GNU readline. ++ * ++ * Accordingly, when the CLI detects it, it attempts to coerce it to a ++ * more capable UTF-8 based alternative as follows: ++ * ++ * if (_Py_LegacyLocaleDetected()) { ++ * _Py_CoerceLegacyLocale(); ++ * } ++ * ++ * See the documentation of the PYTHONCOERCECLOCALE setting for more details. ++ * ++ * Locale coercion also impacts the default error handler for the standard ++ * streams: while the usual default is "strict", the default for the legacy ++ * C locale and for any of the coercion target locales is "surrogateescape". ++ */ ++ ++int ++_Py_LegacyLocaleDetected(void) ++{ ++ const char *ctype_loc = setlocale(LC_CTYPE, NULL); ++ return ctype_loc != NULL && strcmp(ctype_loc, "C") == 0; ++} + +typedef struct _CandidateLocale { + const char *locale_name; @@ -268,7 +370,35 @@ index a7afbc7..b5edebb 100644 + { NULL, 0 } +}; + -+void ++static char * ++get_default_standard_stream_error_handler(void) ++{ ++ const char *ctype_loc = setlocale(LC_CTYPE, NULL); ++ if (ctype_loc != NULL) { ++ /* "surrogateescape" is the default in the legacy C locale */ ++ if (strcmp(ctype_loc, "C") == 0) { ++ return "surrogateescape"; ++ } ++ ++ /* "surrogateescape" is the default in locale coercion target locales */ ++ const _LocaleCoercionTarget *target = NULL; ++ for (target = _TARGET_LOCALES; target->locale_name; target++) { ++ if (strcmp(ctype_loc, target->locale_name) == 0) { ++ return "surrogateescape"; ++ } ++ } ++ } ++ ++ /* Otherwise return NULL to request the typical default error handler */ ++ return NULL; ++} ++ ++#ifdef PY_COERCE_C_LOCALE ++static const char *_C_LOCALE_COERCION_WARNING = ++ "Python detected LC_CTYPE=C: %.20s coerced to %.20s (set another locale " ++ "or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior).\n"; ++ ++static void +_coerce_default_locale_settings(const _LocaleCoercionTarget *target) +{ + const char *newloc = target->locale_name; @@ -303,28 +433,36 @@ index a7afbc7..b5edebb 100644 + return; + } + -+ /* Set PYTHONIOENCODING if not already set */ -+ if (setenv("PYTHONIOENCODING", "utf-8:surrogateescape", 0)) { -+ fprintf(stderr, -+ "Error setting PYTHONIOENCODING during C locale coercion\n"); -+ } -+ + /* Reconfigure with the overridden environment variables */ + setlocale(LC_ALL, ""); +} + -+void -+_handle_legacy_c_locale(void) ++static int ++c_locale_coercion_is_expected(void) +{ ++ /* This may be called prior to Py_Initialize, so we don't call any other ++ * Python APIs, and we ignore the -E and -I flags ++ */ + const char *coerce_c_locale = getenv("PYTHONCOERCECLOCALE"); -+ /* We ignore the Python -E and -I flags here, as we need to sort out ++ if (coerce_c_locale == NULL || strncmp(coerce_c_locale, "0", 2) != 0) { ++ return 1; ++ } ++ return 0; ++} ++#endif ++ ++void ++_Py_CoerceLegacyLocale(void) ++{ ++#ifdef PY_COERCE_C_LOCALE ++ /* We ignore the Python -E and -I flags here, as the CLI needs to sort out + * the locale settings *before* we try to do anything with the command + * line arguments. For cross-platform debugging purposes, we also need + * to give end users a way to force even scripts that are otherwise + * isolated from their environment to use the legacy ASCII-centric C + * locale. + */ -+ if (coerce_c_locale == NULL || strncmp(coerce_c_locale, "0", 2) != 0) { ++ if (c_locale_coercion_is_expected()) { + /* PYTHONCOERCECLOCALE is not set, or is not set to exactly "0" */ + const _LocaleCoercionTarget *target = NULL; + for (target = _TARGET_LOCALES; target->locale_name; target++) { @@ -336,50 +474,12 @@ index a7afbc7..b5edebb 100644 + return; + } + } -+ + } + /* No C locale warning here, as Py_Initialize will emit one later */ ++#endif +} -+#endif + - int - main(int argc, char **argv) - { -@@ -49,7 +153,26 @@ main(int argc, char **argv) - return 1; - } - -+#ifdef __ANDROID__ -+ /* Passing "" to setlocale() on Android requests the C locale rather -+ * than checking environment variables, so request C.UTF-8 explicitly -+ */ -+ setlocale(LC_ALL, "C.UTF-8"); -+#else -+ /* Reconfigure the locale to the default for this process */ - setlocale(LC_ALL, ""); -+#endif + -+#ifdef PY_COERCE_C_LOCALE -+ /* When the LC_CTYPE category still claims to be using the C locale, -+ assume configuration error and try for a UTF-8 based locale instead */ -+ const char *ctype_loc = setlocale(LC_CTYPE, NULL); -+ if (ctype_loc != NULL && strcmp(ctype_loc, "C") == 0) { -+ _handle_legacy_c_locale(); -+ } -+#endif -+ -+ /* Convert from char to wchar_t based on the locale settings */ - for (i = 0; i < argc; i++) { - argv_copy[i] = Py_DecodeLocale(argv[i], NULL); - if (!argv_copy[i]) { -diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c -index a4f7f82..dd58dc9 100644 ---- a/Python/pylifecycle.c -+++ b/Python/pylifecycle.c -@@ -301,6 +301,31 @@ import_init(PyInterpreterState *interp, PyObject *sysmod) - } - - +#ifdef PY_WARN_ON_C_LOCALE +static const char *_C_LOCALE_WARNING = + "Python runtime initialized with LC_CTYPE=C (a locale with default ASCII " @@ -390,15 +490,8 @@ index a4f7f82..dd58dc9 100644 +static void +_emit_stderr_warning_for_c_locale(void) +{ -+ const char *coerce_c_locale = getenv("PYTHONCOERCECLOCALE"); -+ /* We don't emit a warning if locale coercion has been explicitly disabled. -+ * -+ * For consistency with the corresponding check in Programs/python.c -+ * we ignore the Python -E and -I flags here. -+ */ -+ if (coerce_c_locale == NULL || strncmp(coerce_c_locale, "0", 2) != 0) { -+ const char *ctype_loc = setlocale(LC_CTYPE, NULL); -+ if (ctype_loc != NULL && strcmp(ctype_loc, "C") == 0) { ++ if (c_locale_coercion_is_expected()) { ++ if (_Py_LegacyLocaleDetected()) { + fprintf(stderr, "%s", _C_LOCALE_WARNING); + } + } @@ -408,7 +501,7 @@ index a4f7f82..dd58dc9 100644 void _Py_InitializeEx_Private(int install_sigs, int install_importlib) { -@@ -315,11 +340,19 @@ _Py_InitializeEx_Private(int install_sigs, int install_importlib) +@@ -315,11 +483,19 @@ _Py_InitializeEx_Private(int install_sigs, int install_importlib) initialized = 1; _Py_Finalizing = NULL; @@ -429,8 +522,23 @@ index a4f7f82..dd58dc9 100644 #endif if ((p = Py_GETENV("PYTHONDEBUG")) && *p != '\0') +@@ -1242,12 +1418,8 @@ initstdio(void) + } + } + if (!errors && !(pythonioencoding && *pythonioencoding)) { +- /* When the LC_CTYPE locale is the POSIX locale ("C locale"), +- stdin and stdout use the surrogateescape error handler by +- default, instead of the strict error handler. */ +- char *loc = setlocale(LC_CTYPE, NULL); +- if (loc != NULL && strcmp(loc, "C") == 0) +- errors = "surrogateescape"; ++ /* Choose the default error handler based on the current locale */ ++ errors = get_default_standard_stream_error_handler(); + } + } + diff --git a/configure b/configure -index 6bcddb7..13052d6 100755 +index 2915246..39e5a27 100755 --- a/configure +++ b/configure @@ -834,6 +834,8 @@ with_thread @@ -455,7 +563,7 @@ index 6bcddb7..13052d6 100755 --with-valgrind Enable Valgrind support --with(out)-dtrace disable/enable DTrace support --with-fpectl enable SIGFPE catching -@@ -11016,6 +11024,52 @@ fi +@@ -11010,6 +11018,52 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_pymalloc" >&5 $as_echo "$with_pymalloc" >&6; } @@ -509,10 +617,10 @@ index 6bcddb7..13052d6 100755 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-valgrind" >&5 $as_echo_n "checking for --with-valgrind... " >&6; } diff --git a/configure.ac b/configure.ac -index e222c21..a1653e7 100644 +index 67dfba3..b9c9f04 100644 --- a/configure.ac +++ b/configure.ac -@@ -3287,6 +3287,40 @@ then +@@ -3279,6 +3279,40 @@ then fi AC_MSG_RESULT($with_pymalloc) @@ -554,10 +662,10 @@ index e222c21..a1653e7 100644 AC_MSG_CHECKING([for --with-valgrind]) AC_ARG_WITH([valgrind], diff --git a/pyconfig.h.in b/pyconfig.h.in -index e7a836c..11e0798 100644 +index b10c57f..0a6f3e2 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in -@@ -1241,9 +1241,15 @@ +@@ -1244,9 +1244,15 @@ /* Define as the preferred size in bits of long digits */ #undef PYLONG_BITS_IN_DIGIT diff --git a/python3.spec b/python3.spec index 996c52e..aec30b2 100644 --- a/python3.spec +++ b/python3.spec @@ -123,7 +123,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 4%{?dist} +Release: 5%{?dist} License: Python Group: Development/Languages @@ -1659,6 +1659,9 @@ fi # ====================================================== %changelog +* Fri May 05 2017 Charalampos Stratakis - 3.6.1-5 +- Update PEP 538 to the latest upstream implementation + * Tue Apr 18 2017 Charalampos Stratakis - 3.6.1-4 - Enable link time optimizations - Move windows executables to the devel subpackage (rhbz#1426257) From 62458614805e7f14d98b55730d0358dd8bdf7e43 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Tue, 9 May 2017 11:43:22 +0200 Subject: [PATCH 328/416] Change description, to reflect that python3 is now the default Python Also enhance verbosity for the descriptions of subpackages --- python3.spec | 65 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 43 insertions(+), 22 deletions(-) diff --git a/python3.spec b/python3.spec index aec30b2..9a29f09 100644 --- a/python3.spec +++ b/python3.spec @@ -491,13 +491,24 @@ Requires: python3-pip %endif %description -Python 3 is a new version of the language that is incompatible with the 2.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. +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 python3-docs package. + +This package provides the "python3" executable; most of the actual +implementation is within the "python3-libs" and "system-python-libs" packages. %package libs -Summary: Python 3 runtime libraries +Summary: Python runtime libraries Group: Development/Libraries # For Modularity purpose we need not to include the dist-tag int he dependency %if %(d="%{?dist}"; [ "${d#module-base-runtime-}x" != "${d}x" ] && echo 1 || echo 0) @@ -515,7 +526,10 @@ Provides: python3-enum34 = 1.0.4-5%{?dist} Obsoletes: python3-enum34 < 1.0.4-5%{?dist} %description libs -This package contains files used to embed Python 3 into applications. +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 "python3" executable +- the Python standard library %package -n system-python Summary: System Python executable @@ -542,7 +556,7 @@ Requires: glibc%{?_isa} >= 2.24.90-26 This package contains files used to embed System Python into applications. %package devel -Summary: Libraries and header files needed for Python 3 development +Summary: Libraries and header files needed for Python development Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: %{name}-libs%{?_isa} = %{version}-%{release} @@ -552,29 +566,36 @@ Requires: python3-rpm-macros Conflicts: %{name} < %{version}-%{release} %description devel -This package contains libraries and header files used to build applications -with and native libraries for Python 3 +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 python3-devel if you want to develop Python extensions. The +python3 package will also need to be installed. You'll probably also +want to install the python3-docs package, which contains Python +documentation. %package tools -Summary: A collection of tools included with Python 3 +Summary: A collection of tools included with Python Group: Development/Tools Requires: %{name} = %{version}-%{release} Requires: %{name}-tkinter = %{version}-%{release} %description tools -This package contains several tools included with Python 3 +This package contains several tools included with Python %package tkinter -Summary: A GUI toolkit for Python 3 +Summary: A GUI toolkit for Python Group: Development/Languages Requires: %{name} = %{version}-%{release} %description tkinter -The Tkinter (Tk interface) program is an graphical user interface for +The Tkinter (Tk interface) program is a graphical user interface for the Python scripting language. %package test -Summary: The test modules from the main python 3 package +Summary: The test modules from the main python3 package Group: Development/Languages Requires: %{name} = %{version}-%{release} Requires: %{name}-tools = %{version}-%{release} @@ -585,11 +606,11 @@ These are in a separate package to save space, as they are almost never used in production. You might want to install the python3-test package if you're developing -python 3 code that uses more than just unittest and/or test_support.py. +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 3 runtime +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 @@ -603,20 +624,20 @@ Requires: %{name}-tkinter%{?_isa} = %{version}-%{release} Requires: %{name}-tools%{?_isa} = %{version}-%{release} %description debug -python3-debug provides a version of the Python 3 runtime with numerous debugging +python3-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 3 build, +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 -versions of Python 3, but the debugging features mean that C/C++ extension +versions 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 3 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 3 implementation +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 From 51bb7c4cc20ee7e52adfa7bc5ad80ef5937323e3 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Tue, 9 May 2017 14:44:40 +0200 Subject: [PATCH 329/416] Update to a newer implementation of PEP 538 --- 00262-pep538_coerce_legacy_c_locale.patch | 420 +++++++++++++++++----- 1 file changed, 330 insertions(+), 90 deletions(-) diff --git a/00262-pep538_coerce_legacy_c_locale.patch b/00262-pep538_coerce_legacy_c_locale.patch index 462f2aa..7802567 100644 --- a/00262-pep538_coerce_legacy_c_locale.patch +++ b/00262-pep538_coerce_legacy_c_locale.patch @@ -1,5 +1,5 @@ diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst -index 195f63f..0d0a127 100644 +index 08dc311..c6ec147 100644 --- a/Doc/using/cmdline.rst +++ b/Doc/using/cmdline.rst @@ -713,6 +713,40 @@ conflict. @@ -44,10 +44,10 @@ index 195f63f..0d0a127 100644 ~~~~~~~~~~~~~~~~~~~~ diff --git a/Lib/test/support/script_helper.py b/Lib/test/support/script_helper.py -index ca5f9c2..7aa460b 100644 +index 1e74647..b3ac848 100644 --- a/Lib/test/support/script_helper.py +++ b/Lib/test/support/script_helper.py -@@ -51,8 +51,35 @@ def interpreter_requires_environment(): +@@ -48,8 +48,35 @@ def interpreter_requires_environment(): return __cached_interp_requires_environment @@ -85,7 +85,7 @@ index ca5f9c2..7aa460b 100644 # Executing the interpreter in a subprocess -@@ -110,30 +137,7 @@ def run_python_until_end(*args, **env_vars): +@@ -107,30 +134,7 @@ def run_python_until_end(*args, **env_vars): def _assert_python(expected_success, *args, **env_vars): res, cmd_line = run_python_until_end(*args, **env_vars) if (res.rc and expected_success) or (not res.rc and not expected_success): @@ -117,11 +117,286 @@ index ca5f9c2..7aa460b 100644 return res def assert_python_ok(*args, **env_vars): +diff --git a/Lib/test/test_c_locale_coercion.py b/Lib/test/test_c_locale_coercion.py +new file mode 100644 +index 0000000..ad6ecac +--- /dev/null ++++ b/Lib/test/test_c_locale_coercion.py +@@ -0,0 +1,269 @@ ++# Tests the attempted automatic coercion of the C locale to a UTF-8 locale ++ ++import unittest ++import os ++import sys ++import sysconfig ++import shutil ++import subprocess ++from collections import namedtuple ++ ++import test.support ++from test.support.script_helper import ( ++ run_python_until_end, ++ interpreter_requires_environment, ++) ++ ++# In order to get the warning messages to match up as expected, the candidate ++# order here must much the target locale order in Python/pylifecycle.c ++_C_UTF8_LOCALES = ( ++ # Entries: (Target locale, expected env var updates) ++ ("C.UTF-8", "LC_CTYPE & LANG"), ++ ("C.utf8", "LC_CTYPE & LANG"), ++ ("UTF-8", "LC_CTYPE"), ++) ++ ++# There's no reliable cross-platform way of checking locale alias ++# lists, so the only way of knowing which of these locales will work ++# is to try them with locale.setlocale(). We do that in a subprocess ++# to avoid altering the locale of the test runner. ++def _set_locale_in_subprocess(locale_name): ++ cmd_fmt = "import locale; print(locale.setlocale(locale.LC_CTYPE, '{}'))" ++ cmd = cmd_fmt.format(locale_name) ++ result, py_cmd = run_python_until_end("-c", cmd, __isolated=True) ++ return result.rc == 0 ++ ++_EncodingDetails = namedtuple("EncodingDetails", ++ "fsencoding stdin_info stdout_info stderr_info") ++ ++class EncodingDetails(_EncodingDetails): ++ CHILD_PROCESS_SCRIPT = ";".join([ ++ "import sys", ++ "print(sys.getfilesystemencoding())", ++ "print(sys.stdin.encoding + ':' + sys.stdin.errors)", ++ "print(sys.stdout.encoding + ':' + sys.stdout.errors)", ++ "print(sys.stderr.encoding + ':' + sys.stderr.errors)", ++ ]) ++ ++ @classmethod ++ def get_expected_details(cls, expected_fsencoding): ++ """Returns expected child process details for a given encoding""" ++ _stream = expected_fsencoding + ":{}" ++ # stdin and stdout should use surrogateescape either because the ++ # coercion triggered, or because the C locale was detected ++ stream_info = 2*[_stream.format("surrogateescape")] ++ # stderr should always use backslashreplace ++ stream_info.append(_stream.format("backslashreplace")) ++ return dict(cls(expected_fsencoding, *stream_info)._asdict()) ++ ++ @staticmethod ++ def _handle_output_variations(data): ++ """Adjust the output to handle platform specific idiosyncrasies ++ ++ * Some platforms report ASCII as ANSI_X3.4-1968 ++ * Some platforms report ASCII as US-ASCII ++ * Some platforms report UTF-8 instead of utf-8 ++ """ ++ data = data.replace(b"ANSI_X3.4-1968", b"ascii") ++ data = data.replace(b"US-ASCII", b"ascii") ++ data = data.lower() ++ return data ++ ++ @classmethod ++ def get_child_details(cls, env_vars): ++ """Retrieves fsencoding and standard stream details from a child process ++ ++ Returns (encoding_details, stderr_lines): ++ ++ - encoding_details: EncodingDetails for eager decoding ++ - stderr_lines: result of calling splitlines() on the stderr output ++ ++ The child is run in isolated mode if the current interpreter supports ++ that. ++ """ ++ result, py_cmd = run_python_until_end( ++ "-c", cls.CHILD_PROCESS_SCRIPT, ++ __isolated=True, ++ **env_vars ++ ) ++ if not result.rc == 0: ++ result.fail(py_cmd) ++ # All subprocess outputs in this test case should be pure ASCII ++ adjusted_output = cls._handle_output_variations(result.out) ++ stdout_lines = adjusted_output.decode("ascii").rstrip().splitlines() ++ child_encoding_details = dict(cls(*stdout_lines)._asdict()) ++ stderr_lines = result.err.decode("ascii").rstrip().splitlines() ++ return child_encoding_details, stderr_lines ++ ++ ++class _ChildProcessEncodingTestCase(unittest.TestCase): ++ # Base class to check for expected encoding details in a child process ++ ++ def _check_child_encoding_details(self, ++ env_vars, ++ expected_fsencoding, ++ expected_warning): ++ """Check the C locale handling for the given process environment ++ ++ Parameters: ++ expected_fsencoding: the encoding the child is expected to report ++ allow_c_locale: setting to use for PYTHONALLOWCLOCALE ++ None: don't set the variable at all ++ str: the value set in the child's environment ++ """ ++ result = EncodingDetails.get_child_details(env_vars) ++ encoding_details, stderr_lines = result ++ self.assertEqual(encoding_details, ++ EncodingDetails.get_expected_details( ++ expected_fsencoding)) ++ self.assertEqual(stderr_lines, expected_warning) ++ ++# Details of the shared library warning emitted at runtime ++LIBRARY_C_LOCALE_WARNING = ( ++ "Python runtime initialized with LC_CTYPE=C (a locale with default ASCII " ++ "encoding), which may cause Unicode compatibility problems. Using C.UTF-8, " ++ "C.utf8, or UTF-8 (if available) as alternative Unicode-compatible " ++ "locales is recommended." ++) ++ ++@unittest.skipUnless(sysconfig.get_config_var("PY_WARN_ON_C_LOCALE"), ++ "C locale runtime warning disabled at build time") ++class LocaleWarningTests(_ChildProcessEncodingTestCase): ++ # Test warning emitted when running in the C locale ++ ++ def test_library_c_locale_warning(self): ++ self.maxDiff = None ++ for locale_to_set in ("C", "POSIX", "invalid.ascii"): ++ var_dict = { ++ "LC_ALL": locale_to_set ++ } ++ with self.subTest(forced_locale=locale_to_set): ++ self._check_child_encoding_details(var_dict, ++ "ascii", ++ [LIBRARY_C_LOCALE_WARNING]) ++ ++# Details of the CLI locale coercion warning emitted at runtime ++CLI_COERCION_WARNING_FMT = ( ++ "Python detected LC_CTYPE=C: {} coerced to {} (set another locale " ++ "or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior)." ++) ++ ++class _LocaleCoercionTargetsTestCase(_ChildProcessEncodingTestCase): ++ # Base class for test cases that rely on coercion targets being defined ++ ++ available_targets = [] ++ targets_required = True ++ ++ @classmethod ++ def setUpClass(cls): ++ first_target_locale = first_env_updates = None ++ available_targets = cls.available_targets ++ # Find the target locales available in the current system ++ for target_locale, env_updates in _C_UTF8_LOCALES: ++ if _set_locale_in_subprocess(target_locale): ++ available_targets.append(target_locale) ++ if first_target_locale is None: ++ first_target_locale = target_locale ++ first_env_updates = env_updates ++ if cls.targets_required and not available_targets: ++ raise unittest.SkipTest("No C-with-UTF-8 locale available") ++ # Expect coercion to use the first available locale ++ cls.EXPECTED_COERCION_WARNING = CLI_COERCION_WARNING_FMT.format( ++ first_env_updates, first_target_locale ++ ) ++ ++ ++class LocaleConfigurationTests(_LocaleCoercionTargetsTestCase): ++ # Test explicit external configuration via the process environment ++ ++ def test_external_target_locale_configuration(self): ++ # Explicitly setting a target locale should give the same behaviour as ++ # is seen when implicitly coercing to that target locale ++ self.maxDiff = None ++ ++ expected_warning = [] ++ expected_fsencoding = "utf-8" ++ ++ base_var_dict = { ++ "LANG": "", ++ "LC_CTYPE": "", ++ "LC_ALL": "", ++ } ++ for env_var in ("LANG", "LC_CTYPE"): ++ for locale_to_set in self.available_targets: ++ with self.subTest(env_var=env_var, ++ configured_locale=locale_to_set): ++ var_dict = base_var_dict.copy() ++ var_dict[env_var] = locale_to_set ++ self._check_child_encoding_details(var_dict, ++ expected_fsencoding, ++ expected_warning) ++ ++ ++ ++@test.support.cpython_only ++@unittest.skipUnless(sysconfig.get_config_var("PY_COERCE_C_LOCALE"), ++ "C locale coercion disabled at build time") ++class LocaleCoercionTests(_LocaleCoercionTargetsTestCase): ++ # Test implicit reconfiguration of the environment during CLI startup ++ ++ def _check_c_locale_coercion(self, expected_fsencoding, coerce_c_locale): ++ """Check the C locale handling for various configurations ++ ++ Parameters: ++ expected_fsencoding: the encoding the child is expected to report ++ allow_c_locale: setting to use for PYTHONALLOWCLOCALE ++ None: don't set the variable at all ++ str: the value set in the child's environment ++ """ ++ ++ # Check for expected warning on stderr if C locale is coerced ++ self.maxDiff = None ++ ++ expected_warning = [] ++ if coerce_c_locale != "0": ++ expected_warning.append(self.EXPECTED_COERCION_WARNING) ++ ++ base_var_dict = { ++ "LANG": "", ++ "LC_CTYPE": "", ++ "LC_ALL": "", ++ } ++ for env_var in ("LANG", "LC_CTYPE"): ++ for locale_to_set in ("", "C", "POSIX", "invalid.ascii"): ++ with self.subTest(env_var=env_var, ++ nominal_locale=locale_to_set, ++ PYTHONCOERCECLOCALE=coerce_c_locale): ++ var_dict = base_var_dict.copy() ++ var_dict[env_var] = locale_to_set ++ if coerce_c_locale is not None: ++ var_dict["PYTHONCOERCECLOCALE"] = coerce_c_locale ++ self._check_child_encoding_details(var_dict, ++ expected_fsencoding, ++ expected_warning) ++ ++ def test_test_PYTHONCOERCECLOCALE_not_set(self): ++ # This should coerce to the first available target locale by default ++ self._check_c_locale_coercion("utf-8", coerce_c_locale=None) ++ ++ def test_PYTHONCOERCECLOCALE_not_zero(self): ++ # *Any* string other that "0" is considered "set" for our purposes ++ # and hence should result in the locale coercion being enabled ++ for setting in ("", "1", "true", "false"): ++ self._check_c_locale_coercion("utf-8", coerce_c_locale=setting) ++ ++ def test_PYTHONCOERCECLOCALE_set_to_zero(self): ++ # The setting "0" should result in the locale coercion being disabled ++ self._check_c_locale_coercion("ascii", coerce_c_locale="0") ++ ++ ++def test_main(): ++ test.support.run_unittest( ++ LocaleConfigurationTests, ++ LocaleCoercionTests, ++ LocaleWarningTests ++ ) ++ test.support.reap_children() ++ ++if __name__ == "__main__": ++ test_main() diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py -index 2a53f3d..391ca15 100644 +index eb3e2c5..f677d88 100644 --- a/Lib/test/test_capi.py +++ b/Lib/test/test_capi.py -@@ -369,14 +369,15 @@ class EmbeddingTests(unittest.TestCase): +@@ -369,14 +369,15 @@ def setUp(self): def tearDown(self): os.chdir(self.oldcwd) @@ -139,7 +414,7 @@ index 2a53f3d..391ca15 100644 (out, err) = p.communicate() self.assertEqual(p.returncode, 0, "bad returncode %d, stderr is %r" % -@@ -386,7 +387,7 @@ class EmbeddingTests(unittest.TestCase): +@@ -386,7 +387,7 @@ def run_embedded_interpreter(self, *args): def test_subinterps(self): # This is just a "don't crash" test out, err = self.run_embedded_interpreter("repeated_init_and_subinterpreters") @@ -148,7 +423,7 @@ index 2a53f3d..391ca15 100644 print() print(out) print(err) -@@ -403,13 +404,14 @@ class EmbeddingTests(unittest.TestCase): +@@ -403,13 +404,14 @@ def _get_default_pipe_encoding(): def test_forced_io_encoding(self): # Checks forced configuration of embedded interpreter IO streams @@ -168,10 +443,10 @@ index 2a53f3d..391ca15 100644 expected_output = '\n'.join([ "--- Use defaults ---", diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py -index ae2bcd4..0a302ff 100644 +index 958d282..c4c6850 100644 --- a/Lib/test/test_cmd_line.py +++ b/Lib/test/test_cmd_line.py -@@ -9,8 +9,9 @@ import sys +@@ -8,8 +8,9 @@ import subprocess import tempfile from test.support import script_helper, is_android @@ -183,7 +458,7 @@ index ae2bcd4..0a302ff 100644 # XXX (ncoghlan): Move to script_helper and make consistent with run_python -@@ -151,6 +152,7 @@ class CmdLineTest(unittest.TestCase): +@@ -150,6 +151,7 @@ def test_undecodable_code(self): env = os.environ.copy() # Use C locale to get ascii for the locale encoding env['LC_ALL'] = 'C' @@ -192,10 +467,10 @@ index ae2bcd4..0a302ff 100644 b'import locale; ' b'print(ascii("' + undecodable + b'"), ' diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py -index df9ebd4..63145e4 100644 +index ed78e2a..3844812 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py -@@ -680,6 +680,7 @@ class SysModuleTest(unittest.TestCase): +@@ -682,6 +682,7 @@ def c_locale_get_error_handler(self, isolated=False, encoding=None): # Force the POSIX locale env = os.environ.copy() env["LC_ALL"] = "C" @@ -204,7 +479,7 @@ index df9ebd4..63145e4 100644 'import sys', 'def dump(name):', diff --git a/Programs/_testembed.c b/Programs/_testembed.c -index a68d4fa..e28de1c 100644 +index a68d4fa..280bf50 100644 --- a/Programs/_testembed.c +++ b/Programs/_testembed.c @@ -1,4 +1,5 @@ @@ -214,35 +489,6 @@ index a68d4fa..e28de1c 100644 #include /********************************************************* -@@ -126,6 +127,20 @@ static int test_forced_io_encoding(void) - return 0; - } - -+static int test_c_locale_warning(void) -+{ -+#ifdef PY_WARN_ON_C_LOCALE -+ /* Force use of the C locale */ -+ setenv("LC_ALL", "C", 1); -+ -+ _testembed_Py_Initialize(); -+ Py_Finalize(); -+#else -+ printf("C locale compatibility warning disabled at compile time\n"); -+#endif -+ return 0; -+} -+ - /* ********************************************************* - * List of test cases and the function that implements it. - * -@@ -147,6 +162,7 @@ struct TestCase - static struct TestCase TestCases[] = { - { "forced_io_encoding", test_forced_io_encoding }, - { "repeated_init_and_subinterpreters", test_repeated_init_and_subinterpreters }, -+ { "c_locale_warning", test_c_locale_warning }, - { NULL, NULL } - }; - diff --git a/Programs/python.c b/Programs/python.c index a7afbc7..03f8295 100644 --- a/Programs/python.c @@ -316,7 +562,7 @@ index a7afbc7..03f8295 100644 for (i = 0; i < argc; i++) { PyMem_RawFree(argv_copy2[i]); diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c -index a4f7f82..261ed34 100644 +index c0f41b3..278a5af 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -167,6 +167,7 @@ Py_SetStandardStreamEncoding(const char *encoding, const char *errors) @@ -327,7 +573,7 @@ index a4f7f82..261ed34 100644 /* Global initializations. Can be undone by Py_FinalizeEx(). Don't call this twice without an intervening Py_FinalizeEx() call. When initializations fail, a fatal error is issued and the function does -@@ -301,6 +302,173 @@ import_init(PyInterpreterState *interp, PyObject *sysmod) +@@ -302,6 +303,167 @@ import_init(PyInterpreterState *interp, PyObject *sysmod) } @@ -359,14 +605,14 @@ index a4f7f82..261ed34 100644 +} + +typedef struct _CandidateLocale { -+ const char *locale_name; -+ int category; ++ const char *locale_name; /* The locale to try as a coercion target */ ++ int set_LANG; /* Whether to set LANG in addition to LC_CTYPE */ +} _LocaleCoercionTarget; + +static _LocaleCoercionTarget _TARGET_LOCALES[] = { -+ { "C.UTF-8", LC_ALL }, -+ { "C.utf8", LC_ALL }, -+ { "UTF-8", LC_CTYPE }, ++ { "C.UTF-8", 1 }, ++ { "C.utf8", 1}, ++ { "UTF-8", 0 }, + { NULL, 0 } +}; + @@ -401,37 +647,27 @@ index a4f7f82..261ed34 100644 +static void +_coerce_default_locale_settings(const _LocaleCoercionTarget *target) +{ ++ const char *env_vars_updated = "LC_CTYPE"; + const char *newloc = target->locale_name; -+ int category = target->category; + + /* Reset locale back to currently configured defaults */ + setlocale(LC_ALL, ""); + + /* Set the relevant locale environment variables */ -+ if (category == LC_ALL) { -+ const char *env_vars_updated = "LC_ALL & LANG"; -+ if (setenv("LC_ALL", newloc, 1)) { -+ fprintf(stderr, -+ "Error setting LC_ALL, skipping C locale coercion\n"); -+ return; -+ } -+ if (setenv("LANG", newloc, 1)) { -+ fprintf(stderr, -+ "Error setting LANG during C locale coercion\n"); -+ env_vars_updated = "LC_ALL"; -+ } -+ fprintf(stderr, _C_LOCALE_COERCION_WARNING, env_vars_updated, newloc); -+ } else if (category == LC_CTYPE) { -+ if (setenv("LC_CTYPE", newloc, 1)) { -+ fprintf(stderr, -+ "Error setting LC_CTYPE, skipping C locale coercion\n"); -+ return; -+ } -+ fprintf(stderr, _C_LOCALE_COERCION_WARNING, "LC_CTYPE", newloc); -+ } else { -+ fprintf(stderr, "Locale coercion must target LC_ALL or LC_CTYPE\n"); ++ if (setenv("LC_CTYPE", newloc, 1)) { ++ fprintf(stderr, ++ "Error setting LC_CTYPE, skipping C locale coercion\n"); + return; + } ++ if (target->set_LANG) { ++ if (setenv("LANG", newloc, 1) == 0) { ++ env_vars_updated = "LC_CTYPE & LANG"; ++ } else { ++ fprintf(stderr, ++ "Error setting LANG during C locale coercion\n"); ++ } ++ } ++ fprintf(stderr, _C_LOCALE_COERCION_WARNING, env_vars_updated, newloc); + + /* Reconfigure with the overridden environment variables */ + setlocale(LC_ALL, ""); @@ -464,14 +700,18 @@ index a4f7f82..261ed34 100644 + */ + if (c_locale_coercion_is_expected()) { + /* PYTHONCOERCECLOCALE is not set, or is not set to exactly "0" */ -+ const _LocaleCoercionTarget *target = NULL; -+ for (target = _TARGET_LOCALES; target->locale_name; target++) { -+ const char *reconfigured_locale = setlocale(target->category, -+ target->locale_name); -+ if (reconfigured_locale != NULL) { -+ /* Successfully configured locale, so make it the default */ -+ _coerce_default_locale_settings(target); -+ return; ++ const char *locale_override = getenv("LC_ALL"); ++ if (locale_override == NULL || *locale_override == '\0') { ++ /* LC_ALL is also not set (or is set to an empty string) */ ++ const _LocaleCoercionTarget *target = NULL; ++ for (target = _TARGET_LOCALES; target->locale_name; target++) { ++ const char *new_locale = setlocale(LC_CTYPE, ++ target->locale_name); ++ if (new_locale != NULL) { ++ /* Successfully configured locale, so make it the default */ ++ _coerce_default_locale_settings(target); ++ return; ++ } + } + } + } @@ -501,7 +741,7 @@ index a4f7f82..261ed34 100644 void _Py_InitializeEx_Private(int install_sigs, int install_importlib) { -@@ -315,11 +483,19 @@ _Py_InitializeEx_Private(int install_sigs, int install_importlib) +@@ -316,11 +478,19 @@ _Py_InitializeEx_Private(int install_sigs, int install_importlib) initialized = 1; _Py_Finalizing = NULL; @@ -522,7 +762,7 @@ index a4f7f82..261ed34 100644 #endif if ((p = Py_GETENV("PYTHONDEBUG")) && *p != '\0') -@@ -1242,12 +1418,8 @@ initstdio(void) +@@ -1252,12 +1422,8 @@ initstdio(void) } } if (!errors && !(pythonioencoding && *pythonioencoding)) { @@ -538,7 +778,7 @@ index a4f7f82..261ed34 100644 } diff --git a/configure b/configure -index 2915246..39e5a27 100755 +index c9340c6..8b1bd5b 100755 --- a/configure +++ b/configure @@ -834,6 +834,8 @@ with_thread @@ -550,7 +790,7 @@ index 2915246..39e5a27 100755 with_valgrind with_dtrace with_fpectl -@@ -1527,6 +1529,12 @@ Optional Packages: +@@ -1538,6 +1540,12 @@ Optional Packages: deprecated; use --with(out)-threads --with(out)-doc-strings disable/enable documentation strings --with(out)-pymalloc disable/enable specialized mallocs @@ -563,7 +803,7 @@ index 2915246..39e5a27 100755 --with-valgrind Enable Valgrind support --with(out)-dtrace disable/enable DTrace support --with-fpectl enable SIGFPE catching -@@ -11010,6 +11018,52 @@ fi +@@ -11030,6 +11038,52 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_pymalloc" >&5 $as_echo "$with_pymalloc" >&6; } @@ -617,10 +857,10 @@ index 2915246..39e5a27 100755 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-valgrind" >&5 $as_echo_n "checking for --with-valgrind... " >&6; } diff --git a/configure.ac b/configure.ac -index 67dfba3..b9c9f04 100644 +index e065ce5..c455ebd 100644 --- a/configure.ac +++ b/configure.ac -@@ -3279,6 +3279,40 @@ then +@@ -3304,6 +3304,40 @@ then fi AC_MSG_RESULT($with_pymalloc) @@ -662,10 +902,10 @@ index 67dfba3..b9c9f04 100644 AC_MSG_CHECKING([for --with-valgrind]) AC_ARG_WITH([valgrind], diff --git a/pyconfig.h.in b/pyconfig.h.in -index b10c57f..0a6f3e2 100644 +index 0a3d59e..fa2792b 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in -@@ -1244,9 +1244,15 @@ +@@ -1247,9 +1247,15 @@ /* Define as the preferred size in bits of long digits */ #undef PYLONG_BITS_IN_DIGIT From 27c558eb663e30c60d0b70e5067d43b925fb18da Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Tue, 9 May 2017 16:57:18 +0200 Subject: [PATCH 330/416] Added patch for fixing recompilation of Python when using common build commands and the --enable-optimizations flag. Enable profile guided optimizations for x86_64 and i686 architectures --- ...e-compilations-issue-with-pgo-builds.patch | 67 +++++++++++++++++++ python3.spec | 34 +++++++--- 2 files changed, 92 insertions(+), 9 deletions(-) create mode 100644 00269-fix-multiple-compilations-issue-with-pgo-builds.patch 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..a911feb --- /dev/null +++ b/00269-fix-multiple-compilations-issue-with-pgo-builds.patch @@ -0,0 +1,67 @@ +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 0e1d0af..42ab191 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -989,7 +989,7 @@ TESTTIMEOUT= 1200 + + # Run a basic set of regression tests. + # This excludes some tests that are particularly resource-intensive. +-test: all platform ++test: @DEF_MAKE_RULE@ platform + $(TESTRUNNER) $(TESTOPTS) + + # Run the full test suite twice - once without .pyc files, and once with. +@@ -999,7 +999,7 @@ test: all platform + # the bytecode read from a .pyc file had the bug, sometimes the directly + # generated bytecode. This is sometimes a very shy bug needing a lot of + # sample data. +-testall: all platform ++testall: @DEF_MAKE_RULE@ platform + -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f + $(TESTPYTHON) -E $(srcdir)/Lib/compileall.py + -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f +@@ -1008,7 +1008,7 @@ testall: all platform + + # Run the test suite 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 ;\ +@@ -1031,7 +1031,7 @@ QUICKTESTOPTS= $(TESTOPTS) -x test_subprocess test_io test_lib2to3 \ + test_multiprocessing_forkserver \ + test_mailbox test_socket test_poll \ + test_select test_zipfile test_concurrent_futures +-quicktest: all platform ++quicktest: @DEF_MAKE_RULE@ platform + $(TESTRUNNER) $(QUICKTESTOPTS) + + +@@ -1368,7 +1368,7 @@ LIBPL= $(LIBDEST)/config-$(LDVERSION)-$(MULTIARCH) + # pkgconfig directory + LIBPC= $(LIBDIR)/pkgconfig + +-libainstall: all python-config ++libainstall: @DEF_MAKE_RULE@ python-config + @for i in $(LIBDIR) $(LIBPL) $(LIBPC); \ + do \ + if test ! -d $(DESTDIR)$$i; then \ +@@ -1616,7 +1616,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; \ + +@@ -1653,7 +1653,7 @@ funny: + -o -print + + # Perform some verification checks on any modified files. +-patchcheck: all ++patchcheck: @DEF_MAKE_RULE@ + $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py + + # Dependencies diff --git a/python3.spec b/python3.spec index 9a29f09..ff229f8 100644 --- a/python3.spec +++ b/python3.spec @@ -123,7 +123,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 5%{?dist} +Release: 6%{?dist} License: Python Group: Development/Languages @@ -443,6 +443,19 @@ Patch261: 00261-use-proper-command-line-parsing-in-_testembed.patch # Original proposal: https://bugzilla.redhat.com/show_bug.cgi?id=1404918 Patch262: 00262-pep538_coerce_legacy_c_locale.patch +# 00264 # +# test_pass_by_value was added in Python 3.6.1 and on aarch64 +# it is catching an error that was there, but wasn't tested before. +# Therefore skipping the test on aarch64 until fixed upstream. +# Reported upstream: http://bugs.python.org/issue29804 +Patch264: 00264-skip-test-failing-on-aarch64.patch + +# 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 ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -452,14 +465,6 @@ Patch262: 00262-pep538_coerce_legacy_c_locale.patch # # https://fedoraproject.org/wiki/SIGs/Python/PythonPatches -# 00264 # -# test_pass_by_value was added in Python 3.6.1 and on aarch64 -# it is catching an error that was there, but wasn't tested before. -# Therefore skipping the test on aarch64 until fixed upstream. -# Reported upstream: http://bugs.python.org/issue29804 -Patch264: 00264-skip-test-failing-on-aarch64.patch - - # add correct arch for ppc64/ppc64le # it should be ppc64le-linux-gnu/ppc64-linux-gnu instead powerpc64le-linux-gnu/powerpc64-linux-gnu Patch5001: python3-powerppc-arch.patch @@ -725,6 +730,8 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch264 -p1 %endif +%patch269 -p1 + # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. # @@ -824,7 +831,11 @@ BuildPython debug \ BuildPython optimized \ python \ python%{pybasever} \ +%ifarch %{ix86} x86_64 + "--without-ensurepip --enable-optimizations" \ +%else "--without-ensurepip" \ +%end true # ====================================================== @@ -1680,6 +1691,11 @@ fi # ====================================================== %changelog +* Tue May 09 2017 Charalampos Stratakis - 3.6.1-6 +- Enable profile guided optimizations for x86_64 and i686 architectures +- Update to a newer implementation of PEP 538 +- Update description to reflect that Python 3 is now the default Python + * Fri May 05 2017 Charalampos Stratakis - 3.6.1-5 - Update PEP 538 to the latest upstream implementation From 2287f0c54b02245807e4dfec8daef6340b345fbf Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Tue, 9 May 2017 17:05:44 +0200 Subject: [PATCH 331/416] Fix conditional macro --- python3.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index ff229f8..6545d83 100644 --- a/python3.spec +++ b/python3.spec @@ -835,7 +835,7 @@ BuildPython optimized \ "--without-ensurepip --enable-optimizations" \ %else "--without-ensurepip" \ -%end +%endif true # ====================================================== From afb0016f9d576733d43ff478931d6fb066f224e4 Mon Sep 17 00:00:00 2001 From: Tomas Orsava Date: Tue, 16 May 2017 11:06:53 +0200 Subject: [PATCH 332/416] Polishing the Notes on bootstrapping Python --- python3.spec | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/python3.spec b/python3.spec index 6545d83..c25f196 100644 --- a/python3.spec +++ b/python3.spec @@ -4,25 +4,29 @@ # NOTES ON BOOTSTRAPING PYTHON 3.6: # -# Due to dependency cycle between Python, gdb, rpm, pip, setuptools and -# wheel, in order to rebase Python 3, one has to build in the following order: +# Due to a dependency cycle between Python, gdb, rpm, pip, setuptools, wheel, +# and other packages, in order to rebase Python 3 one has to build in the +# following order: # -# 1) gdb without python support (add %%global _without_python 1 on top of gdb's SPEC file) -# 2) python3 with with_rewheel set to 0 -# 3) gdb with python support (remove %%global _without_python 1 on top of gdb's SPEC file) -# 4) rpm -# 5) python-setuptools with bootstrap set to 1 -# 6) python-pip with build_wheel set to 0 -# 7) python-wheel with %%bcond_without bootstrap -# 8) python-setuptools with bootstrap set to 0 and also with_check set to 0 -# 9) python-pip with build_wheel set to 1 -# 10) pyparsing -# 11) python3 with with_rewheel set to 1 +# 1. gdb without python support (add %%global _without_python 1 on top of gdb's SPEC file) +# 2. python3 with with_rewheel set to 0 +# 3. gdb with python support (remove %%global _without_python 1 on top of gdb's SPEC file) +# 4. rpm +# 5. python-setuptools with bootstrap set to 1 +# 6. python-pip with build_wheel set to 0 +# 7. python-wheel with %%bcond_without bootstrap +# 8. python-setuptools with bootstrap set to 0 and also with_check set to 0 +# 9. python-pip with build_wheel set to 1 +# 10. pyparsing +# 11. python3 with with_rewheel set to 1 # -# Then the most important packages have to be built, starting from their various leaf dependencies -# recursively. After these have been built, a targeted rebuild should be requested for the rest. -# Currently these packages are recommended to have been built before a targeted rebuild after a python abi change: -# python-sphinx, pytest, python-requests, cloud-init, dnf, anaconda, abrt. +# Then the most important packages have to be built, starting from their +# various leaf dependencies recursively. After these have been built, a +# targeted rebuild should be requested for the rest. +# +# Currently these packages are recommended to have been built before a targeted +# rebuild after a python abi change: +# python-sphinx, pytest, python-requests, cloud-init, dnf, anaconda, abrt %global with_rewheel 1 From bb9ca6b393d9ee89f6da107dd371b79473aebaa6 Mon Sep 17 00:00:00 2001 From: Tomas Orsava Date: Fri, 5 May 2017 16:47:58 +0200 Subject: [PATCH 333/416] Add dependency to the devel subpackage on python3-rpm-generators ... which have been excised out of rpm-build. Involves: rhbz#1410631, rhbz#1444925 --- python3.spec | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/python3.spec b/python3.spec index c25f196..842815e 100644 --- a/python3.spec +++ b/python3.spec @@ -8,9 +8,15 @@ # and other packages, in order to rebase Python 3 one has to build in the # following order: # -# 1. gdb without python support (add %%global _without_python 1 on top of gdb's SPEC file) +# 1. At the same time: +# - gdb without python support (add %%global _without_python 1 on top of gdb's SPEC file) +# - python-rpm-generators with bootstrapping_python set to 1 +# (this can be done also during step 2., but should be done before 3.) # 2. python3 with with_rewheel set to 0 -# 3. gdb with python support (remove %%global _without_python 1 on top of gdb's SPEC file) +# 3. At the same time: +# - gdb with python support (remove %%global _without_python 1 on top of gdb's SPEC file) +# - python-rpm-generators with bootstrapping_python set to 0 +# (this can be done at any later step without negative effects) # 4. rpm # 5. python-setuptools with bootstrap set to 1 # 6. python-pip with build_wheel set to 0 @@ -127,7 +133,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 6%{?dist} +Release: 7%{?dist} License: Python Group: Development/Languages @@ -572,6 +578,7 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release} BuildRequires: python-rpm-macros Requires: python-rpm-macros Requires: python3-rpm-macros +Requires: python3-rpm-generators Conflicts: %{name} < %{version}-%{release} %description devel @@ -1695,6 +1702,12 @@ fi # ====================================================== %changelog +* Tue May 16 2017 Tomas Orsava - 3.6.1-7 +- Added a dependency to the devel subpackage on python3-rpm-generators which + have been excised out of rpm-build +- Updated notes on bootstrapping Python on top of this specfile accordingly +- Involves: rhbz#1410631, rhbz#1444925 + * Tue May 09 2017 Charalampos Stratakis - 3.6.1-6 - Enable profile guided optimizations for x86_64 and i686 architectures - Update to a newer implementation of PEP 538 From 3f280d64adee5afc57f353aed13c2e4e0ff2df00 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Mon, 19 Jun 2017 11:10:58 +0200 Subject: [PATCH 334/416] setuptools from version 36.0.0 rebundled its dependencies so we don't have to require them in order for rewheel to work, so dropping patch 260 as well. --- python3.spec | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/python3.spec b/python3.spec index 842815e..21892d5 100644 --- a/python3.spec +++ b/python3.spec @@ -194,10 +194,6 @@ BuildRequires: zlib-devel %if 0%{?with_rewheel} BuildRequires: python3-setuptools -BuildRequires: python3-six -BuildRequires: python3-pyparsing -BuildRequires: python3-appdirs -BuildRequires: python3-packaging BuildRequires: python3-pip %endif @@ -432,15 +428,6 @@ Patch252: 00252-add-executable-option.patch # Reported upstream: http://bugs.python.org/issue29324 Patch258: 00258-fix-test_aead_aes_gcm.patch -# 00260 # -# setuptools from version 34.0.0 and onwards, unbundled its dependencies -# and started requiring them so when rewheel mode is enabled we will have -# to BuildRequire the new dependencies, in order for the virtualenv's to work properly -# setuptools change: https://setuptools.readthedocs.io/en/latest/history.html#v34-0-0 -# Reported upstream: http://bugs.python.org/issue29523 -# https://github.com/python/cpython/pull/67 -Patch260: 00260-require-setuptools-dependencies.patch - # 00261 # # Use proper command line parsing in _testembed # Fixed upstream: http://bugs.python.org/issue24932 @@ -733,7 +720,6 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch249 -p1 %patch252 -p1 %patch258 -p1 -%patch260 -p1 %patch261 -p1 %patch262 -p1 From b5403ba5eb1365bd25d6dbe0481e8bc817220ffb Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Sat, 24 Jun 2017 17:24:42 +0200 Subject: [PATCH 335/416] Fix test_alpn_protocols from test_ssl --- 00260-require-setuptools-dependencies.patch | 183 -------------------- 00270-fix-ssl-alpn-hook-test.patch | 16 ++ python3.spec | 13 +- 3 files changed, 28 insertions(+), 184 deletions(-) delete mode 100644 00260-require-setuptools-dependencies.patch create mode 100644 00270-fix-ssl-alpn-hook-test.patch diff --git a/00260-require-setuptools-dependencies.patch b/00260-require-setuptools-dependencies.patch deleted file mode 100644 index 2e3ac20..0000000 --- a/00260-require-setuptools-dependencies.patch +++ /dev/null @@ -1,183 +0,0 @@ -diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py -index 9f5d151..4dfa8a1 100644 ---- a/Lib/ensurepip/__init__.py -+++ b/Lib/ensurepip/__init__.py -@@ -8,13 +8,25 @@ import tempfile - __all__ = ["version", "bootstrap"] - - --_SETUPTOOLS_VERSION = "28.8.0" -+_SETUPTOOLS_VERSION = "34.2.0" - - _PIP_VERSION = "9.0.1" - -+_SIX_VERSION = "1.10.0" -+ -+_APPDIRS_VERSION = "1.4.0" -+ -+_PACKAGING_VERSION = "16.8" -+ -+_PYPARSING_VERSION = "2.1.10" -+ - _PROJECTS = [ -- ("setuptools", _SETUPTOOLS_VERSION), -- ("pip", _PIP_VERSION), -+ ("setuptools", _SETUPTOOLS_VERSION), -+ ("pip", _PIP_VERSION), -+ ("six", _SIX_VERSION), -+ ("appdirs", _APPDIRS_VERSION), -+ ("packaging", _PACKAGING_VERSION), -+ ("pyparsing", _PYPARSING_VERSION) - ] - - -diff --git a/Lib/test/test_ensurepip.py b/Lib/test/test_ensurepip.py -index 9b04c18..23664c4 100644 ---- a/Lib/test/test_ensurepip.py -+++ b/Lib/test/test_ensurepip.py -@@ -40,13 +40,14 @@ class TestBootstrap(EnsurepipMixin, unittest.TestCase): - self.run_pip.assert_called_once_with( - [ - "install", "--no-index", "--find-links", -- unittest.mock.ANY, "setuptools", "pip", -+ unittest.mock.ANY, -+ "setuptools", "pip", "six", "appdirs", "packaging", "pyparsing", - ], - unittest.mock.ANY, - ) - - additional_paths = self.run_pip.call_args[0][1] -- self.assertEqual(len(additional_paths), 2) -+ self.assertEqual(len(additional_paths), 6) - - def test_bootstrapping_with_root(self): - ensurepip.bootstrap(root="/foo/bar/") -@@ -55,7 +56,7 @@ class TestBootstrap(EnsurepipMixin, unittest.TestCase): - [ - "install", "--no-index", "--find-links", - unittest.mock.ANY, "--root", "/foo/bar/", -- "setuptools", "pip", -+ "setuptools", "pip", "six", "appdirs", "packaging", "pyparsing", - ], - unittest.mock.ANY, - ) -@@ -66,7 +67,8 @@ class TestBootstrap(EnsurepipMixin, unittest.TestCase): - self.run_pip.assert_called_once_with( - [ - "install", "--no-index", "--find-links", -- unittest.mock.ANY, "--user", "setuptools", "pip", -+ unittest.mock.ANY, "--user", -+ "setuptools", "pip", "six", "appdirs", "packaging", "pyparsing", - ], - unittest.mock.ANY, - ) -@@ -77,7 +79,8 @@ class TestBootstrap(EnsurepipMixin, unittest.TestCase): - self.run_pip.assert_called_once_with( - [ - "install", "--no-index", "--find-links", -- unittest.mock.ANY, "--upgrade", "setuptools", "pip", -+ unittest.mock.ANY, "--upgrade", -+ "setuptools", "pip", "six", "appdirs", "packaging", "pyparsing", - ], - unittest.mock.ANY, - ) -@@ -88,7 +91,8 @@ class TestBootstrap(EnsurepipMixin, unittest.TestCase): - self.run_pip.assert_called_once_with( - [ - "install", "--no-index", "--find-links", -- unittest.mock.ANY, "-v", "setuptools", "pip", -+ unittest.mock.ANY, "-v", -+ "setuptools", "pip", "six", "appdirs", "packaging", "pyparsing", - ], - unittest.mock.ANY, - ) -@@ -99,7 +103,8 @@ class TestBootstrap(EnsurepipMixin, unittest.TestCase): - self.run_pip.assert_called_once_with( - [ - "install", "--no-index", "--find-links", -- unittest.mock.ANY, "-vv", "setuptools", "pip", -+ unittest.mock.ANY, "-vv", -+ "setuptools", "pip", "six", "appdirs", "packaging", "pyparsing", - ], - unittest.mock.ANY, - ) -@@ -110,7 +115,8 @@ class TestBootstrap(EnsurepipMixin, unittest.TestCase): - self.run_pip.assert_called_once_with( - [ - "install", "--no-index", "--find-links", -- unittest.mock.ANY, "-vvv", "setuptools", "pip", -+ unittest.mock.ANY, "-vvv", -+ "setuptools", "pip", "six", "appdirs", "packaging", "pyparsing", - ], - unittest.mock.ANY, - ) -@@ -186,8 +192,8 @@ class TestUninstall(EnsurepipMixin, unittest.TestCase): - - self.run_pip.assert_called_once_with( - [ -- "uninstall", "-y", "--disable-pip-version-check", "pip", -- "setuptools", -+ "uninstall", "-y", "--disable-pip-version-check", -+ "pyparsing", "packaging", "appdirs", "six", "pip", "setuptools", - ] - ) - -@@ -197,8 +203,8 @@ class TestUninstall(EnsurepipMixin, unittest.TestCase): - - self.run_pip.assert_called_once_with( - [ -- "uninstall", "-y", "--disable-pip-version-check", "-v", "pip", -- "setuptools", -+ "uninstall", "-y", "--disable-pip-version-check", "-v", -+ "pyparsing", "packaging", "appdirs", "six", "pip", "setuptools", - ] - ) - -@@ -208,8 +214,8 @@ class TestUninstall(EnsurepipMixin, unittest.TestCase): - - self.run_pip.assert_called_once_with( - [ -- "uninstall", "-y", "--disable-pip-version-check", "-vv", "pip", -- "setuptools", -+ "uninstall", "-y", "--disable-pip-version-check", "-vv", -+ "pyparsing", "packaging", "appdirs", "six", "pip", "setuptools", - ] - ) - -@@ -220,7 +226,7 @@ class TestUninstall(EnsurepipMixin, unittest.TestCase): - self.run_pip.assert_called_once_with( - [ - "uninstall", "-y", "--disable-pip-version-check", "-vvv", -- "pip", "setuptools", -+ "pyparsing", "packaging", "appdirs", "six", "pip", "setuptools", - ] - ) - -@@ -260,13 +266,14 @@ class TestBootstrappingMainFunction(EnsurepipMixin, unittest.TestCase): - self.run_pip.assert_called_once_with( - [ - "install", "--no-index", "--find-links", -- unittest.mock.ANY, "setuptools", "pip", -+ unittest.mock.ANY, -+ "setuptools", "pip", "six", "appdirs", "packaging", "pyparsing", - ], - unittest.mock.ANY, - ) - - additional_paths = self.run_pip.call_args[0][1] -- self.assertEqual(len(additional_paths), 2) -+ self.assertEqual(len(additional_paths), 6) - - class TestUninstallationMainFunction(EnsurepipMixin, unittest.TestCase): - -@@ -284,8 +291,8 @@ class TestUninstallationMainFunction(EnsurepipMixin, unittest.TestCase): - - self.run_pip.assert_called_once_with( - [ -- "uninstall", "-y", "--disable-pip-version-check", "pip", -- "setuptools", -+ "uninstall", "-y", "--disable-pip-version-check", "pyparsing", "packaging", -+ "appdirs", "six", "pip", "setuptools", - ] - ) - 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/python3.spec b/python3.spec index 21892d5..af93948 100644 --- a/python3.spec +++ b/python3.spec @@ -133,7 +133,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 7%{?dist} +Release: 8%{?dist} License: Python Group: Development/Languages @@ -453,6 +453,12 @@ Patch264: 00264-skip-test-failing-on-aarch64.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 "python" and "python3" in Fedora, EL, etc., @@ -728,6 +734,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %endif %patch269 -p1 +%patch270 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1688,6 +1695,10 @@ fi # ====================================================== %changelog +* Fri Jun 23 2017 Charalampos Stratakis - 3.6.1-8 +- Fix test_alpn_protocols from test_ssl +- Do not require rebundled setuptools dependencies + * Tue May 16 2017 Tomas Orsava - 3.6.1-7 - Added a dependency to the devel subpackage on python3-rpm-generators which have been excised out of rpm-build From 332b947dfc8d0f0d3a4525864b121d0f239beb4d Mon Sep 17 00:00:00 2001 From: Michal Cyprian Date: Mon, 26 Jun 2017 16:32:56 +0200 Subject: [PATCH 336/416] Make pip and distutils in user environment install into separate location --- 00251-change-user-install-location.patch | 46 ++++++++++++++++++++++++ python3.spec | 12 ++++++- 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 00251-change-user-install-location.patch diff --git a/00251-change-user-install-location.patch b/00251-change-user-install-location.patch new file mode 100644 index 0000000..1dcd9f2 --- /dev/null +++ b/00251-change-user-install-location.patch @@ -0,0 +1,46 @@ +diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py +index 9d31d13..ed44a93 100644 +--- a/Lib/distutils/command/install.py ++++ b/Lib/distutils/command/install.py +@@ -424,8 +424,18 @@ class install(Command): + raise DistutilsOptionError( + "must not supply exec-prefix without prefix") + +- self.prefix = os.path.normpath(sys.prefix) +- self.exec_prefix = os.path.normpath(sys.exec_prefix) ++ # self.prefix is set to sys.prefix + /local/ ++ # if the executable is /usr/bin/python* and RPM build ++ # is not detected to make pip and distutils install into ++ # the separate location. ++ if (sys.executable.startswith("/usr/bin/python") ++ and 'RPM_BUILD_ROOT' not in os.environ): ++ addition = "/local" ++ else: ++ addition = "" ++ ++ self.prefix = os.path.normpath(sys.prefix) + addition ++ self.exec_prefix = os.path.normpath(sys.exec_prefix) + addition + + else: + if self.exec_prefix is None: +diff --git a/Lib/site.py b/Lib/site.py +index 4744eb0..b5fe571 100644 +--- a/Lib/site.py ++++ b/Lib/site.py +@@ -326,7 +326,15 @@ def getsitepackages(prefixes=None): + return sitepackages + + def addsitepackages(known_paths, prefixes=None): +- """Add site-packages to sys.path""" ++ """Add site-packages to sys.path. ++ ++ '/usr/local' is included in PREFIXES if the executable is /usr/bin/python* ++ and RPM build is not detected to make sudo pip installed packages visible. ++ ++ """ ++ if (ENABLE_USER_SITE and sys.executable.startswith("/usr/bin/python") ++ and 'RPM_BUILD_ROOT' not in os.environ): ++ PREFIXES.insert(0, "/usr/local") + for sitedir in getsitepackages(prefixes): + if os.path.isdir(sitedir): + addsitedir(sitedir, known_paths) diff --git a/python3.spec b/python3.spec index af93948..9ac8875 100644 --- a/python3.spec +++ b/python3.spec @@ -133,7 +133,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 8%{?dist} +Release: 9%{?dist} License: Python Group: Development/Languages @@ -417,6 +417,12 @@ Patch243: 00243-fix-mips64-triplet.patch # Not yet fixed upstream: http://bugs.python.org/issue28787 Patch249: 00249-fix-out-of-tree-dtrace-builds.patch +# 00251 +# Set values of prefix and exec_prefix in distutils install command +# to /usr/local if executable is /usr/bin/python* and RPM build +# is not detected to make pip and distutils install into separate location +Patch251: 00251-change-user-install-location.patch + # 00252 # Add executable option to install.py command to make it work for # scripts specified as an entry_points @@ -724,6 +730,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch206 -p1 %patch243 -p1 %patch249 -p1 +%patch251 -p1 %patch252 -p1 %patch258 -p1 %patch261 -p1 @@ -1695,6 +1702,9 @@ fi # ====================================================== %changelog +* Mon Jun 26 2017 Michal Cyprian - 3.6.1-9 +- Make pip and distutils in user environment install into separate location + * Fri Jun 23 2017 Charalampos Stratakis - 3.6.1-8 - Fix test_alpn_protocols from test_ssl - Do not require rebundled setuptools dependencies From 252962389ce9dd580711d948620b40468df07030 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Tue, 27 Jun 2017 15:38:30 +0200 Subject: [PATCH 337/416] Update to the latest implementation of PEP 538. Remove patch 261 as it was only required for the previous implementation of PEP 538. --- 00262-pep538_coerce_legacy_c_locale.patch | 507 ++++++++++++++-------- python3.spec | 11 +- 2 files changed, 331 insertions(+), 187 deletions(-) diff --git a/00262-pep538_coerce_legacy_c_locale.patch b/00262-pep538_coerce_legacy_c_locale.patch index 7802567..856ef77 100644 --- a/00262-pep538_coerce_legacy_c_locale.patch +++ b/00262-pep538_coerce_legacy_c_locale.patch @@ -1,8 +1,8 @@ diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst -index 08dc311..c6ec147 100644 +index 195f63f..8ecd70f 100644 --- a/Doc/using/cmdline.rst +++ b/Doc/using/cmdline.rst -@@ -713,6 +713,40 @@ conflict. +@@ -713,6 +713,45 @@ conflict. .. versionadded:: 3.6 @@ -35,6 +35,11 @@ index 08dc311..c6ec147 100644 + :data:`sys.stdin` and :data:`sys.stdout` to ``surrogateescape``. This + behavior can be overridden using :envvar:`PYTHONIOENCODING` as usual. + ++ For debugging purposes, setting ``PYTHONCOERCECLOCALE=warn`` will cause ++ Python to emit warning messages on ``stderr`` if either the locale coercion ++ activates, or else if a locale that *would* have triggered coercion is ++ still active when the Python runtime is initialized. ++ + Availability: \*nix + + .. versionadded:: 3.7 @@ -44,10 +49,10 @@ index 08dc311..c6ec147 100644 ~~~~~~~~~~~~~~~~~~~~ diff --git a/Lib/test/support/script_helper.py b/Lib/test/support/script_helper.py -index 1e74647..b3ac848 100644 +index ca5f9c2..7aa460b 100644 --- a/Lib/test/support/script_helper.py +++ b/Lib/test/support/script_helper.py -@@ -48,8 +48,35 @@ def interpreter_requires_environment(): +@@ -51,8 +51,35 @@ def interpreter_requires_environment(): return __cached_interp_requires_environment @@ -85,7 +90,7 @@ index 1e74647..b3ac848 100644 # Executing the interpreter in a subprocess -@@ -107,30 +134,7 @@ def run_python_until_end(*args, **env_vars): +@@ -110,30 +137,7 @@ def run_python_until_end(*args, **env_vars): def _assert_python(expected_success, *args, **env_vars): res, cmd_line = run_python_until_end(*args, **env_vars) if (res.rc and expected_success) or (not res.rc and not expected_success): @@ -119,10 +124,10 @@ index 1e74647..b3ac848 100644 def assert_python_ok(*args, **env_vars): diff --git a/Lib/test/test_c_locale_coercion.py b/Lib/test/test_c_locale_coercion.py new file mode 100644 -index 0000000..ad6ecac +index 0000000..a4b4626 --- /dev/null +++ b/Lib/test/test_c_locale_coercion.py -@@ -0,0 +1,269 @@ +@@ -0,0 +1,353 @@ +# Tests the attempted automatic coercion of the C locale to a UTF-8 locale + +import unittest @@ -139,14 +144,31 @@ index 0000000..ad6ecac + interpreter_requires_environment, +) + ++# Set our expectation for the default encoding used in the C locale ++# for the filesystem encoding and the standard streams ++C_LOCALE_STREAM_ENCODING = "ascii" ++if sys.platform == "darwin": ++ C_LOCALE_FS_ENCODING = "utf-8" ++else: ++ C_LOCALE_FS_ENCODING = C_LOCALE_STREAM_ENCODING ++ ++# Note that the above is probably still wrong in some cases, such as: ++# * Windows when PYTHONLEGACYWINDOWSFSENCODING is set ++# * AIX and any other platforms that use latin-1 in the C locale ++# ++# Options for dealing with this: ++# * Don't set PYTHON_COERCE_C_LOCALE on such platforms (e.g. Windows doesn't) ++# * Fix the test expectations to match the actual platform behaviour ++ +# In order to get the warning messages to match up as expected, the candidate +# order here must much the target locale order in Python/pylifecycle.c -+_C_UTF8_LOCALES = ( -+ # Entries: (Target locale, expected env var updates) -+ ("C.UTF-8", "LC_CTYPE & LANG"), -+ ("C.utf8", "LC_CTYPE & LANG"), -+ ("UTF-8", "LC_CTYPE"), -+) ++_C_UTF8_LOCALES = ("C.UTF-8", "C.utf8") #, "UTF-8") ++ ++# XXX (ncoghlan): Using UTF-8 as a target locale is currently disabled due to ++# problems encountered on *BSD systems with those test cases ++# For additional details see: ++# nl_langinfo CODESET error: https://bugs.python.org/issue30647 ++# locale handling differences: https://bugs.python.org/issue30672 + +# There's no reliable cross-platform way of checking locale alias +# lists, so the only way of knowing which of these locales will work @@ -158,28 +180,39 @@ index 0000000..ad6ecac + result, py_cmd = run_python_until_end("-c", cmd, __isolated=True) + return result.rc == 0 + -+_EncodingDetails = namedtuple("EncodingDetails", -+ "fsencoding stdin_info stdout_info stderr_info") ++_fields = "fsencoding stdin_info stdout_info stderr_info lang lc_ctype lc_all" ++_EncodingDetails = namedtuple("EncodingDetails", _fields) + +class EncodingDetails(_EncodingDetails): ++ # XXX (ncoghlan): Using JSON for child state reporting may be less fragile + CHILD_PROCESS_SCRIPT = ";".join([ -+ "import sys", ++ "import sys, os", + "print(sys.getfilesystemencoding())", + "print(sys.stdin.encoding + ':' + sys.stdin.errors)", + "print(sys.stdout.encoding + ':' + sys.stdout.errors)", + "print(sys.stderr.encoding + ':' + sys.stderr.errors)", ++ "print(os.environ.get('LANG', 'not set'))", ++ "print(os.environ.get('LC_CTYPE', 'not set'))", ++ "print(os.environ.get('LC_ALL', 'not set'))", + ]) + + @classmethod -+ def get_expected_details(cls, expected_fsencoding): ++ def get_expected_details(cls, coercion_expected, fs_encoding, stream_encoding, env_vars): + """Returns expected child process details for a given encoding""" -+ _stream = expected_fsencoding + ":{}" ++ _stream = stream_encoding + ":{}" + # stdin and stdout should use surrogateescape either because the + # coercion triggered, or because the C locale was detected + stream_info = 2*[_stream.format("surrogateescape")] + # stderr should always use backslashreplace + stream_info.append(_stream.format("backslashreplace")) -+ return dict(cls(expected_fsencoding, *stream_info)._asdict()) ++ expected_lang = env_vars.get("LANG", "not set").lower() ++ if coercion_expected: ++ expected_lc_ctype = CLI_COERCION_TARGET.lower() ++ else: ++ expected_lc_ctype = env_vars.get("LC_CTYPE", "not set").lower() ++ expected_lc_all = env_vars.get("LC_ALL", "not set").lower() ++ env_info = expected_lang, expected_lc_ctype, expected_lc_all ++ return dict(cls(fs_encoding, *stream_info, *env_info)._asdict()) + + @staticmethod + def _handle_output_variations(data): @@ -215,99 +248,99 @@ index 0000000..ad6ecac + result.fail(py_cmd) + # All subprocess outputs in this test case should be pure ASCII + adjusted_output = cls._handle_output_variations(result.out) -+ stdout_lines = adjusted_output.decode("ascii").rstrip().splitlines() ++ stdout_lines = adjusted_output.decode("ascii").splitlines() + child_encoding_details = dict(cls(*stdout_lines)._asdict()) + stderr_lines = result.err.decode("ascii").rstrip().splitlines() + return child_encoding_details, stderr_lines + + -+class _ChildProcessEncodingTestCase(unittest.TestCase): -+ # Base class to check for expected encoding details in a child process -+ -+ def _check_child_encoding_details(self, -+ env_vars, -+ expected_fsencoding, -+ expected_warning): -+ """Check the C locale handling for the given process environment -+ -+ Parameters: -+ expected_fsencoding: the encoding the child is expected to report -+ allow_c_locale: setting to use for PYTHONALLOWCLOCALE -+ None: don't set the variable at all -+ str: the value set in the child's environment -+ """ -+ result = EncodingDetails.get_child_details(env_vars) -+ encoding_details, stderr_lines = result -+ self.assertEqual(encoding_details, -+ EncodingDetails.get_expected_details( -+ expected_fsencoding)) -+ self.assertEqual(stderr_lines, expected_warning) -+ +# Details of the shared library warning emitted at runtime -+LIBRARY_C_LOCALE_WARNING = ( ++LEGACY_LOCALE_WARNING = ( + "Python runtime initialized with LC_CTYPE=C (a locale with default ASCII " + "encoding), which may cause Unicode compatibility problems. Using C.UTF-8, " + "C.utf8, or UTF-8 (if available) as alternative Unicode-compatible " + "locales is recommended." +) + -+@unittest.skipUnless(sysconfig.get_config_var("PY_WARN_ON_C_LOCALE"), -+ "C locale runtime warning disabled at build time") -+class LocaleWarningTests(_ChildProcessEncodingTestCase): -+ # Test warning emitted when running in the C locale -+ -+ def test_library_c_locale_warning(self): -+ self.maxDiff = None -+ for locale_to_set in ("C", "POSIX", "invalid.ascii"): -+ var_dict = { -+ "LC_ALL": locale_to_set -+ } -+ with self.subTest(forced_locale=locale_to_set): -+ self._check_child_encoding_details(var_dict, -+ "ascii", -+ [LIBRARY_C_LOCALE_WARNING]) -+ +# Details of the CLI locale coercion warning emitted at runtime +CLI_COERCION_WARNING_FMT = ( -+ "Python detected LC_CTYPE=C: {} coerced to {} (set another locale " ++ "Python detected LC_CTYPE=C: LC_CTYPE coerced to {} (set another locale " + "or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior)." +) + -+class _LocaleCoercionTargetsTestCase(_ChildProcessEncodingTestCase): -+ # Base class for test cases that rely on coercion targets being defined + -+ available_targets = [] -+ targets_required = True ++AVAILABLE_TARGETS = None ++CLI_COERCION_TARGET = None ++CLI_COERCION_WARNING = None + -+ @classmethod -+ def setUpClass(cls): -+ first_target_locale = first_env_updates = None -+ available_targets = cls.available_targets -+ # Find the target locales available in the current system -+ for target_locale, env_updates in _C_UTF8_LOCALES: -+ if _set_locale_in_subprocess(target_locale): -+ available_targets.append(target_locale) -+ if first_target_locale is None: -+ first_target_locale = target_locale -+ first_env_updates = env_updates -+ if cls.targets_required and not available_targets: -+ raise unittest.SkipTest("No C-with-UTF-8 locale available") -+ # Expect coercion to use the first available locale -+ cls.EXPECTED_COERCION_WARNING = CLI_COERCION_WARNING_FMT.format( -+ first_env_updates, first_target_locale ++def setUpModule(): ++ global AVAILABLE_TARGETS ++ global CLI_COERCION_TARGET ++ global CLI_COERCION_WARNING ++ ++ if AVAILABLE_TARGETS is not None: ++ # initialization already done ++ return ++ AVAILABLE_TARGETS = [] ++ ++ # Find the target locales available in the current system ++ for target_locale in _C_UTF8_LOCALES: ++ if _set_locale_in_subprocess(target_locale): ++ AVAILABLE_TARGETS.append(target_locale) ++ ++ if AVAILABLE_TARGETS: ++ # Coercion is expected to use the first available target locale ++ CLI_COERCION_TARGET = AVAILABLE_TARGETS[0] ++ CLI_COERCION_WARNING = CLI_COERCION_WARNING_FMT.format(CLI_COERCION_TARGET) ++ ++ ++class _LocaleHandlingTestCase(unittest.TestCase): ++ # Base class to check expected locale handling behaviour ++ ++ def _check_child_encoding_details(self, ++ env_vars, ++ expected_fs_encoding, ++ expected_stream_encoding, ++ expected_warnings, ++ coercion_expected): ++ """Check the C locale handling for the given process environment ++ ++ Parameters: ++ expected_fs_encoding: expected sys.getfilesystemencoding() result ++ expected_stream_encoding: expected encoding for standard streams ++ expected_warning: stderr output to expect (if any) ++ """ ++ result = EncodingDetails.get_child_details(env_vars) ++ encoding_details, stderr_lines = result ++ expected_details = EncodingDetails.get_expected_details( ++ coercion_expected, ++ expected_fs_encoding, ++ expected_stream_encoding, ++ env_vars + ) ++ self.assertEqual(encoding_details, expected_details) ++ if expected_warnings is None: ++ expected_warnings = [] ++ self.assertEqual(stderr_lines, expected_warnings) + + -+class LocaleConfigurationTests(_LocaleCoercionTargetsTestCase): ++class LocaleConfigurationTests(_LocaleHandlingTestCase): + # Test explicit external configuration via the process environment + ++ def setUpClass(): ++ # This relies on setupModule() having been run, so it can't be ++ # handled via the @unittest.skipUnless decorator ++ if not AVAILABLE_TARGETS: ++ raise unittest.SkipTest("No C-with-UTF-8 locale available") ++ + def test_external_target_locale_configuration(self): ++ + # Explicitly setting a target locale should give the same behaviour as + # is seen when implicitly coercing to that target locale + self.maxDiff = None + -+ expected_warning = [] -+ expected_fsencoding = "utf-8" ++ expected_fs_encoding = "utf-8" ++ expected_stream_encoding = "utf-8" + + base_var_dict = { + "LANG": "", @@ -315,47 +348,71 @@ index 0000000..ad6ecac + "LC_ALL": "", + } + for env_var in ("LANG", "LC_CTYPE"): -+ for locale_to_set in self.available_targets: ++ for locale_to_set in AVAILABLE_TARGETS: ++ # XXX (ncoghlan): LANG=UTF-8 doesn't appear to work as ++ # expected, so skip that combination for now ++ # See https://bugs.python.org/issue30672 for discussion ++ if env_var == "LANG" and locale_to_set == "UTF-8": ++ continue ++ + with self.subTest(env_var=env_var, + configured_locale=locale_to_set): + var_dict = base_var_dict.copy() + var_dict[env_var] = locale_to_set + self._check_child_encoding_details(var_dict, -+ expected_fsencoding, -+ expected_warning) ++ expected_fs_encoding, ++ expected_stream_encoding, ++ expected_warnings=None, ++ coercion_expected=False) + + + +@test.support.cpython_only +@unittest.skipUnless(sysconfig.get_config_var("PY_COERCE_C_LOCALE"), + "C locale coercion disabled at build time") -+class LocaleCoercionTests(_LocaleCoercionTargetsTestCase): ++class LocaleCoercionTests(_LocaleHandlingTestCase): + # Test implicit reconfiguration of the environment during CLI startup + -+ def _check_c_locale_coercion(self, expected_fsencoding, coerce_c_locale): ++ def _check_c_locale_coercion(self, ++ fs_encoding, stream_encoding, ++ coerce_c_locale, ++ expected_warnings=None, ++ coercion_expected=True, ++ **extra_vars): + """Check the C locale handling for various configurations + + Parameters: -+ expected_fsencoding: the encoding the child is expected to report -+ allow_c_locale: setting to use for PYTHONALLOWCLOCALE ++ fs_encoding: expected sys.getfilesystemencoding() result ++ stream_encoding: expected encoding for standard streams ++ coerce_c_locale: setting to use for PYTHONCOERCECLOCALE + None: don't set the variable at all + str: the value set in the child's environment ++ expected_warnings: expected warning lines on stderr ++ extra_vars: additional environment variables to set in subprocess + """ -+ -+ # Check for expected warning on stderr if C locale is coerced + self.maxDiff = None + -+ expected_warning = [] -+ if coerce_c_locale != "0": -+ expected_warning.append(self.EXPECTED_COERCION_WARNING) ++ if not AVAILABLE_TARGETS: ++ # Locale coercion is disabled when there aren't any target locales ++ fs_encoding = C_LOCALE_FS_ENCODING ++ stream_encoding = C_LOCALE_STREAM_ENCODING ++ coercion_expected = False ++ if expected_warnings: ++ expected_warnings = [LEGACY_LOCALE_WARNING] + + base_var_dict = { + "LANG": "", + "LC_CTYPE": "", + "LC_ALL": "", + } ++ base_var_dict.update(extra_vars) + for env_var in ("LANG", "LC_CTYPE"): + for locale_to_set in ("", "C", "POSIX", "invalid.ascii"): ++ # XXX (ncoghlan): *BSD platforms don't behave as expected in the ++ # POSIX locale, so we skip that for now ++ # See https://bugs.python.org/issue30672 for discussion ++ if locale_to_set == "POSIX": ++ continue + with self.subTest(env_var=env_var, + nominal_locale=locale_to_set, + PYTHONCOERCECLOCALE=coerce_c_locale): @@ -363,40 +420,72 @@ index 0000000..ad6ecac + var_dict[env_var] = locale_to_set + if coerce_c_locale is not None: + var_dict["PYTHONCOERCECLOCALE"] = coerce_c_locale ++ # Check behaviour on successful coercion + self._check_child_encoding_details(var_dict, -+ expected_fsencoding, -+ expected_warning) ++ fs_encoding, ++ stream_encoding, ++ expected_warnings, ++ coercion_expected) + + def test_test_PYTHONCOERCECLOCALE_not_set(self): + # This should coerce to the first available target locale by default -+ self._check_c_locale_coercion("utf-8", coerce_c_locale=None) ++ self._check_c_locale_coercion("utf-8", "utf-8", coerce_c_locale=None) + + def test_PYTHONCOERCECLOCALE_not_zero(self): -+ # *Any* string other that "0" is considered "set" for our purposes ++ # *Any* string other than "0" is considered "set" for our purposes + # and hence should result in the locale coercion being enabled + for setting in ("", "1", "true", "false"): -+ self._check_c_locale_coercion("utf-8", coerce_c_locale=setting) ++ self._check_c_locale_coercion("utf-8", "utf-8", coerce_c_locale=setting) ++ ++ def test_PYTHONCOERCECLOCALE_set_to_warn(self): ++ # PYTHONCOERCECLOCALE=warn enables runtime warnings for legacy locales ++ self._check_c_locale_coercion("utf-8", "utf-8", ++ coerce_c_locale="warn", ++ expected_warnings=[CLI_COERCION_WARNING]) ++ + + def test_PYTHONCOERCECLOCALE_set_to_zero(self): + # The setting "0" should result in the locale coercion being disabled -+ self._check_c_locale_coercion("ascii", coerce_c_locale="0") ++ self._check_c_locale_coercion(C_LOCALE_FS_ENCODING, ++ C_LOCALE_STREAM_ENCODING, ++ coerce_c_locale="0", ++ coercion_expected=False) ++ # Setting LC_ALL=C shouldn't make any difference to the behaviour ++ self._check_c_locale_coercion(C_LOCALE_FS_ENCODING, ++ C_LOCALE_STREAM_ENCODING, ++ coerce_c_locale="0", ++ LC_ALL="C", ++ coercion_expected=False) + ++ def test_LC_ALL_set_to_C(self): ++ # Setting LC_ALL should render the locale coercion ineffective ++ self._check_c_locale_coercion(C_LOCALE_FS_ENCODING, ++ C_LOCALE_STREAM_ENCODING, ++ coerce_c_locale=None, ++ LC_ALL="C", ++ coercion_expected=False) ++ # And result in a warning about a lack of locale compatibility ++ self._check_c_locale_coercion(C_LOCALE_FS_ENCODING, ++ C_LOCALE_STREAM_ENCODING, ++ coerce_c_locale="warn", ++ LC_ALL="C", ++ expected_warnings=[LEGACY_LOCALE_WARNING], ++ coercion_expected=False) + +def test_main(): + test.support.run_unittest( + LocaleConfigurationTests, -+ LocaleCoercionTests, -+ LocaleWarningTests ++ LocaleCoercionTests + ) + test.support.reap_children() + +if __name__ == "__main__": + test_main() diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py -index eb3e2c5..f677d88 100644 +index 6c3625d..009f542 100644 --- a/Lib/test/test_capi.py +++ b/Lib/test/test_capi.py -@@ -369,14 +369,15 @@ def setUp(self): +@@ -369,14 +369,21 @@ class EmbeddingTests(unittest.TestCase): def tearDown(self): os.chdir(self.oldcwd) @@ -405,6 +494,12 @@ index eb3e2c5..f677d88 100644 """Runs a test in the embedded interpreter""" cmd = [self.test_exe] cmd.extend(args) ++ if env is not None and sys.platform == 'win32': ++ # Windows requires at least the SYSTEMROOT environment variable to ++ # start Python. ++ env = env.copy() ++ env['SYSTEMROOT'] = os.environ['SYSTEMROOT'] ++ p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, @@ -414,22 +509,31 @@ index eb3e2c5..f677d88 100644 (out, err) = p.communicate() self.assertEqual(p.returncode, 0, "bad returncode %d, stderr is %r" % -@@ -386,7 +387,7 @@ def run_embedded_interpreter(self, *args): +@@ -386,31 +393,21 @@ class EmbeddingTests(unittest.TestCase): def test_subinterps(self): # This is just a "don't crash" test - out, err = self.run_embedded_interpreter("repeated_init_and_subinterpreters") + out, err = self.run_embedded_interpreter() - if support.verbose: + if support.verbose > 1: print() print(out) print(err) -@@ -403,13 +404,14 @@ def _get_default_pipe_encoding(): +- @staticmethod +- def _get_default_pipe_encoding(): +- rp, wp = os.pipe() +- try: +- with os.fdopen(wp, 'w') as w: +- default_pipe_encoding = w.encoding +- finally: +- os.close(rp) +- return default_pipe_encoding +- def test_forced_io_encoding(self): # Checks forced configuration of embedded interpreter IO streams - out, err = self.run_embedded_interpreter("forced_io_encoding") - if support.verbose: -+ env = {"PYTHONIOENCODING": "UTF-8:surrogateescape"} ++ env = dict(os.environ, PYTHONIOENCODING="utf-8:surrogateescape") + out, err = self.run_embedded_interpreter("forced_io_encoding", env=env) + if support.verbose > 1: print() @@ -437,16 +541,28 @@ index eb3e2c5..f677d88 100644 print(err) - expected_errors = sys.__stdout__.errors - expected_stdin_encoding = sys.__stdin__.encoding +- expected_pipe_encoding = self._get_default_pipe_encoding() ++ expected_stream_encoding = "utf-8" + expected_errors = "surrogateescape" -+ expected_stdin_encoding = "UTF-8" - expected_pipe_encoding = self._get_default_pipe_encoding() expected_output = '\n'.join([ "--- Use defaults ---", + "Expected encoding: default", +@@ -437,8 +434,8 @@ class EmbeddingTests(unittest.TestCase): + "stdout: latin-1:replace", + "stderr: latin-1:backslashreplace"]) + expected_output = expected_output.format( +- in_encoding=expected_stdin_encoding, +- out_encoding=expected_pipe_encoding, ++ in_encoding=expected_stream_encoding, ++ out_encoding=expected_stream_encoding, + errors=expected_errors) + # This is useful if we ever trip over odd platform behaviour + self.maxDiff = None diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py -index 958d282..c4c6850 100644 +index ae2bcd4..0a302ff 100644 --- a/Lib/test/test_cmd_line.py +++ b/Lib/test/test_cmd_line.py -@@ -8,8 +8,9 @@ +@@ -9,8 +9,9 @@ import sys import subprocess import tempfile from test.support import script_helper, is_android @@ -458,7 +574,7 @@ index 958d282..c4c6850 100644 # XXX (ncoghlan): Move to script_helper and make consistent with run_python -@@ -150,6 +151,7 @@ def test_undecodable_code(self): +@@ -151,6 +152,7 @@ class CmdLineTest(unittest.TestCase): env = os.environ.copy() # Use C locale to get ascii for the locale encoding env['LC_ALL'] = 'C' @@ -467,10 +583,10 @@ index 958d282..c4c6850 100644 b'import locale; ' b'print(ascii("' + undecodable + b'"), ' diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py -index ed78e2a..3844812 100644 +index df9ebd4..63145e4 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py -@@ -682,6 +682,7 @@ def c_locale_get_error_handler(self, isolated=False, encoding=None): +@@ -680,6 +680,7 @@ class SysModuleTest(unittest.TestCase): # Force the POSIX locale env = os.environ.copy() env["LC_ALL"] = "C" @@ -478,8 +594,25 @@ index ed78e2a..3844812 100644 code = '\n'.join(( 'import sys', 'def dump(name):', +diff --git a/Modules/main.c b/Modules/main.c +index dd50211..f20cf24 100644 +--- a/Modules/main.c ++++ b/Modules/main.c +@@ -105,7 +105,11 @@ static const char usage_6[] = + " predictable seed.\n" + "PYTHONMALLOC: set the Python memory allocators and/or install debug hooks\n" + " on Python memory allocators. Use PYTHONMALLOC=debug to install debug\n" +-" hooks.\n"; ++" hooks.\n" ++ ++"PYTHONCOERCECLOCALE: if this variable is set to 0, it disables the locale\n" ++" coercion behavior. Use PYTHONCOERCECLOCALE=warn to request display of\n" ++" locale coercion and locale compatibility warnings on stderr.\n"; + + static int + usage(int exitcode, const wchar_t* program) diff --git a/Programs/_testembed.c b/Programs/_testembed.c -index a68d4fa..280bf50 100644 +index 3968399..1bd2bbf 100644 --- a/Programs/_testembed.c +++ b/Programs/_testembed.c @@ -1,4 +1,5 @@ @@ -562,7 +695,7 @@ index a7afbc7..03f8295 100644 for (i = 0; i < argc; i++) { PyMem_RawFree(argv_copy2[i]); diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c -index c0f41b3..278a5af 100644 +index a4f7f82..743d9b6 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -167,6 +167,7 @@ Py_SetStandardStreamEncoding(const char *encoding, const char *errors) @@ -573,7 +706,7 @@ index c0f41b3..278a5af 100644 /* Global initializations. Can be undone by Py_FinalizeEx(). Don't call this twice without an intervening Py_FinalizeEx() call. When initializations fail, a fatal error is issued and the function does -@@ -302,6 +303,167 @@ import_init(PyInterpreterState *interp, PyObject *sysmod) +@@ -301,6 +302,181 @@ import_init(PyInterpreterState *interp, PyObject *sysmod) } @@ -600,22 +733,64 @@ index c0f41b3..278a5af 100644 +int +_Py_LegacyLocaleDetected(void) +{ ++#ifndef MS_WINDOWS ++ /* On non-Windows systems, the C locale is considered a legacy locale */ ++ /* XXX (ncoghlan): some platforms (notably Mac OS X) don't appear to treat ++ * the POSIX locale as a simple alias for the C locale, so ++ * we may also want to check for that explicitly. ++ */ + const char *ctype_loc = setlocale(LC_CTYPE, NULL); + return ctype_loc != NULL && strcmp(ctype_loc, "C") == 0; ++#else ++ /* Windows uses code pages instead of locales, so no locale is legacy */ ++ return 0; ++#endif ++} ++ ++ ++static const char *_C_LOCALE_WARNING = ++ "Python runtime initialized with LC_CTYPE=C (a locale with default ASCII " ++ "encoding), which may cause Unicode compatibility problems. Using C.UTF-8, " ++ "C.utf8, or UTF-8 (if available) as alternative Unicode-compatible " ++ "locales is recommended.\n"; ++ ++static int ++_legacy_locale_warnings_enabled(void) ++{ ++ const char *coerce_c_locale = getenv("PYTHONCOERCECLOCALE"); ++ return (coerce_c_locale != NULL && ++ strncmp(coerce_c_locale, "warn", 5) == 0); ++} ++ ++static void ++_emit_stderr_warning_for_legacy_locale(void) ++{ ++ if (_legacy_locale_warnings_enabled()) { ++ if (_Py_LegacyLocaleDetected()) { ++ fprintf(stderr, "%s", _C_LOCALE_WARNING); ++ } ++ } +} + +typedef struct _CandidateLocale { + const char *locale_name; /* The locale to try as a coercion target */ -+ int set_LANG; /* Whether to set LANG in addition to LC_CTYPE */ +} _LocaleCoercionTarget; + +static _LocaleCoercionTarget _TARGET_LOCALES[] = { -+ { "C.UTF-8", 1 }, -+ { "C.utf8", 1}, -+ { "UTF-8", 0 }, -+ { NULL, 0 } ++ {"C.UTF-8"}, ++ {"C.utf8"}, ++ /* {"UTF-8"}, */ ++ {NULL} +}; + ++/* XXX (ncoghlan): Using UTF-8 as a target locale is currently disabled due to ++ * problems encountered on *BSD systems with those test cases ++ * For additional details see: ++ * nl_langinfo CODESET error: https://bugs.python.org/issue30647 ++ * locale handling differences: https://bugs.python.org/issue30672 ++ */ ++ ++ +static char * +get_default_standard_stream_error_handler(void) +{ @@ -626,6 +801,7 @@ index c0f41b3..278a5af 100644 + return "surrogateescape"; + } + ++#ifdef PY_COERCE_C_LOCALE + /* "surrogateescape" is the default in locale coercion target locales */ + const _LocaleCoercionTarget *target = NULL; + for (target = _TARGET_LOCALES; target->locale_name; target++) { @@ -633,6 +809,7 @@ index c0f41b3..278a5af 100644 + return "surrogateescape"; + } + } ++#endif + } + + /* Otherwise return NULL to request the typical default error handler */ @@ -641,52 +818,34 @@ index c0f41b3..278a5af 100644 + +#ifdef PY_COERCE_C_LOCALE +static const char *_C_LOCALE_COERCION_WARNING = -+ "Python detected LC_CTYPE=C: %.20s coerced to %.20s (set another locale " ++ "Python detected LC_CTYPE=C: LC_CTYPE coerced to %.20s (set another locale " + "or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior).\n"; + +static void +_coerce_default_locale_settings(const _LocaleCoercionTarget *target) +{ -+ const char *env_vars_updated = "LC_CTYPE"; ++ + const char *newloc = target->locale_name; + + /* Reset locale back to currently configured defaults */ + setlocale(LC_ALL, ""); + -+ /* Set the relevant locale environment variables */ ++ /* Set the relevant locale environment variable */ + if (setenv("LC_CTYPE", newloc, 1)) { + fprintf(stderr, + "Error setting LC_CTYPE, skipping C locale coercion\n"); + return; + } -+ if (target->set_LANG) { -+ if (setenv("LANG", newloc, 1) == 0) { -+ env_vars_updated = "LC_CTYPE & LANG"; -+ } else { -+ fprintf(stderr, -+ "Error setting LANG during C locale coercion\n"); -+ } ++ if (_legacy_locale_warnings_enabled()) { ++ fprintf(stderr, _C_LOCALE_COERCION_WARNING, newloc); + } -+ fprintf(stderr, _C_LOCALE_COERCION_WARNING, env_vars_updated, newloc); + + /* Reconfigure with the overridden environment variables */ + setlocale(LC_ALL, ""); +} -+ -+static int -+c_locale_coercion_is_expected(void) -+{ -+ /* This may be called prior to Py_Initialize, so we don't call any other -+ * Python APIs, and we ignore the -E and -I flags -+ */ -+ const char *coerce_c_locale = getenv("PYTHONCOERCECLOCALE"); -+ if (coerce_c_locale == NULL || strncmp(coerce_c_locale, "0", 2) != 0) { -+ return 1; -+ } -+ return 0; -+} +#endif + ++ +void +_Py_CoerceLegacyLocale(void) +{ @@ -697,9 +856,15 @@ index c0f41b3..278a5af 100644 + * to give end users a way to force even scripts that are otherwise + * isolated from their environment to use the legacy ASCII-centric C + * locale. -+ */ -+ if (c_locale_coercion_is_expected()) { -+ /* PYTHONCOERCECLOCALE is not set, or is not set to exactly "0" */ ++ * ++ * Ignoring -E and -I is safe from a security perspective, as we only use ++ * the setting to turn *off* the implicit locale coercion, and anyone with ++ * access to the process environment already has the ability to set ++ * `LC_ALL=C` to override the C level locale settings anyway. ++ */ ++ const char *coerce_c_locale = getenv("PYTHONCOERCECLOCALE"); ++ if (coerce_c_locale == NULL || strncmp(coerce_c_locale, "0", 2) != 0) { ++ /* PYTHONCOERCECLOCALE is not set, or is set to something other than "0" */ + const char *locale_override = getenv("LC_ALL"); + if (locale_override == NULL || *locale_override == '\0') { + /* LC_ALL is also not set (or is set to an empty string) */ @@ -719,29 +884,11 @@ index c0f41b3..278a5af 100644 +#endif +} + -+ -+#ifdef PY_WARN_ON_C_LOCALE -+static const char *_C_LOCALE_WARNING = -+ "Python runtime initialized with LC_CTYPE=C (a locale with default ASCII " -+ "encoding), which may cause Unicode compatibility problems. Using C.UTF-8, " -+ "C.utf8, or UTF-8 (if available) as alternative Unicode-compatible " -+ "locales is recommended.\n"; -+ -+static void -+_emit_stderr_warning_for_c_locale(void) -+{ -+ if (c_locale_coercion_is_expected()) { -+ if (_Py_LegacyLocaleDetected()) { -+ fprintf(stderr, "%s", _C_LOCALE_WARNING); -+ } -+ } -+} -+#endif + void _Py_InitializeEx_Private(int install_sigs, int install_importlib) { -@@ -316,11 +478,19 @@ _Py_InitializeEx_Private(int install_sigs, int install_importlib) +@@ -315,11 +491,19 @@ _Py_InitializeEx_Private(int install_sigs, int install_importlib) initialized = 1; _Py_Finalizing = NULL; @@ -752,17 +899,17 @@ index c0f41b3..278a5af 100644 + */ + setlocale(LC_CTYPE, "C.UTF-8"); +#else ++#ifndef MS_WINDOWS /* Set up the LC_CTYPE locale, so we can obtain the locale's charset without having to switch locales. */ setlocale(LC_CTYPE, ""); -+#ifdef PY_WARN_ON_C_LOCALE -+ _emit_stderr_warning_for_c_locale(); ++ _emit_stderr_warning_for_legacy_locale(); +#endif #endif if ((p = Py_GETENV("PYTHONDEBUG")) && *p != '\0') -@@ -1252,12 +1422,8 @@ initstdio(void) +@@ -1242,12 +1426,8 @@ initstdio(void) } } if (!errors && !(pythonioencoding && *pythonioencoding)) { @@ -778,7 +925,7 @@ index c0f41b3..278a5af 100644 } diff --git a/configure b/configure -index c9340c6..8b1bd5b 100755 +index 2915246..39e5a27 100755 --- a/configure +++ b/configure @@ -834,6 +834,8 @@ with_thread @@ -790,7 +937,7 @@ index c9340c6..8b1bd5b 100755 with_valgrind with_dtrace with_fpectl -@@ -1538,6 +1540,12 @@ Optional Packages: +@@ -1527,6 +1529,12 @@ Optional Packages: deprecated; use --with(out)-threads --with(out)-doc-strings disable/enable documentation strings --with(out)-pymalloc disable/enable specialized mallocs @@ -803,7 +950,7 @@ index c9340c6..8b1bd5b 100755 --with-valgrind Enable Valgrind support --with(out)-dtrace disable/enable DTrace support --with-fpectl enable SIGFPE catching -@@ -11030,6 +11038,52 @@ fi +@@ -11010,6 +11018,52 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_pymalloc" >&5 $as_echo "$with_pymalloc" >&6; } @@ -857,10 +1004,10 @@ index c9340c6..8b1bd5b 100755 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-valgrind" >&5 $as_echo_n "checking for --with-valgrind... " >&6; } diff --git a/configure.ac b/configure.ac -index e065ce5..c455ebd 100644 +index 67dfba3..b9c9f04 100644 --- a/configure.ac +++ b/configure.ac -@@ -3304,6 +3304,40 @@ then +@@ -3279,6 +3279,40 @@ then fi AC_MSG_RESULT($with_pymalloc) @@ -902,10 +1049,10 @@ index e065ce5..c455ebd 100644 AC_MSG_CHECKING([for --with-valgrind]) AC_ARG_WITH([valgrind], diff --git a/pyconfig.h.in b/pyconfig.h.in -index 0a3d59e..fa2792b 100644 +index b10c57f..0a6f3e2 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in -@@ -1247,9 +1247,15 @@ +@@ -1244,9 +1244,15 @@ /* Define as the preferred size in bits of long digits */ #undef PYLONG_BITS_IN_DIGIT diff --git a/python3.spec b/python3.spec index 9ac8875..d6687c7 100644 --- a/python3.spec +++ b/python3.spec @@ -133,7 +133,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.1 -Release: 9%{?dist} +Release: 10%{?dist} License: Python Group: Development/Languages @@ -434,11 +434,6 @@ Patch252: 00252-add-executable-option.patch # Reported upstream: http://bugs.python.org/issue29324 Patch258: 00258-fix-test_aead_aes_gcm.patch -# 00261 # -# Use proper command line parsing in _testembed -# Fixed upstream: http://bugs.python.org/issue24932 -Patch261: 00261-use-proper-command-line-parsing-in-_testembed.patch - # 00262 # # Backport of PEP 538: Coercing the legacy C locale to a UTF-8 based locale # https://www.python.org/dev/peps/pep-0538/ @@ -733,7 +728,6 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch251 -p1 %patch252 -p1 %patch258 -p1 -%patch261 -p1 %patch262 -p1 %ifarch aarch64 @@ -1702,6 +1696,9 @@ fi # ====================================================== %changelog +* Tue Jun 27 2017 Charalampos Stratakis - 3.6.1-10 +- Update to the latest upstream implementation of PEP 538 + * Mon Jun 26 2017 Michal Cyprian - 3.6.1-9 - Make pip and distutils in user environment install into separate location From 7e7918aaddfee38280ec59be3eccebd20574c651 Mon Sep 17 00:00:00 2001 From: Tomas Orsava Date: Tue, 27 Jun 2017 18:02:44 +0200 Subject: [PATCH 338/416] Fix for a build failure when with_debug_build=0 --- python3.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python3.spec b/python3.spec index d6687c7..583c706 100644 --- a/python3.spec +++ b/python3.spec @@ -1145,6 +1145,7 @@ echo '[ $? -eq 127 ] && echo "Could not find python%{LDVERSION_optimized}-`uname %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-config chmod +x %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-config +%if 0%{?with_debug_build} # Rename the -debug script that differs on different arches to arch specific name mv %{buildroot}%{_bindir}/python%{LDVERSION_debug}-{,`uname -m`-}config echo -e '#!/bin/sh\nexec `dirname $0`/python%{LDVERSION_debug}-`uname -m`-config "$@"' > \ @@ -1152,11 +1153,13 @@ echo -e '#!/bin/sh\nexec `dirname $0`/python%{LDVERSION_debug}-`uname -m`-config echo '[ $? -eq 127 ] && echo "Could not find python%{LDVERSION_debug}-`uname -m`-config. Look around to see available arches." >&2' >> \ %{buildroot}%{_bindir}/python%{LDVERSION_debug}-config chmod +x %{buildroot}%{_bindir}/python%{LDVERSION_debug}-config +%endif # with_debug_build # System Python: Copy the executable to libexec mkdir -p %{buildroot}%{_libexecdir} cp %{buildroot}%{_bindir}/python%{pybasever} %{buildroot}%{_libexecdir}/system-python + # ====================================================== # Running the upstream test suite # ====================================================== From 46034c8139e9ae1077d3f777689c074b90a6b990 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Wed, 28 Jun 2017 15:46:50 +0200 Subject: [PATCH 339/416] Provide additional references for patches 251 and 252 --- python3.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python3.spec b/python3.spec index 583c706..9c82d21 100644 --- a/python3.spec +++ b/python3.spec @@ -421,11 +421,13 @@ Patch249: 00249-fix-out-of-tree-dtrace-builds.patch # Set values of prefix and exec_prefix in distutils install command # to /usr/local if executable is /usr/bin/python* and RPM build # is not detected to make pip and distutils install into separate location +# Fedora Change: https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe Patch251: 00251-change-user-install-location.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 # 00258 # From 4ff21139d780d1b13cbb8e6525e611feb426a6aa Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Tue, 18 Jul 2017 16:40:02 +0200 Subject: [PATCH 340/416] Update to Python 3.6.2 Rebased patch 180. Dropped patches 249, 258, 269 as they have been upstreamed. --- 00180-python-add-support-for-ppc64p7.patch | 11 +++++---- python3.spec | 28 ++++------------------ sources | 2 +- 3 files changed, 12 insertions(+), 29 deletions(-) diff --git a/00180-python-add-support-for-ppc64p7.patch b/00180-python-add-support-for-ppc64p7.patch index 022944a..054f9f3 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 40ea5df..932128b 100755 +--- a/config.sub ++++ b/config.sub +@@ -1045,7 +1045,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/python3.spec b/python3.spec index 9c82d21..f088855 100644 --- a/python3.spec +++ b/python3.spec @@ -132,8 +132,8 @@ # ================== Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 -Version: %{pybasever}.1 -Release: 10%{?dist} +Version: %{pybasever}.2 +Release: 1%{?dist} License: Python Group: Development/Languages @@ -411,12 +411,6 @@ Patch206: 00206-remove-hf-from-arm-triplet.patch # Fedora needs the default mips64-linux-gnu Patch243: 00243-fix-mips64-triplet.patch -# 00249 # -# Fix builds using the --with-dtrace flag as the rpmbuild -# of python is an out of tree build -# Not yet fixed upstream: http://bugs.python.org/issue28787 -Patch249: 00249-fix-out-of-tree-dtrace-builds.patch - # 00251 # Set values of prefix and exec_prefix in distutils install command # to /usr/local if executable is /usr/bin/python* and RPM build @@ -430,12 +424,6 @@ Patch251: 00251-change-user-install-location.patch # Reported upstream: https://bugs.python.org/issue29411 Patch252: 00252-add-executable-option.patch -# 00258 # -# Kernel 4.9 introduced some changes to its crypto API -# making test_aead_aes_gcm fail, so skipping the test for now -# Reported upstream: http://bugs.python.org/issue29324 -Patch258: 00258-fix-test_aead_aes_gcm.patch - # 00262 # # Backport of PEP 538: Coercing the legacy C locale to a UTF-8 based locale # https://www.python.org/dev/peps/pep-0538/ @@ -450,12 +438,6 @@ Patch262: 00262-pep538_coerce_legacy_c_locale.patch # Reported upstream: http://bugs.python.org/issue29804 Patch264: 00264-skip-test-failing-on-aarch64.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. @@ -726,17 +708,14 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch205 -p1 %patch206 -p1 %patch243 -p1 -%patch249 -p1 %patch251 -p1 %patch252 -p1 -%patch258 -p1 %patch262 -p1 %ifarch aarch64 %patch264 -p1 %endif -%patch269 -p1 %patch270 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there @@ -1701,6 +1680,9 @@ fi # ====================================================== %changelog +* Tue Jul 18 2017 Charalampos Stratakis - 3.6.2-1 +- Update to Python 3.6.2 + * Tue Jun 27 2017 Charalampos Stratakis - 3.6.1-10 - Update to the latest upstream implementation of PEP 538 diff --git a/sources b/sources index 9bb64d1..af1a1e7 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Python-3.6.1.tar.xz) = 8605fb7019386fec227d4b06d06f00ae500a8a89df289bfe6141bb56196c75483a60cc0ee553930742b31cefce68add5ccf226e0f27b7b915f5026d597e1ac29 +SHA512 (Python-3.6.2.tar.xz) = a8270a09a9e9b39f69ece6cdade2fa964665d2107b5acbad4453f1b921107b329c697c137185928fb4a576fc0f2ae2a98dbf26a8b7ea17219e990ddbc216db8b From f13050e2f3c3d6cacd218ee50859d93357b62f81 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Tue, 18 Jul 2017 16:48:45 +0200 Subject: [PATCH 341/416] Update the PEP 538 backport --- 00262-pep538_coerce_legacy_c_locale.patch | 66 +++++++++++++++-------- 1 file changed, 43 insertions(+), 23 deletions(-) diff --git a/00262-pep538_coerce_legacy_c_locale.patch b/00262-pep538_coerce_legacy_c_locale.patch index 856ef77..d749bac 100644 --- a/00262-pep538_coerce_legacy_c_locale.patch +++ b/00262-pep538_coerce_legacy_c_locale.patch @@ -124,13 +124,14 @@ index ca5f9c2..7aa460b 100644 def assert_python_ok(*args, **env_vars): diff --git a/Lib/test/test_c_locale_coercion.py b/Lib/test/test_c_locale_coercion.py new file mode 100644 -index 0000000..a4b4626 +index 0000000..635c98f --- /dev/null +++ b/Lib/test/test_c_locale_coercion.py -@@ -0,0 +1,353 @@ +@@ -0,0 +1,371 @@ +# Tests the attempted automatic coercion of the C locale to a UTF-8 locale + +import unittest ++import locale +import os +import sys +import sysconfig @@ -146,7 +147,14 @@ index 0000000..a4b4626 + +# Set our expectation for the default encoding used in the C locale +# for the filesystem encoding and the standard streams -+C_LOCALE_STREAM_ENCODING = "ascii" ++ ++# AIX uses iso8859-1 in the C locale, other *nix platforms use ASCII ++if sys.platform.startswith("aix"): ++ C_LOCALE_STREAM_ENCODING = "iso8859-1" ++else: ++ C_LOCALE_STREAM_ENCODING = "ascii" ++ ++# FS encoding is UTF-8 on macOS, other *nix platforms use the locale encoding +if sys.platform == "darwin": + C_LOCALE_FS_ENCODING = "utf-8" +else: @@ -162,24 +170,34 @@ index 0000000..a4b4626 + +# In order to get the warning messages to match up as expected, the candidate +# order here must much the target locale order in Python/pylifecycle.c -+_C_UTF8_LOCALES = ("C.UTF-8", "C.utf8") #, "UTF-8") -+ -+# XXX (ncoghlan): Using UTF-8 as a target locale is currently disabled due to -+# problems encountered on *BSD systems with those test cases -+# For additional details see: -+# nl_langinfo CODESET error: https://bugs.python.org/issue30647 -+# locale handling differences: https://bugs.python.org/issue30672 ++_C_UTF8_LOCALES = ("C.UTF-8", "C.utf8", "UTF-8") + +# There's no reliable cross-platform way of checking locale alias +# lists, so the only way of knowing which of these locales will work +# is to try them with locale.setlocale(). We do that in a subprocess +# to avoid altering the locale of the test runner. ++# ++# If the relevant locale module attributes exist, and we're not on a platform ++# where we expect it to always succeed, we also check that ++# `locale.nl_langinfo(locale.CODESET)` works, as if it fails, the interpreter ++# will skip locale coercion for that particular target locale ++_check_nl_langinfo_CODESET = bool( ++ sys.platform not in ("darwin", "linux") and ++ hasattr(locale, "nl_langinfo") and ++ hasattr(locale, "CODESET") ++) ++ +def _set_locale_in_subprocess(locale_name): + cmd_fmt = "import locale; print(locale.setlocale(locale.LC_CTYPE, '{}'))" ++ if _check_nl_langinfo_CODESET: ++ # If there's no valid CODESET, we expect coercion to be skipped ++ cmd_fmt += "; import sys; sys.exit(not locale.nl_langinfo(locale.CODESET))" + cmd = cmd_fmt.format(locale_name) + result, py_cmd = run_python_until_end("-c", cmd, __isolated=True) + return result.rc == 0 + ++ ++ +_fields = "fsencoding stdin_info stdout_info stderr_info lang lc_ctype lc_all" +_EncodingDetails = namedtuple("EncodingDetails", _fields) + @@ -695,7 +713,7 @@ index a7afbc7..03f8295 100644 for (i = 0; i < argc; i++) { PyMem_RawFree(argv_copy2[i]); diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c -index a4f7f82..743d9b6 100644 +index a4f7f82..3843297 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -167,6 +167,7 @@ Py_SetStandardStreamEncoding(const char *encoding, const char *errors) @@ -706,7 +724,7 @@ index a4f7f82..743d9b6 100644 /* Global initializations. Can be undone by Py_FinalizeEx(). Don't call this twice without an intervening Py_FinalizeEx() call. When initializations fail, a fatal error is issued and the function does -@@ -301,6 +302,181 @@ import_init(PyInterpreterState *interp, PyObject *sysmod) +@@ -301,6 +302,183 @@ import_init(PyInterpreterState *interp, PyObject *sysmod) } @@ -779,18 +797,10 @@ index a4f7f82..743d9b6 100644 +static _LocaleCoercionTarget _TARGET_LOCALES[] = { + {"C.UTF-8"}, + {"C.utf8"}, -+ /* {"UTF-8"}, */ ++ {"UTF-8"}, + {NULL} +}; + -+/* XXX (ncoghlan): Using UTF-8 as a target locale is currently disabled due to -+ * problems encountered on *BSD systems with those test cases -+ * For additional details see: -+ * nl_langinfo CODESET error: https://bugs.python.org/issue30647 -+ * locale handling differences: https://bugs.python.org/issue30672 -+ */ -+ -+ +static char * +get_default_standard_stream_error_handler(void) +{ @@ -873,6 +883,16 @@ index a4f7f82..743d9b6 100644 + const char *new_locale = setlocale(LC_CTYPE, + target->locale_name); + if (new_locale != NULL) { ++#if !defined(__APPLE__) && defined(HAVE_LANGINFO_H) && defined(CODESET) ++ /* Also ensure that nl_langinfo works in this locale */ ++ char *codeset = nl_langinfo(CODESET); ++ if (!codeset || *codeset == '\0') { ++ /* CODESET is not set or empty, so skip coercion */ ++ new_locale = NULL; ++ setlocale(LC_CTYPE, ""); ++ continue; ++ } ++#endif + /* Successfully configured locale, so make it the default */ + _coerce_default_locale_settings(target); + return; @@ -888,7 +908,7 @@ index a4f7f82..743d9b6 100644 void _Py_InitializeEx_Private(int install_sigs, int install_importlib) { -@@ -315,11 +491,19 @@ _Py_InitializeEx_Private(int install_sigs, int install_importlib) +@@ -315,11 +493,19 @@ _Py_InitializeEx_Private(int install_sigs, int install_importlib) initialized = 1; _Py_Finalizing = NULL; @@ -909,7 +929,7 @@ index a4f7f82..743d9b6 100644 #endif if ((p = Py_GETENV("PYTHONDEBUG")) && *p != '\0') -@@ -1242,12 +1426,8 @@ initstdio(void) +@@ -1242,12 +1428,8 @@ initstdio(void) } } if (!errors && !(pythonioencoding && *pythonioencoding)) { From a94422417ac24993a018cb80fc3b00f2d337f18f Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Wed, 19 Jul 2017 14:25:35 +0200 Subject: [PATCH 342/416] Remove unused patches --- ...d-build-with-libffi-multilib-wrapper.patch | 12 -- ...6-test-gdb-match-addr-before-builtin.patch | 30 ----- 00249-fix-out-of-tree-dtrace-builds.patch | 12 -- 00258-fix-test_aead_aes_gcm.patch | 12 -- ...r-command-line-parsing-in-_testembed.patch | 104 ------------------ ...e-compilations-issue-with-pgo-builds.patch | 67 ----------- ...arily-disable-tests-requiring-SIGHUP.patch | 25 ----- 7 files changed, 262 deletions(-) delete mode 100644 00184-ctypes-should-build-with-libffi-multilib-wrapper.patch delete mode 100644 00196-test-gdb-match-addr-before-builtin.patch delete mode 100644 00249-fix-out-of-tree-dtrace-builds.patch delete mode 100644 00258-fix-test_aead_aes_gcm.patch delete mode 100644 00261-use-proper-command-line-parsing-in-_testembed.patch delete mode 100644 00269-fix-multiple-compilations-issue-with-pgo-builds.patch delete mode 100644 temporarily-disable-tests-requiring-SIGHUP.patch 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 e224fc6..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/00196-test-gdb-match-addr-before-builtin.patch b/00196-test-gdb-match-addr-before-builtin.patch deleted file mode 100644 index dc40c82..0000000 --- a/00196-test-gdb-match-addr-before-builtin.patch +++ /dev/null @@ -1,30 +0,0 @@ -Subject: python3.test gdb match addr before builtin -From: Michel Normand - -For ppc64le archi and python3... and gdb... versions -the test_gdb.py need a change of re.match to handle address before the builtin_id word. -Of course there is no error if this substring is not present. -=== -... -#0 0x00003fffb7dd0898 in builtin_id (self=, v=) at /builddir/build/BUILD/Python-3.3.2/Python/bltinmodule.c:966 -....xxxxxxxxxxxxxxxxxxxxxx <= added regexp -=== - -Signed-off-by: Michel Normand ---- - Lib/test/test_gdb.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Index: Python-3.3.2/Lib/test/test_gdb.py -=================================================================== ---- Python-3.3.2.orig/Lib/test/test_gdb.py -+++ Python-3.3.2/Lib/test/test_gdb.py -@@ -230,7 +230,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+\S*Python/bltinmodule.c.*', -+ m = re.match('.*#0\s+(?: 0x[0-9a-f]+\s+in\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/00249-fix-out-of-tree-dtrace-builds.patch b/00249-fix-out-of-tree-dtrace-builds.patch deleted file mode 100644 index d5de53c..0000000 --- a/00249-fix-out-of-tree-dtrace-builds.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/Makefile.pre.in b/Makefile.pre.in -index 28df0e1..42f811c 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -867,6 +867,7 @@ Python/frozen.o: Python/importlib.h Python/importlib_external.h - # follow our naming conventions. dtrace(1) uses the output filename to generate - # an include guard, so we can't use a pipeline to transform its output. - Include/pydtrace_probes.h: $(srcdir)/Include/pydtrace.d -+ @$(MKDIR_P) Include - $(DTRACE) $(DFLAGS) -o $@ -h -s $< - : sed in-place edit with POSIX-only tools - sed 's/PYTHON_/PyDTrace_/' $@ > $@.tmp diff --git a/00258-fix-test_aead_aes_gcm.patch b/00258-fix-test_aead_aes_gcm.patch deleted file mode 100644 index 1d061fd..0000000 --- a/00258-fix-test_aead_aes_gcm.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py -index 8992a01..74170f4 100644 ---- a/Lib/test/test_socket.py -+++ b/Lib/test/test_socket.py -@@ -5458,6 +5458,7 @@ class LinuxKernelCryptoAPI(unittest.TestCase): - self.assertEqual(dec, msg * multiplier) - - @support.requires_linux_version(4, 3) # see test_aes_cbc -+ @unittest.skip('Failure on Kernel 4.9+') - def test_aead_aes_gcm(self): - key = bytes.fromhex('c939cc13397c1d37de6ae0e1cb7c423c') - iv = bytes.fromhex('b3d8cc017cbb89b39e0f67e2') diff --git a/00261-use-proper-command-line-parsing-in-_testembed.patch b/00261-use-proper-command-line-parsing-in-_testembed.patch deleted file mode 100644 index 49db110..0000000 --- a/00261-use-proper-command-line-parsing-in-_testembed.patch +++ /dev/null @@ -1,104 +0,0 @@ -diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py -index 6c3625d..2a53f3d 100644 ---- a/Lib/test/test_capi.py -+++ b/Lib/test/test_capi.py -@@ -385,7 +385,7 @@ class EmbeddingTests(unittest.TestCase): - - def test_subinterps(self): - # This is just a "don't crash" test -- out, err = self.run_embedded_interpreter() -+ out, err = self.run_embedded_interpreter("repeated_init_and_subinterpreters") - if support.verbose: - print() - print(out) -diff --git a/Programs/_testembed.c b/Programs/_testembed.c -index 3968399..a68d4fa 100644 ---- a/Programs/_testembed.c -+++ b/Programs/_testembed.c -@@ -33,7 +33,7 @@ static void print_subinterp(void) - ); - } - --static void test_repeated_init_and_subinterpreters(void) -+static int test_repeated_init_and_subinterpreters(void) - { - PyThreadState *mainstate, *substate; - #ifdef WITH_THREAD -@@ -70,6 +70,7 @@ static void test_repeated_init_and_subinterpreters(void) - PyEval_RestoreThread(mainstate); - Py_Finalize(); - } -+ return 0; - } - - /***************************************************** -@@ -103,7 +104,7 @@ static void check_stdio_details(const char *encoding, const char * errors) - Py_Finalize(); - } - --static void test_forced_io_encoding(void) -+static int test_forced_io_encoding(void) - { - /* Check various combinations */ - printf("--- Use defaults ---\n"); -@@ -122,19 +123,51 @@ static void test_forced_io_encoding(void) - printf("Unexpected success calling Py_SetStandardStreamEncoding"); - } - Py_Finalize(); -+ return 0; - } - --/* Different embedding tests */ --int main(int argc, char *argv[]) -+/* ********************************************************* -+ * List of test cases and the function that implements it. -+ * -+ * Names are compared case-sensitively with the first -+ * argument. If no match is found, or no first argument was -+ * provided, the names of all test cases are printed and -+ * the exit code will be -1. -+ * -+ * The int returned from test functions is used as the exit -+ * code, and test_capi treats all non-zero exit codes as a -+ * failed test. -+ *********************************************************/ -+struct TestCase - { -+ const char *name; -+ int (*func)(void); -+}; -+ -+static struct TestCase TestCases[] = { -+ { "forced_io_encoding", test_forced_io_encoding }, -+ { "repeated_init_and_subinterpreters", test_repeated_init_and_subinterpreters }, -+ { NULL, NULL } -+}; - -- /* TODO: Check the argument string to allow for more test cases */ -+int main(int argc, char *argv[]) -+{ - if (argc > 1) { -- /* For now: assume "forced_io_encoding */ -- test_forced_io_encoding(); -- } else { -- /* Run the original embedding test case by default */ -- test_repeated_init_and_subinterpreters(); -+ for (struct TestCase *tc = TestCases; tc && tc->name; tc++) { -+ if (strcmp(argv[1], tc->name) == 0) -+ return (*tc->func)(); -+ } - } -- return 0; -+ -+ /* No match found, or no test name provided, so display usage */ -+ printf("Python " PY_VERSION " _testembed executable for embedded interpreter tests\n" -+ "Normally executed via 'EmbeddingTests' in Lib/test/test_capi.py\n\n" -+ "Usage: %s TESTNAME\n\nAll available tests:\n", argv[0]); -+ for (struct TestCase *tc = TestCases; tc && tc->name; tc++) { -+ printf(" %s\n", tc->name); -+ } -+ -+ /* Non-zero exit code will cause test_capi.py tests to fail. -+ This is intentional. */ -+ return -1; - } 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 a911feb..0000000 --- a/00269-fix-multiple-compilations-issue-with-pgo-builds.patch +++ /dev/null @@ -1,67 +0,0 @@ -diff --git a/Makefile.pre.in b/Makefile.pre.in -index 0e1d0af..42ab191 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -989,7 +989,7 @@ TESTTIMEOUT= 1200 - - # Run a basic set of regression tests. - # This excludes some tests that are particularly resource-intensive. --test: all platform -+test: @DEF_MAKE_RULE@ platform - $(TESTRUNNER) $(TESTOPTS) - - # Run the full test suite twice - once without .pyc files, and once with. -@@ -999,7 +999,7 @@ test: all platform - # the bytecode read from a .pyc file had the bug, sometimes the directly - # generated bytecode. This is sometimes a very shy bug needing a lot of - # sample data. --testall: all platform -+testall: @DEF_MAKE_RULE@ platform - -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f - $(TESTPYTHON) -E $(srcdir)/Lib/compileall.py - -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f -@@ -1008,7 +1008,7 @@ testall: all platform - - # Run the test suite 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 ;\ -@@ -1031,7 +1031,7 @@ QUICKTESTOPTS= $(TESTOPTS) -x test_subprocess test_io test_lib2to3 \ - test_multiprocessing_forkserver \ - test_mailbox test_socket test_poll \ - test_select test_zipfile test_concurrent_futures --quicktest: all platform -+quicktest: @DEF_MAKE_RULE@ platform - $(TESTRUNNER) $(QUICKTESTOPTS) - - -@@ -1368,7 +1368,7 @@ LIBPL= $(LIBDEST)/config-$(LDVERSION)-$(MULTIARCH) - # pkgconfig directory - LIBPC= $(LIBDIR)/pkgconfig - --libainstall: all python-config -+libainstall: @DEF_MAKE_RULE@ python-config - @for i in $(LIBDIR) $(LIBPL) $(LIBPC); \ - do \ - if test ! -d $(DESTDIR)$$i; then \ -@@ -1616,7 +1616,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; \ - -@@ -1653,7 +1653,7 @@ funny: - -o -print - - # Perform some verification checks on any modified files. --patchcheck: all -+patchcheck: @DEF_MAKE_RULE@ - $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py - - # Dependencies diff --git a/temporarily-disable-tests-requiring-SIGHUP.patch b/temporarily-disable-tests-requiring-SIGHUP.patch deleted file mode 100644 index 30ceb94..0000000 --- a/temporarily-disable-tests-requiring-SIGHUP.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff -up Python-3.4.0/Lib/test/test_asyncio/test_events.py.orig Python-3.4.0/Lib/test/test_asyncio/test_events.py ---- Python-3.4.0/Lib/test/test_asyncio/test_events.py.orig 2014-04-15 13:18:49.696215288 +0200 -+++ Python-3.4.0/Lib/test/test_asyncio/test_events.py 2014-04-15 13:18:56.104258453 +0200 -@@ -1528,7 +1528,7 @@ class SubprocessTestsMixin: - self.check_terminated(proto.returncode) - transp.close() - -- @unittest.skipIf(sys.platform == 'win32', "Don't have SIGHUP") -+ @unittest.skipIf(True, "Temporarily skipped (rhbz#1088233)") - def test_subprocess_send_signal(self): - prog = os.path.join(os.path.dirname(__file__), 'echo.py') - - -diff -up Python-3.4.0/Lib/test/test_asyncio/test_subprocess.py.orig Python-3.4.0/Lib/test/test_asyncio/test_subprocess.py ---- Python-3.4.0/Lib/test/test_asyncio/test_subprocess.py.orig 2014-04-17 12:03:32.777827520 +0200 -+++ Python-3.4.0/Lib/test/test_asyncio/test_subprocess.py 2014-04-17 12:04:37.614210481 +0200 -@@ -108,7 +108,7 @@ class SubprocessMixin: - else: - self.assertEqual(-signal.SIGTERM, returncode) - -- @unittest.skipIf(sys.platform == 'win32', "Don't have SIGHUP") -+ @unittest.skipIf(True, "Temporarily skipped (rhbz#1088233)") - def test_send_signal(self): - code = 'import time; print("sleeping", flush=True); time.sleep(3600)' - args = [sys.executable, '-c', code] From 5b6a3e0e34f46702773ad1082df3b782c1a8b7ac Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Thu, 20 Jul 2017 17:50:38 +0200 Subject: [PATCH 343/416] Replace the "--verbose" flag with "-wW" when invoking the test suite, so that the tests are run in non-verbose mode by default and failed tests are rerun in verbose mode. Also add the "--slowest" flag when invoking the test suite to list the ten slowest tests at the end of the test run. --- python3.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index f088855..302dabb 100644 --- a/python3.spec +++ b/python3.spec @@ -1177,7 +1177,7 @@ CheckPython() { # aarch64, see upstream bug http://bugs.python.org/issue21131 WITHIN_PYTHON_RPM_BUILD= \ LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \ - --verbose --findleaks \ + -wW --slowest --findleaks \ -x test_distutils \ %ifarch ppc64le aarch64 -x test_faulthandler \ From 3a226ae7d71b76c0edd50b904a0f4323722a1eb6 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Tue, 25 Jul 2017 18:03:55 +0200 Subject: [PATCH 344/416] Make sure that we get the default signal handler for test_asyncio, The parent process may have decided to ignore SIGHUP, and signal handlers are inherited which can cause the test to hang in koji. --- ...1-asyncio-get-default-signal-handler.patch | 99 +++++++++++++++++++ python3.spec | 12 ++- 2 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 00271-asyncio-get-default-signal-handler.patch diff --git a/00271-asyncio-get-default-signal-handler.patch b/00271-asyncio-get-default-signal-handler.patch new file mode 100644 index 0000000..8b1bf77 --- /dev/null +++ b/00271-asyncio-get-default-signal-handler.patch @@ -0,0 +1,99 @@ +diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py +index 492a84a2313..9746678607c 100644 +--- a/Lib/test/test_asyncio/test_events.py ++++ b/Lib/test/test_asyncio/test_events.py +@@ -1980,19 +1980,26 @@ def test_subprocess_terminate(self): + + @unittest.skipIf(sys.platform == 'win32', "Don't have SIGHUP") + def test_subprocess_send_signal(self): +- prog = os.path.join(os.path.dirname(__file__), 'echo.py') +- +- connect = self.loop.subprocess_exec( +- functools.partial(MySubprocessProtocol, self.loop), +- sys.executable, prog) +- transp, proto = self.loop.run_until_complete(connect) +- self.assertIsInstance(proto, MySubprocessProtocol) +- self.loop.run_until_complete(proto.connected) +- +- transp.send_signal(signal.SIGHUP) +- self.loop.run_until_complete(proto.completed) +- self.assertEqual(-signal.SIGHUP, proto.returncode) +- transp.close() ++ # bpo-31034: Make sure that we get the default signal handler (killing ++ # the process). The parent process may have decided to ignore SIGHUP, ++ # and signal handlers are inherited. ++ old_handler = signal.signal(signal.SIGHUP, signal.SIG_DFL) ++ try: ++ prog = os.path.join(os.path.dirname(__file__), 'echo.py') ++ ++ connect = self.loop.subprocess_exec( ++ functools.partial(MySubprocessProtocol, self.loop), ++ sys.executable, prog) ++ transp, proto = self.loop.run_until_complete(connect) ++ self.assertIsInstance(proto, MySubprocessProtocol) ++ self.loop.run_until_complete(proto.connected) ++ ++ transp.send_signal(signal.SIGHUP) ++ self.loop.run_until_complete(proto.completed) ++ self.assertEqual(-signal.SIGHUP, proto.returncode) ++ transp.close() ++ finally: ++ signal.signal(signal.SIGHUP, old_handler) + + def test_subprocess_stderr(self): + prog = os.path.join(os.path.dirname(__file__), 'echo2.py') +diff --git a/Lib/test/test_asyncio/test_subprocess.py b/Lib/test/test_asyncio/test_subprocess.py +index 2e14a8a9735..e8822c36698 100644 +--- a/Lib/test/test_asyncio/test_subprocess.py ++++ b/Lib/test/test_asyncio/test_subprocess.py +@@ -166,25 +166,32 @@ def test_terminate(self): + + @unittest.skipIf(sys.platform == 'win32', "Don't have SIGHUP") + def test_send_signal(self): +- code = 'import time; print("sleeping", flush=True); time.sleep(3600)' +- args = [sys.executable, '-c', code] +- create = asyncio.create_subprocess_exec(*args, +- stdout=subprocess.PIPE, +- loop=self.loop) +- proc = self.loop.run_until_complete(create) +- +- @asyncio.coroutine +- def send_signal(proc): +- # basic synchronization to wait until the program is sleeping +- line = yield from proc.stdout.readline() +- self.assertEqual(line, b'sleeping\n') ++ # bpo-31034: Make sure that we get the default signal handler (killing ++ # the process). The parent process may have decided to ignore SIGHUP, ++ # and signal handlers are inherited. ++ old_handler = signal.signal(signal.SIGHUP, signal.SIG_DFL) ++ try: ++ code = 'import time; print("sleeping", flush=True); time.sleep(3600)' ++ args = [sys.executable, '-c', code] ++ create = asyncio.create_subprocess_exec(*args, ++ stdout=subprocess.PIPE, ++ loop=self.loop) ++ proc = self.loop.run_until_complete(create) + +- proc.send_signal(signal.SIGHUP) +- returncode = (yield from proc.wait()) +- return returncode +- +- returncode = self.loop.run_until_complete(send_signal(proc)) +- self.assertEqual(-signal.SIGHUP, returncode) ++ @asyncio.coroutine ++ def send_signal(proc): ++ # basic synchronization to wait until the program is sleeping ++ line = yield from proc.stdout.readline() ++ self.assertEqual(line, b'sleeping\n') ++ ++ proc.send_signal(signal.SIGHUP) ++ returncode = (yield from proc.wait()) ++ return returncode ++ ++ returncode = self.loop.run_until_complete(send_signal(proc)) ++ self.assertEqual(-signal.SIGHUP, returncode) ++ finally: ++ signal.signal(signal.SIGHUP, old_handler) + + def prepare_broken_pipe_test(self): + # buffer large enough to feed the whole pipe buffer diff --git a/python3.spec b/python3.spec index 302dabb..afce2a0 100644 --- a/python3.spec +++ b/python3.spec @@ -133,7 +133,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 1%{?dist} +Release: 2%{?dist} License: Python Group: Development/Languages @@ -444,6 +444,12 @@ Patch264: 00264-skip-test-failing-on-aarch64.patch # Fixed upstream: http://bugs.python.org/issue30714 Patch270: 00270-fix-ssl-alpn-hook-test.patch +# 00271 # +# Make test_asyncio to not depend on the current signal handler +# as this can make it hang on koji, since it ignores SIGHUP. +# Reported upstream: http://bugs.python.org/issue31034 +Patch271: 00271-asyncio-get-default-signal-handler.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -717,6 +723,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %endif %patch270 -p1 +%patch271 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1680,6 +1687,9 @@ fi # ====================================================== %changelog +* Tue Jul 25 2017 Charalampos Stratakis - 3.6.2-2 +- Make test_asyncio to not depend on the current SIGHUP signal handler. + * Tue Jul 18 2017 Charalampos Stratakis - 3.6.2-1 - Update to Python 3.6.2 From 4cc9b2e33c5622f9a683d9dcef4ec3307980f5d6 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 27 Jul 2017 12:26:00 +0000 Subject: [PATCH 345/416] - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild --- python3.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index afce2a0..6b6d0a3 100644 --- a/python3.spec +++ b/python3.spec @@ -133,7 +133,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 2%{?dist} +Release: 3%{?dist} License: Python Group: Development/Languages @@ -1687,6 +1687,9 @@ fi # ====================================================== %changelog +* Thu Jul 27 2017 Fedora Release Engineering - 3.6.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + * Tue Jul 25 2017 Charalampos Stratakis - 3.6.2-2 - Make test_asyncio to not depend on the current SIGHUP signal handler. From c6fe5c680bcaa684fb4a73bfceba37a2469e02cf Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Sun, 30 Jul 2017 17:13:49 +0200 Subject: [PATCH 346/416] Do not generate debuginfo subpackages (#1476593) Rebuild with binutils fix for ppc64le (#1475636) --- python3.spec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 6b6d0a3..38fe5ac 100644 --- a/python3.spec +++ b/python3.spec @@ -133,7 +133,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 3%{?dist} +Release: 4%{?dist} License: Python Group: Development/Languages @@ -1681,12 +1681,18 @@ fi # (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 +* Sun Jul 30 2017 Florian Weimer - 3.6.2-4 +- Do not generate debuginfo subpackages (#1476593) +- Rebuild with binutils fix for ppc64le (#1475636) + * Thu Jul 27 2017 Fedora Release Engineering - 3.6.2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild From e49a729d352532f7bda630fab441c7465f0a7930 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Mon, 31 Jul 2017 14:02:39 +0200 Subject: [PATCH 347/416] Make debuginfo packages parallel installable --- python3.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 38fe5ac..0bb71e1 100644 --- a/python3.spec +++ b/python3.spec @@ -882,7 +882,7 @@ make install DESTDIR=%{buildroot} INSTALL="install -p" EXTRA_CFLAGS="$MoreCFlags # %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 Tools/gdb/libpython.py %{buildroot}$PathOfGdbPy From 7ce2b353052bd12424d70271b36b537c14ad7d0b Mon Sep 17 00:00:00 2001 From: Tomas Orsava Date: Tue, 1 Aug 2017 16:59:32 +0200 Subject: [PATCH 348/416] Dropped BuildRequires on db4-devel - it was useful for Python 2 (module bsddb), however, no longer needod for Python 3 - Tested building Python 3 with and without the dependency, all tests pass and filelists of resulting RPMs are identical --- python3.spec | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/python3.spec b/python3.spec index 0bb71e1..91978da 100644 --- a/python3.spec +++ b/python3.spec @@ -133,7 +133,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 4%{?dist} +Release: 5%{?dist} License: Python Group: Development/Languages @@ -148,7 +148,6 @@ BuildRequires: autoconf BuildRequires: bluez-libs-devel BuildRequires: bzip2 BuildRequires: bzip2-devel -BuildRequires: db4-devel >= 4.7 # 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-3.2.3 for CVE-2012-0876: @@ -1689,6 +1688,12 @@ fi # ====================================================== %changelog +* Tue Aug 01 2017 Tomas Orsava - 3.6.2-5 +- Dropped BuildRequires on db4-devel which was useful for Python 2 (module + bsddb), however, no longer needod for Python 3 +- Tested building Python 3 with and without the dependency, all tests pass and + filelists of resulting RPMs are identical + * Sun Jul 30 2017 Florian Weimer - 3.6.2-4 - Do not generate debuginfo subpackages (#1476593) - Rebuild with binutils fix for ppc64le (#1475636) From 2c3b2229eb44215d3bf9cc53ea07d2aa93ae7c82 Mon Sep 17 00:00:00 2001 From: Iryna Shcherbina Date: Mon, 7 Aug 2017 18:26:47 +0200 Subject: [PATCH 349/416] Fix the "urllib FTP protocol stream injection" vulnerability (rhbz#1478916) --- 00272-fix-ftplib-to-reject-newlines.patch | 58 +++++++++++++++++++++++ python3.spec | 14 +++++- 2 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 00272-fix-ftplib-to-reject-newlines.patch diff --git a/00272-fix-ftplib-to-reject-newlines.patch b/00272-fix-ftplib-to-reject-newlines.patch new file mode 100644 index 0000000..66486a8 --- /dev/null +++ b/00272-fix-ftplib-to-reject-newlines.patch @@ -0,0 +1,58 @@ +From 8c2d4cf092c5f0335e7982392a33927579c4d512 Mon Sep 17 00:00:00 2001 +From: Dong-hee Na +Date: Wed, 26 Jul 2017 21:11:25 +0900 +Subject: [PATCH] [3.6] bpo-30119: fix ftplib.FTP.putline() to throw an error + for a illegal command (#1214) (#2886) + +--- + Lib/ftplib.py | 2 ++ + Lib/test/test_ftplib.py | 6 +++++- + Misc/NEWS.d/next/Library/2017-07-26-15-15-00.bpo-30119.DZ6C_S.rst | 2 ++ + 3 files changed, 9 insertions(+), 1 deletion(-) + create mode 100644 Misc/NEWS.d/next/Library/2017-07-26-15-15-00.bpo-30119.DZ6C_S.rst + +diff --git a/Lib/ftplib.py b/Lib/ftplib.py +index 8f36f537e8a..a02e595cb02 100644 +--- a/Lib/ftplib.py ++++ b/Lib/ftplib.py +@@ -186,6 +186,8 @@ def sanitize(self, s): + + # Internal: send one line to the server, appending CRLF + def putline(self, line): ++ if '\r' in line or '\n' in line: ++ raise ValueError('an illegal newline character should not be contained') + line = line + CRLF + if self.debugging > 1: + print('*put*', self.sanitize(line)) +diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py +index 12fabc5e8be..a561e9efa03 100644 +--- a/Lib/test/test_ftplib.py ++++ b/Lib/test/test_ftplib.py +@@ -484,6 +484,9 @@ def test_sanitize(self): + self.assertEqual(self.client.sanitize('PASS 12345'), repr('PASS *****')) + + def test_exceptions(self): ++ self.assertRaises(ValueError, self.client.sendcmd, 'echo 40\r\n0') ++ self.assertRaises(ValueError, self.client.sendcmd, 'echo 40\n0') ++ self.assertRaises(ValueError, self.client.sendcmd, 'echo 40\r0') + self.assertRaises(ftplib.error_temp, self.client.sendcmd, 'echo 400') + self.assertRaises(ftplib.error_temp, self.client.sendcmd, 'echo 499') + self.assertRaises(ftplib.error_perm, self.client.sendcmd, 'echo 500') +@@ -492,7 +495,8 @@ def test_exceptions(self): + + def test_all_errors(self): + exceptions = (ftplib.error_reply, ftplib.error_temp, ftplib.error_perm, +- ftplib.error_proto, ftplib.Error, OSError, EOFError) ++ ftplib.error_proto, ftplib.Error, OSError, ++ EOFError) + for x in exceptions: + try: + raise x('exception not included in all_errors set') +diff --git a/Misc/NEWS.d/next/Library/2017-07-26-15-15-00.bpo-30119.DZ6C_S.rst b/Misc/NEWS.d/next/Library/2017-07-26-15-15-00.bpo-30119.DZ6C_S.rst +new file mode 100644 +index 00000000000..a37d3703842 +--- /dev/null ++++ b/Misc/NEWS.d/next/Library/2017-07-26-15-15-00.bpo-30119.DZ6C_S.rst +@@ -0,0 +1,2 @@ ++ftplib.FTP.putline() now throws ValueError on commands that contains CR or ++LF. Patch by Dong-hee Na. diff --git a/python3.spec b/python3.spec index 91978da..ba8c992 100644 --- a/python3.spec +++ b/python3.spec @@ -133,7 +133,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 5%{?dist} +Release: 6%{?dist} License: Python Group: Development/Languages @@ -449,6 +449,13 @@ Patch270: 00270-fix-ssl-alpn-hook-test.patch # Reported upstream: http://bugs.python.org/issue31034 Patch271: 00271-asyncio-get-default-signal-handler.patch +# 00272 # +# Reject newline characters in ftplib.FTP.putline() arguments to +# avoid FTP protocol stream injection via malicious URLs. +# rhbz#1478916 +# Fixed upstream: http://bugs.python.org/issue30119 +Patch272: 00272-fix-ftplib-to-reject-newlines.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -723,6 +730,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch270 -p1 %patch271 -p1 +%patch272 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1688,6 +1696,10 @@ fi # ====================================================== %changelog +* Mon Aug 07 2017 Iryna Shcherbina - 3.6.2-6 +- Fix the "urllib FTP protocol stream injection" vulnerability +Resolves: rhbz#1478916 + * Tue Aug 01 2017 Tomas Orsava - 3.6.2-5 - Dropped BuildRequires on db4-devel which was useful for Python 2 (module bsddb), however, no longer needod for Python 3 From 58f92d897bc4ecae6ef7ceb0a5977498ada905f4 Mon Sep 17 00:00:00 2001 From: Michal Cyprian Date: Fri, 11 Aug 2017 13:01:28 +0200 Subject: [PATCH 350/416] 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 ef5c6fe479f00fb1dd84307ecb0f3e3aaef955a2. --- 00252-add-executable-option.patch | 45 ------------------------------- python3.spec | 14 +++++----- 2 files changed, 6 insertions(+), 53 deletions(-) delete mode 100644 00252-add-executable-option.patch 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/python3.spec b/python3.spec index ba8c992..17330aa 100644 --- a/python3.spec +++ b/python3.spec @@ -133,7 +133,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 6%{?dist} +Release: 7%{?dist} License: Python Group: Development/Languages @@ -417,12 +417,6 @@ Patch243: 00243-fix-mips64-triplet.patch # Fedora Change: https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe Patch251: 00251-change-user-install-location.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 - # 00262 # # Backport of PEP 538: Coercing the legacy C locale to a UTF-8 based locale # https://www.python.org/dev/peps/pep-0538/ @@ -721,7 +715,6 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch206 -p1 %patch243 -p1 %patch251 -p1 -%patch252 -p1 %patch262 -p1 %ifarch aarch64 @@ -1696,6 +1689,11 @@ fi # ====================================================== %changelog +* Fri Aug 11 2017 Michal Cyprian - 3.6.2-7 +- Revert "Add --executable option to install.py command" + This enhancement is currently not needed and it can possibly + collide with `pip --editable`option + * Mon Aug 07 2017 Iryna Shcherbina - 3.6.2-6 - Fix the "urllib FTP protocol stream injection" vulnerability Resolves: rhbz#1478916 From b0aea52b4034891c2efd7daa8803de889daceb0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 16 Aug 2017 15:36:09 +0200 Subject: [PATCH 351/416] 2to3 fixes * Have /usr/bin/2to3 (rhbz#1111275) * Provide 2to3 and idle3, list them in summary and description (rhbz#1076401) --- python3.spec | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/python3.spec b/python3.spec index 17330aa..cc950f3 100644 --- a/python3.spec +++ b/python3.spec @@ -133,7 +133,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 Name: python3 Version: %{pybasever}.2 -Release: 7%{?dist} +Release: 8%{?dist} License: Python Group: Development/Languages @@ -577,19 +577,31 @@ want to install the python3-docs package, which contains Python documentation. %package tools -Summary: A collection of tools included with Python +Summary: A collection of tools included with Python including 2to3 and idle Group: Development/Tools Requires: %{name} = %{version}-%{release} Requires: %{name}-tkinter = %{version}-%{release} +Provides: %{name}-2to3 = %{version}-%{release} +Provides: %{name}-idle = %{version}-%{release} +Provides: 2to3 = %{version}-%{release} +Provides: idle3 = %{version}-%{release} + %description tools -This package contains several tools included with Python +This package contains several tools included with Python including 2to3 +and idle. %package tkinter Summary: A GUI toolkit for Python Group: Development/Languages Requires: %{name} = %{version}-%{release} +# https://bugzilla.redhat.com/show_bug.cgi?id=1111275 +# /usr/bin/2to3 was moved from here +# TODO Remove in Fedora 29 +Conflicts: python2-tools < 2.7.13-17 +Conflicts: python-tools < 2.7.13-17 + %description tkinter The Tkinter (Tk interface) program is a graphical user interface for the Python scripting language. @@ -906,8 +918,6 @@ InstallPython optimized \ install -d -m 0755 ${RPM_BUILD_ROOT}%{pylibdir}/site-packages/__pycache__ -mv ${RPM_BUILD_ROOT}%{_bindir}/2to3 ${RPM_BUILD_ROOT}%{_bindir}/python3-2to3 - # add idle3 to menu install -D -m 0644 Lib/idlelib/Icons/idle_16.png ${RPM_BUILD_ROOT}%{_datadir}/icons/hicolor/16x16/apps/idle3.png install -D -m 0644 Lib/idlelib/Icons/idle_32.png ${RPM_BUILD_ROOT}%{_datadir}/icons/hicolor/32x32/apps/idle3.png @@ -1513,7 +1523,8 @@ fi %files tools %defattr(-,root,root,755) -%{_bindir}/python3-2to3 +%{_bindir}/2to3 +# TODO: Remove 2to3-3.7 once rebased to 3.7 %{_bindir}/2to3-%{pybasever} %{_bindir}/idle* %{pylibdir}/Tools @@ -1689,6 +1700,10 @@ fi # ====================================================== %changelog +* Wed Aug 16 2017 Miro Hrončok - 3.6.2-8 +- Have /usr/bin/2to3 (rhbz#1111275) +- Provide 2to3 and idle3, list them in summary and description (rhbz#1076401) + * Fri Aug 11 2017 Michal Cyprian - 3.6.2-7 - Revert "Add --executable option to install.py command" This enhancement is currently not needed and it can possibly From 043c57400a624abc9d42acbb060d3b19019c50b2 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Wed, 16 Aug 2017 15:36:04 +0200 Subject: [PATCH 352/416] Use bconds for configuring the build This makes configuring the build much easier, at least with rpmbuild and mock. Also, reorganize the initial sections, where the config options were scattered. --- python3.spec | 186 +++++++++++++++++++++++++++------------------------ 1 file changed, 100 insertions(+), 86 deletions(-) diff --git a/python3.spec b/python3.spec index cc950f3..3eec686 100644 --- a/python3.spec +++ b/python3.spec @@ -1,8 +1,46 @@ -# ====================================================== -# Conditionals and other variables controlling the build -# ====================================================== +# ================== +# Top-level metadata +# ================== -# NOTES ON BOOTSTRAPING PYTHON 3.6: +Name: python3 +Summary: Version 3 of the Python programming language aka Python 3000 + +%global pybasever 3.6 + +# pybasever without the dot: +%global pyshortver 36 + +Version: %{pybasever}.2 +Release: 9%{?dist} +License: Python + + +# ================================== +# Conditionals 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" + +%bcond_without tests +%bcond_without rewheel +%bcond_without debug_build +%bcond_without gdb_hooks +%bcond_with systemtap +%bcond_without gdbm +%bcond_without computed_gotos + +# some arches don't have valgrind so we need to disable its support on them +%ifnarch s390 %{mips} riscv64 +%bcond_without valgrind +%else +%bcond_with valgrind +%endif + + +# ================================== +# Notes from bootstraping Python 3.6 +# ================================== # # Due to a dependency cycle between Python, gdb, rpm, pip, setuptools, wheel, # and other packages, in order to rebase Python 3 one has to build in the @@ -12,7 +50,7 @@ # - gdb without python support (add %%global _without_python 1 on top of gdb's SPEC file) # - python-rpm-generators with bootstrapping_python set to 1 # (this can be done also during step 2., but should be done before 3.) -# 2. python3 with with_rewheel set to 0 +# 2. python3 with rewheel set to 0 # 3. At the same time: # - gdb with python support (remove %%global _without_python 1 on top of gdb's SPEC file) # - python-rpm-generators with bootstrapping_python set to 0 @@ -24,7 +62,7 @@ # 8. python-setuptools with bootstrap set to 0 and also with_check set to 0 # 9. python-pip with build_wheel set to 1 # 10. pyparsing -# 11. python3 with with_rewheel set to 1 +# 11. python3 with rewheel set to 1 # # Then the most important packages have to be built, starting from their # various leaf dependencies recursively. After these have been built, a @@ -34,12 +72,10 @@ # rebuild after a python abi change: # python-sphinx, pytest, python-requests, cloud-init, dnf, anaconda, abrt -%global with_rewheel 1 -%global pybasever 3.6 - -# pybasever without the dot: -%global pyshortver 36 +# ===================== +# General global macros +# ===================== %global pylibdir %{_libdir}/python%{pybasever} %global dynload_dir %{pylibdir}/lib-dynload @@ -69,10 +105,10 @@ # For example, # foo/bar.py # now has bytecode at: -# foo/__pycache__/bar.cpython-36.pyc -# foo/__pycache__/bar.cpython-36.opt-1.pyc -# foo/__pycache__/bar.cpython-36.opt-2.pyc -%global bytecode_suffixes .cpython-36*.pyc +# foo/__pycache__/bar.cpython-%%{pyshortver}.pyc +# foo/__pycache__/bar.cpython-%%{pyshortver}.opt-1.pyc +# foo/__pycache__/bar.cpython-%%{pyshortver}.opt-2.pyc +%global bytecode_suffixes .cpython-%{pyshortver}*.pyc # Python's configure script defines SOVERSION, and this is used in the Makefile # to determine INSTSONAME, the name of the libpython DSO: @@ -85,27 +121,6 @@ %global py_INSTSONAME_optimized libpython%{LDVERSION_optimized}.so.%{py_SOVERSION} %global py_INSTSONAME_debug libpython%{LDVERSION_debug}.so.%{py_SOVERSION} -%global with_debug_build 1 - -%global with_gdb_hooks 1 - -%global with_systemtap 0 - -# 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 - -# Change from yes to no to turn this off -%global with_computed_gotos yes - -# Turn this to 0 to turn off the "check" phase: -%global run_selftest_suite 1 - # We want to byte-compile the .py files within the packages using the new # python3 binary. # @@ -127,17 +142,6 @@ # pyc/pyo files) -# ================== -# Top-level metadata -# ================== -Summary: Version 3 of the Python programming language aka Python 3000 -Name: python3 -Version: %{pybasever}.2 -Release: 8%{?dist} -License: Python -Group: Development/Languages - - # ======================= # Build-time requirements # ======================= @@ -155,7 +159,7 @@ BuildRequires: expat-devel >= 2.1.0 BuildRequires: findutils BuildRequires: gcc-c++ -%if %{with_gdbm} +%if %{with gdbm} BuildRequires: gdbm-devel %endif BuildRequires: glibc-devel @@ -184,14 +188,14 @@ BuildRequires: tcl-devel BuildRequires: tix-devel BuildRequires: tk-devel -%if 0%{?with_valgrind} +%if %{with valgrind} BuildRequires: valgrind-devel %endif BuildRequires: xz-devel BuildRequires: zlib-devel -%if 0%{?with_rewheel} +%if %{with rewheel} BuildRequires: python3-setuptools BuildRequires: python3-pip %endif @@ -484,7 +488,7 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release} Obsoletes: python%{pyshortver} Provides: python%{pyshortver} = %{version}-%{release} -%if 0%{with_rewheel} +%if %{with rewheel} Requires: python3-setuptools Requires: python3-pip %endif @@ -620,7 +624,7 @@ in production. You might want to install the python3-test package if you're developing python 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 runtime Group: Applications/System @@ -651,7 +655,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 +%endif # with debug_build # ====================================================== # The prep phase of the build: @@ -660,11 +664,11 @@ can load its own extensions. %prep %setup -q -n Python-%{version}%{?prerel} -%if 0%{?with_systemtap} +%if %{with systemtap} # Provide an example of usage of the tapset: cp -a %{SOURCE6} . cp -a %{SOURCE7} . -%endif # with_systemtap +%endif # with systemtap # Ensure that we're using the system copy of various libraries, rather than # copies shipped by upstream in the tarball: @@ -687,7 +691,7 @@ rm -r Modules/zlib || exit 1 # rm Modules/$f #done -%if 0%{with_rewheel} +%if %{with rewheel} %global pip_version 9.0.1 sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/ensurepip/__init__.py %endif @@ -697,7 +701,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en # %patch1 -p1 -%if 0%{?with_systemtap} +%if %{with systemtap} %patch55 -p1 -b .systemtap %endif @@ -719,7 +723,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch186 -p1 %patch188 -p1 -%if 0%{with_rewheel} +%if %{with rewheel} %patch189 -p1 %endif @@ -784,20 +788,26 @@ BuildPython() { # Use the freshly created "configure" script, but in the directory two above: %global _configure $topdir/configure + %if %{with computed_gotos} + %global computed_gotos_flag yes + %else + %global computed_gotos_flag no + %endif + %configure \ --enable-ipv6 \ --enable-shared \ - --with-computed-gotos=%{with_computed_gotos} \ + --with-computed-gotos=%{computed_gotos_flag} \ --with-dbmliborder=gdbm:ndbm:bdb \ --with-system-expat \ --with-system-ffi \ --enable-loadable-sqlite-extensions \ --with-dtrace \ --with-lto \ -%if 0%{?with_systemtap} +%if %{with systemtap} --with-systemtap \ %endif -%if 0%{?with_valgrind} +%if %{with valgrind} --with-valgrind \ %endif $ExtraConfigArgs \ @@ -820,7 +830,7 @@ BuildPython() { # Use "BuildPython" to support building with different configurations: -%if 0%{?with_debug_build} +%if %{with debug_build} BuildPython debug \ python-debug \ python%{pybasever}-debug \ @@ -831,7 +841,7 @@ BuildPython debug \ %endif false \ -O0 -%endif # with_debug_build +%endif # with debug_build BuildPython optimized \ python \ @@ -892,13 +902,13 @@ make install DESTDIR=%{buildroot} INSTALL="install -p" EXTRA_CFLAGS="$MoreCFlags # /usr/lib/libpython3.1.so.1.0-gdb.py # but doing so generated noise when ldconfig was rerun (rhbz:562980) # -%if 0%{?with_gdb_hooks} +%if %{with gdb_hooks} DirHoldingGdbPy=%{_prefix}/lib/debug/%{_libdir} PathOfGdbPy=$DirHoldingGdbPy/$PyInstSoName-%{version}-%{release}.%{_arch}.debug-gdb.py mkdir -p %{buildroot}$DirHoldingGdbPy cp Tools/gdb/libpython.py %{buildroot}$PathOfGdbPy -%endif # with_gdb_hooks +%endif # with gdb_hooks echo FINISHED: INSTALL OF PYTHON FOR CONFIGURATION: $ConfName } @@ -906,11 +916,11 @@ make install DESTDIR=%{buildroot} INSTALL="install -p" EXTRA_CFLAGS="$MoreCFlags # 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 \ %{py_INSTSONAME_debug} \ -O0 -%endif # with_debug_build +%endif # with debug_build # Now the optimized build: InstallPython optimized \ @@ -971,7 +981,7 @@ install -d -m 0755 %{buildroot}/%{_prefix}/lib/python%{pybasever}/site-packages/ %global SOABI_optimized cpython-%{pyshortver}%{ABIFLAGS_optimized}-%{_arch}-linux%{_gnu} %global SOABI_debug cpython-%{pyshortver}%{ABIFLAGS_debug}-%{_arch}-linux%{_gnu} -%if 0%{?with_debug_build} +%if %{with debug_build} %global PyIncludeDirs python%{LDVERSION_optimized} python%{LDVERSION_debug} %else @@ -1096,7 +1106,7 @@ done # Create "/usr/bin/python3-debug", a symlink to the python3 debug binary, to # avoid the user having to know the precise version and ABI flags. (see # e.g. rhbz#676748): -%if 0%{?with_debug_build} +%if %{with debug_build} ln -s \ %{_bindir}/python%{LDVERSION_debug} \ %{buildroot}%{_bindir}/python3-debug @@ -1105,7 +1115,7 @@ ln -s \ # # Systemtap hooks: # -%if 0%{?with_systemtap} +%if %{with systemtap} # Install a tapset for this libpython into tapsetdir, fixing up the path to the # library: mkdir -p %{buildroot}%{tapsetdir} @@ -1122,7 +1132,7 @@ sed \ %{_sourcedir}/libpython.stp \ > %{buildroot}%{tapsetdir}/%{libpython_stp_optimized} -%if 0%{?with_debug_build} +%if %{with debug_build} # In Python 3, python3 and python3-debug don't point to the same binary, # so we have to replace "python3" with "python3-debug" to get systemtap # working with debug build @@ -1131,9 +1141,9 @@ sed \ -e 's|"python3"|"python3-debug"|' \ %{_sourcedir}/libpython.stp \ > %{buildroot}%{tapsetdir}/%{libpython_stp_debug} -%endif # with_debug_build +%endif # with debug_build -%endif # with_systemtap +%endif # with systemtap # Rename the -devel script that differs on different arches to arch specific name mv %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-{,`uname -m`-}config @@ -1143,7 +1153,7 @@ echo '[ $? -eq 127 ] && echo "Could not find python%{LDVERSION_optimized}-`uname %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-config chmod +x %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-config -%if 0%{?with_debug_build} +%if %{with debug_build} # Rename the -debug script that differs on different arches to arch specific name mv %{buildroot}%{_bindir}/python%{LDVERSION_debug}-{,`uname -m`-}config echo -e '#!/bin/sh\nexec `dirname $0`/python%{LDVERSION_debug}-`uname -m`-config "$@"' > \ @@ -1151,7 +1161,7 @@ echo -e '#!/bin/sh\nexec `dirname $0`/python%{LDVERSION_debug}-`uname -m`-config echo '[ $? -eq 127 ] && echo "Could not find python%{LDVERSION_debug}-`uname -m`-config. Look around to see available arches." >&2' >> \ %{buildroot}%{_bindir}/python%{LDVERSION_debug}-config chmod +x %{buildroot}%{_bindir}/python%{LDVERSION_debug}-config -%endif # with_debug_build +%endif # with debug_build # System Python: Copy the executable to libexec mkdir -p %{buildroot}%{_libexecdir} @@ -1210,15 +1220,15 @@ 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 -%endif # with_debug_build +%endif # with debug_build CheckPython optimized -%endif # run_selftest_suite +%endif # with tests # ====================================================== @@ -1298,7 +1308,7 @@ fi %{pylibdir}/ensurepip/__pycache__/*%{bytecode_suffixes} %exclude %{pylibdir}/ensurepip/_bundled -%if 0%{?with_rewheel} +%if %{with rewheel} %dir %{pylibdir}/ensurepip/rewheel/ %dir %{pylibdir}/ensurepip/rewheel/__pycache__/ %{pylibdir}/ensurepip/rewheel/*.py @@ -1367,7 +1377,7 @@ fi %{dynload_dir}/_dbm.%{SOABI_optimized}.so %{dynload_dir}/_decimal.%{SOABI_optimized}.so %{dynload_dir}/_elementtree.%{SOABI_optimized}.so -%if %{with_gdbm} +%if %{with gdbm} %{dynload_dir}/_gdbm.%{SOABI_optimized}.so %endif %{dynload_dir}/_hashlib.%{SOABI_optimized}.so @@ -1495,7 +1505,7 @@ fi %{_libdir}/%{py_INSTSONAME_optimized} %{_libdir}/libpython3.so -%if 0%{?with_systemtap} +%if %{with systemtap} %dir %(dirname %{tapsetdir}) %dir %{tapsetdir} %{tapsetdir}/%{libpython_stp_optimized} @@ -1567,7 +1577,7 @@ fi # 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,-) @@ -1602,7 +1612,7 @@ fi %{dynload_dir}/_dbm.%{SOABI_debug}.so %{dynload_dir}/_decimal.%{SOABI_debug}.so %{dynload_dir}/_elementtree.%{SOABI_debug}.so -%if %{with_gdbm} +%if %{with gdbm} %{dynload_dir}/_gdbm.%{SOABI_debug}.so %endif %{dynload_dir}/_hashlib.%{SOABI_debug}.so @@ -1649,7 +1659,7 @@ fi # now; they're listed below, under "-devel": %{_libdir}/%{py_INSTSONAME_debug} -%if 0%{?with_systemtap} +%if %{with systemtap} %dir %(dirname %{tapsetdir}) %dir %{tapsetdir} %{tapsetdir}/%{libpython_stp_debug} @@ -1677,7 +1687,7 @@ fi %{dynload_dir}/_testcapi.%{SOABI_debug}.so %{dynload_dir}/_testimportmultiple.%{SOABI_debug}.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). @@ -1700,6 +1710,10 @@ fi # ====================================================== %changelog +* Wed Aug 16 2017 Petr Viktorin - 3.6.2-9 +- Use bconds for configuring the build +- Reorganize the initial sections + * Wed Aug 16 2017 Miro Hrončok - 3.6.2-8 - Have /usr/bin/2to3 (rhbz#1111275) - Provide 2to3 and idle3, list them in summary and description (rhbz#1076401) From 11efc8ea599184f57531e16dee37967645557c2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 21 Aug 2017 13:33:07 +0200 Subject: [PATCH 353/416] Remove system-python --- macros.systempython | 5 +-- python3.spec | 84 ++++++++++++++++----------------------------- 2 files changed, 31 insertions(+), 58 deletions(-) diff --git a/macros.systempython b/macros.systempython index b7d1e91..314cd45 100644 --- a/macros.systempython +++ b/macros.systempython @@ -1,4 +1 @@ -%system_python_abi %{expand: \ -%global __requires_exclude ^python\\\\(abi\\\\) = 3\\\\..$ -Requires: system-python(abi) = %{python3_version} -} +%system_python_abi %{expand: } diff --git a/python3.spec b/python3.spec index 3eec686..98ec2e7 100644 --- a/python3.spec +++ b/python3.spec @@ -11,7 +11,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 %global pyshortver 36 Version: %{pybasever}.2 -Release: 9%{?dist} +Release: 10%{?dist} License: Python @@ -230,7 +230,8 @@ Source7: pyfuntop.stp # Written by bkabrda Source8: check-pyc-and-pyo-timestamps.py -# A simple macro that enables packages to require system-python(abi) instead of python(abi) +# Backward compatible no-op macro for system-python +# Remove in Fedora 29 Source9: macros.systempython # Desktop menu entry for idle3 @@ -478,6 +479,12 @@ URL: https://www.python.org/ # See notes in bug 532118: Provides: python(abi) = %{pybasever} +# For backward compatibility only, remove in F29: +Provides: system-python(abi) = %{pybasever} +Provides: system-python = %{version}-%{release} +Provides: system-python%{?_isa} = %{version}-%{release} +Obsoletes: system-python < %{version}-%{release} + Requires: %{name}-libs%{?_isa} = %{version}-%{release} # In order to support multiple python interpreters, apart from the system python3, @@ -508,17 +515,11 @@ need a programmable interface. Note that documentation for Python is provided in the python3-docs package. This package provides the "python3" executable; most of the actual -implementation is within the "python3-libs" and "system-python-libs" packages. +implementation is within the "python3-libs" package. %package libs Summary: Python runtime libraries Group: Development/Libraries -# For Modularity purpose we need not to include the dist-tag int he dependency -%if %(d="%{?dist}"; [ "${d#module-base-runtime-}x" != "${d}x" ] && echo 1 || echo 0) -Requires: system-python-libs%{?_isa} = %{version} -%else -Requires: system-python-libs%{?_isa} = %{version}-%{release} -%endif # 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 @@ -528,36 +529,21 @@ Requires: expat >= 2.1.0 Provides: python3-enum34 = 1.0.4-5%{?dist} Obsoletes: python3-enum34 < 1.0.4-5%{?dist} +# Python 3 built with glibc >= 2.24.90-26 needs to require it (rhbz#1410644). +Requires: glibc%{?_isa} >= 2.24.90-26 + +# For backward compatibility only, remove in F29: +Provides: system-python-libs = %{version}-%{release} +Provides: system-python-libs%{?_isa} = %{version}-%{release} +Obsoletes: system-python-libs < %{version}-%{release} + + %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 "python3" executable - the Python standard library -%package -n system-python -Summary: System Python executable -Group: Development/Libraries -Requires: system-python-libs%{?_isa} = %{version}-%{release} -Provides: system-python(abi) = %{pybasever} - -%description -n system-python -System Python provides a binary interpreter which uses system-python-libs, -a subset of standard Python library considered essential to run various tools, -requiring Python, that consider themselves "system tools". - -%package -n system-python-libs -Summary: System Python runtime libraries -Group: Development/Libraries - -%define __requires_exclude ^(/usr/bin/python3.*|python\\(abi\\) = 3\\..*)$ - -Requires: expat >= 2.1.0 -# Python 3 built with glibc >= 2.24.90-26 needs to require it (rhbz#1410644). -Requires: glibc%{?_isa} >= 2.24.90-26 - -%description -n system-python-libs -This package contains files used to embed System Python into applications. - %package devel Summary: Libraries and header files needed for Python development Group: Development/Libraries @@ -1163,9 +1149,10 @@ echo '[ $? -eq 127 ] && echo "Could not find python%{LDVERSION_debug}-`uname -m` chmod +x %{buildroot}%{_bindir}/python%{LDVERSION_debug}-config %endif # with debug_build -# System Python: Copy the executable to libexec +# System Python: Link the executable to libexec +# This is for backwards compatibility only and should be removed in Fedora 29 mkdir -p %{buildroot}%{_libexecdir} -cp %{buildroot}%{_bindir}/python%{pybasever} %{buildroot}%{_libexecdir}/system-python +ln -s %{_bindir}/python%{pybasever} %{buildroot}%{_libexecdir}/system-python # ====================================================== @@ -1247,10 +1234,6 @@ rm -fr %{buildroot} %postun libs -p /sbin/ldconfig -%post -n system-python-libs -p /sbin/ldconfig - -%postun -n system-python-libs -p /sbin/ldconfig - %post /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : @@ -1274,12 +1257,17 @@ fi %{_bindir}/pyvenv %{_bindir}/pyvenv-%{pybasever} %{_mandir}/*/* +# Remove in Fedora 29: +%{_libexecdir}/system-python %files libs %defattr(-,root,root,-) %license LICENSE %doc README.rst +%dir %{pylibdir} +%dir %{dynload_dir} + %{pylibdir}/lib2to3 %exclude %{pylibdir}/lib2to3/tests @@ -1338,21 +1326,6 @@ fi %{pylibdir}/pydoc_data -################################################################################## - -%files -n system-python -%defattr(-,root,root,-) -%license LICENSE -%doc README.rst -%{_libexecdir}/system-python - -%files -n system-python-libs -%defattr(-,root,root,-) -%license LICENSE -%doc README.rst -%dir %{pylibdir} -%dir %{dynload_dir} - %{dynload_dir}/_blake2.%{SOABI_optimized}.so %{dynload_dir}/_md5.%{SOABI_optimized}.so %{dynload_dir}/_sha1.%{SOABI_optimized}.so @@ -1710,6 +1683,9 @@ fi # ====================================================== %changelog +* Mon Aug 21 2017 Miro Hrončok - 3.6.2-10 +- Remove system-python, see https://fedoraproject.org/wiki/Changes/Platform_Python_Stack + * Wed Aug 16 2017 Petr Viktorin - 3.6.2-9 - Use bconds for configuring the build - Reorganize the initial sections From a7a170bba67e240d7ced975a3cc8ad114caa54b5 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Wed, 16 Aug 2017 17:55:57 +0200 Subject: [PATCH 354/416] Add bcond for --without optimizations --- python3.spec | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/python3.spec b/python3.spec index 98ec2e7..a57ae0a 100644 --- a/python3.spec +++ b/python3.spec @@ -11,7 +11,7 @@ Summary: Version 3 of the Python programming language aka Python 3000 %global pyshortver 36 Version: %{pybasever}.2 -Release: 10%{?dist} +Release: 11%{?dist} License: Python @@ -22,6 +22,12 @@ License: Python # Note that the bcond macros are named for the CLI option they create. # "%%bcond_without" means "ENABLE by default and create a --without option" +%ifarch %{ix86} x86_64 +%bcond_without optimizations +%else +%bcond_with optimizations +%endif + %bcond_without tests %bcond_without rewheel %bcond_without debug_build @@ -832,11 +838,11 @@ BuildPython debug \ BuildPython optimized \ python \ python%{pybasever} \ -%ifarch %{ix86} x86_64 +%if %{with optimizations} "--without-ensurepip --enable-optimizations" \ %else - "--without-ensurepip" \ -%endif + "--without-ensurepip --disable-optimizations" \ +%endif # with optimizations true # ====================================================== @@ -1683,6 +1689,9 @@ fi # ====================================================== %changelog +* Mon Aug 21 2017 Petr Viktorin - 3.6.2-11 +- Add bcond for --without optimizations + * Mon Aug 21 2017 Miro Hrončok - 3.6.2-10 - Remove system-python, see https://fedoraproject.org/wiki/Changes/Platform_Python_Stack From f63e273cfd439aa9d4515eadee335361717ef014 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Thu, 17 Aug 2017 09:13:29 +0200 Subject: [PATCH 355/416] Document configuration options --- python3.spec | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index a57ae0a..fe90cd0 100644 --- a/python3.spec +++ b/python3.spec @@ -22,24 +22,42 @@ License: Python # Note that the bcond macros are named for the CLI option they create. # "%%bcond_without" means "ENABLE by default and create a --without option" +# Expensive optimizations (mainly, profile-guided optimizations) %ifarch %{ix86} x86_64 %bcond_without optimizations %else +# On some architectures, the optimized build takes tens of hours, possibly +# longer than Koji's 24-hour timeout. Disable optimizations here. %bcond_with optimizations %endif +# Run the test suite in %%check %bcond_without tests + +# 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 + +# Support for the GDB debugger %bcond_without gdb_hooks + +# Support for systemtap instrumentation %bcond_with systemtap + +# The dbm.gnu module (key-value database) %bcond_without gdbm + +# Main interpreter loop optimization %bcond_without computed_gotos -# some arches don't have valgrind so we need to disable its support on them +# Support for the Valgrind debugger/profiler %ifnarch s390 %{mips} riscv64 %bcond_without valgrind %else +# Some arches don't have valgrind, disable support for it there. %bcond_with valgrind %endif From 0c74e1153226d2a1029164b3ba6a07645b99ddc4 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Thu, 17 Aug 2017 09:18:50 +0200 Subject: [PATCH 356/416] Remove historical information from the global macros section --- python3.spec | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/python3.spec b/python3.spec index fe90cd0..74c0525 100644 --- a/python3.spec +++ b/python3.spec @@ -104,15 +104,8 @@ License: Python %global pylibdir %{_libdir}/python%{pybasever} %global dynload_dir %{pylibdir}/lib-dynload -# SOABI is defined in the upstream configure.in from Python-3.2a2 onwards, -# for PEP 3149: -# http://www.python.org/dev/peps/pep-3149/ - -# ("configure.in" became "configure.ac" in Python 3.3 onwards, and in -# backports) - -# ABIFLAGS, LDVERSION and SOABI are in the upstream Makefile -# With Python 3.3, we lose the "u" suffix due to PEP 393 +# ABIFLAGS, LDVERSION and SOABI are in the upstream configure.ac +# See PEP 3149 for some background: http://www.python.org/dev/peps/pep-3149/ %global ABIFLAGS_optimized m %global ABIFLAGS_debug dm @@ -122,13 +115,12 @@ License: Python %global SOABI_optimized cpython-%{pyshortver}%{ABIFLAGS_optimized}-%{_arch}-linux%{_gnu} %global SOABI_debug cpython-%{pyshortver}%{ABIFLAGS_debug}-%{_arch}-linux%{_gnu} -# All bytecode files are now in a __pycache__ subdirectory, with a name -# reflecting the version of the bytecode (to permit sharing of python libraries -# between different runtimes) -# See http://www.python.org/dev/peps/pep-3147/ +# All bytecode files are in a __pycache__ subdirectory, with a name +# reflecting the version of the bytecode. +# See PEP 3147: http://www.python.org/dev/peps/pep-3147/ # For example, # foo/bar.py -# now has bytecode at: +# has bytecode at: # foo/__pycache__/bar.cpython-%%{pyshortver}.pyc # foo/__pycache__/bar.cpython-%%{pyshortver}.opt-1.pyc # foo/__pycache__/bar.cpython-%%{pyshortver}.opt-2.pyc From 59c11e6706753fc7935c99c103272c6dd44487d1 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Thu, 17 Aug 2017 09:41:37 +0200 Subject: [PATCH 357/416] Revise the bootstrapping notes --- python3.spec | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/python3.spec b/python3.spec index 74c0525..c97e919 100644 --- a/python3.spec +++ b/python3.spec @@ -66,17 +66,23 @@ License: Python # Notes from bootstraping Python 3.6 # ================================== # +# New Python major version (3.X) break ABI and bytecode compatibility, +# so all packages depending on it need to be rebuilt. +# # Due to a dependency cycle between Python, gdb, rpm, pip, setuptools, wheel, -# and other packages, in order to rebase Python 3 one has to build in the -# following order: +# and other packages, this isn't straightforward. +# Build in the following order: # # 1. At the same time: -# - gdb without python support (add %%global _without_python 1 on top of gdb's SPEC file) +# - gdb without python support (add %%global _without_python 1 on top of +# gdb's SPEC file) # - python-rpm-generators with bootstrapping_python set to 1 # (this can be done also during step 2., but should be done before 3.) -# 2. python3 with rewheel set to 0 +# 2. python3 without rewheel (use %%bcond_with rewheel instead of +# %%bcond_without) # 3. At the same time: -# - gdb with python support (remove %%global _without_python 1 on top of gdb's SPEC file) +# - gdb with python support (remove %%global _without_python 1 on top of +# gdb's SPEC file) # - python-rpm-generators with bootstrapping_python set to 0 # (this can be done at any later step without negative effects) # 4. rpm @@ -86,15 +92,13 @@ License: Python # 8. python-setuptools with bootstrap set to 0 and also with_check set to 0 # 9. python-pip with build_wheel set to 1 # 10. pyparsing -# 11. python3 with rewheel set to 1 +# 11. python3 with rewheel # -# Then the most important packages have to be built, starting from their -# various leaf dependencies recursively. After these have been built, a -# targeted rebuild should be requested for the rest. -# -# Currently these packages are recommended to have been built before a targeted -# rebuild after a python abi change: +# Then the most important packages have to be built, in dependency order. +# These were: # python-sphinx, pytest, python-requests, cloud-init, dnf, anaconda, abrt +# +# After these have been built, a targeted rebuild should be done for the rest. # ===================== From c2f871903561b5e01179c60d0dfc549520215467 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Mon, 21 Aug 2017 13:46:14 +0200 Subject: [PATCH 358/416] Reword package summaries and descriptions Also, remove Group tags --- python3.spec | 101 ++++++++++++++++++++++++++------------------------- 1 file changed, 52 insertions(+), 49 deletions(-) diff --git a/python3.spec b/python3.spec index c97e919..6e099cc 100644 --- a/python3.spec +++ b/python3.spec @@ -521,25 +521,27 @@ Requires: python3-pip %endif %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). +Python is an accessible, high-level, dynamically typed, interpreted programming +language, designed with an emphasis on code readibility. +It includes an extensive standard library, and has a vast ecosystem of +third-party libraries. -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 provides the "python3" executable: the reference interpreter for +the Python language, version 3. +The majority of its standard library is provided in the %{name}-libs package, +which should be installed automatically along with %{name}. +The remaining parts of the Python standard library are broken out into the +%{name}-tkinter and %{name}-test packages, which may need to be installed +separately. -Note that documentation for Python is provided in the python3-docs package. +Documentation for Python is provided in the %{name}-docs package. + +Packages containing additional libraries for Python are generally named with +the "%{name}-" prefix. -This package provides the "python3" executable; most of the actual -implementation is within the "python3-libs" package. %package libs Summary: Python runtime libraries -Group: Development/Libraries # 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 @@ -560,13 +562,13 @@ Obsoletes: system-python-libs < %{version}-%{release} %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 "python3" executable -- the Python standard library +- the majority of the Python standard library +- a dynamically linked library for use by applications that embed Python as + a scripting language, and by the main "python3" executable + %package devel Summary: Libraries and header files needed for Python development -Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: %{name}-libs%{?_isa} = %{version}-%{release} BuildRequires: python-rpm-macros @@ -576,19 +578,15 @@ Requires: python3-rpm-generators Conflicts: %{name} < %{version}-%{release} %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. +This package contains the header files and configuration needed to compile +Python extension modules (typically written in C or C++), to embed Python +into other programs, and to make binary distributions for Python libraries. + +It also contains the necessary macros to build RPM packages with Python modules. -Install python3-devel if you want to develop Python extensions. The -python3 package will also need to be installed. You'll probably also -want to install the python3-docs package, which contains Python -documentation. %package tools Summary: A collection of tools included with Python including 2to3 and idle -Group: Development/Tools Requires: %{name} = %{version}-%{release} Requires: %{name}-tkinter = %{version}-%{release} @@ -598,12 +596,13 @@ Provides: 2to3 = %{version}-%{release} Provides: idle3 = %{version}-%{release} %description tools -This package contains several tools included with Python including 2to3 -and idle. +This package contains several tools included with Python, including: +- 2to3, an automatic source converter from Python 2.X +- idle, a basic graphical development environment + %package tkinter Summary: A GUI toolkit for Python -Group: Development/Languages Requires: %{name} = %{version}-%{release} # https://bugzilla.redhat.com/show_bug.cgi?id=1111275 @@ -613,27 +612,27 @@ Conflicts: python2-tools < 2.7.13-17 Conflicts: python-tools < 2.7.13-17 %description tkinter -The Tkinter (Tk interface) program is a graphical user interface for -the Python scripting language. +The Tkinter (Tk interface) library is a graphical user interface toolkit for +the Python programming language. + %package test -Summary: The test modules from the main python3 package -Group: Development/Languages +Summary: The self-test suite for the main python3 package Requires: %{name} = %{version}-%{release} Requires: %{name}-tools = %{version}-%{release} -%description test -The test modules from the main %{name} package. -These are in a separate package to save space, as they are almost never used -in production. -You might want to install the python3-test package if you're developing -python code that uses more than just unittest and/or test_support.py. +%description test +The self-test suite for the Python interpreter. + +This is only useful to test Python itself. For testing general Python code, +you should use the unittest module from %{name}-libs, or a library such as +${name}-pytest or ${name}-nose. + %if %{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 @@ -647,22 +646,24 @@ Requires: %{name}-tools%{?_isa} = %{version}-%{release} %description debug python3-debug provides a version of the Python runtime with numerous debugging -features enabled, aimed at advanced Python users, such as developers of Python +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. +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 -versions of Python, but the debugging features mean that C/C++ extension -modules are ABI-incompatible with those built for the standard runtime. +The bytecode format is unchanged, so that .pyc files are compatible between +this and the standard version of Python, but the debugging features mean that +C/C++ extension modules are ABI-incompatible and must be built for each version +separately. -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. +The debug build shares installation directories with the standard Python +runtime, so that .py and .pyc files can be shared. +Compiled extension modules use a special ABI flag ("d") in the filename, +so extensions for both verisons can co-exist in the same directory. %endif # with debug_build + # ====================================================== # The prep phase of the build: # ====================================================== @@ -1705,6 +1706,8 @@ fi %changelog * Mon Aug 21 2017 Petr Viktorin - 3.6.2-11 - Add bcond for --without optimizations +- Reword package descriptions +- Remove Group declarations * Mon Aug 21 2017 Miro Hrončok - 3.6.2-10 - Remove system-python, see https://fedoraproject.org/wiki/Changes/Platform_Python_Stack From 88b30e0657489f40599836434c0e2bf38666b5f4 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 22 Aug 2017 14:21:01 +0200 Subject: [PATCH 359/416] Remove duplicate globals --- python3.spec | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/python3.spec b/python3.spec index 6e099cc..6d54414 100644 --- a/python3.spec +++ b/python3.spec @@ -978,16 +978,6 @@ install -d -m 0755 %{buildroot}/%{_prefix}/lib/python%{pybasever}/site-packages/ %global _pyconfig_h %{_pyconfig32_h} %endif -# ABIFLAGS, LDVERSION and SOABI are in the upstream Makefile -%global ABIFLAGS_optimized m -%global ABIFLAGS_debug dm - -%global LDVERSION_optimized %{pybasever}%{ABIFLAGS_optimized} -%global LDVERSION_debug %{pybasever}%{ABIFLAGS_debug} - -%global SOABI_optimized cpython-%{pyshortver}%{ABIFLAGS_optimized}-%{_arch}-linux%{_gnu} -%global SOABI_debug cpython-%{pyshortver}%{ABIFLAGS_debug}-%{_arch}-linux%{_gnu} - %if %{with debug_build} %global PyIncludeDirs python%{LDVERSION_optimized} python%{LDVERSION_debug} From 66c621f01a02d349242fb2f56215d6f92feb31f9 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 22 Aug 2017 14:33:31 +0200 Subject: [PATCH 360/416] Re-alphabetize the BuidRequires section --- python3.spec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python3.spec b/python3.spec index 6d54414..56c9a70 100644 --- a/python3.spec +++ b/python3.spec @@ -172,6 +172,7 @@ BuildRequires: autoconf BuildRequires: bluez-libs-devel BuildRequires: bzip2 BuildRequires: bzip2-devel +BuildRequires: desktop-file-utils # 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-3.2.3 for CVE-2012-0876: @@ -184,23 +185,22 @@ BuildRequires: gdbm-devel %endif BuildRequires: glibc-devel BuildRequires: gmp-devel +BuildRequires: libappstream-glib BuildRequires: libffi-devel BuildRequires: libGL-devel BuildRequires: libX11-devel BuildRequires: ncurses-devel + # workaround http://bugs.python.org/issue19804 (test_uuid requires ifconfig) BuildRequires: net-tools + BuildRequires: openssl-devel BuildRequires: pkgconfig BuildRequires: readline-devel BuildRequires: sqlite-devel -BuildRequires: desktop-file-utils -BuildRequires: libappstream-glib BuildRequires: systemtap-sdt-devel BuildRequires: systemtap-devel -# (this introduces a dependency on "python", in that systemtap-sdt-devel's -# /usr/bin/dtrace is a python 2 script) %global tapsetdir /usr/share/systemtap/tapset BuildRequires: tar From 1824b3ec27d93d66a828424cb50651cf904a79b4 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 22 Aug 2017 14:24:22 +0200 Subject: [PATCH 361/416] Use configuration macro instead of workaround to disable byte-compilation --- python3.spec | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/python3.spec b/python3.spec index 56c9a70..c93ea50 100644 --- a/python3.spec +++ b/python3.spec @@ -141,26 +141,10 @@ License: Python %global py_INSTSONAME_optimized libpython%{LDVERSION_optimized}.so.%{py_SOVERSION} %global py_INSTSONAME_debug libpython%{LDVERSION_debug}.so.%{py_SOVERSION} -# We want to byte-compile the .py files within the packages using the new -# python3 binary. -# -# Unfortunately, rpmbuild's infrastructure requires us to jump through some -# hoops to avoid byte-compiling with the system python 2 version: -# /usr/lib/rpm/redhat/macros sets up build policy that (amongst other things) -# defines __os_install_post. In particular, "brp-python-bytecompile" is -# invoked without an argument thus using the wrong version of python -# (/usr/bin/python, rather than the freshly built python), thus leading to -# numerous syntax errors, and incorrect magic numbers in the .pyc files. We -# thus override __os_install_post to avoid invoking this script: -%global __os_install_post /usr/lib/rpm/brp-compress \ - %{!?__debug_package:/usr/lib/rpm/brp-strip %{__strip}} \ - /usr/lib/rpm/brp-strip-static-archive %{__strip} \ - /usr/lib/rpm/brp-strip-comment-note %{__strip} %{__objdump} \ - /usr/lib/rpm/brp-python-hardlink -# to remove the invocation of brp-python-bytecompile, whilst keeping the -# invocation of brp-python-hardlink (since this should still work for python3 -# pyc/pyo files) - +# Disable automatic bytecompilation. The python3 binary is not yet be +# available in /usr/bin when Python is built. Also, the bytecompilation fails +# on files that test invalid syntax. +%undefine py_auto_byte_compile # ======================= # Build-time requirements From f50a7d31c33b2a1c07a731d342650094cca15f49 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 22 Aug 2017 15:48:41 +0200 Subject: [PATCH 362/416] Reword and expand comment on Provides/Obsoletes of pythonXY --- python3.spec | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/python3.spec b/python3.spec index c93ea50..299d446 100644 --- a/python3.spec +++ b/python3.spec @@ -491,13 +491,17 @@ Obsoletes: system-python < %{version}-%{release} Requires: %{name}-libs%{?_isa} = %{version}-%{release} -# In order to support multiple python interpreters, apart from the system python3, -# for development purposes, new packages were introduced which can be installed in parallel -# with the main python3 package (e.g. 1369688), with the naming scheme 'python', -# however in order to keep the upgrade path clean we need to Obsolete and Provide -# these packages at the main python3 package. -Obsoletes: python%{pyshortver} +# In order to support multiple Python interpreters for development purposes, +# packages with with the naming scheme pythonXY (e.g. python35) exist for +# non-default versions of Python 3. +# For consistency, and to keep the upgrade path clean, we Provide/Obsolete +# these names here. Provides: python%{pyshortver} = %{version}-%{release} +# Note that using Obsoletes without package version is not standard practice. +# Here we assert that *any* version of the system's default interpreter is +# preferable to an "extra" interpreter. For example, python3-3.6.1 will +# replace python36-3.6.2. +Obsoletes: python%{pyshortver} %if %{with rewheel} Requires: python3-setuptools From 737c23e8071caa7a8ac9573b677f1af3977f362c Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 22 Aug 2017 17:00:09 +0200 Subject: [PATCH 363/416] Remove unused patches --- 00146-hashlib-fips.patch | 640 --------------------------------------- python3.spec | 29 -- 2 files changed, 669 deletions(-) delete mode 100644 00146-hashlib-fips.patch diff --git a/00146-hashlib-fips.patch b/00146-hashlib-fips.patch deleted file mode 100644 index e0cdce0..0000000 --- a/00146-hashlib-fips.patch +++ /dev/null @@ -1,640 +0,0 @@ -diff --git a/Lib/hashlib.py b/Lib/hashlib.py -index 316cece..b7ad879 100644 ---- a/Lib/hashlib.py -+++ b/Lib/hashlib.py -@@ -23,6 +23,16 @@ the zlib module. - Choose your hash function wisely. Some have known collision weaknesses. - sha384 and sha512 will be slow on 32 bit platforms. - -+If the underlying implementation supports "FIPS mode", and this is enabled, it -+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. -+ - Hash objects have these methods: - - update(arg): Update the hash object with the bytes in arg. Repeated calls - are equivalent to a single call with the concatenation of all -@@ -62,6 +72,18 @@ algorithms_available = set(__always_supported) - __all__ = __always_supported + ('new', 'algorithms_guaranteed', - 'algorithms_available', 'pbkdf2_hmac') - -+import functools -+def __ignore_usedforsecurity(func): -+ """Used for sha3_* functions. Until OpenSSL implements them, we want -+ to use them from Python _sha3 module, but we want them to accept -+ usedforsecurity argument too.""" -+ # TODO: remove this function when OpenSSL implements sha3 -+ @functools.wraps(func) -+ def inner(*args, **kwargs): -+ if 'usedforsecurity' in kwargs: -+ kwargs.pop('usedforsecurity') -+ return func(*args, **kwargs) -+ return inner - - __builtin_constructor_cache = {} - -@@ -100,31 +122,39 @@ def __get_openssl_constructor(name): - 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): -+ # TODO: We want to just raise here when OpenSSL implements sha3 -+ # because we want to make sure that Fedora uses everything from OpenSSL - return __get_builtin_constructor(name) - - --def __py_new(name, data=b''): -- """new(name, data=b'') - Return a new hashing object using the named algorithm; -- optionally initialized with data (which must be bytes). -+def __py_new(name, data=b'', usedforsecurity=True): -+ """new(name, data=b'', usedforsecurity=True) - Return a new hashing object using -+ the named algorithm; optionally initialized with data (which must be bytes). -+ The 'usedforsecurity' keyword argument does nothing, and is for compatibilty -+ with the OpenSSL implementation - """ - return __get_builtin_constructor(name)(data) - - --def __hash_new(name, data=b''): -- """new(name, data=b'') - Return a new hashing object using the named algorithm; -- optionally initialized with data (which must be bytes). -+def __hash_new(name, data=b'', usedforsecurity=True): -+ """new(name, data=b'', usedforsecurity=True) - Return a new hashing object using -+ the named algorithm; optionally initialized with data (which must be bytes). -+ -+ Override 'usedforsecurity' to False when using for non-security purposes in -+ a FIPS environment - """ - try: -- return _hashlib.new(name, data) -+ return _hashlib.new(name, data, 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. -+ # TODO: We want to just raise here when OpenSSL implements sha3 -+ # because we want to make sure that Fedora uses everything from OpenSSL - return __get_builtin_constructor(name)(data) - - -@@ -207,7 +237,10 @@ for __func_name in __always_supported: - # try them all, some may not work due to the OpenSSL - # version not supporting that algorithm. - try: -- globals()[__func_name] = __get_hash(__func_name) -+ func = __get_hash(__func_name) -+ if 'sha3_' in __func_name: -+ func = __ignore_usedforsecurity(func) -+ globals()[__func_name] = func - except ValueError: - import logging - logging.exception('code for hash %s was not found.', __func_name) -@@ -215,3 +248,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 __ignore_usedforsecurity -\ No newline at end of file -diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py -index c9b113e..60e2392 100644 ---- a/Lib/test/test_hashlib.py -+++ b/Lib/test/test_hashlib.py -@@ -24,7 +24,22 @@ from test.support import _4G, bigmemtest, import_fresh_module - COMPILED_WITH_PYDEBUG = hasattr(sys, 'gettotalrefcount') - - c_hashlib = import_fresh_module('hashlib', fresh=['_hashlib']) --py_hashlib = import_fresh_module('hashlib', blocked=['_hashlib']) -+# skipped on Fedora, since we always use OpenSSL implementation -+# py_hashlib = import_fresh_module('hashlib', blocked=['_hashlib']) -+ -+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() - - def hexstr(s): - assert isinstance(s, bytes), repr(s) -@@ -34,6 +49,16 @@ def hexstr(s): - r += h[(i >> 4) & 0xF] + h[i & 0xF] - return r - -+# hashlib and _hashlib-based functions support a "usedforsecurity" keyword -+# argument, and FIPS mode requires that it be used overridden with a False -+# value for these selftests to work. Other cryptographic code within Python -+# doesn't support this keyword. -+# Modify a function to one in which "usedforsecurity=False" is added to the -+# keyword arguments: -+def suppress_fips(f): -+ def g(*args, **kwargs): -+ return f(*args, usedforsecurity=False, **kwargs) -+ return g - - class HashLibTestCase(unittest.TestCase): - supported_hash_names = ( 'md5', 'MD5', 'sha1', 'SHA1', -@@ -63,11 +88,11 @@ class HashLibTestCase(unittest.TestCase): - # For each algorithm, test the direct constructor and the use - # of hashlib.new given the algorithm name. - for algorithm, constructors in self.constructors_to_test.items(): -- constructors.add(getattr(hashlib, algorithm)) -+ constructors.add(suppress_fips(getattr(hashlib, algorithm))) - def _test_algorithm_via_hashlib_new(data=None, _alg=algorithm): - if data is None: -- return hashlib.new(_alg) -- return hashlib.new(_alg, data) -+ return suppress_fips(hashlib.new)(_alg) -+ return suppress_fips(hashlib.new)(_alg, data) - constructors.add(_test_algorithm_via_hashlib_new) - - _hashlib = self._conditional_import_module('_hashlib') -@@ -79,27 +104,12 @@ class HashLibTestCase(unittest.TestCase): - for algorithm, constructors in self.constructors_to_test.items(): - constructor = getattr(_hashlib, 'openssl_'+algorithm, None) - if constructor: -- constructors.add(constructor) -+ constructors.add(suppress_fips(constructor)) - - def add_builtin_constructor(name): - constructor = getattr(hashlib, "__get_builtin_constructor")(name) - self.constructors_to_test[name].add(constructor) - -- _md5 = self._conditional_import_module('_md5') -- if _md5: -- add_builtin_constructor('md5') -- _sha1 = self._conditional_import_module('_sha1') -- if _sha1: -- add_builtin_constructor('sha1') -- _sha256 = self._conditional_import_module('_sha256') -- if _sha256: -- add_builtin_constructor('sha224') -- add_builtin_constructor('sha256') -- _sha512 = self._conditional_import_module('_sha512') -- if _sha512: -- add_builtin_constructor('sha384') -- add_builtin_constructor('sha512') -- - super(HashLibTestCase, self).__init__(*args, **kwargs) - - @property -@@ -148,9 +158,6 @@ class HashLibTestCase(unittest.TestCase): - else: - del sys.modules['_md5'] - self.assertRaises(TypeError, get_builtin_constructor, 3) -- constructor = get_builtin_constructor('md5') -- self.assertIs(constructor, _md5.md5) -- self.assertEqual(sorted(builtin_constructor_cache), ['MD5', 'md5']) - - def test_hexdigest(self): - for cons in self.hash_constructors: -@@ -433,6 +440,64 @@ 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") -+ -+ @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: -+ with self.assertRaisesRegexp(ValueError, '.*unknown cipher'): -+ m = hashlib.md5() -+ -+ if not self._conditional_import_module('_md5'): -+ with self.assertRaisesRegexp(ValueError, '.*unknown cipher'): -+ m = 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: -+ _hashlib = self._conditional_import_module('_hashlib') -+ if _hashlib: -+ assert hasattr(_hashlib, 'openssl_md5') -+ -+ # Ensure that _hashlib raises a ValueError on vanilla attempts to -+ # use MD5 in a FIPS-enforced setting: -+ with self.assertRaisesRegexp(ValueError, '.*unknown cipher'): -+ m = _hashlib.openssl_md5() -+ with self.assertRaisesRegexp(ValueError, '.*unknown cipher'): -+ m = _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(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.openssl_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") - - class KDFTests(unittest.TestCase): - -@@ -516,7 +581,7 @@ class KDFTests(unittest.TestCase): - out = pbkdf2(hash_name='sha1', password=b'password', salt=b'salt', - iterations=1, dklen=None) - self.assertEqual(out, self.pbkdf2_results['sha1'][0][0]) -- -+ @unittest.skip('skipped on Fedora, as we always use OpenSSL pbkdf2_hmac') - def test_pbkdf2_hmac_py(self): - self._test_pbkdf2_hmac(py_hashlib.pbkdf2_hmac) - -diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c -index 44765ac..b8cf490 100644 ---- a/Modules/_hashopenssl.c -+++ b/Modules/_hashopenssl.c -@@ -20,6 +20,8 @@ - - - /* EVP is the preferred interface to hashing in OpenSSL */ -+#include -+#include - #include - #include - /* We use the object interface to discover what hashes OpenSSL supports. */ -@@ -45,11 +47,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 = 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) \ -+ static EVPCachedInfo cached_info_ ##Name; - - DEFINE_CONSTS_FOR_NEW(md5) - DEFINE_CONSTS_FOR_NEW(sha1) -@@ -92,6 +102,48 @@ EVP_hash(EVPobject *self, const void *vp, Py_ssize_t len) - } - } - -+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 PyUnicode_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 -@@ -259,15 +311,16 @@ EVP_repr(EVPobject *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; - PyObject *data_obj = NULL; -+ int usedforsecurity = 1; - Py_buffer view; - char *nameStr; - const EVP_MD *digest; - -- if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O:HASH", kwlist, -- &name_obj, &data_obj)) { -+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|Oi:HASH", kwlist, -+ &name_obj, &data_obj, &usedforsecurity)) { - return -1; - } - -@@ -288,7 +341,12 @@ EVP_tp_init(EVPobject *self, PyObject *args, PyObject *kwds) - 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); -@@ -372,7 +430,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; - -@@ -387,7 +446,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) { -@@ -411,21 +475,29 @@ 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; - PyObject *data_obj = NULL; -+ int usedforsecurity = 1; - Py_buffer view = { 0 }; - PyObject *ret_obj; - char *name; - const EVP_MD *digest; - -- if (!PyArg_ParseTupleAndKeywords(args, kwdict, "O|O:new", kwlist, -- &name_obj, &data_obj)) { -+ if (!PyArg_ParseTupleAndKeywords(args, kwdict, "O|Oi:new", kwlist, -+ &name_obj, &data_obj, &usedforsecurity)) { - return NULL; - } - -@@ -439,7 +511,8 @@ EVP_new(PyObject *self, PyObject *args, PyObject *kwdict) - - digest = EVP_get_digestbyname(name); - -- ret_obj = EVPnew(name_obj, digest, NULL, (unsigned char*)view.buf, view.len); -+ ret_obj = EVPnew(name_obj, digest, NULL, (unsigned char*)view.buf, view.len, -+ usedforsecurity); - - if (data_obj) - PyBuffer_Release(&view); -@@ -722,57 +795,114 @@ generate_hash_name_list(void) - - - /* -- * 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) \ - { \ -- PyObject *data_obj = NULL; \ -- Py_buffer view = { 0 }; \ -- PyObject *ret_obj; \ -- \ -- if (!PyArg_ParseTuple(args, "|O:" #NAME , &data_obj)) { \ -- return NULL; \ -- } \ -- \ -- if (data_obj) \ -- GET_BUFFER_VIEW_OR_ERROUT(data_obj, &view); \ -- \ -- ret_obj = EVPnew( \ -- CONST_ ## NAME ## _name_obj, \ -- NULL, \ -- CONST_new_ ## NAME ## _ctx_p, \ -- (unsigned char*)view.buf, \ -- view.len); \ -- \ -- if (data_obj) \ -- PyBuffer_Release(&view); \ -- return ret_obj; \ -+ return implement_specific_EVP_new(self, args, kwdict, \ -+ "|Oi:" #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}; -+ PyObject *data_obj = NULL; -+ Py_buffer view = { 0 }; -+ int usedforsecurity = 1; -+ int idx; -+ PyObject *ret_obj = NULL; -+ -+ assert(cached_info); -+ -+ if (!PyArg_ParseTupleAndKeywords(args, kwdict, format, kwlist, -+ &data_obj, &usedforsecurity)) { -+ return NULL; -+ } -+ -+ if (data_obj) -+ GET_BUFFER_VIEW_OR_ERROUT(data_obj, &view); -+ -+ 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"); -+ } -+ } -+ -+ if (data_obj) -+ PyBuffer_Release(&view); -+ -+ 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: 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 = PyUnicode_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 with 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 = PyUnicode_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) -@@ -819,13 +949,10 @@ PyInit__hashlib(void) - { - PyObject *m, *openssl_md_meth_names; - -- OpenSSL_add_all_digests(); -- ERR_load_crypto_strings(); -+ SSL_load_error_strings(); -+ SSL_library_init(); - -- /* 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. */ -+ OpenSSL_add_all_digests(); - - Py_TYPE(&EVPtype) = &PyType_Type; - if (PyType_Ready(&EVPtype) < 0) diff --git a/python3.spec b/python3.spec index 299d446..ea4777b 100644 --- a/python3.spec +++ b/python3.spec @@ -282,38 +282,10 @@ Patch111: 00111-no-static-lib.patch # these unittest hooks in their own "check" phases) Patch132: 00132-add-rpmbuild-hooks-to-unittest.patch -# 00133 # -# 00133-skip-test_dl.patch is not relevant for python3: the "dl" module no -# longer exists - # 00137 # # Some tests within distutils fail when run in an rpmbuild: Patch137: 00137-skip-distutils-tests-that-fail-in-rpmbuild.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 ; see RHEL6 -# python 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 -# (rhbz#563986) -# Note: Up to Python 3.4.0.b1, upstream had their own implementation of what -# they assumed would become sha3. This patch was adapted to give it the -# usedforsecurity argument, even though it did nothing (OpenSSL didn't have -# sha3 implementation at that time).In 3.4.0.b2, sha3 implementation was reverted -# (see http://bugs.python.org/issue16113), but the alterations were left in the -# patch, since they may be useful again if upstream decides to rerevert sha3 -# implementation and OpenSSL still doesn't support it. For now, they're harmless. -Patch146: 00146-hashlib-fips.patch - # 00155 # # Avoid allocating thunks in ctypes unless absolutely necessary, to avoid # generating SELinux denials on "import ctypes" and "import uuid" when @@ -707,7 +679,6 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch111 -p1 %patch132 -p1 %patch137 -p1 -#patch146 -p1 %patch155 -p1 %patch157 -p1 %patch160 -p1 From 44bb068a8e3509fa1a113deb97509beb8847d7f7 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 22 Aug 2017 16:10:31 +0200 Subject: [PATCH 364/416] Top-level metadata: move URL, reword Summary --- python3.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python3.spec b/python3.spec index ea4777b..5602119 100644 --- a/python3.spec +++ b/python3.spec @@ -3,7 +3,8 @@ # ================== Name: python3 -Summary: Version 3 of the Python programming language aka Python 3000 +Summary: Interpreter of the Python programming language +URL: https://www.python.org/ %global pybasever 3.6 @@ -450,7 +451,6 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-root # Additional metadata, and subpackages # ====================================================== -URL: https://www.python.org/ # See notes in bug 532118: Provides: python(abi) = %{pybasever} From 094ccc055a177934c80400f03c6dca93e2ba3148 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 22 Aug 2017 16:55:51 +0200 Subject: [PATCH 365/416] Reword comments for descriptions and subpackage metadata --- python3.spec | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/python3.spec b/python3.spec index 5602119..d6a255a 100644 --- a/python3.spec +++ b/python3.spec @@ -447,12 +447,13 @@ Patch5001: python3-powerppc-arch.patch BuildRoot: %{_tmppath}/%{name}-%{version}-root -# ====================================================== -# Additional metadata, and subpackages -# ====================================================== +# ========================================== +# Descriptions, and metadata for subpackages +# ========================================== -# See notes in bug 532118: +# Packages with Python modules in standard locations automatically +# depend on python(abi). Provide that here. Provides: python(abi) = %{pybasever} # For backward compatibility only, remove in F29: @@ -508,10 +509,14 @@ Summary: Python runtime libraries # prevent "import pyexpat" from failing with a linker error if someone hasn't # yet upgraded expat: Requires: expat >= 2.1.0 + +# The "enum" module is included in the standard library. +# Provide an upgrade path from the external library. Provides: python3-enum34 = 1.0.4-5%{?dist} Obsoletes: python3-enum34 < 1.0.4-5%{?dist} -# Python 3 built with glibc >= 2.24.90-26 needs to require it (rhbz#1410644). +# Python 3 built with glibc >= 2.24.90-26 needs to require it +# See https://bugzilla.redhat.com/show_bug.cgi?id=1410644 Requires: glibc%{?_isa} >= 2.24.90-26 # For backward compatibility only, remove in F29: @@ -519,7 +524,6 @@ Provides: system-python-libs = %{version}-%{release} Provides: system-python-libs%{?_isa} = %{version}-%{release} Obsoletes: system-python-libs < %{version}-%{release} - %description libs This package contains runtime libraries for use by Python: - the majority of the Python standard library From 74f6a3d59e42c71b4e3629646c72281e62c2f277 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Wed, 23 Aug 2017 23:42:09 +0200 Subject: [PATCH 366/416] Skip failing test_float_with_comma I am unable to reproduce this bug outside of a build environment. Skip the test to make Python build again. Bug filed: https://bugzilla.redhat.com/show_bug.cgi?id=1484497 --- python3.spec | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/python3.spec b/python3.spec index d6a255a..a9ced53 100644 --- a/python3.spec +++ b/python3.spec @@ -432,6 +432,11 @@ Patch271: 00271-asyncio-get-default-signal-handler.patch # Fixed upstream: http://bugs.python.org/issue30119 Patch272: 00272-fix-ftplib-to-reject-newlines.patch +# 00273 # +# Skip test_float_with_comma, which fails in Koji with UnicodeDecodeError +# https://bugzilla.redhat.com/show_bug.cgi?id=1484497 +Patch273: 00273-skip-float-test.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -710,6 +715,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch270 -p1 %patch271 -p1 %patch272 -p1 +%patch273 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library. @@ -1661,6 +1667,7 @@ fi - Add bcond for --without optimizations - Reword package descriptions - Remove Group declarations +- Skip failing test_float_with_comma * Mon Aug 21 2017 Miro Hrončok - 3.6.2-10 - Remove system-python, see https://fedoraproject.org/wiki/Changes/Platform_Python_Stack From 37ed19d2c94ab30382c72a63cc868ba4d24c6f4b Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Mon, 28 Aug 2017 13:36:04 +0200 Subject: [PATCH 367/416] Add forgotten patch file --- 00273-skip-float-test.patch | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 00273-skip-float-test.patch diff --git a/00273-skip-float-test.patch b/00273-skip-float-test.patch new file mode 100644 index 0000000..233d3ed --- /dev/null +++ b/00273-skip-float-test.patch @@ -0,0 +1,12 @@ +diff --git a/Lib/test/test_float.py b/Lib/test/test_float.py +index 66726d6496d..3318fa5df59 100644 +--- a/Lib/test/test_float.py ++++ b/Lib/test/test_float.py +@@ -141,6 +141,7 @@ class GeneralFloatCases(unittest.TestCase): + # non-UTF-8 byte string + check(b'123\xa0') + ++ @unittest.skip('Fails in Koji: https://bugzilla.redhat.com/show_bug.cgi?id=1484497') + @support.run_with_locale('LC_NUMERIC', 'fr_FR', 'de_DE') + def test_float_with_comma(self): + # set locale to something that doesn't use '.' for the decimal point From b7855d36446510a3c4ec7ef746ea9a365bd5dd3c Mon Sep 17 00:00:00 2001 From: Tomas Orsava Date: Mon, 28 Aug 2017 15:20:28 +0200 Subject: [PATCH 368/416] Add a warning about updating python3-docs --- python3.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python3.spec b/python3.spec index a9ced53..7509aa4 100644 --- a/python3.spec +++ b/python3.spec @@ -11,6 +11,8 @@ URL: https://www.python.org/ # pybasever without the dot: %global pyshortver 36 +# WARNING When rebasing to a new Python version, +# remember to update the python3-docs package as well Version: %{pybasever}.2 Release: 11%{?dist} License: Python From eef42fd7ea9065fbb33026ca99ffd86566e14567 Mon Sep 17 00:00:00 2001 From: Michal Cyprian Date: Wed, 30 Aug 2017 14:52:53 +0200 Subject: [PATCH 369/416] Use python3 style of calling super() without arguments in rpath patch --- Python-3.1.1-rpath.patch | 7 +++---- python3.spec | 7 ++++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Python-3.1.1-rpath.patch b/Python-3.1.1-rpath.patch index 1493af2..9fae54c 100644 --- a/Python-3.1.1-rpath.patch +++ b/Python-3.1.1-rpath.patch @@ -1,15 +1,14 @@ diff -up Python-3.1.1/Lib/distutils/unixccompiler.py.rpath Python-3.1.1/Lib/distutils/unixccompiler.py --- Python-3.1.1/Lib/distutils/unixccompiler.py.rpath 2009-09-04 17:29:34.000000000 -0400 +++ Python-3.1.1/Lib/distutils/unixccompiler.py 2009-09-04 17:49:54.000000000 -0400 -@@ -141,6 +141,16 @@ class UnixCCompiler(CCompiler): +@@ -141,6 +141,15 @@ 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 = super( -+ self.__class__, self)._fix_lib_args(libraries, library_dirs, -+ runtime_library_dirs) ++ libraries, library_dirs, runtime_library_dirs = super()._fix_lib_args( ++ 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) diff --git a/python3.spec b/python3.spec index 7509aa4..14fd81e 100644 --- a/python3.spec +++ b/python3.spec @@ -14,7 +14,7 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well Version: %{pybasever}.2 -Release: 11%{?dist} +Release: 12%{?dist} License: Python @@ -1665,6 +1665,11 @@ fi # ====================================================== %changelog +* Mon Aug 28 2017 Michal Cyprian - 3.6.2-12 +- Use python3 style of calling super() without arguments in rpath + patch to prevent recursion in UnixCCompiler subclasses +Resolves: rhbz#1458122 + * Mon Aug 21 2017 Petr Viktorin - 3.6.2-11 - Add bcond for --without optimizations - Reword package descriptions From d27ccf60331245da0ce1229a6a0597cc3d4087a9 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Mon, 28 Aug 2017 14:45:54 +0200 Subject: [PATCH 370/416] Rename patch files to start with the number A consistent naming scheme makes managing patch files easier. --- Python-3.1.1-rpath.patch => 00001-rpath.patch | 0 ...3-powerppc-arch.patch => 05001-powerppc-arch.patch | 0 python3.spec | 11 ++++++++--- 3 files changed, 8 insertions(+), 3 deletions(-) rename Python-3.1.1-rpath.patch => 00001-rpath.patch (100%) rename python3-powerppc-arch.patch => 05001-powerppc-arch.patch (100%) diff --git a/Python-3.1.1-rpath.patch b/00001-rpath.patch similarity index 100% rename from Python-3.1.1-rpath.patch rename to 00001-rpath.patch diff --git a/python3-powerppc-arch.patch b/05001-powerppc-arch.patch similarity index 100% rename from python3-powerppc-arch.patch rename to 05001-powerppc-arch.patch diff --git a/python3.spec b/python3.spec index 14fd81e..e78a343 100644 --- a/python3.spec +++ b/python3.spec @@ -14,7 +14,7 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well Version: %{pybasever}.2 -Release: 12%{?dist} +Release: 13%{?dist} License: Python @@ -247,9 +247,10 @@ Source10: idle3.desktop # AppData file for idle3 Source11: idle3.appdata.xml +# 00001 # # Fixup distutils/unixccompiler.py to remove standard library path from rpath: # Was Patch0 in ivazquez' python3000 specfile: -Patch1: Python-3.1.1-rpath.patch +Patch1: 00001-rpath.patch # 00055 # # Systemtap support: add statically-defined probe points @@ -448,9 +449,10 @@ Patch273: 00273-skip-float-test.patch # # https://fedoraproject.org/wiki/SIGs/Python/PythonPatches +# 05001 # # add correct arch for ppc64/ppc64le # it should be ppc64le-linux-gnu/ppc64-linux-gnu instead powerpc64le-linux-gnu/powerpc64-linux-gnu -Patch5001: python3-powerppc-arch.patch +Patch5001: 05001-powerppc-arch.patch BuildRoot: %{_tmppath}/%{name}-%{version}-root @@ -1665,6 +1667,9 @@ fi # ====================================================== %changelog +* Mon Aug 28 2017 Petr Viktorin - 3.6.2-13 +- Rename patch files to be consistent + * Mon Aug 28 2017 Michal Cyprian - 3.6.2-12 - Use python3 style of calling super() without arguments in rpath patch to prevent recursion in UnixCCompiler subclasses From 96a7bd540e8e742d856027cad62d3ecdeece2c4e Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 29 Aug 2017 15:13:05 +0200 Subject: [PATCH 371/416] Run autotools to generate the configure script before building Partially fixes https://bugzilla.redhat.com/show_bug.cgi?id=1377240 --- 00055-systemtap.patch | 60 ------------------------------------------- python3.spec | 11 ++++++++ 2 files changed, 11 insertions(+), 60 deletions(-) diff --git a/00055-systemtap.patch b/00055-systemtap.patch index 0ab0387..a48fe7c 100644 --- a/00055-systemtap.patch +++ b/00055-systemtap.patch @@ -24,66 +24,6 @@ diff -up Python-3.3.0rc2/configure.ac.systemtap Python-3.3.0rc2/configure.ac + # -I${DLINCLDIR} is added to the compile rule for importdl.o AC_SUBST(DLINCLDIR) - DLINCLDIR=. -diff -up Python-3.3.0rc2/configure.systemtap Python-3.3.0rc2/configure ---- Python-3.3.0rc2/configure.systemtap 2012-09-09 05:11:14.000000000 -0400 -+++ Python-3.3.0rc2/configure 2012-09-10 09:17:21.116511780 -0400 -@@ -618,6 +618,8 @@ TRUE - MACHDEP_OBJS - DYNLOADFILE - DLINCLDIR -+SYSTEMTAPDEPS -+SYSTEMTAPOBJS - THREADOBJ - LDLAST - USE_THREAD_MODULE -@@ -779,6 +781,7 @@ with_doc_strings - with_tsc - with_pymalloc - with_valgrind -+with_systemtap - with_fpectl - with_libm - with_libc -@@ -1456,6 +1459,7 @@ Optional Packages: - --with(out)-tsc enable/disable timestamp counter profile - --with(out)-pymalloc disable/enable specialized mallocs - --with-valgrind Enable Valgrind support -+ --with(out)-systemtap disable/enable SystemTap support - --with-fpectl enable SIGFPE catching - --with-libm=STRING math library - --with-libc=STRING C library -@@ -10065,6 +10069,31 @@ fi - OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT" - fi - -+# Check for systemtap support -+# On Linux, /usr/bin/dtrace is in fact a shim to SystemTap -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-systemtap" >&5 -+$as_echo_n "checking for --with-systemtap... " >&6; } -+ -+# Check whether --with-systemtap was given. -+if test "${with_systemtap+set}" = set; then : -+ withval=$with_systemtap; -+else -+ with_systemtap=no -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_systemtap" >&5 -+$as_echo "$with_systemtap" >&6; } -+if test "$with_systemtap" != no; then -+ -+$as_echo "#define WITH_SYSTEMTAP 1" >>confdefs.h -+ -+ SYSTEMTAPOBJS="Python/pysystemtap.o" -+ SYSTEMTAPDEPS="\$(srcdir)/Python/pysystemtap.h" -+fi -+ -+ -+ -+ - # -I${DLINCLDIR} is added to the compile rule for importdl.o - DLINCLDIR=. diff -up Python-3.3.0rc2/Doc/howto/index.rst.systemtap Python-3.3.0rc2/Doc/howto/index.rst --- Python-3.3.0rc2/Doc/howto/index.rst.systemtap 2012-09-09 05:10:51.000000000 -0400 diff --git a/python3.spec b/python3.spec index e78a343..03dae44 100644 --- a/python3.spec +++ b/python3.spec @@ -733,11 +733,21 @@ sed --in-place \ %patch5001 -p1 +# Remove files that should be generated by the build +# (This is after patching, so that we can use patches directly from upstream) +rm configure pyconfig.h.in + + # ====================================================== # Configuring and building the code: # ====================================================== %build + +# Regenerate the configure script and pyconfig.h.in +autoconf +autoheader + topdir=$(pwd) export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv" export CXXFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv" @@ -1669,6 +1679,7 @@ fi %changelog * Mon Aug 28 2017 Petr Viktorin - 3.6.2-13 - Rename patch files to be consistent +- Run autotools to generate the configure script before building * Mon Aug 28 2017 Michal Cyprian - 3.6.2-12 - Use python3 style of calling super() without arguments in rpath From 2c6abcc9a3523d218833c73d81a5528c44fd3ccf Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Mon, 28 Aug 2017 14:52:51 +0200 Subject: [PATCH 372/416] Merge lib64 patches into one (104 into 102) It doean't make sense for these to be separate. --- 00102-lib64.patch | 14 ++++++++++++++ 00104-lib64-fix-for-test_install.patch | 13 ------------- python3.spec | 11 +++++------ 3 files changed, 19 insertions(+), 19 deletions(-) delete mode 100644 00104-lib64-fix-for-test_install.patch diff --git a/00102-lib64.patch b/00102-lib64.patch index 8e9ae4e..8eea66d 100644 --- a/00102-lib64.patch +++ b/00102-lib64.patch @@ -37,6 +37,20 @@ index 026cca7..6d3e077 100644 if standard_lib: return libpython else: +diff a/Lib/distutils/tests/test_install.py b/Lib/distutils/tests/test_install.py +--- a/Lib/distutils/tests/test_install.py ++++ b/Lib/distutils/tests/test_install.py +@@ -57,8 +57,9 @@ + 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/Lib/site.py b/Lib/site.py index a84e3bb..ba0d3ea 100644 --- a/Lib/site.py diff --git a/00104-lib64-fix-for-test_install.patch b/00104-lib64-fix-for-test_install.patch deleted file mode 100644 index 7852bf6..0000000 --- a/00104-lib64-fix-for-test_install.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- 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/python3.spec b/python3.spec index 03dae44..0e0277d 100644 --- a/python3.spec +++ b/python3.spec @@ -259,12 +259,11 @@ Patch1: 00001-rpath.patch # (where sys.getfilesystemencoding() == 'ascii') Patch55: 00055-systemtap.patch -Patch102: 00102-lib64.patch - -# 00104 # +# 00102 # +# Change the various install paths to use /usr/lib64/ instead or /usr/lib # Only used when "%{_lib}" == "lib64" -# Another lib64 fix, for distutils/tests/test_install.py; not upstream: -Patch104: 00104-lib64-fix-for-test_install.patch +# Not yet sent upstream. +Patch102: 00102-lib64.patch # 00111 # # Patch the Makefile.pre.in so that the generated Makefile doesn't try to build @@ -687,7 +686,6 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %if "%{_lib}" == "lib64" %patch102 -p1 -%patch104 -p1 %endif %patch111 -p1 %patch132 -p1 @@ -1680,6 +1678,7 @@ fi * Mon Aug 28 2017 Petr Viktorin - 3.6.2-13 - Rename patch files to be consistent - Run autotools to generate the configure script before building +- Merge lib64 patches (104 into 102) * Mon Aug 28 2017 Michal Cyprian - 3.6.2-12 - Use python3 style of calling super() without arguments in rpath From bbf22253530becdede28441270a43749d01c3bbd Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Mon, 28 Aug 2017 15:09:16 +0200 Subject: [PATCH 373/416] Skip test_bdist_rpm using test config rather than a patch Remove patch 137 --- ...-skip-distutils-tests-that-fail-in-rpmbuild.patch | 12 ------------ python3.spec | 7 ++----- 2 files changed, 2 insertions(+), 17 deletions(-) delete mode 100644 00137-skip-distutils-tests-that-fail-in-rpmbuild.patch diff --git a/00137-skip-distutils-tests-that-fail-in-rpmbuild.patch b/00137-skip-distutils-tests-that-fail-in-rpmbuild.patch deleted file mode 100644 index 0457093..0000000 --- a/00137-skip-distutils-tests-that-fail-in-rpmbuild.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up Python-3.2.2/Lib/distutils/tests/test_bdist_rpm.py.skip-distutils-tests-that-fail-in-rpmbuild Python-3.2.2/Lib/distutils/tests/test_bdist_rpm.py ---- Python-3.2.2/Lib/distutils/tests/test_bdist_rpm.py.skip-distutils-tests-that-fail-in-rpmbuild 2011-09-03 12:16:40.000000000 -0400 -+++ Python-3.2.2/Lib/distutils/tests/test_bdist_rpm.py 2011-09-10 05:04:56.328852558 -0400 -@@ -23,6 +23,7 @@ setup(name='foo', version='0.1', py_modu - - """ - -+@unittest._skipInRpmBuild("don't try to nest one rpm build inside another rpm build") - class BuildRpmTestCase(support.TempdirManager, - support.EnvironGuard, - support.LoggingSilencer, -diff -up Python-3.2.2/Lib/distutils/tests/test_build_ext.py.skip-distutils-tests-that-fail-in-rpmbuild Python-3.2.2/Lib/distutils/tests/test_build_ext.py diff --git a/python3.spec b/python3.spec index 0e0277d..30d1b12 100644 --- a/python3.spec +++ b/python3.spec @@ -285,10 +285,6 @@ Patch111: 00111-no-static-lib.patch # these unittest hooks in their own "check" phases) Patch132: 00132-add-rpmbuild-hooks-to-unittest.patch -# 00137 # -# Some tests within distutils fail when run in an rpmbuild: -Patch137: 00137-skip-distutils-tests-that-fail-in-rpmbuild.patch - # 00155 # # Avoid allocating thunks in ctypes unless absolutely necessary, to avoid # generating SELinux denials on "import ctypes" and "import uuid" when @@ -689,7 +685,6 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %endif %patch111 -p1 %patch132 -p1 -%patch137 -p1 %patch155 -p1 %patch157 -p1 %patch160 -p1 @@ -1185,6 +1180,7 @@ CheckPython() { LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \ -wW --slowest --findleaks \ -x test_distutils \ + -x test_bdist_rpm \ %ifarch ppc64le aarch64 -x test_faulthandler \ %endif @@ -1679,6 +1675,7 @@ fi - Rename patch files to be consistent - Run autotools to generate the configure script before building - Merge lib64 patches (104 into 102) +- Skip test_bdist_rpm using test config rather than a patch (removes patch 137) * Mon Aug 28 2017 Michal Cyprian - 3.6.2-12 - Use python3 style of calling super() without arguments in rpath From c4a5733df68f87f153e5efb3f4707be8b2b48d7e Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Mon, 28 Aug 2017 15:04:48 +0200 Subject: [PATCH 374/416] Use full URLs for bugzilla bugs Seasoned packagers have pattern-matching circuits for "rhbz" embedded in their brains, but for newcomers it's one more opaque, non-googlable string. The original comment for patch 00111 had a wrong bug number. Correct it. --- python3.spec | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/python3.spec b/python3.spec index 30d1b12..384b267 100644 --- a/python3.spec +++ b/python3.spec @@ -267,7 +267,8 @@ Patch102: 00102-lib64.patch # 00111 # # Patch the Makefile.pre.in so that the generated Makefile doesn't try to build -# a libpythonMAJOR.MINOR.a (bug 550692): +# a libpythonMAJOR.MINOR.a +# See https://bugzilla.redhat.com/show_bug.cgi?id=556092 # Downstream only: not appropriate for upstream Patch111: 00111-no-static-lib.patch @@ -288,7 +289,8 @@ Patch132: 00132-add-rpmbuild-hooks-to-unittest.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) +# embedding Python within httpd +# See https://bugzilla.redhat.com/show_bug.cgi?id=814391 Patch155: 00155-avoid-ctypes-thunks.patch # 00157 # @@ -304,7 +306,7 @@ Patch155: 00155-avoid-ctypes-thunks.patch # # 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) +# See https://bugzilla.redhat.com/show_bug.cgi?id=697470 Patch157: 00157-uid-gid-overflows.patch # 00160 # @@ -326,10 +328,11 @@ Patch163: 00163-disable-parts-of-test_socket-in-rpm-build.patch # 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) +# http://bugs.python.org/issue9263 +# (https://bugzilla.redhat.com/show_bug.cgi?id=614680) # hiding the proposed new macros/functions within gcmodule.c to avoid exposing # them within the extension API. -# (rhbz#850013 +# See https://bugzilla.redhat.com/show_bug.cgi?id=850013 Patch170: 00170-gc-assertions.patch # 00178 # @@ -385,7 +388,7 @@ Patch206: 00206-remove-hf-from-arm-triplet.patch # 00243 # # Fix the triplet used on 64-bit MIPS -# rhbz#1322526: https://bugzilla.redhat.com/show_bug.cgi?id=1322526 +# See https://bugzilla.redhat.com/show_bug.cgi?id=1322526 # Upstream uses Debian-like style mips64-linux-gnuabi64 # Fedora needs the default mips64-linux-gnu Patch243: 00243-fix-mips64-triplet.patch @@ -426,13 +429,13 @@ Patch271: 00271-asyncio-get-default-signal-handler.patch # 00272 # # Reject newline characters in ftplib.FTP.putline() arguments to # avoid FTP protocol stream injection via malicious URLs. -# rhbz#1478916 +# See https://bugzilla.redhat.com/show_bug.cgi?id=1478916 # Fixed upstream: http://bugs.python.org/issue30119 Patch272: 00272-fix-ftplib-to-reject-newlines.patch # 00273 # # Skip test_float_with_comma, which fails in Koji with UnicodeDecodeError -# https://bugzilla.redhat.com/show_bug.cgi?id=1484497 +# See https://bugzilla.redhat.com/show_bug.cgi?id=1484497 Patch273: 00273-skip-float-test.patch # (New patches go here ^^^) @@ -883,7 +886,8 @@ make install DESTDIR=%{buildroot} INSTALL="install -p" EXTRA_CFLAGS="$MoreCFlags # # Initially I tried: # /usr/lib/libpython3.1.so.1.0-gdb.py - # but doing so generated noise when ldconfig was rerun (rhbz:562980) + # but doing so generated noise when ldconfig was rerun + # (see https://bugzilla.redhat.com/show_bug.cgi?id=562980) # %if %{with gdb_hooks} DirHoldingGdbPy=%{_prefix}/lib/debug/%{_libdir} @@ -1077,8 +1081,8 @@ for Module in %{buildroot}/%{dynload_dir}/*.so ; do done # Create "/usr/bin/python3-debug", a symlink to the python3 debug binary, to -# avoid the user having to know the precise version and ABI flags. (see -# e.g. rhbz#676748): +# avoid the user having to know the precise version and ABI flags. +# See e.g. https://bugzilla.redhat.com/show_bug.cgi?id=676748 %if %{with debug_build} ln -s \ %{_bindir}/python%{LDVERSION_debug} \ @@ -1154,7 +1158,8 @@ find %{buildroot} -type f -a -name "*.py" -print0 | \ PYTHONPATH="%{buildroot}%{_libdir}/python%{pybasever} %{buildroot}%{_libdir}/python%{pybasever}/site-packages" \ xargs -0 %{buildroot}%{_bindir}/python%{pybasever} %{SOURCE8} -# For ppc64 we need a larger stack than default (rhbz#1292462) +# For ppc64 we need a larger stack than default +# See https://bugzilla.redhat.com/show_bug.cgi?id=1292462 %ifarch %{power64} ulimit -a ulimit -s 16384 @@ -1650,8 +1655,8 @@ fi %endif # with debug_build -# We put the debug-gdb.py file inside /usr/lib/debug to avoid noise from -# ldconfig (rhbz:562980). +# We put the debug-gdb.py file inside /usr/lib/debug to avoid noise from ldconfig +# See https://bugzilla.redhat.com/show_bug.cgi?id=562980 # # The /usr/lib/rpm/redhat/macros defines %__debug_package to use # debugfiles.list, and it appears that everything below /usr/lib/debug and @@ -1663,7 +1668,7 @@ fi # (if it doesn't, then the rpmbuild ought to fail since the debug-gdb.py # payload file would be unpackaged) -# Workaround for rhbz#1476593 +# Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1476593 %undefine _debuginfo_subpackages # ====================================================== From 61c2d437a2288473d392fa123371ae3806253e6d Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Mon, 28 Aug 2017 15:29:04 +0200 Subject: [PATCH 375/416] Remove patch 157, which contained test changes left over after upstreaming --- 00157-uid-gid-overflows.patch | 68 ----------------------------------- python3.spec | 18 +--------- 2 files changed, 1 insertion(+), 85 deletions(-) delete mode 100644 00157-uid-gid-overflows.patch diff --git a/00157-uid-gid-overflows.patch b/00157-uid-gid-overflows.patch deleted file mode 100644 index 03f3e02..0000000 --- a/00157-uid-gid-overflows.patch +++ /dev/null @@ -1,68 +0,0 @@ -diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py -index e9fdb07..ea60e6e 100644 ---- a/Lib/test/test_os.py -+++ b/Lib/test/test_os.py -@@ -1723,30 +1723,36 @@ class PosixUidGidTests(unittest.TestCase): - def test_setuid(self): - if os.getuid() != 0: - self.assertRaises(OSError, os.setuid, 0) -+ self.assertRaises(TypeError, os.setuid, 'not an int') - self.assertRaises(OverflowError, os.setuid, 1<<32) - - @unittest.skipUnless(hasattr(os, 'setgid'), 'test needs os.setgid()') - def test_setgid(self): - if os.getuid() != 0 and not HAVE_WHEEL_GROUP: - self.assertRaises(OSError, os.setgid, 0) -+ self.assertRaises(TypeError, os.setgid, 'not an int') - self.assertRaises(OverflowError, os.setgid, 1<<32) - - @unittest.skipUnless(hasattr(os, 'seteuid'), 'test needs os.seteuid()') - def test_seteuid(self): - if os.getuid() != 0: - self.assertRaises(OSError, os.seteuid, 0) -+ self.assertRaises(TypeError, os.seteuid, 'not an int') - self.assertRaises(OverflowError, os.seteuid, 1<<32) - - @unittest.skipUnless(hasattr(os, 'setegid'), 'test needs os.setegid()') - def test_setegid(self): - if os.getuid() != 0 and not HAVE_WHEEL_GROUP: - self.assertRaises(OSError, os.setegid, 0) -+ self.assertRaises(TypeError, os.setegid, 'not an int') - self.assertRaises(OverflowError, os.setegid, 1<<32) - - @unittest.skipUnless(hasattr(os, 'setreuid'), 'test needs os.setreuid()') - def test_setreuid(self): - if os.getuid() != 0: - self.assertRaises(OSError, 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) - -@@ -1762,6 +1768,8 @@ class PosixUidGidTests(unittest.TestCase): - def test_setregid(self): - if os.getuid() != 0 and not HAVE_WHEEL_GROUP: - self.assertRaises(OSError, 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/Lib/test/test_pwd.py b/Lib/test/test_pwd.py -index ac9cff7..db98159 100644 ---- a/Lib/test/test_pwd.py -+++ b/Lib/test/test_pwd.py -@@ -104,11 +104,11 @@ 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. - # Android accepts a very large span of uids including sys.maxsize and - # -1; it raises KeyError with 1 or 2 for example. -- fakeuid = sys.maxsize -+ fakeuid = 2**32 - 2 - self.assertNotIn(fakeuid, byuids) - if not support.is_android: - self.assertRaises(KeyError, pwd.getpwuid, fakeuid) diff --git a/python3.spec b/python3.spec index 384b267..9792bb7 100644 --- a/python3.spec +++ b/python3.spec @@ -293,22 +293,6 @@ Patch132: 00132-add-rpmbuild-hooks-to-unittest.patch # See https://bugzilla.redhat.com/show_bug.cgi?id=814391 Patch155: 00155-avoid-ctypes-thunks.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. -# See https://bugzilla.redhat.com/show_bug.cgi?id=697470 -Patch157: 00157-uid-gid-overflows.patch - # 00160 # # Python 3.3 added os.SEEK_DATA and os.SEEK_HOLE, which may be present in the # header files in the build chroot, but may not be supported in the running @@ -689,7 +673,6 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch111 -p1 %patch132 -p1 %patch155 -p1 -%patch157 -p1 %patch160 -p1 %patch163 -p1 %patch170 -p1 @@ -1681,6 +1664,7 @@ fi - Run autotools to generate the configure script before building - Merge lib64 patches (104 into 102) - Skip test_bdist_rpm using test config rather than a patch (removes patch 137) +- Remove patch 157, which contained test changes left over after upstreaming * Mon Aug 28 2017 Michal Cyprian - 3.6.2-12 - Use python3 style of calling super() without arguments in rpath From 720c2ade200e9c5ab1a13df5612a48cdbd8d6353 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Mon, 28 Aug 2017 15:36:10 +0200 Subject: [PATCH 376/416] Update comment for patch 170 --- python3.spec | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/python3.spec b/python3.spec index 9792bb7..b2fc811 100644 --- a/python3.spec +++ b/python3.spec @@ -311,12 +311,10 @@ Patch163: 00163-disable-parts-of-test_socket-in-rpm-build.patch # 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 -# (https://bugzilla.redhat.com/show_bug.cgi?id=614680) -# hiding the proposed new macros/functions within gcmodule.c to avoid exposing +# The new macros/functions within gcmodule.c are hidden to avoid exposing # them within the extension API. -# See https://bugzilla.redhat.com/show_bug.cgi?id=850013 +# Sent upstream: http://bugs.python.org/issue9263 +# See https://bugzilla.redhat.com/show_bug.cgi?id=614680 Patch170: 00170-gc-assertions.patch # 00178 # From d8970d7383e1377e69dde453fc1b19820aa2b77b Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Mon, 28 Aug 2017 15:45:22 +0200 Subject: [PATCH 377/416] Remove patch 186, which added a duplicate test The actual change is upstream; the patch as it was just added an inferior version of upstream's test_bad_coding. --- 00186-dont-raise-from-py_compile.patch | 14 -------------- python3.spec | 12 +----------- 2 files changed, 1 insertion(+), 25 deletions(-) delete mode 100644 00186-dont-raise-from-py_compile.patch diff --git a/00186-dont-raise-from-py_compile.patch b/00186-dont-raise-from-py_compile.patch deleted file mode 100644 index 25c4a9d..0000000 --- a/00186-dont-raise-from-py_compile.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -r 7fa3e824a4ee Lib/test/test_py_compile.py ---- a/Lib/test/test_py_compile.py Tue Oct 29 22:25:06 2013 -0400 -+++ b/Lib/test/test_py_compile.py Wed Oct 30 11:08:31 2013 +0100 -@@ -54,6 +54,10 @@ - self.assertTrue(os.path.exists(self.pyc_path)) - self.assertFalse(os.path.exists(self.cache_path)) - -+ def test_bad_coding(self): -+ bad_coding = os.path.join(os.path.dirname(__file__), 'bad_coding2.py') -+ self.assertIsNone(py_compile.compile(bad_coding, doraise=False)) -+ - def test_relative_path(self): - py_compile.compile(os.path.relpath(self.source_path), - os.path.relpath(self.pyc_path)) diff --git a/python3.spec b/python3.spec index b2fc811..3cffc87 100644 --- a/python3.spec +++ b/python3.spec @@ -328,15 +328,6 @@ Patch178: 00178-dont-duplicate-flags-in-sysconfig.patch # Not appropriate for upstream, Fedora-specific naming Patch180: 00180-python-add-support-for-ppc64p7.patch -# 00186 # -# Fix for https://bugzilla.redhat.com/show_bug.cgi?id=1023607 -# Previously, this fixed a problem where some *.py files were not being -# bytecompiled properly during build. This was result of py_compile.compile -# raising exception when trying to convert test file with bad encoding, and -# thus not continuing bytecompilation for other files. -# This was fixed upstream, but the test hasn't been merged yet, so we keep it -Patch186: 00186-dont-raise-from-py_compile.patch - # 00188 # # Downstream only patch that should be removed when we compile all guaranteed # hashlib algorithms properly. The problem is this: @@ -676,7 +667,6 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch170 -p1 %patch178 -p1 %patch180 -p1 -%patch186 -p1 %patch188 -p1 %if %{with rewheel} @@ -1662,7 +1652,7 @@ fi - Run autotools to generate the configure script before building - Merge lib64 patches (104 into 102) - Skip test_bdist_rpm using test config rather than a patch (removes patch 137) -- Remove patch 157, which contained test changes left over after upstreaming +- Remove patches 157 and 186, which had test changes left over after upstreaming * Mon Aug 28 2017 Michal Cyprian - 3.6.2-12 - Use python3 style of calling super() without arguments in rpath From ac06deac652cca79cce036f8acf81decbd86a82c Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Mon, 28 Aug 2017 15:50:56 +0200 Subject: [PATCH 378/416] Remove patch 188, a temporary workaround for hashlib tests --- ...s-when-hashlib-doesnt-compile-properly.patch | 11 ----------- python3.spec | 17 +---------------- 2 files changed, 1 insertion(+), 27 deletions(-) delete mode 100644 00188-fix-lib2to3-tests-when-hashlib-doesnt-compile-properly.patch diff --git a/00188-fix-lib2to3-tests-when-hashlib-doesnt-compile-properly.patch b/00188-fix-lib2to3-tests-when-hashlib-doesnt-compile-properly.patch deleted file mode 100644 index 90af30d..0000000 --- a/00188-fix-lib2to3-tests-when-hashlib-doesnt-compile-properly.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -r 28c04e954bb6 Lib/lib2to3/main.py ---- a/Lib/lib2to3/main.py Tue Oct 29 22:25:55 2013 -0400 -+++ b/Lib/lib2to3/main.py Wed Nov 06 14:33:07 2013 +0100 -@@ -213,6 +213,7 @@ - - # Set up logging handler - level = logging.DEBUG if options.verbose else logging.INFO -+ logging.root.handlers = [] - logging.basicConfig(format='%(name)s: %(message)s', level=level) - logger = logging.getLogger('lib2to3.main') - diff --git a/python3.spec b/python3.spec index 3cffc87..fe52e47 100644 --- a/python3.spec +++ b/python3.spec @@ -328,21 +328,6 @@ Patch178: 00178-dont-duplicate-flags-in-sysconfig.patch # Not appropriate for upstream, Fedora-specific naming Patch180: 00180-python-add-support-for-ppc64p7.patch -# 00188 # -# Downstream only patch that should be removed when we compile all guaranteed -# hashlib algorithms properly. The problem is this: -# - during tests, test_hashlib is imported and executed before test_lib2to3 -# - if at least one hash function has failed, trying to import it triggers an -# exception that is being caught and exception is logged: -# http://hg.python.org/cpython/file/2de806c8b070/Lib/hashlib.py#l217 -# - logging the exception makes logging module run basicConfig -# - when lib2to3 tests are run again, lib2to3 runs basicConfig again, which -# doesn't do anything, because it was run previously -# (logging.root.handlers != []), which means that the default setup -# (most importantly logging level) is not overriden. That means that a test -# relying on this will fail (test_filename_changing_on_output_single_dir) -Patch188: 00188-fix-lib2to3-tests-when-hashlib-doesnt-compile-properly.patch - # 00189 # # Add the rewheel module, allowing to recreate wheels from already installed # ones @@ -667,7 +652,6 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch170 -p1 %patch178 -p1 %patch180 -p1 -%patch188 -p1 %if %{with rewheel} %patch189 -p1 @@ -1653,6 +1637,7 @@ fi - Merge lib64 patches (104 into 102) - Skip test_bdist_rpm using test config rather than a patch (removes patch 137) - Remove patches 157 and 186, which had test changes left over after upstreaming +- Remove patch 188, a temporary workaround for hashlib tests * Mon Aug 28 2017 Michal Cyprian - 3.6.2-12 - Use python3 style of calling super() without arguments in rpath From 9423d36fb4847cc6117daea82490a188cc78ebdf Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Mon, 28 Aug 2017 17:16:46 +0200 Subject: [PATCH 379/416] Consolidate architecture-naming patches in one Patches 180, 206, 243 and 5001 all changed architecture names from Debian style (which upstream uses) to what Fedora uses. Consolidate them into a single patch, 274. Delete changes to `configure` from patch 243 without replacement; that file is generated from `configure.ac`. --- 00180-python-add-support-for-ppc64p7.patch | 13 ----- 00206-remove-hf-from-arm-triplet.patch | 15 ------ 00243-fix-mips64-triplet.patch | 42 ---------------- 00274-fix-arch-names.patch | 58 ++++++++++++++++++++++ 05001-powerppc-arch.patch | 30 ----------- python3.spec | 32 +++--------- 6 files changed, 64 insertions(+), 126 deletions(-) delete mode 100644 00180-python-add-support-for-ppc64p7.patch delete mode 100644 00206-remove-hf-from-arm-triplet.patch delete mode 100644 00243-fix-mips64-triplet.patch create mode 100644 00274-fix-arch-names.patch delete mode 100644 05001-powerppc-arch.patch diff --git a/00180-python-add-support-for-ppc64p7.patch b/00180-python-add-support-for-ppc64p7.patch deleted file mode 100644 index 054f9f3..0000000 --- a/00180-python-add-support-for-ppc64p7.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/config.sub b/config.sub -index 40ea5df..932128b 100755 ---- a/config.sub -+++ b/config.sub -@@ -1045,7 +1045,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) - basic_machine=powerpc64le-unknown diff --git a/00206-remove-hf-from-arm-triplet.patch b/00206-remove-hf-from-arm-triplet.patch deleted file mode 100644 index c5f309c..0000000 --- a/00206-remove-hf-from-arm-triplet.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -up Python-3.5.0/configure.ac.eabi Python-3.5.0/configure.ac ---- Python-3.5.0/configure.eabi 2015-09-23 13:52:20.756909744 +0200 -+++ Python-3.5.0/configure 2015-09-23 13:52:46.859163629 +0200 -@@ -762,9 +762,9 @@ cat >> conftest.c <> conftest.c <> conftest.c <> conftest.c <> conftest.c <> conftest.c <> conftest.c <> conftest.c <> conftest.c <> conftest.c <> conftest.c < - 3.6.2-12 - Use python3 style of calling super() without arguments in rpath From 28aab8e5dbc9e7d00f7f7a72f3a2b895369b542d Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Mon, 28 Aug 2017 17:23:55 +0200 Subject: [PATCH 380/416] Remove the BuildRoot tag According to current guidelines, this SHOULD NOT be used. --- python3.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/python3.spec b/python3.spec index 666e93f..396ca96 100644 --- a/python3.spec +++ b/python3.spec @@ -392,8 +392,6 @@ Patch274: 00274-fix-arch-names.patch # # https://fedoraproject.org/wiki/SIGs/Python/PythonPatches -BuildRoot: %{_tmppath}/%{name}-%{version}-root - # ========================================== # Descriptions, and metadata for subpackages From 9faeaef40ad3e08229eff99c611dc74dc80d1788 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Mon, 28 Aug 2017 17:30:42 +0200 Subject: [PATCH 381/416] Remove fix for version-specific documentation URLs in pydoc This was fixed upstream some time ago. The removed sed invocation did nothing. --- python3.spec | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/python3.spec b/python3.spec index 396ca96..d0d2451 100644 --- a/python3.spec +++ b/python3.spec @@ -650,16 +650,6 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch273 -p1 %patch274 -p1 -# Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there -# are many differences between 2.6 and the Python 3 library. -# -# Fix up the URLs within pydoc to point at the documentation for this -# MAJOR.MINOR version: -# -sed --in-place \ - --expression="s|http://docs.python.org/library|http://docs.python.org/%{pybasever}/library|g" \ - Lib/pydoc.py || exit 1 - # Remove files that should be generated by the build # (This is after patching, so that we can use patches directly from upstream) From 3a884e4af31574b8d88afe4911dfc86e55d22aee Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Mon, 28 Aug 2017 17:38:51 +0200 Subject: [PATCH 382/416] Make module removal (unbundling) more strict Failures from removing bundled expat or zlib should not be silent; if they occur they should be investigated. Also, reword the comments for conciseness --- python3.spec | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/python3.spec b/python3.spec index d0d2451..aa803a5 100644 --- a/python3.spec +++ b/python3.spec @@ -586,13 +586,9 @@ cp -a %{SOURCE6} . cp -a %{SOURCE7} . %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 zlib: -rm -r Modules/zlib || exit 1 +# Remove bundled libraries to ensure that we're using the system copy. +rm -r Modules/expat +rm -r Modules/zlib ## Disabling hashlib patch for now as it needs to be reimplemented ## for OpenSSL 1.1.0. From 1151a3e1a41f4ed815e1e74671cfab8a79b9ba60 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 29 Aug 2017 10:36:23 +0200 Subject: [PATCH 383/416] Remove commented-out prep code for hashlib OpenSSL/FIPS patch A task is open in Bugzilla for adding this back: https://bugzilla.redhat.com/show_bug.cgi?id=1486212 --- python3.spec | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/python3.spec b/python3.spec index aa803a5..c33f99c 100644 --- a/python3.spec +++ b/python3.spec @@ -590,19 +590,6 @@ cp -a %{SOURCE7} . rm -r Modules/expat rm -r Modules/zlib -## 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 hashlib.md5 is implemented within _hashlib via -# OpenSSL (and thus respects FIPS mode), and does not fall back to _md5 -# TODO: there seems to be no OpenSSL support in Python for sha3 so far -# when it is there, also remove _sha3/ dir -#for f in md5module.c sha1module.c sha256module.c sha512module.c; do -# rm Modules/$f -#done - %if %{with rewheel} %global pip_version 9.0.1 sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/ensurepip/__init__.py From 357f40b6c43803f3fe15c4ae3ff1c5f135c46c22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 31 Aug 2017 23:01:10 +0200 Subject: [PATCH 384/416] Move python2-tools conflicts to tools subpackage They were previously wrongly placed in tkinter subpackage --- python3.spec | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/python3.spec b/python3.spec index c33f99c..316eedb 100644 --- a/python3.spec +++ b/python3.spec @@ -504,6 +504,12 @@ Provides: %{name}-idle = %{version}-%{release} Provides: 2to3 = %{version}-%{release} Provides: idle3 = %{version}-%{release} +# https://bugzilla.redhat.com/show_bug.cgi?id=1111275 +# /usr/bin/2to3 was moved from here +# TODO Remove in Fedora 29 +Conflicts: python2-tools < 2.7.13-17 +Conflicts: python-tools < 2.7.13-17 + %description tools This package contains several tools included with Python, including: - 2to3, an automatic source converter from Python 2.X @@ -514,12 +520,6 @@ This package contains several tools included with Python, including: Summary: A GUI toolkit for Python Requires: %{name} = %{version}-%{release} -# https://bugzilla.redhat.com/show_bug.cgi?id=1111275 -# /usr/bin/2to3 was moved from here -# TODO Remove in Fedora 29 -Conflicts: python2-tools < 2.7.13-17 -Conflicts: python-tools < 2.7.13-17 - %description tkinter The Tkinter (Tk interface) library is a graphical user interface toolkit for the Python programming language. @@ -1588,7 +1588,8 @@ fi - Skip test_bdist_rpm using test config rather than a patch (removes patch 137) - Remove patches 157 and 186, which had test changes left over after upstreaming - Remove patch 188, a temporary workaround for hashlib tests -- Merge patches 180, 206, 243, 5001 (architecture naming) into new patch 274. +- Merge patches 180, 206, 243, 5001 (architecture naming) into new patch 274 +- Move python2-tools conflicts to tools subpackage (it was wrongly in tkinter) * Mon Aug 28 2017 Michal Cyprian - 3.6.2-12 - Use python3 style of calling super() without arguments in rpath From 33e1101626689456a447c55b4450b66910df063f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 1 Sep 2017 11:04:02 +0200 Subject: [PATCH 385/416] Expat >= 2.1.0 is everywhere, remove explicit requires (Except EL6) --- python3.spec | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/python3.spec b/python3.spec index 316eedb..f5902c0 100644 --- a/python3.spec +++ b/python3.spec @@ -14,7 +14,7 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well Version: %{pybasever}.2 -Release: 13%{?dist} +Release: 14%{?dist} License: Python @@ -160,10 +160,7 @@ BuildRequires: bluez-libs-devel BuildRequires: bzip2 BuildRequires: bzip2-devel BuildRequires: desktop-file-utils - -# 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-3.2.3 for CVE-2012-0876: -BuildRequires: expat-devel >= 2.1.0 +BuildRequires: expat-devel BuildRequires: findutils BuildRequires: gcc-c++ @@ -449,12 +446,6 @@ the "%{name}-" prefix. %package libs Summary: Python runtime libraries -# 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 - # The "enum" module is included in the standard library. # Provide an upgrade path from the external library. Provides: python3-enum34 = 1.0.4-5%{?dist} @@ -1581,6 +1572,9 @@ fi # ====================================================== %changelog +* Fri Sep 01 2017 Miro Hrončok - 3.6.2-14 +- Expat >= 2.1.0 is everywhere, remove explicit requires + * Mon Aug 28 2017 Petr Viktorin - 3.6.2-13 - Rename patch files to be consistent - Run autotools to generate the configure script before building From 51501f9a0bbd9c12b933dfbfd64580e4d04ca5a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 1 Sep 2017 11:28:31 +0200 Subject: [PATCH 386/416] Conditionalize systemtap-devel BuildRequires --- python3.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index f5902c0..ae2a4fb 100644 --- a/python3.spec +++ b/python3.spec @@ -183,9 +183,11 @@ BuildRequires: pkgconfig BuildRequires: readline-devel BuildRequires: sqlite-devel -BuildRequires: systemtap-sdt-devel +%if %{with systemtap} BuildRequires: systemtap-devel +BuildRequires: systemtap-sdt-devel %global tapsetdir /usr/share/systemtap/tapset +%endif BuildRequires: tar BuildRequires: tcl-devel @@ -199,6 +201,8 @@ BuildRequires: valgrind-devel BuildRequires: xz-devel BuildRequires: zlib-devel +BuildRequires: /usr/bin/dtrace + %if %{with rewheel} BuildRequires: python3-setuptools BuildRequires: python3-pip @@ -1574,6 +1578,7 @@ fi %changelog * Fri Sep 01 2017 Miro Hrončok - 3.6.2-14 - Expat >= 2.1.0 is everywhere, remove explicit requires +- Conditionalize systemtap-devel BuildRequires * Mon Aug 28 2017 Petr Viktorin - 3.6.2-13 - Rename patch files to be consistent From 5f24f39d01d423935d2b21ff7502114641e6fca3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 1 Sep 2017 11:48:50 +0200 Subject: [PATCH 387/416] For consistency, require /usr/sbin/ifconfig instead of net-tools --- python3.spec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python3.spec b/python3.spec index ae2a4fb..64782da 100644 --- a/python3.spec +++ b/python3.spec @@ -175,9 +175,6 @@ BuildRequires: libGL-devel BuildRequires: libX11-devel BuildRequires: ncurses-devel -# workaround http://bugs.python.org/issue19804 (test_uuid requires ifconfig) -BuildRequires: net-tools - BuildRequires: openssl-devel BuildRequires: pkgconfig BuildRequires: readline-devel @@ -203,6 +200,9 @@ BuildRequires: zlib-devel BuildRequires: /usr/bin/dtrace +# workaround http://bugs.python.org/issue19804 (test_uuid requires ifconfig) +BuildRequires: /usr/sbin/ifconfig + %if %{with rewheel} BuildRequires: python3-setuptools BuildRequires: python3-pip @@ -1579,6 +1579,7 @@ fi * Fri Sep 01 2017 Miro Hrončok - 3.6.2-14 - Expat >= 2.1.0 is everywhere, remove explicit requires - Conditionalize systemtap-devel BuildRequires +- For consistency, require /usr/sbin/ifconfig instead of net-tools * Mon Aug 28 2017 Petr Viktorin - 3.6.2-13 - Rename patch files to be consistent From 1acd7dfa3395ac84b450d0d740aeba9e470ffd29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 1 Sep 2017 17:42:46 +0200 Subject: [PATCH 388/416] Remove %{pylibdir}/Tools/scripts/2to3 * the file has wrong shebang (#!/usr/bin/env python) * it is not covered by the shebang correction because it is not named with .py extension * a note has been added to the shebang correction code about this * ignoring shebang, the file is identical to /usr/bin/2to3 * thus redundant --- python3.spec | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 64782da..aa42e9c 100644 --- a/python3.spec +++ b/python3.spec @@ -14,7 +14,7 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well Version: %{pybasever}.2 -Release: 14%{?dist} +Release: 15%{?dist} License: Python @@ -893,10 +893,14 @@ sed -i -e "s/'pyconfig.h'/'%{_pyconfig_h}'/" \ %{buildroot}%{pylibdir}/sysconfig.py # Switch all shebangs to refer to the specific Python version. +# This currently only covers files with .py extension LD_LIBRARY_PATH=./build/optimized ./build/optimized/python \ Tools/scripts/pathfix.py \ -i "%{_bindir}/python%{pybasever}" \ %{buildroot} +# not covered, also redundant and useless: +rm %{buildroot}%{pylibdir}/Tools/scripts/2to3 + # Remove shebang lines from .py files that aren't executable, and # remove executability from .py files that don't have a shebang line: @@ -1576,6 +1580,9 @@ fi # ====================================================== %changelog +* Fri Sep 01 2017 Miro Hrončok - 3.6.2-15 +- Remove %%{pylibdir}/Tools/scripts/2to3 + * Fri Sep 01 2017 Miro Hrončok - 3.6.2-14 - Expat >= 2.1.0 is everywhere, remove explicit requires - Conditionalize systemtap-devel BuildRequires From e441743e28f31eb921af310064a0303e92524f01 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Thu, 31 Aug 2017 15:28:09 +0200 Subject: [PATCH 389/416] Don't remove the buildroot in %install --- python3.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/python3.spec b/python3.spec index aa42e9c..072a1e4 100644 --- a/python3.spec +++ b/python3.spec @@ -745,8 +745,6 @@ BuildPython optimized \ %install topdir=$(pwd) -rm -fr %{buildroot} -mkdir -p %{buildroot}%{_prefix} %{buildroot}%{_mandir} InstallPython() { From db2797c8b72fdcf01f01515e1849a2466933e371 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Thu, 31 Aug 2017 15:27:20 +0200 Subject: [PATCH 390/416] Clean up the %build section - Add more explanatory comments, remove historical notes - Put configuration options in %%global - Shell: use $() instead of backticks - Remove unused aruments to BuildPython()! (fun fact: most were *never* used!) --- python3.spec | 85 ++++++++++++++++++++++------------------------------ 1 file changed, 36 insertions(+), 49 deletions(-) diff --git a/python3.spec b/python3.spec index 072a1e4..6b31105 100644 --- a/python3.spec +++ b/python3.spec @@ -644,42 +644,50 @@ rm configure pyconfig.h.in autoconf autoheader +# Remember the current directory (which has sources and the configure script), +# so we can refer to it after we "cd" elsewhere. topdir=$(pwd) + +# Get proper option names from bconds +%if %{with computed_gotos} +%global computed_gotos_flag yes +%else +%global computed_gotos_flag no +%endif + +%if %{with optimizations} +%global optimizations_flag "--enable-optimizations" +%else +%global optimizations_flag "--disable-optimizations" +%endif + +# Set common compiler/linker flags 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 CPPFLAGS="$(pkg-config --cflags-only-I libffi)" export OPT="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv" export LINKCC="gcc" -export CFLAGS="$CFLAGS `pkg-config --cflags openssl`" -export LDFLAGS="$RPM_LD_FLAGS `pkg-config --libs-only-L openssl`" +export CFLAGS="$CFLAGS $(pkg-config --cflags openssl)" +export LDFLAGS="$RPM_LD_FLAGS $(pkg-config --libs-only-L openssl)" - -# Define a function, for how to perform a "build" of python for a given -# configuration: +# We can build several different configurations of Python: regular and debug. +# Define a common function that does one build: BuildPython() { ConfName=$1 - BinaryName=$2 - SymlinkName=$3 - ExtraConfigArgs=$4 - PathFixWithThisBinary=$5 - MoreCFlags=$6 + ExtraConfigArgs=$2 + MoreCFlags=$3 + # Each build is done in its own directory ConfDir=build/$ConfName - - echo STARTING: BUILD OF PYTHON FOR CONFIGURATION: $ConfName - %{_bindir}/$BinaryName + echo STARTING: BUILD OF PYTHON FOR CONFIGURATION: $ConfName mkdir -p $ConfDir - pushd $ConfDir - # Use the freshly created "configure" script, but in the directory two above: + # Normally, %%configure looks for the "configure" script in the current + # directory. + # Since we changed directories, we need to tell %%configure where to look. %global _configure $topdir/configure - %if %{with computed_gotos} - %global computed_gotos_flag yes - %else - %global computed_gotos_flag no - %endif - %configure \ --enable-ipv6 \ --enable-shared \ @@ -699,45 +707,24 @@ BuildPython() { $ExtraConfigArgs \ %{nil} - # Set EXTRA_CFLAGS to our CFLAGS (rather than overriding OPT, as we've done - # in the past). - # This should fix a problem with --with-valgrind where it adds - # -DDYNAMIC_ANNOTATIONS_ENABLED=1 - # to OPT which must be passed to all compilation units in the build, - # otherwise leading to linker errors, e.g. - # missing symbol AnnotateRWLockDestroy - # - # Invoke the build: + # Invoke the build make EXTRA_CFLAGS="$CFLAGS $MoreCFlags" %{?_smp_mflags} popd - echo FINISHED: BUILD OF PYTHON FOR CONFIGURATION: $ConfDir + echo FINISHED: BUILD OF PYTHON FOR CONFIGURATION: $ConfName } -# Use "BuildPython" to support building with different configurations: +# Call the above to build each configuration. %if %{with debug_build} BuildPython debug \ - python-debug \ - python%{pybasever}-debug \ -%ifarch %{ix86} x86_64 ppc %{power64} - "--with-pydebug --without-ensurepip" \ -%else - "--with-pydebug --without-ensurepip" \ -%endif - false \ - -O0 + "--without-ensurepip --with-pydebug" \ + "-O0" %endif # with debug_build BuildPython optimized \ - python \ - python%{pybasever} \ -%if %{with optimizations} - "--without-ensurepip --enable-optimizations" \ -%else - "--without-ensurepip --disable-optimizations" \ -%endif # with optimizations - true + "--without-ensurepip %{optimizations_flag}" \ + "" # ====================================================== # Installing the built code: From b3fc51be3238066b98575ea2d67e62ce7a7a1456 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Fri, 1 Sep 2017 11:14:37 +0200 Subject: [PATCH 391/416] Replace ${RPM_BUILD_ROOT} by %{buildroot} --- python3.spec | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/python3.spec b/python3.spec index 6b31105..ceef4f2 100644 --- a/python3.spec +++ b/python3.spec @@ -798,26 +798,26 @@ InstallPython debug \ InstallPython optimized \ %{py_INSTSONAME_optimized} -install -d -m 0755 ${RPM_BUILD_ROOT}%{pylibdir}/site-packages/__pycache__ +install -d -m 0755 %{buildroot}%{pylibdir}/site-packages/__pycache__ # add idle3 to menu -install -D -m 0644 Lib/idlelib/Icons/idle_16.png ${RPM_BUILD_ROOT}%{_datadir}/icons/hicolor/16x16/apps/idle3.png -install -D -m 0644 Lib/idlelib/Icons/idle_32.png ${RPM_BUILD_ROOT}%{_datadir}/icons/hicolor/32x32/apps/idle3.png -install -D -m 0644 Lib/idlelib/Icons/idle_48.png ${RPM_BUILD_ROOT}%{_datadir}/icons/hicolor/48x48/apps/idle3.png -desktop-file-install --dir=${RPM_BUILD_ROOT}%{_datadir}/applications %{SOURCE10} +install -D -m 0644 Lib/idlelib/Icons/idle_16.png %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/idle3.png +install -D -m 0644 Lib/idlelib/Icons/idle_32.png %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/idle3.png +install -D -m 0644 Lib/idlelib/Icons/idle_48.png %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/idle3.png +desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE10} # Install and validate appdata file -mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/appdata -cp -a %{SOURCE11} ${RPM_BUILD_ROOT}%{_datadir}/appdata -appstream-util validate-relax --nonet ${RPM_BUILD_ROOT}%{_datadir}/appdata/idle3.appdata.xml +mkdir -p %{buildroot}%{_datadir}/appdata +cp -a %{SOURCE11} %{buildroot}%{_datadir}/appdata +appstream-util validate-relax --nonet %{buildroot}%{_datadir}/appdata/idle3.appdata.xml # Development tools -install -m755 -d ${RPM_BUILD_ROOT}%{pylibdir}/Tools -install Tools/README ${RPM_BUILD_ROOT}%{pylibdir}/Tools/ -cp -ar Tools/freeze ${RPM_BUILD_ROOT}%{pylibdir}/Tools/ -cp -ar Tools/i18n ${RPM_BUILD_ROOT}%{pylibdir}/Tools/ -cp -ar Tools/pynche ${RPM_BUILD_ROOT}%{pylibdir}/Tools/ -cp -ar Tools/scripts ${RPM_BUILD_ROOT}%{pylibdir}/Tools/ +install -m755 -d %{buildroot}%{pylibdir}/Tools +install Tools/README %{buildroot}%{pylibdir}/Tools/ +cp -ar Tools/freeze %{buildroot}%{pylibdir}/Tools/ +cp -ar Tools/i18n %{buildroot}%{pylibdir}/Tools/ +cp -ar Tools/pynche %{buildroot}%{pylibdir}/Tools/ +cp -ar Tools/scripts %{buildroot}%{pylibdir}/Tools/ # Documentation tools install -m755 -d %{buildroot}%{pylibdir}/Doc @@ -913,7 +913,7 @@ find %{buildroot}/ -name "*~" -exec rm -f {} \; find . -name "*~" -exec rm -f {} \; rm -f %{buildroot}%{pylibdir}/LICENSE.txt # 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* # Get rid of stray patch file from buildroot: rm -f %{buildroot}%{pylibdir}/test/test_imp.py.apply-our-changes-to-expected-shebang # from patch 4 From 208332b1c936594b8e2388806115015b85459822 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Thu, 31 Aug 2017 16:00:06 +0200 Subject: [PATCH 392/416] Clean up the start of the %install section - Rewrite comments - Move common part of GDB hook install out of the per-build function --- python3.spec | 75 ++++++++++++++++++++++++++++------------------------ 1 file changed, 40 insertions(+), 35 deletions(-) diff --git a/python3.spec b/python3.spec index ceef4f2..72c2918 100644 --- a/python3.spec +++ b/python3.spec @@ -731,63 +731,66 @@ BuildPython optimized \ # ====================================================== %install + +# As in %%build, remember the current directory topdir=$(pwd) +# We install a collection of hooks for gdb that make it easier to debug +# executables linked against libpython3* (such as /usr/bin/python3 itself) +# +# These hooks are implemented in Python itself (though they are for the version +# of python that gdb is linked with) +# +# gdb-archer looks for them in the same path as the ELF file or its .debug +# file, with a -gdb.py suffix. +# We put them next to the debug file, because ldconfig would complain if +# it found non-library files directly in /usr/lib/ +# (see https://bugzilla.redhat.com/show_bug.cgi?id=562980) +# +# We'll put these files in the debuginfo package by installing them to e.g.: +# /usr/lib/debug/usr/lib/libpython3.2.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 + +%if %{with gdb_hooks} +DirHoldingGdbPy=%{_prefix}/lib/debug/%{_libdir} +mkdir -p %{buildroot}$DirHoldingGdbPy +%endif # with gdb_hooks + +# Use a common function to do an install for all our configurations: InstallPython() { ConfName=$1 PyInstSoName=$2 MoreCFlags=$3 + # Switch to the directory with this configuration's built files ConfDir=build/$ConfName - echo STARTING: INSTALL OF PYTHON FOR CONFIGURATION: $ConfName mkdir -p $ConfDir - pushd $ConfDir -make install DESTDIR=%{buildroot} INSTALL="install -p" EXTRA_CFLAGS="$MoreCFlags" + make \ + DESTDIR=%{buildroot} \ + INSTALL="install -p" \ + EXTRA_CFLAGS="$MoreCFlags" \ + install popd - # We install a collection of hooks for gdb that make it easier to debug - # executables linked against libpython3* (such as /usr/bin/python3 itself) - # - # These hooks are implemented in Python itself (though they are for the version - # of python that gdb is linked with, in this case Python 2.7) - # - # 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/libpython3.2.so.1.0.debug-gdb.py - # - # See https://fedoraproject.org/wiki/Features/EasierPythonDebugging for more - # information - # - # 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/libpython3.2.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/libpython3.1.so.1.0-gdb.py - # but doing so generated noise when ldconfig was rerun - # (see https://bugzilla.redhat.com/show_bug.cgi?id=562980) - # %if %{with gdb_hooks} - DirHoldingGdbPy=%{_prefix}/lib/debug/%{_libdir} + # See comment on $DirHoldingGdbPy above PathOfGdbPy=$DirHoldingGdbPy/$PyInstSoName-%{version}-%{release}.%{_arch}.debug-gdb.py - - mkdir -p %{buildroot}$DirHoldingGdbPy cp Tools/gdb/libpython.py %{buildroot}$PathOfGdbPy %endif # with gdb_hooks 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 +# Install the "debug" build first; anny common files will be overridden with +# later builds %if %{with debug_build} InstallPython debug \ %{py_INSTSONAME_debug} \ @@ -796,7 +799,8 @@ InstallPython debug \ # Now the optimized build: InstallPython optimized \ - %{py_INSTSONAME_optimized} + %{py_INSTSONAME_optimized} \ + "" install -d -m 0755 %{buildroot}%{pylibdir}/site-packages/__pycache__ @@ -833,7 +837,8 @@ rm -f %{buildroot}%{pylibdir}/email/test/data/audiotest.au %{buildroot}%{pylibdi install -d -m 0755 %{buildroot}/%{_prefix}/lib/python%{pybasever}/site-packages/__pycache__ %endif -# Make python3-devel multilib-ready (bug #192747, #139911) +# Make python3-devel multilib-ready +# See https://bugzilla.redhat.com/show_bug.cgi?id=192747 %global _pyconfig32_h pyconfig-32.h %global _pyconfig64_h pyconfig-64.h From f86b3d1707739ef4afebea5b8f9ece9692b29840 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Fri, 1 Sep 2017 17:52:06 +0200 Subject: [PATCH 393/416] Move creation of site-packages/__pycache__ dirs together --- python3.spec | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/python3.spec b/python3.spec index 72c2918..efa2ad1 100644 --- a/python3.spec +++ b/python3.spec @@ -802,7 +802,16 @@ InstallPython optimized \ %{py_INSTSONAME_optimized} \ "" +# Install directories for additional packages install -d -m 0755 %{buildroot}%{pylibdir}/site-packages/__pycache__ +%if "%{_lib}" == "lib64" +# The 64-bit version needs to create "site-packages" in /usr/lib/ (for +# pure-Python modules) as well as in /usr/lib64/ (for packages with extension +# modules). +# Note that rpmlint will complain about hardcoded library path; +# this is intentional. +install -d -m 0755 %{buildroot}%{_prefix}/lib/python%{pybasever}/site-packages/__pycache__ +%endif # add idle3 to menu install -D -m 0644 Lib/idlelib/Icons/idle_16.png %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/idle3.png @@ -833,10 +842,6 @@ cp -ar Tools/demo %{buildroot}%{pylibdir}/Tools/ # Fix for bug #136654 rm -f %{buildroot}%{pylibdir}/email/test/data/audiotest.au %{buildroot}%{pylibdir}/test/audiotest.au -%if "%{_lib}" == "lib64" -install -d -m 0755 %{buildroot}/%{_prefix}/lib/python%{pybasever}/site-packages/__pycache__ -%endif - # Make python3-devel multilib-ready # See https://bugzilla.redhat.com/show_bug.cgi?id=192747 %global _pyconfig32_h pyconfig-32.h From d54a775b46f723aea2f1d2e0ad825e40154cb568 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Fri, 1 Sep 2017 13:35:53 +0200 Subject: [PATCH 394/416] Remove some unneeded old cleanups in %install --- python3.spec | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/python3.spec b/python3.spec index efa2ad1..c656d2c 100644 --- a/python3.spec +++ b/python3.spec @@ -905,14 +905,8 @@ find %{buildroot} -name \*.py \ -perm /u+x,g+x,o+x ! -exec grep -m 1 -q '^#!' {} \; \ -exec chmod a-x {} \; \) \) -# .xpm and .xbm files should not be executable: -find %{buildroot} \ - \( -name \*.xbm -o -name \*.xpm -o -name \*.xpm.1 \) \ - -exec chmod a-x {} \; - # Remove executable flag from files that shouldn't have it: chmod a-x \ - %{buildroot}%{pylibdir}/distutils/tests/Setup.sample \ %{buildroot}%{pylibdir}/Tools/README # Get rid of DOS batch files: @@ -921,24 +915,9 @@ find %{buildroot} -name \*.bat -exec rm {} \; # Get rid of backup files: find %{buildroot}/ -name "*~" -exec rm -f {} \; find . -name "*~" -exec rm -f {} \; -rm -f %{buildroot}%{pylibdir}/LICENSE.txt -# Junk, no point in putting in -test sub-pkg -rm -f %{buildroot}/%{pylibdir}/idlelib/testcode.py* -# Get rid of stray patch file from buildroot: -rm -f %{buildroot}%{pylibdir}/test/test_imp.py.apply-our-changes-to-expected-shebang # from patch 4 - -# Fix end-of-line encodings: -find %{buildroot}/ -name \*.py -exec sed -i 's/\r//' {} \; - -# Fix an encoding: -iconv -f iso8859-1 -t utf-8 %{buildroot}/%{pylibdir}/Demo/rpc/README > README.conv && mv -f README.conv %{buildroot}/%{pylibdir}/Demo/rpc/README - -# Note that -# %{pylibdir}/Demo/distutils/test2to3/setup.py -# is in iso-8859-1 encoding, and that this is deliberate; this is test data -# for the 2to3 tool, and one of the functions of the 2to3 tool is to fixup -# character encodings within python source code +# Get rid of a stray copy of the license: +rm %{buildroot}%{pylibdir}/LICENSE.txt # Do bytecompilation with the newly installed interpreter. # This is similar to the script in macros.pybytecompile @@ -949,8 +928,7 @@ find %{buildroot} -type f -a -name "*.py" -print0 | \ xargs -0 %{buildroot}%{_bindir}/python%{pybasever} -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("%{buildroot}")[2], optimize=opt) for opt in range(3) for f in sys.argv[1:]]' || : # Fixup permissions for shared libraries from non-standard 555 to standard 755: -find %{buildroot} \ - -perm 555 -exec chmod 755 {} \; +find %{buildroot} -perm 555 -exec chmod 755 {} \; # Install macros for rpm: mkdir -p %{buildroot}/%{_rpmconfigdir}/macros.d/ From ec8375ccf7481b6aa95005e225a8be80e3b3ac70 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Fri, 1 Sep 2017 13:43:34 +0200 Subject: [PATCH 395/416] Move packaging checks from %install to %check --- python3.spec | 53 +++++++++++++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/python3.spec b/python3.spec index c656d2c..b165216 100644 --- a/python3.spec +++ b/python3.spec @@ -935,28 +935,6 @@ mkdir -p %{buildroot}/%{_rpmconfigdir}/macros.d/ install -m 644 %{SOURCE3} %{buildroot}/%{_rpmconfigdir}/macros.d/ install -m 644 %{SOURCE9} %{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 \ - | 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 - *.%{SOABI_debug}) - ldd $Module | grep %{py_INSTSONAME_optimized} && - (echo Debug module $Module linked against optimized %{py_INSTSONAME_optimized} ; exit 1) - - ;; - *.%{SOABI_optimized}) - ldd $Module | grep %{py_INSTSONAME_debug} && - (echo Optimized module $Module linked against debug %{py_INSTSONAME_debug} ; exit 1) - ;; - esac -done - # Create "/usr/bin/python3-debug", a symlink to the python3 debug binary, to # avoid the user having to know the precise version and ABI flags. # See e.g. https://bugzilla.redhat.com/show_bug.cgi?id=676748 @@ -1001,6 +979,7 @@ sed \ # Rename the -devel script that differs on different arches to arch specific name mv %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-{,`uname -m`-}config + echo -e '#!/bin/sh\nexec `dirname $0`/python%{LDVERSION_optimized}-`uname -m`-config "$@"' > \ %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-config echo '[ $? -eq 127 ] && echo "Could not find python%{LDVERSION_optimized}-`uname -m`-config. Look around to see available arches." >&2' >> \ @@ -1024,7 +1003,7 @@ ln -s %{_bindir}/python%{pybasever} %{buildroot}%{_libexecdir}/system-python # ====================================================== -# Running the upstream test suite +# Checks for packaging issues # ====================================================== %check @@ -1035,6 +1014,33 @@ find %{buildroot} -type f -a -name "*.py" -print0 | \ PYTHONPATH="%{buildroot}%{_libdir}/python%{pybasever} %{buildroot}%{_libdir}/python%{pybasever}/site-packages" \ xargs -0 %{buildroot}%{_bindir}/python%{pybasever} %{SOURCE8} +# Ensure that the curses module was linked against libncursesw.so, rather than +# libncurses.so +# See https://bugzilla.redhat.com/show_bug.cgi?id=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 + *.%{SOABI_debug}) + ldd $Module | grep %{py_INSTSONAME_optimized} && + (echo Debug module $Module linked against optimized %{py_INSTSONAME_optimized} ; exit 1) + + ;; + *.%{SOABI_optimized}) + ldd $Module | grep %{py_INSTSONAME_debug} && + (echo Optimized module $Module linked against debug %{py_INSTSONAME_debug} ; exit 1) + ;; + esac +done + +# ====================================================== +# Running the upstream test suite +# ====================================================== + # For ppc64 we need a larger stack than default # See https://bugzilla.redhat.com/show_bug.cgi?id=1292462 %ifarch %{power64} @@ -1042,6 +1048,7 @@ find %{buildroot} -type f -a -name "*.py" -print0 | \ ulimit -s 16384 %endif + topdir=$(pwd) CheckPython() { ConfName=$1 From 474cc9f637058b6b4688c53670115d86d5a89431 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Fri, 1 Sep 2017 13:49:50 +0200 Subject: [PATCH 396/416] install: Move renaming -devel scripts to the per-build function --- python3.spec | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/python3.spec b/python3.spec index b165216..e1ffc09 100644 --- a/python3.spec +++ b/python3.spec @@ -765,6 +765,7 @@ InstallPython() { ConfName=$1 PyInstSoName=$2 MoreCFlags=$3 + LDVersion=$4 # Switch to the directory with this configuration's built files ConfDir=build/$ConfName @@ -786,6 +787,14 @@ InstallPython() { cp Tools/gdb/libpython.py %{buildroot}$PathOfGdbPy %endif # with gdb_hooks + # Rename the -devel script that differs on different arches to arch specific name + mv %{buildroot}%{_bindir}/python${LDVersion}-{,`uname -m`-}config + echo -e '#!/bin/sh\nexec `dirname $0`/python'${LDVersion}'-`uname -m`-config "$@"' > \ + %{buildroot}%{_bindir}/python${LDVersion}-config + echo '[ $? -eq 127 ] && echo "Could not find python'${LDVersion}'-`uname -m`-config. Look around to see available arches." >&2' >> \ + %{buildroot}%{_bindir}/python${LDVersion}-config + chmod +x %{buildroot}%{_bindir}/python${LDVersion}-config + echo FINISHED: INSTALL OF PYTHON FOR CONFIGURATION: $ConfName } @@ -794,13 +803,15 @@ InstallPython() { %if %{with debug_build} InstallPython debug \ %{py_INSTSONAME_debug} \ - -O0 + -O0 \ + %{LDVERSION_debug} %endif # with debug_build # Now the optimized build: InstallPython optimized \ %{py_INSTSONAME_optimized} \ - "" + "" \ + %{LDVERSION_optimized} # Install directories for additional packages install -d -m 0755 %{buildroot}%{pylibdir}/site-packages/__pycache__ @@ -977,25 +988,6 @@ sed \ %endif # with systemtap -# Rename the -devel script that differs on different arches to arch specific name -mv %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-{,`uname -m`-}config - -echo -e '#!/bin/sh\nexec `dirname $0`/python%{LDVERSION_optimized}-`uname -m`-config "$@"' > \ - %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-config -echo '[ $? -eq 127 ] && echo "Could not find python%{LDVERSION_optimized}-`uname -m`-config. Look around to see available arches." >&2' >> \ - %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-config - chmod +x %{buildroot}%{_bindir}/python%{LDVERSION_optimized}-config - -%if %{with debug_build} -# Rename the -debug script that differs on different arches to arch specific name -mv %{buildroot}%{_bindir}/python%{LDVERSION_debug}-{,`uname -m`-}config -echo -e '#!/bin/sh\nexec `dirname $0`/python%{LDVERSION_debug}-`uname -m`-config "$@"' > \ - %{buildroot}%{_bindir}/python%{LDVERSION_debug}-config -echo '[ $? -eq 127 ] && echo "Could not find python%{LDVERSION_debug}-`uname -m`-config. Look around to see available arches." >&2' >> \ - %{buildroot}%{_bindir}/python%{LDVERSION_debug}-config - chmod +x %{buildroot}%{_bindir}/python%{LDVERSION_debug}-config -%endif # with debug_build - # System Python: Link the executable to libexec # This is for backwards compatibility only and should be removed in Fedora 29 mkdir -p %{buildroot}%{_libexecdir} From 6c5169565e6bff14f883f19a234fc1b1133b6822 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Fri, 1 Sep 2017 14:01:43 +0200 Subject: [PATCH 397/416] Move multilib support for pyconfig.h to the per-build section --- python3.spec | 70 +++++++++++++++++++++++++--------------------------- 1 file changed, 34 insertions(+), 36 deletions(-) diff --git a/python3.spec b/python3.spec index e1ffc09..0c5eac2 100644 --- a/python3.spec +++ b/python3.spec @@ -759,6 +759,22 @@ DirHoldingGdbPy=%{_prefix}/lib/debug/%{_libdir} mkdir -p %{buildroot}$DirHoldingGdbPy %endif # with gdb_hooks +# Multilib support for pyconfig.h +# 32- and 64-bit versions of pyconfig.h are different. For multilib support +# (making it possible to install 32- and 64-bit versions simultaneously), +# we need to install them under different filenames, and to make the common +# "pyconfig.h" include the right file based on architecture. +# See https://bugzilla.redhat.com/show_bug.cgi?id=192747 +# Filanames are defined here: +%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 + # Use a common function to do an install for all our configurations: InstallPython() { @@ -795,6 +811,21 @@ InstallPython() { %{buildroot}%{_bindir}/python${LDVersion}-config chmod +x %{buildroot}%{_bindir}/python${LDVersion}-config + # Make python3-devel multilib-ready + mv %{buildroot}%{_includedir}/python${LDVersion}/pyconfig.h \ + %{buildroot}%{_includedir}/python${LDVersion}/%{_pyconfig_h} + cat > %{buildroot}%{_includedir}/python${LDVersion}/pyconfig.h << EOF +#include + +#if __WORDSIZE == 32 +#include "%{_pyconfig32_h}" +#elif __WORDSIZE == 64 +#include "%{_pyconfig64_h}" +#else +#error "Unknown word size" +#endif +EOF + echo FINISHED: INSTALL OF PYTHON FOR CONFIGURATION: $ConfName } @@ -853,44 +884,11 @@ cp -ar Tools/demo %{buildroot}%{pylibdir}/Tools/ # Fix for bug #136654 rm -f %{buildroot}%{pylibdir}/email/test/data/audiotest.au %{buildroot}%{pylibdir}/test/audiotest.au -# Make python3-devel multilib-ready -# See https://bugzilla.redhat.com/show_bug.cgi?id=192747 -%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%{LDVERSION_optimized} python%{LDVERSION_debug} - -%else -%global PyIncludeDirs python%{LDVERSION_optimized} -%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 - -#if __WORDSIZE == 32 -#include "%{_pyconfig32_h}" -#elif __WORDSIZE == 64 -#include "%{_pyconfig64_h}" -#else -#error "Unknown word size" -#endif -EOF -done - -# Fix for bug 201434: make sure distutils looks at the right pyconfig.h file +# Make sure distutils looks at the right pyconfig.h file +# See https://bugzilla.redhat.com/show_bug.cgi?id=201434 # 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 (bug 653058) +# when python starts up (see https://bugzilla.redhat.com/show_bug.cgi?id=653058) # # Split this out so it goes directly to the pyconfig-32.h/pyconfig-64.h # variants: From 64593af0dd4edd2343b6631838523735f1d51066 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Fri, 1 Sep 2017 14:17:21 +0200 Subject: [PATCH 398/416] Move systemtap tapfile installation into the per-build function --- python3.spec | 66 ++++++++++++++++++++-------------------------------- 1 file changed, 25 insertions(+), 41 deletions(-) diff --git a/python3.spec b/python3.spec index 0c5eac2..20b10a0 100644 --- a/python3.spec +++ b/python3.spec @@ -149,6 +149,15 @@ License: Python # on files that test invalid syntax. %undefine py_auto_byte_compile +# For multilib support, files that are different between 32- and 64-bit arches +# need different filenames. Use "64" or "32" according to the word size. +%ifarch %{power64} s390x x86_64 ia64 alpha sparc64 aarch64 %{mips64} riscv64 +%global wordsize 64 +%else +%global wordsize 32 +%endif + + # ======================= # Build-time requirements # ======================= @@ -768,12 +777,7 @@ mkdir -p %{buildroot}$DirHoldingGdbPy # Filanames are defined here: %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 _pyconfig_h pyconfig-%{wordsize}.h # Use a common function to do an install for all our configurations: InstallPython() { @@ -782,6 +786,7 @@ InstallPython() { PyInstSoName=$2 MoreCFlags=$3 LDVersion=$4 + Postfix=$5 # Switch to the directory with this configuration's built files ConfDir=build/$ConfName @@ -826,6 +831,16 @@ InstallPython() { #endif EOF + # Systemtap hooks +%if %{with systemtap} + mkdir -p %{buildroot}%{tapsetdir} + sed \ + -e "s|LIBRARY_PATH|%{_libdir}/${PyInstSoName}|" \ + -e 's|"python3"|"python3${Postfix}"|' \ + %{_sourcedir}/libpython.stp \ + > %{buildroot}%{tapsetdir}/libpython%{pybasever}${Postfix}-%{wordsize}.stp +%endif # with systemtap + echo FINISHED: INSTALL OF PYTHON FOR CONFIGURATION: $ConfName } @@ -835,14 +850,16 @@ EOF InstallPython debug \ %{py_INSTSONAME_debug} \ -O0 \ - %{LDVERSION_debug} + %{LDVERSION_debug} \ + -debug %endif # with debug_build # Now the optimized build: InstallPython optimized \ %{py_INSTSONAME_optimized} \ "" \ - %{LDVERSION_optimized} + %{LDVERSION_optimized} \ + "" # Install directories for additional packages install -d -m 0755 %{buildroot}%{pylibdir}/site-packages/__pycache__ @@ -953,39 +970,6 @@ ln -s \ %{buildroot}%{_bindir}/python3-debug %endif -# -# Systemtap hooks: -# -%if %{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}|" \ - %{_sourcedir}/libpython.stp \ - > %{buildroot}%{tapsetdir}/%{libpython_stp_optimized} - -%if %{with debug_build} -# In Python 3, python3 and python3-debug don't point to the same binary, -# so we have to replace "python3" with "python3-debug" to get systemtap -# working with debug build -sed \ - -e "s|LIBRARY_PATH|%{_libdir}/%{py_INSTSONAME_debug}|" \ - -e 's|"python3"|"python3-debug"|' \ - %{_sourcedir}/libpython.stp \ - > %{buildroot}%{tapsetdir}/%{libpython_stp_debug} -%endif # with debug_build - -%endif # with systemtap - # System Python: Link the executable to libexec # This is for backwards compatibility only and should be removed in Fedora 29 mkdir -p %{buildroot}%{_libexecdir} From 39c4234d4870bd7258615fcd718f26f56f045e8b Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Fri, 1 Sep 2017 16:50:59 +0200 Subject: [PATCH 399/416] Remove the %clean section --- python3.spec | 8 -------- 1 file changed, 8 deletions(-) diff --git a/python3.spec b/python3.spec index 20b10a0..7c4a91a 100644 --- a/python3.spec +++ b/python3.spec @@ -1069,14 +1069,6 @@ CheckPython optimized %endif # with tests -# ====================================================== -# Cleaning up -# ====================================================== - -%clean -rm -fr %{buildroot} - - # ====================================================== # Scriptlets # ====================================================== From 4f6b427d2e3994d6709a64376225228d393c0eee Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Mon, 4 Sep 2017 17:33:16 +0200 Subject: [PATCH 400/416] Include audiotest.au again These files were removed because historically they included a short sound clip from Monty Python shows, which might fall under copyright. In 2010 this was replaced upstream by a recording of Guido van Rossum saying something silly in Dutch. So, there's no reason to exclude the file anymore. The bug mentioned in the removed comment is private due to corporate policy from 2004. Sorry for that! The problem itself is discussed at: http://bugs.python.org/issue7755 --- python3.spec | 3 --- 1 file changed, 3 deletions(-) diff --git a/python3.spec b/python3.spec index 7c4a91a..700d819 100644 --- a/python3.spec +++ b/python3.spec @@ -898,9 +898,6 @@ cp -ar Doc/tools %{buildroot}%{pylibdir}/Doc/ # Demo scripts cp -ar Tools/demo %{buildroot}%{pylibdir}/Tools/ -# Fix for bug #136654 -rm -f %{buildroot}%{pylibdir}/email/test/data/audiotest.au %{buildroot}%{pylibdir}/test/audiotest.au - # Make sure distutils looks at the right pyconfig.h file # See https://bugzilla.redhat.com/show_bug.cgi?id=201434 # Similar for sysconfig: sysconfig.get_config_h_filename tries to locate From 4ced9a188ed0a0170a629db7ea5b473a37bbe993 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 5 Sep 2017 11:40:37 +0200 Subject: [PATCH 401/416] Check %{_lib} rather than hardcode all 64-bit arches Checking %{lib} isn't guaranteed to determine the word size correctly, but it works for current arches and is more likely to stay correct when a new arch are added. --- python3.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 700d819..203015b 100644 --- a/python3.spec +++ b/python3.spec @@ -151,7 +151,9 @@ License: Python # For multilib support, files that are different between 32- and 64-bit arches # need different filenames. Use "64" or "32" according to the word size. -%ifarch %{power64} s390x x86_64 ia64 alpha sparc64 aarch64 %{mips64} riscv64 +# Currently, the best way to determine an architecture's word size happens to +# be checking %%{_lib}. +%if "%{_lib}" == "lib64" %global wordsize 64 %else %global wordsize 32 From 7c72174fbd9f244826e707368d8db9b694948a21 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 5 Sep 2017 11:54:06 +0200 Subject: [PATCH 402/416] Snipe a typo --- python3.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 203015b..30d392d 100644 --- a/python3.spec +++ b/python3.spec @@ -846,7 +846,7 @@ EOF echo FINISHED: INSTALL OF PYTHON FOR CONFIGURATION: $ConfName } -# Install the "debug" build first; anny common files will be overridden with +# Install the "debug" build first; any common files will be overridden with # later builds %if %{with debug_build} InstallPython debug \ From 15a5ab169416bf61d9851b1874110ea12623daa9 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 5 Sep 2017 11:54:13 +0200 Subject: [PATCH 403/416] Make the main description also applicable to the SRPM Also, add a comment to highlight its dual purpose --- python3.spec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python3.spec b/python3.spec index 30d392d..f08a7ab 100644 --- a/python3.spec +++ b/python3.spec @@ -438,14 +438,15 @@ Requires: python3-setuptools Requires: python3-pip %endif +# The description used both for the SRPM and the main `python3` subpackage: %description Python is an accessible, high-level, dynamically typed, interpreted programming language, designed with an emphasis on code readibility. It includes an extensive standard library, and has a vast ecosystem of third-party libraries. -This package provides the "python3" executable: the reference interpreter for -the Python language, version 3. +The ${name} package provides the "python3" executable: the reference +interpreter for the Python language, version 3. The majority of its standard library is provided in the %{name}-libs package, which should be installed automatically along with %{name}. The remaining parts of the Python standard library are broken out into the From 7d6b083b8335c56b33afe8d0eb9b3557b5114093 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 5 Sep 2017 17:31:28 +0200 Subject: [PATCH 404/416] Add changelog entry for this round of cleanups --- python3.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index f08a7ab..db8c83a 100644 --- a/python3.spec +++ b/python3.spec @@ -14,7 +14,7 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well Version: %{pybasever}.2 -Release: 15%{?dist} +Release: 16%{?dist} License: Python @@ -1526,6 +1526,11 @@ fi # ====================================================== %changelog +* Tue Sep 05 2017 Petr Viktorin - 3.6.2-16 +- Specfile cleanup +- Make the main description also applicable to the SRPM +- Add audiotest.au to the test package + * Fri Sep 01 2017 Miro Hrončok - 3.6.2-15 - Remove %%{pylibdir}/Tools/scripts/2to3 From 87e35ed7a51d53aa56d224e3b61ae82b16f47dc5 Mon Sep 17 00:00:00 2001 From: Iryna Shcherbina Date: Wed, 6 Sep 2017 14:29:47 +0200 Subject: [PATCH 405/416] Include -g in LDFLAGS sent to the linker (rhbz#1483222) Include -g flag for both compilation and linking so that the debugging information is correctly generated. --- python3.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/python3.spec b/python3.spec index db8c83a..2a465f4 100644 --- a/python3.spec +++ b/python3.spec @@ -14,7 +14,7 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well Version: %{pybasever}.2 -Release: 16%{?dist} +Release: 17%{?dist} License: Python @@ -680,7 +680,7 @@ export CPPFLAGS="$(pkg-config --cflags-only-I libffi)" export OPT="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv" export LINKCC="gcc" export CFLAGS="$CFLAGS $(pkg-config --cflags openssl)" -export LDFLAGS="$RPM_LD_FLAGS $(pkg-config --libs-only-L openssl)" +export LDFLAGS="$RPM_LD_FLAGS -g $(pkg-config --libs-only-L openssl)" # We can build several different configurations of Python: regular and debug. # Define a common function that does one build: @@ -1526,6 +1526,10 @@ fi # ====================================================== %changelog +* Wed Sep 06 2017 Iryna Shcherbina - 3.6.2-17 +- Include `-g` in the flags sent to the linker (LDFLAGS) +Resolves: rhbz#1483222 + * Tue Sep 05 2017 Petr Viktorin - 3.6.2-16 - Specfile cleanup - Make the main description also applicable to the SRPM From 685fb7bc99d90a53a32c37eb29a961a702eb22a0 Mon Sep 17 00:00:00 2001 From: Iryna Shcherbina Date: Thu, 14 Sep 2017 10:26:07 +0200 Subject: [PATCH 406/416] Fix /usr/bin/env dependency from python3-tools (rhbz#1482118) --- python3.spec | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/python3.spec b/python3.spec index 2a465f4..f173971 100644 --- a/python3.spec +++ b/python3.spec @@ -14,7 +14,7 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well Version: %{pybasever}.2 -Release: 17%{?dist} +Release: 18%{?dist} License: Python @@ -914,13 +914,15 @@ sed -i -e "s/'pyconfig.h'/'%{_pyconfig_h}'/" \ %{buildroot}%{pylibdir}/sysconfig.py # Switch all shebangs to refer to the specific Python version. -# This currently only covers files with .py extension +# This currently only covers files matching ^[a-zA-Z0-9_]+\.py$, +# so handle files named using other naming scheme separately. LD_LIBRARY_PATH=./build/optimized ./build/optimized/python \ Tools/scripts/pathfix.py \ -i "%{_bindir}/python%{pybasever}" \ - %{buildroot} + %{buildroot} %{buildroot}%{pylibdir}/Tools/scripts/*-*.py \ + %{buildroot}%{pylibdir}/Tools/pynche/{pynche,pynche.pyw} # not covered, also redundant and useless: -rm %{buildroot}%{pylibdir}/Tools/scripts/2to3 +rm %{buildroot}%{pylibdir}/Tools/scripts/{2to3,idle3,pydoc3,pyvenv} # Remove shebang lines from .py files that aren't executable, and @@ -1526,6 +1528,10 @@ fi # ====================================================== %changelog +* Wed Sep 13 2017 Iryna Shcherbina - 3.6.2-18 +- Fix /usr/bin/env dependency from python3-tools +Resolves: rhbz#1482118 + * Wed Sep 06 2017 Iryna Shcherbina - 3.6.2-17 - Include `-g` in the flags sent to the linker (LDFLAGS) Resolves: rhbz#1483222 From 0652b06063b98a5192d6538a989f9244dbee11df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 19 Sep 2017 12:03:41 +0200 Subject: [PATCH 407/416] Move pathfix.py to bindir See https://github.com/fedora-python/python-rpm-porting/issues/24 --- check-pyc-and-pyo-timestamps.py | 1 + python3.spec | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/check-pyc-and-pyo-timestamps.py b/check-pyc-and-pyo-timestamps.py index aab0cc1..76a3421 100644 --- a/check-pyc-and-pyo-timestamps.py +++ b/check-pyc-and-pyo-timestamps.py @@ -6,6 +6,7 @@ import sys # list of test and other files that we expect not to have bytecode not_compiled = [ + '/usr/bin/pathfix.py', 'test/bad_coding.py', 'test/bad_coding2.py', 'test/badsyntax_3131.py', diff --git a/python3.spec b/python3.spec index f173971..f1ede0c 100644 --- a/python3.spec +++ b/python3.spec @@ -14,7 +14,7 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well Version: %{pybasever}.2 -Release: 18%{?dist} +Release: 19%{?dist} License: Python @@ -925,6 +925,11 @@ LD_LIBRARY_PATH=./build/optimized ./build/optimized/python \ rm %{buildroot}%{pylibdir}/Tools/scripts/{2to3,idle3,pydoc3,pyvenv} +# Move pathfix.py to bindir +# See https://github.com/fedora-python/python-rpm-porting/issues/24 +mv %{buildroot}%{pylibdir}/Tools/scripts/pathfix.py %{buildroot}%{_bindir}/ + + # Remove shebang lines from .py files that aren't executable, and # remove executability from .py files that don't have a shebang line: find %{buildroot} -name \*.py \ @@ -955,6 +960,9 @@ find %{buildroot} -type f -a -name "*.py" -print0 | \ 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], optimize=opt) for opt in range(3) for f in sys.argv[1:]]' || : +# Since we have pathfix.py in bindir, this is created, but we don't want it +rm -rf %{buildroot}%{_bindir}/__pycache__ + # Fixup permissions for shared libraries from non-standard 555 to standard 755: find %{buildroot} -perm 555 -exec chmod 755 {} \; @@ -1342,6 +1350,7 @@ fi %{_bindir}/python%{pybasever}-config %{_bindir}/python%{LDVERSION_optimized}-config %{_bindir}/python%{LDVERSION_optimized}-*-config +%{_bindir}/pathfix.py %{_libdir}/libpython%{LDVERSION_optimized}.so %{_libdir}/pkgconfig/python-%{LDVERSION_optimized}.pc %{_libdir}/pkgconfig/python-%{pybasever}.pc @@ -1528,6 +1537,9 @@ fi # ====================================================== %changelog +* Tue Sep 19 2017 Miro Hrončok - 3.6.2-19 +- Move pathfix.py to bindir, https://github.com/fedora-python/python-rpm-porting/issues/24 + * Wed Sep 13 2017 Iryna Shcherbina - 3.6.2-18 - Fix /usr/bin/env dependency from python3-tools Resolves: rhbz#1482118 From 71718b673e72b2c88c67b8072a69fbd36af988a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 29 Sep 2017 12:30:12 +0200 Subject: [PATCH 408/416] Make the -devel package require redhat-rpm-config 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 Later should be changed to a specific subpackage. --- python3.spec | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index f1ede0c..4c19b74 100644 --- a/python3.spec +++ b/python3.spec @@ -491,6 +491,13 @@ BuildRequires: python-rpm-macros Requires: python-rpm-macros Requires: python3-rpm-macros Requires: python3-rpm-generators + +# 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 + Conflicts: %{name} < %{version}-%{release} %description devel @@ -1537,8 +1544,10 @@ fi # ====================================================== %changelog -* Tue Sep 19 2017 Miro Hrončok - 3.6.2-19 +* Fri Sep 29 2017 Miro Hrončok - 3.6.2-19 - Move pathfix.py to bindir, https://github.com/fedora-python/python-rpm-porting/issues/24 +- Make the -devel package require redhat-rpm-config +Resolves: rhbz#1496757 * Wed Sep 13 2017 Iryna Shcherbina - 3.6.2-18 - Fix /usr/bin/env dependency from python3-tools From 47069ff4171cd7fafa42544033bef8589ad04304 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Fri, 6 Oct 2017 13:30:25 +0200 Subject: [PATCH 409/416] Update to Python 3.6.3 Patches 270, 271, 272 were removed as they have been upstreamed. Patch 277 was added to fix two hanging tests from test_subprocess. Added gdb at the build dependencies, since gdb is not anymore in the buildroot, and that made test_gdb to be skipped. --- 00277-fix-test-subprocess-hanging-tests.patch | 43 +++++++++++++++++++ python3.spec | 39 +++++++---------- sources | 2 +- 3 files changed, 59 insertions(+), 25 deletions(-) create mode 100644 00277-fix-test-subprocess-hanging-tests.patch diff --git a/00277-fix-test-subprocess-hanging-tests.patch b/00277-fix-test-subprocess-hanging-tests.patch new file mode 100644 index 0000000..c9b54e2 --- /dev/null +++ b/00277-fix-test-subprocess-hanging-tests.patch @@ -0,0 +1,43 @@ +From 54849962eacc38f4e6c6f8a72ae258b3e7c2ecd5 Mon Sep 17 00:00:00 2001 +From: Victor Stinner +Date: Thu, 5 Oct 2017 15:05:30 +0200 +Subject: [PATCH] bpo-31178: Mock os.waitpid() in test_subprocess + +Fix test_exception_errpipe_bad_data() and +test_exception_errpipe_normal() of test_subprocess: mock os.waitpid() +to avoid calling the real os.waitpid(0, 0) which is an unexpected +side effect of the test. +--- + Lib/test/test_subprocess.py | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py +index 00dc37bc2c7..3ba5c028517 100644 +--- a/Lib/test/test_subprocess.py ++++ b/Lib/test/test_subprocess.py +@@ -1559,8 +1559,10 @@ def proper_error(*args): + + fork_exec.side_effect = proper_error + +- with self.assertRaises(IsADirectoryError): +- self.PopenNoDestructor(["non_existent_command"]) ++ with mock.patch("subprocess.os.waitpid", ++ side_effect=ChildProcessError): ++ with self.assertRaises(IsADirectoryError): ++ self.PopenNoDestructor(["non_existent_command"]) + + @mock.patch("subprocess._posixsubprocess.fork_exec") + def test_exception_errpipe_bad_data(self, fork_exec): +@@ -1577,8 +1579,10 @@ def bad_error(*args): + + fork_exec.side_effect = bad_error + +- with self.assertRaises(subprocess.SubprocessError) as e: +- self.PopenNoDestructor(["non_existent_command"]) ++ with mock.patch("subprocess.os.waitpid", ++ side_effect=ChildProcessError): ++ with self.assertRaises(subprocess.SubprocessError) as e: ++ self.PopenNoDestructor(["non_existent_command"]) + + self.assertIn(repr(error_data), str(e.exception)) + diff --git a/python3.spec b/python3.spec index 4c19b74..492fbad 100644 --- a/python3.spec +++ b/python3.spec @@ -13,8 +13,8 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well -Version: %{pybasever}.2 -Release: 19%{?dist} +Version: %{pybasever}.3 +Release: 1%{?dist} License: Python @@ -190,6 +190,7 @@ BuildRequires: openssl-devel BuildRequires: pkgconfig BuildRequires: readline-devel BuildRequires: sqlite-devel +BuildRequires: gdb %if %{with systemtap} BuildRequires: systemtap-devel @@ -367,25 +368,6 @@ Patch262: 00262-pep538_coerce_legacy_c_locale.patch # Reported upstream: http://bugs.python.org/issue29804 Patch264: 00264-skip-test-failing-on-aarch64.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 - -# 00271 # -# Make test_asyncio to not depend on the current signal handler -# as this can make it hang on koji, since it ignores SIGHUP. -# Reported upstream: http://bugs.python.org/issue31034 -Patch271: 00271-asyncio-get-default-signal-handler.patch - -# 00272 # -# Reject newline characters in ftplib.FTP.putline() arguments to -# avoid FTP protocol stream injection via malicious URLs. -# See https://bugzilla.redhat.com/show_bug.cgi?id=1478916 -# Fixed upstream: http://bugs.python.org/issue30119 -Patch272: 00272-fix-ftplib-to-reject-newlines.patch - # 00273 # # Skip test_float_with_comma, which fails in Koji with UnicodeDecodeError # See https://bugzilla.redhat.com/show_bug.cgi?id=1484497 @@ -395,6 +377,14 @@ Patch273: 00273-skip-float-test.patch # Upstream uses Debian-style architecture naming. Change to match Fedora. Patch274: 00274-fix-arch-names.patch +# 00277 # +# Fix test_exception_errpipe_bad_data() and +# test_exception_errpipe_normal() of test_subprocess: mock os.waitpid() +# to avoid calling the real os.waitpid(0, 0) which is an unexpected +# side effect of the test, which makes the koji builds hang. +# Fixed upstream: https://github.com/python/cpython/commit/11045c9d8a21dd9bd182a3939189db02815f9783 +Patch277: 00277-fix-test-subprocess-hanging-tests.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -641,11 +631,9 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch264 -p1 %endif -%patch270 -p1 -%patch271 -p1 -%patch272 -p1 %patch273 -p1 %patch274 -p1 +%patch277 -p1 # Remove files that should be generated by the build @@ -1544,6 +1532,9 @@ fi # ====================================================== %changelog +* Fri Oct 06 2017 Charalampos Stratakis - 3.6.3-1 +- Update to Python 3.6.3 + * Fri Sep 29 2017 Miro Hrončok - 3.6.2-19 - Move pathfix.py to bindir, https://github.com/fedora-python/python-rpm-porting/issues/24 - Make the -devel package require redhat-rpm-config diff --git a/sources b/sources index af1a1e7..002f1fb 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Python-3.6.2.tar.xz) = a8270a09a9e9b39f69ece6cdade2fa964665d2107b5acbad4453f1b921107b329c697c137185928fb4a576fc0f2ae2a98dbf26a8b7ea17219e990ddbc216db8b +SHA512 (Python-3.6.3.tar.xz) = 32f24a3adcb7880003c7ecdc5e53e838e774adda76b308961d8215e28db630b2fa2828097817924c76afa4212b2df3362eb64d4e10f37c0147f512ec5aa8662b From 22b8f2b10b5b7e2631c6ed98e2d63adbb6405d12 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Mon, 9 Oct 2017 13:10:17 +0200 Subject: [PATCH 410/416] Fix memory corruption due to allocator mix (rhbz#1498207) --- ...fix-memory-corruption-due-to-allocator-mix.patch | 13 +++++++++++++ python3.spec | 11 ++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 00279-fix-memory-corruption-due-to-allocator-mix.patch diff --git a/00279-fix-memory-corruption-due-to-allocator-mix.patch b/00279-fix-memory-corruption-due-to-allocator-mix.patch new file mode 100644 index 0000000..4937391 --- /dev/null +++ b/00279-fix-memory-corruption-due-to-allocator-mix.patch @@ -0,0 +1,13 @@ +diff --git a/Modules/getpath.c b/Modules/getpath.c +index c4055be..1258fcd 100644 +--- a/Modules/getpath.c ++++ b/Modules/getpath.c +@@ -735,7 +735,7 @@ calculate_path(void) + bufsz += wcslen(zip_path) + 1; + bufsz += wcslen(exec_prefix) + 1; + +- buf = PyMem_New(wchar_t, bufsz); ++ buf = PyMem_RawMalloc(bufsz * sizeof(wchar_t)); + if (buf == NULL) { + Py_FatalError( + "Not enough memory for dynamic PYTHONPATH"); diff --git a/python3.spec b/python3.spec index 492fbad..53def0a 100644 --- a/python3.spec +++ b/python3.spec @@ -14,7 +14,7 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well Version: %{pybasever}.3 -Release: 1%{?dist} +Release: 2%{?dist} License: Python @@ -385,6 +385,11 @@ Patch274: 00274-fix-arch-names.patch # Fixed upstream: https://github.com/python/cpython/commit/11045c9d8a21dd9bd182a3939189db02815f9783 Patch277: 00277-fix-test-subprocess-hanging-tests.patch +# 00279 # +# Fix memory corruption due to allocator mix +# Fixed upstream: https://bugs.python.org/issue31532 +Patch279: 00279-fix-memory-corruption-due-to-allocator-mix.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -1532,6 +1537,10 @@ fi # ====================================================== %changelog +* Mon Oct 09 2017 Charalampos Stratakis - 3.6.3-2 +- Fix memory corruption due to allocator mix +Resolves: rhbz#1498207 + * Fri Oct 06 2017 Charalampos Stratakis - 3.6.3-1 - Update to Python 3.6.3 From a8c86d3aed83a5aadd8af7e7f45a93678a288a75 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Mon, 9 Oct 2017 13:21:53 +0200 Subject: [PATCH 411/416] Apply the patch 279 correctly. --- python3.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/python3.spec b/python3.spec index 53def0a..55aeac4 100644 --- a/python3.spec +++ b/python3.spec @@ -639,6 +639,7 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch273 -p1 %patch274 -p1 %patch277 -p1 +%patch279 -p1 # Remove files that should be generated by the build From e522c84bc535b0c34ede8361d245205842f80dca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 15 Nov 2017 16:05:21 +0100 Subject: [PATCH 412/416] Obsolete platform-python and it's subpackages --- python3.spec | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/python3.spec b/python3.spec index 55aeac4..78c250f 100644 --- a/python3.spec +++ b/python3.spec @@ -14,7 +14,7 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well Version: %{pybasever}.3 -Release: 2%{?dist} +Release: 3%{?dist} License: Python @@ -428,6 +428,10 @@ Provides: python%{pyshortver} = %{version}-%{release} # replace python36-3.6.2. Obsoletes: python%{pyshortver} +# Shall be removed in Fedora 31 +%global platpyver 3.6.2-13 +Obsoletes: platform-python < %{platpyver} + %if %{with rewheel} Requires: python3-setuptools Requires: python3-pip @@ -471,6 +475,10 @@ Provides: system-python-libs = %{version}-%{release} Provides: system-python-libs%{?_isa} = %{version}-%{release} Obsoletes: system-python-libs < %{version}-%{release} +# Shall be removed in Fedora 31 +Obsoletes: platform-python-libs < %{platpyver} +Obsoletes: platform-python-libs-devel < %{platpyver} + %description libs This package contains runtime libraries for use by Python: - the majority of the Python standard library @@ -495,6 +503,9 @@ Requires: redhat-rpm-config Conflicts: %{name} < %{version}-%{release} +# Shall be removed in Fedora 31 +Obsoletes: platform-python-devel < %{platpyver} + %description devel This package contains the header files and configuration needed to compile Python extension modules (typically written in C or C++), to embed Python @@ -519,6 +530,9 @@ Provides: idle3 = %{version}-%{release} Conflicts: python2-tools < 2.7.13-17 Conflicts: python-tools < 2.7.13-17 +# Shall be removed in Fedora 31 +Obsoletes: platform-python-tools < %{platpyver} + %description tools This package contains several tools included with Python, including: - 2to3, an automatic source converter from Python 2.X @@ -529,6 +543,9 @@ This package contains several tools included with Python, including: Summary: A GUI toolkit for Python Requires: %{name} = %{version}-%{release} +# Shall be removed in Fedora 31 +Obsoletes: platform-python-tkinter < %{platpyver} + %description tkinter The Tkinter (Tk interface) library is a graphical user interface toolkit for the Python programming language. @@ -539,6 +556,8 @@ Summary: The self-test suite for the main python3 package Requires: %{name} = %{version}-%{release} Requires: %{name}-tools = %{version}-%{release} +# Shall be removed in Fedora 31 +Obsoletes: platform-python-test < %{platpyver} %description test The self-test suite for the Python interpreter. @@ -1538,6 +1557,9 @@ fi # ====================================================== %changelog +* Wed Nov 15 2017 Miro Hrončok - 3.6.3-3 +- Obsolete platform-python and it's subpackages + * Mon Oct 09 2017 Charalampos Stratakis - 3.6.3-2 - Fix memory corruption due to allocator mix Resolves: rhbz#1498207 From 1f528dac57b2a9a9a1635fdb76c9c86473f1a936 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 21 Nov 2017 11:04:48 +0100 Subject: [PATCH 413/416] Raise the release of platform-python obsoletes for better maintainability --- python3.spec | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/python3.spec b/python3.spec index 78c250f..9b8f122 100644 --- a/python3.spec +++ b/python3.spec @@ -14,7 +14,7 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well Version: %{pybasever}.3 -Release: 3%{?dist} +Release: 4%{?dist} License: Python @@ -429,7 +429,10 @@ Provides: python%{pyshortver} = %{version}-%{release} Obsoletes: python%{pyshortver} # Shall be removed in Fedora 31 -%global platpyver 3.6.2-13 +# The release is bumped to 20, so we can do f27 platform-python updates +# If the release in f27 ever goes >= 20, raise it here +# If platform-python is ever reintroduced, make it higher version than this: +%global platpyver 3.6.2-20 Obsoletes: platform-python < %{platpyver} %if %{with rewheel} @@ -1557,6 +1560,9 @@ fi # ====================================================== %changelog +* Tue Nov 21 2017 Miro Hrončok - 3.6.3-4 +- Raise the release of platform-python obsoletes for better maintainability + * Wed Nov 15 2017 Miro Hrončok - 3.6.3-3 - Obsolete platform-python and it's subpackages From d668c1e89cecad767da9798403b1f86892576a95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 28 Nov 2017 13:47:21 +0100 Subject: [PATCH 414/416] Python 3.7 (fedpkg prep ok, builds ok without debug) --- 00102-lib64.patch | 41 +- 00111-no-static-lib.patch | 25 +- 00170-gc-assertions.patch | 42 +- 00189-add-rewheel-module.patch | 30 +- 00262-pep538_coerce_legacy_c_locale.patch | 1090 ----------------- 00277-fix-test-subprocess-hanging-tests.patch | 43 - ...mory-corruption-due-to-allocator-mix.patch | 13 - ...ybytecompile3.6 => macros.pybytecompile3.7 | 0 python3.spec | 45 +- 9 files changed, 85 insertions(+), 1244 deletions(-) delete mode 100644 00262-pep538_coerce_legacy_c_locale.patch delete mode 100644 00277-fix-test-subprocess-hanging-tests.patch delete mode 100644 00279-fix-memory-corruption-due-to-allocator-mix.patch rename macros.pybytecompile3.6 => macros.pybytecompile3.7 (100%) diff --git a/00102-lib64.patch b/00102-lib64.patch index 8eea66d..61f9b52 100644 --- a/00102-lib64.patch +++ b/00102-lib64.patch @@ -1,5 +1,5 @@ diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py -index 9474e9c..c0ce4c6 100644 +index 0258d3d..4b969bf 100644 --- a/Lib/distutils/command/install.py +++ b/Lib/distutils/command/install.py @@ -30,14 +30,14 @@ WINDOWS_SCHEME = { @@ -20,10 +20,10 @@ index 9474e9c..c0ce4c6 100644 'scripts': '$base/bin', 'data' : '$base', diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py -index 026cca7..6d3e077 100644 +index e07a6c8..554740d 100644 --- a/Lib/distutils/sysconfig.py +++ b/Lib/distutils/sysconfig.py -@@ -132,8 +132,12 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None): +@@ -129,8 +129,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": @@ -37,10 +37,11 @@ index 026cca7..6d3e077 100644 if standard_lib: return libpython else: -diff a/Lib/distutils/tests/test_install.py b/Lib/distutils/tests/test_install.py +diff --git a/Lib/distutils/tests/test_install.py b/Lib/distutils/tests/test_install.py +index 287ab19..d4c05e0 100644 --- a/Lib/distutils/tests/test_install.py +++ b/Lib/distutils/tests/test_install.py -@@ -57,8 +57,9 @@ +@@ -57,8 +57,9 @@ class InstallTestCase(support.TempdirManager, self.assertEqual(got, expected) libdir = os.path.join(destination, "lib", "python") @@ -52,10 +53,10 @@ diff a/Lib/distutils/tests/test_install.py b/Lib/distutils/tests/test_install.py check_path(cmd.install_headers, os.path.join(destination, "include", "python", "foopkg")) diff --git a/Lib/site.py b/Lib/site.py -index a84e3bb..ba0d3ea 100644 +index 7dc1b04..85016b4 100644 --- a/Lib/site.py +++ b/Lib/site.py -@@ -303,11 +303,15 @@ def getsitepackages(prefixes=None): +@@ -334,11 +334,15 @@ def getsitepackages(prefixes=None): seen.add(prefix) if os.sep == '/': @@ -69,10 +70,10 @@ index a84e3bb..ba0d3ea 100644 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 + # for framework builds *only* we add the standard Apple locations. + if sys.platform == "darwin" and sys._framework: diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py -index b9bbfe5..2a5f29c 100644 +index 9ee4d31..53c8606 100644 --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py @@ -20,10 +20,10 @@ __all__ = [ @@ -89,7 +90,7 @@ index b9bbfe5..2a5f29c 100644 'include': '{installed_base}/include/python{py_version_short}{abiflags}', 'platinclude': -@@ -61,10 +61,10 @@ _INSTALL_SCHEMES = { +@@ -62,10 +62,10 @@ _INSTALL_SCHEMES = { 'data': '{userbase}', }, 'posix_user': { @@ -104,10 +105,10 @@ index b9bbfe5..2a5f29c 100644 'scripts': '{userbase}/bin', 'data': '{userbase}', diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py -index f698927..bc977b5 100644 +index 99e7b4f..c4c98a6 100644 --- a/Lib/test/test_site.py +++ b/Lib/test/test_site.py -@@ -248,8 +248,8 @@ class HelperFunctionsTests(unittest.TestCase): +@@ -275,8 +275,8 @@ class HelperFunctionsTests(unittest.TestCase): self.assertEqual(dirs[1], wanted) elif os.sep == '/': # OS X non-framwework builds, Linux, FreeBSD, etc @@ -119,10 +120,10 @@ index f698927..bc977b5 100644 'site-packages') self.assertEqual(dirs[0], wanted) diff --git a/Makefile.pre.in b/Makefile.pre.in -index 8fa7934..a693917 100644 +index e8df8f7..a5a9d5e 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -126,7 +126,7 @@ LIBDIR= @libdir@ +@@ -133,7 +133,7 @@ LIBDIR= @libdir@ MANDIR= @mandir@ INCLUDEDIR= @includedir@ CONFINCLUDEDIR= $(exec_prefix)/include @@ -132,7 +133,7 @@ index 8fa7934..a693917 100644 # Detailed destination directories diff --git a/Modules/getpath.c b/Modules/getpath.c -index 65b47a3..eaa756c 100644 +index dd3387a..1258fcd 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -494,7 +494,7 @@ calculate_path(void) @@ -163,10 +164,10 @@ index 65b47a3..eaa756c 100644 /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */ diff --git a/setup.py b/setup.py -index 0f2dfc4..da37896 100644 +index 11c4ec6..c3e5512 100644 --- a/setup.py +++ b/setup.py -@@ -492,7 +492,7 @@ class PyBuildExt(build_ext): +@@ -513,7 +513,7 @@ class PyBuildExt(build_ext): # directories (i.e. '.' and 'Include') must be first. See issue # 10520. if not cross_compiling: @@ -175,7 +176,7 @@ index 0f2dfc4..da37896 100644 add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') # only change this for cross builds for 3.3, issues on Mageia if cross_compiling: -@@ -780,11 +780,11 @@ class PyBuildExt(build_ext): +@@ -809,11 +809,11 @@ class PyBuildExt(build_ext): elif curses_library: readline_libs.append(curses_library) elif self.compiler.find_library_file(lib_dirs + @@ -189,7 +190,7 @@ index 0f2dfc4..da37896 100644 extra_link_args=readline_extra_link_args, libraries=readline_libs) ) else: -@@ -821,8 +821,8 @@ class PyBuildExt(build_ext): +@@ -850,8 +850,8 @@ class PyBuildExt(build_ext): if krb5_h: ssl_incs += krb5_h ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, diff --git a/00111-no-static-lib.patch b/00111-no-static-lib.patch index 6929fda..50cc13a 100644 --- a/00111-no-static-lib.patch +++ b/00111-no-static-lib.patch @@ -1,9 +1,9 @@ diff --git a/Makefile.pre.in b/Makefile.pre.in -index 70e5927..04c8e3d 100644 +index a5a9d5e..51e8132 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -556,7 +556,7 @@ clinic: $(BUILDPYTHON) $(srcdir)/Modules/_blake2/blake2s_impl.c - $(RUNSHARED) $(PYTHON_FOR_BUILD) ./Tools/clinic/clinic.py --make +@@ -530,7 +530,7 @@ clinic: $(BUILDPYTHON) $(srcdir)/Modules/_blake2/blake2s_impl.c + $(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/Tools/clinic/clinic.py --make --srcdir $(srcdir) # Build the interpreter -$(BUILDPYTHON): Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) @@ -11,26 +11,20 @@ index 70e5927..04c8e3d 100644 $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) platform: $(BUILDPYTHON) pybuilddir.txt -@@ -601,18 +601,6 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o +@@ -574,12 +574,6 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o + _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build - +- -# 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) Python/frozen.o -- $(AR) $(ARFLAGS) $@ $(MODULE_OBJS) -- $(AR) $(ARFLAGS) $@ $(MODOBJS) -- $(RANLIB) $@ +- $(AR) $(ARFLAGS) $@ $(LIBRARY_OBJS) - libpython$(LDVERSION).so: $(LIBRARY_OBJS) if test $(INSTSONAME) != $(LDLIBRARY); then \ $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ -@@ -702,7 +690,7 @@ Modules/Setup: $(srcdir)/Modules/Setup.dist +@@ -667,7 +661,7 @@ Modules/Setup: $(srcdir)/Modules/Setup.dist echo "-----------------------------------------------"; \ fi @@ -39,7 +33,7 @@ index 70e5927..04c8e3d 100644 $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) ############################################################################ -@@ -1382,18 +1370,6 @@ libainstall: all python-config +@@ -1408,17 +1402,6 @@ libainstall: @DEF_MAKE_RULE@ python-config else true; \ fi; \ done @@ -49,7 +43,6 @@ index 70e5927..04c8e3d 100644 - $(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; \ diff --git a/00170-gc-assertions.patch b/00170-gc-assertions.patch index f491733..1f71939 100644 --- a/00170-gc-assertions.patch +++ b/00170-gc-assertions.patch @@ -1,8 +1,8 @@ diff --git a/Include/object.h b/Include/object.h -index 0c88603..e3413e8 100644 +index cb57359..f928f97 100644 --- a/Include/object.h +++ b/Include/object.h -@@ -1059,6 +1059,49 @@ PyAPI_FUNC(void) +@@ -1069,6 +1069,49 @@ PyAPI_FUNC(void) _PyObject_DebugTypeStats(FILE *out); #endif /* ifndef Py_LIMITED_API */ @@ -53,7 +53,7 @@ index 0c88603..e3413e8 100644 } #endif diff --git a/Lib/test/test_gc.py b/Lib/test/test_gc.py -index e727499..6efcafb 100644 +index 904fc7d..5676007 100644 --- a/Lib/test/test_gc.py +++ b/Lib/test/test_gc.py @@ -1,10 +1,11 @@ @@ -69,7 +69,7 @@ index e727499..6efcafb 100644 import time import gc import weakref -@@ -50,6 +51,8 @@ class GC_Detector(object): +@@ -46,6 +47,8 @@ class GC_Detector(object): # gc collects it. self.wr = weakref.ref(C1055820(666), it_happened) @@ -78,7 +78,7 @@ index e727499..6efcafb 100644 @with_tp_del class Uncollectable(object): """Create a reference cycle with multiple __del__ methods. -@@ -862,6 +865,50 @@ class GCCallbackTests(unittest.TestCase): +@@ -863,6 +866,50 @@ class GCCallbackTests(unittest.TestCase): self.assertEqual(len(gc.garbage), 0) @@ -130,10 +130,10 @@ index e727499..6efcafb 100644 def setUp(self): gc.enable() diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c -index 0c6f444..87edd5a 100644 +index 6e26c7a..8410206 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c -@@ -341,7 +341,8 @@ update_refs(PyGC_Head *containers) +@@ -238,7 +238,8 @@ update_refs(PyGC_Head *containers) { PyGC_Head *gc = containers->gc.gc_next; for (; gc != containers; gc = gc->gc.gc_next) { @@ -143,7 +143,7 @@ index 0c6f444..87edd5a 100644 _PyGCHead_SET_REFS(gc, 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 -@@ -361,7 +362,8 @@ update_refs(PyGC_Head *containers) +@@ -258,7 +259,8 @@ update_refs(PyGC_Head *containers) * so serious that maybe this should be a release-build * check instead of an assert? */ @@ -153,7 +153,7 @@ index 0c6f444..87edd5a 100644 } } -@@ -376,7 +378,9 @@ visit_decref(PyObject *op, void *data) +@@ -273,7 +275,9 @@ visit_decref(PyObject *op, void *data) * generation being collected, which can be recognized * because only they have positive gc_refs. */ @@ -164,7 +164,7 @@ index 0c6f444..87edd5a 100644 if (_PyGCHead_REFS(gc) > 0) _PyGCHead_DECREF(gc); } -@@ -436,9 +440,10 @@ visit_reachable(PyObject *op, PyGC_Head *reachable) +@@ -333,9 +337,10 @@ visit_reachable(PyObject *op, PyGC_Head *reachable) * If gc_refs == GC_UNTRACKED, it must be ignored. */ else { @@ -178,7 +178,7 @@ index 0c6f444..87edd5a 100644 } } return 0; -@@ -480,7 +485,7 @@ move_unreachable(PyGC_Head *young, PyGC_Head *unreachable) +@@ -377,7 +382,7 @@ move_unreachable(PyGC_Head *young, PyGC_Head *unreachable) */ PyObject *op = FROM_GC(gc); traverseproc traverse = Py_TYPE(op)->tp_traverse; @@ -187,7 +187,7 @@ index 0c6f444..87edd5a 100644 _PyGCHead_SET_REFS(gc, GC_REACHABLE); (void) traverse(op, (visitproc)visit_reachable, -@@ -543,7 +548,7 @@ move_legacy_finalizers(PyGC_Head *unreachable, PyGC_Head *finalizers) +@@ -440,7 +445,7 @@ move_legacy_finalizers(PyGC_Head *unreachable, PyGC_Head *finalizers) for (gc = unreachable->gc.gc_next; gc != unreachable; gc = next) { PyObject *op = FROM_GC(gc); @@ -196,7 +196,7 @@ index 0c6f444..87edd5a 100644 next = gc->gc.gc_next; if (has_legacy_finalizer(op)) { -@@ -619,7 +624,7 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) +@@ -516,7 +521,7 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) PyWeakReference **wrlist; op = FROM_GC(gc); @@ -205,7 +205,7 @@ index 0c6f444..87edd5a 100644 next = gc->gc.gc_next; if (! PyType_SUPPORTS_WEAKREFS(Py_TYPE(op))) -@@ -640,9 +645,9 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) +@@ -537,9 +542,9 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) * the callback pointer intact. Obscure: it also * changes *wrlist. */ @@ -217,7 +217,7 @@ index 0c6f444..87edd5a 100644 if (wr->wr_callback == NULL) continue; /* no callback */ -@@ -676,7 +681,7 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) +@@ -573,7 +578,7 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) */ if (IS_TENTATIVELY_UNREACHABLE(wr)) continue; @@ -226,7 +226,7 @@ index 0c6f444..87edd5a 100644 /* Create a new reference so that wr can't go away * before we can process it again. -@@ -685,7 +690,8 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) +@@ -582,7 +587,8 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) /* Move wr to wrcb_to_call, for the next pass. */ wrasgc = AS_GC(wr); @@ -236,7 +236,7 @@ index 0c6f444..87edd5a 100644 next isn't, so they can't be the same */ gc_list_move(wrasgc, &wrcb_to_call); -@@ -701,11 +707,11 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) +@@ -598,11 +604,11 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) gc = wrcb_to_call.gc.gc_next; op = FROM_GC(gc); @@ -251,7 +251,7 @@ index 0c6f444..87edd5a 100644 /* copy-paste of weakrefobject.c's handle_callback() */ temp = PyObject_CallFunctionObjArgs(callback, wr, NULL); -@@ -822,12 +828,14 @@ check_garbage(PyGC_Head *collectable) +@@ -719,12 +725,14 @@ check_garbage(PyGC_Head *collectable) for (gc = collectable->gc.gc_next; gc != collectable; gc = gc->gc.gc_next) { _PyGCHead_SET_REFS(gc, Py_REFCNT(FROM_GC(gc))); @@ -269,11 +269,11 @@ index 0c6f444..87edd5a 100644 return -1; } diff --git a/Objects/object.c b/Objects/object.c -index 559794f..a47d47f 100644 +index ed8a62a..5279b15 100644 --- a/Objects/object.c +++ b/Objects/object.c -@@ -2022,6 +2022,35 @@ _PyTrash_thread_destroy_chain(void) - } +@@ -2116,6 +2116,35 @@ _PyTrash_thread_destroy_chain(void) + --tstate->trash_delete_nesting; } +PyAPI_FUNC(void) diff --git a/00189-add-rewheel-module.patch b/00189-add-rewheel-module.patch index 53a26ca..bae64d4 100644 --- a/00189-add-rewheel-module.patch +++ b/00189-add-rewheel-module.patch @@ -1,6 +1,7 @@ -diff -Nur Python-3.4.1/Lib/ensurepip/__init__.py Python-3.4.1-rewheel/Lib/ensurepip/__init__.py ---- Python-3.4.1/Lib/ensurepip/__init__.py 2014-08-21 10:49:30.792695824 +0200 -+++ Python-3.4.1-rewheel/Lib/ensurepip/__init__.py 2014-08-21 10:10:41.958341726 +0200 +diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py +index d69e09f..5cb12df 100644 +--- a/Lib/ensurepip/__init__.py ++++ b/Lib/ensurepip/__init__.py @@ -1,8 +1,10 @@ import os import os.path @@ -12,16 +13,16 @@ diff -Nur Python-3.4.1/Lib/ensurepip/__init__.py Python-3.4.1-rewheel/Lib/ensure __all__ = ["version", "bootstrap"] -@@ -38,6 +40,8 @@ +@@ -25,6 +27,8 @@ def _run_pip(args, additional_paths=None): # Install the bundled software import pip + if args[0] in ["install", "list", "wheel"]: + args.append('--pre') - pip.main(args) + return pip.main(args) -@@ -87,20 +91,39 @@ +@@ -88,20 +92,39 @@ def _bootstrap(*, root=None, upgrade=False, user=False, # omit pip and easy_install os.environ["ENSUREPIP_OPTIONS"] = "install" @@ -71,9 +72,11 @@ diff -Nur Python-3.4.1/Lib/ensurepip/__init__.py Python-3.4.1-rewheel/Lib/ensure # Construct the arguments to be passed to the pip command args = ["install", "--no-index", "--find-links", tmpdir] -diff -Nur Python-3.4.1/Lib/ensurepip/rewheel/__init__.py Python-3.4.1-rewheel/Lib/ensurepip/rewheel/__init__.py ---- Python-3.4.1/Lib/ensurepip/rewheel/__init__.py 1970-01-01 01:00:00.000000000 +0100 -+++ Python-3.4.1-rewheel/Lib/ensurepip/rewheel/__init__.py 2014-08-21 10:11:22.560320121 +0200 +diff --git a/Lib/ensurepip/rewheel/__init__.py b/Lib/ensurepip/rewheel/__init__.py +new file mode 100644 +index 0000000..753c764 +--- /dev/null ++++ b/Lib/ensurepip/rewheel/__init__.py @@ -0,0 +1,143 @@ +import argparse +import codecs @@ -218,10 +221,11 @@ diff -Nur Python-3.4.1/Lib/ensurepip/rewheel/__init__.py Python-3.4.1-rewheel/Li + else: + pass # bad RECORD or empty line + return to_write, to_omit -diff -Nur Python-3.4.1/Makefile.pre.in Python-3.4.1-rewheel/Makefile.pre.in ---- Python-3.4.1/Makefile.pre.in 2014-08-21 10:49:31.512695040 +0200 -+++ Python-3.4.1-rewheel/Makefile.pre.in 2014-08-21 10:10:41.961341722 +0200 -@@ -1145,7 +1145,7 @@ +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 51e8132..42b3d29 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1241,7 +1241,7 @@ LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \ test/test_asyncio \ collections concurrent concurrent/futures encodings \ email email/mime test/test_email test/test_email/data \ diff --git a/00262-pep538_coerce_legacy_c_locale.patch b/00262-pep538_coerce_legacy_c_locale.patch deleted file mode 100644 index d749bac..0000000 --- a/00262-pep538_coerce_legacy_c_locale.patch +++ /dev/null @@ -1,1090 +0,0 @@ -diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst -index 195f63f..8ecd70f 100644 ---- a/Doc/using/cmdline.rst -+++ b/Doc/using/cmdline.rst -@@ -713,6 +713,45 @@ conflict. - - .. versionadded:: 3.6 - -+ -+.. envvar:: PYTHONCOERCECLOCALE -+ -+ If set to the value ``0``, causes the main Python command line application -+ to skip coercing the legacy ASCII-based C locale to a more capable UTF-8 -+ based alternative. Note that this setting is checked even when the -+ :option:`-E` or :option:`-I` options are used, as it is handled prior to -+ the processing of command line options. -+ -+ If this variable is *not* set, or is set to a value other than ``0``, and -+ the current locale reported for the ``LC_CTYPE`` category is the default -+ ``C`` locale, then the Python CLI will attempt to configure one of the -+ following locales for the given locale categories before loading the -+ interpreter runtime: -+ -+ * ``C.UTF-8`` (``LC_ALL``) -+ * ``C.utf8`` (``LC_ALL``) -+ * ``UTF-8`` (``LC_CTYPE``) -+ -+ If setting one of these locale categories succeeds, then the matching -+ environment variables will be set (both ``LC_ALL`` and ``LANG`` for the -+ ``LC_ALL`` category, and ``LC_CTYPE`` for the ``LC_CTYPE`` category) in -+ the current process environment before the Python runtime is initialized. -+ -+ Configuring one of these locales (either explicitly or via the above -+ implicit locale coercion) will automatically set the error handler for -+ :data:`sys.stdin` and :data:`sys.stdout` to ``surrogateescape``. This -+ behavior can be overridden using :envvar:`PYTHONIOENCODING` as usual. -+ -+ For debugging purposes, setting ``PYTHONCOERCECLOCALE=warn`` will cause -+ Python to emit warning messages on ``stderr`` if either the locale coercion -+ activates, or else if a locale that *would* have triggered coercion is -+ still active when the Python runtime is initialized. -+ -+ Availability: \*nix -+ -+ .. versionadded:: 3.7 -+ See :pep:`538` for more details. -+ - Debug-mode variables - ~~~~~~~~~~~~~~~~~~~~ - -diff --git a/Lib/test/support/script_helper.py b/Lib/test/support/script_helper.py -index ca5f9c2..7aa460b 100644 ---- a/Lib/test/support/script_helper.py -+++ b/Lib/test/support/script_helper.py -@@ -51,8 +51,35 @@ def interpreter_requires_environment(): - return __cached_interp_requires_environment - - --_PythonRunResult = collections.namedtuple("_PythonRunResult", -- ("rc", "out", "err")) -+class _PythonRunResult(collections.namedtuple("_PythonRunResult", -+ ("rc", "out", "err"))): -+ """Helper for reporting Python subprocess run results""" -+ def fail(self, cmd_line): -+ """Provide helpful details about failed subcommand runs""" -+ # Limit to 80 lines to ASCII characters -+ maxlen = 80 * 100 -+ out, err = self.out, self.err -+ if len(out) > maxlen: -+ out = b'(... truncated stdout ...)' + out[-maxlen:] -+ if len(err) > maxlen: -+ err = b'(... truncated stderr ...)' + err[-maxlen:] -+ out = out.decode('ascii', 'replace').rstrip() -+ err = err.decode('ascii', 'replace').rstrip() -+ raise AssertionError("Process return code is %d\n" -+ "command line: %r\n" -+ "\n" -+ "stdout:\n" -+ "---\n" -+ "%s\n" -+ "---\n" -+ "\n" -+ "stderr:\n" -+ "---\n" -+ "%s\n" -+ "---" -+ % (self.rc, cmd_line, -+ out, -+ err)) - - - # Executing the interpreter in a subprocess -@@ -110,30 +137,7 @@ def run_python_until_end(*args, **env_vars): - def _assert_python(expected_success, *args, **env_vars): - res, cmd_line = run_python_until_end(*args, **env_vars) - if (res.rc and expected_success) or (not res.rc and not expected_success): -- # Limit to 80 lines to ASCII characters -- maxlen = 80 * 100 -- out, err = res.out, res.err -- if len(out) > maxlen: -- out = b'(... truncated stdout ...)' + out[-maxlen:] -- if len(err) > maxlen: -- err = b'(... truncated stderr ...)' + err[-maxlen:] -- out = out.decode('ascii', 'replace').rstrip() -- err = err.decode('ascii', 'replace').rstrip() -- raise AssertionError("Process return code is %d\n" -- "command line: %r\n" -- "\n" -- "stdout:\n" -- "---\n" -- "%s\n" -- "---\n" -- "\n" -- "stderr:\n" -- "---\n" -- "%s\n" -- "---" -- % (res.rc, cmd_line, -- out, -- err)) -+ res.fail(cmd_line) - return res - - def assert_python_ok(*args, **env_vars): -diff --git a/Lib/test/test_c_locale_coercion.py b/Lib/test/test_c_locale_coercion.py -new file mode 100644 -index 0000000..635c98f ---- /dev/null -+++ b/Lib/test/test_c_locale_coercion.py -@@ -0,0 +1,371 @@ -+# Tests the attempted automatic coercion of the C locale to a UTF-8 locale -+ -+import unittest -+import locale -+import os -+import sys -+import sysconfig -+import shutil -+import subprocess -+from collections import namedtuple -+ -+import test.support -+from test.support.script_helper import ( -+ run_python_until_end, -+ interpreter_requires_environment, -+) -+ -+# Set our expectation for the default encoding used in the C locale -+# for the filesystem encoding and the standard streams -+ -+# AIX uses iso8859-1 in the C locale, other *nix platforms use ASCII -+if sys.platform.startswith("aix"): -+ C_LOCALE_STREAM_ENCODING = "iso8859-1" -+else: -+ C_LOCALE_STREAM_ENCODING = "ascii" -+ -+# FS encoding is UTF-8 on macOS, other *nix platforms use the locale encoding -+if sys.platform == "darwin": -+ C_LOCALE_FS_ENCODING = "utf-8" -+else: -+ C_LOCALE_FS_ENCODING = C_LOCALE_STREAM_ENCODING -+ -+# Note that the above is probably still wrong in some cases, such as: -+# * Windows when PYTHONLEGACYWINDOWSFSENCODING is set -+# * AIX and any other platforms that use latin-1 in the C locale -+# -+# Options for dealing with this: -+# * Don't set PYTHON_COERCE_C_LOCALE on such platforms (e.g. Windows doesn't) -+# * Fix the test expectations to match the actual platform behaviour -+ -+# In order to get the warning messages to match up as expected, the candidate -+# order here must much the target locale order in Python/pylifecycle.c -+_C_UTF8_LOCALES = ("C.UTF-8", "C.utf8", "UTF-8") -+ -+# There's no reliable cross-platform way of checking locale alias -+# lists, so the only way of knowing which of these locales will work -+# is to try them with locale.setlocale(). We do that in a subprocess -+# to avoid altering the locale of the test runner. -+# -+# If the relevant locale module attributes exist, and we're not on a platform -+# where we expect it to always succeed, we also check that -+# `locale.nl_langinfo(locale.CODESET)` works, as if it fails, the interpreter -+# will skip locale coercion for that particular target locale -+_check_nl_langinfo_CODESET = bool( -+ sys.platform not in ("darwin", "linux") and -+ hasattr(locale, "nl_langinfo") and -+ hasattr(locale, "CODESET") -+) -+ -+def _set_locale_in_subprocess(locale_name): -+ cmd_fmt = "import locale; print(locale.setlocale(locale.LC_CTYPE, '{}'))" -+ if _check_nl_langinfo_CODESET: -+ # If there's no valid CODESET, we expect coercion to be skipped -+ cmd_fmt += "; import sys; sys.exit(not locale.nl_langinfo(locale.CODESET))" -+ cmd = cmd_fmt.format(locale_name) -+ result, py_cmd = run_python_until_end("-c", cmd, __isolated=True) -+ return result.rc == 0 -+ -+ -+ -+_fields = "fsencoding stdin_info stdout_info stderr_info lang lc_ctype lc_all" -+_EncodingDetails = namedtuple("EncodingDetails", _fields) -+ -+class EncodingDetails(_EncodingDetails): -+ # XXX (ncoghlan): Using JSON for child state reporting may be less fragile -+ CHILD_PROCESS_SCRIPT = ";".join([ -+ "import sys, os", -+ "print(sys.getfilesystemencoding())", -+ "print(sys.stdin.encoding + ':' + sys.stdin.errors)", -+ "print(sys.stdout.encoding + ':' + sys.stdout.errors)", -+ "print(sys.stderr.encoding + ':' + sys.stderr.errors)", -+ "print(os.environ.get('LANG', 'not set'))", -+ "print(os.environ.get('LC_CTYPE', 'not set'))", -+ "print(os.environ.get('LC_ALL', 'not set'))", -+ ]) -+ -+ @classmethod -+ def get_expected_details(cls, coercion_expected, fs_encoding, stream_encoding, env_vars): -+ """Returns expected child process details for a given encoding""" -+ _stream = stream_encoding + ":{}" -+ # stdin and stdout should use surrogateescape either because the -+ # coercion triggered, or because the C locale was detected -+ stream_info = 2*[_stream.format("surrogateescape")] -+ # stderr should always use backslashreplace -+ stream_info.append(_stream.format("backslashreplace")) -+ expected_lang = env_vars.get("LANG", "not set").lower() -+ if coercion_expected: -+ expected_lc_ctype = CLI_COERCION_TARGET.lower() -+ else: -+ expected_lc_ctype = env_vars.get("LC_CTYPE", "not set").lower() -+ expected_lc_all = env_vars.get("LC_ALL", "not set").lower() -+ env_info = expected_lang, expected_lc_ctype, expected_lc_all -+ return dict(cls(fs_encoding, *stream_info, *env_info)._asdict()) -+ -+ @staticmethod -+ def _handle_output_variations(data): -+ """Adjust the output to handle platform specific idiosyncrasies -+ -+ * Some platforms report ASCII as ANSI_X3.4-1968 -+ * Some platforms report ASCII as US-ASCII -+ * Some platforms report UTF-8 instead of utf-8 -+ """ -+ data = data.replace(b"ANSI_X3.4-1968", b"ascii") -+ data = data.replace(b"US-ASCII", b"ascii") -+ data = data.lower() -+ return data -+ -+ @classmethod -+ def get_child_details(cls, env_vars): -+ """Retrieves fsencoding and standard stream details from a child process -+ -+ Returns (encoding_details, stderr_lines): -+ -+ - encoding_details: EncodingDetails for eager decoding -+ - stderr_lines: result of calling splitlines() on the stderr output -+ -+ The child is run in isolated mode if the current interpreter supports -+ that. -+ """ -+ result, py_cmd = run_python_until_end( -+ "-c", cls.CHILD_PROCESS_SCRIPT, -+ __isolated=True, -+ **env_vars -+ ) -+ if not result.rc == 0: -+ result.fail(py_cmd) -+ # All subprocess outputs in this test case should be pure ASCII -+ adjusted_output = cls._handle_output_variations(result.out) -+ stdout_lines = adjusted_output.decode("ascii").splitlines() -+ child_encoding_details = dict(cls(*stdout_lines)._asdict()) -+ stderr_lines = result.err.decode("ascii").rstrip().splitlines() -+ return child_encoding_details, stderr_lines -+ -+ -+# Details of the shared library warning emitted at runtime -+LEGACY_LOCALE_WARNING = ( -+ "Python runtime initialized with LC_CTYPE=C (a locale with default ASCII " -+ "encoding), which may cause Unicode compatibility problems. Using C.UTF-8, " -+ "C.utf8, or UTF-8 (if available) as alternative Unicode-compatible " -+ "locales is recommended." -+) -+ -+# Details of the CLI locale coercion warning emitted at runtime -+CLI_COERCION_WARNING_FMT = ( -+ "Python detected LC_CTYPE=C: LC_CTYPE coerced to {} (set another locale " -+ "or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior)." -+) -+ -+ -+AVAILABLE_TARGETS = None -+CLI_COERCION_TARGET = None -+CLI_COERCION_WARNING = None -+ -+def setUpModule(): -+ global AVAILABLE_TARGETS -+ global CLI_COERCION_TARGET -+ global CLI_COERCION_WARNING -+ -+ if AVAILABLE_TARGETS is not None: -+ # initialization already done -+ return -+ AVAILABLE_TARGETS = [] -+ -+ # Find the target locales available in the current system -+ for target_locale in _C_UTF8_LOCALES: -+ if _set_locale_in_subprocess(target_locale): -+ AVAILABLE_TARGETS.append(target_locale) -+ -+ if AVAILABLE_TARGETS: -+ # Coercion is expected to use the first available target locale -+ CLI_COERCION_TARGET = AVAILABLE_TARGETS[0] -+ CLI_COERCION_WARNING = CLI_COERCION_WARNING_FMT.format(CLI_COERCION_TARGET) -+ -+ -+class _LocaleHandlingTestCase(unittest.TestCase): -+ # Base class to check expected locale handling behaviour -+ -+ def _check_child_encoding_details(self, -+ env_vars, -+ expected_fs_encoding, -+ expected_stream_encoding, -+ expected_warnings, -+ coercion_expected): -+ """Check the C locale handling for the given process environment -+ -+ Parameters: -+ expected_fs_encoding: expected sys.getfilesystemencoding() result -+ expected_stream_encoding: expected encoding for standard streams -+ expected_warning: stderr output to expect (if any) -+ """ -+ result = EncodingDetails.get_child_details(env_vars) -+ encoding_details, stderr_lines = result -+ expected_details = EncodingDetails.get_expected_details( -+ coercion_expected, -+ expected_fs_encoding, -+ expected_stream_encoding, -+ env_vars -+ ) -+ self.assertEqual(encoding_details, expected_details) -+ if expected_warnings is None: -+ expected_warnings = [] -+ self.assertEqual(stderr_lines, expected_warnings) -+ -+ -+class LocaleConfigurationTests(_LocaleHandlingTestCase): -+ # Test explicit external configuration via the process environment -+ -+ def setUpClass(): -+ # This relies on setupModule() having been run, so it can't be -+ # handled via the @unittest.skipUnless decorator -+ if not AVAILABLE_TARGETS: -+ raise unittest.SkipTest("No C-with-UTF-8 locale available") -+ -+ def test_external_target_locale_configuration(self): -+ -+ # Explicitly setting a target locale should give the same behaviour as -+ # is seen when implicitly coercing to that target locale -+ self.maxDiff = None -+ -+ expected_fs_encoding = "utf-8" -+ expected_stream_encoding = "utf-8" -+ -+ base_var_dict = { -+ "LANG": "", -+ "LC_CTYPE": "", -+ "LC_ALL": "", -+ } -+ for env_var in ("LANG", "LC_CTYPE"): -+ for locale_to_set in AVAILABLE_TARGETS: -+ # XXX (ncoghlan): LANG=UTF-8 doesn't appear to work as -+ # expected, so skip that combination for now -+ # See https://bugs.python.org/issue30672 for discussion -+ if env_var == "LANG" and locale_to_set == "UTF-8": -+ continue -+ -+ with self.subTest(env_var=env_var, -+ configured_locale=locale_to_set): -+ var_dict = base_var_dict.copy() -+ var_dict[env_var] = locale_to_set -+ self._check_child_encoding_details(var_dict, -+ expected_fs_encoding, -+ expected_stream_encoding, -+ expected_warnings=None, -+ coercion_expected=False) -+ -+ -+ -+@test.support.cpython_only -+@unittest.skipUnless(sysconfig.get_config_var("PY_COERCE_C_LOCALE"), -+ "C locale coercion disabled at build time") -+class LocaleCoercionTests(_LocaleHandlingTestCase): -+ # Test implicit reconfiguration of the environment during CLI startup -+ -+ def _check_c_locale_coercion(self, -+ fs_encoding, stream_encoding, -+ coerce_c_locale, -+ expected_warnings=None, -+ coercion_expected=True, -+ **extra_vars): -+ """Check the C locale handling for various configurations -+ -+ Parameters: -+ fs_encoding: expected sys.getfilesystemencoding() result -+ stream_encoding: expected encoding for standard streams -+ coerce_c_locale: setting to use for PYTHONCOERCECLOCALE -+ None: don't set the variable at all -+ str: the value set in the child's environment -+ expected_warnings: expected warning lines on stderr -+ extra_vars: additional environment variables to set in subprocess -+ """ -+ self.maxDiff = None -+ -+ if not AVAILABLE_TARGETS: -+ # Locale coercion is disabled when there aren't any target locales -+ fs_encoding = C_LOCALE_FS_ENCODING -+ stream_encoding = C_LOCALE_STREAM_ENCODING -+ coercion_expected = False -+ if expected_warnings: -+ expected_warnings = [LEGACY_LOCALE_WARNING] -+ -+ base_var_dict = { -+ "LANG": "", -+ "LC_CTYPE": "", -+ "LC_ALL": "", -+ } -+ base_var_dict.update(extra_vars) -+ for env_var in ("LANG", "LC_CTYPE"): -+ for locale_to_set in ("", "C", "POSIX", "invalid.ascii"): -+ # XXX (ncoghlan): *BSD platforms don't behave as expected in the -+ # POSIX locale, so we skip that for now -+ # See https://bugs.python.org/issue30672 for discussion -+ if locale_to_set == "POSIX": -+ continue -+ with self.subTest(env_var=env_var, -+ nominal_locale=locale_to_set, -+ PYTHONCOERCECLOCALE=coerce_c_locale): -+ var_dict = base_var_dict.copy() -+ var_dict[env_var] = locale_to_set -+ if coerce_c_locale is not None: -+ var_dict["PYTHONCOERCECLOCALE"] = coerce_c_locale -+ # Check behaviour on successful coercion -+ self._check_child_encoding_details(var_dict, -+ fs_encoding, -+ stream_encoding, -+ expected_warnings, -+ coercion_expected) -+ -+ def test_test_PYTHONCOERCECLOCALE_not_set(self): -+ # This should coerce to the first available target locale by default -+ self._check_c_locale_coercion("utf-8", "utf-8", coerce_c_locale=None) -+ -+ def test_PYTHONCOERCECLOCALE_not_zero(self): -+ # *Any* string other than "0" is considered "set" for our purposes -+ # and hence should result in the locale coercion being enabled -+ for setting in ("", "1", "true", "false"): -+ self._check_c_locale_coercion("utf-8", "utf-8", coerce_c_locale=setting) -+ -+ def test_PYTHONCOERCECLOCALE_set_to_warn(self): -+ # PYTHONCOERCECLOCALE=warn enables runtime warnings for legacy locales -+ self._check_c_locale_coercion("utf-8", "utf-8", -+ coerce_c_locale="warn", -+ expected_warnings=[CLI_COERCION_WARNING]) -+ -+ -+ def test_PYTHONCOERCECLOCALE_set_to_zero(self): -+ # The setting "0" should result in the locale coercion being disabled -+ self._check_c_locale_coercion(C_LOCALE_FS_ENCODING, -+ C_LOCALE_STREAM_ENCODING, -+ coerce_c_locale="0", -+ coercion_expected=False) -+ # Setting LC_ALL=C shouldn't make any difference to the behaviour -+ self._check_c_locale_coercion(C_LOCALE_FS_ENCODING, -+ C_LOCALE_STREAM_ENCODING, -+ coerce_c_locale="0", -+ LC_ALL="C", -+ coercion_expected=False) -+ -+ def test_LC_ALL_set_to_C(self): -+ # Setting LC_ALL should render the locale coercion ineffective -+ self._check_c_locale_coercion(C_LOCALE_FS_ENCODING, -+ C_LOCALE_STREAM_ENCODING, -+ coerce_c_locale=None, -+ LC_ALL="C", -+ coercion_expected=False) -+ # And result in a warning about a lack of locale compatibility -+ self._check_c_locale_coercion(C_LOCALE_FS_ENCODING, -+ C_LOCALE_STREAM_ENCODING, -+ coerce_c_locale="warn", -+ LC_ALL="C", -+ expected_warnings=[LEGACY_LOCALE_WARNING], -+ coercion_expected=False) -+ -+def test_main(): -+ test.support.run_unittest( -+ LocaleConfigurationTests, -+ LocaleCoercionTests -+ ) -+ test.support.reap_children() -+ -+if __name__ == "__main__": -+ test_main() -diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py -index 6c3625d..009f542 100644 ---- a/Lib/test/test_capi.py -+++ b/Lib/test/test_capi.py -@@ -369,14 +369,21 @@ class EmbeddingTests(unittest.TestCase): - def tearDown(self): - os.chdir(self.oldcwd) - -- def run_embedded_interpreter(self, *args): -+ def run_embedded_interpreter(self, *args, env=None): - """Runs a test in the embedded interpreter""" - cmd = [self.test_exe] - cmd.extend(args) -+ if env is not None and sys.platform == 'win32': -+ # Windows requires at least the SYSTEMROOT environment variable to -+ # start Python. -+ env = env.copy() -+ env['SYSTEMROOT'] = os.environ['SYSTEMROOT'] -+ - p = subprocess.Popen(cmd, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, -- universal_newlines=True) -+ universal_newlines=True, -+ env=env) - (out, err) = p.communicate() - self.assertEqual(p.returncode, 0, - "bad returncode %d, stderr is %r" % -@@ -386,31 +393,21 @@ class EmbeddingTests(unittest.TestCase): - def test_subinterps(self): - # This is just a "don't crash" test - out, err = self.run_embedded_interpreter() -- if support.verbose: -+ if support.verbose > 1: - print() - print(out) - print(err) - -- @staticmethod -- def _get_default_pipe_encoding(): -- rp, wp = os.pipe() -- try: -- with os.fdopen(wp, 'w') as w: -- default_pipe_encoding = w.encoding -- finally: -- os.close(rp) -- return default_pipe_encoding -- - def test_forced_io_encoding(self): - # Checks forced configuration of embedded interpreter IO streams -- out, err = self.run_embedded_interpreter("forced_io_encoding") -- if support.verbose: -+ env = dict(os.environ, PYTHONIOENCODING="utf-8:surrogateescape") -+ out, err = self.run_embedded_interpreter("forced_io_encoding", env=env) -+ if support.verbose > 1: - print() - print(out) - print(err) -- expected_errors = sys.__stdout__.errors -- expected_stdin_encoding = sys.__stdin__.encoding -- expected_pipe_encoding = self._get_default_pipe_encoding() -+ expected_stream_encoding = "utf-8" -+ expected_errors = "surrogateescape" - expected_output = '\n'.join([ - "--- Use defaults ---", - "Expected encoding: default", -@@ -437,8 +434,8 @@ class EmbeddingTests(unittest.TestCase): - "stdout: latin-1:replace", - "stderr: latin-1:backslashreplace"]) - expected_output = expected_output.format( -- in_encoding=expected_stdin_encoding, -- out_encoding=expected_pipe_encoding, -+ in_encoding=expected_stream_encoding, -+ out_encoding=expected_stream_encoding, - errors=expected_errors) - # This is useful if we ever trip over odd platform behaviour - self.maxDiff = None -diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py -index ae2bcd4..0a302ff 100644 ---- a/Lib/test/test_cmd_line.py -+++ b/Lib/test/test_cmd_line.py -@@ -9,8 +9,9 @@ import sys - import subprocess - import tempfile - from test.support import script_helper, is_android --from test.support.script_helper import (spawn_python, kill_python, assert_python_ok, -- assert_python_failure) -+from test.support.script_helper import ( -+ spawn_python, kill_python, assert_python_ok, assert_python_failure -+) - - - # XXX (ncoghlan): Move to script_helper and make consistent with run_python -@@ -151,6 +152,7 @@ class CmdLineTest(unittest.TestCase): - env = os.environ.copy() - # Use C locale to get ascii for the locale encoding - env['LC_ALL'] = 'C' -+ env['PYTHONCOERCECLOCALE'] = '0' - code = ( - b'import locale; ' - b'print(ascii("' + undecodable + b'"), ' -diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py -index df9ebd4..63145e4 100644 ---- a/Lib/test/test_sys.py -+++ b/Lib/test/test_sys.py -@@ -680,6 +680,7 @@ class SysModuleTest(unittest.TestCase): - # Force the POSIX locale - env = os.environ.copy() - env["LC_ALL"] = "C" -+ env["PYTHONCOERCECLOCALE"] = "0" - code = '\n'.join(( - 'import sys', - 'def dump(name):', -diff --git a/Modules/main.c b/Modules/main.c -index dd50211..f20cf24 100644 ---- a/Modules/main.c -+++ b/Modules/main.c -@@ -105,7 +105,11 @@ static const char usage_6[] = - " predictable seed.\n" - "PYTHONMALLOC: set the Python memory allocators and/or install debug hooks\n" - " on Python memory allocators. Use PYTHONMALLOC=debug to install debug\n" --" hooks.\n"; -+" hooks.\n" -+ -+"PYTHONCOERCECLOCALE: if this variable is set to 0, it disables the locale\n" -+" coercion behavior. Use PYTHONCOERCECLOCALE=warn to request display of\n" -+" locale coercion and locale compatibility warnings on stderr.\n"; - - static int - usage(int exitcode, const wchar_t* program) -diff --git a/Programs/_testembed.c b/Programs/_testembed.c -index 3968399..1bd2bbf 100644 ---- a/Programs/_testembed.c -+++ b/Programs/_testembed.c -@@ -1,4 +1,5 @@ --#include -+#include "Python.h" -+#include "pyconfig.h" - #include - - /********************************************************* -diff --git a/Programs/python.c b/Programs/python.c -index a7afbc7..03f8295 100644 ---- a/Programs/python.c -+++ b/Programs/python.c -@@ -15,6 +15,21 @@ wmain(int argc, wchar_t **argv) - } - #else - -+/* Access private pylifecycle helper API to better handle the legacy C locale -+ * -+ * The legacy C locale assumes ASCII as the default text encoding, which -+ * causes problems not only for the CPython runtime, but also other -+ * components like GNU readline. -+ * -+ * Accordingly, when the CLI detects it, it attempts to coerce it to a -+ * more capable UTF-8 based alternative. -+ * -+ * See the documentation of the PYTHONCOERCECLOCALE setting for more details. -+ * -+ */ -+extern int _Py_LegacyLocaleDetected(void); -+extern void _Py_CoerceLegacyLocale(void); -+ - int - main(int argc, char **argv) - { -@@ -25,7 +40,11 @@ main(int argc, char **argv) - char *oldloc; - - /* Force malloc() allocator to bootstrap Python */ -+#ifdef Py_DEBUG -+ (void)_PyMem_SetupAllocators("malloc_debug"); -+# else - (void)_PyMem_SetupAllocators("malloc"); -+# endif - - argv_copy = (wchar_t **)PyMem_RawMalloc(sizeof(wchar_t*) * (argc+1)); - argv_copy2 = (wchar_t **)PyMem_RawMalloc(sizeof(wchar_t*) * (argc+1)); -@@ -49,7 +68,21 @@ main(int argc, char **argv) - return 1; - } - -+#ifdef __ANDROID__ -+ /* Passing "" to setlocale() on Android requests the C locale rather -+ * than checking environment variables, so request C.UTF-8 explicitly -+ */ -+ setlocale(LC_ALL, "C.UTF-8"); -+#else -+ /* Reconfigure the locale to the default for this process */ - setlocale(LC_ALL, ""); -+#endif -+ -+ if (_Py_LegacyLocaleDetected()) { -+ _Py_CoerceLegacyLocale(); -+ } -+ -+ /* Convert from char to wchar_t based on the locale settings */ - for (i = 0; i < argc; i++) { - argv_copy[i] = Py_DecodeLocale(argv[i], NULL); - if (!argv_copy[i]) { -@@ -70,7 +103,11 @@ main(int argc, char **argv) - - /* Force again malloc() allocator to release memory blocks allocated - before Py_Main() */ -+#ifdef Py_DEBUG -+ (void)_PyMem_SetupAllocators("malloc_debug"); -+# else - (void)_PyMem_SetupAllocators("malloc"); -+# endif - - for (i = 0; i < argc; i++) { - PyMem_RawFree(argv_copy2[i]); -diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c -index a4f7f82..3843297 100644 ---- a/Python/pylifecycle.c -+++ b/Python/pylifecycle.c -@@ -167,6 +167,7 @@ Py_SetStandardStreamEncoding(const char *encoding, const char *errors) - return 0; - } - -+ - /* Global initializations. Can be undone by Py_FinalizeEx(). Don't - call this twice without an intervening Py_FinalizeEx() call. When - initializations fail, a fatal error is issued and the function does -@@ -301,6 +302,183 @@ import_init(PyInterpreterState *interp, PyObject *sysmod) - } - - -+/* Helper functions to better handle the legacy C locale -+ * -+ * The legacy C locale assumes ASCII as the default text encoding, which -+ * causes problems not only for the CPython runtime, but also other -+ * components like GNU readline. -+ * -+ * Accordingly, when the CLI detects it, it attempts to coerce it to a -+ * more capable UTF-8 based alternative as follows: -+ * -+ * if (_Py_LegacyLocaleDetected()) { -+ * _Py_CoerceLegacyLocale(); -+ * } -+ * -+ * See the documentation of the PYTHONCOERCECLOCALE setting for more details. -+ * -+ * Locale coercion also impacts the default error handler for the standard -+ * streams: while the usual default is "strict", the default for the legacy -+ * C locale and for any of the coercion target locales is "surrogateescape". -+ */ -+ -+int -+_Py_LegacyLocaleDetected(void) -+{ -+#ifndef MS_WINDOWS -+ /* On non-Windows systems, the C locale is considered a legacy locale */ -+ /* XXX (ncoghlan): some platforms (notably Mac OS X) don't appear to treat -+ * the POSIX locale as a simple alias for the C locale, so -+ * we may also want to check for that explicitly. -+ */ -+ const char *ctype_loc = setlocale(LC_CTYPE, NULL); -+ return ctype_loc != NULL && strcmp(ctype_loc, "C") == 0; -+#else -+ /* Windows uses code pages instead of locales, so no locale is legacy */ -+ return 0; -+#endif -+} -+ -+ -+static const char *_C_LOCALE_WARNING = -+ "Python runtime initialized with LC_CTYPE=C (a locale with default ASCII " -+ "encoding), which may cause Unicode compatibility problems. Using C.UTF-8, " -+ "C.utf8, or UTF-8 (if available) as alternative Unicode-compatible " -+ "locales is recommended.\n"; -+ -+static int -+_legacy_locale_warnings_enabled(void) -+{ -+ const char *coerce_c_locale = getenv("PYTHONCOERCECLOCALE"); -+ return (coerce_c_locale != NULL && -+ strncmp(coerce_c_locale, "warn", 5) == 0); -+} -+ -+static void -+_emit_stderr_warning_for_legacy_locale(void) -+{ -+ if (_legacy_locale_warnings_enabled()) { -+ if (_Py_LegacyLocaleDetected()) { -+ fprintf(stderr, "%s", _C_LOCALE_WARNING); -+ } -+ } -+} -+ -+typedef struct _CandidateLocale { -+ const char *locale_name; /* The locale to try as a coercion target */ -+} _LocaleCoercionTarget; -+ -+static _LocaleCoercionTarget _TARGET_LOCALES[] = { -+ {"C.UTF-8"}, -+ {"C.utf8"}, -+ {"UTF-8"}, -+ {NULL} -+}; -+ -+static char * -+get_default_standard_stream_error_handler(void) -+{ -+ const char *ctype_loc = setlocale(LC_CTYPE, NULL); -+ if (ctype_loc != NULL) { -+ /* "surrogateescape" is the default in the legacy C locale */ -+ if (strcmp(ctype_loc, "C") == 0) { -+ return "surrogateescape"; -+ } -+ -+#ifdef PY_COERCE_C_LOCALE -+ /* "surrogateescape" is the default in locale coercion target locales */ -+ const _LocaleCoercionTarget *target = NULL; -+ for (target = _TARGET_LOCALES; target->locale_name; target++) { -+ if (strcmp(ctype_loc, target->locale_name) == 0) { -+ return "surrogateescape"; -+ } -+ } -+#endif -+ } -+ -+ /* Otherwise return NULL to request the typical default error handler */ -+ return NULL; -+} -+ -+#ifdef PY_COERCE_C_LOCALE -+static const char *_C_LOCALE_COERCION_WARNING = -+ "Python detected LC_CTYPE=C: LC_CTYPE coerced to %.20s (set another locale " -+ "or PYTHONCOERCECLOCALE=0 to disable this locale coercion behavior).\n"; -+ -+static void -+_coerce_default_locale_settings(const _LocaleCoercionTarget *target) -+{ -+ -+ const char *newloc = target->locale_name; -+ -+ /* Reset locale back to currently configured defaults */ -+ setlocale(LC_ALL, ""); -+ -+ /* Set the relevant locale environment variable */ -+ if (setenv("LC_CTYPE", newloc, 1)) { -+ fprintf(stderr, -+ "Error setting LC_CTYPE, skipping C locale coercion\n"); -+ return; -+ } -+ if (_legacy_locale_warnings_enabled()) { -+ fprintf(stderr, _C_LOCALE_COERCION_WARNING, newloc); -+ } -+ -+ /* Reconfigure with the overridden environment variables */ -+ setlocale(LC_ALL, ""); -+} -+#endif -+ -+ -+void -+_Py_CoerceLegacyLocale(void) -+{ -+#ifdef PY_COERCE_C_LOCALE -+ /* We ignore the Python -E and -I flags here, as the CLI needs to sort out -+ * the locale settings *before* we try to do anything with the command -+ * line arguments. For cross-platform debugging purposes, we also need -+ * to give end users a way to force even scripts that are otherwise -+ * isolated from their environment to use the legacy ASCII-centric C -+ * locale. -+ * -+ * Ignoring -E and -I is safe from a security perspective, as we only use -+ * the setting to turn *off* the implicit locale coercion, and anyone with -+ * access to the process environment already has the ability to set -+ * `LC_ALL=C` to override the C level locale settings anyway. -+ */ -+ const char *coerce_c_locale = getenv("PYTHONCOERCECLOCALE"); -+ if (coerce_c_locale == NULL || strncmp(coerce_c_locale, "0", 2) != 0) { -+ /* PYTHONCOERCECLOCALE is not set, or is set to something other than "0" */ -+ const char *locale_override = getenv("LC_ALL"); -+ if (locale_override == NULL || *locale_override == '\0') { -+ /* LC_ALL is also not set (or is set to an empty string) */ -+ const _LocaleCoercionTarget *target = NULL; -+ for (target = _TARGET_LOCALES; target->locale_name; target++) { -+ const char *new_locale = setlocale(LC_CTYPE, -+ target->locale_name); -+ if (new_locale != NULL) { -+#if !defined(__APPLE__) && defined(HAVE_LANGINFO_H) && defined(CODESET) -+ /* Also ensure that nl_langinfo works in this locale */ -+ char *codeset = nl_langinfo(CODESET); -+ if (!codeset || *codeset == '\0') { -+ /* CODESET is not set or empty, so skip coercion */ -+ new_locale = NULL; -+ setlocale(LC_CTYPE, ""); -+ continue; -+ } -+#endif -+ /* Successfully configured locale, so make it the default */ -+ _coerce_default_locale_settings(target); -+ return; -+ } -+ } -+ } -+ } -+ /* No C locale warning here, as Py_Initialize will emit one later */ -+#endif -+} -+ -+ - void - _Py_InitializeEx_Private(int install_sigs, int install_importlib) - { -@@ -315,11 +493,19 @@ _Py_InitializeEx_Private(int install_sigs, int install_importlib) - initialized = 1; - _Py_Finalizing = NULL; - --#ifdef HAVE_SETLOCALE -+#ifdef __ANDROID__ -+ /* Passing "" to setlocale() on Android requests the C locale rather -+ * than checking environment variables, so request C.UTF-8 explicitly -+ */ -+ setlocale(LC_CTYPE, "C.UTF-8"); -+#else -+#ifndef MS_WINDOWS - /* Set up the LC_CTYPE locale, so we can obtain - the locale's charset without having to switch - locales. */ - setlocale(LC_CTYPE, ""); -+ _emit_stderr_warning_for_legacy_locale(); -+#endif - #endif - - if ((p = Py_GETENV("PYTHONDEBUG")) && *p != '\0') -@@ -1242,12 +1428,8 @@ initstdio(void) - } - } - if (!errors && !(pythonioencoding && *pythonioencoding)) { -- /* When the LC_CTYPE locale is the POSIX locale ("C locale"), -- stdin and stdout use the surrogateescape error handler by -- default, instead of the strict error handler. */ -- char *loc = setlocale(LC_CTYPE, NULL); -- if (loc != NULL && strcmp(loc, "C") == 0) -- errors = "surrogateescape"; -+ /* Choose the default error handler based on the current locale */ -+ errors = get_default_standard_stream_error_handler(); - } - } - -diff --git a/configure b/configure -index 2915246..39e5a27 100755 ---- a/configure -+++ b/configure -@@ -834,6 +834,8 @@ with_thread - enable_ipv6 - with_doc_strings - with_pymalloc -+with_c_locale_coercion -+with_c_locale_warning - with_valgrind - with_dtrace - with_fpectl -@@ -1527,6 +1529,12 @@ Optional Packages: - deprecated; use --with(out)-threads - --with(out)-doc-strings disable/enable documentation strings - --with(out)-pymalloc disable/enable specialized mallocs -+ --with(out)-c-locale-coercion -+ disable/enable C locale coercion to a UTF-8 based -+ locale -+ --with(out)-c-locale-warning -+ disable/enable locale compatibility warning in the C -+ locale - --with-valgrind Enable Valgrind support - --with(out)-dtrace disable/enable DTrace support - --with-fpectl enable SIGFPE catching -@@ -11010,6 +11018,52 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_pymalloc" >&5 - $as_echo "$with_pymalloc" >&6; } - -+# Check for --with-c-locale-coercion -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-c-locale-coercion" >&5 -+$as_echo_n "checking for --with-c-locale-coercion... " >&6; } -+ -+# Check whether --with-c-locale-coercion was given. -+if test "${with_c_locale_coercion+set}" = set; then : -+ withval=$with_c_locale_coercion; -+fi -+ -+ -+if test -z "$with_c_locale_coercion" -+then -+ with_c_locale_coercion="yes" -+fi -+if test "$with_c_locale_coercion" != "no" -+then -+ -+$as_echo "#define PY_COERCE_C_LOCALE 1" >>confdefs.h -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_c_locale_coercion" >&5 -+$as_echo "$with_c_locale_coercion" >&6; } -+ -+# Check for --with-c-locale-warning -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-c-locale-warning" >&5 -+$as_echo_n "checking for --with-c-locale-warning... " >&6; } -+ -+# Check whether --with-c-locale-warning was given. -+if test "${with_c_locale_warning+set}" = set; then : -+ withval=$with_c_locale_warning; -+fi -+ -+ -+if test -z "$with_c_locale_warning" -+then -+ with_c_locale_warning="yes" -+fi -+if test "$with_c_locale_warning" != "no" -+then -+ -+$as_echo "#define PY_WARN_ON_C_LOCALE 1" >>confdefs.h -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_c_locale_warning" >&5 -+$as_echo "$with_c_locale_warning" >&6; } -+ - # Check for Valgrind support - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-valgrind" >&5 - $as_echo_n "checking for --with-valgrind... " >&6; } -diff --git a/configure.ac b/configure.ac -index 67dfba3..b9c9f04 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -3279,6 +3279,40 @@ then - fi - AC_MSG_RESULT($with_pymalloc) - -+# Check for --with-c-locale-coercion -+AC_MSG_CHECKING(for --with-c-locale-coercion) -+AC_ARG_WITH(c-locale-coercion, -+ AS_HELP_STRING([--with(out)-c-locale-coercion], -+ [disable/enable C locale coercion to a UTF-8 based locale])) -+ -+if test -z "$with_c_locale_coercion" -+then -+ with_c_locale_coercion="yes" -+fi -+if test "$with_c_locale_coercion" != "no" -+then -+ AC_DEFINE(PY_COERCE_C_LOCALE, 1, -+ [Define if you want to coerce the C locale to a UTF-8 based locale]) -+fi -+AC_MSG_RESULT($with_c_locale_coercion) -+ -+# Check for --with-c-locale-warning -+AC_MSG_CHECKING(for --with-c-locale-warning) -+AC_ARG_WITH(c-locale-warning, -+ AS_HELP_STRING([--with(out)-c-locale-warning], -+ [disable/enable locale compatibility warning in the C locale])) -+ -+if test -z "$with_c_locale_warning" -+then -+ with_c_locale_warning="yes" -+fi -+if test "$with_c_locale_warning" != "no" -+then -+ AC_DEFINE(PY_WARN_ON_C_LOCALE, 1, -+ [Define to emit a locale compatibility warning in the C locale]) -+fi -+AC_MSG_RESULT($with_c_locale_warning) -+ - # Check for Valgrind support - AC_MSG_CHECKING([for --with-valgrind]) - AC_ARG_WITH([valgrind], -diff --git a/pyconfig.h.in b/pyconfig.h.in -index b10c57f..0a6f3e2 100644 ---- a/pyconfig.h.in -+++ b/pyconfig.h.in -@@ -1244,9 +1244,15 @@ - /* Define as the preferred size in bits of long digits */ - #undef PYLONG_BITS_IN_DIGIT - -+/* Define if you want to coerce the C locale to a UTF-8 based locale */ -+#undef PY_COERCE_C_LOCALE -+ - /* Define to printf format modifier for Py_ssize_t */ - #undef PY_FORMAT_SIZE_T - -+/* Define to emit a locale compatibility warning in the C locale */ -+#undef PY_WARN_ON_C_LOCALE -+ - /* Define if you want to build an interpreter with many run-time checks. */ - #undef Py_DEBUG - diff --git a/00277-fix-test-subprocess-hanging-tests.patch b/00277-fix-test-subprocess-hanging-tests.patch deleted file mode 100644 index c9b54e2..0000000 --- a/00277-fix-test-subprocess-hanging-tests.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 54849962eacc38f4e6c6f8a72ae258b3e7c2ecd5 Mon Sep 17 00:00:00 2001 -From: Victor Stinner -Date: Thu, 5 Oct 2017 15:05:30 +0200 -Subject: [PATCH] bpo-31178: Mock os.waitpid() in test_subprocess - -Fix test_exception_errpipe_bad_data() and -test_exception_errpipe_normal() of test_subprocess: mock os.waitpid() -to avoid calling the real os.waitpid(0, 0) which is an unexpected -side effect of the test. ---- - Lib/test/test_subprocess.py | 12 ++++++++---- - 1 file changed, 8 insertions(+), 4 deletions(-) - -diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py -index 00dc37bc2c7..3ba5c028517 100644 ---- a/Lib/test/test_subprocess.py -+++ b/Lib/test/test_subprocess.py -@@ -1559,8 +1559,10 @@ def proper_error(*args): - - fork_exec.side_effect = proper_error - -- with self.assertRaises(IsADirectoryError): -- self.PopenNoDestructor(["non_existent_command"]) -+ with mock.patch("subprocess.os.waitpid", -+ side_effect=ChildProcessError): -+ with self.assertRaises(IsADirectoryError): -+ self.PopenNoDestructor(["non_existent_command"]) - - @mock.patch("subprocess._posixsubprocess.fork_exec") - def test_exception_errpipe_bad_data(self, fork_exec): -@@ -1577,8 +1579,10 @@ def bad_error(*args): - - fork_exec.side_effect = bad_error - -- with self.assertRaises(subprocess.SubprocessError) as e: -- self.PopenNoDestructor(["non_existent_command"]) -+ with mock.patch("subprocess.os.waitpid", -+ side_effect=ChildProcessError): -+ with self.assertRaises(subprocess.SubprocessError) as e: -+ self.PopenNoDestructor(["non_existent_command"]) - - self.assertIn(repr(error_data), str(e.exception)) - diff --git a/00279-fix-memory-corruption-due-to-allocator-mix.patch b/00279-fix-memory-corruption-due-to-allocator-mix.patch deleted file mode 100644 index 4937391..0000000 --- a/00279-fix-memory-corruption-due-to-allocator-mix.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/Modules/getpath.c b/Modules/getpath.c -index c4055be..1258fcd 100644 ---- a/Modules/getpath.c -+++ b/Modules/getpath.c -@@ -735,7 +735,7 @@ calculate_path(void) - bufsz += wcslen(zip_path) + 1; - bufsz += wcslen(exec_prefix) + 1; - -- buf = PyMem_New(wchar_t, bufsz); -+ buf = PyMem_RawMalloc(bufsz * sizeof(wchar_t)); - if (buf == NULL) { - Py_FatalError( - "Not enough memory for dynamic PYTHONPATH"); diff --git a/macros.pybytecompile3.6 b/macros.pybytecompile3.7 similarity index 100% rename from macros.pybytecompile3.6 rename to macros.pybytecompile3.7 diff --git a/python3.spec b/python3.spec index 9b8f122..e540456 100644 --- a/python3.spec +++ b/python3.spec @@ -6,15 +6,18 @@ Name: python3 Summary: Interpreter of the Python programming language URL: https://www.python.org/ -%global pybasever 3.6 +%global pybasever 3.7 # pybasever without the dot: -%global pyshortver 36 +%global pyshortver 37 + +# Second alpha +%global prerel a2 # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well -Version: %{pybasever}.3 -Release: 4%{?dist} +Version: %{pybasever}.0 +Release: 0.1.%{?prerel}%{?dist} License: Python @@ -183,6 +186,7 @@ BuildRequires: gmp-devel BuildRequires: libappstream-glib BuildRequires: libffi-devel BuildRequires: libGL-devel +BuildRequires: libuuid-devel BuildRequires: libX11-devel BuildRequires: ncurses-devel @@ -225,7 +229,7 @@ BuildRequires: python3-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-%{version}%{prerel}.tar.xz # Supply an RPM macro "py_byte_compile" for the python3-devel subpackage # to enable specfiles to selectively byte-compile individual files and paths @@ -354,13 +358,6 @@ Patch205: 00205-make-libpl-respect-lib64.patch # Fedora Change: https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe Patch251: 00251-change-user-install-location.patch -# 00262 # -# Backport of PEP 538: Coercing the legacy C locale to a UTF-8 based locale -# https://www.python.org/dev/peps/pep-0538/ -# Fedora Change: https://fedoraproject.org/wiki/Changes/python3_c.utf-8_locale -# Original proposal: https://bugzilla.redhat.com/show_bug.cgi?id=1404918 -Patch262: 00262-pep538_coerce_legacy_c_locale.patch - # 00264 # # test_pass_by_value was added in Python 3.6.1 and on aarch64 # it is catching an error that was there, but wasn't tested before. @@ -377,18 +374,6 @@ Patch273: 00273-skip-float-test.patch # Upstream uses Debian-style architecture naming. Change to match Fedora. Patch274: 00274-fix-arch-names.patch -# 00277 # -# Fix test_exception_errpipe_bad_data() and -# test_exception_errpipe_normal() of test_subprocess: mock os.waitpid() -# to avoid calling the real os.waitpid(0, 0) which is an unexpected -# side effect of the test, which makes the koji builds hang. -# Fixed upstream: https://github.com/python/cpython/commit/11045c9d8a21dd9bd182a3939189db02815f9783 -Patch277: 00277-fix-test-subprocess-hanging-tests.patch - -# 00279 # -# Fix memory corruption due to allocator mix -# Fixed upstream: https://bugs.python.org/issue31532 -Patch279: 00279-fix-memory-corruption-due-to-allocator-mix.patch # (New patches go here ^^^) # @@ -619,7 +604,6 @@ cp -a %{SOURCE7} . # Remove bundled libraries to ensure that we're using the system copy. rm -r Modules/expat -rm -r Modules/zlib %if %{with rewheel} %global pip_version 9.0.1 @@ -652,7 +636,6 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch205 -p1 %patch251 -p1 -%patch262 -p1 %ifarch aarch64 %patch264 -p1 @@ -660,8 +643,6 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en %patch273 -p1 %patch274 -p1 -%patch277 -p1 -%patch279 -p1 # Remove files that should be generated by the build @@ -1266,6 +1247,7 @@ fi #%{dynload_dir}/time.%{SOABI_optimized}.so %{dynload_dir}/_testmultiphase.%{SOABI_optimized}.so %{dynload_dir}/unicodedata.%{SOABI_optimized}.so +%{dynload_dir}/_uuid.%{SOABI_optimized}.so %{dynload_dir}/xxlimited.%{SOABI_optimized}.so %{dynload_dir}/zlib.%{SOABI_optimized}.so @@ -1416,6 +1398,7 @@ fi %{dynload_dir}/_testbuffer.%{SOABI_optimized}.so %{dynload_dir}/_testcapi.%{SOABI_optimized}.so %{dynload_dir}/_testimportmultiple.%{SOABI_optimized}.so +%{dynload_dir}/_xxtestfuzz.%{SOABI_optimized}.so %{pylibdir}/lib2to3/tests %{pylibdir}/tkinter/test %{pylibdir}/unittest/test @@ -1502,6 +1485,8 @@ fi #%{dynload_dir}/time.%{SOABI_debug}.so %{dynload_dir}/_testmultiphase.%{SOABI_debug}.so %{dynload_dir}/unicodedata.%{SOABI_debug}.so +%{dynload_dir}/_uuid.%{SOABI_debug}.so +%{dynload_dir}/_xxtestfuzz.%{SOABI_debug}.so %{dynload_dir}/zlib.%{SOABI_debug}.so # No need to split things out the "Makefile" and the config-32/64.h file as we @@ -1560,6 +1545,10 @@ fi # ====================================================== %changelog +* Tue Nov 28 2017 Miro Hrončok - 3.7.0-0.1.a2 +- Update to 3.7.0 alpha 2 +- Removed merged patches 262, 277, 279 + * Tue Nov 21 2017 Miro Hrončok - 3.6.3-4 - Raise the release of platform-python obsoletes for better maintainability From 63459d7d2a4a8df39f900d753cf742c979b480a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 30 Nov 2017 09:54:54 +0100 Subject: [PATCH 415/416] Add flatpackage conditional for python37 --- python3.spec | 165 +++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 146 insertions(+), 19 deletions(-) diff --git a/python3.spec b/python3.spec index e540456..ea90da0 100644 --- a/python3.spec +++ b/python3.spec @@ -2,15 +2,16 @@ # Top-level metadata # ================== -Name: python3 -Summary: Interpreter of the Python programming language -URL: https://www.python.org/ - %global pybasever 3.7 # pybasever without the dot: %global pyshortver 37 +Name: python%{pyshortver} +Summary: Version %{pybasever} of the Python interpreter +URL: https://www.python.org/ + + # Second alpha %global prerel a2 @@ -28,6 +29,15 @@ License: Python # Note that the bcond macros are named for the CLI option they create. # "%%bcond_without" means "ENABLE by default and create a --without option" + +# Flat package, i.e. python36, python37, python38 for tox etc. +# warning: changes some other defaults +# in Fedora, never turn this on for the python3 package +# and always keep it on for python37 etc. +# WARNING: This does not change the package name and summary above +%bcond_without flatpackage + + # Expensive optimizations (mainly, profile-guided optimizations) %ifarch %{ix86} x86_64 %bcond_without optimizations @@ -41,11 +51,19 @@ License: Python %bcond_without tests # Ability to reuse RPM-installed pip using rewheel +%if %{with flatpackage} +%bcond_with rewheel +%else %bcond_without rewheel +%endif # Extra build for debugging the interpreter or C-API extensions # (the -debug subpackages) +%if %{with flatpackage} +%bcond_with debug_build +%else %bcond_without debug_build +%endif # Support for the GDB debugger %bcond_without gdb_hooks @@ -389,6 +407,8 @@ Patch274: 00274-fix-arch-names.patch # Descriptions, and metadata for subpackages # ========================================== +%if %{without flatpackage} + # Packages with Python modules in standard locations automatically # depend on python(abi). Provide that here. Provides: python(abi) = %{pybasever} @@ -402,7 +422,7 @@ Obsoletes: system-python < %{version}-%{release} Requires: %{name}-libs%{?_isa} = %{version}-%{release} # In order to support multiple Python interpreters for development purposes, -# packages with with the naming scheme pythonXY (e.g. python35) exist for +# packages with with the naming scheme flatpackage (e.g. python35) exist for # non-default versions of Python 3. # For consistency, and to keep the upgrade path clean, we Provide/Obsolete # these names here. @@ -588,6 +608,27 @@ Compiled extension modules use a special ABI flag ("d") in the filename, so extensions for both verisons can co-exist in the same directory. %endif # with debug_build +%else # with flatpackage + +Requires: redhat-rpm-config + +# We'll not provide this, on purpose +# No package in Fedora shall ever depend on flatpackage via this +%global __requires_exclude ^python\\(abi\\) = 3\\..$ +%global __provides_exclude ^python\\(abi\\) = 3\\..$ + +# We keep those inside on purpose +Provides: bundled(python3-pip) = 9.0.1 +Provides: bundled(python3-setuptools) = 28.8.0 + +# The descripton for the flat flatpackage package +%description +This package exists to allow developers to test their code against an newer +version of Python. This is not a full Python stack and if you wish to run +your applications with Python %{pybasever}, update your Fedora to a newer +version once Python %{pybasever} is stable. + +%endif # with flatpackage # ====================================================== # The prep phase of the build: @@ -879,6 +920,7 @@ install -d -m 0755 %{buildroot}%{pylibdir}/site-packages/__pycache__ install -d -m 0755 %{buildroot}%{_prefix}/lib/python%{pybasever}/site-packages/__pycache__ %endif +%if %{without flatpackage} # add idle3 to menu install -D -m 0644 Lib/idlelib/Icons/idle_16.png %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/idle3.png install -D -m 0644 Lib/idlelib/Icons/idle_32.png %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/idle3.png @@ -889,6 +931,7 @@ desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE10} mkdir -p %{buildroot}%{_datadir}/appdata cp -a %{SOURCE11} %{buildroot}%{_datadir}/appdata appstream-util validate-relax --nonet %{buildroot}%{_datadir}/appdata/idle3.appdata.xml +%endif # Development tools install -m755 -d %{buildroot}%{pylibdir}/Tools @@ -973,12 +1016,14 @@ find %{buildroot} -perm 555 -exec chmod 755 {} \; # Install macros for rpm: mkdir -p %{buildroot}/%{_rpmconfigdir}/macros.d/ install -m 644 %{SOURCE3} %{buildroot}/%{_rpmconfigdir}/macros.d/ +%if %{without flatpackage} install -m 644 %{SOURCE9} %{buildroot}/%{_rpmconfigdir}/macros.d/ +%endif # Create "/usr/bin/python3-debug", a symlink to the python3 debug binary, to # avoid the user having to know the precise version and ABI flags. # See e.g. https://bugzilla.redhat.com/show_bug.cgi?id=676748 -%if %{with debug_build} +%if %{with debug_build} && %{without flatpackage} ln -s \ %{_bindir}/python%{LDVERSION_debug} \ %{buildroot}%{_bindir}/python3-debug @@ -986,8 +1031,10 @@ ln -s \ # System Python: Link the executable to libexec # This is for backwards compatibility only and should be removed in Fedora 29 +%if %{without flatpackage} mkdir -p %{buildroot}%{_libexecdir} ln -s %{_bindir}/python%{pybasever} %{buildroot}%{_libexecdir}/system-python +%endif # ====================================================== @@ -1025,6 +1072,21 @@ for Module in %{buildroot}/%{dynload_dir}/*.so ; do esac done +%if %{with flatpackage} +# Remove stuff that would conflict with python3 package +mv %{buildroot}%{_bindir}/python{3,%{pyshortver}} +rm %{buildroot}%{_bindir}/pydoc3 +rm %{buildroot}%{_bindir}/pathfix.py +rm %{buildroot}%{_bindir}/idle3 +rm %{buildroot}%{_bindir}/python3-* +rm %{buildroot}%{_bindir}/pyvenv +rm %{buildroot}%{_bindir}/2to3 +rm %{buildroot}%{_libdir}/libpython3.so +rm %{buildroot}%{_mandir}/man1/python3.1* +rm %{buildroot}%{_libdir}/pkgconfig/python3.pc +%endif + + # ====================================================== # Running the upstream test suite # ====================================================== @@ -1087,46 +1149,71 @@ CheckPython optimized # Scriptlets # ====================================================== +%if %{without flatpackage} + %post libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig +%posttrans +/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : + +%endif + + %post +%if %{with flatpackage} +/sbin/ldconfig +%else /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : +%endif %postun +%if %{with flatpackage} +/sbin/ldconfig +%else if [ $1 -eq 0 ] ; then /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : fi - -%posttrans -/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : +%endif %files %defattr(-, root, root) %license LICENSE %doc README.rst + +%if %{without flatpackage} %{_bindir}/pydoc* %{_bindir}/python3 -%{_bindir}/python%{pybasever} -%{_bindir}/python%{pybasever}m %{_bindir}/pyvenv -%{_bindir}/pyvenv-%{pybasever} -%{_mandir}/*/* # Remove in Fedora 29: %{_libexecdir}/system-python +%else +%{_bindir}/pydoc%{pybasever} +%{_bindir}/python%{pyshortver} +%endif +%{_bindir}/python%{pybasever} +%{_bindir}/python%{pybasever}m +%{_bindir}/pyvenv-%{pybasever} +%{_mandir}/*/* + + +%if %{without flatpackage} %files libs %defattr(-,root,root,-) %license LICENSE %doc README.rst +%endif %dir %{pylibdir} %dir %{dynload_dir} %{pylibdir}/lib2to3 +%if %{without flatpackage} %exclude %{pylibdir}/lib2to3/tests +%endif %dir %{pylibdir}/unittest/ %dir %{pylibdir}/unittest/__pycache__/ @@ -1151,7 +1238,13 @@ fi %dir %{pylibdir}/ensurepip/__pycache__/ %{pylibdir}/ensurepip/*.py %{pylibdir}/ensurepip/__pycache__/*%{bytecode_suffixes} + +%if %{without flatpackage} %exclude %{pylibdir}/ensurepip/_bundled +%else +%dir %{pylibdir}/ensurepip/_bundled +%{pylibdir}/ensurepip/_bundled/*.whl +%endif %if %{with rewheel} %dir %{pylibdir}/ensurepip/rewheel/ @@ -1314,8 +1407,10 @@ fi %{pylibdir}/sqlite3/*.py %{pylibdir}/sqlite3/__pycache__/*%{bytecode_suffixes} +%if %{without flatpackage} %exclude %{pylibdir}/turtle.py %exclude %{pylibdir}/__pycache__/turtle*%{bytecode_suffixes} +%endif %{pylibdir}/urllib %{pylibdir}/xml @@ -1335,7 +1430,9 @@ fi %{_includedir}/python%{LDVERSION_optimized}/%{_pyconfig_h} %{_libdir}/%{py_INSTSONAME_optimized} +%if %{without flatpackage} %{_libdir}/libpython3.so +%endif %if %{with systemtap} %dir %(dirname %{tapsetdir}) %dir %{tapsetdir} @@ -1343,42 +1440,66 @@ fi %doc systemtap-example.stp pyfuntop.stp %endif + +%if %{without flatpackage} %files devel %defattr(-,root,root) +%endif + %{pylibdir}/config-%{LDVERSION_optimized}-%{_arch}-linux%{_gnu}/* +%if %{without flatpackage} %exclude %{pylibdir}/config-%{LDVERSION_optimized}-%{_arch}-linux%{_gnu}/Makefile +%exclude %{_includedir}/python%{LDVERSION_optimized}/%{_pyconfig_h} +%endif %{pylibdir}/distutils/command/wininst-*.exe %{_includedir}/python%{LDVERSION_optimized}/*.h -%exclude %{_includedir}/python%{LDVERSION_optimized}/%{_pyconfig_h} %doc Misc/README.valgrind Misc/valgrind-python.supp Misc/gdbinit + +%if %{without flatpackage} %{_bindir}/python3-config +%{_libdir}/pkgconfig/python3.pc +%{_rpmconfigdir}/macros.d/macros.systempython +%{_bindir}/pathfix.py +%endif + %{_bindir}/python%{pybasever}-config %{_bindir}/python%{LDVERSION_optimized}-config %{_bindir}/python%{LDVERSION_optimized}-*-config -%{_bindir}/pathfix.py %{_libdir}/libpython%{LDVERSION_optimized}.so %{_libdir}/pkgconfig/python-%{LDVERSION_optimized}.pc %{_libdir}/pkgconfig/python-%{pybasever}.pc -%{_libdir}/pkgconfig/python3.pc %{_rpmconfigdir}/macros.d/macros.pybytecompile%{pybasever} -%{_rpmconfigdir}/macros.d/macros.systempython + +%if %{without flatpackage} %files tools %defattr(-,root,root,755) + %{_bindir}/2to3 +%{_bindir}/idle* +%else +%{_bindir}/idle%{pybasever} +%endif + # TODO: Remove 2to3-3.7 once rebased to 3.7 %{_bindir}/2to3-%{pybasever} -%{_bindir}/idle* %{pylibdir}/Tools %doc %{pylibdir}/Doc +%if %{without flatpackage} %{_datadir}/appdata/idle3.appdata.xml %{_datadir}/applications/idle3.desktop %{_datadir}/icons/hicolor/*/apps/idle3.* +%endif +%if %{without flatpackage} %files tkinter %defattr(-,root,root,755) +%endif + %{pylibdir}/tkinter +%if %{without flatpackage} %exclude %{pylibdir}/tkinter/test +%endif %{dynload_dir}/_tkinter.%{SOABI_optimized}.so %{pylibdir}/turtle.py %{pylibdir}/__pycache__/turtle*%{bytecode_suffixes} @@ -1388,8 +1509,12 @@ fi %dir %{pylibdir}/turtledemo/__pycache__/ %{pylibdir}/turtledemo/__pycache__/*%{bytecode_suffixes} + +%if %{without flatpackage} %files test %defattr(-, root, root) +%endif + %{pylibdir}/ctypes/test %{pylibdir}/distutils/tests %{pylibdir}/sqlite3/test @@ -1411,12 +1536,14 @@ fi # all of the other subpackages %if %{with debug_build} +%if %{without flatpackage} %files debug %defattr(-,root,root,-) +%{_bindir}/python3-debug +%endif # Analog of the core subpackage's files: %{_bindir}/python%{LDVERSION_debug} -%{_bindir}/python3-debug # Analog of the -libs subpackage's files: # ...with debug builds of the built-in "extension" modules: From 08796195b5a2a3f3d957c607783948d306985278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 30 Nov 2017 16:47:53 +0100 Subject: [PATCH 416/416] Remove /usr/bin/2to3-3.7 --- python3.spec | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python3.spec b/python3.spec index ea90da0..be00616 100644 --- a/python3.spec +++ b/python3.spec @@ -1072,6 +1072,10 @@ for Module in %{buildroot}/%{dynload_dir}/*.so ; do esac done +# There's no point of having this, as decided in +# https://bugzilla.redhat.com/show_bug.cgi?id=1111275 +rm %{buildroot}%{_bindir}/2to3-%{pybasever} + %if %{with flatpackage} # Remove stuff that would conflict with python3 package mv %{buildroot}%{_bindir}/python{3,%{pyshortver}} @@ -1481,8 +1485,6 @@ fi %{_bindir}/idle%{pybasever} %endif -# TODO: Remove 2to3-3.7 once rebased to 3.7 -%{_bindir}/2to3-%{pybasever} %{pylibdir}/Tools %doc %{pylibdir}/Doc %if %{without flatpackage}