File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -259,7 +259,7 @@ class BnglModel(Model):
259259 def __init__ (
260260 self ,
261261 model : BnglEntities ,
262- model_id : str = None ,
262+ model_id : str | None = None ,
263263 rel_path : Path | str | None = None ,
264264 base_path : str | Path | None = None ,
265265 ):
@@ -280,7 +280,9 @@ def __init__(
280280
281281 @staticmethod
282282 def from_file (
283- filepath_or_buffer , model_id : str = None , base_path : str | Path = None
283+ filepath_or_buffer ,
284+ model_id : str | None = None ,
285+ base_path : str | Path | None = None ,
284286 ) -> BnglModel :
285287 path = Path (_generate_path (filepath_or_buffer , base_path ))
286288 text = path .read_text (encoding = "utf-8" , errors = "replace" )
@@ -293,7 +295,7 @@ def from_file(
293295
294296 def to_file (self , filename : str | Path | None = None ) -> None :
295297 target = filename or _generate_path (self .rel_path , self .base_path )
296- with open (target , "w" ) as f :
298+ with open (target , "w" , encoding = "utf-8" ) as f :
297299 f .write (self .model .text )
298300
299301 @property
You can’t perform that action at this time.
0 commit comments