Fix missing encoding with open() (#53593)
* Fix missing encoding with open() * Fix tests * Improve open - frontend
This commit is contained in:
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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue