5

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.
Teddy
  • 6,013
  • 3
  • 26
  • 38
Andrey Koltsov
  • 1,956
  • 6
  • 24
  • 43
  • (1) "hang up on etree.XMLSchema(tree)" conveys very little information -- what exactly do you mean? (2) I'm sure that the `lxml` developers would be very concerned to hear that there was a problem; `lxml` appears to be a very robust product, not prone to "hanging up" or breaking down -- consider reporting your problem on the `lxml` mailing list or bug tracker. – John Machin Apr 11 '11 at 07:48
  • upd my question, add some info – Andrey Koltsov Apr 11 '11 at 08:55

3 Answers3

3

The work around that I used, is to set:

WSGIApplicationGroup %{GLOBAL}

More details can be found here.

janst
  • 172
  • 10
  • Link is broken. Some useful information on what this means here: https://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIApplicationGroup – darrint Sep 18 '15 at 17:30
2

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

yaph
  • 21
  • 2
1

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.

Mathias Loesch
  • 373
  • 1
  • 5
  • 15