jenkins-bot merged this change.

View Change

Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
[bugfix] Handle 'mark for deletion' of ItemPage.delete()

Bug: T134563
Change-Id: I06660a1d8750ffce3cf9317afad91daac7e1a5bc
---
M pywikibot/page.py
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/pywikibot/page.py b/pywikibot/page.py
index d8f63fc..570cb6a 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -1910,8 +1910,15 @@
self.site._noMarkDeletePrompt = True
if answer == 'y':
template = '{{delete|1=%s}}\n' % reason
- self.text = template + self.text
- return self.save(summary=reason)
+ # We can't add templates in a wikidata item, so let's use its
+ # talk page
+ if isinstance(self, pywikibot.ItemPage):
+ talk = self.toggleTalkPage()
+ talk.text = template + talk.text
+ talk.save(summary=reason)
+ else:
+ self.text = template + self.text
+ self.save(summary=reason)

@deprecated_args(step=None)
def loadDeletedRevisions(self, total=None):

To view, visit change 434101. To unsubscribe, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I06660a1d8750ffce3cf9317afad91daac7e1a5bc
Gerrit-Change-Number: 434101
Gerrit-PatchSet: 3
Gerrit-Owner: Framawiki <framawiki@tools.wmflabs.org>
Gerrit-Reviewer: John Vandenberg <jayvdb@gmail.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: Zoranzoki21 <zorandori4444@gmail.com>
Gerrit-Reviewer: jenkins-bot <>