From eeb114b028f7aef886e0b1b514d58aac9d26bc8c Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Tue, 22 Feb 2011 03:14:12 +0000 Subject: [PATCH] Issue #10512: close the log file in cgi when running tests. Thanks to Nadeem Vawda for the find and an initial fix. --- Lib/test/test_cgi.py | 1 + Misc/NEWS | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Lib/test/test_cgi.py b/Lib/test/test_cgi.py index 3b6f59b26e6..985de11d5ee 100644 --- a/Lib/test/test_cgi.py +++ b/Lib/test/test_cgi.py @@ -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): diff --git a/Misc/NEWS b/Misc/NEWS index bcfeb4a2cd6..25cad9ef3f7 100644 --- 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