mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-08 04:02:27 +00:00
feat(tools): Enforce utf-8 encoding with open() function
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2020-2024 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# This program creates archives compatible with ESP32-S* ROM DFU implementation.
|
||||
@@ -9,9 +9,6 @@
|
||||
# as a separate file. In addition to that, a special index file, 'dfuinfo0.dat', is created.
|
||||
# This file must be the first one in the archive. It contains binary structures describing each
|
||||
# subsequent file (for example, where the file needs to be flashed/loaded).
|
||||
|
||||
from __future__ import print_function, unicode_literals
|
||||
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
@@ -308,7 +305,7 @@ def main(): # type: () -> None
|
||||
'''
|
||||
return check_file(os.path.relpath(os.path.join(json_dir, path), start=os.curdir))
|
||||
|
||||
with open(args.json) as f:
|
||||
with open(args.json, encoding='utf-8') as f:
|
||||
files += [(int(addr, 0),
|
||||
process_json_file(f_name)) for addr, f_name in json.load(f)['flash_files'].items()]
|
||||
|
||||
|
Reference in New Issue
Block a user