jenkins-bot merged this change.

View Change

Approvals: D3r1ck01: Looks good to me, approved jenkins-bot: Verified
[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.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic20245c3294abf2b7c0043a745358a242d81b0e3
Gerrit-Change-Number: 533241
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki@aol.com>
Gerrit-Reviewer: Dalba <dalba.wiki@gmail.com>
Gerrit-Reviewer: Dvorapa <dvorapa@seznam.cz>
Gerrit-Reviewer: Framawiki <framawiki@tools.wmflabs.org>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: Zhuyifei1999 <zhuyifei1999@gmail.com>
Gerrit-Reviewer: jenkins-bot (75)