[#106341] [Ruby master Bug#18369] users.detect(:name, "Dorian") as shorthand for users.detect { |user| user.name == "Dorian" } — dorianmariefr <noreply@...>
Issue #18369 has been reported by dorianmariefr (Dorian Mari辿).
14 messages
2021/11/30
[#106351] [Ruby master Bug#18371] Release branches (release information in general) — "tenderlovemaking (Aaron Patterson)" <noreply@...>
Issue #18371 has been reported by tenderlovemaking (Aaron Patterson).
7 messages
2021/11/30
[ruby-core:106209] [Ruby master Bug#18350] String with foreign character results in: TypeError (nil can't be coerced into Integer)
From:
"diadbrown (Dave Brown)" <noreply@...>
Date:
2021-11-22 14:29:58 UTC
List:
ruby-core #106209
Issue #18350 has been updated by diadbrown (Dave Brown).
@jeremyevans0 I don't have 3.0.0 here, and since my Mac is somewhat old I can't get it to install. Maybe someone else on Mac with 3.0.0 can try?
jeremyevans0 (Jeremy Evans) wrote in #note-1:
> I cannot reproduce this on Windows using the default 437 code page (using Ruby 2.7.0) or on OpenBSD (using Ruby 2.7.4):
>
> ```
> C:\Ruby27-x64\bin>chcp
> Active code page: 437
>
> C:\Ruby27-x64\bin>set RUBYOPT=-Ku
>
> C:\Ruby27-x64\bin>irb
> irb(main):001:0> s = "P炭rpura"
> irb(main):002:0> s
> => "P炭rpura"
> irb(main):003:0> RUBY_VERSION
> => "2.7.0"
> ```
>
> ```
> $ RUBYOPT=-Ku irb27
> irb(main):001:0> s = "P炭rpura"
> => "P炭rpura"
> irb(main):002:0> RUBY_VERSION
> => "2.7.4"
> ```
>
> When I try it on Windows with the 65001 (UTF-8) code page, the entire command prompt window containing irb closes (not just the ruby process). I also tried with Ruby 3.0 and got the same result. I can paste the `s = "P炭rpura"` text directly into the command prompt outside of irb, so it doesn't appear to be purely a Windows command prompt issue.
>
> You appear to be running on Mac, so the situation must be different there. Can you reproduce this issue with Ruby 3.0?
----------------------------------------
Bug #18350: String with foreign character results in: TypeError (nil can't be coerced into Integer)
https://bugs.ruby-lang.org/issues/18350#change-94817
* Author: diadbrown (Dave Brown)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-darwin17]
* Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
``` ruby
2.7.2 :001 > s = "P炭rpura"
Traceback (most recent call last):
7: from /Users/xxx/.rvm/rubies/ruby-2.7.2/bin/irb:23:in `<main>'
6: from /Users/xxx/.rvm/rubies/ruby-2.7.2/bin/irb:23:in `load'
5: from /Users/xxx/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/irb-1.2.6/exe/irb:11:in `<top (required)>'
4: from /Users/xxx/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/reline/unicode.rb:99:in `calculate_width'
3: from /Users/xxx/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/reline/unicode.rb:99:in `scan'
2: from /Users/xxx/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/reline/unicode.rb:108:in `block in calculate_width'
1: from /Users/xxx/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/reline/unicode.rb:108:in `+'
TypeError (nil can't be coerced into Integer)
2.7.2 :002 >
```
Ruby 2.6.3 does not have this problem:
``` ruby
2.6.3 :001 > s = "P炭rpura"
=> "P炭rpura"
2.6.3 :002 >
```
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>