charlierguo / gmail

A Pythonic interface for Google Mail
MIT License
1.77k stars 385 forks source link

Bug: "object of type 'NoneType' has no len()" in mail.fetch() #57

Open Nico128 opened 9 years ago

Nico128 commented 9 years ago

Hi

I have a script that fetches my emails (more than 5000) and there is an issue with a specific email (maybe also with some others ?). Sorry I can only give you the error and not the content of the email because I don't know which one it is...

Traceback (most recent call last): File "get_emails_gmail.py", line 54, in mail.fetch() File "build\bdist.win-amd64\egg\gmail\message.py", line 181, in fetch self.parse(results[0]) File "build\bdist.win-amd64\egg\gmail\message.py", line 173, in parse if not isinstance(attachment, basestring) and attachment.get('Content-Disposition') is not None File "build\bdist.win-amd64\egg\gmail\message.py", line 223, in init self.size = int(round(len(self.payload)/1000.0)) TypeError: object of type 'NoneType' has no len()