github.com/pdaian/flashboys2@v0.0.0-20190718175736-b101c35361f0/csv_hack.py (about)

     1  # QUICK AND DIRTY HACK FROM https://stackoverflow.com/questions/15063936/csv-error-field-larger-than-field-limit-131072
     2  import sys, csv
     3  maxInt = sys.maxsize
     4  
     5  decrement = False
     6  try:
     7      csv.field_size_limit(maxInt)
     8  except OverflowError:
     9      maxInt = int(maxInt/10)
    10      decrement = True
    11  # END HACK
    12