From 4532e1bb4fe20413e186f47bae01abf631cc43a0 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sun, 9 Feb 2020 21:59:42 +0200 Subject: [PATCH] Handle ValueError in get_date. Fixes #11 --- rss/bot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rss/bot.py b/rss/bot.py index 3463e58..f838273 100644 --- a/rss/bot.py +++ b/rss/bot.py @@ -135,11 +135,11 @@ class RSSBot(Plugin): def get_date(entry: Any) -> datetime: try: return datetime.fromtimestamp(mktime(entry["published_parsed"])) - except (KeyError, TypeError): + except (KeyError, TypeError, ValueError): pass try: return datetime.fromtimestamp(mktime(entry["date_parsed"])) - except (KeyError, TypeError): + except (KeyError, TypeError, ValueError): pass return datetime.now()