jenkins-bot merged this change.

View Change

Approvals: Dvorapa: Looks good to me, but someone else must approve Framawiki: Looks good to me, approved jenkins-bot: Verified
[bugfix] Don't fail missing 'redirects' with RuntimeError

Skipping page processing for these pages.

Bug: T130911
Change-Id: I286e7e83fc2c6c9ac649dd9e9fd6217df5d2466d
---
M scripts/redirect.py
1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/scripts/redirect.py b/scripts/redirect.py
index 8d93480..272aa2f 100755
--- a/scripts/redirect.py
+++ b/scripts/redirect.py
@@ -490,10 +490,9 @@
done = not self.getOption('delete')
try:
targetPage = redir_page.getRedirectTarget()
- except pywikibot.CircularRedirect:
- pywikibot.output('{0} is a circular redirect.'
- .format(redir_page.title()))
- except pywikibot.InvalidTitle:
+ except (pywikibot.CircularRedirect,
+ pywikibot.InvalidTitle,
+ RuntimeError):
pywikibot.exception()
except pywikibot.InterwikiRedirectPage:
pywikibot.output('{0} is on another site.'
@@ -576,15 +575,15 @@
'Skipping: Redirect target {0} is not a redirect.'
.format(newRedir.title(as_link=True)))
break # do nothing
- # else target found
except pywikibot.SectionError:
pywikibot.warning(
"Redirect target section {0} doesn't exist."
.format(newRedir.title(as_link=True)))
except (pywikibot.CircularRedirect,
pywikibot.InterwikiRedirectPage,
- pywikibot.UnsupportedPage) as e:
- pywikibot.exception(e)
+ pywikibot.UnsupportedPage,
+ RuntimeError):
+ pywikibot.exception()
pywikibot.output('Skipping {0}.'.format(newRedir))
break
except pywikibot.BadTitle as e:

To view, visit change 279589. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I286e7e83fc2c6c9ac649dd9e9fd6217df5d2466d
Gerrit-Change-Number: 279589
Gerrit-PatchSet: 4
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Dvorapa <dvorapa@seznam.cz>
Gerrit-Reviewer: Framawiki <framawiki@tools.wmflabs.org>
Gerrit-Reviewer: John Vandenberg <jayvdb@gmail.com>
Gerrit-Reviewer: Meno25 <meno25mail@gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki@gmail.com>
Gerrit-Reviewer: Russell Blau <russblau@imapmail.org>
Gerrit-Reviewer: XZise <CommodoreFabianus@gmx.de>
Gerrit-Reviewer: jenkins-bot (75)