Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange FrozenError on Psych.load #659

Open
shyouhei opened this issue Nov 22, 2023 · 1 comment
Open

Strange FrozenError on Psych.load #659

shyouhei opened this issue Nov 22, 2023 · 1 comment

Comments

@shyouhei
Copy link
Member

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

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

Possibilities:

  • Psych should accept this YAML and properly return a frozen, recursive hash.
  • Psych should raise Psych::AnchorNotDefined instead of FrozenError.
  • FrozenError is the legit exception here.

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

@tenderlove
Copy link
Member

  • 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants