Compare commits

...

15 Commits
master ... f26

Author SHA1 Message Date
Miro Hrončok 30f9dc6ace Fix broken SSL module (#1555081) 2018-03-14 14:08:55 +01:00
Charalampos Stratakis b3ef145e9d Do not send IP addresses in SNI TLS extension 2018-03-13 18:20:30 +01:00
Miro Hrončok f82502dfc9 Move test.support and test.script_helper to python2-libs
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1528899

When moving files around, explicit conflicts should be added, however
the dependency chain here (python2-test requires exact version-release of
python2, python2 requires exact version-release of python2-libs) prevents
instalation of python2-libs with greater version-release than python2-test.
2018-02-17 11:31:31 +01:00
Charalampos Stratakis 204fab2df4 Fix hanging of all threads when trying to access an inaccessible NFS server.
Also mask some macros in comments.
2017-12-11 15:25:49 +01:00
Miro Hrončok 34b7e5bfcb Make the -devel package require redhat-rpm-config
Resolves: rhbz#1496757
2017-11-10 14:09:13 +01:00
Charalampos Stratakis b9637a682d Fix nondeterministic read in test_pty 2017-11-02 16:47:18 +01:00
Charalampos Stratakis 1279ca3068 Add a new PYTHONSHOWREFCOUNT environment variable which when set
prints the number of references when using the debug build.
2017-11-02 16:47:10 +01:00
Iryna Shcherbina a8ced1c5b0 Add patches for failing tests
- Replace COUNT_ALLOCS patches with upstreamed one
  (patches added: 283; patches removed: 125, 134, 135, 141)
  https://bugs.python.org/issue31692
- Add a patch to skip a failing test on s390x: 280
  https://bugs.python.org/issue31719
2017-10-31 15:23:59 +01:00
Iryna Shcherbina f50e49e7fb Update to 2.7.14
- Refactored patches: 55, 112, 153
- Upstreamed patches: 250, 269, 270
2017-10-31 15:23:45 +01:00
Carl George 5d23a875c3 drop patch 173
This was resolved upstream in 3.3/3.4.  The fix was later backported to 2.7.7rc1.

https://bugs.python.org/issue19901
d82634d606
https://github.com/python/cpython/blob/2.7/Misc/NEWS.d/2.7.7rc1.rst
2017-10-31 15:22:07 +01:00
Michal Cyprian 15f65c3dc8 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 8043ae7719.
2017-08-11 09:45:26 +02:00
Charalampos Stratakis e000835995 Provide additional reference for patch 252 2017-06-28 15:51:02 +02:00
Charalampos Stratakis 4880661991 Fix test_alpn_protocols from test_ssl 2017-06-26 11:54:20 +02:00
Miro Hrončok 2187e4186e Change fixed Obsoletes version with a dynamic one (rhbz#1457336) 2017-05-31 19:35:22 +02:00
Karsten Hopp 0268e32375 revert logic for modularity patch and enable gdbm for modularity 2017-05-18 14:15:22 +02:00
20 changed files with 787 additions and 309 deletions

View File

@ -87,9 +87,9 @@ diff -up Python-2.7rc1/Makefile.pre.in.systemtap Python-2.7rc1/Makefile.pre.in
@@ -1251,7 +1264,7 @@ Python/thread.o: @THREADHEADERS@
.PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
.PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
.PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean
-.PHONY: smelly funny patchcheck touch altmaninstall commoninstall
+.PHONY: smelly funny patchcheck touch altmaninstall commoninstall buildinclude
.PHONY: frameworkaltinstallunixtools recheck clean clobber distclean
-.PHONY: smelly funny patchcheck altmaninstall commoninstall
+.PHONY: smelly funny patchcheck altmaninstall commoninstall buildinclude
.PHONY: gdbhooks
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY

View File

@ -118,8 +118,8 @@ index 997a2fc..467e782 100644
+PYTHON= python$(DEBUG_SUFFIX)$(EXE)
+BUILDPYTHON= python$(DEBUG_SUFFIX)$(BUILDEXE)
PYTHON_FOR_REGEN=@PYTHON_FOR_REGEN@
PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@
_PYTHON_HOST_PLATFORM=@_PYTHON_HOST_PLATFORM@
@@ -547,7 +553,7 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o
_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
@ -194,8 +194,8 @@ index 997a2fc..467e782 100644
# pkgconfig directory
LIBPC= $(LIBDIR)/pkgconfig
-libainstall: all python-config
+libainstall: all python$(DEBUG_SUFFIX)-config
-libainstall: @DEF_MAKE_RULE@ python-config
+libainstall: @DEF_MAKE_RULE@ python$(DEBUG_SUFFIX)-config
@for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \
do \
if test ! -d $(DESTDIR)$$i; then \

View File

@ -1,20 +0,0 @@
diff -up Python-2.7/Python/pythonrun.c.less-verbose-COUNT_ALLOCS Python-2.7/Python/pythonrun.c
--- Python-2.7/Python/pythonrun.c.less-verbose-COUNT_ALLOCS 2010-08-17 14:49:33.321913909 -0400
+++ Python-2.7/Python/pythonrun.c 2010-08-17 14:54:48.750910403 -0400
@@ -470,7 +470,15 @@ Py_Finalize(void)
/* Debugging stuff */
#ifdef COUNT_ALLOCS
- dump_counts(stdout);
+ /* This is a downstream Fedora modification.
+ The upstream default with COUNT_ALLOCS is to always dump the counts to
+ stdout on exit. For our debug builds its useful to have the info from
+ COUNT_ALLOCS available, but the stdout info here gets in the way, so
+ we make it optional, wrapping it in an environment variable (modelled
+ on the other PYTHONDUMP* env variables):
+ */
+ if (Py_GETENV("PYTHONDUMPCOUNTS"))
+ dump_counts(stdout);
#endif
PRINT_TOTAL_REFS();

View File

@ -1,16 +0,0 @@
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
index 0dd4258..d9b3267 100644
--- a/Lib/test/test_sys.py
+++ b/Lib/test/test_sys.py
@@ -769,6 +769,11 @@ class SizeofTest(unittest.TestCase):
'10P' # PySequenceMethods
'6P' # PyBufferProcs
'2P')
+
+ # COUNT_ALLOCS adds further fields to the end of a PyTypeObject:
+ if hasattr(sys, 'getcounts'):
+ s += size('P')
+
class newstyleclass(object):
pass
check(newstyleclass, s)

View File

@ -1,18 +0,0 @@
diff -up Python-2.7.2/Lib/test/test_weakref.py.skip-test-within-test_weakref-in-debug-build Python-2.7.2/Lib/test/test_weakref.py
--- Python-2.7.2/Lib/test/test_weakref.py.skip-test-within-test_weakref-in-debug-build 2011-09-08 17:55:09.675392260 -0400
+++ Python-2.7.2/Lib/test/test_weakref.py 2011-09-08 17:59:08.857375903 -0400
@@ -550,6 +550,14 @@ class ReferencesTestCase(TestBase):
del c1, c2, C, D
gc.collect()
+ # In a debug build, this fails with:
+ # AssertionError: Lists differ: [] != ['C went away']
+ # Second list contains 1 additional elements.
+ # First extra element 0:
+ # C went away
+ # - []
+ # + ['C went away']
+ @unittest.skipIf(hasattr(sys, 'getobjects'), 'debug build')
def test_callback_in_cycle_resurrection(self):
import gc

View File

@ -1,24 +0,0 @@
diff -up Python-2.7.2/Lib/test/test_gc.py.fix-test_gc_with_COUNT_ALLOCS Python-2.7.2/Lib/test/test_gc.py
--- Python-2.7.2/Lib/test/test_gc.py.fix-test_gc_with_COUNT_ALLOCS 2011-09-08 19:49:13.045924309 -0400
+++ Python-2.7.2/Lib/test/test_gc.py 2011-09-08 19:50:07.035920617 -0400
@@ -102,11 +102,17 @@ class GCTests(unittest.TestCase):
del a
self.assertNotEqual(gc.collect(), 0)
del B, C
- self.assertNotEqual(gc.collect(), 0)
+ if hasattr(sys, 'getcounts'):
+ self.assertEqual(gc.collect(), 0)
+ else:
+ self.assertNotEqual(gc.collect(), 0)
A.a = A()
del A
- self.assertNotEqual(gc.collect(), 0)
- self.assertEqual(gc.collect(), 0)
+ if hasattr(sys, 'getcounts'):
+ self.assertEqual(gc.collect(), 0)
+ else:
+ self.assertNotEqual(gc.collect(), 0)
+ self.assertEqual(gc.collect(), 0)
def test_method(self):
# Tricky: self.__init__ is a bound method, it references the instance.

View File

@ -1,13 +1,13 @@
--- Lib/test/test_gdb.py.old 2012-04-11 21:04:01.367073855 -0400
+++ Lib/test/test_gdb.py 2012-04-12 08:52:58.320288761 -0400
@@ -144,6 +153,10 @@
'Missing separate debuginfo for ',
'Try: zypper install -C ',
@@ -211,6 +211,10 @@
# ignore all warnings
'warning: ',
)
+ ignore_patterns += ('warning: Unable to open',
+ 'Missing separate debuginfo for',
+ 'Try: yum --disablerepo=',
+ 'Undefined set print command')
for line in errlines:
if not line.startswith(ignore_patterns):
unexpected_errlines.append(line)
if not line:
continue

View File

@ -1,14 +0,0 @@
diff -up Python-2.7.3/Lib/test/test_support.py.rhbz913732 Python-2.7.3/Lib/test/test_support.py
--- Python-2.7.3/Lib/test/test_support.py.rhbz913732 2013-03-04 16:11:53.757315921 -0500
+++ Python-2.7.3/Lib/test/test_support.py 2013-03-04 16:12:11.331314722 -0500
@@ -304,7 +304,8 @@ def bind_port(sock, host=HOST):
if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR) == 1:
raise TestFailed("tests should never set the SO_REUSEADDR " \
"socket option on TCP/IP sockets!")
- if hasattr(socket, 'SO_REUSEPORT'):
+ if hasattr(socket, 'SO_REUSEPORT') \
+ and 'WITHIN_PYTHON_RPM_BUILD' not in os.environ: # rhbz#913732
try:
if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) == 1:
raise TestFailed("tests should never set the SO_REUSEPORT " \
"socket option on TCP/IP sockets!")

View File

@ -1,22 +0,0 @@
diff --git a/Python/random.c b/Python/random.c
index 2f83b5d..4cae217 100644
--- a/Python/random.c
+++ b/Python/random.c
@@ -97,8 +97,15 @@ win32_urandom(unsigned char *buffer, Py_ssize_t size, int raise)
}
/* Issue #25003: Don't use getentropy() on Solaris (available since
- * Solaris 11.3), it is blocking whereas os.urandom() should not block. */
-#elif defined(HAVE_GETENTROPY) && !defined(sun)
+ Solaris 11.3), it is blocking whereas os.urandom() should not block.
+
+ Issue #29188: Don't use getentropy() on Linux since the glibc 2.24
+ implements it with the getrandom() syscall which can fail with ENOSYS,
+ and this error is not supported in py_getentropy() and getrandom() is called
+ with flags=0 which blocks until system urandom is initialized, which is not
+ the desired behaviour to seed the Python hash secret nor for os.urandom():
+ see the PEP 524 which was only implemented in Python 3.6. */
+#elif defined(HAVE_GETENTROPY) && !defined(sun) && !defined(linux)
#define PY_GETENTROPY 1
/* Fill buffer with size pseudo-random bytes generated by getentropy().

View File

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

View File

@ -1,63 +0,0 @@
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 9e4be0a..a58b59c 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -863,12 +863,12 @@ $(LIBRARY_OBJS) $(MODOBJS) Modules/python.o: $(PYTHON_HEADERS)
TESTOPTS= -l $(EXTRATESTOPTS)
TESTPROG= $(srcdir)/Lib/test/regrtest.py
TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS)
-test: all platform
+test: @DEF_MAKE_RULE@ platform
-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
-$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
-testall: all platform
+testall: @DEF_MAKE_RULE@ platform
-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
$(TESTPYTHON) $(srcdir)/Lib/compileall.py
-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
@@ -877,7 +877,7 @@ testall: all platform
# Run the unitests for both architectures in a Universal build on OSX
# Must be run on an Intel box.
-testuniversal: all platform
+testuniversal: @DEF_MAKE_RULE@ platform
if [ `arch` != 'i386' ];then \
echo "This can only be used on OSX/i386" ;\
exit 1 ;\
@@ -900,14 +900,14 @@ QUICKTESTOPTS= $(TESTOPTS) -x test_subprocess test_io test_lib2to3 \
test_multibytecodec test_urllib2_localnet test_itertools \
test_multiprocessing test_mailbox test_socket test_poll \
test_select test_zipfile
-quicktest: all platform
+quicktest: @DEF_MAKE_RULE@ platform
-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
-$(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
$(TESTPYTHON) $(TESTPROG) $(QUICKTESTOPTS)
MEMTESTOPTS= $(QUICKTESTOPTS) -x test_dl test___all__ test_fork1 \
test_longexp
-memtest: all platform
+memtest: @DEF_MAKE_RULE@ platform
-rm -f $(srcdir)/Lib/test/*.py[co]
-$(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
$(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
@@ -1198,7 +1198,7 @@ LIBPL= $(LIBP)/config$(DEBUG_SUFFIX)
# pkgconfig directory
LIBPC= $(LIBDIR)/pkgconfig
-libainstall: all python$(DEBUG_SUFFIX)-config
+libainstall: @DEF_MAKE_RULE@ python$(DEBUG_SUFFIX)-config
@for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \
do \
if test ! -d $(DESTDIR)$$i; then \
@@ -1425,7 +1425,7 @@ distclean: clobber
-exec rm -f {} ';'
# Check for smelly exported symbols (not starting with Py/_Py)
-smelly: all
+smelly: @DEF_MAKE_RULE@
nm -p $(LIBRARY) | \
sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \

View File

@ -0,0 +1,88 @@
From ab35adc682ec51800aa19a77de9947c6aaa50f41 Mon Sep 17 00:00:00 2001
From: Victor Stinner <victor.stinner@gmail.com>
Date: Fri, 6 Oct 2017 22:28:59 +0200
Subject: [PATCH] bpo-31719: Fix test_regrtest.test_crashed() on s390x
Add a new _testcapi._read_null() function to crash Python in a
reliable way on s390x.
On s390x, ctypes.string_at(0) returns an empty string rather than
crashing.
---
Lib/test/support/__init__.py | 4 ++--
Lib/test/test_regrtest.py | 2 ++
.../next/Tests/2017-10-06-22-37-38.bpo-31719.gHyrV3.rst | 3 +++
Modules/_testcapimodule.c | 17 +++++++++++++++++
4 files changed, 24 insertions(+), 2 deletions(-)
create mode 100644 Misc/NEWS.d/next/Tests/2017-10-06-22-37-38.bpo-31719.gHyrV3.rst
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index ef474e00b68..25df3ed0c41 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -1960,6 +1960,6 @@ def _crash_python():
Use SuppressCrashReport() to prevent a crash report from popping up.
"""
- import ctypes
+ import _testcapi
with SuppressCrashReport():
- ctypes.string_at(0)
+ _testcapi._read_null()
diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
index 264c74d22ba..aae274384c7 100644
--- a/Lib/test/test_regrtest.py
+++ b/Lib/test/test_regrtest.py
@@ -543,6 +543,8 @@ def test_method2(self):
testname)
self.assertEqual(output.splitlines(), all_methods)
+ @unittest.skipIf(sys.platform.startswith('aix'),
+ "support._crash_python() doesn't work on AIX")
def test_crashed(self):
# Any code which causes a crash
code = 'import test.support; test.support._crash_python()'
diff --git a/Misc/NEWS.d/next/Tests/2017-10-06-22-37-38.bpo-31719.gHyrV3.rst b/Misc/NEWS.d/next/Tests/2017-10-06-22-37-38.bpo-31719.gHyrV3.rst
new file mode 100644
index 00000000000..a06c5267251
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2017-10-06-22-37-38.bpo-31719.gHyrV3.rst
@@ -0,0 +1,3 @@
+Fix test_regrtest.test_crashed() on s390x. Add a new _testcapi._read_null()
+function to crash Python in a reliable way on s390x. On s390x,
+ctypes.string_at(0) returns an empty string rather than crashing.
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index 7691b5188ff..5902de07823 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -2566,6 +2566,22 @@ py_w_stopcode(PyObject *self, PyObject *args)
#endif
+/* Read memory from NULL (address 0) to raise a SIGSEGV or SIGBUS signal
+ depending on the platform. This function is used by
+ test.support._crash_python() to "crash" Python. */
+static PyObject *
+read_null(PyObject *self, PyObject *args)
+{
+ volatile int *x;
+ volatile int y;
+
+ x = NULL;
+ y = *x;
+ return PyLong_FromLong(y);
+
+}
+
+
static PyMethodDef TestMethods[] = {
{"raise_exception", raise_exception, METH_VARARGS},
{"set_errno", set_errno, METH_VARARGS},
@@ -2685,6 +2701,7 @@ static PyMethodDef TestMethods[] = {
#ifdef W_STOPCODE
{"W_STOPCODE", py_w_stopcode, METH_VARARGS},
#endif
+ {"_read_null", (PyCFunction)read_null, METH_NOARGS},
{NULL, NULL} /* sentinel */
};

View File

@ -0,0 +1,184 @@
From 7b4ba62e388474e811268322b47f80d464933541 Mon Sep 17 00:00:00 2001
From: Victor Stinner <victor.stinner@gmail.com>
Date: Tue, 17 Oct 2017 02:25:23 -0700
Subject: [PATCH] [2.7] bpo-31692: Add PYTHONSHOWALLOCCOUNT env var (GH-3927)
bpo-31692, bpo-19527:
* Add a new PYTHONSHOWALLOCCOUNT environment variable, similar to
the Python 3 "-X showalloccount" option
* When Python is compiled with COUNT_ALLOCS, the new
PYTHONSHOWALLOCCOUNT environment variable now has to be set to dump
allocation counts into stderr on shutdown. Moreover, allocations
statistics are now dumped into stderr rather than stdout.
* Add @test.support.requires_type_collecting decorator: skip test if
COUNT_ALLOCS is defined
* Fix tests for COUNT_ALLOCS: decorate some methods with
@requires_type_collecting
* test_sys.test_objecttypes(): update object type when COUNT_ALLOCS
is defined
---
Doc/c-api/typeobj.rst | 2 +-
Doc/using/cmdline.rst | 7 +++++++
Lib/test/support/__init__.py | 3 +++
Lib/test/test_abc.py | 1 +
Lib/test/test_gc.py | 4 +++-
Lib/test/test_regrtest.py | 1 +
Lib/test/test_sys.py | 5 ++++-
Lib/test/test_weakref.py | 1 +
.../Core and Builtins/2017-10-09-11-03-13.bpo-31692.5-bpdk.rst | 4 ++++
Python/pythonrun.c | 4 +++-
10 files changed, 28 insertions(+), 4 deletions(-)
create mode 100644 Misc/NEWS.d/next/Core and Builtins/2017-10-09-11-03-13.bpo-31692.5-bpdk.rst
diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst
index 18edcdd7e5a..f0ccf2ea5fe 100644
--- a/Doc/c-api/typeobj.rst
+++ b/Doc/c-api/typeobj.rst
@@ -1101,7 +1101,7 @@ The next fields, up to and including :c:member:`~PyTypeObject.tp_weaklist`, only
The remaining fields are only defined if the feature test macro
:const:`COUNT_ALLOCS` is defined, and are for internal use only. They are
documented here for completeness. None of these fields are inherited by
-subtypes.
+subtypes. See the :envvar:`PYTHONSHOWALLOCCOUNT` environment variable.
.. c:member:: Py_ssize_t PyTypeObject.tp_allocs
diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst
index f00f7f6026a..55bc12893d6 100644
--- a/Doc/using/cmdline.rst
+++ b/Doc/using/cmdline.rst
@@ -663,3 +663,10 @@ if Python was configured with the ``--with-pydebug`` build option.
If set, Python will print memory allocation statistics every time a new
object arena is created, and on shutdown.
+
+.. envvar:: PYTHONSHOWALLOCCOUNT
+
+ If set and Python was compiled with ``COUNT_ALLOCS`` defined, Python will
+ dump allocations counts into stderr on shutdown.
+
+ .. versionadded:: 2.7.15
diff --git a/Doc/whatsnew/2.7.rst b/Doc/whatsnew/2.7.rst
index 28a8d4b..f0d2428 100644
--- a/Doc/whatsnew/2.7.rst
+++ b/Doc/whatsnew/2.7.rst
@@ -2540,6 +2540,17 @@ exemption allowing new ``-3`` warnings to be added in any Python 2.7
maintenance release.
+Two new environment variables for debug mode
+--------------------------------------------
+
+When Python is compiled with ``COUNT_ALLOC`` defined, allocation counts are no
+longer dumped by default anymore: the :envvar:`PYTHONSHOWALLOCCOUNT` environment
+variable must now also be set. Moreover, allocation counts are now dumped into
+stderr, rather than stdout. (Contributed by Victor Stinner; :issue:`31692`.)
+
+.. versionadded:: 2.7.15
+
+
PEP 434: IDLE Enhancement Exception for All Branches
----------------------------------------------------
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index 25df3ed0c41..d14a6620b5d 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -1795,6 +1795,9 @@ def py3k_bytes(b):
except TypeError:
return bytes(b)
+requires_type_collecting = unittest.skipIf(hasattr(sys, 'getcounts'),
+ 'types are immortal if COUNT_ALLOCS is defined')
+
def args_from_interpreter_flags():
"""Return a list of command-line arguments reproducing the current
settings in sys.flags."""
diff --git a/Lib/test/test_abc.py b/Lib/test/test_abc.py
index 6a8c3a13274..dbba37cdb6f 100644
--- a/Lib/test/test_abc.py
+++ b/Lib/test/test_abc.py
@@ -208,6 +208,7 @@ class C(A, B):
C()
self.assertEqual(B.counter, 1)
+ @test_support.requires_type_collecting
def test_cache_leak(self):
# See issue #2521.
class A(object):
diff --git a/Lib/test/test_gc.py b/Lib/test/test_gc.py
index ed01c9802fc..7e47b2d3a27 100644
--- a/Lib/test/test_gc.py
+++ b/Lib/test/test_gc.py
@@ -1,5 +1,6 @@
import unittest
-from test.test_support import verbose, run_unittest, start_threads, import_module
+from test.support import (verbose, run_unittest, start_threads, import_module,
+ requires_type_collecting)
import sys
import sysconfig
import time
@@ -90,6 +91,7 @@ class A:
del a
self.assertNotEqual(gc.collect(), 0)
+ @requires_type_collecting
def test_newinstance(self):
class A(object):
pass
diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
index aae274384c7..988a72c1099 100644
--- a/Lib/test/test_regrtest.py
+++ b/Lib/test/test_regrtest.py
@@ -493,6 +493,7 @@ def check_leak(self, code, what):
self.assertIn(line2, reflog)
@unittest.skipUnless(Py_DEBUG, 'need a debug build')
+ @support.requires_type_collecting
def test_huntrleaks(self):
# test --huntrleaks
code = textwrap.dedent("""
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
index 5baaa352c0b..9342716272a 100644
--- a/Lib/test/test_sys.py
+++ b/Lib/test/test_sys.py
@@ -748,7 +748,10 @@ def delx(self): del self.__x
# tupleiterator
check(iter(()), size('lP'))
# type
- s = vsize('P2P15Pl4PP9PP11PI' # PyTypeObject
+ fmt = 'P2P15Pl4PP9PP11PI'
+ if hasattr(sys, 'getcounts'):
+ fmt += '3P2P'
+ s = vsize(fmt + # PyTypeObject
'39P' # PyNumberMethods
'3P' # PyMappingMethods
'10P' # PySequenceMethods
diff --git a/Lib/test/test_weakref.py b/Lib/test/test_weakref.py
index 415d5ebbd72..418481dadd8 100644
--- a/Lib/test/test_weakref.py
+++ b/Lib/test/test_weakref.py
@@ -601,6 +601,7 @@ class D:
del c1, c2, C, D
gc.collect()
+ @test_support.requires_type_collecting
def test_callback_in_cycle_resurrection(self):
import gc
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 677f6e48111..44fe13d2f7d 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -488,7 +488,9 @@ Py_Finalize(void)
/* Debugging stuff */
#ifdef COUNT_ALLOCS
- dump_counts(stdout);
+ if (Py_GETENV("PYTHONSHOWALLOCCOUNT")) {
+ dump_counts(stderr);
+ }
#endif
PRINT_TOTAL_REFS();

View File

@ -0,0 +1,92 @@
diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst
index 55bc128..15d5830 100644
--- a/Doc/using/cmdline.rst
+++ b/Doc/using/cmdline.rst
@@ -664,6 +664,13 @@ if Python was configured with the ``--with-pydebug`` build option.
If set, Python will print memory allocation statistics every time a new
object arena is created, and on shutdown.
+.. envvar:: PYTHONSHOWREFCOUNT
+
+ If set, Python will print the total reference count when the program
+ finishes or after each statement in the interactive interpreter.
+
+ .. versionadded:: 2.7.15
+
.. envvar:: PYTHONSHOWALLOCCOUNT
If set and Python was compiled with ``COUNT_ALLOCS`` defined, Python will
diff --git a/Doc/whatsnew/2.7.rst b/Doc/whatsnew/2.7.rst
index f0d2428..b29593a 100644
--- a/Doc/whatsnew/2.7.rst
+++ b/Doc/whatsnew/2.7.rst
@@ -2548,6 +2548,10 @@ longer dumped by default anymore: the :envvar:`PYTHONSHOWALLOCCOUNT` environment
variable must now also be set. Moreover, allocation counts are now dumped into
stderr, rather than stdout. (Contributed by Victor Stinner; :issue:`31692`.)
+In debug mode, the ``[xxx refs]`` statistic is not written by default, the
+:envvar:`PYTHONSHOWREFCOUNT` environment variable now must also be set.
+(Contributed by Victor Stinner; :issue:`31733`.)
+
.. versionadded:: 2.7.15
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index d17f7f3..eb31e34 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -37,14 +37,6 @@
#include "windows.h"
#endif
-#ifndef Py_REF_DEBUG
-#define PRINT_TOTAL_REFS()
-#else /* Py_REF_DEBUG */
-#define PRINT_TOTAL_REFS() fprintf(stderr, \
- "[%" PY_FORMAT_SIZE_T "d refs]\n", \
- _Py_GetRefTotal())
-#endif
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -104,6 +96,21 @@ PyModule_GetWarningsModule(void)
return PyImport_ImportModule("warnings");
}
+static void
+_PyDebug_PrintTotalRefs(void)
+{
+#ifdef Py_REF_DEBUG
+ Py_ssize_t total;
+
+ if (!Py_GETENV("PYTHONSHOWREFCOUNT")) {
+ return;
+ }
+
+ total = _Py_GetRefTotal();
+ fprintf(stderr, "[%" PY_FORMAT_SIZE_T "d refs]\n", total);
+#endif
+}
+
static int initialized = 0;
/* API to access the initialized flag -- useful for esoteric use */
@@ -486,7 +493,7 @@ Py_Finalize(void)
}
#endif
- PRINT_TOTAL_REFS();
+ _PyDebug_PrintTotalRefs();
#ifdef Py_TRACE_REFS
/* Display all objects still alive -- this can invoke arbitrary
@@ -777,7 +784,7 @@ PyRun_InteractiveLoopFlags(FILE *fp, const char *filename, PyCompilerFlags *flag
}
for (;;) {
ret = PyRun_InteractiveOneFlags(fp, filename, flags);
- PRINT_TOTAL_REFS();
+ _PyDebug_PrintTotalRefs();
if (ret == E_EOF)
return 0;
/*

View File

@ -0,0 +1,59 @@
diff --git a/Lib/test/test_pty.py b/Lib/test/test_pty.py
index bec38c45456..f623aa09620 100644
--- a/Lib/test/test_pty.py
+++ b/Lib/test/test_pty.py
@@ -11,6 +11,7 @@
import select
import signal
import socket
+import io # readline
import unittest
TEST_STRING_1 = "I wish to buy a fish license.\n"
@@ -24,6 +25,16 @@ def debug(msg):
pass
+# Note that os.read() is nondeterministic so we need to be very careful
+# to make the test suite deterministic. A normal call to os.read() may
+# give us less than expected.
+#
+# Beware, on my Linux system, if I put 'foo\n' into a terminal fd, I get
+# back 'foo\r\n' at the other end. The behavior depends on the termios
+# setting. The newline translation may be OS-specific. To make the
+# test suite deterministic and OS-independent, the functions _readline
+# and normalize_output can be used.
+
def normalize_output(data):
# Some operating systems do conversions on newline. We could possibly
# fix that by doing the appropriate termios.tcsetattr()s. I couldn't
@@ -45,6 +56,12 @@ def normalize_output(data):
return data
+def _readline(fd):
+ """Read one line. May block forever if no newline is read."""
+ reader = io.FileIO(fd, mode='rb', closefd=False)
+ return reader.readline()
+
+
# Marginal testing of pty suite. Cannot do extensive 'do or fail' testing
# because pty code is not too portable.
@@ -97,14 +114,14 @@ def test_basic(self):
debug("Writing to slave_fd")
os.write(slave_fd, TEST_STRING_1)
- s1 = os.read(master_fd, 1024)
+ s1 = _readline(master_fd)
self.assertEqual('I wish to buy a fish license.\n',
normalize_output(s1))
debug("Writing chunked output")
os.write(slave_fd, TEST_STRING_2[:5])
os.write(slave_fd, TEST_STRING_2[5:])
- s2 = os.read(master_fd, 1024)
+ s2 = _readline(master_fd)
self.assertEqual('For my pet fish, Eric.\n', normalize_output(s2))
os.close(slave_fd)

View File

@ -0,0 +1,135 @@
diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c
index 4a71a57ec0d..2b40ada195a 100644
--- a/Modules/_io/fileio.c
+++ b/Modules/_io/fileio.c
@@ -146,9 +146,15 @@ dircheck(fileio* self, PyObject *nameobj)
{
#if defined(HAVE_FSTAT) && defined(S_IFDIR) && defined(EISDIR)
struct stat buf;
+ int res;
if (self->fd < 0)
return 0;
- if (fstat(self->fd, &buf) == 0 && S_ISDIR(buf.st_mode)) {
+
+ Py_BEGIN_ALLOW_THREADS
+ res = fstat(self->fd, &buf);
+ Py_END_ALLOW_THREADS
+
+ if (res == 0 && S_ISDIR(buf.st_mode)) {
errno = EISDIR;
PyErr_SetFromErrnoWithFilenameObject(PyExc_IOError, nameobj);
return -1;
@@ -162,17 +168,34 @@ check_fd(int fd)
{
#if defined(HAVE_FSTAT)
struct stat buf;
- if (!_PyVerify_fd(fd) || (fstat(fd, &buf) < 0 && errno == EBADF)) {
- PyObject *exc;
- char *msg = strerror(EBADF);
- exc = PyObject_CallFunction(PyExc_OSError, "(is)",
- EBADF, msg);
- PyErr_SetObject(PyExc_OSError, exc);
- Py_XDECREF(exc);
- return -1;
+ int res;
+ PyObject *exc;
+ char *msg;
+
+ if (!_PyVerify_fd(fd)) {
+ goto badfd;
}
-#endif
+
+ Py_BEGIN_ALLOW_THREADS
+ res = fstat(fd, &buf);
+ Py_END_ALLOW_THREADS
+
+ if (res < 0 && errno == EBADF) {
+ goto badfd;
+ }
+
return 0;
+
+badfd:
+ msg = strerror(EBADF);
+ exc = PyObject_CallFunction(PyExc_OSError, "(is)",
+ EBADF, msg);
+ PyErr_SetObject(PyExc_OSError, exc);
+ Py_XDECREF(exc);
+ return -1;
+#else
+ return 0;
+#endif
}
@@ -519,9 +542,19 @@ new_buffersize(fileio *self, size_t currentsize)
#ifdef HAVE_FSTAT
off_t pos, end;
struct stat st;
- if (fstat(self->fd, &st) == 0) {
+ int res;
+
+ Py_BEGIN_ALLOW_THREADS
+ res = fstat(self->fd, &st);
+ Py_END_ALLOW_THREADS
+
+ if (res == 0) {
end = st.st_size;
+
+ Py_BEGIN_ALLOW_THREADS
pos = lseek(self->fd, 0L, SEEK_CUR);
+ Py_END_ALLOW_THREADS
+
/* Files claiming a size smaller than SMALLCHUNK may
actually be streaming pseudo-files. In this case, we
apply the more aggressive algorithm below.
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index 2f63c374d1e..8d1c5812f0d 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -121,10 +121,15 @@ dircheck(PyFileObject* f)
{
#if defined(HAVE_FSTAT) && defined(S_IFDIR) && defined(EISDIR)
struct stat buf;
+ int res;
if (f->f_fp == NULL)
return f;
- if (fstat(fileno(f->f_fp), &buf) == 0 &&
- S_ISDIR(buf.st_mode)) {
+
+ Py_BEGIN_ALLOW_THREADS
+ res = fstat(fileno(f->f_fp), &buf);
+ Py_END_ALLOW_THREADS
+
+ if (res == 0 && S_ISDIR(buf.st_mode)) {
char *msg = strerror(EISDIR);
PyObject *exc = PyObject_CallFunction(PyExc_IOError, "(isO)",
EISDIR, msg, f->f_name);
@@ -1010,7 +1015,13 @@ new_buffersize(PyFileObject *f, size_t currentsize)
#ifdef HAVE_FSTAT
off_t pos, end;
struct stat st;
- if (fstat(fileno(f->f_fp), &st) == 0) {
+ int res;
+
+ Py_BEGIN_ALLOW_THREADS
+ res = fstat(fileno(f->f_fp), &st);
+ Py_END_ALLOW_THREADS
+
+ if (res == 0) {
end = st.st_size;
/* The following is not a bug: we really need to call lseek()
*and* ftell(). The reason is that some stdio libraries
@@ -1021,7 +1032,11 @@ new_buffersize(PyFileObject *f, size_t currentsize)
works. We can't use the lseek() value either, because we
need to take the amount of buffered data into account.
(Yet another reason why stdio stinks. :-) */
+
+ Py_BEGIN_ALLOW_THREADS
pos = lseek(fileno(f->f_fp), 0L, SEEK_CUR);
+ Py_END_ALLOW_THREADS
+
if (pos >= 0) {
pos = ftell(f->f_fp);
}

View File

@ -0,0 +1,68 @@
diff --git a/Misc/NEWS.d/next/Library/2017-12-20-09-25-10.bpo-32185.IL0cMt.rst b/Misc/NEWS.d/next/Library/2017-12-20-09-25-10.bpo-32185.IL0cMt.rst
new file mode 100644
index 000000000000..bfb2533b5dcf
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2017-12-20-09-25-10.bpo-32185.IL0cMt.rst
@@ -0,0 +1,2 @@
+The SSL module no longer sends IP addresses in SNI TLS extension on
+platforms with OpenSSL 1.0.2+ or inet_pton.
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index f70af266731a..b191b3a8687a 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -52,6 +52,11 @@
#include <sys/poll.h>
#endif
+#ifndef MS_WINDOWS
+/* inet_pton */
+#include <arpa/inet.h>
+#endif
+
/* Don't warn about deprecated functions */
#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
@@ -575,8 +580,41 @@ newPySSLSocket(PySSLContext *sslctx, PySocketSockObject *sock,
SSL_set_mode(self->ssl, mode);
#if HAVE_SNI
- if (server_hostname != NULL)
- SSL_set_tlsext_host_name(self->ssl, server_hostname);
+ if (server_hostname != NULL) {
+/* Don't send SNI for IP addresses. We cannot simply use inet_aton() and
+ * inet_pton() here. inet_aton() may be linked weakly and inet_pton() isn't
+ * available on all platforms. Use OpenSSL's IP address parser. It's
+ * available since 1.0.2 and LibreSSL since at least 2.3.0. */
+ int send_sni = 1;
+#if OPENSSL_VERSION_NUMBER >= 0x10200000L
+ ASN1_OCTET_STRING *ip = a2i_IPADDRESS(server_hostname);
+ if (ip == NULL) {
+ send_sni = 1;
+ ERR_clear_error();
+ } else {
+ send_sni = 0;
+ ASN1_OCTET_STRING_free(ip);
+ }
+#elif defined(HAVE_INET_PTON)
+#ifdef ENABLE_IPV6
+ char packed[Py_MAX(sizeof(struct in_addr), sizeof(struct in6_addr))];
+#else
+ char packed[sizeof(struct in_addr)];
+#endif /* ENABLE_IPV6 */
+ if (inet_pton(AF_INET, server_hostname, packed)) {
+ send_sni = 0;
+#ifdef ENABLE_IPV6
+ } else if(inet_pton(AF_INET6, server_hostname, packed)) {
+ send_sni = 0;
+#endif /* ENABLE_IPV6 */
+ } else {
+ send_sni = 1;
+ }
+#endif /* HAVE_INET_PTON */
+ if (send_sni) {
+ SSL_set_tlsext_host_name(self->ssl, server_hostname);
+ }
+ }
#endif
/* If the socket is in non-blocking mode or timeout mode, set the BIO

View File

@ -0,0 +1,24 @@
From 439956a149f8a3eb44646498c63b2ef3337d5f3d Mon Sep 17 00:00:00 2001
From: Christian Heimes <christian@python.org>
Date: Sun, 25 Feb 2018 13:08:05 +0100
Subject: [PATCH] Fix ssl module, Python 2.7 doesn't have Py_MAX (#5878)
Signed-off-by: Christian Heimes <christian@python.org>
---
Modules/_ssl.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index af66a581e15a..f9ed94dee1e1 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -610,7 +610,8 @@ newPySSLSocket(PySSLContext *sslctx, PySocketSockObject *sock,
}
#elif defined(HAVE_INET_PTON)
#ifdef ENABLE_IPV6
- char packed[Py_MAX(sizeof(struct in_addr), sizeof(struct in6_addr))];
+ #define PySSL_MAX(x, y) (((x) > (y)) ? (x) : (y))
+ char packed[PySSL_MAX(sizeof(struct in_addr), sizeof(struct in6_addr))];
#else
char packed[sizeof(struct in_addr)];
#endif /* ENABLE_IPV6 */

View File

@ -8,11 +8,6 @@
%global python python2
# Macro for using a version-release which will obsolete python for
# Fedora 24 and 25, in order to ensure a clean upgrade path to Fedora 26.
# It should be removed along with the obsolete tags at Fedora 28.
%global obs 2.7.13-2
%global pybasever 2.7
%global pylibdir %{_libdir}/python%{pybasever}
%global tools_dir %{pylibdir}/Tools
@ -54,7 +49,6 @@
%global run_selftest_suite 1
%if 0%{?_module_build}
%global with_gdbm 0
%global with_valgrind 0
%global with_systemtap 0
%global run_selftest_suite 0
@ -109,8 +103,8 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.13
Release: 8%{?dist}
Version: 2.7.14
Release: 7%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@ -353,7 +347,7 @@ Patch17: python-2.6.4-distutils-rpath.patch
# for 2.7rc1 by dmalcolm:
Patch55: 00055-systemtap.patch
# Only used when "%{_lib}" == "lib64"
# Only used when "%%{_lib}" == "lib64"
# Fixup various paths throughout the build and in distutils from "lib" to "lib64",
# and add the /usr/lib64/pythonMAJOR.MINOR/site-packages to sitedirs, in front of
# /usr/lib/pythonMAJOR.MINOR/site-packages
@ -367,7 +361,7 @@ Patch102: 00102-2.7.13-lib64.patch
Patch103: python-2.7-lib64-sysconfig.patch
# 00104 #
# Only used when "%{_lib}" == "lib64"
# Only used when "%%{_lib}" == "lib64"
# Another lib64 fix, for distutils/tests/test_install.py; not upstream:
Patch104: 00104-lib64-fix-for-test_install.patch
@ -471,14 +465,6 @@ Patch114: 00114-statvfs-f_flag-constants.patch
# This patch adds the build Modules directory to build path.
Patch121: 00121-add-Modules-to-build-path.patch
# 00125 #
# COUNT_ALLOCS is useful for debugging, but the upstream behaviour of always
# emitting debug info to stdout on exit is too verbose and makes it harder to
# use the debug build. Add a "PYTHONDUMPCOUNTS" environment variable which
# must be set to enable the output on exit
# Not yet sent upstream
Patch125: 00125-less-verbose-COUNT_ALLOCS.patch
# 2.7.1 (in r84230) added a test to test_abc which fails if python is
# configured with COUNT_ALLOCS, which is the case for our debug build
# (the COUNT_ALLOCS instrumentation keeps "C" alive).
@ -527,16 +513,6 @@ Patch132: 00132-add-rpmbuild-hooks-to-unittest.patch
# "dl" is deprecated, and test_dl doesn't work on 64-bit builds:
Patch133: 00133-skip-test_dl.patch
# 00134 #
# Fix a failure in test_sys.py when configured with COUNT_ALLOCS enabled
# Not yet sent upstream
Patch134: 00134-fix-COUNT_ALLOCS-failure-in-test_sys.patch
# 00135 #
# Skip "test_callback_in_cycle_resurrection" in a debug build, where it fails:
# Not yet sent upstream
Patch135: 00135-skip-test-within-test_weakref-in-debug-build.patch
# 00136 #
# Some tests try to seek on sys.stdin, but don't work as expected when run
# within Koji/mock; skip them within the rpm build:
@ -561,11 +537,6 @@ Patch139: 00139-skip-test_float-known-failure-on-arm.patch
# which appears to be a libffi bug
Patch140: 00140-skip-test_ctypes-known-failure-on-sparc.patch
# 00141 #
# Fix test_gc's test_newinstance case when configured with COUNT_ALLOCS:
# Not yet sent upstream
Patch141: 00141-fix-test_gc_with_COUNT_ALLOCS.patch
# 00142 #
# Some pty tests fail when run in mock (rhbz#714627):
Patch142: 00142-skip-failing-pty-tests-in-rpmbuild.patch
@ -689,12 +660,6 @@ Patch169: 00169-avoid-implicit-usage-of-md5-in-multiprocessing.patch
# (rhbz#850013)
Patch170: 00170-gc-assertions.patch
# 00173 #
# Workaround for ENOPROTOOPT seen in Koji within
# test.test_support.bind_port()
# (rhbz#913732)
Patch173: 00173-workaround-ENOPROTOOPT-in-bind_port.patch
# 00174 #
# Workaround for failure to set up prefix/exec_prefix when running
# an embededed libpython that sets Py_SetProgramName() to a name not
@ -750,23 +715,47 @@ Patch193: 00193-enable-loading-sqlite-extensions.patch
# 00198 #
Patch198: 00198-add-rewheel-module.patch
# 00250 #
# After glibc-2.24.90, Python failed to start on EL7 kernel
# rhbz#1410175: https://bugzilla.redhat.com/show_bug.cgi?id=1410175
# http://bugs.python.org/issue29157
# Fixed upstream: https://hg.python.org/cpython/rev/13a39142c047
Patch250: 00250-getentropy.patch
# 00280 #
# The test `test_regrtest.test_crashed` fails on s390x architecture.
# https://bugs.python.org/issue31719
Patch280: 00280-Fix-test_regrtest-test_crashed-on-s390x.patch
# 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
# 00283 #
# Fix tests on debug build configured with COUNT_ALLOCS,
# and add a new environment variable PYTHONSHOWALLOCCOUNT:
# https://bugs.python.org/issue31692
Patch283: 00283-fix-tests_with_COUNT_ALLOCS.patch
# 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
# 00284 #
# Add a new PYTHONSHOWREFCOUNT environment variable. In debug mode, Python now
# will print the total reference count if PYTHONSHOWREFCOUNT is set.
# Backported from upstream: https://bugs.python.org/issue31733
Patch284: 00284-add-PYTHONSHOWREFCOUNT-env-var.patch
# 00285 #
# Fix nondeterministic read in test_pty which fails randomly in koji.
# Fixed upstream: https://bugs.python.org/issue31158
Patch285: 00285-fix-non-deterministic-read-in-test_pty.patch
# 00287 #
# On the creation of io.FileIO() and builtin file() objects the GIL is now released
# when checking the file descriptor. io.FileIO.readall(), io.FileIO.read(), and
# file.read() also now release the GIL when getting the file size, which fixes hanging
# of all threads when trying to access an inaccessible NFS server.
# Fixed upstream: https://bugs.python.org/issue32186
Patch287: 00287-fix-thread-hanging-on-inaccessible-nfs-server.patch
# 00298 #
# The SSL module no longer sends IP addresses in SNI TLS extension on
# platforms with OpenSSL 1.0.2+ or inet_pton.
# Fixed upstream: https://bugs.python.org/issue32185
Patch298: 00298-do-not-send-IP-in-SNI-TLS-extension.patch
# 00299 #
# Fix ssl module, Python 2.7 doesn't have Py_MAX
# The previous patch 298 broke python2. This is a fixup.
# Fixed upstream: https://github.com/python/cpython/pull/5878
Patch299: 00299-fix-ssl-module-pymax.patch
# (New patches go here ^^^)
#
@ -778,7 +767,7 @@ Patch269: 00269-fix-multiple-compilations-issue-with-pgo-builds.patch
# https://fedoraproject.org/wiki/SIGs/Python/PythonPatches
# This is the generated patch to "configure"; see the description of
# %{regenerate_autotooling_patch}
# %%{regenerate_autotooling_patch}
# above:
# Disable tk for modularity builds to break up build dependencies
@ -792,7 +781,11 @@ Patch5000: 05000-autotool-intermediates.patch
Provides: python = %{version}-%{release}
Provides: python%{?_isa} = %{version}-%{release}
Obsoletes: python < %{obs}
# All the obsolete tags similar to this one should be removed at Fedora 28
# Also, according to the guidelines, this should be a hardcoded version,
# but that was proven problematic, see rhbz#1457336
Obsoletes: python < %{version}-%{release}
# Providing python27 as now multiple interpreters exist in Fedora
# alongside the system one e.g. python26, python33 etc
@ -833,7 +826,7 @@ Requires: glibc%{?_isa} >= 2.24.90-26
Provides: python-libs = %{version}-%{release}
Provides: python-libs%{?_isa} = %{version}-%{release}
Obsoletes: python-libs < %{obs}
Obsoletes: python-libs < %{version}-%{release}
%description libs
This package contains files used to embed Python 2 into applications.
@ -845,13 +838,20 @@ Requires: %{python}%{?_isa} = %{version}-%{release}
Requires: python-rpm-macros
Requires: python2-rpm-macros
Requires: pkgconfig
# https://bugzilla.redhat.com/show_bug.cgi?id=1217376
# https://bugzilla.redhat.com/show_bug.cgi?id=1496757
# https://bugzilla.redhat.com/show_bug.cgi?id=1218294
# TODO change to a specific subpackage once available (#1218294)
Requires: redhat-rpm-config
# Needed here because of the migration of Makefile from -devel to the main
# package
Conflicts: %{python} < %{version}-%{release}
Provides: python-devel = %{version}-%{release}
Provides: python-devel%{?_isa} = %{version}-%{release}
Obsoletes: python-devel < %{obs}
Obsoletes: python-devel < %{version}-%{release}
%description devel
This package contains libraries and header files used to build applications
@ -865,7 +865,7 @@ Requires: %{python}-tkinter = %{version}-%{release}
Provides: python-tools = %{version}-%{release}
Provides: python-tools%{?_isa} = %{version}-%{release}
Obsoletes: python-tools < %{obs}
Obsoletes: python-tools < %{version}-%{release}
%description tools
This package includes several tools to help with the development of Python 2
@ -883,7 +883,7 @@ Provides: tkinter2 = %{version}-%{release}
Provides: tkinter2%{?_isa} = %{version}-%{release}
Provides: python-tkinter = %{version}-%{release}
Provides: python-tkinter%{?_isa} = %{version}-%{release}
Obsoletes: tkinter < %{obs}
Obsoletes: tkinter < %{version}-%{release}
%description tkinter
@ -900,7 +900,7 @@ Requires: %{name} = %{version}-%{release}
Provides: python-test = %{version}-%{release}
Provides: python-test%{?_isa} = %{version}-%{release}
Obsoletes: python-test < %{obs}
Obsoletes: python-test < %{version}-%{release}
%description test
@ -909,7 +909,7 @@ These have been removed to save space, as they are never or almost
never used in production.
You might want to install the python2-test package if you're developing python 2
code that uses more than just unittest and/or test_support.py.
code that uses more than just unittest and/or test.support.
%if 0%{?with_debug_build}
%package debug
@ -928,7 +928,7 @@ Requires: %{name}-tools%{?_isa} = %{version}-%{release}
Provides: python-debug = %{version}-%{release}
Provides: python-debug%{?_isa} = %{version}-%{release}
Obsoletes: python-debug < %{obs}
Obsoletes: python-debug < %{version}-%{release}
%description debug
python2-debug provides a version of the Python 2 runtime with numerous debugging
@ -1022,7 +1022,6 @@ rm -r Modules/zlib || exit 1
%patch121 -p1
%patch125 -p1 -b .less-verbose-COUNT_ALLOCS
%patch128 -p1
%patch130 -p1
@ -1033,8 +1032,6 @@ rm -r Modules/zlib || exit 1
%patch132 -p1
%patch133 -p1
%patch134 -p1
%patch135 -p1
%patch136 -p1 -b .stdin-test
%patch137 -p1
%patch138 -p1
@ -1044,7 +1041,6 @@ rm -r Modules/zlib || exit 1
%ifarch %{sparc}
%patch140 -p1
%endif
%patch141 -p1
%patch142 -p1 -b .tty-fail
%patch143 -p1 -b .tsc-on-ppc
%if !%{with_gdbm}
@ -1062,7 +1058,6 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch168 -p1
%patch169 -p1
%patch170 -p1
%patch173 -p1
%patch174 -p1 -b .fix-for-usr-move
%patch180 -p1
%patch181 -p1
@ -1074,12 +1069,16 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%if 0%{with_rewheel}
%patch198 -p1
%endif
%patch280 -p1
%patch283 -p1
%patch284 -p1
%patch285 -p1
%patch287 -p1
%patch298 -p1
%patch299 -p1
%patch250 -p1
%patch252 -p1
%patch269 -p1
%if ! 0%{?_module_build}
%if 0%{?_module_build}
%patch4000 -p1
%endif
@ -1712,9 +1711,15 @@ rm -fr %{buildroot}
%{pylibdir}/pydoc_data
%dir %{pylibdir}/sqlite3
%{pylibdir}/sqlite3/*.py*
# Some bits of test are used for actual testing of stuff, not just python itself:
# See also https://bugzilla.redhat.com/show_bug.cgi?id=1528899
%dir %{pylibdir}/test
%{pylibdir}/test/test_support.py*
%{pylibdir}/test/__init__.py*
%{pylibdir}/test/support/
%{pylibdir}/test/script_helper.py*
%{pylibdir}/test/test_support.py*
%{pylibdir}/unittest
%{pylibdir}/wsgiref
%{pylibdir}/xml
@ -1796,9 +1801,14 @@ rm -fr %{buildroot}
%{pylibdir}/lib2to3/tests
%{pylibdir}/sqlite3/test
%{pylibdir}/test/*
# These two are shipped in the main subpackage:
%exclude %{pylibdir}/test/test_support.py*
# Some bits of test are used for actual testing of stuff, not just python itself:
# See also https://bugzilla.redhat.com/show_bug.cgi?id=1528899
%exclude %{pylibdir}/test/__init__.py*
%exclude %{pylibdir}/test/support/
%exclude %{pylibdir}/test/script_helper.py*
%exclude %{pylibdir}/test/test_support.py*
%{dynload_dir}/_ctypes_test.so
%{dynload_dir}/_testcapimodule.so
@ -1952,6 +1962,46 @@ rm -fr %{buildroot}
# ======================================================
%changelog
* Wed Mar 14 2018 Miro Hrončok <mhroncok@redhat.com> - 2.7.14-7
- Fix broken SSL module
Resolves: rhbz#1555081
* Tue Mar 13 2018 Charalampos Stratakis <cstratak@redhat.com> - 2.7.14-6
- Do not send IP addresses in SNI TLS extension
* Thu Feb 15 2018 Miro Hrončok <mhroncok@redhat.com> - 2.7.14-5
- Move test.support and test.script_helper to python2-libs
Resolves: rhbz#1528899
* Mon Dec 11 2017 Charalampos Stratakis <cstratak@redhat.com> - 2.7.14-4
- Fix hanging of all threads when trying to access an inaccessible NFS server.
* Thu Nov 09 2017 Miro Hrončok <mhroncok@redhat.com> - 2.7.14-3
- Make the -devel package require redhat-rpm-config
Resolves: rhbz#1496757
* Thu Nov 02 2017 Charalampos Stratakis <cstratak@redhat.com> - 2.7.14-2
- Add a new PYTHONSHOWREFCOUNT environment variable for printing the reference
count in debug builds.
- Fix nondeterministic read in test_pty.
* Mon Oct 09 2017 Iryna Shcherbina <ishcherb@redhat.com> - 2.7.14-1
- Update to version 2.7.14
* Thu Aug 10 2017 Michal Cyprian <mcyprian@redhat.com> - 2.7.13-12
- Revert "Add --executable option to install.py command"
This enhancement is currently not needed and it can possibly
collide with `pip --editable`option
* Mon Jun 26 2017 Charalampos Stratakis <cstratak@redhat.com> - 2.7.13-11
- Fix test_alpn_protocols from test_ssl
* Wed May 31 2017 Miro Hrončok <mhroncok@redhat.com> - 2.7.13-10
- Change fixed Obsoletes version with a dynamic one (rhbz#1457336)
* Thu May 18 2017 Karsten Hopp <karsten@redhat.com> - 2.7.13-9
- revert logic for modularity patch and enable gdbm for modularity
* Wed May 10 2017 Charalampos Stratakis <cstratak@redhat.com> - 2.7.13-8
- Enable profile guided optimizations for x86_64 and i686 architectures
- Update description to reflect that Python 2 is not the default Python

View File

@ -1 +1 @@
SHA512 (Python-2.7.13.tar.xz) = f37c9a28ce129d01e63c84d7db627a06402854578f62d17927334ea21ede318e04bbf66e890e3f47c85333e6b19f6e5581fb3f3e27efd24be27017d1b6529c4b
SHA512 (Python-2.7.14.tar.xz) = 78310b0be6388ffa15f29a80afb9ab3c03a572cb094e9da00cfe391afadb51696e41f592eb658d6a31a2f422fdac8a55214a382cbb8cfb43d4a127d5b35ea7f9