Try this again

This commit is contained in:
Raoul Snyman 2019-03-26 13:11:07 -07:00
parent 27f854fdaa
commit 4072cd4e6e

View File

@ -59,7 +59,11 @@ class PresentationManagerImport(SongImport):
translate('SongsPlugin.PresentationManagerImport', translate('SongsPlugin.PresentationManagerImport',
'File is not in XML-format, which is the only format supported.')) 'File is not in XML-format, which is the only format supported.'))
continue continue
root = objectify.fromstring(etree.tostring(tree).decode(tree.docinfo.encoding)) xml = etree.tostring(tree)
if tree.docinfo.encoding.lower() != 'unicode':
# If the XML string is a bytes object, lxml sometimes croaks
xml = xml.decode(tree.docinfo.encoding)
root = objectify.fromstring(xml)
self.process_song(root, file_path) self.process_song(root, file_path)
def _get_attr(self, elem, name): def _get_attr(self, elem, name):