EasyWorship import throws exception on unknown character

Bug #1553922 reported by Tomas Groth on 2016-03-07
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenLP
Medium
Tomas Groth
2.4
Undecided
Tomas Groth

Bug Description

When importing from a EasyWorship DB the user selects an encoding to use for the imported text. If the importer encounters an unknown character it currently throws the exception shown below. This should be handled better, for example by creating an error entry in the import-log.
See https://support.openlp.org/scp/tickets.php?id=3332 for example files.

Traceback (most recent call last):
  File "/home/tgc/stuff/openlp/trunk/openlp/core/ui/wizard.py", line 216, in on_current_id_changed
    self.perform_wizard()
  File "/home/tgc/stuff/openlp/trunk/openlp/plugins/songs/forms/songimportform.py", line 351, in perform_wizard
    importer.do_import()
  File "/home/tgc/stuff/openlp/trunk/openlp/plugins/songs/lib/importers/easyworship.py", line 78, in do_import
    self.import_db()
  File "/home/tgc/stuff/openlp/trunk/openlp/plugins/songs/lib/importers/easyworship.py", line 303, in import_db
    self.copyright = copy.decode(self.encoding)
  File "/usr/lib/python3.4/encodings/cp1252.py", line 15, in decode
    return codecs.charmap_decode(input,errors,decoding_table)
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 45: character maps to <undefined>

Related branches

lp:~tomasgroth/openlp/25bugfixes1
Tim Bentley: Approve on 2016-03-15
Raoul Snyman: Approve on 2016-03-15
lp:~tomasgroth/openlp/24bugfix-backport1
Raoul Snyman: Approve on 2016-04-22
Tim Bentley: Approve on 2016-04-22
Tomas Groth (tomasgroth) on 2016-03-08
Changed in openlp:
assignee: nobody → Tomas Groth (tomasgroth)
status: Confirmed → In Progress
Tomas Groth (tomasgroth) on 2016-03-15
Changed in openlp:
milestone: none → 2.5.1
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers