openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #19143
[Merge] lp:~phill-ridout/openlp/bug1098075 into lp:openlp
Phill has proposed merging lp:~phill-ridout/openlp/bug1098075 into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
For more details, see:
https://code.launchpad.net/~phill-ridout/openlp/bug1098075/+merge/146480
fixes bug 1098075 trunk version
--
https://code.launchpad.net/~phill-ridout/openlp/bug1098075/+merge/146480
Your team OpenLP Core is requested to review the proposed merge of lp:~phill-ridout/openlp/bug1098075 into lp:openlp.
=== modified file 'openlp/plugins/songs/lib/__init__.py'
--- openlp/plugins/songs/lib/__init__.py 2013-01-18 23:31:02 +0000
+++ openlp/plugins/songs/lib/__init__.py 2013-02-04 17:50:45 +0000
@@ -571,6 +571,8 @@
while True:
try:
encoding, default_encoding = get_encoding(font, font_table, default_encoding, failed=failed)
+ if not encoding:
+ return None
out.append(chr(charcode).decode(encoding))
except UnicodeDecodeError:
failed = True
=== modified file 'openlp/plugins/songs/lib/ewimport.py'
--- openlp/plugins/songs/lib/ewimport.py 2013-01-06 17:25:49 +0000
+++ openlp/plugins/songs/lib/ewimport.py 2013-02-04 17:50:45 +0000
@@ -174,7 +174,10 @@
self.addAuthor(author_name.strip())
if words:
# Format the lyrics
- words, self.encoding = strip_rtf(words, self.encoding)
+ result = strip_rtf(words, self.encoding)
+ if result is None:
+ return
+ words, self.encoding = result
verse_type = VerseType.Tags[VerseType.Verse]
for verse in SLIDE_BREAK_REGEX.split(words):
verse = verse.strip()
=== modified file 'openlp/plugins/songs/lib/songproimport.py'
--- openlp/plugins/songs/lib/songproimport.py 2013-01-18 23:31:02 +0000
+++ openlp/plugins/songs/lib/songproimport.py 2013-02-04 17:50:45 +0000
@@ -107,7 +107,10 @@
self.finish()
return
if u'rtf1' in text:
- text, self.encoding = strip_rtf(text, self.encoding)
+ result = strip_rtf(text, self.encoding)
+ if result is None:
+ return
+ text, self.encoding = result
text = text.rstrip()
if not text:
return
=== modified file 'openlp/plugins/songs/lib/sundayplusimport.py'
--- openlp/plugins/songs/lib/sundayplusimport.py 2013-01-06 17:25:49 +0000
+++ openlp/plugins/songs/lib/sundayplusimport.py 2013-02-04 17:50:45 +0000
@@ -148,7 +148,10 @@
verse_type = HOTKEY_TO_VERSE_TYPE[value]
if name == 'rtf':
value = self.unescape(value)
- verse, self.encoding = strip_rtf(value, self.encoding)
+ result = strip_rtf(value, self.encoding)
+ if result is None:
+ return
+ verse, self.encoding = result
lines = verse.strip().split('\n')
# If any line inside any verse contains CCLI or
# only Public Domain, we treat this as special data:
Follow ups