13 Sep 17:15
lxml + mod_python: cannot unmarshal code objects in restricted execution mode
From: Dmitri Fedoruk <dfedoruk <at> gmail.com>
Subject: lxml + mod_python: cannot unmarshal code objects in restricted execution mode
Newsgroups: gmane.comp.python.lxml.devel
Date: 2007-09-13 15:18:21 GMT
Subject: lxml + mod_python: cannot unmarshal code objects in restricted execution mode
Newsgroups: gmane.comp.python.lxml.devel
Date: 2007-09-13 15:18:21 GMT
Hello everyone,
I'm developing a mod_python application that is based on XML\XSLT
transforming.
I used 4Suite libraries for that, but as the speed was unacceptable
for me, I switched to lxml. Everything became much easier and 10 times
faster, but I've encountered the subject problem.
In brief - all my data and xslt are stored and transferred in UTF-8.
With 4Suite everything was fine all the time. With lxml it works fine
from the console, but inside mod_python it occasionaly dies, ~ one
time out of three. Strange - the same code with the same data works or
dies by its own means.
As far as I have found, there was a similar problem with PyXML and
encodings module, this is the problem with UTF, but there was no clear
solution.
So, my configuration is the following:
Python 2.5.1
Server version: Apache/2.2.4 (FreeBSD)
mod_python-3.3.1
And the relevant parts of my code are these:
def extApplyXslt(xslt, data, logger ):
try:
strXslt = urllib2.urlopen(xslt).read()
# i have to read the xslt url to the python string
(Continue reading)
RSS Feed