diff --git a/Lib/CGIHTTPServer.py b/Lib/CGIHTTPServer.py index ed373483d9d..13ca0b514bf 100644 --- a/Lib/CGIHTTPServer.py +++ b/Lib/CGIHTTPServer.py @@ -289,6 +289,8 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): self.wfile.write(stdout) if stderr: self.log_error('%s', stderr) + p.stderr.close() + p.stdout.close() status = p.returncode if status: self.log_error("CGI script exit status %#x", status)