jenkins-bot has submitted this change and it was merged.
Change subject: Set Session.cookies ......................................................................
Set Session.cookies
This reverts an unrelated and unnecessary change in 8624ddec14.
Bug: T110354 Change-Id: I25119aaf11366902985579eed28dc80294fcd2e5 --- M pywikibot/comms/http.py 1 file changed, 4 insertions(+), 4 deletions(-)
Approvals: XZise: Looks good to me, approved Malafaya: Checked jenkins-bot: Verified
diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py index 39d4d4a..835202f 100644 --- a/pywikibot/comms/http.py +++ b/pywikibot/comms/http.py @@ -64,8 +64,6 @@ 'two.') pywikibot.config2.socket_timeout = min(pywikibot.config2.socket_timeout)
-session = requests.Session() - cookie_jar = cookielib.LWPCookieJar( config.datafilepath('pywikibot.lwp')) try: @@ -74,6 +72,9 @@ pywikibot.debug(u"Loading cookies failed.", _logger) else: pywikibot.debug(u"Loaded cookies from file.", _logger) + +session = requests.Session() +session.cookies = cookie_jar
# Prepare flush on quit @@ -284,7 +285,6 @@ auth = None else: auth = requests_oauthlib.OAuth1(*auth) - cookies = cookie_jar timeout = config.socket_timeout try: ignore_validation = http_request.kwargs.pop( @@ -293,7 +293,7 @@ # HTTPS request can succeed even if the certificate is invalid and # verify=True, when a request with verify=False happened before response = session.request(method, uri, data=body, headers=headers, - cookies=cookies, auth=auth, timeout=timeout, + auth=auth, timeout=timeout, verify=not ignore_validation) except Exception as e: http_request.data = e
pywikibot-commits@lists.wikimedia.org