-
Notifications
You must be signed in to change notification settings - Fork 194
Closed
Description
From ruby/net-imap#470 (comment) by @nevans
@eregon here's the issue I saw with
IO#gets(CRLF, limit)
:
#!/usr/bin/env ruby
puts ?=*72
puts "Ruby Engine: #{RUBY_ENGINE} #{RUBY_ENGINE_VERSION}"
require 'bundler/inline'
gemfile do
gem "stringio", ">= 3.1.7"
end
require "stringio"
puts "Using StringIO #{StringIO::VERSION}"
io = StringIO.new("123456789\r\n123456789\r\n")
pp stringio: io.gets("\r\n", 10)
r, w = IO.pipe
w.write "123456789\r\n123456789\r\n"
w.close
pp io_pipe: r.gets("\r\n", 10)
__END__
$ ruby test.rb && RBENV_VERSION=truffleruby-24.2.1 ruby test.rb
========================================================================
Ruby Engine: ruby 3.4.2
Using StringIO 3.1.7
{stringio: "123456789\r"}
{io_pipe: "123456789\r"}
========================================================================
Ruby Engine: truffleruby 24.2.1
Using StringIO 3.0.1
{:stringio=>"123456789\r\n"}
{:io_pipe=>"123456789\r"}
I didn't make a TruffleRuby ticket for this. I'm guessing this is already a known issue, given that it silently failed to use a newer version of
StringIO
(even after I manually gem installed it). And it looks like it only affects the test which uses StringIO and probably doesn't affect real IO.
Metadata
Metadata
Assignees
Labels
Type
Projects
Relationships
Development
Select code repository
Activity
[-]StringIO#.gets("\r\n", 10) returns an extra \n[/-][+]StringIO#gets("\r\n", 10) returns an extra \n[/+]andrykonchin commentedon May 27, 2025
Fixed in 2173a93