[Python-checkins] python/dist/src/Lib/test test_marshal.py,1.6,1.7

arigo at users.sourceforge.net arigo at users.sourceforge.net
Mon Dec 20 13:25:59 CET 2004


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv325/Lib/test

Modified Files:
	test_marshal.py 
Log Message:
Any call to marshal.dumps() with the new optional argument 'version' just
immediately segfaults, due to a typo!  This was obviously never tested...  
Added a test for it, and also fixed the documentation.



Index: test_marshal.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_marshal.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- test_marshal.py	26 Mar 2004 15:09:27 -0000	1.6
+++ test_marshal.py	20 Dec 2004 12:25:56 -0000	1.7
@@ -180,6 +180,11 @@
         self.assertRaises(Exception, marshal.loads, 'f')
         self.assertRaises(Exception, marshal.loads, marshal.dumps(5L)[:-1])
 
+    def test_version_argument(self):
+        # Python 2.4.0 crashes for any call to marshal.dumps(x, y)
+        self.assertEquals(marshal.loads(marshal.dumps(5, 0)), 5)
+        self.assertEquals(marshal.loads(marshal.dumps(5, 1)), 5)
+
 def test_main():
     test_support.run_unittest(IntTestCase,
                               FloatTestCase,



More information about the Python-checkins mailing list