From: Fredrik Tolf Date: Mon, 31 Oct 2011 08:09:03 +0000 (+0100) Subject: Catch cookie errors. X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=8204ad1dbc40518b46426f4c34f3d71736dc0e48;p=wrw.git Catch cookie errors. --- diff --git a/wrw/cookie.py b/wrw/cookie.py index 2c6f982..37e8708 100644 --- a/wrw/cookie.py +++ b/wrw/cookie.py @@ -9,7 +9,10 @@ def addcookies(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)