jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/917357 )
Change subject: [tests] Skip requests.exceptions.Timeout in HttpbinTestCase.fetch() ......................................................................
[tests] Skip requests.exceptions.Timeout in HttpbinTestCase.fetch()
Change-Id: Ib416cfd6b98e1b80eace1297bf08f28065ec5319 --- M pywikibot/comms/http.py 1 file changed, 14 insertions(+), 0 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py index 319f512..3edca31 100644 --- a/pywikibot/comms/http.py +++ b/pywikibot/comms/http.py @@ -326,6 +326,11 @@ and re.search(r'[Errno (-2|8|11001)]', msg): raise ConnectionError(response)
+ # catch requests.ReadTimeout and requests.ConnectTimeout and convert + # it to ServerError + if isinstance(response, requests.Timeout): + raise ServerError(response) + if isinstance(response, Exception): with suppress(Exception): # request exception may contain response and request attribute
pywikibot-commits@lists.wikimedia.org