Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python hangs on lxml.etree.XMLSchema(tree) with apache + mod_wsgi

Python hangs on

lxml.etree.XMLSchema(tree)

when I use it on apache server + mod_wsgi (Windows)

When I use Django dev server - all works fine

if you know about other nice XML validation solution against XSD, tell me pls

Update:

I'm using soaplib, which uses lxml

logger.debug("building schema...")
self.schema = etree.XMLSchema(etree.parse(f))

logger.debug("schema %r built, cleaning up..." % self.schema)

I see "building schema..." in apache logs, but I don't see "schema %r built, cleaning up..."

Update 2: I built lxml 2.3 with MSVS 2010 visual C++; afterwards it crashes on this line

self.schema = etree.XMLSchema(etree.parse(f))
with Unhandled exception at 0x7c919af2 in httpd.exe: 0xC0000005: Access violation writing location 0x00000010.
like image 290
Andrey Koltsov Avatar asked Apr 11 '11 06:04

Andrey Koltsov


2 Answers

The work around that I used, is to set:

WSGIApplicationGroup %{GLOBAL}

More details can be found here.

like image 145
janst Avatar answered Oct 06 '22 00:10

janst


I had the same problem (lxml 2.2.6, mod_wsgi 3.2). A work around for this is to pass a file or filename to the constructor: XMLSchema(file=).

like image 39
yaph Avatar answered Oct 06 '22 00:10

yaph