Author bmoore
Recipients bmoore
Date 2009-01-24.21:17:39
SpamBayes Score 1.7847e-06
Marked as misclassified No
Message-id <1232831861.1.0.505003833235.issue5045@psf.upfronthosting.co.za>
In-reply-to
Content
IMAP Literals are a tricky subject.  Currently, if IMAP returns:

* text text text {5}\r\n
12345more text

imaplib will return 2 data items:
[("text text text {5}", '12345'), "more text"]

This forces users of imaplib to then parse out and remove the '{5}' from
the first part of the tuple before appending the literal string.  It
would be nice to have imaplib strip the '{size}' portion of the string
in the first part of the tuple, so that the return value would be:
[("text text text ", '12345'), "more text"]

Though, because this entire response from the IMAP server should be
interpreted as a single line, it would be even better to return a
response such that 'data' is:
[(("text text text ", '12345'), "more text")]

a.k.a., a single 'data' item (only one IMAP response per data item) that
contains either a string or a tuple.  The tuple will contain either more
tuples and/or more strings.  Each sub-tuple here would contain two
strings, text, and the IMAP Literal String.

This would make parsing the responses from imaplib much more simple.  It
demarks obviously where IMAP Literal Strings are, and doesn't require
additional string parsing on the side of the imaplib user.

Thanks!
History
Date User Action Args
2009-01-24 21:17:41bmooresetrecipients: + bmoore
2009-01-24 21:17:41bmooresetmessageid: <1232831861.1.0.505003833235.issue5045@psf.upfronthosting.co.za>
2009-01-24 21:17:40bmoorelinkissue5045 messages
2009-01-24 21:17:39bmoorecreate