You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-dev@quetz.apache.org by Josh Hoyt <jo...@janrain.com> on 2003/01/18 00:44:09 UTC

mod_python and Python 2.3

Hello,

I'm trying to get mod_python working with python 2.3, and I've run into
some problems related to module importing. For some reason, it fails to
import the site module. The same setup works with Python 2.2, so I'm
pretty sure that it has something to do with the Python version and not
the configuration. Running with Python in verbose mode, the following
shows up in the apache error log file:

[...]
# trying /home/josh/scratch/python/lib/python2.3/site.py
# /home/josh/scratch/python/lib/python2.3/site.pyc matches /home/josh/scratch/python/lib/python2.3/site.py
import site # precompiled from /home/josh/scratch/python/lib/python2.3/site.pyc
[...]
'import site' failed; traceback:
ImportError: No module named site
[...]

I've attached the full error log in case there are any details there 
that I failed to make clear in the excerpts above.

This problem appears with:
Python 2.3a1, Apache 1.3.20, mod_python 2.7.6 or 2.7.8
Python 2.3a1, Apache 2.0.43, mod_python 3.0.1

It goes away with Python 2.2.2.

Any ideas about where to go from here?

Thanks,
Josh Hoyt
<jo...@janrain.com>

Re: [mod_python] mod_python and Python 2.3

Posted by Josh Hoyt <jo...@janrain.com>.
> This is a Python bug in Py_NewInterpreter() (or in some other place that
> makes Py_NewInterpreter() fail). I sumbitted it to the Python developers
> but I got no reply yet. The bug is described here:
> 
> http://sourceforge.net/tracker/index.php?func=detail&aid=668708&group_id=5470&atid=105470

The problem appears to be that meta_path is not being
initialized in the new interpreter. Adding
_PyImportHooks_Init to Py_NewInterpreter seems to fix the
problem, initializing the new import hooks before trying to
import modules into the new interpreter.

Patch 671459 contains this fix.

Yeah for mod_python in Python 2.3!

Josh

Re: [mod_python] mod_python and Python 2.3

Posted by Geert Jansen <ge...@boskant.nl>.
On Fri, Jan 17, 2003 at 03:44:09PM -0800, Josh Hoyt wrote:
> Hello,
> 
> I'm trying to get mod_python working with python 2.3, and I've run into
> some problems related to module importing. For some reason, it fails to
> import the site module. The same setup works with Python 2.2, so I'm
> pretty sure that it has something to do with the Python version and not
> the configuration. Running with Python in verbose mode, the following
> shows up in the apache error log file:

This is a Python bug in Py_NewInterpreter() (or in some other place that
makes Py_NewInterpreter() fail). I sumbitted it to the Python developers
but I got no reply yet. The bug is described here:

http://sourceforge.net/tracker/index.php?func=detail&aid=668708&group_id=5470&atid=105470

Greetings,
Geert