-
Notifications
You must be signed in to change notification settings - Fork 229
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
[bug] Leading zero in string fields interpreted as octal #213
Comments
Thank you for reporting this. It seems to be how the current YAML parser is intended to work. It might change in the future, e.g. if deciding to use a parser supporting YAML version 1.2 - where the octal number prefix is changed to To avoid such problems, I recommend quoting strings that might be interpreted the wrong way, e.g. |
May I suggest putting a note about this in the docs in the mean while? |
Parsing a leading 0 as octal is pretty unintuitive IMHO, and manufacturers are notorious for having leading 0s in their part numbers, so I've opened #223 to discuss switching to a different YAML parser. I'd much rather have an intuitive solution (soon) than having to point to the docs and requiring quotation marks... Thanks for the heads up! |
Issue:
when using an
int
with a leading zero in thempn
or any other field, the number gets interpreted as an octal number.How to reproduce:
This
compiles into this
Note the different product numbers.
This is an issue that's very easy to miss and could result in the wrong part being selected.
Fixes could be to allow
int
andstr
for these fields, and make sure they get interpreted correctly, or to throw an error if anint
is input where astr
is expected.The text was updated successfully, but these errors were encountered: