jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/784705 )
Change subject: [bugfix] Remove multiple empty lines from archived page ......................................................................
[bugfix] Remove multiple empty lines from archived page
Simplify fix trailing newlines
Bug: T306529 Change-Id: I8c60c6ad16848b15682a4cf240da491f499fedd8 --- M scripts/archivebot.py 1 file changed, 1 insertion(+), 1 deletion(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/archivebot.py b/scripts/archivebot.py index ddd9802..2b02bf7 100755 --- a/scripts/archivebot.py +++ b/scripts/archivebot.py @@ -497,7 +497,7 @@ if sort_threads: pywikibot.output('Sorting threads...') self.threads.sort(key=lambda t: t.timestamp) - newtext = re.sub('\n*$', '\n\n', self.header) # Fix trailing newlines + newtext = self.header.strip() + '\n\n' # Fix trailing newlines for t in self.threads: newtext += t.to_text() if self.full:
pywikibot-commits@lists.wikimedia.org