CGI module does not parse data

amfr amfr.org at gmail.com
Fri Dec 2 15:18:28 EST 2005


I am using execfile, setting stdin and stdout like this:
sys.stdin = self.wfile
sys.stdout = self.rfile
execfile(filename)

Its the same code used in the CGIHTTPServer module.  I know that the
python is executing corretly, a script with this content would work:

print "<html>"
print "<head>"
print "<title>"
print "blah"
print "</title>"
print "</head>
print "<body>"
print "test"
print "</body>"
print "</html>"

but this would not (lets say i submitted a form with the value of test
being "hello world"):

import cgi
form = cgi.FieldStorage()
print form["test"]
print "test"

I would only be able to see "test", not "hello world"
I am sure its not my browser




More information about the Python-list mailing list