bank-statement-reconcile: import of bank statement fails to sniff the csv
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Banking Addons |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
When importing a CSV file with account_
I have some CSV files that cannot be detected, ending with an error: Error: Could not determine delimiter
Example of CSV that can't be sniffed (with many more lines):
transaction_
1524624,2014-02-18 00:00:00,
1524635,2014-02-18 00:00:00,
1524637,2014-02-18 00:00:00,
1524643,2014-02-18 00:00:00,
1524660,2014-02-18 00:00:00,
1524662,2014-02-18 00:00:00,
1524693,2014-02-18 00:00:00,
1524704,2014-02-18 00:00:00,
1524712,2014-02-18 00:00:00,
1524730,2014-02-18 00:00:00,
1524732,2014-02-18 00:00:00,
1524735,2014-02-18 00:00:00,
1524737,2014-02-18 00:00:00,
1524740,2014-02-18 00:00:00,
1524751,2014-02-18 00:00:00,
1524762,2014-02-18 00:00:00,
1524766,2014-02-18 00:00:00,
1524773,2014-02-18 00:00:00,
1524775,2014-02-18 00:00:00,
Currently the code is:
sniffer = csv.Sniffer()
pos = utf8_data.tell()
sample_data = utf8_data.
utf8_
From my analysis, it seems that the sample of 1024 bytes is insufficient to guess the delimiter for this type of files. Raising it to 2048 bytes allowed it to guess the delimiter correctly.
Related branches
- Yannick Vaucher @ Camptocamp: Approve (code review, no tests)
- Laurent Mignon (Acsone) (community): Approve (code review)
- Leonardo Pistone: Approve
- Pedro Manuel Baeza: Approve (code review)
-
Diff: 12 lines (+1/-1)1 file modifiedaccount_statement_base_import/parser/parser.py (+1/-1)
Changed in banking-addons: | |
status: | New → Fix Released |