Closed andymckay closed 9 years ago
@andymckay Thanks for the report.
It seems unlikely this would crop up in production -- you'd have to be formatting dates for the first time at exactly the same time in two different threads. There are two workarounds mentioned in http://stackoverflow.com/questions/2427240/thread-safe-equivalent-to-pythons-time-strptime both of which I tested successfully. You can either use strptime
before creating your threads, or you can import _strptime
either inside or outside your threads before you use strptime
.
We'll consider making changes to the library to stop this from being a problem. Since there are simple workarounds, and we've never had a report of this in production, I'm going to close this issue.
I've been getting intermittent errors in parsing webhooks from braintree:
I think the cause is this:
https://bugs.python.org/issue7980
In my case I'm using braintree_python in Django and runserver. It sounds like this would occur in our prod environment using uwsgi too. Since the webhooks can be retried, this isn't a terrible problem, but it could be an issue in areas other than webhook.
Since the dates are consistent and well formatted from Braintree, perhaps just working around strptime will be easier.