kislyuk / yq

Command-line YAML, XML, TOML processor - jq wrapper for YAML/XML/TOML documents
https://kislyuk.github.io/yq/
Apache License 2.0
2.53k stars 81 forks source link

Strings that look like invalid octal numbers are stripped of quotes. #182

Closed basicbonobo closed 4 months ago

basicbonobo commented 4 months ago

This is probably fine in itself, but it makes yq not handle transcoding it back into JSON:

$ yq -y . <<<'{"hi": {"a": 2, "b": "4", "c": "06", "d": "08"}}'
hi:
  a: 2
  b: '4'
  c: '06'
  d: 08
$ yq -y . <<<'{"hi": {"a": 2, "b": "4", "c": "06", "d": "08"}}' | yq .
yq: Error running jq: ValueError: invalid literal for int() with base 8: '08'.
$ 
basicbonobo commented 4 months ago

Never mind, looks like this works fine with the latest version!