jenkins-bot has submitted this change and it was merged.
Change subject: [FEAT] Api: Check for every single warning and not all at once ......................................................................
[FEAT] Api: Check for every single warning and not all at once
The warning handler was designed that it's executed for each separate warning and not for mutliple warnings in the same 'mod'.
Change-Id: I1c4f126487da6db0e460ba7d3d7b6edf5e42b15d --- M pywikibot/data/api.py 1 file changed, 5 insertions(+), 3 deletions(-)
Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py index 229b88a..0e846ae 100644 --- a/pywikibot/data/api.py +++ b/pywikibot/data/api.py @@ -381,9 +381,11 @@ u'API warning ({0})of unknown format: {1}'. format(mod, warning)) continue - if (not callable(self._warning_handler) or - not self._warning_handler(mod, text)): - pywikibot.warning(u"API warning (%s): %s" % (mod, text)) + # multiple warnings are in text separated by a newline + for single_warning in text.splitlines(): + if (not callable(self._warning_handler) or + not self._warning_handler(mod, single_warning)): + pywikibot.warning(u"API warning (%s): %s" % (mod, single_warning))
def submit(self): """Submit a query and parse the response.