mod_python 2.7.10 - publisher

C

charlie knudsen

I am setting up mod_python 2.7.10 on Apache 1.3.33 as a dso and was
wondering if there is a default function that is called when the publisher
handler is not given a function. I have read through some documentation
and it looks like mod_python 3.x defaults to the index function, but that
does not appear to work for 2.7. Also I am using python 2.3.4.

I have the following file as index.py in the test directory of my web root:

from mod_python import apache

def index(req):
return "hello world"

Currently I get the following behavior:

http://localhost/test/index.py - 404 error
http://localhost/test/index.py/index - my "hello world" output
http://localhost/test/index.py/ - I get :
----------------------
Mod_python error: "PythonHandler mod_python.publisher"

Traceback (most recent call last):

File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 193, in
Dispatch
result = object(req)

File "/usr/lib/python2.3/site-packages/mod_python/publisher.py", line 88,
in handler
if func_path[-1] == ".":

IndexError: string index out of range
----------------------

I was wondering if there was a default function in mod_python 2.7.10.

If not, is there any reasons why I should not add one? Other than the fact
that the current implementation is well tested.

Thank you,

Charlie
 
C

charliek

I was wondering if there was a default function in mod_python 2.7.10.

If not, is there any reasons why I should not add one? Other than the
fact that the current implementation is well tested.

I looked at the source code for the publisher handler and it looks like the
2.7.x version of mod_python does not default to anything. I just added a
couple of lines to make it default to the index function.

Got to love open source!

Thanks,

Charlie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top