bamthomas / aioimaplib

Python asyncio IMAP4rev1 client library
GNU General Public License v3.0
138 stars 59 forks source link

AttributeError: 'NoneType' object has no attribute 'append_to_resp' #11

Closed orf closed 8 years ago

orf commented 8 years ago

Nice library! I'm trying to use it to fetch some GMail messages like so:

res, data = await client.fetch('1:*', '(BODY[HEADER.FIELDS (SUBJECT FROM)])')

This fails with:

AttributeError: 'NoneType' object has no attribute 'append_to_resp'

At this line: https://github.com/bamthomas/aioimaplib/blob/9f4355b8eecb622a50c2f57910f19c3bad036717/aioimaplib/aioimaplib.py#L449

bamthomas commented 8 years ago

ok this is a case not well handled. There is a log in case pending_async_command is none but we try to append something to None with pending_async_command.append_to_resp(text). I'll try to add a test case. Thank you for the feedback. Actually I'm in vacation, but I'll deal with that ASAP. I have a gmail account, I'll try to make a manual test with it.

bamthomas commented 8 years ago

fixed with https://github.com/bamthomas/aioimaplib/commit/f6bf34e6a17a3eaedbe858cceaf4bb5a3d2f64af