Skip to content

Commit

Permalink
do not output . and .. in client.list(*, recursive=True) as the…
Browse files Browse the repository at this point in the history
…se create symlink loop on all ftp servers with UNIX systems (#166)
  • Loading branch information
CrafterKolyan authored Jul 12, 2023
1 parent 2ac2d2d commit 9440a16
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions aioftp/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions history.rst
Original file line number Diff line number Diff line change
@@ -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)
-------------------
Expand Down

0 comments on commit 9440a16

Please sign in to comment.