From 8dfec59527a75145c94d5c5e5abe30369869eee5 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Wed, 31 May 2023 10:41:53 +0200 Subject: patch_series: Ignore whitespace lines E.g. python-coverage has a form feed in the series file. Closes: #1030534 Thanks: Ian Jackson for the detailed report --- gbp/patch_series.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gbp/patch_series.py b/gbp/patch_series.py index 4ce0327f..04e495f4 100644 --- a/gbp/patch_series.py +++ b/gbp/patch_series.py @@ -334,6 +334,7 @@ class PatchSeries(list): >>> PatchSeries._read_series(['a/b', ... 'a -p1 # comment', + ... ' ', ... 'a/b -p2'], '.') ... # doctest:+NORMALIZE_WHITESPACE [, @@ -349,8 +350,11 @@ class PatchSeries(list): @type patch_dir: string """ queue = PatchSeries() + ws = re.compile('^\\s+$') for line in series: try: + if ws.match(line): + continue if line[0] in ['\n', '#']: continue except IndexError: -- cgit v1.2.3