#49 CVS libgmail doesn't work with new GMail


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.

3. Tries to parse the retrieved page, which is totally bogus. On one attempt, it was the login page. On another, a frameset page with "you must enable Javascript"-style text. Both failed to parse. When run under pdb, we get things like:

-> self._cachedQuotaInfo = items[D_QUOTA]
KeyError: ('qu',)

-> self._cachedLabelNames = [category[CT_NAME] for category in items[D_CATEGORIES][0]]
KeyError: ('ct',)

and, the important bit:

-> addresses = myData['cl']
KeyError: ('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.


  • Waseem Daher

    Waseem Daher - 2008-04-04
    • assigned_to: nobody --> wdaher
    • status: open --> closed-duplicate
  • Waseem Daher

    Waseem Daher - 2008-04-04

    Logged In: YES
    Originator: NO

    I believe that this is a duplicate of 1831375.
    That is, solving that should fix this.


Log in to post a comment.