Xqt has submitted this change and it was merged.
Change subject: api.py: Server504Error is already hadled by request.submit() ......................................................................
api.py: Server504Error is already hadled by request.submit()
Change-Id: I53a2265c50fceee0fc08455102e942661b3d71c2 --- M pywikibot/data/api.py 1 file changed, 1 insertion(+), 10 deletions(-)
Approvals: Xqt: Verified; Looks good to me, approved
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py index 155a615..d40cb3c 100644 --- a/pywikibot/data/api.py +++ b/pywikibot/data/api.py @@ -663,16 +663,7 @@ if new_limit is not None: self.request[self.prefix + "limit"] = str(new_limit) if not hasattr(self, "data"): - try: - self.data = self.request.submit() - except Server504Error: - # server timeout, usually caused by request with high limit - old_limit = self.query_limit - if old_limit is None or old_limit < 2: - raise - pywikibot.log("Setting query limit to %s" % (old_limit // 2)) - self.set_query_increment(old_limit // 2) - continue + self.data = self.request.submit() if not self.data or not isinstance(self.data, dict): pywikibot.debug( u"%s: stopped iteration because no dict retrieved from api."
pywikibot-commits@lists.wikimedia.org