charlierguo / gmail

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

added support for python 3 #78

Closed girishramnani closed 7 years ago

zevaverbach commented 7 years ago

@girishramnani the README instructions don't work with this branch. g.inbox() results in None, but you can get it with g.mailbox(bytes('INBOX', 'ascii'). However, from there, Mailbox.mail() produces the following error:

     68         if response == 'OK':
     69             # filter out empty strings
---> 70             uids = [_f for _f in data[0].split(' ') if _f]
     71 
     72             for uid in uids:

TypeError: a bytes-like object is required, not 'str'
zevaverbach commented 7 years ago

@girishramnani got it working on Python 3 here, but not very gracefully. Perhaps there are enough bread crumbs to make your PR work? :-)

girishramnani commented 7 years ago

will open a new PR after some refactors. :-)