jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/533241 )
Change subject: [bugfix] parser method for booleans is "getboolean" but not "getbool" ......................................................................
[bugfix] parser method for booleans is "getboolean" but not "getbool"
Bug: T231565 Change-Id: Ic20245c3294abf2b7c0043a745358a242d81b0e3 --- M pywikibot/bot.py 1 file changed, 7 insertions(+), 3 deletions(-)
Approvals: D3r1ck01: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/bot.py b/pywikibot/bot.py index 6dfb04d..4e01022 100644 --- a/pywikibot/bot.py +++ b/pywikibot/bot.py @@ -1766,12 +1766,16 @@ if not conf.has_option(section, option): continue # use a convenience parser method, default to get() - method = getattr(conf, 'get' + type(value).__name__, - getattr(conf, 'get')) + default = getattr(conf, 'get') + value_type = type(value).__name__ + if value_type == 'bool': + method = getattr(conf, 'getboolean') + else: + method = getattr(conf, 'get' + value_type, default) args[option] = method(section, option) for opt in set(conf.options(section)) - set(args): pywikibot.warning( - opt + ' is not a valid option. It was ignored.') + '"{}" is not a valid option. It was ignored.'.format(opt)) args.update(kwargs) else: args = kwargs
pywikibot-commits@lists.wikimedia.org