Revision: 4108 Author: valhallasw Date: 2007-08-25 16:14:36 +0000 (Sat, 25 Aug 2007)
Log Message: ----------- Bugfix for bugs 1781675 and 1781680: commented non-interwiki links and commented links to the page itself (i.e. <!-- en:Ingria --> on [[en:Ingria]]) won't crash the bot
Modified Paths: -------------- trunk/pywikipedia/interwiki.py
Modified: trunk/pywikipedia/interwiki.py =================================================================== --- trunk/pywikipedia/interwiki.py 2007-08-25 09:30:33 UTC (rev 4107) +++ trunk/pywikipedia/interwiki.py 2007-08-25 16:14:36 UTC (rev 4108) @@ -955,11 +955,11 @@ new = dict(newPages)
# remove interwiki links to ignore - for iw in re.finditer('<!-- *\[\[(.*?):(.*?)\]\] *-->', page.get()): - ignorepage = wikipedia.Page(*iw.groups()[:2]) + for iw in re.finditer('<!-- *\[\[(.*?:.*?)\]\] *-->', page.get()): + ignorepage = wikipedia.Page(page.site(), iw.groups()[0])
try: - if (new[ignorepage.site()] == ignorepage): + if (new[ignorepage.site()] == ignorepage) and (ignorepage.site() != page.site()): wikipedia.output(u"Ignoring link to %(to)s for %(from)s" % {'to': ignorepage, 'from': page}) new.pop(ignorepage.site()) except KeyError: