jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/585729 )
Change subject: [bugfix] Raise ServerError also if connection to PetScan timeouts ......................................................................
[bugfix] Raise ServerError also if connection to PetScan timeouts
Change-Id: Ifc7cc4f15b7f6e7038f1bd13a5db649433a7bac9 --- M pywikibot/pagegenerators.py 1 file changed, 6 insertions(+), 1 deletion(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py index 077fddf..b2d2c42 100644 --- a/pywikibot/pagegenerators.py +++ b/pywikibot/pagegenerators.py @@ -30,6 +30,7 @@
from datetime import timedelta from functools import partial +from requests.exceptions import ReadTimeout from warnings import warn
import pywikibot @@ -3077,7 +3078,11 @@ """Query PetScan.""" url = 'https://petscan.wmflabs.org'
- req = http.fetch(url, params=self.opts) + try: + req = http.fetch(url, params=self.opts) + except ReadTimeout: + raise ServerError( + 'received ReadTimeout from {0}'.format(url)) if 500 <= req.status < 600: raise ServerError( 'received {0} status from {1}'.format(req.status, req.uri))
pywikibot-commits@lists.wikimedia.org