HassOS 3.12
component/python_script
python version 3.8.2
python operation open() required.
I’m trying to use a small python script to edit a file within HASS.IO and Home Assistant.
It appears the open() is missing from the python sandbox, can anyone confirm and if so can it please be added. As an example, running a test python script with the below from the ‘python_script.test’ service produces an error message (after creating a file ‘test.py’ in python_scripts with the below content)
‘’’
f = open(‘RoofStatusFile3.txt’, ‘a’)
f.close()
‘’’
error message:
Error executing script: name ‘open’ is not defined
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/components/python_script/init.py”, line 196, in execute
exec(compiled.code, restricted_globals)
File “test.py”, line 1, in
NameError: name ‘open’ is not defined
All advice appreciated.