mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Config fix (#6261)
This commit is contained in:
parent
e2014eb153
commit
d789de9ea2
@ -129,5 +129,8 @@ def _read(path):
|
|||||||
|
|
||||||
def _write(path, data):
|
def _write(path, data):
|
||||||
"""Write YAML helper."""
|
"""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:
|
with open(path, 'w', encoding='utf-8') as outfile:
|
||||||
outfile.write(dump(data))
|
outfile.write(data)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user