Amarok may save invalid xml playlists

Miguel Angel Alvarez maacruz at gmail.com
Sat Oct 20 20:19:35 UTC 2007


El Sábado 20 Octubre 2007, Jeff Mitchell escribió:
> On Friday 19 October 2007, Miguel Angel Alvarez wrote:
> > Hi all,
> > The saved playlist may not be valid xml, containing escaped non-utf8
> > characters which in turn will cause parsers to fail.
> > See this bugreport for replaygain someone sent me, and have a look at the
> > attached playlist in line 1551:
> >
> > Traceback (most recent call last):
> >   File
> > "/home/yoda/.kde/share/apps/amarok/scripts/amarok_replaygain/amarok_repla
> >yg ain.py", line 1095, in <module>
> >     PlayList.update()
> >   File
> > "/home/yoda/.kde/share/apps/amarok/scripts/amarok_replaygain/amarok_repla
> >yg ain.py", line 877, in update
> >     xmlparser.parse(str(amarok_dcop.playlist.saveCurrentPlaylist()[1]))
> >   File "/usr/lib/python2.5/site-packages/_xmlplus/sax/expatreader.py",
> > line 109, in parse
> >     xmlreader.IncrementalParser.parse(self, source)
> >   File "/usr/lib/python2.5/site-packages/_xmlplus/sax/xmlreader.py", line
> > 123, in parse
> >     self.feed(buffer)
> >   File "/usr/lib/python2.5/site-packages/_xmlplus/sax/expatreader.py",
> > line 220, in feed
> >     self._err_handler.fatalError(exc)
> >   File "/usr/lib/python2.5/site-packages/_xmlplus/sax/handler.py", line
> > 38, in fatalError
> >     raise exception
> > xml.sax._exceptions.SAXParseException:/home/yoda/.kde/share/apps/amarok/c
> >ur rent.xml:1551:51: reference to invalid
> > character number
> >
> > This is not actually a problem for me, since the affected parts are not
> > of interes for replaygain and I have already written a workaround, but
> > for other people this may be a more severe problem.
>
> Miguel--
>
> Here's line 1551:
>
> <Directory>/music/from iTunes/Virginia Jetzt!/Anf&#xdbff;&#xdee4;nger
> Deluxe (Tour Edition)</Directory>
>
> Can you explain what's actually wrong with this?  I don't know what
> character it's supposed to be, or why escaping it is invalid.
It is the german character a-umlaut (ä), encoded in ISO8859-1 i think
I'm not an xml expert, in fact I find it quite confusing, but it seems you 
can't put any character encoded in any encoding different from what the xml 
file encoding claims to be or the sax parsers will throw an error and stop 
parsing .
> I can tell you that the problem, whatever it is, is likely in xmlEncode in
> metabundle.cpp, starting at line 1512.
>
> --Jeff



-- 
Don't see the world through a window, be open{source}minded, and be free :-)



More information about the Amarok mailing list