jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/623592 )
Change subject: [bugfix] Remove socket_timeout fix in config2.py
......................................................................
[bugfix] Remove socket_timeout fix in config2.py
requests >= 2.20.1 is required and using requests < 2.4.0 is on
bot owner's own risk. The version is checked since March 2020
and it is no longer needed to fix socket_timeout value for
compatibility with this very outdated requests version published
before August 2014.
Removing this fix should solve T261748 probably.
Bug: T261748
Change-Id: I644efed987a1e102b9fb0fc62d7f510a49bc1232
---
M pywikibot/config2.py
1 file changed, 1 insertion(+), 10 deletions(-)
Approvals:
Matěj Suchánek: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/config2.py b/pywikibot/config2.py
index 3fd95a6..a6ef6ef 100644
--- a/pywikibot/config2.py
+++ b/pywikibot/config2.py
@@ -45,10 +45,8 @@
import sys
import types
-from distutils.version import StrictVersion
from locale import getdefaultlocale
from os import getenv, environ
-from requests import __version__ as requests_version
from textwrap import fill
from warnings import warn
@@ -784,7 +782,7 @@
# DO NOT set to None to disable timeouts. Otherwise this may freeze your
# script.
# You may assign either a tuple of two int or float values for connection and
-# read timeout, or a single value for both in a tuple (since requests 2.4.0).
+# read timeout, or a single value for both in a tuple.
socket_timeout = (6.05, 45)
@@ -1131,13 +1129,6 @@
"Defaulting to family='wikipedia' and
mylang='test'.")
mylang = 'test'
-# Fix up socket_timeout
-# Older requests library expect a single value whereas newer versions also
-# accept a tuple (connect timeout, read timeout).
-if (isinstance(socket_timeout, tuple)
- and StrictVersion(requests_version) < StrictVersion('2.4.0')):
- socket_timeout = max(socket_timeout)
-
# SECURITY WARNINGS
if (not ignore_file_security_warnings
and private_files_permission & (stat.S_IRWXG | stat.S_IRWXO) != 0):
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/623592
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I644efed987a1e102b9fb0fc62d7f510a49bc1232
Gerrit-Change-Number: 623592
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged