Skip to content
This repository

YAML.load_file to empty file gives false #258

BrandonMathis opened this Issue August 09, 2012 · 3 comments

4 participants

BrandonMathis Charles Oliver Nutter Lucas Aaron Patterson

When parsing a YAML doc.


irb(main):002:0> YAML.load_file File.join("spec","fixtures","empty.yml")
=> false


irb(main):002:0> YAML.load_file File.join("spec","fixtures","empty.yml")
=> {}

Is this expected or would a patch to return an empty hash be accepted?


Hello @KeysetTS!

Ruby 1.9.3 acts the same way, in fact I think it's not a ruby or jruby behavior, because ruby and jruby use the psych as engine to work with yaml [1], [2].

So if you want suggest it, you should do it in the appropriate repository [3].

If I'm mistaken, someone please correct me :)


Charles Oliver Nutter

Yeah, if we match 1.9.3, then this is not our bug. @tenderlove has been working to improve sharing between the JRuby and MRI impls, and would probably welcome a bug report about this.

Charles Oliver Nutter headius closed this September 20, 2012
Aaron Patterson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.