DrTrigon has submitted this change and it was merged.
Change subject: work-a-round; for "MaxTriesExceededError" in catimages.py during debug info/log output ......................................................................
work-a-round; for "MaxTriesExceededError" in catimages.py during debug info/log output
Change-Id: I8d2b5dee5ea1ef80cb87ad765f92c51e59240475 --- M catimages.py 1 file changed, 15 insertions(+), 9 deletions(-)
Approvals: DrTrigon: Verified; Looks good to me, approved jenkins-bot: Verified
diff --git a/catimages.py b/catimages.py index c751df5..e91084f 100644 --- a/catimages.py +++ b/catimages.py @@ -4411,15 +4411,21 @@ # "HTTPError: 504 Gateway Time-out" leading finally to "MaxTriesExceededError" # (why is that...?!?? FIX THIS in the framework core e.g. 'postForm'!) tmp = outresult - while tmp: - i = np.array([m.start() for m in re.finditer(u"\n\n==", tmp)] + - [len(tmp)]) - pos = i[np.where((i - 500 * 1024) <= 0)[0][-1]] - pywikibot.output(u"Size of bunch to write: %s byte(s)" - % len(tmp[:pos])) - outpage.put(tmp[:pos], comment="bot writing log for last run") - tmp = tmp[pos:] - if pywikibot.simulate: + ### BUG 57495: "MaxTriesExceededError" in catimages.py during debug info/log output + ### ('try ... except' has to be considered just a work-a-round) + try: + while tmp: + i = np.array([m.start() for m in re.finditer(u"\n\n==", tmp)] + + [len(tmp)]) + pos = i[np.where((i - 500 * 1024) <= 0)[0][-1]] + pywikibot.output(u"Size of bunch to write: %s byte(s)" + % len(tmp[:pos])) + outpage.put(tmp[:pos], comment="bot writing log for last run") + tmp = tmp[pos:] + except pywikibot.MaxTriesExceededError: + pywikibot.exception() + pywikibot.output(u"Problem writing debug info to wiki, using file instead.") + if pywikibot.simulate or tmp: #print u"--- " * 20 #print u"--- " * 20 #print outresult
pywikibot-commits@lists.wikimedia.org