Message124178
| Author |
r.david.murray |
| Recipients |
BM, BreamoreBoy, aclover, akuchling, dstanek, georg.brandl, jerry.seutter, jjlee, r.david.murray, tim.peters |
| Date |
2010年12月17日.03:33:49 |
| SpamBayes Score |
2.9057162e-07 |
| Marked as misclassified |
No |
| Message-id |
<1292556831.49.0.624167864704.issue2193@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Seems like this really needs a strict and a lax mode. Perhaps a BrowserCookie class that implements the relaxed rules?
That would make this a feature request, though, and so nothing would happen until 3.3, which would be unfortunate.
It is certainly possible to create a more relaxed version for your own use. It seems to me that (untested):
class BrowserCookie(BaseCookie):
def set(self, key, val, coded_val, LegalChars=_LegalChars+':'):
super().set(key, val, coded_val, LegalChars)
would do most of what And Clover wants (not adding or stripping quotes or doing backslash quoting or encoding, accepting : in key names (and more characters could be added; the regex in the parsing step is fairly liberal)).
Making further relaxations is difficult without poking in to module internals, though. |
|