Xqt has submitted this change and it was merged.

Change subject: Populate the revision dict if lastrev is not in it.
......................................................................


Populate the revision dict if lastrev is not in it.

This allows avoinding a KeyError when the timestamp is extracted.

Bug: 54995
Change-Id: I1f97dac718dc6b645b1b35af4a894b84e14e6385
---
M pywikibot/site.py
1 file changed, 2 insertions(+), 0 deletions(-)

Approvals:
  Xqt: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/pywikibot/site.py b/pywikibot/site.py
index f14132c..fff2fe0 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -2691,6 +2691,8 @@
         if bot:
             params["bot"] = ""
         if lastrev is not None:
+            if lastrev not in page._revisions:
+                self.loadrevisions(page)
             params["basetimestamp"] = page._revisions[lastrev].timestamp
         if minor:
             params['minor'] = ""

-- 
To view, visit https://gerrit.wikimedia.org/r/87915
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1f97dac718dc6b645b1b35af4a894b84e14e6385
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen <valhall...@arctus.nl>
Gerrit-Reviewer: Ladsgroup <ladsgr...@gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: Xqt <i...@gno.de>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to