Catch cookie errors.
authorFredrik Tolf <fredrik@dolda2000.com>
Mon, 31 Oct 2011 08:09:03 +0000 (09:09 +0100)
committerFredrik Tolf <fredrik@dolda2000.com>
Mon, 31 Oct 2011 08:09:03 +0000 (09:09 +0100)
wrw/cookie.py

index 2c6f982..37e8708 100644 (file)
@@ -9,7 +9,10 @@ def addcookies(req):
 
 class cookiedict(object):
     def __init__(self, req):
 
 class cookiedict(object):
     def __init__(self, req):
-        self.bk = Cookie.SimpleCookie(req.ihead.get("Cookie"))
+        try:
+            self.bk = Cookie.SimpleCookie(req.ihead.get("Cookie"))
+        except Cookie.CookieError:
+            self.bk = Cookie.SimpleCookie()
         self.codec = Cookie.SimpleCookie()
         req.oncommit(addcookies)
 
         self.codec = Cookie.SimpleCookie()
         req.oncommit(addcookies)