]> granicus.if.org Git - python/commitdiff
Issue #10512: close the log file in cgi when running tests.
authorBrett Cannon <bcannon@gmail.com>
Tue, 22 Feb 2011 03:14:12 +0000 (03:14 +0000)
committerBrett Cannon <bcannon@gmail.com>
Tue, 22 Feb 2011 03:14:12 +0000 (03:14 +0000)
Thanks to Nadeem Vawda for the find and an initial fix.

Lib/test/test_cgi.py
Misc/NEWS

index 3b6f59b26e65bf759dd11e7e0f12f761748046e8..985de11d5ee1956d9006d078c68ad95766ce1587 100644 (file)
@@ -155,6 +155,7 @@ class CgiTests(unittest.TestCase):
             cgi.logfp = None
             cgi.logfile = "/dev/null"
             cgi.initlog("%s", "Testing log 3")
+            self.addCleanup(cgi.logfp.close)
             cgi.log("Testing log 4")
 
     def test_fieldstorage_readline(self):
index bcfeb4a2cd6121de04a53ddbbfeaa0e833fc8390..25cad9ef3f72a70e5b47a5298c0f39eb8fcf69be 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -54,6 +54,8 @@ Build
 Tests
 -----
 
+- Issue #10512: Properly close sockets under test.test_cgi.
+
 - Issue #10992: Make tests pass under coverage.
 
 - Issue #10826: Prevent sporadic failure in test_subprocess on Solaris due