diff --git a/openlp/plugins/songs/lib/openlyricsexport.py b/openlp/plugins/songs/lib/openlyricsexport.py index d6e21ee51..6ba1fabe7 100644 --- a/openlp/plugins/songs/lib/openlyricsexport.py +++ b/openlp/plugins/songs/lib/openlyricsexport.py @@ -70,10 +70,12 @@ class OpenLyricsExport(object): song.title) xml = openLyrics.song_to_xml(song) tree = etree.ElementTree(etree.fromstring(xml)) - filename = u'%s (%s).xml' % (song.title, + filename = u'%s (%s)' % (song.title, u', '.join([author.display_name for author in song.authors])) filename = re.sub( r'[/\\?*|<>\[\]":<>+%]+', u'_', filename).strip(u'_') + # Ensure the filename isn't too long for some filesystems + filename = u'%s.xml' % filename[0:250 - len(self.save_path)] # 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'),