Updated to Python 2.7.4.

- Refreshed patches: 0 (config), 7 (sqlite encoding), 16 (rpath in config),
55 (systemtap), 111 (no static lib), 112 (debug build), 113 (more
configuration flags), 130 (add extension to python config), 134 (fix
COUNT_ALLOCS in test_sys), 146 (haslib FIPS), 147 (add debug malloc stats),
153 (fix gdb test noise), 157 (uid, gid overflow - fixed upstream, just
keeping few more downstream tests), 165 (crypt module salt backport),
175 (fix configure Wformat), 5000 (regenerated autotooling patch)
- Dropped patches: 101 (lib64 regex; merged upstream), 171 (exception on
missing /dev/urandom; merged upstream), 172 (poll for multiprocessing socket
connection; merged upstream)
This commit is contained in:
Bohuslav Kabrda 2013-04-09 10:54:58 +02:00
parent bc9fa6b868
commit 6a2d1e30e2
18 changed files with 119 additions and 3327 deletions

View File

@ -1,6 +1,6 @@
diff -up Python-2.7rc1/configure.in.systemtap Python-2.7rc1/configure.in diff -up Python-2.7rc1/configure.ac.systemtap Python-2.7rc1/configure.ac
--- Python-2.7rc1/configure.in.systemtap 2010-06-06 10:53:15.514975012 -0400 --- Python-2.7rc1/configure.ac.systemtap 2010-06-06 10:53:15.514975012 -0400
+++ Python-2.7rc1/configure.in 2010-06-06 10:53:15.520974361 -0400 +++ Python-2.7rc1/configure.ac 2010-06-06 10:53:15.520974361 -0400
@@ -2616,6 +2616,38 @@ if test "$with_valgrind" != no; then @@ -2616,6 +2616,38 @@ if test "$with_valgrind" != no; then
) )
fi fi
@ -88,8 +88,8 @@ diff -up Python-2.7rc1/Makefile.pre.in.systemtap Python-2.7rc1/Makefile.pre.in
.PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure .PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
.PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools .PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
.PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean .PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean
-.PHONY: smelly funny patchcheck -.PHONY: smelly funny patchcheck touch altmaninstall
+.PHONY: smelly funny patchcheck buildinclude +.PHONY: smelly funny patchcheck touch altmaninstall buildinclude
.PHONY: gdbhooks .PHONY: gdbhooks
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY # IF YOU PUT ANYTHING HERE IT WILL GO AWAY

View File

@ -11,8 +11,8 @@ diff -up Python-2.7.3/Makefile.pre.in.no-static-lib Python-2.7.3/Makefile.pre.in
Modules/python.o \ Modules/python.o \
$(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
@@ -413,18 +413,6 @@ sharedmods: $(BUILDPYTHON) @@ -413,18 +413,6 @@ sharedmods: $(BUILDPYTHON)
*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \ $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
esac $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
-# Build static library -# Build static library
-# avoid long command lines, same as LIBRARY_OBJS -# avoid long command lines, same as LIBRARY_OBJS

View File

@ -1,6 +1,6 @@
diff -up Python-2.6.5/configure.in.more-configuration-flags Python-2.6.5/configure.in diff -up Python-2.6.5/configure.ac.more-configuration-flags Python-2.6.5/configure.ac
--- Python-2.6.5/configure.in.more-configuration-flags 2010-05-24 18:51:25.410111792 -0400 --- Python-2.6.5/configure.ac.more-configuration-flags 2010-05-24 18:51:25.410111792 -0400
+++ Python-2.6.5/configure.in 2010-05-24 18:59:23.954986388 -0400 +++ Python-2.6.5/configure.ac 2010-05-24 18:59:23.954986388 -0400
@@ -2515,6 +2515,30 @@ else AC_MSG_RESULT(no) @@ -2515,6 +2515,30 @@ else AC_MSG_RESULT(no)
fi], fi],
[AC_MSG_RESULT(no)]) [AC_MSG_RESULT(no)])

View File

@ -3,11 +3,11 @@
@@ -734,6 +734,11 @@ class SizeofTest(unittest.TestCase): @@ -734,6 +734,11 @@ class SizeofTest(unittest.TestCase):
# (PyTypeObject + PyNumberMethods + PyMappingMethods + # (PyTypeObject + PyNumberMethods + PyMappingMethods +
# PySequenceMethods + PyBufferProcs) # PySequenceMethods + PyBufferProcs)
s = size(vh + 'P2P15Pl4PP9PP11PI') + size('41P 10P 3P 6P') s = vsize('P2P15Pl4PP9PP11PI') + struct.calcsize('41P 10P 3P 6P')
+ +
+ # COUNT_ALLOCS adds further fields to the end of a PyTypeObject: + # COUNT_ALLOCS adds further fields to the end of a PyTypeObject:
+ if hasattr(sys, 'getcounts'): + if hasattr(sys, 'getcounts'):
+ s += size('5P') + s += size('P')
+ +
class newstyleclass(object): class newstyleclass(object):
pass pass

View File

