openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #07645
[Bug 744337] Re: problems with unicode filesystem when export songs
Hello,
1) When you think it is a lxml library problem, then shouldn't you report this to the lxml project? They actually use launchpad for bugs: https://launchpad.net/lxml
2) Altough I was able to reproduce this on XP with characters like
êúæÅÕóĉ (but not on Linux) you always should provide tracebacks (as
sometimes we are not able to reproduce). However, as I was able to
reproduce, you don't have to provide one now.
Thanks for reporting. Cheers :-)
** Changed in: openlp
Status: New => Confirmed
** Changed in: openlp
Assignee: (unassigned) => Andreas Preikschat (googol-hush)
--
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:
Confirmed
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