jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/333033 )
Change subject: [bugfix] Manage temporary readonly error
......................................................................
[bugfix] Manage temporary readonly error
It's look like the API error named internal_api_error_ReadOnlyError was renamed to
readonly. So, code.startswith(u'internal_api_error_') is not enabled. I've
edited the code to accept readonly as an error that need edit retry. Need investigation to
verify if internal_api_error_ReadOnlyError is still enabled, and if others error codes are
impacted.
Bug: T154011
Change-Id: I9cc80c77532db3d9b71db5c33f91b8a699f41d6c
---
M pywikibot/data/api.py
1 file changed, 10 insertions(+), 3 deletions(-)
Approvals:
Merlijn van Deen: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index e704023..9a1a585 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -2089,15 +2089,22 @@
pywikibot.warning('API error %s: %s' % (code, info))
- if code.startswith(u'internal_api_error_'):
- class_name = code[len(u'internal_api_error_'):]
+ if code.startswith('internal_api_error_') or code ==
'readonly':
+ if code == 'readonly': # T154011
+ class_name = code
+ else:
+ class_name = code[len(u'internal_api_error_'):]
del error['code'] # is added via class_name
e = APIMWException(class_name, **error)
+ # If the error key is in this table, it is probably a temporary problem,
+ # so we will retry the edit.
+ # TODO: T154011: 'ReadOnlyError' seems replaced by
'readonly'
retry = class_name in ['DBConnectionError', # T64974
'DBQueryError', # T60158
- 'ReadOnlyError' # T61227
+ 'ReadOnlyError', # T61227
+ 'readonly', # T154011
]
pywikibot.error("Detected MediaWiki API exception %s%s"
--
To view, visit
https://gerrit.wikimedia.org/r/333033
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I9cc80c77532db3d9b71db5c33f91b8a699f41d6c
Gerrit-PatchSet: 5
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Gerrit Patch Uploader <gerritpatchuploader(a)gmail.com>
Gerrit-Reviewer: Framawiki <framawiki(a)tools.wmflabs.org>
Gerrit-Reviewer: Gerrit Patch Uploader <gerritpatchuploader(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Magul <tomasz.magulski(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: Multichill <maarten(a)mdammers.nl>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: Zhuyifei1999 <zhuyifei1999(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>