Merged revisions 67052 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r67052 | christian.heimes | 2008-10-30 22:26:15 +0100 (Thu, 30 Oct 2008) | 1 line

  Issue #4237: io.FileIO() was raising invalid warnings caused by insufficient initialization of PyFileIOObject struct members.
........
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
index 9ef2a81..08a524f 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -1236,6 +1236,13 @@
             else:
                 self.assert_(issubclass(obj, io.IOBase))
 
+    def test_fileio_warnings(self):
+        with test_support.check_warnings() as w:
+            self.assertEqual(w.warnings, [])
+            self.assertRaises(TypeError, io.FileIO, [])
+            self.assertEqual(w.warnings, [])
+            self.assertRaises(ValueError, io.FileIO, "/some/invalid/name", "rt")
+            self.assertEqual(w.warnings, [])
 
 def test_main():
     test_support.run_unittest(IOTest, BytesIOTest, StringIOTest,