Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix addons without repo/unused repository checks #2

Merged
merged 1 commit into from Jun 29, 2021

Conversation

tstrul1
Copy link
Contributor

@tstrul1 tstrul1 commented Jun 22, 2021

after upgrading to python3, im getting this error while performing these checks:

ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'TypeError'>
                                                   Error Contents: can only concatenate str (not "bytes") to str
                                                   Traceback (most recent call last):
                                                     File "C:\Users\home\AppData\Roaming\Kodi\addons\script.kcleaner\default.py", line 1262, in getPathAddons
                                                       xmldoc = minidom.parseString(httpdata)
                                                     File "C:\Program Files (x86)\Kodi\system\python\Lib\xml\dom\minidom.py", line 1969, in parseString
                                                       return expatbuilder.parseString(string)
                                                     File "C:\Program Files (x86)\Kodi\system\python\Lib\xml\dom\expatbuilder.py", line 925, in parseString
                                                       return builder.parseString(string)
                                                     File "C:\Program Files (x86)\Kodi\system\python\Lib\xml\dom\expatbuilder.py", line 223, in parseString
                                                       parser.Parse(string, True)
                                                   xml.parsers.expat.ExpatError: not well-formed (invalid token): line 186, column 79
                                                   
                                                   During handling of the above exception, another exception occurred:
                                                   
                                                   Traceback (most recent call last):
                                                     File "C:\Users\home\AppData\Roaming\Kodi\addons\script.kcleaner\default.py", line 1963, in <module>
                                                       intCancel = ProcessAddons(0)
                                                     File "C:\Users\home\AppData\Roaming\Kodi\addons\script.kcleaner\default.py", line 1053, in ProcessAddons
                                                       AddonsInRepo += GetAddonsInRepo(repoxml, r)
                                                     File "C:\Users\home\AppData\Roaming\Kodi\addons\script.kcleaner\default.py", line 1190, in GetAddonsInRepo
                                                       id = getPathAddons(ri, repo)
                                                     File "C:\Users\home\AppData\Roaming\Kodi\addons\script.kcleaner\default.py", line 1264, in getPathAddons
                                                       xbmc.log("KCLEANER >> ERROR PARSING REPO >> " + str(e).encode('utf-8'))
                                                   TypeError: can only concatenate str (not "bytes") to str
                                                   -->End of Python script error report<--

after upgrading to python3, this error occurs:
9:38:09.224 T:13716   ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'TypeError'>
                                                   Error Contents: can only concatenate str (not "bytes") to str
                                                   Traceback (most recent call last):
                                                     File "C:\Users\home\AppData\Roaming\Kodi\addons\script.kcleaner\default.py", line 1262, in getPathAddons
                                                       xmldoc = minidom.parseString(httpdata)
                                                     File "C:\Program Files (x86)\Kodi\system\python\Lib\xml\dom\minidom.py", line 1969, in parseString
                                                       return expatbuilder.parseString(string)
                                                     File "C:\Program Files (x86)\Kodi\system\python\Lib\xml\dom\expatbuilder.py", line 925, in parseString
                                                       return builder.parseString(string)
                                                     File "C:\Program Files (x86)\Kodi\system\python\Lib\xml\dom\expatbuilder.py", line 223, in parseString
                                                       parser.Parse(string, True)
                                                   xml.parsers.expat.ExpatError: not well-formed (invalid token): line 186, column 79
                                                   
                                                   During handling of the above exception, another exception occurred:
                                                   
                                                   Traceback (most recent call last):
                                                     File "C:\Users\home\AppData\Roaming\Kodi\addons\script.kcleaner\default.py", line 1963, in <module>
                                                       intCancel = ProcessAddons(0)
                                                     File "C:\Users\home\AppData\Roaming\Kodi\addons\script.kcleaner\default.py", line 1053, in ProcessAddons
                                                       AddonsInRepo += GetAddonsInRepo(repoxml, r)
                                                     File "C:\Users\home\AppData\Roaming\Kodi\addons\script.kcleaner\default.py", line 1190, in GetAddonsInRepo
                                                       id = getPathAddons(ri, repo)
                                                     File "C:\Users\home\AppData\Roaming\Kodi\addons\script.kcleaner\default.py", line 1264, in getPathAddons
                                                       xbmc.log("KCLEANER >> ERROR PARSING REPO >> " + str(e).encode('utf-8'))
                                                   TypeError: can only concatenate str (not "bytes") to str
                                                   -->End of Python script error report<--
@jeffski10
Copy link
Owner

I can't replicate this issue. What repo path is it failing to parse as encoding the path seems logical to me.

@tstrul1
Copy link
Contributor Author

tstrul1 commented Jun 28, 2021

Hi,
It happens for some repositories for example repository.DejaVu

BTW are you sure this part is about encoding the path? I think its encoding the exception

@jeffski10 jeffski10 merged commit 95dc767 into jeffski10:master Jun 29, 2021
@jeffski10
Copy link
Owner

So debugged this. Its happening as the repo xml is invalid for one of the included repos ' unencoded &
Hadn't realised this was just the error message so you you are right no need to encode.

@tstrul1
Copy link
Contributor Author

tstrul1 commented Jun 29, 2021

Thanks a lot for your quick help!
btw im not sure if you keep adding features to this addon but if you do, I think removal of orphaned dependencies could make this the perfect cleaning add-on :)

@tstrul1 tstrul1 deleted the patch-1 branch June 29, 2021 15:33
@jeffski10
Copy link
Owner

Not at the moment. I'd uploaded this as the developer had gone AWOL but has since reinstated the repo and the link updated on the forums. If it does become unmaintained fully then I might think about making further amends.

@tstrul1
Copy link
Contributor Author

tstrul1 commented Jun 30, 2021

Thanks for helping,
I see his user on kodi forum is disabled and i cant find original source code anywhere.
Any idea how to contact the developer with this change?

@jeffski10
Copy link
Owner

Yeah, saw that - He disappeared completely so I uploaded the plugin code I had a copy of to git so it could be found. Not sure it was ever here in the past. His repo is back now but I don't see an obvious way to contact either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants