From 12263ff02f931a0d33bf4073e6cbae50940346b1 Mon Sep 17 00:00:00 2001 From: Ozzieisaacs Date: Sun, 5 Jul 2020 13:55:59 +0200 Subject: [PATCH] Fix #1423 (OverflowError thrown during sync on some Linux Systems if one of the timestamps is outside range 1970 to 2038) --- cps/services/SyncToken.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cps/services/SyncToken.py b/cps/services/SyncToken.py index 2fe7fe95..f6db960b 100644 --- a/cps/services/SyncToken.py +++ b/cps/services/SyncToken.py @@ -48,7 +48,7 @@ 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, OSError): + except (KeyError, OSError, OverflowError): # OSError is thrown on Windows if timestamp is <1970 or >2038 return datetime.min