Description
In this example, the path is stripped only for the contain check. When dircache contains the normalized version (a/b
) but not a/b/
it will throw a KeyError
though it probably shouldn't since this is what that check appears to be stand for. Another case is right below that code that compares the normalized version with the obtained one from the cache, which might not be normalized. So I was wondering whether this is intentional or should we use .rstrip()
in both of the cases (self.dircache[path.rstrip('/')]
, f["name"].rstrip("/") == path.rstrip("/")
)
https://github.com/intake/filesystem_spec/blob/6ee47aa6c10868c383be5cb13837f2a26a099f5d/fsspec/spec.py#L342-L343
https://github.com/intake/filesystem_spec/blob/6ee47aa6c10868c383be5cb13837f2a26a099f5d/fsspec/spec.py#L349