jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/917920 )
Change subject: [fix] Also raise ConnectionError if caused by NameResolutionError ......................................................................
[fix] Also raise ConnectionError if caused by NameResolutionError
Bug: T336280 Change-Id: Ia4047e6aa99e7b499115b8fe552d83a6aa56d8b9 --- M pywikibot/comms/http.py 1 file changed, 11 insertions(+), 1 deletion(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py index 319f512..d467708 100644 --- a/pywikibot/comms/http.py +++ b/pywikibot/comms/http.py @@ -322,7 +322,7 @@
if isinstance(response, requests.ConnectionError): msg = str(response) - if 'NewConnectionError' in msg \ + if ('NewConnectionError' in msg or 'NameResolutionError' in msg) \ and re.search(r'[Errno (-2|8|11001)]', msg): raise ConnectionError(response)
pywikibot-commits@lists.wikimedia.org