I tried many combinations and the only one I can find that consistently produces the correct YAML output is:
yaml.safe_dump(data, file(filename,'w'), encoding='utf-8', allow_unicode=True)
I tried many combinations and the only one I can find that consistently produces the correct YAML output is:
yaml.safe_dump(data, file(filename,'w'), encoding='utf-8', allow_unicode=True)