Wrong location displayed in the error message caused by a control character
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 597
- Forks
- 223
- Avg merge
- 11h 23m
- Merged PRs (30d)
- 3
Description
Reproduciton code:
require "yaml"
YAML.load %(foo:\n - "x\u000Cy")
The above YAML text has a control character U+000C, which is not allowed.
The code gives the following error message:
(<unknown>): control characters are not allowed at line 1 column 1 (Psych::SyntaxError)
Though the character is at line 2 column 7, the reported location is line 1 column 1.
It confuses us.
If it is very difficult to display the correct location, I think it is better to display somewhere!
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 with the YAML.load reproduction and the resulting Psych::SyntaxError. Trace how the control character's location is reported through Psych and its libyaml wrapper. Done means the error identifies line 2 column 7, or uses a neutral location such as “somewhere” when the correct position cannot be displayed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, ruby
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100