Revision: 4893 Author: rotem Date: 2008-01-15 16:19:57 +0000 (Tue, 15 Jan 2008)
Log Message: ----------- This may fix the problem(s) raised in support request 1871836.
Modified Paths: -------------- trunk/pywikipedia/interwiki.py trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/interwiki.py =================================================================== --- trunk/pywikipedia/interwiki.py 2008-01-15 16:02:57 UTC (rev 4892) +++ trunk/pywikipedia/interwiki.py 2008-01-15 16:19:57 UTC (rev 4893) @@ -998,18 +998,21 @@ if not page.exists(): wikipedia.output(u"Not editing %s: page does not exist" % page.aslink(True)) raise SaveError - + # Show a message in purple. wikipedia.output("\03{lightpurple}Updating links on page %s.\03{default}" % page.aslink(True))
# clone original newPages dictionary, so that we can modify it to the local page's needs new = dict(newPages) - + # remove interwiki links to ignore for iw in re.finditer('<!-- *\[\[(.*?:.*?)\]\] *-->', page.get()): - ignorepage = wikipedia.Page(page.site(), iw.groups()[0]) - try: + ignorepage = wikipedia.Page(page.site(), iw.groups()[0]) + except KeyError: + continue + + try: if (new[ignorepage.site()] == ignorepage) and (ignorepage.site() != page.site()): if (ignorepage not in page.interwiki()): wikipedia.output(u"Ignoring link to %(to)s for %(from)s" % {'to': ignorepage.aslink(), 'from': page.aslink()})
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2008-01-15 16:02:57 UTC (rev 4892) +++ trunk/pywikipedia/wikipedia.py 2008-01-15 16:19:57 UTC (rev 4893) @@ -420,7 +420,7 @@ except: print >>sys.stderr, "Exception in Page constructor" print >>sys.stderr, ( - "site=%s, title=%s, insite=%s, defaultNamespace=%i" + u"site=%s, title=%s, insite=%s, defaultNamespace=%i" % (site, title, insite, defaultNamespace) ) raise
pywikipedia-l@lists.wikimedia.org