Commit 607965eb authored by Barry Warsaw's avatar Barry Warsaw

Comment out two tests that won't pass now after reverting the typeobject.c

change.  Also, as per further discussion, we'll just remove the regressing
code in typeobject.c
parent f65395c8
...@@ -42,11 +42,12 @@ class BufferTests(unittest.TestCase): ...@@ -42,11 +42,12 @@ class BufferTests(unittest.TestCase):
with self.assertRaises(TypeError): with self.assertRaises(TypeError):
copy.copy(buf) copy.copy(buf)
def test_pickle(self): # See issue #22995
buf = buffer(b'abc') ## def test_pickle(self):
for proto in range(pickle.HIGHEST_PROTOCOL + 1): ## buf = buffer(b'abc')
with self.assertRaises(TypeError): ## for proto in range(pickle.HIGHEST_PROTOCOL + 1):
pickle.dumps(buf, proto) ## with self.assertRaises(TypeError):
## pickle.dumps(buf, proto)
def test_main(): def test_main():
......
...@@ -362,11 +362,12 @@ class OtherTest(unittest.TestCase): ...@@ -362,11 +362,12 @@ class OtherTest(unittest.TestCase):
with self.assertRaises(TypeError): with self.assertRaises(TypeError):
copy.copy(m) copy.copy(m)
def test_pickle(self): # See issue #22995
m = memoryview(b'abc') ## def test_pickle(self):
for proto in range(pickle.HIGHEST_PROTOCOL + 1): ## m = memoryview(b'abc')
with self.assertRaises(TypeError): ## for proto in range(pickle.HIGHEST_PROTOCOL + 1):
pickle.dumps(m, proto) ## with self.assertRaises(TypeError):
## pickle.dumps(m, proto)
def test_main(): def test_main():
......
...@@ -10,7 +10,7 @@ What's New in Python 2.7.12? ...@@ -10,7 +10,7 @@ What's New in Python 2.7.12?
Core and Builtins Core and Builtins
----------------- -----------------
- Issue #22995: [UPDATE] Comment out the one of the pickleability tests in - Issue #22995: [UPDATE] Remove the one of the pickleability tests in
_PyObject_GetState() due to regressions observed in Cython-based projects. _PyObject_GetState() due to regressions observed in Cython-based projects.
- Issue #25961: Disallowed null characters in the type name. - Issue #25961: Disallowed null characters in the type name.
......
...@@ -3279,30 +3279,6 @@ reduce_2(PyObject *obj) ...@@ -3279,30 +3279,6 @@ reduce_2(PyObject *obj)
if (names == NULL) if (names == NULL)
goto end; goto end;
assert(names == Py_None || PyList_Check(names)); assert(names == Py_None || PyList_Check(names));
#if 0
/* 2016-01-11 barry - This clause breaks at least three packages which
rely on Cython: kivy, pysam, and s3ql. Cython may be doing
something funny under the hood, but as this is clearly a regression
and the rationale for this prohibition is suspect, I am commenting
this out. Perhaps it should just be removed. See issue #22995 for
details.
*/
if (required_state) {
Py_ssize_t basicsize = PyBaseObject_Type.tp_basicsize;
if (obj->ob_type->tp_dictoffset)
basicsize += sizeof(PyObject *);
if (obj->ob_type->tp_weaklistoffset)
basicsize += sizeof(PyObject *);
if (names != Py_None)
basicsize += sizeof(PyObject *) * Py_SIZE(names);
if (obj->ob_type->tp_basicsize > basicsize) {
PyErr_Format(PyExc_TypeError,
"can't pickle %.200s objects",
Py_TYPE(obj)->tp_name);
goto end;
}
}
#endif
if (names != Py_None) { if (names != Py_None) {
slots = PyDict_New(); slots = PyDict_New();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment