]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merged revisions 67910 via svnmerge from
authorSkip Montanaro <skip@pobox.com>
Tue, 23 Dec 2008 03:55:20 +0000 (03:55 +0000)
committerSkip Montanaro <skip@pobox.com>
Tue, 23 Dec 2008 03:55:20 +0000 (03:55 +0000)
svn+ssh://pythondev@svn.python.org/python/branches/py3k

................
  r67910 | skip.montanaro | 2008-12-22 21:51:14 -0600 (Mon, 22 Dec 2008) | 11 lines

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

  ........
    r67908 | skip.montanaro | 2008-12-22 21:30:15 -0600 (Mon, 22 Dec 2008) | 4 lines

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

Lib/test/test_file.py
Misc/NEWS

index ff4996ae482785eb23b34e81ddaf7455302b7ba6..7a68b2f7203a1f7fd46983e44e70d2bb199df8e8 100644 (file)
@@ -123,6 +123,8 @@ class AutoFileTests(unittest.TestCase):
         except:
             self.assertEquals(self.f.__exit__(*sys.exc_info()), None)
 
+    def testReadWhenWriting(self):
+        self.assertRaises(IOError, self.f.read)
 
 class OtherFileTests(unittest.TestCase):
 
index 393b3fc89f80574c3d1567f650dd0353edcd58a2..21460a3f5fbf640edcd3c97ab5cf46ce9c161a3d 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,9 @@ What's New in Python 3.0.1?
 Core and Builtins
 -----------------
 
+- Added test case to ensure attempts to read from a file opened for writing
+  fail.
+
 - Issue #3106: Speedup some comparisons (str/str and int/int).
 
 - Issue #2173: When getting device encoding, check that return value of