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

--
To view, visit https://gerrit.wikimedia.org/r/533241
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/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 <[email protected]>
Gerrit-Reviewer: D3r1ck01 <[email protected]>
Gerrit-Reviewer: Dalba <[email protected]>
Gerrit-Reviewer: Dvorapa <[email protected]>
Gerrit-Reviewer: Framawiki <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: Zhuyifei1999 <[email protected]>
Gerrit-Reviewer: jenkins-bot (75)
_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits

Reply via email to