From 3ef49272f2ff7bef67c8b53bcfba9c3a2ecfa9c7 Mon Sep 17 00:00:00 2001 From: Laurent Bachelier Date: Wed, 14 Feb 2018 15:26:13 +0100 Subject: [PATCH] Copy cookie policy when copying a CookieJar Without it, the cookie policy would get lost while making a request. That would be invisible to the user if the default cookie policy wasn't changed, of course. --- requests/cookies.py | 1 + 1 file changed, 1 insertion(+) diff --git a/requests/cookies.py b/requests/cookies.py index ab3c88b9..5d89da2f 100644 --- a/requests/cookies.py +++ b/requests/cookies.py @@ -415,6 +415,7 @@ class RequestsCookieJar(cookielib.CookieJar, collections.MutableMapping): def copy(self): """Return a copy of this RequestsCookieJar.""" new_cj = RequestsCookieJar() + new_cj.set_policy(self._policy) new_cj.update(self) return new_cj