From 9eb9220ca900e49866c63d6d890e19bc2a6d462a Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sat, 11 Aug 2018 17:57:19 -0700 Subject: [PATCH] Read and write the config file as UTF-8. --- etiquette/photodb.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etiquette/photodb.py b/etiquette/photodb.py index ce78490..00d5bfa 100644 --- a/etiquette/photodb.py +++ b/etiquette/photodb.py @@ -1528,7 +1528,7 @@ class PhotoDB( user_config_exists = self.config_filepath.is_file needs_dump = False if user_config_exists: - with open(self.config_filepath.absolute_path, 'r') as handle: + with open(self.config_filepath.absolute_path, 'r', encoding='utf-8') as handle: user_config = json.load(handle) my_keys = helpers.recursive_dict_keys(config) stored_keys = helpers.recursive_dict_keys(user_config) @@ -1545,7 +1545,7 @@ class PhotoDB( return config def save_config(self): - with open(self.config_filepath.absolute_path, 'w') as handle: + with open(self.config_filepath.absolute_path, 'w', encoding='utf-8') as handle: handle.write(json.dumps(self.config, indent=4, sort_keys=True))