jenkins-bot has submitted this change and it was merged.

Change subject: (bug 64494) do only retry on 'edit-already-exists'
......................................................................


(bug 64494) do only retry on 'edit-already-exists'

proposed by John Mark Vandenberg, see bug 62126 #3

Change-Id: Ifb4f2fcc1040acb96a902b7b7c174b382a4fa75b
---
M pywikibot/data/api.py
1 file changed, 8 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 d5fc032..5d86adb 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -392,11 +392,16 @@
             if code.startswith(u'internal_api_error_'):
                 self.wait()
                 continue
-            # bugs 46535, 62126
+            # bugs 46535, 62126, 64494
             # maybe removed when it 46535 is solved
             if code == "failed-save" and action == 'wbeditentity':
-                self.wait()
-                continue
+                try:
+                    message = result["error"]["messages"]["0"]["name"]
+                except KeyError:
+                    message = None
+                if message == u'edit-already-exists':
+                    self.wait()
+                    continue
             # raise error
             try:
                 pywikibot.log(u"API Error: query=\n%s"

-- 
To view, visit https://gerrit.wikimedia.org/r/129964
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifb4f2fcc1040acb96a902b7b7c174b382a4fa75b
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: Mpaa <[email protected]>
Gerrit-Reviewer: Multichill <[email protected]>
Gerrit-Reviewer: Russell Blau <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits

Reply via email to