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

Numbers separated by colon parse unpredictably #661

Closed
davetapley opened this issue Aug 20, 2022 · 3 comments
Closed

Numbers separated by colon parse unpredictably #661

davetapley opened this issue Aug 20, 2022 · 3 comments

Comments

@davetapley
Copy link

Repro here:

import yaml
good_yaml = '''
test:
  - 123:123
'''

good = yaml.safe_load(good_yaml)

print(good)

bad_yaml = '''
test:
  - 123:12
'''

bad = yaml.safe_load(bad_yaml)

print(bad)

Yields:

{'test': ['123:123']}
{'test': [7392]}
@davetapley davetapley changed the title Numbers separated by colon parses unpredictably Numbers separated by colon parse unpredictably Aug 20, 2022
@munendra-bandela-e3333
Copy link

munendra-bandela-e3333 commented Aug 21, 2022

Hi @davetapley,
I am new here. I would like to look into this.
While the parsed value looks unpredictable, it looks like an intentional parsing logic to me here

What is the desired output?

@perlpunk
Copy link
Member

duplicate of #68 #272 #371 #395
it's correct behavior and part of YAML 1.1

@perlpunk perlpunk closed this as not planned Won't fix, can't repro, duplicate, stale Aug 21, 2022
@davetapley
Copy link
Author

I thought it'd be something like that, searched for a good five minutes and didn't find any of those issues, thanks and sorry!

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