protecting against UnicodeDecodeError in yaml dump

yaml.dump()  was dying  with UnicodeDecodeError  when trying to
 serialize a python object which contained a string that was not in a in utf8