diff --git a/tuf/developer_tool.py b/tuf/developer_tool.py index 3e578b54fc..82d936c072 100755 --- a/tuf/developer_tool.py +++ b/tuf/developer_tool.py @@ -749,7 +749,7 @@ def _save_project_configuration(metadata_directory, targets_directory, project_config['public_keys'][key] = key_metadata # Save the actual file. - with open(project_filename, 'wt') as fp: + with open(project_filename, 'wt', encoding='utf8') as fp: json.dump(project_config, fp) diff --git a/tuf/unittest_toolbox.py b/tuf/unittest_toolbox.py index a248380d2c..063bec8df6 100755 --- a/tuf/unittest_toolbox.py +++ b/tuf/unittest_toolbox.py @@ -116,7 +116,7 @@ def _destroy_temp_file(): def make_temp_data_file(self, suffix='', directory=None, data = 'junk data'): """Returns an absolute path of a temp file containing data.""" temp_file_path = self.make_temp_file(suffix=suffix, directory=directory) - temp_file = open(temp_file_path, 'wt') + temp_file = open(temp_file_path, 'wt', encoding='utf8') temp_file.write(data) temp_file.close() return temp_file_path