From fa5dccf15a568cd389cfb86c0ce0fca3cd3096dc Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Thu, 7 Mar 2024 14:03:16 +0000 Subject: [PATCH] importer: Convert the file handle to text before passing to the CSV parser Signed-off-by: Michael Tremer --- src/scripts/location-importer.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/scripts/location-importer.in b/src/scripts/location-importer.in index c9fd9a8..88f422f 100644 --- a/src/scripts/location-importer.in +++ b/src/scripts/location-importer.in @@ -22,6 +22,7 @@ import asyncio import csv import functools import http.client +import io import ipaddress import json import logging @@ -964,6 +965,9 @@ class CLI(object): self._parse_line(line, source, countries) async def _import_arin_as_names(self, source, countries, f, *args): + # Wrap the data to text + f = io.TextIOWrapper(f) + # Walk through the file for line in csv.DictReader(f, dialect="arin"): log.debug("Processing object: %s" % line) -- 2.47.2