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'] = ""