Skip to content

Commit

Permalink
fix: increase csv field_size_limit to accommodate large fields
Browse files Browse the repository at this point in the history
  • Loading branch information
gitting authored and raphael0202 committed Oct 8, 2024
1 parent 6faadc1 commit 94be4d3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions openfoodfacts/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 94be4d3

Please sign in to comment.