@ -67,7 +67,7 @@ diff -up Python-2.7.2/Lib/hashlib.py.hashlib-fips Python-2.7.2/Lib/hashlib.py
- except ImportError: - except ImportError:
- pass # no extension module, this hash is unsupported. - pass # no extension module, this hash is unsupported.
- -
- raise ValueError('unsupported hash type %s' % name) - raise ValueError('unsupported hash type ' + name)
- -
- -
def __get_openssl_constructor(name): def __get_openssl_constructor(name):
@ -199,9 +199,9 @@ diff -up Python-2.7.2/Lib/test/test_hashlib.py.hashlib-fips Python-2.7.2/Lib/tes
c.hexdigest() c.hexdigest()
def test_algorithms_attribute(self): def test_algorithms_attribute(self):
@@ -115,27 +113,9 @@ class HashLibTestCase(unittest.TestCase) @@ -115,28 +113,9 @@ class HashLibTestCase(unittest.TestCase)
else: self.assertRaises(ValueError, hashlib.new, 'spam spam spam spam spam')
self.assertTrue(0 == "hashlib didn't reject bogus hash name") self.assertRaises(TypeError, hashlib.new, 1)
- def test_get_builtin_constructor(self): - def test_get_builtin_constructor(self):
- get_builtin_constructor = hashlib.__dict__[ - get_builtin_constructor = hashlib.__dict__[
@ -220,6 +220,7 @@ diff -up Python-2.7.2/Lib/test/test_hashlib.py.hashlib-fips Python-2.7.2/Lib/tes
- sys.modules['_md5'] = _md5 - sys.modules['_md5'] = _md5
- else: - else:
- del sys.modules['_md5'] - del sys.modules['_md5']
- self.assertRaises(TypeError, get_builtin_constructor, 3)
- -
def test_hexdigest(self): def test_hexdigest(self):
for name in self.supported_hash_names: for name in self.supported_hash_names:
@ -366,7 +367,7 @@ diff -up Python-2.7.2/Modules/_hashopenssl.c.hashlib-fips Python-2.7.2/Modules/_
+} EVPCachedInfo; +} EVPCachedInfo;
-#define DEFINE_CONSTS_FOR_NEW(Name) \ -#define DEFINE_CONSTS_FOR_NEW(Name) \
- static PyObject *CONST_ ## Name ## _name_obj; \ - static PyObject *CONST_ ## Name ## _name_obj = NULL; \
- static EVP_MD_CTX CONST_new_ ## Name ## _ctx; \ - static EVP_MD_CTX CONST_new_ ## Name ## _ctx; \
- static EVP_MD_CTX *CONST_new_ ## Name ## _ctx_p = NULL; - static EVP_MD_CTX *CONST_new_ ## Name ## _ctx_p = NULL;
+#define DEFINE_CONSTS_FOR_NEW(Name) \ +#define DEFINE_CONSTS_FOR_NEW(Name) \
@ -513,7 +514,7 @@ diff -up Python-2.7.2/Modules/_hashopenssl.c.hashlib-fips Python-2.7.2/Modules/_
return NULL; return NULL;
} }
@@ -484,55 +556,118 @@ EVP_new(PyObject *self, PyObject *args, @@ -484,58 +556,118 @@ EVP_new(PyObject *self, PyObject *args,
digest = EVP_get_digestbyname(name); digest = EVP_get_digestbyname(name);
ret_obj = EVPnew(name_obj, digest, NULL, (unsigned char*)view.buf, ret_obj = EVPnew(name_obj, digest, NULL, (unsigned char*)view.buf,
@ -615,13 +616,16 @@ diff -up Python-2.7.2/Modules/_hashopenssl.c.hashlib-fips Python-2.7.2/Modules/_
" hash object; optionally initialized with a string") \ " hash object; optionally initialized with a string") \
} }
-/* used in the init function to setup a constructor */ -/* used in the init function to setup a constructor: initialize OpenSSL
- constructor constants if they haven't been initialized already. */
-#define INIT_CONSTRUCTOR_CONSTANTS(NAME) do { \ -#define INIT_CONSTRUCTOR_CONSTANTS(NAME) do { \
- if (CONST_ ## NAME ## _name_obj == NULL) { \
- CONST_ ## NAME ## _name_obj = PyString_FromString(#NAME); \ - CONST_ ## NAME ## _name_obj = PyString_FromString(#NAME); \
- if (EVP_get_digestbyname(#NAME)) { \ - if (EVP_get_digestbyname(#NAME)) { \
- CONST_new_ ## NAME ## _ctx_p = &CONST_new_ ## NAME ## _ctx; \ - CONST_new_ ## NAME ## _ctx_p = &CONST_new_ ## NAME ## _ctx; \
- EVP_DigestInit(CONST_new_ ## NAME ## _ctx_p, EVP_get_digestbyname(#NAME)); \ - EVP_DigestInit(CONST_new_ ## NAME ## _ctx_p, EVP_get_digestbyname(#NAME)); \
- } \ - } \
- } \
+/* +/*
+ Macro/function pair to set up the constructors. + Macro/function pair to set up the constructors.
+ +

View File

@ -75,8 +75,8 @@ diff -up Python-2.7.2/Include/object.h.add-debug-malloc-stats Python-2.7.2/Inclu
--- Python-2.7.2/Include/object.h.add-debug-malloc-stats 2011-06-11 11:46:23.000000000 -0400 --- Python-2.7.2/Include/object.h.add-debug-malloc-stats 2011-06-11 11:46:23.000000000 -0400
+++ Python-2.7.2/Include/object.h 2011-09-16 19:03:25.108821625 -0400 +++ Python-2.7.2/Include/object.h 2011-09-16 19:03:25.108821625 -0400
@@ -980,6 +980,13 @@ PyAPI_DATA(PyObject *) _PyTrash_delete_l @@ -980,6 +980,13 @@ PyAPI_DATA(PyObject *) _PyTrash_delete_l
else \ _PyTrash_thread_deposit_object((PyObject*)op); \
_PyTrash_deposit_object((PyObject*)op); } while (0);
+PyAPI_FUNC(void) +PyAPI_FUNC(void)
+_PyDebugAllocatorStats(FILE *out, const char *block_name, int num_blocks, +_PyDebugAllocatorStats(FILE *out, const char *block_name, int num_blocks,
@ -165,7 +165,7 @@ diff -up Python-2.7.2/Lib/test/test_sys.py.add-debug-malloc-stats Python-2.7.2/L
+ +
class SizeofTest(unittest.TestCase): class SizeofTest(unittest.TestCase):
TPFLAGS_HAVE_GC = 1<<14 def setUp(self):
diff -up Python-2.7.2/Objects/classobject.c.add-debug-malloc-stats Python-2.7.2/Objects/classobject.c diff -up Python-2.7.2/Objects/classobject.c.add-debug-malloc-stats Python-2.7.2/Objects/classobject.c
--- Python-2.7.2/Objects/classobject.c.add-debug-malloc-stats 2011-06-11 11:46:27.000000000 -0400 --- Python-2.7.2/Objects/classobject.c.add-debug-malloc-stats 2011-06-11 11:46:27.000000000 -0400
+++ Python-2.7.2/Objects/classobject.c 2011-09-16 19:03:25.110821625 -0400 +++ Python-2.7.2/Objects/classobject.c 2011-09-16 19:03:25.110821625 -0400
@ -542,8 +542,8 @@ diff -up Python-2.7.2/Objects/stringobject.c.add-debug-malloc-stats Python-2.7.2
--- Python-2.7.2/Objects/stringobject.c.add-debug-malloc-stats 2011-06-11 11:46:27.000000000 -0400 --- Python-2.7.2/Objects/stringobject.c.add-debug-malloc-stats 2011-06-11 11:46:27.000000000 -0400
+++ Python-2.7.2/Objects/stringobject.c 2011-09-16 19:03:25.116821625 -0400 +++ Python-2.7.2/Objects/stringobject.c 2011-09-16 19:03:25.116821625 -0400
@@ -4822,3 +4822,43 @@ void _Py_ReleaseInternedStrings(void) @@ -4822,3 +4822,43 @@ void _Py_ReleaseInternedStrings(void)
Py_DECREF(interned); PyDict_Clear(interned);
interned = NULL; Py_CLEAR(interned);
} }
+ +
+void _PyString_DebugMallocStats(FILE *out) +void _PyString_DebugMallocStats(FILE *out)

View File

@ -17,8 +17,8 @@
if cmds_after_breakpoint: if cmds_after_breakpoint:
commands += cmds_after_breakpoint commands += cmds_after_breakpoint
@@ -135,8 +144,16 @@ class DebuggerTests(unittest.TestCase): @@ -135,8 +144,16 @@ class DebuggerTests(unittest.TestCase):
err = err.replace("warning: Cannot initialize thread debugging" 'Do you need "set solib-search-path" or '
" library: Debugger service failed\n", '"set sysroot"?\n',
'') '')
+ err = '\n'.join([line + err = '\n'.join([line
+ for line in err.splitlines() + for line in err.splitlines()

View File

@ -1,44 +1,3 @@
diff -up Python-2.7.3/Include/modsupport.h.uid-gid-overflows Python-2.7.3/Include/modsupport.h
--- Python-2.7.3/Include/modsupport.h.uid-gid-overflows 2012-04-09 19:07:29.000000000 -0400
+++ Python-2.7.3/Include/modsupport.h 2012-06-26 14:52:03.739471150 -0400
@@ -8,6 +8,7 @@ extern "C" {
/* Module support interface */
#include <stdarg.h>
+#include <sys/types.h>
/* If PY_SSIZE_T_CLEAN is defined, each functions treats #-specifier
to mean Py_ssize_t */
@@ -128,6 +129,17 @@ PyAPI_FUNC(PyObject *) Py_InitModule4(co
PyAPI_DATA(char *) _Py_PackageContext;
+/*
+ Non-standard extension: support for dealing with uid_t and gid_t without
+ integer overflow
+ */
+
+PyAPI_FUNC(PyObject *) _PyObject_FromUid(uid_t uid);
+PyAPI_FUNC(PyObject *) _PyObject_FromGid(gid_t gid);
+
+PyAPI_FUNC(int) _PyArg_ParseUid(PyObject *in_obj, uid_t *out_uid);
+PyAPI_FUNC(int) _PyArg_ParseGid(PyObject *in_obj, gid_t *out_gid);
+
#ifdef __cplusplus
}
#endif
diff -up Python-2.7.3/Lib/test/test_grp.py.uid-gid-overflows Python-2.7.3/Lib/test/test_grp.py
--- Python-2.7.3/Lib/test/test_grp.py.uid-gid-overflows 2012-04-09 19:07:31.000000000 -0400
+++ Python-2.7.3/Lib/test/test_grp.py 2012-06-26 14:51:36.000817929 -0400
@@ -16,7 +16,7 @@ class GroupDatabaseTestCase(unittest.Tes
self.assertEqual(value[1], value.gr_passwd)
self.assertIsInstance(value.gr_passwd, basestring)
self.assertEqual(value[2], value.gr_gid)
- self.assertIsInstance(value.gr_gid, int)
+ self.assertIsInstance(value.gr_gid, (int, long))
self.assertEqual(value[3], value.gr_mem)
self.assertIsInstance(value.gr_mem, list)
diff -up Python-2.7.3/Lib/test/test_os.py.uid-gid-overflows Python-2.7.3/Lib/test/test_os.py diff -up Python-2.7.3/Lib/test/test_os.py.uid-gid-overflows Python-2.7.3/Lib/test/test_os.py
--- Python-2.7.3/Lib/test/test_os.py.uid-gid-overflows 2012-04-09 19:07:32.000000000 -0400 --- Python-2.7.3/Lib/test/test_os.py.uid-gid-overflows 2012-04-09 19:07:32.000000000 -0400
+++ Python-2.7.3/Lib/test/test_os.py 2012-06-26 14:51:36.000817929 -0400 +++ Python-2.7.3/Lib/test/test_os.py 2012-06-26 14:51:36.000817929 -0400
@ -88,649 +47,3 @@ diff -up Python-2.7.3/Lib/test/test_os.py.uid-gid-overflows Python-2.7.3/Lib/tes
self.assertRaises(OverflowError, os.setregid, 1<<32, 0) self.assertRaises(OverflowError, os.setregid, 1<<32, 0)
self.assertRaises(OverflowError, os.setregid, 0, 1<<32) self.assertRaises(OverflowError, os.setregid, 0, 1<<32)
diff -up Python-2.7.3/Lib/test/test_posix.py.uid-gid-overflows Python-2.7.3/Lib/test/test_posix.py
--- Python-2.7.3/Lib/test/test_posix.py.uid-gid-overflows 2012-04-09 19:07:32.000000000 -0400
+++ Python-2.7.3/Lib/test/test_posix.py 2012-06-26 14:51:36.001817916 -0400
@@ -217,7 +217,7 @@ class PosixTester(unittest.TestCase):
if hasattr(posix, 'stat'):
self.assertTrue(posix.stat(test_support.TESTFN))
- def _test_all_chown_common(self, chown_func, first_param):
+ def _test_all_chown_common(self, chown_func, stat_func, first_param):
"""Common code for chown, fchown and lchown tests."""
if os.getuid() == 0:
try:
@@ -237,6 +237,13 @@ class PosixTester(unittest.TestCase):
# test a successful chown call
chown_func(first_param, os.getuid(), os.getgid())
+ self.assertEqual(stat_func(first_param).st_uid, os.getuid())
+ self.assertEqual(stat_func(first_param).st_gid, os.getgid())
+
+ # verify that -1 works as a "do-nothing" option:
+ chown_func(first_param, -1, -1)
+ self.assertEqual(stat_func(first_param).st_uid, os.getuid())
+ self.assertEqual(stat_func(first_param).st_gid, os.getgid())
@unittest.skipUnless(hasattr(posix, 'chown'), "test needs os.chown()")
def test_chown(self):
@@ -246,7 +253,7 @@ class PosixTester(unittest.TestCase):
# re-create the file
open(test_support.TESTFN, 'w').close()
- self._test_all_chown_common(posix.chown, test_support.TESTFN)
+ self._test_all_chown_common(posix.chown, posix.stat, test_support.TESTFN)
@unittest.skipUnless(hasattr(posix, 'fchown'), "test needs os.fchown()")
def test_fchown(self):
@@ -256,7 +263,7 @@ class PosixTester(unittest.TestCase):
test_file = open(test_support.TESTFN, 'w')
try:
fd = test_file.fileno()
- self._test_all_chown_common(posix.fchown, fd)
+ self._test_all_chown_common(posix.fchown, posix.fstat, fd)
finally:
test_file.close()
@@ -265,7 +272,7 @@ class PosixTester(unittest.TestCase):
os.unlink(test_support.TESTFN)
# create a symlink
os.symlink(_DUMMY_SYMLINK, test_support.TESTFN)
- self._test_all_chown_common(posix.lchown, test_support.TESTFN)
+ self._test_all_chown_common(posix.lchown, posix.lstat, test_support.TESTFN)
def test_chdir(self):
if hasattr(posix, 'chdir'):
diff -up Python-2.7.3/Lib/test/test_pwd.py.uid-gid-overflows Python-2.7.3/Lib/test/test_pwd.py
--- Python-2.7.3/Lib/test/test_pwd.py.uid-gid-overflows 2012-04-09 19:07:32.000000000 -0400
+++ Python-2.7.3/Lib/test/test_pwd.py 2012-06-26 14:51:36.001817916 -0400
@@ -18,9 +18,9 @@ class PwdTest(unittest.TestCase):
self.assertEqual(e[1], e.pw_passwd)
self.assertIsInstance(e.pw_passwd, basestring)
self.assertEqual(e[2], e.pw_uid)
- self.assertIsInstance(e.pw_uid, int)
+ self.assertIsInstance(e.pw_uid, (int, long))
self.assertEqual(e[3], e.pw_gid)
- self.assertIsInstance(e.pw_gid, int)
+ self.assertIsInstance(e.pw_gid, (int, long))
self.assertEqual(e[4], e.pw_gecos)
self.assertIsInstance(e.pw_gecos, basestring)
self.assertEqual(e[5], e.pw_dir)
@@ -87,9 +87,9 @@ class PwdTest(unittest.TestCase):
# In some cases, byuids isn't a complete list of all users in the
# system, so if we try to pick a value not in byuids (via a perturbing
# loop, say), pwd.getpwuid() might still be able to find data for that
- # uid. Using sys.maxint may provoke the same problems, but hopefully
+ # uid. Using 2**32 - 2 may provoke the same problems, but hopefully
# it will be a more repeatable failure.
- fakeuid = sys.maxint
+ fakeuid = 2**32 - 2
self.assertNotIn(fakeuid, byuids)
self.assertRaises(KeyError, pwd.getpwuid, fakeuid)
diff -up Python-2.7.3/Modules/grpmodule.c.uid-gid-overflows Python-2.7.3/Modules/grpmodule.c
--- Python-2.7.3/Modules/grpmodule.c.uid-gid-overflows 2012-04-09 19:07:34.000000000 -0400
+++ Python-2.7.3/Modules/grpmodule.c 2012-06-26 14:51:36.002817904 -0400
@@ -70,7 +70,7 @@ mkgrent(struct group *p)
Py_INCREF(Py_None);
}
#endif
- SET(setIndex++, PyInt_FromLong((long) p->gr_gid));
+ SET(setIndex++, _PyObject_FromGid(p->gr_gid));
SET(setIndex++, w);
#undef SET
@@ -85,18 +85,15 @@ mkgrent(struct group *p)
static PyObject *
grp_getgrgid(PyObject *self, PyObject *pyo_id)
{
- PyObject *py_int_id;
- unsigned int gid;
+ gid_t gid;
struct group *p;
- py_int_id = PyNumber_Int(pyo_id);
- if (!py_int_id)
- return NULL;
- gid = PyInt_AS_LONG(py_int_id);
- Py_DECREF(py_int_id);
+ if (!_PyArg_ParseGid(pyo_id, &gid)) {
+ return NULL;
+ }
if ((p = getgrgid(gid)) == NULL) {
- PyErr_Format(PyExc_KeyError, "getgrgid(): gid not found: %d", gid);
+ PyErr_Format(PyExc_KeyError, "getgrgid(): gid not found: %lu", (unsigned long)gid);
return NULL;
}
return mkgrent(p);
diff -up Python-2.7.3/Modules/posixmodule.c.uid-gid-overflows Python-2.7.3/Modules/posixmodule.c
--- Python-2.7.3/Modules/posixmodule.c.uid-gid-overflows 2012-06-26 14:51:35.864819629 -0400
+++ Python-2.7.3/Modules/posixmodule.c 2012-06-26 14:51:36.005817868 -0400
@@ -1305,8 +1305,8 @@ _pystat_fromstructstat(STRUCT_STAT *st)
PyStructSequence_SET_ITEM(v, 2, PyInt_FromLong((long)st->st_dev));
#endif
PyStructSequence_SET_ITEM(v, 3, PyInt_FromLong((long)st->st_nlink));
- PyStructSequence_SET_ITEM(v, 4, PyInt_FromLong((long)st->st_uid));
- PyStructSequence_SET_ITEM(v, 5, PyInt_FromLong((long)st->st_gid));
+ PyStructSequence_SET_ITEM(v, 4, _PyObject_FromUid(st->st_uid));
+ PyStructSequence_SET_ITEM(v, 5, _PyObject_FromGid(st->st_gid));
#ifdef HAVE_LARGEFILE_SUPPORT
PyStructSequence_SET_ITEM(v, 6,
PyLong_FromLongLong((PY_LONG_LONG)st->st_size));
@@ -1883,14 +1883,16 @@ static PyObject *
posix_chown(PyObject *self, PyObject *args)
{
char *path = NULL;
- long uid, gid;
+ uid_t uid;
+ gid_t gid;
int res;
- if (!PyArg_ParseTuple(args, "etll:chown",
+ if (!PyArg_ParseTuple(args, "etO&O&:chown",
Py_FileSystemDefaultEncoding, &path,
- &uid, &gid))
+ _PyArg_ParseUid, &uid,
+ _PyArg_ParseGid, &gid))
return NULL;
Py_BEGIN_ALLOW_THREADS
- res = chown(path, (uid_t) uid, (gid_t) gid);
+ res = chown(path, uid, gid);
Py_END_ALLOW_THREADS
if (res < 0)
return posix_error_with_allocated_filename(path);
@@ -1910,12 +1912,15 @@ static PyObject *
posix_fchown(PyObject *self, PyObject *args)
{
int fd;
- long uid, gid;
+ uid_t uid;
+ gid_t gid;
int res;
- if (!PyArg_ParseTuple(args, "ill:chown", &fd, &uid, &gid))
+ if (!PyArg_ParseTuple(args, "iO&O&:chown", &fd,
+ _PyArg_ParseUid, &uid,
+ _PyArg_ParseGid, &gid))
return NULL;
Py_BEGIN_ALLOW_THREADS
- res = fchown(fd, (uid_t) uid, (gid_t) gid);
+ res = fchown(fd, uid, gid);
Py_END_ALLOW_THREADS
if (res < 0)
return posix_error();
@@ -1933,14 +1938,16 @@ static PyObject *
posix_lchown(PyObject *self, PyObject *args)
{
char *path = NULL;
- long uid, gid;
+ uid_t uid;
+ gid_t gid;
int res;
- if (!PyArg_ParseTuple(args, "etll:lchown",
+ if (!PyArg_ParseTuple(args, "etO&O&:lchown",
Py_FileSystemDefaultEncoding, &path,
- &uid, &gid))
+ _PyArg_ParseUid, &uid,
+ _PyArg_ParseGid, &gid))
return NULL;
Py_BEGIN_ALLOW_THREADS
- res = lchown(path, (uid_t) uid, (gid_t) gid);
+ res = lchown(path, uid, gid);
Py_END_ALLOW_THREADS
if (res < 0)
return posix_error_with_allocated_filename(path);
@@ -3841,7 +3848,7 @@ Return the current process's effective g
static PyObject *
posix_getegid(PyObject *self, PyObject *noargs)
{
- return PyInt_FromLong((long)getegid());
+ return _PyObject_FromGid(getegid());
}
#endif
@@ -3854,7 +3861,7 @@ Return the current process's effective u
static PyObject *
posix_geteuid(PyObject *self, PyObject *noargs)
{
- return PyInt_FromLong((long)geteuid());
+ return _PyObject_FromUid(geteuid());
}
#endif
@@ -3867,7 +3874,7 @@ Return the current process's group id.")
static PyObject *
posix_getgid(PyObject *self, PyObject *noargs)
{
- return PyInt_FromLong((long)getgid());
+ return _PyObject_FromGid(getgid());
}
#endif
@@ -3942,7 +3949,7 @@ posix_getgroups(PyObject *self, PyObject
if (result != NULL) {
int i;
for (i = 0; i < n; ++i) {
- PyObject *o = PyInt_FromLong((long)alt_grouplist[i]);
+ PyObject *o = _PyObject_FromGid(alt_grouplist[i]);
if (o == NULL) {
Py_DECREF(result);
result = NULL;
@@ -3971,12 +3978,13 @@ static PyObject *
posix_initgroups(PyObject *self, PyObject *args)
{
char *username;
- long gid;
+ gid_t gid;
- if (!PyArg_ParseTuple(args, "sl:initgroups", &username, &gid))
+ if (!PyArg_ParseTuple(args, "sO&:initgroups", &username,
+ _PyArg_ParseGid, &gid))
return NULL;
- if (initgroups(username, (gid_t) gid) == -1)
+ if (initgroups(username, gid) == -1)
return PyErr_SetFromErrno(PyExc_OSError);
Py_INCREF(Py_None);
@@ -4090,7 +4098,7 @@ Return the current process's user id.");
static PyObject *
posix_getuid(PyObject *self, PyObject *noargs)
{
- return PyInt_FromLong((long)getuid());
+ return _PyObject_FromUid(getuid());
}
#endif
@@ -5736,15 +5744,9 @@ Set the current process's user id.");
static PyObject *
posix_setuid(PyObject *self, PyObject *args)
{
- long uid_arg;
uid_t uid;
- if (!PyArg_ParseTuple(args, "l:setuid", &uid_arg))
+ if (!PyArg_ParseTuple(args, "O&:setuid", _PyArg_ParseUid, &uid))
return NULL;
- uid = uid_arg;
- if (uid != uid_arg) {
- PyErr_SetString(PyExc_OverflowError, "user id too big");
- return NULL;
- }
if (setuid(uid) < 0)
return posix_error();
Py_INCREF(Py_None);
@@ -5761,15 +5763,9 @@ Set the current process's effective user
static PyObject *
posix_seteuid (PyObject *self, PyObject *args)
{
- long euid_arg;
uid_t euid;
- if (!PyArg_ParseTuple(args, "l", &euid_arg))
+ if (!PyArg_ParseTuple(args, "O&:seteuid", _PyArg_ParseUid, &euid))
return NULL;
- euid = euid_arg;
- if (euid != euid_arg) {
- PyErr_SetString(PyExc_OverflowError, "user id too big");
- return NULL;
- }
if (seteuid(euid) < 0) {
return posix_error();
} else {
@@ -5787,15 +5783,9 @@ Set the current process's effective grou
static PyObject *
posix_setegid (PyObject *self, PyObject *args)
{
- long egid_arg;
gid_t egid;
- if (!PyArg_ParseTuple(args, "l", &egid_arg))
+ if (!PyArg_ParseTuple(args, "O&:setegid", _PyArg_ParseGid, &egid))
return NULL;
- egid = egid_arg;
- if (egid != egid_arg) {
- PyErr_SetString(PyExc_OverflowError, "group id too big");
- return NULL;
- }
if (setegid(egid) < 0) {
return posix_error();
} else {
@@ -5813,23 +5803,11 @@ Set the current process's real and effec
static PyObject *
posix_setreuid (PyObject *self, PyObject *args)
{
- long ruid_arg, euid_arg;
uid_t ruid, euid;
- if (!PyArg_ParseTuple(args, "ll", &ruid_arg, &euid_arg))
+ if (!PyArg_ParseTuple(args, "O&O&",
+ _PyArg_ParseUid, &ruid,
+ _PyArg_ParseUid, &euid))
return NULL;
- if (ruid_arg == -1)
- ruid = (uid_t)-1; /* let the compiler choose how -1 fits */
- else
- ruid = ruid_arg; /* otherwise, assign from our long */
- if (euid_arg == -1)
- euid = (uid_t)-1;
- else
- euid = euid_arg;
- if ((euid_arg != -1 && euid != euid_arg) ||
- (ruid_arg != -1 && ruid != ruid_arg)) {
- PyErr_SetString(PyExc_OverflowError, "user id too big");
- return NULL;
- }
if (setreuid(ruid, euid) < 0) {
return posix_error();
} else {
@@ -5847,23 +5825,11 @@ Set the current process's real and effec
static PyObject *
posix_setregid (PyObject *self, PyObject *args)
{
- long rgid_arg, egid_arg;
gid_t rgid, egid;
- if (!PyArg_ParseTuple(args, "ll", &rgid_arg, &egid_arg))
+ if (!PyArg_ParseTuple(args, "O&O&",
+ _PyArg_ParseGid, &rgid,
+ _PyArg_ParseGid, &egid))
return NULL;
- if (rgid_arg == -1)
- rgid = (gid_t)-1; /* let the compiler choose how -1 fits */
- else
- rgid = rgid_arg; /* otherwise, assign from our long */
- if (egid_arg == -1)
- egid = (gid_t)-1;
- else
- egid = egid_arg;
- if ((egid_arg != -1 && egid != egid_arg) ||
- (rgid_arg != -1 && rgid != rgid_arg)) {
- PyErr_SetString(PyExc_OverflowError, "group id too big");
- return NULL;
- }
if (setregid(rgid, egid) < 0) {
return posix_error();
} else {
@@ -5881,15 +5847,9 @@ Set the current process's group id.");
static PyObject *
posix_setgid(PyObject *self, PyObject *args)
{
- long gid_arg;
gid_t gid;
- if (!PyArg_ParseTuple(args, "l:setgid", &gid_arg))
- return NULL;
- gid = gid_arg;
- if (gid != gid_arg) {
- PyErr_SetString(PyExc_OverflowError, "group id too big");
+ if (!PyArg_ParseTuple(args, "O&:setgid", _PyArg_ParseGid, &gid))
return NULL;
- }
if (setgid(gid) < 0)
return posix_error();
Py_INCREF(Py_None);
@@ -5922,39 +5882,10 @@ posix_setgroups(PyObject *self, PyObject
elem = PySequence_GetItem(groups, i);
if (!elem)
return NULL;
- if (!PyInt_Check(elem)) {
- if (!PyLong_Check(elem)) {
- PyErr_SetString(PyExc_TypeError,
- "groups must be integers");
- Py_DECREF(elem);
- return NULL;
- } else {
- unsigned long x = PyLong_AsUnsignedLong(elem);
- if (PyErr_Occurred()) {
- PyErr_SetString(PyExc_TypeError,
- "group id too big");
- Py_DECREF(elem);
- return NULL;
- }
- grouplist[i] = x;
- /* read back to see if it fits in gid_t */
- if (grouplist[i] != x) {
- PyErr_SetString(PyExc_TypeError,
- "group id too big");
- Py_DECREF(elem);
- return NULL;
- }
- }
- } else {
- long x = PyInt_AsLong(elem);
- grouplist[i] = x;
- if (grouplist[i] != x) {
- PyErr_SetString(PyExc_TypeError,
- "group id too big");
- Py_DECREF(elem);
- return NULL;
- }
- }
+ if (!_PyArg_ParseGid(elem, &grouplist[i])) {
+ Py_DECREF(elem);
+ return NULL;
+ }
Py_DECREF(elem);
}
@@ -8576,9 +8507,11 @@ Set the current process's real, effectiv
static PyObject*
posix_setresuid (PyObject *self, PyObject *args)
{
- /* We assume uid_t is no larger than a long. */
- long ruid, euid, suid;
- if (!PyArg_ParseTuple(args, "lll", &ruid, &euid, &suid))
+ uid_t ruid, euid, suid;
+ if (!PyArg_ParseTuple(args, "O&O&O&",
+ _PyArg_ParseUid, &ruid,
+ _PyArg_ParseUid, &euid,
+ _PyArg_ParseUid, &suid))
return NULL;
if (setresuid(ruid, euid, suid) < 0)
return posix_error();
@@ -8594,9 +8527,12 @@ Set the current process's real, effectiv
static PyObject*
posix_setresgid (PyObject *self, PyObject *args)
{
- /* We assume uid_t is no larger than a long. */
- long rgid, egid, sgid;
- if (!PyArg_ParseTuple(args, "lll", &rgid, &egid, &sgid))
+ gid_t rgid, egid, sgid;
+ if (!PyArg_ParseTuple(args, "O&O&O&",
+ _PyArg_ParseGid, &rgid,
+ _PyArg_ParseGid, &egid,
+ _PyArg_ParseGid, &sgid))
+
return NULL;
if (setresgid(rgid, egid, sgid) < 0)
return posix_error();
@@ -8613,14 +8549,13 @@ static PyObject*
posix_getresuid (PyObject *self, PyObject *noargs)
{
uid_t ruid, euid, suid;
- long l_ruid, l_euid, l_suid;
+ PyObject *obj_ruid, *obj_euid, *obj_suid;
if (getresuid(&ruid, &euid, &suid) < 0)
return posix_error();
- /* Force the values into long's as we don't know the size of uid_t. */
- l_ruid = ruid;
- l_euid = euid;
- l_suid = suid;
- return Py_BuildValue("(lll)", l_ruid, l_euid, l_suid);
+ obj_ruid = _PyObject_FromUid(ruid);
+ obj_euid = _PyObject_FromUid(euid);
+ obj_suid = _PyObject_FromUid(suid);
+ return Py_BuildValue("(NNN)", obj_ruid, obj_euid, obj_suid);
}
#endif
@@ -8632,15 +8567,14 @@ Get tuple of the current process's real,
static PyObject*
posix_getresgid (PyObject *self, PyObject *noargs)
{
- uid_t rgid, egid, sgid;
- long l_rgid, l_egid, l_sgid;
+ gid_t rgid, egid, sgid;
+ PyObject *obj_rgid, *obj_egid, *obj_sgid;
if (getresgid(&rgid, &egid, &sgid) < 0)
return posix_error();
- /* Force the values into long's as we don't know the size of uid_t. */
- l_rgid = rgid;
- l_egid = egid;
- l_sgid = sgid;
- return Py_BuildValue("(lll)", l_rgid, l_egid, l_sgid);
+ obj_rgid = _PyObject_FromGid(rgid);
+ obj_egid = _PyObject_FromGid(egid);
+ obj_sgid = _PyObject_FromGid(sgid);
+ return Py_BuildValue("(NNN)", obj_rgid, obj_egid, obj_sgid);
}
#endif
diff -up Python-2.7.3/Modules/pwdmodule.c.uid-gid-overflows Python-2.7.3/Modules/pwdmodule.c
--- Python-2.7.3/Modules/pwdmodule.c.uid-gid-overflows 2012-04-09 19:07:34.000000000 -0400
+++ Python-2.7.3/Modules/pwdmodule.c 2012-06-26 14:51:36.006817855 -0400
@@ -73,8 +73,8 @@ mkpwent(struct passwd *p)
#else
SETS(setIndex++, p->pw_passwd);
#endif
- SETI(setIndex++, p->pw_uid);
- SETI(setIndex++, p->pw_gid);
+ PyStructSequence_SET_ITEM(v, setIndex++, _PyObject_FromUid(p->pw_uid));
+ PyStructSequence_SET_ITEM(v, setIndex++, _PyObject_FromGid(p->pw_gid));
#ifdef __VMS
SETS(setIndex++, "");
#else
@@ -103,13 +103,14 @@ See help(pwd) for more on password datab
static PyObject *
pwd_getpwuid(PyObject *self, PyObject *args)
{
- unsigned int uid;
+ uid_t uid;
struct passwd *p;
- if (!PyArg_ParseTuple(args, "I:getpwuid", &uid))
+ if (!PyArg_ParseTuple(args, "O&:getpwuid",
+ _PyArg_ParseUid, &uid))
return NULL;
if ((p = getpwuid(uid)) == NULL) {
PyErr_Format(PyExc_KeyError,
- "getpwuid(): uid not found: %d", uid);
+ "getpwuid(): uid not found: %lu", (unsigned long)uid);
return NULL;
}
return mkpwent(p);
diff -up Python-2.7.3/Python/getargs.c.uid-gid-overflows Python-2.7.3/Python/getargs.c
--- Python-2.7.3/Python/getargs.c.uid-gid-overflows 2012-04-09 19:07:35.000000000 -0400
+++ Python-2.7.3/Python/getargs.c 2012-06-26 14:51:36.007817842 -0400
@@ -4,6 +4,7 @@
#include "Python.h"
#include <ctype.h>
+#include <limits.h>
#ifdef __cplusplus
@@ -1902,6 +1903,110 @@ _PyArg_NoKeywords(const char *funcname,
funcname);
return 0;
}
+
+PyObject *
+_PyObject_FromUid(uid_t uid)
+{
+ if (uid <= (uid_t)LONG_MAX) {
+ return PyInt_FromLong((uid_t)uid);
+ } else {
+ return PyLong_FromUnsignedLong((uid_t)uid);
+ }
+}
+
+PyObject *
+_PyObject_FromGid(gid_t gid)
+{
+ if (gid <= (gid_t)LONG_MAX) {
+ return PyInt_FromLong((gid_t)gid);
+ } else {
+ return PyLong_FromUnsignedLong((gid_t)gid);
+ }
+}
+
+int
+_PyArg_ParseUid(PyObject *in_obj, uid_t *out_uid)
+{
+ PyObject *index, *number = NULL;
+ long sl;
+ unsigned long ul;
+
+ assert(out_uid);
+
+ index = PyNumber_Index(in_obj);
+ if (index != NULL) {
+ number = PyNumber_Long(index);
+ Py_DECREF(index);
+ }
+ if (number == NULL) {
+ PyErr_SetString(PyExc_TypeError, "user id must be integer");
+ return 0;
+ }
+
+ /* Special case: support -1 (e.g. for use by chown) */
+ sl = PyLong_AsLong(number);
+ if (PyErr_Occurred()) {
+ PyErr_Clear();
+ } else if (sl == -1) {
+ Py_DECREF(number);
+ *out_uid = (uid_t)-1;
+ return 1;
+ }
+
+ /* Otherwise, it must be >= 0 */
+ ul = PyLong_AsUnsignedLong(number);
+ Py_DECREF(number);
+ *out_uid = ul;
+ /* read back the value to see if it fitted in uid_t */
+ if (PyErr_Occurred() || *out_uid != ul) {
+ PyErr_SetString(PyExc_OverflowError,
+ "user id is not in range(-1, 2^32-1)");
+ return 0;
+ }
+ return 1;
+}
+
+int
+_PyArg_ParseGid(PyObject *in_obj, gid_t *out_gid)
+{
+ PyObject *index, *number = NULL;
+ long sl;
+ unsigned long ul;
+
+ assert(out_gid);
+
+ index = PyNumber_Index(in_obj);
+ if (index != NULL) {
+ number = PyNumber_Long(index);
+ Py_DECREF(index);
+ }
+ if (number == NULL) {
+ PyErr_SetString(PyExc_TypeError, "group id must be integer");
+ return 0;
+ }
+
+ /* Special case: support -1 (e.g. for use by chown) */
+ sl = PyLong_AsLong(number);
+ if (PyErr_Occurred()) {
+ PyErr_Clear();
+ } else if (sl == -1) {
+ Py_DECREF(number);
+ *out_gid = (gid_t)-1;
+ return 1;
+ }
+
+ ul = PyLong_AsUnsignedLong(number);
+ Py_DECREF(number);
+ *out_gid = ul;
+ /* read back the value to see if it fitted in gid_t */
+ if (PyErr_Occurred() || *out_gid != ul) {
+ PyErr_SetString(PyExc_OverflowError,
+ "group id is not in range(-1, 2^32-1)");
+ return 0;
+ }
+ return 1;
+}
+
#ifdef __cplusplus
};
#endif

View File

@ -266,7 +266,7 @@ diff -up Python-2.7.3/Modules/Setup.dist.crypt-module-salt-backport Python-2.7.3
# #
# First, look at Setup.config; configure may have set this for you. # 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
+_crypt _cryptmodule.c -lcrypt # crypt(3); needs -lcrypt on some systems +_crypt _cryptmodule.c -lcrypt # crypt(3); needs -lcrypt on some systems

View File

@ -7,9 +7,9 @@ diff -up Python-2.7.3/Lib/test/test_gc.py.gc-assertions Python-2.7.3/Lib/test/te
+from test.test_support import verbose, run_unittest, import_module +from test.test_support import verbose, run_unittest, import_module
import sys import sys
+import sysconfig +import sysconfig
import time
import gc import gc
import weakref import weakref
@@ -32,6 +33,8 @@ class GC_Detector(object): @@ -32,6 +33,8 @@ class GC_Detector(object):
self.wr = weakref.ref(C1055820(666), it_happened) self.wr = weakref.ref(C1055820(666), it_happened)

View File

@ -1,6 +1,6 @@
diff -up Python-2.7.3/configure.in.fix-configure-Wformat Python-2.7.3/configure.in diff -up Python-2.7.3/configure.ac.fix-configure-Wformat Python-2.7.3/configure.ac
--- Python-2.7.3/configure.in.fix-configure-Wformat 2013-03-25 15:15:18.473888383 -0400 --- Python-2.7.3/configure.ac.fix-configure-Wformat 2013-03-25 15:15:18.473888383 -0400
+++ Python-2.7.3/configure.in 2013-03-25 15:15:32.513887426 -0400 +++ Python-2.7.3/configure.ac 2013-03-25 15:15:32.513887426 -0400
@@ -1200,7 +1200,7 @@ if test "$GCC" = "yes" @@ -1200,7 +1200,7 @@ if test "$GCC" = "yes"
then then
AC_MSG_CHECKING(whether gcc supports ParseTuple __format__) AC_MSG_CHECKING(whether gcc supports ParseTuple __format__)

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@ diff -up Python-2.5.1/Lib/sqlite3/dbapi2.py.encoding Python-2.5.1/Lib/sqlite3/db
--- Python-2.5.1/Lib/sqlite3/dbapi2.py.encoding 2007-09-14 10:41:50.000000000 -0400 --- Python-2.5.1/Lib/sqlite3/dbapi2.py.encoding 2007-09-14 10:41:50.000000000 -0400
+++ Python-2.5.1/Lib/sqlite3/dbapi2.py 2007-09-14 10:42:00.000000000 -0400 +++ Python-2.5.1/Lib/sqlite3/dbapi2.py 2007-09-14 10:42:00.000000000 -0400
@@ -1,7 +1,6 @@ @@ -1,7 +1,6 @@
-#-*- coding: ISO-8859-1 -*- -# -*- coding: iso-8859-1 -*-
# pysqlite2/dbapi2.py: the DB-API 2.0 interface # pysqlite2/dbapi2.py: the DB-API 2.0 interface
# #
-# Copyright (C) 2004-2005 Gerhard Häring <gh@ghaering.de> -# Copyright (C) 2004-2005 Gerhard Häring <gh@ghaering.de>

View File

@ -1,6 +1,6 @@
diff -up Python-2.6/configure.in.rpath Python-2.6/configure.in diff -up Python-2.6/configure.ac.rpath Python-2.6/configure.ac
--- Python-2.6/configure.in.rpath 2008-11-24 02:51:06.000000000 -0500 --- Python-2.6/configure.ac.rpath 2008-11-24 02:51:06.000000000 -0500
+++ Python-2.6/configure.in 2008-11-24 02:51:21.000000000 -0500 +++ Python-2.6/configure.ac 2008-11-24 02:51:21.000000000 -0500
@@ -729,7 +729,7 @@ if test $enable_shared = "yes"; then @@ -729,7 +729,7 @@ if test $enable_shared = "yes"; then
;; ;;
OSF*) OSF*)

View File

@ -1,6 +1,5 @@
diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dist --- Python-2.7.4/Modules/Setup.dist.rhconfig 2013-04-06 16:02:34.000000000 +0200
--- Python-2.7.1/Modules/Setup.dist.rhconfig 2010-08-21 07:40:30.000000000 -0400 +++ Python-2.7.4/Modules/Setup.dist 2013-04-08 10:05:16.369985654 +0200
+++ Python-2.7.1/Modules/Setup.dist 2010-12-23 15:47:12.111059967 -0500
@@ -153,7 +153,7 @@ GLHACK=-Dclear=__GLclear @@ -153,7 +153,7 @@ GLHACK=-Dclear=__GLclear
# modules are to be built as shared libraries (see above for more # modules are to be built as shared libraries (see above for more
# detail; also note that *static* reverses this effect): # detail; also note that *static* reverses this effect):
@ -10,7 +9,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dis
# GNU readline. Unlike previous Python incarnations, GNU readline is # GNU readline. Unlike previous Python incarnations, GNU readline is
# now incorporated in an optional module, configured in the Setup file # now incorporated in an optional module, configured in the Setup file
@@ -163,73 +163,73 @@ GLHACK=-Dclear=__GLclear @@ -163,74 +163,74 @@ GLHACK=-Dclear=__GLclear
# it, depending on your system -- see the GNU readline instructions. # it, depending on your system -- see the GNU readline instructions.
# It's okay for this to be a shared library, too. # It's okay for this to be a shared library, too.
@ -29,9 +28,6 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dis
-#_testcapi _testcapimodule.c # Python C API test module -#_testcapi _testcapimodule.c # Python C API test module
-#_random _randommodule.c # Random number generator -#_random _randommodule.c # Random number generator
-#_collections _collectionsmodule.c # Container types -#_collections _collectionsmodule.c # Container types
-#itertools itertoolsmodule.c # Functions creating iterators for efficient looping
-#strop stropmodule.c # String manipulations
-#_functools _functoolsmodule.c # Tools for working with functions and callable objects
+array arraymodule.c # array objects +array arraymodule.c # array objects
+cmath cmathmodule.c _math.c # -lm # complex math library functions +cmath cmathmodule.c _math.c # -lm # complex math library functions
+math mathmodule.c _math.c # -lm # math library functions, e.g. sin() +math mathmodule.c _math.c # -lm # math library functions, e.g. sin()
@ -41,6 +37,10 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dis
+_testcapi _testcapimodule.c # Python C API test module +_testcapi _testcapimodule.c # Python C API test module
+_random _randommodule.c # Random number generator +_random _randommodule.c # Random number generator
+_collections _collectionsmodule.c # Container types +_collections _collectionsmodule.c # Container types
#_heapq _heapqmodule.c # Heapq type
-#itertools itertoolsmodule.c # Functions creating iterators for efficient looping
-#strop stropmodule.c # String manipulations
-#_functools _functoolsmodule.c # Tools for working with functions and callable objects
+itertools itertoolsmodule.c # Functions creating iterators for efficient looping +itertools itertoolsmodule.c # Functions creating iterators for efficient looping
+strop stropmodule.c # String manipulations +strop stropmodule.c # String manipulations
+_functools _functoolsmodule.c # Tools for working with functions and callable objects +_functools _functoolsmodule.c # Tools for working with functions and callable objects
@ -81,7 +81,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dis
# Socket module helper for socket(2) # Socket module helper for socket(2)
-#_socket socketmodule.c -#_socket socketmodule.c
+_socket socketmodule.c +_socket socketmodule.c timemodule.c
# Socket module helper for SSL support; you must comment out the other # Socket module helper for SSL support; you must comment out the other
# socket line above, and possibly edit the SSL variable: # socket line above, and possibly edit the SSL variable:
@ -99,7 +99,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dis
# First, look at Setup.config; configure may have set this for you. # 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
+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 # Some more UNIX dependent modules -- off by default, since these
@ -114,7 +114,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dis
# Multimedia modules -- off by default. # Multimedia modules -- off by default.
@@ -237,8 +237,8 @@ GLHACK=-Dclear=__GLclear @@ -238,8 +238,8 @@ GLHACK=-Dclear=__GLclear
# #993173 says audioop works on 64-bit platforms, though. # #993173 says audioop works on 64-bit platforms, though.
# These represent audio samples or images as strings: # These represent audio samples or images as strings:
@ -125,7 +125,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dis
# Note that the _md5 and _sha modules are normally only built if the # Note that the _md5 and _sha modules are normally only built if the
@@ -248,14 +248,14 @@ GLHACK=-Dclear=__GLclear @@ -249,14 +249,14 @@ GLHACK=-Dclear=__GLclear
# Message-Digest Algorithm, described in RFC 1321. The necessary files # Message-Digest Algorithm, described in RFC 1321. The necessary files
# md5.c and md5.h are included here. # md5.c and md5.h are included here.
@ -144,7 +144,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dis
# SGI IRIX specific modules -- off by default. # SGI IRIX specific modules -- off by default.
@@ -302,12 +302,12 @@ GLHACK=-Dclear=__GLclear @@ -303,12 +303,12 @@ GLHACK=-Dclear=__GLclear
# A Linux specific module -- off by default; this may also work on # A Linux specific module -- off by default; this may also work on
# some *BSDs. # some *BSDs.
@ -159,7 +159,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dis
# The _tkinter module. # The _tkinter module.
@@ -322,7 +322,7 @@ GLHACK=-Dclear=__GLclear @@ -323,7 +323,7 @@ GLHACK=-Dclear=__GLclear
# every system. # every system.
# *** Always uncomment this (leave the leading underscore in!): # *** Always uncomment this (leave the leading underscore in!):
@ -168,7 +168,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dis
# *** Uncomment and edit to reflect where your Tcl/Tk libraries are: # *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
# -L/usr/local/lib \ # -L/usr/local/lib \
# *** Uncomment and edit to reflect where your Tcl/Tk headers are: # *** Uncomment and edit to reflect where your Tcl/Tk headers are:
@@ -332,7 +332,7 @@ GLHACK=-Dclear=__GLclear @@ -333,7 +333,7 @@ GLHACK=-Dclear=__GLclear
# *** Or uncomment this for Solaris: # *** Or uncomment this for Solaris:
# -I/usr/openwin/include \ # -I/usr/openwin/include \
# *** Uncomment and edit for Tix extension only: # *** Uncomment and edit for Tix extension only:
@ -177,7 +177,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dis
# *** Uncomment and edit for BLT extension only: # *** Uncomment and edit for BLT extension only:
# -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \ # -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \
# *** Uncomment and edit for PIL (TkImaging) extension only: # *** Uncomment and edit for PIL (TkImaging) extension only:
@@ -341,7 +341,7 @@ GLHACK=-Dclear=__GLclear @@ -342,7 +342,7 @@ GLHACK=-Dclear=__GLclear
# *** Uncomment and edit for TOGL extension only: # *** Uncomment and edit for TOGL extension only:
# -DWITH_TOGL togl.c \ # -DWITH_TOGL togl.c \
# *** Uncomment and edit to reflect your Tcl/Tk versions: # *** Uncomment and edit to reflect your Tcl/Tk versions:
@ -186,7 +186,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dis
# *** Uncomment and edit to reflect where your X11 libraries are: # *** Uncomment and edit to reflect where your X11 libraries are:
# -L/usr/X11R6/lib \ # -L/usr/X11R6/lib \
# *** Or uncomment this for Solaris: # *** Or uncomment this for Solaris:
@@ -351,7 +351,7 @@ GLHACK=-Dclear=__GLclear @@ -352,7 +352,7 @@ GLHACK=-Dclear=__GLclear
# *** Uncomment for AIX: # *** Uncomment for AIX:
# -lld \ # -lld \
# *** Always uncomment this; X11 libraries to link with: # *** Always uncomment this; X11 libraries to link with:
@ -195,7 +195,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dis
# Lance Ellinghaus's syslog module # Lance Ellinghaus's syslog module
#syslog syslogmodule.c # syslog daemon interface #syslog syslogmodule.c # syslog daemon interface
@@ -373,7 +373,7 @@ GLHACK=-Dclear=__GLclear @@ -374,7 +374,7 @@ GLHACK=-Dclear=__GLclear
# it is a highly experimental and dangerous device for calling # it is a highly experimental and dangerous device for calling
# *arbitrary* C functions in *arbitrary* shared libraries: # *arbitrary* C functions in *arbitrary* shared libraries:
@ -204,7 +204,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dis
# Modules that provide persistent dictionary-like semantics. You will # Modules that provide persistent dictionary-like semantics. You will
@@ -396,7 +396,7 @@ GLHACK=-Dclear=__GLclear @@ -397,7 +397,7 @@ GLHACK=-Dclear=__GLclear
# #
# First, look at Setup.config; configure may have set this for you. # First, look at Setup.config; configure may have set this for you.
@ -213,7 +213,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dis
# Sleepycat Berkeley DB interface. # Sleepycat Berkeley DB interface.
@@ -411,11 +411,10 @@ GLHACK=-Dclear=__GLclear @@ -412,11 +412,10 @@ GLHACK=-Dclear=__GLclear
# #
# Edit the variables DB and DBLIBVERto point to the db top directory # Edit the variables DB and DBLIBVERto point to the db top directory
# and the subdirectory of PORT where you built it. # and the subdirectory of PORT where you built it.
@ -229,7 +229,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dis
# Historical Berkeley DB 1.85 # Historical Berkeley DB 1.85
# #
@@ -430,14 +429,14 @@ GLHACK=-Dclear=__GLclear @@ -431,14 +430,14 @@ GLHACK=-Dclear=__GLclear
# Helper module for various ascii-encoders # Helper module for various ascii-encoders
@ -248,7 +248,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dis
# Lee Busby's SIGFPE modules. # Lee Busby's SIGFPE modules.
@@ -460,7 +459,7 @@ GLHACK=-Dclear=__GLclear @@ -461,7 +460,7 @@ GLHACK=-Dclear=__GLclear
# Andrew Kuchling's zlib module. # Andrew Kuchling's zlib module.
# This require zlib 1.1.3 (or later). # This require zlib 1.1.3 (or later).
# See http://www.gzip.org/zlib/ # See http://www.gzip.org/zlib/
@ -257,7 +257,7 @@ diff -up Python-2.7.1/Modules/Setup.dist.rhconfig Python-2.7.1/Modules/Setup.dis
# Interface to the Expat XML parser # Interface to the Expat XML parser
# #
@@ -479,14 +478,14 @@ GLHACK=-Dclear=__GLclear @@ -480,14 +479,14 @@ GLHACK=-Dclear=__GLclear
# Hye-Shik Chang's CJKCodecs # Hye-Shik Chang's CJKCodecs
# multibytecodec is required for all the other CJK codec modules # multibytecodec is required for all the other CJK codec modules

View File

@ -1,6 +1,6 @@
diff -up Python-2.7.3/configure.in.debug-build Python-2.7.3/configure.in diff -up Python-2.7.3/configure.ac.debug-build Python-2.7.3/configure.ac
--- Python-2.7.3/configure.in.debug-build 2012-04-18 19:46:22.066498521 -0400 --- Python-2.7.3/configure.ac.debug-build 2012-04-18 19:46:22.066498521 -0400
+++ Python-2.7.3/configure.in 2012-04-18 19:46:22.078498372 -0400 +++ Python-2.7.3/configure.ac 2012-04-18 19:46:22.078498372 -0400
@@ -635,7 +635,7 @@ AC_SUBST(LIBRARY) @@ -635,7 +635,7 @@ AC_SUBST(LIBRARY)
AC_MSG_CHECKING(LIBRARY) AC_MSG_CHECKING(LIBRARY)
if test -z "$LIBRARY" if test -z "$LIBRARY"
@ -75,7 +75,7 @@ diff -up Python-2.7.3/Lib/distutils/sysconfig.py.debug-build Python-2.7.3/Lib/di
elif os.name == "os2": elif os.name == "os2":
@@ -250,7 +251,7 @@ def get_makefile_filename(): @@ -250,7 +251,7 @@ def get_makefile_filename():
if python_build: if python_build:
return os.path.join(os.path.dirname(sys.executable), "Makefile") return os.path.join(project_base, "Makefile")
lib_dir = get_python_lib(plat_specific=1, standard_lib=1) lib_dir = get_python_lib(plat_specific=1, standard_lib=1)
- return os.path.join(lib_dir, "config", "Makefile") - return os.path.join(lib_dir, "config", "Makefile")
+ return os.path.join(lib_dir, "config" + (sys.pydebug and "-debug" or ""), "Makefile") + return os.path.join(lib_dir, "config" + (sys.pydebug and "-debug" or ""), "Makefile")
@ -132,11 +132,11 @@ diff -up Python-2.7.3/Makefile.pre.in.debug-build Python-2.7.3/Makefile.pre.in
+PYTHON= python$(DEBUG_SUFFIX)$(EXE) +PYTHON= python$(DEBUG_SUFFIX)$(EXE)
+BUILDPYTHON= python$(DEBUG_SUFFIX)$(BUILDEXE) +BUILDPYTHON= python$(DEBUG_SUFFIX)$(BUILDEXE)
# The task to run while instrument when building the profile-opt target PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@
PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck _PYTHON_HOST_PLATFORM=@_PYTHON_HOST_PLATFORM@
@@ -413,7 +419,7 @@ sharedmods: $(BUILDPYTHON) @@ -413,7 +419,7 @@ sharedmods: $(BUILDPYTHON)
*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \ $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
esac $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
-libpython$(VERSION).so: $(LIBRARY_OBJS) -libpython$(VERSION).so: $(LIBRARY_OBJS)
+libpython$(VERSION)$(DEBUG_EXT).so: $(LIBRARY_OBJS) +libpython$(VERSION)$(DEBUG_EXT).so: $(LIBRARY_OBJS)
@ -183,7 +183,7 @@ diff -up Python-2.7.3/Makefile.pre.in.debug-build Python-2.7.3/Makefile.pre.in
if test -n "$(DLLLIBRARY)" ; then \ if test -n "$(DLLLIBRARY)" ; then \
$(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \ $(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
@@ -970,10 +976,11 @@ $(srcdir)/Lib/$(PLATDIR): @@ -970,10 +976,11 @@ $(srcdir)/Lib/$(PLATDIR):
export EXE; EXE="$(BUILDEXE)"; \ fi; \
cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen
-python-config: $(srcdir)/Misc/python-config.in -python-config: $(srcdir)/Misc/python-config.in

View File

@ -105,8 +105,8 @@
Summary: An interpreted, interactive, object-oriented programming language Summary: An interpreted, interactive, object-oriented programming language
Name: %{python} Name: %{python}
# Remember to also rebase python-docs when changing this: # Remember to also rebase python-docs when changing this:
Version: 2.7.3 Version: 2.7.4
Release: 35%{?dist} Release: 1%{?dist}
License: Python License: Python
Group: Development/Languages Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release} Requires: %{python}-libs%{?_isa} = %{version}-%{release}
@ -345,19 +345,8 @@ Patch54: python-2.6.4-setup-db48.patch
# for 2.7rc1 by dmalcolm: # for 2.7rc1 by dmalcolm:
Patch55: 00055-systemtap.patch Patch55: 00055-systemtap.patch
# "lib64 patches" # Upstream as of Python 2.7.4
# This patch seems to be associated with bug 122304, which was # Patch101: 00101-lib64-regex.patch
# http://sourceforge.net/tracker/?func=detail&atid=105470&aid=931848&group_id=5470
# and is now
# http://bugs.python.org/issue931848
# However, as it stands this patch is merely a copy of:
# http://svn.python.org/view/python/trunk/Lib/test/test_re.py?r1=35825&r2=35824&pathrev=35825
# which is already upstream
# Earlier versions of the patch (from the "dist-pkgs" CVS repo within RH)
# contained additional changes that applied fixes to the internals of the regex
# module, but these appear to have all been applied as part of
# http://bugs.python.org/issue931848
Patch101: 00101-lib64-regex.patch
# Only used when "%{_lib}" == "lib64" # Only used when "%{_lib}" == "lib64"
# Fixup various paths throughout the build and in distutils from "lib" to "lib64", # Fixup various paths throughout the build and in distutils from "lib" to "lib64",
@ -688,14 +677,8 @@ Patch156: 00156-gdb-autoload-safepath.patch
# (rhbz#697470) # (rhbz#697470)
Patch157: 00157-uid-gid-overflows.patch Patch157: 00157-uid-gid-overflows.patch
# 00158 # # Upstream as of Python 2.7.4
# This patch fixes a memory leak in _hashlib module, as reported in # Patch158: 00158-fix-hashlib-leak.patch
# RHBZ #836285; upstream report http://bugs.python.org/issue15219.
# The patch has been accepted upstream, so this should be commented out
# when packaging next upstream release.
# The fix for Fedora specific "implement_specific_EVP_new()" function
# has been merged into patch 00146.
Patch158: 00158-fix-hashlib-leak.patch
# 00159 # # 00159 #
# From F18 on, there is a libdb4 package, that replaces db4. It places header # From F18 on, there is a libdb4 package, that replaces db4. It places header
@ -782,28 +765,11 @@ Patch169: 00169-avoid-implicit-usage-of-md5-in-multiprocessing.patch
# (rhbz#850013) # (rhbz#850013)
Patch170: 00170-gc-assertions.patch Patch170: 00170-gc-assertions.patch
# 00171 # # Upstream as of Python 2.7.4
# Fix os.urandom() so that it raises NotImplementedError rather than OSError # Patch171: 00171-raise-correct-exception-when-dev-urandom-is-missing.patch
# if /dev/urandom can't be opened (e.g. in some chroots), given that callers
# such as the random module have handler code expecting NotImplementedError
# (regression introduced by hash randomization patch)
#
# Cherrypick of http://hg.python.org/cpython/rev/edbf37ace03c/ from upstream
# (rhbz#907383; http://bugs.python.org/issue15340)
Patch171: 00171-raise-correct-exception-when-dev-urandom-is-missing.patch
# 00172 # # Upstream as of Python 2.7.4
# Port _multiprocessing.Connection.poll() to use the "poll" syscall, rather # Patch172: 00172-use-poll-for-multiprocessing-socket-connection.patch
# than "select", allowing large numbers of subprocesses
#
# Based on this sequence of upstream patches to 2.7:
# http://hg.python.org/cpython/rev/c5c27b84d7af/
# http://hg.python.org/cpython/rev/7cf4ea64f603/
# http://hg.python.org/cpython/rev/da5e520a7ba5/
# http://hg.python.org/cpython/rev/f07435fa6736/
#
#(rhbz#849992; http://bugs.python.org/issue10527)
Patch172: 00172-use-poll-for-multiprocessing-socket-connection.patch
# 00173 # # 00173 #
# Workaround for ENOPROTOOPT seen in Koji within # Workaround for ENOPROTOOPT seen in Koji within
@ -1080,7 +1046,7 @@ done
%patch54 -p1 -b .setup-db48 %patch54 -p1 -b .setup-db48
%patch101 -p1 -b .lib64-regex # patch101: upstream as of Python 2.7.4
%if "%{_lib}" == "lib64" %if "%{_lib}" == "lib64"
%patch102 -p1 -b .lib64 %patch102 -p1 -b .lib64
%patch103 -p1 -b .lib64-sysconfig %patch103 -p1 -b .lib64-sysconfig
@ -1152,7 +1118,7 @@ done
%patch155 -p1 %patch155 -p1
%patch156 -p1 %patch156 -p1
%patch157 -p1 %patch157 -p1
%patch158 -p1 # 00158: upstream as of Python 2.7.4
%patch159 -p1 -F 3 %patch159 -p1 -F 3
# 00160: not for python 2 # 00160: not for python 2
# 00161: not for python 2 yet # 00161: not for python 2 yet
@ -1166,8 +1132,8 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch168 -p1 %patch168 -p1
%patch169 -p1 %patch169 -p1
%patch170 -p1 %patch170 -p1
%patch171 -p1 -b .raise-correct-exception-when-dev-urandom-is-missing # 00171: upstream as of Python 2.7.4
%patch172 -p1 # 00171: upstream as of Python 2.7.4
%patch173 -p1 %patch173 -p1
%patch174 -p1 -b .fix-for-usr-move %patch174 -p1 -b .fix-for-usr-move
%patch175 -p1 -b .fix-configure-Wformat %patch175 -p1 -b .fix-configure-Wformat
@ -2003,6 +1969,19 @@ rm -fr %{buildroot}
# ====================================================== # ======================================================
%changelog %changelog
* Mon Apr 08 2013 Bohuslav Kabrda <bkabrda@redhat.com> - 2.7.4-1
- Updated to Python 2.7.4.
- Refreshed patches: 0 (config), 7 (sqlite encoding), 16 (rpath in config),
55 (systemtap), 111 (no static lib), 112 (debug build), 113 (more
configuration flags), 130 (add extension to python config), 134 (fix
COUNT_ALLOCS in test_sys), 146 (haslib FIPS), 147 (add debug malloc stats),
153 (fix gdb test noise), 157 (uid, gid overflow - fixed upstream, just
keeping few more downstream tests), 165 (crypt module salt backport),
175 (fix configure Wformat), 5000 (regenerated autotooling patch)
- Dropped patches: 101 (lib64 regex; merged upstream), 171 (exception on
missing /dev/urandom; merged upstream), 172 (poll for multiprocessing socket
connection; merged upstream)
* Mon Mar 25 2013 David Malcolm <dmalcolm@redhat.com> - 2.7.3-35 * Mon Mar 25 2013 David Malcolm <dmalcolm@redhat.com> - 2.7.3-35
- fix gcc 4.8 incompatibility (rhbz#927358); regenerate autotool intermediates - fix gcc 4.8 incompatibility (rhbz#927358); regenerate autotool intermediates