jenkins-bot submitted this change.

View Change


Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
[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(-)

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)


To view, visit change 917920. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ia4047e6aa99e7b499115b8fe552d83a6aa56d8b9
Gerrit-Change-Number: 917920
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged