Windows ME, CGIHTTPServer and pain...

Sloth mt_horeb at yahoo.com
Sun May 27 08:43:45 EDT 2001


I'm slowly but surely creating a quick-and-dirty app that is intended
to reside locally on a laptop and will use (I hope) the built in
*HTTPServer modules to allow a local user to access some data via
their Web browser.  I tried the following code on a WinNT workstation
to create the server:

     from CGIHTTPServer import CGIHTTPRequestHandler
     import BaseHTTPServer, threading

     httpd = BaseHTTPServer.HTTPServer(("", 8001),
CGIHTTPRequestHandler)
     print "Serving at port 8001"
     httpd.serve_forever()

It works great on WinNT - I can serve up HTML and access CGIs (*.py)
located in a '/cgi-bin' directory below the working directory.

So here is the problem...  While trying the code out on a WinME laptop
(which is where the final app will reside), I'm getting a strange
error while trying to execute a CGI script.  The above code will allow
HTML to be served, but if I click on a link to a *.py CGI script in
cgi-bin, Windows gives me a "beep," the console shows that it is
trying to execute c:\python20\python.exe on c:\pycgi\cgi-bin\test.py,
and then the whole thing hangs...  The browser shows that it is trying
to find the site, but nothing happens (I've waited as long as 30
minutes).  What's even more annoying is that Windows (technically,
Windows Explorer) will inevitably die as a result.

Anyone have any experience with this or any tips to share?  I want to
use the built in modules (*HTTPServer), and not Apache/mod_python at
this time.  Installing/tweaking Apache would be overkill for this app.

Thanks!!!  

Jeremy.



More information about the Python-list mailing list