Closed conao3 closed 9 months ago
Numbers that fall into 0[0-7]+
must be quoted because they are interpreted as octal integers if written as they are, but 08 and 09 are interpreted as strings without quoting, so quoting is omitted.
-- This perspective is provided by @monaqa. Thanks.
The real problem is that 08
is recognized as an octal value and parsing is attempted as an octal value.
$ echo 'hour: 08' | yq .
yq: Error running jq: ValueError: invalid literal for int() with base 8: '08'.
pyyaml parses 08
as '08'
.
$ echo 'hour: 08' | python -c 'import yaml; print(yaml.safe_load(input()))'
{'hour': '08'}
So, this issue merges into #152.
Hi, I noticed the below behavior. Is it intended?
input file
Actual behavior
Output as json. This result is not strange.
Output as yaml, I don't know why, the only
'08'
and'09'
are outputted as08
,09
respectivelyAs a result, this output could not parse 'yq'.
Expected behaiver
Output
'08'
and'09'
are outputted as'08'
,'09'
respectively same as other examples.