New submission from Branden Moore <bmoore-pyt...@forkit.org>:

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!

----------
components: Library (Lib)
messages: 80480
nosy: bmoore
severity: normal
status: open
title: imaplib should remove length of literal strings
type: behavior
versions: Python 2.4, Python 2.5, Python 2.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue5045>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to