← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~googol-hush/openlp/fixes into lp:openlp

 

Andreas Preikschat has proposed merging lp:~googol-hush/openlp/fixes into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  Bug #598393 in OpenLP: "After adding a new image to a selected (image) item in the service manager it is not selected anymore"
  https://bugs.launchpad.net/openlp/+bug/598393
  Bug #719102 in OpenLP: "editing author after editing song causes traceback"
  https://bugs.launchpad.net/openlp/+bug/719102
  Bug #730979 in OpenLP: "Song export crashes"
  https://bugs.launchpad.net/openlp/+bug/730979
  Bug #744337 in OpenLP: "problems with unicode filesystem when export songs "
  https://bugs.launchpad.net/openlp/+bug/744337
  Bug #747206 in OpenLP: "Missing dictionary for spell check prevents program start"
  https://bugs.launchpad.net/openlp/+bug/747206

For more details, see:
https://code.launchpad.net/~googol-hush/openlp/fixes/+merge/57297

Hello,

- fixed bug #744337

My vague guess is, that lxml cannot create/read files from directory with some special characters.
-- 
https://code.launchpad.net/~googol-hush/openlp/fixes/+merge/57297
Your team OpenLP Core is requested to review the proposed merge of lp:~googol-hush/openlp/fixes into lp:openlp.
=== modified file 'openlp/plugins/songs/lib/openlyricsexport.py'
--- openlp/plugins/songs/lib/openlyricsexport.py	2011-03-24 19:04:02 +0000
+++ openlp/plugins/songs/lib/openlyricsexport.py	2011-04-12 09:59:12 +0000
@@ -73,6 +73,8 @@
                 u', '.join([author.display_name for author in song.authors]))
             filename = re.sub(
                 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)
         return True

=== modified file 'openlp/plugins/songs/lib/openlyricsimport.py'
--- openlp/plugins/songs/lib/openlyricsimport.py	2011-03-24 19:04:02 +0000
+++ openlp/plugins/songs/lib/openlyricsimport.py	2011-04-12 09:59:12 +0000
@@ -63,7 +63,9 @@
             self.import_wizard.incrementProgressBar(
                 WizardStrings.ImportingType % os.path.basename(file_path))
             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))
                 if self.openLyrics.xml_to_song(xml) is None:
                     log.debug(u'File could not be imported: %s' % file_path)


Follow ups