Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#49 CVS libgmail doesn't work with new GMail

closed-duplicate
Waseem Daher
None
5
2008-04-04
2007-12-04
k3rni
No

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]
(Pdb)
KeyError: ('qu',)

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

and, the important bit:

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

Discussion

  • 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
    user_id=338872
    Originator: NO

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