From 6a85dc823222494d9d2f5cd98efd1a0666b0bd82 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Mon, 10 Dec 2012 20:07:35 -0500 Subject: [PATCH] feed: fix id fallback in Feed._process_entry The old `entry['id'] or _id` raised a KeyError when the entry lacked an ID. The new `entry.get('id', _id)` falls back appropriately. Signed-off-by: W. Trevor King --- rss2email/feed.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rss2email/feed.py b/rss2email/feed.py index 9b129c8..3c6513d 100644 --- a/rss2email/feed.py +++ b/rss2email/feed.py @@ -382,7 +382,7 @@ class Feed (object): # If .trust_guid isn't set, we get back hashes of the content. # Instead of letting these run wild, we put them in context # by associating them with the actual ID (if it exists). - guid = entry['id'] or id_ + guid = entry.get('id', id_) if isinstance(guid, dict): guid = guid.values()[0] if guid in self.seen: -- 2.26.2