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,c
EOF
p strio.read(2) #=> "aa"
p strio.pos #=> 2
p CSV.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 eeab2ede, which was between v3.0.1 and v3.0.2.
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.This problem was found by @katsyoshi and presented on ruby-jp.slack.com. I tracked it down and identified the causing commit as eeab2ede, which was between v3.0.1 and v3.0.2.