Commit 901e4715 authored by Neal Norwitz's avatar Neal Norwitz

#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
parent dcf48912
...@@ -227,6 +227,10 @@ class OtherFileTests(unittest.TestCase): ...@@ -227,6 +227,10 @@ class OtherFileTests(unittest.TestCase):
except: except:
pass pass
def testInvalidInit(self):
self.assertRaises(TypeError, _fileio._FileIO, "1", 0, 0)
def test_main(): def test_main():
# Historically, these tests have been sloppy about removing TESTFN. # Historically, these tests have been sloppy about removing TESTFN.
# So get rid of it no matter what. # So get rid of it no matter what.
......
...@@ -175,7 +175,7 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds) ...@@ -175,7 +175,7 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds)
kwlist, kwlist,
Py_FileSystemDefaultEncoding, Py_FileSystemDefaultEncoding,
&name, &mode, &closefd)) &name, &mode, &closefd))
goto error; return -1;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment