Repository: fsspec/filesystem_spec

Issue:
FileNotFoundError [LocalFileSystem] on unix-like root / directory 
Hello,

in case of `LocalFileSystem().ls('/')`, a `FileNotFoundError` is being raised. 

```python
FileNotFoundError: [Errno 2] No such file or directory: ''
```

This looks quite normal as path is stripped right 
https://github.com/fsspec/filesystem_spec/blob/b68be6c57f54a71c6ffc89e669c410da353ebc1f/fsspec/implementations/local.py#L54

Is this an expected behavior?

Discussion:

Patch:
diff --git a/ci/environment-win.yml b/ci/environment-win.yml
index 7e847e7..af9671e 100644
--- a/ci/environment-win.yml
+++ b/ci/environment-win.yml
@@ -8,7 +8,7 @@ dependencies:
   - requests
   - zstandard
   - python-snappy
-  - lz4
+  - lz4<3.1.3
   - pyftpdlib
   - cloudpickle
   - pytest
diff --git a/fsspec/asyn.py b/fsspec/asyn.py
index f12fe67..0432331 100644
--- a/fsspec/asyn.py
+++ b/fsspec/asyn.py
@@ -238,13 +238,10 @@ async def _run_coros_in_chunks(
             asyncio.Task(asyncio.wait_for(c, timeout=timeout))
             for c in coros[start : start + batch_size]
         ]
-        if callback is not _DEFAULT_CALLBACK:
-            [
-                t.add_done_callback(
-                    lambda *_, **__: callback.call("relative_update", 1)
-                )
-                for t in chunk
-            ]
+        [
+            t.add_done_callback(lambda: callback.call("relative_update", 1))
+            for t in chunk
+        ]
         results.extend(
             await asyncio.gather(*chunk, return_exceptions=return_exceptions),
         )
diff --git a/fsspec/implementations/http.py b/fsspec/implementations/http.py
index a64942e..89f0718 100644
--- a/fsspec/implementations/http.py
+++ b/fsspec/implementations/http.py
@@ -29,6 +29,14 @@ async def get_client(**kwargs):
     return aiohttp.ClientSession(**kwargs)
 
 
+class BlockSizeError(ValueError):
+    """
+    Helper class for exceptions raised in this module.
+    """
+
+    pass
+
+
 class HTTPFileSystem(AsyncFileSystem):
     """
     Simple File-System for fetching data via HTTP(S)
@@ -606,22 +614,33 @@ class HTTPFile(AbstractBufferedFile):
             if r.status == 206:
                 # partial content, as expected
                 out = await r.read()
-            elif int(r.headers.get("Content-Length", 0)) <= end - start:
-                out = await r.read()
+            elif "Content-Length" in r.headers:
+                cl = int(r.headers["Content-Length"])
+                if cl <= end - start:
+                    # data size OK
+                    out = await r.read()
+                else:
+                    raise BlockSizeError(
+                        "Got more bytes so far (>%i) than requested (%i)"
+                        % (cl, end - start)
+                    )
             else:
                 cl = 0
                 out = []
                 while True:
                     chunk = await r.content.read(2 ** 20)
-                    # data size unknown, let's read until we have enough
+                    # data size unknown, let's see if it goes too big
                     if chunk:
                         out.append(chunk)
                         cl += len(chunk)
                         if cl > end - start:
-                            break
+                            raise BlockSizeError(
+                                "Got more bytes so far (>%i) than requested (%i)"
+                                % (cl, end - start)
+                            )
                     else:
                         break
-                out = b"".join(out)[: end - start]
+                out = b"".join(out)
             return out
 
     _fetch_range = sync_wrapper(async_fetch_range)
diff --git a/fsspec/implementations/local.py b/fsspec/implementations/local.py
index 16eda94..51f86d3 100644
--- a/fsspec/implementations/local.py
+++ b/fsspec/implementations/local.py
@@ -184,7 +184,7 @@ class LocalFileSystem(AbstractFileSystem):
         path = stringify_path(path)
         if path.startswith("file://"):
             path = path[7:]
-        return make_path_posix(path).rstrip("/")
+        return make_path_posix(path).rstrip("/") or cls.root_marker
 
     def _isfilestore(self):
         # Inheriting from DaskFileSystem makes this False (S3, etc. were)


Test patch:
diff --git a/fsspec/implementations/tests/test_local.py b/fsspec/implementations/tests/test_local.py
index 2779018..f3bbad8 100644
--- a/fsspec/implementations/tests/test_local.py
+++ b/fsspec/implementations/tests/test_local.py
@@ -370,6 +370,7 @@ def test_directories(tmpdir):
     assert fs.ls(tmpdir, True)[0]["type"] == "directory"
     fs.rmdir(tmpdir + "/dir")
     assert not fs.ls(tmpdir)
+    assert fs.ls(fs.root_marker)
 
 
 def test_file_ops(tmpdir):