Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eeb114b

Browse files
committed
Issue #10512: close the log file in cgi when running tests.
Thanks to Nadeem Vawda for the find and an initial fix.
1 parent 7a54073 commit eeb114b

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

Lib/test/test_cgi.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ def test_log(self):
155155
cgi.logfp = None
156156
cgi.logfile = "/dev/null"
157157
cgi.initlog("%s", "Testing log 3")
158+
self.addCleanup(cgi.logfp.close)
158159
cgi.log("Testing log 4")
159160

160161
def test_fieldstorage_readline(self):

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ Build
5454
Tests
5555
-----
5656

57+
- Issue #10512: Properly close sockets under test.test_cgi.
58+
5759
- Issue #10992: Make tests pass under coverage.
5860

5961
- Issue #10826: Prevent sporadic failure in test_subprocess on Solaris due

0 commit comments

Comments
 (0)