Revision: 7160 Author: alexsh Date: 2009-08-16 18:02:05 +0000 (Sun, 16 Aug 2009)
Log Message: ----------- typo config.authenticate predata
Modified Paths: -------------- trunk/pywikipedia/query.py
Modified: trunk/pywikipedia/query.py =================================================================== --- trunk/pywikipedia/query.py 2009-08-16 18:01:30 UTC (rev 7159) +++ trunk/pywikipedia/query.py 2009-08-16 18:02:05 UTC (rev 7160) @@ -87,10 +87,9 @@ try: jsontext = "Nothing received" if site.hostname() in wikipedia.config.authenticate.keys(): - predata["Content-type"] = "application/x-www-form-urlencoded" - predata["User-agent"] = useragent - data = site.urlEncode(params) - res = urllib2.urlopen(urllib2.Request(site.protocol() + '://' + site.hostname() + address, data)) + params["Content-type"] = "application/x-www-form-urlencoded" + params["User-agent"] = useragent + res = urllib2.urlopen(urllib2.Request(site.protocol() + '://' + site.hostname() + address, site.urlEncode(params))) jsontext = res.read() elif params['action'] in postAC: res, jsontext = site.postData(path, urllib.urlencode(params.items()), cookies=site.cookies(sysop=sysop), sysop=sysop)
pywikipedia-svn@lists.wikimedia.org