mirror of
https://github.com/espressif/esp-idf.git
synced 2025-12-15 19:34:03 +00:00
feat(tools): Enforce utf-8 encoding with open() function
This commit is contained in:
@@ -481,7 +481,7 @@ def init_cli(verbose_output: Optional[List]=None) -> Any:
|
||||
# Otherwise, if we built any binaries print a message about
|
||||
# how to flash them
|
||||
def print_flashing_message(title: str, key: str) -> None:
|
||||
with open(os.path.join(args.build_dir, 'flasher_args.json')) as file:
|
||||
with open(os.path.join(args.build_dir, 'flasher_args.json'), encoding='utf-8') as file:
|
||||
flasher_args: Dict[str, Any] = json.load(file)
|
||||
|
||||
def flasher_path(f: Union[str, 'os.PathLike[str]']) -> str:
|
||||
@@ -789,7 +789,7 @@ def expand_file_arguments(argv: List[Any]) -> List[Any]:
|
||||
visited.add(rel_path)
|
||||
|
||||
try:
|
||||
with open(rel_path, 'r') as f:
|
||||
with open(rel_path, 'r', encoding='utf-8') as f:
|
||||
for line in f:
|
||||
expanded_args.extend(expand_args(shlex.split(line), os.path.dirname(rel_path), file_stack + [file_name]))
|
||||
except IOError:
|
||||
|
||||
Reference in New Issue
Block a user