Page MenuHomeSolus

Bring fixes for various libxml2 issues
ClosedPublic

Authored by YakoYakoYokuYoku on Oct 26 2021, 2:16 AM.

Details

Summary

Fixes various issues like garbage output with lxml.etree.tostring like the following example.

>>> from lxml import etree
>>> node = etree.XML("<foo><bar>baz</bar>\n<bar>qux</bar></foo>")
>>> print(etree.tostring(node))
b'<foo><bar>baz</bar>\n<bar>qux</bar></foo>'
>>> print(etree.tostring(node.getchildren()[0]))
b'<bar>baz</bar>\n<bar>qux</bar></foo>\n'
>>> print(etree.tostring(node.getchildren()[1]))
b'<bar>qux</bar></foo>'

After the patches I get the expected results.

>>> from lxml import etree
>>> node = etree.XML("<foo><bar>baz</bar>\n<bar>qux</bar></foo>")
>>> print(etree.tostring(node))
b'<foo><bar>baz</bar>\n<bar>qux</bar></foo>'
>>> print(etree.tostring(node.getchildren()[0]))
b'<bar>baz</bar>\n'
>>> print(etree.tostring(node.getchildren()[1]))
b'<bar>qux</bar>'

Signed-off-by: Martin Reboredo <yakoyoku@gmail.com>

Test Plan

Verify tests like the one above and generated the wireplumber gir file.

Diff Detail

Repository
R1930 libxml2
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

YakoYakoYokuYoku requested review of this revision.Oct 26 2021, 2:16 AM

As an aside Idk if libicu can be enabled for Unicode support is going to be an addition for things like this too while considering another addition to the system base install.

YakoYakoYokuYoku edited the summary of this revision. (Show Details)

Python syntax highlight in summary.

Man you'd think they'd make a new release

JoshStrobl accepted this revision.Oct 28 2021, 3:09 AM
JoshStrobl added a subscriber: JoshStrobl.

LGTM, thanks!

This revision is now accepted and ready to land.Oct 28 2021, 3:09 AM
This revision was automatically updated to reflect the committed changes.