Plain equal sign (=) as node content results in an error

Issue #49 new
Sascha Egerer
created an issue

I currently have this bug but copied the bug report from the (6 year old!) old bugtracker.

A plain equal sign (=) as node fails as invalid YAML.


Load this document



A plain equal sign used as anything other than a key should be the String type (,2002:str).

The above document should result in this canonical document:

%YAML 1.1
!!str "="

With this node structure:

ScalarNode(tag=u',2002:str', value=u'=')

That is it should have been equivalent to this document:



Attempts to treat equal sign as the Value Key type (,2002:value) and throws this error:

The document is not valid YAML:
could not determine a constructor for the tag ',2002:value'
  in "", line 1, column 1:


Here's an example of equal sign correctly being treated as the Value Key type:

= : 1

Producing this canonical document and node:

%YAML 1.1
!!map {
    ? !!str "="
    : !!int "1",
MappingNode(tag=u',2002:map', value=[(ScalarNode(tag=u',2002:value', value=u'='),
 ScalarNode(tag=u',2002:int', value=u'1'))])

The document in STEPS TO REPRODUCE is the simplest document that fails, but these documents also fail:

- =
a: =

Comments (0)

  1. Log in to comment