[Python-checkins] python/dist/src/Lib/test test_cpickle.py,1.13,1.14

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
Fri, 21 Feb 2003 12:14:37 -0800


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1:/tmp/cvs-serv22191/Lib/test

Modified Files:
	test_cpickle.py 
Log Message:
SF bug 690622: test_cpickle overflows stack on MacOS9.
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).


Index: test_cpickle.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_cpickle.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** test_cpickle.py	28 Jan 2003 22:26:28 -0000	1.13
--- test_cpickle.py	21 Feb 2003 20:14:35 -0000	1.14
***************
*** 82,87 ****
  
      def test_nonrecursive_deep(self):
          a = []
!         for i in range(100):
              a = [a]
          b = self.loads(self.dumps(a))
--- 82,91 ----
  
      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(60):
              a = [a]
          b = self.loads(self.dumps(a))