[MERGE] Fix ability to use IIS as a dumb HTTP server. (fixes #247585)

Stephen J. Turnbull stephen at xemacs.org
Mon Jul 14 19:04:29 BST 2008


Adrian Wilkins writes:

 > The problem in the Python lib is that the rfc822.unquote() function
 > considers <this> to be a quoted string, when the standard doesn't.

This is an evil hack indeed.

 > rfc822.py:unquote() DOES treat angle brackets as quote characters, along
 > with a note that their implementation isn't conforming to the standard.
 > I think the standard lib clearly is wrong, and also knows it.
 > 
 > {{{ python25\lib\rfc822.py:646
 > # XXX Should fix unquote() and quote() to be really conformant.
 > # XXX The inverses of the parse functions may also be useful.
 > 
 > 
 > def unquote(s):
 >     """Remove quotes from a string."""
 >     if len(s) > 1:
 >         if s.startswith('"') and s.endswith('"'):
 >             return s[1:-1].replace('\\\\', '\\').replace('\\"', '"')
 >         if s.startswith('<') and s.endswith('>'):
 >             return s[1:-1]
 >     return s
 > 
 > }}}

That's hideous.  It will reduce '''"<this>"''' to '''this'''.  What in
the world are they trying to do?  Surely the intent of quoting in that
example is to protect the angle brackets from being stripped.

 > Alas, tinkering with parts of the standard library is rather more risky
 > than dealing with it further downstream, and rather less practical in
 > terms of rapid resolution.

Well, (1) I know that Barry Warsaw wants the email library updated,
although I don't know how exactly how he feels about that being done
in the 2.6/3.0 release cycle; it is still possible, though.  (2)
Mailman was distributed with a variant version of email for years, so
there's precedent for that.  Threaten Barry with that happening to bzr
and you might get some fast action.<wink>




More information about the bazaar mailing list