Source

pyyaml / tests / data / serializer-is-not-opened-2.dumper-error

dumper = yaml.Dumper(StringIO.StringIO())
dumper.serialize(yaml.ScalarNode(tag='!foo', value='bar'))