Message75625
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,
nongreedy
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)
else:
self.update(rawdata)
return |
|
Date |
User |
Action |
Args |
2008-11-08 00:44:35 | mixedpuppy | set | recipients:
+ mixedpuppy, rhymes, trentm |
2008-11-08 00:44:35 | mixedpuppy | set | messageid: <1226105075.83.0.521667156298.issue3073@psf.upfronthosting.co.za> |
2008-11-08 00:44:34 | mixedpuppy | link | issue3073 messages |
2008-11-08 00:44:34 | mixedpuppy | create | |
|