BUG: git-current crashing with "string index out of range"

Florin Boariu florin.ml at rootshell.ro
Fri Mar 29 20:09:09 GMT 2013


Hi everyone,

first off thanks for the great effort in making offlineimap such a nice
piece of software :-)

Then I'd like to report a bug: offlineimap in current debian wheezy
(6.3.4) seems to crash at selected messages from my (rather large, ~7000
messages) mailbox with a strange error in folder/IMAP.py:

>  data = data[0][1].replace("\r\n", "\n")
>   IndexError: string index out of range

The problem persists with the (current?) git version, apparently
6.5.5-rc2. Simple "print"-based debugging indicates that reason for the
problem is probably a malformed message or a dropped connection of my IMAP
server. In any case, it happens reproducibly at several messages, always
at the _same_ messages, and at apparently this is because the data
returned by imapobj.uid() in IMAPFolder.getmessage() looks like:

>   [')']

instead of what the code expects:

> [('...', '...')]

The attached patch seems to... let's say "work around" :-) the problem by
checking for this specific case and resetting the data variable to a sane
value. I don't know the offlineimap internals, so I'd expect that what I'm
doing is a veeery bad and ugly fix, but it keeps things rolling for my
particular case.

If I can help you further, let me know.

I'm not on the mailing list, so I'd appreciate if people answering to this
email would be kind enough to include me in CC.

Thanks again & have a nice holiday,

Florin.








More information about the OfflineIMAP-project mailing list