]> granicus.if.org Git - python/commitdiff
SF bug 690622: test_cpickle overflows stack on MacOS9.
authorTim Peters <tim.peters@gmail.com>
Fri, 21 Feb 2003 20:14:35 +0000 (20:14 +0000)
committerTim Peters <tim.peters@gmail.com>
Fri, 21 Feb 2003 20:14:35 +0000 (20:14 +0000)
test_nonrecursive_deep():  Reduced nesting depth to 60.

Not a bugfix candidate.  2.3 increased the number of stack frames
needed to pickle a list (in order to get implement the "list
batching" unpickling memory optimization new in 2.3).

Lib/test/test_cpickle.py

index f1700d6612be4ddfae5e3f2fe83d3a5e99d0d77e..238fff21a995bf603ebf98be90783b3316a9bf9b 100644 (file)
@@ -81,8 +81,12 @@ class cPickleFastPicklerTests(AbstractPickleTests):
                           self)
 
     def test_nonrecursive_deep(self):
+        # If it's not cyclic, it should pickle OK even if the nesting
+        # depth exceeds PY_CPICKLE_FAST_LIMIT.  That happens to be
+        # 50 today.  Jack Jansen reported stack overflow on Mac OS 9
+        # at 64.
         a = []
-        for i in range(100):
+        for i in range(60):
             a = [a]
         b = self.loads(self.dumps(a))
         self.assertEqual(a, b)