diff --git a/openlp/plugins/bibles/lib/__init__.py b/openlp/plugins/bibles/lib/__init__.py index 78e9dcc63..df72514fa 100644 --- a/openlp/plugins/bibles/lib/__init__.py +++ b/openlp/plugins/bibles/lib/__init__.py @@ -178,7 +178,7 @@ def update_reference_separators(): default_separators = [ '|'.join([ translate('BiblesPlugin', ':', 'Verse identifier e.g. Genesis 1 : 1 = Genesis Chapter 1 Verse 1'), - translate('BiblesPlugin', 'v','Verse identifier e.g. Genesis 1 v 1 = Genesis Chapter 1 Verse 1'), + translate('BiblesPlugin', 'v', 'Verse identifier e.g. Genesis 1 v 1 = Genesis Chapter 1 Verse 1'), translate('BiblesPlugin', 'V', 'Verse identifier e.g. Genesis 1 V 1 = Genesis Chapter 1 Verse 1'), translate('BiblesPlugin', 'verse', 'Verse identifier e.g. Genesis 1 verse 1 = Genesis Chapter 1 Verse 1'), translate('BiblesPlugin', 'verses', diff --git a/openlp/plugins/songs/lib/importers/presentationmanager.py b/openlp/plugins/songs/lib/importers/presentationmanager.py index b9df92961..523bc5763 100644 --- a/openlp/plugins/songs/lib/importers/presentationmanager.py +++ b/openlp/plugins/songs/lib/importers/presentationmanager.py @@ -25,6 +25,7 @@ Presentationmanager song files into the current database. """ import os +import re import chardet from lxml import objectify, etree @@ -49,7 +50,11 @@ class PresentationManagerImport(SongImport): # Try to detect encoding and use it file = open(file_path, mode='rb') encoding = chardet.detect(file.read())['encoding'] - tree = etree.parse(file_path, parser=etree.XMLParser(recover=True, encoding=encoding)) + file.close() + # Open file with detected encoding and remove encoding declaration + text = open(file_path, mode='r', encoding=encoding).read() + text = re.sub('.+\?>\n', '', text) + tree = etree.fromstring(text, parser=etree.XMLParser(recover=True)) root = objectify.fromstring(etree.tostring(tree)) self.process_song(root)