Bugs item #3474217, was opened at 2012-01-15 10:26 Message generated for change (Tracker Item Submitted) made by nobody You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3474217...
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Unable to block IPs
Initial Comment: see http://lists.wikimedia.org/pipermail/pywikipedia-l/2011-November/007034.html and http://lists.wikimedia.org/pipermail/pywikipedia-l/2011-November/007040.html
amir@nightshade:~$ python blockips.py User name '1.161.100.110' is invalid. IP addresses are not supported. Traceback (most recent call last): File "blockips.py", line 23, in <module> user.block(expiry="one year",reason="{{پروکسی باز}}",anon=True) File "/home/amir/userlib.py", line 383, in block if self.isBlocked() and not reBlock: File "/home/amir/userlib.py", line 121, in isBlocked self._load() File "/home/amir/userlib.py", line 96, in _load getall(self.site(), [self], force=True) File "/home/amir/userlib.py", line 540, in getall _GetAllUI(site, users, throttle, force).run() File "/home/amir/userlib.py", line 559, in run data = self.getData() File "/home/amir/userlib.py", line 595, in getData raise InvalidUser("User name '%s' is invalid. IP addresses are not supported." % user['name']) userlib.InvalidUser: User name '1.161.100.110' is invalid. IP addresses are not supported.
My code is: import re import wikipedia, userlib import query, config, codecs f=codecs.open(u"ipblock.txt",u"r",u"utf-8") aaa=f.read() f.close() rr=re.compile(u"[[(.+?)]]") site=wikipedia.getSite() for username in rr.findall(aaa): if u"." in username: user=userlib.User(site,username) user.block(expiry="one year",reason="{{پروکسی باز}}",anon=True)
A possible solution was suggested by Pedro Sanchez ( see http://lists.wikimedia.org/pipermail/pywikipedia-l/2011-November/007040.html ).
----------------------------------------------------------------------
You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3474217...
pywikipedia-bugs@lists.wikimedia.org