diff --git a/openfoodfacts/dataset.py b/openfoodfacts/dataset.py index 845c7db..92726a2 100644 --- a/openfoodfacts/dataset.py +++ b/openfoodfacts/dataset.py @@ -14,6 +14,10 @@ logger = get_logger(__name__) +# Increase field_size to accommodate large fields. +# sys.maxsize will overflow on windows so using max 32-bit integer instead. +csv.field_size_limit(pow(2, 31) - 1) + DEFAULT_CACHE_DIR = Path("~/.cache/openfoodfacts/datasets").expanduser() DATASET_FILE_NAMES = {