openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #07936
[Bug 744337] Re: problems with unicode filesystem when export songs
** Changed in: openlp
Status: Confirmed => Fix Committed
--
You received this bug notification because you are a member of OpenLP
Core, which is subscribed to OpenLP.
https://bugs.launchpad.net/bugs/744337
Title:
problems with unicode filesystem when export songs
Status in OpenLP - Worship Presentation Software:
Fix Committed
Bug description:
From my tests seems that lxml library has a problem in the write
function when should to write a filename with unicode characters (on
windows Xp environment).
A patch for solving this problem can be below code:
1) In the file openlp/plugins/songs/lib/openlysicsexport.py
replace the lines 78-79:
tree.write(os.path.join(self.save_path, filename), encoding=u'utf-8', xml_declaration=True, pretty_print=True)
with
open(os.path.join(self.save_path, filename),'w').write(xml)
2) In the file openlp/plugins/songs/lib/openlysicsexport.py
replace the line 337-338
return etree.tostring(xml, encoding=u'UTF-8', xml_declaration=True)
with
return etree.tostring(xml, encoding=u'UTF-8', xml_declaration=True, pretty_print=True)
The same problem into openlyricsimport.py
replace the line 66:
parsed_file = etree.parse(file_path, parser)
with
parsed_file = etree.parse(open(file_path, 'r'), parser)
References