jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/401116 )
Change subject: comms.http: Include HttpRequest.kwargs in session.request call
......................................................................
comms.http: Include HttpRequest.kwargs in session.request call
Include threadedhttp.HttpRequest.kwargs in session.request call in
`_http_process()`.
Before this HttpRequest.kwargs didn't get into session.request call
so if we call a function like `pywikibot.comms.http.fetch()` with
parameter like `stream=True`, the `stream` param would be ignored.
Bug: T183830
Change-Id: I02d71a933bc1ef0073a0ec34534b4eeeefc10e91
---
M pywikibot/comms/http.py
1 file changed, 12 insertions(+), 1 deletion(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py
index b6fb20d..ba569f6 100644
--- a/pywikibot/comms/http.py
+++ b/pywikibot/comms/http.py
@@ -349,6 +349,16 @@
def _http_process(session, http_request):
+ """
+ Process an `threadedhttp.HttpRequest` instance.
+
+ @param session: Session that will be used to process the `http_request`.
+ @type session: L{requests.Session}
+ @param http_request: Request that will be processed.
+ @type http_request: L{threadedhttp.HttpRequest}
+ @return: None
+ @rtype: None
+ """
method = http_request.method
uri = http_request.uri
params = http_request.params
@@ -374,7 +384,8 @@
# verify=True, when a request with verify=False happened before
response = session.request(method, uri, params=params, data=body,
headers=headers, auth=auth, timeout=timeout,
- verify=not ignore_validation)
+ verify=not ignore_validation,
+ **http_request.kwargs)
except Exception as e:
http_request.data = e
else:
--
To view, visit
https://gerrit.wikimedia.org/r/401116
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I02d71a933bc1ef0073a0ec34534b4eeeefc10e91
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Rafidaslam <rafidteam(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Rafidaslam <rafidteam(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: Zoranzoki21 <zorandori4444(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>