ruby / psych

A libyaml wrapper for Ruby
MIT License
566 stars 205 forks source link

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

Open shyouhei opened 1 year ago

shyouhei commented 1 year 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 10 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.