Small fix broken cookie parse
authornonm <shemooneed+gh@gmail.com>
Mon, 18 Nov 2013 21:32:59 +0000 (13:32 -0800)
committernonm <shemooneed+gh@gmail.com>
Mon, 18 Nov 2013 21:32:59 +0000 (13:32 -0800)
requests/cookies.py

index 12245fc56362da0bc6d56ff3af4d70264ac5bf73..a4140adff2cc6af62522dba4269602bf386a7f5c 100644 (file)
@@ -278,7 +278,7 @@ class RequestsCookieJar(cookielib.CookieJar, collections.MutableMapping):
         remove_cookie_by_name(self, name)
 
     def set_cookie(self, cookie, *args, **kwargs):
-        if cookie.value.startswith('"') and cookie.value.endswith('"'):
+        if hasattr(cookie.value, 'startswith') and cookie.value.startswith('"') and cookie.value.endswith('"'):
             cookie.value = cookie.value.replace('\\"', '')
         return super(RequestsCookieJar, self).set_cookie(cookie, *args, **kwargs)