libo26 / feedparser

Automatically exported from code.google.com/p/feedparser
Other
0 stars 0 forks source link

entries[i].category throws an error when a category isn't not in the feed. #212

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Parse a feed without a category
2. Access entries[i].category

What is the expected output? What do you see instead?
entries[i].category == None

What version of the product are you using? On what operating system?
4.1

Original issue reported on code.google.com by eric.moritz on 9 Apr 2010 at 5:45

GoogleCodeExporter commented 9 years ago
Thanks for reporting this.

FeedParser users are strongly encouraged to test for the existence of optional
elements before trying to use them: 
http://feedparser.org/docs/basic-existence.html

You're also strongly encouraged to use entries[i].categories where possible 
since
feeds and entries can have multiple categories.

I'm marking this as WontFix but I'll happily re-open it if:
- you can tell me what the error is and why it's not something that a user could
reasonably be expected to detect.
- you have an example feed
- you have a suggestion for an improvement we can make to the documentation 
that will
make this clearer

Original comment by adewale on 15 Apr 2010 at 3:07