[mod_python] is not a file?

Jon Mercer jon.mercer at achean.com
Tue Jan 25 04:55:35 EST 2005


Hi all,

Not sure this is the formal fix to manage this, I'm a bit of a newbie
here, but having had the same problem I've found the solution was as below
in the Apache config section.

As a further question in this thread, what is the proper way/best practice
to be mixing directories with different methods of calling mod_python? Can
the same directory handle the publisher as well as psp and custom
mechanisms?

Jon

On Tue, January 25, 2005 9:48, Lionel Roubeyrie said:
> Hi all,
> I don't understand why I have this error:
> ################################
> Mod_python error: "PythonHandler mod_python.psp"
> Traceback (most recent call last):
>   File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 299,
> in
> HandlerDispatch
>     result = object(req)
>   File "/usr/lib/python2.3/site-packages/mod_python/psp.py", line 296, in
> handler
>     p = PSP(req)
>   File "/usr/lib/python2.3/site-packages/mod_python/psp.py", line 111, in
> __init__
>     self.load_from_file()
>   File "/usr/lib/python2.3/site-packages/mod_python/psp.py", line 162, in
> load_from_file
>     raise ValueError, "%s is not a file" % filename
> ValueError:
> /home/lionel/Developpement/PREVAIR_LIMAIR/CARTAIR/mod_web/maxh1h.psp
> is not a file
> ################################
> The file is :
> ################################
> <%
> TITLE='CARTAIR'
> if form.has_key('date_calcul'):
>    tutu=form['date_calcul']
> else:
>    tutu=''
> # end
> %>
> <html>
> <head>
>         <title> <%=TITLE%> </title>
>         <link rel="STYLESHEET" type="text/css"
> href="static/miseenpage.css">
> </head>
> <body>
>     <%=tutu%>
>     <div align="center">
>         <form action='maxh1h.psp' method='POST'>
>             <table width=80%>
>                 <tr>
>                     <td>Date de calcul:    <input type='text'
> name='date_calcul' value=%s><br></td>
>                 </tr>
>                 <tr>
>                     <td>Date de Prévision:   <input type='text'
> name='date_prevu' value=%s><br></td>
>                 </tr>
>                 <tr>
>                     <td><input type='submit' value="Afficher"></td>
>                 </tr>
>             </table>
>         </form>
>     </div>
> </body>
> </html>
> ################################
> If I call this page from another psp page, it's ok, but not if I press the
> submit button or if I call direectly the page from the browser.
> In the Apache2 config:
> ################################
> <Directory /home/lionel/Developpement/PREVAIR_LIMAIR/CARTAIR/mod_web>
>         Order allow,deny
>         Allow from all
>         Options Indexes Includes FollowSymLinks MultiViews

The following line should read:
          SetHandler mod_python


>         AddHandler mod_python .psp
>         PythonHandler mod_python.psp
>         PythonDebug On
> </Directory>
> ################################
>
> What's wrong?
> --
> Lionel Roubeyrie - lroubeyrie at limair.asso.fr
> LIMAIR
> http://www.limair.asso.fr
>
>
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
>


-----------------------------------------------------------------------
Achean Ltd                                        http://www.achean.com
Jon Mercer              jon.mercer at achean.com                  Director
-----------------------------------------------------------------------


More information about the Mod_python mailing list