jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/368227 )
Change subject: harvest_template.py: Catch InvalidTitle ......................................................................
harvest_template.py: Catch InvalidTitle
Change-Id: If7607297bb6911bbdaa955743b6db14b91af97c9 --- M scripts/harvest_template.py 1 file changed, 6 insertions(+), 1 deletion(-)
Approvals: Mpaa: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/harvest_template.py b/scripts/harvest_template.py index ef0dab6..0f542d0 100755 --- a/scripts/harvest_template.py +++ b/scripts/harvest_template.py @@ -99,7 +99,12 @@
def _template_link_target(self, item, link_text): link = pywikibot.Link(link_text) - linked_page = pywikibot.Page(link) + try: + linked_page = pywikibot.Page(link) + except pywikibot.exceptions.InvalidTitle: + pywikibot.error('%s is not a valid title so it cannot be linked. ' + 'Skipping.' % link_text) + return
if not linked_page.exists(): pywikibot.output('%s does not exist so it cannot be linked. '
pywikibot-commits@lists.wikimedia.org