jenkins-bot submitted this change.

View Change

Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
Do not save the API response from wdeditentity

See the last paragraph of https://www.wikidata.org/w/index.php?diff=prev&oldid=1356933963.
TLDR: The data does not always exactly correspond to what content
the entity has after the update.

Change-Id: I594ff3caf18f51ab4455dc976b6c5249f555f576
---
M pywikibot/page/__init__.py
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/pywikibot/page/__init__.py b/pywikibot/page/__init__.py
index 390dfd1..33e70ab 100644
--- a/pywikibot/page/__init__.py
+++ b/pywikibot/page/__init__.py
@@ -3846,8 +3846,14 @@
if getattr(self, 'id', '-1') == '-1':
self.__init__(self.repo, updates['entity']['id'])

- self._content = updates['entity']
- self.get()
+ # the response also contains some data under the 'entity' key
+ # but it is NOT the actual content
+ # see also [[d:Special:Diff/1356933963]]
+ # TODO: there might be some circumstances under which
+ # the content can be safely reused
+ if hasattr(self, '_content'):
+ del self._content
+ self.latest_revision_id = updates['entity'].get('lastrevid')

def concept_uri(self):
"""

To view, visit change 664050. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I594ff3caf18f51ab4455dc976b6c5249f555f576
Gerrit-Change-Number: 664050
Gerrit-PatchSet: 1
Gerrit-Owner: Matěj Suchánek <matejsuchanek97@gmail.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged