[mod_python] psp include directive

Jim Gallacher jpg at jgassociates.ca
Tue May 23 16:00:41 EDT 2006


David Bear wrote:
> I am using publisher to dispatch different psp pages.
> 
> When I use the include directive in the psp page I get an quoting
> error -- 
> 
> here is a snippet of the psp code that throws the error:
> =============
>         <td width="30%">
>     <div id="contactBlock"><%@ include file='contact_body.html' > </div>
>     <div id="useabilityNotes"><%@ include file='useabilityNotes.html' > </div>
>         </td>
> ===================
> 
> the error traceback is 
> ===================
> Mod_python error: "PythonHandler mod_python.publisher"
> 
> Traceback (most recent call last):
> 
>   File "/usr/lib64/python2.4/site-packages/mod_python/apache.py", line
> 299, in HandlerDispatch
>     result = object(req)
> 
>   File "/usr/lib64/python2.4/site-packages/mod_python/publisher.py",
> line 136, in handler
>     result = util.apply_fs_data(object, req.form, req=req)
> 
>   File "/usr/lib64/python2.4/site-packages/mod_python/util.py", line
> 361, in apply_fs_data
>     return object(**args)
> 
>   File "/work/servers/www/htdocs/apep/index.py", line 80, in index
>     return _any_page(req, MAINTEMPLATE )
> 
>   File "/work/servers/www/htdocs/apep/index.py", line 107, in
> _any_page
>     return psp.PSP(req, main_template, vars=vars)
> 
>   File "/usr/lib64/python2.4/site-packages/mod_python/psp.py", line
> 111, in __init__
>     self.load_from_file()
> 
>   File "/usr/lib64/python2.4/site-packages/mod_python/psp.py", line
> 177, in load_from_file
>     code = compile(source, filename, "exec")
> 
>   File "/work/servers/www/htdocs/apep/templates/main_template.html",
> line 27
> 
>     req.write("""
>    
>    ^ SyntaxError: EOF while scanning triple-quoted string 
> 
> =======================
> I'm about to kill this --- are single quotes in directives not
> allowed?

It would appear not, according to a quick test I just ran on my system - 
but it didn't throw an exception either. Double quotes would seem to be 
the order of the day. Sorry, no time to dig into the psp parser code 
right now.

Jim



More information about the Mod_python mailing list