[issue917120] imaplib: incorrect quoting in commands

2010-08-05 Thread Dave Baggett
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

[issue917120] imaplib: incorrect quoting in commands

2009-05-12 Thread Dave Baggett
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

[issue917120] imaplib: incorrect quoting in commands

2009-05-12 Thread Dave Baggett
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

[issue5803] email/quoprimime: encode and decode are very slow on large messages

2009-04-21 Thread Dave Baggett
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

[issue5803] email/quoprimime: encode and decode are very slow on large messages

2009-04-21 Thread Dave Baggett
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

[issue5803] email/quoprimime: encode and decode are very slow on large messages

2009-04-20 Thread Dave Baggett
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

[issue5803] email/quoprimime: encode and decode are very slow on large messages

2009-04-20 Thread Dave Baggett
Changes by Dave Baggett jyt...@baggett.org: -- type: - performance ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5803 ___ ___ Python-bugs-list