Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions gcsfs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -814,10 +814,10 @@ async def _info(self, path, **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:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if out0 and out0["name"][-1] != "/" and out0["size"] == 0:
if out0 and (out0["name"][-1] != "/" or out0["size"] == 0):

# exact hit
return out0[0]
return out0
elif out:
# other stuff - must be a directory
return {
Expand Down