feat(tools): Enforce utf-8 encoding with open() function

This commit is contained in:
Marek Fiala
2024-07-23 15:59:09 +02:00
committed by BOT
parent 305f1c1e5b
commit 2c814ef2fa
40 changed files with 115 additions and 124 deletions

View File

@@ -53,7 +53,7 @@ def action_extensions(base_actions: Dict, project_path: str) -> Dict:
desc_path = os.path.join(args.build_dir, 'project_description.json')
if not os.path.exists(desc_path):
ensure_build_directory(args, ctx.info_name)
with open(desc_path, 'r') as f:
with open(desc_path, 'r', encoding='utf-8') as f:
project_desc = json.load(f)
return project_desc
@@ -71,7 +71,7 @@ def action_extensions(base_actions: Dict, project_path: str) -> Dict:
result += ['-p', args.port]
result += ['-b', str(args.baud)]
with open(os.path.join(args.build_dir, 'flasher_args.json')) as f:
with open(os.path.join(args.build_dir, 'flasher_args.json'), encoding='utf-8') as f:
flasher_args = json.load(f)
extra_esptool_args = flasher_args['extra_esptool_args']