@@ -63,7 +63,7 @@ def checkpoint(
6363 file_path = _build_path (location , branch , parent_id )
6464 file_path .parent .mkdir (parents = True , exist_ok = True )
6565
66- with open (file_path , "w" ) as f :
66+ with open (file_path , "w" , encoding = "utf-8" ) as f :
6767 f .write (data )
6868 return str (file_path )
6969
@@ -91,7 +91,7 @@ async def acheckpoint(
9191 file_path = _build_path (location , branch , parent_id )
9292 await aiofiles .os .makedirs (str (file_path .parent ), exist_ok = True )
9393
94- async with aiofiles .open (file_path , "w" ) as f :
94+ async with aiofiles .open (file_path , "w" , encoding = "utf-8" ) as f :
9595 await f .write (data )
9696 return str (file_path )
9797
@@ -129,7 +129,7 @@ def from_checkpoint(self, location: str) -> str:
129129 Returns:
130130 The raw JSON string.
131131 """
132- return Path (location ).read_text ()
132+ return Path (location ).read_text (encoding = "utf-8" )
133133
134134 async def afrom_checkpoint (self , location : str ) -> str :
135135 """Read a JSON checkpoint file asynchronously.
@@ -140,7 +140,7 @@ async def afrom_checkpoint(self, location: str) -> str:
140140 Returns:
141141 The raw JSON string.
142142 """
143- async with aiofiles .open (location ) as f :
143+ async with aiofiles .open (location , encoding = "utf-8" ) as f :
144144 return await f .read ()
145145
146146
0 commit comments