Bugs item #2849998, was opened at 2009-09-03 16:35 Message generated for change (Tracker Item Submitted) made by saperski You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2849998...
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: 5 Private: No Submitted By: Marcin Cieslak (saperski) Assigned to: Nobody/Anonymous (nobody) Summary: wikipedia.py revision 7195 breaks protect API (protect.py)
Initial Comment: Pywikipedia (r7196 (wikipedia.py), 2009/09/02, 06:21:03) Python 2.5.1 (r251:54863, Oct 18 2007, 01:42:40) [GCC 3.3.2]
After r7185 protect.py fails with "edit" variable not being defined.
Indeed, this revision has changed the API:
- def protect(self, edit='sysop', move='sysop', unprotect=False, - reason=None, duration = None, cascading = False, prompt=True, throttle=True): - """(Un)protect a wiki page. Requires administrator status. + def protect(self, ec = 'sysop', move = 'sysop', unprotect = False, reason = None, + ec_duration = 'infinite', move_duration = 'infinite', + cascading = False, prompt = True, throttle = True):
I would suggest to revert the parameter name change or to accept the old one for compatibility.
As a workaround, line 122 of protect.py can be changed: --- protect.py (revision 7201) +++ protect.py (working copy) @@ -119,7 +119,7 @@ wikipedia.output(u'Processing page %s' % page.title()) print self.edit, self.move#, self.create page.protect(unprotect=self.unprotect, reason=self.summary, prompt=self.always, - edit=self.edit, move=self.move) + ec=self.edit, move=self.move)
# Asks a valid protection level for "operation". # Returns the protection level chosen by user.
This is SVN revision 7201
----------------------------------------------------------------------
You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2849998...
pywikipedia-bugs@lists.wikimedia.org