Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

block-size should be required on list command #119

Merged
merged 1 commit into from
Feb 12, 2025

Conversation

niggowai
Copy link
Contributor

When listing contents of a littlefs-binary, littlefs-python throws an error, when the block-size argument is not passed.

$ littlefs-python list fs.bin                                                                                    Mi 12 Feb 2025 06:38:19 CET
Traceback (most recent call last):
  File "/nix/store/71b4kzb409hl1p1a0p6kca0czd1nc4ds-python3.12-littlefs-python-0.13.1/bin/.littlefs-python-wrapped", line 9, in <module>
    sys.exit(main())
             ^^^^^^
  File "/nix/store/71b4kzb409hl1p1a0p6kca0czd1nc4ds-python3.12-littlefs-python-0.13.1/lib/python3.12/site-packages/littlefs/__main__.py", line 308, in main
    return args.func(parser, args)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/71b4kzb409hl1p1a0p6kca0czd1nc4ds-python3.12-littlefs-python-0.13.1/lib/python3.12/site-packages/littlefs/__main__.py", line 124, in _list
    fs = _fs_from_args(args, mount=False)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/71b4kzb409hl1p1a0p6kca0czd1nc4ds-python3.12-littlefs-python-0.13.1/lib/python3.12/site-packages/littlefs/__main__.py", line 19, in _fs_from_args
    return LittleFS(
           ^^^^^^^^^
  File "/nix/store/71b4kzb409hl1p1a0p6kca0czd1nc4ds-python3.12-littlefs-python-0.13.1/lib/python3.12/site-packages/littlefs/__init__.py", line 61, in __init__
    self.cfg = lfs.LFSConfig(context=context, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Argument 'block_size' has incorrect type (expected int, got NoneType)

Making the argument required should avoid confusion, especially if the argument is required on the other subcommands.

@niggowai niggowai marked this pull request as draft February 12, 2025 05:48
@niggowai niggowai marked this pull request as ready for review February 12, 2025 06:08
@BrianPugh BrianPugh merged commit 069ae46 into jrast:master Feb 12, 2025
15 checks passed
@BrianPugh
Copy link
Collaborator

Thank you! This is now in the release v0.13.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants