Revision: 8230 Author: dantman Date: 2010-05-30 06:31:54 +0000 (Sun, 30 May 2010)
Log Message: ----------- Fix bug where pywikipedia starts sending cookies with bad \r's inside them causing php to respond with HTTP 400 errors where pywikipedia ends up reporting errors that are nearly impossible to debug. \r's appear to have been inserted into login-data by older versions of pywikipedia, so lack of degrading for this causes incompatibility with data when someone tries to upgrade.
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2010-05-29 11:02:47 UTC (rev 8229) +++ trunk/pywikipedia/wikipedia.py 2010-05-30 06:31:54 UTC (rev 8230) @@ -4787,7 +4787,7 @@ """read login cookie file and return a dictionary.""" try: f = open( config.datafilepath('login-data', filename), 'r') - ck = re.compile("(.*?)=(.*?)\n") + ck = re.compile("(.*?)=(.*?)\r?\n") data = dict([(x[0],x[1]) for x in ck.findall(f.read())]) #data = dict(ck.findall(f.read())) f.close()
pywikipedia-svn@lists.wikimedia.org