CGIHTTPServer and Win2k

Andrew Post apost at cbmi.upmc.edu
Wed Nov 14 21:00:33 EST 2001


Hello,

I'm the T/A for a programming class at the University of Pittsburgh, and
we're using Python. We're trying to get the students to use CGIHTTPServer
that's packaged with Python 2.1, but many of our students running Windows
2000 can't get the server to run CGI scripts. I'm having the same problem,
unfortunately. The code we gave them to run the server follows:

from BaseHTTPServer import HTTPServer
from CGIHTTPServer import CGIHTTPRequestHandler
import os

print "Starting Python Web Server..."
port = 80
os.chdir('C:/Documents and Settings/apost/Desktop/Python Web Server')
servr = HTTPServer(('', port), CGIHTTPRequestHandler)
servr.serve_forever()

The server output follows:

APOST2 - - [14/Nov/2001 20:55:42] "GET /ccl.html HTTP/1.1" 200 -
APOST2 - - [14/Nov/2001 20:55:49] "GET
/cgi-bin/creat_calc.py?age=70&weight=70&s
Cr=1.7 HTTP/1.1" 200 -
APOST2 - - [14/Nov/2001 20:55:49] command: C:\Python21\python.exe
C:\Documents a
nd Settings\apost\Desktop\Python Web Server\cgi-bin\creat_calc.py
APOST2 - - [14/Nov/2001 20:55:49] CGI script exit status 0x2

IE 5.5 returns a blank page. Netscape 4.7 reports "The document contained no
data".

The code we gave them runs perfectly on WinNT. Some students are also
getting a CGI script exit status 0x1, but I haven't been able to reproduce
that one. Changing the form to use POST instead of GET generates the same
error.

Thanks in advance for your help,

Andrew





More information about the Python-list mailing list