]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix #12811 by closing files promptly in tabnanny.check. Patch by Anthony Briggs.
authorNick Coghlan <ncoghlan@gmail.com>
Mon, 22 Aug 2011 06:19:19 +0000 (16:19 +1000)
committerNick Coghlan <ncoghlan@gmail.com>
Mon, 22 Aug 2011 06:19:19 +0000 (16:19 +1000)
Lib/tabnanny.py
Misc/ACKS
Misc/NEWS

index 46f8163e5f7e013151b095824ed049fe6e0c2058..4a54f89e82f41afa2725470341f4a36970433a39 100755 (executable)
@@ -126,6 +126,9 @@ def check(file):
             else: print(file, badline, repr(line))
         return
 
+    finally:
+        f.close()
+
     if verbose:
         print("%r: Clean bill of health." % (file,))
 
index 2b6104fe6564ac6fa55684e8442b406ce0925d65..062a77ae9af6cb2fe06c0aa5eed30a087e925a65 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -121,6 +121,7 @@ Erik Bray
 Brian Brazil
 Dave Brennan
 Tom Bridgman
+Anthony Briggs
 Tobias Brink
 Richard Brodie
 Michael Broghton
index ab70dfd8679ed949b95fc0db5bb74f379dfab320..eeb0d71572ef988f90adf90fcc796e7266c7732b 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -265,6 +265,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #12811: tabnanny.check() now promptly closes checked files. Patch by
+  Anthony Briggs.
+
 - Issue #6560: The sendmsg/recvmsg API is now exposed by the socket module
   when provided by the underlying platform, supporting processing of
   ancillary data in pure Python code.