If this could be done, one of the stopping step versus upgrading to Ubuntu 14.04 would be removed. Currently the nrmllib tests fail with
a core dump:
FAIL: test_invalid_schema (openquake.nrmllib.tests.hazard.parsers_test.SourceModelParserTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/var/lib/lxc/engine/rootfs/home/ubuntu/oq-nrmllib/openquake/nrmllib/tests/hazard/parsers_test.py", line 257, in test_invalid_schema
self.assertRaises(etree.XMLSyntaxError, parser.parse)
AssertionError: XMLSyntaxError not raised
*** Error in `/usr/bin/python': free(): invalid pointer: 0x00000000031192b8 ***
Aborted (core dumped)
We should investigate how big of the problem the lack or NRML schema validation would (i.e. if we could get good error messages anyway it
would not be a problem).
ElementTree gives better error messages in some cases.
For instance, given an attribute with a quote which is not escaped
<nonParamet ricSeismicSourc e id="283" name="Kanto Earthquake of "1923 Taisho" type" tectonicRegion= "Subduction Interface" ></nonParametri cSeismicSource>
lxml chokes with
File "/home/ ubuntu/ oq-commonlib/ openquake/ commonlib/ source. py", line 131, in parse_source_model ParseError. __init_ _ (src/lxml/ lxml.etree. c:69927)
for src_node in src_nodes:
File "parser.pxi", line 18, in lxml.etree.
TypeError: __init__() takes exactly 5 positional arguments (2 given)
whereas ElementTree correctly reports line and column where the offending quote is.