jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/473747 )
Change subject: [bugfix] Disable empty sections cc in userspace ......................................................................
[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(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
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
pywikibot-commits@lists.wikimedia.org