Thanks for the report and the excellent reproducer. It crashes due to infinite recursion in libxml2. Luckily, it's easy to replace the call into libxml2 with custom code here – it's both more correct and faster. Fix is here: https://github.com/lxml/lxml/commit/201b712edf0478e6a94ace984c1e8435bf3bc3c3
Thanks for the report and the excellent reproducer. It crashes due to infinite recursion in libxml2. /github. com/lxml/ lxml/commit/ 201b712edf0478e 6a94ace984c1e84 35bf3bc3c3
Luckily, it's easy to replace the call into libxml2 with custom code here – it's both more correct and faster.
Fix is here:
https:/