diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2008-12-23 13:10:43 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2008-12-23 13:10:43 (GMT) |
commit | 3c08e45b70ddce2d702d3bcb67612682bf551845 (patch) | |
tree | fdd567a22d1fbee853fdbb97e65f3ae8f19be97c /Lib | |
parent | edf14317e32ae945d9b1fe554a7be6ed3dde2834 (diff) | |
download | cpython-3c08e45b70ddce2d702d3bcb67612682bf551845.zip cpython-3c08e45b70ddce2d702d3bcb67612682bf551845.tar.gz cpython-3c08e45b70ddce2d702d3bcb67612682bf551845.tar.bz2 |
Revert patch for #1706039, as it can crash the interpreter.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_file.py | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/Lib/test/test_file.py b/Lib/test/test_file.py index f678df6..fbf85e3 100644 --- a/Lib/test/test_file.py +++ b/Lib/test/test_file.py @@ -357,48 +357,6 @@ class StdoutTests(unittest.TestCase): finally: sys.stdout = save_stdout - def testReadAfterEOF(self): - # Regression test for SF bug #1523853. - # Verify read works after hitting EOF - - # Prepare the testfile - teststring = "spam" - bag = open(TESTFN, "w") - bag.write(teststring) - bag.close() - - # And buf for readinto - buf = array("c", " "*len(teststring)) - - # Test for appropriate errors mixing read* and iteration - methods = [("readline", ()), ("read",()), ("readlines", ()), - ("readinto", (buf,))] - - for attr in 'r', 'rU': - for methodname, args in methods: - f = open(TESTFN, "rU") - f.seek(0, 2) - meth = getattr(f, methodname) - meth(*args) # hits EOF - try: - # Writing the same file with another file descriptor - append = open(TESTFN, "a+") - append.write(teststring) - append.flush() - append.close() - try: - meth = getattr(f, methodname) - if methodname == 'readlines': - self.failUnlessEqual(meth(*args), [teststring]) - elif methodname == 'readinto': - meth(*args) - self.failUnlessEqual(buf.tostring(), teststring) - else: - self.failUnlessEqual(meth(*args), teststring) - except ValueError: - self.fail("read* failed after hitting EOF") - finally: - f.close() def test_main(): # Historically, these tests have been sloppy about removing TESTFN. |