The CSV parser seems to call @input.string if @input is a StringIO, but I think it should check if @input.pos is zero before doing that.
require'csv'require'stringio'strio=StringIO.new(<<'EOF')aaa,b,cEOFpstrio.read(2)#=> "aa"pstrio.pos#=> 2pCSV.parse_line(strio)#=> ["aaa", "b", "c"] (["a", "b", "c"] is expected)
This problem was found by @katsyoshi and presented on ruby-jp.slack.com. I tracked it down and identified the causing commit as eeab2ed, which was between v3.0.1 and v3.0.2.
The CSV parser seems to call
@input.stringif@inputis a StringIO, but I think it should check if@input.posis zero before doing that.This problem was found by @katsyoshi and presented on ruby-jp.slack.com. I tracked it down and identified the causing commit as eeab2ed, which was between v3.0.1 and v3.0.2.