Dave Baggett jyt...@baggett.org 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
Dave Baggett jyt...@baggett.org 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 that be \s?
I
Dave Baggett jyt...@baggett.org 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
Dave Baggett jyt...@baggett.org 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 import
Dave Baggett jyt...@baggett.org 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 one currently
New submission from Dave Baggett jyt...@baggett.org:
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
Changes by Dave Baggett jyt...@baggett.org:
--
type: - performance
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5803
___
___
Python-bugs-list