Backport of r67908:
Added test case to ensure attempts to read from a file opened for writing
fail.
diff --git a/Lib/test/test_file.py b/Lib/test/test_file.py
index 8308710..f678df6 100644
--- a/Lib/test/test_file.py
+++ b/Lib/test/test_file.py
@@ -116,6 +116,8 @@
except:
self.assertEquals(self.f.__exit__(*sys.exc_info()), None)
+ def testReadWhenWriting(self):
+ self.assertRaises(IOError, self.f.read)
class OtherFileTests(unittest.TestCase):
diff --git a/Misc/NEWS b/Misc/NEWS
index f7ff496..b581a78 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -9,6 +9,12 @@
*Release date: XX-XXX-2009*
+Core and builtins
+-----------------
+
+- Added test case to ensure attempts to read from a file opened for writing
+ fail.
+
What's New in Python 2.5.3?
===========================