
Hi, 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 schema is valid. Regards, Damian Powazka.
Hi,
What problem do you see exactly? As far as I know, mod_wsgi will use threads to handle requests concurrently, but a single request will stay in its own thread unless you start threads yourself. Also, there should not be any problem (I think) if you do not share lxml objects across threads. Can you avoid doing that?
Regards, -- Simon Sapin _________________________________________________________________ Mailing list for the lxml Python XML toolkit - http://lxml.de/ lxml@lxml.de https://mailman-mail5.webfaction.com/listinfo/lxml

Hi, please use "lxml@lxml.de" as the mailing list address. And please don't top-post in replies. 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. Stefan

W dniu 21 grudnia 2011 18:51 użytkownik Stefan Behnel <stefan_ml@behnel.de> napisał:
Hi,
please use "lxml@lxml.de" as the mailing list address. And please don't top-post in replies.
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.
Stefan
Hi, The problem occurs when working with schema that has xsd:import I have tried schemaLocation pointing to the url and file with the same result. Of curse the file was in the specified location, and same code run as apache user in command line executes with out any problems. Also I observe unexpected death of the process when passing invalid schema string, that should raise an exception that would normally be caught by surrounding try-catch. Kind Regards, Damian Powazka.

W dniu 21 grudnia 2011 18:51 użytkownik Stefan Behnel <stefan_ml@behnel.de> napisał:
Hi,
please use "lxml@lxml.de" as the mailing list address. And please don't top-post in replies.
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.
Stefan _________________________________________________________________ Mailing list for the lxml Python XML toolkit - http://lxml.de/ lxml@lxml.de https://mailman-mail5.webfaction.com/listinfo/lxml
Hi, I have found a temporary work around for the problem: https://techknowhow.library.emory.edu/blogs/branker/2010/07/30/django-lxml-w... but in long term limitation to only one WSGI is bit problematic. Any chance that this issue could be fixed? Best Regards, Damian Powazka

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
participants (2)
-
Damian Powązka
-
Stefan Behnel