bogus "found character '\t' that cannot start any token"
ruamel.yaml is a YAML 1.2 parser/emitter for Python
Brought to you by:
anthon
I have a yaml file with
variables:
OS: fedora:43
Trying to parse it with ruamel fails with
ruamel.yaml.scanner.ScannerError: while scanning for the next token
found character '\t' that cannot start any token
in "<unicode string>", line 1, column 6:
OS: fedora:43
^ (line: 1)
YAML 1.2 allows tabulators at this place (https://yaml.org/spec/1.2.2/#62-separation-spaces)
Based upon https://github.com/adrienverge/yamllint/issues/805
Short reproducer
from ruamel.yaml import YAML
yaml = YAML()
yaml.version = (1, 2)
yaml.load('key:\tvalue')