Kurt McKee

lessons learned in production

Archive

Hey there! This article was written in 2010.

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

Porting feedparser to Python 3

Posted 19 November 2010 in feedparser, programming, and python

Today I'm announcing I'm throwing my hat in the ring to port feedparser to Python 3. There's a ticket open regarding this at the feedparser bug tracker, but the person who's working on porting it appears to be writing Python 3 code instead of writing Python 2 code that the 2to3 tool can then convert.

I'm going to take the opposite approach -- which may not be workable -- and fix the Python 2 code so that it can be rewritten by the 2to3 tool. Here are my guiding principles:

  • Support Python 2.4 and up
  • Avoid rewriting code
  • Support BeautifulSoup and chardet later

I'll add other principles to this list as they occur to me.

I'm doing this because I've been unable to find any ongoing Python 3 porting efforts in the feedparser community. Sam Ruby toyed with it back in 2007, but I don't think his efforts have been incorporated back into the project in the intervening three years.

I'll have a github repository posted after my friend's wedding this weekend.

☕ Like my work? I accept tips!