[mod_python] mod_python error with Fedora Core 1

Adrian Holovaty modpython at holovaty.com
Thu Nov 13 14:41:52 EST 2003


I've installed Fedora Core 1 on my laptop, along with its standard RPMs of 
Apache 2 (httpd-2.0.47-10.rpm) and mod_python (mod_python-3.0.3-3.rpm). The 
mod_python package appears to be buggy.

Here's the httpd.conf code I'm using:

PythonPath "sys.path+['/home/adrian/doc/work/dev/modpython']"
<Location "/modpython">
    PythonDebug On
    SetHandler python-program
    PythonHandler testhandler
</Location>

Here's the handler (/home/adrian/doc/work/dev/modpython/testhandler.py):

from mod_python import apache
def handler(req):
    req.content_type = "text/html"
    req.write("Testing")
    return apache.OK

And here's the error output I see in my browser:

"""
Mod_python error: "PythonHandler testhandler"

Traceback (most recent call last):

  File 
"/usr/src/build/276253-i386/install/usr/lib/python2.2/site-packages/mod_python/apache.py", 
line 320, in HandlerDispatch

  File 
"/usr/src/build/276253-i386/install/usr/lib/python2.2/site-packages/mod_python/apache.py", 
line 496, in import_module

ImportError: No module named testhandler
"""

There are a few things wrong here. First, it should work -- i.e., the output 
should be "Testing". Second, the directory /usr/src/build doesn't exist on my 
machine, so that error message is quite perplexing.

The above httpd.conf settings and handler code worked perfectly with Red Hat 
9; I assume the bug is in the Fedora packaging. Any idea whether I can get it 
to work somehow? Has anybody had luck running mod_python on Fedora Core 1?

Thanks!

Adrian



More information about the Mod_python mailing list