TypeError: attribute of type 'NoneType' is not callable
#1
Be warned, I'm no programmer. But I wanted to make some changes to a specific plugin, as it bothers me, that it had no previous month function to see certain shows. So far so good, made all the necessary changes, but now I get an exception thrown at me, that I can't figure out what it is.

it's pretty much the one here, but the solution didn't help, therefore I assume the problem is elsewhere.

The exception is:
Code:
14:48:08 T:140081852155648   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/pascal/.kodi/addons/plugin.video.sf-videoportal/videoportal.py", line 296, in <module>
                                                ok = show_sendung(params)
                                              File "/home/pascal/.kodi/addons/plugin.video.sf-videoportal/videoportal.py", line 217, in show_sendung
                                                datestring = datetime.datetime.strptime(lastMonth, "%Y%m").strftime("%Y-%m")
                                            TypeError: attribute of type 'NoneType' is not callable
                                            -->End of Python script error report<--

So the line is this one here: https://github.com/pashol/xbmc-addon-sfv...al.py#L218

I wanted to check if the variable lastMonth is really empty, but i don't think so, as in the logfile it says:
Code:
14:48:08 T:140081606772480   DEBUG: StartScript - calling plugin SRF Videoportal('plugin://plugin.video.sf-videoportal/','5','?id=0a7932df-dea7-4d8a-bd35-bba2fe2798b5&lastMonth=201501&mode=sendung&title=Aeschbacher&url=%2fplayer%2ftv%2fsendung%2faeschbacher%3fid%3d0a7932df-dea7-4d8a-bd35-bba2fe2798b5')
Where the plugin got called correctly.

So, I ran out of solutions, as I said, no programmer here.
Reply
#2
Ok, i found a work around, just use this
Code:
datestring = datetime.datetime(*(time.strptime(lastMonth, "%Y%m")[:6])).strftime("%Y-%m")
Reply

Logout Mark Read Team Forum Stats Members Help
TypeError: attribute of type 'NoneType' is not callable0