[mod_python] Strange behaviour using PythonHandler module::ClassName.method

Simen Brekken simen at lunarlounge.org
Mon May 26 01:52:17 EST 2003


Running Apache 2.0 on Windows XP

I'm having some wierd behaviour with the PythonHandler module::ClassName.method directive:

.htaccess:
-----------
AddHandler python-program .py
PythonFixupHandler pso.modpython::fixup
PythonLogHandler pso.modpython::cleanup

PythonHandler test::TestHandler.handle

test.py:
-----------
class TestHandler:
 def __init__(self, req):
  pass

 def handle(self, req):
  req.pso().send_http_header()

  print "Hello world from TestHandler3!"
  return OK

def handler(self, req):
 pass


Now for the wierd part, if I try the url http://localhost/test.py everything works as planned, prints out everything, but if I comment out the "handler" function of the module i get a 404 error. What eludes me is why it is required since it's not referenced anywhere? The pso fixups only add sessions and a reference to that session object on the request so it shouldn't interfere.

Also I'm searching for a way to make mod_python reload *everything* for each request, I find myself having to restart the webserver even after making changes.

And lastly, the error handling/reporting seems very flawed, even if a handler method is required in the actual method, I get no messages in the error log about it.

___
SIMEN BREKKEN / born to synthesize.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.modpython.org/pipermail/mod_python/attachments/20030526/6443b8ed/attachment-0003.htm


More information about the Mod_python mailing list