How to fix offlineimap MacPorts on SnowLeopard
OfflineImap is one of the few things which Snow Leopard has broken.
The problem is somehow related to a file called _locale.py in the OS X distribution
of Python 2.6. The same problem occurs in the distribution of Python 2.6 used by
MacPorts. Some but not all Python apps will be affected.
I'm guessing that both Python and MacPorts will fix this when Python 2.6.3 comes
out.
Here's how to solve it now:
1. You need to compile Python from source by downloading the latest version
from SVN.
>> http://svn.python.org/projects/python/branches/release26-maint
check it out, configure, make, make install. It should Just Work.
2. Best to check out the latest version of OfflineIMAP also - you need to use
Git to access it.
>> git clone git://git.complete.org/offlineimap
then use sudo python setup.py install
3. Then fix your PATH to make sure you are using the version of python loaded
into /usr/local/bin rather than /opt or /usr/bin. Don't worry if you are
invoking this manually - I'm just invoking offlineimap by using
>> /usr/local/bin/python ~/code/offlineimap/offlineimap.py
because, well, it's only going to be temporary - when the next version of
Python comes out, I'll be getting that from MacPorts.
That'll be soon, ...right? ;)
== See also
http://bugs.python.org/issue6997
http://www.sturmnet.org/blog/2009/09/01/an-evening-of-fun-with-snow-leopard