From 8204ad1dbc40518b46426f4c34f3d71736dc0e48 Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Mon, 31 Oct 2011 09:09:03 +0100 Subject: [PATCH] Catch cookie errors. --- wrw/cookie.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) -- 2.11.0