cgi

Chris Gonnerman chris.gonnerman at usa.net
Sat Jan 27 10:11:15 EST 2001


----- Original Message -----
From: "Mohamed Najmeddine" <mnajmeddine at geo.census.gov>
> I have configured the IIS to run a simple cgi script named hello.cgi and
put
> the script on the dir c:/inetpub/wwwroot/cgi-bin/. The script is as
follows:
>
> print "Content-Type: text/html\n\n"
> print "Hello Python"
>
> and I got the following error message:
>
> CGI Error
> The specified CGI application misbehaved by not returning a complete set
of
> HTTP headers. The headers it did return are:
>
> syntax error at c:\inetpub\wwwroot\cgi-bin\hello.cgi line 4, near "print"
> Execution of c:\inetpub\wwwroot\cgi-bin\hello.cgi aborted due to
compilation
> errors.

Try to run the script directly from Python like so:

    python hello.cgi

You have a syntax error in the script.  I can't see an error in the sample
you posted, but there must be one there.

Also, regarding the registry setup for Python, using the -u (unbuffered)
option is sometimes necessary:

    "C:\python\python.exe -u %s %s"






More information about the Python-list mailing list