Simplecache error. 'new_datetime' is not defined
#1
I am getting the following error with simplecache, it used to work before, but since yesterday I am getting this error:

 
Quote:
   - 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 "/home/purpz/.kodi/addons/plugin.video.sortzy/main.py", line 315, in <module>
                                                router(sys.argv[2][1:])
                                              File "/home/purpz/.kodi/addons/plugin.video.sortzy/main.py", line 295, in router
                                                mylink(params['contr'])
                                              File "/home/purpz/.kodi/addons/plugin.video.sortzy/main.py", line 153, in mylink
                                                cache_setter('sortzy.myshows', mylink.shows(), 2)
                                              File "/home/purpz/.kodi/addons/plugin.video.sortzy/main.py", line 211, in cache_setter
                                                _cache = simplecache.SimpleCache()
                                              File "/home/purpz/.kodi/addons/script.module.simplecache/lib/simplecache.py", line 33, in __init__
                                                self.check_cleanup()
                                              File "/home/purpz/.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<--


What I do not understand is, I have not defined 'new_datetime' because it's not in my addon, and I can not find it in simplecache.py. Anyone has any clue what might be going on? Maybe an issue with the time I am passing from my addon? Or does anyone know an alternative that is easy and quick to store either function or data for a short time frame (+-2 hours)
Reply
#2
The problem fixed itself the following day. From what I gathered, the problem seems quite common with simplecache. Also I noticed I was caching the function thinking it will cache the data, dumb me. Needless to say it all works now and seem stable, but still need to seek an alternative reliable solution to simplecache
Reply

Logout Mark Read Team Forum Stats Members Help
Simplecache error. 'new_datetime' is not defined0