http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9535
Revision: 9535 Author: xqt Date: 2011-09-20 17:07:54 +0000 (Tue, 20 Sep 2011) Log Message: ----------- fix for http error 400 (bug #3411408), patch submitted by DrTrigon
Modified Paths: -------------- trunk/pywikipedia/botlist.py
Modified: trunk/pywikipedia/botlist.py =================================================================== --- trunk/pywikipedia/botlist.py 2011-09-19 04:03:22 UTC (rev 9534) +++ trunk/pywikipedia/botlist.py 2011-09-20 17:07:54 UTC (rev 9535) @@ -20,6 +20,7 @@ import re, sys, pickle import os.path import time +import urllib import wikipedia as pywikibot
cache = {} @@ -93,7 +94,7 @@ else: PATTERN = u'<li>(.*?) *((.*?),\s(.*?))</li>' while m1: - text = site.getUrl(site.globalusers_address(offset=offset, group='Global_bot')) + text = site.getUrl(site.globalusers_address(offset=urllib.quote(offset), group='Global_bot'))
m1 = re.findall(u'<li>.*?</li>', text) for item in m1:
pywikipedia-svn@lists.wikimedia.org