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 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.
History
Date User Action Args
2010-12-17 03:33:51r.david.murraysetrecipients: + r.david.murray, tim.peters, akuchling, georg.brandl, jjlee, dstanek, jerry.seutter, BM, aclover, BreamoreBoy
2010-12-17 03:33:51r.david.murraysetmessageid: <1292556831.49.0.624167864704.issue2193@psf.upfronthosting.co.za>
2010-12-17 03:33:49r.david.murraylinkissue2193 messages
2010-12-17 03:33:49r.david.murraycreate