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

Yaml with a key called "on" parsed as True #744

Closed
Puneeth-n opened this issue Aug 22, 2023 · 4 comments
Closed

Yaml with a key called "on" parsed as True #744

Puneeth-n opened this issue Aug 22, 2023 · 4 comments

Comments

@Puneeth-n
Copy link

Hi, I am rather facing a weird issue with pyyaml library where a yaml string is not being parsed properly. the on key is parsed as boolean True. Any idea what is happening?

PyYAML==6.0 also tried the latest 5.x release

>>> import yaml
>>> yaml.full_load('on: {}')
{True: {}}
@nitzmahone
Copy link
Member

Duplicate of many issues, eg, #613 - by design until PyYAML properly supports YAML 1.2 behavior.

@nitzmahone nitzmahone closed this as not planned Won't fix, can't repro, duplicate, stale Aug 22, 2023
@nitzmahone
Copy link
Member

(see also #376 (comment) for a workaround)

@Puneeth-n
Copy link
Author

Thanks for the info. I changed the loader to baseloader and it did the trick.

@semenishchev
Copy link

on = true
off = false

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

No branches or pull requests

3 participants