configuring mxCGIPython

Mark McEahern marklists at mceahern.com
Thu Apr 25 18:38:20 EDT 2002


[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.

> 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.

Thanks for your help!

// mark

<pythonverbose=1 output>

cgipython exists
import site # frozen
import os # frozen
import posix # builtin
import posixpath # frozen
import stat # frozen
import UserDict # frozen
'import site' failed; traceback:
Traceback (most recent call last):
  File "/usr/local/src/Python/Python-2.2/Lib/site.py", line 95, in ?
IndexError: list index out of range
Python 2.2 (#1, Feb 19 2002, 17:44:05)
[GCC 2.95.2 20000220 (Debian GNU/Linux)]
Copyright (c) 2001 Python Software Foundation.
All Rights Reserved.

Copyright (c) 2000 BeOpen.com.
All Rights Reserved.

Copyright (c) 1995-2001 Corporation for National Research Initiatives.
All Rights Reserved.

Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.
All Rights Reserved.
import __main__ # frozen
Traceback (most recent call last):
  File "../../CGIPython/cgipython.py", line 27, in ?
IOError: [Errno 2] No such file or directory
# clear __builtin__._
# clear sys.path
# clear sys.argv
# clear sys.ps1
# clear sys.ps2
# clear sys.exitfunc
# clear sys.exc_type
# clear sys.exc_value
# clear sys.exc_traceback
# clear sys.last_type
# clear sys.last_value
# clear sys.last_traceback
# restore sys.stdin
# restore sys.stdout
# restore sys.stderr
# cleanup __main__
# cleanup[1] signal
# cleanup[1] site
# cleanup[1] posix
# cleanup[1] exceptions
# cleanup[2] stat
# cleanup[2] posixpath
# cleanup[2] UserDict
# cleanup[2] os
# cleanup[2] os.path
# cleanup sys
# cleanup __builtin__
# cleanup ints: 3 unfreed ints in 1 out of 3 blocks
# cleanup floats






More information about the Python-list mailing list