Skip to content

Commit

Permalink
chore(ruff): PTH207 Replace iglob with Path.glob or Path.rglob
Browse files Browse the repository at this point in the history
The trivial rewrite fails with this issue:

    /nix/store/jhflvwr40xbb0xr6jx4311icp9cym1fp-python3-3.10.12/lib/python3.10/pathlib.py:476: in _iterate_directories
        entry_is_dir = entry.is_dir()
    E   OSError: [Errno 36] File name too long: '/home/vlaci/devel/git/github.com/onekey-sec/unblob/tests/integration/filesystem/extfs/__output__/f_badsymlinks.img_extract/long_link'
  • Loading branch information
vlaci committed Sep 20, 2023
1 parent 5e205d5 commit d3916db
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion unblob/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ def configure_logging(tmp_path_factory): # noqa: PT004


def gather_integration_tests(test_data_path: Path):
# Path.glob() trips on some invalid files
test_input_dirs = [
Path(p) for p in glob.iglob(f"{test_data_path}/**/__input__", recursive=True)
Path(p)
for p in glob.iglob( # noqa: PTH207
f"{test_data_path}/**/__input__", recursive=True
)
]
test_case_dirs = [p.parent for p in test_input_dirs]
test_output_dirs = [p / "__output__" for p in test_case_dirs]
Expand Down

0 comments on commit d3916db

Please sign in to comment.