Skip to content

Commit 99f836e

Browse files
author
Martin Gano
committed
Merge branch 'feature/fatfsparse-enable-automatic-detection-wl-lfn' into 'master'
fatfsparse.py: enable automatic detection of lfn Closes IDF-5622 See merge request espressif/esp-idf!20007
2 parents 3ffa2ad + 72acbeb commit 99f836e

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

components/fatfs/fatfsparse.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,8 @@ def traverse_folder_tree(directory_bytes_: bytes,
5555
try:
5656
obj_: dict = Entry.ENTRY_FORMAT_SHORT_NAME.parse(
5757
directory_bytes_[obj_address_: obj_address_ + FATDefaults.ENTRY_SIZE])
58-
except (construct.core.ConstError, UnicodeDecodeError) as e:
59-
if not args.long_name_support:
60-
raise e
58+
except (construct.core.ConstError, UnicodeDecodeError):
59+
args.long_name_support = True
6160
continue
6261

6362
if obj_['DIR_Attr'] == 0: # empty entry
@@ -90,7 +89,7 @@ def traverse_folder_tree(directory_bytes_: bytes,
9089
help='Path to the image that will be parsed and extracted.')
9190
argument_parser.add_argument('--long-name-support',
9291
action='store_true',
93-
help='Set flag to enable long names support.')
92+
help=argparse.SUPPRESS)
9493

9594
argument_parser.add_argument('--wear-leveling',
9695
action='store_true',

components/fatfs/test_fatfsgen/test_fatfsparse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ def test_e2e_very_deep_long(self) -> None:
320320
f'{os.path.join(os.path.dirname(__file__), "..", "fatfsgen.py")}',
321321
'testf', '--long_name_support'
322322
], stderr=STDOUT)
323-
run(['python', '../fatfsparse.py', 'fatfs_image.img', '--long-name-support'], stderr=STDOUT)
323+
run(['python', '../fatfsparse.py', 'fatfs_image.img'], stderr=STDOUT)
324324
assert compare_folders('testf', 'Espressif')
325325

326326

docs/en/api-reference/storage/fatfs.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,4 @@ It is a reverse tool of (:component_file:`fatfsgen.py<fatfs/fatfsgen.py>`), i.e.
144144

145145
Usage::
146146

147-
./fatfsparse.py [-h] [--long-name-support] [--wear-leveling] fatfs_image.img
147+
./fatfsparse.py [-h] [--wear-leveling] fatfs_image.img

docs/zh_CN/api-reference/storage/fatfs.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,4 @@ FatFs 分区分析器
144144

145145
您可以使用::
146146

147-
./fatfsparse.py [-h] [--long-name-support] [--wear-leveling] fatfs_image.img
147+
./fatfsparse.py [-h] [--wear-leveling] fatfs_image.img

0 commit comments

Comments
 (0)