jenkins-bot merged this change.

View Change

Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
[bugfix] Disable empty sections cc in userspace

User sandbox can contain multiple empty sections of newly prepared
article stub. But users don't use nobots/in-use templates
in their userspace, therefore bots should not remove these empty
sections from the page.

Change-Id: I7a588887b24954ebcb8a8a5295b4b84929c4c2ea
---
M pywikibot/cosmetic_changes.py
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/pywikibot/cosmetic_changes.py b/pywikibot/cosmetic_changes.py
index 01fbcdf..7b389a4 100755
--- a/pywikibot/cosmetic_changes.py
+++ b/pywikibot/cosmetic_changes.py
@@ -662,6 +662,10 @@

def removeEmptySections(self, text):
"""Cleanup empty sections."""
+ # userspace contains article stubs without nobots/in use templates
+ if self.namespace == 2:
+ return text
+
skippings = ['comment', 'category']
skip_regexes = _get_regexes(skippings, self.site)
# site defined templates

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

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I7a588887b24954ebcb8a8a5295b4b84929c4c2ea
Gerrit-Change-Number: 473747
Gerrit-PatchSet: 3
Gerrit-Owner: Dvorapa <dvorapa@seznam.cz>
Gerrit-Reviewer: D3r1ck01 <alangiderick@gmail.com>
Gerrit-Reviewer: Dalba <dalba.wiki@gmail.com>
Gerrit-Reviewer: Dvorapa <dvorapa@seznam.cz>
Gerrit-Reviewer: Framawiki <framawiki@tools.wmflabs.org>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: Zhuyifei1999 <zhuyifei1999@gmail.com>
Gerrit-Reviewer: jenkins-bot (75)