[#118346] [Ruby master Bug#20586] Some filesystem calls in dir.c are missing error handling and can return incorrect results if interrupted — "ivoanjo (Ivo Anjo) via ruby-core" <ruby-core@...>
Issue #20586 has been reported by ivoanjo (Ivo Anjo).
13 messages
2024/06/19
[ruby-core:118272] [Ruby master Bug#20570] Nokey behavior changed since 3.3.
From:
"austin (Austin Ziegler) via ruby-core" <ruby-core@...>
Date:
2024-06-10 14:08:23 UTC
List:
ruby-core #118272
Issue #20570 has been updated by austin (Austin Ziegler).
I believe you=E2=80=99re *defining* with `**nil`, not *calling* with `**nil=
`. Your test should probably be `def foo(*, **); end; p foo(*[], **nil)`.
This does seem to be a bit of a regression for your particular use case.
----------------------------------------
Bug #20570: Nokey behavior changed since 3.3.
https://bugs.ruby-lang.org/issues/20570#change-108766
* Author: ksss (Yuki Kurihara)
* Status: Open
* ruby -v: ruby 3.3.2 (2024-05-30 revision e5a195edf6) [arm64-darwin22]
* Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
I am using code that transfers the following method call, but found that th=
e behavior has changed since CRuby 3.3.
```ruby
receiver_value =3D Set.new
method_name =3D :merge
args =3D [1]
kwargs =3D {}
block =3D nil
receiver_value.__send__(method_name, *args, **kwargs, &block)
# =3D> no keywords accepted (ArgumentError)
```
Upon investigation, I found that the behavior of calling a method using `**=
nil` has changed starting from version 3.3.
```
$ docker run -it --rm rubylang/all-ruby env ALL_RUBY_SINCE=3Druby-2.6 ./all=
-ruby -e 'def foo(*, **nil); end; p foo(*[], **{})'
WARNING: The requested image's platform (linux/amd64) does not match the de=
tected host platform (linux/arm64/v8) and no specific platform was requeste=
d
ruby-2.6.0 -e:1: syntax error, unexpected nil, expecting ')'
def foo(*, **nil); end; p foo(*[], **{})
^~~
exit 1
...
ruby-2.6.10 -e:1: syntax error, unexpected nil, expecting ')'
def foo(*, **nil); end; p foo(*[], **{})
^~~
exit 1
ruby-2.7.0-preview1 -e:1: syntax error, unexpected `nil', expecting ')'
def foo(*, **nil); end; p foo(*[], **{})
^~~
exit 1
ruby-2.7.0-preview2 nil
...
ruby-3.2.4 nil
ruby-3.3.0-preview1 -e:1:in `<main>': no keywords accepted (ArgumentError)
def foo(*, **nil); end; p foo(*[], **{})
^^^^^^^^^
exit 1
...
ruby-3.3.2 -e:1:in `<main>': no keywords accepted (ArgumentError)
def foo(*, **nil); end; p foo(*[], **{})
^^^^^^^^^
exit 1
ruby-3.4.0-preview1 -e:1:in '<main>': no keywords accepted (ArgumentError)
def foo(*, **nil); end; p foo(*[], **{})
^^^^^^^^^
exit 1
```
Is this change intentional?
--=20
https://bugs.ruby-lang.org/