jbinkley60 / plugin.program.kscleaner

GNU General Public License v2.0
10 stars 2 forks source link

Database access error due to ampersand in password #4

Closed jmechnich closed 7 months ago

jmechnich commented 7 months ago

I am wondering why using ET.parse(config_file) was not sufficient for parsing the configuration file here:

https://github.com/jbinkley60/plugin.program.kscleaner/blob/babda964878e54a45293aba37757f70ba62fde73/resources/lib/common.py#L94-L96

The replacing code broke the add-on in my case as my password contains an ampersand (which was replaced by a white-space). Uncommenting line 94 (and commenting out the following two lines) fixed it for me.

EDIT: this is using the LibreElec 12 Beta with Kodi 21, Python 3.11.8

jbinkley60 commented 7 months ago

Yeah, this is why I don't like XML parsing and why folks are trying to move away from it. Even Kodi has gone away from XML scrapers to Python based scrapers for this reason. I presume if you changed the password not to have an & it works fine ? The code is like this because many folks have regex expressions and similar in their advancedsettings.xml file and XML parsers don't like those characters.

jmechnich commented 7 months ago

Thanks for the explanation. I am happy with just patching the file manually as the regexes in my advancedsettings.xml must either be simple enough or have been escaped properly. Maybe you want to consider mentioning this e.g. in the README but whatever you decide, there is this issue now for posterity. 😄