This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author dmbaggett
Recipients anadelonbrin, dmbaggett
Date 2009-05-12.20:00:42
SpamBayes Score 7.708264e-08
Marked as misclassified No
Message-id <1242158444.07.0.868789444011.issue917120@psf.upfronthosting.co.za>
In-reply-to
Content
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 atom-specials, which are
defined thus:

atom-specials   = "(" / ")" / "{" / SP / CTL / list-wildcards /
                  quoted-specials / resp-specials
list-wildcards  = "%" / "*"
quoted-specials = DQUOTE / "\"
resp-specials   = "]"

So I think this regex should do it:

mustquote = re.compile(r'[()\s%*"]|"{"|"\\"|"\]"')

Changing status to bug.
History
Date User Action Args
2009-05-12 20:00:44dmbaggettsetrecipients: + dmbaggett, anadelonbrin
2009-05-12 20:00:44dmbaggettsetmessageid: <1242158444.07.0.868789444011.issue917120@psf.upfronthosting.co.za>
2009-05-12 20:00:43dmbaggettlinkissue917120 messages
2009-05-12 20:00:42dmbaggettcreate