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

Single and Double Colon causes SemanticErrorException #575

Open
geferon opened this issue Feb 4, 2021 · 1 comment
Open

Single and Double Colon causes SemanticErrorException #575

geferon opened this issue Feb 4, 2021 · 1 comment
Labels

Comments

@geferon
Copy link

geferon commented Feb 4, 2021

Describe the bug
I have a file which has a value with two continuous colons, which is a valid YAML value, yet whenever parsing it with this library, it's giving me a SemanticErrorException error.

To Reproduce
The YAML I'm currently using is:

ipv4_bind_ip: 0.0.0.0
ipv6_bind_ip: ::

The exception I get is

YamlDotNet.Core.SemanticErrorException: '(Line: 2, Col: 16, Idx: 38) - (Line: 2, Col: 16, Idx: 38): While scanning a plain scalar value, found invalid mapping.'

For the record, I also tried saving the value as a single colon, which is as well a valid YAML format, and gave me an error as well.

ipv4_bind_ip: 0.0.0.0
ipv6_bind_ip: :
@geferon geferon changed the title Double Colon causes SemanticErrorException Single and Double Colon causes SemanticErrorException Feb 4, 2021
@geferon
Copy link
Author

geferon commented Feb 4, 2021

The same also happens if a string starts with a %, though the exception is different:

YamlDotNet.Core.SyntaxErrorException: '(Line: 1, Col: 38, Idx: 37) - (Line: 1, Col: 39, Idx: 38): While scanning for the next token, found character that cannot start any token.'

with the following file:

ff_detector_round_adminchat_message: %nick has been banned for teamkilling (round detector).

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

No branches or pull requests

2 participants