Fix #1509 (OSError thrown during sync on Windows if one of the timestamps is outside range 1970 to 2038)

pull/1540/head
Ozzieisaacs 4 years ago
parent 20c6f79a44
commit c1f5252b3f

@ -45,7 +45,8 @@ def to_epoch_timestamp(datetime_object):
def get_datetime_from_json(json_object, field_name): def get_datetime_from_json(json_object, field_name):
try: try:
return datetime.utcfromtimestamp(json_object[field_name]) return datetime.utcfromtimestamp(json_object[field_name])
except KeyError: except (KeyError, OSError):
# OSError is thrown on Windows if timestamp is <1970 or >2038
return datetime.min return datetime.min

Loading…
Cancel
Save