Revision: 7643 Author: alexsh Date: 2009-11-13 12:58:33 +0000 (Fri, 13 Nov 2009)
Log Message: ----------- Fix bug #2896883 and #2896087 (might occur if not full logout. cause bot get the old local login-datas, now it will abandon the dupilcate keys in local file)
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2009-11-13 12:45:06 UTC (rev 7642) +++ trunk/pywikipedia/wikipedia.py 2009-11-13 12:58:33 UTC (rev 7643) @@ -5237,7 +5237,10 @@
if os.path.exists(localPa): #read and dump local logindata into self._cookies[index] - self._cookies[index] = query.CombineParams(self._cookies[index], self._readCookies(localFn)) + for k, v in self._readCookies(localFn).iteritems(): + if k not in self._cookies[index]: + self._cookies[index][k] = v + elif not os.path.exists(localPa) and not self.family.cross_projects: #keep anonymous mode if not login and centralauth not enable self._cookies[index] = None
pywikipedia-svn@lists.wikimedia.org