diff --git a/openlp/plugins/songs/lib/importers/presentationmanager.py b/openlp/plugins/songs/lib/importers/presentationmanager.py index dfba3b607..a5bf55a4a 100644 --- a/openlp/plugins/songs/lib/importers/presentationmanager.py +++ b/openlp/plugins/songs/lib/importers/presentationmanager.py @@ -59,7 +59,11 @@ class PresentationManagerImport(SongImport): translate('SongsPlugin.PresentationManagerImport', 'File is not in XML-format, which is the only format supported.')) 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) def _get_attr(self, elem, name):