[#105450] [Ruby master Feature#18228] Add a `timeout` option to `IO.copy_stream` — "byroot (Jean Boussier)" <noreply@...>
Issue #18228 has been reported by byroot (Jean Boussier).
11 messages
2021/09/27
[ruby-core:105250] [Ruby master Bug#18167] JSON.load doesn't symbolize names
From:
"yann.gouverneur (Yann Gouverneur)" <noreply@...>
Date:
2021-09-14 13:03:59 UTC
List:
ruby-core #105250
Issue #18167 has been reported by yann.gouverneur (Yann Gouverneur).
----------------------------------------
Bug #18167: JSON.load doesn't symbolize names
https://bugs.ruby-lang.org/issues/18167
* Author: yann.gouverneur (Yann Gouverneur)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux]
* Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
As per the documentation the JSON#load method should accept _**and use**_ the same parsing options as the JSON#parse one.
Obviously this is not the case:
```
$ ./json_parse_vs_load.rb
JSON.load, no symbolize => OK
{"a"=>1, "b"=>2}
JSON.load, symbolize => KO: keys are not symbols
{"a"=>1, "b"=>2}
JSON.load, no symbolize => OK
{"a"=>1, "b"=>2}
JSON.load, do symbolize => OK
{:a=>1, :b=>2}
```
Either the behavior with parsing options is different between these two methods and the documentation should be updated accordingly or there's a bug in the JSON#load method.
Expecting to have either the documentation updated or the incorrect behavior fixed.
---Files--------------------------------
json_parse_vs_load.rb (669 Bytes)
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>