jenkins-bot has submitted this change and it was merged.
Change subject: Improvement: Handle PageSaveRelatedError while putting sd template ......................................................................
Improvement: Handle PageSaveRelatedError while putting sd template
- When a speedy deletion template is to be written on a page, handle PageSaveRelatedError and print that error. - Print an additional message if the script cannot solve the broken redirect or mark the page for deletion. - Remove the blank line at the end of page processing.
Change-Id: I762db6a3e1c4b711dee009893fadab5ee7566ca4 --- M scripts/redirect.py 1 file changed, 6 insertions(+), 2 deletions(-)
Approvals: XZise: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/redirect.py b/scripts/redirect.py index 2fa2c83..6402c57 100755 --- a/scripts/redirect.py +++ b/scripts/redirect.py @@ -502,10 +502,15 @@ targetPage.site, 'redirect-broken-redirect-template' ) + "\n" + content - redir_page.put(content, reason) + try: + redir_page.put(content, reason) + except pywikibot.PageSaveRelatedError as e: + pywikibot.error(e) else: pywikibot.output( u'No speedy deletion template available') + else: + pywikibot.output(u'Cannot fix or delete the broken redirect') except pywikibot.IsRedirectPage: pywikibot.output(u"Redirect target %s is also a redirect! " u"Won't delete anything." @@ -516,7 +521,6 @@ pywikibot.output( u'Redirect target %s does exist! Won't delete anything.' % targetPage.title(asLink=True)) - pywikibot.output(u'')
def fix_double_redirects(self): for redir_name in self.generator.retrieve_double_redirects():