Ticket #29 (closed defect: fixed)
fetch ENVELOPE doesn't work with gmail
| Reported by: | eichin@… | Owned by: | menno |
|---|---|---|---|
| Priority: | critical | Milestone: | 0.6 |
| Version: | Keywords: | gmail | |
| Cc: | eichin@… |
Description (last modified by menno) (diff)
>>> server.select_folder('william')
7L
>>> server.fetch(1, ("ENVELOPE",))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "imapclient/imapclient.py", line 436, in fetch
return parser(data)
File "imapclient/imapclient.py", line 573, in parse
msgid, data = self.parse_data(response_item)
File "imapclient/imapclient.py", line 614, in parse_data
for name, item in FetchTokeniser().process_pairs(data):
File "imapclient/imapclient.py", line 699, in process_pairs
for m in strict_finditer(self.PAIR_RE, s):
File "imapclient/imapclient.py", line 763, in strict_finditer
"%r before -- %r remains" % (s[:i], s[i:]))
ValueError: failed to match all of input. 'UID 1 ENVELOPE ("Fri, 16 Jul 2004 15:59:43 -0400" "on my way" (("Mark Eichin" NIL "eichin" "gmail.com")' before -- ') (("Mark Eichin" NIL "eichin" "gmail.com")) (("Mark Eichin" NIL "eichin" "gmail.com")) (("Other Person" NIL "..." "...")) NIL NIL NIL "<f2e30b5f04071612593d641920@mail.gmail.com>")' remains
(email address parts elided from one of the strings, but the match has already failed at that point. Also, this is with strict_finditer tweaked as-shown so you can see the successful part of the match as well as the failed part...)
It appears that this is what keeps fetch(1, ("ALL",)) from working, as well, it hits the ValueError in the same place at least, and the other parts of ALL work when fetched individually.
Change History
Note: See
TracTickets for help on using
tickets.
