http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10380
Revision: 10380 Author: xqt Date: 2012-06-19 15:29:03 +0000 (Tue, 19 Jun 2012) Log Message: ----------- Ignore InvalidTitle exception for cleanUpLinks, bugfix for bug #3534644
Modified Paths: -------------- branches/rewrite/scripts/cosmetic_changes.py
Modified: branches/rewrite/scripts/cosmetic_changes.py =================================================================== --- branches/rewrite/scripts/cosmetic_changes.py 2012-06-19 15:27:44 UTC (rev 10379) +++ branches/rewrite/scripts/cosmetic_changes.py 2012-06-19 15:29:03 UTC (rev 10380) @@ -428,7 +428,11 @@ # We only work on namespace 0 because pipes and linktrails work # differently for images and categories. page = pywikibot.Page(pywikibot.Link(titleWithSection, self.site)) - if page.namespace() == 0: + try: + namespace = page.namespace() + except pywikibot.InvalidTitle: + return match.group() + if namespace == 0: # Replace underlines by spaces, also multiple underlines titleWithSection = re.sub('_+', ' ', titleWithSection) # Remove double spaces