jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/510690 )
Change subject: [IMPR] 'actionthrottledtext' is a retryable wikibase error ......................................................................
[IMPR] 'actionthrottledtext' is a retryable wikibase error
Bug: T192912 Change-Id: I74b080263b0ca032121c3c47b04902fb046d2d12 --- M pywikibot/data/api.py 1 file changed, 9 insertions(+), 9 deletions(-)
Approvals: Dvorapa: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py index de1e8c7..5f92b76 100644 --- a/pywikibot/data/api.py +++ b/pywikibot/data/api.py @@ -1607,25 +1607,25 @@ return {action: {'result': 'Success', 'nochange': ''}}
def _is_wikibase_error_retryable(self, error): - ERR_MSG = 'edit-already-exists' + ERR_MSG = ( + 'edit-already-exists', + 'actionthrottledtext', # T192912 + ) messages = error.pop('messages', None) + message = None # bug T68619; after Wikibase breaking change 1ca9cee change we have a # list of messages if isinstance(messages, list): for item in messages: message = item['name'] - if message == ERR_MSG: - break - else: # no break - message = None + if message in ERR_MSG: + return True elif isinstance(messages, dict): - try: # behaviour before gerrit 124323 braking change + try: # behaviour before gerrit 124323 breaking change message = messages['0']['name'] except KeyError: # unsure the new output is always a list message = messages['name'] - else: - message = None - return message == ERR_MSG + return message in ERR_MSG
@staticmethod def _generate_MIME_part(key, content, keytype=None, headers=None):
pywikibot-commits@lists.wikimedia.org