2012-10-15, 17:43
(2012-10-12, 17:17)ronie Wrote: as far as i understand it's a known issue with python.
if you google for a bit, you'll find several reports like this one:
http://mail.python.org/pipermail/python-...40579.html
the workaround seems to be:
Code:import datetime
import _strptime
Thanks but this didn't work. I think it might fix a slightly different problem to mine.
(2012-10-12, 18:28)divingmule Wrote: Here is how I worked around the issue in one add-on using time module -
Code:try:
start_date = datetime.strptime(url, "%B %d, %Y - %A")
except TypeError:
start_date = datetime.fromtimestamp(time.mktime(time.strptime(url, "%B %d, %Y - %A")))
Thanks, this works, but I ended up taking a simpler example from the Python doc.
Code:
try:
datetime.strptime(date_string, format)
except TypeError:
datetime(*(time.strptime(date_string, format)[0:6]))
I was hoping there wouldn't be a need to work around the problem but at least it's working now.