VcamX added a comment.
@jayvdb @Nullzero I found out what causes this bug. When we do an edit, the parameter botflag https://github.com/wikimedia/pywikibot-core/blob/master/pywikibot/page.py#1004 of function `save` in pywikibot-core/page will decide whether this edit will have botflag or not. This line https://github.com/wikimedia/pywikibot-core/blob/master/pywikibot/page.py#L1030 will check the user right. If A performing sysop action first, it will cached sysop cookie in `pywikibot.lwp`. Then B performing a bot action without executing like `site.login()` first and doing an edit, the botflag will be set as false since the pywikibot will check user right using sysop cookie, and of course there's no `bot` in `site.userinfo['rights']`. Although we have decorator `must_be` for editpage (see this https://github.com/wikimedia/pywikibot-core/blob/master/pywikibot/site.py#L4033) which will check the user when doing an edit. The botflag is set as false before the decorator `must_be` works.
TASK DETAIL https://phabricator.wikimedia.org/T57140
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: VcamX Cc: VcamX, jayvdb, Nullzero, Xqt, Legoktm, pywikipedia-bugs
pywikipedia-bugs@lists.wikimedia.org