diff --git a/aioftp/client.py b/aioftp/client.py index 2e40e7e..0c3ec85 100644 --- a/aioftp/client.py +++ b/aioftp/client.py @@ -796,6 +796,9 @@ async def __anext__(cls): raise StopAsyncIteration name, info = cls.parse_line(line) + # skipping . and .. as these are symlinks in Unix + if str(name) in (".", ".."): + continue stat = cls.path / name, info if info["type"] == "dir" and recursive: cls.directories.append(stat) diff --git a/history.rst b/history.rst index d939d5c..aa0cb8d 100644 --- a/history.rst +++ b/history.rst @@ -1,5 +1,8 @@ x.x.x (xx-xx-xxxx) + +0.22.0 (xx-xx-xxxx) ------------------ +- client.list: fix infinite symlink loop for `.` and `..` on FTP servers with UNIX-like filesystem for `client.list(path, recursive=True)` 0.21.4 (13-10-2022) -------------------