kopia lustrzana https://github.com/espressif/esp-idf
fix fatfs_create_spiflash_image() feature (IDFGH-6383)
Open the files in binary mode, and remove the redundant encodepull/8169/head
rodzic
5624dffc52
commit
df2ae4689c
|
@ -167,7 +167,7 @@ class FATFS:
|
||||||
normal_path = os.path.normpath(folder_relative_path)
|
normal_path = os.path.normpath(folder_relative_path)
|
||||||
split_path = normal_path.split(os.sep)
|
split_path = normal_path.split(os.sep)
|
||||||
if os.path.isfile(real_path):
|
if os.path.isfile(real_path):
|
||||||
with open(real_path) as file:
|
with open(real_path, "rb") as file:
|
||||||
content = file.read()
|
content = file.read()
|
||||||
file_name, extension = os.path.splitext(split_path[-1])
|
file_name, extension = os.path.splitext(split_path[-1])
|
||||||
extension = extension[1:] # remove the dot from the extension
|
extension = extension[1:] # remove the dot from the extension
|
||||||
|
|
|
@ -47,7 +47,7 @@ class File:
|
||||||
# we assume that the correct amount of clusters is allocated
|
# we assume that the correct amount of clusters is allocated
|
||||||
current_cluster = self._first_cluster
|
current_cluster = self._first_cluster
|
||||||
for content_part in split_content_into_sectors(content, self.fatfs_state.sector_size):
|
for content_part in split_content_into_sectors(content, self.fatfs_state.sector_size):
|
||||||
content_as_list = content_part.encode()
|
content_as_list = content_part
|
||||||
if current_cluster is None:
|
if current_cluster is None:
|
||||||
raise FatalError('No free space left!')
|
raise FatalError('No free space left!')
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue