Revision: 4287 Author: wikipedian Date: 2007-09-14 14:16:07 +0000 (Fri, 14 Sep 2007)
Log Message: ----------- catch exceptions
Modified Paths: -------------- trunk/pywikipedia/cosmetic_changes.py trunk/pywikipedia/replace.py
Modified: trunk/pywikipedia/cosmetic_changes.py =================================================================== --- trunk/pywikipedia/cosmetic_changes.py 2007-09-14 13:37:32 UTC (rev 4286) +++ trunk/pywikipedia/cosmetic_changes.py 2007-09-14 14:16:07 UTC (rev 4287) @@ -94,7 +94,10 @@ text = self.resolveHtmlEntities(text) text = self.validXhtml(text) text = self.removeUselessSpaces(text) - text = isbn.hyphenateIsbnNumbers(text) + try: + text = isbn.hyphenateIsbnNumbers(text) + except isbn.InvalidIsbnException, error: + pass if self.debug: wikipedia.showDiff(oldText, text) return text
Modified: trunk/pywikipedia/replace.py =================================================================== --- trunk/pywikipedia/replace.py 2007-09-14 13:37:32 UTC (rev 4286) +++ trunk/pywikipedia/replace.py 2007-09-14 14:16:07 UTC (rev 4287) @@ -329,6 +329,8 @@ wikipedia.output(u'Skipping %s because of edit conflict' % (page.title(),)) except wikipedia.SpamfilterError, e: wikipedia.output(u'Cannot change %s because of blacklist entry %s' % (page.title(), e.url)) + except wikipedia.PageNotSaved, error: + wikipedia.output(u'Error putting page: %s' % (error.args,)) except wikipedia.LockedPage: wikipedia.output(u'Skipping %s (locked page)' % (page.title(),))