mirror of
https://github.com/junkfix/config-editor.git
synced 2026-05-21 12:14:49 +02:00
handle chmod for windows
This commit is contained in:
parent
24b07092c6
commit
73d2055a20
|
|
@ -74,7 +74,10 @@ async def websocket_create(hass, connection, msg):
|
||||||
if not os.path.isdir(dirnm):
|
if not os.path.isdir(dirnm):
|
||||||
os.makedirs(dirnm, exist_ok=True)
|
os.makedirs(dirnm, exist_ok=True)
|
||||||
with AtomicWriter(fullpath, overwrite=True).open() as fdesc:
|
with AtomicWriter(fullpath, overwrite=True).open() as fdesc:
|
||||||
os.fchmod(fdesc.fileno(), 0o644)
|
try:
|
||||||
|
os.fchmod(fdesc.fileno(), 0o644)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
fdesc.write(content)
|
fdesc.write(content)
|
||||||
except:
|
except:
|
||||||
res = "Saving Failed"
|
res = "Saving Failed"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue