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 12245fc..a4140ad 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)