This page is meant to document Python issues of general interest to Kodi addon developers.
There is an old Python bug (https://bugs.python.org/issue27400) which ONLY impacts embedded python applications, such as the Kodi Python environment. The issue is that datetime.strptime is only initialized once per process and not every time the embedded environment is reinitialized. This causes datetime.strptime to return None and perhaps other strange behavior.
One option is for you to replace every reference to datetime.strptime to use a strptime_patch attached to this page. This is less voodoo, but there is always the possibility that some library code uses strptime and there will still be potential for incorrect results or a Kodi crash (script.module.youtube.dl crashed Kodi for a while).
The other option is to monkey-patch datetime.strptime so that any user of the python runtime will use it. It is voodoo like, but that is why Python supports Monkey patching.
This patch simply replaces datetime.strptime with time.strptime. They are nearly identical in function. For more information, see the attached patch.