watsonbox / xbmc-confreaks

Confreaks addon for Kodi/XBMC (Python)
GNU General Public License v3.0
14 stars 1 forks source link

Opening addon for the second (and third, etc) time fails #8

Open paneidos opened 8 years ago

paneidos commented 8 years ago

When opening the addon for the first time (since launching Kodi) it works just fine. Going to another addon and reopening this addon fails.

First encountered with XBMC 13.x on Gentoo/Linux Currently using Kodi 15.2 on Gentoo/Linux, bug is still there.

Error log:

11:41:44 T:140526162540288  NOTICE: -->Python Interpreter Initialized<--
11:41:44 T:140526162540288  NOTICE: [xbmcswift2] Request for "/" matches rule for function "index"
11:41:45 T:140526162540288   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.TypeError'>
                                            Error Contents: attribute of type 'NoneType' is not callable
                                            Traceback (most recent call last):
                                              File "/home/me/.kodi/addons/plugin.video.confreaks/addon.py", line 31, in <module>
                                                plugin.run()
                                              File "/home/me/.kodi/addons/script.module.xbmcswift2/lib/xbmcswift2/plugin.py", line 332, in run
                                                items = self._dispatch(self.request.path)
                                              File "/home/me/.kodi/addons/script.module.xbmcswift2/lib/xbmcswift2/plugin.py", line 306, in _dispatch
                                                listitems = view_func(**items)
                                              File "/home/me/.kodi/addons/plugin.video.confreaks/addon.py", line 18, in index
                                                } for event in Router.events()]
                                              File "/home/me/.kodi/addons/plugin.video.confreaks/api/router.py", line 11, in events
                                                return [Event(event) for event in json.load(response)]
                                              File "/home/me/.kodi/addons/plugin.video.confreaks/api/event.py", line 10, in __init__
                                                self.start_at = datetime.strptime(json['start_at'], DATETIME_FORMAT)
                                            TypeError: attribute of type 'NoneType' is not callable
                                            -->End of Python script error report<--
11:41:45 T:140526817814528   ERROR: GetDirectory - Error getting plugin://plugin.video.confreaks/
espinosa commented 8 years ago

Same error occurs with Kodi 16.0

p-avery commented 8 years ago

I got this issue and I am running 16.1 I fixed the issue but changing the file (YOUR KODI DIRECTORY)/addons/plugin.video.confreaks/api/event.py

Delete the , date from line 1 so it reads the following ( line 2 is the normal line just mentioning it so you keep time in as its been coded in rather than just using datetime which I would suggest going forward

from datetime import datetime import time

andyw8 commented 7 years ago

I am seeing this too. Here is a log file for @watsonbox:

https://gist.github.com/andyw8/d5c0cc630ae1e0c690e382df6bc04391

andyw8 commented 7 years ago

@watsonbox if marshcroft's suggestion works, would you accept a PR?

andyw8 commented 7 years ago

An update – I checked against the latest code from the GitHub repo, and it seems to be working fine.

I've created an issue to ask @watsonbot to publish a new release: https://github.com/watsonbox/xbmc-confreaks/issues/9.