Skip to content
Myr

Allow RequestsCookieJar to be updated with cookies from a CookieJar

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Chase Sterling · committed by Chase Sterling · parent f73bda0 · Browse files · 1 file+8 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+8 added−0 removed

  • other:+8 added−0 removed

1 file+8 added−0 removed

modified:requests/cookies.py+8 added
256 unmodified lines
257 def __delitem__(self, name):258 """Deletes a cookie given a name. Wraps cookielib.CookieJar's remove_cookie_by_name()."""259 remove_cookie_by_name(self, name)260261 def update(self, other):262 """Updates this jar with cookies from another CookieJar or dict-like"""263 if isinstance(other, cookielib.CookieJar):264 for cookie in other:265 self.set_cookie(cookie)266 else:267 super(RequestsCookieJar, self).update(other)268269 def _find(self, name, domain=None, path=None):270 """Requests uses this method internally to get cookie values. Takes as args name271 and optional domain and path. Returns a cookie.value. If there are conflicting cookies,272 _find arbitrarily chooses one. See _find_no_duplicates if you want an exception thrown
115 unmodified lines