configuring mxCGIPython

M.-A. Lemburg mal at lemburg.com
Fri Apr 26 04:07:25 EDT 2002


Mark McEahern wrote:
> 
> [Marc-Andre Lemburg]
> > Because Python always does on startup if not run with the
> > -S switch (this is not available in cgipython though).
> > Could you send the output of running cgipython
> > with the environment variable PYTHONVERBOSE defined to 1 ?
> 
> I've appended the output below.  It looks like it's stuck here:
> 
> # site.py
> 95: if os.name == "posix" and os.path.basename(sys.path[-1]) == "Modules":
> 
> evaluating sys.path.  Hmm?  It'll take me a while to figure out what's going
> on here.

Hmm, interesting. Looks like sys.path is empty at this point.
I wonder whether this is a bug in the frozen cgipython built
or just a consequence of freezing the interpreter.

Could you try setting PYTHONPATH to the dir where cgipython
lives ?

Since the stuff currently done in site.py doesn't really
make all that much sense here, I think cgipython should
probably use an empty site.py file instead of the standard
one (should enhance startup times even more).
 
> > A simple work-around would be adding the site.py from the
> > standard Python lib -- this should really be included in
> > cgipython, though, and I think it is, so there must
> > be something in site.py which fails.
> 
> If I put a site.py in the same path as cgipython, will that prevent it from
> reading its built-in one?  I need to experiment with that.

Good question. It probably doesn't even start looking for
it since it's already preregistered in the built-in 
modules.

-- 
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
______________________________________________________________________
Company & Consulting:                           http://www.egenix.com/
Python Software:                   http://www.egenix.com/files/python/





More information about the Python-list mailing list