jenkins-bot has submitted this change and it was merged.
Change subject: (bug 55127) Implement network timeouts
......................................................................
(bug 55127) Implement network timeouts
A hung connection will now raise an SSLError (or equivalent
for HTTP connections) after 120 seconds (config.socket_timeout)
Change-Id: Ief38beaf912d4dd1c267eff46e2b73bff8edc447
---
M pywikibot/comms/threadedhttp.py
1 file changed, 3 insertions(+), 0 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/comms/threadedhttp.py b/pywikibot/comms/threadedhttp.py
index 90d4de7..0447b77 100644
--- a/pywikibot/comms/threadedhttp.py
+++ b/pywikibot/comms/threadedhttp.py
@@ -150,6 +150,8 @@
will be used when not supplied.
@param max_redirects: (optional) The maximum number of redirects to
follow. 5 is default.
+ @param timeout: (optional) Socket timeout in seconds. Default is
+ config.socket_timeout. Disable with None.
"""
try:
@@ -163,6 +165,7 @@
self.max_redirects = kwargs.pop('max_redirects', 5)
if len(args) < 3:
kwargs.setdefault('proxy_info', config.proxy)
+ kwargs.setdefault('timeout', config.socket_timeout)
httplib2.Http.__init__(self, *args, **kwargs)
def request(self, uri, method="GET", body=None, headers=None,
--
To view, visit
https://gerrit.wikimedia.org/r/110853
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ief38beaf912d4dd1c267eff46e2b73bff8edc447
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>