[cleanup] Remove unused patches

This commit is contained in:
Robert Kuska 2015-12-14 13:34:09 +01:00
parent e769a59396
commit 7883cb72b0
17 changed files with 0 additions and 1187 deletions

View File

@ -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):

View File

@ -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)

View File

@ -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]

View File

@ -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)));]], [[]])
],[

View File

@ -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():

View File

@ -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:

View File

@ -1,42 +0,0 @@
# HG changeset patch
# User Benjamin Peterson <benjamin@python.org>
# 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);

View File

@ -1,65 +0,0 @@
# HG changeset patch
# User Brett Cannon <brett@python.org>
# 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)

View File

@ -1,41 +0,0 @@
# HG changeset patch
# User Victor Stinner <victor.stinner@gmail.com>
# 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,

View File

@ -1,49 +0,0 @@
# HG changeset patch
# User Benjamin Peterson <benjamin@python.org>
# 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)

View File

@ -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;

View File

@ -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")

View File

@ -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"

View File

@ -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)

View File

@ -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)

View File

@ -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"

View File

@ -247,10 +247,6 @@ Source8: check-pyc-and-pyo-timestamps.py
# Was Patch0 in ivazquez' python3000 specfile: # Was Patch0 in ivazquez' python3000 specfile:
Patch1: Python-3.1.1-rpath.patch 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 # # 00055 #
# Systemtap support: add statically-defined probe points # Systemtap support: add statically-defined probe points
# Patch sent upstream as http://bugs.python.org/issue14776 # 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 # Downstream only: not appropriate for upstream
Patch111: 00111-no-static-lib.patch 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 # # 00113 #
# Add configure-time support for the COUNT_ALLOCS and CALL_PROFILE options # Add configure-time support for the COUNT_ALLOCS and CALL_PROFILE options
# described at http://svn.python.org/projects/python/trunk/Misc/SpecialBuilds.txt # 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 # Not yet sent upstream
Patch113: 00113-more-configuration-flags.patch Patch113: 00113-more-configuration-flags.patch
# 00114 #
# Upstream as of Python 3.4.0.b2
# Patch114: 00114-statvfs-f_flag-constants.patch
# 00125 # # 00125 #
# COUNT_ALLOCS is useful for debugging, but the upstream behaviour of always # 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 # 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 # Not yet sent upstream
Patch125: 00125-less-verbose-COUNT_ALLOCS.patch 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 # # 00131 #
# The four tests in test_io built on top of check_interrupted_write_retry # 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 # 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 # Not yet sent upstream
Patch135: 00135-fix-test-within-test_weakref-in-debug-build.patch 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 # # 00137 #
# Some tests within distutils fail when run in an rpmbuild: # Some tests within distutils fail when run in an rpmbuild:
Patch137: 00137-skip-distutils-tests-that-fail-in-rpmbuild.patch 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 # # 00139 #
# ARM-specific: skip known failure in test_float: # ARM-specific: skip known failure in test_float:
# http://bugs.python.org/issue8265 (rhbz#706253) # 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 # ideally short lived patch disabling a test thats fragile on different arches
Patch140: python3-arm-skip-failing-fragile-test.patch 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 # # 00141 #
# Fix tests for case when tests for case when configured with # Fix tests for case when tests for case when configured with
# COUNT_ALLOCS (debug build): http://bugs.python.org/issue19527 # 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 # Sent upstream as http://bugs.python.org/issue12872
Patch143: 00143-tsc-on-ppc.patch 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 # # 00146 #
# Support OpenSSL FIPS mode (e.g. when OPENSSL_FORCE_FIPS_MODE=1 is set) # 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 # - 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. # implementation and OpenSSL still doesn't support it. For now, they're harmless.
Patch146: 00146-hashlib-fips.patch 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 # # 00150 #
# temporarily disable rAssertAlmostEqual in test_cmath on PPC (bz #750811) # 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 # 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 # http://sourceware.org/bugzilla/show_bug.cgi?id=13472
Patch150: 00150-disable-rAssertAlmostEqual-cmath-on-ppc.patch 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 # # 00155 #
# Avoid allocating thunks in ctypes unless absolutely necessary, to avoid # Avoid allocating thunks in ctypes unless absolutely necessary, to avoid
# generating SELinux denials on "import ctypes" and "import uuid" when # generating SELinux denials on "import ctypes" and "import uuid" when
# embedding Python within httpd (rhbz#814391) # embedding Python within httpd (rhbz#814391)
Patch155: 00155-avoid-ctypes-thunks.patch 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 # # 00157 #
# Update uid/gid handling throughout the standard library: uid_t and gid_t are # 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 # 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) # (rhbz#697470)
Patch157: 00157-uid-gid-overflows.patch 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 # # 00160 #
# Python 3.3 added os.SEEK_DATA and os.SEEK_HOLE, which may be present in the # 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 # 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 # Not yet sent upstream
Patch160: 00160-disable-test_fs_holes-in-rpm-build.patch 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 # # 00163 #
# Some tests within test_socket fail intermittently when run inside Koji; # Some tests within test_socket fail intermittently when run inside Koji;
# disable them using unittest._skipInRpmBuild # 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 # disable those tests so that rebuilds on PPC can continue
Patch164: 00164-disable-interrupted_write-tests-on-ppc.patch 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 # # 00170 #
# In debug builds, try to print repr() when a C-level assert fails in the # In debug builds, try to print repr() when a C-level assert fails in the
# garbage collector (typically indicating a reference-counting error # garbage collector (typically indicating a reference-counting error
@ -551,37 +429,11 @@ Patch164: 00164-disable-interrupted_write-tests-on-ppc.patch
# (rhbz#850013 # (rhbz#850013
Patch170: 00170-gc-assertions.patch 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 # # 00173 #
# Workaround for ENOPROTOOPT seen in Koji withi test.support.bind_port() # Workaround for ENOPROTOOPT seen in Koji withi test.support.bind_port()
# (rhbz#913732) # (rhbz#913732)
Patch173: 00173-workaround-ENOPROTOOPT-in-bind_port.patch 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 # # 00178 #
# Don't duplicate various FLAGS in sysconfig values # Don't duplicate various FLAGS in sysconfig values
# http://bugs.python.org/issue17679 # 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 # Not appropriate for upstream, Fedora-specific naming
Patch180: 00180-python-add-support-for-ppc64p7.patch 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 # # 00184 #
# Fix for https://bugzilla.redhat.com/show_bug.cgi?id=979696 # Fix for https://bugzilla.redhat.com/show_bug.cgi?id=979696
# Fixes build of ctypes against libffi with multilib wrapper # 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" # We patch this by also accepting "#define ffi_wrapper_h"
Patch184: 00184-ctypes-should-build-with-libffi-multilib-wrapper.patch 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 # # 00186 #
# Fix for https://bugzilla.redhat.com/show_bug.cgi?id=1023607 # Fix for https://bugzilla.redhat.com/show_bug.cgi?id=1023607
# Previously, this fixed a problem where some *.py files were not being # 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 # This was fixed upstream, but the test hasn't been merged yet, so we keep it
Patch186: 00186-dont-raise-from-py_compile.patch Patch186: 00186-dont-raise-from-py_compile.patch
# 00187 #
# Fixed upstream as of Python 3.4.0b1
# Patch187: 00187-remove-pthread-atfork.patch
# 00188 # # 00188 #
# Downstream only patch that should be removed when we compile all guaranteed # Downstream only patch that should be removed when we compile all guaranteed
# hashlib algorithms properly. The problem is this: # 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 Patch189: 00189-add-rewheel-module.patch
%endif %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 # Tests requiring SIGHUP to work don't work in Koji
# see rhbz#1088233 # see rhbz#1088233
Patch194: temporarily-disable-tests-requiring-SIGHUP.patch 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 # 00196
# #
# Fix test_gdb failure on ppc64le # Fix test_gdb failure on ppc64le
Patch196: 00196-test-gdb-match-addr-before-builtin.patch 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 # OpenSSL disabled SSLv3 in SSLv23 method
# This patch alters python tests to reflect this change # This patch alters python tests to reflect this change
# Issue: http://bugs.python.org/issue22638 Upstream discussion about SSLv3 in Python # 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 # Note: Backported from scl
Patch201: 00201-fix-memory-leak-in-gdbm.patch 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 # test_threading fails in koji dues to it's handling of signals
Patch203: 00203-disable-threading-test-koji.patch 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 # LIBPL variable in makefile takes LIBPL from configure.ac
# but the LIBPL variable defined there doesn't respect libdir macro # but the LIBPL variable defined there doesn't respect libdir macro
Patch205: 00205-make-libpl-respect-lib64.patch 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: # Apply patches:
# #
%patch1 -p1 %patch1 -p1
# 3: upstream as of Python 3.3.1
%if 0%{?with_systemtap} %if 0%{?with_systemtap}
%patch55 -p1 -b .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 %patch111 -p1
# 112: not for python3
%patch113 -p1 %patch113 -p1
# 00114: Upstream as of Python 3.4.0.b2
%patch125 -p1 -b .less-verbose-COUNT_ALLOCS %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 %endif
%patch132 -p1 %patch132 -p1
# 00133: not for python3
%patch134 -p1 %patch134 -p1
%patch135 -p1 %patch135 -p1
# 00136: not for python3
%patch137 -p1 %patch137 -p1
# 00138: not for python3
%ifarch %{arm} %ifarch %{arm}
%patch139 -p1 %patch139 -p1
%patch140 -p1 %patch140 -p1
%endif %endif
# 00140: not for python3
%patch141 -p1 %patch141 -p1
%patch143 -p1 -b .tsc-on-ppc %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
%ifarch ppc %{power64} %ifarch ppc %{power64}
%patch150 -p1 %patch150 -p1
%endif %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 %patch155 -p1
# 00156: upstream as of 3.4.3
%patch157 -p1 %patch157 -p1
#00158: FIXME
#00159: FIXME
%patch160 -p1 %patch160 -p1
# 00161: was only needed for Python 3.3.0b1
# 00162: was only needed for Python 3.3.0b1
%patch163 -p1 %patch163 -p1
%ifarch ppc %{power64} %ifarch ppc %{power64}
%patch164 -p1 %patch164 -p1
%endif %endif
#00165: TODO
#00166: TODO
#00167: TODO
#00168: TODO
#00169: TODO
#00170: TODO
#00171: TODO
#00172: TODO
%patch173 -p1 %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 %patch178 -p1
%patch179 -p1 %patch179 -p1
%patch180 -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 %patch184 -p1
# 00185 upstream as of Python 3.4.0a4
%patch186 -p1 %patch186 -p1
# 00187: upstream as of Python 3.4.0b1
%patch188 -p1 %patch188 -p1
%if 0%{with_rewheel} %if 0%{with_rewheel}
%patch189 -p1 %patch189 -p1
%endif %endif
# 00190: upstream as of Python 3.4.1
# 00193: upstream as of Python 3.4.1
%patch194 -p1 %patch194 -p1
# 00195: upstream as of Python 3.4.2
%patch196 -p1 %patch196 -p1
# 00197: upstream as of Python 3.4.2
%patch199 -p1 %patch199 -p1
# 00202: upstream as of 3.5.0b3
%patch203 -p1 %patch203 -p1
# 00204: upstream as of 3.5.0b3
%patch205 -p1 %patch205 -p1
%patch206 -p1 %patch206 -p1
%patch207 -p1 %patch207 -p1