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.
@@ -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
