[mod_python] Possible Bug in PythonHandlerModule directive

Graham Dumpleton graham.dumpleton at gmail.com
Wed Nov 28 04:51:14 EST 2007


What version of mod_python are you using? There were bugs in that
directive which were possibly only fixed in mod_python 3.3.

Graham

On 28/11/2007, Troy Wilson <wilsonta72 at gmail.com> wrote:
> Hi all,
>
> I can not seem to get the PythonHandlerModule directive to work. The
> following conf works:
> -------------------------------------------------------------
> <Directory /home/test/public_html>
>                 Options -Indexes -MultiViews
>                 <IfModule mod_python.c>
>                         SetHandler python-program
>                         PythonAuthenHandler handler
>                         PythonAuthzHandler handler
>                         PythonHandler handler
>                         PythonDebug On
>                         PythonInterpreter test
>                         PythonAutoReload On
>                         AuthType python-auth
>                         AuthName "Restricted"
>                         require valid-user
>                 </IfModule>
> </Directory>
> -----------------------------------------------
>
> While this setup produces a 401 error:
> ---------------------------------------------------
>  <Directory /home/test/public_html>
>                 Options -Indexes -MultiViews
>                 <IfModule mod_python.c>
>                         SetHandler python-program
>                         PythonHandlerModule handler
>                         PythonDebug On
>                         PythonInterpreter test
>                         PythonAutoReload On
>                         AuthType python-auth
>                         AuthName "Restricted"
>                         require valid-user
>                 </IfModule>
> </Directory>
> ------------------------------------------------
>
> The simplest form of the handler code:
> --------------------------------------------------
> from mod_python import apache
>
> def authenhandler(req):
>         req.user = "test"
>         return apache.OK
>
> def authzhandler(req):
>         return apache.OK
>
> def handler(req):
>         return apache.OK
>
> ---------------------------------------------------------
>
> My understanding was that the PythonHandlerModule directive would search
> inside the handler code for a function matching the phase. It does not seem
> to do this.Have I misinterpreted what this directive was meant to achieve?
>
> Cheers Troy
>
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
>
>


More information about the Mod_python mailing list