-
-
Notifications
You must be signed in to change notification settings - Fork 164
Failure to parse hexadecimal and octal numbers in YAML #525
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Discussion?
No
Describe the bug
Dasel 3.3.1 fails to parse hexadecimal and octal numbers in YAML.
To Reproduce
❯ dasel version
v3.3.1
❯ dasel -i yaml -o json <<<'0x10'
dasel: error: error reading input: yaml: unmarshal errors:
line 1: strconv.Atoi: parsing "0x10": invalid syntax
❯ dasel -i yaml -o json <<<'0o10'
dasel: error: error reading input: yaml: unmarshal errors:
line 1: strconv.Atoi: parsing "0o10": invalid syntaxNote: Though binary numbers and 0-prefixed octal numbers were abolished in YAML 1.2, those interpretation had changed in dasel v3.
❯ dasel -i yaml -o json <<<'0b10'
dasel: error: error reading input: yaml: unmarshal errors:
line 1: strconv.Atoi: parsing "0b10": invalid syntax
❯ dasel -i yaml -o json <<<'010'
10Expected behavior
dasel parses 0x.. and 0o.. into numbers.
❯ dasel -i yaml -o json <<<'0x10'
16
❯ dasel -i yaml -o json <<<'0o10'
8dasel 2.8.1 worked as expected.
❯ ASDF_DASEL_VERSION=2.8.1 dasel -r yaml -w json <<<'0x10'
16
❯ ASDF_DASEL_VERSION=2.8.1 dasel -r yaml -w json <<<'0o10'
8
❯ ASDF_DASEL_VERSION=2.8.1 dasel -r yaml -w json <<<'0b10'
2
❯ ASDF_DASEL_VERSION=2.8.1 dasel -r yaml -w json <<<'010'
8Desktop (please complete the following information):
- OS: macOS Tahoe 26.3
- Version: 3.3.1
Additional context
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working