summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2011-08-22 06:19:19 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2011-08-22 06:19:19 (GMT)
commitc4a287114e2377772643e354fff5c388899cabff (patch)
tree86998b09aec41e2634825d47f72d61e78e11f491
parent029ba2b8cd31728fb58dd082c44827a0703bff4a (diff)
downloadcpython-c4a287114e2377772643e354fff5c388899cabff.zip
cpython-c4a287114e2377772643e354fff5c388899cabff.tar.gz
cpython-c4a287114e2377772643e354fff5c388899cabff.tar.bz2
Fix #12811 by closing files promptly in tabnanny.check. Patch by Anthony Briggs.
-rwxr-xr-xLib/tabnanny.py3
-rw-r--r--Misc/ACKS1
-rw-r--r--Misc/NEWS3
3 files changed, 7 insertions, 0 deletions
diff --git a/Lib/tabnanny.py b/Lib/tabnanny.py
index 46f8163..4a54f89 100755
--- a/Lib/tabnanny.py
+++ b/Lib/tabnanny.py
@@ -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,))
diff --git a/Misc/ACKS b/Misc/ACKS
index 2b6104f..062a77a 100644
--- 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
diff --git a/Misc/NEWS b/Misc/NEWS
index ab70dfd..eeb0d71 100644
--- 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.