[mod_python] htmltmpl pickle error with mod_python

Graham Dumpleton graham.dumpleton at gmail.com
Mon Nov 3 17:07:06 EST 2008


2008/11/3 Adam <adam at fastmail.com.au>:
> Hello,
> I'm trying to use htmltmpl under modpython and I'm having some issues. When
> I try and visit my cgi page I receive the error:
>
> TemplateError: Htmltmpl error: Pickling error while saving precompiled
> template '/var/www/localhost/BDNS/content/./templates/summary.tmplc': Can't
> pickle _mp_9c83a5362036140a49a9284aab391a5d.Template: import of module
> _mp_9c83a5362036140a49a9284aab391a5d failed
>
> When I run the scripts as CGI it has no troubles with the templates, so I'm
> not sure why the problem only happens under mod_python

Read:

  http://www.dscpl.com.au/wiki/ModPython/Articles/IssuesWithSessionObjects

Move the definitions of the classes etc that you are trying to pickle
to a separate file located on your sys.path somewhere. It must be
locatable by standard Python module import mechanisms and cannot be
loaded directly or indirectly via mod_python module importer.

Graham


More information about the Mod_python mailing list