jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/762101 )
Change subject: pywikibot: Fix KeyError in create_warnings_list ......................................................................
pywikibot: Fix KeyError in create_warnings_list
create_warnings_list() was looking for an offset entry in the passed-in response dict which is (no longer?) being set for that code path. This patch uses the _offest argument to upload() instead.
Bug: T301610 Change-Id: Ibe63befb6f80a0831adee446c66c4fb875ff0b1d --- M pywikibot/site/_apisite.py 1 file changed, 2 insertions(+), 5 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/site/_apisite.py b/pywikibot/site/_apisite.py index 305dc01..faf8f03 100644 --- a/pywikibot/site/_apisite.py +++ b/pywikibot/site/_apisite.py @@ -2954,11 +2954,8 @@ _file_key = None
if not report_success: - if source_filename: - offset = result.setdefault('offset', True) - else: - offset = False - + result.setdefault('offset', bool(source_filename)) + offset = result['offset'] if source_filename else False if ignore_warnings(create_warnings_list(result)): return self.upload( filepage, source_filename=source_filename,
pywikibot-commits@lists.wikimedia.org