Created attachment 731964 [details]
Do not add explictly 'dmispec' attributes inside switch() in dmi_decode()
On some hardware, the DMI tables contains data which makes python-dmidecode generate XML tags with duplicated 'dmispec' attributes.
In the case of libxml2, it handles this without any errors. But running the XML data through xmllint or other XML libraries which are more picky (such as python-lxml), it will fail to parse the data.
The attached patch resolves this issue.
Just to clarify the XML error in this bug. What happens is that python-dmidecode in some DMI tables decodes sections not often found. Inside these sections, an additional XML attribute was added, such as dmispec="3.3.41" or dmispec="3.3.42".
The problem is that python-dmidecode had already added the dmispec attribute. So there output libxml2 allows is:
<tag dmispec="3.3.41" dmispec="3.3.41"/>
This is an invalid XML, as attributes are not allowed to be duplicates. And this is what python-lxml reacts to. What the fix does is to remove the duplication of the dmispec attributes. Those two places it was found should never have been there. The reason this was not discovered earlier was that these DMI table sections are seldom found.
was "dmispec", reopened for "installed".