"<" in song lyrics causes a traceback

Bug #863376 reported by Andreas Preikschat
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenLP
Fix Released
High
Unassigned

Bug Description

Hello,

When a song's lyrics contains "<" (and you try to preview the song) then the following traceback is shown.

**OpenLP Bug Report**
Version: {u'full': u'1.9.7-bzr1765', u'version': u'1.9.7', u'build': u'bzr1765'}

--- Exception Traceback ---
Traceback (most recent call last):
  File "/home/andreas/Projekte/openlp/trunk/openlp/core/lib/mediamanageritem.py", line 506, in onClickPressed
    self.onPreviewClick()
  File "/home/andreas/Projekte/openlp/trunk/openlp/core/lib/mediamanageritem.py", line 529, in onPreviewClick
    serviceItem = self.buildServiceItem()
  File "/home/andreas/Projekte/openlp/trunk/openlp/core/lib/mediamanageritem.py", line 623, in buildServiceItem
    if self.generateSlideData(serviceItem, item, xmlVersion, remote):
  File "/home/andreas/Projekte/openlp/trunk/openlp/plugins/songs/lib/mediaitem.py", line 509, in generateSlideData
    service_item.xml_version = self.openLyrics.song_to_xml(song)
  File "/home/andreas/Projekte/openlp/trunk/openlp/plugins/songs/lib/xml.py", line 341, in song_to_xml
    virtual_verse, tags_element)
  File "/home/andreas/Projekte/openlp/trunk/openlp/plugins/songs/lib/xml.py", line 450, in _add_text_with_tags_to_lines
    element = etree.XML(text)
  File "lxml.etree.pyx", line 2723, in lxml.etree.XML (src/lxml/lxml.etree.c:52448)
  File "parser.pxi", line 1573, in lxml.etree._parseMemoryDocument (src/lxml/lxml.etree.c:79932)
  File "parser.pxi", line 1445, in lxml.etree._parseDoc (src/lxml/lxml.etree.c:78709)
  File "parser.pxi", line 920, in lxml.etree._BaseParser._parseUnicodeDoc (src/lxml/lxml.etree.c:75083)
  File "parser.pxi", line 564, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:71739)
  File "parser.pxi", line 645, in lxml.etree._handleParseResult (src/lxml/lxml.etree.c:72614)
  File "parser.pxi", line 585, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:71955)
XMLSyntaxError: StartTag: invalid element name, line 1, column 23

--- System information ---
Plattform: Linux-3.0-ARCH-i686-Intel-R-_Pentium-R-_4_CPU_1.80GHz-with-glibc2.0

--- Library Versions ---
Python: 2.7.2
Qt4: 4.7.4
Phonon: 4.5.55
PyQt4: 4.8.5
SQLAlchemy: 0.7.2
BeautifulSoup: 3.2.0
lxml: 2.3.0
Chardet: 2.0.1
PyEnchant: 1.6.3
PySQLite: 1.0.1

Related branches

description: updated
Revision history for this message
Jonathan Corwin (j-corwin) wrote :

On a similar theme, when I have a song with an "&" in it and preview it, I get

Traceback (most recent call last):
  File "D:\OpenLP_Code\trunk\build\pyi.win32\OpenLP\outPYZ1.pyz/openlp.core.lib.mediamanageritem", line 516, in onSelectionChange
  File "D:\OpenLP_Code\trunk\build\pyi.win32\OpenLP\outPYZ1.pyz/openlp.core.lib.mediamanageritem", line 529, in onPreviewClick
  File "D:\OpenLP_Code\trunk\build\pyi.win32\OpenLP\outPYZ1.pyz/openlp.core.lib.mediamanageritem", line 623, in buildServiceItem
  File "D:\OpenLP_Code\trunk\build\pyi.win32\OpenLP\outPYZ1.pyz/openlp.plugins.songs.lib.mediaitem", line 509, in generateSlideData
  File "D:\OpenLP_Code\trunk\build\pyi.win32\OpenLP\outPYZ1.pyz/openlp.plugins.songs.lib.xml", line 341, in song_to_xml
  File "D:\OpenLP_Code\trunk\build\pyi.win32\OpenLP\outPYZ1.pyz/openlp.plugins.songs.lib.xml", line 450, in _add_text_with_tags_to_lines
  File "lxml.etree.pyx", line 2512, in lxml.etree.XML (src/lxml/lxml.etree.c:48057)
  File "parser.pxi", line 1545, in lxml.etree._parseMemoryDocument (src/lxml/lxml.etree.c:71812)
  File "parser.pxi", line 1417, in lxml.etree._parseDoc (src/lxml/lxml.etree.c:70608)
  File "parser.pxi", line 898, in lxml.etree._BaseParser._parseUnicodeDoc (src/lxml/lxml.etree.c:67148)
  File "parser.pxi", line 539, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:63824)
  File "parser.pxi", line 625, in lxml.etree._handleParseResult (src/lxml/lxml.etree.c:64745)
  File "parser.pxi", line 565, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:64088)
XMLSyntaxError: xmlParseEntityRef: no name, line 1, column 22

Changed in openlp:
assignee: nobody → Andreas Preikschat (googol)
status: New → In Progress
Changed in openlp:
status: In Progress → Fix Committed
Changed in openlp:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.