Config fix ()

pull/6271/head
Paulus Schoutsen 2017-02-26 15:28:12 -08:00 committed by GitHub
parent e2014eb153
commit d789de9ea2
1 changed files with 4 additions and 1 deletions
homeassistant/components/config

View File

@ -129,5 +129,8 @@ def _read(path):
def _write(path, data):
"""Write YAML helper."""
# Do it before opening file. If dump causes error it will now not
# truncate the file.
data = dump(data)
with open(path, 'w', encoding='utf-8') as outfile:
outfile.write(dump(data))
outfile.write(data)