The code at https://github.com/yaml/pyyaml/blob/master/lib/yaml/emitter.py#L614 does not appear to be py3 compatible, giving errors like TypeError: ord() expected string of length 1, but int found when called on a string containing an extended character like "<".