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 mixedpuppy
Recipients mixedpuppy, rhymes, trentm
Date 2008-11-08.00:44:34
SpamBayes Score 3.50118e-07
Marked as misclassified No
Message-id <>
The problem is that spaces are not allowed in the attribute values. 
Here is a work around

# hack fix of Cookie.BasicCookie
import Cookie
import re
_LegalCharsPatt  = r"\w\d!#%&'~_`><@,:/\$\*\+\-\.\^\|\)\(\?\}\{\="
_FixedCookiePattern = re.compile(
    r"(?x)"                       # This is a Verbose pattern
    r"(?P<key>"                   # Start of group 'key'
    "["+ _LegalCharsPatt +"]+?"     # Any word of at least one letter,
    r")"                          # End of group 'key'
    r"\s*=\s*"                    # Equal Sign
    r"(?P<val>"                   # Start of group 'val'
    r'"(?:[^\\"]|\\.)*"'            # Any doublequoted string
    r"|"                            # or
    "["+ _LegalCharsPatt +"\ ]*"        # Any word or empty string
    r")"                          # End of group 'val'
    r"\s*;?"                      # Probably ending in a semi-colon

class FixedCookie(Cookie.SimpleCookie):
    def load(self, rawdata):
        """Load cookies from a string (presumably HTTP_COOKIE) or
        from a dictionary.  Loading cookies from a dictionary 'd'
        is equivalent to calling:
            map(Cookie.__setitem__, d.keys(), d.values())
        if type(rawdata) == type(""):
            self._BaseCookie__ParseString(rawdata, _FixedCookiePattern)
Date User Action Args
2008-11-08 00:44:35mixedpuppysetrecipients: + mixedpuppy, rhymes, trentm
2008-11-08 00:44:35mixedpuppysetmessageid: <>
2008-11-08 00:44:34mixedpuppylinkissue3073 messages
2008-11-08 00:44:34mixedpuppycreate