
Hi, I had the same problem with mod_python, a while ago, it seems mod_python does some trickery with threads in its internals. The only solution I found is setting PythonInterpreter "myoneandonlyinterpreter" in the apache config of each virtual host while running prefork servers. I coudn't find any other solution beside hoping that the threading problem in lxml will go away, sometime. Hans Am Montag, den 03.12.2007, 16:17 +0300 schrieb Dmitri Fedoruk:
Hello,
Looks like I've got the same problem. Sometimes I get the same error message: 'stylesheet is not usable in this thread'. As far as I could understand, that's because of an attempt to use in one thread the xslt obejct initiated in another thread. Sounds reasonable.
Correct. As I said, a work-around would be to either create them on the fly or cache the XSLT objects in thread-local storage and reuse them from there.
Nice. My application works under the same scheme. I'm using mod_python and several apache processes started in prefork mode. In every apache process I'm using a global general object that contains xslt objects inside. When a request comes to the next apache process, my general object is initialized (if it has not been done yet) and then is used inside this thread and this process. I cannot see the reason why one instance of mod_python should conflict with another.
Nevertheless, I happen to get this error messages without any idea why. I can not see any dependency or rule yet. The only solution is to restart apache.
My software is the following: Apache/2.0.61 Python 2.5.1 mod_python-3.3.1 lxml-1.3.4 libxslt-1.1.20 freebsd 6.2-20070330-SNAP
Do you have any idea how can I fix this situation or at least how can I track the reasons? Maybe this is the question for some other mailing lists too?
Dmitri _______________________________________________ lxml-dev mailing list lxml-dev@codespeak.net http://codespeak.net/mailman/listinfo/lxml-dev --
Alterras GmbH, Allersbergerstr. 185-N, D-90461 Nürnberg http://www.alterras.de/, info@alterras.de Tel: (+49) 0911-480039-0 Handelsreg.: AG Nürnberg HRB 18488, Geschäftsführer: H.-J. Hay, H. Sivak