[Python-checkins] r66018 - in python/trunk: Lib/test/test_fileio.py Modules/_fileio.c

neal.norwitz python-checkins at python.org
Mon Aug 25 00:03:05 CEST 2008


Author: neal.norwitz
Date: Mon Aug 25 00:03:05 2008
New Revision: 66018

Log:
#3662: Fix segfault introduced when fixing memory leaks.

TESTED=./python -E -tt ./Lib/test/regrtest.py test_fileio
R (approach from bug)=Amaury and Benjamin



Modified:
   python/trunk/Lib/test/test_fileio.py
   python/trunk/Modules/_fileio.c

Modified: python/trunk/Lib/test/test_fileio.py
==============================================================================
--- python/trunk/Lib/test/test_fileio.py	(original)
+++ python/trunk/Lib/test/test_fileio.py	Mon Aug 25 00:03:05 2008
@@ -227,6 +227,10 @@
             except:
                 pass
 
+    def testInvalidInit(self):
+        self.assertRaises(TypeError, _fileio._FileIO, "1", 0, 0)
+
+
 def test_main():
     # Historically, these tests have been sloppy about removing TESTFN.
     # So get rid of it no matter what.

Modified: python/trunk/Modules/_fileio.c
==============================================================================
--- python/trunk/Modules/_fileio.c	(original)
+++ python/trunk/Modules/_fileio.c	Mon Aug 25 00:03:05 2008
@@ -175,7 +175,7 @@
 						 kwlist,
 						 Py_FileSystemDefaultEncoding,
 						 &name, &mode, &closefd))
-			goto error;
+			return -1;
 	    }
 	}
 


More information about the Python-checkins mailing list