ruby / psych

A libyaml wrapper for Ruby
MIT License
564 stars 204 forks source link

Strange `FrozenError` on `Psych.load` #659

Open shyouhei opened 11 months ago

shyouhei commented 11 months ago

Is it intentional for the following Ruby code to raise FrozenError ?

Psych.safe_load(<<~'end', aliases: true, freeze: true)
  ---
  foo: &foo
    <<: *foo
end

Possibilities:

I have no idea if the YAML in question is valid or not at the first place.

tenderlove commented 9 months ago
  • Psych should accept this YAML and properly return a frozen, recursive hash.

IMO this is the correct behavior. I'm not sure how hard it is to implement though.