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:
--
To view, visit
https://gerrit.wikimedia.org/r/149638
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibd85350cda6b511afd3b7a335abe20bd4ac0899e
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: jenkins-bot <>