kantan.csv icon indicating copy to clipboard operation
kantan.csv copied to clipboard

StackOverflowError when parsing csv with different then expected cell separator and quoted cells

Open marq opened this issue 1 year ago • 0 comments

Tested on master (d83a0ac438bb7f2c3a57aef124b1f5edc8ad5dcb) and v0.7.0

new File("/home/x/test2.csv")
      .asCsvReader[(String, String)](CsvConfiguration.rfc)
      .toList
Exception in thread "sbt-bg-threads-1" java.lang.StackOverflowError
	at kantan.csv.engine.InternalReader.hasNextChar(InternalReader.scala:66)
	at kantan.csv.engine.InternalReader.escapedCell(InternalReader.scala:174)
	at kantan.csv.engine.InternalReader.escapedCellEnd(InternalReader.scala:169)
	at kantan.csv.engine.InternalReader.escapedCell(InternalReader.scala:186)
	at kantan.csv.engine.InternalReader.escapedCellEnd(InternalReader.scala:169)
	at kantan.csv.engine.InternalReader.escapedCell(InternalReader.scala:186)
	at kantan.csv.engine.InternalReader.escapedCellEnd(InternalReader.scala:169)
	at kantan.csv.engine.InternalReader.escapedCell(InternalReader.scala:186)
	at kantan.csv.engine.InternalReader.escapedCellEnd(InternalReader.scala:169)
	at kantan.csv.engine.InternalReader.escapedCell(InternalReader.scala:186)
	at kantan.csv.engine.InternalReader.escapedCellEnd(InternalReader.scala:169)
	at kantan.csv.engine.InternalReader.escapedCell(InternalReader.scala:186)
	at kantan.csv.engine.InternalReader.escapedCellEnd(InternalReader.scala:169)
	at kantan.csv.engine.InternalReader.escapedCell(InternalReader.scala:186)
	at kantan.csv.engine.InternalReader.escapedCellEnd(InternalReader.scala:169)
	at kantan.csv.engine.InternalReader.escapedCell(InternalReader.scala:186)
	at kantan.csv.engine.InternalReader.escapedCellEnd(InternalReader.scala:169)
	at kantan.csv.engine.InternalReader.escapedCell(InternalReader.scala:186)
	at kantan.csv.engine.InternalReader.escapedCellEnd(InternalReader.scala:169)
...

Test csv file: test2.csv

marq avatar Oct 23 '23 14:10 marq