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

NameError: name 'new_datetime' is not defined #12

Open
kbh2002de opened this issue Oct 19, 2019 · 0 comments
Open

NameError: name 'new_datetime' is not defined #12

kbh2002de opened this issue Oct 19, 2019 · 0 comments

Comments

@kbh2002de
Copy link

I'm seeing an error with the simplecache plugin on my Fire TV Stick when using plugin.video.cbs:

2019-10-19 13:25:41.391 T:10611   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.NameError'>
                                            Error Contents: name 'new_datetime' is not defined
                                            Traceback (most recent call last):
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.cbs/default.py", line 23, in <module>
                                                from resources.lib import cbs
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.cbs/resources/lib/cbs.py", line 250, in <module>
                                                if mode==None:  CBS().buildMenu(MAIN_MENU)
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.cbs/resources/lib/cbs.py", line 76, in __init__
                                                self.cache = SimpleCache()
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.module.simplecache/lib/simplecache.py", line 33, in __init__
                                                self.check_cleanup()
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.module.simplecache/lib/simplecache.py", line 96, in check_cleanup
                                                elif (eval(lastexecuted) + self._auto_clean_interval) < cur_time:
                                              File "<string>", line 1, in <module>
                                            NameError: name 'new_datetime' is not defined
                                            -->End of Python script error report<--

Whole log here: https://paste.kodi.tv/urerunazuz

So the Amazon Fire TV Stick seems to have some kind of problem with the datetime usage. I can circumvent the issue by restarting my device, but the problem reappears after some time (I suspect the _auto_clean_interval).
Searching around I also found the same issue here: https://pastebin.com/3Q6s1MK7 (Discussion in https://forum.kodi.tv/showthread.php?tid=334128) using another video plugin (plugin.video.msnbc) but also crashing in simplecache. The interesting bit here is that the user encountered this on an unspecified Android tablet as well as on an RaspberryPi, so it does not seem to be an exclusive Fire TV issue.

Also looking around I found this issue with a problem in a completely different addon that looks relatively similar: Catch-up-TV-and-More/plugin.video.catchuptvandmore#27 The text is in French, but the interesting part is in the code bits and the fact that the issue lead to the following changes: Catch-up-TV-and-More/plugin.video.catchuptvandmore@c7a904f
So basically they got arround the issue by ditching the datetime import in favour of the time import which seems to be better compatible.

What do you think could the same solution be used for this plugin?

Besides the 'cheap' solution of circumventing the problem I tried to figure out why the datetime problem even appears. I suspect it has something to do with the fact that my device is sporting a German locale and timezone and that messes something up, but I wasn't able to figure out where that comes into play and might cause the error.

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

No branches or pull requests

1 participant