forked from openlp/openlp
Add the recover back in, we need it.
This commit is contained in:
parent
bddc3f02dc
commit
20f0464221
@ -45,7 +45,7 @@ class PresentationManagerImport(SongImport):
|
|||||||
return
|
return
|
||||||
self.import_wizard.increment_progress_bar(WizardStrings.ImportingType.format(source=file_path.name))
|
self.import_wizard.increment_progress_bar(WizardStrings.ImportingType.format(source=file_path.name))
|
||||||
try:
|
try:
|
||||||
tree = etree.parse(str(file_path), parser=etree.XMLParser())
|
tree = etree.parse(str(file_path), parser=etree.XMLParser(recover=True))
|
||||||
except etree.XMLSyntaxError:
|
except etree.XMLSyntaxError:
|
||||||
# Try to detect encoding and use it
|
# Try to detect encoding and use it
|
||||||
encoding = get_file_encoding(file_path)['encoding']
|
encoding = get_file_encoding(file_path)['encoding']
|
||||||
@ -53,7 +53,7 @@ class PresentationManagerImport(SongImport):
|
|||||||
text = file_path.read_text(encoding=encoding)
|
text = file_path.read_text(encoding=encoding)
|
||||||
text = re.sub(r'.+\?>\n', '', text)
|
text = re.sub(r'.+\?>\n', '', text)
|
||||||
try:
|
try:
|
||||||
tree = etree.fromstring(text, parser=etree.XMLParser())
|
tree = etree.fromstring(text, parser=etree.XMLParser(recover=True))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.log_error(file_path,
|
self.log_error(file_path,
|
||||||
translate('SongsPlugin.PresentationManagerImport',
|
translate('SongsPlugin.PresentationManagerImport',
|
||||||
|
Loading…
Reference in New Issue
Block a user