-
Notifications
You must be signed in to change notification settings - Fork 123
Closed
Description
I have an application running on Ruby 2.6.6. I'm using the CSV lib like this, and it works fine:
CSV.read(@params[:csv_file].tempfile, headers: true, col_sep: ';', encoding: 'ISO8859-1:utf-8')Since I upgraded to Ruby 2.7.1 I got this error
NoMethodError:
undefined method `close' for #<String:0x0000558b5db78160>
Did you mean? clone
# ./app/services/admin/batch_search_service.rb:15:in `batch_search'
# ./app/services/admin/batch_search_service.rb:9:in `search'
# ./spec/services/admin/batch_search_service_spec.rb:7:in `block (3 levels) in <top (required)>'
# ./spec/services/admin/batch_search_service_spec.rb:140:in `block (4 levels) in <top (required)>'
# ------------------
# --- Caused by: ---
# ArgumentError:
# unknown encoding name - ISO8859-1:utf-8
# ./app/services/admin/batch_search_service.rb:15:in `batch_search'
However, If I use the explicit params it works:
CSV.read(@params[:csv_file].tempfile, headers: true, col_sep: ';', external_encoding: 'ISO8859-1', internal_encoding: 'utf-8')I saw no breaking change on the changelog so I'm assuming that this is not expected.
Ruby version:
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux-musl]
Metadata
Metadata
Assignees
Labels
No labels