jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/593505 )
Change subject: [IMPR] Login in newitem script if necessary ......................................................................
[IMPR] Login in newitem script if necessary
newitem.py needs to be logged in to run the script. Otherwise it raises a strange exception: AttributeError: 'NoneType' object has no attribute 'startswith' which is a proper message for that reason. Therefore force login if necessary tho show a proper message.
Bug: T251520 Change-Id: I0bd09b153ac5dbe7af17d3602f5883218c69a5ac --- M scripts/newitem.py 1 file changed, 2 insertions(+), 0 deletions(-)
Approvals: D3r1ck01: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/newitem.py b/scripts/newitem.py index 0ff8810..49ad12a 100755 --- a/scripts/newitem.py +++ b/scripts/newitem.py @@ -155,6 +155,8 @@ return
bot = NewItemRobot(generator, **options) + if not bot.site.logged_in(): + bot.site.login() user = pywikibot.User(bot.site, bot.site.username()) if bot.getOption('touch') == 'newly' \ and 'autoconfirmed' not in user.groups():
pywikibot-commits@lists.wikimedia.org