Kurt McKee

lessons learned in production


Hey there! This article was written in 2012.

It might not have aged well for any number of reasons, so keep that in mind when reading (or clicking outgoing links!).

Announcing feedparser 5.1.1

Posted 20 March 2012 in feedparser and release

I'm pleased to announce the release of feedparser 5.1.1!

This release contains a number of important changes that range from fixed crasher bugs to improved date and time string parsing. There are also some bug fixes that affect how various elements are parsed.

Unit test fixes

Several Linux distribution maintainers came forward after the last release and pointed out issues that ranged from missing unit test files to failures that only seemed to occur on x64 platforms. I believe all of the issues have been ironed out in this release, so feedparser 5.1.1 shouldn't pose a problem to include in package repositories.

Parsing changes

This release contains a couple of changes to how certain elements are parsed.

The itunes:keywords element is now split on commas, not whitespace. This brings feedparser in line with the element's description on Apple's website.

Further, pubDate now maps to published rather than updated in the dictionary that feedparser returns. By mapping pubDate to published, its semantic meaning is retained, but developers may need to modify their software if they're only checking the updated key. One software developer already pointed out that old versions of his software will be affected by this change, so a temporary fix is in place to give developers time to change their software:

If updated does not exist, membership tests will always return False.

However, if updated does not exist, and
if published does exist, and
if the software accesses updated,
feedparser will return the contents of published.

Here's an example:

>>> from feedparser import FeedParserDict  
>>> d = FeedParserDict(published='pub')  
>>> 'updated' in d  
>>> d['updated']  
>>> d = FeedParserDict(published='pub', updated='today')  
>>> 'updated' in d  
>>> d['updated']  

Remember that this is only a stopgap measure. It's intended to help avoid affecting users, should they be using an old version of some software with a new version of feedparser. This hack will be removed in a future version of feedparser.

In conclusion

A big thank you to everyone who contributed to this release! As always, if you find an issue don't hesitate to file a report on the issue tracker.

☕ Like my work? I accept tips!