mirror of
https://github.com/espressif/esp-idf.git
synced 2026-08-18 06:35:35 +03:00
feat(tools): Enforce utf-8 encoding with open() function
This commit is contained in:
@@ -21,7 +21,7 @@ def generate_token_data(hmac_key_file: str, output_file: Optional[str] = None) -
|
||||
with open(output_file, 'wb') as out_file:
|
||||
out_file.write(token_data)
|
||||
elif output_file.endswith('.hex'):
|
||||
with open(output_file, 'w') as out_file:
|
||||
with open(output_file, 'w', encoding='utf-8') as out_file:
|
||||
out_file.write(token_hex)
|
||||
else:
|
||||
print(f'Unsupported file format for output file: {output_file}')
|
||||
|
||||
@@ -11,7 +11,7 @@ from pytest_embedded_idf import IdfDut
|
||||
|
||||
|
||||
def run_gdb_test(dut: IdfDut) -> None:
|
||||
with open(os.path.join(dut.logdir, 'ocd.txt'), 'w') as ocd_log, \
|
||||
with open(os.path.join(dut.logdir, 'ocd.txt'), 'w', encoding='utf-8') as ocd_log, \
|
||||
pexpect.spawn(f'openocd -f board/esp32c6-builtin.cfg',
|
||||
timeout=60,
|
||||
logfile=ocd_log,
|
||||
|
||||
Reference in New Issue
Block a user