lxml 5.0.0 incompatibility - Arithmetic exception
eljeffeg opened this issue · 8 comments
lxml 5.0.0 was released on Dec 29th 2023. This update causes an Arithmetic exception (core dumped)
when using python-xmlsec.
Example code that would fail..
import xmlsec
from lxml import etree
root = None
with open("sign4-in.xml") as f:
root = etree.parse(f).getroot()
xmlsec.tree.add_ids(root, ["ID"])
also experiencing segfault with lxml-5
Use pip install --no-binary lxml lxml
to install lxml from source and link to system libxml2
, same as xmlsec
, to avoid conflicting libxml2
libraries.
See also https://bugs.launchpad.net/lxml/+bug/1960668#yui_3_10_3_1_1705879387759_1639 and https://github.com/nosnilmot/lxml/blob/master/doc/FAQ.txt#L623
@nosnilmot Sucks that your PR from Dec 2022 was never accepted. We could have avoided the entire issue. Suggest upvoting a fork. lol #275
I am not sure, that need to build lxml from source every-time.
I am not sure, that need to build lxml from source every-time.
what are you not sure about?
lxml
bundles it's own copy of libxml2
which may be a different version from the library that xmlsec
is linked against, the only way to ensure they are both using the same version is to rebuild lxml
.
This is documented here: https://lxml.de/FAQ.html#my-application-crashes
Yes, I'll try and test it tonight or tomorrow.