[Python-checkins] cpython (2.7): properly explicitly close file (#21128)

benjamin.peterson python-checkins at python.org
Fri Apr 4 20:00:08 CEST 2014


http://hg.python.org/cpython/rev/6f1ac58207cc
changeset:   90143:6f1ac58207cc
branch:      2.7
user:        Benjamin Peterson <benjamin at python.org>
date:        Fri Apr 04 13:56:26 2014 -0400
summary:
  properly explicitly close file (#21128)

files:
  Lib/test/test_file.py |  1 +
  1 files changed, 1 insertions(+), 0 deletions(-)


diff --git a/Lib/test/test_file.py b/Lib/test/test_file.py
--- a/Lib/test/test_file.py
+++ b/Lib/test/test_file.py
@@ -300,6 +300,7 @@
                 self.fail("readlines() after next() with empty buffer "
                           "failed. Got %r, expected %r" % (line, testline))
             # Reading after iteration hit EOF shouldn't hurt either
+            f.close()
             f = self.open(TESTFN, 'rb')
             try:
                 for line in f:

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list