Topic on Manual talk:Pywikibot

Cannot edit protected namespaces

2
Backlitt (talkcontribs)

I'm running 1.35 and use $wgNamespaceProtection to restrict edit access to several namespaces, including the mainspace. ($wgNamespaceProtection[NS_MAIN] = ['main-edit'])

When I try to make an edit with pywikibot (add_text for example), the bot logs in and reads the page properly, but I'm told that the bot lacks permissions to edit in the "Page" namespace". I've made sure that both the bot and the associated user have the ['main-edit'] = true permission.

When I remove that configuration, the bot edits just fine. It edits other namespaces that don't have the special permission structure.

Is there anything I can do to get around this, other than constantly protecting/unprotecting the namespace.

Legoktm (talkcontribs)

How is your bot authenticating? If you're using BotPasswords or OAuth, you need to make sure the "main-edit" permission is in an appropriate grant (see Manual:$wgGrantPermissions) so the bot session actually has that permission.