From 6121e64542f490d88ad1403f860babe1e6d77fc0 Mon Sep 17 00:00:00 2001 From: AleksZyro <178569539+AleksZyro@users.noreply.github.com> Date: Wed, 5 Aug 2026 21:33:24 +0200 Subject: [PATCH] Fix ls detail default --- sshfs/spec.py | 2 +- tests/test_sshfs.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sshfs/spec.py b/sshfs/spec.py index d3a8e05..f8f5940 100644 --- a/sshfs/spec.py +++ b/sshfs/spec.py @@ -265,7 +265,7 @@ async def _cp_file(self, lpath, rpath, **kwargs): await self._execute(cmd) @wrap_exceptions - async def _ls(self, path, detail=False, **kwargs): + async def _ls(self, path, detail=True, **kwargs): async with self._pool.get() as channel: file_attrs = await channel.readdir(path) diff --git a/tests/test_sshfs.py b/tests/test_sshfs.py index f571d7a..141baf7 100644 --- a/tests/test_sshfs.py +++ b/tests/test_sshfs.py @@ -136,7 +136,7 @@ def test_sftp_client_kwargs_path_encoding( (directory / "data.txt").write_bytes(b"data") encoded = str(directory).encode() - assert fs.ls(encoded) == [encoded + b"/data.txt"] + assert fs.ls(encoded, detail=False) == [encoded + b"/data.txt"] assert fs.cat_file(encoded + b"/data.txt") == b"data" @@ -247,9 +247,9 @@ def test_ls(fs, remote_dir): fs.touch(file) files.add(file) - assert set(fs.ls(remote_dir + "dir/")) == files + assert set(fs.ls(remote_dir + "dir/", detail=False)) == files - dirs = fs.ls(remote_dir + "dir/", detail=True) + dirs = fs.ls(remote_dir + "dir/") expected = [fs.info(file) for file in files] by_name = lambda details: details["name"]