mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 10:26:02 +00:00 
			
		
		
		
	Merged revisions 76208 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r76208 | senthil.kumaran | 2009-11-11 07:04:44 +0530 (Wed, 11 Nov 2009) | 3 lines CGIHTTPRequestHandler.run_cgi() to use subprocess for Non Unix platforms. Fix based on Issue1235. ........
This commit is contained in:
		
							parent
							
								
									d42bc519d2
								
							
						
					
					
						commit
						e29cd162ed
					
				
					 1 changed files with 6 additions and 6 deletions
				
			
		|  | @ -1071,16 +1071,16 @@ class CGIHTTPRequestHandler(SimpleHTTPRequestHandler): | ||||||
|         else: |         else: | ||||||
|             # Non-Unix -- use subprocess |             # Non-Unix -- use subprocess | ||||||
|             import subprocess |             import subprocess | ||||||
|             cmdline = scriptfile |             cmdline = [scriptfile] | ||||||
|             if self.is_python(scriptfile): |             if self.is_python(scriptfile): | ||||||
|                 interp = sys.executable |                 interp = sys.executable | ||||||
|                 if interp.lower().endswith("w.exe"): |                 if interp.lower().endswith("w.exe"): | ||||||
|                     # On Windows, use python.exe, not pythonw.exe |                     # On Windows, use python.exe, not pythonw.exe | ||||||
|                     interp = interp[:-5] + interp[-4:] |                     interp = interp[:-5] + interp[-4:] | ||||||
|                 cmdline = "%s -u %s" % (interp, cmdline) |                 cmdline = [interp, '-u'] + cmdline | ||||||
|             if '=' not in query and '"' not in query: |             if '=' not in query: | ||||||
|                 cmdline = '%s "%s"' % (cmdline, query) |                 cmdline.append(query) | ||||||
|             self.log_message("command: %s", cmdline) |             self.log_message("command: %s", subprocess.list2cmdline(cmdline)) | ||||||
|             try: |             try: | ||||||
|                 nbytes = int(length) |                 nbytes = int(length) | ||||||
|             except (TypeError, ValueError): |             except (TypeError, ValueError): | ||||||
|  | @ -1088,7 +1088,7 @@ class CGIHTTPRequestHandler(SimpleHTTPRequestHandler): | ||||||
|             p = subprocess.Popen(cmdline, |             p = subprocess.Popen(cmdline, | ||||||
|                                  stdin=subprocess.PIPE, |                                  stdin=subprocess.PIPE, | ||||||
|                                  stdout=subprocess.PIPE, |                                  stdout=subprocess.PIPE, | ||||||
|                                  stderr=subprocess.PIPE, |                                  stderr=subprocess.PIPE | ||||||
|                                  ) |                                  ) | ||||||
|             if self.command.lower() == "post" and nbytes > 0: |             if self.command.lower() == "post" and nbytes > 0: | ||||||
|                 data = self.rfile.read(nbytes) |                 data = self.rfile.read(nbytes) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Senthil Kumaran
						Senthil Kumaran