YAML.jl icon indicating copy to clipboard operation
YAML.jl copied to clipboard

0-leaded int not parsed

Open nico202 opened this issue 7 years ago • 2 comments

All numbers starting with a leading "0" are parsed as octal. If the number is something like 0329 it fails to be parsed with ArgumentError since 9 is not in the possible range of values. I'd fall-back to a base-10 parse or to a string conversion. yamllint keeps them as-is (03 is 3, 011 is 9, 019 is 019)

nico202 avatar Nov 23 '17 14:11 nico202

Having 011 parse to 9 and 11 parse to 11 seems very confusing to me. Is there precedent for this behavior?

sglyon avatar Nov 24 '17 13:11 sglyon

python yaml:

yaml.safe_load("011") 9 yaml.safe_load("11") 11 yaml.safe_load("09") '09'

nico202 avatar Nov 24 '17 17:11 nico202