can't convert nil into Fixnum in CSV
------------------------------------
Key: JRUBY-2259
URL: http://jira.codehaus.org/browse/JRUBY-2259
Project: JRuby
Issue Type: Bug
Affects Versions: JRuby 1.1RC2
Environment: Fedora 8
Reporter: Dove Cradle
Assignee: Thomas E Enebo
Attachments: csv.log
Here is an example:
require 'csv'
File.open("tmp", "w") do |f|
f << "1,2,3\n4,5,6"
end
p CSV.read("tmp")
Jruby including 1.0.3 and 1.1RC2 both get this output:
can't convert nil into Fixnum
,but ruby-1.8.5 will get:
[["1", "2", "3"], ["4", "5", "6"]]
.
I found this problem is relative to lib/ruby/1.8/csv.rb;
if I changed
CSV.read(path, length = nil, offset = nil)
to
CSV.read(path, length = 1024, offset = 0)
, jruby will get the correct result.
But this modification seems not good.
Any better solution?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email