http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9397
Revision: 9397 Author: xqt Date: 2011-07-16 12:49:57 +0000 (Sat, 16 Jul 2011) Log Message: ----------- category template should have a parameter for redirect target. If not, do not recognize the given page as cateory redirect instead of breaking the bot.
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2011-07-16 11:38:09 UTC (rev 9396) +++ trunk/pywikipedia/wikipedia.py 2011-07-16 12:49:57 UTC (rev 9397) @@ -1142,7 +1142,12 @@ ).titleWithoutNamespace() # normalize title if template in catredirs: # Get target (first template argument) - self._catredirect = self.site().namespace(14) + ":" + args[0] + if not args: + pywikibot.output(u'Warning: redirect target for %s is missing' + % self.title(asLink=True)) + self._catredirect = False + else: + self._catredirect = self.site().namespace(14) + ":" + args[0] break else: self._catredirect = False