v20 Strange datetime error? - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +--- Thread: v20 Strange datetime error? (/showthread.php?tid=374128) |
Strange datetime error? - Mr Dini - 2023-08-16 I am writing a video addon and to parse the EPG I need to convert from the API provided date format to the EPG compatible version. Upon writing the code that handles this logic for me, I encountered a strange issue: Code: import sys If I run this, I get: Code: 2023-08-16 15:58:49.543 T:38735 error <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<-- Other dates work fine... And if I run the same thing from my regular bash shell's python 3.11.3 installation, I get the expected result: Code: >>> a = '14/08/2023 21:45:00' Can you reproduce as well? Any possible workarounds? I am running Kodi v20.2 on an Arch laptop. Thanks RE: Strange datetime error? - izprtxqkft - 2023-08-16 looks like this python bug - https://bugs.python.org/issue27400 workaround code -
RE: Strange datetime error? - Mr Dini - 2023-08-17 Thanks a lot. Meanwhile I figured that there is even a Kodi wiki about this issue: https://kodi.wiki/view/Python_Problems#datetime.strptime Your suggested workaround works well. |