From: Michael Tremer Date: Sat, 3 Jan 2026 13:32:01 +0000 (+0000) Subject: sources: Strip any excess whitespace after the comments have been removed X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22d89c562a3957f3f76fb719c18dc2c70ce1f736;p=dbl.git sources: Strip any excess whitespace after the comments have been removed Signed-off-by: Michael Tremer --- diff --git a/src/dnsbl/sources.py b/src/dnsbl/sources.py index 01868ac..c3fcd99 100644 --- a/src/dnsbl/sources.py +++ b/src/dnsbl/sources.py @@ -222,11 +222,12 @@ class Source(sqlmodel.SQLModel, database.BackendMixin, table=True): # Add all domains for line in f: - line = line.rstrip() - # Strip any comments line, hashtag, comment = line.partition("#") + # Strip away any whitespace + line = line.strip() + # Skip the line if it is empty if not line: continue