Dave Baggett added the comment:
Piers Lauder, author of imaplib, emailed me the following comment about this
bug:
The regex for "mustquote_cre" looks bizarre, and I regret to say I can
no longer remember its genesis.
Note however, that the term CTL in the RFC definition
Dave Baggett added the comment:
OK, I missed the initial caret in the regex. The mustquote regex is
listing everything that needn't be quoted, and then negating. I still
think it's wrong, though. According to BNF given in the Formal Syntax
section of RFC 3501, you must must quote ato
Dave Baggett added the comment:
I'm not sure this causes the behavior reported here, but I believe there
really is a bug in imaplib.
In particular, it seems wrong to me that this line:
mustquote = re.compile(r"[^\w!#$%&'*+,.:;<=>?^`|~-]")
has \w in it. Should th
Dave Baggett added the comment:
Yes, sorry, I meant "built-in list type" not "array". Your point about
using lists this way is valid, and is why I used array.array('c').
I will do as you suggest and try all three methods. I did time the
array.array approach vs. the
Dave Baggett added the comment:
I can certainly generate a patch for you. What form would you like it
in, and against what source tree? Also, do you have a preference between
the use of array.array vs. standard arrays? (I don't know whether it's
good or bad to depend on "i
Changes by Dave Baggett :
--
type: -> performance
___
Python tracker
<http://bugs.python.org/issue5803>
___
___
Python-bugs-list mailing list
Unsubscri
New submission from Dave Baggett :
The implementation of encode and decode are slow, and scale nonlinearly
in the size of the message to be encoded/decoded.
A simple fix is to use an array.array('c') and append to it, rather
than using string concatenation. This change makes the code