From c821ab999b242efbf69ee8e1bc8a20b050f9faea Mon Sep 17 00:00:00 2001 From: Sandra Snan Date: Sun, 24 Sep 2023 00:35:39 +0200 Subject: [PATCH] Fix crash on weird date time Solution found by danschwarz --- toot/entities.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toot/entities.py b/toot/entities.py index 739b962..5125074 100644 --- a/toot/entities.py +++ b/toot/entities.py @@ -394,7 +394,7 @@ def _convert(field_type, value): return datetime.strptime(value, "%Y-%m-%dT%H:%M:%S.%f%z") if field_type == date: - return date.fromisoformat(value) + return datetime.fromisoformat(value).date() if get_origin(field_type) == list: (inner_type,) = get_args(field_type)