Merlijn van Deen has submitted this change and it was merged.
Change subject: [FIX] Siteinfo: Correctly compare cache time ......................................................................
[FIX] Siteinfo: Correctly compare cache time
The expiry check worked backwards and didn't actually check if the cached time was in the past (adding the expiry).
Bug: T94293 Change-Id: I7e43b0191b945c76dd19e30a560431bea928e4a0 --- M pywikibot/site.py 1 file changed, 2 insertions(+), 1 deletion(-)
Approvals: Merlijn van Deen: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/site.py b/pywikibot/site.py index 457a917..1b1bef0 100644 --- a/pywikibot/site.py +++ b/pywikibot/site.py @@ -1226,7 +1226,8 @@ elif not cache_date: # default values are always expired return True else: - return cache_date + expire >= datetime.datetime.utcnow() + # cached date + expiry are in the past if it's expired + return cache_date + expire < datetime.datetime.utcnow()
def _get_general(self, key, expiry): """
pywikibot-commits@lists.wikimedia.org