From: "byroot (Jean Boussier) via ruby-core" Date: 2023-06-21T08:09:50+00:00 Subject: [ruby-core:113962] [Ruby master Bug#19739] Key cannot be found in a Hash when slice! method is applied to the key Issue #19739 has been updated by byroot (Jean Boussier). OK fix is here: https://github.com/ruby/ruby/pull/7965 ---------------------------------------- Bug #19739: Key cannot be found in a Hash when slice! method is applied to the key https://bugs.ruby-lang.org/issues/19739#change-103616 * Author: ilya.andreyuk (Ilya Andreyuk) * Status: Open * Priority: Normal * ruby -v: 3.1.4 * Backport: 3.0: REQUIRED, 3.1: REQUIRED, 3.2: DONTNEED ---------------------------------------- Hello, Key cannot be found in a Hash when slice! method is applied to the key. I cannot reproduce this behaviour with sub! or gsub! methods: ``` ruby hash = {} key = "ABC O�" key.slice!(/ o�$/i) # key.sub!(/ o�$/i, '') # key.gsub!(/ o�$/i, '') hash[key] = true "#{key} in #{hash}: value is #{hash[key]}" => "ABC in {\"ABC\"=>true}: value is " ``` Also it seems that ruby 2.7.6 and 3.2.2 don't have this issue. -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/