http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11208
Revision: 11208 Author: russblau Date: 2013-03-15 15:36:59 +0000 (Fri, 15 Mar 2013) Log Message: ----------- Fix bug #3607448: Preloading fails in combination with getReferences()
Modified Paths: -------------- branches/rewrite/pywikibot/site.py
Modified: branches/rewrite/pywikibot/site.py =================================================================== --- branches/rewrite/pywikibot/site.py 2013-03-15 07:46:41 UTC (rev 11207) +++ branches/rewrite/pywikibot/site.py 2013-03-15 15:36:59 UTC (rev 11208) @@ -1328,9 +1328,10 @@ # This checks to see if there is a normalized title in # the response that corresponds to the canonical form # used in the query. - if pagedata['title'] in rvgen.normalized \ - and rvgen.normalized[pagedata['title']] in cache: - cache[pagedata['title']] = cache[rvgen.normalized[pagedata['title']]] + for key in cache: + if self.sametitle(key, pagedata['title']): + cache[pagedata['title']] = cache[key] + break else: pywikibot.warning( u"preloadpages: Query returned unexpected title '%s'"