From 995daa2c07999cf02414c3a3ed0207b858f0d5d0 Mon Sep 17 00:00:00 2001 From: "Howie.Duan" Date: Sat, 29 Jul 2023 12:00:28 +0800 Subject: [PATCH] add a patch to fix the python issue29097, it will happen when using python 3.6 to python 3.7 just on windows. --- taos/field.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/taos/field.py b/taos/field.py index 9b7c2fb3..d4af9601 100644 --- a/taos/field.py +++ b/taos/field.py @@ -10,7 +10,10 @@ _priv_tz = None _utc_tz = pytz.timezone("UTC") -_datetime_epoch = datetime.fromtimestamp(0) +try: + _datetime_epoch = datetime.fromtimestamp(0) +except OSError: + _datetime_epoch = datetime.fromtimestamp(86400) - timedelta(seconds=86400) _utc_datetime_epoch = _utc_tz.localize(datetime.utcfromtimestamp(0))