Bugs item #1949476, was opened at 2008-04-23 11:09 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1949476...
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: NicDumZ — Nicolas Dumazet (nicdumz) Assigned to: Nobody/Anonymous (nobody) Summary: Nasty weird bug involving preloadingGenerator & canBeEdited
Initial Comment: I realized that sometimes, in blockpageschecker.py, someTotalProtectedPage.canBeEdited() would wrongly return True (I have no sysop account, hence on every [edit=sysop] protected page, it should return False)
I first tried the single canBeEdited() on that total protected page :
import wikipedia; s = wikipedia.Site('fr', 'wikipedia'); protectedpage = wikipedia.Page(s, 'Zentrum')
Checked for running processes. 1 processes currently running, including the current process.
protectedpage.canBeEdited()
Getting 1 pages from wikipedia:fr... False
Which is fine.
However :
import wikipedia; s = wikipedia.Site('fr', 'wikipedia'); protectedpage = wikipedia.Page(s, 'Zentrum')
Checked for running processes. 1 processes currently running, including the current process.
import pagegenerators; gen = pagegenerators.PreloadingGenerator([protectedpage]) for p in gen : print p.canBeEdited()
... Getting 1 pages from wikipedia:fr... True
protectedpage.canBeEdited()
True
Which is wrong.
I then thought then calling canBeEdited on a total protected page from PreloadingGenerator would _every_time_ return wrongly True, but I was wrong :
import wikipedia; s = wikipedia.Site('en', 'wikipedia'); protectedpage = wikipedia.Page(s, 'Wikipedia:site support')
Checked for running processes. 1 processes currently running, including the current process.
import pagegenerators; gen = pagegenerators.PreloadingGenerator([protectedpage]) for p in gen : print p.canBeEdited()
... Getting 1 pages from wikipedia:en... False
So apparently, in some special cases, calling canBeEdited on a total protected page from PreloadingGenerator returns True. However I have not been able to find *when* exactly this happens.
Any thoughts ?
PS : An easy fix for this is to get rid of the current implementation of canBeEdited, to use instead the new getRestrictions using the API (getRestrictions()['edit']). But we should find out what is happenning here, since we might miss something important.
----------------------------------------------------------------------
You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1949476...