After upgrading to MW 1.40, trying to login via "python pwb.py login" ends up in an error message:

writeapidenied, you're not allowed to edit this Wiki through the API

I'm logging in using Bot Passwords. LocalSettings.php has writeapi group right enabled for bot users. Previously, this has worked. What am I doing wrong? Should I use OAuth to gain editing rights?