From 9ae5fb8092050a5fd7a5653fdfae7f62f6f970a6 Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Mon, 18 Sep 2017 16:55:26 +0200 Subject: [PATCH] BUG: fix skip intial lines fixes certat/intelmq-webinput-csv#31 --- intelmq_webinput_csv/bin/backend.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/intelmq_webinput_csv/bin/backend.py b/intelmq_webinput_csv/bin/backend.py index 39a503c7..989fbaaa 100644 --- a/intelmq_webinput_csv/bin/backend.py +++ b/intelmq_webinput_csv/bin/backend.py @@ -165,10 +165,12 @@ def upload_file(): if parameters['skipInitialLines']: if parameters['has_header'] and lineindex == 1: for _ in range(parameters['skipInitialLines']): - next(reader) + line = next(reader) + lineindex += 1 elif not parameters['has_header'] and lineindex == 0: for _ in range(parameters['skipInitialLines']): - next(reader) + line = next(reader) + lineindex += 1 if lineindex >= parameters['loadLinesMax']: break if valid_ip_addresses is None: