We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Weird bug that I'm trying to sort out. A small demonstration:
>>> items = [f"{k:02d}" for k in range(1, 12)] >>> print(items) ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11'] >>> print(yaml.dump(items) - '01' - '02' - '03' - '04' - '05' - '06' - '07' - 08 - 09 - '10' - '11'
This occurs
dump(items, Dumper=yaml.Dumper)
dump(items, Dumper=yaml.CDumper)
>>> fmts = ["{:0%id}"%k for k in range(1, 6)] >>> print(yaml.dump([f.format(7) for f in fmts])) - '7' - '07' - '007' - '0007' - '00007' >>> print(yaml.dump([f.format(9) for f in fmts])) - '9' - 09 - 009 - 0009 - 00009 >>> print(yaml.dump([f"{k}09" for k in range(10)])) - 009 - '109' - '209' - '309' - '409' - '509' - '609' - '709' - '809' - '909'
While adding default_style="'" to the dump helps resolve these values, it adds that styling to everything which is not desired.
default_style="'"
Any suggestions?
The text was updated successfully, but these errors were encountered:
It's not a bug. please see #486 Scalars starting with a zero are parsed as octal values in YAML 1.1 https://perlpunk.github.io/yaml-test-schema/schemas.html
Sorry, something went wrong.
No branches or pull requests
Weird bug that I'm trying to sort out. A small demonstration:
This occurs
dump(items, Dumper=yaml.Dumper)
anddump(items, Dumper=yaml.CDumper)
.While adding
default_style="'"
to the dump helps resolve these values, it adds that styling to everything which is not desired.Any suggestions?
The text was updated successfully, but these errors were encountered: