jenkins-bot merged this change.
[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(-)
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
To view, visit change 533241. To unsubscribe, or for help writing mail filters, visit settings.