jenkins-bot has submitted this change and it was merged.
Change subject: Category add fails on redirect ......................................................................
Category add fails on redirect
Don't crash when trying to follow redirects to add a category. Storing the exception is no longer required.
Bug: 68694
Change-Id: Ibd85350cda6b511afd3b7a335abe20bd4ac0899e --- M scripts/category.py 1 file changed, 2 insertions(+), 2 deletions(-)
Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/category.py b/scripts/category.py index 3923ca0..7896212 100755 --- a/scripts/category.py +++ b/scripts/category.py @@ -304,8 +304,8 @@ else: pywikibot.output(u"Page %s does not exist; skipping." % page.title(asLink=True)) - except pywikibot.IsRedirectPage as arg: - redirTarget = pywikibot.Page(page.site, arg.args[0]) + except pywikibot.IsRedirectPage: + redirTarget = page.getRedirectTarget() if self.follow_redirects: text = redirTarget.get() else:
pywikibot-commits@lists.wikimedia.org