From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer <michael.tremer@ipfire.org> To: location@lists.ipfire.org Subject: Re: [PATCH] location-importer.in: Fix dangling variable Date: Sun, 14 Aug 2022 17:05:57 +0100 Message-ID: <457B6A9E-8079-470C-8731-583728D91F36@ipfire.org> In-Reply-To: <452c5644-c309-78d0-3d3d-2ef123b08805@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0636352308037075089==" List-Id: <location.lists.ipfire.org> --===============0636352308037075089== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Thx. Merged. > On 14 Aug 2022, at 17:02, Peter M=C3=BCller <peter.mueller(a)ipfire.org> wr= ote: >=20 > This fixes: >=20 > Traceback (most recent call last): > File "/usr/bin/location-importer", line 1607, in <module> > main() > File "/usr/bin/location-importer", line 1605, in main > c.run() > File "/usr/bin/location-importer", line 140, in run > ret =3D args.func(args) > File "/usr/bin/location-importer", line 1234, in handle_update_overrides > self._update_overrides_for_spamhaus_drop() > File "/usr/bin/location-importer", line 1504, in _update_overrides_for_spam= haus_drop > for sline in t.readlines(): > NameError: name 't' is not defined >=20 > Signed-off-by: Peter M=C3=BCller <peter.mueller(a)ipfire.org> > --- > src/scripts/location-importer.in | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/src/scripts/location-importer.in b/src/scripts/location-import= er.in > index 1785791..8d47497 100644 > --- a/src/scripts/location-importer.in > +++ b/src/scripts/location-importer.in > @@ -1499,7 +1499,7 @@ class CLI(object): > # Iterate through every line, filter comments and add remaining ASNs to > # the override table in case they are valid... > with self.db.transaction(): > - for sline in t.readlines(): > + for sline in f.readlines(): > # The response is assumed to be encoded in UTF-8... > sline =3D sline.decode("utf-8") >=20 > --=20 > 2.35.3 --===============0636352308037075089==--