[#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:106068] [Ruby master Bug#18338] Encoding.default_external = Encoding::UTF_16BE may add a wrongly-encoded string to $LOADED_FEATURES
From:
"mame (Yusuke Endoh)" <noreply@...>
Date:
2021-11-15 07:32:32 UTC
List:
ruby-core #106068
Issue #18338 has been updated by mame (Yusuke Endoh).
This issue causes a random failure of make test-all.
http://ci.rvm.jp/results/trunk-test@ruby-sky1/3711615
```
/tmp/ruby/v3/src/trunk-test/test/io/console/test_io_console.rb:11:in `===': incompatible encoding regexp match (US-ASCII regexp with UTF-16BE string) (Encoding::CompatibilityError)
```
When `test_object_inspect_external` in test/ruby/test_m17n.rb is executed first, it adds a wrong UTF-16 path to $LOADED_FEATURES. And then, test/io/console/test_io_console.rb applies a regexp to strings in $LOADED_FEATURES. It highly depends on the order of tests, which made the failure inconsistent.
@naruse-san said that we don't pay effort for this issue soon, so I'd like to skip `test_object_inspect_external` to prevent the random test failure.
----------------------------------------
Bug #18338: Encoding.default_external = Encoding::UTF_16BE may add a wrongly-encoded string to $LOADED_FEATURES
https://bugs.ruby-lang.org/issues/18338#change-94658
* Author: mame (Yusuke Endoh)
* Status: Open
* Priority: Normal
* Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
```
# coding: US-ASCII
Encoding.default_external = Encoding::UTF_16BE
"abc".encode(Encoding.default_external)
p $LOADED_FEATURES.last.encoding #=> #<Encoding:UTF-16BE>
p $LOADED_FEATURES.last
#=> "\u2F68\u6F6D\u652F\u6D61\u6D65\u2F77\u6F72\u6B2F\u7275\u6279\u2F6C\u6F63\u616C\u2F6C\u6962\u2F72\u7562\u792F\u332E\u312E\u302F\u7838\u365F\u3634\u2D6C\u696E\u7578\u2F65\u6E63\u2F74\u7261\u6E73\u2F75\u7466\u5F31\u365F\u3332\u2E73\x6F"
```
This weird string seems `"/home/mame/work/ruby/local/lib/ruby/3.1.0/x86_64-linux/enc/trans/utf_16_32.s\u0000o".force_encoding("UTF-16BE")`.
Note that the code may raise a "code converter not found" error depending on the length of install path (or build path?). Maybe it works if it is even due to UTF-16.
```
# works
mame$ /Users/mame/ruby2/exe/ruby --disable-gems test.rb
#<Encoding:UTF-16BE>
"\u2F55\u7365\u7273\u2F6D\u616D\u652F\u7275\u6279\u322F\u2E65\u7874\u2F78\u3836\u5F36\u342D\u6461\u7277\u696E\u3139\u2F65\u6E63\u2F74\u7261\u6E73\u2F73\u696E\u676C\u655F\u6279\u7465\u2E62\u756E\u646C\x65"
```
```
# raises an exception
mame$ /Users/mame/ruby22/exe/ruby --disable-gems test.rb
0ec: 0x0
test.rb:4:in `encode': code converter not found (US-ASCII to UTF-16BE) (Encoding::ConverterNotFoundError)
from test.rb:4:in `<main>'
test.rb:4:in `encode': No such file or directory @ rb_check_realpath_internal - 篆慕婚迚ウ篆ュ諷ュ謾ッ迚オ謇ケ繹イ箴ョ謨ク逅ッ遐ク纖溘亢箏、諷イ逹ゥ貂ア网ッ謨ョ謖ッ迹イ諷ョ迪ッ迯ゥ貉ァ豎・蠖「逾エ謾ョ謇オ貉、豎・ (Errno::ENOENT)
from test.rb:4:in `<main>'
```
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>