forked from openlp/openlp
fixed bug #744337
bzr-revno: 1457 Fixes: https://launchpad.net/bugs/744337
This commit is contained in:
commit
e72e9c8952
@ -73,6 +73,8 @@ class OpenLyricsExport(object):
|
|||||||
u', '.join([author.display_name for author in song.authors]))
|
u', '.join([author.display_name for author in song.authors]))
|
||||||
filename = re.sub(
|
filename = re.sub(
|
||||||
r'[/\\?*|<>\[\]":<>+%]+', u'_', filename).strip(u'_')
|
r'[/\\?*|<>\[\]":<>+%]+', u'_', filename).strip(u'_')
|
||||||
tree.write(os.path.join(self.save_path, filename),
|
# Pass a file object, because lxml does not cope with some special
|
||||||
|
# characters in the path (see lp:757673 and lp:744337).
|
||||||
|
tree.write(open(os.path.join(self.save_path, filename), u'w'),
|
||||||
encoding=u'utf-8', xml_declaration=True, pretty_print=True)
|
encoding=u'utf-8', xml_declaration=True, pretty_print=True)
|
||||||
return True
|
return True
|
||||||
|
@ -63,7 +63,9 @@ class OpenLyricsImport(SongImport):
|
|||||||
self.import_wizard.incrementProgressBar(
|
self.import_wizard.incrementProgressBar(
|
||||||
WizardStrings.ImportingType % os.path.basename(file_path))
|
WizardStrings.ImportingType % os.path.basename(file_path))
|
||||||
try:
|
try:
|
||||||
parsed_file = etree.parse(file_path, parser)
|
# Pass a file object, because lxml does not cope with some
|
||||||
|
# special characters in the path (see lp:757673 and lp:744337).
|
||||||
|
parsed_file = etree.parse(open(file_path, u'r'), parser)
|
||||||
xml = unicode(etree.tostring(parsed_file))
|
xml = unicode(etree.tostring(parsed_file))
|
||||||
if self.openLyrics.xml_to_song(xml) is None:
|
if self.openLyrics.xml_to_song(xml) is None:
|
||||||
log.debug(u'File could not be imported: %s' % file_path)
|
log.debug(u'File could not be imported: %s' % file_path)
|
||||||
|
Loading…
Reference in New Issue
Block a user