Webform python cgi issue

Joshua Macy l0819m0v0smfm001 at sneakemail.com
Sun Oct 7 10:39:24 EDT 2001


tefol wrote:

> This works great, proved when I exit the script like this:
> 
> data = FeedbackData(form)
> 
> print "Content-type: text/html\n\n"
> print "<h3><center>You did it!</center></H3>"
> print data
> sys.exit()
> 
> I get exactly what I want displayed in my browser.  Only thing is when I 
> try:
> 
> output = open('/home/nemir/output/output.txt', 'w')
> output.write(data)
> output.close()
> 
> 
> I get this in my apache error log:
> 
> malformed header from script. Bad header=  File "/home/nemir/public_htm: 
> /home/nemir/public_html/cgi-bin/inputform.py



   You don't say, but when you are saving the data using the second 
approach, do you still bother to print the "Content-type: text/html\n\n" 
stuff to stdout?  If you aren't, that might be what the webserver is 
complaining about.

   Joshua




More information about the Python-list mailing list