jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/237113 )
Change subject: api.py: buffer 'pageprops' in QueryGenerator ......................................................................
api.py: buffer 'pageprops' in QueryGenerator
Currently, 'pageprops' is only cached if found in the response. The API only returns this property if it's not empty, causing repetitive queries if accessed multiple times. This change caches 'pageprops' if it's requested, creating an empty dictionary to use if it's not present in the response.
Change-Id: I30973b7479822ebc043f1d4db77522143e8c5652 --- M pywikibot/data/api.py 1 file changed, 2 insertions(+), 0 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py index ff90b25..4c34108 100644 --- a/pywikibot/data/api.py +++ b/pywikibot/data/api.py @@ -3173,6 +3173,8 @@
if 'pageprops' in pagedict: page._pageprops = pagedict['pageprops'] + elif 'pageprops' in props: + page._pageprops = {}
if 'preload' in pagedict: page._preloadedtext = pagedict['preload']
pywikibot-commits@lists.wikimedia.org