ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:95944] [Ruby master Bug#16368] Error in `YAML.load(symbolize_names: true)` with null column YAML
       [not found] <redmine.issue-16368.20191125201905@ruby-lang.org>
@ 2019-11-25 20:19 ` uzukifirst
  0 siblings, 0 replies; only message in thread
From: uzukifirst @ 2019-11-25 20:19 UTC (permalink / raw
  To: ruby-core

Issue #16368 has been reported by kibitan (Chikahiro Tokoro).

----------------------------------------
Bug #16368: Error in `YAML.load(symbolize_names: true)` with null column YAML
https://bugs.ruby-lang.org/issues/16368

* Author: kibitan (Chikahiro Tokoro)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.7.0preview2 (2019-10-22 master 02aadf1032) [x86_64-linux]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
Trying to parse YAML which contains null column `symbolize_names: true` would raise `NoMethodError`


```
irb(main):001:0> require 'yaml'
=> true
irb(main):002:0> YAML.load("null: nullnull")
=> {nil=>"nullnull"}
irb(main):003:0> YAML.load("null: nullnull", symbolize_names: true)
Traceback (most recent call last):
        8: from /usr/local/bin/irb:23:in `<main>'
        7: from /usr/local/bin/irb:23:in `load'
        6: from /usr/local/lib/ruby/gems/2.7.0/gems/irb-1.1.0.pre.3/exe/irb:11:in `<top (required)>'
        5: from (irb):4
        4: from /usr/local/lib/ruby/2.7.0/psych.rb:276:in `load'
        3: from /usr/local/lib/ruby/2.7.0/psych.rb:606:in `symbolize_names!'
        2: from /usr/local/lib/ruby/2.7.0/psych.rb:606:in `each'
        1: from /usr/local/lib/ruby/2.7.0/psych.rb:607:in `block in symbolize_names!'
NoMethodError (undefined method `to_sym' for nil:NilClass
```


I also send a pull request for related repo.
https://github.com/ruby/psych/pull/423



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-11-25 20:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <redmine.issue-16368.20191125201905@ruby-lang.org>
2019-11-25 20:19 ` [ruby-core:95944] [Ruby master Bug#16368] Error in `YAML.load(symbolize_names: true)` with null column YAML uzukifirst

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).