From 764768f8acc3e622a699b27d62caf18a59f449e3 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Thu, 15 May 2014 21:19:53 +0200 Subject: [PATCH 1/2] fixed bug #1299837 - crash when importing EW DB with unexpected data formatting Fixes: https://launchpad.net/bugs/1299837 --- openlp/plugins/songs/lib/ewimport.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/openlp/plugins/songs/lib/ewimport.py b/openlp/plugins/songs/lib/ewimport.py index 837200aca..7dd122bf9 100644 --- a/openlp/plugins/songs/lib/ewimport.py +++ b/openlp/plugins/songs/lib/ewimport.py @@ -188,7 +188,14 @@ class EasyWorshipSongImport(SongImport): self.addAuthor(author_name.strip()) if words: # Format the lyrics - result = strip_rtf(words, self.encoding) + result = None + try: + result = strip_rtf(words, self.encoding) + except UnicodeDecodeError: + # The unicode chars in the rtf was not escaped in the expected manor + self.logError(self.title, unicode(translate('SongsPlugin.EasyWorshipSongImport', + 'Unexpected data formatting.'))) + continue if result is None: return words, self.encoding = result From bc1675419d53788cb5e585ea97239c8245217383 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Tue, 20 May 2014 18:19:06 +0200 Subject: [PATCH 2/2] Fixed spelling in comment. --- openlp/plugins/songs/lib/ewimport.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/plugins/songs/lib/ewimport.py b/openlp/plugins/songs/lib/ewimport.py index 7dd122bf9..0d95cf548 100644 --- a/openlp/plugins/songs/lib/ewimport.py +++ b/openlp/plugins/songs/lib/ewimport.py @@ -192,7 +192,7 @@ class EasyWorshipSongImport(SongImport): try: result = strip_rtf(words, self.encoding) except UnicodeDecodeError: - # The unicode chars in the rtf was not escaped in the expected manor + # The unicode chars in the rtf was not escaped in the expected manner. self.logError(self.title, unicode(translate('SongsPlugin.EasyWorshipSongImport', 'Unexpected data formatting.'))) continue