using lxml with mod_wsgi in apache
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxml |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
I am using LXML in a web app running under apache.
I am using it for a xsl transformation which has custom functions in it:
ns = etree.FunctionN
ns[
when I want to use IO for writing or the PIL module in the convertBin() function I get an error.
This one only goes away, if I switch WSGIApplication
The wsgi documentation says:
Any WSGI applications in the global application group will always be executed within the context of the first interpreter created by Python when it is initialised. Forcing a WSGI application to run within the first interpreter can be necessary when a third party C extension module for Python has used the simplified threading API for manipulation of the Python GIL and thus will not run correctly within any additional sub interpreters created by Python.
http://
Thanks for the report.
You didn't say what kind of error you got, but since you already quoted the relevant section of the docs, it's probably a crash.
Subinterpreters are barely supported by any extension modules in CPython, and not at all (currently) by Cython. Probably doable in general, but then, libxml2/libxslt also have some corners where they require global state (as opposed to per-thread or per-subinterpreter state).
In short: difficult, and won't happen any time soon.