From: "jeremyevans0 (Jeremy Evans)" Date: 2022-05-26T22:45:29+00:00 Subject: [ruby-core:108720] [Ruby master Bug#18769] StringIO#each hangs up on some input with `chomp: true` Issue #18769 has been updated by jeremyevans0 (Jeremy Evans). I've submitted a pull request to fix this: https://github.com/ruby/stringio/pull/30 ---------------------------------------- Bug #18769: StringIO#each hangs up on some input with `chomp: true` https://bugs.ruby-lang.org/issues/18769#change-97771 * Author: andrykonchin (Andrew Konchin) * Status: Open * Priority: Normal * ruby -v: ruby 3.0.3 * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- The mentioned StringIO method `#each` (as well as `#readlines` and `#each_line`) may hang up when passed a separator and `chomp: true`: ```ruby require 'stringio' StringIO.new('a||b||c').each("||", chomp: true) { |s| p s } "" "" "" "" "" "" "" ``` The same way behave other two methods: ```ruby StringIO.new('a||b||c').readlines("||", chomp: true) StringIO.new('a||b||c').each_line("||", chomp: true) { |s| p s } ``` -- https://bugs.ruby-lang.org/ Unsubscribe: