Page MenuHomePhabricator

page.Save() does not support sysop parameter
Closed, ResolvedPublic


In compat, page.Save can be passed sysop=True to force a sysop edit; in core, the edit just errors out:

"pywikibot.exceptions.PageNotSaved: [[MediaWiki:Gadget-false-blue-links.js]]: protectednamespace-interface: You're not allowed to

edit interface messages"

Version: core-(2.0)
Severity: normal



Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:15 AM
bzimport set Reference to bz58789.
bzimport added a subscriber: Unknown Object (????).

It doesn't work because of "@must_be(group='user')" on top of Site.editpage(). Should I create a new function like Site.editpage_sysop()? Or should I remove "@must_be(group='user')"?

By the way, here is my workaround. It's ugly, though

In APISite

def performAsSysop(self, user)

self._username[False] = user

I think we should adapt the must_be decorator to take a new runtime parameter (e.g. as_group), which would override the group defined by the original function.

(this would adapt kwargs inside must_be.decorator.callee)

I think that new parameter would not be necessary. If we call some functions whose group='user' and there is the parameter sysop=True, obviously we want to call that function as sysop but in user manner (like editing).

Change 111943 had a related patch set uploaded by Nullzero:
Support editing as a sysop

Change 111943 merged by jenkins-bot:
Support editing as a sysop

How to change the status to RESOLVED FIXED?

There should be a selection box below the comment box ('Status: [PATCH_TO_REVIEW v]'). If not, ask Andre ( for 'editbugs' rights.

However, I'm keeping this open, as def save should either get a working 'sysop=...' parameter or a @deprecated('sysop', 'as_group="sysop"') decorator.

Change 112299 had a related patch set uploaded by Nullzero:
Switch sysop parameter to as_group='sysop'

Change 112299 merged by jenkins-bot:
Mark sysop parameter as deprecated