[#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:118219] [Ruby master Bug#20433] Hash.inspect for some hash returns syntax invalid representation
From:
"tompng (tomoya ishida) via ruby-core" <ruby-core@...>
Date:
2024-06-06 17:49:14 UTC
List:
ruby-core #118219
Issue #20433 has been updated by tompng (tomoya ishida).
I created a proof of concept patch for colon style inspect https://github.com/ruby/ruby/pull/10924
----------------------------------------
Bug #20433: Hash.inspect for some hash returns syntax invalid representation
https://bugs.ruby-lang.org/issues/20433#change-108707
* Author: tompng (tomoya ishida)
* Status: Open
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
For these hashes, Hash.inspect returns a syntax invalid representation:
~~~ruby
{ :a! => 1 } # {:a!=>1}
{ :a? => 1 } # {:a?=>1}
{ :* => 1 } # {:*=>1}
{ :== => 1 } # {:===>1}
{ :< => 1 } # {:<=>1}
~~~
`eval(hash.inspect)` will raise SyntaxError.
Although inspect does not guarantee that the result can be eval-ed, it'd be confusing for these few cases.
Maybe related to https://bugs.ruby-lang.org/issues/20235
--
https://bugs.ruby-lang.org/