From: Nick Coghlan Date: Mon, 22 Aug 2011 06:19:19 +0000 (+1000) Subject: Fix #12811 by closing files promptly in tabnanny.check. Patch by Anthony Briggs. X-Git-Tag: v3.3.0a1~1642 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c4a287114e2377772643e354fff5c388899cabff;p=thirdparty%2FPython%2Fcpython.git Fix #12811 by closing files promptly in tabnanny.check. Patch by Anthony Briggs. --- diff --git a/Lib/tabnanny.py b/Lib/tabnanny.py index 46f8163e5f7e..4a54f89e82f4 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 2b6104fe6564..062a77ae9af6 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 ab70dfd8679e..eeb0d71572ef 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.