kurtmckee/feedparser

should entry.tags be defined even when empty?

JoeGermuska opened this issue · 1 comments

I have two different RSS feeds, both of which have a number of elements at the xpath /rss/channel/item/category, which, according to the docs, is one source for tags (categories) on elements.

However, when feedparser parses them, entries from one have tags, and entries from the other do not.

This feed, https://seekingalpha.com/feed.xml, comes up with plentiful tags, even though the RSS does not validate
This feed, https://rss.nytimes.com/services/xml/rss/nyt/World.xml, throws AttributeError when entry.tags is accessed, even though the RSS does validate.

Am I missing something? Is it a bug?

My bad... I didn't read the feed XML carefully, and it just so happened that the first element in the NYT feed didn't have categories.

So I guess I was surprised that the parsed feed entry throws AttributeException when there are no tags, instead of returning an empty list.