Skip to content
This repository has been archived by the owner on Dec 15, 2018. It is now read-only.

Commit

Permalink
Use strptime at import time to avoid a race
Browse files Browse the repository at this point in the history
Summary:
We've observed funny AttributeErrors and similar in accessing _strptime, which
are likely the result of a known race. This might possibly fix it.

Test Plan: None

Reviewers: benjamin

Reviewed By: benjamin

Subscribers: changesbot, anupc

Differential Revision: https://tails.corp.dropbox.com/D225912
  • Loading branch information
kylec1 committed Sep 2, 2016
1 parent 75bfc23 commit afd10d8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions changes/api/validators/datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

import logging

# We appear to be hitting https://bugs.python.org/issue7980, but by using
# strptime early on, the race should be avoided.
datetime.strptime("", "")


class ISODatetime(object):
def __call__(self, value):
Expand Down

0 comments on commit afd10d8

Please sign in to comment.