Skip to content
Myr

Fix crash when session.cookies was not a RequestsCookieJar

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 1866f75 · Browse files · 1 file+4 added−2 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+4 added−2 removed

  • other:+4 added−2 removed

1 file+4 added−2 removed

modified:requests/sessions.py+4 added-2 removed
7 unmodified lines
8requests (cookies, auth, proxies).910"""11import os12from copy import copy13from datetime import datetime1415from .compat import cookielib16from .cookies import cookiejar_from_dict, extract_cookies_to_jar
268 unmodified lines
285 if not isinstance(cookies, cookielib.CookieJar):286 cookies = cookiejar_from_dict(cookies)287288 # Merge with session cookies288 merged_cookies = self.cookies.copy()289 merged_cookies.update(cookies)289 merged_cookies = copy(self.cookies)290 for cookie in cookies:291 merged_cookies.set_cookie(cookie)292 cookies = merged_cookies293294 # Gather clues from the surrounding environment.295 if self.trust_env:
213 unmodified lines