From: Roland Häder Date: Sun, 29 Dec 2024 22:18:45 +0000 (+0100) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=07364d55f33b4338c3645e48416ba60d4448169a;p=fba.git Continued: - need to createa list() of CSV reader object to be able to count total CSV lines --- diff --git a/fba/helpers/processing.py b/fba/helpers/processing.py index 5631f3a..8326d8e 100644 --- a/fba/helpers/processing.py +++ b/fba/helpers/processing.py @@ -158,10 +158,15 @@ def csv_block(blocker: str, url: str, command: str) -> None: logger.debug("Fetched %d Bytes, parsing CSV ...", len(response.content)) reader = csv.DictReader(response.content.decode("utf-8").splitlines(), dialect="unix") - blockdict = list() + logger.debug("reader[]='%s'", type(reader)) + rows = list(reader) + # Init local variables + blockdict = list() cnt = 0 - for row in reader: + + logger.info("Checking %d CSV lines ...", len(rows)) + for row in rows: logger.debug("row[%s]='%s'", type(row), row) domain = severity = reason = None reject_media = reject_reports = False