1
0
mirror of https://github.com/janeczku/calibre-web synced 2024-12-26 01:50:31 +00:00

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

This commit is contained in:
Ozzieisaacs 2020-07-05 13:40:33 +02:00
parent 20c6f79a44
commit c1f5252b3f

View File

@ -45,7 +45,8 @@ def to_epoch_timestamp(datetime_object):
def get_datetime_from_json(json_object, field_name):
try:
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