Updated cherrypy to 3.2.2

This commit is contained in:
rembo10
2012-07-28 23:56:28 +05:30
parent 2141ab45b7
commit d2ae29d2d6
84 changed files with 5359 additions and 13075 deletions
+13 -2
View File
@@ -224,7 +224,7 @@ def handler(req):
qs = ir.query_string
rfile = BytesIO()
send_response(req, response.status, response.header_list,
send_response(req, response.output_status, response.header_list,
response.body, response.stream)
finally:
app.release_serving()
@@ -266,11 +266,22 @@ def send_response(req, status, headers, body, stream=False):
import os
import re
try:
import subprocess
def popen(fullcmd):
p = subprocess.Popen(fullcmd, shell=True,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
close_fds=True)
return p.stdout
except ImportError:
def popen(fullcmd):
pipein, pipeout = os.popen4(fullcmd)
return pipeout
def read_process(cmd, args=""):
fullcmd = "%s %s" % (cmd, args)
pipein, pipeout = os.popen4(fullcmd)
pipeout = popen(fullcmd)
try:
firstline = pipeout.readline()
if (re.search(ntob("(not recognized|No such file|not found)"), firstline,