From d0ddc28f96276edd80c9da425d57acbd0c98f276 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Wed, 26 Sep 2018 17:58:44 +0200 Subject: [PATCH] Revert file mode write_json (#16897) --- homeassistant/util/json.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/homeassistant/util/json.py b/homeassistant/util/json.py index 40f25689148..d6f7e149040 100644 --- a/homeassistant/util/json.py +++ b/homeassistant/util/json.py @@ -47,9 +47,7 @@ def save_json(filename: str, data: Union[List, Dict], """ try: json_data = json.dumps(data, sort_keys=True, indent=4) - mode = 0o600 if private else 0o644 - with open(os.open(filename, os.O_WRONLY | os.O_CREAT, mode), - 'w', encoding='utf-8') as fdesc: + with open(filename, 'w', encoding='utf-8') as fdesc: fdesc.write(json_data) except TypeError as error: _LOGGER.exception('Failed to serialize to JSON: %s',