From e44606333c07237220c6d4faa39ef74ce3ef629a Mon Sep 17 00:00:00 2001 From: davemfish Date: Thu, 30 Jan 2025 13:50:14 -0800 Subject: [PATCH] always write files with uft8 encoding. #71 --- src/geometamaker/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/geometamaker/models.py b/src/geometamaker/models.py index b6e381b..b99175d 100644 --- a/src/geometamaker/models.py +++ b/src/geometamaker/models.py @@ -242,7 +242,7 @@ def write(self, target_path): target_path (str): path to a yaml file to be written """ - with open(target_path, 'w') as file: + with open(target_path, 'w', encoding='utf-8') as file: file.write(utils.yaml_dump(self.model_dump())) @@ -523,7 +523,7 @@ def write(self, workspace=None): target_path = os.path.join( workspace, os.path.basename(self.metadata_path)) - with open(target_path, 'w') as file: + with open(target_path, 'w', encoding='utf-8') as file: file.write(utils.yaml_dump( self.model_dump(exclude=['metadata_path'])))