When parsing a feed update: don't die if the version field is unset.
authorNeal H. Walfield <neal@walfield.org>
Sat, 5 Nov 2011 11:20:53 +0000 (12:20 +0100)
committerNeal H. Walfield <neal@walfield.org>
Sat, 5 Nov 2011 11:20:53 +0000 (12:20 +0100)
src/rss_sqlite.py

index ed6ac3b..c388617 100644 (file)
@@ -392,13 +392,13 @@ class Feed(BaseObject):
                 logger.debug("%s: No changes to feed." % (self.key,))
                 mainthread.execute(wc_success, async=True)
                 success = True
-            elif len(tmp["entries"])==0 and not tmp.version:
+            elif len(tmp["entries"])==0 and not tmp.get('version', None):
                 # An error occured fetching or parsing the feed.  (Version
                 # will be either None if e.g. the connection timed our or
                 # '' if the data is not a proper feed)
                 logger.error(
                     "Error fetching %s: version is: %s: error: %s"
-                    % (url, str (tmp.version),
+                    % (url, str (tmp.get('version', 'unset')),
                        str (tmp.get ('bozo_exception', 'Unknown error'))))
                 logger.debug(tmp)
                 def register_stream_update_failed(http_status):