Actions
Bug #18769
closedStringIO#each hangs up on some input with `chomp: true`
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.0.3
Description
The mentioned StringIO method #each
(as well as #readlines
and #each_line
) may hang up when passed a separator and chomp: true
:
require 'stringio'
StringIO.new('a||b||c').each("||", chomp: true) { |s| p s }
""
""
""
""
""
""
""
The same way behave other two methods:
StringIO.new('a||b||c').readlines("||", chomp: true)
StringIO.new('a||b||c').each_line("||", chomp: true) { |s| p s }
Actions
Like0
Like0Like0