]> granicus.if.org Git - python/commitdiff
Merged revisions 66018 via svnmerge from
authorNeal Norwitz <nnorwitz@gmail.com>
Sun, 24 Aug 2008 22:07:28 +0000 (22:07 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Sun, 24 Aug 2008 22:07:28 +0000 (22:07 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r66018 | neal.norwitz | 2008-08-24 15:03:05 -0700 (Sun, 24 Aug 2008) | 6 lines

  #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
........

Lib/test/test_fileio.py
Modules/_fileio.c

index 12b8e7da3186c36e6b8457082ed4ae049a1e028d..a676bc21180fe4414bf494b44f0754656c05dffd 100644 (file)
@@ -226,6 +226,10 @@ class OtherFileTests(unittest.TestCase):
             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.
index ec123e891e83ebf26df0f9ca98108b6f4927c02d..81ca20227d1cd428a55cddfe1dc1e235c17e1984 100644 (file)
@@ -175,7 +175,7 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds)
                                                 kwlist,
                                                 Py_FileSystemDefaultEncoding,
                                                 &name, &mode, &closefd))
-                       goto error;
+                       return -1;
            }
        }