jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/338631 )
Change subject: [Bug] Create attributes when item is being preloaded ......................................................................
[Bug] Create attributes when item is being preloaded
Attributes like labels or claims are only created inside ItemPage.get().
Change-Id: Iec24389546725dd8142374ee755fedea7284fee3 --- M pywikibot/site.py 1 file changed, 2 insertions(+), 0 deletions(-)
Approvals: jenkins-bot: Verified Xqt: Looks good to me, approved
diff --git a/pywikibot/site.py b/pywikibot/site.py index bdf1fb4..7c453fa 100644 --- a/pywikibot/site.py +++ b/pywikibot/site.py @@ -7231,6 +7231,8 @@ for qid in data['entities']: item = pywikibot.ItemPage(self, qid) item._content = data['entities'][qid] + # No api call is made because item._content is given + item.get(get_redirect=True) yield item
def getPropertyType(self, prop):