Skip to content

Commit

Permalink
Merge pull request #8 from htmltiger/htmltiger-patch-1
Browse files Browse the repository at this point in the history
keep old file permission workaround
  • Loading branch information
htmltiger committed Apr 16, 2022
2 parents 5616917 + 74d9e6e commit 1bdf968
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion custom_components/config_editor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,12 @@ def drec(r, s):
except:
mode = 0o666
with AtomicWriter(fullpath, overwrite=True).open() as fdesc:
fdesc.write(content)
with open(fullpath, 'a') as fdesc:
try:
os.fchmod(fdesc.fileno(), mode)
except:
pass
fdesc.write(content)
except:
res = "Saving Failed"
_LOGGER.exception(res+": %s", fullpath)
Expand Down

0 comments on commit 1bdf968

Please sign in to comment.