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.