From 0724061f76ec91db7d4fecc5e58b09291e4405b5 Mon Sep 17 00:00:00 2001 From: nickfyson Date: Mon, 18 Dec 2023 10:05:44 +0000 Subject: [PATCH] preserve trailing whitespace when transforming CHANGELOG --- .github/update-release-branch.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/update-release-branch.py b/.github/update-release-branch.py index f9587884b..7274a6305 100644 --- a/.github/update-release-branch.py +++ b/.github/update-release-branch.py @@ -187,9 +187,9 @@ def process_changelog_for_backports(source_branch_major_version, target_branch_m # until we find the first section, just duplicate all lines while True: - line = f.readline().rstrip() + line = f.readline() - output += line + '\n' + output += line if line.startswith('## '): line = line.replace(f'## {source_branch_major_version}', f'## {target_branch_major_version}') # we have found the first section, so now handle things differently @@ -202,7 +202,7 @@ def process_changelog_for_backports(source_branch_major_version, target_branch_m line = f.readline() if not line: break # EOF - line = line.rstrip() + line = line.rstrip('\n') # filter out changenote entries that apply only to newer versions match = some_versions_only_regex.search(line)