From 33d3ad2a1af226a950838f76b97109febdce36b5 Mon Sep 17 00:00:00 2001 From: Sam Ruby Date: Fri, 14 May 2010 15:38:44 -0400 Subject: [PATCH] Be more resilient on HTTP errors --- planet/spider.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/planet/spider.py b/planet/spider.py index 59afcb6..9034add 100644 --- a/planet/spider.py +++ b/planet/spider.py @@ -125,7 +125,7 @@ def writeCache(feed_uri, feed_info, data): log.info("Updating feed %s", feed_uri) # if read failed, retain cached information - if not data.version and feed_info.version: + if not data.has_key('version') and feed_info.has_key('version'): data.feed = feed_info.feed data.bozo = feed_info.feed.get('planet_bozo','true') == 'true' data.version = feed_info.feed.get('planet_format') @@ -147,7 +147,7 @@ def writeCache(feed_uri, feed_info, data): data.feed['planet_content_hash'] = data.headers['-content-hash'] # capture feed and data from the planet configuration file - if data.version: + if data.has_key('version') and data.version: if not data.feed.has_key('links'): data.feed['links'] = list() feedtype = 'application/atom+xml' if data.version.startswith('rss'): feedtype = 'application/rss+xml'