Compare commits
70 Commits
private-ka
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
ef338dc7d0 | ||
|
a5e818f217 | ||
|
5d0f9111df | ||
|
75a0703066 | ||
|
b13073ac76 | ||
|
789267ab76 | ||
|
ef2a83ef76 | ||
|
1d7cbe3b6c | ||
|
284b905a2e | ||
|
44b757bc09 | ||
|
ebba43dec3 | ||
|
0dfe62335c | ||
|
0052c9fa9d | ||
|
ae09a79125 | ||
|
e8ef86e1cf | ||
|
4d74b7c9bf | ||
|
d60e5a4fc9 | ||
|
8b06c12ed7 | ||
|
fb39860846 | ||
|
f5b3292c68 | ||
|
08290bc9c3 | ||
|
002eb7557e | ||
|
692623a0b9 | ||
|
5ee9c1ec45 | ||
|
2b53e7ec9b | ||
|
4922a4e974 | ||
|
ba2118865d | ||
|
080ef9bdfb | ||
|
066c258587 | ||
|
3be16be9fa | ||
|
b1a24b465f | ||
|
4856e50ce1 | ||
|
8545792aae | ||
|
cc58e7d338 | ||
|
e1abe5a026 | ||
|
5316098666 | ||
|
528a444ab6 | ||
|
b02c01e554 | ||
|
71264cf847 | ||
|
1bdc5fed8a | ||
|
9c47bee6d8 | ||
|
11b080bc3c | ||
|
96b18273ae | ||
|
7143d8af3a | ||
|
9c6e188db0 | ||
|
3056bfd92a | ||
|
75ba8b986c | ||
|
f2b472093a | ||
|
cf221a53b1 | ||
|
3bebf16e16 | ||
|
9d3ac306c1 | ||
|
f948d41aff | ||
|
349b2233cb | ||
|
6bc3f63023 | ||
|
9db4c321af | ||
|
57e494a406 | ||
|
e4e4dbbeea | ||
|
d2afb4596f | ||
|
db65c52e5c | ||
|
d99160d4df | ||
|
f9d5f4b78d | ||
|
f33a487469 | ||
|
b096dc5eb0 | ||
|
916477c6e6 | ||
|
2ee453130c | ||
|
32febd6043 | ||
|
4485b86f0d | ||
|
1554ebbaa5 | ||
|
890215f627 | ||
|
bd0f7dde03 |
@ -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
|
||||
|
@ -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):
|
||||
|
@ -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 \
|
||||
|
@ -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();
|
@ -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)
|
@ -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
|
||||
|
@ -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.
|
@ -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
|
||||
|
@ -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 = []
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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!")
|
@ -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')
|
70
00189-use-rpm-wheels.patch
Normal file
70
00189-use-rpm-wheels.patch
Normal 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))
|
||||
|
14
00190-gdb-py-bt-dont-raise-exception-from-eval.patch
Normal file
14
00190-gdb-py-bt-dont-raise-exception-from-eval.patch
Normal 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)'
|
@ -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 \
|
@ -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().
|
@ -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!
|
||||
|
69
00289-disable-nis-detection.patch
Normal file
69
00289-disable-nis-detection.patch
Normal 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
2
pynche
@ -1,2 +1,2 @@
|
||||
#!/bin/bash
|
||||
exec `python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(plat_specific = True))"`/pynche/pynche
|
||||
exec `python2 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(plat_specific = True))"`/pynche/pynche
|
||||
|
@ -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
|
||||
|
648
python2.spec
648
python2.spec
File diff suppressed because it is too large
Load Diff
2
sources
2
sources
@ -1 +1 @@
|
||||
SHA512 (Python-2.7.13.tar.xz) = f37c9a28ce129d01e63c84d7db627a06402854578f62d17927334ea21ede318e04bbf66e890e3f47c85333e6b19f6e5581fb3f3e27efd24be27017d1b6529c4b
|
||||
SHA512 (Python-2.7.16.tar.xz) = 16e814e8dcffc707b595ca2919bd2fa3db0d15794c63d977364652c4a5b92e90e72b8c9e1cc83b5020398bd90a1b397dbdd7cb931c49f1aa4af6ef95414b43e0
|
||||
|
19
tests/tests.yml
Normal file
19
tests/tests.yml
Normal 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
|
Loading…
Reference in New Issue
Block a user