[Python-checkins] CVS: python/dist/src/Lib CGIHTTPServer.py,1.17,1.18

Guido van Rossum gvanrossum@users.sourceforge.net
Tue, 07 Aug 2001 12:55:12 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv16654

Modified Files:
	CGIHTTPServer.py 
Log Message:
Apply two small changes to the Windows code, according to SF bug
#427345.  These are supposed to support binary data and avoid
buffering problems on Windows.


Index: CGIHTTPServer.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/CGIHTTPServer.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** CGIHTTPServer.py	2001/02/09 12:10:26	1.17
--- CGIHTTPServer.py	2001/08/07 19:55:10	1.18
***************
*** 224,228 ****
                      # On Windows, use python.exe, not python.exe
                      interp = interp[:-5] = interp[-4:]
!                 cmdline = "%s %s" % (interp, cmdline)
              if '=' not in query and '"' not in query:
                  cmdline = '%s "%s"' % (cmdline, query)
--- 224,228 ----
                      # On Windows, use python.exe, not python.exe
                      interp = interp[:-5] = interp[-4:]
!                 cmdline = "%s -u %s" % (interp, cmdline)
              if '=' not in query and '"' not in query:
                  cmdline = '%s "%s"' % (cmdline, query)
***************
*** 232,236 ****
              except:
                  nbytes = 0
!             fi, fo = os.popen2(cmdline)
              if self.command.lower() == "post" and nbytes > 0:
                  data = self.rfile.read(nbytes)
--- 232,236 ----
              except:
                  nbytes = 0
!             fi, fo = os.popen2(cmdline, 'b')
              if self.command.lower() == "post" and nbytes > 0:
                  data = self.rfile.read(nbytes)