[#111472] [Ruby master Bug#19274] Error installing ruby 3.2.0 on RH 8 — "aalllop (Alberto Allegue) via ruby-core" <ruby-core@...>
Issue #19274 has been reported by aalllop (Alberto Allegue).
5 messages
2022/12/28
[#111508] Data support for versions before 3.2.0 — Eustáquio Rangel via ruby-core <ruby-core@...>
I was wondering that every piece of code (gems, etc) that use the new Data =
3 messages
2022/12/29
[ruby-core:111224] [Ruby master Bug#19167] Object#inspect does not correctly show NilClass TrueClass and FalseClass stored in instance variables
From:
"alanwu (Alan Wu)" <noreply@...>
Date:
2022-12-06 21:19:52 UTC
List:
ruby-core #111224
Issue #19167 has been updated by alanwu (Alan Wu).
Currently it's using a format string with `"%+"PRIsVALUE`,
which calls rb_inspect() for most values, but with special-case
handling for a NilClass and friends. The special handling was
introduced in commit:4191a6b90d3eeb63a31609dba29a1904efee3738:
```diff
diff --git a/sprintf.c b/sprintf.c
index 4549791d2029e..afe27c2d63ae3 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -1338,6 +1338,26 @@ ruby__sfvextra(rb_printf_buffer *fp, size_t valsize, void *valp, long *sz, int s
rb_raise(rb_eRuntimeError, "rb_vsprintf reentered");
}
if (sign == '+') {
+ if (RB_TYPE_P(value, T_CLASS)) {
+# define LITERAL(str) (*sz = rb_strlen_lit(str), str)
+
+ if (value == rb_cNilClass) {
+ return LITERAL("nil");
+ }
+ else if (value == rb_cFixnum) {
+ return LITERAL("Fixnum");
+ }
+ else if (value == rb_cSymbol) {
+ return LITERAL("Symbol");
+ }
+ else if (value == rb_cTrueClass) {
+ return LITERAL("true");
+ }
+ else if (value == rb_cFalseClass) {
+ return LITERAL("false");
+ }
+# undef LITERAL
+ }
value = rb_inspect(value);
```
The commit is titled "preserve encodings in error messages",
and none of the other changes use the `+` modifier. Maybe the special
handling was added by accident?
----------------------------------------
Bug #19167: Object#inspect does not correctly show NilClass TrueClass and FalseClass stored in instance variables
https://bugs.ruby-lang.org/issues/19167#change-100514
* Author: tompng (tomoya ishida)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-darwin20]
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
~~~ruby
Object.new.instance_eval do
@a = nil
@b = NilClass
@c = true
@d = TrueClass
@e = [nil, NilClass, true, TrueClass]
puts self.inspect
end
# actual
# => #<Object:0x2f15e3c8 @a=nil, @b=nil, @c=true, @d=true, @e=[nil, NilClass, true, TrueClass]>
# expected
# => #<Object:0x2f15e3c8 @a=nil, @b=NilClass, @c=true, @d=TrueClass, @e=[nil, NilClass, true, TrueClass]>
~~~
---Files--------------------------------
0001-Fix-Object-inspect-with-NilClass-as-an-ivar.patch (751 Bytes)
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- [email protected]
To unsubscribe send an email to [email protected]
ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/