Bugs item #1999239, was opened at 2008-06-21 03:32
Message generated for change (Comment added) made by rotemliss
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1999239&group_…
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: General
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 9
Private: No
Submitted By: Daniel Herding (wikipedian)
Assigned to: Nobody/Anonymous (nobody)
Summary: Blocking bot account doesn't stop the bot run
Initial Comment:
There is a very serious bug in the current version. If someone blocks your bot account, the bot just keeps on running. It prints this message:
WARNING: Your account on wikipedia:de is blocked. Editing using this account will stop the run.
But then it doesn't stop. Instead, it will try to save the page, fail, and happily continue using the sysop account. Sooner or later, someone will also block your sysop account for a few minutes. PyWikipedia then shows this warning:
WARNING: Your sysop account on wikipedia:de is blocked. Editing using this account will stop the run.
Again, it will happily continue, of course failing on each page. After a few minutes, the block will run out, and the bot will continue to make changes.
As far as I can tell, the problem is this: In _getEditPage(), there is this code, which would be responsible for stopping the bot:
if self.site().isBlocked():
raise UserBlocked(self.site(), self.aslink(forceInterwiki = True))
But it looks like _getEditPage() isn't even called, so this check doesn't even happen.
I don't know who is responsible for this, but this is a real pain in the ass, and it needs to be fixed ASAP.
----
Pywikipedia [svn+ssh] wikipedian@trunk/pywikipedia (r5595, Jun 20 2008, 18:30:58)
Python 2.5.1 (r251:54863, Mar 7 2008, 04:10:12)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)]
----------------------------------------------------------------------
>Comment By: Rotem Liss (rotemliss)
Date: 2008-06-21 12:29
Message:
Logged In: YES
user_id=1327030
Originator: NO
Fixed in r5602 by adding block checks for each action.
----------------------------------------------------------------------
Comment By: NicDumZ — Nicolas Dumazet (nicdumz)
Date: 2008-06-21 09:59
Message:
Logged In: YES
user_id=1963242
Originator: NO
Yes, I had suffered the same bug in november (no sysop account was
involved, though), and even with the commit access, I forgot to fix it :(
Now, every action (move, delete, edit, and so on), call _getActionUser,
which itself calls isAllowed. What about raising an error here
if(self._isBlocked[index]) ?
----------------------------------------------------------------------
Comment By: Daniel Herding (wikipedian)
Date: 2008-06-21 03:42
Message:
Logged In: YES
user_id=880694
Originator: YES
Please note that Nicolas Dumazet already written about this on the mailing
list on 2007-11-12: "[Pywikipedia-l] Shouldn't bots stop trying to edit
when blocked ??!"
I don't know if he already suffered from the same bug that I described,
but if he did, then it's a real shame that it hasn't been fixed for more
than a half year.
----------------------------------------------------------------------
Comment By: Daniel Herding (wikipedian)
Date: 2008-06-21 03:38
Message:
Logged In: YES
user_id=880694
Originator: YES
I have now committed a workaround for this bug; it raises a UserBlocked
exception already in _getUserData(), not only in _getEditPage(). This is
not a nice solution, but we cannot tolerate bots which ignore being
blocked.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1999239&group_…
Revision: 5602
Author: rotem
Date: 2008-06-21 09:29:09 +0000 (Sat, 21 Jun 2008)
Log Message:
-----------
* (bug 1999239) Blocking bot account doesn't stop the bot run
* Removing some old pieces of code.
Modified Paths:
--------------
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2008-06-21 06:32:52 UTC (rev 5601)
+++ trunk/pywikipedia/wikipedia.py 2008-06-21 09:29:09 UTC (rev 5602)
@@ -670,8 +670,6 @@
if throttle:
get_throttle()
textareaFound = False
- readonly = False
- checkBlocks = True
retry_idle_time = 1
while not textareaFound:
text = self.site().getUrl(path, sysop = sysop)
@@ -686,8 +684,6 @@
i1 = m1.end()
i2 = m2.start()
textareaFound = True
- if m1.group(1).find( "readonly" ) >= 0:
- readonly = True
else:
# search for messages with no "view source" (aren't used in new versions)
if text.find(self.site().mediawiki_message('whitelistedittitle')) != -1:
@@ -698,11 +694,8 @@
elif text.find('var wgPageName = "Special:Badtitle";') != -1:
raise BadTitle('BadTitle: %s' % self)
# find out if the username or IP has been blocked
- # check this only once in this method
- elif checkBlocks == True:
- checkBlocks = False;
- if self.site().isBlocked():
- raise UserBlocked(self.site(), self.aslink(forceInterwiki = True))
+ elif self.site().isBlocked():
+ raise UserBlocked(self.site(), self.aslink(forceInterwiki = True))
# If there is no text area and the heading is 'View Source'
# but user is not blocked, the page does not exist, and is
# locked
@@ -727,10 +720,6 @@
retry_idle_time *= 2
if retry_idle_time > 30:
retry_idle_time = 30
- # We now know that there is a textarea.
- # If read-only, check blocks.
- if readonly and checkBlocks and self.site().isBlocked():
- raise UserBlocked(self.site(), self.aslink(forceInterwiki = True))
# Check for restrictions
m = re.search('var wgRestrictionEdit = \\["(\w+)"\\]', text)
if m:
@@ -1217,6 +1206,9 @@
sysop = self._getActionUser(action = 'edit', restriction = self.editRestriction, sysop = False)
username = self.site().loggedInAs()
+ # Check blocks
+ self.site().checkBlocks(sysop = sysop)
+
# Determine if we are allowed to edit
if not force:
if not self.botMayEdit(username):
@@ -2037,6 +2029,9 @@
if deleteAndMove:
sysop = self._getActionUser(action = 'delete', restriction = '', sysop = True)
+ # Check blocks
+ self.site().checkBlocks(sysop = sysop)
+
if throttle:
put_throttle()
if reason == None:
@@ -2128,6 +2123,9 @@
else:
raise
+ # Check blocks
+ self.site().checkBlocks(sysop = True)
+
if throttle:
put_throttle()
if reason == None:
@@ -2276,6 +2274,9 @@
# Login
self._getActionUser(action = 'undelete', sysop = True)
+ # Check blocks
+ self.site().checkBlocks(sysop = sysop)
+
if throttle:
put_throttle()
@@ -2315,6 +2316,9 @@
# Login
self._getActionUser(action = 'protect', sysop = True)
+ # Check blocks
+ self.site().checkBlocks(sysop = sysop)
+
address = self.site().protect_address(self.urlname())
if unprotect:
address = self.site().unprotect_address(self.urlname())
@@ -4033,8 +4037,26 @@
# Old info is about the anonymous user
self._userData[index] = False
+ def checkBlocks(self, sysop = False):
+ """Check if the user is blocked, and raise an exception if so."""
+ self._load(sysop = sysop)
+ index = self._userIndex(sysop)
+ if self._isBlocked[index]:
+ # User blocked
+ raise UserBlocked('User is blocked in site %s' % self)
+
def isBlocked(self, sysop = False):
"""Check if the user is blocked."""
+ self._load(sysop = sysop)
+ index = self._userIndex(sysop)
+ if self._isBlocked[index]:
+ # User blocked
+ return True
+ else:
+ return False
+
+ def _getBlock(self, sysop = False):
+ """Get user block data from the API."""
try:
text = self.getUrl(u'%saction=query&meta=userinfo&uiprop=blockinfo'
% self.api_address(), sysop=sysop)
@@ -4378,19 +4400,13 @@
# Check for blocks - but only if version is 1.11 (userinfo is available)
# and the user data was not yet loaded
if self.versionnumber() >= 11 and (not self._userData[index] or force):
- blocked = self.isBlocked(sysop = sysop)
+ blocked = self._getBlock(sysop = sysop)
if blocked and not self._isBlocked[index]:
# Write a warning if not shown earlier
if sysop:
account = 'Your sysop account'
else:
account = 'Your account'
- ################################################################
- # The following line was added as a workaround for bug 1999239 #
- # (Blocking bot account doesn't stop the bot run). #
- raise UserBlocked(self) #
- # End of workaround. #
- ################################################################
output(u'WARNING: %s on %s is blocked. Editing using this account will stop the run.' % (account, self))
self._isBlocked[index] = blocked
Bugs item #1999239, was opened at 2008-06-21 02:32
Message generated for change (Comment added) made by nicdumz
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1999239&group_…
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: General
Group: None
Status: Open
Resolution: None
Priority: 9
Private: No
Submitted By: Daniel Herding (wikipedian)
Assigned to: Nobody/Anonymous (nobody)
Summary: Blocking bot account doesn't stop the bot run
Initial Comment:
There is a very serious bug in the current version. If someone blocks your bot account, the bot just keeps on running. It prints this message:
WARNING: Your account on wikipedia:de is blocked. Editing using this account will stop the run.
But then it doesn't stop. Instead, it will try to save the page, fail, and happily continue using the sysop account. Sooner or later, someone will also block your sysop account for a few minutes. PyWikipedia then shows this warning:
WARNING: Your sysop account on wikipedia:de is blocked. Editing using this account will stop the run.
Again, it will happily continue, of course failing on each page. After a few minutes, the block will run out, and the bot will continue to make changes.
As far as I can tell, the problem is this: In _getEditPage(), there is this code, which would be responsible for stopping the bot:
if self.site().isBlocked():
raise UserBlocked(self.site(), self.aslink(forceInterwiki = True))
But it looks like _getEditPage() isn't even called, so this check doesn't even happen.
I don't know who is responsible for this, but this is a real pain in the ass, and it needs to be fixed ASAP.
----
Pywikipedia [svn+ssh] wikipedian@trunk/pywikipedia (r5595, Jun 20 2008, 18:30:58)
Python 2.5.1 (r251:54863, Mar 7 2008, 04:10:12)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)]
----------------------------------------------------------------------
>Comment By: NicDumZ Nicolas Dumazet (nicdumz)
Date: 2008-06-21 08:59
Message:
Logged In: YES
user_id=1963242
Originator: NO
Yes, I had suffered the same bug in november (no sysop account was
involved, though), and even with the commit access, I forgot to fix it :(
Now, every action (move, delete, edit, and so on), call _getActionUser,
which itself calls isAllowed. What about raising an error here
if(self._isBlocked[index]) ?
----------------------------------------------------------------------
Comment By: Daniel Herding (wikipedian)
Date: 2008-06-21 02:42
Message:
Logged In: YES
user_id=880694
Originator: YES
Please note that Nicolas Dumazet already written about this on the mailing
list on 2007-11-12: "[Pywikipedia-l] Shouldn't bots stop trying to edit
when blocked ??!"
I don't know if he already suffered from the same bug that I described,
but if he did, then it's a real shame that it hasn't been fixed for more
than a half year.
----------------------------------------------------------------------
Comment By: Daniel Herding (wikipedian)
Date: 2008-06-21 02:38
Message:
Logged In: YES
user_id=880694
Originator: YES
I have now committed a workaround for this bug; it raises a UserBlocked
exception already in _getUserData(), not only in _getEditPage(). This is
not a nice solution, but we cannot tolerate bots which ignore being
blocked.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1999239&group_…
Patches item #1996260, was opened at 2008-06-17 18:22
Message generated for change (Comment added) made by nicdumz
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603140&aid=1996260&group_…
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: Translations
Group: None
>Status: Closed
>Resolution: Accepted
Priority: 5
Private: No
Submitted By: Mikko Silvonen (silvonen)
Assigned to: Nobody/Anonymous (nobody)
Summary: Finnish translations for various scripts
Initial Comment:
See the attached patch for Finnish translations for clean_sandbox.py, movepages.py, redirect.py and unlink.py.
I also changed the existing translation in featured.py, as it confused at least one Finnish user. (The new text is a direct translation of the English text.)
----------------------------------------------------------------------
>Comment By: NicDumZ Nicolas Dumazet (nicdumz)
Date: 2008-06-21 08:33
Message:
Logged In: YES
user_id=1963242
Originator: NO
applied in r5601, thanks :)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603140&aid=1996260&group_…
Patches item #1996187, was opened at 2008-06-17 16:41
Message generated for change (Comment added) made by nicdumz
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603140&aid=1996187&group_…
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: Translations
Group: None
>Status: Closed
>Resolution: Accepted
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: lonelypages.py arabic translation
Initial Comment:
Attached a patch for lonelypages.py to add Arabic translation.
the patch created by the command:
svn diff > ~/lonelypages.py.patch
Thanks.
----------------------------------------------------------------------
>Comment By: NicDumZ Nicolas Dumazet (nicdumz)
Date: 2008-06-21 08:30
Message:
Logged In: YES
user_id=1963242
Originator: NO
Thanks, applied in r5600 :=)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603140&aid=1996187&group_…
Revision: 5600
Author: nicdumz
Date: 2008-06-21 06:30:28 +0000 (Sat, 21 Jun 2008)
Log Message:
-----------
Applying 1996187 [lonelypages.py arabic translation]
Modified Paths:
--------------
trunk/pywikipedia/lonelypages.py
Modified: trunk/pywikipedia/lonelypages.py
===================================================================
--- trunk/pywikipedia/lonelypages.py 2008-06-21 03:49:38 UTC (rev 5599)
+++ trunk/pywikipedia/lonelypages.py 2008-06-21 06:30:28 UTC (rev 5600)
@@ -63,6 +63,7 @@
# Template to add in the orphan pages
Template = {
+ 'ar':u'{{يتيمة|تاريخ={{نسخ:اسم_شهر}} {{نسخ:عام}}}}',
'en':u'{{Orphan|date={{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}}}',
'it':u'{{O||mese={{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}}}',
'zh':u'{{subst:Orphan/auto}}',
@@ -70,6 +71,7 @@
# Comment that the Bot will use to put the template
commento = {
+ 'ar':u'روبوت: إضافة قالب يتيمة',
'en':u'Bot: Orphan page, add template',
'it':u'Bot: Voce orfana, aggiungo template {{O}}',
'zh':u'機器人: 本頁的鏈入頁面太少',
@@ -78,6 +80,7 @@
# When you add a disambig to the list of disambig pages
#(if you set disambigPage to None, you can put here nothing)
commenttodisambig = {
+ 'ar':u'روبوت: إضافة صفحة توضيح',
'en':u'Bot: Adding a disambig page',
'it':u'Bot: Aggiungo una disambigua',
'zh':u'機器人: 增加消歧義頁面',
@@ -87,6 +90,7 @@
# If you need help with regex, ask on botwiki ( http://botwiki.sno.cc )
# Warning: put always "()" inside the regex, so the bot will find "something"
exception = {
+ 'ar': [ur'\{\{(?:قالب:|)(يتيمة)[\|\}]'],
'en': [r'\{\{(?:template:|)(orphan)[\|\}]', r'\{\{(?:template:|)(wi)[\|\}]'],
'it': [r'\{\{(?:template:|)(o)[\|\}]'],
'zh': [r'\{\{(?:template:|)(orphan)[\|\}]'],
Bugs item #1999239, was opened at 2008-06-21 02:32
Message generated for change (Comment added) made by wikipedian
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1999239&group_…
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: General
Group: None
Status: Open
Resolution: None
Priority: 9
Private: No
Submitted By: Daniel Herding (wikipedian)
Assigned to: Nobody/Anonymous (nobody)
Summary: Blocking bot account doesn't stop the bot run
Initial Comment:
There is a very serious bug in the current version. If someone blocks your bot account, the bot just keeps on running. It prints this message:
WARNING: Your account on wikipedia:de is blocked. Editing using this account will stop the run.
But then it doesn't stop. Instead, it will try to save the page, fail, and happily continue using the sysop account. Sooner or later, someone will also block your sysop account for a few minutes. PyWikipedia then shows this warning:
WARNING: Your sysop account on wikipedia:de is blocked. Editing using this account will stop the run.
Again, it will happily continue, of course failing on each page. After a few minutes, the block will run out, and the bot will continue to make changes.
As far as I can tell, the problem is this: In _getEditPage(), there is this code, which would be responsible for stopping the bot:
if self.site().isBlocked():
raise UserBlocked(self.site(), self.aslink(forceInterwiki = True))
But it looks like _getEditPage() isn't even called, so this check doesn't even happen.
I don't know who is responsible for this, but this is a real pain in the ass, and it needs to be fixed ASAP.
----
Pywikipedia [svn+ssh] wikipedian@trunk/pywikipedia (r5595, Jun 20 2008, 18:30:58)
Python 2.5.1 (r251:54863, Mar 7 2008, 04:10:12)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)]
----------------------------------------------------------------------
>Comment By: Daniel Herding (wikipedian)
Date: 2008-06-21 02:42
Message:
Logged In: YES
user_id=880694
Originator: YES
Please note that Nicolas Dumazet already written about this on the mailing
list on 2007-11-12: "[Pywikipedia-l] Shouldn't bots stop trying to edit
when blocked ??!"
I don't know if he already suffered from the same bug that I described,
but if he did, then it's a real shame that it hasn't been fixed for more
than a half year.
----------------------------------------------------------------------
Comment By: Daniel Herding (wikipedian)
Date: 2008-06-21 02:38
Message:
Logged In: YES
user_id=880694
Originator: YES
I have now committed a workaround for this bug; it raises a UserBlocked
exception already in _getUserData(), not only in _getEditPage(). This is
not a nice solution, but we cannot tolerate bots which ignore being
blocked.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1999239&group_…
Bugs item #1999239, was opened at 2008-06-21 02:32
Message generated for change (Comment added) made by wikipedian
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1999239&group_…
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: General
Group: None
Status: Open
Resolution: None
Priority: 9
Private: No
Submitted By: Daniel Herding (wikipedian)
Assigned to: Nobody/Anonymous (nobody)
Summary: Blocking bot account doesn't stop the bot run
Initial Comment:
There is a very serious bug in the current version. If someone blocks your bot account, the bot just keeps on running. It prints this message:
WARNING: Your account on wikipedia:de is blocked. Editing using this account will stop the run.
But then it doesn't stop. Instead, it will try to save the page, fail, and happily continue using the sysop account. Sooner or later, someone will also block your sysop account for a few minutes. PyWikipedia then shows this warning:
WARNING: Your sysop account on wikipedia:de is blocked. Editing using this account will stop the run.
Again, it will happily continue, of course failing on each page. After a few minutes, the block will run out, and the bot will continue to make changes.
As far as I can tell, the problem is this: In _getEditPage(), there is this code, which would be responsible for stopping the bot:
if self.site().isBlocked():
raise UserBlocked(self.site(), self.aslink(forceInterwiki = True))
But it looks like _getEditPage() isn't even called, so this check doesn't even happen.
I don't know who is responsible for this, but this is a real pain in the ass, and it needs to be fixed ASAP.
----
Pywikipedia [svn+ssh] wikipedian@trunk/pywikipedia (r5595, Jun 20 2008, 18:30:58)
Python 2.5.1 (r251:54863, Mar 7 2008, 04:10:12)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)]
----------------------------------------------------------------------
>Comment By: Daniel Herding (wikipedian)
Date: 2008-06-21 02:38
Message:
Logged In: YES
user_id=880694
Originator: YES
I have now committed a workaround for this bug; it raises a UserBlocked
exception already in _getUserData(), not only in _getEditPage(). This is
not a nice solution, but we cannot tolerate bots which ignore being
blocked.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1999239&group_…