jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] upload: Increase stack depth of warnings ......................................................................
[FIX] upload: Increase stack depth of warnings
The `APISite.upload` method is decorated which causes an additional layer in the stack. This is increasing the depth of each warning accordingly.
Change-Id: I0a2e04a7178600deaa040e002004eee886ca2c1c --- M pywikibot/site.py 1 file changed, 3 insertions(+), 3 deletions(-)
Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/site.py b/pywikibot/site.py index 8cb66a8..e50e8ae 100644 --- a/pywikibot/site.py +++ b/pywikibot/site.py @@ -5274,7 +5274,7 @@ '"report_success" is True or None', '"report_success=False" or define ' '"ignore_warnings" as callable/iterable', - 2) + 3) if isinstance(ignore_warnings, Iterable): ignored_warnings = ignore_warnings ignore_warnings = lambda warnings: all(w.code in ignored_warnings @@ -5426,12 +5426,12 @@ return False warn('When ignore_warnings=False in APISite.upload will change ' 'from raising an UploadWarning into behaving like being a ' - 'callable returning False.', DeprecationWarning, 2) + 'callable returning False.', DeprecationWarning, 3) if len(result['warnings']) > 1: warn('The upload returned {0} warnings: ' '{1}'.format(len(result['warnings']), ', '.join(result['warnings'])), - UserWarning, 2) + UserWarning, 3) warning = list(result["warnings"].keys())[0] message = result["warnings"][warning] raise pywikibot.UploadWarning(warning, upload_warnings[warning]