CGIHTTPServer and Win2k
sholden at holdenweb.com
Fri Nov 16 16:57:19 CET 2001
[cc'd to python-docs at python.org]
"Sandy Norton" <sandskyfly at hotmail.com> wrote ...
> > Exit status 0x2 is "file not found".
> > You have a permissions problem. On Windows 2000, the user profile
> > directories in "Documents and Settings" are readable only by the owner.
> > You should either place these in "Documents and Settings\All Users", or
> > some other public directory.
> I don't think that will solve the problem: here's a cut-and-paste from
> python 2.2 module reference:
> "11.17 CGIHTTPServer -- CGI-capable HTTP request handler
> Availability: Unix.
> The CGIHTTPServer module defines a request-handler class, interface
> compatible with BaseHTTPServer.BaseHTTPRequestHandler and inherits
> behavior from SimpleHTTPServer.SimpleHTTPRequestHandler but can also
> run CGI scripts.
> Note: This module is Unix dependent since it creates the CGI process
> using os.fork() and os.exec()."
I suspect this is a documentation bug, because since 2.0 (?) the code uses
fork() if it can, popen2() otherwise; if neither of these are available it
will run imported Python scripts as CGIs. Here's a quote from the docstring
at the head of the 2.0 module:
"""If the os.fork() function is not present (e.g. on Windows), os.popen2()
is used as a fallback, with slightly altered semantics; if that function is
not present either (e.g. on Macintosh), only Python scripts are supported,
and they are executed by the current process."""
More information about the Python-list