Menu

#560 bogus "found character '\t' that cannot start any token"

open
nobody
None
minor
bug
2026-01-25
2026-01-25
No

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')

Discussion


Log in to post a comment.

MongoDB Logo MongoDB