Skip to content

Commit

Permalink
try to detect pseudo folder in _info
Browse files Browse the repository at this point in the history
  • Loading branch information
dynamix authored and VOvchinnikov committed May 22, 2024
1 parent ac38bf3 commit 7827d03
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gcsfs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -997,10 +997,10 @@ async def _info(self, path, generation=None, **kwargs):
pass
kwargs["detail"] = True # Force to true for info
out = await self._ls(path, **kwargs)
out0 = [o for o in out if o["name"].rstrip("/") == path]
if out0:
out0 = next((o for o in out if o["name"].rstrip("/") == path), None)
if out0 and out0["name"][-1] != "/" and out0["size"] == 0:
# exact hit
return out0[0]
return out0
elif out:
# other stuff - must be a directory
return {
Expand Down

0 comments on commit 7827d03

Please sign in to comment.