1
0
mirror of https://github.com/home-assistant/core.git synced 2026-07-13 17:44:45 +01:00

Fix missing encoding with open() (#53593)

* Fix missing encoding with open()

* Fix tests

* Improve open - frontend
This commit is contained in:
Marc Mueller
2021-07-28 09:41:45 +02:00
committed by GitHub
parent 1c20eb3263
commit 10bfc78365
21 changed files with 49 additions and 39 deletions
@@ -139,7 +139,7 @@ def execute_script(hass, name, data=None):
"""Execute a script."""
filename = f"{name}.py"
raise_if_invalid_filename(filename)
with open(hass.config.path(FOLDER, filename)) as fil:
with open(hass.config.path(FOLDER, filename), encoding="utf8") as fil:
source = fil.read()
execute(hass, filename, source, data)