As a result of a regression that snuck into 2.5.3 add a test case that
ensures that when you try to read from a file opened for writing an IOError
is raised.
diff --git a/Lib/test/test_file.py b/Lib/test/test_file.py
index 2d791a5..96f6da2 100644
--- a/Lib/test/test_file.py
+++ b/Lib/test/test_file.py
@@ -120,6 +120,8 @@
except:
self.assertEquals(self.f.__exit__(*sys.exc_info()), None)
+ def testReadWhenWriting(self):
+ self.assertRaises(IOError, self.f.read)
class OtherFileTests(unittest.TestCase):