From cfeb9049f2f8c5cca64a99743b3dcfa9fb65e959 Mon Sep 17 00:00:00 2001 From: Konstantin Date: Fri, 2 Feb 2024 01:21:20 +0300 Subject: [PATCH] Fix non latin symbols decoding in adapters Signed-off-by: Konstantin --- src/py-opentimelineio/opentimelineio/adapters/adapter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/py-opentimelineio/opentimelineio/adapters/adapter.py b/src/py-opentimelineio/opentimelineio/adapters/adapter.py index d614b64a2..3da409828 100644 --- a/src/py-opentimelineio/opentimelineio/adapters/adapter.py +++ b/src/py-opentimelineio/opentimelineio/adapters/adapter.py @@ -105,7 +105,7 @@ def read_from_file( not self.has_feature("read_from_file") and self.has_feature("read_from_string") ): - with open(filepath) as fo: + with open(filepath, encoding="utf-8") as fo: contents = fo.read() result = self._execute_function( "read_from_string", @@ -181,7 +181,7 @@ def write_to_file( self.has_feature("write_to_string") ): result = self.write_to_string(input_otio, **adapter_argument_map) - with open(filepath, 'w') as fo: + with open(filepath, 'w', encoding="utf-8") as fo: fo.write(result) result = filepath