_ls_from_cache: weird behavior regarding comparisons with trailing slash
See original GitHub issueIn 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
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (5 by maintainers)
https://github.com/intake/filesystem_spec/issues/562 is the discussion where I hope we can come to an agreement. I imagined the outcome to be a set of tests hosted in this repo, but run against all three object stores.
@martindurant is there a document for this (or issue for tracking writing this document)?