Compare commits

...

46 Commits
f27 ... master

Author SHA1 Message Date
Victor Stinner ef338dc7d0 tests.yml now installs also glibc-all-langpacks
Install all locales to not skip test_locale tests.
2019-03-05 11:13:34 +00:00
Miro Hrončok a5e818f217 Update to 2.7.16 final 2019-03-04 15:08:29 +01:00
Miro Hrončok 5d0f9111df Update bundled pip/setuptools versions 2019-03-01 15:10:33 +01:00
Charalampos Stratakis 75a0703066 Rebase to 2.7.16rc1 2019-02-28 10:19:21 +00:00
Miro Hrončok b13073ac76 Fedora CI: Workaround for fedora-ci/general #31
https://pagure.io/fedora-ci/general/issue/31
2019-02-28 09:45:47 +01:00
Igor Gnatenko 789267ab76 Rebuild for readline 8.0 2019-02-17 09:30:52 +01:00
Fedora Release Engineering ef2a83ef76 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-02-02 10:16:35 +00:00
Igor Gnatenko 1d7cbe3b6c Remove obsolete Group tag
References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag
2019-01-28 20:24:38 +01:00
Björn Esser 284b905a2e
Rebuilt for libcrypt.so.2 (#1666033) 2019-01-14 18:52:20 +01:00
Miro Hrončok 44b757bc09 BR glibc-all-langpacks to fix a FTBFS and avoid skipped tests
See https://fedoraproject.org/wiki/Changes/Remove_glibc-langpacks-all_from_buildroot

The tests failed with:

Some tests will be disabled: Test locale not supported
(tried en_US.UTF-8, en_US.US-ASCII, en_US)
...
======================================================================
ERROR: test_lookup_issue1813 (test.test_codecs.CodecsModuleTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/Python-2.7.15/Lib/locale.py", line 581, in setlocale
    return _setlocale(category, locale)
Error: unsupported locale setting
----------------------------------------------------------------------
...
======================================================================
ERROR: test_getsetlocale_issue1813 (test.test_locale.TestMiscellaneous)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/Python-2.7.15/Lib/locale.py", line 581, in setlocale
    return _setlocale(category, locale)
Error: unsupported locale setting
======================================================================
ERROR: test_setlocale_unicode (test.test_locale.TestMiscellaneous)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/Python-2.7.15/Lib/locale.py", line 581, in setlocale
    return _setlocale(category, locale)
Error: unsupported locale setting
----------------------------------------------------------------------
2018-12-10 17:39:48 +01:00
Miro Hrončok ebba43dec3 Security fix for CVE-2018-14647 (#1631822) 2018-09-24 13:08:08 +02:00
Miro Hrončok 0dfe62335c Security fix for CVE-2018-1000802 (#1631662) 2018-09-21 10:49:42 +02:00
Petr Viktorin 0052c9fa9d Deprecate python2 and all subpackages in Fedora 30+
See:
- https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
- https://fedoraproject.org/wiki/Packaging:Deprecating_Packages
2018-09-07 12:41:58 +02:00
Miro Hrončok ae09a79125 Enable basic venv smoke test in the CI 2018-08-31 18:56:13 +02:00
Miro Hrončok e8ef86e1cf Require python2-setuptools from python2-devel to prevent packaging errors (#1623922) 2018-08-30 15:46:34 +02:00
Miro Hrončok 4d74b7c9bf Use RPM built wheels of pip and setuptools in ensurepip instead of our rewheel patch 2018-08-23 17:49:59 +02:00
Miro Hrončok d60e5a4fc9 Move patch 189 to 190 to make room for standardized 189
https://fedoraproject.org/wiki/SIGs/Python/PythonPatches
2018-08-23 17:49:59 +02:00
Miro Hrončok 8b06c12ed7 Temporarily use compat-openssl10-devel to workaround #1609291 2018-08-23 15:09:59 +02:00
Fedora Release Engineering fb39860846 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-07-14 02:48:28 +00:00
Jason Tibbitts f5b3292c68 Remove needless use of %defattr 2018-07-10 01:54:54 -05:00
Miro Hrončok 08290bc9c3 Add a workaround for broken %undefine __brp_python_bytecompile
See https://bugzilla.redhat.com/show_bug.cgi?id=1597664
2018-07-03 14:02:51 +02:00
Miro Hrončok 002eb7557e Move /usr/bin/python into a separate package
See https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package

Reverts https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build
2018-07-03 11:31:07 +02:00
Miro Hrončok 692623a0b9 pynche: Do not execute just python, but python2 2018-06-21 16:35:28 +02:00
Miro Hrončok 5ee9c1ec45 Rebuilt for Python 3.7 2018-06-13 18:34:16 +02:00
Miro Hrončok 2b53e7ec9b Bootstrap for Python 3.7 2018-06-13 15:40:42 +02:00
Charalampos Stratakis 4922a4e974 Fix loading of the gdb python plugin (rhbz#1578001)
Conditionalize permissions changes for the debug
shared library.
2018-05-15 14:28:59 +02:00
Miro Hrončok ba2118865d Add a Python 3 bootstrapping bcond 2018-05-12 00:53:31 +02:00
Miro Hrončok 080ef9bdfb Coerce locale to UTF-8 encoding when running tests
Since 2.7.15, there is a test that shutil.copies to unicode filename.
2018-05-02 12:02:18 +02:00
Miro Hrončok 066c258587 Update to version 2.7.15
- Rebased patches: 165, 170, 198
- Refactored patches: 289
- Removed patches (included upstream): 280, 283, 284, 285, 287,
                                       293, 297, 298, 299
2018-05-02 12:02:18 +02:00
Miro Hrončok 3be16be9fa Bytecompile files manually, disable brp-python-bytecompile
Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1572171
2018-04-28 17:12:13 +02:00
Tomas Orsava b1a24b465f Change shebangs to the proper versioned binary 2018-04-26 10:35:56 +02:00
Miro Hrončok 4856e50ce1 Update the docs comment to mention python2-docs 2018-04-13 23:01:00 +02:00
Miro Hrončok 8545792aae Remove Obsoletes tag from when python was renamed to python2
Fedora 25 was last Fedora that had python, N+3 upgrades are not
supported, this can be merged to Fedora 28+.
2018-04-13 22:58:24 +02:00
Miro Hrončok cc58e7d338 Fix broken SSL module (#1555081) 2018-03-14 11:33:05 +01:00
Charalampos Stratakis e1abe5a026 Do not send IP addresses in SNI TLS extension 2018-03-13 17:09:14 +01:00
Petr Viktorin 5316098666 Fix -Wint-in-bool-context warnings 2018-02-27 11:07:57 +01:00
Florian Weimer 528a444ab6 Rebuild with new LDFLAGS from redhat-rpm-config 2018-02-24 18:25:24 +01:00
Miro Hrončok b02c01e554 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-15 17:04:45 +01:00
Igor Gnatenko 71264cf847
Remove %clean section
None of currently supported distributions need that.
Last one was EL5 which is EOL for a while.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-14 09:28:24 +01:00
Igor Gnatenko 1bdc5fed8a Remove BuildRoot definition
None of currently supported distributions need that.
It was needed last for EL5 which is EOL now

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-14 00:53:42 +01:00
Fedora Release Engineering 9c47bee6d8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-02-09 11:53:31 +00:00
Charalampos Stratakis 11b080bc3c Remove obsolete scriptlets that are now automatic. 2018-02-05 17:55:07 +01:00
Petr Viktorin 96b18273ae Add patch 289: Fix for over-aligned GC info 2018-01-31 13:40:48 +01:00
Petr Viktorin 7143d8af3a Warn/fail if /usr/bin/python is called with PYTHON_DISALLOW_AMBIGUOUS_VERSION
See https://fedoraproject.org/wiki/User:Pviktori/Avoid_usr_bin_python_in_RPM_Build
2018-01-30 13:48:45 +01:00
Björn Esser 9c6e188db0
Rebuilt for switch to libxcrypt 2018-01-20 23:07:40 +01:00
Petr Viktorin 3056bfd92a Build the nis module with tirpc 2018-01-17 14:56:25 +01:00
18 changed files with 557 additions and 1042 deletions

View File

@ -20,10 +20,10 @@ index b9f1c6c..7b23714 100644
'scripts': '$base/bin',
'data' : '$base',
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
index 068d1ba..3e7f077 100644
index 031f809..ec5d584 100644
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
@@ -119,8 +119,12 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
@@ -120,8 +120,12 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
prefix = plat_specific and EXEC_PREFIX or PREFIX
if os.name == "posix":
@ -59,10 +59,10 @@ index c360802..868b7cb 100644
return sitepackages
diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py
index d9a9324..e411e5c 100644
index b4384ee..349f688 100644
--- a/Lib/test/test_site.py
+++ b/Lib/test/test_site.py
@@ -235,17 +235,20 @@ class HelperFunctionsTests(unittest.TestCase):
@@ -254,17 +254,20 @@ class HelperFunctionsTests(unittest.TestCase):
self.assertEqual(dirs[0], wanted)
elif os.sep == '/':
# OS X, Linux, FreeBSD, etc
@ -86,12 +86,12 @@ index d9a9324..e411e5c 100644
+ wanted = os.path.join('xoxo', 'lib64', 'site-packages')
self.assertEqual(dirs[1], wanted)
class PthFile(object):
def test_no_home_directory(self):
diff --git a/Makefile.pre.in b/Makefile.pre.in
index adae76b..ecb27f3 100644
index 4f59dd3..877698c 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -111,7 +111,7 @@ LIBDIR= @libdir@
@@ -110,7 +110,7 @@ LIBDIR= @libdir@
MANDIR= @mandir@
INCLUDEDIR= @includedir@
CONFINCLUDEDIR= $(exec_prefix)/include
@ -101,9 +101,18 @@ index adae76b..ecb27f3 100644
# Detailed destination directories
BINLIBDEST= $(LIBDIR)/python$(VERSION)
diff --git a/Modules/Setup.dist b/Modules/Setup.dist
index fbfa1c1..138fb33 100644
index 2cf35a9..c4c88cb 100644
--- a/Modules/Setup.dist
+++ b/Modules/Setup.dist
@@ -231,7 +231,7 @@ crypt cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some systems
# Some more UNIX dependent modules -- off by default, since these
# are not supported by all UNIX systems:
-nis nismodule.c -lnsl -ltirpc -I/usr/include/tirpc -I/usr/include/nsl -L/usr/lib/nsl
+nis nismodule.c -lnsl -ltirpc -I/usr/include/tirpc -I/usr/include/nsl -L/usr/lib64/nsl
termios termios.c # Steen Lumholt's termios module
resource resource.c # Jeremy Hylton's rlimit interface
@@ -416,7 +416,7 @@ gdbm gdbmmodule.c -lgdbm
# Edit the variables DB and DBLIBVERto point to the db top directory
# and the subdirectory of PORT where you built it.
@ -121,7 +130,7 @@ index fbfa1c1..138fb33 100644
+zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib64 -lz
# Interface to the Expat XML parser
#
# More information on Expat can be found at www.libexpat.org.
diff --git a/Modules/getpath.c b/Modules/getpath.c
index fd33a01..c5c86fd 100644
--- a/Modules/getpath.c
@ -145,7 +154,7 @@ index fd33a01..c5c86fd 100644
/* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */
diff --git a/setup.py b/setup.py
index 99ac359..859b6c4 100644
index 0288a6b..7905f6f 100644
--- a/setup.py
+++ b/setup.py
@@ -456,7 +456,7 @@ class PyBuildExt(build_ext):

View File

@ -1,6 +1,7 @@
diff -up Python-2.7.3/Doc/library/crypt.rst.crypt-module-salt-backport Python-2.7.3/Doc/library/crypt.rst
--- Python-2.7.3/Doc/library/crypt.rst.crypt-module-salt-backport 2012-04-09 19:07:28.000000000 -0400
+++ Python-2.7.3/Doc/library/crypt.rst 2013-02-19 16:44:20.465334062 -0500
diff --git a/Doc/library/crypt.rst b/Doc/library/crypt.rst
index 91464ef..6ee64d6 100644
--- a/Doc/library/crypt.rst
+++ b/Doc/library/crypt.rst
@@ -16,9 +16,9 @@
This module implements an interface to the :manpage:`crypt(3)` routine, which is
@ -14,7 +15,7 @@ diff -up Python-2.7.3/Doc/library/crypt.rst.crypt-module-salt-backport Python-2.
.. index:: single: crypt(3)
@@ -27,15 +27,81 @@ the :manpage:`crypt(3)` routine in the r
@@ -27,15 +27,81 @@ the :manpage:`crypt(3)` routine in the running system. Therefore, any
extensions available on the current implementation will also be available on
this module.
@ -130,7 +131,7 @@ diff -up Python-2.7.3/Doc/library/crypt.rst.crypt-module-salt-backport Python-2.
A simple example illustrating typical use::
import crypt, getpass, pwd
@@ -59,3 +146,11 @@ A simple example illustrating typical us
@@ -59,3 +146,11 @@ A simple example illustrating typical use::
else:
return 1
@ -142,9 +143,11 @@ diff -up Python-2.7.3/Doc/library/crypt.rst.crypt-module-salt-backport Python-2.
+ hashed = crypt.crypt(plaintext)
+ if hashed != crypt.crypt(plaintext, hashed):
+ raise "Hashed version doesn't validate against original"
diff -up Python-2.7.3/Lib/crypt.py.crypt-module-salt-backport Python-2.7.3/Lib/crypt.py
--- Python-2.7.3/Lib/crypt.py.crypt-module-salt-backport 2013-02-19 16:44:20.465334062 -0500
+++ Python-2.7.3/Lib/crypt.py 2013-02-19 16:49:56.425311089 -0500
diff --git a/Lib/crypt.py b/Lib/crypt.py
new file mode 100644
index 0000000..bf0a416
--- /dev/null
+++ b/Lib/crypt.py
@@ -0,0 +1,71 @@
+"""Wrapper to the POSIX crypt library call and associated functionality.
+
@ -217,12 +220,13 @@ diff -up Python-2.7.3/Lib/crypt.py.crypt-module-salt-backport Python-2.7.3/Lib/c
+methods.append(METHOD_CRYPT)
+del _result, _method
+
diff -up Python-2.7.3/Lib/test/test_crypt.py.crypt-module-salt-backport Python-2.7.3/Lib/test/test_crypt.py
--- Python-2.7.3/Lib/test/test_crypt.py.crypt-module-salt-backport 2012-04-09 19:07:31.000000000 -0400
+++ Python-2.7.3/Lib/test/test_crypt.py 2013-02-19 16:44:20.465334062 -0500
@@ -10,6 +10,25 @@ class CryptTestCase(unittest.TestCase):
if test_support.verbose:
print 'Test encryption: ', c
diff --git a/Lib/test/test_crypt.py b/Lib/test/test_crypt.py
index 7cd9c71..b061a55 100644
--- a/Lib/test/test_crypt.py
+++ b/Lib/test/test_crypt.py
@@ -16,6 +16,25 @@ class CryptTestCase(unittest.TestCase):
self.assertEqual(cr2, cr)
+ def test_salt(self):
+ self.assertEqual(len(crypt._saltchars), 64)
@ -246,9 +250,23 @@ diff -up Python-2.7.3/Lib/test/test_crypt.py.crypt-module-salt-backport Python-2
def test_main():
test_support.run_unittest(CryptTestCase)
diff -up Python-2.7.3/Modules/cryptmodule.c.crypt-module-salt-backport Python-2.7.3/Modules/cryptmodule.c
--- Python-2.7.3/Modules/cryptmodule.c.crypt-module-salt-backport 2012-04-09 19:07:34.000000000 -0400
+++ Python-2.7.3/Modules/cryptmodule.c 2013-02-19 16:44:20.466334063 -0500
diff --git a/Modules/Setup.dist b/Modules/Setup.dist
index 2712f06..3ea4f0c 100644
--- a/Modules/Setup.dist
+++ b/Modules/Setup.dist
@@ -225,7 +225,7 @@ _ssl _ssl.c \
#
# First, look at Setup.config; configure may have set this for you.
-crypt cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some systems
+_crypt _cryptmodule.c -lcrypt # crypt(3); needs -lcrypt on some systems
# Some more UNIX dependent modules -- off by default, since these
diff --git a/Modules/cryptmodule.c b/Modules/cryptmodule.c
index 76de54f..7c69ca6 100644
--- a/Modules/cryptmodule.c
+++ b/Modules/cryptmodule.c
@@ -43,7 +43,7 @@ static PyMethodDef crypt_methods[] = {
};
@ -259,22 +277,11 @@ diff -up Python-2.7.3/Modules/cryptmodule.c.crypt-module-salt-backport Python-2.
- Py_InitModule("crypt", crypt_methods);
+ Py_InitModule("_crypt", crypt_methods);
}
diff -up Python-2.7.3/Modules/Setup.dist.crypt-module-salt-backport Python-2.7.3/Modules/Setup.dist
--- Python-2.7.3/Modules/Setup.dist.crypt-module-salt-backport 2013-02-19 16:44:20.463334063 -0500
+++ Python-2.7.3/Modules/Setup.dist 2013-02-19 16:44:20.466334063 -0500
@@ -221,7 +221,7 @@ _ssl _ssl.c \
#
# First, look at Setup.config; configure may have set this for you.
-crypt cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some systems
+_crypt _cryptmodule.c -lcrypt # crypt(3); needs -lcrypt on some systems
# Some more UNIX dependent modules -- off by default, since these
diff -up Python-2.7.3/setup.py.crypt-module-salt-backport Python-2.7.3/setup.py
--- Python-2.7.3/setup.py.crypt-module-salt-backport 2013-02-19 16:44:20.425334067 -0500
+++ Python-2.7.3/setup.py 2013-02-19 16:44:20.466334063 -0500
@@ -693,7 +693,7 @@ class PyBuildExt(build_ext):
diff --git a/setup.py b/setup.py
index b787487..c60ac35 100644
--- a/setup.py
+++ b/setup.py
@@ -798,7 +798,7 @@ class PyBuildExt(build_ext):
libs = ['crypt']
else:
libs = []

View File

@ -1,16 +1,18 @@
diff -up Python-2.7.3/Lib/test/test_gc.py.gc-assertions Python-2.7.3/Lib/test/test_gc.py
--- Python-2.7.3/Lib/test/test_gc.py.gc-assertions 2013-02-20 16:28:20.890536607 -0500
+++ Python-2.7.3/Lib/test/test_gc.py 2013-02-20 16:39:52.720489297 -0500
@@ -1,6 +1,7 @@
diff --git a/Lib/test/test_gc.py b/Lib/test/test_gc.py
index 7e47b2d..12a210d 100644
--- a/Lib/test/test_gc.py
+++ b/Lib/test/test_gc.py
@@ -1,7 +1,8 @@
import unittest
-from test.test_support import verbose, run_unittest, start_threads
+from test.test_support import verbose, run_unittest, start_threads, import_module
from test.support import (verbose, run_unittest, start_threads,
- requires_type_collecting)
+ requires_type_collecting, import_module)
import sys
+import sysconfig
import time
import gc
import weakref
@@ -32,6 +33,8 @@ class GC_Detector(object):
@@ -39,6 +40,8 @@ class GC_Detector(object):
self.wr = weakref.ref(C1055820(666), it_happened)
@ -19,7 +21,7 @@ diff -up Python-2.7.3/Lib/test/test_gc.py.gc-assertions Python-2.7.3/Lib/test/te
### Tests
###############################################################################
@@ -476,6 +479,49 @@ class GCTests(unittest.TestCase):
@@ -537,6 +540,49 @@ class GCTests(unittest.TestCase):
# would be damaged, with an empty __dict__.
self.assertEqual(x, None)
@ -69,9 +71,10 @@ diff -up Python-2.7.3/Lib/test/test_gc.py.gc-assertions Python-2.7.3/Lib/test/te
class GCTogglingTests(unittest.TestCase):
def setUp(self):
gc.enable()
diff -up Python-2.7.3/Modules/gcmodule.c.gc-assertions Python-2.7.3/Modules/gcmodule.c
--- Python-2.7.3/Modules/gcmodule.c.gc-assertions 2012-04-09 19:07:34.000000000 -0400
+++ Python-2.7.3/Modules/gcmodule.c 2013-02-20 16:28:21.029536600 -0500
diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c
index 916e481..0233ce2 100644
--- a/Modules/gcmodule.c
+++ b/Modules/gcmodule.c
@@ -21,6 +21,73 @@
#include "Python.h"
#include "frameobject.h" /* for PyFrame_ClearFreeList */
@ -146,7 +149,7 @@ diff -up Python-2.7.3/Modules/gcmodule.c.gc-assertions Python-2.7.3/Modules/gcmo
/* Get an object's GC head */
#define AS_GC(o) ((PyGC_Head *)(o)-1)
@@ -288,7 +355,8 @@ update_refs(PyGC_Head *containers)
@@ -328,7 +395,8 @@ update_refs(PyGC_Head *containers)
{
PyGC_Head *gc = containers->gc.gc_next;
for (; gc != containers; gc = gc->gc.gc_next) {
@ -156,7 +159,7 @@ diff -up Python-2.7.3/Modules/gcmodule.c.gc-assertions Python-2.7.3/Modules/gcmo
gc->gc.gc_refs = Py_REFCNT(FROM_GC(gc));
/* Python's cyclic gc should never see an incoming refcount
* of 0: if something decref'ed to 0, it should have been
@@ -308,7 +376,8 @@ update_refs(PyGC_Head *containers)
@@ -348,7 +416,8 @@ update_refs(PyGC_Head *containers)
* so serious that maybe this should be a release-build
* check instead of an assert?
*/
@ -166,7 +169,7 @@ diff -up Python-2.7.3/Modules/gcmodule.c.gc-assertions Python-2.7.3/Modules/gcmo
}
}
@@ -323,7 +392,9 @@ visit_decref(PyObject *op, void *data)
@@ -363,7 +432,9 @@ visit_decref(PyObject *op, void *data)
* generation being collected, which can be recognized
* because only they have positive gc_refs.
*/
@ -177,7 +180,7 @@ diff -up Python-2.7.3/Modules/gcmodule.c.gc-assertions Python-2.7.3/Modules/gcmo
if (gc->gc.gc_refs > 0)
gc->gc.gc_refs--;
}
@@ -383,9 +454,10 @@ visit_reachable(PyObject *op, PyGC_Head
@@ -423,9 +494,10 @@ visit_reachable(PyObject *op, PyGC_Head *reachable)
* If gc_refs == GC_UNTRACKED, it must be ignored.
*/
else {
@ -191,7 +194,7 @@ diff -up Python-2.7.3/Modules/gcmodule.c.gc-assertions Python-2.7.3/Modules/gcmo
}
}
return 0;
@@ -427,7 +499,7 @@ move_unreachable(PyGC_Head *young, PyGC_
@@ -467,7 +539,7 @@ move_unreachable(PyGC_Head *young, PyGC_Head *unreachable)
*/
PyObject *op = FROM_GC(gc);
traverseproc traverse = Py_TYPE(op)->tp_traverse;
@ -200,7 +203,7 @@ diff -up Python-2.7.3/Modules/gcmodule.c.gc-assertions Python-2.7.3/Modules/gcmo
gc->gc.gc_refs = GC_REACHABLE;
(void) traverse(op,
(visitproc)visit_reachable,
@@ -494,7 +566,8 @@ move_finalizers(PyGC_Head *unreachable,
@@ -545,7 +617,8 @@ move_finalizers(PyGC_Head *unreachable, PyGC_Head *finalizers)
for (gc = unreachable->gc.gc_next; gc != unreachable; gc = next) {
PyObject *op = FROM_GC(gc);
@ -210,7 +213,7 @@ diff -up Python-2.7.3/Modules/gcmodule.c.gc-assertions Python-2.7.3/Modules/gcmo
next = gc->gc.gc_next;
if (has_finalizer(op)) {
@@ -570,7 +643,7 @@ handle_weakrefs(PyGC_Head *unreachable,
@@ -621,7 +694,7 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old)
PyWeakReference **wrlist;
op = FROM_GC(gc);
@ -219,7 +222,7 @@ diff -up Python-2.7.3/Modules/gcmodule.c.gc-assertions Python-2.7.3/Modules/gcmo
next = gc->gc.gc_next;
if (! PyType_SUPPORTS_WEAKREFS(Py_TYPE(op)))
@@ -591,9 +664,9 @@ handle_weakrefs(PyGC_Head *unreachable,
@@ -642,9 +715,9 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old)
* the callback pointer intact. Obscure: it also
* changes *wrlist.
*/
@ -231,7 +234,7 @@ diff -up Python-2.7.3/Modules/gcmodule.c.gc-assertions Python-2.7.3/Modules/gcmo
if (wr->wr_callback == NULL)
continue; /* no callback */
@@ -627,7 +700,7 @@ handle_weakrefs(PyGC_Head *unreachable,
@@ -678,7 +751,7 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old)
*/
if (IS_TENTATIVELY_UNREACHABLE(wr))
continue;
@ -240,7 +243,7 @@ diff -up Python-2.7.3/Modules/gcmodule.c.gc-assertions Python-2.7.3/Modules/gcmo
/* Create a new reference so that wr can't go away
* before we can process it again.
@@ -636,7 +709,8 @@ handle_weakrefs(PyGC_Head *unreachable,
@@ -687,7 +760,8 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old)
/* Move wr to wrcb_to_call, for the next pass. */
wrasgc = AS_GC(wr);
@ -250,7 +253,7 @@ diff -up Python-2.7.3/Modules/gcmodule.c.gc-assertions Python-2.7.3/Modules/gcmo
next isn't, so they can't
be the same */
gc_list_move(wrasgc, &wrcb_to_call);
@@ -652,11 +726,11 @@ handle_weakrefs(PyGC_Head *unreachable,
@@ -703,11 +777,11 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old)
gc = wrcb_to_call.gc.gc_next;
op = FROM_GC(gc);
@ -265,7 +268,7 @@ diff -up Python-2.7.3/Modules/gcmodule.c.gc-assertions Python-2.7.3/Modules/gcmo
/* copy-paste of weakrefobject.c's handle_callback() */
temp = PyObject_CallFunctionObjArgs(callback, wr, NULL);
@@ -759,7 +833,7 @@ delete_garbage(PyGC_Head *collectable, P
@@ -810,7 +884,7 @@ delete_garbage(PyGC_Head *collectable, PyGC_Head *old)
PyGC_Head *gc = collectable->gc.gc_next;
PyObject *op = FROM_GC(gc);

View File

@ -1,11 +0,0 @@
--- Python-2.7.5-orig/Tools/gdb/libpython.py 2013-05-12 03:32:54.000000000 +0000
+++ Python-2.7.5-orig/Tools/gdb/libpython.py 2013-09-15 09:56:25.494000000 +0000
@@ -887,6 +887,8 @@
newline character'''
if self.is_optimized_out():
return '(frame information optimized out)'
+ if self.filename() == '<string>':
+ return '(in an eval block)'
filename = self.filename()
try:
f = open(filename, 'r')

View File

@ -0,0 +1,70 @@
diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py
index 5021ebf..1903cc0 100644
--- a/Lib/ensurepip/__init__.py
+++ b/Lib/ensurepip/__init__.py
@@ -1,9 +1,10 @@
#!/usr/bin/env python2
from __future__ import print_function
+import distutils.version
+import glob
import os
import os.path
-import pkgutil
import shutil
import sys
import tempfile
@@ -12,9 +13,19 @@ import tempfile
__all__ = ["version", "bootstrap"]
-_SETUPTOOLS_VERSION = "40.6.2"
+_WHEEL_DIR = "/usr/share/python-wheels/"
-_PIP_VERSION = "18.1"
+def _get_most_recent_wheel_version(pkg):
+ prefix = os.path.join(_WHEEL_DIR, "{}-".format(pkg))
+ suffix = "-py2.py3-none-any.whl"
+ pattern = "{}*{}".format(prefix, suffix)
+ versions = (p[len(prefix):-len(suffix)] for p in glob.glob(pattern))
+ return str(max(versions, key=distutils.version.LooseVersion))
+
+
+_SETUPTOOLS_VERSION = _get_most_recent_wheel_version("setuptools")
+
+_PIP_VERSION = _get_most_recent_wheel_version("pip")
_PROJECTS = [
("setuptools", _SETUPTOOLS_VERSION),
@@ -28,8 +39,13 @@ def _run_pip(args, additional_paths=None):
sys.path = additional_paths + sys.path
# Install the bundled software
- import pip._internal
- return pip._internal.main(args)
+ try:
+ # pip 10
+ from pip._internal import main
+ except ImportError:
+ # pip 9
+ from pip import main
+ return main(args)
def version():
@@ -100,12 +116,9 @@ def _bootstrap(root=None, upgrade=False, user=False,
additional_paths = []
for project, version in _PROJECTS:
wheel_name = "{}-{}-py2.py3-none-any.whl".format(project, version)
- whl = pkgutil.get_data(
- "ensurepip",
- "_bundled/{}".format(wheel_name),
- )
- with open(os.path.join(tmpdir, wheel_name), "wb") as fp:
- fp.write(whl)
+ with open(os.path.join(_WHEEL_DIR, wheel_name), "rb") as sfp:
+ with open(os.path.join(tmpdir, wheel_name), "wb") as fp:
+ fp.write(sfp.read())
additional_paths.append(os.path.join(tmpdir, wheel_name))

View File

@ -0,0 +1,14 @@
diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py
index 9def56e..c0df208 100755
--- a/Tools/gdb/libpython.py
+++ b/Tools/gdb/libpython.py
@@ -939,6 +939,9 @@ class PyFrameObjectPtr(PyObjectPtr):
if self.is_optimized_out():
return '(frame information optimized out)'
+ if self.filename() == '<string>':
+ return '(in an eval block)'
+
lineno = self.current_line_num()
if lineno is None:
return '(failed to get frame line number)'

View File

@ -1,249 +0,0 @@
diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py
index 14c9adb..e20104e 100644
--- a/Lib/ensurepip/__init__.py
+++ b/Lib/ensurepip/__init__.py
@@ -7,6 +7,7 @@ import pkgutil
import shutil
import sys
import tempfile
+from ensurepip import rewheel
__all__ = ["version", "bootstrap"]
@@ -43,6 +44,8 @@ def _run_pip(args, additional_paths=None):
# Install the bundled software
import pip
+ if args[0] in ["install", "list", "wheel"]:
+ args.append('--pre')
pip.main(args)
@@ -93,21 +96,40 @@ def bootstrap(root=None, upgrade=False, user=False,
# omit pip and easy_install
os.environ["ENSUREPIP_OPTIONS"] = "install"
+ whls = []
+ rewheel_dir = None
+ # try to see if we have system-wide versions of _PROJECTS
+ dep_records = rewheel.find_system_records([p[0] for p in _PROJECTS])
+ # TODO: check if system-wide versions are the newest ones
+ # if --upgrade is used?
+ if all(dep_records):
+ # if we have all _PROJECTS installed system-wide, we'll recreate
+ # wheels from them and install those
+ rewheel_dir = tempfile.mkdtemp()
+ for dr in dep_records:
+ new_whl = rewheel.rewheel_from_record(dr, rewheel_dir)
+ whls.append(os.path.join(rewheel_dir, new_whl))
+ else:
+ # if we don't have all the _PROJECTS installed system-wide,
+ # let's just fall back to bundled wheels
+ for project, version in _PROJECTS:
+ whl = os.path.join(
+ os.path.dirname(__file__),
+ "_bundled",
+ "{}-{}-py2.py3-none-any.whl".format(project, version)
+ )
+ whls.append(whl)
+
tmpdir = tempfile.mkdtemp()
try:
# Put our bundled wheels into a temporary directory and construct the
# additional paths that need added to sys.path
additional_paths = []
- for project, version in _PROJECTS:
- wheel_name = "{}-{}-py2.py3-none-any.whl".format(project, version)
- whl = pkgutil.get_data(
- "ensurepip",
- "_bundled/{}".format(wheel_name),
- )
- with open(os.path.join(tmpdir, wheel_name), "wb") as fp:
- fp.write(whl)
-
- additional_paths.append(os.path.join(tmpdir, wheel_name))
+ for whl in whls:
+ shutil.copy(whl, tmpdir)
+ additional_paths.append(os.path.join(tmpdir, os.path.basename(whl)))
+ if rewheel_dir:
+ shutil.rmtree(rewheel_dir)
# Construct the arguments to be passed to the pip command
args = ["install", "--no-index", "--find-links", tmpdir]
diff --git a/Lib/ensurepip/rewheel/__init__.py b/Lib/ensurepip/rewheel/__init__.py
new file mode 100644
index 0000000..75c2094
--- /dev/null
+++ b/Lib/ensurepip/rewheel/__init__.py
@@ -0,0 +1,158 @@
+import argparse
+import codecs
+import csv
+import email.parser
+import os
+import io
+import re
+import site
+import subprocess
+import sys
+import zipfile
+
+def run():
+ parser = argparse.ArgumentParser(description='Recreate wheel of package with given RECORD.')
+ parser.add_argument('record_path',
+ help='Path to RECORD file')
+ parser.add_argument('-o', '--output-dir',
+ help='Dir where to place the wheel, defaults to current working dir.',
+ dest='outdir',
+ default=os.path.curdir)
+
+ ns = parser.parse_args()
+ retcode = 0
+ try:
+ print(rewheel_from_record(**vars(ns)))
+ except BaseException as e:
+ print('Failed: {}'.format(e))
+ retcode = 1
+ sys.exit(1)
+
+def find_system_records(projects):
+ """Return list of paths to RECORD files for system-installed projects.
+
+ If a project is not installed, the resulting list contains None instead
+ of a path to its RECORD
+ """
+ records = []
+ # get system site-packages dirs
+ if hasattr(sys, 'real_prefix'):
+ #we are in python2 virtualenv and sys.real_prefix is the original sys.prefix
+ _orig_prefixes = site.PREFIXES
+ setattr(site, 'PREFIXES', [sys.real_prefix]*2)
+ sys_sitepack = site.getsitepackages()
+ setattr(site, 'PREFIXES', _orig_prefixes)
+ elif hasattr(sys, 'base_prefix'): # python3 venv doesn't inject real_prefix to sys
+ # we are on python3 and base(_exec)_prefix is unchanged in venv
+ sys_sitepack = site.getsitepackages([sys.base_prefix, sys.base_exec_prefix])
+ else:
+ # we are in python2 without virtualenv
+ sys_sitepack = site.getsitepackages()
+
+ sys_sitepack = [sp for sp in sys_sitepack if os.path.exists(sp)]
+ # try to find all projects in all system site-packages
+ for project in projects:
+ path = None
+ for sp in sys_sitepack:
+ dist_info_re = os.path.join(sp, project) + '-[^\{0}]+\.dist-info'.format(os.sep)
+ candidates = [os.path.join(sp, p) for p in os.listdir(sp)]
+ # filter out candidate dirs based on the above regexp
+ filtered = [c for c in candidates if re.match(dist_info_re, c)]
+ # if we have 0 or 2 or more dirs, something is wrong...
+ if len(filtered) == 1:
+ path = filtered[0]
+ if path is not None:
+ records.append(os.path.join(path, 'RECORD'))
+ else:
+ records.append(None)
+ return records
+
+def rewheel_from_record(record_path, outdir):
+ """Recreates a whee of package with given record_path and returns path
+ to the newly created wheel."""
+ site_dir = os.path.dirname(os.path.dirname(record_path))
+ record_relpath = record_path[len(site_dir):].strip(os.path.sep)
+ to_write, to_omit = get_records_to_pack(site_dir, record_relpath)
+ new_wheel_name = get_wheel_name(record_path)
+ new_wheel_path = os.path.join(outdir, new_wheel_name + '.whl')
+
+ new_wheel = zipfile.ZipFile(new_wheel_path, mode='w', compression=zipfile.ZIP_DEFLATED)
+ # we need to write a new record with just the files that we will write,
+ # e.g. not binaries and *.pyc/*.pyo files
+ if sys.version_info[0] < 3:
+ new_record = io.BytesIO()
+ else:
+ new_record = io.StringIO()
+ writer = csv.writer(new_record)
+
+ # handle files that we can write straight away
+ for f, sha_hash, size in to_write:
+ new_wheel.write(os.path.join(site_dir, f), arcname=f)
+ writer.writerow([f, sha_hash,size])
+
+ # rewrite the old wheel file with a new computed one
+ writer.writerow([record_relpath, '', ''])
+ new_wheel.writestr(record_relpath, new_record.getvalue())
+
+ new_wheel.close()
+
+ return new_wheel.filename
+
+def get_wheel_name(record_path):
+ """Return proper name of the wheel, without .whl."""
+
+ wheel_info_path = os.path.join(os.path.dirname(record_path), 'WHEEL')
+ with codecs.open(wheel_info_path, encoding='utf-8') as wheel_info_file:
+ wheel_info = email.parser.Parser().parsestr(wheel_info_file.read().encode('utf-8'))
+
+ metadata_path = os.path.join(os.path.dirname(record_path), 'METADATA')
+ with codecs.open(metadata_path, encoding='utf-8') as metadata_file:
+ metadata = email.parser.Parser().parsestr(metadata_file.read().encode('utf-8'))
+
+ # construct name parts according to wheel spec
+ distribution = metadata.get('Name')
+ version = metadata.get('Version')
+ build_tag = '' # nothing for now
+ lang_tag = []
+ for t in wheel_info.get_all('Tag'):
+ lang_tag.append(t.split('-')[0])
+ lang_tag = '.'.join(lang_tag)
+ abi_tag, plat_tag = wheel_info.get('Tag').split('-')[1:3]
+ # leave out build tag, if it is empty
+ to_join = filter(None, [distribution, version, build_tag, lang_tag, abi_tag, plat_tag])
+ return '-'.join(list(to_join))
+
+def get_records_to_pack(site_dir, record_relpath):
+ """Accepts path of sitedir and path of RECORD file relative to it.
+ Returns two lists:
+ - list of files that can be written to new RECORD straight away
+ - list of files that shouldn't be written or need some processing
+ (pyc and pyo files, scripts)
+ """
+ record_file_path = os.path.join(site_dir, record_relpath)
+ with codecs.open(record_file_path, encoding='utf-8') as record_file:
+ record_contents = record_file.read()
+ # temporary fix for https://github.com/pypa/pip/issues/1376
+ # we need to ignore files under ".data" directory
+ data_dir = os.path.dirname(record_relpath).strip(os.path.sep)
+ data_dir = data_dir[:-len('dist-info')] + 'data'
+
+ to_write = []
+ to_omit = []
+ for l in record_contents.splitlines():
+ spl = l.split(',')
+ if len(spl) == 3:
+ # new record will omit (or write differently):
+ # - abs paths, paths with ".." (entry points),
+ # - pyc+pyo files
+ # - the old RECORD file
+ # TODO: is there any better way to recognize an entry point?
+ if os.path.isabs(spl[0]) or spl[0].startswith('..') or \
+ spl[0].endswith('.pyc') or spl[0].endswith('.pyo') or \
+ spl[0] == record_relpath or spl[0].startswith(data_dir):
+ to_omit.append(spl)
+ else:
+ to_write.append(spl)
+ else:
+ pass # bad RECORD or empty line
+ return to_write, to_omit
diff --git a/Makefile.pre.in b/Makefile.pre.in
index ca33158..44bdde5 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -1066,7 +1066,7 @@ LIBSUBDIRS= lib-tk lib-tk/test lib-tk/test/test_tkinter \
test/tracedmodules \
encodings compiler hotshot \
email email/mime email/test email/test/data \
- ensurepip ensurepip/_bundled \
+ ensurepip ensurepip/_bundled ensurepip/rewheel\
json json/tests \
sqlite3 sqlite3/test \
logging bsddb bsddb/test csv importlib wsgiref \

View File

@ -1,88 +0,0 @@
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

@ -1,184 +0,0 @@
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

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

View File

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

View File

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

View File

@ -0,0 +1,69 @@
diff --git a/setup.py b/setup.py
index 585e380..9993f11 100644
--- a/setup.py
+++ b/setup.py
@@ -1346,11 +1346,7 @@ class PyBuildExt(build_ext):
else:
missing.append('resource')
- nis = self._detect_nis(inc_dirs, lib_dirs)
- if nis is not None:
- exts.append(nis)
- else:
- missing.append('nis')
+ # nis (Sun yellow pages) is handled in Setup.dist
# Curses support, requiring the System V version of curses, often
# provided by the ncurses library.
@@ -2162,51 +2158,6 @@ class PyBuildExt(build_ext):
# for dlopen, see bpo-32647
ext.libraries.append('dl')
- def _detect_nis(self, inc_dirs, lib_dirs):
- if host_platform in {'win32', 'cygwin', 'qnx6'}:
- return None
-
- libs = []
- library_dirs = []
- includes_dirs = []
-
- # bpo-32521: glibc has deprecated Sun RPC for some time. Fedora 28
- # moved headers and libraries to libtirpc and libnsl. The headers
- # are in tircp and nsl sub directories.
- rpcsvc_inc = find_file(
- 'rpcsvc/yp_prot.h', inc_dirs,
- [os.path.join(inc_dir, 'nsl') for inc_dir in inc_dirs]
- )
- rpc_inc = find_file(
- 'rpc/rpc.h', inc_dirs,
- [os.path.join(inc_dir, 'tirpc') for inc_dir in inc_dirs]
- )
- if rpcsvc_inc is None or rpc_inc is None:
- # not found
- return None
- includes_dirs.extend(rpcsvc_inc)
- includes_dirs.extend(rpc_inc)
-
- if self.compiler.find_library_file(lib_dirs, 'nsl'):
- libs.append('nsl')
- else:
- # libnsl-devel: check for libnsl in nsl/ subdirectory
- nsl_dirs = [os.path.join(lib_dir, 'nsl') for lib_dir in lib_dirs]
- libnsl = self.compiler.find_library_file(nsl_dirs, 'nsl')
- if libnsl is not None:
- library_dirs.append(os.path.dirname(libnsl))
- libs.append('nsl')
-
- if self.compiler.find_library_file(lib_dirs, 'tirpc'):
- libs.append('tirpc')
-
- return Extension(
- 'nis', ['nismodule.c'],
- libraries=libs,
- library_dirs=library_dirs,
- include_dirs=includes_dirs
- )
-
class PyBuildInstall(install):
# Suppress the warning about installation into the lib_dynload

2
pynche
View File

@ -1,2 +1,2 @@
#!/bin/bash
exec `python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(plat_specific = True))"`/pynche/pynche
exec `python2 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(plat_specific = True))"`/pynche/pynche

View File

@ -1,5 +1,7 @@
--- Python-2.7.4/Modules/Setup.dist.rhconfig 2013-04-06 16:02:34.000000000 +0200
+++ Python-2.7.4/Modules/Setup.dist 2013-04-08 10:05:16.369985654 +0200
diff --git a/Modules/Setup.dist b/Modules/Setup.dist
index bbc9222..2cf35a9 100644
--- a/Modules/Setup.dist
+++ b/Modules/Setup.dist
@@ -153,7 +153,7 @@ GLHACK=-Dclear=__GLclear
# modules are to be built as shared libraries (see above for more
# detail; also note that *static* reverses this effect):
@ -9,7 +11,7 @@
# GNU readline. Unlike previous Python incarnations, GNU readline is
# now incorporated in an optional module, configured in the Setup file
@@ -163,77 +163,77 @@ GLHACK=-Dclear=__GLclear
@@ -163,33 +163,33 @@ GLHACK=-Dclear=__GLclear
# it, depending on your system -- see the GNU readline instructions.
# It's okay for this to be a shared library, too.
@ -59,9 +61,7 @@
# Standard I/O baseline
#_io -I$(srcdir)/Modules/_io _io/bufferedio.c _io/bytesio.c _io/fileio.c _io/iobase.c _io/_iomodule.c _io/stringio.c _io/textio.c
# Modules with some UNIX dependencies -- on by default:
@@ -199,41 +199,41 @@ GLHACK=-Dclear=__GLclear
# (If you have a really backward UNIX, select and socket may not be
# supported...)
@ -111,13 +111,13 @@
-#nis nismodule.c -lnsl # Sun yellow pages -- not everywhere
-#termios termios.c # Steen Lumholt's termios module
-#resource resource.c # Jeremy Hylton's rlimit interface
+nis nismodule.c -lnsl # Sun yellow pages -- not everywhere
+nis nismodule.c -lnsl -ltirpc -I/usr/include/tirpc -I/usr/include/nsl -L/usr/lib/nsl
+termios termios.c # Steen Lumholt's termios module
+resource resource.c # Jeremy Hylton's rlimit interface
# Multimedia modules -- off by default.
@@ -238,8 +238,8 @@ GLHACK=-Dclear=__GLclear
@@ -241,8 +241,8 @@ GLHACK=-Dclear=__GLclear
# #993173 says audioop works on 64-bit platforms, though.
# These represent audio samples or images as strings:
@ -128,7 +128,7 @@
# Note that the _md5 and _sha modules are normally only built if the
@@ -249,14 +249,14 @@ GLHACK=-Dclear=__GLclear
@@ -252,14 +252,14 @@ GLHACK=-Dclear=__GLclear
# Message-Digest Algorithm, described in RFC 1321. The necessary files
# md5.c and md5.h are included here.
@ -147,7 +147,7 @@
# SGI IRIX specific modules -- off by default.
@@ -303,12 +303,12 @@ GLHACK=-Dclear=__GLclear
@@ -306,12 +306,12 @@ GLHACK=-Dclear=__GLclear
# A Linux specific module -- off by default; this may also work on
# some *BSDs.
@ -162,7 +162,7 @@
# The _tkinter module.
@@ -323,7 +323,7 @@ GLHACK=-Dclear=__GLclear
@@ -326,7 +326,7 @@ GLHACK=-Dclear=__GLclear
# every system.
# *** Always uncomment this (leave the leading underscore in!):
@ -171,7 +171,7 @@
# *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
# -L/usr/local/lib \
# *** Uncomment and edit to reflect where your Tcl/Tk headers are:
@@ -333,7 +333,7 @@ GLHACK=-Dclear=__GLclear
@@ -336,7 +336,7 @@ GLHACK=-Dclear=__GLclear
# *** Or uncomment this for Solaris:
# -I/usr/openwin/include \
# *** Uncomment and edit for Tix extension only:
@ -180,7 +180,7 @@
# *** Uncomment and edit for BLT extension only:
# -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \
# *** Uncomment and edit for PIL (TkImaging) extension only:
@@ -342,7 +342,7 @@ GLHACK=-Dclear=__GLclear
@@ -345,7 +345,7 @@ GLHACK=-Dclear=__GLclear
# *** Uncomment and edit for TOGL extension only:
# -DWITH_TOGL togl.c \
# *** Uncomment and edit to reflect your Tcl/Tk versions:
@ -189,7 +189,7 @@
# *** Uncomment and edit to reflect where your X11 libraries are:
# -L/usr/X11R6/lib \
# *** Or uncomment this for Solaris:
@@ -352,7 +352,7 @@ GLHACK=-Dclear=__GLclear
@@ -355,7 +355,7 @@ GLHACK=-Dclear=__GLclear
# *** Uncomment for AIX:
# -lld \
# *** Always uncomment this; X11 libraries to link with:
@ -198,7 +198,7 @@
# Lance Ellinghaus's syslog module
#syslog syslogmodule.c # syslog daemon interface
@@ -374,7 +374,7 @@ GLHACK=-Dclear=__GLclear
@@ -377,7 +377,7 @@ GLHACK=-Dclear=__GLclear
# it is a highly experimental and dangerous device for calling
# *arbitrary* C functions in *arbitrary* shared libraries:
@ -207,7 +207,7 @@
# Modules that provide persistent dictionary-like semantics. You will
@@ -397,7 +397,7 @@ GLHACK=-Dclear=__GLclear
@@ -400,7 +400,7 @@ GLHACK=-Dclear=__GLclear
#
# First, look at Setup.config; configure may have set this for you.
@ -216,7 +216,7 @@
# Sleepycat Berkeley DB interface.
@@ -412,11 +412,9 @@ GLHACK=-Dclear=__GLclear
@@ -415,11 +415,9 @@ GLHACK=-Dclear=__GLclear
#
# Edit the variables DB and DBLIBVERto point to the db top directory
# and the subdirectory of PORT where you built it.
@ -231,7 +231,7 @@
# Historical Berkeley DB 1.85
#
@@ -431,14 +430,14 @@ GLHACK=-Dclear=__GLclear
@@ -434,14 +432,14 @@ GLHACK=-Dclear=__GLclear
# Helper module for various ascii-encoders
@ -250,7 +250,7 @@
# Lee Busby's SIGFPE modules.
@@ -461,7 +460,7 @@ GLHACK=-Dclear=__GLclear
@@ -464,7 +462,7 @@ GLHACK=-Dclear=__GLclear
# Andrew Kuchling's zlib module.
# This require zlib 1.1.3 (or later).
# See http://www.gzip.org/zlib/
@ -258,20 +258,21 @@
+zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
# Interface to the Expat XML parser
#
@@ -480,14 +479,14 @@ GLHACK=-Dclear=__GLclear
# More information on Expat can be found at www.libexpat.org.
@@ -475,14 +473,14 @@ GLHACK=-Dclear=__GLclear
# Hye-Shik Chang's CJKCodecs
# multibytecodec is required for all the other CJK codec modules
-#_multibytecodec cjkcodecs/multibytecodec.c
+_multibytecodec cjkcodecs/multibytecodec.c
-
-#_codecs_cn cjkcodecs/_codecs_cn.c
-#_codecs_hk cjkcodecs/_codecs_hk.c
-#_codecs_iso2022 cjkcodecs/_codecs_iso2022.c
-#_codecs_jp cjkcodecs/_codecs_jp.c
-#_codecs_kr cjkcodecs/_codecs_kr.c
-#_codecs_tw cjkcodecs/_codecs_tw.c
+_multibytecodec cjkcodecs/multibytecodec.c
+
+_codecs_cn cjkcodecs/_codecs_cn.c
+_codecs_hk cjkcodecs/_codecs_hk.c
+_codecs_iso2022 cjkcodecs/_codecs_iso2022.c

View File

@ -5,13 +5,18 @@
# Note that the bcond macros are named for the CLI option they create.
# "%%bcond_without" means "ENABLE by default and create a --without option"
# Ability to reuse RPM-installed pip using rewheel
%bcond_without rewheel
# Whether to use RPM build wheels from the python-{pip,setuptools}-wheel package
# Uses upstream bundled prebuilt wheels otherwise
%bcond_without rpmwheels
# Extra build for debugging the interpreter or C-API extensions
# (the -debug subpackages)
%bcond_without debug_build
# Only use this when bootstrapping python3
# Needed to build setuptools for the first time
%bcond_with python3_bootstrap
%global unicode ucs4
%global python python2
@ -62,18 +67,14 @@
%bcond_without tests
%endif
# Some of the files below /usr/lib/pythonMAJOR.MINOR/test (e.g. bad_coding.py)
# are deliberately invalid, leading to SyntaxError exceptions if they get
# byte-compiled.
#
# These errors are ignored by the normal python build, and aren't normally a
# problem in the buildroots since /usr/bin/python isn't present.
#
# However, for the case where we're rebuilding the python srpm on a machine
# that does have python installed we need to set this to avoid
# brp-python-bytecompile treating these as fatal errors:
#
%global _python_bytecompile_errors_terminate_build 0
# Disable automatic bytecompilation. The python2.7 binary is not yet
# available in /usr/bin when Python is built. Also, the bytecompilation fails
# on files that test invalid syntax.
%undefine __brp_python_bytecompile
# The above is broken now
# https://bugzilla.redhat.com/show_bug.cgi?id=1597664
# This is an older non-standard way to disable the brp script, as a workaround
%undefine py_auto_byte_compile
# We need to get a newer configure generated out of configure.in for the following
# patches:
@ -104,20 +105,34 @@
# the rest of the build
%global regenerate_autotooling_patch 0
# Python 2 is deprecated in Fedora 30+, see:
# https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
# This means that new packages MUST NOT depend on python2, even transitively
# see: https://fedoraproject.org/wiki/Packaging:Deprecating_Packages
# Python 2 will not be supported after 2019. Use the python3 package instead
# if possible.
%if 0%{fedora} >= 30
%global deprecated Provides: deprecated()
%endif
# ==================
# Top-level metadata
# ==================
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.14
Release: 6%{?dist}
# Remember to also rebase python2-docs when changing this:
%global general_version %{pybasever}.16
#global prerel ...
%global upstream_version %{general_version}%{?prerel}
Version: %{general_version}%{?prerel:~%{prerel}}
Release: 1%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
Provides: python(abi) = %{pybasever}
%?deprecated
# =======================
# Build-time requirements
@ -131,17 +146,23 @@ BuildRequires: bluez-libs-devel
%endif
BuildRequires: bzip2
BuildRequires: bzip2-devel
BuildRequires: glibc-all-langpacks
BuildRequires: glibc-devel
BuildRequires: gmp-devel
BuildRequires: libdb-devel
BuildRequires: libffi-devel
BuildRequires: ncurses-devel
BuildRequires: openssl-devel
BuildRequires: pkgconfig
BuildRequires: readline-devel
BuildRequires: sqlite-devel
BuildRequires: tcl-devel
BuildRequires: openssl-devel
# For the nis module
BuildRequires: libnsl2-devel
BuildRequires: libtirpc-devel
# expat 2.1.0 added the symbol XML_SetHashSalt without bumping SONAME. We use
# it (in pyexpat) in order to enable the fix in Python-2.7.3 for CVE-2012-0876:
BuildRequires: expat-devel >= 2.1.0
@ -176,23 +197,33 @@ BuildRequires: valgrind-devel
BuildRequires: zlib-devel
%if %{with rewheel}
BuildRequires: python2-setuptools
Requires: python2-setuptools
%if %{with rpmwheels}
BuildRequires: python-setuptools-wheel
BuildRequires: python-pip-wheel
%endif
%if ! 0%{?_module_build}
BuildRequires: python2-pip
Requires: python2-pip
%endif # !module_build
%endif # rewheel
# Providing python27 as now multiple interpreters exist in Fedora
# alongside the system one e.g. python26, python33 etc
Provides: python27 = %{version}-%{release}
# https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package
# We recommend /usr/bin/python so users get it by default
# Versioned recommends are problematic, and we know that the package requires
# python2 back with fixed version, so we just use the path here:
Recommends: %{_bindir}/python
# Previously, this was required for our rewheel patch to work.
# This is technically no longer needed, but we keep it recommended
# for the developer experience.
Recommends: python2-setuptools
Recommends: python2-pip
# =======================
# Source code and patches
# =======================
Source: https://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz
Source: https://www.python.org/ftp/python/%{version}/Python-%{upstream_version}.tar.xz
# Work around bug 562906 until it's fixed in rpm-build by providing a fixed
# version of pythondeps.sh:
@ -228,6 +259,7 @@ Source7: pynche
# - various modules are built by default by upstream as static libraries;
# we built them as shared libraries
# - build the "readline" module (appears to also be handled by setup.py now)
# - build the nis module (which needs the tirpc library since glibc 2.26)
# - enable the build of the following modules:
# - array arraymodule.c # array objects
# - cmath cmathmodule.c # -lm # complex math library functions
@ -254,7 +286,6 @@ Source7: pynche
# - _socket socketmodule.c # Socket module helper for socket(2)
# - _ssl _ssl.c
# - crypt cryptmodule.c -lcrypt # crypt(3)
# - nis nismodule.c -lnsl # Sun yellow pages -- not everywhere
# - termios termios.c # Steen Lumholt's termios module
# - resource resource.c # Jeremy Hylton's rlimit interface
# - audioop audioop.c # Operations on audio samples
@ -705,10 +736,15 @@ Patch185: 00185-urllib2-honors-noproxy-for-ftp.patch
Patch187: 00187-add-RPATH-to-pyexpat.patch
# 00189 #
# Instead of bundled wheels, use our RPM packaged wheels from
# /usr/share/python-wheels
Patch189: 00189-use-rpm-wheels.patch
# 00190 #
# Fixes gdb py-bt command not to raise exception while processing
# statements from eval
# rhbz#1008154 (patch by Attila Fazekas)
Patch189: 00189-gdb-py-bt-dont-raise-exception-from-eval.patch
Patch190: 00190-gdb-py-bt-dont-raise-exception-from-eval.patch
# 00191 #
# Disabling NOOP test as it fails without internet connection
@ -721,38 +757,10 @@ Patch191: 00191-disable-NOOP.patch
# Patch provided by John C. Peterson
Patch193: 00193-enable-loading-sqlite-extensions.patch
# 00198 #
Patch198: 00198-add-rewheel-module.patch
# 00280 #
# The test `test_regrtest.test_crashed` fails on s390x architecture.
# https://bugs.python.org/issue31719
Patch280: 00280-Fix-test_regrtest-test_crashed-on-s390x.patch
# 00283 #
# Fix tests on debug build configured with COUNT_ALLOCS,
# and add a new environment variable PYTHONSHOWALLOCCOUNT:
# https://bugs.python.org/issue31692
Patch283: 00283-fix-tests_with_COUNT_ALLOCS.patch
# 00284 #
# Add a new PYTHONSHOWREFCOUNT environment variable. In debug mode, Python now
# will print the total reference count if PYTHONSHOWREFCOUNT is set.
# Backported from upstream: https://bugs.python.org/issue31733
Patch284: 00284-add-PYTHONSHOWREFCOUNT-env-var.patch
# 00285 #
# Fix nondeterministic read in test_pty which fails randomly in koji.
# Fixed upstream: https://bugs.python.org/issue31158
Patch285: 00285-fix-non-deterministic-read-in-test_pty.patch
# 00287 #
# On the creation of io.FileIO() and builtin file() objects the GIL is now released
# when checking the file descriptor. io.FileIO.readall(), io.FileIO.read(), and
# file.read() also now release the GIL when getting the file size, which fixes hanging
# of all threads when trying to access an inaccessible NFS server.
# Fixed upstream: https://bugs.python.org/issue32186
Patch287: 00287-fix-thread-hanging-on-inaccessible-nfs-server.patch
# 00289 #
# Disable automatic detection for the nis module
# (we handle it it in Setup.dist, see Patch0)
Patch289: 00289-disable-nis-detection.patch
# (New patches go here ^^^)
#
@ -776,20 +784,6 @@ Patch5000: 05000-autotool-intermediates.patch
# Additional metadata, and subpackages
# ======================================================
Provides: python = %{version}-%{release}
Provides: python%{?_isa} = %{version}-%{release}
# All the obsolete tags similar to this one should be removed at Fedora 28
# Also, according to the guidelines, this should be a hardcoded version,
# but that was proven problematic, see rhbz#1457336
Obsoletes: python < %{version}-%{release}
# Providing python27 as now multiple interpreters exist in Fedora
# alongside the system one e.g. python26, python33 etc
Provides: python27 = %{version}-%{release}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
URL: https://www.python.org/
%description
@ -805,9 +799,26 @@ package.
This package provides the "python2" executable; most of the actual
implementation is within the "python2-libs" package.
%package -n python-unversioned-command
Summary: The "python" command that runs Python 2
BuildArch: noarch
# https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package
%?deprecated
# In theory this could require any python2 version
Requires: python2 == %{version}-%{release}
# But since we want to provide versioned python, we require exact version
Provides: python = %{version}-%{release}
# This also save us an explicit conflict for older python2 builds
%description -n python-unversioned-command
This package contains /usr/bin/python - the "python" command that runs Python 2.
%package libs
Summary: Runtime libraries for Python 2
Group: Applications/System
%?deprecated
# Needed for ctypes, to load libraries, worked around for Live CDs size
# Requires: binutils
@ -826,22 +837,45 @@ Requires: glibc%{?_isa} >= 2.24.90-26
Requires: gdbm%{?_isa} >= 1:1.13
%endif
%if %{with rpmwheels}
Requires: python-setuptools-wheel
Requires: python-pip-wheel
%else
Provides: bundled(python2-pip) = 18.1
Provides: bundled(python2-setuptools) = 40.6.2
%endif
Provides: python-libs = %{version}-%{release}
Provides: python-libs%{?_isa} = %{version}-%{release}
Obsoletes: python-libs < %{version}-%{release}
%description libs
This package contains files used to embed Python 2 into applications.
%package devel
Summary: Libraries and header files needed for Python 2 development
Group: Development/Libraries
%?deprecated
Requires: %{python}%{?_isa} = %{version}-%{release}
Requires: python-rpm-macros
Requires: python2-rpm-macros
Requires: python3-rpm-generators
Requires: pkgconfig
%if %{without python3_bootstrap}
# When bootstrapping python3, we need to build setuptools
# But setuptools BR python2-devel and that brings in python3-rpm-generators
# python3-rpm-generators needs python3-setuptools, so we cannot have it yet
Requires: python3-rpm-generators
%endif
# This is not "API" (packages that need setuptools should still BuildRequire it)
# However some packages apparently can build both with and without setuptools
# producing egg-info as file or directory (depending on setuptools presence).
# Directory-to-file updates are problematic in RPM, so we ensure setuptools is
# installed when -devel is required.
# See https://bugzilla.redhat.com/show_bug.cgi?id=1623922
# See https://fedoraproject.org/wiki/Packaging:Directory_Replacement
Requires: python2-setuptools
# https://bugzilla.redhat.com/show_bug.cgi?id=1217376
# https://bugzilla.redhat.com/show_bug.cgi?id=1496757
# https://bugzilla.redhat.com/show_bug.cgi?id=1218294
@ -854,7 +888,6 @@ Conflicts: %{python} < %{version}-%{release}
Provides: python-devel = %{version}-%{release}
Provides: python-devel%{?_isa} = %{version}-%{release}
Obsoletes: python-devel < %{version}-%{release}
%description devel
This package contains libraries and header files used to build applications
@ -862,13 +895,13 @@ with and native libraries for Python 2
%package tools
Summary: A collection of development tools included with Python 2
Group: Development/Tools
%?deprecated
Requires: %{name} = %{version}-%{release}
Requires: %{python}-tkinter = %{version}-%{release}
Provides: python-tools = %{version}-%{release}
Provides: python-tools%{?_isa} = %{version}-%{release}
Obsoletes: python-tools < %{version}-%{release}
%description tools
This package includes several tools to help with the development of Python 2
@ -877,7 +910,8 @@ color editor (pynche), and a python gettext program (pygettext.py).
%package tkinter
Summary: A graphical user interface for the Python 2 scripting language
Group: Development/Languages
%?deprecated
Requires: %{name} = %{version}-%{release}
Provides: tkinter = %{version}-%{release}
@ -886,7 +920,6 @@ Provides: tkinter2 = %{version}-%{release}
Provides: tkinter2%{?_isa} = %{version}-%{release}
Provides: python-tkinter = %{version}-%{release}
Provides: python-tkinter%{?_isa} = %{version}-%{release}
Obsoletes: tkinter < %{version}-%{release}
%description tkinter
@ -898,12 +931,12 @@ user interface for Python 2 programming.
%package test
Summary: The test modules from the main python2 package
Group: Development/Languages
%?deprecated
Requires: %{name} = %{version}-%{release}
Provides: python-test = %{version}-%{release}
Provides: python-test%{?_isa} = %{version}-%{release}
Obsoletes: python-test < %{version}-%{release}
%description test
@ -912,12 +945,12 @@ These have been removed to save space, as they are never or almost
never used in production.
You might want to install the python2-test package if you're developing python 2
code that uses more than just unittest and/or test_support.py.
code that uses more than just unittest and/or test.support.
%if %{with debug_build}
%package debug
Summary: Debug version of the Python 2 runtime
Group: Applications/System
%?deprecated
# The debug build is an all-in-one package version of the regular build, and
# shares the same .py/.pyc files and directories as the regular build. Hence
@ -931,7 +964,6 @@ Requires: %{name}-tools%{?_isa} = %{version}-%{release}
Provides: python-debug = %{version}-%{release}
Provides: python-debug%{?_isa} = %{version}-%{release}
Obsoletes: python-debug < %{version}-%{release}
%description debug
python2-debug provides a version of the Python 2 runtime with numerous debugging
@ -957,7 +989,7 @@ load its own extensions.
# ======================================================
%prep
%setup -q -n Python-%{version}
%setup -q -n Python-%{upstream_version}
%if 0%{?with_systemtap}
# Provide an example of usage of the tapset:
@ -1066,18 +1098,16 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch181 -p1
%patch185 -p1
%patch187 -p1
%if %{with rpmwheels}
%patch189 -p1
rm Lib/ensurepip/_bundled/*.whl
%endif
%patch190 -p1
%patch191 -p1
%patch193 -p1
%if %{with rewheel}
%patch198 -p1
%endif
%patch280 -p1
%patch283 -p1
%patch284 -p1
%patch285 -p1
%patch287 -p1
%patch289 -p1
%if 0%{?_module_build}
%patch4000 -p1
@ -1183,10 +1213,16 @@ make EXTRA_CFLAGS="$CFLAGS" %{?_smp_mflags}
# optimized python binary:
if $PathFixWithThisBinary
then
# pathfix.py currently only works with files matching ^[a-zA-Z0-9_]+\.py$
# when crawling through directories, so we handle the special cases manually
LD_LIBRARY_PATH="$topdir/$ConfDir" ./$BinaryName \
$topdir/Tools/scripts/pathfix.py \
-i "/usr/bin/env $BinaryName" \
$topdir
-i "%{_bindir}/python%{pybasever}" \
$topdir \
$topdir/Tools/pynche/pynche \
$topdir/Demo/pdist/{rcvs,rcsbump,rrcs} \
$topdir/Demo/scripts/find-uname.py \
$topdir/Tools/scripts/reindent-rst.py
fi
# Rebuild with new python
@ -1271,7 +1307,7 @@ make install DESTDIR=%{buildroot}
#
%if 0%{?with_gdb_hooks}
DirHoldingGdbPy=%{_prefix}/lib/debug/%{_libdir}
PathOfGdbPy=$DirHoldingGdbPy/$PyInstSoName.debug-gdb.py
PathOfGdbPy=$DirHoldingGdbPy/$PyInstSoName-%{version}-%{release}.%{_arch}.debug-gdb.py
mkdir -p %{buildroot}$DirHoldingGdbPy
cp $topdir/Tools/gdb/libpython.py %{buildroot}$PathOfGdbPy
@ -1498,10 +1534,25 @@ sed \
%endif # with debug_build
%endif # with_systemtap
# Do bytecompilation with the newly installed interpreter.
# compile *.pyo
find %{buildroot} -type f -a -name "*.py" -print0 | \
LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \
PYTHONPATH="%{buildroot}%{_libdir}/python%{pybasever} %{buildroot}%{_libdir}/python%{pybasever}/site-packages" \
xargs -0 %{buildroot}%{_bindir}/python%{pybasever} -O -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("%{buildroot}")[2]) for f in sys.argv[1:]]' || :
# compile *.pyc
find %{buildroot} -type f -a -name "*.py" -print0 | \
LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \
PYTHONPATH="%{buildroot}%{_libdir}/python%{pybasever} %{buildroot}%{_libdir}/python%{pybasever}/site-packages" \
xargs -0 %{buildroot}%{_bindir}/python%{pybasever} -c 'import py_compile, sys; [py_compile.compile(f, dfile=f.partition("%{buildroot}")[2]) for f in sys.argv[1:]]' || :
# Make library-files user writable
/usr/bin/chmod 755 %{buildroot}%{dynload_dir}/*.so
/usr/bin/chmod 755 %{buildroot}%{_libdir}/libpython%{pybasever}.so.1.0
%if %{with debug_build}
/usr/bin/chmod 755 %{buildroot}%{_libdir}/libpython%{pybasever}_d.so.1.0
%endif
# ======================================================
@ -1515,6 +1566,8 @@ CheckPython() {
BinaryName=$2
ConfDir=$(pwd)/build/$ConfName
export OPENSSL_CONF=/non-existing-file
echo STARTING: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName
# Note that we're running the tests using the version of the code in the
@ -1553,6 +1606,10 @@ CheckPython() {
%if %{with tests}
# no locale coercion in python2
# test_ssl:test_load_dh_params shutil.copies into unicode filename
export LC_ALL=C.utf-8
# Check each of the configurations:
%if %{with debug_build}
CheckPython \
@ -1570,33 +1627,21 @@ CheckPython \
# Cleaning up
# ======================================================
%clean
rm -fr %{buildroot}
# ======================================================
# Scriptlets
# ======================================================
%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
%files
%defattr(-, root, root, -)
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc README
%{_bindir}/pydoc*
%{_bindir}/python
%{_bindir}/%{python}
%{_bindir}/python%{pybasever}
%{_mandir}/*/*
%{_mandir}/*/python2*
%files -n python-unversioned-command
%{_bindir}/python
%{_mandir}/*/python.1.*
%files libs
%defattr(-,root,root,-)
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc README
@ -1608,7 +1653,7 @@ rm -fr %{buildroot}
%{dynload_dir}/_sha512module.so
%{dynload_dir}/_shamodule.so
%{dynload_dir}/Python-%{version}-py%{pybasever}.egg-info
%{dynload_dir}/Python-%{upstream_version}-py%{pybasever}.egg-info
%{dynload_dir}/_bisectmodule.so
%{dynload_dir}/_bsddb.so
%{dynload_dir}/_codecs_cn.so
@ -1712,9 +1757,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
@ -1741,16 +1792,15 @@ rm -fr %{buildroot}
%dir %{pylibdir}/ensurepip/
%{pylibdir}/ensurepip/*.py*
%if %{with rpmwheels}
%exclude %{pylibdir}/ensurepip/_bundled
%if %{with rewheel}
%dir %{pylibdir}/ensurepip/rewheel/
%{pylibdir}/ensurepip/rewheel/*.py*
%else
%dir %{pylibdir}/ensurepip/_bundled
%{pylibdir}/ensurepip/_bundled/*.whl
%endif
%files devel
%defattr(-,root,root,-)
%{_libdir}/pkgconfig/python-%{pybasever}.pc
%{_libdir}/pkgconfig/python.pc
%{_libdir}/pkgconfig/python2.pc
@ -1766,7 +1816,6 @@ rm -fr %{buildroot}
%{_libdir}/libpython%{pybasever}.so
%files tools
%defattr(-,root,root,755)
%doc Tools/pynche/README.pynche
%{site_packages}/pynche
%{_bindir}/smtpd*.py*
@ -1783,14 +1832,12 @@ rm -fr %{buildroot}
%{pylibdir}/Doc
%files tkinter
%defattr(-,root,root,755)
%{pylibdir}/lib-tk
%if ! 0%{?_module_build}
%{dynload_dir}/_tkinter.so
%endif
%files test
%defattr(-, root, root, -)
%{pylibdir}/bsddb/test
%{pylibdir}/ctypes/test
%{pylibdir}/distutils/tests
@ -1799,9 +1846,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
@ -1814,7 +1866,6 @@ rm -fr %{buildroot}
%if %{with debug_build}
%files debug
%defattr(-,root,root,-)
# Analog of the core subpackage's files:
%{_bindir}/python-debug
@ -1957,6 +2008,96 @@ rm -fr %{buildroot}
# ======================================================
%changelog
* Mon Mar 04 2019 Miro Hrončok <mhroncok@redhat.com> - 2.7.16-1
- Update to 2.7.16 final
* Tue Feb 19 2019 Charalampos Stratakis <cstratak@redhat.com> - 2.7.16~rc1-1
- Update to 2.7.16rc1
* Sun Feb 17 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 2.7.15-14
- Rebuild for readline 8.0
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.15-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Mon Jan 14 2019 Björn Esser <besser82@fedoraproject.org> - 2.7.15-12
- Rebuilt for libcrypt.so.2 (#1666033)
* Mon Sep 24 2018 Miro Hrončok <mhroncok@redhat.com> - 2.7.15-11
- Security fix for CVE-2018-14647 (#1631822)
* Thu Sep 20 2018 Miro Hrončok <mhroncok@redhat.com> - 2.7.15-10
- Security fix for CVE-2018-1000802 (#1631662)
* Thu Sep 06 2018 Petr Viktorin <pviktori@redhat.com> - 2.7.15-9
- Deprecate python2 and all subpackages in Fedora 30+ (#1625773)
* Thu Aug 30 2018 Miro Hrončok <mhroncok@redhat.com> - 2.7.15-8
- Require python2-setuptools from python2-devel to prevent packaging errors (#1623922)
* Tue Aug 21 2018 Miro Hrončok <mhroncok@redhat.com> - 2.7.15-7
- Use RPM built wheels of pip and setuptools in ensurepip instead of our rewheel patch
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.15-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Thu Jun 14 2018 Miro Hrončok <mhroncok@redhat.com> - 2.7.15-5
- Move /usr/bin/python into a separate package
https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package
- Revert https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build
* Wed Jun 13 2018 Miro Hrončok <mhroncok@redhat.com> - 2.7.15-4
- Rebuilt for Python 3.7
* Wed Jun 13 2018 Miro Hrončok <mhroncok@redhat.com> - 2.7.15-3
- Bootstrap for Python 3.7
* Tue May 15 2018 Charalampos Stratakis <cstratak@redhat.com> - 2.7.15-2
- Fix loading of the gdb python plugin (rhbz#1578001)
* Tue May 01 2018 Miro Hrončok <mhroncok@redhat.com> - 2.7.15-1
- Update to version 2.7.15
* Wed Apr 25 2018 Tomas Orsava <torsava@redhat.com> - 2.7.14-17
- Change shebangs to the proper versioned binary
- Bytecompile files manually, disbale brp-python-bytecompile
Resolves: rhbz#1572171
* Fri Apr 13 2018 Miro Hrončok <mhroncok@redhat.com> - 2.7.14-16
- Remove Obsoletes tag from when python was renamed to python2 (Fedora 25 was last)
* Wed Mar 14 2018 Miro Hrončok <mhroncok@redhat.com> - 2.7.14-15
- Fix broken SSL module
Resolves: rhbz#1555081
* Tue Mar 13 2018 Charalampos Stratakis <cstratak@redhat.com> - 2.7.14-14
- Do not send IP addresses in SNI TLS extension
* Mon Feb 26 2018 Petr Viktorin <pviktori@redhat.com> - 2.7.14-13
- Fix -Wint-in-bool-context warnings
Resolves: rhbz#1473425
* Sat Feb 24 2018 Florian Weimer <fweimer@redhat.com> - 2.7.14-12
- Rebuild with new LDFLAGS from redhat-rpm-config
* Thu Feb 15 2018 Miro Hrončok <mhroncok@redhat.com> - 2.7.14-11
- Move test.support and test.script_helper to python2-libs
Resolves: rhbz#1528899
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.14-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Tue Jan 30 2018 Petr Viktorin <pviktori@redhat.com> - 2.7.14-9
- Add patch 288: warn/fail if Python 2 is called as /usr/bin/python and
PYTHON_DISALLOW_AMBIGUOUS_VERSION is set
- Add patch 289: Fix for over-aligned GC info
* Sat Jan 20 2018 Björn Esser <besser82@fedoraproject.org> - 2.7.14-8
- Rebuilt for switch to libxcrypt
* Wed Jan 17 2018 Petr Viktorin <pviktori@redhat.com> - 2.7.14-7
- Build the nis module with tirpc
* Tue Jan 16 2018 Miro Hrončok <mhroncok@redhat.com> - 2.7.14-6
- Rebuild for reverted gdbm 1.13 on Fedora 27

View File

@ -1 +1 @@
SHA512 (Python-2.7.14.tar.xz) = 78310b0be6388ffa15f29a80afb9ab3c03a572cb094e9da00cfe391afadb51696e41f592eb658d6a31a2f422fdac8a55214a382cbb8cfb43d4a127d5b35ea7f9
SHA512 (Python-2.7.16.tar.xz) = 16e814e8dcffc707b595ca2919bd2fa3db0d15794c63d977364652c4a5b92e90e72b8c9e1cc83b5020398bd90a1b397dbdd7cb931c49f1aa4af6ef95414b43e0

19
tests/tests.yml Normal file
View File

@ -0,0 +1,19 @@
---
- hosts: localhost
roles:
- role: standard-test-basic
tags:
- classic
repositories:
- repo: "https://src.fedoraproject.org/tests/python.git"
dest: "python"
tests:
- smoke:
dir: python/smoke
run: METHOD=virtualenv VERSION=2.7 ./venv.sh
required_packages:
- gcc
- virtualenv
- python3-tox
- python2-devel
- glibc-all-langpacks # for locale tests