Index: CGIHTTPServer.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/CGIHTTPServer.py,v retrieving revision 1.26 diff -c -r1.26 CGIHTTPServer.py *** CGIHTTPServer.py 1 Aug 2002 21:12:35 -0000 1.26 --- CGIHTTPServer.py 16 Aug 2002 02:11:37 -0000 *************** *** 26,31 **** --- 26,32 ---- import urllib import BaseHTTPServer import SimpleHTTPServer + import select class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): *************** *** 198,203 **** --- 199,207 ---- if pid != 0: # Parent pid, sts = os.waitpid(pid, 0) + # throw away additional data [see bug #427345] + while select.select([self.rfile], [], [], 0)[0]: + waste = self.rfile.read(1) if sts: self.log_error("CGI script exit status %#x", sts) return *************** *** 244,249 **** --- 248,256 ---- if self.command.lower() == "post" and nbytes > 0: data = self.rfile.read(nbytes) fi.write(data) + # throw away additional data [see bug #427345] + while select.select([self.rfile._sock], [], [], 0)[0]: + waste = self.rfile._sock.recv(1) fi.close() shutil.copyfileobj(fo, self.wfile) if self.have_popen3: