Andrey Koltsov
Andrey Koltsov

Reputation: 1974

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.

Upvotes: 5

Views: 1174

Answers (3)

janst
janst

Reputation: 172

The work around that I used, is to set:

WSGIApplicationGroup %{GLOBAL}

More details can be found here.

Upvotes: 3

yaph
yaph

Reputation: 21

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=).

Upvotes: 2

Mathias Loesch
Mathias Loesch

Reputation: 383

I had a similar problem on a Linux system. Try installing a more recent version of libxml2 and reinstalling lxml, at least that's what did it for me.

Upvotes: 1

Related Questions