You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While pairing with @st0012 on removing TruffleRuby exclusions from the IRB test suite, we ran into a case where TruffleRuby uses a slightly different exception message than MRI when constructing a symbol from an invalid key. While error messages aren't exactly stable, I think we should try to match MRI where we can do so without too much effort.
MRI 3.1.3:
> ruby -v -e ':"\xAE"'
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [arm64-darwin21]
ruby: invalid symbol in encoding UTF-8 :"\\xAE" (EncodingError)
> ruby -v -e '"\xAE".to_sym'
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [arm64-darwin21]
-e:1:in `to_sym': invalid symbol in encoding UTF-8 :"\\xAE" (EncodingError)
from -e:1:in `<main>'
MRI 3.2.0:
ruby -v -e ':"\xAE"'
ruby 3.2.0 (2022-12-25 revision a528908271) [arm64-darwin21.5.0]
ruby: invalid symbol in encoding UTF-8 :"\xAE" (EncodingError)
> ruby -v -e '"\xAE".to_sym'
ruby 3.2.0 (2022-12-25 revision a528908271) [arm64-darwin21.5.0]
-e:1:in `to_sym': invalid symbol in encoding UTF-8 :"\xAE" (EncodingError)
from -e:1:in `<main>'
TruffleRuby 23.0.0-dev:
> jt ruby -v -e ':"\xAE"'
truffleruby 23.0.0-dev-8bb04d8c, like ruby 3.1.3, GraalVM CE JVM [aarch64-darwin]
truffleruby: invalid encoding symbol (EncodingError)
> jt ruby -v -e '"\xAE".to_sym'
truffleruby 23.0.0-dev-8bb04d8c, like ruby 3.1.3, GraalVM CE JVM [aarch64-darwin]
<internal:core> core/string.rb:155:in `to_sym': invalid encoding symbol (EncodingError)
from -e:1:in `<main>'
I've tried several versions of MRI going back to 2.7.5 and they all use the same message. If it's a historical divergence, it happened a while ago.
The text was updated successfully, but these errors were encountered:
While pairing with @st0012 on removing TruffleRuby exclusions from the IRB test suite, we ran into a case where TruffleRuby uses a slightly different exception message than MRI when constructing a symbol from an invalid key. While error messages aren't exactly stable, I think we should try to match MRI where we can do so without too much effort.
MRI 3.1.3:
MRI 3.2.0:
TruffleRuby 23.0.0-dev:
I've tried several versions of MRI going back to 2.7.5 and they all use the same message. If it's a historical divergence, it happened a while ago.
The text was updated successfully, but these errors were encountered: