Python libgmail wrong username/password

I have a script that I wrote in 2008 that uses the libgmail Python library to programmatically download attachments from a gmail account based on the label applied to the message. The script has worked great for the last two years, but did not work when I fired it up this year.

Google has changed the way the GMail login flow works. When I attempted to run the script, I got this message:

libgmail.GmailLoginFailure: ‘Login failed. (Wrong username/password?)’

It appears that libgmail is no longer actively supported. However, a fellow named Anton Solovyev wrote a patch to libgmail that fixes its login flow to work with current gmail (as of February 2010, anyway). That patch is available here:

http://home.comcast.net/~anton.solovyev//hacks/#libgmail

Works like a charm.