Damian Powązka, 26.12.2011 18:36:
W dniu 21 grudnia 2011 18:51 użytkownik Stefan Behnel napisał:
Damian Powązka, 21.12.2011 18:11:
I don't share objects across threads. Problem occurs when trying to use
etree.XMLSchema or etree.XMLParser with schema provided the error that I
sometime see is:
File "xmlschema.pxi", line 105, in lxml.etree.XMLSchema.__init__
(src/lxml/lxml.etree.c:132605)
lxml.etree.XMLSchemaParseError: Operation in progress
That's completely unrelated to the FAQ entry you referenced then.
I pasted your error message into a search engine and it turned up a couple
of references that hint at HTTP access, or at least an I/O error (that's
where the error message comes from: errno == EINPROGRESS). Just a stab in
the dark: maybe your XML catalogues are not properly set up? Apart from
that, I have no idea what kind of I/O you do, so I can't comment on it.
I have found a temporary work around for the problem:
https://techknowhow.library.emory.edu/blogs/branker/2010/07/30/django-lxml-w...
For which of the problems you described is that?
but in long term limitation to only one WSGI is bit problematic. Any
chance that this issue could be fixed?
Potentially, yes. It may or may not get fixed by a change I've been working
on for a while, which would basically introduce a per-document lock around
tree modifications, thus making it safe to read and modify trees
concurrently in different threads. However, I don't know when (or if)
that'll get finished.
It would certainly help if you could come up with a short code snippet that
shows the problem (and that doesn't depend on mod_wsgi).
Stefan
Hi,
Same problematic code run without mod_wsgi executes without issue.
From what I learned the problem occurs when making an instance of
etree.XMLSchema
on the xsd that contains xsd:import. I have tried using resolvers but
it wasn't called
when running on mod_wsgi, so the problem must be somewhere before Resolvers are
used.
I may try to simulate way how python instance is created by mod_wsgi.
For now I could provide you a VirtualBox machine that has everything setup, so
I could see the issue for yourself.
I am not sure that is has to do something with threading or locking as
the problem
occurs always - I am not able to make a single successful http call.
WSGIApplicationGroup %{GLOBAL} fixes a problem. My guess would be
that XMLSchema on xsd:import does something odd with pointer to python
interpreter.
Best Regards,
Damian Powazka