Strange `FrozenError` on `Psych.load`
Open
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 597
- Forks
- 223
- Avg merge
- 11h 23m
- Merged PRs (30d)
- 3
Description
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::AnchorNotDefinedinstead ofFrozenError. FrozenErroris the legit exception here.
I have no idea if the YAML in question is valid or not at the first place.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the supplied Psych.safe_load example and determine whether the YAML is valid and how recursive anchors interact with freeze: true. Compare the observed FrozenError with the possible AnchorNotDefined and successful frozen-hash outcomes; done means the behavior is explained and, if needed, covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100