Thread-safe equivalent to python's time.strptime() ?
- by Wells
Something I wrote throws a lot of AttributeErrors when using time.strptime() inside a thread. This only seems to happen on Windows (not on Linux), but whatever…. Upon a'Googling, it seems that time.strptime() isn't considered thread-safe.
Is there a better way to create a datetime object from a string? Current code looks like:
val = DateFromTicks(mktime(strptime(val, '%B %d, %Y')))
But, that yields the AttributeErrors as its run inside a thread.
Thanks!