joergbuchwald / ogs6py

Python-API for the OpenGeoSys (http://www.opengeosys.org) software.
BSD 3-Clause "New" or "Revised" License
16 stars 23 forks source link

lxml error when reading large files #74

Closed psatke closed 4 months ago

psatke commented 8 months ago

This file ogs_3bhe_gw.zip produces the following error:

XMLSyntaxError: xmlSAX2Characters: huge text node, line 762, column 10003741

when the piece of code is executed (ogs6py version 0.370):

from ogs6py import ogs

file = 'ogs_3bhe_gw.prj'

model = ogs.OGS(PROJECT_FILE=file, INPUT_FILE=file)

I tried to reduce the project file to a minimum example, but smaller files did not reproduce the error. My current workaround looks like this:

from lxml import etree

file = 'ogs_3bhe_gw.prj'

parser = etree.XMLParser(huge_tree=True)
tree = etree.parse(file, parser)
root = tree.getroot()

Please consider to add the possibility to set huge_tree=True via the API.

joergbuchwald commented 7 months ago

Thanks for the hint. I'll take a look.