Skip to content
This repository was archived by the owner on Oct 30, 2022. It is now read-only.
This repository was archived by the owner on Oct 30, 2022. It is now read-only.

[Bug] cannot backup build because some addon.xml doesnt have proper xml decleration #134

@tstrul1

Description

@tstrul1

Describe the bug
when trying to backup build it fails because some addons doesnt have proper xml deceleration

2021-06-11 19:36:14.108 T:15432 ERROR : EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'xml.etree.ElementTree.ParseError'>
Error Contents: XML or text declaration not at start of entity: line 2, column 0
Traceback (most recent call last):
File "C:\Users\home\AppData\Roaming\Kodi\addons\plugin.program.openwizard\default.py", line 29, in
dispatcher.dispatch(_handle, _params)
File "C:\Users\home\AppData\Roaming\Kodi\addons\plugin.program.openwizard\resources\libs\common\router.py", line 289, in dispatch
backup.backup(action)
File "C:\Users\home\AppData\Roaming\Kodi\addons\plugin.program.openwizard\resources\libs\backup.py", line 838, in backup
cls.backup_build(name)
File "C:\Users\home\AppData\Roaming\Kodi\addons\plugin.program.openwizard\resources\libs\backup.py", line 274, in backup_build
binaryid, binaryname = db.find_binary_addons(addon=foldername)
File "C:\Users\home\AppData\Roaming\Kodi\addons\plugin.program.openwizard\resources\libs\db.py", line 517, in find_binary_addons
root = ElementTree.parse(xml).getroot()
File "C:\Program Files (x86)\Kodi\system\python\Lib\xml\etree\ElementTree.py", line 1202, in parse
tree.parse(source, parser)
File "C:\Program Files (x86)\Kodi\system\python\Lib\xml\etree\ElementTree.py", line 595, in parse
self._root = parser._parse_whole(source)
File "", line None
xml.etree.ElementTree.ParseError: XML or text declaration not at start of entity: line 2, column 0
-->End of Python script error report<--

example for addons: elementum repository, script.module.pytz, script.module.xbmcswift2

if this exeption cannot be handled it would be great to just skip the problematic addons and get a report afterwards

To Reproduce
Steps to reproduce the behavior:

  1. Go to maintenance
  2. Click on backup/restore
  3. Scroll down to backup build
  4. include addon data
  5. See error

Platform
Kodi 19.1 on windows 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions