Skip to content

Commit

Permalink
fix quokka-cli, following symlinks can cause infinite loop
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinDavid committed Jan 12, 2025
1 parent 1278e1f commit abccaf3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bindings/python/quokka/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ class Bcolors:


def recursive_file_iter(p: Path) -> Generator[Path, None, None]:
if p.is_file():
if p.is_file() and not p.is_symlink():
mime_type = magic.from_file(p, mime=True)
if mime_type not in BINARY_FORMAT and p.suffix not in EXTENSIONS_WHITELIST.get(
mime_type, []
):
pass
else:
yield p
elif p.is_dir():
elif p.is_dir() and not p.is_symlink():
for f in p.iterdir():
yield from recursive_file_iter(f)

Expand Down

0 comments on commit abccaf3

Please sign in to comment.