Menu

#22 _LabelHandlerMixin.addLabel throwing exception

open
nobody
None
5
2006-04-11
2006-04-11
Anonymous
No

I'll report with an example:
$ python gcp.py /cygdrive/d/dip.zip xxxxxxxx:test
Password:

Please wait, logging in...
Log in successful.

Traceback (most recent call last):
File "gcp.py", line 62, in ?
if ga.storeFile(filename, label=label):
File "/cygdrive/p/python/libgmail-0.1.4/libgmail.py",
line 730, in storeFile
draftMsg.addLabel(label)
File "/cygdrive/p/python/libgmail-0.1.4/libgmail.py",
line 1229, in addLabel
if not self._labels:
AttributeError: 'GmailMessageStub' object has no
attribute '_labels'

Looks like the following test on line 1229 is causing
the problem:
if not self._labels:

I tested the gcp.py program under cygwin and vanilla
python for windows (both version 2.4)

The previous version of libgmail (0.1.3.3) works fine
in this case.

Discussion

  • Nobody/Anonymous

    Logged In: NO

    You can fix this by performing the test like this:

    if not hasattr(self, '_labels'):

     
  • klnavarro

    klnavarro - 2006-08-08

    Logged In: YES
    user_id=1571626

    In fact the problem come from the fact that the _labels
    attribute is not created and not accessible !)

     

Log in to post a comment.