Since the latest GMail update, working with libgmail is somewhat hard.
Testing on a number of accounts show that, after I log in with Opera (which the new interface doesn't support, and hence switches to the old one), libgmail can retrieve the contact list. After logging in with Firefox however, libgmail complains with
<type 'exceptions.KeyError'>: 'cl'
A cryptic error message, to be sure. Tracing that, I found that getContacts does the following:
1. Constructs a URL, using myUrl = _buildURL(view='cl',search='contacts', pnl='a')
I believe it should also include a 'fs=1', but I'm not sure on this.
2. Calls _parsePage, which does a _retrievePage, which in turn opens the above mentioned URL, adding some cookies from login.
-> self._cachedQuotaInfo = items[D_QUOTA]
-> self._cachedLabelNames = [category[CT_NAME] for category in items[D_CATEGORIES]]
and, the important bit:
-> addresses = myData['cl']
However, as mentioned above, it all works if you access your account before with a browser not supported by the new interface. Changing the interface language mostly doesn't help.
The fact that we get a login page might hint that libgmail isn't gathering and sending correct cookies. Manual inspection (libgmail cookies under pdb vs. GMail cookies under Firefox Web Developer) shows some missing.