Skip to content

Conversation

@tclancy
Copy link

@tclancy tclancy commented Jan 13, 2017

This pull request includes a new exception type to raise when attachment parsing does not work and a hook to ignore attachment parsing entirely as a work-around. There's a little bit of PEP8 cleanup as well. Not sure anyone else will actually need this but I figured I'd make it available as a result of running into an exception like the following:

  File "/path/venv/lib/python2.7/site-packages/gmail/mailbox.py", line 74, in mail
    self.messages.update(self.gmail.fetch_multiple_messages(messages_dict))
  File "/path/venv/lib/python2.7/site-packages/gmail/gmail.py", line 156, in fetch_multiple_messages
    messages[uid].parse(raw_message)
  File "/path/venv/lib/python2.7/site-packages/gmail/message.py", line 173, in parse
    if not isinstance(attachment, basestring) and attachment.get('Content-Disposition') is not None
  File "/path/venv/lib/python2.7/site-packages/gmail/message.py", line 223, in __init__
    self.size = int(round(len(self.payload)/1000.0))
TypeError: object of type 'NoneType' has no len()

@tclancy tclancy closed this Jan 13, 2017
@tclancy
Copy link
Author

tclancy commented Jan 13, 2017

Declining in favor of #73

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant