Using single-column quoted csv file of this format:
"one-one"
"two-two"
"three-three"
...
If the file is small (say 3,000 rows), it generates an error: _csv.Error: Could not determine delimiter
But if the file is large (say 30,000 rows) the process appears to hang.
Here is a code sample that reproduces this behavior:
import csv
from uuid import uuid4
items = []
items = [f'"{uuid4()}"' for _ in range(30_000)]
print('1. Created uuids')
csv_data = '\n'.join(items)
print('2. Joined')
with open('output', 'w') as h:
h.write(csv_data)
print('3. Wrote output')
sniffer = csv.Sniffer()
# This is the line than hangs
dialect = sniffer.sniff(csv_data, delimiters=',:|\t')
print(f'4. Sniffed delimiter "{dialiect.delimiter}"')
Using single-column quoted csv file of this format:
If the file is small (say 3,000 rows), it generates an error:
_csv.Error: Could not determine delimiterBut if the file is large (say 30,000 rows) the process appears to hang.
Here is a code sample that reproduces this behavior: