Skip to content
Myr

Fix session CookieJars without breaking more stuff this time

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 a7fef58 · Browse files · 1 file+4 added−5 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−5 removed

  • other:+4 added−5 removed

1 file+4 added−5 removed

modified:requests/sessions.py+4 added-5 removed
7 unmodified lines
8requests (cookies, auth, proxies).910"""11import os12from copy import copy12from datetime import datetime1314from .compat import cookielib16from .cookies import cookiejar_from_dict, extract_cookies_to_jar15from .cookies import cookiejar_from_dict, extract_cookies_to_jar, RequestsCookieJar16from .models import Request, PreparedRequest17from .hooks import default_hooks, dispatch_hook18from .utils import from_key_val_list, default_headers19from .exceptions import TooManyRedirects, InvalidSchema
264 unmodified lines
284 if not isinstance(cookies, cookielib.CookieJar):285 cookies = cookiejar_from_dict(cookies)286287 # Merge with session cookies289 merged_cookies = copy(self.cookies)290 for cookie in cookies:291 merged_cookies.set_cookie(cookie)288 merged_cookies = RequestsCookieJar()289 merged_cookies.update(self.cookies)290 merged_cookies.update(cookies)291 cookies = merged_cookies292293 # Gather clues from the surrounding environment.294 if self.trust_env:
213 unmodified lines