@@ -433,7 +433,7 @@ def _remove_ignored_lib_includes(self) -> None:
433
433
self ._log_change ("BT/BLE protection enabled" )
434
434
435
435
try :
436
- with open (build_py_path , 'r' ) as f :
436
+ with open (build_py_path , 'r' , encoding = 'utf-8' ) as f :
437
437
content = f .read ()
438
438
439
439
original_content = content
@@ -480,7 +480,7 @@ def _remove_ignored_lib_includes(self) -> None:
480
480
481
481
# Validate and write changes
482
482
if self ._validate_changes (original_content , content ) and content != original_content :
483
- with open (build_py_path , 'w' ) as f :
483
+ with open (build_py_path , 'w' , encoding = 'utf-8' ) as f :
484
484
f .write (content )
485
485
self ._log_change (f"Updated build file ({ total_removed } total removals)" )
486
486
@@ -552,7 +552,7 @@ def _create_default_component_yml(self, file_path: str) -> None:
552
552
}
553
553
}
554
554
555
- with open (file_path , 'w' ) as f :
555
+ with open (file_path , 'w' , encoding = 'utf-8' ) as f :
556
556
yaml .dump (default_content , f )
557
557
558
558
def _load_component_yml (self , file_path : str ) -> Dict [str , Any ]:
@@ -566,7 +566,7 @@ def _load_component_yml(self, file_path: str) -> Dict[str, Any]:
566
566
Parsed YAML data
567
567
"""
568
568
try :
569
- with open (file_path , "r" ) as f :
569
+ with open (file_path , "r" , encoding = 'utf-8' ) as f :
570
570
return yaml .load (f , Loader = SafeLoader ) or {"dependencies" : {}}
571
571
except Exception :
572
572
return {"dependencies" : {}}
@@ -580,7 +580,7 @@ def _save_component_yml(self, file_path: str, data: Dict[str, Any]) -> None:
580
580
data: Data to save
581
581
"""
582
582
try :
583
- with open (file_path , "w" ) as f :
583
+ with open (file_path , "w" , encoding = 'utf-8' ) as f :
584
584
yaml .dump (data , f )
585
585
except Exception :
586
586
pass
@@ -698,7 +698,7 @@ def _remove_cpppath_entries(self) -> None:
698
698
return
699
699
700
700
try :
701
- with open (build_py_path , 'r' ) as f :
701
+ with open (build_py_path , 'r' , encoding = 'utf-8' ) as f :
702
702
content = f .read ()
703
703
704
704
original_content = content
@@ -715,7 +715,7 @@ def _remove_cpppath_entries(self) -> None:
715
715
content = re .sub (pattern , '' , content )
716
716
717
717
if content != original_content :
718
- with open (build_py_path , 'w' ) as f :
718
+ with open (build_py_path , 'w' , encoding = 'utf-8' ) as f :
719
719
f .write (content )
720
720
721
721
except Exception :
0 commit comments