Open adrianratnapala opened 12 years ago
Same issue, with 1ad407e on python 2.6.6 :
Traceback (most recent call last):
File "./imap2maildir", line 579, in <module>
main()
File "./imap2maildir", line 560, in main
seencache=seencache)
File "./imap2maildir", line 475, in copy_messages_by_folder
for i in folder.Summaries(search=search):
File "/root/rtucker-imap2maildir-1ad407e/simpleimap.py", line 421, in Summaries
summ = self.__parent.get_summary_by_uid(u)
File "/root/rtucker-imap2maildir-1ad407e/simpleimap.py", line 307, in get_summary_by_uid
return self.parse_summary_data(data)
File "/root/rtucker-imap2maildir-1ad407e/simpleimap.py", line 326, in parse_summary_data
fetchresult = self.parseFetch(data[0])
File "/root/rtucker-imap2maildir-1ad407e/simpleimap.py", line 57, in parseFetch
simple = simple_re.match(text[pos:])
TypeError: expected string or buffer
When trying imap2maildir for the first time, I find it first downloads many (perhaps all) all of the messages and then crashes with the exception.
If I repeat it, then it crashes immediately (although if new messages have appeared in the meantime it might download them, I haven't checked). I am running commit 9d8a6efd3, under Python v 2.7.2, on Ubuntu 11.10, the connection is IMAP over SSL.
I'd send a more complete log and a stack trace if I knew where to post it, but in short, the problem is that the "text" parameter to
__simplebase.parseFetch
is a tuple rather than a string. the value is:This tuple is the first "data" element returned from the FETCH command in get_summary_by_uid. My reading of the imaplib documentation makes me expect a tuple in this situation (although unbalanced parentheses in text[0] surprises me).
Finally I can't get away with simple tricks like, sending data[0][0] or ' '.join(data[0]) to parseFetch -- there seems to be some nontrivial change in format. My imaplib.py says it's version is 2.58
Cheers.