XLordKX / kodi

kodi plugins & addons
211 stars 80 forks source link

German umlauts cause favorites skript to crash #19

Open ntim opened 9 years ago

ntim commented 9 years ago

When adding a series to the favorites, German umlauts in the title can cause the favorites skript to fail:

16:58:01 T:1566569504   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
     - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
    Error Type: <class 'xml.parsers.expat.ExpatError'>
    Error Contents: not well-formed (invalid token): line 4, column 41
    Traceback (most recent call last):
      File "/home/osmc/.kodi/addons/script.favourites/default.py", line 176, in <module>
        Main()
      File "/home/osmc/.kodi/addons/script.favourites/default.py", line 22, in __init__
        found, favourites = self._read_file()
      File "/home/osmc/.kodi/addons/script.favourites/default.py", line 46, in _read_file
        self.doc = parse(self.fav_file)
      File "/usr/lib/python2.7/xml/dom/minidom.py", line 1918, in parse
        return expatbuilder.parse(file)
      File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 924, in parse
        result = builder.parseFile(fp)
      File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 207, in parseFile
        parser.Parse(buffer, 0)
    ExpatError: not well-formed (invalid token): line 4, column 41
    -->End of Python script error report<--

Maybe umlauts should be encoded or something?